ikoncomponents 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/ikoncomponents/action-menu/index.d.ts +5 -0
- package/dist/ikoncomponents/action-menu/index.js +42 -0
- package/dist/ikoncomponents/action-menu/type.d.ts +14 -0
- package/dist/ikoncomponents/action-menu/type.js +1 -0
- package/dist/ikoncomponents/activity-sheet/index.d.ts +11 -0
- package/dist/ikoncomponents/activity-sheet/index.js +23 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +21 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +30 -0
- package/dist/ikoncomponents/alert-dialog/index.d.ts +14 -0
- package/dist/ikoncomponents/alert-dialog/index.js +20 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +18 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +43 -0
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +5 -0
- package/dist/ikoncomponents/app-breadcrumb/index.js +57 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +5 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +16 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +39 -0
- package/dist/ikoncomponents/big-calendar/index.d.ts +3 -0
- package/dist/ikoncomponents/big-calendar/index.js +35 -0
- package/dist/ikoncomponents/big-calendar/type.d.ts +31 -0
- package/dist/ikoncomponents/big-calendar/type.js +1 -0
- package/dist/ikoncomponents/buttons/index.d.ts +18 -0
- package/dist/ikoncomponents/buttons/index.js +38 -0
- package/dist/ikoncomponents/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/combobox-input/index.js +18 -0
- package/dist/ikoncomponents/combobox-input/type.d.ts +13 -0
- package/dist/ikoncomponents/combobox-input/type.js +1 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +21 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +85 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +22 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +35 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +38 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +13 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +18 -0
- package/dist/ikoncomponents/data-table/function.d.ts +1 -0
- package/dist/ikoncomponents/data-table/function.js +6 -0
- package/dist/ikoncomponents/data-table/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/index.js +223 -0
- package/dist/ikoncomponents/data-table/type.d.ts +60 -0
- package/dist/ikoncomponents/data-table/type.js +1 -0
- package/dist/ikoncomponents/e-chart/index.d.ts +15 -0
- package/dist/ikoncomponents/e-chart/index.js +115 -0
- package/dist/ikoncomponents/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/file-input/index.js +21 -0
- package/dist/ikoncomponents/fileUpload/index.d.ts +15 -0
- package/dist/ikoncomponents/fileUpload/index.js +69 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +21 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +18 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +26 -0
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/date-input/index.js +15 -0
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/file-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +6 -0
- package/{templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx → dist/ikoncomponents/form-fields/multi-combobox-input/index.js} +381 -574
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/textarea/index.js +18 -0
- package/dist/ikoncomponents/form-fields/types/index.d.ts +36 -0
- package/dist/ikoncomponents/form-fields/types/index.js +1 -0
- package/dist/ikoncomponents/glowing-effect/index.d.ts +14 -0
- package/dist/ikoncomponents/glowing-effect/index.js +84 -0
- package/dist/ikoncomponents/icon/index.d.ts +8 -0
- package/dist/ikoncomponents/icon/index.js +23 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +15 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx → dist/ikoncomponents/image-cropper-upload/components/newCropper.js} +85 -117
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +7 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +145 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +92 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +14 -0
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +14 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx → dist/ikoncomponents/image-cropper-upload/image-cropper/index.js} +87 -119
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +27 -0
- package/dist/ikoncomponents/image-cropper-upload/index.js +49 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +16 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +73 -0
- package/dist/ikoncomponents/loading-spinner/index.d.ts +9 -0
- package/dist/ikoncomponents/loading-spinner/index.js +19 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +10 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.js +17 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +33 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +52 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.js +24 -0
- package/dist/ikoncomponents/main-layout/footer.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/footer.js +5 -0
- package/dist/ikoncomponents/main-layout/header.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/header.js +15 -0
- package/dist/ikoncomponents/main-layout/index.d.ts +6 -0
- package/dist/ikoncomponents/main-layout/index.js +11 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +60 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.js +119 -0
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +11 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +33 -0
- package/dist/ikoncomponents/multi-combobox/index.d.ts +13 -0
- package/dist/ikoncomponents/multi-combobox/index.js +202 -0
- package/dist/ikoncomponents/no-data/index.d.ts +3 -0
- package/dist/ikoncomponents/no-data/index.js +5 -0
- package/dist/ikoncomponents/page-wrapper/index.d.ts +9 -0
- package/dist/ikoncomponents/page-wrapper/index.js +7 -0
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +3 -0
- package/dist/ikoncomponents/password-strength-meter/index.js +40 -0
- package/dist/ikoncomponents/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/phone-input/index.js +41 -0
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +6 -0
- package/dist/ikoncomponents/provider-wrapper/index.js +11 -0
- package/dist/ikoncomponents/search-input/index.d.ts +1 -0
- package/dist/ikoncomponents/search-input/index.js +19 -0
- package/dist/ikoncomponents/sheet/index.d.ts +10 -0
- package/dist/ikoncomponents/sheet/index.js +6 -0
- package/dist/ikoncomponents/simple-widget/index.d.ts +14 -0
- package/dist/ikoncomponents/simple-widget/index.js +14 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +5 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +6 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +3 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +5 -0
- package/dist/ikoncomponents/tabs/index.d.ts +2 -0
- package/dist/ikoncomponents/tabs/index.js +50 -0
- package/{templates/default/ikoncomponents/tabs/type.ts → dist/ikoncomponents/tabs/type.d.ts} +19 -20
- package/dist/ikoncomponents/tabs/type.js +2 -0
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -0
- package/{templates/default/ikoncomponents/theme-toggle-btn/index.tsx → dist/ikoncomponents/theme-toggle-btn/index.js} +118 -189
- package/dist/ikoncomponents/title-progress/index.d.ts +12 -0
- package/dist/ikoncomponents/title-progress/index.js +10 -0
- package/dist/ikoncomponents/tooltip/index.d.ts +5 -0
- package/dist/ikoncomponents/tooltip/index.js +5 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +31 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.js +143 -0
- package/dist/ikoncomponents/upload-tab/index.d.ts +1 -0
- package/dist/ikoncomponents/upload-tab/index.js +92 -0
- package/dist/ikoncomponents/widgets/index.d.ts +2 -0
- package/dist/ikoncomponents/widgets/index.js +14 -0
- package/dist/ikoncomponents/widgets/type.d.ts +10 -0
- package/dist/ikoncomponents/widgets/type.js +2 -0
- package/dist/ikoncomponents/work-in-progress/index.d.ts +1 -0
- package/dist/ikoncomponents/work-in-progress/index.js +4 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +116 -14
- package/dist/shadcn/accordion.d.ts +7 -0
- package/dist/shadcn/accordion.js +33 -0
- package/dist/shadcn/alert-dialog.d.ts +20 -0
- package/dist/shadcn/alert-dialog.js +83 -0
- package/dist/shadcn/alert.d.ts +9 -0
- package/dist/shadcn/alert.js +38 -0
- package/dist/shadcn/aspect-ratio.d.ts +3 -0
- package/dist/shadcn/aspect-ratio.js +19 -0
- package/dist/shadcn/avatar.d.ts +6 -0
- package/dist/shadcn/avatar.js +28 -0
- package/dist/shadcn/badge.d.ts +9 -0
- package/dist/shadcn/badge.js +35 -0
- package/dist/shadcn/breadcrumb.d.ts +11 -0
- package/dist/shadcn/breadcrumb.js +45 -0
- package/dist/shadcn/button.d.ts +10 -0
- package/dist/shadcn/button.js +47 -0
- package/dist/shadcn/calendar.d.ts +8 -0
- package/dist/shadcn/calendar.js +61 -0
- package/dist/shadcn/card.d.ts +9 -0
- package/dist/shadcn/card.js +42 -0
- package/dist/shadcn/checkbox.d.ts +4 -0
- package/dist/shadcn/checkbox.js +21 -0
- package/dist/shadcn/collapsible.d.ts +5 -0
- package/dist/shadcn/collapsible.js +27 -0
- package/dist/shadcn/command.d.ts +18 -0
- package/dist/shadcn/command.js +54 -0
- package/dist/shadcn/date-input.d.ts +7 -0
- package/dist/shadcn/date-input.js +179 -0
- package/dist/shadcn/date-range-picker.d.ts +24 -0
- package/dist/shadcn/date-range-picker.js +45 -0
- package/dist/shadcn/dialog.d.ts +15 -0
- package/dist/shadcn/dialog.js +57 -0
- package/dist/shadcn/drawer.d.ts +13 -0
- package/dist/shadcn/drawer.js +56 -0
- package/dist/shadcn/dropdown-menu.d.ts +25 -0
- package/dist/shadcn/dropdown-menu.js +77 -0
- package/dist/shadcn/form.d.ts +24 -0
- package/dist/shadcn/form.js +70 -0
- package/dist/shadcn/hover-card.d.ts +6 -0
- package/dist/shadcn/hover-card.js +28 -0
- package/dist/shadcn/input-otp.d.ts +34 -0
- package/dist/shadcn/input-otp.js +40 -0
- package/dist/shadcn/input.d.ts +3 -0
- package/dist/shadcn/input.js +18 -0
- package/dist/shadcn/label.d.ts +4 -0
- package/dist/shadcn/label.js +20 -0
- package/dist/shadcn/navigation-menu.d.ts +16 -0
- package/dist/shadcn/navigation-menu.js +74 -0
- package/dist/shadcn/popover.d.ts +7 -0
- package/dist/shadcn/popover.js +32 -0
- package/dist/shadcn/progress.d.ts +8 -0
- package/dist/shadcn/progress.js +23 -0
- package/dist/shadcn/radio-group.d.ts +5 -0
- package/dist/shadcn/radio-group.js +25 -0
- package/dist/shadcn/scroll-area.d.ts +5 -0
- package/dist/shadcn/scroll-area.js +26 -0
- package/dist/shadcn/select.d.ts +15 -0
- package/dist/shadcn/select.js +59 -0
- package/dist/shadcn/separator.d.ts +4 -0
- package/dist/shadcn/separator.js +20 -0
- package/dist/shadcn/sheet.d.ts +13 -0
- package/dist/shadcn/sheet.js +61 -0
- package/dist/shadcn/sidebar.d.ts +69 -0
- package/dist/shadcn/sidebar.js +242 -0
- package/dist/shadcn/skeleton.d.ts +3 -0
- package/dist/shadcn/skeleton.js +18 -0
- package/dist/shadcn/slider.d.ts +4 -0
- package/dist/shadcn/slider.js +26 -0
- package/dist/shadcn/sonner.d.ts +3 -0
- package/dist/shadcn/sonner.js +25 -0
- package/dist/shadcn/switch.d.ts +4 -0
- package/dist/shadcn/switch.js +20 -0
- package/dist/shadcn/table.d.ts +10 -0
- package/dist/shadcn/table.js +47 -0
- package/dist/shadcn/tabs.d.ts +7 -0
- package/dist/shadcn/tabs.js +32 -0
- package/dist/shadcn/textarea.d.ts +3 -0
- package/dist/shadcn/textarea.js +18 -0
- package/dist/shadcn/toggle-group.d.ts +9 -0
- package/dist/shadcn/toggle-group.js +35 -0
- package/dist/shadcn/toggle.d.ts +9 -0
- package/dist/shadcn/toggle.js +38 -0
- package/dist/shadcn/tooltip.d.ts +7 -0
- package/dist/shadcn/tooltip.js +32 -0
- package/dist/shadcn/workflow.d.ts +20 -0
- package/dist/shadcn/workflow.js +20 -0
- package/dist/styles.css +6163 -0
- package/dist/utils/actions/account/index.d.ts +5 -0
- package/dist/utils/actions/account/index.js +28 -0
- package/dist/utils/actions/account/type.d.ts +4 -0
- package/dist/utils/actions/account/type.js +1 -0
- package/dist/utils/actions/auth/index.d.ts +7 -0
- package/{templates/default/utils/actions/auth/index.ts → dist/utils/actions/auth/index.js} +58 -69
- package/dist/utils/actions/common/utils.d.ts +5 -0
- package/{templates/default/utils/actions/common/utils.ts → dist/utils/actions/common/utils.js} +25 -28
- package/dist/utils/actions/software/index.d.ts +11 -0
- package/dist/utils/actions/software/index.js +75 -0
- package/dist/utils/api/accountService/index.d.ts +23 -0
- package/dist/utils/api/accountService/index.js +64 -0
- package/dist/utils/api/accountService/type.d.ts +4 -0
- package/dist/utils/api/accountService/type.js +1 -0
- package/dist/utils/api/file-upload/index.d.ts +5 -0
- package/dist/utils/api/file-upload/index.js +80 -0
- package/dist/utils/api/file-upload/type.d.ts +6 -0
- package/dist/utils/api/file-upload/type.js +1 -0
- package/dist/utils/api/ikonBaseApi.d.ts +12 -0
- package/{templates/default/utils/api/ikonBaseApi.ts → dist/utils/api/ikonBaseApi.js} +104 -132
- package/dist/utils/api/loginService/index.d.ts +12 -0
- package/dist/utils/api/loginService/index.js +72 -0
- package/{templates/default/utils/api/loginService/type.ts → dist/utils/api/loginService/type.d.ts} +31 -35
- package/dist/utils/api/loginService/type.js +1 -0
- package/dist/utils/api/softwareService/index.d.ts +64 -0
- package/dist/utils/api/softwareService/index.js +212 -0
- package/dist/utils/api/softwareService/type.d.ts +54 -0
- package/dist/utils/api/softwareService/type.js +1 -0
- package/dist/utils/border-radius-provider.d.ts +11 -0
- package/{templates/default/utils/border-radius-provider.tsx → dist/utils/border-radius-provider.js} +35 -59
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +5 -0
- package/dist/utils/font-provider.d.ts +11 -0
- package/{templates/default/utils/font-provider.tsx → dist/utils/font-provider.js} +37 -61
- package/dist/utils/session/cookieSession.d.ts +8 -0
- package/dist/utils/session/cookieSession.js +33 -0
- package/dist/utils/theme-provider/index.d.ts +3 -0
- package/dist/utils/theme-provider/index.js +18 -0
- package/dist/utils/token-management/index.d.ts +10 -0
- package/dist/utils/token-management/index.js +69 -0
- package/dist/utils/token-management/types.d.ts +6 -0
- package/dist/utils/token-management/types.js +1 -0
- package/package.json +91 -17
- package/bin.js +0 -2
- package/dist/commands/init.js +0 -63
- package/dist/utlis/copyDir.js +0 -7
- package/templates/default/hooks/use-mobile.ts +0 -19
- package/templates/default/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,92 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input } from '../../../shadcn/input';
|
|
3
|
+
import { Label } from '../../../shadcn/label';
|
|
4
|
+
import { ToggleGroup, ToggleGroupItem } from '../../../shadcn/toggle-group';
|
|
5
|
+
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, FileImage, ImageIcon, RotateCcw, RotateCw, Square, ZoomIn, ZoomOut } from 'lucide-react';
|
|
6
|
+
import { memo, useEffect, useState } from 'react';
|
|
7
|
+
import { ImageCropper } from '../image-cropper';
|
|
8
|
+
import Image from 'next/image';
|
|
9
|
+
import { AspectRatio } from '../../../shadcn/aspect-ratio';
|
|
10
|
+
import { TextButton } from '../../buttons';
|
|
11
|
+
import { toast } from 'sonner';
|
|
12
|
+
import { FileInput } from '../../file-input';
|
|
13
|
+
import { useImageCropper } from '..';
|
|
14
|
+
const stateWiseAspectRatio = {
|
|
15
|
+
landscape: 4 / 3,
|
|
16
|
+
potrait: 3 / 4,
|
|
17
|
+
icon: 1 / 1
|
|
18
|
+
};
|
|
19
|
+
function CropperFormComponent({ onNewFileUpload }) {
|
|
20
|
+
const { originalImage, setOriginalImage, aspectRatioWiseImages, setAspectRatioWiseImages } = useImageCropper();
|
|
21
|
+
const [croppedImage, setCroppedImage] = useState(null);
|
|
22
|
+
const [activeState, setActiveState] = useState();
|
|
23
|
+
const [rotationAngle, setRotationAngle] = useState(0);
|
|
24
|
+
const [scale, setScale] = useState(1);
|
|
25
|
+
const [moveDirection, setMoveDirection] = useState({
|
|
26
|
+
x: 0,
|
|
27
|
+
y: 0,
|
|
28
|
+
});
|
|
29
|
+
const [imageSrc, setImageSrc] = useState(null);
|
|
30
|
+
const handleDrop = (event) => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
handleFileChange(event.dataTransfer.files[0]);
|
|
33
|
+
};
|
|
34
|
+
const handleFileChange = (file) => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (typeof file === "string") {
|
|
37
|
+
setImageSrc(file);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if ((_a = file === null || file === void 0 ? void 0 : file.type) === null || _a === void 0 ? void 0 : _a.startsWith("image/")) {
|
|
41
|
+
onNewFileUpload === null || onNewFileUpload === void 0 ? void 0 : onNewFileUpload();
|
|
42
|
+
const reader = new FileReader();
|
|
43
|
+
reader.onloadend = () => {
|
|
44
|
+
setImageSrc(reader.result);
|
|
45
|
+
setActiveState(undefined);
|
|
46
|
+
};
|
|
47
|
+
reader.readAsDataURL(file);
|
|
48
|
+
setOriginalImage(Object.assign(Object.assign({}, originalImage), { image: file, name: file.name }));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
toast.error("Please select a valid image file.");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (originalImage.image) {
|
|
57
|
+
handleFileChange(originalImage.image);
|
|
58
|
+
}
|
|
59
|
+
}, [originalImage.image]);
|
|
60
|
+
const getImagePreview = (state) => {
|
|
61
|
+
const imgSource = croppedImage && activeState === state ? croppedImage : aspectRatioWiseImages[state];
|
|
62
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { className: 'mb-3', children: state }), _jsx(AspectRatio, { ratio: stateWiseAspectRatio[state], className: 'bg-muted', children: imgSource &&
|
|
63
|
+
_jsx(Image, { src: imgSource || "", alt: `Preview ${state}`, fill: true }) })] }));
|
|
64
|
+
};
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (croppedImage) {
|
|
67
|
+
if (activeState) {
|
|
68
|
+
setAspectRatioWiseImages(Object.assign(Object.assign({}, aspectRatioWiseImages), { [activeState]: croppedImage }));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setAspectRatioWiseImages({
|
|
72
|
+
landscape: croppedImage,
|
|
73
|
+
potrait: croppedImage,
|
|
74
|
+
icon: croppedImage
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [croppedImage]);
|
|
79
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: 'flex flex-col gap-3 h-full overflow-auto', children: [_jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageName", children: "Image Name" }), _jsx(FileInput, { id: "inputImage", accept: "image/*", fileNamePlaceholder: "Enter image name", fileName: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.name) || "", onChange: (e) => {
|
|
80
|
+
var _a;
|
|
81
|
+
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
82
|
+
if (file) {
|
|
83
|
+
handleFileChange(file);
|
|
84
|
+
}
|
|
85
|
+
}, onFileNameChange: (e) => {
|
|
86
|
+
setOriginalImage(Object.assign(Object.assign({}, originalImage), { name: e.target.value }));
|
|
87
|
+
} })] }), _jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageDescription", children: "Image Description" }), _jsx(Input, { id: "imageDescription", placeholder: "Enter image Description", value: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.description) || "", onChange: (e) => setOriginalImage(Object.assign(Object.assign({}, originalImage), { description: e.target.value })) })] })] }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3', children: [_jsxs("div", { className: 'flex-grow flex flex-col gap-3', children: [_jsxs("div", { children: [_jsx("h3", { className: 'mb-3', children: "Original Image" }), _jsx(AspectRatio, { ratio: 4 / 3, className: 'flex justify-center items-center bg-muted text-muted-foreground', onDrop: handleDrop, onDragOver: (e) => e.preventDefault(), children: imageSrc ?
|
|
88
|
+
_jsx(ImageCropper, { src: imageSrc, onCroppedImage: setCroppedImage, aspectRatio: stateWiseAspectRatio[activeState || "icon"], rotationAngle: rotationAngle, zoomLevel: scale, moveDirection: moveDirection })
|
|
89
|
+
:
|
|
90
|
+
_jsxs("div", { className: "text-center", children: [_jsx(Label, { htmlFor: "inputImage", children: "Drag and drop an image here" }), _jsx("div", { className: "mt-3", children: _jsx(TextButton, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage")) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Browse Image" }) })] }) })] }), _jsxs("div", { className: "flex flex-col lg:flex-row gap-3 justify-between", children: [_jsx("div", { children: _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: activeState, onValueChange: (value) => setActiveState(value), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "landscape", children: _jsx(ImageIcon, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "potrait", children: _jsx(FileImage, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "icon", children: _jsx(Square, {}) })] }) }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setRotationAngle(parseInt(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "90", children: _jsx(RotateCw, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-90", children: _jsx(RotateCcw, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: '', children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "up", onClick: () => setMoveDirection({ x: 0, y: -5 }), children: _jsx(ArrowUp, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "down", onClick: () => setMoveDirection({ x: 0, y: 5 }), children: _jsx(ArrowDown, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-none border-e-0', value: "left", onClick: () => setMoveDirection({ x: -5, y: 0 }), children: _jsx(ArrowLeft, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "right", onClick: () => setMoveDirection({ x: 5, y: 0 }), children: _jsx(ArrowRight, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setScale(pre => pre + parseFloat(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "0.1", children: _jsx(ZoomIn, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-0.1", children: _jsx(ZoomOut, {}) })] })] })] })] }), _jsxs("div", { className: "flex flex-row lg:flex-col gap-3 w-full lg:w-48", children: [_jsx("div", { className: 'w-5/5', children: getImagePreview("landscape") }), _jsx("div", { className: 'w-4/5', children: getImagePreview("potrait") }), _jsx("div", { className: 'w-3/5', children: getImagePreview("icon") })] })] })] }) }));
|
|
91
|
+
}
|
|
92
|
+
export const CropperForm = memo(CropperFormComponent);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AspectRatioWiseImagesProps, OriginalImageProps } from '..';
|
|
2
|
+
export declare function CropperFormWithModal({ open, onOpenChange, onCropperChange }: Readonly<{
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
6
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../../../shadcn/dialog';
|
|
3
|
+
import { CropperForm } from '../cropper-form';
|
|
4
|
+
import { TextButton } from '../../buttons';
|
|
5
|
+
import { useImageCropper } from '..';
|
|
6
|
+
export function CropperFormWithModal({ open, onOpenChange, onCropperChange }) {
|
|
7
|
+
const { originalImage, aspectRatioWiseImages } = useImageCropper();
|
|
8
|
+
return (_jsx(Dialog, { modal: true, open: open, onOpenChange: (isOpen) => {
|
|
9
|
+
onOpenChange(isOpen);
|
|
10
|
+
}, children: _jsxs(DialogContent, { className: "max-w-full lg:max-w-5xl max-h-full overflow-auto", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: "Image to upload" }) }), _jsx(CropperForm, {}), _jsx(DialogFooter, { children: _jsx(TextButton, { onClick: () => {
|
|
11
|
+
onCropperChange(originalImage, aspectRatioWiseImages);
|
|
12
|
+
onOpenChange(false);
|
|
13
|
+
}, children: "Save Changes" }) })] }) }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "cropperjs/dist/cropper.css";
|
|
3
|
+
export interface CropperImgProps {
|
|
4
|
+
src: string | undefined;
|
|
5
|
+
onCroppedImage: (imageUrl: string) => void;
|
|
6
|
+
aspectRatio: number;
|
|
7
|
+
rotationAngle: number;
|
|
8
|
+
zoomLevel: number;
|
|
9
|
+
moveDirection: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const ImageCropper: React.NamedExoticComponent<CropperImgProps>;
|
|
@@ -1,119 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// Set the crop box data
|
|
89
|
-
cropper.setCropBoxData({
|
|
90
|
-
left: left,
|
|
91
|
-
top: top,
|
|
92
|
-
width: cropBoxWidth,
|
|
93
|
-
height: cropBoxHeight,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}, [aspectRatio]); // Trigger this effect whenever aspectRatio changes
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<Cropper
|
|
103
|
-
src={src}
|
|
104
|
-
style={{ height: "100%", width: "100%", objectFit: "contain" }}
|
|
105
|
-
guides={true} // Show guides for cropping
|
|
106
|
-
crop={onCrop} // Callback to capture the cropped area
|
|
107
|
-
ref={cropperRef}
|
|
108
|
-
dragMode='move'
|
|
109
|
-
movable={true}
|
|
110
|
-
zoomable={true} // Allow zooming of the image
|
|
111
|
-
scalable={true} // Prevent scaling of the crop box
|
|
112
|
-
cropBoxMovable={true} // Allow the crop box to be moved inside the image
|
|
113
|
-
cropBoxResizable={false} // Disable resizing the crop box
|
|
114
|
-
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const ImageCropper = memo(ImageCropperComponent);
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useEffect, useRef } from "react";
|
|
3
|
+
import Cropper from "react-cropper";
|
|
4
|
+
import "cropperjs/dist/cropper.css";
|
|
5
|
+
const ImageCropperComponent = ({ src, onCroppedImage, aspectRatio, rotationAngle, zoomLevel, moveDirection }) => {
|
|
6
|
+
const cropperRef = useRef(null);
|
|
7
|
+
function onCrop(event) {
|
|
8
|
+
var _a;
|
|
9
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
10
|
+
if (cropper) {
|
|
11
|
+
//cropper.setDragMode('move');
|
|
12
|
+
const croppedCanvas = cropper.getCroppedCanvas();
|
|
13
|
+
const croppedImageUrl = croppedCanvas.toDataURL("image/webp"); // Data URL for preview
|
|
14
|
+
onCroppedImage(croppedImageUrl);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.log("Cropper instance is not available.");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
var _a;
|
|
23
|
+
// Rotate the image whenever the rotation angle changes
|
|
24
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
25
|
+
if (cropper) {
|
|
26
|
+
cropper.rotate(rotationAngle); // Apply the rotation to the image
|
|
27
|
+
}
|
|
28
|
+
}, [rotationAngle]); // Effect will run whenever rotationAngle changes
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
var _a;
|
|
31
|
+
// Zoom the image whenever the zoom level changes
|
|
32
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
33
|
+
if (cropper) {
|
|
34
|
+
const cropBoxData = cropper.getCropBoxData();
|
|
35
|
+
if (cropBoxData.width) {
|
|
36
|
+
console.log('Inside cropper scale');
|
|
37
|
+
cropper.scale(zoomLevel); // Apply the zoom level
|
|
38
|
+
}
|
|
39
|
+
// Apply zoom directly without using getZoom method
|
|
40
|
+
}
|
|
41
|
+
}, [zoomLevel]); // Effect will run whenever zoomLevel changes
|
|
42
|
+
// Move the image based on the moveDirection prop
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
var _a;
|
|
45
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
46
|
+
if (cropper) {
|
|
47
|
+
// Make sure moveDirection is available before calling move
|
|
48
|
+
const cropBoxData = cropper.getCropBoxData();
|
|
49
|
+
if (cropBoxData.width) {
|
|
50
|
+
const { x, y } = moveDirection;
|
|
51
|
+
if (typeof x === "number" && typeof y === "number") {
|
|
52
|
+
cropper.move(x, y); // Move the image
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, [moveDirection]); // This effect runs whenever moveDirection changes
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
60
|
+
if (cropper) {
|
|
61
|
+
cropper.setAspectRatio(aspectRatio); // Dynamically set the aspect ratio
|
|
62
|
+
if (aspectRatio === 1) {
|
|
63
|
+
// Get the displayed (canvas) dimensions of the image
|
|
64
|
+
const canvasData = cropper.getCanvasData();
|
|
65
|
+
const canvasWidth = canvasData.width; // Displayed width of the image
|
|
66
|
+
const canvasHeight = canvasData.height; // Displayed height of the image
|
|
67
|
+
const canvasLeft = canvasData.left; // Left offset of the image within the container
|
|
68
|
+
const canvasTop = canvasData.top; // Top offset of the image within the container
|
|
69
|
+
// Define the desired crop box dimensions
|
|
70
|
+
const cropBoxWidth = 200; // Desired crop box width
|
|
71
|
+
const cropBoxHeight = 100; // Desired crop box height
|
|
72
|
+
// Calculate the center position for the crop box
|
|
73
|
+
const left = canvasLeft + (canvasWidth - cropBoxWidth) / 2;
|
|
74
|
+
const top = canvasTop + (canvasHeight - cropBoxHeight) / 2;
|
|
75
|
+
// Set the crop box data
|
|
76
|
+
cropper.setCropBoxData({
|
|
77
|
+
left: left,
|
|
78
|
+
top: top,
|
|
79
|
+
width: cropBoxWidth,
|
|
80
|
+
height: cropBoxHeight,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, [aspectRatio]); // Trigger this effect whenever aspectRatio changes
|
|
85
|
+
return (_jsx(Cropper, { src: src, style: { height: "100%", width: "100%", objectFit: "contain" }, guides: true, crop: onCrop, ref: cropperRef, dragMode: 'move', movable: true, zoomable: true, scalable: true, cropBoxMovable: true, cropBoxResizable: false }));
|
|
86
|
+
};
|
|
87
|
+
export const ImageCropper = memo(ImageCropperComponent);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CropperUploadImagesInfoProps } from './utils';
|
|
3
|
+
export interface ImageCropperContextProps {
|
|
4
|
+
originalImage: OriginalImageProps;
|
|
5
|
+
setOriginalImage: (originalImage: OriginalImageProps) => void;
|
|
6
|
+
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
7
|
+
setAspectRatioWiseImages: (aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface AspectRatioWiseImagesProps {
|
|
10
|
+
landscape: string | null;
|
|
11
|
+
potrait: string | null;
|
|
12
|
+
icon: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface OriginalImageProps {
|
|
15
|
+
image: string | File | null;
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ImageCropperProps {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
uploadedImages: CropperUploadImagesInfoProps | null;
|
|
22
|
+
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
23
|
+
modalOpen?: boolean;
|
|
24
|
+
onModalOpenChange?: (open: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }: ImageCropperProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const useImageCropper: () => ImageCropperContextProps;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
4
|
+
import { CropperFormWithModal } from './cropper-form-with-modal';
|
|
5
|
+
import { uploadedImagesToCropperImgObj } from './utils';
|
|
6
|
+
const ImageCropperContext = createContext(undefined);
|
|
7
|
+
export function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }) {
|
|
8
|
+
const [aspectRatioWiseImages, setAspectRatioWiseImages] = useState({
|
|
9
|
+
landscape: null,
|
|
10
|
+
potrait: null,
|
|
11
|
+
icon: null
|
|
12
|
+
});
|
|
13
|
+
const [originalImage, setOriginalImage] = useState({
|
|
14
|
+
image: null,
|
|
15
|
+
name: "",
|
|
16
|
+
description: "",
|
|
17
|
+
});
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
async function updateCropperImages() {
|
|
20
|
+
if (!uploadedImages)
|
|
21
|
+
return; // Prevent unnecessary processing
|
|
22
|
+
try {
|
|
23
|
+
const res = await uploadedImagesToCropperImgObj(uploadedImages);
|
|
24
|
+
if (res) {
|
|
25
|
+
// Check if state is different before updating
|
|
26
|
+
setOriginalImage((prev) => JSON.stringify(prev) === JSON.stringify(res.originalImage) ? prev : res.originalImage);
|
|
27
|
+
setAspectRatioWiseImages((prev) => JSON.stringify(prev) === JSON.stringify(res.aspectRatioWiseImages) ? prev : res.aspectRatioWiseImages);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error("Error processing uploaded images:", error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
updateCropperImages();
|
|
35
|
+
}, [uploadedImages]); // Runs only when `uploadedImages` changes
|
|
36
|
+
return (_jsxs(ImageCropperContext.Provider, { value: {
|
|
37
|
+
originalImage,
|
|
38
|
+
setOriginalImage,
|
|
39
|
+
aspectRatioWiseImages,
|
|
40
|
+
setAspectRatioWiseImages
|
|
41
|
+
}, children: [children, modalOpen && onModalOpenChange && _jsx(CropperFormWithModal, { open: modalOpen, onOpenChange: onModalOpenChange, onCropperChange: onCropperChange })] }));
|
|
42
|
+
}
|
|
43
|
+
export const useImageCropper = () => {
|
|
44
|
+
const context = useContext(ImageCropperContext);
|
|
45
|
+
if (!context) {
|
|
46
|
+
throw new Error("useImageCropper must be used within a ImageCropperProvider");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AspectRatioWiseImagesProps, OriginalImageProps } from "..";
|
|
2
|
+
import { FileinfoProps } from "../../../utils/api/file-upload/type";
|
|
3
|
+
export interface CropperUploadImagesInfoProps {
|
|
4
|
+
originalImageInfo?: FileinfoProps | null;
|
|
5
|
+
imageName?: string;
|
|
6
|
+
imageDescription?: string;
|
|
7
|
+
landscapeImageInfo?: FileinfoProps | null;
|
|
8
|
+
portaitImageInfo?: FileinfoProps | null;
|
|
9
|
+
iconImageInfo?: FileinfoProps | null;
|
|
10
|
+
}
|
|
11
|
+
export interface UploadedImagesToCropperImgObjProps {
|
|
12
|
+
originalImage: OriginalImageProps;
|
|
13
|
+
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
14
|
+
}
|
|
15
|
+
export declare function imageCropperFilesUpload(originalImage: OriginalImageProps, aspectRatioWiseImages?: AspectRatioWiseImagesProps, resourceId?: string): Promise<CropperUploadImagesInfoProps | null>;
|
|
16
|
+
export declare function uploadedImagesToCropperImgObj(uploadedImages: CropperUploadImagesInfoProps | null): Promise<UploadedImagesToCropperImgObjProps | null>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { base64FileUpload, singleFileUpload, } from "../../../utils/api/file-upload";
|
|
2
|
+
import { getResourceUrl } from "../../../utils/actions/common/utils";
|
|
3
|
+
export async function imageCropperFilesUpload(originalImage, aspectRatioWiseImages, resourceId) {
|
|
4
|
+
if (!originalImage.image) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
const originalImageInfo = await singleFileUpload(originalImage.image, resourceId);
|
|
8
|
+
const cropperUploadImagesInfo = {
|
|
9
|
+
originalImageInfo: originalImageInfo,
|
|
10
|
+
imageName: originalImage.name,
|
|
11
|
+
imageDescription: originalImage.description,
|
|
12
|
+
landscapeImageInfo: null,
|
|
13
|
+
portaitImageInfo: null,
|
|
14
|
+
iconImageInfo: null,
|
|
15
|
+
};
|
|
16
|
+
if (aspectRatioWiseImages) {
|
|
17
|
+
if (aspectRatioWiseImages.landscape) {
|
|
18
|
+
try {
|
|
19
|
+
cropperUploadImagesInfo["landscapeImageInfo"] = await base64FileUpload(aspectRatioWiseImages.landscape, originalImage.name + "_L.webp", "image/webp");
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (aspectRatioWiseImages.potrait) {
|
|
26
|
+
try {
|
|
27
|
+
cropperUploadImagesInfo["portaitImageInfo"] = await base64FileUpload(aspectRatioWiseImages.potrait, originalImage.name + "_P.webp", "image/webp");
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (aspectRatioWiseImages.icon) {
|
|
34
|
+
try {
|
|
35
|
+
cropperUploadImagesInfo["iconImageInfo"] = await base64FileUpload(aspectRatioWiseImages.icon, originalImage.name + "_I.webp", "image/webp");
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error(error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return cropperUploadImagesInfo;
|
|
43
|
+
}
|
|
44
|
+
export async function uploadedImagesToCropperImgObj(uploadedImages) {
|
|
45
|
+
if (!uploadedImages) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const originalImageUrl = uploadedImages.originalImageInfo
|
|
49
|
+
? await getResourceUrl(uploadedImages.originalImageInfo)
|
|
50
|
+
: null;
|
|
51
|
+
const landscapeImageUrl = uploadedImages.landscapeImageInfo
|
|
52
|
+
? await getResourceUrl(uploadedImages.landscapeImageInfo)
|
|
53
|
+
: null;
|
|
54
|
+
const portaitImageUrl = uploadedImages.portaitImageInfo
|
|
55
|
+
? await getResourceUrl(uploadedImages.portaitImageInfo)
|
|
56
|
+
: null;
|
|
57
|
+
const iconImageUrl = uploadedImages.iconImageInfo
|
|
58
|
+
? await getResourceUrl(uploadedImages.iconImageInfo)
|
|
59
|
+
: null;
|
|
60
|
+
const obj = {
|
|
61
|
+
originalImage: {
|
|
62
|
+
image: originalImageUrl,
|
|
63
|
+
name: uploadedImages.imageName,
|
|
64
|
+
description: uploadedImages.imageDescription,
|
|
65
|
+
},
|
|
66
|
+
aspectRatioWiseImages: {
|
|
67
|
+
landscape: landscapeImageUrl,
|
|
68
|
+
potrait: portaitImageUrl,
|
|
69
|
+
icon: iconImageUrl,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
+
size?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LoadingSpinnerProps extends ISVGProps {
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const LoadingSpinner: ({ size, className, visible, ...props }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "../../utils/cn";
|
|
14
|
+
export const LoadingSpinner = (_a) => {
|
|
15
|
+
var { size = 48, className, visible = true } = _a, props = __rest(_a, ["size", "className", "visible"]);
|
|
16
|
+
if (!visible)
|
|
17
|
+
return null;
|
|
18
|
+
return (_jsx("div", { className: "h-full w-full", children: _jsx("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size }, props, { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("animate-spin", className), children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })) }) }));
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|