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

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