@helpwave/hightide 0.0.12 → 0.0.15
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/coloring/shading.d.mts +5 -0
- package/dist/coloring/shading.d.ts +5 -2
- package/dist/coloring/shading.js +80 -38
- package/dist/coloring/shading.js.map +1 -0
- package/dist/coloring/shading.mjs +47 -0
- package/dist/coloring/shading.mjs.map +1 -0
- package/dist/coloring/types.d.mts +13 -0
- package/dist/coloring/types.d.ts +8 -6
- package/dist/coloring/types.js +31 -1
- package/dist/coloring/types.js.map +1 -0
- package/dist/coloring/types.mjs +6 -0
- package/dist/coloring/types.mjs.map +1 -0
- package/dist/components/Avatar.d.mts +17 -0
- package/dist/components/Avatar.d.ts +9 -6
- package/dist/components/Avatar.js +79 -29
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Avatar.mjs +48 -0
- package/dist/components/Avatar.mjs.map +1 -0
- package/dist/components/AvatarGroup.d.mts +14 -0
- package/dist/components/AvatarGroup.d.ts +7 -3
- package/dist/components/AvatarGroup.js +117 -12
- package/dist/components/AvatarGroup.js.map +1 -0
- package/dist/components/AvatarGroup.mjs +81 -0
- package/dist/components/AvatarGroup.mjs.map +1 -0
- package/dist/components/BreadCrumb.d.mts +19 -0
- package/dist/components/BreadCrumb.d.ts +6 -3
- package/dist/components/BreadCrumb.js +49 -11
- package/dist/components/BreadCrumb.js.map +1 -0
- package/dist/components/BreadCrumb.mjs +15 -0
- package/dist/components/BreadCrumb.mjs.map +1 -0
- package/dist/components/Button.d.mts +44 -0
- package/dist/components/Button.d.ts +16 -13
- package/dist/components/Button.js +232 -80
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Button.mjs +198 -0
- package/dist/components/Button.mjs.map +1 -0
- package/dist/components/ChipList.d.mts +24 -0
- package/dist/components/ChipList.d.ts +10 -7
- package/dist/components/ChipList.js +103 -36
- package/dist/components/ChipList.js.map +1 -0
- package/dist/components/ChipList.mjs +69 -0
- package/dist/components/ChipList.mjs.map +1 -0
- package/dist/components/Circle.d.mts +10 -0
- package/dist/components/Circle.d.ts +7 -3
- package/dist/components/Circle.js +61 -9
- package/dist/components/Circle.js.map +1 -0
- package/dist/components/Circle.mjs +27 -0
- package/dist/components/Circle.mjs.map +1 -0
- package/dist/components/ErrorComponent.d.mts +18 -0
- package/dist/components/ErrorComponent.d.ts +9 -4
- package/dist/components/ErrorComponent.js +86 -17
- package/dist/components/ErrorComponent.js.map +1 -0
- package/dist/components/ErrorComponent.mjs +53 -0
- package/dist/components/ErrorComponent.mjs.map +1 -0
- package/dist/components/Expandable.d.mts +33 -0
- package/dist/components/Expandable.d.ts +8 -5
- package/dist/components/Expandable.js +79 -15
- package/dist/components/Expandable.js.map +1 -0
- package/dist/components/Expandable.mjs +45 -0
- package/dist/components/Expandable.mjs.map +1 -0
- package/dist/components/HelpwaveBadge.d.mts +14 -0
- package/dist/components/HelpwaveBadge.d.ts +6 -3
- package/dist/components/HelpwaveBadge.js +125 -13
- package/dist/components/HelpwaveBadge.js.map +1 -0
- package/dist/components/HelpwaveBadge.mjs +91 -0
- package/dist/components/HelpwaveBadge.mjs.map +1 -0
- package/dist/components/HideableContentSection.d.mts +14 -0
- package/dist/components/HideableContentSection.d.ts +7 -3
- package/dist/components/HideableContentSection.js +69 -14
- package/dist/components/HideableContentSection.js.map +1 -0
- package/dist/components/HideableContentSection.mjs +35 -0
- package/dist/components/HideableContentSection.mjs.map +1 -0
- package/dist/components/InputGroup.d.mts +17 -0
- package/dist/components/InputGroup.d.ts +7 -3
- package/dist/components/InputGroup.js +96 -32
- package/dist/components/InputGroup.js.map +1 -0
- package/dist/components/InputGroup.mjs +62 -0
- package/dist/components/InputGroup.mjs.map +1 -0
- package/dist/components/LoadingAndErrorComponent.d.mts +24 -0
- package/dist/components/LoadingAndErrorComponent.d.ts +12 -5
- package/dist/components/LoadingAndErrorComponent.js +178 -23
- package/dist/components/LoadingAndErrorComponent.js.map +1 -0
- package/dist/components/LoadingAndErrorComponent.mjs +145 -0
- package/dist/components/LoadingAndErrorComponent.mjs.map +1 -0
- package/dist/components/LoadingAnimation.d.mts +18 -0
- package/dist/components/LoadingAnimation.d.ts +9 -4
- package/dist/components/LoadingAnimation.js +124 -16
- package/dist/components/LoadingAnimation.js.map +1 -0
- package/dist/components/LoadingAnimation.mjs +90 -0
- package/dist/components/LoadingAnimation.mjs.map +1 -0
- package/dist/components/LoadingButton.d.mts +10 -0
- package/dist/components/LoadingButton.d.ts +7 -3
- package/dist/components/LoadingButton.js +169 -9
- package/dist/components/LoadingButton.js.map +1 -0
- package/dist/components/LoadingButton.mjs +135 -0
- package/dist/components/LoadingButton.mjs.map +1 -0
- package/dist/components/MarkdownInterpreter.d.mts +28 -0
- package/dist/components/MarkdownInterpreter.d.ts +8 -5
- package/dist/components/MarkdownInterpreter.js +246 -175
- package/dist/components/MarkdownInterpreter.js.map +1 -0
- package/dist/components/MarkdownInterpreter.mjs +235 -0
- package/dist/components/MarkdownInterpreter.mjs.map +1 -0
- package/dist/components/Pagination.d.mts +19 -0
- package/dist/components/Pagination.d.ts +9 -4
- package/dist/components/Pagination.js +100 -23
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Pagination.mjs +67 -0
- package/dist/components/Pagination.mjs.map +1 -0
- package/dist/components/Profile.d.mts +31 -0
- package/dist/components/Profile.d.ts +8 -5
- package/dist/components/Profile.js +194 -42
- package/dist/components/Profile.js.map +1 -0
- package/dist/components/Profile.mjs +162 -0
- package/dist/components/Profile.mjs.map +1 -0
- package/dist/components/ProgressIndicator.d.mts +24 -0
- package/dist/components/ProgressIndicator.d.ts +6 -3
- package/dist/components/ProgressIndicator.js +82 -22
- package/dist/components/ProgressIndicator.js.map +1 -0
- package/dist/components/ProgressIndicator.mjs +59 -0
- package/dist/components/ProgressIndicator.mjs.map +1 -0
- package/dist/components/Ring.d.mts +35 -0
- package/dist/components/Ring.d.ts +13 -9
- package/dist/components/Ring.js +331 -107
- package/dist/components/Ring.js.map +1 -0
- package/dist/components/Ring.mjs +299 -0
- package/dist/components/Ring.mjs.map +1 -0
- package/dist/components/SearchableList.d.mts +22 -0
- package/dist/components/SearchableList.d.ts +9 -5
- package/dist/components/SearchableList.js +268 -24
- package/dist/components/SearchableList.js.map +1 -0
- package/dist/components/SearchableList.mjs +241 -0
- package/dist/components/SearchableList.mjs.map +1 -0
- package/dist/components/SortButton.d.mts +15 -0
- package/dist/components/SortButton.d.ts +9 -4
- package/dist/components/SortButton.js +131 -8
- package/dist/components/SortButton.js.map +1 -0
- package/dist/components/SortButton.mjs +97 -0
- package/dist/components/SortButton.mjs.map +1 -0
- package/dist/components/Span.d.mts +2 -0
- package/dist/components/Span.d.ts +2 -0
- package/dist/components/Span.js +1 -0
- package/dist/components/Span.js.map +1 -0
- package/dist/components/Span.mjs +1 -0
- package/dist/components/Span.mjs.map +1 -0
- package/dist/components/StepperBar.d.mts +28 -0
- package/dist/components/StepperBar.d.ts +10 -5
- package/dist/components/StepperBar.js +248 -44
- package/dist/components/StepperBar.js.map +1 -0
- package/dist/components/StepperBar.mjs +216 -0
- package/dist/components/StepperBar.mjs.map +1 -0
- package/dist/components/Table.d.mts +90 -0
- package/dist/components/Table.d.ts +20 -17
- package/dist/components/Table.js +396 -170
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Table.mjs +370 -0
- package/dist/components/Table.mjs.map +1 -0
- package/dist/components/TechRadar.d.mts +39 -0
- package/dist/components/TechRadar.d.ts +5 -2
- package/dist/components/TechRadar.js +241 -189
- package/dist/components/TechRadar.js.map +1 -0
- package/dist/components/TechRadar.mjs +208 -0
- package/dist/components/TechRadar.mjs.map +1 -0
- package/dist/components/TextImage.d.mts +25 -0
- package/dist/components/TextImage.d.ts +9 -4
- package/dist/components/TextImage.js +121 -29
- package/dist/components/TextImage.js.map +1 -0
- package/dist/components/TextImage.mjs +86 -0
- package/dist/components/TextImage.mjs.map +1 -0
- package/dist/components/TimeDisplay.d.mts +35 -0
- package/dist/components/TimeDisplay.d.ts +8 -3
- package/dist/components/TimeDisplay.js +134 -81
- package/dist/components/TimeDisplay.js.map +1 -0
- package/dist/components/TimeDisplay.mjs +109 -0
- package/dist/components/TimeDisplay.mjs.map +1 -0
- package/dist/components/Tooltip.d.mts +37 -0
- package/dist/components/Tooltip.d.ts +7 -4
- package/dist/components/Tooltip.js +135 -37
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Tooltip.mjs +109 -0
- package/dist/components/Tooltip.mjs.map +1 -0
- package/dist/components/VerticalDivider.d.mts +15 -0
- package/dist/components/VerticalDivider.d.ts +6 -2
- package/dist/components/VerticalDivider.js +80 -6
- package/dist/components/VerticalDivider.js.map +1 -0
- package/dist/components/VerticalDivider.mjs +56 -0
- package/dist/components/VerticalDivider.mjs.map +1 -0
- package/dist/components/date/DatePicker.d.mts +32 -0
- package/dist/components/date/DatePicker.d.ts +13 -7
- package/dist/components/date/DatePicker.js +624 -55
- package/dist/components/date/DatePicker.js.map +1 -0
- package/dist/components/date/DatePicker.mjs +591 -0
- package/dist/components/date/DatePicker.mjs.map +1 -0
- package/dist/components/date/DayPicker.d.mts +20 -0
- package/dist/components/date/DayPicker.d.ts +8 -4
- package/dist/components/date/DayPicker.js +232 -36
- package/dist/components/date/DayPicker.js.map +1 -0
- package/dist/components/date/DayPicker.mjs +195 -0
- package/dist/components/date/DayPicker.mjs.map +1 -0
- package/dist/components/date/TimePicker.d.mts +15 -0
- package/dist/components/date/TimePicker.d.ts +7 -4
- package/dist/components/date/TimePicker.js +196 -75
- package/dist/components/date/TimePicker.js.map +1 -0
- package/dist/components/date/TimePicker.mjs +164 -0
- package/dist/components/date/TimePicker.mjs.map +1 -0
- package/dist/components/date/YearMonthPicker.d.mts +15 -0
- package/dist/components/date/YearMonthPicker.d.ts +7 -3
- package/dist/components/date/YearMonthPicker.js +281 -57
- package/dist/components/date/YearMonthPicker.js.map +1 -0
- package/dist/components/date/YearMonthPicker.mjs +247 -0
- package/dist/components/date/YearMonthPicker.mjs.map +1 -0
- package/dist/components/examples/InputGroupExample.d.mts +11 -0
- package/dist/components/examples/InputGroupExample.d.ts +8 -3
- package/dist/components/examples/InputGroupExample.js +465 -20
- package/dist/components/examples/InputGroupExample.js.map +1 -0
- package/dist/components/examples/InputGroupExample.mjs +436 -0
- package/dist/components/examples/InputGroupExample.mjs.map +1 -0
- package/dist/components/examples/MultiSelectExample.d.mts +14 -0
- package/dist/components/examples/MultiSelectExample.d.ts +10 -3
- package/dist/components/examples/MultiSelectExample.js +659 -25
- package/dist/components/examples/MultiSelectExample.js.map +1 -0
- package/dist/components/examples/MultiSelectExample.mjs +631 -0
- package/dist/components/examples/MultiSelectExample.mjs.map +1 -0
- package/dist/components/examples/SearchableSelectExample.d.mts +13 -0
- package/dist/components/examples/SearchableSelectExample.d.ts +10 -3
- package/dist/components/examples/SearchableSelectExample.js +364 -16
- package/dist/components/examples/SearchableSelectExample.js.map +1 -0
- package/dist/components/examples/SearchableSelectExample.mjs +335 -0
- package/dist/components/examples/SearchableSelectExample.mjs.map +1 -0
- package/dist/components/examples/SelectExample.d.mts +9 -0
- package/dist/components/examples/SelectExample.d.ts +8 -3
- package/dist/components/examples/SelectExample.js +178 -13
- package/dist/components/examples/SelectExample.js.map +1 -0
- package/dist/components/examples/SelectExample.mjs +145 -0
- package/dist/components/examples/SelectExample.mjs.map +1 -0
- package/dist/components/examples/StackingModals.d.mts +8 -0
- package/dist/components/examples/StackingModals.d.ts +5 -1
- package/dist/components/examples/StackingModals.js +497 -14
- package/dist/components/examples/StackingModals.js.map +1 -0
- package/dist/components/examples/StackingModals.mjs +463 -0
- package/dist/components/examples/StackingModals.mjs.map +1 -0
- package/dist/components/examples/TableExample.d.mts +13 -0
- package/dist/components/examples/TableExample.d.ts +9 -5
- package/dist/components/examples/TableExample.js +850 -89
- package/dist/components/examples/TableExample.js.map +1 -0
- package/dist/components/examples/TableExample.mjs +823 -0
- package/dist/components/examples/TableExample.mjs.map +1 -0
- package/dist/components/examples/TextareaExample.d.mts +12 -0
- package/dist/components/examples/TextareaExample.d.ts +9 -3
- package/dist/components/examples/TextareaExample.js +175 -9
- package/dist/components/examples/TextareaExample.js.map +1 -0
- package/dist/components/examples/TextareaExample.mjs +141 -0
- package/dist/components/examples/TextareaExample.mjs.map +1 -0
- package/dist/components/examples/TileExample.d.mts +14 -0
- package/dist/components/examples/TileExample.d.ts +8 -3
- package/dist/components/examples/TileExample.js +78 -8
- package/dist/components/examples/TileExample.js.map +1 -0
- package/dist/components/examples/TileExample.mjs +44 -0
- package/dist/components/examples/TileExample.mjs.map +1 -0
- package/dist/components/examples/Title.d.mts +2 -0
- package/dist/components/examples/Title.d.ts +2 -0
- package/dist/components/examples/Title.js +1 -0
- package/dist/components/examples/Title.js.map +1 -0
- package/dist/components/examples/Title.mjs +1 -0
- package/dist/components/examples/Title.mjs.map +1 -0
- package/dist/components/examples/date/DateTimePickerExample.d.mts +18 -0
- package/dist/components/examples/date/DateTimePickerExample.d.ts +15 -7
- package/dist/components/examples/date/DateTimePickerExample.js +877 -19
- package/dist/components/examples/date/DateTimePickerExample.js.map +1 -0
- package/dist/components/examples/date/DateTimePickerExample.mjs +844 -0
- package/dist/components/examples/date/DateTimePickerExample.mjs.map +1 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.d.mts +16 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +11 -3
- package/dist/components/examples/properties/CheckboxPropertyExample.js +348 -12
- package/dist/components/examples/properties/CheckboxPropertyExample.js.map +1 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs +314 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.mjs.map +1 -0
- package/dist/components/examples/properties/DatePropertyExample.d.mts +16 -0
- package/dist/components/examples/properties/DatePropertyExample.d.ts +11 -3
- package/dist/components/examples/properties/DatePropertyExample.js +459 -22
- package/dist/components/examples/properties/DatePropertyExample.js.map +1 -0
- package/dist/components/examples/properties/DatePropertyExample.mjs +430 -0
- package/dist/components/examples/properties/DatePropertyExample.mjs.map +1 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.mts +18 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +13 -3
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +847 -15
- package/dist/components/examples/properties/MultiSelectPropertyExample.js.map +1 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs +818 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.mjs.map +1 -0
- package/dist/components/examples/properties/NumberPropertyExample.d.mts +14 -0
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +11 -3
- package/dist/components/examples/properties/NumberPropertyExample.js +455 -12
- package/dist/components/examples/properties/NumberPropertyExample.js.map +1 -0
- package/dist/components/examples/properties/NumberPropertyExample.mjs +426 -0
- package/dist/components/examples/properties/NumberPropertyExample.mjs.map +1 -0
- package/dist/components/examples/properties/SelectPropertyExample.d.mts +17 -0
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +14 -3
- package/dist/components/examples/properties/SelectPropertyExample.js +582 -16
- package/dist/components/examples/properties/SelectPropertyExample.js.map +1 -0
- package/dist/components/examples/properties/SelectPropertyExample.mjs +554 -0
- package/dist/components/examples/properties/SelectPropertyExample.mjs.map +1 -0
- package/dist/components/examples/properties/TextPropertyExample.d.mts +16 -0
- package/dist/components/examples/properties/TextPropertyExample.d.ts +11 -3
- package/dist/components/examples/properties/TextPropertyExample.js +404 -12
- package/dist/components/examples/properties/TextPropertyExample.js.map +1 -0
- package/dist/components/examples/properties/TextPropertyExample.mjs +370 -0
- package/dist/components/examples/properties/TextPropertyExample.mjs.map +1 -0
- package/dist/components/icons/Helpwave.d.mts +14 -0
- package/dist/components/icons/Helpwave.d.ts +7 -3
- package/dist/components/icons/Helpwave.js +66 -18
- package/dist/components/icons/Helpwave.js.map +1 -0
- package/dist/components/icons/Helpwave.mjs +43 -0
- package/dist/components/icons/Helpwave.mjs.map +1 -0
- package/dist/components/icons/Tag.d.mts +14 -0
- package/dist/components/icons/Tag.d.ts +7 -3
- package/dist/components/icons/Tag.js +59 -11
- package/dist/components/icons/Tag.js.map +1 -0
- package/dist/components/icons/Tag.mjs +25 -0
- package/dist/components/icons/Tag.mjs.map +1 -0
- package/dist/components/layout/Carousel.d.mts +25 -0
- package/dist/components/layout/Carousel.d.ts +6 -3
- package/dist/components/layout/Carousel.js +477 -226
- package/dist/components/layout/Carousel.js.map +1 -0
- package/dist/components/layout/Carousel.mjs +449 -0
- package/dist/components/layout/Carousel.mjs.map +1 -0
- package/dist/components/layout/DividerInserter.d.mts +15 -0
- package/dist/components/layout/DividerInserter.d.ts +7 -3
- package/dist/components/layout/DividerInserter.js +58 -18
- package/dist/components/layout/DividerInserter.js.map +1 -0
- package/dist/components/layout/DividerInserter.mjs +25 -0
- package/dist/components/layout/DividerInserter.mjs.map +1 -0
- package/dist/components/layout/FAQSection.d.mts +26 -0
- package/dist/components/layout/FAQSection.d.ts +9 -6
- package/dist/components/layout/FAQSection.js +336 -13
- package/dist/components/layout/FAQSection.js.map +1 -0
- package/dist/components/layout/FAQSection.mjs +302 -0
- package/dist/components/layout/FAQSection.mjs.map +1 -0
- package/dist/components/layout/Tile.d.mts +37 -0
- package/dist/components/layout/Tile.d.ts +9 -6
- package/dist/components/layout/Tile.js +76 -16
- package/dist/components/layout/Tile.js.map +1 -0
- package/dist/components/layout/Tile.mjs +42 -0
- package/dist/components/layout/Tile.mjs.map +1 -0
- package/dist/components/modals/ConfirmDialog.d.mts +38 -0
- package/dist/components/modals/ConfirmDialog.d.ts +13 -9
- package/dist/components/modals/ConfirmDialog.js +422 -28
- package/dist/components/modals/ConfirmDialog.js.map +1 -0
- package/dist/components/modals/ConfirmDialog.mjs +388 -0
- package/dist/components/modals/ConfirmDialog.mjs.map +1 -0
- package/dist/components/modals/DiscardChangesDialog.d.mts +23 -0
- package/dist/components/modals/DiscardChangesDialog.d.ts +9 -5
- package/dist/components/modals/DiscardChangesDialog.js +406 -23
- package/dist/components/modals/DiscardChangesDialog.js.map +1 -0
- package/dist/components/modals/DiscardChangesDialog.mjs +370 -0
- package/dist/components/modals/DiscardChangesDialog.mjs.map +1 -0
- package/dist/components/modals/InputModal.d.mts +19 -0
- package/dist/components/modals/InputModal.d.ts +14 -4
- package/dist/components/modals/InputModal.js +598 -8
- package/dist/components/modals/InputModal.js.map +1 -0
- package/dist/components/modals/InputModal.mjs +567 -0
- package/dist/components/modals/InputModal.mjs.map +1 -0
- package/dist/components/modals/LanguageModal.d.mts +21 -0
- package/dist/components/modals/LanguageModal.d.ts +9 -5
- package/dist/components/modals/LanguageModal.js +524 -33
- package/dist/components/modals/LanguageModal.js.map +1 -0
- package/dist/components/modals/LanguageModal.mjs +489 -0
- package/dist/components/modals/LanguageModal.mjs.map +1 -0
- package/dist/components/modals/Modal.d.mts +43 -0
- package/dist/components/modals/Modal.d.ts +13 -8
- package/dist/components/modals/Modal.js +280 -51
- package/dist/components/modals/Modal.js.map +1 -0
- package/dist/components/modals/Modal.mjs +249 -0
- package/dist/components/modals/Modal.mjs.map +1 -0
- package/dist/components/modals/ModalRegister.d.mts +16 -0
- package/dist/components/modals/ModalRegister.d.ts +9 -4
- package/dist/components/modals/ModalRegister.js +61 -26
- package/dist/components/modals/ModalRegister.js.map +1 -0
- package/dist/components/modals/ModalRegister.mjs +37 -0
- package/dist/components/modals/ModalRegister.mjs.map +1 -0
- package/dist/components/properties/CheckboxProperty.d.mts +20 -0
- package/dist/components/properties/CheckboxProperty.d.ts +10 -5
- package/dist/components/properties/CheckboxProperty.js +323 -24
- package/dist/components/properties/CheckboxProperty.js.map +1 -0
- package/dist/components/properties/CheckboxProperty.mjs +291 -0
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -0
- package/dist/components/properties/DateProperty.d.mts +18 -0
- package/dist/components/properties/DateProperty.d.ts +10 -3
- package/dist/components/properties/DateProperty.js +422 -21
- package/dist/components/properties/DateProperty.js.map +1 -0
- package/dist/components/properties/DateProperty.mjs +393 -0
- package/dist/components/properties/DateProperty.mjs.map +1 -0
- package/dist/components/properties/MultiSelectProperty.d.mts +18 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +12 -6
- package/dist/components/properties/MultiSelectProperty.js +815 -31
- package/dist/components/properties/MultiSelectProperty.js.map +1 -0
- package/dist/components/properties/MultiSelectProperty.mjs +787 -0
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -0
- package/dist/components/properties/NumberProperty.d.mts +21 -0
- package/dist/components/properties/NumberProperty.d.ts +10 -5
- package/dist/components/properties/NumberProperty.js +429 -39
- package/dist/components/properties/NumberProperty.js.map +1 -0
- package/dist/components/properties/NumberProperty.mjs +402 -0
- package/dist/components/properties/NumberProperty.mjs.map +1 -0
- package/dist/components/properties/PropertyBase.d.mts +27 -0
- package/dist/components/properties/PropertyBase.d.ts +9 -5
- package/dist/components/properties/PropertyBase.js +194 -24
- package/dist/components/properties/PropertyBase.js.map +1 -0
- package/dist/components/properties/PropertyBase.mjs +162 -0
- package/dist/components/properties/PropertyBase.mjs.map +1 -0
- package/dist/components/properties/SelectProperty.d.mts +19 -0
- package/dist/components/properties/SelectProperty.d.ts +13 -6
- package/dist/components/properties/SelectProperty.js +547 -19
- package/dist/components/properties/SelectProperty.js.map +1 -0
- package/dist/components/properties/SelectProperty.mjs +520 -0
- package/dist/components/properties/SelectProperty.mjs.map +1 -0
- package/dist/components/properties/TextProperty.d.mts +20 -0
- package/dist/components/properties/TextProperty.d.ts +10 -5
- package/dist/components/properties/TextProperty.js +378 -34
- package/dist/components/properties/TextProperty.js.map +1 -0
- package/dist/components/properties/TextProperty.mjs +346 -0
- package/dist/components/properties/TextProperty.mjs.map +1 -0
- package/dist/components/user-input/Checkbox.d.mts +41 -0
- package/dist/components/user-input/Checkbox.d.ts +9 -5
- package/dist/components/user-input/Checkbox.js +148 -63
- package/dist/components/user-input/Checkbox.js.map +1 -0
- package/dist/components/user-input/Checkbox.mjs +112 -0
- package/dist/components/user-input/Checkbox.mjs.map +1 -0
- package/dist/components/user-input/DateAndTimePicker.d.mts +47 -0
- package/dist/components/user-input/DateAndTimePicker.d.ts +15 -7
- package/dist/components/user-input/DateAndTimePicker.js +831 -60
- package/dist/components/user-input/DateAndTimePicker.js.map +1 -0
- package/dist/components/user-input/DateAndTimePicker.mjs +801 -0
- package/dist/components/user-input/DateAndTimePicker.mjs.map +1 -0
- package/dist/components/user-input/Input.d.mts +64 -0
- package/dist/components/user-input/Input.d.ts +12 -9
- package/dist/components/user-input/Input.js +219 -57
- package/dist/components/user-input/Input.js.map +1 -0
- package/dist/components/user-input/Input.mjs +191 -0
- package/dist/components/user-input/Input.mjs.map +1 -0
- package/dist/components/user-input/Label.d.mts +16 -0
- package/dist/components/user-input/Label.d.ts +8 -4
- package/dist/components/user-input/Label.js +43 -11
- package/dist/components/user-input/Label.js.map +1 -0
- package/dist/components/user-input/Label.mjs +19 -0
- package/dist/components/user-input/Label.mjs.map +1 -0
- package/dist/components/user-input/Menu.d.mts +24 -0
- package/dist/components/user-input/Menu.d.ts +8 -5
- package/dist/components/user-input/Menu.js +162 -25
- package/dist/components/user-input/Menu.js.map +1 -0
- package/dist/components/user-input/Menu.mjs +127 -0
- package/dist/components/user-input/Menu.mjs.map +1 -0
- package/dist/components/user-input/MultiSelect.d.mts +43 -0
- package/dist/components/user-input/MultiSelect.d.ts +12 -8
- package/dist/components/user-input/MultiSelect.js +545 -56
- package/dist/components/user-input/MultiSelect.js.map +1 -0
- package/dist/components/user-input/MultiSelect.mjs +516 -0
- package/dist/components/user-input/MultiSelect.mjs.map +1 -0
- package/dist/components/user-input/ScrollPicker.d.mts +15 -0
- package/dist/components/user-input/ScrollPicker.d.ts +6 -2
- package/dist/components/user-input/ScrollPicker.js +276 -145
- package/dist/components/user-input/ScrollPicker.js.map +1 -0
- package/dist/components/user-input/ScrollPicker.mjs +247 -0
- package/dist/components/user-input/ScrollPicker.mjs.map +1 -0
- package/dist/components/user-input/SearchableSelect.d.mts +14 -0
- package/dist/components/user-input/SearchableSelect.d.ts +9 -3
- package/dist/components/user-input/SearchableSelect.js +334 -13
- package/dist/components/user-input/SearchableSelect.js.map +1 -0
- package/dist/components/user-input/SearchableSelect.mjs +305 -0
- package/dist/components/user-input/SearchableSelect.mjs.map +1 -0
- package/dist/components/user-input/Select.d.mts +36 -0
- package/dist/components/user-input/Select.d.ts +9 -5
- package/dist/components/user-input/Select.js +152 -47
- package/dist/components/user-input/Select.js.map +1 -0
- package/dist/components/user-input/Select.mjs +118 -0
- package/dist/components/user-input/Select.mjs.map +1 -0
- package/dist/components/user-input/Textarea.d.mts +24 -0
- package/dist/components/user-input/Textarea.d.ts +8 -4
- package/dist/components/user-input/Textarea.js +153 -31
- package/dist/components/user-input/Textarea.js.map +1 -0
- package/dist/components/user-input/Textarea.mjs +120 -0
- package/dist/components/user-input/Textarea.mjs.map +1 -0
- package/dist/components/user-input/ToggleableInput.d.mts +35 -0
- package/dist/components/user-input/ToggleableInput.d.ts +6 -3
- package/dist/components/user-input/ToggleableInput.js +161 -38
- package/dist/components/user-input/ToggleableInput.js.map +1 -0
- package/dist/components/user-input/ToggleableInput.mjs +128 -0
- package/dist/components/user-input/ToggleableInput.mjs.map +1 -0
- package/dist/css/uncompiled/globals.css +488 -0
- package/dist/hooks/useHoverState.d.mts +42 -0
- package/dist/hooks/useHoverState.d.ts +5 -3
- package/dist/hooks/useHoverState.js +69 -43
- package/dist/hooks/useHoverState.js.map +1 -0
- package/dist/hooks/useHoverState.mjs +47 -0
- package/dist/hooks/useHoverState.mjs.map +1 -0
- package/dist/hooks/useLanguage.d.mts +21 -0
- package/dist/hooks/useLanguage.d.ts +15 -11
- package/dist/hooks/useLanguage.js +145 -50
- package/dist/hooks/useLanguage.js.map +1 -0
- package/dist/hooks/useLanguage.mjs +115 -0
- package/dist/hooks/useLanguage.mjs.map +1 -0
- package/dist/hooks/useLocalStorage.d.mts +6 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -2
- package/dist/hooks/useLocalStorage.js +79 -23
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useLocalStorage.mjs +59 -0
- package/dist/hooks/useLocalStorage.mjs.map +1 -0
- package/dist/hooks/useOutsideClick.d.mts +5 -0
- package/dist/hooks/useOutsideClick.d.ts +5 -2
- package/dist/hooks/useOutsideClick.js +47 -21
- package/dist/hooks/useOutsideClick.js.map +1 -0
- package/dist/hooks/useOutsideClick.mjs +23 -0
- package/dist/hooks/useOutsideClick.mjs.map +1 -0
- package/dist/hooks/useSaveDelay.d.mts +6 -0
- package/dist/hooks/useSaveDelay.d.ts +2 -1
- package/dist/hooks/useSaveDelay.js +62 -38
- package/dist/hooks/useSaveDelay.js.map +1 -0
- package/dist/hooks/useSaveDelay.mjs +44 -0
- package/dist/hooks/useSaveDelay.mjs.map +1 -0
- package/dist/hooks/useTheme.d.mts +21 -0
- package/dist/hooks/useTheme.d.ts +14 -9
- package/dist/hooks/useTheme.js +65 -29
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useTheme.mjs +40 -0
- package/dist/hooks/useTheme.mjs.map +1 -0
- package/dist/hooks/useTranslation.d.mts +28 -0
- package/dist/hooks/useTranslation.d.ts +9 -5
- package/dist/hooks/useTranslation.js +53 -10
- package/dist/hooks/useTranslation.js.map +1 -0
- package/dist/hooks/useTranslation.mjs +27 -0
- package/dist/hooks/useTranslation.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/util/array.d.mts +25 -0
- package/dist/util/array.d.ts +9 -7
- package/dist/util/array.js +119 -92
- package/dist/util/array.js.map +1 -0
- package/dist/util/array.mjs +99 -0
- package/dist/util/array.mjs.map +1 -0
- package/dist/util/builder.d.mts +8 -0
- package/dist/util/builder.d.ts +3 -1
- package/dist/util/builder.js +33 -8
- package/dist/util/builder.js.map +1 -0
- package/dist/util/builder.mjs +9 -0
- package/dist/util/builder.mjs.map +1 -0
- package/dist/util/date.d.mts +30 -0
- package/dist/util/date.d.ts +17 -15
- package/dist/util/date.js +184 -123
- package/dist/util/date.js.map +1 -0
- package/dist/util/date.mjs +156 -0
- package/dist/util/date.mjs.map +1 -0
- package/dist/util/easeFunctions.d.mts +11 -0
- package/dist/util/easeFunctions.d.ts +4 -2
- package/dist/util/easeFunctions.js +63 -30
- package/dist/util/easeFunctions.js.map +1 -0
- package/dist/util/easeFunctions.mjs +36 -0
- package/dist/util/easeFunctions.mjs.map +1 -0
- package/dist/util/emailValidation.d.mts +3 -0
- package/dist/util/emailValidation.d.ts +3 -1
- package/dist/util/emailValidation.js +32 -2
- package/dist/util/emailValidation.js.map +1 -0
- package/dist/util/emailValidation.mjs +8 -0
- package/dist/util/emailValidation.mjs.map +1 -0
- package/dist/util/loopingArray.d.mts +25 -0
- package/dist/util/loopingArray.d.ts +4 -2
- package/dist/util/loopingArray.js +89 -59
- package/dist/util/loopingArray.js.map +1 -0
- package/dist/util/loopingArray.mjs +72 -0
- package/dist/util/loopingArray.mjs.map +1 -0
- package/dist/util/math.d.mts +3 -0
- package/dist/util/math.d.ts +3 -1
- package/dist/util/math.js +32 -2
- package/dist/util/math.js.map +1 -0
- package/dist/util/math.mjs +8 -0
- package/dist/util/math.mjs.map +1 -0
- package/dist/util/news.d.mts +103 -0
- package/dist/util/news.d.ts +21 -16
- package/dist/util/news.js +73 -24
- package/dist/util/news.js.map +1 -0
- package/dist/util/news.mjs +48 -0
- package/dist/util/news.mjs.map +1 -0
- package/dist/util/noop.d.mts +3 -0
- package/dist/util/noop.d.ts +3 -1
- package/dist/util/noop.js +31 -1
- package/dist/util/noop.js.map +1 -0
- package/dist/util/noop.mjs +6 -0
- package/dist/util/noop.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +50 -0
- package/dist/util/simpleSearch.d.ts +6 -4
- package/dist/util/simpleSearch.js +50 -58
- package/dist/util/simpleSearch.js.map +1 -0
- package/dist/util/simpleSearch.mjs +26 -0
- package/dist/util/simpleSearch.mjs.map +1 -0
- package/dist/util/storage.d.mts +16 -0
- package/dist/util/storage.d.ts +4 -3
- package/dist/util/storage.js +63 -31
- package/dist/util/storage.js.map +1 -0
- package/dist/util/storage.mjs +38 -0
- package/dist/util/storage.mjs.map +1 -0
- package/dist/util/types.d.mts +3 -0
- package/dist/util/types.d.ts +3 -1
- package/dist/util/types.js +19 -1
- package/dist/util/types.js.map +1 -0
- package/dist/util/types.mjs +1 -0
- package/dist/util/types.mjs.map +1 -0
- package/package.json +15 -6
|
@@ -1,92 +1,853 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/examples/TableExample.tsx
|
|
31
|
+
var TableExample_exports = {};
|
|
32
|
+
__export(TableExample_exports, {
|
|
33
|
+
default: () => TableExample_default,
|
|
34
|
+
exampleData: () => exampleData
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(TableExample_exports);
|
|
37
|
+
var import_react7 = require("react");
|
|
38
|
+
|
|
39
|
+
// src/components/Table.tsx
|
|
40
|
+
var import_react_custom_scrollbars_2 = require("react-custom-scrollbars-2");
|
|
41
|
+
var import_react4 = require("react");
|
|
42
|
+
|
|
43
|
+
// src/util/noop.ts
|
|
44
|
+
var noop = () => void 0;
|
|
45
|
+
|
|
46
|
+
// src/components/user-input/Checkbox.tsx
|
|
47
|
+
var import_react = require("react");
|
|
48
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
49
|
+
var import_lucide_react = require("lucide-react");
|
|
50
|
+
var import_clsx = __toESM(require("clsx"));
|
|
51
|
+
|
|
52
|
+
// src/components/user-input/Label.tsx
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
var styleMapping = {
|
|
55
|
+
labelSmall: "textstyle-label-sm",
|
|
56
|
+
labelMedium: "textstyle-label-md",
|
|
57
|
+
labelBig: "textstyle-label-lg"
|
|
58
|
+
};
|
|
59
|
+
var Label = ({
|
|
60
|
+
children,
|
|
61
|
+
name,
|
|
62
|
+
labelType = "labelSmall",
|
|
63
|
+
...props
|
|
64
|
+
}) => {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, children: children ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styleMapping[labelType], children: name }) });
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/components/user-input/Checkbox.tsx
|
|
69
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
70
|
+
var checkboxSizeMapping = {
|
|
71
|
+
small: "size-4",
|
|
72
|
+
medium: "size-6",
|
|
73
|
+
large: "size-8"
|
|
74
|
+
};
|
|
75
|
+
var checkboxIconSizeMapping = {
|
|
76
|
+
small: "size-3",
|
|
77
|
+
medium: "size-5",
|
|
78
|
+
large: "size-7"
|
|
79
|
+
};
|
|
80
|
+
var ControlledCheckbox = ({
|
|
81
|
+
id,
|
|
82
|
+
label,
|
|
83
|
+
checked,
|
|
84
|
+
disabled,
|
|
85
|
+
onChange,
|
|
86
|
+
onChangeTristate,
|
|
87
|
+
size = "medium",
|
|
88
|
+
className = "",
|
|
89
|
+
containerClassName
|
|
90
|
+
}) => {
|
|
91
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
92
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
93
|
+
const propagateChange = (checked2) => {
|
|
94
|
+
if (onChangeTristate) {
|
|
95
|
+
onChangeTristate(checked2);
|
|
96
|
+
}
|
|
97
|
+
if (onChange) {
|
|
98
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const changeValue = () => {
|
|
102
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
103
|
+
propagateChange(newValue);
|
|
104
|
+
};
|
|
105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx.default)("row justify-center items-center", containerClassName), children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
107
|
+
CheckboxPrimitive.Root,
|
|
108
|
+
{
|
|
109
|
+
onCheckedChange: propagateChange,
|
|
110
|
+
checked,
|
|
111
|
+
disabled,
|
|
112
|
+
id,
|
|
113
|
+
className: (0, import_clsx.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
|
|
114
|
+
"text-disabled-text border-disabled-text": disabled,
|
|
115
|
+
"border-on-background": !disabled,
|
|
116
|
+
"bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
|
|
117
|
+
"hover:border-gray-400 focus:hover:border-primary": !checked
|
|
118
|
+
}, className),
|
|
119
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
120
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Check, { className: innerIconSize }),
|
|
121
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Minus, { className: innerIconSize })
|
|
122
|
+
] })
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Label, { ...label, className: (0, import_clsx.default)("cursor-pointer", label.className), htmlFor: id, onClick: changeValue })
|
|
126
|
+
] });
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/components/Pagination.tsx
|
|
130
|
+
var import_lucide_react2 = require("lucide-react");
|
|
131
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
132
|
+
|
|
133
|
+
// src/hooks/useLanguage.tsx
|
|
134
|
+
var import_react3 = require("react");
|
|
135
|
+
|
|
136
|
+
// src/hooks/useLocalStorage.tsx
|
|
137
|
+
var import_react2 = require("react");
|
|
138
|
+
|
|
139
|
+
// src/hooks/useLanguage.tsx
|
|
140
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
141
|
+
var DEFAULT_LANGUAGE = "en";
|
|
142
|
+
var LanguageContext = (0, import_react3.createContext)({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
143
|
+
var useLanguage = () => (0, import_react3.useContext)(LanguageContext);
|
|
144
|
+
|
|
145
|
+
// src/hooks/useTranslation.ts
|
|
146
|
+
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
147
|
+
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
148
|
+
const { language: inferredLanguage } = useLanguage();
|
|
149
|
+
const usedLanguage = languageProp ?? inferredLanguage;
|
|
150
|
+
let defaultValues = defaults[usedLanguage];
|
|
151
|
+
if (overwrite && overwrite[usedLanguage]) {
|
|
152
|
+
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
153
|
+
}
|
|
154
|
+
return defaultValues;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/components/Pagination.tsx
|
|
158
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
159
|
+
var defaultPaginationTranslations = {
|
|
160
|
+
en: {
|
|
161
|
+
of: "of"
|
|
162
|
+
},
|
|
163
|
+
de: {
|
|
164
|
+
of: "von"
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
var Pagination = ({
|
|
168
|
+
overwriteTranslation,
|
|
169
|
+
page,
|
|
170
|
+
numberOfPages,
|
|
171
|
+
onPageChanged
|
|
172
|
+
}) => {
|
|
173
|
+
const translation = useTranslation(defaultPaginationTranslations, overwriteTranslation);
|
|
174
|
+
const changePage = (page2) => {
|
|
175
|
+
onPageChanged(page2);
|
|
176
|
+
};
|
|
177
|
+
const noPages = numberOfPages === 0;
|
|
178
|
+
const onFirstPage = page === 0 && !noPages;
|
|
179
|
+
const onLastPage = page === numberOfPages - 1;
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx2.default)("row", { "opacity-30": noPages }), children: [
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: () => changePage(0), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.ChevronFirst, { className: (0, import_clsx2.default)({ "opacity-30": onFirstPage }) }) }),
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: () => changePage(page - 1), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.ChevronLeft, { className: (0, import_clsx2.default)({ "opacity-30": onFirstPage }) }) }),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "min-w-[80px] justify-center mx-2", children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none mx-2", children: translation.of }),
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none text-left flex-1", children: numberOfPages })
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: () => changePage(page + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.ChevronRight, { className: (0, import_clsx2.default)({ "opacity-30": onLastPage }) }) }),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { onClick: () => changePage(numberOfPages - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.ChevronLast, { className: (0, import_clsx2.default)({ "opacity-30": onLastPage }) }) })
|
|
190
|
+
] });
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// src/components/Table.tsx
|
|
194
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
195
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
196
|
+
var defaultTableStatePagination = {
|
|
197
|
+
currentPage: 0,
|
|
198
|
+
entriesPerPage: 5
|
|
199
|
+
};
|
|
200
|
+
var defaultTableStateSelection = {
|
|
201
|
+
currentSelection: [],
|
|
202
|
+
hasSelectedAll: false,
|
|
203
|
+
hasSelectedSome: false,
|
|
204
|
+
hasSelectedNone: true
|
|
205
|
+
};
|
|
206
|
+
var isDataObjectSelected = (tableState, dataObject, identifierMapping) => {
|
|
207
|
+
if (!tableState.selection) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
return !!tableState.selection.currentSelection.find((value) => value.localeCompare(identifierMapping(dataObject)) === 0);
|
|
211
|
+
};
|
|
212
|
+
var pageForItem = (data, item, entriesPerPage, identifierMapping) => {
|
|
213
|
+
const index = data.findIndex((value) => identifierMapping(value) === identifierMapping(item));
|
|
214
|
+
if (index !== -1) {
|
|
215
|
+
return Math.floor(index / entriesPerPage);
|
|
216
|
+
}
|
|
217
|
+
console.warn("item doesn't exist on data", item, data);
|
|
218
|
+
return 0;
|
|
219
|
+
};
|
|
220
|
+
var updatePagination = (pagination, dataLength) => ({
|
|
221
|
+
...pagination,
|
|
222
|
+
currentPage: Math.min(Math.max(Math.ceil(dataLength / pagination.entriesPerPage) - 1, 0), pagination.currentPage)
|
|
223
|
+
});
|
|
224
|
+
var addElementToTable = (tableState, data, dataObject, identifierMapping) => {
|
|
225
|
+
return {
|
|
226
|
+
...tableState,
|
|
227
|
+
pagination: tableState.pagination ? {
|
|
228
|
+
...tableState.pagination,
|
|
229
|
+
currentPage: pageForItem(data, dataObject, tableState.pagination.entriesPerPage, identifierMapping)
|
|
230
|
+
} : void 0,
|
|
231
|
+
selection: tableState.selection ? {
|
|
232
|
+
...tableState.selection,
|
|
233
|
+
hasSelectedAll: false,
|
|
234
|
+
hasSelectedSome: tableState.selection.hasSelectedAll || tableState.selection.hasSelectedSome
|
|
235
|
+
} : void 0
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
var removeFromTableSelection = (tableState, deletedObjects, dataLength, identifierMapping) => {
|
|
239
|
+
if (!tableState.selection) {
|
|
240
|
+
return tableState;
|
|
241
|
+
}
|
|
242
|
+
const deletedObjectIds = deletedObjects.map(identifierMapping);
|
|
243
|
+
const elementsBefore = tableState.selection.currentSelection.length;
|
|
244
|
+
const currentSelection = tableState.selection.currentSelection.filter((value) => !deletedObjectIds.includes(value));
|
|
245
|
+
dataLength -= elementsBefore - currentSelection.length;
|
|
246
|
+
return {
|
|
247
|
+
...tableState,
|
|
248
|
+
selection: {
|
|
249
|
+
currentSelection,
|
|
250
|
+
hasSelectedAll: currentSelection.length === dataLength && dataLength !== 0,
|
|
251
|
+
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
252
|
+
hasSelectedNone: currentSelection.length === 0
|
|
253
|
+
},
|
|
254
|
+
pagination: tableState.pagination ? updatePagination(tableState.pagination, dataLength) : void 0
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
var changeTableSelectionSingle = (tableState, dataObject, dataLength, identifierMapping) => {
|
|
258
|
+
if (!tableState.selection) {
|
|
259
|
+
return tableState;
|
|
260
|
+
}
|
|
261
|
+
const hasSelectedObject = isDataObjectSelected(tableState, dataObject, identifierMapping);
|
|
262
|
+
let currentSelection = [...tableState.selection.currentSelection, identifierMapping(dataObject)];
|
|
263
|
+
if (hasSelectedObject) {
|
|
264
|
+
currentSelection = tableState.selection.currentSelection.filter((value) => value.localeCompare(identifierMapping(dataObject)) !== 0);
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
...tableState,
|
|
268
|
+
selection: {
|
|
269
|
+
currentSelection,
|
|
270
|
+
hasSelectedAll: currentSelection.length === dataLength,
|
|
271
|
+
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
272
|
+
hasSelectedNone: currentSelection.length === 0
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
var changeTableSelectionAll = (tableState, data, identifierMapping) => {
|
|
277
|
+
if (!tableState.selection) {
|
|
278
|
+
return tableState;
|
|
279
|
+
}
|
|
280
|
+
if (data.length === 0) {
|
|
281
|
+
return {
|
|
282
|
+
...tableState,
|
|
283
|
+
selection: {
|
|
284
|
+
currentSelection: [],
|
|
285
|
+
hasSelectedAll: false,
|
|
286
|
+
hasSelectedSome: false,
|
|
287
|
+
hasSelectedNone: true
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
const hasSelectedAll = !(tableState.selection.hasSelectedSome || tableState.selection.hasSelectedAll);
|
|
292
|
+
return {
|
|
293
|
+
...tableState,
|
|
294
|
+
selection: {
|
|
295
|
+
currentSelection: hasSelectedAll ? data.map(identifierMapping) : [],
|
|
296
|
+
hasSelectedAll,
|
|
297
|
+
hasSelectedSome: false,
|
|
298
|
+
hasSelectedNone: !hasSelectedAll
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
var Table = ({
|
|
303
|
+
data,
|
|
304
|
+
stateManagement = [{}, noop],
|
|
305
|
+
identifierMapping,
|
|
306
|
+
header,
|
|
307
|
+
rowMappingToCells,
|
|
308
|
+
sorting,
|
|
309
|
+
focusElement,
|
|
310
|
+
className
|
|
311
|
+
}) => {
|
|
312
|
+
const sortedData = [...data];
|
|
313
|
+
if (sorting) {
|
|
314
|
+
const [sortingFunction, sortingType] = sorting;
|
|
315
|
+
sortedData.sort((a, b) => sortingFunction(a, b) * (sortingType === "ascending" ? 1 : -1));
|
|
316
|
+
}
|
|
317
|
+
let currentPage = 0;
|
|
318
|
+
let pageCount = 1;
|
|
319
|
+
let entriesPerPage = 5;
|
|
320
|
+
const [tableState, updateTableState] = stateManagement;
|
|
321
|
+
let shownElements = sortedData;
|
|
322
|
+
if (tableState?.pagination) {
|
|
323
|
+
if (tableState.pagination.entriesPerPage < 1) {
|
|
324
|
+
console.error("tableState.pagination.entriesPerPage must be >= 1", tableState.pagination.entriesPerPage);
|
|
325
|
+
}
|
|
326
|
+
entriesPerPage = Math.max(1, tableState.pagination.entriesPerPage);
|
|
327
|
+
pageCount = Math.ceil(sortedData.length / entriesPerPage);
|
|
328
|
+
if (tableState.pagination.currentPage < 0 || tableState.pagination.currentPage >= pageCount && pageCount !== 0) {
|
|
329
|
+
console.error(
|
|
330
|
+
"tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0) must be fullfilled",
|
|
331
|
+
[`pageCount: ${pageCount}`, `tableState.pagination.currentPage: ${tableState.pagination.currentPage}`]
|
|
332
|
+
);
|
|
333
|
+
} else {
|
|
334
|
+
currentPage = tableState.pagination.currentPage;
|
|
335
|
+
}
|
|
336
|
+
if (focusElement) {
|
|
337
|
+
currentPage = pageForItem(sortedData, focusElement, entriesPerPage, identifierMapping);
|
|
338
|
+
}
|
|
339
|
+
shownElements = sortedData.slice(currentPage * entriesPerPage, Math.min(sortedData.length, (currentPage + 1) * entriesPerPage));
|
|
340
|
+
} else {
|
|
341
|
+
currentPage = 0;
|
|
342
|
+
}
|
|
343
|
+
const headerRow = "border-b-2 border-gray-300";
|
|
344
|
+
const headerPaddingHead = "pb-2";
|
|
345
|
+
const headerPaddingBody = "pt-2";
|
|
346
|
+
const cellPadding = "py-1 px-2";
|
|
347
|
+
const [scrollbarsAutoHeightMin, setScrollbarsAutoHeightMin] = (0, import_react4.useState)(0);
|
|
348
|
+
const tableRef = (0, import_react4.useRef)(null);
|
|
349
|
+
const calculateHeight = () => {
|
|
350
|
+
if (tableRef.current) {
|
|
351
|
+
const tableHeight = tableRef.current.offsetHeight;
|
|
352
|
+
const offset = 25;
|
|
353
|
+
setScrollbarsAutoHeightMin(tableHeight + offset);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
(0, import_react4.useEffect)(() => {
|
|
357
|
+
calculateHeight();
|
|
358
|
+
const handleResize = () => {
|
|
359
|
+
calculateHeight();
|
|
360
|
+
};
|
|
361
|
+
window.addEventListener("resize", handleResize);
|
|
362
|
+
return () => {
|
|
363
|
+
window.removeEventListener("resize", handleResize);
|
|
364
|
+
};
|
|
365
|
+
}, [data, currentPage]);
|
|
366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx3.default)("col gap-y-4 overflow-hidden", className), children: [
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_custom_scrollbars_2.Scrollbars, { autoHeight: true, autoHeightMin: scrollbarsAutoHeightMin, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("table", { ref: tableRef, className: "w-full mb-[12px]", children: [
|
|
368
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: headerRow, children: [
|
|
369
|
+
header && tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
370
|
+
ControlledCheckbox,
|
|
371
|
+
{
|
|
372
|
+
checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
|
|
373
|
+
onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
|
|
374
|
+
}
|
|
375
|
+
) }),
|
|
376
|
+
header && header.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row justify-start px-2", children: value }) }, `tableHeader${index}`))
|
|
377
|
+
] }) }),
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { children: [
|
|
379
|
+
tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: (0, import_clsx3.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
380
|
+
ControlledCheckbox,
|
|
381
|
+
{
|
|
382
|
+
checked: isDataObjectSelected(tableState, value, identifierMapping),
|
|
383
|
+
onChange: () => {
|
|
384
|
+
updateTableState(changeTableSelectionSingle(tableState, value, data.length, identifierMapping));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
) }),
|
|
388
|
+
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: (0, import_clsx3.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: value1 }, index))
|
|
389
|
+
] }, identifierMapping(value))) })
|
|
390
|
+
] }) }) }),
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row justify-center", children: tableState.pagination && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Pagination, { page: currentPage, numberOfPages: pageCount, onPageChanged: (page) => updateTableState({
|
|
392
|
+
...tableState,
|
|
393
|
+
pagination: { entriesPerPage, currentPage: page }
|
|
394
|
+
}) }) })
|
|
395
|
+
] });
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
// src/components/user-input/Input.tsx
|
|
399
|
+
var import_react6 = require("react");
|
|
400
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
401
|
+
|
|
402
|
+
// src/hooks/useSaveDelay.ts
|
|
403
|
+
var import_react5 = require("react");
|
|
404
|
+
function useSaveDelay(setNotificationStatus, delay) {
|
|
405
|
+
const [updateTimer, setUpdateTimer] = (0, import_react5.useState)(void 0);
|
|
406
|
+
const [notificationTimer, setNotificationTimer] = (0, import_react5.useState)(void 0);
|
|
407
|
+
const restartTimer = (onSave) => {
|
|
408
|
+
clearTimeout(updateTimer);
|
|
409
|
+
setUpdateTimer(setTimeout(() => {
|
|
410
|
+
onSave();
|
|
411
|
+
setNotificationStatus(true);
|
|
412
|
+
clearTimeout(notificationTimer);
|
|
413
|
+
setNotificationTimer(setTimeout(() => {
|
|
414
|
+
setNotificationStatus(false);
|
|
415
|
+
clearTimeout(notificationTimer);
|
|
416
|
+
}, delay));
|
|
417
|
+
clearTimeout(updateTimer);
|
|
418
|
+
}, delay));
|
|
419
|
+
};
|
|
420
|
+
const clearUpdateTimer = (hasSaved = true) => {
|
|
421
|
+
clearTimeout(updateTimer);
|
|
422
|
+
if (hasSaved) {
|
|
423
|
+
setNotificationStatus(true);
|
|
424
|
+
clearTimeout(notificationTimer);
|
|
425
|
+
setNotificationTimer(setTimeout(() => {
|
|
426
|
+
setNotificationStatus(false);
|
|
427
|
+
clearTimeout(notificationTimer);
|
|
428
|
+
}, delay));
|
|
429
|
+
} else {
|
|
430
|
+
setNotificationStatus(false);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
(0, import_react5.useEffect)(() => {
|
|
434
|
+
return () => {
|
|
435
|
+
clearTimeout(updateTimer);
|
|
436
|
+
clearTimeout(notificationTimer);
|
|
437
|
+
};
|
|
438
|
+
}, []);
|
|
439
|
+
return { restartTimer, clearUpdateTimer };
|
|
440
|
+
}
|
|
441
|
+
var useSaveDelay_default = useSaveDelay;
|
|
442
|
+
|
|
443
|
+
// src/components/user-input/Input.tsx
|
|
444
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
445
|
+
var ControlledInput = ({
|
|
446
|
+
id,
|
|
447
|
+
type = "text",
|
|
448
|
+
value,
|
|
449
|
+
label,
|
|
450
|
+
onChange = noop,
|
|
451
|
+
onChangeEvent = noop,
|
|
452
|
+
className = "",
|
|
453
|
+
onEditCompleted,
|
|
454
|
+
expanded = true,
|
|
455
|
+
onBlur,
|
|
456
|
+
containerClassName,
|
|
457
|
+
...restProps
|
|
458
|
+
}) => {
|
|
459
|
+
const {
|
|
460
|
+
restartTimer,
|
|
461
|
+
clearUpdateTimer
|
|
462
|
+
} = useSaveDelay_default(() => void 0, 3e3);
|
|
463
|
+
const ref = (0, import_react6.useRef)(null);
|
|
464
|
+
(0, import_react6.useEffect)(() => {
|
|
465
|
+
if (restProps.autoFocus) {
|
|
466
|
+
ref.current?.focus();
|
|
467
|
+
}
|
|
468
|
+
}, [restProps.autoFocus]);
|
|
469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx4.default)({ "w-full": expanded }, containerClassName), children: [
|
|
470
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx4.default)("mb-1", label.className) }),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
472
|
+
"input",
|
|
473
|
+
{
|
|
474
|
+
ref,
|
|
475
|
+
value,
|
|
476
|
+
id,
|
|
477
|
+
type,
|
|
478
|
+
className: (0, import_clsx4.default)("block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary", className),
|
|
479
|
+
onBlur: (event) => {
|
|
480
|
+
if (onBlur) {
|
|
481
|
+
onBlur(event);
|
|
482
|
+
}
|
|
483
|
+
if (onEditCompleted) {
|
|
484
|
+
onEditCompleted(event.target.value, event);
|
|
485
|
+
clearUpdateTimer();
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
onChange: (e) => {
|
|
489
|
+
const value2 = e.target.value;
|
|
490
|
+
if (onEditCompleted) {
|
|
491
|
+
restartTimer(() => {
|
|
492
|
+
onEditCompleted(value2, e);
|
|
493
|
+
clearUpdateTimer();
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
onChange(value2, e);
|
|
497
|
+
onChangeEvent(e);
|
|
498
|
+
},
|
|
499
|
+
...restProps
|
|
500
|
+
}
|
|
501
|
+
)
|
|
502
|
+
] });
|
|
503
|
+
};
|
|
504
|
+
var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
505
|
+
id,
|
|
506
|
+
labelText,
|
|
507
|
+
errorText,
|
|
508
|
+
className,
|
|
509
|
+
labelClassName,
|
|
510
|
+
errorClassName,
|
|
511
|
+
containerClassName,
|
|
512
|
+
required,
|
|
513
|
+
...restProps
|
|
514
|
+
}, ref) {
|
|
515
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
516
|
+
"input",
|
|
517
|
+
{
|
|
518
|
+
ref,
|
|
519
|
+
id,
|
|
520
|
+
...restProps,
|
|
521
|
+
className: (0, import_clsx4.default)(
|
|
522
|
+
"block bg-surface text-on-surface px-3 py-2 rounded-md w-full border-2 border-gray-200 hover:border-primary focus:outline-none focus:border-primary focus:ring-primary",
|
|
523
|
+
{
|
|
524
|
+
"focus:border-primary focus:ring-primary": !errorText,
|
|
525
|
+
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
33
526
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
527
|
+
className
|
|
528
|
+
)
|
|
529
|
+
}
|
|
530
|
+
);
|
|
531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx4.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
532
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: id, className: (0, import_clsx4.default)("textstyle-label-md", labelClassName), children: [
|
|
533
|
+
labelText,
|
|
534
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
535
|
+
] }),
|
|
536
|
+
input,
|
|
537
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: (0, import_clsx4.default)("text-negative", errorClassName), children: errorText })
|
|
538
|
+
] });
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
// src/components/Button.tsx
|
|
542
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
543
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
544
|
+
var ButtonSizePaddings = {
|
|
545
|
+
small: "btn-sm",
|
|
546
|
+
medium: "btn-md",
|
|
547
|
+
large: "btn-lg"
|
|
548
|
+
};
|
|
549
|
+
var SolidButton = ({
|
|
550
|
+
children,
|
|
551
|
+
disabled = false,
|
|
552
|
+
color = "primary",
|
|
553
|
+
size = "medium",
|
|
554
|
+
startIcon,
|
|
555
|
+
endIcon,
|
|
556
|
+
onClick,
|
|
557
|
+
className,
|
|
558
|
+
...restProps
|
|
559
|
+
}) => {
|
|
560
|
+
const colorClasses = {
|
|
561
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
562
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
563
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
564
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
565
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
566
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text"
|
|
567
|
+
}[color];
|
|
568
|
+
const iconColorClasses = {
|
|
569
|
+
primary: "text-button-solid-primary-icon",
|
|
570
|
+
secondary: "text-button-solid-secondary-icon",
|
|
571
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
572
|
+
positive: "text-button-solid-positive-icon",
|
|
573
|
+
warning: "text-button-solid-warning-icon",
|
|
574
|
+
negative: "text-button-solid-negative-icon"
|
|
575
|
+
}[color];
|
|
576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
577
|
+
"button",
|
|
578
|
+
{
|
|
579
|
+
onClick: disabled ? void 0 : onClick,
|
|
580
|
+
disabled: disabled || onClick === void 0,
|
|
581
|
+
className: (0, import_clsx5.default)(
|
|
582
|
+
className,
|
|
583
|
+
{
|
|
584
|
+
"text-disabled-text bg-disabled-background": disabled,
|
|
585
|
+
[(0, import_clsx5.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
586
|
+
},
|
|
587
|
+
ButtonSizePaddings[size]
|
|
588
|
+
),
|
|
589
|
+
...restProps,
|
|
590
|
+
children: [
|
|
591
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
592
|
+
"span",
|
|
593
|
+
{
|
|
594
|
+
className: (0, import_clsx5.default)({
|
|
595
|
+
[iconColorClasses]: !disabled,
|
|
596
|
+
[`text-disabled-icon`]: disabled
|
|
597
|
+
}),
|
|
598
|
+
children: startIcon
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
children,
|
|
602
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
603
|
+
"span",
|
|
604
|
+
{
|
|
605
|
+
className: (0, import_clsx5.default)({
|
|
606
|
+
[iconColorClasses]: !disabled,
|
|
607
|
+
[`text-disabled-icon`]: disabled
|
|
608
|
+
}),
|
|
609
|
+
children: endIcon
|
|
610
|
+
}
|
|
611
|
+
)
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
);
|
|
615
|
+
};
|
|
616
|
+
var TextButton = ({
|
|
617
|
+
children,
|
|
618
|
+
disabled = false,
|
|
619
|
+
color = "neutral",
|
|
620
|
+
size = "medium",
|
|
621
|
+
startIcon,
|
|
622
|
+
endIcon,
|
|
623
|
+
onClick,
|
|
624
|
+
className,
|
|
625
|
+
...restProps
|
|
626
|
+
}) => {
|
|
627
|
+
const colorClasses = {
|
|
628
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
629
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
630
|
+
}[color];
|
|
631
|
+
const iconColorClasses = {
|
|
632
|
+
negative: "text-button-text-negative-icon",
|
|
633
|
+
neutral: "text-button-text-neutral-icon"
|
|
634
|
+
}[color];
|
|
635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
636
|
+
"button",
|
|
637
|
+
{
|
|
638
|
+
onClick: disabled ? void 0 : onClick,
|
|
639
|
+
disabled: disabled || onClick === void 0,
|
|
640
|
+
className: (0, import_clsx5.default)(
|
|
641
|
+
className,
|
|
642
|
+
{
|
|
643
|
+
"text-disabled-text": disabled,
|
|
644
|
+
[(0, import_clsx5.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
|
|
37
645
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
646
|
+
ButtonSizePaddings[size]
|
|
647
|
+
),
|
|
648
|
+
...restProps,
|
|
649
|
+
children: [
|
|
650
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
651
|
+
"span",
|
|
652
|
+
{
|
|
653
|
+
className: (0, import_clsx5.default)({
|
|
654
|
+
[iconColorClasses]: !disabled,
|
|
655
|
+
[`text-disabled-icon`]: disabled
|
|
656
|
+
}),
|
|
657
|
+
children: startIcon
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
children,
|
|
661
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
662
|
+
"span",
|
|
663
|
+
{
|
|
664
|
+
className: (0, import_clsx5.default)({
|
|
665
|
+
[iconColorClasses]: !disabled,
|
|
666
|
+
[`text-disabled-icon`]: disabled
|
|
667
|
+
}),
|
|
668
|
+
children: endIcon
|
|
669
|
+
}
|
|
670
|
+
)
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
// src/components/SortButton.tsx
|
|
677
|
+
var import_lucide_react3 = require("lucide-react");
|
|
678
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
679
|
+
var SortButton = ({
|
|
680
|
+
children,
|
|
681
|
+
ascending,
|
|
682
|
+
color,
|
|
683
|
+
onClick,
|
|
684
|
+
...buttonProps
|
|
685
|
+
}) => {
|
|
686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
687
|
+
TextButton,
|
|
688
|
+
{
|
|
689
|
+
color,
|
|
690
|
+
onClick: () => onClick(ascending === "descending" ? "ascending" : "descending"),
|
|
691
|
+
...buttonProps,
|
|
692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2", children: [
|
|
693
|
+
children,
|
|
694
|
+
ascending === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronUp, {}) : !ascending ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronsUpDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, {})
|
|
695
|
+
] })
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
// src/components/examples/TableExample.tsx
|
|
701
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
702
|
+
var exampleData = [
|
|
703
|
+
{ id: "data1", name: "Name 1", age: 23 },
|
|
704
|
+
{ id: "data2", name: "Name 2", age: 21 },
|
|
705
|
+
{ id: "data3", name: "Name 3", age: 32 },
|
|
706
|
+
{ id: "data4", name: "Name 4", age: 42 },
|
|
707
|
+
{ id: "data5", name: "Name 5", age: 17 },
|
|
708
|
+
{ id: "data6", name: "Name 6", age: 26 },
|
|
709
|
+
{ id: "data7", name: "Name 7", age: 19 },
|
|
710
|
+
{ id: "data8", name: "Name 8", age: 31 }
|
|
711
|
+
];
|
|
712
|
+
var TableExample = ({ data: initialData }) => {
|
|
713
|
+
const [data, setData] = (0, import_react7.useState)(initialData);
|
|
714
|
+
const [tableState, setTableState] = (0, import_react7.useState)({
|
|
715
|
+
pagination: defaultTableStatePagination,
|
|
716
|
+
selection: defaultTableStateSelection
|
|
717
|
+
});
|
|
718
|
+
(0, import_react7.useEffect)(() => {
|
|
719
|
+
setData(initialData);
|
|
720
|
+
}, [initialData]);
|
|
721
|
+
const [sorting, setSorting] = (0, import_react7.useState)();
|
|
722
|
+
const [sortingKey, ascending] = sorting ?? ["", "ascending"];
|
|
723
|
+
const idMapping = (data2) => data2.id;
|
|
724
|
+
const sortingFunctions = {
|
|
725
|
+
id: {
|
|
726
|
+
ascending: (t1, t2) => t1.id.localeCompare(t2.id),
|
|
727
|
+
descending: (t1, t2) => t1.id.localeCompare(t2.id) * -1
|
|
728
|
+
},
|
|
729
|
+
name: {
|
|
730
|
+
ascending: (t1, t2) => t1.name.localeCompare(t2.name),
|
|
731
|
+
descending: (t1, t2) => t1.name.localeCompare(t2.name) * -1
|
|
732
|
+
},
|
|
733
|
+
age: {
|
|
734
|
+
ascending: (t1, t2) => t1.age - t2.age,
|
|
735
|
+
descending: (t1, t2) => (t1.age - t2.age) * -1
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "col gap-y-12 items-center", children: [
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
740
|
+
Table,
|
|
741
|
+
{
|
|
742
|
+
stateManagement: [tableState, (newTableState) => {
|
|
743
|
+
setTableState(newTableState);
|
|
744
|
+
setData(data);
|
|
745
|
+
}],
|
|
746
|
+
data,
|
|
747
|
+
identifierMapping: idMapping,
|
|
748
|
+
rowMappingToCells: (dataObject) => [
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-title-md w-[100px] text-ellipsis overflow-hidden block", children: dataObject.id }, "id"),
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ControlledInput, { value: dataObject.name, onChange: (text) => {
|
|
751
|
+
setData(data.map((value) => value.id === dataObject.id ? { ...dataObject, name: text } : value));
|
|
752
|
+
setSorting(void 0);
|
|
753
|
+
} }, "name"),
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ControlledInput, { type: "number", value: dataObject.age.toString(), onChange: (text) => {
|
|
755
|
+
setData(data.map((value) => value.id === dataObject.id ? { ...dataObject, age: parseInt(text) } : value));
|
|
756
|
+
setSorting(void 0);
|
|
757
|
+
} }, "age"),
|
|
758
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
759
|
+
TextButton,
|
|
760
|
+
{
|
|
761
|
+
color: "negative",
|
|
762
|
+
onClick: () => {
|
|
763
|
+
const newData = data.filter((value) => value.id !== dataObject.id);
|
|
764
|
+
setData(newData);
|
|
765
|
+
setTableState(removeFromTableSelection(tableState, [dataObject], data.length, idMapping));
|
|
766
|
+
},
|
|
767
|
+
children: "Delete"
|
|
768
|
+
},
|
|
769
|
+
"delete"
|
|
770
|
+
)
|
|
771
|
+
],
|
|
772
|
+
header: [
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
774
|
+
SortButton,
|
|
775
|
+
{
|
|
776
|
+
ascending: sortingKey === "id" ? ascending : void 0,
|
|
777
|
+
onClick: (newTableSorting) => {
|
|
778
|
+
setSorting(["id", newTableSorting]);
|
|
779
|
+
setData(data.sort(sortingFunctions.id[newTableSorting]));
|
|
780
|
+
},
|
|
781
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-table-header", children: "Id" })
|
|
782
|
+
},
|
|
783
|
+
"headerId"
|
|
784
|
+
),
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
786
|
+
SortButton,
|
|
787
|
+
{
|
|
788
|
+
ascending: sortingKey === "name" ? ascending : void 0,
|
|
789
|
+
onClick: (newTableSorting) => {
|
|
790
|
+
setSorting(["name", newTableSorting]);
|
|
791
|
+
setData(data.sort(sortingFunctions.name[newTableSorting]));
|
|
792
|
+
},
|
|
793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-table-header", children: "Name" })
|
|
794
|
+
},
|
|
795
|
+
"name"
|
|
796
|
+
),
|
|
797
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
798
|
+
SortButton,
|
|
799
|
+
{
|
|
800
|
+
ascending: sortingKey === "age" ? ascending : void 0,
|
|
801
|
+
onClick: (newTableSorting) => {
|
|
802
|
+
setSorting(["age", newTableSorting]);
|
|
803
|
+
setData(data.sort(sortingFunctions.age[newTableSorting]));
|
|
804
|
+
},
|
|
805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "textstyle-table-header", children: "age" }, "age")
|
|
806
|
+
},
|
|
807
|
+
"name"
|
|
808
|
+
),
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, {})
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "row gap-x-2", children: [
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
815
|
+
SolidButton,
|
|
816
|
+
{
|
|
817
|
+
className: "w-auto",
|
|
818
|
+
onClick: () => {
|
|
819
|
+
const newData = {
|
|
820
|
+
id: Math.random().toString(),
|
|
821
|
+
name: "Name " + data.length,
|
|
822
|
+
age: Math.ceil(Math.random() * 100)
|
|
823
|
+
};
|
|
824
|
+
const withNewData = [...data, newData];
|
|
825
|
+
const sorted = sortingKey ? withNewData.sort(sortingFunctions[sortingKey][ascending]) : withNewData;
|
|
826
|
+
setData(sorted);
|
|
827
|
+
setTableState(addElementToTable(tableState, sorted, newData, idMapping));
|
|
828
|
+
},
|
|
829
|
+
children: "Add Data"
|
|
41
830
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, children: _jsx("span", { className: "textstyle-table-header", children: "Id" }) }, "headerId"),
|
|
66
|
-
_jsx(SortButton, { ascending: sortingKey === 'name' ? ascending : undefined, onClick: newTableSorting => {
|
|
67
|
-
setSorting(['name', newTableSorting]);
|
|
68
|
-
setData(data.sort(sortingFunctions.name[newTableSorting]));
|
|
69
|
-
}, children: _jsx("span", { className: "textstyle-table-header", children: "Name" }) }, "name"),
|
|
70
|
-
_jsx(SortButton, { ascending: sortingKey === 'age' ? ascending : undefined, onClick: newTableSorting => {
|
|
71
|
-
setSorting(['age', newTableSorting]);
|
|
72
|
-
setData(data.sort(sortingFunctions.age[newTableSorting]));
|
|
73
|
-
}, children: _jsx("span", { className: "textstyle-table-header", children: "age" }, "age") }, "name"),
|
|
74
|
-
_jsx(_Fragment, {})
|
|
75
|
-
] }), _jsxs("div", { className: "row gap-x-2", children: [_jsx(SolidButton, { className: "w-auto", onClick: () => {
|
|
76
|
-
const newData = {
|
|
77
|
-
id: Math.random().toString(),
|
|
78
|
-
name: 'Name ' + data.length,
|
|
79
|
-
age: Math.ceil(Math.random() * 100)
|
|
80
|
-
};
|
|
81
|
-
const withNewData = [...data, newData];
|
|
82
|
-
const sorted = sortingKey ? withNewData.sort(sortingFunctions[sortingKey][ascending]) : withNewData;
|
|
83
|
-
setData(sorted);
|
|
84
|
-
setTableState(addElementToTable(tableState, sorted, newData, idMapping));
|
|
85
|
-
}, children: 'Add Data' }), _jsx(TextButton, { className: "w-auto", onClick: () => {
|
|
86
|
-
const selectedData = data.filter((d) => { var _a; return (_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d)); });
|
|
87
|
-
const unselectedData = data.filter((d) => { var _a; return !((_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d))); });
|
|
88
|
-
setData(unselectedData);
|
|
89
|
-
setTableState(removeFromTableSelection(tableState, selectedData, data.length, idMapping));
|
|
90
|
-
}, children: 'Remove all selected' })] })] }));
|
|
91
|
-
};
|
|
92
|
-
export default TableExample;
|
|
831
|
+
),
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
833
|
+
TextButton,
|
|
834
|
+
{
|
|
835
|
+
className: "w-auto",
|
|
836
|
+
onClick: () => {
|
|
837
|
+
const selectedData = data.filter((d) => tableState.selection?.currentSelection.includes(idMapping(d)));
|
|
838
|
+
const unselectedData = data.filter((d) => !tableState.selection?.currentSelection.includes(idMapping(d)));
|
|
839
|
+
setData(unselectedData);
|
|
840
|
+
setTableState(removeFromTableSelection(tableState, selectedData, data.length, idMapping));
|
|
841
|
+
},
|
|
842
|
+
children: "Remove all selected"
|
|
843
|
+
}
|
|
844
|
+
)
|
|
845
|
+
] })
|
|
846
|
+
] });
|
|
847
|
+
};
|
|
848
|
+
var TableExample_default = TableExample;
|
|
849
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
850
|
+
0 && (module.exports = {
|
|
851
|
+
exampleData
|
|
852
|
+
});
|
|
853
|
+
//# sourceMappingURL=TableExample.js.map
|