@onewelcome/react-lib-components 6.7.1 → 7.0.0
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 +6 -0
- package/dist/cjs/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js +2 -0
- package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js.map +1 -0
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.cjs.js.map +1 -1
- package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
- package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js +1 -1
- package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
- package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
- package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
- package/dist/cjs/Icon/Icon.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js.map +1 -1
- package/dist/cjs/Icon/Icon.module.cjs.js +1 -1
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js +1 -1
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js.map +1 -1
- package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.module.cjs.js +1 -1
- package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js +1 -1
- package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js.map +1 -1
- package/dist/cjs/Pagination/Pagination.cjs.js +1 -1
- package/dist/cjs/Pagination/Pagination.cjs.js.map +1 -1
- package/dist/cjs/Popover/Popover.cjs.js +1 -1
- package/dist/cjs/Popover/Popover.cjs.js.map +1 -1
- package/dist/cjs/Tag/RemoveButton.module.cjs.js +1 -1
- package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js +1 -1
- package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
- package/dist/cjs/src/components/DataGrid/DataGrid.d.ts +6 -0
- package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
- package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
- package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
- package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
- package/dist/cjs/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
- package/dist/cjs/src/components/DataGrid/testUtils.d.ts +13 -0
- package/dist/cjs/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
- package/dist/cjs/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
- package/dist/cjs/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
- package/dist/cjs/src/components/Form/Select/Select.interfaces.d.ts +1 -11
- package/dist/cjs/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
- package/dist/cjs/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
- package/dist/cjs/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
- package/dist/cjs/src/components/Icon/Icon.d.ts +2 -1
- package/dist/cjs/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
- package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js +2 -0
- package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js.map +1 -0
- package/dist/cjs/src/hooks/useFullHeightCollapse.d.ts +4 -0
- package/dist/cjs/src/hooks/usePosition.cjs.js +1 -1
- package/dist/cjs/src/hooks/usePosition.cjs.js.map +1 -1
- package/dist/cjs/src/index.cjs.js +1 -1
- package/dist/cjs/src/index.d.ts +7 -21
- package/dist/esm/DataGrid/DataGrid.esm.js +1 -1
- package/dist/esm/DataGrid/DataGrid.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js.map +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js +2 -0
- package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js.map +1 -0
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js.map +1 -1
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js.map +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.esm.js +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.esm.js.map +1 -1
- package/dist/esm/Form/FileUpload/FileUpload.module.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js.map +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js.map +1 -1
- package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js +1 -1
- package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js.map +1 -1
- package/dist/esm/Form/Select/SingleSelect/Select.esm.js +1 -1
- package/dist/esm/Form/Select/SingleSelect/Select.esm.js.map +1 -1
- package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js +1 -1
- package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js.map +1 -1
- package/dist/esm/Icon/Icon.esm.js +1 -1
- package/dist/esm/Icon/Icon.esm.js.map +1 -1
- package/dist/esm/Icon/Icon.module.esm.js +1 -1
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js +1 -1
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js.map +1 -1
- package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.module.esm.js +1 -1
- package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js +1 -1
- package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js.map +1 -1
- package/dist/esm/Pagination/Pagination.esm.js +1 -1
- package/dist/esm/Pagination/Pagination.esm.js.map +1 -1
- package/dist/esm/Popover/Popover.esm.js +1 -1
- package/dist/esm/Popover/Popover.esm.js.map +1 -1
- package/dist/esm/Tag/RemoveButton.module.esm.js +1 -1
- package/dist/esm/_BaseStyling_/BaseStyling.esm.js +1 -1
- package/dist/esm/_BaseStyling_/BaseStyling.esm.js.map +1 -1
- package/dist/esm/src/components/DataGrid/DataGrid.d.ts +6 -0
- package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
- package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
- package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
- package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
- package/dist/esm/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
- package/dist/esm/src/components/DataGrid/testUtils.d.ts +13 -0
- package/dist/esm/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
- package/dist/esm/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
- package/dist/esm/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
- package/dist/esm/src/components/Form/Select/Select.interfaces.d.ts +1 -11
- package/dist/esm/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
- package/dist/esm/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
- package/dist/esm/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
- package/dist/esm/src/components/Icon/Icon.d.ts +2 -1
- package/dist/esm/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
- package/dist/esm/src/hooks/useFullHeightCollapse.d.ts +4 -0
- package/dist/esm/src/hooks/useFullHeightCollapse.esm.js +2 -0
- package/dist/esm/src/hooks/useFullHeightCollapse.esm.js.map +1 -0
- package/dist/esm/src/hooks/usePosition.esm.js +1 -1
- package/dist/esm/src/hooks/usePosition.esm.js.map +1 -1
- package/dist/esm/src/index.d.ts +7 -21
- package/dist/esm/src/index.esm.js +1 -1
- package/package.json +50 -49
- package/src/components/DataGrid/DataGrid.tsx +24 -10
- package/src/components/DataGrid/DataGridBody/DataGridBody.tsx +2 -2
- package/src/components/DataGrid/DataGridBody/{DataGridCell.module.scss → DataGridCell/DataGridCell.module.scss} +2 -2
- package/src/components/DataGrid/DataGridBody/{DataGridCell.tsx → DataGridCell/DataGridCell.tsx} +1 -1
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss +60 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.tsx +39 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss +21 -0
- package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.tsx +47 -0
- package/src/components/DataGrid/DataGridBody/{DataGridRow.module.scss → DataGridRow/DataGridRow.module.scss} +17 -1
- package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.tsx +122 -0
- package/src/components/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +4 -4
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.module.scss +105 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilter.tsx +150 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.tsx +181 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterService.ts +97 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilterTag.tsx +91 -0
- package/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts +84 -0
- package/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.scss → DataGrid/DataGridFilters/DataGridToolbar.module.scss} +27 -34
- package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +126 -0
- package/src/components/DataGrid/DataGridHeader/DataGridHeader.tsx +6 -1
- package/src/components/DataGrid/testUtils.ts +77 -0
- package/src/components/Form/FileUpload/FileItem/FileItem.tsx +5 -8
- package/src/components/Form/FileUpload/FileUpload.module.scss +9 -4
- package/src/components/Form/FileUpload/FileUpload.tsx +34 -15
- package/src/components/Form/Select/MultiSelect/MultiOption.tsx +4 -2
- package/src/components/Form/Select/MultiSelect/MultiSelect.tsx +1 -5
- package/src/components/Form/Select/MultiSelect/useSearch.tsx +6 -16
- package/src/components/Form/Select/Select.interfaces.ts +1 -9
- package/src/components/Form/Select/SingleSelect/Select.tsx +1 -5
- package/src/components/Form/Select/SingleSelect/useSearch.tsx +6 -18
- package/src/components/Icon/Icon.module.scss +5 -0
- package/src/components/Icon/Icon.tsx +2 -1
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss +12 -15
- package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.tsx +3 -5
- package/src/components/Notifications/NotificationProvider/NotificationContext.tsx +12 -16
- package/src/components/Pagination/Pagination.tsx +15 -6
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Tag/RemoveButton.module.scss +1 -0
- package/src/components/_BaseStyling_/BaseStyling.tsx +0 -36
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +1 -0
- package/src/font/icomoon.ttf +0 -0
- package/src/font/icomoon.woff +0 -0
- package/src/font/selection.json +1 -1
- package/src/{components/Notifications/Snackbar/useSnackbar.ts → hooks/useFullHeightCollapse.ts} +12 -11
- package/src/hooks/usePosition.ts +3 -4
- package/src/index.ts +7 -25
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js +0 -2
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js.map +0 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.module.cjs.js +0 -2
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js +0 -2
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js.map +0 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridRow.module.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js.map +0 -1
- package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js +0 -2
- package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js.map +0 -1
- package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js +0 -2
- package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js.map +0 -1
- package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js +0 -2
- package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js.map +0 -1
- package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js +0 -2
- package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js.map +0 -1
- package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js +0 -2
- package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js.map +0 -1
- package/dist/cjs/Wizard/Wizard.cjs.js +0 -2
- package/dist/cjs/Wizard/Wizard.cjs.js.map +0 -1
- package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js +0 -2
- package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js.map +0 -1
- package/dist/cjs/Wizard/WizardStateProvider.cjs.js +0 -2
- package/dist/cjs/Wizard/WizardStateProvider.cjs.js.map +0 -1
- package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js +0 -2
- package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js.map +0 -1
- package/dist/cjs/Wizard/wizardStateReducer.cjs.js +0 -2
- package/dist/cjs/Wizard/wizardStateReducer.cjs.js.map +0 -1
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
- package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
- package/dist/cjs/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
- package/dist/cjs/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
- package/dist/cjs/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
- package/dist/cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
- package/dist/cjs/src/components/Wizard/Wizard.d.ts +0 -11
- package/dist/cjs/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
- package/dist/cjs/src/components/Wizard/WizardStateProvider.d.ts +0 -15
- package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
- package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
- package/dist/cjs/src/components/Wizard/wizardStateReducer.d.ts +0 -24
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js +0 -2
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js.map +0 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.module.esm.js +0 -2
- package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js +0 -2
- package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js.map +0 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridRow.module.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/interfaces.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/interfaces.esm.js.map +0 -1
- package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js +0 -2
- package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js.map +0 -1
- package/dist/esm/StatusIndicator/StatusIndicator.esm.js +0 -2
- package/dist/esm/StatusIndicator/StatusIndicator.esm.js.map +0 -1
- package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js +0 -2
- package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js.map +0 -1
- package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js +0 -2
- package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js.map +0 -1
- package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js +0 -2
- package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js.map +0 -1
- package/dist/esm/Wizard/Wizard.esm.js +0 -2
- package/dist/esm/Wizard/Wizard.esm.js.map +0 -1
- package/dist/esm/Wizard/WizardActions/WizardActions.esm.js +0 -2
- package/dist/esm/Wizard/WizardActions/WizardActions.esm.js.map +0 -1
- package/dist/esm/Wizard/WizardStateProvider.esm.js +0 -2
- package/dist/esm/Wizard/WizardStateProvider.esm.js.map +0 -1
- package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js +0 -2
- package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js.map +0 -1
- package/dist/esm/Wizard/wizardStateReducer.esm.js +0 -2
- package/dist/esm/Wizard/wizardStateReducer.esm.js.map +0 -1
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts +0 -1
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts +0 -1
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts +0 -1
- package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
- package/dist/esm/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
- package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
- package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.test.d.ts +0 -1
- package/dist/esm/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
- package/dist/esm/src/components/StatusIndicator/StatusIndicator.test.d.ts +0 -1
- package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
- package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts +0 -1
- package/dist/esm/src/components/Wizard/Wizard.d.ts +0 -11
- package/dist/esm/src/components/Wizard/Wizard.test.d.ts +0 -1
- package/dist/esm/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
- package/dist/esm/src/components/Wizard/WizardActions/WizardActions.test.d.ts +0 -1
- package/dist/esm/src/components/Wizard/WizardStateProvider.d.ts +0 -15
- package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
- package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
- package/dist/esm/src/components/Wizard/wizardStateReducer.d.ts +0 -24
- package/src/components/DataGrid/DataGridBody/DataGridRow.tsx +0 -58
- package/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +0 -92
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +0 -156
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +0 -161
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +0 -219
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +0 -57
- package/src/components/Notifications/Snackbar/interfaces.ts +0 -62
- package/src/components/StatusIndicator/StatusIndicator.module.scss +0 -43
- package/src/components/StatusIndicator/StatusIndicator.tsx +0 -44
- package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +0 -214
- package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +0 -93
- package/src/components/Wizard/Wizard.tsx +0 -67
- package/src/components/Wizard/WizardActions/WizardActions.tsx +0 -116
- package/src/components/Wizard/WizardStateProvider.tsx +0 -45
- package/src/components/Wizard/WizardSteps/WizardSteps.tsx +0 -54
- package/src/components/Wizard/wizardStateReducer.ts +0 -61
- /package/dist/cjs/DataGrid/DataGridBody/{DataGridCell.module.cjs.js.map → DataGridCell/DataGridCell.module.cjs.js.map} +0 -0
- /package/dist/cjs/DataGrid/DataGridBody/{DataGridRow.module.cjs.js.map → DataGridRow/DataGridRow.module.cjs.js.map} +0 -0
- /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
- /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
- /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.test.d.ts → DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
- /package/dist/{esm/src/components/DataGrid/DataGridBody → cjs/src/components/DataGrid/DataGridBody/DataGridRow}/DataGridRow.test.d.ts +0 -0
- /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts → DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
- /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts → DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
- /package/dist/cjs/src/{components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts → hooks/useFullHeightCollapse.test.d.ts} +0 -0
- /package/dist/esm/DataGrid/DataGridBody/{DataGridCell.module.esm.js.map → DataGridCell/DataGridCell.module.esm.js.map} +0 -0
- /package/dist/esm/DataGrid/DataGridBody/{DataGridRow.module.esm.js.map → DataGridRow/DataGridRow.module.esm.js.map} +0 -0
- /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
- /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
- /package/dist/{cjs/src/components/Notifications/Snackbar/useSnackbar.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
- /package/dist/{cjs/src/components/StatusIndicator/StatusIndicator.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.test.d.ts} +0 -0
- /package/dist/{cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
- /package/dist/{cjs/src/components/Wizard/Wizard.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
- /package/dist/{cjs/src/components/Wizard/WizardActions/WizardActions.test.d.ts → esm/src/hooks/useFullHeightCollapse.test.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../../src/components/Form/Select/MultiSelect/useSearch.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, { useEffect, useRef, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../../src/components/Form/Select/MultiSelect/useSearch.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, { useEffect, useRef, useState } from \"react\";\nimport { SearchProps } from \"../Select.interfaces\";\n\ninterface Props {\n selectId: string;\n search?: SearchProps;\n optionsCount: number;\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n focusedSelectItem: number;\n describedBy?: string;\n getOptionId: (multiSelectId: string, optionIndex: number) => string;\n getListboxId: (multiSelectId: string) => string;\n}\n\n/** @scope .*/\nexport const useSearch = ({\n selectId,\n search,\n optionsCount,\n searchInputClassName,\n expanded,\n setFocusedSelectItem,\n focusedSelectItem,\n describedBy,\n getOptionId,\n getListboxId\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n\n const DEFAULT_RENDER_THRESHOLD = 0;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount >= threshold;\n\n const shouldRenderSearch = () => {\n if (search?.enabled) {\n return hasEnoughChildren;\n }\n\n if (search) {\n return search.enabled as boolean;\n }\n\n return optionsCount > DEFAULT_RENDER_THRESHOLD;\n };\n\n const renderSearch = () => {\n return (\n <input\n {...((search?.searchInputProps as any) ?? {})}\n ref={searchInputRef}\n value={filter}\n onChange={event => setFilter(event.currentTarget.value)}\n className={[searchInputClassName, search?.searchInputProps?.className].join(\" \")}\n style={{\n display: expanded ? \"block\" : \"none\"\n }}\n type=\"text\"\n name=\"search-option\"\n placeholder={search?.searchPlaceholder}\n role=\"combobox\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-controls={getListboxId(selectId)}\n aria-describedby={describedBy}\n aria-autocomplete=\"none\"\n aria-expanded={expanded}\n aria-activedescendant={getOptionId(selectId, focusedSelectItem)}\n aria-haspopup={true}\n />\n );\n };\n\n const resetSearchState = () => {\n setFilter(\"\");\n setFocusedSelectItem(0);\n };\n\n const visible = shouldRenderSearch();\n\n useEffect(() => {\n if (search?.searchInputProps?.reset) {\n resetSearchState();\n }\n }, [search?.searchInputProps?.reset]);\n\n return {\n renderSearch,\n resetSearchState,\n searchVisible: visible,\n searchThreshold: threshold,\n searchInputRef,\n filter\n };\n};\n"],"names":["useSearch","selectId","search","optionsCount","searchInputClassName","expanded","setFocusedSelectItem","focusedSelectItem","describedBy","getOptionId","getListboxId","filter","setFilter","useState","DEFAULT_RENDER_THRESHOLD","searchInputRef","useRef","threshold","_a","renderThreshold","hasEnoughChildren","shouldRenderSearch","enabled","renderSearch","React","createElement","searchInputProps","ref","value","onChange","event","currentTarget","className","_b","join","style","display","type","name","placeholder","searchPlaceholder","role","autoComplete","autoCorrect","spellCheck","resetSearchState","visible","useEffect","reset","searchVisible","searchThreshold"],"mappings":"+DAiCa,MAAAA,EAAY,EACvBC,WACAC,SACAC,eACAC,uBACAC,WACAC,uBACAC,oBACAC,cACAC,cACAC,2BAEA,MAAOC,EAAQC,GAAaC,EAAS,IAErC,MAAMC,EAA2B,EAEjC,MAAMC,EAAiBC,EAAyB,MAEhD,MAAMC,GAAYC,EAAAhB,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQiB,mBAAmB,MAAAD,SAAA,EAAAA,EAAAJ,EAC7C,MAAMM,EAAoBjB,GAAgBc,EAE1C,MAAMI,EAAqB,KACzB,GAAInB,UAAAA,SAAM,OAAA,EAANA,EAAQoB,QACV,OAAOF,EAGT,GAAIlB,EACF,OAAOA,EAAOoB,QAGhB,OAAOnB,EAAeW,CAAwB,EAGhD,MAAMS,EAAe,aACnB,OACEC,EAAAC,cAAA,QAAA,KACOP,EAAChB,IAAM,MAANA,SAAM,OAAA,EAANA,EAAQwB,oBAAwB,MAAAR,SAAA,EAAAA,EAAI,CAAE,EAC5CS,IAAKZ,EACLa,MAAOjB,EACPkB,SAAUC,GAASlB,EAAUkB,EAAMC,cAAcH,OACjDI,UAAW,CAAC5B,GAAsB6B,EAAA/B,IAAM,MAANA,SAAM,OAAA,EAANA,EAAQwB,oBAAgB,MAAAO,SAAA,OAAA,EAAAA,EAAED,WAAWE,KAAK,KAC5EC,MAAO,CACLC,QAAS/B,EAAW,QAAU,QAEhCgC,KAAK,OACLC,KAAK,gBACLC,YAAarC,IAAM,MAANA,SAAA,OAAA,EAAAA,EAAQsC,kBACrBC,KAAK,WACLC,aAAa,MACbC,YAAY,MACZC,WAAY,MAAK,gBACFlC,EAAaT,GACV,mBAAAO,EACA,oBAAA,uBACHH,EAAQ,wBACAI,EAAYR,EAAUM,GAC9B,gBAAA,MAEjB,EAGJ,MAAMsC,EAAmB,KACvBjC,EAAU,IACVN,EAAqB,EAAE,EAGzB,MAAMwC,EAAUzB,IAEhB0B,GAAU,WACR,IAAI7B,EAAAhB,IAAM,MAANA,SAAM,OAAA,EAANA,EAAQwB,oBAAgB,MAAAR,SAAA,OAAA,EAAAA,EAAE8B,MAC5BH,GACD,GACA,EAACZ,EAAA/B,UAAAA,SAAM,OAAA,EAANA,EAAQwB,oBAAgB,MAAAO,SAAA,OAAA,EAAAA,EAAEe,QAE9B,MAAO,CACLzB,eACAsB,mBACAI,cAAeH,EACfI,gBAAiBjC,EACjBF,iBACAJ,SACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./Select.module.esm.js";import
|
|
1
|
+
import e from"./Select.module.esm.js";import t,{useState as s,useRef as n,createRef as a,useEffect as r,Fragment as o}from"react";import{useBodyClick as l}from"../../../src/hooks/useBodyClick.esm.js";import{useDetermineStatusIcon as c}from"../../../src/hooks/useDetermineStatusIcon.esm.js";import i from"../../../src/readyclasses.module.esm.js";import{filterProps as d}from"../../../src/util/helper.esm.js";import{Icon as u,Icons as m}from"../../../Icon/Icon.esm.js";import{useSelectPositionList as p}from"../useSelectPositionList.esm.js";import{useAddNewBtn as h}from"../useAddNewBtn.esm.js";import{useSearch as f}from"./useSearch.esm.js";import{useArrowNavigation as v}from"./useArrowNavigation.esm.js";const b=({children:b,name:C,disabled:E=false,labeledBy:N,placeholder:y,describedBy:g,selectButtonProps:w,className:S,error:x=false,success:I=false,value:j,clearLabel:B="Clear selection",noResultsLabel:R="No results found",onChange:L,addNew:k,search:A,...$},F)=>{const[O,H]=s(false);const[P,D]=s("");const T=n(null);const K=n(null);const[M,U]=s(-1);const[V,q]=s(false);const[z,G]=s(false);const J=t.Children.count(b);const{filter:Q,isSearching:W,renderSearch:X,searchInputRef:Y,setIsSearching:Z,searchThreshold:_,searchVisible:ee}=f({expanded:O,search:A,searchInputClassName:e["select-search"],optionsCount:J,setFocusedSelectItem:U});const{addBtnRef:te,addNewBtnOptionsContainerClassName:se,renderAddNew:ne}=h({addNew:k,filter:Q,focusedSelectItem:M,optionsCount:J,searchInputRef:Y});const ae=F||a();const re=e=>{if(ae.current&&e){ae.current.value=e.getAttribute("data-value");ae.current.dispatchEvent(new Event("change",{bubbles:true}))}H(false)};const oe=n(null);const{onArrowNavigation:le}=v({expanded:O,setExpanded:H,isSearching:W,setIsSearching:Z,setFocusedSelectItem:U,onOptionChangeHandler:re,childrenCount:J,setShouldClick:q,searchInputRef:Y,addBtnRef:te,renderThreshold:_});const{listPosition:ce,opacity:ie,optionsListMaxHeight:de,setListPosition:ue,setOpacity:me}=p({expanded:O,optionListReference:K,containerReference:T,addBtnRef:te});const pe=e=>{t.Children.forEach(b,(t=>{if(t.props.value===e)D(t.props.children)}))};const he=()=>{if(W||Q!==""){const n=t.Children.toArray(b).filter((e=>e.props.children.toLowerCase().match(Q.toLowerCase())!==null));const a=s(n);if(a.length===0)return t.createElement("li",{className:e["no-results"]},R);return s(n)}return s(b);function s(e){return t.Children.map(e,((e,s)=>t.cloneElement(e,{onFocusChange:e=>{U(e)},onOptionSelect:e=>{re(e.current);q(false)},isSelected:e.props.value===j,isSearching:W,selectOpened:O,childIndex:s,hasFocus:M===s,shouldClick:V,isAddBtnFocused:te.current===document.activeElement})))}};const fe=()=>O?t.createElement(u,{className:e["chevron-icon"],icon:m.ChevronUp}):t.createElement(u,{className:e["chevron-icon"],icon:m.ChevronDown});const ve=c({success:I,error:x});const be=e=>{L===null||L===void 0?void 0:L(e)};r((()=>{if(O){U(0);G(true)}if(!O&&oe.current&&z){oe.current.focus();G(false)}}),[O,oe.current,z]);r((()=>{pe(j)}),[j]);l((e=>!e.target.closest(".custom-select")&&O),(()=>{H(false);ue({top:0,bottom:"initial"});me(0)}),O);const Ce=[];O&&Ce.push(e.expanded);x&&Ce.push(e.error);E&&Ce.push(e.disabled);S&&Ce.push(S);I&&Ce.push(e.success);return t.createElement(o,null,t.createElement("select",{...d($,/^data-/,false),tabIndex:-1,"aria-hidden":"true",ref:ae,name:C,onChange:be,className:i["sr-only"]},t.createElement("option",{value:""}),t.Children.map(b,(e=>t.createElement("option",{value:e.props.value})))),t.createElement("div",{...d($,/^data-/),ref:T,onKeyDown:le,className:`custom-select ${e.select} ${Ce.join(" ")} ${S!==null&&S!==void 0?S:""}`},ee&&X(),t.createElement("button",{...w,onClick:()=>{H(!O)},ref:oe,type:"button",name:C,className:`${e["custom-select"]} ${Ce.join(" ")} `,style:{display:O&&ee?"none":"initial"},disabled:E,"aria-disabled":E,"aria-invalid":x,"aria-expanded":O,"aria-haspopup":"listbox","aria-labelledby":N,"aria-describedby":g},t.createElement("div",{"data-display":true,className:e["selected"]},!j&&y&&t.createElement("span",{className:e["placeholder"]},y),(j===null||j===void 0?void 0:j.length)>0&&t.createElement("span",{"data-display-inner":true},P)),t.createElement("div",{className:e["status"]},ve||fe())),t.createElement("div",{ref:K,className:`list-wrapper ${e["list-wrapper"]}`,style:{display:O?"block":"none",opacity:ie,maxHeight:de.wrapper,pointerEvents:O?"auto":"none",...ce}},t.createElement("ul",{className:se,role:"listbox",style:{maxHeight:de.list}},he()),ne())))};const C=t.forwardRef(b);export{C as Select};
|
|
2
2
|
//# sourceMappingURL=Select.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.esm.js","sources":["../../../../../../../src/components/Form/Select/SingleSelect/Select.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 classes from \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n Fragment,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useBodyClick } from \"../../../../hooks/useBodyClick\";\nimport { useDetermineStatusIcon } from \"../../../../hooks/useDetermineStatusIcon\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { filterProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\n children,\n name,\n disabled = false,\n labeledBy,\n placeholder,\n describedBy,\n searchPlaceholder = \"Search item\",\n searchInputProps,\n selectButtonProps,\n className,\n error = false,\n success = false,\n value,\n clearLabel = \"Clear selection\",\n noResultsLabel = \"No results found\",\n onChange,\n addNew,\n search,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(false);\n /** We need this, because whenever we use the arrow keys to select the select item, and we focus the currently selected item it fires the \"click\" listener in Option component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n const [shouldFocusButtonAfterClose, setShouldFocusButtonAfterClose] = useState(false);\n const optionsCount = React.Children.count(children);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem,\n searchInputProps,\n searchPlaceholder\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (nativeSelect.current && optionElement) {\n nativeSelect.current.value = optionElement.getAttribute(\"data-value\")!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n const syncDisplayValue = (val: string) => {\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n }\n });\n };\n\n /**\n * @description We have to modify the children (Option component) to have an additional props that allows us to keep track of which one is selected and focused at all times and if a filter is active.\n * The `children` prop can be either a single object (1 child) or an array of multiple children.\n */\n const renderOptions = () => {\n if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(\n child =>\n (child as ReactElement).props.children.toLowerCase().match(filter.toLowerCase()) !== null\n );\n\n const internalChildren = _internalRenderChildren(filteredChildren as ReactElement[]);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return _internalRenderChildren(filteredChildren as ReactElement[]);\n }\n\n return _internalRenderChildren(children);\n\n function _internalRenderChildren(internalChildren: ReactElement[]) {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n },\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n },\n isSelected: child.props.value === value,\n isSearching: isSearching,\n selectOpened: expanded,\n childIndex: index,\n hasFocus: focusedSelectItem === index,\n shouldClick: shouldClick,\n isAddBtnFocused: addBtnRef.current === document.activeElement\n });\n });\n }\n };\n\n const renderChevronIcon = () => {\n return expanded ? (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronUp} />\n ) : (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronDown} />\n );\n };\n\n const icon = useDetermineStatusIcon({ success, error });\n\n const nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value]);\n\n useBodyClick(\n (event: MouseEvent) => !(event.target as Element).closest(\".custom-select\") && expanded,\n () => {\n setExpanded(false);\n setListPosition({ top: 0, bottom: \"initial\" });\n setOpacity(0);\n },\n expanded\n );\n\n const additionalClasses = [];\n expanded && additionalClasses.push(classes.expanded);\n error && additionalClasses.push(classes.error);\n disabled && additionalClasses.push(classes.disabled);\n className && additionalClasses.push(className);\n success && additionalClasses.push(classes.success);\n\n /** The native select is purely for external form libraries. We use it to emit an onChange with native select event object so they know exactly what's happening. */\n return (\n <Fragment>\n <select\n {...filterProps(rest, /^data-/, false)}\n tabIndex={-1}\n aria-hidden=\"true\"\n ref={nativeSelect}\n name={name}\n onChange={nativeOnChangeHandler}\n className={readyclasses[\"sr-only\"]}\n >\n <option value=\"\"></option>\n {React.Children.map(children, child => (\n <option value={child.props.value}></option>\n ))}\n </select>\n <div\n {...filterProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")} ${\n className ?? \"\"\n }`}\n >\n {searchVisible && renderSearch()}\n <button\n {...selectButtonProps}\n onClick={() => {\n setExpanded(!expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"initial\" }}\n disabled={disabled}\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n </div>\n <div className={classes[\"status\"]}>{icon || renderChevronIcon()}</div>\n </button>\n\n <div\n ref={optionListReference}\n className={`list-wrapper ${classes[\"list-wrapper\"]}`}\n style={{\n display: expanded ? \"block\" : \"none\",\n opacity: opacity,\n maxHeight: optionsListMaxHeight.wrapper,\n pointerEvents: expanded ? \"auto\" : \"none\",\n ...listPosition\n }}\n >\n <ul\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n >\n {renderOptions()}\n </ul>\n {renderAddNew()}\n </div>\n </div>\n </Fragment>\n );\n};\nexport const Select = React.forwardRef(SelectComponent);\n"],"names":["SelectComponent","children","name","disabled","labeledBy","placeholder","describedBy","searchPlaceholder","searchInputProps","selectButtonProps","className","error","success","value","clearLabel","noResultsLabel","onChange","addNew","search","rest","ref","expanded","setExpanded","useState","display","setDisplay","containerReference","useRef","optionListReference","focusedSelectItem","setFocusedSelectItem","shouldClick","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsCount","React","Children","count","filter","isSearching","renderSearch","searchInputRef","setIsSearching","searchThreshold","searchVisible","useSearch","searchInputClassName","classes","addBtnRef","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","nativeSelect","createRef","onOptionChangeHandler","optionElement","current","getAttribute","dispatchEvent","Event","bubbles","customSelectButtonRef","onArrowNavigation","useArrowNavigation","childrenCount","renderThreshold","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","syncDisplayValue","val","forEach","child","props","renderOptions","filteredChildren","toArray","toLowerCase","match","internalChildren","_internalRenderChildren","length","createElement","map","index","cloneElement","onFocusChange","childIndex","onOptionSelect","optionRef","isSelected","selectOpened","hasFocus","isAddBtnFocused","document","activeElement","renderChevronIcon","Icon","icon","Icons","ChevronUp","ChevronDown","useDetermineStatusIcon","nativeOnChangeHandler","event","useEffect","focus","useBodyClick","target","closest","top","bottom","additionalClasses","push","Fragment","filterProps","tabIndex","readyclasses","onKeyDown","select","join","onClick","type","style","maxHeight","wrapper","pointerEvents","role","list","Select","forwardRef"],"mappings":"isBAsCA,MAAMA,EAAkF,EAEpFC,WACAC,OACAC,WAAW,MACXC,YACAC,cACAC,cACAC,oBAAoB,cACpBC,mBACAC,oBACAC,YACAC,QAAQ,MACRC,UAAU,MACVC,QACAC,aAAa,kBACbC,iBAAiB,mBACjBC,WACAC,SACAC,YACGC,GAELC,KAEA,MAAOC,EAAUC,GAAeC,EAAS,OACzC,MAAOC,EAASC,GAAcF,EAAS,IACvC,MAAMG,EAAqBC,EAAuB,MAClD,MAAMC,EAAsBD,EAAuB,MACnD,MAAOE,EAAmBC,GAAwBP,GAAU,GAC5D,MAAOQ,EAAaC,GAAkBT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SAAK,OAAA,EAALA,EAAOwE,QAAS,GAAKjD,EAA0BkD,cAAA,OAAA,CAAA,qBAAA,MAAA9D,IAElDY,EAAAkD,cAAA,MAAA,CAAK5E,UAAWsC,EAAQ,WAAYsD,IAAQF,OAG9ChE,EAAAkD,cAAA,MAAA,CACElE,IAAKQ,EACLlB,UAAW,gBAAgBsC,EAAQ,kBACnC+E,MAAO,CACLvG,QAASH,EAAW,QAAU,OAC9B+C,QAASA,GACT4D,UAAW3D,GAAqB4D,QAChCC,cAAe7G,EAAW,OAAS,UAChC8C,KAGL/B,EACEkD,cAAA,KAAA,CAAA5E,UAAWwC,GACXiF,KAAK,UACLJ,MAAO,CAAEC,UAAW3D,GAAqB+D,OAExCtD,MAEF3B,OAIP,EAES,MAAAkF,EAASjG,EAAMkG,WAAWtI"}
|
|
1
|
+
{"version":3,"file":"Select.esm.js","sources":["../../../../../../../src/components/Form/Select/SingleSelect/Select.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 classes from \"./Select.module.scss\";\n\nimport React, {\n createRef,\n ForwardRefRenderFunction,\n Fragment,\n ReactElement,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { useBodyClick } from \"../../../../hooks/useBodyClick\";\nimport { useDetermineStatusIcon } from \"../../../../hooks/useDetermineStatusIcon\";\nimport readyclasses from \"../../../../readyclasses.module.scss\";\nimport { filterProps } from \"../../../../util/helper\";\nimport { Icon, Icons } from \"../../../Icon/Icon\";\nimport { SingleSelectProps } from \"../Select.interfaces\";\nimport { useSelectPositionList } from \"../useSelectPositionList\";\nimport { useAddNewBtn } from \"../useAddNewBtn\";\nimport { useSearch } from \"./useSearch\";\nimport { useArrowNavigation } from \"./useArrowNavigation\";\n\nconst SelectComponent: ForwardRefRenderFunction<HTMLSelectElement, SingleSelectProps> = (\n {\n children,\n name,\n disabled = false,\n labeledBy,\n placeholder,\n describedBy,\n selectButtonProps,\n className,\n error = false,\n success = false,\n value,\n clearLabel = \"Clear selection\",\n noResultsLabel = \"No results found\",\n onChange,\n addNew,\n search,\n ...rest\n }: SingleSelectProps,\n ref\n) => {\n const [expanded, setExpanded] = useState(false);\n const [display, setDisplay] = useState(\"\");\n const containerReference = useRef<HTMLDivElement>(null);\n const optionListReference = useRef<HTMLDivElement>(null);\n const [focusedSelectItem, setFocusedSelectItem] = useState(-1);\n const [shouldClick, setShouldClick] = useState(false);\n /** We need this, because whenever we use the arrow keys to select the select item, and we focus the currently selected item it fires the \"click\" listener in Option component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n const [shouldFocusButtonAfterClose, setShouldFocusButtonAfterClose] = useState(false);\n const optionsCount = React.Children.count(children);\n const {\n filter,\n isSearching,\n renderSearch,\n searchInputRef,\n setIsSearching,\n searchThreshold,\n searchVisible\n } = useSearch({\n expanded,\n search,\n searchInputClassName: classes[\"select-search\"],\n optionsCount,\n setFocusedSelectItem\n });\n const { addBtnRef, addNewBtnOptionsContainerClassName, renderAddNew } = useAddNewBtn({\n addNew,\n filter,\n focusedSelectItem,\n optionsCount,\n searchInputRef\n });\n\n const nativeSelect = (ref as React.RefObject<HTMLSelectElement>) || createRef();\n\n const onOptionChangeHandler = (optionElement: HTMLElement | null) => {\n if (nativeSelect.current && optionElement) {\n nativeSelect.current.value = optionElement.getAttribute(\"data-value\")!;\n nativeSelect.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n setExpanded(false);\n };\n\n const customSelectButtonRef = useRef<HTMLButtonElement>(null);\n const { onArrowNavigation } = useArrowNavigation({\n expanded,\n setExpanded,\n isSearching,\n setIsSearching,\n setFocusedSelectItem,\n onOptionChangeHandler,\n childrenCount: optionsCount,\n setShouldClick,\n searchInputRef,\n addBtnRef,\n renderThreshold: searchThreshold\n });\n\n const { listPosition, opacity, optionsListMaxHeight, setListPosition, setOpacity } =\n useSelectPositionList({ expanded, optionListReference, containerReference, addBtnRef });\n\n const syncDisplayValue = (val: string) => {\n React.Children.forEach(children, child => {\n if (child.props.value === val) {\n setDisplay(child.props.children);\n }\n });\n };\n\n /**\n * @description We have to modify the children (Option component) to have an additional props that allows us to keep track of which one is selected and focused at all times and if a filter is active.\n * The `children` prop can be either a single object (1 child) or an array of multiple children.\n */\n const renderOptions = () => {\n if (isSearching || filter !== \"\") {\n const filteredChildren = React.Children.toArray(children).filter(\n child =>\n (child as ReactElement).props.children.toLowerCase().match(filter.toLowerCase()) !== null\n );\n\n const internalChildren = _internalRenderChildren(filteredChildren as ReactElement[]);\n\n if (internalChildren.length === 0) {\n return <li className={classes[\"no-results\"]}>{noResultsLabel}</li>;\n }\n\n return _internalRenderChildren(filteredChildren as ReactElement[]);\n }\n\n return _internalRenderChildren(children);\n\n function _internalRenderChildren(internalChildren: ReactElement[]) {\n return React.Children.map(internalChildren, (child, index) => {\n return React.cloneElement(child, {\n onFocusChange: (childIndex: number) => {\n setFocusedSelectItem(childIndex);\n },\n onOptionSelect: (optionRef: React.RefObject<HTMLLIElement>) => {\n onOptionChangeHandler(optionRef.current);\n setShouldClick(false);\n },\n isSelected: child.props.value === value,\n isSearching: isSearching,\n selectOpened: expanded,\n childIndex: index,\n hasFocus: focusedSelectItem === index,\n shouldClick: shouldClick,\n isAddBtnFocused: addBtnRef.current === document.activeElement\n });\n });\n }\n };\n\n const renderChevronIcon = () => {\n return expanded ? (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronUp} />\n ) : (\n <Icon className={classes[\"chevron-icon\"]} icon={Icons.ChevronDown} />\n );\n };\n\n const icon = useDetermineStatusIcon({ success, error });\n\n const nativeOnChangeHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n onChange?.(event);\n };\n\n useEffect(() => {\n if (expanded) {\n setFocusedSelectItem(0);\n setShouldFocusButtonAfterClose(true);\n }\n\n if (!expanded && customSelectButtonRef.current && shouldFocusButtonAfterClose) {\n customSelectButtonRef.current.focus();\n setShouldFocusButtonAfterClose(false);\n }\n }, [expanded, customSelectButtonRef.current, shouldFocusButtonAfterClose]);\n\n useEffect(() => {\n syncDisplayValue(value);\n }, [value]);\n\n useBodyClick(\n (event: MouseEvent) => !(event.target as Element).closest(\".custom-select\") && expanded,\n () => {\n setExpanded(false);\n setListPosition({ top: 0, bottom: \"initial\" });\n setOpacity(0);\n },\n expanded\n );\n\n const additionalClasses = [];\n expanded && additionalClasses.push(classes.expanded);\n error && additionalClasses.push(classes.error);\n disabled && additionalClasses.push(classes.disabled);\n className && additionalClasses.push(className);\n success && additionalClasses.push(classes.success);\n\n /** The native select is purely for external form libraries. We use it to emit an onChange with native select event object so they know exactly what's happening. */\n return (\n <Fragment>\n <select\n {...filterProps(rest, /^data-/, false)}\n tabIndex={-1}\n aria-hidden=\"true\"\n ref={nativeSelect}\n name={name}\n onChange={nativeOnChangeHandler}\n className={readyclasses[\"sr-only\"]}\n >\n <option value=\"\"></option>\n {React.Children.map(children, child => (\n <option value={child.props.value}></option>\n ))}\n </select>\n <div\n {...filterProps(rest, /^data-/)}\n ref={containerReference}\n onKeyDown={onArrowNavigation}\n className={`custom-select ${classes.select} ${additionalClasses.join(\" \")} ${\n className ?? \"\"\n }`}\n >\n {searchVisible && renderSearch()}\n <button\n {...selectButtonProps}\n onClick={() => {\n setExpanded(!expanded);\n }}\n ref={customSelectButtonRef}\n type=\"button\"\n name={name}\n className={`${classes[\"custom-select\"]} ${additionalClasses.join(\" \")} `}\n style={{ display: expanded && searchVisible ? \"none\" : \"initial\" }}\n disabled={disabled}\n aria-disabled={disabled}\n aria-invalid={error}\n aria-expanded={expanded}\n aria-haspopup=\"listbox\"\n aria-labelledby={labeledBy}\n aria-describedby={describedBy}\n >\n <div data-display className={classes[\"selected\"]}>\n {!value && placeholder && <span className={classes[\"placeholder\"]}>{placeholder}</span>}\n {value?.length > 0 && <span data-display-inner>{display}</span>}\n </div>\n <div className={classes[\"status\"]}>{icon || renderChevronIcon()}</div>\n </button>\n\n <div\n ref={optionListReference}\n className={`list-wrapper ${classes[\"list-wrapper\"]}`}\n style={{\n display: expanded ? \"block\" : \"none\",\n opacity: opacity,\n maxHeight: optionsListMaxHeight.wrapper,\n pointerEvents: expanded ? \"auto\" : \"none\",\n ...listPosition\n }}\n >\n <ul\n className={addNewBtnOptionsContainerClassName}\n role=\"listbox\"\n style={{ maxHeight: optionsListMaxHeight.list }}\n >\n {renderOptions()}\n </ul>\n {renderAddNew()}\n </div>\n </div>\n </Fragment>\n );\n};\nexport const Select = React.forwardRef(SelectComponent);\n"],"names":["SelectComponent","children","name","disabled","labeledBy","placeholder","describedBy","selectButtonProps","className","error","success","value","clearLabel","noResultsLabel","onChange","addNew","search","rest","ref","expanded","setExpanded","useState","display","setDisplay","containerReference","useRef","optionListReference","focusedSelectItem","setFocusedSelectItem","shouldClick","setShouldClick","shouldFocusButtonAfterClose","setShouldFocusButtonAfterClose","optionsCount","React","Children","count","filter","isSearching","renderSearch","searchInputRef","setIsSearching","searchThreshold","searchVisible","useSearch","searchInputClassName","classes","addBtnRef","addNewBtnOptionsContainerClassName","renderAddNew","useAddNewBtn","nativeSelect","createRef","onOptionChangeHandler","optionElement","current","getAttribute","dispatchEvent","Event","bubbles","customSelectButtonRef","onArrowNavigation","useArrowNavigation","childrenCount","renderThreshold","listPosition","opacity","optionsListMaxHeight","setListPosition","setOpacity","useSelectPositionList","syncDisplayValue","val","forEach","child","props","renderOptions","filteredChildren","toArray","toLowerCase","match","internalChildren","_internalRenderChildren","length","createElement","map","index","cloneElement","onFocusChange","childIndex","onOptionSelect","optionRef","isSelected","selectOpened","hasFocus","isAddBtnFocused","document","activeElement","renderChevronIcon","Icon","icon","Icons","ChevronUp","ChevronDown","useDetermineStatusIcon","nativeOnChangeHandler","event","useEffect","focus","useBodyClick","target","closest","top","bottom","additionalClasses","push","Fragment","filterProps","tabIndex","readyclasses","onKeyDown","select","join","onClick","type","style","maxHeight","wrapper","pointerEvents","role","list","Select","forwardRef"],"mappings":"isBAsCA,MAAMA,EAAkF,EAEpFC,WACAC,OACAC,WAAW,MACXC,YACAC,cACAC,cACAC,oBACAC,YACAC,QAAQ,MACRC,UAAU,MACVC,QACAC,aAAa,kBACbC,iBAAiB,mBACjBC,WACAC,SACAC,YACGC,GAELC,KAEA,MAAOC,EAAUC,GAAeC,EAAS,OACzC,MAAOC,EAASC,GAAcF,EAAS,IACvC,MAAMG,EAAqBC,EAAuB,MAClD,MAAMC,EAAsBD,EAAuB,MACnD,MAAOE,EAAmBC,GAAwBP,GAAU,GAC5D,MAAOQ,EAAaC,GAAkBT,EAAS,OAE/C,MAAOU,EAA6BC,GAAkCX,EAAS,OAC/E,MAAMY,EAAeC,EAAMC,SAASC,MAAMnC,GAC1C,MAAMoC,OACJA,EAAMC,YACNA,EAAWC,aACXA,EAAYC,eACZA,EAAcC,eACdA,EAAcC,gBACdA,EAAeC,cACfA,IACEC,EAAU,CACZzB,WACAH,SACA6B,qBAAsBC,EAAQ,iBAC9Bb,eACAL,yBAEF,MAAMmB,UAAEA,GAASC,mCAAEA,GAAkCC,aAAEA,IAAiBC,EAAa,CACnFnC,SACAsB,SACAV,oBACAM,eACAO,mBAGF,MAAMW,GAAgBjC,GAA8CkC,IAEpE,MAAMC,GAAyBC,IAC7B,GAAIH,GAAaI,SAAWD,EAAe,CACzCH,GAAaI,QAAQ5C,MAAQ2C,EAAcE,aAAa,cACxDL,GAAaI,QAAQE,cAAc,IAAIC,MAAM,SAAU,CAAEC,QAAS,OACnE,CAEDvC,EAAY,MAAM,EAGpB,MAAMwC,GAAwBnC,EAA0B,MACxD,MAAMoC,kBAAEA,IAAsBC,EAAmB,CAC/C3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C,EAAQ2E,UAAUP,GAAkBQ,KAAK,QACnElH,UAAAA,SAAS,EAATA,EAAa,MAGdmC,IAAiBJ,IAClBL,EAAAkD,cAAA,SAAA,IACM7E,EACJoH,QAAS,KACPvG,GAAaD,EAAS,EAExBD,IAAK0C,GACLgE,KAAK,SACL1H,KAAMA,EACNM,UAAW,GAAGsC,EAAQ,oBAAoBoE,GAAkBQ,KAAK,QACjEG,MAAO,CAAEvG,QAASH,GAAYwB,GAAgB,OAAS,WACvDxC,SAAUA,EACK,gBAAAA,EACD,eAAAM,EACC,gBAAAU,EACD,gBAAA,UACG,kBAAAf,qBACCE,GAElB4B,EAAAkD,cAAA,MAAA,CAAA,eAAA,KAAkB5E,UAAWsC,EAAQ,cACjCnC,GAASN,GAAe6B,EAAMkD,cAAA,OAAA,CAAA5E,UAAWsC,EAAQ,gBAAiBzC,IACnEM,IAAK,MAALA,SAAK,OAAA,EAALA,EAAOwE,QAAS,GAAKjD,EAA0BkD,cAAA,OAAA,CAAA,qBAAA,MAAA9D,IAElDY,EAAAkD,cAAA,MAAA,CAAK5E,UAAWsC,EAAQ,WAAYsD,IAAQF,OAG9ChE,EAAAkD,cAAA,MAAA,CACElE,IAAKQ,EACLlB,UAAW,gBAAgBsC,EAAQ,kBACnC+E,MAAO,CACLvG,QAASH,EAAW,QAAU,OAC9B+C,QAASA,GACT4D,UAAW3D,GAAqB4D,QAChCC,cAAe7G,EAAW,OAAS,UAChC8C,KAGL/B,EACEkD,cAAA,KAAA,CAAA5E,UAAWwC,GACXiF,KAAK,UACLJ,MAAO,CAAEC,UAAW3D,GAAqB+D,OAExCtD,MAEF3B,OAIP,EAES,MAAAkF,EAASjG,EAAMkG,WAAWpI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useState as o,useRef as r,useEffect as
|
|
1
|
+
import e,{useState as o,useRef as r,useEffect as n}from"react";import{Input as s}from"../../Input/Input.esm.js";const l=({search:l,optionsCount:t,searchInputClassName:a,expanded:c,setFocusedSelectItem:i})=>{var d,u;const[v,p]=o("");const[h,m]=o(false);const f=10;const I=r(null);const P=(d=l===null||l===void 0?void 0:l.renderThreshold)!==null&&d!==void 0?d:f;const S=t>=P;const b=e=>{p(e.currentTarget.value)};const g=()=>{if(l===null||l===void 0?void 0:l.enabled)return S;if(l)return l.enabled;return t>f};const N=()=>{var o,r,n;return e.createElement(s,{...(o=l===null||l===void 0?void 0:l.searchInputProps)!==null&&o!==void 0?o:{},ref:I,onFocus:()=>m(true),onBlur:()=>m(false),onChange:b,className:a,wrapperProps:{className:(n=(r=l===null||l===void 0?void 0:l.searchInputProps)===null||r===void 0?void 0:r.wrapperProps)===null||n===void 0?void 0:n.className},style:{display:c?"block":"none"},type:"text",name:"search-option",placeholder:(l===null||l===void 0?void 0:l.searchPlaceholder)?l===null||l===void 0?void 0:l.searchPlaceholder:"Search item"})};const x=()=>{p("");m(false);i(-1)};const y=g();n((()=>{var e;((e=l===null||l===void 0?void 0:l.searchInputProps)===null||e===void 0?void 0:e.reset)&&x()}),[(u=l===null||l===void 0?void 0:l.searchInputProps)===null||u===void 0?void 0:u.reset]);n((()=>{const e=!y&&!h;if(e)x()}),[h,y]);return{renderSearch:N,setIsSearching:m,searchVisible:y,searchThreshold:P,searchInputRef:I,filter:v,isSearching:h}};export{l as useSearch};
|
|
2
2
|
//# sourceMappingURL=useSearch.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../../src/components/Form/Select/SingleSelect/useSearch.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, { useEffect, useRef, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"useSearch.esm.js","sources":["../../../../../../../src/components/Form/Select/SingleSelect/useSearch.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, { useEffect, useRef, useState } from \"react\";\nimport { SearchProps } from \"../Select.interfaces\";\nimport { Input } from \"../../Input/Input\";\n\ninterface Props {\n search?: SearchProps;\n optionsCount: number;\n searchInputClassName: string;\n expanded: boolean;\n setFocusedSelectItem: (idx: number) => void;\n}\n\n/** @scope .*/\nexport const useSearch = ({\n search,\n optionsCount,\n searchInputClassName,\n expanded,\n setFocusedSelectItem\n}: Props) => {\n const [filter, setFilter] = useState(\"\");\n const [isSearching, setIsSearching] = useState(false);\n\n const DEFAULT_RENDER_THRESHOLD = 10;\n\n const searchInputRef = useRef<HTMLInputElement>(null);\n\n const threshold = search?.renderThreshold ?? DEFAULT_RENDER_THRESHOLD;\n const hasEnoughChildren = optionsCount >= threshold;\n\n const filterResults = (event: React.ChangeEvent<HTMLInputElement>) => {\n setFilter(event.currentTarget.value);\n };\n\n const shouldRenderSearch = () => {\n if (search?.enabled) {\n return hasEnoughChildren;\n }\n\n if (search) {\n return search.enabled as boolean;\n }\n\n return optionsCount > DEFAULT_RENDER_THRESHOLD;\n };\n\n const renderSearch = () => (\n <Input\n {...(search?.searchInputProps ?? {})}\n ref={searchInputRef}\n onFocus={() => setIsSearching(true)}\n onBlur={() => setIsSearching(false)}\n onChange={filterResults}\n className={searchInputClassName}\n wrapperProps={{\n className: search?.searchInputProps?.wrapperProps?.className\n }}\n style={{\n display: expanded ? \"block\" : \"none\"\n }}\n type=\"text\"\n name=\"search-option\"\n placeholder={search?.searchPlaceholder ? search?.searchPlaceholder : \"Search item\"}\n />\n );\n\n const resetSearchState = () => {\n setFilter(\"\");\n setIsSearching(false);\n setFocusedSelectItem(-1);\n };\n\n const visible = shouldRenderSearch();\n\n useEffect(() => {\n search?.searchInputProps?.reset && resetSearchState();\n }, [search?.searchInputProps?.reset]);\n\n useEffect(() => {\n const searchDeactivated =\n !visible &&\n !isSearching; /*solves issue in MultiSelect when we filtered result and selected result causes list to be shorter than threshold so still we have a filter applied but can't change it due to `visible` variable has false */\n if (searchDeactivated) {\n resetSearchState();\n }\n }, [isSearching, visible]);\n\n return {\n renderSearch,\n setIsSearching,\n searchVisible: visible,\n searchThreshold: threshold,\n searchInputRef,\n filter,\n isSearching\n };\n};\n"],"names":["useSearch","search","optionsCount","searchInputClassName","expanded","setFocusedSelectItem","filter","setFilter","useState","isSearching","setIsSearching","DEFAULT_RENDER_THRESHOLD","searchInputRef","useRef","threshold","_a","renderThreshold","hasEnoughChildren","filterResults","event","currentTarget","value","shouldRenderSearch","enabled","renderSearch","React","Input","searchInputProps","ref","onFocus","onBlur","onChange","className","wrapperProps","_c","_b","style","display","type","name","placeholder","searchPlaceholder","resetSearchState","visible","useEffect","reset","searchDeactivated","searchVisible","searchThreshold"],"mappings":"gHA6Ba,MAAAA,EAAY,EACvBC,SACAC,eACAC,uBACAC,WACAC,mCAEA,MAAOC,EAAQC,GAAaC,EAAS,IACrC,MAAOC,EAAaC,GAAkBF,EAAS,OAE/C,MAAMG,EAA2B,GAEjC,MAAMC,EAAiBC,EAAyB,MAEhD,MAAMC,GAAYC,EAAAd,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQe,mBAAmB,MAAAD,SAAA,EAAAA,EAAAJ,EAC7C,MAAMM,EAAoBf,GAAgBY,EAE1C,MAAMI,EAAiBC,IACrBZ,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-1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import l from"./Icon.module.esm.js";var r;(function(e){e["Bell"]="bell";e["BellAlt"]="bell-alt";e["Bookmark"]="bookmark";e["BookmarkAlt"]="bookmark-alt";e["Build"]="build";e["Calendar"]="calendar";e["Change"]="change";e["Checkmark"]="checkmark";e["CheckmarkCircle"]="checkmark-circle";e["CheckmarkCircleAlt"]="checkmark-circle-alt";e["CheckmarkCircleBreakout"]="checkmark-circle-breakout";e["CheckmarkSquare"]="checkmark-square";e["ChevronUp"]="chevron-up";e["ChevronDown"]="chevron-down";e["ChevronLeft"]="chevron-left";e["ChevronRight"]="chevron-right";e["Circle"]="circle";e["Clock"]="clock";e["Copy"]="copy";e["Edit"]="edit";e["Ellipsis"]="ellipsis";e["EllipsisAlt"]="ellipsis-alt";e["Equal"]="equal";e["Error"]="error-circle";e["ErrorAlt"]="error-circle-alt";e["Eye"]="eye";e["EyeBlocked"]="eye-blocked";e["Filter"]="filter";e["FilterAlt"]="filter-alt";e["FilterAltArrow"]="filter-alt-arrow";e["FilterAltTimes"]="filter-alt-times";e["Forbidden"]="forbidden";e["Fullscreen"]="fullscreen";e["FullscreenExit"]="fullscreen-exit";e["Gearwheel"]="gearwheel";e["Grid"]="grid";e["Hamburger"]="hamburger";e["HomeFilled"]="home-filled";e["Heart"]="heart";e["Image"]="image";e["InfoBell"]="info-bell";e["InfoCircle"]="info-circle";e["Link"]="link";e["MinusSquare"]="minus-square";e["NavigationFirst"]="navigation-first";e["NavigationLast"]="navigation-last";e["Plus"]="plus";e["Radio"]="radio";e["Refresh"]="refresh";e["Search"]="search";e["Share"]="share";e["Square"]="square";e["Star"]="star";e["StarAlt"]="star-alt";e["TableSearch"]="table-search";e["Times"]="times";e["TimesCircle"]="times-circle";e["TimesCircleAlt"]="times-circle-alt";e["TimesThin"]="times-thin";e["Trash"]="trash";e["TriangleDown"]="triangle-down";e["TriangleDownCircle"]="triangle-down-circle";e["TriangleLeft"]="triangle-left";e["TriangleRight"]="triangle-right";e["TriangleUp"]="triangle-up";e["Undo"]="undo";e["Warning"]="warning";e["WarningFilled"]="warning-filled";e["FileOutline"]="file-outline";e["FileUpload"]="file-upload-outline";e["FileDownload"]="file-download-outline";e["UploadOutline"]="upload-outline";e["ReplyOutline"]="reply-outline";e["SaveOutline"]="save-outline";e["DownloadFile"]="download-file-outline";e["RetryFile"]="retry";e["AbortFile"]="cancel";e["FileAltIcon"]="file-alt"})(r||(r={}));const i=({icon:r,color:i,className:a,style:t,size:o,tag:n="span",...c},s)=>{const
|
|
1
|
+
import e from"react";import l from"./Icon.module.esm.js";var r;(function(e){e["Bell"]="bell";e["BellAlt"]="bell-alt";e["Bookmark"]="bookmark";e["BookmarkAlt"]="bookmark-alt";e["Build"]="build";e["Calendar"]="calendar";e["Change"]="change";e["Checkmark"]="checkmark";e["CheckmarkCircle"]="checkmark-circle";e["CheckmarkCircleAlt"]="checkmark-circle-alt";e["CheckmarkCircleBreakout"]="checkmark-circle-breakout";e["CheckmarkSquare"]="checkmark-square";e["ChevronUp"]="chevron-up";e["ChevronDown"]="chevron-down";e["ChevronLeft"]="chevron-left";e["ChevronRight"]="chevron-right";e["Circle"]="circle";e["Clock"]="clock";e["Copy"]="copy";e["Edit"]="edit";e["Ellipsis"]="ellipsis";e["EllipsisAlt"]="ellipsis-alt";e["Equal"]="equal";e["Error"]="error-circle";e["ErrorAlt"]="error-circle-alt";e["Eye"]="eye";e["EyeBlocked"]="eye-blocked";e["Filter"]="filter";e["FilterAlt"]="filter-alt";e["FilterAltArrow"]="filter-alt-arrow";e["FilterAltTimes"]="filter-alt-times";e["Forbidden"]="forbidden";e["Fullscreen"]="fullscreen";e["FullscreenExit"]="fullscreen-exit";e["Gearwheel"]="gearwheel";e["Grid"]="grid";e["Hamburger"]="hamburger";e["HomeFilled"]="home-filled";e["Heart"]="heart";e["Image"]="image";e["InfoBell"]="info-bell";e["InfoCircle"]="info-circle";e["Link"]="link";e["MinusSquare"]="minus-square";e["NavigationFirst"]="navigation-first";e["NavigationLast"]="navigation-last";e["Plus"]="plus";e["Radio"]="radio";e["Refresh"]="refresh";e["Search"]="search";e["Share"]="share";e["Square"]="square";e["Star"]="star";e["StarAlt"]="star-alt";e["TableSearch"]="table-search";e["Times"]="times";e["TimesCircle"]="times-circle";e["TimesCircleAlt"]="times-circle-alt";e["TimesThin"]="times-thin";e["Trash"]="trash";e["TriangleDown"]="triangle-down";e["TriangleDownCircle"]="triangle-down-circle";e["TriangleLeft"]="triangle-left";e["TriangleRight"]="triangle-right";e["TriangleUp"]="triangle-up";e["Undo"]="undo";e["Warning"]="warning";e["WarningFilled"]="warning-filled";e["FileOutline"]="file-outline";e["FileUpload"]="file-upload-outline";e["FileDownload"]="file-download-outline";e["UploadOutline"]="upload-outline";e["ReplyOutline"]="reply-outline";e["SaveOutline"]="save-outline";e["DownloadFile"]="download-file-outline";e["RetryFile"]="retry";e["AbortFile"]="cancel";e["FileAltIcon"]="file-alt";e["AddCircle"]="add-circle"})(r||(r={}));const i=({icon:r,color:i,className:a,style:t,size:o,tag:n="span",...c},s)=>{const d=n;return e.createElement(d,{...c,ref:s,style:{color:i,...t,fontSize:o},"data-icon":true,"aria-hidden":"true",className:`${l["icon"]} ${l["icon-"+r]} ${a?a:""}`})};const a=e.forwardRef(i);export{a as Icon,r as Icons};
|
|
2
2
|
//# sourceMappingURL=Icon.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.esm.js","sources":["../../../../../src/components/Icon/Icon.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, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport classes from \"./Icon.module.scss\";\n\nexport enum Icons {\n Bell = \"bell\",\n BellAlt = \"bell-alt\",\n Bookmark = \"bookmark\",\n BookmarkAlt = \"bookmark-alt\",\n Build = \"build\",\n Calendar = \"calendar\",\n Change = \"change\",\n Checkmark = \"checkmark\",\n CheckmarkCircle = \"checkmark-circle\",\n CheckmarkCircleAlt = \"checkmark-circle-alt\",\n CheckmarkCircleBreakout = \"checkmark-circle-breakout\",\n CheckmarkSquare = \"checkmark-square\",\n ChevronUp = \"chevron-up\",\n ChevronDown = \"chevron-down\",\n ChevronLeft = \"chevron-left\",\n ChevronRight = \"chevron-right\",\n Circle = \"circle\",\n Clock = \"clock\",\n Copy = \"copy\",\n Edit = \"edit\",\n Ellipsis = \"ellipsis\",\n EllipsisAlt = \"ellipsis-alt\",\n Equal = \"equal\",\n Error = \"error-circle\",\n ErrorAlt = \"error-circle-alt\",\n Eye = \"eye\",\n EyeBlocked = \"eye-blocked\",\n Filter = \"filter\",\n FilterAlt = \"filter-alt\",\n FilterAltArrow = \"filter-alt-arrow\",\n FilterAltTimes = \"filter-alt-times\",\n Forbidden = \"forbidden\",\n Fullscreen = \"fullscreen\",\n FullscreenExit = \"fullscreen-exit\",\n Gearwheel = \"gearwheel\",\n Grid = \"grid\",\n Hamburger = \"hamburger\",\n HomeFilled = \"home-filled\",\n Heart = \"heart\",\n Image = \"image\",\n InfoBell = \"info-bell\",\n InfoCircle = \"info-circle\",\n Link = \"link\",\n MinusSquare = \"minus-square\",\n NavigationFirst = \"navigation-first\",\n NavigationLast = \"navigation-last\",\n Plus = \"plus\",\n Radio = \"radio\",\n Refresh = \"refresh\",\n Search = \"search\",\n Share = \"share\",\n Square = \"square\",\n Star = \"star\",\n StarAlt = \"star-alt\",\n TableSearch = \"table-search\",\n Times = \"times\",\n TimesCircle = \"times-circle\",\n TimesCircleAlt = \"times-circle-alt\",\n TimesThin = \"times-thin\",\n Trash = \"trash\",\n TriangleDown = \"triangle-down\",\n TriangleDownCircle = \"triangle-down-circle\",\n TriangleLeft = \"triangle-left\",\n TriangleRight = \"triangle-right\",\n TriangleUp = \"triangle-up\",\n Undo = \"undo\",\n Warning = \"warning\",\n WarningFilled = \"warning-filled\",\n FileOutline = \"file-outline\",\n FileUpload = \"file-upload-outline\",\n FileDownload = \"file-download-outline\",\n UploadOutline = \"upload-outline\",\n ReplyOutline = \"reply-outline\",\n SaveOutline = \"save-outline\",\n DownloadFile = \"download-file-outline\",\n RetryFile = \"retry\",\n AbortFile = \"cancel\",\n FileAltIcon = \"file-alt\"\n}\n\ntype Tag = \"span\" | \"div\" | \"i\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n icon: Icons;\n color?: string;\n size?: string;\n tag?: Tag;\n}\n\nconst IconComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { icon, color, className, style, size, tag = \"span\", ...rest }: Props,\n ref\n) => {\n const Component = tag;\n\n return (\n <Component\n {...rest}\n ref={ref}\n style={{ color: color, ...style, fontSize: size }}\n data-icon\n aria-hidden=\"true\"\n className={`${classes[\"icon\"]} ${classes[\"icon-\" + icon]} ${className ? className : \"\"}`}\n />\n );\n};\n\nexport const Icon = React.forwardRef(IconComponent);\n"],"names":["Icons","IconComponent","icon","color","className","style","size","tag","rest","ref","Component","React","createElement","fontSize","classes","Icon","forwardRef"],"mappings":"6DAmBYA,GAAZ,SAAYA,GACVA,EAAA,QAAA,OACAA,EAAA,WAAA,WACAA,EAAA,YAAA,WACAA,EAAA,eAAA,eACAA,EAAA,SAAA,QACAA,EAAA,YAAA,WACAA,EAAA,UAAA,SACAA,EAAA,aAAA,YACAA,EAAA,mBAAA,mBACAA,EAAA,sBAAA,uBACAA,EAAA,2BAAA,4BACAA,EAAA,mBAAA,mBACAA,EAAA,aAAA,aACAA,EAAA,eAAA,eACAA,EAAA,eAAA,eACAA,EAAA,gBAAA,gBACAA,EAAA,UAAA,SACAA,EAAA,SAAA,QACAA,EAAA,QAAA,OACAA,EAAA,QAAA,OACAA,EAAA,YAAA,WACAA,EAAA,eAAA,eACAA,EAAA,SAAA,QACAA,EAAA,SAAA,eACAA,EAAA,YAAA,mBACAA,EAAA,OAAA,MACAA,EAAA,cAAA,cACAA,EAAA,UAAA,SACAA,EAAA,aAAA,aACAA,EAAA,kBAAA,mBACAA,EAAA,kBAAA,mBACAA,EAAA,aAAA,YACAA,EAAA,cAAA,aACAA,EAAA,kBAAA,kBACAA,EAAA,aAAA,YACAA,EAAA,QAAA,OACAA,EAAA,aAAA,YACAA,EAAA,cAAA,cACAA,EAAA,SAAA,QACAA,EAAA,SAAA,QACAA,EAAA,YAAA,YACAA,EAAA,cAAA,cACAA,EAAA,QAAA,OACAA,EAAA,eAAA,eACAA,EAAA,mBAAA,mBACAA,EAAA,kBAAA,kBACAA,EAAA,QAAA,OACAA,EAAA,SAAA,QACAA,EAAA,WAAA,UACAA,EAAA,UAAA,SACAA,EAAA,SAAA,QACAA,EAAA,UAAA,SACAA,EAAA,QAAA,OACAA,EAAA,WAAA,WACAA,EAAA,eAAA,eACAA,EAAA,SAAA,QACAA,EAAA,eAAA,eACAA,EAAA,kBAAA,mBACAA,EAAA,aAAA,aACAA,EAAA,SAAA,QACAA,EAAA,gBAAA,gBACAA,EAAA,sBAAA,uBACAA,EAAA,gBAAA,gBACAA,EAAA,iBAAA,iBACAA,EAAA,cAAA,cACAA,EAAA,QAAA,OACAA,EAAA,WAAA,UACAA,EAAA,iBAAA,iBACAA,EAAA,eAAA,eACAA,EAAA,cAAA,sBACAA,EAAA,gBAAA,wBACAA,EAAA,iBAAA,iBACAA,EAAA,gBAAA,gBACAA,EAAA,eAAA,eACAA,EAAA,gBAAA,wBACAA,EAAA,aAAA,QACAA,EAAA,aAAA,SACAA,EAAA,eAAA,
|
|
1
|
+
{"version":3,"file":"Icon.esm.js","sources":["../../../../../src/components/Icon/Icon.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, { ForwardRefRenderFunction, ComponentPropsWithRef } from \"react\";\nimport classes from \"./Icon.module.scss\";\n\nexport enum Icons {\n Bell = \"bell\",\n BellAlt = \"bell-alt\",\n Bookmark = \"bookmark\",\n BookmarkAlt = \"bookmark-alt\",\n Build = \"build\",\n Calendar = \"calendar\",\n Change = \"change\",\n Checkmark = \"checkmark\",\n CheckmarkCircle = \"checkmark-circle\",\n CheckmarkCircleAlt = \"checkmark-circle-alt\",\n CheckmarkCircleBreakout = \"checkmark-circle-breakout\",\n CheckmarkSquare = \"checkmark-square\",\n ChevronUp = \"chevron-up\",\n ChevronDown = \"chevron-down\",\n ChevronLeft = \"chevron-left\",\n ChevronRight = \"chevron-right\",\n Circle = \"circle\",\n Clock = \"clock\",\n Copy = \"copy\",\n Edit = \"edit\",\n Ellipsis = \"ellipsis\",\n EllipsisAlt = \"ellipsis-alt\",\n Equal = \"equal\",\n Error = \"error-circle\",\n ErrorAlt = \"error-circle-alt\",\n Eye = \"eye\",\n EyeBlocked = \"eye-blocked\",\n Filter = \"filter\",\n FilterAlt = \"filter-alt\",\n FilterAltArrow = \"filter-alt-arrow\",\n FilterAltTimes = \"filter-alt-times\",\n Forbidden = \"forbidden\",\n Fullscreen = \"fullscreen\",\n FullscreenExit = \"fullscreen-exit\",\n Gearwheel = \"gearwheel\",\n Grid = \"grid\",\n Hamburger = \"hamburger\",\n HomeFilled = \"home-filled\",\n Heart = \"heart\",\n Image = \"image\",\n InfoBell = \"info-bell\",\n InfoCircle = \"info-circle\",\n Link = \"link\",\n MinusSquare = \"minus-square\",\n NavigationFirst = \"navigation-first\",\n NavigationLast = \"navigation-last\",\n Plus = \"plus\",\n Radio = \"radio\",\n Refresh = \"refresh\",\n Search = \"search\",\n Share = \"share\",\n Square = \"square\",\n Star = \"star\",\n StarAlt = \"star-alt\",\n TableSearch = \"table-search\",\n Times = \"times\",\n TimesCircle = \"times-circle\",\n TimesCircleAlt = \"times-circle-alt\",\n TimesThin = \"times-thin\",\n Trash = \"trash\",\n TriangleDown = \"triangle-down\",\n TriangleDownCircle = \"triangle-down-circle\",\n TriangleLeft = \"triangle-left\",\n TriangleRight = \"triangle-right\",\n TriangleUp = \"triangle-up\",\n Undo = \"undo\",\n Warning = \"warning\",\n WarningFilled = \"warning-filled\",\n FileOutline = \"file-outline\",\n FileUpload = \"file-upload-outline\",\n FileDownload = \"file-download-outline\",\n UploadOutline = \"upload-outline\",\n ReplyOutline = \"reply-outline\",\n SaveOutline = \"save-outline\",\n DownloadFile = \"download-file-outline\",\n RetryFile = \"retry\",\n AbortFile = \"cancel\",\n FileAltIcon = \"file-alt\",\n AddCircle = \"add-circle\"\n}\n\ntype Tag = \"span\" | \"div\" | \"i\";\n\nexport interface Props extends ComponentPropsWithRef<\"div\"> {\n icon: Icons;\n color?: string;\n size?: string;\n tag?: Tag;\n}\n\nconst IconComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n { icon, color, className, style, size, tag = \"span\", ...rest }: Props,\n ref\n) => {\n const Component = tag;\n\n return (\n <Component\n {...rest}\n ref={ref}\n style={{ color: color, ...style, fontSize: size }}\n data-icon\n aria-hidden=\"true\"\n className={`${classes[\"icon\"]} ${classes[\"icon-\" + icon]} ${className ? className : \"\"}`}\n />\n );\n};\n\nexport const Icon = React.forwardRef(IconComponent);\n"],"names":["Icons","IconComponent","icon","color","className","style","size","tag","rest","ref","Component","React","createElement","fontSize","classes","Icon","forwardRef"],"mappings":"6DAmBYA,GAAZ,SAAYA,GACVA,EAAA,QAAA,OACAA,EAAA,WAAA,WACAA,E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