diginet-core-ui 1.4.56-beta.1 → 1.4.56-beta.3
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/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 +22 -22
- 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 +44 -45
- 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/number-input/index2.js +24 -22
- 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 +35 -35
- 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 +14 -14
- 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/effect.js +1 -1
- package/icons/menu/v2/index.js +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ const uniqBy = (arr, iteratee) => {
|
|
|
48
48
|
return true;
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
const Dropdown = /*#__PURE__*/memo(
|
|
51
|
+
const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
52
52
|
if (!reference) reference = useRef(null);
|
|
53
53
|
const theme = useTheme();
|
|
54
54
|
const {
|
|
@@ -299,10 +299,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
299
299
|
});
|
|
300
300
|
};
|
|
301
301
|
|
|
302
|
-
/**
|
|
303
|
-
* So sánh text đầu vào cáo map với txtSearch
|
|
304
|
-
* @param text
|
|
305
|
-
* @return {boolean}
|
|
302
|
+
/**
|
|
303
|
+
* So sánh text đầu vào cáo map với txtSearch
|
|
304
|
+
* @param text
|
|
305
|
+
* @return {boolean}
|
|
306
306
|
*/
|
|
307
307
|
const handleRenderBySearch = (text = '') => {
|
|
308
308
|
if (text === null || text === undefined) text = '';
|
|
@@ -315,10 +315,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
315
315
|
} else return text.toLowerCase().includes(txtSearch.toLowerCase());
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
-
/**
|
|
319
|
-
* 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
|
|
320
|
-
* @param data {object} rowData of dataSource
|
|
321
|
-
* @return {string}
|
|
318
|
+
/**
|
|
319
|
+
* 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
|
|
320
|
+
* @param data {object} rowData of dataSource
|
|
321
|
+
* @return {string}
|
|
322
322
|
*/
|
|
323
323
|
const displayValue = data => {
|
|
324
324
|
let text = '';
|
|
@@ -425,7 +425,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, reference)
|
|
|
425
425
|
data,
|
|
426
426
|
index
|
|
427
427
|
}) : jsx(Typography, {
|
|
428
|
-
lineClamp: 1,
|
|
429
428
|
type: 'p1'
|
|
430
429
|
}, displayText);
|
|
431
430
|
if (multiple && selectBox) {
|
|
@@ -1802,9 +1801,9 @@ Dropdown.propTypes = {
|
|
|
1802
1801
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1803
1802
|
/** If `true`, the component is disabled. */
|
|
1804
1803
|
disabled: PropTypes.bool,
|
|
1805
|
-
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1806
|
-
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1807
|
-
* Note: Do not use 'id - name', as it will return undefined.
|
|
1804
|
+
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1805
|
+
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1806
|
+
* Note: Do not use 'id - name', as it will return undefined.
|
|
1808
1807
|
*/
|
|
1809
1808
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1810
1809
|
/** Inline style for dropdown items. */
|
|
@@ -1813,14 +1812,14 @@ Dropdown.propTypes = {
|
|
|
1813
1812
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1814
1813
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1815
1814
|
helperTextProps: PropTypes.object,
|
|
1816
|
-
/** The field name used for displaying icons.<br/>
|
|
1817
|
-
* Example:<br/>
|
|
1818
|
-
* string: 'icon'<br/>
|
|
1819
|
-
* object: {<br/>
|
|
1820
|
-
* key: 'icon',<br/>
|
|
1821
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1822
|
-
* suffix: '.jpg'<br/>
|
|
1823
|
-
* }
|
|
1815
|
+
/** The field name used for displaying icons.<br/>
|
|
1816
|
+
* Example:<br/>
|
|
1817
|
+
* string: 'icon'<br/>
|
|
1818
|
+
* object: {<br/>
|
|
1819
|
+
* key: 'icon',<br/>
|
|
1820
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1821
|
+
* suffix: '.jpg'<br/>
|
|
1822
|
+
* }
|
|
1824
1823
|
*/
|
|
1825
1824
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1826
1825
|
key: PropTypes.string,
|
|
@@ -1854,8 +1853,8 @@ Dropdown.propTypes = {
|
|
|
1854
1853
|
onChange: PropTypes.func,
|
|
1855
1854
|
/** Callback function fired when the dropdown is closed. */
|
|
1856
1855
|
onClosed: PropTypes.func,
|
|
1857
|
-
/** Callback function fired when the input value changes.<br/>
|
|
1858
|
-
* If undefined, the filter function will run (default behavior).
|
|
1856
|
+
/** Callback function fired when the input value changes.<br/>
|
|
1857
|
+
* If undefined, the filter function will run (default behavior).
|
|
1859
1858
|
*/
|
|
1860
1859
|
onInput: PropTypes.func,
|
|
1861
1860
|
/** Callback function fired when a key is pressed down in the input. */
|
|
@@ -1868,21 +1867,21 @@ Dropdown.propTypes = {
|
|
|
1868
1867
|
placeholder: PropTypes.string,
|
|
1869
1868
|
/** If `true`, the component is read-only. */
|
|
1870
1869
|
readOnly: PropTypes.bool,
|
|
1871
|
-
/** Function used for custom rendering of items.<br/>
|
|
1872
|
-
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1873
|
-
* This can be used as an alternative to `displayExpr`
|
|
1870
|
+
/** Function used for custom rendering of items.<br/>
|
|
1871
|
+
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1872
|
+
* This can be used as an alternative to `displayExpr`
|
|
1874
1873
|
*/
|
|
1875
1874
|
renderItem: PropTypes.func,
|
|
1876
|
-
/** Function or field name used to display selected items.<br/>
|
|
1877
|
-
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1875
|
+
/** Function or field name used to display selected items.<br/>
|
|
1876
|
+
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1878
1877
|
*/
|
|
1879
1878
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1880
1879
|
/** If `true`, the label will indicate that the input is required. */
|
|
1881
1880
|
required: PropTypes.bool,
|
|
1882
|
-
/**
|
|
1883
|
-
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1884
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1885
|
-
* If `true`, the default delayOnInput will be used.
|
|
1881
|
+
/**
|
|
1882
|
+
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1883
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1884
|
+
* If `true`, the default delayOnInput will be used.
|
|
1886
1885
|
*/
|
|
1887
1886
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1888
1887
|
/** Specifies the field name or expression used to compare values with the search string. */
|
|
@@ -1913,19 +1912,19 @@ Dropdown.propTypes = {
|
|
|
1913
1912
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1914
1913
|
/** The variant to use. */
|
|
1915
1914
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
|
|
1916
|
-
/**
|
|
1917
|
-
* ref methods
|
|
1918
|
-
*
|
|
1919
|
-
* how to get component element? ref.current
|
|
1920
|
-
*
|
|
1921
|
-
* how to call method? ref.current.instance.{method}
|
|
1922
|
-
*
|
|
1923
|
-
* * showDropdown(): Show dropdown
|
|
1924
|
-
* * closeDropdown(): Close dropdown
|
|
1925
|
-
* * onClear(): Clear selected value
|
|
1926
|
-
* * setPreviousValue(): Set value to previous value
|
|
1927
|
-
* * setValue(value): Set value of dropdown
|
|
1928
|
-
* * @param {value} - string || number || array
|
|
1915
|
+
/**
|
|
1916
|
+
* ref methods
|
|
1917
|
+
*
|
|
1918
|
+
* how to get component element? ref.current
|
|
1919
|
+
*
|
|
1920
|
+
* how to call method? ref.current.instance.{method}
|
|
1921
|
+
*
|
|
1922
|
+
* * showDropdown(): Show dropdown
|
|
1923
|
+
* * closeDropdown(): Close dropdown
|
|
1924
|
+
* * onClear(): Clear selected value
|
|
1925
|
+
* * setPreviousValue(): Set value to previous value
|
|
1926
|
+
* * setValue(value): Set value of dropdown
|
|
1927
|
+
* * @param {value} - string || number || array
|
|
1929
1928
|
*/
|
|
1930
1929
|
};
|
|
1931
1930
|
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 {
|
|
@@ -128,7 +128,7 @@ const converters = {
|
|
|
128
128
|
en: num2WordsEn,
|
|
129
129
|
zh: num2WordsZh
|
|
130
130
|
};
|
|
131
|
-
const MoneyInput = /*#__PURE__*/memo(
|
|
131
|
+
const MoneyInput = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
132
132
|
if (!reference) reference = useRef(null);
|
|
133
133
|
|
|
134
134
|
// props priority: `inProps` > `themeDefaultProps`
|
|
@@ -98,13 +98,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
98
98
|
|
|
99
99
|
// if (valueProps || valueProps === 0) valueProps = clamp(valueProps, min, max);
|
|
100
100
|
|
|
101
|
-
/**
|
|
102
|
-
* Convert number to format money
|
|
103
|
-
* @param vl {number} - value
|
|
104
|
-
* @type {function}
|
|
105
|
-
* @return {string}
|
|
106
|
-
* @example 1200300.123 => 1,200,300.123
|
|
107
|
-
* @example 1200300,123 => 1.200.300,123
|
|
101
|
+
/**
|
|
102
|
+
* Convert number to format money
|
|
103
|
+
* @param vl {number} - value
|
|
104
|
+
* @type {function}
|
|
105
|
+
* @return {string}
|
|
106
|
+
* @example 1200300.123 => 1,200,300.123
|
|
107
|
+
* @example 1200300,123 => 1.200.300,123
|
|
108
108
|
*/
|
|
109
109
|
const parseNumberToMoney = useCallback((vl, isNumber) => {
|
|
110
110
|
var _number, _number2, _number$, _number3;
|
|
@@ -152,13 +152,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
152
152
|
return number;
|
|
153
153
|
}, [decimalSymbol, max, value, decimalDigit, fixedDecimalDigit]);
|
|
154
154
|
|
|
155
|
-
/**
|
|
156
|
-
* Convert money to format number
|
|
157
|
-
* @param vl {string} - value
|
|
158
|
-
* @type {function}
|
|
159
|
-
* @return {number}
|
|
160
|
-
* @example 1,200,300.123 => 1200300.123
|
|
161
|
-
* @example 1.200.300,123 => 1200300.123
|
|
155
|
+
/**
|
|
156
|
+
* Convert money to format number
|
|
157
|
+
* @param vl {string} - value
|
|
158
|
+
* @type {function}
|
|
159
|
+
* @return {number}
|
|
160
|
+
* @example 1,200,300.123 => 1200300.123
|
|
161
|
+
* @example 1.200.300,123 => 1200300.123
|
|
162
162
|
*/
|
|
163
163
|
const convertMoneyToNumber = useCallback((vl, isNumber) => {
|
|
164
164
|
var _number4, _number4$toString, _number4$toString$rep, _number4$toString$rep2, _number4$toString$rep3;
|
|
@@ -169,11 +169,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
169
169
|
return number;
|
|
170
170
|
}, [decimalSymbol]);
|
|
171
171
|
const _onInput = useCallback((e, flag) => {
|
|
172
|
-
var _e$target$value;
|
|
172
|
+
var _e$target$value, _limitValueT$toString, _limitValueT$toString2, _limitValueT$toString3, _limitValueT$toString4, _limitValueT$toString5, _limitValueT$toString6;
|
|
173
173
|
let valueT = (_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : e.value;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if ((
|
|
174
|
+
// xóa các số "0" đứng trước giá trị ví dụ: 0100, 0200 để tránh lỗi Octal literals are not allowed in strict mode
|
|
175
|
+
let limitValueT = valueT.split(/([+\-*/])/).map(a => parseFloat(a) || a).join('');
|
|
176
|
+
if (disabledNegative && eval(((_limitValueT$toString = (_limitValueT$toString2 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString === void 0 ? void 0 : _limitValueT$toString.call(_limitValueT$toString2, decimalSymbol, '.')) || 0) <= 0 || limitValueT.includes('-')) valueT = 0;
|
|
177
|
+
if ((min || min === 0) && eval((_limitValueT$toString3 = (_limitValueT$toString4 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString3 === void 0 ? void 0 : _limitValueT$toString3.call(_limitValueT$toString4, decimalSymbol, '.')) <= min || min === 0 && limitValueT.includes('-')) valueT = min;
|
|
178
|
+
if ((max || max === 0) && eval((_limitValueT$toString5 = (_limitValueT$toString6 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString5 === void 0 ? void 0 : _limitValueT$toString5.call(_limitValueT$toString6, decimalSymbol, '.')) >= max) valueT = max;
|
|
177
179
|
valueT = parseNumberToMoney(valueT);
|
|
178
180
|
const returnValue = convertMoneyToNumber(valueT);
|
|
179
181
|
e.value = globalRef.current.value = !isNaN(parseFloat(returnValue)) ? parseFloat(returnValue) : null;
|
|
@@ -496,10 +498,10 @@ NumberInput.propTypes = {
|
|
|
496
498
|
style: PropTypes.object,
|
|
497
499
|
/** Thousand separator character. */
|
|
498
500
|
thousandSeparator: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['.', ','])]),
|
|
499
|
-
/** Validation value, argument can:<br/>
|
|
500
|
-
* * string: the validation rule. Example required.<br/>
|
|
501
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
502
|
-
* * array: the validation rule list, insist object/string
|
|
501
|
+
/** Validation value, argument can:<br/>
|
|
502
|
+
* * string: the validation rule. Example required.<br/>
|
|
503
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
504
|
+
* * array: the validation rule list, insist object/string
|
|
503
505
|
*/
|
|
504
506
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
505
507
|
/** The value of the input element, required for a controlled component. */
|
|
@@ -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,
|
|
@@ -533,22 +533,22 @@ PagingInfo.propTypes = {
|
|
|
533
533
|
onChangePage: PropTypes.func,
|
|
534
534
|
/** Callback fired when quantity on per page changed. */
|
|
535
535
|
onChangePerPage: PropTypes.func,
|
|
536
|
-
/**
|
|
537
|
-
* Callback fired when page number is changing.
|
|
538
|
-
*
|
|
539
|
-
* * prevPage: Page before changed
|
|
540
|
-
* * newPage: Page after changed
|
|
541
|
-
* * cancel(value): Function cancel change page
|
|
542
|
-
* * @param {value} - bool
|
|
536
|
+
/**
|
|
537
|
+
* Callback fired when page number is changing.
|
|
538
|
+
*
|
|
539
|
+
* * prevPage: Page before changed
|
|
540
|
+
* * newPage: Page after changed
|
|
541
|
+
* * cancel(value): Function cancel change page
|
|
542
|
+
* * @param {value} - bool
|
|
543
543
|
*/
|
|
544
544
|
onChangingPage: PropTypes.func,
|
|
545
|
-
/**
|
|
546
|
-
* Callback fired when quantity on item per page is changing.
|
|
547
|
-
*
|
|
548
|
-
* * prevPerPage: Items per page before changed
|
|
549
|
-
* * newPerPage: Items per page after changed
|
|
550
|
-
* * cancel(value): Function cancel change items per page
|
|
551
|
-
* * @param {value} - bool
|
|
545
|
+
/**
|
|
546
|
+
* Callback fired when quantity on item per page is changing.
|
|
547
|
+
*
|
|
548
|
+
* * prevPerPage: Items per page before changed
|
|
549
|
+
* * newPerPage: Items per page after changed
|
|
550
|
+
* * cancel(value): Function cancel change items per page
|
|
551
|
+
* * @param {value} - bool
|
|
552
552
|
*/
|
|
553
553
|
onChangingPerPage: PropTypes.func,
|
|
554
554
|
/** Style inline of component. */
|
|
@@ -557,26 +557,26 @@ PagingInfo.propTypes = {
|
|
|
557
557
|
totalItems: PropTypes.number,
|
|
558
558
|
/** Compact type for mobile. */
|
|
559
559
|
typeShort: PropTypes.bool
|
|
560
|
-
/**
|
|
561
|
-
* ref methods (ref.current.instance.*method*)
|
|
562
|
-
*
|
|
563
|
-
* * onChangePage(page): Change page number
|
|
564
|
-
* * @param {page} - number
|
|
565
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
566
|
-
* * @param {per} - number
|
|
567
|
-
* * setTotalItems(items): Set total items
|
|
568
|
-
* * @param {items} - number
|
|
569
|
-
*
|
|
570
|
-
* * option(): Gets all UI component properties
|
|
571
|
-
* * Returns value - object
|
|
572
|
-
* * option(optionName): Gets the value of a single property
|
|
573
|
-
* * @param {optionName} - string
|
|
574
|
-
* * Returns value - any
|
|
575
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
576
|
-
* * @param {optionName} - string
|
|
577
|
-
* * @param {optionValue} - any
|
|
578
|
-
* * option(options): Updates the values of several properties
|
|
579
|
-
* * @param {options} - object
|
|
560
|
+
/**
|
|
561
|
+
* ref methods (ref.current.instance.*method*)
|
|
562
|
+
*
|
|
563
|
+
* * onChangePage(page): Change page number
|
|
564
|
+
* * @param {page} - number
|
|
565
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
566
|
+
* * @param {per} - number
|
|
567
|
+
* * setTotalItems(items): Set total items
|
|
568
|
+
* * @param {items} - number
|
|
569
|
+
*
|
|
570
|
+
* * option(): Gets all UI component properties
|
|
571
|
+
* * Returns value - object
|
|
572
|
+
* * option(optionName): Gets the value of a single property
|
|
573
|
+
* * @param {optionName} - string
|
|
574
|
+
* * Returns value - any
|
|
575
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
576
|
+
* * @param {optionName} - string
|
|
577
|
+
* * @param {optionValue} - any
|
|
578
|
+
* * option(options): Updates the values of several properties
|
|
579
|
+
* * @param {options} - object
|
|
580
580
|
*/
|
|
581
581
|
};
|
|
582
582
|
export { PagingInfo };
|