@sdcorejs/angular 20.3.2 → 20.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/THEME.md +58 -6
- package/assets/scss/core/form.scss +291 -3
- package/assets/scss/themes/_component-tokens.scss +35 -6
- package/components/badge/index.d.ts +19 -1
- package/components/section/index.d.ts +13 -1
- package/components/splitter/index.d.ts +1 -1
- package/components/tab-router/index.d.ts +47 -5
- package/components/table/index.d.ts +127 -13
- package/components/upload-file/index.d.ts +181 -21
- package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +393 -78
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +444 -16
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +422 -122
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +17 -2
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +210 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +266 -11
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs +131 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs +130 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-s7ZXoakT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BxfQux1Q.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DlYVJqHo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CbYMo3D1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs +90 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-awjgX7ph.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs +467 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-c__NdSt3.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-Bjvq6wJz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs +61 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-FwmYVkag.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs +87 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs +232 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-pqT7lnS6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs +70 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DZXPZuM4.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs +522 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BjMOON6K.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Bf9QWXBp.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CuDjsIzi.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-E8rkFCkK.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DgmM-wTI.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs +297 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CGeqkySv.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-DoBxGoRE.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-dBuQqYkO.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-quSIwMOx.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-rR-MpQFh.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-CcmrUIvP.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Cq72tG9h.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs +128 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CsfGgGJb.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-DYPI_CRD.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.mjs +357 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lHmdUXWT.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
- package/forms/chip/index.d.ts +136 -26
- package/i18n/index.d.ts +42 -0
- package/modules/layout/index.d.ts +89 -6
- package/modules/pattern/README.md +76 -0
- package/modules/pattern/docs/detail.md +237 -0
- package/modules/pattern/docs/drawer.md +484 -0
- package/modules/pattern/docs/flow.md +631 -0
- package/modules/pattern/docs/form.md +518 -0
- package/modules/pattern/docs/header-actions.md +342 -0
- package/modules/pattern/docs/list.md +247 -0
- package/modules/pattern/docs/relation.md +180 -0
- package/modules/pattern/docs/select.md +206 -0
- package/modules/pattern/docs/split.md +350 -0
- package/modules/pattern/docs/states.md +168 -0
- package/modules/pattern/features/approval/entity.resolver.ts +21 -0
- package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
- package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
- package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
- package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
- package/modules/pattern/features/approval/routes.ts +30 -0
- package/modules/pattern/features/approval/services/approval.model.ts +38 -0
- package/modules/pattern/features/approval/services/approval.service.ts +23 -0
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
- package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
- package/modules/pattern/features/category/entity.resolver.ts +27 -0
- package/modules/pattern/features/category/pages/list/list.component.html +20 -0
- package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
- package/modules/pattern/features/category/routes.ts +42 -0
- package/modules/pattern/features/category/services/category.model.ts +39 -0
- package/modules/pattern/features/category/services/category.service.ts +36 -0
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
- package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
- package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
- package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
- package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
- package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
- package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
- package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
- package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
- package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
- package/modules/pattern/features/customer/entity.resolver.ts +21 -0
- package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
- package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
- package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
- package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
- package/modules/pattern/features/customer/routes.ts +59 -0
- package/modules/pattern/features/customer/services/customer.model.ts +87 -0
- package/modules/pattern/features/customer/services/customer.service.ts +79 -0
- package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
- package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
- package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
- package/modules/pattern/features/import/routes.ts +19 -0
- package/modules/pattern/features/import/services/import.model.ts +82 -0
- package/modules/pattern/features/import/services/import.service.ts +18 -0
- package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
- package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
- package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
- package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
- package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
- package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
- package/modules/pattern/features/order/entity.resolver.ts +37 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
- package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
- package/modules/pattern/features/order/pages/list/list.component.html +38 -0
- package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
- package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
- package/modules/pattern/features/order/routes.ts +54 -0
- package/modules/pattern/features/order/services/order.model.ts +109 -0
- package/modules/pattern/features/order/services/order.service.ts +63 -0
- package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
- package/modules/pattern/features/partner/routes.ts +20 -0
- package/modules/pattern/features/partner/services/partner.model.ts +30 -0
- package/modules/pattern/features/partner/services/partner.service.ts +17 -0
- package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
- package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
- package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
- package/modules/pattern/features/product/entity.resolver.ts +21 -0
- package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
- package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
- package/modules/pattern/features/product/pages/list/list.component.html +30 -0
- package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
- package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
- package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
- package/modules/pattern/features/product/routes.ts +48 -0
- package/modules/pattern/features/product/services/product.model.ts +38 -0
- package/modules/pattern/features/product/services/product.service.ts +48 -0
- package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
- package/modules/pattern/features/settings/routes.ts +24 -0
- package/modules/pattern/features/settings/services/settings.model.ts +18 -0
- package/modules/pattern/features/settings/services/settings.service.ts +15 -0
- package/modules/pattern/features/settings/settings.resolver.ts +8 -0
- package/modules/pattern/index.d.ts +50 -0
- package/package.json +5 -1
- package/services/unsaved-changes/index.d.ts +11 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, viewChild, computed, ChangeDetectionStrategy, Component, input, output, model, linkedSignal, signal, effect, untracked } from '@angular/core';
|
|
3
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { Router, ActivatedRoute, NavigationEnd, RouterLink } from '@angular/router';
|
|
5
|
+
import { filter, startWith, map, firstValueFrom } from 'rxjs';
|
|
6
|
+
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
7
|
+
import { SdTabGroup, SdTab } from '@sdcorejs/angular/components/tab';
|
|
8
|
+
import { SdTable, SdTableCellDefDirective } from '@sdcorejs/angular/components/table';
|
|
9
|
+
import { SD_PAGE_LIST, SdPageList } from '@sdcorejs/angular/modules/layout';
|
|
10
|
+
import { SdPermissionService, SdPermissionDirective } from '@sdcorejs/angular/modules/permission';
|
|
11
|
+
import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
|
|
12
|
+
import { SdNotifyService } from '@sdcorejs/angular/services/notify';
|
|
13
|
+
import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
|
|
14
|
+
import { SdSegmentedComponent } from '@sdcorejs/angular/forms/segmented';
|
|
15
|
+
import { SdSwitch } from '@sdcorejs/angular/forms/switch';
|
|
16
|
+
import { d as PatternSettingsStore } from './sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-LQNpFSmN.mjs';
|
|
17
|
+
import { a as apiErrorMessage } from './sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs';
|
|
18
|
+
import { SdInform } from '@sdcorejs/angular/components/inform';
|
|
19
|
+
import { SdCard, SdCardGroup } from '@sdcorejs/angular/components/card';
|
|
20
|
+
import { O as ORDER_STATUS_OPTIONS, a as ORDER_CHANNELS, o as orderStatusBadge, b as OrderService, c as ORDER_PAYMENTS, d as ORDER_WAREHOUSES } from './sdcorejs-angular-modules-pattern-routes-C7b5dRrJ.mjs';
|
|
21
|
+
|
|
22
|
+
const GROUPS = [
|
|
23
|
+
{
|
|
24
|
+
title: 'Vùng của trang',
|
|
25
|
+
rows: [
|
|
26
|
+
{ kind: 'switch', key: 'tabs', label: 'Tab trạng thái', hint: 'sdSubheader · sd-tab' },
|
|
27
|
+
{ kind: 'switch', key: 'score', label: 'Score card', hint: 'nội dung phía trên sd-table' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'sd-table · tìm và lọc',
|
|
32
|
+
rows: [
|
|
33
|
+
{ kind: 'switch', key: 'quickSearch', label: 'Quick search', hint: 'filter.quickSearch' },
|
|
34
|
+
{ kind: 'switch', key: 'warehouse', label: 'Dropdown Kho xuất', hint: 'quickSearch.filters', requires: 'quickSearch' },
|
|
35
|
+
{ kind: 'switch', key: 'inlineFilter', label: 'Filter dưới cột', hint: 'hideInlineFilter: false' },
|
|
36
|
+
{ kind: 'switch', key: 'autoHide', label: 'Tự ẩn khi ≤ 10 dòng', hint: "hideInlineFilter: 'auto'", requires: 'inlineFilter' },
|
|
37
|
+
{ kind: 'switch', key: 'externalFilter', label: 'External filter', hint: 'filter.externalFilters' },
|
|
38
|
+
{
|
|
39
|
+
kind: 'switch',
|
|
40
|
+
key: 'externalFilterCollapsed',
|
|
41
|
+
label: 'Thu gọn external filter',
|
|
42
|
+
hint: 'sd-section collapsible',
|
|
43
|
+
requires: 'externalFilter',
|
|
44
|
+
},
|
|
45
|
+
{ kind: 'switch', key: 'manualFilter', label: 'Lọc thủ công', hint: 'filter.manualFilter', requires: 'externalFilter' },
|
|
46
|
+
{
|
|
47
|
+
kind: 'choice',
|
|
48
|
+
key: 'externalFilterPerRow',
|
|
49
|
+
label: 'Ô mỗi hàng',
|
|
50
|
+
hint: 'externalFilterPerRow',
|
|
51
|
+
items: [
|
|
52
|
+
{ value: 6, label: '6' },
|
|
53
|
+
{ value: 4, label: '4' },
|
|
54
|
+
],
|
|
55
|
+
requires: 'externalFilter',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'sd-table · chọn và footer',
|
|
61
|
+
rows: [
|
|
62
|
+
{ kind: 'switch', key: 'selector', label: 'Cột chọn nhiều', hint: 'selector.visible' },
|
|
63
|
+
{
|
|
64
|
+
kind: 'switch',
|
|
65
|
+
key: 'footerButtons',
|
|
66
|
+
label: 'Nút Tải lại / Xuất dữ liệu / Thiết lập',
|
|
67
|
+
hint: 'reload.visible · export · config.visible',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: 'Dữ liệu và trạng thái',
|
|
73
|
+
rows: [
|
|
74
|
+
{
|
|
75
|
+
kind: 'choice',
|
|
76
|
+
key: 'records',
|
|
77
|
+
label: 'Số bản ghi',
|
|
78
|
+
hint: 'mock API cắt dữ liệu mẫu',
|
|
79
|
+
items: [0, 3, 20, 128].map(value => ({ value, label: String(value) })),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
kind: 'choice',
|
|
83
|
+
key: 'pageSize',
|
|
84
|
+
label: 'Số dòng mỗi trang',
|
|
85
|
+
hint: 'paginate.pageSize',
|
|
86
|
+
items: [10, 20, 50].map(value => ({ value, label: String(value) })),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
kind: 'choice',
|
|
90
|
+
key: 'read',
|
|
91
|
+
label: 'Trạng thái đọc',
|
|
92
|
+
hint: 'mock API',
|
|
93
|
+
items: [
|
|
94
|
+
{ value: 'normal', label: 'Bình thường' },
|
|
95
|
+
{ value: 'loading', label: 'Đang tải' },
|
|
96
|
+
{ value: 'error', label: 'Lỗi' },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{ kind: 'switch', key: 'autoCompact', label: 'Thu gọn khi thấp', hint: 'sd-page-list autoCompact' },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: 'Chi tiết',
|
|
104
|
+
rows: [
|
|
105
|
+
{
|
|
106
|
+
kind: 'choice',
|
|
107
|
+
key: 'detail',
|
|
108
|
+
label: 'Mở chi tiết',
|
|
109
|
+
hint: 'sd-page-list detail',
|
|
110
|
+
items: [
|
|
111
|
+
{ value: 'drawer', label: 'Drawer' },
|
|
112
|
+
{ value: 'page', label: 'Trang' },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
/**
|
|
119
|
+
* "Tuỳ chỉnh hiển thị" of `/pattern/order` (doc 08): a button for the header of the list and a 340px drawer inside
|
|
120
|
+
* the pattern shell, so the list keeps scrolling. Only `/pattern` has it; it is not part of the feature code.
|
|
121
|
+
*/
|
|
122
|
+
class PatternSettingsButtonComponent {
|
|
123
|
+
#host = inject(ElementRef).nativeElement;
|
|
124
|
+
drawer = viewChild.required(SdSideDrawer);
|
|
125
|
+
store = inject(PatternSettingsStore);
|
|
126
|
+
groups = GROUPS;
|
|
127
|
+
/** The body of the pattern shell: the drawer covers the screen, not the sample toolbar. */
|
|
128
|
+
container = computed(() => this.#host.closest('.sd-pattern-shell__body'), ...(ngDevMode ? [{ debugName: "container" }] : []));
|
|
129
|
+
toggle() {
|
|
130
|
+
if (this.store.open()) {
|
|
131
|
+
this.drawer().close();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.store.open.set(true);
|
|
135
|
+
this.drawer().open();
|
|
136
|
+
}
|
|
137
|
+
choose(key, value) {
|
|
138
|
+
if (value === null || value === undefined || Array.isArray(value))
|
|
139
|
+
return;
|
|
140
|
+
this.store.set(key, value);
|
|
141
|
+
}
|
|
142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PatternSettingsButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: PatternSettingsButtonComponent, isStandalone: true, selector: "sd-pattern-settings-button", viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
144
|
+
<sd-button
|
|
145
|
+
title="Tuỳ chỉnh hiển thị"
|
|
146
|
+
prefixIcon="tune"
|
|
147
|
+
autoId="pattern-settings"
|
|
148
|
+
[type]="store.open() ? 'light' : 'outline'"
|
|
149
|
+
[color]="store.open() ? 'primary' : 'secondary'"
|
|
150
|
+
(click)="toggle()" />
|
|
151
|
+
<sd-side-drawer
|
|
152
|
+
title="Tuỳ chỉnh hiển thị"
|
|
153
|
+
width="340px"
|
|
154
|
+
autoId="pattern-settings"
|
|
155
|
+
[container]="container()"
|
|
156
|
+
(sdClosed)="store.open.set(false)">
|
|
157
|
+
<sd-button sdHeaderRight title="Mặc định" type="text" autoId="pattern-settings-reset" (click)="store.reset()" />
|
|
158
|
+
@let settings = store.settings();
|
|
159
|
+
<div class="sd-pattern-settings">
|
|
160
|
+
@for (group of groups; track group.title) {
|
|
161
|
+
<section class="sd-pattern-settings__group">
|
|
162
|
+
<h3 class="sd-pattern-settings__title">{{ group.title }}</h3>
|
|
163
|
+
@for (row of group.rows; track row.key) {
|
|
164
|
+
@let disabled = !!row.requires && !settings[row.requires];
|
|
165
|
+
<div class="sd-pattern-settings__row" [class.sd-pattern-settings__row--disabled]="disabled">
|
|
166
|
+
<div class="sd-pattern-settings__text">
|
|
167
|
+
<span>{{ row.label }}</span>
|
|
168
|
+
@if (store.e6() && (row.key === 'quickSearch' || row.key === 'externalFilter')) {
|
|
169
|
+
<span class="sd-pattern-settings__hint sd-pattern-settings__hint--warning"
|
|
170
|
+
>Không nên bật cùng quick search và external filter (E6)</span
|
|
171
|
+
>
|
|
172
|
+
} @else {
|
|
173
|
+
<span class="sd-pattern-settings__hint">{{ row.hint }}</span>
|
|
174
|
+
}
|
|
175
|
+
</div>
|
|
176
|
+
@if (row.kind === 'switch') {
|
|
177
|
+
<sd-switch
|
|
178
|
+
size="sm"
|
|
179
|
+
[autoId]="'pattern-setting-' + row.key"
|
|
180
|
+
[disabled]="disabled"
|
|
181
|
+
[model]="settings[row.key]"
|
|
182
|
+
(modelChange)="store.set(row.key, !!$event)" />
|
|
183
|
+
} @else {
|
|
184
|
+
<sd-segmented
|
|
185
|
+
size="sm"
|
|
186
|
+
[ariaLabel]="row.label"
|
|
187
|
+
[autoId]="'pattern-setting-' + row.key"
|
|
188
|
+
[disabled]="disabled"
|
|
189
|
+
[items]="row.items"
|
|
190
|
+
[model]="settings[row.key]"
|
|
191
|
+
(sdChange)="choose(row.key, $event)" />
|
|
192
|
+
}
|
|
193
|
+
</div>
|
|
194
|
+
}
|
|
195
|
+
</section>
|
|
196
|
+
}
|
|
197
|
+
</div>
|
|
198
|
+
</sd-side-drawer>
|
|
199
|
+
`, isInline: true, styles: [".sd-pattern-settings{display:flex;flex-direction:column;gap:16px;padding:8px 4px}.sd-pattern-settings__group{display:flex;flex-direction:column;gap:8px}.sd-pattern-settings__title{margin:0;color:var(--sd-text-secondary);font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase}.sd-pattern-settings__row{display:flex;align-items:center;justify-content:space-between;gap:12px}.sd-pattern-settings__row--disabled .sd-pattern-settings__text{opacity:.5}.sd-pattern-settings__text{display:flex;flex-direction:column;min-width:0;font-size:13px}.sd-pattern-settings__hint{color:var(--sd-text-secondary);font:11px/16px var(--sd-font-mono, monospace)}.sd-pattern-settings__hint--warning{color:var(--sd-warning, #b45309);font-family:inherit}\n"], dependencies: [{ 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: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdSwitch, selector: "sd-switch", inputs: ["autoId", "name", "form", "label", "size", "color", "disabled", "viewed", "hideInlineError", "required", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: SdSegmentedComponent, selector: "sd-segmented", inputs: ["items", "option", "model", "label", "ariaLabel", "size", "color", "type", "disabled", "readonly", "loading", "required", "inlineError", "validator", "form", "name", "autoId"], outputs: ["modelChange", "sdChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
200
|
+
}
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PatternSettingsButtonComponent, decorators: [{
|
|
202
|
+
type: Component,
|
|
203
|
+
args: [{ selector: 'sd-pattern-settings-button', standalone: true, imports: [SdButton, SdSideDrawer, SdSwitch, SdSegmentedComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
204
|
+
<sd-button
|
|
205
|
+
title="Tuỳ chỉnh hiển thị"
|
|
206
|
+
prefixIcon="tune"
|
|
207
|
+
autoId="pattern-settings"
|
|
208
|
+
[type]="store.open() ? 'light' : 'outline'"
|
|
209
|
+
[color]="store.open() ? 'primary' : 'secondary'"
|
|
210
|
+
(click)="toggle()" />
|
|
211
|
+
<sd-side-drawer
|
|
212
|
+
title="Tuỳ chỉnh hiển thị"
|
|
213
|
+
width="340px"
|
|
214
|
+
autoId="pattern-settings"
|
|
215
|
+
[container]="container()"
|
|
216
|
+
(sdClosed)="store.open.set(false)">
|
|
217
|
+
<sd-button sdHeaderRight title="Mặc định" type="text" autoId="pattern-settings-reset" (click)="store.reset()" />
|
|
218
|
+
@let settings = store.settings();
|
|
219
|
+
<div class="sd-pattern-settings">
|
|
220
|
+
@for (group of groups; track group.title) {
|
|
221
|
+
<section class="sd-pattern-settings__group">
|
|
222
|
+
<h3 class="sd-pattern-settings__title">{{ group.title }}</h3>
|
|
223
|
+
@for (row of group.rows; track row.key) {
|
|
224
|
+
@let disabled = !!row.requires && !settings[row.requires];
|
|
225
|
+
<div class="sd-pattern-settings__row" [class.sd-pattern-settings__row--disabled]="disabled">
|
|
226
|
+
<div class="sd-pattern-settings__text">
|
|
227
|
+
<span>{{ row.label }}</span>
|
|
228
|
+
@if (store.e6() && (row.key === 'quickSearch' || row.key === 'externalFilter')) {
|
|
229
|
+
<span class="sd-pattern-settings__hint sd-pattern-settings__hint--warning"
|
|
230
|
+
>Không nên bật cùng quick search và external filter (E6)</span
|
|
231
|
+
>
|
|
232
|
+
} @else {
|
|
233
|
+
<span class="sd-pattern-settings__hint">{{ row.hint }}</span>
|
|
234
|
+
}
|
|
235
|
+
</div>
|
|
236
|
+
@if (row.kind === 'switch') {
|
|
237
|
+
<sd-switch
|
|
238
|
+
size="sm"
|
|
239
|
+
[autoId]="'pattern-setting-' + row.key"
|
|
240
|
+
[disabled]="disabled"
|
|
241
|
+
[model]="settings[row.key]"
|
|
242
|
+
(modelChange)="store.set(row.key, !!$event)" />
|
|
243
|
+
} @else {
|
|
244
|
+
<sd-segmented
|
|
245
|
+
size="sm"
|
|
246
|
+
[ariaLabel]="row.label"
|
|
247
|
+
[autoId]="'pattern-setting-' + row.key"
|
|
248
|
+
[disabled]="disabled"
|
|
249
|
+
[items]="row.items"
|
|
250
|
+
[model]="settings[row.key]"
|
|
251
|
+
(sdChange)="choose(row.key, $event)" />
|
|
252
|
+
}
|
|
253
|
+
</div>
|
|
254
|
+
}
|
|
255
|
+
</section>
|
|
256
|
+
}
|
|
257
|
+
</div>
|
|
258
|
+
</sd-side-drawer>
|
|
259
|
+
`, styles: [".sd-pattern-settings{display:flex;flex-direction:column;gap:16px;padding:8px 4px}.sd-pattern-settings__group{display:flex;flex-direction:column;gap:8px}.sd-pattern-settings__title{margin:0;color:var(--sd-text-secondary);font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase}.sd-pattern-settings__row{display:flex;align-items:center;justify-content:space-between;gap:12px}.sd-pattern-settings__row--disabled .sd-pattern-settings__text{opacity:.5}.sd-pattern-settings__text{display:flex;flex-direction:column;min-width:0;font-size:13px}.sd-pattern-settings__hint{color:var(--sd-text-secondary);font:11px/16px var(--sd-font-mono, monospace)}.sd-pattern-settings__hint--warning{color:var(--sd-warning, #b45309);font-family:inherit}\n"] }]
|
|
260
|
+
}], propDecorators: { drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
|
|
261
|
+
|
|
262
|
+
/** Báo kết quả từng phần (E13): "Đã xác nhận 8/10. 2 đơn lỗi." kèm lỗi từng đơn và nút thử lại phần lỗi. */
|
|
263
|
+
class BulkResultComponent {
|
|
264
|
+
result = input.required(...(ngDevMode ? [{ debugName: "result" }] : []));
|
|
265
|
+
retry = output();
|
|
266
|
+
dismiss = output();
|
|
267
|
+
title = computed(() => {
|
|
268
|
+
const { done, total, failed } = this.result();
|
|
269
|
+
return `${done} ${total - failed.length}/${total}.` + (failed.length ? ` ${failed.length} đơn lỗi.` : '');
|
|
270
|
+
}, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
271
|
+
// why: nội dung chiếu vào sd-inform thay cả tiêu đề lẫn nút hành động; lỗi từng đơn đi qua `description`.
|
|
272
|
+
failures = computed(() => this.result()
|
|
273
|
+
.failed.map(item => `${item.code}: ${item.message}`)
|
|
274
|
+
.join(' ') || undefined, ...(ngDevMode ? [{ debugName: "failures" }] : []));
|
|
275
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: BulkResultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
276
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: BulkResultComponent, isStandalone: true, selector: "bulk-result", inputs: { result: { classPropertyName: "result", publicName: "result", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { retry: "retry", dismiss: "dismiss" }, ngImport: i0, template: `
|
|
277
|
+
@let _result = result();
|
|
278
|
+
<sd-inform
|
|
279
|
+
autoId="order-bulk-result"
|
|
280
|
+
[color]="_result.failed.length ? 'warning' : 'success'"
|
|
281
|
+
[title]="title()"
|
|
282
|
+
[description]="failures()"
|
|
283
|
+
[actionLabel]="_result.failed.length ? 'Thử lại phần lỗi' : undefined"
|
|
284
|
+
closable
|
|
285
|
+
(sdAction)="retry.emit()"
|
|
286
|
+
(sdClosed)="dismiss.emit()" />
|
|
287
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdInform, selector: "sd-inform", inputs: ["type", "color", "primary", "secondary", "info", "success", "warning", "error", "title", "description", "icon", "hideIcon", "iconShape", "fontSet", "closable", "actionLabel", "lineClamp", "autoId"], outputs: ["sdClosed", "sdAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
288
|
+
}
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: BulkResultComponent, decorators: [{
|
|
290
|
+
type: Component,
|
|
291
|
+
args: [{
|
|
292
|
+
selector: 'bulk-result',
|
|
293
|
+
standalone: true,
|
|
294
|
+
imports: [SdInform],
|
|
295
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
296
|
+
template: `
|
|
297
|
+
@let _result = result();
|
|
298
|
+
<sd-inform
|
|
299
|
+
autoId="order-bulk-result"
|
|
300
|
+
[color]="_result.failed.length ? 'warning' : 'success'"
|
|
301
|
+
[title]="title()"
|
|
302
|
+
[description]="failures()"
|
|
303
|
+
[actionLabel]="_result.failed.length ? 'Thử lại phần lỗi' : undefined"
|
|
304
|
+
closable
|
|
305
|
+
(sdAction)="retry.emit()"
|
|
306
|
+
(sdClosed)="dismiss.emit()" />
|
|
307
|
+
`,
|
|
308
|
+
}]
|
|
309
|
+
}], propDecorators: { result: [{ type: i0.Input, args: [{ isSignal: true, alias: "result", required: true }] }], retry: [{ type: i0.Output, args: ["retry"] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
|
|
310
|
+
|
|
311
|
+
const CARDS = [
|
|
312
|
+
{ key: 'all', label: 'Tổng đơn' },
|
|
313
|
+
{ key: 'pending', label: 'Chờ xác nhận' },
|
|
314
|
+
{ key: 'shipping', label: 'Đang giao' },
|
|
315
|
+
];
|
|
316
|
+
/** 1.234.567.890 → "1,2 tỷ"; 350.000.000 → "350 triệu". */
|
|
317
|
+
function money(value) {
|
|
318
|
+
if (value >= 1_000_000_000)
|
|
319
|
+
return `${(value / 1_000_000_000).toLocaleString('vi-VN', { maximumFractionDigits: 1 })} tỷ`;
|
|
320
|
+
return `${Math.round(value / 1_000_000).toLocaleString('vi-VN')} triệu`;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Score card của danh sách đơn: ba thẻ đầu lọc theo trạng thái, đồng bộ với tab vì cùng một state; thẻ doanh thu
|
|
324
|
+
* chỉ để xem. Khi `sd-page-list` thu gọn (màn thấp), các thẻ thành một dòng 36px.
|
|
325
|
+
*/
|
|
326
|
+
class SummaryCardsComponent {
|
|
327
|
+
counts = input(null, ...(ngDevMode ? [{ debugName: "counts" }] : []));
|
|
328
|
+
/** Trạng thái đang lọc; `null` là tất cả. */
|
|
329
|
+
status = model(null, ...(ngDevMode ? [{ debugName: "status" }] : []));
|
|
330
|
+
cards = computed(() => {
|
|
331
|
+
const counts = this.counts();
|
|
332
|
+
return CARDS.map(card => ({ ...card, value: counts ? counts[card.key].toLocaleString('vi-VN') : '…' }));
|
|
333
|
+
}, ...(ngDevMode ? [{ debugName: "cards" }] : []));
|
|
334
|
+
compact = inject(SD_PAGE_LIST).compact;
|
|
335
|
+
/** Trạng thái chọn từ tab mà không có thẻ (Hoàn tất, Đã huỷ): không thẻ nào sáng. */
|
|
336
|
+
selected = linkedSignal(() => {
|
|
337
|
+
const status = this.status();
|
|
338
|
+
return status === null ? 'all' : status === 'pending' || status === 'shipping' ? status : null;
|
|
339
|
+
}, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
340
|
+
revenue = computed(() => {
|
|
341
|
+
const counts = this.counts();
|
|
342
|
+
return counts ? money(counts.revenue) : '…';
|
|
343
|
+
}, ...(ngDevMode ? [{ debugName: "revenue" }] : []));
|
|
344
|
+
choose(key) {
|
|
345
|
+
// Bấm lại thẻ đang chọn (model về null) hoặc thẻ Tổng đơn đều là bỏ lọc.
|
|
346
|
+
const card = key ?? 'all';
|
|
347
|
+
this.selected.set(card);
|
|
348
|
+
this.status.set(card === 'all' ? null : card);
|
|
349
|
+
}
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SummaryCardsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
351
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SummaryCardsComponent, isStandalone: true, selector: "summary-cards", inputs: { counts: { classPropertyName: "counts", publicName: "counts", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { status: "statusChange" }, ngImport: i0, template: `
|
|
352
|
+
<sd-card-group
|
|
353
|
+
class="summary"
|
|
354
|
+
autoId="order-summary"
|
|
355
|
+
aria-label="Tóm tắt đơn hàng"
|
|
356
|
+
[class.summary--compact]="compact()"
|
|
357
|
+
[(model)]="selected"
|
|
358
|
+
(sdChange)="choose($event)">
|
|
359
|
+
@for (card of cards(); track card.key) {
|
|
360
|
+
<sd-card class="summary__card" [value]="card.key" [autoId]="'order-summary-' + card.key">
|
|
361
|
+
<span class="summary__label">{{ card.label }}</span>
|
|
362
|
+
<strong class="summary__value">{{ card.value }}</strong>
|
|
363
|
+
</sd-card>
|
|
364
|
+
}
|
|
365
|
+
<div class="summary__card summary__card--static" data-autoid="order-summary-revenue">
|
|
366
|
+
<span class="summary__label">Doanh thu hoàn tất</span>
|
|
367
|
+
<strong class="summary__value">{{ revenue() }}</strong>
|
|
368
|
+
</div>
|
|
369
|
+
</sd-card-group>
|
|
370
|
+
`, isInline: true, styles: [".summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.summary__card{display:flex;flex-direction:column;gap:4px;padding:12px 16px}.summary__card--static{border:1px solid var(--sd-border);border-radius:8px;background:var(--sd-surface)}.summary__label{color:var(--sd-text-secondary);font-size:13px}.summary__value{font-size:22px;line-height:28px;font-weight:500;font-variant-numeric:tabular-nums}.summary--compact{display:flex;align-items:center;gap:8px;height:36px}.summary--compact .summary__card{flex-direction:row;align-items:baseline;gap:6px;padding:4px 10px}.summary--compact .summary__card--static{border:0;background:transparent}.summary--compact .summary__value{font-size:14px;line-height:20px}@media(max-width:767px){.summary{grid-template-columns:repeat(2,minmax(0,1fr))}}\n"], dependencies: [{ kind: "component", type: SdCard, selector: "sd-card", inputs: ["value", "disabled", "autoId", "color"], outputs: ["click"], exportAs: ["sdCard"] }, { kind: "component", type: SdCardGroup, selector: "sd-card-group", inputs: ["model", "multiple", "disabled", "autoId", "color", "compareWith"], outputs: ["modelChange", "sdChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
371
|
+
}
|
|
372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SummaryCardsComponent, decorators: [{
|
|
373
|
+
type: Component,
|
|
374
|
+
args: [{ selector: 'summary-cards', standalone: true, imports: [SdCard, SdCardGroup], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
375
|
+
<sd-card-group
|
|
376
|
+
class="summary"
|
|
377
|
+
autoId="order-summary"
|
|
378
|
+
aria-label="Tóm tắt đơn hàng"
|
|
379
|
+
[class.summary--compact]="compact()"
|
|
380
|
+
[(model)]="selected"
|
|
381
|
+
(sdChange)="choose($event)">
|
|
382
|
+
@for (card of cards(); track card.key) {
|
|
383
|
+
<sd-card class="summary__card" [value]="card.key" [autoId]="'order-summary-' + card.key">
|
|
384
|
+
<span class="summary__label">{{ card.label }}</span>
|
|
385
|
+
<strong class="summary__value">{{ card.value }}</strong>
|
|
386
|
+
</sd-card>
|
|
387
|
+
}
|
|
388
|
+
<div class="summary__card summary__card--static" data-autoid="order-summary-revenue">
|
|
389
|
+
<span class="summary__label">Doanh thu hoàn tất</span>
|
|
390
|
+
<strong class="summary__value">{{ revenue() }}</strong>
|
|
391
|
+
</div>
|
|
392
|
+
</sd-card-group>
|
|
393
|
+
`, styles: [".summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.summary__card{display:flex;flex-direction:column;gap:4px;padding:12px 16px}.summary__card--static{border:1px solid var(--sd-border);border-radius:8px;background:var(--sd-surface)}.summary__label{color:var(--sd-text-secondary);font-size:13px}.summary__value{font-size:22px;line-height:28px;font-weight:500;font-variant-numeric:tabular-nums}.summary--compact{display:flex;align-items:center;gap:8px;height:36px}.summary--compact .summary__card{flex-direction:row;align-items:baseline;gap:6px;padding:4px 10px}.summary--compact .summary__card--static{border:0;background:transparent}.summary--compact .summary__value{font-size:14px;line-height:20px}@media(max-width:767px){.summary{grid-template-columns:repeat(2,minmax(0,1fr))}}\n"] }]
|
|
394
|
+
}], propDecorators: { counts: [{ type: i0.Input, args: [{ isSignal: true, alias: "counts", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }, { type: i0.Output, args: ["statusChange"] }] } });
|
|
395
|
+
|
|
396
|
+
const TABS = [
|
|
397
|
+
{ label: 'Tất cả', status: null },
|
|
398
|
+
...ORDER_STATUS_OPTIONS.map(option => ({ label: option.name, status: option.id })),
|
|
399
|
+
];
|
|
400
|
+
const values = (items) => ({ items: items.map(value => ({ value })), valueField: 'value', displayField: 'value' });
|
|
401
|
+
/** Cột của danh sách; `withTabs`: có tab trạng thái thì không lọc trạng thái dưới cột (E6). */
|
|
402
|
+
function columns(withTabs) {
|
|
403
|
+
return [
|
|
404
|
+
{ field: 'code', title: 'Mã đơn', type: 'string', width: '130px', sortable: true },
|
|
405
|
+
{ field: 'customer', title: 'Khách hàng', type: 'string', minWidth: '180px' },
|
|
406
|
+
{ field: 'channel', title: 'Kênh', type: 'values', width: '130px', option: values(ORDER_CHANNELS) },
|
|
407
|
+
{ field: 'createdAt', title: 'Ngày tạo', type: 'date', width: '170px', filter: { type: 'daterange' }, sortable: true },
|
|
408
|
+
{ field: 'total', title: 'Tổng tiền (₫)', type: 'number', width: '130px', align: 'right', sortable: true },
|
|
409
|
+
{
|
|
410
|
+
field: 'status',
|
|
411
|
+
title: 'Trạng thái',
|
|
412
|
+
type: 'values',
|
|
413
|
+
width: '150px',
|
|
414
|
+
option: { items: ORDER_STATUS_OPTIONS, valueField: 'id', displayField: 'name' },
|
|
415
|
+
useBadge: status => orderStatusBadge(status),
|
|
416
|
+
filter: withTabs ? { disabled: true } : undefined,
|
|
417
|
+
},
|
|
418
|
+
];
|
|
419
|
+
}
|
|
420
|
+
class ListComponent {
|
|
421
|
+
#orderService = inject(OrderService);
|
|
422
|
+
#permission = inject(SdPermissionService);
|
|
423
|
+
#confirm = inject(SdConfirmService);
|
|
424
|
+
#notify = inject(SdNotifyService);
|
|
425
|
+
#router = inject(Router);
|
|
426
|
+
#route = inject(ActivatedRoute);
|
|
427
|
+
pageList = viewChild.required(SdPageList);
|
|
428
|
+
table = viewChild.required(SdTable);
|
|
429
|
+
canOpenDetail = this.#permission.hasPermission('PATTERN_ORDER_R_DETAIL');
|
|
430
|
+
#canExport = this.#permission.hasPermission('PATTERN_ORDER_R_EXPORT');
|
|
431
|
+
settings = inject(PatternSettingsStore).settings;
|
|
432
|
+
tabs = TABS;
|
|
433
|
+
// #region state
|
|
434
|
+
/** Một state cho tab, score card và request: đổi trạng thái thì đọc lại từ trang 1. */
|
|
435
|
+
status = signal(null, ...(ngDevMode ? [{ debugName: "status" }] : []));
|
|
436
|
+
tabIndex = computed(() => TABS.findIndex(tab => tab.status === this.status()), ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
|
|
437
|
+
counts = signal(null, ...(ngDevMode ? [{ debugName: "counts" }] : []));
|
|
438
|
+
// #endregion
|
|
439
|
+
bulkResult = signal(null, ...(ngDevMode ? [{ debugName: "bulkResult" }] : []));
|
|
440
|
+
#lastBulk = null;
|
|
441
|
+
/** Tạo và cập nhật (`data.detail: 'page'`) thay chỗ danh sách; chi tiết mở theo cấu hình (drawer mặc định). */
|
|
442
|
+
#childMode = toSignal(this.#router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.#route.firstChild?.snapshot.data['detail'])), { requireSync: true });
|
|
443
|
+
detailMode = computed(() => this.#childMode() ?? this.settings().detail, ...(ngDevMode ? [{ debugName: "detailMode" }] : []));
|
|
444
|
+
option = computed(() => this.#tableOption(this.settings()), ...(ngDevMode ? [{ debugName: "option" }] : []));
|
|
445
|
+
constructor() {
|
|
446
|
+
let status = this.status();
|
|
447
|
+
effect(() => {
|
|
448
|
+
const next = this.status();
|
|
449
|
+
if (next === status)
|
|
450
|
+
return;
|
|
451
|
+
status = next;
|
|
452
|
+
untracked(() => void this.table().reloadFirstPage());
|
|
453
|
+
});
|
|
454
|
+
// Bật/tắt tab trạng thái thì về "Tất cả".
|
|
455
|
+
let tabs = this.settings().tabs;
|
|
456
|
+
effect(() => {
|
|
457
|
+
const next = this.settings().tabs;
|
|
458
|
+
if (next === tabs)
|
|
459
|
+
return;
|
|
460
|
+
tabs = next;
|
|
461
|
+
untracked(() => this.status.set(null));
|
|
462
|
+
});
|
|
463
|
+
// Lưu hoặc đổi trạng thái ở màn con xong rồi quay về: tải lại trang hiện tại, giữ bộ lọc.
|
|
464
|
+
let changes = this.#orderService.changes();
|
|
465
|
+
effect(() => {
|
|
466
|
+
const next = this.#orderService.changes();
|
|
467
|
+
if (this.pageList().childActive() || next === changes)
|
|
468
|
+
return;
|
|
469
|
+
changes = next;
|
|
470
|
+
untracked(() => void this.table().reload(true, false));
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
selectTab(index) {
|
|
474
|
+
this.status.set(TABS[index]?.status ?? null);
|
|
475
|
+
}
|
|
476
|
+
retryFailed() {
|
|
477
|
+
const last = this.#lastBulk;
|
|
478
|
+
const failed = new Set(this.bulkResult()?.failed.map(item => item.id) ?? []);
|
|
479
|
+
if (last && failed.size)
|
|
480
|
+
void this.#runBulk(last.action, last.reqs.filter(req => failed.has(req.id)));
|
|
481
|
+
}
|
|
482
|
+
async #read(req) {
|
|
483
|
+
const status = untracked(this.status);
|
|
484
|
+
// Số trên tab và thẻ theo cùng bộ lọc của bảng, chưa tính trạng thái đang chọn.
|
|
485
|
+
void firstValueFrom(this.#orderService.counts(req.filters ?? []))
|
|
486
|
+
.then(counts => this.counts.set(counts))
|
|
487
|
+
.catch(() => this.counts.set(null));
|
|
488
|
+
const filters = status ? [...(req.filters ?? []), { field: 'status', operator: 'EQUAL', data: status }] : req.filters;
|
|
489
|
+
return firstValueFrom(this.#orderService.list({ ...req, filters }));
|
|
490
|
+
}
|
|
491
|
+
#tableOption(settings) {
|
|
492
|
+
return {
|
|
493
|
+
type: 'server',
|
|
494
|
+
rowKey: 'id',
|
|
495
|
+
items: (_, req) => this.#read(req),
|
|
496
|
+
sort: { enable: true },
|
|
497
|
+
columns: columns(settings.tabs),
|
|
498
|
+
paginate: { pageSize: settings.pageSize, pages: [10, 20, 50] },
|
|
499
|
+
selector: settings.selector ? { visible: true, preserveSelection: true, actions: this.#selectorActions() } : { visible: false },
|
|
500
|
+
reload: { visible: settings.footerButtons },
|
|
501
|
+
export: settings.footerButtons && this.#canExport ? { visible: 'EXCEL' } : undefined,
|
|
502
|
+
config: { visible: settings.footerButtons },
|
|
503
|
+
filter: {
|
|
504
|
+
hideInlineFilter: !settings.inlineFilter ? true : settings.autoHide ? 'auto' : false,
|
|
505
|
+
quickSearch: settings.quickSearch
|
|
506
|
+
? {
|
|
507
|
+
placeholder: 'Tìm theo mã đơn, khách hàng',
|
|
508
|
+
containFields: ['code', 'customer'],
|
|
509
|
+
filters: settings.warehouse
|
|
510
|
+
? [{ field: 'warehouse', title: 'Kho xuất', type: 'values', option: values(ORDER_WAREHOUSES) }]
|
|
511
|
+
: [],
|
|
512
|
+
}
|
|
513
|
+
: undefined,
|
|
514
|
+
// External filter chỉ chứa field không có cột (E6).
|
|
515
|
+
externalFilters: settings.externalFilter
|
|
516
|
+
? [
|
|
517
|
+
{ field: 'payment', title: 'Thanh toán', type: 'values', option: values(ORDER_PAYMENTS) },
|
|
518
|
+
{ field: 'creator', title: 'Người tạo', type: 'string' },
|
|
519
|
+
{ field: 'deliveredAt', title: 'Ngày giao', type: 'daterange' },
|
|
520
|
+
{ field: 'source', title: 'Nguồn đơn', type: 'string' },
|
|
521
|
+
{ field: 'tracking', title: 'Mã vận đơn', type: 'string' },
|
|
522
|
+
{ field: 'note', title: 'Ghi chú nội bộ', type: 'string' },
|
|
523
|
+
]
|
|
524
|
+
: undefined,
|
|
525
|
+
externalFilterPerRow: settings.externalFilterPerRow,
|
|
526
|
+
externalFilterCollapsed: settings.externalFilterCollapsed || undefined,
|
|
527
|
+
manualFilter: settings.manualFilter,
|
|
528
|
+
},
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
/** Tác vụ trên các dòng đã chọn, theo quyền (đã nạp trước khi mở màn). */
|
|
532
|
+
#selectorActions() {
|
|
533
|
+
const can = (code) => this.#permission.hasPermission(code);
|
|
534
|
+
return [
|
|
535
|
+
{ title: 'Xác nhận', icon: 'check', hidden: !can('PATTERN_ORDER_U_CONFIRM'), click: items => void this.#confirmOrders(items ?? []) },
|
|
536
|
+
{ title: 'In phiếu giao', icon: 'print', hidden: !can('PATTERN_ORDER_R_PRINT'), click: items => this.#print(items ?? []) },
|
|
537
|
+
{
|
|
538
|
+
title: 'Huỷ đơn',
|
|
539
|
+
icon: 'cancel',
|
|
540
|
+
color: 'error',
|
|
541
|
+
hidden: !can('PATTERN_ORDER_U_CANCEL'),
|
|
542
|
+
click: items => void this.#cancelOrders(items ?? []),
|
|
543
|
+
},
|
|
544
|
+
];
|
|
545
|
+
}
|
|
546
|
+
async #confirmOrders(orders) {
|
|
547
|
+
try {
|
|
548
|
+
await this.#confirm.confirm(`Xác nhận ${orders.length} đơn hàng đã chọn? Đơn chuyển sang Đang giao.`, {
|
|
549
|
+
title: 'Xác nhận đơn hàng',
|
|
550
|
+
yesTitle: 'Xác nhận',
|
|
551
|
+
noTitle: 'Không',
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
catch {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
await this.#runBulk('confirm', orders.map(order => ({ id: order.id })));
|
|
558
|
+
}
|
|
559
|
+
async #cancelOrders(orders) {
|
|
560
|
+
let reason;
|
|
561
|
+
try {
|
|
562
|
+
reason = await this.#confirm.withInput(`Huỷ ${orders.length} đơn hàng đã chọn. Lý do được ghi vào từng đơn.`, {
|
|
563
|
+
title: 'Huỷ đơn hàng',
|
|
564
|
+
label: 'Lý do huỷ',
|
|
565
|
+
required: true,
|
|
566
|
+
maxlength: 200,
|
|
567
|
+
yesTitle: 'Huỷ đơn',
|
|
568
|
+
noTitle: 'Không huỷ',
|
|
569
|
+
yesButtonColor: 'error',
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
catch {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
await this.#runBulk('cancel', orders.map(order => ({ id: order.id, reason })));
|
|
576
|
+
}
|
|
577
|
+
#print(orders) {
|
|
578
|
+
this.#notify.info(`Đã gửi ${orders.length} phiếu giao tới máy in.`);
|
|
579
|
+
}
|
|
580
|
+
/** Chạy tác vụ hàng loạt, báo kết quả từng phần, giữ các dòng lỗi đang chọn và cho thử lại phần lỗi. */
|
|
581
|
+
async #runBulk(action, reqs) {
|
|
582
|
+
const table = this.table();
|
|
583
|
+
const selected = table.selectedTableItems();
|
|
584
|
+
const codeOf = (id) => selected.find(item => item.data.id === id)?.data.code ?? id;
|
|
585
|
+
try {
|
|
586
|
+
const { results } = await firstValueFrom(this.#orderService.bulk(action, reqs));
|
|
587
|
+
const failed = results.filter(result => !result.ok);
|
|
588
|
+
const succeeded = new Set(results.filter(result => result.ok).map(result => result.id));
|
|
589
|
+
this.#lastBulk = { action, reqs };
|
|
590
|
+
this.bulkResult.set({
|
|
591
|
+
done: action === 'confirm' ? 'Đã xác nhận' : 'Đã huỷ',
|
|
592
|
+
total: results.length,
|
|
593
|
+
failed: failed.map(result => ({ id: result.id, code: codeOf(result.id), message: result.message ?? 'Không thực hiện được.' })),
|
|
594
|
+
});
|
|
595
|
+
// Bỏ chọn đúng các đơn đã xong; đơn lỗi vẫn được chọn sau khi tải lại (preserveSelection).
|
|
596
|
+
for (const item of selected) {
|
|
597
|
+
if (!succeeded.has(item.data.id))
|
|
598
|
+
continue;
|
|
599
|
+
item.meta.selector.isSelected = false;
|
|
600
|
+
table.onSelect(item);
|
|
601
|
+
}
|
|
602
|
+
await table.reload(true, false);
|
|
603
|
+
}
|
|
604
|
+
catch (error) {
|
|
605
|
+
this.#notify.error(apiErrorMessage(error));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
609
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: ListComponent, isStandalone: true, selector: "list", viewQueries: [{ propertyName: "pageList", first: true, predicate: SdPageList, descendants: true, isSignal: true }, { propertyName: "table", first: true, predicate: SdTable, descendants: true, isSignal: true }], ngImport: i0, template: "@let _settings = settings();\n<sd-page-list title=\"\u0110\u01A1n h\u00E0ng\" description=\"\u0110\u01A1n b\u00E1n l\u1EBB t\u1EEB m\u1ECDi k\u00EAnh.\" [detail]=\"detailMode()\" [autoCompact]=\"_settings.autoCompact\">\n <div headerRight class=\"d-flex align-items-center gap-8 flex-wrap\">\n <!-- Ch\u1EC9 c\u00F3 \u1EDF /pattern. -->\n <sd-pattern-settings-button />\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_C_CREATE'\"\n title=\"T\u1EA1o \u0111\u01A1n h\u00E0ng\"\n prefixIcon=\"add\"\n type=\"fill\"\n color=\"primary\"\n autoId=\"order-create\"\n [routerLink]=\"['create']\" />\n </div>\n\n @if (_settings.tabs) {\n <sd-tab-group sdSubheader [selectedIndex]=\"tabIndex()\" (selectedIndexChange)=\"selectTab($event)\">\n @for (tab of tabs; track tab.label) {\n <sd-tab [label]=\"tab.label\" [badge]=\"counts()?.[tab.status ?? 'all']\" />\n }\n </sd-tab-group>\n }\n @if (_settings.score) {\n <summary-cards [counts]=\"counts()\" [(status)]=\"status\" />\n }\n @if (bulkResult(); as result) {\n <bulk-result [result]=\"result\" (retry)=\"retryFailed()\" (dismiss)=\"bulkResult.set(null)\" />\n }\n\n <sd-table autoId=\"orders\" [option]=\"option()\">\n <ng-template sdTableCellDef=\"code\" let-order=\"item\">\n <a *sdPermission=\"'PATTERN_ORDER_R_DETAIL'\" [routerLink]=\"[order.id, 'detail']\">{{ order.code }}</a>\n @if (!canOpenDetail) {\n <span>{{ order.code }}</span>\n }\n </ng-template>\n </sd-table>\n</sd-page-list>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: SdPageList, selector: "sd-page-list", inputs: ["title", "description", "backLink", "badges", "width", "detail", "autoCompact"] }, { 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: SdTabGroup, selector: "sd-tab-group", inputs: ["preserveContent", "selectedIndex", "variant", "color", "headerPosition", "headerClass", "headerStyle", "bodyClass", "bodyStyle", "alignTabs", "stretchTabs", "animationDuration", "disableRipple", "dynamicHeight", "autoId"], outputs: ["selectedIndexChange", "tabClosed"] }, { kind: "component", type: SdTab, selector: "sd-tab", inputs: ["label", "icon", "badge", "disabled", "closable", "beforeClose"], outputs: ["close", "closeError"] }, { kind: "component", type: SdTable, selector: "sd-table", inputs: ["autoId", "option", "hideReadError"], outputs: ["sdReadStateChange"] }, { kind: "directive", type: SdTableCellDefDirective, selector: "[sdTableCellDef]", inputs: ["sdTableCellDef"] }, { kind: "directive", type: SdPermissionDirective, selector: "[sdPermission]", inputs: ["sdPermission", "sdPermissionKey"] }, { kind: "component", type: SummaryCardsComponent, selector: "summary-cards", inputs: ["counts", "status"], outputs: ["statusChange"] }, { kind: "component", type: BulkResultComponent, selector: "bulk-result", inputs: ["result"], outputs: ["retry", "dismiss"] }, { kind: "component", type: PatternSettingsButtonComponent, selector: "sd-pattern-settings-button" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
610
|
+
}
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ListComponent, decorators: [{
|
|
612
|
+
type: Component,
|
|
613
|
+
args: [{ selector: 'list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
614
|
+
RouterLink,
|
|
615
|
+
SdPageList,
|
|
616
|
+
SdButton,
|
|
617
|
+
SdTabGroup,
|
|
618
|
+
SdTab,
|
|
619
|
+
SdTable,
|
|
620
|
+
SdTableCellDefDirective,
|
|
621
|
+
SdPermissionDirective,
|
|
622
|
+
SummaryCardsComponent,
|
|
623
|
+
BulkResultComponent,
|
|
624
|
+
PatternSettingsButtonComponent,
|
|
625
|
+
], template: "@let _settings = settings();\n<sd-page-list title=\"\u0110\u01A1n h\u00E0ng\" description=\"\u0110\u01A1n b\u00E1n l\u1EBB t\u1EEB m\u1ECDi k\u00EAnh.\" [detail]=\"detailMode()\" [autoCompact]=\"_settings.autoCompact\">\n <div headerRight class=\"d-flex align-items-center gap-8 flex-wrap\">\n <!-- Ch\u1EC9 c\u00F3 \u1EDF /pattern. -->\n <sd-pattern-settings-button />\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_C_CREATE'\"\n title=\"T\u1EA1o \u0111\u01A1n h\u00E0ng\"\n prefixIcon=\"add\"\n type=\"fill\"\n color=\"primary\"\n autoId=\"order-create\"\n [routerLink]=\"['create']\" />\n </div>\n\n @if (_settings.tabs) {\n <sd-tab-group sdSubheader [selectedIndex]=\"tabIndex()\" (selectedIndexChange)=\"selectTab($event)\">\n @for (tab of tabs; track tab.label) {\n <sd-tab [label]=\"tab.label\" [badge]=\"counts()?.[tab.status ?? 'all']\" />\n }\n </sd-tab-group>\n }\n @if (_settings.score) {\n <summary-cards [counts]=\"counts()\" [(status)]=\"status\" />\n }\n @if (bulkResult(); as result) {\n <bulk-result [result]=\"result\" (retry)=\"retryFailed()\" (dismiss)=\"bulkResult.set(null)\" />\n }\n\n <sd-table autoId=\"orders\" [option]=\"option()\">\n <ng-template sdTableCellDef=\"code\" let-order=\"item\">\n <a *sdPermission=\"'PATTERN_ORDER_R_DETAIL'\" [routerLink]=\"[order.id, 'detail']\">{{ order.code }}</a>\n @if (!canOpenDetail) {\n <span>{{ order.code }}</span>\n }\n </ng-template>\n </sd-table>\n</sd-page-list>\n" }]
|
|
626
|
+
}], ctorParameters: () => [], propDecorators: { pageList: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdPageList), { isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdTable), { isSignal: true }] }] } });
|
|
627
|
+
|
|
628
|
+
export { ListComponent };
|
|
629
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-list.component-DkxheDVz.mjs.map
|