@sdcorejs/angular 21.3.2 → 21.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/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 +414 -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-MlNJ6DDc.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs → sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.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-p8-V_Ol9.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-p8-V_Ol9.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs +130 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs +131 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.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-Cbs05A2j.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs +467 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs +90 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs +61 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +232 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +87 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +70 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs +522 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.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-BpSTfkeT.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs +293 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs +128 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs +357 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.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/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/package.json +5 -1
- package/types/sdcorejs-angular-components-badge.d.ts +19 -1
- package/types/sdcorejs-angular-components-section.d.ts +13 -1
- package/types/sdcorejs-angular-components-splitter.d.ts +1 -1
- package/types/sdcorejs-angular-components-tab-router.d.ts +47 -5
- package/types/sdcorejs-angular-components-table.d.ts +127 -13
- package/types/sdcorejs-angular-components-upload-file.d.ts +181 -21
- package/types/sdcorejs-angular-forms-chip.d.ts +136 -26
- package/types/sdcorejs-angular-i18n.d.ts +42 -0
- package/types/sdcorejs-angular-modules-layout.d.ts +89 -6
- package/types/sdcorejs-angular-modules-pattern.d.ts +50 -0
- package/types/sdcorejs-angular-services-unsaved-changes.d.ts +11 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Relation
|
|
2
|
+
|
|
3
|
+
Hiện bản ghi liên quan theo ID bằng pipe `<entity>Detail` của feature sở hữu entity. Mẫu: `customerDetail` (điện thoại khách trên chi tiết đơn hàng), `productDetail` (tên sản phẩm trên dòng hàng).
|
|
4
|
+
|
|
5
|
+
## Khi nào dùng / khi nào không
|
|
6
|
+
|
|
7
|
+
- Dùng khi bản ghi chỉ có ID của entity khác và màn cần tên, mã hay field khác của entity đó.
|
|
8
|
+
- Response đã có tên (chứng từ giữ snapshot tên khách lúc lập đơn): hiện snapshot, không tra lại tên hiện tại.
|
|
9
|
+
|
|
10
|
+
## Code mẫu
|
|
11
|
+
|
|
12
|
+
<!-- @source features/customer/pipes/customer-detail.pipe.ts -->
|
|
13
|
+
```ts
|
|
14
|
+
import { inject, Pipe, type PipeTransform } from '@angular/core';
|
|
15
|
+
import { of, type Observable } from 'rxjs';
|
|
16
|
+
import { CustomerService } from '../services/customer.service';
|
|
17
|
+
import type { CustomerDto } from '../services/customer.model';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Relation khách hàng theo ID: `@let customer = order.customerId | customerDetail | async;`.
|
|
21
|
+
* CustomerService cache và chia sẻ request theo ID; nơi dùng pipe phải có CustomerService trong injector.
|
|
22
|
+
*/
|
|
23
|
+
@Pipe({ name: 'customerDetail', standalone: true })
|
|
24
|
+
export class CustomerDetailPipe implements PipeTransform {
|
|
25
|
+
readonly #customerService = inject(CustomerService);
|
|
26
|
+
|
|
27
|
+
transform(id: CustomerDto['id'] | null | undefined): Observable<CustomerDto | null> {
|
|
28
|
+
if (id === null || id === undefined || id === '') return of(null);
|
|
29
|
+
return this.#customerService.cachedDetail(id);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Service sở hữu cache và chia sẻ request theo ID; lỗi tra cứu không được cache:
|
|
35
|
+
|
|
36
|
+
<!-- @source features/customer/services/customer.service.ts -->
|
|
37
|
+
```ts
|
|
38
|
+
import { HttpParams } from '@angular/common/http';
|
|
39
|
+
import { Injectable, signal } from '@angular/core';
|
|
40
|
+
import { shareReplay, tap, type Observable } from 'rxjs';
|
|
41
|
+
import type { Filter, PagingRes } from '@sdcorejs/utils/models';
|
|
42
|
+
import { BaseApiService } from '../../../services/base-api.service';
|
|
43
|
+
import type {
|
|
44
|
+
CustomerCounts,
|
|
45
|
+
CustomerDebtDto,
|
|
46
|
+
CustomerDocumentDto,
|
|
47
|
+
CustomerDto,
|
|
48
|
+
CustomerListReq,
|
|
49
|
+
CustomerListRes,
|
|
50
|
+
CustomerOrderDto,
|
|
51
|
+
CustomerSaveReq,
|
|
52
|
+
} from './customer.model';
|
|
53
|
+
|
|
54
|
+
@Injectable()
|
|
55
|
+
export class CustomerService extends BaseApiService {
|
|
56
|
+
readonly #details = new Map<string, Observable<CustomerDto>>();
|
|
57
|
+
readonly #changes = signal(0);
|
|
58
|
+
/** Tăng sau mỗi lần tạo, cập nhật hoặc xoá thành công: danh sách chỉ tải lại khi có thay đổi. */
|
|
59
|
+
readonly changes = this.#changes.asReadonly();
|
|
60
|
+
|
|
61
|
+
list(req: CustomerListReq): Observable<CustomerListRes> {
|
|
62
|
+
return this.http.get<CustomerListRes>(this.apiUrl('customers'), { params: this.buildPagingReq(req) });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Số khách theo nhóm cho score card, theo cùng bộ lọc của danh sách. */
|
|
66
|
+
counts(filters: Filter<CustomerDto>[]): Observable<CustomerCounts> {
|
|
67
|
+
return this.http.get<CustomerCounts>(this.apiUrl('customers', 'counts'), {
|
|
68
|
+
params: new HttpParams().set('filters', JSON.stringify(filters)),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
detail(id: string): Observable<CustomerDto> {
|
|
73
|
+
return this.http.get<CustomerDto>(this.apiUrl('customers', id));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** `detail(id)` có cache, cho relation (`customerDetail`) và giá trị đã chọn của `customer-select`. */
|
|
77
|
+
cachedDetail(id: string): Observable<CustomerDto> {
|
|
78
|
+
let detail = this.#details.get(id);
|
|
79
|
+
if (!detail) {
|
|
80
|
+
detail = this.detail(id).pipe(shareReplay({ bufferSize: 1, refCount: false }));
|
|
81
|
+
this.#details.set(id, detail);
|
|
82
|
+
// Lỗi tra cứu không được cache: lần gọi sau hỏi lại.
|
|
83
|
+
detail.subscribe({ error: () => this.#details.delete(id) });
|
|
84
|
+
}
|
|
85
|
+
return detail;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
create(req: CustomerSaveReq): Observable<CustomerDto> {
|
|
89
|
+
return this.http.post<CustomerDto>(this.apiUrl('customers'), req).pipe(tap(() => this.#changed()));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
update(id: string, req: CustomerSaveReq): Observable<CustomerDto> {
|
|
93
|
+
return this.http.put<CustomerDto>(this.apiUrl('customers', id), req).pipe(tap(() => this.#changed(id)));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
delete(id: string): Observable<void> {
|
|
97
|
+
return this.http.delete<void>(this.apiUrl('customers', id)).pipe(tap(() => this.#changed(id)));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
orders(id: string): Observable<PagingRes<CustomerOrderDto>> {
|
|
101
|
+
return this.http.get<PagingRes<CustomerOrderDto>>(this.apiUrl('customers', id, 'orders'));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
debts(id: string): Observable<PagingRes<CustomerDebtDto>> {
|
|
105
|
+
return this.http.get<PagingRes<CustomerDebtDto>>(this.apiUrl('customers', id, 'debts'));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
documents(id: string): Observable<PagingRes<CustomerDocumentDto>> {
|
|
109
|
+
return this.http.get<PagingRes<CustomerDocumentDto>>(this.apiUrl('customers', id, 'documents'));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#changed(id?: string): void {
|
|
113
|
+
if (id) this.#details.delete(id);
|
|
114
|
+
this.#changes.update(count => count + 1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Dùng trong template:
|
|
120
|
+
|
|
121
|
+
<!-- @source features/order/components/lines-view/lines-view.component.ts -->
|
|
122
|
+
```ts
|
|
123
|
+
import { AsyncPipe } from '@angular/common';
|
|
124
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
125
|
+
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
126
|
+
import { SdTable, SdTableCellDefDirective, type SdTableOption } from '@sdcorejs/angular/components/table';
|
|
127
|
+
import { ProductDetailPipe } from '../../../product/pipes/product-detail.pipe';
|
|
128
|
+
import type { OrderLineDto } from '../../services/order.model';
|
|
129
|
+
|
|
130
|
+
/** Dòng hàng chỉ đọc; tên sản phẩm lấy qua relation `productDetail`, không hiện ID thô. */
|
|
131
|
+
@Component({
|
|
132
|
+
selector: 'lines-view',
|
|
133
|
+
standalone: true,
|
|
134
|
+
imports: [AsyncPipe, SdSection, SdTable, SdTableCellDefDirective, ProductDetailPipe],
|
|
135
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
136
|
+
template: `
|
|
137
|
+
<sd-section title="Dòng hàng">
|
|
138
|
+
<sd-table autoId="order-lines" [option]="option()">
|
|
139
|
+
<ng-template sdTableCellDef="productId" let-line="item">
|
|
140
|
+
@let product = line.productId | productDetail | async;
|
|
141
|
+
{{ product?.name ?? '…' }}
|
|
142
|
+
</ng-template>
|
|
143
|
+
</sd-table>
|
|
144
|
+
</sd-section>
|
|
145
|
+
`,
|
|
146
|
+
})
|
|
147
|
+
export class LinesViewComponent {
|
|
148
|
+
readonly lines = input.required<readonly OrderLineDto[]>();
|
|
149
|
+
protected readonly option = computed<SdTableOption<OrderLineDto & { amount: number }>>(() => {
|
|
150
|
+
const items = this.lines().map(line => ({ ...line, amount: line.quantity * line.unitPrice }));
|
|
151
|
+
return {
|
|
152
|
+
type: 'local',
|
|
153
|
+
items: () => items,
|
|
154
|
+
paginate: { pageSize: 50 },
|
|
155
|
+
filter: { hideInlineFilter: 'auto' },
|
|
156
|
+
columns: [
|
|
157
|
+
{ field: 'productId', title: 'Sản phẩm', type: 'string', minWidth: '200px' },
|
|
158
|
+
{ field: 'quantity', title: 'Số lượng', type: 'number', width: '110px', align: 'right' },
|
|
159
|
+
{ field: 'unitPrice', title: 'Đơn giá (₫)', type: 'number', width: '140px', align: 'right' },
|
|
160
|
+
{ field: 'amount', title: 'Thành tiền (₫)', type: 'number', width: '150px', align: 'right' },
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Quy tắc
|
|
168
|
+
|
|
169
|
+
- MUST đặt pipe trong `pipes/<entity>-detail.pipe.ts` của feature sở hữu entity; tên template `<entity>Detail`, trả object có kiểu của entity, không trả chuỗi.
|
|
170
|
+
- MUST gọi service của đúng entity; pipe không tự gọi HTTP.
|
|
171
|
+
- MUST trả `null` không gọi API khi ID rỗng.
|
|
172
|
+
- MUST để service chia sẻ request theo ID; nhiều dòng cùng ID chỉ một request.
|
|
173
|
+
- MUST cấp service của entity ở route nơi pipe chạy.
|
|
174
|
+
- SHOULD hiện placeholder của Core (`sdEmpty`, `sd-view`) khi giá trị rỗng; không tự viết `--`.
|
|
175
|
+
|
|
176
|
+
## Lỗi hay gặp
|
|
177
|
+
|
|
178
|
+
- Gọi hàm tra tên trong template: chạy lại mỗi lần change detection, mỗi lần một request.
|
|
179
|
+
- Bắt lỗi tra cứu rồi trả `null` như thành công: người dùng thấy `--` thay vì biết là lỗi.
|
|
180
|
+
- Hiện ID thô thay cho tên.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
Chọn entity hoặc enum qua wrapper của feature sở hữu entity. Mẫu: `product-select` và `customer-select` (dòng đơn hàng, đầu đơn hàng), `product-status-select`, `customer-type-select`.
|
|
4
|
+
|
|
5
|
+
## Khi nào dùng / khi nào không
|
|
6
|
+
|
|
7
|
+
- Dùng wrapper mỗi khi một màn chọn entity của feature khác, hoặc chọn một enum của entity.
|
|
8
|
+
- Danh sách lựa chọn cố định chỉ dùng một lần trong chính feature (kênh bán của đơn hàng): `sd-select` với hằng số trong `<entity>.model.ts` là đủ.
|
|
9
|
+
|
|
10
|
+
## Code mẫu
|
|
11
|
+
|
|
12
|
+
Entity: lựa chọn mới chỉ gồm bản ghi đang hoạt động (`SEARCH`); giá trị đã chọn tải theo ID (`VALUE`) nên bản ghi đã ngừng vẫn hiện khi cập nhật. Option hai dòng có avatar:
|
|
13
|
+
|
|
14
|
+
<!-- @source features/customer/components/customer-select/customer-select.component.ts -->
|
|
15
|
+
```ts
|
|
16
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';
|
|
17
|
+
import type { FormGroup } from '@angular/forms';
|
|
18
|
+
import { firstValueFrom } from 'rxjs';
|
|
19
|
+
import { SdAvatar } from '@sdcorejs/angular/components/avatar';
|
|
20
|
+
import { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
21
|
+
import type { SdSearchReq } from '@sdcorejs/angular/forms/models';
|
|
22
|
+
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
23
|
+
import type { Filter } from '@sdcorejs/utils/models';
|
|
24
|
+
import { CustomerService } from '../../services/customer.service';
|
|
25
|
+
import type { CustomerDto } from '../../services/customer.model';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Chọn khách hàng cho màn khác (đơn hàng). Lựa chọn mới chỉ gồm khách đang hoạt động; giá trị đã chọn tải theo ID
|
|
29
|
+
* (`VALUE`) nên khách đã ngừng vẫn hiện khi cập nhật. Option hai dòng có avatar: tên · mã · điện thoại.
|
|
30
|
+
*/
|
|
31
|
+
@Component({
|
|
32
|
+
selector: 'customer-select',
|
|
33
|
+
standalone: true,
|
|
34
|
+
imports: [SdSelect, SdItemDefDefDirective, SdAvatar],
|
|
35
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36
|
+
template: `<sd-select
|
|
37
|
+
[label]="label()"
|
|
38
|
+
[name]="name()"
|
|
39
|
+
[form]="form()"
|
|
40
|
+
[(model)]="model"
|
|
41
|
+
[items]="search"
|
|
42
|
+
valueField="id"
|
|
43
|
+
displayField="name"
|
|
44
|
+
[required]="required()"
|
|
45
|
+
[autoId]="autoId()">
|
|
46
|
+
<ng-template sdItemDef let-item="item">
|
|
47
|
+
<div class="d-flex align-items-center gap-8">
|
|
48
|
+
<sd-avatar [src]="null" [name]="item.name" [size]="28" />
|
|
49
|
+
<div class="d-flex flex-column">
|
|
50
|
+
<span>{{ item.name }}</span>
|
|
51
|
+
<small class="text-secondary"
|
|
52
|
+
>{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</ng-template>
|
|
57
|
+
</sd-select>`,
|
|
58
|
+
})
|
|
59
|
+
export class CustomerSelectComponent {
|
|
60
|
+
readonly #customerService = inject(CustomerService);
|
|
61
|
+
readonly form = input<FormGroup>();
|
|
62
|
+
readonly name = input('customerId');
|
|
63
|
+
readonly label = input<string | undefined>('Khách hàng');
|
|
64
|
+
readonly required = input(false, { transform: booleanAttribute });
|
|
65
|
+
readonly autoId = input<string>();
|
|
66
|
+
readonly model = model<string | null | undefined>();
|
|
67
|
+
|
|
68
|
+
protected readonly search = async (req: SdSearchReq): Promise<CustomerDto[]> => {
|
|
69
|
+
if (req.type === 'VALUE') {
|
|
70
|
+
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);
|
|
71
|
+
return Promise.all(ids.map(id => firstValueFrom(this.#customerService.cachedDetail(id))));
|
|
72
|
+
}
|
|
73
|
+
const filters: Filter<CustomerDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
74
|
+
if (req.searchText) {
|
|
75
|
+
filters.push({
|
|
76
|
+
operator: 'OR',
|
|
77
|
+
data: [
|
|
78
|
+
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
79
|
+
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
80
|
+
{ field: 'phone', operator: 'CONTAIN', data: req.searchText },
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const res = await firstValueFrom(this.#customerService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
85
|
+
return res.items;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
<!-- @source features/product/components/product-select/product-select.component.ts -->
|
|
91
|
+
```ts
|
|
92
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';
|
|
93
|
+
import type { FormGroup } from '@angular/forms';
|
|
94
|
+
import { firstValueFrom } from 'rxjs';
|
|
95
|
+
import { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
96
|
+
import type { SdSearchReq } from '@sdcorejs/angular/forms/models';
|
|
97
|
+
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
98
|
+
import type { Filter } from '@sdcorejs/utils/models';
|
|
99
|
+
import { ProductService } from '../../services/product.service';
|
|
100
|
+
import type { ProductDto } from '../../services/product.model';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Chọn sản phẩm cho màn khác (dòng đơn hàng). Lựa chọn mới chỉ gồm sản phẩm đang hoạt động; giá trị đã chọn
|
|
104
|
+
* được tải theo ID (`VALUE`) nên sản phẩm đã ngừng vẫn hiển thị khi cập nhật. Option hai dòng: tên · mã · đơn vị.
|
|
105
|
+
*/
|
|
106
|
+
@Component({
|
|
107
|
+
selector: 'product-select',
|
|
108
|
+
standalone: true,
|
|
109
|
+
imports: [SdSelect, SdItemDefDefDirective],
|
|
110
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
111
|
+
template: `<sd-select
|
|
112
|
+
[label]="label()"
|
|
113
|
+
[name]="name()"
|
|
114
|
+
[form]="form()"
|
|
115
|
+
[(model)]="model"
|
|
116
|
+
[items]="search"
|
|
117
|
+
valueField="id"
|
|
118
|
+
displayField="name"
|
|
119
|
+
[required]="required()"
|
|
120
|
+
[autoId]="autoId()">
|
|
121
|
+
<ng-template sdItemDef let-item="item">
|
|
122
|
+
<div class="d-flex flex-column">
|
|
123
|
+
<span>{{ item.name }}</span>
|
|
124
|
+
<small class="text-secondary">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>
|
|
125
|
+
</div>
|
|
126
|
+
</ng-template>
|
|
127
|
+
</sd-select>`,
|
|
128
|
+
})
|
|
129
|
+
export class ProductSelectComponent {
|
|
130
|
+
readonly #productService = inject(ProductService);
|
|
131
|
+
readonly form = input<FormGroup>();
|
|
132
|
+
readonly name = input('productId');
|
|
133
|
+
readonly label = input<string | undefined>('Sản phẩm');
|
|
134
|
+
readonly required = input(false, { transform: booleanAttribute });
|
|
135
|
+
readonly autoId = input<string>();
|
|
136
|
+
readonly model = model<string | null | undefined>();
|
|
137
|
+
|
|
138
|
+
protected readonly search = async (req: SdSearchReq): Promise<ProductDto[]> => {
|
|
139
|
+
if (req.type === 'VALUE') {
|
|
140
|
+
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);
|
|
141
|
+
return Promise.all(ids.map(id => firstValueFrom(this.#productService.cachedDetail(id))));
|
|
142
|
+
}
|
|
143
|
+
const filters: Filter<ProductDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
144
|
+
if (req.searchText) {
|
|
145
|
+
filters.push({
|
|
146
|
+
operator: 'OR',
|
|
147
|
+
data: [
|
|
148
|
+
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
149
|
+
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const res = await firstValueFrom(this.#productService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
154
|
+
return res.items;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Enum: options và label thuộc model của feature:
|
|
160
|
+
|
|
161
|
+
<!-- @source features/product/components/product-status-select/product-status-select.component.ts -->
|
|
162
|
+
```ts
|
|
163
|
+
import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';
|
|
164
|
+
import type { FormGroup } from '@angular/forms';
|
|
165
|
+
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
166
|
+
import { PRODUCT_STATUS_OPTIONS, type ProductStatus } from '../../services/product.model';
|
|
167
|
+
|
|
168
|
+
/** Dropdown trạng thái sản phẩm: options và label thuộc feature, nơi dùng chỉ bind model/form. */
|
|
169
|
+
@Component({
|
|
170
|
+
selector: 'product-status-select',
|
|
171
|
+
standalone: true,
|
|
172
|
+
imports: [SdSelect],
|
|
173
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
174
|
+
template: `<sd-select
|
|
175
|
+
[label]="label()"
|
|
176
|
+
[name]="name()"
|
|
177
|
+
[form]="form()"
|
|
178
|
+
[(model)]="model"
|
|
179
|
+
[items]="options"
|
|
180
|
+
valueField="id"
|
|
181
|
+
displayField="name"
|
|
182
|
+
[required]="required()"
|
|
183
|
+
[clearable]="false" />`,
|
|
184
|
+
})
|
|
185
|
+
export class ProductStatusSelectComponent {
|
|
186
|
+
readonly form = input<FormGroup>();
|
|
187
|
+
readonly name = input('status');
|
|
188
|
+
readonly label = input('Trạng thái');
|
|
189
|
+
readonly required = input(true);
|
|
190
|
+
readonly model = model<ProductStatus | null | undefined>();
|
|
191
|
+
protected readonly options = PRODUCT_STATUS_OPTIONS;
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Quy tắc
|
|
196
|
+
|
|
197
|
+
- MUST đặt wrapper trong `components/` của feature sở hữu entity; màn dùng nó (đơn hàng) không tự gọi API của entity khác, không khai báo lại `items`, `valueField`, `displayField`.
|
|
198
|
+
- MUST tách lựa chọn mới (`SEARCH`, có điều kiện như đang hoạt động) với giá trị đã chọn (`VALUE`, tải theo ID kể cả bản ghi đã ngừng).
|
|
199
|
+
- MUST cấp service của entity ở route của màn dùng wrapper (`providers` của route đơn hàng có `CustomerService`, `ProductService`).
|
|
200
|
+
- MUST giữ option tối đa hai dòng: dòng đầu là tên, dòng hai là mã và thông tin phân biệt; trong bảng nhập liệu, giá trị đã chọn chỉ hiện gọn trong ô.
|
|
201
|
+
- SHOULD mở input của wrapper chỉ cho thứ nơi dùng cần (`form`, `name`, `model`, `required`, `label`).
|
|
202
|
+
|
|
203
|
+
## Lỗi hay gặp
|
|
204
|
+
|
|
205
|
+
- Lọc bản ghi đang hoạt động ở client cho cả giá trị đã chọn: đơn của khách đã ngừng mở ra ô trống.
|
|
206
|
+
- Gọi `detail(id)` cho từng option: dùng kết quả tìm kiếm cho danh sách, chỉ tải theo ID cho giá trị đã chọn.
|