@gem-sdk/components 2.0.0-dev.344 → 2.0.0-dev.346
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/product/components/ProductList/ProductListItem.liquid.js +2 -1
- package/dist/cjs/product/components/ProductList/common/getClass.js +6 -2
- package/dist/cjs/product/setting/product/configs/uiV2.js +4 -2
- package/dist/esm/product/components/ProductList/ProductListItem.liquid.js +2 -1
- package/dist/esm/product/components/ProductList/common/getClass.js +6 -2
- package/dist/esm/product/setting/product/configs/uiV2.js +4 -2
- package/package.json +2 -2
|
@@ -7,11 +7,12 @@ var getClass = require('./common/getClass.js');
|
|
|
7
7
|
|
|
8
8
|
const ProductListItem = (props)=>{
|
|
9
9
|
const { pageContext, children } = props;
|
|
10
|
-
const { productItemClass } = getClass.getClass(props);
|
|
10
|
+
const { productItemClass, gpProductClass } = getClass.getClass(props);
|
|
11
11
|
return core.template /* liquid */ `
|
|
12
12
|
<gp-product
|
|
13
13
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
14
14
|
gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(pageContext)}}'
|
|
15
|
+
class="${gpProductClass}"
|
|
15
16
|
>
|
|
16
17
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${productItemClass}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
17
18
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
@@ -17,19 +17,23 @@ const getClass = (props)=>{
|
|
|
17
17
|
const productListWrapClass = system.createClass({
|
|
18
18
|
'gp-relative gp-flex': true
|
|
19
19
|
});
|
|
20
|
+
const gpProductClass = system.createClass({
|
|
21
|
+
'gp-contents': setting?.sameHeight
|
|
22
|
+
});
|
|
20
23
|
const carouselClass = system.createClass({
|
|
21
24
|
'gp-justify-center': true,
|
|
22
25
|
'gp-overflow-hidden': !setting?.sameHeight
|
|
23
26
|
});
|
|
24
27
|
const productItemClass = system.createClass({
|
|
25
|
-
'gp-contents [&_*[data-same-height-display-contents="true"]]:gp-contents [&_*[data-
|
|
28
|
+
'gp-contents [&_*[data-same-height-display-contents="true"]]:gp-contents [&_*[data-same-height-subgrid-container="true"]]:gp-grid [&_*[data-same-height-subgrid-container="true"]]:gp-grid-rows-[subgrid] [&_*[data-same-height-subgrid-container="true"]]:gp-gap-y-0 [&_*[data-same-height-subgrid-container="true"]]:gp-grid-col-[subgrid]': setting?.sameHeight,
|
|
26
29
|
[`gp-child-item-${builderProps?.uid}`]: true
|
|
27
30
|
});
|
|
28
31
|
return {
|
|
29
32
|
gridLayoutClass,
|
|
30
33
|
productItemClass,
|
|
31
34
|
carouselClass,
|
|
32
|
-
productListWrapClass
|
|
35
|
+
productListWrapClass,
|
|
36
|
+
gpProductClass
|
|
33
37
|
};
|
|
34
38
|
};
|
|
35
39
|
|
|
@@ -185,11 +185,13 @@ const SettingUIV2 = [
|
|
|
185
185
|
options: [
|
|
186
186
|
{
|
|
187
187
|
label: 'Link variants, quantity <br> between same products',
|
|
188
|
-
value: true
|
|
188
|
+
value: true,
|
|
189
|
+
svgIcon: 'gp-sync-product-on'
|
|
189
190
|
},
|
|
190
191
|
{
|
|
191
192
|
label: 'Unlink variants, quantity <br> between same products',
|
|
192
|
-
value: false
|
|
193
|
+
value: false,
|
|
194
|
+
svgIcon: 'gp-sync-product-off'
|
|
193
195
|
}
|
|
194
196
|
],
|
|
195
197
|
linkWithSetting: {
|
|
@@ -3,11 +3,12 @@ import { getClass } from './common/getClass.js';
|
|
|
3
3
|
|
|
4
4
|
const ProductListItem = (props)=>{
|
|
5
5
|
const { pageContext, children } = props;
|
|
6
|
-
const { productItemClass } = getClass(props);
|
|
6
|
+
const { productItemClass, gpProductClass } = getClass(props);
|
|
7
7
|
return template /* liquid */ `
|
|
8
8
|
<gp-product
|
|
9
9
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
|
|
10
10
|
gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(pageContext)}}'
|
|
11
|
+
class="${gpProductClass}"
|
|
11
12
|
>
|
|
12
13
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${productItemClass}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
13
14
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
@@ -15,19 +15,23 @@ const getClass = (props)=>{
|
|
|
15
15
|
const productListWrapClass = createClass({
|
|
16
16
|
'gp-relative gp-flex': true
|
|
17
17
|
});
|
|
18
|
+
const gpProductClass = createClass({
|
|
19
|
+
'gp-contents': setting?.sameHeight
|
|
20
|
+
});
|
|
18
21
|
const carouselClass = createClass({
|
|
19
22
|
'gp-justify-center': true,
|
|
20
23
|
'gp-overflow-hidden': !setting?.sameHeight
|
|
21
24
|
});
|
|
22
25
|
const productItemClass = createClass({
|
|
23
|
-
'gp-contents [&_*[data-same-height-display-contents="true"]]:gp-contents [&_*[data-
|
|
26
|
+
'gp-contents [&_*[data-same-height-display-contents="true"]]:gp-contents [&_*[data-same-height-subgrid-container="true"]]:gp-grid [&_*[data-same-height-subgrid-container="true"]]:gp-grid-rows-[subgrid] [&_*[data-same-height-subgrid-container="true"]]:gp-gap-y-0 [&_*[data-same-height-subgrid-container="true"]]:gp-grid-col-[subgrid]': setting?.sameHeight,
|
|
24
27
|
[`gp-child-item-${builderProps?.uid}`]: true
|
|
25
28
|
});
|
|
26
29
|
return {
|
|
27
30
|
gridLayoutClass,
|
|
28
31
|
productItemClass,
|
|
29
32
|
carouselClass,
|
|
30
|
-
productListWrapClass
|
|
33
|
+
productListWrapClass,
|
|
34
|
+
gpProductClass
|
|
31
35
|
};
|
|
32
36
|
};
|
|
33
37
|
|
|
@@ -183,11 +183,13 @@ const SettingUIV2 = [
|
|
|
183
183
|
options: [
|
|
184
184
|
{
|
|
185
185
|
label: 'Link variants, quantity <br> between same products',
|
|
186
|
-
value: true
|
|
186
|
+
value: true,
|
|
187
|
+
svgIcon: 'gp-sync-product-on'
|
|
187
188
|
},
|
|
188
189
|
{
|
|
189
190
|
label: 'Unlink variants, quantity <br> between same products',
|
|
190
|
-
value: false
|
|
191
|
+
value: false,
|
|
192
|
+
svgIcon: 'gp-sync-product-off'
|
|
191
193
|
}
|
|
192
194
|
],
|
|
193
195
|
linkWithSetting: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.346",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
25
|
+
"@gem-sdk/core": "2.0.0-dev.345",
|
|
26
26
|
"@gem-sdk/styles": "2.0.0-dev.324",
|
|
27
27
|
"@gem-sdk/system": "2.0.0-dev.324",
|
|
28
28
|
"@types/react-transition-group": "^4.4.5"
|