@ngstarter-ui/components 22.3.6 → 22.4.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/README.md +27 -0
- package/ai/component-registry.json +186 -101
- package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
- package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
- package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
- package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
- package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
- package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
- package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
- package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
- package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
- package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
- package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components.mjs +3 -5
- package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
- package/package.json +11 -10
- package/styles/_tokens.scss +1 -0
- package/types/ngstarter-ui-components-action-required.d.ts +34 -14
- package/types/ngstarter-ui-components-alert.d.ts +53 -44
- package/types/ngstarter-ui-components-announcement.d.ts +74 -53
- package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
- package/types/ngstarter-ui-components-avatar.d.ts +113 -66
- package/types/ngstarter-ui-components-badge.d.ts +73 -37
- package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
- package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
- package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
- package/types/ngstarter-ui-components-button.d.ts +69 -27
- package/types/ngstarter-ui-components-calendar.d.ts +123 -71
- package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
- package/types/ngstarter-ui-components-card.d.ts +75 -71
- package/types/ngstarter-ui-components-carousel.d.ts +115 -69
- package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
- package/types/ngstarter-ui-components-chips.d.ts +288 -195
- package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
- package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
- package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
- package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
- package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
- package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
- package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
- package/types/ngstarter-ui-components-confirm.d.ts +24 -29
- package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
- package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
- package/types/ngstarter-ui-components-core.d.ts +513 -467
- package/types/ngstarter-ui-components-country-select.d.ts +170 -97
- package/types/ngstarter-ui-components-crop.d.ts +67 -52
- package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
- package/types/ngstarter-ui-components-data-view.d.ts +811 -567
- package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
- package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
- package/types/ngstarter-ui-components-dialog.d.ts +138 -116
- package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
- package/types/ngstarter-ui-components-divider.d.ts +29 -17
- package/types/ngstarter-ui-components-drawer.d.ts +39 -30
- package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
- package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
- package/types/ngstarter-ui-components-events.d.ts +73 -57
- package/types/ngstarter-ui-components-expand.d.ts +55 -25
- package/types/ngstarter-ui-components-expansion.d.ts +93 -64
- package/types/ngstarter-ui-components-file-type.d.ts +53 -27
- package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
- package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
- package/types/ngstarter-ui-components-form-field.d.ts +116 -105
- package/types/ngstarter-ui-components-gauge.d.ts +32 -20
- package/types/ngstarter-ui-components-grid.d.ts +66 -50
- package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
- package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
- package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
- package/types/ngstarter-ui-components-icon.d.ts +39 -38
- package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
- package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
- package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
- package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
- package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
- package/types/ngstarter-ui-components-incidents.d.ts +97 -104
- package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
- package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
- package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
- package/types/ngstarter-ui-components-input.d.ts +82 -54
- package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
- package/types/ngstarter-ui-components-kbd.d.ts +8 -12
- package/types/ngstarter-ui-components-layout.d.ts +131 -87
- package/types/ngstarter-ui-components-list.d.ts +123 -88
- package/types/ngstarter-ui-components-logo.d.ts +21 -21
- package/types/ngstarter-ui-components-marquee.d.ts +41 -34
- package/types/ngstarter-ui-components-menu.d.ts +329 -221
- package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
- package/types/ngstarter-ui-components-navigation.d.ts +186 -125
- package/types/ngstarter-ui-components-notifications.d.ts +104 -89
- package/types/ngstarter-ui-components-number-input.d.ts +138 -96
- package/types/ngstarter-ui-components-option.d.ts +102 -68
- package/types/ngstarter-ui-components-overlay.d.ts +7 -12
- package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
- package/types/ngstarter-ui-components-paginator.d.ts +171 -129
- package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
- package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
- package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
- package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
- package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
- package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
- package/types/ngstarter-ui-components-popover.d.ts +128 -89
- package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
- package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
- package/types/ngstarter-ui-components-radio.d.ts +100 -47
- package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
- package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
- package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
- package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
- package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
- package/types/ngstarter-ui-components-segmented.d.ts +93 -61
- package/types/ngstarter-ui-components-select.d.ts +366 -266
- package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
- package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
- package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
- package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
- package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
- package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
- package/types/ngstarter-ui-components-slider.d.ts +123 -82
- package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
- package/types/ngstarter-ui-components-sort.d.ts +99 -63
- package/types/ngstarter-ui-components-spinner.d.ts +49 -27
- package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
- package/types/ngstarter-ui-components-split.d.ts +276 -195
- package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
- package/types/ngstarter-ui-components-stepper.d.ts +57 -43
- package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
- package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
- package/types/ngstarter-ui-components-table.d.ts +256 -228
- package/types/ngstarter-ui-components-tabs.d.ts +231 -138
- package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
- package/types/ngstarter-ui-components-tiles.d.ts +166 -104
- package/types/ngstarter-ui-components-timeline.d.ts +45 -57
- package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
- package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
- package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
- package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
- package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
- package/types/ngstarter-ui-components-tree.d.ts +355 -229
- package/types/ngstarter-ui-components-upload.d.ts +216 -131
- package/types/ngstarter-ui-components-video-player.d.ts +130 -67
- package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
- package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
- package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
- package/types/ngstarter-ui-components.d.ts +2 -2
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
|
@@ -1,649 +1,1098 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, PLATFORM_ID, Renderer2, RendererStyleFlags2, afterNextRender, computed, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { Icon } from "@ngstarter-ui/components/icon";
|
|
4
|
+
import { Button } from "@ngstarter-ui/components/button";
|
|
5
|
+
import { DOCUMENT as DOCUMENT$1, isPlatformBrowser } from "@angular/common";
|
|
6
|
+
import { Subject, fromEvent, merge } from "rxjs";
|
|
7
|
+
import { filter as filter$1, map as map$1, switchMap as switchMap$1, takeUntil as takeUntil$1, tap as tap$1 } from "rxjs/operators";
|
|
8
|
+
import { Menu, MenuItem, MenuTrigger } from "@ngstarter-ui/components/menu";
|
|
9
|
+
import { ColorSwitcher } from "@ngstarter-ui/components/color-switcher";
|
|
11
10
|
function ease(x) {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
class LazyPoint {
|
|
15
|
-
x;
|
|
16
|
-
y;
|
|
17
|
-
constructor(x, y) {
|
|
18
|
-
this.x = x;
|
|
19
|
-
this.y = y;
|
|
20
|
-
}
|
|
21
|
-
update(point) {
|
|
22
|
-
this.x = point.x;
|
|
23
|
-
this.y = point.y;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
moveByAngle(angle, distance, friction) {
|
|
27
|
-
const angleRotated = angle + Math.PI / 2;
|
|
28
|
-
if (friction) {
|
|
29
|
-
this.x = this.x + Math.sin(angleRotated) * distance * ease(1 - friction);
|
|
30
|
-
this.y = this.y - Math.cos(angleRotated) * distance * ease(1 - friction);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.x = this.x + Math.sin(angleRotated) * distance;
|
|
34
|
-
this.y = this.y - Math.cos(angleRotated) * distance;
|
|
35
|
-
}
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
equalsTo(point) {
|
|
39
|
-
return this.x === point.x && this.y === point.y;
|
|
40
|
-
}
|
|
41
|
-
getDifferenceTo(point) {
|
|
42
|
-
return new LazyPoint(this.x - point.x, this.y - point.y);
|
|
43
|
-
}
|
|
44
|
-
getDistanceTo(point) {
|
|
45
|
-
const diff = this.getDifferenceTo(point);
|
|
46
|
-
return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));
|
|
47
|
-
}
|
|
48
|
-
getAngleTo(point) {
|
|
49
|
-
const diff = this.getDifferenceTo(point);
|
|
50
|
-
return Math.atan2(diff.y, diff.x);
|
|
51
|
-
}
|
|
52
|
-
toObject() {
|
|
53
|
-
return {
|
|
54
|
-
x: this.x,
|
|
55
|
-
y: this.y
|
|
56
|
-
};
|
|
57
|
-
}
|
|
11
|
+
return 1 - Math.sqrt(1 - Math.pow(x, 2));
|
|
58
12
|
}
|
|
59
|
-
|
|
13
|
+
var LazyPoint = class LazyPoint {
|
|
14
|
+
x;
|
|
15
|
+
y;
|
|
16
|
+
constructor(x, y) {
|
|
17
|
+
this.x = x;
|
|
18
|
+
this.y = y;
|
|
19
|
+
}
|
|
20
|
+
update(point) {
|
|
21
|
+
this.x = point.x;
|
|
22
|
+
this.y = point.y;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
moveByAngle(angle, distance, friction) {
|
|
26
|
+
const angleRotated = angle + Math.PI / 2;
|
|
27
|
+
if (friction) {
|
|
28
|
+
this.x = this.x + Math.sin(angleRotated) * distance * ease(1 - friction);
|
|
29
|
+
this.y = this.y - Math.cos(angleRotated) * distance * ease(1 - friction);
|
|
30
|
+
} else {
|
|
31
|
+
this.x = this.x + Math.sin(angleRotated) * distance;
|
|
32
|
+
this.y = this.y - Math.cos(angleRotated) * distance;
|
|
33
|
+
}
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
equalsTo(point) {
|
|
37
|
+
return this.x === point.x && this.y === point.y;
|
|
38
|
+
}
|
|
39
|
+
getDifferenceTo(point) {
|
|
40
|
+
return new LazyPoint(this.x - point.x, this.y - point.y);
|
|
41
|
+
}
|
|
42
|
+
getDistanceTo(point) {
|
|
43
|
+
const diff = this.getDifferenceTo(point);
|
|
44
|
+
return Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.y, 2));
|
|
45
|
+
}
|
|
46
|
+
getAngleTo(point) {
|
|
47
|
+
const diff = this.getDifferenceTo(point);
|
|
48
|
+
return Math.atan2(diff.y, diff.x);
|
|
49
|
+
}
|
|
50
|
+
toObject() {
|
|
51
|
+
return {
|
|
52
|
+
x: this.x,
|
|
53
|
+
y: this.y
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
60
57
|
const RADIUS_DEFAULT = 30;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
58
|
+
var LazyBrush = class {
|
|
59
|
+
_isEnabled;
|
|
60
|
+
_hasMoved;
|
|
61
|
+
radius;
|
|
62
|
+
pointer;
|
|
63
|
+
brush;
|
|
64
|
+
angle;
|
|
65
|
+
distance;
|
|
66
|
+
friction;
|
|
67
|
+
constructor(options = {}) {
|
|
68
|
+
const initialPoint = options.initialPoint || {
|
|
69
|
+
x: 0,
|
|
70
|
+
y: 0
|
|
71
|
+
};
|
|
72
|
+
this.radius = options.radius || RADIUS_DEFAULT;
|
|
73
|
+
this._isEnabled = options.enabled === false ? false : true;
|
|
74
|
+
this.friction = options.friction || 0;
|
|
75
|
+
this.pointer = new LazyPoint(initialPoint.x, initialPoint.y);
|
|
76
|
+
this.brush = new LazyPoint(initialPoint.x, initialPoint.y);
|
|
77
|
+
this.angle = 0;
|
|
78
|
+
this.distance = 0;
|
|
79
|
+
this._hasMoved = false;
|
|
80
|
+
}
|
|
81
|
+
enable() {
|
|
82
|
+
this._isEnabled = true;
|
|
83
|
+
}
|
|
84
|
+
disable() {
|
|
85
|
+
this._isEnabled = false;
|
|
86
|
+
}
|
|
87
|
+
isEnabled() {
|
|
88
|
+
return this._isEnabled;
|
|
89
|
+
}
|
|
90
|
+
setRadius(radius) {
|
|
91
|
+
this.radius = radius;
|
|
92
|
+
}
|
|
93
|
+
getRadius() {
|
|
94
|
+
return this.radius;
|
|
95
|
+
}
|
|
96
|
+
setFriction(friction) {
|
|
97
|
+
this.friction = Math.max(0, Math.min(1, friction));
|
|
98
|
+
}
|
|
99
|
+
getFriction() {
|
|
100
|
+
return this.friction;
|
|
101
|
+
}
|
|
102
|
+
getBrushCoordinates() {
|
|
103
|
+
return this.brush.toObject();
|
|
104
|
+
}
|
|
105
|
+
getPointerCoordinates() {
|
|
106
|
+
return this.pointer.toObject();
|
|
107
|
+
}
|
|
108
|
+
getBrush() {
|
|
109
|
+
return this.brush;
|
|
110
|
+
}
|
|
111
|
+
getPointer() {
|
|
112
|
+
return this.pointer;
|
|
113
|
+
}
|
|
114
|
+
getAngle() {
|
|
115
|
+
return this.angle;
|
|
116
|
+
}
|
|
117
|
+
getDistance() {
|
|
118
|
+
return this.distance;
|
|
119
|
+
}
|
|
120
|
+
brushHasMoved() {
|
|
121
|
+
return this._hasMoved;
|
|
122
|
+
}
|
|
123
|
+
update(newPointerPoint, options = {}) {
|
|
124
|
+
this._hasMoved = false;
|
|
125
|
+
const currentFriction = options.friction !== void 0 ? options.friction : this.friction;
|
|
126
|
+
if (this.pointer.equalsTo(newPointerPoint) && !options.both && currentFriction === this.friction) return false;
|
|
127
|
+
this.pointer.update(newPointerPoint);
|
|
128
|
+
if (options.both) {
|
|
129
|
+
this._hasMoved = true;
|
|
130
|
+
this.brush.update(newPointerPoint);
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (this._isEnabled) {
|
|
134
|
+
this.distance = this.pointer.getDistanceTo(this.brush);
|
|
135
|
+
this.angle = this.pointer.getAngleTo(this.brush);
|
|
136
|
+
if (this.distance > this.radius) {
|
|
137
|
+
this.brush.moveByAngle(this.angle, this.distance - this.radius, currentFriction);
|
|
138
|
+
this._hasMoved = true;
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
this.distance = 0;
|
|
142
|
+
this.angle = 0;
|
|
143
|
+
this.brush.update(newPointerPoint);
|
|
144
|
+
this._hasMoved = true;
|
|
145
|
+
}
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var SignaturePad = class SignaturePad {
|
|
150
|
+
fixedCanvasHeight = 250;
|
|
151
|
+
penColor = model("#000", ...ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []);
|
|
152
|
+
lineWidth = input(4, ...ngDevMode ? [{ debugName: "lineWidth" }] : /* istanbul ignore next */ []);
|
|
153
|
+
backgroundColor = input("transparent", ...ngDevMode ? [{ debugName: "backgroundColor" }] : /* istanbul ignore next */ []);
|
|
154
|
+
lazyRadius = input(3, ...ngDevMode ? [{ debugName: "lazyRadius" }] : /* istanbul ignore next */ []);
|
|
155
|
+
lazyFriction = input(.1, ...ngDevMode ? [{ debugName: "lazyFriction" }] : /* istanbul ignore next */ []);
|
|
156
|
+
lazyEnabled = input(true, ...ngDevMode ? [{ debugName: "lazyEnabled" }] : /* istanbul ignore next */ []);
|
|
157
|
+
colors = input([
|
|
158
|
+
"#000",
|
|
159
|
+
"#0059ff",
|
|
160
|
+
"#ff0000"
|
|
161
|
+
], ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
162
|
+
signatureSaved = output();
|
|
163
|
+
signatureCleared = output();
|
|
164
|
+
mainCanvasRef = viewChild.required("signatureCanvas", ...ngDevMode ? [{ debugName: "mainCanvasRef" }] : /* istanbul ignore next */ []);
|
|
165
|
+
canvasWidth = signal(400, ...ngDevMode ? [{ debugName: "canvasWidth" }] : /* istanbul ignore next */ []);
|
|
166
|
+
canvasHeight = signal(this.fixedCanvasHeight, ...ngDevMode ? [{ debugName: "canvasHeight" }] : /* istanbul ignore next */ []);
|
|
167
|
+
mainContext = signal(null, ...ngDevMode ? [{ debugName: "mainContext" }] : /* istanbul ignore next */ []);
|
|
168
|
+
memoryCanvasElement = null;
|
|
169
|
+
memoryContext = signal(null, ...ngDevMode ? [{ debugName: "memoryContext" }] : /* istanbul ignore next */ []);
|
|
170
|
+
lazyBrushInstance;
|
|
171
|
+
isDrawing = signal(false, ...ngDevMode ? [{ debugName: "isDrawing" }] : /* istanbul ignore next */ []);
|
|
172
|
+
currentStrokePoints = signal([], ...ngDevMode ? [{ debugName: "currentStrokePoints" }] : /* istanbul ignore next */ []);
|
|
173
|
+
resizeObserver;
|
|
174
|
+
platformId = inject(PLATFORM_ID);
|
|
175
|
+
document = inject(DOCUMENT);
|
|
176
|
+
subscriptions = [];
|
|
177
|
+
pointerDown$ = new Subject();
|
|
178
|
+
constructor() {
|
|
179
|
+
if (isPlatformBrowser(this.platformId)) afterNextRender(() => {
|
|
180
|
+
this.initializeLazyBrush();
|
|
181
|
+
this.initializeCanvasesAndContexts();
|
|
182
|
+
this.setupResizeObserver();
|
|
183
|
+
this.setupPointerEvents();
|
|
184
|
+
});
|
|
185
|
+
effect(() => {
|
|
186
|
+
const currentWidth = this.canvasWidth();
|
|
187
|
+
const currentHeight = this.canvasHeight();
|
|
188
|
+
this.backgroundColor();
|
|
189
|
+
if (this.mainContext() && this.memoryContext() && this.mainCanvasRef() && this.memoryCanvasElement && this.lazyBrushInstance) {
|
|
190
|
+
const mainCanvasEl = this.mainCanvasRef().nativeElement;
|
|
191
|
+
mainCanvasEl.width = currentWidth;
|
|
192
|
+
mainCanvasEl.height = currentHeight;
|
|
193
|
+
this.memoryCanvasElement.width = currentWidth;
|
|
194
|
+
this.memoryCanvasElement.height = currentHeight;
|
|
195
|
+
this.configureContextStyling(this.mainContext());
|
|
196
|
+
this.configureContextStyling(this.memoryContext());
|
|
197
|
+
this.mainContext().fillStyle = this.backgroundColor();
|
|
198
|
+
this.mainContext().fillRect(0, 0, currentWidth, currentHeight);
|
|
199
|
+
this.memoryContext().clearRect(0, 0, currentWidth, currentHeight);
|
|
200
|
+
this.currentStrokePoints.set([]);
|
|
201
|
+
this.lazyBrushInstance.pointer.update({
|
|
202
|
+
x: 0,
|
|
203
|
+
y: 0
|
|
204
|
+
});
|
|
205
|
+
this.lazyBrushInstance.brush.update({
|
|
206
|
+
x: 0,
|
|
207
|
+
y: 0
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
effect(() => {
|
|
212
|
+
this.penColor();
|
|
213
|
+
this.lineWidth();
|
|
214
|
+
if (this.mainContext()) {
|
|
215
|
+
this.mainContext().strokeStyle = this.penColor();
|
|
216
|
+
this.mainContext().lineWidth = this.lineWidth();
|
|
217
|
+
this.mainContext().fillStyle = this.penColor();
|
|
218
|
+
}
|
|
219
|
+
if (this.memoryContext()) {
|
|
220
|
+
this.memoryContext().strokeStyle = this.penColor();
|
|
221
|
+
this.memoryContext().lineWidth = this.lineWidth();
|
|
222
|
+
this.memoryContext().fillStyle = this.penColor();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
effect(() => {
|
|
226
|
+
if (this.lazyBrushInstance) {
|
|
227
|
+
this.lazyBrushInstance.setRadius(this.lazyRadius());
|
|
228
|
+
this.lazyBrushInstance.setFriction(this.lazyFriction());
|
|
229
|
+
this.lazyEnabled() ? this.lazyBrushInstance.enable() : this.lazyBrushInstance.disable();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
ngOnDestroy() {
|
|
234
|
+
this.subscriptions.forEach((sub) => sub.unsubscribe());
|
|
235
|
+
if (this.resizeObserver && this.mainCanvasRef()) this.resizeObserver.unobserve(this.mainCanvasRef().nativeElement);
|
|
236
|
+
}
|
|
237
|
+
setupPointerEvents() {
|
|
238
|
+
const canvasEl = this.mainCanvasRef().nativeElement;
|
|
239
|
+
const pointerDownEvents$ = merge(fromEvent(canvasEl, "mousedown"), fromEvent(canvasEl, "touchstart").pipe(tap$1((event) => {
|
|
240
|
+
if (event.cancelable) event.preventDefault();
|
|
241
|
+
}))).pipe(filter$1(() => !!this.mainContext() && !!this.lazyBrushInstance), map$1((event) => this.getCoordinates(event)), filter$1((coords) => coords !== null));
|
|
242
|
+
const pointerMoveEvents$ = merge(fromEvent(this.document, "mousemove"), fromEvent(this.document, "touchmove").pipe(tap$1((event) => {
|
|
243
|
+
if (event.cancelable) event.preventDefault();
|
|
244
|
+
}))).pipe(map$1((event) => this.getCoordinates(event)), filter$1((coords) => coords !== null));
|
|
245
|
+
const pointerUpEvents$ = merge(fromEvent(this.document, "mouseup"), fromEvent(this.document, "touchend"), fromEvent(this.document, "touchcancel"));
|
|
246
|
+
const drawingStream$ = pointerDownEvents$.pipe(tap$1((coords) => this.handlePointerDownLogic(coords)), switchMap$1(() => pointerMoveEvents$.pipe(takeUntil$1(pointerUpEvents$.pipe(tap$1((event) => this.handlePointerUpLogic(event)))))));
|
|
247
|
+
this.subscriptions.push(drawingStream$.subscribe((coords) => {
|
|
248
|
+
this.handlePointerMoveLogic(coords);
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
setupResizeObserver() {
|
|
252
|
+
const canvasEl = this.mainCanvasRef().nativeElement;
|
|
253
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
254
|
+
for (const entry of entries) {
|
|
255
|
+
const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;
|
|
256
|
+
const newWidth = contentBoxSize ? contentBoxSize.inlineSize : entry.contentRect.width;
|
|
257
|
+
const newHeight = this.fixedCanvasHeight;
|
|
258
|
+
if (newWidth > 0 && newHeight > 0 && (this.canvasWidth() !== newWidth || this.canvasHeight() !== newHeight)) {
|
|
259
|
+
this.canvasWidth.set(newWidth);
|
|
260
|
+
this.canvasHeight.set(newHeight);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
this.resizeObserver.observe(canvasEl);
|
|
265
|
+
}
|
|
266
|
+
initializeLazyBrush() {
|
|
267
|
+
const options = {
|
|
268
|
+
radius: this.lazyRadius(),
|
|
269
|
+
enabled: this.lazyEnabled(),
|
|
270
|
+
initialPoint: {
|
|
271
|
+
x: 0,
|
|
272
|
+
y: 0
|
|
273
|
+
},
|
|
274
|
+
friction: this.lazyFriction()
|
|
275
|
+
};
|
|
276
|
+
this.lazyBrushInstance = new LazyBrush(options);
|
|
277
|
+
}
|
|
278
|
+
initializeCanvasesAndContexts() {
|
|
279
|
+
const mainCtx = this.mainCanvasRef().nativeElement.getContext("2d");
|
|
280
|
+
if (!mainCtx) {
|
|
281
|
+
console.error("Failed to get 2D context for main canvas");
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
this.mainContext.set(mainCtx);
|
|
285
|
+
this.memoryCanvasElement = document.createElement("canvas");
|
|
286
|
+
const memCtx = this.memoryCanvasElement.getContext("2d");
|
|
287
|
+
if (!memCtx) {
|
|
288
|
+
console.error("Failed to get 2D context for memory canvas");
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.memoryContext.set(memCtx);
|
|
292
|
+
}
|
|
293
|
+
configureContextStyling(ctx) {
|
|
294
|
+
ctx.strokeStyle = this.penColor();
|
|
295
|
+
ctx.lineWidth = this.lineWidth();
|
|
296
|
+
ctx.lineCap = "round";
|
|
297
|
+
ctx.lineJoin = "round";
|
|
298
|
+
ctx.fillStyle = this.penColor();
|
|
299
|
+
}
|
|
300
|
+
handlePointerDownLogic(coords) {
|
|
301
|
+
this.isDrawing.set(true);
|
|
302
|
+
this.lazyBrushInstance.update(coords, { both: true });
|
|
303
|
+
this.currentStrokePoints.set([this.lazyBrushInstance.getBrushCoordinates()]);
|
|
304
|
+
}
|
|
305
|
+
handlePointerMoveLogic(coords) {
|
|
306
|
+
const mainCtx = this.mainContext();
|
|
307
|
+
const memCanvas = this.memoryCanvasElement;
|
|
308
|
+
if (!mainCtx || !memCanvas || !this.lazyBrushInstance) return;
|
|
309
|
+
this.lazyBrushInstance.update(coords);
|
|
310
|
+
if (this.lazyBrushInstance.brushHasMoved()) {
|
|
311
|
+
this.currentStrokePoints.update((points) => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
|
|
312
|
+
mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
313
|
+
mainCtx.drawImage(memCanvas, 0, 0);
|
|
314
|
+
this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
handlePointerUpLogic(event) {
|
|
318
|
+
if (!this.isDrawing()) return;
|
|
319
|
+
const mainCtx = this.mainContext();
|
|
320
|
+
const memCtx = this.memoryContext();
|
|
321
|
+
const mainCanvasEl = this.mainCanvasRef().nativeElement;
|
|
322
|
+
if (!mainCtx || !memCtx || !this.memoryCanvasElement || !this.lazyBrushInstance) {
|
|
323
|
+
this.isDrawing.set(false);
|
|
324
|
+
this.currentStrokePoints.set([]);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const coords = event ? this.getCoordinates(event) : this.lazyBrushInstance.getPointerCoordinates();
|
|
328
|
+
if (coords) {
|
|
329
|
+
this.lazyBrushInstance.update(coords);
|
|
330
|
+
if (this.lazyBrushInstance.brushHasMoved()) this.currentStrokePoints.update((points) => [...points, this.lazyBrushInstance.getBrushCoordinates()]);
|
|
331
|
+
}
|
|
332
|
+
if (this.currentStrokePoints().length > 0) {
|
|
333
|
+
mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
334
|
+
mainCtx.drawImage(this.memoryCanvasElement, 0, 0);
|
|
335
|
+
this.drawSmoothStroke(mainCtx, this.currentStrokePoints());
|
|
336
|
+
}
|
|
337
|
+
memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
338
|
+
memCtx.drawImage(mainCanvasEl, 0, 0);
|
|
339
|
+
this.isDrawing.set(false);
|
|
340
|
+
this.currentStrokePoints.set([]);
|
|
341
|
+
this.save();
|
|
342
|
+
}
|
|
343
|
+
drawSmoothStroke(ctx, points) {
|
|
344
|
+
if (points.length === 0) return;
|
|
345
|
+
ctx.strokeStyle = this.penColor();
|
|
346
|
+
ctx.lineWidth = this.lineWidth();
|
|
347
|
+
ctx.fillStyle = this.penColor();
|
|
348
|
+
ctx.lineCap = "round";
|
|
349
|
+
ctx.lineJoin = "round";
|
|
350
|
+
if (points.length < 3) {
|
|
351
|
+
const p1 = points[0];
|
|
352
|
+
ctx.beginPath();
|
|
353
|
+
if (points.length === 1) {
|
|
354
|
+
const radius = this.lineWidth() / 2;
|
|
355
|
+
ctx.arc(p1.x, p1.y, Math.max(.5, radius), 0, Math.PI * 2, true);
|
|
356
|
+
ctx.fill();
|
|
357
|
+
} else {
|
|
358
|
+
const p2 = points[1];
|
|
359
|
+
ctx.moveTo(p1.x, p1.y);
|
|
360
|
+
ctx.lineTo(p2.x, p2.y);
|
|
361
|
+
ctx.stroke();
|
|
362
|
+
}
|
|
363
|
+
ctx.closePath();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
ctx.beginPath();
|
|
367
|
+
ctx.moveTo(points[0].x, points[0].y);
|
|
368
|
+
let i = 1;
|
|
369
|
+
for (; i < points.length - 2; i++) {
|
|
370
|
+
const c = (points[i].x + points[i + 1].x) / 2;
|
|
371
|
+
const d = (points[i].y + points[i + 1].y) / 2;
|
|
372
|
+
ctx.quadraticCurveTo(points[i].x, points[i].y, c, d);
|
|
373
|
+
}
|
|
374
|
+
ctx.quadraticCurveTo(points[i].x, points[i].y, points[i + 1].x, points[i + 1].y);
|
|
375
|
+
ctx.stroke();
|
|
376
|
+
ctx.closePath();
|
|
377
|
+
}
|
|
378
|
+
getCoordinates(event) {
|
|
379
|
+
const canvas = this.mainCanvasRef()?.nativeElement;
|
|
380
|
+
if (!canvas) return null;
|
|
381
|
+
const rect = canvas.getBoundingClientRect();
|
|
382
|
+
let clientX, clientY;
|
|
383
|
+
if (event instanceof MouseEvent) {
|
|
384
|
+
clientX = event.clientX;
|
|
385
|
+
clientY = event.clientY;
|
|
386
|
+
} else if (event instanceof TouchEvent) {
|
|
387
|
+
const touch = event.touches.length > 0 ? event.touches[0] : event.changedTouches.length > 0 ? event.changedTouches[0] : null;
|
|
388
|
+
if (touch) {
|
|
389
|
+
clientX = touch.clientX;
|
|
390
|
+
clientY = touch.clientY;
|
|
391
|
+
} else return null;
|
|
392
|
+
} else return null;
|
|
393
|
+
const scaleX = canvas.width / rect.width;
|
|
394
|
+
const scaleY = canvas.height / rect.height;
|
|
395
|
+
return {
|
|
396
|
+
x: (clientX - rect.left) * scaleX,
|
|
397
|
+
y: (clientY - rect.top) * scaleY
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
clear() {
|
|
401
|
+
const mainCtx = this.mainContext();
|
|
402
|
+
const memCtx = this.memoryContext();
|
|
403
|
+
if (mainCtx) {
|
|
404
|
+
mainCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
405
|
+
mainCtx.fillStyle = this.backgroundColor();
|
|
406
|
+
mainCtx.fillRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
407
|
+
}
|
|
408
|
+
if (memCtx) memCtx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
409
|
+
this.currentStrokePoints.set([]);
|
|
410
|
+
if (this.lazyBrushInstance) {
|
|
411
|
+
const currentPointer = this.lazyBrushInstance.getPointerCoordinates();
|
|
412
|
+
this.lazyBrushInstance.update(currentPointer, { both: true });
|
|
413
|
+
}
|
|
414
|
+
this.signatureCleared.emit();
|
|
415
|
+
}
|
|
416
|
+
save() {
|
|
417
|
+
const memCanvas = this.memoryCanvasElement;
|
|
418
|
+
if (!memCanvas) {
|
|
419
|
+
console.warn("Memory canvas not available for saving.");
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
if (this.isCanvasEffectivelyBlank(memCanvas)) {
|
|
423
|
+
console.warn("Canvas is effectively empty or contains only background. Nothing to save.");
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const dataUrl = memCanvas.toDataURL("image/png");
|
|
427
|
+
this.signatureSaved.emit(dataUrl);
|
|
428
|
+
}
|
|
429
|
+
onColorChange(color) {
|
|
430
|
+
this.penColor.set(color);
|
|
431
|
+
}
|
|
432
|
+
isCanvasEffectivelyBlank(canvas) {
|
|
433
|
+
if (!canvas) return true;
|
|
434
|
+
const tempCanvas = document.createElement("canvas");
|
|
435
|
+
tempCanvas.width = canvas.width;
|
|
436
|
+
tempCanvas.height = canvas.height;
|
|
437
|
+
const tempCtx = tempCanvas.getContext("2d");
|
|
438
|
+
if (!tempCtx) return true;
|
|
439
|
+
tempCtx.fillStyle = this.backgroundColor();
|
|
440
|
+
tempCtx.fillRect(0, 0, tempCanvas.width, tempCanvas.height);
|
|
441
|
+
return canvas.toDataURL() === tempCanvas.toDataURL();
|
|
442
|
+
}
|
|
443
|
+
handleEscapeKey(event) {
|
|
444
|
+
this.clear();
|
|
445
|
+
}
|
|
446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
447
|
+
minVersion: "12.0.0",
|
|
448
|
+
version: "22.3.0",
|
|
449
|
+
ngImport: i0,
|
|
450
|
+
type: SignaturePad,
|
|
451
|
+
deps: [],
|
|
452
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
453
|
+
});
|
|
454
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
455
|
+
minVersion: "17.2.0",
|
|
456
|
+
version: "22.3.0",
|
|
457
|
+
type: SignaturePad,
|
|
458
|
+
isStandalone: true,
|
|
459
|
+
selector: "ngs-signature-pad",
|
|
460
|
+
inputs: {
|
|
461
|
+
penColor: {
|
|
462
|
+
classPropertyName: "penColor",
|
|
463
|
+
publicName: "penColor",
|
|
464
|
+
isSignal: true,
|
|
465
|
+
isRequired: false,
|
|
466
|
+
transformFunction: null
|
|
467
|
+
},
|
|
468
|
+
lineWidth: {
|
|
469
|
+
classPropertyName: "lineWidth",
|
|
470
|
+
publicName: "lineWidth",
|
|
471
|
+
isSignal: true,
|
|
472
|
+
isRequired: false,
|
|
473
|
+
transformFunction: null
|
|
474
|
+
},
|
|
475
|
+
backgroundColor: {
|
|
476
|
+
classPropertyName: "backgroundColor",
|
|
477
|
+
publicName: "backgroundColor",
|
|
478
|
+
isSignal: true,
|
|
479
|
+
isRequired: false,
|
|
480
|
+
transformFunction: null
|
|
481
|
+
},
|
|
482
|
+
lazyRadius: {
|
|
483
|
+
classPropertyName: "lazyRadius",
|
|
484
|
+
publicName: "lazyRadius",
|
|
485
|
+
isSignal: true,
|
|
486
|
+
isRequired: false,
|
|
487
|
+
transformFunction: null
|
|
488
|
+
},
|
|
489
|
+
lazyFriction: {
|
|
490
|
+
classPropertyName: "lazyFriction",
|
|
491
|
+
publicName: "lazyFriction",
|
|
492
|
+
isSignal: true,
|
|
493
|
+
isRequired: false,
|
|
494
|
+
transformFunction: null
|
|
495
|
+
},
|
|
496
|
+
lazyEnabled: {
|
|
497
|
+
classPropertyName: "lazyEnabled",
|
|
498
|
+
publicName: "lazyEnabled",
|
|
499
|
+
isSignal: true,
|
|
500
|
+
isRequired: false,
|
|
501
|
+
transformFunction: null
|
|
502
|
+
},
|
|
503
|
+
colors: {
|
|
504
|
+
classPropertyName: "colors",
|
|
505
|
+
publicName: "colors",
|
|
506
|
+
isSignal: true,
|
|
507
|
+
isRequired: false,
|
|
508
|
+
transformFunction: null
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
outputs: {
|
|
512
|
+
penColor: "penColorChange",
|
|
513
|
+
signatureSaved: "signatureSaved",
|
|
514
|
+
signatureCleared: "signatureCleared"
|
|
515
|
+
},
|
|
516
|
+
host: {
|
|
517
|
+
listeners: { "document:keydown.escape": "handleEscapeKey($event)" },
|
|
518
|
+
classAttribute: "ngs-signature-pad"
|
|
519
|
+
},
|
|
520
|
+
viewQueries: [{
|
|
521
|
+
propertyName: "mainCanvasRef",
|
|
522
|
+
first: true,
|
|
523
|
+
predicate: ["signatureCanvas"],
|
|
524
|
+
descendants: true,
|
|
525
|
+
isSignal: true
|
|
526
|
+
}],
|
|
527
|
+
exportAs: ["ngsSignaturePad"],
|
|
528
|
+
ngImport: i0,
|
|
529
|
+
template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n",
|
|
530
|
+
styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
531
|
+
dependencies: [
|
|
532
|
+
{
|
|
533
|
+
kind: "component",
|
|
534
|
+
type: ColorSwitcher,
|
|
535
|
+
selector: "ngs-color-switcher",
|
|
536
|
+
inputs: [
|
|
537
|
+
"readonly",
|
|
538
|
+
"value",
|
|
539
|
+
"colors",
|
|
540
|
+
"selectedColor",
|
|
541
|
+
"disabled"
|
|
542
|
+
],
|
|
543
|
+
outputs: [
|
|
544
|
+
"touch",
|
|
545
|
+
"valueChange",
|
|
546
|
+
"colorChange"
|
|
547
|
+
],
|
|
548
|
+
exportAs: ["ngsColorSwitcher"]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
kind: "component",
|
|
552
|
+
type: Icon,
|
|
553
|
+
selector: "ngs-icon",
|
|
554
|
+
inputs: ["name"],
|
|
555
|
+
exportAs: ["ngsIcon"]
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
kind: "component",
|
|
559
|
+
type: Button,
|
|
560
|
+
selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
|
|
561
|
+
inputs: [
|
|
562
|
+
"ngsButton",
|
|
563
|
+
"ngsIconButton",
|
|
564
|
+
"loading",
|
|
565
|
+
"disabled",
|
|
566
|
+
"disabledInteractive",
|
|
567
|
+
"disableRipple",
|
|
568
|
+
"reverse",
|
|
569
|
+
"fullWidth",
|
|
570
|
+
"hideTextOnMobile"
|
|
571
|
+
],
|
|
572
|
+
exportAs: ["ngsButton"]
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
579
|
+
minVersion: "12.0.0",
|
|
580
|
+
version: "22.3.0",
|
|
581
|
+
ngImport: i0,
|
|
582
|
+
type: SignaturePad,
|
|
583
|
+
decorators: [{
|
|
584
|
+
type: Component,
|
|
585
|
+
args: [{
|
|
586
|
+
selector: "ngs-signature-pad",
|
|
587
|
+
exportAs: "ngsSignaturePad",
|
|
588
|
+
standalone: true,
|
|
589
|
+
imports: [
|
|
590
|
+
ColorSwitcher,
|
|
591
|
+
Icon,
|
|
592
|
+
Button
|
|
593
|
+
],
|
|
594
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
595
|
+
host: {
|
|
596
|
+
"class": "ngs-signature-pad",
|
|
597
|
+
"(document:keydown.escape)": "handleEscapeKey($event)"
|
|
598
|
+
},
|
|
599
|
+
template: "<canvas #signatureCanvas\n class=\"signature-canvas\"\n width=\"500\"\n height=\"250\">\n Your browser does not support the HTML canvas tag.\n</canvas>\n<div class=\"line\"></div>\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"/>\n<div class=\"clear-button\">\n <button type=\"button\" ngsIconButton (click)=\"clear()\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n</div>\n",
|
|
600
|
+
styles: [":host{display:block;position:relative;width:100%;max-width:100%;background:var(--ngs-color-surface-container-lowest)}:host canvas{display:block;width:100%;height:250px;z-index:1;position:relative}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .clear-button{position:absolute;top:var(--spacing, .25rem);left:var(--spacing, .25rem);z-index:2}:host .line{position:absolute;height:1px;z-index:0;background:var(--ngs-color-surface-container-highest);left:40px;right:40px;bottom:50px}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
601
|
+
}]
|
|
602
|
+
}],
|
|
603
|
+
ctorParameters: () => [],
|
|
604
|
+
propDecorators: {
|
|
605
|
+
penColor: [{
|
|
606
|
+
type: i0.Input,
|
|
607
|
+
args: [{
|
|
608
|
+
isSignal: true,
|
|
609
|
+
alias: "penColor",
|
|
610
|
+
required: false
|
|
611
|
+
}]
|
|
612
|
+
}, {
|
|
613
|
+
type: i0.Output,
|
|
614
|
+
args: ["penColorChange"]
|
|
615
|
+
}],
|
|
616
|
+
lineWidth: [{
|
|
617
|
+
type: i0.Input,
|
|
618
|
+
args: [{
|
|
619
|
+
isSignal: true,
|
|
620
|
+
alias: "lineWidth",
|
|
621
|
+
required: false
|
|
622
|
+
}]
|
|
623
|
+
}],
|
|
624
|
+
backgroundColor: [{
|
|
625
|
+
type: i0.Input,
|
|
626
|
+
args: [{
|
|
627
|
+
isSignal: true,
|
|
628
|
+
alias: "backgroundColor",
|
|
629
|
+
required: false
|
|
630
|
+
}]
|
|
631
|
+
}],
|
|
632
|
+
lazyRadius: [{
|
|
633
|
+
type: i0.Input,
|
|
634
|
+
args: [{
|
|
635
|
+
isSignal: true,
|
|
636
|
+
alias: "lazyRadius",
|
|
637
|
+
required: false
|
|
638
|
+
}]
|
|
639
|
+
}],
|
|
640
|
+
lazyFriction: [{
|
|
641
|
+
type: i0.Input,
|
|
642
|
+
args: [{
|
|
643
|
+
isSignal: true,
|
|
644
|
+
alias: "lazyFriction",
|
|
645
|
+
required: false
|
|
646
|
+
}]
|
|
647
|
+
}],
|
|
648
|
+
lazyEnabled: [{
|
|
649
|
+
type: i0.Input,
|
|
650
|
+
args: [{
|
|
651
|
+
isSignal: true,
|
|
652
|
+
alias: "lazyEnabled",
|
|
653
|
+
required: false
|
|
654
|
+
}]
|
|
655
|
+
}],
|
|
656
|
+
colors: [{
|
|
657
|
+
type: i0.Input,
|
|
658
|
+
args: [{
|
|
659
|
+
isSignal: true,
|
|
660
|
+
alias: "colors",
|
|
661
|
+
required: false
|
|
662
|
+
}]
|
|
663
|
+
}],
|
|
664
|
+
signatureSaved: [{
|
|
665
|
+
type: i0.Output,
|
|
666
|
+
args: ["signatureSaved"]
|
|
667
|
+
}],
|
|
668
|
+
signatureCleared: [{
|
|
669
|
+
type: i0.Output,
|
|
670
|
+
args: ["signatureCleared"]
|
|
671
|
+
}],
|
|
672
|
+
mainCanvasRef: [{
|
|
673
|
+
type: i0.ViewChild,
|
|
674
|
+
args: ["signatureCanvas", { isSignal: true }]
|
|
675
|
+
}]
|
|
676
|
+
}
|
|
677
|
+
});
|
|
463
678
|
const TYPED_SIGNATURE_DEFAULT_FONTS = [
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
679
|
+
{
|
|
680
|
+
label: "Signature",
|
|
681
|
+
family: "Brush Script MT, Segoe Script, cursive"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
label: "Handwritten",
|
|
685
|
+
family: "Snell Roundhand, Apple Chancery, cursive"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
label: "Script",
|
|
689
|
+
family: "Segoe Script, Lucida Handwriting, cursive"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
label: "Classic",
|
|
693
|
+
family: "Georgia, serif"
|
|
694
|
+
}
|
|
480
695
|
];
|
|
481
|
-
class TypedSignaturePad {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
696
|
+
var TypedSignaturePad = class TypedSignaturePad {
|
|
697
|
+
document = inject(DOCUMENT$1);
|
|
698
|
+
elementRef = inject(ElementRef);
|
|
699
|
+
renderer = inject(Renderer2);
|
|
700
|
+
inputRef = viewChild("signatureInput", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
|
|
701
|
+
value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
702
|
+
fontFamily = model("Brush Script MT, Segoe Script, cursive", ...ngDevMode ? [{ debugName: "fontFamily" }] : /* istanbul ignore next */ []);
|
|
703
|
+
penColor = model("#000", ...ngDevMode ? [{ debugName: "penColor" }] : /* istanbul ignore next */ []);
|
|
704
|
+
placeholder = input("Type signature", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
705
|
+
colors = input([
|
|
706
|
+
"#000",
|
|
707
|
+
"#0059ff",
|
|
708
|
+
"#ff0000"
|
|
709
|
+
], ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
710
|
+
fonts = input(TYPED_SIGNATURE_DEFAULT_FONTS, ...ngDevMode ? [{ debugName: "fonts" }] : /* istanbul ignore next */ []);
|
|
711
|
+
signatureSaved = output();
|
|
712
|
+
signatureTyped = output();
|
|
713
|
+
signatureCleared = output();
|
|
714
|
+
selectedFont = computed(() => this.fonts().find((font) => font.family === this.fontFamily()) ?? this.fonts()[0] ?? TYPED_SIGNATURE_DEFAULT_FONTS[0], ...ngDevMode ? [{ debugName: "selectedFont" }] : /* istanbul ignore next */ []);
|
|
715
|
+
hasValue = computed(() => this.value().trim().length > 0, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
|
|
716
|
+
lastEmittedDataUrl = signal("", ...ngDevMode ? [{ debugName: "lastEmittedDataUrl" }] : /* istanbul ignore next */ []);
|
|
717
|
+
constructor() {
|
|
718
|
+
effect(() => {
|
|
719
|
+
this.setCssVar("--ngs-typed-signature-font", this.fontFamily());
|
|
720
|
+
this.setCssVar("--ngs-typed-signature-color", this.penColor());
|
|
721
|
+
});
|
|
722
|
+
effect(() => {
|
|
723
|
+
const typedValue = this.value().trim();
|
|
724
|
+
this.fontFamily();
|
|
725
|
+
this.penColor();
|
|
726
|
+
if (!typedValue) {
|
|
727
|
+
this.lastEmittedDataUrl.set("");
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
this.emitSignature();
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
updateValue(value) {
|
|
734
|
+
this.value.set(value);
|
|
735
|
+
}
|
|
736
|
+
selectFont(font) {
|
|
737
|
+
this.fontFamily.set(font.family);
|
|
738
|
+
this.focusInput();
|
|
739
|
+
}
|
|
740
|
+
onColorChange(color) {
|
|
741
|
+
this.penColor.set(color);
|
|
742
|
+
this.focusInput();
|
|
743
|
+
}
|
|
744
|
+
clear() {
|
|
745
|
+
this.value.set("");
|
|
746
|
+
this.lastEmittedDataUrl.set("");
|
|
747
|
+
this.signatureCleared.emit();
|
|
748
|
+
this.focusInput();
|
|
749
|
+
}
|
|
750
|
+
save() {
|
|
751
|
+
if (!this.value().trim()) return;
|
|
752
|
+
this.emitSignature(true);
|
|
753
|
+
}
|
|
754
|
+
handleEscapeKey(event) {
|
|
755
|
+
event.preventDefault();
|
|
756
|
+
this.clear();
|
|
757
|
+
}
|
|
758
|
+
emitSignature(force = false) {
|
|
759
|
+
const dataUrl = this.createSignatureDataUrl();
|
|
760
|
+
if (!force && dataUrl === this.lastEmittedDataUrl()) return;
|
|
761
|
+
const signature = {
|
|
762
|
+
value: this.value().trim(),
|
|
763
|
+
fontFamily: this.fontFamily(),
|
|
764
|
+
color: this.penColor(),
|
|
765
|
+
dataUrl
|
|
766
|
+
};
|
|
767
|
+
this.lastEmittedDataUrl.set(dataUrl);
|
|
768
|
+
this.signatureSaved.emit(dataUrl);
|
|
769
|
+
this.signatureTyped.emit(signature);
|
|
770
|
+
}
|
|
771
|
+
createSignatureDataUrl() {
|
|
772
|
+
const rawValue = this.value().trim();
|
|
773
|
+
const value = this.escapeXml(rawValue);
|
|
774
|
+
const fontFamily = this.escapeXml(this.fontFamily());
|
|
775
|
+
const color = this.escapeXml(this.penColor());
|
|
776
|
+
const fontSize = 96;
|
|
777
|
+
const paddingY = 4;
|
|
778
|
+
const textMetrics = this.measureSignatureText(rawValue, fontSize);
|
|
779
|
+
const width = Math.ceil(textMetrics.width + 16);
|
|
780
|
+
const height = Math.ceil(textMetrics.ascent + textMetrics.descent + 8);
|
|
781
|
+
const textX = width / 2;
|
|
782
|
+
const textY = paddingY + textMetrics.ascent;
|
|
783
|
+
const centerY = height / 2;
|
|
784
|
+
const svg = [
|
|
785
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">`,
|
|
786
|
+
`<rect width="${width}" height="${height}" fill="transparent"/>`,
|
|
787
|
+
`<g transform="translate(${textX} ${centerY}) scale(0.9) translate(${-textX} ${-centerY})">`,
|
|
788
|
+
`<text x="${textX}" y="${textY}" text-anchor="middle" fill="${color}" font-family="${fontFamily}" font-size="${fontSize}" font-weight="500">${value}</text>`,
|
|
789
|
+
"</g>",
|
|
790
|
+
"</svg>"
|
|
791
|
+
].join("");
|
|
792
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
793
|
+
}
|
|
794
|
+
measureSignatureText(value, fontSize) {
|
|
795
|
+
const fallbackWidth = Math.max(fontSize * .5, value.length * fontSize * .55);
|
|
796
|
+
const fallbackAscent = fontSize * .75;
|
|
797
|
+
const fallbackDescent = fontSize * .15;
|
|
798
|
+
const context = this.document.createElement("canvas").getContext("2d");
|
|
799
|
+
if (!context) return {
|
|
800
|
+
width: fallbackWidth,
|
|
801
|
+
ascent: fallbackAscent,
|
|
802
|
+
descent: fallbackDescent
|
|
803
|
+
};
|
|
804
|
+
context.font = `500 ${fontSize}px ${this.fontFamily()}`;
|
|
805
|
+
const metrics = context.measureText(value);
|
|
806
|
+
return {
|
|
807
|
+
width: Math.max(metrics.width, metrics.actualBoundingBoxLeft + metrics.actualBoundingBoxRight, fallbackWidth),
|
|
808
|
+
ascent: Math.max(metrics.actualBoundingBoxAscent, fallbackAscent),
|
|
809
|
+
descent: Math.max(metrics.actualBoundingBoxDescent, fallbackDescent)
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
escapeXml(value) {
|
|
813
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
814
|
+
}
|
|
815
|
+
setCssVar(name, value) {
|
|
816
|
+
this.renderer.setStyle(this.elementRef.nativeElement, name, value, RendererStyleFlags2.DashCase);
|
|
817
|
+
}
|
|
818
|
+
focusInput() {
|
|
819
|
+
this.document.defaultView?.setTimeout(() => this.inputRef()?.nativeElement.focus(), 0);
|
|
820
|
+
}
|
|
821
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
822
|
+
minVersion: "12.0.0",
|
|
823
|
+
version: "22.3.0",
|
|
824
|
+
ngImport: i0,
|
|
825
|
+
type: TypedSignaturePad,
|
|
826
|
+
deps: [],
|
|
827
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
828
|
+
});
|
|
829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
830
|
+
minVersion: "17.0.0",
|
|
831
|
+
version: "22.3.0",
|
|
832
|
+
type: TypedSignaturePad,
|
|
833
|
+
isStandalone: true,
|
|
834
|
+
selector: "ngs-typed-signature-pad",
|
|
835
|
+
inputs: {
|
|
836
|
+
value: {
|
|
837
|
+
classPropertyName: "value",
|
|
838
|
+
publicName: "value",
|
|
839
|
+
isSignal: true,
|
|
840
|
+
isRequired: false,
|
|
841
|
+
transformFunction: null
|
|
842
|
+
},
|
|
843
|
+
fontFamily: {
|
|
844
|
+
classPropertyName: "fontFamily",
|
|
845
|
+
publicName: "fontFamily",
|
|
846
|
+
isSignal: true,
|
|
847
|
+
isRequired: false,
|
|
848
|
+
transformFunction: null
|
|
849
|
+
},
|
|
850
|
+
penColor: {
|
|
851
|
+
classPropertyName: "penColor",
|
|
852
|
+
publicName: "penColor",
|
|
853
|
+
isSignal: true,
|
|
854
|
+
isRequired: false,
|
|
855
|
+
transformFunction: null
|
|
856
|
+
},
|
|
857
|
+
placeholder: {
|
|
858
|
+
classPropertyName: "placeholder",
|
|
859
|
+
publicName: "placeholder",
|
|
860
|
+
isSignal: true,
|
|
861
|
+
isRequired: false,
|
|
862
|
+
transformFunction: null
|
|
863
|
+
},
|
|
864
|
+
colors: {
|
|
865
|
+
classPropertyName: "colors",
|
|
866
|
+
publicName: "colors",
|
|
867
|
+
isSignal: true,
|
|
868
|
+
isRequired: false,
|
|
869
|
+
transformFunction: null
|
|
870
|
+
},
|
|
871
|
+
fonts: {
|
|
872
|
+
classPropertyName: "fonts",
|
|
873
|
+
publicName: "fonts",
|
|
874
|
+
isSignal: true,
|
|
875
|
+
isRequired: false,
|
|
876
|
+
transformFunction: null
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
outputs: {
|
|
880
|
+
value: "valueChange",
|
|
881
|
+
fontFamily: "fontFamilyChange",
|
|
882
|
+
penColor: "penColorChange",
|
|
883
|
+
signatureSaved: "signatureSaved",
|
|
884
|
+
signatureTyped: "signatureTyped",
|
|
885
|
+
signatureCleared: "signatureCleared"
|
|
886
|
+
},
|
|
887
|
+
host: {
|
|
888
|
+
listeners: { "document:keydown.escape": "handleEscapeKey($event)" },
|
|
889
|
+
classAttribute: "ngs-typed-signature-pad"
|
|
890
|
+
},
|
|
891
|
+
viewQueries: [{
|
|
892
|
+
propertyName: "inputRef",
|
|
893
|
+
first: true,
|
|
894
|
+
predicate: ["signatureInput"],
|
|
895
|
+
descendants: true,
|
|
896
|
+
isSignal: true
|
|
897
|
+
}],
|
|
898
|
+
exportAs: ["ngsTypedSignaturePad"],
|
|
899
|
+
ngImport: i0,
|
|
900
|
+
template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n",
|
|
901
|
+
styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
902
|
+
dependencies: [
|
|
903
|
+
{
|
|
904
|
+
kind: "component",
|
|
905
|
+
type: Button,
|
|
906
|
+
selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
|
|
907
|
+
inputs: [
|
|
908
|
+
"ngsButton",
|
|
909
|
+
"ngsIconButton",
|
|
910
|
+
"loading",
|
|
911
|
+
"disabled",
|
|
912
|
+
"disabledInteractive",
|
|
913
|
+
"disableRipple",
|
|
914
|
+
"reverse",
|
|
915
|
+
"fullWidth",
|
|
916
|
+
"hideTextOnMobile"
|
|
917
|
+
],
|
|
918
|
+
exportAs: ["ngsButton"]
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
kind: "component",
|
|
922
|
+
type: ColorSwitcher,
|
|
923
|
+
selector: "ngs-color-switcher",
|
|
924
|
+
inputs: [
|
|
925
|
+
"readonly",
|
|
926
|
+
"value",
|
|
927
|
+
"colors",
|
|
928
|
+
"selectedColor",
|
|
929
|
+
"disabled"
|
|
930
|
+
],
|
|
931
|
+
outputs: [
|
|
932
|
+
"touch",
|
|
933
|
+
"valueChange",
|
|
934
|
+
"colorChange"
|
|
935
|
+
],
|
|
936
|
+
exportAs: ["ngsColorSwitcher"]
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
kind: "component",
|
|
940
|
+
type: Icon,
|
|
941
|
+
selector: "ngs-icon",
|
|
942
|
+
inputs: ["name"],
|
|
943
|
+
exportAs: ["ngsIcon"]
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
kind: "component",
|
|
947
|
+
type: Menu,
|
|
948
|
+
selector: "ngs-menu",
|
|
949
|
+
inputs: [
|
|
950
|
+
"themeSource",
|
|
951
|
+
"role",
|
|
952
|
+
"classList",
|
|
953
|
+
"xPosition",
|
|
954
|
+
"yPosition",
|
|
955
|
+
"pushIntoViewport"
|
|
956
|
+
],
|
|
957
|
+
outputs: ["closed"],
|
|
958
|
+
exportAs: ["ngsMenu"]
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
kind: "component",
|
|
962
|
+
type: MenuItem,
|
|
963
|
+
selector: "ngs-menu-item, [ngs-menu-item]",
|
|
964
|
+
inputs: [
|
|
965
|
+
"disabled",
|
|
966
|
+
"role",
|
|
967
|
+
"selected"
|
|
968
|
+
],
|
|
969
|
+
outputs: ["_triggered"],
|
|
970
|
+
exportAs: ["ngsMenuItem"]
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
kind: "directive",
|
|
974
|
+
type: MenuTrigger,
|
|
975
|
+
selector: "[ngsMenuTriggerFor]",
|
|
976
|
+
inputs: [
|
|
977
|
+
"ngsMenuTriggerFor",
|
|
978
|
+
"ngsMenuTriggerData",
|
|
979
|
+
"ngsMenuDisabled",
|
|
980
|
+
"xPosition",
|
|
981
|
+
"yPosition",
|
|
982
|
+
"ngsMenuTriggerRestoreFocus"
|
|
983
|
+
],
|
|
984
|
+
outputs: ["menuOpened", "menuClosed"],
|
|
985
|
+
exportAs: ["ngsMenuTrigger"]
|
|
986
|
+
}
|
|
987
|
+
],
|
|
988
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
989
|
+
});
|
|
990
|
+
};
|
|
991
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
992
|
+
minVersion: "12.0.0",
|
|
993
|
+
version: "22.3.0",
|
|
994
|
+
ngImport: i0,
|
|
995
|
+
type: TypedSignaturePad,
|
|
996
|
+
decorators: [{
|
|
997
|
+
type: Component,
|
|
998
|
+
args: [{
|
|
999
|
+
selector: "ngs-typed-signature-pad",
|
|
1000
|
+
exportAs: "ngsTypedSignaturePad",
|
|
1001
|
+
standalone: true,
|
|
1002
|
+
imports: [
|
|
1003
|
+
Button,
|
|
1004
|
+
ColorSwitcher,
|
|
1005
|
+
Icon,
|
|
1006
|
+
Menu,
|
|
1007
|
+
MenuItem,
|
|
1008
|
+
MenuTrigger
|
|
1009
|
+
],
|
|
1010
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1011
|
+
host: {
|
|
1012
|
+
class: "ngs-typed-signature-pad",
|
|
1013
|
+
"(document:keydown.escape)": "handleEscapeKey($event)"
|
|
1014
|
+
},
|
|
1015
|
+
template: "<div class=\"font-button\">\n <button\n class=\"typed-signature-clear\"\n ngsIconButton\n type=\"button\"\n aria-label=\"Clear typed signature\"\n (click)=\"clear()\"\n >\n <ngs-icon name=\"fluent:dismiss-24-regular\" />\n </button>\n\n <button\n class=\"typed-signature-font-trigger\"\n ngsButton=\"text\"\n reverse\n type=\"button\"\n [ngsMenuTriggerFor]=\"fontMenu\"\n >\n <span>{{ selectedFont().label }}</span>\n <ngs-icon name=\"fluent:chevron-down-24-filled\" />\n </button>\n</div>\n\n<input\n #signatureInput\n class=\"signature-canvas typed-signature-input\"\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-label=\"Typed signature\"\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n (input)=\"updateValue($any($event.target).value)\"\n/>\n\n<div class=\"line\" aria-hidden=\"true\"></div>\n\n<ngs-color-switcher\n [selectedColor]=\"penColor()\"\n [colors]=\"colors()\"\n (colorChange)=\"onColorChange($event)\"\n/>\n\n<ngs-menu #fontMenu=\"ngsMenu\">\n @for (font of fonts(); track font.family) {\n <button\n ngs-menu-item\n type=\"button\"\n [selected]=\"font.family === fontFamily()\"\n (click)=\"selectFont(font)\"\n >\n <span class=\"typed-signature-font-sample\">{{ font.label }}</span>\n </button>\n }\n</ngs-menu>\n",
|
|
1016
|
+
styles: [":host{--ngs-typed-signature-font: \"Brush Script MT\", \"Segoe Script\", cursive;--ngs-typed-signature-color: #000;display:block;position:relative;width:100%;max-width:100%;min-height:calc(var(--spacing, .25rem) * 62.5);overflow:hidden;background:var(--ngs-color-surface-container-lowest)}:host .signature-canvas{position:relative;z-index:1;display:block;width:100%;height:250px}:host .font-button{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);z-index:2;display:inline-flex;align-items:center;gap:var(--spacing, .25rem)}:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: var(--ngs-color-on-surface);--ngs-button-hover-bg: transparent;--ngs-button-height: calc(var(--spacing, .25rem) * 8);--ngs-button-padding: calc(var(--spacing, .25rem) * 2);--ngs-button-content-gap: calc(var(--spacing, .25rem) * 1.5);min-width:0;font-size:var(--ngs-font-size-sm);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger{--ngs-button-text-color: color-mix(in srgb, var(--ngs-color-on-surface), transparent 38%)}}:host .font-button .typed-signature-font-trigger ngs-icon{--ngs-icon-size: calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-font-trigger ngs-icon{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 54%)}}:host .font-button .typed-signature-font-trigger .icon{left:auto}:host .ngs-brand-colors{--ngs-brand-colors-color-size: calc(var(--spacing, .25rem) * 5);--ngs-brand-colors-gap: calc(var(--spacing, .25rem) * 2);position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:2}:host .typed-signature-input{box-sizing:border-box;padding:calc(var(--spacing, .25rem) * 18) calc(var(--spacing, .25rem) * 10) calc(var(--spacing, .25rem) * 14);border:0;background:transparent;color:var(--ngs-typed-signature-color);font-family:var(--ngs-typed-signature-font);font-size:80px;font-weight:500;line-height:1;outline:0;text-align:center}:host .typed-signature-input::placeholder{color:var(--ngs-color-on-surface);font-family:var(--ngs-font-family, inherit);font-size:var(--ngs-font-size-lg);font-weight:400}@supports (color: color-mix(in lab,red,red)){:host .typed-signature-input::placeholder{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 68%)}}:host .line{position:absolute;z-index:0;right:calc(var(--spacing, .25rem) * 10);bottom:calc(var(--spacing, .25rem) * 16.5);left:calc(var(--spacing, .25rem) * 10);height:1px;background:var(--ngs-color-surface-container-highest)}:host .font-button .typed-signature-clear{--ngs-icon-button-size: calc(var(--spacing, .25rem) * 8);--ngs-button-hover-bg: var(--ngs-color-surface-container-low);color:var(--ngs-color-on-surface)}@supports (color: color-mix(in lab,red,red)){:host .font-button .typed-signature-clear{color:color-mix(in srgb,var(--ngs-color-on-surface),transparent 38%)}}:host .typed-signature-font-sample{font-family:var(--ngs-typed-signature-font)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
1017
|
+
}]
|
|
1018
|
+
}],
|
|
1019
|
+
ctorParameters: () => [],
|
|
1020
|
+
propDecorators: {
|
|
1021
|
+
inputRef: [{
|
|
1022
|
+
type: i0.ViewChild,
|
|
1023
|
+
args: ["signatureInput", { isSignal: true }]
|
|
1024
|
+
}],
|
|
1025
|
+
value: [{
|
|
1026
|
+
type: i0.Input,
|
|
1027
|
+
args: [{
|
|
1028
|
+
isSignal: true,
|
|
1029
|
+
alias: "value",
|
|
1030
|
+
required: false
|
|
1031
|
+
}]
|
|
1032
|
+
}, {
|
|
1033
|
+
type: i0.Output,
|
|
1034
|
+
args: ["valueChange"]
|
|
1035
|
+
}],
|
|
1036
|
+
fontFamily: [{
|
|
1037
|
+
type: i0.Input,
|
|
1038
|
+
args: [{
|
|
1039
|
+
isSignal: true,
|
|
1040
|
+
alias: "fontFamily",
|
|
1041
|
+
required: false
|
|
1042
|
+
}]
|
|
1043
|
+
}, {
|
|
1044
|
+
type: i0.Output,
|
|
1045
|
+
args: ["fontFamilyChange"]
|
|
1046
|
+
}],
|
|
1047
|
+
penColor: [{
|
|
1048
|
+
type: i0.Input,
|
|
1049
|
+
args: [{
|
|
1050
|
+
isSignal: true,
|
|
1051
|
+
alias: "penColor",
|
|
1052
|
+
required: false
|
|
1053
|
+
}]
|
|
1054
|
+
}, {
|
|
1055
|
+
type: i0.Output,
|
|
1056
|
+
args: ["penColorChange"]
|
|
1057
|
+
}],
|
|
1058
|
+
placeholder: [{
|
|
1059
|
+
type: i0.Input,
|
|
1060
|
+
args: [{
|
|
1061
|
+
isSignal: true,
|
|
1062
|
+
alias: "placeholder",
|
|
1063
|
+
required: false
|
|
1064
|
+
}]
|
|
1065
|
+
}],
|
|
1066
|
+
colors: [{
|
|
1067
|
+
type: i0.Input,
|
|
1068
|
+
args: [{
|
|
1069
|
+
isSignal: true,
|
|
1070
|
+
alias: "colors",
|
|
1071
|
+
required: false
|
|
1072
|
+
}]
|
|
1073
|
+
}],
|
|
1074
|
+
fonts: [{
|
|
1075
|
+
type: i0.Input,
|
|
1076
|
+
args: [{
|
|
1077
|
+
isSignal: true,
|
|
1078
|
+
alias: "fonts",
|
|
1079
|
+
required: false
|
|
1080
|
+
}]
|
|
1081
|
+
}],
|
|
1082
|
+
signatureSaved: [{
|
|
1083
|
+
type: i0.Output,
|
|
1084
|
+
args: ["signatureSaved"]
|
|
1085
|
+
}],
|
|
1086
|
+
signatureTyped: [{
|
|
1087
|
+
type: i0.Output,
|
|
1088
|
+
args: ["signatureTyped"]
|
|
1089
|
+
}],
|
|
1090
|
+
signatureCleared: [{
|
|
1091
|
+
type: i0.Output,
|
|
1092
|
+
args: ["signatureCleared"]
|
|
1093
|
+
}]
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
648
1096
|
export { SignaturePad, TypedSignaturePad };
|
|
649
|
-
|
|
1097
|
+
|
|
1098
|
+
//# sourceMappingURL=ngstarter-ui-components-signature-pad.mjs.map
|