@gem-sdk/core 1.10.30 → 1.10.38
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.
|
@@ -10,65 +10,65 @@ const getBorderStyle = (value)=>{
|
|
|
10
10
|
bw: value?.width
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
const handleConvertBorderStyle = (value)=>{
|
|
13
|
+
const handleConvertBorderStyle = (value, type)=>{
|
|
14
14
|
if (!value) return undefined;
|
|
15
15
|
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
16
16
|
const data = value;
|
|
17
17
|
const newVal = {
|
|
18
18
|
desktop: {
|
|
19
|
-
normal: data.desktop?.normal?.border,
|
|
20
|
-
hover: data.desktop?.hover?.border,
|
|
21
|
-
focus: data.desktop?.focus?.border
|
|
19
|
+
normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data.desktop?.normal?.isCustom ? 'solid' : data.desktop?.normal?.border,
|
|
20
|
+
hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data.desktop?.hover?.isCustom ? 'solid' : data.desktop?.hover?.border,
|
|
21
|
+
focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data.desktop?.focus?.isCustom ? 'solid' : data.desktop?.focus?.border
|
|
22
22
|
},
|
|
23
23
|
tablet: {
|
|
24
|
-
normal: data.tablet?.normal?.border,
|
|
25
|
-
hover: data.tablet?.hover?.border,
|
|
26
|
-
focus: data.tablet?.focus?.border
|
|
24
|
+
normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data.tablet?.normal?.isCustom ? 'solid' : data.tablet?.normal?.border,
|
|
25
|
+
hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data.tablet?.hover?.isCustom ? 'solid' : data.tablet?.hover?.border,
|
|
26
|
+
focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data.tablet?.focus?.isCustom ? 'solid' : data.tablet?.focus?.border
|
|
27
27
|
},
|
|
28
28
|
mobile: {
|
|
29
|
-
normal: data.mobile?.normal?.border,
|
|
30
|
-
hover: data.mobile?.hover?.border,
|
|
31
|
-
focus: data.mobile?.focus?.border
|
|
29
|
+
normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data.mobile?.normal?.isCustom ? 'solid' : data.mobile?.normal?.border,
|
|
30
|
+
hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data.mobile?.hover?.isCustom ? 'solid' : data.mobile?.hover?.border,
|
|
31
|
+
focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data.mobile?.focus?.isCustom ? 'solid' : data.mobile?.focus?.border
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
return makeStyle.makeStyleResponsiveState('bs', newVal);
|
|
35
35
|
}
|
|
36
36
|
const data = value;
|
|
37
37
|
const newVal = {
|
|
38
|
-
normal: data?.normal?.border,
|
|
39
|
-
hover: data?.hover?.border,
|
|
40
|
-
focus: data?.focus?.border
|
|
38
|
+
normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? 'solid' : data?.normal?.border,
|
|
39
|
+
hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? 'solid' : data?.hover?.border,
|
|
40
|
+
focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? 'solid' : data?.focus?.border
|
|
41
41
|
};
|
|
42
42
|
return makeStyle.makeStyleState('bs', newVal);
|
|
43
43
|
};
|
|
44
|
-
const handleConvertBorderWidth = (value)=>{
|
|
44
|
+
const handleConvertBorderWidth = (value, type)=>{
|
|
45
45
|
if (!value) return undefined;
|
|
46
46
|
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
47
47
|
const data = value;
|
|
48
48
|
const newVal = {
|
|
49
49
|
desktop: {
|
|
50
|
-
normal: data.desktop?.normal?.width,
|
|
51
|
-
hover: data.desktop?.hover?.width,
|
|
52
|
-
focus: data.desktop?.focus?.width
|
|
50
|
+
normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.normal?.width,
|
|
51
|
+
hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.hover?.width,
|
|
52
|
+
focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.focus?.width
|
|
53
53
|
},
|
|
54
54
|
tablet: {
|
|
55
|
-
normal: data.tablet?.normal?.width,
|
|
56
|
-
hover: data.tablet?.hover?.width,
|
|
57
|
-
focus: data.tablet?.focus?.width
|
|
55
|
+
normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data?.tablet?.normal?.isCustom ? '1px 1px 1px 1px' : data.tablet?.normal?.width,
|
|
56
|
+
hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data?.tablet?.hover?.isCustom ? '1px 1px 1px 1px' : data.tablet?.hover?.width,
|
|
57
|
+
focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data?.tablet?.focus?.isCustom ? '1px 1px 1px 1px' : data.tablet?.focus?.width
|
|
58
58
|
},
|
|
59
59
|
mobile: {
|
|
60
|
-
normal: data.mobile?.normal?.width,
|
|
61
|
-
hover: data.mobile?.hover?.width,
|
|
62
|
-
focus: data.mobile?.focus?.width
|
|
60
|
+
normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data?.mobile?.normal?.isCustom ? '1px 1px 1px 1px' : data.mobile?.normal?.width,
|
|
61
|
+
hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data?.mobile?.hover?.isCustom ? '1px 1px 1px 1px' : data.mobile?.hover?.width,
|
|
62
|
+
focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data?.mobile?.focus?.isCustom ? '1px 1px 1px 1px' : data.mobile?.focus?.width
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
return makeStyle.makeStyleResponsiveState('bw', newVal);
|
|
66
66
|
}
|
|
67
67
|
const data = value;
|
|
68
68
|
const newVal = {
|
|
69
|
-
normal: data?.normal?.width,
|
|
70
|
-
hover: data?.hover?.width,
|
|
71
|
-
focus: data?.focus?.width
|
|
69
|
+
normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? '1px 1px 1px 1px' : data?.normal?.width,
|
|
70
|
+
hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? '1px 1px 1px 1px' : data?.hover?.width,
|
|
71
|
+
focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? '1px 1px 1px 1px' : data?.focus?.width
|
|
72
72
|
};
|
|
73
73
|
return makeStyle.makeStyleState('bw', newVal);
|
|
74
74
|
};
|
|
@@ -34,7 +34,7 @@ const styles = (strings, ...keys)=>{
|
|
|
34
34
|
for(const attr in styles){
|
|
35
35
|
if (Object.hasOwnProperty.call(styles, attr)) {
|
|
36
36
|
const val = styles[attr];
|
|
37
|
-
if (val !== undefined) styleArr.push(`${attr}:${val}`);
|
|
37
|
+
if (val !== undefined && val !== false) styleArr.push(`${attr}:${val}`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
return styleArr.join(';');
|
|
@@ -8,65 +8,65 @@ const getBorderStyle = (value)=>{
|
|
|
8
8
|
bw: value?.width
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const handleConvertBorderStyle = (value)=>{
|
|
11
|
+
const handleConvertBorderStyle = (value, type)=>{
|
|
12
12
|
if (!value) return undefined;
|
|
13
13
|
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
14
14
|
const data = value;
|
|
15
15
|
const newVal = {
|
|
16
16
|
desktop: {
|
|
17
|
-
normal: data.desktop?.normal?.border,
|
|
18
|
-
hover: data.desktop?.hover?.border,
|
|
19
|
-
focus: data.desktop?.focus?.border
|
|
17
|
+
normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data.desktop?.normal?.isCustom ? 'solid' : data.desktop?.normal?.border,
|
|
18
|
+
hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data.desktop?.hover?.isCustom ? 'solid' : data.desktop?.hover?.border,
|
|
19
|
+
focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data.desktop?.focus?.isCustom ? 'solid' : data.desktop?.focus?.border
|
|
20
20
|
},
|
|
21
21
|
tablet: {
|
|
22
|
-
normal: data.tablet?.normal?.border,
|
|
23
|
-
hover: data.tablet?.hover?.border,
|
|
24
|
-
focus: data.tablet?.focus?.border
|
|
22
|
+
normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data.tablet?.normal?.isCustom ? 'solid' : data.tablet?.normal?.border,
|
|
23
|
+
hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data.tablet?.hover?.isCustom ? 'solid' : data.tablet?.hover?.border,
|
|
24
|
+
focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data.tablet?.focus?.isCustom ? 'solid' : data.tablet?.focus?.border
|
|
25
25
|
},
|
|
26
26
|
mobile: {
|
|
27
|
-
normal: data.mobile?.normal?.border,
|
|
28
|
-
hover: data.mobile?.hover?.border,
|
|
29
|
-
focus: data.mobile?.focus?.border
|
|
27
|
+
normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data.mobile?.normal?.isCustom ? 'solid' : data.mobile?.normal?.border,
|
|
28
|
+
hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data.mobile?.hover?.isCustom ? 'solid' : data.mobile?.hover?.border,
|
|
29
|
+
focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data.mobile?.focus?.isCustom ? 'solid' : data.mobile?.focus?.border
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
return makeStyleResponsiveState('bs', newVal);
|
|
33
33
|
}
|
|
34
34
|
const data = value;
|
|
35
35
|
const newVal = {
|
|
36
|
-
normal: data?.normal?.border,
|
|
37
|
-
hover: data?.hover?.border,
|
|
38
|
-
focus: data?.focus?.border
|
|
36
|
+
normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? 'solid' : data?.normal?.border,
|
|
37
|
+
hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? 'solid' : data?.hover?.border,
|
|
38
|
+
focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? 'solid' : data?.focus?.border
|
|
39
39
|
};
|
|
40
40
|
return makeStyleState('bs', newVal);
|
|
41
41
|
};
|
|
42
|
-
const handleConvertBorderWidth = (value)=>{
|
|
42
|
+
const handleConvertBorderWidth = (value, type)=>{
|
|
43
43
|
if (!value) return undefined;
|
|
44
44
|
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
45
45
|
const data = value;
|
|
46
46
|
const newVal = {
|
|
47
47
|
desktop: {
|
|
48
|
-
normal: data.desktop?.normal?.width,
|
|
49
|
-
hover: data.desktop?.hover?.width,
|
|
50
|
-
focus: data.desktop?.focus?.width
|
|
48
|
+
normal: type === 'button' && data.desktop?.normal?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.normal?.width,
|
|
49
|
+
hover: type === 'button' && data.desktop?.hover?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.hover?.width,
|
|
50
|
+
focus: type === 'button' && data.desktop?.focus?.borderType === 'none' && !data?.desktop?.normal?.isCustom ? '1px 1px 1px 1px' : data.desktop?.focus?.width
|
|
51
51
|
},
|
|
52
52
|
tablet: {
|
|
53
|
-
normal: data.tablet?.normal?.width,
|
|
54
|
-
hover: data.tablet?.hover?.width,
|
|
55
|
-
focus: data.tablet?.focus?.width
|
|
53
|
+
normal: type === 'button' && data.tablet?.normal?.borderType === 'none' && !data?.tablet?.normal?.isCustom ? '1px 1px 1px 1px' : data.tablet?.normal?.width,
|
|
54
|
+
hover: type === 'button' && data.tablet?.hover?.borderType === 'none' && !data?.tablet?.hover?.isCustom ? '1px 1px 1px 1px' : data.tablet?.hover?.width,
|
|
55
|
+
focus: type === 'button' && data.tablet?.focus?.borderType === 'none' && !data?.tablet?.focus?.isCustom ? '1px 1px 1px 1px' : data.tablet?.focus?.width
|
|
56
56
|
},
|
|
57
57
|
mobile: {
|
|
58
|
-
normal: data.mobile?.normal?.width,
|
|
59
|
-
hover: data.mobile?.hover?.width,
|
|
60
|
-
focus: data.mobile?.focus?.width
|
|
58
|
+
normal: type === 'button' && data.mobile?.normal?.borderType === 'none' && !data?.mobile?.normal?.isCustom ? '1px 1px 1px 1px' : data.mobile?.normal?.width,
|
|
59
|
+
hover: type === 'button' && data.mobile?.hover?.borderType === 'none' && !data?.mobile?.hover?.isCustom ? '1px 1px 1px 1px' : data.mobile?.hover?.width,
|
|
60
|
+
focus: type === 'button' && data.mobile?.focus?.borderType === 'none' && !data?.mobile?.focus?.isCustom ? '1px 1px 1px 1px' : data.mobile?.focus?.width
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
return makeStyleResponsiveState('bw', newVal);
|
|
64
64
|
}
|
|
65
65
|
const data = value;
|
|
66
66
|
const newVal = {
|
|
67
|
-
normal: data?.normal?.width,
|
|
68
|
-
hover: data?.hover?.width,
|
|
69
|
-
focus: data?.focus?.width
|
|
67
|
+
normal: type === 'button' && data.normal?.borderType === 'none' && !data.normal?.isCustom ? '1px 1px 1px 1px' : data?.normal?.width,
|
|
68
|
+
hover: type === 'button' && data.hover?.borderType === 'none' && !data.hover?.isCustom ? '1px 1px 1px 1px' : data?.hover?.width,
|
|
69
|
+
focus: type === 'button' && data.focus?.borderType === 'none' && !data.focus?.isCustom ? '1px 1px 1px 1px' : data?.focus?.width
|
|
70
70
|
};
|
|
71
71
|
return makeStyleState('bw', newVal);
|
|
72
72
|
};
|
|
@@ -32,7 +32,7 @@ const styles = (strings, ...keys)=>{
|
|
|
32
32
|
for(const attr in styles){
|
|
33
33
|
if (Object.hasOwnProperty.call(styles, attr)) {
|
|
34
34
|
const val = styles[attr];
|
|
35
|
-
if (val !== undefined) styleArr.push(`${attr}:${val}`);
|
|
35
|
+
if (val !== undefined && val !== false) styleArr.push(`${attr}:${val}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
return styleArr.join(';');
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7494,8 +7494,8 @@ type BorderStyle = StateProp<Border> | ResponsiveStateProp<Border>;
|
|
|
7494
7494
|
declare const getBorderStyle: (value?: Border) => {
|
|
7495
7495
|
[k: string]: Record<"--b" | "--bc" | "--bw", string | undefined>;
|
|
7496
7496
|
};
|
|
7497
|
-
declare const handleConvertBorderStyle: (value?: BorderStyle) => {} | undefined;
|
|
7498
|
-
declare const handleConvertBorderWidth: (value?: BorderStyle) => {} | undefined;
|
|
7497
|
+
declare const handleConvertBorderStyle: (value?: BorderStyle, type?: 'button') => {} | undefined;
|
|
7498
|
+
declare const handleConvertBorderWidth: (value?: BorderStyle, type?: 'button') => {} | undefined;
|
|
7499
7499
|
declare const handleConvertBorderColor: (value?: BorderStyle) => React.CSSProperties | undefined;
|
|
7500
7500
|
declare const handleConvertClassColor: (value?: BorderStyle) => string | undefined;
|
|
7501
7501
|
declare const handleConvertClassColorDynamicBtn: (value?: BorderStyle) => string | undefined;
|