@gem-sdk/components 2.0.0-dev.474 → 2.0.0-dev.477

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.
Files changed (28) hide show
  1. package/dist/cjs/carousel/setting/configs/settingV2.js +735 -728
  2. package/dist/cjs/carousel/setting/configs/uiV2.js +304 -298
  3. package/dist/cjs/coupon/setting/config/settings.js +9 -9
  4. package/dist/cjs/product/components/ProductList/ProductListGridLayout.js +11 -6
  5. package/dist/cjs/product/components/ProductList/ProductListItem.liquid.js +3 -0
  6. package/dist/cjs/product/components/ProductList/common/getStyle.js +33 -1
  7. package/dist/cjs/product/components/ProductList/common/index.js +2 -25
  8. package/dist/cjs/product/setting/ProductList.js +1 -3
  9. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +17 -203
  10. package/dist/cjs/product/setting/product-list/configs/uiV2.js +100 -137
  11. package/dist/cjs/sticky/components/common/styles.js +3 -3
  12. package/dist/cjs/sticky/components/hooks/useSticky.js +3 -3
  13. package/dist/esm/carousel/setting/configs/settingV2.js +734 -729
  14. package/dist/esm/carousel/setting/configs/uiV2.js +302 -299
  15. package/dist/esm/coupon/setting/config/settings.js +9 -9
  16. package/dist/esm/product/components/ProductList/ProductListGridLayout.js +11 -6
  17. package/dist/esm/product/components/ProductList/ProductListItem.liquid.js +3 -0
  18. package/dist/esm/product/components/ProductList/common/getStyle.js +34 -2
  19. package/dist/esm/product/components/ProductList/common/index.js +2 -25
  20. package/dist/esm/product/setting/ProductList.js +1 -3
  21. package/dist/esm/product/setting/product-list/configs/settingsV2.js +17 -203
  22. package/dist/esm/product/setting/product-list/configs/uiV2.js +100 -137
  23. package/dist/esm/sticky/components/common/styles.js +4 -4
  24. package/dist/esm/sticky/components/hooks/useSticky.js +3 -3
  25. package/dist/types/index.d.ts +2 -5
  26. package/package.json +1 -1
  27. package/dist/cjs/product/setting/product-list/configs/settings.js +0 -496
  28. package/dist/esm/product/setting/product-list/configs/settings.js +0 -494
@@ -1,10 +1,12 @@
1
- import { makeStyleResponsive, getStyleBackgroundByDevice, getResponsiveValueByScreen } from '@gem-sdk/core';
1
+ import { makeGlobalSize, makeStyleResponsive, getStyleBackgroundByDevice, getResponsiveValueByScreen, makeStyle, getSingleColorVariable, getRadiusStyleActiveState, getStyleShadow, getGradientBgrStyleByDevice } from '@gem-sdk/core';
2
2
  import { createStyle } from '@gem-sdk/system';
3
3
  import { getInitialWidthForCarouselItem } from '../../../../carousel/components/common/carousel.js';
4
4
  import { createStyleObject } from '../../../../grid/row/commons/helpers.js';
5
5
 
6
6
  const getStyle = (props)=>{
7
7
  const { setting, styles, style } = props;
8
+ const { background } = setting ?? {};
9
+ const itemPadding = makeGlobalSize(styles?.itemPadding);
8
10
  const productListStyle = createStyle({
9
11
  ...style,
10
12
  ...makeStyleResponsive('bgc', styles?.backgroundColor),
@@ -33,12 +35,42 @@ const getStyle = (props)=>{
33
35
  slidesToShow: setting?.slidesToShow
34
36
  })
35
37
  });
38
+ const getProductItemStyle = {
39
+ ...itemPadding && itemPadding.padding,
40
+ ...makeStyle({
41
+ bs: styles?.borderContent?.border,
42
+ bw: styles?.borderContent?.width,
43
+ bc: getSingleColorVariable(styles?.borderContent?.color)
44
+ }),
45
+ ...getRadiusStyleActiveState({
46
+ ...styles?.roundedContent,
47
+ active: {
48
+ ...styles?.roundedContent || {},
49
+ radiusType: 'custom'
50
+ }
51
+ }),
52
+ ...getStyleShadow({
53
+ value: styles?.carouselShadow,
54
+ styleAppliedFor: 'box-shadow',
55
+ isEnableShadow: styles?.hasActiveShadow
56
+ }),
57
+ ...getStyleBackgroundByDevice(background),
58
+ ...getGradientBgrStyleByDevice(background, {
59
+ desktop: true,
60
+ tablet: true,
61
+ mobile: true
62
+ })
63
+ };
64
+ const productItemStyle = createStyle({
65
+ ...getProductItemStyle
66
+ });
36
67
  return {
37
68
  gridLayoutStyle,
38
69
  carouselItemStyle,
39
70
  productListStyle,
40
71
  productListWrapStyle,
41
- productListContentStyle
72
+ productListContentStyle,
73
+ productItemStyle
42
74
  };
