@gem-sdk/components 2.0.0-dev.415 → 2.0.0-dev.417

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.
@@ -77,7 +77,7 @@ const Button = (props)=>{
77
77
  <gp-button
78
78
  gp-data='${core.dataStringify(buttonState)}'
79
79
  style="${{
80
- wrapStyle
80
+ ...wrapStyle
81
81
  }}"
82
82
  >
83
83
  <div style="${buttonWrapperStyles}" class="${buttonWrapperClasses}">
@@ -26,8 +26,8 @@ const getButtonIconStyles = (styles, settings)=>{
26
26
  };
27
27
  };
28
28
  const isEnableShadowStateForDevice = (deviceStyles)=>({
29
- normal: deviceStyles?.normal?.type !== 'none',
30
- hover: deviceStyles?.hover?.type !== 'none'
29
+ normal: deviceStyles?.normal?.enable,
30
+ hover: deviceStyles?.hover?.enable
31
31
  });
32
32
  const getShadowStyles = (styles)=>{
33
33
  const { boxShadowBtnV2 } = styles || {};
@@ -59,7 +59,7 @@ const getTypoStyles = (styles)=>{
59
59
  ...core.getStyleShadow({
60
60
  styleAppliedFor: 'text-shadow',
61
61
  value: styles?.typo?.custom?.textShadow,
62
- isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
62
+ isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none' && styles?.typo?.custom?.hasShadowText
63
63
  })
64
64
  };
65
65
  };
@@ -47,7 +47,7 @@ const SubmitButtonSettings = [
47
47
  id: 'label',
48
48
  label: 'Text',
49
49
  type: 'input',
50
- default: 'Send'
50
+ default: 'Submit'
51
51
  },
52
52
  {
53
53
  id: 'translate',
@@ -157,6 +157,13 @@ const SubmitButtonSettings = [
157
157
  bbrr: '0px',
158
158
  btlr: '0px',
159
159
  radiusType: 'none'
160
+ },
161
+ hover: {
162
+ btrr: '0px',
163
+ bblr: '0px',
164
+ bbrr: '0px',
165
+ btlr: '0px',
166
+ radiusType: 'none'
160
167
  }
161
168
  }
162
169
  }
@@ -170,6 +177,13 @@ const SubmitButtonSettings = [
170
177
  bbrr: '8px',
171
178
  btlr: '8px',
172
179
  radiusType: 'rounded'
180
+ },
181
+ hover: {
182
+ btrr: '8px',
183
+ bblr: '8px',
184
+ bbrr: '8px',
185
+ btlr: '8px',
186
+ radiusType: 'rounded'
173
187
  }
174
188
  }
175
189
  }
@@ -181,7 +195,24 @@ const SubmitButtonSettings = [
181
195
  devices: {
182
196
  desktop: {
183
197
  default: {
184
- normal: {}
198
+ normal: {
199
+ type: 'shadow-1',
200
+ distance: '4px',
201
+ blur: '4px',
202
+ spread: '0px',
203
+ color: '#121212',
204
+ angle: 45,
205
+ enable: false
206
+ },
207
+ hover: {
208
+ type: 'shadow-1',
209
+ distance: '4px',
210
+ blur: '4px',
211
+ spread: '0px',
212
+ color: '#121212',
213
+ angle: 45,
214
+ enable: false
215
+ }
185
216
  }
186
217
  }
187
218
  },
@@ -194,7 +225,61 @@ const SubmitButtonSettings = [
194
225
  blur: '4px',
195
226
  spread: '0px',
196
227
  color: '#121212',
197
- angle: 45
228
+ angle: 45,
229
+ enable: true
230
+ },
231
+ hover: {
232
+ type: 'shadow-1',
233
+ distance: '4px',
234
+ blur: '4px',
235
+ spread: '0px',
236
+ color: '#121212',
237
+ angle: 45,
238
+ enable: true
239
+ }
240
+ }
241
+ },
242
+ tablet: {
243
+ default: {
244
+ normal: {
245
+ type: 'shadow-1',
246
+ distance: '4px',
247
+ blur: '4px',
248
+ spread: '0px',
249
+ color: '#121212',
250
+ angle: 45,
251
+ enable: true
252
+ },
253
+ hover: {
254
+ type: 'shadow-1',
255
+ distance: '4px',
256
+ blur: '4px',
257
+ spread: '0px',
258
+ color: '#121212',
259
+ angle: 45,
260
+ enable: true
261
+ }
262
+ }
263
+ },
264
+ mobile: {
265
+ default: {
266
+ normal: {
267
+ type: 'shadow-1',
268
+ distance: '4px',
269
+ blur: '4px',
270
+ spread: '0px',
271
+ color: '#121212',
272
+ angle: 45,
273
+ enable: true
274
+ },
275
+ hover: {
276
+ type: 'shadow-1',
277
+ distance: '4px',
278
+ blur: '4px',
279
+ spread: '0px',
280
+ color: '#121212',
281
+ angle: 45,
282
+ enable: true
198
283
  }
199
284
  }
200
285
  }
