@dignite-ng/expand.cms 0.0.32 → 0.0.33
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/config/ng-package.json +7 -0
- package/config/src/cms-config.module.ts +12 -0
- package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
- package/config/src/enums/route-names.ts +8 -0
- package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
- package/config/src/providers/route.provider.ts +82 -0
- package/config/{public-api.d.ts → src/public-api.ts} +3 -3
- package/ng-package.json +7 -0
- package/package.json +6 -21
- package/src/lib/cms-routing.module.ts +108 -0
- package/src/lib/cms.module.ts +108 -0
- package/src/lib/components/admin/domains/domains.component.html +19 -0
- package/src/lib/components/admin/domains/domains.component.scss +0 -0
- package/src/lib/components/admin/domains/domains.component.spec.ts +21 -0
- package/src/lib/components/admin/domains/domains.component.ts +99 -0
- package/src/lib/components/admin/domains/index.ts +1 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.html +113 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +1 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +284 -0
- package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +33 -0
- package/src/lib/components/admin/entries/create.component.html +13 -0
- package/src/lib/components/admin/entries/create.component.scss +1 -0
- package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create.component.ts +104 -0
- package/src/lib/components/admin/entries/edit.component.html +9 -0
- package/src/lib/components/admin/entries/edit.component.scss +1 -0
- package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/edit.component.ts +98 -0
- package/src/lib/components/admin/entries/entries.component.html +112 -0
- package/src/lib/components/admin/entries/entries.component.scss +1 -0
- package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/entries.component.ts +219 -0
- package/src/lib/components/admin/entries/index.ts +4 -0
- package/src/lib/components/admin/fields/create-field.component.html +12 -0
- package/src/lib/components/admin/fields/create-field.component.scss +1 -0
- package/src/lib/components/admin/fields/create-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-field.component.ts +68 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.html +39 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.ts +116 -0
- package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +33 -0
- package/src/lib/components/admin/fields/edit-field.component.html +13 -0
- package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/edit-field.component.ts +100 -0
- package/src/lib/components/admin/fields/field-group.component.html +69 -0
- package/src/lib/components/admin/fields/field-group.component.scss +0 -0
- package/src/lib/components/admin/fields/field-group.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/field-group.component.ts +132 -0
- package/src/lib/components/admin/fields/fields.component.html +74 -0
- package/src/lib/components/admin/fields/fields.component.scss +1 -0
- package/src/lib/components/admin/fields/fields.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/fields.component.ts +111 -0
- package/src/lib/components/admin/fields/index.ts +6 -0
- package/src/lib/components/admin/index.ts +5 -0
- package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +36 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +79 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +191 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +1 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +408 -0
- package/src/lib/components/admin/sections/entry-types/index.ts +2 -0
- package/src/lib/components/admin/sections/index.ts +3 -0
- package/src/lib/components/admin/sections/sections.component.html +190 -0
- package/src/lib/components/admin/sections/sections.component.scss +1 -0
- package/src/lib/components/admin/sections/sections.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/sections.component.ts +370 -0
- package/src/lib/components/admin/sites/create-or-update-sites-input-base.ts +18 -0
- package/src/lib/components/admin/sites/index.ts +2 -0
- package/src/lib/components/admin/sites/sites.component.html +136 -0
- package/src/lib/components/admin/sites/sites.component.scss +1 -0
- package/src/lib/components/admin/sites/sites.component.spec.ts +21 -0
- package/src/lib/components/admin/sites/sites.component.ts +250 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.html +36 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.ts +115 -0
- package/src/lib/components/dynamic-form/entry/entry-config.ts +24 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.html +26 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.scss +1 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.ts +109 -0
- package/src/lib/components/dynamic-form/entry/index.ts +3 -0
- package/src/lib/components/dynamic-form/form-control-group.ts +27 -0
- package/src/lib/components/dynamic-form/index.ts +4 -0
- package/src/lib/components/dynamic-form/matrix/index.ts +3 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +147 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +236 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.ts +63 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +42 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +104 -0
- package/src/lib/components/dynamic-form/table/index.ts +3 -0
- package/src/lib/components/dynamic-form/table/table-config.component.html +85 -0
- package/src/lib/components/dynamic-form/table/table-config.component.scss +10 -0
- package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-config.component.ts +170 -0
- package/src/lib/components/dynamic-form/table/table-config.ts +45 -0
- package/src/lib/components/dynamic-form/table/table-control.component.html +54 -0
- package/src/lib/components/dynamic-form/table/table-control.component.scss +1 -0
- package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-control.component.ts +115 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/constants/index.ts +1 -0
- package/src/lib/constants/styles.ts +13 -0
- package/src/lib/enums/ecms-component.ts +11 -0
- package/src/lib/enums/index.ts +1 -0
- package/src/lib/proxy/README.md +17 -0
- package/src/lib/proxy/admin/domains/domain-admin.service.ts +38 -0
- package/{lib/proxy/admin/domains/models.d.ts → src/lib/proxy/admin/domains/models.ts} +9 -7
- package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +21 -0
- package/src/lib/proxy/admin/dynamic-forms/models.ts +5 -0
- package/src/lib/proxy/admin/entries/entry-admin.service.ts +109 -0
- package/src/lib/proxy/admin/entries/models.ts +68 -0
- package/src/lib/proxy/admin/fields/field-admin.service.ts +64 -0
- package/src/lib/proxy/admin/fields/field-group-admin.service.ts +56 -0
- package/{lib/proxy/admin/fields/models.d.ts → src/lib/proxy/admin/fields/models.ts} +42 -34
- package/src/lib/proxy/admin/index.ts +7 -0
- package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +55 -0
- package/{lib/proxy/admin/sections/models.d.ts → src/lib/proxy/admin/sections/models.ts} +81 -67
- package/src/lib/proxy/admin/sections/section-admin.service.ts +74 -0
- package/src/lib/proxy/admin/settings/site-settings-admin.service.ts +37 -0
- package/src/lib/proxy/dignite/abp/data/index.ts +1 -0
- package/src/lib/proxy/dignite/abp/data/models.ts +4 -0
- package/src/lib/proxy/dignite/abp/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
- package/src/lib/proxy/dignite/file-explorer/directories/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/directories/models.ts +35 -0
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +86 -0
- package/src/lib/proxy/dignite/file-explorer/files/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +58 -0
- package/src/lib/proxy/dignite/file-explorer/index.ts +3 -0
- package/src/lib/proxy/dignite/index.ts +3 -0
- package/src/lib/proxy/entries/entry-status.enum.ts +8 -0
- package/src/lib/proxy/fields/index.ts +1 -0
- package/src/lib/proxy/fields/models.ts +9 -0
- package/src/lib/proxy/generate-proxy.json +11425 -0
- package/src/lib/proxy/index.ts +9 -0
- package/src/lib/proxy/microsoft/asp-net-core/index.ts +2 -0
- package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +1 -0
- package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +12 -0
- package/src/lib/proxy/microsoft/extensions/index.ts +2 -0
- package/src/lib/proxy/microsoft/extensions/primitives/index.ts +1 -0
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +9 -0
- package/src/lib/proxy/microsoft/index.ts +4 -0
- package/src/lib/proxy/microsoft/net/http/headers/index.ts +1 -0
- package/src/lib/proxy/microsoft/net/http/headers/models.ts +7 -0
- package/src/lib/proxy/microsoft/net/http/index.ts +2 -0
- package/src/lib/proxy/microsoft/net/index.ts +2 -0
- package/src/lib/proxy/sections/models.ts +14 -0
- package/src/lib/proxy/sections/section-type.enum.ts +9 -0
- package/src/lib/proxy/settings/index.ts +1 -0
- package/src/lib/proxy/settings/models.ts +6 -0
- package/src/lib/proxy/volo/abp/content/index.ts +1 -0
- package/src/lib/proxy/volo/abp/content/models.ts +6 -0
- package/src/lib/proxy/volo/abp/index.ts +2 -0
- package/src/lib/proxy/volo/cms-kit/index.ts +2 -0
- package/src/lib/proxy/volo/cms-kit/users/index.ts +1 -0
- package/{lib/proxy/volo/cms-kit/users/models.d.ts → src/lib/proxy/volo/cms-kit/users/models.ts} +8 -7
- package/src/lib/proxy/volo/index.ts +3 -0
- package/src/lib/proxy.zip +0 -0
- package/src/lib/services/appent-content.ts +13 -0
- package/src/lib/services/cms-api.service.ts +71 -0
- package/src/lib/services/cms.service.ts +18 -0
- package/src/lib/services/field-abstracts.service.ts +40 -0
- package/src/lib/services/index.ts +4 -0
- package/src/lib/services/simple-reuse-strategy.ts +49 -0
- package/src/lib/services/update-list.service.ts +15 -0
- package/src/lib/toolbar/index.ts +2 -0
- package/src/lib/toolbar/toolbar-btn-default-action.ts +171 -0
- package/src/lib/toolbar/toolbar-config.ts +93 -0
- package/{public-api.d.ts → src/public-api.ts} +10 -4
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +34 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/config/cms-config.module.d.ts +0 -8
- package/config/enums/route-names.d.ts +0 -7
- package/config/index.d.ts +0 -5
- package/config/providers/route.provider.d.ts +0 -9
- package/esm2022/config/cms-config.module.mjs +0 -19
- package/esm2022/config/dignite-ng-expand.cms-config.mjs +0 -5
- package/esm2022/config/enums/index.mjs +0 -2
- package/esm2022/config/enums/route-names.mjs +0 -2
- package/esm2022/config/providers/index.mjs +0 -2
- package/esm2022/config/providers/route.provider.mjs +0 -78
- package/esm2022/config/public-api.mjs +0 -4
- package/esm2022/dignite-ng-expand.cms.mjs +0 -5
- package/esm2022/lib/cms-routing.module.mjs +0 -100
- package/esm2022/lib/cms.module.mjs +0 -132
- package/esm2022/lib/components/admin/domains/domains.component.mjs +0 -90
- package/esm2022/lib/components/admin/domains/index.mjs +0 -2
- package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -286
- package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -32
- package/esm2022/lib/components/admin/entries/create.component.mjs +0 -108
- package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -107
- package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -211
- package/esm2022/lib/components/admin/entries/index.mjs +0 -5
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -82
- package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -119
- package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +0 -25
- package/esm2022/lib/components/admin/fields/edit-field.component.mjs +0 -110
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -124
- package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -119
- package/esm2022/lib/components/admin/fields/index.mjs +0 -7
- package/esm2022/lib/components/admin/index.mjs +0 -6
- package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -27
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +0 -71
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +0 -416
- package/esm2022/lib/components/admin/sections/entry-types/index.mjs +0 -3
- package/esm2022/lib/components/admin/sections/index.mjs +0 -4
- package/esm2022/lib/components/admin/sections/sections.component.mjs +0 -344
- package/esm2022/lib/components/admin/sites/create-or-update-sites-input-base.mjs +0 -18
- package/esm2022/lib/components/admin/sites/index.mjs +0 -3
- package/esm2022/lib/components/admin/sites/sites.component.mjs +0 -29
- package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -124
- package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
- package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -115
- package/esm2022/lib/components/dynamic-form/entry/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/form-control-group.mjs +0 -28
- package/esm2022/lib/components/dynamic-form/index.mjs +0 -5
- package/esm2022/lib/components/dynamic-form/matrix/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +0 -227
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
- package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -111
- package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -173
- package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
- package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -121
- package/esm2022/lib/components/index.mjs +0 -3
- package/esm2022/lib/constants/styles.mjs +0 -14
- package/esm2022/lib/enums/ecms-component.mjs +0 -13
- package/esm2022/lib/enums/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/domains/domain-admin.service.mjs +0 -34
- package/esm2022/lib/proxy/admin/domains/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/domains/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -24
- package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +0 -72
- package/esm2022/lib/proxy/admin/entries/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/entries/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +0 -47
- package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -43
- package/esm2022/lib/proxy/admin/fields/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +0 -43
- package/esm2022/lib/proxy/admin/sections/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +0 -53
- package/esm2022/lib/proxy/admin/settings/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +0 -33
- package/esm2022/lib/proxy/dignite/abp/data/models.mjs +0 -2
- package/esm2022/lib/proxy/entries/entry-status.enum.mjs +0 -8
- package/esm2022/lib/proxy/entries/index.mjs +0 -2
- package/esm2022/lib/proxy/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/index.mjs +0 -3
- package/esm2022/lib/proxy/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/section-type.enum.mjs +0 -9
- package/esm2022/lib/proxy/settings/models.mjs +0 -2
- package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +0 -2
- package/esm2022/lib/services/appent-content.mjs +0 -15
- package/esm2022/lib/services/cms-api.service.mjs +0 -80
- package/esm2022/lib/services/cms.service.mjs +0 -23
- package/esm2022/lib/services/field-abstracts.service.mjs +0 -45
- package/esm2022/lib/services/index.mjs +0 -5
- package/esm2022/lib/services/simple-reuse-strategy.mjs +0 -43
- package/esm2022/lib/services/update-list.service.mjs +0 -19
- package/esm2022/lib/toolbar/index.mjs +0 -3
- package/esm2022/lib/toolbar/toolbar-btn-default-action.mjs +0 -160
- package/esm2022/lib/toolbar/toolbar-config.mjs +0 -79
- package/esm2022/public-api.mjs +0 -10
- package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -101
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
- package/fesm2022/dignite-ng-expand.cms.mjs +0 -4079
- package/fesm2022/dignite-ng-expand.cms.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/cms-routing.module.d.ts +0 -7
- package/lib/cms.module.d.ts +0 -35
- package/lib/components/admin/domains/domains.component.d.ts +0 -21
- package/lib/components/admin/domains/index.d.ts +0 -1
- package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -92
- package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +0 -23
- package/lib/components/admin/entries/create.component.d.ts +0 -40
- package/lib/components/admin/entries/edit.component.d.ts +0 -40
- package/lib/components/admin/entries/entries.component.d.ts +0 -66
- package/lib/components/admin/entries/index.d.ts +0 -4
- package/lib/components/admin/fields/create-field.component.d.ts +0 -31
- package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -36
- package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +0 -16
- package/lib/components/admin/fields/edit-field.component.d.ts +0 -40
- package/lib/components/admin/fields/field-group.component.d.ts +0 -51
- package/lib/components/admin/fields/fields.component.d.ts +0 -37
- package/lib/components/admin/fields/index.d.ts +0 -6
- package/lib/components/admin/index.d.ts +0 -5
- package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -17
- package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +0 -38
- package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +0 -132
- package/lib/components/admin/sections/entry-types/index.d.ts +0 -2
- package/lib/components/admin/sections/index.d.ts +0 -3
- package/lib/components/admin/sections/sections.component.d.ts +0 -90
- package/lib/components/admin/sites/create-or-update-sites-input-base.d.ts +0 -8
- package/lib/components/admin/sites/index.d.ts +0 -2
- package/lib/components/admin/sites/sites.component.d.ts +0 -5
- package/lib/components/dynamic-form/entry/entry-config.component.d.ts +0 -39
- package/lib/components/dynamic-form/entry/entry-config.d.ts +0 -9
- package/lib/components/dynamic-form/entry/entry-control.component.d.ts +0 -35
- package/lib/components/dynamic-form/entry/index.d.ts +0 -3
- package/lib/components/dynamic-form/form-control-group.d.ts +0 -4
- package/lib/components/dynamic-form/index.d.ts +0 -4
- package/lib/components/dynamic-form/matrix/index.d.ts +0 -3
- package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +0 -73
- package/lib/components/dynamic-form/matrix/matrix-config.d.ts +0 -24
- package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +0 -39
- package/lib/components/dynamic-form/table/index.d.ts +0 -3
- package/lib/components/dynamic-form/table/table-config.component.d.ts +0 -58
- package/lib/components/dynamic-form/table/table-config.d.ts +0 -18
- package/lib/components/dynamic-form/table/table-control.component.d.ts +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/constants/styles.d.ts +0 -2
- package/lib/enums/ecms-component.d.ts +0 -11
- package/lib/enums/index.d.ts +0 -1
- package/lib/proxy/admin/domains/domain-admin.service.d.ts +0 -13
- package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +0 -12
- package/lib/proxy/admin/dynamic-forms/models.d.ts +0 -4
- package/lib/proxy/admin/entries/entry-admin.service.d.ts +0 -22
- package/lib/proxy/admin/entries/models.d.ts +0 -60
- package/lib/proxy/admin/fields/field-admin.service.d.ts +0 -17
- package/lib/proxy/admin/fields/field-group-admin.service.d.ts +0 -16
- package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +0 -15
- package/lib/proxy/admin/sections/section-admin.service.d.ts +0 -18
- package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +0 -13
- package/lib/proxy/dignite/abp/data/models.d.ts +0 -3
- package/lib/proxy/entries/entry-status.enum.d.ts +0 -5
- package/lib/proxy/fields/models.d.ts +0 -8
- package/lib/proxy/sections/models.d.ts +0 -12
- package/lib/proxy/sections/section-type.enum.d.ts +0 -6
- package/lib/proxy/settings/models.d.ts +0 -5
- package/lib/services/appent-content.d.ts +0 -1
- package/lib/services/cms-api.service.d.ts +0 -20
- package/lib/services/cms.service.d.ts +0 -10
- package/lib/services/field-abstracts.service.d.ts +0 -20
- package/lib/services/index.d.ts +0 -4
- package/lib/services/simple-reuse-strategy.d.ts +0 -11
- package/lib/services/update-list.service.d.ts +0 -9
- package/lib/toolbar/index.d.ts +0 -2
- package/lib/toolbar/toolbar-btn-default-action.d.ts +0 -18
- package/lib/toolbar/toolbar-config.d.ts +0 -56
- /package/{lib/proxy/admin/domains/index.d.ts → src/lib/proxy/admin/domains/index.ts} +0 -0
- /package/{lib/proxy/admin/dynamic-forms/index.d.ts → src/lib/proxy/admin/dynamic-forms/index.ts} +0 -0
- /package/{lib/proxy/admin/entries/index.d.ts → src/lib/proxy/admin/entries/index.ts} +0 -0
- /package/{lib/proxy/admin/fields/index.d.ts → src/lib/proxy/admin/fields/index.ts} +0 -0
- /package/{lib/proxy/admin/sections/index.d.ts → src/lib/proxy/admin/sections/index.ts} +0 -0
- /package/{lib/proxy/admin/settings/index.d.ts → src/lib/proxy/admin/settings/index.ts} +0 -0
- /package/{lib/proxy/entries/index.d.ts → src/lib/proxy/entries/index.ts} +0 -0
- /package/{lib/proxy/sections/index.d.ts → src/lib/proxy/sections/index.ts} +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<form [formGroup]="_Entity">
|
|
2
|
+
<div formGroupName="formConfiguration">
|
|
3
|
+
<div class="mb-2">
|
|
4
|
+
<label class="form-label">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-md-3">
|
|
7
|
+
<div class="list-group">
|
|
8
|
+
<li class="list-group-item d-flex align-items-center justify-content-between"
|
|
9
|
+
aria-current="true">
|
|
10
|
+
{{'Cms::MatrixBlockType' | abpLocalization}}
|
|
11
|
+
<button class="btn btn-light btn-sm p-0" (click.stop)="addMatrixBlockType()">
|
|
12
|
+
<i class="fas fa-plus-circle p-1"></i>
|
|
13
|
+
</button>
|
|
14
|
+
</li>
|
|
15
|
+
<ng-container *ngFor="let item of MatrixBlockTypes.controls;let i =index">
|
|
16
|
+
<button type="button" (click.stop)="selectMatrixBlockChange(i)"
|
|
17
|
+
class="list-group-item d-flex align-items-center justify-content-between list-group-item-action "
|
|
18
|
+
[class.active]="i===selectMatrixBlockIndex">
|
|
19
|
+
<div>
|
|
20
|
+
<div>{{item.value.displayName}}</div>
|
|
21
|
+
<div>{{item.value.name}}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div ngbDropdown class="d-inline-block">
|
|
24
|
+
<button type="button" class="btn btn-light btn-sm" id="dropdownBasic1"
|
|
25
|
+
style="z-index: 8;" ngbDropdownToggle></button>
|
|
26
|
+
<div ngbDropdownMenu aria-labelledby="dropdownBasic1" style="z-index: 9;">
|
|
27
|
+
<button ngbDropdownItem
|
|
28
|
+
(click.stop)="EditMatrixBlock(item.value)">{{'AbpUi::Edit' | abpLocalization}}</button>
|
|
29
|
+
<button ngbDropdownItem
|
|
30
|
+
(click.stop)="DeleteMatrixBlock(i)">{{'AbpUi::Delete' | abpLocalization}}</button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</button>
|
|
34
|
+
</ng-container>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col-md-3">
|
|
38
|
+
<div class="list-group" *ngIf="MatrixBlockTypes?.controls.length>0">
|
|
39
|
+
<li class="list-group-item d-flex align-items-center justify-content-between"
|
|
40
|
+
aria-current="true">
|
|
41
|
+
{{'Cms::Fields' | abpLocalization}}
|
|
42
|
+
<button class="btn btn-light btn-sm p-0" (click.stop)="addMatrixField()">
|
|
43
|
+
<i class="fas fa-plus-circle p-1"></i>
|
|
44
|
+
</button>
|
|
45
|
+
</li>
|
|
46
|
+
<ng-container *ngFor="let item of MatrixBlockTypes.controls;let i =index">
|
|
47
|
+
<ng-container *ngIf="i === selectMatrixBlockIndex">
|
|
48
|
+
<ng-container *ngFor="let el of item.controls['fields'].controls;let fi =index">
|
|
49
|
+
<button type="button" (click.stop)="selectMatrixFieldChange(i,fi)"
|
|
50
|
+
class="list-group-item d-flex align-items-center justify-content-between list-group-item-action "
|
|
51
|
+
[class.active]="fi===selectMatrixFieldIndex">
|
|
52
|
+
<div>
|
|
53
|
+
<div>{{el.value.displayName}}</div>
|
|
54
|
+
<div>{{el.value.name}}</div>
|
|
55
|
+
</div>
|
|
56
|
+
<button type="button"
|
|
57
|
+
(click.stop)="deleteMatrixField(item.controls['fields'],fi)"
|
|
58
|
+
class="btn btn-sm btn-li">{{'AbpUi::Delete' | abpLocalization}}</button>
|
|
59
|
+
</button>
|
|
60
|
+
</ng-container>
|
|
61
|
+
</ng-container>
|
|
62
|
+
</ng-container>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="col-md-6" formArrayName="MatrixBlockTypes">
|
|
66
|
+
<ng-container *ngFor="let item of MatrixBlockTypes.controls;let i =index">
|
|
67
|
+
<div [formGroupName]="i" [hidden]="i !== selectMatrixBlockIndex">
|
|
68
|
+
<div formArrayName="fields">
|
|
69
|
+
<ng-container *ngFor="let itemf of item.controls['fields'].controls;let fi =index">
|
|
70
|
+
<div [formGroupName]="fi" [hidden]="fi !== selectMatrixFieldIndex">
|
|
71
|
+
<div class="mb-2">
|
|
72
|
+
<label class="form-label"
|
|
73
|
+
for="displayName">{{'Cms::DisplayName' | abpLocalization}}</label>
|
|
74
|
+
<input type="text" class="form-control" formControlName="displayName"
|
|
75
|
+
(blur)="MatrixFieldDisplayNameInputBlur($event)">
|
|
76
|
+
</div>
|
|
77
|
+
<div class="mb-2">
|
|
78
|
+
<label class="form-label"
|
|
79
|
+
for="name">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>
|
|
80
|
+
<input type="text" class="form-control" formControlName="name">
|
|
81
|
+
<div class="form-text">
|
|
82
|
+
{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="mb-2">
|
|
85
|
+
<label class="form-label"
|
|
86
|
+
for="description">{{'Cms::Description' | abpLocalization}}</label>
|
|
87
|
+
<input type="text" class="form-control" formControlName="description">
|
|
88
|
+
</div>
|
|
89
|
+
<div class="mb-2">
|
|
90
|
+
<label class="form-label"
|
|
91
|
+
for="formControlName">{{'Cms::FieldType' | abpLocalization}}</label>
|
|
92
|
+
<select class="form-select" formControlName="formControlName" (change)="setConfigComponent()">
|
|
93
|
+
<ng-container *ngFor="let itemC of _FieldControlGroup;let i =index">
|
|
94
|
+
<option [value]="itemC.name">{{itemC.displayName}}</option>
|
|
95
|
+
</ng-container>
|
|
96
|
+
</select>
|
|
97
|
+
</div>
|
|
98
|
+
<ng-container *ngIf="itemf.value.formControlName&&item">
|
|
99
|
+
<df-dynamic [type]="itemf.value.formControlName" [entity]="item"
|
|
100
|
+
[selected]="_selected?_selected['formConfiguration']['MatrixBlockTypes'][i]['fields'][fi]:''"></df-dynamic>
|
|
101
|
+
</ng-container>
|
|
102
|
+
</div>
|
|
103
|
+
</ng-container>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</ng-container>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<button type="submit" (abpInit)="submitclick?.nativeElement?.click()" style="display: none;"
|
|
112
|
+
#submitclick></button>
|
|
113
|
+
</div>
|
|
114
|
+
</form>
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<abp-modal [(visible)]="matrixModalOpen" [busy]="modalBusy" (visibleChange)="matrixModalVisibleChange($event)" >
|
|
119
|
+
<ng-template #abpHeader>
|
|
120
|
+
<h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>
|
|
121
|
+
</ng-template>
|
|
122
|
+
<ng-template #abpBody>
|
|
123
|
+
<ng-template #loaderRef>
|
|
124
|
+
<div class="text-center"><i class="fa fa-pulse fa-spinner" aria-hidden="true"></i></div>
|
|
125
|
+
</ng-template>
|
|
126
|
+
<ng-container *ngIf="matrixModalForm; else loaderRef">
|
|
127
|
+
<form class="sites-modal-form" #myForm="ngForm" [formGroup]="matrixModalForm"
|
|
128
|
+
(ngSubmit)="createOrEditSave()">
|
|
129
|
+
<button type="submit" #matrixModalModalSubmit style="display: none"></button>
|
|
130
|
+
<div class="mb-2">
|
|
131
|
+
<label class="form-label" for="displayName">{{'Cms::DisplayName' | abpLocalization}}</label>
|
|
132
|
+
<input type="text" class="form-control" formControlName="displayName"
|
|
133
|
+
(blur)="displayNameInputBlur($event)">
|
|
134
|
+
</div>
|
|
135
|
+
<div class="mb-2">
|
|
136
|
+
<label class="form-label" for="name">{{'Cms::Name' | abpLocalization}}</label>
|
|
137
|
+
<input type="text" class="form-control" formControlName="name">
|
|
138
|
+
</div>
|
|
139
|
+
</form>
|
|
140
|
+
</ng-container>
|
|
141
|
+
</ng-template>
|
|
142
|
+
<ng-template #abpFooter>
|
|
143
|
+
<button type="button" class="btn btn-secondary" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>
|
|
144
|
+
<abp-button iconClass="fa fa-check"
|
|
145
|
+
(click)="matrixModalModalSubmit.nativeElement.click()">{{'AbpUi::Save' | abpLocalization}}</abp-button>
|
|
146
|
+
</ng-template>
|
|
147
|
+
</abp-modal>
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MatrixConfigComponent } from './matrix-config.component';
|
|
4
|
+
|
|
5
|
+
describe('MatrixConfigComponent', () => {
|
|
6
|
+
let component: MatrixConfigComponent;
|
|
7
|
+
let fixture: ComponentFixture<MatrixConfigComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [MatrixConfigComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(MatrixConfigComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { Component, ElementRef, Input, ViewChild, } from '@angular/core';
|
|
2
|
+
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
|
+
import { MatrixConfig, MatrixItemConfig } from './matrix-config';
|
|
4
|
+
import { CmsApiService, FieldAbstractsService } from '../../../services';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'df-matrix-config',
|
|
8
|
+
templateUrl: './matrix-config.component.html',
|
|
9
|
+
styleUrls: ['./matrix-config.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class MatrixConfigComponent {
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
private fb: FormBuilder,
|
|
15
|
+
private _CmsApiService: CmsApiService,
|
|
16
|
+
private _FieldAbstractsService: FieldAbstractsService,
|
|
17
|
+
) { }
|
|
18
|
+
|
|
19
|
+
/**表单控件组 */
|
|
20
|
+
_FieldControlGroup: any[]
|
|
21
|
+
/**表单控件类型 */
|
|
22
|
+
_type: any
|
|
23
|
+
@Input()
|
|
24
|
+
public set type(v: any) {
|
|
25
|
+
this._type = v
|
|
26
|
+
this.dataLoaded()
|
|
27
|
+
}
|
|
28
|
+
/**表单实体 */
|
|
29
|
+
_Entity: FormGroup | undefined
|
|
30
|
+
@Input()
|
|
31
|
+
public set Entity(v: FormGroup) {
|
|
32
|
+
this._Entity = v;
|
|
33
|
+
this.dataLoaded()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**选择的表单信息 */
|
|
38
|
+
_selected: any
|
|
39
|
+
@Input()
|
|
40
|
+
public set selected(v: any) {
|
|
41
|
+
|
|
42
|
+
if (v) {
|
|
43
|
+
this._selected = v
|
|
44
|
+
this.dataLoaded()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
50
|
+
|
|
51
|
+
async dataLoaded() {
|
|
52
|
+
if (this._Entity && this._type) {
|
|
53
|
+
await this.AfterInit()
|
|
54
|
+
this.submitclick.nativeElement.click();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
AfterInit() {
|
|
59
|
+
return new Promise(async (resolve, rejects) => {
|
|
60
|
+
this._FieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type)
|
|
61
|
+
this._Entity.setControl('formConfiguration', this.fb.group(new MatrixConfig()))
|
|
62
|
+
await this.setSelectValue()
|
|
63
|
+
this.formConfiguration.patchValue(this._selected.formConfiguration)
|
|
64
|
+
resolve(true)
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
setSelectValue() {
|
|
70
|
+
return new Promise((resolve, rejects) => {
|
|
71
|
+
if (this._selected && this._selected.formControlName == this._type) {
|
|
72
|
+
this._selected.formConfiguration['MatrixBlockTypes'].forEach(((el, index) => {
|
|
73
|
+
this.addMatrixBlockTypeItem(el)
|
|
74
|
+
el.fields.forEach((elf, indexf) => {
|
|
75
|
+
this.addMatrixFieldItem(elf, index)
|
|
76
|
+
})
|
|
77
|
+
}))
|
|
78
|
+
resolve(true)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**获取表单配置 */
|
|
85
|
+
get formConfiguration() {
|
|
86
|
+
return this._Entity.get('formConfiguration') as FormGroup
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**获取表单配置下的矩阵块表单数组 */
|
|
90
|
+
get MatrixBlockTypes() {
|
|
91
|
+
return this.formConfiguration.controls['MatrixBlockTypes'] as FormArray
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**模态框-状态 */
|
|
96
|
+
matrixModalOpen: boolean = false
|
|
97
|
+
/**模态框-是否正在编辑 */
|
|
98
|
+
isMatrixModalEdit: any = false
|
|
99
|
+
|
|
100
|
+
/**模态框-用于确定模态的繁忙状态是否为真 */
|
|
101
|
+
modalBusy: boolean = false
|
|
102
|
+
|
|
103
|
+
/**模态框-表单 */
|
|
104
|
+
matrixModalForm: FormGroup | undefined;
|
|
105
|
+
|
|
106
|
+
/**表单控件模板-用于在form外提交submit */
|
|
107
|
+
@ViewChild('matrixModalModalSubmit', { static: false }) matrixModalModalSubmit: ElementRef;
|
|
108
|
+
|
|
109
|
+
/**矩阵块-选择的下标 */
|
|
110
|
+
selectMatrixBlockIndex: any = 0
|
|
111
|
+
|
|
112
|
+
/**矩阵块-选择的矩阵下字段的下标 */
|
|
113
|
+
selectMatrixFieldIndex: any = 0
|
|
114
|
+
|
|
115
|
+
/**模态框-状态改变 */
|
|
116
|
+
matrixModalVisibleChange(event) {
|
|
117
|
+
if (!event) {
|
|
118
|
+
this.isMatrixModalEdit = false
|
|
119
|
+
this.matrixModalForm = undefined
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/**矩阵块--新增-打开模态框 */
|
|
126
|
+
addMatrixBlockType() {
|
|
127
|
+
this.matrixModalForm = this.fb.group(new MatrixItemConfig())
|
|
128
|
+
this.matrixModalOpen = true
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/**模态框--矩阵表单保存提交 */
|
|
134
|
+
createOrEditSave() {
|
|
135
|
+
let input = this.matrixModalForm.value
|
|
136
|
+
if (!this.matrixModalForm.valid) return
|
|
137
|
+
if (this.isMatrixModalEdit) {
|
|
138
|
+
let MatrixBlockTypesItem = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex) as FormGroup
|
|
139
|
+
MatrixBlockTypesItem.patchValue({
|
|
140
|
+
...input
|
|
141
|
+
})
|
|
142
|
+
} else {
|
|
143
|
+
this.addMatrixBlockTypeItem(input)
|
|
144
|
+
}
|
|
145
|
+
this.matrixModalOpen = false
|
|
146
|
+
}
|
|
147
|
+
/**新增矩阵块-向数组表单中增加项 */
|
|
148
|
+
addMatrixBlockTypeItem(input) {
|
|
149
|
+
this.MatrixBlockTypes.push(new FormGroup({
|
|
150
|
+
displayName: new FormControl(input.displayName, Validators.required),
|
|
151
|
+
name: new FormControl(input.name, Validators.required),
|
|
152
|
+
fields: new FormArray([])
|
|
153
|
+
}))
|
|
154
|
+
}
|
|
155
|
+
/**编辑矩阵块 */
|
|
156
|
+
EditMatrixBlock(input) {
|
|
157
|
+
this.matrixModalForm = this.fb.group(new MatrixItemConfig())
|
|
158
|
+
this.matrixModalForm.patchValue({
|
|
159
|
+
...input
|
|
160
|
+
})
|
|
161
|
+
this.matrixModalOpen = true
|
|
162
|
+
this.isMatrixModalEdit = true
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**删除矩阵块 */
|
|
166
|
+
DeleteMatrixBlock(index) {
|
|
167
|
+
this.MatrixBlockTypes.removeAt(index)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**矩阵块-选择 */
|
|
171
|
+
selectMatrixBlockChange(index) {
|
|
172
|
+
this.selectMatrixBlockIndex = index
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**矩阵字段-新增 */
|
|
176
|
+
addMatrixField() {
|
|
177
|
+
this.addMatrixFieldItem('', this.selectMatrixBlockIndex)
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
/**矩阵字段-新增矩阵字段项 */
|
|
181
|
+
addMatrixFieldItem(input: any = '', selectMatrixBlockIndex) {
|
|
182
|
+
/**矩阵下标的矩阵项Form */
|
|
183
|
+
let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(selectMatrixBlockIndex) as FormGroup
|
|
184
|
+
let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields') as FormArray
|
|
185
|
+
MatrixFieldItemForm.push(this.fb.group({
|
|
186
|
+
/**字段名称 Display name of this field */
|
|
187
|
+
displayName: [input.displayName, [Validators.required]],
|
|
188
|
+
/**字段唯一名称 Unique Name*/
|
|
189
|
+
name: [input.name, [Validators.required]],
|
|
190
|
+
/**描述 说明 */
|
|
191
|
+
description: [input.description, []],
|
|
192
|
+
/**FieldType字段类型 表单控件名称 */
|
|
193
|
+
formControlName: [input.formControlName || 'TextEdit', [Validators.required]],
|
|
194
|
+
//动态表单配置
|
|
195
|
+
formConfiguration: new FormGroup({}),
|
|
196
|
+
}))
|
|
197
|
+
//
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**删除矩阵字段项 */
|
|
201
|
+
deleteMatrixField(MatrixFieldForm, index) {
|
|
202
|
+
MatrixFieldForm.removeAt(index)
|
|
203
|
+
this.selectMatrixFieldIndex = 0
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**矩阵字段-选择 */
|
|
207
|
+
selectMatrixFieldChange(MatrixBlockIndex, MatrixFieldIndex) {
|
|
208
|
+
this.selectMatrixFieldIndex = MatrixFieldIndex
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
get nameInput() {
|
|
212
|
+
return this.matrixModalForm?.get('name')
|
|
213
|
+
}
|
|
214
|
+
get FieldnameInput() {
|
|
215
|
+
let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex) as FormGroup
|
|
216
|
+
let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields') as FormArray
|
|
217
|
+
return MatrixFieldItemForm.at(this.selectMatrixFieldIndex).get('name')
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**矩阵displayNameInput字段失去焦点 */
|
|
221
|
+
displayNameInputBlur(event) {
|
|
222
|
+
let value = event.target.value
|
|
223
|
+
let pinyin = this._CmsApiService.chineseToPinyin(value)
|
|
224
|
+
let nameInput = this.nameInput
|
|
225
|
+
if (nameInput.value) return
|
|
226
|
+
nameInput.patchValue(pinyin)
|
|
227
|
+
}
|
|
228
|
+
/**矩阵displayNameInput字段失去焦点 */
|
|
229
|
+
MatrixFieldDisplayNameInputBlur(event) {
|
|
230
|
+
let value = event.target.value
|
|
231
|
+
let pinyin = this._CmsApiService.chineseToPinyin(value)
|
|
232
|
+
let FieldnameInput = this.FieldnameInput
|
|
233
|
+
if (FieldnameInput.value) return
|
|
234
|
+
FieldnameInput.patchValue(pinyin)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FormArray, FormControl, FormGroup, Validators } from "@angular/forms";
|
|
2
|
+
|
|
3
|
+
export class MatrixConfig {
|
|
4
|
+
// 矩阵类型
|
|
5
|
+
'MatrixBlockTypes': any = new FormArray([])
|
|
6
|
+
|
|
7
|
+
constructor(data?: MatrixConfig) {
|
|
8
|
+
if (data) {
|
|
9
|
+
for (const key in data) {
|
|
10
|
+
if (data.hasOwnProperty(key)) {
|
|
11
|
+
this[key] = data[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class MatrixItemConfig {
|
|
18
|
+
|
|
19
|
+
displayName: any = ['', [Validators.required]];
|
|
20
|
+
/**字段名字 */
|
|
21
|
+
name: any = ['', [Validators.required]];
|
|
22
|
+
|
|
23
|
+
constructor(data?: MatrixConfig) {
|
|
24
|
+
if (data) {
|
|
25
|
+
for (const key in data) {
|
|
26
|
+
if (data.hasOwnProperty(key)) {
|
|
27
|
+
this[key] = data[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export class matrixFieldInputBase {
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/**字段名称 Display name of this field */
|
|
42
|
+
displayName: any = ['', [Validators.required]];
|
|
43
|
+
/**字段唯一名称 Unique Name*/
|
|
44
|
+
name: any = ['', [Validators.required]];
|
|
45
|
+
/**描述 说明 */
|
|
46
|
+
description: any = ['', []];
|
|
47
|
+
/**FieldType字段类型 表单控件名称 */
|
|
48
|
+
formControlName: any = ['TextEdit', [Validators.required]];
|
|
49
|
+
/**动态表单配置 */
|
|
50
|
+
formConfiguration: FormGroup | undefined = new FormGroup({})
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
constructor(data?: matrixFieldInputBase) {
|
|
54
|
+
if (data) {
|
|
55
|
+
for (const key in data) {
|
|
56
|
+
if (data.hasOwnProperty(key)) {
|
|
57
|
+
this[key] = data[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<form [formGroup]="_entity">
|
|
2
|
+
<div formGroupName="extraProperties">
|
|
3
|
+
<div class="mb-2">
|
|
4
|
+
<label class="form-label" *ngIf="_fields.displayName">{{ _fields.displayName }}</label>
|
|
5
|
+
<div [formArrayName]="_fields.field.name">
|
|
6
|
+
<ng-container *ngFor="let item of fieldNameControl.controls;let i=index">
|
|
7
|
+
<div class="card mb-3 border " [formGroupName]="i">
|
|
8
|
+
<div class="card-header d-flex align-items-center justify-content-between border-bottom pt-1">
|
|
9
|
+
<div>{{item.value.displayName}}</div>
|
|
10
|
+
<button class="btn btn-sm btn-light p-0" (click.stop)="deleteMatrixControl(i)"><i
|
|
11
|
+
class="fas fa-trash p-2"></i></button>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="card-body">
|
|
14
|
+
<ng-container *ngFor="let el of MatrixBlockTypesList;let il =index">
|
|
15
|
+
<ng-container *ngIf="el.name===item.value.matrixBlockTypeName">
|
|
16
|
+
<ng-container *ngFor="let elf of el.fields; let fi=index">
|
|
17
|
+
<ng-container>
|
|
18
|
+
<df-dynamic [entity]="item"
|
|
19
|
+
[fields]="{ field: elf,displayName:elf.displayName }"
|
|
20
|
+
[selected]="_selected ? _selected[i][_parentFiledName][elf.name]: ''"
|
|
21
|
+
[parentFiledName]="'extraProperties'" [culture]="_culture"></df-dynamic>
|
|
22
|
+
</ng-container>
|
|
23
|
+
</ng-container>
|
|
24
|
+
</ng-container>
|
|
25
|
+
</ng-container>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</ng-container>
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<div class="btn-group" role="group" aria-label="Basic example">
|
|
32
|
+
<ng-container *ngFor="let item of MatrixBlockTypesList;let i =index">
|
|
33
|
+
<button type="button" class="btn btn-primary btn-sm" (click.stop)="addMatrixControl(item)"><i
|
|
34
|
+
class="fas fa-plus me-1"></i>{{item.displayName}}</button>
|
|
35
|
+
</ng-container>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="form-text" *ngIf="_fields.field.description">{{_fields.field.description}}</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<button type="submit" style="display: none" #submitclick></button>
|
|
42
|
+
</form>
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MatrixControlComponent } from './matrix-control.component';
|
|
4
|
+
|
|
5
|
+
describe('MatrixControlComponent', () => {
|
|
6
|
+
let component: MatrixControlComponent;
|
|
7
|
+
let fixture: ComponentFixture<MatrixControlComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [MatrixControlComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(MatrixControlComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
|
|
2
|
+
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'df-matrix-control',
|
|
6
|
+
templateUrl: './matrix-control.component.html',
|
|
7
|
+
styleUrls: ['./matrix-control.component.scss']
|
|
8
|
+
})
|
|
9
|
+
export class MatrixControlComponent {
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
private fb: FormBuilder,
|
|
13
|
+
) {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**表单实体 */
|
|
18
|
+
_entity: FormGroup | undefined
|
|
19
|
+
@Input()
|
|
20
|
+
public set entity(v: any) {
|
|
21
|
+
this._entity = v;
|
|
22
|
+
this.dataLoaded()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**字段配置列表 */
|
|
26
|
+
_fields: any = ''
|
|
27
|
+
@Input()
|
|
28
|
+
public set fields(v: any) {
|
|
29
|
+
this._fields = v;
|
|
30
|
+
this.dataLoaded()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
34
|
+
_parentFiledName: any
|
|
35
|
+
@Input()
|
|
36
|
+
public set parentFiledName(v: any) {
|
|
37
|
+
this._parentFiledName = v;
|
|
38
|
+
this.dataLoaded()
|
|
39
|
+
}
|
|
40
|
+
/**父级字段名称,用于为表单设置控件赋值 */
|
|
41
|
+
_selected: any
|
|
42
|
+
@Input()
|
|
43
|
+
public set selected(v: any) {
|
|
44
|
+
this._selected = v;
|
|
45
|
+
if (v) { this.dataLoaded() }
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
/**语言 */
|
|
49
|
+
_culture: any
|
|
50
|
+
@Input()
|
|
51
|
+
public set culture(v: any) {
|
|
52
|
+
this._culture = v;
|
|
53
|
+
}
|
|
54
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
55
|
+
|
|
56
|
+
/** 获取父级字段代表的表单组*/
|
|
57
|
+
extraProperties: FormGroup | undefined
|
|
58
|
+
|
|
59
|
+
/**数据加载完成 */
|
|
60
|
+
async dataLoaded() {
|
|
61
|
+
if (this._fields && this._entity && this._parentFiledName) {
|
|
62
|
+
this.extraProperties = this._entity.get(this._parentFiledName) as FormGroup
|
|
63
|
+
await this.AfterInit()
|
|
64
|
+
this.submitclick.nativeElement.click();
|
|
65
|
+
if (this._selected) this.fieldNameControl.patchValue(this._selected);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
formConfiguration: any
|
|
70
|
+
/**获取表格字段代表的控件 */
|
|
71
|
+
fieldNameControl: FormArray | undefined
|
|
72
|
+
|
|
73
|
+
AfterInit() {
|
|
74
|
+
return new Promise((resolve, rejects) => {
|
|
75
|
+
let formConfiguration = this._fields.field.formConfiguration
|
|
76
|
+
let newArrayGroup = this.fb.array([])
|
|
77
|
+
this.extraProperties.setControl(this._fields.field.name, newArrayGroup)
|
|
78
|
+
this.fieldNameControl = this.extraProperties.get(this._fields.field.name) as FormArray
|
|
79
|
+
if (this._selected) {
|
|
80
|
+
this._selected.forEach(el => {
|
|
81
|
+
this.addMatrixControl(formConfiguration.MatrixBlockTypes.find(item => item.name == el.matrixBlockTypeName))
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
this.MatrixBlockTypesList = formConfiguration.MatrixBlockTypes
|
|
85
|
+
resolve(true)
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**矩阵列表 */
|
|
90
|
+
MatrixBlockTypesList: any[] = []
|
|
91
|
+
|
|
92
|
+
/**增加指定矩阵控件项 */
|
|
93
|
+
addMatrixControl(item) {
|
|
94
|
+
this.fieldNameControl.push(this.fb.group({
|
|
95
|
+
extraProperties: new FormGroup({}),
|
|
96
|
+
matrixBlockTypeName: [item.name],
|
|
97
|
+
displayName: [item.displayName]
|
|
98
|
+
}))
|
|
99
|
+
}
|
|
100
|
+
/**删除矩阵控件 */
|
|
101
|
+
deleteMatrixControl(index) {
|
|
102
|
+
this.fieldNameControl.removeAt(index)
|
|
103
|
+
}
|
|
104
|
+
}
|