@sdcorejs/angular 19.3.1 → 19.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/STYLE-GUIDE.md +25 -5
- package/assets/THEME.md +289 -5
- package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
- package/assets/scss/ckeditor5.scss +2 -88
- package/assets/scss/core/_control.scss +39 -0
- package/assets/scss/core/form.scss +444 -45
- package/assets/scss/core/view.scss +24 -0
- package/assets/scss/editor-content.scss +173 -0
- package/assets/scss/sd-core.scss +1 -0
- package/assets/scss/themes/_component-tokens.scss +123 -32
- package/assets/scss/themes/_material-tokens.scss +112 -0
- package/assets/scss/themes/_presets.scss +25 -0
- package/assets/scss/themes/_scales.scss +10 -0
- package/assets/scss/themes/_semantic.scss +13 -0
- package/assets/scss/themes/default.scss +8 -2
- package/components/avatar/index.d.ts +1 -0
- package/components/avatar/src/avatar-group.component.d.ts +43 -0
- package/components/avatar/src/avatar.component.d.ts +23 -1
- package/components/badge/index.d.ts +3 -0
- package/components/badge/src/badge-picker.component.d.ts +148 -0
- package/components/badge/src/badge-picker.constants.d.ts +18 -0
- package/components/badge/src/badge.component.d.ts +24 -3
- package/components/badge/src/badge.model.d.ts +19 -0
- package/components/button/src/button.component.d.ts +20 -1
- package/components/ckeditor-styles/src/ckeditor-styles.component.d.ts +3 -18
- package/components/editor/index.d.ts +1 -0
- package/components/editor/src/editor.component.d.ts +17 -15
- package/components/editor/src/models/editor.model.d.ts +5 -4
- package/components/editor/src/plugins/image-upload/utils/validate.utils.d.ts +5 -2
- package/components/editor/src/upload-manager.d.ts +21 -0
- package/components/editor-engine/index.d.ts +3 -0
- package/components/editor-engine/src/engine/editor-engine.d.ts +68 -0
- package/components/editor-engine/src/engine/editor-engine.models.d.ts +51 -0
- package/components/editor-engine/src/engine/editor-html-boundary.d.ts +6 -0
- package/components/editor-engine/src/engine/editor-schema.d.ts +3 -0
- package/components/editor-engine/src/surface/editor-surface.component.d.ts +50 -0
- package/components/editor-engine/src/toolbar/editor-button.directive.d.ts +17 -0
- package/components/editor-engine/src/toolbar/editor-toolbar.component.d.ts +78 -0
- package/components/file-explorer/src/components/actions.component.d.ts +1 -0
- package/components/file-explorer/src/file-explorer.model.d.ts +4 -2
- package/components/file-explorer/src/file-explorer.utils.d.ts +6 -2
- package/components/form-generic/src/components/elements/button-element.component.d.ts +16 -0
- package/components/form-generic/src/components/elements/index.d.ts +2 -0
- package/components/form-generic/src/components/elements/static-element.component.d.ts +26 -0
- package/components/form-generic/src/components/form-builder/canvas/field-preview.component.d.ts +10 -0
- package/components/form-generic/src/components/form-builder/form-builder.component.d.ts +9 -4
- package/components/form-generic/src/components/form-builder/inspector/inspector.component.d.ts +46 -0
- package/components/form-generic/src/components/form-builder/state/builder-document.d.ts +9 -1
- package/components/form-generic/src/components/form-builder/state/builder-palette.d.ts +2 -2
- package/components/form-generic/src/components/form-builder/state/builder-store.d.ts +13 -1
- package/components/form-generic/src/components/form-render/components/item/components/index.d.ts +2 -0
- package/components/form-generic/src/components/form-render/components/item/components/json/json.component.d.ts +26 -0
- package/components/form-generic/src/components/form-render/components/item/components/time/time.component.d.ts +17 -0
- package/components/form-generic/src/components/form-render/form-render.component.d.ts +64 -6
- package/components/form-generic/src/models/form-generic-element.model.d.ts +128 -0
- package/components/form-generic/src/models/form-generic-field.model.d.ts +5 -1
- package/components/form-generic/src/models/form-generic-schema.d.ts +9 -1
- package/components/form-generic/src/models/form-generic-schema.model.d.ts +7 -3
- package/components/form-generic/src/models/index.d.ts +1 -0
- package/components/form-generic/src/rules/form-generic-button.d.ts +21 -0
- package/components/form-generic/src/rules/form-generic-display.d.ts +2 -0
- package/components/form-generic/src/rules/form-generic-filter.d.ts +21 -3
- package/components/form-generic/src/rules/form-generic-url.d.ts +10 -0
- package/components/form-generic/src/rules/form-generic-validation.d.ts +13 -0
- package/components/history/pipes/view-date.pipe.d.ts +1 -0
- package/components/import-excel/src/pipes/column-transform.pipe.d.ts +1 -0
- package/components/index.d.ts +1 -0
- package/components/mini-editor/index.d.ts +1 -0
- package/components/mini-editor/src/mini-editor.component.d.ts +25 -62
- package/components/mini-editor/src/mini-editor.model.d.ts +9 -9
- package/components/modal-resizable/src/modal-resizable.component.d.ts +3 -121
- package/components/operator/index.d.ts +2 -0
- package/components/operator/src/operator-chip.component.d.ts +72 -0
- package/components/operator/src/operator-items.d.ts +49 -0
- package/components/operator/src/operator.component.d.ts +18 -11
- package/components/section/index.d.ts +1 -0
- package/components/section/src/section-registry.d.ts +11 -0
- package/components/splitter/index.d.ts +1 -1
- package/components/tab-router/src/actions/tab-router.action.d.ts +1 -1
- package/components/tab-router/src/components/tab-router-item/tab-router-item.component.d.ts +8 -1
- package/components/tab-router/src/components/tab-router-list-item/tab-router-list-item.component.d.ts +17 -0
- package/components/tab-router/src/components/tab-router-nav/tab-router-nav.component.d.ts +50 -9
- package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +6 -1
- package/components/tab-router/src/models/tab-router.model.d.ts +5 -0
- package/components/tab-router/src/pipes/tab-info.pipe.d.ts +7 -0
- package/components/tab-router/src/services/tab-router.service.d.ts +5 -0
- package/components/table/index.d.ts +2 -0
- package/components/table/src/components/filter/column-filter/column-filter.component.d.ts +7 -0
- package/components/table/src/components/filter/external-filter/external-filter.component.d.ts +5 -1
- package/components/table/src/components/mobile-cards/mobile-cards.component.d.ts +4 -0
- package/components/table/src/components/unknown-total-paginator/unknown-total-paginator.component.d.ts +52 -0
- package/components/table/src/configurations/index.d.ts +1 -0
- package/components/table/src/configurations/table-layout.d.ts +16 -0
- package/components/table/src/configurations/table.configuration.d.ts +3 -1
- package/components/table/src/models/index.d.ts +1 -0
- package/components/table/src/models/table-column.model.d.ts +3 -10
- package/components/table/src/models/table-item.model.d.ts +4 -1
- package/components/table/src/models/table-option-loading.model.d.ts +42 -0
- package/components/table/src/models/table-option-paginate.model.d.ts +14 -0
- package/components/table/src/models/table-option.model.d.ts +31 -5
- package/components/table/src/services/table-aggregate.util.d.ts +6 -1
- package/components/table/src/services/table-export/table-export.service.d.ts +4 -3
- package/components/table/src/services/table-filter/table-filter-operator.util.d.ts +16 -0
- package/components/table/src/services/table-filter/table-filter.model.d.ts +12 -0
- package/components/table/src/services/table-loading/table-loading.util.d.ts +91 -0
- package/components/table/src/services/table-local/table-local-sort.util.d.ts +8 -2
- package/components/table/src/services/table-local/table-local.util.d.ts +7 -2
- package/components/table/src/services/table-paging/unknown-total.util.d.ts +28 -0
- package/components/table/src/services/tree/tree.util.d.ts +2 -0
- package/components/table/src/table.component.d.ts +39 -0
- package/components/upload-file/src/components/file-type-icon/file-type-icon.component.d.ts +15 -0
- package/components/upload-file/src/components/preview/preview.component.d.ts +88 -10
- package/components/upload-file/src/configurations/upload-file.configuration.d.ts +1 -1
- package/components/upload-file/src/helpers/file-type.d.ts +25 -0
- package/components/upload-file/src/pipes/file-meta.pipe.d.ts +9 -0
- package/components/upload-file/src/pipes/file-reason.pipe.d.ts +11 -0
- package/components/upload-file/src/pipes/index.d.ts +2 -0
- package/components/upload-file/src/upload-file.component.d.ts +89 -8
- package/components/window/index.d.ts +1 -0
- package/components/window/src/window.component.d.ts +77 -0
- package/components/{modal-resizable/src/modal-resizable.registry.d.ts → window/src/window.registry.d.ts} +7 -4
- package/configurations/src/sd-core.configuration.d.ts +7 -0
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +141 -10
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +546 -22
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +32 -2
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-editor.mjs +456 -755
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +68 -37
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2119 -1160
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +12 -2
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +175 -281
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-operator.mjs +261 -42
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +17 -5
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +557 -92
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +1000 -118
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +886 -173
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-window.mjs +486 -0
- package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +20 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +462 -124
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +421 -121
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +78 -12
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +74 -17
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +79 -16
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
- package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +55 -5
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +53 -6
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs +5 -4
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +86 -32
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +16 -3
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +1745 -22
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs +478 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs +214 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs +277 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs +1556 -0
- package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
- package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +2053 -35
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-CVEKaR8U.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs +130 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-BqHybMk0.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs +131 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CND3d2zl.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BbDoQccI.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CB_wJIP8.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CB_wJIP8.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlP4BrhU.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlP4BrhU.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-VAMePx_q.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-VAMePx_q.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-BD79VR0c.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-BD79VR0c.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-B1rFhbOc.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-B1rFhbOc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BhCjw6ZL.mjs +467 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BhCjw6ZL.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CnL2FzCx.mjs +90 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CnL2FzCx.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BeH-NYvE.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BeH-NYvE.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs +61 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DpnYSG2j.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-1bi0JZdf.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-1bi0JZdf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D6eKR2cq.mjs +87 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-D6eKR2cq.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-FcJS3Nbd.mjs +232 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-FcJS3Nbd.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-BA-3FR1J.mjs +70 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-BA-3FR1J.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-BAZLCVci.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-BAZLCVci.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-ikk0cK1M.mjs +522 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-ikk0cK1M.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cex41xzy.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cex41xzy.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D643jEmo.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D643jEmo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DTWHhNNl.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DTWHhNNl.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-YJUJsrIZ.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-YJUJsrIZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-qH-YO6wP.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-qH-YO6wP.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-S0Vuy6Oc.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-S0Vuy6Oc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-Ba73HPGG.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-Ba73HPGG.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CBlN7eEn.mjs +295 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CBlN7eEn.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BvzFafUW.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BvzFafUW.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C3uWi8JZ.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C3uWi8JZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C5ELCTEw.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C5ELCTEw.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClQwnO4h.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClQwnO4h.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DTUxYZ6g.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DTUxYZ6g.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DpCuYBlL.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DpCuYBlL.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DwZWxmJf.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DwZWxmJf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ydOZduls.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ydOZduls.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-D3B5I9hg.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-D3B5I9hg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BW-i6BHg.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-BW-i6BHg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-By1mYFa_.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-By1mYFa_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DwcyKb4j.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DwcyKb4j.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBR8360C.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBR8360C.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CAtqPgIH.mjs +357 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CAtqPgIH.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DjMChf6s.mjs +128 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DjMChf6s.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
- package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
- package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
- package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services.mjs +1 -0
- package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
- package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +5 -0
- package/forms/chip/src/chip.component.d.ts +135 -19
- package/forms/chip/src/index.d.ts +0 -1
- package/forms/chip-calendar/src/chip-calendar-header.component.d.ts +17 -0
- package/forms/chip-calendar/src/chip-calendar.component.d.ts +147 -19
- package/forms/date/src/date.component.d.ts +23 -2
- package/forms/date-range/src/date-range.component.d.ts +24 -2
- package/forms/datetime/src/datetime-time-zone.adapter.d.ts +15 -0
- package/forms/directives/index.d.ts +1 -0
- package/forms/directives/src/search-field.component.d.ts +45 -0
- package/forms/input/src/input.component.d.ts +23 -2
- package/forms/input-number/src/input-number.component.d.ts +23 -2
- package/forms/models/index.d.ts +1 -0
- package/forms/models/src/sd-calendar-day.d.ts +22 -0
- package/forms/models/src/sd-model-facing-control.d.ts +3 -1
- package/forms/models/src/sd-strict-date-adapter.d.ts +3 -0
- package/forms/models/src/sd-temporal-transform.d.ts +7 -0
- package/forms/select/src/select.component.d.ts +33 -4
- package/i18n/src/en.d.ts +344 -2
- package/modules/generic/index.d.ts +4 -0
- package/modules/generic/src/components/configuration-form/generic-configuration-form.component.d.ts +33 -0
- package/modules/generic/src/components/configuration-general/generic-configuration-general.component.d.ts +28 -0
- package/modules/generic/src/components/configuration-import/generic-configuration-import.component.d.ts +27 -0
- package/modules/generic/src/components/configuration-list/generic-configuration-list.component.d.ts +39 -0
- package/modules/generic/src/components/import-dialog/generic-import-dialog.component.d.ts +15 -0
- package/modules/generic/src/components/property-identity/generic-property-identity.component.d.ts +15 -0
- package/modules/generic/src/core/generic-columns.d.ts +19 -0
- package/modules/generic/src/core/generic-defaults.d.ts +14 -0
- package/modules/generic/src/core/generic-form.d.ts +17 -0
- package/modules/generic/src/core/generic-import.d.ts +49 -0
- package/modules/generic/src/core/generic-merge.d.ts +21 -0
- package/modules/generic/src/core/generic-permission.d.ts +3 -0
- package/modules/generic/src/core/generic-property-icon.d.ts +8 -0
- package/modules/generic/src/core/generic-search.d.ts +19 -0
- package/modules/generic/src/core/generic-title.d.ts +11 -0
- package/modules/generic/src/core/generic-validate.d.ts +8 -0
- package/modules/generic/src/core/index.d.ts +10 -0
- package/modules/generic/src/models/generic-adapter.model.d.ts +49 -0
- package/modules/generic/src/models/generic-entity.model.d.ts +71 -0
- package/modules/generic/src/models/generic-issue.model.d.ts +29 -0
- package/modules/generic/src/models/generic-schema.model.d.ts +133 -0
- package/modules/generic/src/models/index.d.ts +4 -0
- package/modules/generic/src/pages/configuration/generic-configuration.page.d.ts +26 -0
- package/modules/generic/src/pages/form/generic-form-host.page.d.ts +42 -0
- package/modules/generic/src/pages/list/generic-list.page.d.ts +39 -0
- package/modules/generic/src/registry/generic-registry.d.ts +35 -0
- package/modules/generic/src/registry/index.d.ts +2 -0
- package/modules/generic/src/registry/provide-sd-generic.d.ts +15 -0
- package/modules/generic/src/routes/generic-route.guards.d.ts +24 -0
- package/modules/generic/src/routes/sd-generic.routes.d.ts +10 -0
- package/modules/generic/src/services/generic-configuration-store.d.ts +13 -0
- package/modules/generic/src/services/generic-data.service.d.ts +34 -0
- package/modules/generic/src/services/generic-import.service.d.ts +21 -0
- package/modules/generic/src/services/generic-permission.service.d.ts +26 -0
- package/modules/generic/src/services/generic-relation-catalog.d.ts +14 -0
- package/modules/generic/src/services/generic-schema.service.d.ts +28 -0
- package/modules/generic/src/services/index.d.ts +6 -0
- package/modules/icon/src/data-type-icon.d.ts +30 -0
- package/modules/icon/src/icon.model.d.ts +2 -1
- package/modules/icon/src/index.d.ts +1 -0
- package/modules/index.d.ts +1 -0
- package/modules/layout/components/index.d.ts +5 -0
- package/modules/layout/components/layout-main/layout-main.component.d.ts +2 -1
- package/modules/layout/components/page/page-form-leave.guard.d.ts +9 -0
- package/modules/layout/components/page/page.component.d.ts +38 -2
- package/modules/layout/components/page-list/page-list.component.d.ts +42 -0
- package/modules/layout/components/shared/context-switcher/context-switcher.component.d.ts +71 -0
- package/modules/layout/components/shared/user-menu/user-menu.component.d.ts +1 -1
- package/modules/layout/components/sidebar-mobile-v4/main.component.d.ts +95 -0
- package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
- package/modules/layout/components/sidebar-v3/main.component.d.ts +3 -0
- package/modules/layout/components/sidebar-v4/main.component.d.ts +69 -0
- package/modules/layout/components/sidebar-v4/menu-tree/sidebar-v4-menu-tree.component.d.ts +174 -0
- package/modules/layout/configurations/layout.configuration.d.ts +46 -1
- package/modules/layout/services/context/context.model.d.ts +16 -0
- package/modules/layout/services/context/context.runtime.d.ts +14 -0
- package/modules/layout/services/context/context.service.d.ts +54 -0
- package/modules/layout/services/context/index.d.ts +3 -0
- package/modules/layout/services/index.d.ts +1 -0
- package/modules/layout/services/menu/menu.model.d.ts +33 -0
- package/modules/layout/services/menu/menu.utils.d.ts +32 -1
- package/modules/layout/services/storage/storage.service.d.ts +20 -1
- package/modules/pattern/README.md +76 -0
- package/modules/pattern/configurations/pattern.configuration.d.ts +30 -0
- package/modules/pattern/configurations/provide-sd-patterns.d.ts +19 -0
- package/modules/pattern/core/mock-api/mock-api.interceptor.d.ts +8 -0
- package/modules/pattern/core/mock-api/mock-api.model.d.ts +62 -0
- package/modules/pattern/core/mock-api/mock-api.state.d.ts +36 -0
- package/modules/pattern/core/mock-api/mock-backend.d.ts +18 -0
- package/modules/pattern/core/mock-api/mock-backend.factory.d.ts +3 -0
- package/modules/pattern/core/mock-api/prng.d.ts +4 -0
- package/modules/pattern/core/mock-api/resources/approval.resource.d.ts +14 -0
- package/modules/pattern/core/mock-api/resources/category.resource.d.ts +9 -0
- package/modules/pattern/core/mock-api/resources/customer.resource.d.ts +22 -0
- package/modules/pattern/core/mock-api/resources/index.d.ts +3 -0
- package/modules/pattern/core/mock-api/resources/names.d.ts +5 -0
- package/modules/pattern/core/mock-api/resources/order.resource.d.ts +44 -0
- package/modules/pattern/core/mock-api/resources/partner.resource.d.ts +16 -0
- package/modules/pattern/core/mock-api/resources/product.resource.d.ts +13 -0
- package/modules/pattern/core/mock-api/resources/settings.resource.d.ts +18 -0
- package/modules/pattern/core/pattern-shell/catalog/pattern-catalog.d.ts +22 -0
- package/modules/pattern/core/pattern-shell/index/index.component.d.ts +9 -0
- package/modules/pattern/core/pattern-shell/settings/pattern-settings.store.d.ts +57 -0
- package/modules/pattern/core/pattern-shell/settings/settings-button.component.d.ts +44 -0
- package/modules/pattern/core/pattern-shell/shell/pattern-source-viewer.d.ts +8 -0
- package/modules/pattern/core/pattern-shell/shell/shell.component.d.ts +13 -0
- package/modules/pattern/core/pattern-shell/source/pattern-source.generated.d.ts +1 -0
- package/modules/pattern/core/pattern-shell/source/source-drawer.component.d.ts +27 -0
- package/modules/pattern/core/pattern-shell/toolbar/toolbar.component.d.ts +24 -0
- package/modules/pattern/core/permission/pattern-permission.d.ts +15 -0
- package/modules/pattern/core/permission/pattern-role.store.d.ts +13 -0
- package/modules/pattern/core/session-state.d.ts +4 -0
- package/modules/pattern/docs/detail.md +237 -0
- package/modules/pattern/docs/drawer.md +484 -0
- package/modules/pattern/docs/flow.md +631 -0
- package/modules/pattern/docs/form.md +518 -0
- package/modules/pattern/docs/header-actions.md +342 -0
- package/modules/pattern/docs/list.md +247 -0
- package/modules/pattern/docs/relation.md +180 -0
- package/modules/pattern/docs/select.md +206 -0
- package/modules/pattern/docs/split.md +350 -0
- package/modules/pattern/docs/states.md +168 -0
- package/modules/pattern/features/approval/entity.resolver.d.ts +4 -0
- package/modules/pattern/features/approval/entity.resolver.ts +21 -0
- package/modules/pattern/features/approval/pages/detail/detail.component.d.ts +13 -0
- package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
- package/modules/pattern/features/approval/pages/list/approval-inbox.d.ts +7 -0
- package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
- package/modules/pattern/features/approval/pages/list/list.component.d.ts +26 -0
- package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
- package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
- package/modules/pattern/features/approval/routes.d.ts +3 -0
- package/modules/pattern/features/approval/routes.ts +30 -0
- package/modules/pattern/features/approval/services/approval.model.d.ts +37 -0
- package/modules/pattern/features/approval/services/approval.model.ts +38 -0
- package/modules/pattern/features/approval/services/approval.service.d.ts +12 -0
- package/modules/pattern/features/approval/services/approval.service.ts +23 -0
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.d.ts +23 -0
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
- package/modules/pattern/features/category/components/general-information-form/general-information-form.component.d.ts +20 -0
- package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.d.ts +23 -0
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
- package/modules/pattern/features/category/entity.resolver.d.ts +6 -0
- package/modules/pattern/features/category/entity.resolver.ts +27 -0
- package/modules/pattern/features/category/pages/list/list.component.d.ts +17 -0
- package/modules/pattern/features/category/pages/list/list.component.html +20 -0
- package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
- package/modules/pattern/features/category/routes.d.ts +3 -0
- package/modules/pattern/features/category/routes.ts +42 -0
- package/modules/pattern/features/category/services/category.model.d.ts +34 -0
- package/modules/pattern/features/category/services/category.model.ts +39 -0
- package/modules/pattern/features/category/services/category.service.d.ts +17 -0
- package/modules/pattern/features/category/services/category.service.ts +36 -0
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.d.ts +24 -0
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
- package/modules/pattern/features/customer/components/customer-select/customer-select.component.d.ts +20 -0
- package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
- package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.d.ts +20 -0
- package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
- package/modules/pattern/features/customer/components/debts-view/debts-view.component.d.ts +11 -0
- package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
- package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.d.ts +20 -0
- package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
- package/modules/pattern/features/customer/components/documents-view/documents-view.component.d.ts +14 -0
- package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
- package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.d.ts +33 -0
- package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
- package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.d.ts +9 -0
- package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
- package/modules/pattern/features/customer/components/orders-view/orders-view.component.d.ts +11 -0
- package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
- package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.d.ts +22 -0
- package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.d.ts +24 -0
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
- package/modules/pattern/features/customer/entity.resolver.d.ts +4 -0
- package/modules/pattern/features/customer/entity.resolver.ts +21 -0
- package/modules/pattern/features/customer/pages/list/list.component.d.ts +19 -0
- package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
- package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
- package/modules/pattern/features/customer/pages/profile/profile.component.d.ts +31 -0
- package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
- package/modules/pattern/features/customer/pipes/customer-detail.pipe.d.ts +14 -0
- package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
- package/modules/pattern/features/customer/routes.d.ts +6 -0
- package/modules/pattern/features/customer/routes.ts +59 -0
- package/modules/pattern/features/customer/services/customer.model.d.ts +77 -0
- package/modules/pattern/features/customer/services/customer.model.ts +87 -0
- package/modules/pattern/features/customer/services/customer.service.d.ts +24 -0
- package/modules/pattern/features/customer/services/customer.service.ts +79 -0
- package/modules/pattern/features/import/components/mapping-form/mapping-form.component.d.ts +21 -0
- package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
- package/modules/pattern/features/import/components/preview-view/preview-view.component.d.ts +10 -0
- package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
- package/modules/pattern/features/import/pages/flow/flow.component.d.ts +43 -0
- package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
- package/modules/pattern/features/import/routes.d.ts +2 -0
- package/modules/pattern/features/import/routes.ts +19 -0
- package/modules/pattern/features/import/services/import.model.d.ts +38 -0
- package/modules/pattern/features/import/services/import.model.ts +82 -0
- package/modules/pattern/features/import/services/import.service.d.ts +15 -0
- package/modules/pattern/features/import/services/import.service.ts +18 -0
- package/modules/pattern/features/order/components/approval-steps/approval-steps.component.d.ts +9 -0
- package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
- package/modules/pattern/features/order/components/bulk-result/bulk-result.component.d.ts +22 -0
- package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
- package/modules/pattern/features/order/components/general-information-form/general-information-form.component.d.ts +30 -0
- package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
- package/modules/pattern/features/order/components/lines-form/lines-form.component.d.ts +33 -0
- package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
- package/modules/pattern/features/order/components/lines-view/lines-view.component.d.ts +12 -0
- package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
- package/modules/pattern/features/order/components/summary-cards/summary-cards.component.d.ts +25 -0
- package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
- package/modules/pattern/features/order/entity.resolver.d.ts +9 -0
- package/modules/pattern/features/order/entity.resolver.ts +37 -0
- package/modules/pattern/features/order/pages/create/create.component.d.ts +16 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
- package/modules/pattern/features/order/pages/detail/detail.component.d.ts +26 -0
- package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
- package/modules/pattern/features/order/pages/list/list.component.d.ts +29 -0
- package/modules/pattern/features/order/pages/list/list.component.html +38 -0
- package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
- package/modules/pattern/features/order/pages/update/update.component.d.ts +20 -0
- package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
- package/modules/pattern/features/order/routes.d.ts +7 -0
- package/modules/pattern/features/order/routes.ts +54 -0
- package/modules/pattern/features/order/services/order.model.d.ts +106 -0
- package/modules/pattern/features/order/services/order.model.ts +109 -0
- package/modules/pattern/features/order/services/order.service.d.ts +25 -0
- package/modules/pattern/features/order/services/order.service.ts +63 -0
- package/modules/pattern/features/partner/pages/create/create.component.d.ts +41 -0
- package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
- package/modules/pattern/features/partner/routes.d.ts +2 -0
- package/modules/pattern/features/partner/routes.ts +20 -0
- package/modules/pattern/features/partner/services/partner.model.d.ts +30 -0
- package/modules/pattern/features/partner/services/partner.model.ts +30 -0
- package/modules/pattern/features/partner/services/partner.service.d.ts +13 -0
- package/modules/pattern/features/partner/services/partner.service.ts +17 -0
- package/modules/pattern/features/product/components/general-information-form/general-information-form.component.d.ts +23 -0
- package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
- package/modules/pattern/features/product/components/product-select/product-select.component.d.ts +20 -0
- package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
- package/modules/pattern/features/product/components/product-status-select/product-status-select.component.d.ts +22 -0
- package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
- package/modules/pattern/features/product/entity.resolver.d.ts +4 -0
- package/modules/pattern/features/product/entity.resolver.ts +21 -0
- package/modules/pattern/features/product/pages/create/create.component.d.ts +15 -0
- package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
- package/modules/pattern/features/product/pages/detail/detail.component.d.ts +10 -0
- package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
- package/modules/pattern/features/product/pages/list/list.component.d.ts +15 -0
- package/modules/pattern/features/product/pages/list/list.component.html +30 -0
- package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
- package/modules/pattern/features/product/pages/update/update.component.d.ts +16 -0
- package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
- package/modules/pattern/features/product/pipes/product-detail.pipe.d.ts +14 -0
- package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
- package/modules/pattern/features/product/routes.d.ts +3 -0
- package/modules/pattern/features/product/routes.ts +48 -0
- package/modules/pattern/features/product/services/product.model.d.ts +34 -0
- package/modules/pattern/features/product/services/product.model.ts +38 -0
- package/modules/pattern/features/product/services/product.service.d.ts +17 -0
- package/modules/pattern/features/product/services/product.service.ts +48 -0
- package/modules/pattern/features/settings/pages/update/update.component.d.ts +26 -0
- package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
- package/modules/pattern/features/settings/routes.d.ts +3 -0
- package/modules/pattern/features/settings/routes.ts +24 -0
- package/modules/pattern/features/settings/services/settings.model.d.ts +17 -0
- package/modules/pattern/features/settings/services/settings.model.ts +18 -0
- package/modules/pattern/features/settings/services/settings.service.d.ts +10 -0
- package/modules/pattern/features/settings/services/settings.service.ts +15 -0
- package/modules/pattern/features/settings/settings.resolver.d.ts +4 -0
- package/modules/pattern/features/settings/settings.resolver.ts +8 -0
- package/modules/pattern/index.d.ts +3 -0
- package/modules/pattern/routes.d.ts +6 -0
- package/modules/pattern/services/base-api.service.d.ts +16 -0
- package/modules/pattern/utils/api-error.d.ts +4 -0
- package/modules/pattern/utils/focus-first-invalid.d.ts +5 -0
- package/modules/pattern/utils/form-api-errors.d.ts +16 -0
- package/modules/pattern/utils/resource-url.d.ts +2 -0
- package/package.json +49 -12
- package/pipes/src/format-date.pipe.d.ts +1 -0
- package/pipes/src/format-datetime.pipe.d.ts +1 -0
- package/services/date-time/index.d.ts +1 -0
- package/services/date-time/src/date-time.service.d.ts +54 -0
- package/services/index.d.ts +1 -0
- package/services/storage/src/storage.model.d.ts +8 -1
- package/services/unsaved-changes/src/unsaved-changes.adapters.d.ts +9 -0
- package/services/unsaved-changes/src/unsaved-changes.model.d.ts +2 -0
- package/utilities/read-state/src/read-state.d.ts +2 -0
- package/utilities/theme/src/theme-tokens.d.ts +1 -1
- package/components/editor/src/plugins/image-upload/image-upload.plugin.d.ts +0 -22
- package/components/editor/src/plugins/image-upload/utils/batch.utils.d.ts +0 -14
- package/components/editor/src/plugins/image-upload/utils/index.d.ts +0 -3
- package/forms/chip/src/pipes/index.d.ts +0 -1
- package/forms/chip/src/pipes/removable-chip.pipe.d.ts +0 -8
- package/forms/chip-calendar/src/pipes/index.d.ts +0 -1
- package/forms/chip-calendar/src/pipes/removable-chip.pipe.d.ts +0 -8
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, inject, ChangeDetectorRef, input, computed, booleanAttribute, model, output, viewChild, contentChild, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
4
1
|
import * as i1 from '@angular/common';
|
|
5
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, ChangeDetectorRef, ElementRef, DestroyRef, input, computed, booleanAttribute, model, output, viewChild, viewChildren, contentChild, signal, effect, isDevMode, afterRenderEffect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { Utilities } from '@sdcorejs/utils/fns';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
|
-
import { NgForm, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
8
|
+
import { FormGroupDirective, NgForm, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
10
9
|
import * as i5 from '@angular/material/chips';
|
|
11
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
10
|
+
import { MatChipGrid, MatChipsModule } from '@angular/material/chips';
|
|
12
11
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
12
|
import * as i3 from '@angular/material/input';
|
|
14
13
|
import { MatInputModule } from '@angular/material/input';
|
|
15
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
16
14
|
import * as i4 from '@angular/material/tooltip';
|
|
17
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
16
|
import { SdView } from '@sdcorejs/angular/components/view';
|
|
@@ -21,45 +19,43 @@ import { SdLabel } from '@sdcorejs/angular/forms/label';
|
|
|
21
19
|
import { ɵsdTimerScope as _sdTimerScope, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, ɵsdFormControlConnector as _sdFormControlConnector } from '@sdcorejs/angular/forms/models';
|
|
22
20
|
import { I18nService } from '@sdcorejs/angular/i18n';
|
|
23
21
|
import { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';
|
|
24
|
-
import { Subscription } from 'rxjs';
|
|
25
22
|
import { SdIcon } from '@sdcorejs/angular/modules/icon';
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
constructor(formControl) {
|
|
48
|
-
this.formControl = formControl;
|
|
49
|
-
}
|
|
50
|
-
isErrorState(control, form) {
|
|
51
|
-
const isSubmitted = form && form.submitted;
|
|
52
|
-
return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
24
|
+
/** Items that never become a chip; `0` and `false` still do (A2). */
|
|
25
|
+
const isChipItem = (item) => item !== null && item !== undefined && item !== '';
|
|
26
|
+
/** Keys that commit the typed text by default (`KeyboardEvent.key`). */
|
|
27
|
+
const DEFAULT_SEPARATORS = ['Enter', ','];
|
|
28
|
+
/** Default `chipTransform`: the text without surrounding spaces. */
|
|
29
|
+
const trimChip = (raw) => raw.trim();
|
|
30
|
+
/** Character a separator key stands for in pasted text; key names other than Enter / Tab have none. */
|
|
31
|
+
const separatorChar = (key) => (key === 'Enter' ? '\n' : key === 'Tab' ? '\t' : key.length === 1 ? key : null);
|
|
32
|
+
/** Duplicate highlight (B3), the same 1.4s as the review. */
|
|
33
|
+
const DUPLICATE_FLASH_MS = 1400;
|
|
34
|
+
/**
|
|
35
|
+
* Icon sizes by field size: chip ✕ / lock and the clear button (C1). why: the chip icons are one step below the handoff
|
|
36
|
+
* table (14 / 16 / 18px), as on `<sd-chip-calendar>` (chosen 2026-10-23: 16px looked heavy in a 24px chip), so both chip
|
|
37
|
+
* fields look the same.
|
|
38
|
+
*/
|
|
39
|
+
const CHIP_ICONS = {
|
|
40
|
+
sm: { chip: '12px', clear: '16px' },
|
|
41
|
+
md: { chip: '14px', clear: '18px' },
|
|
42
|
+
lg: { chip: '16px', clear: '20px' },
|
|
43
|
+
};
|
|
55
44
|
class SdChip {
|
|
56
45
|
#ref = inject(ChangeDetectorRef);
|
|
57
46
|
#i18n = inject(I18nService);
|
|
58
|
-
// why:
|
|
59
|
-
//
|
|
60
|
-
|
|
47
|
+
// why: lỗi phải hiện khi form cha đã submit dù field chưa chạm (A5). NgForm / FormGroupDirective tổ tiên
|
|
48
|
+
// giữ cờ `submitted`; MatInput cũng lấy đúng hai directive này cho ErrorStateMatcher.
|
|
49
|
+
#parentForm = inject(FormGroupDirective, { optional: true }) ?? inject(NgForm, { optional: true });
|
|
50
|
+
#host = inject(ElementRef).nativeElement;
|
|
51
|
+
/** why: id ổn định của lỗi (`<mat-error>` hoặc chữ ẩn của `hideInlineError`) để ô nhập trỏ `aria-describedby` sang (A8). */
|
|
52
|
+
errorId = `sd-chip-error-${Utilities.generateUuid()}`;
|
|
53
|
+
// why: blur hoãn 150ms, focus 100ms. Gỡ chip / đổi route trong khoảng đó thì timer chạy trên view đã destroy (từng
|
|
54
|
+
// gọi detectChanges() → ViewDestroyedError, giờ vẫn focus một ô nhập đã tháo). Scope handle theo DestroyRef để timer
|
|
55
|
+
// bị clear cùng lúc view tháo.
|
|
61
56
|
#timers = _sdTimerScope();
|
|
62
|
-
#
|
|
57
|
+
#destroyRef = inject(DestroyRef);
|
|
58
|
+
/** Control name when `name` is not set. */
|
|
63
59
|
#name = Utilities.generateUuid();
|
|
64
60
|
// Signals - inputs (accept null|undefined at boundary, transform to canonical)
|
|
65
61
|
autoIdInput = input(undefined, {
|
|
@@ -130,13 +126,43 @@ class SdChip {
|
|
|
130
126
|
});
|
|
131
127
|
hideInlineError = input(false, { transform: booleanAttribute });
|
|
132
128
|
required = input(false, { transform: booleanAttribute });
|
|
129
|
+
/** Fewest chips; > 0 adds `Validators.minLength`. Replaces `min`. */
|
|
130
|
+
minCount = input(undefined, {
|
|
131
|
+
transform: (v) => v ?? undefined,
|
|
132
|
+
});
|
|
133
|
+
/** Most chips; > 0 adds `Validators.maxLength` (for a model set from outside) and stops adding once reached. Replaces `max`. */
|
|
134
|
+
maxCount = input(undefined, {
|
|
135
|
+
transform: (v) => v ?? undefined,
|
|
136
|
+
});
|
|
137
|
+
/** @deprecated Use `minCount`; `minCount` wins when both are set. */
|
|
133
138
|
min = input(0, {
|
|
134
139
|
transform: (v) => v ?? 0,
|
|
135
140
|
});
|
|
141
|
+
/** @deprecated Use `maxCount`; `maxCount` wins when both are set. */
|
|
136
142
|
max = input(0, {
|
|
137
143
|
transform: (v) => v ?? 0,
|
|
138
144
|
});
|
|
145
|
+
/** `false` keeps the field read-only for typing: the input stays (mat-chip-grid needs it) but is read-only and out of the Tab order. */
|
|
139
146
|
addable = input(true, { transform: booleanAttribute });
|
|
147
|
+
/** Leaving the field turns the typed text into a chip. `false` drops the text instead, as before. */
|
|
148
|
+
addOnBlur = input(true, { transform: booleanAttribute });
|
|
149
|
+
/** Keys that commit the typed text (`KeyboardEvent.key`). A paste also splits on these characters, new lines and tabs. */
|
|
150
|
+
separators = input(DEFAULT_SEPARATORS, {
|
|
151
|
+
transform: (v) => v ?? DEFAULT_SEPARATORS,
|
|
152
|
+
});
|
|
153
|
+
/** Normalises typed or pasted text before it is compared and stored; `null` or `''` drops it. Default: trim. */
|
|
154
|
+
chipTransform = input(trimChip, {
|
|
155
|
+
transform: (v) => v ?? trimChip,
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* Checks a normalised value: an i18n key (or the message itself) when it is refused, else `null`. A refused value does
|
|
159
|
+
* not become a chip; its text stays in the input and the message shows under the field.
|
|
160
|
+
*/
|
|
161
|
+
chipValidator = input(null);
|
|
162
|
+
/** Shows a button that removes every chip `removable` allows. Off by default, like `clearable` of `<sd-date>`. */
|
|
163
|
+
clearable = input(false, { transform: booleanAttribute });
|
|
164
|
+
/** Chips shown while the field is not focused; the rest fold into “+N”. `null` shows them all. `2` suits `<sd-table>` cells. */
|
|
165
|
+
maxVisible = input(null);
|
|
140
166
|
disabled = input(false, { transform: booleanAttribute });
|
|
141
167
|
/** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
|
|
142
168
|
viewed = input(false, { transform: sdViewedTransform });
|
|
@@ -153,23 +179,37 @@ class SdChip {
|
|
|
153
179
|
sdChange = output();
|
|
154
180
|
// Template properties
|
|
155
181
|
input = viewChild('input');
|
|
182
|
+
chipGrid = viewChild(MatChipGrid);
|
|
183
|
+
// why: query signal không đặt được trên field ES private (#).
|
|
184
|
+
chipTextElements = viewChildren('chipTextEl');
|
|
156
185
|
sdViewDef = contentChild(SdViewDefDirective);
|
|
157
186
|
sdLabelDef = contentChild(SdLabelDefDirective);
|
|
158
187
|
sdLabelTemplate = contentChild('sdLabel');
|
|
159
188
|
sdValueTemplate = contentChild('sdValue');
|
|
160
189
|
// Local states
|
|
161
190
|
#isBlurring = false;
|
|
162
|
-
|
|
191
|
+
/** The field is being edited: the `sdViewDef` face gives way to the field. A signal, so OnPush redraws without `detectChanges()` (D1). */
|
|
192
|
+
isFocused = signal(false);
|
|
163
193
|
#inputControl = new FormControl();
|
|
164
194
|
#formControl = new SdFormControl();
|
|
195
|
+
/**
|
|
196
|
+
* Control of `mat-chip-grid` only. why: the grid is a ControlValueAccessor that writes the text of the rendered chips
|
|
197
|
+
* into its control on blur, after a timeout (numbers became strings, a form reset was undone). It still needs an
|
|
198
|
+
* ngControl to work out its error state on every check, so it gets this one; nothing reads its value.
|
|
199
|
+
*/
|
|
200
|
+
gridControl = new FormControl(null);
|
|
165
201
|
// why: `min`/`max` chỉ là validator do CHÍNH component sở hữu; `required` đi qua option riêng
|
|
166
202
|
// của connector. Connector add/remove đúng phần này (addValidators/removeValidators) nên
|
|
167
203
|
// validator do consumer tự gắn vào `formControl` public KHÔNG bị xoá — trước đây
|
|
168
204
|
// `clearValidators()` + `setValidators()` thổi bay tất cả mỗi lần input đổi.
|
|
205
|
+
/** `minCount`, else the deprecated `min`. */
|
|
206
|
+
effectiveMinCount = computed(() => this.minCount() ?? this.min() ?? 0);
|
|
207
|
+
/** `maxCount`, else the deprecated `max`. */
|
|
208
|
+
effectiveMaxCount = computed(() => this.maxCount() ?? this.max() ?? 0);
|
|
169
209
|
#validators = computed(() => {
|
|
170
210
|
const validators = [];
|
|
171
|
-
const min = this.
|
|
172
|
-
const max = this.
|
|
211
|
+
const min = this.effectiveMinCount();
|
|
212
|
+
const max = this.effectiveMaxCount();
|
|
173
213
|
if (min > 0)
|
|
174
214
|
validators.push(Validators.minLength(min));
|
|
175
215
|
if (max > 0)
|
|
@@ -184,15 +224,72 @@ class SdChip {
|
|
|
184
224
|
required: this.required,
|
|
185
225
|
});
|
|
186
226
|
#matcher;
|
|
187
|
-
|
|
188
|
-
|
|
227
|
+
/** why: phím tách do `separators` + onInputKeydown xử lý, nên Material không nhận phím nào. */
|
|
228
|
+
noSeparatorKeys = [];
|
|
229
|
+
/**
|
|
230
|
+
* Items rendered as chips: every value except `null`, `undefined` and `''`, so `0` shows (A2). Display only: the
|
|
231
|
+
* model is never rewritten. why: exact duplicates are dropped too, because the chips are tracked by value.
|
|
232
|
+
*/
|
|
233
|
+
chips = computed(() => {
|
|
234
|
+
const value = this.#state().value;
|
|
235
|
+
return Array.isArray(value) ? [...new Set(value.filter(isChipItem))] : [];
|
|
236
|
+
});
|
|
237
|
+
/** Focus is in the input or on a chip; “+N” only folds chips while it is not (B7). */
|
|
238
|
+
#focusWithin = signal(false);
|
|
239
|
+
/** Message of a typed or pasted value that `chipValidator` refused; it shows under the field until the text changes (B4). */
|
|
240
|
+
inputError = signal(null);
|
|
241
|
+
/** Last polite announcement; a new id re-renders the text so a repeated message is read again. */
|
|
242
|
+
liveMessage = signal(null);
|
|
243
|
+
#liveId = 0;
|
|
244
|
+
/** Chip that the typed value duplicates, highlighted for 1.4s (B3). */
|
|
245
|
+
duplicateChip = signal(null);
|
|
246
|
+
/** Text of the chips that the 240px limit cuts; only they get a tooltip (B7). */
|
|
247
|
+
truncatedChips = signal(new Set());
|
|
248
|
+
#warnedDeprecated = false;
|
|
249
|
+
/** `maxCount` reached: typing and pasting add nothing more (B3). */
|
|
250
|
+
full = computed(() => {
|
|
251
|
+
const max = this.effectiveMaxCount();
|
|
252
|
+
return max > 0 && this.chips().length >= max;
|
|
253
|
+
});
|
|
254
|
+
/** Chips on screen: all while the field has focus, else at most `maxVisible` (B7). */
|
|
255
|
+
visibleChips = computed(() => {
|
|
256
|
+
const chips = this.chips();
|
|
257
|
+
const max = this.maxVisible();
|
|
258
|
+
if (this.#focusWithin() || max === null || max === undefined || max < 0 || chips.length <= max)
|
|
259
|
+
return chips;
|
|
260
|
+
return chips.slice(0, max);
|
|
261
|
+
});
|
|
262
|
+
/** Chips folded into “+N”. */
|
|
263
|
+
hiddenCount = computed(() => this.chips().length - this.visibleChips().length);
|
|
264
|
+
/** At least one chip may be removed, so the clear button has something to do (B6). */
|
|
265
|
+
hasRemovable = computed(() => {
|
|
266
|
+
void this.removable();
|
|
267
|
+
return this.chips().some(chip => this.isRemovable(chip));
|
|
268
|
+
});
|
|
269
|
+
/**
|
|
270
|
+
* Placeholder: “Đã đủ …” once full, else the input, else “Nhập rồi nhấn Enter” — never the label (B5). None when not
|
|
271
|
+
* addable, or while chips are folded into “+N”: nobody types then, and the input only fills the rest of the line (C1).
|
|
272
|
+
*/
|
|
273
|
+
effectivePlaceholder = computed(() => {
|
|
274
|
+
if (!this.addable() || this.hiddenCount() > 0)
|
|
275
|
+
return null;
|
|
276
|
+
if (this.full())
|
|
277
|
+
return this.#i18n.t('core.form.chip.full', { max: this.effectiveMaxCount() });
|
|
278
|
+
return this.placeholder() || this.#i18n.t('core.form.chip.placeholder');
|
|
279
|
+
});
|
|
280
|
+
clearLabel = computed(() => this.#i18n.t('core.form.chip.clear'));
|
|
281
|
+
/** Tooltip of the lock on a chip that `removable` keeps (C3). */
|
|
282
|
+
lockedLabel = computed(() => this.#i18n.t('core.form.chip.locked'));
|
|
283
|
+
/** Sizes of the chip ✕ / lock and of the clear-button icon for the current `size` (C1). */
|
|
284
|
+
iconSizes = computed(() => CHIP_ICONS[this.size() === 'sm' || this.size() === 'lg' ? this.size() : 'md']);
|
|
285
|
+
moreLabel = computed(() => this.#i18n.t('core.form.chip.more', { count: this.hiddenCount() }));
|
|
189
286
|
constructor() {
|
|
190
287
|
// Update model
|
|
191
288
|
effect(() => {
|
|
192
289
|
const values = this.model();
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
290
|
+
// why: `null` / `undefined` từ cha phải xoá chip và đưa control về `[]`; trước đây control giữ mảng cũ và
|
|
291
|
+
// vẫn gửi nó đi khi submit (A4).
|
|
292
|
+
this.#formControl.setValue(Array.isArray(values) ? values : []);
|
|
196
293
|
});
|
|
197
294
|
// Handle disabled state
|
|
198
295
|
effect(() => {
|
|
@@ -200,19 +297,43 @@ class SdChip {
|
|
|
200
297
|
if (isDisabled) {
|
|
201
298
|
this.#formControl.disable();
|
|
202
299
|
this.#inputControl.disable();
|
|
300
|
+
this.gridControl.disable();
|
|
203
301
|
}
|
|
204
302
|
else {
|
|
205
303
|
this.#formControl.enable();
|
|
206
304
|
this.#inputControl.enable();
|
|
305
|
+
this.gridControl.enable();
|
|
207
306
|
}
|
|
208
307
|
});
|
|
308
|
+
// why: `[required]` trên mat-chip-grid khớp selector `[required][formControl]` của RequiredValidator, nên
|
|
309
|
+
// `gridControl` sẽ invalid khi rỗng và MatChipInput gắn aria-invalid="true" lúc field chưa chạm. Gán thẳng thuộc
|
|
310
|
+
// tính của grid: mat-form-field vẫn hiện dấu * và ô nhập vẫn có aria-required.
|
|
311
|
+
effect(() => {
|
|
312
|
+
const grid = this.chipGrid();
|
|
313
|
+
if (grid)
|
|
314
|
+
grid.required = this.required();
|
|
315
|
+
});
|
|
209
316
|
effect(() => {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
317
|
+
if ((this.min() > 0 || this.max() > 0) && !this.#warnedDeprecated && isDevMode()) {
|
|
318
|
+
this.#warnedDeprecated = true;
|
|
319
|
+
console.warn('[sd-chip] `min` / `max` are deprecated; use `minCount` / `maxCount`.');
|
|
213
320
|
}
|
|
214
321
|
});
|
|
215
|
-
|
|
322
|
+
// why: chữ chip dừng ở 240px rồi cắt "…" (B7); chỉ chip thật sự bị cắt mới cần tooltip, và chỉ đo được sau khi vẽ.
|
|
323
|
+
afterRenderEffect(() => {
|
|
324
|
+
const cut = new Set();
|
|
325
|
+
for (const { nativeElement } of this.chipTextElements()) {
|
|
326
|
+
if (nativeElement.scrollWidth > nativeElement.clientWidth)
|
|
327
|
+
cut.add(nativeElement.dataset['chip'] ?? '');
|
|
328
|
+
}
|
|
329
|
+
const current = untracked(this.truncatedChips);
|
|
330
|
+
if (cut.size !== current.size || [...cut].some(text => !current.has(text)))
|
|
331
|
+
this.truncatedChips.set(cut);
|
|
332
|
+
});
|
|
333
|
+
// why: `submitted` của form cha không phải signal; submit phải vẽ lại lỗi dưới OnPush.
|
|
334
|
+
this.#parentForm?.ngSubmit.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => this.#ref.markForCheck());
|
|
335
|
+
this.#formControl.sdChanges.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => this.#ref.markForCheck());
|
|
336
|
+
this.#matcher = { isErrorState: (_control, form) => !!this.inputError() || this.#errorGate(form) };
|
|
216
337
|
}
|
|
217
338
|
get formControl() {
|
|
218
339
|
return this.#formControl;
|
|
@@ -229,8 +350,8 @@ class SdChip {
|
|
|
229
350
|
errorMessage = computed(() => {
|
|
230
351
|
void this.#state();
|
|
231
352
|
void this.required();
|
|
232
|
-
const min = this.
|
|
233
|
-
const max = this.
|
|
353
|
+
const min = this.effectiveMinCount();
|
|
354
|
+
const max = this.effectiveMaxCount();
|
|
234
355
|
const errors = this.#formControl.errors;
|
|
235
356
|
if (!errors)
|
|
236
357
|
return undefined;
|
|
@@ -245,32 +366,219 @@ class SdChip {
|
|
|
245
366
|
get matcher() {
|
|
246
367
|
return this.#matcher;
|
|
247
368
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
369
|
+
/**
|
|
370
|
+
* The one place that decides whether the error shows (A5): the `ErrorStateMatcher` of the chip grid and the input,
|
|
371
|
+
* `<mat-error>`, the `hideInlineError` icon and `aria-invalid` all read it. Invalid and touched, or the parent form
|
|
372
|
+
* was submitted; a field that is only dirty shows nothing.
|
|
373
|
+
*/
|
|
374
|
+
isErrorShown() {
|
|
375
|
+
return !!this.inputError() || (!!this.errorMessage() && this.#errorGate());
|
|
252
376
|
}
|
|
253
|
-
|
|
254
|
-
|
|
377
|
+
/** Text under the field: the `chipValidator` message of the typed value first, else the form error. */
|
|
378
|
+
errorText = computed(() => this.inputError() ?? this.errorMessage());
|
|
379
|
+
#errorGate(form) {
|
|
380
|
+
const control = this.#formControl;
|
|
381
|
+
return control.invalid && (control.touched || !!(form ?? this.#parentForm)?.submitted);
|
|
255
382
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
383
|
+
/** Whether `item` may be removed, per `removable`; applied on every removal path (A1). */
|
|
384
|
+
isRemovable(item) {
|
|
385
|
+
const removable = this.removable();
|
|
386
|
+
return typeof removable === 'function' ? !!removable(item) : removable;
|
|
387
|
+
}
|
|
388
|
+
/** Accessible name of the ✕ button of a chip (A6). */
|
|
389
|
+
removeLabel(item) {
|
|
390
|
+
return this.#i18n.t('core.form.chip.remove', { value: String(item) });
|
|
391
|
+
}
|
|
392
|
+
/** Accessible name of a chip that `removable` keeps: its text plus “, Không xoá được” (C3). A removable chip keeps its text. */
|
|
393
|
+
chipLabel(item) {
|
|
394
|
+
return this.isRemovable(item) ? null : `${String(item)}, ${this.lockedLabel()}`;
|
|
395
|
+
}
|
|
396
|
+
/** Text of a chip, also its key for `truncatedChips`. */
|
|
397
|
+
chipText(item) {
|
|
398
|
+
return String(item);
|
|
399
|
+
}
|
|
400
|
+
/** A separator key (`separators`) commits the typed text; the key itself is not typed (B2 / separators). */
|
|
401
|
+
onInputKeydown(event) {
|
|
402
|
+
if (event.isComposing || !this.separators().includes(event.key))
|
|
403
|
+
return;
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
this.#commitText(this.input()?.nativeElement.value ?? '');
|
|
406
|
+
}
|
|
407
|
+
/** The refused-value message goes as soon as the text changes (B4). */
|
|
408
|
+
onInputText() {
|
|
409
|
+
if (this.inputError())
|
|
410
|
+
this.inputError.set(null);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* A paste that holds a separator, a new line or a tab becomes several chips in one change (B2). Duplicates are
|
|
414
|
+
* skipped, refused values and values past `maxCount` stay in the input, and the result is announced. A paste with
|
|
415
|
+
* no separator is left to the browser.
|
|
416
|
+
*/
|
|
417
|
+
onPaste(event) {
|
|
418
|
+
if (!this.addable())
|
|
419
|
+
return;
|
|
420
|
+
const text = event.clipboardData?.getData('text') ?? '';
|
|
421
|
+
const chars = new Set(['\n', '\r', '\t']);
|
|
422
|
+
for (const key of this.separators()) {
|
|
423
|
+
const char = separatorChar(key);
|
|
424
|
+
if (char)
|
|
425
|
+
chars.add(char);
|
|
426
|
+
}
|
|
427
|
+
const parts = text.split(new RegExp(`[${[...chars].map(char => char.replace(/[\\\]^-]/g, '\\$&')).join('')}]`));
|
|
428
|
+
if (parts.length < 2)
|
|
429
|
+
return;
|
|
430
|
+
event.preventDefault();
|
|
431
|
+
const next = [...this.#currentValues()];
|
|
432
|
+
const max = this.effectiveMaxCount();
|
|
433
|
+
const kept = [];
|
|
434
|
+
let added = 0;
|
|
435
|
+
let skipped = 0;
|
|
436
|
+
let overflow = false;
|
|
437
|
+
let error = null;
|
|
438
|
+
for (const raw of parts) {
|
|
439
|
+
const value = this.#normalise(raw);
|
|
440
|
+
if (value === null)
|
|
441
|
+
continue;
|
|
442
|
+
if (next.some(item => String(item) === String(value))) {
|
|
443
|
+
skipped++;
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
const refused = this.#refusal(value);
|
|
447
|
+
if (refused || (max > 0 && next.length >= max)) {
|
|
448
|
+
if (refused)
|
|
449
|
+
error ??= refused;
|
|
450
|
+
else
|
|
451
|
+
overflow = true;
|
|
452
|
+
kept.push(raw.trim());
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
next.push(value);
|
|
456
|
+
added++;
|
|
457
|
+
}
|
|
458
|
+
if (added)
|
|
459
|
+
this.#commit(next);
|
|
460
|
+
this.#setInputText(kept.join(', '));
|
|
461
|
+
this.inputError.set(error);
|
|
462
|
+
const notes = [this.#i18n.t('core.form.chip.added', { count: added })];
|
|
463
|
+
if (skipped)
|
|
464
|
+
notes.push(this.#i18n.t('core.form.chip.skipped', { count: skipped }));
|
|
465
|
+
if (overflow)
|
|
466
|
+
notes.push(this.#i18n.t('core.form.chip.full', { max }));
|
|
467
|
+
this.#announce(notes.join(' · '));
|
|
468
|
+
}
|
|
469
|
+
/** Backspace / Delete on a chip that `removable` keeps says why nothing happened (A1, B3). */
|
|
470
|
+
onChipKeydown(event, item) {
|
|
471
|
+
if ((event.key === 'Backspace' || event.key === 'Delete') && !this.isRemovable(item)) {
|
|
472
|
+
this.#announce(this.#i18n.t('core.form.chip.locked'));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
/** “+N” moves focus to the input, where every chip shows (B7). */
|
|
476
|
+
onMoreClick(event) {
|
|
477
|
+
event.stopPropagation();
|
|
478
|
+
this.#focus();
|
|
479
|
+
}
|
|
480
|
+
/** Focus entering the input or a chip unfolds “+N”; focus on the “+N” button itself does not (B7). */
|
|
481
|
+
onFocusIn(event) {
|
|
482
|
+
const target = event.target;
|
|
483
|
+
if (target?.classList.contains('sd-chip__more'))
|
|
484
|
+
return;
|
|
485
|
+
this.#focusWithin.set(true);
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Marks the field touched once focus leaves it; moving between the input and the chips does not count.
|
|
489
|
+
* why: `mat-chip-grid` is no longer bound to the control. As a ControlValueAccessor it wrote the text of the rendered
|
|
490
|
+
* chips back into the control on blur (numbers became strings, a form reset was undone), so the component marks
|
|
491
|
+
* touched itself, like the grid did.
|
|
492
|
+
*/
|
|
493
|
+
onFocusOut(event) {
|
|
494
|
+
const next = event.relatedTarget;
|
|
495
|
+
if (next && this.#host.contains(next))
|
|
496
|
+
return;
|
|
497
|
+
this.#focusWithin.set(false);
|
|
498
|
+
this.#formConnector.markAsTouched();
|
|
499
|
+
this.#ref.markForCheck();
|
|
500
|
+
}
|
|
501
|
+
#add = (event) => this.#commitText(event.value ?? '');
|
|
502
|
+
/**
|
|
503
|
+
* Typed text → chip (a separator key, blur, or `onAdd`): normalise, then a duplicate flashes the chip it repeats, a full
|
|
504
|
+
* field says so, a refused value stays in the input with its message, and anything else is added in one change.
|
|
505
|
+
*/
|
|
506
|
+
#commitText(raw) {
|
|
507
|
+
if (!this.addable())
|
|
508
|
+
return;
|
|
509
|
+
const value = this.#normalise(String(raw));
|
|
510
|
+
if (value === null) {
|
|
511
|
+
this.#setInputText('');
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const values = this.#currentValues();
|
|
515
|
+
// why: so trùng theo chuỗi — model `[1]` và chữ "1" vừa gõ là một chip (A3).
|
|
516
|
+
const existing = values.find(item => String(item) === String(value));
|
|
517
|
+
if (existing !== undefined) {
|
|
518
|
+
this.#flashDuplicate(existing);
|
|
519
|
+
this.#announce(this.#i18n.t('core.form.chip.duplicate', { value: String(value) }));
|
|
520
|
+
this.#setInputText('');
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
if (this.full()) {
|
|
524
|
+
this.#announce(this.#i18n.t('core.form.chip.full', { max: this.effectiveMaxCount() }));
|
|
525
|
+
return;
|
|
268
526
|
}
|
|
527
|
+
const refused = this.#refusal(value);
|
|
528
|
+
if (refused) {
|
|
529
|
+
this.inputError.set(refused);
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
// why: PHẢI tạo mảng MỚI. `values` chính là mảng của consumer (model đi thẳng vào formControl), nên `push` vừa sửa
|
|
533
|
+
// trộm mảng của họ, vừa giữ nguyên reference — `model()` dùng equality Object.is nên `model.set(sameRef)` KHÔNG phát
|
|
534
|
+
// `modelChange`, làm `[(model)]` lệch âm thầm.
|
|
535
|
+
this.#commit([...values, value]);
|
|
536
|
+
this.#setInputText('');
|
|
537
|
+
}
|
|
538
|
+
/** `chipTransform` of the text; `null`, `undefined` or `''` means nothing to add. */
|
|
539
|
+
#normalise(raw) {
|
|
540
|
+
const value = this.chipTransform()(raw);
|
|
541
|
+
return value === null || value === undefined || value === '' ? null : value;
|
|
542
|
+
}
|
|
543
|
+
/** Message of `chipValidator` for `value`, translated when it is a key, else `null`. */
|
|
544
|
+
#refusal(value) {
|
|
545
|
+
const result = this.chipValidator()?.(value) ?? null;
|
|
546
|
+
if (!result)
|
|
547
|
+
return null;
|
|
548
|
+
// why: I18nService.t trả lại chính chuỗi kèm cảnh báo khi không có key; app hay trả thẳng câu thông báo.
|
|
549
|
+
return result in this.#i18n.messages() ? this.#i18n.t(result) : result;
|
|
550
|
+
}
|
|
551
|
+
#currentValues() {
|
|
552
|
+
const value = this.#formControl.value;
|
|
553
|
+
return Array.isArray(value) ? value : [];
|
|
554
|
+
}
|
|
555
|
+
/** Every user change ends here: one new array, written once to the control, the model and `sdChange`. */
|
|
556
|
+
#commit(next) {
|
|
557
|
+
this.inputError.set(null);
|
|
558
|
+
// why: người dùng sửa thì control của form phải dirty trước khi nhận giá trị, như value accessor của Angular;
|
|
559
|
+
// ô gõ là inputControl nên control của chip không tự dirty.
|
|
560
|
+
this.#formControl.markAsDirty();
|
|
561
|
+
this.#formControl.setValue(next);
|
|
562
|
+
this.model.set(next);
|
|
563
|
+
this.sdChange.emit(next);
|
|
564
|
+
this.#ref.markForCheck();
|
|
565
|
+
}
|
|
566
|
+
#setInputText(text) {
|
|
269
567
|
const inputEl = this.input();
|
|
270
568
|
if (inputEl)
|
|
271
|
-
inputEl.nativeElement.value =
|
|
272
|
-
this.#inputControl.setValue(
|
|
273
|
-
}
|
|
569
|
+
inputEl.nativeElement.value = text;
|
|
570
|
+
this.#inputControl.setValue(text);
|
|
571
|
+
}
|
|
572
|
+
#announce(text) {
|
|
573
|
+
this.liveMessage.set({ id: ++this.#liveId, text });
|
|
574
|
+
}
|
|
575
|
+
#flashDuplicate(item) {
|
|
576
|
+
this.duplicateChip.set(item);
|
|
577
|
+
this.#timers.schedule(() => {
|
|
578
|
+
if (this.duplicateChip() === item)
|
|
579
|
+
this.duplicateChip.set(null);
|
|
580
|
+
}, DUPLICATE_FLASH_MS);
|
|
581
|
+
}
|
|
274
582
|
#clickChip = ($event, item) => {
|
|
275
583
|
$event.stopPropagation();
|
|
276
584
|
$event.stopImmediatePropagation();
|
|
@@ -280,9 +588,11 @@ class SdChip {
|
|
|
280
588
|
};
|
|
281
589
|
#remove = (item) => {
|
|
282
590
|
const values = this.#formControl.value ?? [];
|
|
283
|
-
|
|
591
|
+
// why: `removable` áp cho mọi đường xoá, kể cả Backspace / Delete trên chip mà Material vẫn phát `(removed)` (A1).
|
|
592
|
+
if ((typeof item === 'string' || typeof item === 'number') && this.isRemovable(item)) {
|
|
284
593
|
// why: `filter` đã trả mảng mới nên reference đổi → `model.set` phát `modelChange`.
|
|
285
594
|
const next = values.filter(value => item !== value);
|
|
595
|
+
this.#formControl.markAsDirty();
|
|
286
596
|
this.#formControl.setValue(next);
|
|
287
597
|
this.model.set(next);
|
|
288
598
|
this.sdChange.emit(next);
|
|
@@ -290,83 +600,74 @@ class SdChip {
|
|
|
290
600
|
this.#inputControl.setValue('');
|
|
291
601
|
this.#focus();
|
|
292
602
|
};
|
|
293
|
-
|
|
294
|
-
const item = event.option.value;
|
|
295
|
-
const values = this.#formControl.value ?? [];
|
|
296
|
-
if (item) {
|
|
297
|
-
if (typeof item === 'string' || typeof item === 'number') {
|
|
298
|
-
if (!values.includes(item)) {
|
|
299
|
-
// why: giống #add — mảng mới, không `push` lên mảng của consumer.
|
|
300
|
-
const next = [...values, item];
|
|
301
|
-
this.#formControl.setValue(next);
|
|
302
|
-
this.model.set(next);
|
|
303
|
-
this.sdChange.emit(next);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
const inputEl = this.input();
|
|
307
|
-
if (inputEl)
|
|
308
|
-
inputEl.nativeElement.value = '';
|
|
309
|
-
this.#inputControl.setValue('', {
|
|
310
|
-
emitEvent: false,
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
};
|
|
603
|
+
// why: focus không còn xoá chữ đang gõ (B1).
|
|
314
604
|
#onFocus = () => {
|
|
315
|
-
this.isFocused
|
|
605
|
+
this.isFocused.set(true);
|
|
316
606
|
this.#isBlurring = false;
|
|
317
|
-
this.#inputControl.setValue('');
|
|
318
607
|
};
|
|
319
608
|
#onBlur = () => {
|
|
320
609
|
this.#isBlurring = true;
|
|
321
|
-
// why: vẫn 150ms như cũ (cửa sổ để click vào chip/option huỷ blur) — chỉ scope handle
|
|
322
|
-
//
|
|
610
|
+
// why: vẫn 150ms như cũ (cửa sổ để click vào chip/option huỷ blur) — chỉ scope handle theo DestroyRef. Chữ đang gõ
|
|
611
|
+
// thành chip qua `matChipInputAddOnBlur`; chỉ khi `[addOnBlur]="false"` mới bỏ chữ như trước (B1).
|
|
323
612
|
this.#timers.schedule(() => {
|
|
324
613
|
if (this.#isBlurring) {
|
|
325
|
-
this.isFocused
|
|
326
|
-
this
|
|
327
|
-
|
|
328
|
-
});
|
|
329
|
-
this.#ref.detectChanges();
|
|
614
|
+
this.isFocused.set(false);
|
|
615
|
+
if (!this.addOnBlur())
|
|
616
|
+
this.#setInputText('');
|
|
330
617
|
}
|
|
331
618
|
}, 150);
|
|
332
619
|
};
|
|
333
620
|
#onClick = () => {
|
|
334
621
|
if (this.sdViewDef()?.templateRef) {
|
|
335
|
-
if (!this.#formControl.disabled && !this.isFocused) {
|
|
622
|
+
if (!this.#formControl.disabled && !this.isFocused()) {
|
|
336
623
|
this.#focus();
|
|
337
624
|
}
|
|
338
625
|
}
|
|
339
626
|
};
|
|
340
627
|
#focus = () => {
|
|
341
|
-
this.isFocused
|
|
628
|
+
this.isFocused.set(true);
|
|
342
629
|
this.#isBlurring = false;
|
|
343
630
|
// why: vẫn 100ms như cũ — chỉ scope handle theo DestroyRef.
|
|
344
631
|
this.#timers.schedule(() => {
|
|
345
|
-
if (this.isFocused) {
|
|
632
|
+
if (this.isFocused()) {
|
|
346
633
|
this.input()?.nativeElement?.focus();
|
|
347
634
|
}
|
|
348
635
|
}, 100);
|
|
349
636
|
};
|
|
637
|
+
/** Removes every chip `removable` allows; locked chips stay. One change, none when nothing goes (B6). */
|
|
350
638
|
#clear = ($event) => {
|
|
351
639
|
$event?.stopPropagation();
|
|
352
|
-
this.#
|
|
353
|
-
this
|
|
354
|
-
this
|
|
355
|
-
|
|
356
|
-
|
|
640
|
+
this.#setInputText('');
|
|
641
|
+
this.inputError.set(null);
|
|
642
|
+
const values = this.#currentValues();
|
|
643
|
+
const kept = values.filter(value => !this.isRemovable(value));
|
|
644
|
+
if (kept.length !== values.length)
|
|
645
|
+
this.#commit(kept);
|
|
646
|
+
// why: nút vừa bấm ẩn đi (visibility) khi không còn chip nào bỏ được, nên focus trên nó sẽ mất; đưa về ô nhập.
|
|
647
|
+
if ($event)
|
|
648
|
+
this.#focus();
|
|
649
|
+
this.#ref.markForCheck();
|
|
357
650
|
};
|
|
358
651
|
// Public method to expose private methods for template
|
|
359
652
|
onAdd = (event) => this.#add(event);
|
|
360
653
|
onClickChip = (event, item) => this.#clickChip(event, item);
|
|
361
654
|
onRemove = (item) => this.#remove(item);
|
|
362
|
-
onSelect = (event) => this.#select(event);
|
|
363
655
|
onFocus = () => this.#onFocus();
|
|
364
656
|
onBlur = () => this.#onBlur();
|
|
365
657
|
onClick = () => this.#onClick();
|
|
658
|
+
/**
|
|
659
|
+
* why: khi `sdViewDef` đang hiển thị thì bên trong không còn phần tử nào focus được, nên phần tử view là lối vào
|
|
660
|
+
* duy nhất để chuyển sang chế độ sửa. Bàn phím phải mở được y hệt chuột → Enter/Space chạy chung handler;
|
|
661
|
+
* preventDefault chặn Space cuộn trang (A7).
|
|
662
|
+
*/
|
|
663
|
+
onViewKeydown = (event) => {
|
|
664
|
+
event.preventDefault();
|
|
665
|
+
this.#onClick();
|
|
666
|
+
};
|
|
366
667
|
focus = () => this.#focus();
|
|
367
668
|
onClear = ($event) => this.#clear($event);
|
|
368
669
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
369
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdChip, isStandalone: true, selector: "sd-chip", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, addable: { classPropertyName: "addable", publicName: "addable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { properties: { "class.sd-has-label": "!!label()", "class.sd-viewed": "isViewed()", "class.sd-label-top": "labelPlacement() === 'top'" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _removable = removable();\r\n@let _labelTop = labelPlacement() === 'top';\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_sdViewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_sdViewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [removable]=\"_removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\r\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideInlineError && _errorMessage && formControl.touched) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\r\n @if (_hideInlineError && _errorMessage && formControl.touched) {\r\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\r\r\n }\r\n\r\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\r\n <mat-error>{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-chip-input{margin-top:0!important}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-bg, #ebecf0)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.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: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText", "for", "labelId"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdChip, isStandalone: true, selector: "sd-chip", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, minCount: { classPropertyName: "minCount", publicName: "minCount", isSignal: true, isRequired: false, transformFunction: null }, maxCount: { classPropertyName: "maxCount", publicName: "maxCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, addable: { classPropertyName: "addable", publicName: "addable", isSignal: true, isRequired: false, transformFunction: null }, addOnBlur: { classPropertyName: "addOnBlur", publicName: "addOnBlur", isSignal: true, isRequired: false, transformFunction: null }, separators: { classPropertyName: "separators", publicName: "separators", isSignal: true, isRequired: false, transformFunction: null }, chipTransform: { classPropertyName: "chipTransform", publicName: "chipTransform", isSignal: true, isRequired: false, transformFunction: null }, chipValidator: { classPropertyName: "chipValidator", publicName: "chipValidator", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)" }, properties: { "class.sd-has-label": "!!label()", "class.sd-viewed": "isViewed()", "class.sd-label-top": "labelPlacement() === 'top'" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "chipGrid", first: true, predicate: MatChipGrid, descendants: true, isSignal: true }, { propertyName: "chipTextElements", predicate: ["chipTextEl"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorText();\r\n@let _size = size();\r\n@let _labelTop = labelPlacement() === 'top';\r\n@let _icons = iconSizes();\r\n<!-- why: m\u1ED9t c\u1ED5ng duy nh\u1EA5t cho <mat-error>, ch\u1EEF l\u1ED7i \u1EA9n v\u00E0 aria-invalid (A5). -->\r\n@let _errorVisible = isErrorShown();\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n <!-- why: nh\u00E3n r\u1EDDi (`labelPlacement=\"top\"`) l\u00E0 ch\u1ED7 duy nh\u1EA5t d\u00F9ng `#sdLabel` / `sdLabelDef` khi s\u1EEDa, nh\u01B0 sd-date v\u00E0\r\n sd-select; nh\u00E3n n\u1ED5i l\u00E0 <mat-label> ch\u1EEF (D1). -->\r\n @if (_labelTop && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (_labelTop && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout: kh\u00F4ng role, kh\u00F4ng t\u00EAn, kh\u00F4ng n\u1EB1m trong th\u1EE9 t\u1EF1 Tab (A7). Khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB\r\n th\u00EC b\u00EAn trong kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o, n\u00EAn ch\u00EDnh ph\u1EA7n t\u1EED view nh\u1EADn role=\"button\" + tabindex=\"0\" +\r\n Enter/Space; disabled th\u00EC r\u00FAt kh\u1ECFi th\u1EE9 t\u1EF1 Tab. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused()\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused()) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c. -->\r\n <div\r\n class=\"sd-chip__view-trigger\"\r\n role=\"button\"\r\n [attr.tabindex]=\"formControl.disabled ? null : 0\"\r\n [attr.aria-disabled]=\"formControl.disabled ? 'true' : null\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <!-- why: `.sd-chip-field` nh\u1EADn mixin sd-chip-row() c\u1EE7a core/form.scss \u2014 thang chip, chip kho\u00E1, \u201C+N\u201D, n\u00FAt b\u1ECF h\u1EBFt d\u00F9ng\r\n chung v\u1EDBi sd-chip-calendar (C1, C2). -->\r\n <mat-form-field\r\n class=\"sd-chip-field\"\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.sd-lg]=\"_size === 'lg'\"\r\n [class.sd-chip-field--folded]=\"hiddenCount() > 0\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <!-- why: grid n\u1ED1i `gridControl` ri\u00EAng, kh\u00F4ng ph\u1EA3i `formControl`: l\u00E0 ControlValueAccessor, khi blur n\u00F3 ghi text c\u1EE7a\r\n c\u00E1c chip \u0111ang render v\u00E0o control (s\u1ED1 th\u00E0nh chu\u1ED7i, reset b\u1ECB \u0111\u00E8 l\u1EA1i). V\u1EABn c\u1EA7n m\u1ED9t ngControl \u0111\u1EC3 grid t\u1EF1 t\u00EDnh\r\n errorState m\u1ED7i l\u1EA7n check; matcher c\u1EE7a sd-chip quy\u1EBFt \u0111\u1ECBnh vi\u1EC1n \u0111\u1ECF (A5). `required` g\u00E1n trong component, xem\r\n `chipGrid`. -->\r\n <mat-chip-grid [formControl]=\"gridControl\" #chipList [errorStateMatcher]=\"matcher\">\r\n <!-- why: chips() gi\u1EEF c\u1EA3 0 v\u00E0 track theo gi\u00E1 tr\u1ECB, n\u00EAn xo\u00E1 m\u1ED9t chip kh\u00F4ng d\u1EF1ng l\u1EA1i c\u00E1c chip sau n\u00F3 (A2).\r\n `[removable]` nh\u1EADn boolean c\u1EE7a t\u1EEBng chip: predicate truy\u1EC1n th\u1EB3ng lu\u00F4n truthy v\u00E0 Backspace / Delete v\u1EABn\r\n xo\u00E1 chip kho\u00E1 (A1). Khi kh\u00F4ng focus ch\u1EC9 hi\u1EC7n `maxVisible` chip, ph\u1EA7n d\u01B0 g\u1ED9p v\u00E0o \u201C+N\u201D (B7). Chip kho\u00E1 c\u00F3 n\u1EC1n\r\n ri\u00EAng, icon kho\u00E1 v\u00E0 t\u00EAn n\u1ED1i \u201C, kh\u00F4ng xo\u00E1 \u0111\u01B0\u1EE3c\u201D (C3). -->\r\n @for (item of visibleChips(); track item) {\r\n @let _removable = isRemovable(item);\r\n @let _text = chipText(item);\r\n <mat-chip-row\r\n class=\"sd-chip__chip\"\r\n [class.sd-chip__chip--locked]=\"!_removable\"\r\n [class.sd-chip__chip--duplicate]=\"duplicateChip() === item\"\r\n [removable]=\"_removable\"\r\n [aria-label]=\"chipLabel(item)\"\r\n (removed)=\"onRemove(item)\"\r\n (keydown)=\"onChipKeydown($event, item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span\r\n #chipTextEl\r\n class=\"sd-chip__chip-text\"\r\n [attr.data-chip]=\"_text\"\r\n [matTooltip]=\"_text\"\r\n [matTooltipDisabled]=\"!truncatedChips().has(_text)\"\r\n >{{ item }}</span\r\n >\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 \u2715 \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o \u00F4 trailing c\u1EE7a mat-chip-row ([matChipRemove]). -->\r\n @if (!inputControl.disabled && _removable) {\r\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\r\n }\r\n @if (!inputControl.disabled && !_removable) {\r\n <sd-icon class=\"sd-chip__lock\" name=\"lock\" [size]=\"_icons.chip\" [matTooltip]=\"lockedLabel()\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n @if (hiddenCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"sd-chip__more\"\r\n [attr.aria-label]=\"moreLabel()\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\r\n (click)=\"onMoreClick($event)\">\r\n +{{ hiddenCount() }}\r\n </button>\r\n }\r\n <!-- why: ph\u00EDm t\u00E1ch so theo `KeyboardEvent.key` trong onInputKeydown (keyCode c\u1EE7a `;` kh\u00E1c nhau theo b\u1ED1 c\u1EE5c b\u00E0n ph\u00EDm),\r\n n\u00EAn Material kh\u00F4ng nh\u1EADn ph\u00EDm n\u00E0o; n\u00F3 ch\u1EC9 c\u00F2n ph\u00E1t matChipInputTokenEnd khi blur (`addOnBlur`). `addable` false\r\n v\u1EABn gi\u1EEF \u00F4 nh\u1EADp v\u00EC mat-chip-grid c\u1EA7n matChipInputFor, nh\u01B0ng ch\u1EC9 \u0111\u1ECDc v\u00E0 ra kh\u1ECFi th\u1EE9 t\u1EF1 Tab. -->\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [readonly]=\"!addable()\"\r\n [attr.tabindex]=\"addable() ? null : -1\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"noSeparatorKeys\"\r\n [matChipInputAddOnBlur]=\"addOnBlur()\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (input)=\"onInputText()\"\r\n (paste)=\"onPaste($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : 'false'\"\r\n [attr.aria-describedby]=\"_hideInlineError && _errorVisible ? errorId : null\"\r\n #input />\r\n </mat-chip-grid>\r\n <!-- why: icon v\u00E0 ch\u1EEF l\u1ED7i \u1EA9n chung m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c matSuffix, n\u00EAn m\u1ED9t kh\u1ED1i @if \u0111\u1EE7 cho c\u1EA3 hai v\u00E0 v\u1EABn \u0111\u01B0\u1EE3c chi\u1EBFu\r\n v\u00E0o v\u00F9ng suffix. Ch\u1EEF \u1EA9n c\u00F3 id \u0111\u1EC3 \u00F4 nh\u1EADp tr\u1ECF aria-describedby sang (A8); v\u1EDBi <mat-error> th\u00EC\r\n mat-form-field t\u1EF1 n\u1ED1i. -->\r\n @if (_hideInlineError && _errorVisible) {\r\n <span matSuffix class=\"sd-chip__error-suffix\">\r\n <sd-icon class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\">{{ _errorMessage }}</span>\r\n </span>\r\n }\r\n <!-- why: n\u00FAt b\u1ECF h\u1EBFt nh\u01B0 `.sd-clear-btn` c\u1EE7a sd-date (hi\u1EC7n khi hover / focus-within). Lu\u00F4n gi\u1EEF ch\u1ED7: khi kh\u00F4ng c\u00F2n chip\r\n n\u00E0o b\u1ECF \u0111\u01B0\u1EE3c th\u00EC ch\u1EC9 \u1EA9n b\u1EB1ng visibility, kh\u00F4ng g\u1EE1 kh\u1ECFi DOM, \u0111\u1EC3 field kh\u00F4ng nh\u1EA3y (B6). -->\r\n @if (clearable() && !formControl.disabled && !_required) {\r\n @let _canClear = hasRemovable();\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-clear-btn sd-chip__clear sd-chip__suffix\"\r\n [class.sd-hover]=\"_canClear\"\r\n [class.sd-chip__clear--empty]=\"!_canClear\"\r\n [attr.aria-label]=\"clearLabel()\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\r\n (click)=\"onClear($event)\">\r\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\r\n </button>\r\n }\r\n\r\n @if (!_hideInlineError && _errorVisible) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n @if (effectiveMaxCount() > 0) {\r\n <mat-hint align=\"end\" class=\"sd-chip__counter\" [class.sd-chip__counter--full]=\"full()\">\r\n {{ chips().length }}/{{ effectiveMaxCount() }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n <!-- why: v\u00F9ng live lu\u00F4n c\u00F3 m\u1EB7t \u0111\u1EC3 screen reader \u0111\u1ECDc \u201C\u0111\u00E3 c\u00F3\u201D, \u201C\u0111\u00E3 \u0111\u1EE7\u201D, k\u1EBFt qu\u1EA3 d\u00E1n v\u00E0 \u201Ckh\u00F4ng xo\u00E1 \u0111\u01B0\u1EE3c\u201D ngay khi ch\u00FAng\r\n xu\u1EA5t hi\u1EC7n (B2, B3); id m\u1EDBi d\u1EF1ng l\u1EA1i ch\u1EEF \u0111\u1EC3 c\u00E2u l\u1EB7p l\u1EA1i v\u1EABn \u0111\u01B0\u1EE3c \u0111\u1ECDc. -->\r\n @let _live = liveMessage();\r\n <span class=\"sd-visually-hidden sd-chip__live\" aria-live=\"polite\">\r\n @for (message of _live ? [_live] : []; track message.id) {\r\n <span>{{ message.text }}</span>\r\n }\r\n </span>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-chip__chip-text{display:block;min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-bg)}.sd-chip__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-chip__view-trigger[aria-disabled=true]{cursor:default}.sd-chip__error-suffix{display:inline-flex;align-items:center}.sd-chip__clear--empty{visibility:hidden}@media(pointer:coarse){.sd-chip__clear.sd-hover{visibility:visible}}.sd-chip__counter--full{color:var(--sd-warning)}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.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: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText", "for", "labelId"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
370
671
|
}
|
|
371
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdChip, decorators: [{
|
|
372
673
|
type: Component,
|
|
@@ -374,6 +675,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
374
675
|
'[class.sd-has-label]': '!!label()',
|
|
375
676
|
'[class.sd-viewed]': 'isViewed()',
|
|
376
677
|
'[class.sd-label-top]': "labelPlacement() === 'top'",
|
|
678
|
+
'(focusin)': 'onFocusIn($event)',
|
|
679
|
+
'(focusout)': 'onFocusOut($event)',
|
|
377
680
|
}, imports: [
|
|
378
681
|
SdIcon,
|
|
379
682
|
CommonModule,
|
|
@@ -382,18 +685,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
382
685
|
MatInputModule,
|
|
383
686
|
MatTooltipModule,
|
|
384
687
|
MatFormFieldModule,
|
|
385
|
-
MatAutocompleteModule,
|
|
386
|
-
MatProgressSpinnerModule,
|
|
387
688
|
MatChipsModule,
|
|
388
689
|
SdLabel,
|
|
389
690
|
SdView,
|
|
390
|
-
SdRemovableChipPipe,
|
|
391
|
-
], template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _removable = removable();\r\n@let _labelTop = labelPlacement() === 'top';\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_sdViewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_sdViewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [removable]=\"_removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\r\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideInlineError && _errorMessage && formControl.touched) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\r\n @if (_hideInlineError && _errorMessage && formControl.touched) {\r\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\r\r\n }\r\n\r\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\r\n <mat-error>{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-chip-input{margin-top:0!important}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-bg, #ebecf0)}\n"] }]
|
|
691
|
+
], template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorText();\r\n@let _size = size();\r\n@let _labelTop = labelPlacement() === 'top';\r\n@let _icons = iconSizes();\r\n<!-- why: m\u1ED9t c\u1ED5ng duy nh\u1EA5t cho <mat-error>, ch\u1EEF l\u1ED7i \u1EA9n v\u00E0 aria-invalid (A5). -->\r\n@let _errorVisible = isErrorShown();\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n <!-- why: nh\u00E3n r\u1EDDi (`labelPlacement=\"top\"`) l\u00E0 ch\u1ED7 duy nh\u1EA5t d\u00F9ng `#sdLabel` / `sdLabelDef` khi s\u1EEDa, nh\u01B0 sd-date v\u00E0\r\n sd-select; nh\u00E3n n\u1ED5i l\u00E0 <mat-label> ch\u1EEF (D1). -->\r\n @if (_labelTop && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (_labelTop && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout: kh\u00F4ng role, kh\u00F4ng t\u00EAn, kh\u00F4ng n\u1EB1m trong th\u1EE9 t\u1EF1 Tab (A7). Khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB\r\n th\u00EC b\u00EAn trong kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o, n\u00EAn ch\u00EDnh ph\u1EA7n t\u1EED view nh\u1EADn role=\"button\" + tabindex=\"0\" +\r\n Enter/Space; disabled th\u00EC r\u00FAt kh\u1ECFi th\u1EE9 t\u1EF1 Tab. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused()\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused()) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c. -->\r\n <div\r\n class=\"sd-chip__view-trigger\"\r\n role=\"button\"\r\n [attr.tabindex]=\"formControl.disabled ? null : 0\"\r\n [attr.aria-disabled]=\"formControl.disabled ? 'true' : null\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <!-- why: `.sd-chip-field` nh\u1EADn mixin sd-chip-row() c\u1EE7a core/form.scss \u2014 thang chip, chip kho\u00E1, \u201C+N\u201D, n\u00FAt b\u1ECF h\u1EBFt d\u00F9ng\r\n chung v\u1EDBi sd-chip-calendar (C1, C2). -->\r\n <mat-form-field\r\n class=\"sd-chip-field\"\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.sd-lg]=\"_size === 'lg'\"\r\n [class.sd-chip-field--folded]=\"hiddenCount() > 0\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <!-- why: grid n\u1ED1i `gridControl` ri\u00EAng, kh\u00F4ng ph\u1EA3i `formControl`: l\u00E0 ControlValueAccessor, khi blur n\u00F3 ghi text c\u1EE7a\r\n c\u00E1c chip \u0111ang render v\u00E0o control (s\u1ED1 th\u00E0nh chu\u1ED7i, reset b\u1ECB \u0111\u00E8 l\u1EA1i). V\u1EABn c\u1EA7n m\u1ED9t ngControl \u0111\u1EC3 grid t\u1EF1 t\u00EDnh\r\n errorState m\u1ED7i l\u1EA7n check; matcher c\u1EE7a sd-chip quy\u1EBFt \u0111\u1ECBnh vi\u1EC1n \u0111\u1ECF (A5). `required` g\u00E1n trong component, xem\r\n `chipGrid`. -->\r\n <mat-chip-grid [formControl]=\"gridControl\" #chipList [errorStateMatcher]=\"matcher\">\r\n <!-- why: chips() gi\u1EEF c\u1EA3 0 v\u00E0 track theo gi\u00E1 tr\u1ECB, n\u00EAn xo\u00E1 m\u1ED9t chip kh\u00F4ng d\u1EF1ng l\u1EA1i c\u00E1c chip sau n\u00F3 (A2).\r\n `[removable]` nh\u1EADn boolean c\u1EE7a t\u1EEBng chip: predicate truy\u1EC1n th\u1EB3ng lu\u00F4n truthy v\u00E0 Backspace / Delete v\u1EABn\r\n xo\u00E1 chip kho\u00E1 (A1). Khi kh\u00F4ng focus ch\u1EC9 hi\u1EC7n `maxVisible` chip, ph\u1EA7n d\u01B0 g\u1ED9p v\u00E0o \u201C+N\u201D (B7). Chip kho\u00E1 c\u00F3 n\u1EC1n\r\n ri\u00EAng, icon kho\u00E1 v\u00E0 t\u00EAn n\u1ED1i \u201C, kh\u00F4ng xo\u00E1 \u0111\u01B0\u1EE3c\u201D (C3). -->\r\n @for (item of visibleChips(); track item) {\r\n @let _removable = isRemovable(item);\r\n @let _text = chipText(item);\r\n <mat-chip-row\r\n class=\"sd-chip__chip\"\r\n [class.sd-chip__chip--locked]=\"!_removable\"\r\n [class.sd-chip__chip--duplicate]=\"duplicateChip() === item\"\r\n [removable]=\"_removable\"\r\n [aria-label]=\"chipLabel(item)\"\r\n (removed)=\"onRemove(item)\"\r\n (keydown)=\"onChipKeydown($event, item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span\r\n #chipTextEl\r\n class=\"sd-chip__chip-text\"\r\n [attr.data-chip]=\"_text\"\r\n [matTooltip]=\"_text\"\r\n [matTooltipDisabled]=\"!truncatedChips().has(_text)\"\r\n >{{ item }}</span\r\n >\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 \u2715 \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o \u00F4 trailing c\u1EE7a mat-chip-row ([matChipRemove]). -->\r\n @if (!inputControl.disabled && _removable) {\r\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\r\n }\r\n @if (!inputControl.disabled && !_removable) {\r\n <sd-icon class=\"sd-chip__lock\" name=\"lock\" [size]=\"_icons.chip\" [matTooltip]=\"lockedLabel()\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n @if (hiddenCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"sd-chip__more\"\r\n [attr.aria-label]=\"moreLabel()\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\r\n (click)=\"onMoreClick($event)\">\r\n +{{ hiddenCount() }}\r\n </button>\r\n }\r\n <!-- why: ph\u00EDm t\u00E1ch so theo `KeyboardEvent.key` trong onInputKeydown (keyCode c\u1EE7a `;` kh\u00E1c nhau theo b\u1ED1 c\u1EE5c b\u00E0n ph\u00EDm),\r\n n\u00EAn Material kh\u00F4ng nh\u1EADn ph\u00EDm n\u00E0o; n\u00F3 ch\u1EC9 c\u00F2n ph\u00E1t matChipInputTokenEnd khi blur (`addOnBlur`). `addable` false\r\n v\u1EABn gi\u1EEF \u00F4 nh\u1EADp v\u00EC mat-chip-grid c\u1EA7n matChipInputFor, nh\u01B0ng ch\u1EC9 \u0111\u1ECDc v\u00E0 ra kh\u1ECFi th\u1EE9 t\u1EF1 Tab. -->\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [readonly]=\"!addable()\"\r\n [attr.tabindex]=\"addable() ? null : -1\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"noSeparatorKeys\"\r\n [matChipInputAddOnBlur]=\"addOnBlur()\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (input)=\"onInputText()\"\r\n (paste)=\"onPaste($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : 'false'\"\r\n [attr.aria-describedby]=\"_hideInlineError && _errorVisible ? errorId : null\"\r\n #input />\r\n </mat-chip-grid>\r\n <!-- why: icon v\u00E0 ch\u1EEF l\u1ED7i \u1EA9n chung m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c matSuffix, n\u00EAn m\u1ED9t kh\u1ED1i @if \u0111\u1EE7 cho c\u1EA3 hai v\u00E0 v\u1EABn \u0111\u01B0\u1EE3c chi\u1EBFu\r\n v\u00E0o v\u00F9ng suffix. Ch\u1EEF \u1EA9n c\u00F3 id \u0111\u1EC3 \u00F4 nh\u1EADp tr\u1ECF aria-describedby sang (A8); v\u1EDBi <mat-error> th\u00EC\r\n mat-form-field t\u1EF1 n\u1ED1i. -->\r\n @if (_hideInlineError && _errorVisible) {\r\n <span matSuffix class=\"sd-chip__error-suffix\">\r\n <sd-icon class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\">{{ _errorMessage }}</span>\r\n </span>\r\n }\r\n <!-- why: n\u00FAt b\u1ECF h\u1EBFt nh\u01B0 `.sd-clear-btn` c\u1EE7a sd-date (hi\u1EC7n khi hover / focus-within). Lu\u00F4n gi\u1EEF ch\u1ED7: khi kh\u00F4ng c\u00F2n chip\r\n n\u00E0o b\u1ECF \u0111\u01B0\u1EE3c th\u00EC ch\u1EC9 \u1EA9n b\u1EB1ng visibility, kh\u00F4ng g\u1EE1 kh\u1ECFi DOM, \u0111\u1EC3 field kh\u00F4ng nh\u1EA3y (B6). -->\r\n @if (clearable() && !formControl.disabled && !_required) {\r\n @let _canClear = hasRemovable();\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-clear-btn sd-chip__clear sd-chip__suffix\"\r\n [class.sd-hover]=\"_canClear\"\r\n [class.sd-chip__clear--empty]=\"!_canClear\"\r\n [attr.aria-label]=\"clearLabel()\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\r\n (click)=\"onClear($event)\">\r\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\r\n </button>\r\n }\r\n\r\n @if (!_hideInlineError && _errorVisible) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n @if (effectiveMaxCount() > 0) {\r\n <mat-hint align=\"end\" class=\"sd-chip__counter\" [class.sd-chip__counter--full]=\"full()\">\r\n {{ chips().length }}/{{ effectiveMaxCount() }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n <!-- why: v\u00F9ng live lu\u00F4n c\u00F3 m\u1EB7t \u0111\u1EC3 screen reader \u0111\u1ECDc \u201C\u0111\u00E3 c\u00F3\u201D, \u201C\u0111\u00E3 \u0111\u1EE7\u201D, k\u1EBFt qu\u1EA3 d\u00E1n v\u00E0 \u201Ckh\u00F4ng xo\u00E1 \u0111\u01B0\u1EE3c\u201D ngay khi ch\u00FAng\r\n xu\u1EA5t hi\u1EC7n (B2, B3); id m\u1EDBi d\u1EF1ng l\u1EA1i ch\u1EEF \u0111\u1EC3 c\u00E2u l\u1EB7p l\u1EA1i v\u1EABn \u0111\u01B0\u1EE3c \u0111\u1ECDc. -->\r\n @let _live = liveMessage();\r\n <span class=\"sd-visually-hidden sd-chip__live\" aria-live=\"polite\">\r\n @for (message of _live ? [_live] : []; track message.id) {\r\n <span>{{ message.text }}</span>\r\n }\r\n </span>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-chip__chip-text{display:block;min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-bg)}.sd-chip__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-chip__view-trigger[aria-disabled=true]{cursor:default}.sd-chip__error-suffix{display:inline-flex;align-items:center}.sd-chip__clear--empty{visibility:hidden}@media(pointer:coarse){.sd-chip__clear.sd-hover{visibility:visible}}.sd-chip__counter--full{color:var(--sd-warning)}\n"] }]
|
|
392
692
|
}], ctorParameters: () => [] });
|
|
393
693
|
|
|
394
694
|
/**
|
|
395
695
|
* Generated bundle index. Do not edit.
|
|
396
696
|
*/
|
|
397
697
|
|
|
398
|
-
export { SdChip
|
|
698
|
+
export { SdChip };
|
|
399
699
|
//# sourceMappingURL=sdcorejs-angular-forms-chip.mjs.map
|