ikoncomponents 1.5.8 → 1.5.10
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/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 +18 -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/ikonS/accordion.tsx +0 -66
- package/templates/default/ikonS/alert-dialog.tsx +0 -179
- package/templates/default/ikonS/alert.tsx +0 -66
- package/templates/default/ikonS/aspect-ratio.tsx +0 -11
- package/templates/default/ikonS/avatar.tsx +0 -53
- package/templates/default/ikonS/badge.tsx +0 -49
- package/templates/default/ikonS/breadcrumb.tsx +0 -109
- package/templates/default/ikonS/button.tsx +0 -64
- package/templates/default/ikonS/calendar.tsx +0 -227
- package/templates/default/ikonS/card.tsx +0 -92
- package/templates/default/ikonS/checkbox.tsx +0 -33
- package/templates/default/ikonS/collapsible.tsx +0 -33
- package/templates/default/ikonS/command.tsx +0 -184
- package/templates/default/ikonS/date-input.tsx +0 -259
- package/templates/default/ikonS/date-range-picker.tsx +0 -103
- package/templates/default/ikonS/dialog.tsx +0 -143
- package/templates/default/ikonS/drawer.tsx +0 -134
- package/templates/default/ikonS/dropdown-menu.tsx +0 -259
- package/templates/default/ikonS/form.tsx +0 -166
- package/templates/default/ikonS/hover-card.tsx +0 -44
- package/templates/default/ikonS/input-otp.tsx +0 -71
- package/templates/default/ikonS/input.tsx +0 -22
- package/templates/default/ikonS/label.tsx +0 -24
- package/templates/default/ikonS/navigation-menu.tsx +0 -195
- package/templates/default/ikonS/popover.tsx +0 -48
- package/templates/default/ikonS/progress.tsx +0 -40
- package/templates/default/ikonS/radio-group.tsx +0 -45
- package/templates/default/ikonS/scroll-area.tsx +0 -58
- package/templates/default/ikonS/select.tsx +0 -184
- package/templates/default/ikonS/separator.tsx +0 -28
- package/templates/default/ikonS/sheet.tsx +0 -139
- package/templates/default/ikonS/sidebar.tsx +0 -726
- package/templates/default/ikonS/skeleton.tsx +0 -15
- package/templates/default/ikonS/slider.tsx +0 -64
- package/templates/default/ikonS/sonner.tsx +0 -25
- package/templates/default/ikonS/switch.tsx +0 -31
- package/templates/default/ikonS/table.tsx +0 -116
- package/templates/default/ikonS/tabs.tsx +0 -67
- package/templates/default/ikonS/textarea.tsx +0 -18
- package/templates/default/ikonS/toggle-group.tsx +0 -83
- package/templates/default/ikonS/toggle.tsx +0 -47
- package/templates/default/ikonS/tooltip.tsx +0 -65
- package/templates/default/ikonS/workflow.tsx +0 -119
- 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/styles.css +0 -1159
- 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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState } from 'react';
|
|
4
|
+
const SidebarNavContext = createContext(undefined);
|
|
5
|
+
export function SidebarNavProvider({ children }) {
|
|
6
|
+
const [navItems, setNavItems] = useState([]);
|
|
7
|
+
const [header, setHeader] = useState(null);
|
|
8
|
+
const [footer, setFooter] = useState(null);
|
|
9
|
+
const addNavItem = (item) => {
|
|
10
|
+
setNavItems((prevItems) => {
|
|
11
|
+
const exists = prevItems.some((navItem) => navItem.title === item.title);
|
|
12
|
+
if (exists) {
|
|
13
|
+
return prevItems.map((navItem) => navItem.title === item.title ? Object.assign(Object.assign({}, navItem), item) : navItem);
|
|
14
|
+
}
|
|
15
|
+
return [...prevItems, item];
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const removeNavItem = (title) => {
|
|
19
|
+
setNavItems((prevItems) => prevItems.filter((item) => item.title !== title));
|
|
20
|
+
};
|
|
21
|
+
const updateNavItem = (title, updates) => {
|
|
22
|
+
setNavItems((prevItems) => prevItems.map((item) => item.title === title ? Object.assign(Object.assign({}, item), updates) : item));
|
|
23
|
+
};
|
|
24
|
+
const setSidebarHeader = (header) => {
|
|
25
|
+
setHeader(header);
|
|
26
|
+
};
|
|
27
|
+
const setSidebarFooter = (footer) => {
|
|
28
|
+
setFooter(footer);
|
|
29
|
+
};
|
|
30
|
+
const clearNavItems = () => {
|
|
31
|
+
setNavItems([]);
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(SidebarNavContext.Provider, { value: {
|
|
34
|
+
navItems,
|
|
35
|
+
header,
|
|
36
|
+
footer,
|
|
37
|
+
setNavItems,
|
|
38
|
+
addNavItem,
|
|
39
|
+
removeNavItem,
|
|
40
|
+
updateNavItem,
|
|
41
|
+
clearNavItems,
|
|
42
|
+
setSidebarHeader,
|
|
43
|
+
setSidebarFooter,
|
|
44
|
+
}, children: children }));
|
|
45
|
+
}
|
|
46
|
+
export function useSidebarNav() {
|
|
47
|
+
const context = useContext(SidebarNavContext);
|
|
48
|
+
if (!context) {
|
|
49
|
+
throw new Error('useSidebarNav must be used within a SidebarNavProvider');
|
|
50
|
+
}
|
|
51
|
+
return context;
|
|
52
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail, } from "../../shadcn/sidebar";
|
|
15
|
+
import { NavMain } from "./nav-main";
|
|
16
|
+
import { useSidebarNav } from "./SidebarNavContext";
|
|
17
|
+
export function AppSidebar(_a) {
|
|
18
|
+
var props = __rest(_a, []);
|
|
19
|
+
const { navItems, header, footer } = useSidebarNav();
|
|
20
|
+
if (!navItems || navItems.length === 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(Sidebar, Object.assign({ className: "ml-12", collapsible: "offcanvas" }, props, { children: [header && _jsx(SidebarHeader, { children: header }), _jsx(SidebarContent, { children: _jsx(NavMain, {}) }), footer && _jsx(SidebarFooter, { children: footer }), _jsx(SidebarRail, {})] })));
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Copyright } from "lucide-react";
|
|
3
|
+
export function Footer() {
|
|
4
|
+
return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, { className: "size-4" }), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppBreadcrumb } from "../app-breadcrumb";
|
|
3
|
+
import { ThemeToggleBtn } from "../theme-toggle-btn";
|
|
4
|
+
import { Separator } from "../../shadcn/separator";
|
|
5
|
+
import { SidebarTrigger } from "../../shadcn/sidebar";
|
|
6
|
+
import { Bell, Play } from "lucide-react";
|
|
7
|
+
import { IconButtonWithTooltip, IconTextButton } from "../buttons";
|
|
8
|
+
import { useSidebarNav } from "./SidebarNavContext";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
export function Header({ platformUrl }) {
|
|
11
|
+
const { navItems } = useSidebarNav();
|
|
12
|
+
return (_jsx("header", { className: "ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: _jsxs("div", { className: "flex items-center justify-between gap-2 px-4 w-full", children: [_jsxs("div", { className: "flex items-center gap-2", children: [(!navItems || navItems.length === 0) ? _jsx("div", {}) : _jsx(SidebarTrigger, { className: "-ml-1" }), (!navItems || navItems.length === 0) ?
|
|
13
|
+
_jsx("div", {}) :
|
|
14
|
+
_jsx(Separator, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }), _jsx(AppBreadcrumb, {})] }), _jsxs("div", { className: "ml-auto flex gap-4", children: [_jsx(IconButtonWithTooltip, { className: "px-2!", tooltipContent: "Notifications", children: _jsx(Bell, {}) }), _jsx(ThemeToggleBtn, {}), _jsx(Link, { href: `${platformUrl}/app-store`, children: _jsxs(IconTextButton, { variant: "default", children: [_jsx(Play, {}), "App Store"] }) })] })] }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { MainSidebar } from './main-sidebar';
|
|
3
|
+
import { SidebarInset, SidebarProvider } from '../../shadcn/sidebar';
|
|
4
|
+
import { DialogProvider } from '../alert-dialog/dialog-context';
|
|
5
|
+
import { AppSidebar } from './app-sidebar';
|
|
6
|
+
import { Header } from './header';
|
|
7
|
+
import { Footer } from './footer';
|
|
8
|
+
import { SidebarNavProvider } from './SidebarNavContext';
|
|
9
|
+
export function MainLayout({ children, baseUrl, platformUrl }) {
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx(MainSidebar, { baseUrl: baseUrl, platformUrl: platformUrl }), _jsx(SidebarProvider, { children: _jsx(DialogProvider, { children: _jsxs(SidebarNavProvider, { children: [_jsx(AppSidebar, {}), _jsxs(SidebarInset, { className: "flex flex-col h-screen", children: [_jsx(Header, { platformUrl: platformUrl }), _jsx("div", { className: "flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden", children: children }), _jsx(Footer, {})] })] }) }) })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface AccountMembership {
|
|
2
|
+
accountId: string;
|
|
3
|
+
accountName: string;
|
|
4
|
+
primaryAccount?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface Account {
|
|
7
|
+
accountId: string;
|
|
8
|
+
accountName: string;
|
|
9
|
+
accountConfiguration: any | null;
|
|
10
|
+
accountDeleted: boolean;
|
|
11
|
+
active: boolean;
|
|
12
|
+
createdBy: string;
|
|
13
|
+
createdOn: string;
|
|
14
|
+
updatedBy: string;
|
|
15
|
+
updatedOn: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Software {
|
|
18
|
+
softwareId: string;
|
|
19
|
+
softwareName: string;
|
|
20
|
+
url: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
visible: boolean;
|
|
23
|
+
defaultSoftware: boolean;
|
|
24
|
+
order: number;
|
|
25
|
+
}
|
|
26
|
+
export interface User {
|
|
27
|
+
userId: string;
|
|
28
|
+
userName: string;
|
|
29
|
+
userLogin: string;
|
|
30
|
+
userPhone: string;
|
|
31
|
+
userEmail: string;
|
|
32
|
+
userType: string;
|
|
33
|
+
active: boolean;
|
|
34
|
+
dateOfBirth: string;
|
|
35
|
+
userProfileImage: string;
|
|
36
|
+
userDescription: string;
|
|
37
|
+
userDesignation: string;
|
|
38
|
+
userDeleted: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface DecodedAccessToken {
|
|
41
|
+
iss: string;
|
|
42
|
+
jti: string;
|
|
43
|
+
aud: string;
|
|
44
|
+
sub: string;
|
|
45
|
+
typ: string;
|
|
46
|
+
sid: string;
|
|
47
|
+
platformAccess: {
|
|
48
|
+
roles: string[];
|
|
49
|
+
};
|
|
50
|
+
primaryAccountId: string;
|
|
51
|
+
activeAccountId: string;
|
|
52
|
+
userType: string;
|
|
53
|
+
scope: string;
|
|
54
|
+
iat: number;
|
|
55
|
+
exp: number;
|
|
56
|
+
}
|
|
57
|
+
export declare const MainSidebar: ({ baseUrl, platformUrl, }: {
|
|
58
|
+
baseUrl: string;
|
|
59
|
+
platformUrl: string;
|
|
60
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Check, CircleUserRound, FolderCode, Home, LogOut, Settings, } from "lucide-react";
|
|
5
|
+
import { Button } from "../../shadcn/button";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../../shadcn/tooltip";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../../shadcn/dropdown-menu";
|
|
8
|
+
import { getValidAccessToken } from "../../utils/token-management";
|
|
9
|
+
import { clearAllCookieSession, setCookieSession } from "../../utils/session/cookieSession";
|
|
10
|
+
import axios from "axios";
|
|
11
|
+
import { redirect } from "next/navigation";
|
|
12
|
+
import Link from "next/link";
|
|
13
|
+
import { jwtDecode } from "jwt-decode";
|
|
14
|
+
import { Icon } from "../icon";
|
|
15
|
+
import { useRefresh } from "./RefreshContext";
|
|
16
|
+
export const MainSidebar = ({ baseUrl, platformUrl, }) => {
|
|
17
|
+
const [user, setUser] = React.useState();
|
|
18
|
+
const [accounts, setAccounts] = React.useState([]);
|
|
19
|
+
const [selectedAccount, setSelectedAccount] = React.useState();
|
|
20
|
+
const [softwares, setSoftwares] = React.useState([]);
|
|
21
|
+
const { refreshCounter } = useRefresh();
|
|
22
|
+
const getInitials = (name) => {
|
|
23
|
+
return name
|
|
24
|
+
.split(" ")
|
|
25
|
+
.map((word) => word[0])
|
|
26
|
+
.join("")
|
|
27
|
+
.toUpperCase()
|
|
28
|
+
.slice(0, 2);
|
|
29
|
+
};
|
|
30
|
+
function toPascalCase(icon) {
|
|
31
|
+
return icon
|
|
32
|
+
.split("-")
|
|
33
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
34
|
+
.join("");
|
|
35
|
+
}
|
|
36
|
+
// Fetch all data
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
const fetchAllData = async () => {
|
|
39
|
+
try {
|
|
40
|
+
const accessToken = await getValidAccessToken(baseUrl, {
|
|
41
|
+
platformUrl,
|
|
42
|
+
isSetToken: true,
|
|
43
|
+
});
|
|
44
|
+
const decoded = jwtDecode(accessToken !== null && accessToken !== void 0 ? accessToken : "");
|
|
45
|
+
// Fetch all data in parallel
|
|
46
|
+
const [userResponse, accountsResponse, softwaresResponse] = await Promise.all([
|
|
47
|
+
axios.get(`${baseUrl}/platform/user/${decoded.sub}`, {
|
|
48
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
49
|
+
}),
|
|
50
|
+
axios.get(`${baseUrl}/platform/user/account-membership`, {
|
|
51
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
52
|
+
}),
|
|
53
|
+
axios.get(`${baseUrl}/platform/software/accessible/user`, {
|
|
54
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
55
|
+
}),
|
|
56
|
+
]);
|
|
57
|
+
setUser(userResponse.data);
|
|
58
|
+
setAccounts(accountsResponse.data);
|
|
59
|
+
// const primaryAccount = accountsResponse.data.find(
|
|
60
|
+
// (account) => account.primaryAccount === true
|
|
61
|
+
// );
|
|
62
|
+
// if (primaryAccount) {
|
|
63
|
+
// setSelectedAccount(primaryAccount);
|
|
64
|
+
// }
|
|
65
|
+
const activeAccount = accountsResponse.data.find((account) => account.accountId === decoded.activeAccountId);
|
|
66
|
+
setSelectedAccount(activeAccount);
|
|
67
|
+
const visibleSoftwares = softwaresResponse.data.filter((item) => item.visible);
|
|
68
|
+
setSoftwares(visibleSoftwares);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.error("Failed to fetch data:", error);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
fetchAllData();
|
|
75
|
+
}, [baseUrl, platformUrl, refreshCounter]);
|
|
76
|
+
const switchAccount = async (accountId, baseUrl) => {
|
|
77
|
+
try {
|
|
78
|
+
const accessToken = await getValidAccessToken(baseUrl, {
|
|
79
|
+
platformUrl: platformUrl,
|
|
80
|
+
isSetToken: true,
|
|
81
|
+
});
|
|
82
|
+
const response = await axios.post(`${baseUrl}/platform/auth/switch-account`, {
|
|
83
|
+
targetAccountId: accountId,
|
|
84
|
+
}, {
|
|
85
|
+
headers: {
|
|
86
|
+
Authorization: `Bearer ${accessToken}`,
|
|
87
|
+
},
|
|
88
|
+
withCredentials: true,
|
|
89
|
+
});
|
|
90
|
+
console.log(response);
|
|
91
|
+
await setCookieSession("accessToken", response.data.accessToken);
|
|
92
|
+
await setCookieSession("refreshToken", response.data.refreshToken);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error(error);
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return (_jsx(TooltipProvider, { delayDuration: 0, children: _jsxs("aside", { className: "fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "default", className: "mb-4 h-8 w-8 rounded-lg p-0", disabled: !selectedAccount, children: _jsx("span", { className: "text-base font-medium text-accent-foreground", children: selectedAccount
|
|
100
|
+
? getInitials(selectedAccount.accountName)
|
|
101
|
+
: "..." }) }) }), _jsxs(DropdownMenuContent, { className: "w-55", side: "right", sideOffset: 8, align: "start", children: [_jsx("div", { className: "px-2 py-1.5 text-xs font-semibold text-foreground", children: "Accounts" }), accounts.map((account) => (_jsxs(DropdownMenuItem, { className: "flex items-center justify-between cursor-pointer", onClick: async () => {
|
|
102
|
+
try {
|
|
103
|
+
setSelectedAccount(account);
|
|
104
|
+
console.log(account.accountId);
|
|
105
|
+
await switchAccount(account.accountId, baseUrl);
|
|
106
|
+
window.location.reload();
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error("Switch account failed", error);
|
|
110
|
+
}
|
|
111
|
+
}, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-6 w-6 rounded bg-primary/10 flex items-center justify-center", children: _jsx("span", { className: "text-xs font-medium text-primary", children: getInitials(account.accountName) }) }), _jsx("span", { className: "text-sm", children: account.accountName })] }), (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId) === account.accountId && (_jsx(Check, { className: "h-4 w-4 text-primary" }))] }, account.accountId)))] })] }), _jsx("nav", { className: "flex flex-col gap-1", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: `${platformUrl}/home`, children: [_jsx(Home, { className: "h-8 w-8" }), _jsx("span", { className: "sr-only", children: "Home" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Home" })] }, "home") }), _jsx("nav", { className: "flex flex-col gap-1 flex-1", children: softwares.map((software) => {
|
|
112
|
+
var _a, _b;
|
|
113
|
+
const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
|
|
114
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: (_a = software.url) !== null && _a !== void 0 ? _a : "#", children: [hasIcon ? (_jsx(Icon, { name: toPascalCase((_b = software.icon) !== null && _b !== void 0 ? _b : ""), className: "h-8 w-8" })) : (_jsx(FolderCode, { className: "h-8 w-8" })), _jsx("span", { className: "sr-only", children: software.softwareName })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.softwareName })] }, software.softwareName));
|
|
115
|
+
}) }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: `${platformUrl}/settings`, children: [_jsx(Settings, { className: "h-8 w-8" }), _jsx("span", { className: "sr-only", children: "Settings" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Settings" })] }, "settings"), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", children: _jsx(CircleUserRound, { className: "h-8 w-8" }) }) }), _jsxs(DropdownMenuContent, { className: "w-55 p-0", side: "right", sideOffset: 8, children: [_jsxs("div", { className: "flex items-start gap-3 p-4 bg-card", children: [_jsx(CircleUserRound, { className: "h-8 w-8" }), _jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [_jsx("p", { className: "text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userName }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userEmail }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
|
|
116
|
+
await clearAllCookieSession();
|
|
117
|
+
redirect(`${platformUrl}/login.html`);
|
|
118
|
+
}, className: "flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive", children: [_jsx(LogOut, { className: "h-4 w-4 text-foreground" }), _jsx("span", { children: "Log out" })] })] })] })] }) }));
|
|
119
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SidebarNavItem } from "./SidebarNavContext";
|
|
3
|
+
export declare function NavMain(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function RenderSidebarNav({ items, sidebarHeader, sidebarFooter }: {
|
|
5
|
+
items: SidebarNavItem[];
|
|
6
|
+
sidebarHeader?: ReactNode;
|
|
7
|
+
sidebarFooter?: ReactNode;
|
|
8
|
+
}): null;
|
|
9
|
+
export declare function AddSidebarNav({ item }: {
|
|
10
|
+
item: SidebarNavItem;
|
|
11
|
+
}): null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, } from "react";
|
|
4
|
+
import { ChevronRight } from "lucide-react";
|
|
5
|
+
import { SidebarGroup, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem } from "../../shadcn/sidebar";
|
|
6
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../shadcn/collapsible";
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { useSidebarNav } from "./SidebarNavContext";
|
|
9
|
+
export function NavMain() {
|
|
10
|
+
const { navItems } = useSidebarNav();
|
|
11
|
+
// if (!navItems || navItems.length === 0) {
|
|
12
|
+
// return null;
|
|
13
|
+
// }
|
|
14
|
+
return (_jsx(SidebarGroup, { children: _jsx(SidebarMenu, { children: navItems.map((item) => item.items && item.items.length > 0 ? (_jsx(Collapsible, { asChild: true, defaultOpen: item.isActive, className: "group/collapsible", children: _jsxs(SidebarMenuItem, { children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { tooltip: item.title, children: [item.icon && _jsx(item.icon, {}), _jsx("span", { children: item.title }), _jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })] }) }), _jsx(CollapsibleContent, { children: _jsx(SidebarMenuSub, { children: item.items.map((subItem) => (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, children: _jsx(Link, { href: subItem.url, children: _jsx("span", { children: subItem.title }) }) }) }, subItem.title))) }) })] }) }, item.title)) : (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, tooltip: item.title, children: _jsxs(Link, { href: item.url, className: "flex items-center gap-2 w-full", children: [item.icon && _jsx(item.icon, {}), _jsx("span", { children: item.title })] }) }) }, item.title))) }) }));
|
|
15
|
+
}
|
|
16
|
+
// Helper component to set nav items from pages
|
|
17
|
+
export function RenderSidebarNav({ items, sidebarHeader, sidebarFooter }) {
|
|
18
|
+
const { setNavItems, setSidebarHeader, setSidebarFooter } = useSidebarNav();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setNavItems(items);
|
|
21
|
+
setSidebarHeader(sidebarHeader);
|
|
22
|
+
setSidebarFooter(sidebarFooter);
|
|
23
|
+
}, [items, sidebarHeader, sidebarFooter, setNavItems, setSidebarHeader, setSidebarFooter]);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
// Helper component to add a single nav item
|
|
27
|
+
export function AddSidebarNav({ item }) {
|
|
28
|
+
const { addNavItem } = useSidebarNav();
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
addNavItem(item);
|
|
31
|
+
}, [item, addNavItem]);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface MultiComboboxProps {
|
|
2
|
+
placeholder: string;
|
|
3
|
+
items: {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean | ((item: any) => boolean);
|
|
7
|
+
}[];
|
|
8
|
+
onValueChange: (selectedItems: string[]) => void;
|
|
9
|
+
defaultValue?: string[];
|
|
10
|
+
defaultOptions?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions }: MultiComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// import React, { useEffect, useState } from 'react'
|
|
3
|
+
// import { Popover, PopoverContent, PopoverTrigger } from '@/shadcn/ui/popover'
|
|
4
|
+
// import { Button } from '@/shadcn/ui/button'
|
|
5
|
+
// import { cn } from '@/shadcn/lib/utils'
|
|
6
|
+
// import { Check, ChevronsUpDown } from 'lucide-react'
|
|
7
|
+
// import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/shadcn/ui/command'
|
|
8
|
+
// interface MultiComboboxProps {
|
|
9
|
+
// placeholder: string;
|
|
10
|
+
// items: { value: string; label?: string }[];
|
|
11
|
+
// onValueChange: (selectedItems: string[]) => void;
|
|
12
|
+
// defaultValue?: string[];
|
|
13
|
+
// }
|
|
14
|
+
// export default function MultiCombobox({ placeholder, items, onValueChange, defaultValue }: MultiComboboxProps) {
|
|
15
|
+
// const [selectedItems, setSelectedItems] = useState<string[]>(defaultValue ? defaultValue : []);
|
|
16
|
+
// useEffect(() => {
|
|
17
|
+
// onValueChange(selectedItems)
|
|
18
|
+
// }, [selectedItems])
|
|
19
|
+
// return (
|
|
20
|
+
// <>
|
|
21
|
+
// <Popover>
|
|
22
|
+
// <PopoverTrigger asChild>
|
|
23
|
+
// <Button
|
|
24
|
+
// variant="outline"
|
|
25
|
+
// role="combobox"
|
|
26
|
+
// className={cn(
|
|
27
|
+
// "justify-between",
|
|
28
|
+
// selectedItems.length == 0 && "text-muted-foreground"
|
|
29
|
+
// )}
|
|
30
|
+
// >
|
|
31
|
+
// {selectedItems && selectedItems.length > 0 ? (
|
|
32
|
+
// <div className='flex gap-2 items-center'>
|
|
33
|
+
// {
|
|
34
|
+
// selectedItems.map((value: string) => (
|
|
35
|
+
// <span
|
|
36
|
+
// key={value}
|
|
37
|
+
// className="px-2 py-1 bg-secondary text-secondary-foreground rounded-md"
|
|
38
|
+
// >
|
|
39
|
+
// {
|
|
40
|
+
// (items.find(
|
|
41
|
+
// (item) => item.value === value
|
|
42
|
+
// )?.label || value)
|
|
43
|
+
// }
|
|
44
|
+
// </span>
|
|
45
|
+
// ))
|
|
46
|
+
// }
|
|
47
|
+
// </div>
|
|
48
|
+
// ) : placeholder}
|
|
49
|
+
// <ChevronsUpDown className="opacity-50" />
|
|
50
|
+
// </Button>
|
|
51
|
+
// </PopoverTrigger>
|
|
52
|
+
// <PopoverContent className="p-0" align='start'>
|
|
53
|
+
// <Command>
|
|
54
|
+
// <CommandInput
|
|
55
|
+
// placeholder="Search..."
|
|
56
|
+
// />
|
|
57
|
+
// <CommandList>
|
|
58
|
+
// <CommandEmpty>No items found.</CommandEmpty>
|
|
59
|
+
// <CommandGroup>
|
|
60
|
+
// {
|
|
61
|
+
// items.map((item) => {
|
|
62
|
+
// const isSelected = selectedItems.includes(item.value);
|
|
63
|
+
// return (
|
|
64
|
+
// <CommandItem
|
|
65
|
+
// value={item.value}
|
|
66
|
+
// key={item.value}
|
|
67
|
+
// onSelect={(value) => {
|
|
68
|
+
// let updatedItems;
|
|
69
|
+
// if (selectedItems.includes(value)) {
|
|
70
|
+
// updatedItems = selectedItems.filter((val) => val !== value);
|
|
71
|
+
// } else {
|
|
72
|
+
// updatedItems = [...selectedItems, value];
|
|
73
|
+
// }
|
|
74
|
+
// setSelectedItems(updatedItems);
|
|
75
|
+
// }}
|
|
76
|
+
// >
|
|
77
|
+
// {item?.label || item.value}
|
|
78
|
+
// <Check
|
|
79
|
+
// className={cn(
|
|
80
|
+
// "ml-auto",
|
|
81
|
+
// isSelected
|
|
82
|
+
// ? "opacity-100"
|
|
83
|
+
// : "opacity-0"
|
|
84
|
+
// )}
|
|
85
|
+
// />
|
|
86
|
+
// </CommandItem>
|
|
87
|
+
// )
|
|
88
|
+
// })
|
|
89
|
+
// }
|
|
90
|
+
// </CommandGroup>
|
|
91
|
+
// </CommandList>
|
|
92
|
+
// </Command>
|
|
93
|
+
// </PopoverContent>
|
|
94
|
+
// </Popover>
|
|
95
|
+
// </>
|
|
96
|
+
// )
|
|
97
|
+
// }
|
|
98
|
+
import { useEffect, useState, useRef, useCallback } from 'react';
|
|
99
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../shadcn/popover';
|
|
100
|
+
import { Button } from '../../shadcn/button';
|
|
101
|
+
import { cn } from '../../utils/cn';
|
|
102
|
+
import { ChevronsUpDown, X } from 'lucide-react';
|
|
103
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../shadcn/command';
|
|
104
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../shadcn/tooltip';
|
|
105
|
+
import { Checkbox } from '../../shadcn/checkbox';
|
|
106
|
+
export function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions = 2 }) {
|
|
107
|
+
const [selectedItems, setSelectedItems] = useState(defaultValue || []);
|
|
108
|
+
const [search, setSearch] = useState("");
|
|
109
|
+
const containerRef = useRef(null);
|
|
110
|
+
const [open, setOpen] = useState(false);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
onValueChange(selectedItems);
|
|
113
|
+
}, [selectedItems, onValueChange]);
|
|
114
|
+
const filteredItems = items
|
|
115
|
+
.filter((item) => (item.label || item.value).toLowerCase().includes(search.toLowerCase()))
|
|
116
|
+
.sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.label) !== null && _a !== void 0 ? _a : "").localeCompare((_b = b === null || b === void 0 ? void 0 : b.label) !== null && _b !== void 0 ? _b : ""); });
|
|
117
|
+
const onWheel = (e) => {
|
|
118
|
+
const el = e.currentTarget;
|
|
119
|
+
el.scrollTop += e.deltaY;
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
};
|
|
122
|
+
const toggleItem = (value) => {
|
|
123
|
+
const updatedItems = selectedItems.includes(value)
|
|
124
|
+
? selectedItems.filter((val) => val !== value)
|
|
125
|
+
: [...selectedItems, value];
|
|
126
|
+
setSelectedItems(updatedItems);
|
|
127
|
+
};
|
|
128
|
+
const [visibleCount, setVisibleCount] = useState(selectedItems.length);
|
|
129
|
+
const calculateVisibleItems = useCallback(() => {
|
|
130
|
+
const container = containerRef.current;
|
|
131
|
+
if (!container)
|
|
132
|
+
return visibleCount;
|
|
133
|
+
const children = Array.from(container.children);
|
|
134
|
+
let availableWidth = container.offsetWidth;
|
|
135
|
+
let usedWidth = 0;
|
|
136
|
+
let fitCount = 0;
|
|
137
|
+
for (const child of children) {
|
|
138
|
+
const childWidth = child.offsetWidth + 4; // Account for gap
|
|
139
|
+
if (usedWidth + childWidth <= availableWidth) {
|
|
140
|
+
usedWidth += childWidth;
|
|
141
|
+
fitCount++;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return fitCount;
|
|
148
|
+
}, [visibleCount]);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
const container = containerRef.current;
|
|
151
|
+
if (!container)
|
|
152
|
+
return;
|
|
153
|
+
let animationFrameId = null;
|
|
154
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
155
|
+
if (animationFrameId)
|
|
156
|
+
cancelAnimationFrame(animationFrameId);
|
|
157
|
+
animationFrameId = requestAnimationFrame(() => {
|
|
158
|
+
const newVisibleCount = calculateVisibleItems();
|
|
159
|
+
setVisibleCount((prevVisibleCount) => prevVisibleCount !== newVisibleCount ? newVisibleCount : prevVisibleCount);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
resizeObserver.observe(container);
|
|
163
|
+
setVisibleCount(calculateVisibleItems());
|
|
164
|
+
return () => {
|
|
165
|
+
if (animationFrameId)
|
|
166
|
+
cancelAnimationFrame(animationFrameId);
|
|
167
|
+
resizeObserver.disconnect();
|
|
168
|
+
};
|
|
169
|
+
}, [calculateVisibleItems]);
|
|
170
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, className: "w-full", children: _jsxs(Button, { variant: "outline", role: "combobox", className: cn("justify-between px-3 py-2 h-10", selectedItems.length === 0 && "text-foreground/50", "bg-secondary"), onClick: () => setOpen((prev) => !prev), children: [selectedItems.length > 0 ? (_jsx(TooltipProvider, { children: _jsxs("div", { ref: containerRef, className: "flex flex-wrap gap-2 items-center overflow-hidden flex-1", children: [selectedItems.slice(0, defaultOptions).map((value) => {
|
|
171
|
+
var _a;
|
|
172
|
+
const label = ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value;
|
|
173
|
+
return (_jsxs("span", { className: "flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full", title: label, children: [_jsx("span", { className: "truncate max-w-[120px]", children: label }), _jsx("span", { role: "button", tabIndex: 0, onClick: (e) => {
|
|
174
|
+
e.stopPropagation();
|
|
175
|
+
toggleItem(value);
|
|
176
|
+
}, onKeyDown: (e) => {
|
|
177
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
e.stopPropagation();
|
|
180
|
+
toggleItem(value);
|
|
181
|
+
}
|
|
182
|
+
}, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: _jsx(X, { className: "w-3 h-3 ml-1" }) })] }, value));
|
|
183
|
+
}), selectedItems.length > defaultOptions && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { className: "px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer", children: ["+", selectedItems.length - defaultOptions, " more"] }) }), _jsx(TooltipContent, { className: "max-w-xs break-words", children: _jsx("div", { onWheel: onWheel, className: "flex flex-col gap-1 max-h-[200px] overflow-auto", children: selectedItems.slice(defaultOptions).map((value) => {
|
|
184
|
+
var _a;
|
|
185
|
+
return (_jsx("span", { className: "text-sm", children: ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value }, value));
|
|
186
|
+
}) }) })] }))] }) })) : (_jsx("span", { className: "flex-1 text-left truncate", children: placeholder })), _jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0 min-w-[var(--radix-popover-trigger-width)]", style: { width: 'max-content', maxWidth: 'min(500px, 90vw)' }, align: "start", children: _jsxs(Command, { onMouseDown: (e) => e.preventDefault(), children: [_jsx(CommandInput, { placeholder: "Search...", value: search, onValueChange: setSearch }), _jsxs(CommandList, { onWheel: onWheel, className: "max-h-60 overflow-auto", children: [_jsx(CommandEmpty, { children: "No items found." }), _jsx(CommandGroup, { children: filteredItems.map((item) => {
|
|
187
|
+
const isSelected = selectedItems.includes(item.value);
|
|
188
|
+
const isDisabled = item.disabled === true || (typeof item.disabled === "function" && item.disabled(item));
|
|
189
|
+
return (_jsxs(CommandItem, { value: item.label || item.value, disabled: isDisabled, onPointerDown: (e) => {
|
|
190
|
+
e.preventDefault();
|
|
191
|
+
e.stopPropagation();
|
|
192
|
+
}, onSelect: () => {
|
|
193
|
+
if (!isDisabled) {
|
|
194
|
+
toggleItem(item.value);
|
|
195
|
+
}
|
|
196
|
+
}, className: cn("flex items-center justify-between space-x-2", isDisabled && "opacity-50 cursor-not-allowed"), children: [_jsx(Checkbox, { checked: isSelected, onCheckedChange: () => {
|
|
197
|
+
if (!isDisabled) {
|
|
198
|
+
toggleItem(item.value);
|
|
199
|
+
}
|
|
200
|
+
}, onClick: (e) => e.stopPropagation(), disabled: isDisabled }), _jsx("span", { className: "flex-grow text-left", children: (item === null || item === void 0 ? void 0 : item.label) || item.value })] }, item.value));
|
|
201
|
+
}) })] })] }) })] }));
|
|
202
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert } from "lucide-react";
|
|
3
|
+
export function NoDataComponent({ text }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex flex-col h-full justify-center text-center gap-2", children: [_jsx(CircleAlert, { className: "text-muted-foreground mx-auto", size: 36 }), _jsx("p", { className: "text-muted-foreground", children: text ? text : "No Data Available" })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
title?: string | ReactNode;
|
|
4
|
+
subtitle?: string | ReactNode;
|
|
5
|
+
tools?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function PageWrapper({ title, subtitle, tools, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export function PageWrapper({ title, subtitle, tools, children }) {
|
|
4
|
+
title = title !== null && title !== void 0 ? title : '';
|
|
5
|
+
subtitle = subtitle !== null && subtitle !== void 0 ? subtitle : '';
|
|
6
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 h-full", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: 'grid grid-cols-1 gap-1', children: [title && _jsx("h1", { className: 'text-2xl font-semibold', children: title }), subtitle && _jsx("p", { className: 'text-muted-foreground/60', children: subtitle })] }), _jsx("div", { children: tools })] }), children] }));
|
|
7
|
+
}
|