@tidbcloud/uikit 2.1.7 → 2.2.0
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/CHANGELOG.md +12 -0
- package/dist/biz/Form/ProMultiSelect.cjs +34 -0
- package/dist/biz/Form/ProMultiSelect.d.cts +8 -0
- package/dist/biz/Form/ProMultiSelect.d.mts +8 -0
- package/dist/biz/Form/ProMultiSelect.mjs +34 -0
- package/dist/biz/Form/index.d.cts +1 -0
- package/dist/biz/Form/index.d.mts +1 -0
- package/dist/biz/ProMultiSelect/helper.cjs +6 -0
- package/dist/biz/ProMultiSelect/helper.d.cts +1 -0
- package/dist/biz/ProMultiSelect/helper.d.mts +1 -0
- package/dist/biz/ProMultiSelect/helper.mjs +6 -0
- package/dist/biz/ProMultiSelect/index.cjs +291 -0
- package/dist/biz/ProMultiSelect/index.d.cts +6 -0
- package/dist/biz/ProMultiSelect/index.d.mts +6 -0
- package/dist/biz/ProMultiSelect/index.mjs +291 -0
- package/dist/biz/index.cjs +4 -0
- package/dist/biz/index.d.cts +1 -0
- package/dist/biz/index.d.mts +1 -0
- package/dist/biz/index.mjs +4 -0
- package/dist/primitive/index.cjs +10 -0
- package/dist/primitive/index.d.cts +2 -2
- package/dist/primitive/index.d.mts +2 -2
- package/dist/primitive/index.mjs +11 -1
- package/dist/theme/theme.cjs +1 -16
- package/dist/theme/theme.mjs +1 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tidbcloud/uikit
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- feat: add new multi select component ([#488](https://github.com/tidbcloud/tidbcloud-uikit/pull/488))
|
|
8
|
+
|
|
9
|
+
## 2.1.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix(uikit/theme): Simplify Menu component styling ([#490](https://github.com/tidbcloud/tidbcloud-uikit/pull/490))
|
|
14
|
+
|
|
3
15
|
## 2.1.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const errorMessage = require("@hookform/error-message");
|
|
5
|
+
const reactHookForm = require("react-hook-form");
|
|
6
|
+
const index = require("../ProMultiSelect/index.cjs");
|
|
7
|
+
const FormProMultiSelect = ({ name, rules, onChange, ...rest }) => {
|
|
8
|
+
const { control, formState, getFieldState } = reactHookForm.useFormContext();
|
|
9
|
+
const { error } = getFieldState(name, formState);
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
reactHookForm.Controller,
|
|
12
|
+
{
|
|
13
|
+
control,
|
|
14
|
+
name,
|
|
15
|
+
rules,
|
|
16
|
+
render: ({ field }) => {
|
|
17
|
+
const { onChange: handleChange, ...restField } = field;
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
index.ProMultiSelect,
|
|
20
|
+
{
|
|
21
|
+
...rest,
|
|
22
|
+
...restField,
|
|
23
|
+
onChange: (e) => {
|
|
24
|
+
handleChange(e);
|
|
25
|
+
onChange == null ? void 0 : onChange(e);
|
|
26
|
+
},
|
|
27
|
+
error: error ? /* @__PURE__ */ jsxRuntime.jsx(errorMessage.ErrorMessage, { errors: formState.errors, name }) : void 0
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
exports.FormProMultiSelect = FormProMultiSelect;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { ProMultiSelectProps } from '../ProMultiSelect/index.cjs';
|
|
4
|
+
export interface FormProMultiSelectProps extends ProMultiSelectProps {
|
|
5
|
+
name: string;
|
|
6
|
+
rules?: RegisterOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare const FormProMultiSelect: React.FC<FormProMultiSelectProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { ProMultiSelectProps } from '../ProMultiSelect/index.mjs';
|
|
4
|
+
export interface FormProMultiSelectProps extends ProMultiSelectProps {
|
|
5
|
+
name: string;
|
|
6
|
+
rules?: RegisterOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare const FormProMultiSelect: React.FC<FormProMultiSelectProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorMessage } from "@hookform/error-message";
|
|
3
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
4
|
+
import { ProMultiSelect } from "../ProMultiSelect/index.mjs";
|
|
5
|
+
const FormProMultiSelect = ({ name, rules, onChange, ...rest }) => {
|
|
6
|
+
const { control, formState, getFieldState } = useFormContext();
|
|
7
|
+
const { error } = getFieldState(name, formState);
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Controller,
|
|
10
|
+
{
|
|
11
|
+
control,
|
|
12
|
+
name,
|
|
13
|
+
rules,
|
|
14
|
+
render: ({ field }) => {
|
|
15
|
+
const { onChange: handleChange, ...restField } = field;
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
ProMultiSelect,
|
|
18
|
+
{
|
|
19
|
+
...rest,
|
|
20
|
+
...restField,
|
|
21
|
+
onChange: (e) => {
|
|
22
|
+
handleChange(e);
|
|
23
|
+
onChange == null ? void 0 : onChange(e);
|
|
24
|
+
},
|
|
25
|
+
error: error ? /* @__PURE__ */ jsx(ErrorMessage, { errors: formState.errors, name }) : void 0
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
FormProMultiSelect
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isValueChecked(value: string | string[] | undefined | null, optionValue: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isValueChecked(value: string | string[] | undefined | null, optionValue: string): boolean;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const index = require("../../icons/index.cjs");
|
|
6
|
+
;/* empty css */
|
|
7
|
+
;/* empty css */
|
|
8
|
+
;/* empty css */
|
|
9
|
+
;/* empty css */
|
|
10
|
+
;/* empty css */
|
|
11
|
+
const helper = require("./helper.cjs");
|
|
12
|
+
const useProps = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.cjs");
|
|
13
|
+
const MantineThemeProvider = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
|
|
14
|
+
const useCombobox = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/use-combobox/use-combobox.cjs");
|
|
15
|
+
const useUncontrolled = require("../../node_modules/.pnpm/@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-uncontrolled/use-uncontrolled.cjs");
|
|
16
|
+
const getParsedComboboxData = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-parsed-combobox-data/get-parsed-combobox-data.cjs");
|
|
17
|
+
const getOptionsLockup = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-options-lockup/get-options-lockup.cjs");
|
|
18
|
+
const defaultOptionsFilter = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/default-options-filter.cjs");
|
|
19
|
+
const Pill = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Pill/Pill.cjs");
|
|
20
|
+
const isOptionsGroup = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/is-options-group.cjs");
|
|
21
|
+
const Combobox = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/Combobox.cjs");
|
|
22
|
+
const InputBase = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/InputBase/InputBase.cjs");
|
|
23
|
+
const Loader = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Loader/Loader.cjs");
|
|
24
|
+
const Input = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Input/Input.cjs");
|
|
25
|
+
const ScrollArea = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.cjs");
|
|
26
|
+
const Group = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Group/Group.cjs");
|
|
27
|
+
const Box = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/Box/Box.cjs");
|
|
28
|
+
const Checkbox = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.cjs");
|
|
29
|
+
const Option = ({ data, withCheckIcon, value, checkIconPosition, unstyled, renderOption }) => {
|
|
30
|
+
if (!isOptionsGroup.isOptionsGroup(data)) {
|
|
31
|
+
const checked = helper.isValueChecked(value, data.value);
|
|
32
|
+
const check = withCheckIcon && /* @__PURE__ */ jsxRuntime.jsx(Checkbox.Checkbox, { size: "xs", checked });
|
|
33
|
+
const defaultContent = /* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { children: [
|
|
34
|
+
checkIconPosition === "left" && check,
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box.Box, { sx: { flex: 1 }, children: data.label }),
|
|
36
|
+
checkIconPosition === "right" && check
|
|
37
|
+
] });
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
Combobox.Combobox.Option,
|
|
40
|
+
{
|
|
41
|
+
value: data.value,
|
|
42
|
+
disabled: data.disabled,
|
|
43
|
+
"data-reverse": checkIconPosition === "right" || void 0,
|
|
44
|
+
"data-checked": checked || void 0,
|
|
45
|
+
"aria-selected": checked,
|
|
46
|
+
active: checked,
|
|
47
|
+
styles: (theme) => ({
|
|
48
|
+
option: {
|
|
49
|
+
"&:hover": {
|
|
50
|
+
backgroundColor: theme.colors.carbon[3]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
children: typeof renderOption === "function" ? renderOption({ option: data, checked }) : defaultContent
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const options = data.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
+
Option,
|
|
60
|
+
{
|
|
61
|
+
data: item,
|
|
62
|
+
value,
|
|
63
|
+
unstyled,
|
|
64
|
+
withCheckIcon,
|
|
65
|
+
checkIconPosition,
|
|
66
|
+
renderOption
|
|
67
|
+
},
|
|
68
|
+
item.value
|
|
69
|
+
));
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Combobox.Combobox.Group, { label: data.group, children: options });
|
|
71
|
+
};
|
|
72
|
+
const defaultProps = {
|
|
73
|
+
maxValues: Infinity,
|
|
74
|
+
withCheckIcon: true,
|
|
75
|
+
checkIconPosition: "left",
|
|
76
|
+
hiddenInputValuesDivider: ","
|
|
77
|
+
};
|
|
78
|
+
const ProMultiSelect = (_props) => {
|
|
79
|
+
const props = useProps.useProps("MultiSelect", defaultProps, _props);
|
|
80
|
+
const {
|
|
81
|
+
data,
|
|
82
|
+
value,
|
|
83
|
+
defaultValue,
|
|
84
|
+
limit,
|
|
85
|
+
searchable,
|
|
86
|
+
searchValue,
|
|
87
|
+
defaultSearchValue,
|
|
88
|
+
maxValues,
|
|
89
|
+
readOnly,
|
|
90
|
+
disabled,
|
|
91
|
+
size,
|
|
92
|
+
width,
|
|
93
|
+
selectFirstOptionOnChange,
|
|
94
|
+
placeholder,
|
|
95
|
+
clearable,
|
|
96
|
+
label,
|
|
97
|
+
nothingFoundMessage,
|
|
98
|
+
dropdownOpened,
|
|
99
|
+
defaultDropdownOpened,
|
|
100
|
+
loading,
|
|
101
|
+
maxDropdownHeight,
|
|
102
|
+
error,
|
|
103
|
+
onOptionSubmit,
|
|
104
|
+
renderOption,
|
|
105
|
+
filter,
|
|
106
|
+
onChange,
|
|
107
|
+
onSearchChange,
|
|
108
|
+
onRemove,
|
|
109
|
+
onClear
|
|
110
|
+
} = props;
|
|
111
|
+
const theme = MantineThemeProvider.useMantineTheme();
|
|
112
|
+
const combobox = useCombobox.useCombobox({
|
|
113
|
+
opened: dropdownOpened,
|
|
114
|
+
defaultOpened: defaultDropdownOpened,
|
|
115
|
+
onDropdownClose: () => {
|
|
116
|
+
combobox.resetSelectedOption();
|
|
117
|
+
setSearchValue("");
|
|
118
|
+
},
|
|
119
|
+
onDropdownOpen: () => {
|
|
120
|
+
combobox.focusSearchInput();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const [_value, setValue] = useUncontrolled.useUncontrolled({
|
|
124
|
+
value,
|
|
125
|
+
defaultValue,
|
|
126
|
+
finalValue: [],
|
|
127
|
+
onChange
|
|
128
|
+
});
|
|
129
|
+
const [_searchValue, setSearchValue] = useUncontrolled.useUncontrolled({
|
|
130
|
+
value: searchValue,
|
|
131
|
+
defaultValue: defaultSearchValue,
|
|
132
|
+
finalValue: "",
|
|
133
|
+
onChange: onSearchChange
|
|
134
|
+
});
|
|
135
|
+
const parsedData = getParsedComboboxData.getParsedComboboxData(data);
|
|
136
|
+
const optionsLockup = getOptionsLockup.getOptionsLockup(parsedData);
|
|
137
|
+
const shouldFilter = typeof _searchValue === "string";
|
|
138
|
+
const filteredData = shouldFilter ? (filter || defaultOptionsFilter.defaultOptionsFilter)({
|
|
139
|
+
options: parsedData,
|
|
140
|
+
search: searchable ? _searchValue : "",
|
|
141
|
+
limit: limit ?? Infinity
|
|
142
|
+
}) : parsedData;
|
|
143
|
+
const [targetIndex, setTargetIndex] = React.useState(0);
|
|
144
|
+
const hideCount = _value.length - targetIndex - 1;
|
|
145
|
+
const values = _value.map((item, index2) => {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
148
|
+
Pill.Pill,
|
|
149
|
+
{
|
|
150
|
+
withRemoveButton: !readOnly && !((_a = optionsLockup[item]) == null ? void 0 : _a.disabled),
|
|
151
|
+
onRemove: () => {
|
|
152
|
+
setValue(_value.filter((i) => item !== i));
|
|
153
|
+
onRemove == null ? void 0 : onRemove(item);
|
|
154
|
+
},
|
|
155
|
+
disabled,
|
|
156
|
+
styles: (theme2) => ({ root: { backgroundColor: theme2.colors.carbon[3], borderRadius: theme2.radius.sm } }),
|
|
157
|
+
sx: { position: "relative" },
|
|
158
|
+
children: [
|
|
159
|
+
((_b = optionsLockup[item]) == null ? void 0 : _b.label) || item,
|
|
160
|
+
targetIndex === index2 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
161
|
+
Pill.Pill,
|
|
162
|
+
{
|
|
163
|
+
styles: (theme2) => ({
|
|
164
|
+
root: { backgroundColor: theme2.colors.carbon[3], borderRadius: theme2.radius.sm, padding: "0 5px" }
|
|
165
|
+
}),
|
|
166
|
+
sx: { position: "absolute", right: 0, transform: "translateX(calc(100% + 8px))" },
|
|
167
|
+
children: [
|
|
168
|
+
"+",
|
|
169
|
+
hideCount
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
`${item}-${index2}`
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
const inputRef = React.useRef(null);
|
|
179
|
+
React.useLayoutEffect(() => {
|
|
180
|
+
var _a;
|
|
181
|
+
const child = (_a = inputRef.current) == null ? void 0 : _a.children;
|
|
182
|
+
if (!child || (child == null ? void 0 : child.length) === 0) return;
|
|
183
|
+
const index2 = Array.from(child).findIndex((child2) => child2.offsetTop > 20);
|
|
184
|
+
setTargetIndex(index2 - 1);
|
|
185
|
+
}, [values]);
|
|
186
|
+
const options = filteredData == null ? void 0 : filteredData.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
187
|
+
Option,
|
|
188
|
+
{
|
|
189
|
+
data: item,
|
|
190
|
+
value: _value,
|
|
191
|
+
unstyled: false,
|
|
192
|
+
withCheckIcon: true,
|
|
193
|
+
checkIconPosition: "left",
|
|
194
|
+
renderOption
|
|
195
|
+
},
|
|
196
|
+
isOptionsGroup.isOptionsGroup(item) ? item.group : item.value
|
|
197
|
+
));
|
|
198
|
+
const handleOptionSubmit = (val) => {
|
|
199
|
+
onOptionSubmit == null ? void 0 : onOptionSubmit(val);
|
|
200
|
+
setSearchValue("");
|
|
201
|
+
combobox.updateSelectedOptionIndex("selected");
|
|
202
|
+
if (_value.includes(optionsLockup[val].value)) {
|
|
203
|
+
setValue(_value.filter((v) => v !== optionsLockup[val].value));
|
|
204
|
+
onRemove == null ? void 0 : onRemove(optionsLockup[val].value);
|
|
205
|
+
} else if (_value.length < maxValues) {
|
|
206
|
+
setValue([..._value, optionsLockup[val].value]);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const clearButton = /* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
+
Combobox.Combobox.ClearButton,
|
|
211
|
+
{
|
|
212
|
+
onClear: () => {
|
|
213
|
+
onClear == null ? void 0 : onClear();
|
|
214
|
+
setValue([]);
|
|
215
|
+
setSearchValue("");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
const _clearable = clearable && _value.length > 0 && !disabled && !readOnly;
|
|
220
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
221
|
+
Combobox.Combobox,
|
|
222
|
+
{
|
|
223
|
+
store: combobox,
|
|
224
|
+
withinPortal: true,
|
|
225
|
+
size,
|
|
226
|
+
readOnly,
|
|
227
|
+
onOptionSubmit: handleOptionSubmit,
|
|
228
|
+
shadow: "sm",
|
|
229
|
+
styles: {
|
|
230
|
+
search: {
|
|
231
|
+
borderRadius: theme.radius.md
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx(Combobox.Combobox.Target, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
236
|
+
InputBase.InputBase,
|
|
237
|
+
{
|
|
238
|
+
error,
|
|
239
|
+
w: width,
|
|
240
|
+
component: "button",
|
|
241
|
+
type: "button",
|
|
242
|
+
pointer: true,
|
|
243
|
+
disabled: disabled || loading,
|
|
244
|
+
rightSection: loading ? /* @__PURE__ */ jsxRuntime.jsx(Loader.Loader, { size: "sm" }) : _clearable ? clearButton : /* @__PURE__ */ jsxRuntime.jsx(Combobox.Combobox.Chevron, {}),
|
|
245
|
+
label,
|
|
246
|
+
styles: {
|
|
247
|
+
label: { color: theme.colors.carbon[8], marginBottom: 6, fontSize: 14, lineHeight: "20px" },
|
|
248
|
+
description: { color: theme.colors.carbon[6] },
|
|
249
|
+
error: { color: theme.colors.red[7] }
|
|
250
|
+
},
|
|
251
|
+
rightSectionPointerEvents: value === null ? "none" : "all",
|
|
252
|
+
onClick: () => combobox.toggleDropdown(),
|
|
253
|
+
children: [
|
|
254
|
+
_value.length === 0 && !!placeholder && /* @__PURE__ */ jsxRuntime.jsx(Input.Input.Placeholder, { children: placeholder }),
|
|
255
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
256
|
+
Pill.Pill.Group,
|
|
257
|
+
{
|
|
258
|
+
ref: inputRef,
|
|
259
|
+
mah: 22,
|
|
260
|
+
sx: {
|
|
261
|
+
flexWrap: "wrap",
|
|
262
|
+
overflowY: "clip",
|
|
263
|
+
maxWidth: `calc(100% - ${(hideCount.toString().length + 2) * 8}px)`
|
|
264
|
+
},
|
|
265
|
+
children: values
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
) }),
|
|
271
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Combobox.Combobox.Dropdown, { children: [
|
|
272
|
+
searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
273
|
+
Combobox.Combobox.Search,
|
|
274
|
+
{
|
|
275
|
+
leftSection: /* @__PURE__ */ jsxRuntime.jsx(index.IconSearchLg, { size: 16, c: "gray.9", strokeWidth: 2 }),
|
|
276
|
+
value: _searchValue,
|
|
277
|
+
onChange: (event) => {
|
|
278
|
+
setSearchValue(event.currentTarget.value);
|
|
279
|
+
searchable && combobox.openDropdown();
|
|
280
|
+
selectFirstOptionOnChange && combobox.selectFirstOption();
|
|
281
|
+
},
|
|
282
|
+
placeholder: "Find"
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea.ScrollArea.Autosize, { type: "scroll", mah: maxDropdownHeight ?? 200, children: /* @__PURE__ */ jsxRuntime.jsx(Combobox.Combobox.Options, { children: options.length > 0 ? options : /* @__PURE__ */ jsxRuntime.jsx(Combobox.Combobox.Empty, { children: nothingFoundMessage || "Nothing found" }) }) })
|
|
286
|
+
] })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
exports.ProMultiSelect = ProMultiSelect;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MultiSelectProps } from '../../primitive/index.cjs';
|
|
3
|
+
export interface ProMultiSelectProps extends Pick<MultiSelectProps, 'data' | 'value' | 'defaultValue' | 'limit' | 'searchable' | 'searchValue' | 'defaultSearchValue' | 'maxValues' | 'readOnly' | 'disabled' | 'size' | 'width' | 'selectFirstOptionOnChange' | 'placeholder' | 'clearable' | 'label' | 'nothingFoundMessage' | 'dropdownOpened' | 'defaultDropdownOpened' | 'maxDropdownHeight' | 'error' | 'onOptionSubmit' | 'renderOption' | 'filter' | 'onChange' | 'onSearchChange' | 'onRemove' | 'onClear'> {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ProMultiSelect: React.FC<ProMultiSelectProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MultiSelectProps } from '../../primitive/index.mjs';
|
|
3
|
+
export interface ProMultiSelectProps extends Pick<MultiSelectProps, 'data' | 'value' | 'defaultValue' | 'limit' | 'searchable' | 'searchValue' | 'defaultSearchValue' | 'maxValues' | 'readOnly' | 'disabled' | 'size' | 'width' | 'selectFirstOptionOnChange' | 'placeholder' | 'clearable' | 'label' | 'nothingFoundMessage' | 'dropdownOpened' | 'defaultDropdownOpened' | 'maxDropdownHeight' | 'error' | 'onOptionSubmit' | 'renderOption' | 'filter' | 'onChange' | 'onSearchChange' | 'onRemove' | 'onClear'> {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const ProMultiSelect: React.FC<ProMultiSelectProps>;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useLayoutEffect } from "react";
|
|
3
|
+
import { IconSearchLg } from "../../icons/index.mjs";
|
|
4
|
+
/* empty css */
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { isValueChecked } from "./helper.mjs";
|
|
10
|
+
import { useProps } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.mjs";
|
|
11
|
+
import { useMantineTheme } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs";
|
|
12
|
+
import { useCombobox } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/use-combobox/use-combobox.mjs";
|
|
13
|
+
import { useUncontrolled } from "../../node_modules/.pnpm/@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-uncontrolled/use-uncontrolled.mjs";
|
|
14
|
+
import { getParsedComboboxData } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-parsed-combobox-data/get-parsed-combobox-data.mjs";
|
|
15
|
+
import { getOptionsLockup } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-options-lockup/get-options-lockup.mjs";
|
|
16
|
+
import { defaultOptionsFilter } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/default-options-filter.mjs";
|
|
17
|
+
import { Pill } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Pill/Pill.mjs";
|
|
18
|
+
import { isOptionsGroup } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/is-options-group.mjs";
|
|
19
|
+
import { Combobox } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/Combobox.mjs";
|
|
20
|
+
import { InputBase } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/InputBase/InputBase.mjs";
|
|
21
|
+
import { Loader } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Loader/Loader.mjs";
|
|
22
|
+
import { Input } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Input/Input.mjs";
|
|
23
|
+
import { ScrollArea } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.mjs";
|
|
24
|
+
import { Group } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Group/Group.mjs";
|
|
25
|
+
import { Box } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/Box/Box.mjs";
|
|
26
|
+
import { Checkbox } from "../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.mjs";
|
|
27
|
+
const Option = ({ data, withCheckIcon, value, checkIconPosition, unstyled, renderOption }) => {
|
|
28
|
+
if (!isOptionsGroup(data)) {
|
|
29
|
+
const checked = isValueChecked(value, data.value);
|
|
30
|
+
const check = withCheckIcon && /* @__PURE__ */ jsx(Checkbox, { size: "xs", checked });
|
|
31
|
+
const defaultContent = /* @__PURE__ */ jsxs(Group, { children: [
|
|
32
|
+
checkIconPosition === "left" && check,
|
|
33
|
+
/* @__PURE__ */ jsx(Box, { sx: { flex: 1 }, children: data.label }),
|
|
34
|
+
checkIconPosition === "right" && check
|
|
35
|
+
] });
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Combobox.Option,
|
|
38
|
+
{
|
|
39
|
+
value: data.value,
|
|
40
|
+
disabled: data.disabled,
|
|
41
|
+
"data-reverse": checkIconPosition === "right" || void 0,
|
|
42
|
+
"data-checked": checked || void 0,
|
|
43
|
+
"aria-selected": checked,
|
|
44
|
+
active: checked,
|
|
45
|
+
styles: (theme) => ({
|
|
46
|
+
option: {
|
|
47
|
+
"&:hover": {
|
|
48
|
+
backgroundColor: theme.colors.carbon[3]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
children: typeof renderOption === "function" ? renderOption({ option: data, checked }) : defaultContent
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
const options = data.items.map((item) => /* @__PURE__ */ jsx(
|
|
57
|
+
Option,
|
|
58
|
+
{
|
|
59
|
+
data: item,
|
|
60
|
+
value,
|
|
61
|
+
unstyled,
|
|
62
|
+
withCheckIcon,
|
|
63
|
+
checkIconPosition,
|
|
64
|
+
renderOption
|
|
65
|
+
},
|
|
66
|
+
item.value
|
|
67
|
+
));
|
|
68
|
+
return /* @__PURE__ */ jsx(Combobox.Group, { label: data.group, children: options });
|
|
69
|
+
};
|
|
70
|
+
const defaultProps = {
|
|
71
|
+
maxValues: Infinity,
|
|
72
|
+
withCheckIcon: true,
|
|
73
|
+
checkIconPosition: "left",
|
|
74
|
+
hiddenInputValuesDivider: ","
|
|
75
|
+
};
|
|
76
|
+
const ProMultiSelect = (_props) => {
|
|
77
|
+
const props = useProps("MultiSelect", defaultProps, _props);
|
|
78
|
+
const {
|
|
79
|
+
data,
|
|
80
|
+
value,
|
|
81
|
+
defaultValue,
|
|
82
|
+
limit,
|
|
83
|
+
searchable,
|
|
84
|
+
searchValue,
|
|
85
|
+
defaultSearchValue,
|
|
86
|
+
maxValues,
|
|
87
|
+
readOnly,
|
|
88
|
+
disabled,
|
|
89
|
+
size,
|
|
90
|
+
width,
|
|
91
|
+
selectFirstOptionOnChange,
|
|
92
|
+
placeholder,
|
|
93
|
+
clearable,
|
|
94
|
+
label,
|
|
95
|
+
nothingFoundMessage,
|
|
96
|
+
dropdownOpened,
|
|
97
|
+
defaultDropdownOpened,
|
|
98
|
+
loading,
|
|
99
|
+
maxDropdownHeight,
|
|
100
|
+
error,
|
|
101
|
+
onOptionSubmit,
|
|
102
|
+
renderOption,
|
|
103
|
+
filter,
|
|
104
|
+
onChange,
|
|
105
|
+
onSearchChange,
|
|
106
|
+
onRemove,
|
|
107
|
+
onClear
|
|
108
|
+
} = props;
|
|
109
|
+
const theme = useMantineTheme();
|
|
110
|
+
const combobox = useCombobox({
|
|
111
|
+
opened: dropdownOpened,
|
|
112
|
+
defaultOpened: defaultDropdownOpened,
|
|
113
|
+
onDropdownClose: () => {
|
|
114
|
+
combobox.resetSelectedOption();
|
|
115
|
+
setSearchValue("");
|
|
116
|
+
},
|
|
117
|
+
onDropdownOpen: () => {
|
|
118
|
+
combobox.focusSearchInput();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const [_value, setValue] = useUncontrolled({
|
|
122
|
+
value,
|
|
123
|
+
defaultValue,
|
|
124
|
+
finalValue: [],
|
|
125
|
+
onChange
|
|
126
|
+
});
|
|
127
|
+
const [_searchValue, setSearchValue] = useUncontrolled({
|
|
128
|
+
value: searchValue,
|
|
129
|
+
defaultValue: defaultSearchValue,
|
|
130
|
+
finalValue: "",
|
|
131
|
+
onChange: onSearchChange
|
|
132
|
+
});
|
|
133
|
+
const parsedData = getParsedComboboxData(data);
|
|
134
|
+
const optionsLockup = getOptionsLockup(parsedData);
|
|
135
|
+
const shouldFilter = typeof _searchValue === "string";
|
|
136
|
+
const filteredData = shouldFilter ? (filter || defaultOptionsFilter)({
|
|
137
|
+
options: parsedData,
|
|
138
|
+
search: searchable ? _searchValue : "",
|
|
139
|
+
limit: limit ?? Infinity
|
|
140
|
+
}) : parsedData;
|
|
141
|
+
const [targetIndex, setTargetIndex] = useState(0);
|
|
142
|
+
const hideCount = _value.length - targetIndex - 1;
|
|
143
|
+
const values = _value.map((item, index) => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
return /* @__PURE__ */ jsxs(
|
|
146
|
+
Pill,
|
|
147
|
+
{
|
|
148
|
+
withRemoveButton: !readOnly && !((_a = optionsLockup[item]) == null ? void 0 : _a.disabled),
|
|
149
|
+
onRemove: () => {
|
|
150
|
+
setValue(_value.filter((i) => item !== i));
|
|
151
|
+
onRemove == null ? void 0 : onRemove(item);
|
|
152
|
+
},
|
|
153
|
+
disabled,
|
|
154
|
+
styles: (theme2) => ({ root: { backgroundColor: theme2.colors.carbon[3], borderRadius: theme2.radius.sm } }),
|
|
155
|
+
sx: { position: "relative" },
|
|
156
|
+
children: [
|
|
157
|
+
((_b = optionsLockup[item]) == null ? void 0 : _b.label) || item,
|
|
158
|
+
targetIndex === index && /* @__PURE__ */ jsxs(
|
|
159
|
+
Pill,
|
|
160
|
+
{
|
|
161
|
+
styles: (theme2) => ({
|
|
162
|
+
root: { backgroundColor: theme2.colors.carbon[3], borderRadius: theme2.radius.sm, padding: "0 5px" }
|
|
163
|
+
}),
|
|
164
|
+
sx: { position: "absolute", right: 0, transform: "translateX(calc(100% + 8px))" },
|
|
165
|
+
children: [
|
|
166
|
+
"+",
|
|
167
|
+
hideCount
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
`${item}-${index}`
|
|
174
|
+
);
|
|
175
|
+
});
|
|
176
|
+
const inputRef = useRef(null);
|
|
177
|
+
useLayoutEffect(() => {
|
|
178
|
+
var _a;
|
|
179
|
+
const child = (_a = inputRef.current) == null ? void 0 : _a.children;
|
|
180
|
+
if (!child || (child == null ? void 0 : child.length) === 0) return;
|
|
181
|
+
const index = Array.from(child).findIndex((child2) => child2.offsetTop > 20);
|
|
182
|
+
setTargetIndex(index - 1);
|
|
183
|
+
}, [values]);
|
|
184
|
+
const options = filteredData == null ? void 0 : filteredData.map((item) => /* @__PURE__ */ jsx(
|
|
185
|
+
Option,
|
|
186
|
+
{
|
|
187
|
+
data: item,
|
|
188
|
+
value: _value,
|
|
189
|
+
unstyled: false,
|
|
190
|
+
withCheckIcon: true,
|
|
191
|
+
checkIconPosition: "left",
|
|
192
|
+
renderOption
|
|
193
|
+
},
|
|
194
|
+
isOptionsGroup(item) ? item.group : item.value
|
|
195
|
+
));
|
|
196
|
+
const handleOptionSubmit = (val) => {
|
|
197
|
+
onOptionSubmit == null ? void 0 : onOptionSubmit(val);
|
|
198
|
+
setSearchValue("");
|
|
199
|
+
combobox.updateSelectedOptionIndex("selected");
|
|
200
|
+
if (_value.includes(optionsLockup[val].value)) {
|
|
201
|
+
setValue(_value.filter((v) => v !== optionsLockup[val].value));
|
|
202
|
+
onRemove == null ? void 0 : onRemove(optionsLockup[val].value);
|
|
203
|
+
} else if (_value.length < maxValues) {
|
|
204
|
+
setValue([..._value, optionsLockup[val].value]);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const clearButton = /* @__PURE__ */ jsx(
|
|
208
|
+
Combobox.ClearButton,
|
|
209
|
+
{
|
|
210
|
+
onClear: () => {
|
|
211
|
+
onClear == null ? void 0 : onClear();
|
|
212
|
+
setValue([]);
|
|
213
|
+
setSearchValue("");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
const _clearable = clearable && _value.length > 0 && !disabled && !readOnly;
|
|
218
|
+
return /* @__PURE__ */ jsxs(
|
|
219
|
+
Combobox,
|
|
220
|
+
{
|
|
221
|
+
store: combobox,
|
|
222
|
+
withinPortal: true,
|
|
223
|
+
size,
|
|
224
|
+
readOnly,
|
|
225
|
+
onOptionSubmit: handleOptionSubmit,
|
|
226
|
+
shadow: "sm",
|
|
227
|
+
styles: {
|
|
228
|
+
search: {
|
|
229
|
+
borderRadius: theme.radius.md
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ jsx(Combobox.Target, { children: /* @__PURE__ */ jsxs(
|
|
234
|
+
InputBase,
|
|
235
|
+
{
|
|
236
|
+
error,
|
|
237
|
+
w: width,
|
|
238
|
+
component: "button",
|
|
239
|
+
type: "button",
|
|
240
|
+
pointer: true,
|
|
241
|
+
disabled: disabled || loading,
|
|
242
|
+
rightSection: loading ? /* @__PURE__ */ jsx(Loader, { size: "sm" }) : _clearable ? clearButton : /* @__PURE__ */ jsx(Combobox.Chevron, {}),
|
|
243
|
+
label,
|
|
244
|
+
styles: {
|
|
245
|
+
label: { color: theme.colors.carbon[8], marginBottom: 6, fontSize: 14, lineHeight: "20px" },
|
|
246
|
+
description: { color: theme.colors.carbon[6] },
|
|
247
|
+
error: { color: theme.colors.red[7] }
|
|
248
|
+
},
|
|
249
|
+
rightSectionPointerEvents: value === null ? "none" : "all",
|
|
250
|
+
onClick: () => combobox.toggleDropdown(),
|
|
251
|
+
children: [
|
|
252
|
+
_value.length === 0 && !!placeholder && /* @__PURE__ */ jsx(Input.Placeholder, { children: placeholder }),
|
|
253
|
+
/* @__PURE__ */ jsx(
|
|
254
|
+
Pill.Group,
|
|
255
|
+
{
|
|
256
|
+
ref: inputRef,
|
|
257
|
+
mah: 22,
|
|
258
|
+
sx: {
|
|
259
|
+
flexWrap: "wrap",
|
|
260
|
+
overflowY: "clip",
|
|
261
|
+
maxWidth: `calc(100% - ${(hideCount.toString().length + 2) * 8}px)`
|
|
262
|
+
},
|
|
263
|
+
children: values
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
) }),
|
|
269
|
+
/* @__PURE__ */ jsxs(Combobox.Dropdown, { children: [
|
|
270
|
+
searchable && /* @__PURE__ */ jsx(
|
|
271
|
+
Combobox.Search,
|
|
272
|
+
{
|
|
273
|
+
leftSection: /* @__PURE__ */ jsx(IconSearchLg, { size: 16, c: "gray.9", strokeWidth: 2 }),
|
|
274
|
+
value: _searchValue,
|
|
275
|
+
onChange: (event) => {
|
|
276
|
+
setSearchValue(event.currentTarget.value);
|
|
277
|
+
searchable && combobox.openDropdown();
|
|
278
|
+
selectFirstOptionOnChange && combobox.selectFirstOption();
|
|
279
|
+
},
|
|
280
|
+
placeholder: "Find"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsx(ScrollArea.Autosize, { type: "scroll", mah: maxDropdownHeight ?? 200, children: /* @__PURE__ */ jsx(Combobox.Options, { children: options.length > 0 ? options : /* @__PURE__ */ jsx(Combobox.Empty, { children: nothingFoundMessage || "Nothing found" }) }) })
|
|
284
|
+
] })
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
};
|
|
289
|
+
export {
|
|
290
|
+
ProMultiSelect
|
|
291
|
+
};
|
package/dist/biz/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const index$9 = require("./PropertyCard/index.cjs");
|
|
|
12
12
|
const index$a = require("./PageShell/index.cjs");
|
|
13
13
|
const index$b = require("./TimeRangePicker/index.cjs");
|
|
14
14
|
const index$c = require("./DateTimePicker/index.cjs");
|
|
15
|
+
const index$d = require("./ProMultiSelect/index.cjs");
|
|
15
16
|
const helper = require("./PhoneInput/helper.cjs");
|
|
16
17
|
const index_esm = require("../node_modules/.pnpm/mantine-react-table@2.0.0-beta.7_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@_6pmziqsvipqgt5gv2plqw5hct4/node_modules/mantine-react-table/dist/index.esm.cjs");
|
|
17
18
|
const ProTable = require("./Table/ProTable/ProTable.cjs");
|
|
@@ -35,6 +36,7 @@ const Rating = require("./Form/Rating.cjs");
|
|
|
35
36
|
const context = require("./Form/context.cjs");
|
|
36
37
|
const CopyText = require("./Form/CopyText.cjs");
|
|
37
38
|
const SegmentControl = require("./Form/SegmentControl.cjs");
|
|
39
|
+
const ProMultiSelect = require("./Form/ProMultiSelect.cjs");
|
|
38
40
|
const helpers$1 = require("./TimeRangePicker/helpers.cjs");
|
|
39
41
|
exports.Dot = index.Dot;
|
|
40
42
|
exports.CodeBlock = index$1.CodeBlock;
|
|
@@ -50,6 +52,7 @@ exports.PropertyCard = index$9.PropertyCard;
|
|
|
50
52
|
exports.PageShell = index$a.PageShell;
|
|
51
53
|
exports.TimeRangePicker = index$b.TimeRangePicker;
|
|
52
54
|
exports.DateTimePicker = index$c.DateTimePicker;
|
|
55
|
+
exports.ProMultiSelect = index$d.ProMultiSelect;
|
|
53
56
|
exports.validPhoneNumber = helper.validPhoneNumber;
|
|
54
57
|
exports.MRT_AggregationFns = index_esm.MRT_AggregationFns;
|
|
55
58
|
exports.MRT_BottomToolbar = index_esm.MRT_BottomToolbar;
|
|
@@ -180,6 +183,7 @@ exports.HookFormProvider = context.HookFormProvider;
|
|
|
180
183
|
exports.useHookFormContext = context.useHookFormContext;
|
|
181
184
|
exports.FormCopyText = CopyText.FormCopyText;
|
|
182
185
|
exports.FormSegmentedControl = SegmentControl.FormSegmentedControl;
|
|
186
|
+
exports.FormProMultiSelect = ProMultiSelect.FormProMultiSelect;
|
|
183
187
|
exports.DEFAULT_QUICK_RANGES = helpers$1.DEFAULT_QUICK_RANGES;
|
|
184
188
|
exports.DEFAULT_TIME_FORMAT = helpers$1.DEFAULT_TIME_FORMAT;
|
|
185
189
|
exports.DEFAULT_TIME_FORMAT_WITH_TIMEZONE = helpers$1.DEFAULT_TIME_FORMAT_WITH_TIMEZONE;
|
package/dist/biz/index.d.cts
CHANGED
package/dist/biz/index.d.mts
CHANGED
package/dist/biz/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { PropertyCard } from "./PropertyCard/index.mjs";
|
|
|
10
10
|
import { PageShell } from "./PageShell/index.mjs";
|
|
11
11
|
import { TimeRangePicker } from "./TimeRangePicker/index.mjs";
|
|
12
12
|
import { DateTimePicker } from "./DateTimePicker/index.mjs";
|
|
13
|
+
import { ProMultiSelect } from "./ProMultiSelect/index.mjs";
|
|
13
14
|
import { validPhoneNumber } from "./PhoneInput/helper.mjs";
|
|
14
15
|
import { MRT_AggregationFns, MRT_BottomToolbar, MRT_ColumnActionMenu, MRT_ColumnPinningButtons, MRT_CopyButton, MRT_DefaultColumn, MRT_DefaultDisplayColumn, MRT_EditActionButtons, MRT_EditCellTextInput, MRT_EditRowModal, MRT_ExpandAllButton, MRT_ExpandButton, MRT_FilterCheckbox, MRT_FilterFns, MRT_FilterOptionMenu, MRT_FilterRangeFields, MRT_FilterRangeSlider, MRT_FilterTextInput, MRT_GlobalFilterTextInput, MRT_GrabHandleButton, MRT_ProgressBar, MRT_RowActionMenu, MRT_RowPinButton, MRT_SelectCheckbox, MRT_ShowHideColumnsButton, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, MRT_SortingFns, MRT_Table, MRT_TableBody, MRT_TableBodyCell, MRT_TableBodyCellValue, MRT_TableBodyRow, MRT_TableBodyRowGrabHandle, MRT_TableBodyRowPinButton, MRT_TableContainer, MRT_TableDetailPanel, MRT_TableFooter, MRT_TableFooterCell, MRT_TableFooterRow, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellFilterContainer, MRT_TableHeadCellFilterLabel, MRT_TableHeadCellGrabHandle, MRT_TableHeadCellResizeHandle, MRT_TableHeadCellSortLabel, MRT_TableHeadRow, MRT_TablePagination, MRT_TablePaper, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleFullScreenButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MantineReactTable, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, createMRTColumnHelper, createRow, dataVariable, defaultDisplayColumnProps, flexRender, getAllLeafColumnDefs, getCanRankRows, getColumnId, getDefaultColumnFilterFn, getDefaultColumnOrderIds, getIsRankingRows, getIsRowSelected, getLeadingDisplayColumnIds, getMRT_RowSelectionHandler, getMRT_Rows, getMRT_SelectAllHandler, getPrimaryColor, getPrimaryShade, getTrailingDisplayColumnIds, localizedFilterOption, mrtFilterOptions, parseCSSVarId, prepareColumns, rankGlobalFuzzy, reorderColumn, showRowActionsColumn, showRowDragColumn, showRowExpandColumn, showRowNumbersColumn, showRowPinningColumn, showRowSelectionColumn, showRowSpacerColumn, useMRT_ColumnVirtualizer, useMRT_Effects, useMRT_RowVirtualizer, useMRT_Rows, useMRT_TableInstance, useMRT_TableOptions, useMantineReactTable } from "../node_modules/.pnpm/mantine-react-table@2.0.0-beta.7_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@_6pmziqsvipqgt5gv2plqw5hct4/node_modules/mantine-react-table/dist/index.esm.mjs";
|
|
15
16
|
import { ProTable } from "./Table/ProTable/ProTable.mjs";
|
|
@@ -33,6 +34,7 @@ import { FormRatingInput } from "./Form/Rating.mjs";
|
|
|
33
34
|
import { HookFormContext, HookFormProvider, useHookFormContext } from "./Form/context.mjs";
|
|
34
35
|
import { FormCopyText } from "./Form/CopyText.mjs";
|
|
35
36
|
import { FormSegmentedControl } from "./Form/SegmentControl.mjs";
|
|
37
|
+
import { FormProMultiSelect } from "./Form/ProMultiSelect.mjs";
|
|
36
38
|
import { DEFAULT_QUICK_RANGES, DEFAULT_TIME_FORMAT, DEFAULT_TIME_FORMAT_WITH_TIMEZONE, DEFAULT_TIME_RANGE, addOffsetUTC, formatDuration, fromTimeRangeValue, getUTCString, timeFormatter, toTimeRangeValue, toURLTimeRange, urlToTimeRange, urlToTimeRangeValue } from "./TimeRangePicker/helpers.mjs";
|
|
37
39
|
export {
|
|
38
40
|
CodeBlock,
|
|
@@ -57,6 +59,7 @@ export {
|
|
|
57
59
|
FormPasswordInput,
|
|
58
60
|
FormPhoneInput,
|
|
59
61
|
FormPhoneInputV2,
|
|
62
|
+
FormProMultiSelect,
|
|
60
63
|
FormRadioGroup,
|
|
61
64
|
FormRatingInput,
|
|
62
65
|
FormSegmentedControl,
|
|
@@ -132,6 +135,7 @@ export {
|
|
|
132
135
|
Memo_MRT_TableBodyRow,
|
|
133
136
|
PageShell,
|
|
134
137
|
PhoneInput,
|
|
138
|
+
ProMultiSelect,
|
|
135
139
|
ProTable,
|
|
136
140
|
PropertyCard,
|
|
137
141
|
SearchArea,
|
package/dist/primitive/index.cjs
CHANGED
|
@@ -119,6 +119,11 @@ const useInputProps = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_
|
|
|
119
119
|
const MantineThemeProvider = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
|
|
120
120
|
const useCombobox = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/use-combobox/use-combobox.cjs");
|
|
121
121
|
const useComputedColorScheme = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.cjs");
|
|
122
|
+
const defaultOptionsFilter = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/default-options-filter.cjs");
|
|
123
|
+
const getOptionsLockup = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-options-lockup/get-options-lockup.cjs");
|
|
124
|
+
const getParsedComboboxData = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-parsed-combobox-data/get-parsed-combobox-data.cjs");
|
|
125
|
+
const isOptionsGroup = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/is-options-group.cjs");
|
|
126
|
+
const useProps = require("../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.cjs");
|
|
122
127
|
const TextInput = require("./TextInput/TextInput.cjs");
|
|
123
128
|
const mimeTypes = require("../node_modules/.pnpm/@mantine_dropzone@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine__hww35qmvzgxt6vzp3w3turt5w4/node_modules/@mantine/dropzone/esm/mime-types.cjs");
|
|
124
129
|
const Carousel = require("../node_modules/.pnpm/@mantine_carousel@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine__yuzhxl33yngzjan47b6grrovcu/node_modules/@mantine/carousel/esm/Carousel.cjs");
|
|
@@ -248,6 +253,11 @@ exports.useInputProps = useInputProps.useInputProps;
|
|
|
248
253
|
exports.useMantineTheme = MantineThemeProvider.useMantineTheme;
|
|
249
254
|
exports.useCombobox = useCombobox.useCombobox;
|
|
250
255
|
exports.useComputedColorScheme = useComputedColorScheme.useComputedColorScheme;
|
|
256
|
+
exports.defaultOptionsFilter = defaultOptionsFilter.defaultOptionsFilter;
|
|
257
|
+
exports.getOptionsLockup = getOptionsLockup.getOptionsLockup;
|
|
258
|
+
exports.getParsedComboboxData = getParsedComboboxData.getParsedComboboxData;
|
|
259
|
+
exports.isOptionsGroup = isOptionsGroup.isOptionsGroup;
|
|
260
|
+
exports.useProps = useProps.useProps;
|
|
251
261
|
exports.TextInput = TextInput.TextInput;
|
|
252
262
|
exports.EXE_MIME_TYPE = mimeTypes.EXE_MIME_TYPE;
|
|
253
263
|
exports.IMAGE_MIME_TYPE = mimeTypes.IMAGE_MIME_TYPE;
|
|
@@ -29,8 +29,8 @@ declare module '@mantine/core' {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
export type ColorScheme = 'light' | 'dark';
|
|
32
|
-
export type { AppShellProps, AppShellNavbarProps, AppShellMainProps, AppShellFooterProps, AppShellAsideProps, AppShellHeaderProps, AppShellSectionProps, AspectRatioProps, CenterProps, ContainerProps, FlexProps, GridProps, GroupProps, SimpleGridProps, SpaceProps, StackProps, CheckboxProps, CheckboxGroupProps, ChipProps, ChipGroupProps, ColorInputProps, ColorPickerProps, FieldsetProps, FileInputProps, InputProps, InputWrapperProps, InputErrorProps, InputLabelProps, InputPlaceholderProps, InputBaseProps, JsonInputProps, NativeSelectProps, NumberInputProps, PasswordInputProps, PinInputProps, RadioProps, RadioGroupProps, RadioCardProps, RatingProps, SegmentedControlProps, SegmentedControlItem, SliderProps, RangeSliderProps, SwitchProps, TextareaProps, AutocompleteProps, ComboboxProps, ComboboxItem, ComboboxData, PillProps, PillsInputProps, OptionsFilter, TagsInputProps, ActionIconProps, ButtonProps, CloseButtonProps, CopyButtonProps, FileButtonProps, UnstyledButtonProps, AnchorProps, BreadcrumbsProps, BurgerProps, NavLinkProps, PaginationProps, StepperProps, TabsProps, TreeProps, AlertProps, LoaderProps, NotificationProps, ProgressProps, RingProgressProps, SemiCircleProgressProps, SkeletonProps, AffixProps, DialogProps, DrawerProps, FloatingIndicatorProps, HoverCardProps, LoadingOverlayProps, MenuProps, ModalProps, OverlayProps, PopoverProps, TooltipProps, AccordionProps, AvatarProps, BackgroundImageProps, BadgeProps, CardProps, CardSectionProps, ColorSwatchProps, ImageProps, IndicatorProps, KbdProps, NumberFormatterProps, SpoilerProps, ThemeIconProps, TimelineProps, BlockquoteProps, CodeProps, HighlightProps, ListProps, MarkProps, TableProps, TextProps, TitleProps, TypographyStylesProviderProps, BoxProps, CollapseProps, DividerProps, FocusTrapProps, PaperProps, PortalProps, ScrollAreaProps, TransitionProps, VisuallyHiddenProps, ColorSchemeScriptProps, MantineSize, ElementProps } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
33
|
-
export { AppShell, AspectRatio, Center, Container, Flex, Grid, Group, SimpleGrid, Space, Stack, Checkbox, Chip, ColorInput, ColorPicker, HueSlider, AlphaSlider, Fieldset, FileInput, Input, InputBase, JsonInput, NativeSelect, NumberInput, PasswordInput, PinInput, Radio, RadioGroup, RadioCard, Rating, SegmentedControl, Slider, RangeSlider, Switch, Textarea, Autocomplete, Combobox, Pill, PillsInput, TagsInput, ActionIcon, CloseButton, FileButton, UnstyledButton, Anchor, Breadcrumbs, Burger, NavLink, Pagination, Stepper, Tabs, Tree, Alert, Loader, Notification, Progress, RingProgress, SemiCircleProgress, Skeleton, Affix, Dialog, Drawer, FloatingIndicator, HoverCard, LoadingOverlay, Menu, Modal, Overlay, Popover, Tooltip, Accordion, Avatar, BackgroundImage, Badge, Card, ColorSwatch, Image, Indicator, Kbd, NumberFormatter, Spoiler, ThemeIcon, Timeline, Blockquote, Code, Highlight, List, Mark, Table, Text, Title, TypographyStylesProvider, Box, Collapse, Divider, FocusTrap, Paper, Portal, ScrollArea, Transition, VisuallyHidden, ColorSchemeScript, useInputProps, useMantineTheme, useCombobox, useComputedColorScheme } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
32
|
+
export type { AppShellProps, AppShellNavbarProps, AppShellMainProps, AppShellFooterProps, AppShellAsideProps, AppShellHeaderProps, AppShellSectionProps, AspectRatioProps, CenterProps, ContainerProps, FlexProps, GridProps, GroupProps, SimpleGridProps, SpaceProps, StackProps, CheckboxProps, CheckboxGroupProps, ChipProps, ChipGroupProps, ColorInputProps, ColorPickerProps, FieldsetProps, FileInputProps, InputProps, InputWrapperProps, InputErrorProps, InputLabelProps, InputPlaceholderProps, InputBaseProps, JsonInputProps, NativeSelectProps, NumberInputProps, PasswordInputProps, PinInputProps, RadioProps, RadioGroupProps, RadioCardProps, RatingProps, SegmentedControlProps, SegmentedControlItem, SliderProps, RangeSliderProps, SwitchProps, TextareaProps, AutocompleteProps, ComboboxProps, ComboboxItem, ComboboxData, PillProps, PillsInputProps, OptionsFilter, TagsInputProps, ActionIconProps, ButtonProps, CloseButtonProps, CopyButtonProps, FileButtonProps, UnstyledButtonProps, AnchorProps, BreadcrumbsProps, BurgerProps, NavLinkProps, PaginationProps, StepperProps, TabsProps, TreeProps, AlertProps, LoaderProps, NotificationProps, ProgressProps, RingProgressProps, SemiCircleProgressProps, SkeletonProps, AffixProps, DialogProps, DrawerProps, FloatingIndicatorProps, HoverCardProps, LoadingOverlayProps, MenuProps, ModalProps, OverlayProps, PopoverProps, TooltipProps, AccordionProps, AvatarProps, BackgroundImageProps, BadgeProps, CardProps, CardSectionProps, ColorSwatchProps, ImageProps, IndicatorProps, KbdProps, NumberFormatterProps, SpoilerProps, ThemeIconProps, TimelineProps, BlockquoteProps, CodeProps, HighlightProps, ListProps, MarkProps, TableProps, TextProps, TitleProps, TypographyStylesProviderProps, BoxProps, CollapseProps, DividerProps, FocusTrapProps, PaperProps, PortalProps, ScrollAreaProps, TransitionProps, VisuallyHiddenProps, ColorSchemeScriptProps, MantineSize, ElementProps, OptionsData } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
33
|
+
export { AppShell, AspectRatio, Center, Container, Flex, Grid, Group, SimpleGrid, Space, Stack, Checkbox, Chip, ColorInput, ColorPicker, HueSlider, AlphaSlider, Fieldset, FileInput, Input, InputBase, JsonInput, NativeSelect, NumberInput, PasswordInput, PinInput, Radio, RadioGroup, RadioCard, Rating, SegmentedControl, Slider, RangeSlider, Switch, Textarea, Autocomplete, Combobox, Pill, PillsInput, TagsInput, ActionIcon, CloseButton, FileButton, UnstyledButton, Anchor, Breadcrumbs, Burger, NavLink, Pagination, Stepper, Tabs, Tree, Alert, Loader, Notification, Progress, RingProgress, SemiCircleProgress, Skeleton, Affix, Dialog, Drawer, FloatingIndicator, HoverCard, LoadingOverlay, Menu, Modal, Overlay, Popover, Tooltip, Accordion, Avatar, BackgroundImage, Badge, Card, ColorSwatch, Image, Indicator, Kbd, NumberFormatter, Spoiler, ThemeIcon, Timeline, Blockquote, Code, Highlight, List, Mark, Table, Text, Title, TypographyStylesProvider, Box, Collapse, Divider, FocusTrap, Paper, Portal, ScrollArea, Transition, VisuallyHidden, ColorSchemeScript, useInputProps, useMantineTheme, useCombobox, useComputedColorScheme, defaultOptionsFilter, getOptionsLockup, getParsedComboboxData, isOptionsGroup, useProps } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
34
34
|
export { useColorScheme } from '../hooks/useColorScheme.cjs';
|
|
35
35
|
export { TextInput, type TextInputProps } from './TextInput/index.cjs';
|
|
36
36
|
export { notifier } from './notifier/index.cjs';
|
|
@@ -29,8 +29,8 @@ declare module '@mantine/core' {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
export type ColorScheme = 'light' | 'dark';
|
|
32
|
-
export type { AppShellProps, AppShellNavbarProps, AppShellMainProps, AppShellFooterProps, AppShellAsideProps, AppShellHeaderProps, AppShellSectionProps, AspectRatioProps, CenterProps, ContainerProps, FlexProps, GridProps, GroupProps, SimpleGridProps, SpaceProps, StackProps, CheckboxProps, CheckboxGroupProps, ChipProps, ChipGroupProps, ColorInputProps, ColorPickerProps, FieldsetProps, FileInputProps, InputProps, InputWrapperProps, InputErrorProps, InputLabelProps, InputPlaceholderProps, InputBaseProps, JsonInputProps, NativeSelectProps, NumberInputProps, PasswordInputProps, PinInputProps, RadioProps, RadioGroupProps, RadioCardProps, RatingProps, SegmentedControlProps, SegmentedControlItem, SliderProps, RangeSliderProps, SwitchProps, TextareaProps, AutocompleteProps, ComboboxProps, ComboboxItem, ComboboxData, PillProps, PillsInputProps, OptionsFilter, TagsInputProps, ActionIconProps, ButtonProps, CloseButtonProps, CopyButtonProps, FileButtonProps, UnstyledButtonProps, AnchorProps, BreadcrumbsProps, BurgerProps, NavLinkProps, PaginationProps, StepperProps, TabsProps, TreeProps, AlertProps, LoaderProps, NotificationProps, ProgressProps, RingProgressProps, SemiCircleProgressProps, SkeletonProps, AffixProps, DialogProps, DrawerProps, FloatingIndicatorProps, HoverCardProps, LoadingOverlayProps, MenuProps, ModalProps, OverlayProps, PopoverProps, TooltipProps, AccordionProps, AvatarProps, BackgroundImageProps, BadgeProps, CardProps, CardSectionProps, ColorSwatchProps, ImageProps, IndicatorProps, KbdProps, NumberFormatterProps, SpoilerProps, ThemeIconProps, TimelineProps, BlockquoteProps, CodeProps, HighlightProps, ListProps, MarkProps, TableProps, TextProps, TitleProps, TypographyStylesProviderProps, BoxProps, CollapseProps, DividerProps, FocusTrapProps, PaperProps, PortalProps, ScrollAreaProps, TransitionProps, VisuallyHiddenProps, ColorSchemeScriptProps, MantineSize, ElementProps } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
33
|
-
export { AppShell, AspectRatio, Center, Container, Flex, Grid, Group, SimpleGrid, Space, Stack, Checkbox, Chip, ColorInput, ColorPicker, HueSlider, AlphaSlider, Fieldset, FileInput, Input, InputBase, JsonInput, NativeSelect, NumberInput, PasswordInput, PinInput, Radio, RadioGroup, RadioCard, Rating, SegmentedControl, Slider, RangeSlider, Switch, Textarea, Autocomplete, Combobox, Pill, PillsInput, TagsInput, ActionIcon, CloseButton, FileButton, UnstyledButton, Anchor, Breadcrumbs, Burger, NavLink, Pagination, Stepper, Tabs, Tree, Alert, Loader, Notification, Progress, RingProgress, SemiCircleProgress, Skeleton, Affix, Dialog, Drawer, FloatingIndicator, HoverCard, LoadingOverlay, Menu, Modal, Overlay, Popover, Tooltip, Accordion, Avatar, BackgroundImage, Badge, Card, ColorSwatch, Image, Indicator, Kbd, NumberFormatter, Spoiler, ThemeIcon, Timeline, Blockquote, Code, Highlight, List, Mark, Table, Text, Title, TypographyStylesProvider, Box, Collapse, Divider, FocusTrap, Paper, Portal, ScrollArea, Transition, VisuallyHidden, ColorSchemeScript, useInputProps, useMantineTheme, useCombobox, useComputedColorScheme } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
32
|
+
export type { AppShellProps, AppShellNavbarProps, AppShellMainProps, AppShellFooterProps, AppShellAsideProps, AppShellHeaderProps, AppShellSectionProps, AspectRatioProps, CenterProps, ContainerProps, FlexProps, GridProps, GroupProps, SimpleGridProps, SpaceProps, StackProps, CheckboxProps, CheckboxGroupProps, ChipProps, ChipGroupProps, ColorInputProps, ColorPickerProps, FieldsetProps, FileInputProps, InputProps, InputWrapperProps, InputErrorProps, InputLabelProps, InputPlaceholderProps, InputBaseProps, JsonInputProps, NativeSelectProps, NumberInputProps, PasswordInputProps, PinInputProps, RadioProps, RadioGroupProps, RadioCardProps, RatingProps, SegmentedControlProps, SegmentedControlItem, SliderProps, RangeSliderProps, SwitchProps, TextareaProps, AutocompleteProps, ComboboxProps, ComboboxItem, ComboboxData, PillProps, PillsInputProps, OptionsFilter, TagsInputProps, ActionIconProps, ButtonProps, CloseButtonProps, CopyButtonProps, FileButtonProps, UnstyledButtonProps, AnchorProps, BreadcrumbsProps, BurgerProps, NavLinkProps, PaginationProps, StepperProps, TabsProps, TreeProps, AlertProps, LoaderProps, NotificationProps, ProgressProps, RingProgressProps, SemiCircleProgressProps, SkeletonProps, AffixProps, DialogProps, DrawerProps, FloatingIndicatorProps, HoverCardProps, LoadingOverlayProps, MenuProps, ModalProps, OverlayProps, PopoverProps, TooltipProps, AccordionProps, AvatarProps, BackgroundImageProps, BadgeProps, CardProps, CardSectionProps, ColorSwatchProps, ImageProps, IndicatorProps, KbdProps, NumberFormatterProps, SpoilerProps, ThemeIconProps, TimelineProps, BlockquoteProps, CodeProps, HighlightProps, ListProps, MarkProps, TableProps, TextProps, TitleProps, TypographyStylesProviderProps, BoxProps, CollapseProps, DividerProps, FocusTrapProps, PaperProps, PortalProps, ScrollAreaProps, TransitionProps, VisuallyHiddenProps, ColorSchemeScriptProps, MantineSize, ElementProps, OptionsData } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
33
|
+
export { AppShell, AspectRatio, Center, Container, Flex, Grid, Group, SimpleGrid, Space, Stack, Checkbox, Chip, ColorInput, ColorPicker, HueSlider, AlphaSlider, Fieldset, FileInput, Input, InputBase, JsonInput, NativeSelect, NumberInput, PasswordInput, PinInput, Radio, RadioGroup, RadioCard, Rating, SegmentedControl, Slider, RangeSlider, Switch, Textarea, Autocomplete, Combobox, Pill, PillsInput, TagsInput, ActionIcon, CloseButton, FileButton, UnstyledButton, Anchor, Breadcrumbs, Burger, NavLink, Pagination, Stepper, Tabs, Tree, Alert, Loader, Notification, Progress, RingProgress, SemiCircleProgress, Skeleton, Affix, Dialog, Drawer, FloatingIndicator, HoverCard, LoadingOverlay, Menu, Modal, Overlay, Popover, Tooltip, Accordion, Avatar, BackgroundImage, Badge, Card, ColorSwatch, Image, Indicator, Kbd, NumberFormatter, Spoiler, ThemeIcon, Timeline, Blockquote, Code, Highlight, List, Mark, Table, Text, Title, TypographyStylesProvider, Box, Collapse, Divider, FocusTrap, Paper, Portal, ScrollArea, Transition, VisuallyHidden, ColorSchemeScript, useInputProps, useMantineTheme, useCombobox, useComputedColorScheme, defaultOptionsFilter, getOptionsLockup, getParsedComboboxData, isOptionsGroup, useProps } from '../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_sx7emryda53tomnuogmu74guza/node_modules/@mantine/core/lib';
|
|
34
34
|
export { useColorScheme } from '../hooks/useColorScheme.mjs';
|
|
35
35
|
export { TextInput, type TextInputProps } from './TextInput/index.mjs';
|
|
36
36
|
export { notifier } from './notifier/index.mjs';
|
package/dist/primitive/index.mjs
CHANGED
|
@@ -117,6 +117,11 @@ import { useInputProps } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_
|
|
|
117
117
|
import { useMantineTheme } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs";
|
|
118
118
|
import { useCombobox } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/use-combobox/use-combobox.mjs";
|
|
119
119
|
import { useComputedColorScheme } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.mjs";
|
|
120
|
+
import { defaultOptionsFilter } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/default-options-filter.mjs";
|
|
121
|
+
import { getOptionsLockup } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-options-lockup/get-options-lockup.mjs";
|
|
122
|
+
import { getParsedComboboxData } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/get-parsed-combobox-data/get-parsed-combobox-data.mjs";
|
|
123
|
+
import { isOptionsGroup } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/is-options-group.mjs";
|
|
124
|
+
import { useProps } from "../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.mjs";
|
|
120
125
|
import { TextInput } from "./TextInput/TextInput.mjs";
|
|
121
126
|
import { EXE_MIME_TYPE, IMAGE_MIME_TYPE, MIME_TYPES, MS_EXCEL_MIME_TYPE, MS_POWERPOINT_MIME_TYPE, MS_WORD_MIME_TYPE, PDF_MIME_TYPE } from "../node_modules/.pnpm/@mantine_dropzone@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine__hww35qmvzgxt6vzp3w3turt5w4/node_modules/@mantine/dropzone/esm/mime-types.mjs";
|
|
122
127
|
import { Carousel } from "../node_modules/.pnpm/@mantine_carousel@7.15.2_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine__yuzhxl33yngzjan47b6grrovcu/node_modules/@mantine/carousel/esm/Carousel.mjs";
|
|
@@ -259,6 +264,10 @@ export {
|
|
|
259
264
|
VisuallyHidden,
|
|
260
265
|
closeAllModals,
|
|
261
266
|
closeModal,
|
|
267
|
+
defaultOptionsFilter,
|
|
268
|
+
getOptionsLockup,
|
|
269
|
+
getParsedComboboxData,
|
|
270
|
+
isOptionsGroup,
|
|
262
271
|
notifier,
|
|
263
272
|
openConfirmModal,
|
|
264
273
|
openContextModal,
|
|
@@ -269,5 +278,6 @@ export {
|
|
|
269
278
|
useComputedColorScheme,
|
|
270
279
|
useInputProps,
|
|
271
280
|
useMantineTheme,
|
|
272
|
-
useModals
|
|
281
|
+
useModals,
|
|
282
|
+
useProps
|
|
273
283
|
};
|
package/dist/theme/theme.cjs
CHANGED
|
@@ -394,34 +394,19 @@ const theme = createTheme.createTheme({
|
|
|
394
394
|
},
|
|
395
395
|
Menu: {
|
|
396
396
|
styles: (theme2) => {
|
|
397
|
-
const textColor = themeColor(theme2, "carbon", 8);
|
|
398
397
|
const bgHoverColor = themeColor(theme2, "carbon", 3);
|
|
399
398
|
const bgActiveColor = themeColor(theme2, "carbon", 4);
|
|
400
|
-
const disabledColor = themeColor(theme2, "carbon", 6);
|
|
401
399
|
return {
|
|
402
400
|
dropdown: {
|
|
403
401
|
boxShadow: theme2.shadows.md
|
|
404
402
|
},
|
|
405
403
|
item: {
|
|
406
404
|
transition: "background 150ms ease-in-out",
|
|
407
|
-
color: textColor,
|
|
408
405
|
"&:hover, &[data-hovered]": {
|
|
409
|
-
|
|
410
|
-
backgroundColor: bgHoverColor,
|
|
411
|
-
textDecoration: "none"
|
|
406
|
+
backgroundColor: bgHoverColor
|
|
412
407
|
},
|
|
413
408
|
"&:active, &[data-active]": {
|
|
414
|
-
color: textColor,
|
|
415
409
|
backgroundColor: bgActiveColor
|
|
416
|
-
},
|
|
417
|
-
"&:disabled, &[data-disabled]": {
|
|
418
|
-
color: disabledColor,
|
|
419
|
-
userSelect: "none",
|
|
420
|
-
cursor: "not-allowed",
|
|
421
|
-
"&:hover, &[data-hovered]": {
|
|
422
|
-
color: disabledColor,
|
|
423
|
-
backgroundColor: "transparent"
|
|
424
|
-
}
|
|
425
410
|
}
|
|
426
411
|
}
|
|
427
412
|
};
|
package/dist/theme/theme.mjs
CHANGED
|
@@ -392,34 +392,19 @@ const theme = createTheme({
|
|
|
392
392
|
},
|
|
393
393
|
Menu: {
|
|
394
394
|
styles: (theme2) => {
|
|
395
|
-
const textColor = themeColor(theme2, "carbon", 8);
|
|
396
395
|
const bgHoverColor = themeColor(theme2, "carbon", 3);
|
|
397
396
|
const bgActiveColor = themeColor(theme2, "carbon", 4);
|
|
398
|
-
const disabledColor = themeColor(theme2, "carbon", 6);
|
|
399
397
|
return {
|
|
400
398
|
dropdown: {
|
|
401
399
|
boxShadow: theme2.shadows.md
|
|
402
400
|
},
|
|
403
401
|
item: {
|
|
404
402
|
transition: "background 150ms ease-in-out",
|
|
405
|
-
color: textColor,
|
|
406
403
|
"&:hover, &[data-hovered]": {
|
|
407
|
-
|
|
408
|
-
backgroundColor: bgHoverColor,
|
|
409
|
-
textDecoration: "none"
|
|
404
|
+
backgroundColor: bgHoverColor
|
|
410
405
|
},
|
|
411
406
|
"&:active, &[data-active]": {
|
|
412
|
-
color: textColor,
|
|
413
407
|
backgroundColor: bgActiveColor
|
|
414
|
-
},
|
|
415
|
-
"&:disabled, &[data-disabled]": {
|
|
416
|
-
color: disabledColor,
|
|
417
|
-
userSelect: "none",
|
|
418
|
-
cursor: "not-allowed",
|
|
419
|
-
"&:hover, &[data-hovered]": {
|
|
420
|
-
color: disabledColor,
|
|
421
|
-
backgroundColor: "transparent"
|
|
422
|
-
}
|
|
423
408
|
}
|
|
424
409
|
}
|
|
425
410
|
};
|