@sdcorejs/angular 21.3.2 → 21.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/THEME.md +58 -6
- package/assets/scss/core/form.scss +291 -3
- package/assets/scss/themes/_component-tokens.scss +35 -6
- package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +458 -42
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +15 -3
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +393 -78
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +1669 -126
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +5 -2
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +414 -122
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +17 -2
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +4 -0
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +26 -20
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +14 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +350 -5
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs → sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +348 -11
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs +51 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs +144 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs +145 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs +460 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs +142 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.mjs +113 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.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-5hBM9st3.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-5hBM9st3.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs +148 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs +484 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs +172 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs +90 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs +514 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs +61 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +232 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +87 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-CxDQKd64.mjs +170 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-CxDQKd64.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +70 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs +812 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs +164 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs +115 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs +629 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs +118 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs +71 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs +1069 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs +193 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.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-DZ3fY-yQ.mjs +48 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-product.service-DZ3fY-yQ.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs +293 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs +165 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs +50 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs +99 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs +45 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs +66 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs +43 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs +74 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs +406 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs +317 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs +132 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs +143 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs +100 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs +138 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs +359 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-api.mjs +11 -11
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +7 -5
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +6 -4
- 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/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 +815 -0
- package/modules/pattern/docs/header-actions.md +344 -0
- package/modules/pattern/docs/list.md +247 -0
- package/modules/pattern/docs/relation.md +180 -0
- package/modules/pattern/docs/select.md +214 -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 +130 -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 +138 -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 +182 -0
- package/modules/pattern/features/order/components/lines-form/order-lines.ts +101 -0
- package/modules/pattern/features/order/components/lines-table-form/lines-table-form.component.ts +196 -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 +113 -0
- package/modules/pattern/features/order/pages/detail/detail.component.ts +224 -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 +126 -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 +73 -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 +92 -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 +228 -0
- package/modules/pattern/features/settings/routes.ts +24 -0
- package/modules/pattern/features/settings/services/settings.model.ts +18 -0
- package/modules/pattern/features/settings/services/settings.service.ts +15 -0
- package/modules/pattern/features/settings/settings.resolver.ts +8 -0
- package/package.json +5 -1
- package/types/sdcorejs-angular-components-badge.d.ts +19 -1
- package/types/sdcorejs-angular-components-query-bar.d.ts +126 -11
- package/types/sdcorejs-angular-components-section.d.ts +13 -1
- package/types/sdcorejs-angular-components-splitter.d.ts +1 -1
- package/types/sdcorejs-angular-components-tab-router.d.ts +47 -5
- package/types/sdcorejs-angular-components-table.d.ts +300 -25
- package/types/sdcorejs-angular-components-upload-file.d.ts +181 -21
- package/types/sdcorejs-angular-forms-chip.d.ts +136 -26
- package/types/sdcorejs-angular-i18n.d.ts +70 -1
- package/types/sdcorejs-angular-modules-layout.d.ts +89 -6
- package/types/sdcorejs-angular-modules-pattern.d.ts +50 -0
- package/types/sdcorejs-angular-services-api.d.ts +5 -5
- package/types/sdcorejs-angular-services-cache.d.ts +4 -2
- package/types/sdcorejs-angular-services-storage.d.ts +3 -1
- package/types/sdcorejs-angular-services-unsaved-changes.d.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs","sources":["../../../projects/sdcorejs-angular/modules/generic/src/registry/generic-registry.ts","../../../projects/sdcorejs-angular/modules/generic/src/registry/provide-sd-generic.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-configuration-store.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-defaults.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-title.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-search.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-columns.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-form.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-import.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-merge.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-permission.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-property-icon.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-validate.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/index.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-data.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-import.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-permission.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-relation-catalog.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-schema.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/routes/generic-route.guards.ts","../../../projects/sdcorejs-angular/modules/generic/src/routes/sd-generic.routes.ts","../../../projects/sdcorejs-angular/modules/generic/sdcorejs-angular-modules-generic.ts"],"sourcesContent":["import { InjectionToken, Injector, inject, type Type } from '@angular/core';\nimport type { SdGenericAdapter, SdGenericConfiguration, SdGenericDisplay, SdGenericEntityConfiguration } from '../models';\n\n/** What a form shown inside the list outlet needs from the list (D-024). */\nexport interface SdGenericListHost {\n reload(): void;\n /** The form reports its display mode: a page form takes the place of the list, a side drawer keeps it visible. */\n setFormDisplay(display: SdGenericDisplay): void;\n}\n\n/** Provided by the list page for the form pages of its outlet. */\nexport const SD_GENERIC_LIST_HOST = new InjectionToken<SdGenericListHost>('SD_GENERIC_LIST_HOST');\n\n/** Adapter lists of every `provideSdGeneric` call in one injector. */\nexport const SD_GENERIC_ADAPTERS = new InjectionToken<SdGenericConfiguration['adapters'][]>('SD_GENERIC_ADAPTERS');\n/** Entity configurations of every `provideSdGenericEntity` call in one injector. */\nexport const SD_GENERIC_ENTITIES = new InjectionToken<SdGenericEntityConfiguration[]>('SD_GENERIC_ENTITIES');\n/** `permission` option of every `provideSdGeneric` call in one injector. */\nexport const SD_GENERIC_PERMISSION_OPTION = new InjectionToken<(boolean | undefined)[]>('SD_GENERIC_PERMISSION_OPTION');\n\nconst entityKey = (module: string, entity: string) => `${module}.${entity}`;\n\n/**\n * Registrations of one injector plus a link to the scope of the parent injector. Lookups walk from the nearest\n * scope to the root, so a lazy route can override what the root declares (INV-001).\n */\nexport class SdGenericScope {\n constructor(\n readonly adapters: ReadonlyMap<string, SdGenericAdapter>,\n readonly entities: ReadonlyMap<string, SdGenericEntityConfiguration>,\n readonly permission: boolean | undefined,\n readonly parent: SdGenericScope | null\n ) {}\n\n adapter(module: string): SdGenericAdapter | undefined {\n return this.adapters.get(module) ?? this.parent?.adapter(module);\n }\n\n entity(module: string, entity: string): SdGenericEntityConfiguration | undefined {\n return this.entities.get(entityKey(module, entity)) ?? this.parent?.entity(module, entity);\n }\n\n /** `permission` of the nearest scope that declares it; `true` when none does. */\n permissionEnabled(): boolean {\n return this.permission ?? this.parent?.permissionEnabled() ?? true;\n }\n}\n\n/** Scope of the current injector. Every generic screen reads adapters and entity settings only through it. */\nexport const SD_GENERIC_SCOPE = new InjectionToken<SdGenericScope>('SD_GENERIC_SCOPE', {\n providedIn: 'root',\n factory: () => new SdGenericScope(new Map(), new Map(), undefined, null),\n});\n\nconst isAdapterClass = (value: Type<SdGenericAdapter> | SdGenericAdapter): value is Type<SdGenericAdapter> => typeof value === 'function';\n\n/** Factory of the scope of one injector: reads that injector's own registrations, links the parent scope. */\nexport const sdGenericScopeFactory = (): SdGenericScope => {\n const injector = inject(Injector);\n const adapters = new Map<string, SdGenericAdapter>();\n for (const value of (inject(SD_GENERIC_ADAPTERS, { self: true, optional: true }) ?? []).flat()) {\n const adapter = isAdapterClass(value) ? injector.get(value) : value;\n // why: two adapters for one module in the same injector are ambiguous (D-020); fail while the injector is created.\n if (adapters.has(adapter.module))\n throw new Error(`SdGeneric: the module \"${adapter.module}\" is registered twice in the same injector.`);\n adapters.set(adapter.module, adapter);\n }\n const entities = new Map<string, SdGenericEntityConfiguration>();\n for (const entity of inject(SD_GENERIC_ENTITIES, { self: true, optional: true }) ?? []) {\n const key = entityKey(entity.module, entity.entity);\n if (entities.has(key)) throw new Error(`SdGeneric: the entity \"${key}\" is configured twice in the same injector.`);\n entities.set(key, entity);\n }\n const permission = (inject(SD_GENERIC_PERMISSION_OPTION, { self: true, optional: true }) ?? [])\n .filter(value => value !== undefined)\n .pop();\n const parent = inject(SD_GENERIC_SCOPE, { skipSelf: true, optional: true });\n return new SdGenericScope(adapters, entities, permission, parent);\n};\n","import {\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n type EnvironmentProviders,\n type Provider,\n type Type,\n} from '@angular/core';\nimport type { SdGenericAdapter, SdGenericConfiguration, SdGenericEntityConfiguration } from '../models';\nimport {\n SD_GENERIC_ADAPTERS,\n SD_GENERIC_ENTITIES,\n SD_GENERIC_PERMISSION_OPTION,\n SD_GENERIC_SCOPE,\n sdGenericScopeFactory,\n} from './generic-registry';\n\nconst scopeProviders = (): (Provider | EnvironmentProviders)[] => [\n { provide: SD_GENERIC_SCOPE, useFactory: sdGenericScopeFactory },\n // why: build the scope as soon as the injector exists, so a duplicate module throws at bootstrap / route\n // activation instead of on the first generic screen (AC-003).\n provideEnvironmentInitializer(() => inject(SD_GENERIC_SCOPE)),\n];\n\n/**\n * Registers backend adapters for the generic module. Call it at the root and/or in the `providers` of lazy\n * routes: lookups use the nearest injector first, then its parents. Adapter classes are created by DI.\n *\n * @example\n * provideSdGeneric({ adapters: [TmsAdapter] });\n */\nexport function provideSdGeneric(configuration: SdGenericConfiguration): EnvironmentProviders {\n const classes = configuration.adapters.filter((adapter): adapter is Type<SdGenericAdapter> => typeof adapter === 'function');\n return makeEnvironmentProviders([\n ...classes.map(adapter => ({ provide: adapter, useClass: adapter })),\n { provide: SD_GENERIC_ADAPTERS, multi: true, useValue: configuration.adapters },\n { provide: SD_GENERIC_PERMISSION_OPTION, multi: true, useValue: configuration.permission },\n ...scopeProviders(),\n ]);\n}\n\n/**\n * Code-level customization of one entity: schema adjustments, dedicated search, display mode, save hooks and\n * custom actions. Same scoping rules as `provideSdGeneric`.\n */\nexport function provideSdGenericEntity(configuration: SdGenericEntityConfiguration): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: SD_GENERIC_ENTITIES, multi: true, useValue: configuration }, ...scopeProviders()]);\n}\n","import type { SdGenericSchema, SdGenericSchemaStore } from '../models';\n\n/** `localStorage` key of the customized schema of one entity (A-005). */\nexport const sdGenericStorageKey = (module: string, entity: string): string => `sd-generic:configuration:${module}.${entity}`;\n\n/**\n * Default schema store when the adapter has no `schemaStore`. It only lives in this browser, so real deployments\n * should give the adapter a `schemaStore` backed by the server.\n */\nexport class SdGenericLocalStore implements SdGenericSchemaStore {\n constructor(private readonly module: string) {}\n\n async get(entity: string): Promise<SdGenericSchema | null> {\n let raw: string | null;\n try {\n raw = localStorage.getItem(sdGenericStorageKey(this.module, entity));\n } catch {\n // why: no storage (server rendering, blocked site data) means no configuration yet, not a failed screen.\n return null;\n }\n if (raw === null) return null;\n try {\n return JSON.parse(raw) as SdGenericSchema;\n } catch {\n // why: unreadable content is handed to the validator, which reports it as a shape error (fallback to default).\n return raw as unknown as SdGenericSchema;\n }\n }\n\n async set(entity: string, schema: SdGenericSchema): Promise<void> {\n localStorage.setItem(sdGenericStorageKey(this.module, entity), JSON.stringify(schema));\n }\n}\n","import type { SdGenericListColumn, SdGenericProperty, SdGenericSchema } from '../models';\n\nexport const SD_GENERIC_DEFAULT_PAGE_SIZE = 20;\n\n/** Data types that get no list column unless one is configured, and are never imported. */\nconst NOT_LISTED = new Set(['json', 'file']);\n\n/** Configured columns, or every property except `json` and `file`. */\nexport const sdGenericListColumns = (schema: SdGenericSchema): SdGenericListColumn[] =>\n schema.list?.columns ??\n schema.general.properties.filter(property => !NOT_LISTED.has(property.dataType)).map(property => ({ key: property.key }));\n\nexport const sdGenericPageSize = (schema: SdGenericSchema): number => schema.list?.pageSize ?? SD_GENERIC_DEFAULT_PAGE_SIZE;\n\nexport const sdGenericPrimaryKey = (schema: SdGenericSchema): string => schema.general.primaryKey || 'id';\n\n/** Whether a create form may contain the property. */\nexport const sdGenericCanInsert = (property: SdGenericProperty): boolean => !property.system && property.insertable !== false;\n\n/** Whether an update form may contain the property. */\nexport const sdGenericCanUpdate = (property: SdGenericProperty): boolean => !property.system && property.updatable !== false;\n\n/** Whether the default import columns contain the property: insertable, and neither `json` nor `file`. */\nexport const sdGenericImportable = (property: SdGenericProperty): boolean =>\n sdGenericCanInsert(property) && !NOT_LISTED.has(property.dataType);\n\n/** Properties indexed by key. */\nexport const sdGenericPropertyMap = (schema: SdGenericSchema): Map<string, SdGenericProperty> =>\n new Map(schema.general.properties.map(property => [property.key, property]));\n","import type { SdGenericRecord, SdGenericSchemaIssue } from '../models';\n\nconst PLACEHOLDER = /\\$\\{\\s*([^}]*?)\\s*\\}/g;\n\nexport type SdGenericTitleSection = 'list' | 'create' | 'detail' | 'update';\n\n/** Keys referenced by `${key}` placeholders, in order. */\nexport const sdGenericTitlePlaceholders = (template: string): string[] => Array.from(template.matchAll(PLACEHOLDER), match => match[1]);\n\n/**\n * Replaces `${key}` with the record value. The result is plain text: callers bind it with text interpolation,\n * never as HTML (INV-006).\n */\nexport const sdGenericRenderTitle = (template: string, record?: SdGenericRecord | null): string =>\n template.replace(PLACEHOLDER, (_, key: string) => {\n const value = record?.[key];\n return value === undefined || value === null ? '' : String(value);\n });\n\n/** Issues of one section title: list/create titles take no placeholder, detail/update ones only known keys. */\nexport const sdGenericTitleIssues = (\n section: SdGenericTitleSection,\n template: unknown,\n keys: ReadonlySet<string>\n): SdGenericSchemaIssue[] => {\n const path = `${section}.title`;\n if (template === undefined) return [];\n if (typeof template !== 'string') return [{ code: 'shape', severity: 'error', path, message: `${path} must be a string.` }];\n const placeholders = sdGenericTitlePlaceholders(template);\n if (section === 'list' || section === 'create') {\n return placeholders.length\n ? [\n {\n code: 'title-placeholder-forbidden',\n severity: 'error',\n path,\n message: `${path} cannot contain placeholders; there is no record yet.`,\n },\n ]\n : [];\n }\n return placeholders\n .filter(key => !keys.has(key))\n .map(key => ({\n code: 'title-placeholder-unknown' as const,\n severity: 'error' as const,\n path,\n message: `${path} references the unknown property \"${key}\".`,\n }));\n};\n","import type { Filter, PagingReq } from '@sdcorejs/utils/models';\nimport type { SdGenericProperty, SdGenericRecord, SdGenericSearchReq } from '../models';\nimport { sdGenericRenderTitle } from './generic-title';\n\nconst DEFAULT_LIMIT = 20;\n\n/** Relation of a property with its defaults resolved. */\nexport interface SdGenericRelationInfo {\n module: string;\n entity: string;\n valueField: string;\n displayField: string;\n searchFields: string[];\n display?: string;\n}\n\n/** Relation defaults: the schema module, `valueField` `id`, `displayField` the value field, search on the display field. */\nexport const sdGenericRelationInfo = (property: SdGenericProperty, module: string): SdGenericRelationInfo => {\n const relation = property.relation ?? { entity: '' };\n const valueField = relation.valueField || 'id';\n const displayField = relation.displayField || valueField;\n const info: SdGenericRelationInfo = {\n module: relation.module || module,\n entity: relation.entity,\n valueField,\n displayField,\n searchFields: relation.searchFields?.length ? [...relation.searchFields] : [displayField],\n };\n if (relation.display) info.display = relation.display;\n return info;\n};\n\n/** `query` request used when neither the entity nor the adapter has a search: `IN` for values, `CONTAIN` for a term. */\nexport const sdGenericSearchPagingReq = (req: SdGenericSearchReq): PagingReq => {\n const filters: Filter[] = [...(req.filters ?? [])];\n if (req.values?.length) {\n filters.push({ field: req.valueField, operator: 'IN', data: [...req.values] as never });\n } else if (req.term) {\n filters.push({ operator: 'OR', data: req.fields.map(field => ({ field, operator: 'CONTAIN', data: req.term })) } as Filter);\n }\n return { pageNumber: 0, pageSize: req.values?.length || req.limit || DEFAULT_LIMIT, filters };\n};\n\n/** Text label of a related record: the display template, then the display field, then the value field. */\nexport const sdGenericRecordLabel = (record: SdGenericRecord, info: SdGenericRelationInfo): string => {\n if (info.display) return sdGenericRenderTitle(info.display, record);\n const value = record[info.displayField] ?? record[info.valueField];\n return value === undefined || value === null ? '' : String(value);\n};\n\n/** form-generic option values are strings; this restores the original value (a numeric id stays a number). */\nexport const sdGenericCoerceValue = (raw: unknown, known: ReadonlyMap<string, unknown>): unknown => {\n if (Array.isArray(raw)) return raw.map(item => sdGenericCoerceValue(item, known));\n if (typeof raw === 'string' && known.has(raw)) return known.get(raw);\n return raw;\n};\n","import type { SdTableColumn, SdTableExternalFilter } from '@sdcorejs/angular/components/table';\nimport type { SdSearch } from '@sdcorejs/angular/forms/models';\nimport type { SdGenericListColumn, SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericListColumns, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Field added by the data service to related records when the relation has a display template. */\nexport const SD_GENERIC_LABEL_FIELD = '$label';\n\n/** Lookups of relation columns and filters, provided by the data service so this file stays pure. */\nexport interface SdGenericColumnDeps {\n relationSearch(property: SdGenericProperty): SdSearch<SdGenericRecord>;\n relationViews(property: SdGenericProperty): (values: string[]) => Promise<SdGenericRecord[]>;\n}\n\ntype Column = SdTableColumn<SdGenericRecord>;\n\nconst relationDisplayField = (property: SdGenericProperty, schema: SdGenericSchema): string => {\n const info = sdGenericRelationInfo(property, schema.module);\n return info.display ? SD_GENERIC_LABEL_FIELD : info.displayField;\n};\n\nconst fileNames = (value: unknown): string =>\n (Array.isArray(value) ? value : value === undefined || value === null ? [] : [value])\n .map(item => (item && typeof item === 'object' ? String((item as Record<string, unknown>)['name'] ?? '') : String(item)))\n .filter(Boolean)\n .join(', ');\n\nconst columnOf = (property: SdGenericProperty, schema: SdGenericSchema, deps: SdGenericColumnDeps): Column => {\n const base = { field: property.key, title: property.label };\n switch (property.dataType) {\n case 'number':\n return { ...base, type: 'number' };\n case 'boolean':\n return { ...base, type: 'boolean' };\n case 'date':\n case 'datetime':\n return { ...base, type: property.dataType };\n case 'time':\n return { ...base, type: 'time' };\n case 'enum': {\n const enums = property.enums ?? [];\n const styled = enums.some(option => option.color || option.icon);\n return {\n ...base,\n type: 'values',\n option: {\n items: enums,\n valueField: 'value',\n displayField: 'label',\n ...(property.multiple ? { selection: 'MULTIPLE' as const } : {}),\n },\n ...(styled\n ? {\n useBadge: (value: unknown) => {\n const option = enums.find(candidate => candidate.value === value);\n return { color: option?.color as never, icon: option?.icon };\n },\n }\n : {}),\n } as Column;\n }\n case 'relation': {\n const info = sdGenericRelationInfo(property, schema.module);\n return {\n ...base,\n type: 'lazy-values',\n option: {\n items: deps.relationSearch(property),\n valueField: info.valueField,\n displayField: relationDisplayField(property, schema),\n views: deps.relationViews(property),\n ...(property.multiple ? { selection: 'MULTIPLE' as const } : {}),\n },\n } as Column;\n }\n case 'json':\n return {\n ...base,\n type: 'string',\n transform: (value: unknown) => (value === undefined || value === null ? '' : JSON.stringify(value)),\n };\n case 'file':\n return { ...base, type: 'string', transform: (value: unknown) => fileNames(value) };\n default:\n return { ...base, type: 'string' };\n }\n};\n\nconst withFlags = (column: Column, config: SdGenericListColumn): Column => ({\n ...column,\n ...(config.width ? { width: `${config.width}px` } : {}),\n ...(config.visible === false ? { invisible: true } : {}),\n ...(config.sortable !== undefined ? { sortable: config.sortable } : {}),\n ...(config.filterable === false ? { filter: { disabled: true } } : {}),\n});\n\n/**\n * sd-table columns of the list (INV-013); configured keys that no longer exist are skipped. With `open`, the first\n * visible column that is not a server field (else the first visible one) links to the record.\n */\nexport const sdGenericTableColumns = (\n schema: SdGenericSchema,\n deps: SdGenericColumnDeps,\n open?: (row: SdGenericRecord) => void\n): Column[] => {\n const properties = sdGenericPropertyMap(schema);\n const configs = sdGenericListColumns(schema).filter(config => properties.has(config.key));\n const visible = configs.filter(config => config.visible !== false);\n const link = open ? (visible.find(config => !properties.get(config.key)!.system) ?? visible[0]) : undefined;\n return configs.map(config => {\n const column = withFlags(columnOf(properties.get(config.key)!, schema, deps), config);\n return config === link ? { ...column, click: (_value: unknown, row: SdGenericRecord) => open!(row) } : column;\n });\n};\n\n/** sd-table external filters of the list, shown by default; json and file properties cannot be filtered. */\nexport const sdGenericExternalFilters = (schema: SdGenericSchema, deps: SdGenericColumnDeps): SdTableExternalFilter[] => {\n const properties = sdGenericPropertyMap(schema);\n return (schema.list?.externalFilters ?? []).flatMap(config => {\n const property = properties.get(config.key);\n if (!property) return [];\n const base = {\n field: property.key,\n title: property.label,\n // why: a configured filter is shown right away; the list hides the toolbar that would let users pick it.\n defaultShowing: true,\n ...(config.required ? { required: true } : {}),\n ...(config.operator ? { defaultOperator: config.operator } : {}),\n ...(config.default !== undefined ? { default: config.default } : {}),\n };\n switch (property.dataType) {\n case 'string':\n case 'text':\n case 'time':\n return [{ ...base, type: 'string' } as SdTableExternalFilter];\n case 'number':\n return [{ ...base, type: 'number' } as SdTableExternalFilter];\n case 'boolean':\n return [{ ...base, type: 'boolean' } as SdTableExternalFilter];\n case 'date':\n case 'datetime':\n return [{ ...base, type: 'daterange', ...(property.dataType === 'datetime' ? { enableTime: true } : {}) } as SdTableExternalFilter];\n case 'enum':\n return [\n {\n ...base,\n type: 'values',\n option: { items: property.enums ?? [], valueField: 'value', displayField: 'label', selection: 'MULTIPLE' },\n } as SdTableExternalFilter,\n ];\n case 'relation': {\n const info = sdGenericRelationInfo(property, schema.module);\n return [\n {\n ...base,\n type: 'lazy-values',\n option: {\n items: deps.relationSearch(property),\n valueField: info.valueField,\n displayField: relationDisplayField(property, schema),\n selection: 'MULTIPLE',\n },\n } as SdTableExternalFilter,\n ];\n }\n default:\n return [];\n }\n });\n};\n","import type { SdFormGenericField, SdFormGenericFieldValidation, SdFormGenericSchema } from '@sdcorejs/angular/components/form-generic';\nimport type { SdGenericFormAction, SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericCanInsert, sdGenericCanUpdate, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Id of the form-generic catalog that serves every relation select (D-022). */\nexport const SD_GENERIC_RELATION_CATALOG = 'sd-generic-relation';\n\ntype FieldType = SdFormGenericField['type'];\ntype JsonRecord = Record<string, unknown>;\n\nconst STRING_FORMATS = new Set(['email', 'phone', 'url', 'password']);\nconst NUMBER_FORMATS = new Set(['integer', 'decimal', 'currency', 'percent']);\n/** Layout-only members of a stored field; everything else comes from `general` (INV-007). */\nconst LAYOUT_MEMBERS = ['layout', 'rules', 'helperText', 'placeholder', 'hidden', 'disabled', 'viewed', 'hyperlink', 'direction'] as const;\n\n/** form-generic field type generated for a property. */\nexport const sdGenericFieldType = (property: SdGenericProperty): FieldType => {\n switch (property.dataType) {\n case 'string':\n return property.multiple ? 'chip-string' : 'textfield';\n case 'text':\n return 'textarea';\n case 'number':\n return 'number';\n case 'boolean':\n return 'checkbox';\n case 'date':\n case 'datetime':\n return 'datetime';\n case 'time':\n return 'time';\n case 'enum':\n case 'relation':\n return 'select';\n case 'json':\n return 'json';\n case 'file':\n return 'upload';\n }\n};\n\n/** Field types a stored layout may use for a property: a single enum may also be a radio group. */\nexport const sdGenericAllowedFieldTypes = (property: SdGenericProperty): FieldType[] =>\n property.dataType === 'enum' && !property.multiple ? ['select', 'radio'] : [sdGenericFieldType(property)];\n\nconst validationOf = (property: SdGenericProperty): SdFormGenericFieldValidation | undefined => {\n const source = property.validation;\n if (!source) return undefined;\n const validation: SdFormGenericFieldValidation = {};\n if (source.required) validation.required = true;\n if (source.min !== undefined) validation.min = source.min;\n if (source.max !== undefined) validation.max = source.max;\n if (source.minLength !== undefined) validation.minLength = source.minLength;\n if (source.maxLength !== undefined) validation.maxLength = source.maxLength;\n if (source.pattern) validation.pattern = { value: source.pattern };\n return Object.keys(validation).length ? validation : undefined;\n};\n\nconst optionsOf = (property: SdGenericProperty, schema: SdGenericSchema): JsonRecord | undefined => {\n if (property.dataType === 'enum') {\n return { source: 'static', items: (property.enums ?? []).map(option => ({ value: option.value, label: option.label })) };\n }\n if (property.dataType === 'relation') {\n const info = sdGenericRelationInfo(property, schema.module);\n const param = (name: string, value: string) => ({ name, value: { value } });\n return {\n source: 'catalog',\n catalog: SD_GENERIC_RELATION_CATALOG,\n // why: constant params make the form-generic cache key unique per relation, not per entity.\n params: [\n param('module', info.module),\n param('entity', info.entity),\n param('valueField', info.valueField),\n param('displayField', info.displayField),\n param('searchFields', info.searchFields.join(',')),\n param('display', info.display ?? ''),\n ],\n };\n }\n return undefined;\n};\n\n/**\n * A full form-generic field: data from the property, layout members from the stored field when there is one. The\n * default value only fills a create form; on detail / update it would replace a value the record left empty.\n */\nconst hydrate = (\n property: SdGenericProperty,\n schema: SdGenericSchema,\n action: SdGenericFormAction,\n stored?: JsonRecord\n): SdFormGenericField => {\n const allowed = sdGenericAllowedFieldTypes(property);\n const type = stored && allowed.includes(stored['type'] as FieldType) ? (stored['type'] as FieldType) : sdGenericFieldType(property);\n const field: JsonRecord = {\n id: typeof stored?.['id'] === 'string' ? stored['id'] : property.key,\n key: property.key,\n type,\n label: property.label,\n };\n for (const member of LAYOUT_MEMBERS) if (stored && stored[member] !== undefined) field[member] = stored[member];\n const validation = validationOf(property);\n if (validation) field['validation'] = validation;\n if (action === 'create' && property.defaultValue !== undefined) field['defaultValue'] = property.defaultValue;\n if (type === 'textfield' && property.format && STRING_FORMATS.has(property.format)) field['subtype'] = property.format;\n if (type === 'number' && property.format && NUMBER_FORMATS.has(property.format)) field['subtype'] = property.format;\n if (type === 'datetime') field['subtype'] = property.dataType === 'datetime' ? 'datetime' : 'date';\n if (type === 'select' || type === 'radio') field['options'] = optionsOf(property, schema);\n if (type === 'select') field['multiple'] = !!property.multiple;\n if (type === 'upload' && !property.multiple) field['maxFiles'] = 1;\n return field as unknown as SdFormGenericField;\n};\n\nconst isAllowed =\n (action: SdGenericFormAction) =>\n (property: SdGenericProperty): boolean =>\n action === 'create' ? sdGenericCanInsert(property) : action === 'update' ? sdGenericCanUpdate(property) : true;\n\n/**\n * Form of one action: the action layout, then the detail layout, then a generated one-page layout. Stored fields\n * keep only their layout; type, label, options and validation always come from `general` (INV-007).\n */\nexport const sdGenericBuildForm = (schema: SdGenericSchema, action: SdGenericFormAction): SdFormGenericSchema => {\n const allowed = isAllowed(action);\n const properties = sdGenericPropertyMap(schema);\n const layout = schema[action]?.form ?? (action === 'detail' ? undefined : schema.detail?.form);\n if (!layout) {\n return {\n pages: [{ id: 'main', elements: schema.general.properties.filter(allowed).map(property => hydrate(property, schema, action)) }],\n };\n }\n const elementsOf = (elements: unknown): unknown[] =>\n (Array.isArray(elements) ? elements : []).flatMap((element): unknown[] => {\n const node = element as JsonRecord;\n if (node['type'] === 'group') return [{ ...node, elements: elementsOf(node['elements']) }];\n if (node['type'] === 'html') return [node];\n const property = properties.get(node['key'] as string);\n return property && allowed(property) ? [hydrate(property, schema, action, node)] : [];\n });\n return { ...layout, pages: layout.pages.map(page => ({ ...page, elements: elementsOf(page.elements) })) } as SdFormGenericSchema;\n};\n\n/** Payload of a save: only insertable values on create, only updatable values on update (INV-007). */\nexport const sdGenericFormPayload = (\n schema: SdGenericSchema,\n action: 'create' | 'update',\n value: Readonly<SdGenericRecord>\n): SdGenericRecord => {\n const allowed = isAllowed(action);\n const payload: SdGenericRecord = {};\n for (const property of schema.general.properties) {\n if (allowed(property) && Object.hasOwn(value, property.key)) payload[property.key] = value[property.key];\n }\n return payload;\n};\n","import type { SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericImportable, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Concurrent adapter calls of an import (D-016). */\nexport const SD_GENERIC_IMPORT_CONCURRENCY = 5;\n\n/** Values per lookup request of an import, so that one request stays under backend page-size and URL limits. */\nexport const SD_GENERIC_IMPORT_LOOKUP_SIZE = 100;\n\n/** Lookup entry of a match value that several records share; such a cell cannot be resolved. */\nexport const SD_GENERIC_AMBIGUOUS = Symbol('sd-generic-ambiguous');\n\nexport interface SdGenericImportColumnInfo {\n key: string;\n property: SdGenericProperty;\n /** Relation column: field of the related record matched against the cell. */\n matchField?: string;\n}\n\nexport interface SdGenericImportCellError {\n key: string;\n code: 'enum-unknown' | 'relation-not-found' | 'number-invalid' | 'match-ambiguous';\n value: unknown;\n}\n\nexport type SdGenericImportOp = { kind: 'create'; data: SdGenericRecord } | { kind: 'update'; id: string; data: SdGenericRecord };\n\nconst TRUE_VALUES = new Set(['true', '1', 'yes', 'x']);\n\n/** `values` split into lists of at most `size` items. */\nexport const sdGenericChunk = <T>(values: readonly T[], size: number): T[][] => {\n const chunks: T[][] = [];\n for (let start = 0; start < values.length; start += size) chunks.push(values.slice(start, start + size));\n return chunks;\n};\n\n/** `match value -> stored value`; a match value shared by several records maps to `SD_GENERIC_AMBIGUOUS`. */\nexport const sdGenericLookupMap = (entries: readonly (readonly [string, unknown])[]): Map<string, unknown> => {\n const lookup = new Map<string, unknown>();\n for (const [match, value] of entries) lookup.set(match, lookup.has(match) && lookup.get(match) !== value ? SD_GENERIC_AMBIGUOUS : value);\n return lookup;\n};\n\nconst matchFieldOf = (property: SdGenericProperty, schema: SdGenericSchema, configured?: string): string | undefined =>\n property.dataType === 'relation' ? configured || sdGenericRelationInfo(property, schema.module).displayField : undefined;\n\n/** Import columns: configured ones that still exist, or every insertable property except system, json and file. */\nexport const sdGenericImportColumns = (schema: SdGenericSchema): SdGenericImportColumnInfo[] => {\n const properties = sdGenericPropertyMap(schema);\n const configured = schema.import?.columns;\n if (configured) {\n return configured.flatMap(column => {\n const property = properties.get(column.key);\n return property ? [{ key: property.key, property, matchField: matchFieldOf(property, schema, column.matchField) }] : [];\n });\n }\n return schema.general.properties\n .filter(sdGenericImportable)\n .map(property => ({ key: property.key, property, matchField: matchFieldOf(property, schema) }));\n};\n\n/** Empty spreadsheet cell: no value, or only spaces. */\nexport const sdGenericIsBlank = (value: unknown): boolean =>\n value === undefined || value === null || (typeof value === 'string' && value.trim() === '');\nconst isBlank = sdGenericIsBlank;\n\n/**\n * Converts one spreadsheet row: enum cells by value or label, relation cells through `lookups`\n * (`property key -> match value -> stored value`).\n */\nexport const sdGenericParseImportRow = (\n row: Readonly<Record<string, unknown>>,\n columns: readonly SdGenericImportColumnInfo[],\n lookups: ReadonlyMap<string, ReadonlyMap<string, unknown>>\n): { data: SdGenericRecord; errors: SdGenericImportCellError[] } => {\n const data: SdGenericRecord = {};\n const errors: SdGenericImportCellError[] = [];\n for (const { key, property } of columns) {\n const cell = row[key];\n if (isBlank(cell)) continue;\n switch (property.dataType) {\n case 'enum': {\n const text = String(cell).trim();\n const option =\n property.enums?.find(candidate => candidate.value === text) ??\n property.enums?.find(candidate => candidate.label.trim().toLowerCase() === text.toLowerCase());\n if (option) data[key] = option.value;\n else errors.push({ key, code: 'enum-unknown', value: cell });\n break;\n }\n case 'relation': {\n const lookup = lookups.get(key);\n const texts = property.multiple\n ? String(cell)\n .split(',')\n .map(part => part.trim())\n .filter(Boolean)\n : [String(cell).trim()];\n const values = texts.map(text => lookup?.get(text));\n const missing = texts.filter((_, index) => values[index] === undefined);\n const ambiguous = texts.filter((_, index) => values[index] === SD_GENERIC_AMBIGUOUS);\n if (missing.length) errors.push({ key, code: 'relation-not-found', value: property.multiple ? missing.join(', ') : cell });\n else if (ambiguous.length) errors.push({ key, code: 'match-ambiguous', value: property.multiple ? ambiguous.join(', ') : cell });\n else data[key] = property.multiple ? values : values[0];\n break;\n }\n case 'number': {\n const value = typeof cell === 'number' ? cell : Number(String(cell).trim());\n if (Number.isFinite(value)) data[key] = value;\n else errors.push({ key, code: 'number-invalid', value: cell });\n break;\n }\n case 'boolean':\n data[key] = typeof cell === 'boolean' ? cell : TRUE_VALUES.has(String(cell).trim().toLowerCase());\n break;\n default:\n data[key] = cell;\n }\n }\n return { data, errors };\n};\n\n/**\n * Update when the upsert key matches one existing record (`existing`: key value -> id), otherwise create. A key\n * value that several records share is not planned: the caller reports the row as ambiguous.\n */\nexport const sdGenericPlanUpsert = (\n rows: readonly SdGenericRecord[],\n upsertKey: string | undefined,\n existing: ReadonlyMap<string, unknown>\n): (SdGenericImportOp | null)[] =>\n rows.map(data => {\n const match = upsertKey && !isBlank(data[upsertKey]) ? existing.get(String(data[upsertKey])) : undefined;\n if (match === SD_GENERIC_AMBIGUOUS) return null;\n return match === undefined ? { kind: 'create', data } : { kind: 'update', id: String(match), data };\n });\n\n/** Runs `worker` over `items` with at most `limit` calls in flight; results keep the item order. */\nexport const sdGenericRunLimited = async <T, R>(\n items: readonly T[],\n limit: number,\n worker: (item: T, index: number) => Promise<R>\n): Promise<PromiseSettledResult<R>[]> => {\n const results: PromiseSettledResult<R>[] = new Array(items.length);\n let next = 0;\n const lane = async (): Promise<void> => {\n while (next < items.length) {\n const index = next++;\n try {\n results[index] = { status: 'fulfilled', value: await worker(items[index], index) };\n } catch (reason) {\n results[index] = { status: 'rejected', reason };\n }\n }\n };\n await Promise.all(Array.from({ length: Math.min(Math.max(1, limit), items.length) }, lane));\n return results;\n};\n","import type { SdFormGenericSchema } from '@sdcorejs/angular/components/form-generic';\nimport type { SdGenericFormSection, SdGenericProperty, SdGenericSchema } from '../models';\n\nexport interface SdGenericMergeResult {\n schema: SdGenericSchema;\n /** Stored property keys that the current schema no longer has. */\n removed: string[];\n /** Current property keys that the stored configuration does not know yet. */\n added: string[];\n}\n\ntype JsonRecord = Record<string, unknown>;\n\n/**\n * One property: structure (`key`, `dataType`, `multiple`, `system`, `enums[].value`, `relation.entity`) from the\n * current schema, display and form settings from the stored one.\n */\nexport const sdGenericMergeProperty = (current: SdGenericProperty, stored: SdGenericProperty | undefined): SdGenericProperty => {\n if (!stored) return current;\n const merged: SdGenericProperty = { ...current };\n if (typeof stored.label === 'string') merged.label = stored.label;\n if (stored.format !== undefined) merged.format = stored.format;\n if (stored.validation !== undefined) merged.validation = stored.validation;\n if (Object.hasOwn(stored, 'defaultValue')) merged.defaultValue = stored.defaultValue;\n // why: a configuration may only narrow what the backend allows; it never reopens a field the adapter locked.\n if (stored.insertable === false) merged.insertable = false;\n if (stored.updatable === false) merged.updatable = false;\n if (current.enums) {\n merged.enums = current.enums.map(option => {\n const saved = stored.enums?.find(candidate => candidate.value === option.value);\n if (!saved) return option;\n return {\n ...option,\n ...(typeof saved.label === 'string' ? { label: saved.label } : {}),\n ...(saved.color !== undefined ? { color: saved.color } : {}),\n ...(saved.icon !== undefined ? { icon: saved.icon } : {}),\n };\n });\n }\n if (current.relation) {\n const saved = stored.relation;\n merged.relation = {\n ...current.relation,\n ...(saved?.displayField !== undefined ? { displayField: saved.displayField } : {}),\n ...(saved?.display !== undefined ? { display: saved.display } : {}),\n ...(saved?.searchFields !== undefined ? { searchFields: saved.searchFields } : {}),\n };\n }\n return merged;\n};\n\n/** Removes fields whose key is not in `keys`; groups and html elements stay. */\nexport const sdGenericPruneLayout = (form: SdFormGenericSchema, keys: ReadonlySet<string>): SdFormGenericSchema => {\n const prune = (elements: unknown): unknown[] =>\n (Array.isArray(elements) ? elements : []).flatMap((element): unknown[] => {\n const node = element as JsonRecord;\n if (node['type'] === 'group') return [{ ...node, elements: prune(node['elements']) }];\n if (node['type'] === 'html') return [node];\n return keys.has(node['key'] as string) ? [node] : [];\n });\n return { ...form, pages: form.pages.map(page => ({ ...page, elements: prune(page.elements) })) } as SdFormGenericSchema;\n};\n\nconst mergeSection = (section: SdGenericFormSection | undefined, keys: ReadonlySet<string>): SdGenericFormSection | undefined =>\n section && { ...section, ...(section.form ? { form: sdGenericPruneLayout(section.form, keys) } : {}) };\n\n/**\n * Lays a stored configuration over the current schema (INV-002). Dangling references are dropped; new properties\n * join `general` and the configured columns (hidden) but never a stored form layout.\n */\nexport const sdGenericMergeSchema = (storedInput: SdGenericSchema, currentInput: SdGenericSchema): SdGenericMergeResult => {\n const stored = structuredClone(storedInput);\n const current = structuredClone(currentInput);\n const currentByKey = new Map(current.general.properties.map(property => [property.key, property]));\n const storedByKey = new Map(stored.general.properties.map(property => [property.key, property]));\n const keys = new Set(currentByKey.keys());\n const removed = stored.general.properties.map(property => property.key).filter(key => !keys.has(key));\n const added = current.general.properties.map(property => property.key).filter(key => !storedByKey.has(key));\n\n const properties = [\n ...stored.general.properties\n .filter(property => keys.has(property.key))\n .map(property => sdGenericMergeProperty(currentByKey.get(property.key)!, property)),\n ...added.map(key => currentByKey.get(key)!),\n ];\n\n const schema: SdGenericSchema = {\n version: 1,\n module: current.module,\n entity: current.entity,\n general: { ...current.general, label: stored.general.label || current.general.label, properties },\n };\n\n const list = stored.list ?? current.list;\n if (list) {\n schema.list = { ...list };\n if (list.columns) {\n const columns = list.columns.filter(column => keys.has(column.key));\n const listed = new Set(columns.map(column => column.key));\n schema.list.columns = [...columns, ...added.filter(key => !listed.has(key)).map(key => ({ key, visible: false }))];\n }\n // why: external filters are declared in code (backend schema or provideSdGenericEntity), never by a stored\n // configuration. `list` may be the stored one, so drop its value and take the current schema's (INV-004).\n delete schema.list.externalFilters;\n const externalFilters = current.list?.externalFilters;\n if (externalFilters) schema.list.externalFilters = externalFilters.filter(filter => keys.has(filter.key));\n if (list.orders) schema.list.orders = list.orders.filter(order => keys.has(order.field as string));\n }\n for (const action of ['detail', 'create', 'update'] as const) {\n const section = mergeSection(stored[action] ?? current[action], keys);\n if (section) schema[action] = section;\n }\n const importSection = stored.import ?? current.import;\n if (importSection) {\n schema.import = { ...importSection };\n if (importSection.columns) schema.import.columns = importSection.columns.filter(column => keys.has(column.key));\n if (importSection.upsertKey && !keys.has(importSection.upsertKey)) delete schema.import.upsertKey;\n }\n return { schema, removed, added };\n};\n","import type { SdGenericAction } from '../models';\n\n/** Upper-case word chain: `purchaseOrder` and `sales.invoice` become `PURCHASE_ORDER` and `SALES_INVOICE`. */\nconst segment = (value: string): string =>\n value\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .replace(/[^A-Za-z0-9]+/g, '_')\n .replace(/^_+|_+$/g, '')\n .toUpperCase();\n\n/** Permission code `<MODULE>_<ENTITY>_C_GENERIC_<ACTION>`; the only place that builds one (INV-005). */\nexport const sdGenericPermissionCode = (module: string, entity: string, action: SdGenericAction): string =>\n `${segment(module)}_${segment(entity)}_C_GENERIC_${action.toUpperCase()}`;\n","import { SD_DATA_TYPE_ICON, type SdDataTypeIconKey } from '@sdcorejs/angular/modules/icon';\nimport type { SdGenericProperty } from '../models';\n\nconst STRING_FORMATS = new Set<SdDataTypeIconKey>(['email', 'phone', 'url', 'password']);\nconst NUMBER_FORMATS = new Set<SdDataTypeIconKey>(['integer', 'decimal', 'currency', 'percent']);\n\n/**\n * Key of the shared data-type icon set (`@sdcorejs/angular/modules/icon`) for a property (INV-003).\n * `relation` and `file` keep one icon whether or not they hold several values; a format that does not belong\n * to the data type is ignored. A data type outside the set has no key: the backend schema is not validated.\n */\nexport function sdGenericPropertyIconKey(\n property: Pick<SdGenericProperty, 'dataType' | 'format' | 'multiple'>\n): SdDataTypeIconKey | undefined {\n const format = property.format as SdDataTypeIconKey | undefined;\n switch (property.dataType) {\n case 'string':\n if (property.multiple) return 'string-multiple';\n return format && STRING_FORMATS.has(format) ? format : 'string';\n case 'number':\n return format && NUMBER_FORMATS.has(format) ? format : 'number';\n case 'enum':\n return property.multiple ? 'enum-multiple' : 'enum';\n default:\n return Object.hasOwn(SD_DATA_TYPE_ICON, property.dataType) ? property.dataType : undefined;\n }\n}\n","import type { SdGenericProperty, SdGenericSchema, SdGenericSchemaIssue, SdGenericSchemaIssueCode } from '../models';\nimport { sdGenericCanInsert, sdGenericCanUpdate, sdGenericImportable } from './generic-defaults';\nimport { sdGenericAllowedFieldTypes } from './generic-form';\nimport { sdGenericMergeProperty } from './generic-merge';\nimport { sdGenericTitleIssues } from './generic-title';\n\ntype JsonRecord = Record<string, unknown>;\n\nconst DATA_TYPES = new Set(['string', 'text', 'number', 'boolean', 'date', 'datetime', 'time', 'enum', 'relation', 'json', 'file']);\n\n/**\n * Issues a load tolerates because a backend change can cause them and the merge or the form builder already\n * handles them: dangling references are dropped (D-013), unknown title placeholders render empty, and fields whose\n * type or create / update flag no longer fits are rebuilt or left out of the form. A save still refuses them.\n */\nconst TOLERATED_AT_LOAD = new Set<SdGenericSchemaIssueCode>([\n 'reference-dangling',\n 'title-placeholder-unknown',\n 'layout-type-mismatch',\n 'create-not-insertable',\n 'update-not-updatable',\n]);\n\nconst isRecord = (value: unknown): value is JsonRecord => !!value && typeof value === 'object' && !Array.isArray(value);\nconst isStringList = (value: unknown): boolean => Array.isArray(value) && value.every(item => typeof item === 'string');\n\n/** Whether an issue must replace the stored configuration with the default one. */\nexport const sdGenericBlocksLoad = (issue: SdGenericSchemaIssue): boolean => !TOLERATED_AT_LOAD.has(issue.code);\n\n/** Members of a stored property that the merge reads, checked so that a merge never meets a wrong type. */\nconst propertyShapeIssue = (value: JsonRecord): string | null => {\n for (const member of ['multiple', 'insertable', 'updatable', 'system'] as const) {\n if (value[member] !== undefined && typeof value[member] !== 'boolean') return `${member} must be a boolean.`;\n }\n if (value['format'] !== undefined && typeof value['format'] !== 'string') return 'format must be a string.';\n if (value['validation'] !== undefined && !isRecord(value['validation'])) return 'validation must be an object.';\n const enums = value['enums'];\n if (enums !== undefined && (!Array.isArray(enums) || !enums.every(option => isRecord(option) && typeof option['value'] === 'string')))\n return 'enums must be a list of options with a value.';\n const relation = value['relation'];\n if (relation === undefined) return null;\n if (!isRecord(relation)) return 'relation must be an object.';\n for (const member of ['displayField', 'display'] as const) {\n if (relation[member] !== undefined && typeof relation[member] !== 'string') return `relation.${member} must be a string.`;\n }\n if (relation['searchFields'] !== undefined && !isStringList(relation['searchFields']))\n return 'relation.searchFields must be a list of strings.';\n return null;\n};\n\n/**\n * Validates a stored configuration against the current schema of the entity (INV-003). The same function guards\n * the load and the configuration screen; an empty list means valid.\n */\nexport function validateSdGenericSchema(stored: unknown, base: SdGenericSchema): SdGenericSchemaIssue[] {\n const issues: SdGenericSchemaIssue[] = [];\n const report = (code: SdGenericSchemaIssueCode, path: string, message: string) => issues.push({ code, severity: 'error', path, message });\n /** Items of an optional list member; a present member that is not a list is a `shape` issue. */\n const listAt = (container: JsonRecord, member: string, path: string): unknown[] => {\n const value = container[member];\n if (value === undefined) return [];\n if (Array.isArray(value)) return value;\n report('shape', path, `${path} must be a list.`);\n return [];\n };\n\n if (!isRecord(stored)) {\n report('shape', '$', 'The configuration must be an object.');\n return issues;\n }\n if (stored['version'] !== 1) report('version', 'version', `Unsupported configuration version ${String(stored['version'])}; expected 1.`);\n for (const member of ['module', 'entity'] as const) {\n const value = stored[member];\n if (typeof value !== 'string') report('shape', member, `${member} must be a string.`);\n else if (value !== base[member])\n report(member === 'module' ? 'module-mismatch' : 'entity-mismatch', member, `${member} \"${value}\" does not match \"${base[member]}\".`);\n }\n const general = stored['general'];\n if (!isRecord(general) || typeof general['label'] !== 'string' || !Array.isArray(general['properties'])) {\n report('shape', 'general', 'general must have a label and a properties array.');\n return issues;\n }\n\n const current = new Map(base.general.properties.map(property => [property.key, property]));\n const keys = new Set(current.keys());\n const storedProperties = new Map<string, SdGenericProperty>();\n general['properties'].forEach((value: unknown, index: number) => {\n const path = `general.properties[${index}]`;\n if (!isRecord(value) || typeof value['key'] !== 'string' || !value['key'] || typeof value['label'] !== 'string') {\n report('shape', path, `${path} must have a key and a label.`);\n return;\n }\n const key = value['key'];\n if (storedProperties.has(key)) report('property-key-duplicate', `${path}.key`, `The property key \"${key}\" is used twice.`);\n if (!DATA_TYPES.has(value['dataType'] as string))\n report('property-type', `${path}.dataType`, `Unknown data type \"${String(value['dataType'])}\".`);\n if (!keys.has(key)) report('reference-dangling', `${path}.key`, `The property \"${key}\" no longer exists.`);\n const shapeIssue = propertyShapeIssue(value);\n if (shapeIssue) {\n report('shape', path, `${path}: ${shapeIssue}`);\n return;\n }\n storedProperties.set(key, value as unknown as SdGenericProperty);\n });\n const effective = (key: string): SdGenericProperty | undefined => {\n const property = current.get(key);\n return property && sdGenericMergeProperty(property, storedProperties.get(key));\n };\n const reference = (key: unknown, path: string): SdGenericProperty | undefined => {\n const property = typeof key === 'string' ? effective(key) : undefined;\n if (!property) report('reference-dangling', path, `\"${String(key)}\" is not a property of ${base.module}.${base.entity}.`);\n return property;\n };\n\n const list = stored['list'];\n if (list !== undefined) {\n if (!isRecord(list)) report('shape', 'list', 'list must be an object.');\n else {\n listAt(list, 'columns', 'list.columns').forEach((column, index) =>\n reference(isRecord(column) ? column['key'] : undefined, `list.columns[${index}].key`)\n );\n listAt(list, 'externalFilters', 'list.externalFilters').forEach((filter, index) =>\n reference(isRecord(filter) ? filter['key'] : undefined, `list.externalFilters[${index}].key`)\n );\n listAt(list, 'orders', 'list.orders').forEach((order, index) =>\n reference(isRecord(order) ? order['field'] : undefined, `list.orders[${index}].field`)\n );\n const pageSize = list['pageSize'];\n if (pageSize !== undefined && !(Number.isInteger(pageSize) && (pageSize as number) > 0))\n report('shape', 'list.pageSize', 'list.pageSize must be a positive integer.');\n }\n }\n\n const importSection = stored['import'];\n if (importSection !== undefined) {\n if (!isRecord(importSection)) report('shape', 'import', 'import must be an object.');\n else {\n const columns = importSection['columns'];\n const imported = new Set<string>();\n listAt(importSection, 'columns', 'import.columns').forEach((column, index) => {\n const property = reference(isRecord(column) ? column['key'] : undefined, `import.columns[${index}].key`);\n if (property) imported.add(property.key);\n });\n if (!Array.isArray(columns)) {\n for (const key of keys) if (sdGenericImportable(effective(key)!)) imported.add(key);\n }\n if (importSection['upsertKey'] !== undefined) {\n const property = reference(importSection['upsertKey'], 'import.upsertKey');\n if (property?.multiple)\n report('upsert-key-multiple', 'import.upsertKey', `The upsert key \"${property.key}\" cannot hold several values.`);\n else if (property && !imported.has(property.key))\n report('upsert-key-not-imported', 'import.upsertKey', `The upsert key \"${property.key}\" is not one of the import columns.`);\n }\n }\n }\n\n for (const action of ['detail', 'create', 'update'] as const) {\n const section = stored[action];\n if (section === undefined) continue;\n if (!isRecord(section)) {\n report('shape', action, `${action} must be an object.`);\n continue;\n }\n if (section['form'] === undefined) continue;\n const fields = layoutFields(section['form']);\n if (!fields) {\n report('layout-grammar', `${action}.form`, `${action}.form must be pages of groups and fields, with no nested group.`);\n continue;\n }\n for (const { node, path } of fields) {\n if (node['type'] === 'html') continue;\n const property = reference(node['key'], `${action}.form.${path}.key`);\n if (!property) continue;\n if (!sdGenericAllowedFieldTypes(property).includes(node['type'] as never)) {\n report(\n 'layout-type-mismatch',\n `${action}.form.${path}.type`,\n `\"${property.key}\" (${property.dataType}) cannot use a ${String(node['type'])} field.`\n );\n } else if (action === 'create' && !sdGenericCanInsert(property)) {\n report('create-not-insertable', `create.form.${path}.key`, `\"${property.key}\" cannot be set on create.`);\n } else if (action === 'update' && !sdGenericCanUpdate(property)) {\n report('update-not-updatable', `update.form.${path}.key`, `\"${property.key}\" cannot be changed on update.`);\n }\n }\n }\n\n for (const section of ['list', 'create', 'detail', 'update'] as const) {\n const value = stored[section];\n if (isRecord(value)) issues.push(...sdGenericTitleIssues(section, value['title'], keys));\n }\n return issues;\n}\n\n/** Field nodes of a layout with their paths, or `null` when the layout breaks the form-generic grammar. */\nconst layoutFields = (form: unknown): { node: JsonRecord; path: string }[] | null => {\n if (!isRecord(form) || !Array.isArray(form['pages'])) return null;\n const fields: { node: JsonRecord; path: string }[] = [];\n for (const [pageIndex, page] of form['pages'].entries()) {\n if (!isRecord(page) || !Array.isArray(page['elements'])) return null;\n for (const [index, element] of page['elements'].entries()) {\n const path = `pages[${pageIndex}].elements[${index}]`;\n if (!isRecord(element)) return null;\n if (element['type'] !== 'group') {\n fields.push({ node: element, path });\n continue;\n }\n if (!Array.isArray(element['elements'])) return null;\n for (const [childIndex, child] of element['elements'].entries()) {\n if (!isRecord(child) || child['type'] === 'group') return null;\n fields.push({ node: child, path: `${path}.elements[${childIndex}]` });\n }\n }\n }\n return fields;\n};\n","// Pure functions shared by every screen of the module (D-019): no DI, no DOM, no HTTP client.\nexport * from './generic-columns';\nexport * from './generic-defaults';\nexport * from './generic-form';\nexport * from './generic-import';\nexport * from './generic-merge';\nexport * from './generic-permission';\nexport * from './generic-property-icon';\nexport * from './generic-search';\nexport * from './generic-title';\nexport * from './generic-validate';\n","import { Injectable, inject } from '@angular/core';\nimport type { SdFormGenericCatalogItem } from '@sdcorejs/angular/components/form-generic';\nimport type { SdSearch } from '@sdcorejs/angular/forms/models';\nimport type { PagingReq, PagingRes } from '@sdcorejs/utils/models';\nimport {\n SD_GENERIC_LABEL_FIELD,\n sdGenericCoerceValue,\n sdGenericFormPayload,\n sdGenericRecordLabel,\n sdGenericRelationInfo,\n sdGenericSearchPagingReq,\n type SdGenericColumnDeps,\n type SdGenericRelationInfo,\n} from '../core';\nimport type { SdGenericAdapter, SdGenericProperty, SdGenericRecord, SdGenericSchema, SdGenericSearchReq } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\n\nconst DEFAULT_LIMIT = 20;\n/** Option strings remembered per relation; the oldest are forgotten first. */\nconst KNOWN_LIMIT = 500;\n\nconst text = (value: unknown): string => (value === undefined || value === null ? '' : String(value));\n\n/** Records `option string -> original value`, keeping at most `KNOWN_LIMIT` entries (least recently set first out). */\nconst remember = (known: Map<string, unknown>, option: string, value: unknown): void => {\n known.delete(option);\n known.set(option, value);\n if (known.size > KNOWN_LIMIT) known.delete(known.keys().next().value as string);\n};\n\n/** Relation info carried by the constant params of the relation catalog (D-022). */\nconst infoFromParams = (params: Readonly<Record<string, unknown>>): SdGenericRelationInfo => {\n const info: SdGenericRelationInfo = {\n module: text(params['module']),\n entity: text(params['entity']),\n valueField: text(params['valueField']) || 'id',\n displayField: text(params['displayField']) || text(params['valueField']) || 'id',\n searchFields: text(params['searchFields'])\n .split(',')\n .map(field => field.trim())\n .filter(Boolean),\n };\n if (!info.searchFields.length) info.searchFields = [info.displayField];\n if (text(params['display'])) info.display = text(params['display']);\n return info;\n};\n\n/**\n * The only caller of the data methods of the adapters (INV-008): applies the save hooks, the search order\n * (entity search -> adapter search -> `query`) and keeps relation values in their original type.\n */\n@Injectable()\nexport class SdGenericDataService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n /** `module.entity.valueField` -> option string -> original value. */\n readonly #known = new Map<string, Map<string, unknown>>();\n\n async query(module: string, entity: string, req: PagingReq): Promise<PagingRes<SdGenericRecord>> {\n return this.#adapter(module).query(entity, req);\n }\n\n async detail(module: string, entity: string, id: string): Promise<SdGenericRecord> {\n return this.#adapter(module).detail(entity, id);\n }\n\n async delete(module: string, entity: string, id: string): Promise<void> {\n await this.#adapter(module).delete(entity, id);\n }\n\n async search(module: string, entity: string, req: SdGenericSearchReq): Promise<SdGenericRecord[]> {\n const own = this.#scope.entity(module, entity)?.search;\n if (own) return own(req);\n const adapter = this.#adapter(module);\n if (adapter.search) return adapter.search(entity, req);\n return (await adapter.query(entity, sdGenericSearchPagingReq(req))).items;\n }\n\n /** Saves through the adapter: allowed fields only, relation values restored, then `beforeSave` / `afterSave`. */\n async save(\n schema: SdGenericSchema,\n action: 'create' | 'update',\n value: Readonly<SdGenericRecord>,\n id?: string\n ): Promise<SdGenericRecord> {\n const adapter = this.#adapter(schema.module);\n const hooks = this.#scope.entity(schema.module, schema.entity)?.hooks;\n let data = this.#restoreRelations(schema, sdGenericFormPayload(schema, action, value));\n if (hooks?.beforeSave) data = await hooks.beforeSave({ action, data, schema, ...(id === undefined ? {} : { id }) });\n const result = action === 'create' ? await adapter.create(schema.entity, data) : await adapter.update(schema.entity, id ?? '', data);\n await hooks?.afterSave?.({ action, data, schema, result, ...(id === undefined ? {} : { id }) });\n return result;\n }\n\n /** Record prepared for `sd-form-render`: relation values become the option strings of the relation catalog. */\n toFormValue(schema: SdGenericSchema, record: Readonly<SdGenericRecord>): SdGenericRecord {\n const value: SdGenericRecord = { ...record };\n for (const property of schema.general.properties) {\n if (property.dataType !== 'relation' || value[property.key] === undefined || value[property.key] === null) continue;\n const known = this.#knownFor(sdGenericRelationInfo(property, schema.module));\n const toText = (item: unknown) => {\n remember(known, String(item), item);\n return String(item);\n };\n const current = value[property.key];\n value[property.key] = Array.isArray(current) ? current.map(toText) : toText(current);\n }\n return value;\n }\n\n /** Options of the relation catalog, by term, by values, or the first page. */\n async relationItems(\n params: Readonly<Record<string, unknown>>,\n request: { term?: string; values?: string[] }\n ): Promise<SdFormGenericCatalogItem[]> {\n const info = infoFromParams(params);\n const known = this.#knownFor(info);\n const records = await this.search(info.module, info.entity, {\n fields: info.searchFields,\n valueField: info.valueField,\n // why: option strings go back to their original type (a numeric id stays a number) before reaching the adapter.\n ...(request.values\n ? { values: request.values.map(value => (known.has(value) ? known.get(value) : value)) }\n : { term: request.term ?? '', limit: DEFAULT_LIMIT }),\n });\n return records.map(record => {\n remember(known, text(record[info.valueField]), record[info.valueField]);\n return { value: text(record[info.valueField]), label: sdGenericRecordLabel(record, info), data: record };\n });\n }\n\n /** Search function of a relation column or filter of `sd-table`. */\n relationSearch(schema: SdGenericSchema, property: SdGenericProperty): SdSearch<SdGenericRecord> {\n const info = sdGenericRelationInfo(property, schema.module);\n return async args => {\n const values = args.type === 'VALUE' ? ([] as unknown[]).concat(args.value ?? []) : undefined;\n const records = await this.search(info.module, info.entity, {\n fields: args.searchFields?.length ? args.searchFields : info.searchFields,\n valueField: info.valueField,\n ...(values ? { values } : { term: args.searchText ?? '', limit: DEFAULT_LIMIT }),\n });\n return this.#labelled(records, info);\n };\n }\n\n /** Related records of displayed values for a relation column of `sd-table`. */\n relationViews(schema: SdGenericSchema, property: SdGenericProperty): (values: string[]) => Promise<SdGenericRecord[]> {\n const info = sdGenericRelationInfo(property, schema.module);\n const known = this.#knownFor(info);\n return async values =>\n this.#labelled(\n await this.search(info.module, info.entity, {\n values: values.map(value => (known.has(value) ? known.get(value) : value)),\n fields: info.searchFields,\n valueField: info.valueField,\n }),\n info\n );\n }\n\n /** Lookups of the table columns and filters of a schema. */\n columnDeps(schema: SdGenericSchema): SdGenericColumnDeps {\n return {\n relationSearch: property => this.relationSearch(schema, property),\n relationViews: property => this.relationViews(schema, property),\n };\n }\n\n #labelled(records: SdGenericRecord[], info: SdGenericRelationInfo): SdGenericRecord[] {\n return info.display ? records.map(record => ({ ...record, [SD_GENERIC_LABEL_FIELD]: sdGenericRecordLabel(record, info) })) : records;\n }\n\n #restoreRelations(schema: SdGenericSchema, data: SdGenericRecord): SdGenericRecord {\n for (const property of schema.general.properties) {\n if (property.dataType === 'relation' && Object.hasOwn(data, property.key)) {\n data[property.key] = sdGenericCoerceValue(data[property.key], this.#knownFor(sdGenericRelationInfo(property, schema.module)));\n }\n }\n return data;\n }\n\n #knownFor(info: SdGenericRelationInfo): Map<string, unknown> {\n const key = `${info.module}.${info.entity}.${info.valueField}`;\n let known = this.#known.get(key);\n if (!known) this.#known.set(key, (known = new Map()));\n return known;\n }\n\n #adapter(module: string): SdGenericAdapter {\n const adapter = this.#scope.adapter(module);\n if (!adapter) throw new Error(`SdGeneric: no adapter is registered for the module \"${module}\".`);\n return adapter;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n SD_GENERIC_IMPORT_CONCURRENCY,\n SD_GENERIC_IMPORT_LOOKUP_SIZE,\n sdGenericChunk,\n sdGenericImportColumns,\n sdGenericIsBlank,\n sdGenericLookupMap,\n sdGenericParseImportRow,\n sdGenericPlanUpsert,\n sdGenericPrimaryKey,\n sdGenericRelationInfo,\n sdGenericRunLimited,\n type SdGenericImportCellError,\n type SdGenericImportColumnInfo,\n type SdGenericImportOp,\n} from '../core';\nimport type { SdGenericRecord, SdGenericSchema } from '../models';\nimport { SdGenericDataService } from './generic-data.service';\n\nexport interface SdGenericImportRowResult {\n index: number;\n status: 'created' | 'updated' | 'error';\n errors: SdGenericImportCellError[];\n /** Adapter error message of a failed save. */\n message?: string;\n}\n\n/** Runs one lookup per batch, at most five at a time; the first failed batch fails the import. */\nconst lookupBatches = async <T>(values: readonly unknown[], lookup: (batch: unknown[]) => Promise<T[]>): Promise<T[]> => {\n const settled = await sdGenericRunLimited(sdGenericChunk(values, SD_GENERIC_IMPORT_LOOKUP_SIZE), SD_GENERIC_IMPORT_CONCURRENCY, lookup);\n return settled.flatMap(outcome => {\n if (outcome.status === 'rejected') throw outcome.reason;\n return outcome.value;\n });\n};\n\n/**\n * Imports spreadsheet rows (INV-014): converts cells, looks up relations and existing records in batches, then\n * creates or updates through `SdGenericDataService` (so hooks apply) with at most five saves in flight.\n */\n@Injectable()\nexport class SdGenericImportService {\n readonly #data = inject(SdGenericDataService);\n\n columns(schema: SdGenericSchema): SdGenericImportColumnInfo[] {\n return sdGenericImportColumns(schema);\n }\n\n async run(schema: SdGenericSchema, rows: readonly Record<string, unknown>[]): Promise<SdGenericImportRowResult[]> {\n const columns = this.columns(schema);\n const lookups = await this.#relationLookups(schema, columns, rows);\n const parsed = rows.map(row => sdGenericParseImportRow(row, columns, lookups));\n const results: SdGenericImportRowResult[] = parsed.map((row, index) => ({\n index,\n status: row.errors.length ? 'error' : 'created',\n errors: row.errors,\n }));\n const valid = parsed.flatMap((row, index) => (row.errors.length ? [] : [{ data: row.data, index }]));\n const data = valid.map(item => item.data);\n const upsertKey = schema.import?.upsertKey;\n const existing = upsertKey ? await this.#existing(schema, upsertKey, data) : new Map<string, unknown>();\n const ops: { op: SdGenericImportOp; index: number }[] = [];\n sdGenericPlanUpsert(data, upsertKey, existing).forEach((op, position) => {\n const { index } = valid[position];\n if (op) ops.push({ op, index });\n else\n results[index] = {\n index,\n status: 'error',\n errors: [{ key: upsertKey!, code: 'match-ambiguous', value: data[position][upsertKey!] }],\n };\n });\n const settled = await sdGenericRunLimited(ops, SD_GENERIC_IMPORT_CONCURRENCY, ({ op }) =>\n op.kind === 'create' ? this.#data.save(schema, 'create', op.data) : this.#data.save(schema, 'update', op.data, op.id)\n );\n settled.forEach((outcome, position) => {\n const { op, index } = ops[position];\n const result = results[index];\n if (outcome.status === 'fulfilled') result.status = op.kind === 'create' ? 'created' : 'updated';\n else {\n result.status = 'error';\n result.message = outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason);\n }\n });\n return results;\n }\n\n /** `property key -> cell text -> stored value` for each relation column, searched in batches. */\n async #relationLookups(\n schema: SdGenericSchema,\n columns: readonly SdGenericImportColumnInfo[],\n rows: readonly Record<string, unknown>[]\n ): Promise<Map<string, Map<string, unknown>>> {\n const lookups = new Map<string, Map<string, unknown>>();\n for (const column of columns.filter(item => item.property.dataType === 'relation')) {\n const info = sdGenericRelationInfo(column.property, schema.module);\n const matchField = column.matchField ?? info.displayField;\n const texts = [\n ...new Set(\n rows\n .map(row => row[column.key])\n .filter(value => !sdGenericIsBlank(value))\n .flatMap(value => (column.property.multiple ? String(value).split(',') : [String(value)]))\n .map(value => value.trim())\n .filter(Boolean)\n ),\n ];\n const records = await lookupBatches(texts, batch =>\n this.#data.search(info.module, info.entity, { values: batch, fields: [matchField], valueField: matchField })\n );\n lookups.set(column.key, sdGenericLookupMap(records.map(record => [String(record[matchField]), record[info.valueField]] as const)));\n }\n return lookups;\n }\n\n /** `upsert key value -> id` of the records that already exist, paging until each batch is complete. */\n async #existing(schema: SdGenericSchema, upsertKey: string, rows: readonly SdGenericRecord[]): Promise<Map<string, unknown>> {\n const values = [...new Set(rows.map(row => row[upsertKey]).filter(value => !sdGenericIsBlank(value)))];\n const primaryKey = sdGenericPrimaryKey(schema);\n const records = await lookupBatches(values, async batch => {\n const filters = [{ field: upsertKey, operator: 'IN' as const, data: batch as never }];\n const items: SdGenericRecord[] = [];\n for (let pageNumber = 0; ; pageNumber++) {\n const page = await this.#data.query(schema.module, schema.entity, { pageNumber, pageSize: batch.length, filters });\n items.push(...page.items);\n // why: a backend may cap the page size; keep reading until the reported total is reached.\n if (!page.items.length || items.length >= page.total) return items;\n }\n });\n return sdGenericLookupMap(records.map(record => [String(record[upsertKey]), String(record[primaryKey])] as const));\n }\n}\n","import { Injectable, Injector, inject } from '@angular/core';\nimport { SdPermissionService } from '@sdcorejs/angular/modules/permission';\nimport { sdGenericPermissionCode } from '../core';\nimport type { SdGenericAction, SdGenericDefaultAction } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\n\n/**\n * Permission checks of the generic screens (INV-005). Codes come from `sdGenericPermissionCode`; the default\n * permission key of the portal is used (D-029). These checks hide UI and block routes only: the backend behind\n * the adapter must enforce permissions again.\n */\n@Injectable()\nexport class SdGenericPermissionService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n // why: SdPermissionService requires SD_PERMISSION_CONFIGURATION; with `permission: false` a portal may have none,\n // so the service is only resolved when a check really runs.\n readonly #injector = inject(Injector);\n #loading: Promise<unknown> | undefined;\n\n get enabled(): boolean {\n return this.#scope.permissionEnabled();\n }\n\n can(module: string, entity: string, action: SdGenericAction): boolean {\n return !this.enabled || this.#service().hasPermission(sdGenericPermissionCode(module, entity, action));\n }\n\n /** Whether `provideSdGenericEntity({ hiddenDefaults })` hides the default action; `list` and `configuration` never are. */\n hides(module: string, entity: string, action: SdGenericAction | SdGenericDefaultAction): boolean {\n return this.#scope.entity(module, entity)?.hiddenDefaults?.includes(action as SdGenericDefaultAction) ?? false;\n }\n\n /** The one rule of a default action, shared by the screens and the route guard: not hidden, and permitted. */\n allows(module: string, entity: string, action: SdGenericAction): boolean {\n return !this.hides(module, entity, action) && this.can(module, entity, action);\n }\n\n /** A custom action without `permission` is allowed. */\n canCode(code: string | undefined): boolean {\n return !this.enabled || !code || this.#service().hasPermission(code);\n }\n\n /**\n * Loads the permission list before a route check; a failed load denies instead of throwing. Only a load in\n * flight is shared: SdPermissionService skips keys it already loaded, and its `reset()` on sign-out must make\n * the next check load the permissions of the new user.\n */\n ensureLoaded(): Promise<unknown> {\n if (!this.enabled) return Promise.resolve();\n this.#loading ??= this.#service()\n .loadPermissions()\n .catch(error => console.error(error))\n .finally(() => (this.#loading = undefined));\n return this.#loading;\n }\n\n #service(): SdPermissionService {\n return this.#injector.get(SdPermissionService);\n }\n}\n","import type { EnvironmentInjector } from '@angular/core';\nimport type { SdFormGenericCatalog } from '@sdcorejs/angular/components/form-generic';\nimport { SD_GENERIC_RELATION_CATALOG } from '../core';\nimport { SdGenericDataService } from './generic-data.service';\n\n/**\n * Holds the environment injector of a generic route. form-generic catalogs are plain objects created before any\n * injector exists, so `sdGenericRoutes()` attaches the route injector here once Angular creates it (D-022).\n */\nexport class SdGenericCatalogBridge {\n #injector: EnvironmentInjector | undefined;\n\n attach(injector: EnvironmentInjector): void {\n this.#injector = injector;\n }\n\n data(): SdGenericDataService {\n if (!this.#injector) throw new Error('SdGeneric: the relation catalog is only available inside a generic route.');\n return this.#injector.get(SdGenericDataService);\n }\n}\n\nconst param = (name: string) => ({ name, label: name, required: name === 'module' || name === 'entity' });\n\n/** The single form-generic catalog behind every relation select; params identify the relation. */\nexport const sdGenericRelationCatalog = (bridge: SdGenericCatalogBridge): SdFormGenericCatalog => ({\n id: SD_GENERIC_RELATION_CATALOG,\n label: 'Generic relation',\n params: ['module', 'entity', 'valueField', 'displayField', 'searchFields', 'display'].map(param),\n load: async params => bridge.data().relationItems(params, {}),\n search: async (term, params) => bridge.data().relationItems(params, { term }),\n labels: async (values, params) => bridge.data().relationItems(params, { values }),\n});\n","import { Injectable, inject } from '@angular/core';\nimport { sdGenericBlocksLoad, sdGenericMergeSchema, validateSdGenericSchema } from '../core';\nimport type { SdGenericAdapter, SdGenericSchema, SdGenericSchemaIssue, SdGenericSchemaStore } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\nimport { SdGenericLocalStore } from './generic-configuration-store';\n\nexport interface SdGenericResolvedSchema {\n /** Effective schema used by every screen. */\n schema: SdGenericSchema;\n /** Default configuration: the adapter schema after `provideSdGenericEntity.schema`. */\n base: SdGenericSchema;\n /** The stored configuration was rejected and the default one is in use. */\n invalid: boolean;\n issues: SdGenericSchemaIssue[];\n /** Stored property keys that the backend no longer has. */\n removed: string[];\n /** Backend property keys that the stored configuration does not know yet. */\n added: string[];\n}\n\n/**\n * Copy of a stored configuration without `list.externalFilters`. External filters are declared in code (backend\n * schema or `provideSdGenericEntity`), so a stored configuration neither carries nor contributes them (INV-004).\n * Anything that is not a configuration object is returned unchanged for the validator to report.\n */\nfunction withoutExternalFilters<T>(configuration: T): T {\n const list = (configuration as { list?: unknown } | null)?.list;\n if (!list || typeof list !== 'object' || Array.isArray(list) || !('externalFilters' in list)) return configuration;\n const rest: Record<string, unknown> = { ...list };\n delete rest['externalFilters'];\n return { ...(configuration as object), list: rest } as T;\n}\n\n/**\n * Owns the effective schema of each entity (INV-002): adapter schema -> entity schema function -> stored\n * configuration (validated, then merged). It is the only caller of `adapter.schema` and of the schema store.\n */\n@Injectable()\nexport class SdGenericSchemaService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n readonly #cache = new Map<string, Promise<SdGenericResolvedSchema>>();\n\n resolve(module: string, entity: string): Promise<SdGenericResolvedSchema> {\n const key = `${module}.${entity}`;\n let pending = this.#cache.get(key);\n if (!pending) {\n pending = this.#load(module, entity);\n // why: a failed load must not stay cached, so the next navigation retries.\n pending.catch(() => this.#cache.delete(key));\n this.#cache.set(key, pending);\n }\n return pending;\n }\n\n /** Validates, stores and drops the cached schema of the entity; returns the issues when it refuses to save. */\n async save(module: string, entity: string, schema: SdGenericSchema): Promise<SdGenericSchemaIssue[]> {\n const { base } = await this.resolve(module, entity);\n const configuration = withoutExternalFilters(schema);\n const issues = validateSdGenericSchema(configuration, base);\n if (issues.length) return issues;\n await this.#store(this.#adapter(module)).set(entity, configuration);\n this.invalidate(module, entity);\n return [];\n }\n\n invalidate(module: string, entity: string): void {\n this.#cache.delete(`${module}.${entity}`);\n }\n\n async #load(module: string, entity: string): Promise<SdGenericResolvedSchema> {\n const adapter = this.#adapter(module);\n const config = this.#scope.entity(module, entity);\n let base = await adapter.schema(entity);\n if (config?.schema) base = await config.schema(structuredClone(base));\n const stored = withoutExternalFilters(await this.#store(adapter).get(entity));\n if (stored === null || stored === undefined) return { schema: base, base, invalid: false, issues: [], removed: [], added: [] };\n const issues = validateSdGenericSchema(stored, base);\n if (issues.some(sdGenericBlocksLoad)) {\n console.warn(`SdGeneric: the stored configuration of ${module}.${entity} is invalid; the default configuration is in use.`, issues);\n return { schema: base, base, invalid: true, issues, removed: [], added: [] };\n }\n try {\n const merged = sdGenericMergeSchema(stored, base);\n return { schema: merged.schema, base, invalid: false, issues, removed: merged.removed, added: merged.added };\n } catch (error) {\n // why: a configuration the validator did not foresee must still fall back to the default one (AC-007).\n const issue: SdGenericSchemaIssue = {\n code: 'shape',\n severity: 'error',\n path: '$',\n message: `The configuration cannot be merged: ${String(error)}`,\n };\n console.warn(`SdGeneric: the stored configuration of ${module}.${entity} is invalid; the default configuration is in use.`, [issue]);\n return { schema: base, base, invalid: true, issues: [...issues, issue], removed: [], added: [] };\n }\n }\n\n #adapter(module: string): SdGenericAdapter {\n const adapter = this.#scope.adapter(module);\n if (!adapter) throw new Error(`SdGeneric: no adapter is registered for the module \"${module}\".`);\n return adapter;\n }\n\n #store(adapter: SdGenericAdapter): SdGenericSchemaStore {\n return adapter.schemaStore ?? new SdGenericLocalStore(adapter.module);\n }\n}\n","import { inject } from '@angular/core';\nimport type { ActivatedRouteSnapshot, CanActivateFn, ResolveFn } from '@angular/router';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport type { SdGenericAction } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\nimport { SdGenericPermissionService, SdGenericSchemaService, type SdGenericResolvedSchema } from '../services';\n\n/** Route data `generic` of the list and configuration routes. */\nexport interface SdGenericRouteData {\n module: string;\n entity: string;\n resolved: SdGenericResolvedSchema | null;\n /** Message when the schema could not be loaded (unknown module, adapter failure). */\n error: string | null;\n}\n\n/** `module`, `entity` and `id` of a generic route, read from every ancestor because nested routes do not inherit params. */\nexport const sdGenericRouteParams = (route: ActivatedRouteSnapshot): { module: string; entity: string; id: string | null } => {\n const read = (key: string) =>\n route.pathFromRoot\n .map(snapshot => snapshot.paramMap.get(key))\n .filter((value): value is string => value !== null)\n .pop() ?? null;\n return { module: read('module') ?? '', entity: read('entity') ?? '', id: read('id') };\n};\n\n/**\n * Module and entity names a route may carry: letters, digits, `_` and `-`, with single dots between parts. It\n * keeps decoded `/`, `..` and other separators away from permission codes and adapter calls.\n */\nconst NAME = /^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$/;\n\n/**\n * Blocks a generic route without its permission code (INV-005), with an unsafe module / entity name, or whose\n * action the entity hides through `hiddenDefaults`. Permissions are loaded before the check.\n */\nexport const sdGenericPermissionGuard =\n (action: SdGenericAction): CanActivateFn =>\n async route => {\n const permission = inject(SdGenericPermissionService);\n const { module, entity } = sdGenericRouteParams(route);\n if (!NAME.test(module) || !NAME.test(entity)) return false;\n // why: a hidden route is refused before the permission list is loaded.\n if (permission.hides(module, entity, action)) return false;\n await permission.ensureLoaded();\n return permission.allows(module, entity, action);\n };\n\n/** Resolves the effective schema before the page renders; a failure becomes `error` instead of a navigation error. */\nexport const sdGenericSchemaResolver: ResolveFn<SdGenericRouteData> = async route => {\n const schemas = inject(SdGenericSchemaService);\n const scope = inject(SD_GENERIC_SCOPE);\n const i18n = inject(I18nService);\n const { module, entity } = sdGenericRouteParams(route);\n if (!scope.adapter(module))\n return { module, entity, resolved: null, error: i18n.t('core.module.generic.error.adapter-missing', { module }) };\n try {\n return { module, entity, resolved: await schemas.resolve(module, entity), error: null };\n } catch (error) {\n return { module, entity, resolved: null, error: error instanceof Error ? error.message : String(error) };\n }\n};\n","import { EnvironmentInjector, inject, provideEnvironmentInitializer } from '@angular/core';\nimport type { Route, Routes } from '@angular/router';\nimport { provideSdFormGeneric } from '@sdcorejs/angular/components/form-generic';\nimport { SD_PERMISSION_PUBLIC } from '@sdcorejs/angular/modules/permission';\nimport type { SdGenericAction, SdGenericFormAction } from '../models';\nimport {\n SdGenericCatalogBridge,\n SdGenericDataService,\n SdGenericPermissionService,\n SdGenericSchemaService,\n sdGenericRelationCatalog,\n} from '../services';\nimport { sdGenericPermissionGuard, sdGenericSchemaResolver } from './generic-route.guards';\n\n/**\n * Routes of the generic module:\n * `generic/:module/:entity` (list), `create`, `:id/detail`, `:id/update` (page or side drawer over the list)\n * and `configuration`. Mount them where the adapters of the module are provided (root or the lazy route).\n *\n * @example\n * { path: 'tms', providers: [provideSdGeneric({ adapters: [TmsAdapter] })], children: sdGenericRoutes() }\n */\nexport function sdGenericRoutes(): Routes {\n const bridge = new SdGenericCatalogBridge();\n // why: a portal SdPermissionGuard denies routes without data.permission; the generic guards check the real\n // codes, which depend on :module/:entity and cannot be static route data (D-024).\n const data = (action?: SdGenericAction) => ({ permission: SD_PERMISSION_PUBLIC, ...(action ? { sdGenericAction: action } : {}) });\n const form = (action: SdGenericFormAction): Route => ({\n path: action === 'create' ? 'create' : `:id/${action}`,\n data: data(action),\n canActivate: [sdGenericPermissionGuard(action)],\n loadComponent: () => import('../pages/form/generic-form-host.page').then(m => m.GenericFormHostPage),\n });\n return [\n {\n path: 'generic/:module/:entity',\n data: data(),\n providers: [\n SdGenericSchemaService,\n SdGenericDataService,\n SdGenericPermissionService,\n provideSdFormGeneric({ catalogs: [sdGenericRelationCatalog(bridge)] }),\n provideEnvironmentInitializer(() => bridge.attach(inject(EnvironmentInjector))),\n ],\n children: [\n {\n path: 'configuration',\n data: data('configuration'),\n canActivate: [sdGenericPermissionGuard('configuration')],\n resolve: { generic: sdGenericSchemaResolver },\n loadComponent: () => import('../pages/configuration/generic-configuration.page').then(m => m.GenericConfigurationPage),\n },\n {\n path: '',\n data: data('list'),\n canActivate: [sdGenericPermissionGuard('list')],\n resolve: { generic: sdGenericSchemaResolver },\n loadComponent: () => import('../pages/list/generic-list.page').then(m => m.GenericListPage),\n children: [form('create'), form('detail'), form('update')],\n },\n ],\n },\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DEFAULT_LIMIT","STRING_FORMATS","NUMBER_FORMATS"],"mappings":";;;;;;;AAUA;MACa,oBAAoB,GAAG,IAAI,cAAc,CAAoB,sBAAsB;AAEhG;AACO,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAuC,qBAAqB,CAAC;AAClH;AACO,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAiC,qBAAqB,CAAC;AAC5G;AACO,MAAM,4BAA4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AC;AAC3B,oBAAA,WAAW,EAAE,CAAC,wBAAwB,CAAC,eAAe,CAAC,CAAC;AACxD,oBAAA,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;AAC7C,oBAAA,aAAa,EAAE,MAAM,OAAO,4EAAmD,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,wBAAwB,CAAC;AACvH,iBAAA;AACD,gBAAA;AACE,oBAAA,IAAI,EAAE,EAAE;AACR,oBAAA,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;AAClB,oBAAA,WAAW,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAC/C,oBAAA,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;AAC7C,oBAAA,aAAa,EAAE,MAAM,OAAO,mEAAiC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC;AAC3F,oBAAA,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3D,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AACH;;AC/DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs","sources":["../../../projects/sdcorejs-angular/modules/generic/src/registry/generic-registry.ts","../../../projects/sdcorejs-angular/modules/generic/src/registry/provide-sd-generic.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-configuration-store.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-defaults.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-title.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-search.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-columns.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-form.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-import.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-merge.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-permission.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-property-icon.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/generic-validate.ts","../../../projects/sdcorejs-angular/modules/generic/src/core/index.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-data.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-import.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-permission.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-relation-catalog.ts","../../../projects/sdcorejs-angular/modules/generic/src/services/generic-schema.service.ts","../../../projects/sdcorejs-angular/modules/generic/src/routes/generic-route.guards.ts","../../../projects/sdcorejs-angular/modules/generic/src/routes/sd-generic.routes.ts","../../../projects/sdcorejs-angular/modules/generic/sdcorejs-angular-modules-generic.ts"],"sourcesContent":["import { InjectionToken, Injector, inject, type Type } from '@angular/core';\nimport type { SdGenericAdapter, SdGenericConfiguration, SdGenericDisplay, SdGenericEntityConfiguration } from '../models';\n\n/** What a form shown inside the list outlet needs from the list (D-024). */\nexport interface SdGenericListHost {\n reload(): void;\n /** The form reports its display mode: a page form takes the place of the list, a side drawer keeps it visible. */\n setFormDisplay(display: SdGenericDisplay): void;\n}\n\n/** Provided by the list page for the form pages of its outlet. */\nexport const SD_GENERIC_LIST_HOST = new InjectionToken<SdGenericListHost>('SD_GENERIC_LIST_HOST');\n\n/** Adapter lists of every `provideSdGeneric` call in one injector. */\nexport const SD_GENERIC_ADAPTERS = new InjectionToken<SdGenericConfiguration['adapters'][]>('SD_GENERIC_ADAPTERS');\n/** Entity configurations of every `provideSdGenericEntity` call in one injector. */\nexport const SD_GENERIC_ENTITIES = new InjectionToken<SdGenericEntityConfiguration[]>('SD_GENERIC_ENTITIES');\n/** `permission` option of every `provideSdGeneric` call in one injector. */\nexport const SD_GENERIC_PERMISSION_OPTION = new InjectionToken<(boolean | undefined)[]>('SD_GENERIC_PERMISSION_OPTION');\n\nconst entityKey = (module: string, entity: string) => `${module}.${entity}`;\n\n/**\n * Registrations of one injector plus a link to the scope of the parent injector. Lookups walk from the nearest\n * scope to the root, so a lazy route can override what the root declares (INV-001).\n */\nexport class SdGenericScope {\n constructor(\n readonly adapters: ReadonlyMap<string, SdGenericAdapter>,\n readonly entities: ReadonlyMap<string, SdGenericEntityConfiguration>,\n readonly permission: boolean | undefined,\n readonly parent: SdGenericScope | null\n ) {}\n\n adapter(module: string): SdGenericAdapter | undefined {\n return this.adapters.get(module) ?? this.parent?.adapter(module);\n }\n\n entity(module: string, entity: string): SdGenericEntityConfiguration | undefined {\n return this.entities.get(entityKey(module, entity)) ?? this.parent?.entity(module, entity);\n }\n\n /** `permission` of the nearest scope that declares it; `true` when none does. */\n permissionEnabled(): boolean {\n return this.permission ?? this.parent?.permissionEnabled() ?? true;\n }\n}\n\n/** Scope of the current injector. Every generic screen reads adapters and entity settings only through it. */\nexport const SD_GENERIC_SCOPE = new InjectionToken<SdGenericScope>('SD_GENERIC_SCOPE', {\n providedIn: 'root',\n factory: () => new SdGenericScope(new Map(), new Map(), undefined, null),\n});\n\nconst isAdapterClass = (value: Type<SdGenericAdapter> | SdGenericAdapter): value is Type<SdGenericAdapter> => typeof value === 'function';\n\n/** Factory of the scope of one injector: reads that injector's own registrations, links the parent scope. */\nexport const sdGenericScopeFactory = (): SdGenericScope => {\n const injector = inject(Injector);\n const adapters = new Map<string, SdGenericAdapter>();\n for (const value of (inject(SD_GENERIC_ADAPTERS, { self: true, optional: true }) ?? []).flat()) {\n const adapter = isAdapterClass(value) ? injector.get(value) : value;\n // why: two adapters for one module in the same injector are ambiguous (D-020); fail while the injector is created.\n if (adapters.has(adapter.module))\n throw new Error(`SdGeneric: the module \"${adapter.module}\" is registered twice in the same injector.`);\n adapters.set(adapter.module, adapter);\n }\n const entities = new Map<string, SdGenericEntityConfiguration>();\n for (const entity of inject(SD_GENERIC_ENTITIES, { self: true, optional: true }) ?? []) {\n const key = entityKey(entity.module, entity.entity);\n if (entities.has(key)) throw new Error(`SdGeneric: the entity \"${key}\" is configured twice in the same injector.`);\n entities.set(key, entity);\n }\n const permission = (inject(SD_GENERIC_PERMISSION_OPTION, { self: true, optional: true }) ?? [])\n .filter(value => value !== undefined)\n .pop();\n const parent = inject(SD_GENERIC_SCOPE, { skipSelf: true, optional: true });\n return new SdGenericScope(adapters, entities, permission, parent);\n};\n","import {\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n type EnvironmentProviders,\n type Provider,\n type Type,\n} from '@angular/core';\nimport type { SdGenericAdapter, SdGenericConfiguration, SdGenericEntityConfiguration } from '../models';\nimport {\n SD_GENERIC_ADAPTERS,\n SD_GENERIC_ENTITIES,\n SD_GENERIC_PERMISSION_OPTION,\n SD_GENERIC_SCOPE,\n sdGenericScopeFactory,\n} from './generic-registry';\n\nconst scopeProviders = (): (Provider | EnvironmentProviders)[] => [\n { provide: SD_GENERIC_SCOPE, useFactory: sdGenericScopeFactory },\n // why: build the scope as soon as the injector exists, so a duplicate module throws at bootstrap / route\n // activation instead of on the first generic screen (AC-003).\n provideEnvironmentInitializer(() => inject(SD_GENERIC_SCOPE)),\n];\n\n/**\n * Registers backend adapters for the generic module. Call it at the root and/or in the `providers` of lazy\n * routes: lookups use the nearest injector first, then its parents. Adapter classes are created by DI.\n *\n * @example\n * provideSdGeneric({ adapters: [TmsAdapter] });\n */\nexport function provideSdGeneric(configuration: SdGenericConfiguration): EnvironmentProviders {\n const classes = configuration.adapters.filter((adapter): adapter is Type<SdGenericAdapter> => typeof adapter === 'function');\n return makeEnvironmentProviders([\n ...classes.map(adapter => ({ provide: adapter, useClass: adapter })),\n { provide: SD_GENERIC_ADAPTERS, multi: true, useValue: configuration.adapters },\n { provide: SD_GENERIC_PERMISSION_OPTION, multi: true, useValue: configuration.permission },\n ...scopeProviders(),\n ]);\n}\n\n/**\n * Code-level customization of one entity: schema adjustments, dedicated search, display mode, save hooks and\n * custom actions. Same scoping rules as `provideSdGeneric`.\n */\nexport function provideSdGenericEntity(configuration: SdGenericEntityConfiguration): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: SD_GENERIC_ENTITIES, multi: true, useValue: configuration }, ...scopeProviders()]);\n}\n","import type { SdGenericSchema, SdGenericSchemaStore } from '../models';\n\n/** `localStorage` key of the customized schema of one entity (A-005). */\nexport const sdGenericStorageKey = (module: string, entity: string): string => `sd-generic:configuration:${module}.${entity}`;\n\n/**\n * Default schema store when the adapter has no `schemaStore`. It only lives in this browser, so real deployments\n * should give the adapter a `schemaStore` backed by the server.\n */\nexport class SdGenericLocalStore implements SdGenericSchemaStore {\n constructor(private readonly module: string) {}\n\n async get(entity: string): Promise<SdGenericSchema | null> {\n let raw: string | null;\n try {\n raw = localStorage.getItem(sdGenericStorageKey(this.module, entity));\n } catch {\n // why: no storage (server rendering, blocked site data) means no configuration yet, not a failed screen.\n return null;\n }\n if (raw === null) return null;\n try {\n return JSON.parse(raw) as SdGenericSchema;\n } catch {\n // why: unreadable content is handed to the validator, which reports it as a shape error (fallback to default).\n return raw as unknown as SdGenericSchema;\n }\n }\n\n async set(entity: string, schema: SdGenericSchema): Promise<void> {\n localStorage.setItem(sdGenericStorageKey(this.module, entity), JSON.stringify(schema));\n }\n}\n","import type { SdGenericListColumn, SdGenericProperty, SdGenericSchema } from '../models';\n\nexport const SD_GENERIC_DEFAULT_PAGE_SIZE = 20;\n\n/** Data types that get no list column unless one is configured, and are never imported. */\nconst NOT_LISTED = new Set(['json', 'file']);\n\n/** Configured columns, or every property except `json` and `file`. */\nexport const sdGenericListColumns = (schema: SdGenericSchema): SdGenericListColumn[] =>\n schema.list?.columns ??\n schema.general.properties.filter(property => !NOT_LISTED.has(property.dataType)).map(property => ({ key: property.key }));\n\nexport const sdGenericPageSize = (schema: SdGenericSchema): number => schema.list?.pageSize ?? SD_GENERIC_DEFAULT_PAGE_SIZE;\n\nexport const sdGenericPrimaryKey = (schema: SdGenericSchema): string => schema.general.primaryKey || 'id';\n\n/** Whether a create form may contain the property. */\nexport const sdGenericCanInsert = (property: SdGenericProperty): boolean => !property.system && property.insertable !== false;\n\n/** Whether an update form may contain the property. */\nexport const sdGenericCanUpdate = (property: SdGenericProperty): boolean => !property.system && property.updatable !== false;\n\n/** Whether the default import columns contain the property: insertable, and neither `json` nor `file`. */\nexport const sdGenericImportable = (property: SdGenericProperty): boolean =>\n sdGenericCanInsert(property) && !NOT_LISTED.has(property.dataType);\n\n/** Properties indexed by key. */\nexport const sdGenericPropertyMap = (schema: SdGenericSchema): Map<string, SdGenericProperty> =>\n new Map(schema.general.properties.map(property => [property.key, property]));\n","import type { SdGenericRecord, SdGenericSchemaIssue } from '../models';\n\nconst PLACEHOLDER = /\\$\\{\\s*([^}]*?)\\s*\\}/g;\n\nexport type SdGenericTitleSection = 'list' | 'create' | 'detail' | 'update';\n\n/** Keys referenced by `${key}` placeholders, in order. */\nexport const sdGenericTitlePlaceholders = (template: string): string[] => Array.from(template.matchAll(PLACEHOLDER), match => match[1]);\n\n/**\n * Replaces `${key}` with the record value. The result is plain text: callers bind it with text interpolation,\n * never as HTML (INV-006).\n */\nexport const sdGenericRenderTitle = (template: string, record?: SdGenericRecord | null): string =>\n template.replace(PLACEHOLDER, (_, key: string) => {\n const value = record?.[key];\n return value === undefined || value === null ? '' : String(value);\n });\n\n/** Issues of one section title: list/create titles take no placeholder, detail/update ones only known keys. */\nexport const sdGenericTitleIssues = (\n section: SdGenericTitleSection,\n template: unknown,\n keys: ReadonlySet<string>\n): SdGenericSchemaIssue[] => {\n const path = `${section}.title`;\n if (template === undefined) return [];\n if (typeof template !== 'string') return [{ code: 'shape', severity: 'error', path, message: `${path} must be a string.` }];\n const placeholders = sdGenericTitlePlaceholders(template);\n if (section === 'list' || section === 'create') {\n return placeholders.length\n ? [\n {\n code: 'title-placeholder-forbidden',\n severity: 'error',\n path,\n message: `${path} cannot contain placeholders; there is no record yet.`,\n },\n ]\n : [];\n }\n return placeholders\n .filter(key => !keys.has(key))\n .map(key => ({\n code: 'title-placeholder-unknown' as const,\n severity: 'error' as const,\n path,\n message: `${path} references the unknown property \"${key}\".`,\n }));\n};\n","import type { Filter, PagingReq } from '@sdcorejs/utils/models';\nimport type { SdGenericProperty, SdGenericRecord, SdGenericSearchReq } from '../models';\nimport { sdGenericRenderTitle } from './generic-title';\n\nconst DEFAULT_LIMIT = 20;\n\n/** Relation of a property with its defaults resolved. */\nexport interface SdGenericRelationInfo {\n module: string;\n entity: string;\n valueField: string;\n displayField: string;\n searchFields: string[];\n display?: string;\n}\n\n/** Relation defaults: the schema module, `valueField` `id`, `displayField` the value field, search on the display field. */\nexport const sdGenericRelationInfo = (property: SdGenericProperty, module: string): SdGenericRelationInfo => {\n const relation = property.relation ?? { entity: '' };\n const valueField = relation.valueField || 'id';\n const displayField = relation.displayField || valueField;\n const info: SdGenericRelationInfo = {\n module: relation.module || module,\n entity: relation.entity,\n valueField,\n displayField,\n searchFields: relation.searchFields?.length ? [...relation.searchFields] : [displayField],\n };\n if (relation.display) info.display = relation.display;\n return info;\n};\n\n/** `query` request used when neither the entity nor the adapter has a search: `IN` for values, `CONTAIN` for a term. */\nexport const sdGenericSearchPagingReq = (req: SdGenericSearchReq): PagingReq => {\n const filters: Filter[] = [...(req.filters ?? [])];\n if (req.values?.length) {\n filters.push({ field: req.valueField, operator: 'IN', data: [...req.values] as never });\n } else if (req.term) {\n filters.push({ operator: 'OR', data: req.fields.map(field => ({ field, operator: 'CONTAIN', data: req.term })) } as Filter);\n }\n return { pageNumber: 0, pageSize: req.values?.length || req.limit || DEFAULT_LIMIT, filters };\n};\n\n/** Text label of a related record: the display template, then the display field, then the value field. */\nexport const sdGenericRecordLabel = (record: SdGenericRecord, info: SdGenericRelationInfo): string => {\n if (info.display) return sdGenericRenderTitle(info.display, record);\n const value = record[info.displayField] ?? record[info.valueField];\n return value === undefined || value === null ? '' : String(value);\n};\n\n/** form-generic option values are strings; this restores the original value (a numeric id stays a number). */\nexport const sdGenericCoerceValue = (raw: unknown, known: ReadonlyMap<string, unknown>): unknown => {\n if (Array.isArray(raw)) return raw.map(item => sdGenericCoerceValue(item, known));\n if (typeof raw === 'string' && known.has(raw)) return known.get(raw);\n return raw;\n};\n","import type { SdTableColumn, SdTableExternalFilter } from '@sdcorejs/angular/components/table';\nimport type { SdSearch } from '@sdcorejs/angular/forms/models';\nimport type { SdGenericListColumn, SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericListColumns, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Field added by the data service to related records when the relation has a display template. */\nexport const SD_GENERIC_LABEL_FIELD = '$label';\n\n/** Lookups of relation columns and filters, provided by the data service so this file stays pure. */\nexport interface SdGenericColumnDeps {\n relationSearch(property: SdGenericProperty): SdSearch<SdGenericRecord>;\n relationViews(property: SdGenericProperty): (values: string[]) => Promise<SdGenericRecord[]>;\n}\n\ntype Column = SdTableColumn<SdGenericRecord>;\n\nconst relationDisplayField = (property: SdGenericProperty, schema: SdGenericSchema): string => {\n const info = sdGenericRelationInfo(property, schema.module);\n return info.display ? SD_GENERIC_LABEL_FIELD : info.displayField;\n};\n\nconst fileNames = (value: unknown): string =>\n (Array.isArray(value) ? value : value === undefined || value === null ? [] : [value])\n .map(item => (item && typeof item === 'object' ? String((item as Record<string, unknown>)['name'] ?? '') : String(item)))\n .filter(Boolean)\n .join(', ');\n\nconst columnOf = (property: SdGenericProperty, schema: SdGenericSchema, deps: SdGenericColumnDeps): Column => {\n const base = { field: property.key, title: property.label };\n switch (property.dataType) {\n case 'number':\n return { ...base, type: 'number' };\n case 'boolean':\n return { ...base, type: 'boolean' };\n case 'date':\n case 'datetime':\n return { ...base, type: property.dataType };\n case 'time':\n return { ...base, type: 'time' };\n case 'enum': {\n const enums = property.enums ?? [];\n const styled = enums.some(option => option.color || option.icon);\n return {\n ...base,\n type: 'values',\n option: {\n items: enums,\n valueField: 'value',\n displayField: 'label',\n ...(property.multiple ? { selection: 'MULTIPLE' as const } : {}),\n },\n ...(styled\n ? {\n useBadge: (value: unknown) => {\n const option = enums.find(candidate => candidate.value === value);\n return { color: option?.color as never, icon: option?.icon };\n },\n }\n : {}),\n } as Column;\n }\n case 'relation': {\n const info = sdGenericRelationInfo(property, schema.module);\n return {\n ...base,\n type: 'lazy-values',\n option: {\n items: deps.relationSearch(property),\n valueField: info.valueField,\n displayField: relationDisplayField(property, schema),\n views: deps.relationViews(property),\n ...(property.multiple ? { selection: 'MULTIPLE' as const } : {}),\n },\n } as Column;\n }\n case 'json':\n return {\n ...base,\n type: 'string',\n transform: (value: unknown) => (value === undefined || value === null ? '' : JSON.stringify(value)),\n };\n case 'file':\n return { ...base, type: 'string', transform: (value: unknown) => fileNames(value) };\n default:\n return { ...base, type: 'string' };\n }\n};\n\nconst withFlags = (column: Column, config: SdGenericListColumn): Column => ({\n ...column,\n ...(config.width ? { width: `${config.width}px` } : {}),\n ...(config.visible === false ? { invisible: true } : {}),\n ...(config.sortable !== undefined ? { sortable: config.sortable } : {}),\n ...(config.filterable === false ? { filter: { disabled: true } } : {}),\n});\n\n/**\n * sd-table columns of the list (INV-013); configured keys that no longer exist are skipped. With `open`, the first\n * visible column that is not a server field (else the first visible one) links to the record.\n */\nexport const sdGenericTableColumns = (\n schema: SdGenericSchema,\n deps: SdGenericColumnDeps,\n open?: (row: SdGenericRecord) => void\n): Column[] => {\n const properties = sdGenericPropertyMap(schema);\n const configs = sdGenericListColumns(schema).filter(config => properties.has(config.key));\n const visible = configs.filter(config => config.visible !== false);\n const link = open ? (visible.find(config => !properties.get(config.key)!.system) ?? visible[0]) : undefined;\n return configs.map(config => {\n const column = withFlags(columnOf(properties.get(config.key)!, schema, deps), config);\n return config === link ? { ...column, click: (_value: unknown, row: SdGenericRecord) => open!(row) } : column;\n });\n};\n\n/** sd-table external filters of the list, shown by default; json and file properties cannot be filtered. */\nexport const sdGenericExternalFilters = (schema: SdGenericSchema, deps: SdGenericColumnDeps): SdTableExternalFilter[] => {\n const properties = sdGenericPropertyMap(schema);\n return (schema.list?.externalFilters ?? []).flatMap(config => {\n const property = properties.get(config.key);\n if (!property) return [];\n const base = {\n field: property.key,\n title: property.label,\n // why: a configured filter is shown right away; the list hides the toolbar that would let users pick it.\n defaultShowing: true,\n ...(config.required ? { required: true } : {}),\n ...(config.operator ? { defaultOperator: config.operator } : {}),\n ...(config.default !== undefined ? { default: config.default } : {}),\n };\n switch (property.dataType) {\n case 'string':\n case 'text':\n case 'time':\n return [{ ...base, type: 'string' } as SdTableExternalFilter];\n case 'number':\n return [{ ...base, type: 'number' } as SdTableExternalFilter];\n case 'boolean':\n return [{ ...base, type: 'boolean' } as SdTableExternalFilter];\n case 'date':\n case 'datetime':\n return [{ ...base, type: 'daterange', ...(property.dataType === 'datetime' ? { enableTime: true } : {}) } as SdTableExternalFilter];\n case 'enum':\n return [\n {\n ...base,\n type: 'values',\n option: { items: property.enums ?? [], valueField: 'value', displayField: 'label', selection: 'MULTIPLE' },\n } as SdTableExternalFilter,\n ];\n case 'relation': {\n const info = sdGenericRelationInfo(property, schema.module);\n return [\n {\n ...base,\n type: 'lazy-values',\n option: {\n items: deps.relationSearch(property),\n valueField: info.valueField,\n displayField: relationDisplayField(property, schema),\n selection: 'MULTIPLE',\n },\n } as SdTableExternalFilter,\n ];\n }\n default:\n return [];\n }\n });\n};\n","import type { SdFormGenericField, SdFormGenericFieldValidation, SdFormGenericSchema } from '@sdcorejs/angular/components/form-generic';\nimport type { SdGenericFormAction, SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericCanInsert, sdGenericCanUpdate, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Id of the form-generic catalog that serves every relation select (D-022). */\nexport const SD_GENERIC_RELATION_CATALOG = 'sd-generic-relation';\n\ntype FieldType = SdFormGenericField['type'];\ntype JsonRecord = Record<string, unknown>;\n\nconst STRING_FORMATS = new Set(['email', 'phone', 'url', 'password']);\nconst NUMBER_FORMATS = new Set(['integer', 'decimal', 'currency', 'percent']);\n/** Layout-only members of a stored field; everything else comes from `general` (INV-007). */\nconst LAYOUT_MEMBERS = ['layout', 'rules', 'helperText', 'placeholder', 'hidden', 'disabled', 'viewed', 'hyperlink', 'direction'] as const;\n\n/** form-generic field type generated for a property. */\nexport const sdGenericFieldType = (property: SdGenericProperty): FieldType => {\n switch (property.dataType) {\n case 'string':\n return property.multiple ? 'chip-string' : 'textfield';\n case 'text':\n return 'textarea';\n case 'number':\n return 'number';\n case 'boolean':\n return 'checkbox';\n case 'date':\n case 'datetime':\n return 'datetime';\n case 'time':\n return 'time';\n case 'enum':\n case 'relation':\n return 'select';\n case 'json':\n return 'json';\n case 'file':\n return 'upload';\n }\n};\n\n/** Field types a stored layout may use for a property: a single enum may also be a radio group. */\nexport const sdGenericAllowedFieldTypes = (property: SdGenericProperty): FieldType[] =>\n property.dataType === 'enum' && !property.multiple ? ['select', 'radio'] : [sdGenericFieldType(property)];\n\nconst validationOf = (property: SdGenericProperty): SdFormGenericFieldValidation | undefined => {\n const source = property.validation;\n if (!source) return undefined;\n const validation: SdFormGenericFieldValidation = {};\n if (source.required) validation.required = true;\n if (source.min !== undefined) validation.min = source.min;\n if (source.max !== undefined) validation.max = source.max;\n if (source.minLength !== undefined) validation.minLength = source.minLength;\n if (source.maxLength !== undefined) validation.maxLength = source.maxLength;\n if (source.pattern) validation.pattern = { value: source.pattern };\n return Object.keys(validation).length ? validation : undefined;\n};\n\nconst optionsOf = (property: SdGenericProperty, schema: SdGenericSchema): JsonRecord | undefined => {\n if (property.dataType === 'enum') {\n return { source: 'static', items: (property.enums ?? []).map(option => ({ value: option.value, label: option.label })) };\n }\n if (property.dataType === 'relation') {\n const info = sdGenericRelationInfo(property, schema.module);\n const param = (name: string, value: string) => ({ name, value: { value } });\n return {\n source: 'catalog',\n catalog: SD_GENERIC_RELATION_CATALOG,\n // why: constant params make the form-generic cache key unique per relation, not per entity.\n params: [\n param('module', info.module),\n param('entity', info.entity),\n param('valueField', info.valueField),\n param('displayField', info.displayField),\n param('searchFields', info.searchFields.join(',')),\n param('display', info.display ?? ''),\n ],\n };\n }\n return undefined;\n};\n\n/**\n * A full form-generic field: data from the property, layout members from the stored field when there is one. The\n * default value only fills a create form; on detail / update it would replace a value the record left empty.\n */\nconst hydrate = (\n property: SdGenericProperty,\n schema: SdGenericSchema,\n action: SdGenericFormAction,\n stored?: JsonRecord\n): SdFormGenericField => {\n const allowed = sdGenericAllowedFieldTypes(property);\n const type = stored && allowed.includes(stored['type'] as FieldType) ? (stored['type'] as FieldType) : sdGenericFieldType(property);\n const field: JsonRecord = {\n id: typeof stored?.['id'] === 'string' ? stored['id'] : property.key,\n key: property.key,\n type,\n label: property.label,\n };\n for (const member of LAYOUT_MEMBERS) if (stored && stored[member] !== undefined) field[member] = stored[member];\n const validation = validationOf(property);\n if (validation) field['validation'] = validation;\n if (action === 'create' && property.defaultValue !== undefined) field['defaultValue'] = property.defaultValue;\n if (type === 'textfield' && property.format && STRING_FORMATS.has(property.format)) field['subtype'] = property.format;\n if (type === 'number' && property.format && NUMBER_FORMATS.has(property.format)) field['subtype'] = property.format;\n if (type === 'datetime') field['subtype'] = property.dataType === 'datetime' ? 'datetime' : 'date';\n if (type === 'select' || type === 'radio') field['options'] = optionsOf(property, schema);\n if (type === 'select') field['multiple'] = !!property.multiple;\n if (type === 'upload' && !property.multiple) field['maxFiles'] = 1;\n return field as unknown as SdFormGenericField;\n};\n\nconst isAllowed =\n (action: SdGenericFormAction) =>\n (property: SdGenericProperty): boolean =>\n action === 'create' ? sdGenericCanInsert(property) : action === 'update' ? sdGenericCanUpdate(property) : true;\n\n/**\n * Form of one action: the action layout, then the detail layout, then a generated one-page layout. Stored fields\n * keep only their layout; type, label, options and validation always come from `general` (INV-007).\n */\nexport const sdGenericBuildForm = (schema: SdGenericSchema, action: SdGenericFormAction): SdFormGenericSchema => {\n const allowed = isAllowed(action);\n const properties = sdGenericPropertyMap(schema);\n const layout = schema[action]?.form ?? (action === 'detail' ? undefined : schema.detail?.form);\n if (!layout) {\n return {\n pages: [{ id: 'main', elements: schema.general.properties.filter(allowed).map(property => hydrate(property, schema, action)) }],\n };\n }\n const elementsOf = (elements: unknown): unknown[] =>\n (Array.isArray(elements) ? elements : []).flatMap((element): unknown[] => {\n const node = element as JsonRecord;\n if (node['type'] === 'group') return [{ ...node, elements: elementsOf(node['elements']) }];\n if (node['type'] === 'html') return [node];\n const property = properties.get(node['key'] as string);\n return property && allowed(property) ? [hydrate(property, schema, action, node)] : [];\n });\n return { ...layout, pages: layout.pages.map(page => ({ ...page, elements: elementsOf(page.elements) })) } as SdFormGenericSchema;\n};\n\n/** Payload of a save: only insertable values on create, only updatable values on update (INV-007). */\nexport const sdGenericFormPayload = (\n schema: SdGenericSchema,\n action: 'create' | 'update',\n value: Readonly<SdGenericRecord>\n): SdGenericRecord => {\n const allowed = isAllowed(action);\n const payload: SdGenericRecord = {};\n for (const property of schema.general.properties) {\n if (allowed(property) && Object.hasOwn(value, property.key)) payload[property.key] = value[property.key];\n }\n return payload;\n};\n","import type { SdGenericProperty, SdGenericRecord, SdGenericSchema } from '../models';\nimport { sdGenericImportable, sdGenericPropertyMap } from './generic-defaults';\nimport { sdGenericRelationInfo } from './generic-search';\n\n/** Concurrent adapter calls of an import (D-016). */\nexport const SD_GENERIC_IMPORT_CONCURRENCY = 5;\n\n/** Values per lookup request of an import, so that one request stays under backend page-size and URL limits. */\nexport const SD_GENERIC_IMPORT_LOOKUP_SIZE = 100;\n\n/** Lookup entry of a match value that several records share; such a cell cannot be resolved. */\nexport const SD_GENERIC_AMBIGUOUS = Symbol('sd-generic-ambiguous');\n\nexport interface SdGenericImportColumnInfo {\n key: string;\n property: SdGenericProperty;\n /** Relation column: field of the related record matched against the cell. */\n matchField?: string;\n}\n\nexport interface SdGenericImportCellError {\n key: string;\n code: 'enum-unknown' | 'relation-not-found' | 'number-invalid' | 'match-ambiguous';\n value: unknown;\n}\n\nexport type SdGenericImportOp = { kind: 'create'; data: SdGenericRecord } | { kind: 'update'; id: string; data: SdGenericRecord };\n\nconst TRUE_VALUES = new Set(['true', '1', 'yes', 'x']);\n\n/** `values` split into lists of at most `size` items. */\nexport const sdGenericChunk = <T>(values: readonly T[], size: number): T[][] => {\n const chunks: T[][] = [];\n for (let start = 0; start < values.length; start += size) chunks.push(values.slice(start, start + size));\n return chunks;\n};\n\n/** `match value -> stored value`; a match value shared by several records maps to `SD_GENERIC_AMBIGUOUS`. */\nexport const sdGenericLookupMap = (entries: readonly (readonly [string, unknown])[]): Map<string, unknown> => {\n const lookup = new Map<string, unknown>();\n for (const [match, value] of entries) lookup.set(match, lookup.has(match) && lookup.get(match) !== value ? SD_GENERIC_AMBIGUOUS : value);\n return lookup;\n};\n\nconst matchFieldOf = (property: SdGenericProperty, schema: SdGenericSchema, configured?: string): string | undefined =>\n property.dataType === 'relation' ? configured || sdGenericRelationInfo(property, schema.module).displayField : undefined;\n\n/** Import columns: configured ones that still exist, or every insertable property except system, json and file. */\nexport const sdGenericImportColumns = (schema: SdGenericSchema): SdGenericImportColumnInfo[] => {\n const properties = sdGenericPropertyMap(schema);\n const configured = schema.import?.columns;\n if (configured) {\n return configured.flatMap(column => {\n const property = properties.get(column.key);\n return property ? [{ key: property.key, property, matchField: matchFieldOf(property, schema, column.matchField) }] : [];\n });\n }\n return schema.general.properties\n .filter(sdGenericImportable)\n .map(property => ({ key: property.key, property, matchField: matchFieldOf(property, schema) }));\n};\n\n/** Empty spreadsheet cell: no value, or only spaces. */\nexport const sdGenericIsBlank = (value: unknown): boolean =>\n value === undefined || value === null || (typeof value === 'string' && value.trim() === '');\nconst isBlank = sdGenericIsBlank;\n\n/**\n * Converts one spreadsheet row: enum cells by value or label, relation cells through `lookups`\n * (`property key -> match value -> stored value`).\n */\nexport const sdGenericParseImportRow = (\n row: Readonly<Record<string, unknown>>,\n columns: readonly SdGenericImportColumnInfo[],\n lookups: ReadonlyMap<string, ReadonlyMap<string, unknown>>\n): { data: SdGenericRecord; errors: SdGenericImportCellError[] } => {\n const data: SdGenericRecord = {};\n const errors: SdGenericImportCellError[] = [];\n for (const { key, property } of columns) {\n const cell = row[key];\n if (isBlank(cell)) continue;\n switch (property.dataType) {\n case 'enum': {\n const text = String(cell).trim();\n const option =\n property.enums?.find(candidate => candidate.value === text) ??\n property.enums?.find(candidate => candidate.label.trim().toLowerCase() === text.toLowerCase());\n if (option) data[key] = option.value;\n else errors.push({ key, code: 'enum-unknown', value: cell });\n break;\n }\n case 'relation': {\n const lookup = lookups.get(key);\n const texts = property.multiple\n ? String(cell)\n .split(',')\n .map(part => part.trim())\n .filter(Boolean)\n : [String(cell).trim()];\n const values = texts.map(text => lookup?.get(text));\n const missing = texts.filter((_, index) => values[index] === undefined);\n const ambiguous = texts.filter((_, index) => values[index] === SD_GENERIC_AMBIGUOUS);\n if (missing.length) errors.push({ key, code: 'relation-not-found', value: property.multiple ? missing.join(', ') : cell });\n else if (ambiguous.length) errors.push({ key, code: 'match-ambiguous', value: property.multiple ? ambiguous.join(', ') : cell });\n else data[key] = property.multiple ? values : values[0];\n break;\n }\n case 'number': {\n const value = typeof cell === 'number' ? cell : Number(String(cell).trim());\n if (Number.isFinite(value)) data[key] = value;\n else errors.push({ key, code: 'number-invalid', value: cell });\n break;\n }\n case 'boolean':\n data[key] = typeof cell === 'boolean' ? cell : TRUE_VALUES.has(String(cell).trim().toLowerCase());\n break;\n default:\n data[key] = cell;\n }\n }\n return { data, errors };\n};\n\n/**\n * Update when the upsert key matches one existing record (`existing`: key value -> id), otherwise create. A key\n * value that several records share is not planned: the caller reports the row as ambiguous.\n */\nexport const sdGenericPlanUpsert = (\n rows: readonly SdGenericRecord[],\n upsertKey: string | undefined,\n existing: ReadonlyMap<string, unknown>\n): (SdGenericImportOp | null)[] =>\n rows.map(data => {\n const match = upsertKey && !isBlank(data[upsertKey]) ? existing.get(String(data[upsertKey])) : undefined;\n if (match === SD_GENERIC_AMBIGUOUS) return null;\n return match === undefined ? { kind: 'create', data } : { kind: 'update', id: String(match), data };\n });\n\n/** Runs `worker` over `items` with at most `limit` calls in flight; results keep the item order. */\nexport const sdGenericRunLimited = async <T, R>(\n items: readonly T[],\n limit: number,\n worker: (item: T, index: number) => Promise<R>\n): Promise<PromiseSettledResult<R>[]> => {\n const results: PromiseSettledResult<R>[] = new Array(items.length);\n let next = 0;\n const lane = async (): Promise<void> => {\n while (next < items.length) {\n const index = next++;\n try {\n results[index] = { status: 'fulfilled', value: await worker(items[index], index) };\n } catch (reason) {\n results[index] = { status: 'rejected', reason };\n }\n }\n };\n await Promise.all(Array.from({ length: Math.min(Math.max(1, limit), items.length) }, lane));\n return results;\n};\n","import type { SdFormGenericSchema } from '@sdcorejs/angular/components/form-generic';\nimport type { SdGenericFormSection, SdGenericProperty, SdGenericSchema } from '../models';\n\nexport interface SdGenericMergeResult {\n schema: SdGenericSchema;\n /** Stored property keys that the current schema no longer has. */\n removed: string[];\n /** Current property keys that the stored configuration does not know yet. */\n added: string[];\n}\n\ntype JsonRecord = Record<string, unknown>;\n\n/**\n * One property: structure (`key`, `dataType`, `multiple`, `system`, `enums[].value`, `relation.entity`) from the\n * current schema, display and form settings from the stored one.\n */\nexport const sdGenericMergeProperty = (current: SdGenericProperty, stored: SdGenericProperty | undefined): SdGenericProperty => {\n if (!stored) return current;\n const merged: SdGenericProperty = { ...current };\n if (typeof stored.label === 'string') merged.label = stored.label;\n if (stored.format !== undefined) merged.format = stored.format;\n if (stored.validation !== undefined) merged.validation = stored.validation;\n if (Object.hasOwn(stored, 'defaultValue')) merged.defaultValue = stored.defaultValue;\n // why: a configuration may only narrow what the backend allows; it never reopens a field the adapter locked.\n if (stored.insertable === false) merged.insertable = false;\n if (stored.updatable === false) merged.updatable = false;\n if (current.enums) {\n merged.enums = current.enums.map(option => {\n const saved = stored.enums?.find(candidate => candidate.value === option.value);\n if (!saved) return option;\n return {\n ...option,\n ...(typeof saved.label === 'string' ? { label: saved.label } : {}),\n ...(saved.color !== undefined ? { color: saved.color } : {}),\n ...(saved.icon !== undefined ? { icon: saved.icon } : {}),\n };\n });\n }\n if (current.relation) {\n const saved = stored.relation;\n merged.relation = {\n ...current.relation,\n ...(saved?.displayField !== undefined ? { displayField: saved.displayField } : {}),\n ...(saved?.display !== undefined ? { display: saved.display } : {}),\n ...(saved?.searchFields !== undefined ? { searchFields: saved.searchFields } : {}),\n };\n }\n return merged;\n};\n\n/** Removes fields whose key is not in `keys`; groups and html elements stay. */\nexport const sdGenericPruneLayout = (form: SdFormGenericSchema, keys: ReadonlySet<string>): SdFormGenericSchema => {\n const prune = (elements: unknown): unknown[] =>\n (Array.isArray(elements) ? elements : []).flatMap((element): unknown[] => {\n const node = element as JsonRecord;\n if (node['type'] === 'group') return [{ ...node, elements: prune(node['elements']) }];\n if (node['type'] === 'html') return [node];\n return keys.has(node['key'] as string) ? [node] : [];\n });\n return { ...form, pages: form.pages.map(page => ({ ...page, elements: prune(page.elements) })) } as SdFormGenericSchema;\n};\n\nconst mergeSection = (section: SdGenericFormSection | undefined, keys: ReadonlySet<string>): SdGenericFormSection | undefined =>\n section && { ...section, ...(section.form ? { form: sdGenericPruneLayout(section.form, keys) } : {}) };\n\n/**\n * Lays a stored configuration over the current schema (INV-002). Dangling references are dropped; new properties\n * join `general` and the configured columns (hidden) but never a stored form layout.\n */\nexport const sdGenericMergeSchema = (storedInput: SdGenericSchema, currentInput: SdGenericSchema): SdGenericMergeResult => {\n const stored = structuredClone(storedInput);\n const current = structuredClone(currentInput);\n const currentByKey = new Map(current.general.properties.map(property => [property.key, property]));\n const storedByKey = new Map(stored.general.properties.map(property => [property.key, property]));\n const keys = new Set(currentByKey.keys());\n const removed = stored.general.properties.map(property => property.key).filter(key => !keys.has(key));\n const added = current.general.properties.map(property => property.key).filter(key => !storedByKey.has(key));\n\n const properties = [\n ...stored.general.properties\n .filter(property => keys.has(property.key))\n .map(property => sdGenericMergeProperty(currentByKey.get(property.key)!, property)),\n ...added.map(key => currentByKey.get(key)!),\n ];\n\n const schema: SdGenericSchema = {\n version: 1,\n module: current.module,\n entity: current.entity,\n general: { ...current.general, label: stored.general.label || current.general.label, properties },\n };\n\n const list = stored.list ?? current.list;\n if (list) {\n schema.list = { ...list };\n if (list.columns) {\n const columns = list.columns.filter(column => keys.has(column.key));\n const listed = new Set(columns.map(column => column.key));\n schema.list.columns = [...columns, ...added.filter(key => !listed.has(key)).map(key => ({ key, visible: false }))];\n }\n // why: external filters are declared in code (backend schema or provideSdGenericEntity), never by a stored\n // configuration. `list` may be the stored one, so drop its value and take the current schema's (INV-004).\n delete schema.list.externalFilters;\n const externalFilters = current.list?.externalFilters;\n if (externalFilters) schema.list.externalFilters = externalFilters.filter(filter => keys.has(filter.key));\n if (list.orders) schema.list.orders = list.orders.filter(order => keys.has(order.field as string));\n }\n for (const action of ['detail', 'create', 'update'] as const) {\n const section = mergeSection(stored[action] ?? current[action], keys);\n if (section) schema[action] = section;\n }\n const importSection = stored.import ?? current.import;\n if (importSection) {\n schema.import = { ...importSection };\n if (importSection.columns) schema.import.columns = importSection.columns.filter(column => keys.has(column.key));\n if (importSection.upsertKey && !keys.has(importSection.upsertKey)) delete schema.import.upsertKey;\n }\n return { schema, removed, added };\n};\n","import type { SdGenericAction } from '../models';\n\n/** Upper-case word chain: `purchaseOrder` and `sales.invoice` become `PURCHASE_ORDER` and `SALES_INVOICE`. */\nconst segment = (value: string): string =>\n value\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .replace(/[^A-Za-z0-9]+/g, '_')\n .replace(/^_+|_+$/g, '')\n .toUpperCase();\n\n/** Permission code `<MODULE>_<ENTITY>_C_GENERIC_<ACTION>`; the only place that builds one (INV-005). */\nexport const sdGenericPermissionCode = (module: string, entity: string, action: SdGenericAction): string =>\n `${segment(module)}_${segment(entity)}_C_GENERIC_${action.toUpperCase()}`;\n","import { SD_DATA_TYPE_ICON, type SdDataTypeIconKey } from '@sdcorejs/angular/modules/icon';\nimport type { SdGenericProperty } from '../models';\n\nconst STRING_FORMATS = new Set<SdDataTypeIconKey>(['email', 'phone', 'url', 'password']);\nconst NUMBER_FORMATS = new Set<SdDataTypeIconKey>(['integer', 'decimal', 'currency', 'percent']);\n\n/**\n * Key of the shared data-type icon set (`@sdcorejs/angular/modules/icon`) for a property (INV-003).\n * `relation` and `file` keep one icon whether or not they hold several values; a format that does not belong\n * to the data type is ignored. A data type outside the set has no key: the backend schema is not validated.\n */\nexport function sdGenericPropertyIconKey(\n property: Pick<SdGenericProperty, 'dataType' | 'format' | 'multiple'>\n): SdDataTypeIconKey | undefined {\n const format = property.format as SdDataTypeIconKey | undefined;\n switch (property.dataType) {\n case 'string':\n if (property.multiple) return 'string-multiple';\n return format && STRING_FORMATS.has(format) ? format : 'string';\n case 'number':\n return format && NUMBER_FORMATS.has(format) ? format : 'number';\n case 'enum':\n return property.multiple ? 'enum-multiple' : 'enum';\n default:\n return Object.hasOwn(SD_DATA_TYPE_ICON, property.dataType) ? property.dataType : undefined;\n }\n}\n","import type { SdGenericProperty, SdGenericSchema, SdGenericSchemaIssue, SdGenericSchemaIssueCode } from '../models';\nimport { sdGenericCanInsert, sdGenericCanUpdate, sdGenericImportable } from './generic-defaults';\nimport { sdGenericAllowedFieldTypes } from './generic-form';\nimport { sdGenericMergeProperty } from './generic-merge';\nimport { sdGenericTitleIssues } from './generic-title';\n\ntype JsonRecord = Record<string, unknown>;\n\nconst DATA_TYPES = new Set(['string', 'text', 'number', 'boolean', 'date', 'datetime', 'time', 'enum', 'relation', 'json', 'file']);\n\n/**\n * Issues a load tolerates because a backend change can cause them and the merge or the form builder already\n * handles them: dangling references are dropped (D-013), unknown title placeholders render empty, and fields whose\n * type or create / update flag no longer fits are rebuilt or left out of the form. A save still refuses them.\n */\nconst TOLERATED_AT_LOAD = new Set<SdGenericSchemaIssueCode>([\n 'reference-dangling',\n 'title-placeholder-unknown',\n 'layout-type-mismatch',\n 'create-not-insertable',\n 'update-not-updatable',\n]);\n\nconst isRecord = (value: unknown): value is JsonRecord => !!value && typeof value === 'object' && !Array.isArray(value);\nconst isStringList = (value: unknown): boolean => Array.isArray(value) && value.every(item => typeof item === 'string');\n\n/** Whether an issue must replace the stored configuration with the default one. */\nexport const sdGenericBlocksLoad = (issue: SdGenericSchemaIssue): boolean => !TOLERATED_AT_LOAD.has(issue.code);\n\n/** Members of a stored property that the merge reads, checked so that a merge never meets a wrong type. */\nconst propertyShapeIssue = (value: JsonRecord): string | null => {\n for (const member of ['multiple', 'insertable', 'updatable', 'system'] as const) {\n if (value[member] !== undefined && typeof value[member] !== 'boolean') return `${member} must be a boolean.`;\n }\n if (value['format'] !== undefined && typeof value['format'] !== 'string') return 'format must be a string.';\n if (value['validation'] !== undefined && !isRecord(value['validation'])) return 'validation must be an object.';\n const enums = value['enums'];\n if (enums !== undefined && (!Array.isArray(enums) || !enums.every(option => isRecord(option) && typeof option['value'] === 'string')))\n return 'enums must be a list of options with a value.';\n const relation = value['relation'];\n if (relation === undefined) return null;\n if (!isRecord(relation)) return 'relation must be an object.';\n for (const member of ['displayField', 'display'] as const) {\n if (relation[member] !== undefined && typeof relation[member] !== 'string') return `relation.${member} must be a string.`;\n }\n if (relation['searchFields'] !== undefined && !isStringList(relation['searchFields']))\n return 'relation.searchFields must be a list of strings.';\n return null;\n};\n\n/**\n * Validates a stored configuration against the current schema of the entity (INV-003). The same function guards\n * the load and the configuration screen; an empty list means valid.\n */\nexport function validateSdGenericSchema(stored: unknown, base: SdGenericSchema): SdGenericSchemaIssue[] {\n const issues: SdGenericSchemaIssue[] = [];\n const report = (code: SdGenericSchemaIssueCode, path: string, message: string) => issues.push({ code, severity: 'error', path, message });\n /** Items of an optional list member; a present member that is not a list is a `shape` issue. */\n const listAt = (container: JsonRecord, member: string, path: string): unknown[] => {\n const value = container[member];\n if (value === undefined) return [];\n if (Array.isArray(value)) return value;\n report('shape', path, `${path} must be a list.`);\n return [];\n };\n\n if (!isRecord(stored)) {\n report('shape', '$', 'The configuration must be an object.');\n return issues;\n }\n if (stored['version'] !== 1) report('version', 'version', `Unsupported configuration version ${String(stored['version'])}; expected 1.`);\n for (const member of ['module', 'entity'] as const) {\n const value = stored[member];\n if (typeof value !== 'string') report('shape', member, `${member} must be a string.`);\n else if (value !== base[member])\n report(member === 'module' ? 'module-mismatch' : 'entity-mismatch', member, `${member} \"${value}\" does not match \"${base[member]}\".`);\n }\n const general = stored['general'];\n if (!isRecord(general) || typeof general['label'] !== 'string' || !Array.isArray(general['properties'])) {\n report('shape', 'general', 'general must have a label and a properties array.');\n return issues;\n }\n\n const current = new Map(base.general.properties.map(property => [property.key, property]));\n const keys = new Set(current.keys());\n const storedProperties = new Map<string, SdGenericProperty>();\n general['properties'].forEach((value: unknown, index: number) => {\n const path = `general.properties[${index}]`;\n if (!isRecord(value) || typeof value['key'] !== 'string' || !value['key'] || typeof value['label'] !== 'string') {\n report('shape', path, `${path} must have a key and a label.`);\n return;\n }\n const key = value['key'];\n if (storedProperties.has(key)) report('property-key-duplicate', `${path}.key`, `The property key \"${key}\" is used twice.`);\n if (!DATA_TYPES.has(value['dataType'] as string))\n report('property-type', `${path}.dataType`, `Unknown data type \"${String(value['dataType'])}\".`);\n if (!keys.has(key)) report('reference-dangling', `${path}.key`, `The property \"${key}\" no longer exists.`);\n const shapeIssue = propertyShapeIssue(value);\n if (shapeIssue) {\n report('shape', path, `${path}: ${shapeIssue}`);\n return;\n }\n storedProperties.set(key, value as unknown as SdGenericProperty);\n });\n const effective = (key: string): SdGenericProperty | undefined => {\n const property = current.get(key);\n return property && sdGenericMergeProperty(property, storedProperties.get(key));\n };\n const reference = (key: unknown, path: string): SdGenericProperty | undefined => {\n const property = typeof key === 'string' ? effective(key) : undefined;\n if (!property) report('reference-dangling', path, `\"${String(key)}\" is not a property of ${base.module}.${base.entity}.`);\n return property;\n };\n\n const list = stored['list'];\n if (list !== undefined) {\n if (!isRecord(list)) report('shape', 'list', 'list must be an object.');\n else {\n listAt(list, 'columns', 'list.columns').forEach((column, index) =>\n reference(isRecord(column) ? column['key'] : undefined, `list.columns[${index}].key`)\n );\n listAt(list, 'externalFilters', 'list.externalFilters').forEach((filter, index) =>\n reference(isRecord(filter) ? filter['key'] : undefined, `list.externalFilters[${index}].key`)\n );\n listAt(list, 'orders', 'list.orders').forEach((order, index) =>\n reference(isRecord(order) ? order['field'] : undefined, `list.orders[${index}].field`)\n );\n const pageSize = list['pageSize'];\n if (pageSize !== undefined && !(Number.isInteger(pageSize) && (pageSize as number) > 0))\n report('shape', 'list.pageSize', 'list.pageSize must be a positive integer.');\n }\n }\n\n const importSection = stored['import'];\n if (importSection !== undefined) {\n if (!isRecord(importSection)) report('shape', 'import', 'import must be an object.');\n else {\n const columns = importSection['columns'];\n const imported = new Set<string>();\n listAt(importSection, 'columns', 'import.columns').forEach((column, index) => {\n const property = reference(isRecord(column) ? column['key'] : undefined, `import.columns[${index}].key`);\n if (property) imported.add(property.key);\n });\n if (!Array.isArray(columns)) {\n for (const key of keys) if (sdGenericImportable(effective(key)!)) imported.add(key);\n }\n if (importSection['upsertKey'] !== undefined) {\n const property = reference(importSection['upsertKey'], 'import.upsertKey');\n if (property?.multiple)\n report('upsert-key-multiple', 'import.upsertKey', `The upsert key \"${property.key}\" cannot hold several values.`);\n else if (property && !imported.has(property.key))\n report('upsert-key-not-imported', 'import.upsertKey', `The upsert key \"${property.key}\" is not one of the import columns.`);\n }\n }\n }\n\n for (const action of ['detail', 'create', 'update'] as const) {\n const section = stored[action];\n if (section === undefined) continue;\n if (!isRecord(section)) {\n report('shape', action, `${action} must be an object.`);\n continue;\n }\n if (section['form'] === undefined) continue;\n const fields = layoutFields(section['form']);\n if (!fields) {\n report('layout-grammar', `${action}.form`, `${action}.form must be pages of groups and fields, with no nested group.`);\n continue;\n }\n for (const { node, path } of fields) {\n if (node['type'] === 'html') continue;\n const property = reference(node['key'], `${action}.form.${path}.key`);\n if (!property) continue;\n if (!sdGenericAllowedFieldTypes(property).includes(node['type'] as never)) {\n report(\n 'layout-type-mismatch',\n `${action}.form.${path}.type`,\n `\"${property.key}\" (${property.dataType}) cannot use a ${String(node['type'])} field.`\n );\n } else if (action === 'create' && !sdGenericCanInsert(property)) {\n report('create-not-insertable', `create.form.${path}.key`, `\"${property.key}\" cannot be set on create.`);\n } else if (action === 'update' && !sdGenericCanUpdate(property)) {\n report('update-not-updatable', `update.form.${path}.key`, `\"${property.key}\" cannot be changed on update.`);\n }\n }\n }\n\n for (const section of ['list', 'create', 'detail', 'update'] as const) {\n const value = stored[section];\n if (isRecord(value)) issues.push(...sdGenericTitleIssues(section, value['title'], keys));\n }\n return issues;\n}\n\n/** Field nodes of a layout with their paths, or `null` when the layout breaks the form-generic grammar. */\nconst layoutFields = (form: unknown): { node: JsonRecord; path: string }[] | null => {\n if (!isRecord(form) || !Array.isArray(form['pages'])) return null;\n const fields: { node: JsonRecord; path: string }[] = [];\n for (const [pageIndex, page] of form['pages'].entries()) {\n if (!isRecord(page) || !Array.isArray(page['elements'])) return null;\n for (const [index, element] of page['elements'].entries()) {\n const path = `pages[${pageIndex}].elements[${index}]`;\n if (!isRecord(element)) return null;\n if (element['type'] !== 'group') {\n fields.push({ node: element, path });\n continue;\n }\n if (!Array.isArray(element['elements'])) return null;\n for (const [childIndex, child] of element['elements'].entries()) {\n if (!isRecord(child) || child['type'] === 'group') return null;\n fields.push({ node: child, path: `${path}.elements[${childIndex}]` });\n }\n }\n }\n return fields;\n};\n","// Pure functions shared by every screen of the module (D-019): no DI, no DOM, no HTTP client.\nexport * from './generic-columns';\nexport * from './generic-defaults';\nexport * from './generic-form';\nexport * from './generic-import';\nexport * from './generic-merge';\nexport * from './generic-permission';\nexport * from './generic-property-icon';\nexport * from './generic-search';\nexport * from './generic-title';\nexport * from './generic-validate';\n","import { Injectable, inject } from '@angular/core';\nimport type { SdFormGenericCatalogItem } from '@sdcorejs/angular/components/form-generic';\nimport type { SdSearch } from '@sdcorejs/angular/forms/models';\nimport type { PagingReq, PagingRes } from '@sdcorejs/utils/models';\nimport {\n SD_GENERIC_LABEL_FIELD,\n sdGenericCoerceValue,\n sdGenericFormPayload,\n sdGenericRecordLabel,\n sdGenericRelationInfo,\n sdGenericSearchPagingReq,\n type SdGenericColumnDeps,\n type SdGenericRelationInfo,\n} from '../core';\nimport type { SdGenericAdapter, SdGenericProperty, SdGenericRecord, SdGenericSchema, SdGenericSearchReq } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\n\nconst DEFAULT_LIMIT = 20;\n/** Option strings remembered per relation; the oldest are forgotten first. */\nconst KNOWN_LIMIT = 500;\n\nconst text = (value: unknown): string => (value === undefined || value === null ? '' : String(value));\n\n/** Records `option string -> original value`, keeping at most `KNOWN_LIMIT` entries (least recently set first out). */\nconst remember = (known: Map<string, unknown>, option: string, value: unknown): void => {\n known.delete(option);\n known.set(option, value);\n if (known.size > KNOWN_LIMIT) known.delete(known.keys().next().value as string);\n};\n\n/** Relation info carried by the constant params of the relation catalog (D-022). */\nconst infoFromParams = (params: Readonly<Record<string, unknown>>): SdGenericRelationInfo => {\n const info: SdGenericRelationInfo = {\n module: text(params['module']),\n entity: text(params['entity']),\n valueField: text(params['valueField']) || 'id',\n displayField: text(params['displayField']) || text(params['valueField']) || 'id',\n searchFields: text(params['searchFields'])\n .split(',')\n .map(field => field.trim())\n .filter(Boolean),\n };\n if (!info.searchFields.length) info.searchFields = [info.displayField];\n if (text(params['display'])) info.display = text(params['display']);\n return info;\n};\n\n/**\n * The only caller of the data methods of the adapters (INV-008): applies the save hooks, the search order\n * (entity search -> adapter search -> `query`) and keeps relation values in their original type.\n */\n@Injectable()\nexport class SdGenericDataService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n /** `module.entity.valueField` -> option string -> original value. */\n readonly #known = new Map<string, Map<string, unknown>>();\n\n async query(module: string, entity: string, req: PagingReq): Promise<PagingRes<SdGenericRecord>> {\n return this.#adapter(module).query(entity, req);\n }\n\n async detail(module: string, entity: string, id: string): Promise<SdGenericRecord> {\n return this.#adapter(module).detail(entity, id);\n }\n\n async delete(module: string, entity: string, id: string): Promise<void> {\n await this.#adapter(module).delete(entity, id);\n }\n\n async search(module: string, entity: string, req: SdGenericSearchReq): Promise<SdGenericRecord[]> {\n const own = this.#scope.entity(module, entity)?.search;\n if (own) return own(req);\n const adapter = this.#adapter(module);\n if (adapter.search) return adapter.search(entity, req);\n return (await adapter.query(entity, sdGenericSearchPagingReq(req))).items;\n }\n\n /** Saves through the adapter: allowed fields only, relation values restored, then `beforeSave` / `afterSave`. */\n async save(\n schema: SdGenericSchema,\n action: 'create' | 'update',\n value: Readonly<SdGenericRecord>,\n id?: string\n ): Promise<SdGenericRecord> {\n const adapter = this.#adapter(schema.module);\n const hooks = this.#scope.entity(schema.module, schema.entity)?.hooks;\n let data = this.#restoreRelations(schema, sdGenericFormPayload(schema, action, value));\n if (hooks?.beforeSave) data = await hooks.beforeSave({ action, data, schema, ...(id === undefined ? {} : { id }) });\n const result = action === 'create' ? await adapter.create(schema.entity, data) : await adapter.update(schema.entity, id ?? '', data);\n await hooks?.afterSave?.({ action, data, schema, result, ...(id === undefined ? {} : { id }) });\n return result;\n }\n\n /** Record prepared for `sd-form-render`: relation values become the option strings of the relation catalog. */\n toFormValue(schema: SdGenericSchema, record: Readonly<SdGenericRecord>): SdGenericRecord {\n const value: SdGenericRecord = { ...record };\n for (const property of schema.general.properties) {\n if (property.dataType !== 'relation' || value[property.key] === undefined || value[property.key] === null) continue;\n const known = this.#knownFor(sdGenericRelationInfo(property, schema.module));\n const toText = (item: unknown) => {\n remember(known, String(item), item);\n return String(item);\n };\n const current = value[property.key];\n value[property.key] = Array.isArray(current) ? current.map(toText) : toText(current);\n }\n return value;\n }\n\n /** Options of the relation catalog, by term, by values, or the first page. */\n async relationItems(\n params: Readonly<Record<string, unknown>>,\n request: { term?: string; values?: string[] }\n ): Promise<SdFormGenericCatalogItem[]> {\n const info = infoFromParams(params);\n const known = this.#knownFor(info);\n const records = await this.search(info.module, info.entity, {\n fields: info.searchFields,\n valueField: info.valueField,\n // why: option strings go back to their original type (a numeric id stays a number) before reaching the adapter.\n ...(request.values\n ? { values: request.values.map(value => (known.has(value) ? known.get(value) : value)) }\n : { term: request.term ?? '', limit: DEFAULT_LIMIT }),\n });\n return records.map(record => {\n remember(known, text(record[info.valueField]), record[info.valueField]);\n return { value: text(record[info.valueField]), label: sdGenericRecordLabel(record, info), data: record };\n });\n }\n\n /** Search function of a relation column or filter of `sd-table`. */\n relationSearch(schema: SdGenericSchema, property: SdGenericProperty): SdSearch<SdGenericRecord> {\n const info = sdGenericRelationInfo(property, schema.module);\n return async args => {\n const values = args.type === 'VALUE' ? ([] as unknown[]).concat(args.value ?? []) : undefined;\n const records = await this.search(info.module, info.entity, {\n fields: args.searchFields?.length ? args.searchFields : info.searchFields,\n valueField: info.valueField,\n ...(values ? { values } : { term: args.searchText ?? '', limit: DEFAULT_LIMIT }),\n });\n return this.#labelled(records, info);\n };\n }\n\n /** Related records of displayed values for a relation column of `sd-table`. */\n relationViews(schema: SdGenericSchema, property: SdGenericProperty): (values: string[]) => Promise<SdGenericRecord[]> {\n const info = sdGenericRelationInfo(property, schema.module);\n const known = this.#knownFor(info);\n return async values =>\n this.#labelled(\n await this.search(info.module, info.entity, {\n values: values.map(value => (known.has(value) ? known.get(value) : value)),\n fields: info.searchFields,\n valueField: info.valueField,\n }),\n info\n );\n }\n\n /** Lookups of the table columns and filters of a schema. */\n columnDeps(schema: SdGenericSchema): SdGenericColumnDeps {\n return {\n relationSearch: property => this.relationSearch(schema, property),\n relationViews: property => this.relationViews(schema, property),\n };\n }\n\n #labelled(records: SdGenericRecord[], info: SdGenericRelationInfo): SdGenericRecord[] {\n return info.display ? records.map(record => ({ ...record, [SD_GENERIC_LABEL_FIELD]: sdGenericRecordLabel(record, info) })) : records;\n }\n\n #restoreRelations(schema: SdGenericSchema, data: SdGenericRecord): SdGenericRecord {\n for (const property of schema.general.properties) {\n if (property.dataType === 'relation' && Object.hasOwn(data, property.key)) {\n data[property.key] = sdGenericCoerceValue(data[property.key], this.#knownFor(sdGenericRelationInfo(property, schema.module)));\n }\n }\n return data;\n }\n\n #knownFor(info: SdGenericRelationInfo): Map<string, unknown> {\n const key = `${info.module}.${info.entity}.${info.valueField}`;\n let known = this.#known.get(key);\n if (!known) this.#known.set(key, (known = new Map()));\n return known;\n }\n\n #adapter(module: string): SdGenericAdapter {\n const adapter = this.#scope.adapter(module);\n if (!adapter) throw new Error(`SdGeneric: no adapter is registered for the module \"${module}\".`);\n return adapter;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n SD_GENERIC_IMPORT_CONCURRENCY,\n SD_GENERIC_IMPORT_LOOKUP_SIZE,\n sdGenericChunk,\n sdGenericImportColumns,\n sdGenericIsBlank,\n sdGenericLookupMap,\n sdGenericParseImportRow,\n sdGenericPlanUpsert,\n sdGenericPrimaryKey,\n sdGenericRelationInfo,\n sdGenericRunLimited,\n type SdGenericImportCellError,\n type SdGenericImportColumnInfo,\n type SdGenericImportOp,\n} from '../core';\nimport type { SdGenericRecord, SdGenericSchema } from '../models';\nimport { SdGenericDataService } from './generic-data.service';\n\nexport interface SdGenericImportRowResult {\n index: number;\n status: 'created' | 'updated' | 'error';\n errors: SdGenericImportCellError[];\n /** Adapter error message of a failed save. */\n message?: string;\n}\n\n/** Runs one lookup per batch, at most five at a time; the first failed batch fails the import. */\nconst lookupBatches = async <T>(values: readonly unknown[], lookup: (batch: unknown[]) => Promise<T[]>): Promise<T[]> => {\n const settled = await sdGenericRunLimited(sdGenericChunk(values, SD_GENERIC_IMPORT_LOOKUP_SIZE), SD_GENERIC_IMPORT_CONCURRENCY, lookup);\n return settled.flatMap(outcome => {\n if (outcome.status === 'rejected') throw outcome.reason;\n return outcome.value;\n });\n};\n\n/**\n * Imports spreadsheet rows (INV-014): converts cells, looks up relations and existing records in batches, then\n * creates or updates through `SdGenericDataService` (so hooks apply) with at most five saves in flight.\n */\n@Injectable()\nexport class SdGenericImportService {\n readonly #data = inject(SdGenericDataService);\n\n columns(schema: SdGenericSchema): SdGenericImportColumnInfo[] {\n return sdGenericImportColumns(schema);\n }\n\n async run(schema: SdGenericSchema, rows: readonly Record<string, unknown>[]): Promise<SdGenericImportRowResult[]> {\n const columns = this.columns(schema);\n const lookups = await this.#relationLookups(schema, columns, rows);\n const parsed = rows.map(row => sdGenericParseImportRow(row, columns, lookups));\n const results: SdGenericImportRowResult[] = parsed.map((row, index) => ({\n index,\n status: row.errors.length ? 'error' : 'created',\n errors: row.errors,\n }));\n const valid = parsed.flatMap((row, index) => (row.errors.length ? [] : [{ data: row.data, index }]));\n const data = valid.map(item => item.data);\n const upsertKey = schema.import?.upsertKey;\n const existing = upsertKey ? await this.#existing(schema, upsertKey, data) : new Map<string, unknown>();\n const ops: { op: SdGenericImportOp; index: number }[] = [];\n sdGenericPlanUpsert(data, upsertKey, existing).forEach((op, position) => {\n const { index } = valid[position];\n if (op) ops.push({ op, index });\n else\n results[index] = {\n index,\n status: 'error',\n errors: [{ key: upsertKey!, code: 'match-ambiguous', value: data[position][upsertKey!] }],\n };\n });\n const settled = await sdGenericRunLimited(ops, SD_GENERIC_IMPORT_CONCURRENCY, ({ op }) =>\n op.kind === 'create' ? this.#data.save(schema, 'create', op.data) : this.#data.save(schema, 'update', op.data, op.id)\n );\n settled.forEach((outcome, position) => {\n const { op, index } = ops[position];\n const result = results[index];\n if (outcome.status === 'fulfilled') result.status = op.kind === 'create' ? 'created' : 'updated';\n else {\n result.status = 'error';\n result.message = outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason);\n }\n });\n return results;\n }\n\n /** `property key -> cell text -> stored value` for each relation column, searched in batches. */\n async #relationLookups(\n schema: SdGenericSchema,\n columns: readonly SdGenericImportColumnInfo[],\n rows: readonly Record<string, unknown>[]\n ): Promise<Map<string, Map<string, unknown>>> {\n const lookups = new Map<string, Map<string, unknown>>();\n for (const column of columns.filter(item => item.property.dataType === 'relation')) {\n const info = sdGenericRelationInfo(column.property, schema.module);\n const matchField = column.matchField ?? info.displayField;\n const texts = [\n ...new Set(\n rows\n .map(row => row[column.key])\n .filter(value => !sdGenericIsBlank(value))\n .flatMap(value => (column.property.multiple ? String(value).split(',') : [String(value)]))\n .map(value => value.trim())\n .filter(Boolean)\n ),\n ];\n const records = await lookupBatches(texts, batch =>\n this.#data.search(info.module, info.entity, { values: batch, fields: [matchField], valueField: matchField })\n );\n lookups.set(column.key, sdGenericLookupMap(records.map(record => [String(record[matchField]), record[info.valueField]] as const)));\n }\n return lookups;\n }\n\n /** `upsert key value -> id` of the records that already exist, paging until each batch is complete. */\n async #existing(schema: SdGenericSchema, upsertKey: string, rows: readonly SdGenericRecord[]): Promise<Map<string, unknown>> {\n const values = [...new Set(rows.map(row => row[upsertKey]).filter(value => !sdGenericIsBlank(value)))];\n const primaryKey = sdGenericPrimaryKey(schema);\n const records = await lookupBatches(values, async batch => {\n const filters = [{ field: upsertKey, operator: 'IN' as const, data: batch as never }];\n const items: SdGenericRecord[] = [];\n for (let pageNumber = 0; ; pageNumber++) {\n const page = await this.#data.query(schema.module, schema.entity, { pageNumber, pageSize: batch.length, filters });\n items.push(...page.items);\n // why: a backend may cap the page size; keep reading until the reported total is reached.\n if (!page.items.length || items.length >= page.total) return items;\n }\n });\n return sdGenericLookupMap(records.map(record => [String(record[upsertKey]), String(record[primaryKey])] as const));\n }\n}\n","import { Injectable, Injector, inject } from '@angular/core';\nimport { SdPermissionService } from '@sdcorejs/angular/modules/permission';\nimport { sdGenericPermissionCode } from '../core';\nimport type { SdGenericAction, SdGenericDefaultAction } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\n\n/**\n * Permission checks of the generic screens (INV-005). Codes come from `sdGenericPermissionCode`; the default\n * permission key of the portal is used (D-029). These checks hide UI and block routes only: the backend behind\n * the adapter must enforce permissions again.\n */\n@Injectable()\nexport class SdGenericPermissionService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n // why: SdPermissionService requires SD_PERMISSION_CONFIGURATION; with `permission: false` a portal may have none,\n // so the service is only resolved when a check really runs.\n readonly #injector = inject(Injector);\n #loading: Promise<unknown> | undefined;\n\n get enabled(): boolean {\n return this.#scope.permissionEnabled();\n }\n\n can(module: string, entity: string, action: SdGenericAction): boolean {\n return !this.enabled || this.#service().hasPermission(sdGenericPermissionCode(module, entity, action));\n }\n\n /** Whether `provideSdGenericEntity({ hiddenDefaults })` hides the default action; `list` and `configuration` never are. */\n hides(module: string, entity: string, action: SdGenericAction | SdGenericDefaultAction): boolean {\n return this.#scope.entity(module, entity)?.hiddenDefaults?.includes(action as SdGenericDefaultAction) ?? false;\n }\n\n /** The one rule of a default action, shared by the screens and the route guard: not hidden, and permitted. */\n allows(module: string, entity: string, action: SdGenericAction): boolean {\n return !this.hides(module, entity, action) && this.can(module, entity, action);\n }\n\n /** A custom action without `permission` is allowed. */\n canCode(code: string | undefined): boolean {\n return !this.enabled || !code || this.#service().hasPermission(code);\n }\n\n /**\n * Loads the permission list before a route check; a failed load denies instead of throwing. Only a load in\n * flight is shared: SdPermissionService skips keys it already loaded, and its `reset()` on sign-out must make\n * the next check load the permissions of the new user.\n */\n ensureLoaded(): Promise<unknown> {\n if (!this.enabled) return Promise.resolve();\n this.#loading ??= this.#service()\n .loadPermissions()\n .catch(error => console.error(error))\n .finally(() => (this.#loading = undefined));\n return this.#loading;\n }\n\n #service(): SdPermissionService {\n return this.#injector.get(SdPermissionService);\n }\n}\n","import type { EnvironmentInjector } from '@angular/core';\nimport type { SdFormGenericCatalog } from '@sdcorejs/angular/components/form-generic';\nimport { SD_GENERIC_RELATION_CATALOG } from '../core';\nimport { SdGenericDataService } from './generic-data.service';\n\n/**\n * Holds the environment injector of a generic route. form-generic catalogs are plain objects created before any\n * injector exists, so `sdGenericRoutes()` attaches the route injector here once Angular creates it (D-022).\n */\nexport class SdGenericCatalogBridge {\n #injector: EnvironmentInjector | undefined;\n\n attach(injector: EnvironmentInjector): void {\n this.#injector = injector;\n }\n\n data(): SdGenericDataService {\n if (!this.#injector) throw new Error('SdGeneric: the relation catalog is only available inside a generic route.');\n return this.#injector.get(SdGenericDataService);\n }\n}\n\nconst param = (name: string) => ({ name, label: name, required: name === 'module' || name === 'entity' });\n\n/** The single form-generic catalog behind every relation select; params identify the relation. */\nexport const sdGenericRelationCatalog = (bridge: SdGenericCatalogBridge): SdFormGenericCatalog => ({\n id: SD_GENERIC_RELATION_CATALOG,\n label: 'Generic relation',\n params: ['module', 'entity', 'valueField', 'displayField', 'searchFields', 'display'].map(param),\n load: async params => bridge.data().relationItems(params, {}),\n search: async (term, params) => bridge.data().relationItems(params, { term }),\n labels: async (values, params) => bridge.data().relationItems(params, { values }),\n});\n","import { Injectable, inject } from '@angular/core';\nimport { sdGenericBlocksLoad, sdGenericMergeSchema, validateSdGenericSchema } from '../core';\nimport type { SdGenericAdapter, SdGenericSchema, SdGenericSchemaIssue, SdGenericSchemaStore } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\nimport { SdGenericLocalStore } from './generic-configuration-store';\n\nexport interface SdGenericResolvedSchema {\n /** Effective schema used by every screen. */\n schema: SdGenericSchema;\n /** Default configuration: the adapter schema after `provideSdGenericEntity.schema`. */\n base: SdGenericSchema;\n /** The stored configuration was rejected and the default one is in use. */\n invalid: boolean;\n issues: SdGenericSchemaIssue[];\n /** Stored property keys that the backend no longer has. */\n removed: string[];\n /** Backend property keys that the stored configuration does not know yet. */\n added: string[];\n}\n\n/**\n * Copy of a stored configuration without `list.externalFilters`. External filters are declared in code (backend\n * schema or `provideSdGenericEntity`), so a stored configuration neither carries nor contributes them (INV-004).\n * Anything that is not a configuration object is returned unchanged for the validator to report.\n */\nfunction withoutExternalFilters<T>(configuration: T): T {\n const list = (configuration as { list?: unknown } | null)?.list;\n if (!list || typeof list !== 'object' || Array.isArray(list) || !('externalFilters' in list)) return configuration;\n const rest: Record<string, unknown> = { ...list };\n delete rest['externalFilters'];\n return { ...(configuration as object), list: rest } as T;\n}\n\n/**\n * Owns the effective schema of each entity (INV-002): adapter schema -> entity schema function -> stored\n * configuration (validated, then merged). It is the only caller of `adapter.schema` and of the schema store.\n */\n@Injectable()\nexport class SdGenericSchemaService {\n readonly #scope = inject(SD_GENERIC_SCOPE);\n readonly #cache = new Map<string, Promise<SdGenericResolvedSchema>>();\n\n resolve(module: string, entity: string): Promise<SdGenericResolvedSchema> {\n const key = `${module}.${entity}`;\n let pending = this.#cache.get(key);\n if (!pending) {\n pending = this.#load(module, entity);\n // why: a failed load must not stay cached, so the next navigation retries.\n pending.catch(() => this.#cache.delete(key));\n this.#cache.set(key, pending);\n }\n return pending;\n }\n\n /** Validates, stores and drops the cached schema of the entity; returns the issues when it refuses to save. */\n async save(module: string, entity: string, schema: SdGenericSchema): Promise<SdGenericSchemaIssue[]> {\n const { base } = await this.resolve(module, entity);\n const configuration = withoutExternalFilters(schema);\n const issues = validateSdGenericSchema(configuration, base);\n if (issues.length) return issues;\n await this.#store(this.#adapter(module)).set(entity, configuration);\n this.invalidate(module, entity);\n return [];\n }\n\n invalidate(module: string, entity: string): void {\n this.#cache.delete(`${module}.${entity}`);\n }\n\n async #load(module: string, entity: string): Promise<SdGenericResolvedSchema> {\n const adapter = this.#adapter(module);\n const config = this.#scope.entity(module, entity);\n let base = await adapter.schema(entity);\n if (config?.schema) base = await config.schema(structuredClone(base));\n const stored = withoutExternalFilters(await this.#store(adapter).get(entity));\n if (stored === null || stored === undefined) return { schema: base, base, invalid: false, issues: [], removed: [], added: [] };\n const issues = validateSdGenericSchema(stored, base);\n if (issues.some(sdGenericBlocksLoad)) {\n console.warn(`SdGeneric: the stored configuration of ${module}.${entity} is invalid; the default configuration is in use.`, issues);\n return { schema: base, base, invalid: true, issues, removed: [], added: [] };\n }\n try {\n const merged = sdGenericMergeSchema(stored, base);\n return { schema: merged.schema, base, invalid: false, issues, removed: merged.removed, added: merged.added };\n } catch (error) {\n // why: a configuration the validator did not foresee must still fall back to the default one (AC-007).\n const issue: SdGenericSchemaIssue = {\n code: 'shape',\n severity: 'error',\n path: '$',\n message: `The configuration cannot be merged: ${String(error)}`,\n };\n console.warn(`SdGeneric: the stored configuration of ${module}.${entity} is invalid; the default configuration is in use.`, [issue]);\n return { schema: base, base, invalid: true, issues: [...issues, issue], removed: [], added: [] };\n }\n }\n\n #adapter(module: string): SdGenericAdapter {\n const adapter = this.#scope.adapter(module);\n if (!adapter) throw new Error(`SdGeneric: no adapter is registered for the module \"${module}\".`);\n return adapter;\n }\n\n #store(adapter: SdGenericAdapter): SdGenericSchemaStore {\n return adapter.schemaStore ?? new SdGenericLocalStore(adapter.module);\n }\n}\n","import { inject } from '@angular/core';\nimport type { ActivatedRouteSnapshot, CanActivateFn, ResolveFn } from '@angular/router';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport type { SdGenericAction } from '../models';\nimport { SD_GENERIC_SCOPE } from '../registry';\nimport { SdGenericPermissionService, SdGenericSchemaService, type SdGenericResolvedSchema } from '../services';\n\n/** Route data `generic` of the list and configuration routes. */\nexport interface SdGenericRouteData {\n module: string;\n entity: string;\n resolved: SdGenericResolvedSchema | null;\n /** Message when the schema could not be loaded (unknown module, adapter failure). */\n error: string | null;\n}\n\n/** `module`, `entity` and `id` of a generic route, read from every ancestor because nested routes do not inherit params. */\nexport const sdGenericRouteParams = (route: ActivatedRouteSnapshot): { module: string; entity: string; id: string | null } => {\n const read = (key: string) =>\n route.pathFromRoot\n .map(snapshot => snapshot.paramMap.get(key))\n .filter((value): value is string => value !== null)\n .pop() ?? null;\n return { module: read('module') ?? '', entity: read('entity') ?? '', id: read('id') };\n};\n\n/**\n * Module and entity names a route may carry: letters, digits, `_` and `-`, with single dots between parts. It\n * keeps decoded `/`, `..` and other separators away from permission codes and adapter calls.\n */\nconst NAME = /^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$/;\n\n/**\n * Blocks a generic route without its permission code (INV-005), with an unsafe module / entity name, or whose\n * action the entity hides through `hiddenDefaults`. Permissions are loaded before the check.\n */\nexport const sdGenericPermissionGuard =\n (action: SdGenericAction): CanActivateFn =>\n async route => {\n const permission = inject(SdGenericPermissionService);\n const { module, entity } = sdGenericRouteParams(route);\n if (!NAME.test(module) || !NAME.test(entity)) return false;\n // why: a hidden route is refused before the permission list is loaded.\n if (permission.hides(module, entity, action)) return false;\n await permission.ensureLoaded();\n return permission.allows(module, entity, action);\n };\n\n/** Resolves the effective schema before the page renders; a failure becomes `error` instead of a navigation error. */\nexport const sdGenericSchemaResolver: ResolveFn<SdGenericRouteData> = async route => {\n const schemas = inject(SdGenericSchemaService);\n const scope = inject(SD_GENERIC_SCOPE);\n const i18n = inject(I18nService);\n const { module, entity } = sdGenericRouteParams(route);\n if (!scope.adapter(module))\n return { module, entity, resolved: null, error: i18n.t('core.module.generic.error.adapter-missing', { module }) };\n try {\n return { module, entity, resolved: await schemas.resolve(module, entity), error: null };\n } catch (error) {\n return { module, entity, resolved: null, error: error instanceof Error ? error.message : String(error) };\n }\n};\n","import { EnvironmentInjector, inject, provideEnvironmentInitializer } from '@angular/core';\nimport type { Route, Routes } from '@angular/router';\nimport { provideSdFormGeneric } from '@sdcorejs/angular/components/form-generic';\nimport { SD_PERMISSION_PUBLIC } from '@sdcorejs/angular/modules/permission';\nimport type { SdGenericAction, SdGenericFormAction } from '../models';\nimport {\n SdGenericCatalogBridge,\n SdGenericDataService,\n SdGenericPermissionService,\n SdGenericSchemaService,\n sdGenericRelationCatalog,\n} from '../services';\nimport { sdGenericPermissionGuard, sdGenericSchemaResolver } from './generic-route.guards';\n\n/**\n * Routes of the generic module:\n * `generic/:module/:entity` (list), `create`, `:id/detail`, `:id/update` (page or side drawer over the list)\n * and `configuration`. Mount them where the adapters of the module are provided (root or the lazy route).\n *\n * @example\n * { path: 'tms', providers: [provideSdGeneric({ adapters: [TmsAdapter] })], children: sdGenericRoutes() }\n */\nexport function sdGenericRoutes(): Routes {\n const bridge = new SdGenericCatalogBridge();\n // why: a portal SdPermissionGuard denies routes without data.permission; the generic guards check the real\n // codes, which depend on :module/:entity and cannot be static route data (D-024).\n const data = (action?: SdGenericAction) => ({ permission: SD_PERMISSION_PUBLIC, ...(action ? { sdGenericAction: action } : {}) });\n const form = (action: SdGenericFormAction): Route => ({\n path: action === 'create' ? 'create' : `:id/${action}`,\n data: data(action),\n canActivate: [sdGenericPermissionGuard(action)],\n loadComponent: () => import('../pages/form/generic-form-host.page').then(m => m.GenericFormHostPage),\n });\n return [\n {\n path: 'generic/:module/:entity',\n data: data(),\n providers: [\n SdGenericSchemaService,\n SdGenericDataService,\n SdGenericPermissionService,\n provideSdFormGeneric({ catalogs: [sdGenericRelationCatalog(bridge)] }),\n provideEnvironmentInitializer(() => bridge.attach(inject(EnvironmentInjector))),\n ],\n children: [\n {\n path: 'configuration',\n data: data('configuration'),\n canActivate: [sdGenericPermissionGuard('configuration')],\n resolve: { generic: sdGenericSchemaResolver },\n loadComponent: () => import('../pages/configuration/generic-configuration.page').then(m => m.GenericConfigurationPage),\n },\n {\n path: '',\n data: data('list'),\n canActivate: [sdGenericPermissionGuard('list')],\n resolve: { generic: sdGenericSchemaResolver },\n loadComponent: () => import('../pages/list/generic-list.page').then(m => m.GenericListPage),\n children: [form('create'), form('detail'), form('update')],\n },\n ],\n },\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DEFAULT_LIMIT","STRING_FORMATS","NUMBER_FORMATS"],"mappings":";;;;;;;AAUA;MACa,oBAAoB,GAAG,IAAI,cAAc,CAAoB,sBAAsB;AAEhG;AACO,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAuC,qBAAqB,CAAC;AAClH;AACO,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAiC,qBAAqB,CAAC;AAC5G;AACO,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAA0B,8BAA8B,CAAC;AAEvH,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,MAAc,KAAK,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,MAAM,EAAE;AAE3E;;;AAGG;MACU,cAAc,CAAA;AAEd,IAAA,QAAA;AACA,I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