@cryptlex/web-components 2.0.1 → 3.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 -7
- package/dist/_virtual/index.es.js +5 -0
- package/dist/_virtual/index.es.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.es.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.es.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.es.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.es.js.map +1 -0
- package/dist/components/data-table/column-picker.es.js +34 -73
- package/dist/components/data-table/column-picker.es.js.map +1 -1
- package/dist/components/data-table/data-table.es.js +106 -159
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/page-size.es.js +15 -16
- package/dist/components/data-table/page-size.es.js.map +1 -1
- package/dist/components/data-table/paginator.es.js +37 -30
- package/dist/components/data-table/paginator.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js +26 -61
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-commons.es.js +17 -17
- package/dist/components/data-table/table-commons.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +42 -43
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js +10 -11
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js.map +1 -1
- package/dist/components/data-table/table-utils/types.es.js.map +1 -1
- package/dist/components/{ui → inputs}/calendar.es.js +10 -10
- package/dist/components/inputs/calendar.es.js.map +1 -0
- package/dist/components/inputs/checkbox.es.js +27 -0
- package/dist/components/inputs/checkbox.es.js.map +1 -0
- package/dist/components/inputs/country-select.es.js +280 -0
- package/dist/components/inputs/country-select.es.js.map +1 -0
- package/dist/components/inputs/form-field.es.js +25 -0
- package/dist/components/inputs/form-field.es.js.map +1 -0
- package/dist/components/inputs/input-otp.es.js +49 -0
- package/dist/components/inputs/input-otp.es.js.map +1 -0
- package/dist/components/inputs/input.es.js +34 -0
- package/dist/components/inputs/input.es.js.map +1 -0
- package/dist/components/inputs/license-type-select.es.js +26 -0
- package/dist/components/inputs/license-type-select.es.js.map +1 -0
- package/dist/components/inputs/multi-select.es.js +57 -0
- package/dist/components/inputs/multi-select.es.js.map +1 -0
- package/dist/components/inputs/password-input.es.js +19 -0
- package/dist/components/inputs/password-input.es.js.map +1 -0
- package/dist/components/inputs/radio-group.es.js +32 -0
- package/dist/components/inputs/radio-group.es.js.map +1 -0
- package/dist/components/{ui → inputs}/search-input.es.js +7 -7
- package/dist/components/inputs/search-input.es.js.map +1 -0
- package/dist/components/inputs/select.es.js +29 -0
- package/dist/components/inputs/select.es.js.map +1 -0
- package/dist/components/inputs/textarea.es.js +35 -0
- package/dist/components/inputs/textarea.es.js.map +1 -0
- package/dist/components/key-value-card/key-value-card.es.js +32 -64
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +33 -67
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/sidebar.es.js +4 -5
- package/dist/components/sidebar/sidebar.es.js.map +1 -1
- package/dist/components/ui/accordion.es.js +29 -29
- package/dist/components/ui/accordion.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +23 -23
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/badge.es.js +4 -4
- package/dist/components/ui/badge.es.js.map +1 -1
- package/dist/components/ui/breadcrumb.es.js +8 -8
- package/dist/components/ui/breadcrumb.es.js.map +1 -1
- package/dist/components/ui/button.es.js +30 -28
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/card.es.js +7 -7
- package/dist/components/ui/card.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +24 -24
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/collapsible.es.js +5 -5
- package/dist/components/ui/collapsible.es.js.map +1 -1
- package/dist/components/ui/copy-button.es.js +18 -47
- package/dist/components/ui/copy-button.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +65 -65
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +7 -7
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +67 -92
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/label.es.js +10 -13
- package/dist/components/ui/label.es.js.map +1 -1
- package/dist/components/ui/loader.es.js +6 -6
- package/dist/components/ui/loader.es.js.map +1 -1
- package/dist/components/ui/navigation-menu.es.js +75 -75
- package/dist/components/ui/navigation-menu.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +26 -26
- package/dist/components/ui/pagination.es.js.map +1 -1
- package/dist/components/ui/popover.es.js +15 -14
- package/dist/components/ui/popover.es.js.map +1 -1
- package/dist/components/ui/separator.es.js +11 -11
- package/dist/components/ui/separator.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +50 -50
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +105 -120
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/skeleton.es.js +3 -3
- package/dist/components/ui/skeleton.es.js.map +1 -1
- package/dist/components/{static-data-table → ui}/static-data-table.es.js +2 -2
- package/dist/components/ui/static-data-table.es.js.map +1 -0
- package/dist/components/ui/table.es.js +29 -33
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +31 -31
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/components/ui/tooltip.es.js +13 -13
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +135 -188
- package/dist/index.es.js +253 -271
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.0/node_modules/@floating-ui/core/dist/floating-ui.core.es.js +530 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.0/node_modules/@floating-ui/core/dist/floating-ui.core.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.es.js +400 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.2_react-dom@18.3.1_react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +208 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.2_react-dom@18.3.1_react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +132 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.es.js +130 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.es.js +10 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.10_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-accordion/dist/index.es.js +242 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-accordion@1.2.10_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-accordion/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-arrow/dist/index.es.js +25 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-avatar/dist/index.es.js +78 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-avatar/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.10_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-collapsible/dist/index.es.js +122 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.10_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-collapsible/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-collection/dist/index.es.js +50 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-collection/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.es.js +30 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.es.js +71 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.13_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dialog/dist/index.es.js +264 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.13_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dialog/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.es.js +11 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-direction/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +129 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.14_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dropdown-menu/dist/index.es.js +229 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.14_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-dropdown-menu/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.es.js +19 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +139 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.es.js +14 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-label@2.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-label/dist/index.es.js +22 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-label@2.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-label/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.14_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-menu/dist/index.es.js +654 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.14_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-menu/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.12_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-navigation-menu/dist/index.es.js +610 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.12_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-navigation-menu/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popover@1.1.13_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-popover/dist/index.es.js +246 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popover@1.1.13_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-popover/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.es.js +222 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.8_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-portal/dist/index.es.js +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.8_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-portal/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.es.js +73 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.2_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.es.js +37 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.2_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-radio-group@1.3.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-radio-group/dist/index.es.js +241 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-radio-group@1.3.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-radio-group/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-roving-focus/dist/index.es.js +185 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.9_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-roving-focus/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-separator@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-separator/dist/index.es.js +25 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-separator@1.1.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-separator/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.es.js +61 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.11_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-tabs/dist/index.es.js +166 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.11_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-tabs/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tooltip@1.2.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.es.js +341 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-tooltip@1.2.6_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +14 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +55 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.es.js +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.es.js +16 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.es.js +7 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-previous/dist/index.es.js +9 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-previous/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.es.js +28 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.1_@types_react@18.3.21_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.2_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +33 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.2_@types_react-dom@18.3.7_@types_react@18.3.21_react-dom@18.3.1_react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.es.js +53 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.es.js +10 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.es.js +19 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.es.js +32 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchFn.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.es.js +16 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.es.js +71 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.es.js +34 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatLong.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.es.js +12 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.es.js +156 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/localize.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.es.js +111 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US/_lib/match.es.js.map +1 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.es.js +22 -0
- package/dist/node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/locale/en-US.es.js.map +1 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.es.js +8 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-day-picker@8.10.1_date-fns@3.6.0_react@18.3.1/node_modules/react-day-picker/dist/index.esm.es.js +1012 -0
- package/dist/node_modules/.pnpm/react-day-picker@8.10.1_date-fns@3.6.0_react@18.3.1/node_modules/react-day-picker/dist/index.esm.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.es.js +72 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.es.js +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.es.js +26 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.es.js +12 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.es.js +113 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/UI.es.js +32 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/UI.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.es.js +17 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.es.js +65 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/medium.es.js +6 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/medium.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.es.js +8 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.0_@types_react@18.3.21_react@18.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/component.es.js +12 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/component.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/hook.es.js +16 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/hook.es.js.map +1 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/singleton.es.js +31 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@18.3.21_react@18.3.1/node_modules/react-style-singleton/dist/es2015/singleton.es.js.map +1 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.es.js +28 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.es.js +7 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.es.js +27 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useRef.es.js +26 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@18.3.21_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useRef.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.21_react@18.3.1/node_modules/use-sidecar/dist/es2015/exports.es.js +19 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.21_react@18.3.1/node_modules/use-sidecar/dist/es2015/exports.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.21_react@18.3.1/node_modules/use-sidecar/dist/es2015/medium.es.js +68 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@18.3.21_react@18.3.1/node_modules/use-sidecar/dist/es2015/medium.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.es.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.es.js +56 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.es.js.map +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.es.js +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.es.js.map +1 -0
- package/dist/utils/form-context.es.js +8 -0
- package/dist/utils/form-context.es.js.map +1 -0
- package/dist/utils/form-hook.es.js +28 -0
- package/dist/utils/form-hook.es.js.map +1 -0
- package/dist/utils/index.es.js.map +1 -1
- package/lib/{tailwind.base.css → base.css} +0 -4
- package/lib/index.css +4 -2
- package/lib/{tailwind.theme.css → theme.css} +5 -59
- package/lib/utilities.css +77 -0
- package/package.json +43 -43
- package/dist/components/data-table/table-filter.es.js +0 -261
- package/dist/components/data-table/table-filter.es.js.map +0 -1
- package/dist/components/data-table/table-utils/link-display.es.js +0 -21
- package/dist/components/data-table/table-utils/link-display.es.js.map +0 -1
- package/dist/components/sidebar/breadcrumb.es.js +0 -58
- package/dist/components/sidebar/breadcrumb.es.js.map +0 -1
- package/dist/components/sidebar/nav-main.es.js +0 -90
- package/dist/components/sidebar/nav-main.es.js.map +0 -1
- package/dist/components/static-data-table/static-data-table.es.js.map +0 -1
- package/dist/components/ui/calendar.es.js.map +0 -1
- package/dist/components/ui/checkbox.es.js +0 -22
- package/dist/components/ui/checkbox.es.js.map +0 -1
- package/dist/components/ui/command.es.js +0 -110
- package/dist/components/ui/command.es.js.map +0 -1
- package/dist/components/ui/form.es.js +0 -94
- package/dist/components/ui/form.es.js.map +0 -1
- package/dist/components/ui/input-otp.es.js +0 -49
- package/dist/components/ui/input-otp.es.js.map +0 -1
- package/dist/components/ui/input.es.js +0 -27
- package/dist/components/ui/input.es.js.map +0 -1
- package/dist/components/ui/link-button.es.js +0 -22
- package/dist/components/ui/link-button.es.js.map +0 -1
- package/dist/components/ui/mutli-select.es.js +0 -198
- package/dist/components/ui/mutli-select.es.js.map +0 -1
- package/dist/components/ui/password-input.es.js +0 -19
- package/dist/components/ui/password-input.es.js.map +0 -1
- package/dist/components/ui/radio-group.es.js +0 -32
- package/dist/components/ui/radio-group.es.js.map +0 -1
- package/dist/components/ui/search-input.es.js.map +0 -1
- package/dist/components/ui/select.es.js +0 -99
- package/dist/components/ui/select.es.js.map +0 -1
- package/dist/components/ui/textarea.es.js +0 -19
- package/dist/components/ui/textarea.es.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,14 +4,10 @@ A React component library for Cryptlex.
|
|
|
4
4
|
|
|
5
5
|
# Usage
|
|
6
6
|
|
|
7
|
-
In your
|
|
8
|
-
|
|
9
|
-
TS
|
|
10
|
-
```ts
|
|
11
|
-
import '@cryptlex/web-components/index.css';
|
|
12
|
-
```
|
|
7
|
+
In your global CSS file, import the index.css and add the web-components as an explicit source for Tailwind.
|
|
13
8
|
|
|
14
9
|
CSS
|
|
15
10
|
```css
|
|
16
|
-
@import
|
|
11
|
+
@import '@cryptlex/web-components/index.css';
|
|
12
|
+
@source "@cryptlex/web-components";
|
|
17
13
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sync-external-store-shim.development.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sync-external-store-shim.production.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,79 +1,40 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import "../ui/
|
|
7
|
-
import "../ui/
|
|
8
|
-
import "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import "../ui/input-otp.es.js";
|
|
20
|
-
import { Label as s } from "../ui/label.es.js";
|
|
21
|
-
import "@tanstack/react-router";
|
|
22
|
-
import "../ui/mutli-select.es.js";
|
|
23
|
-
import "../ui/navigation-menu.es.js";
|
|
24
|
-
import "../ui/pagination.es.js";
|
|
25
|
-
import "../ui/password-input.es.js";
|
|
26
|
-
import { Popover as h, PopoverTrigger as f, PopoverContent as g } from "../ui/popover.es.js";
|
|
27
|
-
import "../ui/radio-group.es.js";
|
|
28
|
-
import { SearchInput as u } from "../ui/search-input.es.js";
|
|
29
|
-
import "../ui/select.es.js";
|
|
30
|
-
import "../ui/separator.es.js";
|
|
31
|
-
import "../ui/sheet.es.js";
|
|
32
|
-
import "../ui/sidebar.es.js";
|
|
33
|
-
import "sonner";
|
|
34
|
-
import "../ui/table.es.js";
|
|
35
|
-
import "../ui/tabs.es.js";
|
|
36
|
-
import "../ui/textarea.es.js";
|
|
37
|
-
import "../ui/tooltip.es.js";
|
|
38
|
-
import { getResourceDisplayName as C } from "./table-utils/constants.es.js";
|
|
39
|
-
function ie({ table: r }) {
|
|
40
|
-
const [t, p] = d(""), m = r.getAllColumns().filter(
|
|
41
|
-
(e) => e.getCanHide() && e.id.toLowerCase().includes(t.toLowerCase())
|
|
42
|
-
);
|
|
43
|
-
return /* @__PURE__ */ i(h, { children: [
|
|
44
|
-
/* @__PURE__ */ o(f, { asChild: !0, children: /* @__PURE__ */ o(c, { icon: a, variant: "outline", size: "sm", children: "Columns" }) }),
|
|
45
|
-
/* @__PURE__ */ i(g, { className: "flex flex-col gap-4 divide-y-1", children: [
|
|
46
|
-
/* @__PURE__ */ o("div", { className: " flex gap-1 justify-center items-center sticky top-0", children: /* @__PURE__ */ o(u, { value: t, onChange: (e) => p(e) }) }),
|
|
47
|
-
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
48
|
-
/* @__PURE__ */ o(
|
|
49
|
-
l,
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../utils/form-context.es.js";
|
|
4
|
+
import "../../utils/form-hook.es.js";
|
|
5
|
+
import { Columns3 as m } from "lucide-react";
|
|
6
|
+
import { DropdownMenu as p, DropdownMenuTrigger as u, DropdownMenuContent as a, DropdownMenuGroup as c, DropdownMenuCheckboxItem as n } from "../ui/dropdown-menu.es.js";
|
|
7
|
+
import { Button as s } from "../ui/button.es.js";
|
|
8
|
+
import { getResourceDisplayName as h } from "./table-utils/constants.es.js";
|
|
9
|
+
function x({ toggleAllColumnsVisible: o, getIsAllColumnsVisible: t, getAllColumns: d }) {
|
|
10
|
+
return /* @__PURE__ */ i(p, { children: [
|
|
11
|
+
/* @__PURE__ */ r(u, { asChild: !0, children: /* @__PURE__ */ r(s, { icon: () => m, variant: "outline", children: "Columns" }) }),
|
|
12
|
+
/* @__PURE__ */ r(a, { children: /* @__PURE__ */ i(c, { children: [
|
|
13
|
+
/* @__PURE__ */ r(n, { className: "italic", onSelect: (e) => {
|
|
14
|
+
e.preventDefault(), o();
|
|
15
|
+
}, checked: t(), children: "(Select all)" }),
|
|
16
|
+
d().map(
|
|
17
|
+
(e) => /* @__PURE__ */ i(
|
|
18
|
+
n,
|
|
50
19
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ o(s, { className: "font-normal cursor-pointer", htmlFor: e.id, children: C(e.id, "admin-portal") })
|
|
69
|
-
] }, e.id)),
|
|
70
|
-
" ",
|
|
71
|
-
m.length === 0 && /* @__PURE__ */ o("p", { className: "text-gray-500 text-sm italic", children: "No matching columns found." })
|
|
72
|
-
] })
|
|
73
|
-
] })
|
|
20
|
+
onSelect: (l) => {
|
|
21
|
+
l.preventDefault(), e.toggleVisibility();
|
|
22
|
+
},
|
|
23
|
+
disabled: !e.getCanHide(),
|
|
24
|
+
checked: e.getIsVisible(),
|
|
25
|
+
children: [
|
|
26
|
+
e.getIsSorted(),
|
|
27
|
+
" ",
|
|
28
|
+
h(e.id, "admin-portal")
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
e.id
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
] }) })
|
|
74
35
|
] });
|
|
75
36
|
}
|
|
76
37
|
export {
|
|
77
|
-
|
|
38
|
+
x as ColumnPicker
|
|
78
39
|
};
|
|
79
40
|
//# sourceMappingURL=column-picker.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-picker.es.js","sources":["../../../lib/components/data-table/column-picker.tsx"],"sourcesContent":["import {\n Button,\n
|
|
1
|
+
{"version":3,"file":"column-picker.es.js","sources":["../../../lib/components/data-table/column-picker.tsx"],"sourcesContent":["import {\n Button,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuTrigger,\n getResourceDisplayName\n} from '@/index';\nimport type { Column } from '@tanstack/react-table';\nimport { Columns3 } from 'lucide-react';\n\nexport function ColumnPicker({ toggleAllColumnsVisible, getIsAllColumnsVisible, getAllColumns }: { toggleAllColumnsVisible: () => void; getIsAllColumnsVisible: () => boolean, getAllColumns: () => Column<any, any>[] }) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button icon={() => Columns3} variant={'outline'}>Columns</Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuGroup>\n <DropdownMenuCheckboxItem className=\"italic\" onSelect={(e) => { e.preventDefault(); toggleAllColumnsVisible(); }} checked={getIsAllColumnsVisible()}>(Select all)</DropdownMenuCheckboxItem>\n {getAllColumns().map(col =>\n <DropdownMenuCheckboxItem\n onSelect={(e) => {\n e.preventDefault();\n col.toggleVisibility()\n }}\n key={col.id}\n disabled={!col.getCanHide()}\n checked={col.getIsVisible()}>{col.getIsSorted()} {getResourceDisplayName(col.id, 'admin-portal')}</DropdownMenuCheckboxItem>\n )}\n {/* TODO getResourceDisplayName needs some review here. */}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"names":["ColumnPicker","toggleAllColumnsVisible","getIsAllColumnsVisible","getAllColumns","DropdownMenu","jsx","DropdownMenuTrigger","Button","Columns3","DropdownMenuContent","jsxs","DropdownMenuGroup","DropdownMenuCheckboxItem","col","e","getResourceDisplayName"],"mappings":";;;;;;;;AAYO,SAASA,EAAa,EAAE,yBAAAC,GAAyB,wBAAAC,GAAwB,eAAAC,KAA0I;AACxN,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAoB,SAAO,IAC1B,UAAC,gBAAAD,EAAAE,GAAA,EAAO,MAAM,MAAMC,GAAU,SAAS,WAAW,UAAA,UAAO,CAAA,GAC3D;AAAA,IACA,gBAAAH,EAACI,GACC,EAAA,UAAA,gBAAAC,EAACC,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAN,EAACO,GAAyB,EAAA,WAAU,UAAS,UAAU,CAAC,MAAM;AAAE,UAAE,eAAe,GAA2BX,EAAA;AAAA,MAAM,GAAA,SAASC,EAAuB,GAAG,UAAY,eAAA,CAAA;AAAA,MAChKC,EAAgB,EAAA;AAAA,QAAI,CACnBU,MAAA,gBAAAH;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,UAAU,CAACE,MAAM;AACf,cAAAA,EAAE,eAAe,GACjBD,EAAI,iBAAiB;AAAA,YACvB;AAAA,YAEA,UAAU,CAACA,EAAI,WAAW;AAAA,YAC1B,SAASA,EAAI,aAAa;AAAA,YAAI,UAAA;AAAA,cAAAA,EAAI,YAAY;AAAA,cAAE;AAAA,cAAEE,EAAuBF,EAAI,IAAI,cAAc;AAAA,YAAA;AAAA,UAAA;AAAA,UAF1FA,EAAI;AAAA,QAAA;AAAA,MAEwF;AAAA,IACrG,EAAA,CAEF,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,62 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import "../ui/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import "../ui/navigation-menu.es.js";
|
|
26
|
-
import "../ui/pagination.es.js";
|
|
27
|
-
import "../ui/password-input.es.js";
|
|
28
|
-
import "../ui/popover.es.js";
|
|
29
|
-
import "../ui/radio-group.es.js";
|
|
30
|
-
import "../ui/select.es.js";
|
|
31
|
-
import "../ui/separator.es.js";
|
|
32
|
-
import "../ui/sheet.es.js";
|
|
33
|
-
import "../ui/sidebar.es.js";
|
|
34
|
-
import "sonner";
|
|
35
|
-
import "../ui/table.es.js";
|
|
36
|
-
import "../ui/tabs.es.js";
|
|
37
|
-
import "../ui/textarea.es.js";
|
|
38
|
-
import { TooltipProvider as J, Tooltip as Y, TooltipTrigger as Z, TooltipContent as $ } from "../ui/tooltip.es.js";
|
|
39
|
-
import { useQuery as Q, keepPreviousData as tt } from "@tanstack/react-query";
|
|
40
|
-
import { createColumnHelper as ot, useReactTable as et, getCoreRowModel as it } from "@tanstack/react-table";
|
|
41
|
-
import { useDebounce as rt } from "use-debounce";
|
|
42
|
-
import { ColumnPicker as nt } from "./column-picker.es.js";
|
|
43
|
-
import { PageSize as at } from "./page-size.es.js";
|
|
44
|
-
import { Paginator as lt } from "./paginator.es.js";
|
|
45
|
-
import mt from "./table-actions.es.js";
|
|
46
|
-
import { TableContent as st } from "./table-content.es.js";
|
|
47
|
-
import { TABLE_CHECK_BOX_COLUMN as ct, TABLE_ID_COLUMN as pt, TABLE_DEFAULT_DATE_COLUMNS as ft } from "./table-commons.es.js";
|
|
48
|
-
import { DEFAULT_FILTERABLE_FIELDS as ut } from "./table-utils/constants.es.js";
|
|
49
|
-
const N = "actions_button";
|
|
50
|
-
function lo({
|
|
51
|
-
columns: g,
|
|
52
|
-
fetchFn: O,
|
|
53
|
-
tableName: I,
|
|
54
|
-
tableActions: h,
|
|
55
|
-
columnsToHideByDefault: S,
|
|
56
|
-
filterableFields: V
|
|
2
|
+
import { jsx as n, jsxs as c, Fragment as O } from "react/jsx-runtime";
|
|
3
|
+
import { useState as z, useEffect as U, useMemo as M } from "react";
|
|
4
|
+
import "../../utils/form-context.es.js";
|
|
5
|
+
import "../../utils/form-hook.es.js";
|
|
6
|
+
import { useQuery as H, keepPreviousData as K } from "@tanstack/react-query";
|
|
7
|
+
import { createColumnHelper as j, useReactTable as k, getCoreRowModel as q } from "@tanstack/react-table";
|
|
8
|
+
import { Info as B } from "lucide-react";
|
|
9
|
+
import { useDebounce as G } from "use-debounce";
|
|
10
|
+
import { ColumnPicker as Q } from "./column-picker.es.js";
|
|
11
|
+
import { PageSize as W } from "./page-size.es.js";
|
|
12
|
+
import { Paginator as X } from "./paginator.es.js";
|
|
13
|
+
import J from "./table-actions.es.js";
|
|
14
|
+
import { TableContent as Y } from "./table-content.es.js";
|
|
15
|
+
import { TABLE_CHECK_BOX_COLUMN as Z, TABLE_ID_COLUMN as $, TABLE_DEFAULT_DATE_COLUMNS as ee } from "./table-commons.es.js";
|
|
16
|
+
import { TooltipProvider as te, Tooltip as oe, TooltipTrigger as ne, TooltipContent as ae } from "../ui/tooltip.es.js";
|
|
17
|
+
const N = "Actions";
|
|
18
|
+
function we({
|
|
19
|
+
columns: u,
|
|
20
|
+
fetchFn: _,
|
|
21
|
+
tableName: V,
|
|
22
|
+
tableActions: d,
|
|
23
|
+
columnsToHideByDefault: p
|
|
24
|
+
// filterableFields,
|
|
57
25
|
}) {
|
|
58
|
-
var
|
|
59
|
-
const [
|
|
26
|
+
var w, P, y, x, v;
|
|
27
|
+
const [F, D] = z({
|
|
60
28
|
sorting: [],
|
|
61
29
|
// Sorting state
|
|
62
30
|
columnFilters: [],
|
|
@@ -69,148 +37,127 @@ function lo({
|
|
|
69
37
|
// Row selection state
|
|
70
38
|
pagination: { pageIndex: 0, pageSize: 20 }
|
|
71
39
|
// Pagination state
|
|
72
|
-
}),
|
|
73
|
-
|
|
74
|
-
}, { sorting:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
columnVisibility: { id: !1, updatedAt: !1, ...
|
|
40
|
+
}), i = (e) => {
|
|
41
|
+
D((t) => ({ ...t, ...e }));
|
|
42
|
+
}, { sorting: g, columnFilters: C, searching: h, columnVisibility: S, rowSelection: b, pagination: m } = F, [E] = G(h.trim(), 300);
|
|
43
|
+
U(() => {
|
|
44
|
+
i({
|
|
45
|
+
columnVisibility: { id: !1, updatedAt: !1, ...p }
|
|
78
46
|
});
|
|
79
|
-
}, [
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
queryKey: [I, u, p, j, F],
|
|
85
|
-
queryFn: () => O(u, p, y.trim(), F),
|
|
86
|
-
placeholderData: tt,
|
|
47
|
+
}, [p]);
|
|
48
|
+
const a = H({
|
|
49
|
+
queryKey: [V, m, g, E],
|
|
50
|
+
queryFn: () => _(m, g, h.trim()),
|
|
51
|
+
placeholderData: K,
|
|
87
52
|
// Keep previous data while loading new data
|
|
88
53
|
retry: 0,
|
|
89
54
|
refetchOnWindowFocus: !1
|
|
90
|
-
}),
|
|
91
|
-
var
|
|
92
|
-
const
|
|
93
|
-
if (!(
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
|
|
55
|
+
}), I = j(), f = M(() => {
|
|
56
|
+
var T;
|
|
57
|
+
const e = (T = a.data) == null ? void 0 : T.data;
|
|
58
|
+
if (!(e != null && e.length)) return [];
|
|
59
|
+
const t = /* @__PURE__ */ new Set();
|
|
60
|
+
return e.forEach((r) => {
|
|
61
|
+
r.metadata && r.metadata.forEach((s) => {
|
|
62
|
+
t.add(s.key);
|
|
98
63
|
});
|
|
99
|
-
}), Array.from(
|
|
100
|
-
(
|
|
101
|
-
(
|
|
64
|
+
}), Array.from(t).map(
|
|
65
|
+
(r) => I.accessor(
|
|
66
|
+
(s) => {
|
|
102
67
|
var A;
|
|
103
|
-
const
|
|
104
|
-
return
|
|
68
|
+
const l = (A = s.metadata) == null ? void 0 : A.find((R) => R.key === r);
|
|
69
|
+
return l == null ? void 0 : l.value;
|
|
105
70
|
},
|
|
106
71
|
{
|
|
107
|
-
header: () => /* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
72
|
+
header: () => /* @__PURE__ */ n(te, { delayDuration: 0, children: /* @__PURE__ */ c(oe, { children: [
|
|
73
|
+
/* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "flex gap-1 items-center align-middle", children: [
|
|
74
|
+
r,
|
|
110
75
|
" ",
|
|
111
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ n(B, { size: 18, strokeWidth: "1px" })
|
|
112
77
|
] }) }),
|
|
113
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ n(ae, { children: "Metadata Key" })
|
|
114
79
|
] }) }),
|
|
115
80
|
// Use the metadata key as the column header
|
|
116
|
-
id:
|
|
81
|
+
id: r,
|
|
117
82
|
enableSorting: !1,
|
|
118
|
-
cell: (
|
|
119
|
-
const
|
|
120
|
-
return
|
|
83
|
+
cell: (s) => {
|
|
84
|
+
const l = s.getValue();
|
|
85
|
+
return l == null ? "" : String(l);
|
|
121
86
|
}
|
|
122
87
|
}
|
|
123
88
|
)
|
|
124
89
|
);
|
|
125
|
-
}, [(
|
|
126
|
-
...
|
|
127
|
-
|
|
128
|
-
...
|
|
129
|
-
...
|
|
130
|
-
...
|
|
131
|
-
...
|
|
132
|
-
], [
|
|
133
|
-
(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
[(L = e == null ? void 0 : e.data) == null ? void 0 : L.data, f]
|
|
138
|
-
), s = et({
|
|
139
|
-
data: ((v = e.data) == null ? void 0 : v.data) ?? [],
|
|
140
|
-
columns: _,
|
|
141
|
-
getCoreRowModel: it(),
|
|
142
|
-
rowCount: (x = e.data) == null ? void 0 : x.total,
|
|
90
|
+
}, [(w = a.data) == null ? void 0 : w.data]), L = M(() => [
|
|
91
|
+
...d.selection ? Z : [],
|
|
92
|
+
...$,
|
|
93
|
+
...u.filter((t) => t.id !== N),
|
|
94
|
+
...f.length ? f : [],
|
|
95
|
+
...ee,
|
|
96
|
+
...u.filter((t) => t.id === N)
|
|
97
|
+
], [u, f, (P = a.data) == null ? void 0 : P.data, d.selection]), o = k({
|
|
98
|
+
data: ((y = a.data) == null ? void 0 : y.data) ?? [],
|
|
99
|
+
columns: L,
|
|
100
|
+
getCoreRowModel: q(),
|
|
101
|
+
rowCount: (x = a.data) == null ? void 0 : x.total,
|
|
143
102
|
manualPagination: !0,
|
|
144
103
|
// Handle pagination manually since pagination is done server side for data tables
|
|
145
|
-
onPaginationChange: (
|
|
146
|
-
const
|
|
147
|
-
|
|
104
|
+
onPaginationChange: (e) => {
|
|
105
|
+
const t = typeof e == "function" ? e(m) : e;
|
|
106
|
+
i({ pagination: t });
|
|
148
107
|
},
|
|
149
108
|
manualSorting: !0,
|
|
150
109
|
// Handle sorting manually since sorting is done server side for data tables
|
|
151
|
-
onSortingChange: (
|
|
152
|
-
const
|
|
153
|
-
|
|
110
|
+
onSortingChange: (e) => {
|
|
111
|
+
const t = typeof e == "function" ? e(g) : e;
|
|
112
|
+
i({ sorting: t, rowSelection: {} });
|
|
154
113
|
},
|
|
155
114
|
manualFiltering: !0,
|
|
156
115
|
// Handle filtering manually since filtering is done server side for data tables
|
|
157
|
-
onGlobalFilterChange: (
|
|
158
|
-
const
|
|
159
|
-
|
|
116
|
+
onGlobalFilterChange: (e) => {
|
|
117
|
+
const t = typeof e == "function" ? e(C) : e;
|
|
118
|
+
i({ columnFilters: t });
|
|
160
119
|
},
|
|
161
|
-
onColumnVisibilityChange: (
|
|
162
|
-
const
|
|
163
|
-
|
|
120
|
+
onColumnVisibilityChange: (e) => {
|
|
121
|
+
const t = typeof e == "function" ? e(S) : e;
|
|
122
|
+
i({ columnVisibility: t });
|
|
164
123
|
},
|
|
165
|
-
onRowSelectionChange: (
|
|
166
|
-
const
|
|
167
|
-
|
|
124
|
+
onRowSelectionChange: (e) => {
|
|
125
|
+
const t = typeof e == "function" ? e(b) : e;
|
|
126
|
+
i({ rowSelection: t });
|
|
168
127
|
},
|
|
169
128
|
state: {
|
|
170
|
-
sorting:
|
|
171
|
-
columnFilters:
|
|
172
|
-
columnVisibility:
|
|
173
|
-
pagination:
|
|
174
|
-
rowSelection:
|
|
129
|
+
sorting: g,
|
|
130
|
+
columnFilters: C,
|
|
131
|
+
columnVisibility: S,
|
|
132
|
+
pagination: m,
|
|
133
|
+
rowSelection: b
|
|
175
134
|
},
|
|
176
135
|
meta: {
|
|
177
|
-
refetch:
|
|
136
|
+
refetch: a.refetch
|
|
178
137
|
}
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return /* @__PURE__ */ c(H, { children: [
|
|
184
|
-
/* @__PURE__ */ i(
|
|
185
|
-
W,
|
|
138
|
+
});
|
|
139
|
+
return /* @__PURE__ */ n(O, { children: /* @__PURE__ */ c("div", { className: "bg-card", children: [
|
|
140
|
+
/* @__PURE__ */ n(
|
|
141
|
+
J,
|
|
186
142
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
143
|
+
dataQuery: a,
|
|
144
|
+
getSelectedRowModel: o.getSelectedRowModel,
|
|
145
|
+
tableActions: d,
|
|
146
|
+
handleSearching: (e) => i({ searching: e })
|
|
190
147
|
}
|
|
191
148
|
),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
194
|
-
{
|
|
195
|
-
dataQuery: e,
|
|
196
|
-
table: s,
|
|
197
|
-
tableActions: h,
|
|
198
|
-
stateToPass: z,
|
|
199
|
-
handleSearching: (t) => a({ searching: t })
|
|
200
|
-
}
|
|
201
|
-
),
|
|
202
|
-
/* @__PURE__ */ i("div", { className: "w-full bg-card overflow-auto border-x", children: /* @__PURE__ */ i(st, { table: s, columns: _, dataQuery: e }) }),
|
|
203
|
-
/* @__PURE__ */ c("div", { className: "bg-card flex w-full justify-between border gap-4 p-4 overflow-x-auto", children: [
|
|
149
|
+
/* @__PURE__ */ n("div", { className: "w-full overflow-auto border-x", tabIndex: 0, children: /* @__PURE__ */ n(Y, { getRowModel: o.getRowModel, getHeaderGroups: o.getHeaderGroups, query: a }) }),
|
|
150
|
+
/* @__PURE__ */ c("div", { className: "flex w-full justify-between border gap-4 p-4 overflow-x-auto", children: [
|
|
204
151
|
/* @__PURE__ */ c("div", { className: "flex gap-4", children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ n(Q, { getAllColumns: o.getAllColumns, getIsAllColumnsVisible: o.getIsAllColumnsVisible, toggleAllColumnsVisible: o.toggleAllColumnsVisible }),
|
|
153
|
+
/* @__PURE__ */ n(W, { size: o.getState().pagination.pageSize, onSelect: o.setPageSize })
|
|
207
154
|
] }),
|
|
208
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ n(X, { firstPage: o.firstPage, previousPage: o.previousPage, getCanNextPage: o.getCanNextPage, getCanPreviousPage: o.getCanPreviousPage, lastPage: o.lastPage, nextPage: o.nextPage, getState: o.getState, rowCount: ((v = a.data) == null ? void 0 : v.total) ?? 0 })
|
|
209
156
|
] })
|
|
210
|
-
] });
|
|
157
|
+
] }) });
|
|
211
158
|
}
|
|
212
159
|
export {
|
|
213
160
|
N as ACTIONS_COLUMN_ID,
|
|
214
|
-
|
|
161
|
+
we as DataTable
|
|
215
162
|
};
|
|
216
163
|
//# sourceMappingURL=data-table.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/data-table/data-table.tsx"],"sourcesContent":["'use client';\nimport { TableFilter, type FilterFormType } from '@/components/data-table/table-filter';\nimport {\n DEFAULT_FILTERABLE_FIELDS,\n TABLE_CHECK_BOX_COLUMN,\n TABLE_DEFAULT_DATE_COLUMNS,\n TABLE_ID_COLUMN,\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/index';\nimport { keepPreviousData, useQuery } from '@tanstack/react-query';\nimport {\n ColumnDef,\n ColumnFiltersState,\n createColumnHelper,\n getCoreRowModel,\n PaginationState,\n SortingState,\n useReactTable,\n VisibilityState,\n} from '@tanstack/react-table';\nimport { Info } from 'lucide-react';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useDebounce } from 'use-debounce';\nimport { ColumnPicker } from './column-picker';\nimport { PageSize } from './page-size';\nimport { Paginator } from './paginator';\nimport Actions from './table-actions';\nimport { TableContent } from './table-content';\nimport type { FilterableProperties, MetadataDto, TableActions, TableFetchFn } from './table-utils';\n\n/** Reserved name for actions column */\nexport const ACTIONS_COLUMN_ID = 'actions_button';\n\n// Props type for the DataTable component\nexport interface DataTableProps<TData, TValue = any> {\n columns: ColumnDef<TData, TValue>[]; // Columns for the table\n tableName: string; // Table name used as query key\n fetchFn: TableFetchFn<TData>; // Function for fetching data from the server\n tableActions: TableActions;\n filterableFields: FilterableProperties<TData>; // Fields that can be filtered\n columnsToHideByDefault: VisibilityState; // Columns that are hidden by default\n}\nexport function DataTable<TData extends Record<string, any>, TValue = any>({\n columns,\n fetchFn,\n tableName,\n tableActions,\n columnsToHideByDefault,\n filterableFields,\n}: DataTableProps<TData, TValue>) {\n // State for managing table data and filters\n\n //TODO: This is later to be stored in url as params\n const [tableState, setTableState] = useState({\n sorting: [] as SortingState, // Sorting state\n columnFilters: [] as ColumnFiltersState, // Filters for columns\n searching: '', // Search query state\n columnVisibility: {} as VisibilityState, // Visibility of columns\n rowSelection: {}, // Row selection state\n pagination: { pageIndex: 0, pageSize: 20 } as PaginationState, // Pagination state\n });\n\n // Update table state with new values\n const updateTableState = (updates: Partial<typeof tableState>) => {\n setTableState((prev) => ({ ...prev, ...updates }));\n };\n\n // Destructuring the table state for easier access\n const { sorting, columnFilters, searching, columnVisibility, rowSelection, pagination } =\n tableState;\n\n // Debounce the search query to avoid making a request on every keystroke\n const [debouncedQuery] = useDebounce(searching.trim(), 300);\n\n // Update column visibility when columnsToHideByDefault changes\n useEffect(() => {\n updateTableState({\n columnVisibility: { id: false, updatedAt: false, ...columnsToHideByDefault },\n });\n }, [columnsToHideByDefault]);\n const [filters, setFilters] = useState<FilterFormType[]>([]);\n\n const formatedFilters = useMemo(() => {\n return filters.reduce((acc, filter) => {\n const { property, value, operator } = filter;\n if (!acc[property]) {\n acc[property] = {};\n }\n acc[property][operator] = value;\n return acc;\n }, {} as Record<string, Record<string, any>>);\n }, [filters]);\n\n // Fetch table data using the fetchFn and react-query's useQuery hook\n const dataQuery = useQuery({\n queryKey: [tableName, pagination, sorting, debouncedQuery, formatedFilters],\n queryFn: () => fetchFn(pagination, sorting, searching.trim(), formatedFilters),\n placeholderData: keepPreviousData, // Keep previous data while loading new data\n retry: 0,\n refetchOnWindowFocus: false,\n });\n\n // Create column helpers for dynamic column generation\n const columnHelper = createColumnHelper<TData>();\n const metadataColumns = useMemo<ColumnDef<TData, TValue>[]>(() => {\n const data = dataQuery.data?.data;\n if (!data?.length) return [];\n // set of all the keys present in a given view\n const allMetadataKeys = new Set<string>();\n\n // Collect all unique metadata keys\n data.forEach((row: TData) => {\n if (row.metadata) {\n row.metadata.forEach((meta: MetadataDto) => {\n allMetadataKeys.add(meta.key);\n });\n }\n });\n\n // Generate columns for all unique metadata keys\n return Array.from(allMetadataKeys).map((key) =>\n columnHelper.accessor(\n (row: TData) => {\n // Find the metadata object with the matching key\n const metadataEntry = row.metadata?.find((meta: MetadataDto) => meta.key === key);\n return metadataEntry?.value; // Return the value for the specific key\n },\n {\n header: () => (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex gap-1 items-center align-middle\">\n {key} <Info size={18} strokeWidth={'1px'} />\n </span>\n </TooltipTrigger>\n <TooltipContent>Metadata Key</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n ), // Use the metadata key as the column header\n id: key,\n enableSorting: false,\n cell: (info) => {\n const value = info.getValue();\n // Handle null/undefined values\n if (value === null || value === undefined) return '';\n // For primitive types, return the string representation\n return String(value);\n },\n },\n ),\n );\n }, [dataQuery.data?.data]);\n\n /**\n * ID,createdAt and updatedAt will be added by default for all tables\n * If selection is allowed, checkbox will be added\n * If the dto has metadata, dynamics columns for all the metadata key-value will be added(particular for a view)\n * If there are actions for the table, they will be placed fixed at the right side of table.\n */\n const extendedColumns = useMemo<ColumnDef<any, any>[]>(() => {\n const _columns = [\n ...(tableActions.selection ? TABLE_CHECK_BOX_COLUMN : []),\n ...TABLE_ID_COLUMN,\n ...columns.filter((col) => col.id !== ACTIONS_COLUMN_ID),\n ...(metadataColumns.length ? metadataColumns : []),\n ...TABLE_DEFAULT_DATE_COLUMNS,\n ...columns.filter((col) => col.id === ACTIONS_COLUMN_ID),\n ];\n\n return _columns;\n }, [columns, metadataColumns, dataQuery.data?.data, tableActions.selection]);\n\n // Get selected row data\n const rowSelectedData = useMemo(\n () => Object.entries(rowSelection).map((d: any) => dataQuery?.data?.data?.[d[0]]),\n [dataQuery?.data?.data, rowSelection],\n );\n\n // Use react-table's hook to create the table instance\n const table = useReactTable({\n data: dataQuery.data?.data ?? [],\n columns: extendedColumns,\n getCoreRowModel: getCoreRowModel(),\n rowCount: dataQuery.data?.total,\n manualPagination: true, // Handle pagination manually since pagination is done server side for data tables\n onPaginationChange: (updater) => {\n const newPagination = typeof updater === 'function' ? updater(pagination) : updater;\n updateTableState({ pagination: newPagination });\n },\n manualSorting: true, // Handle sorting manually since sorting is done server side for data tables\n onSortingChange: (updater) => {\n const newSorting = typeof updater === 'function' ? updater(sorting) : updater;\n // Reset selection when sorting.\n updateTableState({ sorting: newSorting, rowSelection: {} });\n },\n manualFiltering: true, // Handle filtering manually since filtering is done server side for data tables\n onGlobalFilterChange: (updater) => {\n const newFilters = typeof updater === 'function' ? updater(columnFilters) : updater;\n updateTableState({ columnFilters: newFilters });\n },\n onColumnVisibilityChange: (updater) => {\n const newVisibility = typeof updater === 'function' ? updater(columnVisibility) : updater;\n updateTableState({ columnVisibility: newVisibility });\n },\n onRowSelectionChange: (updater) => {\n const newSelection = typeof updater === 'function' ? updater(rowSelection) : updater;\n updateTableState({ rowSelection: newSelection });\n },\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n pagination,\n rowSelection,\n },\n meta: {\n refetch: dataQuery.refetch,\n },\n });\n const stateToPass = {\n key: '',\n stateData: rowSelectedData,\n };\n\n return (\n <>\n <TableFilter\n filterableProperties={{ ...filterableFields, ...DEFAULT_FILTERABLE_FIELDS }}\n filters={filters}\n onFiltersChange={setFilters}\n />\n\n {/* Table Actions Section */}\n <Actions\n dataQuery={dataQuery}\n table={table}\n tableActions={tableActions}\n stateToPass={stateToPass}\n handleSearching={(value) => updateTableState({ searching: value })}\n />\n\n {/* Table Content Section */}\n {/* TODO, content tabindex */}\n {/* TODO set height */}\n <div className='w-full bg-card overflow-auto border-x'>\n <TableContent table={table} columns={extendedColumns} dataQuery={dataQuery} />\n </div>\n\n {/* Table Footer Section with Pagination and Column Picker */}\n <div className=\"bg-card flex w-full justify-between border gap-4 p-4 overflow-x-auto\">\n <div className=\"flex gap-4\">\n <ColumnPicker table={table} />\n <PageSize table={table} />\n </div>\n <Paginator table={table} rowCount={dataQuery.data?.total ?? 0} />\n </div>\n </>\n );\n}\n"],"names":["ACTIONS_COLUMN_ID","DataTable","columns","fetchFn","tableName","tableActions","columnsToHideByDefault","filterableFields","tableState","setTableState","useState","updateTableState","updates","prev","sorting","columnFilters","searching","columnVisibility","rowSelection","pagination","debouncedQuery","useDebounce","useEffect","filters","setFilters","formatedFilters","useMemo","acc","filter","property","value","operator","dataQuery","useQuery","keepPreviousData","columnHelper","createColumnHelper","metadataColumns","data","_a","allMetadataKeys","row","meta","key","metadataEntry","jsx","TooltipProvider","Tooltip","TooltipTrigger","jsxs","Info","TooltipContent","info","extendedColumns","TABLE_CHECK_BOX_COLUMN","TABLE_ID_COLUMN","col","TABLE_DEFAULT_DATE_COLUMNS","_b","rowSelectedData","d","_c","table","useReactTable","_d","getCoreRowModel","_e","updater","newPagination","newSorting","newFilters","newVisibility","newSelection","stateToPass","Fragment","TableFilter","DEFAULT_FILTERABLE_FIELDS","Actions","TableContent","ColumnPicker","PageSize","Paginator","_f"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAMA,IAAoB;AAW1B,SAASC,GAA2D;AAAA,EACzE,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AACF,GAAkC;;AAIhC,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS;AAAA,IAC3C,SAAS,CAAC;AAAA;AAAA,IACV,eAAe,CAAC;AAAA;AAAA,IAChB,WAAW;AAAA;AAAA,IAC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A,CAAsB,EAC9E,CAAA;AAAA,IAGA,gBAAAiB,EAAC,OAAI,EAAA,WAAU,wEACb,UAAA;AAAA,MAAC,gBAAAA,EAAA,OAAA,EAAI,WAAU,cACb,UAAA;AAAA,QAAA,gBAAAJ,EAACkC,MAAa,OAAAjB,GAAc;AAAA,QAC5B,gBAAAjB,EAACmC,MAAS,OAAAlB,EAAc,CAAA;AAAA,MAAA,GAC1B;AAAA,wBACCmB,IAAU,EAAA,OAAAnB,GAAc,YAAUoB,IAAAlD,EAAU,SAAV,gBAAAkD,EAAgB,UAAS,EAAG,CAAA;AAAA,IAAA,EACjE,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/data-table/data-table.tsx"],"sourcesContent":["'use client';\n// import { TableFilter, type FilterFormType } from '@/components/data-table/table-filter';\nimport {\n TABLE_CHECK_BOX_COLUMN,\n TABLE_DEFAULT_DATE_COLUMNS,\n TABLE_ID_COLUMN,\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger\n} from '@/index';\nimport { keepPreviousData, useQuery } from '@tanstack/react-query';\nimport {\n ColumnDef,\n ColumnFiltersState,\n createColumnHelper,\n getCoreRowModel,\n PaginationState,\n SortingState,\n useReactTable,\n VisibilityState,\n} from '@tanstack/react-table';\nimport { Info } from 'lucide-react';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useDebounce } from 'use-debounce';\nimport { ColumnPicker } from './column-picker';\nimport { PageSize } from './page-size';\nimport { Paginator } from './paginator';\nimport Actions from './table-actions';\nimport { TableContent } from './table-content';\nimport type { MetadataDto, TableActions, TableFetchFn } from './table-utils';\n\n/** Reserved name for actions column */\nexport const ACTIONS_COLUMN_ID = 'Actions';\n\n// Props type for the DataTable component\nexport interface DataTableProps<TData, TValue = any> {\n columns: ColumnDef<TData, TValue>[]; // Columns for the table\n tableName: string; // Table name used as query key\n fetchFn: TableFetchFn<TData>; // Function for fetching data from the server\n tableActions: TableActions;\n // filterableFields: FilterableProperties<TData>; // Fields that can be filtered\n columnsToHideByDefault: VisibilityState; // Columns that are hidden by default\n}\nexport function DataTable<TData extends Record<string, any>, TValue = any>({\n columns,\n fetchFn,\n tableName,\n tableActions,\n columnsToHideByDefault,\n // filterableFields,\n}: DataTableProps<TData, TValue>) {\n // State for managing table data and filters\n\n //TODO: This is later to be stored in url as params\n const [tableState, setTableState] = useState({\n sorting: [] as SortingState, // Sorting state\n columnFilters: [] as ColumnFiltersState, // Filters for columns\n searching: '', // Search query state\n columnVisibility: {} as VisibilityState, // Visibility of columns\n rowSelection: {}, // Row selection state\n pagination: { pageIndex: 0, pageSize: 20 } as PaginationState, // Pagination state\n });\n\n // Update table state with new values\n const updateTableState = (updates: Partial<typeof tableState>) => {\n setTableState((prev) => ({ ...prev, ...updates }));\n };\n\n // Destructuring the table state for easier access\n const { sorting, columnFilters, searching, columnVisibility, rowSelection, pagination } =\n tableState;\n\n // Debounce the search query to avoid making a request on every keystroke\n const [debouncedQuery] = useDebounce(searching.trim(), 300);\n\n // Update column visibility when columnsToHideByDefault changes\n useEffect(() => {\n updateTableState({\n columnVisibility: { id: false, updatedAt: false, ...columnsToHideByDefault },\n });\n }, [columnsToHideByDefault]);\n // const [filters, setFilters] = useState<FilterFormType[]>([]);\n\n // const formatedFilters = useMemo(() => {\n // return filters.reduce((acc, filter) => {\n // const { property, value, operator } = filter;\n // if (!acc[property]) {\n // acc[property] = {};\n // }\n // acc[property][operator] = value;\n // return acc;\n // }, {} as Record<string, Record<string, any>>);\n // }, [filters]);\n\n // Fetch table data using the fetchFn and react-query's useQuery hook\n const query = useQuery({\n queryKey: [tableName, pagination, sorting, debouncedQuery],\n queryFn: () => fetchFn(pagination, sorting, searching.trim()),\n placeholderData: keepPreviousData, // Keep previous data while loading new data\n retry: 0,\n refetchOnWindowFocus: false,\n });\n\n // Create column helpers for dynamic column generation\n const columnHelper = createColumnHelper<TData>();\n const metadataColumns = useMemo<ColumnDef<TData, TValue>[]>(() => {\n const data = query.data?.data;\n if (!data?.length) return [];\n // set of all the keys present in a given view\n const allMetadataKeys = new Set<string>();\n\n // Collect all unique metadata keys\n data.forEach((row: TData) => {\n if (row.metadata) {\n row.metadata.forEach((meta: MetadataDto) => {\n allMetadataKeys.add(meta.key);\n });\n }\n });\n\n // Generate columns for all unique metadata keys\n return Array.from(allMetadataKeys).map((key) =>\n columnHelper.accessor(\n (row: TData) => {\n // Find the metadata object with the matching key\n const metadataEntry = row.metadata?.find((meta: MetadataDto) => meta.key === key);\n return metadataEntry?.value; // Return the value for the specific key\n },\n {\n header: () => (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex gap-1 items-center align-middle\">\n {key} <Info size={18} strokeWidth={'1px'} />\n </span>\n </TooltipTrigger>\n <TooltipContent>Metadata Key</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n ), // Use the metadata key as the column header\n id: key,\n enableSorting: false,\n cell: (info) => {\n const value = info.getValue();\n // Handle null/undefined values\n if (value === null || value === undefined) return '';\n // For primitive types, return the string representation\n return String(value);\n },\n },\n ),\n );\n }, [query.data?.data]);\n\n /**\n * ID,createdAt and updatedAt will be added by default for all tables\n * If selection is allowed, checkbox will be added\n * If the dto has metadata, dynamics columns for all the metadata key-value will be added(particular for a view)\n * If there are actions for the table, they will be placed fixed at the right side of table.\n */\n const extendedColumns = useMemo<ColumnDef<any, any>[]>(() => {\n const _columns = [\n ...(tableActions.selection ? TABLE_CHECK_BOX_COLUMN : []),\n ...TABLE_ID_COLUMN,\n ...columns.filter((col) => col.id !== ACTIONS_COLUMN_ID),\n ...(metadataColumns.length ? metadataColumns : []),\n ...TABLE_DEFAULT_DATE_COLUMNS,\n ...columns.filter((col) => col.id === ACTIONS_COLUMN_ID),\n ];\n\n return _columns;\n }, [columns, metadataColumns, query.data?.data, tableActions.selection]);\n\n // Use react-table's hook to create the table instance\n const table = useReactTable({\n data: query.data?.data ?? [],\n columns: extendedColumns,\n getCoreRowModel: getCoreRowModel(),\n rowCount: query.data?.total,\n manualPagination: true, // Handle pagination manually since pagination is done server side for data tables\n onPaginationChange: (updater) => {\n const newPagination = typeof updater === 'function' ? updater(pagination) : updater;\n updateTableState({ pagination: newPagination });\n },\n manualSorting: true, // Handle sorting manually since sorting is done server side for data tables\n onSortingChange: (updater) => {\n const newSorting = typeof updater === 'function' ? updater(sorting) : updater;\n // Reset selection when sorting.\n updateTableState({ sorting: newSorting, rowSelection: {} });\n },\n manualFiltering: true, // Handle filtering manually since filtering is done server side for data tables\n onGlobalFilterChange: (updater) => {\n const newFilters = typeof updater === 'function' ? updater(columnFilters) : updater;\n updateTableState({ columnFilters: newFilters });\n },\n onColumnVisibilityChange: (updater) => {\n const newVisibility = typeof updater === 'function' ? updater(columnVisibility) : updater;\n updateTableState({ columnVisibility: newVisibility });\n },\n onRowSelectionChange: (updater) => {\n const newSelection = typeof updater === 'function' ? updater(rowSelection) : updater;\n updateTableState({ rowSelection: newSelection });\n },\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n pagination,\n rowSelection,\n },\n meta: {\n refetch: query.refetch,\n },\n });\n\n return (\n <>\n {/* <TableFilter\n filterableProperties={{ ...filterableFields, ...DEFAULT_FILTERABLE_FIELDS }}\n filters={filters}\n onFiltersChange={setFilters}\n /> */}\n\n {/* Table Actions Section */}\n <div className='bg-card'>\n <Actions\n dataQuery={query}\n getSelectedRowModel={table.getSelectedRowModel}\n tableActions={tableActions}\n handleSearching={(value) => updateTableState({ searching: value })}\n />\n\n {/* The div here is necessary because TableContent is internally a <table> tag and does not respect width, height CSS */}\n <div className='w-full overflow-auto border-x' tabIndex={0}>\n <TableContent getRowModel={table.getRowModel} getHeaderGroups={table.getHeaderGroups} query={query} />\n </div>\n\n {/* Table Footer Section with Pagination and Column Picker */}\n <div className=\"flex w-full justify-between border gap-4 p-4 overflow-x-auto\">\n <div className=\"flex gap-4\">\n <ColumnPicker getAllColumns={table.getAllColumns} getIsAllColumnsVisible={table.getIsAllColumnsVisible} toggleAllColumnsVisible={table.toggleAllColumnsVisible} />\n <PageSize size={table.getState().pagination.pageSize} onSelect={table.setPageSize} />\n </div>\n <Paginator firstPage={table.firstPage} previousPage={table.previousPage} getCanNextPage={table.getCanNextPage} getCanPreviousPage={table.getCanPreviousPage} lastPage={table.lastPage} nextPage={table.nextPage} getState={table.getState} rowCount={query.data?.total ?? 0} />\n </div>\n </div>\n </>\n );\n}\n"],"names":["ACTIONS_COLUMN_ID","DataTable","columns","fetchFn","tableName","tableActions","columnsToHideByDefault","tableState","setTableState","useState","updateTableState","updates","prev","sorting","columnFilters","searching","columnVisibility","rowSelection","pagination","debouncedQuery","useDebounce","useEffect","query","useQuery","keepPreviousData","columnHelper","createColumnHelper","metadataColumns","useMemo","data","_a","allMetadataKeys","row","meta","key","metadataEntry","jsx","TooltipProvider","Tooltip","TooltipTrigger","jsxs","Info","TooltipContent","info","value","extendedColumns","TABLE_CHECK_BOX_COLUMN","TABLE_ID_COLUMN","col","TABLE_DEFAULT_DATE_COLUMNS","_b","table","useReactTable","_c","getCoreRowModel","_d","updater","newPagination","newSorting","newFilters","newVisibility","newSelection","Fragment","Actions","TableContent","ColumnPicker","PageSize","Paginator","_e"],"mappings":";;;;;;;;;;;;;;;;AAiCO,MAAMA,IAAoB;AAW1B,SAASC,GAA2D;AAAA,EACzE,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,wBAAAC;AAAA;AAEF,GAAkC;;AAIhC,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS;AAAA,IAC3C,SAAS,CAAC;AAAA;AAAA,IACV,eAAe,CAAC;AAAA;AAAA,IAChB,WAAW;AAAA;AAAA,IACX,kBAAkB,CAAC;AAAA;AAAA,IACnB,cAAc,CAAC;AAAA;AAAA,IACf,YAAY,EAAE,WAAW,GAAG,UAAU,GAAG;AAAA;AAAA,EAAA,CAC1C,GAGKC,IAAmB,CAACC,MAAwC;AAChE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