@sdcorejs/angular 20.3.1 → 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/STYLE-GUIDE.md +25 -5
- package/assets/THEME.md +289 -5
- package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
- package/assets/scss/ckeditor5.scss +2 -88
- package/assets/scss/core/_control.scss +39 -0
- package/assets/scss/core/form.scss +444 -45
- package/assets/scss/core/view.scss +24 -0
- package/assets/scss/editor-content.scss +173 -0
- package/assets/scss/sd-core.scss +1 -0
- package/assets/scss/themes/_component-tokens.scss +123 -32
- package/assets/scss/themes/_material-tokens.scss +112 -0
- package/assets/scss/themes/_presets.scss +25 -0
- package/assets/scss/themes/_scales.scss +10 -0
- package/assets/scss/themes/_semantic.scss +13 -0
- package/assets/scss/themes/default.scss +8 -2
- package/components/avatar/index.d.ts +67 -2
- package/components/badge/index.d.ts +206 -6
- package/components/button/index.d.ts +20 -1
- package/components/ckeditor-styles/index.d.ts +3 -18
- package/components/editor/index.d.ts +20 -17
- package/components/editor-engine/index.d.ts +246 -0
- package/components/file-explorer/index.d.ts +4 -2
- package/components/form-generic/index.d.ts +246 -35
- package/components/index.d.ts +1 -0
- package/components/mini-editor/index.d.ts +33 -70
- package/components/modal-resizable/index.d.ts +1 -124
- package/components/operator/index.d.ts +137 -8
- package/components/section/index.d.ts +13 -1
- package/components/splitter/index.d.ts +1 -1
- package/components/tab-router/index.d.ts +74 -19
- package/components/table/index.d.ts +210 -18
- package/components/upload-file/index.d.ts +181 -21
- package/components/window/index.d.ts +81 -0
- package/configurations/index.d.ts +8 -1
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +548 -24
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +33 -3
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +68 -37
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2118 -1159
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +12 -2
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-operator.mjs +262 -43
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +17 -5
- 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 +559 -94
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +1001 -119
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.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-components-view.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-window.mjs +486 -0
- package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +20 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +463 -125
- 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 +79 -13
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +75 -18
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +79 -16
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
- package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +56 -6
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +54 -7
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs +5 -4
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +87 -33
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +16 -3
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time.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 +1745 -22
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs +478 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-D_1BxDC9.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs +214 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-CgH8Qi25.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs +277 -0
- package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-CyCGqW9W.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs +1556 -0
- package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DTmU8Te4.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
- package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +2055 -37
- 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-modules.mjs +1 -0
- package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
- package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
- package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services.mjs +1 -0
- package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
- package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
- package/forms/autocomplete/index.d.ts +5 -0
- package/forms/chip/index.d.ts +136 -26
- package/forms/chip-calendar/index.d.ts +163 -18
- package/forms/date/index.d.ts +23 -2
- package/forms/date-range/index.d.ts +24 -2
- package/forms/directives/index.d.ts +47 -2
- package/forms/input/index.d.ts +23 -2
- package/forms/input-number/index.d.ts +23 -2
- package/forms/models/index.d.ts +38 -3
- package/forms/select/index.d.ts +32 -2
- package/i18n/index.d.ts +344 -2
- package/modules/generic/index.d.ts +316 -0
- package/modules/icon/index.d.ts +37 -6
- package/modules/index.d.ts +1 -0
- package/modules/layout/index.d.ts +622 -89
- 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 +45 -8
- package/pipes/index.d.ts +2 -0
- package/services/date-time/index.d.ts +57 -0
- package/services/index.d.ts +1 -0
- package/services/storage/index.d.ts +8 -1
- package/services/unsaved-changes/index.d.ts +11 -0
- package/utilities/read-state/index.d.ts +2 -0
- package/utilities/theme/index.d.ts +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const PRODUCT_STATUS_OPTIONS = [
|
|
2
|
+
{ id: 'active', name: 'Đang hoạt động', color: 'success' },
|
|
3
|
+
{ id: 'inactive', name: 'Ngừng hoạt động', color: 'secondary' },
|
|
4
|
+
];
|
|
5
|
+
/** Badge trạng thái cạnh title của chi tiết. */
|
|
6
|
+
function productStatusBadge(status) {
|
|
7
|
+
const option = PRODUCT_STATUS_OPTIONS.find(item => item.id === status);
|
|
8
|
+
return { type: 'round', title: option?.name ?? status, color: option?.color };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { PRODUCT_STATUS_OPTIONS as P, productStatusBadge as p };
|
|
12
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/product/services/product.model.ts"],"sourcesContent":["import type { SdBadgeData } from '@sdcorejs/angular/components/badge';\nimport type { PagingReq, PagingRes } from '@sdcorejs/utils/models';\n\nexport type ProductStatus = 'active' | 'inactive';\n\nexport const PRODUCT_STATUS_OPTIONS = [\n { id: 'active', name: 'Đang hoạt động', color: 'success' },\n { id: 'inactive', name: 'Ngừng hoạt động', color: 'secondary' },\n] satisfies { id: ProductStatus; name: string; color: SdBadgeData['color'] }[];\n\nexport interface ProductDto {\n readonly id: string;\n readonly code: string;\n readonly name: string;\n readonly status: ProductStatus;\n /** Đơn vị tính. */\n readonly unit: string;\n /** Giá bán (₫). */\n readonly price: number;\n}\n\n/** PagingReq dùng pageNumber bắt đầu từ 0. */\nexport type ProductListReq = PagingReq<ProductDto>;\nexport type ProductListRes = PagingRes<ProductDto>;\n\nexport interface ProductSaveReq {\n readonly code: string;\n readonly name: string;\n readonly status: ProductStatus;\n readonly unit: string;\n readonly price: number;\n}\n\n/** Badge trạng thái cạnh title của chi tiết. */\nexport function productStatusBadge(status: ProductStatus): SdBadgeData {\n const option = PRODUCT_STATUS_OPTIONS.find(item => item.id === status);\n return { type: 'round', title: option?.name ?? status, color: option?.color };\n}\n"],"names":[],"mappings":"AAKO,MAAM,sBAAsB,GAAG;IACpC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;IAC1D,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE;;AA0BjE;AACM,SAAU,kBAAkB,CAAC,MAAqB,EAAA;AACtD,IAAA,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC;AACtE,IAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;AAC/E;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, Injectable } from '@angular/core';
|
|
3
|
+
import { shareReplay, tap } from 'rxjs';
|
|
4
|
+
import { B as BaseApiService } from './sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs';
|
|
5
|
+
|
|
6
|
+
class ProductService extends BaseApiService {
|
|
7
|
+
/** Một request cho mỗi ID trong phạm vi service: pipe và select dùng chung kết quả. */
|
|
8
|
+
#details = new Map();
|
|
9
|
+
#changes = signal(0, ...(ngDevMode ? [{ debugName: "#changes" }] : []));
|
|
10
|
+
/** Tăng sau mỗi lần tạo hoặc cập nhật thành công: danh sách tải lại khi quay về. */
|
|
11
|
+
changes = this.#changes.asReadonly();
|
|
12
|
+
list(req) {
|
|
13
|
+
return this.http.get(this.apiUrl('products'), {
|
|
14
|
+
params: this.buildPagingReq(req),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
detail(id) {
|
|
18
|
+
return this.http.get(this.apiUrl('products', id));
|
|
19
|
+
}
|
|
20
|
+
/** `detail(id)` có cache, cho relation (`productDetail`) và giá trị đã chọn của `product-select`. */
|
|
21
|
+
cachedDetail(id) {
|
|
22
|
+
let detail = this.#details.get(id);
|
|
23
|
+
if (!detail) {
|
|
24
|
+
detail = this.detail(id).pipe(shareReplay({ bufferSize: 1, refCount: false }));
|
|
25
|
+
this.#details.set(id, detail);
|
|
26
|
+
// Lỗi tra cứu không được cache: lần gọi sau hỏi lại.
|
|
27
|
+
detail.subscribe({ error: () => this.#details.delete(id) });
|
|
28
|
+
}
|
|
29
|
+
return detail;
|
|
30
|
+
}
|
|
31
|
+
create(req) {
|
|
32
|
+
return this.http.post(this.apiUrl('products'), req).pipe(tap(() => this.#changes.update(count => count + 1)));
|
|
33
|
+
}
|
|
34
|
+
update(id, req) {
|
|
35
|
+
return this.http.put(this.apiUrl('products', id), req).pipe(tap(() => {
|
|
36
|
+
this.#details.delete(id);
|
|
37
|
+
this.#changes.update(count => count + 1);
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ProductService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ProductService });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ProductService, decorators: [{
|
|
44
|
+
type: Injectable
|
|
45
|
+
}] });
|
|
46
|
+
|
|
47
|
+
export { ProductService as P };
|
|
48
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-product.service-C3coYwmZ.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/product/services/product.service.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { shareReplay, tap, type Observable } from 'rxjs';\nimport { BaseApiService } from '../../../services/base-api.service';\nimport type { ProductDto, ProductListReq, ProductListRes, ProductSaveReq } from './product.model';\n\n@Injectable()\nexport class ProductService extends BaseApiService {\n /** Một request cho mỗi ID trong phạm vi service: pipe và select dùng chung kết quả. */\n readonly #details = new Map<string, Observable<ProductDto>>();\n readonly #changes = signal(0);\n /** Tăng sau mỗi lần tạo hoặc cập nhật thành công: danh sách tải lại khi quay về. */\n readonly changes = this.#changes.asReadonly();\n\n list(req: ProductListReq): Observable<ProductListRes> {\n return this.http.get<ProductListRes>(this.apiUrl('products'), {\n params: this.buildPagingReq(req),\n });\n }\n\n detail(id: string): Observable<ProductDto> {\n return this.http.get<ProductDto>(this.apiUrl('products', id));\n }\n\n /** `detail(id)` có cache, cho relation (`productDetail`) và giá trị đã chọn của `product-select`. */\n cachedDetail(id: string): Observable<ProductDto> {\n let detail = this.#details.get(id);\n if (!detail) {\n detail = this.detail(id).pipe(shareReplay({ bufferSize: 1, refCount: false }));\n this.#details.set(id, detail);\n // Lỗi tra cứu không được cache: lần gọi sau hỏi lại.\n detail.subscribe({ error: () => this.#details.delete(id) });\n }\n return detail;\n }\n\n create(req: ProductSaveReq): Observable<ProductDto> {\n return this.http.post<ProductDto>(this.apiUrl('products'), req).pipe(tap(() => this.#changes.update(count => count + 1)));\n }\n\n update(id: string, req: ProductSaveReq): Observable<ProductDto> {\n return this.http.put<ProductDto>(this.apiUrl('products', id), req).pipe(\n tap(() => {\n this.#details.delete(id);\n this.#changes.update(count => count + 1);\n })\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAMM,MAAO,cAAe,SAAQ,cAAc,CAAA;;AAEvC,IAAA,QAAQ,GAAG,IAAI,GAAG,EAAkC;AACpD,IAAA,QAAQ,GAAG,MAAM,CAAC,CAAC,oDAAC;;AAEpB,IAAA,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAE7C,IAAA,IAAI,CAAC,GAAmB,EAAA;AACtB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAiB,IAA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AAI,CACrE,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;AACxB,YAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC;QAC1C,CAAC,CAAC,CACH;IACH;wGAxCW,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAd,cAAc,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;;;"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, ChangeDetectionStrategy, Component, signal, computed, linkedSignal, untracked } from '@angular/core';
|
|
3
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { RouterLink, Router, ActivatedRoute } from '@angular/router';
|
|
5
|
+
import { firstValueFrom, map } from 'rxjs';
|
|
6
|
+
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
7
|
+
import { SdTabGroup, SdTab } from '@sdcorejs/angular/components/tab';
|
|
8
|
+
import { SdPageComponent } from '@sdcorejs/angular/modules/layout';
|
|
9
|
+
import { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';
|
|
10
|
+
import { SdTable, SdTableCellDefDirective } from '@sdcorejs/angular/components/table';
|
|
11
|
+
import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs';
|
|
12
|
+
import { SdDataState } from '@sdcorejs/angular/components/data-state';
|
|
13
|
+
import { SdSection, SdSectionItem } from '@sdcorejs/angular/components/section';
|
|
14
|
+
import { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';
|
|
15
|
+
import { G as GeneralInformationViewComponent } from './sdcorejs-angular-modules-pattern-general-information-view.component-kdEZ9s7K.mjs';
|
|
16
|
+
import { c as customerStatusBadge, b as customerTypeName } from './sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs';
|
|
17
|
+
|
|
18
|
+
/** Tab Công nợ của hồ sơ 360°. */
|
|
19
|
+
class DebtsViewComponent {
|
|
20
|
+
#customerService = inject(CustomerService);
|
|
21
|
+
customerId = input.required(...(ngDevMode ? [{ debugName: "customerId" }] : []));
|
|
22
|
+
option = {
|
|
23
|
+
type: 'server',
|
|
24
|
+
items: () => firstValueFrom(this.#customerService.debts(this.customerId())),
|
|
25
|
+
paginate: { pageSize: 10 },
|
|
26
|
+
columns: [
|
|
27
|
+
{ field: 'orderCode', title: 'Đơn hàng', type: 'string', width: '140px' },
|
|
28
|
+
{ field: 'dueDate', title: 'Hạn thanh toán', type: 'date', width: '160px' },
|
|
29
|
+
{ field: 'amount', title: 'Còn nợ (₫)', type: 'number', align: 'right' },
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DebtsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: DebtsViewComponent, isStandalone: true, selector: "debts-view", inputs: { customerId: { classPropertyName: "customerId", publicName: "customerId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<sd-table autoId="customer-debts" [option]="option" />`, isInline: true, dependencies: [{ kind: "component", type: SdTable, selector: "sd-table", inputs: ["autoId", "option", "hideReadError"], outputs: ["sdReadStateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DebtsViewComponent, decorators: [{
|
|
36
|
+
type: Component,
|
|
37
|
+
args: [{
|
|
38
|
+
selector: 'debts-view',
|
|
39
|
+
standalone: true,
|
|
40
|
+
imports: [SdTable],
|
|
41
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
42
|
+
template: `<sd-table autoId="customer-debts" [option]="option" />`,
|
|
43
|
+
}]
|
|
44
|
+
}], propDecorators: { customerId: [{ type: i0.Input, args: [{ isSignal: true, alias: "customerId", required: true }] }] } });
|
|
45
|
+
|
|
46
|
+
/** Tab Tài liệu của hồ sơ 360°: danh sách ngắn, trạng thái riêng bằng `sd-data-state`. */
|
|
47
|
+
class DocumentsViewComponent {
|
|
48
|
+
#customerService = inject(CustomerService);
|
|
49
|
+
customerId = input.required(...(ngDevMode ? [{ debugName: "customerId" }] : []));
|
|
50
|
+
state = signal('loading', ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
51
|
+
documents = signal([], ...(ngDevMode ? [{ debugName: "documents" }] : []));
|
|
52
|
+
ngOnInit() {
|
|
53
|
+
void this.load();
|
|
54
|
+
}
|
|
55
|
+
async load() {
|
|
56
|
+
this.state.set('loading');
|
|
57
|
+
try {
|
|
58
|
+
const res = await firstValueFrom(this.#customerService.documents(this.customerId()));
|
|
59
|
+
this.documents.set(res.items);
|
|
60
|
+
this.state.set(res.items.length ? 'success' : 'empty');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
this.state.set('error');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DocumentsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: DocumentsViewComponent, isStandalone: true, selector: "documents-view", inputs: { customerId: { classPropertyName: "customerId", publicName: "customerId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
68
|
+
<sd-data-state
|
|
69
|
+
[state]="state()"
|
|
70
|
+
retryable
|
|
71
|
+
title=""
|
|
72
|
+
[message]="state() === 'empty' ? 'Khách hàng chưa có tài liệu.' : undefined"
|
|
73
|
+
(sdRetry)="load()">
|
|
74
|
+
<sd-section title="Tài liệu">
|
|
75
|
+
@for (document of documents(); track document.id) {
|
|
76
|
+
<sd-section-item [label]="document.name">{{ document.size / 1024 | sdFormatNumber: 0 }} KB</sd-section-item>
|
|
77
|
+
}
|
|
78
|
+
</sd-section>
|
|
79
|
+
</sd-data-state>
|
|
80
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "iconShape", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: SdSectionItem, selector: "sd-section-item", inputs: ["label", "labelWidth"] }, { kind: "pipe", type: SdFormatNumberPipe, name: "sdFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
81
|
+
}
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: DocumentsViewComponent, decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{
|
|
85
|
+
selector: 'documents-view',
|
|
86
|
+
standalone: true,
|
|
87
|
+
imports: [SdDataState, SdSection, SdSectionItem, SdFormatNumberPipe],
|
|
88
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
|
+
template: `
|
|
90
|
+
<sd-data-state
|
|
91
|
+
[state]="state()"
|
|
92
|
+
retryable
|
|
93
|
+
title=""
|
|
94
|
+
[message]="state() === 'empty' ? 'Khách hàng chưa có tài liệu.' : undefined"
|
|
95
|
+
(sdRetry)="load()">
|
|
96
|
+
<sd-section title="Tài liệu">
|
|
97
|
+
@for (document of documents(); track document.id) {
|
|
98
|
+
<sd-section-item [label]="document.name">{{ document.size / 1024 | sdFormatNumber: 0 }} KB</sd-section-item>
|
|
99
|
+
}
|
|
100
|
+
</sd-section>
|
|
101
|
+
</sd-data-state>
|
|
102
|
+
`,
|
|
103
|
+
}]
|
|
104
|
+
}], propDecorators: { customerId: [{ type: i0.Input, args: [{ isSignal: true, alias: "customerId", required: true }] }] } });
|
|
105
|
+
|
|
106
|
+
/** Tab Đơn hàng của hồ sơ 360°: tải khi tab được mở lần đầu; bảng tự có trạng thái đang tải, rỗng và lỗi. */
|
|
107
|
+
class OrdersViewComponent {
|
|
108
|
+
#customerService = inject(CustomerService);
|
|
109
|
+
customerId = input.required(...(ngDevMode ? [{ debugName: "customerId" }] : []));
|
|
110
|
+
option = {
|
|
111
|
+
type: 'server',
|
|
112
|
+
items: () => firstValueFrom(this.#customerService.orders(this.customerId())),
|
|
113
|
+
paginate: { pageSize: 10 },
|
|
114
|
+
columns: [
|
|
115
|
+
{ field: 'code', title: 'Mã đơn', type: 'string', width: '140px' },
|
|
116
|
+
{ field: 'createdAt', title: 'Ngày tạo', type: 'date', width: '160px' },
|
|
117
|
+
{ field: 'total', title: 'Tổng tiền (₫)', type: 'number', align: 'right' },
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OrdersViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: OrdersViewComponent, isStandalone: true, selector: "orders-view", inputs: { customerId: { classPropertyName: "customerId", publicName: "customerId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
122
|
+
<sd-table autoId="customer-orders" [option]="option">
|
|
123
|
+
<ng-template sdTableCellDef="code" let-order="item">
|
|
124
|
+
<a [routerLink]="['../../../order', order.id, 'detail']">{{ order.code }}</a>
|
|
125
|
+
</ng-template>
|
|
126
|
+
</sd-table>
|
|
127
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: SdTable, selector: "sd-table", inputs: ["autoId", "option", "hideReadError"], outputs: ["sdReadStateChange"] }, { kind: "directive", type: SdTableCellDefDirective, selector: "[sdTableCellDef]", inputs: ["sdTableCellDef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
128
|
+
}
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: OrdersViewComponent, decorators: [{
|
|
130
|
+
type: Component,
|
|
131
|
+
args: [{
|
|
132
|
+
selector: 'orders-view',
|
|
133
|
+
standalone: true,
|
|
134
|
+
imports: [RouterLink, SdTable, SdTableCellDefDirective],
|
|
135
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
136
|
+
template: `
|
|
137
|
+
<sd-table autoId="customer-orders" [option]="option">
|
|
138
|
+
<ng-template sdTableCellDef="code" let-order="item">
|
|
139
|
+
<a [routerLink]="['../../../order', order.id, 'detail']">{{ order.code }}</a>
|
|
140
|
+
</ng-template>
|
|
141
|
+
</sd-table>
|
|
142
|
+
`,
|
|
143
|
+
}]
|
|
144
|
+
}], propDecorators: { customerId: [{ type: i0.Input, args: [{ isSignal: true, alias: "customerId", required: true }] }] } });
|
|
145
|
+
|
|
146
|
+
const TABS = [
|
|
147
|
+
{ key: 'info', label: 'Thông tin' },
|
|
148
|
+
{ key: 'orders', label: 'Đơn hàng' },
|
|
149
|
+
{ key: 'debts', label: 'Công nợ' },
|
|
150
|
+
{ key: 'documents', label: 'Tài liệu' },
|
|
151
|
+
];
|
|
152
|
+
/**
|
|
153
|
+
* Hồ sơ 360° (`:id/360`): thông tin chung và các quan hệ của khách hàng theo tab. Tab ghi trên URL (`?tab=`);
|
|
154
|
+
* mở tab nào mới tải tab đó, mỗi tab tự có trạng thái đang tải, rỗng và lỗi.
|
|
155
|
+
*/
|
|
156
|
+
class ProfileComponent {
|
|
157
|
+
#router = inject(Router);
|
|
158
|
+
#route = inject(ActivatedRoute);
|
|
159
|
+
tabs = TABS;
|
|
160
|
+
entity = toSignal(this.#route.data.pipe(map(data => data['entity'])), { requireSync: true });
|
|
161
|
+
badges = computed(() => [customerStatusBadge(this.entity().status)], ...(ngDevMode ? [{ debugName: "badges" }] : []));
|
|
162
|
+
typeName = computed(() => customerTypeName(this.entity().type), ...(ngDevMode ? [{ debugName: "typeName" }] : []));
|
|
163
|
+
#tabParam = toSignal(this.#route.queryParamMap.pipe(map(params => params.get('tab'))), { requireSync: true });
|
|
164
|
+
tabIndex = computed(() => Math.max(0, TABS.findIndex(tab => tab.key === this.#tabParam())), ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
|
|
165
|
+
/** Tab đã mở ít nhất một lần: giữ lại khi chuyển tab, không tải lại. Đổi khách hàng thì bắt đầu lại. */
|
|
166
|
+
opened = linkedSignal(...(ngDevMode ? [{ debugName: "opened", source: this.entity,
|
|
167
|
+
// untracked: đổi tab không được đặt lại các tab đã mở; chỉ đổi khách hàng mới bắt đầu lại.
|
|
168
|
+
computation: () => new Set([TABS[untracked(this.tabIndex)].key]) }] : [{
|
|
169
|
+
source: this.entity,
|
|
170
|
+
// untracked: đổi tab không được đặt lại các tab đã mở; chỉ đổi khách hàng mới bắt đầu lại.
|
|
171
|
+
computation: () => new Set([TABS[untracked(this.tabIndex)].key]),
|
|
172
|
+
}]));
|
|
173
|
+
selectTab(index) {
|
|
174
|
+
const key = TABS[index]?.key ?? 'info';
|
|
175
|
+
this.opened.update(opened => new Set([...opened, key]));
|
|
176
|
+
void this.#router.navigate([], {
|
|
177
|
+
relativeTo: this.#route,
|
|
178
|
+
queryParams: { tab: key === 'info' ? null : key },
|
|
179
|
+
queryParamsHandling: 'merge',
|
|
180
|
+
replaceUrl: true,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: ProfileComponent, isStandalone: true, selector: "profile", ngImport: i0, template: `
|
|
185
|
+
@let customer = entity();
|
|
186
|
+
<sd-page-detail
|
|
187
|
+
[title]="'Hồ sơ khách hàng #' + customer.code"
|
|
188
|
+
[description]="customer.name + ' · ' + typeName()"
|
|
189
|
+
[badges]="badges()"
|
|
190
|
+
[backLink]="['../..']">
|
|
191
|
+
<sd-button
|
|
192
|
+
headerRight
|
|
193
|
+
*sdPermission="'PATTERN_CUSTOMER_U_UPDATE'"
|
|
194
|
+
title="Cập nhật khách hàng"
|
|
195
|
+
prefixIcon="edit"
|
|
196
|
+
type="fill"
|
|
197
|
+
color="primary"
|
|
198
|
+
autoId="customer-profile-update"
|
|
199
|
+
[routerLink]="['../update']" />
|
|
200
|
+
<sd-tab-group sdSubheader [selectedIndex]="tabIndex()" (selectedIndexChange)="selectTab($event)">
|
|
201
|
+
@for (tab of tabs; track tab.key) {
|
|
202
|
+
<sd-tab [label]="tab.label" />
|
|
203
|
+
}
|
|
204
|
+
</sd-tab-group>
|
|
205
|
+
<div class="py-16">
|
|
206
|
+
@for (tab of tabs; track tab.key; let index = $index) {
|
|
207
|
+
@if (opened().has(tab.key)) {
|
|
208
|
+
<div [hidden]="tabIndex() !== index" [attr.data-customer-tab]="tab.key">
|
|
209
|
+
@switch (tab.key) {
|
|
210
|
+
@case ('info') {
|
|
211
|
+
<general-information-view [customer]="customer" />
|
|
212
|
+
}
|
|
213
|
+
@case ('orders') {
|
|
214
|
+
<orders-view [customerId]="customer.id" />
|
|
215
|
+
}
|
|
216
|
+
@case ('debts') {
|
|
217
|
+
<debts-view [customerId]="customer.id" />
|
|
218
|
+
}
|
|
219
|
+
@case ('documents') {
|
|
220
|
+
<documents-view [customerId]="customer.id" />
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
</div>
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
</div>
|
|
227
|
+
</sd-page-detail>
|
|
228
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { 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: "directive", type: SdPermissionDirective, selector: "[sdPermission]", inputs: ["sdPermission", "sdPermissionKey"] }, { kind: "component", type: GeneralInformationViewComponent, selector: "general-information-view", inputs: ["customer"] }, { kind: "component", type: OrdersViewComponent, selector: "orders-view", inputs: ["customerId"] }, { kind: "component", type: DebtsViewComponent, selector: "debts-view", inputs: ["customerId"] }, { kind: "component", type: DocumentsViewComponent, selector: "documents-view", inputs: ["customerId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
229
|
+
}
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ProfileComponent, decorators: [{
|
|
231
|
+
type: Component,
|
|
232
|
+
args: [{
|
|
233
|
+
selector: 'profile',
|
|
234
|
+
standalone: true,
|
|
235
|
+
imports: [
|
|
236
|
+
RouterLink,
|
|
237
|
+
SdPageComponent,
|
|
238
|
+
SdButton,
|
|
239
|
+
SdTabGroup,
|
|
240
|
+
SdTab,
|
|
241
|
+
SdPermissionDirective,
|
|
242
|
+
GeneralInformationViewComponent,
|
|
243
|
+
OrdersViewComponent,
|
|
244
|
+
DebtsViewComponent,
|
|
245
|
+
DocumentsViewComponent,
|
|
246
|
+
],
|
|
247
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
248
|
+
template: `
|
|
249
|
+
@let customer = entity();
|
|
250
|
+
<sd-page-detail
|
|
251
|
+
[title]="'Hồ sơ khách hàng #' + customer.code"
|
|
252
|
+
[description]="customer.name + ' · ' + typeName()"
|
|
253
|
+
[badges]="badges()"
|
|
254
|
+
[backLink]="['../..']">
|
|
255
|
+
<sd-button
|
|
256
|
+
headerRight
|
|
257
|
+
*sdPermission="'PATTERN_CUSTOMER_U_UPDATE'"
|
|
258
|
+
title="Cập nhật khách hàng"
|
|
259
|
+
prefixIcon="edit"
|
|
260
|
+
type="fill"
|
|
261
|
+
color="primary"
|
|
262
|
+
autoId="customer-profile-update"
|
|
263
|
+
[routerLink]="['../update']" />
|
|
264
|
+
<sd-tab-group sdSubheader [selectedIndex]="tabIndex()" (selectedIndexChange)="selectTab($event)">
|
|
265
|
+
@for (tab of tabs; track tab.key) {
|
|
266
|
+
<sd-tab [label]="tab.label" />
|
|
267
|
+
}
|
|
268
|
+
</sd-tab-group>
|
|
269
|
+
<div class="py-16">
|
|
270
|
+
@for (tab of tabs; track tab.key; let index = $index) {
|
|
271
|
+
@if (opened().has(tab.key)) {
|
|
272
|
+
<div [hidden]="tabIndex() !== index" [attr.data-customer-tab]="tab.key">
|
|
273
|
+
@switch (tab.key) {
|
|
274
|
+
@case ('info') {
|
|
275
|
+
<general-information-view [customer]="customer" />
|
|
276
|
+
}
|
|
277
|
+
@case ('orders') {
|
|
278
|
+
<orders-view [customerId]="customer.id" />
|
|
279
|
+
}
|
|
280
|
+
@case ('debts') {
|
|
281
|
+
<debts-view [customerId]="customer.id" />
|
|
282
|
+
}
|
|
283
|
+
@case ('documents') {
|
|
284
|
+
<documents-view [customerId]="customer.id" />
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
</div>
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
</div>
|
|
291
|
+
</sd-page-detail>
|
|
292
|
+
`,
|
|
293
|
+
}]
|
|
294
|
+
}] });
|
|
295
|
+
|
|
296
|
+
export { ProfileComponent };
|
|
297
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/debts-view/debts-view.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/documents-view/documents-view.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/customer/components/orders-view/orders-view.component.ts","../../../projects/sdcorejs-angular/modules/pattern/features/customer/pages/profile/profile.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\nimport { SdTable, type SdTableOption } from '@sdcorejs/angular/components/table';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerDebtDto } from '../../services/customer.model';\n\n/** Tab Công nợ của hồ sơ 360°. */\n@Component({\n selector: 'debts-view',\n standalone: true,\n imports: [SdTable],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<sd-table autoId=\"customer-debts\" [option]=\"option\" />`,\n})\nexport class DebtsViewComponent {\n readonly #customerService = inject(CustomerService);\n readonly customerId = input.required<string>();\n protected readonly option: SdTableOption<CustomerDebtDto> = {\n type: 'server',\n items: () => firstValueFrom(this.#customerService.debts(this.customerId())),\n paginate: { pageSize: 10 },\n columns: [\n { field: 'orderCode', title: 'Đơn hàng', type: 'string', width: '140px' },\n { field: 'dueDate', title: 'Hạn thanh toán', type: 'date', width: '160px' },\n { field: 'amount', title: 'Còn nợ (₫)', type: 'number', align: 'right' },\n ],\n };\n}\n","import { ChangeDetectionStrategy, Component, inject, input, OnInit, signal } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\nimport { SdDataState } from '@sdcorejs/angular/components/data-state';\nimport { SdSection, SdSectionItem } from '@sdcorejs/angular/components/section';\nimport { SdFormatNumberPipe } from '@sdcorejs/angular/pipes';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerDocumentDto } from '../../services/customer.model';\n\n/** Tab Tài liệu của hồ sơ 360°: danh sách ngắn, trạng thái riêng bằng `sd-data-state`. */\n@Component({\n selector: 'documents-view',\n standalone: true,\n imports: [SdDataState, SdSection, SdSectionItem, SdFormatNumberPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-data-state\n [state]=\"state()\"\n retryable\n title=\"\"\n [message]=\"state() === 'empty' ? 'Khách hàng chưa có tài liệu.' : undefined\"\n (sdRetry)=\"load()\">\n <sd-section title=\"Tài liệu\">\n @for (document of documents(); track document.id) {\n <sd-section-item [label]=\"document.name\">{{ document.size / 1024 | sdFormatNumber: 0 }} KB</sd-section-item>\n }\n </sd-section>\n </sd-data-state>\n `,\n})\nexport class DocumentsViewComponent implements OnInit {\n readonly #customerService = inject(CustomerService);\n readonly customerId = input.required<string>();\n protected readonly state = signal<'loading' | 'empty' | 'error' | 'success'>('loading');\n protected readonly documents = signal<readonly CustomerDocumentDto[]>([]);\n\n ngOnInit(): void {\n void this.load();\n }\n\n protected async load(): Promise<void> {\n this.state.set('loading');\n try {\n const res = await firstValueFrom(this.#customerService.documents(this.customerId()));\n this.documents.set(res.items);\n this.state.set(res.items.length ? 'success' : 'empty');\n } catch {\n this.state.set('error');\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { SdTable, SdTableCellDefDirective, type SdTableOption } from '@sdcorejs/angular/components/table';\nimport { CustomerService } from '../../services/customer.service';\nimport type { CustomerOrderDto } from '../../services/customer.model';\n\n/** Tab Đơn hàng của hồ sơ 360°: tải khi tab được mở lần đầu; bảng tự có trạng thái đang tải, rỗng và lỗi. */\n@Component({\n selector: 'orders-view',\n standalone: true,\n imports: [RouterLink, SdTable, SdTableCellDefDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <sd-table autoId=\"customer-orders\" [option]=\"option\">\n <ng-template sdTableCellDef=\"code\" let-order=\"item\">\n <a [routerLink]=\"['../../../order', order.id, 'detail']\">{{ order.code }}</a>\n </ng-template>\n </sd-table>\n `,\n})\nexport class OrdersViewComponent {\n readonly #customerService = inject(CustomerService);\n readonly customerId = input.required<string>();\n protected readonly option: SdTableOption<CustomerOrderDto> = {\n type: 'server',\n items: () => firstValueFrom(this.#customerService.orders(this.customerId())),\n paginate: { pageSize: 10 },\n columns: [\n { field: 'code', title: 'Mã đơn', type: 'string', width: '140px' },\n { field: 'createdAt', title: 'Ngày tạo', type: 'date', width: '160px' },\n { field: 'total', title: 'Tổng tiền (₫)', type: 'number', align: 'right' },\n ],\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, linkedSignal, untracked } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { map } from 'rxjs';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdTab, SdTabGroup } from '@sdcorejs/angular/components/tab';\nimport { SdPageComponent } from '@sdcorejs/angular/modules/layout';\nimport { SdPermissionDirective } from '@sdcorejs/angular/modules/permission';\nimport { DebtsViewComponent } from '../../components/debts-view/debts-view.component';\nimport { DocumentsViewComponent } from '../../components/documents-view/documents-view.component';\nimport { GeneralInformationViewComponent } from '../../components/general-information-view/general-information-view.component';\nimport { OrdersViewComponent } from '../../components/orders-view/orders-view.component';\nimport { customerStatusBadge, customerTypeName, type CustomerDto } from '../../services/customer.model';\n\nconst TABS = [\n { key: 'info', label: 'Thông tin' },\n { key: 'orders', label: 'Đơn hàng' },\n { key: 'debts', label: 'Công nợ' },\n { key: 'documents', label: 'Tài liệu' },\n] as const;\ntype TabKey = (typeof TABS)[number]['key'];\n\n/**\n * Hồ sơ 360° (`:id/360`): thông tin chung và các quan hệ của khách hàng theo tab. Tab ghi trên URL (`?tab=`);\n * mở tab nào mới tải tab đó, mỗi tab tự có trạng thái đang tải, rỗng và lỗi.\n */\n@Component({\n selector: 'profile',\n standalone: true,\n imports: [\n RouterLink,\n SdPageComponent,\n SdButton,\n SdTabGroup,\n SdTab,\n SdPermissionDirective,\n GeneralInformationViewComponent,\n OrdersViewComponent,\n DebtsViewComponent,\n DocumentsViewComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @let customer = entity();\n <sd-page-detail\n [title]=\"'Hồ sơ khách hàng #' + customer.code\"\n [description]=\"customer.name + ' · ' + typeName()\"\n [badges]=\"badges()\"\n [backLink]=\"['../..']\">\n <sd-button\n headerRight\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-profile-update\"\n [routerLink]=\"['../update']\" />\n <sd-tab-group sdSubheader [selectedIndex]=\"tabIndex()\" (selectedIndexChange)=\"selectTab($event)\">\n @for (tab of tabs; track tab.key) {\n <sd-tab [label]=\"tab.label\" />\n }\n </sd-tab-group>\n <div class=\"py-16\">\n @for (tab of tabs; track tab.key; let index = $index) {\n @if (opened().has(tab.key)) {\n <div [hidden]=\"tabIndex() !== index\" [attr.data-customer-tab]=\"tab.key\">\n @switch (tab.key) {\n @case ('info') {\n <general-information-view [customer]=\"customer\" />\n }\n @case ('orders') {\n <orders-view [customerId]=\"customer.id\" />\n }\n @case ('debts') {\n <debts-view [customerId]=\"customer.id\" />\n }\n @case ('documents') {\n <documents-view [customerId]=\"customer.id\" />\n }\n }\n </div>\n }\n }\n </div>\n </sd-page-detail>\n `,\n})\nexport class ProfileComponent {\n readonly #router = inject(Router);\n readonly #route = inject(ActivatedRoute);\n protected readonly tabs = TABS;\n protected readonly entity = toSignal(this.#route.data.pipe(map(data => data['entity'] as CustomerDto)), { requireSync: true });\n protected readonly badges = computed(() => [customerStatusBadge(this.entity().status)]);\n protected readonly typeName = computed(() => customerTypeName(this.entity().type));\n readonly #tabParam = toSignal(this.#route.queryParamMap.pipe(map(params => params.get('tab'))), { requireSync: true });\n protected readonly tabIndex = computed(() =>\n Math.max(\n 0,\n TABS.findIndex(tab => tab.key === this.#tabParam())\n )\n );\n /** Tab đã mở ít nhất một lần: giữ lại khi chuyển tab, không tải lại. Đổi khách hàng thì bắt đầu lại. */\n protected readonly opened = linkedSignal<CustomerDto, ReadonlySet<TabKey>>({\n source: this.entity,\n // untracked: đổi tab không được đặt lại các tab đã mở; chỉ đổi khách hàng mới bắt đầu lại.\n computation: () => new Set<TabKey>([TABS[untracked(this.tabIndex)].key]),\n });\n\n protected selectTab(index: number): void {\n const key = TABS[index]?.key ?? 'info';\n this.opened.update(opened => new Set([...opened, key]));\n void this.#router.navigate([], {\n relativeTo: this.#route,\n queryParams: { tab: key === 'info' ? null : key },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA;MAQa,kBAAkB,CAAA;AACpB,IAAA,gBAAgB,GAAG,MAAM,CAAC,eAAe,CAAC;AAC1C,IAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,qDAAU;AAC3B,IAAA,MAAM,GAAmC;AAC1D,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,KAAK,EAAE,MAAM,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC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s/angular/modules/permission';
|
|
3
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
4
|
+
import { inject } from '@angular/core';
|
|
5
|
+
import { timeout, map } from 'rxjs';
|
|
6
|
+
import { C as CustomerService } from './sdcorejs-angular-modules-pattern-customer.service-Bfx6_CmA.mjs';
|
|
7
|
+
|
|
8
|
+
/** Tải khách hàng bằng `detail(id)` trước khi mở drawer/trang; lỗi đi tới navigation error handler của host. */
|
|
9
|
+
const entityResolver = route => {
|
|
10
|
+
const id = route.paramMap.get('id');
|
|
11
|
+
if (!id?.trim())
|
|
12
|
+
throw new HttpErrorResponse({ status: 404 });
|
|
13
|
+
return inject(CustomerService)
|
|
14
|
+
.detail(id)
|
|
15
|
+
.pipe(timeout(10_000), map(entity => {
|
|
16
|
+
if (!entity || entity.id !== id)
|
|
17
|
+
throw new HttpErrorResponse({ status: 404 });
|
|
18
|
+
return entity;
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Chi tiết, tạo và cập nhật mở trong drawer (route con của danh sách); hồ sơ 360° là trang thay chỗ danh sách
|
|
24
|
+
* (`data.detail: 'page'`). Đóng drawer hay quay lại đều giữ bộ lọc, trang và vị trí cuộn của danh sách.
|
|
25
|
+
*/
|
|
26
|
+
const routes = [
|
|
27
|
+
{
|
|
28
|
+
path: '',
|
|
29
|
+
providers: [CustomerService],
|
|
30
|
+
canActivateChild: [SdPermissionGuard],
|
|
31
|
+
children: [
|
|
32
|
+
{
|
|
33
|
+
path: '',
|
|
34
|
+
title: 'Khách hàng',
|
|
35
|
+
data: { permission: 'PATTERN_CUSTOMER_R_LIST' },
|
|
36
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-list.component-DkVrMSPZ.mjs').then(module => module.ListComponent),
|
|
37
|
+
children: [
|
|
38
|
+
{
|
|
39
|
+
path: 'create',
|
|
40
|
+
data: { permission: 'PATTERN_CUSTOMER_C_CREATE' },
|
|
41
|
+
canDeactivate: [sdPageFormLeaveGuard],
|
|
42
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-create-side-drawer.component-C9WQdsEi.mjs').then(module => module.CreateSideDrawerComponent),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: ':id/detail',
|
|
46
|
+
data: { permission: 'PATTERN_CUSTOMER_R_DETAIL' },
|
|
47
|
+
resolve: { entity: entityResolver },
|
|
48
|
+
runGuardsAndResolvers: 'paramsChange',
|
|
49
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-detail-side-drawer.component-3PUIy1Vi.mjs').then(module => module.DetailSideDrawerComponent),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: ':id/update',
|
|
53
|
+
data: { permission: 'PATTERN_CUSTOMER_U_UPDATE' },
|
|
54
|
+
resolve: { entity: entityResolver },
|
|
55
|
+
runGuardsAndResolvers: 'paramsChange',
|
|
56
|
+
canDeactivate: [sdPageFormLeaveGuard],
|
|
57
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-update-side-drawer.component-xFbutFLY.mjs').then(module => module.UpdateSideDrawerComponent),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
path: ':id/360',
|
|
61
|
+
title: 'Hồ sơ khách hàng',
|
|
62
|
+
data: { permission: 'PATTERN_CUSTOMER_R_DETAIL', detail: 'page' },
|
|
63
|
+
resolve: { entity: entityResolver },
|
|
64
|
+
runGuardsAndResolvers: 'paramsChange',
|
|
65
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-profile.component-YsWsrKWJ.mjs').then(module => module.ProfileComponent),
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export { routes };
|
|
74
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-routes-9ujH01cX.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/customer/entity.resolver.ts","../../../projects/sdcorejs-angular/modules/pattern/features/customer/routes.ts"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport type { ResolveFn } from '@angular/router';\nimport { map, timeout } from 'rxjs';\nimport { CustomerService } from './services/customer.service';\nimport type { CustomerDto } from './services/customer.model';\n\n/** Tải khách hàng bằng `detail(id)` trước khi mở drawer/trang; lỗi đi tới navigation error handler của host. */\nexport const entityResolver: ResolveFn<CustomerDto> = route => {\n const id = route.paramMap.get('id');\n if (!id?.trim()) throw new HttpErrorResponse({ status: 404 });\n return inject(CustomerService)\n .detail(id)\n .pipe(\n timeout(10_000),\n map(entity => {\n if (!entity || entity.id !== id) throw new HttpErrorResponse({ status: 404 });\n return entity;\n })\n );\n};\n","import type { Routes } from '@angular/router';\nimport { sdPageFormLeaveGuard } from '@sdcorejs/angular/modules/layout';\nimport { SdPermissionGuard } from '@sdcorejs/angular/modules/permission';\nimport { entityResolver } from './entity.resolver';\nimport { CustomerService } from './services/customer.service';\n\n/**\n * Chi tiết, tạo và cập nhật mở trong drawer (route con của danh sách); hồ sơ 360° là trang thay chỗ danh sách\n * (`data.detail: 'page'`). Đóng drawer hay quay lại đều giữ bộ lọc, trang và vị trí cuộn của danh sách.\n */\nexport const routes: Routes = [\n {\n path: '',\n providers: [CustomerService],\n canActivateChild: [SdPermissionGuard],\n children: [\n {\n path: '',\n title: 'Khách hàng',\n data: { permission: 'PATTERN_CUSTOMER_R_LIST' },\n loadComponent: () => import('./pages/list/list.component').then(module => module.ListComponent),\n children: [\n {\n path: 'create',\n data: { permission: 'PATTERN_CUSTOMER_C_CREATE' },\n canDeactivate: [sdPageFormLeaveGuard],\n loadComponent: () =>\n import('./components/create-side-drawer/create-side-drawer.component').then(module => module.CreateSideDrawerComponent),\n },\n {\n path: ':id/detail',\n data: { permission: 'PATTERN_CUSTOMER_R_DETAIL' },\n resolve: { entity: entityResolver },\n runGuardsAndResolvers: 'paramsChange',\n loadComponent: () =>\n import('./components/detail-side-drawer/detail-side-drawer.component').then(module => module.DetailSideDrawerComponent),\n },\n {\n path: ':id/update',\n data: { permission: 'PATTERN_CUSTOMER_U_UPDATE' },\n resolve: { entity: entityResolver },\n runGuardsAndResolvers: 'paramsChange',\n canDeactivate: [sdPageFormLeaveGuard],\n loadComponent: () =>\n import('./components/update-side-drawer/update-side-drawer.component').then(module => module.UpdateSideDrawerComponent),\n },\n {\n path: ':id/360',\n title: 'Hồ sơ khách hàng',\n data: { permission: 'PATTERN_CUSTOMER_R_DETAIL', detail: 'page' },\n resolve: { entity: entityResolver },\n runGuardsAndResolvers: 'paramsChange',\n loadComponent: () => import('./pages/profile/profile.component').then(module => module.ProfileComponent),\n },\n ],\n },\n ],\n },\n];\n"],"names":[],"mappings":";;;;;;;AAOA;AACO,MAAM,cAAc,GAA2B,KAAK,IAAG;IAC5D,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACnC,IAAA,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE;QAAE,MAAM,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC7D,OAAO,MAAM,CAAC,eAAe;SAC1B,MAAM,CAAC,EAAE;SACT,IAAI,CACH,OAAO,CAAC,MAAM,CAAC,EACf,GAAG,CAAC,MAAM,IAAG;AACX,QAAA,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE;YAAE,MAAM,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAC7E,QAAA,OAAO,MAAM;IACf,CAAC,CAAC,CACH;AACL,CAAC;;ACdD;;;AAGG;AACI,MAAM,MAAM,GAAW;AAC5B,IAAA;AACE,QAAA,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,CAAC,eAAe,CAAC;QAC5B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AAC1H,qBAAA;AACD,oBAAA;AACE,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,KAAK,EAAE,kBAAkB;wBACzB,IAAI,EAAE,EAAE,UAAU,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM,EAAE;AACjE,wBAAA,OAAO,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;AACnC,wBAAA,qBAAqB,EAAE,cAAc;AACrC,wBAAA,aAAa,EAAE,MAAM,OAAO,mEAAmC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAAC;AACzG,qBAAA;AACF,iBAAA;AACF,aAAA;AACF,SAAA;AACF,KAAA;;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SdPermissionGuard } from '@sdcorejs/angular/modules/permission';
|
|
2
|
+
import { HttpParams } from '@angular/common/http';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable } from '@angular/core';
|
|
5
|
+
import { B as BaseApiService } from './sdcorejs-angular-modules-pattern-base-api.service-BubUwgBK.mjs';
|
|
6
|
+
|
|
7
|
+
class PartnerService extends BaseApiService {
|
|
8
|
+
/** Mã còn dùng được không; gọi khi rời bước nhập mã, API vẫn kiểm tra lại lúc lưu. */
|
|
9
|
+
checkCode(code) {
|
|
10
|
+
return this.http.get(this.apiUrl('partners', 'check-code'), { params: new HttpParams().set('code', code) });
|
|
11
|
+
}
|
|
12
|
+
create(req) {
|
|
13
|
+
return this.http.post(this.apiUrl('partners'), req);
|
|
14
|
+
}
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PartnerService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
16
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PartnerService });
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PartnerService, decorators: [{
|
|
19
|
+
type: Injectable
|
|
20
|
+
}] });
|
|
21
|
+
|
|
22
|
+
const routes = [
|
|
23
|
+
{
|
|
24
|
+
path: '',
|
|
25
|
+
providers: [PartnerService],
|
|
26
|
+
canActivateChild: [SdPermissionGuard],
|
|
27
|
+
children: [
|
|
28
|
+
{ path: '', pathMatch: 'full', redirectTo: 'create' },
|
|
29
|
+
{
|
|
30
|
+
path: 'create',
|
|
31
|
+
title: 'Tạo đối tác',
|
|
32
|
+
data: { permission: 'PATTERN_PARTNER_C_CREATE' },
|
|
33
|
+
loadComponent: () => import('./sdcorejs-angular-modules-pattern-create.component-D4GrcahQ.mjs').then(module => module.CreateComponent),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
var routes$1 = /*#__PURE__*/Object.freeze({
|
|
40
|
+
__proto__: null,
|
|
41
|
+
routes: routes
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { PartnerService as P, routes$1 as r };
|
|
45
|
+
//# sourceMappingURL=sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-pattern-routes-BfpsCkim.mjs","sources":["../../../projects/sdcorejs-angular/modules/pattern/features/partner/services/partner.service.ts","../../../projects/sdcorejs-angular/modules/pattern/features/partner/routes.ts"],"sourcesContent":["import { HttpParams } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport type { Observable } from 'rxjs';\nimport { BaseApiService } from '../../../services/base-api.service';\nimport type { PartnerDto, PartnerSaveReq } from './partner.model';\n\n@Injectable()\nexport class PartnerService extends BaseApiService {\n /** Mã còn dùng được không; gọi khi rời bước nhập mã, API vẫn kiểm tra lại lúc lưu. */\n checkCode(code: string): Observable<{ available: boolean }> {\n return this.http.get<{ available: boolean }>(this.apiUrl('partners', 'check-code'), { params: new HttpParams().set('code', code) });\n }\n\n create(req: PartnerSaveReq): Observable<PartnerDto> {\n return this.http.post<PartnerDto>(this.apiUrl('partners'), req);\n }\n}\n","import type { Routes } from '@angular/router';\nimport { SdPermissionGuard } from '@sdcorejs/angular/modules/permission';\nimport { PartnerService } from './services/partner.service';\n\nexport const routes: Routes = [\n {\n path: '',\n providers: [PartnerService],\n canActivateChild: [SdPermissionGuard],\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'create' },\n {\n path: 'create',\n title: 'Tạo đối tác',\n data: { permission: 'PATTERN_PARTNER_C_CREATE' },\n loadComponent: () => import('./pages/create/create.component').then(module => module.CreateComponent),\n },\n ],\n },\n];\n"],"names":[],"mappings":";;;;;;AAOM,MAAO,cAAe,SAAQ,cAAc,CAAA;;AAEhD,IAAA,SAAS,CAAC,IAAY,EAAA;AACpB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;IACrI;AAEA,IAAA,MAAM,CAAC,GAAmB,EAAA;AACxB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAa,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC;IACjE;wGARW,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAd,cAAc,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACFM,MAAM,MAAM,GAAW;AAC5B,IAAA;AACE,QAAA,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,CAAC,cAAc,CAAC;QAC3B,gBAAgB,EAAE,CAAC,iBAAiB,CAAC;AACrC,QAAA,QAAQ,EAAE;YACR,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE;AACrD,YAAA;AACE,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,KAAK,EAAE,aAAa;AACpB,gBAAA,IAAI,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE;AAChD,gBAAA,aAAa,EAAE,MAAM,OAAO,kEAAiC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC;AACtG,aAAA;AACF,SAAA;AACF,KAAA;CACF;;;;;;;;;"}
|