@infomaximum/ui-kit 0.12.12 → 0.13.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.
- package/dist/components/BaseSelect/BaseSelect.d.ts +5 -0
- package/dist/components/BaseSelect/BaseSelect.js +360 -0
- package/dist/components/{Select/Select.styles.d.ts → BaseSelect/BaseSelect.styles.d.ts} +20 -4
- package/dist/components/{Select/Select.styles.js → BaseSelect/BaseSelect.styles.js} +23 -10
- package/dist/components/BaseSelect/BaseSelect.types.d.ts +99 -0
- package/dist/components/BaseSelect/BaseSelect.utils.d.ts +8 -0
- package/dist/components/BaseSelect/BaseSelect.utils.js +39 -0
- package/dist/components/BaseSelect/components/BaseSelectOptionList/BaseSelectOptionList.types.d.ts +11 -0
- package/dist/components/BaseSelect/components/SelectOptionList/SelectOptionList.d.ts +4 -0
- package/dist/components/BaseSelect/components/SelectOptionList/SelectOptionList.js +120 -0
- package/dist/components/{Select → BaseSelect}/components/SelectOptionList/SelectOptionList.styles.d.ts +13 -4
- package/dist/components/{Select → BaseSelect}/components/SelectOptionList/SelectOptionList.styles.js +13 -7
- package/dist/components/BaseSelect/components/SelectOptionList/SelectOptionList.types.d.ts +20 -0
- package/dist/components/BaseSelect/components/SelectTag/SelectTag.d.ts +4 -0
- package/dist/components/{Select → BaseSelect}/components/SelectTag/SelectTag.js +9 -5
- package/dist/components/BaseSelect/components/SelectTag/SelectTag.styles.d.ts +16 -0
- package/dist/components/{Select → BaseSelect}/components/SelectTag/SelectTag.styles.js +13 -3
- package/dist/components/BaseSelect/components/SelectTag/SelectTag.types.d.ts +11 -0
- package/dist/components/BaseSelect/contexts/BaseSelectContext.d.ts +33 -0
- package/dist/components/BaseSelect/contexts/BaseSelectContext.js +8 -0
- package/dist/components/BaseSelect/hooks/useCurrentValue.d.ts +7 -0
- package/dist/components/{Select → BaseSelect}/hooks/useCurrentValue.js +15 -0
- package/dist/components/BaseSelect/hooks/useDefaultCurrentValue.d.ts +2 -0
- package/dist/components/{Select → BaseSelect}/hooks/useDefaultCurrentValue.js +1 -1
- package/dist/components/BaseSelect/hooks/useDefaultSelectIndex.d.ts +2 -0
- package/dist/components/BaseSelect/hooks/useHideElements.d.ts +6 -0
- package/dist/components/{Select → BaseSelect}/hooks/useHideElements.js +11 -3
- package/dist/components/BaseSelect/hooks/useSearch.d.ts +10 -0
- package/dist/components/{Select → BaseSelect}/hooks/useSearch.js +4 -16
- package/dist/components/Checkbox/Checkbox.js +12 -8
- package/dist/components/Checkbox/Checkbox.utils.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.utils.js +5 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +35 -10
- package/dist/components/Input/Input.styles.d.ts +7 -0
- package/dist/components/Input/Input.styles.js +9 -5
- package/dist/components/Input/Input.types.d.ts +16 -6
- package/dist/components/Input/components/InputPassword/InputPassword.d.ts +2 -1
- package/dist/components/Input/components/InputTextArea/InputTextArea.d.ts +2 -2
- package/dist/components/Input/components/InputTextArea/InputTextArea.js +27 -5
- package/dist/components/Input/components/InputTextArea/InputTextArea.types.d.ts +10 -2
- package/dist/components/Input/index.d.ts +3 -1
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.js +39 -281
- package/dist/components/Select/Select.types.d.ts +6 -85
- package/dist/components/Select/Select.utils.d.ts +1 -9
- package/dist/components/Select/Select.utils.js +1 -46
- package/dist/components/Select/components/SelectOption/SelectOption.js +20 -23
- package/dist/components/Select/components/SelectOption/SelectOption.styles.js +1 -1
- package/dist/components/Select/components/SelectOption/SelectOption.types.d.ts +13 -15
- package/dist/components/Select/hooks/useKeyControl.d.ts +7 -3
- package/dist/components/Select/hooks/useKeyControl.js +48 -13
- package/dist/components/TreeSelect/TreeSelect.d.ts +3 -0
- package/dist/components/TreeSelect/TreeSelect.js +189 -0
- package/dist/components/TreeSelect/TreeSelect.tokens.d.ts +30 -0
- package/dist/components/TreeSelect/TreeSelect.tokens.js +31 -0
- package/dist/components/TreeSelect/TreeSelect.types.d.ts +69 -0
- package/dist/components/TreeSelect/TreeSelect.utils.d.ts +13 -0
- package/dist/components/TreeSelect/TreeSelect.utils.js +192 -0
- package/dist/components/TreeSelect/components/TreeSelectOption/TreeSelectOption.d.ts +3 -0
- package/dist/components/TreeSelect/components/TreeSelectOption/TreeSelectOption.js +117 -0
- package/dist/components/TreeSelect/components/TreeSelectOption/TreeSelectOption.styles.d.ts +83 -0
- package/dist/components/TreeSelect/components/TreeSelectOption/TreeSelectOption.styles.js +111 -0
- package/dist/components/TreeSelect/components/TreeSelectOption/TreeSelectOption.types.d.ts +27 -0
- package/dist/components/TreeSelect/contexts/treeSelectContext.d.ts +14 -0
- package/dist/components/TreeSelect/contexts/treeSelectContext.js +5 -0
- package/dist/components/TreeSelect/forStories/dataForExamples.d.ts +32 -0
- package/dist/components/TreeSelect/hooks/useAsyncLoading.d.ts +8 -0
- package/dist/components/TreeSelect/hooks/useAsyncLoading.js +39 -0
- package/dist/components/TreeSelect/hooks/useElementSizesController.d.ts +6 -0
- package/dist/components/TreeSelect/hooks/useElementSizesController.js +21 -0
- package/dist/components/TreeSelect/hooks/useExtendController.d.ts +19 -0
- package/dist/components/TreeSelect/hooks/useExtendController.js +65 -0
- package/dist/components/TreeSelect/hooks/useKeyControl.d.ts +11 -0
- package/dist/components/TreeSelect/hooks/useKeyControl.js +75 -0
- package/dist/components/TreeSelect/hooks/useTreeCheckable.d.ts +6 -0
- package/dist/components/TreeSelect/hooks/useTreeCheckable.js +56 -0
- package/dist/components/TreeSelect/hooks/useTreeData.d.ts +8 -0
- package/dist/components/TreeSelect/hooks/useTreeData.js +33 -0
- package/dist/components/TreeSelect/index.d.ts +2 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/dist/components/Select/components/SelectOptionList/SelectOptionList.d.ts +0 -3
- package/dist/components/Select/components/SelectOptionList/SelectOptionList.js +0 -139
- package/dist/components/Select/components/SelectOptionList/SelectOptionList.types.d.ts +0 -42
- package/dist/components/Select/components/SelectOptionList/SelectOptionList.utils.d.ts +0 -1
- package/dist/components/Select/components/SelectOptionList/SelectOptionList.utils.js +0 -4
- package/dist/components/Select/components/SelectTag/SelectTag.d.ts +0 -3
- package/dist/components/Select/components/SelectTag/SelectTag.styles.d.ts +0 -8
- package/dist/components/Select/components/SelectTag/SelectTag.types.d.ts +0 -10
- package/dist/components/Select/hooks/useCurrentValue.d.ts +0 -8
- package/dist/components/Select/hooks/useDefaultCurrentValue.d.ts +0 -3
- package/dist/components/Select/hooks/useDefaultSelectIndex.d.ts +0 -2
- package/dist/components/Select/hooks/useDefaultSelectIndex.js +0 -17
- package/dist/components/Select/hooks/useHideElements.d.ts +0 -5
- package/dist/components/Select/hooks/useSearch.d.ts +0 -11
- /package/dist/components/{Select/Select.tokens.d.ts → BaseSelect/BaseSelect.tokens.d.ts} +0 -0
- /package/dist/components/{Select/Select.tokens.js → BaseSelect/BaseSelect.tokens.js} +0 -0
- /package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.d.ts +0 -0
- /package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.js +0 -0
- /package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.styles.d.ts +0 -0
- /package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.styles.js +0 -0
- /package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.types.d.ts +0 -0
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { createElement } from "@emotion/react";
|
|
3
|
-
import { memo, useState, useRef, useEffect } from "react";
|
|
4
|
-
import { SelectOption } from "../SelectOption/SelectOption.js";
|
|
5
|
-
import { getSelectOptionListStyle } from "./SelectOptionList.styles.js";
|
|
6
|
-
import { ANIMATION_DURATION } from "./SelectOptionList.utils.js";
|
|
7
|
-
import { isFunction } from "lodash-es";
|
|
8
|
-
import { createPortal } from "react-dom";
|
|
9
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
10
|
-
import { useTheme } from "../../../../hooks/useTheme/useTheme.js";
|
|
11
|
-
import { LoadingOutlined } from "../../../../icons/icons/LoadingOutlined.js";
|
|
12
|
-
const SelectOptionList = memo(({
|
|
13
|
-
options,
|
|
14
|
-
mode,
|
|
15
|
-
showOptionList,
|
|
16
|
-
currentValue,
|
|
17
|
-
dropdownMinWidth,
|
|
18
|
-
dropdownMaxHeight,
|
|
19
|
-
dropdownPrompt,
|
|
20
|
-
loading,
|
|
21
|
-
dropdownClassName,
|
|
22
|
-
styles,
|
|
23
|
-
dropdownMatchSelectWidth,
|
|
24
|
-
floatingStyles,
|
|
25
|
-
referenceOffsetWidth,
|
|
26
|
-
floatingRef,
|
|
27
|
-
virtual,
|
|
28
|
-
currentSelectingIndex,
|
|
29
|
-
emptyContent,
|
|
30
|
-
notFoundContent,
|
|
31
|
-
searchValue,
|
|
32
|
-
showSearch,
|
|
33
|
-
setFloating,
|
|
34
|
-
setValue,
|
|
35
|
-
closeOptionList,
|
|
36
|
-
returnFocusToWrapper,
|
|
37
|
-
dropdownRender,
|
|
38
|
-
optionRender,
|
|
39
|
-
getPopupContainer,
|
|
40
|
-
removeValue
|
|
41
|
-
}) => {
|
|
42
|
-
const theme = useTheme();
|
|
43
|
-
const [isAnimation, setIsAnimation] = useState(false);
|
|
44
|
-
const isInitialMount = useRef(true);
|
|
45
|
-
const {
|
|
46
|
-
getTotalSize,
|
|
47
|
-
getVirtualItems,
|
|
48
|
-
scrollToIndex,
|
|
49
|
-
scrollToOffset
|
|
50
|
-
} = useVirtualizer({
|
|
51
|
-
count: virtual && dropdownPrompt ? options.length + 1 : options.length,
|
|
52
|
-
getScrollElement: () => floatingRef.current,
|
|
53
|
-
estimateSize: () => 28
|
|
54
|
-
});
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (!showOptionList) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
scrollToIndex(currentSelectingIndex || 0);
|
|
60
|
-
}, [showOptionList, currentSelectingIndex, scrollToIndex, scrollToOffset]);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (isInitialMount.current) {
|
|
63
|
-
isInitialMount.current = false;
|
|
64
|
-
} else {
|
|
65
|
-
setIsAnimation(true);
|
|
66
|
-
const timerId = setTimeout(() => {
|
|
67
|
-
setIsAnimation(false);
|
|
68
|
-
}, ANIMATION_DURATION);
|
|
69
|
-
return () => clearTimeout(timerId);
|
|
70
|
-
}
|
|
71
|
-
}, [showOptionList]);
|
|
72
|
-
const selectOptionListStyle = getSelectOptionListStyle(dropdownMinWidth, dropdownMaxHeight, showOptionList, dropdownMatchSelectWidth, referenceOffsetWidth, getTotalSize);
|
|
73
|
-
const hasPlaceholder = loading || options.length === 0;
|
|
74
|
-
if (!showOptionList && !isAnimation) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
const renderOption = (option, index) => {
|
|
78
|
-
if (isFunction(optionRender)) {
|
|
79
|
-
return optionRender({
|
|
80
|
-
...option,
|
|
81
|
-
index,
|
|
82
|
-
isSelecting: currentSelectingIndex === index,
|
|
83
|
-
selected: currentValue.includes(option.value),
|
|
84
|
-
mode,
|
|
85
|
-
setValue,
|
|
86
|
-
closeOptionList,
|
|
87
|
-
returnFocusToWrapper,
|
|
88
|
-
removeValue
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
return /* @__PURE__ */ createElement(SelectOption, { ...option, index, isSelecting: currentSelectingIndex === index, selected: currentValue.includes(option.value), setValue, closeOptionList, key: option.value, returnFocusToWrapper, mode, removeValue });
|
|
92
|
-
};
|
|
93
|
-
const renderPrompt = () => {
|
|
94
|
-
var _a;
|
|
95
|
-
if (!dropdownPrompt) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return /* @__PURE__ */ jsx("div", { css: [selectOptionListStyle.prompt(theme), (_a = styles == null ? void 0 : styles.prompt) == null ? void 0 : _a.call(styles, theme), process.env.NODE_ENV === "production" ? "" : ";label:renderPrompt;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L2NvbXBvbmVudHMvU2VsZWN0T3B0aW9uTGlzdC9TZWxlY3RPcHRpb25MaXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnSWEiLCJmaWxlIjoiL2J1aWxkcy9mcm9udGVuZC9saWJzL3VpLWtpdC9zcmMvY29tcG9uZW50cy9TZWxlY3QvY29tcG9uZW50cy9TZWxlY3RPcHRpb25MaXN0L1NlbGVjdE9wdGlvbkxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBGQywgbWVtbywgdXNlRWZmZWN0LCB1c2VSZWYsIHVzZVN0YXRlIH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgdHlwZSB7IFNlbGVjdE9wdGlvbkxpc3RQcm9wcyB9IGZyb20gXCIuL1NlbGVjdE9wdGlvbkxpc3QudHlwZXNcIjtcbmltcG9ydCB7IFNlbGVjdE9wdGlvbiB9IGZyb20gXCIuLi9TZWxlY3RPcHRpb24vU2VsZWN0T3B0aW9uXCI7XG5pbXBvcnQgeyBnZXRTZWxlY3RPcHRpb25MaXN0U3R5bGUgfSBmcm9tIFwiLi9TZWxlY3RPcHRpb25MaXN0LnN0eWxlc1wiO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tIFwiaG9va3MvdXNlVGhlbWVcIjtcbmltcG9ydCB7IEFOSU1BVElPTl9EVVJBVElPTiB9IGZyb20gXCIuL1NlbGVjdE9wdGlvbkxpc3QudXRpbHNcIjtcbmltcG9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BjdXJyZW50U2VsZWN0aW5nSW5kZXggPT09IGluZGV4LFxuICAgICAgICAgIHNlbGVjdGVkOiBjdXJyZW50VmFsdWUuaW5jbHVkZXMob3B0aW9uLnZhbHVlKSxcbiAgICAgICAgICBtb2RlLFxuICAgICAgICAgIHNldFZhbHVlLFxuICAgICAgICAgIGNsb3NlT3B0aW9uTGlzdCxcbiAgICAgICAgICByZXR1cm5Gb2N1c1RvV3JhcHBlcixcbiAgICAgICAgICByZW1vdmVWYWx1ZSxcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiAoXG4gICAgICAgIDxTZWxlY3RPcHRpb25cbiAgICAgICAgICB7Li4ub3B0aW9ufVxuICAgICAgICAgIGluZGV4PXtpbmRleH1cbiAgICAgICAgICBpc1NlbGVjdGluZz17Y3VycmVudFNlbGVjdGluZ0luZGV4ID09PSBpbmRleH1cbiAgICAgICAgICBzZWxlY3RlZD17Y3VycmVudFZhbHVlLmluY2x1ZGVzKG9wdGlvbi52YWx1ZSl9XG4gICAgICAgICAgc2V0VmFsdWU9e3NldFZhbHVlfVxuICAgICAgICAgIGNsb3NlT3B0aW9uTGlzdD17Y2xvc2VPcHRpb25MaXN0fVxuICAgICAgICAgIGtleT17b3B0aW9uLnZhbHVlfVxuICAgICAgICAgIHJldHVybkZvY3VzVG9XcmFwcGVyPXtyZXR1cm5Gb2N1c1RvV3JhcHBlcn1cbiAgICAgICAgICBtb2RlPXttb2RlfVxuICAgICAgICAgIHJlbW92ZVZhbHVlPXtyZW1vdmVWYWx1ZX1cbiAgICAgICAgLz5cbiAgICAgICk7XG4gICAgfTtcblxuICAgIGNvbnN0IHJlbmRlclByb21wdCA9ICgpID0+IHtcbiAgICAgIGlmICghZHJvcGRvd25Qcm9tcHQpIHtcbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiAoXG4gICAgICAgIDxkaXYgY3NzPXtbc2VsZWN0T3B0aW9uTGlzdFN0eWx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biAgICBjb25zdCByZW5kZXJPcHRpb25zID0gKCkgPT4gKFxuICAgICAgPD5cbiAgICAgICAge29wdGlvbnMubWFwKChvcHRpb24sIGluZGV4KSA9PiByZW5kZXJPcHRpb24ob3B0aW9uLCBpbmRleCkpfVxuICAgICAgICB7cmVuZGVyUHJvbXB0KCl9XG4gICAgICA8Lz5cbiAgICApO1xuXG4gICAgY29uc3QgcmVuZGVyT3B0aW9uTGlzdENvbnRlbnQgPSAoKSA9PiAodmlydHVhbCA/IHJlbmRlclZpcnR1YWxpemVkT3B0aW9ucygpIDogcmVuZGVyT3B0aW9ucygpKTtcblxuICAgIGNvbnN0IHJlbmRlclBsYWNlaG9sZGVyID0gKCkgPT4ge1xuICAgICAgaWYgKGxvYWRpbmcpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICA8c3BhbiBjc3M9e3NlbGVjdE9wdGlvbkxpc3RTdHlsZS53cmFwcGVyT2ZMb2FkaW5nKHRoZW1lKX0+XG4gICAgICAgICAgICA8TG9hZGluZ091dGxpbmVkIC8+XG4gICAgICAgICAgPC9zcGFuPlxuICAgICAgICApO1xuICAgICAgfVxuXG4gICAgICBjb25zdCBpc0FjdGl2ZVNlYXJjaCA9IHNlYXJjaFZhbHVlICYmIHNob3dTZWFyY2g7XG5cbiAgICAgIGlmIChvcHRpb25zLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgIDxkaXYgY3NzPXtzZWxlY3RPcHRpb25MaXN0U3R5bGUud3JhcHBlck9mRW1wdHlDb250ZW50KHRoZW1lKX0+XG4gICAgICAgICAgICB7aXNBY3RpdmVTZWFyY2ggPyBub3RGb3VuZENvbnRlbnQgOiBlbXB0eUNvbnRlbnR9XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBudWxsO1xuICAgIH07XG5cbiAgICBjb25zdCByZW5kZXJTZWxlY3RPcHRpb25MaXN0ID0gKCkgPT4gKFxuICAgICAgPGRpdlxuICAgICAgICByZWY9e3NldEZsb2F0aW5nfVxuICAgICAgICBzdHlsZT17ZmxvYXRpbmdTdHlsZXN9XG4gICAgICAgIGNzcz17W3NlbGVjdE9wdGlvbkxpc3RTdHlsZS53cmFwcGVyKHRoZW1lKSwgc3R5bGVzPy53cmFwcGVyPy4odGhlbWUpXX1cbiAgICAgICAgY2xhc3NOYW1lPXtkcm9wZG93bkNsYXNzTmFtZX1cbiAgICAgICAgdGFiSW5kZXg9ezJ9XG4gICAgICA+XG4gICAgICAgIHtoYXNQbGFjZWhvbGRlciA/IChcbiAgICAgICAgICByZW5kZXJQbGFjZWhvbGRlcigpXG4gICAgICAgICkgOiAoXG4gICAgICAgICAgPGRpdiBjc3M9e3NlbGVjdE9wdGlvbkxpc3RTdHlsZS5jb250YWluZXIodmlydHVhbCl9PlxuICAgICAgICAgICAge2lzRnVuY3Rpb24oZHJvcGRvd25SZW5kZXIpXG4gICAgICAgICAgICAgID8gZHJvcGRvd25SZW5kZXIocmVuZGVyT3B0aW9uTGlzdENvbnRlbnQoKSlcbiAgICAgICAgICAgICAgOiByZW5kZXJPcHRpb25MaXN0Q29udGVudCgpfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICApfVxuICAgICAgPC9kaXY+XG4gICAgKTtcblxuICAgIHJldHVybiBjcmVhdGVQb3J0YWwocmVuZGVyU2VsZWN0T3B0aW9uTGlzdCgpLCBnZXRQb3B1cENvbnRhaW5lcigpKTtcbiAgfVxuKTtcbiJdfQ== */"], children: dropdownPrompt }, "prompt");
|
|
99
|
-
};
|
|
100
|
-
const renderVirtualizedOptions = () => {
|
|
101
|
-
return getVirtualItems().map(({
|
|
102
|
-
index,
|
|
103
|
-
size,
|
|
104
|
-
start
|
|
105
|
-
}) => {
|
|
106
|
-
if (index < options.length) {
|
|
107
|
-
const option = options[index];
|
|
108
|
-
return /* @__PURE__ */ jsx("div", { css: selectOptionListStyle.virtualizedOptionWrapper(size, start), children: renderOption(option, index) }, option.value);
|
|
109
|
-
}
|
|
110
|
-
if (!dropdownPrompt) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
return /* @__PURE__ */ jsx("div", { css: selectOptionListStyle.virtualizedOptionWrapper(size, start), children: renderPrompt() }, "prompt");
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
const renderOptions = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
117
|
-
options.map((option, index) => renderOption(option, index)),
|
|
118
|
-
renderPrompt()
|
|
119
|
-
] });
|
|
120
|
-
const renderOptionListContent = () => virtual ? renderVirtualizedOptions() : renderOptions();
|
|
121
|
-
const renderPlaceholder = () => {
|
|
122
|
-
if (loading) {
|
|
123
|
-
return /* @__PURE__ */ jsx("span", { css: selectOptionListStyle.wrapperOfLoading(theme), children: /* @__PURE__ */ jsx(LoadingOutlined, {}) });
|
|
124
|
-
}
|
|
125
|
-
const isActiveSearch = searchValue && showSearch;
|
|
126
|
-
if (options.length === 0) {
|
|
127
|
-
return /* @__PURE__ */ jsx("div", { css: selectOptionListStyle.wrapperOfEmptyContent(theme), children: isActiveSearch ? notFoundContent : emptyContent });
|
|
128
|
-
}
|
|
129
|
-
return null;
|
|
130
|
-
};
|
|
131
|
-
const renderSelectOptionList = () => {
|
|
132
|
-
var _a;
|
|
133
|
-
return /* @__PURE__ */ jsx("div", { ref: setFloating, style: floatingStyles, css: [selectOptionListStyle.wrapper(theme), (_a = styles == null ? void 0 : styles.wrapper) == null ? void 0 : _a.call(styles, theme), process.env.NODE_ENV === "production" ? "" : ";label:renderSelectOptionList;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L2NvbXBvbmVudHMvU2VsZWN0T3B0aW9uTGlzdC9TZWxlY3RPcHRpb25M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ICAgICAgaWYgKGluZGV4IDwgb3B0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICBjb25zdCBvcHRpb24gPSBvcHRpb25zW2luZGV4XTtcblxuICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICAgIGNzcz17c2VsZWN0T3B0aW9uTGlzdFN0eWxlLnZpcnR1YWxpemVkT3B0aW9uV3JhcHBlcihzaXplLCBzdGFydCl9XG4gICAgICAgICAgICAgIGtleT17b3B0aW9uLnZhbHVlfVxuICAgICAgICAgICAgPlxuICAgICAgICAgICAgICB7cmVuZGVyT3B0aW9uKG9wdGlvbiwgaW5kZXgpfVxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZHJvcGRvd25Qcm9tcHQpIHtcbiAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgPGRpdiBjc3M9e3NlbGVjdE9wdGlvbkxpc3RTdHlsZS52aXJ0dWFsaXplZE9wdGlvbldyYXBwZXIoc2l6ZSwgc3RhcnQpfSBrZXk9XCJwcm9tcHRcIj5cbiAgICAgICAgICAgIHtyZW5kZXJQcm9tcHQoKX1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgKTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjb25zdCByZW5kZXJPcHRpb25zID0gKCkgPT4gKFxuICAgICAgPD5cbiAgICAgICAge29wdGlvbnMubWFwKChvcHRpb24sIGluZGV4KSA9PiByZW5kZXJPcHRpb24ob3B0aW9uLCBpbmRleCkpfVxuICAgICAgICB7cmVuZGVyUHJvbXB0KCl9XG4gICAgICA8Lz5cbiAgICApO1xuXG4gICAgY29uc3QgcmVuZGVyT3B0aW9uTGlzdENvbnRlbnQgPSAoKSA9PiAodmlydHVhbCA/IHJlbmRlclZpcnR1YWxpemVkT3B0aW9ucygpIDogc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XNQbGFjZWhvbGRlciA/IChcbiAgICAgICAgICByZW5kZXJQbGFjZWhvbGRlcigpXG4gICAgICAgICkgOiAoXG4gICAgICAgICAgPGRpdiBjc3M9e3NlbGVjdE9wdGlvbkxpc3RTdHlsZS5jb250YWluZXIodmlydHVhbCl9PlxuICAgICAgICAgICAge2lzRnVuY3Rpb24oZHJvcGRvd25SZW5kZXIpXG4gICAgICAgICAgICAgID8gZHJvcGRvd25SZW5kZXIocmVuZGVyT3B0aW9uTGlzdENvbnRlbnQoKSlcbiAgICAgICAgICAgICAgOiByZW5kZXJPcHRpb25MaXN0Q29udGVudCgpfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICApfVxuICAgICAgPC9kaXY+XG4gICAgKTtcblxuICAgIHJldHVybiBjcmVhdGVQb3J0YWwocmVuZGVyU2VsZWN0T3B0aW9uTGlzdCgpLCBnZXRQb3B1cENvbnRhaW5lcigpKTtcbiAgfVxuKTtcbiJdfQ== */"], className: dropdownClassName, tabIndex: 2, children: hasPlaceholder ? renderPlaceholder() : /* @__PURE__ */ jsx("div", { css: selectOptionListStyle.container(virtual), children: isFunction(dropdownRender) ? dropdownRender(renderOptionListContent()) : renderOptionListContent() }) });
|
|
134
|
-
};
|
|
135
|
-
return createPortal(renderSelectOptionList(), getPopupContainer());
|
|
136
|
-
});
|
|
137
|
-
export {
|
|
138
|
-
SelectOptionList
|
|
139
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Theme } from '../../../../themes';
|
|
2
|
-
import { SelectOptionCallbacks, SelectOptionInterface, SelectOptionProps, SelectOptionValue } from '../SelectOption/SelectOption.types';
|
|
3
|
-
import { Interpolation } from '@emotion/react';
|
|
4
|
-
import { CSSProperties, MutableRefObject, ReactNode } from 'react';
|
|
5
|
-
import { ModeType } from '../../Select.types';
|
|
6
|
-
export type DropdownMatchSelectWidthType = boolean | number;
|
|
7
|
-
export interface DropdownStyles {
|
|
8
|
-
wrapper?: (theme: Theme) => Interpolation;
|
|
9
|
-
container?: (virtual: boolean) => Interpolation;
|
|
10
|
-
prompt?: (theme: Theme) => Interpolation;
|
|
11
|
-
wrapperOfLoading?: (theme: Theme) => Interpolation;
|
|
12
|
-
wrapperOfEmptyContent?: (theme: Theme) => Interpolation;
|
|
13
|
-
virtualizedOptionWrapper?: (theme: Theme) => Interpolation;
|
|
14
|
-
}
|
|
15
|
-
export interface SelectOptionListProps extends SelectOptionCallbacks {
|
|
16
|
-
options: SelectOptionInterface[];
|
|
17
|
-
mode: ModeType;
|
|
18
|
-
showOptionList: boolean;
|
|
19
|
-
currentValue: SelectOptionValue[];
|
|
20
|
-
dropdownMinWidth: number;
|
|
21
|
-
dropdownMaxHeight: number;
|
|
22
|
-
dropdownPrompt?: string;
|
|
23
|
-
loading?: boolean;
|
|
24
|
-
dropdownClassName?: string;
|
|
25
|
-
dropdownMatchSelectWidth: DropdownMatchSelectWidthType;
|
|
26
|
-
floatingStyles: CSSProperties;
|
|
27
|
-
referenceOffsetWidth: number | undefined;
|
|
28
|
-
floatingRef: MutableRefObject<HTMLElement | null>;
|
|
29
|
-
virtual: boolean;
|
|
30
|
-
currentSelectingIndex: number;
|
|
31
|
-
emptyContent: ReactNode;
|
|
32
|
-
notFoundContent?: ReactNode;
|
|
33
|
-
searchValue?: string;
|
|
34
|
-
showSearch?: boolean;
|
|
35
|
-
styles?: DropdownStyles;
|
|
36
|
-
returnFocusToWrapper: () => void;
|
|
37
|
-
getPopupContainer: () => HTMLElement;
|
|
38
|
-
dropdownRender?: (originNode: ReactNode) => ReactNode;
|
|
39
|
-
optionRender?: (option: SelectOptionProps) => React.ReactNode;
|
|
40
|
-
setFloating: (node: HTMLElement | null) => void;
|
|
41
|
-
removeValue: (removeValue: SelectOptionValue) => void;
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ANIMATION_DURATION = 200;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Theme } from 'themes';
|
|
2
|
-
export declare const getSelectTagDefaultStyle: (isError: boolean, isBorderless: boolean, disabled: boolean) => {
|
|
3
|
-
wrapper: (theme: Theme) => {
|
|
4
|
-
fontSize: number;
|
|
5
|
-
color: "#262626" | "#8C8C8C" | "#FF4D4F";
|
|
6
|
-
background: "#D9D9D9" | "#F5F5F5";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SelectOptionValue } from '../SelectOption/SelectOption.types';
|
|
2
|
-
export interface SelectTagProps {
|
|
3
|
-
value: SelectOptionValue;
|
|
4
|
-
label: string;
|
|
5
|
-
maxTagTextLength?: number;
|
|
6
|
-
removeValue: (removeValue: SelectOptionValue) => void;
|
|
7
|
-
isError: boolean;
|
|
8
|
-
isBorderless: boolean;
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SelectOptionInterface, SelectOptionValue } from '../components/SelectOption/SelectOption.types';
|
|
2
|
-
import { ModeType } from '../Select.types';
|
|
3
|
-
export declare const useCurrentValue: (mode: ModeType, defaultValue: SelectOptionValue | SelectOptionValue[] | undefined, defaultActiveFirstOption: boolean | undefined, options: SelectOptionInterface[], onDeselect?: (value: SelectOptionValue) => void) => {
|
|
4
|
-
currentValue: SelectOptionValue[];
|
|
5
|
-
changeCurrentValue: (value: SelectOptionValue) => void;
|
|
6
|
-
removeValue: (removeValue: SelectOptionValue) => void;
|
|
7
|
-
clearCurrentValue: () => void;
|
|
8
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SelectOptionInterface, SelectOptionValue } from '../components/SelectOption/SelectOption.types';
|
|
2
|
-
import { ModeType } from '../Select.types';
|
|
3
|
-
export declare const useDefaultCurrentValue: (mode: ModeType, defaultValue: SelectOptionValue | SelectOptionValue[] | undefined, defaultActiveFirstOption: boolean | undefined, options: SelectOptionInterface[]) => SelectOptionValue[];
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { SelectOptionInterface, SelectOptionValue } from '../components/SelectOption/SelectOption.types';
|
|
2
|
-
export declare const useDefaultSelectIndex: (currentValue: SelectOptionValue[], options: SelectOptionInterface[], optionsMap: Map<SelectOptionValue, SelectOptionInterface>) => number;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
const useDefaultSelectIndex = (currentValue, options, optionsMap) => {
|
|
3
|
-
return useMemo(() => {
|
|
4
|
-
if (currentValue.length === 0) {
|
|
5
|
-
return 0;
|
|
6
|
-
}
|
|
7
|
-
const value = currentValue[currentValue.length - 1];
|
|
8
|
-
const currentOption = optionsMap.get(value);
|
|
9
|
-
if (!currentOption) {
|
|
10
|
-
return 0;
|
|
11
|
-
}
|
|
12
|
-
return options.indexOf(currentOption);
|
|
13
|
-
}, [options]);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
useDefaultSelectIndex
|
|
17
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
export declare const useHideElements: (itemKeys: (string | number)[], gapSize: number, additionalElements: string[], inputRef: MutableRefObject<HTMLInputElement | null>) => {
|
|
3
|
-
containerRef: import('react').RefObject<HTMLDivElement>;
|
|
4
|
-
isItemHidden: Map<string | number, boolean>;
|
|
5
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { UseSearchProps } from '../Select.types';
|
|
2
|
-
import { ChangeEvent } from 'react';
|
|
3
|
-
import { SelectOptionInterface } from '../components/SelectOption/SelectOption.types';
|
|
4
|
-
type ResultType = {
|
|
5
|
-
filteredAndSortedOptions: SelectOptionInterface[];
|
|
6
|
-
searchInputValue: string;
|
|
7
|
-
searchHandle: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
-
clearSearchValue: () => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const useSearch: ({ options, filterOption, optionFilterProp, searchValue, onSearch, filterSort, }: UseSearchProps) => ResultType;
|
|
11
|
-
export {};
|
|
File without changes
|
|
File without changes
|
/package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.styles.d.ts
RENAMED
|
File without changes
|
/package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.styles.js
RENAMED
|
File without changes
|
/package/dist/components/{Select → BaseSelect}/components/TagPlaceholder/TagPlaceholder.types.d.ts
RENAMED
|
File without changes
|