diginet-core-ui 1.4.48-beta.4 → 1.4.48-beta.6
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/MHRP25N0007.svg +18 -0
- package/assets/images/menu/dhr/MHRP25N0008.svg +17 -0
- package/components/accordion/details.js +1 -1
- package/components/accordion/group.js +1 -1
- package/components/accordion/index.js +1 -1
- package/components/accordion/summary.js +1 -1
- package/components/alert/index.js +1 -1
- package/components/alert/notify.js +1 -1
- package/components/avatar/index.js +2 -2
- package/components/badge/index.js +1 -1
- package/components/breadcrumb/index.js +1 -1
- package/components/button/icon.js +1 -1
- package/components/button/index.js +1 -1
- package/components/button/more.js +2 -2
- package/components/button/ripple-effect.js +1 -1
- package/components/card/body.js +1 -1
- package/components/card/extra.js +1 -1
- package/components/card/footer.js +1 -1
- package/components/card/header.js +1 -1
- package/components/card/index.js +1 -1
- package/components/chart/Pie/Circle.js +1 -1
- package/components/chart/Pie/Sector.js +1 -1
- package/components/chart/Pie/index.js +1 -1
- package/components/chart/Pie-v2/Circle.js +1 -1
- package/components/chart/Pie-v2/Sector.js +1 -1
- package/components/chart/Pie-v2/index.js +1 -1
- package/components/chart/bar/Bar.js +1 -1
- package/components/chart/bar/index.js +1 -1
- package/components/chart/bar-v2/Bar.js +1 -1
- package/components/chart/bar-v2/index.js +1 -1
- package/components/chart/line/index.js +1 -1
- package/components/chart/line-v2/index.js +1 -1
- package/components/check-text/index.js +1 -1
- package/components/check-text/interview-confirmation.js +1 -1
- package/components/check-text/interview-status.js +1 -1
- package/components/chip/index.js +1 -1
- package/components/collapse/index.js +1 -1
- package/components/divider/index.js +1 -1
- package/components/form-control/attachment/index.js +1 -1
- package/components/form-control/calendar/index.js +1 -1
- package/components/form-control/calendar/range.js +1 -1
- package/components/form-control/checkbox/index.js +1 -1
- package/components/form-control/control/index.js +1 -1
- package/components/form-control/date-input/index.js +1 -1
- package/components/form-control/date-picker/index.js +1 -1
- package/components/form-control/date-range-picker/index.js +1 -1
- package/components/form-control/dropdown/index.js +85 -46
- package/components/form-control/dropdown-box/index.js +1 -1
- package/components/form-control/form-group/index.js +1 -1
- package/components/form-control/helper-text/index.js +1 -1
- package/components/form-control/input-base/UncontrolledInputBase.js +1 -1
- package/components/form-control/input-base/index.js +1 -1
- package/components/form-control/label/index.js +1 -1
- package/components/form-control/money-input/index.js +1 -1
- package/components/form-control/password-input/index.js +1 -1
- package/components/form-control/phone-input/index.js +1 -1
- package/components/form-control/radio/index.js +1 -1
- package/components/form-control/text-input/index.js +1 -1
- package/components/form-control/time-picker/index.js +1 -1
- package/components/form-control/time-picker/v2/index.js +1 -1
- package/components/form-control/toggle/index.js +1 -1
- package/components/form-view/input.js +1 -1
- package/components/grid/index.js +1 -1
- package/components/image/index.js +1 -1
- package/components/list/list-item-action.js +1 -1
- package/components/list/list-item-icon.js +1 -1
- package/components/list/list-item-text.js +1 -1
- package/components/list/list-item.js +1 -1
- package/components/list/list.js +1 -1
- package/components/list/sub-header.js +1 -1
- package/components/modal/body.js +1 -1
- package/components/modal/footer.js +1 -1
- package/components/modal/header.js +1 -1
- package/components/modal/index.js +1 -1
- package/components/modal/modal.js +1 -1
- package/components/others/option-wrapper/index.js +1 -1
- package/components/paging/page-info.js +1 -1
- package/components/paging/page-selector.js +1 -1
- package/components/paper/index.js +1 -1
- package/components/popover/body.js +1 -1
- package/components/popover/footer.js +1 -1
- package/components/popover/header.js +1 -1
- package/components/popover/index.js +1 -1
- package/components/popup/index.js +1 -1
- package/components/popup/v2/index.js +1 -1
- package/components/progress/circular.js +1 -1
- package/components/progress/linear.js +1 -1
- package/components/rating/index.js +1 -1
- package/components/skeleton/index.js +1 -1
- package/components/slider/slider-container.js +1 -1
- package/components/slider/slider-item.js +1 -1
- package/components/status/index.js +1 -1
- package/components/tab/tab-container.js +1 -1
- package/components/tab/tab-header.js +1 -1
- package/components/tab/tab-panel.js +1 -1
- package/components/tab/tab.js +1 -1
- package/components/tooltip/index.js +1 -1
- package/components/transfer/index.js +1 -1
- package/components/tree-view/index.js +1 -1
- package/components/typography/index.js +1 -1
- package/icons/basic.js +28 -0
- package/icons/effect.js +1 -1
- package/icons/menu/v2/index.js +1 -1
- package/package.json +1 -1
- package/readme.md +16 -0
|
@@ -47,7 +47,7 @@ const uniqBy = (arr, iteratee) => {
|
|
|
47
47
|
return true;
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
const Dropdown = /*#__PURE__*/memo(
|
|
50
|
+
const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
51
51
|
if (!reference) reference = useRef(null);
|
|
52
52
|
const theme = useTheme();
|
|
53
53
|
const {
|
|
@@ -61,6 +61,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
61
61
|
});
|
|
62
62
|
const {
|
|
63
63
|
action = {},
|
|
64
|
+
allowInput,
|
|
64
65
|
allowSearch,
|
|
65
66
|
children,
|
|
66
67
|
className,
|
|
@@ -75,6 +76,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
75
76
|
inputProps,
|
|
76
77
|
inputStyle,
|
|
77
78
|
itemMode,
|
|
79
|
+
isInGrid,
|
|
78
80
|
label,
|
|
79
81
|
labelProps,
|
|
80
82
|
limit,
|
|
@@ -256,6 +258,19 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
256
258
|
} else if (e.key === 'ArrowDown' && dropdownListRef.current) {
|
|
257
259
|
e.preventDefault();
|
|
258
260
|
dropdownListRef.current.firstChild.focus();
|
|
261
|
+
} else if (!!allowInput && txtSearch && multiple && e.key === 'Enter') {
|
|
262
|
+
if (!Array.isArray(currentValue[unique])) currentValue[unique] = [];
|
|
263
|
+
const newValueArrState = [...valueMulti];
|
|
264
|
+
if (!newValueArrState.some(v => JSON.stringify(v) === JSON.stringify(txtSearch))) {
|
|
265
|
+
newValueArrState.push(txtSearch);
|
|
266
|
+
}
|
|
267
|
+
setValueMulti(newValueArrState);
|
|
268
|
+
!!onChange && onChange({
|
|
269
|
+
value: newValueArrState,
|
|
270
|
+
data: {
|
|
271
|
+
[valueExpr]: txtSearch
|
|
272
|
+
}
|
|
273
|
+
});
|
|
259
274
|
}
|
|
260
275
|
};
|
|
261
276
|
const closeDropdown = (event, reason, value) => {
|
|
@@ -271,10 +286,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
271
286
|
});
|
|
272
287
|
};
|
|
273
288
|
|
|
274
|
-
/**
|
|
275
|
-
* So sánh text đầu vào cáo map với txtSearch
|
|
276
|
-
* @param text
|
|
277
|
-
* @return {boolean}
|
|
289
|
+
/**
|
|
290
|
+
* So sánh text đầu vào cáo map với txtSearch
|
|
291
|
+
* @param text
|
|
292
|
+
* @return {boolean}
|
|
278
293
|
*/
|
|
279
294
|
const handleRenderBySearch = (text = '') => {
|
|
280
295
|
if (typeof text !== 'string') text = text.toString();
|
|
@@ -286,10 +301,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
286
301
|
} else return text.toLowerCase().includes(txtSearch.toLowerCase());
|
|
287
302
|
};
|
|
288
303
|
|
|
289
|
-
/**
|
|
290
|
-
* 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
|
|
291
|
-
* @param data {object} rowData of dataSource
|
|
292
|
-
* @return {string}
|
|
304
|
+
/**
|
|
305
|
+
* 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
|
|
306
|
+
* @param data {object} rowData of dataSource
|
|
307
|
+
* @return {string}
|
|
293
308
|
*/
|
|
294
309
|
const displayValue = data => {
|
|
295
310
|
let text = '';
|
|
@@ -1158,6 +1173,27 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
1158
1173
|
});
|
|
1159
1174
|
}
|
|
1160
1175
|
items.push(item);
|
|
1176
|
+
} else if (allowInput && multiple) {
|
|
1177
|
+
const displayText = vl;
|
|
1178
|
+
let item;
|
|
1179
|
+
if (typeof renderSelectedItem === 'function') {
|
|
1180
|
+
item = renderSelectedItem({
|
|
1181
|
+
data,
|
|
1182
|
+
index
|
|
1183
|
+
});
|
|
1184
|
+
} else {
|
|
1185
|
+
item = jsx(Chip, {
|
|
1186
|
+
css: [parseWidth('100%'), parseMaxWidth('max-content')],
|
|
1187
|
+
key: index,
|
|
1188
|
+
startIcon: getIconFromData(data, true),
|
|
1189
|
+
label: displayText,
|
|
1190
|
+
size: 'medium',
|
|
1191
|
+
disabled: disabled,
|
|
1192
|
+
clearAble: !readOnly && !disabled,
|
|
1193
|
+
onRemove: e => onRemove(e, vl)
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
items.push(item);
|
|
1161
1197
|
}
|
|
1162
1198
|
});
|
|
1163
1199
|
}
|
|
@@ -1289,7 +1325,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
1289
1325
|
}, error) : null;
|
|
1290
1326
|
}, [disabled, error, helperTextProps]);
|
|
1291
1327
|
const DropdownView = jsx(Popover, {
|
|
1292
|
-
css: PopoverCSS(theme),
|
|
1328
|
+
css: PopoverCSS(theme, isInGrid),
|
|
1293
1329
|
ref: dropdownRef,
|
|
1294
1330
|
open: openState,
|
|
1295
1331
|
anchor: ref.current,
|
|
@@ -1319,9 +1355,10 @@ const InputCSS = (multiple, renderSelectedItem) => css`
|
|
|
1319
1355
|
`;
|
|
1320
1356
|
const PopoverCSS = ({
|
|
1321
1357
|
spacing
|
|
1322
|
-
}) => css`
|
|
1358
|
+
}, isInGrid) => css`
|
|
1323
1359
|
margin-top: ${spacing([1])};
|
|
1324
1360
|
${overflowHidden};
|
|
1361
|
+
${isInGrid && 'width:fit-content'}
|
|
1325
1362
|
`;
|
|
1326
1363
|
const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly, multilineSelectedItem, {
|
|
1327
1364
|
colors,
|
|
@@ -1656,6 +1693,8 @@ Dropdown.propTypes = {
|
|
|
1656
1693
|
}),
|
|
1657
1694
|
/** If `true`, the input box for searching will be displayed. */
|
|
1658
1695
|
allowSearch: PropTypes.bool,
|
|
1696
|
+
/** If `true`, the input value will be added when user hit Enter. */
|
|
1697
|
+
allowInput: PropTypes.bool,
|
|
1659
1698
|
/** The content to be displayed inside the Dropdown box, such as TreeView. */
|
|
1660
1699
|
children: PropTypes.node,
|
|
1661
1700
|
/** The CSS class for the component. */
|
|
@@ -1670,9 +1709,9 @@ Dropdown.propTypes = {
|
|
|
1670
1709
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1671
1710
|
/** If `true`, the component is disabled. */
|
|
1672
1711
|
disabled: PropTypes.bool,
|
|
1673
|
-
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1674
|
-
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1675
|
-
* Note: Do not use 'id - name', as it will return undefined.
|
|
1712
|
+
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1713
|
+
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1714
|
+
* Note: Do not use 'id - name', as it will return undefined.
|
|
1676
1715
|
*/
|
|
1677
1716
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1678
1717
|
/** Inline style for dropdown items. */
|
|
@@ -1681,14 +1720,14 @@ Dropdown.propTypes = {
|
|
|
1681
1720
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1682
1721
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1683
1722
|
helperTextProps: PropTypes.object,
|
|
1684
|
-
/** The field name used for displaying icons.<br/>
|
|
1685
|
-
* Example:<br/>
|
|
1686
|
-
* string: 'icon'<br/>
|
|
1687
|
-
* object: {<br/>
|
|
1688
|
-
* key: 'icon',<br/>
|
|
1689
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1690
|
-
* suffix: '.jpg'<br/>
|
|
1691
|
-
* }
|
|
1723
|
+
/** The field name used for displaying icons.<br/>
|
|
1724
|
+
* Example:<br/>
|
|
1725
|
+
* string: 'icon'<br/>
|
|
1726
|
+
* object: {<br/>
|
|
1727
|
+
* key: 'icon',<br/>
|
|
1728
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1729
|
+
* suffix: '.jpg'<br/>
|
|
1730
|
+
* }
|
|
1692
1731
|
*/
|
|
1693
1732
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1694
1733
|
key: PropTypes.string,
|
|
@@ -1722,8 +1761,8 @@ Dropdown.propTypes = {
|
|
|
1722
1761
|
onChange: PropTypes.func,
|
|
1723
1762
|
/** Callback function fired when the dropdown is closed. */
|
|
1724
1763
|
onClosed: PropTypes.func,
|
|
1725
|
-
/** Callback function fired when the input value changes.<br/>
|
|
1726
|
-
* If undefined, the filter function will run (default behavior).
|
|
1764
|
+
/** Callback function fired when the input value changes.<br/>
|
|
1765
|
+
* If undefined, the filter function will run (default behavior).
|
|
1727
1766
|
*/
|
|
1728
1767
|
onInput: PropTypes.func,
|
|
1729
1768
|
/** Callback function fired when a key is pressed down in the input. */
|
|
@@ -1736,21 +1775,21 @@ Dropdown.propTypes = {
|
|
|
1736
1775
|
placeholder: PropTypes.string,
|
|
1737
1776
|
/** If `true`, the component is read-only. */
|
|
1738
1777
|
readOnly: PropTypes.bool,
|
|
1739
|
-
/** Function used for custom rendering of items.<br/>
|
|
1740
|
-
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1741
|
-
* This can be used as an alternative to `displayExpr`
|
|
1778
|
+
/** Function used for custom rendering of items.<br/>
|
|
1779
|
+
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1780
|
+
* This can be used as an alternative to `displayExpr`
|
|
1742
1781
|
*/
|
|
1743
1782
|
renderItem: PropTypes.func,
|
|
1744
|
-
/** Function or field name used to display selected items.<br/>
|
|
1745
|
-
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1783
|
+
/** Function or field name used to display selected items.<br/>
|
|
1784
|
+
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1746
1785
|
*/
|
|
1747
1786
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1748
1787
|
/** If `true`, the label will indicate that the input is required. */
|
|
1749
1788
|
required: PropTypes.bool,
|
|
1750
|
-
/**
|
|
1751
|
-
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1752
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1753
|
-
* If `true`, the default delayOnInput will be used.
|
|
1789
|
+
/**
|
|
1790
|
+
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1791
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1792
|
+
* If `true`, the default delayOnInput will be used.
|
|
1754
1793
|
*/
|
|
1755
1794
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1756
1795
|
/** Specifies the field name or expression used to compare values with the search string. */
|
|
@@ -1777,19 +1816,19 @@ Dropdown.propTypes = {
|
|
|
1777
1816
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1778
1817
|
/** The variant to use. */
|
|
1779
1818
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
|
|
1780
|
-
/**
|
|
1781
|
-
* ref methods
|
|
1782
|
-
*
|
|
1783
|
-
* how to get component element? ref.current
|
|
1784
|
-
*
|
|
1785
|
-
* how to call method? ref.current.instance.{method}
|
|
1786
|
-
*
|
|
1787
|
-
* * showDropdown(): Show dropdown
|
|
1788
|
-
* * closeDropdown(): Close dropdown
|
|
1789
|
-
* * onClear(): Clear selected value
|
|
1790
|
-
* * setPreviousValue(): Set value to previous value
|
|
1791
|
-
* * setValue(value): Set value of dropdown
|
|
1792
|
-
* * @param {value} - string || number || array
|
|
1819
|
+
/**
|
|
1820
|
+
* ref methods
|
|
1821
|
+
*
|
|
1822
|
+
* how to get component element? ref.current
|
|
1823
|
+
*
|
|
1824
|
+
* how to call method? ref.current.instance.{method}
|
|
1825
|
+
*
|
|
1826
|
+
* * showDropdown(): Show dropdown
|
|
1827
|
+
* * closeDropdown(): Close dropdown
|
|
1828
|
+
* * onClear(): Clear selected value
|
|
1829
|
+
* * setPreviousValue(): Set value to previous value
|
|
1830
|
+
* * setValue(value): Set value of dropdown
|
|
1831
|
+
* * @param {value} - string || number || array
|
|
1793
1832
|
*/
|
|
1794
1833
|
};
|
|
1795
1834
|
export default Dropdown;
|
|
@@ -10,7 +10,7 @@ import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
|
10
10
|
import { classNames, getProp } from "../../../utils";
|
|
11
11
|
const regexBetween = /[^{}]+(?=})/g;
|
|
12
12
|
const regexInclude = /{|}/g;
|
|
13
|
-
const DropdownBox = /*#__PURE__*/memo(
|
|
13
|
+
const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
14
14
|
if (!reference) reference = useRef(null);
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
const {
|
|
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/core';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Children, forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';
|
|
6
6
|
import { useTheme } from "../../../theme";
|
|
7
|
-
const FormGroup = /*#__PURE__*/memo(
|
|
7
|
+
const FormGroup = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
8
8
|
fullWidth,
|
|
9
9
|
oneHelperText,
|
|
10
10
|
marginRight,
|
|
@@ -9,7 +9,7 @@ import { useTheme } from "../../../theme";
|
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../../utils";
|
|
11
11
|
const colorMap = new Map([['default', 'semantic/danger'], ['success', 'semantic/success'], ['warning', 'semantic/warning'], ['danger', 'semantic/danger'], ['info', 'semantic/info']]);
|
|
12
|
-
const HelperText = /*#__PURE__*/memo(
|
|
12
|
+
const HelperText = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
const {
|
|
@@ -9,7 +9,7 @@ import { bgColor, border, borderBottom, borderBottomColor, borderColor, borderNo
|
|
|
9
9
|
import { useTheme } from "../../../theme";
|
|
10
10
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, refType as ref, getProp } from "../../../utils";
|
|
12
|
-
const UncontrolledInputBase = /*#__PURE__*/memo(
|
|
12
|
+
const UncontrolledInputBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
const {
|
|
@@ -9,7 +9,7 @@ import { bgColor, bgTransparent, border, borderBottom, borderBottomColor, border
|
|
|
9
9
|
import { useTheme } from "../../../theme";
|
|
10
10
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, refType as ref, useInput, getProp } from "../../../utils";
|
|
12
|
-
const InputBase = /*#__PURE__*/memo(
|
|
12
|
+
const InputBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
const {
|
|
@@ -9,7 +9,7 @@ import { flexRow, parseMinHeight, typographyTypes } from "../../../styles/genera
|
|
|
9
9
|
import { useTheme } from "../../../theme";
|
|
10
10
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, getProp } from "../../../utils";
|
|
12
|
-
const Label = /*#__PURE__*/memo(
|
|
12
|
+
const Label = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
const {
|
|
@@ -72,7 +72,7 @@ const num2WordsEn = n => {
|
|
|
72
72
|
if (n === '0') return 'zero';
|
|
73
73
|
return comp(chunk(3))(reverse)(arr(n)).map(makeGroup).map(thousand).filter(comp(not)(isEmpty)).reverse().join(' ');
|
|
74
74
|
};
|
|
75
|
-
const MoneyInput = /*#__PURE__*/memo(
|
|
75
|
+
const MoneyInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
76
76
|
if (!reference) reference = useRef(null);
|
|
77
77
|
|
|
78
78
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -8,7 +8,7 @@ import { cursorNotAllowed, displayBlock, positionRelative } from "../../../style
|
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, onValidate, refType as ref } from "../../../utils";
|
|
11
|
-
const PasswordInput = /*#__PURE__*/memo(
|
|
11
|
+
const PasswordInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ import { boxBorder, cursorNoDrop, cursorPointer, displayBlock, displayNone, posi
|
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp, randomString } from "../../../utils";
|
|
11
|
-
const Radio = /*#__PURE__*/memo(
|
|
11
|
+
const Radio = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
const {
|
|
@@ -8,7 +8,7 @@ import { cursorNotAllowed, displayBlock, positionRelative } from "../../../style
|
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, onValidate, refType as ref } from "../../../utils";
|
|
11
|
-
const TextInput = /*#__PURE__*/memo(
|
|
11
|
+
const TextInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
|
|
@@ -9,7 +9,7 @@ import { bgColor, border, borderColor, borderNone, borderRadius4px, displayFlex,
|
|
|
9
9
|
import { useTheme } from "../../../../theme";
|
|
10
10
|
import useThemeProps from "../../../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, date, getProp, hexToRGBA } from "../../../../utils";
|
|
12
|
-
const TimePicker = /*#__PURE__*/memo(
|
|
12
|
+
const TimePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
|
|
15
15
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -8,7 +8,7 @@ import { borderRadius, cursorNoDrop, cursorPointer, displayBlock, flexRow, items
|
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../../utils";
|
|
11
|
-
const Toggle = /*#__PURE__*/memo(
|
|
11
|
+
const Toggle = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
|
|
@@ -6,7 +6,7 @@ import { forwardRef, memo, useEffect, useMemo, useRef } from 'react';
|
|
|
6
6
|
import { border, borderBottom, borderRadius, bottom, boxBorder, displayFlex, inset, insetX, itemsCenter, parseHeight, pointerEventsNone, positionAbsolute, positionRelative, scale } from "../../styles/general";
|
|
7
7
|
import { useTheme } from "../../theme";
|
|
8
8
|
import { formatDate, getProp } from "../../utils";
|
|
9
|
-
const InputView = /*#__PURE__*/memo(
|
|
9
|
+
const InputView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
10
10
|
inputProps,
|
|
11
11
|
inputStyleProps,
|
|
12
12
|
value,
|
package/components/grid/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { breakpointKeys } from "../../theme/createBreakpoints";
|
|
|
10
10
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, handleBreakpoints } from "../../utils";
|
|
12
12
|
import GridContext from "./context";
|
|
13
|
-
const Grid = /*#__PURE__*/memo(
|
|
13
|
+
const Grid = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
14
14
|
if (!reference) reference = useRef(null);
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
const {
|
|
@@ -15,7 +15,7 @@ const blurKeyframe = keyframes`
|
|
|
15
15
|
75% { -webkit-filter: blur(1px);}
|
|
16
16
|
100% { -webkit-filter: blur(0px);}
|
|
17
17
|
`;
|
|
18
|
-
const Image = /*#__PURE__*/memo(
|
|
18
|
+
const Image = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
19
19
|
if (!reference) reference = useRef(null);
|
|
20
20
|
|
|
21
21
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -7,7 +7,7 @@ import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
|
7
7
|
import { bgColor, boxBorder, displayFlex, itemsCenter, order, parseMaxHeight, positionRelative, textColor, z } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import { classNames, getProp } from "../../utils";
|
|
10
|
-
const ListItemAction = /*#__PURE__*/memo(
|
|
10
|
+
const ListItemAction = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
11
11
|
children,
|
|
12
12
|
name,
|
|
13
13
|
className,
|
|
@@ -7,7 +7,7 @@ import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
|
7
7
|
import { bgColor, boxBorder, displayFlex, itemsCenter, order, parseMinWidth, positionRelative, textColor, z } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import { classNames, getProp } from "../../utils";
|
|
10
|
-
const ListItemIcon = /*#__PURE__*/memo(
|
|
10
|
+
const ListItemIcon = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
11
11
|
className,
|
|
12
12
|
children,
|
|
13
13
|
name,
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
7
|
import { bgColor, boxBorder, displayFlex, itemsCenter, order, positionRelative } from "../../styles/general";
|
|
8
8
|
import { classNames } from "../../utils";
|
|
9
|
-
const ListItemText = /*#__PURE__*/memo(
|
|
9
|
+
const ListItemText = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
10
10
|
className,
|
|
11
11
|
children,
|
|
12
12
|
style,
|
|
@@ -7,7 +7,7 @@ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } fro
|
|
|
7
7
|
import { bgColor, boxBorder, cursorPointer, displayFlex, flexRow, itemsCenter, overflowHidden, parseMaxWidth, parseMinHeight, parseWidthHeight, positionRelative, textColor, userSelectNone } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import { classNames, getProp } from "../../utils";
|
|
10
|
-
const ListItem = /*#__PURE__*/memo(
|
|
10
|
+
const ListItem = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
11
11
|
children,
|
|
12
12
|
className,
|
|
13
13
|
style,
|
package/components/list/list.js
CHANGED
|
@@ -7,7 +7,7 @@ import { bgColor, borderRadius, boxBorder, displayBlock, parseMaxHeight, parseMa
|
|
|
7
7
|
import { useTheme } from "../../theme";
|
|
8
8
|
import { classNames, getProp } from "../../utils";
|
|
9
9
|
const levels = [0, 1, 'second', 'third', 'fourth', 'fifth'];
|
|
10
|
-
const List = /*#__PURE__*/memo(
|
|
10
|
+
const List = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
11
11
|
className,
|
|
12
12
|
width,
|
|
13
13
|
maxWidth,
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
7
|
import { bgColor, boxBorder, displayBlock, parseWidthHeight, positionSticky, textLeft, top, userSelectNone, z } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
|
-
const ListSubHeader = /*#__PURE__*/memo(
|
|
9
|
+
const ListSubHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
10
10
|
children,
|
|
11
11
|
style,
|
|
12
12
|
...props
|
package/components/modal/body.js
CHANGED
|
@@ -9,7 +9,7 @@ import sx from "../../styles/sx";
|
|
|
9
9
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames } from "../../utils";
|
|
11
11
|
import { sxResponsivePadding } from "./header";
|
|
12
|
-
const ModalBody = /*#__PURE__*/memo(
|
|
12
|
+
const ModalBody = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
|
|
15
15
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -9,7 +9,7 @@ import sx from "../../styles/sx";
|
|
|
9
9
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames } from "../../utils";
|
|
11
11
|
import { sxResponsivePadding } from "./header";
|
|
12
|
-
const ModalFooter = /*#__PURE__*/memo(
|
|
12
|
+
const ModalFooter = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
|
|
15
15
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -17,7 +17,7 @@ export const sxResponsivePadding = {
|
|
|
17
17
|
md: [4, 6]
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const ModalHeader = /*#__PURE__*/memo(
|
|
20
|
+
const ModalHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
21
21
|
if (!reference) reference = useRef(null);
|
|
22
22
|
const theme = useTheme();
|
|
23
23
|
const {
|
|
@@ -5,7 +5,7 @@ import Body from "./body";
|
|
|
5
5
|
import Footer from "./footer";
|
|
6
6
|
import Header from "./header";
|
|
7
7
|
import Modal from "./modal";
|
|
8
|
-
const ModalSample = /*#__PURE__*/memo(
|
|
8
|
+
const ModalSample = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
bodyStyle,
|
|
11
11
|
children,
|
|
@@ -13,7 +13,7 @@ import { classNames, getProp, hexToRGBA, useDelayUnmount } from "../../utils";
|
|
|
13
13
|
import ModalContext from "./context";
|
|
14
14
|
const fadeInDown = animations.fadeInDown;
|
|
15
15
|
const fadeOutUp = animations.fadeOutUp;
|
|
16
|
-
const Modal = /*#__PURE__*/memo(
|
|
16
|
+
const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
17
17
|
if (!reference) reference = useRef(null);
|
|
18
18
|
const theme = useTheme();
|
|
19
19
|
const {
|
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/core';
|
|
|
4
4
|
import { forwardRef, memo, useEffect, useState } from 'react';
|
|
5
5
|
import sx from "../../../styles/sx";
|
|
6
6
|
const OptionWrapper = Component => {
|
|
7
|
-
const WrappedComponent = /*#__PURE__*/memo(
|
|
7
|
+
const WrappedComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const [options, setOptions] = useState({});
|
|
9
9
|
const option = (option, optionValue) => {
|
|
10
10
|
if (typeof option === 'undefined') {
|
|
@@ -17,7 +17,7 @@ const getLastPage = (totalItems, itemsPerPage) => {
|
|
|
17
17
|
}
|
|
18
18
|
return _lastPage + 1;
|
|
19
19
|
};
|
|
20
|
-
const PagingInfo = /*#__PURE__*/memo(
|
|
20
|
+
const PagingInfo = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
21
21
|
action = {},
|
|
22
22
|
bgColor: bgColorProp,
|
|
23
23
|
className,
|
|
@@ -17,7 +17,7 @@ const getLastPage = (totalItems, itemsPerPage) => {
|
|
|
17
17
|
}
|
|
18
18
|
return _lastPage + 1;
|
|
19
19
|
};
|
|
20
|
-
const PagingSelector = /*#__PURE__*/memo(
|
|
20
|
+
const PagingSelector = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
21
21
|
action = {},
|
|
22
22
|
className,
|
|
23
23
|
currentPage,
|
|
@@ -5,7 +5,7 @@ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } fro
|
|
|
5
5
|
import { bgColor, border, borderRadius, parseMaxHeight, parseWidth, parseWidthHeight, shadowSmall } from "../../styles/general";
|
|
6
6
|
import { useTheme } from "../../theme";
|
|
7
7
|
import { classNames, getProp, renderHTML } from "../../utils";
|
|
8
|
-
const Paper = /*#__PURE__*/memo(
|
|
8
|
+
const Paper = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
9
9
|
width,
|
|
10
10
|
height,
|
|
11
11
|
mapping,
|
|
@@ -8,7 +8,7 @@ import { bgColor, border, borderRadius, displayFlex, flexCol, order, overflowAut
|
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../utils";
|
|
11
|
-
const PopoverBody = /*#__PURE__*/memo(
|
|
11
|
+
const PopoverBody = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ import { bgColor, borderRadius, boxBorder, displayFlex, flexRow, itemsCenter, ju
|
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../utils";
|
|
11
|
-
const PopoverFooter = /*#__PURE__*/memo(
|
|
11
|
+
const PopoverFooter = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
12
|
if (!reference) reference = useRef(null);
|
|
13
13
|
const theme = useTheme();
|
|
14
14
|
|
|
@@ -9,7 +9,7 @@ import { bgColor, borderRadius, boxBorder, displayFlex, flexRow, itemsCenter, or
|
|
|
9
9
|
import { useTheme } from "../../theme";
|
|
10
10
|
import useThemeProps from "../../theme/utils/useThemeProps";
|
|
11
11
|
import { classNames, getProp } from "../../utils";
|
|
12
|
-
const PopoverHeader = /*#__PURE__*/memo(
|
|
12
|
+
const PopoverHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
13
13
|
if (!reference) reference = useRef(null);
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
|
|
@@ -106,7 +106,7 @@ const getDirectionPopover = direction => {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
-
const Popover = /*#__PURE__*/memo(
|
|
109
|
+
const Popover = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
110
110
|
if (!reference) reference = useRef(null);
|
|
111
111
|
const theme = useTheme();
|
|
112
112
|
const {
|
|
@@ -16,7 +16,7 @@ const titleMap = new Map([['yesno', 'notify'], ['success', 'confirm'], ['warning
|
|
|
16
16
|
const iconMap = new Map([['yesno', 'Info'], ['success', 'ApprovalFilled'], ['warning', 'Warning'], ['danger', 'Failed'], ['info', 'Info']]);
|
|
17
17
|
const fadeInDown = animations.fadeInDown;
|
|
18
18
|
const fadeOutUp = animations.fadeOutUp;
|
|
19
|
-
const Popup = /*#__PURE__*/memo(
|
|
19
|
+
const Popup = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
20
20
|
action = {},
|
|
21
21
|
cancelProps,
|
|
22
22
|
className,
|