@gem-sdk/components 2.0.0-dev.534 → 2.0.0-dev.535
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/estimate-delivery/components/EstimateDate.js +23 -58
- package/dist/cjs/estimate-delivery/components/common/getAdvanced.js +10 -0
- package/dist/cjs/estimate-delivery/components/common/getNewSetting.js +86 -0
- package/dist/cjs/estimate-delivery/components/common/getStyle.js +10 -0
- package/dist/cjs/estimate-delivery/index.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/settings.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/uiV1.js +1 -1
- package/dist/cjs/estimate-delivery/setting/configs/uiV2.js +1 -1
- package/dist/cjs/index.liquid.js +6 -5
- package/dist/cjs/tab/components/Tabs.js +0 -4
- package/dist/cjs/tab/components/common/getStyle.js +4 -11
- package/dist/cjs/tab/setting/Tabs.js +2 -1
- package/dist/cjs/tab/setting/configs/settings.js +62 -14
- package/dist/cjs/tab/setting/configs/uiV2.js +15 -2
- package/dist/cjs/text/components/TextInline.js +10 -11
- package/dist/cjs/text/components/common/getClasses.js +8 -4
- package/dist/cjs/text/components/common/getStyle.js +9 -0
- package/dist/esm/estimate-delivery/components/EstimateDate.js +23 -58
- package/dist/esm/estimate-delivery/components/common/getAdvanced.js +8 -0
- package/dist/esm/estimate-delivery/components/common/getNewSetting.js +84 -0
- package/dist/esm/estimate-delivery/components/common/getStyle.js +8 -0
- package/dist/esm/estimate-delivery/index.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/settings.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/uiV1.js +1 -1
- package/dist/esm/estimate-delivery/setting/configs/uiV2.js +1 -1
- package/dist/esm/index.liquid.js +5 -4
- package/dist/esm/tab/components/Tabs.js +1 -5
- package/dist/esm/tab/components/common/getStyle.js +5 -11
- package/dist/esm/tab/setting/Tabs.js +2 -1
- package/dist/esm/tab/setting/configs/settings.js +62 -14
- package/dist/esm/tab/setting/configs/uiV2.js +15 -2
- package/dist/esm/text/components/TextInline.js +11 -12
- package/dist/esm/text/components/common/getClasses.js +8 -5
- package/dist/esm/text/components/common/getStyle.js +9 -1
- package/dist/types/index.d.ts +41 -5
- package/package.json +2 -2
- /package/dist/cjs/estimate-delivery/{const.js → components/common/const.js} +0 -0
- /package/dist/esm/estimate-delivery/{const.js → components/common/const.js} +0 -0
|
@@ -1,73 +1,38 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { getNewSetting } from './common/getNewSetting.js';
|
|
4
|
+
import { createClass } from '@gem-sdk/system';
|
|
5
|
+
import { getClassAdvanced } from './common/getAdvanced.js';
|
|
4
6
|
import Text from '../../text/components/Text.js';
|
|
5
|
-
import { ESTIMATE_DAYS, getDayFormat, getFutureDay } from '../const.js';
|
|
6
|
-
import TextInline from '../../text/components/TextInline.js';
|
|
7
7
|
|
|
8
8
|
const EstimateDate = ({ setting, styles, builderAttrs, style, builderProps, advanced, children })=>{
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
default:
|
|
24
|
-
return 'div';
|
|
25
|
-
}
|
|
26
|
-
}, [
|
|
27
|
-
setting?.htmlTag
|
|
28
|
-
]);
|
|
29
|
-
const getDayEst = ()=>{
|
|
30
|
-
const currentDay = new Date(Date.now());
|
|
31
|
-
const settingTypeFormat = setting?.typeFormat === 'Custom' ? setting?.customFormat : setting?.typeFormat;
|
|
32
|
-
if (!settingTypeFormat) return '';
|
|
33
|
-
if (setting?.typeEstimate === ESTIMATE_DAYS.SPECIFIC) {
|
|
34
|
-
const text = `${getDayFormat(getFutureDay(Number(setting?.estimateTime)), settingTypeFormat)}`;
|
|
35
|
-
return text;
|
|
36
|
-
}
|
|
37
|
-
getDayFormat(currentDay);
|
|
38
|
-
const text = `${getDayFormat(getFutureDay(Number(setting?.minEstimate)), settingTypeFormat)} - ${getDayFormat(getFutureDay(Number(setting?.maxEstimate)), settingTypeFormat)}`;
|
|
39
|
-
return text;
|
|
40
|
-
};
|
|
9
|
+
const wrapperClasses = createClass({
|
|
10
|
+
'estimate-date-container': true
|
|
11
|
+
});
|
|
12
|
+
const advancedClass = getClassAdvanced({
|
|
13
|
+
setting,
|
|
14
|
+
advanced,
|
|
15
|
+
type: 'React'
|
|
16
|
+
});
|
|
17
|
+
const newSetting = getNewSetting({
|
|
18
|
+
type: 'React',
|
|
19
|
+
styles,
|
|
20
|
+
setting,
|
|
21
|
+
builderProps
|
|
22
|
+
});
|
|
41
23
|
return /*#__PURE__*/ jsx(Text, {
|
|
42
24
|
builderProps: builderProps,
|
|
43
25
|
builderAttrs: builderAttrs,
|
|
44
|
-
advanced:
|
|
26
|
+
advanced: {
|
|
27
|
+
...advanced,
|
|
28
|
+
cssClass: advancedClass
|
|
29
|
+
},
|
|
45
30
|
style: style,
|
|
46
31
|
styles: {
|
|
47
32
|
align: styles?.align
|
|
48
33
|
},
|
|
49
|
-
setting:
|
|
50
|
-
|
|
51
|
-
styles: {
|
|
52
|
-
align: styles?.align,
|
|
53
|
-
typo: styles?.typoCustom
|
|
54
|
-
},
|
|
55
|
-
setting: {
|
|
56
|
-
text: setting?.customText
|
|
57
|
-
}
|
|
58
|
-
}) : ''} ${TextInline({
|
|
59
|
-
styles: {
|
|
60
|
-
align: styles?.align,
|
|
61
|
-
typo: styles?.typoDate
|
|
62
|
-
},
|
|
63
|
-
setting: {
|
|
64
|
-
text: getDayEst()
|
|
65
|
-
}
|
|
66
|
-
})}`,
|
|
67
|
-
htmlTag: headingLevel,
|
|
68
|
-
globalSize: setting?.globalSize,
|
|
69
|
-
background: setting?.background
|
|
70
|
-
},
|
|
34
|
+
setting: newSetting,
|
|
35
|
+
className: wrapperClasses,
|
|
71
36
|
children: children
|
|
72
37
|
});
|
|
73
38
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OUT_OF_STOCK } from './const.js';
|
|
2
|
+
|
|
3
|
+
const getClassAdvanced = ({ setting, advanced, type })=>{
|
|
4
|
+
const conditionRenderClassHiddenLiquid = type === 'Liquid' && setting?.ifOutOfStock === OUT_OF_STOCK.HIDE;
|
|
5
|
+
return `${conditionRenderClassHiddenLiquid && '{% if product %} !gp-hidden trigger-hidden-class {% endif %}'} ${advanced?.cssClass}`;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { getClassAdvanced };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import TextInline from '../../../text/components/TextInline.js';
|
|
2
|
+
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
|
+
import { ESTIMATE_DAYS, getDayFormat, getFutureDay } from './const.js';
|
|
4
|
+
import { createClass } from '@gem-sdk/system';
|
|
5
|
+
import { getStyleEstimateDate } from './getStyle.js';
|
|
6
|
+
|
|
7
|
+
const getDayEst = (setting)=>{
|
|
8
|
+
const currentDay = new Date(Date.now());
|
|
9
|
+
const settingTypeFormat = setting?.typeFormat === 'Custom' ? setting?.customFormat : setting?.typeFormat;
|
|
10
|
+
if (!settingTypeFormat) return '';
|
|
11
|
+
if (setting?.typeEstimate === ESTIMATE_DAYS.SPECIFIC) {
|
|
12
|
+
const text = `${getDayFormat(getFutureDay(Number(setting?.estimateTime)), settingTypeFormat)}`;
|
|
13
|
+
return text;
|
|
14
|
+
}
|
|
15
|
+
getDayFormat(currentDay);
|
|
16
|
+
const text = `${getDayFormat(getFutureDay(Number(setting?.minEstimate)), settingTypeFormat)} - ${getDayFormat(getFutureDay(Number(setting?.maxEstimate)), settingTypeFormat)}`;
|
|
17
|
+
return text;
|
|
18
|
+
};
|
|
19
|
+
const EstimateDateLevel = (setting)=>{
|
|
20
|
+
switch(setting?.htmlTag){
|
|
21
|
+
case 1:
|
|
22
|
+
return 'h1';
|
|
23
|
+
case 2:
|
|
24
|
+
return 'h2';
|
|
25
|
+
case 3:
|
|
26
|
+
return 'h3';
|
|
27
|
+
case 4:
|
|
28
|
+
return 'h4';
|
|
29
|
+
case 5:
|
|
30
|
+
return 'h5';
|
|
31
|
+
case 6:
|
|
32
|
+
return 'h6';
|
|
33
|
+
default:
|
|
34
|
+
return 'div';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const getNewSetting = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
38
|
+
const isReact = type === 'React';
|
|
39
|
+
const textContent = getTextContent({
|
|
40
|
+
type,
|
|
41
|
+
styles,
|
|
42
|
+
setting,
|
|
43
|
+
builderProps,
|
|
44
|
+
pageContext
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
text: textContent,
|
|
48
|
+
htmlTag: EstimateDateLevel(setting),
|
|
49
|
+
globalSize: setting?.globalSize,
|
|
50
|
+
background: setting?.background,
|
|
51
|
+
...!isReact && {
|
|
52
|
+
translate: setting?.translate,
|
|
53
|
+
isForceValue: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const getTextContent = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
58
|
+
const isReact = type === 'React';
|
|
59
|
+
const estimateClasses = createClass({
|
|
60
|
+
'estimate-date-main': true
|
|
61
|
+
});
|
|
62
|
+
const textWithTranslate = isReact ? setting?.customText : getDynamicSourceLocales({
|
|
63
|
+
val: setting?.customText,
|
|
64
|
+
uid: builderProps?.uid,
|
|
65
|
+
settingId: setting?.translate || '',
|
|
66
|
+
pageContext,
|
|
67
|
+
isCapitalize: styles?.typo?.attrs?.transform === 'capitalize',
|
|
68
|
+
translate: setting?.translate
|
|
69
|
+
}).toString();
|
|
70
|
+
return `${TextInline({
|
|
71
|
+
styles: getStyleEstimateDate(styles, 'typoCustom'),
|
|
72
|
+
setting: {
|
|
73
|
+
text: textWithTranslate
|
|
74
|
+
}
|
|
75
|
+
})} ${TextInline({
|
|
76
|
+
styles: getStyleEstimateDate(styles, 'typoDate'),
|
|
77
|
+
setting: {
|
|
78
|
+
text: getDayEst(setting)
|
|
79
|
+
},
|
|
80
|
+
className: estimateClasses
|
|
81
|
+
})}`;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { getNewSetting };
|
package/dist/esm/index.liquid.js
CHANGED
|
@@ -28,10 +28,6 @@ export { default as Countdown } from './countdown-timer/components/Countdown.liq
|
|
|
28
28
|
export { default as Coupon } from './coupon/components/Coupon.liquid.js';
|
|
29
29
|
export { default as Dialog } from './dialog/components/Dialog.liquid.js';
|
|
30
30
|
import '@gem-sdk/core';
|
|
31
|
-
export { default as Text } from './text/components/Text.liquid.js';
|
|
32
|
-
import 'react/jsx-runtime';
|
|
33
|
-
import 'react';
|
|
34
|
-
import 'next/link';
|
|
35
31
|
export { default as Col } from './grid/col/Col.liquid.js';
|
|
36
32
|
export { default as Row } from './grid/row/Row.liquid.js';
|
|
37
33
|
export { default as Section } from './grid/section/Section.liquid.js';
|
|
@@ -57,6 +53,7 @@ export { default as ImageComparison } from './image-comparison/components/ImageC
|
|
|
57
53
|
export { default as Line } from './line/components/Line.liquid.js';
|
|
58
54
|
export { default as MarqueeItem } from './marquee/components/MarqueeItem.liquid.js';
|
|
59
55
|
export { default as Marquee } from './marquee/components/Marquee.liquid.js';
|
|
56
|
+
export { default as Text } from './text/components/Text.liquid.js';
|
|
60
57
|
export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.liquid.js';
|
|
61
58
|
export { default as FileUpload } from './product/components/FileUpload/components/UploadFile.liquid.js';
|
|
62
59
|
export { default as Product } from './product/components/ProductWrap/Product.liquid.js';
|
|
@@ -199,3 +196,7 @@ export { default as StellarDeliveryDatePickup } from './third-party/components/S
|
|
|
199
196
|
export { default as ThirdPartySlot } from './third-party-slot/components/ThirdPartySlot.liquid.js';
|
|
200
197
|
export { default as ShopPayInstallments } from './shop-pay-installment/components/ShopPayInstallments.liquid.js';
|
|
201
198
|
export { default as Sticky } from './sticky/components/Sticky.liquid.js';
|
|
199
|
+
import 'react/jsx-runtime';
|
|
200
|
+
import 'react';
|
|
201
|
+
import 'next/link';
|
|
202
|
+
import '@gem-sdk/system';
|
|
@@ -6,7 +6,7 @@ import { useTab } from './hooks/useTab.js';
|
|
|
6
6
|
import { createAttr, createStyle, createClass } from '@gem-sdk/system';
|
|
7
7
|
import { getAttr, getAttrContent } from './common/getAttr.js';
|
|
8
8
|
import Text from '../../text/components/Text.js';
|
|
9
|
-
import { getStyleWrapper,
|
|
9
|
+
import { getStyleWrapper, getTabParentListStyle, getTabListStyle, getContainContentStyle, getItemStyle } from './common/getStyle.js';
|
|
10
10
|
import { getClassesWrapper, getContainClasses, getStyleTagClasses, getTabParentListClasses, getTabListClasses, getWrapperContentClasses, getContainContentClasses, getTextClasses, getItemClasses } from './common/getClasses.js';
|
|
11
11
|
|
|
12
12
|
const Tabs = (props)=>{
|
|
@@ -29,9 +29,6 @@ const Tabs = (props)=>{
|
|
|
29
29
|
const wrapperStyle = createStyle({
|
|
30
30
|
...getStyleWrapper(setting, style)
|
|
31
31
|
});
|
|
32
|
-
const containStyle = createStyle({
|
|
33
|
-
...getContainStyle(setting)
|
|
34
|
-
});
|
|
35
32
|
const wrapperClasses = createClass({
|
|
36
33
|
...getClassesWrapper({
|
|
37
34
|
builderProps,
|
|
@@ -148,7 +145,6 @@ const Tabs = (props)=>{
|
|
|
148
145
|
}),
|
|
149
146
|
/*#__PURE__*/ jsxs("div", {
|
|
150
147
|
className: containClasses,
|
|
151
|
-
style: containStyle,
|
|
152
148
|
children: [
|
|
153
149
|
/*#__PURE__*/ jsx("div", {
|
|
154
150
|
className: tabParentListClasses,
|
|
@@ -3,7 +3,7 @@ import { filterTruthyStyles } from '../../../helpers.js';
|
|
|
3
3
|
import { getStyleWidthByPositionResponsive, initialStyles } from './common.js';
|
|
4
4
|
|
|
5
5
|
const getStyleWrapper = (setting, style)=>{
|
|
6
|
-
const { background } = setting ?? {};
|
|
6
|
+
const { background, containWidth, align } = setting ?? {};
|
|
7
7
|
const composeStyles = {
|
|
8
8
|
...style,
|
|
9
9
|
...getStyleBackgroundByDevice(background),
|
|
@@ -11,15 +11,9 @@ const getStyleWrapper = (setting, style)=>{
|
|
|
11
11
|
desktop: true,
|
|
12
12
|
tablet: true,
|
|
13
13
|
mobile: true
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
const getContainStyle = (setting)=>{
|
|
19
|
-
const { containWidth, align } = setting ?? {};
|
|
20
|
-
const composeStyles = {
|
|
21
|
-
...makeStyleResponsive('js', align),
|
|
22
|
-
...makeStyleResponsive('w', makeWidth(containWidth))
|
|
14
|
+
}),
|
|
15
|
+
...makeStyleResponsive('w', makeWidth(containWidth)),
|
|
16
|
+
...makeStyleResponsive('as', align)
|
|
23
17
|
};
|
|
24
18
|
return filterTruthyStyles(composeStyles);
|
|
25
19
|
};
|
|
@@ -95,4 +89,4 @@ const getTabItemStyle = (style)=>{
|
|
|
95
89
|
return filterTruthyStyles(composeStyles);
|
|
96
90
|
};
|
|
97
91
|
|
|
98
|
-
export { getContainContentStyle,
|
|
92
|
+
export { getContainContentStyle, getItemStyle, getStyleWrapper, getTabItemStyle, getTabListStyle, getTabParentListStyle };
|
|
@@ -8,7 +8,8 @@ const TabsSettings = [
|
|
|
8
8
|
type: 'child-item',
|
|
9
9
|
default: [
|
|
10
10
|
'Tab 1',
|
|
11
|
-
'Tab 2'
|
|
11
|
+
'Tab 2',
|
|
12
|
+
'Tab 3'
|
|
12
13
|
],
|
|
13
14
|
expandItem: true
|
|
14
15
|
},
|
|
@@ -69,7 +70,10 @@ const TabsSettings = [
|
|
|
69
70
|
id: 'labelTypoV2',
|
|
70
71
|
type: 'typography-v2',
|
|
71
72
|
default: {
|
|
72
|
-
type: 'paragraph-1'
|
|
73
|
+
type: 'paragraph-1',
|
|
74
|
+
attrs: {
|
|
75
|
+
color: 'text-1'
|
|
76
|
+
}
|
|
73
77
|
},
|
|
74
78
|
hiddenSetting: {
|
|
75
79
|
},
|
|
@@ -148,10 +152,7 @@ const TabsSettings = [
|
|
|
148
152
|
},
|
|
149
153
|
{
|
|
150
154
|
id: 'padding',
|
|
151
|
-
type: 'padding-v2'
|
|
152
|
-
devices: {
|
|
153
|
-
desktop: {}
|
|
154
|
-
}
|
|
155
|
+
type: 'padding-v2'
|
|
155
156
|
},
|
|
156
157
|
{
|
|
157
158
|
id: 'labelAlign',
|
|
@@ -182,6 +183,18 @@ const TabsSettings = [
|
|
|
182
183
|
}
|
|
183
184
|
]
|
|
184
185
|
},
|
|
186
|
+
{
|
|
187
|
+
id: 'enableHoverEffect',
|
|
188
|
+
label: '',
|
|
189
|
+
type: 'toggle',
|
|
190
|
+
default: false
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'enableActiveEffect',
|
|
194
|
+
label: '',
|
|
195
|
+
type: 'toggle',
|
|
196
|
+
default: false
|
|
197
|
+
},
|
|
185
198
|
{
|
|
186
199
|
id: 'behavior-state-group',
|
|
187
200
|
type: 'behavior-state',
|
|
@@ -197,6 +210,10 @@ const TabsSettings = [
|
|
|
197
210
|
normal: true,
|
|
198
211
|
hover: true,
|
|
199
212
|
active: true
|
|
213
|
+
},
|
|
214
|
+
compoDefaultValue: {
|
|
215
|
+
normal: 'bg-2',
|
|
216
|
+
hover: 'bg-2'
|
|
200
217
|
}
|
|
201
218
|
},
|
|
202
219
|
{
|
|
@@ -204,12 +221,17 @@ const TabsSettings = [
|
|
|
204
221
|
label: 'Text Color',
|
|
205
222
|
type: 'color-picker-v2',
|
|
206
223
|
default: {
|
|
207
|
-
normal: '
|
|
224
|
+
normal: 'text-1'
|
|
208
225
|
},
|
|
209
226
|
state: {
|
|
210
227
|
normal: true,
|
|
211
228
|
hover: true,
|
|
212
229
|
active: true
|
|
230
|
+
},
|
|
231
|
+
compoDefaultValue: {
|
|
232
|
+
normal: 'text-1',
|
|
233
|
+
hover: 'text-1',
|
|
234
|
+
active: 'text-1'
|
|
213
235
|
}
|
|
214
236
|
},
|
|
215
237
|
{
|
|
@@ -221,7 +243,7 @@ const TabsSettings = [
|
|
|
221
243
|
border: 'none',
|
|
222
244
|
width: '1px 1px 1px 1px',
|
|
223
245
|
borderWidth: '1px',
|
|
224
|
-
color: '#
|
|
246
|
+
color: '#7D7D7D',
|
|
225
247
|
isCustom: false,
|
|
226
248
|
position: 'all'
|
|
227
249
|
},
|
|
@@ -229,7 +251,7 @@ const TabsSettings = [
|
|
|
229
251
|
border: 'none',
|
|
230
252
|
width: '1px 1px 1px 1px',
|
|
231
253
|
borderWidth: '1px',
|
|
232
|
-
color: '
|
|
254
|
+
color: 'line-2',
|
|
233
255
|
isCustom: false,
|
|
234
256
|
position: 'all'
|
|
235
257
|
},
|
|
@@ -237,7 +259,7 @@ const TabsSettings = [
|
|
|
237
259
|
border: 'solid',
|
|
238
260
|
width: '0px 0px 2px 0px',
|
|
239
261
|
borderWidth: '2px',
|
|
240
|
-
color: '
|
|
262
|
+
color: 'line-2',
|
|
241
263
|
position: 'bottom',
|
|
242
264
|
isCustom: true
|
|
243
265
|
}
|
|
@@ -246,6 +268,32 @@ const TabsSettings = [
|
|
|
246
268
|
hover: true,
|
|
247
269
|
normal: true,
|
|
248
270
|
active: true
|
|
271
|
+
},
|
|
272
|
+
compoDefaultValue: {
|
|
273
|
+
normal: {
|
|
274
|
+
border: 'solid',
|
|
275
|
+
width: '1px 1px 1px 1px',
|
|
276
|
+
borderWidth: '1px',
|
|
277
|
+
color: '#7D7D7D',
|
|
278
|
+
isCustom: false,
|
|
279
|
+
position: 'all'
|
|
280
|
+
},
|
|
281
|
+
hover: {
|
|
282
|
+
border: 'solid',
|
|
283
|
+
width: '1px 1px 1px 1px',
|
|
284
|
+
borderWidth: '1px',
|
|
285
|
+
color: 'line-2',
|
|
286
|
+
isCustom: false,
|
|
287
|
+
position: 'all'
|
|
288
|
+
},
|
|
289
|
+
active: {
|
|
290
|
+
border: 'solid',
|
|
291
|
+
width: '1px 1px 1px 1px',
|
|
292
|
+
borderWidth: '1px',
|
|
293
|
+
color: 'line-1',
|
|
294
|
+
isCustom: false,
|
|
295
|
+
position: 'all'
|
|
296
|
+
}
|
|
249
297
|
}
|
|
250
298
|
}
|
|
251
299
|
]
|
|
@@ -260,7 +308,7 @@ const TabsSettings = [
|
|
|
260
308
|
],
|
|
261
309
|
devices: {
|
|
262
310
|
desktop: {
|
|
263
|
-
default: '
|
|
311
|
+
default: '1200px'
|
|
264
312
|
}
|
|
265
313
|
}
|
|
266
314
|
},
|
|
@@ -316,7 +364,7 @@ const TabsSettings = [
|
|
|
316
364
|
options: [
|
|
317
365
|
{
|
|
318
366
|
label: 'Left',
|
|
319
|
-
value: '
|
|
367
|
+
value: 'start',
|
|
320
368
|
type: 'align',
|
|
321
369
|
tooltip: 'Align left',
|
|
322
370
|
iconName: 'gp-align-left'
|
|
@@ -330,7 +378,7 @@ const TabsSettings = [
|
|
|
330
378
|
},
|
|
331
379
|
{
|
|
332
380
|
label: 'Right',
|
|
333
|
-
value: '
|
|
381
|
+
value: 'end',
|
|
334
382
|
type: 'align',
|
|
335
383
|
tooltip: 'Align right',
|
|
336
384
|
iconName: 'gp-align-right'
|
|
@@ -338,7 +386,7 @@ const TabsSettings = [
|
|
|
338
386
|
],
|
|
339
387
|
devices: {
|
|
340
388
|
desktop: {
|
|
341
|
-
default: '
|
|
389
|
+
default: 'center'
|
|
342
390
|
}
|
|
343
391
|
}
|
|
344
392
|
}
|
|
@@ -162,7 +162,9 @@ const SettingUIV2 = [
|
|
|
162
162
|
type: 'combo',
|
|
163
163
|
iconName: 'polaris-edit',
|
|
164
164
|
fixedValue: 'Enabled',
|
|
165
|
-
|
|
165
|
+
setting: {
|
|
166
|
+
id: 'enableHoverEffect'
|
|
167
|
+
},
|
|
166
168
|
popoverLabel: {
|
|
167
169
|
en: 'Tabs hover effect'
|
|
168
170
|
},
|
|
@@ -176,6 +178,15 @@ const SettingUIV2 = [
|
|
|
176
178
|
state: 'hover'
|
|
177
179
|
}
|
|
178
180
|
},
|
|
181
|
+
{
|
|
182
|
+
label: {
|
|
183
|
+
en: 'Background'
|
|
184
|
+
},
|
|
185
|
+
setting: {
|
|
186
|
+
id: 'labelBgColor',
|
|
187
|
+
state: 'hover'
|
|
188
|
+
}
|
|
189
|
+
},
|
|
179
190
|
{
|
|
180
191
|
label: {
|
|
181
192
|
en: 'Border'
|
|
@@ -192,9 +203,11 @@ const SettingUIV2 = [
|
|
|
192
203
|
en: 'Active state'
|
|
193
204
|
},
|
|
194
205
|
type: 'combo',
|
|
206
|
+
setting: {
|
|
207
|
+
id: 'enableActiveEffect'
|
|
208
|
+
},
|
|
195
209
|
iconName: 'polaris-edit',
|
|
196
210
|
fixedValue: 'Enabled',
|
|
197
|
-
isHideClear: true,
|
|
198
211
|
popoverLabel: {
|
|
199
212
|
en: 'Tabs active state'
|
|
200
213
|
},
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cls, composeTypographyClassName } from '@gem-sdk/core';
|
|
2
|
+
import { createClass, createStyle } from '@gem-sdk/system';
|
|
3
|
+
import { getTextStyleInline } from './common/getStyle.js';
|
|
4
|
+
import { composeClasses } from './common/getClasses.js';
|
|
2
5
|
|
|
3
6
|
const TextInline = ({ styles, setting, className, elementAttrs, ...props })=>{
|
|
4
|
-
const appendTypoStyle = composeTypographyStyle(styles?.typo);
|
|
5
|
-
const appendTypoClass = composeTypographyClassName(styles?.typo);
|
|
6
7
|
const { text } = setting ?? {};
|
|
8
|
+
const getClassText = createClass({
|
|
9
|
+
...composeClasses(cls(className, composeTypographyClassName(styles?.typo)))
|
|
10
|
+
});
|
|
7
11
|
const getStyleText = ()=>{
|
|
8
|
-
const objectStyle = {
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
overflow: 'hidden'
|
|
12
|
-
};
|
|
12
|
+
const objectStyle = createStyle({
|
|
13
|
+
...getTextStyleInline(styles)
|
|
14
|
+
});
|
|
13
15
|
const styleInline = Object.entries(objectStyle).map(([key, value])=>`${key}:${value}`).join(';');
|
|
14
16
|
return styleInline;
|
|
15
17
|
};
|
|
16
18
|
return `
|
|
17
19
|
<span
|
|
18
|
-
${{
|
|
19
|
-
...elementAttrs
|
|
20
|
-
}}
|
|
21
20
|
${{
|
|
22
21
|
...props
|
|
23
22
|
}}
|
|
24
|
-
class="${
|
|
23
|
+
class="${getClassText}"
|
|
25
24
|
style="${getStyleText()}"
|
|
26
25
|
>
|
|
27
26
|
${text}
|
|
@@ -17,10 +17,7 @@ const getContainerClasses = ({ setting })=>{
|
|
|
17
17
|
const { excludeFlex } = setting ?? {};
|
|
18
18
|
let classList = '';
|
|
19
19
|
if (!excludeFlex) classList += ' gp-flex';
|
|
20
|
-
return classList
|
|
21
|
-
acc[item] = true;
|
|
22
|
-
return acc;
|
|
23
|
-
}, {});
|
|
20
|
+
return composeClasses(classList);
|
|
24
21
|
};
|
|
25
22
|
const getTextClasses = ({ styles, setting, className, mode })=>{
|
|
26
23
|
const { text, options } = setting ?? {};
|
|
@@ -51,5 +48,11 @@ const getTextClasses = ({ styles, setting, className, mode })=>{
|
|
|
51
48
|
...staticClasses
|
|
52
49
|
};
|
|
53
50
|
};
|
|
51
|
+
function composeClasses(classList) {
|
|
52
|
+
return classList.split(' ').reduce((acc, item)=>{
|
|
53
|
+
acc[item] = true;
|
|
54
|
+
return acc;
|
|
55
|
+
}, {});
|
|
56
|
+
}
|
|
54
57
|
|
|
55
|
-
export { getClasses, getContainerClasses, getTextClasses };
|
|
58
|
+
export { composeClasses, getClasses, getContainerClasses, getTextClasses };
|
|
@@ -61,5 +61,13 @@ const getTextStyle = (styles, setting)=>{
|
|
|
61
61
|
};
|
|
62
62
|
return filterTruthyStyles(composeStyles);
|
|
63
63
|
};
|
|
64
|
+
const getTextStyleInline = (styles)=>{
|
|
65
|
+
const composeStyles = {
|
|
66
|
+
...composeTypographyStyle(styles?.typo),
|
|
67
|
+
'word-break': 'break-word',
|
|
68
|
+
overflow: 'hidden'
|
|
69
|
+
};
|
|
70
|
+
return filterTruthyStyles(composeStyles);
|
|
71
|
+
};
|
|
64
72
|
|
|
65
|
-
export { getContainerStyle, getStyle, getTextStyle };
|
|
73
|
+
export { getContainerStyle, getStyle, getTextStyle, getTextStyleInline };
|