43
75
  };
44
76
 
@@ -11,39 +11,16 @@ const getData = (props)=>{
11
11
  const navigationStyle = getUpdatedArrowDisplay(setting?.arrow, setting?.controlOverContent);
12
12
  const dotStyle = getUpdatedDotStyle(setting?.dot, setting?.dotStyle);
13
13
  const carouselConfigSetting = {
14
- dotStyle,
15
- navigationStyle,
16
- loop: setting?.loop,
17
- slidesToShow: setting?.slidesToShow,
18
- dot: setting?.dot,
19
14
  dotSize: {
20
15
  desktop: 12
21
16
  },
22
17
  dotGapToCarousel: {
23
18
  desktop: 16
24
19
  },
25
- arrowCustom: setting?.arrowCustom,
26
- controlOverContent: setting?.controlOverContent,
27
- enableDrag: {
28
- desktop: setting?.dragToScroll,
29
- tablet: setting?.dragToScroll,
30
- mobile: setting?.dragToScroll
31
- },
32
- speed: setting?.speed,
33
- dotActiveColor: setting?.dotActiveColor,
34
- dotColor: setting?.dotColor,
35
- autoplay: setting?.autoplay,
36
- pauseOnHover: setting?.pauseOnHover,
37
- autoplayTimeout: setting?.autoplayTimeout,
38
- arrowCustomColor: setting?.arrowCustomColor,
39
- arrowButtonSize: {
40
- desktop: {
41
- width: '24px',
42
- height: '24px'
43
- }
44
- }
20
+ ...setting
45
21
  };
46
22
  const carouselConfigStyle = {
23
+ ...styles,
47
24
  sizeSetting: {
48
25
  ...getSizeSetting({
49
26
  adaptiveHeight: styles?.adaptiveHeight,
@@ -1,6 +1,5 @@
1
1
  import { ProductListPreset } from './product-list/configs/presets.js';
2
2
  import { SettingUIV1 } from './product-list/configs/uiV1.js';
3
- import { ProductListSettings } from './product-list/configs/settings.js';
4
3
  import { ProductListSettingsV2 } from './product-list/configs/settingsV2.js';
5
4
  import { SettingUIV2 } from './product-list/configs/uiV2.js';
6
5
 
@@ -15,8 +14,7 @@ const config = {
15
14
  <path d="M7.96712 33.8834C7.59893 33.8834 7.30046 33.5849 7.30046 33.2168V32.1358C7.30046 31.7676 7.59893 31.4692 7.96712 31.4692H36.3481C36.7163 31.4692 37.0147 31.7676 37.0147 32.1358V33.2168C37.0147 33.5849 36.7163 33.8834 36.3481 33.8834H7.96712Z" fill="currentColor"/>
16
15
  </svg>
17
16
  `,
18
- settings: ProductListSettings,
19
- settingsV2: ProductListSettingsV2,
17
+ settings: ProductListSettingsV2,
20
18
  ui: SettingUIV1,
21
19
  uiV2: SettingUIV2,
22
20
  presets: ProductListPreset,
@@ -1,3 +1,5 @@
1
+ import { CarouselSettingsV2Setting, CarouselSettingsV2Style } from '../../../../carousel/setting/configs/settingV2.js';
2
+
1
3
  const ProductListSettingsV2 = [
2
4
  {
3
5
  id: 'setting',
@@ -46,186 +48,6 @@ const ProductListSettingsV2 = [
46
48
  default: 4,
47
49
  ignoreMax: true
48
50
  },
49
- {
50
- id: 'dot',
51
- label: 'Dot',
52
- type: 'toggle',
53
- devices: {
54
- desktop: {
55
- default: false
56
- }
57
- }
58
- },
59
- {
60
- id: 'dotStyle',
61
- label: 'Dot style',
62
- type: 'option:illustration',
63
- iconViewBox: '0 0 77 48',
64
- enableItemBackground: true,
65
- enableTooltip: true,
66
- options: [
67
- {
68
- label: 'Inside',
69
- value: 'inside',
70
- type: 'carousel-dot',
71
- svgName: 'gp-carousel-dot-inside'
72
- },
73
- {
74
- label: 'Outside',
75
- value: 'outside',
76
- type: 'carousel-dot',
77
- svgName: 'gp-carousel-dot-outside'
78
- }
79
- ],
80
- devices: {
81
- desktop: {
82
- default: 'inside'
83
- }
84
- }
85
- },
86
- {
87
- id: 'dotSize',
88
- label: 'Dots size',
89
- type: 'input:stepper',
90
- min: 1,
91
- devices: {
92
- desktop: {
93
- default: 12
94
- }
95
- }
96
- },
97
- {
98
- id: 'dotGapToCarousel',
99
- label: 'Gap to carousel',
100
- type: 'input:unit',
101
- useOnlyUnitInit: true,
102
- units: [
103
- 'px'
104
- ],
105
- min: 0,
106
- devices: {
107
- desktop: {
108
- default: 16
109
- }
110
- }
111
- },
112
- {
113
- id: 'dotColor',
114
- label: 'Dot color',
115
- type: 'color-picker-v2',
116
- devices: {
117
- desktop: {
118
- default: 'bg-1'
119
- }
120
- }
121
- },
122
- {
123
- id: 'dotActiveColor',
124
- label: 'Dot color active',
125
- type: 'color-picker-v2',
126
- devices: {
127
- desktop: {
128
- default: 'line-3'
129
- }
130
- }
131
- },
132
- {
133
- id: 'arrow',
134
- label: 'Next/Prev Arrow',
135
- type: 'toggle',
136
- devices: {
137
- desktop: {
138
- default: false
139
- }
140
- }
141
- },
142
- {
143
- id: 'arrowCustom',
144
- label: 'Custom Arrow',
145
- type: 'icon',
146
- default: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"></path></svg>'
147
- },
148
- {
149
- id: 'arrowCustomColor',
150
- label: 'Icon color',
151
- type: 'color-picker-v2',
152
- default: '#000000'
153
- },
154
- {
155
- id: 'controlOverContent',
156
- label: 'Control Over Content',
157
- devices: {
158
- desktop: {
159
- default: false
160
- }
161
- },
162
- type: 'option:illustration',
163
- enableTooltip: true,
164
- options: [
165
- {
166
- label: 'Display inside navigation',
167
- value: true,
168
- iconName: 'slide-control-inside',
169
- svgName: 'gp-slide-control-inside'
170
- },
171
- {
172
- label: 'Display outside navigation',
173
- value: false,
174
- iconName: 'slide-control-outside',
175
- svgName: 'gp-slide-control-outside'
176
- }
177
- ]
178
- },
179
- {
180
- id: 'loop',
181
- label: 'Loop',
182
- type: 'toggle',
183
- devices: {
184
- desktop: {
185
- default: false
186
- }
187
- }
188
- },
189
- {
190
- id: 'speed',
191
- label: 'Speed(s)',
192
- type: 'input:stepper',
193
- min: 0,
194
- max: 60,
195
- default: 2,
196
- hide: true
197
- },
198
- {
199
- id: 'dragToScroll',
200
- label: 'Drag to scroll',
201
- type: 'toggle',
202
- default: false
203
- },
204
- {
205
- id: 'autoplay',
206
- label: 'Autoplay',
207
- type: 'toggle',
208
- default: false
209
- },
210
- {
211
- id: 'pauseOnHover',
212
- label: 'Pause On Hover',
213
- type: 'toggle',
214
- default: true,
215
- hide: true
216
- },
217
- {
218
- id: 'autoplayTimeout',
219
- label: 'Timeout(s)',
220
- type: 'range',
221
- min: 1,
222
- max: 10,
223
- step: 0.1,
224
- default: 2,
225
- hide: true,
226
- hideUnit: true,
227
- useOnlyUnitInit: true
228
- },
229
51
  {
230
52
  id: 'sameHeight',
231
53
  label: 'Enable same height',
@@ -241,7 +63,8 @@ const ProductListSettingsV2 = [
241
63
  }
242
64
  ],
243
65
  default: true
244
- }
66
+ },
67
+ ...CarouselSettingsV2Setting
245
68
  ]
246
69
  },
247
70
  {
@@ -249,17 +72,22 @@ const ProductListSettingsV2 = [
249
72
  controls: [
250
73
  {
251
74
  id: 'layout',
252
- type: 'segment',
253
75
  label: 'Layout',
76
+ type: 'layout-selector',
77
+ iconViewBox: '0 0 78 52',
78
+ itemPerRow: 2,
79
+ itemSpacing: 'large',
254
80
  default: 'grid',
255
81
  options: [
256
82
  {
257
83
  label: 'Grid',
258
- value: 'grid'
84
+ value: 'grid',
85
+ iconName: 'gp-grid-layout'
259
86
  },
260
87
  {
261
88
  label: 'Slider',
262
- value: 'slider'
89
+ value: 'slider',
90
+ iconName: 'gp-slider-layout'
263
91
  }
264
92
  ]
265
93
  },
@@ -302,7 +130,7 @@ const ProductListSettingsV2 = [
302
130
  ],
303
131
  devices: {
304
132
  desktop: {
305
- default: '400px'
133
+ default: 'auto'
306
134
  }
307
135
  },
308
136
  displayOptions: [
@@ -337,25 +165,10 @@ const ProductListSettingsV2 = [
337
165
  ],
338
166
  devices: {
339
167
  desktop: {
340
- default: '8px'
168
+ default: '16px'
341
169
  },
342
170
  mobile: {
343
- default: '8px'
344
- }
345
- }
346
- },
347
- {
348
- id: 'spacing',
349
- label: 'Item Spacing',
350
- type: 'input:unit',
351
- min: 0,
352
- useOnlyUnitInit: true,
353
- units: [
354
- 'px'
355
- ],
356
- devices: {
357
- desktop: {
358
- default: 44
171
+ default: '16px'
359
172
  }
360
173
  }
361
174
  },
@@ -431,7 +244,8 @@ const ProductListSettingsV2 = [
431
244
  default: 'center'
432
245
  }
433
246
  }
434
- }
247
+ },
248
+ ...CarouselSettingsV2Style
435
249
  ]
436
250
  }
437
251
  ];
@@ -1,3 +1,5 @@
1
+ import { carouselNavigationSettings, carouselDotsSettings, carouselEffectsSettings } from '../../../../carousel/setting/configs/uiV2.js';
2
+
1
3
  const SettingUIV2 = [
2
4
  {
3
5
  controls: [
@@ -6,6 +8,7 @@ const SettingUIV2 = [
6
8
  label: {
7
9
  en: 'Layout'
8
10
  },
11
+ layout: 'vertical',
9
12
  options: {
10
13
  labelVariant: 'primary'
11
14
  },
@@ -35,7 +38,7 @@ const SettingUIV2 = [
35
38
  controls: [
36
39
  {
37
40
  label: {
38
- en: 'Product number'
41
+ en: 'Products'
39
42
  },
40
43
  conditionDisplay: "productSetting.productSrc === 'RelatedProduct' || !!productSetting && productSetting.productSrc !== 'PickProduct'",
41
44
  setting: {
@@ -92,166 +95,126 @@ const SettingUIV2 = [
92
95
  },
93
96
  controls: [
94
97
  {
98
+ conditionDisplay: "layout !== 'slider'",
95
99
  label: {
96
100
  en: 'Height'
97
101
  },
98
102
  setting: {
99
103
  id: 'sameHeight'
100
104
  }
101
- }
102
- ]
103
- },
104
- {
105
- conditionDisplay: "layout === 'slider'",
106
- controls: [
107
- {
108
- label: {
109
- en: 'Navigation'
110
- },
111
- setting: {
112
- id: 'arrow'
113
- },
114
- options: {
115
- labelVariant: 'primary',
116
- toggleStyle: 'switch'
117
- }
118
105
  },
119
106
  {
120
107
  label: {
121
- en: 'Layout'
108
+ en: 'Padding'
122
109
  },
123
- conditionDisplay: 'arrow === true',
124
- setting: {
125
- id: 'controlOverContent'
110
+ controlConfig: {
111
+ id: 'itemPadding',
112
+ type: 'padding-v2',
113
+ linkWithSetting: {
114
+ name: 'itemPadding',
115
+ field: 'padding'
116
+ },
117
+ compoDefaultValue: {
118
+ desktop: {
119
+ default: {
120
+ type: 'custom',
121
+ top: '16px',
122
+ bottom: '16px',
123
+ left: '16px',
124
+ right: '16px'
125
+ }
126
+ }
127
+ }
126
128
  }
127
129
  },
128
130
  {
129
- conditionDisplay: 'arrow === true',
130
131
  label: {
131
- en: 'Icon'
132
+ en: 'Background'
132
133
  },
133
134
  setting: {
134
- id: 'arrowCustom'
135
+ id: 'background'
135
136
  }
136
- },
137
- {
138
- conditionDisplay: 'arrow === true',
139
- label: {
140
- en: 'Icon color'
137
+ }
138
+ ],
139
+ moreSettings: {
140
+ controls: [
141
+ {
142
+ label: {
143
+ en: 'Border'
144
+ },
145
+ setting: {
146
+ id: 'borderContent'
147
+ }
141
148
  },
142
- setting: {
143
- id: 'arrowCustomColor'
149
+ {
150
+ label: {
151
+ en: 'Corner'
152
+ },
153
+ setting: {
154
+ id: 'roundedContent'
155
+ }
156
+ },
157
+ {
158
+ label: {
159
+ en: 'Shadow'
160
+ },
161
+ setting: {
162
+ id: 'carouselShadow'
163
+ },
164
+ options: {
165
+ updateFields: [
166
+ {
167
+ field: 'enable',
168
+ settingId: 'hasActiveShadow'
169
+ }
170
+ ]
171
+ },
172
+ controlChangeTrigger: {
173
+ settings: [
174
+ {
175
+ condition: `carouselShadow.enable === true`,
176
+ source: [
177
+ 'carouselShadow'
178
+ ],
179
+ action: {
180
+ controlId: 'hasActiveShadow',
181
+ groupType: 'style',
182
+ controlType: 'style',
183
+ newValue: true
184
+ }
185
+ },
186
+ {
187
+ condition: `carouselShadow.enable === false`,
188
+ source: [
189
+ 'carouselShadow'
190
+ ],
191
+ action: {
192
+ controlId: 'hasActiveShadow',
193
+ groupType: 'style',
194
+ controlType: 'style',
195
+ newValue: false
196
+ }
197
+ }
198
+ ],
199
+ options: {
200
+ noRecordHistory: true
201
+ }
202
+ }
144
203
  }
145
- }
146
- ]
204
+ ]
205
+ }
147
206
  },
148
207
  {
149
208
  conditionDisplay: "layout === 'slider'",
150
- controls: [
151
- {
152
- label: {
153
- en: 'Dots'
154
- },
155
- setting: {
156
- id: 'dot'
157
- },
158
- options: {
159
- labelVariant: 'primary',
160
- toggleStyle: 'switch'
161
- }
162
- },
163
- {
164
- conditionDisplay: 'dot == true',
165
- label: {
166
- en: 'Layout'
167
- },
168
- setting: {
169
- id: 'dotStyle'
170
- }
171
- },
172
- {
173
- conditionDisplay: 'dot == true',
174
- label: {
175
- en: 'Active color'
176
- },
177
- setting: {
178
- id: 'dotActiveColor'
179
- }
180
- },
181
- {
182
- conditionDisplay: 'dot == true',
183
- label: {
184
- en: 'Inactive color'
185
- },
186
- setting: {
187
- id: 'dotColor'
188
- }
189
- },
190
- {
191
- conditionDisplay: 'dot == true',
192
- label: {
193
- en: 'Dots size'
194
- },
195
- setting: {
196
- id: 'dotSize'
197
- }
198
- }
199
- ]
209
+ ...carouselNavigationSettings
200
210
  },
201
211
  {
202
- label: {
203
- en: 'Slider effect'
204
- },
205
212
  conditionDisplay: "layout === 'slider'",
206
- controls: [
207
- {
208
- type: 'control',
209
- label: {
210
- en: 'Drag to scroll'
211
- },
212
- setting: {
213
- id: 'dragToScroll'
214
- }
215
- },
216
- {
217
- type: 'control',
218
- label: {
219
- en: 'Infinity loop'
220
- },
221
- setting: {
222
- id: 'loop'
223
- }
224
- },
225
- {
226
- type: 'control',
227
- label: {
228
- en: 'Autoplay'
229
- },
230
- setting: {
231
- id: 'autoplay'
232
- }
233
- },
234
- {
235
- type: 'control',
236
- label: {
237
- en: 'Pause On Hover'
238
- },
239
- setting: {
240
- id: 'pauseOnHover'
241
- },
242
- conditionDisplay: 'autoplay == true'
243
- },
244
- {
245
- type: 'control',
246
- label: {
247
- en: 'Timeout(s)'
248
- },
249
- setting: {
250
- id: 'autoplayTimeout'
251
- },
252
- conditionDisplay: 'autoplay == true'
253
- }
254
- ]
213
+ ...carouselDotsSettings
214
+ },
215
+ {
216
+ conditionDisplay: "layout === 'slider'",
217
+ ...carouselEffectsSettings
255
218
  },
256
219
  {
257
220
  label: {
@@ -378,7 +341,7 @@ const SettingUIV2 = [
378
341
  label: {
379
342
  en: 'Align'
380
343
  },
381
- conditionEnable: '!(width === "default" || (parseInt(width) >= 100 && width?.includes("%")))',
344
+ conditionEnable: '!(parseInt(width) >= 100 && width?.includes("%"))',
382
345
  setting: {
383
346
  id: 'align'
384
347
  },