@helpwave/hightide 0.0.13 → 0.0.16
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/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/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/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 +86 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +5716 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5542 -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 +12 -7
- 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 +20 -9
- package/dist/components/Span.d.ts +0 -0
- package/dist/components/Span.js +0 -1
- package/dist/components/examples/InputGroupExample.d.ts +0 -6
- package/dist/components/examples/InputGroupExample.js +0 -21
- package/dist/components/examples/MultiSelectExample.d.ts +0 -7
- package/dist/components/examples/MultiSelectExample.js +0 -27
- package/dist/components/examples/SearchableSelectExample.d.ts +0 -6
- package/dist/components/examples/SearchableSelectExample.js +0 -17
- package/dist/components/examples/SelectExample.d.ts +0 -4
- package/dist/components/examples/SelectExample.js +0 -15
- package/dist/components/examples/StackingModals.d.ts +0 -4
- package/dist/components/examples/StackingModals.js +0 -15
- package/dist/components/examples/TableExample.d.ts +0 -9
- package/dist/components/examples/TableExample.js +0 -92
- package/dist/components/examples/TextareaExample.d.ts +0 -6
- package/dist/components/examples/TextareaExample.js +0 -10
- package/dist/components/examples/TileExample.d.ts +0 -9
- package/dist/components/examples/TileExample.js +0 -9
- package/dist/components/examples/Title.d.ts +0 -0
- package/dist/components/examples/Title.js +0 -1
- package/dist/components/examples/date/DateTimePickerExample.d.ts +0 -10
- package/dist/components/examples/date/DateTimePickerExample.js +0 -21
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/CheckboxPropertyExample.js +0 -13
- package/dist/components/examples/properties/DatePropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/DatePropertyExample.js +0 -23
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +0 -16
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +0 -6
- package/dist/components/examples/properties/NumberPropertyExample.js +0 -13
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +0 -6
- package/dist/components/examples/properties/SelectPropertyExample.js +0 -18
- package/dist/components/examples/properties/TextPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/TextPropertyExample.js +0 -13
package/dist/components/Table.js
CHANGED
|
@@ -1,187 +1,413 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export const defaultTableStateSelection = {
|
|
13
|
-
currentSelection: [],
|
|
14
|
-
hasSelectedAll: false,
|
|
15
|
-
hasSelectedSome: false,
|
|
16
|
-
hasSelectedNone: true
|
|
17
|
-
};
|
|
18
|
-
export const isDataObjectSelected = (tableState, dataObject, identifierMapping) => {
|
|
19
|
-
if (!tableState.selection) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return !!tableState.selection.currentSelection.find(value => value.localeCompare(identifierMapping(dataObject)) === 0);
|
|
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 });
|
|
23
11
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
31
19
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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/Table.tsx
|
|
31
|
+
var Table_exports = {};
|
|
32
|
+
__export(Table_exports, {
|
|
33
|
+
Table: () => Table,
|
|
34
|
+
addElementToTable: () => addElementToTable,
|
|
35
|
+
changeTableSelectionSingle: () => changeTableSelectionSingle,
|
|
36
|
+
defaultTableStatePagination: () => defaultTableStatePagination,
|
|
37
|
+
defaultTableStateSelection: () => defaultTableStateSelection,
|
|
38
|
+
isDataObjectSelected: () => isDataObjectSelected,
|
|
39
|
+
pageForItem: () => pageForItem,
|
|
40
|
+
removeFromTableSelection: () => removeFromTableSelection,
|
|
41
|
+
updatePagination: () => updatePagination
|
|
35
42
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
module.exports = __toCommonJS(Table_exports);
|
|
44
|
+
var import_react_custom_scrollbars_2 = require("react-custom-scrollbars-2");
|
|
45
|
+
var import_react4 = require("react");
|
|
46
|
+
|
|
47
|
+
// src/util/noop.ts
|
|
48
|
+
var noop = () => void 0;
|
|
49
|
+
|
|
50
|
+
// src/components/user-input/Checkbox.tsx
|
|
51
|
+
var import_react = require("react");
|
|
52
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
53
|
+
var import_lucide_react = require("lucide-react");
|
|
54
|
+
var import_clsx = __toESM(require("clsx"));
|
|
55
|
+
|
|
56
|
+
// src/components/user-input/Label.tsx
|
|
57
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
+
var styleMapping = {
|
|
59
|
+
labelSmall: "textstyle-label-sm",
|
|
60
|
+
labelMedium: "textstyle-label-md",
|
|
61
|
+
labelBig: "textstyle-label-lg"
|
|
49
62
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
hasSelectedAll: currentSelection.length === dataLength && dataLength !== 0,
|
|
66
|
-
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
67
|
-
hasSelectedNone: currentSelection.length === 0,
|
|
68
|
-
},
|
|
69
|
-
pagination: tableState.pagination ? updatePagination(tableState.pagination, dataLength) : undefined
|
|
70
|
-
};
|
|
63
|
+
var Label = ({
|
|
64
|
+
children,
|
|
65
|
+
name,
|
|
66
|
+
labelType = "labelSmall",
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, children: children ? children : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styleMapping[labelType], children: name }) });
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/components/user-input/Checkbox.tsx
|
|
73
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
74
|
+
var checkboxSizeMapping = {
|
|
75
|
+
small: "size-4",
|
|
76
|
+
medium: "size-6",
|
|
77
|
+
large: "size-8"
|
|
71
78
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
var checkboxIconSizeMapping = {
|
|
80
|
+
small: "size-3",
|
|
81
|
+
medium: "size-5",
|
|
82
|
+
large: "size-7"
|
|
83
|
+
};
|
|
84
|
+
var ControlledCheckbox = ({
|
|
85
|
+
id,
|
|
86
|
+
label,
|
|
87
|
+
checked,
|
|
88
|
+
disabled,
|
|
89
|
+
onChange,
|
|
90
|
+
onChangeTristate,
|
|
91
|
+
size = "medium",
|
|
92
|
+
className = "",
|
|
93
|
+
containerClassName
|
|
94
|
+
}) => {
|
|
95
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
96
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
97
|
+
const propagateChange = (checked2) => {
|
|
98
|
+
if (onChangeTristate) {
|
|
99
|
+
onChangeTristate(checked2);
|
|
75
100
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (hasSelectedObject) {
|
|
79
|
-
currentSelection = tableState.selection.currentSelection.filter(value => value.localeCompare(identifierMapping(dataObject)) !== 0);
|
|
101
|
+
if (onChange) {
|
|
102
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
80
103
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
104
|
+
};
|
|
105
|
+
const changeValue = () => {
|
|
106
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
107
|
+
propagateChange(newValue);
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx.default)("row justify-center items-center", containerClassName), children: [
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
111
|
+
CheckboxPrimitive.Root,
|
|
112
|
+
{
|
|
113
|
+
onCheckedChange: propagateChange,
|
|
114
|
+
checked,
|
|
115
|
+
disabled,
|
|
116
|
+
id,
|
|
117
|
+
className: (0, import_clsx.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
|
|
118
|
+
"text-disabled-text border-disabled-text": disabled,
|
|
119
|
+
"border-on-background": !disabled,
|
|
120
|
+
"bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
|
|
121
|
+
"hover:border-gray-400 focus:hover:border-primary": !checked
|
|
122
|
+
}, className),
|
|
123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
124
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Check, { className: innerIconSize }),
|
|
125
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Minus, { className: innerIconSize })
|
|
126
|
+
] })
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Label, { ...label, className: (0, import_clsx.default)("cursor-pointer", label.className), htmlFor: id, onClick: changeValue })
|
|
130
|
+
] });
|
|
90
131
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
132
|
+
|
|
133
|
+
// src/components/Pagination.tsx
|
|
134
|
+
var import_lucide_react2 = require("lucide-react");
|
|
135
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
136
|
+
|
|
137
|
+
// src/hooks/useLanguage.tsx
|
|
138
|
+
var import_react3 = require("react");
|
|
139
|
+
|
|
140
|
+
// src/hooks/useLocalStorage.tsx
|
|
141
|
+
var import_react2 = require("react");
|
|
142
|
+
|
|
143
|
+
// src/hooks/useLanguage.tsx
|
|
144
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
145
|
+
var DEFAULT_LANGUAGE = "en";
|
|
146
|
+
var LanguageContext = (0, import_react3.createContext)({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
147
|
+
var useLanguage = () => (0, import_react3.useContext)(LanguageContext);
|
|
148
|
+
|
|
149
|
+
// src/hooks/useTranslation.ts
|
|
150
|
+
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
151
|
+
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
152
|
+
const { language: inferredLanguage } = useLanguage();
|
|
153
|
+
const usedLanguage = languageProp ?? inferredLanguage;
|
|
154
|
+
let defaultValues = defaults[usedLanguage];
|
|
155
|
+
if (overwrite && overwrite[usedLanguage]) {
|
|
156
|
+
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
157
|
+
}
|
|
158
|
+
return defaultValues;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// src/components/Pagination.tsx
|
|
162
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
163
|
+
var defaultPaginationTranslations = {
|
|
164
|
+
en: {
|
|
165
|
+
of: "of"
|
|
166
|
+
},
|
|
167
|
+
de: {
|
|
168
|
+
of: "von"
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
var Pagination = ({
|
|
172
|
+
overwriteTranslation,
|
|
173
|
+
page,
|
|
174
|
+
numberOfPages,
|
|
175
|
+
onPageChanged
|
|
176
|
+
}) => {
|
|
177
|
+
const translation = useTranslation(defaultPaginationTranslations, overwriteTranslation);
|
|
178
|
+
const changePage = (page2) => {
|
|
179
|
+
onPageChanged(page2);
|
|
180
|
+
};
|
|
181
|
+
const noPages = numberOfPages === 0;
|
|
182
|
+
const onFirstPage = page === 0 && !noPages;
|
|
183
|
+
const onLastPage = page === numberOfPages - 1;
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx2.default)("row", { "opacity-30": noPages }), children: [
|
|
185
|
+
/* @__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 }) }) }),
|
|
186
|
+
/* @__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 }) }) }),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "min-w-[80px] justify-center mx-2", children: [
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none mx-2", children: translation.of }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "select-none text-left flex-1", children: numberOfPages })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__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 }) }) }),
|
|
193
|
+
/* @__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 }) }) })
|
|
194
|
+
] });
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/components/Table.tsx
|
|
198
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
199
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
200
|
+
var defaultTableStatePagination = {
|
|
201
|
+
currentPage: 0,
|
|
202
|
+
entriesPerPage: 5
|
|
203
|
+
};
|
|
204
|
+
var defaultTableStateSelection = {
|
|
205
|
+
currentSelection: [],
|
|
206
|
+
hasSelectedAll: false,
|
|
207
|
+
hasSelectedSome: false,
|
|
208
|
+
hasSelectedNone: true
|
|
209
|
+
};
|
|
210
|
+
var isDataObjectSelected = (tableState, dataObject, identifierMapping) => {
|
|
211
|
+
if (!tableState.selection) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
return !!tableState.selection.currentSelection.find((value) => value.localeCompare(identifierMapping(dataObject)) === 0);
|
|
215
|
+
};
|
|
216
|
+
var pageForItem = (data, item, entriesPerPage, identifierMapping) => {
|
|
217
|
+
const index = data.findIndex((value) => identifierMapping(value) === identifierMapping(item));
|
|
218
|
+
if (index !== -1) {
|
|
219
|
+
return Math.floor(index / entriesPerPage);
|
|
220
|
+
}
|
|
221
|
+
console.warn("item doesn't exist on data", item, data);
|
|
222
|
+
return 0;
|
|
223
|
+
};
|
|
224
|
+
var updatePagination = (pagination, dataLength) => ({
|
|
225
|
+
...pagination,
|
|
226
|
+
currentPage: Math.min(Math.max(Math.ceil(dataLength / pagination.entriesPerPage) - 1, 0), pagination.currentPage)
|
|
227
|
+
});
|
|
228
|
+
var addElementToTable = (tableState, data, dataObject, identifierMapping) => {
|
|
229
|
+
return {
|
|
230
|
+
...tableState,
|
|
231
|
+
pagination: tableState.pagination ? {
|
|
232
|
+
...tableState.pagination,
|
|
233
|
+
currentPage: pageForItem(data, dataObject, tableState.pagination.entriesPerPage, identifierMapping)
|
|
234
|
+
} : void 0,
|
|
235
|
+
selection: tableState.selection ? {
|
|
236
|
+
...tableState.selection,
|
|
237
|
+
hasSelectedAll: false,
|
|
238
|
+
hasSelectedSome: tableState.selection.hasSelectedAll || tableState.selection.hasSelectedSome
|
|
239
|
+
} : void 0
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
var removeFromTableSelection = (tableState, deletedObjects, dataLength, identifierMapping) => {
|
|
243
|
+
if (!tableState.selection) {
|
|
244
|
+
return tableState;
|
|
245
|
+
}
|
|
246
|
+
const deletedObjectIds = deletedObjects.map(identifierMapping);
|
|
247
|
+
const elementsBefore = tableState.selection.currentSelection.length;
|
|
248
|
+
const currentSelection = tableState.selection.currentSelection.filter((value) => !deletedObjectIds.includes(value));
|
|
249
|
+
dataLength -= elementsBefore - currentSelection.length;
|
|
250
|
+
return {
|
|
251
|
+
...tableState,
|
|
252
|
+
selection: {
|
|
253
|
+
currentSelection,
|
|
254
|
+
hasSelectedAll: currentSelection.length === dataLength && dataLength !== 0,
|
|
255
|
+
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
256
|
+
hasSelectedNone: currentSelection.length === 0
|
|
257
|
+
},
|
|
258
|
+
pagination: tableState.pagination ? updatePagination(tableState.pagination, dataLength) : void 0
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
var changeTableSelectionSingle = (tableState, dataObject, dataLength, identifierMapping) => {
|
|
262
|
+
if (!tableState.selection) {
|
|
263
|
+
return tableState;
|
|
264
|
+
}
|
|
265
|
+
const hasSelectedObject = isDataObjectSelected(tableState, dataObject, identifierMapping);
|
|
266
|
+
let currentSelection = [...tableState.selection.currentSelection, identifierMapping(dataObject)];
|
|
267
|
+
if (hasSelectedObject) {
|
|
268
|
+
currentSelection = tableState.selection.currentSelection.filter((value) => value.localeCompare(identifierMapping(dataObject)) !== 0);
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
...tableState,
|
|
272
|
+
selection: {
|
|
273
|
+
currentSelection,
|
|
274
|
+
hasSelectedAll: currentSelection.length === dataLength,
|
|
275
|
+
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
276
|
+
hasSelectedNone: currentSelection.length === 0
|
|
105
277
|
}
|
|
106
|
-
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
var changeTableSelectionAll = (tableState, data, identifierMapping) => {
|
|
281
|
+
if (!tableState.selection) {
|
|
282
|
+
return tableState;
|
|
283
|
+
}
|
|
284
|
+
if (data.length === 0) {
|
|
107
285
|
return {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
286
|
+
...tableState,
|
|
287
|
+
selection: {
|
|
288
|
+
currentSelection: [],
|
|
289
|
+
hasSelectedAll: false,
|
|
290
|
+
hasSelectedSome: false,
|
|
291
|
+
hasSelectedNone: true
|
|
292
|
+
}
|
|
115
293
|
};
|
|
294
|
+
}
|
|
295
|
+
const hasSelectedAll = !(tableState.selection.hasSelectedSome || tableState.selection.hasSelectedAll);
|
|
296
|
+
return {
|
|
297
|
+
...tableState,
|
|
298
|
+
selection: {
|
|
299
|
+
currentSelection: hasSelectedAll ? data.map(identifierMapping) : [],
|
|
300
|
+
hasSelectedAll,
|
|
301
|
+
hasSelectedSome: false,
|
|
302
|
+
hasSelectedNone: !hasSelectedAll
|
|
303
|
+
}
|
|
304
|
+
};
|
|
116
305
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
306
|
+
var Table = ({
|
|
307
|
+
data,
|
|
308
|
+
stateManagement = [{}, noop],
|
|
309
|
+
identifierMapping,
|
|
310
|
+
header,
|
|
311
|
+
rowMappingToCells,
|
|
312
|
+
sorting,
|
|
313
|
+
focusElement,
|
|
314
|
+
className
|
|
315
|
+
}) => {
|
|
316
|
+
const sortedData = [...data];
|
|
317
|
+
if (sorting) {
|
|
318
|
+
const [sortingFunction, sortingType] = sorting;
|
|
319
|
+
sortedData.sort((a, b) => sortingFunction(a, b) * (sortingType === "ascending" ? 1 : -1));
|
|
320
|
+
}
|
|
321
|
+
let currentPage = 0;
|
|
322
|
+
let pageCount = 1;
|
|
323
|
+
let entriesPerPage = 5;
|
|
324
|
+
const [tableState, updateTableState] = stateManagement;
|
|
325
|
+
let shownElements = sortedData;
|
|
326
|
+
if (tableState?.pagination) {
|
|
327
|
+
if (tableState.pagination.entriesPerPage < 1) {
|
|
328
|
+
console.error("tableState.pagination.entriesPerPage must be >= 1", tableState.pagination.entriesPerPage);
|
|
329
|
+
}
|
|
330
|
+
entriesPerPage = Math.max(1, tableState.pagination.entriesPerPage);
|
|
331
|
+
pageCount = Math.ceil(sortedData.length / entriesPerPage);
|
|
332
|
+
if (tableState.pagination.currentPage < 0 || tableState.pagination.currentPage >= pageCount && pageCount !== 0) {
|
|
333
|
+
console.error(
|
|
334
|
+
"tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0) must be fullfilled",
|
|
335
|
+
[`pageCount: ${pageCount}`, `tableState.pagination.currentPage: ${tableState.pagination.currentPage}`]
|
|
336
|
+
);
|
|
337
|
+
} else {
|
|
338
|
+
currentPage = tableState.pagination.currentPage;
|
|
131
339
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
let entriesPerPage = 5;
|
|
135
|
-
const [tableState, updateTableState] = stateManagement;
|
|
136
|
-
let shownElements = sortedData;
|
|
137
|
-
if (tableState === null || tableState === void 0 ? void 0 : tableState.pagination) {
|
|
138
|
-
if (tableState.pagination.entriesPerPage < 1) {
|
|
139
|
-
console.error('tableState.pagination.entriesPerPage must be >= 1', tableState.pagination.entriesPerPage);
|
|
140
|
-
}
|
|
141
|
-
entriesPerPage = Math.max(1, tableState.pagination.entriesPerPage);
|
|
142
|
-
pageCount = Math.ceil(sortedData.length / entriesPerPage);
|
|
143
|
-
if (tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0)) {
|
|
144
|
-
console.error('tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0) must be fullfilled', [`pageCount: ${pageCount}`, `tableState.pagination.currentPage: ${tableState.pagination.currentPage}`]);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
currentPage = tableState.pagination.currentPage;
|
|
148
|
-
}
|
|
149
|
-
if (focusElement) {
|
|
150
|
-
currentPage = pageForItem(sortedData, focusElement, entriesPerPage, identifierMapping);
|
|
151
|
-
}
|
|
152
|
-
shownElements = sortedData.slice(currentPage * entriesPerPage, Math.min(sortedData.length, (currentPage + 1) * entriesPerPage));
|
|
340
|
+
if (focusElement) {
|
|
341
|
+
currentPage = pageForItem(sortedData, focusElement, entriesPerPage, identifierMapping);
|
|
153
342
|
}
|
|
154
|
-
|
|
155
|
-
|
|
343
|
+
shownElements = sortedData.slice(currentPage * entriesPerPage, Math.min(sortedData.length, (currentPage + 1) * entriesPerPage));
|
|
344
|
+
} else {
|
|
345
|
+
currentPage = 0;
|
|
346
|
+
}
|
|
347
|
+
const headerRow = "border-b-2 border-gray-300";
|
|
348
|
+
const headerPaddingHead = "pb-2";
|
|
349
|
+
const headerPaddingBody = "pt-2";
|
|
350
|
+
const cellPadding = "py-1 px-2";
|
|
351
|
+
const [scrollbarsAutoHeightMin, setScrollbarsAutoHeightMin] = (0, import_react4.useState)(0);
|
|
352
|
+
const tableRef = (0, import_react4.useRef)(null);
|
|
353
|
+
const calculateHeight = () => {
|
|
354
|
+
if (tableRef.current) {
|
|
355
|
+
const tableHeight = tableRef.current.offsetHeight;
|
|
356
|
+
const offset = 25;
|
|
357
|
+
setScrollbarsAutoHeightMin(tableHeight + offset);
|
|
156
358
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
const tableRef = useRef(null);
|
|
163
|
-
const calculateHeight = () => {
|
|
164
|
-
if (tableRef.current) {
|
|
165
|
-
const tableHeight = tableRef.current.offsetHeight;
|
|
166
|
-
const offset = 25;
|
|
167
|
-
setScrollbarsAutoHeightMin(tableHeight + offset);
|
|
168
|
-
}
|
|
359
|
+
};
|
|
360
|
+
(0, import_react4.useEffect)(() => {
|
|
361
|
+
calculateHeight();
|
|
362
|
+
const handleResize = () => {
|
|
363
|
+
calculateHeight();
|
|
169
364
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
365
|
+
window.addEventListener("resize", handleResize);
|
|
366
|
+
return () => {
|
|
367
|
+
window.removeEventListener("resize", handleResize);
|
|
368
|
+
};
|
|
369
|
+
}, [data, currentPage]);
|
|
370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx3.default)("col gap-y-4 overflow-hidden", className), children: [
|
|
371
|
+
/* @__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: [
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: headerRow, children: [
|
|
373
|
+
header && tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
374
|
+
ControlledCheckbox,
|
|
375
|
+
{
|
|
376
|
+
checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
|
|
377
|
+
onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
|
|
378
|
+
}
|
|
379
|
+
) }),
|
|
380
|
+
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}`))
|
|
381
|
+
] }) }),
|
|
382
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { children: [
|
|
383
|
+
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)(
|
|
384
|
+
ControlledCheckbox,
|
|
385
|
+
{
|
|
386
|
+
checked: isDataObjectSelected(tableState, value, identifierMapping),
|
|
387
|
+
onChange: () => {
|
|
388
|
+
updateTableState(changeTableSelectionSingle(tableState, value, data.length, identifierMapping));
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
) }),
|
|
392
|
+
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: (0, import_clsx3.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: value1 }, index))
|
|
393
|
+
] }, identifierMapping(value))) })
|
|
394
|
+
] }) }) }),
|
|
395
|
+
/* @__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({
|
|
396
|
+
...tableState,
|
|
397
|
+
pagination: { entriesPerPage, currentPage: page }
|
|
398
|
+
}) }) })
|
|
399
|
+
] });
|
|
187
400
|
};
|
|
401
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
402
|
+
0 && (module.exports = {
|
|
403
|
+
Table,
|
|
404
|
+
addElementToTable,
|
|
405
|
+
changeTableSelectionSingle,
|
|
406
|
+
defaultTableStatePagination,
|
|
407
|
+
defaultTableStateSelection,
|
|
408
|
+
isDataObjectSelected,
|
|
409
|
+
pageForItem,
|
|
410
|
+
removeFromTableSelection,
|
|
411
|
+
updatePagination
|
|
412
|
+
});
|
|
413
|
+
//# sourceMappingURL=Table.js.map
|