@onewelcome/react-lib-components 14.0.0-experiment.1 → 14.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/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.cjs.js +1 -1
- package/dist/components/Button/Button.cjs.js.map +1 -1
- package/dist/components/Button/Button.es.js +11 -2
- package/dist/components/Button/Button.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuItem.es.js.map +1 -1
- 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/ContextMenu/ContextMenuService.cjs.js +1 -1
- package/dist/components/ContextMenu/ContextMenuService.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuService.es.js +20 -17
- package/dist/components/ContextMenu/ContextMenuService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.es.js +102 -59
- package/dist/components/DataGrid/DataGrid.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -6
- package/dist/components/DataGrid/DataGrid.module.scss.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js +4 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js +2 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js.map +1 -1
- 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/DataGridBody/DataGridRow/useNestedRow.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js +4 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js.map +1 -1
- 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/DataGridFilterPopover.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.es.js.map +1 -1
- 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 +17 -21
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js +15 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +54 -6
- 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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js +4 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.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.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js.map +1 -1
- 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/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js +45 -24
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js +7 -9
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js +6 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +7 -4
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js +14 -12
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js +11 -10
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Form/Checkbox/Checkbox.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Fieldset/Fieldset.cjs.js.map +1 -1
- package/dist/components/Form/Fieldset/Fieldset.es.js +3 -2
- package/dist/components/Form/Fieldset/Fieldset.es.js.map +1 -1
- package/dist/components/Form/Fieldset/Fieldset.module.scss.cjs.js +2 -2
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js +8 -5
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileUpload.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileUpload.es.js +6 -6
- package/dist/components/Form/FileUpload/FileUpload.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FormControl/FormControl.cjs.js.map +1 -1
- package/dist/components/Form/FormControl/FormControl.es.js +3 -3
- package/dist/components/Form/FormControl/FormControl.es.js.map +1 -1
- 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 +9 -6
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js.map +1 -1
- package/dist/components/Form/FormGroup/FormGroup.cjs.js.map +1 -1
- package/dist/components/Form/FormGroup/FormGroup.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js.map +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js +4 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js.map +1 -1
- 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 +48 -5
- 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.cjs.js.map +1 -1
- package/dist/components/Form/Radio/Radio.es.js +1 -1
- package/dist/components/Form/Radio/Radio.es.js.map +1 -1
- 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 +11 -10
- 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 +236 -57
- 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 -15
- 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 +134 -32
- 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 +73 -55
- 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 +16 -9
- 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 +202 -46
- 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 -17
- 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 +176 -89
- 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 +48 -36
- 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 +8 -6
- 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/Select/useSelectPositionList.cjs.js +1 -1
- package/dist/components/Form/Select/useSelectPositionList.cjs.js.map +1 -1
- package/dist/components/Form/Select/useSelectPositionList.es.js +18 -5
- package/dist/components/Form/Select/useSelectPositionList.es.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.cjs.js +1 -1
- package/dist/components/Form/Textarea/Textarea.cjs.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.es.js +4 -0
- package/dist/components/Form/Textarea/Textarea.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Toggle/Toggle.cjs.js.map +1 -1
- package/dist/components/Form/Toggle/Toggle.es.js +5 -3
- package/dist/components/Form/Toggle/Toggle.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js +25 -17
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +8 -4
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js +41 -22
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js +8 -4
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js.map +1 -1
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js +2 -0
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Icon/Icon.cjs.js.map +1 -1
- package/dist/components/Icon/Icon.es.js +2 -1
- package/dist/components/Icon/Icon.es.js.map +1 -1
- package/dist/components/Icon/Icon.module.scss.cjs.js +2 -2
- package/dist/components/Icon/Icon.module.scss.es.js +108 -107
- package/dist/components/Icon/Icon.module.scss.es.js.map +1 -1
- package/dist/components/Layout/ActionBar/ActionBar.cjs.js +2 -0
- package/dist/components/Layout/ActionBar/ActionBar.cjs.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.es.js +122 -0
- package/dist/components/Layout/ActionBar/ActionBar.es.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js +3 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js +24 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js.map +1 -0
- 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.cjs.js +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js +66 -41
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +28 -13
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Link/Link.es.js +1 -1
- package/dist/components/Link/Link.es.js.map +1 -1
- 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/AlertContainer/useAlertContainerHeightAnimation.cjs.js +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js +7 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.es.js.map +1 -1
- 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/DiscardChangesModal/DiscardChangesModal.cjs.js.map +1 -1
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.es.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.cjs.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Pagination/Pagination.cjs.js.map +1 -1
- package/dist/components/Pagination/Pagination.es.js +118 -90
- package/dist/components/Pagination/Pagination.es.js.map +1 -1
- package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
- package/dist/components/Pagination/Pagination.module.scss.es.js +15 -14
- package/dist/components/Pagination/Pagination.module.scss.es.js.map +1 -1
- package/dist/components/Popover/Popover.cjs.js.map +1 -1
- package/dist/components/Popover/Popover.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Tabs/TabButton.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Tabs/Tabs.cjs.js.map +1 -1
- package/dist/components/Tabs/Tabs.es.js +1 -1
- package/dist/components/Tabs/Tabs.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/TextEllipsis/TextEllipsis.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/Tiles/Tile.es.js.map +1 -1
- 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.cjs.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.es.js +47 -39
- package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.scss.cjs.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.es.js +28 -27
- package/dist/components/Tooltip/Tooltip.module.scss.es.js.map +1 -1
- 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/_BaseStyling_/BaseStyling.cjs.js +2 -1
- package/dist/components/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
- package/dist/components/_BaseStyling_/BaseStyling.es.js +3 -3
- package/dist/components/_BaseStyling_/BaseStyling.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js.map +1 -1
- 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/ButtonLeftNavItem.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js +3 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js.map +1 -1
- 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/LeftNav/LeftNavItem/LinkLeftNavItem.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js +6 -2
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js +7 -6
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js.map +1 -1
- 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.cjs.js.map +1 -1
- package/dist/components/miscellaneous/IdentityProviderButton.es.js.map +1 -1
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
- package/dist/components/withReadOnly.cjs.js +1 -1
- package/dist/components/withReadOnly.cjs.js.map +1 -1
- package/dist/components/withReadOnly.es.js +2 -4
- package/dist/components/withReadOnly.es.js.map +1 -1
- 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 +9 -2
- package/dist/hooks/useDebouncedCallback.es.js.map +1 -1
- package/dist/hooks/useGetDomRoot.cjs.js.map +1 -1
- package/dist/hooks/useGetDomRoot.es.js.map +1 -1
- package/dist/hooks/usePosition.cjs.js +1 -1
- package/dist/hooks/usePosition.cjs.js.map +1 -1
- package/dist/hooks/usePosition.es.js +105 -4
- package/dist/hooks/usePosition.es.js.map +1 -1
- package/dist/hooks/useRepeatFocus.cjs.js.map +1 -1
- package/dist/hooks/useRepeatFocus.es.js.map +1 -1
- package/dist/hooks/useScreenSize.cjs.js +1 -1
- package/dist/hooks/useScreenSize.cjs.js.map +1 -1
- package/dist/hooks/useScreenSize.es.js +1 -1
- package/dist/hooks/useScreenSize.es.js.map +1 -1
- package/dist/hooks/useStickyStacking.cjs.js +2 -0
- package/dist/hooks/useStickyStacking.cjs.js.map +1 -0
- package/dist/hooks/useStickyStacking.es.js +208 -0
- package/dist/hooks/useStickyStacking.es.js.map +1 -0
- package/dist/hooks/useUploadFile.cjs.js +1 -1
- package/dist/hooks/useUploadFile.cjs.js.map +1 -1
- package/dist/hooks/useUploadFile.es.js +1 -1
- package/dist/hooks/useUploadFile.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +140 -29
- package/dist/index.es.js +4 -0
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.cjs.js +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.cjs.js.map +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.es.js +4 -3
- package/dist/node_modules/tabbable/dist/index.esm.es.js.map +1 -1
- 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 +33 -16
- package/dist/util/helper.es.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreenSize.cjs.js","sources":["../../src/hooks/useScreenSize.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 { useState, useEffect } from \"react\";\nimport { breakpoints, ScreenSize } from \"../variables\";\n\ninterface Props {\n onScreenSizeChange?: (nextScreenSize: ScreenSize, prevScreenSize?: ScreenSize) => void;\n}\n\nconst emToPx = (em: number)
|
|
1
|
+
{"version":3,"file":"useScreenSize.cjs.js","sources":["../../src/hooks/useScreenSize.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 { useState, useEffect } from \"react\";\nimport { breakpoints, ScreenSize } from \"../variables\";\n\ninterface Props {\n onScreenSizeChange?: (nextScreenSize: ScreenSize, prevScreenSize?: ScreenSize) => void;\n}\n\nconst emToPx = (em: number) =>\n em * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst getScreenSize = (width: number) => {\n if (width < emToPx(breakpoints[ScreenSize.SMALL])) {\n return ScreenSize.SMALL;\n }\n if (width < emToPx(breakpoints[ScreenSize.MEDIUM])) {\n return ScreenSize.MEDIUM;\n }\n\n return ScreenSize.LARGE;\n};\n\nexport const useScreenSize = ({ onScreenSizeChange }: Props = {}) => {\n const [screenSize, setScreenSize] = useState<ScreenSize>(getScreenSize(window.innerWidth));\n\n useEffect(() => {\n const handleResize = () => {\n const newScreenSize = getScreenSize(window.innerWidth);\n setScreenSize(prevScreenSize => {\n if (newScreenSize !== prevScreenSize) {\n onScreenSizeChange?.(newScreenSize, prevScreenSize);\n return newScreenSize;\n }\n return prevScreenSize;\n });\n };\n\n window.addEventListener(\"resize\", handleResize);\n handleResize();\n return () => window.removeEventListener(\"resize\", handleResize);\n }, []);\n\n const isDesktopScreenSize = () => screenSize === ScreenSize.LARGE;\n\n return { screenSize, isDesktopScreenSize };\n};\n"],"names":["emToPx","em","Number","parseFloat","getComputedStyle","document","documentElement","fontSize","getScreenSize","width","breakpoints","ScreenSize","SMALL","MEDIUM","LARGE","onScreenSizeChange","screenSize","setScreenSize","useState","window","innerWidth","useEffect","handleResize","newScreenSize","prevScreenSize","addEventListener","removeEventListener","isDesktopScreenSize"],"mappings":"0IAuBMA,EAAUC,GACdA,EAAKC,OAAOC,WAAWC,iBAAiBC,SAASC,iBAAiBC,UAE9DC,EAAiBC,GACjBA,EAAQT,EAAOU,EAAAA,YAAYC,EAAAA,WAAWC,QACjCD,EAAAA,WAAWC,MAEhBH,EAAQT,EAAOU,EAAAA,YAAYC,EAAAA,WAAWE,SACjCF,EAAAA,WAAWE,OAGbF,EAAAA,WAAWG,4BAGS,EAAGC,sBAA8B,MAC5D,MAAOC,EAAYC,GAAiBC,EAAAA,SAAqBV,EAAcW,OAAOC,aAqB9E,OAnBAC,EAAAA,UAAU,KACR,MAAMC,EAAe,KACnB,MAAMC,EAAgBf,EAAcW,OAAOC,YAC3CH,EAAcO,GACRD,IAAkBC,GACpB,MAAAT,GAAAA,EAAqBQ,EAAeC,GAC7BD,GAEFC,IAMX,OAFAL,OAAOM,iBAAiB,SAAUH,GAClCA,IACO,IAAMH,OAAOO,oBAAoB,SAAUJ,IACjD,IAII,CAAEN,aAAYW,oBAFO,IAAMX,IAAeL,EAAAA,WAAWG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { breakpoints, ScreenSize } from "../variables.es.js";
|
|
3
|
-
const emToPx = (em) => em * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
3
|
+
const emToPx = (em) => em * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
4
4
|
const getScreenSize = (width) => {
|
|
5
5
|
if (width < emToPx(breakpoints[ScreenSize.SMALL])) {
|
|
6
6
|
return ScreenSize.SMALL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreenSize.es.js","sources":["../../src/hooks/useScreenSize.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 { useState, useEffect } from \"react\";\nimport { breakpoints, ScreenSize } from \"../variables\";\n\ninterface Props {\n onScreenSizeChange?: (nextScreenSize: ScreenSize, prevScreenSize?: ScreenSize) => void;\n}\n\nconst emToPx = (em: number)
|
|
1
|
+
{"version":3,"file":"useScreenSize.es.js","sources":["../../src/hooks/useScreenSize.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 { useState, useEffect } from \"react\";\nimport { breakpoints, ScreenSize } from \"../variables\";\n\ninterface Props {\n onScreenSizeChange?: (nextScreenSize: ScreenSize, prevScreenSize?: ScreenSize) => void;\n}\n\nconst emToPx = (em: number) =>\n em * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n\nconst getScreenSize = (width: number) => {\n if (width < emToPx(breakpoints[ScreenSize.SMALL])) {\n return ScreenSize.SMALL;\n }\n if (width < emToPx(breakpoints[ScreenSize.MEDIUM])) {\n return ScreenSize.MEDIUM;\n }\n\n return ScreenSize.LARGE;\n};\n\nexport const useScreenSize = ({ onScreenSizeChange }: Props = {}) => {\n const [screenSize, setScreenSize] = useState<ScreenSize>(getScreenSize(window.innerWidth));\n\n useEffect(() => {\n const handleResize = () => {\n const newScreenSize = getScreenSize(window.innerWidth);\n setScreenSize(prevScreenSize => {\n if (newScreenSize !== prevScreenSize) {\n onScreenSizeChange?.(newScreenSize, prevScreenSize);\n return newScreenSize;\n }\n return prevScreenSize;\n });\n };\n\n window.addEventListener(\"resize\", handleResize);\n handleResize();\n return () => window.removeEventListener(\"resize\", handleResize);\n }, []);\n\n const isDesktopScreenSize = () => screenSize === ScreenSize.LARGE;\n\n return { screenSize, isDesktopScreenSize };\n};\n"],"names":[],"mappings":";;AAuBA,MAAM,SAAS,CAAC,OACd,KAAK,OAAO,WAAW,iBAAiB,SAAS,eAAe,EAAE,QAAQ;AAE5E,MAAM,gBAAgB,CAAC,UAAkB;AACvC,MAAI,QAAQ,OAAO,YAAY,WAAW,KAAK,CAAC,GAAG;AACjD,WAAO,WAAW;AAAA,EACpB;AACA,MAAI,QAAQ,OAAO,YAAY,WAAW,MAAM,CAAC,GAAG;AAClD,WAAO,WAAW;AAAA,EACpB;AAEA,SAAO,WAAW;AACpB;AAEO,MAAM,gBAAgB,CAAC,EAAE,mBAAA,IAA8B,OAAO;AACnE,QAAM,CAAC,YAAY,aAAa,IAAI,SAAqB,cAAc,OAAO,UAAU,CAAC;AAEzF,YAAU,MAAM;AACd,UAAM,eAAe,MAAM;AACzB,YAAM,gBAAgB,cAAc,OAAO,UAAU;AACrD,oBAAc,CAAA,mBAAkB;AAC9B,YAAI,kBAAkB,gBAAgB;AACpC,mEAAqB,eAAe;AACpC,iBAAO;AAAA,QACT;AACA,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAEA,WAAO,iBAAiB,UAAU,YAAY;AAC9C,iBAAA;AACA,WAAO,MAAM,OAAO,oBAAoB,UAAU,YAAY;AAAA,EAChE,GAAG,CAAA,CAAE;AAEL,QAAM,sBAAsB,MAAM,eAAe,WAAW;AAE5D,SAAO,EAAE,YAAY,oBAAA;AACvB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=new Map,o=new Set;let n=0,r=null,s=0;function c(e,o){let n=0;for(let r=0;r<o;r++){const o=e[r],s=t.get(o);if(null==s?void 0:s.scope){const e=s.scope.getBoundingClientRect(),t=Math.min(o.offsetHeight,e.bottom-n);if(t<=0)continue;n+=t;continue}n+=o.offsetHeight}return n}function l(){const e=[...t.keys()].sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);for(let o=0;o<e.length;o++){const n=e[o],r=t.get(n);if(!r)continue;const s=c(e,o);let l=0;s>0?l=s-1:r.cssOnly&&(l=-1),r.offset=l,n.style.setProperty("--sticky-stack-offset",`${l}px`),r.cssOnly||(n.style.position="sticky",n.style.top=`${l}px`,n.style.zIndex=`${r.zIndex}`)}}function i(){l(),o.forEach(e=>e())}const u=new Map;function f(e){const t=u.get(e);t?t.count++:(u.set(e,{count:1,previous:e.style.getPropertyValue("overflow-anchor")}),e.style.setProperty("overflow-anchor","none"))}function d(e){const t=u.get(e);t&&(t.count--,t.count>0||(u.delete(e),t.previous?e.style.setProperty("overflow-anchor",t.previous):e.style.removeProperty("overflow-anchor")))}exports.useStickyStacking=function(c,u=!0){const y="boolean"==typeof u?{enabled:u}:u,{enabled:a=!0,cssOnly:p=!1,zIndex:m,scope:v,disableScrollAnchoring:w=!1}=y,[g,E]=e.useState(!1),h=e.useRef(!1);e.useEffect(()=>{const e=c.current;if(!a||!e)return E(!1),void(h.current=!1);const u=(null==v?void 0:v.current)??void 0,y={element:e,scope:u,zIndex:m??(u?2:3),cssOnly:p,offset:0};t.set(e,y);const g=function(e){const t=e.ownerDocument,o=t.defaultView;let n=e.parentElement;for(;n&&n!==t.documentElement;){const e=o?o.getComputedStyle(n).overflowY:"";if("auto"===e||"scroll"===e||"overlay"===e)return n;n=n.parentElement}return null}(e),P=w?function(e,t){if(t)return[t];const o=e.ownerDocument;return o.body?[o.documentElement,o.body]:[o.documentElement]}(e,g):[];P.forEach(f);const b=()=>{const t=e.getBoundingClientRect(),o=g?g.getBoundingClientRect().top:0,n=(!g||g.scrollTop>0)&&t.top<=o+y.offset;n!==h.current&&(h.current=n,E(n))},O=new ResizeObserver(()=>{i()});return O.observe(e),o.add(b),n++,1===n&&(r=()=>{s||(s=requestAnimationFrame(()=>{s=0,i()}))},window.addEventListener("scroll",r,!0),window.addEventListener("resize",r)),i(),()=>{t.delete(e),o.delete(b),O.disconnect(),n--,0===n&&r&&(s&&(cancelAnimationFrame(s),s=0),window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r),r=null),P.forEach(d),l(),e.style.removeProperty("--sticky-stack-offset"),p||(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("z-index")),h.current=!1,E(!1)}},[a,c,v,m,p,w]);const P=e.useRef(!0);return e.useLayoutEffect(()=>{P.current?P.current=!1:l()},[g]),{isStuck:g}};
|
|
2
|
+
//# sourceMappingURL=useStickyStacking.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStickyStacking.cjs.js","sources":["../../src/hooks/useStickyStacking.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 { useEffect, useLayoutEffect, useRef, useState, RefObject } from \"react\";\n\ninterface StickyEntry {\n element: HTMLElement;\n scope?: HTMLElement;\n zIndex: number;\n cssOnly: boolean;\n offset: number;\n}\n\nexport interface StickyStackingOptions {\n enabled?: boolean;\n zIndex?: number;\n scope?: RefObject<HTMLElement | null>;\n cssOnly?: boolean;\n /**\n * Set when the sticky element changes size while docked (e.g. a header that\n * collapses when stuck). While such an element is mounted, scroll anchoring is\n * suppressed on its scroll container: otherwise the browser nudges the scroll\n * position to compensate for the element's own resize, which re-crosses the\n * stuck/unstuck threshold and makes the element oscillate indefinitely.\n */\n disableScrollAnchoring?: boolean;\n}\n\nexport interface StickyStackingResult {\n isStuck: boolean;\n}\n\nconst registry = new Map<HTMLElement, StickyEntry>();\nconst listeners = new Set<() => void>();\n\nlet scrollListenerCount = 0;\nlet scrollHandler: (() => void) | null = null;\nlet scrollFrame = 0;\n\nfunction computeCumulativeTop(sorted: HTMLElement[], myIndex: number): number {\n let top = 0;\n for (let i = 0; i < myIndex; i++) {\n const other = sorted[i];\n const otherEntry = registry.get(other);\n\n if (otherEntry?.scope) {\n const scopeRect = otherEntry.scope.getBoundingClientRect();\n const occupied = Math.min(other.offsetHeight, scopeRect.bottom - top);\n if (occupied <= 0) {\n continue;\n }\n top += occupied;\n continue;\n }\n\n top += other.offsetHeight;\n }\n return top;\n}\n\nfunction repositionAll() {\n const sorted = [...registry.keys()].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n );\n\n for (let myIndex = 0; myIndex < sorted.length; myIndex++) {\n const el = sorted[myIndex];\n const entry = registry.get(el);\n if (!entry) {\n continue;\n }\n\n const top = computeCumulativeTop(sorted, myIndex);\n\n let calculatedOffset = 0;\n if (top > 0) {\n calculatedOffset = top - 1;\n } else if (entry.cssOnly) {\n calculatedOffset = -1;\n }\n entry.offset = calculatedOffset;\n\n el.style.setProperty(\"--sticky-stack-offset\", `${calculatedOffset}px`);\n\n if (!entry.cssOnly) {\n el.style.position = \"sticky\";\n el.style.top = `${calculatedOffset}px`;\n el.style.zIndex = `${entry.zIndex}`;\n }\n }\n}\n\nfunction updateAll() {\n repositionAll();\n listeners.forEach(fn => fn());\n}\n\nfunction addScrollListener() {\n scrollListenerCount++;\n if (scrollListenerCount === 1) {\n scrollHandler = () => {\n if (!scrollFrame) {\n scrollFrame = requestAnimationFrame(() => {\n scrollFrame = 0;\n updateAll();\n });\n }\n };\n window.addEventListener(\"scroll\", scrollHandler, true);\n window.addEventListener(\"resize\", scrollHandler);\n }\n}\n\nfunction removeScrollListener() {\n scrollListenerCount--;\n if (scrollListenerCount === 0 && scrollHandler) {\n if (scrollFrame) {\n cancelAnimationFrame(scrollFrame);\n scrollFrame = 0;\n }\n window.removeEventListener(\"scroll\", scrollHandler, true);\n window.removeEventListener(\"resize\", scrollHandler);\n scrollHandler = null;\n }\n}\n\n// Elements whose scroll anchoring we have suppressed, ref-counted so multiple\n// resizing sticky elements sharing a scroll container restore it exactly once.\nconst scrollAnchorSuppressors = new Map<HTMLElement, { count: number; previous: string }>();\n\n/**\n * Nearest scrollable ancestor the element docks within, or null when it sticks\n * to the document/window scroller. Uses the element's own document/window so\n * it works inside iframes (e.g. the Storybook canvas).\n */\nfunction findScrollContainer(el: HTMLElement): HTMLElement | null {\n const doc = el.ownerDocument;\n const win = doc.defaultView;\n let node = el.parentElement;\n while (node && node !== doc.documentElement) {\n const overflowY = win ? win.getComputedStyle(node).overflowY : \"\";\n if (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\") {\n return node;\n }\n node = node.parentElement;\n }\n return null;\n}\n\n/**\n * Resolve which element(s) to suppress scroll anchoring on: the scrolling box the\n * sticky element docks within (nearest scrollable ancestor).\n *\n * For the root/viewport scroller there is a well-known quirk: whether scroll\n * anchoring is controlled by <html> or <body> differs between browsers, and\n * suppressing it on only one leaves the other anchoring the viewport (verified\n * live — the header still snapped back to scrollTop 0 with `none` on <html>\n * alone). So for the root case we suppress on both.\n */\nfunction getAnchorSuppressionTargets(\n el: HTMLElement,\n scrollContainer: HTMLElement | null\n): HTMLElement[] {\n if (scrollContainer) {\n return [scrollContainer];\n }\n const doc = el.ownerDocument;\n return doc.body ? [doc.documentElement, doc.body] : [doc.documentElement];\n}\n\nfunction suppressScrollAnchoring(container: HTMLElement) {\n const existing = scrollAnchorSuppressors.get(container);\n if (existing) {\n existing.count++;\n return;\n }\n scrollAnchorSuppressors.set(container, {\n count: 1,\n previous: container.style.getPropertyValue(\"overflow-anchor\")\n });\n container.style.setProperty(\"overflow-anchor\", \"none\");\n}\n\nfunction restoreScrollAnchoring(container: HTMLElement) {\n const existing = scrollAnchorSuppressors.get(container);\n if (!existing) {\n return;\n }\n existing.count--;\n if (existing.count > 0) {\n return;\n }\n scrollAnchorSuppressors.delete(container);\n if (existing.previous) {\n container.style.setProperty(\"overflow-anchor\", existing.previous);\n } else {\n container.style.removeProperty(\"overflow-anchor\");\n }\n}\n\nexport function useStickyStacking(\n ref: RefObject<HTMLElement | null>,\n options: StickyStackingOptions | boolean = true\n): StickyStackingResult {\n const opts = typeof options === \"boolean\" ? { enabled: options } : options;\n const {\n enabled = true,\n cssOnly = false,\n zIndex: zIndexOption,\n scope,\n disableScrollAnchoring = false\n } = opts;\n\n const [isStuck, setIsStuck] = useState(false);\n const isStuckRef = useRef(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!enabled || !el) {\n setIsStuck(false);\n isStuckRef.current = false;\n return;\n }\n\n const resolvedScope = scope?.current ?? undefined;\n const zIndex = zIndexOption ?? (resolvedScope ? 2 : 3);\n\n const entry: StickyEntry = {\n element: el,\n scope: resolvedScope,\n zIndex,\n cssOnly,\n offset: 0\n };\n registry.set(el, entry);\n\n const scrollContainer = findScrollContainer(el);\n const scrollAnchorTargets = disableScrollAnchoring\n ? getAnchorSuppressionTargets(el, scrollContainer)\n : [];\n scrollAnchorTargets.forEach(suppressScrollAnchoring);\n\n const detect = () => {\n const rect = el.getBoundingClientRect();\n const containerTop = scrollContainer ? scrollContainer.getBoundingClientRect().top : 0;\n const stuck =\n (!scrollContainer || scrollContainer.scrollTop > 0) &&\n rect.top <= containerTop + entry.offset;\n if (stuck !== isStuckRef.current) {\n isStuckRef.current = stuck;\n setIsStuck(stuck);\n }\n };\n\n const observer = new ResizeObserver(() => {\n updateAll();\n });\n observer.observe(el);\n\n listeners.add(detect);\n addScrollListener();\n updateAll();\n\n return () => {\n registry.delete(el);\n listeners.delete(detect);\n observer.disconnect();\n removeScrollListener();\n scrollAnchorTargets.forEach(restoreScrollAnchoring);\n repositionAll();\n\n el.style.removeProperty(\"--sticky-stack-offset\");\n if (!cssOnly) {\n el.style.removeProperty(\"position\");\n el.style.removeProperty(\"top\");\n el.style.removeProperty(\"z-index\");\n }\n\n isStuckRef.current = false;\n setIsStuck(false);\n };\n }, [enabled, ref, scope, zIndexOption, cssOnly, disableScrollAnchoring]);\n\n const isInitialMount = useRef(true);\n useLayoutEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n return;\n }\n repositionAll();\n }, [isStuck]);\n\n return { isStuck };\n}\n"],"names":["registry","Map","listeners","Set","scrollListenerCount","scrollHandler","scrollFrame","computeCumulativeTop","sorted","myIndex","top","i","other","otherEntry","get","scope","scopeRect","getBoundingClientRect","occupied","Math","min","offsetHeight","bottom","repositionAll","keys","sort","a","b","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","length","el","entry","calculatedOffset","cssOnly","offset","style","setProperty","position","zIndex","updateAll","forEach","fn","scrollAnchorSuppressors","suppressScrollAnchoring","container","existing","count","set","previous","getPropertyValue","restoreScrollAnchoring","delete","removeProperty","ref","options","opts","enabled","zIndexOption","disableScrollAnchoring","isStuck","setIsStuck","useState","isStuckRef","useRef","useEffect","current","resolvedScope","element","scrollContainer","doc","ownerDocument","win","defaultView","node","parentElement","documentElement","overflowY","getComputedStyle","findScrollContainer","scrollAnchorTargets","body","getAnchorSuppressionTargets","detect","rect","containerTop","stuck","scrollTop","observer","ResizeObserver","observe","add","requestAnimationFrame","window","addEventListener","disconnect","cancelAnimationFrame","removeEventListener","isInitialMount","useLayoutEffect"],"mappings":"yGA6CMA,MAAeC,IACfC,MAAgBC,IAEtB,IAAIC,EAAsB,EACtBC,EAAqC,KACrCC,EAAc,EAElB,SAASC,EAAqBC,EAAuBC,GACnD,IAAIC,EAAM,EACV,IAAA,IAASC,EAAI,EAAGA,EAAIF,EAASE,IAAK,CAChC,MAAMC,EAAQJ,EAAOG,GACfE,EAAab,EAASc,IAAIF,GAEhC,SAAIC,WAAYE,MAAO,CACrB,MAAMC,EAAYH,EAAWE,MAAME,wBAC7BC,EAAWC,KAAKC,IAAIR,EAAMS,aAAcL,EAAUM,OAASZ,GACjE,GAAIQ,GAAY,EACd,SAEFR,GAAOQ,EACP,QACF,CAEAR,GAAOE,EAAMS,YACf,CACA,OAAOX,CACT,CAEA,SAASa,IACP,MAAMf,EAAS,IAAIR,EAASwB,QAAQC,KAAK,CAACC,EAAGC,IAC3CD,EAAEE,wBAAwBD,GAAKE,KAAKC,6BAA8B,EAAK,GAGzE,IAAA,IAASrB,EAAU,EAAGA,EAAUD,EAAOuB,OAAQtB,IAAW,CACxD,MAAMuB,EAAKxB,EAAOC,GACZwB,EAAQjC,EAASc,IAAIkB,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IAEO,KACLzC,EAASqD,OAAOrB,GAChB9B,EAAUmD,OAAO+B,GACjBK,EAASO,aAxJb5F,IAC4B,IAAxBA,GAA6BC,IAC3BC,IACF2F,qBAAqB3F,GACrBA,EAAc,GAEhBwF,OAAOI,oBAAoB,SAAU7F,GAAe,GACpDyF,OAAOI,oBAAoB,SAAU7F,GACrCA,EAAgB,MAkJd4E,EAAoBvC,QAAQU,GAC5B7B,IAEAS,EAAGK,MAAMiB,eAAe,yBACnBnB,IACHH,EAAGK,MAAMiB,eAAe,YACxBtB,EAAGK,MAAMiB,eAAe,OACxBtB,EAAGK,MAAMiB,eAAe,YAG1BU,EAAWG,SAAU,EACrBL,GAAW,KAEZ,CAACJ,EAASH,EAAKxC,EAAO4C,EAAcxB,EAASyB,IAEhD,MAAMuC,EAAiBlC,EAAAA,QAAO,GAS9B,OARAmC,EAAAA,gBAAgB,KACVD,EAAehC,QACjBgC,EAAehC,SAAU,EAG3B5C,KACC,CAACsC,IAEG,CAAEA,UACX"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useLayoutEffect } from "react";
|
|
2
|
+
const registry = /* @__PURE__ */ new Map();
|
|
3
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4
|
+
let scrollListenerCount = 0;
|
|
5
|
+
let scrollHandler = null;
|
|
6
|
+
let scrollFrame = 0;
|
|
7
|
+
function computeCumulativeTop(sorted, myIndex) {
|
|
8
|
+
let top = 0;
|
|
9
|
+
for (let i = 0; i < myIndex; i++) {
|
|
10
|
+
const other = sorted[i];
|
|
11
|
+
const otherEntry = registry.get(other);
|
|
12
|
+
if (otherEntry == null ? void 0 : otherEntry.scope) {
|
|
13
|
+
const scopeRect = otherEntry.scope.getBoundingClientRect();
|
|
14
|
+
const occupied = Math.min(other.offsetHeight, scopeRect.bottom - top);
|
|
15
|
+
if (occupied <= 0) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
top += occupied;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
top += other.offsetHeight;
|
|
22
|
+
}
|
|
23
|
+
return top;
|
|
24
|
+
}
|
|
25
|
+
function repositionAll() {
|
|
26
|
+
const sorted = [...registry.keys()].sort(
|
|
27
|
+
(a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1
|
|
28
|
+
);
|
|
29
|
+
for (let myIndex = 0; myIndex < sorted.length; myIndex++) {
|
|
30
|
+
const el = sorted[myIndex];
|
|
31
|
+
const entry = registry.get(el);
|
|
32
|
+
if (!entry) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const top = computeCumulativeTop(sorted, myIndex);
|
|
36
|
+
let calculatedOffset = 0;
|
|
37
|
+
if (top > 0) {
|
|
38
|
+
calculatedOffset = top - 1;
|
|
39
|
+
} else if (entry.cssOnly) {
|
|
40
|
+
calculatedOffset = -1;
|
|
41
|
+
}
|
|
42
|
+
entry.offset = calculatedOffset;
|
|
43
|
+
el.style.setProperty("--sticky-stack-offset", `${calculatedOffset}px`);
|
|
44
|
+
if (!entry.cssOnly) {
|
|
45
|
+
el.style.position = "sticky";
|
|
46
|
+
el.style.top = `${calculatedOffset}px`;
|
|
47
|
+
el.style.zIndex = `${entry.zIndex}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function updateAll() {
|
|
52
|
+
repositionAll();
|
|
53
|
+
listeners.forEach((fn) => fn());
|
|
54
|
+
}
|
|
55
|
+
function addScrollListener() {
|
|
56
|
+
scrollListenerCount++;
|
|
57
|
+
if (scrollListenerCount === 1) {
|
|
58
|
+
scrollHandler = () => {
|
|
59
|
+
if (!scrollFrame) {
|
|
60
|
+
scrollFrame = requestAnimationFrame(() => {
|
|
61
|
+
scrollFrame = 0;
|
|
62
|
+
updateAll();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
window.addEventListener("scroll", scrollHandler, true);
|
|
67
|
+
window.addEventListener("resize", scrollHandler);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function removeScrollListener() {
|
|
71
|
+
scrollListenerCount--;
|
|
72
|
+
if (scrollListenerCount === 0 && scrollHandler) {
|
|
73
|
+
if (scrollFrame) {
|
|
74
|
+
cancelAnimationFrame(scrollFrame);
|
|
75
|
+
scrollFrame = 0;
|
|
76
|
+
}
|
|
77
|
+
window.removeEventListener("scroll", scrollHandler, true);
|
|
78
|
+
window.removeEventListener("resize", scrollHandler);
|
|
79
|
+
scrollHandler = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const scrollAnchorSuppressors = /* @__PURE__ */ new Map();
|
|
83
|
+
function findScrollContainer(el) {
|
|
84
|
+
const doc = el.ownerDocument;
|
|
85
|
+
const win = doc.defaultView;
|
|
86
|
+
let node = el.parentElement;
|
|
87
|
+
while (node && node !== doc.documentElement) {
|
|
88
|
+
const overflowY = win ? win.getComputedStyle(node).overflowY : "";
|
|
89
|
+
if (overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay") {
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
92
|
+
node = node.parentElement;
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
function getAnchorSuppressionTargets(el, scrollContainer) {
|
|
97
|
+
if (scrollContainer) {
|
|
98
|
+
return [scrollContainer];
|
|
99
|
+
}
|
|
100
|
+
const doc = el.ownerDocument;
|
|
101
|
+
return doc.body ? [doc.documentElement, doc.body] : [doc.documentElement];
|
|
102
|
+
}
|
|
103
|
+
function suppressScrollAnchoring(container) {
|
|
104
|
+
const existing = scrollAnchorSuppressors.get(container);
|
|
105
|
+
if (existing) {
|
|
106
|
+
existing.count++;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
scrollAnchorSuppressors.set(container, {
|
|
110
|
+
count: 1,
|
|
111
|
+
previous: container.style.getPropertyValue("overflow-anchor")
|
|
112
|
+
});
|
|
113
|
+
container.style.setProperty("overflow-anchor", "none");
|
|
114
|
+
}
|
|
115
|
+
function restoreScrollAnchoring(container) {
|
|
116
|
+
const existing = scrollAnchorSuppressors.get(container);
|
|
117
|
+
if (!existing) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
existing.count--;
|
|
121
|
+
if (existing.count > 0) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
scrollAnchorSuppressors.delete(container);
|
|
125
|
+
if (existing.previous) {
|
|
126
|
+
container.style.setProperty("overflow-anchor", existing.previous);
|
|
127
|
+
} else {
|
|
128
|
+
container.style.removeProperty("overflow-anchor");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function useStickyStacking(ref, options = true) {
|
|
132
|
+
const opts = typeof options === "boolean" ? { enabled: options } : options;
|
|
133
|
+
const {
|
|
134
|
+
enabled = true,
|
|
135
|
+
cssOnly = false,
|
|
136
|
+
zIndex: zIndexOption,
|
|
137
|
+
scope,
|
|
138
|
+
disableScrollAnchoring = false
|
|
139
|
+
} = opts;
|
|
140
|
+
const [isStuck, setIsStuck] = useState(false);
|
|
141
|
+
const isStuckRef = useRef(false);
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
const el = ref.current;
|
|
144
|
+
if (!enabled || !el) {
|
|
145
|
+
setIsStuck(false);
|
|
146
|
+
isStuckRef.current = false;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const resolvedScope = (scope == null ? void 0 : scope.current) ?? void 0;
|
|
150
|
+
const zIndex = zIndexOption ?? (resolvedScope ? 2 : 3);
|
|
151
|
+
const entry = {
|
|
152
|
+
element: el,
|
|
153
|
+
scope: resolvedScope,
|
|
154
|
+
zIndex,
|
|
155
|
+
cssOnly,
|
|
156
|
+
offset: 0
|
|
157
|
+
};
|
|
158
|
+
registry.set(el, entry);
|
|
159
|
+
const scrollContainer = findScrollContainer(el);
|
|
160
|
+
const scrollAnchorTargets = disableScrollAnchoring ? getAnchorSuppressionTargets(el, scrollContainer) : [];
|
|
161
|
+
scrollAnchorTargets.forEach(suppressScrollAnchoring);
|
|
162
|
+
const detect = () => {
|
|
163
|
+
const rect = el.getBoundingClientRect();
|
|
164
|
+
const containerTop = scrollContainer ? scrollContainer.getBoundingClientRect().top : 0;
|
|
165
|
+
const stuck = (!scrollContainer || scrollContainer.scrollTop > 0) && rect.top <= containerTop + entry.offset;
|
|
166
|
+
if (stuck !== isStuckRef.current) {
|
|
167
|
+
isStuckRef.current = stuck;
|
|
168
|
+
setIsStuck(stuck);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const observer = new ResizeObserver(() => {
|
|
172
|
+
updateAll();
|
|
173
|
+
});
|
|
174
|
+
observer.observe(el);
|
|
175
|
+
listeners.add(detect);
|
|
176
|
+
addScrollListener();
|
|
177
|
+
updateAll();
|
|
178
|
+
return () => {
|
|
179
|
+
registry.delete(el);
|
|
180
|
+
listeners.delete(detect);
|
|
181
|
+
observer.disconnect();
|
|
182
|
+
removeScrollListener();
|
|
183
|
+
scrollAnchorTargets.forEach(restoreScrollAnchoring);
|
|
184
|
+
repositionAll();
|
|
185
|
+
el.style.removeProperty("--sticky-stack-offset");
|
|
186
|
+
if (!cssOnly) {
|
|
187
|
+
el.style.removeProperty("position");
|
|
188
|
+
el.style.removeProperty("top");
|
|
189
|
+
el.style.removeProperty("z-index");
|
|
190
|
+
}
|
|
191
|
+
isStuckRef.current = false;
|
|
192
|
+
setIsStuck(false);
|
|
193
|
+
};
|
|
194
|
+
}, [enabled, ref, scope, zIndexOption, cssOnly, disableScrollAnchoring]);
|
|
195
|
+
const isInitialMount = useRef(true);
|
|
196
|
+
useLayoutEffect(() => {
|
|
197
|
+
if (isInitialMount.current) {
|
|
198
|
+
isInitialMount.current = false;
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
repositionAll();
|
|
202
|
+
}, [isStuck]);
|
|
203
|
+
return { isStuck };
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
useStickyStacking
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=useStickyStacking.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStickyStacking.es.js","sources":["../../src/hooks/useStickyStacking.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 { useEffect, useLayoutEffect, useRef, useState, RefObject } from \"react\";\n\ninterface StickyEntry {\n element: HTMLElement;\n scope?: HTMLElement;\n zIndex: number;\n cssOnly: boolean;\n offset: number;\n}\n\nexport interface StickyStackingOptions {\n enabled?: boolean;\n zIndex?: number;\n scope?: RefObject<HTMLElement | null>;\n cssOnly?: boolean;\n /**\n * Set when the sticky element changes size while docked (e.g. a header that\n * collapses when stuck). While such an element is mounted, scroll anchoring is\n * suppressed on its scroll container: otherwise the browser nudges the scroll\n * position to compensate for the element's own resize, which re-crosses the\n * stuck/unstuck threshold and makes the element oscillate indefinitely.\n */\n disableScrollAnchoring?: boolean;\n}\n\nexport interface StickyStackingResult {\n isStuck: boolean;\n}\n\nconst registry = new Map<HTMLElement, StickyEntry>();\nconst listeners = new Set<() => void>();\n\nlet scrollListenerCount = 0;\nlet scrollHandler: (() => void) | null = null;\nlet scrollFrame = 0;\n\nfunction computeCumulativeTop(sorted: HTMLElement[], myIndex: number): number {\n let top = 0;\n for (let i = 0; i < myIndex; i++) {\n const other = sorted[i];\n const otherEntry = registry.get(other);\n\n if (otherEntry?.scope) {\n const scopeRect = otherEntry.scope.getBoundingClientRect();\n const occupied = Math.min(other.offsetHeight, scopeRect.bottom - top);\n if (occupied <= 0) {\n continue;\n }\n top += occupied;\n continue;\n }\n\n top += other.offsetHeight;\n }\n return top;\n}\n\nfunction repositionAll() {\n const sorted = [...registry.keys()].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n );\n\n for (let myIndex = 0; myIndex < sorted.length; myIndex++) {\n const el = sorted[myIndex];\n const entry = registry.get(el);\n if (!entry) {\n continue;\n }\n\n const top = computeCumulativeTop(sorted, myIndex);\n\n let calculatedOffset = 0;\n if (top > 0) {\n calculatedOffset = top - 1;\n } else if (entry.cssOnly) {\n calculatedOffset = -1;\n }\n entry.offset = calculatedOffset;\n\n el.style.setProperty(\"--sticky-stack-offset\", `${calculatedOffset}px`);\n\n if (!entry.cssOnly) {\n el.style.position = \"sticky\";\n el.style.top = `${calculatedOffset}px`;\n el.style.zIndex = `${entry.zIndex}`;\n }\n }\n}\n\nfunction updateAll() {\n repositionAll();\n listeners.forEach(fn => fn());\n}\n\nfunction addScrollListener() {\n scrollListenerCount++;\n if (scrollListenerCount === 1) {\n scrollHandler = () => {\n if (!scrollFrame) {\n scrollFrame = requestAnimationFrame(() => {\n scrollFrame = 0;\n updateAll();\n });\n }\n };\n window.addEventListener(\"scroll\", scrollHandler, true);\n window.addEventListener(\"resize\", scrollHandler);\n }\n}\n\nfunction removeScrollListener() {\n scrollListenerCount--;\n if (scrollListenerCount === 0 && scrollHandler) {\n if (scrollFrame) {\n cancelAnimationFrame(scrollFrame);\n scrollFrame = 0;\n }\n window.removeEventListener(\"scroll\", scrollHandler, true);\n window.removeEventListener(\"resize\", scrollHandler);\n scrollHandler = null;\n }\n}\n\n// Elements whose scroll anchoring we have suppressed, ref-counted so multiple\n// resizing sticky elements sharing a scroll container restore it exactly once.\nconst scrollAnchorSuppressors = new Map<HTMLElement, { count: number; previous: string }>();\n\n/**\n * Nearest scrollable ancestor the element docks within, or null when it sticks\n * to the document/window scroller. Uses the element's own document/window so\n * it works inside iframes (e.g. the Storybook canvas).\n */\nfunction findScrollContainer(el: HTMLElement): HTMLElement | null {\n const doc = el.ownerDocument;\n const win = doc.defaultView;\n let node = el.parentElement;\n while (node && node !== doc.documentElement) {\n const overflowY = win ? win.getComputedStyle(node).overflowY : \"\";\n if (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\") {\n return node;\n }\n node = node.parentElement;\n }\n return null;\n}\n\n/**\n * Resolve which element(s) to suppress scroll anchoring on: the scrolling box the\n * sticky element docks within (nearest scrollable ancestor).\n *\n * For the root/viewport scroller there is a well-known quirk: whether scroll\n * anchoring is controlled by <html> or <body> differs between browsers, and\n * suppressing it on only one leaves the other anchoring the viewport (verified\n * live — the header still snapped back to scrollTop 0 with `none` on <html>\n * alone). So for the root case we suppress on both.\n */\nfunction getAnchorSuppressionTargets(\n el: HTMLElement,\n scrollContainer: HTMLElement | null\n): HTMLElement[] {\n if (scrollContainer) {\n return [scrollContainer];\n }\n const doc = el.ownerDocument;\n return doc.body ? [doc.documentElement, doc.body] : [doc.documentElement];\n}\n\nfunction suppressScrollAnchoring(container: HTMLElement) {\n const existing = scrollAnchorSuppressors.get(container);\n if (existing) {\n existing.count++;\n return;\n }\n scrollAnchorSuppressors.set(container, {\n count: 1,\n previous: container.style.getPropertyValue(\"overflow-anchor\")\n });\n container.style.setProperty(\"overflow-anchor\", \"none\");\n}\n\nfunction restoreScrollAnchoring(container: HTMLElement) {\n const existing = scrollAnchorSuppressors.get(container);\n if (!existing) {\n return;\n }\n existing.count--;\n if (existing.count > 0) {\n return;\n }\n scrollAnchorSuppressors.delete(container);\n if (existing.previous) {\n container.style.setProperty(\"overflow-anchor\", existing.previous);\n } else {\n container.style.removeProperty(\"overflow-anchor\");\n }\n}\n\nexport function useStickyStacking(\n ref: RefObject<HTMLElement | null>,\n options: StickyStackingOptions | boolean = true\n): StickyStackingResult {\n const opts = typeof options === \"boolean\" ? { enabled: options } : options;\n const {\n enabled = true,\n cssOnly = false,\n zIndex: zIndexOption,\n scope,\n disableScrollAnchoring = false\n } = opts;\n\n const [isStuck, setIsStuck] = useState(false);\n const isStuckRef = useRef(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!enabled || !el) {\n setIsStuck(false);\n isStuckRef.current = false;\n return;\n }\n\n const resolvedScope = scope?.current ?? undefined;\n const zIndex = zIndexOption ?? (resolvedScope ? 2 : 3);\n\n const entry: StickyEntry = {\n element: el,\n scope: resolvedScope,\n zIndex,\n cssOnly,\n offset: 0\n };\n registry.set(el, entry);\n\n const scrollContainer = findScrollContainer(el);\n const scrollAnchorTargets = disableScrollAnchoring\n ? getAnchorSuppressionTargets(el, scrollContainer)\n : [];\n scrollAnchorTargets.forEach(suppressScrollAnchoring);\n\n const detect = () => {\n const rect = el.getBoundingClientRect();\n const containerTop = scrollContainer ? scrollContainer.getBoundingClientRect().top : 0;\n const stuck =\n (!scrollContainer || scrollContainer.scrollTop > 0) &&\n rect.top <= containerTop + entry.offset;\n if (stuck !== isStuckRef.current) {\n isStuckRef.current = stuck;\n setIsStuck(stuck);\n }\n };\n\n const observer = new ResizeObserver(() => {\n updateAll();\n });\n observer.observe(el);\n\n listeners.add(detect);\n addScrollListener();\n updateAll();\n\n return () => {\n registry.delete(el);\n listeners.delete(detect);\n observer.disconnect();\n removeScrollListener();\n scrollAnchorTargets.forEach(restoreScrollAnchoring);\n repositionAll();\n\n el.style.removeProperty(\"--sticky-stack-offset\");\n if (!cssOnly) {\n el.style.removeProperty(\"position\");\n el.style.removeProperty(\"top\");\n el.style.removeProperty(\"z-index\");\n }\n\n isStuckRef.current = false;\n setIsStuck(false);\n };\n }, [enabled, ref, scope, zIndexOption, cssOnly, disableScrollAnchoring]);\n\n const isInitialMount = useRef(true);\n useLayoutEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n return;\n }\n repositionAll();\n }, [isStuck]);\n\n return { isStuck };\n}\n"],"names":[],"mappings":";AA6CA,MAAM,+BAAe,IAAA;AACrB,MAAM,gCAAgB,IAAA;AAEtB,IAAI,sBAAsB;AA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BAAgB,sBAAA,EAAwB,MAAM;AACrF,YAAM,SACH,CAAC,mBAAmB,gBAAgB,YAAY,MACjD,KAAK,OAAO,eAAe,MAAM;AACnC,UAAI,UAAU,WAAW,SAAS;AAChC,mBAAW,UAAU;AACrB,mBAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAEA,UAAM,WAAW,IAAI,eAAe,MAAM;AACxC,gBAAA;AAAA,IACF,CAAC;AACD,aAAS,QAAQ,EAAE;AAEnB,cAAU,IAAI,MAAM;AACpB,sBAAA;AACA,cAAA;AAEA,WAAO,MAAM;AACX,eAAS,OAAO,EAAE;AAClB,gBAAU,OAAO,MAAM;AACvB,eAAS,WAAA;AACT,2BAAA;AACA,0BAAoB,QAAQ,sBAAsB;AAClD,oBAAA;AAEA,SAAG,MAAM,eAAe,uBAAuB;AAC/C,UAAI,CAAC,SAAS;AACZ,WAAG,MAAM,eAAe,UAAU;AAClC,WAAG,MAAM,eAAe,KAAK;AAC7B,WAAG,MAAM,eAAe,SAAS;AAAA,MACnC;AAEA,iBAAW,UAAU;AACrB,iBAAW,KAAK;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,SAAS,KAAK,OAAO,cAAc,SAAS,sBAAsB,CAAC;AAEvE,QAAM,iBAAiB,OAAO,IAAI;AAClC,kBAAgB,MAAM;AACpB,QAAI,eAAe,SAAS;AAC1B,qBAAe,UAAU;AACzB;AAAA,IACF;AACA,kBAAA;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO,EAAE,QAAA;AACX;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../util/helper.cjs.js");exports.useUploadFile=(r,s,n)=>{const{url:o,headers:a,withCredentials:l}=s,{onComplete:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../util/helper.cjs.js");exports.useUploadFile=(r,s,n)=>{const{url:o,headers:a,withCredentials:l}=s,{onComplete:u,onProgress:i,onErrorMessageMapper:d}=n??{},[p,c]=e.useState([]),[m,S]=e.useState([...r]),f=(e,t,s,n)=>r.map(r=>(r.name===e&&(r.progress=s,r.error=n,r.status=t),{...r})),g=e=>{const r=new XMLHttpRequest;r.upload.addEventListener("progress",t=>((e,t)=>{const r=e.loaded/e.total*100,s=f(t,"uploading",r);S(s),null==i||i(t,r)})(t,e.name)),r.addEventListener("readystatechange",()=>((e,r)=>{const{status:s,readyState:n,responseText:o}=e;if(n===e.DONE){const e=o&&t.isJsonString(o)&&JSON.parse(o),{fileStatus:n,error:a}=((e,t)=>{let r,s="";return e>=200&&e<400?r="completed":0===e?(r="retry",s=(null==d?void 0:d({responseStatus:e,responseJson:t}))??"Network error. Check internet connection and retry uploading the file"):e>=400&&e<500?(r="error",s=(null==d?void 0:d({responseStatus:e,responseJson:t}))??"Bad request"):e>=500&&(r="error",s=(null==d?void 0:d({responseStatus:e,responseJson:t}))??"Server Error"),{fileStatus:r,error:s}})(s,e),l=f(r,n,void 0,a);S(l);const i={fileList:l,status:s,responseJson:e};c(e=>e.filter(e=>e.name!==r)),null==u||u(i)}})(r,e.name)),l&&(r.withCredentials=!0),r.open("POST",o,!0),null==a||a.forEach((e,t)=>r.setRequestHeader(t,e));const s=new FormData;s.append("file",e.data),s.append("name",e.name),r.send(s)};return e.useEffect(()=>{o&&r.length&&r.forEach(e=>{e.status||p.some(t=>t.name===e.name)||(c(t=>[...t,e]),g(e))})},[o,r]),{updatedFiles:m,setUpdatedFiles:S,uploadingFiles:p}};
|
|
2
2
|
//# sourceMappingURL=useUploadFile.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUploadFile.cjs.js","sources":["../../src/hooks/useUploadFile.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 { FileType } from \"../components/Form/FileUpload/FileUpload\";\nimport { useEffect, useState } from \"react\";\nimport { isJsonString } from \"../util/helper\";\n\nexport type UploadResponseStatus = XMLHttpRequest[\"status\"];\nexport type UploadResponseJson = Record<string, unknown>;\nexport interface UploadResponseType {\n fileList: FileType[];\n status: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface OnErrorMessageMapperType {\n responseStatus: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface UseUploadFileCallback {\n onComplete?: (response: UploadResponseType) => void;\n onProgress?: (fileName: string, progress: number) => void;\n onErrorMessageMapper?: (args: OnErrorMessageMapperType) => string | undefined;\n}\nexport interface UploadFileRequestParams {\n url: string;\n headers?: Headers;\n withCredentials?: boolean;\n}\n\nexport const useUploadFile = (\n files: FileType[],\n request: UploadFileRequestParams,\n callbacks?: UseUploadFileCallback\n) => {\n const { url, headers, withCredentials } = request;\n\n const { onComplete, onProgress, onErrorMessageMapper } = callbacks ?? {};\n\n const [uploadingFiles, setUploadingFiles] = useState<FileType[]>([]);\n const [updatedFiles, setUpdatedFiles] = useState<FileType[]>([...files]);\n\n const getUpdatedList = (\n fileName: string,\n fileStatus: FileType[\"status\"],\n progress?: number,\n error?: string\n ) => {\n return files.map(file => {\n if (file.name === fileName) {\n file.progress = progress;\n file.error = error;\n file.status = fileStatus;\n }\n return { ...file };\n });\n };\n\n const recordProgress = (e: ProgressEvent<XMLHttpRequestEventTarget>, fileName: string) => {\n const progress = (e.loaded / e.total) * 100;\n const updatedData = getUpdatedList(fileName, \"uploading\", progress);\n setUpdatedFiles(updatedData);\n onProgress?.(fileName, progress);\n };\n\n const getFileStatus = (\n responseStatus: UploadResponseStatus,\n responseJson: UploadResponseJson\n ) => {\n let fileStatus: FileType[\"status\"] = undefined;\n let error = \"\";\n if (responseStatus >= 200 && responseStatus < 400) {\n fileStatus = \"completed\";\n } else if (responseStatus === 0) {\n fileStatus = \"retry\";\n error =\n onErrorMessageMapper?.({ responseStatus, responseJson }) ??\n \"Network error. Check internet connection and retry uploading the file\";\n } else if (responseStatus >= 400 && responseStatus < 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Bad request\";\n } else if (responseStatus >= 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Server Error\";\n }\n return { fileStatus, error };\n };\n\n const handleOnComplete = (xhr: XMLHttpRequest, fileName: string) => {\n const { status, readyState, responseText } = xhr;\n if (readyState === xhr.DONE) {\n const responseJson = responseText && isJsonString(responseText) && JSON.parse(responseText);\n const { fileStatus, error } = getFileStatus(status, responseJson);\n const updatedList = getUpdatedList(fileName, fileStatus, undefined, error);\n setUpdatedFiles(updatedList);\n const response = { fileList: updatedList, status, responseJson };\n setUploadingFiles(prevState => prevState.filter(selected => selected.name !== fileName));\n onComplete?.(response);\n }\n };\n\n const uploadFile = (file: FileType) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", e => recordProgress(e, file.name));\n xhr.addEventListener(\"readystatechange\", () => handleOnComplete(xhr, file.name));\n withCredentials && (xhr.withCredentials = true);\n xhr.open(\"POST\", url, true);\n headers?.forEach((value, key) => xhr.setRequestHeader(key, value));\n const formData = new FormData();\n formData.append(\"file\", file.data as File);\n formData.append(\"name\", file.name);\n xhr.send(formData);\n };\n\n useEffect(() => {\n if (!url || !files.length) {\n return;\n }\n\n files.forEach(file => {\n if (!file.status && !uploadingFiles.
|
|
1
|
+
{"version":3,"file":"useUploadFile.cjs.js","sources":["../../src/hooks/useUploadFile.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 { FileType } from \"../components/Form/FileUpload/FileUpload\";\nimport { useEffect, useState } from \"react\";\nimport { isJsonString } from \"../util/helper\";\n\nexport type UploadResponseStatus = XMLHttpRequest[\"status\"];\nexport type UploadResponseJson = Record<string, unknown>;\nexport interface UploadResponseType {\n fileList: FileType[];\n status: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface OnErrorMessageMapperType {\n responseStatus: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface UseUploadFileCallback {\n onComplete?: (response: UploadResponseType) => void;\n onProgress?: (fileName: string, progress: number) => void;\n onErrorMessageMapper?: (args: OnErrorMessageMapperType) => string | undefined;\n}\nexport interface UploadFileRequestParams {\n url: string;\n headers?: Headers;\n withCredentials?: boolean;\n}\n\nexport const useUploadFile = (\n files: FileType[],\n request: UploadFileRequestParams,\n callbacks?: UseUploadFileCallback\n) => {\n const { url, headers, withCredentials } = request;\n\n const { onComplete, onProgress, onErrorMessageMapper } = callbacks ?? {};\n\n const [uploadingFiles, setUploadingFiles] = useState<FileType[]>([]);\n const [updatedFiles, setUpdatedFiles] = useState<FileType[]>([...files]);\n\n const getUpdatedList = (\n fileName: string,\n fileStatus: FileType[\"status\"],\n progress?: number,\n error?: string\n ) => {\n return files.map(file => {\n if (file.name === fileName) {\n file.progress = progress;\n file.error = error;\n file.status = fileStatus;\n }\n return { ...file };\n });\n };\n\n const recordProgress = (e: ProgressEvent<XMLHttpRequestEventTarget>, fileName: string) => {\n const progress = (e.loaded / e.total) * 100;\n const updatedData = getUpdatedList(fileName, \"uploading\", progress);\n setUpdatedFiles(updatedData);\n onProgress?.(fileName, progress);\n };\n\n const getFileStatus = (\n responseStatus: UploadResponseStatus,\n responseJson: UploadResponseJson\n ) => {\n let fileStatus: FileType[\"status\"] = undefined;\n let error = \"\";\n if (responseStatus >= 200 && responseStatus < 400) {\n fileStatus = \"completed\";\n } else if (responseStatus === 0) {\n fileStatus = \"retry\";\n error =\n onErrorMessageMapper?.({ responseStatus, responseJson }) ??\n \"Network error. Check internet connection and retry uploading the file\";\n } else if (responseStatus >= 400 && responseStatus < 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Bad request\";\n } else if (responseStatus >= 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Server Error\";\n }\n return { fileStatus, error };\n };\n\n const handleOnComplete = (xhr: XMLHttpRequest, fileName: string) => {\n const { status, readyState, responseText } = xhr;\n if (readyState === xhr.DONE) {\n const responseJson = responseText && isJsonString(responseText) && JSON.parse(responseText);\n const { fileStatus, error } = getFileStatus(status, responseJson);\n const updatedList = getUpdatedList(fileName, fileStatus, undefined, error);\n setUpdatedFiles(updatedList);\n const response = { fileList: updatedList, status, responseJson };\n setUploadingFiles(prevState => prevState.filter(selected => selected.name !== fileName));\n onComplete?.(response);\n }\n };\n\n const uploadFile = (file: FileType) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", e => recordProgress(e, file.name));\n xhr.addEventListener(\"readystatechange\", () => handleOnComplete(xhr, file.name));\n withCredentials && (xhr.withCredentials = true);\n xhr.open(\"POST\", url, true);\n headers?.forEach((value, key) => xhr.setRequestHeader(key, value));\n const formData = new FormData();\n formData.append(\"file\", file.data as File);\n formData.append(\"name\", file.name);\n xhr.send(formData);\n };\n\n useEffect(() => {\n if (!url || !files.length) {\n return;\n }\n\n files.forEach(file => {\n if (!file.status && !uploadingFiles.some(selected => selected.name === file.name)) {\n setUploadingFiles(prevState => [...prevState, file]);\n uploadFile(file);\n }\n });\n }, [url, files]);\n\n return { updatedFiles, setUpdatedFiles, uploadingFiles };\n};\n"],"names":["files","request","callbacks","url","headers","withCredentials","onComplete","onProgress","onErrorMessageMapper","uploadingFiles","setUploadingFiles","useState","updatedFiles","setUpdatedFiles","getUpdatedList","fileName","fileStatus","progress","error","map","file","name","status","uploadFile","xhr","XMLHttpRequest","upload","addEventListener","e","loaded","total","updatedData","recordProgress","readyState","responseText","DONE","responseJson","isJsonString","JSON","parse","responseStatus","getFileStatus","updatedList","response","fileList","prevState","filter","selected","handleOnComplete","open","forEach","value","key","setRequestHeader","formData","FormData","append","data","send","useEffect","length","some"],"mappings":"kKA0C6B,CAC3BA,EACAC,EACAC,KAEA,MAAMC,IAAEA,EAAAC,QAAKA,EAAAC,gBAASA,GAAoBJ,GAEpCK,WAAEA,EAAAC,WAAYA,EAAAC,qBAAYA,GAAyBN,GAAa,CAAA,GAE/DO,EAAgBC,GAAqBC,EAAAA,SAAqB,KAC1DC,EAAcC,GAAmBF,EAAAA,SAAqB,IAAIX,IAE3Dc,EAAiB,CACrBC,EACAC,EACAC,EACAC,IAEOlB,EAAMmB,IAAIC,IACXA,EAAKC,OAASN,IAChBK,EAAKH,SAAWA,EAChBG,EAAKF,MAAQA,EACbE,EAAKE,OAASN,GAET,IAAKI,KA+CVG,EAAcH,IAClB,MAAMI,EAAM,IAAIC,eAChBD,EAAIE,OAAOC,iBAAiB,WAAYC,GA7CnB,EAACA,EAA6Cb,KACnE,MAAME,EAAYW,EAAEC,OAASD,EAAEE,MAAS,IAClCC,EAAcjB,EAAeC,EAAU,YAAaE,GAC1DJ,EAAgBkB,GAChB,MAAAxB,GAAAA,EAAaQ,EAAUE,IAyCsBe,CAAeJ,EAAGR,EAAKC,OACpEG,EAAIG,iBAAiB,mBAAoB,IAhBlB,EAACH,EAAqBT,KAC7C,MAAMO,OAAEA,EAAAW,WAAQA,EAAAC,aAAYA,GAAiBV,EAC7C,GAAIS,IAAeT,EAAIW,KAAM,CAC3B,MAAMC,EAAeF,GAAgB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,CAACjB,EAAKH,IAEF,CAAEY,eAAcC,kBAAiBJ"}
|
|
@@ -67,7 +67,7 @@ const useUploadFile = (files, request, callbacks) => {
|
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
files.forEach((file) => {
|
|
70
|
-
if (!file.status && !uploadingFiles.
|
|
70
|
+
if (!file.status && !uploadingFiles.some((selected) => selected.name === file.name)) {
|
|
71
71
|
setUploadingFiles((prevState) => [...prevState, file]);
|
|
72
72
|
uploadFile(file);
|
|
73
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUploadFile.es.js","sources":["../../src/hooks/useUploadFile.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 { FileType } from \"../components/Form/FileUpload/FileUpload\";\nimport { useEffect, useState } from \"react\";\nimport { isJsonString } from \"../util/helper\";\n\nexport type UploadResponseStatus = XMLHttpRequest[\"status\"];\nexport type UploadResponseJson = Record<string, unknown>;\nexport interface UploadResponseType {\n fileList: FileType[];\n status: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface OnErrorMessageMapperType {\n responseStatus: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface UseUploadFileCallback {\n onComplete?: (response: UploadResponseType) => void;\n onProgress?: (fileName: string, progress: number) => void;\n onErrorMessageMapper?: (args: OnErrorMessageMapperType) => string | undefined;\n}\nexport interface UploadFileRequestParams {\n url: string;\n headers?: Headers;\n withCredentials?: boolean;\n}\n\nexport const useUploadFile = (\n files: FileType[],\n request: UploadFileRequestParams,\n callbacks?: UseUploadFileCallback\n) => {\n const { url, headers, withCredentials } = request;\n\n const { onComplete, onProgress, onErrorMessageMapper } = callbacks ?? {};\n\n const [uploadingFiles, setUploadingFiles] = useState<FileType[]>([]);\n const [updatedFiles, setUpdatedFiles] = useState<FileType[]>([...files]);\n\n const getUpdatedList = (\n fileName: string,\n fileStatus: FileType[\"status\"],\n progress?: number,\n error?: string\n ) => {\n return files.map(file => {\n if (file.name === fileName) {\n file.progress = progress;\n file.error = error;\n file.status = fileStatus;\n }\n return { ...file };\n });\n };\n\n const recordProgress = (e: ProgressEvent<XMLHttpRequestEventTarget>, fileName: string) => {\n const progress = (e.loaded / e.total) * 100;\n const updatedData = getUpdatedList(fileName, \"uploading\", progress);\n setUpdatedFiles(updatedData);\n onProgress?.(fileName, progress);\n };\n\n const getFileStatus = (\n responseStatus: UploadResponseStatus,\n responseJson: UploadResponseJson\n ) => {\n let fileStatus: FileType[\"status\"] = undefined;\n let error = \"\";\n if (responseStatus >= 200 && responseStatus < 400) {\n fileStatus = \"completed\";\n } else if (responseStatus === 0) {\n fileStatus = \"retry\";\n error =\n onErrorMessageMapper?.({ responseStatus, responseJson }) ??\n \"Network error. Check internet connection and retry uploading the file\";\n } else if (responseStatus >= 400 && responseStatus < 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Bad request\";\n } else if (responseStatus >= 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Server Error\";\n }\n return { fileStatus, error };\n };\n\n const handleOnComplete = (xhr: XMLHttpRequest, fileName: string) => {\n const { status, readyState, responseText } = xhr;\n if (readyState === xhr.DONE) {\n const responseJson = responseText && isJsonString(responseText) && JSON.parse(responseText);\n const { fileStatus, error } = getFileStatus(status, responseJson);\n const updatedList = getUpdatedList(fileName, fileStatus, undefined, error);\n setUpdatedFiles(updatedList);\n const response = { fileList: updatedList, status, responseJson };\n setUploadingFiles(prevState => prevState.filter(selected => selected.name !== fileName));\n onComplete?.(response);\n }\n };\n\n const uploadFile = (file: FileType) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", e => recordProgress(e, file.name));\n xhr.addEventListener(\"readystatechange\", () => handleOnComplete(xhr, file.name));\n withCredentials && (xhr.withCredentials = true);\n xhr.open(\"POST\", url, true);\n headers?.forEach((value, key) => xhr.setRequestHeader(key, value));\n const formData = new FormData();\n formData.append(\"file\", file.data as File);\n formData.append(\"name\", file.name);\n xhr.send(formData);\n };\n\n useEffect(() => {\n if (!url || !files.length) {\n return;\n }\n\n files.forEach(file => {\n if (!file.status && !uploadingFiles.
|
|
1
|
+
{"version":3,"file":"useUploadFile.es.js","sources":["../../src/hooks/useUploadFile.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 { FileType } from \"../components/Form/FileUpload/FileUpload\";\nimport { useEffect, useState } from \"react\";\nimport { isJsonString } from \"../util/helper\";\n\nexport type UploadResponseStatus = XMLHttpRequest[\"status\"];\nexport type UploadResponseJson = Record<string, unknown>;\nexport interface UploadResponseType {\n fileList: FileType[];\n status: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface OnErrorMessageMapperType {\n responseStatus: UploadResponseStatus;\n responseJson: UploadResponseJson;\n}\nexport interface UseUploadFileCallback {\n onComplete?: (response: UploadResponseType) => void;\n onProgress?: (fileName: string, progress: number) => void;\n onErrorMessageMapper?: (args: OnErrorMessageMapperType) => string | undefined;\n}\nexport interface UploadFileRequestParams {\n url: string;\n headers?: Headers;\n withCredentials?: boolean;\n}\n\nexport const useUploadFile = (\n files: FileType[],\n request: UploadFileRequestParams,\n callbacks?: UseUploadFileCallback\n) => {\n const { url, headers, withCredentials } = request;\n\n const { onComplete, onProgress, onErrorMessageMapper } = callbacks ?? {};\n\n const [uploadingFiles, setUploadingFiles] = useState<FileType[]>([]);\n const [updatedFiles, setUpdatedFiles] = useState<FileType[]>([...files]);\n\n const getUpdatedList = (\n fileName: string,\n fileStatus: FileType[\"status\"],\n progress?: number,\n error?: string\n ) => {\n return files.map(file => {\n if (file.name === fileName) {\n file.progress = progress;\n file.error = error;\n file.status = fileStatus;\n }\n return { ...file };\n });\n };\n\n const recordProgress = (e: ProgressEvent<XMLHttpRequestEventTarget>, fileName: string) => {\n const progress = (e.loaded / e.total) * 100;\n const updatedData = getUpdatedList(fileName, \"uploading\", progress);\n setUpdatedFiles(updatedData);\n onProgress?.(fileName, progress);\n };\n\n const getFileStatus = (\n responseStatus: UploadResponseStatus,\n responseJson: UploadResponseJson\n ) => {\n let fileStatus: FileType[\"status\"] = undefined;\n let error = \"\";\n if (responseStatus >= 200 && responseStatus < 400) {\n fileStatus = \"completed\";\n } else if (responseStatus === 0) {\n fileStatus = \"retry\";\n error =\n onErrorMessageMapper?.({ responseStatus, responseJson }) ??\n \"Network error. Check internet connection and retry uploading the file\";\n } else if (responseStatus >= 400 && responseStatus < 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Bad request\";\n } else if (responseStatus >= 500) {\n fileStatus = \"error\";\n error = onErrorMessageMapper?.({ responseStatus, responseJson }) ?? \"Server Error\";\n }\n return { fileStatus, error };\n };\n\n const handleOnComplete = (xhr: XMLHttpRequest, fileName: string) => {\n const { status, readyState, responseText } = xhr;\n if (readyState === xhr.DONE) {\n const responseJson = responseText && isJsonString(responseText) && JSON.parse(responseText);\n const { fileStatus, error } = getFileStatus(status, responseJson);\n const updatedList = getUpdatedList(fileName, fileStatus, undefined, error);\n setUpdatedFiles(updatedList);\n const response = { fileList: updatedList, status, responseJson };\n setUploadingFiles(prevState => prevState.filter(selected => selected.name !== fileName));\n onComplete?.(response);\n }\n };\n\n const uploadFile = (file: FileType) => {\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener(\"progress\", e => recordProgress(e, file.name));\n xhr.addEventListener(\"readystatechange\", () => handleOnComplete(xhr, file.name));\n withCredentials && (xhr.withCredentials = true);\n xhr.open(\"POST\", url, true);\n headers?.forEach((value, key) => xhr.setRequestHeader(key, value));\n const formData = new FormData();\n formData.append(\"file\", file.data as File);\n formData.append(\"name\", file.name);\n xhr.send(formData);\n };\n\n useEffect(() => {\n if (!url || !files.length) {\n return;\n }\n\n files.forEach(file => {\n if (!file.status && !uploadingFiles.some(selected => selected.name === file.name)) {\n setUploadingFiles(prevState => [...prevState, file]);\n uploadFile(file);\n }\n });\n }, [url, files]);\n\n return { updatedFiles, setUpdatedFiles, uploadingFiles };\n};\n"],"names":[],"mappings":";;AA0CO,MAAM,gBAAgB,CAC3B,OACA,SACA,cACG;AACH,QAAM,EAAE,KAAK,SAAS,gBAAA,IAAoB;AAE1C,QAAM,EAAE,YAAY,YAAY,qBAAA,IAAyB,aAAa,CAAA;AAEtE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAqB,CAAA,CAAE;AACnE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAqB,CAAC,GAAG,KAAK,CAAC;AAEvE,QAAM,iBAAiB,CACrB,UACA,YACA,UACA,UACG;AACH,WAAO,MAAM,IAAI,CAAA,SAAQ;AACvB,UAAI,KAAK,SAAS,UAAU;AAC1B,aAAK,WAAW;AAChB,aAAK,QAAQ;AACb,aAAK,SAAS;AAAA,MAChB;AACA,aAAO,EAAE,GAAG,KAAA;AAAA,IACd,CAAC;AAAA,EACH;AAEA,QAAM,iBAAiB,CAAC,GAA6C,aAAqB;AACxF,UAAM,WAAY,EAAE,SAAS,EAAE,QAAS;AACxC,UAAM,cAAc,eAAe,UAAU,aAAa,QAAQ;AAClE,oBA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,KAAK,IAAI;AAC1B,uCAAS,QAAQ,CAAC,OAAO,QAAQ,IAAI,iBAAiB,KAAK,KAAK;AAChE,UAAM,WAAW,IAAI,SAAA;AACrB,aAAS,OAAO,QAAQ,KAAK,IAAY;AACzC,aAAS,OAAO,QAAQ,KAAK,IAAI;AACjC,QAAI,KAAK,QAAQ;AAAA,EACnB;AAEA,YAAU,MAAM;AACd,QAAI,CAAC,OAAO,CAAC,MAAM,QAAQ;AACzB;AAAA,IACF;AAEA,UAAM,QAAQ,CAAA,SAAQ;AACpB,UAAI,CAAC,KAAK,UAAU,CAAC,eAAe,KAAK,CAAA,aAAY,SAAS,SAAS,KAAK,IAAI,GAAG;AACjF,0BAAkB,CAAA,cAAa,CAAC,GAAG,WAAW,IAAI,CAAC;AACnD,mBAAW,IAAI;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,KAAK,KAAK,CAAC;AAEf,SAAO,EAAE,cAAc,iBAAiB,eAAA;AAC1C;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/_BaseStyling_/BaseStyling.cjs.js"),r=require("./components/Button/Button.cjs.js"),o=require("./components/Breadcrumbs/Breadcrumbs.cjs.js"),t=require("./components/ContextMenu/ContextMenu.cjs.js"),s=require("./components/ContextMenu/ContextMenuItem.cjs.js"),n=require("./components/ContextMenu/ContextMenuDivider.cjs.js"),i=require("./components/Link/Link.cjs.js"),p=require("./components/Icon/Icon.cjs.js"),a=require("./components/Button/IconButton.cjs.js"),c=require("./components/Tabs/Tab.cjs.js"),l=require("./components/Tabs/Tabs.cjs.js"),u=require("./components/Tag/Tag.cjs.js"),j=require("./components/TextEllipsis/TextEllipsis.cjs.js"),m=require("./components/Tiles/Tile.cjs.js"),d=require("./components/Tiles/Tiles.cjs.js"),x=require("./components/Tooltip/Tooltip.cjs.js"),S=require("./components/Typography/Typography.cjs.js"),q=require("./components/ProgressBar/ProgressBar.cjs.js"),F=require("./components/Skeleton/Skeleton.cjs.js"),C=require("./components/Spinner/Spinner.cjs.js"),M=require("./components/Stepper/Stepper.cjs.js"),T=require("./components/Pagination/Pagination.cjs.js"),g=require("./hooks/useRepeater.cjs.js"),h=require("./hooks/useClickOutside.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/_BaseStyling_/BaseStyling.cjs.js"),r=require("./components/Button/Button.cjs.js"),o=require("./components/Breadcrumbs/Breadcrumbs.cjs.js"),t=require("./components/ContextMenu/ContextMenu.cjs.js"),s=require("./components/ContextMenu/ContextMenuItem.cjs.js"),n=require("./components/ContextMenu/ContextMenuDivider.cjs.js"),i=require("./components/Link/Link.cjs.js"),p=require("./components/Icon/Icon.cjs.js"),a=require("./components/Button/IconButton.cjs.js"),c=require("./components/Tabs/Tab.cjs.js"),l=require("./components/Tabs/Tabs.cjs.js"),u=require("./components/Tag/Tag.cjs.js"),j=require("./components/TextEllipsis/TextEllipsis.cjs.js"),m=require("./components/Tiles/Tile.cjs.js"),d=require("./components/Tiles/Tiles.cjs.js"),x=require("./components/Tooltip/Tooltip.cjs.js"),S=require("./components/Typography/Typography.cjs.js"),q=require("./components/ProgressBar/ProgressBar.cjs.js"),F=require("./components/Skeleton/Skeleton.cjs.js"),C=require("./components/Spinner/Spinner.cjs.js"),M=require("./components/Stepper/Stepper.cjs.js"),T=require("./components/Pagination/Pagination.cjs.js"),g=require("./hooks/useRepeater.cjs.js"),h=require("./hooks/useClickOutside.cjs.js"),B=require("./hooks/useFullHeightCollapse.cjs.js"),I=require("./hooks/usePosition.cjs.js"),D=require("./hooks/useDebouncedCallback.cjs.js"),b=require("./hooks/useUploadFile.cjs.js"),k=require("./util/helper.cjs.js"),y=require("./hooks/useScreenSize.cjs.js"),W=require("./variables.cjs.js"),A=require("./hooks/useStickyStacking.cjs.js"),G=require("./components/Notifications/Alert/useAlert.cjs.js"),P=require("./components/Notifications/Alert/AlertProvider/AlertProvider.cjs.js"),f=require("./components/Notifications/Alert/AlertItem/AlertItem.cjs.js"),N=require("./components/Notifications/Dialog/Dialog.cjs.js"),v=require("./components/Notifications/DiscardChangesModal/DiscardChangesModal.cjs.js"),L=require("./components/Notifications/SlideInModal/SlideInModal.cjs.js"),H=require("./components/Notifications/SideSheet/SideSheet.cjs.js"),R=require("./components/Notifications/SideSheet/SideSheetContent/SideSheetContent.cjs.js"),O=require("./components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.cjs.js"),E=require("./components/Form/Checkbox/Checkbox.cjs.js"),U=require("./components/InlineEditing/InlineCheckbox/InlineCheckbox.cjs.js"),w=require("./components/Form/Fieldset/Fieldset.cjs.js"),_=require("./components/Form/Form.cjs.js"),z=require("./components/Form/FormControl/FormControl.cjs.js"),K=require("./components/Form/FormGroup/FormGroup.cjs.js"),J=require("./components/Form/FormHelperText/FormHelperText.cjs.js"),Q=require("./components/Form/Input/Input.cjs.js"),V=require("./components/Form/Wrapper/InputWrapper/InputWrapper.cjs.js"),X=require("./components/Form/Label/Label.cjs.js"),Y=require("./components/Form/Radio/Radio.cjs.js"),Z=require("./components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js"),$=require("./components/Form/Select/SingleSelect/Select.cjs.js"),ee=require("./components/InlineEditing/InlineEditingSelect/InlineSelect.cjs.js"),re=require("./components/Form/Select/MultiSelect/MultiSelect.cjs.js"),oe=require("./components/Form/Select/SingleSelect/Option.cjs.js"),te=require("./components/Form/Select/MultiSelect/MultiOption.cjs.js"),se=require("./components/Form/Textarea/Textarea.cjs.js"),ne=require("./components/Form/Toggle/Toggle.cjs.js"),ie=require("./components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js"),pe=require("./components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js"),ae=require("./components/Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js"),ce=require("./components/Form/FileUpload/FileUpload.cjs.js"),le=require("./components/Form/FileUpload/FileItem/FileItem.cjs.js"),ue=require("./components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.cjs.js"),je=require("./components/Form/Select/MultiSelect/useMultiSelect.cjs.js"),me=require("./components/Layout/ContentHeader/ContentHeader.cjs.js"),de=require("./components/Layout/Card/Card.cjs.js"),xe=require("./components/Layout/ActionBar/ActionBar.cjs.js"),Se=require("./components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.cjs.js"),qe=require("./components/Layout/FormPage/FormWithStepper/FormSection/FormSection.cjs.js"),Fe=require("./components/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js"),Ce=require("./components/DataGrid/DataGrid.cjs.js"),Me=require("./components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js"),Te=require("./components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js"),ge=require("./components/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js"),he=require("./components/DataGrid/DataGridFilters/FilterKeyMapper.cjs.js"),Be=require("./components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js"),Ie=require("./components/Notifications/Banner/Banner.cjs.js"),De=require("./components/DatePicker/DatePicker.cjs.js"),be=require("./components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.cjs.js"),ke=require("./components/admin/layout/LeftNav/LeftNav.cjs.js"),ye=require("./components/admin/layout/TopNavBar/TopNavBar.cjs.js"),We=require("./components/admin/layout/ProfileMenu/ProfileMenu.cjs.js"),Ae=require("./components/miscellaneous/IdentityProviderButton.cjs.js"),Ge=require("./utils/focusManagement.cjs.js"),Pe=require("./components/Notifications/BaseModal/BaseModal.cjs.js"),fe=require("./components/Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js"),Ne=require("./components/Notifications/BaseModal/BaseModalContent/BaseModalContent.cjs.js"),ve=require("./components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.cjs.js");exports.BaseStyling=e.BaseStyling,exports.Button=r.Button,exports.Breadcrumbs=o.Breadcrumbs,exports.ContextMenu=t.ContextMenu,exports.ContextMenuItem=s.ContextMenuItem,exports.ContextMenuDivider=n.ContextMenuDivider,exports.Link=i.Link,exports.Icon=p.Icon,exports.Icons=p.Icons,exports.IconButton=a.IconButton,exports.Tab=c.Tab,exports.Tabs=l.Tabs,exports.Tag=u.Tag,exports.TextEllipsis=j.TextEllipsis,exports.Tile=m.Tile,exports.Tiles=d.Tiles,exports.Tooltip=x.Tooltip,exports.Typography=S.Typography,exports.ProgressBar=q.ProgressBar,exports.Skeleton=F.Skeleton,exports.Spinner=C.Spinner,exports.Stepper=M.Stepper,exports.Pagination=T.Pagination,exports.useRepeater=g.useRepeater,exports.useClickOutside=h.useClickOutside,exports.useFullHeightCollapse=B.useFullHeightCollapse,exports.usePosition=I.usePosition,exports.useDebouncedCallback=D.useDebouncedCallback,exports.useUploadFile=b.useUploadFile,exports.debounce=k.debounce,exports.generateID=k.generateID,exports.throttle=k.throttle,exports.useScreenSize=y.useScreenSize,exports.ScreenSize=W.ScreenSize,exports.useStickyStacking=A.useStickyStacking,exports.useAlert=G.useAlert,exports.AlertProvider=P.AlertProvider,exports.AlertItem=f.AlertItem,exports.Dialog=N.Dialog,exports.DiscardChangesModal=v.DiscardChangesModal,exports.SlideInModal=L.SlideInModal,exports.SideSheet=H.SideSheet,exports.SideSheetContent=R.SideSheetContent,exports.SideSheetHeader=O.SideSheetHeader,exports.Checkbox=E.Checkbox,exports.InlineCheckbox=U.InlineCheckbox,exports.Fieldset=w.Fieldset,exports.Form=_.Form,exports.FormControl=z.FormControl,exports.FormGroup=K.FormGroup,exports.FormHelperText=J.FormHelperText,exports.Input=Q.Input,exports.InputWrapper=V.InputWrapper,exports.Label=X.Label,exports.Radio=Y.Radio,exports.RadioWrapper=Z.RadioWrapper,exports.Select=$.Select,exports.InlineSelect=ee.InlineSelect,exports.MultiSelect=re.MultiSelect,exports.Option=oe.Option,exports.MultiOption=te.MultiOption,exports.Textarea=se.Textarea,exports.Toggle=ne.Toggle,exports.CheckboxWrapper=ie.CheckboxWrapper,exports.TextareaWrapper=pe.TextareaWrapper,exports.SelectWrapper=ae.SelectWrapper,exports.FileUpload=ce.FileUpload,exports.ACTION_STATUS=le.ACTION_STATUS,exports.FILE_ACTION=le.FILE_ACTION,exports.MultiSelectWrapper=ue.MultiSelectWrapper,exports.useMultiSelect=je.useMultiSelect,exports.ContentHeader=me.ContentHeader,exports.Card=de.Card,exports.ActionBar=xe.ActionBar,exports.FormStepper=Se.FormStepper,exports.FormSection=qe.FormSection,exports.FormWithStepper=Fe.FormWithStepper,exports.DataGrid=Ce.DataGrid,exports.DataGridRow=Me.DataGridRow,exports.DataGridDrawerItem=Te.DataGridDrawerItem,exports.DataGridCell=ge.DataGridCell,exports.FilterKeyMapper=he.FilterKeyMapper,exports.useFiltersReducer=Be.useFiltersReducer,exports.Banner=Ie.Banner,exports.DatePicker=De.DatePicker,exports.MicrofrontendContainer=be.MicrofrontendContainer,exports.LeftNav=ke.LeftNav,exports.TopNavBar=ye.TopNavBar,exports.ProfileMenu=We.ProfileMenu,exports.IdentityProviderButton=Ae.IdentityProviderButton,exports.getTabbableElements=Ge.getTabbableElements,exports.Modal=Pe.BaseModal,exports.ModalActions=fe.BaseModalActions,exports.SideSheetActions=fe.BaseModalActions,exports.ModalContent=Ne.BaseModalContent,exports.ModalHeader=ve.BaseModalHeader;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|