diginet-core-ui 1.4.49-beta.4 → 1.4.50-beta.1
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.
|
@@ -135,6 +135,7 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
135
135
|
skip: skip || 0,
|
|
136
136
|
limit: limit || 50
|
|
137
137
|
});
|
|
138
|
+
const txtSearchRef = useRef(false);
|
|
138
139
|
const [unique] = useState(randomString(6, {
|
|
139
140
|
allowNumber: false,
|
|
140
141
|
allowSymbol: false
|
|
@@ -674,6 +675,7 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
674
675
|
var _e$target$value;
|
|
675
676
|
if (!dropdownRef.current) return; // Kiểm tra nếu dropdown đóng trước searchDelayTime thì không chạy
|
|
676
677
|
setTxtSearch((_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : '');
|
|
678
|
+
txtSearchRef.current = !!e.target.value;
|
|
677
679
|
if (onInput) {
|
|
678
680
|
onInput(e);
|
|
679
681
|
}
|
|
@@ -938,6 +940,13 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
938
940
|
return () => {
|
|
939
941
|
allValue[unique] = null;
|
|
940
942
|
closeDropdown(null, 'cleanup');
|
|
943
|
+
if (onInput && txtSearchRef.current) {
|
|
944
|
+
onInput({
|
|
945
|
+
target: {
|
|
946
|
+
value: ''
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
}
|
|
941
950
|
};
|
|
942
951
|
}, []);
|
|
943
952
|
useEffect(() => {
|
|
@@ -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;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -42,6 +42,11 @@ npm test
|
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
44
|
|
|
45
|
+
## 1.4.50
|
|
46
|
+
- \[Added\]: Icon – Add IconMenu MHRP39N0025, MHRP39N0027, MHRP39N0028
|
|
47
|
+
- \[Added\]: Attachment – Add HEIF support to getFileType in Attachment
|
|
48
|
+
- \[Fixed\]: Dropdown – Dropdown Treeview keep the search input fixed while scrolling through the list
|
|
49
|
+
|
|
45
50
|
## 1.4.49
|
|
46
51
|
- \[Added\]: Icon – Add Icon Fire
|
|
47
52
|
- \[Added\]: Dropdown – Add allowInput to the multiple-select dropdown.
|