@gem-sdk/components 2.0.0-dev.467 → 2.0.0-dev.469
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/dialog/components/Dialog.js +11 -8
- package/dist/cjs/dialog/components/Dialog.liquid.js +12 -8
- package/dist/cjs/dialog/components/common/getClasses.js +7 -0
- package/dist/cjs/dialog/components/common/getStyle.js +1 -4
- package/dist/cjs/dialog/setting/configs/settings.js +15 -2
- package/dist/cjs/dialog/setting/configs/uiV2.js +8 -0
- package/dist/cjs/product/components/ProductVariants/components/base/base.liquid.js +1 -1
- package/dist/cjs/product/setting/product-variant/configs/uiV2.js +79 -11
- package/dist/esm/dialog/components/Dialog.js +12 -9
- package/dist/esm/dialog/components/Dialog.liquid.js +13 -9
- package/dist/esm/dialog/components/common/getClasses.js +7 -1
- package/dist/esm/dialog/components/common/getStyle.js +1 -4
- package/dist/esm/dialog/setting/configs/settings.js +15 -2
- package/dist/esm/dialog/setting/configs/uiV2.js +8 -0
- package/dist/esm/product/components/ProductVariants/components/base/base.liquid.js +1 -1
- package/dist/esm/product/setting/product-variant/configs/uiV2.js +79 -11
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -11,11 +11,12 @@ var system = require('@gem-sdk/system');
|
|
|
11
11
|
var getAttr = require('./common/getAttr.js');
|
|
12
12
|
var getStyle = require('./common/getStyle.js');
|
|
13
13
|
var getClasses = require('./common/getClasses.js');
|
|
14
|
+
var ButtonIcon = require('../../button/components/ButtonIcon.js');
|
|
14
15
|
|
|
15
16
|
const Dialog = (props)=>{
|
|
16
17
|
const { setting, children, builderProps, style, advanced, builderAttrs } = props;
|
|
17
18
|
const display = advanced?.d;
|
|
18
|
-
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition } = setting ?? {};
|
|
19
|
+
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition, iconSvg } = setting ?? {};
|
|
19
20
|
const mode = core.useEditorMode();
|
|
20
21
|
const { ref, overlay, handleClickOverlay, closeModal, open, dialogId } = useDialog.useDialog(setting, builderProps, mode === 'edit');
|
|
21
22
|
const enableEffect = open;
|
|
@@ -84,6 +85,9 @@ const Dialog = (props)=>{
|
|
|
84
85
|
const svgContentStyle = system.createStyle({
|
|
85
86
|
...getStyle.getSvgContentStyle(iconSize)
|
|
86
87
|
});
|
|
88
|
+
const svgContentClasses = system.createClass({
|
|
89
|
+
...getClasses.getSvgContentClasses()
|
|
90
|
+
});
|
|
87
91
|
const bodyContentStyle = system.createStyle({
|
|
88
92
|
...getStyle.getBodyContentStyle(setting, style)
|
|
89
93
|
});
|
|
@@ -130,13 +134,12 @@ const Dialog = (props)=>{
|
|
|
130
134
|
className: buttonContentClasses,
|
|
131
135
|
style: buttonContentStyle,
|
|
132
136
|
onClick: closeModal,
|
|
133
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
137
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(ButtonIcon.default, {
|
|
138
|
+
iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
139
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
140
|
+
</svg>`,
|
|
141
|
+
styles: svgContentStyle,
|
|
142
|
+
classes: svgContentClasses
|
|
140
143
|
})
|
|
141
144
|
}),
|
|
142
145
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -8,12 +8,13 @@ var getAttr = require('./common/getAttr.js');
|
|
|
8
8
|
var getStyle = require('./common/getStyle.js');
|
|
9
9
|
var getClasses = require('./common/getClasses.js');
|
|
10
10
|
var helpers = require('../../helpers.js');
|
|
11
|
+
var ButtonIcon = require('../../button/components/ButtonIcon.js');
|
|
11
12
|
|
|
12
13
|
const Dialog = (props)=>{
|
|
13
14
|
const { setting, children, builderProps, style, advanced, builderAttrs } = props;
|
|
14
15
|
const display = advanced?.d;
|
|
15
16
|
const { frequency = 3, triggerPercentage = 0, trigger, triggerTime, frequencyMode = 'once', mobileTrigger, mobileTriggerTime, closeOnClickOutside } = setting ?? {};
|
|
16
|
-
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition } = setting ?? {};
|
|
17
|
+
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition, iconSvg } = setting ?? {};
|
|
17
18
|
const dialogId = setting?.dialogId ?? builderProps?.uid;
|
|
18
19
|
const stateData = system.createStateOrContext({
|
|
19
20
|
dialogId,
|
|
@@ -93,6 +94,9 @@ const Dialog = (props)=>{
|
|
|
93
94
|
const svgContentStyle = system.createStyle({
|
|
94
95
|
...getStyle.getSvgContentStyle(iconSize)
|
|
95
96
|
});
|
|
97
|
+
const svgContentClasses = system.createClass({
|
|
98
|
+
...getClasses.getSvgContentClasses()
|
|
99
|
+
});
|
|
96
100
|
const bodyContentStyle = system.createStyle({
|
|
97
101
|
...getStyle.getBodyContentStyle(setting, style)
|
|
98
102
|
});
|
|
@@ -148,13 +152,13 @@ const Dialog = (props)=>{
|
|
|
148
152
|
class="${buttonContentClasses}"
|
|
149
153
|
style="${buttonContentStyle}"
|
|
150
154
|
>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
${ButtonIcon.default({
|
|
156
|
+
iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
157
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
158
|
+
</svg>`,
|
|
159
|
+
styles: svgContentStyle,
|
|
160
|
+
classes: svgContentClasses
|
|
161
|
+
})}
|
|
158
162
|
</button>
|
|
159
163
|
<div
|
|
160
164
|
aria-label="Dialog body"
|
|
@@ -65,6 +65,12 @@ const getButtonContentClasses = (closeButtonPosition)=>{
|
|
|
65
65
|
...composeClasses(classList)
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
+
const getSvgContentClasses = ()=>{
|
|
69
|
+
const classList = 'gp-h-[var(--height-icon)] gp-w-auto [&>svg]:!gp-h-full [&>svg]:!gp-w-full';
|
|
70
|
+
return {
|
|
71
|
+
...composeClasses(classList)
|
|
72
|
+
};
|
|
73
|
+
};
|
|
68
74
|
const getBodyContentClasses = ()=>{
|
|
69
75
|
const classList = 'gp-h-full gp-w-full gp-overflow-y-auto gp-overflow-x-hidden !gp-max-h-screen';
|
|
70
76
|
return {
|
|
@@ -79,3 +85,4 @@ exports.getContainClasses = getContainClasses;
|
|
|
79
85
|
exports.getDialogContentClasses = getDialogContentClasses;
|
|
80
86
|
exports.getHeadContentClasses = getHeadContentClasses;
|
|
81
87
|
exports.getOverlayClasses = getOverlayClasses;
|
|
88
|
+
exports.getSvgContentClasses = getSvgContentClasses;
|
|
@@ -76,10 +76,7 @@ const getSvgContentStyle = (iconSize)=>{
|
|
|
76
76
|
let composeStyles = {};
|
|
77
77
|
if (iconSize) {
|
|
78
78
|
composeStyles = {
|
|
79
|
-
|
|
80
|
-
w: iconSize,
|
|
81
|
-
h: iconSize
|
|
82
|
-
})
|
|
79
|
+
'--height-icon': `${iconSize}`
|
|
83
80
|
};
|
|
84
81
|
}
|
|
85
82
|
return filterTruthyStyles(composeStyles);
|
|
@@ -197,6 +197,16 @@ const DialogSettings = [
|
|
|
197
197
|
type: 'input:stepper',
|
|
198
198
|
default: 32
|
|
199
199
|
},
|
|
200
|
+
{
|
|
201
|
+
id: 'iconSvg',
|
|
202
|
+
label: 'SVG Icon',
|
|
203
|
+
type: 'icon',
|
|
204
|
+
default: `
|
|
205
|
+
<svg viewBox="0 0 12 12" fill="currentColor">
|
|
206
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
207
|
+
</svg>
|
|
208
|
+
`
|
|
209
|
+
},
|
|
200
210
|
{
|
|
201
211
|
id: 'btnWidth',
|
|
202
212
|
type: 'input:unit',
|
|
@@ -226,6 +236,9 @@ const DialogSettings = [
|
|
|
226
236
|
{
|
|
227
237
|
id: 'btnPadding',
|
|
228
238
|
type: 'padding-v2',
|
|
239
|
+
devices: {
|
|
240
|
+
desktop: {}
|
|
241
|
+
},
|
|
229
242
|
compoDefaultValue: {
|
|
230
243
|
desktop: {
|
|
231
244
|
default: {
|
|
@@ -241,7 +254,7 @@ const DialogSettings = [
|
|
|
241
254
|
{
|
|
242
255
|
id: 'iconSize',
|
|
243
256
|
type: 'input:stepper',
|
|
244
|
-
default: '
|
|
257
|
+
default: '16px',
|
|
245
258
|
includeUnit: 'px'
|
|
246
259
|
},
|
|
247
260
|
// {
|
|
@@ -258,7 +271,7 @@ const DialogSettings = [
|
|
|
258
271
|
{
|
|
259
272
|
id: 'btnColor',
|
|
260
273
|
type: 'color-picker-v2',
|
|
261
|
-
default: '
|
|
274
|
+
default: 'text-1'
|
|
262
275
|
},
|
|
263
276
|
{
|
|
264
277
|
id: 'trigger',
|
|
@@ -57,7 +57,7 @@ const BaseVariant = (props)=>{
|
|
|
57
57
|
return core.template`
|
|
58
58
|
<div
|
|
59
59
|
class="${wrapperTextClasses}"
|
|
60
|
-
style="${isColorType ? getColorStyleLiquid() : ''} ${wrapperTextStyle}">
|
|
60
|
+
style="${isColorType ? getColorStyleLiquid() : ''} ${_function.getStyleOfObject(wrapperTextStyle)}">
|
|
61
61
|
${system.If(isUploadImageType, `<svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="#D6D6D6"></circle><path d="M0.196854 10.6453L2.40968 8.05946C2.4846 7.97175 2.57719 7.9008 2.68141 7.85124C2.78562 7.80168 2.89913 7.77461 3.01452 7.77181C3.12991 7.76902 3.2446 7.79055 3.3511 7.835C3.45761 7.87945 3.55353 7.94583 3.63262 8.02981L4.66733 9.12714L8.71205 4.29464C8.79123 4.19995 8.89077 4.1243 9.00325 4.07333C9.11573 4.02236 9.23827 3.99737 9.36176 4.00022C9.48524 4.00307 9.6065 4.03369 9.71651 4.08979C9.82651 4.1459 9.92245 4.22605 9.99717 4.32429L14.8329 10.6772C14.9254 10.7989 14.982 10.9441 14.9964 11.0962C15.0107 11.2484 14.9823 11.4016 14.9144 11.5385C14.8464 11.6754 14.7415 11.7907 14.6115 11.8713C14.4815 11.952 14.3316 11.9948 14.1786 11.995L0.822048 12C0.664945 11.9999 0.511148 11.9549 0.378853 11.8703C0.246557 11.7857 0.141299 11.6649 0.0755311 11.5224C0.00976323 11.3799 -0.013762 11.2216 0.00773837 11.0661C0.0292388 10.9107 0.0948652 10.7646 0.196854 10.6453Z" fill="#D6D6D6"></path></svg>`, ' ')}
|
|
62
62
|
<span class="${textClasses}" style="${textStyle}">{{value}}</span>
|
|
63
63
|
</div>
|
|
@@ -185,15 +185,6 @@ const SettingUIV2 = [
|
|
|
185
185
|
state: 'normal'
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
|
-
{
|
|
189
|
-
label: {
|
|
190
|
-
en: 'Has Shadow'
|
|
191
|
-
},
|
|
192
|
-
setting: {
|
|
193
|
-
id: 'optionHasShadow',
|
|
194
|
-
state: 'active'
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
188
|
{
|
|
198
189
|
label: {
|
|
199
190
|
en: 'Shadow'
|
|
@@ -359,7 +350,6 @@ const SettingUIV2 = [
|
|
|
359
350
|
label: {
|
|
360
351
|
en: 'Sold out style'
|
|
361
352
|
},
|
|
362
|
-
conditionDisplay: "optionType !== 'groupOption'",
|
|
363
353
|
controls: [
|
|
364
354
|
{
|
|
365
355
|
label: {
|
|
@@ -386,6 +376,84 @@ const SettingUIV2 = [
|
|
|
386
376
|
}
|
|
387
377
|
]
|
|
388
378
|
},
|
|
379
|
+
{
|
|
380
|
+
label: {
|
|
381
|
+
en: 'Shape'
|
|
382
|
+
},
|
|
383
|
+
controls: [
|
|
384
|
+
{
|
|
385
|
+
label: {
|
|
386
|
+
en: 'Border'
|
|
387
|
+
},
|
|
388
|
+
setting: {
|
|
389
|
+
id: 'border',
|
|
390
|
+
state: 'normal'
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
label: {
|
|
395
|
+
en: 'Corner'
|
|
396
|
+
},
|
|
397
|
+
setting: {
|
|
398
|
+
id: 'rounded',
|
|
399
|
+
state: 'normal'
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
label: {
|
|
404
|
+
en: 'Shadow'
|
|
405
|
+
},
|
|
406
|
+
setting: {
|
|
407
|
+
id: 'boxShadow',
|
|
408
|
+
state: 'normal'
|
|
409
|
+
},
|
|
410
|
+
options: {
|
|
411
|
+
updateFields: [
|
|
412
|
+
{
|
|
413
|
+
field: 'enable',
|
|
414
|
+
settingId: 'advanced.hasBoxShadow',
|
|
415
|
+
state: 'normal'
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
controlChangeTrigger: {
|
|
420
|
+
settings: [
|
|
421
|
+
{
|
|
422
|
+
condition: `boxShadow.normal.enable === true`,
|
|
423
|
+
source: [
|
|
424
|
+
'boxShadow',
|
|
425
|
+
'hasBoxShadow'
|
|
426
|
+
],
|
|
427
|
+
action: {
|
|
428
|
+
controlId: 'hasBoxShadow',
|
|
429
|
+
groupType: 'advanced',
|
|
430
|
+
controlType: 'advanced',
|
|
431
|
+
state: 'normal',
|
|
432
|
+
newValue: true
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
condition: `boxShadow.normal.enable === false`,
|
|
437
|
+
source: [
|
|
438
|
+
'boxShadow',
|
|
439
|
+
'hasBoxShadow'
|
|
440
|
+
],
|
|
441
|
+
action: {
|
|
442
|
+
controlId: 'hasBoxShadow',
|
|
443
|
+
groupType: 'advanced',
|
|
444
|
+
controlType: 'advanced',
|
|
445
|
+
state: 'normal',
|
|
446
|
+
newValue: false
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
options: {
|
|
451
|
+
noRecordHistory: true
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
},
|
|
389
457
|
{
|
|
390
458
|
label: {
|
|
391
459
|
en: 'Display condition'
|
|
@@ -439,7 +507,7 @@ const SettingUIV2 = [
|
|
|
439
507
|
options: {
|
|
440
508
|
labelVariant: 'primary',
|
|
441
509
|
fullWidth: true,
|
|
442
|
-
disableMessage: `
|
|
510
|
+
disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
|
|
443
511
|
}
|
|
444
512
|
}
|
|
445
513
|
]
|
|
@@ -6,12 +6,13 @@ import { useDialog } from './hooks/useDialog.js';
|
|
|
6
6
|
import { createAttr, createStyle, createClass, If } from '@gem-sdk/system';
|
|
7
7
|
import { getAttr, getAttrContainer, getAttrOverlay, getAttrClose } from './common/getAttr.js';
|
|
8
8
|
import { getWrapperStyle, getContainStyle, getBackdropStyle, getOverlayStyle, getDialogContentStyle, getButtonContentStyle, getSvgContentStyle, getBodyContentStyle } from './common/getStyle.js';
|
|
9
|
-
import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getBodyContentClasses } from './common/getClasses.js';
|
|
9
|
+
import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getSvgContentClasses, getBodyContentClasses } from './common/getClasses.js';
|
|
10
|
+
import ButtonIcon from '../../button/components/ButtonIcon.js';
|
|
10
11
|
|
|
11
12
|
const Dialog = (props)=>{
|
|
12
13
|
const { setting, children, builderProps, style, advanced, builderAttrs } = props;
|
|
13
14
|
const display = advanced?.d;
|
|
14
|
-
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition } = setting ?? {};
|
|
15
|
+
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition, iconSvg } = setting ?? {};
|
|
15
16
|
const mode = useEditorMode();
|
|
16
17
|
const { ref, overlay, handleClickOverlay, closeModal, open, dialogId } = useDialog(setting, builderProps, mode === 'edit');
|
|
17
18
|
const enableEffect = open;
|
|
@@ -80,6 +81,9 @@ const Dialog = (props)=>{
|
|
|
80
81
|
const svgContentStyle = createStyle({
|
|
81
82
|
...getSvgContentStyle(iconSize)
|
|
82
83
|
});
|
|
84
|
+
const svgContentClasses = createClass({
|
|
85
|
+
...getSvgContentClasses()
|
|
86
|
+
});
|
|
83
87
|
const bodyContentStyle = createStyle({
|
|
84
88
|
...getBodyContentStyle(setting, style)
|
|
85
89
|
});
|
|
@@ -126,13 +130,12 @@ const Dialog = (props)=>{
|
|
|
126
130
|
className: buttonContentClasses,
|
|
127
131
|
style: buttonContentStyle,
|
|
128
132
|
onClick: closeModal,
|
|
129
|
-
children: /*#__PURE__*/ jsx(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
})
|
|
133
|
+
children: /*#__PURE__*/ jsx(ButtonIcon, {
|
|
134
|
+
iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
135
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
136
|
+
</svg>`,
|
|
137
|
+
styles: svgContentStyle,
|
|
138
|
+
classes: svgContentClasses
|
|
136
139
|
})
|
|
137
140
|
}),
|
|
138
141
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -2,14 +2,15 @@ import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
|
2
2
|
import { createStateOrContext, createAttr, createStyle, createClass, If } from '@gem-sdk/system';
|
|
3
3
|
import { getAttr, getAttrContainer, getAttrOverlay, getAttrClose } from './common/getAttr.js';
|
|
4
4
|
import { getWrapperStyle, getContainStyle, getBackdropStyle, getOverlayStyle, getDialogContentStyle, getButtonContentStyle, getSvgContentStyle, getBodyContentStyle } from './common/getStyle.js';
|
|
5
|
-
import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getBodyContentClasses } from './common/getClasses.js';
|
|
5
|
+
import { getContainClasses, getBackdropClasses, getOverlayClasses, getDialogContentClasses, getHeadContentClasses, getButtonContentClasses, getSvgContentClasses, getBodyContentClasses } from './common/getClasses.js';
|
|
6
6
|
import { getSettingPreloadData } from '../../helpers.js';
|
|
7
|
+
import ButtonIcon from '../../button/components/ButtonIcon.js';
|
|
7
8
|
|
|
8
9
|
const Dialog = (props)=>{
|
|
9
10
|
const { setting, children, builderProps, style, advanced, builderAttrs } = props;
|
|
10
11
|
const display = advanced?.d;
|
|
11
12
|
const { frequency = 3, triggerPercentage = 0, trigger, triggerTime, frequencyMode = 'once', mobileTrigger, mobileTriggerTime, closeOnClickOutside } = setting ?? {};
|
|
12
|
-
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition } = setting ?? {};
|
|
13
|
+
const { name, fullScreen, width, height, position, overlayColor, overlayOpacity, iconSize, closeButtonPosition, iconSvg } = setting ?? {};
|
|
13
14
|
const dialogId = setting?.dialogId ?? builderProps?.uid;
|
|
14
15
|
const stateData = createStateOrContext({
|
|
15
16
|
dialogId,
|
|
@@ -89,6 +90,9 @@ const Dialog = (props)=>{
|
|
|
89
90
|
const svgContentStyle = createStyle({
|
|
90
91
|
...getSvgContentStyle(iconSize)
|
|
91
92
|
});
|
|
93
|
+
const svgContentClasses = createClass({
|
|
94
|
+
...getSvgContentClasses()
|
|
95
|
+
});
|
|
92
96
|
const bodyContentStyle = createStyle({
|
|
93
97
|
...getBodyContentStyle(setting, style)
|
|
94
98
|
});
|
|
@@ -144,13 +148,13 @@ const Dialog = (props)=>{
|
|
|
144
148
|
class="${buttonContentClasses}"
|
|
145
149
|
style="${buttonContentStyle}"
|
|
146
150
|
>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
${ButtonIcon({
|
|
152
|
+
iconSvg: iconSvg ?? `<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
153
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
154
|
+
</svg>`,
|
|
155
|
+
styles: svgContentStyle,
|
|
156
|
+
classes: svgContentClasses
|
|
157
|
+
})}
|
|
154
158
|
</button>
|
|
155
159
|
<div
|
|
156
160
|
aria-label="Dialog body"
|
|
@@ -63,6 +63,12 @@ const getButtonContentClasses = (closeButtonPosition)=>{
|
|
|
63
63
|
...composeClasses(classList)
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
+
const getSvgContentClasses = ()=>{
|
|
67
|
+
const classList = 'gp-h-[var(--height-icon)] gp-w-auto [&>svg]:!gp-h-full [&>svg]:!gp-w-full';
|
|
68
|
+
return {
|
|
69
|
+
...composeClasses(classList)
|
|
70
|
+
};
|
|
71
|
+
};
|
|
66
72
|
const getBodyContentClasses = ()=>{
|
|
67
73
|
const classList = 'gp-h-full gp-w-full gp-overflow-y-auto gp-overflow-x-hidden !gp-max-h-screen';
|
|
68
74
|
return {
|
|
@@ -70,4 +76,4 @@ const getBodyContentClasses = ()=>{
|
|
|
70
76
|
};
|
|
71
77
|
};
|
|
72
78
|
|
|
73
|
-
export { getBackdropClasses, getBodyContentClasses, getButtonContentClasses, getContainClasses, getDialogContentClasses, getHeadContentClasses, getOverlayClasses };
|
|
79
|
+
export { getBackdropClasses, getBodyContentClasses, getButtonContentClasses, getContainClasses, getDialogContentClasses, getHeadContentClasses, getOverlayClasses, getSvgContentClasses };
|
|
@@ -195,6 +195,16 @@ const DialogSettings = [
|
|
|
195
195
|
type: 'input:stepper',
|
|
196
196
|
default: 32
|
|
197
197
|
},
|
|
198
|
+
{
|
|
199
|
+
id: 'iconSvg',
|
|
200
|
+
label: 'SVG Icon',
|
|
201
|
+
type: 'icon',
|
|
202
|
+
default: `
|
|
203
|
+
<svg viewBox="0 0 12 12" fill="currentColor">
|
|
204
|
+
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
205
|
+
</svg>
|
|
206
|
+
`
|
|
207
|
+
},
|
|
198
208
|
{
|
|
199
209
|
id: 'btnWidth',
|
|
200
210
|
type: 'input:unit',
|
|
@@ -224,6 +234,9 @@ const DialogSettings = [
|
|
|
224
234
|
{
|
|
225
235
|
id: 'btnPadding',
|
|
226
236
|
type: 'padding-v2',
|
|
237
|
+
devices: {
|
|
238
|
+
desktop: {}
|
|
239
|
+
},
|
|
227
240
|
compoDefaultValue: {
|
|
228
241
|
desktop: {
|
|
229
242
|
default: {
|
|
@@ -239,7 +252,7 @@ const DialogSettings = [
|
|
|
239
252
|
{
|
|
240
253
|
id: 'iconSize',
|
|
241
254
|
type: 'input:stepper',
|
|
242
|
-
default: '
|
|
255
|
+
default: '16px',
|
|
243
256
|
includeUnit: 'px'
|
|
244
257
|
},
|
|
245
258
|
// {
|
|
@@ -256,7 +269,7 @@ const DialogSettings = [
|
|
|
256
269
|
{
|
|
257
270
|
id: 'btnColor',
|
|
258
271
|
type: 'color-picker-v2',
|
|
259
|
-
default: '
|
|
272
|
+
default: 'text-1'
|
|
260
273
|
},
|
|
261
274
|
{
|
|
262
275
|
id: 'trigger',
|
|
@@ -53,7 +53,7 @@ const BaseVariant = (props)=>{
|
|
|
53
53
|
return template`
|
|
54
54
|
<div
|
|
55
55
|
class="${wrapperTextClasses}"
|
|
56
|
-
style="${isColorType ? getColorStyleLiquid() : ''} ${wrapperTextStyle}">
|
|
56
|
+
style="${isColorType ? getColorStyleLiquid() : ''} ${getStyleOfObject(wrapperTextStyle)}">
|
|
57
57
|
${If(isUploadImageType, `<svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="#D6D6D6"></circle><path d="M0.196854 10.6453L2.40968 8.05946C2.4846 7.97175 2.57719 7.9008 2.68141 7.85124C2.78562 7.80168 2.89913 7.77461 3.01452 7.77181C3.12991 7.76902 3.2446 7.79055 3.3511 7.835C3.45761 7.87945 3.55353 7.94583 3.63262 8.02981L4.66733 9.12714L8.71205 4.29464C8.79123 4.19995 8.89077 4.1243 9.00325 4.07333C9.11573 4.02236 9.23827 3.99737 9.36176 4.00022C9.48524 4.00307 9.6065 4.03369 9.71651 4.08979C9.82651 4.1459 9.92245 4.22605 9.99717 4.32429L14.8329 10.6772C14.9254 10.7989 14.982 10.9441 14.9964 11.0962C15.0107 11.2484 14.9823 11.4016 14.9144 11.5385C14.8464 11.6754 14.7415 11.7907 14.6115 11.8713C14.4815 11.952 14.3316 11.9948 14.1786 11.995L0.822048 12C0.664945 11.9999 0.511148 11.9549 0.378853 11.8703C0.246557 11.7857 0.141299 11.6649 0.0755311 11.5224C0.00976323 11.3799 -0.013762 11.2216 0.00773837 11.0661C0.0292388 10.9107 0.0948652 10.7646 0.196854 10.6453Z" fill="#D6D6D6"></path></svg>`, ' ')}
|
|
58
58
|
<span class="${textClasses}" style="${textStyle}">{{value}}</span>
|
|
59
59
|
</div>
|
|
@@ -183,15 +183,6 @@ const SettingUIV2 = [
|
|
|
183
183
|
state: 'normal'
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
|
-
{
|
|
187
|
-
label: {
|
|
188
|
-
en: 'Has Shadow'
|
|
189
|
-
},
|
|
190
|
-
setting: {
|
|
191
|
-
id: 'optionHasShadow',
|
|
192
|
-
state: 'active'
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
186
|
{
|
|
196
187
|
label: {
|
|
197
188
|
en: 'Shadow'
|
|
@@ -357,7 +348,6 @@ const SettingUIV2 = [
|
|
|
357
348
|
label: {
|
|
358
349
|
en: 'Sold out style'
|
|
359
350
|
},
|
|
360
|
-
conditionDisplay: "optionType !== 'groupOption'",
|
|
361
351
|
controls: [
|
|
362
352
|
{
|
|
363
353
|
label: {
|
|
@@ -384,6 +374,84 @@ const SettingUIV2 = [
|
|
|
384
374
|
}
|
|
385
375
|
]
|
|
386
376
|
},
|
|
377
|
+
{
|
|
378
|
+
label: {
|
|
379
|
+
en: 'Shape'
|
|
380
|
+
},
|
|
381
|
+
controls: [
|
|
382
|
+
{
|
|
383
|
+
label: {
|
|
384
|
+
en: 'Border'
|
|
385
|
+
},
|
|
386
|
+
setting: {
|
|
387
|
+
id: 'border',
|
|
388
|
+
state: 'normal'
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
label: {
|
|
393
|
+
en: 'Corner'
|
|
394
|
+
},
|
|
395
|
+
setting: {
|
|
396
|
+
id: 'rounded',
|
|
397
|
+
state: 'normal'
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
label: {
|
|
402
|
+
en: 'Shadow'
|
|
403
|
+
},
|
|
404
|
+
setting: {
|
|
405
|
+
id: 'boxShadow',
|
|
406
|
+
state: 'normal'
|
|
407
|
+
},
|
|
408
|
+
options: {
|
|
409
|
+
updateFields: [
|
|
410
|
+
{
|
|
411
|
+
field: 'enable',
|
|
412
|
+
settingId: 'advanced.hasBoxShadow',
|
|
413
|
+
state: 'normal'
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
controlChangeTrigger: {
|
|
418
|
+
settings: [
|
|
419
|
+
{
|
|
420
|
+
condition: `boxShadow.normal.enable === true`,
|
|
421
|
+
source: [
|
|
422
|
+
'boxShadow',
|
|
423
|
+
'hasBoxShadow'
|
|
424
|
+
],
|
|
425
|
+
action: {
|
|
426
|
+
controlId: 'hasBoxShadow',
|
|
427
|
+
groupType: 'advanced',
|
|
428
|
+
controlType: 'advanced',
|
|
429
|
+
state: 'normal',
|
|
430
|
+
newValue: true
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
condition: `boxShadow.normal.enable === false`,
|
|
435
|
+
source: [
|
|
436
|
+
'boxShadow',
|
|
437
|
+
'hasBoxShadow'
|
|
438
|
+
],
|
|
439
|
+
action: {
|
|
440
|
+
controlId: 'hasBoxShadow',
|
|
441
|
+
groupType: 'advanced',
|
|
442
|
+
controlType: 'advanced',
|
|
443
|
+
state: 'normal',
|
|
444
|
+
newValue: false
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
options: {
|
|
449
|
+
noRecordHistory: true
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
},
|
|
387
455
|
{
|
|
388
456
|
label: {
|
|
389
457
|
en: 'Display condition'
|
|
@@ -437,7 +505,7 @@ const SettingUIV2 = [
|
|
|
437
505
|
options: {
|
|
438
506
|
labelVariant: 'primary',
|
|
439
507
|
fullWidth: true,
|
|
440
|
-
disableMessage: `
|
|
508
|
+
disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
|
|
441
509
|
}
|
|
442
510
|
}
|
|
443
511
|
]
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1404,6 +1404,7 @@ type Setting$2 = {
|
|
|
1404
1404
|
btnPadding?: ObjectDevices$1<PaddingType$1>;
|
|
1405
1405
|
background?: ObjectDevices$1<BackgroundMedia>;
|
|
1406
1406
|
iconSize?: string;
|
|
1407
|
+
iconSvg?: string;
|
|
1407
1408
|
effectType?: 'fade' | 'zoom' | 'zoom-out' | 'horizontal' | 'vertical' | 'unfold' | 'none';
|
|
1408
1409
|
position?: 'center' | 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
1409
1410
|
};
|
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.469",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
26
|
+
"@gem-sdk/core": "2.0.0-dev.468",
|
|
27
27
|
"@gem-sdk/styles": "2.0.0-dev.464",
|
|
28
28
|
"@gem-sdk/system": "2.0.0-dev.464",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|