@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/components/user-action/Button.tsx
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
var ButtonColorUtil = {
|
|
@@ -24,7 +25,7 @@ var ButtonUtil = {
|
|
|
24
25
|
paddingMapping,
|
|
25
26
|
iconPaddingMapping
|
|
26
27
|
};
|
|
27
|
-
var SolidButton = ({
|
|
28
|
+
var SolidButton = forwardRef(function SolidButton2({
|
|
28
29
|
children,
|
|
29
30
|
disabled = false,
|
|
30
31
|
color = "primary",
|
|
@@ -34,7 +35,7 @@ var SolidButton = ({
|
|
|
34
35
|
onClick,
|
|
35
36
|
className,
|
|
36
37
|
...restProps
|
|
37
|
-
})
|
|
38
|
+
}, ref) {
|
|
38
39
|
const colorClasses = {
|
|
39
40
|
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
40
41
|
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
@@ -56,8 +57,9 @@ var SolidButton = ({
|
|
|
56
57
|
return /* @__PURE__ */ jsxs(
|
|
57
58
|
"button",
|
|
58
59
|
{
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
ref,
|
|
61
|
+
onClick,
|
|
62
|
+
disabled,
|
|
61
63
|
className: clsx(
|
|
62
64
|
{
|
|
63
65
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
@@ -92,13 +94,12 @@ var SolidButton = ({
|
|
|
92
94
|
]
|
|
93
95
|
}
|
|
94
96
|
);
|
|
95
|
-
};
|
|
97
|
+
});
|
|
96
98
|
var IconButton = ({
|
|
97
99
|
children,
|
|
98
100
|
disabled = false,
|
|
99
101
|
color = "primary",
|
|
100
102
|
size = "medium",
|
|
101
|
-
onClick,
|
|
102
103
|
className,
|
|
103
104
|
...restProps
|
|
104
105
|
}) => {
|
|
@@ -115,8 +116,7 @@ var IconButton = ({
|
|
|
115
116
|
return /* @__PURE__ */ jsx(
|
|
116
117
|
"button",
|
|
117
118
|
{
|
|
118
|
-
|
|
119
|
-
disabled: disabled || onClick === void 0,
|
|
119
|
+
disabled,
|
|
120
120
|
className: clsx(
|
|
121
121
|
{
|
|
122
122
|
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
@@ -134,7 +134,7 @@ var IconButton = ({
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
// src/components/user-action/Input.tsx
|
|
137
|
-
import { forwardRef, useEffect as useEffect3, useImperativeHandle, useRef, useState as useState2 } from "react";
|
|
137
|
+
import { forwardRef as forwardRef2, useEffect as useEffect3, useImperativeHandle, useRef, useState as useState2 } from "react";
|
|
138
138
|
import clsx3 from "clsx";
|
|
139
139
|
|
|
140
140
|
// src/hooks/useDelay.ts
|
|
@@ -295,7 +295,7 @@ var defaultEditCompleteOptions = {
|
|
|
295
295
|
afterDelay: true,
|
|
296
296
|
delay: 2500
|
|
297
297
|
};
|
|
298
|
-
var Input =
|
|
298
|
+
var Input = forwardRef2(function Input2({
|
|
299
299
|
id,
|
|
300
300
|
type = "text",
|
|
301
301
|
value,
|
|
@@ -370,7 +370,7 @@ var Input = forwardRef(function Input2({
|
|
|
370
370
|
)
|
|
371
371
|
] });
|
|
372
372
|
});
|
|
373
|
-
var FormInput =
|
|
373
|
+
var FormInput = forwardRef2(function FormInput2({
|
|
374
374
|
id,
|
|
375
375
|
labelText,
|
|
376
376
|
errorText,
|
|
@@ -409,7 +409,11 @@ var FormInput = forwardRef(function FormInput2({
|
|
|
409
409
|
import { FilterIcon } from "lucide-react";
|
|
410
410
|
|
|
411
411
|
// src/components/user-action/Menu.tsx
|
|
412
|
-
import {
|
|
412
|
+
import {
|
|
413
|
+
useEffect as useEffect6,
|
|
414
|
+
useRef as useRef2,
|
|
415
|
+
useState as useState4
|
|
416
|
+
} from "react";
|
|
413
417
|
import clsx4 from "clsx";
|
|
414
418
|
|
|
415
419
|
// src/hooks/useOutsideClick.ts
|
|
@@ -487,56 +491,153 @@ var BagFunctionUtil = {
|
|
|
487
491
|
resolve
|
|
488
492
|
};
|
|
489
493
|
|
|
494
|
+
// src/hooks/usePopoverPosition.ts
|
|
495
|
+
var defaultPopoverPositionOptions = {
|
|
496
|
+
edgePadding: 16,
|
|
497
|
+
outerGap: 4,
|
|
498
|
+
horizontalAlignment: "leftInside",
|
|
499
|
+
verticalAlignment: "bottomOutside",
|
|
500
|
+
disabled: false
|
|
501
|
+
};
|
|
502
|
+
var usePopoverPosition = (trigger, options) => {
|
|
503
|
+
const {
|
|
504
|
+
edgePadding,
|
|
505
|
+
outerGap,
|
|
506
|
+
verticalAlignment,
|
|
507
|
+
horizontalAlignment,
|
|
508
|
+
disabled
|
|
509
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
510
|
+
if (disabled || !trigger) {
|
|
511
|
+
return {};
|
|
512
|
+
}
|
|
513
|
+
const left = {
|
|
514
|
+
leftOutside: trigger.left - outerGap,
|
|
515
|
+
leftInside: trigger.left,
|
|
516
|
+
rightOutside: trigger.right + outerGap,
|
|
517
|
+
rightInside: trigger.right,
|
|
518
|
+
center: trigger.left + trigger.width / 2
|
|
519
|
+
}[horizontalAlignment];
|
|
520
|
+
const top = {
|
|
521
|
+
topOutside: trigger.top - outerGap,
|
|
522
|
+
topInside: trigger.top,
|
|
523
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
524
|
+
bottomInside: trigger.bottom,
|
|
525
|
+
center: trigger.top + trigger.height / 2
|
|
526
|
+
}[verticalAlignment];
|
|
527
|
+
const translateX = {
|
|
528
|
+
leftOutside: "-100%",
|
|
529
|
+
leftInside: void 0,
|
|
530
|
+
rightOutside: void 0,
|
|
531
|
+
rightInside: "-100%",
|
|
532
|
+
center: "-50%"
|
|
533
|
+
}[horizontalAlignment];
|
|
534
|
+
const translateY = {
|
|
535
|
+
topOutside: "-100%",
|
|
536
|
+
topInside: void 0,
|
|
537
|
+
bottomOutside: void 0,
|
|
538
|
+
bottomInside: "-100%",
|
|
539
|
+
center: "-50%"
|
|
540
|
+
}[verticalAlignment];
|
|
541
|
+
return {
|
|
542
|
+
left: Math.max(left, edgePadding),
|
|
543
|
+
top: Math.max(top, edgePadding),
|
|
544
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
|
|
490
548
|
// src/components/user-action/Menu.tsx
|
|
491
|
-
import {
|
|
549
|
+
import { createPortal } from "react-dom";
|
|
550
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
551
|
+
function getScrollableParents(element) {
|
|
552
|
+
const scrollables = [];
|
|
553
|
+
let parent = element.parentElement;
|
|
554
|
+
while (parent) {
|
|
555
|
+
scrollables.push(parent);
|
|
556
|
+
parent = parent.parentElement;
|
|
557
|
+
}
|
|
558
|
+
return scrollables;
|
|
559
|
+
}
|
|
492
560
|
var Menu = ({
|
|
493
561
|
trigger,
|
|
494
562
|
children,
|
|
495
|
-
|
|
563
|
+
alignmentHorizontal = "leftInside",
|
|
564
|
+
alignmentVertical = "bottomOutside",
|
|
496
565
|
showOnHover = false,
|
|
566
|
+
disabled = false,
|
|
497
567
|
menuClassName = ""
|
|
498
568
|
}) => {
|
|
499
|
-
const { isHovered: isOpen, setIsHovered: setIsOpen
|
|
569
|
+
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
500
570
|
const triggerRef = useRef2(null);
|
|
501
571
|
const menuRef = useRef2(null);
|
|
502
572
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
573
|
+
const [isHidden, setIsHidden] = useState4(true);
|
|
574
|
+
const bag = {
|
|
575
|
+
isOpen,
|
|
576
|
+
close: () => setIsOpen(false),
|
|
577
|
+
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
578
|
+
disabled
|
|
579
|
+
};
|
|
580
|
+
const menuPosition = usePopoverPosition(
|
|
581
|
+
triggerRef.current?.getBoundingClientRect(),
|
|
582
|
+
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
583
|
+
);
|
|
584
|
+
useEffect6(() => {
|
|
585
|
+
if (!isOpen) return;
|
|
586
|
+
const triggerEl = triggerRef.current;
|
|
587
|
+
if (!triggerEl) return;
|
|
588
|
+
const scrollableParents = getScrollableParents(triggerEl);
|
|
589
|
+
const close = () => setIsOpen(false);
|
|
590
|
+
scrollableParents.forEach((parent) => {
|
|
591
|
+
parent.addEventListener("scroll", close);
|
|
592
|
+
});
|
|
593
|
+
window.addEventListener("resize", close);
|
|
594
|
+
return () => {
|
|
595
|
+
scrollableParents.forEach((parent) => {
|
|
596
|
+
parent.removeEventListener("scroll", close);
|
|
597
|
+
});
|
|
598
|
+
window.removeEventListener("resize", close);
|
|
599
|
+
};
|
|
600
|
+
}, [isOpen, setIsOpen]);
|
|
601
|
+
useEffect6(() => {
|
|
602
|
+
if (isOpen) {
|
|
603
|
+
setIsHidden(false);
|
|
604
|
+
}
|
|
605
|
+
}, [isOpen]);
|
|
606
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
607
|
+
trigger(bag, triggerRef),
|
|
608
|
+
createPortal(/* @__PURE__ */ jsx4(
|
|
609
|
+
"div",
|
|
610
|
+
{
|
|
611
|
+
ref: menuRef,
|
|
612
|
+
onClick: (e) => e.stopPropagation(),
|
|
613
|
+
className: clsx4(
|
|
614
|
+
"absolute rounded-md bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
513
615
|
{
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
"hidden": !isOpen
|
|
524
|
-
},
|
|
525
|
-
menuClassName
|
|
526
|
-
),
|
|
527
|
-
children: BagFunctionUtil.resolve(children, bag)
|
|
616
|
+
"animate-pop-in": isOpen,
|
|
617
|
+
"animate-pop-out": !isOpen,
|
|
618
|
+
"hidden": isHidden
|
|
619
|
+
},
|
|
620
|
+
menuClassName
|
|
621
|
+
),
|
|
622
|
+
onAnimationEnd: () => {
|
|
623
|
+
if (!isOpen) {
|
|
624
|
+
setIsHidden(true);
|
|
528
625
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
626
|
+
},
|
|
627
|
+
style: {
|
|
628
|
+
...menuPosition
|
|
629
|
+
},
|
|
630
|
+
children: BagFunctionUtil.resolve(children, bag)
|
|
631
|
+
}
|
|
632
|
+
), document.body)
|
|
633
|
+
] });
|
|
533
634
|
};
|
|
534
635
|
|
|
535
636
|
// src/localization/LanguageProvider.tsx
|
|
536
|
-
import { createContext, useContext, useEffect as
|
|
637
|
+
import { createContext, useContext, useEffect as useEffect8, useState as useState6 } from "react";
|
|
537
638
|
|
|
538
639
|
// src/hooks/useLocalStorage.ts
|
|
539
|
-
import { useCallback as useCallback2, useEffect as
|
|
640
|
+
import { useCallback as useCallback2, useEffect as useEffect7, useState as useState5 } from "react";
|
|
540
641
|
|
|
541
642
|
// src/localization/util.ts
|
|
542
643
|
var languages = ["en", "de"];
|
|
@@ -622,6 +723,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
622
723
|
// src/localization/defaults/form.ts
|
|
623
724
|
var formTranslation = {
|
|
624
725
|
en: {
|
|
726
|
+
add: "Add",
|
|
625
727
|
all: "All",
|
|
626
728
|
apply: "Apply",
|
|
627
729
|
back: "Back",
|
|
@@ -634,6 +736,7 @@ var formTranslation = {
|
|
|
634
736
|
confirm: "Confirm",
|
|
635
737
|
copy: "Copy",
|
|
636
738
|
copied: "Copied",
|
|
739
|
+
create: "Create",
|
|
637
740
|
decline: "Decline",
|
|
638
741
|
delete: "Delete",
|
|
639
742
|
discard: "Discard",
|
|
@@ -676,6 +779,7 @@ var formTranslation = {
|
|
|
676
779
|
yes: "Yes"
|
|
677
780
|
},
|
|
678
781
|
de: {
|
|
782
|
+
add: "Hinzuf\xFCgen",
|
|
679
783
|
all: "Alle",
|
|
680
784
|
apply: "Anwenden",
|
|
681
785
|
back: "Zur\xFCck",
|
|
@@ -688,6 +792,7 @@ var formTranslation = {
|
|
|
688
792
|
confirm: "Best\xE4tigen",
|
|
689
793
|
copy: "Kopieren",
|
|
690
794
|
copied: "Kopiert",
|
|
795
|
+
create: "Erstellen",
|
|
691
796
|
decline: "Ablehnen",
|
|
692
797
|
delete: "L\xF6schen",
|
|
693
798
|
discard: "Verwerfen",
|
|
@@ -732,8 +837,8 @@ var formTranslation = {
|
|
|
732
837
|
};
|
|
733
838
|
|
|
734
839
|
// src/components/table/TableFilterButton.tsx
|
|
735
|
-
import { useEffect as
|
|
736
|
-
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
840
|
+
import { useEffect as useEffect9, useState as useState7 } from "react";
|
|
841
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
737
842
|
var defaultTableFilterTranslation = {
|
|
738
843
|
en: {
|
|
739
844
|
filter: "Filter",
|
|
@@ -758,16 +863,16 @@ var TableFilterButton = ({
|
|
|
758
863
|
}) => {
|
|
759
864
|
const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
|
|
760
865
|
const columnFilterValue = column.getFilterValue();
|
|
761
|
-
const [filterValue, setFilterValue] =
|
|
866
|
+
const [filterValue, setFilterValue] = useState7(columnFilterValue);
|
|
762
867
|
const hasFilter = !!filterValue;
|
|
763
|
-
|
|
868
|
+
useEffect9(() => {
|
|
764
869
|
setFilterValue(columnFilterValue);
|
|
765
870
|
}, [columnFilterValue]);
|
|
766
871
|
return /* @__PURE__ */ jsx6(
|
|
767
872
|
Menu,
|
|
768
873
|
{
|
|
769
|
-
trigger: (
|
|
770
|
-
/* @__PURE__ */ jsx6(IconButton, { color: "neutral", size: "tiny", onClick, children: /* @__PURE__ */ jsx6(FilterIcon, {}) }),
|
|
874
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ jsxs4("div", { ref, className: "relative", children: [
|
|
875
|
+
/* @__PURE__ */ jsx6(IconButton, { color: "neutral", size: "tiny", onClick: toggleOpen, children: /* @__PURE__ */ jsx6(FilterIcon, {}) }),
|
|
771
876
|
hasFilter && /* @__PURE__ */ jsx6(
|
|
772
877
|
"div",
|
|
773
878
|
{
|
|
@@ -776,7 +881,7 @@ var TableFilterButton = ({
|
|
|
776
881
|
}
|
|
777
882
|
)
|
|
778
883
|
] }),
|
|
779
|
-
children: ({ close }) => /* @__PURE__ */ jsxs4("div", { className: "col
|
|
884
|
+
children: ({ close }) => /* @__PURE__ */ jsxs4("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
780
885
|
/* @__PURE__ */ jsx6("h4", { className: "textstyle-title-sm", children: translation("filter") }),
|
|
781
886
|
filterType === "text" && /* @__PURE__ */ jsx6(
|
|
782
887
|
Input,
|
|
@@ -788,7 +893,7 @@ var TableFilterButton = ({
|
|
|
788
893
|
className: "h-10"
|
|
789
894
|
}
|
|
790
895
|
),
|
|
791
|
-
filterType === "range" && /* @__PURE__ */ jsxs4("div", { className: "row
|
|
896
|
+
filterType === "range" && /* @__PURE__ */ jsxs4("div", { className: "flex-row-2 items-center", children: [
|
|
792
897
|
/* @__PURE__ */ jsx6(
|
|
793
898
|
Input,
|
|
794
899
|
{
|
|
@@ -817,7 +922,7 @@ var TableFilterButton = ({
|
|
|
817
922
|
}
|
|
818
923
|
)
|
|
819
924
|
] }),
|
|
820
|
-
filterType === "dateRange" && /* @__PURE__ */ jsxs4(
|
|
925
|
+
filterType === "dateRange" && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
821
926
|
/* @__PURE__ */ jsx6(
|
|
822
927
|
Input,
|
|
823
928
|
{
|
|
@@ -845,7 +950,7 @@ var TableFilterButton = ({
|
|
|
845
950
|
}
|
|
846
951
|
)
|
|
847
952
|
] }),
|
|
848
|
-
/* @__PURE__ */ jsxs4("div", { className: "row justify-end w-full", children: [
|
|
953
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
849
954
|
hasFilter && /* @__PURE__ */ jsx6(SolidButton, { color: "negative", size: "small", onClick: () => {
|
|
850
955
|
column.setFilterValue(void 0);
|
|
851
956
|
close();
|