@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
|
@@ -33,7 +33,7 @@ __export(SelectProperty_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(SelectProperty_exports);
|
|
35
35
|
var import_lucide_react5 = require("lucide-react");
|
|
36
|
-
var
|
|
36
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
37
37
|
|
|
38
38
|
// src/localization/LanguageProvider.tsx
|
|
39
39
|
var import_react2 = require("react");
|
|
@@ -127,6 +127,7 @@ var import_lucide_react = require("lucide-react");
|
|
|
127
127
|
var import_clsx2 = __toESM(require("clsx"));
|
|
128
128
|
|
|
129
129
|
// src/components/user-action/Button.tsx
|
|
130
|
+
var import_react3 = require("react");
|
|
130
131
|
var import_clsx = __toESM(require("clsx"));
|
|
131
132
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
132
133
|
var ButtonColorUtil = {
|
|
@@ -152,6 +153,76 @@ var ButtonUtil = {
|
|
|
152
153
|
paddingMapping,
|
|
153
154
|
iconPaddingMapping
|
|
154
155
|
};
|
|
156
|
+
var SolidButton = (0, import_react3.forwardRef)(function SolidButton2({
|
|
157
|
+
children,
|
|
158
|
+
disabled = false,
|
|
159
|
+
color = "primary",
|
|
160
|
+
size = "medium",
|
|
161
|
+
startIcon,
|
|
162
|
+
endIcon,
|
|
163
|
+
onClick,
|
|
164
|
+
className,
|
|
165
|
+
...restProps
|
|
166
|
+
}, ref) {
|
|
167
|
+
const colorClasses = {
|
|
168
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
169
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
170
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
171
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
172
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
173
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
174
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
175
|
+
}[color];
|
|
176
|
+
const iconColorClasses = {
|
|
177
|
+
primary: "text-button-solid-primary-icon",
|
|
178
|
+
secondary: "text-button-solid-secondary-icon",
|
|
179
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
180
|
+
positive: "text-button-solid-positive-icon",
|
|
181
|
+
warning: "text-button-solid-warning-icon",
|
|
182
|
+
negative: "text-button-solid-negative-icon",
|
|
183
|
+
neutral: "text-button-solid-neutral-icon"
|
|
184
|
+
}[color];
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
186
|
+
"button",
|
|
187
|
+
{
|
|
188
|
+
ref,
|
|
189
|
+
onClick,
|
|
190
|
+
disabled,
|
|
191
|
+
className: (0, import_clsx.default)(
|
|
192
|
+
{
|
|
193
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
194
|
+
[(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
195
|
+
},
|
|
196
|
+
ButtonUtil.paddingMapping[size],
|
|
197
|
+
className
|
|
198
|
+
),
|
|
199
|
+
...restProps,
|
|
200
|
+
children: [
|
|
201
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
202
|
+
"span",
|
|
203
|
+
{
|
|
204
|
+
className: (0, import_clsx.default)({
|
|
205
|
+
[iconColorClasses]: !disabled,
|
|
206
|
+
[`text-disabled-icon`]: disabled
|
|
207
|
+
}),
|
|
208
|
+
children: startIcon
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
children,
|
|
212
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
213
|
+
"span",
|
|
214
|
+
{
|
|
215
|
+
className: (0, import_clsx.default)({
|
|
216
|
+
[iconColorClasses]: !disabled,
|
|
217
|
+
[`text-disabled-icon`]: disabled
|
|
218
|
+
}),
|
|
219
|
+
children: endIcon
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
});
|
|
155
226
|
var TextButton = ({
|
|
156
227
|
children,
|
|
157
228
|
disabled = false,
|
|
@@ -176,8 +247,8 @@ var TextButton = ({
|
|
|
176
247
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
177
248
|
"button",
|
|
178
249
|
{
|
|
179
|
-
onClick
|
|
180
|
-
disabled
|
|
250
|
+
onClick,
|
|
251
|
+
disabled,
|
|
181
252
|
className: (0, import_clsx.default)(
|
|
182
253
|
{
|
|
183
254
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
@@ -218,7 +289,6 @@ var IconButton = ({
|
|
|
218
289
|
disabled = false,
|
|
219
290
|
color = "primary",
|
|
220
291
|
size = "medium",
|
|
221
|
-
onClick,
|
|
222
292
|
className,
|
|
223
293
|
...restProps
|
|
224
294
|
}) => {
|
|
@@ -235,8 +305,7 @@ var IconButton = ({
|
|
|
235
305
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
236
306
|
"button",
|
|
237
307
|
{
|
|
238
|
-
|
|
239
|
-
disabled: disabled || onClick === void 0,
|
|
308
|
+
disabled,
|
|
240
309
|
className: (0, import_clsx.default)(
|
|
241
310
|
{
|
|
242
311
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
@@ -256,6 +325,7 @@ var IconButton = ({
|
|
|
256
325
|
// src/localization/defaults/form.ts
|
|
257
326
|
var formTranslation = {
|
|
258
327
|
en: {
|
|
328
|
+
add: "Add",
|
|
259
329
|
all: "All",
|
|
260
330
|
apply: "Apply",
|
|
261
331
|
back: "Back",
|
|
@@ -268,6 +338,7 @@ var formTranslation = {
|
|
|
268
338
|
confirm: "Confirm",
|
|
269
339
|
copy: "Copy",
|
|
270
340
|
copied: "Copied",
|
|
341
|
+
create: "Create",
|
|
271
342
|
decline: "Decline",
|
|
272
343
|
delete: "Delete",
|
|
273
344
|
discard: "Discard",
|
|
@@ -310,6 +381,7 @@ var formTranslation = {
|
|
|
310
381
|
yes: "Yes"
|
|
311
382
|
},
|
|
312
383
|
de: {
|
|
384
|
+
add: "Hinzuf\xFCgen",
|
|
313
385
|
all: "Alle",
|
|
314
386
|
apply: "Anwenden",
|
|
315
387
|
back: "Zur\xFCck",
|
|
@@ -322,6 +394,7 @@ var formTranslation = {
|
|
|
322
394
|
confirm: "Best\xE4tigen",
|
|
323
395
|
copy: "Kopieren",
|
|
324
396
|
copied: "Kopiert",
|
|
397
|
+
create: "Erstellen",
|
|
325
398
|
decline: "Ablehnen",
|
|
326
399
|
delete: "L\xF6schen",
|
|
327
400
|
discard: "Verwerfen",
|
|
@@ -380,36 +453,44 @@ var PropertyBase = ({
|
|
|
380
453
|
}) => {
|
|
381
454
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
382
455
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
383
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("row
|
|
456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex-row-0 group", className), children: [
|
|
384
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
385
458
|
"div",
|
|
386
459
|
{
|
|
387
|
-
className: (0, import_clsx2.default)(
|
|
388
|
-
"
|
|
389
|
-
|
|
390
|
-
|
|
460
|
+
className: (0, import_clsx2.default)(
|
|
461
|
+
"flex-row-2 max-w-48 min-w-48 px-3 py-2 items-center rounded-l-xl border-2 border-r-0",
|
|
462
|
+
{
|
|
463
|
+
"bg-property-title-background text-property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
464
|
+
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
465
|
+
},
|
|
466
|
+
className
|
|
467
|
+
),
|
|
391
468
|
children: [
|
|
392
|
-
icon,
|
|
393
|
-
name
|
|
469
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "max-w-6 min-w-6 text-text-default", children: icon }),
|
|
470
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "font-semibold", children: name })
|
|
394
471
|
]
|
|
395
472
|
}
|
|
396
473
|
),
|
|
397
474
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
398
475
|
"div",
|
|
399
476
|
{
|
|
400
|
-
className: (0, import_clsx2.default)(
|
|
401
|
-
"
|
|
402
|
-
|
|
403
|
-
|
|
477
|
+
className: (0, import_clsx2.default)(
|
|
478
|
+
"flex-row-2 grow px-3 py-2 justify-between items-center rounded-r-xl border-2 border-l-0 min-h-15",
|
|
479
|
+
{
|
|
480
|
+
"bg-surface group-hover:border-primary": !requiredAndNoValue,
|
|
481
|
+
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
482
|
+
},
|
|
483
|
+
className
|
|
484
|
+
),
|
|
404
485
|
children: [
|
|
405
486
|
input({ softRequired, hasValue }),
|
|
406
|
-
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-warning
|
|
407
|
-
onRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
487
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-warning", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.AlertTriangle, { size: 24 }) }),
|
|
488
|
+
onRemove && hasValue && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
408
489
|
TextButton,
|
|
409
490
|
{
|
|
410
491
|
onClick: onRemove,
|
|
411
492
|
color: "negative",
|
|
412
|
-
className: (0, import_clsx2.default)("
|
|
493
|
+
className: (0, import_clsx2.default)("items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
413
494
|
disabled: !hasValue || readOnly,
|
|
414
495
|
children: translation("remove")
|
|
415
496
|
}
|
|
@@ -421,9 +502,9 @@ var PropertyBase = ({
|
|
|
421
502
|
};
|
|
422
503
|
|
|
423
504
|
// src/components/user-action/Select.tsx
|
|
424
|
-
var
|
|
425
|
-
var
|
|
426
|
-
var
|
|
505
|
+
var import_react13 = require("react");
|
|
506
|
+
var import_react14 = require("react");
|
|
507
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
427
508
|
|
|
428
509
|
// src/components/user-action/Label.tsx
|
|
429
510
|
var import_clsx3 = __toESM(require("clsx"));
|
|
@@ -443,22 +524,385 @@ var Label = ({
|
|
|
443
524
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { ...props, className: (0, import_clsx3.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
444
525
|
};
|
|
445
526
|
|
|
446
|
-
// src/components/layout-and-navigation/
|
|
527
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
528
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
447
529
|
var import_lucide_react2 = require("lucide-react");
|
|
530
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
531
|
+
var Tile = ({
|
|
532
|
+
title,
|
|
533
|
+
description,
|
|
534
|
+
onClick,
|
|
535
|
+
isSelected = false,
|
|
536
|
+
disabled = false,
|
|
537
|
+
prefix,
|
|
538
|
+
suffix,
|
|
539
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
540
|
+
selectedClassName = " bg-primary/20",
|
|
541
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
542
|
+
className
|
|
543
|
+
}) => {
|
|
544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
545
|
+
"div",
|
|
546
|
+
{
|
|
547
|
+
className: (0, import_clsx4.default)(
|
|
548
|
+
"flex-row-2 w-full items-center",
|
|
549
|
+
{
|
|
550
|
+
[normalClassName]: !!onClick && !disabled,
|
|
551
|
+
[selectedClassName]: isSelected && !disabled,
|
|
552
|
+
[disabledClassName]: disabled
|
|
553
|
+
},
|
|
554
|
+
className
|
|
555
|
+
),
|
|
556
|
+
onClick: disabled ? void 0 : onClick,
|
|
557
|
+
children: [
|
|
558
|
+
prefix,
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-col-0 w-full", children: [
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h4", { className: (0, import_clsx4.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
561
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: (0, import_clsx4.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
562
|
+
] }),
|
|
563
|
+
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0)
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
570
|
+
var import_react4 = require("react");
|
|
571
|
+
var import_lucide_react3 = require("lucide-react");
|
|
448
572
|
var import_clsx5 = __toESM(require("clsx"));
|
|
449
573
|
|
|
450
|
-
// src/
|
|
574
|
+
// src/util/noop.ts
|
|
575
|
+
var noop = () => void 0;
|
|
576
|
+
|
|
577
|
+
// src/components/layout-and-navigation/Expandable.tsx
|
|
578
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
579
|
+
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
581
|
+
import_lucide_react3.ChevronDown,
|
|
582
|
+
{
|
|
583
|
+
className: (0, import_clsx5.default)(
|
|
584
|
+
"min-w-6 w-6 min-h-6 h-6 transition-transform duration-200 ease-in-out",
|
|
585
|
+
{ "rotate-180": isExpanded },
|
|
586
|
+
className
|
|
587
|
+
)
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
};
|
|
591
|
+
var Expandable = (0, import_react4.forwardRef)(function Expandable2({
|
|
592
|
+
children,
|
|
593
|
+
label,
|
|
594
|
+
icon,
|
|
595
|
+
isExpanded = false,
|
|
596
|
+
onChange = noop,
|
|
597
|
+
clickOnlyOnHeader = true,
|
|
598
|
+
disabled = false,
|
|
599
|
+
className,
|
|
600
|
+
headerClassName,
|
|
601
|
+
contentClassName,
|
|
602
|
+
contentExpandedClassName
|
|
603
|
+
}, ref) {
|
|
604
|
+
const defaultIcon = (0, import_react4.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
605
|
+
icon ??= defaultIcon;
|
|
606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
607
|
+
"div",
|
|
608
|
+
{
|
|
609
|
+
ref,
|
|
610
|
+
className: (0, import_clsx5.default)("flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader && !disabled }, className),
|
|
611
|
+
onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
612
|
+
children: [
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
614
|
+
"div",
|
|
615
|
+
{
|
|
616
|
+
className: (0, import_clsx5.default)(
|
|
617
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
|
|
618
|
+
{
|
|
619
|
+
"group-hover:brightness-97": !isExpanded,
|
|
620
|
+
"hover:brightness-97": isExpanded && !disabled,
|
|
621
|
+
"cursor-pointer": clickOnlyOnHeader && !disabled
|
|
622
|
+
},
|
|
623
|
+
headerClassName
|
|
624
|
+
),
|
|
625
|
+
onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
|
|
626
|
+
children: [
|
|
627
|
+
label,
|
|
628
|
+
icon(isExpanded)
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
className: (0, import_clsx5.default)(
|
|
636
|
+
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
637
|
+
{
|
|
638
|
+
[(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
639
|
+
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
640
|
+
},
|
|
641
|
+
contentClassName
|
|
642
|
+
),
|
|
643
|
+
children
|
|
644
|
+
}
|
|
645
|
+
)
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
});
|
|
650
|
+
var ExpandableUncontrolled = (0, import_react4.forwardRef)(function ExpandableUncontrolled2({
|
|
651
|
+
isExpanded,
|
|
652
|
+
onChange = noop,
|
|
653
|
+
...props
|
|
654
|
+
}, ref) {
|
|
655
|
+
const [usedIsExpanded, setUsedIsExpanded] = (0, import_react4.useState)(isExpanded);
|
|
656
|
+
(0, import_react4.useEffect)(() => {
|
|
657
|
+
setUsedIsExpanded(isExpanded);
|
|
658
|
+
}, [isExpanded]);
|
|
659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
660
|
+
Expandable,
|
|
661
|
+
{
|
|
662
|
+
...props,
|
|
663
|
+
ref,
|
|
664
|
+
isExpanded: usedIsExpanded,
|
|
665
|
+
onChange: (value) => {
|
|
666
|
+
onChange(value);
|
|
667
|
+
setUsedIsExpanded(value);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
);
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// src/components/user-action/Menu.tsx
|
|
674
|
+
var import_react7 = require("react");
|
|
675
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
676
|
+
|
|
677
|
+
// src/hooks/useOutsideClick.ts
|
|
678
|
+
var import_react5 = require("react");
|
|
679
|
+
var useOutsideClick = (refs, handler) => {
|
|
680
|
+
(0, import_react5.useEffect)(() => {
|
|
681
|
+
const listener = (event) => {
|
|
682
|
+
if (event.target === null) return;
|
|
683
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
handler();
|
|
687
|
+
};
|
|
688
|
+
document.addEventListener("mousedown", listener);
|
|
689
|
+
document.addEventListener("touchstart", listener);
|
|
690
|
+
return () => {
|
|
691
|
+
document.removeEventListener("mousedown", listener);
|
|
692
|
+
document.removeEventListener("touchstart", listener);
|
|
693
|
+
};
|
|
694
|
+
}, [refs, handler]);
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
// src/hooks/useHoverState.ts
|
|
451
698
|
var import_react6 = require("react");
|
|
452
|
-
var
|
|
699
|
+
var defaultUseHoverStateProps = {
|
|
700
|
+
closingDelay: 200,
|
|
701
|
+
isDisabled: false
|
|
702
|
+
};
|
|
703
|
+
var useHoverState = (props = void 0) => {
|
|
704
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
705
|
+
const [isHovered, setIsHovered] = (0, import_react6.useState)(false);
|
|
706
|
+
const [timer, setTimer] = (0, import_react6.useState)();
|
|
707
|
+
const onMouseEnter = () => {
|
|
708
|
+
if (isDisabled) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
clearTimeout(timer);
|
|
712
|
+
setIsHovered(true);
|
|
713
|
+
};
|
|
714
|
+
const onMouseLeave = () => {
|
|
715
|
+
if (isDisabled) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
setTimer(setTimeout(() => {
|
|
719
|
+
setIsHovered(false);
|
|
720
|
+
}, closingDelay));
|
|
721
|
+
};
|
|
722
|
+
(0, import_react6.useEffect)(() => {
|
|
723
|
+
if (timer) {
|
|
724
|
+
return () => {
|
|
725
|
+
clearTimeout(timer);
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
(0, import_react6.useEffect)(() => {
|
|
730
|
+
if (timer) {
|
|
731
|
+
clearTimeout(timer);
|
|
732
|
+
}
|
|
733
|
+
}, [isDisabled]);
|
|
734
|
+
return {
|
|
735
|
+
isHovered,
|
|
736
|
+
setIsHovered,
|
|
737
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
// src/util/PropsWithFunctionChildren.ts
|
|
742
|
+
var resolve = (children, bag) => {
|
|
743
|
+
if (typeof children === "function") {
|
|
744
|
+
return children(bag);
|
|
745
|
+
}
|
|
746
|
+
return children ?? void 0;
|
|
747
|
+
};
|
|
748
|
+
var BagFunctionUtil = {
|
|
749
|
+
resolve
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
// src/hooks/usePopoverPosition.ts
|
|
753
|
+
var defaultPopoverPositionOptions = {
|
|
754
|
+
edgePadding: 16,
|
|
755
|
+
outerGap: 4,
|
|
756
|
+
horizontalAlignment: "leftInside",
|
|
757
|
+
verticalAlignment: "bottomOutside",
|
|
758
|
+
disabled: false
|
|
759
|
+
};
|
|
760
|
+
var usePopoverPosition = (trigger, options) => {
|
|
761
|
+
const {
|
|
762
|
+
edgePadding,
|
|
763
|
+
outerGap,
|
|
764
|
+
verticalAlignment,
|
|
765
|
+
horizontalAlignment,
|
|
766
|
+
disabled
|
|
767
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
768
|
+
if (disabled || !trigger) {
|
|
769
|
+
return {};
|
|
770
|
+
}
|
|
771
|
+
const left = {
|
|
772
|
+
leftOutside: trigger.left - outerGap,
|
|
773
|
+
leftInside: trigger.left,
|
|
774
|
+
rightOutside: trigger.right + outerGap,
|
|
775
|
+
rightInside: trigger.right,
|
|
776
|
+
center: trigger.left + trigger.width / 2
|
|
777
|
+
}[horizontalAlignment];
|
|
778
|
+
const top = {
|
|
779
|
+
topOutside: trigger.top - outerGap,
|
|
780
|
+
topInside: trigger.top,
|
|
781
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
782
|
+
bottomInside: trigger.bottom,
|
|
783
|
+
center: trigger.top + trigger.height / 2
|
|
784
|
+
}[verticalAlignment];
|
|
785
|
+
const translateX = {
|
|
786
|
+
leftOutside: "-100%",
|
|
787
|
+
leftInside: void 0,
|
|
788
|
+
rightOutside: void 0,
|
|
789
|
+
rightInside: "-100%",
|
|
790
|
+
center: "-50%"
|
|
791
|
+
}[horizontalAlignment];
|
|
792
|
+
const translateY = {
|
|
793
|
+
topOutside: "-100%",
|
|
794
|
+
topInside: void 0,
|
|
795
|
+
bottomOutside: void 0,
|
|
796
|
+
bottomInside: "-100%",
|
|
797
|
+
center: "-50%"
|
|
798
|
+
}[verticalAlignment];
|
|
799
|
+
return {
|
|
800
|
+
left: Math.max(left, edgePadding),
|
|
801
|
+
top: Math.max(top, edgePadding),
|
|
802
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
// src/components/user-action/Menu.tsx
|
|
807
|
+
var import_react_dom = require("react-dom");
|
|
808
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
809
|
+
function getScrollableParents(element) {
|
|
810
|
+
const scrollables = [];
|
|
811
|
+
let parent = element.parentElement;
|
|
812
|
+
while (parent) {
|
|
813
|
+
scrollables.push(parent);
|
|
814
|
+
parent = parent.parentElement;
|
|
815
|
+
}
|
|
816
|
+
return scrollables;
|
|
817
|
+
}
|
|
818
|
+
var Menu = ({
|
|
819
|
+
trigger,
|
|
820
|
+
children,
|
|
821
|
+
alignmentHorizontal = "leftInside",
|
|
822
|
+
alignmentVertical = "bottomOutside",
|
|
823
|
+
showOnHover = false,
|
|
824
|
+
disabled = false,
|
|
825
|
+
menuClassName = ""
|
|
826
|
+
}) => {
|
|
827
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
828
|
+
const triggerRef = (0, import_react7.useRef)(null);
|
|
829
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
830
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
831
|
+
const [isHidden, setIsHidden] = (0, import_react7.useState)(true);
|
|
832
|
+
const bag = {
|
|
833
|
+
isOpen,
|
|
834
|
+
close: () => setIsOpen(false),
|
|
835
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
836
|
+
disabled
|
|
837
|
+
};
|
|
838
|
+
const menuPosition = usePopoverPosition(
|
|
839
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
840
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
841
|
+
);
|
|
842
|
+
(0, import_react7.useEffect)(() => {
|
|
843
|
+
if (!isOpen) return;
|
|
844
|
+
const triggerEl = triggerRef.current;
|
|
845
|
+
if (!triggerEl) return;
|
|
846
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
847
|
+
const close = () => setIsOpen(false);
|
|
848
|
+
scrollableParents.forEach((parent) => {
|
|
849
|
+
parent.addEventListener("scroll", close);
|
|
850
|
+
});
|
|
851
|
+
window.addEventListener("resize", close);
|
|
852
|
+
return () => {
|
|
853
|
+
scrollableParents.forEach((parent) => {
|
|
854
|
+
parent.removeEventListener("scroll", close);
|
|
855
|
+
});
|
|
856
|
+
window.removeEventListener("resize", close);
|
|
857
|
+
};
|
|
858
|
+
}, [isOpen, setIsOpen]);
|
|
859
|
+
(0, import_react7.useEffect)(() => {
|
|
860
|
+
if (isOpen) {
|
|
861
|
+
setIsHidden(false);
|
|
862
|
+
}
|
|
863
|
+
}, [isOpen]);
|
|
864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
865
|
+
trigger(bag, triggerRef),
|
|
866
|
+
(0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
867
|
+
"div",
|
|
868
|
+
{
|
|
869
|
+
ref: menuRef,
|
|
870
|
+
onClick: (e) => e.stopPropagation(),
|
|
871
|
+
className: (0, import_clsx6.default)(
|
|
872
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
873
|
+
{
|
|
874
|
+
"animate-pop-in": isOpen,
|
|
875
|
+
"animate-pop-out": !isOpen,
|
|
876
|
+
"hidden": isHidden
|
|
877
|
+
},
|
|
878
|
+
menuClassName
|
|
879
|
+
),
|
|
880
|
+
onAnimationEnd: () => {
|
|
881
|
+
if (!isOpen) {
|
|
882
|
+
setIsHidden(true);
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
style: {
|
|
886
|
+
...menuPosition
|
|
887
|
+
},
|
|
888
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
889
|
+
}
|
|
890
|
+
), document.body)
|
|
891
|
+
] });
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
// src/components/user-action/Input.tsx
|
|
895
|
+
var import_react11 = require("react");
|
|
896
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
453
897
|
|
|
454
898
|
// src/hooks/useDelay.ts
|
|
455
|
-
var
|
|
899
|
+
var import_react8 = require("react");
|
|
456
900
|
var defaultOptions = {
|
|
457
901
|
delay: 3e3,
|
|
458
902
|
disabled: false
|
|
459
903
|
};
|
|
460
904
|
function useDelay(options) {
|
|
461
|
-
const [timer, setTimer] = (0,
|
|
905
|
+
const [timer, setTimer] = (0, import_react8.useState)(void 0);
|
|
462
906
|
const { delay, disabled } = {
|
|
463
907
|
...defaultOptions,
|
|
464
908
|
...options
|
|
@@ -477,12 +921,12 @@ function useDelay(options) {
|
|
|
477
921
|
setTimer(void 0);
|
|
478
922
|
}, delay));
|
|
479
923
|
};
|
|
480
|
-
(0,
|
|
924
|
+
(0, import_react8.useEffect)(() => {
|
|
481
925
|
return () => {
|
|
482
926
|
clearTimeout(timer);
|
|
483
927
|
};
|
|
484
928
|
}, [timer]);
|
|
485
|
-
(0,
|
|
929
|
+
(0, import_react8.useEffect)(() => {
|
|
486
930
|
if (disabled) {
|
|
487
931
|
clearTimeout(timer);
|
|
488
932
|
setTimer(void 0);
|
|
@@ -491,13 +935,10 @@ function useDelay(options) {
|
|
|
491
935
|
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
492
936
|
}
|
|
493
937
|
|
|
494
|
-
// src/util/noop.ts
|
|
495
|
-
var noop = () => void 0;
|
|
496
|
-
|
|
497
938
|
// src/hooks/useFocusManagement.ts
|
|
498
|
-
var
|
|
939
|
+
var import_react9 = require("react");
|
|
499
940
|
function useFocusManagement() {
|
|
500
|
-
const getFocusableElements = (0,
|
|
941
|
+
const getFocusableElements = (0, import_react9.useCallback)(() => {
|
|
501
942
|
return Array.from(
|
|
502
943
|
document.querySelectorAll(
|
|
503
944
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -506,7 +947,7 @@ function useFocusManagement() {
|
|
|
506
947
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
507
948
|
);
|
|
508
949
|
}, []);
|
|
509
|
-
const getNextFocusElement = (0,
|
|
950
|
+
const getNextFocusElement = (0, import_react9.useCallback)(() => {
|
|
510
951
|
const elements = getFocusableElements();
|
|
511
952
|
if (elements.length === 0) {
|
|
512
953
|
return void 0;
|
|
@@ -518,11 +959,11 @@ function useFocusManagement() {
|
|
|
518
959
|
}
|
|
519
960
|
return nextElement;
|
|
520
961
|
}, [getFocusableElements]);
|
|
521
|
-
const focusNext = (0,
|
|
962
|
+
const focusNext = (0, import_react9.useCallback)(() => {
|
|
522
963
|
const nextElement = getNextFocusElement();
|
|
523
964
|
nextElement?.focus();
|
|
524
965
|
}, [getNextFocusElement]);
|
|
525
|
-
const getPreviousFocusElement = (0,
|
|
966
|
+
const getPreviousFocusElement = (0, import_react9.useCallback)(() => {
|
|
526
967
|
const elements = getFocusableElements();
|
|
527
968
|
if (elements.length === 0) {
|
|
528
969
|
return void 0;
|
|
@@ -538,7 +979,7 @@ function useFocusManagement() {
|
|
|
538
979
|
}
|
|
539
980
|
return previousElement;
|
|
540
981
|
}, [getFocusableElements]);
|
|
541
|
-
const focusPrevious = (0,
|
|
982
|
+
const focusPrevious = (0, import_react9.useCallback)(() => {
|
|
542
983
|
const previousElement = getPreviousFocusElement();
|
|
543
984
|
if (previousElement) previousElement.focus();
|
|
544
985
|
}, [getPreviousFocusElement]);
|
|
@@ -552,10 +993,10 @@ function useFocusManagement() {
|
|
|
552
993
|
}
|
|
553
994
|
|
|
554
995
|
// src/hooks/useFocusOnceVisible.ts
|
|
555
|
-
var
|
|
996
|
+
var import_react10 = __toESM(require("react"));
|
|
556
997
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
557
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
558
|
-
(0,
|
|
998
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react10.default.useState(false);
|
|
999
|
+
(0, import_react10.useEffect)(() => {
|
|
559
1000
|
if (disable || hasUsedFocus) {
|
|
560
1001
|
return;
|
|
561
1002
|
}
|
|
@@ -575,9 +1016,9 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
575
1016
|
};
|
|
576
1017
|
|
|
577
1018
|
// src/components/user-action/Input.tsx
|
|
578
|
-
var
|
|
1019
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
579
1020
|
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
580
|
-
return (0,
|
|
1021
|
+
return (0, import_clsx7.default)(
|
|
581
1022
|
"px-2 py-1.5 rounded-md border-2",
|
|
582
1023
|
{
|
|
583
1024
|
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
@@ -591,7 +1032,7 @@ var defaultEditCompleteOptions = {
|
|
|
591
1032
|
afterDelay: true,
|
|
592
1033
|
delay: 2500
|
|
593
1034
|
};
|
|
594
|
-
var Input = (0,
|
|
1035
|
+
var Input = (0, import_react11.forwardRef)(function Input2({
|
|
595
1036
|
id,
|
|
596
1037
|
type = "text",
|
|
597
1038
|
value,
|
|
@@ -614,10 +1055,10 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
614
1055
|
restartTimer,
|
|
615
1056
|
clearTimer
|
|
616
1057
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
617
|
-
const innerRef = (0,
|
|
1058
|
+
const innerRef = (0, import_react11.useRef)(null);
|
|
618
1059
|
const { focusNext } = useFocusManagement();
|
|
619
1060
|
useFocusOnceVisible(innerRef, !autoFocus);
|
|
620
|
-
(0,
|
|
1061
|
+
(0, import_react11.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
621
1062
|
const handleKeyDown = (e) => {
|
|
622
1063
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
623
1064
|
e.preventDefault();
|
|
@@ -625,9 +1066,9 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
625
1066
|
focusNext();
|
|
626
1067
|
}
|
|
627
1068
|
};
|
|
628
|
-
return /* @__PURE__ */ (0,
|
|
629
|
-
label && /* @__PURE__ */ (0,
|
|
630
|
-
/* @__PURE__ */ (0,
|
|
1069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)({ "w-full": expanded }, containerClassName), children: [
|
|
1070
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx7.default)("mb-1", label.className) }),
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
631
1072
|
"input",
|
|
632
1073
|
{
|
|
633
1074
|
...restProps,
|
|
@@ -636,7 +1077,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
636
1077
|
id,
|
|
637
1078
|
type,
|
|
638
1079
|
disabled,
|
|
639
|
-
className: (0,
|
|
1080
|
+
className: (0, import_clsx7.default)(getInputClassName({ disabled }), className),
|
|
640
1081
|
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
641
1082
|
onBlur: (event) => {
|
|
642
1083
|
onBlur?.(event);
|
|
@@ -666,7 +1107,7 @@ var Input = (0, import_react6.forwardRef)(function Input2({
|
|
|
666
1107
|
)
|
|
667
1108
|
] });
|
|
668
1109
|
});
|
|
669
|
-
var FormInput = (0,
|
|
1110
|
+
var FormInput = (0, import_react11.forwardRef)(function FormInput2({
|
|
670
1111
|
id,
|
|
671
1112
|
labelText,
|
|
672
1113
|
errorText,
|
|
@@ -678,40 +1119,64 @@ var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
|
678
1119
|
disabled,
|
|
679
1120
|
...restProps
|
|
680
1121
|
}, ref) {
|
|
681
|
-
const input = /* @__PURE__ */ (0,
|
|
1122
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
682
1123
|
"input",
|
|
683
1124
|
{
|
|
684
1125
|
...restProps,
|
|
685
1126
|
ref,
|
|
686
1127
|
id,
|
|
687
1128
|
disabled,
|
|
688
|
-
className: (0,
|
|
1129
|
+
className: (0, import_clsx7.default)(
|
|
689
1130
|
getInputClassName({ disabled, hasError: !!errorText }),
|
|
690
1131
|
className
|
|
691
1132
|
)
|
|
692
1133
|
}
|
|
693
1134
|
);
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
695
|
-
labelText && /* @__PURE__ */ (0,
|
|
1135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
1136
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { htmlFor: id, className: (0, import_clsx7.default)("textstyle-label-md", labelClassName), children: [
|
|
696
1137
|
labelText,
|
|
697
|
-
required && /* @__PURE__ */ (0,
|
|
1138
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
698
1139
|
] }),
|
|
699
1140
|
input,
|
|
700
|
-
errorText && /* @__PURE__ */ (0,
|
|
1141
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: id, className: (0, import_clsx7.default)("text-negative", errorClassName), children: errorText })
|
|
701
1142
|
] });
|
|
702
1143
|
});
|
|
703
1144
|
|
|
1145
|
+
// src/components/user-action/SearchBar.tsx
|
|
1146
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1147
|
+
var import_clsx8 = require("clsx");
|
|
1148
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1149
|
+
var SearchBar = ({
|
|
1150
|
+
placeholder,
|
|
1151
|
+
onSearch,
|
|
1152
|
+
disableOnSearch,
|
|
1153
|
+
containerClassName,
|
|
1154
|
+
...inputProps
|
|
1155
|
+
}) => {
|
|
1156
|
+
const translation = useTranslation([formTranslation]);
|
|
1157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_clsx8.clsx)("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1159
|
+
Input,
|
|
1160
|
+
{
|
|
1161
|
+
...inputProps,
|
|
1162
|
+
placeholder: placeholder ?? translation("search")
|
|
1163
|
+
}
|
|
1164
|
+
),
|
|
1165
|
+
onSearch && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconButton, { color: "neutral", disabled: disableOnSearch, onClick: onSearch, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Search, { className: "w-full h-full" }) })
|
|
1166
|
+
] });
|
|
1167
|
+
};
|
|
1168
|
+
|
|
704
1169
|
// src/hooks/useSearch.ts
|
|
705
|
-
var
|
|
1170
|
+
var import_react12 = require("react");
|
|
706
1171
|
|
|
707
1172
|
// src/util/simpleSearch.ts
|
|
708
|
-
var
|
|
1173
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
709
1174
|
return objects.filter((object) => {
|
|
710
1175
|
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
711
1176
|
if (!mappedSearchKeywords) {
|
|
712
1177
|
return true;
|
|
713
1178
|
}
|
|
714
|
-
return !!mappedSearchKeywords.find((value) => value.includes(
|
|
1179
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
715
1180
|
});
|
|
716
1181
|
};
|
|
717
1182
|
|
|
@@ -719,212 +1184,163 @@ var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
|
719
1184
|
var useSearch = ({
|
|
720
1185
|
list,
|
|
721
1186
|
initialSearch,
|
|
722
|
-
searchMapping
|
|
1187
|
+
searchMapping,
|
|
1188
|
+
additionalSearchTags,
|
|
1189
|
+
isSearchInstant = true,
|
|
1190
|
+
sortingFunction,
|
|
1191
|
+
filter,
|
|
1192
|
+
disabled = false
|
|
723
1193
|
}) => {
|
|
724
|
-
const [
|
|
725
|
-
const [
|
|
726
|
-
(0,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1194
|
+
const [search, setSearch] = (0, import_react12.useState)(initialSearch ?? "");
|
|
1195
|
+
const [result, setResult] = (0, import_react12.useState)(list);
|
|
1196
|
+
const searchTags = (0, import_react12.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
1197
|
+
const updateSearch = (0, import_react12.useCallback)((newSearch) => {
|
|
1198
|
+
const usedSearch = newSearch ?? search;
|
|
1199
|
+
if (newSearch) {
|
|
1200
|
+
setSearch(search);
|
|
1201
|
+
}
|
|
1202
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
1203
|
+
}, [searchTags, list, search, searchMapping]);
|
|
1204
|
+
(0, import_react12.useEffect)(() => {
|
|
1205
|
+
if (isSearchInstant) {
|
|
1206
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
1207
|
+
}
|
|
1208
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
1209
|
+
const filteredResult = (0, import_react12.useMemo)(() => {
|
|
1210
|
+
if (!filter) {
|
|
1211
|
+
return result;
|
|
1212
|
+
}
|
|
1213
|
+
return result.filter(filter);
|
|
1214
|
+
}, [result, filter]);
|
|
1215
|
+
const sortedAndFilteredResult = (0, import_react12.useMemo)(() => {
|
|
1216
|
+
if (!sortingFunction) {
|
|
1217
|
+
return filteredResult;
|
|
1218
|
+
}
|
|
1219
|
+
return filteredResult.sort(sortingFunction);
|
|
1220
|
+
}, [filteredResult, sortingFunction]);
|
|
1221
|
+
const usedResult = (0, import_react12.useMemo)(() => {
|
|
1222
|
+
if (!disabled) {
|
|
1223
|
+
return sortedAndFilteredResult;
|
|
1224
|
+
}
|
|
1225
|
+
return list;
|
|
1226
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
733
1227
|
return {
|
|
734
|
-
result,
|
|
735
|
-
hasResult:
|
|
736
|
-
allItems:
|
|
737
|
-
|
|
1228
|
+
result: usedResult,
|
|
1229
|
+
hasResult: usedResult.length > 0,
|
|
1230
|
+
allItems: list,
|
|
1231
|
+
updateSearch,
|
|
738
1232
|
search,
|
|
739
1233
|
setSearch
|
|
740
1234
|
};
|
|
741
1235
|
};
|
|
742
1236
|
|
|
743
|
-
// src/components/
|
|
744
|
-
var
|
|
745
|
-
var
|
|
746
|
-
en: {
|
|
747
|
-
nothingFound: "Nothing found"
|
|
748
|
-
},
|
|
749
|
-
de: {
|
|
750
|
-
nothingFound: "Nichts gefunden"
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
var SearchableList = ({
|
|
754
|
-
overwriteTranslation,
|
|
755
|
-
list,
|
|
756
|
-
initialSearch = "",
|
|
757
|
-
searchMapping,
|
|
758
|
-
autoFocus,
|
|
759
|
-
minimumItemsForSearch = 6,
|
|
760
|
-
itemMapper,
|
|
1237
|
+
// src/components/user-action/Select.tsx
|
|
1238
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1239
|
+
var SelectTile = ({
|
|
761
1240
|
className,
|
|
762
|
-
|
|
763
|
-
}) => {
|
|
764
|
-
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
765
|
-
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
766
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("col gap-y-2", className), children: [
|
|
767
|
-
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
768
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
769
|
-
Input,
|
|
770
|
-
{
|
|
771
|
-
value: search,
|
|
772
|
-
onChangeText: setSearch,
|
|
773
|
-
placeholder: translation("search"),
|
|
774
|
-
autoFocus,
|
|
775
|
-
className: "w-full"
|
|
776
|
-
}
|
|
777
|
-
),
|
|
778
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Search, { className: "w-full h-full" }) })
|
|
779
|
-
] }),
|
|
780
|
-
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_clsx5.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
781
|
-
] });
|
|
782
|
-
};
|
|
783
|
-
|
|
784
|
-
// src/components/layout-and-navigation/Tile.tsx
|
|
785
|
-
var import_clsx6 = __toESM(require("clsx"));
|
|
786
|
-
var import_lucide_react3 = require("lucide-react");
|
|
787
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
788
|
-
var Tile = ({
|
|
1241
|
+
disabledClassName,
|
|
789
1242
|
title,
|
|
790
|
-
|
|
791
|
-
onClick,
|
|
792
|
-
isSelected = false,
|
|
793
|
-
isDisabled = false,
|
|
794
|
-
prefix,
|
|
795
|
-
suffix,
|
|
796
|
-
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
797
|
-
selectedClassName = " bg-primary/20",
|
|
798
|
-
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
799
|
-
className
|
|
1243
|
+
...restProps
|
|
800
1244
|
}) => {
|
|
801
|
-
return /* @__PURE__ */ (0,
|
|
802
|
-
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1246
|
+
Tile,
|
|
803
1247
|
{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
[selectedClassName]: isSelected && !isDisabled,
|
|
809
|
-
[disabledClassName]: isDisabled
|
|
810
|
-
},
|
|
811
|
-
className
|
|
812
|
-
),
|
|
813
|
-
onClick: isDisabled ? void 0 : onClick,
|
|
814
|
-
children: [
|
|
815
|
-
prefix,
|
|
816
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
817
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h4", { className: (0, import_clsx6.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
818
|
-
!!description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx6.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
819
|
-
] }),
|
|
820
|
-
suffix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Check, { size: 24 }) : void 0)
|
|
821
|
-
]
|
|
1248
|
+
...restProps,
|
|
1249
|
+
className: (0, import_clsx9.default)("px-2 py-1 rounded-md", className),
|
|
1250
|
+
disabledClassName: disabledClassName ?? "text-disabled-text cursor-not-allowed",
|
|
1251
|
+
title: { ...title, className: title.className ?? "font-semibold" }
|
|
822
1252
|
}
|
|
823
1253
|
);
|
|
824
1254
|
};
|
|
825
|
-
|
|
826
|
-
// src/hooks/useOutsideClick.ts
|
|
827
|
-
var import_react8 = require("react");
|
|
828
|
-
var useOutsideClick = (refs, handler) => {
|
|
829
|
-
(0, import_react8.useEffect)(() => {
|
|
830
|
-
const listener = (event) => {
|
|
831
|
-
if (event.target === null) return;
|
|
832
|
-
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
handler();
|
|
836
|
-
};
|
|
837
|
-
document.addEventListener("mousedown", listener);
|
|
838
|
-
document.addEventListener("touchstart", listener);
|
|
839
|
-
return () => {
|
|
840
|
-
document.removeEventListener("mousedown", listener);
|
|
841
|
-
document.removeEventListener("touchstart", listener);
|
|
842
|
-
};
|
|
843
|
-
}, [refs, handler]);
|
|
844
|
-
};
|
|
845
|
-
|
|
846
|
-
// src/components/user-action/Select.tsx
|
|
847
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
848
1255
|
var Select = ({
|
|
849
1256
|
value,
|
|
850
1257
|
label,
|
|
851
1258
|
options,
|
|
852
1259
|
onChange,
|
|
853
1260
|
hintText = "",
|
|
854
|
-
|
|
855
|
-
|
|
1261
|
+
selectedDisplayOverwrite,
|
|
1262
|
+
searchOptions,
|
|
1263
|
+
additionalItems,
|
|
856
1264
|
className,
|
|
857
|
-
|
|
1265
|
+
triggerClassName,
|
|
1266
|
+
hintTextClassName,
|
|
1267
|
+
...menuProps
|
|
858
1268
|
}) => {
|
|
859
|
-
const triggerRef = (0, import_react9.useRef)(null);
|
|
860
|
-
const menuRef = (0, import_react9.useRef)(null);
|
|
861
|
-
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
862
|
-
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
863
1269
|
const selectedOption = options.find((option) => option.value === value);
|
|
864
1270
|
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
865
1271
|
console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
|
|
866
1272
|
}
|
|
867
1273
|
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1274
|
+
const { result, search, setSearch } = useSearch({
|
|
1275
|
+
list: options,
|
|
1276
|
+
searchMapping: (0, import_react13.useCallback)((item) => item.searchTags, []),
|
|
1277
|
+
...searchOptions
|
|
1278
|
+
});
|
|
1279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_clsx9.default)(className), children: [
|
|
1280
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx9.default)("mb-1", label.className) }),
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1282
|
+
Menu,
|
|
1283
|
+
{
|
|
1284
|
+
...menuProps,
|
|
1285
|
+
trigger: ({ toggleOpen, isOpen, disabled }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1286
|
+
"button",
|
|
1287
|
+
{
|
|
1288
|
+
ref,
|
|
1289
|
+
className: (0, import_clsx9.default)(
|
|
1290
|
+
"btn-md justify-between w-full border-2",
|
|
1291
|
+
{
|
|
1292
|
+
"rounded-b-lg": !open,
|
|
1293
|
+
"bg-menu-background text-menu-text border-menu-border hover:border-primary": !disabled,
|
|
1294
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": disabled
|
|
1295
|
+
},
|
|
1296
|
+
triggerClassName
|
|
1297
|
+
),
|
|
1298
|
+
onClick: toggleOpen,
|
|
1299
|
+
disabled,
|
|
1300
|
+
children: [
|
|
1301
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-semibold", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
1302
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: (0, import_clsx9.default)("textstyle-description", hintTextClassName), children: hintText }),
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
1304
|
+
]
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
menuClassName: (0, import_clsx9.default)("flex-col-2 p-2 max-h-96 overflow-hidden", menuProps.menuClassName),
|
|
1308
|
+
children: (bag) => {
|
|
1309
|
+
const { close } = bag;
|
|
1310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1311
|
+
!searchOptions?.disabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1312
|
+
SearchBar,
|
|
1313
|
+
{
|
|
1314
|
+
value: search,
|
|
1315
|
+
onChangeText: setSearch,
|
|
1316
|
+
autoFocus: true
|
|
1317
|
+
}
|
|
1318
|
+
),
|
|
1319
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-col-2 overflow-y-auto", children: [
|
|
1320
|
+
result.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1321
|
+
SelectTile,
|
|
905
1322
|
{
|
|
906
|
-
isSelected:
|
|
907
|
-
|
|
908
|
-
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
909
|
-
title: { value: option.label, className: "font-semibold" },
|
|
1323
|
+
isSelected: option === selectedOption,
|
|
1324
|
+
title: { value: option.label },
|
|
910
1325
|
onClick: () => {
|
|
911
1326
|
onChange(option.value);
|
|
912
|
-
|
|
1327
|
+
close();
|
|
913
1328
|
},
|
|
914
|
-
|
|
1329
|
+
disabled: option.disabled
|
|
915
1330
|
},
|
|
916
1331
|
index
|
|
917
|
-
)
|
|
918
|
-
|
|
919
|
-
|
|
1332
|
+
)),
|
|
1333
|
+
additionalItems && additionalItems({ ...bag, search, selected: value })
|
|
1334
|
+
] })
|
|
1335
|
+
] });
|
|
920
1336
|
}
|
|
921
|
-
|
|
922
|
-
|
|
1337
|
+
}
|
|
1338
|
+
)
|
|
923
1339
|
] });
|
|
924
1340
|
};
|
|
925
1341
|
|
|
926
1342
|
// src/components/properties/SelectProperty.tsx
|
|
927
|
-
var
|
|
1343
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
928
1344
|
var SingleSelectProperty = ({
|
|
929
1345
|
overwriteTranslation,
|
|
930
1346
|
value,
|
|
@@ -933,11 +1349,12 @@ var SingleSelectProperty = ({
|
|
|
933
1349
|
readOnly = false,
|
|
934
1350
|
softRequired,
|
|
935
1351
|
onRemove,
|
|
1352
|
+
onAddNew,
|
|
936
1353
|
...selectProps
|
|
937
1354
|
}) => {
|
|
938
1355
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
939
1356
|
const hasValue = value !== void 0;
|
|
940
|
-
return /* @__PURE__ */ (0,
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
941
1358
|
PropertyBase,
|
|
942
1359
|
{
|
|
943
1360
|
name,
|
|
@@ -945,22 +1362,45 @@ var SingleSelectProperty = ({
|
|
|
945
1362
|
readOnly,
|
|
946
1363
|
softRequired,
|
|
947
1364
|
hasValue,
|
|
948
|
-
icon: /* @__PURE__ */ (0,
|
|
949
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
950
|
-
|
|
1365
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.List, { size: 24 }),
|
|
1366
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1367
|
+
Select,
|
|
951
1368
|
{
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1369
|
+
...selectProps,
|
|
1370
|
+
value,
|
|
1371
|
+
options,
|
|
1372
|
+
disabled: readOnly,
|
|
1373
|
+
className: (0, import_clsx10.default)("w-full"),
|
|
1374
|
+
hintText: `${translation("select")}...`,
|
|
1375
|
+
searchOptions: {
|
|
1376
|
+
sortingFunction: (a, b) => a.value.localeCompare(b.value),
|
|
1377
|
+
...selectProps?.searchOptions
|
|
1378
|
+
},
|
|
1379
|
+
additionalItems: ({ close, search }) => {
|
|
1380
|
+
if (!onAddNew && !search.trim()) {
|
|
1381
|
+
return void 0;
|
|
1382
|
+
}
|
|
1383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1384
|
+
SelectTile,
|
|
1385
|
+
{
|
|
1386
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Plus, {}),
|
|
1387
|
+
title: { value: `${translation("add")} ${search.trim()}` },
|
|
1388
|
+
onClick: () => {
|
|
1389
|
+
onAddNew(search);
|
|
1390
|
+
close();
|
|
1391
|
+
},
|
|
1392
|
+
disabled: options.some((value2) => value2.value === search.trim())
|
|
1393
|
+
}
|
|
1394
|
+
);
|
|
1395
|
+
},
|
|
1396
|
+
triggerClassName: (0, import_clsx10.default)(
|
|
1397
|
+
"!border-none",
|
|
955
1398
|
{
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
options,
|
|
959
|
-
isDisabled: readOnly,
|
|
960
|
-
className: (0, import_clsx8.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
961
|
-
hintText: `${translation("select")}...`
|
|
1399
|
+
"!bg-warning !text-surface-warning": softRequired2 && !hasValue,
|
|
1400
|
+
"!bg-property-title-background": !softRequired2 || hasValue
|
|
962
1401
|
}
|
|
963
|
-
)
|
|
1402
|
+
),
|
|
1403
|
+
hintTextClassName: softRequired2 && !hasValue ? "text-surface-warning" : void 0
|
|
964
1404
|
}
|
|
965
1405
|
)
|
|
966
1406
|
}
|