ikoncomponents 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init.js +57 -0
- package/dist/index.js +3 -116
- package/dist/utlis/copyDir.js +7 -0
- package/package.json +12 -90
- package/templates/default/hooks/use-mobile.ts +19 -0
- package/templates/default/ikonShade/accordion.tsx +66 -0
- package/templates/default/ikonShade/alert-dialog.tsx +179 -0
- package/templates/default/ikonShade/alert.tsx +66 -0
- package/templates/default/ikonShade/aspect-ratio.tsx +11 -0
- package/templates/default/ikonShade/avatar.tsx +53 -0
- package/templates/default/ikonShade/badge.tsx +49 -0
- package/templates/default/ikonShade/breadcrumb.tsx +109 -0
- package/templates/default/ikonShade/button.tsx +64 -0
- package/templates/default/ikonShade/calendar.tsx +227 -0
- package/templates/default/ikonShade/card.tsx +92 -0
- package/templates/default/ikonShade/checkbox.tsx +33 -0
- package/templates/default/ikonShade/collapsible.tsx +33 -0
- package/templates/default/ikonShade/command.tsx +184 -0
- package/templates/default/ikonShade/date-input.tsx +259 -0
- package/templates/default/ikonShade/date-range-picker.tsx +103 -0
- package/templates/default/ikonShade/dialog.tsx +143 -0
- package/templates/default/ikonShade/drawer.tsx +134 -0
- package/templates/default/ikonShade/dropdown-menu.tsx +259 -0
- package/templates/default/ikonShade/form.tsx +166 -0
- package/templates/default/ikonShade/hover-card.tsx +44 -0
- package/templates/default/ikonShade/input-otp.tsx +71 -0
- package/templates/default/ikonShade/input.tsx +22 -0
- package/templates/default/ikonShade/label.tsx +24 -0
- package/templates/default/ikonShade/navigation-menu.tsx +195 -0
- package/templates/default/ikonShade/popover.tsx +48 -0
- package/templates/default/ikonShade/progress.tsx +40 -0
- package/templates/default/ikonShade/radio-group.tsx +45 -0
- package/templates/default/ikonShade/scroll-area.tsx +58 -0
- package/templates/default/ikonShade/select.tsx +184 -0
- package/templates/default/ikonShade/separator.tsx +28 -0
- package/templates/default/ikonShade/sheet.tsx +139 -0
- package/templates/default/ikonShade/sidebar.tsx +726 -0
- package/templates/default/ikonShade/skeleton.tsx +15 -0
- package/templates/default/ikonShade/slider.tsx +64 -0
- package/templates/default/ikonShade/sonner.tsx +25 -0
- package/templates/default/ikonShade/switch.tsx +31 -0
- package/templates/default/ikonShade/table.tsx +116 -0
- package/templates/default/ikonShade/tabs.tsx +67 -0
- package/templates/default/ikonShade/textarea.tsx +18 -0
- package/templates/default/ikonShade/toggle-group.tsx +83 -0
- package/templates/default/ikonShade/toggle.tsx +47 -0
- package/templates/default/ikonShade/tooltip.tsx +65 -0
- package/templates/default/ikonShade/workflow.tsx +119 -0
- package/templates/default/ikoncomponents/action-menu/index.tsx +108 -0
- package/templates/default/ikoncomponents/action-menu/type.ts +18 -0
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +63 -0
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +65 -0
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +80 -0
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +68 -0
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +222 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +38 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +81 -0
- package/templates/default/ikoncomponents/big-calendar/index.css +879 -0
- package/templates/default/ikoncomponents/big-calendar/index.tsx +59 -0
- package/templates/default/ikoncomponents/big-calendar/type.ts +37 -0
- package/templates/default/ikoncomponents/buttons/index.tsx +127 -0
- package/templates/default/ikoncomponents/combobox-input/index.tsx +75 -0
- package/templates/default/ikoncomponents/combobox-input/type.ts +14 -0
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +242 -0
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +80 -0
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +149 -0
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +98 -0
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +119 -0
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +45 -0
- package/templates/default/ikoncomponents/data-table/function.ts +7 -0
- package/templates/default/ikoncomponents/data-table/index.tsx +549 -0
- package/templates/default/ikoncomponents/data-table/type.ts +75 -0
- package/templates/default/ikoncomponents/e-chart/index.tsx +183 -0
- package/templates/default/ikoncomponents/file-input/index.tsx +27 -0
- package/templates/default/ikoncomponents/fileUpload/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +111 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +80 -0
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +9 -0
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +27 -0
- package/{dist/ikoncomponents/form-fields/multi-combobox-input/index.js → templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx} +574 -381
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +39 -0
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +52 -0
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +7 -0
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +28 -0
- package/templates/default/ikoncomponents/form-fields/types/index.ts +46 -0
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +171 -0
- package/templates/default/ikoncomponents/icon/index.tsx +22 -0
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +19 -0
- package/{dist/ikoncomponents/image-cropper-upload/components/newCropper.js → templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx} +117 -85
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +352 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +250 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +32 -0
- package/{dist/ikoncomponents/image-cropper-upload/image-cropper/index.js → templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx} +119 -87
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +95 -0
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +117 -0
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +30 -0
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +103 -0
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +36 -0
- package/templates/default/ikoncomponents/main-layout/footer.tsx +21 -0
- package/templates/default/ikoncomponents/main-layout/header.tsx +53 -0
- package/templates/default/ikoncomponents/main-layout/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +389 -0
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +103 -0
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +345 -0
- package/templates/default/ikoncomponents/no-data/index.tsx +11 -0
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +30 -0
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +49 -0
- package/templates/default/ikoncomponents/phone-input/index.tsx +72 -0
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +32 -0
- package/templates/default/ikoncomponents/search-input/index.tsx +18 -0
- package/templates/default/ikoncomponents/sheet/index.tsx +34 -0
- package/templates/default/ikoncomponents/simple-widget/index.tsx +54 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +34 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +13 -0
- package/templates/default/ikoncomponents/tabs/index.tsx +139 -0
- package/{dist/ikoncomponents/tabs/type.d.ts → templates/default/ikoncomponents/tabs/type.ts} +20 -20
- package/{dist/ikoncomponents/theme-toggle-btn/index.js → templates/default/ikoncomponents/theme-toggle-btn/index.tsx} +189 -118
- package/templates/default/ikoncomponents/title-progress/index.tsx +41 -0
- package/templates/default/ikoncomponents/tooltip/index.tsx +17 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +33 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +279 -0
- package/templates/default/ikoncomponents/upload-tab/index.tsx +237 -0
- package/templates/default/ikoncomponents/widgets/index.tsx +81 -0
- package/templates/default/ikoncomponents/widgets/type.ts +11 -0
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +16 -0
- package/{dist/index.d.ts → templates/default/index.ts} +234 -139
- package/templates/default/styles.css +1159 -0
- package/templates/default/utils/actions/account/index.ts +33 -0
- package/templates/default/utils/actions/account/type.ts +4 -0
- package/{dist/utils/actions/auth/index.js → templates/default/utils/actions/auth/index.ts} +69 -58
- package/templates/default/utils/actions/common/revalidate.ts +18 -0
- package/templates/default/utils/actions/common/type.ts +4 -0
- package/{dist/utils/actions/common/utils.js → templates/default/utils/actions/common/utils.ts} +28 -25
- package/templates/default/utils/actions/software/index.ts +106 -0
- package/templates/default/utils/api/accountService/index.ts +103 -0
- package/templates/default/utils/api/accountService/type.ts +4 -0
- package/templates/default/utils/api/file-upload/index.ts +103 -0
- package/templates/default/utils/api/file-upload/type.ts +8 -0
- package/{dist/utils/api/ikonBaseApi.js → templates/default/utils/api/ikonBaseApi.ts} +132 -104
- package/templates/default/utils/api/loginService/index.ts +108 -0
- package/{dist/utils/api/loginService/type.d.ts → templates/default/utils/api/loginService/type.ts} +35 -32
- package/templates/default/utils/api/softwareService/index.ts +356 -0
- package/templates/default/utils/api/softwareService/type.ts +62 -0
- package/{dist/utils/border-radius-provider.js → templates/default/utils/border-radius-provider.tsx} +59 -35
- package/templates/default/utils/cn.ts +6 -0
- package/{dist/utils/font-provider.js → templates/default/utils/font-provider.tsx} +61 -37
- package/templates/default/utils/session/cookieSession.ts +49 -0
- package/templates/default/utils/theme-provider/index.tsx +11 -0
- package/templates/default/utils/token-management/index.ts +115 -0
- package/templates/default/utils/token-management/types.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/ikoncomponents/action-menu/index.d.ts +0 -6
- package/dist/ikoncomponents/action-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/index.js +0 -42
- package/dist/ikoncomponents/action-menu/type.d.ts +0 -15
- package/dist/ikoncomponents/action-menu/type.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/type.js +0 -1
- package/dist/ikoncomponents/activity-sheet/index.d.ts +0 -12
- package/dist/ikoncomponents/activity-sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/activity-sheet/index.js +0 -23
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +0 -22
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +0 -30
- package/dist/ikoncomponents/alert-dialog/index.d.ts +0 -15
- package/dist/ikoncomponents/alert-dialog/index.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/index.js +0 -20
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +0 -19
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +0 -43
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +0 -6
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/index.js +0 -57
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +0 -6
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +0 -16
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +0 -39
- package/dist/ikoncomponents/big-calendar/index.d.ts +0 -4
- package/dist/ikoncomponents/big-calendar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/index.js +0 -35
- package/dist/ikoncomponents/big-calendar/type.d.ts +0 -32
- package/dist/ikoncomponents/big-calendar/type.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/type.js +0 -1
- package/dist/ikoncomponents/buttons/index.d.ts +0 -19
- package/dist/ikoncomponents/buttons/index.d.ts.map +0 -1
- package/dist/ikoncomponents/buttons/index.js +0 -38
- package/dist/ikoncomponents/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/index.js +0 -18
- package/dist/ikoncomponents/combobox-input/type.d.ts +0 -14
- package/dist/ikoncomponents/combobox-input/type.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/type.js +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +0 -22
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +0 -85
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +0 -22
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +0 -35
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +0 -38
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +0 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +0 -18
- package/dist/ikoncomponents/data-table/function.d.ts +0 -2
- package/dist/ikoncomponents/data-table/function.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/function.js +0 -6
- package/dist/ikoncomponents/data-table/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/index.js +0 -223
- package/dist/ikoncomponents/data-table/type.d.ts +0 -61
- package/dist/ikoncomponents/data-table/type.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/type.js +0 -1
- package/dist/ikoncomponents/e-chart/index.d.ts +0 -16
- package/dist/ikoncomponents/e-chart/index.d.ts.map +0 -1
- package/dist/ikoncomponents/e-chart/index.js +0 -115
- package/dist/ikoncomponents/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/file-input/index.js +0 -21
- package/dist/ikoncomponents/fileUpload/index.d.ts +0 -16
- package/dist/ikoncomponents/fileUpload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/fileUpload/index.js +0 -69
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +0 -21
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +0 -19
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +0 -26
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/date-input/index.js +0 -15
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/file-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +0 -7
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/password-input/index.js +0 -23
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/phone-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/textarea/index.js +0 -18
- package/dist/ikoncomponents/form-fields/types/index.d.ts +0 -37
- package/dist/ikoncomponents/form-fields/types/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/types/index.js +0 -1
- package/dist/ikoncomponents/glowing-effect/index.d.ts +0 -15
- package/dist/ikoncomponents/glowing-effect/index.d.ts.map +0 -1
- package/dist/ikoncomponents/glowing-effect/index.js +0 -84
- package/dist/ikoncomponents/icon/index.d.ts +0 -9
- package/dist/ikoncomponents/icon/index.d.ts.map +0 -1
- package/dist/ikoncomponents/icon/index.js +0 -23
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +0 -16
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +0 -8
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +0 -145
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +0 -92
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +0 -14
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +0 -15
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +0 -28
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.js +0 -49
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +0 -17
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +0 -73
- package/dist/ikoncomponents/loading-spinner/index.d.ts +0 -10
- package/dist/ikoncomponents/loading-spinner/index.d.ts.map +0 -1
- package/dist/ikoncomponents/loading-spinner/index.js +0 -19
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +0 -11
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/RefreshContext.js +0 -17
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +0 -34
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +0 -52
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/app-sidebar.js +0 -24
- package/dist/ikoncomponents/main-layout/footer.d.ts +0 -2
- package/dist/ikoncomponents/main-layout/footer.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/footer.js +0 -5
- package/dist/ikoncomponents/main-layout/header.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/header.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/header.js +0 -15
- package/dist/ikoncomponents/main-layout/index.d.ts +0 -7
- package/dist/ikoncomponents/main-layout/index.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/index.js +0 -12
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +0 -61
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/main-sidebar.js +0 -119
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +0 -12
- package/dist/ikoncomponents/main-layout/nav-main.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/nav-main.js +0 -33
- package/dist/ikoncomponents/multi-combobox/index.d.ts +0 -14
- package/dist/ikoncomponents/multi-combobox/index.d.ts.map +0 -1
- package/dist/ikoncomponents/multi-combobox/index.js +0 -202
- package/dist/ikoncomponents/no-data/index.d.ts +0 -4
- package/dist/ikoncomponents/no-data/index.d.ts.map +0 -1
- package/dist/ikoncomponents/no-data/index.js +0 -5
- package/dist/ikoncomponents/page-wrapper/index.d.ts +0 -10
- package/dist/ikoncomponents/page-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/page-wrapper/index.js +0 -7
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +0 -4
- package/dist/ikoncomponents/password-strength-meter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/password-strength-meter/index.js +0 -40
- package/dist/ikoncomponents/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/phone-input/index.js +0 -41
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +0 -7
- package/dist/ikoncomponents/provider-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/provider-wrapper/index.js +0 -10
- package/dist/ikoncomponents/search-input/index.d.ts +0 -2
- package/dist/ikoncomponents/search-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/search-input/index.js +0 -19
- package/dist/ikoncomponents/sheet/index.d.ts +0 -11
- package/dist/ikoncomponents/sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/sheet/index.js +0 -6
- package/dist/ikoncomponents/simple-widget/index.d.ts +0 -15
- package/dist/ikoncomponents/simple-widget/index.d.ts.map +0 -1
- package/dist/ikoncomponents/simple-widget/index.js +0 -14
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +0 -4
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +0 -5
- package/dist/ikoncomponents/tabs/index.d.ts +0 -3
- package/dist/ikoncomponents/tabs/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/index.js +0 -50
- package/dist/ikoncomponents/tabs/type.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/type.js +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.d.ts +0 -13
- package/dist/ikoncomponents/title-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.js +0 -10
- package/dist/ikoncomponents/tooltip/index.d.ts +0 -6
- package/dist/ikoncomponents/tooltip/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tooltip/index.js +0 -5
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts +0 -10
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.js +0 -24
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +0 -32
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/index.js +0 -143
- package/dist/ikoncomponents/upload-tab/index.d.ts +0 -2
- package/dist/ikoncomponents/upload-tab/index.d.ts.map +0 -1
- package/dist/ikoncomponents/upload-tab/index.js +0 -92
- package/dist/ikoncomponents/widgets/index.d.ts +0 -3
- package/dist/ikoncomponents/widgets/index.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/index.js +0 -14
- package/dist/ikoncomponents/widgets/type.d.ts +0 -11
- package/dist/ikoncomponents/widgets/type.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/type.js +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/work-in-progress/index.js +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/shadcn/accordion.d.ts +0 -8
- package/dist/shadcn/accordion.d.ts.map +0 -1
- package/dist/shadcn/accordion.js +0 -33
- package/dist/shadcn/alert-dialog.d.ts +0 -21
- package/dist/shadcn/alert-dialog.d.ts.map +0 -1
- package/dist/shadcn/alert-dialog.js +0 -83
- package/dist/shadcn/alert.d.ts +0 -10
- package/dist/shadcn/alert.d.ts.map +0 -1
- package/dist/shadcn/alert.js +0 -38
- package/dist/shadcn/aspect-ratio.d.ts +0 -4
- package/dist/shadcn/aspect-ratio.d.ts.map +0 -1
- package/dist/shadcn/aspect-ratio.js +0 -19
- package/dist/shadcn/avatar.d.ts +0 -7
- package/dist/shadcn/avatar.d.ts.map +0 -1
- package/dist/shadcn/avatar.js +0 -28
- package/dist/shadcn/badge.d.ts +0 -10
- package/dist/shadcn/badge.d.ts.map +0 -1
- package/dist/shadcn/badge.js +0 -35
- package/dist/shadcn/breadcrumb.d.ts +0 -12
- package/dist/shadcn/breadcrumb.d.ts.map +0 -1
- package/dist/shadcn/breadcrumb.js +0 -45
- package/dist/shadcn/button.d.ts +0 -11
- package/dist/shadcn/button.d.ts.map +0 -1
- package/dist/shadcn/button.js +0 -47
- package/dist/shadcn/calendar.d.ts +0 -9
- package/dist/shadcn/calendar.d.ts.map +0 -1
- package/dist/shadcn/calendar.js +0 -61
- package/dist/shadcn/card.d.ts +0 -10
- package/dist/shadcn/card.d.ts.map +0 -1
- package/dist/shadcn/card.js +0 -42
- package/dist/shadcn/checkbox.d.ts +0 -5
- package/dist/shadcn/checkbox.d.ts.map +0 -1
- package/dist/shadcn/checkbox.js +0 -21
- package/dist/shadcn/collapsible.d.ts +0 -6
- package/dist/shadcn/collapsible.d.ts.map +0 -1
- package/dist/shadcn/collapsible.js +0 -27
- package/dist/shadcn/command.d.ts +0 -19
- package/dist/shadcn/command.d.ts.map +0 -1
- package/dist/shadcn/command.js +0 -54
- package/dist/shadcn/date-input.d.ts +0 -8
- package/dist/shadcn/date-input.d.ts.map +0 -1
- package/dist/shadcn/date-input.js +0 -179
- package/dist/shadcn/date-range-picker.d.ts +0 -25
- package/dist/shadcn/date-range-picker.d.ts.map +0 -1
- package/dist/shadcn/date-range-picker.js +0 -45
- package/dist/shadcn/dialog.d.ts +0 -16
- package/dist/shadcn/dialog.d.ts.map +0 -1
- package/dist/shadcn/dialog.js +0 -57
- package/dist/shadcn/drawer.d.ts +0 -14
- package/dist/shadcn/drawer.d.ts.map +0 -1
- package/dist/shadcn/drawer.js +0 -56
- package/dist/shadcn/dropdown-menu.d.ts +0 -26
- package/dist/shadcn/dropdown-menu.d.ts.map +0 -1
- package/dist/shadcn/dropdown-menu.js +0 -77
- package/dist/shadcn/form.d.ts +0 -25
- package/dist/shadcn/form.d.ts.map +0 -1
- package/dist/shadcn/form.js +0 -70
- package/dist/shadcn/hover-card.d.ts +0 -7
- package/dist/shadcn/hover-card.d.ts.map +0 -1
- package/dist/shadcn/hover-card.js +0 -28
- package/dist/shadcn/input-otp.d.ts +0 -35
- package/dist/shadcn/input-otp.d.ts.map +0 -1
- package/dist/shadcn/input-otp.js +0 -40
- package/dist/shadcn/input.d.ts +0 -4
- package/dist/shadcn/input.d.ts.map +0 -1
- package/dist/shadcn/input.js +0 -18
- package/dist/shadcn/label.d.ts +0 -5
- package/dist/shadcn/label.d.ts.map +0 -1
- package/dist/shadcn/label.js +0 -20
- package/dist/shadcn/navigation-menu.d.ts +0 -17
- package/dist/shadcn/navigation-menu.d.ts.map +0 -1
- package/dist/shadcn/navigation-menu.js +0 -74
- package/dist/shadcn/popover.d.ts +0 -8
- package/dist/shadcn/popover.d.ts.map +0 -1
- package/dist/shadcn/popover.js +0 -32
- package/dist/shadcn/progress.d.ts +0 -9
- package/dist/shadcn/progress.d.ts.map +0 -1
- package/dist/shadcn/progress.js +0 -23
- package/dist/shadcn/radio-group.d.ts +0 -6
- package/dist/shadcn/radio-group.d.ts.map +0 -1
- package/dist/shadcn/radio-group.js +0 -25
- package/dist/shadcn/scroll-area.d.ts +0 -6
- package/dist/shadcn/scroll-area.d.ts.map +0 -1
- package/dist/shadcn/scroll-area.js +0 -26
- package/dist/shadcn/select.d.ts +0 -16
- package/dist/shadcn/select.d.ts.map +0 -1
- package/dist/shadcn/select.js +0 -59
- package/dist/shadcn/separator.d.ts +0 -5
- package/dist/shadcn/separator.d.ts.map +0 -1
- package/dist/shadcn/separator.js +0 -20
- package/dist/shadcn/sheet.d.ts +0 -14
- package/dist/shadcn/sheet.d.ts.map +0 -1
- package/dist/shadcn/sheet.js +0 -61
- package/dist/shadcn/sidebar.d.ts +0 -70
- package/dist/shadcn/sidebar.d.ts.map +0 -1
- package/dist/shadcn/sidebar.js +0 -242
- package/dist/shadcn/skeleton.d.ts +0 -4
- package/dist/shadcn/skeleton.d.ts.map +0 -1
- package/dist/shadcn/skeleton.js +0 -18
- package/dist/shadcn/slider.d.ts +0 -5
- package/dist/shadcn/slider.d.ts.map +0 -1
- package/dist/shadcn/slider.js +0 -26
- package/dist/shadcn/sonner.d.ts +0 -4
- package/dist/shadcn/sonner.d.ts.map +0 -1
- package/dist/shadcn/sonner.js +0 -25
- package/dist/shadcn/switch.d.ts +0 -5
- package/dist/shadcn/switch.d.ts.map +0 -1
- package/dist/shadcn/switch.js +0 -20
- package/dist/shadcn/table.d.ts +0 -11
- package/dist/shadcn/table.d.ts.map +0 -1
- package/dist/shadcn/table.js +0 -47
- package/dist/shadcn/tabs.d.ts +0 -8
- package/dist/shadcn/tabs.d.ts.map +0 -1
- package/dist/shadcn/tabs.js +0 -32
- package/dist/shadcn/textarea.d.ts +0 -4
- package/dist/shadcn/textarea.d.ts.map +0 -1
- package/dist/shadcn/textarea.js +0 -18
- package/dist/shadcn/toggle-group.d.ts +0 -10
- package/dist/shadcn/toggle-group.d.ts.map +0 -1
- package/dist/shadcn/toggle-group.js +0 -35
- package/dist/shadcn/toggle.d.ts +0 -10
- package/dist/shadcn/toggle.d.ts.map +0 -1
- package/dist/shadcn/toggle.js +0 -38
- package/dist/shadcn/tooltip.d.ts +0 -8
- package/dist/shadcn/tooltip.d.ts.map +0 -1
- package/dist/shadcn/tooltip.js +0 -32
- package/dist/shadcn/workflow.d.ts +0 -21
- package/dist/shadcn/workflow.d.ts.map +0 -1
- package/dist/shadcn/workflow.js +0 -20
- package/dist/styles.css +0 -1302
- package/dist/utils/actions/account/index.d.ts +0 -6
- package/dist/utils/actions/account/index.d.ts.map +0 -1
- package/dist/utils/actions/account/index.js +0 -28
- package/dist/utils/actions/account/type.d.ts +0 -5
- package/dist/utils/actions/account/type.d.ts.map +0 -1
- package/dist/utils/actions/account/type.js +0 -1
- package/dist/utils/actions/auth/index.d.ts +0 -8
- package/dist/utils/actions/auth/index.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.d.ts +0 -3
- package/dist/utils/actions/common/revalidate.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.js +0 -14
- package/dist/utils/actions/common/type.d.ts +0 -5
- package/dist/utils/actions/common/type.d.ts.map +0 -1
- package/dist/utils/actions/common/type.js +0 -1
- package/dist/utils/actions/common/utils.d.ts +0 -6
- package/dist/utils/actions/common/utils.d.ts.map +0 -1
- package/dist/utils/actions/software/index.d.ts +0 -12
- package/dist/utils/actions/software/index.d.ts.map +0 -1
- package/dist/utils/actions/software/index.js +0 -75
- package/dist/utils/api/accountService/index.d.ts +0 -24
- package/dist/utils/api/accountService/index.d.ts.map +0 -1
- package/dist/utils/api/accountService/index.js +0 -64
- package/dist/utils/api/accountService/type.d.ts +0 -5
- package/dist/utils/api/accountService/type.d.ts.map +0 -1
- package/dist/utils/api/accountService/type.js +0 -1
- package/dist/utils/api/file-upload/index.d.ts +0 -6
- package/dist/utils/api/file-upload/index.d.ts.map +0 -1
- package/dist/utils/api/file-upload/index.js +0 -80
- package/dist/utils/api/file-upload/type.d.ts +0 -7
- package/dist/utils/api/file-upload/type.d.ts.map +0 -1
- package/dist/utils/api/file-upload/type.js +0 -1
- package/dist/utils/api/ikonBaseApi.d.ts +0 -13
- package/dist/utils/api/ikonBaseApi.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.d.ts +0 -13
- package/dist/utils/api/loginService/index.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.js +0 -72
- package/dist/utils/api/loginService/type.d.ts.map +0 -1
- package/dist/utils/api/loginService/type.js +0 -1
- package/dist/utils/api/softwareService/index.d.ts +0 -65
- package/dist/utils/api/softwareService/index.d.ts.map +0 -1
- package/dist/utils/api/softwareService/index.js +0 -212
- package/dist/utils/api/softwareService/type.d.ts +0 -55
- package/dist/utils/api/softwareService/type.d.ts.map +0 -1
- package/dist/utils/api/softwareService/type.js +0 -1
- package/dist/utils/border-radius-provider.d.ts +0 -12
- package/dist/utils/border-radius-provider.d.ts.map +0 -1
- package/dist/utils/cn.d.ts +0 -3
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -5
- package/dist/utils/font-provider.d.ts +0 -12
- package/dist/utils/font-provider.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.d.ts +0 -9
- package/dist/utils/session/cookieSession.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.js +0 -33
- package/dist/utils/theme-provider/index.d.ts +0 -4
- package/dist/utils/theme-provider/index.d.ts.map +0 -1
- package/dist/utils/theme-provider/index.js +0 -18
- package/dist/utils/token-management/index.d.ts +0 -11
- package/dist/utils/token-management/index.d.ts.map +0 -1
- package/dist/utils/token-management/index.js +0 -69
- package/dist/utils/token-management/types.d.ts +0 -7
- package/dist/utils/token-management/types.d.ts.map +0 -1
- package/dist/utils/token-management/types.js +0 -1
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, {
|
|
3
|
+
forwardRef,
|
|
4
|
+
useEffect,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useState,
|
|
7
|
+
} from "react";
|
|
8
|
+
import {
|
|
9
|
+
ColumnDef,
|
|
10
|
+
ColumnFiltersState,
|
|
11
|
+
SortingState,
|
|
12
|
+
VisibilityState,
|
|
13
|
+
GroupingState,
|
|
14
|
+
flexRender,
|
|
15
|
+
getCoreRowModel,
|
|
16
|
+
getFilteredRowModel,
|
|
17
|
+
getPaginationRowModel,
|
|
18
|
+
getSortedRowModel,
|
|
19
|
+
getGroupedRowModel,
|
|
20
|
+
getExpandedRowModel,
|
|
21
|
+
useReactTable,
|
|
22
|
+
getFacetedUniqueValues,
|
|
23
|
+
getFacetedMinMaxValues,
|
|
24
|
+
getFacetedRowModel,
|
|
25
|
+
Header,
|
|
26
|
+
Row,
|
|
27
|
+
PaginationState,
|
|
28
|
+
} from "@tanstack/react-table";
|
|
29
|
+
import {
|
|
30
|
+
ArrowDown,
|
|
31
|
+
ArrowDownToLine,
|
|
32
|
+
ArrowUp,
|
|
33
|
+
ArrowUpToLine,
|
|
34
|
+
ChevronDown,
|
|
35
|
+
ChevronLast,
|
|
36
|
+
ChevronRight,
|
|
37
|
+
ChevronUp,
|
|
38
|
+
X,
|
|
39
|
+
} from "lucide-react";
|
|
40
|
+
|
|
41
|
+
import { Button } from "../../ikonShade/button";
|
|
42
|
+
import {
|
|
43
|
+
Table,
|
|
44
|
+
TableBody,
|
|
45
|
+
TableCell,
|
|
46
|
+
TableFooter,
|
|
47
|
+
TableHead,
|
|
48
|
+
TableHeader,
|
|
49
|
+
TableRow,
|
|
50
|
+
} from "../../ikonShade/table";
|
|
51
|
+
import { DataTableToolbar } from "./datatable-toolbar";
|
|
52
|
+
import { getDataTableColumnTitle } from "./function";
|
|
53
|
+
import { DataTableProps, DragDropHeaderProp, DTColumnsProps } from "./type";
|
|
54
|
+
import { Checkbox } from "../../ikonShade/checkbox";
|
|
55
|
+
import { DataTablePagination } from "./datatable-pagination";
|
|
56
|
+
import { ActionMenu } from "../action-menu";
|
|
57
|
+
import { cx } from "class-variance-authority";
|
|
58
|
+
|
|
59
|
+
export const DataTable = (
|
|
60
|
+
<TData, TValue>(
|
|
61
|
+
{ columns, data, extraParams, onTableReady }: DataTableProps<TData, TValue>,
|
|
62
|
+
ref: any
|
|
63
|
+
) => {
|
|
64
|
+
const [sorting, setSorting] = React.useState<SortingState>([]);
|
|
65
|
+
const [globalFilter, setGlobalFilter] = React.useState("");
|
|
66
|
+
const [columnFilters, setColumnFilters] =
|
|
67
|
+
React.useState<ColumnFiltersState>([]);
|
|
68
|
+
|
|
69
|
+
const [pagination, setPagination] = React.useState<PaginationState>({
|
|
70
|
+
pageIndex: extraParams?.pageIndex || 0,
|
|
71
|
+
pageSize: extraParams?.pageSize || 15,
|
|
72
|
+
});
|
|
73
|
+
// useImperativeHandle(ref, () => ({
|
|
74
|
+
// toggleAllRowsExpanded: (expanded: boolean) => {
|
|
75
|
+
// table.toggleAllRowsExpanded(expanded);
|
|
76
|
+
// },
|
|
77
|
+
// getTableInstance: () => table, // Optional: Expose the entire table instance if needed
|
|
78
|
+
// }));
|
|
79
|
+
const [columnVisibility, setColumnVisibility] =
|
|
80
|
+
React.useState<VisibilityState>({});
|
|
81
|
+
const [grouping, setGrouping] = React.useState<GroupingState>([]);
|
|
82
|
+
const [expanded, setExpanded] = React.useState({});
|
|
83
|
+
const [rowSelection, setRowSelection] = React.useState({});
|
|
84
|
+
|
|
85
|
+
columns = columns.map((column: any) => {
|
|
86
|
+
if (!column?.filterFn) {
|
|
87
|
+
column.filterFn = "arrIncludesSome";
|
|
88
|
+
}
|
|
89
|
+
return column;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (extraParams?.checkBoxColumnCallback)
|
|
94
|
+
extraParams.checkBoxColumnCallback(
|
|
95
|
+
table.getFilteredSelectedRowModel().rows
|
|
96
|
+
);
|
|
97
|
+
}, [rowSelection]);
|
|
98
|
+
|
|
99
|
+
if (extraParams?.checkBoxColumn) {
|
|
100
|
+
columns.splice(0, 0, {
|
|
101
|
+
id: "checkBoxColumn",
|
|
102
|
+
header: ({ table }) => (
|
|
103
|
+
<Checkbox
|
|
104
|
+
checked={
|
|
105
|
+
table.getIsAllPageRowsSelected() ||
|
|
106
|
+
(table.getIsSomePageRowsSelected() && "indeterminate")
|
|
107
|
+
}
|
|
108
|
+
onCheckedChange={(value) =>
|
|
109
|
+
table.toggleAllPageRowsSelected(!!value)
|
|
110
|
+
}
|
|
111
|
+
aria-label="Select all"
|
|
112
|
+
/>
|
|
113
|
+
),
|
|
114
|
+
|
|
115
|
+
cell: ({ row }) => (
|
|
116
|
+
<>
|
|
117
|
+
<Checkbox
|
|
118
|
+
checked={row.getIsSelected()}
|
|
119
|
+
onCheckedChange={(value) => row.toggleSelected(!!value)}
|
|
120
|
+
aria-label="Select row"
|
|
121
|
+
/>
|
|
122
|
+
</>
|
|
123
|
+
),
|
|
124
|
+
enableSorting: false,
|
|
125
|
+
enableHiding: false,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (extraParams?.actionMenu || extraParams?.groupActionMenu) {
|
|
130
|
+
columns.push({
|
|
131
|
+
id: "DTActions",
|
|
132
|
+
accessorKey: "Actions",
|
|
133
|
+
header: () => <div className="text-center">Action</div>,
|
|
134
|
+
size: 20,
|
|
135
|
+
headerClassName: "text-center",
|
|
136
|
+
cell: ({ row }) => {
|
|
137
|
+
if (row.getIsGrouped()) {
|
|
138
|
+
return extraParams?.groupActionMenu ? (
|
|
139
|
+
<div className="text-end">
|
|
140
|
+
<ActionMenu
|
|
141
|
+
actionMenus={extraParams.groupActionMenu.items}
|
|
142
|
+
extraActionParams={{
|
|
143
|
+
arguments: [
|
|
144
|
+
row.original,
|
|
145
|
+
...(extraParams.groupActionMenu.extraArguments || []),
|
|
146
|
+
],
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
) : null;
|
|
151
|
+
} else if (extraParams?.actionMenu) {
|
|
152
|
+
return (
|
|
153
|
+
<div className="text-center">
|
|
154
|
+
<ActionMenu
|
|
155
|
+
actionMenus={extraParams.actionMenu.items}
|
|
156
|
+
extraActionParams={{
|
|
157
|
+
arguments: [
|
|
158
|
+
row.original,
|
|
159
|
+
...(extraParams.actionMenu.extraArguments || []),
|
|
160
|
+
],
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
} else {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
enableSorting: false,
|
|
170
|
+
enableHiding: false,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// const onPaginationChange = (state: any) => {
|
|
175
|
+
// console.warn(state);
|
|
176
|
+
// setPagination(state);
|
|
177
|
+
// extraParams?.onPaginationChange?.(state);
|
|
178
|
+
// }
|
|
179
|
+
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
extraParams?.onPaginationChange?.(pagination);
|
|
182
|
+
}, [pagination]);
|
|
183
|
+
|
|
184
|
+
const table = useReactTable({
|
|
185
|
+
data,
|
|
186
|
+
columns,
|
|
187
|
+
state: {
|
|
188
|
+
sorting,
|
|
189
|
+
globalFilter,
|
|
190
|
+
columnFilters,
|
|
191
|
+
columnVisibility,
|
|
192
|
+
rowSelection,
|
|
193
|
+
grouping,
|
|
194
|
+
expanded,
|
|
195
|
+
pagination,
|
|
196
|
+
},
|
|
197
|
+
onPaginationChange: setPagination,
|
|
198
|
+
onSortingChange: setSorting,
|
|
199
|
+
onExpandedChange: setExpanded,
|
|
200
|
+
onColumnFiltersChange: setColumnFilters,
|
|
201
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
202
|
+
onGroupingChange: setGrouping,
|
|
203
|
+
onGlobalFilterChange: setGlobalFilter,
|
|
204
|
+
onRowSelectionChange: setRowSelection,
|
|
205
|
+
getCoreRowModel: getCoreRowModel(),
|
|
206
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
207
|
+
getSortedRowModel: getSortedRowModel(),
|
|
208
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
209
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
210
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
211
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
212
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
213
|
+
getFacetedMinMaxValues: getFacetedMinMaxValues(),
|
|
214
|
+
manualPagination: (extraParams?.pagination == undefined || extraParams?.pagination == true) ? undefined : true
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
useImperativeHandle(ref, () => table);
|
|
218
|
+
|
|
219
|
+
const [droppedHeaders, setDroppedHeaders] = useState<DragDropHeaderProp[]>(
|
|
220
|
+
[]
|
|
221
|
+
);
|
|
222
|
+
// Drag Event Handlers
|
|
223
|
+
const handleDragStart = (
|
|
224
|
+
e: React.DragEvent<HTMLDivElement>,
|
|
225
|
+
header: Header<TData, unknown>
|
|
226
|
+
) => {
|
|
227
|
+
const headerObj = {
|
|
228
|
+
id: header.id,
|
|
229
|
+
title: getDataTableColumnTitle(header.column),
|
|
230
|
+
};
|
|
231
|
+
e.dataTransfer.setData("headerObj", JSON.stringify(headerObj));
|
|
232
|
+
e.dataTransfer.effectAllowed = "move";
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const handleDrop = (e: React.DragEvent<HTMLDivElement>) => {
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
const headerObj = JSON.parse(e.dataTransfer.getData("headerObj"));
|
|
238
|
+
if (!droppedHeaders.find((e) => e.id == headerObj.id)) {
|
|
239
|
+
setDroppedHeaders((prevHeaders) => [...prevHeaders, headerObj]);
|
|
240
|
+
const column = table.getColumn(headerObj.id);
|
|
241
|
+
if (column) {
|
|
242
|
+
column.getToggleGroupingHandler()();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
|
|
248
|
+
e.preventDefault(); // Necessary to allow dropping
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const handleRemoveGrouping = (groupId: string) => {
|
|
252
|
+
const newDroppedHeaders = droppedHeaders.filter(
|
|
253
|
+
(header) => header.id !== groupId
|
|
254
|
+
);
|
|
255
|
+
setDroppedHeaders(() => [...newDroppedHeaders]);
|
|
256
|
+
const column = table.getColumn(groupId);
|
|
257
|
+
if (column) {
|
|
258
|
+
column.getToggleGroupingHandler()();
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const [isMount, setIsMount] = useState<boolean>(false);
|
|
263
|
+
useEffect(() => {
|
|
264
|
+
if (!isMount) {
|
|
265
|
+
setIsMount(true);
|
|
266
|
+
}
|
|
267
|
+
if (extraParams?.defaultGroups) {
|
|
268
|
+
table.setGrouping(extraParams?.defaultGroups);
|
|
269
|
+
}
|
|
270
|
+
}, []);
|
|
271
|
+
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
if (onTableReady) {
|
|
274
|
+
onTableReady(table);
|
|
275
|
+
}
|
|
276
|
+
}, [onTableReady, table]);
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
isMount && (
|
|
280
|
+
<div className="w-full h-full flex flex-col gap-3 justify-between">
|
|
281
|
+
<div className="flex-grow flex flex-col gap-3 overflow-hidden">
|
|
282
|
+
{(extraParams?.defaultTools == undefined ||
|
|
283
|
+
extraParams.defaultTools ||
|
|
284
|
+
extraParams.extraTools) && (
|
|
285
|
+
<DataTableToolbar table={table} extraParams={extraParams} />
|
|
286
|
+
)}
|
|
287
|
+
|
|
288
|
+
<div className="flex-grow flex flex-col overflow-hidden">
|
|
289
|
+
{(extraParams?.grouping == undefined || extraParams.grouping) && (
|
|
290
|
+
<div
|
|
291
|
+
className="w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new"
|
|
292
|
+
onDrop={handleDrop}
|
|
293
|
+
onDragOver={handleDragOver}
|
|
294
|
+
>
|
|
295
|
+
{droppedHeaders.length === 0
|
|
296
|
+
? "Drag a column header here to group its column"
|
|
297
|
+
: droppedHeaders.map((header, index) => (
|
|
298
|
+
<div
|
|
299
|
+
key={header.id}
|
|
300
|
+
className="rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center"
|
|
301
|
+
>
|
|
302
|
+
{header.title}
|
|
303
|
+
<span onClick={() => handleRemoveGrouping(header.id)}>
|
|
304
|
+
<X size={15} />
|
|
305
|
+
</span>
|
|
306
|
+
</div>
|
|
307
|
+
))}
|
|
308
|
+
</div>
|
|
309
|
+
)}
|
|
310
|
+
<div className="flex-grow overflow-hidden">
|
|
311
|
+
<Table className="border-t whitespace-nowrap bg-card-new">
|
|
312
|
+
{(extraParams?.header == undefined || extraParams.header) && (
|
|
313
|
+
<TableHeader className="sticky top-0 z-10 border-t bg-card-new">
|
|
314
|
+
{table.getHeaderGroups().map((headerGroup) => (
|
|
315
|
+
<TableRow key={headerGroup.id} className={cx("")}>
|
|
316
|
+
{headerGroup.headers.map((header) => {
|
|
317
|
+
if (header.column.getIsGrouped()) {
|
|
318
|
+
if (
|
|
319
|
+
header.column.getGroupedIndex() <
|
|
320
|
+
droppedHeaders.length - 1
|
|
321
|
+
) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
return (
|
|
325
|
+
<TableHead
|
|
326
|
+
key={header.id}
|
|
327
|
+
colSpan={droppedHeaders.length}
|
|
328
|
+
className={cx(
|
|
329
|
+
"w-36 ",
|
|
330
|
+
"text-left"
|
|
331
|
+
)}
|
|
332
|
+
></TableHead>
|
|
333
|
+
);
|
|
334
|
+
} else {
|
|
335
|
+
return (
|
|
336
|
+
<TableHead
|
|
337
|
+
key={header.id}
|
|
338
|
+
{...(extraParams?.grouping == undefined ||
|
|
339
|
+
extraParams.grouping
|
|
340
|
+
? {
|
|
341
|
+
onDragStart: (e) =>
|
|
342
|
+
handleDragStart(e, header),
|
|
343
|
+
draggable: true,
|
|
344
|
+
}
|
|
345
|
+
: {})}
|
|
346
|
+
className={cx(
|
|
347
|
+
"text-left"
|
|
348
|
+
)}
|
|
349
|
+
>
|
|
350
|
+
{header.isPlaceholder ? null : (extraParams?.sorting ==
|
|
351
|
+
undefined ||
|
|
352
|
+
extraParams.sorting) &&
|
|
353
|
+
header.column.getCanSort() ? (
|
|
354
|
+
<div
|
|
355
|
+
onClick={header.column.getToggleSortingHandler()}
|
|
356
|
+
className={cx(
|
|
357
|
+
"-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"
|
|
358
|
+
)}
|
|
359
|
+
>
|
|
360
|
+
<div>
|
|
361
|
+
{flexRender(
|
|
362
|
+
header.column.columnDef.header,
|
|
363
|
+
header.getContext()
|
|
364
|
+
)}
|
|
365
|
+
</div>
|
|
366
|
+
{header.column.getCanSort() ? (
|
|
367
|
+
<div className="-space-y-2">
|
|
368
|
+
<ChevronUp
|
|
369
|
+
className={cx(
|
|
370
|
+
"size-3.5 text-foreground",
|
|
371
|
+
header.column.getIsSorted() ===
|
|
372
|
+
"desc"
|
|
373
|
+
? "opacity-30"
|
|
374
|
+
: ""
|
|
375
|
+
)}
|
|
376
|
+
aria-hidden="true"
|
|
377
|
+
/>
|
|
378
|
+
<ChevronDown
|
|
379
|
+
className={cx(
|
|
380
|
+
"size-3.5 text-foreground",
|
|
381
|
+
header.column.getIsSorted() ===
|
|
382
|
+
"asc"
|
|
383
|
+
? "opacity-30"
|
|
384
|
+
: ""
|
|
385
|
+
)}
|
|
386
|
+
aria-hidden="true"
|
|
387
|
+
/>
|
|
388
|
+
</div>
|
|
389
|
+
) : null}
|
|
390
|
+
</div>
|
|
391
|
+
) : (
|
|
392
|
+
flexRender(
|
|
393
|
+
header.column.columnDef.header,
|
|
394
|
+
header.getContext()
|
|
395
|
+
)
|
|
396
|
+
)}
|
|
397
|
+
</TableHead>
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
})}
|
|
401
|
+
</TableRow>
|
|
402
|
+
))}
|
|
403
|
+
</TableHeader>
|
|
404
|
+
)}
|
|
405
|
+
<TableBody>
|
|
406
|
+
{table.getRowModel().rows.length ? (
|
|
407
|
+
table.getRowModel().rows.map((row) =>
|
|
408
|
+
row.getIsGrouped() ? (
|
|
409
|
+
<TableRow key={row.id}>
|
|
410
|
+
{row.getVisibleCells().map((cell) => {
|
|
411
|
+
if (cell.column.getIndex() < row.depth) {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
return (
|
|
415
|
+
// colSpan={cell.column.getIndex() == row.depth ? row.depth + 1 : undefined}
|
|
416
|
+
<TableCell
|
|
417
|
+
key={cell.id}
|
|
418
|
+
colSpan={
|
|
419
|
+
cell.column.getIndex() == row.depth
|
|
420
|
+
? row.depth + 1
|
|
421
|
+
: undefined
|
|
422
|
+
}
|
|
423
|
+
className={
|
|
424
|
+
cell.column.getIndex() == row.depth
|
|
425
|
+
? "w-36"
|
|
426
|
+
: ""
|
|
427
|
+
}
|
|
428
|
+
>
|
|
429
|
+
{cell.getIsGrouped() ? (
|
|
430
|
+
<Button
|
|
431
|
+
variant="link"
|
|
432
|
+
onClick={row.getToggleExpandedHandler()}
|
|
433
|
+
className={`text-right text-foreground`}
|
|
434
|
+
style={{
|
|
435
|
+
marginLeft: row.depth + "rem",
|
|
436
|
+
}}
|
|
437
|
+
>
|
|
438
|
+
{row.getIsExpanded() ? (
|
|
439
|
+
<ChevronDown />
|
|
440
|
+
) : (
|
|
441
|
+
<ChevronRight />
|
|
442
|
+
)}{" "}
|
|
443
|
+
{flexRender(
|
|
444
|
+
cell.column.columnDef.cell,
|
|
445
|
+
cell.getContext()
|
|
446
|
+
)}{" "}
|
|
447
|
+
({row.subRows.length})
|
|
448
|
+
</Button>
|
|
449
|
+
) : cell.column.id == "DTActions" ? (
|
|
450
|
+
flexRender(
|
|
451
|
+
cell.column.columnDef.cell,
|
|
452
|
+
cell.getContext()
|
|
453
|
+
)
|
|
454
|
+
) : cell.getIsAggregated() ? (
|
|
455
|
+
flexRender(
|
|
456
|
+
cell.column.columnDef.aggregatedCell ??
|
|
457
|
+
cell.column.columnDef.cell,
|
|
458
|
+
cell.getContext()
|
|
459
|
+
)
|
|
460
|
+
) : cell.getIsPlaceholder() ? null : (
|
|
461
|
+
flexRender(
|
|
462
|
+
cell.column.columnDef.cell,
|
|
463
|
+
cell.getContext()
|
|
464
|
+
)
|
|
465
|
+
)}
|
|
466
|
+
</TableCell>
|
|
467
|
+
);
|
|
468
|
+
})}
|
|
469
|
+
</TableRow>
|
|
470
|
+
) : (
|
|
471
|
+
<TableRow
|
|
472
|
+
key={row.id}
|
|
473
|
+
className={cx(
|
|
474
|
+
row.getIsSelected() ? "bg-accent/10" : ""
|
|
475
|
+
)}
|
|
476
|
+
{...(extraParams?.checkBoxColumn && {
|
|
477
|
+
onClick: () =>
|
|
478
|
+
row.toggleSelected(!row.getIsSelected()),
|
|
479
|
+
})}
|
|
480
|
+
>
|
|
481
|
+
{row.getVisibleCells().map((cell, index) => (
|
|
482
|
+
<TableCell
|
|
483
|
+
key={cell.id}
|
|
484
|
+
className={cx(
|
|
485
|
+
row.getIsSelected() ? "relative" : "",
|
|
486
|
+
!(
|
|
487
|
+
extraParams?.actionMenu ||
|
|
488
|
+
extraParams?.groupActionMenu
|
|
489
|
+
) && "py-2"
|
|
490
|
+
)}
|
|
491
|
+
>
|
|
492
|
+
{index === 0 && row.getIsSelected() && (
|
|
493
|
+
<div className="absolute inset-y-0 left-0 w-0.5 bg-primary" />
|
|
494
|
+
)}
|
|
495
|
+
{cell.getIsPlaceholder()
|
|
496
|
+
? null
|
|
497
|
+
: flexRender(
|
|
498
|
+
cell.column.columnDef.cell,
|
|
499
|
+
cell.getContext()
|
|
500
|
+
)}
|
|
501
|
+
</TableCell>
|
|
502
|
+
))}
|
|
503
|
+
</TableRow>
|
|
504
|
+
)
|
|
505
|
+
)
|
|
506
|
+
) : (
|
|
507
|
+
<TableRow>
|
|
508
|
+
<TableCell
|
|
509
|
+
colSpan={columns.length}
|
|
510
|
+
className="h-24 text-center"
|
|
511
|
+
>
|
|
512
|
+
No results.
|
|
513
|
+
</TableCell>
|
|
514
|
+
</TableRow>
|
|
515
|
+
)}
|
|
516
|
+
</TableBody>
|
|
517
|
+
{extraParams?.footer && (
|
|
518
|
+
<TableFooter className="sticky bottom-0 bg-background text-foreground">
|
|
519
|
+
{table.getFooterGroups().map((group) => (
|
|
520
|
+
<TableRow>
|
|
521
|
+
{group.headers.map((header) => (
|
|
522
|
+
<TableCell>
|
|
523
|
+
{header.isPlaceholder ? null : (
|
|
524
|
+
<div className="flex items-center">
|
|
525
|
+
{flexRender(
|
|
526
|
+
header.column.columnDef.footer,
|
|
527
|
+
header.getContext()
|
|
528
|
+
)}
|
|
529
|
+
</div>
|
|
530
|
+
)}
|
|
531
|
+
</TableCell>
|
|
532
|
+
))}
|
|
533
|
+
</TableRow>
|
|
534
|
+
))}
|
|
535
|
+
</TableFooter>
|
|
536
|
+
)}
|
|
537
|
+
</Table>
|
|
538
|
+
</div>
|
|
539
|
+
</div>
|
|
540
|
+
</div>
|
|
541
|
+
{(extraParams?.paginationBar == undefined ||
|
|
542
|
+
extraParams.paginationBar) && (
|
|
543
|
+
<DataTablePagination table={table} extraParams={extraParams} />
|
|
544
|
+
)}
|
|
545
|
+
</div>
|
|
546
|
+
)
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
ColumnDef,
|
|
4
|
+
PaginationState,
|
|
5
|
+
Table,
|
|
6
|
+
} from "@tanstack/react-table";
|
|
7
|
+
import { ActionMenuProps } from "../action-menu/type";
|
|
8
|
+
|
|
9
|
+
export interface DataTableProps<TData, TValue> {
|
|
10
|
+
data: TData[];
|
|
11
|
+
columns: DTColumnsProps<TData, TValue>[];
|
|
12
|
+
extraParams?: DTExtraParamsProps;
|
|
13
|
+
onTableReady?: (table: any) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type DTColumnsProps<TData, TValue = unknown> = ColumnDef<
|
|
17
|
+
TData,
|
|
18
|
+
TValue
|
|
19
|
+
> & {
|
|
20
|
+
title?: string;
|
|
21
|
+
headerClassName?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface DTExtraParamsProps {
|
|
25
|
+
defaultGroups?: string[];
|
|
26
|
+
grouping?: boolean;
|
|
27
|
+
header?: boolean;
|
|
28
|
+
footer?: boolean;
|
|
29
|
+
defaultTools?: ("columnFilter" | "search" | "filter")[] | boolean;
|
|
30
|
+
extraTools?: any;
|
|
31
|
+
sorting?: boolean;
|
|
32
|
+
paginationBar?: boolean;
|
|
33
|
+
rowsPerPage?: boolean;
|
|
34
|
+
pagination?: boolean;
|
|
35
|
+
numberOfRows?: boolean;
|
|
36
|
+
checkBoxColumn?: boolean;
|
|
37
|
+
checkBoxColumnCallback?: (selectedRows: any[]) => void;
|
|
38
|
+
actionMenu?: DTActionMenuProps;
|
|
39
|
+
groupActionMenu?: DTActionMenuProps;
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
pageIndex?: number;
|
|
42
|
+
pageSizeArray?: number[];
|
|
43
|
+
rowSelection?: boolean;
|
|
44
|
+
onPaginationChange?: (state: PaginationState) => void;
|
|
45
|
+
defaultRowSelection?: (row: any) => boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DTActionMenuProps {
|
|
49
|
+
items: ActionMenuProps[];
|
|
50
|
+
extraArguments?: any[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DataTableViewOptionsProps<TData> {
|
|
54
|
+
table: Table<TData>;
|
|
55
|
+
}
|
|
56
|
+
export interface DTToolBarProps<TData> {
|
|
57
|
+
table: Table<TData>;
|
|
58
|
+
extraParams?: DTExtraParamsProps;
|
|
59
|
+
}
|
|
60
|
+
export interface DataTableFilterProps<TData> {
|
|
61
|
+
table: Table<TData>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface DataTableFacetedFilterProps<TData, TValue> {
|
|
65
|
+
column: Column<TData, TValue>;
|
|
66
|
+
}
|
|
67
|
+
export interface DataTablePaginationProps<TData> {
|
|
68
|
+
table: Table<TData>;
|
|
69
|
+
extraParams?: DTExtraParamsProps;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface DragDropHeaderProp {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
}
|