diginet-core-ui 1.4.50-beta.3 → 1.4.50-beta.5
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.
|
@@ -330,19 +330,21 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
330
330
|
let dataSourceUsable = [...dataSourceState];
|
|
331
331
|
|
|
332
332
|
// search dataSource dựa trên txtSearch
|
|
333
|
-
if (!onInput
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
333
|
+
if (!onInput) {
|
|
334
|
+
if (!(action !== null && action !== void 0 && action.loadData) || !onLoadMore) {
|
|
335
|
+
var _dataSourceUsable;
|
|
336
|
+
dataSourceUsable = (_dataSourceUsable = dataSourceUsable) === null || _dataSourceUsable === void 0 ? void 0 : _dataSourceUsable.filter(i => {
|
|
337
|
+
if (searchExpr) {
|
|
338
|
+
// nếu map đc vs 1 trong những <key>(data[key]) của searchExpr
|
|
339
|
+
return !!searchExpr.find(j => handleRenderBySearch(i[j]));
|
|
340
|
+
} else {
|
|
341
|
+
// nếu map đc vs displayValue
|
|
342
|
+
return handleRenderBySearch(displayValue(i)) || handleRenderBySearch(i === null || i === void 0 ? void 0 : i[valueExpr]);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
344
346
|
}
|
|
345
|
-
if (vlObjDefaultState && vlObjDefaultState
|
|
347
|
+
if (vlObjDefaultState && (vlObjDefaultState === null || vlObjDefaultState === void 0 ? void 0 : vlObjDefaultState.length) > 0) {
|
|
346
348
|
const length = vlObjDefaultState === null || vlObjDefaultState === void 0 ? void 0 : vlObjDefaultState.length;
|
|
347
349
|
let existItemQuantity = 0;
|
|
348
350
|
for (let index = length - 1; index >= 0; index--) {
|
|
@@ -457,7 +459,8 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
457
459
|
parentID: treeViewParentID,
|
|
458
460
|
value: typeof currentValue[unique] === 'string' ? [currentValue[unique]] : currentValue[unique],
|
|
459
461
|
onChange: (e, value) => onChangeValue(e, '', multiple ? value : e.value),
|
|
460
|
-
renderItem: renderItem
|
|
462
|
+
renderItem: renderItem,
|
|
463
|
+
isInDropdown: true
|
|
461
464
|
}) : EmptyDataText);
|
|
462
465
|
};
|
|
463
466
|
|
|
@@ -37,6 +37,7 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
37
37
|
expand,
|
|
38
38
|
expandIcon,
|
|
39
39
|
id,
|
|
40
|
+
isInDropdown,
|
|
40
41
|
multiple,
|
|
41
42
|
multipleValueMode,
|
|
42
43
|
onChange,
|
|
@@ -69,7 +70,7 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
69
70
|
allowNumber: false,
|
|
70
71
|
allowSymbol: false
|
|
71
72
|
}));
|
|
72
|
-
const _TreeViewRootCSS = TreeViewRootCSS(theme);
|
|
73
|
+
const _TreeViewRootCSS = TreeViewRootCSS(theme, isInDropdown);
|
|
73
74
|
const determinateCheckbox = (input, determinate) => {
|
|
74
75
|
if (multipleValueMode === 'multiple' || disabledRelevantValue) {
|
|
75
76
|
input.classList[determinate ? 'add' : 'remove']('determinate');
|
|
@@ -793,7 +794,7 @@ const TreeView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
793
794
|
const TreeViewRootCSS = ({
|
|
794
795
|
colors,
|
|
795
796
|
spacing
|
|
796
|
-
}) => css`
|
|
797
|
+
}, isInDropdown) => css`
|
|
797
798
|
${displayBlock};
|
|
798
799
|
${positionRelative};
|
|
799
800
|
.DGN-UI-Accordion {
|
|
@@ -833,7 +834,7 @@ const TreeViewRootCSS = ({
|
|
|
833
834
|
.TreeView-Content {
|
|
834
835
|
${displayBlock};
|
|
835
836
|
${positionRelative};
|
|
836
|
-
${parseMaxHeight(240)};
|
|
837
|
+
${isInDropdown && parseMaxHeight(240)};
|
|
837
838
|
${overflowYScroll};
|
|
838
839
|
&::-webkit-scrollbar {
|
|
839
840
|
${borderRadius(4)};
|