ikoncomponents 1.5.5 → 1.5.7
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 +36 -36
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/ikoncomponents/action-menu/index.d.ts +5 -0
- package/dist/ikoncomponents/action-menu/index.js +42 -0
- package/dist/ikoncomponents/action-menu/type.d.ts +14 -0
- package/dist/ikoncomponents/action-menu/type.js +1 -0
- package/dist/ikoncomponents/activity-sheet/index.d.ts +11 -0
- package/dist/ikoncomponents/activity-sheet/index.js +23 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +21 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +30 -0
- package/dist/ikoncomponents/alert-dialog/index.d.ts +14 -0
- package/dist/ikoncomponents/alert-dialog/index.js +20 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +18 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +43 -0
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +5 -0
- package/dist/ikoncomponents/app-breadcrumb/index.js +57 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +5 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +16 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +39 -0
- package/dist/ikoncomponents/big-calendar/index.d.ts +3 -0
- package/dist/ikoncomponents/big-calendar/index.js +35 -0
- package/dist/ikoncomponents/big-calendar/type.d.ts +31 -0
- package/dist/ikoncomponents/big-calendar/type.js +1 -0
- package/dist/ikoncomponents/buttons/index.d.ts +18 -0
- package/dist/ikoncomponents/buttons/index.js +38 -0
- package/dist/ikoncomponents/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/combobox-input/index.js +18 -0
- package/dist/ikoncomponents/combobox-input/type.d.ts +13 -0
- package/dist/ikoncomponents/combobox-input/type.js +1 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +21 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +85 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +22 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +35 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +38 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +13 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +18 -0
- package/dist/ikoncomponents/data-table/function.d.ts +1 -0
- package/dist/ikoncomponents/data-table/function.js +6 -0
- package/dist/ikoncomponents/data-table/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/index.js +223 -0
- package/dist/ikoncomponents/data-table/type.d.ts +60 -0
- package/dist/ikoncomponents/data-table/type.js +1 -0
- package/dist/ikoncomponents/e-chart/index.d.ts +15 -0
- package/dist/ikoncomponents/e-chart/index.js +115 -0
- package/dist/ikoncomponents/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/file-input/index.js +21 -0
- package/dist/ikoncomponents/fileUpload/index.d.ts +15 -0
- package/dist/ikoncomponents/fileUpload/index.js +69 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +21 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +18 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +26 -0
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/date-input/index.js +15 -0
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/file-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +6 -0
- package/{templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx → dist/ikoncomponents/form-fields/multi-combobox-input/index.js} +381 -574
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/textarea/index.js +18 -0
- package/dist/ikoncomponents/form-fields/types/index.d.ts +36 -0
- package/dist/ikoncomponents/form-fields/types/index.js +1 -0
- package/dist/ikoncomponents/glowing-effect/index.d.ts +14 -0
- package/dist/ikoncomponents/glowing-effect/index.js +84 -0
- package/dist/ikoncomponents/icon/index.d.ts +8 -0
- package/dist/ikoncomponents/icon/index.js +23 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +15 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx → dist/ikoncomponents/image-cropper-upload/components/newCropper.js} +85 -117
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +7 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +145 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +92 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +14 -0
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +14 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx → dist/ikoncomponents/image-cropper-upload/image-cropper/index.js} +87 -119
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +27 -0
- package/dist/ikoncomponents/image-cropper-upload/index.js +49 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +16 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +73 -0
- package/dist/ikoncomponents/loading-spinner/index.d.ts +9 -0
- package/dist/ikoncomponents/loading-spinner/index.js +19 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +10 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.js +17 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +33 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +52 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.js +24 -0
- package/dist/ikoncomponents/main-layout/footer.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/footer.js +5 -0
- package/dist/ikoncomponents/main-layout/header.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/header.js +15 -0
- package/dist/ikoncomponents/main-layout/index.d.ts +6 -0
- package/dist/ikoncomponents/main-layout/index.js +11 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +60 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.js +119 -0
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +11 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +33 -0
- package/dist/ikoncomponents/multi-combobox/index.d.ts +13 -0
- package/dist/ikoncomponents/multi-combobox/index.js +202 -0
- package/dist/ikoncomponents/no-data/index.d.ts +3 -0
- package/dist/ikoncomponents/no-data/index.js +5 -0
- package/dist/ikoncomponents/page-wrapper/index.d.ts +9 -0
- package/dist/ikoncomponents/page-wrapper/index.js +7 -0
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +3 -0
- package/dist/ikoncomponents/password-strength-meter/index.js +40 -0
- package/dist/ikoncomponents/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/phone-input/index.js +41 -0
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +6 -0
- package/dist/ikoncomponents/provider-wrapper/index.js +11 -0
- package/dist/ikoncomponents/search-input/index.d.ts +1 -0
- package/dist/ikoncomponents/search-input/index.js +19 -0
- package/dist/ikoncomponents/sheet/index.d.ts +10 -0
- package/dist/ikoncomponents/sheet/index.js +6 -0
- package/dist/ikoncomponents/simple-widget/index.d.ts +14 -0
- package/dist/ikoncomponents/simple-widget/index.js +14 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +5 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +6 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +3 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +5 -0
- package/dist/ikoncomponents/tabs/index.d.ts +2 -0
- package/dist/ikoncomponents/tabs/index.js +50 -0
- package/{templates/default/ikoncomponents/tabs/type.ts → dist/ikoncomponents/tabs/type.d.ts} +19 -20
- package/dist/ikoncomponents/tabs/type.js +2 -0
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -0
- package/{templates/default/ikoncomponents/theme-toggle-btn/index.tsx → dist/ikoncomponents/theme-toggle-btn/index.js} +118 -189
- package/dist/ikoncomponents/title-progress/index.d.ts +12 -0
- package/dist/ikoncomponents/title-progress/index.js +10 -0
- package/dist/ikoncomponents/tooltip/index.d.ts +5 -0
- package/dist/ikoncomponents/tooltip/index.js +5 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +31 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.js +143 -0
- package/dist/ikoncomponents/upload-tab/index.d.ts +1 -0
- package/dist/ikoncomponents/upload-tab/index.js +92 -0
- package/dist/ikoncomponents/widgets/index.d.ts +2 -0
- package/dist/ikoncomponents/widgets/index.js +14 -0
- package/dist/ikoncomponents/widgets/type.d.ts +10 -0
- package/dist/ikoncomponents/widgets/type.js +2 -0
- package/dist/ikoncomponents/work-in-progress/index.d.ts +1 -0
- package/dist/ikoncomponents/work-in-progress/index.js +4 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +116 -14
- package/dist/shadcn/accordion.d.ts +7 -0
- package/dist/shadcn/accordion.js +33 -0
- package/dist/shadcn/alert-dialog.d.ts +20 -0
- package/dist/shadcn/alert-dialog.js +83 -0
- package/dist/shadcn/alert.d.ts +9 -0
- package/dist/shadcn/alert.js +38 -0
- package/dist/shadcn/aspect-ratio.d.ts +3 -0
- package/dist/shadcn/aspect-ratio.js +19 -0
- package/dist/shadcn/avatar.d.ts +6 -0
- package/dist/shadcn/avatar.js +28 -0
- package/dist/shadcn/badge.d.ts +9 -0
- package/dist/shadcn/badge.js +35 -0
- package/dist/shadcn/breadcrumb.d.ts +11 -0
- package/dist/shadcn/breadcrumb.js +45 -0
- package/dist/shadcn/button.d.ts +10 -0
- package/dist/shadcn/button.js +47 -0
- package/dist/shadcn/calendar.d.ts +8 -0
- package/dist/shadcn/calendar.js +61 -0
- package/dist/shadcn/card.d.ts +9 -0
- package/dist/shadcn/card.js +42 -0
- package/dist/shadcn/checkbox.d.ts +4 -0
- package/dist/shadcn/checkbox.js +21 -0
- package/dist/shadcn/collapsible.d.ts +5 -0
- package/dist/shadcn/collapsible.js +27 -0
- package/dist/shadcn/command.d.ts +18 -0
- package/dist/shadcn/command.js +54 -0
- package/dist/shadcn/date-input.d.ts +7 -0
- package/dist/shadcn/date-input.js +179 -0
- package/dist/shadcn/date-range-picker.d.ts +24 -0
- package/dist/shadcn/date-range-picker.js +45 -0
- package/dist/shadcn/dialog.d.ts +15 -0
- package/dist/shadcn/dialog.js +57 -0
- package/dist/shadcn/drawer.d.ts +13 -0
- package/dist/shadcn/drawer.js +56 -0
- package/dist/shadcn/dropdown-menu.d.ts +25 -0
- package/dist/shadcn/dropdown-menu.js +77 -0
- package/dist/shadcn/form.d.ts +24 -0
- package/dist/shadcn/form.js +70 -0
- package/dist/shadcn/hover-card.d.ts +6 -0
- package/dist/shadcn/hover-card.js +28 -0
- package/dist/shadcn/input-otp.d.ts +34 -0
- package/dist/shadcn/input-otp.js +40 -0
- package/dist/shadcn/input.d.ts +3 -0
- package/dist/shadcn/input.js +18 -0
- package/dist/shadcn/label.d.ts +4 -0
- package/dist/shadcn/label.js +20 -0
- package/dist/shadcn/navigation-menu.d.ts +16 -0
- package/dist/shadcn/navigation-menu.js +74 -0
- package/dist/shadcn/popover.d.ts +7 -0
- package/dist/shadcn/popover.js +32 -0
- package/dist/shadcn/progress.d.ts +8 -0
- package/dist/shadcn/progress.js +23 -0
- package/dist/shadcn/radio-group.d.ts +5 -0
- package/dist/shadcn/radio-group.js +25 -0
- package/dist/shadcn/scroll-area.d.ts +5 -0
- package/dist/shadcn/scroll-area.js +26 -0
- package/dist/shadcn/select.d.ts +15 -0
- package/dist/shadcn/select.js +59 -0
- package/dist/shadcn/separator.d.ts +4 -0
- package/dist/shadcn/separator.js +20 -0
- package/dist/shadcn/sheet.d.ts +13 -0
- package/dist/shadcn/sheet.js +61 -0
- package/dist/shadcn/sidebar.d.ts +69 -0
- package/dist/shadcn/sidebar.js +242 -0
- package/dist/shadcn/skeleton.d.ts +3 -0
- package/dist/shadcn/skeleton.js +18 -0
- package/dist/shadcn/slider.d.ts +4 -0
- package/dist/shadcn/slider.js +26 -0
- package/dist/shadcn/sonner.d.ts +3 -0
- package/dist/shadcn/sonner.js +25 -0
- package/dist/shadcn/switch.d.ts +4 -0
- package/dist/shadcn/switch.js +20 -0
- package/dist/shadcn/table.d.ts +10 -0
- package/dist/shadcn/table.js +47 -0
- package/dist/shadcn/tabs.d.ts +7 -0
- package/dist/shadcn/tabs.js +32 -0
- package/dist/shadcn/textarea.d.ts +3 -0
- package/dist/shadcn/textarea.js +18 -0
- package/dist/shadcn/toggle-group.d.ts +9 -0
- package/dist/shadcn/toggle-group.js +35 -0
- package/dist/shadcn/toggle.d.ts +9 -0
- package/dist/shadcn/toggle.js +38 -0
- package/dist/shadcn/tooltip.d.ts +7 -0
- package/dist/shadcn/tooltip.js +32 -0
- package/dist/shadcn/workflow.d.ts +20 -0
- package/dist/shadcn/workflow.js +20 -0
- package/dist/styles.css +6163 -0
- package/dist/utils/actions/account/index.d.ts +5 -0
- package/dist/utils/actions/account/index.js +28 -0
- package/dist/utils/actions/account/type.d.ts +4 -0
- package/dist/utils/actions/account/type.js +1 -0
- package/dist/utils/actions/auth/index.d.ts +7 -0
- package/{templates/default/utils/actions/auth/index.ts → dist/utils/actions/auth/index.js} +58 -69
- package/dist/utils/actions/common/utils.d.ts +5 -0
- package/{templates/default/utils/actions/common/utils.ts → dist/utils/actions/common/utils.js} +25 -28
- package/dist/utils/actions/software/index.d.ts +11 -0
- package/dist/utils/actions/software/index.js +75 -0
- package/dist/utils/api/accountService/index.d.ts +23 -0
- package/dist/utils/api/accountService/index.js +64 -0
- package/dist/utils/api/accountService/type.d.ts +4 -0
- package/dist/utils/api/accountService/type.js +1 -0
- package/dist/utils/api/file-upload/index.d.ts +5 -0
- package/dist/utils/api/file-upload/index.js +80 -0
- package/dist/utils/api/file-upload/type.d.ts +6 -0
- package/dist/utils/api/file-upload/type.js +1 -0
- package/dist/utils/api/ikonBaseApi.d.ts +12 -0
- package/{templates/default/utils/api/ikonBaseApi.ts → dist/utils/api/ikonBaseApi.js} +104 -132
- package/dist/utils/api/loginService/index.d.ts +12 -0
- package/dist/utils/api/loginService/index.js +72 -0
- package/{templates/default/utils/api/loginService/type.ts → dist/utils/api/loginService/type.d.ts} +31 -35
- package/dist/utils/api/loginService/type.js +1 -0
- package/dist/utils/api/softwareService/index.d.ts +64 -0
- package/dist/utils/api/softwareService/index.js +212 -0
- package/dist/utils/api/softwareService/type.d.ts +54 -0
- package/dist/utils/api/softwareService/type.js +1 -0
- package/dist/utils/border-radius-provider.d.ts +11 -0
- package/{templates/default/utils/border-radius-provider.tsx → dist/utils/border-radius-provider.js} +35 -59
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +5 -0
- package/dist/utils/font-provider.d.ts +11 -0
- package/{templates/default/utils/font-provider.tsx → dist/utils/font-provider.js} +37 -61
- package/dist/utils/session/cookieSession.d.ts +8 -0
- package/dist/utils/session/cookieSession.js +33 -0
- package/dist/utils/theme-provider/index.d.ts +3 -0
- package/dist/utils/theme-provider/index.js +18 -0
- package/dist/utils/token-management/index.d.ts +10 -0
- package/dist/utils/token-management/index.js +69 -0
- package/dist/utils/token-management/types.d.ts +6 -0
- package/dist/utils/token-management/types.js +1 -0
- package/package.json +91 -17
- package/bin.js +0 -2
- package/dist/commands/init.js +0 -63
- package/dist/utlis/copyDir.js +0 -7
- package/templates/default/hooks/use-mobile.ts +0 -19
- package/templates/default/ikoncomponents/action-menu/index.tsx +0 -108
- package/templates/default/ikoncomponents/action-menu/type.ts +0 -18
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +0 -63
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +0 -65
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +0 -80
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +0 -68
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +0 -222
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +0 -38
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +0 -81
- package/templates/default/ikoncomponents/big-calendar/index.css +0 -879
- package/templates/default/ikoncomponents/big-calendar/index.tsx +0 -59
- package/templates/default/ikoncomponents/big-calendar/type.ts +0 -37
- package/templates/default/ikoncomponents/buttons/index.tsx +0 -127
- package/templates/default/ikoncomponents/combobox-input/index.tsx +0 -75
- package/templates/default/ikoncomponents/combobox-input/type.ts +0 -14
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +0 -242
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +0 -80
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +0 -149
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +0 -98
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +0 -119
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +0 -45
- package/templates/default/ikoncomponents/data-table/function.ts +0 -7
- package/templates/default/ikoncomponents/data-table/index.tsx +0 -549
- package/templates/default/ikoncomponents/data-table/type.ts +0 -75
- package/templates/default/ikoncomponents/e-chart/index.tsx +0 -183
- package/templates/default/ikoncomponents/file-input/index.tsx +0 -27
- package/templates/default/ikoncomponents/fileUpload/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +0 -111
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +0 -80
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +0 -9
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +0 -27
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +0 -39
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +0 -52
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +0 -7
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +0 -28
- package/templates/default/ikoncomponents/form-fields/types/index.ts +0 -46
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +0 -171
- package/templates/default/ikoncomponents/icon/index.tsx +0 -22
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +0 -19
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +0 -352
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +0 -250
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +0 -32
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +0 -95
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +0 -117
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +0 -43
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +0 -30
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +0 -103
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +0 -36
- package/templates/default/ikoncomponents/main-layout/footer.tsx +0 -21
- package/templates/default/ikoncomponents/main-layout/header.tsx +0 -53
- package/templates/default/ikoncomponents/main-layout/index.tsx +0 -38
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +0 -389
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +0 -103
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +0 -345
- package/templates/default/ikoncomponents/no-data/index.tsx +0 -11
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +0 -30
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +0 -49
- package/templates/default/ikoncomponents/phone-input/index.tsx +0 -72
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +0 -32
- package/templates/default/ikoncomponents/search-input/index.tsx +0 -18
- package/templates/default/ikoncomponents/sheet/index.tsx +0 -34
- package/templates/default/ikoncomponents/simple-widget/index.tsx +0 -54
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +0 -34
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +0 -13
- package/templates/default/ikoncomponents/tabs/index.tsx +0 -139
- package/templates/default/ikoncomponents/title-progress/index.tsx +0 -41
- package/templates/default/ikoncomponents/tooltip/index.tsx +0 -17
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +0 -33
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +0 -279
- package/templates/default/ikoncomponents/upload-tab/index.tsx +0 -237
- package/templates/default/ikoncomponents/widgets/index.tsx +0 -81
- package/templates/default/ikoncomponents/widgets/type.ts +0 -11
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +0 -16
- package/templates/default/shadcn/accordion.tsx +0 -66
- package/templates/default/shadcn/alert-dialog.tsx +0 -179
- package/templates/default/shadcn/alert.tsx +0 -66
- package/templates/default/shadcn/aspect-ratio.tsx +0 -11
- package/templates/default/shadcn/avatar.tsx +0 -53
- package/templates/default/shadcn/badge.tsx +0 -49
- package/templates/default/shadcn/breadcrumb.tsx +0 -109
- package/templates/default/shadcn/button.tsx +0 -64
- package/templates/default/shadcn/calendar.tsx +0 -227
- package/templates/default/shadcn/card.tsx +0 -92
- package/templates/default/shadcn/checkbox.tsx +0 -33
- package/templates/default/shadcn/collapsible.tsx +0 -33
- package/templates/default/shadcn/command.tsx +0 -184
- package/templates/default/shadcn/date-input.tsx +0 -259
- package/templates/default/shadcn/date-range-picker.tsx +0 -103
- package/templates/default/shadcn/dialog.tsx +0 -143
- package/templates/default/shadcn/drawer.tsx +0 -134
- package/templates/default/shadcn/dropdown-menu.tsx +0 -259
- package/templates/default/shadcn/form.tsx +0 -166
- package/templates/default/shadcn/hover-card.tsx +0 -44
- package/templates/default/shadcn/input-otp.tsx +0 -71
- package/templates/default/shadcn/input.tsx +0 -22
- package/templates/default/shadcn/label.tsx +0 -24
- package/templates/default/shadcn/navigation-menu.tsx +0 -195
- package/templates/default/shadcn/popover.tsx +0 -48
- package/templates/default/shadcn/progress.tsx +0 -40
- package/templates/default/shadcn/radio-group.tsx +0 -45
- package/templates/default/shadcn/scroll-area.tsx +0 -58
- package/templates/default/shadcn/select.tsx +0 -184
- package/templates/default/shadcn/separator.tsx +0 -28
- package/templates/default/shadcn/sheet.tsx +0 -139
- package/templates/default/shadcn/sidebar.tsx +0 -726
- package/templates/default/shadcn/skeleton.tsx +0 -15
- package/templates/default/shadcn/slider.tsx +0 -64
- package/templates/default/shadcn/sonner.tsx +0 -25
- package/templates/default/shadcn/switch.tsx +0 -31
- package/templates/default/shadcn/table.tsx +0 -116
- package/templates/default/shadcn/tabs.tsx +0 -67
- package/templates/default/shadcn/textarea.tsx +0 -18
- package/templates/default/shadcn/toggle-group.tsx +0 -83
- package/templates/default/shadcn/toggle.tsx +0 -47
- package/templates/default/shadcn/tooltip.tsx +0 -65
- package/templates/default/shadcn/workflow.tsx +0 -119
- package/templates/default/utils/actions/account/index.ts +0 -33
- package/templates/default/utils/actions/account/type.ts +0 -4
- package/templates/default/utils/actions/common/revalidate.ts +0 -18
- package/templates/default/utils/actions/common/type.ts +0 -4
- package/templates/default/utils/actions/software/index.ts +0 -106
- package/templates/default/utils/api/accountService/index.ts +0 -103
- package/templates/default/utils/api/accountService/type.ts +0 -4
- package/templates/default/utils/api/file-upload/index.ts +0 -103
- package/templates/default/utils/api/file-upload/type.ts +0 -8
- package/templates/default/utils/api/loginService/index.ts +0 -106
- package/templates/default/utils/api/softwareService/index.ts +0 -356
- package/templates/default/utils/api/softwareService/type.ts +0 -62
- package/templates/default/utils/cn.ts +0 -6
- package/templates/default/utils/session/cookieSession.ts +0 -49
- package/templates/default/utils/theme-provider/index.tsx +0 -11
- package/templates/default/utils/token-management/index.ts +0 -115
- package/templates/default/utils/token-management/types.ts +0 -6
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Skeleton } from "../../shadcn/skeleton";
|
|
2
|
-
|
|
3
|
-
export function SkeletonWidget({ count }: { count: number }) {
|
|
4
|
-
return (
|
|
5
|
-
<div className='flex flex-row gap-3 w-full'>
|
|
6
|
-
{count > 0 && Array.from({ length: count }).map((_, index) => (
|
|
7
|
-
<Skeleton key={'widget_' + index} className={"w-1/" + count + " flex flex-col md:flex-row gap-2 h-20"}>
|
|
8
|
-
<div className="flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"></div>
|
|
9
|
-
</Skeleton>
|
|
10
|
-
))}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { TabArray, TabProps } from "./type";
|
|
3
|
-
import {
|
|
4
|
-
Tabs as TabsComp,
|
|
5
|
-
TabsContent,
|
|
6
|
-
TabsList,
|
|
7
|
-
TabsTrigger,
|
|
8
|
-
} from "../../shadcn/tabs";
|
|
9
|
-
import {
|
|
10
|
-
DropdownMenu,
|
|
11
|
-
DropdownMenuContent,
|
|
12
|
-
DropdownMenuItem,
|
|
13
|
-
DropdownMenuTrigger,
|
|
14
|
-
} from "../../shadcn/dropdown-menu";
|
|
15
|
-
import { Ellipsis, EllipsisVertical } from "lucide-react";
|
|
16
|
-
import { TextButton } from "../buttons";
|
|
17
|
-
import { Card } from "../../shadcn/card";
|
|
18
|
-
import React, { useEffect, useState } from "react";
|
|
19
|
-
import { useIsMobile } from "../../hooks/use-mobile";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export function CustomTabs({
|
|
23
|
-
children,
|
|
24
|
-
tabArray,
|
|
25
|
-
pathName,
|
|
26
|
-
tabListClass = "",
|
|
27
|
-
tabListInnerClass = "",
|
|
28
|
-
tabListButtonClass = "",
|
|
29
|
-
tabContentClass = "",
|
|
30
|
-
headerEndComponent,
|
|
31
|
-
onTabChange,
|
|
32
|
-
isSeperatePage = false,
|
|
33
|
-
}: TabProps) {
|
|
34
|
-
// const pathName = usePathname();
|
|
35
|
-
const [itemToDisplay, setItemToDisplay] = useState<number>(5);
|
|
36
|
-
const isMobile = useIsMobile();
|
|
37
|
-
const [visibleTabs, setVisibleTabs] = useState<TabArray[]>([]);
|
|
38
|
-
const [groupedTabs, setGroupedTabs] = useState<TabArray[]>([]);
|
|
39
|
-
const [activeTab, setActiveTab] = useState<string>(
|
|
40
|
-
tabArray.find((tab) => tab.default)?.tabId || tabArray[0]?.tabId || ""
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
setItemToDisplay(isMobile ? 2 : 5);
|
|
45
|
-
}, [isMobile]);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (pathName && isSeperatePage) {
|
|
49
|
-
const lastPath = pathName.split("/").pop() || "";
|
|
50
|
-
setActiveTab(lastPath);
|
|
51
|
-
}
|
|
52
|
-
}, [pathName, isSeperatePage]);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
setVisibleTabs(tabArray.slice(0, itemToDisplay));
|
|
56
|
-
setGroupedTabs(tabArray.slice(itemToDisplay));
|
|
57
|
-
}, [tabArray, itemToDisplay]);
|
|
58
|
-
|
|
59
|
-
const handleTabChange = (tabId: string) => {
|
|
60
|
-
setActiveTab(tabId);
|
|
61
|
-
onTabChange?.(tabId);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const handleGroupedTabSelect = (tab: TabArray) => {
|
|
65
|
-
setVisibleTabs((prev) => {
|
|
66
|
-
const updatedTabs = [...prev];
|
|
67
|
-
const replacedTab = updatedTabs.pop();
|
|
68
|
-
if (replacedTab) {
|
|
69
|
-
setGroupedTabs((prevGrouped) => [
|
|
70
|
-
...prevGrouped.filter((t) => t.tabId !== tab.tabId),
|
|
71
|
-
replacedTab,
|
|
72
|
-
]);
|
|
73
|
-
}
|
|
74
|
-
return [...updatedTabs, tab];
|
|
75
|
-
});
|
|
76
|
-
handleTabChange(tab.tabId);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<TabsComp
|
|
81
|
-
value={activeTab}
|
|
82
|
-
onValueChange={handleTabChange}
|
|
83
|
-
className="w-full h-full flex flex-col"
|
|
84
|
-
>
|
|
85
|
-
<TabsList className={`flex justify-between items-center ${tabListClass}`}>
|
|
86
|
-
<div className={`flex w-full ${tabListInnerClass}`}>
|
|
87
|
-
{visibleTabs.map((tab) => (
|
|
88
|
-
<TabsTrigger
|
|
89
|
-
key={tab.tabId}
|
|
90
|
-
value={tab.tabId}
|
|
91
|
-
className={tabListButtonClass}
|
|
92
|
-
>
|
|
93
|
-
{tab.tabName}
|
|
94
|
-
</TabsTrigger>
|
|
95
|
-
))}
|
|
96
|
-
{groupedTabs.length > 0 && (
|
|
97
|
-
<DropdownMenu>
|
|
98
|
-
<DropdownMenuTrigger asChild>
|
|
99
|
-
<TextButton variant="outline" size='smIcon' className="mt-1">
|
|
100
|
-
<EllipsisVertical />
|
|
101
|
-
</TextButton>
|
|
102
|
-
</DropdownMenuTrigger>
|
|
103
|
-
<DropdownMenuContent>
|
|
104
|
-
{groupedTabs.map((tab) => (
|
|
105
|
-
<DropdownMenuItem
|
|
106
|
-
key={tab.tabId}
|
|
107
|
-
onClick={() => handleGroupedTabSelect(tab)}
|
|
108
|
-
>
|
|
109
|
-
{tab.tabName}
|
|
110
|
-
</DropdownMenuItem>
|
|
111
|
-
))}
|
|
112
|
-
</DropdownMenuContent>
|
|
113
|
-
</DropdownMenu>
|
|
114
|
-
)}
|
|
115
|
-
</div>
|
|
116
|
-
{headerEndComponent && <div>{headerEndComponent}</div>}
|
|
117
|
-
</TabsList>
|
|
118
|
-
{children ? (
|
|
119
|
-
<TabsContent
|
|
120
|
-
value={activeTab}
|
|
121
|
-
className={`mt-3 flex-grow overflow-auto h-full w-full ${tabContentClass}`}
|
|
122
|
-
>
|
|
123
|
-
<Card className="h-full w-full p-3">{children}</Card>
|
|
124
|
-
</TabsContent>
|
|
125
|
-
) : (
|
|
126
|
-
tabArray.map((tab) => (
|
|
127
|
-
<TabsContent
|
|
128
|
-
value={tab.tabId}
|
|
129
|
-
key={tab.tabId}
|
|
130
|
-
className={`mt-3 flex-grow overflow-auto h-full w-full ${tabContentClass}`}
|
|
131
|
-
>
|
|
132
|
-
|
|
133
|
-
<Card className="h-full w-full p-3">{tab?.tabContent}</Card>
|
|
134
|
-
</TabsContent>
|
|
135
|
-
))
|
|
136
|
-
)}
|
|
137
|
-
</TabsComp>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Progress } from "../../shadcn/progress";
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
title: string;
|
|
6
|
-
value: number;
|
|
7
|
-
valueText?: string;
|
|
8
|
-
isPercent?: boolean;
|
|
9
|
-
className?: string;
|
|
10
|
-
titleClassName?: string;
|
|
11
|
-
valueClassName?: string;
|
|
12
|
-
progressClassName?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function TitleProgress({ title, value, valueText, isPercent = true, className, titleClassName, valueClassName, progressClassName }: Props) {
|
|
16
|
-
let finalValue = value.toFixed(2);
|
|
17
|
-
const parts = finalValue.split('.');
|
|
18
|
-
|
|
19
|
-
if (parts[1] === '00') {
|
|
20
|
-
finalValue = parts[0];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={'w-full ' + (className ?? '')}>
|
|
25
|
-
<div className={'flex items-center justify-between gap-4'}>
|
|
26
|
-
<div className={'text-muted-foreground text-sm ' + (titleClassName ?? '')}>
|
|
27
|
-
{title}
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div className={'text-sm ' + (valueClassName ?? '')}>
|
|
31
|
-
{valueText ?? `${finalValue}${isPercent ? '%' : ''}`}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<Progress
|
|
36
|
-
value={value}
|
|
37
|
-
className={'w-full mt-2 ' + (progressClassName ?? '')}
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Tooltip as TooltipComp, TooltipContent, TooltipProvider, TooltipTrigger } from "../../shadcn/tooltip";
|
|
3
|
-
|
|
4
|
-
export function TooltipComponent({ tooltipContent, children }: { tooltipContent: string | React.ReactNode, children: React.ReactNode }) {
|
|
5
|
-
return (
|
|
6
|
-
<TooltipProvider>
|
|
7
|
-
<TooltipComp>
|
|
8
|
-
<TooltipTrigger asChild>
|
|
9
|
-
{children}
|
|
10
|
-
</TooltipTrigger>
|
|
11
|
-
<TooltipContent>
|
|
12
|
-
{tooltipContent}
|
|
13
|
-
</TooltipContent>
|
|
14
|
-
</TooltipComp>
|
|
15
|
-
</TooltipProvider>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// import { entries, parentEntries } from "./your-json";
|
|
2
|
-
type DropdownNode = {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
description: string;
|
|
6
|
-
index: string;
|
|
7
|
-
children?: DropdownNode[];
|
|
8
|
-
};
|
|
9
|
-
export function convertToDropdownNodes(entriesMap: Record<string, any>, parentEntries: any[]): DropdownNode[] {
|
|
10
|
-
const map: Record<string, DropdownNode> = {};
|
|
11
|
-
|
|
12
|
-
// Create base nodes
|
|
13
|
-
Object.values(entriesMap).forEach((entry) => {
|
|
14
|
-
map[entry.id] = {
|
|
15
|
-
id: entry.id,
|
|
16
|
-
index: entry.index,
|
|
17
|
-
title: entry.title,
|
|
18
|
-
description: entry.description,
|
|
19
|
-
children: [],
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Build tree
|
|
24
|
-
parentEntries.forEach((entry) => {
|
|
25
|
-
const node = map[entry.id];
|
|
26
|
-
entry.childrenArray?.forEach((childId: string) => {
|
|
27
|
-
node.children?.push(map[childId]);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Return top-level (no parentId)
|
|
32
|
-
return parentEntries.filter(e => !e.parentId).map(e => map[e.id]);
|
|
33
|
-
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { ChevronsUpDown } from "lucide-react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../utils/cn";
|
|
7
|
-
import { Button } from "../../shadcn/button";
|
|
8
|
-
import {
|
|
9
|
-
Command,
|
|
10
|
-
CommandEmpty,
|
|
11
|
-
CommandInput,
|
|
12
|
-
CommandItem,
|
|
13
|
-
CommandList,
|
|
14
|
-
} from "../../shadcn/command";
|
|
15
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../shadcn/popover";
|
|
16
|
-
|
|
17
|
-
export interface FrameworkEntry {
|
|
18
|
-
id: string;
|
|
19
|
-
index: string;
|
|
20
|
-
title: string;
|
|
21
|
-
description: string;
|
|
22
|
-
parentId: string | null;
|
|
23
|
-
treatAsParent: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface TreeNode extends FrameworkEntry {
|
|
27
|
-
level: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface ParentEntry extends FrameworkEntry {
|
|
31
|
-
childrenArray: string[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ProcessedFrameworkData {
|
|
35
|
-
flatTree: TreeNode[];
|
|
36
|
-
itemMap: Record<string, { parentId: string | null; childrenIds: string[] }>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface FrameworkItemDropdownProps {
|
|
40
|
-
processedData: ProcessedFrameworkData;
|
|
41
|
-
value: string[];
|
|
42
|
-
onChange: (newSelection: string[]) => void;
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
searchPlaceholder?: string;
|
|
45
|
-
className?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function FrameworkItemDropdown({
|
|
49
|
-
processedData,
|
|
50
|
-
value,
|
|
51
|
-
onChange,
|
|
52
|
-
placeholder = "Select items...",
|
|
53
|
-
searchPlaceholder = "Search...",
|
|
54
|
-
className,
|
|
55
|
-
}: FrameworkItemDropdownProps) {
|
|
56
|
-
const [open, setOpen] = React.useState(false);
|
|
57
|
-
const [searchQuery, setSearchQuery] = React.useState("");
|
|
58
|
-
|
|
59
|
-
const { flatTree, itemMap } = processedData;
|
|
60
|
-
|
|
61
|
-
const selectionState = React.useMemo(() => {
|
|
62
|
-
const state = new Map<string, "checked" | "indeterminate">();
|
|
63
|
-
const selectedSet = new Set(value);
|
|
64
|
-
|
|
65
|
-
[...flatTree].reverse().forEach((item) => {
|
|
66
|
-
const nodeInfo = itemMap[item.id];
|
|
67
|
-
if (
|
|
68
|
-
!nodeInfo ||
|
|
69
|
-
!item.treatAsParent ||
|
|
70
|
-
nodeInfo.childrenIds.length === 0
|
|
71
|
-
) {
|
|
72
|
-
if (selectedSet.has(item.id)) {
|
|
73
|
-
state.set(item.id, "checked");
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
const childStates = nodeInfo.childrenIds.map((childId) =>
|
|
77
|
-
state.get(childId)
|
|
78
|
-
);
|
|
79
|
-
const checkedCount = childStates.filter((s) => s === "checked").length;
|
|
80
|
-
const indeterminateCount = childStates.filter(
|
|
81
|
-
(s) => s === "indeterminate"
|
|
82
|
-
).length;
|
|
83
|
-
|
|
84
|
-
if (checkedCount === nodeInfo.childrenIds.length) {
|
|
85
|
-
state.set(item.id, "checked");
|
|
86
|
-
} else if (checkedCount > 0 || indeterminateCount > 0) {
|
|
87
|
-
state.set(item.id, "indeterminate");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return state;
|
|
93
|
-
}, [value, flatTree, itemMap]);
|
|
94
|
-
|
|
95
|
-
const handleSelect = (item: TreeNode) => {
|
|
96
|
-
const newSelectedIds = new Set(value);
|
|
97
|
-
const currentState = selectionState.get(item.id);
|
|
98
|
-
const shouldBeChecked = !(
|
|
99
|
-
currentState === "checked" || currentState === "indeterminate"
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const descendants = new Set<string>();
|
|
103
|
-
const queue: string[] = [...(itemMap[item.id]?.childrenIds || [])];
|
|
104
|
-
|
|
105
|
-
while (queue.length > 0) {
|
|
106
|
-
const currentId = queue.shift()!;
|
|
107
|
-
descendants.add(currentId);
|
|
108
|
-
const children = itemMap[currentId]?.childrenIds || [];
|
|
109
|
-
children.forEach((childId) => queue.push(childId));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (shouldBeChecked) {
|
|
113
|
-
newSelectedIds.add(item.id);
|
|
114
|
-
descendants.forEach((id) => newSelectedIds.add(id));
|
|
115
|
-
} else {
|
|
116
|
-
newSelectedIds.delete(item.id);
|
|
117
|
-
descendants.forEach((id) => newSelectedIds.delete(id));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
let parentId = itemMap[item.id]?.parentId;
|
|
121
|
-
while (parentId) {
|
|
122
|
-
const parentInfo = itemMap[parentId];
|
|
123
|
-
if (parentInfo && parentInfo.childrenIds.length > 0) {
|
|
124
|
-
const areAllChildrenSelected = parentInfo.childrenIds.every((childId) =>
|
|
125
|
-
newSelectedIds.has(childId)
|
|
126
|
-
);
|
|
127
|
-
if (areAllChildrenSelected) {
|
|
128
|
-
newSelectedIds.add(parentId);
|
|
129
|
-
} else {
|
|
130
|
-
newSelectedIds.delete(parentId);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
parentId = parentInfo?.parentId;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
onChange(Array.from(newSelectedIds));
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const filteredItems = React.useMemo(() => {
|
|
140
|
-
if (!searchQuery) return flatTree.slice(); // Always return a new array in original order
|
|
141
|
-
|
|
142
|
-
const lowercasedQuery = searchQuery.toLowerCase();
|
|
143
|
-
const matchedIds = new Set<string>();
|
|
144
|
-
|
|
145
|
-
// Step 1: collect directly matched items
|
|
146
|
-
flatTree.forEach((item) => {
|
|
147
|
-
const matches =
|
|
148
|
-
item.title.toLowerCase().includes(lowercasedQuery) ||
|
|
149
|
-
item.description.toLowerCase().includes(lowercasedQuery) ||
|
|
150
|
-
item.index.toLowerCase().includes(lowercasedQuery);
|
|
151
|
-
|
|
152
|
-
if (matches) {
|
|
153
|
-
matchedIds.add(item.id);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// Step 2: collect ancestors and descendants
|
|
158
|
-
const expandedIds = new Set(matchedIds);
|
|
159
|
-
|
|
160
|
-
const addAncestors = (id: string) => {
|
|
161
|
-
let current = id;
|
|
162
|
-
while (current) {
|
|
163
|
-
const parentId = itemMap[current]?.parentId;
|
|
164
|
-
if (parentId && !expandedIds.has(parentId)) {
|
|
165
|
-
expandedIds.add(parentId);
|
|
166
|
-
current = parentId;
|
|
167
|
-
} else {
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const addDescendants = (id: string) => {
|
|
174
|
-
const children = itemMap[id]?.childrenIds || [];
|
|
175
|
-
for (const childId of children) {
|
|
176
|
-
if (!expandedIds.has(childId)) {
|
|
177
|
-
expandedIds.add(childId);
|
|
178
|
-
addDescendants(childId);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
matchedIds.forEach((id) => {
|
|
184
|
-
addAncestors(id);
|
|
185
|
-
addDescendants(id);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
// Step 3: Return nodes in the original flatTree order, but only those in expandedIds
|
|
189
|
-
return flatTree.filter((node) => expandedIds.has(node.id));
|
|
190
|
-
}, [searchQuery, flatTree, itemMap]);
|
|
191
|
-
|
|
192
|
-
const getSelectedLabel = () => {
|
|
193
|
-
const leafNodeIds = value.filter((id) => {
|
|
194
|
-
const nodeInfo = itemMap[id];
|
|
195
|
-
return !nodeInfo || nodeInfo.childrenIds.length === 0;
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
if (leafNodeIds.length === 0) {
|
|
199
|
-
return <span className="text-muted-foreground">{placeholder}</span>;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (leafNodeIds.length === 1) {
|
|
203
|
-
const item = flatTree.find((i) => i.id === leafNodeIds[0]);
|
|
204
|
-
return item ? item.index : placeholder;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return `${leafNodeIds.length} items selected`;
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
return (
|
|
211
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
212
|
-
<PopoverTrigger asChild>
|
|
213
|
-
<Button
|
|
214
|
-
variant="outline"
|
|
215
|
-
role="combobox"
|
|
216
|
-
aria-expanded={open}
|
|
217
|
-
className={cn(
|
|
218
|
-
"w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",
|
|
219
|
-
className
|
|
220
|
-
)}
|
|
221
|
-
>
|
|
222
|
-
<span className="truncate">{getSelectedLabel()}</span>
|
|
223
|
-
<ChevronsUpDown
|
|
224
|
-
className={cn(
|
|
225
|
-
"ml-2 h-4 w-4 shrink-0 transition-transform duration-200",
|
|
226
|
-
open && "rotate-180"
|
|
227
|
-
)}
|
|
228
|
-
/>
|
|
229
|
-
</Button>
|
|
230
|
-
</PopoverTrigger>
|
|
231
|
-
<PopoverContent className="w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto">
|
|
232
|
-
<Command>
|
|
233
|
-
<CommandInput
|
|
234
|
-
placeholder={searchPlaceholder}
|
|
235
|
-
value={searchQuery}
|
|
236
|
-
onValueChange={setSearchQuery}
|
|
237
|
-
/>
|
|
238
|
-
<CommandList className="transition-all duration-200 ease-in-out">
|
|
239
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
240
|
-
|
|
241
|
-
{filteredItems.map((item) => (
|
|
242
|
-
<CommandItem
|
|
243
|
-
key={item.id}
|
|
244
|
-
value={`${item.index} ${item.title} ${item.description}`}
|
|
245
|
-
onSelect={() => handleSelect(item)}
|
|
246
|
-
className="flex items-start cursor-pointer gap-2"
|
|
247
|
-
style={{ paddingLeft: `${item.level * 1.5 + 0.75}rem` }}
|
|
248
|
-
>
|
|
249
|
-
<input
|
|
250
|
-
type="checkbox"
|
|
251
|
-
className="mt-1 h-4 w-4 accent-primary border rounded"
|
|
252
|
-
checked={selectionState.get(item.id) === "checked"}
|
|
253
|
-
ref={(el) => {
|
|
254
|
-
if (el) {
|
|
255
|
-
el.indeterminate =
|
|
256
|
-
selectionState.get(item.id) === "indeterminate";
|
|
257
|
-
}
|
|
258
|
-
}}
|
|
259
|
-
readOnly
|
|
260
|
-
/>
|
|
261
|
-
<div className="flex flex-col">
|
|
262
|
-
<div className="flex items-center space-x-2">
|
|
263
|
-
<span className="text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded">
|
|
264
|
-
{item.index}
|
|
265
|
-
</span>
|
|
266
|
-
<span className="font-medium">{item.title}</span>
|
|
267
|
-
</div>
|
|
268
|
-
<p className="text-sm text-muted-foreground">
|
|
269
|
-
{item.description}
|
|
270
|
-
</p>
|
|
271
|
-
</div>
|
|
272
|
-
</CommandItem>
|
|
273
|
-
))}
|
|
274
|
-
</CommandList>
|
|
275
|
-
</Command>
|
|
276
|
-
</PopoverContent>
|
|
277
|
-
</Popover>
|
|
278
|
-
);
|
|
279
|
-
}
|