@dignite-ng/expand.cms 0.0.19 → 0.0.20

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.
Files changed (385) hide show
  1. package/config/ng-package.json +7 -0
  2. package/config/src/cms-config.module.ts +12 -0
  3. package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
  4. package/config/src/enums/route-names.ts +8 -0
  5. package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
  6. package/config/src/providers/route.provider.ts +66 -0
  7. package/config/{public-api.d.ts → src/public-api.ts} +3 -3
  8. package/karma.conf.js +44 -0
  9. package/ng-package.json +7 -0
  10. package/package.json +19 -38
  11. package/src/lib/cms-routing.module.ts +111 -0
  12. package/src/lib/cms.module.ts +119 -0
  13. package/src/lib/components/admin/entries/create-or-edit-entries.component.html +115 -0
  14. package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +25 -0
  15. package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +21 -0
  16. package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +287 -0
  17. package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +36 -0
  18. package/src/lib/components/admin/entries/create.component.html +13 -0
  19. package/src/lib/components/admin/entries/create.component.scss +21 -0
  20. package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
  21. package/src/lib/components/admin/entries/create.component.ts +103 -0
  22. package/src/lib/components/admin/entries/edit.component.html +9 -0
  23. package/src/lib/components/admin/entries/edit.component.scss +26 -0
  24. package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
  25. package/src/lib/components/admin/entries/edit.component.ts +103 -0
  26. package/src/lib/components/admin/entries/entries.component.html +106 -0
  27. package/src/lib/components/admin/entries/entries.component.scss +80 -0
  28. package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
  29. package/src/lib/components/admin/entries/entries.component.ts +216 -0
  30. package/src/lib/components/admin/entries/index.ts +4 -0
  31. package/src/lib/components/admin/fields/create-field.component.html +12 -0
  32. package/src/lib/components/admin/fields/create-field.component.scss +10 -0
  33. package/src/lib/components/admin/fields/create-field.component.spec.ts +21 -0
  34. package/src/lib/components/admin/fields/create-field.component.ts +68 -0
  35. package/src/lib/components/admin/fields/create-or-edit-field.component.html +39 -0
  36. package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
  37. package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +21 -0
  38. package/src/lib/components/admin/fields/create-or-edit-field.component.ts +119 -0
  39. package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +33 -0
  40. package/src/lib/components/admin/fields/edit-field.component.html +13 -0
  41. package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
  42. package/src/lib/components/admin/fields/edit-field.component.spec.ts +21 -0
  43. package/src/lib/components/admin/fields/edit-field.component.ts +100 -0
  44. package/src/lib/components/admin/fields/field-group.component.html +69 -0
  45. package/src/lib/components/admin/fields/field-group.component.scss +0 -0
  46. package/src/lib/components/admin/fields/field-group.component.spec.ts +21 -0
  47. package/src/lib/components/admin/fields/field-group.component.ts +132 -0
  48. package/src/lib/components/admin/fields/fields.component.html +73 -0
  49. package/src/lib/components/admin/fields/fields.component.scss +11 -0
  50. package/src/lib/components/admin/fields/fields.component.spec.ts +21 -0
  51. package/src/lib/components/admin/fields/fields.component.ts +111 -0
  52. package/src/lib/components/admin/fields/index.ts +6 -0
  53. package/src/lib/components/admin/index.ts +4 -0
  54. package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +36 -0
  55. package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +79 -0
  56. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +191 -0
  57. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +24 -0
  58. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +21 -0
  59. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +412 -0
  60. package/src/lib/components/admin/sections/entry-types/index.ts +2 -0
  61. package/src/lib/components/admin/sections/index.ts +3 -0
  62. package/src/lib/components/admin/sections/sections.component.html +191 -0
  63. package/src/lib/components/admin/sections/sections.component.scss +26 -0
  64. package/src/lib/components/admin/sections/sections.component.spec.ts +21 -0
  65. package/src/lib/components/admin/sections/sections.component.ts +334 -0
  66. package/src/lib/components/admin/sites/create-or-update-sites-input-base.ts +31 -0
  67. package/src/lib/components/admin/sites/index.ts +2 -0
  68. package/src/lib/components/admin/sites/sites.component.html +154 -0
  69. package/src/lib/components/admin/sites/sites.component.scss +19 -0
  70. package/src/lib/components/admin/sites/sites.component.spec.ts +21 -0
  71. package/src/lib/components/admin/sites/sites.component.ts +293 -0
  72. package/src/lib/components/dynamic-form/entry/entry-config.component.html +36 -0
  73. package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -0
  74. package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +21 -0
  75. package/src/lib/components/dynamic-form/entry/entry-config.component.ts +115 -0
  76. package/src/lib/components/dynamic-form/entry/entry-config.ts +24 -0
  77. package/src/lib/components/dynamic-form/entry/entry-control.component.html +26 -0
  78. package/src/lib/components/dynamic-form/entry/entry-control.component.scss +20 -0
  79. package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +21 -0
  80. package/src/lib/components/dynamic-form/entry/entry-control.component.ts +110 -0
  81. package/src/lib/components/dynamic-form/entry/index.ts +3 -0
  82. package/src/lib/components/dynamic-form/form-control-group.ts +31 -0
  83. package/src/lib/components/dynamic-form/index.ts +4 -0
  84. package/src/lib/components/dynamic-form/matrix/index.ts +3 -0
  85. package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +147 -0
  86. package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
  87. package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +21 -0
  88. package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +238 -0
  89. package/src/lib/components/dynamic-form/matrix/matrix-config.ts +63 -0
  90. package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +42 -0
  91. package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
  92. package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +21 -0
  93. package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +104 -0
  94. package/src/lib/components/dynamic-form/table/index.ts +3 -0
  95. package/src/lib/components/dynamic-form/table/table-config.component.html +85 -0
  96. package/src/lib/components/dynamic-form/table/table-config.component.scss +10 -0
  97. package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +21 -0
  98. package/src/lib/components/dynamic-form/table/table-config.component.ts +170 -0
  99. package/src/lib/components/dynamic-form/table/table-config.ts +45 -0
  100. package/src/lib/components/dynamic-form/table/table-control.component.html +55 -0
  101. package/src/lib/components/dynamic-form/table/table-control.component.scss +10 -0
  102. package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +21 -0
  103. package/src/lib/components/dynamic-form/table/table-control.component.ts +107 -0
  104. package/src/lib/components/index.ts +2 -0
  105. package/src/lib/constants/index.ts +1 -0
  106. package/src/lib/constants/styles.ts +31 -0
  107. package/src/lib/enums/ecms-component.ts +11 -0
  108. package/src/lib/enums/index.ts +1 -0
  109. package/src/lib/proxy/README.md +17 -0
  110. package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +21 -0
  111. package/src/lib/proxy/admin/dynamic-forms/models.ts +5 -0
  112. package/src/lib/proxy/admin/entries/entry-admin.service.ts +100 -0
  113. package/src/lib/proxy/admin/entries/models.ts +73 -0
  114. package/src/lib/proxy/admin/fields/field-admin.service.ts +64 -0
  115. package/src/lib/proxy/admin/fields/field-group-admin.service.ts +56 -0
  116. package/{lib/proxy/admin/fields/models.d.ts → src/lib/proxy/admin/fields/models.ts} +42 -34
  117. package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +55 -0
  118. package/{lib/proxy/admin/sections/models.d.ts → src/lib/proxy/admin/sections/models.ts} +88 -74
  119. package/src/lib/proxy/admin/sections/section-admin.service.ts +74 -0
  120. package/{lib/proxy/admin/sites/models.d.ts → src/lib/proxy/admin/sites/models.ts} +36 -30
  121. package/src/lib/proxy/admin/sites/site-admin.service.ts +72 -0
  122. package/src/lib/proxy/dignite/abp/data/models.ts +4 -0
  123. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
  124. package/{lib/proxy/dignite/file-explorer/directories/models.d.ts → src/lib/proxy/dignite/file-explorer/directories/models.ts} +35 -29
  125. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +86 -0
  126. package/src/lib/proxy/dignite/file-explorer/files/models.ts +57 -0
  127. package/src/lib/proxy/entries/entry-status.enum.ts +8 -0
  128. package/src/lib/proxy/fields/models.ts +9 -0
  129. package/src/lib/proxy/generate-proxy.json +11821 -0
  130. package/{lib/proxy/microsoft/asp-net-core/mvc/models.d.ts → src/lib/proxy/microsoft/asp-net-core/mvc/models.ts} +12 -10
  131. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +9 -0
  132. package/{lib/proxy/microsoft/net/http/headers/models.d.ts → src/lib/proxy/microsoft/net/http/headers/models.ts} +7 -6
  133. package/src/lib/proxy/sections/models.ts +14 -0
  134. package/src/lib/proxy/sections/section-type.enum.ts +9 -0
  135. package/src/lib/proxy/sites/models.ts +5 -0
  136. package/src/lib/proxy/volo/abp/content/models.ts +6 -0
  137. package/{lib/proxy/volo/cms-kit/users/models.d.ts → src/lib/proxy/volo/cms-kit/users/models.ts} +8 -7
  138. package/src/lib/services/appent-content.ts +13 -0
  139. package/src/lib/services/cms-api.service.ts +71 -0
  140. package/src/lib/services/cms.service.ts +18 -0
  141. package/src/lib/services/field-abstracts.service.ts +41 -0
  142. package/src/lib/services/index.ts +4 -0
  143. package/src/lib/services/simple-reuse-strategy.ts +49 -0
  144. package/src/lib/services/update-list.service.ts +15 -0
  145. package/src/lib/toolbar/index.ts +2 -0
  146. package/src/lib/toolbar/toolbar-btn-default-action.ts +171 -0
  147. package/src/lib/toolbar/toolbar-config.ts +95 -0
  148. package/{public-api.d.ts → src/public-api.ts} +12 -8
  149. package/src/test.ts +26 -0
  150. package/tsconfig.lib.json +20 -0
  151. package/tsconfig.lib.prod.json +10 -0
  152. package/tsconfig.spec.json +17 -0
  153. package/config/cms-config.module.d.ts +0 -8
  154. package/config/enums/route-names.d.ts +0 -8
  155. package/config/index.d.ts +0 -5
  156. package/config/providers/route.provider.d.ts +0 -8
  157. package/esm2022/config/cms-config.module.mjs +0 -19
  158. package/esm2022/config/dignite-ng-expand.cms-config.mjs +0 -5
  159. package/esm2022/config/enums/index.mjs +0 -2
  160. package/esm2022/config/enums/route-names.mjs +0 -2
  161. package/esm2022/config/providers/index.mjs +0 -2
  162. package/esm2022/config/providers/route.provider.mjs +0 -64
  163. package/esm2022/config/public-api.mjs +0 -4
  164. package/esm2022/dignite-ng-expand.cms.mjs +0 -5
  165. package/esm2022/lib/cms-routing.module.mjs +0 -100
  166. package/esm2022/lib/cms.module.mjs +0 -156
  167. package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -285
  168. package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -32
  169. package/esm2022/lib/components/admin/entries/create.component.mjs +0 -107
  170. package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -110
  171. package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -212
  172. package/esm2022/lib/components/admin/entries/index.mjs +0 -5
  173. package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -82
  174. package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -121
  175. package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +0 -25
  176. package/esm2022/lib/components/admin/fields/edit-field.component.mjs +0 -110
  177. package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -124
  178. package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -119
  179. package/esm2022/lib/components/admin/fields/index.mjs +0 -7
  180. package/esm2022/lib/components/admin/index.mjs +0 -5
  181. package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -27
  182. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +0 -71
  183. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +0 -418
  184. package/esm2022/lib/components/admin/sections/entry-types/index.mjs +0 -3
  185. package/esm2022/lib/components/admin/sections/index.mjs +0 -4
  186. package/esm2022/lib/components/admin/sections/sections.component.mjs +0 -334
  187. package/esm2022/lib/components/admin/sites/create-or-update-sites-input-base.mjs +0 -23
  188. package/esm2022/lib/components/admin/sites/index.mjs +0 -3
  189. package/esm2022/lib/components/admin/sites/sites.component.mjs +0 -285
  190. package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -125
  191. package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
  192. package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -115
  193. package/esm2022/lib/components/dynamic-form/entry/index.mjs +0 -4
  194. package/esm2022/lib/components/dynamic-form/form-control-group.mjs +0 -31
  195. package/esm2022/lib/components/dynamic-form/index.mjs +0 -5
  196. package/esm2022/lib/components/dynamic-form/matrix/index.mjs +0 -4
  197. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +0 -229
  198. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
  199. package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -111
  200. package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
  201. package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -174
  202. package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
  203. package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -114
  204. package/esm2022/lib/components/index.mjs +0 -3
  205. package/esm2022/lib/constants/index.mjs +0 -2
  206. package/esm2022/lib/constants/styles.mjs +0 -32
  207. package/esm2022/lib/enums/ecms-component.mjs +0 -13
  208. package/esm2022/lib/enums/index.mjs +0 -2
  209. package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -24
  210. package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +0 -3
  211. package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +0 -2
  212. package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +0 -67
  213. package/esm2022/lib/proxy/admin/entries/index.mjs +0 -3
  214. package/esm2022/lib/proxy/admin/entries/models.mjs +0 -2
  215. package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +0 -47
  216. package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -43
  217. package/esm2022/lib/proxy/admin/fields/index.mjs +0 -4
  218. package/esm2022/lib/proxy/admin/fields/models.mjs +0 -2
  219. package/esm2022/lib/proxy/admin/index.mjs +0 -7
  220. package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +0 -43
  221. package/esm2022/lib/proxy/admin/sections/index.mjs +0 -4
  222. package/esm2022/lib/proxy/admin/sections/models.mjs +0 -2
  223. package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +0 -53
  224. package/esm2022/lib/proxy/admin/sites/index.mjs +0 -3
  225. package/esm2022/lib/proxy/admin/sites/models.mjs +0 -2
  226. package/esm2022/lib/proxy/admin/sites/site-admin.service.mjs +0 -51
  227. package/esm2022/lib/proxy/dignite/abp/data/index.mjs +0 -2
  228. package/esm2022/lib/proxy/dignite/abp/data/models.mjs +0 -2
  229. package/esm2022/lib/proxy/dignite/abp/index.mjs +0 -3
  230. package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +0 -48
  231. package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +0 -3
  232. package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +0 -2
  233. package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +0 -60
  234. package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +0 -3
  235. package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +0 -2
  236. package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +0 -4
  237. package/esm2022/lib/proxy/dignite/index.mjs +0 -4
  238. package/esm2022/lib/proxy/entries/entry-status.enum.mjs +0 -8
  239. package/esm2022/lib/proxy/entries/index.mjs +0 -2
  240. package/esm2022/lib/proxy/fields/index.mjs +0 -2
  241. package/esm2022/lib/proxy/fields/models.mjs +0 -2
  242. package/esm2022/lib/proxy/index.mjs +0 -10
  243. package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +0 -3
  244. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +0 -2
  245. package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +0 -2
  246. package/esm2022/lib/proxy/microsoft/extensions/index.mjs +0 -3
  247. package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +0 -2
  248. package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +0 -2
  249. package/esm2022/lib/proxy/microsoft/index.mjs +0 -5
  250. package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +0 -2
  251. package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +0 -2
  252. package/esm2022/lib/proxy/microsoft/net/http/index.mjs +0 -3
  253. package/esm2022/lib/proxy/microsoft/net/index.mjs +0 -3
  254. package/esm2022/lib/proxy/sections/index.mjs +0 -3
  255. package/esm2022/lib/proxy/sections/models.mjs +0 -2
  256. package/esm2022/lib/proxy/sections/section-type.enum.mjs +0 -9
  257. package/esm2022/lib/proxy/sites/index.mjs +0 -2
  258. package/esm2022/lib/proxy/sites/models.mjs +0 -2
  259. package/esm2022/lib/proxy/volo/abp/content/index.mjs +0 -2
  260. package/esm2022/lib/proxy/volo/abp/content/models.mjs +0 -2
  261. package/esm2022/lib/proxy/volo/abp/index.mjs +0 -3
  262. package/esm2022/lib/proxy/volo/cms-kit/index.mjs +0 -3
  263. package/esm2022/lib/proxy/volo/cms-kit/users/index.mjs +0 -2
  264. package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +0 -2
  265. package/esm2022/lib/proxy/volo/index.mjs +0 -4
  266. package/esm2022/lib/services/appent-content.mjs +0 -15
  267. package/esm2022/lib/services/cms-api.service.mjs +0 -80
  268. package/esm2022/lib/services/cms.service.mjs +0 -23
  269. package/esm2022/lib/services/field-abstracts.service.mjs +0 -45
  270. package/esm2022/lib/services/index.mjs +0 -4
  271. package/esm2022/lib/services/simple-reuse-strategy.mjs +0 -43
  272. package/esm2022/lib/services/update-list.service.mjs +0 -19
  273. package/esm2022/lib/toolbar/index.mjs +0 -3
  274. package/esm2022/lib/toolbar/toolbar-btn-default-action.mjs +0 -160
  275. package/esm2022/lib/toolbar/toolbar-config.mjs +0 -81
  276. package/esm2022/public-api.mjs +0 -12
  277. package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -87
  278. package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
  279. package/fesm2022/dignite-ng-expand.cms.mjs +0 -4515
  280. package/fesm2022/dignite-ng-expand.cms.mjs.map +0 -1
  281. package/index.d.ts +0 -5
  282. package/lib/cms-routing.module.d.ts +0 -7
  283. package/lib/cms.module.d.ts +0 -40
  284. package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -91
  285. package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +0 -23
  286. package/lib/components/admin/entries/create.component.d.ts +0 -40
  287. package/lib/components/admin/entries/edit.component.d.ts +0 -42
  288. package/lib/components/admin/entries/entries.component.d.ts +0 -66
  289. package/lib/components/admin/entries/index.d.ts +0 -4
  290. package/lib/components/admin/fields/create-field.component.d.ts +0 -31
  291. package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -37
  292. package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +0 -16
  293. package/lib/components/admin/fields/edit-field.component.d.ts +0 -40
  294. package/lib/components/admin/fields/field-group.component.d.ts +0 -51
  295. package/lib/components/admin/fields/fields.component.d.ts +0 -37
  296. package/lib/components/admin/fields/index.d.ts +0 -6
  297. package/lib/components/admin/index.d.ts +0 -4
  298. package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -17
  299. package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +0 -38
  300. package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +0 -132
  301. package/lib/components/admin/sections/entry-types/index.d.ts +0 -2
  302. package/lib/components/admin/sections/index.d.ts +0 -3
  303. package/lib/components/admin/sections/sections.component.d.ts +0 -95
  304. package/lib/components/admin/sites/create-or-update-sites-input-base.d.ts +0 -12
  305. package/lib/components/admin/sites/index.d.ts +0 -2
  306. package/lib/components/admin/sites/sites.component.d.ts +0 -72
  307. package/lib/components/dynamic-form/entry/entry-config.component.d.ts +0 -42
  308. package/lib/components/dynamic-form/entry/entry-config.d.ts +0 -9
  309. package/lib/components/dynamic-form/entry/entry-control.component.d.ts +0 -35
  310. package/lib/components/dynamic-form/entry/index.d.ts +0 -3
  311. package/lib/components/dynamic-form/form-control-group.d.ts +0 -4
  312. package/lib/components/dynamic-form/index.d.ts +0 -4
  313. package/lib/components/dynamic-form/matrix/index.d.ts +0 -3
  314. package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +0 -73
  315. package/lib/components/dynamic-form/matrix/matrix-config.d.ts +0 -24
  316. package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +0 -39
  317. package/lib/components/dynamic-form/table/index.d.ts +0 -3
  318. package/lib/components/dynamic-form/table/table-config.component.d.ts +0 -58
  319. package/lib/components/dynamic-form/table/table-config.d.ts +0 -18
  320. package/lib/components/dynamic-form/table/table-control.component.d.ts +0 -36
  321. package/lib/components/index.d.ts +0 -2
  322. package/lib/constants/index.d.ts +0 -1
  323. package/lib/constants/styles.d.ts +0 -2
  324. package/lib/enums/ecms-component.d.ts +0 -11
  325. package/lib/enums/index.d.ts +0 -1
  326. package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +0 -12
  327. package/lib/proxy/admin/dynamic-forms/models.d.ts +0 -4
  328. package/lib/proxy/admin/entries/entry-admin.service.d.ts +0 -21
  329. package/lib/proxy/admin/entries/models.d.ts +0 -65
  330. package/lib/proxy/admin/fields/field-admin.service.d.ts +0 -17
  331. package/lib/proxy/admin/fields/field-group-admin.service.d.ts +0 -16
  332. package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +0 -15
  333. package/lib/proxy/admin/sections/section-admin.service.d.ts +0 -18
  334. package/lib/proxy/admin/sites/site-admin.service.d.ts +0 -18
  335. package/lib/proxy/dignite/abp/data/models.d.ts +0 -3
  336. package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +0 -17
  337. package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +0 -20
  338. package/lib/proxy/dignite/file-explorer/files/models.d.ts +0 -50
  339. package/lib/proxy/entries/entry-status.enum.d.ts +0 -5
  340. package/lib/proxy/fields/models.d.ts +0 -8
  341. package/lib/proxy/microsoft/extensions/primitives/models.d.ts +0 -8
  342. package/lib/proxy/sections/models.d.ts +0 -12
  343. package/lib/proxy/sections/section-type.enum.d.ts +0 -6
  344. package/lib/proxy/sites/models.d.ts +0 -4
  345. package/lib/proxy/volo/abp/content/models.d.ts +0 -5
  346. package/lib/services/appent-content.d.ts +0 -1
  347. package/lib/services/cms-api.service.d.ts +0 -20
  348. package/lib/services/cms.service.d.ts +0 -10
  349. package/lib/services/field-abstracts.service.d.ts +0 -20
  350. package/lib/services/index.d.ts +0 -3
  351. package/lib/services/simple-reuse-strategy.d.ts +0 -11
  352. package/lib/services/update-list.service.d.ts +0 -9
  353. package/lib/toolbar/index.d.ts +0 -2
  354. package/lib/toolbar/toolbar-btn-default-action.d.ts +0 -19
  355. package/lib/toolbar/toolbar-config.d.ts +0 -57
  356. /package/{lib/proxy/admin/dynamic-forms/index.d.ts → src/lib/proxy/admin/dynamic-forms/index.ts} +0 -0
  357. /package/{lib/proxy/admin/entries/index.d.ts → src/lib/proxy/admin/entries/index.ts} +0 -0
  358. /package/{lib/proxy/admin/fields/index.d.ts → src/lib/proxy/admin/fields/index.ts} +0 -0
  359. /package/{lib/proxy/admin/index.d.ts → src/lib/proxy/admin/index.ts} +0 -0
  360. /package/{lib/proxy/admin/sections/index.d.ts → src/lib/proxy/admin/sections/index.ts} +0 -0
  361. /package/{lib/proxy/admin/sites/index.d.ts → src/lib/proxy/admin/sites/index.ts} +0 -0
  362. /package/{lib/proxy/dignite/abp/data/index.d.ts → src/lib/proxy/dignite/abp/data/index.ts} +0 -0
  363. /package/{lib/proxy/dignite/abp/index.d.ts → src/lib/proxy/dignite/abp/index.ts} +0 -0
  364. /package/{lib/proxy/dignite/file-explorer/directories/index.d.ts → src/lib/proxy/dignite/file-explorer/directories/index.ts} +0 -0
  365. /package/{lib/proxy/dignite/file-explorer/files/index.d.ts → src/lib/proxy/dignite/file-explorer/files/index.ts} +0 -0
  366. /package/{lib/proxy/dignite/file-explorer/index.d.ts → src/lib/proxy/dignite/file-explorer/index.ts} +0 -0
  367. /package/{lib/proxy/dignite/index.d.ts → src/lib/proxy/dignite/index.ts} +0 -0
  368. /package/{lib/proxy/entries/index.d.ts → src/lib/proxy/entries/index.ts} +0 -0
  369. /package/{lib/proxy/fields/index.d.ts → src/lib/proxy/fields/index.ts} +0 -0
  370. /package/{lib/proxy/index.d.ts → src/lib/proxy/index.ts} +0 -0
  371. /package/{lib/proxy/microsoft/asp-net-core/index.d.ts → src/lib/proxy/microsoft/asp-net-core/index.ts} +0 -0
  372. /package/{lib/proxy/microsoft/asp-net-core/mvc/index.d.ts → src/lib/proxy/microsoft/asp-net-core/mvc/index.ts} +0 -0
  373. /package/{lib/proxy/microsoft/extensions/index.d.ts → src/lib/proxy/microsoft/extensions/index.ts} +0 -0
  374. /package/{lib/proxy/microsoft/extensions/primitives/index.d.ts → src/lib/proxy/microsoft/extensions/primitives/index.ts} +0 -0
  375. /package/{lib/proxy/microsoft/index.d.ts → src/lib/proxy/microsoft/index.ts} +0 -0
  376. /package/{lib/proxy/microsoft/net/http/headers/index.d.ts → src/lib/proxy/microsoft/net/http/headers/index.ts} +0 -0
  377. /package/{lib/proxy/microsoft/net/http/index.d.ts → src/lib/proxy/microsoft/net/http/index.ts} +0 -0
  378. /package/{lib/proxy/microsoft/net/index.d.ts → src/lib/proxy/microsoft/net/index.ts} +0 -0
  379. /package/{lib/proxy/sections/index.d.ts → src/lib/proxy/sections/index.ts} +0 -0
  380. /package/{lib/proxy/sites/index.d.ts → src/lib/proxy/sites/index.ts} +0 -0
  381. /package/{lib/proxy/volo/abp/content/index.d.ts → src/lib/proxy/volo/abp/content/index.ts} +0 -0
  382. /package/{lib/proxy/volo/abp/index.d.ts → src/lib/proxy/volo/abp/index.ts} +0 -0
  383. /package/{lib/proxy/volo/cms-kit/index.d.ts → src/lib/proxy/volo/cms-kit/index.ts} +0 -0
  384. /package/{lib/proxy/volo/cms-kit/users/index.d.ts → src/lib/proxy/volo/cms-kit/users/index.ts} +0 -0
  385. /package/{lib/proxy/volo/index.d.ts → src/lib/proxy/volo/index.ts} +0 -0
