diginet-core-ui 1.4.55-beta.1 → 1.4.55-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.
|
@@ -725,6 +725,7 @@ const DateRangePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, refe
|
|
|
725
725
|
});
|
|
726
726
|
};
|
|
727
727
|
const closePicker = () => {
|
|
728
|
+
setOpenState(false);
|
|
728
729
|
const backGr = document.getElementById(unique.backGr);
|
|
729
730
|
if (!backGr) return;
|
|
730
731
|
const picker = backGr.querySelector(`#${unique.picker}`);
|
|
@@ -297,10 +297,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
297
297
|
});
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
-
/**
|
|
301
|
-
* So sánh text đầu vào cáo map với txtSearch
|
|
302
|
-
* @param text
|
|
303
|
-
* @return {boolean}
|
|
300
|
+
/**
|
|
301
|
+
* So sánh text đầu vào cáo map với txtSearch
|
|
302
|
+
* @param text
|
|
303
|
+
* @return {boolean}
|
|
304
304
|
*/
|
|
305
305
|
const handleRenderBySearch = (text = '') => {
|
|
306
306
|
if (text === null || text === undefined) text = '';
|
|
@@ -313,10 +313,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
313
313
|
} else return text.toLowerCase().includes(txtSearch.toLowerCase());
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
-
/**
|
|
317
|
-
* 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
|
|
318
|
-
* @param data {object} rowData of dataSource
|
|
319
|
-
* @return {string}
|
|
316
|
+
/**
|
|
317
|
+
* 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
|
|
318
|
+
* @param data {object} rowData of dataSource
|
|
319
|
+
* @return {string}
|
|
320
320
|
*/
|
|
321
321
|
const displayValue = data => {
|
|
322
322
|
let text = '';
|
|
@@ -1743,9 +1743,9 @@ Dropdown.propTypes = {
|
|
|
1743
1743
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1744
1744
|
/** If `true`, the component is disabled. */
|
|
1745
1745
|
disabled: PropTypes.bool,
|
|
1746
|
-
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1747
|
-
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1748
|
-
* Note: Do not use 'id - name', as it will return undefined.
|
|
1746
|
+
/** The field name used for displaying text in the dropdown list.<br/>
|
|
1747
|
+
* Examples: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1748
|
+
* Note: Do not use 'id - name', as it will return undefined.
|
|
1749
1749
|
*/
|
|
1750
1750
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1751
1751
|
/** Inline style for dropdown items. */
|
|
@@ -1754,14 +1754,14 @@ Dropdown.propTypes = {
|
|
|
1754
1754
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1755
1755
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1756
1756
|
helperTextProps: PropTypes.object,
|
|
1757
|
-
/** The field name used for displaying icons.<br/>
|
|
1758
|
-
* Example:<br/>
|
|
1759
|
-
* string: 'icon'<br/>
|
|
1760
|
-
* object: {<br/>
|
|
1761
|
-
* key: 'icon',<br/>
|
|
1762
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1763
|
-
* suffix: '.jpg'<br/>
|
|
1764
|
-
* }
|
|
1757
|
+
/** The field name used for displaying icons.<br/>
|
|
1758
|
+
* Example:<br/>
|
|
1759
|
+
* string: 'icon'<br/>
|
|
1760
|
+
* object: {<br/>
|
|
1761
|
+
* key: 'icon',<br/>
|
|
1762
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1763
|
+
* suffix: '.jpg'<br/>
|
|
1764
|
+
* }
|
|
1765
1765
|
*/
|
|
1766
1766
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1767
1767
|
key: PropTypes.string,
|
|
@@ -1795,8 +1795,8 @@ Dropdown.propTypes = {
|
|
|
1795
1795
|
onChange: PropTypes.func,
|
|
1796
1796
|
/** Callback function fired when the dropdown is closed. */
|
|
1797
1797
|
onClosed: PropTypes.func,
|
|
1798
|
-
/** Callback function fired when the input value changes.<br/>
|
|
1799
|
-
* If undefined, the filter function will run (default behavior).
|
|
1798
|
+
/** Callback function fired when the input value changes.<br/>
|
|
1799
|
+
* If undefined, the filter function will run (default behavior).
|
|
1800
1800
|
*/
|
|
1801
1801
|
onInput: PropTypes.func,
|
|
1802
1802
|
/** Callback function fired when a key is pressed down in the input. */
|
|
@@ -1809,21 +1809,21 @@ Dropdown.propTypes = {
|
|
|
1809
1809
|
placeholder: PropTypes.string,
|
|
1810
1810
|
/** If `true`, the component is read-only. */
|
|
1811
1811
|
readOnly: PropTypes.bool,
|
|
1812
|
-
/** Function used for custom rendering of items.<br/>
|
|
1813
|
-
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1814
|
-
* This can be used as an alternative to `displayExpr`
|
|
1812
|
+
/** Function used for custom rendering of items.<br/>
|
|
1813
|
+
* Example: `(data, index) => data.name + ' - ' + data.role`<br/>
|
|
1814
|
+
* This can be used as an alternative to `displayExpr`
|
|
1815
1815
|
*/
|
|
1816
1816
|
renderItem: PropTypes.func,
|
|
1817
|
-
/** Function or field name used to display selected items.<br/>
|
|
1818
|
-
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1817
|
+
/** Function or field name used to display selected items.<br/>
|
|
1818
|
+
* Example: `(data, index) => index + ' - ' + data.name`<br/>
|
|
1819
1819
|
*/
|
|
1820
1820
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1821
1821
|
/** If `true`, the label will indicate that the input is required. */
|
|
1822
1822
|
required: PropTypes.bool,
|
|
1823
|
-
/**
|
|
1824
|
-
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1825
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1826
|
-
* If `true`, the default delayOnInput will be used.
|
|
1823
|
+
/**
|
|
1824
|
+
* Duration to wait after entering search content before triggering a search.<br/>
|
|
1825
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1826
|
+
* If `true`, the default delayOnInput will be used.
|
|
1827
1827
|
*/
|
|
1828
1828
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1829
1829
|
/** Specifies the field name or expression used to compare values with the search string. */
|
|
@@ -1854,19 +1854,19 @@ Dropdown.propTypes = {
|
|
|
1854
1854
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1855
1855
|
/** The variant to use. */
|
|
1856
1856
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
|
|
1857
|
-
/**
|
|
1858
|
-
* ref methods
|
|
1859
|
-
*
|
|
1860
|
-
* how to get component element? ref.current
|
|
1861
|
-
*
|
|
1862
|
-
* how to call method? ref.current.instance.{method}
|
|
1863
|
-
*
|
|
1864
|
-
* * showDropdown(): Show dropdown
|
|
1865
|
-
* * closeDropdown(): Close dropdown
|
|
1866
|
-
* * onClear(): Clear selected value
|
|
1867
|
-
* * setPreviousValue(): Set value to previous value
|
|
1868
|
-
* * setValue(value): Set value of dropdown
|
|
1869
|
-
* * @param {value} - string || number || array
|
|
1857
|
+
/**
|
|
1858
|
+
* ref methods
|
|
1859
|
+
*
|
|
1860
|
+
* how to get component element? ref.current
|
|
1861
|
+
*
|
|
1862
|
+
* how to call method? ref.current.instance.{method}
|
|
1863
|
+
*
|
|
1864
|
+
* * showDropdown(): Show dropdown
|
|
1865
|
+
* * closeDropdown(): Close dropdown
|
|
1866
|
+
* * onClear(): Clear selected value
|
|
1867
|
+
* * setPreviousValue(): Set value to previous value
|
|
1868
|
+
* * setValue(value): Set value of dropdown
|
|
1869
|
+
* * @param {value} - string || number || array
|
|
1870
1870
|
*/
|
|
1871
1871
|
};
|
|
1872
1872
|
export default Dropdown;
|
|
@@ -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;
|
|
@@ -493,10 +493,10 @@ NumberInput.propTypes = {
|
|
|
493
493
|
style: PropTypes.object,
|
|
494
494
|
/** Thousand separator character. */
|
|
495
495
|
thousandSeparator: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['.', ','])]),
|
|
496
|
-
/** Validation value, argument can:<br/>
|
|
497
|
-
* * string: the validation rule. Example required.<br/>
|
|
498
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
499
|
-
* * array: the validation rule list, insist object/string
|
|
496
|
+
/** Validation value, argument can:<br/>
|
|
497
|
+
* * string: the validation rule. Example required.<br/>
|
|
498
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
499
|
+
* * array: the validation rule list, insist object/string
|
|
500
500
|
*/
|
|
501
501
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
502
502
|
/** The value of the input element, required for a controlled component. */
|