@sdcorejs/angular 20.3.4 → 20.3.6
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/STYLE-GUIDE.md +78 -1
- package/assets/THEME.md +45 -3
- package/assets/scss/core/_popover-panel.scss +90 -0
- package/assets/scss/core/form.scss +5 -2
- package/assets/scss/core/utilities/_grid.scss +15 -0
- package/assets/scss/core/utilities/_sizing.scss +4 -0
- package/assets/scss/themes/_component-tokens.scss +9 -4
- package/assets/scss/themes/_semantic.scss +6 -5
- package/components/anchor/index.d.ts +6 -1
- package/components/button/index.d.ts +7 -1
- package/components/calendar/index.d.ts +1092 -0
- package/components/card/index.d.ts +247 -9
- package/components/index.d.ts +3 -1
- package/components/kanban/index.d.ts +191 -74
- package/components/modal/index.d.ts +15 -1
- package/components/query-bar/index.d.ts +204 -38
- package/components/quick-action/index.d.ts +65 -1
- package/components/scheduler/index.d.ts +544 -0
- package/components/tab/index.d.ts +6 -1
- package/components/table/index.d.ts +338 -31
- package/components/timeline/index.d.ts +216 -0
- package/components/tree/index.d.ts +119 -6
- package/directives/index.d.ts +4 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +62 -3
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +14 -6
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-calendar.mjs +2481 -0
- package/fesm2022/sdcorejs-angular-components-calendar.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-card.mjs +486 -23
- package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +4 -18
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +7 -7
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +833 -154
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +69 -14
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +1477 -365
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +68 -2
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-scheduler.mjs +1934 -0
- package/fesm2022/sdcorejs-angular-components-scheduler.mjs.map +1 -0
- 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-tab-router.mjs +126 -26
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +31 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +5967 -3690
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-timeline.mjs +473 -0
- package/fesm2022/sdcorejs-angular-components-timeline.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-tree.mjs +597 -36
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +3 -1
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +109 -22
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +140 -42
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +70 -21
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +4 -3
- package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +23 -4
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +812 -52
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-w7iVesRB.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-w7iVesRB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-DwGr3EVD.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-DwGr3EVD.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs → sdcorejs-angular-modules-generic-generic-list.page-QqBNS185.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-QqBNS185.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-_WrprZ_o.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-_WrprZ_o.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +17 -8
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-okZVmcd5.mjs → sdcorejs-angular-modules-pattern-base-api.service-B2HMyv8F.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-okZVmcd5.mjs.map → sdcorejs-angular-modules-pattern-base-api.service-B2HMyv8F.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-LPUj7MqG.mjs → sdcorejs-angular-modules-pattern-create.component-CNtkbnRK.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-LPUj7MqG.mjs.map → sdcorejs-angular-modules-pattern-create.component-CNtkbnRK.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-2-dyjvCH.mjs → sdcorejs-angular-modules-pattern-create.component-DlNyY3e7.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-2-dyjvCH.mjs.map → sdcorejs-angular-modules-pattern-create.component-DlNyY3e7.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-BCoG3bVV.mjs → sdcorejs-angular-modules-pattern-create.component-DxV_0Ckg.mjs} +11 -7
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxV_0Ckg.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-Caua6Xto.mjs → sdcorejs-angular-modules-pattern-customer.service-DS0cFc3u.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-Caua6Xto.mjs.map → sdcorejs-angular-modules-pattern-customer.service-DS0cFc3u.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-_c_4slgf.mjs → sdcorejs-angular-modules-pattern-detail.component-B_1ppVNA.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-_c_4slgf.mjs.map → sdcorejs-angular-modules-pattern-detail.component-B_1ppVNA.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-B2Y0PbbC.mjs → sdcorejs-angular-modules-pattern-detail.component-CFvwPHFx.mjs} +58 -55
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CFvwPHFx.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-C_HziBQN.mjs → sdcorejs-angular-modules-pattern-flow.component-Ba4xO_tF.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-C_HziBQN.mjs.map → sdcorejs-angular-modules-pattern-flow.component-Ba4xO_tF.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-B2dNqckm.mjs → sdcorejs-angular-modules-pattern-index.component-DvwY0K3t.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-B2dNqckm.mjs.map → sdcorejs-angular-modules-pattern-index.component-DvwY0K3t.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-Dq8Q8Vfm.mjs → sdcorejs-angular-modules-pattern-lines-table-form.component-BSAQaAgH.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-Dq8Q8Vfm.mjs.map → sdcorejs-angular-modules-pattern-lines-table-form.component-BSAQaAgH.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIv2k6NI.mjs +506 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIv2k6NI.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-CeX57FPi.mjs → sdcorejs-angular-modules-pattern-list.component-BYyL5Q5n.mjs} +30 -39
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BYyL5Q5n.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZRTnqNx.mjs +501 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZRTnqNx.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DS8A17mM.mjs → sdcorejs-angular-modules-pattern-list.component-DF7CvaVG.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DS8A17mM.mjs.map → sdcorejs-angular-modules-pattern-list.component-DF7CvaVG.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bs9hhMr7.mjs → sdcorejs-angular-modules-pattern-list.component-nMyLso8Z.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bs9hhMr7.mjs.map → sdcorejs-angular-modules-pattern-list.component-nMyLso8Z.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-Dfil91qL.mjs → sdcorejs-angular-modules-pattern-mock-backend.factory-CS7VK5Ol.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-Dfil91qL.mjs.map → sdcorejs-angular-modules-pattern-mock-backend.factory-CS7VK5Ol.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs → sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs} +4 -22
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs → sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs} +26 -27
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-PaIGZ1ve.mjs → sdcorejs-angular-modules-pattern-product.service-KKWwzMEG.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-PaIGZ1ve.mjs.map → sdcorejs-angular-modules-pattern-product.service-KKWwzMEG.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-B8j8cieu.mjs → sdcorejs-angular-modules-pattern-profile.component-XDuLwzEl.mjs} +25 -15
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-XDuLwzEl.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-0Vh73aXL.mjs → sdcorejs-angular-modules-pattern-routes--ScZNg7A.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-0Vh73aXL.mjs.map → sdcorejs-angular-modules-pattern-routes--ScZNg7A.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-Cw9uJySU.mjs → sdcorejs-angular-modules-pattern-routes-Bka6PaRB.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-Cw9uJySU.mjs.map → sdcorejs-angular-modules-pattern-routes-Bka6PaRB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-nrxSHE-O.mjs → sdcorejs-angular-modules-pattern-routes-CCwFQAdd.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-nrxSHE-O.mjs.map → sdcorejs-angular-modules-pattern-routes-CCwFQAdd.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CFT9DyKj.mjs → sdcorejs-angular-modules-pattern-routes-CKryLRCh.mjs} +8 -8
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CFT9DyKj.mjs.map → sdcorejs-angular-modules-pattern-routes-CKryLRCh.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CFLETqYK.mjs → sdcorejs-angular-modules-pattern-routes-Dr72yGSt.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CFLETqYK.mjs.map → sdcorejs-angular-modules-pattern-routes-Dr72yGSt.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BoB2usST.mjs → sdcorejs-angular-modules-pattern-routes-P9WvwSEW.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BoB2usST.mjs.map → sdcorejs-angular-modules-pattern-routes-P9WvwSEW.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-_EDJ1-63.mjs +65 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-_EDJ1-63.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-n4kpjO0y.mjs +56 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-n4kpjO0y.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CJ6hUHjk.mjs → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-DHhmKKVI.mjs} +12 -12
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CJ6hUHjk.mjs.map → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-DHhmKKVI.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-C_AFK_9X.mjs → sdcorejs-angular-modules-pattern-shell.component-DxNC-ixx.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-C_AFK_9X.mjs.map → sdcorejs-angular-modules-pattern-shell.component-DxNC-ixx.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-TWYHj6in.mjs +480 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-TWYHj6in.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-B7H9pp-R.mjs → sdcorejs-angular-modules-pattern-update.component-BcBxBqWB.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-B7H9pp-R.mjs.map → sdcorejs-angular-modules-pattern-update.component-BcBxBqWB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Dhfba-qx.mjs → sdcorejs-angular-modules-pattern-update.component-BntTyV55.mjs} +9 -6
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BntTyV55.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-hRTu79uE.mjs → sdcorejs-angular-modules-pattern-update.component-CJjZWZuz.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-hRTu79uE.mjs.map → sdcorejs-angular-modules-pattern-update.component-CJjZWZuz.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +171 -158
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +34 -0
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-query-params.mjs +226 -0
- package/fesm2022/sdcorejs-angular-services-query-params.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +24 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
- package/forms/date/index.d.ts +2 -0
- package/forms/directives/index.d.ts +1 -1
- package/i18n/index.d.ts +159 -9
- package/modules/layout/index.d.ts +2 -1
- package/modules/pattern/README.md +5 -4
- package/modules/pattern/docs/detail.md +18 -9
- package/modules/pattern/docs/drawer.md +185 -83
- package/modules/pattern/docs/header-actions.md +1 -1
- package/modules/pattern/docs/list.md +3 -3
- package/modules/pattern/docs/states.md +1 -1
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +12 -16
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +58 -29
- package/modules/pattern/features/category/pages/list/list.component.html +11 -3
- package/modules/pattern/features/category/pages/list/list.component.ts +36 -10
- package/modules/pattern/features/category/routes.ts +5 -22
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +7 -11
- package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +70 -27
- package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +9 -53
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +53 -19
- package/modules/pattern/features/customer/entity.resolver.ts +1 -1
- package/modules/pattern/features/customer/pages/list/list.component.html +18 -3
- package/modules/pattern/features/customer/pages/list/list.component.ts +43 -16
- package/modules/pattern/features/customer/pages/profile/profile.component.ts +17 -8
- package/modules/pattern/features/customer/routes.ts +6 -27
- package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +37 -56
- package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +14 -76
- package/modules/pattern/features/order/pages/create/create.component.ts +7 -3
- package/modules/pattern/features/order/pages/detail/detail.component.ts +1 -1
- package/modules/pattern/features/order/pages/update/update.component.ts +5 -2
- package/package.json +17 -5
- package/services/confirm/index.d.ts +22 -81
- package/services/excel/index.d.ts +59 -0
- package/services/query-params/index.d.ts +67 -0
- package/utilities/extensions/index.d.ts +10 -1
- package/components/history/index.d.ts +0 -23
- package/fesm2022/sdcorejs-angular-components-history.mjs +0 -54
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CB4F9cBe.mjs +0 -144
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CB4F9cBe.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CowdEzyv.mjs +0 -145
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CowdEzyv.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-BCoG3bVV.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +0 -18
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bu6E63bN.mjs +0 -148
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bu6E63bN.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-B2Y0PbbC.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs +0 -87
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs +0 -232
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs +0 -70
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B3-th1z4.mjs +0 -164
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B3-th1z4.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CRttQEXa.mjs +0 -118
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CRttQEXa.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CeX57FPi.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-B8j8cieu.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CZusLcS3.mjs +0 -74
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CZusLcS3.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-Cq4BqjE9.mjs +0 -99
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-Cq4BqjE9.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-C74EEboR.mjs +0 -143
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-C74EEboR.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Dj9lvkCP.mjs +0 -132
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Dj9lvkCP.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Dhfba-qx.mjs.map +0 -1
- package/modules/pattern/features/category/entity.resolver.ts +0 -27
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, viewChild, computed, signal, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
|
|
5
|
-
import { map, firstValueFrom } from 'rxjs';
|
|
6
|
-
import { SdBadge } from '@sdcorejs/angular/components/badge';
|
|
7
|
-
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
8
|
-
import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
|
|
9
|
-
import { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';
|
|
10
|
-
import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
|
|
11
|
-
import { SdNotifyService } from '@sdcorejs/angular/services/notify';
|
|
12
|
-
import { a as apiErrorMessage } from './sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs';
|
|
13
|
-
import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-Caua6Xto.mjs';
|
|
14
|
-
import { c as customerStatusBadge, b as customerTypeName } from './sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs';
|
|
15
|
-
import { G as GeneralInformationViewComponent } from './sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Chi tiết khách hàng trong drawer (route con `:id/detail` của danh sách). Bản ghi do resolver tải bằng
|
|
19
|
-
* `detail(id)`, không lấy dữ liệu của dòng. Chỉ đóng bằng X (cùng Esc, backdrop): không có nút Đóng (E4).
|
|
20
|
-
* Xoá là tác vụ hiếm dùng và phá huỷ: nút chỉ có icon màu đỏ ở header, cạnh X; footer giữ tác vụ thường dùng.
|
|
21
|
-
*/
|
|
22
|
-
class DetailSideDrawerComponent {
|
|
23
|
-
#customerService = inject(CustomerService);
|
|
24
|
-
#confirm = inject(SdConfirmService);
|
|
25
|
-
#notify = inject(SdNotifyService);
|
|
26
|
-
#router = inject(Router);
|
|
27
|
-
#route = inject(ActivatedRoute);
|
|
28
|
-
drawer = viewChild.required(SdSideDrawer);
|
|
29
|
-
entity = toSignal(this.#route.data.pipe(map(data => data['entity'])), { requireSync: true });
|
|
30
|
-
badge = computed(() => customerStatusBadge(this.entity().status), ...(ngDevMode ? [{ debugName: "badge" }] : []));
|
|
31
|
-
typeName = computed(() => customerTypeName(this.entity().type), ...(ngDevMode ? [{ debugName: "typeName" }] : []));
|
|
32
|
-
deleting = signal(false, ...(ngDevMode ? [{ debugName: "deleting" }] : []));
|
|
33
|
-
constructor() {
|
|
34
|
-
afterNextRender(() => this.drawer().open());
|
|
35
|
-
}
|
|
36
|
-
closed() {
|
|
37
|
-
// X, Esc, backdrop đều qua sdClosed; về danh sách bằng điều hướng để Back của trình duyệt cũng đóng được.
|
|
38
|
-
// Sang drawer cập nhật hay hồ sơ 360° thì drawer này bị huỷ cùng route, không phát sdClosed.
|
|
39
|
-
void this.#router.navigate(['../..'], { relativeTo: this.#route });
|
|
40
|
-
}
|
|
41
|
-
async delete() {
|
|
42
|
-
const customer = this.entity();
|
|
43
|
-
try {
|
|
44
|
-
await this.#confirm.confirm(`Xoá khách hàng ${customer.name}? Thao tác không hoàn tác được.`, {
|
|
45
|
-
title: 'Xoá khách hàng',
|
|
46
|
-
yesTitle: 'Xoá',
|
|
47
|
-
noTitle: 'Không xoá',
|
|
48
|
-
yesButtonColor: 'error',
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.deleting.set(true);
|
|
55
|
-
try {
|
|
56
|
-
await firstValueFrom(this.#customerService.delete(customer.id));
|
|
57
|
-
this.#notify.success(`Đã xoá khách hàng ${customer.name}.`);
|
|
58
|
-
this.drawer().close();
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
this.#notify.error(apiErrorMessage(error, 'Không xoá được khách hàng.'));
|
|
62
|
-
}
|
|
63
|
-
finally {
|
|
64
|
-
this.deleting.set(false);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DetailSideDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.25", type: DetailSideDrawerComponent, isStandalone: true, selector: "detail-side-drawer", viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
69
|
-
@let customer = entity();
|
|
70
|
-
<sd-side-drawer width="600px" autoId="customer-detail" (sdClosed)="closed()">
|
|
71
|
-
<div sdHeaderLeft class="d-flex flex-column">
|
|
72
|
-
<div class="d-flex align-items-center gap-8">
|
|
73
|
-
<span class="T16M">Chi tiết khách hàng #{{ customer.code }}</span>
|
|
74
|
-
<sd-badge size="md" [type]="badge().type ?? 'round'" [title]="badge().title" [color]="badge().color" />
|
|
75
|
-
</div>
|
|
76
|
-
<span class="T14R text-secondary">{{ typeName() }} · {{ customer.phone }}</span>
|
|
77
|
-
</div>
|
|
78
|
-
<sd-button
|
|
79
|
-
sdHeaderRight
|
|
80
|
-
*sdPermission="'PATTERN_CUSTOMER_D_DELETE'"
|
|
81
|
-
prefixIcon="delete"
|
|
82
|
-
tooltip="Xoá khách hàng"
|
|
83
|
-
type="text"
|
|
84
|
-
color="error"
|
|
85
|
-
autoId="customer-delete"
|
|
86
|
-
[loading]="deleting()"
|
|
87
|
-
(click)="delete()" />
|
|
88
|
-
<general-information-view [customer]="customer" />
|
|
89
|
-
<div sdFooterRight class="d-flex align-items-center gap-8">
|
|
90
|
-
<sd-button title="Hồ sơ 360°" prefixIcon="contact_page" type="outline" autoId="customer-profile" [routerLink]="['../360']" />
|
|
91
|
-
<sd-button
|
|
92
|
-
*sdPermission="'PATTERN_CUSTOMER_U_UPDATE'"
|
|
93
|
-
title="Cập nhật khách hàng"
|
|
94
|
-
prefixIcon="edit"
|
|
95
|
-
type="fill"
|
|
96
|
-
color="primary"
|
|
97
|
-
autoId="customer-update"
|
|
98
|
-
[routerLink]="['../update']" />
|
|
99
|
-
</div>
|
|
100
|
-
</sd-side-drawer>
|
|
101
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "label", "description", "tooltip", "icon", "size", "pulse"], outputs: ["click"] }, { 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: "directive", type: SdPermissionDirective, selector: "[sdPermission]", inputs: ["sdPermission", "sdPermissionKey"] }, { kind: "component", type: GeneralInformationViewComponent, selector: "general-information-view", inputs: ["customer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
102
|
-
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DetailSideDrawerComponent, decorators: [{
|
|
104
|
-
type: Component,
|
|
105
|
-
args: [{
|
|
106
|
-
selector: 'detail-side-drawer',
|
|
107
|
-
standalone: true,
|
|
108
|
-
imports: [RouterLink, SdSideDrawer, SdBadge, SdButton, SdPermissionDirective, GeneralInformationViewComponent],
|
|
109
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
|
-
template: `
|
|
111
|
-
@let customer = entity();
|
|
112
|
-
<sd-side-drawer width="600px" autoId="customer-detail" (sdClosed)="closed()">
|
|
113
|
-
<div sdHeaderLeft class="d-flex flex-column">
|
|
114
|
-
<div class="d-flex align-items-center gap-8">
|
|
115
|
-
<span class="T16M">Chi tiết khách hàng #{{ customer.code }}</span>
|
|
116
|
-
<sd-badge size="md" [type]="badge().type ?? 'round'" [title]="badge().title" [color]="badge().color" />
|
|
117
|
-
</div>
|
|
118
|
-
<span class="T14R text-secondary">{{ typeName() }} · {{ customer.phone }}</span>
|
|
119
|
-
</div>
|
|
120
|
-
<sd-button
|
|
121
|
-
sdHeaderRight
|
|
122
|
-
*sdPermission="'PATTERN_CUSTOMER_D_DELETE'"
|
|
123
|
-
prefixIcon="delete"
|
|
124
|
-
tooltip="Xoá khách hàng"
|
|
125
|
-
type="text"
|
|
126
|
-
color="error"
|
|
127
|
-
autoId="customer-delete"
|
|
128
|
-
[loading]="deleting()"
|
|
129
|
-
(click)="delete()" />
|
|
130
|
-
<general-information-view [customer]="customer" />
|
|
131
|
-
<div sdFooterRight class="d-flex align-items-center gap-8">
|
|
132
|
-
<sd-button title="Hồ sơ 360°" prefixIcon="contact_page" type="outline" autoId="customer-profile" [routerLink]="['../360']" />
|
|
133
|
-
<sd-button
|
|
134
|
-
*sdPermission="'PATTERN_CUSTOMER_U_UPDATE'"
|
|
135
|
-
title="Cập nhật khách hàng"
|
|
136
|
-
prefixIcon="edit"
|
|
137
|
-
type="fill"
|
|
138
|
-
color="primary"
|
|
139
|
-
autoId="customer-update"
|
|
140
|
-
[routerLink]="['../update']" />
|
|
141
|
-
</div>
|
|
142
|
-
</sd-side-drawer>
|
|
143
|
-
`,
|
|
144
|
-
}]
|
|
145
|
-
}], ctorParameters: () => [], propDecorators: { drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
|
|
146
|
-
|
|
147
|
-
export { DetailSideDrawerComponent };
|
|
148
|
-
//# sourceMappingURL=sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bu6E63bN.mjs.map
|
package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bu6E63bN.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bu6E63bN.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts"],"sourcesContent":["import { afterNextRender, ChangeDetectionStrategy, Component, computed, inject, signal, viewChild } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { firstValueFrom, map } from 'rxjs';\nimport { SdBadge } from '@sdcorejs/angular/components/badge';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';\nimport { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';\nimport { SdConfirmService } from '@sdcorejs/angular/services/confirm';\nimport { SdNotifyService } from '@sdcorejs/angular/services/notify';\nimport { apiErrorMessage } from '../../../../utils/api-error';\nimport { CustomerService } from '../../services/customer.service';\nimport { customerStatusBadge, customerTypeName, type CustomerDto } from '../../services/customer.model';\nimport { GeneralInformationViewComponent } from '../general-information-view/general-information-view.component';\n\n/**\n * Chi tiết khách hàng trong drawer (route con `:id/detail` của danh sách). Bản ghi do resolver tải bằng\n * `detail(id)`, không lấy dữ liệu của dòng. Chỉ đóng bằng X (cùng Esc, backdrop): không có nút Đóng (E4).\n * Xoá là tác vụ hiếm dùng và phá huỷ: nút chỉ có icon màu đỏ ở header, cạnh X; footer giữ tác vụ thường dùng.\n */\n@Component({\n selector: 'detail-side-drawer',\n standalone: true,\n imports: [RouterLink, SdSideDrawer, SdBadge, SdButton, SdPermissionDirective, GeneralInformationViewComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @let customer = entity();\n <sd-side-drawer width=\"600px\" autoId=\"customer-detail\" (sdClosed)=\"closed()\">\n <div sdHeaderLeft class=\"d-flex flex-column\">\n <div class=\"d-flex align-items-center gap-8\">\n <span class=\"T16M\">Chi tiết khách hàng #{{ customer.code }}</span>\n <sd-badge size=\"md\" [type]=\"badge().type ?? 'round'\" [title]=\"badge().title\" [color]=\"badge().color\" />\n </div>\n <span class=\"T14R text-secondary\">{{ typeName() }} · {{ customer.phone }}</span>\n </div>\n <sd-button\n sdHeaderRight\n *sdPermission=\"'PATTERN_CUSTOMER_D_DELETE'\"\n prefixIcon=\"delete\"\n tooltip=\"Xoá khách hàng\"\n type=\"text\"\n color=\"error\"\n autoId=\"customer-delete\"\n [loading]=\"deleting()\"\n (click)=\"delete()\" />\n <general-information-view [customer]=\"customer\" />\n <div sdFooterRight class=\"d-flex align-items-center gap-8\">\n <sd-button title=\"Hồ sơ 360°\" prefixIcon=\"contact_page\" type=\"outline\" autoId=\"customer-profile\" [routerLink]=\"['../360']\" />\n <sd-button\n *sdPermission=\"'PATTERN_CUSTOMER_U_UPDATE'\"\n title=\"Cập nhật khách hàng\"\n prefixIcon=\"edit\"\n type=\"fill\"\n color=\"primary\"\n autoId=\"customer-update\"\n [routerLink]=\"['../update']\" />\n </div>\n </sd-side-drawer>\n `,\n})\nexport class DetailSideDrawerComponent {\n readonly #customerService = inject(CustomerService);\n readonly #confirm = inject(SdConfirmService);\n readonly #notify = inject(SdNotifyService);\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n private readonly drawer = viewChild.required(SdSideDrawer);\n protected readonly entity = toSignal(this.#route.data.pipe(map(data => data['entity'] as CustomerDto)), { requireSync: true });\n protected readonly badge = computed(() => customerStatusBadge(this.entity().status));\n protected readonly typeName = computed(() => customerTypeName(this.entity().type));\n protected readonly deleting = signal(false);\n\n constructor() {\n afterNextRender(() => this.drawer().open());\n }\n\n protected closed(): void {\n // X, Esc, backdrop đều qua sdClosed; về danh sách bằng điều hướng để Back của trình duyệt cũng đóng được.\n // Sang drawer cập nhật hay hồ sơ 360° thì drawer này bị huỷ cùng route, không phát sdClosed.\n void this.#router.navigate(['../..'], { relativeTo: this.#route });\n }\n\n protected async delete(): Promise<void> {\n const customer = this.entity();\n try {\n await this.#confirm.confirm(`Xoá khách hàng ${customer.name}? Thao tác không hoàn tác được.`, {\n title: 'Xoá khách hàng',\n yesTitle: 'Xoá',\n noTitle: 'Không xoá',\n yesButtonColor: 'error',\n });\n } catch {\n return;\n }\n this.deleting.set(true);\n try {\n await firstValueFrom(this.#customerService.delete(customer.id));\n this.#notify.success(`Đã xoá khách hàng ${customer.name}.`);\n this.drawer().close();\n } catch (error) {\n this.#notify.error(apiErrorMessage(error, 'Không xoá được khách hàng.'));\n } finally {\n this.deleting.set(false);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA;;;;AAIG;MAyCU,yBAAyB,CAAA;AAC3B,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;AAC1C,IAAA,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACnC,IAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AACjC,IAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AACvB,IAAA,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;AACvC,IAAA,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAgB,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC3G,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,iDAAC;AACjE,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,oDAAC;AAC/D,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AAE3C,IAAA,WAAA,GAAA;AACE,QAAA,eAAe,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7C;IAEU,MAAM,GAAA;;;AAGd,QAAA,KAAK,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACpE;AA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AAA,EAAE,+BAA+B,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAqClG,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAxCrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,+BAA+B,CAAC;oBAC9G,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA;AACF,iBAAA;kHAO8C,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-modules-pattern-detail.component-B2Y0PbbC.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/pipes/customer-detail.pipe.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/product/pipes/product-detail.pipe.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/components/lines-view/lines-view.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/order/pages/detail/detail.component.ts"],"sourcesContent":["import { inject, Pipe, type PipeTransform } from '@angular/core';\nimport { of, type Observable } from 'rxjs';\nimport { CustomerService } from '../services/customer.service';\nimport type { CustomerDto } from '../services/customer.model';\n\n/**\n * Relation khách hàng theo ID: `@let customer = order.customerId | customerDetail | async;`.\n * CustomerService cache và chia sẻ request theo ID; nơi dùng pipe phải có CustomerService trong injector.\n */\n@Pipe({ name: 'customerDetail', standalone: true })\nexport class CustomerDetailPipe implements PipeTransform {\n readonly #customerService = inject(CustomerService);\n\n transform(id: CustomerDto['id'] | null | undefined): Observable<CustomerDto | null> {\n if (id === null || id === undefined || id === '') return of(null);\n return this.#customerService.cachedDetail(id);\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdFormatDatetimePipe } from '@sdcorejs/angular/pipes';\nimport type { OrderApprovalStepDto } from '../../services/order.model';\n\nconst ACTION_NAME: Readonly<Record<OrderApprovalStepDto['action'], string>> = {\n submit: 'Gửi duyệt',\n approve: 'Duyệt',\n reject: 'Từ chối',\n};\n\n/** Quy trình duyệt của đơn, mới nhất ở cuối; dùng ở cột phụ của trang chi tiết. */\n@Component({\n selector: 'approval-steps',\n standalone: true,\n imports: [SdSection, SdFormatDatetimePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Quy trình duyệt\">\n <ol class=\"approval-steps\">\n <li class=\"approval-steps__item approval-steps__item--done\">\n <span class=\"T14M\">Tạo đơn</span>\n </li>\n @for (step of steps(); track $index) {\n <li class=\"approval-steps__item\" [class.approval-steps__item--rejected]=\"step.action === 'reject'\">\n <span class=\"T14M\">{{ actionName[step.action] }}</span>\n <span class=\"T12R text-secondary\">{{ step.by }} · {{ step.at | sdFormatDatetime }}</span>\n @if (step.reason) {\n <span class=\"T12R\">Lý do: {{ step.reason }}</span>\n }\n </li>\n } @empty {\n <li class=\"approval-steps__item approval-steps__item--pending\">\n <span class=\"T12R text-secondary\">Chưa gửi duyệt</span>\n </li>\n }\n </ol>\n </sd-section>\n `,\n styles: `\n .approval-steps {\n margin: 0;\n padding: 16px 16px 16px 32px;\n list-style: none;\n }\n .approval-steps__item {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding-bottom: 16px;\n }\n .approval-steps__item::before {\n content: '';\n position: absolute;\n top: 4px;\n left: -18px;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--sd-primary);\n }\n .approval-steps__item--rejected::before {\n background: var(--sd-error, currentColor);\n }\n .approval-steps__item--pending::before {\n background: var(--sd-border-strong);\n }\n `,\n})\nexport class ApprovalStepsComponent {\n readonly steps = input.required<readonly OrderApprovalStepDto[]>();\n protected readonly actionName = ACTION_NAME;\n}\n","import { inject, Pipe, type PipeTransform } from '@angular/core';\nimport { of, type Observable } from 'rxjs';\nimport { ProductService } from '../services/product.service';\nimport type { ProductDto } from '../services/product.model';\n\n/**\n * Relation sản phẩm theo ID: `@let product = line.productId | productDetail | async;`.\n * ProductService cache và chia sẻ request theo ID; nơi dùng pipe phải có ProductService trong injector.\n */\n@Pipe({ name: 'productDetail', standalone: true })\nexport class ProductDetailPipe implements PipeTransform {\n readonly #productService = inject(ProductService);\n\n transform(id: ProductDto['id'] | null | undefined): Observable<ProductDto | null> {\n if (id === null || id === undefined || id === '') return of(null);\n return this.#productService.cachedDetail(id);\n }\n}\n","import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdTable, SdTableCellDefDirective, type SdTableOption } from '@sdcorejs/angular/components/table';\nimport { ProductDetailPipe } from '../../../product/pipes/product-detail.pipe';\nimport type { OrderLineDto } from '../../services/order.model';\n\n/** Dòng hàng chỉ đọc; tên sản phẩm lấy qua relation `productDetail`, không hiện ID thô. */\n@Component({\n selector: 'lines-view',\n standalone: true,\n imports: [AsyncPipe, SdSection, SdTable, SdTableCellDefDirective, ProductDetailPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Dòng hàng\">\n <sd-table autoId=\"order-lines\" [option]=\"option()\">\n <ng-template sdTableCellDef=\"productId\" let-line=\"item\">\n @let product = line.productId | productDetail | async;\n {{ product?.name ?? '…' }}\n </ng-template>\n </sd-table>\n </sd-section>\n `,\n})\nexport class LinesViewComponent {\n readonly lines = input.required<readonly OrderLineDto[]>();\n protected readonly option = computed<SdTableOption<OrderLineDto & { amount: number }>>(() => {\n const items = this.lines().map(line => ({ ...line, amount: line.quantity * line.unitPrice }));\n return {\n type: 'local',\n items: () => items,\n paginate: { pageSize: 50 },\n filter: { hideInlineFilter: 'auto' },\n columns: [\n { field: 'productId', title: 'Sản phẩm', type: 'string', minWidth: '200px' },\n { field: 'quantity', title: 'Số lượng', type: 'number', width: '110px', align: 'right' },\n { field: 'unitPrice', title: 'Đơn giá (₫)', type: 'number', width: '140px', align: 'right' },\n { field: 'amount', title: 'Thành tiền (₫)', type: 'number', width: '150px', align: 'right' },\n ],\n };\n });\n}\n","import { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { afterNextRender, ChangeDetectionStrategy, Component, computed, inject, linkedSignal, signal, viewChild } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { firstValueFrom, map } from 'rxjs';\nimport { SdBadge } from '@sdcorejs/angular/components/badge';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdSection, SdSectionItem } from '@sdcorejs/angular/components/section';\nimport { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';\nimport { SdView } from '@sdcorejs/angular/components/view';\nimport { SD_PAGE_LIST, SdPageComponent } from '@sdcorejs/angular/modules/layout';\nimport { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';\nimport { SdEmptyPipe, SdFormatDatePipe, SdFormatDatetimePipe, SdFormatNumberPipe } from '@sdcorejs/angular/pipes';\nimport { SdConfirmService } from '@sdcorejs/angular/services/confirm';\nimport { SdNotifyService } from '@sdcorejs/angular/services/notify';\nimport { apiErrorMessage } from '../../../../utils/api-error';\nimport { CustomerDetailPipe } from '../../../customer/pipes/customer-detail.pipe';\nimport { ApprovalStepsComponent } from '../../components/approval-steps/approval-steps.component';\nimport { LinesViewComponent } from '../../components/lines-view/lines-view.component';\nimport { OrderService } from '../../services/order.service';\nimport { canUpdateOrder, orderApprovalBadge, orderStatusBadge, type OrderAction, type OrderDto } from '../../services/order.model';\n\n/**\n * Chi tiết đơn (`:id/detail`, route con của danh sách). Mở trong drawer 600px hoặc trang `sd-page-detail` theo\n * `detail` của `sd-page-list`. Gửi duyệt, Duyệt và Từ chối đều hỏi xác nhận; Từ chối bắt buộc lý do (E13).\n */\n@Component({\n selector: 'detail',\n standalone: true,\n imports: [\n AsyncPipe,\n NgTemplateOutlet,\n RouterLink,\n SdPageComponent,\n SdSideDrawer,\n SdBadge,\n SdButton,\n SdSection,\n SdSectionItem,\n SdView,\n SdPermissionDirective,\n SdEmptyPipe,\n SdFormatDatePipe,\n SdFormatDatetimePipe,\n SdFormatNumberPipe,\n CustomerDetailPipe,\n ApprovalStepsComponent,\n LinesViewComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @let order = entity();\n @let customer = order.customerId | customerDetail | async;\n <ng-template #actions>\n @if (order.approval === 'submitted') {\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_U_REJECT'\"\n title=\"Từ chối\"\n prefixIcon=\"close\"\n type=\"light\"\n color=\"warning\"\n autoId=\"order-reject\"\n [disabled]=\"pending()\"\n (click)=\"act('reject')\" />\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_U_APPROVE'\"\n title=\"Duyệt\"\n prefixIcon=\"check\"\n type=\"fill\"\n color=\"success\"\n autoId=\"order-approve\"\n [disabled]=\"pending()\"\n (click)=\"act('approve')\" />\n }\n @if (editable()) {\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_U_SUBMIT'\"\n title=\"Gửi duyệt\"\n prefixIcon=\"send\"\n type=\"outline\"\n autoId=\"order-submit\"\n [disabled]=\"pending()\"\n (click)=\"act('submit')\" />\n <sd-button\n *sdPermission=\"'PATTERN_ORDER_U_UPDATE'\"\n title=\"Cập nhật đơn hàng\"\n prefixIcon=\"edit\"\n type=\"fill\"\n color=\"primary\"\n autoId=\"order-update\"\n [disabled]=\"pending()\"\n [routerLink]=\"['../update']\" />\n }\n </ng-template>\n\n @if (mode() === 'drawer') {\n <sd-side-drawer width=\"600px\" autoId=\"order-detail\" (sdClosed)=\"closed()\">\n <div sdHeaderLeft class=\"d-flex align-items-center gap-8\">\n <span class=\"T16M\">Đơn hàng {{ order.code }}</span>\n <sd-badge size=\"md\" type=\"round\" [title]=\"statusBadge().title\" [color]=\"statusBadge().color\" />\n </div>\n <sd-section title=\"Thông tin chung\">\n <sd-section-item label=\"Khách hàng\">{{ order.customer }}</sd-section-item>\n <sd-section-item label=\"Kênh bán\">{{ order.channel }}</sd-section-item>\n <sd-section-item label=\"Kho xuất\">{{ order.warehouse }}</sd-section-item>\n <sd-section-item label=\"Thanh toán\">{{ order.payment }}</sd-section-item>\n <sd-section-item label=\"Ngày tạo\">{{ order.createdAt | sdFormatDatetime }}</sd-section-item>\n <sd-section-item label=\"Tổng tiền (₫)\">{{ order.total | sdFormatNumber: 0 }}</sd-section-item>\n <sd-section-item label=\"Trạng thái\">\n <div class=\"d-flex align-items-center gap-8 flex-wrap\">\n @for (badge of badges(); track $index) {\n <sd-badge [type]=\"badge.type\" [title]=\"badge.title\" [color]=\"badge.color\" />\n }\n </div>\n </sd-section-item>\n </sd-section>\n <div sdFooterRight class=\"d-flex align-items-center gap-8 flex-wrap\">\n <ng-container [ngTemplateOutlet]=\"actions\" />\n </div>\n </sd-side-drawer>\n } @else {\n <sd-page-detail\n [title]=\"'Chi tiết đơn hàng #' + order.code\"\n [description]=\"order.customer + ' · ' + order.channel\"\n [badges]=\"badges()\"\n [backLink]=\"['../..']\">\n <div headerRight class=\"d-flex align-items-center gap-8 flex-wrap\">\n <ng-container [ngTemplateOutlet]=\"actions\" />\n </div>\n <div class=\"d-flex flex-column gap-16 py-16\">\n <sd-section title=\"Thông tin chung\">\n <div class=\"row p-8\">\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Khách hàng\" [display]=\"order.customer\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Điện thoại\" [display]=\"customer?.phone\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Kênh bán\" [display]=\"order.channel\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Kho xuất\" [display]=\"order.warehouse\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Thanh toán\" [display]=\"order.payment\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Ngày tạo\" [display]=\"order.createdAt | sdFormatDatetime\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Ngày giao\" [display]=\"order.deliveredAt | sdFormatDate\" /></div>\n <div class=\"col-12 col-md-6 p-8\"><sd-view label=\"Mã vận đơn\" [display]=\"order.tracking\" /></div>\n </div>\n </sd-section>\n <lines-view [lines]=\"order.lines\" />\n <sd-section title=\"Thông tin phê duyệt\">\n <sd-section-item label=\"Trạng thái duyệt\">\n <sd-badge [type]=\"approvalBadge().type\" [title]=\"approvalBadge().title\" [color]=\"approvalBadge().color\" />\n </sd-section-item>\n <sd-section-item label=\"Người gửi duyệt\">{{ submitted()?.by | sdEmpty }}</sd-section-item>\n <sd-section-item label=\"Người duyệt\">{{ decided()?.by | sdEmpty }}</sd-section-item>\n <sd-section-item label=\"Lý do từ chối\">{{ decided()?.reason | sdEmpty }}</sd-section-item>\n <sd-section-item label=\"Ghi chú\">{{ order.note | sdEmpty }}</sd-section-item>\n </sd-section>\n </div>\n <approval-steps sdAside [steps]=\"order.approvalHistory\" />\n </sd-page-detail>\n }\n `,\n})\nexport class DetailComponent {\n readonly #orderService = inject(OrderService);\n readonly #confirm = inject(SdConfirmService);\n readonly #notify = inject(SdNotifyService);\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n private readonly drawer = viewChild(SdSideDrawer);\n protected readonly mode = inject(SD_PAGE_LIST).detail;\n readonly #resolved = toSignal(this.#route.data.pipe(map(data => data['entity'] as OrderDto)), { requireSync: true });\n /** Đơn do resolver tải; sau mỗi tác vụ thay bằng đơn API trả về. */\n protected readonly entity = linkedSignal(() => this.#resolved());\n protected readonly pending = signal(false);\n protected readonly statusBadge = computed(() => orderStatusBadge(this.entity().status));\n protected readonly approvalBadge = computed(() => orderApprovalBadge(this.entity().approval));\n /** Trạng thái đơn và trạng thái duyệt: title của trang, dòng \"Trạng thái\" của drawer. */\n protected readonly badges = computed(() => [this.statusBadge(), this.approvalBadge()]);\n protected readonly editable = computed(() => canUpdateOrder(this.entity()));\n protected readonly submitted = computed(() => [...this.entity().approvalHistory].reverse().find(step => step.action === 'submit'));\n protected readonly decided = computed(() =>\n this.entity().approval === 'approved' || this.entity().approval === 'rejected' ? this.entity().approvalHistory.at(-1) : undefined\n );\n\n constructor() {\n afterNextRender(() => this.drawer()?.open());\n }\n\n protected closed(): void {\n void this.#router.navigate(['../..'], { relativeTo: this.#route });\n }\n\n /** Hỏi xác nhận (Từ chối kèm lý do), gọi API, rồi hiển thị đơn mới; lỗi giữ nguyên màn để thử lại. */\n protected async act(action: Extract<OrderAction, 'submit' | 'approve' | 'reject'>): Promise<void> {\n const order = this.entity();\n let reason: string | undefined;\n try {\n if (action === 'reject') {\n reason = await this.#confirm.withInput(`Từ chối đơn ${order.code}. Lý do được gửi cho người lập đơn.`, {\n title: 'Từ chối đơn hàng',\n label: 'Lý do từ chối',\n required: true,\n maxlength: 200,\n yesTitle: 'Từ chối',\n noTitle: 'Không',\n yesButtonColor: 'warning',\n });\n } else {\n await this.#confirm.confirm(action === 'approve' ? `Duyệt đơn ${order.code}?` : `Gửi đơn ${order.code} cho người duyệt?`, {\n title: action === 'approve' ? 'Duyệt đơn hàng' : 'Gửi duyệt',\n yesTitle: action === 'approve' ? 'Duyệt' : 'Gửi duyệt',\n noTitle: 'Không',\n });\n }\n } catch {\n return;\n }\n this.pending.set(true);\n try {\n this.entity.set(await firstValueFrom(this.#orderService.act(action, { id: order.id, reason })));\n this.#notify.success(action === 'approve' ? 'Đã duyệt đơn.' : action === 'reject' ? 'Đã từ chối đơn.' : 'Đã gửi duyệt.');\n } catch (error) {\n this.#notify.error(apiErrorMessage(error));\n } finally {\n this.pending.set(false);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA;;;AAGG;MAEU,kBAAkB,CAAA;AACpB,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;AAEnD,IAAA,SAAS,CAAC,EAAwC,EAAA;QAChD,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE;AAAE,YAAA,OAAO,EAAE,CAAC,IAAI,CAAC;QACjE,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC;IAC/C;wGANW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;sGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,gBAAA,EAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE;;;ACJlD,MAAM,WAAW,GAA6D;AAC5E,IAAA,MAAM,EAAE,WAAW;AACnB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,MAAM,EAAE,SAAS;CAClB;AAED;MA2Da,sBAAsB,CAAA;AACxB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAmC;IAC/C,UAAU,GAAG,WAAW;wGAFhC,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GT,EAAA,CAAA;AACF,iBAAA;kHAOqC,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
4
|
-
import { SdView } from '@sdcorejs/angular/components/view';
|
|
5
|
-
import { SdInput } from '@sdcorejs/angular/forms/input';
|
|
6
|
-
import { SdSwitch } from '@sdcorejs/angular/forms/switch';
|
|
7
|
-
|
|
8
|
-
/** Giá trị form → request lưu; danh mục cha do drawer quyết định, không sửa trong form. */
|
|
9
|
-
function categorySaveReq(form, parentId, code) {
|
|
10
|
-
const value = form.getRawValue();
|
|
11
|
-
return { code: code ?? value.code ?? '', name: value.name ?? '', parentId, status: value.active === false ? 'inactive' : 'active' };
|
|
12
|
-
}
|
|
13
|
-
/** Form danh mục một nhóm, dùng chung cho drawer tạo và cập nhật. */
|
|
14
|
-
class GeneralInformationFormComponent {
|
|
15
|
-
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
16
|
-
seed = input.required(...(ngDevMode ? [{ debugName: "seed" }] : []));
|
|
17
|
-
parentName = input(null, ...(ngDevMode ? [{ debugName: "parentName" }] : []));
|
|
18
|
-
editing = input(false, ...(ngDevMode ? [{ debugName: "editing" }] : []));
|
|
19
|
-
errors = input({}, ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
20
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GeneralInformationFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", 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 }, parentName: { classPropertyName: "parentName", publicName: "parentName", isSignal: true, isRequired: false, transformFunction: null }, editing: { classPropertyName: "editing", publicName: "editing", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
22
|
-
<sd-section title="Thông tin chung">
|
|
23
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
24
|
-
<sd-view label="Danh mục cha" [display]="parentName()" />
|
|
25
|
-
<sd-input
|
|
26
|
-
label="Mã danh mục"
|
|
27
|
-
name="code"
|
|
28
|
-
autoId="category-code"
|
|
29
|
-
[form]="form()"
|
|
30
|
-
[model]="seed().code"
|
|
31
|
-
[disabled]="editing()"
|
|
32
|
-
[inlineError]="errors()['code']"
|
|
33
|
-
maxlength="30"
|
|
34
|
-
required />
|
|
35
|
-
<sd-input
|
|
36
|
-
label="Tên danh mục"
|
|
37
|
-
name="name"
|
|
38
|
-
autoId="category-name"
|
|
39
|
-
[form]="form()"
|
|
40
|
-
[model]="seed().name"
|
|
41
|
-
[inlineError]="errors()['name']"
|
|
42
|
-
maxlength="100"
|
|
43
|
-
required />
|
|
44
|
-
<sd-switch label="Đang dùng" name="active" [form]="form()" [model]="seed().status !== 'inactive'" />
|
|
45
|
-
</div>
|
|
46
|
-
</sd-section>
|
|
47
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSwitch, selector: "sd-switch", inputs: ["autoId", "name", "form", "label", "size", "color", "disabled", "viewed", "hideInlineError", "required", "model"], outputs: ["modelChange", "sdChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
|
-
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GeneralInformationFormComponent, decorators: [{
|
|
50
|
-
type: Component,
|
|
51
|
-
args: [{
|
|
52
|
-
selector: 'general-information-form',
|
|
53
|
-
standalone: true,
|
|
54
|
-
imports: [SdSection, SdView, SdInput, SdSwitch],
|
|
55
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
56
|
-
template: `
|
|
57
|
-
<sd-section title="Thông tin chung">
|
|
58
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
59
|
-
<sd-view label="Danh mục cha" [display]="parentName()" />
|
|
60
|
-
<sd-input
|
|
61
|
-
label="Mã danh mục"
|
|
62
|
-
name="code"
|
|
63
|
-
autoId="category-code"
|
|
64
|
-
[form]="form()"
|
|
65
|
-
[model]="seed().code"
|
|
66
|
-
[disabled]="editing()"
|
|
67
|
-
[inlineError]="errors()['code']"
|
|
68
|
-
maxlength="30"
|
|
69
|
-
required />
|
|
70
|
-
<sd-input
|
|
71
|
-
label="Tên danh mục"
|
|
72
|
-
name="name"
|
|
73
|
-
autoId="category-name"
|
|
74
|
-
[form]="form()"
|
|
75
|
-
[model]="seed().name"
|
|
76
|
-
[inlineError]="errors()['name']"
|
|
77
|
-
maxlength="100"
|
|
78
|
-
required />
|
|
79
|
-
<sd-switch label="Đang dùng" name="active" [form]="form()" [model]="seed().status !== 'inactive'" />
|
|
80
|
-
</div>
|
|
81
|
-
</sd-section>
|
|
82
|
-
`,
|
|
83
|
-
}]
|
|
84
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], seed: [{ type: i0.Input, args: [{ isSignal: true, alias: "seed", required: true }] }], parentName: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentName", required: false }] }], editing: [{ type: i0.Input, args: [{ isSignal: true, alias: "editing", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }] } });
|
|
85
|
-
|
|
86
|
-
export { GeneralInformationFormComponent as G, categorySaveReq as c };
|
|
87
|
-
//# sourceMappingURL=sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-modules-pattern-general-information-form.component-BRsdOwWy.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport type { FormControl, FormGroup } from '@angular/forms';\nimport { SdSection } from '@sdcorejs/angular/components/section';\nimport { SdView } from '@sdcorejs/angular/components/view';\nimport { SdInput } from '@sdcorejs/angular/forms/input';\nimport { SdSwitch } from '@sdcorejs/angular/forms/switch';\nimport type { CategorySaveReq } from '../../services/category.model';\n\nexport type CategoryForm = FormGroup<{\n code?: FormControl<string>;\n name?: FormControl<string>;\n active?: FormControl<boolean>;\n}>;\n\n/** Giá trị form → request lưu; danh mục cha do drawer quyết định, không sửa trong form. */\nexport function categorySaveReq(form: CategoryForm, parentId: string | null, code?: string): CategorySaveReq {\n const value = form.getRawValue();\n return { code: code ?? value.code ?? '', name: value.name ?? '', parentId, status: value.active === false ? 'inactive' : 'active' };\n}\n\n/** Form danh mục một nhóm, dùng chung cho drawer tạo và cập nhật. */\n@Component({\n selector: 'general-information-form',\n standalone: true,\n imports: [SdSection, SdView, SdInput, SdSwitch],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-section title=\"Thông tin chung\">\n <div class=\"d-flex flex-column gap-8 p-16\">\n <sd-view label=\"Danh mục cha\" [display]=\"parentName()\" />\n <sd-input\n label=\"Mã danh mục\"\n name=\"code\"\n autoId=\"category-code\"\n [form]=\"form()\"\n [model]=\"seed().code\"\n [disabled]=\"editing()\"\n [inlineError]=\"errors()['code']\"\n maxlength=\"30\"\n required />\n <sd-input\n label=\"Tên danh mục\"\n name=\"name\"\n autoId=\"category-name\"\n [form]=\"form()\"\n [model]=\"seed().name\"\n [inlineError]=\"errors()['name']\"\n maxlength=\"100\"\n required />\n <sd-switch label=\"Đang dùng\" name=\"active\" [form]=\"form()\" [model]=\"seed().status !== 'inactive'\" />\n </div>\n </sd-section>\n `,\n})\nexport class GeneralInformationFormComponent {\n readonly form = input.required<CategoryForm>();\n readonly seed = input.required<CategorySaveReq>();\n readonly parentName = input<string | null>(null);\n readonly editing = input(false);\n readonly errors = input<Readonly<Record<string, string>>>({});\n}\n"],"names":[],"mappings":";;;;;;;AAcA;SACgB,eAAe,CAAC,IAAkB,EAAE,QAAuB,EAAE,IAAa,EAAA;AACxF,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE;AAChC,IAAA,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,C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U,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;oBAC/C,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, ChangeDetectionStrategy, Component, linkedSignal } from '@angular/core';
|
|
3
|
-
import { SdInform } from '@sdcorejs/angular/components/inform';
|
|
4
|
-
import { SdSection } from '@sdcorejs/angular/components/section';
|
|
5
|
-
import { SdInput } from '@sdcorejs/angular/forms/input';
|
|
6
|
-
import { SdSwitch } from '@sdcorejs/angular/forms/switch';
|
|
7
|
-
import { SdTextarea } from '@sdcorejs/angular/forms/textarea';
|
|
8
|
-
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
9
|
-
import { C as CUSTOMER_TYPE_OPTIONS } from './sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs';
|
|
10
|
-
|
|
11
|
-
/** Dropdown loại khách hàng. */
|
|
12
|
-
class CustomerTypeSelectComponent {
|
|
13
|
-
form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : []));
|
|
14
|
-
name = input('type', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
15
|
-
label = input('Loại khách hàng', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
16
|
-
required = input(true, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
17
|
-
model = model(...(ngDevMode ? [undefined, { debugName: "model" }] : []));
|
|
18
|
-
options = CUSTOMER_TYPE_OPTIONS;
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CustomerTypeSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: CustomerTypeSelectComponent, isStandalone: true, selector: "customer-type-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 }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange" }, ngImport: i0, template: `<sd-select
|
|
21
|
-
[label]="label()"
|
|
22
|
-
[name]="name()"
|
|
23
|
-
[form]="form()"
|
|
24
|
-
[(model)]="model"
|
|
25
|
-
[items]="options"
|
|
26
|
-
valueField="id"
|
|
27
|
-
displayField="name"
|
|
28
|
-
[required]="required()"
|
|
29
|
-
[clearable]="false" />`, 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
30
|
-
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: CustomerTypeSelectComponent, decorators: [{
|
|
32
|
-
type: Component,
|
|
33
|
-
args: [{
|
|
34
|
-
selector: 'customer-type-select',
|
|
35
|
-
standalone: true,
|
|
36
|
-
imports: [SdSelect],
|
|
37
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
38
|
-
template: `<sd-select
|
|
39
|
-
[label]="label()"
|
|
40
|
-
[name]="name()"
|
|
41
|
-
[form]="form()"
|
|
42
|
-
[(model)]="model"
|
|
43
|
-
[items]="options"
|
|
44
|
-
valueField="id"
|
|
45
|
-
displayField="name"
|
|
46
|
-
[required]="required()"
|
|
47
|
-
[clearable]="false" />`,
|
|
48
|
-
}]
|
|
49
|
-
}], 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 }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }] } });
|
|
50
|
-
|
|
51
|
-
const GROUP_FIELDS = {
|
|
52
|
-
general: ['name', 'type', 'taxCode', 'vip'],
|
|
53
|
-
contact: ['email', 'phone', 'address'],
|
|
54
|
-
other: ['active', 'note'],
|
|
55
|
-
};
|
|
56
|
-
/** Nhóm có field không hợp lệ: field còn lỗi validate hoặc lỗi do API trả về. */
|
|
57
|
-
function invalidCustomerGroups(form, apiErrors) {
|
|
58
|
-
return Object.keys(GROUP_FIELDS).filter(group => GROUP_FIELDS[group].some(field => form.get(field)?.invalid || !!apiErrors[field]));
|
|
59
|
-
}
|
|
60
|
-
/** Giá trị form → request lưu. */
|
|
61
|
-
function customerSaveReq(form) {
|
|
62
|
-
const value = form.getRawValue();
|
|
63
|
-
const type = value.type ?? 'individual';
|
|
64
|
-
const tier = value.vip ? 'vip' : 'standard';
|
|
65
|
-
const status = value.active === false ? 'inactive' : 'active';
|
|
66
|
-
return {
|
|
67
|
-
name: value.name ?? '',
|
|
68
|
-
type,
|
|
69
|
-
tier,
|
|
70
|
-
email: value.email ?? '',
|
|
71
|
-
phone: value.phone ?? '',
|
|
72
|
-
address: value.address ?? '',
|
|
73
|
-
taxCode: type === 'business' ? (value.taxCode ?? null) : null,
|
|
74
|
-
status,
|
|
75
|
-
note: value.note || null,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
/** Form khách hàng ba nhóm, dùng chung cho drawer tạo mới và cập nhật. */
|
|
79
|
-
class GeneralInformationFormComponent {
|
|
80
|
-
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
81
|
-
seed = input.required(...(ngDevMode ? [{ debugName: "seed" }] : []));
|
|
82
|
-
/** Lỗi theo field do API trả về. */
|
|
83
|
-
errors = input({}, ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
84
|
-
invalidGroups = input([], ...(ngDevMode ? [{ debugName: "invalidGroups" }] : []));
|
|
85
|
-
/** Loại khách đang chọn: doanh nghiệp mới có mã số thuế. */
|
|
86
|
-
type = linkedSignal(() => this.seed().type, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
87
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GeneralInformationFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", 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 }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, invalidGroups: { classPropertyName: "invalidGroups", publicName: "invalidGroups", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
89
|
-
@let invalid = invalidGroups();
|
|
90
|
-
<div class="d-flex flex-column gap-16">
|
|
91
|
-
<sd-section title="Thông tin chung">
|
|
92
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
93
|
-
@if (invalid.includes('general')) {
|
|
94
|
-
<sd-inform warning description="Kiểm tra tên và loại khách hàng." autoId="customer-general-warning" />
|
|
95
|
-
}
|
|
96
|
-
<sd-input
|
|
97
|
-
label="Tên khách hàng"
|
|
98
|
-
name="name"
|
|
99
|
-
autoId="customer-name"
|
|
100
|
-
[form]="form()"
|
|
101
|
-
[model]="seed().name"
|
|
102
|
-
[inlineError]="errors()['name']"
|
|
103
|
-
maxlength="120"
|
|
104
|
-
required />
|
|
105
|
-
<customer-type-select [form]="form()" [model]="seed().type" (modelChange)="type.set($event ?? 'individual')" />
|
|
106
|
-
@if (type() === 'business') {
|
|
107
|
-
<sd-input
|
|
108
|
-
label="Mã số thuế"
|
|
109
|
-
name="taxCode"
|
|
110
|
-
autoId="customer-tax-code"
|
|
111
|
-
[form]="form()"
|
|
112
|
-
[model]="seed().taxCode"
|
|
113
|
-
[inlineError]="errors()['taxCode']"
|
|
114
|
-
maxlength="14"
|
|
115
|
-
required />
|
|
116
|
-
}
|
|
117
|
-
<sd-switch label="Khách VIP" name="vip" [form]="form()" [model]="seed().tier === 'vip'" />
|
|
118
|
-
</div>
|
|
119
|
-
</sd-section>
|
|
120
|
-
<sd-section title="Liên hệ">
|
|
121
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
122
|
-
@if (invalid.includes('contact')) {
|
|
123
|
-
<sd-inform warning description="Kiểm tra email và số điện thoại." autoId="customer-contact-warning" />
|
|
124
|
-
}
|
|
125
|
-
<sd-input
|
|
126
|
-
label="Email"
|
|
127
|
-
name="email"
|
|
128
|
-
autoId="customer-email"
|
|
129
|
-
[form]="form()"
|
|
130
|
-
[model]="seed().email"
|
|
131
|
-
[inlineError]="errors()['email']"
|
|
132
|
-
pattern="EMAIL"
|
|
133
|
-
required />
|
|
134
|
-
<sd-input
|
|
135
|
-
label="Điện thoại"
|
|
136
|
-
name="phone"
|
|
137
|
-
autoId="customer-phone"
|
|
138
|
-
[form]="form()"
|
|
139
|
-
[model]="seed().phone"
|
|
140
|
-
[inlineError]="errors()['phone']"
|
|
141
|
-
maxlength="15"
|
|
142
|
-
required />
|
|
143
|
-
<sd-input label="Địa chỉ" name="address" autoId="customer-address" [form]="form()" [model]="seed().address" maxlength="200" />
|
|
144
|
-
</div>
|
|
145
|
-
</sd-section>
|
|
146
|
-
<sd-section title="Khác">
|
|
147
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
148
|
-
<sd-switch label="Đang hoạt động" name="active" [form]="form()" [model]="seed().status !== 'inactive'" />
|
|
149
|
-
<sd-textarea label="Ghi chú" name="note" [form]="form()" [model]="seed().note" maxlength="500" />
|
|
150
|
-
</div>
|
|
151
|
-
</sd-section>
|
|
152
|
-
</div>
|
|
153
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdTextarea, selector: "sd-textarea", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "rows", "hideInlineError", "required", "disabled", "viewed", "autoHeight", "maxlength", "minlength", "pattern", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "model"], outputs: ["modelChange", "sdChange"] }, { 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: 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"] }, { kind: "component", type: CustomerTypeSelectComponent, selector: "customer-type-select", inputs: ["form", "name", "label", "required", "model"], outputs: ["modelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
154
|
-
}
|
|
155
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GeneralInformationFormComponent, decorators: [{
|
|
156
|
-
type: Component,
|
|
157
|
-
args: [{
|
|
158
|
-
selector: 'general-information-form',
|
|
159
|
-
standalone: true,
|
|
160
|
-
imports: [SdSection, SdInput, SdTextarea, SdSwitch, SdInform, CustomerTypeSelectComponent],
|
|
161
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
162
|
-
template: `
|
|
163
|
-
@let invalid = invalidGroups();
|
|
164
|
-
<div class="d-flex flex-column gap-16">
|
|
165
|
-
<sd-section title="Thông tin chung">
|
|
166
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
167
|
-
@if (invalid.includes('general')) {
|
|
168
|
-
<sd-inform warning description="Kiểm tra tên và loại khách hàng." autoId="customer-general-warning" />
|
|
169
|
-
}
|
|
170
|
-
<sd-input
|
|
171
|
-
label="Tên khách hàng"
|
|
172
|
-
name="name"
|
|
173
|
-
autoId="customer-name"
|
|
174
|
-
[form]="form()"
|
|
175
|
-
[model]="seed().name"
|
|
176
|
-
[inlineError]="errors()['name']"
|
|
177
|
-
maxlength="120"
|
|
178
|
-
required />
|
|
179
|
-
<customer-type-select [form]="form()" [model]="seed().type" (modelChange)="type.set($event ?? 'individual')" />
|
|
180
|
-
@if (type() === 'business') {
|
|
181
|
-
<sd-input
|
|
182
|
-
label="Mã số thuế"
|
|
183
|
-
name="taxCode"
|
|
184
|
-
autoId="customer-tax-code"
|
|
185
|
-
[form]="form()"
|
|
186
|
-
[model]="seed().taxCode"
|
|
187
|
-
[inlineError]="errors()['taxCode']"
|
|
188
|
-
maxlength="14"
|
|
189
|
-
required />
|
|
190
|
-
}
|
|
191
|
-
<sd-switch label="Khách VIP" name="vip" [form]="form()" [model]="seed().tier === 'vip'" />
|
|
192
|
-
</div>
|
|
193
|
-
</sd-section>
|
|
194
|
-
<sd-section title="Liên hệ">
|
|
195
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
196
|
-
@if (invalid.includes('contact')) {
|
|
197
|
-
<sd-inform warning description="Kiểm tra email và số điện thoại." autoId="customer-contact-warning" />
|
|
198
|
-
}
|
|
199
|
-
<sd-input
|
|
200
|
-
label="Email"
|
|
201
|
-
name="email"
|
|
202
|
-
autoId="customer-email"
|
|
203
|
-
[form]="form()"
|
|
204
|
-
[model]="seed().email"
|
|
205
|
-
[inlineError]="errors()['email']"
|
|
206
|
-
pattern="EMAIL"
|
|
207
|
-
required />
|
|
208
|
-
<sd-input
|
|
209
|
-
label="Điện thoại"
|
|
210
|
-
name="phone"
|
|
211
|
-
autoId="customer-phone"
|
|
212
|
-
[form]="form()"
|
|
213
|
-
[model]="seed().phone"
|
|
214
|
-
[inlineError]="errors()['phone']"
|
|
215
|
-
maxlength="15"
|
|
216
|
-
required />
|
|
217
|
-
<sd-input label="Địa chỉ" name="address" autoId="customer-address" [form]="form()" [model]="seed().address" maxlength="200" />
|
|
218
|
-
</div>
|
|
219
|
-
</sd-section>
|
|
220
|
-
<sd-section title="Khác">
|
|
221
|
-
<div class="d-flex flex-column gap-8 p-16">
|
|
222
|
-
<sd-switch label="Đang hoạt động" name="active" [form]="form()" [model]="seed().status !== 'inactive'" />
|
|
223
|
-
<sd-textarea label="Ghi chú" name="note" [form]="form()" [model]="seed().note" maxlength="500" />
|
|
224
|
-
</div>
|
|
225
|
-
</sd-section>
|
|
226
|
-
</div>
|
|
227
|
-
`,
|
|
228
|
-
}]
|
|
229
|
-
}], 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 }] }], invalidGroups: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidGroups", required: false }] }] } });
|
|
230
|
-
|
|
231
|
-
export { GeneralInformationFormComponent as G, customerSaveReq as c, invalidCustomerGroups as i };
|
|
232
|
-
//# sourceMappingURL=sdcorejs-angular-modules-pattern-general-information-form.component-DalxHa8D.mjs.map
|