@helpwave/hightide 0.1.18 → 0.1.20
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 +67 -39
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +56 -28
- 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 +48 -20
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +46 -18
- 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 +10 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +10 -1
- package/dist/components/layout-and-navigation/Expandable.js +38 -10
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +38 -11
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +36 -12
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +38 -14
- 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.d.mts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.js +14 -327
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +15 -318
- 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/loading-states/LoadingContainer.d.mts +8 -0
- package/dist/components/loading-states/LoadingContainer.d.ts +8 -0
- package/dist/components/loading-states/LoadingContainer.js +34 -0
- package/dist/components/loading-states/LoadingContainer.js.map +1 -0
- package/dist/components/loading-states/LoadingContainer.mjs +10 -0
- package/dist/components/loading-states/LoadingContainer.mjs.map +1 -0
- 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 +729 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +729 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +733 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +732 -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 +916 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +921 -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 +683 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +687 -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 +81 -49
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +67 -35
- 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 +797 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +782 -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 +765 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +762 -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 +284 -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 +96 -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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1197 -902
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1048 -754
- 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
|
@@ -32,8 +32,8 @@ __export(MultiSelectProperty_exports, {
|
|
|
32
32
|
MultiSelectProperty: () => MultiSelectProperty
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(MultiSelectProperty_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var import_lucide_react7 = require("lucide-react");
|
|
36
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
37
37
|
|
|
38
38
|
// src/localization/LanguageProvider.tsx
|
|
39
39
|
var import_react2 = require("react");
|
|
@@ -123,9 +123,9 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// src/components/user-action/MultiSelect.tsx
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
126
|
+
var import_react16 = require("react");
|
|
127
|
+
var import_react17 = require("react");
|
|
128
|
+
var import_clsx11 = __toESM(require("clsx"));
|
|
129
129
|
|
|
130
130
|
// src/components/user-action/Label.tsx
|
|
131
131
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -145,22 +145,390 @@ var Label = ({
|
|
|
145
145
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
// src/components/
|
|
148
|
+
// src/components/user-action/Select.tsx
|
|
149
|
+
var import_react13 = require("react");
|
|
150
|
+
var import_react14 = require("react");
|
|
151
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
152
|
+
|
|
153
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
154
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
149
155
|
var import_lucide_react = require("lucide-react");
|
|
156
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
157
|
+
var Tile = ({
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
onClick,
|
|
161
|
+
isSelected = false,
|
|
162
|
+
disabled = false,
|
|
163
|
+
prefix,
|
|
164
|
+
suffix,
|
|
165
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
166
|
+
selectedClassName = " bg-primary/20",
|
|
167
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
168
|
+
className
|
|
169
|
+
}) => {
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
className: (0, import_clsx2.default)(
|
|
174
|
+
"flex-row-2 w-full items-center",
|
|
175
|
+
{
|
|
176
|
+
[normalClassName]: !!onClick && !disabled,
|
|
177
|
+
[selectedClassName]: isSelected && !disabled,
|
|
178
|
+
[disabledClassName]: disabled
|
|
179
|
+
},
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
onClick: disabled ? void 0 : onClick,
|
|
183
|
+
children: [
|
|
184
|
+
prefix,
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: (0, import_clsx2.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
187
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
188
|
+
] }),
|
|
189
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Check, { size: 24 }) : void 0)
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
196
|
+
var import_react3 = require("react");
|
|
197
|
+
var import_lucide_react2 = require("lucide-react");
|
|
198
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
199
|
+
|
|
200
|
+
// src/util/noop.ts
|
|
201
|
+
var noop = () => void 0;
|
|
202
|
+
|
|
203
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
204
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
205
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
207
|
+
import_lucide_react2.ChevronDown,
|
|
208
|
+
{
|
|
209
|
+
className: (0, import_clsx3.default)(
|
|
210
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
211
|
+
{ "rotate-180": isExpanded },
|
|
212
|
+
className
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
var Expandable = (0, import_react3.forwardRef)(function Expandable2({
|
|
218
|
+
children,
|
|
219
|
+
label,
|
|
220
|
+
icon,
|
|
221
|
+
isExpanded = false,
|
|
222
|
+
onChange = noop,
|
|
223
|
+
clickOnlyOnHeader = true,
|
|
224
|
+
disabled = false,
|
|
225
|
+
className,
|
|
226
|
+
headerClassName,
|
|
227
|
+
contentClassName,
|
|
228
|
+
contentExpandedClassName
|
|
229
|
+
}, ref) {
|
|
230
|
+
const defaultIcon = (0, import_react3.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
231
|
+
icon ??= defaultIcon;
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
ref,
|
|
236
|
+
className: (0, import_clsx3.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
237
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
className: (0, import_clsx3.default)(
|
|
243
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
244
|
+
{
|
|
245
|
+
"group-hover:brightness-97": !isExpanded,
|
|
246
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
247
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
248
|
+
},
|
|
249
|
+
headerClassName
|
|
250
|
+
),
|
|
251
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
252
|
+
children: [
|
|
253
|
+
label,
|
|
254
|
+
icon(isExpanded)
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: (0, import_clsx3.default)(
|
|
262
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
263
|
+
{
|
|
264
|
+
[(0, import_clsx3.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
265
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
266
|
+
},
|
|
267
|
+
contentClassName
|
|
268
|
+
),
|
|
269
|
+
children
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
});
|
|
276
|
+
var ExpandableUncontrolled = (0, import_react3.forwardRef)(function ExpandableUncontrolled2({
|
|
277
|
+
isExpanded,
|
|
278
|
+
onChange = noop,
|
|
279
|
+
...props
|
|
280
|
+
}, ref) {
|
|
281
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react3.useState)(isExpanded);
|
|
282
|
+
(0, import_react3.useEffect)(() => {
|
|
283
|
+
setUsedIsExpanded(isExpanded);
|
|
284
|
+
}, [isExpanded]);
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
286
|
+
Expandable,
|
|
287
|
+
{
|
|
288
|
+
...props,
|
|
289
|
+
ref,
|
|
290
|
+
isExpanded: usedIsExpanded,
|
|
291
|
+
onChange: (value) => {
|
|
292
|
+
onChange(value);
|
|
293
|
+
setUsedIsExpanded(value);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// src/components/user-action/Menu.tsx
|
|
300
|
+
var import_react6 = require("react");
|
|
150
301
|
var import_clsx4 = __toESM(require("clsx"));
|
|
151
302
|
|
|
303
|
+
// src/hooks/useOutsideClick.ts
|
|
304
|
+
var import_react4 = require("react");
|
|
305
|
+
var useOutsideClick = (refs, handler) => {
|
|
306
|
+
(0, import_react4.useEffect)(() => {
|
|
307
|
+
const listener = (event) => {
|
|
308
|
+
if (event.target === null) return;
|
|
309
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
handler();
|
|
313
|
+
};
|
|
314
|
+
document.addEventListener("mousedown", listener);
|
|
315
|
+
document.addEventListener("touchstart", listener);
|
|
316
|
+
return () => {
|
|
317
|
+
document.removeEventListener("mousedown", listener);
|
|
318
|
+
document.removeEventListener("touchstart", listener);
|
|
319
|
+
};
|
|
320
|
+
}, [refs, handler]);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
// src/hooks/useHoverState.ts
|
|
324
|
+
var import_react5 = require("react");
|
|
325
|
+
var defaultUseHoverStateProps = {
|
|
326
|
+
closingDelay: 200,
|
|
327
|
+
isDisabled: false
|
|
328
|
+
};
|
|
329
|
+
var useHoverState = (props = void 0) => {
|
|
330
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
331
|
+
const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
|
|
332
|
+
const [timer, setTimer] = (0, import_react5.useState)();
|
|
333
|
+
const onMouseEnter = () => {
|
|
334
|
+
if (isDisabled) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
clearTimeout(timer);
|
|
338
|
+
setIsHovered(true);
|
|
339
|
+
};
|
|
340
|
+
const onMouseLeave = () => {
|
|
341
|
+
if (isDisabled) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
setTimer(setTimeout(() => {
|
|
345
|
+
setIsHovered(false);
|
|
346
|
+
}, closingDelay));
|
|
347
|
+
};
|
|
348
|
+
(0, import_react5.useEffect)(() => {
|
|
349
|
+
if (timer) {
|
|
350
|
+
return () => {
|
|
351
|
+
clearTimeout(timer);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
(0, import_react5.useEffect)(() => {
|
|
356
|
+
if (timer) {
|
|
357
|
+
clearTimeout(timer);
|
|
358
|
+
}
|
|
359
|
+
}, [isDisabled]);
|
|
360
|
+
return {
|
|
361
|
+
isHovered,
|
|
362
|
+
setIsHovered,
|
|
363
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
368
|
+
var resolve = (children, bag) => {
|
|
369
|
+
if (typeof children === "function") {
|
|
370
|
+
return children(bag);
|
|
371
|
+
}
|
|
372
|
+
return children ?? void 0;
|
|
373
|
+
};
|
|
374
|
+
var BagFunctionUtil = {
|
|
375
|
+
resolve
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// src/hooks/usePopoverPosition.ts
|
|
379
|
+
var defaultPopoverPositionOptions = {
|
|
380
|
+
edgePadding: 16,
|
|
381
|
+
outerGap: 4,
|
|
382
|
+
horizontalAlignment: "leftInside",
|
|
383
|
+
verticalAlignment: "bottomOutside",
|
|
384
|
+
disabled: false
|
|
385
|
+
};
|
|
386
|
+
var usePopoverPosition = (trigger, options) => {
|
|
387
|
+
const {
|
|
388
|
+
edgePadding,
|
|
389
|
+
outerGap,
|
|
390
|
+
verticalAlignment,
|
|
391
|
+
horizontalAlignment,
|
|
392
|
+
disabled
|
|
393
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
394
|
+
if (disabled || !trigger) {
|
|
395
|
+
return {};
|
|
396
|
+
}
|
|
397
|
+
const left = {
|
|
398
|
+
leftOutside: trigger.left - outerGap,
|
|
399
|
+
leftInside: trigger.left,
|
|
400
|
+
rightOutside: trigger.right + outerGap,
|
|
401
|
+
rightInside: trigger.right,
|
|
402
|
+
center: trigger.left + trigger.width / 2
|
|
403
|
+
}[horizontalAlignment];
|
|
404
|
+
const top = {
|
|
405
|
+
topOutside: trigger.top - outerGap,
|
|
406
|
+
topInside: trigger.top,
|
|
407
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
408
|
+
bottomInside: trigger.bottom,
|
|
409
|
+
center: trigger.top + trigger.height / 2
|
|
410
|
+
}[verticalAlignment];
|
|
411
|
+
const translateX = {
|
|
412
|
+
leftOutside: "-100%",
|
|
413
|
+
leftInside: void 0,
|
|
414
|
+
rightOutside: void 0,
|
|
415
|
+
rightInside: "-100%",
|
|
416
|
+
center: "-50%"
|
|
417
|
+
}[horizontalAlignment];
|
|
418
|
+
const translateY = {
|
|
419
|
+
topOutside: "-100%",
|
|
420
|
+
topInside: void 0,
|
|
421
|
+
bottomOutside: void 0,
|
|
422
|
+
bottomInside: "-100%",
|
|
423
|
+
center: "-50%"
|
|
424
|
+
}[verticalAlignment];
|
|
425
|
+
return {
|
|
426
|
+
left: Math.max(left, edgePadding),
|
|
427
|
+
top: Math.max(top, edgePadding),
|
|
428
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// src/components/user-action/Menu.tsx
|
|
433
|
+
var import_react_dom = require("react-dom");
|
|
434
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
435
|
+
function getScrollableParents(element) {
|
|
436
|
+
const scrollables = [];
|
|
437
|
+
let parent = element.parentElement;
|
|
438
|
+
while (parent) {
|
|
439
|
+
scrollables.push(parent);
|
|
440
|
+
parent = parent.parentElement;
|
|
441
|
+
}
|
|
442
|
+
return scrollables;
|
|
443
|
+
}
|
|
444
|
+
var Menu = ({
|
|
445
|
+
trigger,
|
|
446
|
+
children,
|
|
447
|
+
alignmentHorizontal = "leftInside",
|
|
448
|
+
alignmentVertical = "bottomOutside",
|
|
449
|
+
showOnHover = false,
|
|
450
|
+
disabled = false,
|
|
451
|
+
menuClassName = ""
|
|
452
|
+
}) => {
|
|
453
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
454
|
+
const triggerRef = (0, import_react6.useRef)(null);
|
|
455
|
+
const menuRef = (0, import_react6.useRef)(null);
|
|
456
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
457
|
+
const [isHidden, setIsHidden] = (0, import_react6.useState)(true);
|
|
458
|
+
const bag = {
|
|
459
|
+
isOpen,
|
|
460
|
+
close: () => setIsOpen(false),
|
|
461
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
462
|
+
disabled
|
|
463
|
+
};
|
|
464
|
+
const menuPosition = usePopoverPosition(
|
|
465
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
466
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
467
|
+
);
|
|
468
|
+
(0, import_react6.useEffect)(() => {
|
|
469
|
+
if (!isOpen) return;
|
|
470
|
+
const triggerEl = triggerRef.current;
|
|
471
|
+
if (!triggerEl) return;
|
|
472
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
473
|
+
const close = () => setIsOpen(false);
|
|
474
|
+
scrollableParents.forEach((parent) => {
|
|
475
|
+
parent.addEventListener("scroll", close);
|
|
476
|
+
});
|
|
477
|
+
window.addEventListener("resize", close);
|
|
478
|
+
return () => {
|
|
479
|
+
scrollableParents.forEach((parent) => {
|
|
480
|
+
parent.removeEventListener("scroll", close);
|
|
481
|
+
});
|
|
482
|
+
window.removeEventListener("resize", close);
|
|
483
|
+
};
|
|
484
|
+
}, [isOpen, setIsOpen]);
|
|
485
|
+
(0, import_react6.useEffect)(() => {
|
|
486
|
+
if (isOpen) {
|
|
487
|
+
setIsHidden(false);
|
|
488
|
+
}
|
|
489
|
+
}, [isOpen]);
|
|
490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
491
|
+
trigger(bag, triggerRef),
|
|
492
|
+
(0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
493
|
+
"div",
|
|
494
|
+
{
|
|
495
|
+
ref: menuRef,
|
|
496
|
+
onClick: (e) => e.stopPropagation(),
|
|
497
|
+
className: (0, import_clsx4.default)(
|
|
498
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
499
|
+
{
|
|
500
|
+
"animate-pop-in": isOpen,
|
|
501
|
+
"animate-pop-out": !isOpen,
|
|
502
|
+
"hidden": isHidden
|
|
503
|
+
},
|
|
504
|
+
menuClassName
|
|
505
|
+
),
|
|
506
|
+
onAnimationEnd: () => {
|
|
507
|
+
if (!isOpen) {
|
|
508
|
+
setIsHidden(true);
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
style: {
|
|
512
|
+
...menuPosition
|
|
513
|
+
},
|
|
514
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
515
|
+
}
|
|
516
|
+
), document.body)
|
|
517
|
+
] });
|
|
518
|
+
};
|
|
519
|
+
|
|
152
520
|
// src/components/user-action/Input.tsx
|
|
153
|
-
var
|
|
154
|
-
var
|
|
521
|
+
var import_react10 = require("react");
|
|
522
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
155
523
|
|
|
156
524
|
// src/hooks/useDelay.ts
|
|
157
|
-
var
|
|
525
|
+
var import_react7 = require("react");
|
|
158
526
|
var defaultOptions = {
|
|
159
527
|
delay: 3e3,
|
|
160
528
|
disabled: false
|
|
161
529
|
};
|
|
162
530
|
function useDelay(options) {
|
|
163
|
-
const [timer, setTimer] = (0,
|
|
531
|
+
const [timer, setTimer] = (0, import_react7.useState)(void 0);
|
|
164
532
|
const { delay, disabled } = {
|
|
165
533
|
...defaultOptions,
|
|
166
534
|
...options
|
|
@@ -179,12 +547,12 @@ function useDelay(options) {
|
|
|
179
547
|
setTimer(void 0);
|
|
180
548
|
}, delay));
|
|
181
549
|
};
|
|
182
|
-
(0,
|
|
550
|
+
(0, import_react7.useEffect)(() => {
|
|
183
551
|
return () => {
|
|
184
552
|
clearTimeout(timer);
|
|
185
553
|
};
|
|
186
554
|
}, [timer]);
|
|
187
|
-
(0,
|
|
555
|
+
(0, import_react7.useEffect)(() => {
|
|
188
556
|
if (disabled) {
|
|
189
557
|
clearTimeout(timer);
|
|
190
558
|
setTimer(void 0);
|
|
@@ -193,13 +561,10 @@ function useDelay(options) {
|
|
|
193
561
|
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
194
562
|
}
|
|
195
563
|
|
|
196
|
-
// src/util/noop.ts
|
|
197
|
-
var noop = () => void 0;
|
|
198
|
-
|
|
199
564
|
// src/hooks/useFocusManagement.ts
|
|
200
|
-
var
|
|
565
|
+
var import_react8 = require("react");
|
|
201
566
|
function useFocusManagement() {
|
|
202
|
-
const getFocusableElements = (0,
|
|
567
|
+
const getFocusableElements = (0, import_react8.useCallback)(() => {
|
|
203
568
|
return Array.from(
|
|
204
569
|
document.querySelectorAll(
|
|
205
570
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -208,7 +573,7 @@ function useFocusManagement() {
|
|
|
208
573
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
209
574
|
);
|
|
210
575
|
}, []);
|
|
211
|
-
const getNextFocusElement = (0,
|
|
576
|
+
const getNextFocusElement = (0, import_react8.useCallback)(() => {
|
|
212
577
|
const elements = getFocusableElements();
|
|
213
578
|
if (elements.length === 0) {
|
|
214
579
|
return void 0;
|
|
@@ -220,11 +585,11 @@ function useFocusManagement() {
|
|
|
220
585
|
}
|
|
221
586
|
return nextElement;
|
|
222
587
|
}, [getFocusableElements]);
|
|
223
|
-
const focusNext = (0,
|
|
588
|
+
const focusNext = (0, import_react8.useCallback)(() => {
|
|
224
589
|
const nextElement = getNextFocusElement();
|
|
225
590
|
nextElement?.focus();
|
|
226
591
|
}, [getNextFocusElement]);
|
|
227
|
-
const getPreviousFocusElement = (0,
|
|
592
|
+
const getPreviousFocusElement = (0, import_react8.useCallback)(() => {
|
|
228
593
|
const elements = getFocusableElements();
|
|
229
594
|
if (elements.length === 0) {
|
|
230
595
|
return void 0;
|
|
@@ -240,7 +605,7 @@ function useFocusManagement() {
|
|
|
240
605
|
}
|
|
241
606
|
return previousElement;
|
|
242
607
|
}, [getFocusableElements]);
|
|
243
|
-
const focusPrevious = (0,
|
|
608
|
+
const focusPrevious = (0, import_react8.useCallback)(() => {
|
|
244
609
|
const previousElement = getPreviousFocusElement();
|
|
245
610
|
if (previousElement) previousElement.focus();
|
|
246
611
|
}, [getPreviousFocusElement]);
|
|
@@ -254,10 +619,10 @@ function useFocusManagement() {
|
|
|
254
619
|
}
|
|
255
620
|
|
|
256
621
|
// src/hooks/useFocusOnceVisible.ts
|
|
257
|
-
var
|
|
622
|
+
var import_react9 = __toESM(require("react"));
|
|
258
623
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
259
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
260
|
-
(0,
|
|
624
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react9.default.useState(false);
|
|
625
|
+
(0, import_react9.useEffect)(() => {
|
|
261
626
|
if (disable || hasUsedFocus) {
|
|
262
627
|
return;
|
|
263
628
|
}
|
|
@@ -277,9 +642,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
277
642
|
};
|
|
278
643
|
|
|
279
644
|
// src/components/user-action/Input.tsx
|
|
280
|
-
var
|
|
645
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
281
646
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
282
|
-
return (0,
|
|
647
|
+
return (0, import_clsx5.default)(
|
|
283
648
|
"px-2 py-1.5 rounded-md border-2",
|
|
284
649
|
{
|
|
285
650
|
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -293,7 +658,7 @@ var defaultEditCompleteOptions = {
|
|
|
293
658
|
afterDelay: true,
|
|
294
659
|
delay: 2500
|
|
295
660
|
};
|
|
296
|
-
var Input = (0,
|
|
661
|
+
var Input = (0, import_react10.forwardRef)(function Input2({
|
|
297
662
|
id,
|
|
298
663
|
type = "text",
|
|
299
664
|
value,
|
|
@@ -316,10 +681,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
316
681
|
restartTimer,
|
|
317
682
|
clearTimer
|
|
318
683
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
319
|
-
const innerRef = (0,
|
|
684
|
+
const innerRef = (0, import_react10.useRef)(null);
|
|
320
685
|
const { focusNext } = useFocusManagement();
|
|
321
686
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
322
|
-
(0,
|
|
687
|
+
(0, import_react10.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
323
688
|
const handleKeyDown = (e) => {
|
|
324
689
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
325
690
|
e.preventDefault();
|
|
@@ -327,9 +692,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
327
692
|
focusNext();
|
|
328
693
|
}
|
|
329
694
|
};
|
|
330
|
-
return /* @__PURE__ */ (0,
|
|
331
|
-
label && /* @__PURE__ */ (0,
|
|
332
|
-
/* @__PURE__ */ (0,
|
|
695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)({ "w-full": expanded }, containerClassName), children: [
|
|
696
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx5.default)("mb-1", label.className) }),
|
|
697
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
333
698
|
"input",
|
|
334
699
|
{
|
|
335
700
|
...restProps,
|
|
@@ -338,7 +703,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
338
703
|
id,
|
|
339
704
|
type,
|
|
340
705
|
disabled,
|
|
341
|
-
className: (0,
|
|
706
|
+
className: (0, import_clsx5.default)(getInputClassName({ disabled }), className),
|
|
342
707
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
343
708
|
onBlur: (event) => {
|
|
344
709
|
onBlur?.(event);
|
|
@@ -368,7 +733,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
368
733
|
)
|
|
369
734
|
] });
|
|
370
735
|
});
|
|
371
|
-
var FormInput = (0,
|
|
736
|
+
var FormInput = (0, import_react10.forwardRef)(function FormInput2({
|
|
372
737
|
id,
|
|
373
738
|
labelText,
|
|
374
739
|
errorText,
|
|
@@ -380,114 +745,232 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
|
380
745
|
disabled,
|
|
381
746
|
...restProps
|
|
382
747
|
}, ref) {
|
|
383
|
-
const input = /* @__PURE__ */ (0,
|
|
748
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
384
749
|
"input",
|
|
385
750
|
{
|
|
386
751
|
...restProps,
|
|
387
752
|
ref,
|
|
388
753
|
id,
|
|
389
754
|
disabled,
|
|
390
|
-
className: (0,
|
|
755
|
+
className: (0, import_clsx5.default)(
|
|
391
756
|
getInputClassName({ disabled, hasError: !!errorText }),
|
|
392
757
|
className
|
|
393
758
|
)
|
|
394
759
|
}
|
|
395
760
|
);
|
|
396
|
-
return /* @__PURE__ */ (0,
|
|
397
|
-
labelText && /* @__PURE__ */ (0,
|
|
761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
762
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx5.default)("textstyle-label-md", labelClassName), children: [
|
|
398
763
|
labelText,
|
|
399
|
-
required && /* @__PURE__ */ (0,
|
|
764
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
400
765
|
] }),
|
|
401
766
|
input,
|
|
402
|
-
errorText && /* @__PURE__ */ (0,
|
|
767
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx5.default)("text-negative", errorClassName), children: errorText })
|
|
403
768
|
] });
|
|
404
769
|
});
|
|
405
770
|
|
|
406
|
-
// src/
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
"
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
771
|
+
// src/localization/defaults/form.ts
|
|
772
|
+
var formTranslation = {
|
|
773
|
+
en: {
|
|
774
|
+
add: "Add",
|
|
775
|
+
all: "All",
|
|
776
|
+
apply: "Apply",
|
|
777
|
+
back: "Back",
|
|
778
|
+
cancel: "Cancel",
|
|
779
|
+
change: "Change",
|
|
780
|
+
clear: "Clear",
|
|
781
|
+
click: "Click",
|
|
782
|
+
clickToCopy: "Click to Copy",
|
|
783
|
+
close: "Close",
|
|
784
|
+
confirm: "Confirm",
|
|
785
|
+
copy: "Copy",
|
|
786
|
+
copied: "Copied",
|
|
787
|
+
create: "Create",
|
|
788
|
+
decline: "Decline",
|
|
789
|
+
delete: "Delete",
|
|
790
|
+
discard: "Discard",
|
|
791
|
+
discardChanges: "Discard Changes",
|
|
792
|
+
done: "Done",
|
|
793
|
+
edit: "Edit",
|
|
794
|
+
enterText: "Enter text here",
|
|
795
|
+
error: "Error",
|
|
796
|
+
exit: "Exit",
|
|
797
|
+
fieldRequiredError: "This field is required.",
|
|
798
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
799
|
+
less: "Less",
|
|
800
|
+
loading: "Loading",
|
|
801
|
+
maxLengthError: "Maximum length exceeded.",
|
|
802
|
+
minLengthError: "Minimum length not met.",
|
|
803
|
+
more: "More",
|
|
804
|
+
next: "Next",
|
|
805
|
+
no: "No",
|
|
806
|
+
none: "None",
|
|
807
|
+
of: "of",
|
|
808
|
+
optional: "Optional",
|
|
809
|
+
pleaseWait: "Please wait...",
|
|
810
|
+
previous: "Previous",
|
|
811
|
+
remove: "Remove",
|
|
812
|
+
required: "Required",
|
|
813
|
+
reset: "Reset",
|
|
814
|
+
save: "Save",
|
|
815
|
+
saved: "Saved",
|
|
816
|
+
search: "Search",
|
|
817
|
+
select: "Select",
|
|
818
|
+
selectOption: "Select an option",
|
|
819
|
+
show: "Show",
|
|
820
|
+
showMore: "Show more",
|
|
821
|
+
showLess: "Show less",
|
|
822
|
+
submit: "Submit",
|
|
823
|
+
success: "Success",
|
|
824
|
+
update: "Update",
|
|
825
|
+
unsavedChanges: "Unsaved Changes",
|
|
826
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
827
|
+
yes: "Yes"
|
|
828
|
+
},
|
|
829
|
+
de: {
|
|
830
|
+
add: "Hinzuf\xFCgen",
|
|
831
|
+
all: "Alle",
|
|
832
|
+
apply: "Anwenden",
|
|
833
|
+
back: "Zur\xFCck",
|
|
834
|
+
cancel: "Abbrechen",
|
|
835
|
+
change: "\xC4ndern",
|
|
836
|
+
clear: "L\xF6schen",
|
|
837
|
+
click: "Klicken",
|
|
838
|
+
clickToCopy: "Zum kopieren klicken",
|
|
839
|
+
close: "Schlie\xDFen",
|
|
840
|
+
confirm: "Best\xE4tigen",
|
|
841
|
+
copy: "Kopieren",
|
|
842
|
+
copied: "Kopiert",
|
|
843
|
+
create: "Erstellen",
|
|
844
|
+
decline: "Ablehnen",
|
|
845
|
+
delete: "L\xF6schen",
|
|
846
|
+
discard: "Verwerfen",
|
|
847
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
848
|
+
done: "Fertig",
|
|
849
|
+
edit: "Bearbeiten",
|
|
850
|
+
enterText: "Text hier eingeben",
|
|
851
|
+
error: "Fehler",
|
|
852
|
+
exit: "Beenden",
|
|
853
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
854
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
855
|
+
less: "Weniger",
|
|
856
|
+
loading: "L\xE4dt",
|
|
857
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
858
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
859
|
+
more: "Mehr",
|
|
860
|
+
next: "Weiter",
|
|
861
|
+
no: "Nein",
|
|
862
|
+
none: "Nichts",
|
|
863
|
+
of: "von",
|
|
864
|
+
optional: "Optional",
|
|
865
|
+
pleaseWait: "Bitte warten...",
|
|
866
|
+
previous: "Vorherige",
|
|
867
|
+
remove: "Entfernen",
|
|
868
|
+
required: "Erforderlich",
|
|
869
|
+
reset: "Zur\xFCcksetzen",
|
|
870
|
+
save: "Speichern",
|
|
871
|
+
saved: "Gespeichert",
|
|
872
|
+
search: "Suche",
|
|
873
|
+
select: "Select",
|
|
874
|
+
selectOption: "Option ausw\xE4hlen",
|
|
875
|
+
show: "Anzeigen",
|
|
876
|
+
showMore: "Mehr anzeigen",
|
|
877
|
+
showLess: "Weniger anzeigen",
|
|
878
|
+
submit: "Abschicken",
|
|
879
|
+
success: "Erfolg",
|
|
880
|
+
update: "Update",
|
|
881
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
882
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
883
|
+
yes: "Ja"
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
// src/components/user-action/Button.tsx
|
|
888
|
+
var import_react11 = require("react");
|
|
889
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
890
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
891
|
+
var ButtonColorUtil = {
|
|
892
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
893
|
+
text: ["primary", "negative", "neutral"],
|
|
894
|
+
outline: ["primary"]
|
|
895
|
+
};
|
|
896
|
+
var IconButtonUtil = {
|
|
897
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
898
|
+
};
|
|
899
|
+
var paddingMapping = {
|
|
900
|
+
small: "btn-sm",
|
|
901
|
+
medium: "btn-md",
|
|
902
|
+
large: "btn-lg"
|
|
903
|
+
};
|
|
904
|
+
var iconPaddingMapping = {
|
|
905
|
+
tiny: "icon-btn-xs",
|
|
906
|
+
small: "icon-btn-sm",
|
|
907
|
+
medium: "icon-btn-md",
|
|
908
|
+
large: "icon-btn-lg"
|
|
909
|
+
};
|
|
910
|
+
var ButtonUtil = {
|
|
911
|
+
paddingMapping,
|
|
912
|
+
iconPaddingMapping
|
|
913
|
+
};
|
|
914
|
+
var SolidButton = (0, import_react11.forwardRef)(function SolidButton2({
|
|
915
|
+
children,
|
|
916
|
+
disabled = false,
|
|
917
|
+
color = "primary",
|
|
918
|
+
size = "medium",
|
|
919
|
+
startIcon,
|
|
920
|
+
endIcon,
|
|
921
|
+
onClick,
|
|
922
|
+
className,
|
|
923
|
+
...restProps
|
|
924
|
+
}, ref) {
|
|
925
|
+
const colorClasses = {
|
|
926
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
927
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
928
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
929
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
930
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
931
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
932
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
933
|
+
}[color];
|
|
934
|
+
const iconColorClasses = {
|
|
935
|
+
primary: "text-button-solid-primary-icon",
|
|
936
|
+
secondary: "text-button-solid-secondary-icon",
|
|
937
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
938
|
+
positive: "text-button-solid-positive-icon",
|
|
939
|
+
warning: "text-button-solid-warning-icon",
|
|
940
|
+
negative: "text-button-solid-negative-icon",
|
|
941
|
+
neutral: "text-button-solid-neutral-icon"
|
|
942
|
+
}[color];
|
|
943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
944
|
+
"button",
|
|
945
|
+
{
|
|
946
|
+
ref,
|
|
947
|
+
onClick,
|
|
948
|
+
disabled,
|
|
949
|
+
className: (0, import_clsx6.default)(
|
|
950
|
+
{
|
|
951
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
952
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
953
|
+
},
|
|
954
|
+
ButtonUtil.paddingMapping[size],
|
|
955
|
+
className
|
|
956
|
+
),
|
|
957
|
+
...restProps,
|
|
958
|
+
children: [
|
|
959
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
960
|
+
"span",
|
|
961
|
+
{
|
|
962
|
+
className: (0, import_clsx6.default)({
|
|
963
|
+
[iconColorClasses]: !disabled,
|
|
964
|
+
[`text-disabled-icon`]: disabled
|
|
482
965
|
}),
|
|
483
966
|
children: startIcon
|
|
484
967
|
}
|
|
485
968
|
),
|
|
486
969
|
children,
|
|
487
|
-
endIcon && /* @__PURE__ */ (0,
|
|
970
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
488
971
|
"span",
|
|
489
972
|
{
|
|
490
|
-
className: (0,
|
|
973
|
+
className: (0, import_clsx6.default)({
|
|
491
974
|
[iconColorClasses]: !disabled,
|
|
492
975
|
[`text-disabled-icon`]: disabled
|
|
493
976
|
}),
|
|
@@ -497,7 +980,7 @@ var SolidButton = ({
|
|
|
497
980
|
]
|
|
498
981
|
}
|
|
499
982
|
);
|
|
500
|
-
};
|
|
983
|
+
});
|
|
501
984
|
var TextButton = ({
|
|
502
985
|
children,
|
|
503
986
|
disabled = false,
|
|
@@ -519,25 +1002,25 @@ var TextButton = ({
|
|
|
519
1002
|
negative: "text-button-text-negative-icon",
|
|
520
1003
|
neutral: "text-button-text-neutral-icon"
|
|
521
1004
|
}[color];
|
|
522
|
-
return /* @__PURE__ */ (0,
|
|
1005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
523
1006
|
"button",
|
|
524
1007
|
{
|
|
525
|
-
onClick
|
|
526
|
-
disabled
|
|
527
|
-
className: (0,
|
|
1008
|
+
onClick,
|
|
1009
|
+
disabled,
|
|
1010
|
+
className: (0, import_clsx6.default)(
|
|
528
1011
|
{
|
|
529
1012
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
530
|
-
[(0,
|
|
1013
|
+
[(0, import_clsx6.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
531
1014
|
},
|
|
532
1015
|
ButtonUtil.paddingMapping[size],
|
|
533
1016
|
className
|
|
534
1017
|
),
|
|
535
1018
|
...restProps,
|
|
536
1019
|
children: [
|
|
537
|
-
startIcon && /* @__PURE__ */ (0,
|
|
1020
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
538
1021
|
"span",
|
|
539
1022
|
{
|
|
540
|
-
className: (0,
|
|
1023
|
+
className: (0, import_clsx6.default)({
|
|
541
1024
|
[iconColorClasses]: !disabled,
|
|
542
1025
|
[`text-disabled-icon`]: disabled
|
|
543
1026
|
}),
|
|
@@ -545,10 +1028,10 @@ var TextButton = ({
|
|
|
545
1028
|
}
|
|
546
1029
|
),
|
|
547
1030
|
children,
|
|
548
|
-
endIcon && /* @__PURE__ */ (0,
|
|
1031
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
549
1032
|
"span",
|
|
550
1033
|
{
|
|
551
|
-
className: (0,
|
|
1034
|
+
className: (0, import_clsx6.default)({
|
|
552
1035
|
[iconColorClasses]: !disabled,
|
|
553
1036
|
[`text-disabled-icon`]: disabled
|
|
554
1037
|
}),
|
|
@@ -564,7 +1047,6 @@ var IconButton = ({
|
|
|
564
1047
|
disabled = false,
|
|
565
1048
|
color = "primary",
|
|
566
1049
|
size = "medium",
|
|
567
|
-
onClick,
|
|
568
1050
|
className,
|
|
569
1051
|
...restProps
|
|
570
1052
|
}) => {
|
|
@@ -578,17 +1060,16 @@ var IconButton = ({
|
|
|
578
1060
|
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
579
1061
|
transparent: "bg-transparent"
|
|
580
1062
|
}[color];
|
|
581
|
-
return /* @__PURE__ */ (0,
|
|
1063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
582
1064
|
"button",
|
|
583
1065
|
{
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
className: (0, import_clsx3.default)(
|
|
1066
|
+
disabled,
|
|
1067
|
+
className: (0, import_clsx6.default)(
|
|
587
1068
|
{
|
|
588
1069
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
589
1070
|
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
590
1071
|
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
591
|
-
[(0,
|
|
1072
|
+
[(0, import_clsx6.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
592
1073
|
},
|
|
593
1074
|
ButtonUtil.iconPaddingMapping[size],
|
|
594
1075
|
className
|
|
@@ -599,17 +1080,41 @@ var IconButton = ({
|
|
|
599
1080
|
);
|
|
600
1081
|
};
|
|
601
1082
|
|
|
1083
|
+
// src/components/user-action/SearchBar.tsx
|
|
1084
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1085
|
+
var import_clsx7 = require("clsx");
|
|
1086
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1087
|
+
var SearchBar = ({
|
|
1088
|
+
placeholder,
|
|
1089
|
+
onSearch,
|
|
1090
|
+
disableOnSearch,
|
|
1091
|
+
containerClassName,
|
|
1092
|
+
...inputProps
|
|
1093
|
+
}) => {
|
|
1094
|
+
const translation = useTranslation([formTranslation]);
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1097
|
+
Input,
|
|
1098
|
+
{
|
|
1099
|
+
...inputProps,
|
|
1100
|
+
placeholder: placeholder ?? translation("search")
|
|
1101
|
+
}
|
|
1102
|
+
),
|
|
1103
|
+
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" }) })
|
|
1104
|
+
] });
|
|
1105
|
+
};
|
|
1106
|
+
|
|
602
1107
|
// src/hooks/useSearch.ts
|
|
603
|
-
var
|
|
1108
|
+
var import_react12 = require("react");
|
|
604
1109
|
|
|
605
1110
|
// src/util/simpleSearch.ts
|
|
606
|
-
var
|
|
1111
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
607
1112
|
return objects.filter((object) => {
|
|
608
1113
|
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
609
1114
|
if (!mappedSearchKeywords) {
|
|
610
1115
|
return true;
|
|
611
1116
|
}
|
|
612
|
-
return !!mappedSearchKeywords.find((value) => value.includes(
|
|
1117
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
613
1118
|
});
|
|
614
1119
|
};
|
|
615
1120
|
|
|
@@ -617,225 +1122,78 @@ var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
|
617
1122
|
var useSearch = ({
|
|
618
1123
|
list,
|
|
619
1124
|
initialSearch,
|
|
620
|
-
searchMapping
|
|
1125
|
+
searchMapping,
|
|
1126
|
+
additionalSearchTags,
|
|
1127
|
+
isSearchInstant = true,
|
|
1128
|
+
sortingFunction,
|
|
1129
|
+
filter,
|
|
1130
|
+
disabled = false
|
|
621
1131
|
}) => {
|
|
622
|
-
const [
|
|
623
|
-
const [
|
|
624
|
-
(0,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
1132
|
+
const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
|
|
1133
|
+
const [result, setResult] = (0, import_react12.useState)(list);
|
|
1134
|
+
const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
1135
|
+
const updateSearch = (0, import_react12.useCallback)((newSearch) => {
|
|
1136
|
+
const usedSearch = newSearch ?? search;
|
|
1137
|
+
if (newSearch) {
|
|
1138
|
+
setSearch(search);
|
|
1139
|
+
}
|
|
1140
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1141
|
+
}, [searchTags, list, search, searchMapping]);
|
|
1142
|
+
(0, import_react12.useEffect)(() => {
|
|
1143
|
+
if (isSearchInstant) {
|
|
1144
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1145
|
+
}
|
|
1146
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
1147
|
+
const filteredResult = (0, import_react12.useMemo)(() => {
|
|
1148
|
+
if (!filter) {
|
|
1149
|
+
return result;
|
|
1150
|
+
}
|
|
1151
|
+
return result.filter(filter);
|
|
1152
|
+
}, [result, filter]);
|
|
1153
|
+
const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
|
|
1154
|
+
if (!sortingFunction) {
|
|
1155
|
+
return filteredResult;
|
|
1156
|
+
}
|
|
1157
|
+
return filteredResult.sort(sortingFunction);
|
|
1158
|
+
}, [filteredResult, sortingFunction]);
|
|
1159
|
+
const usedResult = (0, import_react12.useMemo)(() => {
|
|
1160
|
+
if (!disabled) {
|
|
1161
|
+
return sortedAndFilteredResult;
|
|
1162
|
+
}
|
|
1163
|
+
return list;
|
|
1164
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
631
1165
|
return {
|
|
632
|
-
result,
|
|
633
|
-
hasResult:
|
|
634
|
-
allItems:
|
|
635
|
-
|
|
1166
|
+
result: usedResult,
|
|
1167
|
+
hasResult: usedResult.length > 0,
|
|
1168
|
+
allItems: list,
|
|
1169
|
+
updateSearch,
|
|
636
1170
|
search,
|
|
637
1171
|
setSearch
|
|
638
1172
|
};
|
|
639
1173
|
};
|
|
640
1174
|
|
|
641
|
-
// src/
|
|
642
|
-
var
|
|
643
|
-
|
|
644
|
-
all: "All",
|
|
645
|
-
apply: "Apply",
|
|
646
|
-
back: "Back",
|
|
647
|
-
cancel: "Cancel",
|
|
648
|
-
change: "Change",
|
|
649
|
-
clear: "Clear",
|
|
650
|
-
click: "Click",
|
|
651
|
-
clickToCopy: "Click to Copy",
|
|
652
|
-
close: "Close",
|
|
653
|
-
confirm: "Confirm",
|
|
654
|
-
copy: "Copy",
|
|
655
|
-
copied: "Copied",
|
|
656
|
-
decline: "Decline",
|
|
657
|
-
delete: "Delete",
|
|
658
|
-
discard: "Discard",
|
|
659
|
-
discardChanges: "Discard Changes",
|
|
660
|
-
done: "Done",
|
|
661
|
-
edit: "Edit",
|
|
662
|
-
enterText: "Enter text here",
|
|
663
|
-
error: "Error",
|
|
664
|
-
exit: "Exit",
|
|
665
|
-
fieldRequiredError: "This field is required.",
|
|
666
|
-
invalidEmailError: "Please enter a valid email address.",
|
|
667
|
-
less: "Less",
|
|
668
|
-
loading: "Loading",
|
|
669
|
-
maxLengthError: "Maximum length exceeded.",
|
|
670
|
-
minLengthError: "Minimum length not met.",
|
|
671
|
-
more: "More",
|
|
672
|
-
next: "Next",
|
|
673
|
-
no: "No",
|
|
674
|
-
none: "None",
|
|
675
|
-
of: "of",
|
|
676
|
-
optional: "Optional",
|
|
677
|
-
pleaseWait: "Please wait...",
|
|
678
|
-
previous: "Previous",
|
|
679
|
-
remove: "Remove",
|
|
680
|
-
required: "Required",
|
|
681
|
-
reset: "Reset",
|
|
682
|
-
save: "Save",
|
|
683
|
-
saved: "Saved",
|
|
684
|
-
search: "Search",
|
|
685
|
-
select: "Select",
|
|
686
|
-
selectOption: "Select an option",
|
|
687
|
-
show: "Show",
|
|
688
|
-
showMore: "Show more",
|
|
689
|
-
showLess: "Show less",
|
|
690
|
-
submit: "Submit",
|
|
691
|
-
success: "Success",
|
|
692
|
-
update: "Update",
|
|
693
|
-
unsavedChanges: "Unsaved Changes",
|
|
694
|
-
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
695
|
-
yes: "Yes"
|
|
696
|
-
},
|
|
697
|
-
de: {
|
|
698
|
-
all: "Alle",
|
|
699
|
-
apply: "Anwenden",
|
|
700
|
-
back: "Zur\xFCck",
|
|
701
|
-
cancel: "Abbrechen",
|
|
702
|
-
change: "\xC4ndern",
|
|
703
|
-
clear: "L\xF6schen",
|
|
704
|
-
click: "Klicken",
|
|
705
|
-
clickToCopy: "Zum kopieren klicken",
|
|
706
|
-
close: "Schlie\xDFen",
|
|
707
|
-
confirm: "Best\xE4tigen",
|
|
708
|
-
copy: "Kopieren",
|
|
709
|
-
copied: "Kopiert",
|
|
710
|
-
decline: "Ablehnen",
|
|
711
|
-
delete: "L\xF6schen",
|
|
712
|
-
discard: "Verwerfen",
|
|
713
|
-
discardChanges: "\xC4nderungen Verwerfen",
|
|
714
|
-
done: "Fertig",
|
|
715
|
-
edit: "Bearbeiten",
|
|
716
|
-
enterText: "Text hier eingeben",
|
|
717
|
-
error: "Fehler",
|
|
718
|
-
exit: "Beenden",
|
|
719
|
-
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
720
|
-
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
721
|
-
less: "Weniger",
|
|
722
|
-
loading: "L\xE4dt",
|
|
723
|
-
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
724
|
-
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
725
|
-
more: "Mehr",
|
|
726
|
-
next: "Weiter",
|
|
727
|
-
no: "Nein",
|
|
728
|
-
none: "Nichts",
|
|
729
|
-
of: "von",
|
|
730
|
-
optional: "Optional",
|
|
731
|
-
pleaseWait: "Bitte warten...",
|
|
732
|
-
previous: "Vorherige",
|
|
733
|
-
remove: "Entfernen",
|
|
734
|
-
required: "Erforderlich",
|
|
735
|
-
reset: "Zur\xFCcksetzen",
|
|
736
|
-
save: "Speichern",
|
|
737
|
-
saved: "Gespeichert",
|
|
738
|
-
search: "Suche",
|
|
739
|
-
select: "Select",
|
|
740
|
-
selectOption: "Option ausw\xE4hlen",
|
|
741
|
-
show: "Anzeigen",
|
|
742
|
-
showMore: "Mehr anzeigen",
|
|
743
|
-
showLess: "Weniger anzeigen",
|
|
744
|
-
submit: "Abschicken",
|
|
745
|
-
success: "Erfolg",
|
|
746
|
-
update: "Update",
|
|
747
|
-
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
748
|
-
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
749
|
-
yes: "Ja"
|
|
750
|
-
}
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
// src/components/layout-and-navigation/SearchableList.tsx
|
|
754
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
755
|
-
var defaultSearchableListTranslation = {
|
|
756
|
-
en: {
|
|
757
|
-
nothingFound: "Nothing found"
|
|
758
|
-
},
|
|
759
|
-
de: {
|
|
760
|
-
nothingFound: "Nichts gefunden"
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
var SearchableList = ({
|
|
764
|
-
overwriteTranslation,
|
|
765
|
-
list,
|
|
766
|
-
initialSearch = "",
|
|
767
|
-
searchMapping,
|
|
768
|
-
autoFocus,
|
|
769
|
-
minimumItemsForSearch = 6,
|
|
770
|
-
itemMapper,
|
|
1175
|
+
// src/components/user-action/Select.tsx
|
|
1176
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1177
|
+
var SelectTile = ({
|
|
771
1178
|
className,
|
|
772
|
-
|
|
773
|
-
}) => {
|
|
774
|
-
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
775
|
-
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
|
|
777
|
-
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
778
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
779
|
-
Input,
|
|
780
|
-
{
|
|
781
|
-
value: search,
|
|
782
|
-
onChangeText: setSearch,
|
|
783
|
-
placeholder: translation("search"),
|
|
784
|
-
autoFocus,
|
|
785
|
-
className: "w-full"
|
|
786
|
-
}
|
|
787
|
-
),
|
|
788
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
|
|
789
|
-
] }),
|
|
790
|
-
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
791
|
-
] });
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
795
|
-
var import_clsx5 = __toESM(require("clsx"));
|
|
796
|
-
var import_lucide_react2 = require("lucide-react");
|
|
797
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
798
|
-
var Tile = ({
|
|
1179
|
+
disabledClassName,
|
|
799
1180
|
title,
|
|
800
|
-
|
|
801
|
-
onClick,
|
|
802
|
-
isSelected = false,
|
|
803
|
-
isDisabled = false,
|
|
804
|
-
prefix,
|
|
805
|
-
suffix,
|
|
806
|
-
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
807
|
-
selectedClassName = " bg-primary/20",
|
|
808
|
-
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
809
|
-
className
|
|
1181
|
+
...restProps
|
|
810
1182
|
}) => {
|
|
811
|
-
return /* @__PURE__ */ (0,
|
|
812
|
-
|
|
1183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1184
|
+
Tile,
|
|
813
1185
|
{
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
[selectedClassName]: isSelected && !isDisabled,
|
|
819
|
-
[disabledClassName]: isDisabled
|
|
820
|
-
},
|
|
821
|
-
className
|
|
822
|
-
),
|
|
823
|
-
onClick: isDisabled ? void 0 : onClick,
|
|
824
|
-
children: [
|
|
825
|
-
prefix,
|
|
826
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
827
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
828
|
-
!!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
829
|
-
] }),
|
|
830
|
-
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0)
|
|
831
|
-
]
|
|
1186
|
+
...restProps,
|
|
1187
|
+
className: (0, import_clsx8.default)("px-2 py-1 rounded-md", className),
|
|
1188
|
+
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1189
|
+
title: { ...title, className: title.className ?? "font-semibold" }
|
|
832
1190
|
}
|
|
833
1191
|
);
|
|
834
1192
|
};
|
|
835
1193
|
|
|
836
1194
|
// src/components/layout-and-navigation/Chip.tsx
|
|
837
|
-
var
|
|
838
|
-
var
|
|
1195
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
1196
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
839
1197
|
var Chip = ({
|
|
840
1198
|
children,
|
|
841
1199
|
trailingIcon,
|
|
@@ -862,11 +1220,11 @@ var Chip = ({
|
|
|
862
1220
|
blue: "text-tag-blue-icon",
|
|
863
1221
|
pink: "text-tag-pink-icon"
|
|
864
1222
|
}[color];
|
|
865
|
-
return /* @__PURE__ */ (0,
|
|
1223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
866
1224
|
"div",
|
|
867
1225
|
{
|
|
868
1226
|
...restProps,
|
|
869
|
-
className: (0,
|
|
1227
|
+
className: (0, import_clsx9.default)(
|
|
870
1228
|
`row w-fit px-2 py-1`,
|
|
871
1229
|
colorMapping,
|
|
872
1230
|
{
|
|
@@ -877,7 +1235,7 @@ var Chip = ({
|
|
|
877
1235
|
),
|
|
878
1236
|
children: [
|
|
879
1237
|
children,
|
|
880
|
-
trailingIcon && /* @__PURE__ */ (0,
|
|
1238
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
881
1239
|
]
|
|
882
1240
|
}
|
|
883
1241
|
);
|
|
@@ -886,7 +1244,7 @@ var ChipList = ({
|
|
|
886
1244
|
list,
|
|
887
1245
|
className = ""
|
|
888
1246
|
}) => {
|
|
889
|
-
return /* @__PURE__ */ (0,
|
|
1247
|
+
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)(
|
|
890
1248
|
Chip,
|
|
891
1249
|
{
|
|
892
1250
|
...value,
|
|
@@ -898,28 +1256,74 @@ var ChipList = ({
|
|
|
898
1256
|
)) });
|
|
899
1257
|
};
|
|
900
1258
|
|
|
901
|
-
// src/
|
|
902
|
-
var
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1259
|
+
// src/components/user-action/Checkbox.tsx
|
|
1260
|
+
var import_react15 = require("react");
|
|
1261
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1262
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1263
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
1264
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1265
|
+
var checkboxSizeMapping = {
|
|
1266
|
+
small: "size-5",
|
|
1267
|
+
medium: "size-6",
|
|
1268
|
+
large: "size-8"
|
|
1269
|
+
};
|
|
1270
|
+
var checkboxIconSizeMapping = {
|
|
1271
|
+
small: "size-4",
|
|
1272
|
+
medium: "size-5",
|
|
1273
|
+
large: "size-7"
|
|
1274
|
+
};
|
|
1275
|
+
var Checkbox = ({
|
|
1276
|
+
id,
|
|
1277
|
+
label,
|
|
1278
|
+
checked,
|
|
1279
|
+
disabled,
|
|
1280
|
+
onChange,
|
|
1281
|
+
onChangeTristate,
|
|
1282
|
+
size = "medium",
|
|
1283
|
+
className = "",
|
|
1284
|
+
containerClassName
|
|
1285
|
+
}) => {
|
|
1286
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
1287
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
1288
|
+
const propagateChange = (checked2) => {
|
|
1289
|
+
if (onChangeTristate) {
|
|
1290
|
+
onChangeTristate(checked2);
|
|
1291
|
+
}
|
|
1292
|
+
if (onChange) {
|
|
1293
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
const changeValue = () => {
|
|
1297
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
1298
|
+
propagateChange(newValue);
|
|
1299
|
+
};
|
|
1300
|
+
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: [
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1302
|
+
CheckboxPrimitive.Root,
|
|
1303
|
+
{
|
|
1304
|
+
onCheckedChange: propagateChange,
|
|
1305
|
+
checked,
|
|
1306
|
+
disabled,
|
|
1307
|
+
id,
|
|
1308
|
+
className: (0, import_clsx10.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
1309
|
+
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
1310
|
+
"focus:border-primary group-hover:border-primary ": !disabled,
|
|
1311
|
+
"bg-surface": !disabled && !checked,
|
|
1312
|
+
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate"
|
|
1313
|
+
}, className),
|
|
1314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
1315
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Check, { className: innerIconSize }),
|
|
1316
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Minus, { className: innerIconSize })
|
|
1317
|
+
] })
|
|
909
1318
|
}
|
|
910
|
-
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
document.addEventListener("touchstart", listener);
|
|
914
|
-
return () => {
|
|
915
|
-
document.removeEventListener("mousedown", listener);
|
|
916
|
-
document.removeEventListener("touchstart", listener);
|
|
917
|
-
};
|
|
918
|
-
}, [refs, handler]);
|
|
1319
|
+
),
|
|
1320
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Label, { ...label, className: (0, import_clsx10.default)(label.className), htmlFor: id })
|
|
1321
|
+
] });
|
|
919
1322
|
};
|
|
920
1323
|
|
|
921
1324
|
// src/components/user-action/MultiSelect.tsx
|
|
922
|
-
var
|
|
1325
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1326
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
923
1327
|
var defaultMultiSelectTranslation = {
|
|
924
1328
|
en: {
|
|
925
1329
|
selected: `{{amount}} selected`
|
|
@@ -930,89 +1334,107 @@ var defaultMultiSelectTranslation = {
|
|
|
930
1334
|
};
|
|
931
1335
|
var MultiSelect = ({
|
|
932
1336
|
overwriteTranslation,
|
|
933
|
-
options,
|
|
934
1337
|
label,
|
|
1338
|
+
options,
|
|
935
1339
|
onChange,
|
|
936
1340
|
hintText,
|
|
937
|
-
isDisabled = false,
|
|
938
|
-
isSearchEnabled = false,
|
|
939
1341
|
selectedDisplayOverwrite,
|
|
1342
|
+
searchOptions,
|
|
1343
|
+
additionalItems,
|
|
940
1344
|
useChipDisplay = false,
|
|
941
|
-
className
|
|
1345
|
+
className,
|
|
1346
|
+
triggerClassName,
|
|
1347
|
+
hintTextClassName,
|
|
1348
|
+
...menuProps
|
|
942
1349
|
}) => {
|
|
943
1350
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1351
|
+
const { result, search, setSearch } = useSearch({
|
|
1352
|
+
list: options,
|
|
1353
|
+
searchMapping: (0, import_react16.useCallback)((item) => item.searchTags, []),
|
|
1354
|
+
...searchOptions
|
|
1355
|
+
});
|
|
948
1356
|
const selectedItems = options.filter((value) => value.selected);
|
|
949
1357
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
950
|
-
return /* @__PURE__ */ (0,
|
|
951
|
-
label && /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx11.default)(className), children: [
|
|
1359
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
952
1360
|
Label,
|
|
953
1361
|
{
|
|
954
1362
|
...label,
|
|
955
1363
|
htmlFor: label.name,
|
|
956
|
-
className: (0,
|
|
1364
|
+
className: (0, import_clsx11.default)(" mb-1", label.className),
|
|
957
1365
|
labelType: label.labelType ?? "labelBig"
|
|
958
1366
|
}
|
|
959
1367
|
),
|
|
960
|
-
/* @__PURE__ */ (0,
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
"
|
|
970
|
-
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
971
|
-
}
|
|
972
|
-
),
|
|
973
|
-
onClick: () => setIsOpen(!isOpen),
|
|
974
|
-
disabled: isDisabled,
|
|
975
|
-
children: [
|
|
976
|
-
!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() } })) }),
|
|
977
|
-
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
978
|
-
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" })
|
|
979
|
-
]
|
|
980
|
-
}
|
|
981
|
-
),
|
|
982
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
983
|
-
"div",
|
|
984
|
-
{
|
|
985
|
-
ref: menuRef,
|
|
986
|
-
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",
|
|
987
|
-
children: [
|
|
988
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
989
|
-
SearchableList,
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1369
|
+
Menu,
|
|
1370
|
+
{
|
|
1371
|
+
...menuProps,
|
|
1372
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1373
|
+
"button",
|
|
1374
|
+
{
|
|
1375
|
+
ref,
|
|
1376
|
+
className: (0, import_clsx11.default)(
|
|
1377
|
+
"btn-md justify-between w-full border-2 h-auto",
|
|
990
1378
|
{
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1379
|
+
"min-h-14": useChipDisplay,
|
|
1380
|
+
"bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
|
|
1381
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1382
|
+
},
|
|
1383
|
+
triggerClassName
|
|
1384
|
+
),
|
|
1385
|
+
onClick: toggleOpen,
|
|
1386
|
+
disabled,
|
|
1387
|
+
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: [
|
|
1388
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? translation("selected", { replacements: { amount: selectedItems.length.toString() } }) }),
|
|
1389
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: (0, import_clsx11.default)("textstyle-description", hintTextClassName), children: hintText ?? translation("select") }),
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1391
|
+
] })
|
|
1392
|
+
}
|
|
1393
|
+
),
|
|
1394
|
+
menuClassName: (0, import_clsx11.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1395
|
+
children: (bag) => {
|
|
1396
|
+
const { close } = bag;
|
|
1397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1398
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1399
|
+
SearchBar,
|
|
1400
|
+
{
|
|
1401
|
+
value: search,
|
|
1402
|
+
onChangeText: setSearch,
|
|
1403
|
+
autoFocus: true
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1407
|
+
result.map((option, index) => {
|
|
1408
|
+
const update = () => {
|
|
1409
|
+
onChange(options.map((value) => value.value === option.value ? {
|
|
1410
|
+
...option,
|
|
1411
|
+
selected: !value.selected
|
|
1412
|
+
} : value));
|
|
1413
|
+
};
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1415
|
+
SelectTile,
|
|
996
1416
|
{
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1007
|
-
|
|
1417
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1418
|
+
Checkbox,
|
|
1419
|
+
{
|
|
1420
|
+
checked: option.selected,
|
|
1421
|
+
onChange: update,
|
|
1422
|
+
size: "small",
|
|
1423
|
+
disabled: option.disabled
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
title: { value: option.label },
|
|
1427
|
+
onClick: update,
|
|
1428
|
+
disabled: option.disabled
|
|
1008
1429
|
},
|
|
1009
1430
|
index
|
|
1010
|
-
)
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1431
|
+
);
|
|
1432
|
+
}),
|
|
1433
|
+
additionalItems && additionalItems({ ...bag, search })
|
|
1434
|
+
] }),
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2 justify-between", children: [
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-row-2", children: [
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1016
1438
|
SolidButton,
|
|
1017
1439
|
{
|
|
1018
1440
|
color: "neutral",
|
|
@@ -1027,7 +1449,7 @@ var MultiSelect = ({
|
|
|
1027
1449
|
children: translation("all")
|
|
1028
1450
|
}
|
|
1029
1451
|
),
|
|
1030
|
-
/* @__PURE__ */ (0,
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1031
1453
|
SolidButton,
|
|
1032
1454
|
{
|
|
1033
1455
|
color: "neutral",
|
|
@@ -1042,19 +1464,19 @@ var MultiSelect = ({
|
|
|
1042
1464
|
}
|
|
1043
1465
|
)
|
|
1044
1466
|
] }),
|
|
1045
|
-
/* @__PURE__ */ (0,
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SolidButton, { size: "small", onClick: close, children: "Done" })
|
|
1046
1468
|
] })
|
|
1047
|
-
]
|
|
1469
|
+
] });
|
|
1048
1470
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1471
|
+
}
|
|
1472
|
+
)
|
|
1051
1473
|
] });
|
|
1052
1474
|
};
|
|
1053
1475
|
|
|
1054
1476
|
// src/components/properties/PropertyBase.tsx
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
1057
|
-
var
|
|
1477
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1478
|
+
var import_clsx12 = __toESM(require("clsx"));
|
|
1479
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1058
1480
|
var PropertyBase = ({
|
|
1059
1481
|
overwriteTranslation,
|
|
1060
1482
|
name,
|
|
@@ -1068,36 +1490,44 @@ var PropertyBase = ({
|
|
|
1068
1490
|
}) => {
|
|
1069
1491
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1070
1492
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
1071
|
-
return /* @__PURE__ */ (0,
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: (0, import_clsx12.default)("flex-row-0 group", className), children: [
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1073
1495
|
"div",
|
|
1074
1496
|
{
|
|
1075
|
-
className: (0,
|
|
1076
|
-
"
|
|
1077
|
-
|
|
1078
|
-
|
|
1497
|
+
className: (0, import_clsx12.default)(
|
|
1498
|
+
"flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
|
|
1499
|
+
{
|
|
1500
|
+
"bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
1501
|
+
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
1502
|
+
},
|
|
1503
|
+
className
|
|
1504
|
+
),
|
|
1079
1505
|
children: [
|
|
1080
|
-
icon,
|
|
1081
|
-
name
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-w-6 min-w-6 text-text-default", children: icon }),
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "font-semibold", children: name })
|
|
1082
1508
|
]
|
|
1083
1509
|
}
|
|
1084
1510
|
),
|
|
1085
|
-
/* @__PURE__ */ (0,
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1086
1512
|
"div",
|
|
1087
1513
|
{
|
|
1088
|
-
className: (0,
|
|
1089
|
-
"
|
|
1090
|
-
|
|
1091
|
-
|
|
1514
|
+
className: (0, import_clsx12.default)(
|
|
1515
|
+
"flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
|
|
1516
|
+
{
|
|
1517
|
+
"bg-surface group-hover:border-primary": !requiredAndNoValue,
|
|
1518
|
+
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
1519
|
+
},
|
|
1520
|
+
className
|
|
1521
|
+
),
|
|
1092
1522
|
children: [
|
|
1093
1523
|
input({ softRequired, hasValue }),
|
|
1094
|
-
requiredAndNoValue && /* @__PURE__ */ (0,
|
|
1095
|
-
onRemove && /* @__PURE__ */ (0,
|
|
1524
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.AlertTriangle, { size: 24 }) }),
|
|
1525
|
+
onRemove && hasValue && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1096
1526
|
TextButton,
|
|
1097
1527
|
{
|
|
1098
1528
|
onClick: onRemove,
|
|
1099
1529
|
color: "negative",
|
|
1100
|
-
className: (0,
|
|
1530
|
+
className: (0, import_clsx12.default)("items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
1101
1531
|
disabled: !hasValue || readOnly,
|
|
1102
1532
|
children: translation("remove")
|
|
1103
1533
|
}
|
|
@@ -1109,7 +1539,7 @@ var PropertyBase = ({
|
|
|
1109
1539
|
};
|
|
1110
1540
|
|
|
1111
1541
|
// src/components/properties/MultiSelectProperty.tsx
|
|
1112
|
-
var
|
|
1542
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1113
1543
|
var MultiSelectProperty = ({
|
|
1114
1544
|
overwriteTranslation,
|
|
1115
1545
|
options,
|
|
@@ -1117,11 +1547,12 @@ var MultiSelectProperty = ({
|
|
|
1117
1547
|
readOnly = false,
|
|
1118
1548
|
softRequired,
|
|
1119
1549
|
onRemove,
|
|
1550
|
+
onAddNew,
|
|
1120
1551
|
...multiSelectProps
|
|
1121
1552
|
}) => {
|
|
1122
1553
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
1123
1554
|
const hasValue = options.some((value) => value.selected);
|
|
1124
|
-
return /* @__PURE__ */ (0,
|
|
1555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1125
1556
|
PropertyBase,
|
|
1126
1557
|
{
|
|
1127
1558
|
name,
|
|
@@ -1129,20 +1560,42 @@ var MultiSelectProperty = ({
|
|
|
1129
1560
|
readOnly,
|
|
1130
1561
|
softRequired,
|
|
1131
1562
|
hasValue,
|
|
1132
|
-
icon: /* @__PURE__ */ (0,
|
|
1133
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
1134
|
-
|
|
1563
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.List, { size: 24 }),
|
|
1564
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1565
|
+
MultiSelect,
|
|
1135
1566
|
{
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1567
|
+
...multiSelectProps,
|
|
1568
|
+
className: (0, import_clsx13.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
1569
|
+
options,
|
|
1570
|
+
disabled: readOnly,
|
|
1571
|
+
useChipDisplay: true,
|
|
1572
|
+
hintText: `${translation("select")}...`,
|
|
1573
|
+
searchOptions: {
|
|
1574
|
+
sortingFunction: (a, b) => a.value.localeCompare(b.value),
|
|
1575
|
+
...multiSelectProps?.searchOptions
|
|
1576
|
+
},
|
|
1577
|
+
additionalItems: ({ close, search }) => {
|
|
1578
|
+
if (!onAddNew && !search.trim()) {
|
|
1579
|
+
return void 0;
|
|
1580
|
+
}
|
|
1581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1582
|
+
SelectTile,
|
|
1583
|
+
{
|
|
1584
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.Plus, {}),
|
|
1585
|
+
title: { value: `${translation("add")} ${search.trim()}` },
|
|
1586
|
+
onClick: () => {
|
|
1587
|
+
onAddNew(search);
|
|
1588
|
+
close();
|
|
1589
|
+
},
|
|
1590
|
+
disabled: options.some((value) => value.value === search.trim())
|
|
1591
|
+
}
|
|
1592
|
+
);
|
|
1593
|
+
},
|
|
1594
|
+
triggerClassName: (0, import_clsx13.default)(
|
|
1595
|
+
"!border-none !p-0 !min-h-10",
|
|
1139
1596
|
{
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
options,
|
|
1143
|
-
isDisabled: readOnly,
|
|
1144
|
-
useChipDisplay: true,
|
|
1145
|
-
hintText: `${translation("select")}...`
|
|
1597
|
+
"!bg-warning !text-surface-warning": softRequired2 && !hasValue,
|
|
1598
|
+
"": !softRequired2 || hasValue
|
|
1146
1599
|
}
|
|
1147
1600
|
)
|
|
1148
1601
|
}
|