@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,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe, Injectable, inject, SecurityContext } from '@angular/core';
|
|
3
|
+
import { ɵsdInjectDateTime as _sdInjectDateTime } from '@sdcorejs/angular/services/date-time';
|
|
3
4
|
import { DateUtilities, NumberUtilities } from '@sdcorejs/utils/fns';
|
|
4
5
|
import { SD_CORE_CONFIGURATION } from '@sdcorejs/angular/configurations';
|
|
5
6
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -8,8 +9,10 @@ import { map, takeWhile } from 'rxjs/operators';
|
|
|
8
9
|
import { EMPTY_STR } from '@sdcorejs/utils/constants';
|
|
9
10
|
|
|
10
11
|
class SdFormatDatePipe {
|
|
12
|
+
// why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).
|
|
13
|
+
#dateTime = _sdInjectDateTime();
|
|
11
14
|
transform(value, format = 'dd/MM/yyyy') {
|
|
12
|
-
return DateUtilities.toFormat(value, format) || null;
|
|
15
|
+
return (this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format)) || null;
|
|
13
16
|
}
|
|
14
17
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdFormatDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
15
18
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: SdFormatDatePipe, isStandalone: true, name: "sdFormatDate" });
|
|
@@ -29,8 +32,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
29
32
|
}] });
|
|
30
33
|
|
|
31
34
|
class SdFormatDatetimePipe {
|
|
35
|
+
// why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).
|
|
36
|
+
#dateTime = _sdInjectDateTime();
|
|
32
37
|
transform(value, format = 'dd/MM/yyyy HH:mm:ss') {
|
|
33
|
-
return DateUtilities.toFormat(value, format) || null;
|
|
38
|
+
return (this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format)) || null;
|
|
34
39
|
}
|
|
35
40
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdFormatDatetimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
36
41
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: SdFormatDatetimePipe, isStandalone: true, name: "sdFormatDatetime" });
|
|
@@ -134,6 +139,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
134
139
|
}] });
|
|
135
140
|
|
|
136
141
|
class SdTimeDifferentPipe {
|
|
142
|
+
// why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).
|
|
143
|
+
#dateTime = _sdInjectDateTime();
|
|
137
144
|
maxSecond = 60;
|
|
138
145
|
maxMinute = this.maxSecond * 60;
|
|
139
146
|
maxHour = this.maxMinute * 24;
|
|
@@ -144,22 +151,35 @@ class SdTimeDifferentPipe {
|
|
|
144
151
|
return of('');
|
|
145
152
|
}
|
|
146
153
|
if (!different) {
|
|
147
|
-
return of(
|
|
154
|
+
return of(this.#format(value, format));
|
|
148
155
|
}
|
|
149
|
-
const elapsedSeconds = () => Math.round((new Date().getTime() -
|
|
156
|
+
const elapsedSeconds = () => Math.round((new Date().getTime() - this.#instant(value)) / 1000);
|
|
150
157
|
if (elapsedSeconds() < 0) {
|
|
151
|
-
return of(
|
|
158
|
+
return of(this.#format(value, format));
|
|
152
159
|
}
|
|
153
160
|
const threshold = this.#threshold(different);
|
|
154
161
|
// why: quá ngưỡng thì output là một chuỗi ngày tĩnh, tick mỗi giây không đổi được gì nữa.
|
|
155
162
|
// Trả `of()` để không tạo timer nào cho các giá trị đã cũ (list N dòng = N timer thừa).
|
|
156
163
|
if (elapsedSeconds() >= threshold) {
|
|
157
|
-
return of(
|
|
164
|
+
return of(this.#format(value, format));
|
|
158
165
|
}
|
|
159
166
|
// why: `interval(1000)` cũ KHÔNG BAO GIỜ complete — mỗi usage giữ một timer + một lượt
|
|
160
167
|
// change-detection của async pipe mỗi giây, vĩnh viễn, kể cả khi giá trị đã vượt ngưỡng
|
|
161
168
|
// tương đối. `takeWhile(..., true)` phát nốt lần cuối (dạng ngày tuyệt đối) rồi complete.
|
|
162
|
-
return interval(1000).pipe(map(() => elapsedSeconds()), takeWhile(elapsed => elapsed < threshold, true), map(elapsed => (elapsed < threshold ?
|
|
169
|
+
return interval(1000).pipe(map(() => elapsedSeconds()), takeWhile(elapsed => elapsed < threshold, true), map(elapsed => (elapsed < threshold ? this.#relative(value) : this.#format(value, format))));
|
|
170
|
+
}
|
|
171
|
+
#format(value, format) {
|
|
172
|
+
return this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format);
|
|
173
|
+
}
|
|
174
|
+
// why: local mode keeps the native parse it always used; a zone reads zone-less values as wall clock in the zone.
|
|
175
|
+
#instant(value) {
|
|
176
|
+
return this.#zoned() ? (this.#dateTime.parse(value)?.getTime() ?? NaN) : new Date(value).getTime();
|
|
177
|
+
}
|
|
178
|
+
#relative(value) {
|
|
179
|
+
return this.#zoned() ? DateUtilities.timeDifference(new Date(this.#instant(value))) : DateUtilities.timeDifference(value);
|
|
180
|
+
}
|
|
181
|
+
#zoned() {
|
|
182
|
+
return !!this.#dateTime && this.#dateTime.timeZone !== 'local';
|
|
163
183
|
}
|
|
164
184
|
#threshold(different) {
|
|
165
185
|
switch (different) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-pipes.mjs","sources":["../../../projects/sdcorejs-angular/pipes/src/format-date.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/format-datetime.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/format-number.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/safe-html.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/time-different.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/empty.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/view.pipe.ts","../../../projects/sdcorejs-angular/pipes/sdcorejs-angular-pipes.ts"],"sourcesContent":["import { Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\n\n@Pipe({\n name: 'sdFormatDate',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatDatePipe implements PipeTransform {\n transform(value: unknown, format = 'dd/MM/yyyy'): string | null {\n return DateUtilities.toFormat(value, format) || null;\n }\n}\n","import { Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\n\n@Pipe({\n name: 'sdFormatDatetime',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatDatetimePipe implements PipeTransform {\n transform(value: unknown, format = 'dd/MM/yyyy HH:mm:ss'): string | null {\n return DateUtilities.toFormat(value, format) || null;\n }\n}\n","import { inject, Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { ISdCoreConfiguration, SD_CORE_CONFIGURATION } from '@sdcorejs/angular/configurations';\nimport { NumberUtilities } from '@sdcorejs/utils/fns';\n@Pipe({\n name: 'sdFormatNumber',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatNumberPipe implements PipeTransform {\n private readonly coreConfiguration: ISdCoreConfiguration | null = inject(SD_CORE_CONFIGURATION, { optional: true });\n\n transform(value: any, digits?: number, format?: '1,234,567.89' | '1.234.567,89') {\n const resolvedFormat = format ?? this.coreConfiguration?.format?.number;\n const fixedValue = NumberUtilities.isNumber(value) ? (+value).toFixed(digits ?? 2) : null;\n if (resolvedFormat === '1.234.567,89') {\n return NumberUtilities.toVN(fixedValue);\n }\n return NumberUtilities.toISO(fixedValue);\n }\n}\n","import { Injectable, Pipe, PipeTransform, SecurityContext, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Render an HTML string through `[innerHTML]`.\n *\n * why: this pipe used to call `bypassSecurityTrustHtml()` unconditionally, on every value, with no\n * sanitize step. That turned every call site into a stored-XSS sink — and the library itself pipes\n * server-supplied table cell data through it\n * (`components/table/src/components/desktop-cell/view/view.component.html`), while\n * `components/table/sd-table.md` already described the value as \"sanitized via sdSafeHtml\".\n *\n * Now it **sanitizes by default** and the bypass is an explicit, per-call-site opt-in:\n *\n * ```html\n * <!-- untrusted / server-supplied: script, on* handlers and javascript: urls are stripped -->\n * <div [innerHTML]=\"row.note | sdSafeHtml\"></div>\n *\n * <!-- app-authored markup you control, e.g. an inline SVG sprite -->\n * <span [innerHTML]=\"iconSvg | sdSafeHtml: true\"></span>\n * ```\n *\n * This mirrors the decision already taken for the toast in `services/notify`: text-safe by default,\n * opt-in HTML. Auto-detecting \"this looks like HTML\" is deliberately NOT done — it would escalate\n * untrusted text that merely contains `<` straight back into the unsanitized sink.\n */\n@Pipe({\n name: 'sdSafeHtml',\n standalone: true,\n})\n// why: kept `providedIn: 'root'` — consumer có thể `inject(SdSafeHtmlPipe)` để dùng ngoài template.\n// Bỏ nó đi là một breaking change về DI (NullInjectorError) không liên quan gì tới việc siết XSS.\n@Injectable({\n providedIn: 'root',\n})\nexport class SdSafeHtmlPipe implements PipeTransform {\n readonly #sanitizer = inject(DomSanitizer);\n\n transform(html: string | number | undefined | null, trusted = false): SafeHtml | string | number | undefined {\n if (typeof html === 'number') {\n return html;\n }\n if (!html) {\n return undefined;\n }\n if (trusted) {\n // Caller has explicitly declared this markup as app-authored.\n return this.#sanitizer.bypassSecurityTrustHtml(html);\n }\n // `sanitize` returns `null` when the value is entirely stripped; normalise to `''` so the\n // binding clears the element instead of rendering the string \"null\".\n return this.#sanitizer.sanitize(SecurityContext.HTML, html) ?? '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\nimport { interval, Observable, of } from 'rxjs';\nimport { map, takeWhile } from 'rxjs/operators';\n@Pipe({\n name: 'sdTimeDifferent',\n standalone: true,\n})\nexport class SdTimeDifferentPipe implements PipeTransform {\n private maxSecond = 60;\n private maxMinute = this.maxSecond * 60;\n private maxHour = this.maxMinute * 24;\n private maxDay = this.maxHour * 30;\n private maxMonth = this.maxHour * 365;\n transform(value: any, format: string, different: 'second' | 'minute' | 'hour' | 'day' | 'month'): Observable<string> {\n if (!DateUtilities.isDate(value)) {\n return of('');\n }\n if (!different) {\n return of(DateUtilities.toFormat(value, format));\n }\n const elapsedSeconds = () => Math.round((new Date().getTime() - new Date(value).getTime()) / 1000);\n if (elapsedSeconds() < 0) {\n return of(DateUtilities.toFormat(value, format));\n }\n const threshold = this.#threshold(different);\n // why: quá ngưỡng thì output là một chuỗi ngày tĩnh, tick mỗi giây không đổi được gì nữa.\n // Trả `of()` để không tạo timer nào cho các giá trị đã cũ (list N dòng = N timer thừa).\n if (elapsedSeconds() >= threshold) {\n return of(DateUtilities.toFormat(value, format));\n }\n // why: `interval(1000)` cũ KHÔNG BAO GIỜ complete — mỗi usage giữ một timer + một lượt\n // change-detection của async pipe mỗi giây, vĩnh viễn, kể cả khi giá trị đã vượt ngưỡng\n // tương đối. `takeWhile(..., true)` phát nốt lần cuối (dạng ngày tuyệt đối) rồi complete.\n return interval(1000).pipe(\n map(() => elapsedSeconds()),\n takeWhile(elapsed => elapsed < threshold, true),\n map(elapsed => (elapsed < threshold ? DateUtilities.timeDifference(value) : DateUtilities.toFormat(value, format)))\n );\n }\n\n #threshold(different: 'second' | 'minute' | 'hour' | 'day' | 'month'): number {\n switch (different) {\n case 'month':\n return this.maxMonth;\n case 'day':\n return this.maxDay;\n case 'hour':\n return this.maxHour;\n case 'minute':\n return this.maxMinute;\n default:\n return this.maxSecond;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EMPTY_STR } from '@sdcorejs/utils/constants';\n@Pipe({\n name: 'sdEmpty',\n standalone: true,\n})\nexport class SdEmptyPipe implements PipeTransform {\n transform(value: any): string {\n if (value === undefined || value === null || value === '') {\n return EMPTY_STR;\n }\n return value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EMPTY_STR } from '@sdcorejs/utils/constants';\n\n@Pipe({\n name: 'sdView',\n standalone: true,\n})\nexport class SdViewPipe implements PipeTransform {\n transform(value: unknown): string {\n if (value === null || value === undefined || value === '' || (typeof value === 'number' && Number.isNaN(value))) {\n return EMPTY_STR;\n }\n\n if (Array.isArray(value)) {\n if (!value.length) return EMPTY_STR;\n return value.map(item => this.transform(item)).join(', ');\n }\n\n return `${value}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAUa,gBAAgB,CAAA;AAC3B,IAAA,SAAS,CAAC,KAAc,EAAE,MAAM,GAAG,YAAY,EAAA;QAC7C,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI;IACtD;wGAHW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;sGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,cAAc;AACpB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;kBACA,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCCY,oBAAoB,CAAA;AAC/B,IAAA,SAAS,CAAC,KAAc,EAAE,MAAM,GAAG,qBAAqB,EAAA;QACtD,OAAO,aAAa,CAAC,QAAQ,CAAC,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AV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,QAAQ;AACd,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-pipes.mjs","sources":["../../../projects/sdcorejs-angular/pipes/src/format-date.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/format-datetime.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/format-number.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/safe-html.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/time-different.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/empty.pipe.ts","../../../projects/sdcorejs-angular/pipes/src/view.pipe.ts","../../../projects/sdcorejs-angular/pipes/sdcorejs-angular-pipes.ts"],"sourcesContent":["import { Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { ɵsdInjectDateTime } from '@sdcorejs/angular/services/date-time';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\n\n@Pipe({\n name: 'sdFormatDate',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatDatePipe implements PipeTransform {\n // why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).\n readonly #dateTime = ɵsdInjectDateTime();\n\n transform(value: unknown, format = 'dd/MM/yyyy'): string | null {\n return (this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format)) || null;\n }\n}\n","import { Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { ɵsdInjectDateTime } from '@sdcorejs/angular/services/date-time';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\n\n@Pipe({\n name: 'sdFormatDatetime',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatDatetimePipe implements PipeTransform {\n // why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).\n readonly #dateTime = ɵsdInjectDateTime();\n\n transform(value: unknown, format = 'dd/MM/yyyy HH:mm:ss'): string | null {\n return (this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format)) || null;\n }\n}\n","import { inject, Injectable, Pipe, PipeTransform } from '@angular/core';\nimport { ISdCoreConfiguration, SD_CORE_CONFIGURATION } from '@sdcorejs/angular/configurations';\nimport { NumberUtilities } from '@sdcorejs/utils/fns';\n@Pipe({\n name: 'sdFormatNumber',\n standalone: true,\n})\n@Injectable({\n providedIn: 'root',\n})\nexport class SdFormatNumberPipe implements PipeTransform {\n private readonly coreConfiguration: ISdCoreConfiguration | null = inject(SD_CORE_CONFIGURATION, { optional: true });\n\n transform(value: any, digits?: number, format?: '1,234,567.89' | '1.234.567,89') {\n const resolvedFormat = format ?? this.coreConfiguration?.format?.number;\n const fixedValue = NumberUtilities.isNumber(value) ? (+value).toFixed(digits ?? 2) : null;\n if (resolvedFormat === '1.234.567,89') {\n return NumberUtilities.toVN(fixedValue);\n }\n return NumberUtilities.toISO(fixedValue);\n }\n}\n","import { Injectable, Pipe, PipeTransform, SecurityContext, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Render an HTML string through `[innerHTML]`.\n *\n * why: this pipe used to call `bypassSecurityTrustHtml()` unconditionally, on every value, with no\n * sanitize step. That turned every call site into a stored-XSS sink — and the library itself pipes\n * server-supplied table cell data through it\n * (`components/table/src/components/desktop-cell/view/view.component.html`), while\n * `components/table/sd-table.md` already described the value as \"sanitized via sdSafeHtml\".\n *\n * Now it **sanitizes by default** and the bypass is an explicit, per-call-site opt-in:\n *\n * ```html\n * <!-- untrusted / server-supplied: script, on* handlers and javascript: urls are stripped -->\n * <div [innerHTML]=\"row.note | sdSafeHtml\"></div>\n *\n * <!-- app-authored markup you control, e.g. an inline SVG sprite -->\n * <span [innerHTML]=\"iconSvg | sdSafeHtml: true\"></span>\n * ```\n *\n * This mirrors the decision already taken for the toast in `services/notify`: text-safe by default,\n * opt-in HTML. Auto-detecting \"this looks like HTML\" is deliberately NOT done — it would escalate\n * untrusted text that merely contains `<` straight back into the unsanitized sink.\n */\n@Pipe({\n name: 'sdSafeHtml',\n standalone: true,\n})\n// why: kept `providedIn: 'root'` — consumer có thể `inject(SdSafeHtmlPipe)` để dùng ngoài template.\n// Bỏ nó đi là một breaking change về DI (NullInjectorError) không liên quan gì tới việc siết XSS.\n@Injectable({\n providedIn: 'root',\n})\nexport class SdSafeHtmlPipe implements PipeTransform {\n readonly #sanitizer = inject(DomSanitizer);\n\n transform(html: string | number | undefined | null, trusted = false): SafeHtml | string | number | undefined {\n if (typeof html === 'number') {\n return html;\n }\n if (!html) {\n return undefined;\n }\n if (trusted) {\n // Caller has explicitly declared this markup as app-authored.\n return this.#sanitizer.bypassSecurityTrustHtml(html);\n }\n // `sanitize` returns `null` when the value is entirely stripped; normalise to `''` so the\n // binding clears the element instead of rendering the string \"null\".\n return this.#sanitizer.sanitize(SecurityContext.HTML, html) ?? '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ɵsdInjectDateTime } from '@sdcorejs/angular/services/date-time';\nimport { DateUtilities } from '@sdcorejs/utils/fns';\nimport { interval, Observable, of } from 'rxjs';\nimport { map, takeWhile } from 'rxjs/operators';\n@Pipe({\n name: 'sdTimeDifferent',\n standalone: true,\n})\nexport class SdTimeDifferentPipe implements PipeTransform {\n // why: `new …Pipe()` outside an injection context keeps the local behavior (no zone).\n readonly #dateTime = ɵsdInjectDateTime();\n\n private maxSecond = 60;\n private maxMinute = this.maxSecond * 60;\n private maxHour = this.maxMinute * 24;\n private maxDay = this.maxHour * 30;\n private maxMonth = this.maxHour * 365;\n transform(value: any, format: string, different: 'second' | 'minute' | 'hour' | 'day' | 'month'): Observable<string> {\n if (!DateUtilities.isDate(value)) {\n return of('');\n }\n if (!different) {\n return of(this.#format(value, format));\n }\n const elapsedSeconds = () => Math.round((new Date().getTime() - this.#instant(value)) / 1000);\n if (elapsedSeconds() < 0) {\n return of(this.#format(value, format));\n }\n const threshold = this.#threshold(different);\n // why: quá ngưỡng thì output là một chuỗi ngày tĩnh, tick mỗi giây không đổi được gì nữa.\n // Trả `of()` để không tạo timer nào cho các giá trị đã cũ (list N dòng = N timer thừa).\n if (elapsedSeconds() >= threshold) {\n return of(this.#format(value, format));\n }\n // why: `interval(1000)` cũ KHÔNG BAO GIỜ complete — mỗi usage giữ một timer + một lượt\n // change-detection của async pipe mỗi giây, vĩnh viễn, kể cả khi giá trị đã vượt ngưỡng\n // tương đối. `takeWhile(..., true)` phát nốt lần cuối (dạng ngày tuyệt đối) rồi complete.\n return interval(1000).pipe(\n map(() => elapsedSeconds()),\n takeWhile(elapsed => elapsed < threshold, true),\n map(elapsed => (elapsed < threshold ? this.#relative(value) : this.#format(value, format)))\n );\n }\n\n #format(value: unknown, format: string): string {\n return this.#dateTime ? this.#dateTime.toFormat(value, format) : DateUtilities.toFormat(value, format);\n }\n\n // why: local mode keeps the native parse it always used; a zone reads zone-less values as wall clock in the zone.\n #instant(value: any): number {\n return this.#zoned() ? (this.#dateTime!.parse(value)?.getTime() ?? NaN) : new Date(value).getTime();\n }\n\n #relative(value: any): string {\n return this.#zoned() ? DateUtilities.timeDifference(new Date(this.#instant(value))) : DateUtilities.timeDifference(value);\n }\n\n #zoned(): boolean {\n return !!this.#dateTime && this.#dateTime.timeZone !== 'local';\n }\n\n #threshold(different: 'second' | 'minute' | 'hour' | 'day' | 'month'): number {\n switch (different) {\n case 'month':\n return this.maxMonth;\n case 'day':\n return this.maxDay;\n case 'hour':\n return this.maxHour;\n case 'minute':\n return this.maxMinute;\n default:\n return this.maxSecond;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EMPTY_STR } from '@sdcorejs/utils/constants';\n@Pipe({\n name: 'sdEmpty',\n standalone: true,\n})\nexport class SdEmptyPipe implements PipeTransform {\n transform(value: any): string {\n if (value === undefined || value === null || value === '') {\n return EMPTY_STR;\n }\n return value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EMPTY_STR } from '@sdcorejs/utils/constants';\n\n@Pipe({\n name: 'sdView',\n standalone: true,\n})\nexport class SdViewPipe implements PipeTransform {\n transform(value: unknown): string {\n if (value === null || value === undefined || value === '' || (typeof value === 'number' && Number.isNaN(value))) {\n return EMPTY_STR;\n }\n\n if (Array.isArray(value)) {\n if (!value.length) return EMPTY_STR;\n return value.map(item => this.transform(item)).join(', ');\n }\n\n return `${value}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵsdInjectDateTime"],"mappings":";;;;;;;;;;MAWa,gBAAgB,CAAA;;IAElB,SAAS,GAAGA,iBAAiB,EAAE;AAExC,IAAA,SAAS,CAAC,KAAc,EAAE,MAAM,GAAG,YAAY,EAAA;AAC7C,QAAA,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI;IAClH;wGANW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;sGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAP5B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,cAAc;A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QAAA,EAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,QAAQ;AACd,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -70,7 +70,7 @@ class DialogConfirmComponent {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: DialogConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: DialogConfirmComponent, isStandalone: true, selector: "sd-dialog-confirm", ngImport: i0, template: "<div mat-dialog-content class=\"sd-dialog-confirm__content\" [class.sd-dialog-confirm__content--radio]=\"data.radio\">\n <div class=\"sd-dialog-confirm__header\">\n <span class=\"sd-dialog-confirm__icon\" aria-hidden=\"true\" [attr.data-icon]=\"resolvedIcon\" [attr.data-tone]=\"iconTone\" [attr.data-icon-shape]=\"iconShape\">\n <sd-icon [name]=\"resolvedIcon\" size=\"22px\"></sd-icon>\n </span>\n <div class=\"sd-dialog-confirm__copy\">\n <h2 mat-dialog-title class=\"sd-dialog-confirm__title\" [innerHtml]=\"data.title || 'Confirm'\"></h2>\n @if (data.message) {\n <div class=\"sd-dialog-confirm__message\" [innerHtml]=\"data.message\"></div>\n }\n </div>\n </div>\n @if (hasFields) {\n <div class=\"sd-dialog-confirm__fields\">\n @if (data.input) {\n <sd-textarea\n [label]=\"data.input.label\"\n [placeholder]=\"data.input.placeholder\"\n [(model)]=\"value\"\n [rows]=\"3\"\n [required]=\"data.input.required\"\n [maxlength]=\"data.input.maxlength!\" />\n }\n @if (data.select) {\n <sd-select\n [placeholder]=\"data.select.placeholder\"\n [items]=\"data.select.items\"\n [valueField]=\"data.select.valueField\"\n [displayField]=\"data.select.displayField\"\n [multiple]=\"data.select.multiple\"\n [(model)]=\"value\"\n [required]=\"data.select.required\">\n </sd-select>\n }\n @if (data.date) {\n <sd-date\n [placeholder]=\"data.date.placeholder\"\n [(model)]=\"value\"\n type=\"date\"\n [min]=\"data.date.min!\"\n [max]=\"data.date.max!\"\n [required]=\"data.date.required\">\n </sd-date>\n }\n @if (data.datetime) {\n <sd-datetime\n [placeholder]=\"data.datetime.placeholder\"\n [(model)]=\"value\"\n [min]=\"data.datetime.min!\"\n [max]=\"data.datetime.max!\"\n [showSeconds]=\"data.datetime.showSeconds\"\n [required]=\"data.datetime.required\">\n </sd-datetime>\n }\n @if (data.radio) {\n <sd-radio\n [items]=\"data.radio.items\"\n [valueField]=\"data.radio.valueField\"\n [displayField]=\"data.radio.displayField\"\n [display]=\"data.radio.display || 'column'\"\n [(model)]=\"value\"\n [required]=\"data.radio.required\">\n </sd-radio>\n }\n </div>\n }\n</div>\n<div mat-dialog-actions align=\"end\" class=\"sd-dialog-confirm__actions\">\n @if (data.noTitle) {\n <sd-button\n data-confirm-cancel\n size=\"sm\"\n type=\"light\"\n htmlType=\"button\"\n [color]=\"data.noButtonColor || 'secondary'\"\n [title]=\"data.noTitle\"\n (click)=\"onCancel()\"></sd-button>\n }\n @if (data.yesTitle) {\n <sd-button\n data-confirm-accept\n size=\"sm\"\n type=\"fill\"\n htmlType=\"button\"\n [color]=\"data.yesButtonColor || 'primary'\"\n [disabled]=\"\n required &&\n (value === undefined ||\n value === null ||\n value === '' ||\n (data.input && !value.trim()) ||\n (value.length !== undefined && value.length === 0))\n \"\n [title]=\"data.yesTitle\"\n (click)=\"onAccept()\"></sd-button>\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;box-sizing:border-box;min-height:0;max-height:calc(100dvh - 32px);padding:20px;overflow:hidden}.sd-dialog-confirm__content{min-height:0;max-height:none;margin:0;padding:0;color:var(--sd-text)}.sd-dialog-confirm__header{display:flex;align-items:flex-start;gap:12px}.sd-dialog-confirm__icon{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border-radius:var(--sd-icon-shape-radius, var(--sd-radius-8, 8px));color:var(--sd-primary-dark);background:var(--sd-primary-light)}.sd-dialog-confirm__icon[data-tone=success]{color:var(--sd-success-dark);background:var(--sd-success-light)}.sd-dialog-confirm__icon[data-tone=info]{color:var(--sd-info-dark);background:var(--sd-info-light)}.sd-dialog-confirm__icon[data-tone=warning]{color:var(--sd-warning-dark);background:var(--sd-warning-light)}.sd-dialog-confirm__icon[data-tone=error]{color:var(--sd-error-dark);background:var(--sd-error-light)}.sd-dialog-confirm__icon[data-icon-shape=circle]{border-radius:50%}.sd-dialog-confirm__icon[data-icon-shape=none]{background:transparent}.sd-dialog-confirm__icon sd-icon{width:22px;height:22px;font-size:var(--sd-font-size-22, 22px);line-height:var(--sd-line-height-22, 22px)}.sd-dialog-confirm__copy{min-width:0}.sd-dialog-confirm__title{margin:0 0 6px;padding:0;font:inherit;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);line-height:25px;letter-spacing:normal;color:var(--sd-text);overflow-wrap:anywhere}.sd-dialog-confirm__title:before{display:none}.sd-dialog-confirm__message{font-size:var(--sd-font-size-14, 14px);line-height:21px;letter-spacing:normal;color:var(--sd-text-secondary);overflow-wrap:anywhere}.sd-dialog-confirm__fields{margin-top:20px}.sd-dialog-confirm__fields sd-radio{height:auto}.sd-dialog-confirm__fields ::ng-deep .mdc-radio{display:inline-flex;align-items:center;justify-content:center}.sd-dialog-confirm__fields ::ng-deep .mat-mdc-radio-button{display:inline-flex;align-items:center;min-height:48px}.sd-dialog-confirm__fields ::ng-deep .c-radio-group-row{flex-wrap:wrap;row-gap:4px}.sd-dialog-confirm__actions{flex-shrink:0;gap:8px;min-height:0;margin:24px 0 0;padding:0}::ng-deep .sd-confirm-panel .mat-mdc-dialog-surface{border-radius:var(--sd-radius-8, 8px);box-shadow:0 16px 48px #00000029,0 2px 8px #0000000f}::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:3px}::ng-deep .sd-confirm-panel .sd-dialog-confirm__message>:first-child{margin-top:0}::ng-deep .sd-confirm-panel .sd-dialog-confirm__message>:last-child{margin-bottom:0}@media(prefers-reduced-motion:reduce){::ng-deep .sd-confirm-panel .mat-mdc-dialog-container,::ng-deep .sd-confirm-panel .mat-mdc-dialog-surface{transition:none!important}}@media(max-width:600px){::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions sd-button{flex:1}::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions sd-button button{width:100%;min-height:44px}}@media(max-width:600px){:host{padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdRadio, selector: "sd-radio", inputs: ["autoId", "name", "form", "label", "placeholder", "display", "items", "valueField", "displayField", "required", "inlineError", "disabled", "viewed", "color", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdTextarea, selector: "sd-textarea", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "rows", "hideInlineError", "required", "disabled", "viewed", "autoHeight", "maxlength", "minlength", "pattern", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "model"], outputs: ["modelChange", "sdChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: DialogConfirmComponent, isStandalone: true, selector: "sd-dialog-confirm", ngImport: i0, template: "<div mat-dialog-content class=\"sd-dialog-confirm__content\" [class.sd-dialog-confirm__content--radio]=\"data.radio\">\n <div class=\"sd-dialog-confirm__header\">\n <span class=\"sd-dialog-confirm__icon\" aria-hidden=\"true\" [attr.data-icon]=\"resolvedIcon\" [attr.data-tone]=\"iconTone\" [attr.data-icon-shape]=\"iconShape\">\n <sd-icon [name]=\"resolvedIcon\" size=\"22px\"></sd-icon>\n </span>\n <div class=\"sd-dialog-confirm__copy\">\n <h2 mat-dialog-title class=\"sd-dialog-confirm__title\" [innerHtml]=\"data.title || 'Confirm'\"></h2>\n @if (data.message) {\n <div class=\"sd-dialog-confirm__message\" [innerHtml]=\"data.message\"></div>\n }\n </div>\n </div>\n @if (hasFields) {\n <div class=\"sd-dialog-confirm__fields\">\n @if (data.input) {\n <sd-textarea\n [label]=\"data.input.label\"\n [placeholder]=\"data.input.placeholder\"\n [(model)]=\"value\"\n [rows]=\"3\"\n [required]=\"data.input.required\"\n [maxlength]=\"data.input.maxlength!\" />\n }\n @if (data.select) {\n <sd-select\n [placeholder]=\"data.select.placeholder\"\n [items]=\"data.select.items\"\n [valueField]=\"data.select.valueField\"\n [displayField]=\"data.select.displayField\"\n [multiple]=\"data.select.multiple\"\n [(model)]=\"value\"\n [required]=\"data.select.required\">\n </sd-select>\n }\n @if (data.date) {\n <sd-date\n [placeholder]=\"data.date.placeholder\"\n [(model)]=\"value\"\n type=\"date\"\n [min]=\"data.date.min!\"\n [max]=\"data.date.max!\"\n [required]=\"data.date.required\">\n </sd-date>\n }\n @if (data.datetime) {\n <sd-datetime\n [placeholder]=\"data.datetime.placeholder\"\n [(model)]=\"value\"\n [min]=\"data.datetime.min!\"\n [max]=\"data.datetime.max!\"\n [showSeconds]=\"data.datetime.showSeconds\"\n [required]=\"data.datetime.required\">\n </sd-datetime>\n }\n @if (data.radio) {\n <sd-radio\n [items]=\"data.radio.items\"\n [valueField]=\"data.radio.valueField\"\n [displayField]=\"data.radio.displayField\"\n [display]=\"data.radio.display || 'column'\"\n [(model)]=\"value\"\n [required]=\"data.radio.required\">\n </sd-radio>\n }\n </div>\n }\n</div>\n<div mat-dialog-actions align=\"end\" class=\"sd-dialog-confirm__actions\">\n @if (data.noTitle) {\n <sd-button\n data-confirm-cancel\n size=\"sm\"\n type=\"light\"\n htmlType=\"button\"\n [color]=\"data.noButtonColor || 'secondary'\"\n [title]=\"data.noTitle\"\n (click)=\"onCancel()\"></sd-button>\n }\n @if (data.yesTitle) {\n <sd-button\n data-confirm-accept\n size=\"sm\"\n type=\"fill\"\n htmlType=\"button\"\n [color]=\"data.yesButtonColor || 'primary'\"\n [disabled]=\"\n required &&\n (value === undefined ||\n value === null ||\n value === '' ||\n (data.input && !value.trim()) ||\n (value.length !== undefined && value.length === 0))\n \"\n [title]=\"data.yesTitle\"\n (click)=\"onAccept()\"></sd-button>\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;box-sizing:border-box;min-height:0;max-height:calc(100dvh - 32px);padding:20px;overflow:hidden}.sd-dialog-confirm__content{min-height:0;max-height:none;margin:0;padding:0;color:var(--sd-text)}.sd-dialog-confirm__header{display:flex;align-items:flex-start;gap:12px}.sd-dialog-confirm__icon{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border-radius:var(--sd-icon-shape-radius, var(--sd-radius-8, 8px));color:var(--sd-primary-dark);background:var(--sd-primary-light)}.sd-dialog-confirm__icon[data-tone=success]{color:var(--sd-success-dark);background:var(--sd-success-light)}.sd-dialog-confirm__icon[data-tone=info]{color:var(--sd-info-dark);background:var(--sd-info-light)}.sd-dialog-confirm__icon[data-tone=warning]{color:var(--sd-warning-dark);background:var(--sd-warning-light)}.sd-dialog-confirm__icon[data-tone=error]{color:var(--sd-error-dark);background:var(--sd-error-light)}.sd-dialog-confirm__icon[data-icon-shape=circle]{border-radius:50%}.sd-dialog-confirm__icon[data-icon-shape=none]{background:transparent}.sd-dialog-confirm__icon sd-icon{width:22px;height:22px;font-size:var(--sd-font-size-22, 22px);line-height:var(--sd-line-height-22, 22px)}.sd-dialog-confirm__copy{min-width:0}.sd-dialog-confirm__title{margin:0 0 6px;padding:0;font:inherit;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);line-height:25px;letter-spacing:normal;color:var(--sd-text);overflow-wrap:anywhere}.sd-dialog-confirm__title:before{display:none}.sd-dialog-confirm__message{font-size:var(--sd-font-size-14, 14px);line-height:21px;letter-spacing:normal;color:var(--sd-text-secondary);overflow-wrap:anywhere}.sd-dialog-confirm__fields{margin-top:20px}.sd-dialog-confirm__fields sd-radio{height:auto}.sd-dialog-confirm__fields ::ng-deep .mdc-radio{display:inline-flex;align-items:center;justify-content:center}.sd-dialog-confirm__fields ::ng-deep .mat-mdc-radio-button{display:inline-flex;align-items:center;min-height:48px}.sd-dialog-confirm__fields ::ng-deep .c-radio-group-row{flex-wrap:wrap;row-gap:4px}.sd-dialog-confirm__actions{flex-shrink:0;gap:8px;min-height:0;margin:24px 0 0;padding:0}::ng-deep .sd-confirm-panel .mat-mdc-dialog-surface{border-radius:var(--sd-radius-8, 8px);box-shadow:0 16px 48px #00000029,0 2px 8px #0000000f}::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:3px}::ng-deep .sd-confirm-panel .sd-dialog-confirm__message>:first-child{margin-top:0}::ng-deep .sd-confirm-panel .sd-dialog-confirm__message>:last-child{margin-bottom:0}@media(prefers-reduced-motion:reduce){::ng-deep .sd-confirm-panel .mat-mdc-dialog-container,::ng-deep .sd-confirm-panel .mat-mdc-dialog-surface{transition:none!important}}@media(max-width:600px){::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions sd-button{flex:1}::ng-deep .sd-confirm-panel .sd-dialog-confirm__actions sd-button button{width:100%;min-height:44px}}@media(max-width:600px){:host{padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdRadio, selector: "sd-radio", inputs: ["autoId", "name", "form", "label", "placeholder", "display", "items", "valueField", "displayField", "required", "inlineError", "disabled", "viewed", "color", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdTextarea, selector: "sd-textarea", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "rows", "hideInlineError", "required", "disabled", "viewed", "autoHeight", "maxlength", "minlength", "pattern", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "model"], outputs: ["modelChange", "sdChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
74
|
}
|
|
75
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: DialogConfirmComponent, decorators: [{
|
|
76
76
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-services-confirm.mjs","sources":["../../../projects/sdcorejs-angular/services/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../projects/sdcorejs-angular/services/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.html","../../../projects/sdcorejs-angular/services/confirm/src/lib/confirm.service.ts","../../../projects/sdcorejs-angular/services/confirm/src/public-api.ts","../../../projects/sdcorejs-angular/services/confirm/sdcorejs-angular-services-confirm.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdDate } from '@sdcorejs/angular/forms/date';\nimport { SdDatetime } from '@sdcorejs/angular/forms/datetime';\nimport { SdRadio } from '@sdcorejs/angular/forms/radio';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport { SdTextarea } from '@sdcorejs/angular/forms/textarea';\nimport { Color } from '@sdcorejs/utils/models';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { SD_ICON_CONFIGURATION, SdIcon, type SdIconShape } from '@sdcorejs/angular/modules/icon';\n\nexport interface DialogData {\n icon?: string;\n iconShape?: SdIconShape;\n title?: string;\n message?: string;\n yesTitle?: string;\n noTitle?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n input?: {\n label?: string;\n placeholder?: string;\n minlength?: number;\n maxlength?: number;\n required?: boolean;\n defaultValue?: string;\n };\n date?: {\n required?: boolean;\n placeholder?: string;\n defaultValue?: string | Date;\n min?: string | Date;\n max?: string | Date;\n };\n datetime?: {\n required?: boolean;\n placeholder?: string;\n defaultValue?: string | Date;\n min?: string | Date;\n max?: string | Date;\n showSeconds?: boolean;\n };\n radio?: {\n required?: boolean;\n defaultValue?: string | number;\n items: any[];\n valueField: string;\n displayField: string;\n display?: 'row' | 'column';\n };\n select?: {\n required?: boolean;\n defaultValue?: string | number | (string | number)[];\n items: any[];\n valueField: string;\n displayField: string;\n placeholder?: string;\n multiple?: boolean;\n };\n}\n\n@Component({\n selector: 'sd-dialog-confirm',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: 'dialog-confirm.component.html',\n styleUrl: './dialog-confirm.component.scss',\n imports: [SdIcon, CommonModule, FormsModule, MatDialogModule, SdButton, SdDate, SdDatetime, SdRadio, SdSelect, SdTextarea],\n})\nexport class DialogConfirmComponent {\n value: any;\n required = false;\n id = `I${Utilities.generateUuid()}`;\n public readonly dialogRef = inject(MatDialogRef<DialogConfirmComponent>);\n public readonly data = inject<DialogData>(MAT_DIALOG_DATA);\n\n readonly iconTone = this.data.yesButtonColor || 'primary';\n readonly iconShape: SdIconShape = this.data.iconShape ?? inject(SD_ICON_CONFIGURATION).defaultShape;\n readonly resolvedIcon =\n this.data.icon?.trim() ||\n (this.iconTone === 'error'\n ? 'delete'\n : this.iconTone === 'warning'\n ? 'warning_amber'\n : this.data.input\n ? 'edit_note'\n : this.data.date || this.data.datetime\n ? 'today'\n : this.data.radio || this.data.select\n ? 'list'\n : 'check_circle');\n readonly hasFields = !!(this.data.input || this.data.date || this.data.radio || this.data.datetime || this.data.select);\n\n constructor() {\n if (this.data?.input) {\n this.value = this.data?.input?.defaultValue ?? '';\n this.required = this.data?.input?.required || false;\n }\n if (this.data?.date) {\n this.value = this.data?.date?.defaultValue ?? '';\n this.required = this.data?.date?.required || false;\n }\n if (this.data?.datetime) {\n this.value = this.data?.datetime?.defaultValue ?? '';\n this.required = this.data?.datetime?.required || false;\n }\n if (this.data?.radio) {\n this.value = this.data?.radio?.defaultValue ?? '';\n this.required = this.data?.radio?.required || false;\n }\n if (this.data?.select) {\n this.value = this.data?.select?.defaultValue ?? (this.data?.select?.multiple ? [] : null);\n this.required = this.data?.select?.required || false;\n }\n }\n\n onCancel = () => {\n this.dialogRef.close({ action: 'CANCEL', value: null });\n };\n\n onAccept = () => {\n // Always return an object with action and value for consistency\n if (this.data?.radio || this.data?.input || this.data?.date || this.data?.datetime || this.data?.select) {\n this.dialogRef.close({ action: 'ACCEPT', value: this.value });\n } else {\n this.dialogRef.close({ action: 'ACCEPT', value: null });\n }\n };\n}\n","<div mat-dialog-content class=\"sd-dialog-confirm__content\" [class.sd-dialog-confirm__content--radio]=\"data.radio\">\n <div class=\"sd-dialog-confirm__header\">\n <span class=\"sd-dialog-confirm__icon\" aria-hidden=\"true\" [attr.data-icon]=\"resolvedIcon\" [attr.data-tone]=\"iconTone\" [attr.data-icon-shape]=\"iconShape\">\n <sd-icon [name]=\"resolvedIcon\" size=\"22px\"></sd-icon>\n </span>\n <div class=\"sd-dialog-confirm__copy\">\n <h2 mat-dialog-title class=\"sd-dialog-confirm__title\" [innerHtml]=\"data.title || 'Confirm'\"></h2>\n @if (data.message) {\n <div class=\"sd-dialog-confirm__message\" [innerHtml]=\"data.message\"></div>\n }\n </div>\n </div>\n @if (hasFields) {\n <div class=\"sd-dialog-confirm__fields\">\n @if (data.input) {\n <sd-textarea\n [label]=\"data.input.label\"\n [placeholder]=\"data.input.placeholder\"\n [(model)]=\"value\"\n [rows]=\"3\"\n [required]=\"data.input.required\"\n [maxlength]=\"data.input.maxlength!\" />\n }\n @if (data.select) {\n <sd-select\n [placeholder]=\"data.select.placeholder\"\n [items]=\"data.select.items\"\n [valueField]=\"data.select.valueField\"\n [displayField]=\"data.select.displayField\"\n [multiple]=\"data.select.multiple\"\n [(model)]=\"value\"\n [required]=\"data.select.required\">\n </sd-select>\n }\n @if (data.date) {\n <sd-date\n [placeholder]=\"data.date.placeholder\"\n [(model)]=\"value\"\n type=\"date\"\n [min]=\"data.date.min!\"\n [max]=\"data.date.max!\"\n [required]=\"data.date.required\">\n </sd-date>\n }\n @if (data.datetime) {\n <sd-datetime\n [placeholder]=\"data.datetime.placeholder\"\n [(model)]=\"value\"\n [min]=\"data.datetime.min!\"\n [max]=\"data.datetime.max!\"\n [showSeconds]=\"data.datetime.showSeconds\"\n [required]=\"data.datetime.required\">\n </sd-datetime>\n }\n @if (data.radio) {\n <sd-radio\n [items]=\"data.radio.items\"\n [valueField]=\"data.radio.valueField\"\n [displayField]=\"data.radio.displayField\"\n [display]=\"data.radio.display || 'column'\"\n [(model)]=\"value\"\n [required]=\"data.radio.required\">\n </sd-radio>\n }\n </div>\n }\n</div>\n<div mat-dialog-actions align=\"end\" class=\"sd-dialog-confirm__actions\">\n @if (data.noTitle) {\n <sd-button\n data-confirm-cancel\n size=\"sm\"\n type=\"light\"\n htmlType=\"button\"\n [color]=\"data.noButtonColor || 'secondary'\"\n [title]=\"data.noTitle\"\n (click)=\"onCancel()\"></sd-button>\n }\n @if (data.yesTitle) {\n <sd-button\n data-confirm-accept\n size=\"sm\"\n type=\"fill\"\n htmlType=\"button\"\n [color]=\"data.yesButtonColor || 'primary'\"\n [disabled]=\"\n required &&\n (value === undefined ||\n value === null ||\n value === '' ||\n (data.input && !value.trim()) ||\n (value.length !== undefined && value.length === 0))\n \"\n [title]=\"data.yesTitle\"\n (click)=\"onAccept()\"></sd-button>\n }\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Observable } from 'rxjs';\nimport { DialogConfirmComponent } from './components/dialog-confirm/dialog-confirm.component';\nimport { Color } from '@sdcorejs/utils/models';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport type { SdIconShape } from '@sdcorejs/angular/modules/icon';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdConfirmService {\n private dialog = inject(MatDialog);\n\n readonly #i18n = inject(I18nService);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n /**\n * Biến `afterClosed()` của dialog thành một Promise LUÔN settle.\n *\n * why: cả 6 API trước đây đều viết `if (result) { ...ACCEPT/CANCEL... }`, nên MỌI đường đóng\n * dialog không đi qua hai nút — phím ESC, click backdrop (khi `disableBackdropClose: false`),\n * hoặc `dialogRef.close()` gọi từ code — cho `result` là `undefined` và promise KHÔNG BAO GIỜ\n * settle. Closure của caller (cùng mọi thứ nó giữ) bị ghim lại đến hết phiên, và `await` đứng im\n * mãi mãi. Đóng-không-chọn về ngữ nghĩa chính là huỷ, nên nó reject `'CANCEL'` — đúng nhánh mà\n * consumer vốn đã bắt.\n */\n #settleOnClose = <TValue>(afterClosed: Observable<{ action?: 'ACCEPT' | 'CANCEL'; value?: TValue } | undefined>): Promise<TValue> =>\n new Promise<TValue>((resolve, reject) => {\n afterClosed.subscribe(result => {\n if (result?.action === 'ACCEPT') resolve(result.value as TValue);\n else reject(result?.action ?? 'CANCEL');\n });\n });\n\n confirm = (\n message: string,\n option: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n width?: string;\n disableBackdropClose?: boolean;\n } = {}\n ) => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: option?.width || '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: '[data-confirm-cancel] button',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withInput = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n maxlength?: number;\n label?: string;\n placeholder?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string;\n disableBackdropClose?: boolean;\n }\n ): Promise<string> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'textarea',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n input: {\n label: option?.label,\n placeholder: option?.placeholder,\n maxlength: option?.maxlength || 255,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withRadio = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | number;\n items: any[];\n valueField: string;\n displayField: string;\n display?: 'row' | 'column';\n disableBackdropClose?: boolean;\n }\n ): Promise<string> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n radio: {\n items: option?.items || [],\n valueField: option?.valueField || 'value',\n displayField: option?.displayField || 'label',\n display: option?.display || 'row',\n required: option?.required,\n defaultValue: option?.defaultValue,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withSelect = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | number | (string | number)[];\n items: any[];\n valueField: string;\n displayField: string;\n placeholder?: string;\n multiple?: boolean;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | number | (string | number)[]> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n select: {\n items: option?.items || [],\n valueField: option?.valueField || 'value',\n displayField: option?.displayField || 'label',\n placeholder: option?.placeholder,\n multiple: option?.multiple,\n required: option?.required,\n defaultValue: option?.defaultValue,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withDate = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | Date;\n placeholder?: string;\n min?: string | Date;\n max?: string | Date;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | Date> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n date: {\n placeholder: option?.placeholder,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n min: option?.min,\n max: option?.max,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withDatetime = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | Date;\n placeholder?: string;\n min?: string | Date;\n max?: string | Date;\n showSeconds?: boolean;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | Date> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n datetime: {\n placeholder: option?.placeholder,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n min: option?.min,\n max: option?.max,\n showSeconds: option?.showSeconds,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n}\n","/*\n * Public API Surface of superdev-angular-core\n */\n\nexport * from './lib/components/dialog-confirm/dialog-confirm.component';\nexport * from './lib/confirm.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAwEa,sBAAsB,CAAA;AACjC,IAAA,KAAK;IACL,QAAQ,GAAG,KAAK;AAChB,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,SAAS,CAAC,YAAY,EAAE,EAAE;AACnB,IAAA,SAAS,GAAG,MAAM,EAAC,YAAoC,EAAC;AACxD,IAAA,IAAI,GAAG,MAAM,CAAa,eAAe,CAAC;IAEjD,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS;AAChD,IAAA,SAAS,GAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,YAAY;IAC1F,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AAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-services-confirm.mjs","sources":["../../../projects/sdcorejs-angular/services/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../projects/sdcorejs-angular/services/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.html","../../../projects/sdcorejs-angular/services/confirm/src/lib/confirm.service.ts","../../../projects/sdcorejs-angular/services/confirm/src/public-api.ts","../../../projects/sdcorejs-angular/services/confirm/sdcorejs-angular-services-confirm.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdDate } from '@sdcorejs/angular/forms/date';\nimport { SdDatetime } from '@sdcorejs/angular/forms/datetime';\nimport { SdRadio } from '@sdcorejs/angular/forms/radio';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport { SdTextarea } from '@sdcorejs/angular/forms/textarea';\nimport { Color } from '@sdcorejs/utils/models';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { SD_ICON_CONFIGURATION, SdIcon, type SdIconShape } from '@sdcorejs/angular/modules/icon';\n\nexport interface DialogData {\n icon?: string;\n iconShape?: SdIconShape;\n title?: string;\n message?: string;\n yesTitle?: string;\n noTitle?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n input?: {\n label?: string;\n placeholder?: string;\n minlength?: number;\n maxlength?: number;\n required?: boolean;\n defaultValue?: string;\n };\n date?: {\n required?: boolean;\n placeholder?: string;\n defaultValue?: string | Date;\n min?: string | Date;\n max?: string | Date;\n };\n datetime?: {\n required?: boolean;\n placeholder?: string;\n defaultValue?: string | Date;\n min?: string | Date;\n max?: string | Date;\n showSeconds?: boolean;\n };\n radio?: {\n required?: boolean;\n defaultValue?: string | number;\n items: any[];\n valueField: string;\n displayField: string;\n display?: 'row' | 'column';\n };\n select?: {\n required?: boolean;\n defaultValue?: string | number | (string | number)[];\n items: any[];\n valueField: string;\n displayField: string;\n placeholder?: string;\n multiple?: boolean;\n };\n}\n\n@Component({\n selector: 'sd-dialog-confirm',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: 'dialog-confirm.component.html',\n styleUrl: './dialog-confirm.component.scss',\n imports: [SdIcon, CommonModule, FormsModule, MatDialogModule, SdButton, SdDate, SdDatetime, SdRadio, SdSelect, SdTextarea],\n})\nexport class DialogConfirmComponent {\n value: any;\n required = false;\n id = `I${Utilities.generateUuid()}`;\n public readonly dialogRef = inject(MatDialogRef<DialogConfirmComponent>);\n public readonly data = inject<DialogData>(MAT_DIALOG_DATA);\n\n readonly iconTone = this.data.yesButtonColor || 'primary';\n readonly iconShape: SdIconShape = this.data.iconShape ?? inject(SD_ICON_CONFIGURATION).defaultShape;\n readonly resolvedIcon =\n this.data.icon?.trim() ||\n (this.iconTone === 'error'\n ? 'delete'\n : this.iconTone === 'warning'\n ? 'warning_amber'\n : this.data.input\n ? 'edit_note'\n : this.data.date || this.data.datetime\n ? 'today'\n : this.data.radio || this.data.select\n ? 'list'\n : 'check_circle');\n readonly hasFields = !!(this.data.input || this.data.date || this.data.radio || this.data.datetime || this.data.select);\n\n constructor() {\n if (this.data?.input) {\n this.value = this.data?.input?.defaultValue ?? '';\n this.required = this.data?.input?.required || false;\n }\n if (this.data?.date) {\n this.value = this.data?.date?.defaultValue ?? '';\n this.required = this.data?.date?.required || false;\n }\n if (this.data?.datetime) {\n this.value = this.data?.datetime?.defaultValue ?? '';\n this.required = this.data?.datetime?.required || false;\n }\n if (this.data?.radio) {\n this.value = this.data?.radio?.defaultValue ?? '';\n this.required = this.data?.radio?.required || false;\n }\n if (this.data?.select) {\n this.value = this.data?.select?.defaultValue ?? (this.data?.select?.multiple ? [] : null);\n this.required = this.data?.select?.required || false;\n }\n }\n\n onCancel = () => {\n this.dialogRef.close({ action: 'CANCEL', value: null });\n };\n\n onAccept = () => {\n // Always return an object with action and value for consistency\n if (this.data?.radio || this.data?.input || this.data?.date || this.data?.datetime || this.data?.select) {\n this.dialogRef.close({ action: 'ACCEPT', value: this.value });\n } else {\n this.dialogRef.close({ action: 'ACCEPT', value: null });\n }\n };\n}\n","<div mat-dialog-content class=\"sd-dialog-confirm__content\" [class.sd-dialog-confirm__content--radio]=\"data.radio\">\n <div class=\"sd-dialog-confirm__header\">\n <span class=\"sd-dialog-confirm__icon\" aria-hidden=\"true\" [attr.data-icon]=\"resolvedIcon\" [attr.data-tone]=\"iconTone\" [attr.data-icon-shape]=\"iconShape\">\n <sd-icon [name]=\"resolvedIcon\" size=\"22px\"></sd-icon>\n </span>\n <div class=\"sd-dialog-confirm__copy\">\n <h2 mat-dialog-title class=\"sd-dialog-confirm__title\" [innerHtml]=\"data.title || 'Confirm'\"></h2>\n @if (data.message) {\n <div class=\"sd-dialog-confirm__message\" [innerHtml]=\"data.message\"></div>\n }\n </div>\n </div>\n @if (hasFields) {\n <div class=\"sd-dialog-confirm__fields\">\n @if (data.input) {\n <sd-textarea\n [label]=\"data.input.label\"\n [placeholder]=\"data.input.placeholder\"\n [(model)]=\"value\"\n [rows]=\"3\"\n [required]=\"data.input.required\"\n [maxlength]=\"data.input.maxlength!\" />\n }\n @if (data.select) {\n <sd-select\n [placeholder]=\"data.select.placeholder\"\n [items]=\"data.select.items\"\n [valueField]=\"data.select.valueField\"\n [displayField]=\"data.select.displayField\"\n [multiple]=\"data.select.multiple\"\n [(model)]=\"value\"\n [required]=\"data.select.required\">\n </sd-select>\n }\n @if (data.date) {\n <sd-date\n [placeholder]=\"data.date.placeholder\"\n [(model)]=\"value\"\n type=\"date\"\n [min]=\"data.date.min!\"\n [max]=\"data.date.max!\"\n [required]=\"data.date.required\">\n </sd-date>\n }\n @if (data.datetime) {\n <sd-datetime\n [placeholder]=\"data.datetime.placeholder\"\n [(model)]=\"value\"\n [min]=\"data.datetime.min!\"\n [max]=\"data.datetime.max!\"\n [showSeconds]=\"data.datetime.showSeconds\"\n [required]=\"data.datetime.required\">\n </sd-datetime>\n }\n @if (data.radio) {\n <sd-radio\n [items]=\"data.radio.items\"\n [valueField]=\"data.radio.valueField\"\n [displayField]=\"data.radio.displayField\"\n [display]=\"data.radio.display || 'column'\"\n [(model)]=\"value\"\n [required]=\"data.radio.required\">\n </sd-radio>\n }\n </div>\n }\n</div>\n<div mat-dialog-actions align=\"end\" class=\"sd-dialog-confirm__actions\">\n @if (data.noTitle) {\n <sd-button\n data-confirm-cancel\n size=\"sm\"\n type=\"light\"\n htmlType=\"button\"\n [color]=\"data.noButtonColor || 'secondary'\"\n [title]=\"data.noTitle\"\n (click)=\"onCancel()\"></sd-button>\n }\n @if (data.yesTitle) {\n <sd-button\n data-confirm-accept\n size=\"sm\"\n type=\"fill\"\n htmlType=\"button\"\n [color]=\"data.yesButtonColor || 'primary'\"\n [disabled]=\"\n required &&\n (value === undefined ||\n value === null ||\n value === '' ||\n (data.input && !value.trim()) ||\n (value.length !== undefined && value.length === 0))\n \"\n [title]=\"data.yesTitle\"\n (click)=\"onAccept()\"></sd-button>\n }\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Observable } from 'rxjs';\nimport { DialogConfirmComponent } from './components/dialog-confirm/dialog-confirm.component';\nimport { Color } from '@sdcorejs/utils/models';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport type { SdIconShape } from '@sdcorejs/angular/modules/icon';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdConfirmService {\n private dialog = inject(MatDialog);\n\n readonly #i18n = inject(I18nService);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n /**\n * Biến `afterClosed()` của dialog thành một Promise LUÔN settle.\n *\n * why: cả 6 API trước đây đều viết `if (result) { ...ACCEPT/CANCEL... }`, nên MỌI đường đóng\n * dialog không đi qua hai nút — phím ESC, click backdrop (khi `disableBackdropClose: false`),\n * hoặc `dialogRef.close()` gọi từ code — cho `result` là `undefined` và promise KHÔNG BAO GIỜ\n * settle. Closure của caller (cùng mọi thứ nó giữ) bị ghim lại đến hết phiên, và `await` đứng im\n * mãi mãi. Đóng-không-chọn về ngữ nghĩa chính là huỷ, nên nó reject `'CANCEL'` — đúng nhánh mà\n * consumer vốn đã bắt.\n */\n #settleOnClose = <TValue>(afterClosed: Observable<{ action?: 'ACCEPT' | 'CANCEL'; value?: TValue } | undefined>): Promise<TValue> =>\n new Promise<TValue>((resolve, reject) => {\n afterClosed.subscribe(result => {\n if (result?.action === 'ACCEPT') resolve(result.value as TValue);\n else reject(result?.action ?? 'CANCEL');\n });\n });\n\n confirm = (\n message: string,\n option: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n width?: string;\n disableBackdropClose?: boolean;\n } = {}\n ) => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: option?.width || '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: '[data-confirm-cancel] button',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withInput = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n maxlength?: number;\n label?: string;\n placeholder?: string;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string;\n disableBackdropClose?: boolean;\n }\n ): Promise<string> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'textarea',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n input: {\n label: option?.label,\n placeholder: option?.placeholder,\n maxlength: option?.maxlength || 255,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withRadio = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | number;\n items: any[];\n valueField: string;\n displayField: string;\n display?: 'row' | 'column';\n disableBackdropClose?: boolean;\n }\n ): Promise<string> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n radio: {\n items: option?.items || [],\n valueField: option?.valueField || 'value',\n displayField: option?.displayField || 'label',\n display: option?.display || 'row',\n required: option?.required,\n defaultValue: option?.defaultValue,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withSelect = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | number | (string | number)[];\n items: any[];\n valueField: string;\n displayField: string;\n placeholder?: string;\n multiple?: boolean;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | number | (string | number)[]> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n select: {\n items: option?.items || [],\n valueField: option?.valueField || 'value',\n displayField: option?.displayField || 'label',\n placeholder: option?.placeholder,\n multiple: option?.multiple,\n required: option?.required,\n defaultValue: option?.defaultValue,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withDate = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | Date;\n placeholder?: string;\n min?: string | Date;\n max?: string | Date;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | Date> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n date: {\n placeholder: option?.placeholder,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n min: option?.min,\n max: option?.max,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n\n withDatetime = (\n message?: string,\n option?: {\n title?: string;\n icon?: string;\n /** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */\n iconShape?: SdIconShape;\n\n yesTitle?: string;\n noTitle?: string;\n required?: boolean;\n yesButtonColor?: Color;\n noButtonColor?: Color;\n defaultValue?: string | Date;\n placeholder?: string;\n min?: string | Date;\n max?: string | Date;\n showSeconds?: boolean;\n disableBackdropClose?: boolean;\n }\n ): Promise<string | Date> => {\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\n width: '440px',\n panelClass: 'sd-confirm-panel',\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100dvh - 32px)',\n autoFocus: 'first-tabbable',\n disableClose: option?.disableBackdropClose ?? true,\n data: {\n icon: option?.icon,\n iconShape: option?.iconShape,\n title: option?.title || this.#i18n.t('core.confirm.title'),\n message,\n yesTitle: option?.yesTitle || this.#i18n.t('core.confirm.yes-short'),\n noTitle: option?.noTitle || this.#i18n.t('core.confirm.no-short'),\n noButtonColor: option?.noButtonColor || 'secondary',\n yesButtonColor: option?.yesButtonColor || 'primary',\n datetime: {\n placeholder: option?.placeholder,\n required: option?.required,\n defaultValue: option?.defaultValue || '',\n min: option?.min,\n max: option?.max,\n showSeconds: option?.showSeconds,\n },\n },\n });\n return this.#settleOnClose(dialogRef.afterClosed());\n };\n}\n","/*\n * Public API Surface of superdev-angular-core\n */\n\nexport * from './lib/components/dialog-confirm/dialog-confirm.component';\nexport * from './lib/confirm.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAwEa,sBAAsB,CAAA;AACjC,IAAA,KAAK;IACL,QAAQ,GAAG,KAAK;AAChB,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,SAAS,CAAC,YAAY,EAAE,EAAE;AACnB,IAAA,SAAS,GAAG,MAAM,EAAC,YAAoC,EAAC;AACxD,IAAA,IAAI,GAAG,MAAM,CAAa,eAAe,CAAC;IAEjD,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS;AAChD,IAAA,SAAS,GAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,YAAY;IAC1F,YAAY,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AAS,CAAC,WAAW,EAAE,CAAC;AACrD,IAAA,CAAC;wGAnTU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, assertInInjectionContext } from '@angular/core';
|
|
3
|
+
import { SD_CORE_CONFIGURATION } from '@sdcorejs/angular/configurations';
|
|
4
|
+
import { DateUtilities } from '@sdcorejs/utils/fns';
|
|
5
|
+
|
|
6
|
+
/** Local Date whose fields equal `parts`: the wall-clock carrier pickers and controls work with. */
|
|
7
|
+
const carrierOf = (parts) => {
|
|
8
|
+
const carrier = new Date(0);
|
|
9
|
+
carrier.setFullYear(parts.year, parts.month - 1, parts.day);
|
|
10
|
+
carrier.setHours(parts.hour, parts.minute, parts.second, parts.millisecond);
|
|
11
|
+
return carrier;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Converts and parses model dates in the zone of `ISdCoreConfiguration.timeZone`.
|
|
15
|
+
*
|
|
16
|
+
* - An instant (`Z`/offset, `Date`, epoch) shows as the wall clock of the zone.
|
|
17
|
+
* - A zone-less or date-only string keeps its digits and is read as wall clock in the zone.
|
|
18
|
+
* - A carrier is a local `Date` whose fields are a wall clock (what Material pickers hold);
|
|
19
|
+
* `toWallClock` / `fromWallClock` are the only crossings between carriers and model values.
|
|
20
|
+
*
|
|
21
|
+
* With `'local'` (the default) every method returns exactly what `DateUtilities` returns
|
|
22
|
+
* without options.
|
|
23
|
+
*/
|
|
24
|
+
class SdDateTimeService {
|
|
25
|
+
/** The configured zone, resolved once from the root injector. */
|
|
26
|
+
timeZone;
|
|
27
|
+
#options;
|
|
28
|
+
constructor() {
|
|
29
|
+
const timeZone = inject(SD_CORE_CONFIGURATION, { optional: true })?.timeZone ?? 'local';
|
|
30
|
+
if (timeZone !== 'local' && !DateUtilities.isValidTimeZone(timeZone)) {
|
|
31
|
+
throw new Error(`[@sdcorejs/angular] Invalid ISdCoreConfiguration.timeZone "${String(timeZone)}": use an IANA time zone id such as "Asia/Ho_Chi_Minh", or "local".`);
|
|
32
|
+
}
|
|
33
|
+
this.timeZone = timeZone;
|
|
34
|
+
this.#options = timeZone === 'local' ? undefined : { timeZone };
|
|
35
|
+
}
|
|
36
|
+
/** Formats a model value; `''` when invalid. */
|
|
37
|
+
toFormat(value, format) {
|
|
38
|
+
return DateUtilities.toFormat(value, format, this.#options);
|
|
39
|
+
}
|
|
40
|
+
/** Parses a model value to an instant; `null` when invalid. */
|
|
41
|
+
parse(value) {
|
|
42
|
+
return DateUtilities.parse(value, this.#options);
|
|
43
|
+
}
|
|
44
|
+
/** Parses text in `format` as wall clock in the zone; `null` when invalid. */
|
|
45
|
+
parseFrom(value, format) {
|
|
46
|
+
return DateUtilities.parseFrom(value, format, this.#options);
|
|
47
|
+
}
|
|
48
|
+
/** First instant of the value's calendar day. */
|
|
49
|
+
begin(value) {
|
|
50
|
+
return DateUtilities.begin(value, this.#options);
|
|
51
|
+
}
|
|
52
|
+
/** Last millisecond of the value's calendar day. */
|
|
53
|
+
end(value) {
|
|
54
|
+
return DateUtilities.end(value, this.#options);
|
|
55
|
+
}
|
|
56
|
+
/** First instant of the next calendar day: the exclusive upper bound of a day filter. */
|
|
57
|
+
beginOfNextDay(value) {
|
|
58
|
+
const options = this.#options;
|
|
59
|
+
// why: local mode stays byte-identical to the bound the table filter used before time zones.
|
|
60
|
+
if (!options?.timeZone)
|
|
61
|
+
return DateUtilities.begin(DateUtilities.addDays(value, 1));
|
|
62
|
+
const day = DateUtilities.toZonedParts(value, options.timeZone);
|
|
63
|
+
if (!day)
|
|
64
|
+
return null;
|
|
65
|
+
return DateUtilities.fromZonedParts({ year: day.year, month: day.month, day: day.day + 1 }, options.timeZone);
|
|
66
|
+
}
|
|
67
|
+
/** Carrier of today 00:00 in the zone. */
|
|
68
|
+
today() {
|
|
69
|
+
const now = this.now();
|
|
70
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
71
|
+
}
|
|
72
|
+
/** Carrier of the current wall clock in the zone. */
|
|
73
|
+
now() {
|
|
74
|
+
const options = this.#options;
|
|
75
|
+
if (!options?.timeZone)
|
|
76
|
+
return new Date();
|
|
77
|
+
return carrierOf(DateUtilities.toZonedParts(Date.now(), options.timeZone));
|
|
78
|
+
}
|
|
79
|
+
/** Carrier of a model value's wall clock in the zone; `null` when invalid. */
|
|
80
|
+
toWallClock(value) {
|
|
81
|
+
const options = this.#options;
|
|
82
|
+
if (!options?.timeZone)
|
|
83
|
+
return DateUtilities.parse(value);
|
|
84
|
+
const parts = DateUtilities.toZonedParts(value, options.timeZone);
|
|
85
|
+
return parts ? carrierOf(parts) : null;
|
|
86
|
+
}
|
|
87
|
+
/** Instant of a carrier's wall clock in the zone. */
|
|
88
|
+
fromWallClock(value) {
|
|
89
|
+
const options = this.#options;
|
|
90
|
+
if (!options?.timeZone || !Number.isFinite(value.getTime()))
|
|
91
|
+
return new Date(value.getTime());
|
|
92
|
+
return DateUtilities.fromZonedParts({
|
|
93
|
+
year: value.getFullYear(),
|
|
94
|
+
month: value.getMonth() + 1,
|
|
95
|
+
day: value.getDate(),
|
|
96
|
+
hour: value.getHours(),
|
|
97
|
+
minute: value.getMinutes(),
|
|
98
|
+
second: value.getSeconds(),
|
|
99
|
+
millisecond: value.getMilliseconds(),
|
|
100
|
+
}, options.timeZone);
|
|
101
|
+
}
|
|
102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdDateTimeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
103
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdDateTimeService, providedIn: 'root' });
|
|
104
|
+
}
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdDateTimeService, decorators: [{
|
|
106
|
+
type: Injectable,
|
|
107
|
+
args: [{ providedIn: 'root' }]
|
|
108
|
+
}], ctorParameters: () => [] });
|
|
109
|
+
/**
|
|
110
|
+
* @internal `SdDateTimeService` with `'local'`, for pure helpers that run without an injector (public
|
|
111
|
+
* helpers called directly by consumers, unit tests). Every method equals the service in local mode.
|
|
112
|
+
*/
|
|
113
|
+
const ɵSD_LOCAL_DATE_TIME = {
|
|
114
|
+
timeZone: 'local',
|
|
115
|
+
toFormat: (value, format) => DateUtilities.toFormat(value, format),
|
|
116
|
+
parse: value => DateUtilities.parse(value),
|
|
117
|
+
begin: value => DateUtilities.begin(value),
|
|
118
|
+
end: value => DateUtilities.end(value),
|
|
119
|
+
beginOfNextDay: value => DateUtilities.begin(DateUtilities.addDays(value, 1)),
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* @internal The service inside an injection context, `null` outside one.
|
|
123
|
+
*
|
|
124
|
+
* Pipes call it from a field initializer: created by DI or a template they follow the zone, while
|
|
125
|
+
* `new SdFormatDatePipe()` outside an injection context keeps the local behavior. Only the
|
|
126
|
+
* "no injection context" error (NG0203) is swallowed; an invalid zone still throws.
|
|
127
|
+
*/
|
|
128
|
+
function ɵsdInjectDateTime() {
|
|
129
|
+
try {
|
|
130
|
+
assertInInjectionContext(ɵsdInjectDateTime);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return inject(SdDateTimeService);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Generated bundle index. Do not edit.
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
export { SdDateTimeService, ɵSD_LOCAL_DATE_TIME, ɵsdInjectDateTime };
|
|
143
|
+
//# sourceMappingURL=sdcorejs-angular-services-date-time.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-services-date-time.mjs","sources":["../../../projects/sdcorejs-angular/services/date-time/src/date-time.service.ts","../../../projects/sdcorejs-angular/services/date-time/sdcorejs-angular-services-date-time.ts"],"sourcesContent":["import { assertInInjectionContext, inject, Injectable } from '@angular/core';\nimport { SD_CORE_CONFIGURATION, type SdTimeZone } from '@sdcorejs/angular/configurations';\nimport { DateUtilities, type TimeZoneOptions, type ZonedDateTimeParts } from '@sdcorejs/utils/fns';\n\n/** Local Date whose fields equal `parts`: the wall-clock carrier pickers and controls work with. */\nconst carrierOf = (parts: ZonedDateTimeParts): Date => {\n const carrier = new Date(0);\n carrier.setFullYear(parts.year, parts.month - 1, parts.day);\n carrier.setHours(parts.hour, parts.minute, parts.second, parts.millisecond);\n return carrier;\n};\n\n/**\n * Converts and parses model dates in the zone of `ISdCoreConfiguration.timeZone`.\n *\n * - An instant (`Z`/offset, `Date`, epoch) shows as the wall clock of the zone.\n * - A zone-less or date-only string keeps its digits and is read as wall clock in the zone.\n * - A carrier is a local `Date` whose fields are a wall clock (what Material pickers hold);\n * `toWallClock` / `fromWallClock` are the only crossings between carriers and model values.\n *\n * With `'local'` (the default) every method returns exactly what `DateUtilities` returns\n * without options.\n */\n@Injectable({ providedIn: 'root' })\nexport class SdDateTimeService {\n /** The configured zone, resolved once from the root injector. */\n readonly timeZone: SdTimeZone;\n readonly #options: TimeZoneOptions | undefined;\n\n constructor() {\n const timeZone = inject(SD_CORE_CONFIGURATION, { optional: true })?.timeZone ?? 'local';\n if (timeZone !== 'local' && !DateUtilities.isValidTimeZone(timeZone)) {\n throw new Error(\n `[@sdcorejs/angular] Invalid ISdCoreConfiguration.timeZone \"${String(timeZone)}\": use an IANA time zone id such as \"Asia/Ho_Chi_Minh\", or \"local\".`\n );\n }\n this.timeZone = timeZone;\n this.#options = timeZone === 'local' ? undefined : { timeZone };\n }\n\n /** Formats a model value; `''` when invalid. */\n toFormat(value: unknown, format: string): string {\n return DateUtilities.toFormat(value, format, this.#options);\n }\n\n /** Parses a model value to an instant; `null` when invalid. */\n parse(value: unknown): Date | null {\n return DateUtilities.parse(value, this.#options);\n }\n\n /** Parses text in `format` as wall clock in the zone; `null` when invalid. */\n parseFrom(value: unknown, format: string): Date | null {\n return DateUtilities.parseFrom(value, format, this.#options);\n }\n\n /** First instant of the value's calendar day. */\n begin(value: unknown): Date | null {\n return DateUtilities.begin(value, this.#options);\n }\n\n /** Last millisecond of the value's calendar day. */\n end(value: unknown): Date | null {\n return DateUtilities.end(value, this.#options);\n }\n\n /** First instant of the next calendar day: the exclusive upper bound of a day filter. */\n beginOfNextDay(value: unknown): Date | null {\n const options = this.#options;\n // why: local mode stays byte-identical to the bound the table filter used before time zones.\n if (!options?.timeZone) return DateUtilities.begin(DateUtilities.addDays(value, 1));\n const day = DateUtilities.toZonedParts(value, options.timeZone);\n if (!day) return null;\n return DateUtilities.fromZonedParts({ year: day.year, month: day.month, day: day.day + 1 }, options.timeZone);\n }\n\n /** Carrier of today 00:00 in the zone. */\n today(): Date {\n const now = this.now();\n return new Date(now.getFullYear(), now.getMonth(), now.getDate());\n }\n\n /** Carrier of the current wall clock in the zone. */\n now(): Date {\n const options = this.#options;\n if (!options?.timeZone) return new Date();\n return carrierOf(DateUtilities.toZonedParts(Date.now(), options.timeZone)!);\n }\n\n /** Carrier of a model value's wall clock in the zone; `null` when invalid. */\n toWallClock(value: unknown): Date | null {\n const options = this.#options;\n if (!options?.timeZone) return DateUtilities.parse(value);\n const parts = DateUtilities.toZonedParts(value, options.timeZone);\n return parts ? carrierOf(parts) : null;\n }\n\n /** Instant of a carrier's wall clock in the zone. */\n fromWallClock(value: Date): Date {\n const options = this.#options;\n if (!options?.timeZone || !Number.isFinite(value.getTime())) return new Date(value.getTime());\n return DateUtilities.fromZonedParts(\n {\n year: value.getFullYear(),\n month: value.getMonth() + 1,\n day: value.getDate(),\n hour: value.getHours(),\n minute: value.getMinutes(),\n second: value.getSeconds(),\n millisecond: value.getMilliseconds(),\n },\n options.timeZone\n );\n }\n}\n\n/**\n * @internal `SdDateTimeService` with `'local'`, for pure helpers that run without an injector (public\n * helpers called directly by consumers, unit tests). Every method equals the service in local mode.\n */\nexport const ɵSD_LOCAL_DATE_TIME: Pick<SdDateTimeService, 'timeZone' | 'toFormat' | 'parse' | 'begin' | 'end' | 'beginOfNextDay'> = {\n timeZone: 'local',\n toFormat: (value, format) => DateUtilities.toFormat(value, format),\n parse: value => DateUtilities.parse(value),\n begin: value => DateUtilities.begin(value),\n end: value => DateUtilities.end(value),\n beginOfNextDay: value => DateUtilities.begin(DateUtilities.addDays(value, 1)),\n};\n\n/**\n * @internal The service inside an injection context, `null` outside one.\n *\n * Pipes call it from a field initializer: created by DI or a template they follow the zone, while\n * `new SdFormatDatePipe()` outside an injection context keeps the local behavior. Only the\n * \"no injection context\" error (NG0203) is swallowed; an invalid zone still throws.\n */\nexport function ɵsdInjectDateTime(): SdDateTimeService | null {\n try {\n assertInInjectionContext(ɵsdInjectDateTime);\n } catch {\n return null;\n }\n return inject(SdDateTimeService);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;AACA,MAAM,SAAS,GAAG,CAAC,KAAyB,KAAU;AACpD,IAAA,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;AAC3B,IAAA,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK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