@flipdish/ui-library 0.70.0 → 0.72.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 +1 -1
- 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/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/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/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/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 -285
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.d.ts +29 -138
- package/dist/components/organisms/Table/index.d.ts.map +1 -1
- package/dist/components/organisms/Table/index.js +13 -284
- 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.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/Table.styles.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/Table.styles.d.ts.map +1 -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 +8 -4
- 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 +9 -5
- package/dist/components/organisms/Tables/Table/components/TableCardRow.js.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.d.ts.map +1 -0
- 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 +3 -3
- package/dist/components/organisms/Tables/Table/components/TableRowCard.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/components/TableRowCard.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.js +3 -3
- 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.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts.map +1 -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/{Table → Tables/Table}/hooks/useIsPlaceholderPage.cjs +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useIsPlaceholderPage.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useIsPlaceholderPage.js +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js.map +1 -0
- package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.d.ts.map +1 -0
- 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 +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useTableSelection.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/hooks/useTableSelection.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.js +1 -1
- 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 +4 -1
- 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/{Table → Tables/Table}/utilities/tableLoading.utils.cjs +1 -1
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/utilities/tableLoading.utils.d.ts +1 -1
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts.map +1 -0
- package/dist/components/organisms/{Table → Tables/Table}/utilities/tableLoading.utils.js +1 -1
- package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.d.ts.map +1 -0
- 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 +9 -2
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.cjs.map +1 -0
- package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.d.ts +18 -6
- package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts.map +1 -0
- package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.js +9 -2
- 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} +4 -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 +1 -1
- 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/Tables/utilities/tableChildren.utils.cjs.map +1 -0
- package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.d.ts +1 -1
- package/dist/components/organisms/Tables/utilities/tableChildren.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableChildren.utils.js.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableIterable.utils.js.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableSort.utils.cjs.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableSort.utils.d.ts.map +1 -0
- package/dist/components/organisms/Tables/utilities/tableSort.utils.js.map +1 -0
- package/dist/hooks/{useFocusHandOff/index.cjs → __internal__/useFocusHandOff/useFocusHandOff.cjs} +2 -2
- package/dist/hooks/__internal__/useFocusHandOff/useFocusHandOff.cjs.map +1 -0
- package/dist/hooks/{useFocusHandOff/index.d.ts → __internal__/useFocusHandOff/useFocusHandOff.d.ts} +1 -1
- package/dist/hooks/__internal__/useFocusHandOff/useFocusHandOff.d.ts.map +1 -0
- package/dist/hooks/{useFocusHandOff/index.js → __internal__/useFocusHandOff/useFocusHandOff.js} +2 -2
- package/dist/hooks/__internal__/useFocusHandOff/useFocusHandOff.js.map +1 -0
- package/dist/hooks/useFocusAfterRetry/index.cjs +2 -2
- package/dist/hooks/useFocusAfterRetry/index.d.ts +1 -1
- package/dist/hooks/useFocusAfterRetry/index.js +2 -2
- 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/{hooks/useFocusHandOff → components/organisms/Tables}/index.d.ts +3 -3
- 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 +3 -3
- 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 +3 -3
- package/dist/components/organisms/Table/Table.styles.cjs.map +0 -1
- package/dist/components/organisms/Table/Table.styles.d.ts.map +0 -1
- package/dist/components/organisms/Table/Table.styles.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/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.map +0 -1
- package/dist/components/organisms/Table/components/TableSortMenu.js.map +0 -1
- package/dist/components/organisms/Table/hooks/useBusyCount.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useBusyCount.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useBusyCount.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/useIsPlaceholderPage.cjs.map +0 -1
- package/dist/components/organisms/Table/hooks/useIsPlaceholderPage.d.ts.map +0 -1
- package/dist/components/organisms/Table/hooks/useIsPlaceholderPage.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/tableIterable.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableIterable.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableIterable.utils.js.map +0 -1
- package/dist/components/organisms/Table/utilities/tableLoading.utils.cjs.map +0 -1
- package/dist/components/organisms/Table/utilities/tableLoading.utils.d.ts.map +0 -1
- package/dist/components/organisms/Table/utilities/tableLoading.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/hooks/useFocusHandOff/index.cjs.map +0 -1
- package/dist/hooks/useFocusHandOff/index.d.ts.map +0 -1
- package/dist/hooks/useFocusHandOff/index.js.map +0 -1
- /package/dist/components/organisms/{Table → Tables/Table}/Table.styles.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/Table.styles.js +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.js +0 -0
- /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/TableRowCard.d.ts +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/useBusyCount.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useBusyCount.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useBusyCount.js +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.js +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/Table}/utilities/tableSelection.utils.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.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
- /package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.js +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableIterable.utils.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableIterable.utils.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableIterable.utils.js +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.cjs +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.d.ts +0 -0
- /package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.js +0 -0
|
@@ -4,9 +4,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
5
|
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var controlFill_context = require('../../__internal__/controlFill/controlFill.context.cjs');
|
|
7
8
|
var FilterDropdownMenu = require('./components/FilterDropdownMenu.cjs');
|
|
9
|
+
var useFilterDraft = require('./hooks/useFilterDraft.cjs');
|
|
8
10
|
|
|
9
|
-
/** Root layout container for the filter bar
|
|
11
|
+
/** Root layout container for the filter bar: content and actions share a wrapping row from `md`, and take a row each below it. */
|
|
10
12
|
const FilterBarRoot = React.forwardRef(({ children, className, 'data-testid': dataTestId, ...props }, ref) => {
|
|
11
13
|
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'filter-bar', rootName: 'filter-bar' });
|
|
12
14
|
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx("div", { ...props, ref: ref, "data-testid": rootTestId, "data-pagination-scroll-lead": "",
|
|
@@ -14,20 +16,29 @@ const FilterBarRoot = React.forwardRef(({ children, className, 'data-testid': da
|
|
|
14
16
|
className: cx.cx('flex scroll-mt-4 flex-wrap items-end gap-3', className), children: children }) }));
|
|
15
17
|
});
|
|
16
18
|
FilterBarRoot.displayName = 'FilterBar.Root';
|
|
17
|
-
/**
|
|
19
|
+
/** Content area of the filter bar: from `md` it grows to fill the row beside the actions; below `md` it takes the first row, or none when empty. */
|
|
18
20
|
const FilterBarContent = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
19
21
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
20
22
|
const contentTestId = prefix ? testIdUtils.joinTestId(prefix, 'content') : undefined;
|
|
21
|
-
return (jsxRuntime.jsx("div", { ...props, ref: ref, "data-testid": contentTestId,
|
|
23
|
+
return (jsxRuntime.jsx("div", { ...props, ref: ref, "data-testid": contentTestId,
|
|
24
|
+
// The first row to itself below `md`; with nothing in it, no row at all.
|
|
25
|
+
className: cx.cx('flex min-w-0 flex-1 flex-wrap items-end gap-3 max-md:basis-full max-md:empty:hidden', className), children: children }));
|
|
22
26
|
});
|
|
23
27
|
FilterBarContent.displayName = 'FilterBar.Content';
|
|
24
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Actions area of the filter bar: beside the content from `md`, shrinking to fit; below `md` the full row after it, where labelled
|
|
30
|
+
* controls share the width, two to a row, and icon-only buttons keep their size at its end.
|
|
31
|
+
*/
|
|
25
32
|
const FilterBarActions = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
26
33
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
27
34
|
const actionsTestId = prefix ? testIdUtils.joinTestId(prefix, 'actions') : undefined;
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
return (jsxRuntime.jsx(controlFill_context.ControlFillContext.Provider, { value: true, children: jsxRuntime.jsx("div", { ...props, ref: ref, "data-testid": actionsTestId, className: cx.cx(
|
|
36
|
+
// Wraps in the bar, as a date picker beside Filters outgrows a 320px phone; below `md` an icons-only row keeps them at its end, as from `md` up.
|
|
37
|
+
'flex max-w-full shrink-0 flex-wrap items-center gap-3 max-md:w-full max-md:justify-end',
|
|
38
|
+
// Below `md` each control but an icon button takes at least half the row less an icon's room: two and an icon share it, a third wraps.
|
|
39
|
+
'max-md:[:where(&>:not([data-icon-only]))]:min-w-0 max-md:[:where(&>:not([data-icon-only]))]:flex-[1_1_calc(50%-2rem)]',
|
|
40
|
+
// `:where` adds no specificity, so a control's own `className` still overrides its share.
|
|
41
|
+
'max-md:[:where(&>:not([data-icon-only])>[data-text])]:min-w-0 max-md:[:where(&>:not([data-icon-only])>[data-text])]:truncate', className), children: children }) }));
|
|
31
42
|
});
|
|
32
43
|
FilterBarActions.displayName = 'FilterBar.Actions';
|
|
33
44
|
/**
|
|
@@ -43,5 +54,6 @@ const FilterBar = {
|
|
|
43
54
|
};
|
|
44
55
|
|
|
45
56
|
exports.FilterDropdown = FilterDropdownMenu.FilterDropdown;
|
|
57
|
+
exports.useFilterDraft = useFilterDraft.useFilterDraft;
|
|
46
58
|
exports.FilterBar = FilterBar;
|
|
47
59
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/FilterBar/index.tsx"],"sourcesContent":[null],"names":["forwardRef","useResolvedTestId","_jsx","TestIdProvider","cx","useTestIdPrefix","joinTestId"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/FilterBar/index.tsx"],"sourcesContent":[null],"names":["forwardRef","useResolvedTestId","_jsx","TestIdProvider","cx","useTestIdPrefix","joinTestId","ControlFillContext"],"mappings":";;;;;;;;;;AAqBA;AACA,MAAM,aAAa,GAAGA,gBAAU,CAAqC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACzI,IAAA,MAAM,UAAU,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AAE3G,IAAA,QACEC,cAAA,CAACC,0BAAc,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/BD,cAAA,CAAA,KAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,UAAU,iCAEK,EAAE;;AAE9B,YAAA,SAAS,EAAEE,KAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,EAAA,QAAA,EAErE,QAAQ,EAAA,CACL,EAAA,CACS;AAErB,CAAC,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,gBAAgB;AAO5C;AACA,MAAM,gBAAgB,GAAGJ,gBAAU,CAAwC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KA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ropdownProps } from './components/FilterDropdownMenu';
|
|
3
|
+
export { type FilterDraftDropdownProps, type FilterDraftState, type UseFilterDraftOptions, useFilterDraft } from './hooks/useFilterDraft';
|
|
3
4
|
interface FilterBarRootProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
5
|
/** Content and actions for the filter bar */
|
|
5
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/FilterBar/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/FilterBar/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE1I,UAAU,kBAAmB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAClE,6CAA6C;IAC7C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwBD,UAAU,qBAAsB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrE,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAqBD,UAAU,qBAAsB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrE,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAiCD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;CAIrB,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
3
|
import { useResolvedTestId, TestIdProvider, useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
+
import { ControlFillContext } from '../../__internal__/controlFill/controlFill.context.js';
|
|
5
6
|
export { FilterDropdown } from './components/FilterDropdownMenu.js';
|
|
7
|
+
export { useFilterDraft } from './hooks/useFilterDraft.js';
|
|
6
8
|
|
|
7
|
-
/** Root layout container for the filter bar
|
|
9
|
+
/** Root layout container for the filter bar: content and actions share a wrapping row from `md`, and take a row each below it. */
|
|
8
10
|
const FilterBarRoot = forwardRef(({ children, className, 'data-testid': dataTestId, ...props }, ref) => {
|
|
9
11
|
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'filter-bar', rootName: 'filter-bar' });
|
|
10
12
|
return (jsx(TestIdProvider, { value: rootTestId, children: jsx("div", { ...props, ref: ref, "data-testid": rootTestId, "data-pagination-scroll-lead": "",
|
|
@@ -12,20 +14,29 @@ const FilterBarRoot = forwardRef(({ children, className, 'data-testid': dataTest
|
|
|
12
14
|
className: cx('flex scroll-mt-4 flex-wrap items-end gap-3', className), children: children }) }));
|
|
13
15
|
});
|
|
14
16
|
FilterBarRoot.displayName = 'FilterBar.Root';
|
|
15
|
-
/**
|
|
17
|
+
/** Content area of the filter bar: from `md` it grows to fill the row beside the actions; below `md` it takes the first row, or none when empty. */
|
|
16
18
|
const FilterBarContent = forwardRef(({ children, className, ...props }, ref) => {
|
|
17
19
|
const prefix = useTestIdPrefix();
|
|
18
20
|
const contentTestId = prefix ? joinTestId(prefix, 'content') : undefined;
|
|
19
|
-
return (jsx("div", { ...props, ref: ref, "data-testid": contentTestId,
|
|
21
|
+
return (jsx("div", { ...props, ref: ref, "data-testid": contentTestId,
|
|
22
|
+
// The first row to itself below `md`; with nothing in it, no row at all.
|
|
23
|
+
className: cx('flex min-w-0 flex-1 flex-wrap items-end gap-3 max-md:basis-full max-md:empty:hidden', className), children: children }));
|
|
20
24
|
});
|
|
21
25
|
FilterBarContent.displayName = 'FilterBar.Content';
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Actions area of the filter bar: beside the content from `md`, shrinking to fit; below `md` the full row after it, where labelled
|
|
28
|
+
* controls share the width, two to a row, and icon-only buttons keep their size at its end.
|
|
29
|
+
*/
|
|
23
30
|
const FilterBarActions = forwardRef(({ children, className, ...props }, ref) => {
|
|
24
31
|
const prefix = useTestIdPrefix();
|
|
25
32
|
const actionsTestId = prefix ? joinTestId(prefix, 'actions') : undefined;
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
return (jsx(ControlFillContext.Provider, { value: true, children: jsx("div", { ...props, ref: ref, "data-testid": actionsTestId, className: cx(
|
|
34
|
+
// Wraps in the bar, as a date picker beside Filters outgrows a 320px phone; below `md` an icons-only row keeps them at its end, as from `md` up.
|
|
35
|
+
'flex max-w-full shrink-0 flex-wrap items-center gap-3 max-md:w-full max-md:justify-end',
|
|
36
|
+
// Below `md` each control but an icon button takes at least half the row less an icon's room: two and an icon share it, a third wraps.
|
|
37
|
+
'max-md:[:where(&>:not([data-icon-only]))]:min-w-0 max-md:[:where(&>:not([data-icon-only]))]:flex-[1_1_calc(50%-2rem)]',
|
|
38
|
+
// `:where` adds no specificity, so a control's own `className` still overrides its share.
|
|
39
|
+
'max-md:[:where(&>:not([data-icon-only])>[data-text])]:min-w-0 max-md:[:where(&>:not([data-icon-only])>[data-text])]:truncate', className), children: children }) }));
|
|
29
40
|
});
|
|
30
41
|
FilterBarActions.displayName = 'FilterBar.Actions';
|
|
31
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/FilterBar/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/FilterBar/index.t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,KAAK,EAAE,EAAE,GAAG,KAAI;AACpH,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAChC,IAAA,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS;IAExE,QACEA,IAAC,kBAAkB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,IAAI,EAAA,QAAA,EACtCA,gBACM,KAAK,EACT,GAAG,EAAE,GAAG,iBACK,aAAa,EAC1B,SAAS,EAAE,EAAE;;YAEX,wFAAwF;;YAExF,uHAAuH;;YAEvH,8HAA8H,EAC9H,SAAS,CACV,EAAA,QAAA,EAEA,QAAQ,EAAA,CACL,EAAA,CACsB;AAElC,CAAC,CAAC;AACF,gBAAgB,CAAC,WAAW,GAAG,mBAAmB;AAElD;;;;;AAKG;AACI,MAAM,SAAS,GAAG;AACvB,IAAA,IAAI,EAAE,aAAa;AACnB,IAAA,OAAO,EAAE,gBAAgB;AACzB,IAAA,OAAO,EAAE,gBAAgB;;;"}
|
|
@@ -8,12 +8,14 @@ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
|
8
8
|
var utils = require('@react-aria/utils');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var reactAriaComponents = require('react-aria-components');
|
|
11
|
+
var controlFill_context = require('../../__internal__/controlFill/controlFill.context.cjs');
|
|
11
12
|
var SlideoutShell = require('./components/SlideoutShell.cjs');
|
|
12
13
|
var PageArea_context = require('./providers/PageArea.context.cjs');
|
|
13
14
|
var SlideoutMenu_context = require('./providers/SlideoutMenu.context.cjs');
|
|
14
15
|
var slideoutMenu_utils = require('./utilities/slideoutMenu.utils.cjs');
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
// Context reaches through the portal: a form in the panel keeps its controls' own size, wherever the panel opened from.
|
|
18
|
+
const Menu = (props) => (jsxRuntime.jsx(controlFill_context.ControlFillContext.Provider, { value: false, children: jsxRuntime.jsx(SlideoutShell.SlideoutShell, { ...props }) }));
|
|
17
19
|
Menu.displayName = 'SlideoutMenu';
|
|
18
20
|
const Content = React.forwardRef(({ 'data-testid': dataTestId, ...props }, ref) => {
|
|
19
21
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","SlideoutShell","forwardRef","useTestIdPrefix","joinTestId","cx","useContext","SlideoutMenuContext","useRef","useObjectRef","useLayoutEffect","_jsxs","IconButton","ArrowUpRight","CloseButton","PageAreaContext","AriaDialogTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","ControlFillContext","SlideoutShell","forwardRef","useTestIdPrefix","joinTestId","cx","useContext","SlideoutMenuContext","useRef","useObjectRef","useLayoutEffect","_jsxs","IconButton","ArrowUpRight","CloseButton","PageAreaContext","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;;;;AAuDA;AACA,MAAM,IAAI,GAAG,CAAC,KAAwB,MACpCA,cAAA,CAACC,sCAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EACvCD,cAAA,CAACE,2BAAa,OAAK,KAAK,EAAA,CAAI,EAAA,CACA,CAC/B;AACD,IAAI,CAAC,WAAW,GAAG,cAAc;AAEjC,MAAM,OAAO,GAAGC,gBAAU,CACxB,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC/C,IAAA,MAAM,MAAM,GAAGC,2BAAe,EAAE;IAChC,MAAM,aAAa,GAAG,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;;IAGxF,QACEL,2BACM,KAAK,EACT,GAAG,EAAE,GAAG,iBACK,aAAa;;QAE1B,SAAS,EAAE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EAAyB,KAAKN,eAACgB,gCAAe,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,QAAA,EAAG,QAAQ,EAAA,CAA4B;AAClJ,QAAQ,CAAC,WAAW,GAAG,kBAAkB;AAEzC;;;;;;AAMG;AACH,MAAM,YAAY,GAAG;AAOrB,YAAY,CAAC,WAAW,GAAG,cAAc;AAEzC,YAAY,CAAC,OAAO,GAAGC,iCAAiB;AACxC,YAAY,CAAC,OAAO,GAAG,OAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,QAAQ,GAAG,QAAQ;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAItE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC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AACnK,QAAA,MAAM,MAAM;oBAAkF,MAAM;kDAqBnG,CAAC;AAGF,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACvC,wGAAwG;IACxG,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,yHAAyH;AACzH,QAAA,MAAM,QAAQ;4BAA2B,qBAAqB;;CAAoF,CAAC;AAGnJ;;;;;;GAMG;AACH,QAAA,MAAM,YAAY,EAAW,OAAO,IAAI,GAAG;IACzC,OAAO,EAAE,OAAO,iBAAiB,CAAC;IAClC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAC3B,CAAC;AASF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -6,12 +6,14 @@ import { useTestIdPrefix, joinTestId } from '@flipdish/ui-library/utilities/test
|
|
|
6
6
|
import { useObjectRef } from '@react-aria/utils';
|
|
7
7
|
import { forwardRef, useContext, useRef, useLayoutEffect } from 'react';
|
|
8
8
|
import { DialogTrigger } from 'react-aria-components';
|
|
9
|
+
import { ControlFillContext } from '../../__internal__/controlFill/controlFill.context.js';
|
|
9
10
|
import { SlideoutShell } from './components/SlideoutShell.js';
|
|
10
11
|
import { PageAreaContext } from './providers/PageArea.context.js';
|
|
11
12
|
import { SlideoutMenuContext } from './providers/SlideoutMenu.context.js';
|
|
12
13
|
export { APP_HEADER_HEIGHT_VAR, APP_SIDEBAR_WIDTH_VAR, APP_SIDE_PANEL_WIDTH_VAR } from './utilities/slideoutMenu.utils.js';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
// Context reaches through the portal: a form in the panel keeps its controls' own size, wherever the panel opened from.
|
|
16
|
+
const Menu = (props) => (jsx(ControlFillContext.Provider, { value: false, children: jsx(SlideoutShell, { ...props }) }));
|
|
15
17
|
Menu.displayName = 'SlideoutMenu';
|
|
16
18
|
const Content = forwardRef(({ 'data-testid': dataTestId, ...props }, ref) => {
|
|
17
19
|
const prefix = useTestIdPrefix();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDialogTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;;AAuDA;AACA,MAAM,IAAI,GAAG,CAAC,KAAwB,MACpCA,GAAA,CAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EACvCA,GAAA,CAAC,aAAa,OAAK,KAAK,EAAA,CAAI,EAAA,CACA,CAC/B;AACD,IAAI,CAAC,WAAW,GAAG,cAAc;AAEjC,MAAM,OAAO,GAAG,UAAU,CACxB,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC/C,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;IAChC,MAAM,aAAa,GAAG,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;;IAGxF,QACEA,gBACM,KAAK,EACT,GAAG,EAAE,GAAG,iBACK,aAAa;;QAE1B,SAAS,EAAE,EAAE,CAAC,+FAA+F,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA,CAC/H;AAEN,CAAC,CACF;AACD,OAAO,CAAC,WAAW,GAAG,iBAAiB;AAiBvC,MAAM,MAAM,GAAG,UAAU,CACvB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,GAAG,gBAAgB,EAAE,WAAW,EAAE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AC9B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,MAAM,GAAG,MAAM;AAC5B,YAAY,CAAC,QAAQ,GAAG,QAAQ;;"}
|
|
@@ -1,293 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var uiIcons = require('@flipdish/ui-icons');
|
|
5
|
-
var Badges = require('@flipdish/ui-library/components/atoms/Badges');
|
|
6
|
-
var Checkboxes = require('@flipdish/ui-library/components/atoms/Checkboxes');
|
|
7
|
-
var Skeleton = require('@flipdish/ui-library/components/atoms/Skeleton');
|
|
8
|
-
var Tooltip = require('@flipdish/ui-library/components/atoms/Tooltip');
|
|
9
|
-
var Dropdown = require('@flipdish/ui-library/components/molecules/Dropdown');
|
|
10
|
-
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
11
|
-
var renderUtils = require('@flipdish/ui-library/utilities/renderUtils');
|
|
12
|
-
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
13
|
-
var React = require('react');
|
|
14
|
-
var reactAriaComponents = require('react-aria-components');
|
|
15
|
-
var log_utils = require('../../../utilities/__internal__/logUtils/log.utils.cjs');
|
|
16
|
-
var TableCardList = require('./components/TableCardList.cjs');
|
|
17
|
-
var TableCardRow = require('./components/TableCardRow.cjs');
|
|
18
|
-
var TableCardsSelectAll = require('./components/TableCardsSelectAll.cjs');
|
|
19
|
-
var TableLayoutToggle = require('./components/TableLayoutToggle.cjs');
|
|
20
|
-
var TableRowCard = require('./components/TableRowCard.cjs');
|
|
21
|
-
var TableSortIcon = require('./components/TableSortIcon.cjs');
|
|
22
|
-
var TableSortMenu = require('./components/TableSortMenu.cjs');
|
|
23
|
-
var useBusyCount = require('./hooks/useBusyCount.cjs');
|
|
24
|
-
var useFirstSortDirection = require('./hooks/useFirstSortDirection.cjs');
|
|
25
|
-
var useIsAtLeastMd = require('./hooks/useIsAtLeastMd.cjs');
|
|
26
|
-
var useIsPlaceholderPage = require('./hooks/useIsPlaceholderPage.cjs');
|
|
27
|
-
var usePlaceholderRows = require('./hooks/usePlaceholderRows.cjs');
|
|
28
|
-
var useSelectableRowRegistry = require('./hooks/useSelectableRowRegistry.cjs');
|
|
29
|
-
var useTableSelection = require('./hooks/useTableSelection.cjs');
|
|
30
|
-
var Table_context = require('./providers/Table.context.cjs');
|
|
31
|
-
var Table_styles = require('./Table.styles.cjs');
|
|
32
|
-
var tableCard_utils = require('./utilities/tableCard.utils.cjs');
|
|
33
|
-
var tableChildren_utils = require('./utilities/tableChildren.utils.cjs');
|
|
34
|
-
var tableIterable_utils = require('./utilities/tableIterable.utils.cjs');
|
|
35
|
-
var tableLoading_utils = require('./utilities/tableLoading.utils.cjs');
|
|
36
|
-
var tableSort_utils = require('./utilities/tableSort.utils.cjs');
|
|
3
|
+
var Tables = require('@flipdish/ui-library/components/organisms/Tables');
|
|
37
4
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const { layout } = React.useContext(Table_context.TableCardLayoutContext);
|
|
50
|
-
const renderBadge = () => {
|
|
51
|
-
if (!badge)
|
|
52
|
-
return null;
|
|
53
|
-
if (React.isValidElement(badge))
|
|
54
|
-
return badge;
|
|
55
|
-
return (jsxRuntime.jsx(Badges.Badge, { color: "gray", size: "sm", type: "modern", children: badge }));
|
|
56
|
-
};
|
|
57
|
-
return (jsxRuntime.jsxs("div", { className: cx.cx('relative flex flex-col items-start gap-4 md:flex-row',
|
|
58
|
-
// Above cards the header is a plain heading row: the card it would divide from has no surface.
|
|
59
|
-
layout !== 'cards' && 'border-b border-secondary bg-primary px-4', layout !== 'cards' && (size === 'sm' ? 'py-4 md:px-5' : 'py-5 md:px-6'), className), children: [jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-0.5", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("h2", { className: "text-md font-semibold text-primary", children: title }), renderBadge()] }), description && jsxRuntime.jsx("p", { className: "text-sm text-tertiary", children: description })] }), contentTrailing] }));
|
|
60
|
-
};
|
|
61
|
-
// What a table's descendants see in place of its `TableCard.Root`: one nested in a row card or a cell has no card of its own to report to.
|
|
62
|
-
const DETACHED_CARD_LAYOUT = { layout: 'table' };
|
|
63
|
-
// The element types match react-aria's: inside a `Virtualizer` the table, its header, rows and cells render as `div`s.
|
|
64
|
-
const TableRoot = React.forwardRef(({ className, style, children, mobileLayout = 'cards', desktopLayout = 'table', size: sizeProp, selectedKey, selectedKeys, defaultSelectedKeys, onSelectionChange, onSelectedKeyChange, onSelectedKeysChange, onSortChange, defaultSortDescriptor, isLoading = false, loadingRowCount = 5, loadingRow, 'data-testid': dataTestId, ...props }, ref) => {
|
|
65
|
-
// Re-providing the context would otherwise reset a card-level `size` back to `md`.
|
|
66
|
-
const inherited = React.useContext(Table_context.TableContext);
|
|
67
|
-
const { setLayout, registerBusy } = React.useContext(Table_context.TableCardLayoutContext);
|
|
68
|
-
const size = sizeProp ?? inherited.size;
|
|
69
|
-
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'table', rootName: 'table' });
|
|
70
|
-
const registry = useSelectableRowRegistry.useSelectableRowRegistry();
|
|
71
|
-
const placeholders = usePlaceholderRows.usePlaceholderRows(props.onRowAction);
|
|
72
|
-
// Read by the table and by react-aria alike, so a one-shot iterator is read once and every reader gets the same keys.
|
|
73
|
-
const disabledKeys = tableIterable_utils.reusableIterableOf(props.disabledKeys);
|
|
74
|
-
const isPlaceholderPage = useIsPlaceholderPage.useIsPlaceholderPage(isLoading, registry, placeholders.registry, disabledKeys);
|
|
75
|
-
// Held here, above the layout switch: the table and the card list are different trees, and crossing `md` remounts the rows.
|
|
76
|
-
const selection = useTableSelection.useTableSelection({
|
|
77
|
-
selectedKey,
|
|
78
|
-
selectedKeys,
|
|
79
|
-
defaultSelectedKeys,
|
|
80
|
-
disabledKeys,
|
|
81
|
-
rowIds: registry.rowIds,
|
|
82
|
-
isPlaceholderPage,
|
|
83
|
-
onSelectionChange,
|
|
84
|
-
onSelectedKeyChange,
|
|
85
|
-
onSelectedKeysChange,
|
|
86
|
-
});
|
|
87
|
-
const isAtLeastMd = useIsAtLeastMd.useIsAtLeastMd();
|
|
88
|
-
// A `Virtualizer` hands its table layout to any collection inside it, and that layout cannot place cards.
|
|
89
|
-
const { isVirtualized } = React.useContext(reactAriaComponents.CollectionRendererContext);
|
|
90
|
-
const layout = tableCard_utils.tableLayoutOf(isAtLeastMd, mobileLayout, desktopLayout, isVirtualized);
|
|
91
|
-
// Before paint, so a `TableCard.Root` around cards never shows a frame of its surface.
|
|
92
|
-
React.useLayoutEffect(() => {
|
|
93
|
-
setLayout?.(layout);
|
|
94
|
-
return () => setLayout?.('table');
|
|
95
|
-
}, [layout, setLayout]);
|
|
96
|
-
React.useLayoutEffect(() => (isLoading ? registerBusy?.() : undefined), [isLoading, registerBusy]);
|
|
97
|
-
// With no card to report to, as alone or nested in a row card, the table marks itself busy.
|
|
98
|
-
const isOwnBusy = isLoading && registerBusy === undefined;
|
|
99
|
-
// Only the cards and the loading rows need the columns, and a column render function runs on every read.
|
|
100
|
-
const header = isLoading || layout === 'cards' ? tableChildren_utils.findElement(children, TableHeader) : undefined;
|
|
101
|
-
const columns = header ? tableChildren_utils.columnsOfHeader(header.props.children, header.props.columns) : [];
|
|
102
|
-
const loadingParts = isLoading ? tableLoading_utils.loadingRowPartsOf(loadingRow, columns, LOADING_ROW_DEFAULTS) : undefined;
|
|
103
|
-
const isMissingLoadingCells = loadingParts !== undefined && !tableLoading_utils.canDrawLoadingRows(layout, loadingParts.cells.length);
|
|
104
|
-
React.useEffect(() => {
|
|
105
|
-
if (!isMissingLoadingCells || renderUtils.isProductionBuild())
|
|
106
|
-
return;
|
|
107
|
-
log_utils.warnOnce('Table:loading-no-columns', 'Table: `isLoading` found no columns to give its loading rows cells, so the table shows none: `Table` reads columns only from a `Table.Header` among its direct children. Render `Table.Header` directly inside `Table`, or pass `loadingRow` with a `Table.Cell` per column.');
|
|
108
|
-
}, [isMissingLoadingCells]);
|
|
109
|
-
// react-aria only toggles a sorted column; the press that would toggle it back to its first direction clears it instead.
|
|
110
|
-
const firstSortDirection = useFirstSortDirection.useFirstSortDirection(props.sortDescriptor, defaultSortDescriptor);
|
|
111
|
-
const handleSortChange = onSortChange &&
|
|
112
|
-
((next) => onSortChange(tableSort_utils.sortStepOf(props.sortDescriptor, next, firstSortDirection) === 'clear' ? defaultSortDescriptor : next));
|
|
113
|
-
// A row cannot see the table-level `onRowAction`, so the context carries whether one exists.
|
|
114
|
-
const context = {
|
|
115
|
-
size,
|
|
116
|
-
layout,
|
|
117
|
-
testIdPrefix: rootTestId,
|
|
118
|
-
hasRowAction: props.onRowAction !== undefined,
|
|
119
|
-
registerRow: registry.register,
|
|
120
|
-
isPlaceholderPage,
|
|
121
|
-
registerPlaceholder: placeholders.register,
|
|
122
|
-
// React-aria throws on a table row with no cells, so with none to give the table draws no loading rows; see the warning.
|
|
123
|
-
loadingRows: loadingParts && renderLoadingRows(isMissingLoadingCells ? 0 : loadingRowCount, loadingParts),
|
|
124
|
-
};
|
|
125
|
-
if (layout === 'cards') {
|
|
126
|
-
const { selectionMode = 'none', selectionBehavior = 'toggle' } = props;
|
|
127
|
-
// Cards have no column headers to sort from, and dragging is untested on them; react-aria filters the rest as it does for the table.
|
|
128
|
-
const { dragAndDropHooks, sortDescriptor, onRowAction, render: _tableRender, ...sharedProps } = props;
|
|
129
|
-
const listProps = {
|
|
130
|
-
...tableCard_utils.cardListPropsOf(sharedProps),
|
|
131
|
-
disabledKeys,
|
|
132
|
-
selectedKeys: selection.selectedKeys,
|
|
133
|
-
onSelectionChange: selection.onSelectionChange,
|
|
134
|
-
onAction: placeholders.onAction,
|
|
135
|
-
// From `md` the cards sit in columns, so the arrow keys move across them as well as down.
|
|
136
|
-
layout: isAtLeastMd ? 'grid' : 'stack',
|
|
137
|
-
'data-testid': testIdUtils.joinTestId(rootTestId, 'list'),
|
|
138
|
-
};
|
|
139
|
-
const cardContext = { ...context, columns, listProps };
|
|
140
|
-
return (jsxRuntime.jsx(Table_context.TableCardLayoutContext.Provider, { value: DETACHED_CARD_LAYOUT, children: jsxRuntime.jsx(Table_context.TableRowCardContext.Provider, { value: null, children: jsxRuntime.jsx(Table_context.TableRowCardSurfaceContext.Provider, { value: false, children: jsxRuntime.jsx(Table_context.TableRowCardHeaderCheckboxContext.Provider, { value: false, children: jsxRuntime.jsx(Table_context.TableContext.Provider, { value: cardContext, children: jsxRuntime.jsxs("div", { ref: ref, "data-testid": rootTestId, "aria-busy": isOwnBusy || undefined, className: "@container flex flex-col gap-4", children: [selectionMode === 'multiple' && selectionBehavior === 'toggle' && (jsxRuntime.jsx(TableCardsSelectAll.TableCardsSelectAll, { registry: registry, selectedKeys: selection.selectedKeys, onSelectionChange: selection.onSelectionChange, disabledKeys: disabledKeys, isPlaceholderPage: isPlaceholderPage, disallowEmptySelection: props.disallowEmptySelection, "data-testid": testIdUtils.joinTestId(rootTestId, 'select-all') })), children] }) }) }) }) }) }));
|
|
141
|
-
}
|
|
142
|
-
return (jsxRuntime.jsx(Table_context.TableCardLayoutContext.Provider, { value: DETACHED_CARD_LAYOUT, children: jsxRuntime.jsx(Table_context.TableContext.Provider, { value: context, children: jsxRuntime.jsx("div", { className: "overflow-x-auto", "aria-busy": isOwnBusy || undefined, children: jsxRuntime.jsx(reactAriaComponents.Table, { "data-testid": rootTestId, className: (state) => cx.cx('w-full overflow-x-hidden', typeof className === 'function' ? className(state) : className), style: style, ...props, ref: ref, disabledKeys: disabledKeys, selectedKeys: selection.selectedKeys, onSelectionChange: selection.onSelectionChange, onSortChange: handleSortChange, onRowAction: placeholders.onAction, children: children }) }) }) }));
|
|
143
|
-
});
|
|
144
|
-
TableRoot.displayName = 'Table';
|
|
145
|
-
// On a page of placeholders, as while loading, react-aria's own select all stays on and would store `'all'` for the rows that load next.
|
|
146
|
-
const NO_ROW_TO_SELECT = { isDisabled: true, isSelected: false, isIndeterminate: false };
|
|
147
|
-
const TableGridHeaderBase = ({ columns, children, bordered = true, className, size: sizeProp, ...props }, ref) => {
|
|
148
|
-
const context = React.useContext(Table_context.TableContext);
|
|
149
|
-
const { selectionBehavior, selectionMode } = reactAriaComponents.useTableOptions();
|
|
150
|
-
const size = sizeProp ?? context.size;
|
|
151
|
-
return (jsxRuntime.jsxs(reactAriaComponents.TableHeader, { ...props, ref: ref, className: (state) => cx.cx('relative bg-secondary', size === 'sm' ? 'h-9' : 'h-11',
|
|
152
|
-
// Row border—using an "after" pseudo-element to avoid the border taking up space.
|
|
153
|
-
bordered &&
|
|
154
|
-
'[&>tr>th]:after:pointer-events-none [&>tr>th]:after:absolute [&>tr>th]:after:inset-x-0 [&>tr>th]:after:bottom-0 [&>tr>th]:after:h-px [&>tr>th]:after:bg-border-secondary [&>tr>th]:focus-visible:after:bg-transparent', typeof className === 'function' ? className(state) : className), children: [selectionBehavior === 'toggle' && (jsxRuntime.jsx(reactAriaComponents.Column, { className: cx.cx('relative py-2 pr-0 pl-4', size === 'sm' ? 'w-9 md:pl-5' : 'w-11 md:pl-6'), children: selectionMode === 'multiple' && (jsxRuntime.jsx("div", { className: "flex items-start", children: jsxRuntime.jsx(Checkboxes.Checkbox, { slot: "selection", size: "md", ...(context.isPlaceholderPage ? NO_ROW_TO_SELECT : {}) }) })) })), jsxRuntime.jsx(reactAriaComponents.Collection, { items: tableIterable_utils.reusableIterableOf(columns), children: children })] }));
|
|
155
|
-
};
|
|
156
|
-
// `forwardRef` drops the type parameter that ties `columns` to the item a render function gets; the cast restores it.
|
|
157
|
-
const TableGridHeader = React.forwardRef(TableGridHeaderBase);
|
|
158
|
-
// Cards have no header row: the fallback card reads the columns from this element's props, and no sort control renders.
|
|
159
|
-
const TableHeaderBase = (props, ref) => {
|
|
160
|
-
const { layout } = React.useContext(Table_context.TableContext);
|
|
161
|
-
return layout === 'cards' ? null : jsxRuntime.jsx(TableGridHeader, { ...props, ref: ref });
|
|
162
|
-
};
|
|
163
|
-
/** The row of column headers: one `Table.Head` per column, and select all with multiple selection; nothing in the cards layout. */
|
|
164
|
-
const TableHeader = React.forwardRef(TableHeaderBase);
|
|
165
|
-
TableHeader.displayName = 'TableHeader';
|
|
166
|
-
/** One column header, with an optional `label`, help `tooltip` and sort arrow; its `id` keys the column. */
|
|
167
|
-
const TableHead = ({ className, tooltip, label, children, 'data-testid': dataTestId, ...props }) => {
|
|
168
|
-
const { selectionBehavior } = reactAriaComponents.useTableOptions();
|
|
169
|
-
const { testIdPrefix } = React.useContext(Table_context.TableContext);
|
|
170
|
-
const colTestId = dataTestId ?? (testIdPrefix && props.id !== undefined ? testIdUtils.joinTestId(testIdPrefix, `col-${testIdUtils.slugifyTestId(String(props.id))}`) : undefined);
|
|
171
|
-
return (jsxRuntime.jsx(reactAriaComponents.Column, { ...props, "data-testid": colTestId, className: (state) => cx.cx('relative p-0 px-6 py-2 outline-hidden focus-visible:z-1 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-bg-primary focus-visible:ring-inset', selectionBehavior === 'toggle' && 'nth-2:pl-3', state.allowsSorting && 'cursor-pointer', typeof className === 'function' ? className(state) : className), children: (state) => (jsxRuntime.jsxs(reactAriaComponents.Group, { className: "flex items-center gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [label && jsxRuntime.jsx("span", { className: "text-xs font-semibold whitespace-nowrap text-quaternary", children: label }), typeof children === 'function' ? children(state) : children] }), tooltip && (jsxRuntime.jsx(Tooltip.Tooltip, { title: tooltip, placement: "top", children: jsxRuntime.jsx(Tooltip.TooltipTrigger, { "aria-label": tooltip, className: "cursor-pointer text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover", children: jsxRuntime.jsx(uiIcons.HelpCircle, { className: "size-4" }) }) })), state.allowsSorting && jsxRuntime.jsx(TableSortIcon.TableSortIcon, { sortDirection: state.sortDirection })] })) }));
|
|
172
|
-
};
|
|
173
|
-
TableHead.displayName = 'TableHead';
|
|
174
|
-
// The selected row: a brand tint (`_alt`, as `bg-brand-primary` is solid brand-500 in dark) and a 4px brand bar on its first cell.
|
|
175
|
-
const HIGHLIGHTED_ROW_CLASSNAME = "bg-brand-primary_alt hover:bg-brand-primary_alt [&>td:first-child]:before:absolute [&>td:first-child]:before:inset-y-0 [&>td:first-child]:before:left-0 [&>td:first-child]:before:w-1 [&>td:first-child]:before:bg-brand-solid [&>td:first-child]:before:content-['']";
|
|
176
|
-
const TableGridRowBase = ({ columns, children, className, highlightSelectedRow = true, isHighlighted = false, color, size: sizeProp, 'data-testid': dataTestId, ...props }, ref) => {
|
|
177
|
-
const context = React.useContext(Table_context.TableContext);
|
|
178
|
-
const { selectionBehavior, selectionMode } = reactAriaComponents.useTableOptions();
|
|
179
|
-
const size = sizeProp ?? context.size;
|
|
180
|
-
const rowTestId = tableCard_utils.rowTestIdOf(context.testIdPrefix, props.id, dataTestId);
|
|
181
|
-
// Function children render their own cells, and a skeleton only counts as a direct child, so only nodes are split.
|
|
182
|
-
const rowChildren = typeof children === 'function' ? undefined : tableChildren_utils.splitRowChildren(children, columns, TableRowCard.isRowCardElement);
|
|
183
|
-
// A row carrying `Table.RowCard.Skeleton` is a placeholder here too: nothing to press, select or count in select all.
|
|
184
|
-
const isPlaceholder = rowChildren?.card?.type === TableRowCard.TableRowCardSkeleton;
|
|
185
|
-
// A click does something on the row itself: its own action or link, the table's row action, or selection by row.
|
|
186
|
-
const isInteractive = !isPlaceholder && (props.onAction !== undefined || props.href !== undefined || context.hasRowAction === true || selectionMode !== 'none');
|
|
187
|
-
const { id, isDisabled } = props;
|
|
188
|
-
useSelectableRowRegistry.useRegisterSelectableRow(context.registerRow, id, isDisabled || isPlaceholder);
|
|
189
|
-
usePlaceholderRows.useRegisterPlaceholderRow(context.registerPlaceholder, id, isPlaceholder);
|
|
190
|
-
return (jsxRuntime.jsxs(reactAriaComponents.Row, { ...props, ref: ref, isDisabled: isDisabled || isPlaceholder, onAction: isPlaceholder ? undefined : props.onAction, href: isPlaceholder ? undefined : props.href, "data-testid": rowTestId, "data-highlighted": isHighlighted || undefined, className: (state) => cx.cx('relative outline-focus-ring transition-colors after:pointer-events-none hover:bg-secondary focus-visible:outline-2 focus-visible:-outline-offset-2', size === 'sm' ? 'h-14' : 'h-18',
|
|
191
|
-
// Before the highlight, which replaces it; hover keeps its neutral surface over it.
|
|
192
|
-
color && !isPlaceholder && Table_styles.styles.rowColors[color], ((highlightSelectedRow && state.isSelected) || isHighlighted) && HIGHLIGHTED_ROW_CLASSNAME, isInteractive && (state.isDisabled ? 'cursor-default' : 'cursor-pointer'),
|
|
193
|
-
// Row border—using an "after" pseudo-element to avoid the border taking up space.
|
|
194
|
-
'[&>td]:after:absolute [&>td]:after:inset-x-0 [&>td]:after:bottom-0 [&>td]:after:h-px [&>td]:after:w-full [&>td]:after:bg-border-secondary last:[&>td]:after:hidden [&>td]:focus-visible:after:opacity-0 focus-visible:[&>td]:after:opacity-0', typeof className === 'function' ? className(state) : className), children: [selectionBehavior === 'toggle' && (jsxRuntime.jsx(reactAriaComponents.Cell, { className: cx.cx('relative py-2 pr-0 pl-4', size === 'sm' ? 'md:pl-5' : 'md:pl-6'), children: jsxRuntime.jsx("div", { className: "flex items-end", children: jsxRuntime.jsx(Checkboxes.Checkbox, { slot: "selection", size: "md", "data-testid": rowTestId ? testIdUtils.joinTestId(rowTestId, 'selection') : undefined }) }) })), jsxRuntime.jsx(reactAriaComponents.Collection, { items: tableIterable_utils.reusableIterableOf(columns), children: rowChildren ? rowChildren.cells : children })] }));
|
|
195
|
-
};
|
|
196
|
-
// As for `TableHeader`: the cast restores the type parameter `forwardRef` drops.
|
|
197
|
-
const TableGridRow = React.forwardRef(TableGridRowBase);
|
|
198
|
-
// The row reads its layout from the table, which asks the viewport once for every row.
|
|
199
|
-
const TableRowBase = (props, ref) => {
|
|
200
|
-
const { layout } = React.useContext(Table_context.TableContext);
|
|
201
|
-
return layout === 'cards' ? jsxRuntime.jsx(TableCardRow.TableCardRow, { ...props, ref: ref }) : jsxRuntime.jsx(TableGridRow, { ...props, ref: ref });
|
|
202
|
-
};
|
|
203
|
-
/** One row of cells, or its `Table.RowCard` in the cards layout; give it an `id` for selection and its test id. */
|
|
204
|
-
const TableRow = React.forwardRef(TableRowBase);
|
|
205
|
-
TableRow.displayName = 'TableRow';
|
|
206
|
-
const TableGridCell = React.forwardRef(({ className, children, size: sizeProp, ...props }, ref) => {
|
|
207
|
-
const context = React.useContext(Table_context.TableContext);
|
|
208
|
-
const { selectionBehavior } = reactAriaComponents.useTableOptions();
|
|
209
|
-
const size = sizeProp ?? context.size;
|
|
210
|
-
return (jsxRuntime.jsx(reactAriaComponents.Cell, { ...props, ref: ref, className: (state) => cx.cx('relative text-sm text-tertiary outline-focus-ring focus-visible:z-1 focus-visible:outline-2 focus-visible:-outline-offset-2', size === 'sm' && 'px-5 py-3', size === 'md' && 'px-6 py-4', selectionBehavior === 'toggle' && 'nth-2:pl-3', typeof className === 'function' ? className(state) : className), children: children }));
|
|
211
|
-
});
|
|
212
|
-
// Every state off: a card is not a grid of cells, so nothing in it is a focused, hovered or selected cell.
|
|
213
|
-
const CARD_CELL_STATE = {
|
|
214
|
-
isPressed: false,
|
|
215
|
-
isFocused: false,
|
|
216
|
-
isFocusVisible: false,
|
|
217
|
-
isHovered: false,
|
|
218
|
-
isSelected: false,
|
|
219
|
-
isDisabled: false,
|
|
220
|
-
isFocusVisibleWithinRow: false,
|
|
221
|
-
isTreeColumn: false,
|
|
222
|
-
isExpanded: false,
|
|
223
|
-
hasChildItems: false,
|
|
224
|
-
level: 1,
|
|
225
|
-
defaultChildren: undefined,
|
|
226
|
-
};
|
|
227
|
-
// In a card a cell is its content: its padding, `className` and span are written for the table.
|
|
228
|
-
const TableCardCell = ({ children, className, style, colSpan, size, textValue, id, render: _tableCellRender, ...props }) => {
|
|
229
|
-
const content = typeof children === 'function' ? children(CARD_CELL_STATE) : children;
|
|
230
|
-
// What react-aria puts on the table's cell, such as `onClick` and `data-testid`; a click bubbles on to the card's row as to the table's.
|
|
231
|
-
const cellProps = tableCard_utils.cardCellPropsOf(props);
|
|
232
|
-
if (Object.keys(cellProps).length === 0)
|
|
233
|
-
return content;
|
|
234
|
-
return (jsxRuntime.jsx("div", { className: "contents", ...cellProps, children: content }));
|
|
235
|
-
};
|
|
236
|
-
/** One cell of a row; in the cards layout only the fallback card shows it: its content, with its `data-*` and handlers. */
|
|
237
|
-
const TableCell = React.forwardRef((props, ref) => {
|
|
238
|
-
const { layout } = React.useContext(Table_context.TableContext);
|
|
239
|
-
return layout === 'cards' ? jsxRuntime.jsx(TableCardCell, { ...props }) : jsxRuntime.jsx(TableGridCell, { ...props, ref: ref });
|
|
240
|
-
});
|
|
241
|
-
TableCell.displayName = 'TableCell';
|
|
242
|
-
// What a loading row draws for a part its `loadingRow` leaves out: a bar of about a line of text, which fits both sizes.
|
|
243
|
-
const LOADING_ROW_DEFAULTS = {
|
|
244
|
-
isCard: TableRowCard.isRowCardElement,
|
|
245
|
-
isSkeletonCard: (element) => element.type === TableRowCard.TableRowCardSkeleton,
|
|
246
|
-
// As wide as its column up to 96px, so a narrow column such as a row's actions stays narrow. The row-header cell names
|
|
247
|
-
// the row "Loading", as a loading card is named, so it is no empty `rowheader`.
|
|
248
|
-
cellOf: (column, isRowHeader) => (jsxRuntime.jsxs(TableCell, { children: [jsxRuntime.jsx(Skeleton.Skeleton, { width: "100%", height: 14, radius: "sm", className: "max-w-24" }), isRowHeader && jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })] }, column)),
|
|
249
|
-
card: jsxRuntime.jsx(TableRowCard.TableRowCardSkeleton, {}),
|
|
250
|
-
};
|
|
251
|
-
// Placeholders in both layouts, as a row carrying `Table.RowCard.Skeleton` is: nothing to press, select or count in select all.
|
|
252
|
-
const renderLoadingRows = (count, { cells, card }) => tableLoading_utils.loadingRowIdsOf(count).map((id) => (jsxRuntime.jsxs(TableRow, { id: id, children: [cells, card] }, id)));
|
|
253
|
-
const TableBodyBase = (props, ref) => {
|
|
254
|
-
const { layout, loadingRows } = React.useContext(Table_context.TableContext);
|
|
255
|
-
// A one-shot `items` is read once, so the card list still gets the rows after the table had them, as crossing `md` does.
|
|
256
|
-
const bodyProps = tableLoading_utils.loadingBodyPropsOf({ ...props, items: tableIterable_utils.reusableIterableOf(props.items) }, loadingRows);
|
|
257
|
-
return layout === 'cards' ? (jsxRuntime.jsx(TableCardList.TableCardList, { ...bodyProps, ref: ref })) : (jsxRuntime.jsx(reactAriaComponents.TableBody, { ...bodyProps, ref: ref }));
|
|
258
|
-
};
|
|
259
|
-
// As for `TableHeader`: the cast restores the type parameter `forwardRef` drops.
|
|
260
|
-
/** The table's rows, with `renderEmptyState` for when there are none; while the table `isLoading`, its loading rows instead; in the cards layout, the one `grid` that holds every card. */
|
|
261
|
-
const TableBody = React.forwardRef(TableBodyBase);
|
|
262
|
-
TableBody.displayName = 'TableBody';
|
|
263
|
-
const TableCard = {
|
|
264
|
-
Root: TableCardRoot,
|
|
265
|
-
Header: TableCardHeader,
|
|
266
|
-
};
|
|
267
|
-
/** The card a `Table.Row` shows in the cards layout, built from its `Header`, `Content` and `Footer`, or its `Skeleton` while loading. */
|
|
268
|
-
const TableRowCardCompound = TableRowCard.TableRowCard;
|
|
269
|
-
TableRowCardCompound.Header = TableRowCard.TableRowCardHeader;
|
|
270
|
-
TableRowCardCompound.Content = TableRowCard.TableRowCardContent;
|
|
271
|
-
TableRowCardCompound.Footer = TableRowCard.TableRowCardFooter;
|
|
272
|
-
TableRowCardCompound.Skeleton = TableRowCard.TableRowCardSkeleton;
|
|
273
|
-
/**
|
|
274
|
-
* Displays structured data in rows and columns with selection, sorting and keyboard navigation, or as one card per row:
|
|
275
|
-
* below `md` unless `mobileLayout` opts out, and from `md` when `desktopLayout` asks. Wrap it in `TableCard.Root`; on a page the title comes from
|
|
276
|
-
* `PageHeader` and search or filters from a `FilterBar` above the card.
|
|
277
|
-
*
|
|
278
|
-
* @summary data table with selection, sorting and cards on mobile
|
|
279
|
-
*/
|
|
280
|
-
const Table = TableRoot;
|
|
281
|
-
Table.Body = TableBody;
|
|
282
|
-
Table.RowCard = TableRowCardCompound;
|
|
283
|
-
Table.Cell = TableCell;
|
|
284
|
-
Table.Head = TableHead;
|
|
285
|
-
Table.Header = TableHeader;
|
|
286
|
-
Table.Row = TableRow;
|
|
5
|
+
// `typeof` keeps the compounds' members, and lets the declaration name props types `Tables` does not export.
|
|
6
|
+
/** @deprecated Import from `@flipdish/ui-library/components/organisms/Tables`. Removed in the next major. */
|
|
7
|
+
const Table = Tables.Table;
|
|
8
|
+
/** @deprecated Import from `@flipdish/ui-library/components/organisms/Tables`. Removed in the next major. */
|
|
9
|
+
const TableCard = Tables.TableCard;
|
|
10
|
+
/** @deprecated Import from `@flipdish/ui-library/components/organisms/Tables`. Removed in the next major. */
|
|
11
|
+
const TableRowActionsDropdown = Tables.TableRowActionsDropdown;
|
|
12
|
+
/** @deprecated Import from `@flipdish/ui-library/components/organisms/Tables`. Removed in the next major. */
|
|
13
|
+
const TableSortMenu = Tables.TableSortMenu;
|
|
14
|
+
/** @deprecated Import from `@flipdish/ui-library/components/organisms/Tables`. Removed in the next major. */
|
|
15
|
+
const TableLayoutToggle = Tables.TableLayoutToggle;
|
|
287
16
|
|
|
288
|
-
exports.TableLayoutToggle = TableLayoutToggle.TableLayoutToggle;
|
|
289
|
-
exports.TableSortMenu = TableSortMenu.TableSortMenu;
|
|
290
17
|
exports.Table = Table;
|
|
291
18
|
exports.TableCard = TableCard;
|
|
19
|
+
exports.TableLayoutToggle = TableLayoutToggle;
|
|
292
20
|
exports.TableRowActionsDropdown = TableRowActionsDropdown;
|
|
21
|
+
exports.TableSortMenu = TableSortMenu;
|
|
293
22
|
//# sourceMappingURL=index.cjs.map
|