@ayasofyazilim/ui 0.0.0 → 0.0.1
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/aria/index.js +2 -0
- package/dist/aria/index.js.map +1 -0
- package/dist/aria/number-field.js +46 -0
- package/dist/aria/number-field.js.map +1 -0
- package/dist/components/accordion.js +66 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.js +148 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.js +69 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.js +12 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.js +55 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +62 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.js +104 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.js +77 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.js +56 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +196 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +91 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.js +200 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.js +250 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.js +36 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.js +178 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +225 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.js +139 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.js +130 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.js +234 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.js +100 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.js +231 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/form.js +124 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.js +40 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.js +156 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.js +68 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.js +22 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.js +188 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.js +32 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.js +24 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.js +253 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.js +171 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.js +125 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +82 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.js +33 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.js +47 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.js +50 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.js +62 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.js +173 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.js +28 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.js +129 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.js +759 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +16 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.js +65 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.js +40 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.js +18 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stepper.js +220 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.js +33 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +131 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +69 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.js +19 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.js +70 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.js +45 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.js +65 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/custom/action-button.js +38 -0
- package/dist/custom/action-button.js.map +1 -0
- package/dist/custom/async-select.js +249 -0
- package/dist/custom/async-select.js.map +1 -0
- package/dist/custom/awesome-not-found.js +113 -0
- package/dist/custom/awesome-not-found.js.map +1 -0
- package/dist/custom/charts/area-chart.js +125 -0
- package/dist/custom/charts/area-chart.js.map +1 -0
- package/dist/custom/charts/bar-chart.js +232 -0
- package/dist/custom/charts/bar-chart.js.map +1 -0
- package/dist/custom/charts/chart-card.js +71 -0
- package/dist/custom/charts/chart-card.js.map +1 -0
- package/dist/custom/charts/index.js +5 -0
- package/dist/custom/charts/index.js.map +1 -0
- package/dist/custom/charts/pie-chart.js +153 -0
- package/dist/custom/charts/pie-chart.js.map +1 -0
- package/dist/custom/charts/radar-chart.js +112 -0
- package/dist/custom/charts/radar-chart.js.map +1 -0
- package/dist/custom/checkbox-tree.js +70 -0
- package/dist/custom/checkbox-tree.js.map +1 -0
- package/dist/custom/combobox.js +233 -0
- package/dist/custom/combobox.js.map +1 -0
- package/dist/custom/confirm-dialog.js +90 -0
- package/dist/custom/confirm-dialog.js.map +1 -0
- package/dist/custom/country-selector.js +151 -0
- package/dist/custom/country-selector.js.map +1 -0
- package/dist/custom/date-picker/calendar-rac.js +91 -0
- package/dist/custom/date-picker/calendar-rac.js.map +1 -0
- package/dist/custom/date-picker/datefield-rac.js +77 -0
- package/dist/custom/date-picker/datefield-rac.js.map +1 -0
- package/dist/custom/date-picker/index.js +251 -0
- package/dist/custom/date-picker/index.js.map +1 -0
- package/dist/custom/date-picker/types/index.js +1 -0
- package/dist/custom/date-picker/types/index.js.map +1 -0
- package/dist/custom/date-picker/utils/index.js +30 -0
- package/dist/custom/date-picker/utils/index.js.map +1 -0
- package/dist/custom/date-picker-old.js +46 -0
- package/dist/custom/date-picker-old.js.map +1 -0
- package/dist/custom/date-tooltip.js +89 -0
- package/dist/custom/date-tooltip.js.map +1 -0
- package/dist/custom/document-scanner/consts.js +13 -0
- package/dist/custom/document-scanner/consts.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/action-buttons.js +24 -0
- package/dist/custom/document-scanner/corner-adjustment/action-buttons.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/corner-handle.js +44 -0
- package/dist/custom/document-scanner/corner-adjustment/corner-handle.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.js +60 -0
- package/dist/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/index.js +124 -0
- package/dist/custom/document-scanner/corner-adjustment/index.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/types.js +1 -0
- package/dist/custom/document-scanner/corner-adjustment/types.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/utils/clip-path.js +16 -0
- package/dist/custom/document-scanner/corner-adjustment/utils/clip-path.js.map +1 -0
- package/dist/custom/document-scanner/corner-adjustment/zoom-magnifier.js +85 -0
- package/dist/custom/document-scanner/corner-adjustment/zoom-magnifier.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-document-capture.js +61 -0
- package/dist/custom/document-scanner/hooks/use-document-capture.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-document-scanner.js +59 -0
- package/dist/custom/document-scanner/hooks/use-document-scanner.js.map +1 -0
- package/dist/custom/document-scanner/hooks/use-perspective-crop.js +31 -0
- package/dist/custom/document-scanner/hooks/use-perspective-crop.js.map +1 -0
- package/dist/custom/document-scanner/index.js +229 -0
- package/dist/custom/document-scanner/index.js.map +1 -0
- package/dist/custom/document-scanner/lib.js +289 -0
- package/dist/custom/document-scanner/lib.js.map +1 -0
- package/dist/custom/document-scanner/types.js +1 -0
- package/dist/custom/document-scanner/types.js.map +1 -0
- package/dist/custom/document-scanner/utils/perspective-correction.js +100 -0
- package/dist/custom/document-scanner/utils/perspective-correction.js.map +1 -0
- package/dist/custom/document-viewer/controllers.js +76 -0
- package/dist/custom/document-viewer/controllers.js.map +1 -0
- package/dist/custom/document-viewer/index.js +36 -0
- package/dist/custom/document-viewer/index.js.map +1 -0
- package/dist/custom/document-viewer/renderers/image.js +40 -0
- package/dist/custom/document-viewer/renderers/image.js.map +1 -0
- package/dist/custom/document-viewer/renderers/index.js +3 -0
- package/dist/custom/document-viewer/renderers/index.js.map +1 -0
- package/dist/custom/document-viewer/renderers/pdf.js +95 -0
- package/dist/custom/document-viewer/renderers/pdf.js.map +1 -0
- package/dist/custom/email-input/email.js +184 -0
- package/dist/custom/email-input/email.js.map +1 -0
- package/dist/custom/email-input/index.js +8 -0
- package/dist/custom/email-input/index.js.map +1 -0
- package/dist/custom/email-input/types.js +13 -0
- package/dist/custom/email-input/types.js.map +1 -0
- package/dist/custom/file-uploader.js +389 -0
- package/dist/custom/file-uploader.js.map +1 -0
- package/dist/custom/filter-component/fields/async-select.js +31 -0
- package/dist/custom/filter-component/fields/async-select.js.map +1 -0
- package/dist/custom/filter-component/fields/date.js +56 -0
- package/dist/custom/filter-component/fields/date.js.map +1 -0
- package/dist/custom/filter-component/fields/multi-select.js +28 -0
- package/dist/custom/filter-component/fields/multi-select.js.map +1 -0
- package/dist/custom/filter-component/index.js +149 -0
- package/dist/custom/filter-component/index.js.map +1 -0
- package/dist/custom/image-canvas.js +193 -0
- package/dist/custom/image-canvas.js.map +1 -0
- package/dist/custom/json-editor.js +30 -0
- package/dist/custom/json-editor.js.map +1 -0
- package/dist/custom/master-data-grid/components/dialogs/column-settings-dialog.js +84 -0
- package/dist/custom/master-data-grid/components/dialogs/column-settings-dialog.js.map +1 -0
- package/dist/custom/master-data-grid/components/dialogs/index.js +5 -0
- package/dist/custom/master-data-grid/components/dialogs/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/client-filter.js +310 -0
- package/dist/custom/master-data-grid/components/filters/client-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/filter-input.js +209 -0
- package/dist/custom/master-data-grid/components/filters/filter-input.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/index.js +9 -0
- package/dist/custom/master-data-grid/components/filters/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/inline-column-filter.js +188 -0
- package/dist/custom/master-data-grid/components/filters/inline-column-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/multi-filter-dialog.js +65 -0
- package/dist/custom/master-data-grid/components/filters/multi-filter-dialog.js.map +1 -0
- package/dist/custom/master-data-grid/components/filters/server-filter.js +213 -0
- package/dist/custom/master-data-grid/components/filters/server-filter.js.map +1 -0
- package/dist/custom/master-data-grid/components/master-data-grid.js +421 -0
- package/dist/custom/master-data-grid/components/master-data-grid.js.map +1 -0
- package/dist/custom/master-data-grid/components/pagination/index.js +5 -0
- package/dist/custom/master-data-grid/components/pagination/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/pagination/pagination.js +159 -0
- package/dist/custom/master-data-grid/components/pagination/pagination.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/cell-renderer.js +442 -0
- package/dist/custom/master-data-grid/components/table/cell-renderer.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/header-cell.js +116 -0
- package/dist/custom/master-data-grid/components/table/header-cell.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/index.js +5 -0
- package/dist/custom/master-data-grid/components/table/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/table-body-renderer.js +79 -0
- package/dist/custom/master-data-grid/components/table/table-body-renderer.js.map +1 -0
- package/dist/custom/master-data-grid/components/table/virtual-body.js +86 -0
- package/dist/custom/master-data-grid/components/table/virtual-body.js.map +1 -0
- package/dist/custom/master-data-grid/components/toolbar/index.js +5 -0
- package/dist/custom/master-data-grid/components/toolbar/index.js.map +1 -0
- package/dist/custom/master-data-grid/components/toolbar/toolbar.js +238 -0
- package/dist/custom/master-data-grid/components/toolbar/toolbar.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/index.js +7 -0
- package/dist/custom/master-data-grid/hooks/index.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-columns.js +278 -0
- package/dist/custom/master-data-grid/hooks/use-columns.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-editing.js +75 -0
- package/dist/custom/master-data-grid/hooks/use-editing.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-table-state-reducer.js +96 -0
- package/dist/custom/master-data-grid/hooks/use-table-state-reducer.js.map +1 -0
- package/dist/custom/master-data-grid/hooks/use-table-state.js +25 -0
- package/dist/custom/master-data-grid/hooks/use-table-state.js.map +1 -0
- package/dist/custom/master-data-grid/index.js +5 -0
- package/dist/custom/master-data-grid/index.js.map +1 -0
- package/dist/custom/master-data-grid/types.js +1 -0
- package/dist/custom/master-data-grid/types.js.map +1 -0
- package/dist/custom/master-data-grid/utils/column-generator.js +203 -0
- package/dist/custom/master-data-grid/utils/column-generator.js.map +1 -0
- package/dist/custom/master-data-grid/utils/export-utils.js +46 -0
- package/dist/custom/master-data-grid/utils/export-utils.js.map +1 -0
- package/dist/custom/master-data-grid/utils/filter-fns.js +218 -0
- package/dist/custom/master-data-grid/utils/filter-fns.js.map +1 -0
- package/dist/custom/master-data-grid/utils/index.js +16 -0
- package/dist/custom/master-data-grid/utils/index.js.map +1 -0
- package/dist/custom/master-data-grid/utils/pinning-utils.js +70 -0
- package/dist/custom/master-data-grid/utils/pinning-utils.js.map +1 -0
- package/dist/custom/master-data-grid/utils/translation-utils.js +33 -0
- package/dist/custom/master-data-grid/utils/translation-utils.js.map +1 -0
- package/dist/custom/multi-select.js +339 -0
- package/dist/custom/multi-select.js.map +1 -0
- package/dist/custom/password-input.js +158 -0
- package/dist/custom/password-input.js.map +1 -0
- package/dist/custom/phone-input.js +127 -0
- package/dist/custom/phone-input.js.map +1 -0
- package/dist/custom/schema-form/custom/index.js +2 -0
- package/dist/custom/schema-form/custom/index.js.map +1 -0
- package/dist/custom/schema-form/custom/label.js +39 -0
- package/dist/custom/schema-form/custom/label.js.map +1 -0
- package/dist/custom/schema-form/fields/base-input-field.js +73 -0
- package/dist/custom/schema-form/fields/base-input-field.js.map +1 -0
- package/dist/custom/schema-form/fields/field.js +72 -0
- package/dist/custom/schema-form/fields/field.js.map +1 -0
- package/dist/custom/schema-form/fields/index.js +6 -0
- package/dist/custom/schema-form/fields/index.js.map +1 -0
- package/dist/custom/schema-form/fields/object.js +9 -0
- package/dist/custom/schema-form/fields/object.js.map +1 -0
- package/dist/custom/schema-form/fields/table-array/array-field-item.js +58 -0
- package/dist/custom/schema-form/fields/table-array/array-field-item.js.map +1 -0
- package/dist/custom/schema-form/fields/table-array/array-field-template.js +104 -0
- package/dist/custom/schema-form/fields/table-array/array-field-template.js.map +1 -0
- package/dist/custom/schema-form/index.js +219 -0
- package/dist/custom/schema-form/index.js.map +1 -0
- package/dist/custom/schema-form/templates/description.js +19 -0
- package/dist/custom/schema-form/templates/description.js.map +1 -0
- package/dist/custom/schema-form/templates/index.js +3 -0
- package/dist/custom/schema-form/templates/index.js.map +1 -0
- package/dist/custom/schema-form/templates/submit.js +31 -0
- package/dist/custom/schema-form/templates/submit.js.map +1 -0
- package/dist/custom/schema-form/types.js +1 -0
- package/dist/custom/schema-form/types.js.map +1 -0
- package/dist/custom/schema-form/utils/index.js +10 -0
- package/dist/custom/schema-form/utils/index.js.map +1 -0
- package/dist/custom/schema-form/utils/schema-dependency.js +349 -0
- package/dist/custom/schema-form/utils/schema-dependency.js.map +1 -0
- package/dist/custom/schema-form/utils/schemas.js +190 -0
- package/dist/custom/schema-form/utils/schemas.js.map +1 -0
- package/dist/custom/schema-form/utils/validation.js +19 -0
- package/dist/custom/schema-form/utils/validation.js.map +1 -0
- package/dist/custom/schema-form/widgets/boolean.js +73 -0
- package/dist/custom/schema-form/widgets/boolean.js.map +1 -0
- package/dist/custom/schema-form/widgets/combobox.js +222 -0
- package/dist/custom/schema-form/widgets/combobox.js.map +1 -0
- package/dist/custom/schema-form/widgets/date.js +56 -0
- package/dist/custom/schema-form/widgets/date.js.map +1 -0
- package/dist/custom/schema-form/widgets/email.js +37 -0
- package/dist/custom/schema-form/widgets/email.js.map +1 -0
- package/dist/custom/schema-form/widgets/index.js +11 -0
- package/dist/custom/schema-form/widgets/index.js.map +1 -0
- package/dist/custom/schema-form/widgets/password.js +42 -0
- package/dist/custom/schema-form/widgets/password.js.map +1 -0
- package/dist/custom/schema-form/widgets/phone.js +39 -0
- package/dist/custom/schema-form/widgets/phone.js.map +1 -0
- package/dist/custom/schema-form/widgets/select.js +78 -0
- package/dist/custom/schema-form/widgets/select.js.map +1 -0
- package/dist/custom/schema-form/widgets/selectable.js +25 -0
- package/dist/custom/schema-form/widgets/selectable.js.map +1 -0
- package/dist/custom/schema-form/widgets/string-array.js +237 -0
- package/dist/custom/schema-form/widgets/string-array.js.map +1 -0
- package/dist/custom/schema-form/widgets/url.js +53 -0
- package/dist/custom/schema-form/widgets/url.js.map +1 -0
- package/dist/custom/section-layout-v2.js +150 -0
- package/dist/custom/section-layout-v2.js.map +1 -0
- package/dist/custom/select-tabs.js +66 -0
- package/dist/custom/select-tabs.js.map +1 -0
- package/dist/custom/selectable.js +231 -0
- package/dist/custom/selectable.js.map +1 -0
- package/dist/custom/stepper.js +166 -0
- package/dist/custom/stepper.js.map +1 -0
- package/dist/custom/tab-layout.js +182 -0
- package/dist/custom/tab-layout.js.map +1 -0
- package/dist/custom/tanstack-table/fields/index.js +13 -0
- package/dist/custom/tanstack-table/fields/index.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-action-dialogs.js +76 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-action-dialogs.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-column-header.js +47 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-column-header.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-date.js +132 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-date.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-faceted.js +131 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-faceted.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-text.js +64 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-filter-text.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-pagination.js +135 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-pagination.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-plain-table.js +111 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-plain-table.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.js +65 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.js +69 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions.js +119 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-row-actions.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.js +75 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.js +41 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-toolbar.js +106 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-toolbar.js.map +1 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-view-options.js +132 -0
- package/dist/custom/tanstack-table/fields/tanstack-table-view-options.js.map +1 -0
- package/dist/custom/tanstack-table/index.js +217 -0
- package/dist/custom/tanstack-table/index.js.map +1 -0
- package/dist/custom/tanstack-table/types/index.js +1 -0
- package/dist/custom/tanstack-table/types/index.js.map +1 -0
- package/dist/custom/tanstack-table/utils/cell-with-actions.js +16 -0
- package/dist/custom/tanstack-table/utils/cell-with-actions.js.map +1 -0
- package/dist/custom/tanstack-table/utils/column-names.js +15 -0
- package/dist/custom/tanstack-table/utils/column-names.js.map +1 -0
- package/dist/custom/tanstack-table/utils/columns-by-row-data.js +246 -0
- package/dist/custom/tanstack-table/utils/columns-by-row-data.js.map +1 -0
- package/dist/custom/tanstack-table/utils/editable-columns-by-row-data.js +187 -0
- package/dist/custom/tanstack-table/utils/editable-columns-by-row-data.js.map +1 -0
- package/dist/custom/tanstack-table/utils/faceted-boolean-options.js +25 -0
- package/dist/custom/tanstack-table/utils/faceted-boolean-options.js.map +1 -0
- package/dist/custom/tanstack-table/utils/index.js +10 -0
- package/dist/custom/tanstack-table/utils/index.js.map +1 -0
- package/dist/custom/tanstack-table/utils/pinning-styles.js +38 -0
- package/dist/custom/tanstack-table/utils/pinning-styles.js.map +1 -0
- package/dist/custom/tanstack-table/utils/table.js +66 -0
- package/dist/custom/tanstack-table/utils/table.js.map +1 -0
- package/dist/custom/tanstack-table/utils/test-conditions.js +10 -0
- package/dist/custom/tanstack-table/utils/test-conditions.js.map +1 -0
- package/dist/custom/timeline.js +165 -0
- package/dist/custom/timeline.js.map +1 -0
- package/dist/custom/tree.js +130 -0
- package/dist/custom/tree.js.map +1 -0
- package/dist/custom/tscanify/browser.js +36 -0
- package/dist/custom/tscanify/browser.js.map +1 -0
- package/dist/custom/tscanify/index.js +34 -0
- package/dist/custom/tscanify/index.js.map +1 -0
- package/dist/custom/tscanify/tscanify-browser.js +363 -0
- package/dist/custom/tscanify/tscanify-browser.js.map +1 -0
- package/dist/custom/tscanify/tscanify.js +197 -0
- package/dist/custom/tscanify/tscanify.js.map +1 -0
- package/dist/custom/tscanify/types.js +1 -0
- package/dist/custom/tscanify/types.js.map +1 -0
- package/dist/custom/webcam.js +519 -0
- package/dist/custom/webcam.js.map +1 -0
- package/dist/hooks/use-callback-ref.js +15 -0
- package/dist/hooks/use-callback-ref.js.map +1 -0
- package/dist/hooks/use-controllable-state.js +49 -0
- package/dist/hooks/use-controllable-state.js.map +1 -0
- package/dist/hooks/use-debounce.js +18 -0
- package/dist/hooks/use-debounce.js.map +1 -0
- package/dist/hooks/use-is-visible.js +22 -0
- package/dist/hooks/use-is-visible.js.map +1 -0
- package/dist/hooks/use-media-query.js +19 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-on-window-resize.js +15 -0
- package/dist/hooks/use-on-window-resize.js.map +1 -0
- package/dist/hooks/use-scroll.js +20 -0
- package/dist/hooks/use-scroll.js.map +1 -0
- package/dist/lib/utils.js +48 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/zod.js +7 -0
- package/dist/lib/zod.js.map +1 -0
- package/package.json +34 -8
- package/src/aria/index.tsx +1 -1
- package/src/aria/number-field.tsx +41 -41
- package/src/components/accordion.tsx +66 -66
- package/src/components/alert-dialog.tsx +157 -157
- package/src/components/alert.tsx +70 -70
- package/src/components/aspect-ratio.tsx +11 -11
- package/src/components/avatar.tsx +53 -53
- package/src/components/badge.tsx +74 -67
- package/src/components/breadcrumb.tsx +109 -109
- package/src/components/button-group.tsx +83 -83
- package/src/components/button.tsx +68 -68
- package/src/components/calendar.tsx +219 -219
- package/src/components/card.tsx +92 -92
- package/src/components/carousel.tsx +241 -241
- package/src/components/chart.tsx +363 -363
- package/src/components/checkbox.tsx +32 -32
- package/src/components/collapsible.tsx +33 -33
- package/src/components/command.tsx +184 -184
- package/src/components/context-menu.tsx +252 -252
- package/src/components/dialog.tsx +144 -144
- package/src/components/drawer.tsx +135 -135
- package/src/components/dropdown-menu.tsx +258 -258
- package/src/components/empty.tsx +100 -100
- package/src/components/field.tsx +248 -248
- package/src/components/form.tsx +169 -169
- package/src/components/hover-card.tsx +44 -44
- package/src/components/input-group.tsx +170 -170
- package/src/components/input-otp.tsx +77 -77
- package/src/components/input.tsx +21 -21
- package/src/components/item.tsx +193 -193
- package/src/components/kbd.tsx +28 -28
- package/src/components/label.tsx +24 -24
- package/src/components/menubar.tsx +276 -276
- package/src/components/navigation-menu.tsx +168 -168
- package/src/components/pagination.tsx +130 -130
- package/src/components/popover.tsx +88 -88
- package/src/components/progress.tsx +31 -31
- package/src/components/radio-group.tsx +45 -45
- package/src/components/resizable.tsx +56 -56
- package/src/components/scroll-area.tsx +58 -58
- package/src/components/select.tsx +189 -189
- package/src/components/separator.tsx +28 -28
- package/src/components/sheet.tsx +140 -140
- package/src/components/sidebar.tsx +862 -862
- package/src/components/skeleton.tsx +13 -13
- package/src/components/slider.tsx +63 -63
- package/src/components/sonner.tsx +40 -40
- package/src/components/spinner.tsx +16 -16
- package/src/components/stepper.tsx +291 -291
- package/src/components/switch.tsx +31 -31
- package/src/components/table.tsx +133 -133
- package/src/components/tabs.tsx +66 -66
- package/src/components/textarea.tsx +18 -18
- package/src/components/toggle-group.tsx +83 -83
- package/src/components/toggle.tsx +47 -47
- package/src/components/tooltip.tsx +66 -66
- package/src/custom/action-button.tsx +48 -48
- package/src/custom/async-select.tsx +287 -287
- package/src/custom/awesome-not-found.tsx +116 -116
- package/src/custom/charts/area-chart.tsx +147 -147
- package/src/custom/charts/bar-chart.tsx +233 -233
- package/src/custom/charts/chart-card.tsx +103 -103
- package/src/custom/charts/index.tsx +16 -16
- package/src/custom/charts/pie-chart.tsx +168 -168
- package/src/custom/charts/radar-chart.tsx +126 -126
- package/src/custom/checkbox-tree.tsx +100 -100
- package/src/custom/combobox.tsx +296 -296
- package/src/custom/confirm-dialog.tsx +114 -102
- package/src/custom/country-selector.tsx +204 -204
- package/src/custom/date-picker/calendar-rac.tsx +109 -109
- package/src/custom/date-picker/datefield-rac.tsx +84 -84
- package/src/custom/date-picker/index.tsx +273 -273
- package/src/custom/date-picker/types/index.ts +4 -4
- package/src/custom/date-picker/utils/index.ts +42 -42
- package/src/custom/date-picker-old.tsx +50 -50
- package/src/custom/date-tooltip.tsx +98 -98
- package/src/custom/document-scanner/consts.ts +5 -5
- package/src/custom/document-scanner/corner-adjustment/action-buttons.tsx +33 -33
- package/src/custom/document-scanner/corner-adjustment/corner-handle.tsx +43 -43
- package/src/custom/document-scanner/corner-adjustment/hooks/use-corner-drag.ts +85 -85
- package/src/custom/document-scanner/corner-adjustment/index.tsx +125 -125
- package/src/custom/document-scanner/corner-adjustment/types.ts +53 -53
- package/src/custom/document-scanner/corner-adjustment/utils/clip-path.ts +22 -22
- package/src/custom/document-scanner/corner-adjustment/zoom-magnifier.tsx +115 -115
- package/src/custom/document-scanner/hooks/use-document-capture.ts +81 -81
- package/src/custom/document-scanner/hooks/use-document-scanner.ts +80 -80
- package/src/custom/document-scanner/hooks/use-perspective-crop.ts +38 -38
- package/src/custom/document-scanner/index.tsx +255 -255
- package/src/custom/document-scanner/lib.ts +407 -407
- package/src/custom/document-scanner/types.ts +205 -205
- package/src/custom/document-scanner/utils/perspective-correction.ts +139 -139
- package/src/custom/document-viewer/controllers.tsx +98 -98
- package/src/custom/document-viewer/index.tsx +43 -43
- package/src/custom/document-viewer/renderers/image.tsx +37 -37
- package/src/custom/document-viewer/renderers/index.tsx +2 -2
- package/src/custom/document-viewer/renderers/pdf.tsx +105 -105
- package/src/custom/email-input/domains.json +159 -159
- package/src/custom/email-input/email.tsx +229 -229
- package/src/custom/email-input/index.tsx +4 -4
- package/src/custom/email-input/types.ts +104 -104
- package/src/custom/file-uploader.tsx +541 -541
- package/src/custom/filter-component/fields/async-select.tsx +33 -33
- package/src/custom/filter-component/fields/date.tsx +60 -60
- package/src/custom/filter-component/fields/multi-select.tsx +30 -30
- package/src/custom/filter-component/index.tsx +217 -217
- package/src/custom/image-canvas.tsx +260 -260
- package/src/custom/json-editor.tsx +22 -22
- package/src/custom/master-data-grid/components/dialogs/column-settings-dialog.tsx +100 -100
- package/src/custom/master-data-grid/components/dialogs/index.ts +1 -1
- package/src/custom/master-data-grid/components/filters/client-filter.tsx +368 -368
- package/src/custom/master-data-grid/components/filters/filter-input.tsx +256 -256
- package/src/custom/master-data-grid/components/filters/index.ts +3 -3
- package/src/custom/master-data-grid/components/filters/inline-column-filter.tsx +233 -233
- package/src/custom/master-data-grid/components/filters/multi-filter-dialog.tsx +90 -90
- package/src/custom/master-data-grid/components/filters/server-filter.tsx +264 -255
- package/src/custom/master-data-grid/components/master-data-grid.tsx +472 -472
- package/src/custom/master-data-grid/components/pagination/index.ts +1 -1
- package/src/custom/master-data-grid/components/pagination/pagination.tsx +178 -178
- package/src/custom/master-data-grid/components/table/cell-renderer.tsx +621 -634
- package/src/custom/master-data-grid/components/table/header-cell.tsx +162 -162
- package/src/custom/master-data-grid/components/table/index.ts +4 -4
- package/src/custom/master-data-grid/components/table/table-body-renderer.tsx +113 -113
- package/src/custom/master-data-grid/components/table/virtual-body.tsx +138 -138
- package/src/custom/master-data-grid/components/toolbar/index.ts +1 -1
- package/src/custom/master-data-grid/components/toolbar/toolbar.tsx +314 -314
- package/src/custom/master-data-grid/hooks/index.ts +3 -3
- package/src/custom/master-data-grid/hooks/use-columns.tsx +353 -332
- package/src/custom/master-data-grid/hooks/use-editing.ts +106 -106
- package/src/custom/master-data-grid/hooks/use-table-state-reducer.ts +157 -157
- package/src/custom/master-data-grid/hooks/use-table-state.ts +31 -31
- package/src/custom/master-data-grid/index.ts +16 -16
- package/src/custom/master-data-grid/types.ts +486 -466
- package/src/custom/master-data-grid/utils/column-generator.tsx +324 -306
- package/src/custom/master-data-grid/utils/export-utils.ts +67 -67
- package/src/custom/master-data-grid/utils/filter-fns.ts +310 -290
- package/src/custom/master-data-grid/utils/index.ts +8 -8
- package/src/custom/master-data-grid/utils/pinning-utils.ts +88 -88
- package/src/custom/master-data-grid/utils/translation-utils.ts +42 -42
- package/src/custom/multi-select.tsx +432 -432
- package/src/custom/password-input.tsx +194 -194
- package/src/custom/phone-input.tsx +172 -172
- package/src/custom/schema-form/custom/index.tsx +1 -1
- package/src/custom/schema-form/custom/label.tsx +53 -53
- package/src/custom/schema-form/fields/base-input-field.tsx +82 -82
- package/src/custom/schema-form/fields/field.tsx +67 -67
- package/src/custom/schema-form/fields/index.tsx +5 -5
- package/src/custom/schema-form/fields/object.tsx +12 -12
- package/src/custom/schema-form/fields/table-array/array-field-item.tsx +90 -90
- package/src/custom/schema-form/fields/table-array/array-field-template.tsx +115 -115
- package/src/custom/schema-form/index.tsx +259 -259
- package/src/custom/schema-form/templates/description.tsx +20 -20
- package/src/custom/schema-form/templates/index.tsx +2 -2
- package/src/custom/schema-form/templates/submit.tsx +32 -32
- package/src/custom/schema-form/types.ts +64 -64
- package/src/custom/schema-form/utils/index.ts +4 -4
- package/src/custom/schema-form/utils/schema-dependency.ts +655 -655
- package/src/custom/schema-form/utils/schemas.ts +289 -289
- package/src/custom/schema-form/utils/validation.ts +23 -23
- package/src/custom/schema-form/widgets/boolean.tsx +77 -77
- package/src/custom/schema-form/widgets/combobox.tsx +274 -274
- package/src/custom/schema-form/widgets/date.tsx +59 -59
- package/src/custom/schema-form/widgets/email.tsx +34 -34
- package/src/custom/schema-form/widgets/index.tsx +10 -10
- package/src/custom/schema-form/widgets/password.tsx +40 -40
- package/src/custom/schema-form/widgets/phone.tsx +40 -40
- package/src/custom/schema-form/widgets/select.tsx +105 -105
- package/src/custom/schema-form/widgets/selectable.tsx +25 -25
- package/src/custom/schema-form/widgets/string-array.tsx +296 -296
- package/src/custom/schema-form/widgets/url.tsx +56 -56
- package/src/custom/section-layout-v2.tsx +212 -212
- package/src/custom/select-tabs.tsx +109 -109
- package/src/custom/selectable.tsx +316 -316
- package/src/custom/stepper.tsx +236 -236
- package/src/custom/tab-layout.tsx +213 -213
- package/src/custom/tanstack-table/fields/index.tsx +12 -12
- package/src/custom/tanstack-table/fields/tanstack-table-action-dialogs.tsx +89 -89
- package/src/custom/tanstack-table/fields/tanstack-table-column-header.tsx +66 -66
- package/src/custom/tanstack-table/fields/tanstack-table-filter-date.tsx +180 -180
- package/src/custom/tanstack-table/fields/tanstack-table-filter-faceted.tsx +158 -158
- package/src/custom/tanstack-table/fields/tanstack-table-filter-text.tsx +76 -76
- package/src/custom/tanstack-table/fields/tanstack-table-pagination.tsx +136 -136
- package/src/custom/tanstack-table/fields/tanstack-table-plain-table.tsx +142 -142
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions-confirmation.tsx +77 -77
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions-custom-dialog.tsx +87 -87
- package/src/custom/tanstack-table/fields/tanstack-table-row-actions.tsx +151 -151
- package/src/custom/tanstack-table/fields/tanstack-table-table-actions-custom-dialog.tsx +88 -88
- package/src/custom/tanstack-table/fields/tanstack-table-table-actions-schemaform-dialog.tsx +47 -47
- package/src/custom/tanstack-table/fields/tanstack-table-toolbar.tsx +143 -143
- package/src/custom/tanstack-table/fields/tanstack-table-view-options.tsx +171 -171
- package/src/custom/tanstack-table/index.tsx +244 -244
- package/src/custom/tanstack-table/types/index.ts +328 -328
- package/src/custom/tanstack-table/utils/cell-with-actions.tsx +21 -21
- package/src/custom/tanstack-table/utils/column-names.ts +26 -26
- package/src/custom/tanstack-table/utils/columns-by-row-data.tsx +312 -312
- package/src/custom/tanstack-table/utils/editable-columns-by-row-data.tsx +219 -219
- package/src/custom/tanstack-table/utils/faceted-boolean-options.tsx +22 -22
- package/src/custom/tanstack-table/utils/index.tsx +10 -10
- package/src/custom/tanstack-table/utils/pinning-styles.ts +57 -57
- package/src/custom/tanstack-table/utils/table.tsx +83 -83
- package/src/custom/tanstack-table/utils/test-conditions.ts +17 -17
- package/src/custom/timeline.tsx +208 -208
- package/src/custom/tree.tsx +200 -200
- package/src/custom/tscanify/browser.ts +66 -66
- package/src/custom/tscanify/index.ts +51 -51
- package/src/custom/tscanify/tscanify-browser.ts +522 -522
- package/src/custom/tscanify/tscanify.ts +262 -262
- package/src/custom/tscanify/types.ts +22 -22
- package/src/custom/webcam.tsx +737 -737
- package/src/hooks/use-callback-ref.ts +27 -27
- package/src/hooks/use-controllable-state.ts +67 -67
- package/src/hooks/use-debounce.ts +19 -19
- package/src/hooks/use-is-visible.ts +23 -23
- package/src/hooks/use-media-query.ts +21 -21
- package/src/hooks/use-mobile.ts +21 -21
- package/src/hooks/use-on-window-resize.ts +15 -15
- package/src/hooks/use-scroll.tsx +22 -22
- package/src/lib/utils.ts +61 -61
- package/src/lib/zod.ts +2 -2
- package/src/styles/core.css +57 -57
- package/src/test/email-input.test.tsx +217 -217
- package/src/test/password-input.test.tsx +92 -92
- package/src/test/select-tabs.test.tsx +302 -302
- package/src/test/selectable.test.tsx +1093 -1093
- package/__mocks__/canvas.ts +0 -8
- package/components.json +0 -21
- package/eslint.config.js +0 -4
- package/jest-environment.js +0 -37
- package/jest.config.ts +0 -47
- package/jest.setup.ts +0 -69
- package/postcss.config.mjs +0 -6
- package/tsconfig.json +0 -13
- package/tsconfig.lint.json +0 -8
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDownIcon, PhoneIcon } from "lucide-react";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import PhoneInputWithCountrySelect, {
|
|
6
|
+
getCountryCallingCode,
|
|
7
|
+
parsePhoneNumber
|
|
8
|
+
} from "react-phone-number-input";
|
|
9
|
+
import flags from "react-phone-number-input/flags";
|
|
10
|
+
import { Input } from "@repo/ayasofyazilim-ui/components/input";
|
|
11
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
12
|
+
import {
|
|
13
|
+
Select,
|
|
14
|
+
SelectContent,
|
|
15
|
+
SelectItem,
|
|
16
|
+
SelectTrigger,
|
|
17
|
+
SelectValue
|
|
18
|
+
} from "../components/select";
|
|
19
|
+
function PhoneInput({
|
|
20
|
+
id,
|
|
21
|
+
name,
|
|
22
|
+
placeholder,
|
|
23
|
+
defaultValue,
|
|
24
|
+
value: initialValue,
|
|
25
|
+
onChange,
|
|
26
|
+
disabled,
|
|
27
|
+
required,
|
|
28
|
+
className,
|
|
29
|
+
defaultCountry = "US"
|
|
30
|
+
}) {
|
|
31
|
+
const [value, setValue] = useState(initialValue || defaultValue || "");
|
|
32
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
33
|
+
PhoneInputWithCountrySelect,
|
|
34
|
+
{
|
|
35
|
+
className: cn("flex rounded-r-md shadow-xs", className),
|
|
36
|
+
international: true,
|
|
37
|
+
flagComponent: FlagComponent,
|
|
38
|
+
defaultCountry,
|
|
39
|
+
countrySelectComponent: (props) => CountrySelect({ ...props, id }),
|
|
40
|
+
inputComponent: _PhoneInput,
|
|
41
|
+
id,
|
|
42
|
+
required,
|
|
43
|
+
"data-testid": id,
|
|
44
|
+
disabled,
|
|
45
|
+
name,
|
|
46
|
+
placeholder,
|
|
47
|
+
value,
|
|
48
|
+
onChange: (newValue) => {
|
|
49
|
+
setValue(newValue ?? "");
|
|
50
|
+
if (onChange) {
|
|
51
|
+
onChange({
|
|
52
|
+
value: newValue ?? void 0,
|
|
53
|
+
parsed: parsePhoneNumber(newValue || "")
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
) });
|
|
59
|
+
}
|
|
60
|
+
const _PhoneInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
61
|
+
Input,
|
|
62
|
+
{
|
|
63
|
+
"data-testid": `${props.id}_input`,
|
|
64
|
+
"data-slot": "phone-input",
|
|
65
|
+
className: cn(
|
|
66
|
+
"-ms-px rounded-s-none rounded-l-none! shadow-none focus-visible:z-10",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
ref,
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
_PhoneInput.displayName = "_PhoneInput";
|
|
74
|
+
const CountrySelect = ({
|
|
75
|
+
id,
|
|
76
|
+
disabled,
|
|
77
|
+
value,
|
|
78
|
+
onChange,
|
|
79
|
+
options
|
|
80
|
+
}) => {
|
|
81
|
+
const handleSelect = (value2) => {
|
|
82
|
+
if (!onChange) return;
|
|
83
|
+
onChange(value2);
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ jsxs("div", { className: "border-input bg-background text-muted-foreground focus-within:border-ring focus-within:ring-ring/50 hover:bg-accent hover:text-foreground has-aria-invalid:border-destructive/60 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 relative inline-flex items-center self-stretch rounded-s-md border py-2 ps-3 pe-2 transition-[color,box-shadow] outline-none focus-within:z-10 focus-within:ring-[3px] has-disabled:pointer-events-none has-disabled:opacity-50", children: [
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [
|
|
87
|
+
/* @__PURE__ */ jsx(FlagComponent, { country: value, countryName: value, "aria-hidden": "true" }),
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/80", children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16, "aria-hidden": "true" }) })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsxs(
|
|
91
|
+
Select,
|
|
92
|
+
{
|
|
93
|
+
disabled,
|
|
94
|
+
value,
|
|
95
|
+
"data-testid": `${id}_select`,
|
|
96
|
+
onValueChange: handleSelect,
|
|
97
|
+
"aria-label": "Select country",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "absolute inset-0 text-sm opacity-0", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a country" }) }),
|
|
100
|
+
/* @__PURE__ */ jsx(SelectContent, { children: options.filter((x) => x.value).map((option, i) => {
|
|
101
|
+
if (!option.value) return null;
|
|
102
|
+
return /* @__PURE__ */ jsxs(
|
|
103
|
+
SelectItem,
|
|
104
|
+
{
|
|
105
|
+
value: option.value,
|
|
106
|
+
"data-testid": `${id}_${option.value}`,
|
|
107
|
+
children: [
|
|
108
|
+
option.label,
|
|
109
|
+
option.value && `+${getCountryCallingCode(option.value)}`
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
option.value
|
|
113
|
+
);
|
|
114
|
+
}) })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
};
|
|
120
|
+
const FlagComponent = ({ country, countryName }) => {
|
|
121
|
+
const Flag = flags[country];
|
|
122
|
+
return /* @__PURE__ */ jsx("span", { className: "w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ jsx(Flag, { title: countryName }) : /* @__PURE__ */ jsx(PhoneIcon, { size: 16, "aria-hidden": "true" }) });
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
PhoneInput
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=phone-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/custom/phone-input.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ChevronDownIcon, PhoneIcon } from \"lucide-react\";\r\nimport React, { useState } from \"react\";\r\nimport PhoneInputWithCountrySelect, {\r\n Country,\r\n FlagProps,\r\n getCountryCallingCode,\r\n parsePhoneNumber,\r\n} from \"react-phone-number-input\";\r\nimport flags from \"react-phone-number-input/flags\";\r\n\r\nimport { Input } from \"@repo/ayasofyazilim-ui/components/input\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport {\r\n Select,\r\n SelectContent,\r\n SelectItem,\r\n SelectTrigger,\r\n SelectValue,\r\n} from \"../components/select\";\r\n// import { FieldErrorTemplate } from \"./schema-form/fields\";\r\nexport type PhoneInputValues = {\r\n value: string | undefined;\r\n parsed: ReturnType<typeof parsePhoneNumber>;\r\n};\r\nexport type PhoneInputProps = {\r\n id: string;\r\n name?: string;\r\n placeholder?: string;\r\n defaultValue?: string | undefined;\r\n value?: string;\r\n onChange?: (values: PhoneInputValues) => void;\r\n disabled?: boolean;\r\n className?: string;\r\n required?: boolean;\r\n defaultCountry?: string;\r\n};\r\nexport function PhoneInput({\r\n id,\r\n name,\r\n placeholder,\r\n defaultValue,\r\n value: initialValue,\r\n onChange,\r\n disabled,\r\n required,\r\n className,\r\n defaultCountry = \"US\",\r\n}: PhoneInputProps) {\r\n const [value, setValue] = useState(initialValue || defaultValue || \"\");\r\n return (\r\n <>\r\n <PhoneInputWithCountrySelect\r\n className={cn(\"flex rounded-r-md shadow-xs\", className)}\r\n international\r\n flagComponent={FlagComponent}\r\n defaultCountry={defaultCountry as Country}\r\n countrySelectComponent={(props) => CountrySelect({ ...props, id })}\r\n inputComponent={_PhoneInput}\r\n id={id}\r\n required={required}\r\n data-testid={id}\r\n disabled={disabled}\r\n name={name}\r\n placeholder={placeholder}\r\n value={value}\r\n onChange={(newValue) => {\r\n setValue(newValue ?? \"\");\r\n if (onChange) {\r\n onChange({\r\n value: newValue ?? undefined,\r\n parsed: parsePhoneNumber(newValue || \"\"),\r\n });\r\n }\r\n }}\r\n />\r\n </>\r\n );\r\n}\r\n\r\n// Use forwardRef to support refs from react-phone-number-input\r\nconst _PhoneInput = React.forwardRef<\r\n HTMLInputElement,\r\n React.ComponentProps<\"input\">\r\n>(({ className, ...props }, ref) => (\r\n <Input\r\n data-testid={`${props.id}_input`}\r\n data-slot=\"phone-input\"\r\n className={cn(\r\n \"-ms-px rounded-s-none rounded-l-none! shadow-none focus-visible:z-10\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n />\r\n));\r\n\r\n_PhoneInput.displayName = \"_PhoneInput\";\r\n\r\ntype CountrySelectProps = {\r\n id: string;\r\n disabled?: boolean;\r\n value: Country;\r\n onChange?: (value: Country) => void;\r\n options: { label: string; value: Country | undefined }[];\r\n};\r\n\r\nconst CountrySelect = ({\r\n id,\r\n disabled,\r\n value,\r\n onChange,\r\n options,\r\n}: CountrySelectProps) => {\r\n const handleSelect = (value: Country) => {\r\n if (!onChange) return;\r\n onChange(value);\r\n };\r\n return (\r\n <div className=\"border-input bg-background text-muted-foreground focus-within:border-ring focus-within:ring-ring/50 hover:bg-accent hover:text-foreground has-aria-invalid:border-destructive/60 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 relative inline-flex items-center self-stretch rounded-s-md border py-2 ps-3 pe-2 transition-[color,box-shadow] outline-none focus-within:z-10 focus-within:ring-[3px] has-disabled:pointer-events-none has-disabled:opacity-50\">\r\n <div className=\"inline-flex items-center gap-1\" aria-hidden=\"true\">\r\n <FlagComponent country={value} countryName={value} aria-hidden=\"true\" />\r\n <span className=\"text-muted-foreground/80\">\r\n <ChevronDownIcon size={16} aria-hidden=\"true\" />\r\n </span>\r\n </div>\r\n <Select\r\n disabled={disabled}\r\n value={value}\r\n data-testid={`${id}_select`}\r\n onValueChange={handleSelect}\r\n aria-label=\"Select country\"\r\n >\r\n <SelectTrigger className=\"absolute inset-0 text-sm opacity-0\">\r\n <SelectValue placeholder=\"Select a country\" />\r\n </SelectTrigger>\r\n <SelectContent>\r\n {options\r\n .filter((x) => x.value)\r\n .map((option, i) => {\r\n if (!option.value) return null;\r\n return (\r\n <SelectItem\r\n key={option.value}\r\n value={option.value}\r\n data-testid={`${id}_${option.value}`}\r\n >\r\n {option.label}\r\n {option.value && `+${getCountryCallingCode(option.value)}`}\r\n </SelectItem>\r\n );\r\n })}\r\n </SelectContent>\r\n </Select>\r\n </div>\r\n );\r\n};\r\n\r\nconst FlagComponent = ({ country, countryName }: FlagProps) => {\r\n const Flag = flags[country];\r\n\r\n return (\r\n <span className=\"w-5 overflow-hidden rounded-sm\">\r\n {Flag ? (\r\n <Flag title={countryName} />\r\n ) : (\r\n <PhoneIcon size={16} aria-hidden=\"true\" />\r\n )}\r\n </span>\r\n );\r\n};\r\n"],"mappings":";AAoDI,mBACE,KAoEA,YArEF;AAlDJ,SAAS,iBAAiB,iBAAiB;AAC3C,OAAO,SAAS,gBAAgB;AAChC,OAAO;AAAA,EAGL;AAAA,EACA;AAAA,OACK;AACP,OAAO,WAAW;AAElB,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAkBA,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AACnB,GAAoB;AAClB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,gBAAgB,gBAAgB,EAAE;AACrE,SACE,gCACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,+BAA+B,SAAS;AAAA,MACtD,eAAa;AAAA,MACb,eAAe;AAAA,MACf;AAAA,MACA,wBAAwB,CAAC,UAAU,cAAc,EAAE,GAAG,OAAO,GAAG,CAAC;AAAA,MACjE,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,aAAa;AACtB,iBAAS,YAAY,EAAE;AACvB,YAAI,UAAU;AACZ,mBAAS;AAAA,YACP,OAAO,YAAY;AAAA,YACnB,QAAQ,iBAAiB,YAAY,EAAE;AAAA,UACzC,CAAC;AAAA,QACH;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ;AAGA,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC,eAAa,GAAG,MAAM,EAAE;AAAA,IACxB,aAAU;AAAA,IACV,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc;AAU1B,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA0B;AACxB,QAAM,eAAe,CAACA,WAAmB;AACvC,QAAI,CAAC,SAAU;AACf,aAASA,MAAK;AAAA,EAChB;AACA,SACE,qBAAC,SAAI,WAAU,meACb;AAAA,yBAAC,SAAI,WAAU,kCAAiC,eAAY,QAC1D;AAAA,0BAAC,iBAAc,SAAS,OAAO,aAAa,OAAO,eAAY,QAAO;AAAA,MACtE,oBAAC,UAAK,WAAU,4BACd,8BAAC,mBAAgB,MAAM,IAAI,eAAY,QAAO,GAChD;AAAA,OACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,GAAG,EAAE;AAAA,QAClB,eAAe;AAAA,QACf,cAAW;AAAA,QAEX;AAAA,8BAAC,iBAAc,WAAU,sCACvB,8BAAC,eAAY,aAAY,oBAAmB,GAC9C;AAAA,UACA,oBAAC,iBACE,kBACE,OAAO,CAAC,MAAM,EAAE,KAAK,EACrB,IAAI,CAAC,QAAQ,MAAM;AAClB,gBAAI,CAAC,OAAO,MAAO,QAAO;AAC1B,mBACE;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO,OAAO;AAAA,gBACd,eAAa,GAAG,EAAE,IAAI,OAAO,KAAK;AAAA,gBAEjC;AAAA,yBAAO;AAAA,kBACP,OAAO,SAAS,IAAI,sBAAsB,OAAO,KAAK,CAAC;AAAA;AAAA;AAAA,cALnD,OAAO;AAAA,YAMd;AAAA,UAEJ,CAAC,GACL;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,MAAM,gBAAgB,CAAC,EAAE,SAAS,YAAY,MAAiB;AAC7D,QAAM,OAAO,MAAM,OAAO;AAE1B,SACE,oBAAC,UAAK,WAAU,kCACb,iBACC,oBAAC,QAAK,OAAO,aAAa,IAE1B,oBAAC,aAAU,MAAM,IAAI,eAAY,QAAO,GAE5C;AAEJ;","names":["value"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/custom/index.tsx"],"sourcesContent":["export * from \"./label\";\r\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Label } from "@repo/ayasofyazilim-ui/components/label";
|
|
3
|
+
import {
|
|
4
|
+
Tooltip,
|
|
5
|
+
TooltipContent,
|
|
6
|
+
TooltipProvider,
|
|
7
|
+
TooltipTrigger
|
|
8
|
+
} from "@repo/ayasofyazilim-ui/components/tooltip";
|
|
9
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
10
|
+
import { InfoIcon } from "lucide-react";
|
|
11
|
+
function FieldLabel({
|
|
12
|
+
id,
|
|
13
|
+
className,
|
|
14
|
+
required,
|
|
15
|
+
label,
|
|
16
|
+
description
|
|
17
|
+
}) {
|
|
18
|
+
if (!label) return null;
|
|
19
|
+
return /* @__PURE__ */ jsxs(
|
|
20
|
+
Label,
|
|
21
|
+
{
|
|
22
|
+
"data-testid": `${id}_label`,
|
|
23
|
+
htmlFor: id,
|
|
24
|
+
className: cn("flex items-center gap-0 text-nowrap", className),
|
|
25
|
+
children: [
|
|
26
|
+
label,
|
|
27
|
+
required ? /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "*" }) : null,
|
|
28
|
+
description && typeof description === "string" && description.length > 0 ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(InfoIcon, { className: "size-3.5 ml-1 text-muted-foreground cursor-help" }) }),
|
|
30
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: description })
|
|
31
|
+
] }) }) : description
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
FieldLabel
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/custom/label.tsx"],"sourcesContent":["import { Label } from \"@repo/ayasofyazilim-ui/components/label\";\r\nimport {\r\n Tooltip,\r\n TooltipContent,\r\n TooltipProvider,\r\n TooltipTrigger,\r\n} from \"@repo/ayasofyazilim-ui/components/tooltip\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { InfoIcon } from \"lucide-react\";\r\nimport { JSXElementConstructor, ReactElement } from \"react\";\r\n\r\nexport function FieldLabel({\r\n id,\r\n className,\r\n required,\r\n label,\r\n description,\r\n}: {\r\n label: string | undefined;\r\n id: string | undefined;\r\n className?: string;\r\n required?: boolean;\r\n description?:\r\n | ReactElement<unknown, string | JSXElementConstructor<any>>\r\n | string\r\n | undefined;\r\n}) {\r\n if (!label) return null;\r\n return (\r\n <Label\r\n data-testid={`${id}_label`}\r\n htmlFor={id}\r\n className={cn(\"flex items-center gap-0 text-nowrap\", className)}\r\n >\r\n {label}\r\n {required ? <span className=\"text-destructive\">*</span> : null}\r\n {description &&\r\n typeof description === \"string\" &&\r\n description.length > 0 ? (\r\n <TooltipProvider>\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <InfoIcon className=\"size-3.5 ml-1 text-muted-foreground cursor-help\" />\r\n </TooltipTrigger>\r\n <TooltipContent>{description}</TooltipContent>\r\n </Tooltip>\r\n </TooltipProvider>\r\n ) : (\r\n description\r\n )}\r\n </Label>\r\n );\r\n}\r\n"],"mappings":"AAmCkB,cAKR,YALQ;AAnClB,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAGlB,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,MAAI,CAAC,MAAO,QAAO;AACnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,GAAG,EAAE;AAAA,MAClB,SAAS;AAAA,MACT,WAAW,GAAG,uCAAuC,SAAS;AAAA,MAE7D;AAAA;AAAA,QACA,WAAW,oBAAC,UAAK,WAAU,oBAAmB,eAAC,IAAU;AAAA,QACzD,eACD,OAAO,gBAAgB,YACvB,YAAY,SAAS,IACnB,oBAAC,mBACC,+BAAC,WACC;AAAA,8BAAC,kBAAe,SAAO,MACrB,8BAAC,YAAS,WAAU,mDAAkD,GACxE;AAAA,UACA,oBAAC,kBAAgB,uBAAY;AAAA,WAC/B,GACF,IAEA;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input } from "@repo/ayasofyazilim-ui/components/input";
|
|
3
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
4
|
+
import {
|
|
5
|
+
ariaDescribedByIds,
|
|
6
|
+
examplesId,
|
|
7
|
+
getInputProps
|
|
8
|
+
} from "@rjsf/utils";
|
|
9
|
+
function BaseInputTemplate({
|
|
10
|
+
id,
|
|
11
|
+
htmlName,
|
|
12
|
+
placeholder,
|
|
13
|
+
required,
|
|
14
|
+
readonly,
|
|
15
|
+
disabled,
|
|
16
|
+
type,
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
onChangeOverride,
|
|
20
|
+
onBlur,
|
|
21
|
+
onFocus,
|
|
22
|
+
autofocus,
|
|
23
|
+
options,
|
|
24
|
+
schema,
|
|
25
|
+
rawErrors = [],
|
|
26
|
+
children,
|
|
27
|
+
extraProps,
|
|
28
|
+
className
|
|
29
|
+
}) {
|
|
30
|
+
const inputProps = {
|
|
31
|
+
...extraProps,
|
|
32
|
+
...getInputProps(schema, type, options)
|
|
33
|
+
};
|
|
34
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
35
|
+
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
36
|
+
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
37
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
Input,
|
|
40
|
+
{
|
|
41
|
+
id,
|
|
42
|
+
name: htmlName || id,
|
|
43
|
+
type,
|
|
44
|
+
placeholder,
|
|
45
|
+
autoFocus: autofocus,
|
|
46
|
+
required,
|
|
47
|
+
disabled,
|
|
48
|
+
readOnly: readonly,
|
|
49
|
+
className: cn(
|
|
50
|
+
{ "border-destructive focus-visible:ring-0": rawErrors.length > 0 },
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
list: schema.examples ? examplesId(id) : void 0,
|
|
54
|
+
...inputProps,
|
|
55
|
+
value: value || value === 0 ? value : "",
|
|
56
|
+
onChange: onChangeOverride || _onChange,
|
|
57
|
+
onBlur: _onBlur,
|
|
58
|
+
onFocus: _onFocus,
|
|
59
|
+
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
children,
|
|
63
|
+
Array.isArray(schema.examples) ? /* @__PURE__ */ jsx("datalist", { id: examplesId(id), children: schema.examples.concat(
|
|
64
|
+
schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []
|
|
65
|
+
).map((example) => {
|
|
66
|
+
return /* @__PURE__ */ jsx("option", { value: example }, example);
|
|
67
|
+
}) }) : null
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
BaseInputTemplate
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=base-input-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/fields/base-input-field.tsx"],"sourcesContent":["import { Input } from \"@repo/ayasofyazilim-ui/components/input\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport {\r\n ariaDescribedByIds,\r\n BaseInputTemplateProps,\r\n examplesId,\r\n getInputProps,\r\n} from \"@rjsf/utils\";\r\nimport { ChangeEvent, FocusEvent } from \"react\";\r\n\r\nexport function BaseInputTemplate({\r\n id,\r\n htmlName,\r\n placeholder,\r\n required,\r\n readonly,\r\n disabled,\r\n type,\r\n value,\r\n onChange,\r\n onChangeOverride,\r\n onBlur,\r\n onFocus,\r\n autofocus,\r\n options,\r\n schema,\r\n rawErrors = [],\r\n children,\r\n extraProps,\r\n className,\r\n}: BaseInputTemplateProps) {\r\n const inputProps = {\r\n ...extraProps,\r\n ...getInputProps(schema, type, options),\r\n };\r\n const _onChange = ({ target: { value } }: ChangeEvent<HTMLInputElement>) =>\r\n onChange(value === \"\" ? options.emptyValue : value);\r\n const _onBlur = ({ target }: FocusEvent<HTMLInputElement>) =>\r\n onBlur(id, target && target.value);\r\n const _onFocus = ({ target }: FocusEvent<HTMLInputElement>) =>\r\n onFocus(id, target && target.value);\r\n\r\n return (\r\n <>\r\n <Input\r\n id={id}\r\n name={htmlName || id}\r\n type={type}\r\n placeholder={placeholder}\r\n autoFocus={autofocus}\r\n required={required}\r\n disabled={disabled}\r\n readOnly={readonly}\r\n className={cn(\r\n { \"border-destructive focus-visible:ring-0\": rawErrors.length > 0 },\r\n className\r\n )}\r\n list={schema.examples ? examplesId(id) : undefined}\r\n {...inputProps}\r\n value={value || value === 0 ? value : \"\"}\r\n onChange={onChangeOverride || _onChange}\r\n onBlur={_onBlur}\r\n onFocus={_onFocus}\r\n aria-describedby={ariaDescribedByIds(id, !!schema.examples)}\r\n />\r\n {children}\r\n {Array.isArray(schema.examples) ? (\r\n <datalist id={examplesId(id)}>\r\n {(schema.examples as string[])\r\n .concat(\r\n schema.default && !schema.examples.includes(schema.default)\r\n ? ([schema.default] as string[])\r\n : []\r\n )\r\n .map((example: any) => {\r\n return <option key={example} value={example} />;\r\n })}\r\n </datalist>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n"],"mappings":"AA2CI,mBACE,KADF;AA3CJ,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAGA,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF,GAA2B;AACzB,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH,GAAG,cAAc,QAAQ,MAAM,OAAO;AAAA,EACxC;AACA,QAAM,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAAA,OAAM,EAAE,MACrC,SAASA,WAAU,KAAK,QAAQ,aAAaA,MAAK;AACpD,QAAM,UAAU,CAAC,EAAE,OAAO,MACxB,OAAO,IAAI,UAAU,OAAO,KAAK;AACnC,QAAM,WAAW,CAAC,EAAE,OAAO,MACzB,QAAQ,IAAI,UAAU,OAAO,KAAK;AAEpC,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,YAAY;AAAA,QAClB;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,UACT,EAAE,2CAA2C,UAAU,SAAS,EAAE;AAAA,UAClE;AAAA,QACF;AAAA,QACA,MAAM,OAAO,WAAW,WAAW,EAAE,IAAI;AAAA,QACxC,GAAG;AAAA,QACJ,OAAO,SAAS,UAAU,IAAI,QAAQ;AAAA,QACtC,UAAU,oBAAoB;AAAA,QAC9B,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,oBAAkB,mBAAmB,IAAI,CAAC,CAAC,OAAO,QAAQ;AAAA;AAAA,IAC5D;AAAA,IACC;AAAA,IACA,MAAM,QAAQ,OAAO,QAAQ,IAC5B,oBAAC,cAAS,IAAI,WAAW,EAAE,GACvB,iBAAO,SACN;AAAA,MACC,OAAO,WAAW,CAAC,OAAO,SAAS,SAAS,OAAO,OAAO,IACrD,CAAC,OAAO,OAAO,IAChB,CAAC;AAAA,IACP,EACC,IAAI,CAAC,YAAiB;AACrB,aAAO,oBAAC,YAAqB,OAAO,WAAhB,OAAyB;AAAA,IAC/C,CAAC,GACL,IACE;AAAA,KACN;AAEJ;","names":["value"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TableCell } from "@repo/ayasofyazilim-ui/components/table";
|
|
3
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
4
|
+
import { FieldLabel } from "../custom";
|
|
5
|
+
const FieldTemplate = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
id,
|
|
8
|
+
classNames,
|
|
9
|
+
style,
|
|
10
|
+
label,
|
|
11
|
+
help,
|
|
12
|
+
required,
|
|
13
|
+
description,
|
|
14
|
+
errors,
|
|
15
|
+
children,
|
|
16
|
+
displayLabel,
|
|
17
|
+
hidden,
|
|
18
|
+
schema,
|
|
19
|
+
registry
|
|
20
|
+
} = props;
|
|
21
|
+
const shouldRenderLabel = label && displayLabel && schema.type !== "boolean";
|
|
22
|
+
if (hidden) return null;
|
|
23
|
+
const isInArray = /root_\w+_\d+/.test(id);
|
|
24
|
+
const { useTableForArrayFields } = registry.formContext;
|
|
25
|
+
if (schema.type === "object" && isInArray && useTableForArrayFields)
|
|
26
|
+
return children;
|
|
27
|
+
if (isInArray && useTableForArrayFields)
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
TableCell,
|
|
30
|
+
{
|
|
31
|
+
className: cn(
|
|
32
|
+
"p-0",
|
|
33
|
+
"*:data-wrapper:border-0 *:data-wrapper:shadow-none *:data-wrapper:rounded-none *:data-wrapper:justify-center",
|
|
34
|
+
"**:[[role=combobox]]:border-0 **:[[role=combobox]]:shadow-none **:[[role=combobox]]:rounded-none",
|
|
35
|
+
"**:data-[slot=input]:border-0 **:data-[slot=input]:shadow-none **:data-[slot=input]:rounded-none",
|
|
36
|
+
"**:data-rac:border-0 **:data-rac:shadow-none **:data-rac:rounded-none",
|
|
37
|
+
"*:data-[slot=drawer-trigger]:border-0"
|
|
38
|
+
),
|
|
39
|
+
children
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"flex flex-col gap-1.5 h-max",
|
|
47
|
+
props.schema.type === "object" && "gap-3",
|
|
48
|
+
classNames,
|
|
49
|
+
label
|
|
50
|
+
),
|
|
51
|
+
style,
|
|
52
|
+
children: [
|
|
53
|
+
shouldRenderLabel && /* @__PURE__ */ jsx(
|
|
54
|
+
FieldLabel,
|
|
55
|
+
{
|
|
56
|
+
id,
|
|
57
|
+
label,
|
|
58
|
+
description,
|
|
59
|
+
required
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
children,
|
|
63
|
+
errors,
|
|
64
|
+
help
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
FieldTemplate
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/fields/field.tsx"],"sourcesContent":["import { TableCell } from \"@repo/ayasofyazilim-ui/components/table\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport { FieldTemplateProps } from \"@rjsf/utils\";\r\nimport { FieldLabel } from \"../custom\";\r\n\r\nexport const FieldTemplate = (props: FieldTemplateProps) => {\r\n const {\r\n id,\r\n classNames,\r\n style,\r\n label,\r\n help,\r\n required,\r\n description,\r\n errors,\r\n children,\r\n displayLabel,\r\n hidden,\r\n schema,\r\n registry,\r\n } = props;\r\n\r\n const shouldRenderLabel = label && displayLabel && schema.type !== \"boolean\";\r\n if (hidden) return null;\r\n const isInArray = /root_\\w+_\\d+/.test(id);\r\n const { useTableForArrayFields } = registry.formContext;\r\n if (schema.type === \"object\" && isInArray && useTableForArrayFields)\r\n return children;\r\n if (isInArray && useTableForArrayFields)\r\n return (\r\n <TableCell\r\n className={cn(\r\n \"p-0\",\r\n \"*:data-wrapper:border-0 *:data-wrapper:shadow-none *:data-wrapper:rounded-none *:data-wrapper:justify-center\",\r\n \"**:[[role=combobox]]:border-0 **:[[role=combobox]]:shadow-none **:[[role=combobox]]:rounded-none\",\r\n \"**:data-[slot=input]:border-0 **:data-[slot=input]:shadow-none **:data-[slot=input]:rounded-none\",\r\n \"**:data-rac:border-0 **:data-rac:shadow-none **:data-rac:rounded-none\",\r\n \"*:data-[slot=drawer-trigger]:border-0\"\r\n )}\r\n >\r\n {children}\r\n </TableCell>\r\n );\r\n return (\r\n <div\r\n className={cn(\r\n \"flex flex-col gap-1.5 h-max\",\r\n props.schema.type === \"object\" && \"gap-3\",\r\n classNames,\r\n label\r\n )}\r\n style={style}\r\n >\r\n {shouldRenderLabel && (\r\n <FieldLabel\r\n id={id}\r\n label={label}\r\n description={description}\r\n required={required}\r\n />\r\n )}\r\n {children}\r\n {errors}\r\n {help}\r\n </div>\r\n );\r\n};\r\n"],"mappings":"AA8BM,cAcF,YAdE;AA9BN,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,kBAAkB;AAEpB,MAAM,gBAAgB,CAAC,UAA8B;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,oBAAoB,SAAS,gBAAgB,OAAO,SAAS;AACnE,MAAI,OAAQ,QAAO;AACnB,QAAM,YAAY,eAAe,KAAK,EAAE;AACxC,QAAM,EAAE,uBAAuB,IAAI,SAAS;AAC5C,MAAI,OAAO,SAAS,YAAY,aAAa;AAC3C,WAAO;AACT,MAAI,aAAa;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAEC;AAAA;AAAA,IACH;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,MAAM,OAAO,SAAS,YAAY;AAAA,QAClC;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MAEC;AAAA,6BACC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA,QAED;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/fields/index.tsx"],"sourcesContent":["export * from \"./field\";\r\nexport * from \"./object\";\r\nexport * from \"./table-array/array-field-item\";\r\nexport * from \"./table-array/array-field-template\";\r\nexport * from \"./base-input-field\";\r\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as Fragment2 } from "react";
|
|
3
|
+
const ObjectFieldTemplate = (props) => {
|
|
4
|
+
return /* @__PURE__ */ jsx(Fragment, { children: props.properties.map((element, idx) => /* @__PURE__ */ jsx(Fragment2, { children: element.content }, element.name + idx)) });
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
ObjectFieldTemplate
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/custom/schema-form/fields/object.tsx"],"sourcesContent":["import { ObjectFieldTemplateProps } from \"@rjsf/utils\";\r\nimport { Fragment } from \"react\";\r\n\r\nexport const ObjectFieldTemplate = (props: ObjectFieldTemplateProps) => {\r\n return (\r\n <>\r\n {props.properties.map((element, idx) => (\r\n <Fragment key={element.name + idx}>{element.content}</Fragment>\r\n ))}\r\n </>\r\n );\r\n};\r\n"],"mappings":"AAKI,mBAEI,WAFJ;AAJJ,SAAS,YAAAA,iBAAgB;AAElB,MAAM,sBAAsB,CAAC,UAAoC;AACtE,SACE,gCACG,gBAAM,WAAW,IAAI,CAAC,SAAS,QAC9B,oBAACA,WAAA,EAAmC,kBAAQ,WAA7B,QAAQ,OAAO,GAAsB,CACrD,GACH;AAEJ;","names":["Fragment"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@repo/ayasofyazilim-ui/components/button";
|
|
3
|
+
import { ButtonGroup } from "@repo/ayasofyazilim-ui/components/button-group";
|
|
4
|
+
import {
|
|
5
|
+
Popover,
|
|
6
|
+
PopoverContent,
|
|
7
|
+
PopoverTrigger
|
|
8
|
+
} from "@repo/ayasofyazilim-ui/components/popover";
|
|
9
|
+
import { TableCell, TableRow } from "@repo/ayasofyazilim-ui/components/table";
|
|
10
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
11
|
+
import {
|
|
12
|
+
ArrowDownIcon,
|
|
13
|
+
ArrowUpIcon,
|
|
14
|
+
ClipboardCheck,
|
|
15
|
+
MoreHorizontal,
|
|
16
|
+
Trash2
|
|
17
|
+
} from "lucide-react";
|
|
18
|
+
function ArrayFieldItemTemplate(props) {
|
|
19
|
+
const { children, buttonsProps, hasToolbar } = props;
|
|
20
|
+
const {
|
|
21
|
+
hasCopy,
|
|
22
|
+
hasMoveDown,
|
|
23
|
+
hasMoveUp,
|
|
24
|
+
hasRemove,
|
|
25
|
+
onCopyItem,
|
|
26
|
+
onMoveDownItem,
|
|
27
|
+
onMoveUpItem,
|
|
28
|
+
onRemoveItem
|
|
29
|
+
} = buttonsProps;
|
|
30
|
+
const isMultipleToolbar = hasRemove && (hasCopy || hasMoveDown || hasMoveUp);
|
|
31
|
+
return /* @__PURE__ */ jsxs(TableRow, { className: cn("divide-x", props.className), children: [
|
|
32
|
+
children,
|
|
33
|
+
/* @__PURE__ */ jsxs(TableCell, { className: "p-0", children: [
|
|
34
|
+
hasToolbar && hasRemove && !isMultipleToolbar && /* @__PURE__ */ jsx(
|
|
35
|
+
Button,
|
|
36
|
+
{
|
|
37
|
+
variant: "ghost",
|
|
38
|
+
type: "button",
|
|
39
|
+
onClick: buttonsProps.onRemoveItem,
|
|
40
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
hasToolbar && isMultipleToolbar && /* @__PURE__ */ jsxs(Popover, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", type: "button", className: "", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }) }) }),
|
|
45
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "p-0 border-0 min-w-max", children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
46
|
+
hasCopy && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onCopyItem, children: /* @__PURE__ */ jsx(ClipboardCheck, { className: "size-4" }) }),
|
|
47
|
+
hasMoveUp && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onMoveUpItem, children: /* @__PURE__ */ jsx(ArrowUpIcon, { className: "size-4" }) }),
|
|
48
|
+
hasRemove && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onRemoveItem, children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" }) }),
|
|
49
|
+
hasMoveDown && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onMoveDownItem, children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" }) })
|
|
50
|
+
] }) })
|
|
51
|
+
] })
|
|
52
|
+
] })
|
|
53
|
+
] }, props.itemKey);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
ArrayFieldItemTemplate
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=array-field-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/custom/schema-form/fields/table-array/array-field-item.tsx"],"sourcesContent":["import { Button } from \"@repo/ayasofyazilim-ui/components/button\";\r\nimport { ButtonGroup } from \"@repo/ayasofyazilim-ui/components/button-group\";\r\nimport {\r\n Popover,\r\n PopoverContent,\r\n PopoverTrigger,\r\n} from \"@repo/ayasofyazilim-ui/components/popover\";\r\nimport { TableCell, TableRow } from \"@repo/ayasofyazilim-ui/components/table\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport {\r\n ArrayFieldItemTemplateProps,\r\n FormContextType,\r\n RJSFSchema,\r\n StrictRJSFSchema,\r\n} from \"@rjsf/utils\";\r\nimport {\r\n ArrowDownIcon,\r\n ArrowUpIcon,\r\n ClipboardCheck,\r\n MoreHorizontal,\r\n Trash2,\r\n} from \"lucide-react\";\r\n\r\nexport function ArrayFieldItemTemplate<\r\n T = any,\r\n S extends StrictRJSFSchema = RJSFSchema,\r\n F extends FormContextType = any,\r\n>(props: ArrayFieldItemTemplateProps<T, S, F>) {\r\n const { children, buttonsProps, hasToolbar } = props;\r\n const {\r\n hasCopy,\r\n hasMoveDown,\r\n hasMoveUp,\r\n hasRemove,\r\n onCopyItem,\r\n onMoveDownItem,\r\n onMoveUpItem,\r\n onRemoveItem,\r\n } = buttonsProps;\r\n const isMultipleToolbar = hasRemove && (hasCopy || hasMoveDown || hasMoveUp);\r\n return (\r\n <TableRow className={cn(\"divide-x\", props.className)} key={props.itemKey}>\r\n {children}\r\n <TableCell className=\"p-0\">\r\n {hasToolbar && hasRemove && !isMultipleToolbar && (\r\n <Button\r\n variant=\"ghost\"\r\n type=\"button\"\r\n onClick={buttonsProps.onRemoveItem}\r\n >\r\n <Trash2 className=\"size-4\" />\r\n </Button>\r\n )}\r\n {hasToolbar && isMultipleToolbar && (\r\n <Popover>\r\n <PopoverTrigger asChild>\r\n <Button variant=\"ghost\" type=\"button\" className=\"\">\r\n <MoreHorizontal className=\"size-4\" />\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent className=\"p-0 border-0 min-w-max\">\r\n <ButtonGroup>\r\n {hasCopy && (\r\n <Button variant=\"outline\" onClick={onCopyItem}>\r\n <ClipboardCheck className=\"size-4\" />\r\n </Button>\r\n )}\r\n {hasMoveUp && (\r\n <Button variant=\"outline\" onClick={onMoveUpItem}>\r\n <ArrowUpIcon className=\"size-4\" />\r\n </Button>\r\n )}\r\n {hasRemove && (\r\n <Button variant=\"outline\" onClick={onRemoveItem}>\r\n <Trash2 className=\"size-4\" />\r\n </Button>\r\n )}\r\n {hasMoveDown && (\r\n <Button variant=\"outline\" onClick={onMoveDownItem}>\r\n <ArrowDownIcon className=\"size-4\" />\r\n </Button>\r\n )}\r\n </ButtonGroup>\r\n </PopoverContent>\r\n </Popover>\r\n )}\r\n </TableCell>\r\n </TableRow>\r\n );\r\n}\r\n"],"mappings":"AAkDY,cAWE,YAXF;AAlDZ,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,gBAAgB;AACpC,SAAS,UAAU;AAOnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,uBAId,OAA6C;AAC7C,QAAM,EAAE,UAAU,cAAc,WAAW,IAAI;AAC/C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,oBAAoB,cAAc,WAAW,eAAe;AAClE,SACE,qBAAC,YAAS,WAAW,GAAG,YAAY,MAAM,SAAS,GAChD;AAAA;AAAA,IACD,qBAAC,aAAU,WAAU,OAClB;AAAA,oBAAc,aAAa,CAAC,qBAC3B;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,SAAS,aAAa;AAAA,UAEtB,8BAAC,UAAO,WAAU,UAAS;AAAA;AAAA,MAC7B;AAAA,MAED,cAAc,qBACb,qBAAC,WACC;AAAA,4BAAC,kBAAe,SAAO,MACrB,8BAAC,UAAO,SAAQ,SAAQ,MAAK,UAAS,WAAU,IAC9C,8BAAC,kBAAe,WAAU,UAAS,GACrC,GACF;AAAA,QACA,oBAAC,kBAAe,WAAU,0BACxB,+BAAC,eACE;AAAA,qBACC,oBAAC,UAAO,SAAQ,WAAU,SAAS,YACjC,8BAAC,kBAAe,WAAU,UAAS,GACrC;AAAA,UAED,aACC,oBAAC,UAAO,SAAQ,WAAU,SAAS,cACjC,8BAAC,eAAY,WAAU,UAAS,GAClC;AAAA,UAED,aACC,oBAAC,UAAO,SAAQ,WAAU,SAAS,cACjC,8BAAC,UAAO,WAAU,UAAS,GAC7B;AAAA,UAED,eACC,oBAAC,UAAO,SAAQ,WAAU,SAAS,gBACjC,8BAAC,iBAAc,WAAU,UAAS,GACpC;AAAA,WAEJ,GACF;AAAA,SACF;AAAA,OAEJ;AAAA,OA7CyD,MAAM,OA8CjE;AAEJ;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@repo/ayasofyazilim-ui/components/button";
|
|
3
|
+
import {
|
|
4
|
+
Table,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableCaption,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableHeader,
|
|
9
|
+
TableRow
|
|
10
|
+
} from "@repo/ayasofyazilim-ui/components/table";
|
|
11
|
+
import { cn } from "@repo/ayasofyazilim-ui/lib/utils";
|
|
12
|
+
import {
|
|
13
|
+
buttonId,
|
|
14
|
+
getTemplate,
|
|
15
|
+
getUiOptions
|
|
16
|
+
} from "@rjsf/utils";
|
|
17
|
+
import { PlusCircle } from "lucide-react";
|
|
18
|
+
function ArrayFieldTemplate(props) {
|
|
19
|
+
const {
|
|
20
|
+
canAdd,
|
|
21
|
+
disabled,
|
|
22
|
+
fieldPathId,
|
|
23
|
+
uiSchema,
|
|
24
|
+
items,
|
|
25
|
+
optionalDataControl,
|
|
26
|
+
onAddClick,
|
|
27
|
+
readonly,
|
|
28
|
+
registry,
|
|
29
|
+
required,
|
|
30
|
+
schema,
|
|
31
|
+
title
|
|
32
|
+
} = props;
|
|
33
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
34
|
+
const ArrayFieldDescriptionTemplate = getTemplate(
|
|
35
|
+
"ArrayFieldDescriptionTemplate",
|
|
36
|
+
registry,
|
|
37
|
+
uiOptions
|
|
38
|
+
);
|
|
39
|
+
const ArrayFieldTitleTemplate = getTemplate(
|
|
40
|
+
"ArrayFieldTitleTemplate",
|
|
41
|
+
registry,
|
|
42
|
+
uiOptions
|
|
43
|
+
);
|
|
44
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
45
|
+
return /* @__PURE__ */ jsx("div", { className: "border rounded-md overflow-hidden", children: /* @__PURE__ */ jsxs(Table, { className: "caption-top", children: [
|
|
46
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
47
|
+
/* @__PURE__ */ jsxs(TableCaption, { className: "border-b mt-0 [&_h5]:font-medium [&_h5]:text-black **:data-[slot=separator]:hidden", children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
ArrayFieldTitleTemplate,
|
|
50
|
+
{
|
|
51
|
+
fieldPathId,
|
|
52
|
+
title: uiOptions.title || title,
|
|
53
|
+
schema,
|
|
54
|
+
uiSchema,
|
|
55
|
+
required,
|
|
56
|
+
registry,
|
|
57
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
ArrayFieldDescriptionTemplate,
|
|
62
|
+
{
|
|
63
|
+
fieldPathId,
|
|
64
|
+
description: uiOptions.description || schema.description,
|
|
65
|
+
schema,
|
|
66
|
+
uiSchema,
|
|
67
|
+
registry
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "divide-x", children: [
|
|
72
|
+
Object.keys(
|
|
73
|
+
schema?.items?.properties || {}
|
|
74
|
+
).map((item) => {
|
|
75
|
+
const itemsUiSchema = typeof uiSchema?.items === "function" ? void 0 : uiSchema?.items;
|
|
76
|
+
const title2 = itemsUiSchema?.[item]?.["ui:title"] || item;
|
|
77
|
+
return /* @__PURE__ */ jsx(
|
|
78
|
+
TableHead,
|
|
79
|
+
{
|
|
80
|
+
className: cn("h-9", !canAdd && "nth-last-2:border-0!"),
|
|
81
|
+
children: title2
|
|
82
|
+
},
|
|
83
|
+
item
|
|
84
|
+
);
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ jsx(TableHead, { className: cn("p-0 size-9"), children: canAdd && /* @__PURE__ */ jsx(
|
|
87
|
+
Button,
|
|
88
|
+
{
|
|
89
|
+
id: buttonId(fieldPathId, "add"),
|
|
90
|
+
onClick: onAddClick,
|
|
91
|
+
disabled: disabled || readonly,
|
|
92
|
+
className: "rounded-none h-full",
|
|
93
|
+
variant: "ghost",
|
|
94
|
+
children: /* @__PURE__ */ jsx(PlusCircle, { className: "size-4" })
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
97
|
+
] }) }),
|
|
98
|
+
/* @__PURE__ */ jsx(TableBody, { className: "[&_tr:last-child>td]:rounded-md", children: items })
|
|
99
|
+
] }, `array-item-list-${fieldPathId.$id}`) });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
ArrayFieldTemplate
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=array-field-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/custom/schema-form/fields/table-array/array-field-template.tsx"],"sourcesContent":["import { Button } from \"@repo/ayasofyazilim-ui/components/button\";\r\nimport {\r\n Table,\r\n TableBody,\r\n TableCaption,\r\n TableHead,\r\n TableHeader,\r\n TableRow,\r\n} from \"@repo/ayasofyazilim-ui/components/table\";\r\nimport { cn } from \"@repo/ayasofyazilim-ui/lib/utils\";\r\nimport {\r\n ArrayFieldTemplateProps,\r\n buttonId,\r\n getTemplate,\r\n getUiOptions,\r\n} from \"@rjsf/utils\";\r\nimport { PlusCircle } from \"lucide-react\";\r\n\r\nexport function ArrayFieldTemplate(props: ArrayFieldTemplateProps) {\r\n const {\r\n canAdd,\r\n disabled,\r\n fieldPathId,\r\n uiSchema,\r\n items,\r\n optionalDataControl,\r\n onAddClick,\r\n readonly,\r\n registry,\r\n required,\r\n schema,\r\n title,\r\n } = props;\r\n const uiOptions = getUiOptions(uiSchema);\r\n const ArrayFieldDescriptionTemplate = getTemplate(\r\n \"ArrayFieldDescriptionTemplate\",\r\n registry,\r\n uiOptions\r\n );\r\n const ArrayFieldTitleTemplate = getTemplate(\r\n \"ArrayFieldTitleTemplate\",\r\n registry,\r\n uiOptions\r\n );\r\n const showOptionalDataControlInTitle = !readonly && !disabled;\r\n\r\n return (\r\n <div className=\"border rounded-md overflow-hidden\">\r\n <Table key={`array-item-list-${fieldPathId.$id}`} className=\"caption-top\">\r\n {!showOptionalDataControlInTitle ? optionalDataControl : undefined}\r\n <TableCaption className=\"border-b mt-0 [&_h5]:font-medium [&_h5]:text-black **:data-[slot=separator]:hidden\">\r\n <ArrayFieldTitleTemplate\r\n fieldPathId={fieldPathId}\r\n title={uiOptions.title || title}\r\n schema={schema}\r\n uiSchema={uiSchema}\r\n required={required}\r\n registry={registry}\r\n optionalDataControl={\r\n showOptionalDataControlInTitle ? optionalDataControl : undefined\r\n }\r\n />\r\n <ArrayFieldDescriptionTemplate\r\n fieldPathId={fieldPathId}\r\n description={uiOptions.description || schema.description}\r\n schema={schema}\r\n uiSchema={uiSchema}\r\n registry={registry}\r\n />\r\n </TableCaption>\r\n <TableHeader>\r\n <TableRow className=\"divide-x\">\r\n {Object.keys(\r\n (schema?.items as { properties: Record<string, string> })\r\n ?.properties || {}\r\n ).map((item) => {\r\n const itemsUiSchema =\r\n typeof uiSchema?.items === \"function\"\r\n ? undefined\r\n : (uiSchema?.items as\r\n | Record<string, { \"ui:title\": string }>\r\n | undefined);\r\n const title =\r\n itemsUiSchema?.[item as string]?.[\"ui:title\"] || item;\r\n return (\r\n <TableHead\r\n key={item}\r\n className={cn(\"h-9\", !canAdd && \"nth-last-2:border-0!\")}\r\n >\r\n {title}\r\n </TableHead>\r\n );\r\n })}\r\n <TableHead className={cn(\"p-0 size-9\")}>\r\n {canAdd && (\r\n <Button\r\n id={buttonId(fieldPathId, \"add\")}\r\n onClick={onAddClick}\r\n disabled={disabled || readonly}\r\n className=\"rounded-none h-full\"\r\n variant=\"ghost\"\r\n >\r\n <PlusCircle className=\"size-4\" />\r\n </Button>\r\n )}\r\n </TableHead>\r\n </TableRow>\r\n </TableHeader>\r\n <TableBody className=\"[&_tr:last-child>td]:rounded-md\">\r\n {items}\r\n </TableBody>\r\n </Table>\r\n </div>\r\n );\r\n}\r\n"],"mappings":"AAkDQ,SACE,KADF;AAlDR,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAEpB,SAAS,mBAAmB,OAAgC;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,YAAY,aAAa,QAAQ;AACvC,QAAM,gCAAgC;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,0BAA0B;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,iCAAiC,CAAC,YAAY,CAAC;AAErD,SACE,oBAAC,SAAI,WAAU,qCACb,+BAAC,SAAiD,WAAU,eACzD;AAAA,KAAC,iCAAiC,sBAAsB;AAAA,IACzD,qBAAC,gBAAa,WAAU,uFACtB;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,OAAO,UAAU,SAAS;AAAA,UAC1B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,qBACE,iCAAiC,sBAAsB;AAAA;AAAA,MAE3D;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,aAAa,UAAU,eAAe,OAAO;AAAA,UAC7C;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA,OACF;AAAA,IACA,oBAAC,eACC,+BAAC,YAAS,WAAU,YACjB;AAAA,aAAO;AAAA,QACL,QAAQ,OACL,cAAc,CAAC;AAAA,MACrB,EAAE,IAAI,CAAC,SAAS;AACd,cAAM,gBACJ,OAAO,UAAU,UAAU,aACvB,SACC,UAAU;AAGjB,cAAMA,SACJ,gBAAgB,IAAc,IAAI,UAAU,KAAK;AACnD,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW,GAAG,OAAO,CAAC,UAAU,sBAAsB;AAAA,YAErD,UAAAA;AAAA;AAAA,UAHI;AAAA,QAIP;AAAA,MAEJ,CAAC;AAAA,MACD,oBAAC,aAAU,WAAW,GAAG,YAAY,GAClC,oBACC;AAAA,QAAC;AAAA;AAAA,UACC,IAAI,SAAS,aAAa,KAAK;AAAA,UAC/B,SAAS;AAAA,UACT,UAAU,YAAY;AAAA,UACtB,WAAU;AAAA,UACV,SAAQ;AAAA,UAER,8BAAC,cAAW,WAAU,UAAS;AAAA;AAAA,MACjC,GAEJ;AAAA,OACF,GACF;AAAA,IACA,oBAAC,aAAU,WAAU,mCAClB,iBACH;AAAA,OA9DU,mBAAmB,YAAY,GAAG,EA+D9C,GACF;AAEJ;","names":["title"]}
|