@sdcorejs/angular 20.3.2 → 20.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/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 +19 -1
- package/components/section/index.d.ts +13 -1
- package/components/splitter/index.d.ts +1 -1
- package/components/tab-router/index.d.ts +47 -5
- package/components/table/index.d.ts +127 -13
- package/components/upload-file/index.d.ts +181 -21
- 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-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 +393 -78
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +444 -16
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
- 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 +422 -122
- 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 +210 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +266 -11
- 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-BubUwgBK.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs +131 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs +130 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.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-Bfx6_CmA.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs +90 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs +467 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs +61 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs +87 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs +232 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs +70 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs +522 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.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-C3coYwmZ.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs +297 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs +128 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.mjs +357 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.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-unsaved-changes.mjs +104 -4
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
- package/forms/chip/index.d.ts +136 -26
- package/i18n/index.d.ts +42 -0
- package/modules/layout/index.d.ts +89 -6
- package/modules/pattern/README.md +76 -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.ts +21 -0
- package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
- package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -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.ts +30 -0
- package/modules/pattern/features/approval/services/approval.model.ts +38 -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.ts +123 -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.ts +134 -0
- package/modules/pattern/features/category/entity.resolver.ts +27 -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.ts +42 -0
- package/modules/pattern/features/category/services/category.model.ts +39 -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.ts +131 -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.ts +30 -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.ts +106 -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.ts +140 -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.ts +35 -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.ts +127 -0
- package/modules/pattern/features/customer/entity.resolver.ts +21 -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.ts +120 -0
- package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
- package/modules/pattern/features/customer/routes.ts +59 -0
- package/modules/pattern/features/customer/services/customer.model.ts +87 -0
- package/modules/pattern/features/customer/services/customer.service.ts +79 -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.ts +44 -0
- package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
- package/modules/pattern/features/import/routes.ts +19 -0
- package/modules/pattern/features/import/services/import.model.ts +82 -0
- package/modules/pattern/features/import/services/import.service.ts +18 -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.ts +46 -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.ts +205 -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.ts +128 -0
- package/modules/pattern/features/order/entity.resolver.ts +37 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
- package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -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.ts +119 -0
- package/modules/pattern/features/order/routes.ts +54 -0
- package/modules/pattern/features/order/services/order.model.ts +109 -0
- package/modules/pattern/features/order/services/order.service.ts +63 -0
- package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
- package/modules/pattern/features/partner/routes.ts +20 -0
- package/modules/pattern/features/partner/services/partner.model.ts +30 -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.ts +88 -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.ts +30 -0
- package/modules/pattern/features/product/entity.resolver.ts +21 -0
- package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
- package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -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.ts +86 -0
- package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
- package/modules/pattern/features/product/routes.ts +48 -0
- package/modules/pattern/features/product/services/product.model.ts +38 -0
- package/modules/pattern/features/product/services/product.service.ts +48 -0
- package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
- package/modules/pattern/features/settings/routes.ts +24 -0
- package/modules/pattern/features/settings/services/settings.model.ts +18 -0
- package/modules/pattern/features/settings/services/settings.service.ts +15 -0
- package/modules/pattern/features/settings/settings.resolver.ts +8 -0
- package/modules/pattern/index.d.ts +50 -0
- package/package.json +5 -1
- package/services/unsaved-changes/index.d.ts +11 -0
|
@@ -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,227 @@
|
|
|
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
|
+
type="fill"
|
|
56
|
+
color="primary"
|
|
57
|
+
autoId="settings-save"
|
|
58
|
+
[loading]="saving()"
|
|
59
|
+
(click)="save()" />
|
|
60
|
+
<div class="d-flex flex-column gap-16 py-16">
|
|
61
|
+
<sd-section title="Thông tin cửa hàng">
|
|
62
|
+
<div class="row p-8">
|
|
63
|
+
<div class="col-12 col-md-6">
|
|
64
|
+
<sd-input
|
|
65
|
+
label="Tên cửa hàng"
|
|
66
|
+
name="storeName"
|
|
67
|
+
autoId="settings-store-name"
|
|
68
|
+
[form]="form"
|
|
69
|
+
[model]="value.storeName"
|
|
70
|
+
[viewed]="!canEdit"
|
|
71
|
+
[inlineError]="errors['storeName']"
|
|
72
|
+
required />
|
|
73
|
+
</div>
|
|
74
|
+
<div class="col-12 col-md-6">
|
|
75
|
+
<sd-input label="Hotline" name="hotline" [form]="form" [model]="value.hotline" [viewed]="!canEdit" />
|
|
76
|
+
</div>
|
|
77
|
+
<div class="col-12">
|
|
78
|
+
<sd-input label="Địa chỉ" name="address" [form]="form" [model]="value.address" [viewed]="!canEdit" />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</sd-section>
|
|
82
|
+
<sd-section title="Bán hàng">
|
|
83
|
+
<div class="row p-8">
|
|
84
|
+
<div class="col-12 col-md-6">
|
|
85
|
+
<sd-select
|
|
86
|
+
label="Tiền tệ"
|
|
87
|
+
name="currency"
|
|
88
|
+
[form]="form"
|
|
89
|
+
[model]="value.currency"
|
|
90
|
+
[items]="currencies"
|
|
91
|
+
valueField="value"
|
|
92
|
+
displayField="label"
|
|
93
|
+
[viewed]="!canEdit"
|
|
94
|
+
[clearable]="false" />
|
|
95
|
+
</div>
|
|
96
|
+
<div class="col-12 col-md-6">
|
|
97
|
+
<sd-input
|
|
98
|
+
label="Tiền tố mã đơn"
|
|
99
|
+
name="orderPrefix"
|
|
100
|
+
autoId="settings-order-prefix"
|
|
101
|
+
[form]="form"
|
|
102
|
+
[model]="value.orderPrefix"
|
|
103
|
+
[viewed]="!canEdit"
|
|
104
|
+
[inlineError]="errors['orderPrefix']"
|
|
105
|
+
maxlength="5"
|
|
106
|
+
required />
|
|
107
|
+
</div>
|
|
108
|
+
<div class="col-12 col-md-6">
|
|
109
|
+
<sd-input-number
|
|
110
|
+
label="Ngưỡng cảnh báo tồn kho"
|
|
111
|
+
name="lowStockThreshold"
|
|
112
|
+
type="positive"
|
|
113
|
+
[precision]="0"
|
|
114
|
+
[form]="form"
|
|
115
|
+
[model]="value.lowStockThreshold"
|
|
116
|
+
[viewed]="!canEdit" />
|
|
117
|
+
</div>
|
|
118
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
119
|
+
<sd-switch
|
|
120
|
+
label="Tự xác nhận đơn online"
|
|
121
|
+
name="autoConfirm"
|
|
122
|
+
[form]="form"
|
|
123
|
+
[model]="value.autoConfirm"
|
|
124
|
+
[disabled]="!canEdit" />
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</sd-section>
|
|
128
|
+
<sd-section title="Thông báo">
|
|
129
|
+
<div class="row p-8">
|
|
130
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
131
|
+
<sd-switch
|
|
132
|
+
label="Gửi email"
|
|
133
|
+
name="emailNotify"
|
|
134
|
+
[form]="form"
|
|
135
|
+
[model]="value.emailNotify"
|
|
136
|
+
[disabled]="!canEdit"
|
|
137
|
+
(modelChange)="emailNotify.set(!!$event)" />
|
|
138
|
+
</div>
|
|
139
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
140
|
+
<sd-switch label="Gửi SMS" name="smsNotify" [form]="form" [model]="value.smsNotify" [disabled]="!canEdit" />
|
|
141
|
+
</div>
|
|
142
|
+
<div class="col-12">
|
|
143
|
+
<sd-input
|
|
144
|
+
label="Email nhận thông báo"
|
|
145
|
+
name="notifyEmail"
|
|
146
|
+
[form]="form"
|
|
147
|
+
[model]="value.notifyEmail"
|
|
148
|
+
pattern="EMAIL"
|
|
149
|
+
[viewed]="!canEdit"
|
|
150
|
+
[required]="emailNotify()" />
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</sd-section>
|
|
154
|
+
<sd-section title="Bảo mật">
|
|
155
|
+
<div class="row p-8">
|
|
156
|
+
<div class="col-12 col-md-6">
|
|
157
|
+
<sd-input-number
|
|
158
|
+
label="Hết phiên sau (phút)"
|
|
159
|
+
name="sessionMinutes"
|
|
160
|
+
autoId="settings-session"
|
|
161
|
+
type="positive"
|
|
162
|
+
[precision]="0"
|
|
163
|
+
[form]="form"
|
|
164
|
+
[model]="value.sessionMinutes"
|
|
165
|
+
[viewed]="!canEdit"
|
|
166
|
+
[inlineError]="errors['sessionMinutes']"
|
|
167
|
+
required />
|
|
168
|
+
</div>
|
|
169
|
+
<div class="col-12 col-md-6 d-flex align-items-center">
|
|
170
|
+
<sd-switch label="Xác thực hai bước" name="twoFactor" [form]="form" [model]="value.twoFactor" [disabled]="!canEdit" />
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</sd-section>
|
|
174
|
+
</div>
|
|
175
|
+
<span sdFooterLeft class="T14R text-secondary" role="status" data-autoid="settings-save-state">
|
|
176
|
+
{{ unsaved.dirty() ? 'Có thay đổi chưa lưu' : 'Đã lưu lúc ' + (value.updatedAt | sdFormatDatetime) }}
|
|
177
|
+
</span>
|
|
178
|
+
</sd-page-form>
|
|
179
|
+
`,
|
|
180
|
+
})
|
|
181
|
+
export class UpdateComponent {
|
|
182
|
+
readonly #settingsService = inject(SettingsService);
|
|
183
|
+
readonly #notify = inject(SdNotifyService);
|
|
184
|
+
readonly #route = inject(ActivatedRoute);
|
|
185
|
+
readonly #host: HTMLElement = inject(ElementRef).nativeElement;
|
|
186
|
+
readonly #injector = inject(Injector);
|
|
187
|
+
protected readonly canEdit = inject(SdPermissionService).hasPermission('PATTERN_SETTINGS_U_UPDATE');
|
|
188
|
+
protected readonly currencies = CURRENCIES;
|
|
189
|
+
readonly #resolved = toSignal(this.#route.data.pipe(map(data => data['entity'] as SettingsDto)), { requireSync: true });
|
|
190
|
+
/** Bản ghi đã lưu gần nhất: sau khi lưu thay bằng bản API trả về. */
|
|
191
|
+
protected readonly entity = linkedSignal(() => this.#resolved());
|
|
192
|
+
protected readonly emailNotify = linkedSignal(() => this.entity().emailNotify);
|
|
193
|
+
protected readonly form = new FormGroup({});
|
|
194
|
+
protected readonly saving = signal(false);
|
|
195
|
+
protected readonly apiErrors = formApiErrors(this.form);
|
|
196
|
+
protected readonly unsaved = registerSdUnsavedChangesForm(inject(SdUnsavedChangesService), this.form, { id: 'settings', dirty: 'value' });
|
|
197
|
+
|
|
198
|
+
constructor() {
|
|
199
|
+
inject(DestroyRef).onDestroy(() => this.unsaved.destroy());
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
protected async save(): Promise<void> {
|
|
203
|
+
if (this.saving()) return;
|
|
204
|
+
this.form.markAllAsTouched();
|
|
205
|
+
if (this.form.invalid) {
|
|
206
|
+
this.#focusFirstInvalid();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
this.saving.set(true);
|
|
210
|
+
try {
|
|
211
|
+
const saved = await firstValueFrom(this.#settingsService.update({ ...this.entity(), ...this.form.getRawValue() } as SettingsSaveReq));
|
|
212
|
+
this.entity.set(saved);
|
|
213
|
+
// Ở 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.
|
|
214
|
+
this.unsaved.markPristine();
|
|
215
|
+
this.#notify.success('Đã lưu cài đặt.');
|
|
216
|
+
} catch (error) {
|
|
217
|
+
if (this.apiErrors.set(error)) this.#focusFirstInvalid();
|
|
218
|
+
else this.#notify.error(apiErrorMessage(error, 'Không thể lưu. Thay đổi vẫn được giữ.'));
|
|
219
|
+
} finally {
|
|
220
|
+
this.saving.set(false);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
#focusFirstInvalid(): void {
|
|
225
|
+
afterNextRender(() => focusFirstInvalid(this.#host), { injector: this.#injector });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -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,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,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,50 @@
|
|
|
1
|
+
import { Routes } from '@angular/router';
|
|
2
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Routes of `/pattern`. Mount them with `provideSdPatterns()` in the providers of the same route:
|
|
6
|
+
* the guard below is the route-level `SdPermissionGuard` of the sample roles, not the host's.
|
|
7
|
+
*/
|
|
8
|
+
declare const SD_PATTERN_ROUTES: Routes;
|
|
9
|
+
|
|
10
|
+
/** What the host configures when it mounts the pattern routes with `provideSdPatterns()`. */
|
|
11
|
+
interface SdPatternConfiguration {
|
|
12
|
+
/**
|
|
13
|
+
* Answer `apiBaseUrl` requests from the built-in mock API (seeded data, latency, simulated errors).
|
|
14
|
+
* `false`: the feature services call a real API at `apiBaseUrl`. Default `true`.
|
|
15
|
+
*/
|
|
16
|
+
readonly mockApi?: boolean;
|
|
17
|
+
/** Base URL of the pattern API, root-relative or absolute HTTP(S), no query or hash. Default `'/pattern-api'`. */
|
|
18
|
+
readonly apiBaseUrl?: string;
|
|
19
|
+
/** Latency of every mock response in milliseconds; the toolbar can change it. Default `400`. */
|
|
20
|
+
readonly latencyMs?: number;
|
|
21
|
+
/** Where the mock API keeps created, updated and deleted records. Default `'session'` (sessionStorage). */
|
|
22
|
+
readonly storage?: 'session' | 'none';
|
|
23
|
+
/**
|
|
24
|
+
* Host URL to open when a role has no permission for a pattern route (Core `onForbiden`).
|
|
25
|
+
* Unset: the navigation is only blocked. Errors while loading a record (404, timeout) reach the host's
|
|
26
|
+
* navigation error handler instead, like any other route.
|
|
27
|
+
*/
|
|
28
|
+
readonly forbiddenUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Registers what the pattern routes need, in the environment injector of the route that mounts them:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* {
|
|
36
|
+
* path: 'pattern',
|
|
37
|
+
* loadChildren: () => import('@sdcorejs/angular/modules/pattern').then(m => m.SD_PATTERN_ROUTES),
|
|
38
|
+
* providers: [provideSdPatterns({ mockApi: true })],
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* - The mock API interceptor runs on a child `HttpClient` of that route (`withRequestsMadeViaParent`), so other
|
|
43
|
+
* requests of the host are untouched and requests under `/pattern` still go through the host's interceptors.
|
|
44
|
+
* - `SdPermissionService`, `SdPermissionGuard` and `SD_PERMISSION_CONFIGURATION` are provided again there with the
|
|
45
|
+
* sample roles, so the host's own permissions are neither read nor changed.
|
|
46
|
+
*/
|
|
47
|
+
declare function provideSdPatterns(configuration?: SdPatternConfiguration): EnvironmentProviders;
|
|
48
|
+
|
|
49
|
+
export { SD_PATTERN_ROUTES, provideSdPatterns };
|
|
50
|
+
export type { SdPatternConfiguration };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdcorejs/angular",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.3",
|
|
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",
|
|
@@ -399,6 +399,10 @@
|
|
|
399
399
|
"types": "./modules/layout/index.d.ts",
|
|
400
400
|
"default": "./fesm2022/sdcorejs-angular-modules-layout.mjs"
|
|
401
401
|
},
|
|
402
|
+
"./modules/pattern": {
|
|
403
|
+
"types": "./modules/pattern/index.d.ts",
|
|
404
|
+
"default": "./fesm2022/sdcorejs-angular-modules-pattern.mjs"
|
|
405
|
+
},
|
|
402
406
|
"./modules/permission": {
|
|
403
407
|
"types": "./modules/permission/index.d.ts",
|
|
404
408
|
"default": "./fesm2022/sdcorejs-angular-modules-permission.mjs"
|
|
@@ -42,6 +42,8 @@ interface SdUnsavedChangesRegistration {
|
|
|
42
42
|
interface SdUnsavedChangesConfirmOptions {
|
|
43
43
|
readonly scope?: unknown;
|
|
44
44
|
readonly reason?: SdUnsavedChangesReason;
|
|
45
|
+
/** Asks with this adapter for this call only, instead of `SD_UNSAVED_CHANGES_CONFIRMATION_ADAPTER`. */
|
|
46
|
+
readonly adapter?: SdUnsavedChangesConfirmationAdapter;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
interface SdUnsavedChangesWindow {
|
|
@@ -74,6 +76,15 @@ interface SdUnsavedChangesFormOptions<TValue> {
|
|
|
74
76
|
readonly save?: (value: TValue) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
75
77
|
readonly reset?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
76
78
|
readonly discard?: (form: FormGroup) => SdUnsavedChangesMaybeAsync<void | boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* `'control'` (default): the form's own `dirty` flag. `'value'`: dirty only while the value differs from the
|
|
81
|
+
* saved one, so a value typed back to what it was is no change, whether or not the field marks its control dirty.
|
|
82
|
+
* In `'value'` mode each control's saved value is the one it holds once it has joined the form (an `<sd-*>`
|
|
83
|
+
* field registers and writes its model after this call), and it is taken again when the form or the control is
|
|
84
|
+
* marked pristine, on `save()`, `reset()`, `discard()` and on `markPristine()` of the registration. A page that
|
|
85
|
+
* loads another record into the same form calls `markPristine()` once the record is in.
|
|
86
|
+
*/
|
|
87
|
+
readonly dirty?: 'control' | 'value';
|
|
77
88
|
}
|
|
78
89
|
declare function registerSdUnsavedChangesForm<TValue extends Record<string, unknown>>(service: SdUnsavedChangesService, form: FormGroup, options: SdUnsavedChangesFormOptions<TValue>): SdUnsavedChangesRegistration;
|
|
79
90
|
declare function createSdUnsavedChangesCloseGuard(service: SdUnsavedChangesService, options?: Omit<SdUnsavedChangesConfirmOptions, 'reason'>): () => Promise<boolean>;
|