@ayasofyazilim/ui 0.0.0 → 0.0.2
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 +69 -68
- package/src/components/calendar.tsx +216 -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 +127 -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 +290 -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 +45 -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 +231 -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 +369 -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 +91 -90
- package/src/custom/master-data-grid/components/filters/server-filter.tsx +265 -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 +487 -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 +434 -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 +68 -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 +73 -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 +202 -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,197 @@
|
|
|
1
|
+
/*! tscanify v1.0.0 | Based on jscanify v1.4.0 | (c) ColonelParrot and other contributors | MIT License */
|
|
2
|
+
import { Canvas, createCanvas, Image, ImageData } from "canvas";
|
|
3
|
+
import { JSDOM } from "jsdom";
|
|
4
|
+
import cv from "opencv-ts";
|
|
5
|
+
function installDOM() {
|
|
6
|
+
const dom = new JSDOM();
|
|
7
|
+
global.document = dom.window.document;
|
|
8
|
+
global.Image = Image;
|
|
9
|
+
global.HTMLCanvasElement = Canvas;
|
|
10
|
+
global.ImageData = ImageData;
|
|
11
|
+
global.HTMLImageElement = Image;
|
|
12
|
+
}
|
|
13
|
+
function distance(p1, p2) {
|
|
14
|
+
return Math.hypot(p1.x - p2.x, p1.y - p2.y);
|
|
15
|
+
}
|
|
16
|
+
class TScanify {
|
|
17
|
+
constructor() {
|
|
18
|
+
installDOM();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Loads OpenCV module
|
|
22
|
+
* @param callback Function to call when OpenCV is initialized
|
|
23
|
+
*/
|
|
24
|
+
loadOpenCV(callback) {
|
|
25
|
+
cv.onRuntimeInitialized = () => {
|
|
26
|
+
callback(cv);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Finds the contour of the paper within the image
|
|
31
|
+
* @param img image to process (Mat)
|
|
32
|
+
* @returns the biggest contour inside the image
|
|
33
|
+
*/
|
|
34
|
+
findPaperContour(img) {
|
|
35
|
+
const imgGray = new cv.Mat();
|
|
36
|
+
cv.Canny(img, imgGray, 50, 200);
|
|
37
|
+
const imgBlur = new cv.Mat();
|
|
38
|
+
cv.GaussianBlur(
|
|
39
|
+
imgGray,
|
|
40
|
+
imgBlur,
|
|
41
|
+
new cv.Size(3, 3),
|
|
42
|
+
0,
|
|
43
|
+
0,
|
|
44
|
+
cv.BORDER_DEFAULT
|
|
45
|
+
);
|
|
46
|
+
const imgThresh = new cv.Mat();
|
|
47
|
+
cv.threshold(imgBlur, imgThresh, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU);
|
|
48
|
+
const contours = new cv.MatVector();
|
|
49
|
+
const hierarchy = new cv.Mat();
|
|
50
|
+
cv.findContours(
|
|
51
|
+
imgThresh,
|
|
52
|
+
contours,
|
|
53
|
+
hierarchy,
|
|
54
|
+
cv.RETR_CCOMP,
|
|
55
|
+
cv.CHAIN_APPROX_SIMPLE
|
|
56
|
+
);
|
|
57
|
+
let maxArea = 0;
|
|
58
|
+
let maxContourIndex = -1;
|
|
59
|
+
for (let i = 0; i < contours.size(); ++i) {
|
|
60
|
+
const contourArea = cv.contourArea(contours.get(i));
|
|
61
|
+
if (contourArea > maxArea) {
|
|
62
|
+
maxArea = contourArea;
|
|
63
|
+
maxContourIndex = i;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const maxContour = maxContourIndex >= 0 ? contours.get(maxContourIndex) : null;
|
|
67
|
+
imgGray.delete();
|
|
68
|
+
imgBlur.delete();
|
|
69
|
+
imgThresh.delete();
|
|
70
|
+
contours.delete();
|
|
71
|
+
hierarchy.delete();
|
|
72
|
+
return maxContour;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Highlights the paper detected inside the image.
|
|
76
|
+
* @param image image to process
|
|
77
|
+
* @param options options for highlighting. Accepts `color` and `thickness` parameter
|
|
78
|
+
* @returns Canvas with original image and paper highlighted
|
|
79
|
+
*/
|
|
80
|
+
highlightPaper(image, options) {
|
|
81
|
+
options = options || {};
|
|
82
|
+
options.color = options.color || "orange";
|
|
83
|
+
options.thickness = options.thickness || 10;
|
|
84
|
+
const width = image.width || 800;
|
|
85
|
+
const height = image.height || 600;
|
|
86
|
+
const canvas = createCanvas(width, height);
|
|
87
|
+
const ctx = canvas.getContext("2d");
|
|
88
|
+
const img = cv.imread(image);
|
|
89
|
+
const maxContour = this.findPaperContour(img);
|
|
90
|
+
const canvasId = "outputCanvas";
|
|
91
|
+
canvas.id = canvasId;
|
|
92
|
+
cv.imshow(canvasId, img);
|
|
93
|
+
if (maxContour) {
|
|
94
|
+
const {
|
|
95
|
+
topLeftCorner,
|
|
96
|
+
topRightCorner,
|
|
97
|
+
bottomLeftCorner,
|
|
98
|
+
bottomRightCorner
|
|
99
|
+
} = this.getCornerPoints(img);
|
|
100
|
+
ctx.strokeStyle = options.color;
|
|
101
|
+
ctx.lineWidth = options.thickness;
|
|
102
|
+
ctx.beginPath();
|
|
103
|
+
ctx.moveTo(topLeftCorner.x, topLeftCorner.y);
|
|
104
|
+
ctx.lineTo(topRightCorner.x, topRightCorner.y);
|
|
105
|
+
ctx.lineTo(bottomRightCorner.x, bottomRightCorner.y);
|
|
106
|
+
ctx.lineTo(bottomLeftCorner.x, bottomLeftCorner.y);
|
|
107
|
+
ctx.closePath();
|
|
108
|
+
ctx.stroke();
|
|
109
|
+
}
|
|
110
|
+
img.delete();
|
|
111
|
+
return canvas;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Gets the corner points of a contour
|
|
115
|
+
* @param contour contour to find corners
|
|
116
|
+
* @param originalImage original image (for size reference)
|
|
117
|
+
* @returns object with corner points
|
|
118
|
+
*/
|
|
119
|
+
getCornerPoints(originalImage) {
|
|
120
|
+
return {
|
|
121
|
+
topLeftCorner: { x: 0, y: 0 },
|
|
122
|
+
topRightCorner: { x: originalImage.cols, y: 0 },
|
|
123
|
+
bottomLeftCorner: { x: 0, y: originalImage.rows },
|
|
124
|
+
bottomRightCorner: { x: originalImage.cols, y: originalImage.rows }
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Performs perspective transform to get a top-down view of the detected document
|
|
129
|
+
* @param image image containing document
|
|
130
|
+
* @returns Canvas with the document in a top-down perspective
|
|
131
|
+
*/
|
|
132
|
+
getPerspective(image) {
|
|
133
|
+
const width = image.width || 800;
|
|
134
|
+
const height = image.height || 600;
|
|
135
|
+
const canvas = createCanvas(width, height);
|
|
136
|
+
const img = cv.imread(image);
|
|
137
|
+
const maxContour = this.findPaperContour(img);
|
|
138
|
+
if (maxContour) {
|
|
139
|
+
const {
|
|
140
|
+
topLeftCorner,
|
|
141
|
+
topRightCorner,
|
|
142
|
+
bottomLeftCorner,
|
|
143
|
+
bottomRightCorner
|
|
144
|
+
} = this.getCornerPoints(img);
|
|
145
|
+
const width2 = Math.max(
|
|
146
|
+
distance(topLeftCorner, topRightCorner),
|
|
147
|
+
distance(bottomLeftCorner, bottomRightCorner)
|
|
148
|
+
);
|
|
149
|
+
const height2 = Math.max(
|
|
150
|
+
distance(topLeftCorner, bottomLeftCorner),
|
|
151
|
+
distance(topRightCorner, bottomRightCorner)
|
|
152
|
+
);
|
|
153
|
+
const srcPoints = cv.matFromArray(4, 1, cv.CV_32FC2, [
|
|
154
|
+
topLeftCorner.x,
|
|
155
|
+
topLeftCorner.y,
|
|
156
|
+
topRightCorner.x,
|
|
157
|
+
topRightCorner.y,
|
|
158
|
+
bottomLeftCorner.x,
|
|
159
|
+
bottomLeftCorner.y,
|
|
160
|
+
bottomRightCorner.x,
|
|
161
|
+
bottomRightCorner.y
|
|
162
|
+
]);
|
|
163
|
+
const dstPoints = cv.matFromArray(4, 1, cv.CV_32FC2, [
|
|
164
|
+
0,
|
|
165
|
+
0,
|
|
166
|
+
width2,
|
|
167
|
+
0,
|
|
168
|
+
0,
|
|
169
|
+
height2,
|
|
170
|
+
width2,
|
|
171
|
+
height2
|
|
172
|
+
]);
|
|
173
|
+
const M = cv.getPerspectiveTransform(srcPoints, dstPoints);
|
|
174
|
+
srcPoints.delete();
|
|
175
|
+
dstPoints.delete();
|
|
176
|
+
const dst = new cv.Mat();
|
|
177
|
+
cv.warpPerspective(img, dst, M, new cv.Size(width2, height2));
|
|
178
|
+
const canvasId = "outputCanvas";
|
|
179
|
+
canvas.id = canvasId;
|
|
180
|
+
cv.imshow(canvasId, dst);
|
|
181
|
+
dst.delete();
|
|
182
|
+
M.delete();
|
|
183
|
+
} else {
|
|
184
|
+
const canvasId = "outputCanvas";
|
|
185
|
+
canvas.id = canvasId;
|
|
186
|
+
cv.imshow(canvasId, img);
|
|
187
|
+
}
|
|
188
|
+
img.delete();
|
|
189
|
+
return canvas;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var tscanify_default = TScanify;
|
|
193
|
+
export {
|
|
194
|
+
TScanify,
|
|
195
|
+
tscanify_default as default
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=tscanify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/custom/tscanify/tscanify.ts"],"sourcesContent":["/*! tscanify v1.0.0 | Based on jscanify v1.4.0 | (c) ColonelParrot and other contributors | MIT License */\r\n\r\nimport { Canvas, createCanvas, Image, ImageData } from \"canvas\";\r\nimport { JSDOM } from \"jsdom\";\r\nimport cv, { Mat } from \"opencv-ts\";\r\nimport { CornerPoints, HighlightOptions, Point } from \"./types\";\r\n\r\n// Custom type to handle the difference between Node's Canvas and HTMLCanvasElement\r\ntype CanvasResult = Canvas | HTMLCanvasElement;\r\n\r\n/**\r\n * Installs DOM elements required for canvas operations\r\n */\r\nfunction installDOM(): void {\r\n const dom = new JSDOM();\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (global as any).document = dom.window.document;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (global as any).Image = Image;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (global as any).HTMLCanvasElement = Canvas;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (global as any).ImageData = ImageData;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (global as any).HTMLImageElement = Image;\r\n}\r\n\r\n/**\r\n * Calculates distance between two points.\r\n * @param p1 point 1\r\n * @param p2 point 2\r\n * @returns distance between two points\r\n */\r\nfunction distance(p1: Point, p2: Point): number {\r\n return Math.hypot(p1.x - p2.x, p1.y - p2.y);\r\n}\r\n\r\nexport class TScanify {\r\n constructor() {\r\n installDOM();\r\n }\r\n\r\n /**\r\n * Loads OpenCV module\r\n * @param callback Function to call when OpenCV is initialized\r\n */\r\n loadOpenCV(callback: (opencv: typeof cv) => void): void {\r\n // opencv-ts uses onRuntimeInitialized\r\n cv.onRuntimeInitialized = () => {\r\n callback(cv);\r\n };\r\n }\r\n\r\n /**\r\n * Finds the contour of the paper within the image\r\n * @param img image to process (Mat)\r\n * @returns the biggest contour inside the image\r\n */\r\n findPaperContour(img: Mat) {\r\n const imgGray = new cv.Mat();\r\n cv.Canny(img, imgGray, 50, 200);\r\n\r\n const imgBlur = new cv.Mat();\r\n cv.GaussianBlur(\r\n imgGray,\r\n imgBlur,\r\n new cv.Size(3, 3),\r\n 0,\r\n 0,\r\n cv.BORDER_DEFAULT\r\n );\r\n\r\n const imgThresh = new cv.Mat();\r\n cv.threshold(imgBlur, imgThresh, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU);\r\n\r\n const contours = new cv.MatVector();\r\n const hierarchy = new cv.Mat();\r\n\r\n cv.findContours(\r\n imgThresh,\r\n contours,\r\n hierarchy,\r\n cv.RETR_CCOMP,\r\n cv.CHAIN_APPROX_SIMPLE\r\n );\r\n\r\n let maxArea = 0;\r\n let maxContourIndex = -1;\r\n for (let i = 0; i < contours.size(); ++i) {\r\n const contourArea = cv.contourArea(contours.get(i));\r\n if (contourArea > maxArea) {\r\n maxArea = contourArea;\r\n maxContourIndex = i;\r\n }\r\n }\r\n\r\n const maxContour =\r\n maxContourIndex >= 0 ? contours.get(maxContourIndex) : null;\r\n\r\n imgGray.delete();\r\n imgBlur.delete();\r\n imgThresh.delete();\r\n contours.delete();\r\n hierarchy.delete();\r\n return maxContour;\r\n }\r\n\r\n /**\r\n * Highlights the paper detected inside the image.\r\n * @param image image to process\r\n * @param options options for highlighting. Accepts `color` and `thickness` parameter\r\n * @returns Canvas with original image and paper highlighted\r\n */\r\n highlightPaper(\r\n image: HTMLImageElement,\r\n options?: HighlightOptions\r\n ): CanvasResult {\r\n options = options || {};\r\n options.color = options.color || \"orange\";\r\n options.thickness = options.thickness || 10;\r\n\r\n // Get image dimensions (assuming image has width and height properties)\r\n const width = image.width || 800;\r\n const height = image.height || 600;\r\n\r\n const canvas = createCanvas(width, height);\r\n const ctx = canvas.getContext(\"2d\");\r\n const img = cv.imread(image);\r\n\r\n const maxContour = this.findPaperContour(img);\r\n // Convert the canvas to an HTML canvas id string for opencv-ts\r\n const canvasId = \"outputCanvas\";\r\n (canvas as unknown as HTMLCanvasElement).id = canvasId;\r\n\r\n // Use the canvas id instead of the canvas object\r\n cv.imshow(canvasId, img);\r\n if (maxContour) {\r\n const {\r\n topLeftCorner,\r\n topRightCorner,\r\n bottomLeftCorner,\r\n bottomRightCorner,\r\n } = this.getCornerPoints(img);\r\n\r\n ctx.strokeStyle = options.color!;\r\n ctx.lineWidth = options.thickness!;\r\n ctx.beginPath();\r\n ctx.moveTo(topLeftCorner.x, topLeftCorner.y);\r\n ctx.lineTo(topRightCorner.x, topRightCorner.y);\r\n ctx.lineTo(bottomRightCorner.x, bottomRightCorner.y);\r\n ctx.lineTo(bottomLeftCorner.x, bottomLeftCorner.y);\r\n ctx.closePath();\r\n ctx.stroke();\r\n }\r\n\r\n img.delete();\r\n return canvas;\r\n }\r\n\r\n /**\r\n * Gets the corner points of a contour\r\n * @param contour contour to find corners\r\n * @param originalImage original image (for size reference)\r\n * @returns object with corner points\r\n */\r\n getCornerPoints(originalImage: Mat): CornerPoints {\r\n // Implementation will depend on actual CV.js structure\r\n // This is a placeholder that would need to be updated\r\n return {\r\n topLeftCorner: { x: 0, y: 0 },\r\n topRightCorner: { x: originalImage.cols, y: 0 },\r\n bottomLeftCorner: { x: 0, y: originalImage.rows },\r\n bottomRightCorner: { x: originalImage.cols, y: originalImage.rows },\r\n };\r\n }\r\n\r\n /**\r\n * Performs perspective transform to get a top-down view of the detected document\r\n * @param image image containing document\r\n * @returns Canvas with the document in a top-down perspective\r\n */\r\n getPerspective(image: HTMLImageElement): CanvasResult {\r\n // Get image dimensions (assuming image has width and height properties)\r\n const width = image.width || 800;\r\n const height = image.height || 600;\r\n\r\n const canvas = createCanvas(width, height);\r\n const img = cv.imread(image);\r\n\r\n const maxContour = this.findPaperContour(img);\r\n if (maxContour) {\r\n const {\r\n topLeftCorner,\r\n topRightCorner,\r\n bottomLeftCorner,\r\n bottomRightCorner,\r\n } = this.getCornerPoints(img);\r\n\r\n // Calculate width and height for the transformed image\r\n const width = Math.max(\r\n distance(topLeftCorner, topRightCorner),\r\n distance(bottomLeftCorner, bottomRightCorner)\r\n );\r\n const height = Math.max(\r\n distance(topLeftCorner, bottomLeftCorner),\r\n distance(topRightCorner, bottomRightCorner)\r\n );\r\n\r\n // Create source points matrix for perspective transform\r\n const srcPoints = cv.matFromArray(4, 1, cv.CV_32FC2, [\r\n topLeftCorner.x,\r\n topLeftCorner.y,\r\n topRightCorner.x,\r\n topRightCorner.y,\r\n bottomLeftCorner.x,\r\n bottomLeftCorner.y,\r\n bottomRightCorner.x,\r\n bottomRightCorner.y,\r\n ]);\r\n\r\n // Create destination points matrix for perspective transform\r\n const dstPoints = cv.matFromArray(4, 1, cv.CV_32FC2, [\r\n 0,\r\n 0,\r\n width,\r\n 0,\r\n 0,\r\n height,\r\n width,\r\n height,\r\n ]);\r\n\r\n // Perform perspective transform\r\n const M = cv.getPerspectiveTransform(srcPoints, dstPoints);\r\n\r\n // Clean up the temporary matrices when done\r\n srcPoints.delete();\r\n dstPoints.delete();\r\n const dst = new cv.Mat();\r\n\r\n cv.warpPerspective(img, dst, M, new cv.Size(width, height));\r\n // Use the canvas id instead of the canvas object\r\n const canvasId = \"outputCanvas\";\r\n (canvas as unknown as HTMLCanvasElement).id = canvasId;\r\n cv.imshow(canvasId, dst);\r\n\r\n dst.delete();\r\n M.delete();\r\n } else {\r\n // Use the canvas id instead of the canvas object\r\n const canvasId = \"outputCanvas\";\r\n (canvas as unknown as HTMLCanvasElement).id = canvasId;\r\n cv.imshow(canvasId, img);\r\n }\r\n\r\n img.delete();\r\n return canvas;\r\n }\r\n}\r\n\r\nexport default TScanify;\r\n"],"mappings":"AAAA;AAEA,SAAS,QAAQ,cAAc,OAAO,iBAAiB;AACvD,SAAS,aAAa;AACtB,OAAO,QAAiB;AASxB,SAAS,aAAmB;AAC1B,QAAM,MAAM,IAAI,MAAM;AAGtB,EAAC,OAAe,WAAW,IAAI,OAAO;AAEtC,EAAC,OAAe,QAAQ;AAExB,EAAC,OAAe,oBAAoB;AAEpC,EAAC,OAAe,YAAY;AAE5B,EAAC,OAAe,mBAAmB;AACrC;AAQA,SAAS,SAAS,IAAW,IAAmB;AAC9C,SAAO,KAAK,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,CAA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U,GAAG;AAAA,IACzB;AAEA,QAAI,OAAO;AACX,WAAO;AAAA,EACT;AACF;AAEA,IAAO,mBAAQ;","names":["width","height"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|