@@ -258,6 +343,25 @@ const SubmitButtonSettings = [
258
343
  normal: true
259
344
  }
260
345
  },
346
+ {
347
+ id: 'textColorHover',
348
+ type: 'color-picker-v2',
349
+ devices: {
350
+ desktop: {
351
+ default: {
352
+ hover: 'text-3'
353
+ }
354
+ }
355
+ },
356
+ compoDefaultValue: {
357
+ desktop: {
358
+ default: {
359
+ hover: 'text-3'
360
+ }
361
+ }
362
+ },
363
+ enableGradient: true
364
+ },
261
365
  {
262
366
  id: 'hasBoxShadowBtn',
263
367
  type: 'toggle',
@@ -463,7 +567,7 @@ const SubmitButtonSettings = [
463
567
  devices: {
464
568
  desktop: {
465
569
  default: {
466
- width: '120px',
570
+ width: 'Auto',
467
571
  height: 'Auto',
468
572
  padding: {
469
573
  type: 'medium',
@@ -1,19 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const SettingUIV2 = [
4
- {
5
- label: {
6
- en: 'Layout'
7
- },
8
- controls: [
9
- {
10
- setting: {
11
- id: 'layout'
12
- },
13
- layout: 'vertical'
14
- }
15
- ]
16
- },
17
4
  {
18
5
  label: {
19
6
  en: 'Size'
@@ -202,7 +189,7 @@ const SettingUIV2 = [
202
189
  },
203
190
  {
204
191
  label: {
205
- en: 'Choose icon'
192
+ en: 'Icon'
206
193
  },
207
194
  setting: {
208
195
  id: 'iconSvg'
@@ -290,7 +277,7 @@ const SettingUIV2 = [
290
277
  en: 'Text color'
291
278
  },
292
279
  setting: {
293
- id: 'textColor',
280
+ id: 'textColorHover',
294
281
  state: 'hover'
295
282
  }
296
283
  }
@@ -32,6 +32,7 @@ const SettingV2 = [
32
32
  enableItemBackground: true,
33
33
  itemPerRow: 3,
34
34
  itemSpacing: 'large',
35
+ enableItemOpacity: true,
35
36
  options: [
36
37
  {
37
38
  label: 'Featured top',
@@ -67,7 +68,8 @@ const SettingV2 = [
67
68
  label: 'Image list 1 col',
68
69
  value: 'one-col',
69
70
  type: 'p-image-layout',
70
- iconName: 'gp-product-image-layout-one-col'
71
+ iconName: 'gp-product-image-layout-one-col',
72
+ noPadding: 'y'
71
73
  }
72
74
  ],
73
75
  default: 'bottom-center'
@@ -13,27 +13,32 @@ const SettingUIV2 = [
13
13
  setting: {
14
14
  id: 'layoutType'
15
15
  },
16
- layout: 'vertical'
17
- },
18
- {
19
- label: {
20
- en: ''
21
- },
22
- setting: {
23
- id: 'ratioLayoutLeft'
24
- },
25
16
  layout: 'vertical',
26
- conditionDisplay: "layoutType === 'left'"
27
- },
28
- {
29
- label: {
30
- en: ''
31
- },
32
- setting: {
33
- id: 'ratioLayoutRight'
34
- },
35
- layout: 'vertical',
36
- conditionDisplay: "layoutType === 'right'"
17
+ options: {
18
+ isComboLayout: true
19
+ },
20
+ controls: [
21
+ {
22
+ label: {
23
+ en: 'Ratio'
24
+ },
25
+ setting: {
26
+ id: 'ratioLayoutLeft'
27
+ },
28
+ layout: 'vertical',
29
+ conditionDisplay: "layoutType === 'left'"
30
+ },
31
+ {
32
+ label: {
33
+ en: 'Ratio'
34
+ },
35
+ setting: {
36
+ id: 'ratioLayoutRight'
37
+ },
38
+ layout: 'vertical',
39
+ conditionDisplay: "layoutType === 'right'"
40
+ }
41
+ ]
37
42
  }
38
43
  ]
39
44
  },
@@ -6,18 +6,16 @@ const getContainerAttrs = ({ uid, isDisabled = true, isDisableByLiquid })=>{
6
6
  'data-disabled': isDisableByLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled
7
7
  };
8
8
  };
9
- const getButtonAttrs = ({ isDisabled = true, isLiquid, buttonSide })=>{
9
+ const getButtonAttrs = ({ buttonSide })=>{
10
10
  return {
11
- disabled: isLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled,
12
11
  title: buttonSide === 'left' ? 'Decrement' : 'Increment',
13
12
  'aria-label': buttonSide === 'left' ? 'decrement' : 'increment'
14
13
  };
15
14
  };
16
- const getInputAttr = ({ isDisabled = true, isLiquid, qtyStyle, quantity, currentVariant, defaultQty })=>{
15
+ const getInputAttr = ({ isLiquid, qtyStyle, quantity, currentVariant, defaultQty })=>{
17
16
  const attrs = {};
18
17
  if (currentVariant?.manageInventory) attrs['max'] = isLiquid ? '{{ current_variant.quantity_rule.max }}' : currentVariant?.inventoryQuantity ?? 1;
19
18
  return {
20
- disabled: isLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled,
21
19
  type: qtyStyle === 'standard' ? 'text' : 'number',
22
20
  name: 'quantity',
23
21
  step: 1,
@@ -17,7 +17,7 @@ const getInputClasses = ({ styles, borderBtn, inputBackgroundColor, textColor })
17
17
  };
18
18
  };
19
19
  const getButtonClass = ({ borderBtn, buttonBackgroundColor, iconColor, buttonSide })=>{
20
- let classList = `gp-flex gp-aspect-square gp-h-full gp-cursor-pointer gp-items-center gp-justify-center gp-outline-none disabled:gp-cursor-not-allowed ${buttonSide === 'left' ? '!gp-border-r-0' : '!gp-border-l-0'} `;
20
+ let classList = `gp-flex gp-aspect-square gp-h-full gp-cursor-pointer gp-items-center gp-justify-center gp-outline-none disabled:gp-cursor-not-allowed ${buttonSide === 'left' ? '!gp-border-r-0 gp-minus' : '!gp-border-l-0 gp-plus'} `;
21
21
  const buttonColor = core.handleConvertClassColor(borderBtn);
22
22
  const buttonBgColor = core.getGlobalColorStateClass('bg', buttonBackgroundColor);
23
23
  const iconColorStateClass = core.getGlobalColorStateClass('text', iconColor);
@@ -46,7 +46,6 @@ const ProductQuantity = (props)=>{
46
46
  });
47
47
  const inputAttrs = system.createAttr({
48
48
  ...getAttrs.getInputAttr({
49
- isDisabled: !isInStock,
50
49
  qtyStyle,
51
50
  quantity,
52
51
  currentVariant,
@@ -85,7 +84,6 @@ const ProductQuantity = (props)=>{
85
84
  });
86
85
  const buttonLeftAttrs = system.createAttr({
87
86
  ...getAttrs.getButtonAttrs({
88
- isDisabled: !isInStock,
89
87
  buttonSide: 'left'
90
88
  })
91
89
  });
@@ -110,7 +108,6 @@ const ProductQuantity = (props)=>{
110
108
  });
111
109
  const buttonRightAttrs = system.createAttr({
112
110
  ...getAttrs.getButtonAttrs({
113
- isDisabled: !isInStock,
114
111
  buttonSide: 'right'
115
112
  })
116
113
  });
@@ -128,6 +125,7 @@ const ProductQuantity = (props)=>{
128
125
  style: wrapperStyles,
129
126
  children: [
130
127
  system.If(qtyStyle === 'standard', /*#__PURE__*/ jsxRuntime.jsx("button", {
128
+ disabled: !isInStock,
131
129
  ...buttonLeftAttrs,
132
130
  onClick: decrement,
133
131
  className: buttonLeftClass,
@@ -136,11 +134,12 @@ const ProductQuantity = (props)=>{
136
134
  className: iconWrapperClass,
137
135
  style: iconWidth,
138
136
  dangerouslySetInnerHTML: {
139
- __html: common.getPlusIcon(plusIcon)
137
+ __html: common.getPlusIcon(minusIcon)
140
138
  }
141
139
  })
142
140
  })),
143
141
  /*#__PURE__*/ jsxRuntime.jsx("input", {
142
+ disabled: !isInStock,
144
143
  ...inputAttrs,
145
144
  className: inputClass,
146
145
  style: inputStyle,
@@ -149,6 +148,7 @@ const ProductQuantity = (props)=>{
149
148
  }
150
149
  }),
151
150
  system.If(qtyStyle === 'standard', /*#__PURE__*/ jsxRuntime.jsx("button", {
151
+ disabled: !isInStock,
152
152
  ...buttonRightAttrs,
153
153
  onClick: increment,
154
154
  className: buttonRightClass,
@@ -157,7 +157,7 @@ const ProductQuantity = (props)=>{
157
157
  className: iconWrapperClass,
158
158
  style: iconWidth,
159
159
  dangerouslySetInnerHTML: {
160
- __html: common.getMinusIcon(minusIcon)
160
+ __html: common.getMinusIcon(plusIcon)
161
161
  }
162
162
  })
163
163
  }))
@@ -86,7 +86,6 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
86
86
  });
87
87
  const buttonLeftAttrs = system.createAttr({
88
88
  ...getAttrs.getButtonAttrs({
89
- isLiquid: true,
90
89
  buttonSide: 'left'
91
90
  })
92
91
  });
@@ -110,7 +109,6 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
110
109
  });
111
110
  const buttonRightAttrs = system.createAttr({
112
111
  ...getAttrs.getButtonAttrs({
113
- isLiquid: true,
114
112
  buttonSide: 'right'
115
113
  })
116
114
  });
@@ -134,6 +132,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
134
132
  <div class="${wrapperClasses}" style="${wrapperStyles}">
135
133
  ${core.RenderIf(qtyStyle === 'standard', core.template /* liquid */ `
136
134
  <button
135
+ {% if available == false %} disabled {% endif %}
137
136
  ${{
138
137
  ...buttonLeftAttrs
139
138
  }}
@@ -142,11 +141,12 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
142
141
  >
143
142
  <span class="${iconWrapperClass}" style="${iconWidth}"
144
143
  >
145
- ${common.getPlusIcon(plusIcon)}
144
+ ${common.getPlusIcon(minusIcon)}
146
145
  </span>
147
146
  </button>
148
147
  `)}
149
148
  <input
149
+ {% if available == false %} disabled {% endif %}
150
150
  ${{
151
151
  ...inputAttrs
152
152
  }}
@@ -157,6 +157,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
157
157
 
158
158
  ${core.RenderIf(qtyStyle === 'standard', core.template /* liquid */ `
159
159
  <button
160
+ {% if available == false %} disabled {% endif %}
160
161
  ${{
161
162
  ...buttonRightAttrs
162
163
  }}
@@ -164,7 +165,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
164
165
  style="${buttonRightStyle}"
165
166
  >
166
167
  <span class="${iconWrapperClass}" style="${iconWidth}">
167
- ${common.getPlusIcon(minusIcon)}
168
+ ${common.getPlusIcon(plusIcon)}
168
169
  </span>
169
170
  </button>
170
171
  `)}
@@ -73,7 +73,7 @@ const Button = (props)=>{
73
73
  <gp-button
74
74
  gp-data='${dataStringify(buttonState)}'
75
75
  style="${{
76
- wrapStyle
76
+ ...wrapStyle
77
77
  }}"
78
78
  >
79
79
  <div style="${buttonWrapperStyles}" class="${buttonWrapperClasses}">
@@ -24,8 +24,8 @@ const getButtonIconStyles = (styles, settings)=>{
24
24
  };
25
25
  };
26
26
  const isEnableShadowStateForDevice = (deviceStyles)=>({
27
- normal: deviceStyles?.normal?.type !== 'none',
28
- hover: deviceStyles?.hover?.type !== 'none'
27
+ normal: deviceStyles?.normal?.enable,
28
+ hover: deviceStyles?.hover?.enable
29
29
  });
30
30
  const getShadowStyles = (styles)=>{
31
31
  const { boxShadowBtnV2 } = styles || {};
@@ -57,7 +57,7 @@ const getTypoStyles = (styles)=>{
57
57
  ...getStyleShadow({
58
58
  styleAppliedFor: 'text-shadow',
59
59
  value: styles?.typo?.custom?.textShadow,
60
- isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none'
60
+ isEnableShadow: styles?.typo?.custom?.textShadow?.type !== 'none' && styles?.typo?.custom?.hasShadowText
61
61
  })
62
62
  };
63
63
  };
@@ -43,7 +43,7 @@ const SubmitButtonSettings = [
43
43
  id: 'label',
44
44
  label: 'Text',
45
45
  type: 'input',
46
- default: 'Send'
46
+ default: 'Submit'
47
47
  },
48
48
  {
49
49
  id: 'translate',
@@ -153,6 +153,13 @@ const SubmitButtonSettings = [
153
153
  bbrr: '0px',
154
154
  btlr: '0px',
155
155
  radiusType: 'none'
156
+ },
157
+ hover: {
158
+ btrr: '0px',
159
+ bblr: '0px',
160
+ bbrr: '0px',
161
+ btlr: '0px',
162
+ radiusType: 'none'
156
163
  }
157
164
  }
158
165
  }
@@ -166,6 +173,13 @@ const SubmitButtonSettings = [
166
173
  bbrr: '8px',
167
174
  btlr: '8px',
168
175
  radiusType: 'rounded'
176
+ },
177
+ hover: {
178
+ btrr: '8px',
179
+ bblr: '8px',
180
+ bbrr: '8px',
181
+ btlr: '8px',
182
+ radiusType: 'rounded'
169
183
  }
170
184
  }
171
185
  }
@@ -177,7 +191,24 @@ const SubmitButtonSettings = [
177
191
  devices: {
178
192
  desktop: {
179
193
  default: {
180
- normal: {}
194
+ normal: {
195
+ type: 'shadow-1',
196
+ distance: '4px',
197
+ blur: '4px',
198
+ spread: '0px',
199
+ color: '#121212',
200
+ angle: 45,
201
+ enable: false
202
+ },
203
+ hover: {
204
+ type: 'shadow-1',
205
+ distance: '4px',
206
+ blur: '4px',
207
+ spread: '0px',
208
+ color: '#121212',
209
+ angle: 45,
210
+ enable: false
211
+ }
181
212
  }
182
213
  }
183
214
  },
@@ -190,7 +221,61 @@ const SubmitButtonSettings = [
190
221
  blur: '4px',
191
222
  spread: '0px',
192
223
  color: '#121212',
193
- angle: 45
224
+ angle: 45,
225
+ enable: true
226
+ },
227
+ hover: {
228
+ type: 'shadow-1',
229
+ distance: '4px',
230
+ blur: '4px',
231
+ spread: '0px',
232
+ color: '#121212',
233
+ angle: 45,
234
+ enable: true
235
+ }
236
+ }
237
+ },
238
+ tablet: {
239
+ default: {
240
+ normal: {
241
+ type: 'shadow-1',
242
+ distance: '4px',
243
+ blur: '4px',
244
+ spread: '0px',
245
+ color: '#121212',
246
+ angle: 45,
247
+ enable: true
248
+ },
249
+ hover: {
250
+ type: 'shadow-1',
251
+ distance: '4px',
252
+ blur: '4px',
253
+ spread: '0px',
254
+ color: '#121212',
255
+ angle: 45,
256
+ enable: true
257
+ }
258
+ }
259
+ },
260
+ mobile: {
261
+ default: {
262
+ normal: {
263
+ type: 'shadow-1',
264
+ distance: '4px',
265
+ blur: '4px',
266
+ spread: '0px',
267
+ color: '#121212',
268
+ angle: 45,
269
+ enable: true
270
+ },
271
+ hover: {
272
+ type: 'shadow-1',
273
+ distance: '4px',
274
+ blur: '4px',
275
+ spread: '0px',
276
+ color: '#121212',
277
+ angle: 45,
278
+ enable: true
194
279
  }
195
280
  }
196
281
  }
@@ -254,6 +339,25 @@ const SubmitButtonSettings = [
254
339
  normal: true
255
340
  }
256
341
  },
342
+ {
343
+ id: 'textColorHover',
344
+ type: 'color-picker-v2',
345
+ devices: {
346
+ desktop: {
347
+ default: {
348
+ hover: 'text-3'
349
+ }
350
+ }
351
+ },
352
+ compoDefaultValue: {
353
+ desktop: {
354
+ default: {
355
+ hover: 'text-3'
356
+ }
357
+ }
358
+ },
359
+ enableGradient: true
360
+ },
257
361
  {
258
362
  id: 'hasBoxShadowBtn',
259
363
  type: 'toggle',
@@ -459,7 +563,7 @@ const SubmitButtonSettings = [
459
563
  devices: {
460
564
  desktop: {
461
565
  default: {
462
- width: '120px',
566
+ width: 'Auto',
463
567
  height: 'Auto',
464
568
  padding: {
465
569
  type: 'medium',
@@ -1,17 +1,4 @@
1
1
  const SettingUIV2 = [
2
- {
3
- label: {
4
- en: 'Layout'
5
- },
6
- controls: [
7
- {
8
- setting: {
9
- id: 'layout'
10
- },
11
- layout: 'vertical'
12
- }
13
- ]
14
- },
15
2
  {
16
3
  label: {
17
4
  en: 'Size'
@@ -200,7 +187,7 @@ const SettingUIV2 = [
200
187
  },
201
188
  {
202
189
  label: {
203
- en: 'Choose icon'
190
+ en: 'Icon'
204
191
  },
205
192
  setting: {
206
193
  id: 'iconSvg'
@@ -288,7 +275,7 @@ const SettingUIV2 = [
288
275
  en: 'Text color'
289
276
  },
290
277
  setting: {
291
- id: 'textColor',
278
+ id: 'textColorHover',
292
279
  state: 'hover'
293
280
  }
294
281
  }
@@ -30,6 +30,7 @@ const SettingV2 = [
30
30
  enableItemBackground: true,
31
31
  itemPerRow: 3,
32
32
  itemSpacing: 'large',
33
+ enableItemOpacity: true,
33
34
  options: [
34
35
  {
35
36
  label: 'Featured top',
@@ -65,7 +66,8 @@ const SettingV2 = [
65
66
  label: 'Image list 1 col',
66
67
  value: 'one-col',
67
68
  type: 'p-image-layout',
68
- iconName: 'gp-product-image-layout-one-col'
69
+ iconName: 'gp-product-image-layout-one-col',
70
+ noPadding: 'y'
69
71
  }
70
72
  ],
71
73
  default: 'bottom-center'
@@ -11,27 +11,32 @@ const SettingUIV2 = [
11
11
  setting: {
12
12
  id: 'layoutType'
13
13
  },
14
- layout: 'vertical'
15
- },
16
- {
17
- label: {
18
- en: ''
19
- },
20
- setting: {
21
- id: 'ratioLayoutLeft'
22
- },
23
14
  layout: 'vertical',
24
- conditionDisplay: "layoutType === 'left'"
25
- },
26
- {
27
- label: {
28
- en: ''
29
- },
30
- setting: {
31
- id: 'ratioLayoutRight'
32
- },
33
- layout: 'vertical',
34
- conditionDisplay: "layoutType === 'right'"
15
+ options: {
16
+ isComboLayout: true
17
+ },
18
+ controls: [
19
+ {
20
+ label: {
21
+ en: 'Ratio'
22
+ },
23
+ setting: {
24
+ id: 'ratioLayoutLeft'
25
+ },
26
+ layout: 'vertical',
27
+ conditionDisplay: "layoutType === 'left'"
28
+ },
29
+ {
30
+ label: {
31
+ en: 'Ratio'
32
+ },
33
+ setting: {
34
+ id: 'ratioLayoutRight'
35
+ },
36
+ layout: 'vertical',
37
+ conditionDisplay: "layoutType === 'right'"
38
+ }
39
+ ]
35
40
  }
36
41
  ]
37
42
  },
@@ -4,18 +4,16 @@ const getContainerAttrs = ({ uid, isDisabled = true, isDisableByLiquid })=>{
4
4
  'data-disabled': isDisableByLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled
5
5
  };
6
6
  };
7
- const getButtonAttrs = ({ isDisabled = true, isLiquid, buttonSide })=>{
7
+ const getButtonAttrs = ({ buttonSide })=>{
8
8
  return {
9
- disabled: isLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled,
10
9
  title: buttonSide === 'left' ? 'Decrement' : 'Increment',
11
10
  'aria-label': buttonSide === 'left' ? 'decrement' : 'increment'
12
11
  };
13
12
  };
14
- const getInputAttr = ({ isDisabled = true, isLiquid, qtyStyle, quantity, currentVariant, defaultQty })=>{
13
+ const getInputAttr = ({ isLiquid, qtyStyle, quantity, currentVariant, defaultQty })=>{
15
14
  const attrs = {};
16
15
  if (currentVariant?.manageInventory) attrs['max'] = isLiquid ? '{{ current_variant.quantity_rule.max }}' : currentVariant?.inventoryQuantity ?? 1;
17
16
  return {
18
- disabled: isLiquid ? '{%- if available -%} false {%- else -%} true {%- endif -%}' : isDisabled,
19
17
  type: qtyStyle === 'standard' ? 'text' : 'number',
20
18
  name: 'quantity',
21
19
  step: 1,
@@ -15,7 +15,7 @@ const getInputClasses = ({ styles, borderBtn, inputBackgroundColor, textColor })
15
15
  };
16
16
  };
17
17
  const getButtonClass = ({ borderBtn, buttonBackgroundColor, iconColor, buttonSide })=>{
18
- let classList = `gp-flex gp-aspect-square gp-h-full gp-cursor-pointer gp-items-center gp-justify-center gp-outline-none disabled:gp-cursor-not-allowed ${buttonSide === 'left' ? '!gp-border-r-0' : '!gp-border-l-0'} `;
18
+ let classList = `gp-flex gp-aspect-square gp-h-full gp-cursor-pointer gp-items-center gp-justify-center gp-outline-none disabled:gp-cursor-not-allowed ${buttonSide === 'left' ? '!gp-border-r-0 gp-minus' : '!gp-border-l-0 gp-plus'} `;
19
19
  const buttonColor = handleConvertClassColor(borderBtn);
20
20
  const buttonBgColor = getGlobalColorStateClass('bg', buttonBackgroundColor);
21
21
  const iconColorStateClass = getGlobalColorStateClass('text', iconColor);
@@ -42,7 +42,6 @@ const ProductQuantity = (props)=>{
42
42
  });
43
43
  const inputAttrs = createAttr({
44
44
  ...getInputAttr({
45
- isDisabled: !isInStock,
46
45
  qtyStyle,
47
46
  quantity,
48
47
  currentVariant,
@@ -81,7 +80,6 @@ const ProductQuantity = (props)=>{
81
80
  });
82
81
  const buttonLeftAttrs = createAttr({
83
82
  ...getButtonAttrs({
84
- isDisabled: !isInStock,
85
83
  buttonSide: 'left'
86
84
  })
87
85
  });
@@ -106,7 +104,6 @@ const ProductQuantity = (props)=>{
106
104
  });
107
105
  const buttonRightAttrs = createAttr({
108
106
  ...getButtonAttrs({
109
- isDisabled: !isInStock,
110
107
  buttonSide: 'right'
111
108
  })
112
109
  });
@@ -124,6 +121,7 @@ const ProductQuantity = (props)=>{
124
121
  style: wrapperStyles,
125
122
  children: [
126
123
  If(qtyStyle === 'standard', /*#__PURE__*/ jsx("button", {
124
+ disabled: !isInStock,
127
125
  ...buttonLeftAttrs,
128
126
  onClick: decrement,
129
127
  className: buttonLeftClass,
@@ -132,11 +130,12 @@ const ProductQuantity = (props)=>{
132
130
  className: iconWrapperClass,
133
131
  style: iconWidth,
134
132
  dangerouslySetInnerHTML: {
135
- __html: getPlusIcon(plusIcon)
133
+ __html: getPlusIcon(minusIcon)
136
134
  }
137
135
  })
138
136
  })),
139
137
  /*#__PURE__*/ jsx("input", {
138
+ disabled: !isInStock,
140
139
  ...inputAttrs,
141
140
  className: inputClass,
142
141
  style: inputStyle,
@@ -145,6 +144,7 @@ const ProductQuantity = (props)=>{
145
144
  }
146
145
  }),
147
146
  If(qtyStyle === 'standard', /*#__PURE__*/ jsx("button", {
147
+ disabled: !isInStock,
148
148
  ...buttonRightAttrs,
149
149
  onClick: increment,
150
150
  className: buttonRightClass,
@@ -153,7 +153,7 @@ const ProductQuantity = (props)=>{
153
153
  className: iconWrapperClass,
154
154
  style: iconWidth,
155
155
  dangerouslySetInnerHTML: {
156
- __html: getMinusIcon(minusIcon)
156
+ __html: getMinusIcon(plusIcon)
157
157
  }
158
158
  })
159
159
  }))
@@ -82,7 +82,6 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
82
82
  });
83
83
  const buttonLeftAttrs = createAttr({
84
84
  ...getButtonAttrs({
85
- isLiquid: true,
86
85
  buttonSide: 'left'
87
86
  })
88
87
  });
@@ -106,7 +105,6 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
106
105
  });
107
106
  const buttonRightAttrs = createAttr({
108
107
  ...getButtonAttrs({
109
- isLiquid: true,
110
108
  buttonSide: 'right'
111
109
  })
112
110
  });
@@ -130,6 +128,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
130
128
  <div class="${wrapperClasses}" style="${wrapperStyles}">
131
129
  ${RenderIf(qtyStyle === 'standard', template /* liquid */ `
132
130
  <button
131
+ {% if available == false %} disabled {% endif %}
133
132
  ${{
134
133
  ...buttonLeftAttrs
135
134
  }}
@@ -138,11 +137,12 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
138
137
  >
139
138
  <span class="${iconWrapperClass}" style="${iconWidth}"
140
139
  >
141
- ${getPlusIcon(plusIcon)}
140
+ ${getPlusIcon(minusIcon)}
142
141
  </span>
143
142
  </button>
144
143
  `)}
145
144
  <input
145
+ {% if available == false %} disabled {% endif %}
146
146
  ${{
147
147
  ...inputAttrs
148
148
  }}
@@ -153,6 +153,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
153
153
 
154
154
  ${RenderIf(qtyStyle === 'standard', template /* liquid */ `
155
155
  <button
156
+ {% if available == false %} disabled {% endif %}
156
157
  ${{
157
158
  ...buttonRightAttrs
158
159
  }}
@@ -160,7 +161,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
160
161
  style="${buttonRightStyle}"
161
162
  >
162
163
  <span class="${iconWrapperClass}" style="${iconWidth}">
163
- ${getPlusIcon(minusIcon)}
164
+ ${getPlusIcon(plusIcon)}
164
165
  </span>
165
166
  </button>
166
167
  `)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.415",
3
+ "version": "2.0.0-dev.417",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",