diginet-core-ui 1.3.32-beta.5 → 1.3.33
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/button/icon.js +12 -12
- package/components/button/index.js +13 -13
- package/components/form-control/dropdown/index.js +10 -1
- package/components/form-control/input-base/index.js +11 -24
- package/components/form-control/text-input/index.js +13 -15
- package/icons/basic.js +57 -5
- package/package.json +34 -38
- package/readme.md +12 -0
- package/styles/color-helper.js +2 -0
- package/styles/colors.js +2 -1
- package/styles/general.js +3 -0
- package/utils/useInput.js +3 -3
|
@@ -108,7 +108,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
108
108
|
${justifyCenter}
|
|
109
109
|
${alignCenter}
|
|
110
110
|
}
|
|
111
|
-
&.disabled {
|
|
111
|
+
&.button-icon--disabled {
|
|
112
112
|
cursor: not-allowed !important;
|
|
113
113
|
color: ${systemDisabled} !important;
|
|
114
114
|
&.outlined {
|
|
@@ -123,7 +123,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
123
123
|
background-color: transparent !important;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
&.loading {
|
|
126
|
+
&.button-icon--loading {
|
|
127
127
|
${pointerEventsNone}
|
|
128
128
|
}
|
|
129
129
|
&.${size} {
|
|
@@ -139,14 +139,14 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
139
139
|
&.default {
|
|
140
140
|
${border(1, rest)}
|
|
141
141
|
color: ${rest};
|
|
142
|
-
&.loading,
|
|
142
|
+
&.button-icon--loading,
|
|
143
143
|
&:hover,
|
|
144
144
|
&:focus,
|
|
145
145
|
&:active {
|
|
146
146
|
color: ${colorHover};
|
|
147
147
|
border-color: ${colorHover};
|
|
148
148
|
}
|
|
149
|
-
&.loading {
|
|
149
|
+
&.button-icon--loading {
|
|
150
150
|
background-color: ${hexToRGBA(colorHover, alphaLoading)};
|
|
151
151
|
}
|
|
152
152
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -156,7 +156,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
156
156
|
&.${color} {
|
|
157
157
|
${color !== 'default' && border(1, colorMap.get(color))}
|
|
158
158
|
color: ${colorMap.get(color)};
|
|
159
|
-
&.loading {
|
|
159
|
+
&.button-icon--loading {
|
|
160
160
|
background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
|
|
161
161
|
}
|
|
162
162
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -166,7 +166,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
166
166
|
&.custom-color {
|
|
167
167
|
${border(1, color)}
|
|
168
168
|
color: ${color};
|
|
169
|
-
&.loading {
|
|
169
|
+
&.button-icon--loading {
|
|
170
170
|
background-color: ${hexToRGBA(color, alphaLoading)};
|
|
171
171
|
}
|
|
172
172
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -178,7 +178,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
178
178
|
${borderNone}
|
|
179
179
|
color: ${white};
|
|
180
180
|
font-weight: bold;
|
|
181
|
-
&.loading,
|
|
181
|
+
&.button-icon--loading,
|
|
182
182
|
&:hover,
|
|
183
183
|
&:focus {
|
|
184
184
|
filter: brightness(0.85);
|
|
@@ -188,7 +188,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
188
188
|
}
|
|
189
189
|
&.default {
|
|
190
190
|
background-color: ${rest};
|
|
191
|
-
&.loading,
|
|
191
|
+
&.button-icon--loading,
|
|
192
192
|
&:hover,
|
|
193
193
|
&:focus,
|
|
194
194
|
&:active {
|
|
@@ -212,7 +212,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
212
212
|
&:active {
|
|
213
213
|
color: ${colorHover};
|
|
214
214
|
}
|
|
215
|
-
&.loading {
|
|
215
|
+
&.button-icon--loading {
|
|
216
216
|
color: ${active};
|
|
217
217
|
background-color: ${hexToRGBA(colorHover, alphaLoading)};
|
|
218
218
|
}
|
|
@@ -222,7 +222,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
222
222
|
}
|
|
223
223
|
&.${color} {
|
|
224
224
|
color: ${colorMap.get(color)};
|
|
225
|
-
&.loading {
|
|
225
|
+
&.button-icon--loading {
|
|
226
226
|
background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
|
|
227
227
|
}
|
|
228
228
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -231,7 +231,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
231
231
|
}
|
|
232
232
|
&.custom-color {
|
|
233
233
|
color: ${color};
|
|
234
|
-
&.loading {
|
|
234
|
+
&.button-icon--loading {
|
|
235
235
|
background-color: ${hexToRGBA(color, alphaLoading)};
|
|
236
236
|
}
|
|
237
237
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -315,7 +315,7 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
315
315
|
ref: ref,
|
|
316
316
|
type: type,
|
|
317
317
|
onClick: _onClick,
|
|
318
|
-
className: ['DGN-UI-ButtonIcon', viewType, getClassNameFromColor(color), size, loading && 'loading', disabled && 'disabled', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
318
|
+
className: ['DGN-UI-ButtonIcon', viewType, getClassNameFromColor(color), size, loading && 'button-icon--loading', disabled && 'button-icon--disabled', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
319
319
|
...props
|
|
320
320
|
}, loading && iconLoading(), !loading && jsx("span", {
|
|
321
321
|
className: 'DGN-UI-ButtonIcon-Icon'
|
|
@@ -149,7 +149,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
149
149
|
${userSelectNone}
|
|
150
150
|
height: max-content;
|
|
151
151
|
transition: all 0.5s;
|
|
152
|
-
&.disabled {
|
|
152
|
+
&.button--disabled {
|
|
153
153
|
cursor: not-allowed !important;
|
|
154
154
|
color: ${systemDisabled} !important;
|
|
155
155
|
&.outlined {
|
|
@@ -167,7 +167,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
167
167
|
/* &:not(:disabled):focus {
|
|
168
168
|
box-shadow: ${viewType === 'outlined' ? '0 0 0 2px ' + hexToRGBA(active, 0.13) : 'none'};
|
|
169
169
|
} */
|
|
170
|
-
&.loading {
|
|
170
|
+
&.button--loading {
|
|
171
171
|
${pointerEventsNone}
|
|
172
172
|
}
|
|
173
173
|
&.${size} {
|
|
@@ -204,14 +204,14 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
204
204
|
&.default {
|
|
205
205
|
border: 1px solid ${rest};
|
|
206
206
|
color: ${rest};
|
|
207
|
-
&.loading,
|
|
207
|
+
&.button--loading,
|
|
208
208
|
&:hover,
|
|
209
209
|
&:focus,
|
|
210
210
|
&:active {
|
|
211
211
|
color: ${active};
|
|
212
212
|
border-color: ${active};
|
|
213
213
|
}
|
|
214
|
-
&.loading {
|
|
214
|
+
&.button--loading {
|
|
215
215
|
background-color: ${hexToRGBA(active, alphaLoading)};
|
|
216
216
|
}
|
|
217
217
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -221,7 +221,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
221
221
|
&.${color} {
|
|
222
222
|
border: 1px solid ${colorMap.get(color)};
|
|
223
223
|
color: ${colorMap.get(color)};
|
|
224
|
-
&.loading {
|
|
224
|
+
&.button--loading {
|
|
225
225
|
background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
|
|
226
226
|
}
|
|
227
227
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -231,7 +231,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
231
231
|
&.custom-color {
|
|
232
232
|
border: 1px solid ${color};
|
|
233
233
|
color: ${color};
|
|
234
|
-
&.loading {
|
|
234
|
+
&.button--loading {
|
|
235
235
|
background-color: ${hexToRGBA(color, alphaLoading)};
|
|
236
236
|
}
|
|
237
237
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -243,7 +243,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
243
243
|
border: none;
|
|
244
244
|
color: ${white};
|
|
245
245
|
font-weight: bold;
|
|
246
|
-
&.loading,
|
|
246
|
+
&.button--loading,
|
|
247
247
|
&:hover,
|
|
248
248
|
&:focus {
|
|
249
249
|
filter: brightness(0.85);
|
|
@@ -253,7 +253,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
253
253
|
}
|
|
254
254
|
&.default {
|
|
255
255
|
background-color: ${rest};
|
|
256
|
-
&.loading {
|
|
256
|
+
&.button--loading {
|
|
257
257
|
background-color: ${active};
|
|
258
258
|
}
|
|
259
259
|
&:hover,
|
|
@@ -279,7 +279,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
279
279
|
&:active {
|
|
280
280
|
color: ${active};
|
|
281
281
|
}
|
|
282
|
-
&.loading {
|
|
282
|
+
&.button--loading {
|
|
283
283
|
color: ${active};
|
|
284
284
|
background-color: ${hexToRGBA(active, alphaLoading)};
|
|
285
285
|
}
|
|
@@ -289,7 +289,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
289
289
|
}
|
|
290
290
|
&.${color} {
|
|
291
291
|
color: ${colorMap.get(color)};
|
|
292
|
-
&.loading {
|
|
292
|
+
&.button--loading {
|
|
293
293
|
background-color: ${hexToRGBA(colorMap.get(color), alphaLoading)};
|
|
294
294
|
}
|
|
295
295
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -298,7 +298,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
298
298
|
}
|
|
299
299
|
&.custom-color {
|
|
300
300
|
color: ${color};
|
|
301
|
-
&.loading {
|
|
301
|
+
&.button--loading {
|
|
302
302
|
background-color: ${hexToRGBA(color, alphaLoading)};
|
|
303
303
|
}
|
|
304
304
|
${Object.keys(alphaArr).map(key => `&:${key} {
|
|
@@ -311,7 +311,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
311
311
|
${noBorder}
|
|
312
312
|
${noPadding}
|
|
313
313
|
color: ${info};
|
|
314
|
-
&.loading,
|
|
314
|
+
&.button--loading,
|
|
315
315
|
&:hover,
|
|
316
316
|
&:focus {
|
|
317
317
|
filter: brightness(0.85);
|
|
@@ -424,7 +424,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
424
424
|
onClick: _onClick,
|
|
425
425
|
ref: ref,
|
|
426
426
|
type: type,
|
|
427
|
-
className: ['DGN-UI-Button', viewType, getClassNameFromColor(color), size, loading && 'loading', disabled && 'disabled', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
427
|
+
className: ['DGN-UI-Button', viewType, getClassNameFromColor(color), size, loading && 'button--loading', disabled && 'button--disabled', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
428
428
|
...props
|
|
429
429
|
}, start, jsx(Typography, {
|
|
430
430
|
css: ButtonText,
|
|
@@ -1374,7 +1374,16 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1374
1374
|
setShowClear(clearAble && checkHasValue(valueProp) && !disabled && !readOnly && !loading);
|
|
1375
1375
|
}, [clearAble, valueProp, disabled, readOnly, loading]);
|
|
1376
1376
|
useEffect(() => {
|
|
1377
|
-
|
|
1377
|
+
if (onLoadMore && valueObjectDefault) {
|
|
1378
|
+
if (Array.isArray(valueObjectDefault)) {
|
|
1379
|
+
currentObjectDefault[unique] = [...valueObjectDefault];
|
|
1380
|
+
} else if (typeof valueObjectDefault === 'object') {
|
|
1381
|
+
currentObjectDefault[unique] = Object.keys(valueObjectDefault).length !== 0 ? [valueObjectDefault] : [];
|
|
1382
|
+
}
|
|
1383
|
+
} else {
|
|
1384
|
+
currentObjectDefault[unique] = [];
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1378
1387
|
return () => {
|
|
1379
1388
|
currentObjectDefault[unique] = null;
|
|
1380
1389
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
-
import useInput from '../../../utils/useInput';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
7
6
|
import { jsx, css } from '@emotion/core';
|
|
8
7
|
import { renderIcon } from '../../../utils';
|
|
@@ -16,7 +15,7 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
16
15
|
type,
|
|
17
16
|
viewType,
|
|
18
17
|
defaultValue,
|
|
19
|
-
value
|
|
18
|
+
value,
|
|
20
19
|
placeholder,
|
|
21
20
|
resize,
|
|
22
21
|
status,
|
|
@@ -44,17 +43,8 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
44
43
|
onInput,
|
|
45
44
|
onKeyDown,
|
|
46
45
|
onKeyUp,
|
|
47
|
-
delayOnChange,
|
|
48
46
|
...props
|
|
49
47
|
}, reference) => {
|
|
50
|
-
const {
|
|
51
|
-
bind
|
|
52
|
-
} = useInput({
|
|
53
|
-
defaultValue,
|
|
54
|
-
valueProp,
|
|
55
|
-
onChange,
|
|
56
|
-
delayOnChange
|
|
57
|
-
});
|
|
58
48
|
const ref = useRef(null);
|
|
59
49
|
const inputBaseRef = useRef(null);
|
|
60
50
|
const valueArray = useRef([]);
|
|
@@ -489,9 +479,9 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
489
479
|
useEffect(() => {
|
|
490
480
|
const defaultHeight = 24;
|
|
491
481
|
|
|
492
|
-
if (
|
|
493
|
-
valueArray.current.push(
|
|
494
|
-
inputBaseRef.current.value =
|
|
482
|
+
if (value !== undefined) {
|
|
483
|
+
valueArray.current.push(value);
|
|
484
|
+
inputBaseRef.current.value = value;
|
|
495
485
|
|
|
496
486
|
if (multiline && !/\d+/.test(rows)) {
|
|
497
487
|
inputBaseRef.current.style.height = 0;
|
|
@@ -500,11 +490,11 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
500
490
|
}
|
|
501
491
|
|
|
502
492
|
return () => {
|
|
503
|
-
if (
|
|
493
|
+
if (value !== undefined && multiline && !/\d+/.test(rows) && inputBaseRef.current) {
|
|
504
494
|
inputBaseRef.current.style.height = defaultHeight + 'px';
|
|
505
495
|
}
|
|
506
496
|
};
|
|
507
|
-
}, [
|
|
497
|
+
}, [value]);
|
|
508
498
|
useEffect(() => {
|
|
509
499
|
if (disabled) {
|
|
510
500
|
if (ref.current) {
|
|
@@ -542,9 +532,9 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
542
532
|
onKeyDown: onKeyDown,
|
|
543
533
|
onKeyUp: onKeyUp,
|
|
544
534
|
onInput: onInputTextArea,
|
|
535
|
+
onChange: onChange,
|
|
545
536
|
onBlur: onBlur,
|
|
546
|
-
onFocus: onFocus
|
|
547
|
-
...bind
|
|
537
|
+
onFocus: onFocus
|
|
548
538
|
}));
|
|
549
539
|
const InputComp = jsx("div", {
|
|
550
540
|
css: inputBaseRoot,
|
|
@@ -579,9 +569,9 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
579
569
|
onKeyDown: onKeyDown,
|
|
580
570
|
onKeyUp: onKeyUp,
|
|
581
571
|
onInput: onInput,
|
|
572
|
+
onChange: onChange,
|
|
582
573
|
onBlur: onBlur,
|
|
583
|
-
onFocus: onFocus
|
|
584
|
-
...bind
|
|
574
|
+
onFocus: onFocus
|
|
585
575
|
})), !!endIcon && jsx("div", {
|
|
586
576
|
css: inputBaseIconCSS,
|
|
587
577
|
...endIconProps,
|
|
@@ -729,9 +719,6 @@ InputBase.propTypes = {
|
|
|
729
719
|
onFocus: PropTypes.func,
|
|
730
720
|
|
|
731
721
|
/** inputRef of InputBase component */
|
|
732
|
-
inputRef: PropTypes.any
|
|
733
|
-
|
|
734
|
-
/** delayOnChange of InputBase component */
|
|
735
|
-
delayOnChange: PropTypes.number
|
|
722
|
+
inputRef: PropTypes.any
|
|
736
723
|
};
|
|
737
724
|
export default InputBase;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { memo, useEffect, useRef, forwardRef,
|
|
4
|
+
import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import { ButtonIcon, CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
|
|
8
8
|
import { renderIcon, onValidate } from '../../../utils';
|
|
9
|
-
import { displayBlock, flexRow, positionRelative } from '../../../styles/general';
|
|
10
9
|
const icons = {
|
|
11
10
|
default: `<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
11
|
<path fillRule="evenodd" clipRule="evenodd" d="M15.5616 19.0007C15.4036 19.0007 15.2446 18.9637 15.0986 18.8877L9.99962 16.2237L4.90162 18.8877C4.56362 19.0627 4.15562 19.0327 3.84962 18.8087C3.54162 18.5847 3.38862 18.2057 3.45362 17.8307L4.42462 12.2027L0.304623 8.21765C0.030623 7.95265 -0.068377 7.55465 0.048623 7.19065C0.165623 6.82865 0.478623 6.56365 0.856623 6.50965L6.55662 5.68165L9.10462 0.555654C9.44262 -0.124346 10.5576 -0.124346 10.8956 0.555654L13.4436 5.68165L19.1436 6.50965C19.5216 6.56365 19.8346 6.82865 19.9516 7.19065C20.0686 7.55465 19.9696 7.95265 19.6956 8.21765L15.5756 12.2027L16.5466 17.8307C16.6116 18.2057 16.4576 18.5847 16.1506 18.8087C15.9766 18.9367 15.7696 19.0007 15.5616 19.0007Z" fill="#7F828E"/>
|
|
@@ -34,7 +33,7 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
34
33
|
className,
|
|
35
34
|
label,
|
|
36
35
|
defaultValue,
|
|
37
|
-
value
|
|
36
|
+
value,
|
|
38
37
|
placeholder,
|
|
39
38
|
resize,
|
|
40
39
|
startIcon,
|
|
@@ -78,20 +77,19 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
78
77
|
|
|
79
78
|
const iconRef = useRef(null);
|
|
80
79
|
let currentValue = '';
|
|
81
|
-
const [value, setValue] = useState(valueProp || defaultValue);
|
|
82
80
|
const isError = !!error && !value && value !== 0;
|
|
83
81
|
/* Start styled */
|
|
84
82
|
|
|
85
83
|
const TextInputRoot = css`
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
display: block;
|
|
85
|
+
position: relative;
|
|
88
86
|
margin-bottom: 20px;
|
|
89
87
|
`;
|
|
90
88
|
const TextInputIcon = css`
|
|
91
|
-
|
|
89
|
+
display: flex;
|
|
92
90
|
color: inherit;
|
|
93
91
|
.edit-icon-pen {
|
|
94
|
-
|
|
92
|
+
display: flex;
|
|
95
93
|
}
|
|
96
94
|
.edit-icon-confirm {
|
|
97
95
|
display: none;
|
|
@@ -181,12 +179,12 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
181
179
|
inputRef.current.disabled = false;
|
|
182
180
|
};
|
|
183
181
|
|
|
184
|
-
useEffect(() => {
|
|
185
|
-
setValue(valueProp);
|
|
186
|
-
}, [valueProp]);
|
|
187
182
|
useEffect(() => {
|
|
188
183
|
!!refs && refs(ref);
|
|
189
|
-
|
|
184
|
+
|
|
185
|
+
if (defaultValue !== undefined && defaultValue !== '') {
|
|
186
|
+
currentValue = defaultValue;
|
|
187
|
+
}
|
|
190
188
|
}, []);
|
|
191
189
|
useEffect(() => {
|
|
192
190
|
if (/^(quick)?Edit/i.test(type) && !multiline) {
|
|
@@ -331,7 +329,7 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
331
329
|
return jsx("div", {
|
|
332
330
|
ref: ref,
|
|
333
331
|
css: TextInputRoot,
|
|
334
|
-
className: ['DGN-UI-TextInput', className].join(' ').trim()
|
|
332
|
+
className: ['DGN-UI-TextInput', className].join(' ').trim(),
|
|
335
333
|
style: style,
|
|
336
334
|
...props
|
|
337
335
|
}, !!label && jsx(Label, {
|
|
@@ -344,6 +342,7 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
344
342
|
inputRef: inputRef,
|
|
345
343
|
viewType: viewType,
|
|
346
344
|
defaultValue: defaultValue,
|
|
345
|
+
value: value,
|
|
347
346
|
placeholder: placeholder,
|
|
348
347
|
autoFocus: autoFocus,
|
|
349
348
|
disabled: disabled,
|
|
@@ -364,8 +363,7 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
364
363
|
onInput: onInput,
|
|
365
364
|
onKeyDown: onKeyDown,
|
|
366
365
|
onKeyUp: onKeyUp,
|
|
367
|
-
onPaste: onPaste
|
|
368
|
-
value: valueProp
|
|
366
|
+
onPaste: onPaste
|
|
369
367
|
}), isError && jsx(HelperText, {
|
|
370
368
|
disabled: disabled,
|
|
371
369
|
status: status
|
package/icons/basic.js
CHANGED
|
@@ -1289,15 +1289,19 @@ export const ChatBubble = /*#__PURE__*/memo(({
|
|
|
1289
1289
|
viewBox: "0 0 24 24",
|
|
1290
1290
|
fill: "none"
|
|
1291
1291
|
}, /*#__PURE__*/React.createElement("path", {
|
|
1292
|
-
|
|
1292
|
+
fillRule: "evenodd",
|
|
1293
|
+
clipRule: "evenodd",
|
|
1294
|
+
d: "M4 2H20C21.1 2 22 2.9 22 4V16C22 17.1 21.1 18 20 18H6L2 22V4C2 2.9 2.9 2 4 2ZM6 16H20V4H4V18L6 16Z",
|
|
1293
1295
|
fill: colors[color] || color
|
|
1294
1296
|
})) : /*#__PURE__*/React.createElement("svg", {
|
|
1295
|
-
width: width ||
|
|
1296
|
-
height: height ||
|
|
1297
|
-
viewBox: "0 0
|
|
1297
|
+
width: width || 20,
|
|
1298
|
+
height: height || 20,
|
|
1299
|
+
viewBox: "0 0 20 20",
|
|
1298
1300
|
fill: "none"
|
|
1299
1301
|
}, /*#__PURE__*/React.createElement("path", {
|
|
1300
|
-
|
|
1302
|
+
fillRule: "evenodd",
|
|
1303
|
+
clipRule: "evenodd",
|
|
1304
|
+
d: "M2 0H18C19.1 0 20 0.9 20 2V14C20 15.1 19.1 16 18 16H4L0 20V2C0 0.9 0.9 0 2 0ZM4 14H18V2H2V16L4 14Z",
|
|
1301
1305
|
fill: colors[color] || color
|
|
1302
1306
|
}));
|
|
1303
1307
|
});
|
|
@@ -3454,6 +3458,30 @@ export const Monetization = /*#__PURE__*/memo(({
|
|
|
3454
3458
|
fill: colors[color] || color
|
|
3455
3459
|
}));
|
|
3456
3460
|
});
|
|
3461
|
+
export const Money = /*#__PURE__*/memo(({
|
|
3462
|
+
width,
|
|
3463
|
+
height,
|
|
3464
|
+
color = '#7F828E',
|
|
3465
|
+
viewBox = false
|
|
3466
|
+
}) => {
|
|
3467
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
3468
|
+
width: width || 24,
|
|
3469
|
+
height: height || 24,
|
|
3470
|
+
viewBox: "0 0 24 24",
|
|
3471
|
+
fill: "none"
|
|
3472
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3473
|
+
d: "M11.8001 10.9C9.53007 10.31 8.80007 9.7 8.80007 8.75C8.80007 7.66 9.81007 6.9 11.5001 6.9C13.2801 6.9 13.9401 7.75 14.0001 9H16.2101C16.1401 7.28 15.0901 5.7 13.0001 5.19V3H10.0001V5.16C8.06007 5.58 6.50007 6.84 6.50007 8.77C6.50007 11.08 8.41007 12.23 11.2001 12.9C13.7001 13.5 14.2001 14.38 14.2001 15.31C14.2001 16 13.7101 17.1 11.5001 17.1C9.44007 17.1 8.63007 16.18 8.52007 15H6.32007C6.44007 17.19 8.08007 18.42 10.0001 18.83V21H13.0001V18.85C14.9501 18.48 16.5001 17.35 16.5001 15.3C16.5001 12.46 14.0701 11.49 11.8001 10.9Z",
|
|
3474
|
+
fill: colors[color] || color
|
|
3475
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
3476
|
+
width: width || 11,
|
|
3477
|
+
height: height || 18,
|
|
3478
|
+
viewBox: "0 0 11 18",
|
|
3479
|
+
fill: "none"
|
|
3480
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3481
|
+
d: "M5.80007 7.9C3.53007 7.31 2.80007 6.7 2.80007 5.75C2.80007 4.66 3.81007 3.9 5.50007 3.9C7.28007 3.9 7.94007 4.75 8.00007 6H10.2101C10.1401 4.28 9.09007 2.7 7.00007 2.19V0H4.00007V2.16C2.06007 2.58 0.500068 3.84 0.500068 5.77C0.500068 8.08 2.41007 9.23 5.20007 9.9C7.70007 10.5 8.20007 11.38 8.20007 12.31C8.20007 13 7.71007 14.1 5.50007 14.1C3.44007 14.1 2.63007 13.18 2.52007 12H0.320068C0.440068 14.19 2.08007 15.42 4.00007 15.83V18H7.00007V15.85C8.95007 15.48 10.5001 14.35 10.5001 12.3C10.5001 9.46 8.07007 8.49 5.80007 7.9Z",
|
|
3482
|
+
fill: colors[color] || color
|
|
3483
|
+
}));
|
|
3484
|
+
});
|
|
3457
3485
|
export const More = /*#__PURE__*/memo(({
|
|
3458
3486
|
width,
|
|
3459
3487
|
height,
|
|
@@ -5925,6 +5953,30 @@ export const BackFilled = /*#__PURE__*/memo(({
|
|
|
5925
5953
|
fill: colors[color] || color
|
|
5926
5954
|
}));
|
|
5927
5955
|
});
|
|
5956
|
+
export const Bookmark = /*#__PURE__*/memo(({
|
|
5957
|
+
width,
|
|
5958
|
+
height,
|
|
5959
|
+
color = '#7F828E',
|
|
5960
|
+
viewBox = false
|
|
5961
|
+
}) => {
|
|
5962
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
5963
|
+
width: width || 24,
|
|
5964
|
+
height: height || 24,
|
|
5965
|
+
viewBox: "0 0 24 24",
|
|
5966
|
+
fill: "none"
|
|
5967
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5968
|
+
d: "M17 3H7C5.9 3 5 3.9 5 5V21L12 18L19 21V5C19 3.9 18.1 3 17 3Z",
|
|
5969
|
+
fill: colors[color] || color
|
|
5970
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
5971
|
+
width: width || 14,
|
|
5972
|
+
height: height || 18,
|
|
5973
|
+
viewBox: "0 0 14 18",
|
|
5974
|
+
fill: "none"
|
|
5975
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5976
|
+
d: "M12 0H2C0.9 0 0 0.9 0 2V18L7 15L14 18V2C14 0.9 13.1 0 12 0Z",
|
|
5977
|
+
fill: colors[color] || color
|
|
5978
|
+
}));
|
|
5979
|
+
});
|
|
5928
5980
|
export const CancelFilled = /*#__PURE__*/memo(({
|
|
5929
5981
|
width,
|
|
5930
5982
|
height,
|
package/package.json
CHANGED
|
@@ -1,49 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diginet-core-ui",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.3.33",
|
|
4
|
+
"description": "The DigiNet core ui",
|
|
5
|
+
"homepage": "https://diginet.com.vn",
|
|
5
6
|
"main": "index.js",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "
|
|
9
|
-
"
|
|
10
|
-
"build": "
|
|
11
|
-
"
|
|
12
|
-
"build:darwin:linux:default": "rm -rf dist && npm run compile && sass --style=compressed src/scss:dist/css && cp -rf src/assets dist/assets",
|
|
13
|
-
"compile": "babel src --out-dir dist --ignore **/*.stories.js",
|
|
14
|
-
"pack": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm pack",
|
|
15
|
-
"production-keep-version": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish",
|
|
16
|
-
"beta": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish --tag beta",
|
|
17
|
-
"production": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm publish",
|
|
18
|
-
"version:add": "run-script-os",
|
|
19
|
-
"version:add:windows": "cat package.json.tmp | sed \"s/0.0.0/%npm_package_version%/g\" > dist/package.json",
|
|
20
|
-
"version:add:darwin:linux:default": "VERSION=$(npm run version:extract --silent) && cat package.json.tmp | sed \"s/0.0.0/${VERSION}/g\" > dist/package.json",
|
|
21
|
-
"version:bump": "npm version patch --no-git-tag-version --silent",
|
|
22
|
-
"version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'",
|
|
8
|
+
"start-js": "react-scripts start --max_old_space_size=4096",
|
|
9
|
+
"start": "npx npm-run-all -p start-js",
|
|
10
|
+
"build": "GENERATE_SOURCEMAP=false && react-scripts build --env=production --max_old_space_size=8192",
|
|
11
|
+
"eject": "react-scripts eject",
|
|
23
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
13
|
},
|
|
25
14
|
"dependencies": {
|
|
26
15
|
"@emotion/core": "^10.0.35",
|
|
16
|
+
"@emotion/styled": "^10.0.27",
|
|
27
17
|
"prop-types": "^15.7.2",
|
|
28
|
-
"
|
|
18
|
+
"react": "^16.12.0",
|
|
19
|
+
"react-dom": "^16.12.0"
|
|
29
20
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://diginetvn@bitbucket.org/diginetvn/diginet-core-ui.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"core ui",
|
|
27
|
+
"diginet"
|
|
28
|
+
],
|
|
29
|
+
"author": "rocachien",
|
|
30
|
+
"contributors": [
|
|
31
|
+
{
|
|
32
|
+
"name": "Chien Do",
|
|
33
|
+
"email": "rocachien@gmail.com"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Nhat Tran",
|
|
37
|
+
"email": "tranminhnhat1005@gmail.com"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "Thuan Nguyen",
|
|
41
|
+
"email": "nt.thuan.hutech@gmail.com"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT"
|
|
49
45
|
}
|
package/readme.md
CHANGED
|
@@ -38,6 +38,18 @@ npm test
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Changelog
|
|
41
|
+
## 1.3.33
|
|
42
|
+
- \[Fixed\]: Dropdown - Fix show wrong when valueObjectDefault is empty object
|
|
43
|
+
- \[Fixed\]: Button, ButtonIcon - Fix classname
|
|
44
|
+
|
|
45
|
+
## 1.3.32
|
|
46
|
+
- \[Added\]: SYSTEM - Add color text/disabled
|
|
47
|
+
- \[Added\]: Icon - Bookmark, Money
|
|
48
|
+
- \[Changed\]: Icon - ChatBubble
|
|
49
|
+
- \[Fixed\]: Popover - Fix bug not close popover on Modal
|
|
50
|
+
- \[Fixed\]: DropdownBox - Return element in onChangeInput prop
|
|
51
|
+
- \[Fixed\]: InputBase, Dropdown - Change default placeholder
|
|
52
|
+
|
|
41
53
|
## 1.3.31
|
|
42
54
|
- \[Added\]: MenuIcon - W05F0011N0000
|
|
43
55
|
- \[Changed\]: SYSTEM - Replace color text from string to object
|
package/styles/color-helper.js
CHANGED
|
@@ -264,6 +264,8 @@ export const fade = (color, value) => {
|
|
|
264
264
|
*/
|
|
265
265
|
|
|
266
266
|
export const darken = (color, coefficient) => {
|
|
267
|
+
if (isColorName(color)) color = isColorName(color);
|
|
268
|
+
if (!isColor(color)) return;
|
|
267
269
|
color = decomposeColor(color);
|
|
268
270
|
coefficient = clamp(coefficient);
|
|
269
271
|
|
package/styles/colors.js
CHANGED
package/styles/general.js
CHANGED
package/utils/useInput.js
CHANGED
|
@@ -15,11 +15,11 @@ const useInput = props => {
|
|
|
15
15
|
e.persist();
|
|
16
16
|
if (timer.current) clearTimeout(timer.current);
|
|
17
17
|
timer.current = setTimeout(() => {
|
|
18
|
-
const
|
|
19
|
-
setValue(
|
|
18
|
+
const valueInput = e.target.value || e.value;
|
|
19
|
+
setValue(valueInput);
|
|
20
20
|
|
|
21
21
|
e.reset = () => {
|
|
22
|
-
setValue(
|
|
22
|
+
setValue(valueProp);
|
|
23
23
|
e.target.value = valueProp;
|
|
24
24
|
};
|
|
25
25
|
|