<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd" component="Magento_Catalog/js/components/new-attribute-form">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">product_attribute_add_form.product_attribute_add_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">New Attribute</item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
        <item name="childrenFromMeta" xsi:type="boolean">true</item>
        <item name="config" xsi:type="array">
            <item name="newSetPromptMessage" translate="true" xsi:type="string">Enter Name for New Attribute Set</item>
        </item>
    </argument>
    <settings>
        <buttons>
            <button name="save" class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Button\Save"/>
            <button name="saveInNewSet" class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Button\SaveInNewAttributeSet"/>
            <button name="cancel" class="Magento\Catalog\Block\Adminhtml\Product\Attribute\Button\Cancel"/>
        </buttons>
        <namespace>product_attribute_add_form</namespace>
        <ajaxSave>true</ajaxSave>
        <ajaxSaveType>simple</ajaxSaveType>
        <dataScope>data</dataScope>
        <deps>
            <dep>product_attribute_add_form.product_attribute_add_form_data_source</dep>
        </deps>
    </settings>
    <dataSource name="product_attribute_add_form_data_source">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
        <settings>
            <validateUrl path="catalog/product_attribute/validate"/>
            <submitUrl path="catalog/product_attribute/save"/>
        </settings>
        <dataProvider class="Magento\Catalog\Model\Product\Attribute\DataProvider" name="product_attribute_add_form_data_source">
            <settings>
                <requestFieldName>id</requestFieldName>
                <primaryFieldName>attribute_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>
    <fieldset name="base_fieldset" sortOrder="10">
        <settings>
            <collapsible>false</collapsible>
            <label translate="true">Attribute Properties</label>
        </settings>
        <field name="frontend_label[0]" sortOrder="10" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">product_attribute</item>
                </item>
            </argument>
            <settings>
                <required>true</required>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <dataType>string</dataType>
                <label translate="true">Attribute Label</label>
            </settings>
        </field>
        <field name="frontend_input" sortOrder="20" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="hints" xsi:type="array">
                        <item name="texteditor" xsi:type="string" translate="true">Text Editor input type requires WYSIWYG to be enabled in Stores > Configuration > Content Management.</item>
                    </item>
                    <item name="source" xsi:type="string">product_attribute</item>
                </item>
            </argument>
            <settings>
                <dataType>string</dataType>
                <label translate="true">Catalog Input Type for Store Owner</label>
                <dataScope>frontend_input</dataScope>
                <elementTmpl>Magento_Catalog/form/element/frontend-input-select</elementTmpl>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Magento\Catalog\Model\Product\Attribute\Source\Inputtype"/>
                    </settings>
                </select>
            </formElements>
        </field>
        <field name="is_required" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="30" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">product_attribute</item>
                    <item name="default" xsi:type="number">0</item>
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                        <item name="textarea" xsi:type="string">textarea</item>
                        <item name="texteditor" xsi:type="string">texteditor</item>
                        <item name="date" xsi:type="string">date</item>
                        <item name="boolean" xsi:type="string">boolean</item>
                        <item name="multiselect" xsi:type="string">multiselect</item>
                        <item name="select" xsi:type="string">select</item>
                        <item name="price" xsi:type="string">price</item>
                    </item>
                </item>
            </argument>
            <settings>
                <label translate="true">Required</label>
                <dataScope>is_required</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <options class="Magento\Config\Model\Config\Source\Yesno"/>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
    </fieldset>
    <fieldset name="attribute_options_select_container" component="Magento_Catalog/js/components/visible-on-option/fieldset" sortOrder="15">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="valuesForOptions" xsi:type="array">
                    <item name="select" xsi:type="string">select</item>
                </item>
            </item>
        </argument>
        <settings>
            <collapsible>true</collapsible>
            <label translate="true">Values</label>
        </settings>
        <dynamicRows name="attribute_options_select">
            <settings>
                <addButtonLabel translate="true">Add Value</addButtonLabel>
                <additionalClasses>
                    <class name="admin__field-wide">true</class>
                </additionalClasses>
                <componentType>dynamicRows</componentType>
            </settings>
            <container name="record" component="Magento_Ui/js/dynamic-rows/record">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="isTemplate" xsi:type="boolean">true</item>
                        <item name="is_collection" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">container</item>
                    </item>
                </argument>
                <field name="is_default" component="Magento_Catalog/js/form/element/checkbox" sortOrder="0" formElement="checkbox">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="prefixElementName" xsi:type="string">option_</item>
                            <item name="inputCheckBoxName" xsi:type="string">default.</item>
                            <item name="columnsHeaderClasses" xsi:type="string">control-table-options-th</item>
                            <item name="modules" xsi:type="array">
                                <item name="rows" xsi:type="string">ns = ${ $.ns }, index = attribute_options_select</item>
                            </item>
                        </item>
                    </argument>
                    <settings>
                        <additionalClasses>
                            <class name="control-table-options-cell">true</class>
                        </additionalClasses>
                        <dataType>boolean</dataType>
                        <label translate="true">Is Default</label>
                    </settings>
                    <formElements>
                        <checkbox>
                            <settings>
                                <prefer>radio</prefer>
                            </settings>
                        </checkbox>
                    </formElements>
                </field>
                <field name="position" component="Magento_Catalog/js/form/element/input" formElement="input">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="prefixName" xsi:type="string">option.order</item>
                            <item name="prefixElementName" xsi:type="string">option_</item>
                        </item>
                    </argument>
                    <settings>
                        <dataType>text</dataType>
                        <visible>false</visible>
                    </settings>
                </field>
            </container>
        </dynamicRows>
    </fieldset>
    <fieldset name="attribute_options_multiselect_container" component="Magento_Catalog/js/components/visible-on-option/fieldset" sortOrder="15">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="valuesForOptions" xsi:type="array">
                    <item name="multiselect" xsi:type="string">multiselect</item>
                </item>
            </item>
        </argument>
        <settings>
            <collapsible>true</collapsible>
            <label translate="true">Values</label>
        </settings>
        <dynamicRows name="attribute_options_multiselect">
            <settings>
                <addButtonLabel translate="true">Add Value</addButtonLabel>
                <additionalClasses>
                    <class name="admin__field-wide">true</class>
                </additionalClasses>
                <componentType>dynamicRows</componentType>
            </settings>
            <container name="record" component="Magento_Ui/js/dynamic-rows/record">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="isTemplate" xsi:type="boolean">true</item>
                        <item name="is_collection" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">container</item>
                        <item name="positionProvider" xsi:type="string">attribute_options.position</item>
                    </item>
                </argument>
                <field name="is_default" component="Magento_Catalog/js/form/element/checkbox" sortOrder="0" formElement="checkbox">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="prefixElementName" xsi:type="string">option_</item>
                            <item name="inputCheckBoxName" xsi:type="string">default</item>
                            <item name="isMultiple" xsi:type="boolean">true</item>
                            <item name="value" xsi:type="string">1</item>
                            <item name="columnsHeaderClasses" xsi:type="string">control-table-options-th</item>
                            <item name="modules" xsi:type="array">
                                <item name="rows" xsi:type="string">ns = ${ $.ns }, index = attribute_options_multiselect</item>
                            </item>
                        </item>
                    </argument>
                    <settings>
                        <additionalClasses>
                            <class name="control-table-options-cell">true</class>
                        </additionalClasses>
                        <dataType>boolean</dataType>
                        <label translate="true">Is Default</label>
                    </settings>
                </field>
                <field name="position" component="Magento_Catalog/js/form/element/input" formElement="input">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="prefixName" xsi:type="string">option.order</item>
                            <item name="prefixElementName" xsi:type="string">option_</item>
                        </item>
                    </argument>
                    <settings>
                        <additionalClasses>
                            <class name="_hidden">true</class>
                        </additionalClasses>
                        <dataType>text</dataType>
                        <visible>false</visible>
                        <dataScope>position</dataScope>
                    </settings>
                </field>
            </container>
        </dynamicRows>
    </fieldset>
    <fieldset name="advanced_fieldset" sortOrder="20">
        <settings>
            <collapsible>true</collapsible>
            <label translate="true">Advanced Attribute Properties</label>
        </settings>
        <field name="attribute_code" sortOrder="10" formElement="input">
            <settings>
                <validation>
                    <rule name="validate-code" xsi:type="boolean">true</rule>
                </validation>
                <dataType>string</dataType>
                <label translate="true">Attribute Code</label>
                <dataScope>attribute_code</dataScope>
            </settings>
        </field>
        <field name="is_global" component="Magento_Catalog/js/components/visible-on-option/select" sortOrder="20" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                        <item name="textarea" xsi:type="string">textarea</item>
                        <item name="texteditor" xsi:type="string">texteditor</item>
                        <item name="date" xsi:type="string">date</item>
                        <item name="boolean" xsi:type="string">boolean</item>
                        <item name="multiselect" xsi:type="string">multiselect</item>
                        <item name="select" xsi:type="string">select</item>
                        <item name="media_image" xsi:type="string">media_image</item>
                    </item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Declare attribute value saving scope.</notice>
                <dataType>string</dataType>
                <label translate="true">Scope</label>
                <dataScope>is_global</dataScope>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Magento\Catalog\Model\Attribute\Source\Scopes"/>
                    </settings>
                </select>
            </formElements>
        </field>
        <field name="default_value_text" component="Magento_Catalog/js/components/visible-on-option/input" sortOrder="30" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                    </item>
                </item>
            </argument>
            <settings>
                <dataType>string</dataType>
                <label translate="true">Default Value</label>
                <dataScope>default_value_text</dataScope>
            </settings>
        </field>
        <field name="default_value_textarea" component="Magento_Catalog/js/components/visible-on-option/textarea" sortOrder="30" formElement="textarea">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="textarea" xsi:type="string">textarea</item>
                    </item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
                <label translate="true">Default Value</label>
                <dataScope>default_value_textarea</dataScope>
            </settings>
        </field>
        <field name="default_value_yesno" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="30" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="boolean" xsi:type="string">boolean</item>
                    </item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Default Value</label>
                <dataScope>default_value_yesno</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="default_value_date" component="Magento_Catalog/js/components/visible-on-option/date" sortOrder="30" formElement="date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="date" xsi:type="string">date</item>
                    </item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
                <label translate="true">Default Value</label>
                <dataScope>default_value_date</dataScope>
            </settings>
        </field>
        <field name="is_unique" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="40" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="media_image" xsi:type="string">media_image</item>
                    </item>
                    <item name="inverseVisibility" xsi:type="boolean">true</item>
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Not shared with other products.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Unique Value</label>
                <dataScope>is_unique</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="frontend_class" component="Magento_Catalog/js/components/disable-hide-select" sortOrder="50" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                        <item name="textarea" xsi:type="string">textarea</item>
                        <item name="texteditor" xsi:type="string">texteditor</item>
                        <item name="date" xsi:type="string">date</item>
                        <item name="boolean" xsi:type="string">boolean</item>
                        <item name="multiselect" xsi:type="string">multiselect</item>
                        <item name="select" xsi:type="string">select</item>
                        <item name="price" xsi:type="string">price</item>
                    </item>
                    <item name="valuesForEnable" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                    </item>
                </item>
            </argument>
            <settings>
                <dataType>string</dataType>
                <label translate="true">Input Validation for Store Owner</label>
                <dataScope>frontend_class</dataScope>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Magento\Eav\Model\Adminhtml\Attribute\Validation\Rules\Options"/>
                    </settings>
                </select>
            </formElements>
        </field>
        <field name="is_used_in_grid" sortOrder="60" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Add this attribute to the list of column options in the product grid.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Add to Column Options</label>
                <dataScope>is_used_in_grid</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="is_visible_in_grid" formElement="hidden">
            <settings>
                <dataType>string</dataType>
                <dataScope>is_visible_in_grid</dataScope>
            </settings>
        </field>
        <field name="is_filterable_in_grid" sortOrder="70" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Add this attribute to the list of filter options in the product grid.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Use in Filter Options</label>
                <dataScope>is_filterable_in_grid</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
    </fieldset>
    <fieldset name="manage-titles" sortOrder="25">
        <settings>
            <collapsible>true</collapsible>
            <label translate="true">Manage Titles (Size, Color, etc.)</label>
        </settings>
    </fieldset>
    <fieldset name="front_fieldset" component="Magento_Catalog/js/components/visible-on-option/fieldset" sortOrder="30">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="valuesForOptions" xsi:type="array">
                    <item name="media_image" xsi:type="string">media_image</item>
                </item>
                <item name="openOnShow" xsi:type="boolean">false</item>
                <item name="inverseVisibility" xsi:type="boolean">true</item>
            </item>
        </argument>
        <settings>
            <collapsible>true</collapsible>
            <label translate="true">Storefront Properties</label>
        </settings>
        <field name="is_searchable" sortOrder="10" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Use in Search</label>
                <dataScope>is_searchable</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="is_visible_in_advanced_search" sortOrder="20" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Visible in Advanced Search</label>
                <dataScope>is_visible_in_advanced_search</dataScope>
                <imports>
                    <link name="visible">${ $.parentName}.is_searchable:checked</link>
                </imports>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="is_comparable" sortOrder="30" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Comparable on Storefront</label>
                <dataScope>is_comparable</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <!--TODO: Add 3 fields from other modules-->
        <field name="is_used_for_promo_rules" sortOrder="70" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Use for Promo Rule Conditions</label>
                <dataScope>is_used_for_promo_rules</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="is_html_allowed_on_front" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="80" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="valuesForOptions" xsi:type="array">
                        <item name="text" xsi:type="string">text</item>
                        <item name="multiselect" xsi:type="string">multiselect</item>
                        <item name="select" xsi:type="string">select</item>
                    </item>
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Allow HTML Tags on Storefront</label>
                <dataScope>is_html_allowed_on_front</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="is_visible_on_front" sortOrder="100" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <dataType>boolean</dataType>
                <label translate="true">Visible on Catalog Pages on Storefront</label>
                <dataScope>is_visible_on_front</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="used_in_product_listing" sortOrder="110" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Depends on design theme.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Used in Product Listing</label>
                <dataScope>used_in_product_listing</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
        <field name="used_for_sort_by" sortOrder="120" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Depends on design theme.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Used for Sorting in Product Listing</label>
                <dataScope>used_for_sort_by</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
    </fieldset>
</form>
