ikoncomponents 1.5.7 → 1.5.8
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/bin.js +2 -0
- package/dist/commands/init.js +63 -0
- package/dist/index.js +14 -116
- package/dist/utlis/copyDir.js +7 -0
- package/package.json +17 -91
- package/templates/default/hooks/use-mobile.ts +19 -0
- package/templates/default/ikonS/accordion.tsx +66 -0
- package/templates/default/ikonS/alert-dialog.tsx +179 -0
- package/templates/default/ikonS/alert.tsx +66 -0
- package/templates/default/ikonS/aspect-ratio.tsx +11 -0
- package/templates/default/ikonS/avatar.tsx +53 -0
- package/templates/default/ikonS/badge.tsx +49 -0
- package/templates/default/ikonS/breadcrumb.tsx +109 -0
- package/templates/default/ikonS/button.tsx +64 -0
- package/templates/default/ikonS/calendar.tsx +227 -0
- package/templates/default/ikonS/card.tsx +92 -0
- package/templates/default/ikonS/checkbox.tsx +33 -0
- package/templates/default/ikonS/collapsible.tsx +33 -0
- package/templates/default/ikonS/command.tsx +184 -0
- package/templates/default/ikonS/date-input.tsx +259 -0
- package/templates/default/ikonS/date-range-picker.tsx +103 -0
- package/templates/default/ikonS/dialog.tsx +143 -0
- package/templates/default/ikonS/drawer.tsx +134 -0
- package/templates/default/ikonS/dropdown-menu.tsx +259 -0
- package/templates/default/ikonS/form.tsx +166 -0
- package/templates/default/ikonS/hover-card.tsx +44 -0
- package/templates/default/ikonS/input-otp.tsx +71 -0
- package/templates/default/ikonS/input.tsx +22 -0
- package/templates/default/ikonS/label.tsx +24 -0
- package/templates/default/ikonS/navigation-menu.tsx +195 -0
- package/templates/default/ikonS/popover.tsx +48 -0
- package/templates/default/ikonS/progress.tsx +40 -0
- package/templates/default/ikonS/radio-group.tsx +45 -0
- package/templates/default/ikonS/scroll-area.tsx +58 -0
- package/templates/default/ikonS/select.tsx +184 -0
- package/templates/default/ikonS/separator.tsx +28 -0
- package/templates/default/ikonS/sheet.tsx +139 -0
- package/templates/default/ikonS/sidebar.tsx +726 -0
- package/templates/default/ikonS/skeleton.tsx +15 -0
- package/templates/default/ikonS/slider.tsx +64 -0
- package/templates/default/ikonS/sonner.tsx +25 -0
- package/templates/default/ikonS/switch.tsx +31 -0
- package/templates/default/ikonS/table.tsx +116 -0
- package/templates/default/ikonS/tabs.tsx +67 -0
- package/templates/default/ikonS/textarea.tsx +18 -0
- package/templates/default/ikonS/toggle-group.tsx +83 -0
- package/templates/default/ikonS/toggle.tsx +47 -0
- package/templates/default/ikonS/tooltip.tsx +65 -0
- package/templates/default/ikonS/workflow.tsx +119 -0
- package/templates/default/ikoncomponents/action-menu/index.tsx +108 -0
- package/templates/default/ikoncomponents/action-menu/type.ts +18 -0
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +63 -0
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +65 -0
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +80 -0
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +68 -0
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +222 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +38 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +81 -0
- package/templates/default/ikoncomponents/big-calendar/index.css +879 -0
- package/templates/default/ikoncomponents/big-calendar/index.tsx +59 -0
- package/templates/default/ikoncomponents/big-calendar/type.ts +37 -0
- package/templates/default/ikoncomponents/buttons/index.tsx +127 -0
- package/templates/default/ikoncomponents/combobox-input/index.tsx +75 -0
- package/templates/default/ikoncomponents/combobox-input/type.ts +14 -0
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +242 -0
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +80 -0
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +149 -0
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +98 -0
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +119 -0
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +45 -0
- package/templates/default/ikoncomponents/data-table/function.ts +7 -0
- package/templates/default/ikoncomponents/data-table/index.tsx +549 -0
- package/templates/default/ikoncomponents/data-table/type.ts +75 -0
- package/templates/default/ikoncomponents/e-chart/index.tsx +183 -0
- package/templates/default/ikoncomponents/file-input/index.tsx +27 -0
- package/templates/default/ikoncomponents/fileUpload/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +111 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +80 -0
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +9 -0
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +27 -0
- package/{dist/ikoncomponents/form-fields/multi-combobox-input/index.js → templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx} +574 -381
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +39 -0
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +52 -0
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +7 -0
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +28 -0
- package/templates/default/ikoncomponents/form-fields/types/index.ts +46 -0
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +171 -0
- package/templates/default/ikoncomponents/icon/index.tsx +22 -0
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +19 -0
- package/{dist/ikoncomponents/image-cropper-upload/components/newCropper.js → templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx} +117 -85
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +352 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +250 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +32 -0
- package/{dist/ikoncomponents/image-cropper-upload/image-cropper/index.js → templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx} +119 -87
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +95 -0
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +117 -0
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +30 -0
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +103 -0
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +36 -0
- package/templates/default/ikoncomponents/main-layout/footer.tsx +21 -0
- package/templates/default/ikoncomponents/main-layout/header.tsx +53 -0
- package/templates/default/ikoncomponents/main-layout/index.tsx +38 -0
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +389 -0
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +103 -0
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +345 -0
- package/templates/default/ikoncomponents/no-data/index.tsx +11 -0
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +30 -0
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +49 -0
- package/templates/default/ikoncomponents/phone-input/index.tsx +72 -0
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +32 -0
- package/templates/default/ikoncomponents/search-input/index.tsx +18 -0
- package/templates/default/ikoncomponents/sheet/index.tsx +34 -0
- package/templates/default/ikoncomponents/simple-widget/index.tsx +54 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +34 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +13 -0
- package/templates/default/ikoncomponents/tabs/index.tsx +139 -0
- package/{dist/ikoncomponents/tabs/type.d.ts → templates/default/ikoncomponents/tabs/type.ts} +20 -19
- package/{dist/ikoncomponents/theme-toggle-btn/index.js → templates/default/ikoncomponents/theme-toggle-btn/index.tsx} +189 -118
- package/templates/default/ikoncomponents/title-progress/index.tsx +41 -0
- package/templates/default/ikoncomponents/tooltip/index.tsx +17 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +33 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +279 -0
- package/templates/default/ikoncomponents/upload-tab/index.tsx +237 -0
- package/templates/default/ikoncomponents/widgets/index.tsx +81 -0
- package/templates/default/ikoncomponents/widgets/type.ts +11 -0
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +16 -0
- package/templates/default/styles.css +1159 -0
- package/templates/default/utils/actions/account/index.ts +33 -0
- package/templates/default/utils/actions/account/type.ts +4 -0
- package/{dist/utils/actions/auth/index.js → templates/default/utils/actions/auth/index.ts} +69 -58
- package/templates/default/utils/actions/common/revalidate.ts +18 -0
- package/templates/default/utils/actions/common/type.ts +4 -0
- package/{dist/utils/actions/common/utils.js → templates/default/utils/actions/common/utils.ts} +28 -25
- package/templates/default/utils/actions/software/index.ts +106 -0
- package/templates/default/utils/api/accountService/index.ts +103 -0
- package/templates/default/utils/api/accountService/type.ts +4 -0
- package/templates/default/utils/api/file-upload/index.ts +103 -0
- package/templates/default/utils/api/file-upload/type.ts +8 -0
- package/{dist/utils/api/ikonBaseApi.js → templates/default/utils/api/ikonBaseApi.ts} +132 -104
- package/templates/default/utils/api/loginService/index.ts +106 -0
- package/{dist/utils/api/loginService/type.d.ts → templates/default/utils/api/loginService/type.ts} +35 -31
- package/templates/default/utils/api/softwareService/index.ts +356 -0
- package/templates/default/utils/api/softwareService/type.ts +62 -0
- package/{dist/utils/border-radius-provider.js → templates/default/utils/border-radius-provider.tsx} +59 -35
- package/templates/default/utils/cn.ts +6 -0
- package/{dist/utils/font-provider.js → templates/default/utils/font-provider.tsx} +61 -37
- package/templates/default/utils/session/cookieSession.ts +49 -0
- package/templates/default/utils/theme-provider/index.tsx +11 -0
- package/templates/default/utils/token-management/index.ts +115 -0
- package/templates/default/utils/token-management/types.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/ikoncomponents/action-menu/index.d.ts +0 -5
- package/dist/ikoncomponents/action-menu/index.js +0 -42
- package/dist/ikoncomponents/action-menu/type.d.ts +0 -14
- package/dist/ikoncomponents/action-menu/type.js +0 -1
- package/dist/ikoncomponents/activity-sheet/index.d.ts +0 -11
- package/dist/ikoncomponents/activity-sheet/index.js +0 -23
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +0 -21
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +0 -30
- package/dist/ikoncomponents/alert-dialog/index.d.ts +0 -14
- package/dist/ikoncomponents/alert-dialog/index.js +0 -20
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +0 -18
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +0 -43
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +0 -5
- package/dist/ikoncomponents/app-breadcrumb/index.js +0 -57
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +0 -5
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +0 -16
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +0 -2
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +0 -39
- package/dist/ikoncomponents/big-calendar/index.d.ts +0 -3
- package/dist/ikoncomponents/big-calendar/index.js +0 -35
- package/dist/ikoncomponents/big-calendar/type.d.ts +0 -31
- package/dist/ikoncomponents/big-calendar/type.js +0 -1
- package/dist/ikoncomponents/buttons/index.d.ts +0 -18
- package/dist/ikoncomponents/buttons/index.js +0 -38
- package/dist/ikoncomponents/combobox-input/index.d.ts +0 -2
- package/dist/ikoncomponents/combobox-input/index.js +0 -18
- package/dist/ikoncomponents/combobox-input/type.d.ts +0 -13
- package/dist/ikoncomponents/combobox-input/type.js +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +0 -21
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +0 -85
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +0 -22
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +0 -35
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +0 -38
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +0 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +0 -18
- package/dist/ikoncomponents/data-table/function.d.ts +0 -1
- package/dist/ikoncomponents/data-table/function.js +0 -6
- package/dist/ikoncomponents/data-table/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/index.js +0 -223
- package/dist/ikoncomponents/data-table/type.d.ts +0 -60
- package/dist/ikoncomponents/data-table/type.js +0 -1
- package/dist/ikoncomponents/e-chart/index.d.ts +0 -15
- package/dist/ikoncomponents/e-chart/index.js +0 -115
- package/dist/ikoncomponents/file-input/index.d.ts +0 -1
- package/dist/ikoncomponents/file-input/index.js +0 -21
- package/dist/ikoncomponents/fileUpload/index.d.ts +0 -15
- package/dist/ikoncomponents/fileUpload/index.js +0 -69
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +0 -21
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +0 -18
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +0 -26
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/date-input/index.js +0 -15
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +0 -1
- package/dist/ikoncomponents/form-fields/file-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +0 -6
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/otp-input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +0 -1
- package/dist/ikoncomponents/form-fields/phone-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/textarea/index.js +0 -18
- package/dist/ikoncomponents/form-fields/types/index.d.ts +0 -36
- package/dist/ikoncomponents/form-fields/types/index.js +0 -1
- package/dist/ikoncomponents/glowing-effect/index.d.ts +0 -14
- package/dist/ikoncomponents/glowing-effect/index.js +0 -84
- package/dist/ikoncomponents/icon/index.d.ts +0 -8
- package/dist/ikoncomponents/icon/index.js +0 -23
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +0 -15
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +0 -145
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +0 -6
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +0 -92
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +0 -6
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +0 -14
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +0 -14
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +0 -27
- package/dist/ikoncomponents/image-cropper-upload/index.js +0 -49
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +0 -16
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +0 -73
- package/dist/ikoncomponents/loading-spinner/index.d.ts +0 -9
- package/dist/ikoncomponents/loading-spinner/index.js +0 -19
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +0 -10
- package/dist/ikoncomponents/main-layout/RefreshContext.js +0 -17
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +0 -33
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +0 -52
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +0 -3
- package/dist/ikoncomponents/main-layout/app-sidebar.js +0 -24
- package/dist/ikoncomponents/main-layout/footer.d.ts +0 -1
- package/dist/ikoncomponents/main-layout/footer.js +0 -5
- package/dist/ikoncomponents/main-layout/header.d.ts +0 -3
- package/dist/ikoncomponents/main-layout/header.js +0 -15
- package/dist/ikoncomponents/main-layout/index.d.ts +0 -6
- package/dist/ikoncomponents/main-layout/index.js +0 -11
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +0 -60
- package/dist/ikoncomponents/main-layout/main-sidebar.js +0 -119
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +0 -11
- package/dist/ikoncomponents/main-layout/nav-main.js +0 -33
- package/dist/ikoncomponents/multi-combobox/index.d.ts +0 -13
- package/dist/ikoncomponents/multi-combobox/index.js +0 -202
- package/dist/ikoncomponents/no-data/index.d.ts +0 -3
- package/dist/ikoncomponents/no-data/index.js +0 -5
- package/dist/ikoncomponents/page-wrapper/index.d.ts +0 -9
- package/dist/ikoncomponents/page-wrapper/index.js +0 -7
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +0 -3
- package/dist/ikoncomponents/password-strength-meter/index.js +0 -40
- package/dist/ikoncomponents/phone-input/index.d.ts +0 -1
- package/dist/ikoncomponents/phone-input/index.js +0 -41
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +0 -6
- package/dist/ikoncomponents/provider-wrapper/index.js +0 -11
- package/dist/ikoncomponents/search-input/index.d.ts +0 -1
- package/dist/ikoncomponents/search-input/index.js +0 -19
- package/dist/ikoncomponents/sheet/index.d.ts +0 -10
- package/dist/ikoncomponents/sheet/index.js +0 -6
- package/dist/ikoncomponents/simple-widget/index.d.ts +0 -14
- package/dist/ikoncomponents/simple-widget/index.js +0 -14
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +0 -5
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +0 -3
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +0 -5
- package/dist/ikoncomponents/tabs/index.d.ts +0 -2
- package/dist/ikoncomponents/tabs/index.js +0 -50
- package/dist/ikoncomponents/tabs/type.js +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +0 -1
- package/dist/ikoncomponents/title-progress/index.d.ts +0 -12
- package/dist/ikoncomponents/title-progress/index.js +0 -10
- package/dist/ikoncomponents/tooltip/index.d.ts +0 -5
- package/dist/ikoncomponents/tooltip/index.js +0 -5
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +0 -31
- package/dist/ikoncomponents/twolevel-dropdown/index.js +0 -143
- package/dist/ikoncomponents/upload-tab/index.d.ts +0 -1
- package/dist/ikoncomponents/upload-tab/index.js +0 -92
- package/dist/ikoncomponents/widgets/index.d.ts +0 -2
- package/dist/ikoncomponents/widgets/index.js +0 -14
- package/dist/ikoncomponents/widgets/type.d.ts +0 -10
- package/dist/ikoncomponents/widgets/type.js +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts +0 -1
- package/dist/ikoncomponents/work-in-progress/index.js +0 -4
- package/dist/index.d.ts +0 -138
- package/dist/shadcn/accordion.d.ts +0 -7
- package/dist/shadcn/accordion.js +0 -33
- package/dist/shadcn/alert-dialog.d.ts +0 -20
- package/dist/shadcn/alert-dialog.js +0 -83
- package/dist/shadcn/alert.d.ts +0 -9
- package/dist/shadcn/alert.js +0 -38
- package/dist/shadcn/aspect-ratio.d.ts +0 -3
- package/dist/shadcn/aspect-ratio.js +0 -19
- package/dist/shadcn/avatar.d.ts +0 -6
- package/dist/shadcn/avatar.js +0 -28
- package/dist/shadcn/badge.d.ts +0 -9
- package/dist/shadcn/badge.js +0 -35
- package/dist/shadcn/breadcrumb.d.ts +0 -11
- package/dist/shadcn/breadcrumb.js +0 -45
- package/dist/shadcn/button.d.ts +0 -10
- package/dist/shadcn/button.js +0 -47
- package/dist/shadcn/calendar.d.ts +0 -8
- package/dist/shadcn/calendar.js +0 -61
- package/dist/shadcn/card.d.ts +0 -9
- package/dist/shadcn/card.js +0 -42
- package/dist/shadcn/checkbox.d.ts +0 -4
- package/dist/shadcn/checkbox.js +0 -21
- package/dist/shadcn/collapsible.d.ts +0 -5
- package/dist/shadcn/collapsible.js +0 -27
- package/dist/shadcn/command.d.ts +0 -18
- package/dist/shadcn/command.js +0 -54
- package/dist/shadcn/date-input.d.ts +0 -7
- package/dist/shadcn/date-input.js +0 -179
- package/dist/shadcn/date-range-picker.d.ts +0 -24
- package/dist/shadcn/date-range-picker.js +0 -45
- package/dist/shadcn/dialog.d.ts +0 -15
- package/dist/shadcn/dialog.js +0 -57
- package/dist/shadcn/drawer.d.ts +0 -13
- package/dist/shadcn/drawer.js +0 -56
- package/dist/shadcn/dropdown-menu.d.ts +0 -25
- package/dist/shadcn/dropdown-menu.js +0 -77
- package/dist/shadcn/form.d.ts +0 -24
- package/dist/shadcn/form.js +0 -70
- package/dist/shadcn/hover-card.d.ts +0 -6
- package/dist/shadcn/hover-card.js +0 -28
- package/dist/shadcn/input-otp.d.ts +0 -34
- package/dist/shadcn/input-otp.js +0 -40
- package/dist/shadcn/input.d.ts +0 -3
- package/dist/shadcn/input.js +0 -18
- package/dist/shadcn/label.d.ts +0 -4
- package/dist/shadcn/label.js +0 -20
- package/dist/shadcn/navigation-menu.d.ts +0 -16
- package/dist/shadcn/navigation-menu.js +0 -74
- package/dist/shadcn/popover.d.ts +0 -7
- package/dist/shadcn/popover.js +0 -32
- package/dist/shadcn/progress.d.ts +0 -8
- package/dist/shadcn/progress.js +0 -23
- package/dist/shadcn/radio-group.d.ts +0 -5
- package/dist/shadcn/radio-group.js +0 -25
- package/dist/shadcn/scroll-area.d.ts +0 -5
- package/dist/shadcn/scroll-area.js +0 -26
- package/dist/shadcn/select.d.ts +0 -15
- package/dist/shadcn/select.js +0 -59
- package/dist/shadcn/separator.d.ts +0 -4
- package/dist/shadcn/separator.js +0 -20
- package/dist/shadcn/sheet.d.ts +0 -13
- package/dist/shadcn/sheet.js +0 -61
- package/dist/shadcn/sidebar.d.ts +0 -69
- package/dist/shadcn/sidebar.js +0 -242
- package/dist/shadcn/skeleton.d.ts +0 -3
- package/dist/shadcn/skeleton.js +0 -18
- package/dist/shadcn/slider.d.ts +0 -4
- package/dist/shadcn/slider.js +0 -26
- package/dist/shadcn/sonner.d.ts +0 -3
- package/dist/shadcn/sonner.js +0 -25
- package/dist/shadcn/switch.d.ts +0 -4
- package/dist/shadcn/switch.js +0 -20
- package/dist/shadcn/table.d.ts +0 -10
- package/dist/shadcn/table.js +0 -47
- package/dist/shadcn/tabs.d.ts +0 -7
- package/dist/shadcn/tabs.js +0 -32
- package/dist/shadcn/textarea.d.ts +0 -3
- package/dist/shadcn/textarea.js +0 -18
- package/dist/shadcn/toggle-group.d.ts +0 -9
- package/dist/shadcn/toggle-group.js +0 -35
- package/dist/shadcn/toggle.d.ts +0 -9
- package/dist/shadcn/toggle.js +0 -38
- package/dist/shadcn/tooltip.d.ts +0 -7
- package/dist/shadcn/tooltip.js +0 -32
- package/dist/shadcn/workflow.d.ts +0 -20
- package/dist/shadcn/workflow.js +0 -20
- package/dist/styles.css +0 -6163
- package/dist/utils/actions/account/index.d.ts +0 -5
- package/dist/utils/actions/account/index.js +0 -28
- package/dist/utils/actions/account/type.d.ts +0 -4
- package/dist/utils/actions/account/type.js +0 -1
- package/dist/utils/actions/auth/index.d.ts +0 -7
- package/dist/utils/actions/common/utils.d.ts +0 -5
- package/dist/utils/actions/software/index.d.ts +0 -11
- package/dist/utils/actions/software/index.js +0 -75
- package/dist/utils/api/accountService/index.d.ts +0 -23
- package/dist/utils/api/accountService/index.js +0 -64
- package/dist/utils/api/accountService/type.d.ts +0 -4
- package/dist/utils/api/accountService/type.js +0 -1
- package/dist/utils/api/file-upload/index.d.ts +0 -5
- package/dist/utils/api/file-upload/index.js +0 -80
- package/dist/utils/api/file-upload/type.d.ts +0 -6
- package/dist/utils/api/file-upload/type.js +0 -1
- package/dist/utils/api/ikonBaseApi.d.ts +0 -12
- package/dist/utils/api/loginService/index.d.ts +0 -12
- package/dist/utils/api/loginService/index.js +0 -72
- package/dist/utils/api/loginService/type.js +0 -1
- package/dist/utils/api/softwareService/index.d.ts +0 -64
- package/dist/utils/api/softwareService/index.js +0 -212
- package/dist/utils/api/softwareService/type.d.ts +0 -54
- package/dist/utils/api/softwareService/type.js +0 -1
- package/dist/utils/border-radius-provider.d.ts +0 -11
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/cn.js +0 -5
- package/dist/utils/font-provider.d.ts +0 -11
- package/dist/utils/session/cookieSession.d.ts +0 -8
- package/dist/utils/session/cookieSession.js +0 -33
- package/dist/utils/theme-provider/index.d.ts +0 -3
- package/dist/utils/theme-provider/index.js +0 -18
- package/dist/utils/token-management/index.d.ts +0 -10
- package/dist/utils/token-management/index.js +0 -69
- package/dist/utils/token-management/types.d.ts +0 -6
- package/dist/utils/token-management/types.js +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface RefreshContextType {
|
|
3
|
-
refresh: () => void;
|
|
4
|
-
refreshCounter: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function RefreshProvider({ children }: {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function useRefresh(): RefreshContextType;
|
|
10
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState, useCallback } from 'react';
|
|
3
|
-
const RefreshContext = createContext(undefined);
|
|
4
|
-
export function RefreshProvider({ children }) {
|
|
5
|
-
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
6
|
-
const refresh = useCallback(() => {
|
|
7
|
-
setRefreshCounter((prev) => prev + 1);
|
|
8
|
-
}, []);
|
|
9
|
-
return (_jsx(RefreshContext.Provider, { value: { refresh, refreshCounter }, children: children }));
|
|
10
|
-
}
|
|
11
|
-
export function useRefresh() {
|
|
12
|
-
const context = useContext(RefreshContext);
|
|
13
|
-
if (context === undefined) {
|
|
14
|
-
throw new Error('useRefresh must be used within a RefreshProvider');
|
|
15
|
-
}
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { LucideIcon } from 'lucide-react';
|
|
3
|
-
export interface SidebarNavSubItem {
|
|
4
|
-
title: string;
|
|
5
|
-
url: string;
|
|
6
|
-
isActive?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface SidebarNavItem {
|
|
9
|
-
title: string;
|
|
10
|
-
url: string;
|
|
11
|
-
icon?: LucideIcon;
|
|
12
|
-
isActive?: boolean;
|
|
13
|
-
default?: boolean;
|
|
14
|
-
items?: SidebarNavSubItem[];
|
|
15
|
-
header?: ReactNode;
|
|
16
|
-
footer?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export interface SidebarNavContextType {
|
|
19
|
-
navItems: SidebarNavItem[];
|
|
20
|
-
header: ReactNode | null;
|
|
21
|
-
footer: ReactNode | null;
|
|
22
|
-
setNavItems: (items: SidebarNavItem[]) => void;
|
|
23
|
-
addNavItem: (item: SidebarNavItem) => void;
|
|
24
|
-
removeNavItem: (title: string) => void;
|
|
25
|
-
updateNavItem: (title: string, updates: Partial<SidebarNavItem>) => void;
|
|
26
|
-
clearNavItems: () => void;
|
|
27
|
-
setSidebarHeader: (header: ReactNode) => void;
|
|
28
|
-
setSidebarFooter: (footer: ReactNode) => void;
|
|
29
|
-
}
|
|
30
|
-
export declare function SidebarNavProvider({ children }: {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare function useSidebarNav(): SidebarNavContextType;
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
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;
|
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|