@chayns-components/core 5.0.0-beta.21 → 5.0.0-beta.211
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/README.md +3 -9
- package/lib/api/image/post.d.ts +16 -0
- package/lib/api/image/post.js +34 -0
- package/lib/api/image/post.js.map +1 -0
- package/lib/api/video/post.d.ts +16 -0
- package/lib/api/video/post.js +31 -0
- package/lib/api/video/post.js.map +1 -0
- package/lib/components/accordion/Accordion.d.ts +31 -2
- package/lib/components/accordion/Accordion.js +68 -74
- package/lib/components/accordion/Accordion.js.map +1 -1
- package/lib/components/accordion/Accordion.styles.d.ts +3 -2
- package/lib/components/accordion/Accordion.styles.js +67 -26
- package/lib/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.d.ts +17 -2
- package/lib/components/accordion/accordion-body/AccordionBody.js +22 -13
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +15 -10
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +16 -2
- package/lib/components/accordion/accordion-content/AccordionContent.js +13 -11
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +2 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js +24 -14
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
- package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +10 -2
- package/lib/components/accordion/accordion-group/AccordionGroup.js +31 -44
- package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.d.ts +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.js +26 -54
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +136 -49
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +9 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js +21 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +13 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -0
- package/lib/components/accordion/accordion-item/AccordionItem.d.ts +9 -0
- package/lib/components/accordion/accordion-item/AccordionItem.js +28 -0
- package/lib/components/accordion/accordion-item/AccordionItem.js.map +1 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.d.ts +5 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.js +34 -0
- package/lib/components/accordion/accordion-item/AccordionItem.styles.js.map +1 -0
- package/lib/components/accordion/utils.js +10 -12
- package/lib/components/accordion/utils.js.map +1 -1
- package/lib/components/amount-control/AmountControl.d.ts +22 -0
- package/lib/components/amount-control/AmountControl.js +176 -0
- package/lib/components/amount-control/AmountControl.js.map +1 -0
- package/lib/components/amount-control/AmountControl.styles.d.ts +14 -0
- package/lib/components/amount-control/AmountControl.styles.js +61 -0
- package/lib/components/amount-control/AmountControl.styles.js.map +1 -0
- package/lib/components/amount-control/utils.d.ts +7 -0
- package/lib/components/amount-control/utils.js +22 -0
- package/lib/components/amount-control/utils.js.map +1 -0
- package/lib/components/badge/Badge.d.ts +9 -1
- package/lib/components/badge/Badge.js +12 -12
- package/lib/components/badge/Badge.js.map +1 -1
- package/lib/components/badge/Badge.styles.d.ts +4 -1
- package/lib/components/badge/Badge.styles.js +22 -15
- package/lib/components/badge/Badge.styles.js.map +1 -1
- package/lib/components/button/Button.d.ts +6 -2
- package/lib/components/button/Button.js +65 -22
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/button/Button.styles.d.ts +2 -0
- package/lib/components/button/Button.styles.js +57 -24
- package/lib/components/button/Button.styles.js.map +1 -1
- package/lib/components/checkbox/Checkbox.d.ts +25 -0
- package/lib/components/checkbox/Checkbox.js +44 -0
- package/lib/components/checkbox/Checkbox.js.map +1 -0
- package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
- package/lib/components/checkbox/Checkbox.styles.js +131 -0
- package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +2 -2
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +44 -78
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/components/color-scheme-provider/font.d.ts +6 -0
- package/lib/components/color-scheme-provider/font.js +59 -0
- package/lib/components/color-scheme-provider/font.js.map +1 -0
- package/lib/components/combobox/ComboBox.d.ts +25 -0
- package/lib/components/combobox/ComboBox.js +143 -0
- package/lib/components/combobox/ComboBox.js.map +1 -0
- package/lib/components/combobox/ComboBox.styles.d.ts +17 -0
- package/lib/components/combobox/ComboBox.styles.js +128 -0
- package/lib/components/combobox/ComboBox.styles.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.d.ts +18 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js +30 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.js.map +1 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.d.ts +6 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js +30 -0
- package/lib/components/combobox/combobox-item/ComboBoxItem.styles.js.map +1 -0
- package/lib/components/content-card/ContentCard.d.ts +9 -0
- package/lib/components/content-card/ContentCard.js +19 -0
- package/lib/components/content-card/ContentCard.js.map +1 -0
- package/lib/components/content-card/ContentCard.styles.d.ts +1 -0
- package/lib/components/content-card/ContentCard.styles.js +23 -0
- package/lib/components/content-card/ContentCard.styles.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.d.ts +6 -6
- package/lib/components/context-menu/ContextMenu.js +82 -98
- package/lib/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/components/context-menu/ContextMenu.styles.js +3 -9
- package/lib/components/context-menu/ContextMenu.styles.js.map +1 -1
- package/lib/components/context-menu/constants/alignment.js +4 -5
- package/lib/components/context-menu/constants/alignment.js.map +1 -1
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +1 -1
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +32 -28
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -1
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +92 -41
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
- package/lib/components/date-info/DateInfo.d.ts +40 -0
- package/lib/components/date-info/DateInfo.js +109 -0
- package/lib/components/date-info/DateInfo.js.map +1 -0
- package/lib/components/date-info/utils/format.d.ts +43 -0
- package/lib/components/date-info/utils/format.js +288 -0
- package/lib/components/date-info/utils/format.js.map +1 -0
- package/lib/components/date-info/utils/language.d.ts +1 -0
- package/lib/components/date-info/utils/language.js +34 -0
- package/lib/components/date-info/utils/language.js.map +1 -0
- package/lib/components/filter-button/FilterButton.d.ts +22 -0
- package/lib/components/filter-button/FilterButton.js +89 -0
- package/lib/components/filter-button/FilterButton.js.map +1 -0
- package/lib/components/filter-button/FilterButton.styles.d.ts +1 -0
- package/lib/components/filter-button/FilterButton.styles.js +15 -0
- package/lib/components/filter-button/FilterButton.styles.js.map +1 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.d.ts +14 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.js +48 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.js.map +1 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.d.ts +26 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js +109 -0
- package/lib/components/filter-button/filter-button-item/FilterButtonItem.styles.js.map +1 -0
- package/lib/components/filter-button/types.d.ts +15 -0
- package/lib/components/filter-button/types.js +19 -0
- package/lib/components/filter-button/types.js.map +1 -0
- package/lib/components/grid-image/GridImage.d.ts +1 -1
- package/lib/components/grid-image/GridImage.js +15 -52
- package/lib/components/grid-image/GridImage.js.map +1 -1
- package/lib/components/grid-image/GridImage.styles.d.ts +3 -3
- package/lib/components/grid-image/GridImage.styles.js +82 -38
- package/lib/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/components/icon/Icon.d.ts +2 -2
- package/lib/components/icon/Icon.js +22 -34
- package/lib/components/icon/Icon.js.map +1 -1
- package/lib/components/icon/Icon.styles.d.ts +1 -1
- package/lib/components/icon/Icon.styles.js +61 -39
- package/lib/components/icon/Icon.styles.js.map +1 -1
- package/lib/components/icon/utils.js +2 -5
- package/lib/components/icon/utils.js.map +1 -1
- package/lib/components/input/Input.d.ts +44 -0
- package/lib/components/input/Input.js +85 -0
- package/lib/components/input/Input.js.map +1 -0
- package/lib/components/input/Input.styles.d.ts +7 -0
- package/lib/components/input/Input.styles.js +71 -0
- package/lib/components/input/Input.styles.js.map +1 -0
- package/lib/components/list/List.d.ts +1 -1
- package/lib/components/list/List.js +26 -63
- package/lib/components/list/List.js.map +1 -1
- package/lib/components/list/list-item/ListItem.d.ts +10 -1
- package/lib/components/list/list-item/ListItem.js +37 -47
- package/lib/components/list/list-item/ListItem.js.map +1 -1
- package/lib/components/list/list-item/ListItem.styles.js +44 -26
- package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +4 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.js +31 -12
- package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +3 -9
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.js +4 -7
- package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +8 -11
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +2 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.js +37 -88
- package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +1 -11
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +88 -81
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +23 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +32 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +44 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +52 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
- package/lib/components/mention-finder/MentionFinder.js +141 -0
- package/lib/components/mention-finder/MentionFinder.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -0
- package/lib/components/mention-finder/MentionFinder.styles.js +94 -0
- package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
- package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
- package/lib/components/mention-finder/constants/alignment.js +13 -0
- package/lib/components/mention-finder/constants/alignment.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +32 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +8 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +100 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
- package/lib/components/popup/Popup.d.ts +26 -0
- package/lib/components/popup/Popup.js +145 -0
- package/lib/components/popup/Popup.js.map +1 -0
- package/lib/components/popup/Popup.styles.d.ts +2 -0
- package/lib/components/popup/Popup.styles.js +22 -0
- package/lib/components/popup/Popup.styles.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.d.ts +9 -0
- package/lib/components/popup/popup-content/PopupContent.js +64 -0
- package/lib/components/popup/popup-content/PopupContent.js.map +1 -0
- package/lib/components/popup/popup-content/PopupContent.styles.d.ts +6 -0
- package/lib/components/popup/popup-content/PopupContent.styles.js +90 -0
- package/lib/components/popup/popup-content/PopupContent.styles.js.map +1 -0
- package/lib/components/popup/types.d.ts +16 -0
- package/lib/components/popup/types.js +17 -0
- package/lib/components/popup/types.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.d.ts +9 -0
- package/lib/components/progress-bar/ProgressBar.js +39 -0
- package/lib/components/progress-bar/ProgressBar.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.styles.d.ts +7 -0
- package/lib/components/progress-bar/ProgressBar.styles.js +39 -0
- package/lib/components/progress-bar/ProgressBar.styles.js.map +1 -0
- package/lib/components/radio-button/RadioButton.d.ts +22 -0
- package/lib/components/radio-button/RadioButton.js +73 -0
- package/lib/components/radio-button/RadioButton.js.map +1 -0
- package/lib/components/radio-button/RadioButton.styles.d.ts +18 -0
- package/lib/components/radio-button/RadioButton.styles.js +89 -0
- package/lib/components/radio-button/RadioButton.styles.js.map +1 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.d.ts +21 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js +54 -0
- package/lib/components/radio-button/radio-button-group/RadioButtonGroup.js.map +1 -0
- package/lib/components/radio-button/types.d.ts +4 -0
- package/lib/components/radio-button/types.js +6 -0
- package/lib/components/radio-button/types.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.d.ts +9 -0
- package/lib/components/scroll-view/ScrollView.js +23 -0
- package/lib/components/scroll-view/ScrollView.js.map +1 -0
- package/lib/components/scroll-view/ScrollView.styles.d.ts +6 -0
- package/lib/components/scroll-view/ScrollView.styles.js +27 -0
- package/lib/components/scroll-view/ScrollView.styles.js.map +1 -0
- package/lib/components/search-box/SearchBox.d.ts +26 -0
- package/lib/components/search-box/SearchBox.js +149 -0
- package/lib/components/search-box/SearchBox.js.map +1 -0
- package/lib/components/search-box/SearchBox.styles.d.ts +6 -0
- package/lib/components/search-box/SearchBox.styles.js +51 -0
- package/lib/components/search-box/SearchBox.styles.js.map +1 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.d.ts +9 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.js +30 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.js.map +1 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.d.ts +6 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js +30 -0
- package/lib/components/search-box/search-box-item/SearchBoxItem.styles.js.map +1 -0
- package/lib/components/search-box/types.d.ts +4 -0
- package/lib/components/search-box/types.js +6 -0
- package/lib/components/search-box/types.js.map +1 -0
- package/lib/components/search-box/utils.d.ts +7 -0
- package/lib/components/search-box/utils.js +23 -0
- package/lib/components/search-box/utils.js.map +1 -0
- package/lib/components/search-input/SearchInput.d.ts +18 -0
- package/lib/components/search-input/SearchInput.js +94 -0
- package/lib/components/search-input/SearchInput.js.map +1 -0
- package/lib/components/search-input/SearchInput.styles.d.ts +4 -0
- package/lib/components/search-input/SearchInput.styles.js +30 -0
- package/lib/components/search-input/SearchInput.styles.js.map +1 -0
- package/lib/components/sharing-bar/SharingBar.d.ts +18 -0
- package/lib/components/sharing-bar/SharingBar.js +114 -0
- package/lib/components/sharing-bar/SharingBar.js.map +1 -0
- package/lib/components/sharing-bar/SharingBar.styles.d.ts +5 -0
- package/lib/components/sharing-bar/SharingBar.styles.js +27 -0
- package/lib/components/sharing-bar/SharingBar.styles.js.map +1 -0
- package/lib/components/slider/Slider.d.ts +21 -0
- package/lib/components/slider/Slider.js +52 -0
- package/lib/components/slider/Slider.js.map +1 -0
- package/lib/components/slider/Slider.styles.d.ts +8 -0
- package/lib/components/slider/Slider.styles.js +77 -0
- package/lib/components/slider/Slider.styles.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.d.ts +31 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js +47 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.js.map +1 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.d.ts +18 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js +105 -0
- package/lib/components/small-wait-cursor/SmallWaitCursor.styles.js.map +1 -0
- package/lib/components/text-area/TextArea.d.ts +25 -0
- package/lib/components/text-area/TextArea.js +63 -0
- package/lib/components/text-area/TextArea.js.map +1 -0
- package/lib/components/text-area/TextArea.styles.d.ts +8 -0
- package/lib/components/text-area/TextArea.styles.js +46 -0
- package/lib/components/text-area/TextArea.styles.js.map +1 -0
- package/lib/components/textstring/TextString.d.ts +22 -0
- package/lib/components/textstring/TextString.js +63 -0
- package/lib/components/textstring/TextString.js.map +1 -0
- package/lib/components/textstring/TextString.styles.d.ts +1 -0
- package/lib/components/textstring/TextString.styles.js +11 -0
- package/lib/components/textstring/TextString.styles.js.map +1 -0
- package/lib/components/textstring/types.d.ts +8 -0
- package/lib/components/textstring/types.js +6 -0
- package/lib/components/textstring/types.js.map +1 -0
- package/lib/components/textstring-provider/TextStringProvider.d.ts +21 -0
- package/lib/components/textstring-provider/TextStringProvider.js +39 -0
- package/lib/components/textstring-provider/TextStringProvider.js.map +1 -0
- package/lib/components/textstring-provider/utils.d.ts +11 -0
- package/lib/components/textstring-provider/utils.js +32 -0
- package/lib/components/textstring-provider/utils.js.map +1 -0
- package/lib/components/tooltip/Tooltip.d.ts +18 -0
- package/lib/components/tooltip/Tooltip.js +33 -0
- package/lib/components/tooltip/Tooltip.js.map +1 -0
- package/lib/components/tooltip/Tooltip.styles.d.ts +1 -0
- package/lib/components/tooltip/Tooltip.styles.js +11 -0
- package/lib/components/tooltip/Tooltip.styles.js.map +1 -0
- package/lib/components/tooltip/interface.d.ts +4 -0
- package/lib/components/tooltip/interface.js +6 -0
- package/lib/components/tooltip/interface.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.d.ts +7 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js +21 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.js.map +1 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.d.ts +7 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js +32 -0
- package/lib/components/tooltip/tooltip-item/TooltipItem.styles.js.map +1 -0
- package/lib/hooks/uuid.js +2 -21
- package/lib/hooks/uuid.js.map +1 -1
- package/lib/index.d.ts +35 -0
- package/lib/index.js +222 -25
- package/lib/index.js.map +1 -1
- package/lib/types/chayns.d.ts +98 -0
- package/lib/types/chayns.js +14 -0
- package/lib/types/chayns.js.map +1 -0
- package/lib/types/file.d.ts +42 -0
- package/lib/types/file.js +6 -0
- package/lib/types/file.js.map +1 -0
- package/lib/utils/calculate.d.ts +2 -0
- package/lib/utils/calculate.js +40 -0
- package/lib/utils/calculate.js.map +1 -0
- package/lib/utils/fileDialog.d.ts +7 -0
- package/lib/utils/fileDialog.js +70 -0
- package/lib/utils/fileDialog.js.map +1 -0
- package/lib/utils/isTobitEmployee.d.ts +1 -0
- package/lib/utils/isTobitEmployee.js +29 -0
- package/lib/utils/isTobitEmployee.js.map +1 -0
- package/lib/utils/uploadFile.d.ts +9 -0
- package/lib/utils/uploadFile.js +48 -0
- package/lib/utils/uploadFile.js.map +1 -0
- package/package.json +23 -19
|
@@ -1,66 +1,117 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.StyledMotionContextMenuContent = exports.StyledContextMenuContentItemText = exports.StyledContextMenuContentItemIconWrapper = exports.StyledContextMenuContentItem = void 0;
|
|
9
|
-
|
|
10
7
|
var _framerMotion = require("framer-motion");
|
|
11
|
-
|
|
12
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
9
|
var _alignment = require("../constants/alignment");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
23
|
-
|
|
24
|
-
var StyledMotionContextMenuContent = (0, _styledComponents.default)(_framerMotion.motion.div)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);\n color: ", ";\n position: absolute;\n z-index: 0;\n\n ::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-bottom-right-radius: 2px;\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n\n ", "\n }\n\n ::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -1;\n }\n"])), function (_ref) {
|
|
25
|
-
var theme = _ref.theme;
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
const StyledMotionContextMenuContent = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
13
|
+
background-color: ${_ref => {
|
|
14
|
+
let {
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
26
17
|
return theme['001'];
|
|
27
|
-
}
|
|
28
|
-
|
|
18
|
+
}};
|
|
19
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
20
|
+
border-radius: 3px;
|
|
21
|
+
box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);
|
|
22
|
+
color: ${_ref2 => {
|
|
23
|
+
let {
|
|
24
|
+
theme
|
|
25
|
+
} = _ref2;
|
|
29
26
|
return theme.text;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
}};
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 0;
|
|
30
|
+
|
|
31
|
+
::after {
|
|
32
|
+
background-color: inherit;
|
|
33
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
34
|
+
border-bottom-right-radius: 3px;
|
|
35
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
36
|
+
box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);
|
|
37
|
+
content: '';
|
|
38
|
+
height: 14px;
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 14px;
|
|
41
|
+
z-index: -2;
|
|
42
|
+
|
|
43
|
+
${_ref3 => {
|
|
44
|
+
let {
|
|
45
|
+
position
|
|
46
|
+
} = _ref3;
|
|
33
47
|
switch (position) {
|
|
34
48
|
case _alignment.ContextMenuAlignment.TopLeft:
|
|
35
|
-
return (0, _styledComponents.css)
|
|
36
|
-
|
|
49
|
+
return (0, _styledComponents.css)`
|
|
50
|
+
bottom: -8px;
|
|
51
|
+
right: 13px;
|
|
52
|
+
transform: rotate(45deg);
|
|
53
|
+
`;
|
|
37
54
|
case _alignment.ContextMenuAlignment.BottomLeft:
|
|
38
|
-
return (0, _styledComponents.css)
|
|
39
|
-
|
|
55
|
+
return (0, _styledComponents.css)`
|
|
56
|
+
top: -8px;
|
|
57
|
+
right: 13px;
|
|
58
|
+
transform: rotate(225deg);
|
|
59
|
+
`;
|
|
40
60
|
case _alignment.ContextMenuAlignment.TopRight:
|
|
41
|
-
return (0, _styledComponents.css)
|
|
42
|
-
|
|
61
|
+
return (0, _styledComponents.css)`
|
|
62
|
+
transform: rotate(45deg);
|
|
63
|
+
bottom: -8px;
|
|
64
|
+
left: 13px;
|
|
65
|
+
`;
|
|
43
66
|
case _alignment.ContextMenuAlignment.BottomRight:
|
|
44
|
-
return (0, _styledComponents.css)
|
|
45
|
-
|
|
67
|
+
return (0, _styledComponents.css)`
|
|
68
|
+
transform: rotate(225deg);
|
|
69
|
+
top: -8px;
|
|
70
|
+
left: 13px;
|
|
71
|
+
`;
|
|
46
72
|
default:
|
|
47
73
|
return undefined;
|
|
48
74
|
}
|
|
49
|
-
}
|
|
75
|
+
}}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
::before {
|
|
79
|
+
background-color: inherit;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
content: '';
|
|
82
|
+
left: 0;
|
|
83
|
+
position: absolute;
|
|
84
|
+
right: 0;
|
|
85
|
+
top: 0;
|
|
86
|
+
z-index: -1;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
50
89
|
exports.StyledMotionContextMenuContent = StyledMotionContextMenuContent;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
90
|
+
const StyledContextMenuContentItem = _styledComponents.default.div`
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
display: flex;
|
|
93
|
+
padding: 5px 8px 5px 5px;
|
|
94
|
+
transition: background-color 0.3s ease;
|
|
95
|
+
|
|
96
|
+
:hover {
|
|
97
|
+
background-color: ${_ref4 => {
|
|
98
|
+
let {
|
|
99
|
+
theme
|
|
100
|
+
} = _ref4;
|
|
54
101
|
return theme['secondary-103'];
|
|
55
|
-
}
|
|
56
|
-
|
|
102
|
+
}};
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
57
105
|
exports.StyledContextMenuContentItem = StyledContextMenuContentItem;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
const StyledContextMenuContentItemIconWrapper = _styledComponents.default.div`
|
|
107
|
+
flex: 0 0 auto;
|
|
108
|
+
margin: 0 8px 0 3px;
|
|
109
|
+
width: 20px;
|
|
110
|
+
`;
|
|
61
111
|
exports.StyledContextMenuContentItemIconWrapper = StyledContextMenuContentItemIconWrapper;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
112
|
+
const StyledContextMenuContentItemText = _styledComponents.default.div`
|
|
113
|
+
flex: 0 0 auto;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
`;
|
|
65
116
|
exports.StyledContextMenuContentItemText = StyledContextMenuContentItemText;
|
|
66
117
|
//# sourceMappingURL=ContextMenuContent.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ContextMenuContent.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_alignment","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledMotionContextMenuContent","styled","motion","div","_ref","theme","_ref2","text","_ref3","position","ContextMenuAlignment","TopLeft","css","BottomLeft","TopRight","BottomRight","undefined","exports","StyledContextMenuContentItem","_ref4","StyledContextMenuContentItemIconWrapper","StyledContextMenuContentItemText"],"sources":["../../../../src/components/context-menu/context-menu-content/ContextMenuContent.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport { ContextMenuAlignment } from '../constants/alignment';\n\ntype StyledMotionContextMenuContentProps = WithTheme<{\n position: ContextMenuAlignment;\n}>;\n\nexport const StyledMotionContextMenuContent = styled(\n motion.div\n)<StyledMotionContextMenuContentProps>`\n background-color: ${({ theme }: StyledMotionContextMenuContentProps) => theme['001']};\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);\n color: ${({ theme }: StyledMotionContextMenuContentProps) => theme.text};\n position: absolute;\n z-index: 0;\n\n ::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-bottom-right-radius: 3px;\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n\n ${({ position }) => {\n switch (position) {\n case ContextMenuAlignment.TopLeft:\n return css`\n bottom: -8px;\n right: 13px;\n transform: rotate(45deg);\n `;\n case ContextMenuAlignment.BottomLeft:\n return css`\n top: -8px;\n right: 13px;\n transform: rotate(225deg);\n `;\n case ContextMenuAlignment.TopRight:\n return css`\n transform: rotate(45deg);\n bottom: -8px;\n left: 13px;\n `;\n case ContextMenuAlignment.BottomRight:\n return css`\n transform: rotate(225deg);\n top: -8px;\n left: 13px;\n `;\n default:\n return undefined;\n }\n }}\n }\n\n ::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -1;\n }\n`;\n\ntype StyledContextMenuContentItemProps = WithTheme<unknown>;\n\nexport const StyledContextMenuContentItem = styled.div<StyledContextMenuContentItemProps>`\n cursor: pointer;\n display: flex;\n padding: 5px 8px 5px 5px;\n transition: background-color 0.3s ease;\n\n :hover {\n background-color: ${({ theme }: StyledContextMenuContentItemProps) =>\n theme['secondary-103']};\n }\n`;\n\nexport const StyledContextMenuContentItemIconWrapper = styled.div`\n flex: 0 0 auto;\n margin: 0 8px 0 3px;\n width: 20px;\n`;\n\nexport const StyledContextMenuContentItemText = styled.div`\n flex: 0 0 auto;\n white-space: nowrap;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAA8D,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,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AAA,GAAAA,gCAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export type DateInfoProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The date, that should be displayed
|
|
5
|
+
*/
|
|
6
|
+
date: Date | string;
|
|
7
|
+
/**
|
|
8
|
+
* Additional text for "shouldShowDateToNowDifference" prop. Writes a text before the calculated time
|
|
9
|
+
*/
|
|
10
|
+
preText?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Adds the current year to the display
|
|
13
|
+
*/
|
|
14
|
+
shouldShowThisYear?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Adds the time to the display.
|
|
17
|
+
* NOTE: The time is display with german text
|
|
18
|
+
*/
|
|
19
|
+
shouldShowTime?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the relative day of week to today should be shown (today, yesterday or tomorrow).
|
|
22
|
+
* NOTE: The text is only available in german
|
|
23
|
+
*/
|
|
24
|
+
shouldShowRelativeDayOfWeek?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Shortens the day and month text to maximum three digits
|
|
27
|
+
*/
|
|
28
|
+
shouldUseShortText?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Adds the day of week to the display
|
|
31
|
+
*/
|
|
32
|
+
shouldShowDayOfWeek?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Shows the difference from the date to now. The component handles updates itself.
|
|
35
|
+
* NOTE: This option is only available in german
|
|
36
|
+
*/
|
|
37
|
+
shouldShowDateToNowDifference?: boolean;
|
|
38
|
+
};
|
|
39
|
+
declare const DateInfo: FC<DateInfoProps>;
|
|
40
|
+
export default DateInfo;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _dateFns = require("date-fns");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _format = require("./utils/format");
|
|
10
|
+
var _language = require("./utils/language");
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
const DateInfo = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
date,
|
|
16
|
+
preText = '',
|
|
17
|
+
shouldShowThisYear,
|
|
18
|
+
shouldShowTime,
|
|
19
|
+
shouldShowRelativeDayOfWeek,
|
|
20
|
+
shouldUseShortText,
|
|
21
|
+
shouldShowDayOfWeek,
|
|
22
|
+
shouldShowDateToNowDifference
|
|
23
|
+
} = _ref;
|
|
24
|
+
const [formattedDate, setFormattedDate] = (0, _react.useState)(new Date(date));
|
|
25
|
+
const [formattedDateString, setFormattedDateString] = (0, _react.useState)('');
|
|
26
|
+
const [language] = (0, _react.useState)((0, _language.getLanguage)());
|
|
27
|
+
(0, _react.useEffect)(() => {
|
|
28
|
+
// This useEffect is used for normal date formation
|
|
29
|
+
if (shouldShowDateToNowDifference) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let newFormattedDateString = (0, _format.getFormattedDayOfWeek)({
|
|
33
|
+
shouldShowDayOfWeek,
|
|
34
|
+
shouldShowRelativeDayOfWeek,
|
|
35
|
+
shouldUseShortText,
|
|
36
|
+
date: formattedDate
|
|
37
|
+
});
|
|
38
|
+
let formatString = 'dd. ';
|
|
39
|
+
formatString += `${(0, _format.getMonthFormat)({
|
|
40
|
+
shouldUseShortText
|
|
41
|
+
})}`;
|
|
42
|
+
formatString += `${(0, _format.getYearFormat)({
|
|
43
|
+
date: formattedDate,
|
|
44
|
+
shouldShowThisYear
|
|
45
|
+
})}`;
|
|
46
|
+
newFormattedDateString += (0, _dateFns.format)(formattedDate, formatString, {
|
|
47
|
+
locale: language
|
|
48
|
+
});
|
|
49
|
+
newFormattedDateString += (0, _format.getFormattedTime)({
|
|
50
|
+
date: formattedDate,
|
|
51
|
+
shouldShowTime
|
|
52
|
+
});
|
|
53
|
+
setFormattedDateString(newFormattedDateString);
|
|
54
|
+
}, [date, formattedDate, language, shouldShowDateToNowDifference, shouldShowDayOfWeek, shouldShowRelativeDayOfWeek, shouldShowThisYear, shouldShowTime, shouldUseShortText]);
|
|
55
|
+
|
|
56
|
+
// Calculate remaining time till next minute to update time according to time left
|
|
57
|
+
const [currentDate, setCurrentDate] = (0, _react.useState)(new Date());
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
// This useEffect is for calculating the current date for shouldShowDateToNowDifference option
|
|
60
|
+
if (!shouldShowDateToNowDifference) {
|
|
61
|
+
return () => {};
|
|
62
|
+
}
|
|
63
|
+
let timeoutTime = formattedDate.getSeconds() - new Date().getSeconds();
|
|
64
|
+
|
|
65
|
+
// If the seconds of date are after seconds of current time, the timeoutTime has to be calculated differently
|
|
66
|
+
if (timeoutTime < 0) {
|
|
67
|
+
timeoutTime = 60 - new Date().getSeconds() + formattedDate.getSeconds();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// initialized with remaining time
|
|
71
|
+
let timeDiffInMs = formattedDate.getTime() - currentDate.getTime();
|
|
72
|
+
|
|
73
|
+
// set to elapsed time
|
|
74
|
+
if ((0, _dateFns.isPast)(formattedDate)) {
|
|
75
|
+
timeDiffInMs = currentDate.getTime() - formattedDate.getTime();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// time difference is less than a minute, time should be updated every second
|
|
79
|
+
if (timeDiffInMs < 60000) {
|
|
80
|
+
timeoutTime = 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Set timeoutTime to at least 1000ms
|
|
84
|
+
timeoutTime = Math.max(timeoutTime * 1000, 1000);
|
|
85
|
+
const timeout = setTimeout(() => {
|
|
86
|
+
setCurrentDate(new Date());
|
|
87
|
+
}, timeoutTime);
|
|
88
|
+
return () => {
|
|
89
|
+
clearTimeout(timeout);
|
|
90
|
+
};
|
|
91
|
+
}, [currentDate, date, formattedDate, shouldShowDateToNowDifference]);
|
|
92
|
+
(0, _react.useEffect)(() => {
|
|
93
|
+
// This useEffect is for showing the difference of the date to now
|
|
94
|
+
if (shouldShowDateToNowDifference) {
|
|
95
|
+
setFormattedDateString((0, _format.getTimeTillNow)({
|
|
96
|
+
date: formattedDate,
|
|
97
|
+
currentDate
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
}, [currentDate, date, formattedDate, shouldShowDateToNowDifference]);
|
|
101
|
+
(0, _react.useEffect)(() => {
|
|
102
|
+
setFormattedDate(new Date(date));
|
|
103
|
+
}, [date]);
|
|
104
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement("div", null, preText.trim(), " ", formattedDateString), [formattedDateString, preText]);
|
|
105
|
+
};
|
|
106
|
+
DateInfo.displayName = 'DateInfo';
|
|
107
|
+
var _default = DateInfo;
|
|
108
|
+
exports.default = _default;
|
|
109
|
+
//# sourceMappingURL=DateInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInfo.js","names":["_dateFns","require","_react","_interopRequireWildcard","_format","_language","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DateInfo","_ref","date","preText","shouldShowThisYear","shouldShowTime","shouldShowRelativeDayOfWeek","shouldUseShortText","shouldShowDayOfWeek","shouldShowDateToNowDifference","formattedDate","setFormattedDate","useState","Date","formattedDateString","setFormattedDateString","language","getLanguage","useEffect","newFormattedDateString","getFormattedDayOfWeek","formatString","getMonthFormat","getYearFormat","format","locale","getFormattedTime","currentDate","setCurrentDate","timeoutTime","getSeconds","timeDiffInMs","getTime","isPast","Math","max","timeout","setTimeout","clearTimeout","getTimeTillNow","useMemo","createElement","trim","displayName","_default","exports"],"sources":["../../../src/components/date-info/DateInfo.tsx"],"sourcesContent":["import { format, isPast } from 'date-fns';\nimport React, { FC, useEffect, useMemo, useState } from 'react';\nimport {\n getFormattedDayOfWeek,\n getFormattedTime,\n getMonthFormat,\n getTimeTillNow,\n getYearFormat,\n} from './utils/format';\nimport { getLanguage } from './utils/language';\n\nexport type DateInfoProps = {\n /**\n * The date, that should be displayed\n */\n date: Date | string;\n /**\n * Additional text for \"shouldShowDateToNowDifference\" prop. Writes a text before the calculated time\n */\n preText?: string;\n /**\n * Adds the current year to the display\n */\n shouldShowThisYear?: boolean;\n /**\n * Adds the time to the display.\n * NOTE: The time is display with german text\n */\n shouldShowTime?: boolean;\n /**\n * Whether the relative day of week to today should be shown (today, yesterday or tomorrow).\n * NOTE: The text is only available in german\n */\n shouldShowRelativeDayOfWeek?: boolean;\n /**\n * Shortens the day and month text to maximum three digits\n */\n shouldUseShortText?: boolean;\n /**\n * Adds the day of week to the display\n */\n shouldShowDayOfWeek?: boolean;\n /**\n * Shows the difference from the date to now. The component handles updates itself.\n * NOTE: This option is only available in german\n */\n shouldShowDateToNowDifference?: boolean;\n};\n\nconst DateInfo: FC<DateInfoProps> = ({\n date,\n preText = '',\n shouldShowThisYear,\n shouldShowTime,\n shouldShowRelativeDayOfWeek,\n shouldUseShortText,\n shouldShowDayOfWeek,\n shouldShowDateToNowDifference,\n}) => {\n const [formattedDate, setFormattedDate] = useState(new Date(date));\n const [formattedDateString, setFormattedDateString] = useState<string>('');\n const [language] = useState(getLanguage());\n\n useEffect(() => {\n // This useEffect is used for normal date formation\n if (shouldShowDateToNowDifference) {\n return;\n }\n\n let newFormattedDateString = getFormattedDayOfWeek({\n shouldShowDayOfWeek,\n shouldShowRelativeDayOfWeek,\n shouldUseShortText,\n date: formattedDate,\n });\n\n let formatString = 'dd. ';\n\n formatString += `${getMonthFormat({ shouldUseShortText })}`;\n\n formatString += `${getYearFormat({\n date: formattedDate,\n shouldShowThisYear,\n })}`;\n\n newFormattedDateString += format(formattedDate, formatString, { locale: language });\n\n newFormattedDateString += getFormattedTime({ date: formattedDate, shouldShowTime });\n\n setFormattedDateString(newFormattedDateString);\n }, [\n date,\n formattedDate,\n language,\n shouldShowDateToNowDifference,\n shouldShowDayOfWeek,\n shouldShowRelativeDayOfWeek,\n shouldShowThisYear,\n shouldShowTime,\n shouldUseShortText,\n ]);\n\n // Calculate remaining time till next minute to update time according to time left\n const [currentDate, setCurrentDate] = useState(new Date());\n\n useEffect(() => {\n // This useEffect is for calculating the current date for shouldShowDateToNowDifference option\n if (!shouldShowDateToNowDifference) {\n return () => {};\n }\n\n let timeoutTime = formattedDate.getSeconds() - new Date().getSeconds();\n\n // If the seconds of date are after seconds of current time, the timeoutTime has to be calculated differently\n if (timeoutTime < 0) {\n timeoutTime = 60 - new Date().getSeconds() + formattedDate.getSeconds();\n }\n\n // initialized with remaining time\n let timeDiffInMs = formattedDate.getTime() - currentDate.getTime();\n\n // set to elapsed time\n if (isPast(formattedDate)) {\n timeDiffInMs = currentDate.getTime() - formattedDate.getTime();\n }\n\n // time difference is less than a minute, time should be updated every second\n if (timeDiffInMs < 60000) {\n timeoutTime = 1;\n }\n\n // Set timeoutTime to at least 1000ms\n timeoutTime = Math.max(timeoutTime * 1000, 1000);\n\n const timeout = setTimeout(() => {\n setCurrentDate(new Date());\n }, timeoutTime);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [currentDate, date, formattedDate, shouldShowDateToNowDifference]);\n\n useEffect(() => {\n // This useEffect is for showing the difference of the date to now\n if (shouldShowDateToNowDifference) {\n setFormattedDateString(getTimeTillNow({ date: formattedDate, currentDate }));\n }\n }, [currentDate, date, formattedDate, shouldShowDateToNowDifference]);\n\n useEffect(() => {\n setFormattedDate(new Date(date));\n }, [date]);\n\n return useMemo(\n () => (\n <div>\n {preText.trim()} {formattedDateString}\n </div>\n ),\n [formattedDateString, preText]\n );\n};\n\nDateInfo.displayName = 'DateInfo';\n\nexport default DateInfo;\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAOA,IAAAI,SAAA,GAAAJ,OAAA;AAA+C,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC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Q;AAAA6C,OAAA,CAAA5D,OAAA,GAAA2D,QAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface GetFormattedYearOptions {
|
|
2
|
+
date: Date;
|
|
3
|
+
shouldShowThisYear?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const getYearFormat: ({ date, shouldShowThisYear }: GetFormattedYearOptions) => "" | " yyyy";
|
|
6
|
+
interface GetFormattedMonthOptions {
|
|
7
|
+
shouldUseShortText?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const getMonthFormat: ({ shouldUseShortText }: GetFormattedMonthOptions) => "LLL." | "LLLL";
|
|
10
|
+
interface GetFormattedDayOfWeekOptions {
|
|
11
|
+
shouldShowDayOfWeek?: boolean;
|
|
12
|
+
shouldShowRelativeDayOfWeek?: boolean;
|
|
13
|
+
shouldUseShortText?: boolean;
|
|
14
|
+
date: Date;
|
|
15
|
+
}
|
|
16
|
+
export declare const getFormattedDayOfWeek: ({ shouldShowRelativeDayOfWeek, shouldShowDayOfWeek, shouldUseShortText, date, }: GetFormattedDayOfWeekOptions) => string;
|
|
17
|
+
interface GetFormattedTimeOptions {
|
|
18
|
+
shouldShowTime?: boolean;
|
|
19
|
+
date: Date;
|
|
20
|
+
}
|
|
21
|
+
export declare const getFormattedTime: ({ shouldShowTime, date }: GetFormattedTimeOptions) => string;
|
|
22
|
+
export interface Time {
|
|
23
|
+
value: number;
|
|
24
|
+
type: TimeType;
|
|
25
|
+
isPast: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare enum TimeType {
|
|
28
|
+
Seconds = 0,
|
|
29
|
+
Minutes = 1,
|
|
30
|
+
Hours = 2,
|
|
31
|
+
Days = 3,
|
|
32
|
+
Weeks = 4,
|
|
33
|
+
Months = 5,
|
|
34
|
+
Years = 6
|
|
35
|
+
}
|
|
36
|
+
interface GetTimeTillNowOptions {
|
|
37
|
+
date: Date;
|
|
38
|
+
currentDate: Date;
|
|
39
|
+
}
|
|
40
|
+
export declare const getTimeTillNow: ({ date, currentDate }: GetTimeTillNowOptions) => string;
|
|
41
|
+
export declare const getFormattedPastTimeString: (time: Time) => string;
|
|
42
|
+
export declare const getFormattedFutureTimeString: (time: Time) => string;
|
|
43
|
+
export {};
|