@ngstarter-ui/components 21.0.76 → 22.0.3
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/LICENSE.md +21 -116
- package/README.md +16 -25
- package/ai/component-registry.json +188 -183
- package/fesm2022/ngstarter-ui-components-action-required.mjs +14 -10
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-alert.mjs +23 -21
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-announcement.mjs +23 -18
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +18 -13
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-avatar.mjs +44 -33
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-badge.mjs +12 -10
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +7 -7
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +7 -7
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +60 -60
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +21 -22
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +6 -5
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-calendar.mjs +30 -17
- package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +9 -9
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card.mjs +57 -54
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-carousel.mjs +77 -51
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +35 -24
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-chips.mjs +86 -66
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +25 -18
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +62 -45
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +33 -83
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +11 -9
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +20 -18
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +129 -108
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +26 -19
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-confirm.mjs +13 -11
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-CLfzSb69.mjs → ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs} +29 -18
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbK5fCoE.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs → ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs} +10 -7
- package/fesm2022/{ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs.map → ngstarter-ui-components-content-editor-content-editor-content-editable.directive-BOXOHcSo.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs → ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs} +16 -11
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-B5wyMHjr.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BMBObSRE.mjs → ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs} +28 -19
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGqupBLe.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-DL9PehLX.mjs → ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs} +30 -19
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D1s2yalT.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-image-block.component-DJWItlMf.mjs → ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs} +27 -17
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-D75DrPNq.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-J9vhrddX.mjs → ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs} +29 -20
- package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-J9vhrddX.mjs.map → ngstarter-ui-components-content-editor-list-block.component-B7pDlrQ_.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-Be8dDH3z.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs} +351 -213
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CV959OGj.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-DxE2SXVt.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs} +30 -19
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CVV2f-ON.mjs.map +1 -0
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-BEt5JkO8.mjs → ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs} +42 -25
- package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-BEt5JkO8.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-CVb-bkJw.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BeCHXahH.mjs → ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs} +42 -31
- package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BeCHXahH.mjs.map → ngstarter-ui-components-content-editor-table-block.component-DSpLBC4V.mjs.map} +1 -1
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-BzFQtQwc.mjs → ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs} +31 -19
- package/fesm2022/{ngstarter-ui-components-content-editor-video-block.component-BzFQtQwc.mjs.map → ngstarter-ui-components-content-editor-video-block.component-D3U8uXIy.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +18 -16
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +228 -689
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +27 -17
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-crop.mjs +22 -13
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +25 -16
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +173 -98
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +17 -12
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +172 -117
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-dialog.mjs +39 -35
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs +55 -31
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-divider.mjs +11 -11
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-drawer.mjs +16 -12
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +23 -16
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +24 -24
- package/fesm2022/ngstarter-ui-components-events.mjs +45 -40
- package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expand.mjs +14 -10
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expansion.mjs +30 -28
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-file-type.mjs +18 -11
- package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +35 -25
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/{ngstarter-ui-components-form-builder-plain-text-settings-C69NYW8R.mjs → ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs} +19 -12
- package/fesm2022/{ngstarter-ui-components-form-builder-plain-text-settings-C69NYW8R.mjs.map → ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map} +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +328 -181
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-field.mjs +105 -66
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-gauge.mjs +11 -11
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-grid.mjs +15 -11
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +56 -36
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +32 -19
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-icon.mjs +21 -10
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +136 -76
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +18 -14
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +41 -31
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +25 -19
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-incidents.mjs +69 -64
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +12 -8
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +15 -12
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input.mjs +19 -11
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +19 -15
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kbd.mjs +11 -11
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-layout.mjs +45 -43
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-list.mjs +52 -49
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-logo.mjs +21 -20
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-marquee.mjs +13 -11
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +75 -57
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +63 -45
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-motion.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-navigation.mjs +83 -62
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-notifications.mjs +73 -49
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +39 -28
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +22 -17
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +7 -7
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-panel.mjs +47 -42
- package/fesm2022/ngstarter-ui-components-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +39 -27
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +256 -104
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +80 -34
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +125 -70
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +51 -32
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +22 -16
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-popover.mjs +27 -20
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +16 -10
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +28 -24
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +27 -18
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +19 -17
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +6 -5
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +11 -10
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +29 -27
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +75 -41
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-segmented.mjs +21 -18
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +121 -79
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +35 -23
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +105 -94
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +47 -33
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +56 -32
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +21 -15
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slider.mjs +27 -20
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +17 -14
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +13 -12
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-spinner.mjs +15 -12
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +6 -6
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-split.mjs +18 -12
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs +48 -35
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-stepper.mjs +33 -34
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +23 -22
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +64 -61
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +68 -73
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tabs.mjs +74 -49
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-text-editor.mjs +131 -110
- package/fesm2022/ngstarter-ui-components-text-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +19 -14
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tiles.mjs +43 -29
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timeline.mjs +48 -47
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +29 -23
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +26 -17
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +55 -47
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +8 -8
- package/fesm2022/ngstarter-ui-components-tree.mjs +56 -42
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +94 -78
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-player.mjs +43 -25
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +45 -33
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +5 -5
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
- package/package.json +13 -16
- package/schematics/utils.js +0 -1
- package/schematics/utils.js.map +1 -1
- package/styles/_common.scss +20 -20
- package/styles/_tokens.scss +132 -556
- package/styles/themes/_default-components.scss +492 -0
- package/styles/themes/chalk.scss +400 -0
- package/styles/themes/default.scss +360 -0
- package/types/ngstarter-ui-components-announcement.d.ts +1 -1
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +1 -1
- package/types/ngstarter-ui-components-button-toggle.d.ts +1 -1
- package/types/ngstarter-ui-components-checkbox.d.ts +3 -2
- package/types/ngstarter-ui-components-code-highlighter.d.ts +1 -2
- package/types/ngstarter-ui-components-confirm.d.ts +1 -1
- package/types/ngstarter-ui-components-core.d.ts +42 -31
- package/types/ngstarter-ui-components-datepicker.d.ts +2 -2
- package/types/ngstarter-ui-components-dialog.d.ts +1 -1
- package/types/ngstarter-ui-components-expansion.d.ts +3 -2
- package/types/ngstarter-ui-components-form-field.d.ts +15 -5
- package/types/ngstarter-ui-components-guided-tour.d.ts +1 -1
- package/types/ngstarter-ui-components-icon.d.ts +2 -1
- package/types/ngstarter-ui-components-image-designer.d.ts +1 -1
- package/types/ngstarter-ui-components-layout.d.ts +1 -1
- package/types/ngstarter-ui-components-list.d.ts +3 -2
- package/types/ngstarter-ui-components-navigation.d.ts +3 -1
- package/types/ngstarter-ui-components-notifications.d.ts +8 -2
- package/types/ngstarter-ui-components-paginator.d.ts +1 -1
- package/types/ngstarter-ui-components-pdf-builder.d.ts +23 -2
- package/types/ngstarter-ui-components-pdf-signer.d.ts +3 -0
- package/types/ngstarter-ui-components-pdf-viewer.d.ts +1 -1
- package/types/ngstarter-ui-components-screen-loader.d.ts +1 -1
- package/types/ngstarter-ui-components-sidebar.d.ts +8 -6
- package/types/ngstarter-ui-components-snack-bar.d.ts +1 -1
- package/types/ngstarter-ui-components-stepper.d.ts +0 -1
- package/types/ngstarter-ui-components-tab-panel.d.ts +1 -1
- package/types/ngstarter-ui-components-table.d.ts +1 -4
- package/types/ngstarter-ui-components-tiles.d.ts +1 -1
- package/types/ngstarter-ui-components-timepicker.d.ts +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-CLfzSb69.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-BMBObSRE.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-DL9PehLX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DJWItlMf.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-Be8dDH3z.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-DxE2SXVt.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-fade.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-content-fade.mjs.map +0 -1
- package/styles/themes/compact.scss +0 -8
- package/styles/themes/modern.scss +0 -346
- package/types/ngstarter-ui-components-content-fade.d.ts +0 -17
|
@@ -2,16 +2,24 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, output, computed, signal, inject, ElementRef, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class Crop {
|
|
5
|
-
minWidth = input(100,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
minWidth = input(100, /* @ts-ignore */
|
|
6
|
+
...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
7
|
+
minHeight = input(100, /* @ts-ignore */
|
|
8
|
+
...(ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []));
|
|
9
|
+
shape = input('rectangle', /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
8
11
|
selectionApplied = output();
|
|
9
|
-
isCircle = computed(() => this.shape() === 'circle',
|
|
10
|
-
|
|
12
|
+
isCircle = computed(() => this.shape() === 'circle', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "isCircle" }] : /* istanbul ignore next */ []));
|
|
14
|
+
selection = signal({ top: 20, right: 20, bottom: 20, left: 20 }, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
11
16
|
elementRef = inject(ElementRef);
|
|
12
|
-
activeDragHandle = signal(null,
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
activeDragHandle = signal(null, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "activeDragHandle" }] : /* istanbul ignore next */ []));
|
|
19
|
+
startDragPosition = signal(null, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "startDragPosition" }] : /* istanbul ignore next */ []));
|
|
21
|
+
startDragSelection = signal(null, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "startDragSelection" }] : /* istanbul ignore next */ []));
|
|
15
23
|
constructor() {
|
|
16
24
|
effect(() => {
|
|
17
25
|
if (this.isCircle() && this.elementRef.nativeElement.isConnected) {
|
|
@@ -60,7 +68,8 @@ class Crop {
|
|
|
60
68
|
right: `${this.selection().right}px`,
|
|
61
69
|
bottom: `${this.selection().bottom}px`,
|
|
62
70
|
left: `${this.selection().left}px`,
|
|
63
|
-
}),
|
|
71
|
+
}), /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "selectionStyle" }] : /* istanbul ignore next */ []));
|
|
64
73
|
onDragStart(event, handle) {
|
|
65
74
|
event.preventDefault();
|
|
66
75
|
event.stopPropagation();
|
|
@@ -164,15 +173,15 @@ class Crop {
|
|
|
164
173
|
return newSelection;
|
|
165
174
|
});
|
|
166
175
|
}
|
|
167
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
168
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
176
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Crop, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
177
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: Crop, isStandalone: true, selector: "ngs-crop", inputs: { minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionApplied: "selectionApplied" }, host: { listeners: { "document:mouseup": "onDragEnd()", "document:mousemove": "onDrag($event)" } }, ngImport: i0, template: "<div class=\"crop-viewport\">\n <ng-content />\n <div\n class=\"crop-selection-area\"\n [class.is-circle]=\"isCircle()\"\n [style]=\"selectionStyle()\">\n </div>\n</div>\n\n<!-- Handles are now outside the viewport to prevent clipping -->\n<div\n class=\"crop-handles-overlay\"\n [style]=\"selectionStyle()\">\n <div class=\"crop-handle move-handle\" (mousedown)=\"onDragStart($event, 'move')\"></div>\n <div class=\"crop-handle top-left\" (mousedown)=\"onDragStart($event, 'top-left')\"></div>\n <div class=\"crop-handle top-right\" (mousedown)=\"onDragStart($event, 'top-right')\"></div>\n <div class=\"crop-handle bottom-left\" (mousedown)=\"onDragStart($event, 'bottom-left')\"></div>\n <div class=\"crop-handle bottom-right\" (mousedown)=\"onDragStart($event, 'bottom-right')\"></div>\n\n <div class=\"crop-handle top\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'top')\"></div>\n <div class=\"crop-handle right\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'right')\"></div>\n <div class=\"crop-handle bottom\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'bottom')\"></div>\n <div class=\"crop-handle left\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'left')\"></div>\n</div>\n", styles: [":host{display:inline-block;position:relative;-webkit-user-select:none;user-select:none}:host .crop-viewport{position:relative;width:100%;height:100%;overflow:hidden}:host ::ng-deep>.crop-viewport>*:first-child{display:block;max-width:100%;height:auto}:host .crop-selection-area{position:absolute;box-shadow:0 0 0 2000px #00000080}:host .crop-selection-area.is-circle{border-radius:50%}:host .crop-handles-overlay{position:absolute}:host .crop-handles-overlay.is-circle{border-radius:50%}:host .crop-handle{position:absolute;width:14px;height:14px;background:#ffffffe6;border:1px solid rgba(0,0,0,.5);border-radius:50%}:host .crop-handle.hidden{display:none}:host .move-handle{position:absolute;inset:0;width:auto;height:auto;background:transparent;border:none;border-radius:0;cursor:move}.is-circle :host .move-handle{border-radius:50%}:host .top-left{top:-7px;left:-7px;cursor:nwse-resize}:host .top-right{top:-7px;right:-7px;cursor:nesw-resize}:host .bottom-left{bottom:-7px;left:-7px;cursor:nesw-resize}:host .bottom-right{bottom:-7px;right:-7px;cursor:nwse-resize}:host .top{top:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .right{top:50%;right:-7px;transform:translateY(-50%);cursor:ew-resize}:host .bottom{bottom:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .left{top:50%;left:-7px;transform:translateY(-50%);cursor:ew-resize}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
169
178
|
}
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Crop, decorators: [{
|
|
171
180
|
type: Component,
|
|
172
181
|
args: [{ selector: 'ngs-crop', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
173
182
|
'(document:mouseup)': 'onDragEnd()',
|
|
174
183
|
'(document:mousemove)': 'onDrag($event)',
|
|
175
|
-
}, template: "<div class=\"crop-viewport\">\n <ng-content />\n <div\n class=\"crop-selection-area\"\n [class.is-circle]=\"isCircle()\"\n [style]=\"selectionStyle()\">\n </div>\n</div>\n\n<!-- Handles are now outside the viewport to prevent clipping -->\n<div\n class=\"crop-handles-overlay\"\n [style]=\"selectionStyle()\">\n <div class=\"crop-handle move-handle\" (mousedown)=\"onDragStart($event, 'move')\"></div>\n <div class=\"crop-handle top-left\" (mousedown)=\"onDragStart($event, 'top-left')\"></div>\n <div class=\"crop-handle top-right\" (mousedown)=\"onDragStart($event, 'top-right')\"></div>\n <div class=\"crop-handle bottom-left\" (mousedown)=\"onDragStart($event, 'bottom-left')\"></div>\n <div class=\"crop-handle bottom-right\" (mousedown)=\"onDragStart($event, 'bottom-right')\"></div>\n\n <div class=\"crop-handle top\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'top')\"></div>\n <div class=\"crop-handle right\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'right')\"></div>\n <div class=\"crop-handle bottom\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'bottom')\"></div>\n <div class=\"crop-handle left\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'left')\"></div>\n</div>\n", styles: [":host{display:inline-block;position:relative;-webkit-user-select:none;user-select:none}:host .crop-viewport{position:relative;width:100%;height:100%;overflow:hidden}:host ::ng-deep>.crop-viewport>*:first-child{display:block;max-width:100%;height:auto}:host .crop-selection-area{position:absolute;box-shadow:0 0 0 2000px #00000080}:host .crop-selection-area.is-circle{border-radius:50%}:host .crop-handles-overlay{position:absolute}:host .crop-handles-overlay.is-circle{border-radius:50%}:host .crop-handle{position:absolute;width:14px;height:14px;background:#ffffffe6;border:1px solid rgba(0,0,0,.5);border-radius:50%}:host .crop-handle.hidden{display:none}:host .move-handle{position:absolute;inset:0;width:auto;height:auto;background:transparent;border:none;border-radius:0;cursor:move}.is-circle :host .move-handle{border-radius:50%}:host .top-left{top:-7px;left:-7px;cursor:nwse-resize}:host .top-right{top:-7px;right:-7px;cursor:nesw-resize}:host .bottom-left{bottom:-7px;left:-7px;cursor:nesw-resize}:host .bottom-right{bottom:-7px;right:-7px;cursor:nwse-resize}:host .top{top:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .right{top:50%;right:-7px;transform:translateY(-50%);cursor:ew-resize}:host .bottom{bottom:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .left{top:50%;left:-7px;transform:translateY(-50%);cursor:ew-resize}\n/*! tailwindcss v4.
|
|
184
|
+
}, template: "<div class=\"crop-viewport\">\n <ng-content />\n <div\n class=\"crop-selection-area\"\n [class.is-circle]=\"isCircle()\"\n [style]=\"selectionStyle()\">\n </div>\n</div>\n\n<!-- Handles are now outside the viewport to prevent clipping -->\n<div\n class=\"crop-handles-overlay\"\n [style]=\"selectionStyle()\">\n <div class=\"crop-handle move-handle\" (mousedown)=\"onDragStart($event, 'move')\"></div>\n <div class=\"crop-handle top-left\" (mousedown)=\"onDragStart($event, 'top-left')\"></div>\n <div class=\"crop-handle top-right\" (mousedown)=\"onDragStart($event, 'top-right')\"></div>\n <div class=\"crop-handle bottom-left\" (mousedown)=\"onDragStart($event, 'bottom-left')\"></div>\n <div class=\"crop-handle bottom-right\" (mousedown)=\"onDragStart($event, 'bottom-right')\"></div>\n\n <div class=\"crop-handle top\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'top')\"></div>\n <div class=\"crop-handle right\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'right')\"></div>\n <div class=\"crop-handle bottom\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'bottom')\"></div>\n <div class=\"crop-handle left\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'left')\"></div>\n</div>\n", styles: [":host{display:inline-block;position:relative;-webkit-user-select:none;user-select:none}:host .crop-viewport{position:relative;width:100%;height:100%;overflow:hidden}:host ::ng-deep>.crop-viewport>*:first-child{display:block;max-width:100%;height:auto}:host .crop-selection-area{position:absolute;box-shadow:0 0 0 2000px #00000080}:host .crop-selection-area.is-circle{border-radius:50%}:host .crop-handles-overlay{position:absolute}:host .crop-handles-overlay.is-circle{border-radius:50%}:host .crop-handle{position:absolute;width:14px;height:14px;background:#ffffffe6;border:1px solid rgba(0,0,0,.5);border-radius:50%}:host .crop-handle.hidden{display:none}:host .move-handle{position:absolute;inset:0;width:auto;height:auto;background:transparent;border:none;border-radius:0;cursor:move}.is-circle :host .move-handle{border-radius:50%}:host .top-left{top:-7px;left:-7px;cursor:nwse-resize}:host .top-right{top:-7px;right:-7px;cursor:nesw-resize}:host .bottom-left{bottom:-7px;left:-7px;cursor:nesw-resize}:host .bottom-right{bottom:-7px;right:-7px;cursor:nwse-resize}:host .top{top:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .right{top:50%;right:-7px;transform:translateY(-50%);cursor:ew-resize}:host .bottom{bottom:-7px;left:50%;transform:translate(-50%);cursor:ns-resize}:host .left{top:50%;left:-7px;transform:translateY(-50%);cursor:ew-resize}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
176
185
|
}], ctorParameters: () => [], propDecorators: { minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], selectionApplied: [{ type: i0.Output, args: ["selectionApplied"] }] } });
|
|
177
186
|
|
|
178
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-crop.mjs","sources":["../../../projects/components/crop/src/crop/crop.ts","../../../projects/components/crop/src/crop/crop.html","../../../projects/components/crop/ngstarter-ui-components-crop.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nexport interface CropSelection {\n shape: 'rectangle' | 'circle';\n pixels: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n };\n percentages: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n containerWidth: number;\n containerHeight: number;\n}\n\ninterface CropInset {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\ntype DragHandle =\n | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n | 'top' | 'right' | 'bottom' | 'left'\n | 'move';\n\n@Component({\n selector: 'ngs-crop',\n templateUrl: './crop.html',\n styleUrl: './crop.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:mouseup)': 'onDragEnd()',\n '(document:mousemove)': 'onDrag($event)',\n },\n})\nexport class Crop implements AfterViewInit {\n minWidth = input(100);\n minHeight = input(100);\n shape = input<'rectangle' | 'circle'>('rectangle');\n selectionApplied = output<CropSelection>();\n\n isCircle = computed(() => this.shape() === 'circle');\n selection = signal<CropInset>({ top: 20, right: 20, bottom: 20, left: 20 });\n\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private activeDragHandle = signal<DragHandle | null>(null);\n private startDragPosition = signal<{ x: number; y: number } | null>(null);\n private startDragSelection = signal<CropInset | null>(null);\n\n constructor() {\n effect(() => {\n if (this.isCircle() && this.elementRef.nativeElement.isConnected) {\n this.resetSelectionToSquare();\n }\n });\n }\n\n ngAfterViewInit(): void {\n if (this.isCircle()) {\n const hostEl = this.elementRef.nativeElement;\n if (hostEl.offsetWidth > 0) {\n this.resetSelectionToSquare();\n } else {\n const observer = new ResizeObserver(() => {\n if (hostEl.offsetWidth > 0) {\n this.resetSelectionToSquare();\n observer.disconnect();\n }\n });\n observer.observe(hostEl);\n }\n }\n }\n\n private resetSelectionToSquare(): void {\n const hostEl = this.elementRef.nativeElement;\n const hostWidth = hostEl.offsetWidth;\n const hostHeight = hostEl.offsetHeight;\n\n if (hostWidth === 0 || hostHeight === 0) return;\n\n const size = Math.min(hostWidth, hostHeight) * 0.8;\n const left = (hostWidth - size) / 2;\n const top = (hostHeight - size) / 2;\n\n this.selection.set({\n top: top,\n right: (hostWidth - size) / 2,\n bottom: (hostHeight - size) / 2,\n left: left,\n });\n\n // Emit the new selection state after it has been programmatically changed.\n // Use a timeout to avoid potential \"changed after checked\" errors.\n setTimeout(() => this.emitSelection(), 0);\n }\n\n selectionStyle = computed(() => ({\n top: `${this.selection().top}px`,\n right: `${this.selection().right}px`,\n bottom: `${this.selection().bottom}px`,\n left: `${this.selection().left}px`,\n }));\n\n onDragStart(event: MouseEvent, handle: DragHandle): void {\n event.preventDefault();\n event.stopPropagation();\n this.activeDragHandle.set(handle);\n this.startDragPosition.set({ x: event.clientX, y: event.clientY });\n this.startDragSelection.set(this.selection());\n }\n\n onDragEnd(): void {\n if (!this.activeDragHandle()) {\n return;\n }\n this.activeDragHandle.set(null);\n this.emitSelection();\n }\n\n private emitSelection(): void {\n const hostEl = this.elementRef.nativeElement;\n const containerWidth = hostEl.offsetWidth;\n const containerHeight = hostEl.offsetHeight;\n\n if (containerWidth === 0 || containerHeight === 0) {\n return;\n }\n\n const { top, right, bottom, left } = this.selection();\n const width = containerWidth - left - right;\n const height = containerHeight - top - bottom;\n\n this.selectionApplied.emit({\n shape: this.shape(),\n pixels: {\n top,\n right,\n bottom,\n left,\n width,\n height,\n },\n percentages: {\n top: (top / containerHeight) * 100,\n right: (right / containerWidth) * 100,\n bottom: (bottom / containerHeight) * 100,\n left: (left / containerWidth) * 100,\n },\n containerWidth,\n containerHeight,\n });\n }\n\n onDrag(event: MouseEvent): void {\n const handle = this.activeDragHandle();\n if (!handle) return;\n\n const startPos = this.startDragPosition()!;\n const startSelection = this.startDragSelection()!;\n const dx = event.clientX - startPos.x;\n const dy = event.clientY - startPos.y;\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n this.selection.update(() => {\n const newSelection = { ...startSelection };\n\n if (handle === 'move') {\n const selectionWidth = hostRect.width - startSelection.left - startSelection.right;\n const selectionHeight = hostRect.height - startSelection.top - startSelection.bottom;\n newSelection.top = Math.max(0, Math.min(startSelection.top + dy, hostRect.height - selectionHeight));\n newSelection.left = Math.max(0, Math.min(startSelection.left + dx, hostRect.width - selectionWidth));\n newSelection.bottom = hostRect.height - newSelection.top - selectionHeight;\n newSelection.right = hostRect.width - newSelection.left - selectionWidth;\n return newSelection;\n }\n\n let currentDx = dx;\n let currentDy = dy;\n\n if (this.isCircle() && handle.includes('-')) {\n if (handle === 'top-left' || handle === 'bottom-right') {\n currentDy = currentDx;\n } else {\n currentDy = -currentDx;\n }\n }\n\n if (handle.includes('top')) newSelection.top = startSelection.top + currentDy;\n if (handle.includes('bottom')) newSelection.bottom = startSelection.bottom - currentDy;\n if (handle.includes('left')) newSelection.left = startSelection.left + currentDx;\n if (handle.includes('right')) newSelection.right = startSelection.right - currentDx;\n\n const minW = this.minWidth();\n const minH = this.isCircle() ? minW : this.minHeight();\n\n if (hostRect.width - newSelection.left - newSelection.right < minW) {\n if (handle.includes('left')) newSelection.left = hostRect.width - newSelection.right - minW;\n else newSelection.right = hostRect.width - newSelection.left - minW;\n }\n if (hostRect.height - newSelection.top - newSelection.bottom < minH) {\n if (handle.includes('top')) newSelection.top = hostRect.height - newSelection.bottom - minH;\n else newSelection.bottom = hostRect.height - newSelection.top - minH;\n }\n\n newSelection.top = Math.max(0, newSelection.top);\n newSelection.bottom = Math.max(0, newSelection.bottom);\n newSelection.left = Math.max(0, newSelection.left);\n newSelection.right = Math.max(0, newSelection.right);\n\n return newSelection;\n });\n }\n}\n","<div class=\"crop-viewport\">\n <ng-content />\n <div\n class=\"crop-selection-area\"\n [class.is-circle]=\"isCircle()\"\n [style]=\"selectionStyle()\">\n </div>\n</div>\n\n<!-- Handles are now outside the viewport to prevent clipping -->\n<div\n class=\"crop-handles-overlay\"\n [style]=\"selectionStyle()\">\n <div class=\"crop-handle move-handle\" (mousedown)=\"onDragStart($event, 'move')\"></div>\n <div class=\"crop-handle top-left\" (mousedown)=\"onDragStart($event, 'top-left')\"></div>\n <div class=\"crop-handle top-right\" (mousedown)=\"onDragStart($event, 'top-right')\"></div>\n <div class=\"crop-handle bottom-left\" (mousedown)=\"onDragStart($event, 'bottom-left')\"></div>\n <div class=\"crop-handle bottom-right\" (mousedown)=\"onDragStart($event, 'bottom-right')\"></div>\n\n <div class=\"crop-handle top\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'top')\"></div>\n <div class=\"crop-handle right\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'right')\"></div>\n <div class=\"crop-handle bottom\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'bottom')\"></div>\n <div class=\"crop-handle left\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'left')\"></div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAuDa,IAAI,CAAA;AACf,IAAA,QAAQ,GAAG,KAAK,CAAC,GAAG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AAC,IAAI,CAAC;AAClD,YAAA,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;AAEpD,YAAA,OAAO,YAAY;AACrB,QAAA,CAAC,CAAC;IACJ;uGAjLW,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAJ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAI,omBCvDjB,0wCAwBA,EAAA,MAAA,EAAA,CAAA,+5CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FD+Ba,IAAI,EAAA,UAAA,EAAA,CAAA;kBAVhB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,eAAA,EAGH,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,oBAAoB,EAAE,aAAa;AACnC,wBAAA,sBAAsB,EAAE,gBAAgB;AACzC,qBAAA,EAAA,QAAA,EAAA,0wCAAA,EAAA,MAAA,EAAA,CAAA,+5CAAA,CAAA,EAAA;;;AErDH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngstarter-ui-components-crop.mjs","sources":["../../../projects/components/crop/src/crop/crop.ts","../../../projects/components/crop/src/crop/crop.html","../../../projects/components/crop/ngstarter-ui-components-crop.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nexport interface CropSelection {\n shape: 'rectangle' | 'circle';\n pixels: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n };\n percentages: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n containerWidth: number;\n containerHeight: number;\n}\n\ninterface CropInset {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\ntype DragHandle =\n | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n | 'top' | 'right' | 'bottom' | 'left'\n | 'move';\n\n@Component({\n selector: 'ngs-crop',\n templateUrl: './crop.html',\n styleUrl: './crop.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:mouseup)': 'onDragEnd()',\n '(document:mousemove)': 'onDrag($event)',\n },\n})\nexport class Crop implements AfterViewInit {\n minWidth = input(100);\n minHeight = input(100);\n shape = input<'rectangle' | 'circle'>('rectangle');\n selectionApplied = output<CropSelection>();\n\n isCircle = computed(() => this.shape() === 'circle');\n selection = signal<CropInset>({ top: 20, right: 20, bottom: 20, left: 20 });\n\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private activeDragHandle = signal<DragHandle | null>(null);\n private startDragPosition = signal<{ x: number; y: number } | null>(null);\n private startDragSelection = signal<CropInset | null>(null);\n\n constructor() {\n effect(() => {\n if (this.isCircle() && this.elementRef.nativeElement.isConnected) {\n this.resetSelectionToSquare();\n }\n });\n }\n\n ngAfterViewInit(): void {\n if (this.isCircle()) {\n const hostEl = this.elementRef.nativeElement;\n if (hostEl.offsetWidth > 0) {\n this.resetSelectionToSquare();\n } else {\n const observer = new ResizeObserver(() => {\n if (hostEl.offsetWidth > 0) {\n this.resetSelectionToSquare();\n observer.disconnect();\n }\n });\n observer.observe(hostEl);\n }\n }\n }\n\n private resetSelectionToSquare(): void {\n const hostEl = this.elementRef.nativeElement;\n const hostWidth = hostEl.offsetWidth;\n const hostHeight = hostEl.offsetHeight;\n\n if (hostWidth === 0 || hostHeight === 0) return;\n\n const size = Math.min(hostWidth, hostHeight) * 0.8;\n const left = (hostWidth - size) / 2;\n const top = (hostHeight - size) / 2;\n\n this.selection.set({\n top: top,\n right: (hostWidth - size) / 2,\n bottom: (hostHeight - size) / 2,\n left: left,\n });\n\n // Emit the new selection state after it has been programmatically changed.\n // Use a timeout to avoid potential \"changed after checked\" errors.\n setTimeout(() => this.emitSelection(), 0);\n }\n\n selectionStyle = computed(() => ({\n top: `${this.selection().top}px`,\n right: `${this.selection().right}px`,\n bottom: `${this.selection().bottom}px`,\n left: `${this.selection().left}px`,\n }));\n\n onDragStart(event: MouseEvent, handle: DragHandle): void {\n event.preventDefault();\n event.stopPropagation();\n this.activeDragHandle.set(handle);\n this.startDragPosition.set({ x: event.clientX, y: event.clientY });\n this.startDragSelection.set(this.selection());\n }\n\n onDragEnd(): void {\n if (!this.activeDragHandle()) {\n return;\n }\n this.activeDragHandle.set(null);\n this.emitSelection();\n }\n\n private emitSelection(): void {\n const hostEl = this.elementRef.nativeElement;\n const containerWidth = hostEl.offsetWidth;\n const containerHeight = hostEl.offsetHeight;\n\n if (containerWidth === 0 || containerHeight === 0) {\n return;\n }\n\n const { top, right, bottom, left } = this.selection();\n const width = containerWidth - left - right;\n const height = containerHeight - top - bottom;\n\n this.selectionApplied.emit({\n shape: this.shape(),\n pixels: {\n top,\n right,\n bottom,\n left,\n width,\n height,\n },\n percentages: {\n top: (top / containerHeight) * 100,\n right: (right / containerWidth) * 100,\n bottom: (bottom / containerHeight) * 100,\n left: (left / containerWidth) * 100,\n },\n containerWidth,\n containerHeight,\n });\n }\n\n onDrag(event: MouseEvent): void {\n const handle = this.activeDragHandle();\n if (!handle) return;\n\n const startPos = this.startDragPosition()!;\n const startSelection = this.startDragSelection()!;\n const dx = event.clientX - startPos.x;\n const dy = event.clientY - startPos.y;\n const hostRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n this.selection.update(() => {\n const newSelection = { ...startSelection };\n\n if (handle === 'move') {\n const selectionWidth = hostRect.width - startSelection.left - startSelection.right;\n const selectionHeight = hostRect.height - startSelection.top - startSelection.bottom;\n newSelection.top = Math.max(0, Math.min(startSelection.top + dy, hostRect.height - selectionHeight));\n newSelection.left = Math.max(0, Math.min(startSelection.left + dx, hostRect.width - selectionWidth));\n newSelection.bottom = hostRect.height - newSelection.top - selectionHeight;\n newSelection.right = hostRect.width - newSelection.left - selectionWidth;\n return newSelection;\n }\n\n let currentDx = dx;\n let currentDy = dy;\n\n if (this.isCircle() && handle.includes('-')) {\n if (handle === 'top-left' || handle === 'bottom-right') {\n currentDy = currentDx;\n } else {\n currentDy = -currentDx;\n }\n }\n\n if (handle.includes('top')) newSelection.top = startSelection.top + currentDy;\n if (handle.includes('bottom')) newSelection.bottom = startSelection.bottom - currentDy;\n if (handle.includes('left')) newSelection.left = startSelection.left + currentDx;\n if (handle.includes('right')) newSelection.right = startSelection.right - currentDx;\n\n const minW = this.minWidth();\n const minH = this.isCircle() ? minW : this.minHeight();\n\n if (hostRect.width - newSelection.left - newSelection.right < minW) {\n if (handle.includes('left')) newSelection.left = hostRect.width - newSelection.right - minW;\n else newSelection.right = hostRect.width - newSelection.left - minW;\n }\n if (hostRect.height - newSelection.top - newSelection.bottom < minH) {\n if (handle.includes('top')) newSelection.top = hostRect.height - newSelection.bottom - minH;\n else newSelection.bottom = hostRect.height - newSelection.top - minH;\n }\n\n newSelection.top = Math.max(0, newSelection.top);\n newSelection.bottom = Math.max(0, newSelection.bottom);\n newSelection.left = Math.max(0, newSelection.left);\n newSelection.right = Math.max(0, newSelection.right);\n\n return newSelection;\n });\n }\n}\n","<div class=\"crop-viewport\">\n <ng-content />\n <div\n class=\"crop-selection-area\"\n [class.is-circle]=\"isCircle()\"\n [style]=\"selectionStyle()\">\n </div>\n</div>\n\n<!-- Handles are now outside the viewport to prevent clipping -->\n<div\n class=\"crop-handles-overlay\"\n [style]=\"selectionStyle()\">\n <div class=\"crop-handle move-handle\" (mousedown)=\"onDragStart($event, 'move')\"></div>\n <div class=\"crop-handle top-left\" (mousedown)=\"onDragStart($event, 'top-left')\"></div>\n <div class=\"crop-handle top-right\" (mousedown)=\"onDragStart($event, 'top-right')\"></div>\n <div class=\"crop-handle bottom-left\" (mousedown)=\"onDragStart($event, 'bottom-left')\"></div>\n <div class=\"crop-handle bottom-right\" (mousedown)=\"onDragStart($event, 'bottom-right')\"></div>\n\n <div class=\"crop-handle top\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'top')\"></div>\n <div class=\"crop-handle right\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'right')\"></div>\n <div class=\"crop-handle bottom\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'bottom')\"></div>\n <div class=\"crop-handle left\" [class.hidden]=\"isCircle()\" (mousedown)=\"onDragStart($event, 'left')\"></div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAuDa,IAAI,CAAA;IACf,QAAQ,GAAG,KAAK,CAAC,GAAG;iFAAC;IACrB,SAAS,GAAG,KAAK,CAAC,GAAG;kFAAC;IACtB,KAAK,GAAG,KAAK,CAAyB,WAAW;8EAAC;IAClD,gBAAgB,GAAG,MAAM,EAAiB;IAE1C,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,KAAK,QAAQ;iFAAC;AACpD,IAAA,SAAS,GAAG,MAAM,CAAY,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;kFAAC;AAEnE,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;IACxD,gBAAgB,GAAG,MAAM,CAAoB,IAAI;yFAAC;IAClD,iBAAiB,GAAG,MAAM,CAAkC,IAAI;0FAAC;IACjE,kBAAkB,GAAG,MAAM,CAAmB,IAAI;2FAAC;AAE3D,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;AACV,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE;gBAChE,IAAI,CAAC,sBAAsB,EAAE;YAC/B;AACF,QAAA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1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Renderer2, model, signal, input, booleanAttribute, computed, viewChild, DestroyRef, output, effect, forwardRef, Component } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Renderer2, model, signal, input, booleanAttribute, computed, viewChild, DestroyRef, output, effect, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { NgControl, FormsModule } from '@angular/forms';
|
|
5
5
|
import { FORM_FIELD, FormFieldControl } from '@ngstarter-ui/components/form-field';
|
|
@@ -180,10 +180,14 @@ class CurrencySelect {
|
|
|
180
180
|
stateChanges = new Subject();
|
|
181
181
|
controlType = 'ngs-currency-select';
|
|
182
182
|
autofilled;
|
|
183
|
-
searchTerm = model('',
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
searchTerm = model('', /* @ts-ignore */
|
|
184
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
185
|
+
visibleCurrencyCount = signal(CurrencySelect.CURRENCY_RENDER_CHUNK_SIZE, /* @ts-ignore */
|
|
186
|
+
...(ngDevMode ? [{ debugName: "visibleCurrencyCount" }] : /* istanbul ignore next */ []));
|
|
187
|
+
_valueSignal = signal(null, /* @ts-ignore */
|
|
188
|
+
...(ngDevMode ? [{ debugName: "_valueSignal" }] : /* istanbul ignore next */ []));
|
|
189
|
+
_focusedSignal = signal(false, /* @ts-ignore */
|
|
190
|
+
...(ngDevMode ? [{ debugName: "_focusedSignal" }] : /* istanbul ignore next */ []));
|
|
187
191
|
_touched = false;
|
|
188
192
|
placeholderInputSignal = input('', { ...(ngDevMode ? { debugName: "placeholderInputSignal" } : /* istanbul ignore next */ {}), alias: 'placeholder' });
|
|
189
193
|
isRequiredSignal = model(false, { ...(ngDevMode ? { debugName: "isRequiredSignal" } : /* istanbul ignore next */ {}), alias: 'required' });
|
|
@@ -199,15 +203,20 @@ class CurrencySelect {
|
|
|
199
203
|
const filterValue = term.trim().toLowerCase();
|
|
200
204
|
return currencies.filter(currency => currency.name.toLowerCase().includes(filterValue) ||
|
|
201
205
|
currency.code.toLowerCase().includes(filterValue));
|
|
202
|
-
},
|
|
206
|
+
}, /* @ts-ignore */
|
|
207
|
+
...(ngDevMode ? [{ debugName: "filteredCurrencies" }] : /* istanbul ignore next */ []));
|
|
203
208
|
visibleCurrencies = computed(() => {
|
|
204
209
|
return this.filteredCurrencies().slice(0, this.visibleCurrencyCount());
|
|
205
|
-
},
|
|
210
|
+
}, /* @ts-ignore */
|
|
211
|
+
...(ngDevMode ? [{ debugName: "visibleCurrencies" }] : /* istanbul ignore next */ []));
|
|
206
212
|
selectedCurrencyDisplay = computed(() => {
|
|
207
213
|
return this.internalCurrencies.find(c => c.code === this._valueSignal());
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
}, /* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [{ debugName: "selectedCurrencyDisplay" }] : /* istanbul ignore next */ []));
|
|
216
|
+
ngsSelect = viewChild('ngsSelect', /* @ts-ignore */
|
|
217
|
+
...(ngDevMode ? [{ debugName: "ngsSelect" }] : /* istanbul ignore next */ []));
|
|
218
|
+
searchInput = viewChild('searchInput', /* @ts-ignore */
|
|
219
|
+
...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
211
220
|
fm = inject(FocusMonitor);
|
|
212
221
|
elRef = inject(ElementRef);
|
|
213
222
|
ngControl = inject(NgControl, { self: true, optional: true });
|
|
@@ -417,15 +426,15 @@ class CurrencySelect {
|
|
|
417
426
|
clearTimeout(this._currencySearchFocusTimeout);
|
|
418
427
|
this._currencySearchFocusTimeout = undefined;
|
|
419
428
|
}
|
|
420
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
421
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
429
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CurrencySelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
430
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CurrencySelect, isStandalone: true, selector: "ngs-currency-select", inputs: { searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null }, placeholderInputSignal: { classPropertyName: "placeholderInputSignal", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, isRequiredSignal: { classPropertyName: "isRequiredSignal", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, isDisabledSignal: { classPropertyName: "isDisabledSignal", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showCountryName: { classPropertyName: "showCountryName", publicName: "showCountryName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchTerm: "searchTermChange", isRequiredSignal: "requiredChange", isDisabledSignal: "disabledChange", opened: "opened", closed: "closed" }, host: { listeners: { "focus": "onFocusIn()", "blur": "onFocusOut($event)" }, properties: { "class.floating": "shouldLabelFloat", "id": "id", "attr.tabindex": "disabled ? -1 : 0" }, classAttribute: "ngs-currency-select" }, providers: [
|
|
422
431
|
{
|
|
423
432
|
provide: FormFieldControl,
|
|
424
433
|
useExisting: forwardRef(() => CurrencySelect),
|
|
425
434
|
},
|
|
426
|
-
], viewQueries: [{ propertyName: "ngsSelect", first: true, predicate: ["ngsSelect"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], exportAs: ["ngsCurrencySelect"], ngImport: i0, template: "<ngs-select\n #ngsSelect\n [value]=\"value\"\n (selectionChange)=\"onSelectionChange($event)\"\n (opened)=\"onSelectOpened()\"\n (closed)=\"onSelectClosed()\"\n [placeholder]=\"placeholder\"\n [required]=\"isRequiredSignal()\"\n [disabled]=\"isDisabledSignal()\">\n <ngs-select-trigger class=\"select-trigger\">\n @let selectedCurrency = selectedCurrencyDisplay();\n @if (selectedCurrency) {\n <span class=\"ngs-select-trigger-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ selectedCurrency.flag }}</span>\n <span class=\"ngs-select-trigger-text\">\n <span class=\"currency-code\">\n {{ selectedCurrency.code }}\n <span class=\"currency-symbol\">{{ selectedCurrency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ selectedCurrency.name }}\n }\n </span>\n </span>\n }\n\n @if (!selectedCurrencyDisplay() && placeholder) {\n <span class=\"ngs-select-trigger-text placeholder-text\">\n {{ placeholder }}\n </span>\n }\n </ngs-select-trigger>\n\n <ngs-select-header>\n <div class=\"sticky top-0 z-1 bg-surface-container-lowest\">\n <input #searchInput\n type=\"text\"\n placeholder=\"Search...\"\n autocomplete=\"off\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onCurrencySearch($event)\"\n class=\"w-full
|
|
435
|
+
], viewQueries: [{ propertyName: "ngsSelect", first: true, predicate: ["ngsSelect"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], exportAs: ["ngsCurrencySelect"], ngImport: i0, template: "<ngs-select\n #ngsSelect\n [value]=\"value\"\n (selectionChange)=\"onSelectionChange($event)\"\n (opened)=\"onSelectOpened()\"\n (closed)=\"onSelectClosed()\"\n [placeholder]=\"placeholder\"\n [required]=\"isRequiredSignal()\"\n [disabled]=\"isDisabledSignal()\">\n <ngs-select-trigger class=\"select-trigger\">\n @let selectedCurrency = selectedCurrencyDisplay();\n @if (selectedCurrency) {\n <span class=\"ngs-select-trigger-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ selectedCurrency.flag }}</span>\n <span class=\"ngs-select-trigger-text\">\n <span class=\"currency-code\">\n {{ selectedCurrency.code }}\n <span class=\"currency-symbol\">{{ selectedCurrency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ selectedCurrency.name }}\n }\n </span>\n </span>\n }\n\n @if (!selectedCurrencyDisplay() && placeholder) {\n <span class=\"ngs-select-trigger-text placeholder-text\">\n {{ placeholder }}\n </span>\n }\n </ngs-select-trigger>\n\n <ngs-select-header>\n <div class=\"sticky top-0 z-1 bg-surface-container-lowest\">\n <input #searchInput\n type=\"text\"\n placeholder=\"Search...\"\n autocomplete=\"off\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onCurrencySearch($event)\"\n class=\"h-10 w-full border-b border-surface-container-high px-3 text-sm focus:border-b-primary focus:outline-none\">\n @if (searchTerm().trim()) {\n <div class=\"absolute end-1 top-1/2 -translate-y-1/2\">\n <button\n ngsIconButton\n (click)=\"clearSearch($event)\"\n class=\"clear-button\"\n type=\"button\"\n aria-label=\"Clear search\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n }\n </div>\n </ngs-select-header>\n\n @for (currency of visibleCurrencies(); track currency.code) {\n <ngs-option [value]=\"currency.code\">\n <div class=\"select-option-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ currency.flag }}</span>\n <span class=\"select-option-text\">\n <span class=\"currency-code\">\n {{ currency.code }}\n <span class=\"currency-symbol\">{{ currency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ currency.name }}\n }\n </span>\n </div>\n </ngs-option>\n } @empty {\n @if (searchTerm()) {\n <div class=\"text-sm px-4 py-3\">\n <span i18n>Currency not found</span>.\n </div>\n }\n }\n\n @if (visibleCurrencyCount() < filteredCurrencies().length) {\n <div class=\"select-loading\">\n Loading more currencies...\n </div>\n }\n</ngs-select>\n", styles: [":host{display:block}:host .flag-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none;font-size:18px;line-height:20px}:host .select-option-content{display:flex;align-items:center;gap:var(--ngs-dropdown-item-gap, calc(var(--spacing, .25rem) * 2));min-width:0;width:100%;height:100%;overflow:hidden;white-space:nowrap}:host .select-option-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .placeholder-text{color:var(--ngs-select-placeholder-color, var(--ngs-field-label-color))}:host .currency-code{text-transform:uppercase}:host .currency-symbol{color:var(--ngs-color-neutral-500);display:inline-block;margin-inline-start:.125rem}:host .select-loading{padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface-variant);font-size:var(--ngs-font-size-sm)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Option, selector: "ngs-option", inputs: ["value", "data", "disabled", "selected"], outputs: ["onSelectionChange"], exportAs: ["ngsOption"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: Select, selector: "ngs-select", inputs: ["id", "placeholder", "disabled", "required", "multiple", "hideCheckIcon", "clearable", "dataSource", "pageSize", "searchable", "searchDebounce", "minSearchLength", "loadOnOpen", "aria-label", "tabIndex", "aria-describedby", "value"], outputs: ["selectionChange", "opened", "closed", "valueChange"], exportAs: ["ngsSelect"] }, { kind: "component", type: SelectHeader, selector: "ngs-select-header" }, { kind: "directive", type: SelectTrigger, selector: "ngs-select-trigger" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
427
436
|
}
|
|
428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CurrencySelect, decorators: [{
|
|
429
438
|
type: Component,
|
|
430
439
|
args: [{ selector: 'ngs-currency-select', exportAs: 'ngsCurrencySelect', providers: [
|
|
431
440
|
{
|
|
@@ -439,7 +448,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
439
448
|
'[attr.tabindex]': 'disabled ? -1 : 0',
|
|
440
449
|
'(focus)': 'onFocusIn()',
|
|
441
450
|
'(blur)': 'onFocusOut($event)',
|
|
442
|
-
}, imports: [
|
|
451
|
+
}, changeDetection: ChangeDetectionStrategy.Eager, imports: [
|
|
443
452
|
Option,
|
|
444
453
|
Icon,
|
|
445
454
|
Select,
|
|
@@ -447,7 +456,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
447
456
|
SelectTrigger,
|
|
448
457
|
FormsModule,
|
|
449
458
|
Button
|
|
450
|
-
], template: "<ngs-select\n #ngsSelect\n [value]=\"value\"\n (selectionChange)=\"onSelectionChange($event)\"\n (opened)=\"onSelectOpened()\"\n (closed)=\"onSelectClosed()\"\n [placeholder]=\"placeholder\"\n [required]=\"isRequiredSignal()\"\n [disabled]=\"isDisabledSignal()\">\n <ngs-select-trigger class=\"select-trigger\">\n @let selectedCurrency = selectedCurrencyDisplay();\n @if (selectedCurrency) {\n <span class=\"ngs-select-trigger-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ selectedCurrency.flag }}</span>\n <span class=\"ngs-select-trigger-text\">\n <span class=\"currency-code\">\n {{ selectedCurrency.code }}\n <span class=\"currency-symbol\">{{ selectedCurrency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ selectedCurrency.name }}\n }\n </span>\n </span>\n }\n\n @if (!selectedCurrencyDisplay() && placeholder) {\n <span class=\"ngs-select-trigger-text placeholder-text\">\n {{ placeholder }}\n </span>\n }\n </ngs-select-trigger>\n\n <ngs-select-header>\n <div class=\"sticky top-0 z-1 bg-surface-container-lowest\">\n <input #searchInput\n type=\"text\"\n placeholder=\"Search...\"\n autocomplete=\"off\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onCurrencySearch($event)\"\n class=\"w-full
|
|
459
|
+
], template: "<ngs-select\n #ngsSelect\n [value]=\"value\"\n (selectionChange)=\"onSelectionChange($event)\"\n (opened)=\"onSelectOpened()\"\n (closed)=\"onSelectClosed()\"\n [placeholder]=\"placeholder\"\n [required]=\"isRequiredSignal()\"\n [disabled]=\"isDisabledSignal()\">\n <ngs-select-trigger class=\"select-trigger\">\n @let selectedCurrency = selectedCurrencyDisplay();\n @if (selectedCurrency) {\n <span class=\"ngs-select-trigger-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ selectedCurrency.flag }}</span>\n <span class=\"ngs-select-trigger-text\">\n <span class=\"currency-code\">\n {{ selectedCurrency.code }}\n <span class=\"currency-symbol\">{{ selectedCurrency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ selectedCurrency.name }}\n }\n </span>\n </span>\n }\n\n @if (!selectedCurrencyDisplay() && placeholder) {\n <span class=\"ngs-select-trigger-text placeholder-text\">\n {{ placeholder }}\n </span>\n }\n </ngs-select-trigger>\n\n <ngs-select-header>\n <div class=\"sticky top-0 z-1 bg-surface-container-lowest\">\n <input #searchInput\n type=\"text\"\n placeholder=\"Search...\"\n autocomplete=\"off\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onCurrencySearch($event)\"\n class=\"h-10 w-full border-b border-surface-container-high px-3 text-sm focus:border-b-primary focus:outline-none\">\n @if (searchTerm().trim()) {\n <div class=\"absolute end-1 top-1/2 -translate-y-1/2\">\n <button\n ngsIconButton\n (click)=\"clearSearch($event)\"\n class=\"clear-button\"\n type=\"button\"\n aria-label=\"Clear search\">\n <ngs-icon name=\"fluent:dismiss-24-regular\"/>\n </button>\n </div>\n }\n </div>\n </ngs-select-header>\n\n @for (currency of visibleCurrencies(); track currency.code) {\n <ngs-option [value]=\"currency.code\">\n <div class=\"select-option-content\">\n <span class=\"flag-icon\" aria-hidden=\"true\">{{ currency.flag }}</span>\n <span class=\"select-option-text\">\n <span class=\"currency-code\">\n {{ currency.code }}\n <span class=\"currency-symbol\">{{ currency.symbol }}</span>\n </span>\n @if (showCountryName()) {\n – {{ currency.name }}\n }\n </span>\n </div>\n </ngs-option>\n } @empty {\n @if (searchTerm()) {\n <div class=\"text-sm px-4 py-3\">\n <span i18n>Currency not found</span>.\n </div>\n }\n }\n\n @if (visibleCurrencyCount() < filteredCurrencies().length) {\n <div class=\"select-loading\">\n Loading more currencies...\n </div>\n }\n</ngs-select>\n", styles: [":host{display:block}:host .flag-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none;font-size:18px;line-height:20px}:host .select-option-content{display:flex;align-items:center;gap:var(--ngs-dropdown-item-gap, calc(var(--spacing, .25rem) * 2));min-width:0;width:100%;height:100%;overflow:hidden;white-space:nowrap}:host .select-option-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .placeholder-text{color:var(--ngs-select-placeholder-color, var(--ngs-field-label-color))}:host .currency-code{text-transform:uppercase}:host .currency-symbol{color:var(--ngs-color-neutral-500);display:inline-block;margin-inline-start:.125rem}:host .select-loading{padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 4);color:var(--ngs-color-on-surface-variant);font-size:var(--ngs-font-size-sm)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
451
460
|
}], ctorParameters: () => [], propDecorators: { searchTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTerm", required: false }] }, { type: i0.Output, args: ["searchTermChange"] }], placeholderInputSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], isRequiredSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }, { type: i0.Output, args: ["requiredChange"] }], isDisabledSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], showCountryName: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCountryName", required: false }] }], ngsSelect: [{ type: i0.ViewChild, args: ['ngsSelect', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
452
461
|
|
|
453
462
|
/**
|