ikoncomponents 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init.js +57 -0
- package/dist/index.js +3 -116
- package/dist/utlis/copyDir.js +7 -0
- package/package.json +12 -90
- package/templates/default/hooks/use-mobile.ts +19 -0
- package/templates/default/ikonShade/accordion.tsx +66 -0
- package/templates/default/ikonShade/alert-dialog.tsx +179 -0
- package/templates/default/ikonShade/alert.tsx +66 -0
- package/templates/default/ikonShade/aspect-ratio.tsx +11 -0
- package/templates/default/ikonShade/avatar.tsx +53 -0
- package/templates/default/ikonShade/badge.tsx +49 -0
- package/templates/default/ikonShade/breadcrumb.tsx +109 -0
- package/templates/default/ikonShade/button.tsx +64 -0
- package/templates/default/ikonShade/calendar.tsx +227 -0
- package/templates/default/ikonShade/card.tsx +92 -0
- package/templates/default/ikonShade/checkbox.tsx +33 -0
- package/templates/default/ikonShade/collapsible.tsx +33 -0
- package/templates/default/ikonShade/command.tsx +184 -0
- package/templates/default/ikonShade/date-input.tsx +259 -0
- package/templates/default/ikonShade/date-range-picker.tsx +103 -0
- package/templates/default/ikonShade/dialog.tsx +143 -0
- package/templates/default/ikonShade/drawer.tsx +134 -0
- package/templates/default/ikonShade/dropdown-menu.tsx +259 -0
- package/templates/default/ikonShade/form.tsx +166 -0
- package/templates/default/ikonShade/hover-card.tsx +44 -0
- package/templates/default/ikonShade/input-otp.tsx +71 -0
- package/templates/default/ikonShade/input.tsx +22 -0
- package/templates/default/ikonShade/label.tsx +24 -0
- package/templates/default/ikonShade/navigation-menu.tsx +195 -0
- package/templates/default/ikonShade/popover.tsx +48 -0
- package/templates/default/ikonShade/progress.tsx +40 -0
- package/templates/default/ikonShade/radio-group.tsx +45 -0
- package/templates/default/ikonShade/scroll-area.tsx +58 -0
- package/templates/default/ikonShade/select.tsx +184 -0
- package/templates/default/ikonShade/separator.tsx +28 -0
- package/templates/default/ikonShade/sheet.tsx +139 -0
- package/templates/default/ikonShade/sidebar.tsx +726 -0
- package/templates/default/ikonShade/skeleton.tsx +15 -0
- package/templates/default/ikonShade/slider.tsx +64 -0
- package/templates/default/ikonShade/sonner.tsx +25 -0
- package/templates/default/ikonShade/switch.tsx +31 -0
- package/templates/default/ikonShade/table.tsx +116 -0
- package/templates/default/ikonShade/tabs.tsx +67 -0
- package/templates/default/ikonShade/textarea.tsx +18 -0
- package/templates/default/ikonShade/toggle-group.tsx +83 -0
- package/templates/default/ikonShade/toggle.tsx +47 -0
- package/templates/default/ikonShade/tooltip.tsx +65 -0
- package/templates/default/ikonShade/workflow.tsx +119 -0
- package/templates/default/ikoncomponents/action-menu/index.tsx +108 -0
- package/templates/default/ikoncomponents/action-menu/type.ts +18 -0
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +63 -0
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +65 -0
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +80 -0
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +68 -0
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +222 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +38 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +81 -0
- package/templates/default/ikoncomponents/big-calendar/index.css +879 -0
- package/templates/default/ikoncomponents/big-calendar/index.tsx +59 -0
- package/templates/default/ikoncomponents/big-calendar/type.ts +37 -0
- package/templates/default/ikoncomponents/buttons/index.tsx +127 -0
- package/templates/default/ikoncomponents/combobox-input/index.tsx +75 -0
- package/templates/default/ikoncomponents/combobox-input/type.ts +14 -0
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +242 -0
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +80 -0
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +149 -0
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +98 -0
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +119 -0
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +45 -0
- package/templates/default/ikoncomponents/data-table/function.ts +7 -0
- package/templates/default/ikoncomponents/data-table/index.tsx +549 -0
- package/templates/default/ikoncomponents/data-table/type.ts +75 -0
- package/templates/default/ikoncomponents/e-chart/index.tsx +183 -0
- package/templates/default/ikoncomponents/file-input/index.tsx +27 -0
- package/templates/default/ikoncomponents/fileUpload/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +111 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +80 -0
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +9 -0
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +27 -0
- package/{dist/ikoncomponents/form-fields/multi-combobox-input/index.js → templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx} +574 -381
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +39 -0
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +52 -0
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +7 -0
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +28 -0
- package/templates/default/ikoncomponents/form-fields/types/index.ts +46 -0
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +171 -0
- package/templates/default/ikoncomponents/icon/index.tsx +22 -0
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +19 -0
- package/{dist/ikoncomponents/image-cropper-upload/components/newCropper.js → templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx} +117 -85
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +352 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +250 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +32 -0
- package/{dist/ikoncomponents/image-cropper-upload/image-cropper/index.js → templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx} +119 -87
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +95 -0
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +117 -0
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +30 -0
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +103 -0
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +36 -0
- package/templates/default/ikoncomponents/main-layout/footer.tsx +21 -0
- package/templates/default/ikoncomponents/main-layout/header.tsx +53 -0
- package/templates/default/ikoncomponents/main-layout/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +389 -0
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +103 -0
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +345 -0
- package/templates/default/ikoncomponents/no-data/index.tsx +11 -0
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +30 -0
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +49 -0
- package/templates/default/ikoncomponents/phone-input/index.tsx +72 -0
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +32 -0
- package/templates/default/ikoncomponents/search-input/index.tsx +18 -0
- package/templates/default/ikoncomponents/sheet/index.tsx +34 -0
- package/templates/default/ikoncomponents/simple-widget/index.tsx +54 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +34 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +13 -0
- package/templates/default/ikoncomponents/tabs/index.tsx +139 -0
- package/{dist/ikoncomponents/tabs/type.d.ts → templates/default/ikoncomponents/tabs/type.ts} +20 -20
- package/{dist/ikoncomponents/theme-toggle-btn/index.js → templates/default/ikoncomponents/theme-toggle-btn/index.tsx} +189 -118
- package/templates/default/ikoncomponents/title-progress/index.tsx +41 -0
- package/templates/default/ikoncomponents/tooltip/index.tsx +17 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +33 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +279 -0
- package/templates/default/ikoncomponents/upload-tab/index.tsx +237 -0
- package/templates/default/ikoncomponents/widgets/index.tsx +81 -0
- package/templates/default/ikoncomponents/widgets/type.ts +11 -0
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +16 -0
- package/{dist/index.d.ts → templates/default/index.ts} +234 -139
- package/templates/default/styles.css +1159 -0
- package/templates/default/utils/actions/account/index.ts +33 -0
- package/templates/default/utils/actions/account/type.ts +4 -0
- package/{dist/utils/actions/auth/index.js → templates/default/utils/actions/auth/index.ts} +69 -58
- package/templates/default/utils/actions/common/revalidate.ts +18 -0
- package/templates/default/utils/actions/common/type.ts +4 -0
- package/{dist/utils/actions/common/utils.js → templates/default/utils/actions/common/utils.ts} +28 -25
- package/templates/default/utils/actions/software/index.ts +106 -0
- package/templates/default/utils/api/accountService/index.ts +103 -0
- package/templates/default/utils/api/accountService/type.ts +4 -0
- package/templates/default/utils/api/file-upload/index.ts +103 -0
- package/templates/default/utils/api/file-upload/type.ts +8 -0
- package/{dist/utils/api/ikonBaseApi.js → templates/default/utils/api/ikonBaseApi.ts} +132 -104
- package/templates/default/utils/api/loginService/index.ts +108 -0
- package/{dist/utils/api/loginService/type.d.ts → templates/default/utils/api/loginService/type.ts} +35 -32
- package/templates/default/utils/api/softwareService/index.ts +356 -0
- package/templates/default/utils/api/softwareService/type.ts +62 -0
- package/{dist/utils/border-radius-provider.js → templates/default/utils/border-radius-provider.tsx} +59 -35
- package/templates/default/utils/cn.ts +6 -0
- package/{dist/utils/font-provider.js → templates/default/utils/font-provider.tsx} +61 -37
- package/templates/default/utils/session/cookieSession.ts +49 -0
- package/templates/default/utils/theme-provider/index.tsx +11 -0
- package/templates/default/utils/token-management/index.ts +115 -0
- package/templates/default/utils/token-management/types.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/ikoncomponents/action-menu/index.d.ts +0 -6
- package/dist/ikoncomponents/action-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/index.js +0 -42
- package/dist/ikoncomponents/action-menu/type.d.ts +0 -15
- package/dist/ikoncomponents/action-menu/type.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/type.js +0 -1
- package/dist/ikoncomponents/activity-sheet/index.d.ts +0 -12
- package/dist/ikoncomponents/activity-sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/activity-sheet/index.js +0 -23
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +0 -22
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +0 -30
- package/dist/ikoncomponents/alert-dialog/index.d.ts +0 -15
- package/dist/ikoncomponents/alert-dialog/index.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/index.js +0 -20
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +0 -19
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +0 -43
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +0 -6
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/index.js +0 -57
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +0 -6
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +0 -16
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +0 -39
- package/dist/ikoncomponents/big-calendar/index.d.ts +0 -4
- package/dist/ikoncomponents/big-calendar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/index.js +0 -35
- package/dist/ikoncomponents/big-calendar/type.d.ts +0 -32
- package/dist/ikoncomponents/big-calendar/type.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/type.js +0 -1
- package/dist/ikoncomponents/buttons/index.d.ts +0 -19
- package/dist/ikoncomponents/buttons/index.d.ts.map +0 -1
- package/dist/ikoncomponents/buttons/index.js +0 -38
- package/dist/ikoncomponents/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/index.js +0 -18
- package/dist/ikoncomponents/combobox-input/type.d.ts +0 -14
- package/dist/ikoncomponents/combobox-input/type.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/type.js +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +0 -22
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +0 -85
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +0 -22
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +0 -35
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +0 -38
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +0 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +0 -18
- package/dist/ikoncomponents/data-table/function.d.ts +0 -2
- package/dist/ikoncomponents/data-table/function.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/function.js +0 -6
- package/dist/ikoncomponents/data-table/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/index.js +0 -223
- package/dist/ikoncomponents/data-table/type.d.ts +0 -61
- package/dist/ikoncomponents/data-table/type.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/type.js +0 -1
- package/dist/ikoncomponents/e-chart/index.d.ts +0 -16
- package/dist/ikoncomponents/e-chart/index.d.ts.map +0 -1
- package/dist/ikoncomponents/e-chart/index.js +0 -115
- package/dist/ikoncomponents/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/file-input/index.js +0 -21
- package/dist/ikoncomponents/fileUpload/index.d.ts +0 -16
- package/dist/ikoncomponents/fileUpload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/fileUpload/index.js +0 -69
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +0 -21
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +0 -19
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +0 -26
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/date-input/index.js +0 -15
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/file-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +0 -7
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/password-input/index.js +0 -23
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/phone-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/textarea/index.js +0 -18
- package/dist/ikoncomponents/form-fields/types/index.d.ts +0 -37
- package/dist/ikoncomponents/form-fields/types/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/types/index.js +0 -1
- package/dist/ikoncomponents/glowing-effect/index.d.ts +0 -15
- package/dist/ikoncomponents/glowing-effect/index.d.ts.map +0 -1
- package/dist/ikoncomponents/glowing-effect/index.js +0 -84
- package/dist/ikoncomponents/icon/index.d.ts +0 -9
- package/dist/ikoncomponents/icon/index.d.ts.map +0 -1
- package/dist/ikoncomponents/icon/index.js +0 -23
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +0 -16
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +0 -8
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +0 -145
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +0 -92
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +0 -14
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +0 -15
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +0 -28
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.js +0 -49
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +0 -17
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +0 -73
- package/dist/ikoncomponents/loading-spinner/index.d.ts +0 -10
- package/dist/ikoncomponents/loading-spinner/index.d.ts.map +0 -1
- package/dist/ikoncomponents/loading-spinner/index.js +0 -19
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +0 -11
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/RefreshContext.js +0 -17
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +0 -34
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +0 -52
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/app-sidebar.js +0 -24
- package/dist/ikoncomponents/main-layout/footer.d.ts +0 -2
- package/dist/ikoncomponents/main-layout/footer.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/footer.js +0 -5
- package/dist/ikoncomponents/main-layout/header.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/header.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/header.js +0 -15
- package/dist/ikoncomponents/main-layout/index.d.ts +0 -7
- package/dist/ikoncomponents/main-layout/index.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/index.js +0 -12
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +0 -61
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/main-sidebar.js +0 -119
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +0 -12
- package/dist/ikoncomponents/main-layout/nav-main.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/nav-main.js +0 -33
- package/dist/ikoncomponents/multi-combobox/index.d.ts +0 -14
- package/dist/ikoncomponents/multi-combobox/index.d.ts.map +0 -1
- package/dist/ikoncomponents/multi-combobox/index.js +0 -202
- package/dist/ikoncomponents/no-data/index.d.ts +0 -4
- package/dist/ikoncomponents/no-data/index.d.ts.map +0 -1
- package/dist/ikoncomponents/no-data/index.js +0 -5
- package/dist/ikoncomponents/page-wrapper/index.d.ts +0 -10
- package/dist/ikoncomponents/page-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/page-wrapper/index.js +0 -7
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +0 -4
- package/dist/ikoncomponents/password-strength-meter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/password-strength-meter/index.js +0 -40
- package/dist/ikoncomponents/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/phone-input/index.js +0 -41
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +0 -7
- package/dist/ikoncomponents/provider-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/provider-wrapper/index.js +0 -10
- package/dist/ikoncomponents/search-input/index.d.ts +0 -2
- package/dist/ikoncomponents/search-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/search-input/index.js +0 -19
- package/dist/ikoncomponents/sheet/index.d.ts +0 -11
- package/dist/ikoncomponents/sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/sheet/index.js +0 -6
- package/dist/ikoncomponents/simple-widget/index.d.ts +0 -15
- package/dist/ikoncomponents/simple-widget/index.d.ts.map +0 -1
- package/dist/ikoncomponents/simple-widget/index.js +0 -14
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +0 -4
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +0 -5
- package/dist/ikoncomponents/tabs/index.d.ts +0 -3
- package/dist/ikoncomponents/tabs/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/index.js +0 -50
- package/dist/ikoncomponents/tabs/type.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/type.js +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.d.ts +0 -13
- package/dist/ikoncomponents/title-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.js +0 -10
- package/dist/ikoncomponents/tooltip/index.d.ts +0 -6
- package/dist/ikoncomponents/tooltip/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tooltip/index.js +0 -5
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts +0 -10
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.js +0 -24
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +0 -32
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/index.js +0 -143
- package/dist/ikoncomponents/upload-tab/index.d.ts +0 -2
- package/dist/ikoncomponents/upload-tab/index.d.ts.map +0 -1
- package/dist/ikoncomponents/upload-tab/index.js +0 -92
- package/dist/ikoncomponents/widgets/index.d.ts +0 -3
- package/dist/ikoncomponents/widgets/index.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/index.js +0 -14
- package/dist/ikoncomponents/widgets/type.d.ts +0 -11
- package/dist/ikoncomponents/widgets/type.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/type.js +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/work-in-progress/index.js +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/shadcn/accordion.d.ts +0 -8
- package/dist/shadcn/accordion.d.ts.map +0 -1
- package/dist/shadcn/accordion.js +0 -33
- package/dist/shadcn/alert-dialog.d.ts +0 -21
- package/dist/shadcn/alert-dialog.d.ts.map +0 -1
- package/dist/shadcn/alert-dialog.js +0 -83
- package/dist/shadcn/alert.d.ts +0 -10
- package/dist/shadcn/alert.d.ts.map +0 -1
- package/dist/shadcn/alert.js +0 -38
- package/dist/shadcn/aspect-ratio.d.ts +0 -4
- package/dist/shadcn/aspect-ratio.d.ts.map +0 -1
- package/dist/shadcn/aspect-ratio.js +0 -19
- package/dist/shadcn/avatar.d.ts +0 -7
- package/dist/shadcn/avatar.d.ts.map +0 -1
- package/dist/shadcn/avatar.js +0 -28
- package/dist/shadcn/badge.d.ts +0 -10
- package/dist/shadcn/badge.d.ts.map +0 -1
- package/dist/shadcn/badge.js +0 -35
- package/dist/shadcn/breadcrumb.d.ts +0 -12
- package/dist/shadcn/breadcrumb.d.ts.map +0 -1
- package/dist/shadcn/breadcrumb.js +0 -45
- package/dist/shadcn/button.d.ts +0 -11
- package/dist/shadcn/button.d.ts.map +0 -1
- package/dist/shadcn/button.js +0 -47
- package/dist/shadcn/calendar.d.ts +0 -9
- package/dist/shadcn/calendar.d.ts.map +0 -1
- package/dist/shadcn/calendar.js +0 -61
- package/dist/shadcn/card.d.ts +0 -10
- package/dist/shadcn/card.d.ts.map +0 -1
- package/dist/shadcn/card.js +0 -42
- package/dist/shadcn/checkbox.d.ts +0 -5
- package/dist/shadcn/checkbox.d.ts.map +0 -1
- package/dist/shadcn/checkbox.js +0 -21
- package/dist/shadcn/collapsible.d.ts +0 -6
- package/dist/shadcn/collapsible.d.ts.map +0 -1
- package/dist/shadcn/collapsible.js +0 -27
- package/dist/shadcn/command.d.ts +0 -19
- package/dist/shadcn/command.d.ts.map +0 -1
- package/dist/shadcn/command.js +0 -54
- package/dist/shadcn/date-input.d.ts +0 -8
- package/dist/shadcn/date-input.d.ts.map +0 -1
- package/dist/shadcn/date-input.js +0 -179
- package/dist/shadcn/date-range-picker.d.ts +0 -25
- package/dist/shadcn/date-range-picker.d.ts.map +0 -1
- package/dist/shadcn/date-range-picker.js +0 -45
- package/dist/shadcn/dialog.d.ts +0 -16
- package/dist/shadcn/dialog.d.ts.map +0 -1
- package/dist/shadcn/dialog.js +0 -57
- package/dist/shadcn/drawer.d.ts +0 -14
- package/dist/shadcn/drawer.d.ts.map +0 -1
- package/dist/shadcn/drawer.js +0 -56
- package/dist/shadcn/dropdown-menu.d.ts +0 -26
- package/dist/shadcn/dropdown-menu.d.ts.map +0 -1
- package/dist/shadcn/dropdown-menu.js +0 -77
- package/dist/shadcn/form.d.ts +0 -25
- package/dist/shadcn/form.d.ts.map +0 -1
- package/dist/shadcn/form.js +0 -70
- package/dist/shadcn/hover-card.d.ts +0 -7
- package/dist/shadcn/hover-card.d.ts.map +0 -1
- package/dist/shadcn/hover-card.js +0 -28
- package/dist/shadcn/input-otp.d.ts +0 -35
- package/dist/shadcn/input-otp.d.ts.map +0 -1
- package/dist/shadcn/input-otp.js +0 -40
- package/dist/shadcn/input.d.ts +0 -4
- package/dist/shadcn/input.d.ts.map +0 -1
- package/dist/shadcn/input.js +0 -18
- package/dist/shadcn/label.d.ts +0 -5
- package/dist/shadcn/label.d.ts.map +0 -1
- package/dist/shadcn/label.js +0 -20
- package/dist/shadcn/navigation-menu.d.ts +0 -17
- package/dist/shadcn/navigation-menu.d.ts.map +0 -1
- package/dist/shadcn/navigation-menu.js +0 -74
- package/dist/shadcn/popover.d.ts +0 -8
- package/dist/shadcn/popover.d.ts.map +0 -1
- package/dist/shadcn/popover.js +0 -32
- package/dist/shadcn/progress.d.ts +0 -9
- package/dist/shadcn/progress.d.ts.map +0 -1
- package/dist/shadcn/progress.js +0 -23
- package/dist/shadcn/radio-group.d.ts +0 -6
- package/dist/shadcn/radio-group.d.ts.map +0 -1
- package/dist/shadcn/radio-group.js +0 -25
- package/dist/shadcn/scroll-area.d.ts +0 -6
- package/dist/shadcn/scroll-area.d.ts.map +0 -1
- package/dist/shadcn/scroll-area.js +0 -26
- package/dist/shadcn/select.d.ts +0 -16
- package/dist/shadcn/select.d.ts.map +0 -1
- package/dist/shadcn/select.js +0 -59
- package/dist/shadcn/separator.d.ts +0 -5
- package/dist/shadcn/separator.d.ts.map +0 -1
- package/dist/shadcn/separator.js +0 -20
- package/dist/shadcn/sheet.d.ts +0 -14
- package/dist/shadcn/sheet.d.ts.map +0 -1
- package/dist/shadcn/sheet.js +0 -61
- package/dist/shadcn/sidebar.d.ts +0 -70
- package/dist/shadcn/sidebar.d.ts.map +0 -1
- package/dist/shadcn/sidebar.js +0 -242
- package/dist/shadcn/skeleton.d.ts +0 -4
- package/dist/shadcn/skeleton.d.ts.map +0 -1
- package/dist/shadcn/skeleton.js +0 -18
- package/dist/shadcn/slider.d.ts +0 -5
- package/dist/shadcn/slider.d.ts.map +0 -1
- package/dist/shadcn/slider.js +0 -26
- package/dist/shadcn/sonner.d.ts +0 -4
- package/dist/shadcn/sonner.d.ts.map +0 -1
- package/dist/shadcn/sonner.js +0 -25
- package/dist/shadcn/switch.d.ts +0 -5
- package/dist/shadcn/switch.d.ts.map +0 -1
- package/dist/shadcn/switch.js +0 -20
- package/dist/shadcn/table.d.ts +0 -11
- package/dist/shadcn/table.d.ts.map +0 -1
- package/dist/shadcn/table.js +0 -47
- package/dist/shadcn/tabs.d.ts +0 -8
- package/dist/shadcn/tabs.d.ts.map +0 -1
- package/dist/shadcn/tabs.js +0 -32
- package/dist/shadcn/textarea.d.ts +0 -4
- package/dist/shadcn/textarea.d.ts.map +0 -1
- package/dist/shadcn/textarea.js +0 -18
- package/dist/shadcn/toggle-group.d.ts +0 -10
- package/dist/shadcn/toggle-group.d.ts.map +0 -1
- package/dist/shadcn/toggle-group.js +0 -35
- package/dist/shadcn/toggle.d.ts +0 -10
- package/dist/shadcn/toggle.d.ts.map +0 -1
- package/dist/shadcn/toggle.js +0 -38
- package/dist/shadcn/tooltip.d.ts +0 -8
- package/dist/shadcn/tooltip.d.ts.map +0 -1
- package/dist/shadcn/tooltip.js +0 -32
- package/dist/shadcn/workflow.d.ts +0 -21
- package/dist/shadcn/workflow.d.ts.map +0 -1
- package/dist/shadcn/workflow.js +0 -20
- package/dist/styles.css +0 -1302
- package/dist/utils/actions/account/index.d.ts +0 -6
- package/dist/utils/actions/account/index.d.ts.map +0 -1
- package/dist/utils/actions/account/index.js +0 -28
- package/dist/utils/actions/account/type.d.ts +0 -5
- package/dist/utils/actions/account/type.d.ts.map +0 -1
- package/dist/utils/actions/account/type.js +0 -1
- package/dist/utils/actions/auth/index.d.ts +0 -8
- package/dist/utils/actions/auth/index.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.d.ts +0 -3
- package/dist/utils/actions/common/revalidate.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.js +0 -14
- package/dist/utils/actions/common/type.d.ts +0 -5
- package/dist/utils/actions/common/type.d.ts.map +0 -1
- package/dist/utils/actions/common/type.js +0 -1
- package/dist/utils/actions/common/utils.d.ts +0 -6
- package/dist/utils/actions/common/utils.d.ts.map +0 -1
- package/dist/utils/actions/software/index.d.ts +0 -12
- package/dist/utils/actions/software/index.d.ts.map +0 -1
- package/dist/utils/actions/software/index.js +0 -75
- package/dist/utils/api/accountService/index.d.ts +0 -24
- package/dist/utils/api/accountService/index.d.ts.map +0 -1
- package/dist/utils/api/accountService/index.js +0 -64
- package/dist/utils/api/accountService/type.d.ts +0 -5
- package/dist/utils/api/accountService/type.d.ts.map +0 -1
- package/dist/utils/api/accountService/type.js +0 -1
- package/dist/utils/api/file-upload/index.d.ts +0 -6
- package/dist/utils/api/file-upload/index.d.ts.map +0 -1
- package/dist/utils/api/file-upload/index.js +0 -80
- package/dist/utils/api/file-upload/type.d.ts +0 -7
- package/dist/utils/api/file-upload/type.d.ts.map +0 -1
- package/dist/utils/api/file-upload/type.js +0 -1
- package/dist/utils/api/ikonBaseApi.d.ts +0 -13
- package/dist/utils/api/ikonBaseApi.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.d.ts +0 -13
- package/dist/utils/api/loginService/index.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.js +0 -72
- package/dist/utils/api/loginService/type.d.ts.map +0 -1
- package/dist/utils/api/loginService/type.js +0 -1
- package/dist/utils/api/softwareService/index.d.ts +0 -65
- package/dist/utils/api/softwareService/index.d.ts.map +0 -1
- package/dist/utils/api/softwareService/index.js +0 -212
- package/dist/utils/api/softwareService/type.d.ts +0 -55
- package/dist/utils/api/softwareService/type.d.ts.map +0 -1
- package/dist/utils/api/softwareService/type.js +0 -1
- package/dist/utils/border-radius-provider.d.ts +0 -12
- package/dist/utils/border-radius-provider.d.ts.map +0 -1
- package/dist/utils/cn.d.ts +0 -3
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -5
- package/dist/utils/font-provider.d.ts +0 -12
- package/dist/utils/font-provider.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.d.ts +0 -9
- package/dist/utils/session/cookieSession.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.js +0 -33
- package/dist/utils/theme-provider/index.d.ts +0 -4
- package/dist/utils/theme-provider/index.d.ts.map +0 -1
- package/dist/utils/theme-provider/index.js +0 -18
- package/dist/utils/token-management/index.d.ts +0 -11
- package/dist/utils/token-management/index.d.ts.map +0 -1
- package/dist/utils/token-management/index.js +0 -69
- package/dist/utils/token-management/types.d.ts +0 -7
- package/dist/utils/token-management/types.d.ts.map +0 -1
- package/dist/utils/token-management/types.js +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { ForwardedRef, forwardRef, JSX, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
|
+
import { EChartsType, getInstanceByDom, init, ResizeOpts } from 'echarts';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
parentDivProps?: any;
|
|
8
|
+
option?: Record<string | number, any>;
|
|
9
|
+
style?: Record<string, string>;
|
|
10
|
+
settings?: Record<string, any>;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
theme?: string | object | null;
|
|
13
|
+
isConfigurable?: boolean;
|
|
14
|
+
resizeKey?: null | boolean | number | string;
|
|
15
|
+
onClick?: (...args: any) => void;
|
|
16
|
+
onConfigure?: (...args: any) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function validateOption(option?: null | Record<string, any>): Record<string, any> {
|
|
20
|
+
if (option === undefined || option === null || typeof option !== 'object') {
|
|
21
|
+
option = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const validatedOption = { ...option };
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
validatedOption.toolbox === undefined ||
|
|
28
|
+
validatedOption.toolbox === null ||
|
|
29
|
+
typeof validatedOption.toolbox !== 'object'
|
|
30
|
+
) {
|
|
31
|
+
validatedOption.toolbox = {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
validatedOption.toolbox.feature === undefined ||
|
|
36
|
+
validatedOption.toolbox.feature === null ||
|
|
37
|
+
typeof validatedOption.toolbox.feature !== 'object'
|
|
38
|
+
) {
|
|
39
|
+
validatedOption.toolbox.feature = {};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return validatedOption;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const EChart = forwardRef<HTMLElement, Props>((
|
|
46
|
+
{
|
|
47
|
+
parentDivProps = {},
|
|
48
|
+
option = {},
|
|
49
|
+
style = {},
|
|
50
|
+
settings = {},
|
|
51
|
+
loading = true,
|
|
52
|
+
theme,
|
|
53
|
+
isConfigurable = false,
|
|
54
|
+
resizeKey,
|
|
55
|
+
onClick = () => { },
|
|
56
|
+
onConfigure = () => { }
|
|
57
|
+
},
|
|
58
|
+
ref
|
|
59
|
+
) => {
|
|
60
|
+
const chartRef = useRef<HTMLDivElement | null>(null);
|
|
61
|
+
const chartInstanceRef = useRef<EChartsType | null>(null);
|
|
62
|
+
|
|
63
|
+
const validatedOption = validateOption(option);
|
|
64
|
+
|
|
65
|
+
if (isConfigurable) {
|
|
66
|
+
validatedOption.toolbox.feature = {
|
|
67
|
+
...validatedOption.toolbox.feature,
|
|
68
|
+
myConfigureChartTool: {
|
|
69
|
+
show: true,
|
|
70
|
+
title: 'Configure Chart',
|
|
71
|
+
icon: 'image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=',
|
|
72
|
+
onclick: () => onConfigure?.()
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
useImperativeHandle<HTMLElement, any>(ref, () => {
|
|
78
|
+
return {
|
|
79
|
+
getChartObject: () => {
|
|
80
|
+
return chartRef.current ? getInstanceByDom(chartRef.current) : null;
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
setOption: (validatedOption: any, settings: any) => {
|
|
84
|
+
if (!chartRef.current) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const chart = getInstanceByDom(chartRef.current);
|
|
89
|
+
chart?.setOption(validatedOption, settings);
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
resize: (secondResizeDelay = 0) => {
|
|
93
|
+
if (!chartRef.current) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const chart = getInstanceByDom(chartRef.current);
|
|
98
|
+
chart?.resize();
|
|
99
|
+
|
|
100
|
+
if (secondResizeDelay) {
|
|
101
|
+
setTimeout(() => chart?.resize(), secondResizeDelay);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
loadingVisible: (visibility?: boolean) => {
|
|
106
|
+
if (!chartRef.current) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const chart = getInstanceByDom(chartRef.current);
|
|
111
|
+
visibility ? chart?.showLoading() : chart?.hideLoading();
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
dispose: () => {
|
|
115
|
+
if (!chartRef.current) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const chart = getInstanceByDom(chartRef.current);
|
|
120
|
+
chart?.dispose();
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
on: (eventName: string, callback: (...args: any) => void) => {
|
|
124
|
+
if (!chartRef.current) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const chart = getInstanceByDom(chartRef.current);
|
|
129
|
+
chart?.on(eventName, callback);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (chartRef.current) {
|
|
136
|
+
chartInstanceRef.current = init(chartRef.current, theme);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const resizeCallback = () => chartInstanceRef.current?.resize?.();
|
|
140
|
+
window.addEventListener('resize', resizeCallback);
|
|
141
|
+
|
|
142
|
+
return () => {
|
|
143
|
+
if (chartInstanceRef.current) {
|
|
144
|
+
chartInstanceRef.current.dispose();
|
|
145
|
+
chartInstanceRef.current = null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
window.removeEventListener('resize', resizeCallback);
|
|
149
|
+
};
|
|
150
|
+
}, [theme]);
|
|
151
|
+
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
if (chartInstanceRef.current) {
|
|
154
|
+
chartInstanceRef.current.setOption(validatedOption, settings);
|
|
155
|
+
}
|
|
156
|
+
if (chartInstanceRef.current) {
|
|
157
|
+
chartInstanceRef.current.on('click', onClick);
|
|
158
|
+
}
|
|
159
|
+
}, [option, settings, theme]);
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (chartInstanceRef.current) {
|
|
163
|
+
chartInstanceRef.current.resize();
|
|
164
|
+
}
|
|
165
|
+
}, [resizeKey]);
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (chartInstanceRef.current) {
|
|
169
|
+
setTimeout(() => {
|
|
170
|
+
chartInstanceRef.current?.resize();
|
|
171
|
+
}, 500);
|
|
172
|
+
}
|
|
173
|
+
}, []);
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
<div
|
|
177
|
+
ref={chartRef}
|
|
178
|
+
{...parentDivProps}
|
|
179
|
+
style={{ width: '100%', height: '100%', ...style }}
|
|
180
|
+
/>
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
import { Upload } from 'lucide-react'
|
|
3
|
+
import { Input } from '../../ikonShade/input'
|
|
4
|
+
import { IconButtonWithTooltip } from '../buttons';
|
|
5
|
+
|
|
6
|
+
export function FileInput({ tooltipContent, fileNamePlaceholder, fileName, onFileNameChange, ...props }: any) {
|
|
7
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<div className='flex'>
|
|
11
|
+
<Input
|
|
12
|
+
ref={inputRef}
|
|
13
|
+
type="file"
|
|
14
|
+
className="hidden"
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
<div className='mx-1'></div>
|
|
18
|
+
<Input className='rounded-e-none' placeholder={fileNamePlaceholder} onChange={(...args: any) => onFileNameChange?.(...args)} value={fileName} />
|
|
19
|
+
<IconButtonWithTooltip tooltipContent={tooltipContent || "Browse File"} onClick={() => inputRef?.current?.click()} className='border-s-0 rounded-s-none'>
|
|
20
|
+
<Upload />
|
|
21
|
+
</IconButtonWithTooltip>
|
|
22
|
+
</div>
|
|
23
|
+
</>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useState, DragEvent } from "react";
|
|
4
|
+
import { UploadCloud, FileUp } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
export interface FileUploaderProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
isDrag?: boolean; // enable or disable drag & drop
|
|
9
|
+
onFileSelect: (fileObj: any) => Promise<any> | void; // now returns object with base64
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// --- Helper: Convert File to Object with Base64 ---
|
|
13
|
+
export const convertFileToObject = async (file: File) => {
|
|
14
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
15
|
+
const base64 = btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)));
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
message: "File processed successfully",
|
|
19
|
+
fileName: file.name,
|
|
20
|
+
size: file.size,
|
|
21
|
+
type: file.type,
|
|
22
|
+
lastModified: file.lastModified,
|
|
23
|
+
base64: base64,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function FileUploader({
|
|
28
|
+
label = "Upload File",
|
|
29
|
+
isDrag = false,
|
|
30
|
+
onFileSelect,
|
|
31
|
+
}: FileUploaderProps) {
|
|
32
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
33
|
+
|
|
34
|
+
const handleFile = async (file: File) => {
|
|
35
|
+
if (!file) return;
|
|
36
|
+
const fileObj = await convertFileToObject(file); // convert to object
|
|
37
|
+
await onFileSelect(fileObj); // pass object to parent
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// ---- DRAG HANDLERS ----
|
|
41
|
+
const handleDrop = (e: DragEvent<HTMLDivElement>) => {
|
|
42
|
+
if (!isDrag) return;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
setIsDragging(false);
|
|
45
|
+
|
|
46
|
+
const file = e.dataTransfer.files?.[0];
|
|
47
|
+
if (file) handleFile(file);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleDragOver = (e: DragEvent<HTMLDivElement>) => {
|
|
51
|
+
if (!isDrag) return;
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
setIsDragging(true);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleDragLeave = () => {
|
|
57
|
+
if (!isDrag) return;
|
|
58
|
+
setIsDragging(false);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
62
|
+
const file = e.target.files?.[0];
|
|
63
|
+
if (file) handleFile(file);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className="flex flex-col gap-2 w-full">
|
|
68
|
+
<label className="text-sm font-medium">{label}</label>
|
|
69
|
+
|
|
70
|
+
<input
|
|
71
|
+
type="file"
|
|
72
|
+
id="fileInput"
|
|
73
|
+
className="hidden"
|
|
74
|
+
onChange={handleInputChange}
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
{/* ----- DRAG & DROP VERSION ----- */}
|
|
78
|
+
{isDrag ? (
|
|
79
|
+
<div
|
|
80
|
+
className={`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
|
|
81
|
+
${isDragging ? "border-blue-600 bg-blue-50" : "border-gray-300"}
|
|
82
|
+
`}
|
|
83
|
+
onDragOver={handleDragOver}
|
|
84
|
+
onDragLeave={handleDragLeave}
|
|
85
|
+
onDrop={handleDrop}
|
|
86
|
+
onClick={() => document.getElementById("fileInput")?.click()}
|
|
87
|
+
>
|
|
88
|
+
<div className="flex flex-col items-center gap-3">
|
|
89
|
+
<UploadCloud className="w-10 h-10 text-blue-600" />
|
|
90
|
+
<p className="text-gray-600">
|
|
91
|
+
Drag & drop your file here or{" "}
|
|
92
|
+
<span className="text-blue-600 underline">browse</span>
|
|
93
|
+
</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
) : (
|
|
97
|
+
// ----- SIMPLE UPLOAD BOX -----
|
|
98
|
+
<div
|
|
99
|
+
className="border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center"
|
|
100
|
+
onClick={() => document.getElementById("fileInput")?.click()}
|
|
101
|
+
>
|
|
102
|
+
<FileUp className="w-8 h-8 text-blue-600" />
|
|
103
|
+
<span className="text-blue-600 underline">Browse File</span>
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- Helper Function: Recreate Image from File Object ---
|
|
111
|
+
export function getImageFromObject(obj: any) {
|
|
112
|
+
const byteCharacters = atob(obj.base64);
|
|
113
|
+
const byteNumbers = new Array(byteCharacters.length)
|
|
114
|
+
.fill(0)
|
|
115
|
+
.map((_, i) => byteCharacters.charCodeAt(i));
|
|
116
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
117
|
+
|
|
118
|
+
const blob = new Blob([byteArray], { type: obj.type });
|
|
119
|
+
|
|
120
|
+
return URL.createObjectURL(blob); // usable in <img src="..." />
|
|
121
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl,
|
|
3
|
+
FormDescription,
|
|
4
|
+
FormField,
|
|
5
|
+
FormItem,
|
|
6
|
+
FormLabel,
|
|
7
|
+
FormMessage,
|
|
8
|
+
} from "../../../ikonShade/form";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { FormComboboxInputProps } from "../types";
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../ikonShade/popover";
|
|
12
|
+
import { Button } from "../../../ikonShade/button";
|
|
13
|
+
import { cn } from "../../../utils/cn";
|
|
14
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
15
|
+
import {
|
|
16
|
+
Command,
|
|
17
|
+
CommandEmpty,
|
|
18
|
+
CommandGroup,
|
|
19
|
+
CommandInput,
|
|
20
|
+
CommandItem,
|
|
21
|
+
CommandList,
|
|
22
|
+
} from "../../../ikonShade/command";
|
|
23
|
+
|
|
24
|
+
export function FormComboboxInput({
|
|
25
|
+
formControl,
|
|
26
|
+
name,
|
|
27
|
+
label,
|
|
28
|
+
placeholder,
|
|
29
|
+
formDescription,
|
|
30
|
+
items,
|
|
31
|
+
disabled,
|
|
32
|
+
onSelect,
|
|
33
|
+
}: FormComboboxInputProps) {
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<FormField
|
|
37
|
+
control={formControl}
|
|
38
|
+
name={name}
|
|
39
|
+
render={({ field }) => (
|
|
40
|
+
<FormItem className="">
|
|
41
|
+
{label && (
|
|
42
|
+
<>
|
|
43
|
+
<FormLabel>{label}</FormLabel>
|
|
44
|
+
|
|
45
|
+
</>
|
|
46
|
+
)}
|
|
47
|
+
<Popover>
|
|
48
|
+
<PopoverTrigger asChild className="w-full">
|
|
49
|
+
<FormControl>
|
|
50
|
+
<Button
|
|
51
|
+
variant="outline"
|
|
52
|
+
role="combobox"
|
|
53
|
+
className={cn(
|
|
54
|
+
"justify-between",
|
|
55
|
+
!field.value && "text-muted-foreground"
|
|
56
|
+
)}
|
|
57
|
+
disabled={
|
|
58
|
+
disabled == true ||
|
|
59
|
+
(disabled && disabled(...arguments))
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
{field.value
|
|
63
|
+
? items.find((item) => item.value === field.value)
|
|
64
|
+
?.label || field.value
|
|
65
|
+
: placeholder}
|
|
66
|
+
<ChevronsUpDown className="opacity-50" />
|
|
67
|
+
</Button>
|
|
68
|
+
</FormControl>
|
|
69
|
+
</PopoverTrigger>
|
|
70
|
+
<PopoverContent className="p-0" align="start">
|
|
71
|
+
<Command>
|
|
72
|
+
<CommandInput placeholder="Search..." />
|
|
73
|
+
<CommandList>
|
|
74
|
+
<CommandEmpty>No items found.</CommandEmpty>
|
|
75
|
+
<CommandGroup>
|
|
76
|
+
{items.map((item) => (
|
|
77
|
+
<CommandItem
|
|
78
|
+
value={item.value}
|
|
79
|
+
key={item.value}
|
|
80
|
+
disabled={(item.disabled == true || (item.disabled && item.disabled(item)))}
|
|
81
|
+
onSelect={(value) => {
|
|
82
|
+
field.onChange(value);
|
|
83
|
+
onSelect && onSelect(value);
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{item?.label || item.value}
|
|
87
|
+
<Check
|
|
88
|
+
className={cn(
|
|
89
|
+
"ml-auto",
|
|
90
|
+
item.value === field.value
|
|
91
|
+
? "opacity-100"
|
|
92
|
+
: "opacity-0"
|
|
93
|
+
)}
|
|
94
|
+
/>
|
|
95
|
+
</CommandItem>
|
|
96
|
+
))}
|
|
97
|
+
</CommandGroup>
|
|
98
|
+
</CommandList>
|
|
99
|
+
</Command>
|
|
100
|
+
</PopoverContent>
|
|
101
|
+
</Popover>
|
|
102
|
+
{formDescription && (
|
|
103
|
+
<FormDescription>{formDescription}</FormDescription>
|
|
104
|
+
)}
|
|
105
|
+
<FormMessage />
|
|
106
|
+
</FormItem>
|
|
107
|
+
)}
|
|
108
|
+
/>
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useController, Control } from "react-hook-form";
|
|
5
|
+
import {
|
|
6
|
+
FormControl,
|
|
7
|
+
FormDescription,
|
|
8
|
+
FormField,
|
|
9
|
+
FormItem,
|
|
10
|
+
FormLabel,
|
|
11
|
+
FormMessage,
|
|
12
|
+
} from "../../../ikonShade/form";
|
|
13
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../ikonShade/popover";
|
|
14
|
+
import { Button } from "../../../ikonShade/button";
|
|
15
|
+
import { cn } from "../../../utils/cn";
|
|
16
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
17
|
+
import {
|
|
18
|
+
Command,
|
|
19
|
+
CommandEmpty,
|
|
20
|
+
CommandGroup,
|
|
21
|
+
CommandInput,
|
|
22
|
+
CommandItem,
|
|
23
|
+
CommandList,
|
|
24
|
+
} from "../../../ikonShade/command";
|
|
25
|
+
|
|
26
|
+
// Updated type definition to include 'value' and 'onChange'
|
|
27
|
+
export interface FormComboboxInputProps {
|
|
28
|
+
formControl: Control<any>;
|
|
29
|
+
name: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
formDescription?: string;
|
|
33
|
+
items: { value: string; label: string; disabled?: boolean | ((item: any) => boolean) }[];
|
|
34
|
+
disabled?: boolean | ((...args: any[]) => boolean);
|
|
35
|
+
onSelect?: (value: any) => void;
|
|
36
|
+
value?: string; // added for controlled component
|
|
37
|
+
onChange?: (value: any) => void; // added for controlled component
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function FormComboboxInputWithValue(props: FormComboboxInputProps) {
|
|
41
|
+
const { field } = useController({ name: props.name, control: props.formControl });
|
|
42
|
+
// Use the external value if provided, otherwise use the field's value.
|
|
43
|
+
const currentValue = props.value !== undefined ? props.value : field.value;
|
|
44
|
+
return (
|
|
45
|
+
<FormField
|
|
46
|
+
control={props.formControl}
|
|
47
|
+
name={props.name}
|
|
48
|
+
render={({ field }) => (
|
|
49
|
+
<FormItem className="">
|
|
50
|
+
{props.label && (
|
|
51
|
+
<>
|
|
52
|
+
<FormLabel>{props.label}</FormLabel>
|
|
53
|
+
<br />
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
<Popover>
|
|
57
|
+
<PopoverTrigger asChild className="w-full">
|
|
58
|
+
<FormControl>
|
|
59
|
+
<Button
|
|
60
|
+
variant="outline"
|
|
61
|
+
role="combobox"
|
|
62
|
+
className={cn(
|
|
63
|
+
"justify-between",
|
|
64
|
+
!currentValue && "text-muted-foreground"
|
|
65
|
+
)}
|
|
66
|
+
disabled={
|
|
67
|
+
typeof props.disabled === "function" ? props.disabled() : props.disabled
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
{currentValue
|
|
71
|
+
? props.items.find((item) => item.value === currentValue)
|
|
72
|
+
?.label || currentValue
|
|
73
|
+
: props.placeholder}
|
|
74
|
+
<ChevronsUpDown className="opacity-50" />
|
|
75
|
+
</Button>
|
|
76
|
+
</FormControl>
|
|
77
|
+
</PopoverTrigger>
|
|
78
|
+
<PopoverContent className="p-0" align="start">
|
|
79
|
+
<Command>
|
|
80
|
+
<CommandInput placeholder="Search..." />
|
|
81
|
+
<CommandList>
|
|
82
|
+
<CommandEmpty>No items found.</CommandEmpty>
|
|
83
|
+
<CommandGroup>
|
|
84
|
+
{props.items.map((item) => (
|
|
85
|
+
<CommandItem
|
|
86
|
+
value={item.value}
|
|
87
|
+
key={item.value}
|
|
88
|
+
disabled={
|
|
89
|
+
typeof item.disabled === "function"
|
|
90
|
+
? item.disabled(item)
|
|
91
|
+
: item.disabled
|
|
92
|
+
}
|
|
93
|
+
onSelect={(value) => {
|
|
94
|
+
field.onChange(value);
|
|
95
|
+
props.onSelect && props.onSelect(value);
|
|
96
|
+
props.onChange && props.onChange(value);
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{item?.label || item.value}
|
|
100
|
+
<Check
|
|
101
|
+
className={cn(
|
|
102
|
+
"ml-auto",
|
|
103
|
+
item.value === currentValue ? "opacity-100" : "opacity-0"
|
|
104
|
+
)}
|
|
105
|
+
/>
|
|
106
|
+
</CommandItem>
|
|
107
|
+
))}
|
|
108
|
+
</CommandGroup>
|
|
109
|
+
</CommandList>
|
|
110
|
+
</Command>
|
|
111
|
+
</PopoverContent>
|
|
112
|
+
</Popover>
|
|
113
|
+
{props.formDescription && (
|
|
114
|
+
<FormDescription>{props.formDescription}</FormDescription>
|
|
115
|
+
)}
|
|
116
|
+
<FormMessage />
|
|
117
|
+
</FormItem>
|
|
118
|
+
)}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl,
|
|
3
|
+
FormDescription,
|
|
4
|
+
FormField,
|
|
5
|
+
FormItem,
|
|
6
|
+
FormLabel,
|
|
7
|
+
FormMessage,
|
|
8
|
+
} from "../../../ikonShade/form";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { FormDateInputProps } from "../types";
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../ikonShade/popover";
|
|
12
|
+
import { Button } from "../../../ikonShade/button";
|
|
13
|
+
import { cn } from "../../../utils/cn";
|
|
14
|
+
import { format } from "date-fns";
|
|
15
|
+
import { CalendarIcon } from "lucide-react";
|
|
16
|
+
import { Calendar } from "../../../ikonShade/calendar";
|
|
17
|
+
|
|
18
|
+
export function FormDateInput({
|
|
19
|
+
formControl,
|
|
20
|
+
name,
|
|
21
|
+
label,
|
|
22
|
+
placeholder,
|
|
23
|
+
dateFormat,
|
|
24
|
+
calendarDateDisabled,
|
|
25
|
+
formDescription,
|
|
26
|
+
disabled,
|
|
27
|
+
}: FormDateInputProps) {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<FormField
|
|
31
|
+
control={formControl}
|
|
32
|
+
name={name}
|
|
33
|
+
render={({ field }) => (
|
|
34
|
+
<FormItem>
|
|
35
|
+
{label && (
|
|
36
|
+
<>
|
|
37
|
+
<FormLabel>{label}</FormLabel>
|
|
38
|
+
</>
|
|
39
|
+
)}
|
|
40
|
+
<Popover>
|
|
41
|
+
<PopoverTrigger asChild className="w-full">
|
|
42
|
+
<FormControl>
|
|
43
|
+
<Button
|
|
44
|
+
variant={"outline"}
|
|
45
|
+
className={cn(!field.value && "text-foreground/50")}
|
|
46
|
+
disabled={disabled}
|
|
47
|
+
>
|
|
48
|
+
{field.value ? (
|
|
49
|
+
format(field.value, dateFormat || "PPP")
|
|
50
|
+
) : (
|
|
51
|
+
<span>{placeholder || "Pick a date"}</span>
|
|
52
|
+
)}
|
|
53
|
+
<CalendarIcon className="ml-auto h-4 w-4 opacity-50" />
|
|
54
|
+
</Button>
|
|
55
|
+
</FormControl>
|
|
56
|
+
</PopoverTrigger>
|
|
57
|
+
<PopoverContent className="w-auto p-0" align="start">
|
|
58
|
+
<Calendar
|
|
59
|
+
mode="single"
|
|
60
|
+
selected={field.value}
|
|
61
|
+
onSelect={field.onChange}
|
|
62
|
+
disabled={calendarDateDisabled}
|
|
63
|
+
captionLayout="dropdown"
|
|
64
|
+
// disabled={(date) =>
|
|
65
|
+
// date > new Date() || date < new Date("1900-01-01")
|
|
66
|
+
// }
|
|
67
|
+
autoFocus
|
|
68
|
+
/>
|
|
69
|
+
</PopoverContent>
|
|
70
|
+
</Popover>
|
|
71
|
+
{formDescription && (
|
|
72
|
+
<FormDescription>{formDescription}</FormDescription>
|
|
73
|
+
)}
|
|
74
|
+
<FormMessage />
|
|
75
|
+
</FormItem>
|
|
76
|
+
)}
|
|
77
|
+
/>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../../../ikonShade/form'
|
|
2
|
+
import { Input } from '../../../ikonShade/input'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { FormInputProps } from '../types'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export function FormInput({ formControl, label, formDescription, extraFormComponent, name, ...inputProps }: FormInputProps) {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<FormField
|
|
11
|
+
control={formControl}
|
|
12
|
+
name={name}
|
|
13
|
+
render={({ field }) => (
|
|
14
|
+
<FormItem>
|
|
15
|
+
{label && <FormLabel>{label}</FormLabel>}
|
|
16
|
+
<FormControl>
|
|
17
|
+
<Input {...field} {...inputProps} />
|
|
18
|
+
</FormControl>
|
|
19
|
+
{extraFormComponent && extraFormComponent(field.value)}
|
|
20
|
+
{formDescription && <FormDescription>{formDescription}</FormDescription>}
|
|
21
|
+
<FormMessage />
|
|
22
|
+
</FormItem>
|
|
23
|
+
)}
|
|
24
|
+
/>
|
|
25
|
+
</>
|
|
26
|
+
)
|
|
27
|
+
}
|