diginet-core-ui 1.4.66 → 1.4.67-beta.2
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/assets/images/menu/dhr/MHRP75N0025.svg +15 -0
- package/components/button/icon.js +11 -6
- package/components/form-control/attachment/index.js +1 -1
- package/components/form-control/calendar/function.js +1 -1
- package/components/form-control/calendar/index.js +1 -1
- package/components/form-control/date-range-picker/index.js +14 -8
- package/components/form-control/dropdown/index.js +1 -28
- package/components/form-control/dropdown-box/index.js +63 -21
- package/components/form-control/input-base/index.js +1 -1
- package/components/form-control/money-input/index.js +86 -44
- package/components/form-control/number-input/index2.js +4 -1
- package/components/tree-view/index.js +6 -8
- package/icons/basic.js +86 -0
- package/package.json +78 -44
- package/readme.md +9 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2813_38)">
|
|
3
|
+
<path d="M9.70007 26.7C9.70007 27.3 10.1001 27.8 10.7001 28V25.4C10.1001 25.5 9.70007 26 9.70007 26.7Z" fill="#FF8C00"/>
|
|
4
|
+
<path d="M13.4001 31.5C13.3001 30.9 12.9001 30.4 12.4001 30.4V33C13.1001 32.7 13.5001 32.2 13.4001 31.5Z" fill="#FF8C00"/>
|
|
5
|
+
<path d="M18.7001 38.3V22.3C17.7001 21.1 16.6001 20 15.2001 19.1C15.1001 19 14.9001 19 14.8001 19C14.0001 19 13.2001 19.1 12.4001 19.1C12.1001 19.1 11.9001 19.1 11.6001 19.1C11.3001 19.1 11.1001 19.1 10.8001 19.1C10.0001 19.1 9.20007 19.1 8.40007 19C8.30007 19 8.10007 19 8.00007 19.1C6.50007 20 5.30007 21.2 4.30007 22.6C2.40007 25 1.00007 27.7 0.300074 30.7C7.42078e-05 32.2 -0.199926 33.6 0.200074 35.1C0.600074 36.5 1.40007 37.5 2.70007 38C3.80007 38.5 7.00007 39 7.00007 39C8.20007 39 9.30007 39 10.5001 39C10.9001 39 11.2001 39 11.6001 39C11.9001 39 12.3001 39 12.7001 39C13.9001 39 15.0001 39 16.2001 39C16.1001 39 18.7001 38.4 18.7001 38.3ZM12.9001 28.4C14.3001 28.9 15.2001 30 15.3001 31.5C15.4001 33 14.4001 34.2 13.0001 34.6C12.4001 34.8 12.4001 34.8 12.4001 35.4V36.1H10.8001C10.8001 35.7 10.8001 35.4 10.8001 35C10.8001 34.8 10.7001 34.7 10.5001 34.6C9.20007 34.2 8.30007 33.4 7.90007 32C7.80007 31.7 7.80007 31.4 7.80007 31.1H9.80007C9.80007 31.8 10.1001 32.2 10.8001 32.5V30C10.7001 30 10.5001 29.9 10.3001 29.9C8.80007 29.4 7.80007 28.2 7.90007 26.7C7.90007 25.2 8.90007 24 10.3001 23.6C10.8001 23.5 10.8001 23.5 10.8001 23V22.1H12.4001C12.4001 22.5 12.4001 22.9 12.4001 23.2C12.4001 23.4 12.5001 23.5 12.7001 23.6C14.0001 24 14.9001 24.8 15.3001 26.1C15.5001 27 15.5001 27 14.6001 27H13.4001C13.4001 26.3 13.1001 25.8 12.4001 25.5V28.2C12.5001 28.3 12.7001 28.3 12.9001 28.4Z" fill="#FF8C00"/>
|
|
6
|
+
<path d="M8.80007 17.7C8.60007 17.7 8.50007 17.6 8.40007 17.5C7.40007 16.1 6.40007 14.7 5.60007 13.2C5.30007 12.6 5.10007 12 4.90007 11.4C4.80007 11.2 4.90007 11 4.90007 10.8C4.90007 10.5 5.10007 10.3 5.50007 10.3C5.80007 10.3 6.10007 10.4 6.40007 10.5C6.90007 10.7 7.40007 10.9 7.90007 11.1C8.60007 11.4 9.30007 11.3 9.90007 10.8C10.1001 10.6 10.4001 10.4 10.7001 10.3C11.3001 9.9 11.9001 9.9 12.5001 10.3C12.8001 10.5 13.2001 10.7 13.5001 11C13.9001 11.3 14.4001 11.4 14.9001 11.3C15.5001 11.1 16.1001 10.9 16.7001 10.7C17.0001 10.6 17.3001 10.5 17.6001 10.5C18.0001 10.4 18.2001 10.6 18.2001 11C18.2001 11.4 18.1001 11.9 18.0001 12.3C17.6001 13.5 16.9001 14.5 16.2001 15.5C15.7001 16.2 15.2001 16.9 14.7001 17.6C14.6001 17.7 14.5001 17.8 14.4001 17.8C13.5001 17.7 9.70007 17.7 8.80007 17.7Z" fill="#FF8C00"/>
|
|
7
|
+
<path d="M31.1 7.8C31 8.1 30.7 8.2 30.4 8.3H27.6V14.5L23.6 18.5C23.1 19 23 19.7 23.2 20.3C23.5 20.9 24.1 21.3 24.7 21.3H26.6V38.3C26.6 38.6 26.7 38.8 26.8 39H20.3C19.9 39 19.6 38.7 19.5 38.3V8.3H16.7C16.4 8.3 16.1 8.1 16 7.8C16 7.5 16.1 7.2 16.3 7L23.1 0.2C23.2 0.1 23.4 0 23.6 0C23.8 0 24 0.1 24.1 0.2L30.9 7C31.1 7.2 31.2 7.5 31.1 7.8Z" fill="#1CA261"/>
|
|
8
|
+
<path d="M31.4598 12C31.6598 12 31.8598 12.1 31.9598 12.2L38.7598 19C38.9598 19.2 39.0598 19.5 38.9598 19.8C38.8598 20.1 38.5598 20.2 38.2598 20.3H35.4598V38.3C35.4598 38.7 35.1598 39 34.7598 39H28.2598C27.8598 39 27.5598 38.7 27.5598 38.3V20.3H24.7598C24.4598 20.3 24.1598 20.1 24.0598 19.8C23.9598 19.5 23.9598 19.2 24.2598 19L31.0598 12.2C31.0598 12.1 31.2598 12 31.4598 12Z" fill="#FF4444"/>
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_2813_38">
|
|
12
|
+
<rect width="39" height="39" fill="white"/>
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -109,11 +109,8 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
109
109
|
currentRef.instance = _instance;
|
|
110
110
|
return currentRef;
|
|
111
111
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
title: title,
|
|
115
|
-
disableInteractive: !title
|
|
116
|
-
}, jsx("button", {
|
|
112
|
+
const renderBtn = () => {
|
|
113
|
+
let result = jsx("button", {
|
|
117
114
|
css: [_ButtonRootCSS, _ButtonSizeCSS],
|
|
118
115
|
ref: ref,
|
|
119
116
|
id: id,
|
|
@@ -133,7 +130,15 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
133
130
|
ref: rippleRef,
|
|
134
131
|
color: getRippleColor(colorProp, viewType, colors),
|
|
135
132
|
circular: circular
|
|
136
|
-
}))
|
|
133
|
+
}));
|
|
134
|
+
if (title) result = jsx(Tooltip, {
|
|
135
|
+
title: title,
|
|
136
|
+
disableInteractive: !title
|
|
137
|
+
}, result);
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
return useMemo(() => {
|
|
141
|
+
return renderBtn();
|
|
137
142
|
}, [children, circular, className, colorHover, colorProp, disabled, height, id, loading, name, onClick, size, style, viewBox, viewType, width, theme, title]);
|
|
138
143
|
}));
|
|
139
144
|
const ButtonIconCSS = iconSize => css`
|
|
@@ -573,7 +573,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
573
573
|
// Add event listener click out of item
|
|
574
574
|
if (!existClickOutOfItem.current) {
|
|
575
575
|
existClickOutOfItem.current = true;
|
|
576
|
-
attachmentHandleIconRef.current.style.display = '
|
|
576
|
+
attachmentHandleIconRef.current.style.display = 'flex';
|
|
577
577
|
document.addEventListener('keydown', onKeyDown);
|
|
578
578
|
document.addEventListener('click', clickOutOfItem);
|
|
579
579
|
}
|
|
@@ -652,7 +652,7 @@ const renderNavigator = (className, refs, dbLeftFn, leftFn, rightFn, dbRightFn,
|
|
|
652
652
|
color: 'primary',
|
|
653
653
|
type: 'h3',
|
|
654
654
|
ref: refs.content,
|
|
655
|
-
format: ['
|
|
655
|
+
format: ['sentence']
|
|
656
656
|
}))), jsx("div", {
|
|
657
657
|
className: className.navigator.around
|
|
658
658
|
}, jsx(ButtonIcon, {
|
|
@@ -226,7 +226,7 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
226
226
|
* START EFFECT
|
|
227
227
|
*/
|
|
228
228
|
useEffect(() => {
|
|
229
|
-
if (defaultValue && defaultValue !== '' && isValidDate(defaultValue)) {
|
|
229
|
+
if (defaultValue && defaultValue !== '' && isValidDate(defaultValue) && !value) {
|
|
230
230
|
if (isBeforeLimit(min, defaultValue)) {
|
|
231
231
|
onUpdate(min);
|
|
232
232
|
} else if (isAfterLimit(max, defaultValue)) {
|
|
@@ -119,6 +119,7 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, ref
|
|
|
119
119
|
const iconRef = useRef(null);
|
|
120
120
|
const ipConRef = useRef(null);
|
|
121
121
|
const ipRef = useRef(null);
|
|
122
|
+
const iconCloseRef = useRef(null);
|
|
122
123
|
const pickerRef = useRef(null);
|
|
123
124
|
const tableFrRef = useRef(null);
|
|
124
125
|
const tableToRef = useRef(null);
|
|
@@ -593,22 +594,25 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, ref
|
|
|
593
594
|
const t = iconRef.current.childNodes[+open];
|
|
594
595
|
if (open) {
|
|
595
596
|
Object.assign(t.style, {
|
|
596
|
-
...
|
|
597
|
+
...activeStyle
|
|
597
598
|
});
|
|
598
599
|
Object.assign(t.previousSibling.style, {
|
|
599
600
|
...activeStyle
|
|
600
601
|
});
|
|
601
602
|
setTimeout(() => {
|
|
603
|
+
t.style.pointerEvents = null;
|
|
602
604
|
t.previousSibling.style.pointerEvents = null;
|
|
605
|
+
if (iconCloseRef.current) Object.assign(iconCloseRef.current.style, hiddenStyle);
|
|
603
606
|
}, 200);
|
|
604
607
|
} else {
|
|
605
608
|
Object.assign(t.style, {
|
|
606
|
-
...
|
|
609
|
+
...activeStyle
|
|
607
610
|
});
|
|
608
611
|
Object.assign(t.nextSibling.style, {
|
|
609
612
|
...activeStyle
|
|
610
613
|
});
|
|
611
614
|
setTimeout(() => {
|
|
615
|
+
t.style.pointerEvents = null;
|
|
612
616
|
t.nextSibling.style.pointerEvents = null;
|
|
613
617
|
}, 200);
|
|
614
618
|
}
|
|
@@ -995,17 +999,18 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, ref
|
|
|
995
999
|
css: IconAreaCSS,
|
|
996
1000
|
ref: iconRef
|
|
997
1001
|
}, jsx(ButtonIcon, {
|
|
998
|
-
|
|
999
|
-
onClick: triggerFocus,
|
|
1000
|
-
className: `${unique.icon} ${unique.icon}-accept`,
|
|
1001
|
-
viewBox: true,
|
|
1002
|
-
name: 'Calendar'
|
|
1003
|
-
}), jsx(ButtonIcon, {
|
|
1002
|
+
ref: iconCloseRef,
|
|
1004
1003
|
viewType: 'ghost',
|
|
1005
1004
|
onClick: onClear,
|
|
1006
1005
|
className: `${unique.icon} ${unique.icon}-cancel`,
|
|
1007
1006
|
viewBox: true,
|
|
1008
1007
|
name: 'Close'
|
|
1008
|
+
}), jsx(ButtonIcon, {
|
|
1009
|
+
viewType: 'ghost',
|
|
1010
|
+
onClick: triggerFocus,
|
|
1011
|
+
className: `${unique.icon} ${unique.icon}-accept`,
|
|
1012
|
+
viewBox: true,
|
|
1013
|
+
name: 'Calendar'
|
|
1009
1014
|
})) : null;
|
|
1010
1015
|
const endIcon = actionIconAt === 'end' && iconComp;
|
|
1011
1016
|
const startIcon = actionIconAt === 'start' && iconComp;
|
|
@@ -1321,6 +1326,7 @@ const buttonProps = ({
|
|
|
1321
1326
|
}
|
|
1322
1327
|
});
|
|
1323
1328
|
const IconAreaCSS = css`
|
|
1329
|
+
display: flex;
|
|
1324
1330
|
.${unique.icon} {
|
|
1325
1331
|
${displayNone};
|
|
1326
1332
|
${cursorPointer};
|
|
@@ -110,7 +110,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
110
110
|
total,
|
|
111
111
|
treeViewID,
|
|
112
112
|
treeViewParentID,
|
|
113
|
-
value: valueProp,
|
|
113
|
+
value: valueProp = '',
|
|
114
114
|
valueExpr,
|
|
115
115
|
valueObjectDefault,
|
|
116
116
|
viewType,
|
|
@@ -1754,33 +1754,6 @@ const CheckBoxCSS = ({
|
|
|
1754
1754
|
`;
|
|
1755
1755
|
/* End styled */
|
|
1756
1756
|
|
|
1757
|
-
// Dropdown.defaultProps = {
|
|
1758
|
-
// allowSearch: true,
|
|
1759
|
-
// className: '',
|
|
1760
|
-
// clearAble: false,
|
|
1761
|
-
// dataSource: [],
|
|
1762
|
-
// disabled: false,
|
|
1763
|
-
// displayExpr: 'name',
|
|
1764
|
-
// error: '',
|
|
1765
|
-
// iconExpr: 'none',
|
|
1766
|
-
// inputProps: {},
|
|
1767
|
-
// itemMode: 'normal',
|
|
1768
|
-
// label: '',
|
|
1769
|
-
// limit: 50,
|
|
1770
|
-
// loading: false,
|
|
1771
|
-
// multilineSelectedItem: false,
|
|
1772
|
-
// multiple: false,
|
|
1773
|
-
// noDataText: getGlobal('noDataText'),
|
|
1774
|
-
// placeholder: getGlobal('dropdownPlaceholder'),
|
|
1775
|
-
// readOnly: false,
|
|
1776
|
-
// required: false,
|
|
1777
|
-
// searchDelayTime: getGlobal('delayOnInput'),
|
|
1778
|
-
// searchMode: 'contains',
|
|
1779
|
-
// total: Number.MAX_SAFE_INTEGER,
|
|
1780
|
-
// valueExpr: 'id',
|
|
1781
|
-
// viewType: 'underlined',
|
|
1782
|
-
// };
|
|
1783
|
-
|
|
1784
1757
|
Dropdown.propTypes = {
|
|
1785
1758
|
action: PropTypes.shape({
|
|
1786
1759
|
loadData: PropTypes.func
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
|
-
import { ButtonIcon, InputBase, Label, Popover, PopoverBody } from "../..";
|
|
4
|
+
import { ButtonIcon, InputBase, Label, Popover, PopoverBody, HelperText } from "../..";
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { Fragment, forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react';
|
|
6
|
+
import { Fragment, forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, useMemo } from 'react';
|
|
7
7
|
import { animation, borderColor, displayBlock, overflowHidden, parseHeight, parseMinWidth, positionRelative, scaleX } from "../../../styles/general";
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../../utils";
|
|
11
|
+
const regexBetween = /[^{}]+(?=})/g;
|
|
12
|
+
const regexInclude = /{|}/g;
|
|
11
13
|
const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
14
|
if (!reference) reference = useRef(null);
|
|
13
15
|
const theme = useTheme();
|
|
@@ -22,10 +24,14 @@ const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referen
|
|
|
22
24
|
});
|
|
23
25
|
const {
|
|
24
26
|
action = {},
|
|
27
|
+
allowInput,
|
|
25
28
|
bgColor: bgColorProp,
|
|
26
29
|
children,
|
|
27
30
|
className,
|
|
28
31
|
delayOnInput,
|
|
32
|
+
disabled,
|
|
33
|
+
displayExpr: displayExprProp,
|
|
34
|
+
error,
|
|
29
35
|
endIcon,
|
|
30
36
|
inputProps,
|
|
31
37
|
inputRef,
|
|
@@ -39,10 +45,19 @@ const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referen
|
|
|
39
45
|
placeholder,
|
|
40
46
|
startIcon,
|
|
41
47
|
style,
|
|
42
|
-
value,
|
|
43
|
-
|
|
48
|
+
value: valueProps,
|
|
49
|
+
valueExpr,
|
|
50
|
+
viewType,
|
|
51
|
+
helperTextProps
|
|
44
52
|
} = props;
|
|
53
|
+
let displayExpr = displayExprProp;
|
|
45
54
|
const bgColor = typeof bgColorProp === 'string' ? getProp(colors, bgColorProp, bgColorProp) : bgColorProp;
|
|
55
|
+
const ErrorView = useMemo(() => {
|
|
56
|
+
return error ? jsx(HelperText, {
|
|
57
|
+
...helperTextProps,
|
|
58
|
+
disabled: disabled
|
|
59
|
+
}, error) : null;
|
|
60
|
+
}, [disabled, error, helperTextProps]);
|
|
46
61
|
const ref = useRef(null);
|
|
47
62
|
const dropdownBoxRef = useRef(null);
|
|
48
63
|
const timer = useRef(null);
|
|
@@ -85,6 +100,28 @@ const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referen
|
|
|
85
100
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
86
101
|
}
|
|
87
102
|
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Chuyển đổi data thành giá trị cần hiện thị dựa vào displayExpr [string, string object {field} - {field}], renderSelectedItem, displayExpr, valueExpr
|
|
106
|
+
* @param data {object} rowData of dataSource
|
|
107
|
+
* @return {string}
|
|
108
|
+
*/
|
|
109
|
+
const displayValue = data => {
|
|
110
|
+
let text = '';
|
|
111
|
+
if (data || data === 0) {
|
|
112
|
+
displayExpr = displayExpr || valueExpr;
|
|
113
|
+
let mask = data === null || data === void 0 ? void 0 : data[displayExpr];
|
|
114
|
+
// convert {id} - {name} to {<data[id]>} - {<data[name]>}
|
|
115
|
+
if (!mask && regexBetween.test(displayExpr)) {
|
|
116
|
+
var _displayExpr;
|
|
117
|
+
mask = (_displayExpr = displayExpr) === null || _displayExpr === void 0 ? void 0 : _displayExpr.replace(regexBetween, _ => (data === null || data === void 0 ? void 0 : data[_]) || '');
|
|
118
|
+
} else if (!mask) {
|
|
119
|
+
mask = typeof data !== 'object' ? data : '';
|
|
120
|
+
}
|
|
121
|
+
text = mask.toString().replace(regexInclude, '');
|
|
122
|
+
}
|
|
123
|
+
return text;
|
|
124
|
+
};
|
|
88
125
|
useLayoutEffect(() => {
|
|
89
126
|
if (ref.current) {
|
|
90
127
|
const {
|
|
@@ -130,15 +167,17 @@ const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referen
|
|
|
130
167
|
onClick: openOnClickAt === 'icon' ? onTriggerDropdown : null
|
|
131
168
|
}) : null;
|
|
132
169
|
};
|
|
170
|
+
const value = displayValue(valueProps);
|
|
133
171
|
return jsx(Fragment, null, jsx("div", {
|
|
134
172
|
ref: ref,
|
|
135
173
|
css: _DropdownBoxRootCSS,
|
|
136
|
-
className: classNames('DGN-UI-Dropdown-Box', className),
|
|
174
|
+
className: classNames('DGN-UI-Dropdown-Box', className, error && 'error'),
|
|
137
175
|
style: style
|
|
138
176
|
}, label ? jsx(Label, {
|
|
139
177
|
...labelProps
|
|
140
178
|
}, label) : null, jsx(InputBase, {
|
|
141
179
|
...inputProps,
|
|
180
|
+
readOnly: !allowInput,
|
|
142
181
|
style: inputStyle,
|
|
143
182
|
viewType: viewType,
|
|
144
183
|
inputRef: inputRef,
|
|
@@ -157,7 +196,7 @@ const DropdownBox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referen
|
|
|
157
196
|
anchor: ref.current,
|
|
158
197
|
width: popoverWidth,
|
|
159
198
|
onClose: closeDropdownBox
|
|
160
|
-
}, jsx(PopoverBody, null, children)));
|
|
199
|
+
}, jsx(PopoverBody, null, children)), ErrorView);
|
|
161
200
|
}));
|
|
162
201
|
const DropdownBoxRootCSS = (bgColorProp, {
|
|
163
202
|
colors
|
|
@@ -166,6 +205,17 @@ const DropdownBoxRootCSS = (bgColorProp, {
|
|
|
166
205
|
${positionRelative};
|
|
167
206
|
${parseMinWidth(150)};
|
|
168
207
|
${parseHeight('max-content')};
|
|
208
|
+
&.error {
|
|
209
|
+
.DGN-UI-InputBase {
|
|
210
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
211
|
+
&::before {
|
|
212
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
213
|
+
}
|
|
214
|
+
&::after {
|
|
215
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
169
219
|
.DGN-UI-InputBase {
|
|
170
220
|
background: ${bgColorProp ? bgColorProp === true ? getProp(colors, 'fill/disabled') : bgColorProp : 'inherit'} !important;
|
|
171
221
|
${openState && css`
|
|
@@ -183,20 +233,6 @@ const DropdownBoxCSS = ({
|
|
|
183
233
|
margin-top: ${spacing([1])};
|
|
184
234
|
${overflowHidden};
|
|
185
235
|
`;
|
|
186
|
-
|
|
187
|
-
// DropdownBox.defaultProps = {
|
|
188
|
-
// className: '',
|
|
189
|
-
// label: '',
|
|
190
|
-
// placeholder: '',
|
|
191
|
-
// startIcon: 'Search',
|
|
192
|
-
// endIcon: 'ArrowDown',
|
|
193
|
-
// openOnClickAt: 'icon',
|
|
194
|
-
// viewType: 'underlined',
|
|
195
|
-
// inputProps: {},
|
|
196
|
-
// delayOnInput: 700,
|
|
197
|
-
// zIndex: zIndexCORE(1),
|
|
198
|
-
// };
|
|
199
|
-
|
|
200
236
|
DropdownBox.propTypes = {
|
|
201
237
|
/** class for dropdown */
|
|
202
238
|
className: PropTypes.string,
|
|
@@ -233,6 +269,12 @@ DropdownBox.propTypes = {
|
|
|
233
269
|
/** the function will run after open */
|
|
234
270
|
onOpened: PropTypes.func,
|
|
235
271
|
/** the function will run after close */
|
|
236
|
-
onClosed: PropTypes.func
|
|
272
|
+
onClosed: PropTypes.func,
|
|
273
|
+
/** Error message displayed below the input. */
|
|
274
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
275
|
+
/** If `true`, the component is disabled. */
|
|
276
|
+
disabled: PropTypes.bool,
|
|
277
|
+
/** If `true`, the input is enable. */
|
|
278
|
+
allowInput: PropTypes.bool
|
|
237
279
|
};
|
|
238
280
|
export default DropdownBox;
|
|
@@ -60,7 +60,7 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference
|
|
|
60
60
|
...other
|
|
61
61
|
} = props;
|
|
62
62
|
const autoWidth = !autoWidthProp && inputProps !== null && inputProps !== void 0 && inputProps.autoWidth ? inputProps.autoWidth : autoWidthProp;
|
|
63
|
-
const delayOnChange = delayOnChangeProp
|
|
63
|
+
const delayOnChange = delayOnChangeProp !== null && delayOnChangeProp !== void 0 ? delayOnChangeProp : getGlobal('delayOnInput');
|
|
64
64
|
const placeholder = placeholderProp || getGlobal('inputPlaceholder');
|
|
65
65
|
const _onChange = e => {
|
|
66
66
|
onChange && onChange(e);
|
|
@@ -38,13 +38,29 @@ const num2WordsVi = function () {
|
|
|
38
38
|
return e > 0 && (o += n(e, r) + ' ngàn', r = !0), t > 0 && (o += n(t, r)), o;
|
|
39
39
|
};
|
|
40
40
|
return {
|
|
41
|
-
convert: function (
|
|
41
|
+
convert: function (input) {
|
|
42
|
+
if (!Number.isFinite(input)) return '';
|
|
43
|
+
let parts = String(input).split('.');
|
|
44
|
+
let intPart = Math.floor(Number(parts[0]));
|
|
45
|
+
let decimalPart = parts[1];
|
|
46
|
+
let temp = intPart;
|
|
47
|
+
let nStr = '';
|
|
48
|
+
let a = '';
|
|
42
49
|
let ty;
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
if (intPart === 0) return t[0];
|
|
51
|
+
do {
|
|
52
|
+
ty = temp % 1e9;
|
|
53
|
+
temp = Math.floor(temp / 1e9);
|
|
54
|
+
nStr = temp > 0 ? o(ty, true) + a + nStr : o(ty, false) + a + nStr;
|
|
55
|
+
a = ' tỷ';
|
|
56
|
+
} while (temp > 0);
|
|
57
|
+
let result = nStr.trim();
|
|
58
|
+
|
|
59
|
+
// xử lý thập phân
|
|
60
|
+
if (decimalPart) {
|
|
61
|
+
result += ' phẩy ' + decimalPart.split('').map(d => t[Number(d)]).join(' ');
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
48
64
|
}
|
|
49
65
|
};
|
|
50
66
|
}();
|
|
@@ -56,22 +72,32 @@ const num2WordsEn = n => {
|
|
|
56
72
|
const drop = n => xs => xs.slice(n);
|
|
57
73
|
const reverse = xs => xs.slice(0).reverse();
|
|
58
74
|
const comp = f => g => x => f(g(x));
|
|
59
|
-
const not = x => !x;
|
|
60
75
|
const chunk = n => xs => isEmpty(xs) ? [] : [take(n)(xs), ...chunk(n)(drop(n)(xs))];
|
|
61
76
|
let a = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
|
|
62
77
|
let b = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
|
|
63
78
|
let g = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion'];
|
|
64
|
-
// this part is really nasty still
|
|
65
|
-
// it might edit this again later to show how Monoids could fix this up
|
|
66
79
|
let makeGroup = ([ones, tens, huns]) => {
|
|
67
80
|
return [num(huns) === 0 ? '' : a[huns] + ' hundred ', num(ones) === 0 ? b[tens] : b[tens] && b[tens] + '-' || '', a[tens + ones] || a[ones]].join('');
|
|
68
81
|
};
|
|
69
|
-
// "thousands" constructor; no real good names for this, I guess
|
|
70
82
|
let thousand = (group, i) => group === '' ? group : `${group} ${g[i]}`;
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
// convert integer part
|
|
84
|
+
const convertInt = str => {
|
|
85
|
+
if (str === '0') return 'zero';
|
|
86
|
+
return comp(chunk(3))(reverse)(arr(str)).map(makeGroup).map(thousand).filter(x => x.trim().length > 0).reverse().join(' ').trim();
|
|
87
|
+
};
|
|
88
|
+
// normalize input
|
|
89
|
+
if (typeof n === 'number') n = String(n);
|
|
90
|
+
const parts = n.split('.');
|
|
91
|
+
const intPart = parts[0];
|
|
92
|
+
const decimalPart = parts[1];
|
|
93
|
+
let result = convertInt(intPart);
|
|
94
|
+
|
|
95
|
+
// decimal handling
|
|
96
|
+
if (decimalPart) {
|
|
97
|
+
const decimalWords = decimalPart.split('').map(d => a[Number(d)] || '').join(' ').trim();
|
|
98
|
+
result += ' point ' + decimalWords;
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
75
101
|
};
|
|
76
102
|
const num2WordsZh = (() => {
|
|
77
103
|
const t = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
|
|
@@ -79,47 +105,63 @@ const num2WordsZh = (() => {
|
|
|
79
105
|
const bigUnits = ['', '万', '亿', '兆'];
|
|
80
106
|
const readSection = num => {
|
|
81
107
|
let str = '';
|
|
82
|
-
let zero =
|
|
83
|
-
for (let i = 0; i < 4
|
|
108
|
+
let zero = false;
|
|
109
|
+
for (let i = 0; i < 4; i++) {
|
|
84
110
|
const digit = num % 10;
|
|
85
111
|
if (digit === 0) {
|
|
86
|
-
if (!zero) {
|
|
87
|
-
zero = true;
|
|
112
|
+
if (!zero && str !== '') {
|
|
88
113
|
str = t[0] + str;
|
|
89
114
|
}
|
|
115
|
+
zero = true;
|
|
90
116
|
} else {
|
|
91
|
-
zero = false;
|
|
92
117
|
str = t[digit] + units[i] + str;
|
|
118
|
+
zero = false;
|
|
93
119
|
}
|
|
94
120
|
num = Math.floor(num / 10);
|
|
121
|
+
if (num === 0) break;
|
|
95
122
|
}
|
|
96
123
|
return str;
|
|
97
124
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const sectionStr = readSection(section) + bigUnits[unitPos];
|
|
113
|
-
str = sectionStr + str;
|
|
114
|
-
needZero = true;
|
|
125
|
+
const readInteger = num => {
|
|
126
|
+
if (num === 0) return t[0];
|
|
127
|
+
let sections = [];
|
|
128
|
+
while (num > 0) {
|
|
129
|
+
sections.unshift(num % 10000);
|
|
130
|
+
num = Math.floor(num / 10000);
|
|
131
|
+
}
|
|
132
|
+
let result = '';
|
|
133
|
+
for (let i = 0; i < sections.length; i++) {
|
|
134
|
+
const section = sections[i];
|
|
135
|
+
const unit = bigUnits[sections.length - 1 - i];
|
|
136
|
+
if (section === 0) {
|
|
137
|
+
if (result && !result.endsWith(t[0]) && sections.slice(i + 1).some(v => v > 0)) {
|
|
138
|
+
result += t[0];
|
|
115
139
|
}
|
|
116
|
-
|
|
117
|
-
unitPos++;
|
|
140
|
+
continue;
|
|
118
141
|
}
|
|
119
142
|
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
143
|
+
// Nếu nhóm hiện tại <1000 và phía trước đã có nội dung
|
|
144
|
+
// => cần thêm "零"
|
|
145
|
+
if (result && section < 1000 && !result.endsWith(t[0])) {
|
|
146
|
+
result += t[0];
|
|
147
|
+
}
|
|
148
|
+
result += readSection(section) + unit;
|
|
149
|
+
}
|
|
150
|
+
return result.replace(/零+/g, '零').replace(/零$/g, '').replace(/^一十/, '十');
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
convert: num => {
|
|
154
|
+
if (typeof num === 'string') {
|
|
155
|
+
num = num.trim();
|
|
156
|
+
}
|
|
157
|
+
const strNum = String(num);
|
|
158
|
+
if (!strNum.includes('.')) {
|
|
159
|
+
return readInteger(Number(strNum));
|
|
160
|
+
}
|
|
161
|
+
const [intPart, decPart] = strNum.split('.');
|
|
162
|
+
const intWords = readInteger(Number(intPart));
|
|
163
|
+
const decWords = decPart.split('').map(ch => t[Number(ch)]).join('');
|
|
164
|
+
return `${intWords}点${decWords}`;
|
|
123
165
|
}
|
|
124
166
|
};
|
|
125
167
|
})();
|
|
@@ -403,7 +445,7 @@ const MoneyInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
403
445
|
}
|
|
404
446
|
}
|
|
405
447
|
const v = getValueWithDecimal(number.toString().replace('.', decimalSymbol));
|
|
406
|
-
if (convertToWords &&
|
|
448
|
+
if (convertToWords && (disabled || readOnly)) {
|
|
407
449
|
inputRef.current.value = convertNumToWords(value);
|
|
408
450
|
} else {
|
|
409
451
|
inputRef.current.value = parseValueWithFix(thousandSeparator ? getThousandSeparator(v) : v);
|
|
@@ -431,9 +473,9 @@ const MoneyInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
431
473
|
});
|
|
432
474
|
const convertNumToWords = number => {
|
|
433
475
|
let valueConverted = getGlobal('helperInvalid');
|
|
434
|
-
if (Number.
|
|
476
|
+
if (Number.isFinite(number)) {
|
|
435
477
|
const currentLocale = locale.get();
|
|
436
|
-
const converter = converters[currentLocale] ||
|
|
478
|
+
const converter = converters[currentLocale] || num2WordsEn; // fallback VN
|
|
437
479
|
valueConverted = Object.hasOwn(converter, 'convert') ? converter.convert(number) : converter(number);
|
|
438
480
|
}
|
|
439
481
|
return valueConverted;
|
|
@@ -49,7 +49,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
49
49
|
labelProps,
|
|
50
50
|
max: maxProp,
|
|
51
51
|
maxDigit,
|
|
52
|
-
min,
|
|
52
|
+
min: minProp,
|
|
53
53
|
nonStyle,
|
|
54
54
|
onBlur,
|
|
55
55
|
onChange,
|
|
@@ -69,9 +69,12 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
69
69
|
viewType
|
|
70
70
|
} = props;
|
|
71
71
|
let max = maxProp;
|
|
72
|
+
let min = minProp;
|
|
72
73
|
let thousandSymbol = thousandSeparator;
|
|
73
74
|
let decimalSymbol = decimalSymbolProp;
|
|
74
75
|
let valueProps = valueProp;
|
|
76
|
+
if (!min && min !== 0) min = -Infinity;
|
|
77
|
+
if (!max && max !== 0) max = Infinity;
|
|
75
78
|
const pos = useRef(null);
|
|
76
79
|
const ref = useRef(null);
|
|
77
80
|
const globalRef = useRef({});
|
|
@@ -97,21 +97,19 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
97
97
|
const checkedParentFollowValue = nodes => {
|
|
98
98
|
if (nodes && nodes !== null && nodes !== void 0 && nodes.length) {
|
|
99
99
|
nodes.forEach(node => {
|
|
100
|
+
const checkedLeastOfOne = Array.from(node.querySelectorAll('input')).slice(1).some(el => el.checked);
|
|
101
|
+
const checkedAll = Array.from(node.querySelectorAll('input')).slice(1).every(el => el.checked);
|
|
100
102
|
if (!node.classList.contains('non-child')) {
|
|
101
103
|
const input = node.firstChild.querySelector('input');
|
|
102
104
|
if (input.checked) {
|
|
103
|
-
if (
|
|
105
|
+
if (checkedAll) {
|
|
104
106
|
determinateCheckbox(input, true);
|
|
107
|
+
} else if (checkedLeastOfOne) {
|
|
108
|
+
determinateCheckbox(input, false);
|
|
105
109
|
}
|
|
106
|
-
Array.from(node.querySelectorAll('
|
|
107
|
-
el.checked = true;
|
|
108
|
-
if (!el.classList.contains('determinate')) {
|
|
109
|
-
determinateCheckbox(el, true);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
110
|
+
checkedParentFollowValue(Array.from(node.querySelectorAll('div.TreeView-Item non-child, div.DGN-UI-Accordion')));
|
|
112
111
|
} else {
|
|
113
112
|
var _node$lastChild, _node$lastChild$first;
|
|
114
|
-
const checkedLeastOfOne = Array.from(node.querySelectorAll('input')).some(el => el.checked);
|
|
115
113
|
if (checkedLeastOfOne) {
|
|
116
114
|
input.checked = checkedLeastOfOne;
|
|
117
115
|
if (input.classList.contains('determinate')) {
|
package/icons/basic.js
CHANGED
|
@@ -3800,6 +3800,34 @@ export const Lock = /*#__PURE__*/memo(({
|
|
|
3800
3800
|
fill: fillColor(color)
|
|
3801
3801
|
}));
|
|
3802
3802
|
});
|
|
3803
|
+
export const LockReset = /*#__PURE__*/memo(({
|
|
3804
|
+
width,
|
|
3805
|
+
height,
|
|
3806
|
+
color = 'system/rest',
|
|
3807
|
+
viewBox = false
|
|
3808
|
+
}) => {
|
|
3809
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
3810
|
+
width: width || 24,
|
|
3811
|
+
height: height || 24,
|
|
3812
|
+
viewBox: "0 0 24 24",
|
|
3813
|
+
fill: "none"
|
|
3814
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3815
|
+
fillRule: "evenodd",
|
|
3816
|
+
clipRule: "evenodd",
|
|
3817
|
+
d: "M12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12H4C4 13.1 4.20833 14.1375 4.625 15.1125C5.04167 16.0875 5.6125 16.9375 6.3375 17.6625C7.0625 18.3875 7.9125 18.9625 8.8875 19.3875C9.8625 19.8125 10.9 20.025 12 20.025C14.2333 20.025 16.125 19.25 17.675 17.7C19.225 16.15 20 14.2583 20 12.025C20 9.79167 19.225 7.9 17.675 6.35C16.125 4.8 14.2333 4.025 12 4.025C10.5167 4.025 9.17083 4.3875 7.9625 5.1125C6.75417 5.8375 5.8 6.8 5.1 8H8V10H2V4H4V6C4.91667 4.78333 6.06667 3.8125 7.45 3.0875C8.83333 2.3625 10.35 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22ZM10 16C9.71667 16 9.47917 15.9042 9.2875 15.7125C9.09583 15.5208 9 15.2833 9 15V12C9 11.7167 9.09583 11.4792 9.2875 11.2875C9.47917 11.0958 9.71667 11 10 11V10C10 9.45 10.1958 8.97917 10.5875 8.5875C10.9792 8.19583 11.45 8 12 8C12.55 8 13.0208 8.19583 13.4125 8.5875C13.8042 8.97917 14 9.45 14 10V11C14.2833 11 14.5208 11.0958 14.7125 11.2875C14.9042 11.4792 15 11.7167 15 12V15C15 15.2833 14.9042 15.5208 14.7125 15.7125C14.5208 15.9042 14.2833 16 14 16H10ZM11 11H13V10C13 9.71667 12.9042 9.47917 12.7125 9.2875C12.5208 9.09583 12.2833 9 12 9C11.7167 9 11.4792 9.09583 11.2875 9.2875C11.0958 9.47917 11 9.71667 11 10V11Z",
|
|
3818
|
+
fill: fillColor(color)
|
|
3819
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
3820
|
+
width: width || 20,
|
|
3821
|
+
height: height || 20,
|
|
3822
|
+
viewBox: "0 0 20 20",
|
|
3823
|
+
fill: "none"
|
|
3824
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3825
|
+
fillRule: "evenodd",
|
|
3826
|
+
clipRule: "evenodd",
|
|
3827
|
+
d: "M10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10H2C2 11.1 2.20833 12.1375 2.625 13.1125C3.04167 14.0875 3.6125 14.9375 4.3375 15.6625C5.0625 16.3875 5.9125 16.9625 6.8875 17.3875C7.8625 17.8125 8.9 18.025 10 18.025C12.2333 18.025 14.125 17.25 15.675 15.7C17.225 14.15 18 12.2583 18 10.025C18 7.79167 17.225 5.9 15.675 4.35C14.125 2.8 12.2333 2.025 10 2.025C8.51667 2.025 7.17083 2.3875 5.9625 3.1125C4.75417 3.8375 3.8 4.8 3.1 6H6V8H0V2H2V4C2.91667 2.78333 4.06667 1.8125 5.45 1.0875C6.83333 0.3625 8.35 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20ZM8 14C7.71667 14 7.47917 13.9042 7.2875 13.7125C7.09583 13.5208 7 13.2833 7 13V10C7 9.71667 7.09583 9.47917 7.2875 9.2875C7.47917 9.09583 7.71667 9 8 9V8C8 7.45 8.19583 6.97917 8.5875 6.5875C8.97917 6.19583 9.45 6 10 6C10.55 6 11.0208 6.19583 11.4125 6.5875C11.8042 6.97917 12 7.45 12 8V9C12.2833 9 12.5208 9.09583 12.7125 9.2875C12.9042 9.47917 13 9.71667 13 10V13C13 13.2833 12.9042 13.5208 12.7125 13.7125C12.5208 13.9042 12.2833 14 12 14H8ZM9 9H11V8C11 7.71667 10.9042 7.47917 10.7125 7.2875C10.5208 7.09583 10.2833 7 10 7C9.71667 7 9.47917 7.09583 9.2875 7.2875C9.09583 7.47917 9 7.71667 9 8V9Z",
|
|
3828
|
+
fill: fillColor(color)
|
|
3829
|
+
}));
|
|
3830
|
+
});
|
|
3803
3831
|
export const Login = /*#__PURE__*/memo(({
|
|
3804
3832
|
width,
|
|
3805
3833
|
height,
|
|
@@ -5268,6 +5296,34 @@ export const PersonArrowRight = /*#__PURE__*/memo(({
|
|
|
5268
5296
|
fill: fillColor(color)
|
|
5269
5297
|
}));
|
|
5270
5298
|
});
|
|
5299
|
+
export const PersonEdit = /*#__PURE__*/memo(({
|
|
5300
|
+
width,
|
|
5301
|
+
height,
|
|
5302
|
+
color = 'system/rest',
|
|
5303
|
+
viewBox = false
|
|
5304
|
+
}) => {
|
|
5305
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
5306
|
+
width: width || 24,
|
|
5307
|
+
height: height || 24,
|
|
5308
|
+
viewBox: "0 0 24 24",
|
|
5309
|
+
fill: "none"
|
|
5310
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5311
|
+
fillRule: "evenodd",
|
|
5312
|
+
clipRule: "evenodd",
|
|
5313
|
+
d: "M14 21V17.925L19.525 12.425C19.675 12.275 19.8417 12.1667 20.025 12.1C20.2083 12.0333 20.3917 12 20.575 12C20.775 12 20.9667 12.0375 21.15 12.1125C21.3333 12.1875 21.5 12.3 21.65 12.45L22.575 13.375C22.7083 13.525 22.8125 13.6917 22.8875 13.875C22.9625 14.0583 23 14.2417 23 14.425C23 14.6083 22.9667 14.7958 22.9 14.9875C22.8333 15.1792 22.725 15.35 22.575 15.5L17.075 21H14ZM4 20V17.2C4 16.6333 4.14583 16.1125 4.4375 15.6375C4.72917 15.1625 5.11667 14.8 5.6 14.55C6.63333 14.0333 7.68333 13.6458 8.75 13.3875C9.81667 13.1292 10.9 13 12 13C12.6167 13 13.225 13.0375 13.825 13.1125C14.425 13.1875 15.025 13.3083 15.625 13.475L12 17.1V20H4ZM20.575 15.4L21.5 14.425L20.575 13.5L19.625 14.45L20.575 15.4ZM9.175 10.825C8.39167 10.0417 8 9.1 8 8C8 6.9 8.39167 5.95833 9.175 5.175C9.95833 4.39167 10.9 4 12 4C13.1 4 14.0417 4.39167 14.825 5.175C15.6083 5.95833 16 6.9 16 8C16 9.1 15.6083 10.0417 14.825 10.825C14.0417 11.6083 13.1 12 12 12C10.9 12 9.95833 11.6083 9.175 10.825Z",
|
|
5314
|
+
fill: fillColor(color)
|
|
5315
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
5316
|
+
width: width || 19,
|
|
5317
|
+
height: height || 17,
|
|
5318
|
+
viewBox: "0 0 19 17",
|
|
5319
|
+
fill: "none"
|
|
5320
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5321
|
+
fillRule: "evenodd",
|
|
5322
|
+
clipRule: "evenodd",
|
|
5323
|
+
d: "M10 17V13.925L15.525 8.425C15.675 8.275 15.8417 8.16667 16.025 8.1C16.2083 8.03333 16.3917 8 16.575 8C16.775 8 16.9667 8.0375 17.15 8.1125C17.3333 8.1875 17.5 8.3 17.65 8.45L18.575 9.375C18.7083 9.525 18.8125 9.69167 18.8875 9.875C18.9625 10.0583 19 10.2417 19 10.425C19 10.6083 18.9667 10.7958 18.9 10.9875C18.8333 11.1792 18.725 11.35 18.575 11.5L13.075 17H10ZM0 16V13.2C0 12.6333 0.145833 12.1125 0.4375 11.6375C0.729167 11.1625 1.11667 10.8 1.6 10.55C2.63333 10.0333 3.68333 9.64583 4.75 9.3875C5.81667 9.12917 6.9 9 8 9C8.61667 9 9.225 9.0375 9.825 9.1125C10.425 9.1875 11.025 9.30833 11.625 9.475L8 13.1V16H0ZM16.575 11.4L17.5 10.425L16.575 9.5L15.625 10.45L16.575 11.4ZM5.175 6.825C4.39167 6.04167 4 5.1 4 4C4 2.9 4.39167 1.95833 5.175 1.175C5.95833 0.391667 6.9 0 8 0C9.1 0 10.0417 0.391667 10.825 1.175C11.6083 1.95833 12 2.9 12 4C12 5.1 11.6083 6.04167 10.825 6.825C10.0417 7.60833 9.1 8 8 8C6.9 8 5.95833 7.60833 5.175 6.825Z",
|
|
5324
|
+
fill: fillColor(color)
|
|
5325
|
+
}));
|
|
5326
|
+
});
|
|
5271
5327
|
export const PersonGroup = /*#__PURE__*/memo(({
|
|
5272
5328
|
width,
|
|
5273
5329
|
height,
|
|
@@ -6859,6 +6915,36 @@ export const Treeview = /*#__PURE__*/memo(({
|
|
|
6859
6915
|
fill: fillColor(color)
|
|
6860
6916
|
}));
|
|
6861
6917
|
});
|
|
6918
|
+
export const TruckApproval = /*#__PURE__*/memo(({
|
|
6919
|
+
width,
|
|
6920
|
+
height,
|
|
6921
|
+
color = 'system/rest',
|
|
6922
|
+
viewBox = false
|
|
6923
|
+
}) => {
|
|
6924
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
6925
|
+
width: width || 24,
|
|
6926
|
+
height: height || 24,
|
|
6927
|
+
viewBox: "0 0 24 24",
|
|
6928
|
+
fill: "none"
|
|
6929
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
6930
|
+
d: "M9 8.19983L4.42823 13L1 9.39967L2.14274 8.19983L4.42823 10.5995L7.85726 7L9 8.19983Z",
|
|
6931
|
+
fill: fillColor(color)
|
|
6932
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
6933
|
+
d: "M4.875 19.125C4.29167 18.5417 4 17.8333 4 17H1.5L1.95 15H4.775C5.05833 14.6833 5.39167 14.4375 5.775 14.2625C6.15833 14.0875 6.56667 14 7 14C7.43333 14 7.84167 14.0875 8.225 14.2625C8.60833 14.4375 8.94167 14.6833 9.225 15H13.4L15.5 6H6.55L6.975 4H18L17.075 8H20L23 12L22 17H20C20 17.8333 19.7083 18.5417 19.125 19.125C18.5417 19.7083 17.8333 20 17 20C16.1667 20 15.4583 19.7083 14.875 19.125C14.2917 18.5417 14 17.8333 14 17H10C10 17.8333 9.70833 18.5417 9.125 19.125C8.54167 19.7083 7.83333 20 7 20C6.16667 20 5.45833 19.7083 4.875 19.125ZM15.925 13H20.75L20.85 12.475L19 10H16.625L15.925 13ZM15.5 6L13.4 15L13.45 14.825L15.5 6ZM7 18C7.28333 18 7.52083 17.9042 7.7125 17.7125C7.90417 17.5208 8 17.2833 8 17C8 16.7167 7.90417 16.4792 7.7125 16.2875C7.52083 16.0958 7.28333 16 7 16C6.71667 16 6.47917 16.0958 6.2875 16.2875C6.09583 16.4792 6 16.7167 6 17C6 17.2833 6.09583 17.5208 6.2875 17.7125C6.47917 17.9042 6.71667 18 7 18ZM17 18C17.2833 18 17.5208 17.9042 17.7125 17.7125C17.9042 17.5208 18 17.2833 18 17C18 16.7167 17.9042 16.4792 17.7125 16.2875C17.5208 16.0958 17.2833 16 17 16C16.7167 16 16.4792 16.0958 16.2875 16.2875C16.0958 16.4792 16 16.7167 16 17C16 17.2833 16.0958 17.5208 16.2875 17.7125C16.4792 17.9042 16.7167 18 17 18Z",
|
|
6934
|
+
fill: fillColor(color)
|
|
6935
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
6936
|
+
width: width || 22,
|
|
6937
|
+
height: height || 16,
|
|
6938
|
+
viewBox: "0 0 22 16",
|
|
6939
|
+
fill: "none"
|
|
6940
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
6941
|
+
d: "M8 4.19983L3.42823 9L0 5.39967L1.14274 4.19983L3.42823 6.5995L6.85726 3L8 4.19983Z",
|
|
6942
|
+
fill: fillColor(color)
|
|
6943
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
6944
|
+
d: "M3.875 15.125C3.29167 14.5417 3 13.8333 3 13H0.5L0.95 11H3.775C4.05833 10.6833 4.39167 10.4375 4.775 10.2625C5.15833 10.0875 5.56667 10 6 10C6.43333 10 6.84167 10.0875 7.225 10.2625C7.60833 10.4375 7.94167 10.6833 8.225 11H12.4L14.5 2H5.55L5.975 0H17L16.075 4H19L22 8L21 13H19C19 13.8333 18.7083 14.5417 18.125 15.125C17.5417 15.7083 16.8333 16 16 16C15.1667 16 14.4583 15.7083 13.875 15.125C13.2917 14.5417 13 13.8333 13 13H9C9 13.8333 8.70833 14.5417 8.125 15.125C7.54167 15.7083 6.83333 16 6 16C5.16667 16 4.45833 15.7083 3.875 15.125ZM14.925 9H19.75L19.85 8.475L18 6H15.625L14.925 9ZM14.5 2L12.4 11L12.45 10.825L14.5 2ZM6 14C6.28333 14 6.52083 13.9042 6.7125 13.7125C6.90417 13.5208 7 13.2833 7 13C7 12.7167 6.90417 12.4792 6.7125 12.2875C6.52083 12.0958 6.28333 12 6 12C5.71667 12 5.47917 12.0958 5.2875 12.2875C5.09583 12.4792 5 12.7167 5 13C5 13.2833 5.09583 13.5208 5.2875 13.7125C5.47917 13.9042 5.71667 14 6 14ZM16 14C16.2833 14 16.5208 13.9042 16.7125 13.7125C16.9042 13.5208 17 13.2833 17 13C17 12.7167 16.9042 12.4792 16.7125 12.2875C16.5208 12.0958 16.2833 12 16 12C15.7167 12 15.4792 12.0958 15.2875 12.2875C15.0958 12.4792 15 12.7167 15 13C15 13.2833 15.0958 13.5208 15.2875 13.7125C15.4792 13.9042 15.7167 14 16 14Z",
|
|
6945
|
+
fill: fillColor(color)
|
|
6946
|
+
}));
|
|
6947
|
+
});
|
|
6862
6948
|
export const TwoSquare = /*#__PURE__*/memo(({
|
|
6863
6949
|
width,
|
|
6864
6950
|
height,
|
package/package.json
CHANGED
|
@@ -1,44 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "diginet-core-ui",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start
|
|
9
|
-
"start": "
|
|
10
|
-
"build": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "diginet-core-ui",
|
|
3
|
+
"version": "1.4.67-beta.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "npm-run-all --parallel start-sb eslint-test",
|
|
9
|
+
"start-sb": "start-storybook -p 9050",
|
|
10
|
+
"build-storybook": "build-storybook -c .storybook -s src",
|
|
11
|
+
"build": "run-script-os",
|
|
12
|
+
"build:windows": "rimraf dist && mkdirp dist/components && npm run compile && sass --style=compressed src/scss:dist/css && xcopy src\\\\assets dist\\\\assets\\ /e /y",
|
|
13
|
+
"build:darwin:linux:default": "rm -rf dist && npm run compile && sass --style=compressed src/scss:dist/css && cp -rf src/assets dist/assets",
|
|
14
|
+
"compile": "babel src --out-dir dist --ignore **/*.stories.js",
|
|
15
|
+
"pack": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm pack",
|
|
16
|
+
"production-keep-version": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish",
|
|
17
|
+
"beta": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish --tag beta",
|
|
18
|
+
"production": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm publish",
|
|
19
|
+
"version:add": "run-script-os",
|
|
20
|
+
"version:add:windows": "cat package.json.tmp | sed \"s/0.0.0/%npm_package_version%/g\" > dist/package.json",
|
|
21
|
+
"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",
|
|
22
|
+
"version:bump": "npm version patch --no-git-tag-version --silent",
|
|
23
|
+
"version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'",
|
|
24
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
|
+
"lint": "eslint --fix --config .eslintrc.js \"**/*.js\"",
|
|
26
|
+
"eslint-test": "onchange \"src/**/*.{js,jsx,json}\" -- eslint . --fix",
|
|
27
|
+
"freshtall": "npm cache clean --force && rm -rf node_modules && rm -f package-lock.json && npm install",
|
|
28
|
+
"test-storybook": "test-storybook --url http://localhost:9050",
|
|
29
|
+
"preinstall": "echo {} > package-lock.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@emotion/core": "^10.0.35",
|
|
33
|
+
"@emotion/css": "^11.11.0",
|
|
34
|
+
"@emotion/react": "^11.10.6",
|
|
35
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
36
|
+
"date-fns": "^2.30.0",
|
|
37
|
+
"prop-types": "^15.7.2"
|
|
38
|
+
},
|
|
39
|
+
"lint-staged": {
|
|
40
|
+
"*/**/*.{js,jsx,json}": [
|
|
41
|
+
"prettier --write",
|
|
42
|
+
"git add"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/cli": "^7.14.3",
|
|
47
|
+
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
48
|
+
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.0",
|
|
49
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
50
|
+
"@babel/plugin-proposal-optional-chaining": "^7.14.2",
|
|
51
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
52
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
53
|
+
"@babel/preset-react": "^7.13.13",
|
|
54
|
+
"@storybook/addon-actions": "6.2.9",
|
|
55
|
+
"@storybook/addon-essentials": "6.2.9",
|
|
56
|
+
"@storybook/addon-links": "6.2.9",
|
|
57
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
58
|
+
"@storybook/react": "6.2.9",
|
|
59
|
+
"@storybook/test-runner": "^0.7.1",
|
|
60
|
+
"autoprefixer": "^10.3.1",
|
|
61
|
+
"babel-loader": "^8.2.2",
|
|
62
|
+
"eslint": "^8.4.1",
|
|
63
|
+
"eslint-plugin-react": "^7.27.1",
|
|
64
|
+
"eslint-plugin-regex": "^1.10.0",
|
|
65
|
+
"husky": "^7.0.4",
|
|
66
|
+
"jest": "^27.5.1",
|
|
67
|
+
"lint-staged": "^12.1.2",
|
|
68
|
+
"mkdirp": "^1.0.4",
|
|
69
|
+
"npm-run-all": "^4.1.5",
|
|
70
|
+
"onchange": "^7.1.0",
|
|
71
|
+
"postcss-flexbugs-fixes": "^5.0.2",
|
|
72
|
+
"react": "^17.0.1",
|
|
73
|
+
"react-dom": "^17.0.1",
|
|
74
|
+
"rimraf": "^3.0.2",
|
|
75
|
+
"run-script-os": "^1.1.6",
|
|
76
|
+
"sass": "1.58.3"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/readme.md
CHANGED
|
@@ -41,6 +41,15 @@ npm test
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
|
+
## 1.4.67
|
|
45
|
+
- \[Added\]: ButtonIcon – Add the title prop to ButtonIcon to display the text as a tooltip on hover.
|
|
46
|
+
- \[Added\]: Icon – Add IconMenu MHRP75N0025
|
|
47
|
+
- \[Added\]: Icon – Add Icon LockReset
|
|
48
|
+
- \[Fixed\]: NumberInput - Fix the NumberInput issue where entering 0 does not trigger the delayOnChange prop.
|
|
49
|
+
- \[Fixed\]: DateRangePicker - Fix the issue where the calendar icon is missing and the clear icon is not displayed.
|
|
50
|
+
- \[Fixed\]: Dropdown - Fix the issue where the selected value is not displayed correctly in the Dropdown.
|
|
51
|
+
- \[Added\]: Icon – Add Icon TruckApproval
|
|
52
|
+
- \[Added\]: MoneyInput – Add support for converting decimal numbers to words in Vietnamese, English, and Chinese.
|
|
44
53
|
|
|
45
54
|
## 1.4.66
|
|
46
55
|
- \[Added\]: Icon – Add Icon Import
|