@dignite-ng/expand.cms 0.0.58 → 2.0.0-rc.10
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 +6 -0
- package/config/src/cms-config.module.ts +13 -0
- package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
- package/config/src/enums/route-names.ts +7 -0
- package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
- package/config/src/providers/route.provider.ts +68 -0
- package/config/{public-api.d.ts → src/public-api.ts} +3 -3
- package/ng-package.json +10 -0
- package/package.json +7 -22
- package/src/lib/cms-routing.module.ts +102 -0
- package/src/lib/cms.module.ts +113 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.html +137 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +0 -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 +216 -0
- package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +26 -0
- package/src/lib/components/admin/entries/create.component.html +16 -0
- package/src/lib/components/admin/entries/create.component.scss +0 -0
- package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create.component.ts +130 -0
- package/src/lib/components/admin/entries/edit.component.html +9 -0
- package/src/lib/components/admin/entries/edit.component.scss +0 -0
- package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/edit.component.ts +134 -0
- package/src/lib/components/admin/entries/entries.component.html +225 -0
- package/src/lib/components/admin/entries/entries.component.scss +109 -0
- package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/entries.component.ts +394 -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 +85 -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 +140 -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 +14 -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 +112 -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 +151 -0
- package/src/lib/components/admin/fields/fields.component.html +25 -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 +109 -0
- package/src/lib/components/admin/fields/index.ts +6 -0
- package/src/lib/components/admin/index.ts +3 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.html +81 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.scss +0 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.spec.ts +23 -0
- package/src/lib/components/admin/sections/create-or-edit-sections-modal.component.ts +239 -0
- package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +23 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +52 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +195 -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 +442 -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 +189 -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 +136 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.html +26 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.scss +27 -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 +119 -0
- package/src/lib/components/dynamic-form/entry/entry-config.ts +22 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.html +25 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.scss +35 -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 +111 -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 +148 -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 +244 -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 +118 -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 +177 -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 +127 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/constants/index.ts +1 -0
- package/src/lib/constants/styles.ts +18 -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/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 +3 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/index.ts +2 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/models.ts +10 -0
- package/src/lib/proxy/dignite/abp/regionalization-management/regionalization.service.ts +29 -0
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +20 -0
- package/src/lib/proxy/dignite/cms/admin/dynamic-forms/models.ts +6 -0
- package/src/lib/proxy/dignite/cms/admin/entries/entry-admin.service.ts +109 -0
- package/src/lib/proxy/dignite/cms/admin/entries/models.ts +69 -0
- package/src/lib/proxy/dignite/cms/admin/fields/field-admin.service.ts +64 -0
- package/src/lib/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +56 -0
- package/src/lib/proxy/dignite/cms/admin/fields/models.ts +42 -0
- package/src/lib/proxy/dignite/cms/admin/index.ts +5 -0
- package/src/lib/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +55 -0
- package/{lib/proxy/admin/sections/models.d.ts → src/lib/proxy/dignite/cms/admin/sections/models.ts} +82 -67
- package/src/lib/proxy/dignite/cms/admin/sections/section-admin.service.ts +74 -0
- package/src/lib/proxy/dignite/cms/entries/entry-status.enum.ts +8 -0
- package/src/lib/proxy/dignite/cms/fields/index.ts +1 -0
- package/src/lib/proxy/dignite/cms/fields/models.ts +9 -0
- package/src/lib/proxy/dignite/cms/index.ts +5 -0
- package/src/lib/proxy/dignite/cms/sections/models.ts +15 -0
- package/src/lib/proxy/dignite/cms/sections/section-type.enum.ts +9 -0
- package/src/lib/proxy/dignite/index.ts +3 -0
- package/src/lib/proxy/generate-proxy.json +54593 -0
- package/src/lib/proxy/index.ts +3 -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 +2 -0
- package/src/lib/resolvers/extensions-props-action-token.resolver.ts +182 -0
- package/src/lib/resolvers/page-default-toolbar-actions.ts +173 -0
- package/src/lib/resolvers/table-default-entity-actions.ts +29 -0
- package/src/lib/resolvers/table-default-entity-props.ts +62 -0
- package/src/lib/services/appent-content.ts +13 -0
- package/src/lib/services/cms-api.service.ts +90 -0
- package/src/lib/services/cms.service.ts +18 -0
- package/src/lib/services/field-abstracts.service.ts +39 -0
- package/src/lib/services/index.ts +3 -0
- package/src/lib/services/validator.ts +10 -0
- package/src/public-api.ts +7 -0
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +16 -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/components/domains/domains.component.d.ts +0 -31
- package/config/components/site-language/site-language.component.d.ts +0 -30
- package/config/enums/route-names.d.ts +0 -8
- package/config/index.d.ts +0 -5
- package/config/providers/route.provider.d.ts +0 -9
- package/config/proxy/admin/domains/domain-admin.service.d.ts +0 -13
- package/config/proxy/admin/domains/index.d.ts +0 -2
- package/config/proxy/admin/domains/models.d.ts +0 -7
- package/config/proxy/dignite/cms/admin/sites/index.d.ts +0 -2
- package/config/proxy/dignite/cms/admin/sites/models.d.ts +0 -4
- package/config/proxy/dignite/cms/admin/sites/site-admin.service.d.ts +0 -13
- package/config/proxy/dignite/cms/sites/models.d.ts +0 -4
- package/esm2022/config/cms-config.module.mjs +0 -18
- package/esm2022/config/components/domains/domains.component.mjs +0 -118
- package/esm2022/config/components/site-language/site-language.component.mjs +0 -113
- 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 -10
- package/esm2022/config/providers/index.mjs +0 -2
- package/esm2022/config/providers/route.provider.mjs +0 -74
- package/esm2022/config/proxy/admin/domains/domain-admin.service.mjs +0 -32
- package/esm2022/config/proxy/admin/domains/index.mjs +0 -3
- package/esm2022/config/proxy/admin/domains/models.mjs +0 -2
- package/esm2022/config/proxy/dignite/cms/admin/sites/index.mjs +0 -3
- package/esm2022/config/proxy/dignite/cms/admin/sites/models.mjs +0 -2
- package/esm2022/config/proxy/dignite/cms/admin/sites/site-admin.service.mjs +0 -27
- package/esm2022/config/proxy/dignite/cms/sites/models.mjs +0 -2
- 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 -94
- package/esm2022/lib/cms.module.mjs +0 -139
- package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -226
- package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -25
- package/esm2022/lib/components/admin/entries/create.component.mjs +0 -136
- package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -138
- package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -203
- package/esm2022/lib/components/admin/entries/index.mjs +0 -5
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -87
- package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -120
- 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 -109
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -131
- package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -108
- package/esm2022/lib/components/admin/fields/index.mjs +0 -7
- package/esm2022/lib/components/admin/index.mjs +0 -4
- package/esm2022/lib/components/admin/sections/create-or-edit-sections-modal.component.mjs +0 -210
- package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -22
- 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 -404
- 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 -138
- package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -114
- package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
- package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -101
- 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 -212
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
- package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -94
- package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -151
- package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
- package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -105
- package/esm2022/lib/components/index.mjs +0 -3
- package/esm2022/lib/constants/styles.mjs +0 -19
- package/esm2022/lib/enums/ecms-component.mjs +0 -13
- package/esm2022/lib/enums/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -22
- 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 -70
- 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 -45
- package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -41
- 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 -41
- 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 -51
- package/esm2022/lib/proxy/admin/settings/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +0 -31
- 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/resolvers/extensions-props-action-token.resolver.mjs +0 -136
- package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +0 -160
- package/esm2022/lib/resolvers/table-default-entity-actions.mjs +0 -49
- package/esm2022/lib/resolvers/table-default-entity-props.mjs +0 -53
- package/esm2022/lib/services/appent-content.mjs +0 -15
- package/esm2022/lib/services/cms-api.service.mjs +0 -70
- package/esm2022/lib/services/cms.service.mjs +0 -21
- package/esm2022/lib/services/field-abstracts.service.mjs +0 -42
- package/esm2022/lib/services/index.mjs +0 -4
- package/esm2022/public-api.mjs +0 -6
- package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -371
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
- package/fesm2022/dignite-ng-expand.cms.mjs +0 -3886
- 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 -37
- package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -63
- 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 -50
- package/lib/components/admin/entries/edit.component.d.ts +0 -53
- package/lib/components/admin/entries/entries.component.d.ts +0 -67
- package/lib/components/admin/entries/index.d.ts +0 -4
- package/lib/components/admin/fields/create-field.component.d.ts +0 -37
- package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -38
- 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 -46
- package/lib/components/admin/fields/field-group.component.d.ts +0 -58
- package/lib/components/admin/fields/fields.component.d.ts +0 -35
- package/lib/components/admin/fields/index.d.ts +0 -6
- package/lib/components/admin/index.d.ts +0 -3
- package/lib/components/admin/sections/create-or-edit-sections-modal.component.d.ts +0 -49
- package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -20
- 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 -139
- 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 -46
- 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/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/fields/models.d.ts +0 -34
- 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/index.d.ts +0 -1
- 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/resolvers/extensions-props-action-token.resolver.d.ts +0 -75
- package/lib/resolvers/page-default-toolbar-actions.d.ts +0 -18
- package/lib/resolvers/table-default-entity-actions.d.ts +0 -5
- package/lib/resolvers/table-default-entity-props.d.ts +0 -5
- package/lib/services/appent-content.d.ts +0 -1
- package/lib/services/cms-api.service.d.ts +0 -16
- 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 -3
- package/public-api.d.ts +0 -2
- /package/{lib/proxy/admin/dynamic-forms/index.d.ts → src/lib/proxy/dignite/cms/admin/dynamic-forms/index.ts} +0 -0
- /package/{lib/proxy/admin/entries/index.d.ts → src/lib/proxy/dignite/cms/admin/entries/index.ts} +0 -0
- /package/{lib/proxy/admin/fields/index.d.ts → src/lib/proxy/dignite/cms/admin/fields/index.ts} +0 -0
- /package/{lib/proxy/admin/sections/index.d.ts → src/lib/proxy/dignite/cms/admin/sections/index.ts} +0 -0
- /package/{lib/proxy/entries/index.d.ts → src/lib/proxy/dignite/cms/entries/index.ts} +0 -0
- /package/{lib/proxy/sections/index.d.ts → src/lib/proxy/dignite/cms/sections/index.ts} +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<form class="row g-3 needs-validation" [formGroup]="newEntity" (keydown.enter)="$event.preventDefault()" [class]="{'was-validated':formValidation}" (submit)="save()">
|
|
2
|
+
<abp-page [title]="entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)"
|
|
3
|
+
[toolbar]="true">
|
|
4
|
+
<div class="create-or-edit-entry-type-page">
|
|
5
|
+
<div class="card">
|
|
6
|
+
<button type="submit" style="display: none;" #submitclick></button>
|
|
7
|
+
<div class="card-body">
|
|
8
|
+
<div class="">
|
|
9
|
+
<div class="mb-3">
|
|
10
|
+
<label class="form-label">{{'Cms::DisplayName' | abpLocalization}}</label>
|
|
11
|
+
<input type="text" class="form-control" formControlName="displayName"
|
|
12
|
+
(blur)="disPlayNameInputBlur($event)" placeholder="" />
|
|
13
|
+
</div>
|
|
14
|
+
<div class="mb-3">
|
|
15
|
+
<label class="form-label">{{'Cms::Name' | abpLocalization}}</label>
|
|
16
|
+
<input type="text" class="form-control" formControlName="name" placeholder="" />
|
|
17
|
+
</div>
|
|
18
|
+
<div formArrayName="fieldTabs">
|
|
19
|
+
<div class="mb-3">
|
|
20
|
+
<label class="form-label">{{'Cms::FieldLayout' | abpLocalization}}</label>
|
|
21
|
+
<div class="container">
|
|
22
|
+
<div class="row">
|
|
23
|
+
<div class="col-sm-8">
|
|
24
|
+
<ul ngbNav #nav="ngbNav" [(activeId)]="navActive" class="nav nav-tabs">
|
|
25
|
+
<ng-container *ngFor="let item of resultSource; let i = index">
|
|
26
|
+
<li [ngbNavItem]="i">
|
|
27
|
+
<button type="button" ngbDropdown ngbNavLink>
|
|
28
|
+
{{ item.name }}
|
|
29
|
+
<span class="ms-1" (click.stop)="$event.stopPropagation()"
|
|
30
|
+
ngbDropdownToggle></span>
|
|
31
|
+
<div ngbDropdownMenu style="z-index: 999;">
|
|
32
|
+
<li ngbDropdownItem type="button"
|
|
33
|
+
(click.stop)="editFieldTabs(item,i)">
|
|
34
|
+
<i class="fas fa-edit"></i>
|
|
35
|
+
{{'AbpUi::Edit' | abpLocalization}}
|
|
36
|
+
</li>
|
|
37
|
+
<li ngbDropdownItem *ngIf="resultSource.length !== 1" type="button"
|
|
38
|
+
(click.stop)="deleteFieldTabs(i)">
|
|
39
|
+
<i class="fas fa-trash"></i>
|
|
40
|
+
{{'AbpUi::Delete' | abpLocalization}}
|
|
41
|
+
</li>
|
|
42
|
+
</div>
|
|
43
|
+
</button>
|
|
44
|
+
<ng-template ngbNavContent>
|
|
45
|
+
<div class="p-2" ondragover="event.preventDefault();"
|
|
46
|
+
(drop)="dragToResultSourceDropped(item,i)" style="height: 100%;">
|
|
47
|
+
<p class="form-text text-muted" *ngIf="item.fields.length === 0">
|
|
48
|
+
{{'Cms::DragAndDropFieldTips' | abpLocalization}}
|
|
49
|
+
</p>
|
|
50
|
+
<ul class="list-group" style="height: 100%;">
|
|
51
|
+
<ng-container *ngFor="let el of item.fields; let iel = index">
|
|
52
|
+
<li draggable="true" (dragstart)="fromResultSourceDragStart(el)"
|
|
53
|
+
(drop)="dragToResultSourceItemDropped(iel)"
|
|
54
|
+
class="list-group-item d-flex align-items-center justify-content-between py-1"
|
|
55
|
+
style="position: unset;">
|
|
56
|
+
{{ el.displayName }}
|
|
57
|
+
<button class="p-0 btn btn-sm btn-light"
|
|
58
|
+
(click.stop)="EditFieldModalOpen(el,iel)"
|
|
59
|
+
type="button"><i class="fas fa-wrench p-sm-1"
|
|
60
|
+
role="button"></i></button>
|
|
61
|
+
</li>
|
|
62
|
+
</ng-container>
|
|
63
|
+
</ul>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
</ng-template>
|
|
67
|
+
</li>
|
|
68
|
+
</ng-container>
|
|
69
|
+
<li class="nav-item" role="presentation">
|
|
70
|
+
<button type="button" class="nav-link" (click.stop)="addFieldTabs()">
|
|
71
|
+
<i class="fas fa-plus-circle"></i>
|
|
72
|
+
{{'Cms::NewTab' | abpLocalization}}
|
|
73
|
+
</button>
|
|
74
|
+
</li>
|
|
75
|
+
</ul>
|
|
76
|
+
<div [ngbNavOutlet]="nav" class="mt-2 bordernNavs p-0"></div>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="col-sm-4">
|
|
79
|
+
<div ngbAccordion #accordion="ngbAccordion" ondragover="event.preventDefault();"
|
|
80
|
+
(drop)="dragToDataSourceDropped()" style="min-height: 80px;">
|
|
81
|
+
<ng-container *ngFor="let item of fieldGroupList; let i = index">
|
|
82
|
+
<div [ngbAccordionItem]="item.name" *ngIf="item.fields.length > 0">
|
|
83
|
+
<h2 ngbAccordionHeader>
|
|
84
|
+
<button ngbAccordionButton>{{
|
|
85
|
+
('Cms::'+item.name) | abpLocalization }}</button>
|
|
86
|
+
</h2>
|
|
87
|
+
<div ngbAccordionCollapse>
|
|
88
|
+
<div ngbAccordionBody>
|
|
89
|
+
<ng-template>
|
|
90
|
+
<ul class="list-group">
|
|
91
|
+
<ng-container
|
|
92
|
+
*ngFor="let el of item.fields; let ii = index">
|
|
93
|
+
<li draggable="true"
|
|
94
|
+
(dragstart)="fromDataSourceDragStart(el,ii,i)"
|
|
95
|
+
class="list-group-item">
|
|
96
|
+
{{ el.displayName }}
|
|
97
|
+
</li>
|
|
98
|
+
</ng-container>
|
|
99
|
+
</ul>
|
|
100
|
+
</ng-template>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</ng-container>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
</abp-page>
|
|
120
|
+
|
|
121
|
+
</form>
|
|
122
|
+
|
|
123
|
+
<abp-modal [(visible)]="visibleTabsOpen" [busy]="modalBusy" (visibleChange)="VisibleTabsChange($event)">
|
|
124
|
+
<ng-template #abpHeader>
|
|
125
|
+
<h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>22
|
|
126
|
+
</ng-template>
|
|
127
|
+
<ng-template #abpBody>
|
|
128
|
+
<ng-template #loaderRef>
|
|
129
|
+
<div class="text-center"><i class="fa fa-pulse fa-spinner" aria-hidden="true"></i></div>
|
|
130
|
+
</ng-template>
|
|
131
|
+
<ng-container *ngIf="editFieldTabsFrom; else loaderRef">
|
|
132
|
+
<form class="sites-modal-form" [formGroup]="editFieldTabsFrom" (keydown.enter)="$event.preventDefault()" [class]="{'was-validated':formValidation}" (submit)="editFieldTabsSave()">
|
|
133
|
+
<button type="submit" #editFieldTabsModalSubmitBtn style="display: none"></button>
|
|
134
|
+
<div class="mb-3">
|
|
135
|
+
<label class="form-label">{{'Cms::Name' | abpLocalization}}</label>
|
|
136
|
+
<input type="text" class="form-control" formControlName="name" placeholder="" />
|
|
137
|
+
</div>
|
|
138
|
+
</form>
|
|
139
|
+
</ng-container>
|
|
140
|
+
</ng-template>
|
|
141
|
+
<ng-template #abpFooter>
|
|
142
|
+
<button type="button" class="btn btn-secondary" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>
|
|
143
|
+
<abp-button iconClass="fa fa-check"
|
|
144
|
+
(click)="editFieldTabsModalSubmitBtn.nativeElement.click()">{{'AbpUi::Save' | abpLocalization}}</abp-button>
|
|
145
|
+
</ng-template>
|
|
146
|
+
</abp-modal>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<abp-modal [(visible)]="visibleEditFieldOpen" [busy]="modalBusy" (visibleChange)="VisibleEditFieldChange($event)">
|
|
150
|
+
<ng-template #abpHeader>
|
|
151
|
+
<h3>{{'AbpUi::Edit' | abpLocalization}}</h3>
|
|
152
|
+
</ng-template>
|
|
153
|
+
<ng-template #abpBody>
|
|
154
|
+
<ng-template #loaderRef>
|
|
155
|
+
<div class="text-center"><i class="fa fa-pulse fa-spinner" aria-hidden="true"></i></div>
|
|
156
|
+
</ng-template>
|
|
157
|
+
<ng-container *ngIf="editFieldFrom; else loaderRef">
|
|
158
|
+
<form class="sites-modal-form" [formGroup]="editFieldFrom" (keydown.enter)="$event.preventDefault()" (submit)="editFieldSave()">
|
|
159
|
+
<button type="submit" #editFieldModalSubmitBtn style="display: none"></button>
|
|
160
|
+
<div class="mb-3">
|
|
161
|
+
<label class="form-label">{{'Cms::DisplayName' | abpLocalization}}</label>
|
|
162
|
+
<input type="text" class="form-control" formControlName="displayName" placeholder="" />
|
|
163
|
+
</div>
|
|
164
|
+
<div class="mb-3">
|
|
165
|
+
<div class="form-check form-check-inline">
|
|
166
|
+
<input class="form-check-input" type="checkbox" value="true" formControlName="required"
|
|
167
|
+
id="required" />
|
|
168
|
+
<label class="form-check-label" for="required"> {{'Cms::Required' | abpLocalization}} </label>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="mb-3">
|
|
172
|
+
<div class="form-check form-check-inline">
|
|
173
|
+
<input class="form-check-input" type="checkbox" value="true" formControlName="showInList"
|
|
174
|
+
id="showInList" />
|
|
175
|
+
<label class="form-check-label" for="showInList"> {{'Cms::ShowInList' | abpLocalization}}
|
|
176
|
+
</label>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<div class="mb-3">
|
|
180
|
+
<div class="form-check form-check-inline">
|
|
181
|
+
<input class="form-check-input" type="checkbox" value="true" formControlName="enableSearch"
|
|
182
|
+
id="enableSearch" />
|
|
183
|
+
<label class="form-check-label" for="enableSearch"> {{'Cms::EnableSearch' | abpLocalization}}
|
|
184
|
+
</label>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</form>
|
|
188
|
+
</ng-container>
|
|
189
|
+
</ng-template>
|
|
190
|
+
<ng-template #abpFooter>
|
|
191
|
+
<button type="button" class="btn btn-secondary" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>
|
|
192
|
+
<abp-button iconClass="fa fa-check" [disabled]="!editFieldFrom.valid"
|
|
193
|
+
(click)="editFieldModalSubmitBtn.nativeElement.click()">{{'AbpUi::Save' | abpLocalization}}</abp-button>
|
|
194
|
+
</ng-template>
|
|
195
|
+
</abp-modal>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::ng-deep .create-or-edit-entry-type-page{.dignite_page{height:calc(100vh - 32px - 53px - 40px);overflow:auto}.form-control,.form-select{padding:.475rem 1.25rem}.cursor-move{cursor:move}.bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}.tab-pane{height:100%}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CreateOrEditComponent } from './create-or-edit.component';
|
|
4
|
+
|
|
5
|
+
describe('CreateOrEditComponent', () => {
|
|
6
|
+
let component: CreateOrEditComponent;
|
|
7
|
+
let fixture: ComponentFixture<CreateOrEditComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CreateOrEditComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(CreateOrEditComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { EXTENSIONS_IDENTIFIER } from '@abp/ng.components/extensible';
|
|
2
|
+
import { LocalizationService } from '@abp/ng.core';
|
|
3
|
+
import { ToasterService } from '@abp/ng.theme.shared';
|
|
4
|
+
import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
|
5
|
+
import { FormBuilder, FormGroup, FormArray } from '@angular/forms';
|
|
6
|
+
import { ActivatedRoute } from '@angular/router';
|
|
7
|
+
import { CmsApiService } from '../../../../services';
|
|
8
|
+
import {
|
|
9
|
+
CreateOrEditEntryTypeInputBase,
|
|
10
|
+
fieldTabsBase,
|
|
11
|
+
fieldsBase,
|
|
12
|
+
} from './create-or-edit.-entry-type-input-base';
|
|
13
|
+
import { Location } from '@angular/common';
|
|
14
|
+
import { ECmsComponent } from '../../../../enums';
|
|
15
|
+
import { ValidatorsService } from '@dignite-ng/expand.core';
|
|
16
|
+
import { UpdateListService } from '@dignite-ng/expand.core';
|
|
17
|
+
import { finalize } from 'rxjs';
|
|
18
|
+
import { FieldAdminService, FieldGroupAdminService } from '../../../../proxy/dignite/cms/admin/fields';
|
|
19
|
+
import { EntryTypeAdminService } from '../../../../proxy/dignite/cms/admin/sections';
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'cms-create-or-edit',
|
|
22
|
+
templateUrl: './create-or-edit.component.html',
|
|
23
|
+
styleUrls: ['./create-or-edit.component.scss'],
|
|
24
|
+
providers: [
|
|
25
|
+
{
|
|
26
|
+
provide: EXTENSIONS_IDENTIFIER,
|
|
27
|
+
useValue: ECmsComponent.SectionsCreateOrEdit,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
export class CreateOrEditComponent implements OnInit {
|
|
32
|
+
constructor(
|
|
33
|
+
private toaster: ToasterService,
|
|
34
|
+
public _location: Location,
|
|
35
|
+
private route: ActivatedRoute,
|
|
36
|
+
public _FieldGroupAdminService: FieldGroupAdminService,
|
|
37
|
+
public _FieldAdminService: FieldAdminService,
|
|
38
|
+
public _EntryTypeAdminService: EntryTypeAdminService,
|
|
39
|
+
public _LocalizationService: LocalizationService,
|
|
40
|
+
public _CmsApiService: CmsApiService
|
|
41
|
+
) {}
|
|
42
|
+
private fb = inject(FormBuilder);
|
|
43
|
+
private _UpdateListService = inject(UpdateListService);
|
|
44
|
+
/**表单实体 */
|
|
45
|
+
newEntity: FormGroup | undefined = this.fb.group(new CreateOrEditEntryTypeInputBase());
|
|
46
|
+
/**版块id */
|
|
47
|
+
sectionId: string = '';
|
|
48
|
+
/**条目类型id */
|
|
49
|
+
entryTypesId: string = '';
|
|
50
|
+
/**条目类型详情 */
|
|
51
|
+
entryTypesSelect: any;
|
|
52
|
+
|
|
53
|
+
get fieldTabs() {
|
|
54
|
+
return this.newEntity.get('fieldTabs') as FormArray;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
58
|
+
@ViewChild('submitclick', { static: true }) submitclick: ElementRef;
|
|
59
|
+
|
|
60
|
+
/**触发提交按钮 */
|
|
61
|
+
submitclickBtn() {
|
|
62
|
+
this.submitclick.nativeElement.click();
|
|
63
|
+
}
|
|
64
|
+
ngOnInit() {
|
|
65
|
+
let sectionId = this.route.snapshot.params.sectionsId;
|
|
66
|
+
this.entryTypesId = this.route.snapshot.params.entryTypesId || '';
|
|
67
|
+
if (sectionId) {
|
|
68
|
+
this.sectionId = sectionId;
|
|
69
|
+
this.addControlToFieldTabs();
|
|
70
|
+
this.getFieldGroup();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**给fieldTabs添加新控件 */
|
|
75
|
+
addControlToFieldTabs(nameValue = '') {
|
|
76
|
+
const newFormGroup = this.fb.group(
|
|
77
|
+
new fieldTabsBase({
|
|
78
|
+
name:
|
|
79
|
+
this.fieldTabs.length === 0
|
|
80
|
+
? this._LocalizationService.instant(`Cms::FieldTab`)
|
|
81
|
+
: nameValue,
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
this.fieldTabs.push(newFormGroup);
|
|
85
|
+
this.resultSource.push(newFormGroup.value);
|
|
86
|
+
this.navActive = this.resultSource.length - 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**获取字段分组 */
|
|
90
|
+
getFieldGroup() {
|
|
91
|
+
this._FieldGroupAdminService.getList({}).subscribe(async res => {
|
|
92
|
+
let fieldList: any = await this.getFieldList();
|
|
93
|
+
let fieldGroupList = res.items;
|
|
94
|
+
fieldGroupList.unshift({
|
|
95
|
+
id: null,
|
|
96
|
+
name: 'UngroupedFields',
|
|
97
|
+
});
|
|
98
|
+
fieldGroupList.forEach((el: any, index) => {
|
|
99
|
+
el.fields = fieldList.filter(els => els.groupId === el.id);
|
|
100
|
+
});
|
|
101
|
+
this.fieldGroupList = fieldGroupList;
|
|
102
|
+
this.fieldList = this.deepClone(fieldList);
|
|
103
|
+
let entryTypesId = this.entryTypesId;
|
|
104
|
+
if (entryTypesId) {
|
|
105
|
+
this.entryTypesId = entryTypesId;
|
|
106
|
+
this.getEntryTypes();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**获取条目类型详情 */
|
|
111
|
+
getEntryTypes() {
|
|
112
|
+
let fieldList: any = this.deepClone(this.fieldList);
|
|
113
|
+
this._EntryTypeAdminService.get(this.entryTypesId).subscribe(res => {
|
|
114
|
+
res.fieldTabs.forEach(el => {
|
|
115
|
+
el.fields.forEach((eld: any) => {
|
|
116
|
+
eld.id = eld.fieldId;
|
|
117
|
+
eld.groupId = fieldList.find(elfd => elfd.id == eld.fieldId).groupId;
|
|
118
|
+
this.formRightGroup.push(eld);
|
|
119
|
+
let fieldindex = fieldList.findIndex(elfl => elfl.id == eld.fieldId);
|
|
120
|
+
fieldList.splice(fieldindex, 1);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
this.fieldGroupList.forEach((el: any, index) => {
|
|
124
|
+
el.fields = fieldList.filter(els => els.groupId === el.id);
|
|
125
|
+
});
|
|
126
|
+
this.newEntity.patchValue(res);
|
|
127
|
+
this.entryTypesSelect = res;
|
|
128
|
+
this.resultSource = res.fieldTabs;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 深拷贝--方法
|
|
133
|
+
* $api.deepClone() */
|
|
134
|
+
deepClone(obj: any) {
|
|
135
|
+
if (typeof obj !== 'object' || obj === null) return obj;
|
|
136
|
+
const result = Array.isArray(obj) ? [] : {};
|
|
137
|
+
for (let key in obj) {
|
|
138
|
+
if (obj.hasOwnProperty(key)) {
|
|
139
|
+
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
140
|
+
if (obj[key] instanceof Date) {
|
|
141
|
+
result[key] = new Date(obj[key].getTime());
|
|
142
|
+
} else if (obj[key] instanceof RegExp) {
|
|
143
|
+
result[key] = new RegExp(obj[key]);
|
|
144
|
+
} else {
|
|
145
|
+
result[key] = this.deepClone(obj[key]);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
result[key] = obj[key];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @param nameValue 获取所有字段
|
|
157
|
+
*/
|
|
158
|
+
getFieldList() {
|
|
159
|
+
return new Promise((resolve, rejects) => {
|
|
160
|
+
this._FieldAdminService
|
|
161
|
+
.getList({
|
|
162
|
+
maxResultCount: 1000,
|
|
163
|
+
})
|
|
164
|
+
.subscribe((res: any) => {
|
|
165
|
+
res.items.forEach(el => {
|
|
166
|
+
el.required = false;
|
|
167
|
+
el.showInList = false;
|
|
168
|
+
el.enableSearch = false;
|
|
169
|
+
});
|
|
170
|
+
resolve(res.items);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* 拖拽 功能*/
|
|
177
|
+
/**数据源 */
|
|
178
|
+
/**数据源-字段分组数据-包含字段数据 fields */
|
|
179
|
+
fieldGroupList: any[] = [];
|
|
180
|
+
/**数据源-所有字段列表 */
|
|
181
|
+
fieldList: any[] = [];
|
|
182
|
+
/**数据源拖拽的分组下标 */
|
|
183
|
+
DataSourceGroupIndex: number;
|
|
184
|
+
/**数据源拖拽的字段下标 */
|
|
185
|
+
DataSourceFieldIndex: number;
|
|
186
|
+
/**目标源 结果*/
|
|
187
|
+
resultSource: any[] = [];
|
|
188
|
+
|
|
189
|
+
/**从数据源拖拽的元素 */
|
|
190
|
+
fromDataSourceDragEl: any;
|
|
191
|
+
/**从目标源拖拽的元素 */
|
|
192
|
+
fromResultSourceDragEl: any;
|
|
193
|
+
|
|
194
|
+
/**来自数据源的集合,用于从目标源拖回数据源时的判断,与取值 */
|
|
195
|
+
formRightGroup: any[] = [];
|
|
196
|
+
/**从数据源开始拖拽 */
|
|
197
|
+
fromDataSourceDragStart(element, fieldIndex, groupIndex) {
|
|
198
|
+
this.fromDataSourceDragEl = element;
|
|
199
|
+
this.DataSourceFieldIndex = fieldIndex;
|
|
200
|
+
this.DataSourceGroupIndex = groupIndex;
|
|
201
|
+
this.fromResultSourceDragEl = undefined;
|
|
202
|
+
}
|
|
203
|
+
/**从目标源开始拖拽 */
|
|
204
|
+
fromResultSourceDragStart(element) {
|
|
205
|
+
this.fromResultSourceDragEl = element;
|
|
206
|
+
this.fromDataSourceDragEl = undefined;
|
|
207
|
+
this.DataSourceFieldIndex = undefined;
|
|
208
|
+
this.DataSourceGroupIndex = undefined;
|
|
209
|
+
}
|
|
210
|
+
/**拖拽到数据源时触发 */
|
|
211
|
+
dragToDataSourceDropped() {
|
|
212
|
+
//从数据源拖拽到数据源-排序
|
|
213
|
+
if (this.fromDataSourceDragEl) {
|
|
214
|
+
}
|
|
215
|
+
let _fromResultSourceDragEl = this.fromResultSourceDragEl;
|
|
216
|
+
let formRightGroup = this.deepClone(this.formRightGroup);
|
|
217
|
+
let fieldList = this.deepClone(this.fieldList);
|
|
218
|
+
|
|
219
|
+
if (_fromResultSourceDragEl) {
|
|
220
|
+
//移动
|
|
221
|
+
//从目标源拖拽到数据源
|
|
222
|
+
// 拖拽目标源的下标
|
|
223
|
+
let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(
|
|
224
|
+
el => el.id == _fromResultSourceDragEl.id
|
|
225
|
+
);
|
|
226
|
+
//删除目标源中的数据
|
|
227
|
+
this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
|
|
228
|
+
formRightGroup.splice(
|
|
229
|
+
formRightGroup.findIndex(el => el.id == _fromResultSourceDragEl.id),
|
|
230
|
+
1
|
|
231
|
+
);
|
|
232
|
+
this.fieldGroupList.forEach(el => {
|
|
233
|
+
if (el.id == _fromResultSourceDragEl.groupId) {
|
|
234
|
+
const elFieldsAll = fieldList.filter(els => els.groupId === el.id);
|
|
235
|
+
el.fields = elFieldsAll.filter(
|
|
236
|
+
item => !formRightGroup.some(itemB => item.id === itemB.id)
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
this.formRightGroup = formRightGroup;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
this.setfieldTabsFrom();
|
|
244
|
+
}
|
|
245
|
+
/**拖拽到目标源时触发
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
dragToResultSourceDropped(fieldTabstem: any, fieldTabsIndex) {
|
|
249
|
+
const _fromDataSourceDragEl = this.fromDataSourceDragEl;
|
|
250
|
+
//从数据源拖拽到目标源
|
|
251
|
+
if (_fromDataSourceDragEl) {
|
|
252
|
+
this.fieldGroupList[this.DataSourceGroupIndex].fields.splice(this.DataSourceFieldIndex, 1);
|
|
253
|
+
this.resultSource[fieldTabsIndex].fields.push(_fromDataSourceDragEl);
|
|
254
|
+
this.formRightGroup.push(_fromDataSourceDragEl);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
this.setfieldTabsFrom();
|
|
258
|
+
}
|
|
259
|
+
/** 从目标源拖拽到目标源*/
|
|
260
|
+
dragToResultSourceItemDropped(fieldsIndex) {
|
|
261
|
+
const _fromResultSourceDragEl = this.fromResultSourceDragEl;
|
|
262
|
+
if (_fromResultSourceDragEl) {
|
|
263
|
+
// 拖拽目标源的下标
|
|
264
|
+
let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(
|
|
265
|
+
el => el.id == _fromResultSourceDragEl.id
|
|
266
|
+
);
|
|
267
|
+
//删除目标源中的数据
|
|
268
|
+
this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
|
|
269
|
+
this.resultSource[this.navActive].fields.splice(fieldsIndex, 0, _fromResultSourceDragEl);
|
|
270
|
+
}
|
|
271
|
+
this.setfieldTabsFrom();
|
|
272
|
+
}
|
|
273
|
+
/**设置formA表单 */
|
|
274
|
+
setfieldTabsFrom() {
|
|
275
|
+
let setArray = [];
|
|
276
|
+
this.resultSource.forEach(el => {
|
|
277
|
+
let fieldsArray = [];
|
|
278
|
+
el.fields.forEach(item => {
|
|
279
|
+
fieldsArray.push({
|
|
280
|
+
fieldId: item.id || item.fieldId,
|
|
281
|
+
displayName: item.displayName,
|
|
282
|
+
required: item?.required,
|
|
283
|
+
showInList: item?.showInList,
|
|
284
|
+
enableSearch: item?.enableSearch,
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
setArray.push({
|
|
288
|
+
name: el.name,
|
|
289
|
+
fields: fieldsArray,
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
this.newEntity.patchValue({
|
|
293
|
+
fieldTabs: setArray,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
private _ValidatorsService = inject(ValidatorsService);
|
|
297
|
+
/**表单验证状态
|
|
298
|
+
* {
|
|
299
|
+
* title:true,
|
|
300
|
+
* }
|
|
301
|
+
*/
|
|
302
|
+
formValidation: any = '';
|
|
303
|
+
isSubmit:boolean = false;
|
|
304
|
+
/**保存表单 */
|
|
305
|
+
save() {
|
|
306
|
+
console.log(this.newEntity.value,'this.newEntity.value');
|
|
307
|
+
|
|
308
|
+
if(this.isSubmit) return;
|
|
309
|
+
this.isSubmit = true;
|
|
310
|
+
let input = this.newEntity.value;
|
|
311
|
+
|
|
312
|
+
this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
|
|
313
|
+
if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms')) return this.isSubmit = false;
|
|
314
|
+
|
|
315
|
+
if (this.entryTypesSelect) {
|
|
316
|
+
this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).pipe(finalize(()=>{
|
|
317
|
+
this.isSubmit = false;
|
|
318
|
+
})).subscribe(res => {
|
|
319
|
+
this.toaster.success(this._LocalizationService.instant(`Cms::SavedSuccessfully`));
|
|
320
|
+
this._location.back();
|
|
321
|
+
this._UpdateListService.updateList();
|
|
322
|
+
});
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
input.sectionId = this.sectionId;
|
|
326
|
+
this._EntryTypeAdminService.create(input).pipe(finalize(()=>{
|
|
327
|
+
this.isSubmit = false;
|
|
328
|
+
})).subscribe(res => {
|
|
329
|
+
this.toaster.success(this._LocalizationService.instant(`Cms::SavedSuccessfully`));
|
|
330
|
+
this._location.back();
|
|
331
|
+
this._UpdateListService.updateList();
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/**编辑Tabs表单 */
|
|
335
|
+
editFieldTabsFrom: FormGroup | undefined;
|
|
336
|
+
/**模态框状态 */
|
|
337
|
+
visibleTabsOpen: boolean = false;
|
|
338
|
+
/**是否是忙碌状态 */
|
|
339
|
+
modalBusy: boolean = false;
|
|
340
|
+
/**正在编辑的tabs */
|
|
341
|
+
editFieldTabsSelect: any;
|
|
342
|
+
/**正在选中的nav */
|
|
343
|
+
navActive: any = 0;
|
|
344
|
+
|
|
345
|
+
/**表单控件模板-动态赋值表单控件 */
|
|
346
|
+
@ViewChild('editFieldTabsModalSubmitBtn', { static: false })
|
|
347
|
+
editFieldTabsModalSubmitBtn: ElementRef;
|
|
348
|
+
|
|
349
|
+
/**模态框状态改变回调 */
|
|
350
|
+
VisibleTabsChange(event) {
|
|
351
|
+
if (!event) {
|
|
352
|
+
this.editFieldTabsSelect = '';
|
|
353
|
+
this.formValidation = '';
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**新建增加FieldTabs */
|
|
358
|
+
addFieldTabs() {
|
|
359
|
+
this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
|
|
360
|
+
this.visibleTabsOpen = true;
|
|
361
|
+
}
|
|
362
|
+
/**正在编辑的tab下标 */
|
|
363
|
+
newEditFieldTabsIndex: number;
|
|
364
|
+
/**编辑FieldTabs */
|
|
365
|
+
editFieldTabs(item, i) {
|
|
366
|
+
this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
|
|
367
|
+
this.editFieldTabsFrom.patchValue({
|
|
368
|
+
name: item.name,
|
|
369
|
+
});
|
|
370
|
+
this.editFieldTabsSelect = item;
|
|
371
|
+
this.visibleTabsOpen = true;
|
|
372
|
+
this.newEditFieldTabsIndex = i;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**保存编辑tabs表单 */
|
|
376
|
+
editFieldTabsSave() {
|
|
377
|
+
if (!this.editFieldTabsFrom.value.name) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
//编辑
|
|
381
|
+
if (this.editFieldTabsSelect) {
|
|
382
|
+
this.resultSource[this.newEditFieldTabsIndex].name = this.editFieldTabsFrom.value.name;
|
|
383
|
+
this.navActive = this.newEditFieldTabsIndex;
|
|
384
|
+
} else {
|
|
385
|
+
//新建
|
|
386
|
+
this.addControlToFieldTabs(this.editFieldTabsFrom.value.name);
|
|
387
|
+
}
|
|
388
|
+
this.visibleTabsOpen = false;
|
|
389
|
+
this.setfieldTabsFrom();
|
|
390
|
+
}
|
|
391
|
+
/**删除某个tabs表单 */
|
|
392
|
+
deleteFieldTabs(index) {
|
|
393
|
+
this.fieldTabs.removeAt(index);
|
|
394
|
+
this.resultSource.splice(index, 1);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**编辑字段模态框状态 */
|
|
398
|
+
visibleEditFieldOpen: boolean = false;
|
|
399
|
+
/**编辑字段模态框表单 */
|
|
400
|
+
editFieldFrom: FormGroup | undefined;
|
|
401
|
+
/**表单控件模板-动态赋值表单控件-编辑字段 */
|
|
402
|
+
@ViewChild('editFieldModalSubmitBtn', { static: false }) editFieldModalSubmitBtn: ElementRef;
|
|
403
|
+
/**正在编辑的字段下标 */
|
|
404
|
+
EditFieldIndex: number;
|
|
405
|
+
/**编辑字段模态框状态状态改变回调 */
|
|
406
|
+
VisibleEditFieldChange(event) {
|
|
407
|
+
if (!event) {
|
|
408
|
+
this.EditFieldIndex = undefined;
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
/**打开编辑字段模态框 */
|
|
413
|
+
EditFieldModalOpen(items, elIndex) {
|
|
414
|
+
this.visibleEditFieldOpen = true;
|
|
415
|
+
this.EditFieldIndex = elIndex;
|
|
416
|
+
this.editFieldFrom = this.fb.group(new fieldsBase());
|
|
417
|
+
this.editFieldFrom.patchValue(this.fieldTabs.value[this.navActive].fields[elIndex]);
|
|
418
|
+
}
|
|
419
|
+
/**保存编辑字段 */
|
|
420
|
+
editFieldSave() {
|
|
421
|
+
let input = this.editFieldFrom.value;
|
|
422
|
+
this.resultSource[this.navActive].fields[this.EditFieldIndex].displayName = input.displayName;
|
|
423
|
+
this.resultSource[this.navActive].fields[this.EditFieldIndex].required = input.required;
|
|
424
|
+
this.resultSource[this.navActive].fields[this.EditFieldIndex].showInList = input.showInList;
|
|
425
|
+
this.resultSource[this.navActive].fields[this.EditFieldIndex].enableSearch = input.enableSearch;
|
|
426
|
+
this.visibleEditFieldOpen = false;
|
|
427
|
+
this.setfieldTabsFrom();
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**name表单控件 */
|
|
431
|
+
get nameInput() {
|
|
432
|
+
return this.newEntity.get('name');
|
|
433
|
+
}
|
|
434
|
+
/**字段标签input失去标点生成字段名字 */
|
|
435
|
+
disPlayNameInputBlur(event) {
|
|
436
|
+
let value = event.target.value;
|
|
437
|
+
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
438
|
+
let nameInput = this.nameInput;
|
|
439
|
+
if (nameInput.value) return;
|
|
440
|
+
nameInput.patchValue(pinyin);
|
|
441
|
+
}
|
|
442
|
+
}
|