@kosmeo-ui/react 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/components/buttons/button/index.d.ts +2 -0
- package/dist/components/buttons/button/index.d.ts.map +1 -1
- package/dist/components/buttons/button/index.js +2 -2
- package/dist/components/buttons/button/index.js.map +1 -1
- package/dist/components/buttons/button/styles.css +45 -43
- package/dist/components/buttons/rowActions/index.d.ts.map +1 -1
- package/dist/components/buttons/rowActions/index.js +2 -1
- package/dist/components/buttons/rowActions/index.js.map +1 -1
- package/dist/components/buttons/rowActions/styles.css +7 -0
- package/dist/components/data-display/addressBlock/styles.css +2 -4
- package/dist/components/data-display/colorSwatch/index.d.ts +1 -1
- package/dist/components/data-display/colorSwatch/index.d.ts.map +1 -1
- package/dist/components/data-display/colorSwatch/index.js +1 -1
- package/dist/components/data-display/colorSwatch/index.js.map +1 -1
- package/dist/components/data-display/colorSwatch/styles.css +1 -1
- package/dist/components/data-display/dataTable/index.d.ts.map +1 -1
- package/dist/components/data-display/dataTable/index.js +7 -3
- package/dist/components/data-display/dataTable/index.js.map +1 -1
- package/dist/components/data-display/dataTable/styles.css +18 -2
- package/dist/components/data-display/dataTable/utils/parseDataKey.d.ts +8 -1
- package/dist/components/data-display/dataTable/utils/parseDataKey.d.ts.map +1 -1
- package/dist/components/data-display/dataTable/utils/parseDataKey.js +13 -41
- package/dist/components/data-display/dataTable/utils/parseDataKey.js.map +1 -1
- package/dist/components/data-display/imagePreview/styles.css +2 -2
- package/dist/components/data-display/infiniteScroll/filters/index.d.ts +4 -0
- package/dist/components/data-display/infiniteScroll/filters/index.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/index.js +12 -2
- package/dist/components/data-display/infiniteScroll/filters/index.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/listFilter.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/listFilter.js +1 -1
- package/dist/components/data-display/infiniteScroll/filters/listFilter.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/rangeFilter.d.ts +6 -0
- package/dist/components/data-display/infiniteScroll/filters/rangeFilter.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/rangeFilter.js +55 -46
- package/dist/components/data-display/infiniteScroll/filters/rangeFilter.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/searchFilter.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/searchFilter.js +4 -35
- package/dist/components/data-display/infiniteScroll/filters/searchFilter.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/selectFilter.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/selectFilter.js +3 -5
- package/dist/components/data-display/infiniteScroll/filters/selectFilter.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/filters/styles.css +34 -1
- package/dist/components/data-display/infiniteScroll/header/deleteButton.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/deleteButton.js +1 -1
- package/dist/components/data-display/infiniteScroll/header/deleteButton.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/index.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/index.js +1 -1
- package/dist/components/data-display/infiniteScroll/header/index.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/limit.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/limit.js +1 -1
- package/dist/components/data-display/infiniteScroll/header/limit.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortBy.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortBy.js +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortBy.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortDirection.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortDirection.js +1 -1
- package/dist/components/data-display/infiniteScroll/header/sortDirection.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/index.d.ts +8 -0
- package/dist/components/data-display/infiniteScroll/index.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/index.js +41 -23
- package/dist/components/data-display/infiniteScroll/index.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/styles.css +2 -2
- package/dist/components/data-display/infiniteScroll/table/index.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/table/index.js +2 -2
- package/dist/components/data-display/infiniteScroll/table/index.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/index.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/index.js +7 -11
- package/dist/components/data-display/infiniteScroll/tags/index.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/listFilterTag.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/listFilterTag.js +8 -8
- package/dist/components/data-display/infiniteScroll/tags/listFilterTag.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/rangeFilterTag.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/rangeFilterTag.js +6 -18
- package/dist/components/data-display/infiniteScroll/tags/rangeFilterTag.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/selectFilterTag.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/selectFilterTag.js +3 -5
- package/dist/components/data-display/infiniteScroll/tags/selectFilterTag.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/tags/styles.css +1 -29
- package/dist/components/data-display/infiniteScroll/utils/generateQueryString.d.ts +6 -0
- package/dist/components/data-display/infiniteScroll/utils/generateQueryString.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/utils/generateQueryString.js +24 -12
- package/dist/components/data-display/infiniteScroll/utils/generateQueryString.js.map +1 -1
- package/dist/components/data-display/infiniteScroll/utils/hasPendingChanges.d.ts +11 -1
- package/dist/components/data-display/infiniteScroll/utils/hasPendingChanges.d.ts.map +1 -1
- package/dist/components/data-display/infiniteScroll/utils/hasPendingChanges.js +37 -18
- package/dist/components/data-display/infiniteScroll/utils/hasPendingChanges.js.map +1 -1
- package/dist/components/data-display/listCard/styles.css +3 -3
- package/dist/components/data-display/listRow/styles.css +2 -2
- package/dist/components/data-display/recoveryCodeGrid/styles.css +3 -4
- package/dist/components/data-display/secretDisplay/styles.css +4 -4
- package/dist/components/data-display/statCard/styles.css +12 -12
- package/dist/components/data-display/summaryRow/styles.css +4 -4
- package/dist/components/data-display/table/index.d.ts.map +1 -1
- package/dist/components/data-display/table/index.js +2 -2
- package/dist/components/data-display/table/index.js.map +1 -1
- package/dist/components/data-display/table/styles.css +22 -11
- package/dist/components/data-display/tableFilters/index.d.ts +30 -0
- package/dist/components/data-display/tableFilters/index.d.ts.map +1 -0
- package/dist/components/data-display/tableFilters/index.js +67 -0
- package/dist/components/data-display/tableFilters/index.js.map +1 -0
- package/dist/components/data-display/tagCard/index.d.ts.map +1 -1
- package/dist/components/data-display/tagCard/index.js +1 -1
- package/dist/components/data-display/tagCard/index.js.map +1 -1
- package/dist/components/data-display/tagCard/styles.css +1 -1
- package/dist/components/feedback/alert/styles.css +15 -15
- package/dist/components/feedback/badge/index.d.ts.map +1 -1
- package/dist/components/feedback/badge/index.js +14 -8
- package/dist/components/feedback/badge/index.js.map +1 -1
- package/dist/components/feedback/badge/styles.css +45 -45
- package/dist/components/feedback/emptyState/styles.css +2 -4
- package/dist/components/feedback/loadingOverlay/styles.css +1 -1
- package/dist/components/feedback/progressBar/index.d.ts.map +1 -1
- package/dist/components/feedback/progressBar/index.js +7 -2
- package/dist/components/feedback/progressBar/index.js.map +1 -1
- package/dist/components/feedback/progressBar/styles.css +25 -16
- package/dist/components/feedback/spinner/styles.css +14 -24
- package/dist/components/feedback/tooltip/styles.css +9 -7
- package/dist/components/forms/detailField/styles.css +1 -1
- package/dist/components/forms/fieldShell/index.d.ts +3 -1
- package/dist/components/forms/fieldShell/index.d.ts.map +1 -1
- package/dist/components/forms/fieldShell/index.js +1 -1
- package/dist/components/forms/fieldShell/index.js.map +1 -1
- package/dist/components/forms/fieldShell/styles.css +5 -5
- package/dist/components/forms/form/styles.css +6 -6
- package/dist/components/forms/formActions/styles.css +4 -4
- package/dist/components/forms/formGrid/styles.css +32 -0
- package/dist/components/forms/infoRow/styles.css +2 -3
- package/dist/components/forms/optionsGroup/index.d.ts +3 -1
- package/dist/components/forms/optionsGroup/index.d.ts.map +1 -1
- package/dist/components/forms/optionsGroup/index.js +5 -1
- package/dist/components/forms/optionsGroup/index.js.map +1 -1
- package/dist/components/forms/optionsGroup/styles.css +1 -1
- package/dist/components/forms/requiredAsterisk/index.d.ts.map +1 -1
- package/dist/components/forms/requiredAsterisk/index.js +3 -2
- package/dist/components/forms/requiredAsterisk/index.js.map +1 -1
- package/dist/components/forms/requiredAsterisk/styles.css +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/index.d.ts +6 -1
- package/dist/components/inputs/checkbox/index.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/index.js +12 -3
- package/dist/components/inputs/checkbox/index.js.map +1 -1
- package/dist/components/inputs/checkbox/styles.css +11 -3
- package/dist/components/inputs/colorPicker/index.d.ts.map +1 -1
- package/dist/components/inputs/colorPicker/index.js +3 -1
- package/dist/components/inputs/colorPicker/index.js.map +1 -1
- package/dist/components/inputs/colorPicker/styles.css +3 -3
- package/dist/components/inputs/dateInput/index.d.ts +6 -6
- package/dist/components/inputs/dateInput/index.d.ts.map +1 -1
- package/dist/components/inputs/dateInput/index.js +15 -5
- package/dist/components/inputs/dateInput/index.js.map +1 -1
- package/dist/components/inputs/dateInput/styles.css +5 -5
- package/dist/components/inputs/dateInput/utils.d.ts +0 -1
- package/dist/components/inputs/dateInput/utils.d.ts.map +1 -1
- package/dist/components/inputs/dateInput/utils.js +13 -8
- package/dist/components/inputs/dateInput/utils.js.map +1 -1
- package/dist/components/inputs/dropdown/index.d.ts +2 -0
- package/dist/components/inputs/dropdown/index.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/index.js +2 -2
- package/dist/components/inputs/dropdown/index.js.map +1 -1
- package/dist/components/inputs/dropdown/styles.css +2 -2
- package/dist/components/inputs/dropdownArrowButton/index.d.ts.map +1 -1
- package/dist/components/inputs/dropdownArrowButton/index.js +1 -1
- package/dist/components/inputs/dropdownArrowButton/index.js.map +1 -1
- package/dist/components/inputs/dropdownArrowButton/styles.css +7 -5
- package/dist/components/inputs/fileDropZone/index.d.ts.map +1 -1
- package/dist/components/inputs/fileDropZone/index.js +3 -2
- package/dist/components/inputs/fileDropZone/index.js.map +1 -1
- package/dist/components/inputs/fileDropZone/styles.css +12 -12
- package/dist/components/inputs/fileUpload/index.d.ts.map +1 -1
- package/dist/components/inputs/fileUpload/index.js +11 -6
- package/dist/components/inputs/fileUpload/index.js.map +1 -1
- package/dist/components/inputs/fileUpload/styles.css +9 -9
- package/dist/components/inputs/input/index.d.ts +17 -1
- package/dist/components/inputs/input/index.d.ts.map +1 -1
- package/dist/components/inputs/input/index.js +27 -5
- package/dist/components/inputs/input/index.js.map +1 -1
- package/dist/components/inputs/input/styles.css +68 -24
- package/dist/components/inputs/languageSelect/index.d.ts.map +1 -1
- package/dist/components/inputs/languageSelect/index.js +15 -4
- package/dist/components/inputs/languageSelect/index.js.map +1 -1
- package/dist/components/inputs/multiSelect/dropDown.d.ts +7 -0
- package/dist/components/inputs/multiSelect/dropDown.d.ts.map +1 -1
- package/dist/components/inputs/multiSelect/dropDown.js +19 -12
- package/dist/components/inputs/multiSelect/dropDown.js.map +1 -1
- package/dist/components/inputs/multiSelect/index.d.ts.map +1 -1
- package/dist/components/inputs/multiSelect/index.js +49 -13
- package/dist/components/inputs/multiSelect/index.js.map +1 -1
- package/dist/components/inputs/multiSelect/styles.css +51 -43
- package/dist/components/inputs/multiSelect/utils.d.ts +7 -0
- package/dist/components/inputs/multiSelect/utils.d.ts.map +1 -0
- package/dist/components/inputs/multiSelect/utils.js +18 -0
- package/dist/components/inputs/multiSelect/utils.js.map +1 -0
- package/dist/components/inputs/phoneInput/index.d.ts.map +1 -1
- package/dist/components/inputs/phoneInput/index.js +11 -3
- package/dist/components/inputs/phoneInput/index.js.map +1 -1
- package/dist/components/inputs/phoneInput/styles.css +13 -13
- package/dist/components/inputs/radioGroup/index.d.ts.map +1 -1
- package/dist/components/inputs/radioGroup/index.js +1 -1
- package/dist/components/inputs/radioGroup/index.js.map +1 -1
- package/dist/components/inputs/richTextEditor/index.d.ts.map +1 -1
- package/dist/components/inputs/richTextEditor/index.js +30 -20
- package/dist/components/inputs/richTextEditor/index.js.map +1 -1
- package/dist/components/inputs/richTextEditor/styles.css +24 -24
- package/dist/components/inputs/searchList/index.d.ts +4 -1
- package/dist/components/inputs/searchList/index.d.ts.map +1 -1
- package/dist/components/inputs/searchList/index.js +46 -31
- package/dist/components/inputs/searchList/index.js.map +1 -1
- package/dist/components/inputs/searchList/styles.css +22 -22
- package/dist/components/inputs/searchSelect/index.d.ts.map +1 -1
- package/dist/components/inputs/searchSelect/index.js +8 -2
- package/dist/components/inputs/searchSelect/index.js.map +1 -1
- package/dist/components/inputs/select/index.js +3 -2
- package/dist/components/inputs/select/index.js.map +1 -1
- package/dist/components/inputs/select/styles.css +93 -15
- package/dist/components/inputs/switch/index.d.ts.map +1 -1
- package/dist/components/inputs/switch/index.js +3 -1
- package/dist/components/inputs/switch/index.js.map +1 -1
- package/dist/components/inputs/switch/styles.css +5 -5
- package/dist/components/inputs/textArea/index.d.ts.map +1 -1
- package/dist/components/inputs/textArea/index.js +3 -2
- package/dist/components/inputs/textArea/index.js.map +1 -1
- package/dist/components/inputs/textArea/styles.css +11 -11
- package/dist/components/inputs/typeahead/index.d.ts.map +1 -1
- package/dist/components/inputs/typeahead/index.js +21 -6
- package/dist/components/inputs/typeahead/index.js.map +1 -1
- package/dist/components/inputs/typeahead/styles.css +13 -13
- package/dist/components/layout/authPage/styles.css +6 -6
- package/dist/components/layout/borderedSection/index.d.ts +3 -1
- package/dist/components/layout/borderedSection/index.d.ts.map +1 -1
- package/dist/components/layout/borderedSection/index.js +2 -2
- package/dist/components/layout/borderedSection/index.js.map +1 -1
- package/dist/components/layout/borderedSection/styles.css +3 -3
- package/dist/components/layout/card/styles.css +53 -31
- package/dist/components/layout/col/styles.css +1 -1
- package/dist/components/layout/page/styles.css +25 -5
- package/dist/components/layout/sectionHeader/styles.css +3 -4
- package/dist/components/navigation/breadcrumbs/styles.css +7 -7
- package/dist/components/navigation/pagination/index.d.ts +23 -0
- package/dist/components/navigation/pagination/index.d.ts.map +1 -0
- package/dist/components/navigation/pagination/index.js +29 -0
- package/dist/components/navigation/pagination/index.js.map +1 -0
- package/dist/components/navigation/pagination/styles.css +113 -0
- package/dist/components/navigation/pagination/utils.d.ts +9 -0
- package/dist/components/navigation/pagination/utils.d.ts.map +1 -0
- package/dist/components/navigation/pagination/utils.js +25 -0
- package/dist/components/navigation/pagination/utils.js.map +1 -0
- package/dist/components/navigation/sidebar/styles.css +13 -5
- package/dist/components/navigation/stepper/styles.css +14 -14
- package/dist/components/navigation/tabButton/styles.css +59 -59
- package/dist/components/navigation/tabs/styles.css +5 -5
- package/dist/components/overlays/confirmationModal/index.d.ts +5 -0
- package/dist/components/overlays/confirmationModal/index.d.ts.map +1 -1
- package/dist/components/overlays/confirmationModal/index.js +23 -4
- package/dist/components/overlays/confirmationModal/index.js.map +1 -1
- package/dist/components/overlays/confirmationModal/styles.css +3 -0
- package/dist/components/overlays/modal/index.d.ts +2 -0
- package/dist/components/overlays/modal/index.d.ts.map +1 -1
- package/dist/components/overlays/modal/index.js +13 -4
- package/dist/components/overlays/modal/index.js.map +1 -1
- package/dist/components/overlays/modal/styles.css +19 -19
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useInfinite.d.ts +3 -1
- package/dist/hooks/useInfinite.d.ts.map +1 -1
- package/dist/hooks/useInfinite.js +4 -2
- package/dist/hooks/useInfinite.js.map +1 -1
- package/dist/hooks/useInfiniteArchivableCursor.d.ts +1 -1
- package/dist/hooks/useInfiniteArchivableCursor.d.ts.map +1 -1
- package/dist/hooks/useInfiniteArchivableCursor.js +11 -4
- package/dist/hooks/useInfiniteArchivableCursor.js.map +1 -1
- package/dist/hooks/useInfiniteCursor.d.ts +1 -1
- package/dist/hooks/useInfiniteCursor.d.ts.map +1 -1
- package/dist/hooks/useInfiniteCursor.js +11 -4
- package/dist/hooks/useInfiniteCursor.js.map +1 -1
- package/dist/hooks/usePaginated.d.ts +43 -0
- package/dist/hooks/usePaginated.d.ts.map +1 -0
- package/dist/hooks/usePaginated.js +60 -0
- package/dist/hooks/usePaginated.js.map +1 -0
- package/dist/styles.css +161 -123
- package/package.json +15 -4
- package/src/components/buttons/button/index.tsx +14 -5
- package/src/components/buttons/button/styles.css +45 -43
- package/src/components/buttons/rowActions/index.tsx +6 -1
- package/src/components/buttons/rowActions/styles.css +7 -0
- package/src/components/data-display/addressBlock/styles.css +2 -4
- package/src/components/data-display/colorSwatch/index.tsx +2 -2
- package/src/components/data-display/colorSwatch/styles.css +1 -1
- package/src/components/data-display/dataTable/index.tsx +6 -3
- package/src/components/data-display/dataTable/styles.css +18 -2
- package/src/components/data-display/dataTable/utils/parseDataKey.ts +18 -36
- package/src/components/data-display/imagePreview/styles.css +2 -2
- package/src/components/data-display/infiniteScroll/filters/index.tsx +18 -1
- package/src/components/data-display/infiniteScroll/filters/listFilter.tsx +1 -0
- package/src/components/data-display/infiniteScroll/filters/rangeFilter.tsx +77 -33
- package/src/components/data-display/infiniteScroll/filters/searchFilter.tsx +16 -65
- package/src/components/data-display/infiniteScroll/filters/selectFilter.tsx +11 -17
- package/src/components/data-display/infiniteScroll/filters/styles.css +34 -1
- package/src/components/data-display/infiniteScroll/header/deleteButton.tsx +1 -0
- package/src/components/data-display/infiniteScroll/header/index.tsx +4 -0
- package/src/components/data-display/infiniteScroll/header/limit.tsx +1 -0
- package/src/components/data-display/infiniteScroll/header/sortBy.tsx +1 -0
- package/src/components/data-display/infiniteScroll/header/sortDirection.tsx +1 -0
- package/src/components/data-display/infiniteScroll/index.tsx +75 -29
- package/src/components/data-display/infiniteScroll/styles.css +2 -2
- package/src/components/data-display/infiniteScroll/table/index.tsx +2 -0
- package/src/components/data-display/infiniteScroll/tags/index.tsx +7 -16
- package/src/components/data-display/infiniteScroll/tags/listFilterTag.tsx +31 -28
- package/src/components/data-display/infiniteScroll/tags/rangeFilterTag.tsx +8 -25
- package/src/components/data-display/infiniteScroll/tags/selectFilterTag.tsx +4 -11
- package/src/components/data-display/infiniteScroll/tags/styles.css +1 -29
- package/src/components/data-display/infiniteScroll/utils/generateQueryString.ts +28 -13
- package/src/components/data-display/infiniteScroll/utils/hasPendingChanges.ts +48 -16
- package/src/components/data-display/listCard/styles.css +3 -3
- package/src/components/data-display/listRow/styles.css +2 -2
- package/src/components/data-display/recoveryCodeGrid/styles.css +3 -4
- package/src/components/data-display/secretDisplay/styles.css +4 -4
- package/src/components/data-display/statCard/styles.css +12 -12
- package/src/components/data-display/summaryRow/styles.css +4 -4
- package/src/components/data-display/table/index.tsx +2 -2
- package/src/components/data-display/table/styles.css +22 -11
- package/src/components/data-display/tableFilters/index.tsx +147 -0
- package/src/components/data-display/tagCard/index.tsx +7 -4
- package/src/components/data-display/tagCard/styles.css +1 -1
- package/src/components/feedback/alert/styles.css +15 -15
- package/src/components/feedback/badge/index.tsx +36 -16
- package/src/components/feedback/badge/styles.css +45 -45
- package/src/components/feedback/emptyState/styles.css +2 -4
- package/src/components/feedback/loadingOverlay/styles.css +1 -1
- package/src/components/feedback/progressBar/index.tsx +14 -8
- package/src/components/feedback/progressBar/styles.css +25 -16
- package/src/components/feedback/spinner/styles.css +14 -24
- package/src/components/feedback/tooltip/styles.css +9 -7
- package/src/components/forms/detailField/styles.css +1 -1
- package/src/components/forms/fieldShell/index.tsx +4 -1
- package/src/components/forms/fieldShell/styles.css +5 -5
- package/src/components/forms/form/styles.css +6 -6
- package/src/components/forms/formActions/styles.css +4 -4
- package/src/components/forms/formGrid/styles.css +32 -0
- package/src/components/forms/infoRow/styles.css +2 -3
- package/src/components/forms/optionsGroup/index.tsx +31 -12
- package/src/components/forms/optionsGroup/styles.css +1 -1
- package/src/components/forms/requiredAsterisk/index.tsx +5 -1
- package/src/components/forms/requiredAsterisk/styles.css +1 -1
- package/src/components/index.ts +4 -0
- package/src/components/inputs/checkbox/index.tsx +27 -6
- package/src/components/inputs/checkbox/styles.css +11 -3
- package/src/components/inputs/colorPicker/index.tsx +5 -2
- package/src/components/inputs/colorPicker/styles.css +3 -3
- package/src/components/inputs/dateInput/index.tsx +17 -9
- package/src/components/inputs/dateInput/styles.css +5 -5
- package/src/components/inputs/dateInput/utils.ts +12 -8
- package/src/components/inputs/dropdown/index.tsx +5 -1
- package/src/components/inputs/dropdown/styles.css +2 -2
- package/src/components/inputs/dropdownArrowButton/index.tsx +1 -0
- package/src/components/inputs/dropdownArrowButton/styles.css +7 -5
- package/src/components/inputs/fileDropZone/index.tsx +4 -3
- package/src/components/inputs/fileDropZone/styles.css +12 -12
- package/src/components/inputs/fileUpload/index.tsx +33 -23
- package/src/components/inputs/fileUpload/styles.css +9 -9
- package/src/components/inputs/input/index.tsx +67 -6
- package/src/components/inputs/input/styles.css +68 -24
- package/src/components/inputs/languageSelect/index.tsx +19 -4
- package/src/components/inputs/multiSelect/dropDown.tsx +83 -35
- package/src/components/inputs/multiSelect/index.tsx +87 -29
- package/src/components/inputs/multiSelect/styles.css +51 -43
- package/src/components/inputs/multiSelect/utils.ts +18 -0
- package/src/components/inputs/phoneInput/index.tsx +16 -4
- package/src/components/inputs/phoneInput/styles.css +13 -13
- package/src/components/inputs/radioGroup/index.tsx +2 -1
- package/src/components/inputs/richTextEditor/index.tsx +59 -37
- package/src/components/inputs/richTextEditor/styles.css +24 -24
- package/src/components/inputs/searchList/index.tsx +121 -109
- package/src/components/inputs/searchList/styles.css +22 -22
- package/src/components/inputs/searchSelect/index.tsx +8 -2
- package/src/components/inputs/select/index.tsx +3 -3
- package/src/components/inputs/select/styles.css +93 -15
- package/src/components/inputs/switch/index.tsx +3 -2
- package/src/components/inputs/switch/styles.css +5 -5
- package/src/components/inputs/textArea/index.tsx +3 -3
- package/src/components/inputs/textArea/styles.css +11 -11
- package/src/components/inputs/typeahead/index.tsx +84 -54
- package/src/components/inputs/typeahead/styles.css +13 -13
- package/src/components/layout/authPage/styles.css +6 -6
- package/src/components/layout/borderedSection/index.tsx +4 -1
- package/src/components/layout/borderedSection/styles.css +3 -3
- package/src/components/layout/card/styles.css +53 -31
- package/src/components/layout/col/styles.css +1 -1
- package/src/components/layout/page/styles.css +25 -5
- package/src/components/layout/sectionHeader/styles.css +3 -4
- package/src/components/navigation/breadcrumbs/styles.css +7 -7
- package/src/components/navigation/pagination/index.tsx +134 -0
- package/src/components/navigation/pagination/styles.css +113 -0
- package/src/components/navigation/pagination/utils.ts +32 -0
- package/src/components/navigation/sidebar/styles.css +13 -5
- package/src/components/navigation/stepper/styles.css +14 -14
- package/src/components/navigation/tabButton/styles.css +59 -59
- package/src/components/navigation/tabs/styles.css +5 -5
- package/src/components/overlays/confirmationModal/index.tsx +37 -1
- package/src/components/overlays/confirmationModal/styles.css +3 -0
- package/src/components/overlays/modal/index.tsx +23 -4
- package/src/components/overlays/modal/styles.css +19 -19
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useInfinite.ts +7 -3
- package/src/hooks/useInfiniteArchivableCursor.ts +11 -4
- package/src/hooks/useInfiniteCursor.ts +11 -4
- package/src/hooks/usePaginated.ts +123 -0
- package/src/styles.css +161 -123
- package/dist/components/data-display/infiniteScroll/tags/searchFilterTag.d.ts +0 -10
- package/dist/components/data-display/infiniteScroll/tags/searchFilterTag.d.ts.map +0 -1
- package/dist/components/data-display/infiniteScroll/tags/searchFilterTag.js +0 -22
- package/dist/components/data-display/infiniteScroll/tags/searchFilterTag.js.map +0 -1
- package/src/components/data-display/infiniteScroll/tags/searchFilterTag.tsx +0 -41
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
-
import {
|
|
5
|
-
import Dropdown from "../../../inputs/dropdown/index.js";
|
|
6
|
-
import Button from "../../../buttons/button/index.js";
|
|
4
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
7
5
|
import Input from "../../../inputs/input/index.js";
|
|
8
6
|
import "./styles.css";
|
|
9
7
|
import {
|
|
@@ -16,68 +14,21 @@ interface InfiniteScrollSearchFilterProps {
|
|
|
16
14
|
onFilterChange: (filter: InfiniteScrollMenuGeneratedFilter) => void;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (
|
|
26
|
-
props.filter.value === prevValue ||
|
|
27
|
-
(props.filter.value === undefined && prevValue === "")
|
|
28
|
-
)
|
|
29
|
-
return;
|
|
30
|
-
setValue(props.filter.value || "");
|
|
31
|
-
setPrevValue(props.filter.value || "");
|
|
32
|
-
return;
|
|
33
|
-
}, [props.filter.value, value, prevValue]);
|
|
34
|
-
|
|
35
|
-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
36
|
-
setValue(e.target.value);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const handleSubmit = useCallback(() => {
|
|
40
|
-
setPrevValue(value);
|
|
41
|
-
props.onFilterChange({ ...props.filter, value: value });
|
|
42
|
-
setIsOpen(false);
|
|
43
|
-
}, [value, props]);
|
|
44
|
-
|
|
45
|
-
const handleKeydown = useCallback(
|
|
46
|
-
(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
47
|
-
if (e.key !== "Enter") return;
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
handleSubmit();
|
|
50
|
-
},
|
|
51
|
-
[handleSubmit]
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const allowSubmit = useMemo(() => {
|
|
55
|
-
return value !== prevValue;
|
|
56
|
-
}, [value, prevValue]);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<Dropdown
|
|
60
|
-
label={props.filter.title}
|
|
61
|
-
icon={faMagnifyingGlass}
|
|
62
|
-
align="left"
|
|
17
|
+
// Typing updates the pending filter, like the other filters; Apply applies it.
|
|
18
|
+
const SearchFilter = (props: InfiniteScrollSearchFilterProps) => (
|
|
19
|
+
<div className="k-search-filter">
|
|
20
|
+
<Input
|
|
63
21
|
size="sm"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<Button size="sm" disabled={!allowSubmit} onClick={handleSubmit}>
|
|
76
|
-
Add Filter
|
|
77
|
-
</Button>
|
|
78
|
-
</div>
|
|
79
|
-
</Dropdown>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
22
|
+
label={props.filter.title}
|
|
23
|
+
placeholder="Search…"
|
|
24
|
+
prefix={<FontAwesomeIcon icon={faMagnifyingGlass} />}
|
|
25
|
+
value={props.filter.value ?? ""}
|
|
26
|
+
onChange={(e) =>
|
|
27
|
+
props.onFilterChange({ ...props.filter, value: e.target.value })
|
|
28
|
+
}
|
|
29
|
+
onClear={() => props.onFilterChange({ ...props.filter, value: "" })}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
82
33
|
|
|
83
34
|
export default SearchFilter;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import IconButton from "../../../buttons/iconButton/index.js";
|
|
3
|
+
import { faSquareCheck } from "@fortawesome/free-solid-svg-icons";
|
|
5
4
|
import Dropdown from "../../../inputs/dropdown/index.js";
|
|
6
5
|
import { useEffect, useMemo, useState } from "react";
|
|
7
6
|
import Input from "../../../inputs/input/index.js";
|
|
8
7
|
import "./styles.css";
|
|
9
|
-
import {
|
|
10
|
-
faCheckSquare,
|
|
11
|
-
faSquareCheck,
|
|
12
|
-
} from "@fortawesome/free-solid-svg-icons";
|
|
13
8
|
import {
|
|
14
9
|
GeneratedSelectFilter,
|
|
15
10
|
InfiniteScrollMenuFilterOption,
|
|
@@ -63,18 +58,16 @@ const SelectFilter = (props: InfiniteScrollSelectFilterProps) => {
|
|
|
63
58
|
if (optionSearch === "") return true;
|
|
64
59
|
return item.name.toLowerCase().includes(optionSearch.toLowerCase());
|
|
65
60
|
});
|
|
66
|
-
return available.map((item
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
icon={item.selected ? faCheckSquare : faSquare}
|
|
75
|
-
>
|
|
61
|
+
return available.map((item) => (
|
|
62
|
+
<label className="k-select-filter-option" key={item.id}>
|
|
63
|
+
<input
|
|
64
|
+
type="checkbox"
|
|
65
|
+
className="k-select-filter-option-input"
|
|
66
|
+
checked={item.selected}
|
|
67
|
+
onChange={() => handleSelect(item.id, !item.selected)}
|
|
68
|
+
/>
|
|
76
69
|
{item.name}
|
|
77
|
-
</
|
|
70
|
+
</label>
|
|
78
71
|
));
|
|
79
72
|
}, [options, optionSearch]);
|
|
80
73
|
|
|
@@ -92,6 +85,7 @@ const SelectFilter = (props: InfiniteScrollSelectFilterProps) => {
|
|
|
92
85
|
<Input
|
|
93
86
|
size="sm"
|
|
94
87
|
placeholder="Search"
|
|
88
|
+
aria-label={`Search ${props.filter.title} options`}
|
|
95
89
|
value={optionSearch}
|
|
96
90
|
onChange={handleSearchOption}
|
|
97
91
|
/>
|
|
@@ -26,13 +26,22 @@
|
|
|
26
26
|
min-width: 15rem;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.k-search-filter {
|
|
30
|
+
width: 14rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
.k-range-filter-menu-column {
|
|
30
34
|
display: flex;
|
|
31
35
|
flex-direction: column;
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
.k-range-filter-menu-actions {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
}
|
|
42
|
+
|
|
34
43
|
.k-range-filter-menu-label {
|
|
35
|
-
color: var(--text-color-secondary);
|
|
44
|
+
color: var(--k-text-color-secondary);
|
|
36
45
|
margin-bottom: 0;
|
|
37
46
|
}
|
|
38
47
|
|
|
@@ -46,3 +55,27 @@
|
|
|
46
55
|
flex-direction: column;
|
|
47
56
|
overflow-y: auto;
|
|
48
57
|
}
|
|
58
|
+
|
|
59
|
+
.k-select-filter-option {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 0.5rem;
|
|
63
|
+
padding: 0.375rem 0.5rem;
|
|
64
|
+
border-radius: 0.25rem;
|
|
65
|
+
font-size: var(--k-text-size-sm);
|
|
66
|
+
color: var(--k-text-color);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.k-select-filter-option:hover,
|
|
71
|
+
.k-select-filter-option:has(:focus-visible) {
|
|
72
|
+
background-color: var(--k-background-color-hover);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.k-select-filter-option-input {
|
|
76
|
+
width: 1rem;
|
|
77
|
+
height: 1rem;
|
|
78
|
+
margin: 0;
|
|
79
|
+
accent-color: var(--k-primary-color);
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
@@ -47,6 +47,7 @@ const Header = <TData extends object>(props: HeaderProps<TData>) => {
|
|
|
47
47
|
size="sm"
|
|
48
48
|
variant="secondary"
|
|
49
49
|
onClick={props.onRefetch}
|
|
50
|
+
aria-label="Refresh"
|
|
50
51
|
icon={faRotate}
|
|
51
52
|
/>
|
|
52
53
|
{props.onDownload && (
|
|
@@ -54,6 +55,7 @@ const Header = <TData extends object>(props: HeaderProps<TData>) => {
|
|
|
54
55
|
size="sm"
|
|
55
56
|
variant="secondary"
|
|
56
57
|
onClick={props.onDownload}
|
|
58
|
+
aria-label="Download"
|
|
57
59
|
icon={faDownload}
|
|
58
60
|
/>
|
|
59
61
|
)}
|
|
@@ -62,6 +64,7 @@ const Header = <TData extends object>(props: HeaderProps<TData>) => {
|
|
|
62
64
|
size="sm"
|
|
63
65
|
variant="success"
|
|
64
66
|
onClick={props.onAddNew}
|
|
67
|
+
aria-label="Add new"
|
|
65
68
|
icon={faPlus}
|
|
66
69
|
/>
|
|
67
70
|
)}
|
|
@@ -74,6 +77,7 @@ const Header = <TData extends object>(props: HeaderProps<TData>) => {
|
|
|
74
77
|
{props.optionsDropdown && (
|
|
75
78
|
<Dropdown
|
|
76
79
|
icon={faEllipsisVertical}
|
|
80
|
+
aria-label="More options"
|
|
77
81
|
size="sm"
|
|
78
82
|
variant="secondary"
|
|
79
83
|
align="left"
|
|
@@ -39,6 +39,7 @@ const Limit = (props: LimitProps) => {
|
|
|
39
39
|
<p>Results Per Page:</p>
|
|
40
40
|
<Dropdown
|
|
41
41
|
label={limitOptions.find((o) => o.selected)?.value || "None"}
|
|
42
|
+
aria-label={`Results per page: ${limitOptions.find((o) => o.selected)?.value || "None"}`}
|
|
42
43
|
align="right"
|
|
43
44
|
size="sm"
|
|
44
45
|
variant="secondary"
|
|
@@ -31,6 +31,7 @@ const SortBy = (props: SortbyProps) => {
|
|
|
31
31
|
size="sm"
|
|
32
32
|
variant="secondary"
|
|
33
33
|
label={props.sortBy.find((key) => key.selected)?.displayName || "None"}
|
|
34
|
+
aria-label={`Sort by: ${props.sortBy.find((key) => key.selected)?.displayName || "None"}`}
|
|
34
35
|
isOpen={isOpen}
|
|
35
36
|
onOpenChange={setIsOpen}
|
|
36
37
|
>
|
|
@@ -28,6 +28,7 @@ const SortDirection = (props: DirectionSortProps) => {
|
|
|
28
28
|
align="right"
|
|
29
29
|
size="sm"
|
|
30
30
|
label={props.sortDirection === "asc" ? "Ascending" : "Descending"}
|
|
31
|
+
aria-label={`Sort direction: ${props.sortDirection === "asc" ? "Ascending" : "Descending"}`}
|
|
31
32
|
isOpen={isOpen}
|
|
32
33
|
onOpenChange={setIsOpen}
|
|
33
34
|
>
|
|
@@ -83,8 +83,18 @@ interface InfiniteScrollProps<TData> {
|
|
|
83
83
|
hideSelectColumn?: boolean;
|
|
84
84
|
/** When true, hides the "Fetch Next Page" button */
|
|
85
85
|
hideNextPageButton?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* When filter, sort and page-size changes take effect. `"immediate"`
|
|
88
|
+
* (default) applies each change as it's made: searches wait for a pause in
|
|
89
|
+
* typing, and a range (two bounds in one menu) applies from the menu's own
|
|
90
|
+
* Apply button. `"manual"` collects changes until Apply is clicked. In
|
|
91
|
+
* both, Enter in a filter's text box applies at once.
|
|
92
|
+
*/
|
|
93
|
+
applyMode?: "immediate" | "manual";
|
|
86
94
|
}
|
|
87
95
|
|
|
96
|
+
const TYPING_DEBOUNCE_MS = 400;
|
|
97
|
+
|
|
88
98
|
const InfiniteScroll = <TData extends object>(
|
|
89
99
|
props: InfiniteScrollProps<TData>
|
|
90
100
|
) => {
|
|
@@ -189,9 +199,19 @@ const InfiniteScroll = <TData extends object>(
|
|
|
189
199
|
props.onRowSelect(selectedData);
|
|
190
200
|
}, [selectedRows, rows, props.onRowSelect]);
|
|
191
201
|
|
|
202
|
+
// The menu is plain data: re-apply it when its contents change, not each
|
|
203
|
+
// time it is a new object, or an inline menu or onReload re-renders forever.
|
|
204
|
+
const menuKey = JSON.stringify([
|
|
205
|
+
props.menu.filters,
|
|
206
|
+
props.menu.sort,
|
|
207
|
+
props.menu.limitOptions,
|
|
208
|
+
]);
|
|
209
|
+
const onReloadRef = useRef(props.onReload);
|
|
210
|
+
onReloadRef.current = props.onReload;
|
|
211
|
+
const menuApplied = useRef(false);
|
|
212
|
+
|
|
192
213
|
useEffect(() => {
|
|
193
|
-
|
|
194
|
-
const generatedFilters = props.menu.filters.map((f, i) => {
|
|
214
|
+
const generatedFilters = (props.menu.filters ?? []).map((f, i) => {
|
|
195
215
|
return { ...f, filterId: `${f.dataKey}-${i}` };
|
|
196
216
|
});
|
|
197
217
|
setFilters(generatedFilters);
|
|
@@ -205,8 +225,10 @@ const InfiniteScroll = <TData extends object>(
|
|
|
205
225
|
const limits = props.menu.limitOptions || DEFAULT_LIMIT_OPTIONS;
|
|
206
226
|
setLimitOptions(limits);
|
|
207
227
|
setPendingLimitOptions(limits);
|
|
208
|
-
|
|
209
|
-
|
|
228
|
+
// On mount the first query already loads the data.
|
|
229
|
+
if (menuApplied.current) onReloadRef.current();
|
|
230
|
+
menuApplied.current = true;
|
|
231
|
+
}, [menuKey]);
|
|
210
232
|
|
|
211
233
|
useEffect(() => {
|
|
212
234
|
const queryString = generateQueryString({
|
|
@@ -251,9 +273,13 @@ const InfiniteScroll = <TData extends object>(
|
|
|
251
273
|
]
|
|
252
274
|
);
|
|
253
275
|
|
|
276
|
+
// Reset clears what's applied as well as what's pending, so it stays
|
|
277
|
+
// available while the table is filtered even if the pending edits are empty.
|
|
254
278
|
const hasActiveFilters = useMemo(
|
|
255
|
-
() =>
|
|
256
|
-
|
|
279
|
+
() =>
|
|
280
|
+
pendingChangesUtil.hasActiveFilters(pendingFilters) ||
|
|
281
|
+
pendingChangesUtil.hasActiveFilters(filters),
|
|
282
|
+
[pendingFilters, filters]
|
|
257
283
|
);
|
|
258
284
|
|
|
259
285
|
const handleApply = useCallback(() => {
|
|
@@ -268,19 +294,36 @@ const InfiniteScroll = <TData extends object>(
|
|
|
268
294
|
pendingLimitOptions,
|
|
269
295
|
]);
|
|
270
296
|
|
|
297
|
+
const applyMode = props.applyMode ?? "immediate";
|
|
298
|
+
|
|
299
|
+
// Immediate mode applies pending changes on the next tick, or once typing
|
|
300
|
+
// pauses. Each keystroke changes handleApply, which restarts the timer.
|
|
301
|
+
useEffect(() => {
|
|
302
|
+
if (applyMode !== "immediate" || !hasPendingChanges) return;
|
|
303
|
+
const delay = pendingChangesUtil.hasTypedFilterChanges(
|
|
304
|
+
filters,
|
|
305
|
+
pendingFilters
|
|
306
|
+
)
|
|
307
|
+
? TYPING_DEBOUNCE_MS
|
|
308
|
+
: 0;
|
|
309
|
+
const timer = setTimeout(handleApply, delay);
|
|
310
|
+
return () => clearTimeout(timer);
|
|
311
|
+
}, [applyMode, hasPendingChanges, handleApply, filters, pendingFilters]);
|
|
312
|
+
|
|
313
|
+
// Tags show the applied filters, and removing one applies at once. The
|
|
314
|
+
// pending copy of that filter follows; other pending edits are kept.
|
|
315
|
+
const handleTagChange = useCallback(
|
|
316
|
+
(next: InfiniteScrollMenuGeneratedFilter[]) => {
|
|
317
|
+
setPendingFilters((pending) =>
|
|
318
|
+
pending.map((p, i) => (next[i] !== filters[i] ? next[i] : p))
|
|
319
|
+
);
|
|
320
|
+
setFilters(next);
|
|
321
|
+
},
|
|
322
|
+
[filters]
|
|
323
|
+
);
|
|
324
|
+
|
|
271
325
|
const handleReset = useCallback(() => {
|
|
272
|
-
const clearedFilters =
|
|
273
|
-
if (filter.type === "SELECT") {
|
|
274
|
-
return {
|
|
275
|
-
...filter,
|
|
276
|
-
options: filter.options?.map((o) => ({ ...o, selected: false })),
|
|
277
|
-
};
|
|
278
|
-
} else if (filter.type === "RANGE") {
|
|
279
|
-
return { ...filter, startValue: undefined, endValue: undefined };
|
|
280
|
-
} else if (filter.type === "SEARCH") {
|
|
281
|
-
return { ...filter, value: undefined };
|
|
282
|
-
} else return { ...filter, list: "" };
|
|
283
|
-
});
|
|
326
|
+
const clearedFilters = pendingChangesUtil.clearFilters(pendingFilters);
|
|
284
327
|
setPendingFilters(clearedFilters);
|
|
285
328
|
setFilters(clearedFilters);
|
|
286
329
|
}, [pendingFilters]);
|
|
@@ -310,6 +353,8 @@ const InfiniteScroll = <TData extends object>(
|
|
|
310
353
|
<Filters
|
|
311
354
|
pendingFilters={pendingFilters}
|
|
312
355
|
handleNewPendingFilters={setPendingFilters}
|
|
356
|
+
onApply={hasPendingChanges ? handleApply : undefined}
|
|
357
|
+
rangeApplyInMenu={applyMode === "immediate"}
|
|
313
358
|
>
|
|
314
359
|
<Button
|
|
315
360
|
size="sm"
|
|
@@ -319,18 +364,17 @@ const InfiniteScroll = <TData extends object>(
|
|
|
319
364
|
>
|
|
320
365
|
Reset
|
|
321
366
|
</Button>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
367
|
+
{applyMode === "manual" && (
|
|
368
|
+
<Button
|
|
369
|
+
size="sm"
|
|
370
|
+
disabled={!hasPendingChanges}
|
|
371
|
+
onClick={handleApply}
|
|
372
|
+
>
|
|
373
|
+
Apply
|
|
374
|
+
</Button>
|
|
375
|
+
)}
|
|
329
376
|
</Filters>
|
|
330
|
-
<Tags
|
|
331
|
-
filters={pendingFilters}
|
|
332
|
-
handleNewFilters={setPendingFilters}
|
|
333
|
-
/>
|
|
377
|
+
<Tags filters={filters} handleNewFilters={handleTagChange} />
|
|
334
378
|
</Col>
|
|
335
379
|
<div className="k-infinite-scroll-menu-table-divider" />
|
|
336
380
|
</>
|
|
@@ -338,6 +382,8 @@ const InfiniteScroll = <TData extends object>(
|
|
|
338
382
|
<div
|
|
339
383
|
ref={infiniteScrollTableRef}
|
|
340
384
|
className="k-infinite-scroll-table-container"
|
|
385
|
+
role="region"
|
|
386
|
+
aria-label={props.menu.title}
|
|
341
387
|
onScroll={handleScroll}
|
|
342
388
|
>
|
|
343
389
|
{props.columns && (
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
.k-infinite-scroll-menu-table-divider {
|
|
19
19
|
margin: 1rem;
|
|
20
|
-
border-top: 2px solid var(--border-color);
|
|
20
|
+
border-top: 2px solid var(--k-border-color);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.k-infinite-scroll-next-page-container {
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
justify-content: center;
|
|
33
33
|
align-items: center;
|
|
34
34
|
padding: 3rem 1rem;
|
|
35
|
-
color: var(--text-
|
|
35
|
+
color: var(--k-text-color-secondary);
|
|
36
36
|
font-size: 1rem;
|
|
37
37
|
}
|
|
@@ -32,12 +32,14 @@ const InfiniteScrollTable = <TData extends object>(
|
|
|
32
32
|
<Checkbox
|
|
33
33
|
checked={props.allSelected}
|
|
34
34
|
onChange={props.onSelectAll}
|
|
35
|
+
aria-label="Select all rows"
|
|
35
36
|
/>
|
|
36
37
|
),
|
|
37
38
|
cell: (row) => (
|
|
38
39
|
<Checkbox
|
|
39
40
|
checked={props.selectedRows.has(row.index) || props.allSelected}
|
|
40
41
|
onChange={() => props.onRowSelect(row.index)}
|
|
42
|
+
aria-label={`Select row ${row.index + 1}`}
|
|
41
43
|
/>
|
|
42
44
|
),
|
|
43
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { InfiniteScrollMenuGeneratedFilter } from "../types.js";
|
|
4
|
-
import
|
|
4
|
+
import { hasRangeValue } from "../utils/hasPendingChanges.js";
|
|
5
5
|
import SelectFilterTag from "./selectFilterTag.js";
|
|
6
6
|
import RangeFilterTag from "./rangeFilterTag.js";
|
|
7
7
|
import ListFilterTag from "./listFilterTag.js";
|
|
@@ -13,6 +13,7 @@ interface InfiniteScrollMenuTagsProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const Tags = (props: InfiniteScrollMenuTagsProps) => {
|
|
16
|
+
// SEARCH filters get no tag: their search box already shows the value.
|
|
16
17
|
const filterTags = props.filters.reduce((tags, f) => {
|
|
17
18
|
if (f.type === "SELECT") {
|
|
18
19
|
const selectedFilters = f.options?.filter((o) => o.selected);
|
|
@@ -20,7 +21,7 @@ const Tags = (props: InfiniteScrollMenuTagsProps) => {
|
|
|
20
21
|
for (const selectedFilter of selectedFilters) {
|
|
21
22
|
tags.push(
|
|
22
23
|
<SelectFilterTag
|
|
23
|
-
key={f.filterId}
|
|
24
|
+
key={`${f.filterId}-${selectedFilter.id}`}
|
|
24
25
|
filter={f}
|
|
25
26
|
filterOption={selectedFilter}
|
|
26
27
|
filters={props.filters}
|
|
@@ -29,10 +30,10 @@ const Tags = (props: InfiniteScrollMenuTagsProps) => {
|
|
|
29
30
|
);
|
|
30
31
|
}
|
|
31
32
|
} else if (f.type === "RANGE") {
|
|
32
|
-
if (f.startValue) {
|
|
33
|
+
if (hasRangeValue(f.startValue)) {
|
|
33
34
|
tags.push(
|
|
34
35
|
<RangeFilterTag
|
|
35
|
-
key={f.filterId}
|
|
36
|
+
key={`${f.filterId}-start`}
|
|
36
37
|
filter={f}
|
|
37
38
|
filters={props.filters}
|
|
38
39
|
filterValue="startValue"
|
|
@@ -40,10 +41,10 @@ const Tags = (props: InfiniteScrollMenuTagsProps) => {
|
|
|
40
41
|
/>
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
|
-
if (f.endValue) {
|
|
44
|
+
if (hasRangeValue(f.endValue)) {
|
|
44
45
|
tags.push(
|
|
45
46
|
<RangeFilterTag
|
|
46
|
-
key={f.filterId}
|
|
47
|
+
key={`${f.filterId}-end`}
|
|
47
48
|
filter={f}
|
|
48
49
|
filters={props.filters}
|
|
49
50
|
filterValue="endValue"
|
|
@@ -51,16 +52,6 @@ const Tags = (props: InfiniteScrollMenuTagsProps) => {
|
|
|
51
52
|
/>
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
|
-
} else if (f.type === "SEARCH") {
|
|
55
|
-
if (!f.value) return tags;
|
|
56
|
-
tags.push(
|
|
57
|
-
<SearchFilterTag
|
|
58
|
-
key={f.filterId}
|
|
59
|
-
filter={f}
|
|
60
|
-
filters={props.filters}
|
|
61
|
-
handleNewFilters={props.handleNewFilters}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
55
|
} else if (f.type === "LIST") {
|
|
65
56
|
if (!f.list) return tags;
|
|
66
57
|
tags.push(
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
3
|
import IconButton from "../../../buttons/iconButton/index.js";
|
|
5
4
|
import type { TableColumn } from "../../dataTable/types.js";
|
|
6
5
|
import Table from "../../../data-display/table/index.js";
|
|
7
6
|
import { useCallback, useMemo, useState } from "react";
|
|
7
|
+
import Badge from "../../../feedback/badge/index.js";
|
|
8
8
|
import Modal from "../../../overlays/modal/index.js";
|
|
9
9
|
import Input from "../../../inputs/input/index.js";
|
|
10
10
|
import Row from "../../../layout/row/index.js";
|
|
11
11
|
import "./styles.css";
|
|
12
12
|
import {
|
|
13
|
-
faList,
|
|
14
13
|
faPenToSquare,
|
|
15
14
|
faPlus,
|
|
16
15
|
faXmark,
|
|
@@ -31,16 +30,19 @@ const ListFilterTag = (props: InfiniteScrollListFilterTagProps) => {
|
|
|
31
30
|
const [modalFilter, setModalFilter] = useState<string>("");
|
|
32
31
|
const [modalAddValues, setModalAddValues] = useState<string>("");
|
|
33
32
|
|
|
34
|
-
const handleRemove = useCallback(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
const handleRemove = useCallback(
|
|
34
|
+
(value?: string) => {
|
|
35
|
+
const newFilters = props.filters?.map((f) => {
|
|
36
|
+
if (f.type !== "LIST") return f;
|
|
37
|
+
if (f.filterId !== props.filter.filterId) return f;
|
|
38
|
+
if (value === undefined) return { ...f, list: "" };
|
|
39
|
+
const newValues = f.list.split(",").filter((v) => v !== value);
|
|
40
|
+
return { ...f, list: newValues.join(",") };
|
|
41
|
+
});
|
|
42
|
+
props.handleNewFilters(newFilters);
|
|
43
|
+
},
|
|
44
|
+
[props.filters, props.filter.filterId]
|
|
45
|
+
);
|
|
44
46
|
|
|
45
47
|
const handleAddValues = () => {
|
|
46
48
|
const newFilters = props.filters?.map((f) => {
|
|
@@ -95,13 +97,14 @@ const ListFilterTag = (props: InfiniteScrollListFilterTagProps) => {
|
|
|
95
97
|
headerElement: (t) => (
|
|
96
98
|
<span className="k-lft-modal-table-header">{t}</span>
|
|
97
99
|
),
|
|
98
|
-
cellElement: () => (
|
|
100
|
+
cellElement: (value) => (
|
|
99
101
|
<div className="k-lft-modal-table-remove-button">
|
|
100
102
|
<IconButton
|
|
101
103
|
icon={faXmark}
|
|
102
104
|
size="sm"
|
|
103
105
|
variant="danger"
|
|
104
|
-
onClick={handleRemove}
|
|
106
|
+
onClick={() => handleRemove(value)}
|
|
107
|
+
aria-label={`Remove ${value}`}
|
|
105
108
|
/>
|
|
106
109
|
</div>
|
|
107
110
|
),
|
|
@@ -111,25 +114,23 @@ const ListFilterTag = (props: InfiniteScrollListFilterTagProps) => {
|
|
|
111
114
|
);
|
|
112
115
|
|
|
113
116
|
return (
|
|
114
|
-
<div className="k-
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<IconButton icon={faXmark} onClick={handleRemove} size="sm" />
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
117
|
+
<div className="k-lft-buttons">
|
|
118
|
+
<Badge onRemove={() => handleRemove()}>
|
|
119
|
+
{props.filter.title}: {tagValue}
|
|
120
|
+
</Badge>
|
|
121
|
+
<IconButton
|
|
122
|
+
icon={faPenToSquare}
|
|
123
|
+
onClick={() => setShow(!show)}
|
|
124
|
+
size="sm"
|
|
125
|
+
variant="light"
|
|
126
|
+
aria-label={`Edit ${props.filter.title}`}
|
|
127
|
+
/>
|
|
128
128
|
<Modal show={show} onClose={handleClose} title={props.filter.title}>
|
|
129
129
|
<div className="k-lft-modal-body">
|
|
130
130
|
<Input
|
|
131
131
|
size="sm"
|
|
132
132
|
placeholder="Search"
|
|
133
|
+
aria-label="Search values"
|
|
133
134
|
value={modalFilter}
|
|
134
135
|
onChange={(e) => setModalFilter(e.target.value)}
|
|
135
136
|
/>
|
|
@@ -137,6 +138,7 @@ const ListFilterTag = (props: InfiniteScrollListFilterTagProps) => {
|
|
|
137
138
|
<Input
|
|
138
139
|
size="sm"
|
|
139
140
|
placeholder="Add new values"
|
|
141
|
+
aria-label="Add new values"
|
|
140
142
|
value={modalAddValues}
|
|
141
143
|
onChange={(e) => setModalAddValues(e.target.value)}
|
|
142
144
|
/>
|
|
@@ -145,6 +147,7 @@ const ListFilterTag = (props: InfiniteScrollListFilterTagProps) => {
|
|
|
145
147
|
icon={faPlus}
|
|
146
148
|
disabled={!allowAdd}
|
|
147
149
|
onClick={handleAddValues}
|
|
150
|
+
aria-label="Add values"
|
|
148
151
|
/>
|
|
149
152
|
</Row>
|
|
150
153
|
<div className="k-lft-modal-table-container">
|