@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,522 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, booleanAttribute, model, ChangeDetectionStrategy, Component, signal, computed, DestroyRef, effect, untracked } from '@angular/core';
|
|
3
|
+
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
4
|
+
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
5
|
+
import { firstValueFrom } from 'rxjs';
|
|
6
|
+
import { SdAvatar } from '@sdcorejs/angular/components/avatar';
|
|
7
|
+
import { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
8
|
+
import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs';
|
|
9
|
+
import { c as ORDER_PAYMENTS, d as ORDER_WAREHOUSES, a as ORDER_CHANNELS } from './sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs';
|
|
10
|
+
import { FormArray, FormGroup } from '@angular/forms';
|
|
11
|
+
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
12
|
+
import { SdInputNumber } from '@sdcorejs/angular/forms/input-number';
|
|
13
|
+
import { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';
|
|
14
|
+
import { P as ProductService } from './sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 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
|
|
18
|
+
* (`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.
|
|
19
|
+
*/
|
|
20
|
+
class CustomerSelectComponent {
|
|
21
|
+
#customerService = inject(CustomerService);
|
|
22
|
+
form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
|
|
23
|
+
name = input('customerId', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
24
|
+
label = input('Khách hàng', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
25
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
26
|
+
autoId = input(...(ngDevMode ? [undefined, { debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
27
|
+
model = model(...(ngDevMode ? [undefined, { debugName: "model" }] : /* istanbul ignore next */ []));
|
|
28
|
+
search = async (req) => {
|
|
29
|
+
if (req.type === 'VALUE') {
|
|
30
|
+
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id) => !!id);
|
|
31
|
+
return Promise.all(ids.map(id => firstValueFrom(this.#customerService.cachedDetail(id))));
|
|
32
|
+
}
|
|
33
|
+
const filters = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
34
|
+
if (req.searchText) {
|
|
35
|
+
filters.push({
|
|
36
|
+
operator: 'OR',
|
|
37
|
+
data: [
|
|
38
|
+
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
39
|
+
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
40
|
+
{ field: 'phone', operator: 'CONTAIN', data: req.searchText },
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const res = await firstValueFrom(this.#customerService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
45
|
+
return res.items;
|
|
46
|
+
};
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: CustomerSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: CustomerSelectComponent, isStandalone: true, selector: "customer-select", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange" }, ngImport: i0, template: `<sd-select
|
|
49
|
+
[label]="label()"
|
|
50
|
+
[name]="name()"
|
|
51
|
+
[form]="form()"
|
|
52
|
+
[(model)]="model"
|
|
53
|
+
[items]="search"
|
|
54
|
+
valueField="id"
|
|
55
|
+
displayField="name"
|
|
56
|
+
[required]="required()"
|
|
57
|
+
[autoId]="autoId()">
|
|
58
|
+
<ng-template sdItemDef let-item="item">
|
|
59
|
+
<div class="d-flex align-items-center gap-8">
|
|
60
|
+
<sd-avatar [src]="null" [name]="item.name" [size]="28" />
|
|
61
|
+
<div class="d-flex flex-column">
|
|
62
|
+
<span>{{ item.name }}</span>
|
|
63
|
+
<small class="text-secondary"
|
|
64
|
+
>{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small
|
|
65
|
+
>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</ng-template>
|
|
69
|
+
</sd-select>`, isInline: true, dependencies: [{ kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "directive", type: SdItemDefDefDirective, selector: "[sdItemDef]" }, { kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size", "name", "status", "statusLabel", "statusPulse", "tooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: CustomerSelectComponent, decorators: [{
|
|
72
|
+
type: Component,
|
|
73
|
+
args: [{
|
|
74
|
+
selector: 'customer-select',
|
|
75
|
+
standalone: true,
|
|
76
|
+
imports: [SdSelect, SdItemDefDefDirective, SdAvatar],
|
|
77
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
78
|
+
template: `<sd-select
|
|
79
|
+
[label]="label()"
|
|
80
|
+
[name]="name()"
|
|
81
|
+
[form]="form()"
|
|
82
|
+
[(model)]="model"
|
|
83
|
+
[items]="search"
|
|
84
|
+
valueField="id"
|
|
85
|
+
displayField="name"
|
|
86
|
+
[required]="required()"
|
|
87
|
+
[autoId]="autoId()">
|
|
88
|
+
<ng-template sdItemDef let-item="item">
|
|
89
|
+
<div class="d-flex align-items-center gap-8">
|
|
90
|
+
<sd-avatar [src]="null" [name]="item.name" [size]="28" />
|
|
91
|
+
<div class="d-flex flex-column">
|
|
92
|
+
<span>{{ item.name }}</span>
|
|
93
|
+
<small class="text-secondary"
|
|
94
|
+
>{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small
|
|
95
|
+
>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ng-template>
|
|
99
|
+
</sd-select>`,
|
|
100
|
+
}]
|
|
101
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }] } });
|
|
102
|
+
|
|
103
|
+
/** Giá trị form → request lưu. */
|
|
104
|
+
function orderSaveReq(form) {
|
|
105
|
+
const value = form.getRawValue();
|
|
106
|
+
const lines = (value.lines ?? []);
|
|
107
|
+
return {
|
|
108
|
+
customerId: value.customerId ?? '',
|
|
109
|
+
channel: value.channel ?? ORDER_CHANNELS[0],
|
|
110
|
+
warehouse: value.warehouse ?? ORDER_WAREHOUSES[0],
|
|
111
|
+
payment: value.payment ?? ORDER_PAYMENTS[0],
|
|
112
|
+
note: value.note || null,
|
|
113
|
+
lines: lines.map(line => ({
|
|
114
|
+
productId: line.productId ?? '',
|
|
115
|
+
quantity: Number(line.quantity ?? 0),
|
|
116
|
+
unitPrice: Number(line.unitPrice ?? 0),
|
|
117
|
+
})),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const options = (values) => values.map(value => ({ value }));
|
|
121
|
+
/** Nhóm "Thông tin chung" của đơn hàng. */
|
|
122
|
+
class GeneralInformationFormComponent {
|
|
123
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
124
|
+
seed = input.required(...(ngDevMode ? [{ debugName: "seed" }] : /* istanbul ignore next */ []));
|
|
125
|
+
channels = options(ORDER_CHANNELS);
|
|
126
|
+
warehouses = options(ORDER_WAREHOUSES);
|
|
127
|
+
payments = options(ORDER_PAYMENTS);
|
|
128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: GeneralInformationFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: GeneralInformationFormComponent, isStandalone: true, selector: "general-information-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, seed: { classPropertyName: "seed", publicName: "seed", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
130
|
+
<sd-section title="Thông tin chung">
|
|
131
|
+
<div class="row p-8">
|
|
132
|
+
<div class="col-12 col-md-6">
|
|
133
|
+
<customer-select autoId="order-customer" [form]="form()" [model]="seed().customerId || null" required />
|
|
134
|
+
</div>
|
|
135
|
+
<div class="col-12 col-md-6">
|
|
136
|
+
<sd-select
|
|
137
|
+
label="Kênh bán"
|
|
138
|
+
name="channel"
|
|
139
|
+
[form]="form()"
|
|
140
|
+
[model]="seed().channel"
|
|
141
|
+
[items]="channels"
|
|
142
|
+
valueField="value"
|
|
143
|
+
displayField="value"
|
|
144
|
+
[clearable]="false"
|
|
145
|
+
required />
|
|
146
|
+
</div>
|
|
147
|
+
<div class="col-12 col-md-6">
|
|
148
|
+
<sd-select
|
|
149
|
+
label="Kho xuất"
|
|
150
|
+
name="warehouse"
|
|
151
|
+
[form]="form()"
|
|
152
|
+
[model]="seed().warehouse"
|
|
153
|
+
[items]="warehouses"
|
|
154
|
+
valueField="value"
|
|
155
|
+
displayField="value"
|
|
156
|
+
[clearable]="false"
|
|
157
|
+
required />
|
|
158
|
+
</div>
|
|
159
|
+
<div class="col-12 col-md-6">
|
|
160
|
+
<sd-select
|
|
161
|
+
label="Thanh toán"
|
|
162
|
+
name="payment"
|
|
163
|
+
[form]="form()"
|
|
164
|
+
[model]="seed().payment"
|
|
165
|
+
[items]="payments"
|
|
166
|
+
valueField="value"
|
|
167
|
+
displayField="value"
|
|
168
|
+
[clearable]="false"
|
|
169
|
+
required />
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</sd-section>
|
|
173
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: CustomerSelectComponent, selector: "customer-select", inputs: ["form", "name", "label", "required", "autoId", "model"], outputs: ["modelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
174
|
+
}
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: GeneralInformationFormComponent, decorators: [{
|
|
176
|
+
type: Component,
|
|
177
|
+
args: [{
|
|
178
|
+
selector: 'general-information-form',
|
|
179
|
+
standalone: true,
|
|
180
|
+
imports: [SdSection, SdSelect, CustomerSelectComponent],
|
|
181
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
182
|
+
template: `
|
|
183
|
+
<sd-section title="Thông tin chung">
|
|
184
|
+
<div class="row p-8">
|
|
185
|
+
<div class="col-12 col-md-6">
|
|
186
|
+
<customer-select autoId="order-customer" [form]="form()" [model]="seed().customerId || null" required />
|
|
187
|
+
</div>
|
|
188
|
+
<div class="col-12 col-md-6">
|
|
189
|
+
<sd-select
|
|
190
|
+
label="Kênh bán"
|
|
191
|
+
name="channel"
|
|
192
|
+
[form]="form()"
|
|
193
|
+
[model]="seed().channel"
|
|
194
|
+
[items]="channels"
|
|
195
|
+
valueField="value"
|
|
196
|
+
displayField="value"
|
|
197
|
+
[clearable]="false"
|
|
198
|
+
required />
|
|
199
|
+
</div>
|
|
200
|
+
<div class="col-12 col-md-6">
|
|
201
|
+
<sd-select
|
|
202
|
+
label="Kho xuất"
|
|
203
|
+
name="warehouse"
|
|
204
|
+
[form]="form()"
|
|
205
|
+
[model]="seed().warehouse"
|
|
206
|
+
[items]="warehouses"
|
|
207
|
+
valueField="value"
|
|
208
|
+
displayField="value"
|
|
209
|
+
[clearable]="false"
|
|
210
|
+
required />
|
|
211
|
+
</div>
|
|
212
|
+
<div class="col-12 col-md-6">
|
|
213
|
+
<sd-select
|
|
214
|
+
label="Thanh toán"
|
|
215
|
+
name="payment"
|
|
216
|
+
[form]="form()"
|
|
217
|
+
[model]="seed().payment"
|
|
218
|
+
[items]="payments"
|
|
219
|
+
valueField="value"
|
|
220
|
+
displayField="value"
|
|
221
|
+
[clearable]="false"
|
|
222
|
+
required />
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</sd-section>
|
|
226
|
+
`,
|
|
227
|
+
}]
|
|
228
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], seed: [{ type: i0.Input, args: [{ isSignal: true, alias: "seed", required: true }] }] } });
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* 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
|
|
232
|
+
* đượ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ị.
|
|
233
|
+
*/
|
|
234
|
+
class ProductSelectComponent {
|
|
235
|
+
#productService = inject(ProductService);
|
|
236
|
+
form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
|
|
237
|
+
name = input('productId', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
238
|
+
label = input('Sản phẩm', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
239
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
240
|
+
autoId = input(...(ngDevMode ? [undefined, { debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
241
|
+
model = model(...(ngDevMode ? [undefined, { debugName: "model" }] : /* istanbul ignore next */ []));
|
|
242
|
+
search = async (req) => {
|
|
243
|
+
if (req.type === 'VALUE') {
|
|
244
|
+
const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id) => !!id);
|
|
245
|
+
return Promise.all(ids.map(id => firstValueFrom(this.#productService.cachedDetail(id))));
|
|
246
|
+
}
|
|
247
|
+
const filters = [{ field: 'status', operator: 'EQUAL', data: 'active' }];
|
|
248
|
+
if (req.searchText) {
|
|
249
|
+
filters.push({
|
|
250
|
+
operator: 'OR',
|
|
251
|
+
data: [
|
|
252
|
+
{ field: 'name', operator: 'CONTAIN', data: req.searchText },
|
|
253
|
+
{ field: 'code', operator: 'CONTAIN', data: req.searchText },
|
|
254
|
+
],
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
const res = await firstValueFrom(this.#productService.list({ pageNumber: 0, pageSize: 20, filters }));
|
|
258
|
+
return res.items;
|
|
259
|
+
};
|
|
260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ProductSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: ProductSelectComponent, isStandalone: true, selector: "product-select", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange" }, ngImport: i0, template: `<sd-select
|
|
262
|
+
[label]="label()"
|
|
263
|
+
[name]="name()"
|
|
264
|
+
[form]="form()"
|
|
265
|
+
[(model)]="model"
|
|
266
|
+
[items]="search"
|
|
267
|
+
valueField="id"
|
|
268
|
+
displayField="name"
|
|
269
|
+
[required]="required()"
|
|
270
|
+
[autoId]="autoId()">
|
|
271
|
+
<ng-template sdItemDef let-item="item">
|
|
272
|
+
<div class="d-flex flex-column">
|
|
273
|
+
<span>{{ item.name }}</span>
|
|
274
|
+
<small class="text-secondary">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>
|
|
275
|
+
</div>
|
|
276
|
+
</ng-template>
|
|
277
|
+
</sd-select>`, isInline: true, dependencies: [{ kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "directive", type: SdItemDefDefDirective, selector: "[sdItemDef]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
278
|
+
}
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ProductSelectComponent, decorators: [{
|
|
280
|
+
type: Component,
|
|
281
|
+
args: [{
|
|
282
|
+
selector: 'product-select',
|
|
283
|
+
standalone: true,
|
|
284
|
+
imports: [SdSelect, SdItemDefDefDirective],
|
|
285
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
286
|
+
template: `<sd-select
|
|
287
|
+
[label]="label()"
|
|
288
|
+
[name]="name()"
|
|
289
|
+
[form]="form()"
|
|
290
|
+
[(model)]="model"
|
|
291
|
+
[items]="search"
|
|
292
|
+
valueField="id"
|
|
293
|
+
displayField="name"
|
|
294
|
+
[required]="required()"
|
|
295
|
+
[autoId]="autoId()">
|
|
296
|
+
<ng-template sdItemDef let-item="item">
|
|
297
|
+
<div class="d-flex flex-column">
|
|
298
|
+
<span>{{ item.name }}</span>
|
|
299
|
+
<small class="text-secondary">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>
|
|
300
|
+
</div>
|
|
301
|
+
</ng-template>
|
|
302
|
+
</sd-select>`,
|
|
303
|
+
}]
|
|
304
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }] } });
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Bảng dòng hàng nhập trực tiếp: mỗi dòng là một FormGroup trong `form.lines` (FormArray), các field Core tự đăng
|
|
308
|
+
* ký vào dòng. Chọn sản phẩm điền đơn giá; thành tiền và tổng tự tính. Lỗi API theo dòng (`lines.<i>.<field>`) hiện
|
|
309
|
+
* ngay trên ô của dòng đó.
|
|
310
|
+
*/
|
|
311
|
+
class LinesFormComponent {
|
|
312
|
+
#productService = inject(ProductService);
|
|
313
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
314
|
+
/** Dòng ban đầu (cập nhật) hoặc một dòng trống (tạo mới). */
|
|
315
|
+
seed = input.required(...(ngDevMode ? [{ debugName: "seed" }] : /* istanbul ignore next */ []));
|
|
316
|
+
/** Lỗi theo field do API trả về, khoá dạng `lines.<index>.<field>`. */
|
|
317
|
+
errors = input({}, ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
318
|
+
#array = new FormArray([]);
|
|
319
|
+
#version = signal(0, ...(ngDevMode ? [{ debugName: "#version" }] : /* istanbul ignore next */ []));
|
|
320
|
+
#nextKey = 0;
|
|
321
|
+
rows = signal([], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
322
|
+
amounts = computed(() => {
|
|
323
|
+
this.#version();
|
|
324
|
+
return this.rows().map(row => Number(row.group.get('quantity')?.value ?? row.seed.quantity) * Number(row.group.get('unitPrice')?.value ?? row.seed.unitPrice));
|
|
325
|
+
}, ...(ngDevMode ? [{ debugName: "amounts" }] : /* istanbul ignore next */ []));
|
|
326
|
+
total = computed(() => this.amounts().reduce((sum, amount) => sum + amount, 0), ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
327
|
+
constructor() {
|
|
328
|
+
const subscription = this.#array.valueChanges.subscribe(() => this.#version.update(version => version + 1));
|
|
329
|
+
inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
|
|
330
|
+
// why: trang cập nhật được dùng lại khi chỉ đổi `:id`; dòng hàng phải theo đơn mới, không giữ dòng của đơn trước.
|
|
331
|
+
effect(() => {
|
|
332
|
+
const seed = this.seed();
|
|
333
|
+
untracked(() => this.#load(seed));
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
add() {
|
|
337
|
+
this.#push({ productId: '', quantity: 1, unitPrice: 0 });
|
|
338
|
+
}
|
|
339
|
+
remove(row) {
|
|
340
|
+
const index = this.rows().indexOf(row);
|
|
341
|
+
if (index < 0)
|
|
342
|
+
return;
|
|
343
|
+
// why: đánh dấu đã sửa TRƯỚC khi gỡ, để dirty theo giá trị so với danh sách dòng lúc trước.
|
|
344
|
+
this.#array.markAsDirty();
|
|
345
|
+
this.#array.removeAt(index);
|
|
346
|
+
this.rows.update(rows => rows.filter(item => item !== row));
|
|
347
|
+
}
|
|
348
|
+
/** Chọn sản phẩm thì điền đơn giá hiện hành của sản phẩm. */
|
|
349
|
+
async pick(row, productId) {
|
|
350
|
+
if (!productId)
|
|
351
|
+
return;
|
|
352
|
+
const product = await firstValueFrom(this.#productService.cachedDetail(productId));
|
|
353
|
+
row.group.get('unitPrice')?.setValue(product.price);
|
|
354
|
+
}
|
|
355
|
+
#load(seed) {
|
|
356
|
+
this.#array.clear();
|
|
357
|
+
this.rows.set([]);
|
|
358
|
+
(seed.length ? seed : [{ productId: '', quantity: 1, unitPrice: 0 }]).forEach(line => this.#push(line));
|
|
359
|
+
if (this.form().get('lines') !== this.#array)
|
|
360
|
+
this.form().setControl('lines', this.#array);
|
|
361
|
+
}
|
|
362
|
+
#push(seed) {
|
|
363
|
+
const group = new FormGroup({});
|
|
364
|
+
this.#array.push(group);
|
|
365
|
+
this.rows.update(rows => [...rows, { key: this.#nextKey++, group, seed }]);
|
|
366
|
+
}
|
|
367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LinesFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LinesFormComponent, isStandalone: true, selector: "lines-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, seed: { classPropertyName: "seed", publicName: "seed", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
369
|
+
<sd-section title="Dòng hàng">
|
|
370
|
+
<div sdHeaderRight>
|
|
371
|
+
<sd-button title="Thêm dòng" prefixIcon="add" type="text" autoId="order-line-add" (click)="add()" />
|
|
372
|
+
</div>
|
|
373
|
+
<table class="lines">
|
|
374
|
+
<thead>
|
|
375
|
+
<tr>
|
|
376
|
+
<th scope="col">Sản phẩm</th>
|
|
377
|
+
<th scope="col" class="lines__number">Số lượng</th>
|
|
378
|
+
<th scope="col" class="lines__number">Đơn giá (₫)</th>
|
|
379
|
+
<th scope="col" class="lines__number">Thành tiền (₫)</th>
|
|
380
|
+
<th scope="col"><span class="sd-visually-hidden">Xoá dòng</span></th>
|
|
381
|
+
</tr>
|
|
382
|
+
</thead>
|
|
383
|
+
<tbody>
|
|
384
|
+
@for (row of rows(); track row.key; let index = $index) {
|
|
385
|
+
<tr [attr.data-line]="index">
|
|
386
|
+
<td>
|
|
387
|
+
<product-select
|
|
388
|
+
[label]="undefined"
|
|
389
|
+
[form]="row.group"
|
|
390
|
+
[model]="row.seed.productId || null"
|
|
391
|
+
[autoId]="'order-line-' + index + '-product'"
|
|
392
|
+
(modelChange)="pick(row, $event)"
|
|
393
|
+
required />
|
|
394
|
+
@if (errors()['lines.' + index + '.productId']; as error) {
|
|
395
|
+
<span class="lines__error" role="alert">{{ error }}</span>
|
|
396
|
+
}
|
|
397
|
+
</td>
|
|
398
|
+
<td class="lines__number">
|
|
399
|
+
<sd-input-number
|
|
400
|
+
name="quantity"
|
|
401
|
+
type="positive"
|
|
402
|
+
[precision]="0"
|
|
403
|
+
[form]="row.group"
|
|
404
|
+
[model]="row.seed.quantity"
|
|
405
|
+
[inlineError]="errors()['lines.' + index + '.quantity']"
|
|
406
|
+
[autoId]="'order-line-' + index + '-quantity'"
|
|
407
|
+
required />
|
|
408
|
+
</td>
|
|
409
|
+
<td class="lines__number">
|
|
410
|
+
<sd-input-number
|
|
411
|
+
name="unitPrice"
|
|
412
|
+
type="positive"
|
|
413
|
+
[precision]="0"
|
|
414
|
+
[form]="row.group"
|
|
415
|
+
[model]="row.seed.unitPrice"
|
|
416
|
+
required />
|
|
417
|
+
</td>
|
|
418
|
+
<td class="lines__number">{{ amounts()[index] | sdFormatNumber: 0 }}</td>
|
|
419
|
+
<td>
|
|
420
|
+
<sd-button
|
|
421
|
+
prefixIcon="delete"
|
|
422
|
+
type="text"
|
|
423
|
+
color="error"
|
|
424
|
+
tooltip="Xoá dòng"
|
|
425
|
+
[autoId]="'order-line-' + index + '-remove'"
|
|
426
|
+
[disabled]="rows().length === 1"
|
|
427
|
+
(click)="remove(row)" />
|
|
428
|
+
</td>
|
|
429
|
+
</tr>
|
|
430
|
+
}
|
|
431
|
+
</tbody>
|
|
432
|
+
<tfoot>
|
|
433
|
+
<tr>
|
|
434
|
+
<th scope="row" colspan="3" class="lines__number">Tổng tiền (₫)</th>
|
|
435
|
+
<td class="lines__number lines__total" data-autoid="order-total">{{ total() | sdFormatNumber: 0 }}</td>
|
|
436
|
+
<td></td>
|
|
437
|
+
</tr>
|
|
438
|
+
</tfoot>
|
|
439
|
+
</table>
|
|
440
|
+
</sd-section>
|
|
441
|
+
`, isInline: true, styles: [".lines{width:100%;border-collapse:collapse}.lines th,.lines td{padding:4px 8px;text-align:left;vertical-align:top}.lines thead th{color:var(--sd-text-secondary);font-size:12px;font-weight:500;border-bottom:1px solid var(--sd-border)}.lines td:first-child{min-width:240px}.lines__number{width:150px;text-align:right!important}.lines td.lines__number{padding-top:14px}.lines tfoot th,.lines tfoot td{padding-top:12px;border-top:1px solid var(--sd-border)}.lines__total{font-weight:500}.lines__error{color:var(--sd-error, currentColor);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: ProductSelectComponent, selector: "product-select", inputs: ["form", "name", "label", "required", "autoId", "model"], outputs: ["modelChange"] }, { kind: "pipe", type: SdFormatNumberPipe, name: "sdFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LinesFormComponent, decorators: [{
|
|
444
|
+
type: Component,
|
|
445
|
+
args: [{ selector: 'lines-form', standalone: true, imports: [SdSection, SdButton, SdInputNumber, SdFormatNumberPipe, ProductSelectComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
446
|
+
<sd-section title="Dòng hàng">
|
|
447
|
+
<div sdHeaderRight>
|
|
448
|
+
<sd-button title="Thêm dòng" prefixIcon="add" type="text" autoId="order-line-add" (click)="add()" />
|
|
449
|
+
</div>
|
|
450
|
+
<table class="lines">
|
|
451
|
+
<thead>
|
|
452
|
+
<tr>
|
|
453
|
+
<th scope="col">Sản phẩm</th>
|
|
454
|
+
<th scope="col" class="lines__number">Số lượng</th>
|
|
455
|
+
<th scope="col" class="lines__number">Đơn giá (₫)</th>
|
|
456
|
+
<th scope="col" class="lines__number">Thành tiền (₫)</th>
|
|
457
|
+
<th scope="col"><span class="sd-visually-hidden">Xoá dòng</span></th>
|
|
458
|
+
</tr>
|
|
459
|
+
</thead>
|
|
460
|
+
<tbody>
|
|
461
|
+
@for (row of rows(); track row.key; let index = $index) {
|
|
462
|
+
<tr [attr.data-line]="index">
|
|
463
|
+
<td>
|
|
464
|
+
<product-select
|
|
465
|
+
[label]="undefined"
|
|
466
|
+
[form]="row.group"
|
|
467
|
+
[model]="row.seed.productId || null"
|
|
468
|
+
[autoId]="'order-line-' + index + '-product'"
|
|
469
|
+
(modelChange)="pick(row, $event)"
|
|
470
|
+
required />
|
|
471
|
+
@if (errors()['lines.' + index + '.productId']; as error) {
|
|
472
|
+
<span class="lines__error" role="alert">{{ error }}</span>
|
|
473
|
+
}
|
|
474
|
+
</td>
|
|
475
|
+
<td class="lines__number">
|
|
476
|
+
<sd-input-number
|
|
477
|
+
name="quantity"
|
|
478
|
+
type="positive"
|
|
479
|
+
[precision]="0"
|
|
480
|
+
[form]="row.group"
|
|
481
|
+
[model]="row.seed.quantity"
|
|
482
|
+
[inlineError]="errors()['lines.' + index + '.quantity']"
|
|
483
|
+
[autoId]="'order-line-' + index + '-quantity'"
|
|
484
|
+
required />
|
|
485
|
+
</td>
|
|
486
|
+
<td class="lines__number">
|
|
487
|
+
<sd-input-number
|
|
488
|
+
name="unitPrice"
|
|
489
|
+
type="positive"
|
|
490
|
+
[precision]="0"
|
|
491
|
+
[form]="row.group"
|
|
492
|
+
[model]="row.seed.unitPrice"
|
|
493
|
+
required />
|
|
494
|
+
</td>
|
|
495
|
+
<td class="lines__number">{{ amounts()[index] | sdFormatNumber: 0 }}</td>
|
|
496
|
+
<td>
|
|
497
|
+
<sd-button
|
|
498
|
+
prefixIcon="delete"
|
|
499
|
+
type="text"
|
|
500
|
+
color="error"
|
|
501
|
+
tooltip="Xoá dòng"
|
|
502
|
+
[autoId]="'order-line-' + index + '-remove'"
|
|
503
|
+
[disabled]="rows().length === 1"
|
|
504
|
+
(click)="remove(row)" />
|
|
505
|
+
</td>
|
|
506
|
+
</tr>
|
|
507
|
+
}
|
|
508
|
+
</tbody>
|
|
509
|
+
<tfoot>
|
|
510
|
+
<tr>
|
|
511
|
+
<th scope="row" colspan="3" class="lines__number">Tổng tiền (₫)</th>
|
|
512
|
+
<td class="lines__number lines__total" data-autoid="order-total">{{ total() | sdFormatNumber: 0 }}</td>
|
|
513
|
+
<td></td>
|
|
514
|
+
</tr>
|
|
515
|
+
</tfoot>
|
|
516
|
+
</table>
|
|
517
|
+
</sd-section>
|
|
518
|
+
`, styles: [".lines{width:100%;border-collapse:collapse}.lines th,.lines td{padding:4px 8px;text-align:left;vertical-align:top}.lines thead th{color:var(--sd-text-secondary);font-size:12px;font-weight:500;border-bottom:1px solid var(--sd-border)}.lines td:first-child{min-width:240px}.lines__number{width:150px;text-align:right!important}.lines td.lines__number{padding-top:14px}.lines tfoot th,.lines tfoot td{padding-top:12px;border-top:1px solid var(--sd-border)}.lines__total{font-weight:500}.lines__error{color:var(--sd-error, currentColor);font-size:12px}\n"] }]
|
|
519
|
+
}], ctorParameters: () => [], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], seed: [{ type: i0.Input, args: [{ isSignal: true, alias: "seed", required: true }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
|
|
520
|
+
|
|
521
|
+
export { GeneralInformationFormComponent as G, LinesFormComponent as L, orderSaveReq as o };
|
|
522
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/customer-select/customer-select.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/product/components/product-select/product-select.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/lines-form/lines-form.component.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';\nimport type { FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdAvatar } from '@sdcorejs/angular/components/avatar';\nimport { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';\nimport type { SdSearchReq } from '@sdcorejs/angular/forms/models';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport type { Filter } from '@sdcorejs/utils/models';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerDto } from '../../services/customer.model';\n\n/**\n * 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\n * (`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.\n */\n@Component({\n selector: 'customer-select',\n standalone: true,\n imports: [SdSelect, SdItemDefDefDirective, SdAvatar],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<sd-select\n [label]=\"label()\"\n [name]=\"name()\"\n [form]=\"form()\"\n [(model)]=\"model\"\n [items]=\"search\"\n valueField=\"id\"\n displayField=\"name\"\n [required]=\"required()\"\n [autoId]=\"autoId()\">\n <ng-template sdItemDef let-item=\"item\">\n <div class=\"d-flex align-items-center gap-8\">\n <sd-avatar [src]=\"null\" [name]=\"item.name\" [size]=\"28\" />\n <div class=\"d-flex flex-column\">\n <span>{{ item.name }}</span>\n <small class=\"text-secondary\"\n >{{ item.code }} · {{ item.phone }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small\n >\n </div>\n </div>\n </ng-template>\n </sd-select>`,\n})\nexport class CustomerSelectComponent {\n readonly #customerService = inject(CustomerService);\n readonly form = input<FormGroup>();\n readonly name = input('customerId');\n readonly label = input<string | undefined>('Khách hàng');\n readonly required = input(false, { transform: booleanAttribute });\n readonly autoId = input<string>();\n readonly model = model<string | null | undefined>();\n\n protected readonly search = async (req: SdSearchReq): Promise<CustomerDto[]> => {\n if (req.type === 'VALUE') {\n const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);\n return Promise.all(ids.map(id => firstValueFrom(this.#customerService.cachedDetail(id))));\n }\n const filters: Filter<CustomerDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];\n if (req.searchText) {\n filters.push({\n operator: 'OR',\n data: [\n { field: 'name', operator: 'CONTAIN', data: req.searchText },\n { field: 'code', operator: 'CONTAIN', data: req.searchText },\n { field: 'phone', operator: 'CONTAIN', data: req.searchText },\n ],\n });\n }\n const res = await firstValueFrom(this.#customerService.list({ pageNumber: 0, pageSize: 20, filters }));\n return res.items;\n };\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport type { FormArray, FormControl, FormGroup } from '@angular/forms';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport { CustomerSelectComponent } from '../../../customer/components/customer-select/customer-select.component';\nimport { ORDER_CHANNELS, ORDER_PAYMENTS, ORDER_WAREHOUSES, type OrderLineDto, type OrderSaveReq } from '../../services/order.model';\n\n/** Form đơn hàng: field của đầu chứng từ do Core tự đăng ký; `lines` là FormArray do `lines-form` quản lý. */\nexport type OrderForm = FormGroup<{\n customerId?: FormControl<string | null>;\n channel?: FormControl<string>;\n warehouse?: FormControl<string>;\n payment?: FormControl<string>;\n note?: FormControl<string | null>;\n lines?: FormArray<FormGroup>;\n}>;\n\n/** Giá trị form → request lưu. */\nexport function orderSaveReq(form: OrderForm): OrderSaveReq {\n const value = form.getRawValue();\n const lines = (value.lines ?? []) as Partial<OrderLineDto>[];\n return {\n customerId: value.customerId ?? '',\n channel: value.channel ?? ORDER_CHANNELS[0],\n warehouse: value.warehouse ?? ORDER_WAREHOUSES[0],\n payment: value.payment ?? ORDER_PAYMENTS[0],\n note: value.note || null,\n lines: lines.map(line => ({\n productId: line.productId ?? '',\n quantity: Number(line.quantity ?? 0),\n unitPrice: Number(line.unitPrice ?? 0),\n })),\n };\n}\n\nconst options = (values: readonly string[]) => values.map(value => ({ value }));\n\n/** Nhóm \"Thông tin chung\" của đơn hàng. */\n@Component({\n selector: 'general-information-form',\n standalone: true,\n imports: [SdSection, SdSelect, CustomerSelectComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Thông tin chung\">\n <div class=\"row p-8\">\n <div class=\"col-12 col-md-6\">\n <customer-select autoId=\"order-customer\" [form]=\"form()\" [model]=\"seed().customerId || null\" required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Kênh bán\"\n name=\"channel\"\n [form]=\"form()\"\n [model]=\"seed().channel\"\n [items]=\"channels\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Kho xuất\"\n name=\"warehouse\"\n [form]=\"form()\"\n [model]=\"seed().warehouse\"\n [items]=\"warehouses\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n <div class=\"col-12 col-md-6\">\n <sd-select\n label=\"Thanh toán\"\n name=\"payment\"\n [form]=\"form()\"\n [model]=\"seed().payment\"\n [items]=\"payments\"\n valueField=\"value\"\n displayField=\"value\"\n [clearable]=\"false\"\n required />\n </div>\n </div>\n </sd-section>\n `,\n})\nexport class GeneralInformationFormComponent {\n readonly form = input.required<OrderForm>();\n readonly seed = input.required<OrderSaveReq>();\n protected readonly channels = options(ORDER_CHANNELS);\n protected readonly warehouses = options(ORDER_WAREHOUSES);\n protected readonly payments = options(ORDER_PAYMENTS);\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, inject, input, model } from '@angular/core';\nimport type { FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdItemDefDefDirective } from '@sdcorejs/angular/forms/directives';\nimport type { SdSearchReq } from '@sdcorejs/angular/forms/models';\nimport { SdSelect } from '@sdcorejs/angular/forms/select';\nimport type { Filter } from '@sdcorejs/utils/models';\nimport { ProductService } from '../../services/product.service';\nimport type { ProductDto } from '../../services/product.model';\n\n/**\n * 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\n * đượ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ị.\n */\n@Component({\n selector: 'product-select',\n standalone: true,\n imports: [SdSelect, SdItemDefDefDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<sd-select\n [label]=\"label()\"\n [name]=\"name()\"\n [form]=\"form()\"\n [(model)]=\"model\"\n [items]=\"search\"\n valueField=\"id\"\n displayField=\"name\"\n [required]=\"required()\"\n [autoId]=\"autoId()\">\n <ng-template sdItemDef let-item=\"item\">\n <div class=\"d-flex flex-column\">\n <span>{{ item.name }}</span>\n <small class=\"text-secondary\">{{ item.code }} · {{ item.unit }}{{ item.status === 'inactive' ? ' · Ngừng hoạt động' : '' }}</small>\n </div>\n </ng-template>\n </sd-select>`,\n})\nexport class ProductSelectComponent {\n readonly #productService = inject(ProductService);\n readonly form = input<FormGroup>();\n readonly name = input('productId');\n readonly label = input<string | undefined>('Sản phẩm');\n readonly required = input(false, { transform: booleanAttribute });\n readonly autoId = input<string>();\n readonly model = model<string | null | undefined>();\n\n protected readonly search = async (req: SdSearchReq): Promise<ProductDto[]> => {\n if (req.type === 'VALUE') {\n const ids = (Array.isArray(req.value) ? req.value : [req.value]).filter((id): id is string => !!id);\n return Promise.all(ids.map(id => firstValueFrom(this.#productService.cachedDetail(id))));\n }\n const filters: Filter<ProductDto>[] = [{ field: 'status', operator: 'EQUAL', data: 'active' }];\n if (req.searchText) {\n filters.push({\n operator: 'OR',\n data: [\n { field: 'name', operator: 'CONTAIN', data: req.searchText },\n { field: 'code', operator: 'CONTAIN', data: req.searchText },\n ],\n });\n }\n const res = await firstValueFrom(this.#productService.list({ pageNumber: 0, pageSize: 20, filters }));\n return res.items;\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, DestroyRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { FormArray, FormGroup } from '@angular/forms';\nimport { firstValueFrom } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdInputNumber } from '@sdcorejs/angular/forms/input-number';\nimport { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';\nimport { ProductSelectComponent } from '../../../product/components/product-select/product-select.component';\nimport { ProductService } from '../../../product/services/product.service';\nimport type { OrderLineDto } from '../../services/order.model';\nimport type { OrderForm } from '../general-information-form/general-information-form.component';\n\ninterface LineRow {\n readonly key: number;\n readonly group: FormGroup;\n readonly seed: OrderLineDto;\n}\n\n/**\n * Bảng dòng hàng nhập trực tiếp: mỗi dòng là một FormGroup trong `form.lines` (FormArray), các field Core tự đăng\n * ký vào dòng. Chọn sản phẩm điền đơn giá; thành tiền và tổng tự tính. Lỗi API theo dòng (`lines.<i>.<field>`) hiện\n * ngay trên ô của dòng đó.\n */\n@Component({\n selector: 'lines-form',\n standalone: true,\n imports: [SdSection, SdButton, SdInputNumber, SdFormatNumberPipe, ProductSelectComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Dòng hàng\">\n <div sdHeaderRight>\n <sd-button title=\"Thêm dòng\" prefixIcon=\"add\" type=\"text\" autoId=\"order-line-add\" (click)=\"add()\" />\n </div>\n <table class=\"lines\">\n <thead>\n <tr>\n <th scope=\"col\">Sản phẩm</th>\n <th scope=\"col\" class=\"lines__number\">Số lượng</th>\n <th scope=\"col\" class=\"lines__number\">Đơn giá (₫)</th>\n <th scope=\"col\" class=\"lines__number\">Thành tiền (₫)</th>\n <th scope=\"col\"><span class=\"sd-visually-hidden\">Xoá dòng</span></th>\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track row.key; let index = $index) {\n <tr [attr.data-line]=\"index\">\n <td>\n <product-select\n [label]=\"undefined\"\n [form]=\"row.group\"\n [model]=\"row.seed.productId || null\"\n [autoId]=\"'order-line-' + index + '-product'\"\n (modelChange)=\"pick(row, $event)\"\n required />\n @if (errors()['lines.' + index + '.productId']; as error) {\n <span class=\"lines__error\" role=\"alert\">{{ error }}</span>\n }\n </td>\n <td class=\"lines__number\">\n <sd-input-number\n name=\"quantity\"\n type=\"positive\"\n [precision]=\"0\"\n [form]=\"row.group\"\n [model]=\"row.seed.quantity\"\n [inlineError]=\"errors()['lines.' + index + '.quantity']\"\n [autoId]=\"'order-line-' + index + '-quantity'\"\n required />\n </td>\n <td class=\"lines__number\">\n <sd-input-number\n name=\"unitPrice\"\n type=\"positive\"\n [precision]=\"0\"\n [form]=\"row.group\"\n [model]=\"row.seed.unitPrice\"\n required />\n </td>\n <td class=\"lines__number\">{{ amounts()[index] | sdFormatNumber: 0 }}</td>\n <td>\n <sd-button\n prefixIcon=\"delete\"\n type=\"text\"\n color=\"error\"\n tooltip=\"Xoá dòng\"\n [autoId]=\"'order-line-' + index + '-remove'\"\n [disabled]=\"rows().length === 1\"\n (click)=\"remove(row)\" />\n </td>\n </tr>\n }\n </tbody>\n <tfoot>\n <tr>\n <th scope=\"row\" colspan=\"3\" class=\"lines__number\">Tổng tiền (₫)</th>\n <td class=\"lines__number lines__total\" data-autoid=\"order-total\">{{ total() | sdFormatNumber: 0 }}</td>\n <td></td>\n </tr>\n </tfoot>\n </table>\n </sd-section>\n `,\n styles: `\n .lines {\n width: 100%;\n border-collapse: collapse;\n }\n .lines th,\n .lines td {\n padding: 4px 8px;\n text-align: left;\n vertical-align: top;\n }\n .lines thead th {\n color: var(--sd-text-secondary);\n font-size: 12px;\n font-weight: 500;\n border-bottom: 1px solid var(--sd-border);\n }\n .lines td:first-child {\n min-width: 240px;\n }\n .lines__number {\n width: 150px;\n text-align: right !important;\n }\n .lines td.lines__number {\n padding-top: 14px;\n }\n .lines tfoot th,\n .lines tfoot td {\n padding-top: 12px;\n border-top: 1px solid var(--sd-border);\n }\n .lines__total {\n font-weight: 500;\n }\n .lines__error {\n color: var(--sd-error, currentColor);\n font-size: 12px;\n }\n `,\n})\nexport class LinesFormComponent {\n readonly #productService = inject(ProductService);\n readonly form = input.required<OrderForm>();\n /** Dòng ban đầu (cập nhật) hoặc một dòng trống (tạo mới). */\n readonly seed = input.required<readonly OrderLineDto[]>();\n /** Lỗi theo field do API trả về, khoá dạng `lines.<index>.<field>`. */\n readonly errors = input<Readonly<Record<string, string>>>({});\n readonly #array = new FormArray<FormGroup>([]);\n readonly #version = signal(0);\n #nextKey = 0;\n protected readonly rows = signal<readonly LineRow[]>([]);\n protected readonly amounts = computed(() => {\n this.#version();\n return this.rows().map(\n row => Number(row.group.get('quantity')?.value ?? row.seed.quantity) * Number(row.group.get('unitPrice')?.value ?? row.seed.unitPrice)\n );\n });\n protected readonly total = computed(() => this.amounts().reduce((sum, amount) => sum + amount, 0));\n\n constructor() {\n const subscription = this.#array.valueChanges.subscribe(() => this.#version.update(version => version + 1));\n inject(DestroyRef).onDestroy(() => subscription.unsubscribe());\n // why: trang cập nhật được dùng lại khi chỉ đổi `:id`; dòng hàng phải theo đơn mới, không giữ dòng của đơn trước.\n effect(() => {\n const seed = this.seed();\n untracked(() => this.#load(seed));\n });\n }\n\n protected add(): void {\n this.#push({ productId: '', quantity: 1, unitPrice: 0 });\n }\n\n protected remove(row: LineRow): void {\n const index = this.rows().indexOf(row);\n if (index < 0) return;\n // why: đánh dấu đã sửa TRƯỚC khi gỡ, để dirty theo giá trị so với danh sách dòng lúc trước.\n this.#array.markAsDirty();\n this.#array.removeAt(index);\n this.rows.update(rows => rows.filter(item => item !== row));\n }\n\n /** Chọn sản phẩm thì điền đơn giá hiện hành của sản phẩm. */\n protected async pick(row: LineRow, productId: string | null | undefined): Promise<void> {\n if (!productId) return;\n const product = await firstValueFrom(this.#productService.cachedDetail(productId));\n row.group.get('unitPrice')?.setValue(product.price);\n }\n\n #load(seed: readonly OrderLineDto[]): void {\n this.#array.clear();\n this.rows.set([]);\n (seed.length ? seed : [{ productId: '', quantity: 1, unitPrice: 0 }]).forEach(line => this.#push(line));\n if (this.form().get('lines') !== this.#array) this.form().setControl('lines', this.#array);\n }\n\n #push(seed: OrderLineDto): void {\n const group = new FormGroup({});\n this.#array.push(group);\n this.rows.update(rows => [...rows, { key: this.#nextKey++, group, seed }]);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA;;;AAGG;MA6BU,uBAAuB,CAAA;AACzB,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;IAC1C,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAa;AACzB,IAAA,IAAI,GAAG,KAAK,CAAC,YAAY,2EAAC;AAC1B,IAAA,KAAK,GAAG,KAAK,CAAqB,YAAY,4EAAC;IAC/C,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IACxD,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACxB,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA6B;AAEhC,IAAA,MAAM,GAAG,OAAO,GAAgB,KAA4B;AAC7E,QAAA,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;AACxB,YAAA,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAmB,CAAC,CAAC,EAAE,CAAC;YACnG,OA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