diginet-core-ui 1.4.66-beta.2 → 1.4.66-beta.4
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 +32 -27
- package/components/form-control/attachment/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/input-base/index.js +1 -1
- package/icons/basic.js +31 -1
- package/package.json +1 -1
|
@@ -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`
|
|
@@ -314,14 +319,14 @@ ButtonIcon.propTypes = {
|
|
|
314
319
|
onClick: PropTypes.func,
|
|
315
320
|
/** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
|
|
316
321
|
name: PropTypes.string,
|
|
317
|
-
/**
|
|
318
|
-
* The size of the component.
|
|
319
|
-
*
|
|
320
|
-
* * tiny (button 24px, icon 16px)
|
|
321
|
-
* * small (button 32px, icon 20px)
|
|
322
|
-
* * medium (button 40px, icon 24px)
|
|
323
|
-
* * large (button 48px, icon 32px)
|
|
324
|
-
* * giant (button 56px, icon 40px)
|
|
322
|
+
/**
|
|
323
|
+
* The size of the component.
|
|
324
|
+
*
|
|
325
|
+
* * tiny (button 24px, icon 16px)
|
|
326
|
+
* * small (button 32px, icon 20px)
|
|
327
|
+
* * medium (button 40px, icon 24px)
|
|
328
|
+
* * large (button 48px, icon 32px)
|
|
329
|
+
* * giant (button 56px, icon 40px)
|
|
325
330
|
* */
|
|
326
331
|
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant', 'extraGiant']),
|
|
327
332
|
/** Style inline of component. */
|
|
@@ -332,19 +337,19 @@ ButtonIcon.propTypes = {
|
|
|
332
337
|
viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'ghost']),
|
|
333
338
|
/** Width of the component. */
|
|
334
339
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
335
|
-
/**
|
|
336
|
-
* ref methods (ref.current.instance.*method*)
|
|
337
|
-
*
|
|
338
|
-
* * option(): Gets all UI component properties
|
|
339
|
-
* * Returns value - object
|
|
340
|
-
* * option(optionName): Gets the value of a single property
|
|
341
|
-
* * @param {optionName} - string
|
|
342
|
-
* * Returns value - any
|
|
343
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
344
|
-
* * @param {optionName} - string
|
|
345
|
-
* * @param {optionValue} - any
|
|
346
|
-
* * option(options): Updates the values of several properties
|
|
347
|
-
* * @param {options} - object
|
|
340
|
+
/**
|
|
341
|
+
* ref methods (ref.current.instance.*method*)
|
|
342
|
+
*
|
|
343
|
+
* * option(): Gets all UI component properties
|
|
344
|
+
* * Returns value - object
|
|
345
|
+
* * option(optionName): Gets the value of a single property
|
|
346
|
+
* * @param {optionName} - string
|
|
347
|
+
* * Returns value - any
|
|
348
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
349
|
+
* * @param {optionName} - string
|
|
350
|
+
* * @param {optionValue} - any
|
|
351
|
+
* * option(options): Updates the values of several properties
|
|
352
|
+
* * @param {options} - object
|
|
348
353
|
*/
|
|
349
354
|
};
|
|
350
355
|
export { ButtonIcon };
|
|
@@ -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
|
}
|
|
@@ -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
|
|
@@ -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);
|
package/icons/basic.js
CHANGED
|
@@ -3814,7 +3814,7 @@ export const LockReset = /*#__PURE__*/memo(({
|
|
|
3814
3814
|
}, /*#__PURE__*/React.createElement("path", {
|
|
3815
3815
|
fillRule: "evenodd",
|
|
3816
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.
|
|
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
3818
|
fill: fillColor(color)
|
|
3819
3819
|
})) : /*#__PURE__*/React.createElement("svg", {
|
|
3820
3820
|
width: width || 20,
|
|
@@ -6887,6 +6887,36 @@ export const Treeview = /*#__PURE__*/memo(({
|
|
|
6887
6887
|
fill: fillColor(color)
|
|
6888
6888
|
}));
|
|
6889
6889
|
});
|
|
6890
|
+
export const TruckApproval = /*#__PURE__*/memo(({
|
|
6891
|
+
width,
|
|
6892
|
+
height,
|
|
6893
|
+
color = 'system/rest',
|
|
6894
|
+
viewBox = false
|
|
6895
|
+
}) => {
|
|
6896
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
6897
|
+
width: width || 24,
|
|
6898
|
+
height: height || 24,
|
|
6899
|
+
viewBox: "0 0 24 24",
|
|
6900
|
+
fill: "none"
|
|
6901
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
6902
|
+
d: "M9 8.19983L4.42823 13L1 9.39967L2.14274 8.19983L4.42823 10.5995L7.85726 7L9 8.19983Z",
|
|
6903
|
+
fill: fillColor(color)
|
|
6904
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
6905
|
+
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",
|
|
6906
|
+
fill: fillColor(color)
|
|
6907
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
6908
|
+
width: width || 22,
|
|
6909
|
+
height: height || 16,
|
|
6910
|
+
viewBox: "0 0 22 16",
|
|
6911
|
+
fill: "none"
|
|
6912
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
6913
|
+
d: "M8 4.19983L3.42823 9L0 5.39967L1.14274 4.19983L3.42823 6.5995L6.85726 3L8 4.19983Z",
|
|
6914
|
+
fill: fillColor(color)
|
|
6915
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
6916
|
+
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",
|
|
6917
|
+
fill: fillColor(color)
|
|
6918
|
+
}));
|
|
6919
|
+
});
|
|
6890
6920
|
export const TwoSquare = /*#__PURE__*/memo(({
|
|
6891
6921
|
width,
|
|
6892
6922
|
height,
|