@onewelcome/react-lib-components 13.3.0-alpha.2 → 13.4.0-experminent.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.es.js +5 -5
- package/dist/components/Button/BaseButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/BaseButton.module.scss.es.js +4 -4
- package/dist/components/Button/Button.module.scss.cjs.js +2 -2
- package/dist/components/Button/Button.module.scss.es.js +17 -17
- package/dist/components/Button/IconButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/IconButton.module.scss.es.js +18 -18
- package/dist/components/ContextMenu/ContextMenu.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.module.scss.es.js +6 -6
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.es.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.es.js +3 -3
- package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -8
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.es.js +6 -6
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.es.js +7 -7
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.es.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.es.js +4 -4
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.es.js +24 -24
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.es.js +9 -9
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js +4 -27
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +2 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.es.js +10 -10
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.es.js +17 -17
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +4 -4
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js +11 -11
- package/dist/components/DatePicker/DatePicker.module.scss.cjs.js +2 -2
- package/dist/components/DatePicker/DatePicker.module.scss.es.js +31 -31
- package/dist/components/Form/Checkbox/Checkbox.module.scss.cjs.js +2 -2
- package/dist/components/Form/Checkbox/Checkbox.module.scss.es.js +13 -13
- package/dist/components/Form/Fieldset/Fieldset.module.scss.cjs.js +2 -2
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js +6 -6
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.es.js +18 -18
- package/dist/components/Form/FileUpload/FileUpload.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileUpload.module.scss.es.js +16 -16
- package/dist/components/Form/Form.module.scss.cjs.js +2 -2
- package/dist/components/Form/Form.module.scss.es.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.es.js +13 -13
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js +6 -6
- package/dist/components/Form/FormGroup/FormGroup.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormGroup/FormGroup.module.scss.es.js +3 -3
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.es.js +4 -4
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.es.js +6 -6
- package/dist/components/Form/Input/Input.cjs.js +1 -1
- package/dist/components/Form/Input/Input.cjs.js.map +1 -1
- package/dist/components/Form/Input/Input.es.js +46 -4
- package/dist/components/Form/Input/Input.es.js.map +1 -1
- package/dist/components/Form/Input/Input.module.scss.cjs.js +2 -2
- package/dist/components/Form/Input/Input.module.scss.es.js +8 -8
- package/dist/components/Form/Label/Label.module.scss.cjs.js +2 -2
- package/dist/components/Form/Label/Label.module.scss.es.js +2 -2
- package/dist/components/Form/Radio/Radio.module.scss.cjs.js +2 -2
- package/dist/components/Form/Radio/Radio.module.scss.es.js +11 -11
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js +5 -4
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js +93 -74
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js +20 -18
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.es.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.es.js +4 -4
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js +57 -3
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js +66 -82
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.cjs.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.es.js +6 -6
- package/dist/components/Form/Select/SingleSelect/Option.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.es.js +73 -67
- package/dist/components/Form/Select/SingleSelect/Select.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js +21 -20
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js +62 -3
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js +43 -61
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.es.js +6 -5
- package/dist/components/Form/Select/useAddNewBtn.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/useAddNewBtn.module.scss.es.js +4 -4
- package/dist/components/Form/Select/useBaseSearch.cjs.js +2 -0
- package/dist/components/Form/Select/useBaseSearch.cjs.js.map +1 -0
- package/dist/components/Form/Select/useBaseSearch.es.js +85 -0
- package/dist/components/Form/Select/useBaseSearch.es.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.module.scss.cjs.js +2 -2
- package/dist/components/Form/Textarea/Textarea.module.scss.es.js +6 -6
- package/dist/components/Form/Toggle/Toggle.module.scss.cjs.js +2 -2
- package/dist/components/Form/Toggle/Toggle.module.scss.es.js +18 -18
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.es.js +8 -8
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.es.js +6 -6
- package/dist/components/Icon/Icon.module.scss.cjs.js +2 -2
- package/dist/components/Icon/Icon.module.scss.es.js +108 -108
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js +10 -10
- package/dist/components/Layout/Card/Card.module.scss.cjs.js +2 -2
- package/dist/components/Layout/Card/Card.module.scss.es.js +12 -12
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +19 -19
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.es.js +4 -4
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.es.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.es.js +3 -3
- package/dist/components/Link/Link.module.scss.cjs.js +2 -2
- package/dist/components/Link/Link.module.scss.es.js +17 -17
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.es.js +11 -11
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.es.js +22 -22
- package/dist/components/Notifications/Banner/Banner.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Banner/Banner.module.scss.es.js +9 -9
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.es.js +5 -5
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.es.js +4 -4
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.es.js +6 -6
- package/dist/components/Notifications/Dialog/Dialog.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/Dialog.module.scss.es.js +4 -4
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.es.js +3 -3
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.es.js +10 -10
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.es.js +13 -13
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.es.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.es.js +10 -10
- package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
- package/dist/components/Pagination/Pagination.module.scss.es.js +15 -15
- package/dist/components/Popover/Popover.module.scss.cjs.js +2 -2
- package/dist/components/Popover/Popover.module.scss.es.js +3 -3
- package/dist/components/ProgressBar/ProgressBar.module.scss.cjs.js +2 -2
- package/dist/components/ProgressBar/ProgressBar.module.scss.es.js +9 -9
- package/dist/components/Skeleton/Skeleton.module.scss.cjs.js +2 -2
- package/dist/components/Skeleton/Skeleton.module.scss.es.js +5 -5
- package/dist/components/Spinner/Spinner.module.scss.cjs.js +2 -2
- package/dist/components/Spinner/Spinner.module.scss.es.js +3 -3
- package/dist/components/Stepper/Step.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Step.module.scss.es.js +22 -22
- package/dist/components/Stepper/Stepper.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Stepper.module.scss.es.js +4 -4
- package/dist/components/Tabs/Tab.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tab.module.scss.es.js +3 -3
- package/dist/components/Tabs/TabButton.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/TabButton.module.scss.es.js +12 -12
- package/dist/components/Tabs/Tabs.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tabs.module.scss.es.js +10 -10
- package/dist/components/Tag/RemoveButton.module.scss.cjs.js +2 -2
- package/dist/components/Tag/RemoveButton.module.scss.es.js +3 -3
- package/dist/components/Tag/Tag.cjs.js +1 -1
- package/dist/components/Tag/Tag.cjs.js.map +1 -1
- package/dist/components/Tag/Tag.es.js +7 -1
- package/dist/components/Tag/Tag.es.js.map +1 -1
- package/dist/components/Tag/Tag.module.scss.cjs.js +2 -2
- package/dist/components/Tag/Tag.module.scss.es.js +6 -6
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.cjs.js +2 -2
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.es.js +3 -3
- package/dist/components/Tiles/Tile.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tile.module.scss.es.js +8 -8
- package/dist/components/Tiles/Tiles.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tiles.module.scss.es.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.cjs.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.es.js +28 -28
- package/dist/components/Typography/Typography.module.scss.cjs.js +2 -2
- package/dist/components/Typography/Typography.module.scss.es.js +13 -13
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.es.js +5 -5
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.es.js +14 -14
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.es.js +3 -3
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.es.js +7 -7
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.es.js +13 -13
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
- package/dist/hooks/useClickOutside.cjs.js +1 -1
- package/dist/hooks/useClickOutside.cjs.js.map +1 -1
- package/dist/hooks/useClickOutside.es.js +1 -1
- package/dist/hooks/useClickOutside.es.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.es.js +8 -1
- package/dist/hooks/useDebouncedCallback.es.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/readyclasses.module.scss.cjs.js +2 -2
- package/dist/readyclasses.module.scss.es.js +5 -5
- package/dist/util/helper.cjs.js +1 -1
- package/dist/util/helper.cjs.js.map +1 -1
- package/dist/util/helper.es.js +19 -0
- package/dist/util/helper.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var a=document.createElement("style");a.appendChild(document.createTextNode('.TopNavBar_sr-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var a=document.createElement("style");a.appendChild(document.createTextNode('.TopNavBar_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.TopNavBar_hidden_MD9ir{display:none}.TopNavBar_slide-in_MD9ir{animation:TopNavBar_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.TopNavBar_slide-in_MD9ir{animation-duration:.1ms}}.TopNavBar_slide-out_MD9ir{animation:TopNavBar_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.TopNavBar_slide-out_MD9ir{animation-duration:.1ms}}@keyframes TopNavBar_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes TopNavBar_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.TopNavBar_topnavbar_MD9ir{position:sticky;top:0;left:0;z-index:3;width:100%;display:flex;align-items:center;height:4rem;padding:0 .75rem 0 0;background-color:var(--sidenavbar-background);box-shadow:0 2px 4px #0105320a,0 4px 5px #0105320a,0 1px 10px #01053214;--font-size: .875rem;flex-wrap:nowrap}.TopNavBar_topnavbar_MD9ir .TopNavBar_left-section_MD9ir{flex-shrink:0;display:flex;align-items:center}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-link_MD9ir{display:flex;align-items:center;text-decoration:none}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir{display:flex;align-items:center}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo-small_MD9ir{height:2.5rem;display:flex;align-items:center;margin:0 1rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{display:none}@media screen and (min-width:30em){.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo-small_MD9ir{display:none;height:0}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{display:block;margin-left:1rem}}@media screen and (min-width:30em)and (min-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{margin-left:.75rem;margin-right:0}}.TopNavBar_topnavbar_MD9ir .TopNavBar_sr-only_MD9ir{position:absolute;margin:-1px;height:1px;width:1px;overflow:hidden}.TopNavBar_topnavbar_MD9ir .TopNavBar_separator_MD9ir{border:none;width:1px;height:2.5rem;background-color:#dedee6;flex-shrink:0;align-self:center;margin:0 3rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_middle-section_MD9ir{flex:1;display:flex;align-items:center;min-width:0;margin-left:6.0625rem}@media screen and (max-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_middle-section_MD9ir{margin-left:0}}.TopNavBar_topnavbar_MD9ir .TopNavBar_separator_MD9ir+.TopNavBar_middle-section_MD9ir{margin-left:0}.TopNavBar_topnavbar_MD9ir .TopNavBar_right-section_MD9ir{display:flex;align-items:center;margin-left:auto;justify-content:flex-end;gap:1rem;padding-left:1rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir{flex-shrink:0;margin-left:.75rem;display:none;--font-size: 1rem}@media screen and (max-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir{display:initial}}.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir.TopNavBar_menu--collapsed_MD9ir{display:initial}')),document.head.appendChild(a)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="TopNavBar_topnavbar_MD9ir",r="TopNavBar_logo_MD9ir",a="TopNavBar_separator_MD9ir",e={"sr-only":"TopNavBar_sr-only_MD9ir",topnavbar:o,"left-section":"TopNavBar_left-section_MD9ir","logo-link":"TopNavBar_logo-link_MD9ir","logo-container":"TopNavBar_logo-container_MD9ir","logo-small":"TopNavBar_logo-small_MD9ir",logo:r,separator:a,"middle-section":"TopNavBar_middle-section_MD9ir","right-section":"TopNavBar_right-section_MD9ir","menu-button":"TopNavBar_menu-button_MD9ir","menu--collapsed":"TopNavBar_menu--collapsed_MD9ir"};exports.default=e,exports.logo=r,exports.separator=a,exports.topnavbar=o;
|
|
3
3
|
//# sourceMappingURL=TopNavBar.module.scss.cjs.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var a=document.createElement("style");a.appendChild(document.createTextNode('.TopNavBar_sr-
|
|
2
|
-
const topnavbar = "
|
|
3
|
-
const logo = "
|
|
4
|
-
const separator = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var a=document.createElement("style");a.appendChild(document.createTextNode('.TopNavBar_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.TopNavBar_hidden_MD9ir{display:none}.TopNavBar_slide-in_MD9ir{animation:TopNavBar_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.TopNavBar_slide-in_MD9ir{animation-duration:.1ms}}.TopNavBar_slide-out_MD9ir{animation:TopNavBar_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.TopNavBar_slide-out_MD9ir{animation-duration:.1ms}}@keyframes TopNavBar_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes TopNavBar_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.TopNavBar_topnavbar_MD9ir{position:sticky;top:0;left:0;z-index:3;width:100%;display:flex;align-items:center;height:4rem;padding:0 .75rem 0 0;background-color:var(--sidenavbar-background);box-shadow:0 2px 4px #0105320a,0 4px 5px #0105320a,0 1px 10px #01053214;--font-size: .875rem;flex-wrap:nowrap}.TopNavBar_topnavbar_MD9ir .TopNavBar_left-section_MD9ir{flex-shrink:0;display:flex;align-items:center}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-link_MD9ir{display:flex;align-items:center;text-decoration:none}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir{display:flex;align-items:center}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo-small_MD9ir{height:2.5rem;display:flex;align-items:center;margin:0 1rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{display:none}@media screen and (min-width:30em){.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo-small_MD9ir{display:none;height:0}.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{display:block;margin-left:1rem}}@media screen and (min-width:30em)and (min-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_logo-container_MD9ir .TopNavBar_logo_MD9ir{margin-left:.75rem;margin-right:0}}.TopNavBar_topnavbar_MD9ir .TopNavBar_sr-only_MD9ir{position:absolute;margin:-1px;height:1px;width:1px;overflow:hidden}.TopNavBar_topnavbar_MD9ir .TopNavBar_separator_MD9ir{border:none;width:1px;height:2.5rem;background-color:#dedee6;flex-shrink:0;align-self:center;margin:0 3rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_middle-section_MD9ir{flex:1;display:flex;align-items:center;min-width:0;margin-left:6.0625rem}@media screen and (max-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_middle-section_MD9ir{margin-left:0}}.TopNavBar_topnavbar_MD9ir .TopNavBar_separator_MD9ir+.TopNavBar_middle-section_MD9ir{margin-left:0}.TopNavBar_topnavbar_MD9ir .TopNavBar_right-section_MD9ir{display:flex;align-items:center;margin-left:auto;justify-content:flex-end;gap:1rem;padding-left:1rem}.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir{flex-shrink:0;margin-left:.75rem;display:none;--font-size: 1rem}@media screen and (max-width:50em){.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir{display:initial}}.TopNavBar_topnavbar_MD9ir .TopNavBar_menu-button_MD9ir.TopNavBar_menu--collapsed_MD9ir{display:initial}')),document.head.appendChild(a)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
const topnavbar = "TopNavBar_topnavbar_MD9ir";
|
|
3
|
+
const logo = "TopNavBar_logo_MD9ir";
|
|
4
|
+
const separator = "TopNavBar_separator_MD9ir";
|
|
5
5
|
const classes = {
|
|
6
|
-
"sr-only": "TopNavBar_sr-
|
|
6
|
+
"sr-only": "TopNavBar_sr-only_MD9ir",
|
|
7
7
|
topnavbar,
|
|
8
|
-
"left-section": "TopNavBar_left-
|
|
9
|
-
"logo-link": "TopNavBar_logo-
|
|
10
|
-
"logo-container": "TopNavBar_logo-
|
|
11
|
-
"logo-small": "TopNavBar_logo-
|
|
8
|
+
"left-section": "TopNavBar_left-section_MD9ir",
|
|
9
|
+
"logo-link": "TopNavBar_logo-link_MD9ir",
|
|
10
|
+
"logo-container": "TopNavBar_logo-container_MD9ir",
|
|
11
|
+
"logo-small": "TopNavBar_logo-small_MD9ir",
|
|
12
12
|
logo,
|
|
13
13
|
separator,
|
|
14
|
-
"middle-section": "TopNavBar_middle-
|
|
15
|
-
"right-section": "TopNavBar_right-
|
|
16
|
-
"menu-button": "TopNavBar_menu-
|
|
17
|
-
"menu--collapsed": "TopNavBar_menu--
|
|
14
|
+
"middle-section": "TopNavBar_middle-section_MD9ir",
|
|
15
|
+
"right-section": "TopNavBar_right-section_MD9ir",
|
|
16
|
+
"menu-button": "TopNavBar_menu-button_MD9ir",
|
|
17
|
+
"menu--collapsed": "TopNavBar_menu--collapsed_MD9ir"
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
20
|
classes as default,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.IdentityProviderButton_sr-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default={"idp-button":"IdentityProviderButton_idp-
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.IdentityProviderButton_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.IdentityProviderButton_hidden_MD9ir{display:none}.IdentityProviderButton_slide-in_MD9ir{animation:IdentityProviderButton_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.IdentityProviderButton_slide-in_MD9ir{animation-duration:.1ms}}.IdentityProviderButton_slide-out_MD9ir{animation:IdentityProviderButton_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.IdentityProviderButton_slide-out_MD9ir{animation-duration:.1ms}}@keyframes IdentityProviderButton_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes IdentityProviderButton_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.IdentityProviderButton_idp-button_MD9ir{width:100%}.IdentityProviderButton_idp-button--with-icon_MD9ir{display:flex;align-items:center;justify-content:center;gap:.5rem;margin-top:-.125rem;margin-bottom:-.125rem}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default={"idp-button":"IdentityProviderButton_idp-button_MD9ir","idp-button--with-icon":"IdentityProviderButton_idp-button--with-icon_MD9ir"};
|
|
3
3
|
//# sourceMappingURL=IdentityProviderButton.module.scss.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.IdentityProviderButton_sr-
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.IdentityProviderButton_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.IdentityProviderButton_hidden_MD9ir{display:none}.IdentityProviderButton_slide-in_MD9ir{animation:IdentityProviderButton_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.IdentityProviderButton_slide-in_MD9ir{animation-duration:.1ms}}.IdentityProviderButton_slide-out_MD9ir{animation:IdentityProviderButton_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.IdentityProviderButton_slide-out_MD9ir{animation-duration:.1ms}}@keyframes IdentityProviderButton_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes IdentityProviderButton_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.IdentityProviderButton_idp-button_MD9ir{width:100%}.IdentityProviderButton_idp-button--with-icon_MD9ir{display:flex;align-items:center;justify-content:center;gap:.5rem;margin-top:-.125rem;margin-bottom:-.125rem}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
2
|
const classes = {
|
|
3
|
-
"idp-button": "IdentityProviderButton_idp-
|
|
4
|
-
"idp-button--with-icon": "IdentityProviderButton_idp-button--with-
|
|
3
|
+
"idp-button": "IdentityProviderButton_idp-button_MD9ir",
|
|
4
|
+
"idp-button--with-icon": "IdentityProviderButton_idp-button--with-icon_MD9ir"
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
7
|
classes as default
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useClickOutside=(t,i,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useClickOutside=(t,i,o)=>{function c(e){const o=null==t?void 0:t.current;o&&(e.composedPath().includes(o)||i(e))}e.useEffect(()=>(setTimeout(()=>window.addEventListener("click",c)),()=>{setTimeout(()=>window.removeEventListener("click",c))}),o)};
|
|
2
2
|
//# sourceMappingURL=useClickOutside.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.cjs.js","sources":["../../src/hooks/useClickOutside.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyList, useEffect } from \"react\";\n\nexport const useClickOutside = (\n myElementRef: React.RefObject<HTMLElement>,\n onClickOutside: (event: MouseEvent) => void,\n dependencies?: DependencyList\n) => {\n function eventListener(event: MouseEvent) {\n const myElement = myElementRef?.current;\n if (!myElement) {\n return;\n }\n const clickedInsideMyElement =
|
|
1
|
+
{"version":3,"file":"useClickOutside.cjs.js","sources":["../../src/hooks/useClickOutside.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyList, useEffect } from \"react\";\n\nexport const useClickOutside = (\n myElementRef: React.RefObject<HTMLElement>,\n onClickOutside: (event: MouseEvent) => void,\n dependencies?: DependencyList\n) => {\n function eventListener(event: MouseEvent) {\n const myElement = myElementRef?.current;\n if (!myElement) {\n return;\n }\n const clickedInsideMyElement = event.composedPath().includes(myElement);\n\n if (!clickedInsideMyElement) {\n onClickOutside(event);\n }\n }\n useEffect(() => {\n setTimeout(() => window.addEventListener(\"click\", eventListener));\n\n return () => {\n setTimeout(() => window.removeEventListener(\"click\", eventListener));\n };\n }, dependencies);\n};\n"],"names":["myElementRef","onClickOutside","dependencies","eventListener","event","myElement","current","composedPath","includes","useEffect","setTimeout","window","addEventListener","removeEventListener"],"mappings":"iIAkB+B,CAC7BA,EACAC,EACAC,KAEA,SAASC,EAAcC,GACrB,MAAMC,EAAY,MAAAL,OAAA,EAAAA,EAAcM,QAC3BD,IAG0BD,EAAMG,eAAeC,SAASH,IAG3DJ,EAAeG,GAEnB,CACAK,EAAAA,UAAU,KACRC,WAAW,IAAMC,OAAOC,iBAAiB,QAAST,IAE3C,KACLO,WAAW,IAAMC,OAAOE,oBAAoB,QAASV,MAEtDD"}
|
|
@@ -5,7 +5,7 @@ const useClickOutside = (myElementRef, onClickOutside, dependencies) => {
|
|
|
5
5
|
if (!myElement) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
-
const clickedInsideMyElement =
|
|
8
|
+
const clickedInsideMyElement = event.composedPath().includes(myElement);
|
|
9
9
|
if (!clickedInsideMyElement) {
|
|
10
10
|
onClickOutside(event);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.es.js","sources":["../../src/hooks/useClickOutside.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyList, useEffect } from \"react\";\n\nexport const useClickOutside = (\n myElementRef: React.RefObject<HTMLElement>,\n onClickOutside: (event: MouseEvent) => void,\n dependencies?: DependencyList\n) => {\n function eventListener(event: MouseEvent) {\n const myElement = myElementRef?.current;\n if (!myElement) {\n return;\n }\n const clickedInsideMyElement =
|
|
1
|
+
{"version":3,"file":"useClickOutside.es.js","sources":["../../src/hooks/useClickOutside.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyList, useEffect } from \"react\";\n\nexport const useClickOutside = (\n myElementRef: React.RefObject<HTMLElement>,\n onClickOutside: (event: MouseEvent) => void,\n dependencies?: DependencyList\n) => {\n function eventListener(event: MouseEvent) {\n const myElement = myElementRef?.current;\n if (!myElement) {\n return;\n }\n const clickedInsideMyElement = event.composedPath().includes(myElement);\n\n if (!clickedInsideMyElement) {\n onClickOutside(event);\n }\n }\n useEffect(() => {\n setTimeout(() => window.addEventListener(\"click\", eventListener));\n\n return () => {\n setTimeout(() => window.removeEventListener(\"click\", eventListener));\n };\n }, dependencies);\n};\n"],"names":[],"mappings":";AAkBO,MAAM,kBAAkB,CAC7B,cACA,gBACA,iBACG;AACH,WAAS,cAAc,OAAmB;AACxC,UAAM,YAAY,6CAAc;AAChC,QAAI,CAAC,WAAW;AACd;AAAA,IACF;AACA,UAAM,yBAAyB,MAAM,aAAA,EAAe,SAAS,SAAS;AAEtE,QAAI,CAAC,wBAAwB;AAC3B,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF;AACA,YAAU,MAAM;AACd,eAAW,MAAM,OAAO,iBAAiB,SAAS,aAAa,CAAC;AAEhE,WAAO,MAAM;AACX,iBAAW,MAAM,OAAO,oBAAoB,SAAS,aAAa,CAAC;AAAA,IACrE;AAAA,EACF,GAAG,YAAY;AACjB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useDebouncedCallback=(r,t,u)=>{const c=e.useRef(),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useDebouncedCallback=(r,t,u)=>{const c=e.useRef(),l=u?[r,t,...u]:[r,t],n=e.useCallback((...e)=>{null!=c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{r(...e)},t)},l),a=e.useCallback(()=>{null!=c.current&&(clearTimeout(c.current),c.current=void 0)},[]);return Object.assign(n,{cancel:a})};
|
|
2
2
|
//# sourceMappingURL=useDebouncedCallback.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebouncedCallback.cjs.js","sources":["../../src/hooks/useDebouncedCallback.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const useDebouncedCallback = <T extends unknown[]>(\n callback: (...args: T) => void,\n delay: number,\n dependencies?: React.DependencyList\n) => {\n const timeout = React.useRef<ReturnType<typeof setTimeout>>();\n const comboDeps = dependencies ? [callback, delay, ...dependencies] : [callback, delay];\n\n
|
|
1
|
+
{"version":3,"file":"useDebouncedCallback.cjs.js","sources":["../../src/hooks/useDebouncedCallback.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const useDebouncedCallback = <T extends unknown[]>(\n callback: (...args: T) => void,\n delay: number,\n dependencies?: React.DependencyList\n) => {\n const timeout = React.useRef<ReturnType<typeof setTimeout>>();\n const comboDeps = dependencies ? [callback, delay, ...dependencies] : [callback, delay];\n\n const debounced = React.useCallback((...args: T) => {\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n }\n\n timeout.current = setTimeout(() => {\n callback(...args);\n }, delay);\n }, comboDeps);\n\n const cancel = React.useCallback(() => {\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = undefined;\n }\n }, []);\n\n return Object.assign(debounced, { cancel });\n};\n"],"names":["callback","delay","dependencies","timeout","React","useRef","comboDeps","debounced","useCallback","args","current","clearTimeout","setTimeout","cancel","Object","assign"],"mappings":"sIAkBoC,CAClCA,EACAC,EACAC,KAEA,MAAMC,EAAUC,EAAMC,SAChBC,EAAYJ,EAAe,CAACF,EAAUC,KAAUC,GAAgB,CAACF,EAAUC,GAE3EM,EAAYH,EAAMI,YAAY,IAAIC,KACf,MAAnBN,EAAQO,SACVC,aAAaR,EAAQO,SAGvBP,EAAQO,QAAUE,WAAW,KAC3BZ,KAAYS,IACXR,IACFK,GAEGO,EAAST,EAAMI,YAAY,KACR,MAAnBL,EAAQO,UACVC,aAAaR,EAAQO,SACrBP,EAAQO,aAAU,IAEnB,IAEH,OAAOI,OAAOC,OAAOR,EAAW,CAAEM"}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
const useDebouncedCallback = (callback, delay, dependencies) => {
|
|
3
3
|
const timeout = React.useRef();
|
|
4
4
|
const comboDeps = dependencies ? [callback, delay, ...dependencies] : [callback, delay];
|
|
5
|
-
|
|
5
|
+
const debounced = React.useCallback((...args) => {
|
|
6
6
|
if (timeout.current != null) {
|
|
7
7
|
clearTimeout(timeout.current);
|
|
8
8
|
}
|
|
@@ -10,6 +10,13 @@ const useDebouncedCallback = (callback, delay, dependencies) => {
|
|
|
10
10
|
callback(...args);
|
|
11
11
|
}, delay);
|
|
12
12
|
}, comboDeps);
|
|
13
|
+
const cancel = React.useCallback(() => {
|
|
14
|
+
if (timeout.current != null) {
|
|
15
|
+
clearTimeout(timeout.current);
|
|
16
|
+
timeout.current = void 0;
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
return Object.assign(debounced, { cancel });
|
|
13
20
|
};
|
|
14
21
|
export {
|
|
15
22
|
useDebouncedCallback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebouncedCallback.es.js","sources":["../../src/hooks/useDebouncedCallback.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const useDebouncedCallback = <T extends unknown[]>(\n callback: (...args: T) => void,\n delay: number,\n dependencies?: React.DependencyList\n) => {\n const timeout = React.useRef<ReturnType<typeof setTimeout>>();\n const comboDeps = dependencies ? [callback, delay, ...dependencies] : [callback, delay];\n\n
|
|
1
|
+
{"version":3,"file":"useDebouncedCallback.es.js","sources":["../../src/hooks/useDebouncedCallback.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nexport const useDebouncedCallback = <T extends unknown[]>(\n callback: (...args: T) => void,\n delay: number,\n dependencies?: React.DependencyList\n) => {\n const timeout = React.useRef<ReturnType<typeof setTimeout>>();\n const comboDeps = dependencies ? [callback, delay, ...dependencies] : [callback, delay];\n\n const debounced = React.useCallback((...args: T) => {\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n }\n\n timeout.current = setTimeout(() => {\n callback(...args);\n }, delay);\n }, comboDeps);\n\n const cancel = React.useCallback(() => {\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = undefined;\n }\n }, []);\n\n return Object.assign(debounced, { cancel });\n};\n"],"names":[],"mappings":";AAkBO,MAAM,uBAAuB,CAClC,UACA,OACA,iBACG;AACH,QAAM,UAAU,MAAM,OAAA;AACtB,QAAM,YAAY,eAAe,CAAC,UAAU,OAAO,GAAG,YAAY,IAAI,CAAC,UAAU,KAAK;AAEtF,QAAM,YAAY,MAAM,YAAY,IAAI,SAAY;AAClD,QAAI,QAAQ,WAAW,MAAM;AAC3B,mBAAa,QAAQ,OAAO;AAAA,IAC9B;AAEA,YAAQ,UAAU,WAAW,MAAM;AACjC,eAAS,GAAG,IAAI;AAAA,IAClB,GAAG,KAAK;AAAA,EACV,GAAG,SAAS;AAEZ,QAAM,SAAS,MAAM,YAAY,MAAM;AACrC,QAAI,QAAQ,WAAW,MAAM;AAC3B,mBAAa,QAAQ,OAAO;AAC5B,cAAQ,UAAU;AAAA,IACpB;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,SAAO,OAAO,OAAO,WAAW,EAAE,QAAQ;AAC5C;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -519,8 +519,7 @@ export declare interface DataGridColumnMetadata {
|
|
|
519
519
|
valueSelectType?: ValueSelectType;
|
|
520
520
|
/**
|
|
521
521
|
* Enables backend value search for this column. When provided, `defaultValues` is treated as
|
|
522
|
-
* the initial page only
|
|
523
|
-
* further fetches as the user types (wiring lands in a follow-up task).
|
|
522
|
+
* the initial page only, and the value select fetches further pages as the user types/scrolls.
|
|
524
523
|
*/
|
|
525
524
|
onValueSearch?: (query: string) => void;
|
|
526
525
|
/** Called to fetch the next page of values once the user reaches the end of the loaded list. */
|
|
@@ -532,9 +531,8 @@ export declare interface DataGridColumnMetadata {
|
|
|
532
531
|
/** Minimum query length required before `onValueSearch` is invoked. */
|
|
533
532
|
minValueSearchLength?: number;
|
|
534
533
|
/**
|
|
535
|
-
* Resolves display labels for saved values
|
|
536
|
-
*
|
|
537
|
-
* value select can show a meaningful label instead of falling back to the raw value.
|
|
534
|
+
* Resolves display labels for saved values not present in the currently loaded page (e.g. from
|
|
535
|
+
* a previously saved filter), used in EDIT mode to show a label instead of the raw value.
|
|
538
536
|
*/
|
|
539
537
|
resolveValueLabels?: (values: string[]) => {
|
|
540
538
|
value: string;
|
|
@@ -1644,10 +1642,8 @@ export declare interface TagProps extends Omit<HTMLAttributes<HTMLDivElement>, "
|
|
|
1644
1642
|
icon?: Icons;
|
|
1645
1643
|
backgroundColor?: string;
|
|
1646
1644
|
color?: string;
|
|
1647
|
-
/**
|
|
1648
|
-
*
|
|
1649
|
-
* The remove button's accessible label falls back to just `removeLabel` when `children` isn't
|
|
1650
|
-
* a plain string, since a `ReactNode` can't be safely concatenated into announcement text. */
|
|
1645
|
+
/** Accepts non-string content. When `removeButton.label` isn't set, RemoveButton's accessible
|
|
1646
|
+
* label falls back to `children` only if it's a plain string, otherwise just `removeLabel`. */
|
|
1651
1647
|
children?: ReactNode;
|
|
1652
1648
|
shape?: "rounded" | "sharp";
|
|
1653
1649
|
removeButton?: Props_7;
|
|
@@ -1795,7 +1791,9 @@ export declare const useAlert: () => {
|
|
|
1795
1791
|
|
|
1796
1792
|
export declare const useClickOutside: (myElementRef: React.RefObject<HTMLElement>, onClickOutside: (event: MouseEvent) => void, dependencies?: DependencyList) => void;
|
|
1797
1793
|
|
|
1798
|
-
export declare const useDebouncedCallback: <T extends unknown[]>(callback: (...args: T) => void, delay: number, dependencies?: default_2.DependencyList) => (...args: T) => void
|
|
1794
|
+
export declare const useDebouncedCallback: <T extends unknown[]>(callback: (...args: T) => void, delay: number, dependencies?: default_2.DependencyList) => ((...args: T) => void) & {
|
|
1795
|
+
cancel: () => void;
|
|
1796
|
+
};
|
|
1799
1797
|
|
|
1800
1798
|
export declare const useFiltersReducer: (filterValues: Filter[] | undefined) => {
|
|
1801
1799
|
state: FiltersState;
|
|
@@ -1835,7 +1833,9 @@ export declare const usePosition: (providedConfigObject?: ConfigObject) => {
|
|
|
1835
1833
|
bottom: PositionType;
|
|
1836
1834
|
left: PositionType;
|
|
1837
1835
|
right: PositionType;
|
|
1838
|
-
calculatePosition: () => void
|
|
1836
|
+
calculatePosition: (() => void) & {
|
|
1837
|
+
cancel: () => void;
|
|
1838
|
+
};
|
|
1839
1839
|
calculatePositionImmediate: () => void;
|
|
1840
1840
|
initialCalculationDone: boolean;
|
|
1841
1841
|
resetCalculationState: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.readyclasses_sr-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.readyclasses_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.readyclasses_hidden_MD9ir{display:none}.readyclasses_slide-in_MD9ir{animation:readyclasses_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.readyclasses_slide-in_MD9ir{animation-duration:.1ms}}.readyclasses_slide-out_MD9ir{animation:readyclasses_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.readyclasses_slide-out_MD9ir{animation-duration:.1ms}}@keyframes readyclasses_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes readyclasses_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="readyclasses_hidden_MD9ir",s={"sr-only":"readyclasses_sr-only_MD9ir",hidden:e,"slide-in":"readyclasses_slide-in_MD9ir","slide-out":"readyclasses_slide-out_MD9ir"};exports.default=s,exports.hidden=e;
|
|
3
3
|
//# sourceMappingURL=readyclasses.module.scss.cjs.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.readyclasses_sr-
|
|
2
|
-
const hidden = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.readyclasses_sr-only_MD9ir{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.readyclasses_hidden_MD9ir{display:none}.readyclasses_slide-in_MD9ir{animation:readyclasses_slide-in_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.readyclasses_slide-in_MD9ir{animation-duration:.1ms}}.readyclasses_slide-out_MD9ir{animation:readyclasses_slide-out_MD9ir .5s forwards}@media(prefers-reduced-motion:reduce){.readyclasses_slide-out_MD9ir{animation-duration:.1ms}}@keyframes readyclasses_slide-in_MD9ir{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes readyclasses_slide-out_MD9ir{0%{transform:translateY(0)}to{transform:translateY(100vh)}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
|
+
const hidden = "readyclasses_hidden_MD9ir";
|
|
3
3
|
const readyclasses = {
|
|
4
|
-
"sr-only": "readyclasses_sr-
|
|
4
|
+
"sr-only": "readyclasses_sr-only_MD9ir",
|
|
5
5
|
hidden,
|
|
6
|
-
"slide-in": "readyclasses_slide-
|
|
7
|
-
"slide-out": "readyclasses_slide-
|
|
6
|
+
"slide-in": "readyclasses_slide-in_MD9ir",
|
|
7
|
+
"slide-out": "readyclasses_slide-out_MD9ir"
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
readyclasses as default,
|
package/dist/util/helper.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.debounce=(e,t)=>{let
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.classNames=(...e)=>{const t=[];for(const o of e)if(o)if("string"!=typeof o&&"number"!=typeof o)for(const e in o)o[e]&&t.push(e);else t.push(String(o));return t.join(" ")},exports.debounce=(e,t)=>{let o;return function(...r){clearTimeout(o),o=setTimeout(()=>{clearTimeout(o),e(...r)},t)}},exports.generateID=(e=15,t)=>{const o=["1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];let r="";for(let s=0;s<e&&r.length<e;s++)r=r+("string"!=typeof t||void 0===(null==t?void 0:t[s])||/\s/.test(t[s])?"":t[s])+o[Math.floor(Math.random()*o.length)];return r.slice(0,e)},exports.isJsonString=e=>{try{JSON.parse(e)}catch{return!1}return!0},exports.omitProps=(e,t)=>Object.keys(e).reduce((o,r)=>(t.test(r)||(o[r]=e[r]),o),{}),exports.pickProps=(e,t)=>Object.keys(e).reduce((o,r)=>(t.test(r)&&(o[r]=e[r]),o),{}),exports.remToPx=e=>e*Number.parseFloat(getComputedStyle(document.documentElement).fontSize),exports.throttle=(e,t)=>{let o=0;return function(){const r=Date.now();r-o>=t&&(e(),o=r)}};
|
|
2
2
|
//# sourceMappingURL=helper.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.cjs.js","sources":["../../src/util/helper.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype KeyValuePair = { [key: string]: unknown };\n\nexport const generateID = (length = 15, stringToWeaveIn?: string) => {\n /** We will make sure to mesh the generate id and name property together to basically create a unique ID */\n const hashCharacters = [\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"0\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\"\n ];\n\n let id = \"\";\n\n /** Generate an id of x characters in length */\n for (let i = 0; i < length && id.length < length; i++) {\n const stringCharacter =\n typeof stringToWeaveIn === \"string\" &&\n stringToWeaveIn?.[i] !== undefined &&\n !/\\s/.test(stringToWeaveIn[i])\n ? stringToWeaveIn[i]\n : \"\";\n id = id + stringCharacter + hashCharacters[Math.floor(Math.random() * hashCharacters.length)];\n }\n\n return id.slice(0, length);\n};\n\n//Returns only the props whose key matches `regexPattern`\nexport const pickProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\n//Returns only the props whose key does not match `regexPattern`\nexport const omitProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (!regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\nexport const debounce = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let timeout: undefined | ReturnType<typeof setTimeout>;\n\n return function executedFunction(...args: unknown[]) {\n const later = () => {\n clearTimeout(timeout);\n fn(...args);\n };\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, delay);\n };\n};\n\nexport const throttle = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let lastTime = 0;\n\n return function () {\n const now = Date.now();\n\n if (now - lastTime >= delay) {\n fn();\n lastTime = now;\n }\n };\n};\n\nconst isEqual = (x: any, y: any): boolean => {\n const typesCoincide = x && y && typeof x === \"object\" && typeof y === \"object\";\n return typesCoincide\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every(key => isEqual(x[key], y[key]))\n : x === y;\n};\n\nexport const areArraysDifferent = (\n arr1: Record<string, any>[],\n arr2: Record<string, any>[],\n key: string\n) => {\n if (arr1.length !== arr2.length) {\n return true;\n } else {\n const firstFilteredArray = arr1.filter(arr1Item =>\n arr2.some((arr2Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n const secondFilteredArray = arr2.filter(arr2Item =>\n arr1.some((arr1Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n\n return !!firstFilteredArray.length || !!secondFilteredArray.length;\n }\n};\n\n/** Source: https://stackoverflow.com/a/42769683/5084110 */\nexport const remToPx = (rem: number): number => {\n return rem * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\nexport const isJsonString = (str: any) => {\n try {\n JSON.parse(str);\n } catch {\n return false;\n }\n return true;\n};\n\ntype ObjectType = { [key: string]: any };\n\nexport const deepMerge = <T extends object>(obj1: ObjectType, obj2: ObjectType | false): T => {\n if (!obj2) {\n return obj1 as T;\n }\n\n const result: ObjectType = { ...obj1 };\n\n for (const key in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, key)) {\n if (\n typeof obj2[key] === \"object\" &&\n obj2[key] !== null &&\n Object.prototype.hasOwnProperty.call(obj1, key) &&\n !Array.isArray(obj2[key])\n ) {\n result[key] = deepMerge(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result as T;\n};\n\nexport const escapeRegExp = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n"],"names":["fn","delay","timeout","
|
|
1
|
+
{"version":3,"file":"helper.cjs.js","sources":["../../src/util/helper.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype KeyValuePair = { [key: string]: unknown };\n\nexport const generateID = (length = 15, stringToWeaveIn?: string) => {\n /** We will make sure to mesh the generate id and name property together to basically create a unique ID */\n const hashCharacters = [\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"0\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\"\n ];\n\n let id = \"\";\n\n /** Generate an id of x characters in length */\n for (let i = 0; i < length && id.length < length; i++) {\n const stringCharacter =\n typeof stringToWeaveIn === \"string\" &&\n stringToWeaveIn?.[i] !== undefined &&\n !/\\s/.test(stringToWeaveIn[i])\n ? stringToWeaveIn[i]\n : \"\";\n id = id + stringCharacter + hashCharacters[Math.floor(Math.random() * hashCharacters.length)];\n }\n\n return id.slice(0, length);\n};\n\n//Returns only the props whose key matches `regexPattern`\nexport const pickProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\n//Returns only the props whose key does not match `regexPattern`\nexport const omitProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (!regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\nexport const debounce = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let timeout: undefined | ReturnType<typeof setTimeout>;\n\n return function executedFunction(...args: unknown[]) {\n const later = () => {\n clearTimeout(timeout);\n fn(...args);\n };\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, delay);\n };\n};\n\nexport const throttle = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let lastTime = 0;\n\n return function () {\n const now = Date.now();\n\n if (now - lastTime >= delay) {\n fn();\n lastTime = now;\n }\n };\n};\n\nconst isEqual = (x: any, y: any): boolean => {\n const typesCoincide = x && y && typeof x === \"object\" && typeof y === \"object\";\n return typesCoincide\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every(key => isEqual(x[key], y[key]))\n : x === y;\n};\n\nexport const areArraysDifferent = (\n arr1: Record<string, any>[],\n arr2: Record<string, any>[],\n key: string\n) => {\n if (arr1.length !== arr2.length) {\n return true;\n } else {\n const firstFilteredArray = arr1.filter(arr1Item =>\n arr2.some((arr2Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n const secondFilteredArray = arr2.filter(arr2Item =>\n arr1.some((arr1Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n\n return !!firstFilteredArray.length || !!secondFilteredArray.length;\n }\n};\n\n/** Source: https://stackoverflow.com/a/42769683/5084110 */\nexport const remToPx = (rem: number): number => {\n return rem * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\nexport const isJsonString = (str: any) => {\n try {\n JSON.parse(str);\n } catch {\n return false;\n }\n return true;\n};\n\ntype ObjectType = { [key: string]: any };\n\nexport const deepMerge = <T extends object>(obj1: ObjectType, obj2: ObjectType | false): T => {\n if (!obj2) {\n return obj1 as T;\n }\n\n const result: ObjectType = { ...obj1 };\n\n for (const key in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, key)) {\n if (\n typeof obj2[key] === \"object\" &&\n obj2[key] !== null &&\n Object.prototype.hasOwnProperty.call(obj1, key) &&\n !Array.isArray(obj2[key])\n ) {\n result[key] = deepMerge(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result as T;\n};\n\nexport const escapeRegExp = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\ntype ClassDictionary = Record<string, boolean | undefined | null>;\ntype ClassValue = string | number | false | null | undefined | ClassDictionary;\n\n/**\n * Builds a space-separated className string from a mix of plain strings and\n * `{ className: condition }` maps, skipping any falsy value. Replaces the\n * repeated `const arr = []; cond && arr.push(...); arr.join(\" \")` boilerplate.\n */\nexport const classNames = (...args: ClassValue[]): string => {\n const result: string[] = [];\n\n for (const arg of args) {\n if (!arg) {\n continue;\n }\n\n if (typeof arg === \"string\" || typeof arg === \"number\") {\n result.push(String(arg));\n continue;\n }\n\n for (const key in arg) {\n if (arg[key]) {\n result.push(key);\n }\n }\n }\n\n return result.join(\" \");\n};\n"],"names":["args","result","arg","key","push","String","join","fn","delay","timeout","clearTimeout","setTimeout","length","stringToWeaveIn","hashCharacters","id","i","test","Math","floor","random","slice","str","JSON","parse","props","regexPattern","Object","keys","reduce","acc","rem","Number","parseFloat","getComputedStyle","document","documentElement","fontSize","lastTime","now","Date"],"mappings":"mGAqO0B,IAAIA,KAC5B,MAAMC,EAAmB,GAEzB,IAAA,MAAWC,KAAOF,EAChB,GAAKE,EAIL,GAAmB,iBAARA,GAAmC,iBAARA,EAKtC,IAAA,MAAWC,KAAOD,EACZA,EAAIC,IACNF,EAAOG,KAAKD,QANdF,EAAOG,KAAKC,OAAOH,IAWvB,OAAOD,EAAOK,KAAK,uBA9HG,CAACC,EAAqCC,KAC5D,IAAIC,EAEJ,OAAO,YAA6BT,GAMlCU,aAAaD,GAEbA,EAAUE,WAPI,KACZD,aAAaD,GACbF,KAAMP,IAKoBQ,EAC9B,sBAnHwB,CAACI,EAAS,GAAIC,KAEtC,MAAMC,EAAiB,CACrB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGF,IAAIC,EAAK,GAGT,IAAA,IAASC,EAAI,EAAGA,EAAIJ,GAAUG,EAAGH,OAASA,EAAQI,IAOhDD,EAAKA,GALwB,iBAApBF,QACkB,KAAzB,MAAAA,OAAA,EAAAA,EAAkBG,KACjB,KAAKC,KAAKJ,EAAgBG,IAEvB,GADAH,EAAgBG,IAEMF,EAAeI,KAAKC,MAAMD,KAAKE,SAAWN,EAAeF,SAGvF,OAAOG,EAAGM,MAAM,EAAGT,yBAmFQU,IAC3B,IACEC,KAAKC,MAAMF,EACb,CAAA,MACE,OAAO,CACT,CACA,OAAO,qBA3EgB,CAACG,EAAYC,IACpCC,OAAOC,KAAKH,GAAOI,OAAO,CAACC,EAAmB3B,KACvCuB,EAAaT,KAAKd,KACrB2B,EAAI3B,GAAOsB,EAAMtB,IAGZ2B,GACN,CAAA,qBAjBoB,CAACL,EAAYC,IACpCC,OAAOC,KAAKH,GAAOI,OAAO,CAACC,EAAmB3B,KACxCuB,EAAaT,KAAKd,KACpB2B,EAAI3B,GAAOsB,EAAMtB,IAGZ2B,GACN,CAAA,mBAoEmBC,GACfA,EAAMC,OAAOC,WAAWC,iBAAiBC,SAASC,iBAAiBC,2BA1CpD,CAAC9B,EAAqCC,KAC5D,IAAI8B,EAAW,EAEf,OAAO,WACL,MAAMC,EAAMC,KAAKD,MAEbA,EAAMD,GAAY9B,IACpBD,IACA+B,EAAWC,EAEf"}
|
package/dist/util/helper.es.js
CHANGED
|
@@ -114,7 +114,26 @@ const isJsonString = (str) => {
|
|
|
114
114
|
}
|
|
115
115
|
return true;
|
|
116
116
|
};
|
|
117
|
+
const classNames = (...args) => {
|
|
118
|
+
const result = [];
|
|
119
|
+
for (const arg of args) {
|
|
120
|
+
if (!arg) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
124
|
+
result.push(String(arg));
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
for (const key in arg) {
|
|
128
|
+
if (arg[key]) {
|
|
129
|
+
result.push(key);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return result.join(" ");
|
|
134
|
+
};
|
|
117
135
|
export {
|
|
136
|
+
classNames,
|
|
118
137
|
debounce,
|
|
119
138
|
generateID,
|
|
120
139
|
isJsonString,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.es.js","sources":["../../src/util/helper.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype KeyValuePair = { [key: string]: unknown };\n\nexport const generateID = (length = 15, stringToWeaveIn?: string) => {\n /** We will make sure to mesh the generate id and name property together to basically create a unique ID */\n const hashCharacters = [\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"0\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\"\n ];\n\n let id = \"\";\n\n /** Generate an id of x characters in length */\n for (let i = 0; i < length && id.length < length; i++) {\n const stringCharacter =\n typeof stringToWeaveIn === \"string\" &&\n stringToWeaveIn?.[i] !== undefined &&\n !/\\s/.test(stringToWeaveIn[i])\n ? stringToWeaveIn[i]\n : \"\";\n id = id + stringCharacter + hashCharacters[Math.floor(Math.random() * hashCharacters.length)];\n }\n\n return id.slice(0, length);\n};\n\n//Returns only the props whose key matches `regexPattern`\nexport const pickProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\n//Returns only the props whose key does not match `regexPattern`\nexport const omitProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (!regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\nexport const debounce = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let timeout: undefined | ReturnType<typeof setTimeout>;\n\n return function executedFunction(...args: unknown[]) {\n const later = () => {\n clearTimeout(timeout);\n fn(...args);\n };\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, delay);\n };\n};\n\nexport const throttle = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let lastTime = 0;\n\n return function () {\n const now = Date.now();\n\n if (now - lastTime >= delay) {\n fn();\n lastTime = now;\n }\n };\n};\n\nconst isEqual = (x: any, y: any): boolean => {\n const typesCoincide = x && y && typeof x === \"object\" && typeof y === \"object\";\n return typesCoincide\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every(key => isEqual(x[key], y[key]))\n : x === y;\n};\n\nexport const areArraysDifferent = (\n arr1: Record<string, any>[],\n arr2: Record<string, any>[],\n key: string\n) => {\n if (arr1.length !== arr2.length) {\n return true;\n } else {\n const firstFilteredArray = arr1.filter(arr1Item =>\n arr2.some((arr2Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n const secondFilteredArray = arr2.filter(arr2Item =>\n arr1.some((arr1Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n\n return !!firstFilteredArray.length || !!secondFilteredArray.length;\n }\n};\n\n/** Source: https://stackoverflow.com/a/42769683/5084110 */\nexport const remToPx = (rem: number): number => {\n return rem * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\nexport const isJsonString = (str: any) => {\n try {\n JSON.parse(str);\n } catch {\n return false;\n }\n return true;\n};\n\ntype ObjectType = { [key: string]: any };\n\nexport const deepMerge = <T extends object>(obj1: ObjectType, obj2: ObjectType | false): T => {\n if (!obj2) {\n return obj1 as T;\n }\n\n const result: ObjectType = { ...obj1 };\n\n for (const key in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, key)) {\n if (\n typeof obj2[key] === \"object\" &&\n obj2[key] !== null &&\n Object.prototype.hasOwnProperty.call(obj1, key) &&\n !Array.isArray(obj2[key])\n ) {\n result[key] = deepMerge(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result as T;\n};\n\nexport const escapeRegExp = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n"],"names":[],"mappings":"AAoBO,MAAM,aAAa,CAAC,SAAS,IAAI,oBAA6B;AAEnE,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGF,MAAI,KAAK;AAGT,WAAS,IAAI,GAAG,IAAI,UAAU,GAAG,SAAS,QAAQ,KAAK;AACrD,UAAM,kBACJ,OAAO,oBAAoB,aAC3B,mDAAkB,QAAO,UACzB,CAAC,KAAK,KAAK,gBAAgB,CAAC,CAAC,IACzB,gBAAgB,CAAC,IACjB;AACN,SAAK,KAAK,kBAAkB,eAAe,KAAK,MAAM,KAAK,OAAA,IAAW,eAAe,MAAM,CAAC;AAAA,EAC9F;AAEA,SAAO,GAAG,MAAM,GAAG,MAAM;AAC3B;AAGO,MAAM,YAAY,CAAC,OAAY,iBACpC,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,KAAmB,QAAQ;AACpD,MAAI,aAAa,KAAK,GAAG,GAAG;AAC1B,QAAI,GAAG,IAAI,MAAM,GAAG;AAAA,EACtB;AAEA,SAAO;AACT,GAAG,CAAA,CAAE;AAGA,MAAM,YAAY,CAAC,OAAY,iBACpC,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,KAAmB,QAAQ;AACpD,MAAI,CAAC,aAAa,KAAK,GAAG,GAAG;AAC3B,QAAI,GAAG,IAAI,MAAM,GAAG;AAAA,EACtB;AAEA,SAAO;AACT,GAAG,CAAA,CAAE;AAEA,MAAM,WAAW,CAAC,IAAqC,UAAkB;AAC9E,MAAI;AAEJ,SAAO,SAAS,oBAAoB,MAAiB;AACnD,UAAM,QAAQ,MAAM;AAClB,mBAAa,OAAO;AACpB,SAAG,GAAG,IAAI;AAAA,IACZ;AAEA,iBAAa,OAAO;AAEpB,cAAU,WAAW,OAAO,KAAK;AAAA,EACnC;AACF;AAEO,MAAM,WAAW,CAAC,IAAqC,UAAkB;AAC9E,MAAI,WAAW;AAEf,SAAO,WAAY;AACjB,UAAM,MAAM,KAAK,IAAA;AAEjB,QAAI,MAAM,YAAY,OAAO;AAC3B,SAAA;AACA,iBAAW;AAAA,IACb;AAAA,EACF;AACF;AA8BO,MAAM,UAAU,CAAC,QAAwB;AAC9C,SAAO,MAAM,OAAO,WAAW,iBAAiB,SAAS,eAAe,EAAE,QAAQ;AACpF;AAEO,MAAM,eAAe,CAAC,QAAa;AACxC,MAAI;AACF,SAAK,MAAM,GAAG;AAAA,EAChB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO;AACT;"}
|
|
1
|
+
{"version":3,"file":"helper.es.js","sources":["../../src/util/helper.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype KeyValuePair = { [key: string]: unknown };\n\nexport const generateID = (length = 15, stringToWeaveIn?: string) => {\n /** We will make sure to mesh the generate id and name property together to basically create a unique ID */\n const hashCharacters = [\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"0\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\"\n ];\n\n let id = \"\";\n\n /** Generate an id of x characters in length */\n for (let i = 0; i < length && id.length < length; i++) {\n const stringCharacter =\n typeof stringToWeaveIn === \"string\" &&\n stringToWeaveIn?.[i] !== undefined &&\n !/\\s/.test(stringToWeaveIn[i])\n ? stringToWeaveIn[i]\n : \"\";\n id = id + stringCharacter + hashCharacters[Math.floor(Math.random() * hashCharacters.length)];\n }\n\n return id.slice(0, length);\n};\n\n//Returns only the props whose key matches `regexPattern`\nexport const pickProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\n//Returns only the props whose key does not match `regexPattern`\nexport const omitProps = (props: any, regexPattern: RegExp): KeyValuePair =>\n Object.keys(props).reduce((acc: KeyValuePair, key) => {\n if (!regexPattern.test(key)) {\n acc[key] = props[key];\n }\n\n return acc;\n }, {});\n\nexport const debounce = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let timeout: undefined | ReturnType<typeof setTimeout>;\n\n return function executedFunction(...args: unknown[]) {\n const later = () => {\n clearTimeout(timeout);\n fn(...args);\n };\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, delay);\n };\n};\n\nexport const throttle = (fn: (...args: unknown[]) => unknown, delay: number) => {\n let lastTime = 0;\n\n return function () {\n const now = Date.now();\n\n if (now - lastTime >= delay) {\n fn();\n lastTime = now;\n }\n };\n};\n\nconst isEqual = (x: any, y: any): boolean => {\n const typesCoincide = x && y && typeof x === \"object\" && typeof y === \"object\";\n return typesCoincide\n ? Object.keys(x).length === Object.keys(y).length &&\n Object.keys(x).every(key => isEqual(x[key], y[key]))\n : x === y;\n};\n\nexport const areArraysDifferent = (\n arr1: Record<string, any>[],\n arr2: Record<string, any>[],\n key: string\n) => {\n if (arr1.length !== arr2.length) {\n return true;\n } else {\n const firstFilteredArray = arr1.filter(arr1Item =>\n arr2.some((arr2Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n const secondFilteredArray = arr2.filter(arr2Item =>\n arr1.some((arr1Item: { [x: string]: any }) => !isEqual(arr1Item[key], arr2Item[key]))\n );\n\n return !!firstFilteredArray.length || !!secondFilteredArray.length;\n }\n};\n\n/** Source: https://stackoverflow.com/a/42769683/5084110 */\nexport const remToPx = (rem: number): number => {\n return rem * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n};\n\nexport const isJsonString = (str: any) => {\n try {\n JSON.parse(str);\n } catch {\n return false;\n }\n return true;\n};\n\ntype ObjectType = { [key: string]: any };\n\nexport const deepMerge = <T extends object>(obj1: ObjectType, obj2: ObjectType | false): T => {\n if (!obj2) {\n return obj1 as T;\n }\n\n const result: ObjectType = { ...obj1 };\n\n for (const key in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, key)) {\n if (\n typeof obj2[key] === \"object\" &&\n obj2[key] !== null &&\n Object.prototype.hasOwnProperty.call(obj1, key) &&\n !Array.isArray(obj2[key])\n ) {\n result[key] = deepMerge(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result as T;\n};\n\nexport const escapeRegExp = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\ntype ClassDictionary = Record<string, boolean | undefined | null>;\ntype ClassValue = string | number | false | null | undefined | ClassDictionary;\n\n/**\n * Builds a space-separated className string from a mix of plain strings and\n * `{ className: condition }` maps, skipping any falsy value. Replaces the\n * repeated `const arr = []; cond && arr.push(...); arr.join(\" \")` boilerplate.\n */\nexport const classNames = (...args: ClassValue[]): string => {\n const result: string[] = [];\n\n for (const arg of args) {\n if (!arg) {\n continue;\n }\n\n if (typeof arg === \"string\" || typeof arg === \"number\") {\n result.push(String(arg));\n continue;\n }\n\n for (const key in arg) {\n if (arg[key]) {\n result.push(key);\n }\n }\n }\n\n return result.join(\" \");\n};\n"],"names":[],"mappings":"AAoBO,MAAM,aAAa,CAAC,SAAS,IAAI,oBAA6B;AAEnE,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGF,MAAI,KAAK;AAGT,WAAS,IAAI,GAAG,IAAI,UAAU,GAAG,SAAS,QAAQ,KAAK;AACrD,UAAM,kBACJ,OAAO,oBAAoB,aAC3B,mDAAkB,QAAO,UACzB,CAAC,KAAK,KAAK,gBAAgB,CAAC,CAAC,IACzB,gBAAgB,CAAC,IACjB;AACN,SAAK,KAAK,kBAAkB,eAAe,KAAK,MAAM,KAAK,OAAA,IAAW,eAAe,MAAM,CAAC;AAAA,EAC9F;AAEA,SAAO,GAAG,MAAM,GAAG,MAAM;AAC3B;AAGO,MAAM,YAAY,CAAC,OAAY,iBACpC,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,KAAmB,QAAQ;AACpD,MAAI,aAAa,KAAK,GAAG,GAAG;AAC1B,QAAI,GAAG,IAAI,MAAM,GAAG;AAAA,EACtB;AAEA,SAAO;AACT,GAAG,CAAA,CAAE;AAGA,MAAM,YAAY,CAAC,OAAY,iBACpC,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,KAAmB,QAAQ;AACpD,MAAI,CAAC,aAAa,KAAK,GAAG,GAAG;AAC3B,QAAI,GAAG,IAAI,MAAM,GAAG;AAAA,EACtB;AAEA,SAAO;AACT,GAAG,CAAA,CAAE;AAEA,MAAM,WAAW,CAAC,IAAqC,UAAkB;AAC9E,MAAI;AAEJ,SAAO,SAAS,oBAAoB,MAAiB;AACnD,UAAM,QAAQ,MAAM;AAClB,mBAAa,OAAO;AACpB,SAAG,GAAG,IAAI;AAAA,IACZ;AAEA,iBAAa,OAAO;AAEpB,cAAU,WAAW,OAAO,KAAK;AAAA,EACnC;AACF;AAEO,MAAM,WAAW,CAAC,IAAqC,UAAkB;AAC9E,MAAI,WAAW;AAEf,SAAO,WAAY;AACjB,UAAM,MAAM,KAAK,IAAA;AAEjB,QAAI,MAAM,YAAY,OAAO;AAC3B,SAAA;AACA,iBAAW;AAAA,IACb;AAAA,EACF;AACF;AA8BO,MAAM,UAAU,CAAC,QAAwB;AAC9C,SAAO,MAAM,OAAO,WAAW,iBAAiB,SAAS,eAAe,EAAE,QAAQ;AACpF;AAEO,MAAM,eAAe,CAAC,QAAa;AACxC,MAAI;AACF,SAAK,MAAM,GAAG;AAAA,EAChB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAuCO,MAAM,aAAa,IAAI,SAA+B;AAC3D,QAAM,SAAmB,CAAA;AAEzB,aAAW,OAAO,MAAM;AACtB,QAAI,CAAC,KAAK;AACR;AAAA,IACF;AAEA,QAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,UAAU;AACtD,aAAO,KAAK,OAAO,GAAG,CAAC;AACvB;AAAA,IACF;AAEA,eAAW,OAAO,KAAK;AACrB,UAAI,IAAI,GAAG,GAAG;AACZ,eAAO,KAAK,GAAG;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAEA,SAAO,OAAO,KAAK,GAAG;AACxB;"}
|