@flipdish/ui-library 0.69.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/components/__internal__/controlFill/controlFill.context.cjs +13 -0
- package/dist/components/__internal__/controlFill/controlFill.context.cjs.map +1 -0
- package/dist/components/__internal__/controlFill/controlFill.context.d.ts +7 -0
- package/dist/components/__internal__/controlFill/controlFill.context.d.ts.map +1 -0
- package/dist/components/__internal__/controlFill/controlFill.context.js +11 -0
- package/dist/components/__internal__/controlFill/controlFill.context.js.map +1 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs +13 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs.map +1 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts +8 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts.map +1 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.js +11 -0
- package/dist/components/__internal__/focusHandOff/focusHandOff.context.js.map +1 -0
- package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.d.ts +1 -1
- package/dist/components/atoms/Buttons/IconButton/IconButton.cjs +1 -1
- package/dist/components/atoms/Buttons/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/Buttons/IconButton/IconButton.js +1 -1
- package/dist/components/atoms/Buttons/IconButton/IconButton.js.map +1 -1
- package/dist/components/atoms/LiveStatus/index.cjs +18 -0
- package/dist/components/atoms/LiveStatus/index.cjs.map +1 -0
- package/dist/components/atoms/LiveStatus/index.d.ts +17 -0
- package/dist/components/atoms/LiveStatus/index.d.ts.map +1 -0
- package/dist/components/atoms/LiveStatus/index.js +16 -0
- package/dist/components/atoms/LiveStatus/index.js.map +1 -0
- package/dist/components/forms/Form/index.cjs +1 -1
- package/dist/components/forms/Form/index.js +1 -1
- package/dist/components/molecules/Dropdown/index.d.ts +2 -2
- package/dist/components/molecules/EmptyState/index.cjs +9 -1
- package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
- package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
- package/dist/components/molecules/EmptyState/index.js +11 -3
- package/dist/components/molecules/EmptyState/index.js.map +1 -1
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs +13 -0
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs.map +1 -1
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts +8 -0
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts.map +1 -1
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js +13 -1
- package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js.map +1 -1
- package/dist/components/molecules/Modals/Modal/Modal.cjs +6 -5
- package/dist/components/molecules/Modals/Modal/Modal.cjs.map +1 -1
- package/dist/components/molecules/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/components/molecules/Modals/Modal/Modal.js +6 -5
- package/dist/components/molecules/Modals/Modal/Modal.js.map +1 -1
- package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.cjs +1 -1
- package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts +1 -1
- package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts.map +1 -1
- package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.js +1 -1
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +1 -1
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -1
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs +4 -1
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs.map +1 -1
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js +5 -2
- package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs +11 -6
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts +4 -2
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts.map +1 -1
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js +12 -7
- package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js.map +1 -1
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs +53 -0
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs.map +1 -0
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts +41 -0
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts.map +1 -0
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js +51 -0
- package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js.map +1 -0
- package/dist/components/organisms/FilterBar/index.cjs +19 -7
- package/dist/components/organisms/FilterBar/index.cjs.map +1 -1
- package/dist/components/organisms/FilterBar/index.d.ts +1 -0
- package/dist/components/organisms/FilterBar/index.d.ts.map +1 -1
- package/dist/components/organisms/FilterBar/index.js +18 -7
- package/dist/components/organisms/FilterBar/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +2 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts +10 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +2 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.cjs +3 -1
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +3 -1
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/Table/index.cjs +14 -244
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +29 -124
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +13 -243
- package/dist/components/organisms/Table/index.js.map +1 -1
- package/dist/components/organisms/Tables/Table/Table.cjs +305 -0
- package/dist/components/organisms/Tables/Table/Table.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/Table.d.ts +146 -0
- package/dist/components/organisms/Tables/Table/Table.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/Table.js +301 -0
- package/dist/components/organisms/Tables/Table/Table.js.map +1 -0
- package/dist/components/organisms/Tables/Table/Table.styles.cjs +29 -0
- package/dist/components/organisms/Tables/Table/Table.styles.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/Table.styles.d.ts +16 -0
- package/dist/components/organisms/Tables/Table/Table.styles.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/Table.styles.js +27 -0
- package/dist/components/organisms/Tables/Table/Table.styles.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.cjs +2 -2
- package/dist/components/organisms/Tables/Table/components/TableCardList.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/components/TableCardList.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.js +2 -2
- package/dist/components/organisms/Tables/Table/components/TableCardList.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.cjs +10 -5
- package/dist/components/organisms/Tables/Table/components/TableCardRow.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/components/TableCardRow.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.js +11 -6
- package/dist/components/organisms/Tables/Table/components/TableCardRow.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.cjs +2 -2
- package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.d.ts +3 -1
- package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.js +2 -2
- package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.js.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs +17 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts +5 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.js +15 -0
- package/dist/components/organisms/Tables/Table/components/TableEmptyState.js.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableFallbackCard.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/components/TableFallbackCard.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableFallbackCard.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.cjs +6 -5
- package/dist/components/organisms/Tables/Table/components/TableRowCard.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/components/TableRowCard.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.js +6 -5
- package/dist/components/organisms/Tables/Table/components/TableRowCard.js.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableSortIcon.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableSortIcon.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableSortIcon.js.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs +22 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts +12 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js +20 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.cjs +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.js +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.js.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs +42 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts +14 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js +40 -0
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.cjs +8 -11
- package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.d.ts +10 -3
- package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.js +9 -12
- package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.js.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.js.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs +83 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts +23 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js +81 -0
- package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.cjs +12 -4
- package/dist/components/organisms/Tables/Table/hooks/useTableSelection.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.d.ts +5 -3
- package/dist/components/organisms/Tables/Table/hooks/useTableSelection.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.js +12 -4
- package/dist/components/organisms/Tables/Table/hooks/useTableSelection.js.map +1 -0
- package/dist/components/organisms/Tables/Table/providers/Table.context.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.d.ts +14 -2
- package/dist/components/organisms/Tables/Table/providers/Table.context.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/providers/Table.context.js.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs +55 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts +25 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js +51 -0
- package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs +57 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts +66 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js +52 -0
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.cjs +21 -21
- package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.d.ts +29 -19
- package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.js +20 -21
- package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.js.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs +34 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts +37 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js +32 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs +32 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts +21 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts.map +1 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js +30 -0
- package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js.map +1 -0
- package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.cjs +12 -5
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.cjs.map +1 -0
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts +47 -0
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts.map +1 -0
- package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.js +12 -5
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.js.map +1 -0
- package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.cjs.map +1 -0
- package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.d.ts.map +1 -0
- package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.js.map +1 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs +84 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs.map +1 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts +20 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts.map +1 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js +81 -0
- package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js.map +1 -0
- package/dist/components/organisms/Tables/index.cjs +14 -0
- package/dist/components/organisms/Tables/index.cjs.map +1 -0
- package/dist/components/organisms/Tables/index.d.ts +19 -0
- package/dist/components/organisms/Tables/index.d.ts.map +1 -0
- package/dist/components/organisms/Tables/index.js +4 -0
- package/dist/components/organisms/Tables/index.js.map +1 -0
- package/dist/components/organisms/{Table/table.types.d.ts → Tables/tables.types.d.ts} +12 -2
- package/dist/components/organisms/Tables/tables.types.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableCard.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.d.ts +2 -2
- package/dist/components/organisms/Tables/utilities/tableCard.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableCard.utils.js.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.cjs +7 -4
- package/dist/components/organisms/Tables/utilities/tableChildren.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.d.ts +5 -3
- package/dist/components/organisms/Tables/utilities/tableChildren.utils.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.js +7 -4
- package/dist/components/organisms/Tables/utilities/tableChildren.utils.js.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs +23 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts +8 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.js +21 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.js.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.cjs +1 -1
- package/dist/components/organisms/Tables/utilities/tableSort.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.d.ts +1 -1
- package/dist/components/organisms/Tables/utilities/tableSort.utils.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.js +1 -1
- package/dist/components/organisms/Tables/utilities/tableSort.utils.js.map +1 -0
- package/dist/hooks/useFocusAfterRetry/index.cjs +21 -19
- package/dist/hooks/useFocusAfterRetry/index.cjs.map +1 -1
- package/dist/hooks/useFocusAfterRetry/index.d.ts +15 -5
- package/dist/hooks/useFocusAfterRetry/index.d.ts.map +1 -1
- package/dist/hooks/useFocusAfterRetry/index.js +21 -19
- package/dist/hooks/useFocusAfterRetry/index.js.map +1 -1
- package/dist/hooks/useFocusHandOff/index.cjs +67 -0
- package/dist/hooks/useFocusHandOff/index.cjs.map +1 -0
- package/dist/hooks/useFocusHandOff/index.d.ts +17 -0
- package/dist/hooks/useFocusHandOff/index.d.ts.map +1 -0
- package/dist/hooks/useFocusHandOff/index.js +65 -0
- package/dist/hooks/useFocusHandOff/index.js.map +1 -0
- package/dist/hooks/useListQueryParams/index.cjs +238 -0
- package/dist/hooks/useListQueryParams/index.cjs.map +1 -0
- package/dist/hooks/useListQueryParams/index.d.ts +77 -0
- package/dist/hooks/useListQueryParams/index.d.ts.map +1 -0
- package/dist/hooks/useListQueryParams/index.js +236 -0
- package/dist/hooks/useListQueryParams/index.js.map +1 -0
- package/dist/hooks/useLoadState/index.cjs +69 -0
- package/dist/hooks/useLoadState/index.cjs.map +1 -0
- package/dist/hooks/useLoadState/index.d.ts +44 -0
- package/dist/hooks/useLoadState/index.d.ts.map +1 -0
- package/dist/hooks/useLoadState/index.js +67 -0
- package/dist/hooks/useLoadState/index.js.map +1 -0
- package/dist/hooks/usePagedList/index.cjs +61 -0
- package/dist/hooks/usePagedList/index.cjs.map +1 -0
- package/dist/hooks/usePagedList/index.d.ts +56 -0
- package/dist/hooks/usePagedList/index.d.ts.map +1 -0
- package/dist/hooks/usePagedList/index.js +59 -0
- package/dist/hooks/usePagedList/index.js.map +1 -0
- package/dist/native/components/atoms/LiveStatus/index.d.ts +12 -0
- package/dist/native/components/organisms/Tables/index.d.ts +12 -0
- package/dist/native/hooks/useFocusHandOff/index.d.ts +12 -0
- package/dist/native/hooks/useListQueryParams/index.d.ts +12 -0
- package/dist/native/hooks/useLoadState/index.d.ts +12 -0
- package/dist/native/hooks/usePagedList/index.d.ts +12 -0
- package/dist/native/utilities/listQueryUtils/index.d.ts +12 -0
- package/dist/styles.css +12 -0
- package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.cjs +9 -0
- package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.cjs.map +1 -0
- package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.d.ts +8 -0
- package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.d.ts.map +1 -0
- package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.js +9 -1
- package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.js.map +1 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs +47 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts +51 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.js +43 -0
- package/dist/utilities/__internal__/listStateUtils/listState.utils.js.map +1 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs +67 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts +27 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js +64 -0
- package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js.map +1 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs +28 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts +10 -0
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts.map +1 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js +28 -1
- package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js.map +1 -1
- package/dist/utilities/listQueryUtils/index.cjs +59 -0
- package/dist/utilities/listQueryUtils/index.cjs.map +1 -0
- package/dist/utilities/listQueryUtils/index.d.ts +46 -0
- package/dist/utilities/listQueryUtils/index.d.ts.map +1 -0
- package/dist/utilities/listQueryUtils/index.js +55 -0
- package/dist/utilities/listQueryUtils/index.js.map +1 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.js +2 -0
- package/dist/utilities/localStorageUtils/localStorageUtils.constants.js.map +1 -1
- package/package.json +9 -9
- package/dist/components/forms/Form/utilities/focusFromCode.utils.cjs.map +0 -1
- package/dist/components/forms/Form/utilities/focusFromCode.utils.d.ts.map +0 -1
- package/dist/components/forms/Form/utilities/focusFromCode.utils.js.map +0 -1
- package/dist/components/organisms/Table/components/TableCardList.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableCardList.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableCardList.js.map +0 -1
- package/dist/components/organisms/Table/components/TableCardRow.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableCardRow.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableCardRow.js.map +0 -1
- package/dist/components/organisms/Table/components/TableCardsSelectAll.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableCardsSelectAll.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableCardsSelectAll.js.map +0 -1
- package/dist/components/organisms/Table/components/TableFallbackCard.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableFallbackCard.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableFallbackCard.js.map +0 -1
- package/dist/components/organisms/Table/components/TableFocusGuard.cjs +0 -23
- package/dist/components/organisms/Table/components/TableFocusGuard.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableFocusGuard.d.ts +0 -2
- package/dist/components/organisms/Table/components/TableFocusGuard.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableFocusGuard.js +0 -21
- package/dist/components/organisms/Table/components/TableFocusGuard.js.map +0 -1
- package/dist/components/organisms/Table/components/TableLayoutToggle.cjs +0 -27
- package/dist/components/organisms/Table/components/TableLayoutToggle.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts +0 -17
- package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableLayoutToggle.js +0 -25
- package/dist/components/organisms/Table/components/TableLayoutToggle.js.map +0 -1
- package/dist/components/organisms/Table/components/TableRowCard.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableRowCard.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableRowCard.js.map +0 -1
- package/dist/components/organisms/Table/components/TableSortIcon.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableSortIcon.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableSortIcon.js.map +0 -1
- package/dist/components/organisms/Table/components/TableSortMenu.cjs.map +0 -1
- package/dist/components/organisms/Table/components/TableSortMenu.d.ts +0 -35
- package/dist/components/organisms/Table/components/TableSortMenu.d.ts.map +0 -1
- package/dist/components/organisms/Table/components/TableSortMenu.js.map +0 -1
- package/dist/components/organisms/Table/hooks/useFirstSortDirection.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useFirstSortDirection.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useFirstSortDirection.js.map +0 -1
- package/dist/components/organisms/Table/hooks/useIsAtLeastMd.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useIsAtLeastMd.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useIsAtLeastMd.js.map +0 -1
- package/dist/components/organisms/Table/hooks/usePlaceholderRows.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/usePlaceholderRows.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/usePlaceholderRows.js.map +0 -1
- package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.js.map +0 -1
- package/dist/components/organisms/Table/hooks/useTableSelection.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useTableSelection.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useTableSelection.js.map +0 -1
- package/dist/components/organisms/Table/providers/Table.context.cjs.map +0 -1
- package/dist/components/organisms/Table/providers/Table.context.d.ts.map +0 -1
- package/dist/components/organisms/Table/providers/Table.context.js.map +0 -1
- package/dist/components/organisms/Table/table.types.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableCard.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableCard.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableCard.utils.js.map +0 -1
- package/dist/components/organisms/Table/utilities/tableChildren.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableChildren.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableChildren.utils.js.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSelection.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSelection.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSelection.utils.js.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSort.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSort.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableSort.utils.js.map +0 -1
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.js +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.js +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.js +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.js +0 -0
- /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.js +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useListQueryParams/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AA4FA,MAAM,WAAW,GAAG,CAAC,MAAuB,EAAE,KAAwB,KAAI;AACxE,IAAA,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE;QACjC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AAAE,YAAA,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;IACpE;AACA,IAAA,OAAO,KAAK;AACd,CAAC;AAED;AACA,MAAM,KAAK,GAAG,CAAC,MAAuB,KAAI;AACxC,IAAA,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC;IAC1C,MAAM,CAAC,IAA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,CAAC,CAAC;gBACF,aAAa,CAAC,MAAM,EAAE;YACxB,CAAC;SACF;IACH,CAAC,EAAE,EAAE,CAAC;IAEN,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE;AAC7D;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var listState_utils = require('../../utilities/__internal__/listStateUtils/listState.utils.cjs');
|
|
5
|
+
|
|
6
|
+
// Counted per key, so overlapping retries on one key hold it until the last of them settles.
|
|
7
|
+
const withRetryCount = (counts, key, change) => {
|
|
8
|
+
const next = new Map(counts);
|
|
9
|
+
const count = (counts.get(key) ?? 0) + change;
|
|
10
|
+
if (count > 0)
|
|
11
|
+
next.set(key, count);
|
|
12
|
+
else
|
|
13
|
+
next.delete(key);
|
|
14
|
+
return next;
|
|
15
|
+
};
|
|
16
|
+
const ignoreRejection = () => { };
|
|
17
|
+
const isPromiseLike = (value) => typeof value?.then === 'function';
|
|
18
|
+
/**
|
|
19
|
+
* Decides what a request shows, loading, stand-in data, an error or the data, and keeps a failed request's error on screen
|
|
20
|
+
* while its retry runs. TanStack Query drops the error as soon as the query fetches again, so whether a retry is running
|
|
21
|
+
* cannot be read back from the query; use it for a single record, and through `usePagedList` for a list.
|
|
22
|
+
*
|
|
23
|
+
* @param options The request's key and state as the data library reports it, and its `refetch`; see `UseLoadStateOptions`.
|
|
24
|
+
* @returns At most one of `isLoading`, `isSearching` and `isError`, with `showData`, which is `false` while the error shows, so
|
|
25
|
+
* a failed refetch's cached data and stand-in data stay hidden until a retry succeeds; `isRetrying` while a retry pressed on
|
|
26
|
+
* the current key's error runs, during which `isError` stays `true`; and `retry`, which only refetches when the request is
|
|
27
|
+
* not in error. A refetch on returning to a key that failed earlier is a load, not a retry, and a retry left running behind
|
|
28
|
+
* another key is still one when its key is shown again.
|
|
29
|
+
*/
|
|
30
|
+
const useLoadState = ({ key, isPending, isError, isPreviousData = false, refetch }) => {
|
|
31
|
+
const [retryCounts, setRetryCounts] = React.useState(() => new Map());
|
|
32
|
+
const isRetrying = retryCounts.has(key);
|
|
33
|
+
const state = listState_utils.loadStateOf({ isPending, isError, isPreviousData, isRetrying });
|
|
34
|
+
// A layout effect, so a press straight after the render that showed the error already reads it.
|
|
35
|
+
const latest = React.useRef({ key, refetch, isError: state.isError });
|
|
36
|
+
React.useLayoutEffect(() => {
|
|
37
|
+
latest.current = { key, refetch, isError: state.isError };
|
|
38
|
+
});
|
|
39
|
+
const retry = React.useCallback(() => {
|
|
40
|
+
const { key: retriedKey, refetch: run, isError: isInError } = latest.current;
|
|
41
|
+
// A refetch of a request that has not failed, such as a Refresh, must not show an error or hide the data.
|
|
42
|
+
if (!isInError) {
|
|
43
|
+
const refresh = run();
|
|
44
|
+
// The data library reports a failed refresh through `isError`; left unhandled, the rejection would reach the browser too.
|
|
45
|
+
if (isPromiseLike(refresh))
|
|
46
|
+
refresh.then(undefined, ignoreRejection);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const settle = () => setRetryCounts((counts) => withRetryCount(counts, retriedKey, -1));
|
|
50
|
+
setRetryCounts((counts) => withRetryCount(counts, retriedKey, 1));
|
|
51
|
+
let attempt;
|
|
52
|
+
try {
|
|
53
|
+
attempt = run();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// A refetch that throws started nothing, so the error must not hold behind a spinner that never ends.
|
|
57
|
+
settle();
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
if (isPromiseLike(attempt))
|
|
61
|
+
attempt.then(settle, settle);
|
|
62
|
+
else
|
|
63
|
+
settle();
|
|
64
|
+
}, []);
|
|
65
|
+
return { ...state, isRetrying, retry };
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.useLoadState = useLoadState;
|
|
69
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/useLoadState/index.ts"],"sourcesContent":[null],"names":["useState","loadStateOf","useRef","useLayoutEffect","useCallback"],"mappings":";;;;;AAuCA;AACA,MAAM,cAAc,GAAG,CAAC,MAAmB,EAAE,GAA+B,EAAE,MAAc,KAAiB;AAC3G,IAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC;AAC5B,IAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM;IAC7C,IAAI,KAAK,GAAG,CAAC;AAAE,QAAA,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;AACrB,IAAA,OAAO,IAAI;AACb,CAAC;AAED,MAAM,eAAe,GAAG,MAAK,EAAE,CAAC;AAEhC,MAAM,aAAa,GAAG,CAAC,KAAc,KAAoC,OAAQ,KAAqC,EAAE,IAAI,KAAK,UAAU;AAE3I;;;;;;;;;;;AAWG;AACI,MAAM,YAAY,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,KAAK,EAAE,OAAO,EAAuB,KAAe;AAC3H,IAAA,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAGA,cAAQ,CAAc,MAAM,IAAI,GAAG,EAAE,CAAC;IAC5E,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;AACvC,IAAA,MAAM,KAAK,GAAGC,2BAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;;AAG7E,IAAA,MAAM,MAAM,GAAGC,YAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAC/DC,qBAAe,CAAC,MAAK;AACnB,QAAA,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;AAC3D,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,KAAK,GAAGC,iBAAW,CAAC,MAAK;AAC7B,QAAA,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,OAAO;;QAE5E,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,OAAO,GAAG,GAAG,EAAE;;YAErB,IAAI,aAAa,CAAC,OAAO,CAAC;AAAE,gBAAA,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;YACpE;QACF;QACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;AACvF,QAAA,cAAc,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AACjE,QAAA,IAAI,OAAgB;AACpB,QAAA,IAAI;YACF,OAAO,GAAG,GAAG,EAAE;QACjB;QAAE,OAAO,KAAK,EAAE;;AAEd,YAAA,MAAM,EAAE;AACR,YAAA,MAAM,KAAK;QACb;QACA,IAAI,aAAa,CAAC,OAAO,CAAC;AAAE,YAAA,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;;AACnD,YAAA,MAAM,EAAE;IACf,CAAC,EAAE,EAAE,CAAC;IAEN,OAAO,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;AACxC;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface UseLoadStateOptions {
|
|
2
|
+
/** Names the request on screen, such as a record's id or a list query's stable key; each `retry` is tracked under its key. */
|
|
3
|
+
key: string | number | null;
|
|
4
|
+
/** The request has no data yet, as TanStack Query's `isPending`. */
|
|
5
|
+
isPending: boolean;
|
|
6
|
+
/** The request failed. */
|
|
7
|
+
isError: boolean;
|
|
8
|
+
/** The previous request's data is standing in while this one lands, as TanStack Query's `isPlaceholderData`. */
|
|
9
|
+
isPreviousData?: boolean;
|
|
10
|
+
/** Starts the request again. A returned promise ends the retry when it settles; anything else ends it at once. */
|
|
11
|
+
refetch: () => unknown;
|
|
12
|
+
}
|
|
13
|
+
/** What `useLoadState` reports a request shows, and its retry. */
|
|
14
|
+
export interface LoadState {
|
|
15
|
+
/** Nothing to show yet: draw the loading state. */
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
/** The previous request's data stands in while this one lands, as for a search. */
|
|
18
|
+
isSearching: boolean;
|
|
19
|
+
/** Show the error and its retry button; it wins over the rest, and stays `true` while a retry runs. */
|
|
20
|
+
isError: boolean;
|
|
21
|
+
/** The data may be drawn; `false` while the error shows, so a failed refetch's cached data stays hidden behind it. */
|
|
22
|
+
showData: boolean;
|
|
23
|
+
/** A `retry` pressed on the current request's error has not settled; the error, and the spinner on its button, hold until it does. */
|
|
24
|
+
isRetrying: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Runs `refetch` for the current request. While it is in error, the retry is tracked until it settles; otherwise, as for a
|
|
27
|
+
* Refresh control, it only refetches. The same function on every render.
|
|
28
|
+
*/
|
|
29
|
+
retry: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Decides what a request shows, loading, stand-in data, an error or the data, and keeps a failed request's error on screen
|
|
33
|
+
* while its retry runs. TanStack Query drops the error as soon as the query fetches again, so whether a retry is running
|
|
34
|
+
* cannot be read back from the query; use it for a single record, and through `usePagedList` for a list.
|
|
35
|
+
*
|
|
36
|
+
* @param options The request's key and state as the data library reports it, and its `refetch`; see `UseLoadStateOptions`.
|
|
37
|
+
* @returns At most one of `isLoading`, `isSearching` and `isError`, with `showData`, which is `false` while the error shows, so
|
|
38
|
+
* a failed refetch's cached data and stand-in data stay hidden until a retry succeeds; `isRetrying` while a retry pressed on
|
|
39
|
+
* the current key's error runs, during which `isError` stays `true`; and `retry`, which only refetches when the request is
|
|
40
|
+
* not in error. A refetch on returning to a key that failed earlier is a load, not a retry, and a retry left running behind
|
|
41
|
+
* another key is still one when its key is shown again.
|
|
42
|
+
*/
|
|
43
|
+
export declare const useLoadState: ({ key, isPending, isError, isPreviousData, refetch }: UseLoadStateOptions) => LoadState;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useLoadState/index.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,mBAAmB;IAClC,8HAA8H;IAC9H,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,gHAAgH;IAChH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kHAAkH;IAClH,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAED,kEAAkE;AAClE,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,WAAW,EAAE,OAAO,CAAC;IACrB,uGAAuG;IACvG,OAAO,EAAE,OAAO,CAAC;IACjB,sHAAsH;IACtH,QAAQ,EAAE,OAAO,CAAC;IAClB,sIAAsI;IACtI,UAAU,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAiBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,sDAA8D,mBAAmB,KAAG,SAmChH,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useState, useRef, useLayoutEffect, useCallback } from 'react';
|
|
2
|
+
import { loadStateOf } from '../../utilities/__internal__/listStateUtils/listState.utils.js';
|
|
3
|
+
|
|
4
|
+
// Counted per key, so overlapping retries on one key hold it until the last of them settles.
|
|
5
|
+
const withRetryCount = (counts, key, change) => {
|
|
6
|
+
const next = new Map(counts);
|
|
7
|
+
const count = (counts.get(key) ?? 0) + change;
|
|
8
|
+
if (count > 0)
|
|
9
|
+
next.set(key, count);
|
|
10
|
+
else
|
|
11
|
+
next.delete(key);
|
|
12
|
+
return next;
|
|
13
|
+
};
|
|
14
|
+
const ignoreRejection = () => { };
|
|
15
|
+
const isPromiseLike = (value) => typeof value?.then === 'function';
|
|
16
|
+
/**
|
|
17
|
+
* Decides what a request shows, loading, stand-in data, an error or the data, and keeps a failed request's error on screen
|
|
18
|
+
* while its retry runs. TanStack Query drops the error as soon as the query fetches again, so whether a retry is running
|
|
19
|
+
* cannot be read back from the query; use it for a single record, and through `usePagedList` for a list.
|
|
20
|
+
*
|
|
21
|
+
* @param options The request's key and state as the data library reports it, and its `refetch`; see `UseLoadStateOptions`.
|
|
22
|
+
* @returns At most one of `isLoading`, `isSearching` and `isError`, with `showData`, which is `false` while the error shows, so
|
|
23
|
+
* a failed refetch's cached data and stand-in data stay hidden until a retry succeeds; `isRetrying` while a retry pressed on
|
|
24
|
+
* the current key's error runs, during which `isError` stays `true`; and `retry`, which only refetches when the request is
|
|
25
|
+
* not in error. A refetch on returning to a key that failed earlier is a load, not a retry, and a retry left running behind
|
|
26
|
+
* another key is still one when its key is shown again.
|
|
27
|
+
*/
|
|
28
|
+
const useLoadState = ({ key, isPending, isError, isPreviousData = false, refetch }) => {
|
|
29
|
+
const [retryCounts, setRetryCounts] = useState(() => new Map());
|
|
30
|
+
const isRetrying = retryCounts.has(key);
|
|
31
|
+
const state = loadStateOf({ isPending, isError, isPreviousData, isRetrying });
|
|
32
|
+
// A layout effect, so a press straight after the render that showed the error already reads it.
|
|
33
|
+
const latest = useRef({ key, refetch, isError: state.isError });
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
latest.current = { key, refetch, isError: state.isError };
|
|
36
|
+
});
|
|
37
|
+
const retry = useCallback(() => {
|
|
38
|
+
const { key: retriedKey, refetch: run, isError: isInError } = latest.current;
|
|
39
|
+
// A refetch of a request that has not failed, such as a Refresh, must not show an error or hide the data.
|
|
40
|
+
if (!isInError) {
|
|
41
|
+
const refresh = run();
|
|
42
|
+
// The data library reports a failed refresh through `isError`; left unhandled, the rejection would reach the browser too.
|
|
43
|
+
if (isPromiseLike(refresh))
|
|
44
|
+
refresh.then(undefined, ignoreRejection);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const settle = () => setRetryCounts((counts) => withRetryCount(counts, retriedKey, -1));
|
|
48
|
+
setRetryCounts((counts) => withRetryCount(counts, retriedKey, 1));
|
|
49
|
+
let attempt;
|
|
50
|
+
try {
|
|
51
|
+
attempt = run();
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
// A refetch that throws started nothing, so the error must not hold behind a spinner that never ends.
|
|
55
|
+
settle();
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
if (isPromiseLike(attempt))
|
|
59
|
+
attempt.then(settle, settle);
|
|
60
|
+
else
|
|
61
|
+
settle();
|
|
62
|
+
}, []);
|
|
63
|
+
return { ...state, isRetrying, retry };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { useLoadState };
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useLoadState/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAuCA;AACA,MAAM,cAAc,GAAG,CAAC,MAAmB,EAAE,GAA+B,EAAE,MAAc,KAAiB;AAC3G,IAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC;AAC5B,IAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM;IAC7C,IAAI,KAAK,GAAG,CAAC;AAAE,QAAA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AC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;YACpE;QACF;QACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;AACvF,QAAA,cAAc,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AACjE,QAAA,IAAI,OAAgB;AACpB,QAAA,IAAI;YACF,OAAO,GAAG,GAAG,EAAE;QACjB;QAAE,OAAO,KAAK,EAAE;;AAEd,YAAA,MAAM,EAAE;AACR,YAAA,MAAM,KAAK;QACb;QACA,IAAI,aAAa,CAAC,OAAO,CAAC;AAAE,YAAA,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;;AACnD,YAAA,MAAM,EAAE;IACf,CAAC,EAAE,EAAE,CAAC;IAEN,OAAO,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;AACxC;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var useLoadState = require('@flipdish/ui-library/hooks/useLoadState');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var listState_utils = require('../../utilities/__internal__/listStateUtils/listState.utils.cjs');
|
|
6
|
+
var stableKey_utils = require('../../utilities/__internal__/stableKeyUtils/stableKey.utils.cjs');
|
|
7
|
+
|
|
8
|
+
// One empty array for every render with nothing to draw, so `rows` keeps its identity while it stays empty.
|
|
9
|
+
const NO_ROWS = [];
|
|
10
|
+
/**
|
|
11
|
+
* Reports what a paged list shows, from the state of the request its page makes, which keeps its own `useQuery`. Use it for
|
|
12
|
+
* any list with a pager: it keeps the row total across page changes, holds a failed load's error through its retry, and
|
|
13
|
+
* names the query on screen for the status region that announces it.
|
|
14
|
+
*
|
|
15
|
+
* @param options The page's query, its rows and total, the request's state as the data library reports it, and its `refetch`;
|
|
16
|
+
* see `UsePagedListOptions`.
|
|
17
|
+
* @returns The `rows` to draw, `[]` while there is nothing to show or the error shows, as it does for a failed refetch whose
|
|
18
|
+
* rows are cached; `total` and `totalPages`, which stay through a page or rows-per-page change and an error, and are unknown
|
|
19
|
+
* again once anything else changes; the load state of `useLoadState`; `resultKey`, which changes as another query's result
|
|
20
|
+
* lands and with each failed attempt, but not for a refresh of the same query; `isPastEnd` for a link to a page past the
|
|
21
|
+
* last; and `loadingRowCount`, so a short last page does not load taller than it lands.
|
|
22
|
+
*/
|
|
23
|
+
const usePagedList = ({ query, rows, total, isPending, isError, isPreviousData = false, errorCount = 0, refetch, }) => {
|
|
24
|
+
const key = stableKey_utils.stableKeyOf(query);
|
|
25
|
+
const { showData, ...state } = useLoadState.useLoadState({ key, isPending, isError, isPreviousData, refetch });
|
|
26
|
+
// Rows standing in from the previous request belong to its result set, so neither their total nor their key is kept.
|
|
27
|
+
const hasLanded = rows !== undefined && !isPreviousData;
|
|
28
|
+
// Kept per result set, so the pager stays through a page change but never offers pages a new search or filter may not have.
|
|
29
|
+
const resultSet = listState_utils.resultSetKeyOf(query);
|
|
30
|
+
// A `NaN` total, as from `Number()` of a missing header, never equals the kept one and would set state on every render.
|
|
31
|
+
const landedTotal = hasLanded && Number.isFinite(total) ? total : undefined;
|
|
32
|
+
const [kept, setKept] = React.useState();
|
|
33
|
+
if (landedTotal !== undefined && (kept?.resultSet !== resultSet || kept.total !== landedTotal))
|
|
34
|
+
setKept({ resultSet, total: landedTotal });
|
|
35
|
+
const knownTotal = landedTotal ?? (kept?.resultSet === resultSet ? kept.total : undefined);
|
|
36
|
+
const totalPages = listState_utils.pageCountOf(knownTotal, query.pageSize);
|
|
37
|
+
// Keyed by query, not by response: a background refetch landing new rows for the same query must not be announced again.
|
|
38
|
+
const shownResult = hasLanded ? key : undefined;
|
|
39
|
+
const [landedResult, setLandedResult] = React.useState();
|
|
40
|
+
if (shownResult !== undefined && shownResult !== landedResult)
|
|
41
|
+
setLandedResult(shownResult);
|
|
42
|
+
// A failed attempt gets a key of its own, so a retry that fails again is announced although the words are the same.
|
|
43
|
+
const resultKey = state.isError ? `${key} failed ${errorCount}` : (shownResult ?? landedResult);
|
|
44
|
+
const shownRows = showData ? (rows ?? NO_ROWS) : NO_ROWS;
|
|
45
|
+
const isSettled = !state.isLoading && !state.isSearching && !state.isError;
|
|
46
|
+
const isPastEnd = isSettled && hasLanded && shownRows.length === 0 && knownTotal !== undefined && knownTotal > 0 && query.page > totalPages;
|
|
47
|
+
const rowsBeforePage = (query.page - 1) * query.pageSize;
|
|
48
|
+
const rowsOnPage = knownTotal === undefined ? 0 : Math.min(knownTotal - rowsBeforePage, query.pageSize);
|
|
49
|
+
return {
|
|
50
|
+
...state,
|
|
51
|
+
rows: shownRows,
|
|
52
|
+
total: knownTotal,
|
|
53
|
+
totalPages,
|
|
54
|
+
resultKey,
|
|
55
|
+
isPastEnd,
|
|
56
|
+
loadingRowCount: rowsOnPage > 0 ? rowsOnPage : query.pageSize,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.usePagedList = usePagedList;
|
|
61
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/hooks/usePagedList/index.ts"],"sourcesContent":[null],"names":["stableKeyOf","useLoadState","resultSetKeyOf","useState","pageCountOf"],"mappings":";;;;;;;AAkDA;AACA,MAAM,OAAO,GAAqB,EAAE;AAEpC;;;;;;;;;;;;AAYG;AACI,MAAM,YAAY,GAAG,CAAqD,EAC/E,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,GAAG,KAAK,EACtB,UAAU,GAAG,CAAC,EACd,OAAO,GACyB,KAAyB;AACzD,IAAA,MAAM,GAAG,GAAGA,2BAAW,CAAC,KAAK,CAAC;IAC9B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAGC,yBAAY,CAAC,EAA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,KAAK,CAAC,OAAO;IAC1E,MAAM,SAAS,GAAG,SAAS,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,UAAU;AAE3I,IAAA,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ;IACxD,MAAM,UAAU,GAAG,UAAU,KAAK,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC;IAEvG,OAAO;AACL,QAAA,GAAG,KAAK;AACR,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,KAAK,EAAE,UAAU;QACjB,UAAU;QACV,SAAS;QACT,SAAS;AACT,QAAA,eAAe,EAAE,UAAU,GAAG,CAAC,GAAG,UAAU,GAAG,KAAK,CAAC,QAAQ;KAC9D;AACH;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type LoadState } from '@flipdish/ui-library/hooks/useLoadState';
|
|
2
|
+
/** The fields `usePagedList` reads from a list query; the rest of the query, such as its search and filters, passes through. */
|
|
3
|
+
export interface PagedListQuery {
|
|
4
|
+
/** The page requested, from 1. */
|
|
5
|
+
page: number;
|
|
6
|
+
/** Rows per page. */
|
|
7
|
+
pageSize: number;
|
|
8
|
+
}
|
|
9
|
+
export interface UsePagedListOptions<Row, Query extends PagedListQuery = PagedListQuery> {
|
|
10
|
+
/** Names the request: the page's query, or its `listQueryKeyOf` key. */
|
|
11
|
+
query: Query;
|
|
12
|
+
/** The page's rows, `undefined` until they arrive. */
|
|
13
|
+
rows: readonly Row[] | undefined;
|
|
14
|
+
/** The row total of the whole result set, from the API, `undefined` until a page arrives; `NaN` or `Infinity` counts as unknown. */
|
|
15
|
+
total: number | undefined;
|
|
16
|
+
/** The request has no data yet, as TanStack Query's `isPending`. */
|
|
17
|
+
isPending: boolean;
|
|
18
|
+
/** The request failed. */
|
|
19
|
+
isError: boolean;
|
|
20
|
+
/** The previous request's rows are standing in while this one lands, as TanStack Query's `isPlaceholderData`. */
|
|
21
|
+
isPreviousData?: boolean;
|
|
22
|
+
/** How many times the request has failed, as TanStack Query's `errorUpdateCount`, so a retry that fails again has a new `resultKey`. */
|
|
23
|
+
errorCount?: number;
|
|
24
|
+
/** Starts the request again. A returned promise ends the retry when it settles; anything else ends it at once. */
|
|
25
|
+
refetch: () => unknown;
|
|
26
|
+
}
|
|
27
|
+
/** What `usePagedList` reports a paged list shows. */
|
|
28
|
+
export interface PagedListState<Row> extends Omit<LoadState, 'showData'> {
|
|
29
|
+
/** The rows to draw: none while nothing has arrived or while the error shows, cached rows of a failed refetch included. */
|
|
30
|
+
rows: readonly Row[];
|
|
31
|
+
/** The current result set's row total, kept across page and page-size changes and through an error; `undefined` until a page lands. */
|
|
32
|
+
total: number | undefined;
|
|
33
|
+
/** The page count for the pager; `0` while `total` is unknown. */
|
|
34
|
+
totalPages: number;
|
|
35
|
+
/** Names the query whose rows are on screen, for keying a status announcement; each failed attempt has a key of its own. */
|
|
36
|
+
resultKey: string | undefined;
|
|
37
|
+
/** A page past the last one has landed with no rows, as from a stale link. */
|
|
38
|
+
isPastEnd: boolean;
|
|
39
|
+
/** How many placeholder rows a loading page draws: the size the page will land at when the total is known. */
|
|
40
|
+
loadingRowCount: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Reports what a paged list shows, from the state of the request its page makes, which keeps its own `useQuery`. Use it for
|
|
44
|
+
* any list with a pager: it keeps the row total across page changes, holds a failed load's error through its retry, and
|
|
45
|
+
* names the query on screen for the status region that announces it.
|
|
46
|
+
*
|
|
47
|
+
* @param options The page's query, its rows and total, the request's state as the data library reports it, and its `refetch`;
|
|
48
|
+
* see `UsePagedListOptions`.
|
|
49
|
+
* @returns The `rows` to draw, `[]` while there is nothing to show or the error shows, as it does for a failed refetch whose
|
|
50
|
+
* rows are cached; `total` and `totalPages`, which stay through a page or rows-per-page change and an error, and are unknown
|
|
51
|
+
* again once anything else changes; the load state of `useLoadState`; `resultKey`, which changes as another query's result
|
|
52
|
+
* lands and with each failed attempt, but not for a refresh of the same query; `isPastEnd` for a link to a page past the
|
|
53
|
+
* last; and `loadingRowCount`, so a short last page does not load taller than it lands.
|
|
54
|
+
*/
|
|
55
|
+
export declare const usePagedList: <Row, Query extends PagedListQuery = PagedListQuery>({ query, rows, total, isPending, isError, isPreviousData, errorCount, refetch, }: UsePagedListOptions<Row, Query>) => PagedListState<Row>;
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePagedList/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,yCAAyC,CAAC;AAKvF,gIAAgI;AAChI,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB,CAAC,GAAG,EAAE,KAAK,SAAS,cAAc,GAAG,cAAc;IACrF,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,SAAS,CAAC;IACjC,oIAAoI;IACpI,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wIAAwI;IACxI,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kHAAkH;IAClH,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,cAAc,CAAC,GAAG,CAAE,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACtE,2HAA2H;IAC3H,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,uIAAuI;IACvI,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,4HAA4H;IAC5H,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,8GAA8G;IAC9G,eAAe,EAAE,MAAM,CAAC;CACzB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,EAAE,KAAK,SAAS,cAAc,GAAG,cAAc,EAAE,kFAS9E,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,KAAG,cAAc,CAAC,GAAG,CAuCtD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useLoadState } from '@flipdish/ui-library/hooks/useLoadState';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { resultSetKeyOf, pageCountOf } from '../../utilities/__internal__/listStateUtils/listState.utils.js';
|
|
4
|
+
import { stableKeyOf } from '../../utilities/__internal__/stableKeyUtils/stableKey.utils.js';
|
|
5
|
+
|
|
6
|
+
// One empty array for every render with nothing to draw, so `rows` keeps its identity while it stays empty.
|
|
7
|
+
const NO_ROWS = [];
|
|
8
|
+
/**
|
|
9
|
+
* Reports what a paged list shows, from the state of the request its page makes, which keeps its own `useQuery`. Use it for
|
|
10
|
+
* any list with a pager: it keeps the row total across page changes, holds a failed load's error through its retry, and
|
|
11
|
+
* names the query on screen for the status region that announces it.
|
|
12
|
+
*
|
|
13
|
+
* @param options The page's query, its rows and total, the request's state as the data library reports it, and its `refetch`;
|
|
14
|
+
* see `UsePagedListOptions`.
|
|
15
|
+
* @returns The `rows` to draw, `[]` while there is nothing to show or the error shows, as it does for a failed refetch whose
|
|
16
|
+
* rows are cached; `total` and `totalPages`, which stay through a page or rows-per-page change and an error, and are unknown
|
|
17
|
+
* again once anything else changes; the load state of `useLoadState`; `resultKey`, which changes as another query's result
|
|
18
|
+
* lands and with each failed attempt, but not for a refresh of the same query; `isPastEnd` for a link to a page past the
|
|
19
|
+
* last; and `loadingRowCount`, so a short last page does not load taller than it lands.
|
|
20
|
+
*/
|
|
21
|
+
const usePagedList = ({ query, rows, total, isPending, isError, isPreviousData = false, errorCount = 0, refetch, }) => {
|
|
22
|
+
const key = stableKeyOf(query);
|
|
23
|
+
const { showData, ...state } = useLoadState({ key, isPending, isError, isPreviousData, refetch });
|
|
24
|
+
// Rows standing in from the previous request belong to its result set, so neither their total nor their key is kept.
|
|
25
|
+
const hasLanded = rows !== undefined && !isPreviousData;
|
|
26
|
+
// Kept per result set, so the pager stays through a page change but never offers pages a new search or filter may not have.
|
|
27
|
+
const resultSet = resultSetKeyOf(query);
|
|
28
|
+
// A `NaN` total, as from `Number()` of a missing header, never equals the kept one and would set state on every render.
|
|
29
|
+
const landedTotal = hasLanded && Number.isFinite(total) ? total : undefined;
|
|
30
|
+
const [kept, setKept] = useState();
|
|
31
|
+
if (landedTotal !== undefined && (kept?.resultSet !== resultSet || kept.total !== landedTotal))
|
|
32
|
+
setKept({ resultSet, total: landedTotal });
|
|
33
|
+
const knownTotal = landedTotal ?? (kept?.resultSet === resultSet ? kept.total : undefined);
|
|
34
|
+
const totalPages = pageCountOf(knownTotal, query.pageSize);
|
|
35
|
+
// Keyed by query, not by response: a background refetch landing new rows for the same query must not be announced again.
|
|
36
|
+
const shownResult = hasLanded ? key : undefined;
|
|
37
|
+
const [landedResult, setLandedResult] = useState();
|
|
38
|
+
if (shownResult !== undefined && shownResult !== landedResult)
|
|
39
|
+
setLandedResult(shownResult);
|
|
40
|
+
// A failed attempt gets a key of its own, so a retry that fails again is announced although the words are the same.
|
|
41
|
+
const resultKey = state.isError ? `${key} failed ${errorCount}` : (shownResult ?? landedResult);
|
|
42
|
+
const shownRows = showData ? (rows ?? NO_ROWS) : NO_ROWS;
|
|
43
|
+
const isSettled = !state.isLoading && !state.isSearching && !state.isError;
|
|
44
|
+
const isPastEnd = isSettled && hasLanded && shownRows.length === 0 && knownTotal !== undefined && knownTotal > 0 && query.page > totalPages;
|
|
45
|
+
const rowsBeforePage = (query.page - 1) * query.pageSize;
|
|
46
|
+
const rowsOnPage = knownTotal === undefined ? 0 : Math.min(knownTotal - rowsBeforePage, query.pageSize);
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
rows: shownRows,
|
|
50
|
+
total: knownTotal,
|
|
51
|
+
totalPages,
|
|
52
|
+
resultKey,
|
|
53
|
+
isPastEnd,
|
|
54
|
+
loadingRowCount: rowsOnPage > 0 ? rowsOnPage : query.pageSize,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { usePagedList };
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/usePagedList/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAkDA;AACA,MAAM,OAAO,GAAqB,EAAE;AAEpC;;;;;;;;;;;;AAYG;AACI,MAAM,YAAY,GAAG,CAAqD,EAC/E,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,GAAG,KAAK,EACtB,UAAU,GAAG,CAAC,EACd,OAAO,GACyB,KAAyB;AACzD,IAAA,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC;IAC9B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;;IAGjG,MAAM,SAAS,GAAG,IAAI,KAAK,SAAS,IAAI,CAAC,cAAc;;AAGvD,IAAA,MAAM,SAAS,GAAG,cAAc,CA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AU;AAE3I,IAAA,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ;IACxD,MAAM,UAAU,GAAG,UAAU,KAAK,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC;IAEvG,OAAO;AACL,QAAA,GAAG,KAAK;AACR,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,KAAK,EAAE,UAAU;QACjB,UAAU;QACV,SAAS;QACT,SAAS;AACT,QAAA,eAAe,EAAE,UAAU,GAAG,CAAC,GAAG,UAAU,GAAG,KAAK,CAAC,QAAQ;KAC9D;AACH;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiveStatus` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/components/atoms/LiveStatus` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `LiveStatus` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Tables` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/components/organisms/Tables` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `Tables` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useFocusHandOff` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/hooks/useFocusHandOff` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `useFocusHandOff` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useListQueryParams` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/hooks/useListQueryParams` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `useListQueryParams` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useLoadState` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/hooks/useLoadState` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `useLoadState` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `usePagedList` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/hooks/usePagedList` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `usePagedList` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `listQueryUtils` has no React Native implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
|
|
5
|
+
* that importing `@flipdish/ui-library/utilities/listQueryUtils` from React Native fails at
|
|
6
|
+
* compile time rather than resolving to the web build's types. There is no
|
|
7
|
+
* matching `index.js`, so Metro cannot bundle this module either.
|
|
8
|
+
*
|
|
9
|
+
* To make `listQueryUtils` available on React Native, add an `index.native.tsx` beside
|
|
10
|
+
* its `index.tsx` — the build picks it up automatically and this stub disappears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
|
package/dist/styles.css
CHANGED
|
@@ -141,6 +141,18 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/*
|
|
145
|
+
* The keyboard focus ring of an element `useFocusHandOff` (or `useFocusAfterRetry`, built on it) made focusable, which marks
|
|
146
|
+
* it with this attribute, so the element keeps its own classes. In `base`, so a utility on the element such as
|
|
147
|
+
* `focus-visible:outline-hidden` still wins.
|
|
148
|
+
*/
|
|
149
|
+
@layer base {
|
|
150
|
+
[data-focus-hand-off-target]:focus-visible {
|
|
151
|
+
outline: 2px solid var(--color-focus-ring);
|
|
152
|
+
outline-offset: 2px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
144
156
|
/* ============================================================
|
|
145
157
|
CodeSnippet — Shiki syntax-highlighting overrides
|
|
146
158
|
============================================================ */
|
|
@@ -42,6 +42,15 @@ const takeFocusFromCodeOnly = (element) => {
|
|
|
42
42
|
// Defined, as a prototype setter such as Storybook's would take an assignment for every element; by `Reflect`, as a form whose control holds the name must not throw.
|
|
43
43
|
Reflect.defineProperty(element, 'focus', { configurable: true, writable: true, value: focus });
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Says whether `takeFocusFromCodeOnly` already handles an element, so a second caller, such as a focus hand-off whose target
|
|
47
|
+
* is a `Form`, leaves the element and its own focus ring as they are.
|
|
48
|
+
*
|
|
49
|
+
* @param element The element to ask about.
|
|
50
|
+
* @returns `true` once `takeFocusFromCodeOnly` has been called on it.
|
|
51
|
+
*/
|
|
52
|
+
const isFocusableFromCodeOnly = (element) => wrapped.has(element);
|
|
45
53
|
|
|
54
|
+
exports.isFocusableFromCodeOnly = isFocusableFromCodeOnly;
|
|
46
55
|
exports.takeFocusFromCodeOnly = takeFocusFromCodeOnly;
|
|
47
56
|
//# sourceMappingURL=focusFromCode.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusFromCode.utils.cjs","sources":["../../../../src/utilities/__internal__/focusUtils/focusFromCode.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;A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C;AAChG;AAEA;;;;;;AAMG;AACI,MAAM,uBAAuB,GAAG,CAAC,OAAoB,KAAc,OAAO,CAAC,GAAG,CAAC,OAAO;;;"}
|
|
@@ -9,4 +9,12 @@
|
|
|
9
9
|
* the browser returns in the method's place.
|
|
10
10
|
*/
|
|
11
11
|
export declare const takeFocusFromCodeOnly: (element: HTMLElement) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Says whether `takeFocusFromCodeOnly` already handles an element, so a second caller, such as a focus hand-off whose target
|
|
14
|
+
* is a `Form`, leaves the element and its own focus ring as they are.
|
|
15
|
+
*
|
|
16
|
+
* @param element The element to ask about.
|
|
17
|
+
* @returns `true` once `takeFocusFromCodeOnly` has been called on it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isFocusableFromCodeOnly: (element: HTMLElement) => boolean;
|
|
12
20
|
//# sourceMappingURL=focusFromCode.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusFromCode.utils.d.ts","sourceRoot":"","sources":["../../../../src/utilities/__internal__/focusUtils/focusFromCode.utils.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,WAAW,KAAG,IAyB5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,WAAW,KAAG,OAA+B,CAAC"}
|
|
@@ -40,6 +40,14 @@ const takeFocusFromCodeOnly = (element) => {
|
|
|
40
40
|
// Defined, as a prototype setter such as Storybook's would take an assignment for every element; by `Reflect`, as a form whose control holds the name must not throw.
|
|
41
41
|
Reflect.defineProperty(element, 'focus', { configurable: true, writable: true, value: focus });
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Says whether `takeFocusFromCodeOnly` already handles an element, so a second caller, such as a focus hand-off whose target
|
|
45
|
+
* is a `Form`, leaves the element and its own focus ring as they are.
|
|
46
|
+
*
|
|
47
|
+
* @param element The element to ask about.
|
|
48
|
+
* @returns `true` once `takeFocusFromCodeOnly` has been called on it.
|
|
49
|
+
*/
|
|
50
|
+
const isFocusableFromCodeOnly = (element) => wrapped.has(element);
|
|
43
51
|
|
|
44
|
-
export { takeFocusFromCodeOnly };
|
|
52
|
+
export { isFocusableFromCodeOnly, takeFocusFromCodeOnly };
|
|
45
53
|
//# sourceMappingURL=focusFromCode.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusFromCode.utils.js","sources":["../../../../src/utilities/__internal__/focusUtils/focusFromCode.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,MAAM,OAAO,GAAG,IAAI,OAAO,EAAe;AAE1C;;;;;;;;;AASG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAoB,KAAU;AAClE,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE;AAC1B,IAAA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;;AAEpB,IAAA,MAAM,aAAa,GAAG,CAAC,OAAsB,KAAK,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;;AAEpG,IAAA,MAAM,QAAQ,GAAG,MAAO,OAAO,CAAC,WAAW,EAA4B,CAAC,aAAa,KAAK,OAAO;IAEjG,MAAM,OAAO,GAAG,MAAK;;AAEnB,QAAA,IAAI,QAAQ,EAAE;YAAE;;AAEhB,QAAA,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI;AAAE,YAAA,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC;AAClF,QAAA,OAAO,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC;AAC9C,IAAA,CAAC;AAED,IAAA,MAAM,KAAK,GAAG,CAAC,OAAsB,KAAI;AACvC,QAAA,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC;AAAE,YAAA,OAAO,aAAa,CAAC,OAAO,CAAC;AACnE,QAAA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