diginet-core-ui 1.4.49-beta.3 → 1.4.49-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.
|
@@ -286,10 +286,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
/**
|
|
290
|
-
* So sánh text đầu vào cáo map với txtSearch
|
|
291
|
-
* @param text
|
|
292
|
-
* @return {boolean}
|
|
289
|
+
/**
|
|
290
|
+
* So sánh text đầu vào cáo map với txtSearch
|
|
291
|
+
* @param text
|
|
292
|
+
* @return {boolean}
|
|
293
293
|
*/
|
|
294
294
|
const handleRenderBySearch = (text = '') => {
|
|
295
295
|
if (typeof text !== 'string') text = text.toString();
|
|
@@ -301,10 +301,10 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
301
301
|
} else return text.toLowerCase().includes(txtSearch.toLowerCase());
|
|
302
302
|
};
|
|
303
303
|
|
|
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}
|
|
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}
|
|
308
308
|
*/
|
|
309
309
|
const displayValue = data => {
|
|
310
310
|
let text = '';
|
|
@@ -1709,9 +1709,9 @@ Dropdown.propTypes = {
|
|
|
1709
1709
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1710
1710
|
/** If `true`, the component is disabled. */
|
|
1711
1711
|
disabled: PropTypes.bool,
|
|
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.
|
|
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.
|
|
1715
1715
|
*/
|
|
1716
1716
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1717
1717
|
/** Inline style for dropdown items. */
|
|
@@ -1720,14 +1720,14 @@ Dropdown.propTypes = {
|
|
|
1720
1720
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1721
1721
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1722
1722
|
helperTextProps: PropTypes.object,
|
|
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
|
-
* }
|
|
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
|
+
* }
|
|
1731
1731
|
*/
|
|
1732
1732
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1733
1733
|
key: PropTypes.string,
|
|
@@ -1761,8 +1761,8 @@ Dropdown.propTypes = {
|
|
|
1761
1761
|
onChange: PropTypes.func,
|
|
1762
1762
|
/** Callback function fired when the dropdown is closed. */
|
|
1763
1763
|
onClosed: PropTypes.func,
|
|
1764
|
-
/** Callback function fired when the input value changes.<br/>
|
|
1765
|
-
* 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).
|
|
1766
1766
|
*/
|
|
1767
1767
|
onInput: PropTypes.func,
|
|
1768
1768
|
/** Callback function fired when a key is pressed down in the input. */
|
|
@@ -1775,21 +1775,21 @@ Dropdown.propTypes = {
|
|
|
1775
1775
|
placeholder: PropTypes.string,
|
|
1776
1776
|
/** If `true`, the component is read-only. */
|
|
1777
1777
|
readOnly: PropTypes.bool,
|
|
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`
|
|
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`
|
|
1781
1781
|
*/
|
|
1782
1782
|
renderItem: PropTypes.func,
|
|
1783
|
-
/** Function or field name used to display selected items.<br/>
|
|
1784
|
-
* 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/>
|
|
1785
1785
|
*/
|
|
1786
1786
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1787
1787
|
/** If `true`, the label will indicate that the input is required. */
|
|
1788
1788
|
required: PropTypes.bool,
|
|
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.
|
|
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.
|
|
1793
1793
|
*/
|
|
1794
1794
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1795
1795
|
/** Specifies the field name or expression used to compare values with the search string. */
|
|
@@ -1816,19 +1816,19 @@ Dropdown.propTypes = {
|
|
|
1816
1816
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1817
1817
|
/** The variant to use. */
|
|
1818
1818
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none'])
|
|
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
|
|
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
|
|
1832
1832
|
*/
|
|
1833
1833
|
};
|
|
1834
1834
|
export default Dropdown;
|
|
@@ -833,7 +833,7 @@ const TreeViewRootCSS = ({
|
|
|
833
833
|
.TreeView-Content {
|
|
834
834
|
${displayBlock};
|
|
835
835
|
${positionRelative};
|
|
836
|
-
${parseMaxHeight(
|
|
836
|
+
${parseMaxHeight(240)};
|
|
837
837
|
${overflowYScroll};
|
|
838
838
|
&::-webkit-scrollbar {
|
|
839
839
|
${borderRadius(4)};
|
|
@@ -950,9 +950,9 @@ TreeView.propTypes = {
|
|
|
950
950
|
disabledBoldResult: PropTypes.bool,
|
|
951
951
|
/** If `true`, disabled parent and children item (only supported for multipleValueMode is single). */
|
|
952
952
|
disabledRelevantValue: PropTypes.bool,
|
|
953
|
-
/** Field name used for text display in dropdown list.<br/>
|
|
954
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
955
|
-
* Note: don't use 'id - name', return undefined
|
|
953
|
+
/** Field name used for text display in dropdown list.<br/>
|
|
954
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
955
|
+
* Note: don't use 'id - name', return undefined
|
|
956
956
|
*/
|
|
957
957
|
displayExpr: PropTypes.string,
|
|
958
958
|
/** If `true`, expand immediate after render (shouldn't use this). */
|
|
@@ -963,14 +963,14 @@ TreeView.propTypes = {
|
|
|
963
963
|
multiple: PropTypes.bool,
|
|
964
964
|
/** Return value for the select multiple use case. */
|
|
965
965
|
multipleValueMode: PropTypes.oneOf(['single', 'multiple', 'inheritance']),
|
|
966
|
-
/**
|
|
967
|
-
* Callback fired when the value changes.<br />
|
|
968
|
-
* return 2 parameters (e, data)<br />
|
|
969
|
-
* * e: element (insist {value, justSelected, data})<br/>
|
|
970
|
-
* + value is one or an array of selected values<br />
|
|
971
|
-
* + justSelected is value has just been selected (either true or false))<br />
|
|
972
|
-
* + data is one or an array of selected values with full information<br />
|
|
973
|
-
* * data: array of selected values (not recommend because it's the same e.value)
|
|
966
|
+
/**
|
|
967
|
+
* Callback fired when the value changes.<br />
|
|
968
|
+
* return 2 parameters (e, data)<br />
|
|
969
|
+
* * e: element (insist {value, justSelected, data})<br/>
|
|
970
|
+
* + value is one or an array of selected values<br />
|
|
971
|
+
* + justSelected is value has just been selected (either true or false))<br />
|
|
972
|
+
* + data is one or an array of selected values with full information<br />
|
|
973
|
+
* * data: array of selected values (not recommend because it's the same e.value)
|
|
974
974
|
*/
|
|
975
975
|
onChange: PropTypes.func,
|
|
976
976
|
/** Used for mapping into a nested list. */
|
|
@@ -979,15 +979,15 @@ TreeView.propTypes = {
|
|
|
979
979
|
renderAsyncFromLevel: PropTypes.oneOf([2, 3, 4, 5]),
|
|
980
980
|
/** Will render asynchronously if the number of elements is greater than this number. */
|
|
981
981
|
renderAsyncWithLength: PropTypes.number,
|
|
982
|
-
/** Function displays items by custom.<br/>
|
|
983
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
984
|
-
* --> such as: displayExpr={'name - role'}
|
|
982
|
+
/** Function displays items by custom.<br/>
|
|
983
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
984
|
+
* --> such as: displayExpr={'name - role'}
|
|
985
985
|
*/
|
|
986
986
|
renderItem: PropTypes.func,
|
|
987
|
-
/**
|
|
988
|
-
* Duration wait enter search content on search.<br/>
|
|
989
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
990
|
-
* If `true`, used default delayOnInput.
|
|
987
|
+
/**
|
|
988
|
+
* Duration wait enter search content on search.<br/>
|
|
989
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
990
|
+
* If `true`, used default delayOnInput.
|
|
991
991
|
*/
|
|
992
992
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
993
993
|
/** Specifies a comparison operation used to search items. */
|
|
@@ -1010,22 +1010,22 @@ TreeView.propTypes = {
|
|
|
1010
1010
|
value: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
1011
1011
|
/** The field name used for the returned result. */
|
|
1012
1012
|
valueExpr: PropTypes.string
|
|
1013
|
-
/**
|
|
1014
|
-
* get ref of TreeView component, insist:<br/>
|
|
1015
|
-
* {<br/>
|
|
1016
|
-
* disabled: true/false,<br/>
|
|
1017
|
-
* displayExpr: string,<br/>
|
|
1018
|
-
* valueExpr: string,<br/>
|
|
1019
|
-
* id: string,<br/>
|
|
1020
|
-
* parentID: string,<br/>
|
|
1021
|
-
* value: string/array<br/>
|
|
1022
|
-
* getValue: get selected values (instead of onChange function),<br/>
|
|
1023
|
-
* setValue: set array of value (only multiple),<br/>
|
|
1024
|
-
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1025
|
-
* + isChecked: checked if true (default is false) <br/>
|
|
1026
|
-
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1027
|
-
* get: get DOM of TreeView component<br/>
|
|
1028
|
-
* }
|
|
1013
|
+
/**
|
|
1014
|
+
* get ref of TreeView component, insist:<br/>
|
|
1015
|
+
* {<br/>
|
|
1016
|
+
* disabled: true/false,<br/>
|
|
1017
|
+
* displayExpr: string,<br/>
|
|
1018
|
+
* valueExpr: string,<br/>
|
|
1019
|
+
* id: string,<br/>
|
|
1020
|
+
* parentID: string,<br/>
|
|
1021
|
+
* value: string/array<br/>
|
|
1022
|
+
* getValue: get selected values (instead of onChange function),<br/>
|
|
1023
|
+
* setValue: set array of value (only multiple),<br/>
|
|
1024
|
+
* handleCheckbox: checked/unchecked a Checkbox, includes 2 parameters (isChecked, value):<br/>
|
|
1025
|
+
* + isChecked: checked if true (default is false) <br/>
|
|
1026
|
+
* + value: selected values, use 'all' for all values (default is 'all') <br/>
|
|
1027
|
+
* get: get DOM of TreeView component<br/>
|
|
1028
|
+
* }
|
|
1029
1029
|
*/
|
|
1030
1030
|
};
|
|
1031
1031
|
export default TreeView;
|