@elementar-rt/components 0.6.56 → 0.6.57
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 +49 -49
- package/badge/index.d.ts +18 -0
- package/bottom-sheet/index.d.ts +32 -0
- package/button-toggle/index.d.ts +33 -0
- package/calendar/index.d.ts +44 -0
- package/card/index.d.ts +32 -0
- package/chips/index.d.ts +23 -0
- package/clipboard-copy/index.d.ts +28 -0
- package/code-highlighter/index.d.ts +5 -1
- package/combobox/index.d.ts +38 -0
- package/content-editor/index.d.ts +18 -0
- package/dashboard/index.d.ts +1 -1
- package/data-grid/index.d.ts +64 -0
- package/datepicker/index.d.ts +32 -0
- package/dialog/index.d.ts +48 -0
- package/digit-roller/index.d.ts +18 -0
- package/empty-state/index.d.ts +17 -0
- package/expansion-panel/index.d.ts +12 -0
- package/fesm2022/elementar-rt-components-action-required.mjs +4 -4
- package/fesm2022/elementar-rt-components-action-required.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-alert.mjs +17 -17
- package/fesm2022/elementar-rt-components-alert.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-announcement.mjs +8 -8
- package/fesm2022/elementar-rt-components-announcement.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-avatar.mjs +22 -22
- package/fesm2022/elementar-rt-components-avatar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-badge.mjs +38 -0
- package/fesm2022/elementar-rt-components-badge.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-block-loader.mjs +7 -7
- package/fesm2022/elementar-rt-components-block-loader.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-block-state.mjs +24 -24
- package/fesm2022/elementar-rt-components-block-state.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-bottom-sheet.mjs +71 -0
- package/fesm2022/elementar-rt-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-brand-colors.mjs +5 -5
- package/fesm2022/elementar-rt-components-brand-colors.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs +41 -41
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-button-toggle.mjs +89 -0
- package/fesm2022/elementar-rt-components-button-toggle.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-calendar.mjs +130 -0
- package/fesm2022/elementar-rt-components-calendar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-card-overlay.mjs +7 -7
- package/fesm2022/elementar-rt-components-card-overlay.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-card.mjs +60 -0
- package/fesm2022/elementar-rt-components-card.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-carousel.mjs +22 -22
- package/fesm2022/elementar-rt-components-carousel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-chips.mjs +54 -0
- package/fesm2022/elementar-rt-components-chips.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-clipboard-copy.mjs +115 -0
- package/fesm2022/elementar-rt-components-clipboard-copy.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-code-highlighter.mjs +19 -6
- package/fesm2022/elementar-rt-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-color-picker.mjs +27 -27
- package/fesm2022/elementar-rt-components-color-picker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-color-scheme.mjs +10 -10
- package/fesm2022/elementar-rt-components-color-scheme.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-combobox.mjs +70 -0
- package/fesm2022/elementar-rt-components-combobox.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-command-bar.mjs +12 -12
- package/fesm2022/elementar-rt-components-command-bar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-comment-editor.mjs +82 -82
- package/fesm2022/elementar-rt-components-comment-editor.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-comparison-slider.mjs +10 -10
- package/fesm2022/elementar-rt-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-confirm.mjs +7 -7
- package/fesm2022/elementar-rt-components-confirm.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-content-editor.mjs +121 -0
- package/fesm2022/elementar-rt-components-content-editor.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-content-fade.mjs +4 -4
- package/fesm2022/elementar-rt-components-content-fade.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-cookie-popup.mjs +13 -13
- package/fesm2022/elementar-rt-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-core.mjs +64 -64
- package/fesm2022/elementar-rt-components-core.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-country-select.mjs +5 -5
- package/fesm2022/elementar-rt-components-country-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-crop.mjs +4 -4
- package/fesm2022/elementar-rt-components-crop.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-currency-select.mjs +5 -5
- package/fesm2022/elementar-rt-components-currency-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-dashboard.mjs +9 -9
- package/fesm2022/elementar-rt-components-dashboard.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-data-grid.mjs +120 -0
- package/fesm2022/elementar-rt-components-data-grid.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-data-view.mjs +17 -17
- package/fesm2022/elementar-rt-components-data-view.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-date-format-select.mjs +5 -5
- package/fesm2022/elementar-rt-components-date-format-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-datepicker.mjs +81 -0
- package/fesm2022/elementar-rt-components-datepicker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-dialog.mjs +97 -0
- package/fesm2022/elementar-rt-components-dialog.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-digit-roller.mjs +41 -0
- package/fesm2022/elementar-rt-components-digit-roller.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-divider.mjs +8 -8
- package/fesm2022/elementar-rt-components-divider.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-drawer.mjs +8 -8
- package/fesm2022/elementar-rt-components-drawer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-emoji-picker.mjs +7 -7
- package/fesm2022/elementar-rt-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-empty-state.mjs +35 -0
- package/fesm2022/elementar-rt-components-empty-state.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-expand.mjs +4 -4
- package/fesm2022/elementar-rt-components-expand.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-expansion-panel.mjs +32 -0
- package/fesm2022/elementar-rt-components-expansion-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-filter-builder.mjs +13 -13
- package/fesm2022/elementar-rt-components-filter-builder.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-filter-select.mjs +126 -0
- package/fesm2022/elementar-rt-components-filter-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs +123 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs +40 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs.map +1 -0
- package/fesm2022/{elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs → elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs} +5 -5
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs.map +1 -0
- package/fesm2022/{elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs → elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs} +5 -5
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs +33 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-9BLv1MsP.mjs +38 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-9BLv1MsP.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-C97pIEdh.mjs +39 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-C97pIEdh.mjs.map +1 -0
- package/fesm2022/{elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs → elementar-rt-components-form-renderer-text-content.component-CJxCc5vX.mjs} +5 -5
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-CJxCc5vX.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-CCtWiJOk.mjs +37 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-CCtWiJOk.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-GvZgdvUX.mjs +35 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-GvZgdvUX.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-DBiIiV-9.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-DBiIiV-9.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer.mjs +29 -29
- package/fesm2022/elementar-rt-components-form-renderer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-gauge.mjs +8 -8
- package/fesm2022/elementar-rt-components-gauge.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-grid.mjs +37 -0
- package/fesm2022/elementar-rt-components-grid.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-guided-tour.mjs +161 -0
- package/fesm2022/elementar-rt-components-guided-tour.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-headless-stepper.mjs +72 -0
- package/fesm2022/elementar-rt-components-headless-stepper.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-icon.mjs +4 -4
- package/fesm2022/elementar-rt-components-icon.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-placeholder.mjs +30 -0
- package/fesm2022/elementar-rt-components-image-placeholder.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-image-resizer.mjs +10 -10
- package/fesm2022/elementar-rt-components-image-resizer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-viewer.mjs +19 -19
- package/fesm2022/elementar-rt-components-image-viewer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-zoom-viewer.mjs +97 -0
- package/fesm2022/elementar-rt-components-image-zoom-viewer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-incidents.mjs +49 -49
- package/fesm2022/elementar-rt-components-incidents.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs +4 -4
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-input-mask.mjs +9 -9
- package/fesm2022/elementar-rt-components-input-mask.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-input-validator.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-kanban-board.mjs +7 -7
- package/fesm2022/elementar-rt-components-kanban-board.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-keyboard.mjs +63 -0
- package/fesm2022/elementar-rt-components-keyboard.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-layout.mjs +32 -32
- package/fesm2022/elementar-rt-components-layout.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-list.mjs +43 -0
- package/fesm2022/elementar-rt-components-list.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-logo.mjs +12 -12
- package/fesm2022/elementar-rt-components-logo.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-marquee.mjs +7 -7
- package/fesm2022/elementar-rt-components-marquee.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-menu.mjs +94 -0
- package/fesm2022/elementar-rt-components-menu.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-micro-chart.mjs +24 -24
- package/fesm2022/elementar-rt-components-micro-chart.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-multi-select.mjs +66 -0
- package/fesm2022/elementar-rt-components-multi-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-navigation.mjs +39 -39
- package/fesm2022/elementar-rt-components-navigation.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-notifications.mjs +40 -40
- package/fesm2022/elementar-rt-components-notifications.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-number-input.mjs +17 -17
- package/fesm2022/elementar-rt-components-number-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs +4 -4
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-overlay.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs +4 -4
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-paginator.mjs +50 -0
- package/fesm2022/elementar-rt-components-paginator.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-panel.mjs +24 -24
- package/fesm2022/elementar-rt-components-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-password-strength.mjs +13 -13
- package/fesm2022/elementar-rt-components-password-strength.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-phone-input.mjs +11 -11
- package/fesm2022/elementar-rt-components-phone-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-pin-input.mjs +8 -8
- package/fesm2022/elementar-rt-components-pin-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-popover.mjs +10 -10
- package/fesm2022/elementar-rt-components-popover.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-progress-bar.mjs +32 -0
- package/fesm2022/elementar-rt-components-progress-bar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-progress-spinner.mjs +94 -0
- package/fesm2022/elementar-rt-components-progress-spinner.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-radio-card.mjs +17 -17
- package/fesm2022/elementar-rt-components-radio-card.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-rail-nav.mjs +12 -12
- package/fesm2022/elementar-rt-components-rail-nav.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-rating.mjs +84 -0
- package/fesm2022/elementar-rt-components-rating.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-resizable-container.mjs +4 -4
- package/fesm2022/elementar-rt-components-resizable-container.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-screen-loader.mjs +4 -4
- package/fesm2022/elementar-rt-components-screen-loader.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-scroll-spy.mjs +16 -16
- package/fesm2022/elementar-rt-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-segmented.mjs +12 -12
- package/fesm2022/elementar-rt-components-segmented.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-side-panel.mjs +8 -8
- package/fesm2022/elementar-rt-components-side-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-sidebar.mjs +61 -61
- package/fesm2022/elementar-rt-components-sidebar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-sidenav.mjs +72 -0
- package/fesm2022/elementar-rt-components-sidenav.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-signature-pad.mjs +4 -4
- package/fesm2022/elementar-rt-components-signature-pad.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-skeleton.mjs +16 -16
- package/fesm2022/elementar-rt-components-skeleton.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-slider.mjs +64 -0
- package/fesm2022/elementar-rt-components-slider.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-snackbar.mjs +81 -0
- package/fesm2022/elementar-rt-components-snackbar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-sort.mjs +69 -0
- package/fesm2022/elementar-rt-components-sort.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-splash-screen.mjs +4 -4
- package/fesm2022/elementar-rt-components-splash-screen.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-split-pane.mjs +70 -0
- package/fesm2022/elementar-rt-components-split-pane.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-stat-card.mjs +27 -0
- package/fesm2022/elementar-rt-components-stat-card.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-step-tracker.mjs +30 -0
- package/fesm2022/elementar-rt-components-step-tracker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-stepper.mjs +6 -6
- package/fesm2022/elementar-rt-components-stepper.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-suggestions.mjs +18 -18
- package/fesm2022/elementar-rt-components-suggestions.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tab-panel.mjs +48 -48
- package/fesm2022/elementar-rt-components-tab-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-table.mjs +84 -0
- package/fesm2022/elementar-rt-components-table.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tabs.mjs +59 -0
- package/fesm2022/elementar-rt-components-tabs.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tag.mjs +28 -0
- package/fesm2022/elementar-rt-components-tag.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-text-editor.mjs +85 -85
- package/fesm2022/elementar-rt-components-text-editor.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs +7 -7
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tiles.mjs +35 -0
- package/fesm2022/elementar-rt-components-tiles.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timeline.mjs +39 -39
- package/fesm2022/elementar-rt-components-timeline.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-timepicker.mjs +75 -0
- package/fesm2022/elementar-rt-components-timepicker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timezone-select.mjs +8 -8
- package/fesm2022/elementar-rt-components-timezone-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-toast.mjs +98 -0
- package/fesm2022/elementar-rt-components-toast.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-toolbar.mjs +24 -0
- package/fesm2022/elementar-rt-components-toolbar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tooltip.mjs +119 -0
- package/fesm2022/elementar-rt-components-tooltip.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tree.mjs +77 -0
- package/fesm2022/elementar-rt-components-tree.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-upload.mjs +57 -57
- package/fesm2022/elementar-rt-components-upload.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-video-player.mjs +144 -0
- package/fesm2022/elementar-rt-components-video-player.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-video-viewer.mjs +98 -0
- package/fesm2022/elementar-rt-components-video-viewer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components.mjs.map +1 -1
- package/filter-select/index.d.ts +40 -0
- package/grid/index.d.ts +24 -0
- package/guided-tour/index.d.ts +45 -0
- package/headless-stepper/index.d.ts +30 -0
- package/image-placeholder/index.d.ts +18 -0
- package/image-zoom-viewer/index.d.ts +33 -0
- package/keyboard/index.d.ts +13 -0
- package/list/index.d.ts +18 -0
- package/menu/index.d.ts +38 -0
- package/multi-select/index.d.ts +36 -0
- package/package.json +225 -33
- package/paginator/index.d.ts +26 -0
- package/progress-bar/index.d.ts +17 -0
- package/progress-spinner/index.d.ts +19 -0
- package/rating/index.d.ts +30 -0
- package/sidenav/index.d.ts +31 -0
- package/slider/index.d.ts +26 -0
- package/snackbar/index.d.ts +36 -0
- package/sort/index.d.ts +27 -0
- package/split-pane/index.d.ts +25 -0
- package/stat-card/index.d.ts +16 -0
- package/step-tracker/index.d.ts +21 -0
- package/styles/_common.scss +777 -776
- package/styles/themes/cyan-orange.scss +41 -41
- package/styles/themes/default.scss +5 -5
- package/styles/themes/magenta-violet.scss +41 -41
- package/styles/themes/rose-red.scss +41 -41
- package/table/index.d.ts +44 -0
- package/tabs/index.d.ts +26 -0
- package/tag/index.d.ts +17 -0
- package/tiles/index.d.ts +14 -0
- package/timepicker/index.d.ts +29 -0
- package/toast/index.d.ts +48 -0
- package/toolbar/index.d.ts +10 -0
- package/tooltip/index.d.ts +30 -0
- package/tree/index.d.ts +42 -0
- package/video-player/index.d.ts +49 -0
- package/video-viewer/index.d.ts +33 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs +0 -123
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs +0 -22
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs +0 -40
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs +0 -33
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs +0 -38
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs +0 -39
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs +0 -37
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs +0 -35
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs.map +0 -1
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs +0 -22
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { KeyValuePipe } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
class FilterSelectComponent {
|
|
8
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
9
|
+
placeholder = input('Select…', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
10
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
11
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
12
|
+
clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
13
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
14
|
+
valueChange = output();
|
|
15
|
+
_open = signal(false, ...(ngDevMode ? [{ debugName: "_open" }] : []));
|
|
16
|
+
_search = signal('', ...(ngDevMode ? [{ debugName: "_search" }] : []));
|
|
17
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
18
|
+
_selected = computed(() => {
|
|
19
|
+
const v = this._value();
|
|
20
|
+
if (this.multiple())
|
|
21
|
+
return Array.isArray(v) ? v : [];
|
|
22
|
+
return v;
|
|
23
|
+
}, ...(ngDevMode ? [{ debugName: "_selected" }] : []));
|
|
24
|
+
_hasValue = computed(() => {
|
|
25
|
+
const s = this._selected();
|
|
26
|
+
if (this.multiple())
|
|
27
|
+
return Array.isArray(s) && s.length > 0;
|
|
28
|
+
return s !== null && s !== undefined;
|
|
29
|
+
}, ...(ngDevMode ? [{ debugName: "_hasValue" }] : []));
|
|
30
|
+
_displayLabel = computed(() => {
|
|
31
|
+
const v = this._value();
|
|
32
|
+
if (this.multiple()) {
|
|
33
|
+
const arr = Array.isArray(v) ? v : [];
|
|
34
|
+
if (!arr.length)
|
|
35
|
+
return this.placeholder();
|
|
36
|
+
const labels = arr.map(val => this.options().find(o => o.value === val)?.label ?? val);
|
|
37
|
+
return labels.length <= 2 ? labels.join(', ') : `${labels.slice(0, 2).join(', ')} +${labels.length - 2}`;
|
|
38
|
+
}
|
|
39
|
+
const opt = this.options().find(o => o.value === v);
|
|
40
|
+
return opt?.label ?? this.placeholder();
|
|
41
|
+
}, ...(ngDevMode ? [{ debugName: "_displayLabel" }] : []));
|
|
42
|
+
_filtered = computed(() => {
|
|
43
|
+
const q = this._search().toLowerCase();
|
|
44
|
+
return this.options().filter(o => o.label.toLowerCase().includes(q));
|
|
45
|
+
}, ...(ngDevMode ? [{ debugName: "_filtered" }] : []));
|
|
46
|
+
_groups = computed(() => {
|
|
47
|
+
const grouped = new Map();
|
|
48
|
+
for (const o of this._filtered()) {
|
|
49
|
+
const g = o.group ?? '';
|
|
50
|
+
if (!grouped.has(g))
|
|
51
|
+
grouped.set(g, []);
|
|
52
|
+
grouped.get(g).push(o);
|
|
53
|
+
}
|
|
54
|
+
return grouped;
|
|
55
|
+
}, ...(ngDevMode ? [{ debugName: "_groups" }] : []));
|
|
56
|
+
_onChange = (_) => { };
|
|
57
|
+
_onTouched = () => { };
|
|
58
|
+
writeValue(val) { this._value.set(val); }
|
|
59
|
+
registerOnChange(fn) { this._onChange = fn; }
|
|
60
|
+
registerOnTouched(fn) { this._onTouched = fn; }
|
|
61
|
+
setDisabledState(_) { }
|
|
62
|
+
_toggle() {
|
|
63
|
+
if (this.disabled())
|
|
64
|
+
return;
|
|
65
|
+
this._open.set(!this._open());
|
|
66
|
+
if (this._open())
|
|
67
|
+
this._search.set('');
|
|
68
|
+
}
|
|
69
|
+
_select(opt) {
|
|
70
|
+
let newVal;
|
|
71
|
+
if (this.multiple()) {
|
|
72
|
+
const arr = Array.isArray(this._value()) ? [...this._value()] : [];
|
|
73
|
+
const idx = arr.indexOf(opt.value);
|
|
74
|
+
if (idx >= 0)
|
|
75
|
+
arr.splice(idx, 1);
|
|
76
|
+
else
|
|
77
|
+
arr.push(opt.value);
|
|
78
|
+
newVal = arr;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
newVal = opt.value;
|
|
82
|
+
this._open.set(false);
|
|
83
|
+
}
|
|
84
|
+
this._value.set(newVal);
|
|
85
|
+
this._onChange(newVal);
|
|
86
|
+
this._onTouched();
|
|
87
|
+
this.valueChange.emit(newVal);
|
|
88
|
+
}
|
|
89
|
+
_isSelected(opt) {
|
|
90
|
+
if (this.multiple()) {
|
|
91
|
+
return Array.isArray(this._value()) && this._value().includes(opt.value);
|
|
92
|
+
}
|
|
93
|
+
return this._value() === opt.value;
|
|
94
|
+
}
|
|
95
|
+
_clear(e) {
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
const v = this.multiple() ? [] : null;
|
|
98
|
+
this._value.set(v);
|
|
99
|
+
this._onChange(v);
|
|
100
|
+
this._onTouched();
|
|
101
|
+
}
|
|
102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: FilterSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: FilterSelectComponent, isStandalone: true, selector: "emr-filter-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.data-open": "_open() || null", "attr.data-disabled": "disabled() || null" } }, providers: [{
|
|
104
|
+
provide: NG_VALUE_ACCESSOR,
|
|
105
|
+
useExisting: forwardRef(() => FilterSelectComponent),
|
|
106
|
+
multi: true
|
|
107
|
+
}], ngImport: i0, template: "<div class=\"fs-trigger\" (click)=\"_toggle()\">\n <span class=\"fs-display\">{{ _displayLabel() }}</span>\n <div class=\"fs-controls\">\n @if (clearable() && _hasValue()) {\n <button type=\"button\" class=\"fs-clear\" (click)=\"_clear($event)\" aria-label=\"Clear\">\u00D7</button>\n }\n <span class=\"fs-arrow\" [attr.data-open]=\"_open() || null\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </span>\n </div>\n</div>\n\n@if (_open()) {\n <div class=\"fs-dropdown\">\n <div class=\"fs-search-wrap\">\n <input\n class=\"fs-search\"\n type=\"text\"\n placeholder=\"Search\u2026\"\n [ngModel]=\"_search()\"\n (ngModelChange)=\"_search.set($event)\"\n autofocus\n (click)=\"$event.stopPropagation()\"\n />\n </div>\n\n @if (loading()) {\n <div class=\"fs-loading\">Loading options\u2026</div>\n } @else if (_filtered().length === 0) {\n <div class=\"fs-empty\">No options found</div>\n } @else {\n <ul class=\"fs-list\" role=\"listbox\">\n @for (entry of _groups() | keyvalue; track entry.key) {\n @if (entry.key) {\n <li class=\"fs-group-label\">{{ entry.key }}</li>\n }\n @for (opt of entry.value; track opt.value) {\n <li\n class=\"fs-option\"\n role=\"option\"\n [attr.data-selected]=\"_isSelected(opt) || null\"\n (click)=\"_select(opt)\"\n >\n @if (multiple()) {\n <span class=\"fs-checkbox\" [attr.data-checked]=\"_isSelected(opt) || null\">\u2713</span>\n }\n {{ opt.label }}\n </li>\n }\n }\n </ul>\n }\n </div>\n}\n", styles: [":host{position:relative;display:block;font-size:.875rem;-webkit-user-select:none;user-select:none}.fs-trigger{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border:1px solid var(--color-outline-variant);border-radius:.5rem;background:var(--color-surface);cursor:pointer;min-height:calc(var(--spacing, .25rem) * 10);transition:border-color .15s ease}.fs-trigger:hover{border-color:var(--color-outline)}:host([data-open]) .fs-trigger{border-color:var(--color-primary)}:host([data-disabled]) .fs-trigger{opacity:.5;pointer-events:none}.fs-display{flex:1;color:var(--color-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fs-controls{display:flex;align-items:center;gap:var(--spacing, .25rem);flex-shrink:0}.fs-clear{font-size:1rem;line-height:1;padding:0 var(--spacing, .25rem);background:none;border:none;cursor:pointer;color:var(--color-on-surface-variant);border-radius:.25rem}.fs-clear:hover{color:var(--color-on-surface)}.fs-arrow{color:var(--color-on-surface-variant);display:flex;align-items:center;transition:transform .15s ease}.fs-arrow svg{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4)}.fs-arrow[data-open]{transform:rotate(180deg)}.fs-dropdown{position:absolute;top:calc(100% + var(--spacing, .25rem));left:0;right:0;background:var(--color-surface-container-high);border:1px solid var(--color-outline-variant);border-radius:.75rem;box-shadow:0 8px 24px var(--color-shadow);z-index:100;overflow:hidden;max-height:calc(var(--spacing, .25rem) * 72);display:flex;flex-direction:column}@supports (color: color-mix(in lab,red,red)){.fs-dropdown{box-shadow:0 8px 24px color-mix(in srgb,var(--color-shadow) 12%,transparent)}}.fs-search-wrap{padding:calc(var(--spacing, .25rem) * 2);border-bottom:1px solid var(--color-outline-variant)}.fs-search{width:100%;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);border:1px solid var(--color-outline-variant);border-radius:.5rem;background:var(--color-surface);font-size:.875rem;color:var(--color-on-surface);outline:none}.fs-search:focus{border-color:var(--color-primary)}.fs-list{list-style:none;margin:0;padding:var(--spacing, .25rem);overflow-y:auto;flex:1}.fs-group-label{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--color-on-surface-variant);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}.fs-option{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:.5rem;cursor:pointer;color:var(--color-on-surface);transition:background .1s ease}.fs-option:hover{background:var(--color-surface-container)}.fs-option[data-selected]{background:var(--color-primary-container);color:var(--color-on-primary-container)}.fs-checkbox{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center;justify-content:center;border:2px solid var(--color-outline-variant);border-radius:.25rem;font-size:.75rem;font-weight:700;color:transparent;flex-shrink:0}.fs-checkbox[data-checked]{border-color:var(--color-primary);background:var(--color-primary);color:var(--color-on-primary)}.fs-loading,.fs-empty{padding:calc(var(--spacing, .25rem) * 6);text-align:center;color:var(--color-on-surface-variant);font-size:.875rem}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[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: "pipe", type: KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: FilterSelectComponent, decorators: [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{ selector: 'emr-filter-select', standalone: true, imports: [FormsModule, KeyValuePipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
|
|
112
|
+
provide: NG_VALUE_ACCESSOR,
|
|
113
|
+
useExisting: forwardRef(() => FilterSelectComponent),
|
|
114
|
+
multi: true
|
|
115
|
+
}], host: {
|
|
116
|
+
'[attr.data-open]': '_open() || null',
|
|
117
|
+
'[attr.data-disabled]': 'disabled() || null',
|
|
118
|
+
}, template: "<div class=\"fs-trigger\" (click)=\"_toggle()\">\n <span class=\"fs-display\">{{ _displayLabel() }}</span>\n <div class=\"fs-controls\">\n @if (clearable() && _hasValue()) {\n <button type=\"button\" class=\"fs-clear\" (click)=\"_clear($event)\" aria-label=\"Clear\">\u00D7</button>\n }\n <span class=\"fs-arrow\" [attr.data-open]=\"_open() || null\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </span>\n </div>\n</div>\n\n@if (_open()) {\n <div class=\"fs-dropdown\">\n <div class=\"fs-search-wrap\">\n <input\n class=\"fs-search\"\n type=\"text\"\n placeholder=\"Search\u2026\"\n [ngModel]=\"_search()\"\n (ngModelChange)=\"_search.set($event)\"\n autofocus\n (click)=\"$event.stopPropagation()\"\n />\n </div>\n\n @if (loading()) {\n <div class=\"fs-loading\">Loading options\u2026</div>\n } @else if (_filtered().length === 0) {\n <div class=\"fs-empty\">No options found</div>\n } @else {\n <ul class=\"fs-list\" role=\"listbox\">\n @for (entry of _groups() | keyvalue; track entry.key) {\n @if (entry.key) {\n <li class=\"fs-group-label\">{{ entry.key }}</li>\n }\n @for (opt of entry.value; track opt.value) {\n <li\n class=\"fs-option\"\n role=\"option\"\n [attr.data-selected]=\"_isSelected(opt) || null\"\n (click)=\"_select(opt)\"\n >\n @if (multiple()) {\n <span class=\"fs-checkbox\" [attr.data-checked]=\"_isSelected(opt) || null\">\u2713</span>\n }\n {{ opt.label }}\n </li>\n }\n }\n </ul>\n }\n </div>\n}\n", styles: [":host{position:relative;display:block;font-size:.875rem;-webkit-user-select:none;user-select:none}.fs-trigger{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border:1px solid var(--color-outline-variant);border-radius:.5rem;background:var(--color-surface);cursor:pointer;min-height:calc(var(--spacing, .25rem) * 10);transition:border-color .15s ease}.fs-trigger:hover{border-color:var(--color-outline)}:host([data-open]) .fs-trigger{border-color:var(--color-primary)}:host([data-disabled]) .fs-trigger{opacity:.5;pointer-events:none}.fs-display{flex:1;color:var(--color-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fs-controls{display:flex;align-items:center;gap:var(--spacing, .25rem);flex-shrink:0}.fs-clear{font-size:1rem;line-height:1;padding:0 var(--spacing, .25rem);background:none;border:none;cursor:pointer;color:var(--color-on-surface-variant);border-radius:.25rem}.fs-clear:hover{color:var(--color-on-surface)}.fs-arrow{color:var(--color-on-surface-variant);display:flex;align-items:center;transition:transform .15s ease}.fs-arrow svg{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4)}.fs-arrow[data-open]{transform:rotate(180deg)}.fs-dropdown{position:absolute;top:calc(100% + var(--spacing, .25rem));left:0;right:0;background:var(--color-surface-container-high);border:1px solid var(--color-outline-variant);border-radius:.75rem;box-shadow:0 8px 24px var(--color-shadow);z-index:100;overflow:hidden;max-height:calc(var(--spacing, .25rem) * 72);display:flex;flex-direction:column}@supports (color: color-mix(in lab,red,red)){.fs-dropdown{box-shadow:0 8px 24px color-mix(in srgb,var(--color-shadow) 12%,transparent)}}.fs-search-wrap{padding:calc(var(--spacing, .25rem) * 2);border-bottom:1px solid var(--color-outline-variant)}.fs-search{width:100%;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2);border:1px solid var(--color-outline-variant);border-radius:.5rem;background:var(--color-surface);font-size:.875rem;color:var(--color-on-surface);outline:none}.fs-search:focus{border-color:var(--color-primary)}.fs-list{list-style:none;margin:0;padding:var(--spacing, .25rem);overflow-y:auto;flex:1}.fs-group-label{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--color-on-surface-variant);padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 2)}.fs-option{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:.5rem;cursor:pointer;color:var(--color-on-surface);transition:background .1s ease}.fs-option:hover{background:var(--color-surface-container)}.fs-option[data-selected]{background:var(--color-primary-container);color:var(--color-on-primary-container)}.fs-checkbox{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center;justify-content:center;border:2px solid var(--color-outline-variant);border-radius:.25rem;font-size:.75rem;font-weight:700;color:transparent;flex-shrink:0}.fs-checkbox[data-checked]{border-color:var(--color-primary);background:var(--color-primary);color:var(--color-on-primary)}.fs-loading,.fs-empty{padding:calc(var(--spacing, .25rem) * 6);text-align:center;color:var(--color-on-surface-variant);font-size:.875rem}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
119
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Generated bundle index. Do not edit.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
export { FilterSelectComponent };
|
|
126
|
+
//# sourceMappingURL=elementar-rt-components-filter-select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-filter-select.mjs","sources":["../../../projects/components/filter-select/src/filter-select/filter-select.component.ts","../../../projects/components/filter-select/src/filter-select/filter-select.component.html","../../../projects/components/filter-select/elementar-rt-components-filter-select.ts"],"sourcesContent":["import {\n Component, input, output, signal, computed,\n ChangeDetectionStrategy, booleanAttribute, forwardRef, model\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { FormsModule } from '@angular/forms';\nimport { KeyValuePipe } from '@angular/common';\n\nexport interface FilterSelectOption {\n value: unknown;\n label: string;\n group?: string;\n}\n\n@Component({\n selector: 'emr-filter-select',\n standalone: true,\n imports: [FormsModule, KeyValuePipe],\n templateUrl: './filter-select.component.html',\n styleUrl: './filter-select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FilterSelectComponent),\n multi: true\n }],\n host: {\n '[attr.data-open]': '_open() || null',\n '[attr.data-disabled]': 'disabled() || null',\n }\n})\nexport class FilterSelectComponent implements ControlValueAccessor {\n options = input<FilterSelectOption[]>([]);\n placeholder = input('Select…');\n multiple = input(false, { transform: booleanAttribute });\n loading = input(false, { transform: booleanAttribute });\n clearable = input(false, { transform: booleanAttribute });\n disabled = input(false, { transform: booleanAttribute });\n\n valueChange = output<unknown>();\n\n protected _open = signal(false);\n protected _search = signal('');\n private _value = signal<unknown>(null);\n\n protected _selected = computed(() => {\n const v = this._value();\n if (this.multiple()) return Array.isArray(v) ? v : [];\n return v;\n });\n\n protected _hasValue = computed(() => {\n const s = this._selected();\n if (this.multiple()) return Array.isArray(s) && (s as unknown[]).length > 0;\n return s !== null && s !== undefined;\n });\n\n protected _displayLabel = computed(() => {\n const v = this._value();\n if (this.multiple()) {\n const arr = Array.isArray(v) ? v : [];\n if (!arr.length) return this.placeholder();\n const labels = arr.map(val => this.options().find(o => o.value === val)?.label ?? val);\n return labels.length <= 2 ? labels.join(', ') : `${labels.slice(0, 2).join(', ')} +${labels.length - 2}`;\n }\n const opt = this.options().find(o => o.value === v);\n return opt?.label ?? this.placeholder();\n });\n\n protected _filtered = computed(() => {\n const q = this._search().toLowerCase();\n return this.options().filter(o => o.label.toLowerCase().includes(q));\n });\n\n protected _groups = computed(() => {\n const grouped = new Map<string, FilterSelectOption[]>();\n for (const o of this._filtered()) {\n const g = o.group ?? '';\n if (!grouped.has(g)) grouped.set(g, []);\n grouped.get(g)!.push(o);\n }\n return grouped;\n });\n\n private _onChange = (_: unknown) => {};\n private _onTouched = () => {};\n\n writeValue(val: unknown): void { this._value.set(val); }\n registerOnChange(fn: (_: unknown) => void): void { this._onChange = fn; }\n registerOnTouched(fn: () => void): void { this._onTouched = fn; }\n setDisabledState(_: boolean): void {}\n\n protected _toggle(): void {\n if (this.disabled()) return;\n this._open.set(!this._open());\n if (this._open()) this._search.set('');\n }\n\n protected _select(opt: FilterSelectOption): void {\n let newVal: unknown;\n if (this.multiple()) {\n const arr = Array.isArray(this._value()) ? [...this._value() as unknown[]] : [];\n const idx = arr.indexOf(opt.value);\n if (idx >= 0) arr.splice(idx, 1); else arr.push(opt.value);\n newVal = arr;\n } else {\n newVal = opt.value;\n this._open.set(false);\n }\n this._value.set(newVal);\n this._onChange(newVal);\n this._onTouched();\n this.valueChange.emit(newVal);\n }\n\n protected _isSelected(opt: FilterSelectOption): boolean {\n if (this.multiple()) {\n return Array.isArray(this._value()) && (this._value() as unknown[]).includes(opt.value);\n }\n return this._value() === opt.value;\n }\n\n protected _clear(e: MouseEvent): void {\n e.stopPropagation();\n const v = this.multiple() ? [] : null;\n this._value.set(v);\n this._onChange(v);\n this._onTouched();\n }\n}\n","<div class=\"fs-trigger\" (click)=\"_toggle()\">\n <span class=\"fs-display\">{{ _displayLabel() }}</span>\n <div class=\"fs-controls\">\n @if (clearable() && _hasValue()) {\n <button type=\"button\" class=\"fs-clear\" (click)=\"_clear($event)\" aria-label=\"Clear\">×</button>\n }\n <span class=\"fs-arrow\" [attr.data-open]=\"_open() || null\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </span>\n </div>\n</div>\n\n@if (_open()) {\n <div class=\"fs-dropdown\">\n <div class=\"fs-search-wrap\">\n <input\n class=\"fs-search\"\n type=\"text\"\n placeholder=\"Search…\"\n [ngModel]=\"_search()\"\n (ngModelChange)=\"_search.set($event)\"\n autofocus\n (click)=\"$event.stopPropagation()\"\n />\n </div>\n\n @if (loading()) {\n <div class=\"fs-loading\">Loading options…</div>\n } @else if (_filtered().length === 0) {\n <div class=\"fs-empty\">No options found</div>\n } @else {\n <ul class=\"fs-list\" role=\"listbox\">\n @for (entry of _groups() | keyvalue; track entry.key) {\n @if (entry.key) {\n <li class=\"fs-group-label\">{{ entry.key }}</li>\n }\n @for (opt of entry.value; track opt.value) {\n <li\n class=\"fs-option\"\n role=\"option\"\n [attr.data-selected]=\"_isSelected(opt) || null\"\n (click)=\"_select(opt)\"\n >\n @if (multiple()) {\n <span class=\"fs-checkbox\" [attr.data-checked]=\"_isSelected(opt) || null\">✓</span>\n }\n {{ opt.label }}\n </li>\n }\n }\n </ul>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA+Ba,qBAAqB,CAAA;AAChC,IAAA,OAAO,GAAG,KAAK,CAAuB,EAAE,mDAAC;AACzC,IAAA,WAAW,GAAG,KAAK,CAAC,SAAS,uDAAC;AAC9B,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AACxD,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,2CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AACvD,IAAA,SAAS,GAAG,KAAK,CAAC,KAAK,6CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AACzD,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;IAExD,WAAW,GAAG,MAAM,EAAW;AAErB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,iDAAC;AACrB,IAAA,OAAO,GAAG,MAAM,CAAC,EAAE,mDAAC;AACtB,IAAA,MAAM,GAAG,MAAM,CAAU,IAAI,kDAAC;AAE5B,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;AAClC,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE;QACvB,IAAI,IAAI,CAAC,QAAQ,EAAE;AAAE,YAAA,O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AAA,mBAAmB,EAAA,UAAA,EACjB,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,YAAY,CAAC,EAAA,eAAA,EAGnB,uBAAuB,CAAC,MAAM,aACpC,CAAC;AACV,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC;AACpD,4BAAA,KAAK,EAAE;AACR,yBAAA,CAAC,EAAA,IAAA,EACI;AACJ,wBAAA,kBAAkB,EAAE,iBAAiB;AACrC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC7C,qBAAA,EAAA,QAAA,EAAA,8yDAAA,EAAA,MAAA,EAAA,CAAA,+7GAAA,CAAA,EAAA;;;AE7BH;;AAEG;;;;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, viewChild, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { MatAutocomplete, MatAutocompleteTrigger, MatOption } from '@angular/material/autocomplete';
|
|
6
|
+
import { MatChipGrid, MatChipInput, MatChipRemove, MatChipRow } from '@angular/material/chips';
|
|
7
|
+
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
8
|
+
import { MatError, MatFormField, MatHint, MatLabel } from '@angular/material/form-field';
|
|
9
|
+
import { MatIcon } from '@angular/material/icon';
|
|
10
|
+
import { startWith, tap, debounceTime, distinctUntilChanged, switchMap, of } from 'rxjs';
|
|
11
|
+
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
12
|
+
import { AsyncPipe } from '@angular/common';
|
|
13
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
14
|
+
|
|
15
|
+
class AutocompleteManyFieldComponent {
|
|
16
|
+
httpClient = inject(HttpClient);
|
|
17
|
+
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
18
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
19
|
+
separatorKeysCodes = [ENTER, COMMA];
|
|
20
|
+
chipsCtrl = new FormControl('');
|
|
21
|
+
input = viewChild.required('input');
|
|
22
|
+
value = [];
|
|
23
|
+
filteredOptions$;
|
|
24
|
+
isLoading = false;
|
|
25
|
+
ngOnInit() {
|
|
26
|
+
this.filteredOptions$ = this.chipsCtrl.valueChanges.pipe(startWith(''), tap(() => this.isLoading = true), debounceTime(300), distinctUntilChanged(), switchMap((query) => {
|
|
27
|
+
if (!query || !query.trim()) {
|
|
28
|
+
return of([]);
|
|
29
|
+
}
|
|
30
|
+
const params = new HttpParams().set('query', query || '');
|
|
31
|
+
return this.httpClient.get(this.config().payload?.['autocompleteUrl'], {
|
|
32
|
+
params
|
|
33
|
+
});
|
|
34
|
+
}), tap(() => this.isLoading = false));
|
|
35
|
+
}
|
|
36
|
+
getErrorMessage() {
|
|
37
|
+
const errors = this.control().errors;
|
|
38
|
+
if (!errors) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
const errorKey = Object.keys(errors)[0];
|
|
42
|
+
const validator = this.config().validators?.find((v) => v.type === errorKey);
|
|
43
|
+
return validator?.message || 'Некорректное значение';
|
|
44
|
+
}
|
|
45
|
+
get options() {
|
|
46
|
+
return this.config()?.payload?.['options'] || [];
|
|
47
|
+
}
|
|
48
|
+
get bindValue() {
|
|
49
|
+
return this.config().bindValue || 'id';
|
|
50
|
+
}
|
|
51
|
+
get bindName() {
|
|
52
|
+
return this.config().bindName || 'name';
|
|
53
|
+
}
|
|
54
|
+
add(event) {
|
|
55
|
+
const name = (event.value || '').trim();
|
|
56
|
+
const hasValue = this.value.find(v => v[this.bindName].toLowerCase() === name.toLowerCase());
|
|
57
|
+
if (name && !hasValue) {
|
|
58
|
+
this.value.push({
|
|
59
|
+
[this.bindValue]: null,
|
|
60
|
+
[this.bindName]: name,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
event.chipInput.clear();
|
|
64
|
+
this.chipsCtrl.setValue(null);
|
|
65
|
+
this.isLoading = false;
|
|
66
|
+
this.calculateControlValue();
|
|
67
|
+
}
|
|
68
|
+
remove(chip) {
|
|
69
|
+
const index = this.value.indexOf(chip);
|
|
70
|
+
if (index >= 0) {
|
|
71
|
+
this.value.splice(index, 1);
|
|
72
|
+
this.calculateControlValue();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
onSelected(event) {
|
|
76
|
+
const hasValue = this.value.find(v => v[this.bindName].toLowerCase() === event.option.value[this.bindName].toLowerCase());
|
|
77
|
+
if (!hasValue) {
|
|
78
|
+
this.value.push(event.option.value);
|
|
79
|
+
}
|
|
80
|
+
this.input().nativeElement.value = '';
|
|
81
|
+
this.chipsCtrl.setValue(null);
|
|
82
|
+
this.calculateControlValue();
|
|
83
|
+
this.isLoading = false;
|
|
84
|
+
}
|
|
85
|
+
calculateControlValue() {
|
|
86
|
+
const value = this.value.map(v => {
|
|
87
|
+
const itemValue = v[this.bindValue];
|
|
88
|
+
if (itemValue) {
|
|
89
|
+
return {
|
|
90
|
+
[this.bindValue]: itemValue,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return v;
|
|
94
|
+
});
|
|
95
|
+
this.control().setValue(value);
|
|
96
|
+
}
|
|
97
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AutocompleteManyFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: AutocompleteManyFieldComponent, isStandalone: true, selector: "emr-autocomplete-many-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <mat-chip-grid #chipGrid>\n @for (option of value; track option) {\n <mat-chip-row (removed)=\"remove(option)\">\n {{ option[bindName] }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n <input [placeholder]=\"config().placeholder\"\n #input\n maxlength=\"30\"\n [formControl]=\"chipsCtrl\"\n [matChipInputFor]=\"chipGrid\"\n [matAutocomplete]=\"autocomplete\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n (matChipInputTokenEnd)=\"add($event)\">\n @if (isLoading) {\n <div class=\"loader\">\n <mat-progress-spinner\n mode=\"indeterminate\"\n [diameter]=\"20\"/>\n </div>\n }\n <mat-autocomplete #autocomplete=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\">\n @for (option of filteredOptions$ | async; track option) {\n <mat-option [value]=\"option\">{{ option[bindName] }}</mat-option>\n }\n\n @if (!(filteredOptions$ | async)?.length && !isLoading && chipsCtrl.value) {\n <mat-option disabled>\n No search results found.\n </mat-option>\n }\n </mat-autocomplete>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}:host .loader{position:absolute;right:0;top:50%;transform:translateY(-50%)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "component", type: MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
99
|
+
}
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AutocompleteManyFieldComponent, decorators: [{
|
|
101
|
+
type: Component,
|
|
102
|
+
args: [{ selector: 'emr-autocomplete-many-field', imports: [
|
|
103
|
+
FormsModule,
|
|
104
|
+
MatAutocomplete,
|
|
105
|
+
MatAutocompleteTrigger,
|
|
106
|
+
MatChipGrid,
|
|
107
|
+
MatChipInput,
|
|
108
|
+
MatChipRemove,
|
|
109
|
+
MatChipRow,
|
|
110
|
+
MatError,
|
|
111
|
+
MatFormField,
|
|
112
|
+
MatHint,
|
|
113
|
+
MatIcon,
|
|
114
|
+
MatLabel,
|
|
115
|
+
MatOption,
|
|
116
|
+
ReactiveFormsModule,
|
|
117
|
+
MatProgressSpinner,
|
|
118
|
+
AsyncPipe
|
|
119
|
+
], template: "@if (control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <mat-chip-grid #chipGrid>\n @for (option of value; track option) {\n <mat-chip-row (removed)=\"remove(option)\">\n {{ option[bindName] }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n <input [placeholder]=\"config().placeholder\"\n #input\n maxlength=\"30\"\n [formControl]=\"chipsCtrl\"\n [matChipInputFor]=\"chipGrid\"\n [matAutocomplete]=\"autocomplete\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n (matChipInputTokenEnd)=\"add($event)\">\n @if (isLoading) {\n <div class=\"loader\">\n <mat-progress-spinner\n mode=\"indeterminate\"\n [diameter]=\"20\"/>\n </div>\n }\n <mat-autocomplete #autocomplete=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\">\n @for (option of filteredOptions$ | async; track option) {\n <mat-option [value]=\"option\">{{ option[bindName] }}</mat-option>\n }\n\n @if (!(filteredOptions$ | async)?.length && !isLoading && chipsCtrl.value) {\n <mat-option disabled>\n No search results found.\n </mat-option>\n }\n </mat-autocomplete>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}:host .loader{position:absolute;right:0;top:50%;transform:translateY(-50%)}\n"] }]
|
|
120
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
121
|
+
|
|
122
|
+
export { AutocompleteManyFieldComponent };
|
|
123
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs","sources":["../../../projects/components/form-renderer/src/fields/autocomplete-many-field/autocomplete-many-field.component.ts","../../../projects/components/form-renderer/src/fields/autocomplete-many-field/autocomplete-many-field.component.html"],"sourcesContent":["import { Component, ElementRef, inject, input, OnInit, viewChild } from '@angular/core';\nimport { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport {\n MatAutocomplete,\n MatAutocompleteSelectedEvent,\n MatAutocompleteTrigger,\n MatOption\n} from '@angular/material/autocomplete';\nimport { MatChipGrid, MatChipInput, MatChipInputEvent, MatChipRemove, MatChipRow } from '@angular/material/chips';\nimport { ComponentConfig } from '../../models/form-config.model';\nimport { COMMA, ENTER } from '@angular/cdk/keycodes';\nimport { MatError, MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\nimport { MatIcon } from '@angular/material/icon';\nimport { catchError, debounceTime, distinctUntilChanged, Observable, of, startWith, switchMap, tap } from 'rxjs';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { AsyncPipe } from '@angular/common';\nimport { HttpClient, HttpParams } from '@angular/common/http';\n\n@Component({\n selector: 'emr-autocomplete-many-field',\n imports: [\n FormsModule,\n MatAutocomplete,\n MatAutocompleteTrigger,\n MatChipGrid,\n MatChipInput,\n MatChipRemove,\n MatChipRow,\n MatError,\n MatFormField,\n MatHint,\n MatIcon,\n MatLabel,\n MatOption,\n ReactiveFormsModule,\n MatProgressSpinner,\n AsyncPipe\n ],\n templateUrl: './autocomplete-many-field.component.html',\n styleUrl: './autocomplete-many-field.component.scss'\n})\nexport class AutocompleteManyFieldComponent implements OnInit {\n private httpClient = inject(HttpClient);\n\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n\n readonly separatorKeysCodes: number[] = [ENTER, COMMA];\n readonly chipsCtrl = new FormControl('');\n readonly input = viewChild.required<ElementRef<HTMLInputElement>>('input');\n readonly value: any[] = [];\n\n filteredOptions$!: Observable<any[]>;\n isLoading = false;\n\n ngOnInit() {\n this.filteredOptions$ = this.chipsCtrl.valueChanges.pipe(\n startWith(''),\n tap(() => this.isLoading = true),\n debounceTime(300),\n distinctUntilChanged(),\n switchMap((query: any) => {\n if (!query || !query.trim()) {\n return of([]);\n }\n const params = new HttpParams().set('query', query || '');\n return this.httpClient.get<any[]>(this.config().payload?.['autocompleteUrl'], {\n params\n });\n }),\n tap(() => this.isLoading = false)\n );\n }\n\n getErrorMessage(): string {\n const errors = this.control().errors;\n\n if (!errors) {\n return '';\n }\n\n const errorKey = Object.keys(errors)[0];\n const validator = this.config().validators?.find((v: any) => v.type === errorKey);\n return validator?.message || 'Некорректное значение';\n }\n\n get options() {\n return this.config()?.payload?.['options'] || [];\n }\n\n get bindValue() {\n return this.config().bindValue || 'id';\n }\n\n get bindName() {\n return this.config().bindName || 'name';\n }\n\n add(event: MatChipInputEvent): void {\n const name = (event.value || '').trim();\n const hasValue = this.value.find(\n v => v[this.bindName].toLowerCase() === name.toLowerCase()\n );\n\n if (name && !hasValue) {\n this.value.push({\n [this.bindValue]: null,\n [this.bindName]: name,\n });\n }\n\n event.chipInput!.clear();\n this.chipsCtrl.setValue(null);\n this.isLoading = false;\n this.calculateControlValue();\n }\n\n remove(chip: any): void {\n const index = this.value.indexOf(chip);\n\n if (index >= 0) {\n this.value.splice(index, 1);\n this.calculateControlValue();\n }\n }\n\n onSelected(event: MatAutocompleteSelectedEvent): void {\n const hasValue = this.value.find(\n v => v[this.bindName].toLowerCase() === event.option.value[this.bindName].toLowerCase()\n );\n\n if (!hasValue) {\n this.value.push(event.option.value);\n }\n\n this.input().nativeElement.value = '';\n this.chipsCtrl.setValue(null);\n this.calculateControlValue();\n this.isLoading = false;\n }\n\n private calculateControlValue() {\n const value = this.value.map(v => {\n const itemValue = v[this.bindValue];\n\n if (itemValue) {\n return {\n [this.bindValue]: itemValue,\n };\n }\n\n return v;\n });\n this.control().setValue(value);\n }\n}\n","@if (control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <mat-chip-grid #chipGrid>\n @for (option of value; track option) {\n <mat-chip-row (removed)=\"remove(option)\">\n {{ option[bindName] }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n <input [placeholder]=\"config().placeholder\"\n #input\n maxlength=\"30\"\n [formControl]=\"chipsCtrl\"\n [matChipInputFor]=\"chipGrid\"\n [matAutocomplete]=\"autocomplete\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n (matChipInputTokenEnd)=\"add($event)\">\n @if (isLoading) {\n <div class=\"loader\">\n <mat-progress-spinner\n mode=\"indeterminate\"\n [diameter]=\"20\"/>\n </div>\n }\n <mat-autocomplete #autocomplete=\"matAutocomplete\" (optionSelected)=\"onSelected($event)\">\n @for (option of filteredOptions$ | async; track option) {\n <mat-option [value]=\"option\">{{ option[bindName] }}</mat-option>\n }\n\n @if (!(filteredOptions$ | async)?.length && !isLoading && chipsCtrl.value) {\n <mat-option disabled>\n No search results found.\n </mat-option>\n }\n </mat-autocomplete>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAyCa,8BAA8B,CAAA;AACjC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAmB;AAEjC,IAAA,kBAAkB,GAAa,CAAC,KAAK,EAAE,KAAK,CAAC;AAC7C,IAAA,SAAS,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;AAC/B,IAAA,KAAK,GAAG,SAAS,CAAC,QAAQ,CAA+B,OAAO,CAAC;IACjE,KAAK,GAAU,EAAE;AAE1B,IAAA,gBAAgB;IAChB,SAAS,GAAG,KAAK;IAEjB,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CACtD,SAAS,CAAC,EAAE,CAAC,EACb,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAChC,YAAY,CAAC,GAAG,CAAC,EACjB,oBAAoB,EAAE,EACtB,SAAS,CAAC,CAAC,KAAU,KAAI;YACvB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE;AAC3B,gBAAA,OAAO,EAAE,CAAC,EAAE,CAAC;YACf;AACA,YAAA,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;AACzD,YAAA,OA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A,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,kBAAkB,0KAClB,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA;;4FAKA,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAvB1C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,6BAA6B,EAAA,OAAA,EAC9B;wBACP,WAAW;wBACX,eAAe;wBACf,sBAAsB;wBACtB,WAAW;wBACX,YAAY;wBACZ,aAAa;wBACb,UAAU;wBACV,QAAQ;wBACR,YAAY;wBACZ,OAAO;wBACP,OAAO;wBACP,QAAQ;wBACR,SAAS;wBACT,mBAAmB;wBACnB,kBAAkB;wBAClB;AACD,qBAAA,EAAA,QAAA,EAAA,yiDAAA,EAAA,MAAA,EAAA,CAAA,mIAAA,CAAA,EAAA;2PAYiE,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { MatCheckbox } from '@angular/material/checkbox';
|
|
6
|
+
|
|
7
|
+
class CheckboxFieldComponent {
|
|
8
|
+
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
9
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: CheckboxFieldComponent, isStandalone: true, selector: "emr-checkbox-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if(control() && config()) {\n <mat-checkbox [formControl]=\"control()\">\n {{ config().label }}\n </mat-checkbox>\n}\n", styles: [":host{display:block;margin-bottom:calc(var(--spacing, .25rem) * 3)}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CheckboxFieldComponent, decorators: [{
|
|
14
|
+
type: Component,
|
|
15
|
+
args: [{ selector: 'emr-checkbox-field', imports: [
|
|
16
|
+
MatCheckbox,
|
|
17
|
+
ReactiveFormsModule
|
|
18
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(control() && config()) {\n <mat-checkbox [formControl]=\"control()\">\n {{ config().label }}\n </mat-checkbox>\n}\n", styles: [":host{display:block;margin-bottom:calc(var(--spacing, .25rem) * 3)}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
19
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
20
|
+
|
|
21
|
+
export { CheckboxFieldComponent };
|
|
22
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs.map
|
package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs","sources":["../../../projects/components/form-renderer/src/fields/checkbox-field/checkbox-field.component.ts","../../../projects/components/form-renderer/src/fields/checkbox-field/checkbox-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\nimport { MatCheckbox } from '@angular/material/checkbox';\n\n@Component({\n selector: 'emr-checkbox-field',\n imports: [\n MatCheckbox,\n ReactiveFormsModule\n ],\n templateUrl: './checkbox-field.component.html',\n styleUrl: './checkbox-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckboxFieldComponent {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n}\n","@if(control() && config()) {\n <mat-checkbox [formControl]=\"control()\">\n {{ config().label }}\n </mat-checkbox>\n}\n"],"names":[],"mappings":";;;;;;MAea,sBAAsB,CAAA;AACjC,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAmB;wGAF/B,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SA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;;;;;"}
|
package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { MatInput, MatSuffix, MatError, MatLabel, MatFormField } from '@angular/material/input';
|
|
6
|
+
import { MatDatepickerToggle, MatDatepicker, MatDatepickerInput } from '@angular/material/datepicker';
|
|
7
|
+
import { MatHint } from '@angular/material/form-field';
|
|
8
|
+
|
|
9
|
+
class DatepickerFieldComponent {
|
|
10
|
+
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
11
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
12
|
+
getErrorMessage() {
|
|
13
|
+
const errors = this.control().errors;
|
|
14
|
+
if (!errors)
|
|
15
|
+
return '';
|
|
16
|
+
const errorKey = Object.keys(errors)[0];
|
|
17
|
+
const validator = this.config().validators?.find((v) => v.type === errorKey);
|
|
18
|
+
return validator?.message || 'Invalid value';
|
|
19
|
+
}
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatepickerFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DatepickerFieldComponent, isStandalone: true, selector: "emr-datepicker-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["emrDatepickerField"], ngImport: i0, template: "@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [formControl]=\"control()\" readonly>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
|
|
24
|
+
type: Component,
|
|
25
|
+
args: [{ selector: 'emr-datepicker-field', exportAs: 'emrDatepickerField', imports: [
|
|
26
|
+
MatHint,
|
|
27
|
+
MatInput,
|
|
28
|
+
MatSuffix,
|
|
29
|
+
MatDatepickerToggle,
|
|
30
|
+
MatDatepicker,
|
|
31
|
+
MatError,
|
|
32
|
+
MatLabel,
|
|
33
|
+
MatFormField,
|
|
34
|
+
ReactiveFormsModule,
|
|
35
|
+
MatDatepickerInput
|
|
36
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [formControl]=\"control()\" readonly>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}\n"] }]
|
|
37
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
38
|
+
|
|
39
|
+
export { DatepickerFieldComponent };
|
|
40
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs.map
|
package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs","sources":["../../../projects/components/form-renderer/src/fields/datepicker-field/datepicker-field.component.ts","../../../projects/components/form-renderer/src/fields/datepicker-field/datepicker-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\nimport { MatError, MatFormField, MatInput, MatLabel, MatSuffix } from '@angular/material/input';\nimport { MatDatepicker, MatDatepickerInput, MatDatepickerToggle } from '@angular/material/datepicker';\nimport { MatHint } from '@angular/material/form-field';\n\n@Component({\n selector: 'emr-datepicker-field',\n exportAs: 'emrDatepickerField',\n imports: [\n MatHint,\n MatInput,\n MatSuffix,\n MatDatepickerToggle,\n MatDatepicker,\n MatError,\n MatLabel,\n MatFormField,\n ReactiveFormsModule,\n MatDatepickerInput\n ],\n templateUrl: './datepicker-field.component.html',\n styleUrl: './datepicker-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DatepickerFieldComponent {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n\n getErrorMessage(): string {\n const errors = this.control().errors;\n if (!errors) return '';\n const errorKey = Object.keys(errors)[0];\n const validator = this.config().validators?.find((v: any) => v.type === errorKey);\n return validator?.message || 'Invalid value';\n }\n}\n","@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput [matDatepicker]=\"picker\" [formControl]=\"control()\" readonly>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-hint>{{ config().hint }}</mat-hint>\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n"],"names":[],"mappings":";;;;;;;;MA0Ba,wBAAwB,CAAA;AACnC,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAe;AACvC,IAAA,MAAM,GAA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IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,KAAA,EAAA,KAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMT,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAnBpC,SAAS;+BACE,sBAAsB,EAAA,QAAA,EACtB,oBAAoB,EAAA,OAAA,EACrB;wBACP,OAAO;wBACP,QAAQ;wBACR,SAAS;wBACT,mBAAmB;wBACnB,aAAa;wBACb,QAAQ;wBACR,QAAQ;wBACR,YAAY;wBACZ,mBAAmB;wBACnB;qBACD,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qfAAA,EAAA,MAAA,EAAA,CAAA,wDAAA,CAAA,EAAA;;;;;"}
|
|
@@ -3,15 +3,15 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
3
3
|
import { MatDivider } from '@angular/material/divider';
|
|
4
4
|
|
|
5
5
|
class DividerContentComponent {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DividerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: DividerContentComponent, isStandalone: true, selector: "emr-divider-content", exportAs: ["emrDividerContent"], ngImport: i0, template: "<mat-divider/>\n", styles: [":host hr{width:100%;border:none;border-top:1px solid #e0e0e0;margin:1rem 0}\n"], dependencies: [{ kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8
8
|
}
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DividerContentComponent, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
11
|
args: [{ selector: 'emr-divider-content', exportAs: 'emrDividerContent', imports: [
|
|
12
12
|
MatDivider
|
|
13
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-divider/>\
|
|
13
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-divider/>\n", styles: [":host hr{width:100%;border:none;border-top:1px solid #e0e0e0;margin:1rem 0}\n"] }]
|
|
14
14
|
}] });
|
|
15
15
|
|
|
16
16
|
export { DividerContentComponent };
|
|
17
|
-
//# sourceMappingURL=elementar-rt-components-form-renderer-divider-content.component-
|
|
17
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs.map
|
package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs","sources":["../../../projects/components/form-renderer/src/content/divider-content/divider-content.component.ts","../../../projects/components/form-renderer/src/content/divider-content/divider-content.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { MatDivider } from '@angular/material/divider';\n\n@Component({\n selector: 'emr-divider-content',\n exportAs: 'emrDividerContent',\n imports: [\n MatDivider\n ],\n templateUrl: './divider-content.component.html',\n styleUrl: './divider-content.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DividerContentComponent {\n\n}\n","<mat-divider/>\n"],"names":[],"mappings":";;;;MAaa,uBAAuB,CAAA;wGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECbpC,kBACA,EAAA,MAAA,EAAA,CAAA,+EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDMI,UAAU,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMD,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;+BACE,qBAAqB,EAAA,QAAA,EACrB,mBAAmB,EAAA,OAAA,EACpB;wBACP;qBACD,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,+EAAA,CAAA,EAAA;;;;;"}
|
|
@@ -3,15 +3,15 @@ import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
3
3
|
|
|
4
4
|
class ImageContentComponent {
|
|
5
5
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ImageContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: ImageContentComponent, isStandalone: true, selector: "emr-image-content", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "emr-image-content" }, exportAs: ["emrImageContent"], ngImport: i0, template: "@if (config().content; as opts) {\n <img [src]=\"opts['src']\"\n [alt]=\"opts['alt'] || ''\"\n [width]=\"opts['width'] || null\"\n [height]=\"opts['height'] || null\">\n}\n", styles: [":host{display:flex;align-items:center;justify-content:center}:host img{max-width:100%;height:auto;border-radius:4px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8
8
|
}
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ImageContentComponent, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
11
|
args: [{ selector: 'emr-image-content', exportAs: 'emrImageContent', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
12
12
|
'class': 'emr-image-content',
|
|
13
|
-
}, template: "@if (config().content; as opts) {\
|
|
13
|
+
}, template: "@if (config().content; as opts) {\n <img [src]=\"opts['src']\"\n [alt]=\"opts['alt'] || ''\"\n [width]=\"opts['width'] || null\"\n [height]=\"opts['height'] || null\">\n}\n", styles: [":host{display:flex;align-items:center;justify-content:center}:host img{max-width:100%;height:auto;border-radius:4px}\n"] }]
|
|
14
14
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
15
15
|
|
|
16
16
|
export { ImageContentComponent };
|
|
17
|
-
//# sourceMappingURL=elementar-rt-components-form-renderer-image-content.component-
|
|
17
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs.map
|
package/fesm2022/elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs","sources":["../../../projects/components/form-renderer/src/content/image-content/image-content.component.ts","../../../projects/components/form-renderer/src/content/image-content/image-content.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { ComponentConfig } from '../../models/form-config.model';\n\n@Component({\n selector: 'emr-image-content',\n exportAs: 'emrImageContent',\n imports: [],\n templateUrl: './image-content.component.html',\n styleUrl: './image-content.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'emr-image-content',\n }\n})\nexport class ImageContentComponent {\n config = input.required<ComponentConfig>();\n}\n","@if (config().content; as opts) {\n <img [src]=\"opts['src']\"\n [alt]=\"opts['alt'] || ''\"\n [width]=\"opts['width'] || null\"\n [height]=\"opts['height'] || null\">\n}\n"],"names":[],"mappings":";;;MAca,qBAAqB,CAAA;AAChC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAmB;wGAD/B,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,qBAAqB,iSCdlC,iMAMA,EAAA,MAAA,EAAA,CAAA,wHAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDQa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAXjC,SAAS;+BACE,mBAAmB,EAAA,QAAA,EACnB,iBAAiB,EAAA,OAAA,EAClB,EAAE,mBAGM,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,OAAO,EAAE,mBAAmB;AAC7B,qBAAA,EAAA,QAAA,EAAA,iMAAA,EAAA,MAAA,EAAA,CAAA,wHAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
+
import * as i2 from '@angular/material/input';
|
|
5
|
+
import { MatInputModule } from '@angular/material/input';
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
|
|
9
|
+
class InputFieldComponent {
|
|
10
|
+
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
11
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
12
|
+
getErrorMessage() {
|
|
13
|
+
const errors = this.control().errors;
|
|
14
|
+
if (!errors)
|
|
15
|
+
return '';
|
|
16
|
+
const errorKey = Object.keys(errors)[0];
|
|
17
|
+
const validator = this.config().validators?.find((v) => v.type === errorKey);
|
|
18
|
+
return validator?.message || 'Некорректное значение';
|
|
19
|
+
}
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: InputFieldComponent, isStandalone: true, selector: "emr-input-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput\n [type]=\"config().inputType || 'text'\"\n [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"\n [readonly]=\"config().readonly\">\n @if (config().hint) {\n <mat-hint>{{ config().hint }}</mat-hint>\n }\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatFormFieldModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
24
|
+
type: Component,
|
|
25
|
+
args: [{ selector: 'emr-input-field', imports: [
|
|
26
|
+
ReactiveFormsModule,
|
|
27
|
+
MatInputModule,
|
|
28
|
+
MatFormFieldModule
|
|
29
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput\n [type]=\"config().inputType || 'text'\"\n [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"\n [readonly]=\"config().readonly\">\n @if (config().hint) {\n <mat-hint>{{ config().hint }}</mat-hint>\n }\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n", styles: [":host{display:block}:host mat-form-field{width:100%}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
30
|
+
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
31
|
+
|
|
32
|
+
export { InputFieldComponent };
|
|
33
|
+
//# sourceMappingURL=elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs","sources":["../../../projects/components/form-renderer/src/fields/input-field/input-field.component.ts","../../../projects/components/form-renderer/src/fields/input-field/input-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\n\n@Component({\n selector: 'emr-input-field',\n imports: [\n ReactiveFormsModule,\n MatInputModule,\n MatFormFieldModule\n ],\n templateUrl: './input-field.component.html',\n styleUrl: './input-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class InputFieldComponent {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n\n getErrorMessage(): string {\n const errors = this.control().errors;\n if (!errors) return '';\n const errorKey = Object.keys(errors)[0];\n const validator = this.config().validators?.find((v: any) => v.type === errorKey);\n return validator?.message || 'Некорректное значение';\n }\n}\n","@if(control() && config()) {\n <mat-form-field>\n <mat-label>{{ config().label }}</mat-label>\n <input matInput\n [type]=\"config().inputType || 'text'\"\n [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"\n [readonly]=\"config().readonly\">\n @if (config().hint) {\n <mat-hint>{{ config().hint }}</mat-hint>\n }\n @if (control().invalid && control().touched) {\n <mat-error>{{ getErrorMessage() }}</mat-error>\n }\n </mat-form-field>\n}\n"],"names":[],"mappings":";;;;;;;;MAiBa,mBAAmB,CAAA;AAC9B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAmB;IAE1C,eAAe,GAAA;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM;AACpC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,EAAE;QACtB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAM,KAAK,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AACjF,QAAA,OAAO,SAAS,EAAE,OAAO,IAAI,uBAAuB;IACtD;wGAVW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,8UCjBhC,whBAgBA,EAAA,MAAA,EAAA,CAAA,2HAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDPI,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA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