|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd" extends="pagebuilder_base_form"> |
| 10 | + <argument name="data" xsi:type="array"> |
| 11 | + <item name="js_config" xsi:type="array"> |
| 12 | + <item name="provider" xsi:type="string">pagebuilder_products_carousel_form.pagebuilder_products_carousel_form_data_source</item> |
| 13 | + </item> |
| 14 | + <item name="label" xsi:type="string" translate="true">Products</item> |
| 15 | + </argument> |
| 16 | + <settings> |
| 17 | + <deps> |
| 18 | + <dep>pagebuilder_products_carousel_form.pagebuilder_products_carousel_form_data_source</dep> |
| 19 | + </deps> |
| 20 | + <namespace>pagebuilder_products_carousel_form</namespace> |
| 21 | + </settings> |
| 22 | + <dataSource name="pagebuilder_products_carousel_form_data_source"> |
| 23 | + <argument name="data" xsi:type="array"> |
| 24 | + <item name="js_config" xsi:type="array"> |
| 25 | + <item name="component" xsi:type="string">Magento_PageBuilder/js/content-type/products/form/provider</item> |
| 26 | + </item> |
| 27 | + </argument> |
| 28 | + <dataProvider name="pagebuilder_products_carousel_form_data_source" class="Magento\PageBuilder\Model\ContentType\DataProvider"> |
| 29 | + <settings> |
| 30 | + <requestFieldName/> |
| 31 | + <primaryFieldName/> |
| 32 | + </settings> |
| 33 | + </dataProvider> |
| 34 | + </dataSource> |
| 35 | + <fieldset name="appearance_fieldset" sortOrder="10" component="Magento_PageBuilder/js/form/element/dependent-fieldset"> |
| 36 | + <settings> |
| 37 | + <label translate="true">Appearance</label> |
| 38 | + <additionalClasses> |
| 39 | + <class name="admin__fieldset-visual-select-large">true</class> |
| 40 | + </additionalClasses> |
| 41 | + <collapsible>false</collapsible> |
| 42 | + <opened>true</opened> |
| 43 | + <imports> |
| 44 | + <link name="hideFieldset">${$.name}.appearance:options</link> |
| 45 | + <link name="hideLabel">${$.name}.appearance:options</link> |
| 46 | + </imports> |
| 47 | + </settings> |
| 48 | + <field name="appearance" formElement="select" sortOrder="10" component="Magento_PageBuilder/js/form/element/dependent-visual-select"> |
| 49 | + <argument name="data" xsi:type="array"> |
| 50 | + <item name="config" xsi:type="array"> |
| 51 | + <item name="default" xsi:type="string">carousel</item> |
| 52 | + </item> |
| 53 | + </argument> |
| 54 | + <settings> |
| 55 | + <additionalClasses> |
| 56 | + <class name="admin__field-wide">true</class> |
| 57 | + <class name="admin__field-visual-select-container">true</class> |
| 58 | + </additionalClasses> |
| 59 | + <dataType>text</dataType> |
| 60 | + <validation> |
| 61 | + <rule name="required-entry" xsi:type="boolean">true</rule> |
| 62 | + </validation> |
| 63 | + <elementTmpl>Magento_PageBuilder/form/element/visual-select</elementTmpl> |
| 64 | + </settings> |
| 65 | + <formElements> |
| 66 | + <select> |
| 67 | + <settings> |
| 68 | + <options class="AppearanceSourceProducts" /> |
| 69 | + </settings> |
| 70 | + </select> |
| 71 | + </formElements> |
| 72 | + </field> |
| 73 | + </fieldset> |
| 74 | + <fieldset name="general" sortOrder="20"> |
| 75 | + <settings> |
| 76 | + <label /> |
| 77 | + </settings> |
| 78 | + <field name="condition_option" sortOrder="0" formElement="select" component="Magento_PageBuilder/js/form/element/condition-options"> |
| 79 | + <settings> |
| 80 | + <dataType>text</dataType> |
| 81 | + <label translate="true">Select Products By</label> |
| 82 | + <elementTmpl>Magento_PageBuilder/form/element/visual-select</elementTmpl> |
| 83 | + <exports> |
| 84 | + <link name="category_idsVisible">${$.parentName}.category_ids:visible</link> |
| 85 | + <link name="conditionVisible">${$.parentName}.conditions_form:visible</link> |
| 86 | + <link name="value">${$.parentName}.sort_order:filter</link> |
| 87 | + </exports> |
| 88 | + <dataScope>condition_option</dataScope> |
| 89 | + </settings> |
| 90 | + <formElements> |
| 91 | + <select> |
| 92 | + <settings> |
| 93 | + <options> |
| 94 | + <option name="0" xsi:type="array"> |
| 95 | + <item name="size" xsi:type="string">small</item> |
| 96 | + <item name="value" xsi:type="string">category_ids</item> |
| 97 | + <item name="title" xsi:type="string" translate="true">Category</item> |
| 98 | + </option> |
| 99 | + <option name="1" xsi:type="array"> |
| 100 | + <item name="size" xsi:type="string">small</item> |
| 101 | + <item name="value" xsi:type="string">condition</item> |
| 102 | + <item name="title" xsi:type="string" translate="true">Condition</item> |
| 103 | + </option> |
| 104 | + </options> |
| 105 | + </settings> |
| 106 | + </select> |
| 107 | + </formElements> |
| 108 | + </field> |
| 109 | + <field name="category_ids" component="Magento_Catalog/js/components/new-category" sortOrder="5" formElement="select"> |
| 110 | + <argument name="data" xsi:type="array"> |
| 111 | + <item name="config" xsi:type="array"> |
| 112 | + <item name="filterOptions" xsi:type="boolean">true</item> |
| 113 | + <item name="multiple" xsi:type="boolean">false</item> |
| 114 | + <item name="showCheckbox" xsi:type="boolean">false</item> |
| 115 | + <item name="disableLabel" xsi:type="boolean">true</item> |
| 116 | + <item name="levelsVisibility" xsi:type="number">1</item> |
| 117 | + </item> |
| 118 | + </argument> |
| 119 | + <settings> |
| 120 | + <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl> |
| 121 | + <label translate="true">Category</label> |
| 122 | + <dataScope>category_ids</dataScope> |
| 123 | + <componentType>field</componentType> |
| 124 | + <visible>false</visible> |
| 125 | + <listens> |
| 126 | + <link name="${ $.namespace }.${ $.namespace }:responseData">setParsed</link> |
| 127 | + </listens> |
| 128 | + </settings> |
| 129 | + <formElements> |
| 130 | + <select> |
| 131 | + <settings> |
| 132 | + <options class="Magento\Catalog\Ui\Component\Product\Form\Categories\Options"/> |
| 133 | + </settings> |
| 134 | + </select> |
| 135 | + </formElements> |
| 136 | + </field> |
| 137 | + <htmlContent name="conditions_form" sortOrder="5" template="Magento_PageBuilder/form/element/widget-conditions"> |
| 138 | + <settings> |
| 139 | + <visible>false</visible> |
| 140 | + <additionalClasses> |
| 141 | + <class name="admin__field">true</class> |
| 142 | + </additionalClasses> |
| 143 | + </settings> |
| 144 | + <block name="conditions_form" class="Magento\PageBuilder\Block\Adminhtml\Form\Element\ProductConditions"> |
| 145 | + <arguments> |
| 146 | + <argument name="formNamespace" xsi:type="string">pagebuilder_products_carousel_form</argument> |
| 147 | + <argument name="attribute" xsi:type="string">condition_source</argument> |
| 148 | + <argument name="label" xsi:type="string" translate="true">Condition</argument> |
| 149 | + </arguments> |
| 150 | + </block> |
| 151 | + </htmlContent> |
| 152 | + <field name="sort_order" sortOrder="10" formElement="select" component="Magento_PageBuilder/js/form/element/select-filtered-options"> |
| 153 | + <argument name="data" xsi:type="array"> |
| 154 | + <item name="config" xsi:type="array"> |
| 155 | + <item name="default" xsi:type="string">position</item> |
| 156 | + <item name="excludeOptions" xsi:type="array"> |
| 157 | + <item name="condition" xsi:type="string">position</item> |
| 158 | + </item> |
| 159 | + </item> |
| 160 | + </argument> |
| 161 | + <settings> |
| 162 | + <dataType>text</dataType> |
| 163 | + <label translate="true">Sort By</label> |
| 164 | + <dataScope>sort_order</dataScope> |
| 165 | + </settings> |
| 166 | + <formElements> |
| 167 | + <select> |
| 168 | + <settings> |
| 169 | + <options class="Magento\PageBuilder\Model\Catalog\Sorting\Options"/> |
| 170 | + </settings> |
| 171 | + </select> |
| 172 | + </formElements> |
| 173 | + </field> |
| 174 | + <field name="carousel_products_count" sortOrder="20" formElement="input"> |
| 175 | + <argument name="data" xsi:type="array"> |
| 176 | + <item name="config" xsi:type="array"> |
| 177 | + <item name="default" xsi:type="number">20</item> |
| 178 | + </item> |
| 179 | + </argument> |
| 180 | + <settings> |
| 181 | + <dataType>number</dataType> |
| 182 | + <label translate="true">Number of Products to Display</label> |
| 183 | + <additionalClasses> |
| 184 | + <class name="admin__field-small">true</class> |
| 185 | + </additionalClasses> |
| 186 | + <dataScope>carousel_products_count</dataScope> |
| 187 | + <validation> |
| 188 | + <rule name="required-entry" xsi:type="boolean">true</rule> |
| 189 | + <rule name="validate-number" xsi:type="boolean">true</rule> |
| 190 | + <rule name="less-than-equals-to" xsi:type="number">999</rule> |
| 191 | + <rule name="greater-than-equals-to" xsi:type="number">1</rule> |
| 192 | + </validation> |
| 193 | + </settings> |
| 194 | + </field> |
| 195 | + </fieldset> |
| 196 | +</form> |
0 commit comments