@sdcorejs/angular 19.3.2 → 19.3.4
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/THEME.md +58 -6
- package/assets/scss/core/form.scss +291 -3
- package/assets/scss/themes/_component-tokens.scss +35 -6
- package/components/badge/index.d.ts +1 -0
- package/components/badge/src/badge.model.d.ts +19 -0
- package/components/query-bar/src/components/actions-bar/actions-bar.component.d.ts +6 -1
- package/components/query-bar/src/components/field-picker/field-picker.component.d.ts +21 -0
- package/components/query-bar/src/components/inline-chip/inline-chip.component.d.ts +7 -1
- package/components/query-bar/src/components/inline-value-chip/inline-value-chip.component.d.ts +7 -1
- package/components/query-bar/src/components/popover-chip/popover-chip.component.d.ts +16 -2
- package/components/query-bar/src/query-bar.component.d.ts +66 -8
- package/components/query-bar/src/query-bar.model.d.ts +44 -1
- 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 +4 -2
- package/components/tab-router/src/components/tab-router-nav/tab-router-nav.component.d.ts +31 -3
- 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/config/config-width.util.d.ts +9 -0
- package/components/table/src/components/config/config.component.d.ts +58 -11
- package/components/table/src/components/filter/column-filter/column-filter.component.d.ts +5 -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/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 +7 -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.model.d.ts +6 -0
- package/components/table/src/services/column-leaf.util.d.ts +6 -0
- package/components/table/src/services/config-custom.util.d.ts +14 -0
- package/components/table/src/services/table-filter/table-filter.model.d.ts +30 -0
- package/components/table/src/services/table-filter/table-query-bar.util.d.ts +110 -0
- package/components/table/src/services/table-loading/table-loading.util.d.ts +91 -0
- package/components/table/src/services/tree/tree.util.d.ts +2 -0
- package/components/table/src/table.component.d.ts +60 -1
- 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/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +455 -37
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
- 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 +390 -75
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +1667 -124
- package/fesm2022/sdcorejs-angular-components-table.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-forms-autocomplete.mjs +7 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
- 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 +4 -0
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +17 -2
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +350 -5
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BFxO3eHX.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BFxO3eHX.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-Bk3PrEf3.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-Csy2fShj.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-Csy2fShj.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-CwUegGgG.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BIIxNR6k.mjs → sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BIIxNR6k.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-lF2trhfp.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DjDsau9C.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DjDsau9C.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BbmeOduc.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +347 -10
- 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-DK33LxHm.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-DK33LxHm.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-B1BUBiag.mjs +145 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-B1BUBiag.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-B27ZX8Co.mjs +144 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-B27ZX8Co.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-Bi2tMFHf.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-Bi2tMFHf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CPwGkrNk.mjs +142 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CPwGkrNk.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-VCbA_FkZ.mjs +113 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-VCbA_FkZ.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-CehsdBRP.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-CehsdBRP.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-CPhLTiyx.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-CPhLTiyx.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-5kI7wGdX.mjs +484 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-5kI7wGdX.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CjAy-B9K.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CjAy-B9K.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-DObN_wCR.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-DObN_wCR.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-C_ST-ld5.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-C_ST-ld5.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-TTrWCXIT.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-TTrWCXIT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-B1qePLfk.mjs +812 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-B1qePLfk.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BY5gjtNS.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BY5gjtNS.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CJ38CJXg.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CJ38CJXg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CdgPtSjJ.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CdgPtSjJ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DKIwrluh.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DKIwrluh.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-W9vY7HrT.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-W9vY7HrT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-CI0H_5a4.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-CI0H_5a4.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs +193 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.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-D829aEk5.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-D829aEk5.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-BEFVmSSj.mjs +295 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-BEFVmSSj.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-1kDb9T7_.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-1kDb9T7_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B-TJUSV_.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B-TJUSV_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B6z7KO0P.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B6z7KO0P.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DS39vgzU.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DS39vgzU.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DVlcUUzh.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DVlcUUzh.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DxWDWUdo.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DxWDWUdo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-r9CTj-8C.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-r9CTj-8C.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-xI1XYRo6.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-xI1XYRo6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-nV5dVFx2.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-nV5dVFx2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-0rRaWsuo.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-0rRaWsuo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-6uH7sDEg.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-6uH7sDEg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DglN2sS_.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DglN2sS_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BmsOgENL.mjs +359 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BmsOgENL.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DPZ_ucNB.mjs +138 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DPZ_ucNB.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DkAcDmsZ.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DkAcDmsZ.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-services-api.mjs +11 -11
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +7 -5
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +6 -4
- 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/forms/chip/src/chip.component.d.ts +135 -19
- package/forms/chip/src/index.d.ts +0 -1
- package/i18n/src/en.d.ts +70 -1
- package/modules/layout/components/index.d.ts +2 -0
- 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 +1 -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 +24 -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 +815 -0
- package/modules/pattern/docs/header-actions.md +344 -0
- package/modules/pattern/docs/list.md +247 -0
- package/modules/pattern/docs/relation.md +180 -0
- package/modules/pattern/docs/select.md +214 -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 +130 -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 +138 -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 +19 -0
- package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +182 -0
- package/modules/pattern/features/order/components/lines-form/order-lines.d.ts +35 -0
- package/modules/pattern/features/order/components/lines-form/order-lines.ts +101 -0
- package/modules/pattern/features/order/components/lines-table-form/lines-table-form.component.d.ts +34 -0
- package/modules/pattern/features/order/components/lines-table-form/lines-table-form.component.ts +196 -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 +18 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +113 -0
- package/modules/pattern/features/order/pages/detail/detail.component.d.ts +27 -0
- package/modules/pattern/features/order/pages/detail/detail.component.ts +224 -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 +22 -0
- package/modules/pattern/features/order/pages/update/update.component.ts +126 -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 +26 -0
- package/modules/pattern/features/product/components/product-select/product-select.component.ts +73 -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 +92 -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 +228 -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 +13 -9
- package/services/api/src/api-handler-registry.d.ts +3 -3
- package/services/api/src/api-route-configurations.d.ts +2 -2
- package/services/api/src/api.model.d.ts +2 -2
- package/services/cache/src/cache.model.d.ts +3 -1
- package/services/storage/src/storage.model.d.ts +2 -0
- 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/forms/chip/src/pipes/index.d.ts +0 -1
- package/forms/chip/src/pipes/removable-chip.pipe.d.ts +0 -8
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Observable } from 'rxjs';
|
|
2
|
+
import { BaseApiService } from '../../../services/base-api.service';
|
|
3
|
+
import type { ProductDto, ProductListReq, ProductListRes, ProductSaveReq } from './product.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ProductService extends BaseApiService {
|
|
6
|
+
#private;
|
|
7
|
+
/** Tăng sau mỗi lần tạo hoặc cập nhật thành công: danh sách tải lại khi quay về. */
|
|
8
|
+
readonly changes: import("@angular/core").Signal<number>;
|
|
9
|
+
list(req: ProductListReq): Observable<ProductListRes>;
|
|
10
|
+
detail(id: string): Observable<ProductDto>;
|
|
11
|
+
/** `detail(id)` có cache, cho relation (`productDetail`) và giá trị đã chọn của `product-select`. */
|
|
12
|
+
cachedDetail(id: string): Observable<ProductDto>;
|
|
13
|
+
create(req: ProductSaveReq): Observable<ProductDto>;
|
|
14
|
+
update(id: string, req: ProductSaveReq): Observable<ProductDto>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProductService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProductService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Injectable, signal } from '@angular/core';
|
|
2
|
+
import { shareReplay, tap, type Observable } from 'rxjs';
|
|
3
|
+
import { BaseApiService } from '../../../services/base-api.service';
|
|
4
|
+
import type { ProductDto, ProductListReq, ProductListRes, ProductSaveReq } from './product.model';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class ProductService extends BaseApiService {
|
|
8
|
+
/** Một request cho mỗi ID trong phạm vi service: pipe và select dùng chung kết quả. */
|
|
9
|
+
readonly #details = new Map<string, Observable<ProductDto>>();
|
|
10
|
+
readonly #changes = signal(0);
|
|
11
|
+
/** Tăng sau mỗi lần tạo hoặc cập nhật thành công: danh sách tải lại khi quay về. */
|
|
12
|
+
readonly changes = this.#changes.asReadonly();
|
|
13
|
+
|
|
14
|
+
list(req: ProductListReq): Observable<ProductListRes> {
|
|
15
|
+
return this.http.get<ProductListRes>(this.apiUrl('products'), {
|
|
16
|
+
params: this.buildPagingReq(req),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
detail(id: string): Observable<ProductDto> {
|
|
21
|
+
return this.http.get<ProductDto>(this.apiUrl('products', id));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** `detail(id)` có cache, cho relation (`productDetail`) và giá trị đã chọn của `product-select`. */
|
|
25
|
+
cachedDetail(id: string): Observable<ProductDto> {
|
|
26
|
+
let detail = this.#details.get(id);
|
|
27
|
+
if (!detail) {
|
|
28
|
+
detail = this.detail(id).pipe(shareReplay({ bufferSize: 1, refCount: false }));
|
|
29
|
+
this.#details.set(id, detail);
|
|
30
|
+
// Lỗi tra cứu không được cache: lần gọi sau hỏi lại.
|
|
31
|
+
detail.subscribe({ error: () => this.#details.delete(id) });
|
|
32
|
+
}
|
|
33
|
+
return detail;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
create(req: ProductSaveReq): Observable<ProductDto> {
|
|
37
|
+
return this.http.post<ProductDto>(this.apiUrl('products'), req).pipe(tap(() => this.#changes.update(count => count + 1)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
update(id: string, req: ProductSaveReq): Observable<ProductDto> {
|
|
41
|
+
return this.http.put<ProductDto>(this.apiUrl('products', id), req).pipe(
|
|
42
|
+
tap(() => {
|
|
43
|
+
this.#details.delete(id);
|
|
44
|
+
this.#changes.update(count => count + 1);
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import type { SettingsDto } from '../../services/settings.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Cài đặt một bản ghi: `sd-page-form` có mục lục, nhiều nhóm. Lưu xong vẫn ở trang; footer báo trạng thái lưu, rời
|
|
6
|
+
* trang khi còn thay đổi thì hỏi. Vai trò chỉ có quyền xem thấy form ở chế độ xem.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UpdateComponent {
|
|
9
|
+
#private;
|
|
10
|
+
protected readonly canEdit: boolean;
|
|
11
|
+
protected readonly currencies: {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
/** Bản ghi đã lưu gần nhất: sau khi lưu thay bằng bản API trả về. */
|
|
16
|
+
protected readonly entity: import("@angular/core").WritableSignal<SettingsDto>;
|
|
17
|
+
protected readonly emailNotify: import("@angular/core").WritableSignal<boolean>;
|
|
18
|
+
protected readonly form: FormGroup<{}>;
|
|
19
|
+
protected readonly saving: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
+
protected readonly apiErrors: import("../../../../utils/form-api-errors").FormApiErrors;
|
|
21
|
+
protected readonly unsaved: import("@sdcorejs/angular/services").SdUnsavedChangesRegistration;
|
|
22
|
+
constructor();
|
|
23
|
+
protected save(): Promise<void>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UpdateComponent, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UpdateComponent, "update", never, {}, {}, never, never, true, never>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterNextRender,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
DestroyRef,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
Injector,
|
|
9
|
+
linkedSignal,
|
|
10
|
+
signal,
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
13
|
+
import { FormGroup } from '@angular/forms';
|
|
14
|
+
import { ActivatedRoute } from '@angular/router';
|
|
15
|
+
import { firstValueFrom, map } from 'rxjs';
|
|
16
|
+
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
17
|
+
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
18
|
+
import { SdInput } from '@sdcorejs/angular/forms/input';
|
|
19
|
+
import { SdInputNumber } from '@sdcorejs/angular/forms/input-number';
|
|
20
|
+
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
21
|
+
import { SdSwitch } from '@sdcorejs/angular/forms/switch';
|
|
22
|
+
import { SdPageComponent } from '@sdcorejs/angular/modules/layout';
|
|
23
|
+
import { SdPermissionDirective, SdPermissionService } from '@sdcorejs/angular/modules/permission';
|
|
24
|
+
import { SdFormatDatetimePipe } from '@sdcorejs/angular/pipes';
|
|
25
|
+
import { SdNotifyService } from '@sdcorejs/angular/services/notify';
|
|
26
|
+
import { registerSdUnsavedChangesForm, SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';
|
|
27
|
+
import { apiErrorMessage } from '../../../../utils/api-error';
|
|
28
|
+
import { focusFirstInvalid } from '../../../../utils/focus-first-invalid';
|
|
29
|
+
import { formApiErrors } from '../../../../utils/form-api-errors';
|
|
30
|
+
import { SettingsService } from '../../services/settings.service';
|
|
31
|
+
import type { SettingsDto, SettingsSaveReq } from '../../services/settings.model';
|
|
32
|
+
|
|
33
|
+
const CURRENCIES = [
|
|
34
|
+
{ value: 'VND', label: 'Việt Nam đồng (VND)' },
|
|
35
|
+
{ value: 'USD', label: 'Đô la Mỹ (USD)' },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Cài đặt một bản ghi: `sd-page-form` có mục lục, nhiều nhóm. Lưu xong vẫn ở trang; footer báo trạng thái lưu, rời
|
|
40
|
+
* trang khi còn thay đổi thì hỏi. Vai trò chỉ có quyền xem thấy form ở chế độ xem.
|
|
41
|
+
*/
|
|
42
|
+
@Component({
|
|
43
|
+
selector: 'update',
|
|
44
|
+
standalone: true,
|
|
45
|
+
imports: [SdPageComponent, SdButton, SdSection, SdInput, SdInputNumber, SdSelect, SdSwitch, SdPermissionDirective, SdFormatDatetimePipe],
|
|
46
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
47
|
+
template: `
|
|
48
|
+
@let value = entity();
|
|
49
|
+
@let errors = apiErrors.errors();
|
|
50
|
+
<sd-page-form title="Cài đặt cửa hàng" description="Áp dụng cho mọi chi nhánh." toc>
|
|
51
|
+
<sd-button
|
|
52
|
+
headerRight
|
|
53
|
+
*sdPermission="'PATTERN_SETTINGS_U_UPDATE'"
|
|
54
|
+
title="Lưu"
|
|
55
|
+
prefixIcon="save"
|
|
56
|
+
type="fill"
|
|
57
|
+
color="primary"
|
|
58
|
+
autoId="settings-save"
|
|
59
|
+
[loading]="saving()"
|
|
60
|
+
(click)="save()" />
|
|
61
|
+
<div class="d-flex flex-column gap-16 py-16">
|
|
62
|
+
<sd-section title="Thông tin cửa hàng">
|
|
63
|
+
<div class="row px-16 pt-16 pb-8">
|
|
64
|
+
<div class="col-12 col-md-6">
|
|
65
|
+
<sd-input
|
|
66
|
+
label="Tên cửa hàng"
|
|
67
|
+
name="storeName"
|
|
68
|
+
autoId="settings-store-name"
|
|
69
|
+
[form]="form"
|
|
70
|
+
[model]="value.storeName"
|
|
71
|
+
[viewed]="!canEdit"
|
|
72
|
+
[inlineError]="errors['storeName']"
|
|
73
|
+
required />
|
|
74
|
+
</div>
|
|
75
|
+
<div class="col-12 col-md-6">
|
|
76
|
+
<sd-input label="Hotline" name="hotline" [form]="form" [model]="value.hotline" [viewed]="!canEdit" />
|
|
77
|
+
</div>
|
|
78
|
+
<div class="col-12">
|
|
79
|
+
<sd-input label="Địa chỉ" name="address" [form]="form" [model]="value.address" [viewed]="!canEdit" />
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</sd-section>
|
|
83
|
+
<sd-section title="Bán hàng">
|
|
84
|
+
<div class="row px-16 pt-16 pb-8">
|
|
85
|
+
<div class="col-12 col-md-6">
|
|
86
|
+
<sd-select
|
|
87
|
+
label="Tiền tệ"
|
|
88
|
+
name="currency"
|
|
89
|
+
[form]="form"
|
|
90
|
+
[model]="value.currency"
|
|
91
|
+
[items]="currencies"
|
|
92
|
+
valueField="value"
|
|
93
|
+
displayField="label"
|
|
94
|
+
[viewed]="!canEdit"
|
|
95
|
+
[clearable]="false" />
|
|
96
|
+
</div>
|
|
97
|
+
<div class="col-12 col-md-6">
|
|
98
|
+
<sd-input
|
|
99
|
+
label="Tiền tố mã đơn"
|
|
100
|
+
name="orderPrefix"
|
|
101
|
+
autoId="settings-order-prefix"
|
|
102
|
+
[form]="form"
|
|
103
|
+
[model]="value.orderPrefix"
|
|
104
|
+
[viewed]="!canEdit"
|
|
105
|
+
[inlineError]="errors['orderPrefix']"
|
|
106
|
+
maxlength="5"
|
|
107
|
+
required />
|
|
108
|
+
</div>
|
|
109
|
+
<div class="col-12 col-md-6">
|
|
110
|
+
<sd-input-number
|
|
111
|
+
label="Ngưỡng cảnh báo tồn kho"
|
|
112
|
+
name="lowStockThreshold"
|
|
113
|
+
type="positive"
|
|
114
|
+
[precision]="0"
|
|
115
|
+
[form]="form"
|
|
116
|
+
[model]="value.lowStockThreshold"
|
|
117
|
+
[viewed]="!canEdit" />
|
|
118
|
+
</div>
|
|
119
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
120
|
+
<sd-switch
|
|
121
|
+
label="Tự xác nhận đơn online"
|
|
122
|
+
name="autoConfirm"
|
|
123
|
+
[form]="form"
|
|
124
|
+
[model]="value.autoConfirm"
|
|
125
|
+
[disabled]="!canEdit" />
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</sd-section>
|
|
129
|
+
<sd-section title="Thông báo">
|
|
130
|
+
<div class="row px-16 pt-16 pb-8">
|
|
131
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
132
|
+
<sd-switch
|
|
133
|
+
label="Gửi email"
|
|
134
|
+
name="emailNotify"
|
|
135
|
+
[form]="form"
|
|
136
|
+
[model]="value.emailNotify"
|
|
137
|
+
[disabled]="!canEdit"
|
|
138
|
+
(modelChange)="emailNotify.set(!!$event)" />
|
|
139
|
+
</div>
|
|
140
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
141
|
+
<sd-switch label="Gửi SMS" name="smsNotify" [form]="form" [model]="value.smsNotify" [disabled]="!canEdit" />
|
|
142
|
+
</div>
|
|
143
|
+
<div class="col-12">
|
|
144
|
+
<sd-input
|
|
145
|
+
label="Email nhận thông báo"
|
|
146
|
+
name="notifyEmail"
|
|
147
|
+
[form]="form"
|
|
148
|
+
[model]="value.notifyEmail"
|
|
149
|
+
pattern="EMAIL"
|
|
150
|
+
[viewed]="!canEdit"
|
|
151
|
+
[required]="emailNotify()" />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</sd-section>
|
|
155
|
+
<sd-section title="Bảo mật">
|
|
156
|
+
<div class="row px-16 pt-16 pb-8">
|
|
157
|
+
<div class="col-12 col-md-6">
|
|
158
|
+
<sd-input-number
|
|
159
|
+
label="Hết phiên sau (phút)"
|
|
160
|
+
name="sessionMinutes"
|
|
161
|
+
autoId="settings-session"
|
|
162
|
+
type="positive"
|
|
163
|
+
[precision]="0"
|
|
164
|
+
[form]="form"
|
|
165
|
+
[model]="value.sessionMinutes"
|
|
166
|
+
[viewed]="!canEdit"
|
|
167
|
+
[inlineError]="errors['sessionMinutes']"
|
|
168
|
+
required />
|
|
169
|
+
</div>
|
|
170
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
171
|
+
<sd-switch label="Xác thực hai bước" name="twoFactor" [form]="form" [model]="value.twoFactor" [disabled]="!canEdit" />
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</sd-section>
|
|
175
|
+
</div>
|
|
176
|
+
<span sdFooterLeft class="T14R text-secondary" role="status" data-autoid="settings-save-state">
|
|
177
|
+
{{ unsaved.dirty() ? 'Có thay đổi chưa lưu' : 'Đã lưu lúc ' + (value.updatedAt | sdFormatDatetime) }}
|
|
178
|
+
</span>
|
|
179
|
+
</sd-page-form>
|
|
180
|
+
`,
|
|
181
|
+
})
|
|
182
|
+
export class UpdateComponent {
|
|
183
|
+
readonly #settingsService = inject(SettingsService);
|
|
184
|
+
readonly #notify = inject(SdNotifyService);
|
|
185
|
+
readonly #route = inject(ActivatedRoute);
|
|
186
|
+
readonly #host: HTMLElement = inject(ElementRef).nativeElement;
|
|
187
|
+
readonly #injector = inject(Injector);
|
|
188
|
+
protected readonly canEdit = inject(SdPermissionService).hasPermission('PATTERN_SETTINGS_U_UPDATE');
|
|
189
|
+
protected readonly currencies = CURRENCIES;
|
|
190
|
+
readonly #resolved = toSignal(this.#route.data.pipe(map(data => data['entity'] as SettingsDto)), { requireSync: true });
|
|
191
|
+
/** Bản ghi đã lưu gần nhất: sau khi lưu thay bằng bản API trả về. */
|
|
192
|
+
protected readonly entity = linkedSignal(() => this.#resolved());
|
|
193
|
+
protected readonly emailNotify = linkedSignal(() => this.entity().emailNotify);
|
|
194
|
+
protected readonly form = new FormGroup({});
|
|
195
|
+
protected readonly saving = signal(false);
|
|
196
|
+
protected readonly apiErrors = formApiErrors(this.form);
|
|
197
|
+
protected readonly unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'settings', dirty: 'value' });
|
|
198
|
+
|
|
199
|
+
constructor() {
|
|
200
|
+
inject(DestroyRef).onDestroy(() => this.unsaved.destroy());
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
protected async save(): Promise<void> {
|
|
204
|
+
if (this.saving()) return;
|
|
205
|
+
this.form.markAllAsTouched();
|
|
206
|
+
if (this.form.invalid) {
|
|
207
|
+
this.#focusFirstInvalid();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.saving.set(true);
|
|
211
|
+
try {
|
|
212
|
+
const saved = await firstValueFrom(this.#settingsService.update({ ...this.entity(), ...this.form.getRawValue() } as SettingsSaveReq));
|
|
213
|
+
this.entity.set(saved);
|
|
214
|
+
// Ở lại trang: giá trị vừa lưu là mốc so sánh mới (`markPristine()` ở chế độ value), sửa tiếp vẫn được bảo vệ khi rời trang.
|
|
215
|
+
this.unsaved.markPristine();
|
|
216
|
+
this.#notify.success('Đã lưu cài đặt.');
|
|
217
|
+
} catch (error) {
|
|
218
|
+
if (this.apiErrors.set(error)) this.#focusFirstInvalid();
|
|
219
|
+
else this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Thay đổi vẫn được giữ.'));
|
|
220
|
+
} finally {
|
|
221
|
+
this.saving.set(false);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
#focusFirstInvalid(): void {
|
|
226
|
+
afterNextRender(() => focusFirstInvalid(this.#host), { injector: this.#injector });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Routes } from '@angular/router';
|
|
2
|
+
import { sdPageFormLeaveGuard } from '@sdcorejs/angular/modules/layout';
|
|
3
|
+
import { SdPermissionGuard } from '@sdcorejs/angular/modules/permission';
|
|
4
|
+
import { SettingsService } from './services/settings.service';
|
|
5
|
+
import { settingsResolver } from './settings.resolver';
|
|
6
|
+
|
|
7
|
+
/** Một bản ghi: vào thẳng trang cập nhật; người chỉ có quyền xem thấy form ở chế độ xem. */
|
|
8
|
+
export const routes: Routes = [
|
|
9
|
+
{
|
|
10
|
+
path: '',
|
|
11
|
+
providers: [SettingsService],
|
|
12
|
+
canActivateChild: [SdPermissionGuard],
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
path: '',
|
|
16
|
+
title: 'Cài đặt',
|
|
17
|
+
data: { permission: 'PATTERN_SETTINGS_R_DETAIL' },
|
|
18
|
+
resolve: { entity: settingsResolver },
|
|
19
|
+
canDeactivate: [sdPageFormLeaveGuard],
|
|
20
|
+
loadComponent: () => import('./pages/update/update.component').then(module => module.UpdateComponent),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Cài đặt cửa hàng: một bản ghi, không có danh sách. */
|
|
2
|
+
export interface SettingsDto {
|
|
3
|
+
readonly storeName: string;
|
|
4
|
+
readonly hotline: string;
|
|
5
|
+
readonly address: string;
|
|
6
|
+
readonly currency: string;
|
|
7
|
+
readonly orderPrefix: string;
|
|
8
|
+
readonly autoConfirm: boolean;
|
|
9
|
+
readonly lowStockThreshold: number;
|
|
10
|
+
readonly emailNotify: boolean;
|
|
11
|
+
readonly smsNotify: boolean;
|
|
12
|
+
readonly notifyEmail: string;
|
|
13
|
+
readonly sessionMinutes: number;
|
|
14
|
+
readonly twoFactor: boolean;
|
|
15
|
+
readonly updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export type SettingsSaveReq = Omit<SettingsDto, 'updatedAt'>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Cài đặt cửa hàng: một bản ghi, không có danh sách. */
|
|
2
|
+
export interface SettingsDto {
|
|
3
|
+
readonly storeName: string;
|
|
4
|
+
readonly hotline: string;
|
|
5
|
+
readonly address: string;
|
|
6
|
+
readonly currency: string;
|
|
7
|
+
readonly orderPrefix: string;
|
|
8
|
+
readonly autoConfirm: boolean;
|
|
9
|
+
readonly lowStockThreshold: number;
|
|
10
|
+
readonly emailNotify: boolean;
|
|
11
|
+
readonly smsNotify: boolean;
|
|
12
|
+
readonly notifyEmail: string;
|
|
13
|
+
readonly sessionMinutes: number;
|
|
14
|
+
readonly twoFactor: boolean;
|
|
15
|
+
readonly updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type SettingsSaveReq = Omit<SettingsDto, 'updatedAt'>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Observable } from 'rxjs';
|
|
2
|
+
import { BaseApiService } from '../../../services/base-api.service';
|
|
3
|
+
import type { SettingsDto, SettingsSaveReq } from './settings.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SettingsService extends BaseApiService {
|
|
6
|
+
detail(): Observable<SettingsDto>;
|
|
7
|
+
update(req: SettingsSaveReq): Observable<SettingsDto>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsService, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SettingsService>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import { BaseApiService } from '../../../services/base-api.service';
|
|
4
|
+
import type { SettingsDto, SettingsSaveReq } from './settings.model';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class SettingsService extends BaseApiService {
|
|
8
|
+
detail(): Observable<SettingsDto> {
|
|
9
|
+
return this.http.get<SettingsDto>(this.apiUrl('settings'));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
update(req: SettingsSaveReq): Observable<SettingsDto> {
|
|
13
|
+
return this.http.put<SettingsDto>(this.apiUrl('settings'), req);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { inject } from '@angular/core';
|
|
2
|
+
import type { ResolveFn } from '@angular/router';
|
|
3
|
+
import { timeout } from 'rxjs';
|
|
4
|
+
import { SettingsService } from './services/settings.service';
|
|
5
|
+
import type { SettingsDto } from './services/settings.model';
|
|
6
|
+
|
|
7
|
+
/** Tải cài đặt trước khi mở trang; lỗi đi tới navigation error handler của host. */
|
|
8
|
+
export const settingsResolver: ResolveFn<SettingsDto> = () => inject(SettingsService).detail().pipe(timeout(10_000));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Routes } from '@angular/router';
|
|
2
|
+
/**
|
|
3
|
+
* Routes of `/pattern`. Mount them with `provideSdPatterns()` in the providers of the same route:
|
|
4
|
+
* the guard below is the route-level `SdPermissionGuard` of the sample roles, not the host's.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SD_PATTERN_ROUTES: Routes;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
|
+
import type { PagingReq } from '@sdcorejs/utils/models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* HttpClient, configuration and URL helpers shared by the API services of the pattern features.
|
|
6
|
+
* The services do not know whether the mock API or a real API answers.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseApiService {
|
|
9
|
+
protected readonly http: HttpClient;
|
|
10
|
+
protected readonly configuration: import("../configurations/pattern.configuration").SdPatternResolvedConfiguration;
|
|
11
|
+
protected apiUrl(...segments: string[]): string;
|
|
12
|
+
/** Wire format of the sample API: scalar paging + JSON for filters/orders/fields. */
|
|
13
|
+
protected buildPagingReq<T>(req: PagingReq<T>): HttpParams;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseApiService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseApiService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Field errors returned by the API, keyed by field name, to show on the matching fields. */
|
|
2
|
+
export declare function apiFieldErrors(error: unknown): Record<string, string>;
|
|
3
|
+
/** Message to show for a failed request, with the field errors that no field of the screen shows. */
|
|
4
|
+
export declare function apiErrorMessage(error: unknown, fallback?: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Signal } from '@angular/core';
|
|
2
|
+
import type { FormGroup } from '@angular/forms';
|
|
3
|
+
/** Field errors of the last failed save, shown on the fields through `[inlineError]`. */
|
|
4
|
+
export interface FormApiErrors {
|
|
5
|
+
/** Field → message, without the fields the user changed since the failure. */
|
|
6
|
+
readonly errors: Signal<Readonly<Record<string, string>>>;
|
|
7
|
+
/** Keeps the field errors of `error`; returns whether one of them is on a field of the form. */
|
|
8
|
+
set(error: unknown): boolean;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Field errors of a save that the API rejected (`errors: [{ field, message }]`, a field path such as `lines.2.quantity`
|
|
13
|
+
* for a row). A field keeps its error until the user changes its value, so the next save is not blocked by an answer that no longer applies.
|
|
14
|
+
* Call it in an injection context (a field initializer of the page or drawer).
|
|
15
|
+
*/
|
|
16
|
+
export declare function formApiErrors(form: FormGroup): FormApiErrors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdcorejs/angular",
|
|
3
|
-
"version": "19.3.
|
|
3
|
+
"version": "19.3.4",
|
|
4
4
|
"description": "Angular component library: data table, query bar/builder, 20+ signal-based form controls, layout, auth and workflow services. Standalone, OnPush, signals-first. Published in parallel lines for Angular 19, 20, 21 and 22.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"types": "./index.d.ts",
|
|
84
84
|
"default": "./fesm2022/sdcorejs-angular.mjs"
|
|
85
85
|
},
|
|
86
|
-
"./configurations": {
|
|
87
|
-
"types": "./configurations/index.d.ts",
|
|
88
|
-
"default": "./fesm2022/sdcorejs-angular-configurations.mjs"
|
|
89
|
-
},
|
|
90
86
|
"./components": {
|
|
91
87
|
"types": "./components/index.d.ts",
|
|
92
88
|
"default": "./fesm2022/sdcorejs-angular-components.mjs"
|
|
93
89
|
},
|
|
90
|
+
"./configurations": {
|
|
91
|
+
"types": "./configurations/index.d.ts",
|
|
92
|
+
"default": "./fesm2022/sdcorejs-angular-configurations.mjs"
|
|
93
|
+
},
|
|
94
94
|
"./directives": {
|
|
95
95
|
"types": "./directives/index.d.ts",
|
|
96
96
|
"default": "./fesm2022/sdcorejs-angular-directives.mjs"
|
|
@@ -327,14 +327,14 @@
|
|
|
327
327
|
"types": "./forms/datetime/index.d.ts",
|
|
328
328
|
"default": "./fesm2022/sdcorejs-angular-forms-datetime.mjs"
|
|
329
329
|
},
|
|
330
|
-
"./forms/directives": {
|
|
331
|
-
"types": "./forms/directives/index.d.ts",
|
|
332
|
-
"default": "./fesm2022/sdcorejs-angular-forms-directives.mjs"
|
|
333
|
-
},
|
|
334
330
|
"./forms/entity-picker": {
|
|
335
331
|
"types": "./forms/entity-picker/index.d.ts",
|
|
336
332
|
"default": "./fesm2022/sdcorejs-angular-forms-entity-picker.mjs"
|
|
337
333
|
},
|
|
334
|
+
"./forms/directives": {
|
|
335
|
+
"types": "./forms/directives/index.d.ts",
|
|
336
|
+
"default": "./fesm2022/sdcorejs-angular-forms-directives.mjs"
|
|
337
|
+
},
|
|
338
338
|
"./forms/inline-text": {
|
|
339
339
|
"types": "./forms/inline-text/index.d.ts",
|
|
340
340
|
"default": "./fesm2022/sdcorejs-angular-forms-inline-text.mjs"
|
|
@@ -407,6 +407,10 @@
|
|
|
407
407
|
"types": "./modules/keycloak/index.d.ts",
|
|
408
408
|
"default": "./fesm2022/sdcorejs-angular-modules-keycloak.mjs"
|
|
409
409
|
},
|
|
410
|
+
"./modules/pattern": {
|
|
411
|
+
"types": "./modules/pattern/index.d.ts",
|
|
412
|
+
"default": "./fesm2022/sdcorejs-angular-modules-pattern.mjs"
|
|
413
|
+
},
|
|
410
414
|
"./modules/layout": {
|
|
411
415
|
"types": "./modules/layout/index.d.ts",
|
|
412
416
|
"default": "./fesm2022/sdcorejs-angular-modules-layout.mjs"
|
|
@@ -5,13 +5,13 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
* Handler API đăng ký lúc runtime, sống ở root injector.
|
|
6
6
|
*
|
|
7
7
|
* why: `SdHttpInterceptor` được đăng ký qua `HTTP_INTERCEPTORS` ở ROOT, nên
|
|
8
|
-
* `inject(
|
|
9
|
-
* `{ provide:
|
|
8
|
+
* `inject(SD_API_CONFIGURATION)` của nó chỉ thấy provider ở root. Library nào khai
|
|
9
|
+
* `{ provide: SD_API_CONFIGURATION, multi: true }` trong NgModule mà shell nạp bằng
|
|
10
10
|
* `loadChildren` thì provider nằm ở child injector của lazy route — interceptor không
|
|
11
11
|
* bao giờ thấy, nên mất `intercept` / `beforeRemote` / `afterRemote` trong im lặng.
|
|
12
12
|
* Registry này là điểm hẹn ở root mà mọi scope (root, eager, lazy) đều ghi vào được.
|
|
13
13
|
*
|
|
14
|
-
* Registry tự nhặt `
|
|
14
|
+
* Registry tự nhặt `SD_API_CONFIGURATION` khai trong injector của lazy route (`Route.providers`,
|
|
15
15
|
* NgModule của `loadChildren`) trong chính navigation Router tạo injector đó — trước guard,
|
|
16
16
|
* resolver và component — và gỡ khi injector bị huỷ;
|
|
17
17
|
* library giữ nguyên cách khai multi provider, không cần biết shell mount nó eager hay lazy.
|
|
@@ -6,9 +6,9 @@ interface SdApiConfigurationSink {
|
|
|
6
6
|
register(configuration: ISdApiConfiguration): () => void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Nhặt `
|
|
9
|
+
* Nhặt `SD_API_CONFIGURATION` khai trong injector của lazy route và đăng ký vào registry ở root.
|
|
10
10
|
*
|
|
11
|
-
* why: interceptor sống ở root nên không thấy `{ provide:
|
|
11
|
+
* why: interceptor sống ở root nên không thấy `{ provide: SD_API_CONFIGURATION, multi: true }` nằm trong
|
|
12
12
|
* `Route.providers` hay NgModule nạp bằng `loadChildren`. Library không biết shell mount nó eager
|
|
13
13
|
* hay lazy, nên Core phải tự tìm các injector đó thay vì bắt library đổi cách khai.
|
|
14
14
|
*
|
|
@@ -69,9 +69,9 @@ export interface SdApiHandler {
|
|
|
69
69
|
export interface ISdApiConfiguration {
|
|
70
70
|
handlers?: SdApiHandler[];
|
|
71
71
|
}
|
|
72
|
-
export declare const SD_API_CONFIG: InjectionToken<ISdApiConfiguration>;
|
|
73
|
-
/** @deprecated Use `SD_API_CONFIG`. This is the same injection token. */
|
|
74
72
|
export declare const SD_API_CONFIGURATION: InjectionToken<ISdApiConfiguration>;
|
|
73
|
+
/** @deprecated Use `SD_API_CONFIGURATION`. This is the same injection token. */
|
|
74
|
+
export declare const SD_API_CONFIG: InjectionToken<ISdApiConfiguration>;
|
|
75
75
|
/**
|
|
76
76
|
* Lỗi nghiệp vụ: HTTP 200 nhưng body envelope báo thất bại (`{ ok: false, ... }`).
|
|
77
77
|
*
|
|
@@ -43,7 +43,7 @@ export type SdCacheGetCallback = (key: string, option?: SdCacheOption<unknown>)
|
|
|
43
43
|
export type SdCacheRemoveCallback = (key: string, option?: SdCacheOption<unknown>) => Promise<void> | void;
|
|
44
44
|
/**
|
|
45
45
|
* Số entry `type: 'memory'` tối đa được giữ trước khi LRU đẩy entry cũ nhất ra.
|
|
46
|
-
* Ghi đè bằng `maxMemoryEntries` trên `
|
|
46
|
+
* Ghi đè bằng `maxMemoryEntries` trên `SD_CACHE_CONFIGURATION`.
|
|
47
47
|
*/
|
|
48
48
|
export declare const SD_CACHE_DEFAULT_MAX_MEMORY_ENTRIES = 500;
|
|
49
49
|
export interface ISdCacheConfiguration {
|
|
@@ -61,6 +61,8 @@ export interface ISdCacheConfiguration {
|
|
|
61
61
|
get?: SdCacheGetCallback;
|
|
62
62
|
remove?: SdCacheRemoveCallback;
|
|
63
63
|
}
|
|
64
|
+
export declare const SD_CACHE_CONFIGURATION: InjectionToken<ISdCacheConfiguration>;
|
|
65
|
+
/** @deprecated Use `SD_CACHE_CONFIGURATION`. This is the same injection token. */
|
|
64
66
|
export declare const SD_CACHE_CONFIG: InjectionToken<ISdCacheConfiguration>;
|
|
65
67
|
export interface SdLegacyCacheCallbacks<T> {
|
|
66
68
|
matches: (key: string, option?: SdCacheOption<unknown>) => boolean;
|
|
@@ -39,4 +39,6 @@ export interface ISdStorageConfiguration {
|
|
|
39
39
|
serializer?: SdPersistenceSerializer;
|
|
40
40
|
identityCanonicalizer?: SdPersistenceIdentityCanonicalizer;
|
|
41
41
|
}
|
|
42
|
+
export declare const SD_STORAGE_CONFIGURATION: InjectionToken<ISdStorageConfiguration>;
|
|
43
|
+
/** @deprecated Use `SD_STORAGE_CONFIGURATION`. This is the same injection token. */
|
|
42
44
|
export declare const SD_STORAGE_CONFIG: InjectionToken<ISdStorageConfiguration>;
|
|
@@ -9,6 +9,15 @@ export interface SdUnsavedChangesFormOptions<TValue> {
|
|
|
9
9
|
readonly save?: (value: TValue) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
10
10
|
readonly reset?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
11
11
|
readonly discard?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* `'control'` (default): the form's own `dirty` flag. `'value'`: dirty only while the value differs from the
|
|
14
|
+
* saved one, so a value typed back to what it was is no change, whether or not the field marks its control dirty.
|
|
15
|
+
* In `'value'` mode each control's saved value is the one it holds once it has joined the form (an `<sd-*>`
|
|
16
|
+
* field registers and writes its model after this call), and it is taken again when the form or the control is
|
|
17
|
+
* marked pristine, on `save()`, `reset()`, `discard()` and on `markPristine()` of the registration. A page that
|
|
18
|
+
* loads another record into the same form calls `markPristine()` once the record is in.
|
|
19
|
+
*/
|
|
20
|
+
readonly dirty?: 'control' | 'value';
|
|
12
21
|
}
|
|
13
22
|
export declare function registerSdUnsavedChangesForm<TValue extends Record<string, unknown>>(service: SdUnsavedChangesService, form: FormGroup, options: SdUnsavedChangesFormOptions<TValue>): SdUnsavedChangesRegistration;
|
|
14
23
|
export declare function createSdUnsavedChangesCloseGuard(service: SdUnsavedChangesService, options?: Omit<SdUnsavedChangesConfirmOptions, 'reason'>): () => Promise<boolean>;
|