@@ -0,0 +1,293 @@
1
+ /* eslint-disable @angular-eslint/use-lifecycle-interface */
2
+ import { ABP, ConfigStateService, LIST_QUERY_DEBOUNCE_TIME, ListService, LocalizationService, PagedResultDto } from '@abp/ng.core';
3
+ import { ToasterService, ConfirmationService, Confirmation } from '@abp/ng.theme.shared';
4
+ import { Component, ViewChild, OnInit, ViewContainerRef, ElementRef } from '@angular/core';
5
+ import { AbstractControl, FormBuilder, FormControl, FormGroup, NgForm, ValidationErrors, Validators } from '@angular/forms';
6
+ import { GetSitesInput, SiteDto, SiteAdminService } from '../../../proxy/admin/sites';
7
+ import { ColumnMode } from "@swimlane/ngx-datatable";
8
+ import { finalize } from 'rxjs/operators';
9
+ import { CreateOrUpdateSitesInputBase } from './create-or-update-sites-input-base';
10
+ import { EXTENSIONS_IDENTIFIER } from '@abp/ng.theme.shared/extensions';
11
+ import { ECmsComponent } from '../../../enums';
12
+ import { CmsApiService } from '../../../services/cms-api.service';
13
+ import { Observable } from 'rxjs';
14
+
15
+ @Component({
16
+ selector: 'cms-sites',
17
+ templateUrl: './sites.component.html',
18
+ styleUrls: ['./sites.component.scss'],
19
+ providers: [
20
+ // [Required]
21
+ ListService,
22
+ // [Optional]
23
+ // Provide this token if you want a different debounce time.
24
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
25
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
26
+ {
27
+ provide: EXTENSIONS_IDENTIFIER,
28
+ useValue: ECmsComponent.Sites,
29
+ },
30
+ ]
31
+ })
32
+ export class SitesComponent implements OnInit {
33
+ constructor(
34
+ public readonly list: ListService,
35
+ private _SiteAdminService: SiteAdminService,
36
+ private toaster: ToasterService,
37
+ private confirmation: ConfirmationService,
38
+ private fb: FormBuilder,
39
+ private configState: ConfigStateService,
40
+ private _LocalizationService: LocalizationService,
41
+ private _CmsApiService: CmsApiService,
42
+ ) {
43
+ }
44
+
45
+
46
+
47
+
48
+
49
+ /**创建站点模态框状态 */
50
+ createSitesOpen: boolean = false
51
+
52
+ /**用于确定模态的繁忙状态是否为真 */
53
+ modalBusy: boolean = false
54
+ /**创建站点表单 */
55
+ createOrEditForm: FormGroup | undefined;
56
+
57
+ get languagesInput() {
58
+ return this.createOrEditForm.get('languages').value
59
+ }
60
+
61
+ /**语言列表 */
62
+ languages: any[]
63
+
64
+ /**站点给定的表单值 */
65
+ selected: any
66
+
67
+ /**表单控件模板-动态赋值表单控件 */
68
+ @ViewChild('createModalSubmit', { static: false }) createModalSubmit: ElementRef;
69
+
70
+
71
+ ColumnMode = ColumnMode;
72
+ data: PagedResultDto<SiteDto> = {
73
+ items: [],
74
+ totalCount: 0,
75
+ };
76
+
77
+ filters = {} as GetSitesInput;
78
+
79
+
80
+ ngOnInit(): void {
81
+ this.hookToQuery()
82
+ }
83
+
84
+ hookToQuery() {
85
+ const getData = (query: ABP.PageQueryParams) => this._SiteAdminService.getList({
86
+ ...query,
87
+ ...this.filters,
88
+ });
89
+
90
+ const setData = (list: PagedResultDto<SiteDto>) => (this.data = list);
91
+ this.list.hookToQuery(getData).subscribe(setData);
92
+ }
93
+
94
+
95
+ /**删除字段 */
96
+ deletefield(row: any) {
97
+ this.confirmation.warn(
98
+ row.displayName,
99
+ this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`),
100
+ ).subscribe((status: Confirmation.Status) => {
101
+ if (status == 'confirm') {
102
+ this._SiteAdminService.delete(row.id).pipe(finalize(() => {
103
+ })).subscribe(res => {
104
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
105
+ this.list.get()
106
+ })
107
+ }
108
+
109
+ });
110
+ }
111
+
112
+ /**创建站点模态框状态改变 */
113
+ createGroupVisibleChange(event) {
114
+ if (!event) {
115
+ this.selected = ''
116
+ return
117
+ }
118
+ }
119
+
120
+ /**选择语言改变 */
121
+ languagesChange(event) {
122
+ let checked = event.target.checked
123
+ let value = event.target.value
124
+ this.languages.forEach(el => {
125
+ el.ischecked = el.cultureName === value ? checked : el.ischecked;
126
+ })
127
+ this.setFromLangguages()
128
+ }
129
+ /**设置默认语言 */
130
+ setDefault(items) {
131
+ this.languages.forEach(el => {
132
+ el.isDefault = el.cultureName === items.cultureName;
133
+ })
134
+ this.setFromLangguages()
135
+ }
136
+ /**设置表单中的语言 */
137
+ setFromLangguages() {
138
+ let languagesSelect = this.languages.filter(el => el.ischecked == true)
139
+ this.createOrEditForm.patchValue({
140
+ languages: languagesSelect
141
+ })
142
+ if (languagesSelect.length == 0) {
143
+ this.languages.forEach(el => {
144
+ el.isDefault = false
145
+ })
146
+ }
147
+ }
148
+ /**表单保存提交 */
149
+ createOrEditSave() {
150
+ if (this.selected) {
151
+ return this.EditSave()
152
+ }
153
+ this.createSave()
154
+ }
155
+
156
+ /**创建站点保存 */
157
+ createSave() {
158
+ let input = this.createOrEditForm.value
159
+ this.modalBusy = true
160
+ if (!this.createOrEditForm.valid) return
161
+ this._SiteAdminService.create(input).pipe(finalize(() => {
162
+ this.modalBusy = false
163
+ this.createSitesOpen = false
164
+ })).subscribe(res => {
165
+ this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
166
+ this.list.get()
167
+ })
168
+ }
169
+ /**编辑站点保存 */
170
+ EditSave() {
171
+ let input = this.createOrEditForm.value
172
+ this.modalBusy = true
173
+ this._SiteAdminService.update(this.selected.id, input).pipe(finalize(() => {
174
+ this.modalBusy = false
175
+ this.createSitesOpen = false
176
+ })).subscribe(res => {
177
+ this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
178
+ this.list.get()
179
+ })
180
+ }
181
+
182
+
183
+
184
+ /**创建站点按钮 */
185
+ createSitesBtn() {
186
+ this.createSitesOpen = true
187
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSitesInputBase())
188
+ this.setAsyncValidatorsFn()
189
+ this.languages = this.configState.getDeep('localization.languages')
190
+ this.languages.forEach((el, index) => {
191
+ el.isDefault = index === 0
192
+ el.ischecked = index === 0
193
+ })
194
+ this.setFromLangguages()
195
+ }
196
+
197
+
198
+
199
+ /**编辑站点按钮 */
200
+ EditSitesBtn(rows) {
201
+ this.createSitesOpen = true
202
+ this.languages = this.configState.getDeep('localization.languages')
203
+ this._SiteAdminService.get(rows.id).subscribe(res => {
204
+ this.selected = rows
205
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSitesInputBase())
206
+ this.createOrEditForm.patchValue(rows)
207
+ this.setAsyncValidatorsFn()
208
+ // 更新语言和默认状态
209
+ this.updateLanguages(res.languages);
210
+ // 设置表单语言
211
+ this.setFromLangguages()
212
+ })
213
+ }
214
+
215
+ /**设置字段控件异步验证 */
216
+ setAsyncValidatorsFn() {
217
+ this.createOrEditForm.setControl('name', new FormControl(this.nameInput.value || '', {
218
+ validators: Validators.required,
219
+ asyncValidators: this.nameRepetitionAsyncValidator(),
220
+ updateOn: 'blur'
221
+ }))
222
+ }
223
+
224
+
225
+
226
+ /**更新语言和默认状态 */
227
+ updateLanguages(siteLanguages) {
228
+ this.languages.forEach(language => {
229
+ const siteLanguage = siteLanguages.find(sl => sl.cultureName === language.cultureName);
230
+ if (siteLanguage) {
231
+ language.ischecked = true;
232
+ language.isDefault = siteLanguage.isDefault;
233
+ }
234
+ });
235
+ }
236
+
237
+
238
+ get nameInput() {
239
+ return this.createOrEditForm.get('name')
240
+ }
241
+ get hostInput() {
242
+ return this.createOrEditForm.get('host')
243
+ }
244
+
245
+ /**字段标签input失去标点生成字段名字 */
246
+ disPlayNameInputBlur(event) {
247
+ let value = event.target.value
248
+ let pinyin = this._CmsApiService.chineseToPinyin(value)
249
+ let nameInput = this.nameInput
250
+ if (nameInput.value) return
251
+ nameInput.patchValue(pinyin)
252
+ }
253
+
254
+ /**name定义自定义异步验证 */
255
+ nameRepetitionAsyncValidator() {
256
+ return (ctrl: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => {
257
+ return new Promise(resolve => {
258
+ let subslug = this.createOrEditForm?.get('name').value
259
+ if (subslug == this.selected?.name) {
260
+ resolve(null);
261
+ return
262
+ }
263
+ this._SiteAdminService.nameExists(subslug).subscribe(res => {
264
+ if (res) {
265
+ resolve({ repetition: this._LocalizationService.instant(`Cms::SiteName{0}AlreadyExist`, ctrl.value) });
266
+ } else {
267
+ resolve(null);
268
+ }
269
+ })
270
+ });
271
+ };
272
+ }
273
+ /**host定义自定义异步验证 */
274
+ hostRepetitionAsyncValidator() {
275
+ return (ctrl: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => {
276
+ return new Promise(resolve => {
277
+ let subslug = this.createOrEditForm?.get('host').value
278
+ if (subslug == this.selected?.host || subslug == 'https://') {
279
+ resolve(null);
280
+ return
281
+ }
282
+ this._SiteAdminService.hostExists(subslug).subscribe(res => {
283
+ if (res) {
284
+ resolve({ repetition: this._LocalizationService.instant(`Cms::SiteHost{0}AlreadyExist`, ctrl.value) });
285
+ } else {
286
+ resolve(null);
287
+ }
288
+ })
289
+ });
290
+ };
291
+ }
292
+
293
+ }
@@ -0,0 +1,36 @@
1
+ <div class="mb-2">
2
+ <label class="form-label">{{'Cms::Sites' | abpLocalization}}</label>
3
+ <select class="form-select col-auto" [(ngModel)]="siteId" (change)="siteIdChange()">
4
+ <ng-container *ngFor="let item of siteList">
5
+ <option [value]="item.id">{{item.displayName}}</option>
6
+ </ng-container>
7
+ </select>
8
+ </div>
9
+ <form [formGroup]="_Entity">
10
+ <div formGroupName="formConfiguration">
11
+
12
+ <div class="mb-2">
13
+ <label class="form-label">{{'Cms::Sections' | abpLocalization}}</label>
14
+ <select class="form-select col-auto" formControlName="Entry.SectionId">
15
+ <ng-container *ngFor="let item of SiteOfSectionList">
16
+ <option [value]="item.id">{{item.displayName}}</option>
17
+ </ng-container>
18
+ </select>
19
+ </div>
20
+
21
+ <div class="mb-2">
22
+ <div class="form-check form-check-inline">
23
+ <input class="form-check-input" type="checkbox" formControlName="Entry.Multiple" id="Multiple">
24
+ <label class="form-check-label" for="Multiple">
25
+ {{'Cms::Multiple' | abpLocalization}}
26
+ </label>
27
+ </div>
28
+ </div>
29
+ <div class="mb-2">
30
+ <label class="form-label">{{'Cms::Placeholder' | abpLocalization}}</label>
31
+ <input type="text" class="form-control" formControlName="Entry.Placeholder">
32
+ </div>
33
+ <button type="submit" (abpInit)="submitclick?.nativeElement?.click()" style="display: none;"
34
+ #submitclick></button>
35
+ </div>
36
+ </form>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { EntryConfigComponent } from './entry-config.component';
4
+
5
+ describe('EntryConfigComponent', () => {
6
+ let component: EntryConfigComponent;
7
+ let fixture: ComponentFixture<EntryConfigComponent>;
8
+
9
+ beforeEach(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [EntryConfigComponent]
12
+ });
13
+ fixture = TestBed.createComponent(EntryConfigComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,115 @@
1
+ import { AfterContentInit, Component, ElementRef, Input, ViewChild } from '@angular/core';
2
+ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
3
+ import { EntryConfig } from './entry-config';
4
+ import { SiteAdminService } from '../../../proxy/admin/sites';
5
+ import { SectionAdminService } from '../../../proxy/admin/sections';
6
+ @Component({
7
+ selector: 'cms-entry-config',
8
+ templateUrl: './entry-config.component.html',
9
+ styleUrls: ['./entry-config.component.scss']
10
+ })
11
+ export class EntryConfigComponent implements AfterContentInit{
12
+ constructor(
13
+ private fb: FormBuilder,
14
+ private _SiteAdminService: SiteAdminService,
15
+ private _SectionAdminService: SectionAdminService,
16
+ ) {
17
+ }
18
+ /**表单控件类型 */
19
+ _type: any
20
+ @Input()
21
+ public set type(v: any) {
22
+ if (v == this._type) return
23
+
24
+ this._type = v
25
+ }
26
+ /**表单实体 */
27
+ _Entity: FormGroup | undefined
28
+ @Input()
29
+ public set Entity(v: FormGroup) {
30
+ this._Entity = v;
31
+ }
32
+ /**选择的表单信息 */
33
+ _selected: any
34
+ @Input()
35
+ public set selected(v: any) {
36
+ this._selected = v
37
+ }
38
+ /**语言 */
39
+ _culture: any
40
+ @Input()
41
+ public set culture(v: any) {
42
+ this._culture = v
43
+ }
44
+ get formConfiguration() {
45
+ return this._Entity.get('formConfiguration') as FormGroup
46
+ }
47
+ @ViewChild('submitclick', { static: true }) submitclick: ElementRef;
48
+
49
+ /**站点列表 */
50
+ siteList: any[any] = []
51
+
52
+ /**选择的站点id */
53
+ // siteId: string = ''
54
+ siteId: any = new FormControl('')
55
+ /**站点下的版块 */
56
+ SiteOfSectionList: any[any] = []
57
+
58
+ ngAfterContentInit(): void {
59
+ //Called after ngOnInit when the component's or directive's content has been initialized.
60
+ //Add 'implements AfterContentInit' to the class.
61
+ this.dataLoaded(2)
62
+ }
63
+
64
+ async dataLoaded(val) {
65
+ if (this._Entity && this._type) {
66
+ await this.AfterInit()
67
+ this.submitclick.nativeElement.click();
68
+ }
69
+ }
70
+
71
+ AfterInit() {
72
+ return new Promise(async (resolve, rejects) => {
73
+ this._Entity.setControl('formConfiguration', this.fb.group(new EntryConfig()))
74
+ await this.getsiteList()
75
+ await this.getSiteOfSectionList()
76
+ if (this._selected) {
77
+ this.formConfiguration.patchValue({
78
+ ...this._selected.formConfiguration
79
+ })
80
+ }
81
+ resolve(true)
82
+ })
83
+ }
84
+
85
+ /**获取站点列表 */
86
+ getsiteList() {
87
+ return new Promise((resolve, rejects) => {
88
+ this._SiteAdminService.getList({}).subscribe(res => {
89
+ this.siteList = res.items
90
+ this.siteId = res.items[0]?.id || ''
91
+ resolve(res.items)
92
+ })
93
+ })
94
+ }
95
+ /**获取站点下的版块 */
96
+ getSiteOfSectionList() {
97
+ return new Promise((resolve, rejects) => {
98
+ this._SectionAdminService.getList({
99
+ maxResultCount: 1000,
100
+ siteId: this.siteId
101
+ }).subscribe(res => {
102
+ this.SiteOfSectionList = res.items
103
+ this.formConfiguration.patchValue({
104
+ 'Entry.SectionId': res.items[0]?.id || ''
105
+ })
106
+ resolve(res.items)
107
+ })
108
+ })
109
+ }
110
+
111
+ /**切换站点 */
112
+ async siteIdChange() {
113
+ await this.getSiteOfSectionList()
114
+ }
115
+ }
@@ -0,0 +1,24 @@
1
+ import { FormControl, Validators } from "@angular/forms";
2
+
3
+ export class EntryConfig {
4
+
5
+
6
+ /**多选 */
7
+ 'Entry.Multiple': any = [false, []];
8
+ /**占位符 */
9
+ 'Entry.Placeholder': any = ['', []];
10
+ /**版块id */
11
+ 'Entry.SectionId': any = ['', []];
12
+
13
+ constructor(data?: EntryConfig) {
14
+ if (data) {
15
+ for (const key in data) {
16
+ if (data.hasOwnProperty(key)) {
17
+ this[key] = data[key];
18
+ }
19
+ }
20
+ }
21
+
22
+
23
+ }
24
+ }
@@ -0,0 +1,26 @@
1
+ <form [formGroup]="_entity">
2
+ <div [formGroupName]="_parentFiledName" class="entry-control-page">
3
+ <div class="mb-2">
4
+ <label class="form-label" *ngIf="_fields.displayName">{{ _fields.displayName }}</label>
5
+ <ng-container *ngIf="_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate">
6
+ <div class="form-select">
7
+ <nz-select [nzMaxTagCount]="5" (nzOnSearch)="SelectChange($event)" nzShowSearch nzMode="multiple" [nzPlaceHolder]="_fields.field.formConfiguration['Entry.Placeholder']"
8
+ formControlName="{{_fields.field.name}}">
9
+ <nz-option *ngFor="let item of listOfOption" [nzLabel]="item.title" [nzValue]="item.id"></nz-option>
10
+ </nz-select>
11
+ </div>
12
+ </ng-container>
13
+ <ng-template #elseTemplate>
14
+ <div class="form-select">
15
+ <nz-select nzShowSearch (nzOnSearch)="SelectChange($event)" [nzMaxMultipleCount]="1" nzMode="multiple" [nzPlaceHolder]="_fields.field.formConfiguration['Entry.Placeholder']"
16
+ formControlName="{{_fields.field.name}}">
17
+ <nz-option *ngFor="let item of listOfOption" [nzLabel]="item.title" [nzValue]="item.id"></nz-option>
18
+ </nz-select>
19
+ </div>
20
+ </ng-template>
21
+
22
+ <div class="form-text" *ngIf="_fields.field.description">{{_fields.field.description}}</div>
23
+ </div>
24
+ </div>
25
+ <button type="submit" style="display: none;" #submitclick></button>
26
+ </form>
@@ -0,0 +1,20 @@
1
+
2
+ ::ng-deep .entry-control-page {
3
+ .form-select {
4
+ padding: 0;
5
+ }
6
+ nz-select {
7
+ width: 100%;
8
+ .ant-select-selector {
9
+ background: transparent !important;
10
+ border: none !important;
11
+ padding: 0.275rem 1.25rem !important;
12
+ box-shadow: none !important;
13
+ height: auto !important;
14
+ }
15
+ .anticon-search,.anticon-down{
16
+ display: none;
17
+ }
18
+ }
19
+
20
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { EntryControlComponent } from './entry-control.component';
4
+
5
+ describe('EntryControlComponent', () => {
6
+ let component: EntryControlComponent;
7
+ let fixture: ComponentFixture<EntryControlComponent>;
8
+
9
+ beforeEach(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [EntryControlComponent]
12
+ });
13
+ fixture = TestBed.createComponent(EntryControlComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,110 @@
1
+ import { Component, ElementRef, Input, ViewChild, ViewContainerRef, inject } from '@angular/core';
2
+ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3
+ import { EntryAdminService } from '../../../proxy/admin/entries';
4
+ import { EntryStatus } from '../../../proxy/entries/entry-status.enum';
5
+ import { ActivatedRoute, Router } from '@angular/router';
6
+
7
+
8
+ @Component({
9
+ selector: 'cms-entry-control',
10
+ templateUrl: './entry-control.component.html',
11
+ styleUrls: ['./entry-control.component.scss']
12
+ })
13
+ export class EntryControlComponent {
14
+
15
+
16
+ constructor(
17
+ ) {
18
+ }
19
+ private fb=inject(FormBuilder)
20
+ private _EntryAdminService=inject(EntryAdminService)
21
+
22
+ /**表单实体 */
23
+ _entity: FormGroup | undefined
24
+ @Input()
25
+ public set entity(v: any) {
26
+ this._entity = v;
27
+
28
+ if (v) this.dataLoaded()
29
+ }
30
+
31
+ /**字段配置列表 */
32
+ _fields: any = ''
33
+ @Input()
34
+ public set fields(v: any) {
35
+ this._fields = v;
36
+ if (v) this.dataLoaded()
37
+ }
38
+
39
+ /**父级字段名称,用于为表单设置控件赋值 */
40
+ _parentFiledName: any
41
+ @Input()
42
+ public set parentFiledName(v: any) {
43
+ this._parentFiledName = v;
44
+ if (v) this.dataLoaded()
45
+ }
46
+ /**父级字段名称,用于为表单设置控件赋值 */
47
+ _selected: any
48
+ @Input()
49
+ public set selected(v: any) {
50
+ this._selected = v || [];
51
+ if (v) this.dataLoaded()
52
+ }
53
+ /**语言 */
54
+ _culture: any
55
+ @Input()
56
+ public set culture(v: any) {
57
+ if (v) {
58
+ this._culture = v ;
59
+ this.dataLoaded()
60
+ }
61
+ }
62
+ @ViewChild('submitclick', { static: true }) submitclick: ElementRef;
63
+
64
+ extraProperties: FormGroup | undefined
65
+
66
+ /** */
67
+ listOfOption: any[] = [];
68
+ async dataLoaded() {
69
+ if (this._fields && this._entity && this._parentFiledName&&this._culture) {
70
+ await this.AfterInit()
71
+ await this.getEntryAssignList()
72
+ this.submitclick.nativeElement.click();
73
+ }
74
+ }
75
+
76
+ AfterInit() {
77
+ return new Promise((resolve, rejects) => {
78
+ let ValidatorsArray = []
79
+ if (this._fields.required) {
80
+ ValidatorsArray.push(Validators.required)
81
+ }
82
+ let newControl = this.fb.control(this._selected, ValidatorsArray)
83
+ let extraProperties = this._entity.get(this._parentFiledName) as FormGroup
84
+ extraProperties.setControl(this._fields.field.name, newControl)
85
+ resolve(true)
86
+ })
87
+ }
88
+
89
+ /**获取对应的条目 */
90
+ getEntryAssignList(filter = '') {
91
+ return new Promise((resolve, rejects) => {
92
+ this._EntryAdminService.getList({
93
+ culture: this._culture,
94
+ sectionId: this._fields.field.formConfiguration['Entry.SectionId'],
95
+ skipCount: 0,
96
+ maxResultCount: 30,
97
+ status: EntryStatus.Published,
98
+ filter: filter
99
+ }).subscribe(res => {
100
+ this.listOfOption = res.items
101
+ resolve(true)
102
+ })
103
+ })
104
+ }
105
+
106
+ /** */
107
+ async SelectChange(event) {
108
+ await this.getEntryAssignList(event)
109
+ }
110
+ }
@@ -0,0 +1,3 @@
1
+ export * from './entry-config'
2
+ export * from './entry-config.component'
3
+ export * from './entry-control.component'