@helpwave/hightide 0.1.18 → 0.1.19
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/branding/HelpwaveBadge.js +7 -7
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +7 -7
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +65 -38
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +54 -27
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js +3 -3
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +3 -3
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimePicker.js +4 -4
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +4 -4
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +46 -19
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +44 -17
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +32 -28
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +18 -14
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Ring.js +2 -2
- package/dist/components/icons-and-geometry/Ring.js.map +1 -1
- package/dist/components/icons-and-geometry/Ring.mjs +2 -2
- package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +84 -15
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +76 -7
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.js +1 -1
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +7 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +7 -1
- package/dist/components/layout-and-navigation/Expandable.js +36 -9
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +36 -10
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +34 -11
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +36 -13
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +92 -19
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +81 -8
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +82 -9
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +79 -6
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +127 -25
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +126 -24
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +22 -16
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +19 -13
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +7 -3
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +7 -3
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +2 -2
- package/dist/components/layout-and-navigation/Tile.d.ts +2 -2
- package/dist/components/layout-and-navigation/Tile.js +7 -7
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +7 -7
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +6 -2
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +5 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +5 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +8 -6
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +8 -6
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +32 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +18 -14
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +28 -24
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +18 -14
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +32 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +18 -14
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +728 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +728 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +732 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +731 -433
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +110 -35
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +110 -35
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +118 -41
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +114 -37
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +10 -3
- package/dist/components/properties/MultiSelectProperty.d.ts +10 -3
- package/dist/components/properties/MultiSelectProperty.js +915 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +920 -464
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +101 -18
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +101 -18
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +103 -20
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +99 -16
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +9 -2
- package/dist/components/properties/SelectProperty.d.ts +9 -2
- package/dist/components/properties/SelectProperty.js +682 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +686 -243
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +133 -46
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +133 -46
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js +285 -185
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +270 -166
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +179 -78
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +160 -55
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/TableSortButton.js +72 -3
- package/dist/components/table/TableSortButton.js.map +1 -1
- package/dist/components/table/TableSortButton.mjs +72 -3
- package/dist/components/table/TableSortButton.mjs.map +1 -1
- package/dist/components/user-action/Button.d.mts +15 -2
- package/dist/components/user-action/Button.d.ts +15 -2
- package/dist/components/user-action/Button.js +12 -12
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +12 -12
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +6 -15
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +6 -15
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +79 -48
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +65 -34
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +11 -6
- package/dist/components/user-action/Menu.d.ts +11 -6
- package/dist/components/user-action/Menu.js +128 -31
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +134 -33
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +17 -7
- package/dist/components/user-action/MultiSelect.d.ts +17 -7
- package/dist/components/user-action/MultiSelect.js +796 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +781 -356
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +2 -2
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +2 -2
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.d.mts +14 -0
- package/dist/components/user-action/SearchBar.d.ts +14 -0
- package/dist/components/user-action/SearchBar.js +673 -0
- package/dist/components/user-action/SearchBar.js.map +1 -0
- package/dist/components/user-action/SearchBar.mjs +637 -0
- package/dist/components/user-action/SearchBar.mjs.map +1 -0
- package/dist/components/user-action/Select.d.mts +18 -5
- package/dist/components/user-action/Select.d.ts +18 -5
- package/dist/components/user-action/Select.js +764 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +761 -349
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +1 -1
- package/dist/components/user-action/Textarea.d.ts +1 -1
- package/dist/components/user-action/Textarea.js +13 -3
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +13 -3
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.js +2 -2
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +2 -2
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +251 -113
- package/dist/css/uncompiled/globals.css +19 -13
- package/dist/css/uncompiled/theme/colors-component.css +12 -3
- package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
- package/dist/css/uncompiled/utitlity/animation.css +70 -1
- package/dist/css/uncompiled/utitlity/general.css +16 -0
- package/dist/hooks/usePopoverPosition.d.mts +15 -0
- package/dist/hooks/usePopoverPosition.d.ts +15 -0
- package/dist/hooks/usePopoverPosition.js +81 -0
- package/dist/hooks/usePopoverPosition.js.map +1 -0
- package/dist/hooks/usePopoverPosition.mjs +57 -0
- package/dist/hooks/usePopoverPosition.mjs.map +1 -0
- package/dist/hooks/useSearch.d.mts +7 -2
- package/dist/hooks/useSearch.d.ts +7 -2
- package/dist/hooks/useSearch.js +44 -15
- package/dist/hooks/useSearch.js.map +1 -1
- package/dist/hooks/useSearch.mjs +45 -16
- package/dist/hooks/useSearch.mjs.map +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1102 -819
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1001 -718
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +2 -0
- package/dist/localization/defaults/form.d.ts +2 -0
- package/dist/localization/defaults/form.js +4 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +4 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/simpleSearch.d.mts +1 -1
- package/dist/util/simpleSearch.d.ts +1 -1
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -33,8 +33,8 @@ __export(MultiSelect_exports, {
|
|
|
33
33
|
MultiSelectUncontrolled: () => MultiSelectUncontrolled
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(MultiSelect_exports);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_react16 = require("react");
|
|
37
|
+
var import_react17 = require("react");
|
|
38
38
|
|
|
39
39
|
// src/localization/LanguageProvider.tsx
|
|
40
40
|
var import_react2 = require("react");
|
|
@@ -124,7 +124,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
// src/components/user-action/MultiSelect.tsx
|
|
127
|
-
var
|
|
127
|
+
var import_clsx11 = __toESM(require("clsx"));
|
|
128
128
|
|
|
129
129
|
// src/components/user-action/Label.tsx
|
|
130
130
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -144,22 +144,389 @@ var Label = ({
|
|
|
144
144
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
// src/components/
|
|
147
|
+
// src/components/user-action/Select.tsx
|
|
148
|
+
var import_react13 = require("react");
|
|
149
|
+
var import_react14 = require("react");
|
|
150
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
151
|
+
|
|
152
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
153
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
148
154
|
var import_lucide_react = require("lucide-react");
|
|
155
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
156
|
+
var Tile = ({
|
|
157
|
+
title,
|
|
158
|
+
description,
|
|
159
|
+
onClick,
|
|
160
|
+
isSelected = false,
|
|
161
|
+
disabled = false,
|
|
162
|
+
prefix,
|
|
163
|
+
suffix,
|
|
164
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
165
|
+
selectedClassName = " bg-primary/20",
|
|
166
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
167
|
+
className
|
|
168
|
+
}) => {
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: (0, import_clsx2.default)(
|
|
173
|
+
"flex-row-2 w-full items-center",
|
|
174
|
+
{
|
|
175
|
+
[normalClassName]: !!onClick && !disabled,
|
|
176
|
+
[selectedClassName]: isSelected && !disabled,
|
|
177
|
+
[disabledClassName]: disabled
|
|
178
|
+
},
|
|
179
|
+
className
|
|
180
|
+
),
|
|
181
|
+
onClick: disabled ? void 0 : onClick,
|
|
182
|
+
children: [
|
|
183
|
+
prefix,
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: (0, import_clsx2.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
186
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
187
|
+
] }),
|
|
188
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 24 }) : void 0)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
195
|
+
var import_react3 = require("react");
|
|
196
|
+
var import_lucide_react2 = require("lucide-react");
|
|
197
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
198
|
+
|
|
199
|
+
// src/util/noop.ts
|
|
200
|
+
var noop = () => void 0;
|
|
201
|
+
|
|
202
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
203
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
204
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
206
|
+
import_lucide_react2.ChevronDown,
|
|
207
|
+
{
|
|
208
|
+
className: (0, import_clsx3.default)(
|
|
209
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
210
|
+
{ "rotate-180": isExpanded },
|
|
211
|
+
className
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
var Expandable = (0, import_react3.forwardRef)(function Expandable2({
|
|
217
|
+
children,
|
|
218
|
+
label,
|
|
219
|
+
icon,
|
|
220
|
+
isExpanded = false,
|
|
221
|
+
onChange = noop,
|
|
222
|
+
clickOnlyOnHeader = true,
|
|
223
|
+
disabled = false,
|
|
224
|
+
className,
|
|
225
|
+
headerClassName,
|
|
226
|
+
contentClassName
|
|
227
|
+
}, ref) {
|
|
228
|
+
const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
229
|
+
icon ??= defaultIcon;
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
ref,
|
|
234
|
+
className: (0, import_clsx3.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
235
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
className: (0, import_clsx3.default)(
|
|
241
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
242
|
+
{
|
|
243
|
+
"group-hover:brightness-97": !isExpanded,
|
|
244
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
245
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
246
|
+
},
|
|
247
|
+
headerClassName
|
|
248
|
+
),
|
|
249
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
250
|
+
children: [
|
|
251
|
+
label,
|
|
252
|
+
icon(isExpanded)
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
257
|
+
"div",
|
|
258
|
+
{
|
|
259
|
+
className: (0, import_clsx3.default)(
|
|
260
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
261
|
+
{
|
|
262
|
+
"max-h-96 opacity-100 pb-2": isExpanded,
|
|
263
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
264
|
+
},
|
|
265
|
+
contentClassName
|
|
266
|
+
),
|
|
267
|
+
children
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
});
|
|
274
|
+
var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
|
|
275
|
+
isExpanded,
|
|
276
|
+
onChange = noop,
|
|
277
|
+
...props
|
|
278
|
+
}, ref) {
|
|
279
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
|
|
280
|
+
(0, import_react3.useEffect)(() => {
|
|
281
|
+
setUsedIsExpanded(isExpanded);
|
|
282
|
+
}, [isExpanded]);
|
|
283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
284
|
+
Expandable,
|
|
285
|
+
{
|
|
286
|
+
...props,
|
|
287
|
+
ref,
|
|
288
|
+
isExpanded: usedIsExpanded,
|
|
289
|
+
onChange: (value) => {
|
|
290
|
+
onChange(value);
|
|
291
|
+
setUsedIsExpanded(value);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// src/components/user-action/Menu.tsx
|
|
298
|
+
var import_react6 = require("react");
|
|
149
299
|
var import_clsx4 = __toESM(require("clsx"));
|
|
150
300
|
|
|
301
|
+
// src/hooks/useOutsideClick.ts
|
|
302
|
+
var import_react4 = require("react");
|
|
303
|
+
var useOutsideClick = (refs, handler) => {
|
|
304
|
+
(0, import_react4.useEffect)(() => {
|
|
305
|
+
const listener = (event) => {
|
|
306
|
+
if (event.target === null) return;
|
|
307
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
handler();
|
|
311
|
+
};
|
|
312
|
+
document.addEventListener("mousedown", listener);
|
|
313
|
+
document.addEventListener("touchstart", listener);
|
|
314
|
+
return () => {
|
|
315
|
+
document.removeEventListener("mousedown", listener);
|
|
316
|
+
document.removeEventListener("touchstart", listener);
|
|
317
|
+
};
|
|
318
|
+
}, [refs, handler]);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// src/hooks/useHoverState.ts
|
|
322
|
+
var import_react5 = require("react");
|
|
323
|
+
var defaultUseHoverStateProps = {
|
|
324
|
+
closingDelay: 200,
|
|
325
|
+
isDisabled: false
|
|
326
|
+
};
|
|
327
|
+
var useHoverState = (props = void 0) => {
|
|
328
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
329
|
+
const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
|
|
330
|
+
const [timer, setTimer] = (0, import_react5.useState)();
|
|
331
|
+
const onMouseEnter = () => {
|
|
332
|
+
if (isDisabled) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
clearTimeout(timer);
|
|
336
|
+
setIsHovered(true);
|
|
337
|
+
};
|
|
338
|
+
const onMouseLeave = () => {
|
|
339
|
+
if (isDisabled) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
setTimer(setTimeout(() => {
|
|
343
|
+
setIsHovered(false);
|
|
344
|
+
}, closingDelay));
|
|
345
|
+
};
|
|
346
|
+
(0, import_react5.useEffect)(() => {
|
|
347
|
+
if (timer) {
|
|
348
|
+
return () => {
|
|
349
|
+
clearTimeout(timer);
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
(0, import_react5.useEffect)(() => {
|
|
354
|
+
if (timer) {
|
|
355
|
+
clearTimeout(timer);
|
|
356
|
+
}
|
|
357
|
+
}, [isDisabled]);
|
|
358
|
+
return {
|
|
359
|
+
isHovered,
|
|
360
|
+
setIsHovered,
|
|
361
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
366
|
+
var resolve = (children, bag) => {
|
|
367
|
+
if (typeof children === "function") {
|
|
368
|
+
return children(bag);
|
|
369
|
+
}
|
|
370
|
+
return children ?? void 0;
|
|
371
|
+
};
|
|
372
|
+
var BagFunctionUtil = {
|
|
373
|
+
resolve
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
// src/hooks/usePopoverPosition.ts
|
|
377
|
+
var defaultPopoverPositionOptions = {
|
|
378
|
+
edgePadding: 16,
|
|
379
|
+
outerGap: 4,
|
|
380
|
+
horizontalAlignment: "leftInside",
|
|
381
|
+
verticalAlignment: "bottomOutside",
|
|
382
|
+
disabled: false
|
|
383
|
+
};
|
|
384
|
+
var usePopoverPosition = (trigger, options) => {
|
|
385
|
+
const {
|
|
386
|
+
edgePadding,
|
|
387
|
+
outerGap,
|
|
388
|
+
verticalAlignment,
|
|
389
|
+
horizontalAlignment,
|
|
390
|
+
disabled
|
|
391
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
392
|
+
if (disabled || !trigger) {
|
|
393
|
+
return {};
|
|
394
|
+
}
|
|
395
|
+
const left = {
|
|
396
|
+
leftOutside: trigger.left - outerGap,
|
|
397
|
+
leftInside: trigger.left,
|
|
398
|
+
rightOutside: trigger.right + outerGap,
|
|
399
|
+
rightInside: trigger.right,
|
|
400
|
+
center: trigger.left + trigger.width / 2
|
|
401
|
+
}[horizontalAlignment];
|
|
402
|
+
const top = {
|
|
403
|
+
topOutside: trigger.top - outerGap,
|
|
404
|
+
topInside: trigger.top,
|
|
405
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
406
|
+
bottomInside: trigger.bottom,
|
|
407
|
+
center: trigger.top + trigger.height / 2
|
|
408
|
+
}[verticalAlignment];
|
|
409
|
+
const translateX = {
|
|
410
|
+
leftOutside: "-100%",
|
|
411
|
+
leftInside: void 0,
|
|
412
|
+
rightOutside: void 0,
|
|
413
|
+
rightInside: "-100%",
|
|
414
|
+
center: "-50%"
|
|
415
|
+
}[horizontalAlignment];
|
|
416
|
+
const translateY = {
|
|
417
|
+
topOutside: "-100%",
|
|
418
|
+
topInside: void 0,
|
|
419
|
+
bottomOutside: void 0,
|
|
420
|
+
bottomInside: "-100%",
|
|
421
|
+
center: "-50%"
|
|
422
|
+
}[verticalAlignment];
|
|
423
|
+
return {
|
|
424
|
+
left: Math.max(left, edgePadding),
|
|
425
|
+
top: Math.max(top, edgePadding),
|
|
426
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// src/components/user-action/Menu.tsx
|
|
431
|
+
var import_react_dom = require("react-dom");
|
|
432
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
433
|
+
function getScrollableParents(element) {
|
|
434
|
+
const scrollables = [];
|
|
435
|
+
let parent = element.parentElement;
|
|
436
|
+
while (parent) {
|
|
437
|
+
scrollables.push(parent);
|
|
438
|
+
parent = parent.parentElement;
|
|
439
|
+
}
|
|
440
|
+
return scrollables;
|
|
441
|
+
}
|
|
442
|
+
var Menu = ({
|
|
443
|
+
trigger,
|
|
444
|
+
children,
|
|
445
|
+
alignmentHorizontal = "leftInside",
|
|
446
|
+
alignmentVertical = "bottomOutside",
|
|
447
|
+
showOnHover = false,
|
|
448
|
+
disabled = false,
|
|
449
|
+
menuClassName = ""
|
|
450
|
+
}) => {
|
|
451
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
452
|
+
const triggerRef = (0, import_react6.useRef)(null);
|
|
453
|
+
const menuRef = (0, import_react6.useRef)(null);
|
|
454
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
455
|
+
const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
|
|
456
|
+
const bag = {
|
|
457
|
+
isOpen,
|
|
458
|
+
close: () => setIsOpen(false),
|
|
459
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
460
|
+
disabled
|
|
461
|
+
};
|
|
462
|
+
const menuPosition = usePopoverPosition(
|
|
463
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
464
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
465
|
+
);
|
|
466
|
+
(0, import_react6.useEffect)(() => {
|
|
467
|
+
if (!isOpen) return;
|
|
468
|
+
const triggerEl = triggerRef.current;
|
|
469
|
+
if (!triggerEl) return;
|
|
470
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
471
|
+
const close = () => setIsOpen(false);
|
|
472
|
+
scrollableParents.forEach((parent) => {
|
|
473
|
+
parent.addEventListener("scroll", close);
|
|
474
|
+
});
|
|
475
|
+
window.addEventListener("resize", close);
|
|
476
|
+
return () => {
|
|
477
|
+
scrollableParents.forEach((parent) => {
|
|
478
|
+
parent.removeEventListener("scroll", close);
|
|
479
|
+
});
|
|
480
|
+
window.removeEventListener("resize", close);
|
|
481
|
+
};
|
|
482
|
+
}, [isOpen, setIsOpen]);
|
|
483
|
+
(0, import_react6.useEffect)(() => {
|
|
484
|
+
if (isOpen) {
|
|
485
|
+
setIsHidden(false);
|
|
486
|
+
}
|
|
487
|
+
}, [isOpen]);
|
|
488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
489
|
+
trigger(bag, triggerRef),
|
|
490
|
+
(0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
491
|
+
"div",
|
|
492
|
+
{
|
|
493
|
+
ref: menuRef,
|
|
494
|
+
onClick: (e) => e.stopPropagation(),
|
|
495
|
+
className: (0, import_clsx4.default)(
|
|
496
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
497
|
+
{
|
|
498
|
+
"animate-pop-in": isOpen,
|
|
499
|
+
"animate-pop-out": !isOpen,
|
|
500
|
+
"hidden": isHidden
|
|
501
|
+
},
|
|
502
|
+
menuClassName
|
|
503
|
+
),
|
|
504
|
+
onAnimationEnd: () => {
|
|
505
|
+
if (!isOpen) {
|
|
506
|
+
setIsHidden(true);
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
style: {
|
|
510
|
+
...menuPosition
|
|
511
|
+
},
|
|
512
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
513
|
+
}
|
|
514
|
+
), document.body)
|
|
515
|
+
] });
|
|
516
|
+
};
|
|
517
|
+
|
|
151
518
|
// src/components/user-action/Input.tsx
|
|
152
|
-
var
|
|
153
|
-
var
|
|
519
|
+
var import_react10 = require("react");
|
|
520
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
154
521
|
|
|
155
522
|
// src/hooks/useDelay.ts
|
|
156
|
-
var
|
|
523
|
+
var import_react7 = require("react");
|
|
157
524
|
var defaultOptions = {
|
|
158
525
|
delay: 3e3,
|
|
159
526
|
disabled: false
|
|
160
527
|
};
|
|
161
528
|
function useDelay(options) {
|
|
162
|
-
const [timer, setTimer] = (0,
|
|
529
|
+
const [timer, setTimer] = (0, import_react7.useState)(void 0);
|
|
163
530
|
const { delay, disabled } = {
|
|
164
531
|
...defaultOptions,
|
|
165
532
|
...options
|
|
@@ -178,12 +545,12 @@ function useDelay(options) {
|
|
|
178
545
|
setTimer(void 0);
|
|
179
546
|
}, delay));
|
|
180
547
|
};
|
|
181
|
-
(0,
|
|
548
|
+
(0, import_react7.useEffect)(() => {
|
|
182
549
|
return () => {
|
|
183
550
|
clearTimeout(timer);
|
|
184
551
|
};
|
|
185
552
|
}, [timer]);
|
|
186
|
-
(0,
|
|
553
|
+
(0, import_react7.useEffect)(() => {
|
|
187
554
|
if (disabled) {
|
|
188
555
|
clearTimeout(timer);
|
|
189
556
|
setTimer(void 0);
|
|
@@ -192,13 +559,10 @@ function useDelay(options) {
|
|
|
192
559
|
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
193
560
|
}
|
|
194
561
|
|
|
195
|
-
// src/util/noop.ts
|
|
196
|
-
var noop = () => void 0;
|
|
197
|
-
|
|
198
562
|
// src/hooks/useFocusManagement.ts
|
|
199
|
-
var
|
|
563
|
+
var import_react8 = require("react");
|
|
200
564
|
function useFocusManagement() {
|
|
201
|
-
const getFocusableElements = (0,
|
|
565
|
+
const getFocusableElements = (0, import_react8.useCallback)(() => {
|
|
202
566
|
return Array.from(
|
|
203
567
|
document.querySelectorAll(
|
|
204
568
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -207,7 +571,7 @@ function useFocusManagement() {
|
|
|
207
571
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
208
572
|
);
|
|
209
573
|
}, []);
|
|
210
|
-
const getNextFocusElement = (0,
|
|
574
|
+
const getNextFocusElement = (0, import_react8.useCallback)(() => {
|
|
211
575
|
const elements = getFocusableElements();
|
|
212
576
|
if (elements.length === 0) {
|
|
213
577
|
return void 0;
|
|
@@ -219,11 +583,11 @@ function useFocusManagement() {
|
|
|
219
583
|
}
|
|
220
584
|
return nextElement;
|
|
221
585
|
}, [getFocusableElements]);
|
|
222
|
-
const focusNext = (0,
|
|
586
|
+
const focusNext = (0, import_react8.useCallback)(() => {
|
|
223
587
|
const nextElement = getNextFocusElement();
|
|
224
588
|
nextElement?.focus();
|
|
225
589
|
}, [getNextFocusElement]);
|
|
226
|
-
const getPreviousFocusElement = (0,
|
|
590
|
+
const getPreviousFocusElement = (0, import_react8.useCallback)(() => {
|
|
227
591
|
const elements = getFocusableElements();
|
|
228
592
|
if (elements.length === 0) {
|
|
229
593
|
return void 0;
|
|
@@ -239,7 +603,7 @@ function useFocusManagement() {
|
|
|
239
603
|
}
|
|
240
604
|
return previousElement;
|
|
241
605
|
}, [getFocusableElements]);
|
|
242
|
-
const focusPrevious = (0,
|
|
606
|
+
const focusPrevious = (0, import_react8.useCallback)(() => {
|
|
243
607
|
const previousElement = getPreviousFocusElement();
|
|
244
608
|
if (previousElement) previousElement.focus();
|
|
245
609
|
}, [getPreviousFocusElement]);
|
|
@@ -253,10 +617,10 @@ function useFocusManagement() {
|
|
|
253
617
|
}
|
|
254
618
|
|
|
255
619
|
// src/hooks/useFocusOnceVisible.ts
|
|
256
|
-
var
|
|
620
|
+
var import_react9 = __toESM(require("react"));
|
|
257
621
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
258
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
259
|
-
(0,
|
|
622
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react9.default.useState(false);
|
|
623
|
+
(0, import_react9.useEffect)(() => {
|
|
260
624
|
if (disable || hasUsedFocus) {
|
|
261
625
|
return;
|
|
262
626
|
}
|
|
@@ -276,9 +640,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
276
640
|
};
|
|
277
641
|
|
|
278
642
|
// src/components/user-action/Input.tsx
|
|
279
|
-
var
|
|
643
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
280
644
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
281
|
-
return (0,
|
|
645
|
+
return (0, import_clsx5.default)(
|
|
282
646
|
"px-2 py-1.5 rounded-md border-2",
|
|
283
647
|
{
|
|
284
648
|
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -292,7 +656,7 @@ var defaultEditCompleteOptions = {
|
|
|
292
656
|
afterDelay: true,
|
|
293
657
|
delay: 2500
|
|
294
658
|
};
|
|
295
|
-
var Input = (0,
|
|
659
|
+
var Input = (0, import_react10.forwardRef)(function Input2({
|
|
296
660
|
id,
|
|
297
661
|
type = "text",
|
|
298
662
|
value,
|
|
@@ -315,10 +679,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
315
679
|
restartTimer,
|
|
316
680
|
clearTimer
|
|
317
681
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
318
|
-
const innerRef = (0,
|
|
682
|
+
const innerRef = (0, import_react10.useRef)(null);
|
|
319
683
|
const { focusNext } = useFocusManagement();
|
|
320
684
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
321
|
-
(0,
|
|
685
|
+
(0, import_react10.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
322
686
|
const handleKeyDown = (e) => {
|
|
323
687
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
324
688
|
e.preventDefault();
|
|
@@ -326,9 +690,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
326
690
|
focusNext();
|
|
327
691
|
}
|
|
328
692
|
};
|
|
329
|
-
return /* @__PURE__ */ (0,
|
|
330
|
-
label && /* @__PURE__ */ (0,
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)({ "w-full": expanded }, containerClassName), children: [
|
|
694
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx5.default)("mb-1", label.className) }),
|
|
695
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
332
696
|
"input",
|
|
333
697
|
{
|
|
334
698
|
...restProps,
|
|
@@ -337,7 +701,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
337
701
|
id,
|
|
338
702
|
type,
|
|
339
703
|
disabled,
|
|
340
|
-
className: (0,
|
|
704
|
+
className: (0, import_clsx5.default)(getInputClassName({ disabled }), className),
|
|
341
705
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
342
706
|
onBlur: (event) => {
|
|
343
707
|
onBlur?.(event);
|
|
@@ -367,7 +731,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
367
731
|
)
|
|
368
732
|
] });
|
|
369
733
|
});
|
|
370
|
-
var FormInput = (0,
|
|
734
|
+
var FormInput = (0, import_react10.forwardRef)(function FormInput2({
|
|
371
735
|
id,
|
|
372
736
|
labelText,
|
|
373
737
|
errorText,
|
|
@@ -379,206 +743,33 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
|
379
743
|
disabled,
|
|
380
744
|
...restProps
|
|
381
745
|
}, ref) {
|
|
382
|
-
const input = /* @__PURE__ */ (0,
|
|
746
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
383
747
|
"input",
|
|
384
748
|
{
|
|
385
749
|
...restProps,
|
|
386
750
|
ref,
|
|
387
751
|
id,
|
|
388
752
|
disabled,
|
|
389
|
-
className: (0,
|
|
753
|
+
className: (0, import_clsx5.default)(
|
|
390
754
|
getInputClassName({ disabled, hasError: !!errorText }),
|
|
391
755
|
className
|
|
392
756
|
)
|
|
393
757
|
}
|
|
394
758
|
);
|
|
395
|
-
return /* @__PURE__ */ (0,
|
|
396
|
-
labelText && /* @__PURE__ */ (0,
|
|
759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
760
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
|
|
397
761
|
labelText,
|
|
398
|
-
required && /* @__PURE__ */ (0,
|
|
762
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
399
763
|
] }),
|
|
400
764
|
input,
|
|
401
|
-
errorText && /* @__PURE__ */ (0,
|
|
765
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
|
|
402
766
|
] });
|
|
403
767
|
});
|
|
404
768
|
|
|
405
|
-
// src/components/user-action/Button.tsx
|
|
406
|
-
var import_clsx3 = __toESM(require("clsx"));
|
|
407
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
408
|
-
var ButtonColorUtil = {
|
|
409
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
410
|
-
text: ["primary", "negative", "neutral"],
|
|
411
|
-
outline: ["primary"]
|
|
412
|
-
};
|
|
413
|
-
var IconButtonUtil = {
|
|
414
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
415
|
-
};
|
|
416
|
-
var paddingMapping = {
|
|
417
|
-
small: "btn-sm",
|
|
418
|
-
medium: "btn-md",
|
|
419
|
-
large: "btn-lg"
|
|
420
|
-
};
|
|
421
|
-
var iconPaddingMapping = {
|
|
422
|
-
tiny: "icon-btn-xs",
|
|
423
|
-
small: "icon-btn-sm",
|
|
424
|
-
medium: "icon-btn-md",
|
|
425
|
-
large: "icon-btn-lg"
|
|
426
|
-
};
|
|
427
|
-
var ButtonUtil = {
|
|
428
|
-
paddingMapping,
|
|
429
|
-
iconPaddingMapping
|
|
430
|
-
};
|
|
431
|
-
var SolidButton = ({
|
|
432
|
-
children,
|
|
433
|
-
disabled = false,
|
|
434
|
-
color = "primary",
|
|
435
|
-
size = "medium",
|
|
436
|
-
startIcon,
|
|
437
|
-
endIcon,
|
|
438
|
-
onClick,
|
|
439
|
-
className,
|
|
440
|
-
...restProps
|
|
441
|
-
}) => {
|
|
442
|
-
const colorClasses = {
|
|
443
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
444
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
445
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
446
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
447
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
448
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
449
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
450
|
-
}[color];
|
|
451
|
-
const iconColorClasses = {
|
|
452
|
-
primary: "text-button-solid-primary-icon",
|
|
453
|
-
secondary: "text-button-solid-secondary-icon",
|
|
454
|
-
tertiary: "text-button-solid-tertiary-icon",
|
|
455
|
-
positive: "text-button-solid-positive-icon",
|
|
456
|
-
warning: "text-button-solid-warning-icon",
|
|
457
|
-
negative: "text-button-solid-negative-icon",
|
|
458
|
-
neutral: "text-button-solid-neutral-icon"
|
|
459
|
-
}[color];
|
|
460
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
461
|
-
"button",
|
|
462
|
-
{
|
|
463
|
-
onClick: disabled ? void 0 : onClick,
|
|
464
|
-
disabled: disabled || onClick === void 0,
|
|
465
|
-
className: (0, import_clsx3.default)(
|
|
466
|
-
{
|
|
467
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
468
|
-
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
469
|
-
},
|
|
470
|
-
ButtonUtil.paddingMapping[size],
|
|
471
|
-
className
|
|
472
|
-
),
|
|
473
|
-
...restProps,
|
|
474
|
-
children: [
|
|
475
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
476
|
-
"span",
|
|
477
|
-
{
|
|
478
|
-
className: (0, import_clsx3.default)({
|
|
479
|
-
[iconColorClasses]: !disabled,
|
|
480
|
-
[`text-disabled-icon`]: disabled
|
|
481
|
-
}),
|
|
482
|
-
children: startIcon
|
|
483
|
-
}
|
|
484
|
-
),
|
|
485
|
-
children,
|
|
486
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
487
|
-
"span",
|
|
488
|
-
{
|
|
489
|
-
className: (0, import_clsx3.default)({
|
|
490
|
-
[iconColorClasses]: !disabled,
|
|
491
|
-
[`text-disabled-icon`]: disabled
|
|
492
|
-
}),
|
|
493
|
-
children: endIcon
|
|
494
|
-
}
|
|
495
|
-
)
|
|
496
|
-
]
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
};
|
|
500
|
-
var IconButton = ({
|
|
501
|
-
children,
|
|
502
|
-
disabled = false,
|
|
503
|
-
color = "primary",
|
|
504
|
-
size = "medium",
|
|
505
|
-
onClick,
|
|
506
|
-
className,
|
|
507
|
-
...restProps
|
|
508
|
-
}) => {
|
|
509
|
-
const colorClasses = {
|
|
510
|
-
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
511
|
-
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
512
|
-
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
513
|
-
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
514
|
-
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
515
|
-
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
516
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
517
|
-
transparent: "bg-transparent"
|
|
518
|
-
}[color];
|
|
519
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
520
|
-
"button",
|
|
521
|
-
{
|
|
522
|
-
onClick: disabled ? void 0 : onClick,
|
|
523
|
-
disabled: disabled || onClick === void 0,
|
|
524
|
-
className: (0, import_clsx3.default)(
|
|
525
|
-
{
|
|
526
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
527
|
-
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
528
|
-
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
529
|
-
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
530
|
-
},
|
|
531
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
532
|
-
className
|
|
533
|
-
),
|
|
534
|
-
...restProps,
|
|
535
|
-
children
|
|
536
|
-
}
|
|
537
|
-
);
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
// src/hooks/useSearch.ts
|
|
541
|
-
var import_react7 = require("react");
|
|
542
|
-
|
|
543
|
-
// src/util/simpleSearch.ts
|
|
544
|
-
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
545
|
-
return objects.filter((object) => {
|
|
546
|
-
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
547
|
-
if (!mappedSearchKeywords) {
|
|
548
|
-
return true;
|
|
549
|
-
}
|
|
550
|
-
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
551
|
-
});
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
// src/hooks/useSearch.ts
|
|
555
|
-
var useSearch = ({
|
|
556
|
-
list,
|
|
557
|
-
initialSearch,
|
|
558
|
-
searchMapping
|
|
559
|
-
}) => {
|
|
560
|
-
const [items, setItems] = (0, import_react7.useState)(list);
|
|
561
|
-
const [search, setSearch] = (0, import_react7.useState)(initialSearch);
|
|
562
|
-
(0, import_react7.useEffect)(() => {
|
|
563
|
-
setItems(list);
|
|
564
|
-
}, [list]);
|
|
565
|
-
const result = (0, import_react7.useMemo)(
|
|
566
|
-
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
567
|
-
[search, items, searchMapping]
|
|
568
|
-
);
|
|
569
|
-
return {
|
|
570
|
-
result,
|
|
571
|
-
hasResult: result.length > 0,
|
|
572
|
-
allItems: items,
|
|
573
|
-
setItems,
|
|
574
|
-
search,
|
|
575
|
-
setSearch
|
|
576
|
-
};
|
|
577
|
-
};
|
|
578
|
-
|
|
579
769
|
// src/localization/defaults/form.ts
|
|
580
770
|
var formTranslation = {
|
|
581
771
|
en: {
|
|
772
|
+
add: "Add",
|
|
582
773
|
all: "All",
|
|
583
774
|
apply: "Apply",
|
|
584
775
|
back: "Back",
|
|
@@ -591,6 +782,7 @@ var formTranslation = {
|
|
|
591
782
|
confirm: "Confirm",
|
|
592
783
|
copy: "Copy",
|
|
593
784
|
copied: "Copied",
|
|
785
|
+
create: "Create",
|
|
594
786
|
decline: "Decline",
|
|
595
787
|
delete: "Delete",
|
|
596
788
|
discard: "Discard",
|
|
@@ -633,6 +825,7 @@ var formTranslation = {
|
|
|
633
825
|
yes: "Yes"
|
|
634
826
|
},
|
|
635
827
|
de: {
|
|
828
|
+
add: "Hinzuf\xFCgen",
|
|
636
829
|
all: "Alle",
|
|
637
830
|
apply: "Anwenden",
|
|
638
831
|
back: "Zur\xFCck",
|
|
@@ -645,6 +838,7 @@ var formTranslation = {
|
|
|
645
838
|
confirm: "Best\xE4tigen",
|
|
646
839
|
copy: "Kopieren",
|
|
647
840
|
copied: "Kopiert",
|
|
841
|
+
create: "Erstellen",
|
|
648
842
|
decline: "Ablehnen",
|
|
649
843
|
delete: "L\xF6schen",
|
|
650
844
|
discard: "Verwerfen",
|
|
@@ -688,92 +882,255 @@ var formTranslation = {
|
|
|
688
882
|
}
|
|
689
883
|
};
|
|
690
884
|
|
|
691
|
-
// src/components/
|
|
692
|
-
var
|
|
693
|
-
var
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}
|
|
885
|
+
// src/components/user-action/Button.tsx
|
|
886
|
+
var import_react11 = require("react");
|
|
887
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
888
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
889
|
+
var ButtonColorUtil = {
|
|
890
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
891
|
+
text: ["primary", "negative", "neutral"],
|
|
892
|
+
outline: ["primary"]
|
|
700
893
|
};
|
|
701
|
-
var
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
894
|
+
var IconButtonUtil = {
|
|
895
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
896
|
+
};
|
|
897
|
+
var paddingMapping = {
|
|
898
|
+
small: "btn-sm",
|
|
899
|
+
medium: "btn-md",
|
|
900
|
+
large: "btn-lg"
|
|
901
|
+
};
|
|
902
|
+
var iconPaddingMapping = {
|
|
903
|
+
tiny: "icon-btn-xs",
|
|
904
|
+
small: "icon-btn-sm",
|
|
905
|
+
medium: "icon-btn-md",
|
|
906
|
+
large: "icon-btn-lg"
|
|
907
|
+
};
|
|
908
|
+
var ButtonUtil = {
|
|
909
|
+
paddingMapping,
|
|
910
|
+
iconPaddingMapping
|
|
911
|
+
};
|
|
912
|
+
var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
|
|
913
|
+
children,
|
|
914
|
+
disabled = false,
|
|
915
|
+
color = "primary",
|
|
916
|
+
size = "medium",
|
|
917
|
+
startIcon,
|
|
918
|
+
endIcon,
|
|
919
|
+
onClick,
|
|
709
920
|
className,
|
|
710
|
-
|
|
921
|
+
...restProps
|
|
922
|
+
}, ref) {
|
|
923
|
+
const colorClasses = {
|
|
924
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
925
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
926
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
927
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
928
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
929
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
930
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
931
|
+
}[color];
|
|
932
|
+
const iconColorClasses = {
|
|
933
|
+
primary: "text-button-solid-primary-icon",
|
|
934
|
+
secondary: "text-button-solid-secondary-icon",
|
|
935
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
936
|
+
positive: "text-button-solid-positive-icon",
|
|
937
|
+
warning: "text-button-solid-warning-icon",
|
|
938
|
+
negative: "text-button-solid-negative-icon",
|
|
939
|
+
neutral: "text-button-solid-neutral-icon"
|
|
940
|
+
}[color];
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
942
|
+
"button",
|
|
943
|
+
{
|
|
944
|
+
ref,
|
|
945
|
+
onClick,
|
|
946
|
+
disabled,
|
|
947
|
+
className: (0, import_clsx6.default)(
|
|
948
|
+
{
|
|
949
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
950
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
951
|
+
},
|
|
952
|
+
ButtonUtil.paddingMapping[size],
|
|
953
|
+
className
|
|
954
|
+
),
|
|
955
|
+
...restProps,
|
|
956
|
+
children: [
|
|
957
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
958
|
+
"span",
|
|
959
|
+
{
|
|
960
|
+
className: (0, import_clsx6.default)({
|
|
961
|
+
[iconColorClasses]: !disabled,
|
|
962
|
+
[`text-disabled-icon`]: disabled
|
|
963
|
+
}),
|
|
964
|
+
children: startIcon
|
|
965
|
+
}
|
|
966
|
+
),
|
|
967
|
+
children,
|
|
968
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
969
|
+
"span",
|
|
970
|
+
{
|
|
971
|
+
className: (0, import_clsx6.default)({
|
|
972
|
+
[iconColorClasses]: !disabled,
|
|
973
|
+
[`text-disabled-icon`]: disabled
|
|
974
|
+
}),
|
|
975
|
+
children: endIcon
|
|
976
|
+
}
|
|
977
|
+
)
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
);
|
|
981
|
+
});
|
|
982
|
+
var IconButton = ({
|
|
983
|
+
children,
|
|
984
|
+
disabled = false,
|
|
985
|
+
color = "primary",
|
|
986
|
+
size = "medium",
|
|
987
|
+
className,
|
|
988
|
+
...restProps
|
|
711
989
|
}) => {
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
990
|
+
const colorClasses = {
|
|
991
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
992
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
993
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
994
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
995
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
996
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
997
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
998
|
+
transparent: "bg-transparent"
|
|
999
|
+
}[color];
|
|
1000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1001
|
+
"button",
|
|
1002
|
+
{
|
|
1003
|
+
disabled,
|
|
1004
|
+
className: (0, import_clsx6.default)(
|
|
718
1005
|
{
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1006
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
1007
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
1008
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
1009
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
1010
|
+
},
|
|
1011
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
1012
|
+
className
|
|
725
1013
|
),
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1014
|
+
...restProps,
|
|
1015
|
+
children
|
|
1016
|
+
}
|
|
1017
|
+
);
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
// src/components/user-action/SearchBar.tsx
|
|
1021
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1022
|
+
var import_clsx7 = require("clsx");
|
|
1023
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1024
|
+
var SearchBar = ({
|
|
1025
|
+
placeholder,
|
|
1026
|
+
onSearch,
|
|
1027
|
+
disableOnSearch,
|
|
1028
|
+
containerClassName,
|
|
1029
|
+
...inputProps
|
|
1030
|
+
}) => {
|
|
1031
|
+
const translation = useTranslation([formTranslation]);
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1034
|
+
Input,
|
|
1035
|
+
{
|
|
1036
|
+
...inputProps,
|
|
1037
|
+
placeholder: placeholder ?? translation("search")
|
|
1038
|
+
}
|
|
1039
|
+
),
|
|
1040
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Search, { className: "w-full h-full" }) })
|
|
729
1041
|
] });
|
|
730
1042
|
};
|
|
731
1043
|
|
|
732
|
-
// src/
|
|
733
|
-
var
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
var
|
|
1044
|
+
// src/hooks/useSearch.ts
|
|
1045
|
+
var import_react12 = require("react");
|
|
1046
|
+
|
|
1047
|
+
// src/util/simpleSearch.ts
|
|
1048
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
1049
|
+
return objects.filter((object) => {
|
|
1050
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
1051
|
+
if (!mappedSearchKeywords) {
|
|
1052
|
+
return true;
|
|
1053
|
+
}
|
|
1054
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
1055
|
+
});
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
// src/hooks/useSearch.ts
|
|
1059
|
+
var useSearch = ({
|
|
1060
|
+
list,
|
|
1061
|
+
initialSearch,
|
|
1062
|
+
searchMapping,
|
|
1063
|
+
additionalSearchTags,
|
|
1064
|
+
isSearchInstant = true,
|
|
1065
|
+
sortingFunction,
|
|
1066
|
+
filter,
|
|
1067
|
+
disabled = false
|
|
1068
|
+
}) => {
|
|
1069
|
+
const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
|
|
1070
|
+
const [result, setResult] = (0, import_react12.useState)(list);
|
|
1071
|
+
const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
1072
|
+
const updateSearch = (0, import_react12.useCallback)((newSearch) => {
|
|
1073
|
+
const usedSearch = newSearch ?? search;
|
|
1074
|
+
if (newSearch) {
|
|
1075
|
+
setSearch(search);
|
|
1076
|
+
}
|
|
1077
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1078
|
+
}, [searchTags, list, search, searchMapping]);
|
|
1079
|
+
(0, import_react12.useEffect)(() => {
|
|
1080
|
+
if (isSearchInstant) {
|
|
1081
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1082
|
+
}
|
|
1083
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
1084
|
+
const filteredResult = (0, import_react12.useMemo)(() => {
|
|
1085
|
+
if (!filter) {
|
|
1086
|
+
return result;
|
|
1087
|
+
}
|
|
1088
|
+
return result.filter(filter);
|
|
1089
|
+
}, [result, filter]);
|
|
1090
|
+
const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
|
|
1091
|
+
if (!sortingFunction) {
|
|
1092
|
+
return filteredResult;
|
|
1093
|
+
}
|
|
1094
|
+
return filteredResult.sort(sortingFunction);
|
|
1095
|
+
}, [filteredResult, sortingFunction]);
|
|
1096
|
+
const usedResult = (0, import_react12.useMemo)(() => {
|
|
1097
|
+
if (!disabled) {
|
|
1098
|
+
return sortedAndFilteredResult;
|
|
1099
|
+
}
|
|
1100
|
+
return list;
|
|
1101
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
1102
|
+
return {
|
|
1103
|
+
result: usedResult,
|
|
1104
|
+
hasResult: usedResult.length > 0,
|
|
1105
|
+
allItems: list,
|
|
1106
|
+
updateSearch,
|
|
1107
|
+
search,
|
|
1108
|
+
setSearch
|
|
1109
|
+
};
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
// src/components/user-action/Select.tsx
|
|
1113
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1114
|
+
var SelectTile = ({
|
|
1115
|
+
className,
|
|
1116
|
+
disabledClassName,
|
|
737
1117
|
title,
|
|
738
|
-
|
|
739
|
-
onClick,
|
|
740
|
-
isSelected = false,
|
|
741
|
-
isDisabled = false,
|
|
742
|
-
prefix,
|
|
743
|
-
suffix,
|
|
744
|
-
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
745
|
-
selectedClassName = " bg-primary/20",
|
|
746
|
-
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
747
|
-
className
|
|
1118
|
+
...restProps
|
|
748
1119
|
}) => {
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
750
|
-
|
|
1120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1121
|
+
Tile,
|
|
751
1122
|
{
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
[selectedClassName]: isSelected && !isDisabled,
|
|
757
|
-
[disabledClassName]: isDisabled
|
|
758
|
-
},
|
|
759
|
-
className
|
|
760
|
-
),
|
|
761
|
-
onClick: isDisabled ? void 0 : onClick,
|
|
762
|
-
children: [
|
|
763
|
-
prefix,
|
|
764
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
765
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
766
|
-
!!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
767
|
-
] }),
|
|
768
|
-
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0)
|
|
769
|
-
]
|
|
1123
|
+
...restProps,
|
|
1124
|
+
className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
|
|
1125
|
+
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1126
|
+
title: { ...title, className: title.className ?? "font-semibold" }
|
|
770
1127
|
}
|
|
771
1128
|
);
|
|
772
1129
|
};
|
|
773
1130
|
|
|
774
1131
|
// src/components/layout-and-navigation/Chip.tsx
|
|
775
|
-
var
|
|
776
|
-
var
|
|
1132
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
1133
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
777
1134
|
var Chip = ({
|
|
778
1135
|
children,
|
|
779
1136
|
trailingIcon,
|
|
@@ -800,11 +1157,11 @@ var Chip = ({
|
|
|
800
1157
|
blue: "text-tag-blue-icon",
|
|
801
1158
|
pink: "text-tag-pink-icon"
|
|
802
1159
|
}[color];
|
|
803
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
804
1161
|
"div",
|
|
805
1162
|
{
|
|
806
1163
|
...restProps,
|
|
807
|
-
className: (0,
|
|
1164
|
+
className: (0, import_clsx9.default)(
|
|
808
1165
|
`row w-fit px-2 py-1`,
|
|
809
1166
|
colorMapping,
|
|
810
1167
|
{
|
|
@@ -815,7 +1172,7 @@ var Chip = ({
|
|
|
815
1172
|
),
|
|
816
1173
|
children: [
|
|
817
1174
|
children,
|
|
818
|
-
trailingIcon && /* @__PURE__ */ (0,
|
|
1175
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
819
1176
|
]
|
|
820
1177
|
}
|
|
821
1178
|
);
|
|
@@ -824,7 +1181,7 @@ var ChipList = ({
|
|
|
824
1181
|
list,
|
|
825
1182
|
className = ""
|
|
826
1183
|
}) => {
|
|
827
|
-
return /* @__PURE__ */ (0,
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx9.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
828
1185
|
Chip,
|
|
829
1186
|
{
|
|
830
1187
|
...value,
|
|
@@ -836,28 +1193,74 @@ var ChipList = ({
|
|
|
836
1193
|
)) });
|
|
837
1194
|
};
|
|
838
1195
|
|
|
839
|
-
// src/
|
|
840
|
-
var
|
|
841
|
-
var
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1196
|
+
// src/components/user-action/Checkbox.tsx
|
|
1197
|
+
var import_react15 = require("react");
|
|
1198
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1199
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1200
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
1201
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1202
|
+
var checkboxSizeMapping = {
|
|
1203
|
+
small: "size-5",
|
|
1204
|
+
medium: "size-6",
|
|
1205
|
+
large: "size-8"
|
|
1206
|
+
};
|
|
1207
|
+
var checkboxIconSizeMapping = {
|
|
1208
|
+
small: "size-4",
|
|
1209
|
+
medium: "size-5",
|
|
1210
|
+
large: "size-7"
|
|
1211
|
+
};
|
|
1212
|
+
var Checkbox = ({
|
|
1213
|
+
id,
|
|
1214
|
+
label,
|
|
1215
|
+
checked,
|
|
1216
|
+
disabled,
|
|
1217
|
+
onChange,
|
|
1218
|
+
onChangeTristate,
|
|
1219
|
+
size = "medium",
|
|
1220
|
+
className = "",
|
|
1221
|
+
containerClassName
|
|
1222
|
+
}) => {
|
|
1223
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
1224
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
1225
|
+
const propagateChange = (checked2) => {
|
|
1226
|
+
if (onChangeTristate) {
|
|
1227
|
+
onChangeTristate(checked2);
|
|
1228
|
+
}
|
|
1229
|
+
if (onChange) {
|
|
1230
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
const changeValue = () => {
|
|
1234
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1235
|
+
propagateChange(newValue);
|
|
1236
|
+
};
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_clsx10.default)("group flex-row-2 items-center cursor-pointer", containerClassName), onClick: changeValue, children: [
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1239
|
+
CheckboxPrimitive.Root,
|
|
1240
|
+
{
|
|
1241
|
+
onCheckedChange: propagateChange,
|
|
1242
|
+
checked,
|
|
1243
|
+
disabled,
|
|
1244
|
+
id,
|
|
1245
|
+
className: (0, import_clsx10.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1246
|
+
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1247
|
+
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1248
|
+
"bg-surface": !disabled && !checked,
|
|
1249
|
+
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1250
|
+
}, className),
|
|
1251
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
1252
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Check, { className: innerIconSize }),
|
|
1253
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Minus, { className: innerIconSize })
|
|
1254
|
+
] })
|
|
847
1255
|
}
|
|
848
|
-
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
document.addEventListener("touchstart", listener);
|
|
852
|
-
return () => {
|
|
853
|
-
document.removeEventListener("mousedown", listener);
|
|
854
|
-
document.removeEventListener("touchstart", listener);
|
|
855
|
-
};
|
|
856
|
-
}, [refs, handler]);
|
|
1256
|
+
),
|
|
1257
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Label, { ...label, className: (0, import_clsx10.default)(label.className), htmlFor: id })
|
|
1258
|
+
] });
|
|
857
1259
|
};
|
|
858
1260
|
|
|
859
1261
|
// src/components/user-action/MultiSelect.tsx
|
|
860
|
-
var
|
|
1262
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1263
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
861
1264
|
var defaultMultiSelectTranslation = {
|
|
862
1265
|
en: {
|
|
863
1266
|
selected: `{{amount}} selected`
|
|
@@ -868,89 +1271,107 @@ var defaultMultiSelectTranslation = {
|
|
|
868
1271
|
};
|
|
869
1272
|
var MultiSelect = ({
|
|
870
1273
|
overwriteTranslation,
|
|
871
|
-
options,
|
|
872
1274
|
label,
|
|
1275
|
+
options,
|
|
873
1276
|
onChange,
|
|
874
1277
|
hintText,
|
|
875
|
-
isDisabled = false,
|
|
876
|
-
isSearchEnabled = false,
|
|
877
1278
|
selectedDisplayOverwrite,
|
|
1279
|
+
searchOptions,
|
|
1280
|
+
additionalItems,
|
|
878
1281
|
useChipDisplay = false,
|
|
879
|
-
className
|
|
1282
|
+
className,
|
|
1283
|
+
triggerClassName,
|
|
1284
|
+
hintTextClassName,
|
|
1285
|
+
...menuProps
|
|
880
1286
|
}) => {
|
|
881
1287
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
1288
|
+
const { result, search, setSearch } = useSearch({
|
|
1289
|
+
list: options,
|
|
1290
|
+
searchMapping: (0, import_react16.useCallback)((item) => item.searchTags, []),
|
|
1291
|
+
...searchOptions
|
|
1292
|
+
});
|
|
886
1293
|
const selectedItems = options.filter((value) => value.selected);
|
|
887
1294
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
888
|
-
return /* @__PURE__ */ (0,
|
|
889
|
-
label && /* @__PURE__ */ (0,
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx11.default)(className), children: [
|
|
1296
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
890
1297
|
Label,
|
|
891
1298
|
{
|
|
892
1299
|
...label,
|
|
893
1300
|
htmlFor: label.name,
|
|
894
|
-
className: (0,
|
|
1301
|
+
className: (0, import_clsx11.default)(" mb-1", label.className),
|
|
895
1302
|
labelType: label.labelType ?? "labelBig"
|
|
896
1303
|
}
|
|
897
1304
|
),
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
"
|
|
908
|
-
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
909
|
-
}
|
|
910
|
-
),
|
|
911
|
-
onClick: () => setIsOpen(!isOpen),
|
|
912
|
-
disabled: isDisabled,
|
|
913
|
-
children: [
|
|
914
|
-
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
|
|
915
|
-
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
916
|
-
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, { className: "min-w-6" })
|
|
917
|
-
]
|
|
918
|
-
}
|
|
919
|
-
),
|
|
920
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
921
|
-
"div",
|
|
922
|
-
{
|
|
923
|
-
ref: menuRef,
|
|
924
|
-
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
|
|
925
|
-
children: [
|
|
926
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
927
|
-
SearchableList,
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1306
|
+
Menu,
|
|
1307
|
+
{
|
|
1308
|
+
...menuProps,
|
|
1309
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1310
|
+
"button",
|
|
1311
|
+
{
|
|
1312
|
+
ref,
|
|
1313
|
+
className: (0, import_clsx11.default)(
|
|
1314
|
+
"btn-md justify-between w-full border-2 h-auto",
|
|
928
1315
|
{
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1316
|
+
"min-h-14": useChipDisplay,
|
|
1317
|
+
"bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
|
|
1318
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1319
|
+
},
|
|
1320
|
+
triggerClassName
|
|
1321
|
+
),
|
|
1322
|
+
onClick: toggleOpen,
|
|
1323
|
+
disabled,
|
|
1324
|
+
children: useChipDisplay ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: isShowingHint ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconButton, { disabled, size: "small", color: "neutral", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.Plus, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1325
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1326
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: (0, import_clsx11.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1328
|
+
] })
|
|
1329
|
+
}
|
|
1330
|
+
),
|
|
1331
|
+
menuClassName: (0, import_clsx11.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1332
|
+
children: (bag) => {
|
|
1333
|
+
const { close } = bag;
|
|
1334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1335
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1336
|
+
SearchBar,
|
|
1337
|
+
{
|
|
1338
|
+
value: search,
|
|
1339
|
+
onChangeText: setSearch,
|
|
1340
|
+
autoFocus: true
|
|
1341
|
+
}
|
|
1342
|
+
),
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1344
|
+
result.map((option, index) => {
|
|
1345
|
+
const update = () => {
|
|
1346
|
+
onChange(options.map((value) => value.value === option.value ? {
|
|
1347
|
+
...option,
|
|
1348
|
+
selected: !value.selected
|
|
1349
|
+
} : value));
|
|
1350
|
+
};
|
|
1351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1352
|
+
SelectTile,
|
|
934
1353
|
{
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
},
|
|
945
|
-
|
|
1354
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1355
|
+
Checkbox,
|
|
1356
|
+
{
|
|
1357
|
+
checked: option.selected,
|
|
1358
|
+
onChange: update,
|
|
1359
|
+
size: "small",
|
|
1360
|
+
disabled: option.disabled
|
|
1361
|
+
}
|
|
1362
|
+
),
|
|
1363
|
+
title: { value: option.label },
|
|
1364
|
+
onClick: update,
|
|
1365
|
+
disabled: option.disabled
|
|
946
1366
|
},
|
|
947
1367
|
index
|
|
948
|
-
)
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1368
|
+
);
|
|
1369
|
+
}),
|
|
1370
|
+
additionalItems && additionalItems({ ...bag, search })
|
|
1371
|
+
] }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2 justify-between", children: [
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2", children: [
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
954
1375
|
SolidButton,
|
|
955
1376
|
{
|
|
956
1377
|
color: "neutral",
|
|
@@ -965,7 +1386,7 @@ var MultiSelect = ({
|
|
|
965
1386
|
children: translation("all")
|
|
966
1387
|
}
|
|
967
1388
|
),
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
1389
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
969
1390
|
SolidButton,
|
|
970
1391
|
{
|
|
971
1392
|
color: "neutral",
|
|
@@ -980,12 +1401,12 @@ var MultiSelect = ({
|
|
|
980
1401
|
}
|
|
981
1402
|
)
|
|
982
1403
|
] }),
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
984
1405
|
] })
|
|
985
|
-
]
|
|
1406
|
+
] });
|
|
986
1407
|
}
|
|
987
|
-
|
|
988
|
-
|
|
1408
|
+
}
|
|
1409
|
+
)
|
|
989
1410
|
] });
|
|
990
1411
|
};
|
|
991
1412
|
var MultiSelectUncontrolled = ({
|
|
@@ -993,11 +1414,11 @@ var MultiSelectUncontrolled = ({
|
|
|
993
1414
|
onChange,
|
|
994
1415
|
...props
|
|
995
1416
|
}) => {
|
|
996
|
-
const [usedOptions, setUsedOptions] = (0,
|
|
997
|
-
(0,
|
|
1417
|
+
const [usedOptions, setUsedOptions] = (0, import_react17.useState)(options);
|
|
1418
|
+
(0, import_react17.useEffect)(() => {
|
|
998
1419
|
setUsedOptions(options);
|
|
999
1420
|
}, [options]);
|
|
1000
|
-
return /* @__PURE__ */ (0,
|
|
1421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1001
1422
|
MultiSelect,
|
|
1002
1423
|
{
|
|
1003
1424
|
...props,
|