diginet-core-ui 1.3.70 → 1.3.71
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/components/avatar/index.js +99 -84
- package/components/button/index.js +13 -8
- package/components/card/body.js +2 -1
- package/components/card/extra.js +2 -1
- package/components/card/footer.js +2 -1
- package/components/card/header.js +2 -1
- package/components/card/index.js +11 -8
- package/components/chip/index.js +158 -189
- package/components/form-control/checkbox/index.js +2 -2
- package/components/form-control/dropdown/index.js +199 -218
- package/components/form-control/radio/index.js +2 -2
- package/components/form-control/text-input/index.js +139 -212
- package/components/form-control/toggle/index.js +2 -2
- package/components/grid/index.js +2 -2
- package/components/others/import/index.js +78 -0
- package/components/tooltip/index.js +8 -2
- package/global/index.js +5 -5
- package/package.json +1 -1
- package/readme.md +10 -0
- package/utils/index.js +2 -0
- package/utils/{sb-teamplate.js → sb-template.js} +20 -12
package/components/chip/index.js
CHANGED
|
@@ -6,34 +6,33 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import { ButtonIcon, Typography } from '../';
|
|
8
8
|
import Icon from '../../icons';
|
|
9
|
-
import { alignCenter, border, borderBox, flexRow, inlineFlex, justifyCenter, positionRelative, userSelectNone, whiteSpaceNoWrap } from '../../styles/general';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { alignCenter, border, borderBox, flexRow, inlineFlex, justifyCenter, positionRelative, userSelectNone, whiteSpaceNoWrap, cursorNotAllowed, positionAbsolute, overflowHidden } from '../../styles/general';
|
|
10
|
+
import { hexToRGBA } from '../../styles/color-helper';
|
|
11
|
+
import { useTheme } from '../../theme';
|
|
12
12
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
line: {
|
|
26
|
-
normal,
|
|
27
|
-
disabled: lineDisabled
|
|
13
|
+
colors: {
|
|
14
|
+
danger,
|
|
15
|
+
info,
|
|
16
|
+
success,
|
|
17
|
+
warning,
|
|
18
|
+
system: {
|
|
19
|
+
active,
|
|
20
|
+
rest,
|
|
21
|
+
white,
|
|
22
|
+
disabled: disabledCl,
|
|
23
|
+
dark
|
|
24
|
+
}
|
|
28
25
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
26
|
+
spacing
|
|
27
|
+
} = useTheme();
|
|
28
|
+
const colorMap = new Map([['default', active], ['primary', active], ['success', success], ['warning', warning], ['danger', danger], ['info', info]]);
|
|
29
|
+
const iconSizeMap = new Map([['small', `${spacing(4)}px`], ['medium', `${spacing(5)}px`], ['large', `${spacing(6)}px`]]);
|
|
30
|
+
const typographySizeMap = new Map([['small', 'p3'], ['medium', 'p2'], ['large', 'p1']]);
|
|
31
|
+
const paddingSizeMap = new Map([['small', `0px ${spacing(1.5)}px`], ['medium', `0px ${spacing(2)}px`], ['large', `0px ${spacing(2.5)}px`]]);
|
|
32
|
+
const minHeightSizeMap = new Map([['small', `${spacing(5)}px`], ['medium', `${spacing(6)}px`], ['large', `${spacing(7)}px`]]);
|
|
34
33
|
const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
35
34
|
viewType,
|
|
36
|
-
color,
|
|
35
|
+
color: colorProps,
|
|
37
36
|
size,
|
|
38
37
|
label,
|
|
39
38
|
className,
|
|
@@ -41,24 +40,44 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
41
40
|
onClick,
|
|
42
41
|
onDbClick,
|
|
43
42
|
onDoubleClick,
|
|
44
|
-
maxLength,
|
|
45
43
|
startIcon,
|
|
46
44
|
endIcon,
|
|
47
45
|
clearAble,
|
|
48
46
|
disabled,
|
|
49
47
|
readOnly,
|
|
50
48
|
children,
|
|
51
|
-
style
|
|
49
|
+
style,
|
|
50
|
+
labelProps
|
|
52
51
|
}, reference) => {
|
|
53
52
|
const ref = useRef(null);
|
|
54
53
|
const IconRef = useRef(null);
|
|
55
54
|
if (!onDbClick && onDoubleClick) onDbClick = onDoubleClick;
|
|
55
|
+
const color = colorMap.get(colorProps) || colorProps;
|
|
56
|
+
const infoChip = {
|
|
57
|
+
color: colorMap.get(colorProps) || colorProps,
|
|
58
|
+
contentColor: viewType !== 'filled' ? color : white,
|
|
59
|
+
backgroundColor: viewType !== 'filled' ? white : color,
|
|
60
|
+
iconSize: iconSizeMap.get(size),
|
|
61
|
+
paddingSize: paddingSizeMap.get(size),
|
|
62
|
+
typographySize: typographySizeMap.get(size),
|
|
63
|
+
minHeightSize: minHeightSizeMap.get(size),
|
|
64
|
+
viewType
|
|
65
|
+
};
|
|
66
|
+
infoChip.border = viewType === 'ghost' ? 'transparent !important' : colorProps === 'default' ? rest : infoChip === null || infoChip === void 0 ? void 0 : infoChip.color;
|
|
67
|
+
infoChip.contentColor = colorProps === 'default' && viewType === 'outlined' ? rest : infoChip === null || infoChip === void 0 ? void 0 : infoChip.contentColor;
|
|
68
|
+
infoChip.backgroundColor = colorProps === 'default' && viewType === 'filled' ? rest : infoChip === null || infoChip === void 0 ? void 0 : infoChip.backgroundColor;
|
|
69
|
+
useImperativeHandle(reference, () => {
|
|
70
|
+
const currentRef = ref.current || {};
|
|
71
|
+
const _instance = {}; // methods
|
|
72
|
+
|
|
73
|
+
_instance.__proto__ = {}; // hidden methods
|
|
74
|
+
|
|
75
|
+
currentRef.instance = _instance;
|
|
76
|
+
return currentRef;
|
|
77
|
+
});
|
|
56
78
|
|
|
57
79
|
const onRemoveHandler = () => {
|
|
58
|
-
if (onRemove) onRemove(ref.current);
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
ref.current && ref.current.remove();
|
|
61
|
-
}, 0);
|
|
80
|
+
if (onRemove || disabled) onRemove(ref.current);
|
|
62
81
|
};
|
|
63
82
|
|
|
64
83
|
const _onClick = event => {
|
|
@@ -71,213 +90,161 @@ const Chip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
71
90
|
onDbClick && event.stopPropagation();
|
|
72
91
|
if (disabled) return;
|
|
73
92
|
onDbClick && onDbClick(event);
|
|
74
|
-
};
|
|
93
|
+
}; // Start Icon
|
|
75
94
|
|
|
76
|
-
const renderLabel = () => {
|
|
77
|
-
if (maxLength && label && label.length > maxLength) {
|
|
78
|
-
label = label.slice(0, maxLength) + '...';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return label;
|
|
82
|
-
};
|
|
83
95
|
|
|
84
|
-
useImperativeHandle(reference, () => {
|
|
85
|
-
const currentRef = ref.current || {};
|
|
86
|
-
const _instance = {}; // methods
|
|
87
|
-
|
|
88
|
-
_instance.__proto__ = {}; // hidden methods
|
|
89
|
-
|
|
90
|
-
currentRef.instance = _instance;
|
|
91
|
-
return currentRef;
|
|
92
|
-
});
|
|
93
96
|
const startIconView = useMemo(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
height: iconSizeMap.get(size),
|
|
101
|
-
color: 'currentColor',
|
|
102
|
-
viewBox: false
|
|
97
|
+
if (typeof startIcon === 'string') {
|
|
98
|
+
return jsx(Icon, {
|
|
99
|
+
name: startIcon,
|
|
100
|
+
width: infoChip.iconSize,
|
|
101
|
+
height: infoChip.iconSize,
|
|
102
|
+
color: 'currentColor'
|
|
103
103
|
});
|
|
104
|
-
}
|
|
104
|
+
} else return jsx("div", {
|
|
105
|
+
css: ChipIconCSS(infoChip)
|
|
106
|
+
}, startIcon);
|
|
107
|
+
}, [startIcon, size]); // Label
|
|
105
108
|
|
|
106
|
-
return startIcon && jsx("div", {
|
|
107
|
-
css: ChipIconCSS,
|
|
108
|
-
className: size
|
|
109
|
-
}, node);
|
|
110
|
-
}, [startIcon, size]);
|
|
111
109
|
const labelView = useMemo(() => {
|
|
112
|
-
return jsx(
|
|
113
|
-
css: ChipLabelCSS
|
|
114
|
-
|
|
115
|
-
}, jsx(Typography, {
|
|
116
|
-
type: size === 'small' ? 'p2' : 'p1',
|
|
110
|
+
return jsx(Typography, {
|
|
111
|
+
css: ChipLabelCSS,
|
|
112
|
+
type: infoChip.typographySize,
|
|
117
113
|
color: 'inherit',
|
|
118
|
-
lineClamp: 1
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
lineClamp: 1,
|
|
115
|
+
...labelProps
|
|
116
|
+
}, label);
|
|
117
|
+
}, [label, size, startIcon, endIcon, clearAble]); // End Icon
|
|
118
|
+
|
|
121
119
|
const endIconView = useMemo(() => {
|
|
122
120
|
let node = endIcon;
|
|
123
121
|
|
|
124
122
|
if (typeof node === 'string') {
|
|
125
|
-
|
|
123
|
+
return jsx(Icon, {
|
|
126
124
|
name: node,
|
|
127
|
-
width:
|
|
128
|
-
height:
|
|
129
|
-
color:
|
|
130
|
-
viewBox:
|
|
125
|
+
width: infoChip.iconSize,
|
|
126
|
+
height: infoChip.iconSize,
|
|
127
|
+
color: infoChip.contentColor,
|
|
128
|
+
viewBox: true
|
|
131
129
|
});
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
return clearAble ? jsx(
|
|
135
|
-
|
|
136
|
-
className: 'end-icon
|
|
137
|
-
ref: IconRef
|
|
138
|
-
}, jsx(ButtonIcon, {
|
|
132
|
+
return clearAble ? jsx(ButtonIcon, {
|
|
133
|
+
ref: IconRef,
|
|
134
|
+
className: 'end-icon',
|
|
139
135
|
viewType: 'ghost',
|
|
140
136
|
name: 'Close',
|
|
141
|
-
|
|
137
|
+
width: infoChip.iconSize,
|
|
138
|
+
height: infoChip.iconSize,
|
|
139
|
+
color: infoChip.contentColor,
|
|
142
140
|
disabled: disabled,
|
|
141
|
+
viewBox: true,
|
|
143
142
|
onClick: onRemoveHandler
|
|
144
|
-
})
|
|
145
|
-
css: ChipIconCSS,
|
|
143
|
+
}) : node && jsx("div", {
|
|
144
|
+
css: ChipIconCSS(infoChip),
|
|
146
145
|
className: 'end-icon ' + size,
|
|
147
146
|
ref: IconRef
|
|
148
147
|
}, node);
|
|
149
|
-
}, [clearAble, viewType, color, endIcon, size, disabled]);
|
|
148
|
+
}, [clearAble, viewType, color, endIcon, size, disabled, onRemove]);
|
|
150
149
|
return jsx("div", {
|
|
151
|
-
css: ChipRootCSS(onClick, onDbClick,
|
|
150
|
+
css: ChipRootCSS(onClick, onDbClick, colorProps, infoChip),
|
|
152
151
|
ref: ref,
|
|
153
|
-
className: ['DGN-UI-Chip',
|
|
152
|
+
className: ['DGN-UI-Chip', className, disabled && 'chip--disabled', readOnly && 'chip--readOnly', viewType === 'filled' && 'chip--filled'].join(' '),
|
|
154
153
|
style: style,
|
|
155
154
|
onClick: _onClick,
|
|
156
155
|
onDoubleClick: _onDbClick
|
|
157
|
-
}, startIconView, labelView, endIconView, children);
|
|
156
|
+
}, !!startIcon && startIconView, !!label && labelView, (!!endIcon || !!clearAble) && endIconView, children);
|
|
158
157
|
}));
|
|
159
|
-
const
|
|
160
|
-
${flexRow};
|
|
161
|
-
${justifyCenter};
|
|
162
|
-
${alignCenter};
|
|
163
|
-
${positionRelative};
|
|
164
|
-
${borderBox};
|
|
165
|
-
padding: 0 2px;
|
|
166
|
-
color: inherit;
|
|
167
|
-
img {
|
|
168
|
-
border-radius: 50%;
|
|
169
|
-
}
|
|
170
|
-
&.small {
|
|
171
|
-
width: 24px;
|
|
172
|
-
height: 24px;
|
|
173
|
-
img {
|
|
174
|
-
width: 20px;
|
|
175
|
-
height: 20px;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
&.medium {
|
|
179
|
-
max-width: 32px;
|
|
180
|
-
max-height: 32px;
|
|
181
|
-
img {
|
|
182
|
-
min-width: 24px;
|
|
183
|
-
min-height: 24px;
|
|
184
|
-
}
|
|
185
|
-
&:not(.end-icon) {
|
|
186
|
-
margin-right: 4px;
|
|
187
|
-
}
|
|
188
|
-
&.end-icon {
|
|
189
|
-
width: 32px;
|
|
190
|
-
height: 26px;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
`;
|
|
194
|
-
|
|
195
|
-
const ChipLabelCSS = (startIcon, endIcon, clearAble) => css`
|
|
158
|
+
const ChipLabelCSS = css`
|
|
196
159
|
${flexRow};
|
|
197
160
|
${alignCenter};
|
|
198
161
|
${positionRelative};
|
|
199
162
|
${userSelectNone};
|
|
200
163
|
${whiteSpaceNoWrap};
|
|
201
|
-
padding-right: ${endIcon || clearAble ? 2 : 10}px;
|
|
202
|
-
padding-left: ${startIcon ? 2 : 10}px;
|
|
203
|
-
&.small {
|
|
204
|
-
max-height: 24px;
|
|
205
|
-
}
|
|
206
|
-
&.medium {
|
|
207
|
-
max-height: 32px;
|
|
208
|
-
}
|
|
209
164
|
`;
|
|
210
165
|
|
|
211
|
-
const ChipRootCSS = (onClick, onDbClick,
|
|
166
|
+
const ChipRootCSS = (onClick, onDbClick, colorProps, info) => css`
|
|
212
167
|
${inlineFlex};
|
|
213
168
|
${alignCenter};
|
|
214
169
|
${positionRelative};
|
|
215
170
|
${borderBox};
|
|
216
|
-
${border(
|
|
171
|
+
${border('1px', info.border)};
|
|
217
172
|
width: max-content;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
border-radius: 20px;
|
|
173
|
+
padding: ${info === null || info === void 0 ? void 0 : info.paddingSize};
|
|
174
|
+
color: ${info === null || info === void 0 ? void 0 : info.contentColor};
|
|
175
|
+
background: ${info === null || info === void 0 ? void 0 : info.backgroundColor};
|
|
176
|
+
border-radius: ${spacing(4)}px;
|
|
223
177
|
cursor: ${onClick || onDbClick ? 'pointer' : 'unset'};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
&.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
178
|
+
height: ${info === null || info === void 0 ? void 0 : info.minHeightSize};
|
|
179
|
+
min-height: ${info === null || info === void 0 ? void 0 : info.minHeightSize};
|
|
180
|
+
gap: ${spacing()}px;
|
|
181
|
+
&.chip--filled {
|
|
182
|
+
&:not(.chip--disabled):not(.chip--readOnly) {
|
|
183
|
+
&::after {
|
|
184
|
+
border-radius: ${spacing(4)}px;
|
|
185
|
+
${positionAbsolute};
|
|
186
|
+
top: 0;
|
|
187
|
+
left: 0;
|
|
188
|
+
content: '';
|
|
189
|
+
width: 100%;
|
|
190
|
+
height: 100%;
|
|
191
|
+
}
|
|
192
|
+
&:hover::after,
|
|
193
|
+
&:focus::after {
|
|
194
|
+
background: ${hexToRGBA(dark, 0.15)};
|
|
195
|
+
}
|
|
196
|
+
&:active::after {
|
|
197
|
+
background: ${hexToRGBA(dark, 0.3)};
|
|
244
198
|
}
|
|
245
199
|
}
|
|
246
200
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
201
|
+
&:not(.chip--filled) {
|
|
202
|
+
&:not(.chip--disabled):not(.chip--readOnly):hover {
|
|
203
|
+
${border('1px', info === null || info === void 0 ? void 0 : info.color)};
|
|
204
|
+
background: ${hexToRGBA(info === null || info === void 0 ? void 0 : info.color, 0.1)};
|
|
205
|
+
color: ${info === null || info === void 0 ? void 0 : info.color};
|
|
251
206
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
color: ${
|
|
256
|
-
border-color: ${colors[color] || color};
|
|
207
|
+
&:not(.chip--disabled):not(.chip--readOnly):active {
|
|
208
|
+
${border('1px', info === null || info === void 0 ? void 0 : info.color)};
|
|
209
|
+
background: ${hexToRGBA(info === null || info === void 0 ? void 0 : info.color, 0.3)};
|
|
210
|
+
color: ${info === null || info === void 0 ? void 0 : info.color};
|
|
257
211
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
color: ${white};
|
|
263
|
-
&:hover {
|
|
264
|
-
color: ${danger};
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
&.${color} {
|
|
268
|
-
background-color: ${colors[color] || color};
|
|
269
|
-
border-color: ${darken(colors[color] || color, 0.22)};
|
|
212
|
+
&:not(.chip--disabled):not(.chip--readOnly):focus {
|
|
213
|
+
${border('1px', info === null || info === void 0 ? void 0 : info.color)};
|
|
214
|
+
background: ${hexToRGBA(info === null || info === void 0 ? void 0 : info.color, 0.2)};
|
|
215
|
+
color: ${info === null || info === void 0 ? void 0 : info.color};
|
|
270
216
|
}
|
|
271
217
|
}
|
|
218
|
+
&.chip--disabled {
|
|
219
|
+
color: ${disabledCl} !important;
|
|
220
|
+
background-color: ${white} !important;
|
|
221
|
+
${border('1px', disabledCl)};
|
|
222
|
+
}
|
|
223
|
+
&.chip--readOnly,
|
|
224
|
+
&.chip--disabled {
|
|
225
|
+
${cursorNotAllowed}
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
|
|
229
|
+
const ChipIconCSS = info => css`
|
|
230
|
+
${flexRow};
|
|
231
|
+
${justifyCenter};
|
|
232
|
+
${alignCenter};
|
|
233
|
+
${positionRelative};
|
|
234
|
+
${borderBox};
|
|
235
|
+
${overflowHidden};
|
|
236
|
+
width: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
237
|
+
min-width: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
238
|
+
max-width: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
239
|
+
height: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
240
|
+
min-height: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
241
|
+
max-height: ${info === null || info === void 0 ? void 0 : info.iconSize};
|
|
272
242
|
`;
|
|
273
243
|
|
|
274
244
|
Chip.defaultProps = {
|
|
275
|
-
label: '',
|
|
276
|
-
className: '',
|
|
277
|
-
style: {},
|
|
278
245
|
viewType: 'outlined',
|
|
279
|
-
size: '
|
|
280
|
-
|
|
246
|
+
size: 'medium',
|
|
247
|
+
color: 'default'
|
|
281
248
|
};
|
|
282
249
|
Chip.propTypes = {
|
|
283
250
|
/** content to display in Chip */
|
|
@@ -290,7 +257,6 @@ Chip.propTypes = {
|
|
|
290
257
|
|
|
291
258
|
/** style inline of component */
|
|
292
259
|
style: PropTypes.object,
|
|
293
|
-
maxLength: PropTypes.number,
|
|
294
260
|
|
|
295
261
|
/** the icon display at head of Chip */
|
|
296
262
|
startIcon: PropTypes.any,
|
|
@@ -299,13 +265,13 @@ Chip.propTypes = {
|
|
|
299
265
|
endIcon: PropTypes.any,
|
|
300
266
|
|
|
301
267
|
/** type of chip */
|
|
302
|
-
viewType: PropTypes.oneOf(['outlined', 'filled']),
|
|
268
|
+
viewType: PropTypes.oneOf(['ghost', 'outlined', 'filled']),
|
|
303
269
|
|
|
304
270
|
/** color for text or background of Chip */
|
|
305
271
|
color: PropTypes.oneOf(['default', 'primary', 'info', 'success', 'warning', 'danger']),
|
|
306
272
|
|
|
307
273
|
/** size of Chip */
|
|
308
|
-
size: PropTypes.oneOf(['small', 'medium']),
|
|
274
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
309
275
|
|
|
310
276
|
/** show clear icon if true */
|
|
311
277
|
clearAble: PropTypes.bool,
|
|
@@ -332,6 +298,9 @@ Chip.propTypes = {
|
|
|
332
298
|
onDoubleClick: PropTypes.func,
|
|
333
299
|
|
|
334
300
|
/** content to display on Chip (the same to label) */
|
|
335
|
-
children: PropTypes.node
|
|
301
|
+
children: PropTypes.node,
|
|
302
|
+
|
|
303
|
+
/** props for Typography of label */
|
|
304
|
+
labelProps: PropTypes.object
|
|
336
305
|
};
|
|
337
306
|
export default Chip;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
6
|
+
import { forwardRef, memo, useEffect, useRef, useState, useImperativeHandle, Fragment } from 'react';
|
|
7
7
|
import { Typography } from '../..';
|
|
8
8
|
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative, cursorNoDrop, parseWidthHeight } from '../../../styles/general';
|
|
9
9
|
import { randomString } from '../../../utils';
|
|
@@ -154,7 +154,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
154
154
|
},
|
|
155
155
|
color: disabled ? clDisabled : '',
|
|
156
156
|
...labelProps
|
|
157
|
-
}, jsx(
|
|
157
|
+
}, jsx(Fragment, null, children || label, required && jsx("span", {
|
|
158
158
|
style: {
|
|
159
159
|
color: disabled ? clDisabled : clDanger
|
|
160
160
|
}
|