ikoncomponents 1.5.8 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/ikoncomponents/action-menu/index.d.ts +5 -0
- package/dist/ikoncomponents/action-menu/index.js +42 -0
- package/dist/ikoncomponents/action-menu/type.d.ts +14 -0
- package/dist/ikoncomponents/action-menu/type.js +1 -0
- package/dist/ikoncomponents/activity-sheet/index.d.ts +11 -0
- package/dist/ikoncomponents/activity-sheet/index.js +23 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +21 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +30 -0
- package/dist/ikoncomponents/alert-dialog/index.d.ts +14 -0
- package/dist/ikoncomponents/alert-dialog/index.js +20 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +18 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +43 -0
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +5 -0
- package/dist/ikoncomponents/app-breadcrumb/index.js +57 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +5 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +16 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +39 -0
- package/dist/ikoncomponents/big-calendar/index.d.ts +3 -0
- package/dist/ikoncomponents/big-calendar/index.js +35 -0
- package/dist/ikoncomponents/big-calendar/type.d.ts +31 -0
- package/dist/ikoncomponents/big-calendar/type.js +1 -0
- package/dist/ikoncomponents/buttons/index.d.ts +18 -0
- package/dist/ikoncomponents/buttons/index.js +38 -0
- package/dist/ikoncomponents/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/combobox-input/index.js +18 -0
- package/dist/ikoncomponents/combobox-input/type.d.ts +13 -0
- package/dist/ikoncomponents/combobox-input/type.js +1 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +21 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +85 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +22 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +35 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +38 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +13 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +18 -0
- package/dist/ikoncomponents/data-table/function.d.ts +1 -0
- package/dist/ikoncomponents/data-table/function.js +6 -0
- package/dist/ikoncomponents/data-table/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/index.js +223 -0
- package/dist/ikoncomponents/data-table/type.d.ts +60 -0
- package/dist/ikoncomponents/data-table/type.js +1 -0
- package/dist/ikoncomponents/e-chart/index.d.ts +15 -0
- package/dist/ikoncomponents/e-chart/index.js +115 -0
- package/dist/ikoncomponents/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/file-input/index.js +21 -0
- package/dist/ikoncomponents/fileUpload/index.d.ts +15 -0
- package/dist/ikoncomponents/fileUpload/index.js +69 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +21 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +18 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +26 -0
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/date-input/index.js +15 -0
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/file-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +6 -0
- package/{templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx → dist/ikoncomponents/form-fields/multi-combobox-input/index.js} +381 -574
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/textarea/index.js +18 -0
- package/dist/ikoncomponents/form-fields/types/index.d.ts +36 -0
- package/dist/ikoncomponents/form-fields/types/index.js +1 -0
- package/dist/ikoncomponents/glowing-effect/index.d.ts +14 -0
- package/dist/ikoncomponents/glowing-effect/index.js +84 -0
- package/dist/ikoncomponents/icon/index.d.ts +8 -0
- package/dist/ikoncomponents/icon/index.js +23 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +15 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx → dist/ikoncomponents/image-cropper-upload/components/newCropper.js} +85 -117
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +7 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +145 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +92 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +14 -0
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +14 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx → dist/ikoncomponents/image-cropper-upload/image-cropper/index.js} +87 -119
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +27 -0
- package/dist/ikoncomponents/image-cropper-upload/index.js +49 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +16 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +73 -0
- package/dist/ikoncomponents/loading-spinner/index.d.ts +9 -0
- package/dist/ikoncomponents/loading-spinner/index.js +19 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +10 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.js +18 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +33 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +52 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.js +24 -0
- package/dist/ikoncomponents/main-layout/footer.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/footer.js +5 -0
- package/dist/ikoncomponents/main-layout/header.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/header.js +15 -0
- package/dist/ikoncomponents/main-layout/index.d.ts +6 -0
- package/dist/ikoncomponents/main-layout/index.js +11 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +60 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.js +119 -0
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +11 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +33 -0
- package/dist/ikoncomponents/multi-combobox/index.d.ts +13 -0
- package/dist/ikoncomponents/multi-combobox/index.js +202 -0
- package/dist/ikoncomponents/no-data/index.d.ts +3 -0
- package/dist/ikoncomponents/no-data/index.js +5 -0
- package/dist/ikoncomponents/page-wrapper/index.d.ts +9 -0
- package/dist/ikoncomponents/page-wrapper/index.js +7 -0
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +3 -0
- package/dist/ikoncomponents/password-strength-meter/index.js +40 -0
- package/dist/ikoncomponents/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/phone-input/index.js +41 -0
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +6 -0
- package/dist/ikoncomponents/provider-wrapper/index.js +11 -0
- package/dist/ikoncomponents/search-input/index.d.ts +1 -0
- package/dist/ikoncomponents/search-input/index.js +19 -0
- package/dist/ikoncomponents/sheet/index.d.ts +10 -0
- package/dist/ikoncomponents/sheet/index.js +6 -0
- package/dist/ikoncomponents/simple-widget/index.d.ts +14 -0
- package/dist/ikoncomponents/simple-widget/index.js +14 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +5 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +6 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +3 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +5 -0
- package/dist/ikoncomponents/tabs/index.d.ts +2 -0
- package/dist/ikoncomponents/tabs/index.js +50 -0
- package/{templates/default/ikoncomponents/tabs/type.ts → dist/ikoncomponents/tabs/type.d.ts} +19 -20
- package/dist/ikoncomponents/tabs/type.js +2 -0
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -0
- package/{templates/default/ikoncomponents/theme-toggle-btn/index.tsx → dist/ikoncomponents/theme-toggle-btn/index.js} +118 -189
- package/dist/ikoncomponents/title-progress/index.d.ts +12 -0
- package/dist/ikoncomponents/title-progress/index.js +10 -0
- package/dist/ikoncomponents/tooltip/index.d.ts +5 -0
- package/dist/ikoncomponents/tooltip/index.js +5 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +31 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.js +143 -0
- package/dist/ikoncomponents/upload-tab/index.d.ts +1 -0
- package/dist/ikoncomponents/upload-tab/index.js +92 -0
- package/dist/ikoncomponents/widgets/index.d.ts +2 -0
- package/dist/ikoncomponents/widgets/index.js +14 -0
- package/dist/ikoncomponents/widgets/type.d.ts +10 -0
- package/dist/ikoncomponents/widgets/type.js +2 -0
- package/dist/ikoncomponents/work-in-progress/index.d.ts +1 -0
- package/dist/ikoncomponents/work-in-progress/index.js +4 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +116 -14
- package/dist/shadcn/accordion.d.ts +7 -0
- package/dist/shadcn/accordion.js +33 -0
- package/dist/shadcn/alert-dialog.d.ts +20 -0
- package/dist/shadcn/alert-dialog.js +83 -0
- package/dist/shadcn/alert.d.ts +9 -0
- package/dist/shadcn/alert.js +38 -0
- package/dist/shadcn/aspect-ratio.d.ts +3 -0
- package/dist/shadcn/aspect-ratio.js +19 -0
- package/dist/shadcn/avatar.d.ts +6 -0
- package/dist/shadcn/avatar.js +28 -0
- package/dist/shadcn/badge.d.ts +9 -0
- package/dist/shadcn/badge.js +35 -0
- package/dist/shadcn/breadcrumb.d.ts +11 -0
- package/dist/shadcn/breadcrumb.js +45 -0
- package/dist/shadcn/button.d.ts +10 -0
- package/dist/shadcn/button.js +47 -0
- package/dist/shadcn/calendar.d.ts +8 -0
- package/dist/shadcn/calendar.js +61 -0
- package/dist/shadcn/card.d.ts +9 -0
- package/dist/shadcn/card.js +42 -0
- package/dist/shadcn/checkbox.d.ts +4 -0
- package/dist/shadcn/checkbox.js +21 -0
- package/dist/shadcn/collapsible.d.ts +5 -0
- package/dist/shadcn/collapsible.js +27 -0
- package/dist/shadcn/command.d.ts +18 -0
- package/dist/shadcn/command.js +54 -0
- package/dist/shadcn/date-input.d.ts +7 -0
- package/dist/shadcn/date-input.js +179 -0
- package/dist/shadcn/date-range-picker.d.ts +24 -0
- package/dist/shadcn/date-range-picker.js +45 -0
- package/dist/shadcn/dialog.d.ts +15 -0
- package/dist/shadcn/dialog.js +57 -0
- package/dist/shadcn/drawer.d.ts +13 -0
- package/dist/shadcn/drawer.js +56 -0
- package/dist/shadcn/dropdown-menu.d.ts +25 -0
- package/dist/shadcn/dropdown-menu.js +77 -0
- package/dist/shadcn/form.d.ts +24 -0
- package/dist/shadcn/form.js +70 -0
- package/dist/shadcn/hover-card.d.ts +6 -0
- package/dist/shadcn/hover-card.js +28 -0
- package/dist/shadcn/input-otp.d.ts +34 -0
- package/dist/shadcn/input-otp.js +40 -0
- package/dist/shadcn/input.d.ts +3 -0
- package/dist/shadcn/input.js +18 -0
- package/dist/shadcn/label.d.ts +4 -0
- package/dist/shadcn/label.js +20 -0
- package/dist/shadcn/navigation-menu.d.ts +16 -0
- package/dist/shadcn/navigation-menu.js +74 -0
- package/dist/shadcn/popover.d.ts +7 -0
- package/dist/shadcn/popover.js +32 -0
- package/dist/shadcn/progress.d.ts +8 -0
- package/dist/shadcn/progress.js +23 -0
- package/dist/shadcn/radio-group.d.ts +5 -0
- package/dist/shadcn/radio-group.js +25 -0
- package/dist/shadcn/scroll-area.d.ts +5 -0
- package/dist/shadcn/scroll-area.js +26 -0
- package/dist/shadcn/select.d.ts +15 -0
- package/dist/shadcn/select.js +59 -0
- package/dist/shadcn/separator.d.ts +4 -0
- package/dist/shadcn/separator.js +20 -0
- package/dist/shadcn/sheet.d.ts +13 -0
- package/dist/shadcn/sheet.js +61 -0
- package/dist/shadcn/sidebar.d.ts +69 -0
- package/dist/shadcn/sidebar.js +242 -0
- package/dist/shadcn/skeleton.d.ts +3 -0
- package/dist/shadcn/skeleton.js +18 -0
- package/dist/shadcn/slider.d.ts +4 -0
- package/dist/shadcn/slider.js +26 -0
- package/dist/shadcn/sonner.d.ts +3 -0
- package/dist/shadcn/sonner.js +25 -0
- package/dist/shadcn/switch.d.ts +4 -0
- package/dist/shadcn/switch.js +20 -0
- package/dist/shadcn/table.d.ts +10 -0
- package/dist/shadcn/table.js +47 -0
- package/dist/shadcn/tabs.d.ts +7 -0
- package/dist/shadcn/tabs.js +32 -0
- package/dist/shadcn/textarea.d.ts +3 -0
- package/dist/shadcn/textarea.js +18 -0
- package/dist/shadcn/toggle-group.d.ts +9 -0
- package/dist/shadcn/toggle-group.js +35 -0
- package/dist/shadcn/toggle.d.ts +9 -0
- package/dist/shadcn/toggle.js +38 -0
- package/dist/shadcn/tooltip.d.ts +7 -0
- package/dist/shadcn/tooltip.js +32 -0
- package/dist/shadcn/workflow.d.ts +20 -0
- package/dist/shadcn/workflow.js +20 -0
- package/dist/styles.css +6163 -0
- package/dist/utils/actions/account/index.d.ts +5 -0
- package/dist/utils/actions/account/index.js +28 -0
- package/dist/utils/actions/account/type.d.ts +4 -0
- package/dist/utils/actions/account/type.js +1 -0
- package/dist/utils/actions/auth/index.d.ts +7 -0
- package/{templates/default/utils/actions/auth/index.ts → dist/utils/actions/auth/index.js} +58 -69
- package/dist/utils/actions/common/utils.d.ts +5 -0
- package/{templates/default/utils/actions/common/utils.ts → dist/utils/actions/common/utils.js} +25 -28
- package/dist/utils/actions/software/index.d.ts +11 -0
- package/dist/utils/actions/software/index.js +75 -0
- package/dist/utils/api/accountService/index.d.ts +23 -0
- package/dist/utils/api/accountService/index.js +64 -0
- package/dist/utils/api/accountService/type.d.ts +4 -0
- package/dist/utils/api/accountService/type.js +1 -0
- package/dist/utils/api/file-upload/index.d.ts +5 -0
- package/dist/utils/api/file-upload/index.js +80 -0
- package/dist/utils/api/file-upload/type.d.ts +6 -0
- package/dist/utils/api/file-upload/type.js +1 -0
- package/dist/utils/api/ikonBaseApi.d.ts +12 -0
- package/{templates/default/utils/api/ikonBaseApi.ts → dist/utils/api/ikonBaseApi.js} +104 -132
- package/dist/utils/api/loginService/index.d.ts +12 -0
- package/dist/utils/api/loginService/index.js +72 -0
- package/{templates/default/utils/api/loginService/type.ts → dist/utils/api/loginService/type.d.ts} +31 -35
- package/dist/utils/api/loginService/type.js +1 -0
- package/dist/utils/api/softwareService/index.d.ts +64 -0
- package/dist/utils/api/softwareService/index.js +212 -0
- package/dist/utils/api/softwareService/type.d.ts +54 -0
- package/dist/utils/api/softwareService/type.js +1 -0
- package/dist/utils/border-radius-provider.d.ts +11 -0
- package/{templates/default/utils/border-radius-provider.tsx → dist/utils/border-radius-provider.js} +35 -59
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +5 -0
- package/dist/utils/font-provider.d.ts +11 -0
- package/{templates/default/utils/font-provider.tsx → dist/utils/font-provider.js} +37 -61
- package/dist/utils/session/cookieSession.d.ts +8 -0
- package/dist/utils/session/cookieSession.js +33 -0
- package/dist/utils/theme-provider/index.d.ts +3 -0
- package/dist/utils/theme-provider/index.js +18 -0
- package/dist/utils/token-management/index.d.ts +10 -0
- package/dist/utils/token-management/index.js +69 -0
- package/dist/utils/token-management/types.d.ts +6 -0
- package/dist/utils/token-management/types.js +1 -0
- package/package.json +91 -17
- package/bin.js +0 -2
- package/dist/commands/init.js +0 -63
- package/dist/utlis/copyDir.js +0 -7
- package/templates/default/hooks/use-mobile.ts +0 -19
- package/templates/default/ikonS/accordion.tsx +0 -66
- package/templates/default/ikonS/alert-dialog.tsx +0 -179
- package/templates/default/ikonS/alert.tsx +0 -66
- package/templates/default/ikonS/aspect-ratio.tsx +0 -11
- package/templates/default/ikonS/avatar.tsx +0 -53
- package/templates/default/ikonS/badge.tsx +0 -49
- package/templates/default/ikonS/breadcrumb.tsx +0 -109
- package/templates/default/ikonS/button.tsx +0 -64
- package/templates/default/ikonS/calendar.tsx +0 -227
- package/templates/default/ikonS/card.tsx +0 -92
- package/templates/default/ikonS/checkbox.tsx +0 -33
- package/templates/default/ikonS/collapsible.tsx +0 -33
- package/templates/default/ikonS/command.tsx +0 -184
- package/templates/default/ikonS/date-input.tsx +0 -259
- package/templates/default/ikonS/date-range-picker.tsx +0 -103
- package/templates/default/ikonS/dialog.tsx +0 -143
- package/templates/default/ikonS/drawer.tsx +0 -134
- package/templates/default/ikonS/dropdown-menu.tsx +0 -259
- package/templates/default/ikonS/form.tsx +0 -166
- package/templates/default/ikonS/hover-card.tsx +0 -44
- package/templates/default/ikonS/input-otp.tsx +0 -71
- package/templates/default/ikonS/input.tsx +0 -22
- package/templates/default/ikonS/label.tsx +0 -24
- package/templates/default/ikonS/navigation-menu.tsx +0 -195
- package/templates/default/ikonS/popover.tsx +0 -48
- package/templates/default/ikonS/progress.tsx +0 -40
- package/templates/default/ikonS/radio-group.tsx +0 -45
- package/templates/default/ikonS/scroll-area.tsx +0 -58
- package/templates/default/ikonS/select.tsx +0 -184
- package/templates/default/ikonS/separator.tsx +0 -28
- package/templates/default/ikonS/sheet.tsx +0 -139
- package/templates/default/ikonS/sidebar.tsx +0 -726
- package/templates/default/ikonS/skeleton.tsx +0 -15
- package/templates/default/ikonS/slider.tsx +0 -64
- package/templates/default/ikonS/sonner.tsx +0 -25
- package/templates/default/ikonS/switch.tsx +0 -31
- package/templates/default/ikonS/table.tsx +0 -116
- package/templates/default/ikonS/tabs.tsx +0 -67
- package/templates/default/ikonS/textarea.tsx +0 -18
- package/templates/default/ikonS/toggle-group.tsx +0 -83
- package/templates/default/ikonS/toggle.tsx +0 -47
- package/templates/default/ikonS/tooltip.tsx +0 -65
- package/templates/default/ikonS/workflow.tsx +0 -119
- package/templates/default/ikoncomponents/action-menu/index.tsx +0 -108
- package/templates/default/ikoncomponents/action-menu/type.ts +0 -18
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +0 -63
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +0 -65
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +0 -80
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +0 -68
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +0 -222
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +0 -38
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +0 -81
- package/templates/default/ikoncomponents/big-calendar/index.css +0 -879
- package/templates/default/ikoncomponents/big-calendar/index.tsx +0 -59
- package/templates/default/ikoncomponents/big-calendar/type.ts +0 -37
- package/templates/default/ikoncomponents/buttons/index.tsx +0 -127
- package/templates/default/ikoncomponents/combobox-input/index.tsx +0 -75
- package/templates/default/ikoncomponents/combobox-input/type.ts +0 -14
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +0 -242
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +0 -80
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +0 -149
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +0 -98
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +0 -119
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +0 -45
- package/templates/default/ikoncomponents/data-table/function.ts +0 -7
- package/templates/default/ikoncomponents/data-table/index.tsx +0 -549
- package/templates/default/ikoncomponents/data-table/type.ts +0 -75
- package/templates/default/ikoncomponents/e-chart/index.tsx +0 -183
- package/templates/default/ikoncomponents/file-input/index.tsx +0 -27
- package/templates/default/ikoncomponents/fileUpload/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +0 -111
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +0 -80
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +0 -9
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +0 -27
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +0 -39
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +0 -52
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +0 -7
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +0 -28
- package/templates/default/ikoncomponents/form-fields/types/index.ts +0 -46
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +0 -171
- package/templates/default/ikoncomponents/icon/index.tsx +0 -22
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +0 -19
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +0 -352
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +0 -250
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +0 -32
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +0 -95
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +0 -117
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +0 -43
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +0 -30
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +0 -103
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +0 -36
- package/templates/default/ikoncomponents/main-layout/footer.tsx +0 -21
- package/templates/default/ikoncomponents/main-layout/header.tsx +0 -53
- package/templates/default/ikoncomponents/main-layout/index.tsx +0 -38
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +0 -389
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +0 -103
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +0 -345
- package/templates/default/ikoncomponents/no-data/index.tsx +0 -11
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +0 -30
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +0 -49
- package/templates/default/ikoncomponents/phone-input/index.tsx +0 -72
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +0 -32
- package/templates/default/ikoncomponents/search-input/index.tsx +0 -18
- package/templates/default/ikoncomponents/sheet/index.tsx +0 -34
- package/templates/default/ikoncomponents/simple-widget/index.tsx +0 -54
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +0 -34
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +0 -13
- package/templates/default/ikoncomponents/tabs/index.tsx +0 -139
- package/templates/default/ikoncomponents/title-progress/index.tsx +0 -41
- package/templates/default/ikoncomponents/tooltip/index.tsx +0 -17
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +0 -33
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +0 -279
- package/templates/default/ikoncomponents/upload-tab/index.tsx +0 -237
- package/templates/default/ikoncomponents/widgets/index.tsx +0 -81
- package/templates/default/ikoncomponents/widgets/type.ts +0 -11
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +0 -16
- package/templates/default/styles.css +0 -1159
- package/templates/default/utils/actions/account/index.ts +0 -33
- package/templates/default/utils/actions/account/type.ts +0 -4
- package/templates/default/utils/actions/common/revalidate.ts +0 -18
- package/templates/default/utils/actions/common/type.ts +0 -4
- package/templates/default/utils/actions/software/index.ts +0 -106
- package/templates/default/utils/api/accountService/index.ts +0 -103
- package/templates/default/utils/api/accountService/type.ts +0 -4
- package/templates/default/utils/api/file-upload/index.ts +0 -103
- package/templates/default/utils/api/file-upload/type.ts +0 -8
- package/templates/default/utils/api/loginService/index.ts +0 -106
- package/templates/default/utils/api/softwareService/index.ts +0 -356
- package/templates/default/utils/api/softwareService/type.ts +0 -62
- package/templates/default/utils/cn.ts +0 -6
- package/templates/default/utils/session/cookieSession.ts +0 -49
- package/templates/default/utils/theme-provider/index.tsx +0 -11
- package/templates/default/utils/token-management/index.ts +0 -115
- package/templates/default/utils/token-management/types.ts +0 -6
|
@@ -1,574 +1,381 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// import {
|
|
12
|
-
// import {
|
|
13
|
-
// import {
|
|
14
|
-
// import {
|
|
15
|
-
// import {
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// import {
|
|
25
|
-
// import {
|
|
26
|
-
|
|
27
|
-
// interface FormComboboxInputProps extends BaseFormComboboxInputProps {
|
|
28
|
-
// defaultOptions?: number; // Add defaultOptions to the type
|
|
29
|
-
// }
|
|
30
|
-
// export default function dFormMultiComboboxInput({
|
|
31
|
-
// formControl,
|
|
32
|
-
// name,
|
|
33
|
-
// label,
|
|
34
|
-
// placeholder,
|
|
35
|
-
// formDescription,
|
|
36
|
-
// items = [], // fallback to empty array
|
|
37
|
-
// disabled,
|
|
38
|
-
// onSelect,
|
|
39
|
-
// defaultValue = [],
|
|
40
|
-
// defaultOptions = 2,
|
|
41
|
-
// }: FormComboboxInputProps) {
|
|
42
|
-
// const [search, setSearch] = useState("");
|
|
43
|
-
// const containerRef = useRef<HTMLDivElement>(null);
|
|
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
|
-
//
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
// }
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
//
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
//
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
// }
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
//
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
//
|
|
210
|
-
//
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
//
|
|
216
|
-
//
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
//
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
//
|
|
245
|
-
//
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
//
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
//
|
|
269
|
-
//
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
animationFrameId = requestAnimationFrame(() => {
|
|
383
|
-
const newVisibleCount = calculateVisibleItems();
|
|
384
|
-
setVisibleCount((prevVisibleCount: number) => {
|
|
385
|
-
if (prevVisibleCount !== newVisibleCount) {
|
|
386
|
-
return newVisibleCount;
|
|
387
|
-
}
|
|
388
|
-
return prevVisibleCount;
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
resizeObserver.observe(container);
|
|
394
|
-
|
|
395
|
-
setVisibleCount(calculateVisibleItems());
|
|
396
|
-
|
|
397
|
-
return () => {
|
|
398
|
-
if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
399
|
-
resizeObserver.disconnect();
|
|
400
|
-
};
|
|
401
|
-
}, [calculateVisibleItems]);
|
|
402
|
-
|
|
403
|
-
const toggleItem = (value: string) => {
|
|
404
|
-
let updatedItems;
|
|
405
|
-
if (selectedItems.includes(value)) {
|
|
406
|
-
updatedItems = selectedItems.filter((v: string) => v !== value);
|
|
407
|
-
} else {
|
|
408
|
-
updatedItems = [...selectedItems, value];
|
|
409
|
-
}
|
|
410
|
-
field.onChange(updatedItems);
|
|
411
|
-
onSelect && onSelect(updatedItems);
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
const onWheel = (e: React.WheelEvent<HTMLDivElement>) => {
|
|
415
|
-
const el = e.currentTarget;
|
|
416
|
-
el.scrollTop += e.deltaY;
|
|
417
|
-
e.preventDefault();
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
return (
|
|
421
|
-
<FormItem>
|
|
422
|
-
{label && <FormLabel>{label}</FormLabel>}
|
|
423
|
-
|
|
424
|
-
<Popover>
|
|
425
|
-
<PopoverTrigger asChild className="w-full">
|
|
426
|
-
<FormControl>
|
|
427
|
-
<Button
|
|
428
|
-
// Removed ref={triggerRef} here as it's no longer needed for explicit width measurement
|
|
429
|
-
variant="outline"
|
|
430
|
-
role="combobox"
|
|
431
|
-
className={cn(
|
|
432
|
-
"justify-between",
|
|
433
|
-
!selectedItems.length && "text-foreground/50"
|
|
434
|
-
)}
|
|
435
|
-
disabled={
|
|
436
|
-
disabled === true || (disabled && disabled(...arguments))
|
|
437
|
-
}
|
|
438
|
-
>
|
|
439
|
-
{selectedItems.length > 0 ? (
|
|
440
|
-
<TooltipProvider>
|
|
441
|
-
<div
|
|
442
|
-
ref={containerRef}
|
|
443
|
-
className="flex flex-wrap gap-2 items-center overflow-hidden"
|
|
444
|
-
>
|
|
445
|
-
{selectedItems.slice(0, defaultOptions).map((value: string) => {
|
|
446
|
-
const label =
|
|
447
|
-
items.find((item) => item.value === value)?.label ||
|
|
448
|
-
value;
|
|
449
|
-
return (
|
|
450
|
-
<span
|
|
451
|
-
key={value}
|
|
452
|
-
className="flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full"
|
|
453
|
-
title={label}
|
|
454
|
-
>
|
|
455
|
-
<span className="truncate max-w-[120px]">{label}</span>
|
|
456
|
-
<span
|
|
457
|
-
role="button"
|
|
458
|
-
tabIndex={0}
|
|
459
|
-
onClick={(e) => {
|
|
460
|
-
e.stopPropagation();
|
|
461
|
-
const updated = selectedItems.filter(
|
|
462
|
-
(v: string) => v !== value
|
|
463
|
-
);
|
|
464
|
-
field.onChange(updated);
|
|
465
|
-
onSelect && onSelect(updated);
|
|
466
|
-
}}
|
|
467
|
-
onKeyDown={(e) => {
|
|
468
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
469
|
-
e.preventDefault();
|
|
470
|
-
e.stopPropagation();
|
|
471
|
-
const updated = selectedItems.filter(
|
|
472
|
-
(v: string) => v !== value
|
|
473
|
-
);
|
|
474
|
-
field.onChange(updated);
|
|
475
|
-
onSelect && onSelect(updated);
|
|
476
|
-
}
|
|
477
|
-
}}
|
|
478
|
-
className="ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none"
|
|
479
|
-
>
|
|
480
|
-
<X className="w-3 h-3 ml-1" />
|
|
481
|
-
</span>
|
|
482
|
-
</span>
|
|
483
|
-
);
|
|
484
|
-
})}
|
|
485
|
-
|
|
486
|
-
{selectedItems.length > defaultOptions && (
|
|
487
|
-
<Tooltip>
|
|
488
|
-
<TooltipTrigger asChild>
|
|
489
|
-
<span className="px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer">
|
|
490
|
-
+{selectedItems.length - defaultOptions} more
|
|
491
|
-
</span>
|
|
492
|
-
</TooltipTrigger>
|
|
493
|
-
<TooltipContent className="max-w-xs break-words">
|
|
494
|
-
<div
|
|
495
|
-
onWheel={onWheel}
|
|
496
|
-
className="flex flex-col gap-1 max-h-[200px] overflow-auto"
|
|
497
|
-
>
|
|
498
|
-
{selectedItems.slice(defaultOptions).map((value: string) => (
|
|
499
|
-
<span key={value} className="text-sm">
|
|
500
|
-
{items.find((item) => item.value === value)
|
|
501
|
-
?.label || value}
|
|
502
|
-
</span>
|
|
503
|
-
))}
|
|
504
|
-
</div>
|
|
505
|
-
</TooltipContent>
|
|
506
|
-
</Tooltip>
|
|
507
|
-
)}
|
|
508
|
-
</div>
|
|
509
|
-
</TooltipProvider>
|
|
510
|
-
) : (
|
|
511
|
-
placeholder
|
|
512
|
-
)}
|
|
513
|
-
<ChevronsUpDown className="opacity-50" />
|
|
514
|
-
</Button>
|
|
515
|
-
</FormControl>
|
|
516
|
-
</PopoverTrigger>
|
|
517
|
-
|
|
518
|
-
<PopoverContent
|
|
519
|
-
id="multiSelectPopover"
|
|
520
|
-
// New and improved width logic for PopoverContent
|
|
521
|
-
className="p-0 min-w-[--radix-popover-trigger-width]" // Ensures at least trigger width
|
|
522
|
-
style={{
|
|
523
|
-
width: 'max-content', // Allow to grow with content
|
|
524
|
-
maxWidth: 'min(500px, 90vw)' // Cap at 500px or 90% of viewport width, whichever is smaller
|
|
525
|
-
}}
|
|
526
|
-
align="start"
|
|
527
|
-
>
|
|
528
|
-
<Command id="commandPopover">
|
|
529
|
-
<CommandInput
|
|
530
|
-
placeholder="Search..."
|
|
531
|
-
value={search}
|
|
532
|
-
onValueChange={setSearch}
|
|
533
|
-
autoFocus
|
|
534
|
-
/>
|
|
535
|
-
<CommandList
|
|
536
|
-
className="max-h-60 overflow-auto"
|
|
537
|
-
onWheel={onWheel}
|
|
538
|
-
>
|
|
539
|
-
<CommandEmpty>No items found.</CommandEmpty>
|
|
540
|
-
<CommandGroup>
|
|
541
|
-
{filteredItems.map((item) => {
|
|
542
|
-
const isSelected = selectedItems.includes(item.value);
|
|
543
|
-
return (
|
|
544
|
-
<CommandItem
|
|
545
|
-
value={item.label ?? ""}
|
|
546
|
-
key={item.value}
|
|
547
|
-
onSelect={() => toggleItem(item.value)}
|
|
548
|
-
className="flex items-center space-x-2 justify-start"
|
|
549
|
-
>
|
|
550
|
-
<Checkbox
|
|
551
|
-
checked={isSelected}
|
|
552
|
-
onCheckedChange={() => toggleItem(item.value)}
|
|
553
|
-
onClick={(e) => e.stopPropagation()}
|
|
554
|
-
/>
|
|
555
|
-
<span>{item.label}</span>
|
|
556
|
-
</CommandItem>
|
|
557
|
-
);
|
|
558
|
-
})}
|
|
559
|
-
</CommandGroup>
|
|
560
|
-
</CommandList>
|
|
561
|
-
</Command>
|
|
562
|
-
</PopoverContent>
|
|
563
|
-
</Popover>
|
|
564
|
-
|
|
565
|
-
{formDescription && (
|
|
566
|
-
<FormDescription>{formDescription}</FormDescription>
|
|
567
|
-
)}
|
|
568
|
-
<FormMessage />
|
|
569
|
-
</FormItem>
|
|
570
|
-
);
|
|
571
|
-
}}
|
|
572
|
-
/>
|
|
573
|
-
);
|
|
574
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// import {
|
|
3
|
+
// FormControl,
|
|
4
|
+
// FormDescription,
|
|
5
|
+
// FormField,
|
|
6
|
+
// FormItem,
|
|
7
|
+
// FormLabel,
|
|
8
|
+
// FormMessage,
|
|
9
|
+
// } from "@/shadcn/ui/form";
|
|
10
|
+
// import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
11
|
+
// // import { FormComboboxInputProps } from "@/ikon/components/form-fields/types";
|
|
12
|
+
// import { Popover, PopoverContent, PopoverTrigger } from "@/shadcn/ui/popover";
|
|
13
|
+
// import { Button } from "@/shadcn/ui/button";
|
|
14
|
+
// import { cn } from "@/shadcn/lib/utils";
|
|
15
|
+
// import { Check, ChevronsUpDown } from "lucide-react";
|
|
16
|
+
// import {
|
|
17
|
+
// Command,
|
|
18
|
+
// CommandEmpty,
|
|
19
|
+
// CommandGroup,
|
|
20
|
+
// CommandInput,
|
|
21
|
+
// CommandItem,
|
|
22
|
+
// CommandList,
|
|
23
|
+
// } from "@/shadcn/ui/command";
|
|
24
|
+
// import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/shadcn/ui/tooltip";
|
|
25
|
+
// import { X } from "lucide-react";
|
|
26
|
+
// import { FormComboboxInputProps as BaseFormComboboxInputProps } from "@/ikon/components/form-fields/types";
|
|
27
|
+
// interface FormComboboxInputProps extends BaseFormComboboxInputProps {
|
|
28
|
+
// defaultOptions?: number; // Add defaultOptions to the type
|
|
29
|
+
// }
|
|
30
|
+
// export default function dFormMultiComboboxInput({
|
|
31
|
+
// formControl,
|
|
32
|
+
// name,
|
|
33
|
+
// label,
|
|
34
|
+
// placeholder,
|
|
35
|
+
// formDescription,
|
|
36
|
+
// items = [], // fallback to empty array
|
|
37
|
+
// disabled,
|
|
38
|
+
// onSelect,
|
|
39
|
+
// defaultValue = [],
|
|
40
|
+
// defaultOptions = 2,
|
|
41
|
+
// }: FormComboboxInputProps) {
|
|
42
|
+
// const [search, setSearch] = useState("");
|
|
43
|
+
// const containerRef = useRef<HTMLDivElement>(null);
|
|
44
|
+
// // Filter items based on search
|
|
45
|
+
// const filteredItems = items.filter((item) =>
|
|
46
|
+
// item.label?.toLowerCase().includes(search.toLowerCase())
|
|
47
|
+
// )
|
|
48
|
+
// .sort((a, b) => (a?.label ?? "").localeCompare(b?.label ?? ""));
|
|
49
|
+
// return (
|
|
50
|
+
// <FormField
|
|
51
|
+
// control={formControl}
|
|
52
|
+
// name={name}
|
|
53
|
+
// render={({ field }) => {
|
|
54
|
+
// // Initialize defaultValue if field.value is undefined
|
|
55
|
+
// useEffect(() => {
|
|
56
|
+
// if (
|
|
57
|
+
// (field.value === undefined || field.value === null) &&
|
|
58
|
+
// defaultValue.length > 0
|
|
59
|
+
// ) {
|
|
60
|
+
// field.onChange(defaultValue);
|
|
61
|
+
// }
|
|
62
|
+
// }, [defaultValue, field]);
|
|
63
|
+
// // field.value is the selected array, default to [] if undefined
|
|
64
|
+
// const selectedItems = field.value || [];
|
|
65
|
+
// const [visibleCount, setVisibleCount] = useState(selectedItems.length);
|
|
66
|
+
// const calculateVisibleItems = useCallback(() => {
|
|
67
|
+
// const container = containerRef.current;
|
|
68
|
+
// if (!container) return visibleCount;
|
|
69
|
+
// const children = Array.from(container.children) as HTMLElement[];
|
|
70
|
+
// let availableWidth = container.offsetWidth;
|
|
71
|
+
// let usedWidth = 0;
|
|
72
|
+
// let fitCount = 0;
|
|
73
|
+
// for (const child of children) {
|
|
74
|
+
// const childWidth = child.offsetWidth + 4; // gap/margin
|
|
75
|
+
// if (usedWidth + childWidth <= availableWidth) {
|
|
76
|
+
// usedWidth += childWidth;
|
|
77
|
+
// fitCount++;
|
|
78
|
+
// } else {
|
|
79
|
+
// break;
|
|
80
|
+
// }
|
|
81
|
+
// }
|
|
82
|
+
// return fitCount;
|
|
83
|
+
// }, []); // No dependencies
|
|
84
|
+
// useEffect(() => {
|
|
85
|
+
// const container = containerRef.current;
|
|
86
|
+
// if (!container) return;
|
|
87
|
+
// let animationFrameId: number | null = null;
|
|
88
|
+
// const resizeObserver = new ResizeObserver(() => {
|
|
89
|
+
// if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
90
|
+
// animationFrameId = requestAnimationFrame(() => {
|
|
91
|
+
// const newVisibleCount = calculateVisibleItems();
|
|
92
|
+
// setVisibleCount((prevVisibleCount: number) => {
|
|
93
|
+
// if (prevVisibleCount !== newVisibleCount) {
|
|
94
|
+
// return newVisibleCount;
|
|
95
|
+
// }
|
|
96
|
+
// return prevVisibleCount;
|
|
97
|
+
// });
|
|
98
|
+
// });
|
|
99
|
+
// });
|
|
100
|
+
// resizeObserver.observe(container);
|
|
101
|
+
// // Initial calculation
|
|
102
|
+
// setVisibleCount(calculateVisibleItems());
|
|
103
|
+
// // Cleanup
|
|
104
|
+
// return () => {
|
|
105
|
+
// if (animationFrameId) cancelAnimationFrame(animationFrameId);
|
|
106
|
+
// resizeObserver.disconnect();
|
|
107
|
+
// };
|
|
108
|
+
// }, [calculateVisibleItems]); // Only depend on calculateVisibleItems
|
|
109
|
+
// // Toggle select/unselect item
|
|
110
|
+
// const toggleItem = (value: string) => {
|
|
111
|
+
// let updatedItems;
|
|
112
|
+
// if (selectedItems.includes(value)) {
|
|
113
|
+
// updatedItems = selectedItems.filter((v: string) => v !== value);
|
|
114
|
+
// } else {
|
|
115
|
+
// updatedItems = [...selectedItems, value];
|
|
116
|
+
// }
|
|
117
|
+
// field.onChange(updatedItems);
|
|
118
|
+
// onSelect && onSelect(updatedItems);
|
|
119
|
+
// };
|
|
120
|
+
// const onWheel = (e: React.WheelEvent<HTMLDivElement>) => {
|
|
121
|
+
// const el = e.currentTarget;
|
|
122
|
+
// el.scrollTop += e.deltaY; // manually scroll
|
|
123
|
+
// e.preventDefault(); // prevent parent scroll
|
|
124
|
+
// };
|
|
125
|
+
// return (
|
|
126
|
+
// <FormItem>
|
|
127
|
+
// {label && <FormLabel>{label}</FormLabel>}
|
|
128
|
+
// <Popover>
|
|
129
|
+
// <PopoverTrigger asChild className="w-full">
|
|
130
|
+
// <FormControl>
|
|
131
|
+
// <Button
|
|
132
|
+
// variant="outline"
|
|
133
|
+
// role="combobox"
|
|
134
|
+
// className={cn(
|
|
135
|
+
// "justify-between",
|
|
136
|
+
// !selectedItems.length && "text-foreground/50"
|
|
137
|
+
// )}
|
|
138
|
+
// disabled={
|
|
139
|
+
// disabled === true || (disabled && disabled(...arguments))
|
|
140
|
+
// }
|
|
141
|
+
// >
|
|
142
|
+
// {selectedItems.length > 0 ? (
|
|
143
|
+
// <TooltipProvider>
|
|
144
|
+
// <div ref={containerRef} className="flex flex-wrap gap-2 items-center overflow-hidden">
|
|
145
|
+
// {selectedItems.slice(0, defaultOptions).map((value: string) => {
|
|
146
|
+
// const label = items.find((item) => item.value === value)?.label || value;
|
|
147
|
+
// return (
|
|
148
|
+
// <span
|
|
149
|
+
// key={value}
|
|
150
|
+
// className="flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full"
|
|
151
|
+
// title={label}
|
|
152
|
+
// >
|
|
153
|
+
// <span className="truncate max-w-[120px]">{label}</span>
|
|
154
|
+
// <span
|
|
155
|
+
// role="button"
|
|
156
|
+
// tabIndex={0}
|
|
157
|
+
// onClick={(e) => {
|
|
158
|
+
// e.stopPropagation(); // prevent popover toggle
|
|
159
|
+
// const updated = selectedItems.filter((v: string) => v !== value);
|
|
160
|
+
// field.onChange(updated);
|
|
161
|
+
// onSelect && onSelect(updated);
|
|
162
|
+
// }}
|
|
163
|
+
// onKeyDown={(e) => {
|
|
164
|
+
// if (e.key === 'Enter' || e.key === ' ') {
|
|
165
|
+
// e.preventDefault();
|
|
166
|
+
// e.stopPropagation();
|
|
167
|
+
// const updated = selectedItems.filter((v: string) => v !== value);
|
|
168
|
+
// field.onChange(updated);
|
|
169
|
+
// onSelect && onSelect(updated);
|
|
170
|
+
// }
|
|
171
|
+
// }}
|
|
172
|
+
// className="ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none"
|
|
173
|
+
// >
|
|
174
|
+
// <X className="w-3 h-3 ml-1" />
|
|
175
|
+
// </span>
|
|
176
|
+
// </span>
|
|
177
|
+
// );
|
|
178
|
+
// })}
|
|
179
|
+
// {selectedItems.length > defaultOptions && (
|
|
180
|
+
// <Tooltip>
|
|
181
|
+
// <TooltipTrigger asChild>
|
|
182
|
+
// <span className="px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer">
|
|
183
|
+
// +{selectedItems.length - defaultOptions} more
|
|
184
|
+
// </span>
|
|
185
|
+
// </TooltipTrigger>
|
|
186
|
+
// <TooltipContent className="max-w-xs break-words">
|
|
187
|
+
// <div
|
|
188
|
+
// onWheel={onWheel}
|
|
189
|
+
// className="flex flex-col gap-1 max-h-[200px] overflow-auto"
|
|
190
|
+
// >
|
|
191
|
+
// {selectedItems.slice(defaultOptions).map((value: string) => (
|
|
192
|
+
// <span key={value} className="text-sm">
|
|
193
|
+
// {items.find((item) => item.value === value)?.label || value}
|
|
194
|
+
// </span>
|
|
195
|
+
// ))}
|
|
196
|
+
// </div>
|
|
197
|
+
// </TooltipContent>
|
|
198
|
+
// </Tooltip>
|
|
199
|
+
// )}
|
|
200
|
+
// </div>
|
|
201
|
+
// </TooltipProvider>
|
|
202
|
+
// ) : (
|
|
203
|
+
// placeholder
|
|
204
|
+
// )}
|
|
205
|
+
// <ChevronsUpDown className="opacity-50" />
|
|
206
|
+
// </Button>
|
|
207
|
+
// </FormControl>
|
|
208
|
+
// </PopoverTrigger>
|
|
209
|
+
// <PopoverContent id="multiSelectPopover" className="p-0 w-full max-w-[300px]" align="start">
|
|
210
|
+
// <Command id="commandPopover">
|
|
211
|
+
// <CommandInput
|
|
212
|
+
// placeholder="Search..."
|
|
213
|
+
// value={search}
|
|
214
|
+
// onValueChange={setSearch}
|
|
215
|
+
// autoFocus
|
|
216
|
+
// />
|
|
217
|
+
// <CommandList
|
|
218
|
+
// className="max-h-60 overflow-auto"
|
|
219
|
+
// onWheel={onWheel}
|
|
220
|
+
// >
|
|
221
|
+
// <CommandEmpty>No items found.</CommandEmpty>
|
|
222
|
+
// <CommandGroup>
|
|
223
|
+
// {filteredItems.map((item) => {
|
|
224
|
+
// const isSelected = selectedItems.includes(item.value);
|
|
225
|
+
// return (
|
|
226
|
+
// <CommandItem
|
|
227
|
+
// value={item.label ?? ""}
|
|
228
|
+
// key={item.value}
|
|
229
|
+
// onSelect={() => toggleItem(item.value)}
|
|
230
|
+
// >
|
|
231
|
+
// {item.label}
|
|
232
|
+
// <Check
|
|
233
|
+
// className={cn(
|
|
234
|
+
// "ml-auto",
|
|
235
|
+
// isSelected ? "opacity-100" : "opacity-0"
|
|
236
|
+
// )}
|
|
237
|
+
// />
|
|
238
|
+
// </CommandItem>
|
|
239
|
+
// );
|
|
240
|
+
// })}
|
|
241
|
+
// </CommandGroup>
|
|
242
|
+
// </CommandList>
|
|
243
|
+
// </Command>
|
|
244
|
+
// </PopoverContent>
|
|
245
|
+
// </Popover>
|
|
246
|
+
// {formDescription && (
|
|
247
|
+
// <FormDescription>{formDescription}</FormDescription>
|
|
248
|
+
// )}
|
|
249
|
+
// <FormMessage />
|
|
250
|
+
// </FormItem>
|
|
251
|
+
// );
|
|
252
|
+
// }}
|
|
253
|
+
// />
|
|
254
|
+
// );
|
|
255
|
+
// }
|
|
256
|
+
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "../../../shadcn/form";
|
|
257
|
+
import { useState, useEffect, useRef, useCallback } from "react";
|
|
258
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../shadcn/popover";
|
|
259
|
+
import { Button } from "../../../shadcn/button";
|
|
260
|
+
import { cn } from "../../../utils/cn";
|
|
261
|
+
import { ChevronsUpDown, X } from "lucide-react";
|
|
262
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "../../../shadcn/command";
|
|
263
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../../shadcn/tooltip";
|
|
264
|
+
import { Checkbox } from "../../../shadcn/checkbox";
|
|
265
|
+
export function FormMultiComboboxInput({ formControl, name, label, placeholder, formDescription, items = [], disabled, onSelect, defaultValue = [], defaultOptions = 2, }) {
|
|
266
|
+
const [search, setSearch] = useState("");
|
|
267
|
+
const containerRef = useRef(null);
|
|
268
|
+
// Removed triggerRef and popoverWidth state, as we'll rely on CSS variables for sizing
|
|
269
|
+
// Filter items based on search
|
|
270
|
+
const filteredItems = items
|
|
271
|
+
.filter((item) => { var _a; return (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(search.toLowerCase()); })
|
|
272
|
+
.sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.label) !== null && _a !== void 0 ? _a : "").localeCompare((_b = b === null || b === void 0 ? void 0 : b.label) !== null && _b !== void 0 ? _b : ""); });
|
|
273
|
+
return (_jsx(FormField, { control: formControl, name: name, render: ({ field }) => {
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if ((field.value === undefined || field.value === null) &&
|
|
276
|
+
defaultValue.length > 0) {
|
|
277
|
+
field.onChange(defaultValue);
|
|
278
|
+
}
|
|
279
|
+
}, [defaultValue, field]);
|
|
280
|
+
const selectedItems = field.value || [];
|
|
281
|
+
const [visibleCount, setVisibleCount] = useState(selectedItems.length);
|
|
282
|
+
const calculateVisibleItems = useCallback(() => {
|
|
283
|
+
const container = containerRef.current;
|
|
284
|
+
if (!container)
|
|
285
|
+
return visibleCount;
|
|
286
|
+
const children = Array.from(container.children);
|
|
287
|
+
let availableWidth = container.offsetWidth;
|
|
288
|
+
let usedWidth = 0;
|
|
289
|
+
let fitCount = 0;
|
|
290
|
+
for (const child of children) {
|
|
291
|
+
const childWidth = child.offsetWidth + 4; // gap/margin
|
|
292
|
+
if (usedWidth + childWidth <= availableWidth) {
|
|
293
|
+
usedWidth += childWidth;
|
|
294
|
+
fitCount++;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return fitCount;
|
|
301
|
+
}, [visibleCount]);
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
const container = containerRef.current;
|
|
304
|
+
if (!container)
|
|
305
|
+
return;
|
|
306
|
+
let animationFrameId = null;
|
|
307
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
308
|
+
if (animationFrameId)
|
|
309
|
+
cancelAnimationFrame(animationFrameId);
|
|
310
|
+
animationFrameId = requestAnimationFrame(() => {
|
|
311
|
+
const newVisibleCount = calculateVisibleItems();
|
|
312
|
+
setVisibleCount((prevVisibleCount) => {
|
|
313
|
+
if (prevVisibleCount !== newVisibleCount) {
|
|
314
|
+
return newVisibleCount;
|
|
315
|
+
}
|
|
316
|
+
return prevVisibleCount;
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
resizeObserver.observe(container);
|
|
321
|
+
setVisibleCount(calculateVisibleItems());
|
|
322
|
+
return () => {
|
|
323
|
+
if (animationFrameId)
|
|
324
|
+
cancelAnimationFrame(animationFrameId);
|
|
325
|
+
resizeObserver.disconnect();
|
|
326
|
+
};
|
|
327
|
+
}, [calculateVisibleItems]);
|
|
328
|
+
const toggleItem = (value) => {
|
|
329
|
+
let updatedItems;
|
|
330
|
+
if (selectedItems.includes(value)) {
|
|
331
|
+
updatedItems = selectedItems.filter((v) => v !== value);
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
updatedItems = [...selectedItems, value];
|
|
335
|
+
}
|
|
336
|
+
field.onChange(updatedItems);
|
|
337
|
+
onSelect && onSelect(updatedItems);
|
|
338
|
+
};
|
|
339
|
+
const onWheel = (e) => {
|
|
340
|
+
const el = e.currentTarget;
|
|
341
|
+
el.scrollTop += e.deltaY;
|
|
342
|
+
e.preventDefault();
|
|
343
|
+
};
|
|
344
|
+
return (_jsxs(FormItem, { children: [label && _jsx(FormLabel, { children: label }), _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, className: "w-full", children: _jsx(FormControl, { children: _jsxs(Button
|
|
345
|
+
// Removed ref={triggerRef} here as it's no longer needed for explicit width measurement
|
|
346
|
+
, {
|
|
347
|
+
// Removed ref={triggerRef} here as it's no longer needed for explicit width measurement
|
|
348
|
+
variant: "outline", role: "combobox", className: cn("justify-between", !selectedItems.length && "text-foreground/50"), disabled: disabled === true || (disabled && disabled(...arguments)), children: [selectedItems.length > 0 ? (_jsx(TooltipProvider, { children: _jsxs("div", { ref: containerRef, className: "flex flex-wrap gap-2 items-center overflow-hidden", children: [selectedItems.slice(0, defaultOptions).map((value) => {
|
|
349
|
+
var _a;
|
|
350
|
+
const label = ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) ||
|
|
351
|
+
value;
|
|
352
|
+
return (_jsxs("span", { className: "flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full", title: label, children: [_jsx("span", { className: "truncate max-w-[120px]", children: label }), _jsx("span", { role: "button", tabIndex: 0, onClick: (e) => {
|
|
353
|
+
e.stopPropagation();
|
|
354
|
+
const updated = selectedItems.filter((v) => v !== value);
|
|
355
|
+
field.onChange(updated);
|
|
356
|
+
onSelect && onSelect(updated);
|
|
357
|
+
}, onKeyDown: (e) => {
|
|
358
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
359
|
+
e.preventDefault();
|
|
360
|
+
e.stopPropagation();
|
|
361
|
+
const updated = selectedItems.filter((v) => v !== value);
|
|
362
|
+
field.onChange(updated);
|
|
363
|
+
onSelect && onSelect(updated);
|
|
364
|
+
}
|
|
365
|
+
}, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: _jsx(X, { className: "w-3 h-3 ml-1" }) })] }, value));
|
|
366
|
+
}), selectedItems.length > defaultOptions && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { className: "px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer", children: ["+", selectedItems.length - defaultOptions, " more"] }) }), _jsx(TooltipContent, { className: "max-w-xs break-words", children: _jsx("div", { onWheel: onWheel, className: "flex flex-col gap-1 max-h-[200px] overflow-auto", children: selectedItems.slice(defaultOptions).map((value) => {
|
|
367
|
+
var _a;
|
|
368
|
+
return (_jsx("span", { className: "text-sm", children: ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value }, value));
|
|
369
|
+
}) }) })] }))] }) })) : (placeholder), _jsx(ChevronsUpDown, { className: "opacity-50" })] }) }) }), _jsx(PopoverContent, { id: "multiSelectPopover",
|
|
370
|
+
// New and improved width logic for PopoverContent
|
|
371
|
+
className: "p-0 min-w-[--radix-popover-trigger-width]" // Ensures at least trigger width
|
|
372
|
+
, style: {
|
|
373
|
+
width: 'max-content', // Allow to grow with content
|
|
374
|
+
maxWidth: 'min(500px, 90vw)' // Cap at 500px or 90% of viewport width, whichever is smaller
|
|
375
|
+
}, align: "start", children: _jsxs(Command, { id: "commandPopover", children: [_jsx(CommandInput, { placeholder: "Search...", value: search, onValueChange: setSearch, autoFocus: true }), _jsxs(CommandList, { className: "max-h-60 overflow-auto", onWheel: onWheel, children: [_jsx(CommandEmpty, { children: "No items found." }), _jsx(CommandGroup, { children: filteredItems.map((item) => {
|
|
376
|
+
var _a;
|
|
377
|
+
const isSelected = selectedItems.includes(item.value);
|
|
378
|
+
return (_jsxs(CommandItem, { value: (_a = item.label) !== null && _a !== void 0 ? _a : "", onSelect: () => toggleItem(item.value), className: "flex items-center space-x-2 justify-start", children: [_jsx(Checkbox, { checked: isSelected, onCheckedChange: () => toggleItem(item.value), onClick: (e) => e.stopPropagation() }), _jsx("span", { children: item.label })] }, item.value));
|
|
379
|
+
}) })] })] }) })] }), formDescription && (_jsx(FormDescription, { children: formDescription })), _jsx(FormMessage, {})] }));
|
|
380
|
+
} }));
|
|
381
|
+
}
|