@dignite-ng/expand.cms 0.0.52 → 0.0.53

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 (448) hide show
  1. package/config/cms-config.module.d.ts +8 -0
  2. package/config/components/domains/domains.component.d.ts +29 -0
  3. package/config/components/site-language/site-language.component.d.ts +29 -0
  4. package/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
  5. package/config/enums/route-names.d.ts +8 -0
  6. package/config/index.d.ts +5 -0
  7. package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
  8. package/config/providers/route.provider.d.ts +9 -0
  9. package/config/proxy/admin/domains/domain-admin.service.d.ts +13 -0
  10. package/config/{src/proxy/dignite/cms/admin/domains/models.ts → proxy/admin/domains/models.d.ts} +7 -9
  11. package/config/proxy/dignite/cms/admin/sites/models.d.ts +4 -0
  12. package/config/proxy/dignite/cms/admin/sites/site-admin.service.d.ts +13 -0
  13. package/config/proxy/dignite/cms/sites/models.d.ts +4 -0
  14. package/config/{src/public-api.ts → public-api.d.ts} +3 -3
  15. package/config/services/validators.service.d.ts +16 -0
  16. package/esm2022/config/cms-config.module.mjs +18 -0
  17. package/esm2022/config/components/domains/domains.component.mjs +102 -0
  18. package/esm2022/config/components/site-language/site-language.component.mjs +108 -0
  19. package/esm2022/config/dignite-ng-expand.cms-config.mjs +5 -0
  20. package/esm2022/config/enums/index.mjs +2 -0
  21. package/esm2022/config/enums/route-names.mjs +10 -0
  22. package/esm2022/config/providers/index.mjs +2 -0
  23. package/esm2022/config/providers/route.provider.mjs +74 -0
  24. package/esm2022/config/proxy/admin/domains/domain-admin.service.mjs +32 -0
  25. package/esm2022/config/proxy/admin/domains/index.mjs +3 -0
  26. package/esm2022/config/proxy/admin/domains/models.mjs +2 -0
  27. package/esm2022/config/proxy/dignite/cms/admin/sites/index.mjs +3 -0
  28. package/esm2022/config/proxy/dignite/cms/admin/sites/models.mjs +2 -0
  29. package/esm2022/config/proxy/dignite/cms/admin/sites/site-admin.service.mjs +27 -0
  30. package/esm2022/config/proxy/dignite/cms/sites/models.mjs +2 -0
  31. package/esm2022/config/public-api.mjs +4 -0
  32. package/esm2022/config/services/validators.service.mjs +83 -0
  33. package/esm2022/dignite-ng-expand.cms.mjs +5 -0
  34. package/esm2022/lib/cms-routing.module.mjs +94 -0
  35. package/esm2022/lib/cms.module.mjs +130 -0
  36. package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +303 -0
  37. package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +32 -0
  38. package/esm2022/lib/components/admin/entries/create.component.mjs +109 -0
  39. package/esm2022/lib/components/admin/entries/edit.component.mjs +110 -0
  40. package/esm2022/lib/components/admin/entries/entries.component.mjs +198 -0
  41. package/esm2022/lib/components/admin/entries/index.mjs +5 -0
  42. package/esm2022/lib/components/admin/fields/create-field.component.mjs +80 -0
  43. package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +112 -0
  44. package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +25 -0
  45. package/esm2022/lib/components/admin/fields/edit-field.component.mjs +103 -0
  46. package/esm2022/lib/components/admin/fields/field-group.component.mjs +131 -0
  47. package/esm2022/lib/components/admin/fields/fields.component.mjs +109 -0
  48. package/esm2022/lib/components/admin/fields/index.mjs +7 -0
  49. package/esm2022/lib/components/admin/index.mjs +4 -0
  50. package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +27 -0
  51. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +71 -0
  52. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +389 -0
  53. package/esm2022/lib/components/admin/sections/entry-types/index.mjs +3 -0
  54. package/esm2022/lib/components/admin/sections/index.mjs +4 -0
  55. package/esm2022/lib/components/admin/sections/sections.component.mjs +292 -0
  56. package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +112 -0
  57. package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +18 -0
  58. package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +105 -0
  59. package/esm2022/lib/components/dynamic-form/entry/index.mjs +4 -0
  60. package/esm2022/lib/components/dynamic-form/form-control-group.mjs +28 -0
  61. package/esm2022/lib/components/dynamic-form/index.mjs +5 -0
  62. package/esm2022/lib/components/dynamic-form/matrix/index.mjs +4 -0
  63. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +214 -0
  64. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +50 -0
  65. package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +98 -0
  66. package/esm2022/lib/components/dynamic-form/table/index.mjs +4 -0
  67. package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +151 -0
  68. package/esm2022/lib/components/dynamic-form/table/table-config.mjs +38 -0
  69. package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +105 -0
  70. package/esm2022/lib/components/index.mjs +3 -0
  71. package/esm2022/lib/constants/styles.mjs +21 -0
  72. package/esm2022/lib/enums/ecms-component.mjs +13 -0
  73. package/esm2022/lib/enums/index.mjs +2 -0
  74. package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +22 -0
  75. package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +3 -0
  76. package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +2 -0
  77. package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +70 -0
  78. package/esm2022/lib/proxy/admin/entries/index.mjs +3 -0
  79. package/esm2022/lib/proxy/admin/entries/models.mjs +2 -0
  80. package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +45 -0
  81. package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +41 -0
  82. package/esm2022/lib/proxy/admin/fields/index.mjs +4 -0
  83. package/esm2022/lib/proxy/admin/fields/models.mjs +2 -0
  84. package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +41 -0
  85. package/esm2022/lib/proxy/admin/sections/index.mjs +4 -0
  86. package/esm2022/lib/proxy/admin/sections/models.mjs +2 -0
  87. package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +51 -0
  88. package/esm2022/lib/proxy/admin/settings/index.mjs +2 -0
  89. package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +31 -0
  90. package/esm2022/lib/proxy/dignite/abp/data/models.mjs +2 -0
  91. package/esm2022/lib/proxy/entries/entry-status.enum.mjs +8 -0
  92. package/esm2022/lib/proxy/entries/index.mjs +2 -0
  93. package/esm2022/lib/proxy/fields/models.mjs +2 -0
  94. package/esm2022/lib/proxy/sections/index.mjs +3 -0
  95. package/esm2022/lib/proxy/sections/models.mjs +2 -0
  96. package/esm2022/lib/proxy/sections/section-type.enum.mjs +9 -0
  97. package/esm2022/lib/proxy/settings/models.mjs +2 -0
  98. package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +2 -0
  99. package/esm2022/lib/resolvers/extensions-props-action-token.resolver.mjs +132 -0
  100. package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +160 -0
  101. package/esm2022/lib/services/appent-content.mjs +15 -0
  102. package/esm2022/lib/services/cms-api.service.mjs +78 -0
  103. package/esm2022/lib/services/cms.service.mjs +21 -0
  104. package/esm2022/lib/services/field-abstracts.service.mjs +42 -0
  105. package/esm2022/lib/services/index.mjs +5 -0
  106. package/esm2022/lib/services/simple-reuse-strategy.mjs +64 -0
  107. package/esm2022/lib/services/update-list.service.mjs +19 -0
  108. package/esm2022/lib/services/validators.service.mjs +85 -0
  109. package/esm2022/public-api.mjs +6 -0
  110. package/fesm2022/dignite-ng-expand.cms-config.mjs +428 -0
  111. package/fesm2022/dignite-ng-expand.cms-config.mjs.map +1 -0
  112. package/fesm2022/dignite-ng-expand.cms.mjs +3915 -0
  113. package/fesm2022/dignite-ng-expand.cms.mjs.map +1 -0
  114. package/index.d.ts +5 -0
  115. package/lib/cms-routing.module.d.ts +7 -0
  116. package/lib/cms.module.d.ts +34 -0
  117. package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +96 -0
  118. package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +23 -0
  119. package/lib/components/admin/entries/create.component.d.ts +47 -0
  120. package/lib/components/admin/entries/edit.component.d.ts +47 -0
  121. package/lib/components/admin/entries/entries.component.d.ts +66 -0
  122. package/lib/components/admin/entries/index.d.ts +4 -0
  123. package/lib/components/admin/fields/create-field.component.d.ts +37 -0
  124. package/lib/components/admin/fields/create-or-edit-field.component.d.ts +38 -0
  125. package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +16 -0
  126. package/lib/components/admin/fields/edit-field.component.d.ts +46 -0
  127. package/lib/components/admin/fields/field-group.component.d.ts +58 -0
  128. package/lib/components/admin/fields/fields.component.d.ts +35 -0
  129. package/lib/components/admin/fields/index.d.ts +6 -0
  130. package/lib/components/admin/index.d.ts +3 -0
  131. package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +17 -0
  132. package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +38 -0
  133. package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +138 -0
  134. package/lib/components/admin/sections/entry-types/index.d.ts +2 -0
  135. package/lib/components/admin/sections/index.d.ts +3 -0
  136. package/lib/components/admin/sections/sections.component.d.ts +64 -0
  137. package/lib/components/dynamic-form/entry/entry-config.component.d.ts +39 -0
  138. package/lib/components/dynamic-form/entry/entry-config.d.ts +9 -0
  139. package/lib/components/dynamic-form/entry/entry-control.component.d.ts +35 -0
  140. package/lib/components/dynamic-form/entry/index.d.ts +3 -0
  141. package/lib/components/dynamic-form/form-control-group.d.ts +4 -0
  142. package/lib/components/dynamic-form/index.d.ts +4 -0
  143. package/lib/components/dynamic-form/matrix/index.d.ts +3 -0
  144. package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +73 -0
  145. package/lib/components/dynamic-form/matrix/matrix-config.d.ts +24 -0
  146. package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +39 -0
  147. package/lib/components/dynamic-form/table/index.d.ts +3 -0
  148. package/lib/components/dynamic-form/table/table-config.component.d.ts +58 -0
  149. package/lib/components/dynamic-form/table/table-config.d.ts +18 -0
  150. package/lib/components/dynamic-form/table/table-control.component.d.ts +39 -0
  151. package/lib/components/index.d.ts +2 -0
  152. package/lib/constants/styles.d.ts +2 -0
  153. package/lib/enums/ecms-component.d.ts +11 -0
  154. package/lib/enums/index.d.ts +1 -0
  155. package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +12 -0
  156. package/lib/proxy/admin/dynamic-forms/models.d.ts +4 -0
  157. package/lib/proxy/admin/entries/entry-admin.service.d.ts +22 -0
  158. package/lib/proxy/admin/entries/models.d.ts +60 -0
  159. package/lib/proxy/admin/fields/field-admin.service.d.ts +17 -0
  160. package/lib/proxy/admin/fields/field-group-admin.service.d.ts +16 -0
  161. package/{src/lib/proxy/admin/fields/models.ts → lib/proxy/admin/fields/models.d.ts} +34 -42
  162. package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +15 -0
  163. package/{src/lib/proxy/admin/sections/models.ts → lib/proxy/admin/sections/models.d.ts} +67 -81
  164. package/lib/proxy/admin/sections/section-admin.service.d.ts +18 -0
  165. package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +13 -0
  166. package/lib/proxy/dignite/abp/data/models.d.ts +3 -0
  167. package/lib/proxy/entries/entry-status.enum.d.ts +5 -0
  168. package/lib/proxy/fields/models.d.ts +8 -0
  169. package/lib/proxy/sections/models.d.ts +12 -0
  170. package/lib/proxy/sections/section-type.enum.d.ts +6 -0
  171. package/lib/proxy/settings/models.d.ts +5 -0
  172. package/{src/lib/proxy/volo/cms-kit/users/models.ts → lib/proxy/volo/cms-kit/users/models.d.ts} +7 -8
  173. package/lib/resolvers/extensions-props-action-token.resolver.d.ts +71 -0
  174. package/lib/resolvers/page-default-toolbar-actions.d.ts +18 -0
  175. package/lib/services/appent-content.d.ts +1 -0
  176. package/lib/services/cms-api.service.d.ts +20 -0
  177. package/lib/services/cms.service.d.ts +10 -0
  178. package/lib/services/field-abstracts.service.d.ts +20 -0
  179. package/lib/services/index.d.ts +4 -0
  180. package/lib/services/simple-reuse-strategy.d.ts +13 -0
  181. package/lib/services/update-list.service.d.ts +9 -0
  182. package/lib/services/validators.service.d.ts +17 -0
  183. package/package.json +22 -7
  184. package/{src/public-api.ts → public-api.d.ts} +2 -6
  185. package/config/ng-package.json +0 -6
  186. package/config/src/cms-config.module.ts +0 -12
  187. package/config/src/components/domains/domains.component.html +0 -17
  188. package/config/src/components/domains/domains.component.scss +0 -0
  189. package/config/src/components/domains/domains.component.spec.ts +0 -21
  190. package/config/src/components/domains/domains.component.ts +0 -109
  191. package/config/src/components/site-language/site-language.component.html +0 -31
  192. package/config/src/components/site-language/site-language.component.scss +0 -0
  193. package/config/src/components/site-language/site-language.component.spec.ts +0 -21
  194. package/config/src/components/site-language/site-language.component.ts +0 -117
  195. package/config/src/enums/route-names.ts +0 -8
  196. package/config/src/providers/route.provider.ts +0 -82
  197. package/config/src/proxy/admin/domains/domain-admin.service.ts +0 -38
  198. package/config/src/proxy/admin/domains/models.ts +0 -9
  199. package/config/src/proxy/dignite/abp/data/index.ts +0 -1
  200. package/config/src/proxy/dignite/abp/data/models.ts +0 -4
  201. package/config/src/proxy/dignite/abp/index.ts +0 -2
  202. package/config/src/proxy/dignite/cms/admin/domains/domain-admin.service.ts +0 -47
  203. package/config/src/proxy/dignite/cms/admin/domains/index.ts +0 -2
  204. package/config/src/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +0 -21
  205. package/config/src/proxy/dignite/cms/admin/dynamic-forms/models.ts +0 -5
  206. package/config/src/proxy/dignite/cms/admin/entries/entry-admin.service.ts +0 -109
  207. package/config/src/proxy/dignite/cms/admin/entries/models.ts +0 -68
  208. package/config/src/proxy/dignite/cms/admin/fields/field-admin.service.ts +0 -64
  209. package/config/src/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +0 -56
  210. package/config/src/proxy/dignite/cms/admin/fields/models.ts +0 -42
  211. package/config/src/proxy/dignite/cms/admin/index.ts +0 -7
  212. package/config/src/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +0 -55
  213. package/config/src/proxy/dignite/cms/admin/sections/models.ts +0 -81
  214. package/config/src/proxy/dignite/cms/admin/sections/section-admin.service.ts +0 -74
  215. package/config/src/proxy/dignite/cms/admin/sites/models.ts +0 -5
  216. package/config/src/proxy/dignite/cms/admin/sites/site-admin.service.ts +0 -30
  217. package/config/src/proxy/dignite/cms/entries/entry-status.enum.ts +0 -8
  218. package/config/src/proxy/dignite/cms/fields/index.ts +0 -1
  219. package/config/src/proxy/dignite/cms/fields/models.ts +0 -9
  220. package/config/src/proxy/dignite/cms/index.ts +0 -6
  221. package/config/src/proxy/dignite/cms/sections/models.ts +0 -14
  222. package/config/src/proxy/dignite/cms/sections/section-type.enum.ts +0 -9
  223. package/config/src/proxy/dignite/cms/sites/index.ts +0 -1
  224. package/config/src/proxy/dignite/cms/sites/models.ts +0 -5
  225. package/config/src/proxy/dignite/cms-kit/admin/brand/brand-admin.service.ts +0 -21
  226. package/config/src/proxy/dignite/cms-kit/admin/brand/index.ts +0 -2
  227. package/config/src/proxy/dignite/cms-kit/admin/brand/models.ts +0 -7
  228. package/config/src/proxy/dignite/cms-kit/admin/index.ts +0 -2
  229. package/config/src/proxy/dignite/cms-kit/brand/brand.service.ts +0 -20
  230. package/config/src/proxy/dignite/cms-kit/brand/index.ts +0 -2
  231. package/config/src/proxy/dignite/cms-kit/brand/models.ts +0 -7
  232. package/config/src/proxy/dignite/cms-kit/index.ts +0 -3
  233. package/config/src/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  234. package/config/src/proxy/dignite/file-explorer/directories/index.ts +0 -2
  235. package/config/src/proxy/dignite/file-explorer/directories/models.ts +0 -35
  236. package/config/src/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -101
  237. package/config/src/proxy/dignite/file-explorer/files/index.ts +0 -2
  238. package/config/src/proxy/dignite/file-explorer/files/models.ts +0 -61
  239. package/config/src/proxy/dignite/file-explorer/index.ts +0 -3
  240. package/config/src/proxy/dignite/index.ts +0 -6
  241. package/config/src/proxy/dignite/travely/areas/index.ts +0 -1
  242. package/config/src/proxy/dignite/travely/areas/models.ts +0 -5
  243. package/config/src/proxy/dignite/travely/common/index.ts +0 -1
  244. package/config/src/proxy/dignite/travely/common/models.ts +0 -5
  245. package/config/src/proxy/dignite/travely/entity-snapshots/index.ts +0 -1
  246. package/config/src/proxy/dignite/travely/entity-snapshots/models.ts +0 -7
  247. package/config/src/proxy/dignite/travely/guides/index.ts +0 -1
  248. package/config/src/proxy/dignite/travely/guides/models.ts +0 -26
  249. package/config/src/proxy/dignite/travely/index.ts +0 -9
  250. package/config/src/proxy/dignite/travely/merchants/index.ts +0 -1
  251. package/config/src/proxy/dignite/travely/merchants/models.ts +0 -9
  252. package/config/src/proxy/dignite/travely/orders/index.ts +0 -1
  253. package/config/src/proxy/dignite/travely/orders/models.ts +0 -52
  254. package/config/src/proxy/dignite/travely/payment/index.ts +0 -1
  255. package/config/src/proxy/dignite/travely/payment/models.ts +0 -9
  256. package/config/src/proxy/dignite/travely/tours/booking-time-type.enum.ts +0 -9
  257. package/config/src/proxy/dignite/travely/tours/index.ts +0 -5
  258. package/config/src/proxy/dignite/travely/tours/models.ts +0 -77
  259. package/config/src/proxy/dignite/travely/tours/period-type.enum.ts +0 -9
  260. package/config/src/proxy/dignite/travely/tours/tour-recommendation-rank.enum.ts +0 -12
  261. package/config/src/proxy/dignite/travely/tours/tourist-type.enum.ts +0 -8
  262. package/config/src/proxy/microsoft/asp-net-core/index.ts +0 -2
  263. package/config/src/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
  264. package/config/src/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
  265. package/config/src/proxy/microsoft/extensions/index.ts +0 -2
  266. package/config/src/proxy/microsoft/extensions/primitives/index.ts +0 -1
  267. package/config/src/proxy/microsoft/extensions/primitives/models.ts +0 -9
  268. package/config/src/proxy/microsoft/index.ts +0 -4
  269. package/config/src/proxy/microsoft/net/http/headers/index.ts +0 -1
  270. package/config/src/proxy/microsoft/net/http/headers/models.ts +0 -7
  271. package/config/src/proxy/microsoft/net/http/index.ts +0 -2
  272. package/config/src/proxy/microsoft/net/index.ts +0 -2
  273. package/config/src/services/validators.service.ts +0 -80
  274. package/ng-package.json +0 -10
  275. package/src/lib/cms-routing.module.ts +0 -102
  276. package/src/lib/cms.module.ts +0 -109
  277. package/src/lib/components/admin/entries/create-or-edit-entries.component.html +0 -137
  278. package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +0 -1
  279. package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +0 -21
  280. package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +0 -318
  281. package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +0 -33
  282. package/src/lib/components/admin/entries/create.component.html +0 -13
  283. package/src/lib/components/admin/entries/create.component.scss +0 -1
  284. package/src/lib/components/admin/entries/create.component.spec.ts +0 -21
  285. package/src/lib/components/admin/entries/create.component.ts +0 -110
  286. package/src/lib/components/admin/entries/edit.component.html +0 -9
  287. package/src/lib/components/admin/entries/edit.component.scss +0 -1
  288. package/src/lib/components/admin/entries/edit.component.spec.ts +0 -21
  289. package/src/lib/components/admin/entries/edit.component.ts +0 -111
  290. package/src/lib/components/admin/entries/entries.component.html +0 -112
  291. package/src/lib/components/admin/entries/entries.component.scss +0 -1
  292. package/src/lib/components/admin/entries/entries.component.spec.ts +0 -21
  293. package/src/lib/components/admin/entries/entries.component.ts +0 -216
  294. package/src/lib/components/admin/entries/index.ts +0 -4
  295. package/src/lib/components/admin/fields/create-field.component.html +0 -12
  296. package/src/lib/components/admin/fields/create-field.component.scss +0 -1
  297. package/src/lib/components/admin/fields/create-field.component.spec.ts +0 -21
  298. package/src/lib/components/admin/fields/create-field.component.ts +0 -82
  299. package/src/lib/components/admin/fields/create-or-edit-field.component.html +0 -40
  300. package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
  301. package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +0 -21
  302. package/src/lib/components/admin/fields/create-or-edit-field.component.ts +0 -121
  303. package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +0 -33
  304. package/src/lib/components/admin/fields/edit-field.component.html +0 -16
  305. package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
  306. package/src/lib/components/admin/fields/edit-field.component.spec.ts +0 -21
  307. package/src/lib/components/admin/fields/edit-field.component.ts +0 -101
  308. package/src/lib/components/admin/fields/field-group.component.html +0 -69
  309. package/src/lib/components/admin/fields/field-group.component.scss +0 -0
  310. package/src/lib/components/admin/fields/field-group.component.spec.ts +0 -21
  311. package/src/lib/components/admin/fields/field-group.component.ts +0 -151
  312. package/src/lib/components/admin/fields/fields.component.html +0 -74
  313. package/src/lib/components/admin/fields/fields.component.scss +0 -1
  314. package/src/lib/components/admin/fields/fields.component.spec.ts +0 -21
  315. package/src/lib/components/admin/fields/fields.component.ts +0 -109
  316. package/src/lib/components/admin/fields/index.ts +0 -6
  317. package/src/lib/components/admin/index.ts +0 -3
  318. package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +0 -32
  319. package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +0 -79
  320. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +0 -187
  321. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +0 -1
  322. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +0 -21
  323. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +0 -424
  324. package/src/lib/components/admin/sections/entry-types/index.ts +0 -2
  325. package/src/lib/components/admin/sections/index.ts +0 -3
  326. package/src/lib/components/admin/sections/sections.component.html +0 -188
  327. package/src/lib/components/admin/sections/sections.component.scss +0 -1
  328. package/src/lib/components/admin/sections/sections.component.spec.ts +0 -21
  329. package/src/lib/components/admin/sections/sections.component.ts +0 -302
  330. package/src/lib/components/dynamic-form/entry/entry-config.component.html +0 -36
  331. package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -27
  332. package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +0 -21
  333. package/src/lib/components/dynamic-form/entry/entry-config.component.ts +0 -114
  334. package/src/lib/components/dynamic-form/entry/entry-config.ts +0 -24
  335. package/src/lib/components/dynamic-form/entry/entry-control.component.html +0 -26
  336. package/src/lib/components/dynamic-form/entry/entry-control.component.scss +0 -1
  337. package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +0 -21
  338. package/src/lib/components/dynamic-form/entry/entry-control.component.ts +0 -111
  339. package/src/lib/components/dynamic-form/entry/index.ts +0 -3
  340. package/src/lib/components/dynamic-form/form-control-group.ts +0 -27
  341. package/src/lib/components/dynamic-form/index.ts +0 -4
  342. package/src/lib/components/dynamic-form/matrix/index.ts +0 -3
  343. package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +0 -148
  344. package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
  345. package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +0 -21
  346. package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +0 -239
  347. package/src/lib/components/dynamic-form/matrix/matrix-config.ts +0 -63
  348. package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +0 -42
  349. package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
  350. package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +0 -21
  351. package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +0 -106
  352. package/src/lib/components/dynamic-form/table/index.ts +0 -3
  353. package/src/lib/components/dynamic-form/table/table-config.component.html +0 -85
  354. package/src/lib/components/dynamic-form/table/table-config.component.scss +0 -10
  355. package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +0 -21
  356. package/src/lib/components/dynamic-form/table/table-config.component.ts +0 -170
  357. package/src/lib/components/dynamic-form/table/table-config.ts +0 -45
  358. package/src/lib/components/dynamic-form/table/table-control.component.html +0 -54
  359. package/src/lib/components/dynamic-form/table/table-control.component.scss +0 -1
  360. package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +0 -21
  361. package/src/lib/components/dynamic-form/table/table-control.component.ts +0 -114
  362. package/src/lib/components/index.ts +0 -2
  363. package/src/lib/constants/index.ts +0 -1
  364. package/src/lib/constants/styles.ts +0 -20
  365. package/src/lib/enums/ecms-component.ts +0 -11
  366. package/src/lib/enums/index.ts +0 -1
  367. package/src/lib/proxy/README.md +0 -17
  368. package/src/lib/proxy/admin/domains/domain-admin.service.ts +0 -38
  369. package/src/lib/proxy/admin/domains/index.ts +0 -2
  370. package/src/lib/proxy/admin/domains/models.ts +0 -9
  371. package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +0 -21
  372. package/src/lib/proxy/admin/dynamic-forms/index.ts +0 -2
  373. package/src/lib/proxy/admin/dynamic-forms/models.ts +0 -5
  374. package/src/lib/proxy/admin/entries/entry-admin.service.ts +0 -109
  375. package/src/lib/proxy/admin/entries/index.ts +0 -2
  376. package/src/lib/proxy/admin/entries/models.ts +0 -68
  377. package/src/lib/proxy/admin/fields/field-admin.service.ts +0 -64
  378. package/src/lib/proxy/admin/fields/field-group-admin.service.ts +0 -56
  379. package/src/lib/proxy/admin/fields/index.ts +0 -3
  380. package/src/lib/proxy/admin/index.ts +0 -7
  381. package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +0 -55
  382. package/src/lib/proxy/admin/sections/index.ts +0 -3
  383. package/src/lib/proxy/admin/sections/section-admin.service.ts +0 -74
  384. package/src/lib/proxy/admin/settings/site-settings-admin.service.ts +0 -37
  385. package/src/lib/proxy/dignite/abp/data/index.ts +0 -1
  386. package/src/lib/proxy/dignite/abp/data/models.ts +0 -4
  387. package/src/lib/proxy/dignite/abp/index.ts +0 -2
  388. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  389. package/src/lib/proxy/dignite/file-explorer/directories/index.ts +0 -2
  390. package/src/lib/proxy/dignite/file-explorer/directories/models.ts +0 -35
  391. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
  392. package/src/lib/proxy/dignite/file-explorer/files/index.ts +0 -2
  393. package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
  394. package/src/lib/proxy/dignite/file-explorer/index.ts +0 -3
  395. package/src/lib/proxy/dignite/index.ts +0 -3
  396. package/src/lib/proxy/entries/entry-status.enum.ts +0 -8
  397. package/src/lib/proxy/entries/index.ts +0 -1
  398. package/src/lib/proxy/fields/index.ts +0 -1
  399. package/src/lib/proxy/fields/models.ts +0 -9
  400. package/src/lib/proxy/generate-proxy.json +0 -11425
  401. package/src/lib/proxy/index.ts +0 -9
  402. package/src/lib/proxy/microsoft/asp-net-core/index.ts +0 -2
  403. package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
  404. package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
  405. package/src/lib/proxy/microsoft/extensions/index.ts +0 -2
  406. package/src/lib/proxy/microsoft/extensions/primitives/index.ts +0 -1
  407. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
  408. package/src/lib/proxy/microsoft/index.ts +0 -4
  409. package/src/lib/proxy/microsoft/net/http/headers/index.ts +0 -1
  410. package/src/lib/proxy/microsoft/net/http/headers/models.ts +0 -7
  411. package/src/lib/proxy/microsoft/net/http/index.ts +0 -2
  412. package/src/lib/proxy/microsoft/net/index.ts +0 -2
  413. package/src/lib/proxy/sections/index.ts +0 -2
  414. package/src/lib/proxy/sections/models.ts +0 -14
  415. package/src/lib/proxy/sections/section-type.enum.ts +0 -9
  416. package/src/lib/proxy/settings/index.ts +0 -1
  417. package/src/lib/proxy/settings/models.ts +0 -6
  418. package/src/lib/proxy/volo/abp/content/index.ts +0 -1
  419. package/src/lib/proxy/volo/abp/content/models.ts +0 -6
  420. package/src/lib/proxy/volo/abp/index.ts +0 -2
  421. package/src/lib/proxy/volo/cms-kit/index.ts +0 -2
  422. package/src/lib/proxy/volo/cms-kit/users/index.ts +0 -1
  423. package/src/lib/proxy/volo/index.ts +0 -3
  424. package/src/lib/resolvers/extensions-props-action-token.resolver.ts +0 -178
  425. package/src/lib/resolvers/page-default-toolbar-actions.ts +0 -170
  426. package/src/lib/resolvers/table-default-entity-actions.ts +0 -24
  427. package/src/lib/resolvers/table-default-entity-props.ts +0 -36
  428. package/src/lib/services/appent-content.ts +0 -13
  429. package/src/lib/services/cms-api.service.ts +0 -71
  430. package/src/lib/services/cms.service.ts +0 -18
  431. package/src/lib/services/field-abstracts.service.ts +0 -40
  432. package/src/lib/services/index.ts +0 -4
  433. package/src/lib/services/simple-reuse-strategy.ts +0 -74
  434. package/src/lib/services/update-list.service.ts +0 -15
  435. package/src/lib/services/validators.service.ts +0 -82
  436. package/src/test.ts +0 -26
  437. package/tsconfig.lib.json +0 -16
  438. package/tsconfig.lib.prod.json +0 -10
  439. package/tsconfig.spec.json +0 -17
  440. /package/config/{src/proxy/admin/domains/index.ts → proxy/admin/domains/index.d.ts} +0 -0
  441. /package/config/{src/proxy/dignite/cms/admin/sites/index.ts → proxy/dignite/cms/admin/sites/index.d.ts} +0 -0
  442. /package/{config/src/proxy/dignite/cms/admin/dynamic-forms/index.ts → lib/proxy/admin/dynamic-forms/index.d.ts} +0 -0
  443. /package/{config/src/proxy/dignite/cms/admin/entries/index.ts → lib/proxy/admin/entries/index.d.ts} +0 -0
  444. /package/{config/src/proxy/dignite/cms/admin/fields/index.ts → lib/proxy/admin/fields/index.d.ts} +0 -0
  445. /package/{config/src/proxy/dignite/cms/admin/sections/index.ts → lib/proxy/admin/sections/index.d.ts} +0 -0
  446. /package/{src/lib/proxy/admin/settings/index.ts → lib/proxy/admin/settings/index.d.ts} +0 -0
  447. /package/{config/src/proxy/dignite/cms/entries/index.ts → lib/proxy/entries/index.d.ts} +0 -0
  448. /package/{config/src/proxy/dignite/cms/sections/index.ts → lib/proxy/sections/index.d.ts} +0 -0
@@ -0,0 +1,3915 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, inject, Component, ViewContainerRef, Input, ViewChildren, ViewChild, Output, RendererFactory2, InjectionToken, NgModule } from '@angular/core';
3
+ import * as i1 from '@abp/ng.core';
4
+ import { mapEnumToOptions, ListService, ConfigStateService, LIST_QUERY_DEBOUNCE_TIME, LocalizationService, AuthGuard, PermissionGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
5
+ import * as i3 from '@abp/ng.theme.shared';
6
+ import { ToasterService, ThemeSharedModule } from '@abp/ng.theme.shared';
7
+ import * as i3$1 from '@angular/router';
8
+ import { RouterModule } from '@angular/router';
9
+ import { EXTENSIONS_IDENTIFIER, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps } from '@abp/ng.components/extensible';
10
+ import * as i1$1 from '@angular/forms';
11
+ import { FormBuilder, Validators, FormGroup, FormControl, FormArray, FormsModule } from '@angular/forms';
12
+ import * as i8 from '@swimlane/ngx-datatable';
13
+ import { ColumnMode } from '@swimlane/ngx-datatable';
14
+ import { finalize, map, tap } from 'rxjs';
15
+ import * as i2 from '@angular/common';
16
+ import * as i9 from '@ngx-validate/core';
17
+ import * as i10 from '@ng-bootstrap/ng-bootstrap';
18
+ import { NgbNavModule, NgbAccordionModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
19
+ import * as i8$1 from '@abp/ng.components/page';
20
+ import { PageModule } from '@abp/ng.components/page';
21
+ import { pinyin } from 'pinyin-pro';
22
+ import * as i1$2 from '@angular/platform-browser';
23
+ import * as i8$2 from '@dignite-ng/expand.dynamic-form';
24
+ import { DynamicFormModule } from '@dignite-ng/expand.dynamic-form';
25
+ import { finalize as finalize$1 } from 'rxjs/operators';
26
+ import * as i4 from 'ng-zorro-antd/select';
27
+ import { NzSelectModule } from 'ng-zorro-antd/select';
28
+ import { fielFieldControlGroup } from '@dignite-ng/expand.file-explorer';
29
+ import { ckEditorFieldControlGroup } from '@dignite-ng/expand.ck-editor';
30
+
31
+ class SiteSettingsAdminService {
32
+ constructor(restService) {
33
+ this.restService = restService;
34
+ this.apiName = 'CmsAdmin';
35
+ this.getAllLanguages = (config) => this.restService.request({
36
+ method: 'GET',
37
+ url: '/api/cms-admin/site-settings/all-languages',
38
+ }, { apiName: this.apiName, ...config });
39
+ this.getBrand = (config) => this.restService.request({
40
+ method: 'GET',
41
+ url: '/api/cms-admin/site-settings/brand',
42
+ }, { apiName: this.apiName, ...config });
43
+ this.getDefaultLanguage = (config) => this.restService.request({
44
+ method: 'GET',
45
+ responseType: 'text',
46
+ url: '/api/cms-admin/site-settings/default-language',
47
+ }, { apiName: this.apiName, ...config });
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, providedIn: 'root' }); }
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, decorators: [{
53
+ type: Injectable,
54
+ args: [{
55
+ providedIn: 'root',
56
+ }]
57
+ }], ctorParameters: () => [{ type: i1.RestService }] });
58
+
59
+ var EntryStatus;
60
+ (function (EntryStatus) {
61
+ EntryStatus[EntryStatus["Draft"] = 0] = "Draft";
62
+ EntryStatus[EntryStatus["Published"] = 1] = "Published";
63
+ })(EntryStatus || (EntryStatus = {}));
64
+ const entryStatusOptions = mapEnumToOptions(EntryStatus);
65
+
66
+ var ECmsComponent;
67
+ (function (ECmsComponent) {
68
+ ECmsComponent["Entries"] = "Cms.Entries";
69
+ ECmsComponent["Entries_Create"] = "Cms.Entries.Create";
70
+ ECmsComponent["Entries_Edit"] = "Cms.Entries.Edit";
71
+ ECmsComponent["Fields"] = "Cms.Fields";
72
+ ECmsComponent["FieldsCreate"] = "Cms.Fields.Create";
73
+ ECmsComponent["FieldsEdit"] = "Cms.Fields.Edit";
74
+ ECmsComponent["Sites"] = "Cms.Sites";
75
+ ECmsComponent["Sections"] = "Cms.Sections";
76
+ ECmsComponent["SectionsCreateOrEdit"] = "Cms.Sections.Create.Or.Edit";
77
+ })(ECmsComponent || (ECmsComponent = {}));
78
+
79
+ class UpdateListService {
80
+ constructor() {
81
+ this.updateListEvent = new EventEmitter();
82
+ }
83
+ updateList() {
84
+ this.updateListEvent.emit();
85
+ }
86
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
87
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, providedIn: 'root' }); }
88
+ }
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, decorators: [{
90
+ type: Injectable,
91
+ args: [{
92
+ providedIn: 'root'
93
+ }]
94
+ }], ctorParameters: () => [] });
95
+
96
+ class EntryAdminService {
97
+ constructor(restService) {
98
+ this.restService = restService;
99
+ this.apiName = 'CmsAdmin';
100
+ this.activate = (id, config) => this.restService.request({
101
+ method: 'POST',
102
+ url: `/api/cms-admin/entries/activate/${id}`,
103
+ }, { apiName: this.apiName, ...config });
104
+ this.create = (input, config) => this.restService.request({
105
+ method: 'POST',
106
+ url: '/api/cms-admin/entries',
107
+ body: input,
108
+ }, { apiName: this.apiName, ...config });
109
+ this.cultureExistWithSingleSection = (input, config) => this.restService.request({
110
+ method: 'GET',
111
+ url: '/api/cms-admin/entries/culture-exists-with-single-section',
112
+ params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId },
113
+ }, { apiName: this.apiName, ...config });
114
+ this.delete = (id, config) => this.restService.request({
115
+ method: 'DELETE',
116
+ url: `/api/cms-admin/entries/${id}`,
117
+ }, { apiName: this.apiName, ...config });
118
+ this.get = (id, config) => this.restService.request({
119
+ method: 'GET',
120
+ url: `/api/cms-admin/entries/${id}`,
121
+ }, { apiName: this.apiName, ...config });
122
+ this.getAllVersions = (id, config) => this.restService.request({
123
+ method: 'GET',
124
+ url: `/api/cms-admin/entries/${id}/all-versions`,
125
+ }, { apiName: this.apiName, ...config });
126
+ this.getList = (input, config) => this.restService.request({
127
+ method: 'GET',
128
+ url: '/api/cms-admin/entries',
129
+ params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId, startPublishDate: input.startPublishDate, expiryPublishDate: input.expiryPublishDate, filter: input.filter, status: input.status, creatorId: input.creatorId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
130
+ }, { apiName: this.apiName, ...config });
131
+ this.getListByIds = (sectionId, ids, config) => this.restService.request({
132
+ method: 'GET',
133
+ url: '/api/cms-admin/entries/search-by-ids',
134
+ params: { sectionId, ids },
135
+ }, { apiName: this.apiName, ...config });
136
+ this.move = (id, input, config) => this.restService.request({
137
+ method: 'POST',
138
+ url: `/api/cms-admin/entries/move/${id}`,
139
+ body: input,
140
+ }, { apiName: this.apiName, ...config });
141
+ this.slugExists = (input, config) => this.restService.request({
142
+ method: 'GET',
143
+ url: '/api/cms-admin/entries/slug-exists',
144
+ params: { culture: input.culture, sectionId: input.sectionId, slug: input.slug },
145
+ }, { apiName: this.apiName, ...config });
146
+ this.update = (id, input, config) => this.restService.request({
147
+ method: 'PUT',
148
+ url: '/api/cms-admin/entries',
149
+ params: { id },
150
+ body: input,
151
+ }, { apiName: this.apiName, ...config });
152
+ }
153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
154
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, providedIn: 'root' }); }
155
+ }
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, decorators: [{
157
+ type: Injectable,
158
+ args: [{
159
+ providedIn: 'root',
160
+ }]
161
+ }], ctorParameters: () => [{ type: i1.RestService }] });
162
+
163
+ class EntryTypeAdminService {
164
+ constructor(restService) {
165
+ this.restService = restService;
166
+ this.apiName = 'CmsAdmin';
167
+ this.create = (input, config) => this.restService.request({
168
+ method: 'POST',
169
+ url: '/api/cms-admin/entry-types',
170
+ body: input,
171
+ }, { apiName: this.apiName, ...config });
172
+ this.delete = (id, config) => this.restService.request({
173
+ method: 'DELETE',
174
+ url: `/api/cms-admin/entry-types/${id}`,
175
+ }, { apiName: this.apiName, ...config });
176
+ this.get = (id, config) => this.restService.request({
177
+ method: 'GET',
178
+ url: `/api/cms-admin/entry-types/${id}`,
179
+ }, { apiName: this.apiName, ...config });
180
+ this.nameExists = (input, config) => this.restService.request({
181
+ method: 'GET',
182
+ url: '/api/cms-admin/entry-types/name-exists',
183
+ params: { sectionId: input.sectionId, name: input.name },
184
+ }, { apiName: this.apiName, ...config });
185
+ this.update = (id, input, config) => this.restService.request({
186
+ method: 'PUT',
187
+ url: `/api/cms-admin/entry-types/${id}`,
188
+ body: input,
189
+ }, { apiName: this.apiName, ...config });
190
+ }
191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
192
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, providedIn: 'root' }); }
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, decorators: [{
195
+ type: Injectable,
196
+ args: [{
197
+ providedIn: 'root',
198
+ }]
199
+ }], ctorParameters: () => [{ type: i1.RestService }] });
200
+
201
+ class SectionAdminService {
202
+ constructor(restService) {
203
+ this.restService = restService;
204
+ this.apiName = 'CmsAdmin';
205
+ this.create = (input, config) => this.restService.request({
206
+ method: 'POST',
207
+ url: '/api/cms-admin/sections',
208
+ body: input,
209
+ }, { apiName: this.apiName, ...config });
210
+ this.delete = (id, config) => this.restService.request({
211
+ method: 'DELETE',
212
+ url: `/api/cms-admin/sections/${id}`,
213
+ }, { apiName: this.apiName, ...config });
214
+ this.get = (id, config) => this.restService.request({
215
+ method: 'GET',
216
+ url: `/api/cms-admin/sections/${id}`,
217
+ }, { apiName: this.apiName, ...config });
218
+ this.getList = (input, config) => this.restService.request({
219
+ method: 'GET',
220
+ url: '/api/cms-admin/sections',
221
+ params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
222
+ }, { apiName: this.apiName, ...config });
223
+ this.nameExists = (input, config) => this.restService.request({
224
+ method: 'GET',
225
+ url: '/api/cms-admin/sections/name-exists',
226
+ params: { name: input.name },
227
+ }, { apiName: this.apiName, ...config });
228
+ this.routeExists = (input, config) => this.restService.request({
229
+ method: 'GET',
230
+ url: '/api/cms-admin/sections/route-exists',
231
+ params: { route: input.route },
232
+ }, { apiName: this.apiName, ...config });
233
+ this.update = (id, input, config) => this.restService.request({
234
+ method: 'PUT',
235
+ url: `/api/cms-admin/sections/${id}`,
236
+ body: input,
237
+ }, { apiName: this.apiName, ...config });
238
+ }
239
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
240
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, providedIn: 'root' }); }
241
+ }
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, decorators: [{
243
+ type: Injectable,
244
+ args: [{
245
+ providedIn: 'root',
246
+ }]
247
+ }], ctorParameters: () => [{ type: i1.RestService }] });
248
+
249
+ class EntriesComponent {
250
+ constructor(_EntryAdminService, _SectionAdminService, toaster, confirmation, configState, router, _LocalizationService) {
251
+ this._EntryAdminService = _EntryAdminService;
252
+ this._SectionAdminService = _SectionAdminService;
253
+ this.toaster = toaster;
254
+ this.confirmation = confirmation;
255
+ this.configState = configState;
256
+ this.router = router;
257
+ this._LocalizationService = _LocalizationService;
258
+ this.fb = inject(FormBuilder);
259
+ this._UpdateListService = inject(UpdateListService);
260
+ this.list = inject(ListService);
261
+ /**站点列表 */
262
+ // siteList: any[any] = []
263
+ /**选择的站点id */
264
+ // siteId: string = ''
265
+ /**站点下的版块 */
266
+ this.SiteOfSectionList = [];
267
+ /**版块下的语言列表 */
268
+ this.sectionLanguagesList = [];
269
+ /**版块下的条目类型列表 */
270
+ this.entryTypeList = [];
271
+ /**状态编码 */
272
+ this._entryStatusOptions = entryStatusOptions;
273
+ this.config = inject(ConfigStateService);
274
+ this._SiteSettingsAdminService = inject(SiteSettingsAdminService);
275
+ /**站点设置语言 */
276
+ this.SiteSettingsAdminLanguages = [];
277
+ /**列表相关 */
278
+ this.ColumnMode = ColumnMode;
279
+ this.data = {
280
+ items: [],
281
+ totalCount: 0,
282
+ };
283
+ this.filters = {};
284
+ this.filtersForm = this.fb.group({
285
+ siteId: [''],
286
+ sectionId: [''],
287
+ culture: [''],
288
+ filter: [''],
289
+ });
290
+ }
291
+ ngOnInit() {
292
+ this.getPageDate();
293
+ this._UpdateListService.updateListEvent.subscribe(() => {
294
+ this.list.get();
295
+ });
296
+ }
297
+ /**获取页面数据 */
298
+ async getPageDate() {
299
+ await this.getSiteOfSectionList();
300
+ await this.getSectionLanguagesList();
301
+ this.filters = this.filtersForm.value;
302
+ this.hookToQuery();
303
+ }
304
+ /**切换板块 */
305
+ async sectionIdChange() {
306
+ this.getSectionOfEntryType();
307
+ await this.getSectionLanguagesList();
308
+ this.resetData();
309
+ }
310
+ /**切换语言 */
311
+ async cultureChange() {
312
+ this.resetData();
313
+ }
314
+ /**获取站点下的版块 */
315
+ getSiteOfSectionList() {
316
+ return new Promise((resolve, rejects) => {
317
+ this._SectionAdminService.getList({
318
+ maxResultCount: 1000,
319
+ }).subscribe(res => {
320
+ this.SiteOfSectionList = res.items;
321
+ this.filtersForm.get('sectionId').patchValue(res.items[0]?.id || '');
322
+ this.getSectionOfEntryType();
323
+ resolve(res.items);
324
+ });
325
+ });
326
+ }
327
+ /**获取版块下的条目类型 */
328
+ getSectionOfEntryType() {
329
+ let sectionId = this.filtersForm.get('sectionId').value;
330
+ this.entryTypeList = this.SiteOfSectionList.find(el => el.id == sectionId)?.entryTypes || [];
331
+ }
332
+ /**获取版块下的语言列表 */
333
+ getSectionLanguagesList() {
334
+ return new Promise(async (resolve, rejects) => {
335
+ //获取所有语言 */
336
+ let languagesSystem = this.configState.getDeep('localization.languages');
337
+ //获取系统默认语言 */
338
+ let DefaultLanguage = this.config.getSetting("Abp.Localization.DefaultLanguage");
339
+ const configCmsSiteLanguages = this.config.getSetting("Cms.Site.Languages");
340
+ if (!configCmsSiteLanguages) {
341
+ await this.getSiteSettingsLanguages();
342
+ }
343
+ const LanguagesSite = (configCmsSiteLanguages ? configCmsSiteLanguages.split(',') : '') || this.SiteSettingsAdminLanguages;
344
+ let LanguagesArray = languagesSystem.filter(el => LanguagesSite.includes(el.cultureName));
345
+ //获取当前选择的语言
346
+ let nowculture = this.filtersForm.get('culture').value;
347
+ //当前选择的语言,是否在版块的的语言列表中
348
+ let isexist = LanguagesArray.find(el => el.cultureName == nowculture);
349
+ this.filtersForm.get('culture').patchValue(nowculture ? isexist ? nowculture : DefaultLanguage : DefaultLanguage);
350
+ this.sectionLanguagesList = LanguagesArray;
351
+ resolve(LanguagesArray);
352
+ });
353
+ }
354
+ /**
355
+ * 获取站点设置语言
356
+ */
357
+ getSiteSettingsLanguages() {
358
+ return new Promise((resolve, rejects) => {
359
+ this._SiteSettingsAdminService.getAllLanguages().subscribe(res => {
360
+ this.SiteSettingsAdminLanguages = res;
361
+ resolve(res);
362
+ });
363
+ });
364
+ }
365
+ resetData() {
366
+ this.filters = this.filtersForm.value;
367
+ this.list.page = 0;
368
+ this.data.items = [];
369
+ this.list.get();
370
+ }
371
+ /**新增-单个 */
372
+ createEntriesBtn() {
373
+ this.router.navigate(['/cms/admin/entries/create'], {
374
+ queryParams: { cultureName: this.filters.culture, sectionId: this.filters.sectionId, entryTypeId: this.entryTypeList[0].id }
375
+ });
376
+ }
377
+ hookToQuery() {
378
+ const getData = (query) => this._EntryAdminService.getList({
379
+ ...query,
380
+ ...this.filters,
381
+ });
382
+ const setData = (list) => {
383
+ this.data = list;
384
+ };
385
+ this.list.hookToQuery(getData).subscribe(setData);
386
+ }
387
+ /**删除条目 */
388
+ deletefield(row) {
389
+ this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
390
+ if (status == 'confirm') {
391
+ this._EntryAdminService.delete(row.id).pipe(finalize(() => {
392
+ })).subscribe(res => {
393
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
394
+ this.list.get();
395
+ });
396
+ }
397
+ });
398
+ }
399
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntriesComponent, deps: [{ token: EntryAdminService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.ConfigStateService }, { token: i3$1.Router }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
400
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntriesComponent, selector: "cms-entries", providers: [
401
+ ListService,
402
+ // Provide this token if you want a different debounce time.
403
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
404
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
405
+ {
406
+ provide: EXTENSIONS_IDENTIFIER,
407
+ useValue: ECmsComponent.Entries,
408
+ },
409
+ ], ngImport: i0, template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::Title' | abpLocalization\" prop=\"title\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"entryTypeId\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <ng-container *ngIf=\"item.id === value\">{{item.displayName}}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Slug' | abpLocalization\" prop=\"slug\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Status' | abpLocalization\" prop=\"status\" [width]=\"80\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of _entryStatusOptions\">\r\n <ng-container *ngIf=\"item.value=== value\">{{ 'Cms::Enum:EntryStatus:'+item.key |\r\n abpLocalization }}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::PublishTime' | abpLocalization\" prop=\"publishTime\" [width]=\"190\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{value | date: 'YYYY/MM/dd HH:mm:s' }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\" >\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\r\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem\r\n routerLink=\"/cms/admin/entries/{{row.id}}/edit\">{{'AbpUi::Edit' |\r\n abpLocalization}}</button>\r\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\r\n abpLocalization}}</button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</abp-page>", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .card-header input{flex:2 1 auto}::ng-deep .sites-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-page .morentr{border:2px solid transparent}::ng-deep .sites-page .borderdrag{border:2px solid var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .borderdragtd{background-color:var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .testtr{border-color:transparent}::ng-deep .sites-page .testtr td{padding:2px}::ng-deep .sites-page .testtr:hover{background-color:transparent}.cdk-drag-preview{display:table;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:0}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: i8$1.PageToolbarContainerComponent, selector: "abp-page-toolbar-container" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
410
+ }
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntriesComponent, decorators: [{
412
+ type: Component,
413
+ args: [{ selector: 'cms-entries', providers: [
414
+ ListService,
415
+ // Provide this token if you want a different debounce time.
416
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
417
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
418
+ {
419
+ provide: EXTENSIONS_IDENTIFIER,
420
+ useValue: ECmsComponent.Entries,
421
+ },
422
+ ], template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::Title' | abpLocalization\" prop=\"title\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"entryTypeId\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <ng-container *ngIf=\"item.id === value\">{{item.displayName}}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Slug' | abpLocalization\" prop=\"slug\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Status' | abpLocalization\" prop=\"status\" [width]=\"80\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of _entryStatusOptions\">\r\n <ng-container *ngIf=\"item.value=== value\">{{ 'Cms::Enum:EntryStatus:'+item.key |\r\n abpLocalization }}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::PublishTime' | abpLocalization\" prop=\"publishTime\" [width]=\"190\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{value | date: 'YYYY/MM/dd HH:mm:s' }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\" >\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\r\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem\r\n routerLink=\"/cms/admin/entries/{{row.id}}/edit\">{{'AbpUi::Edit' |\r\n abpLocalization}}</button>\r\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\r\n abpLocalization}}</button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</abp-page>", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .card-header input{flex:2 1 auto}::ng-deep .sites-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-page .morentr{border:2px solid transparent}::ng-deep .sites-page .borderdrag{border:2px solid var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .borderdragtd{background-color:var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .testtr{border-color:transparent}::ng-deep .sites-page .testtr td{padding:2px}::ng-deep .sites-page .testtr:hover{background-color:transparent}.cdk-drag-preview{display:table;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:0}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
423
+ }], ctorParameters: () => [{ type: EntryAdminService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.ConfigStateService }, { type: i3$1.Router }, { type: i1.LocalizationService }] });
424
+
425
+ class CreateOrUpdateEntryInputBase {
426
+ constructor(data) {
427
+ /**语言 */
428
+ this.culture = ['', [Validators.required]];
429
+ /**条目id */
430
+ this.entryTypeId = [''];
431
+ /**标题 */
432
+ this.title = ['', [Validators.required]];
433
+ /**别名 */
434
+ this.slug = ['', [Validators.required]];
435
+ /**是否是草稿 */
436
+ this.draft = ['', []];
437
+ /**发布时间 */
438
+ this.publishTime = ['', [Validators.required]];
439
+ /**上级目录 */
440
+ this.parentId = [null];
441
+ /**修订说明 */
442
+ this.versionNotes = [null];
443
+ /**版本 */
444
+ this.initialVersionId = [null];
445
+ this.extraProperties = new FormGroup({});
446
+ if (data) {
447
+ for (const key in data) {
448
+ if (data.hasOwnProperty(key)) {
449
+ this[key] = data[key];
450
+ }
451
+ }
452
+ }
453
+ }
454
+ }
455
+
456
+ class ValidatorsService {
457
+ constructor() {
458
+ this.fb = inject(FormBuilder);
459
+ this.toaster = inject(ToasterService);
460
+ this._LocalizationService = inject(LocalizationService);
461
+ }
462
+ /**检查表单- */
463
+ /**检查表单- */
464
+ isCheckForm(input, module = 'AbpValidation') {
465
+ let keys = Object.keys(input);
466
+ for (let i = 0; i < keys.length; i++) {
467
+ const element = keys[i];
468
+ if (input[element] == false) {
469
+ let info = `"${this._LocalizationService.instant(`${module}::${element}`)}" `;
470
+ if (element.includes('.') && !element.includes('].')) {
471
+ let arr = element.split('.');
472
+ info = `"${this._LocalizationService.instant(`CmsKit::${arr[0]}`)}.${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
473
+ }
474
+ if (element.includes('].')) {
475
+ let arr = element.split('].');
476
+ let arrStart = arr[0].split('[');
477
+ info = `"${this._LocalizationService.instant(`CmsKit::${arrStart[0]}`)}[${arrStart[1]}].${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
478
+ }
479
+ info += `${this._LocalizationService.instant(`AbpValidation::ThisFieldIsNotValid`)}`;
480
+ //使用abp多语言提示
481
+ this.toaster.warn(info);
482
+ return true;
483
+ }
484
+ }
485
+ return false;
486
+ }
487
+ /**获取表单所有字段是否通过验证 */
488
+ getFormValidationStatus(formEntity) {
489
+ let validationStatus = {};
490
+ // 递归遍历表单组和表单控件集合
491
+ const traverseForm = (form, prefix = '') => {
492
+ if (form instanceof FormGroup) {
493
+ Object.keys(form.controls).forEach(key => {
494
+ const control = form.controls[key];
495
+ let displayName = key.charAt(0).toUpperCase() + key.slice(1);
496
+ const fullKey = prefix ? `${prefix}.${displayName}` : displayName;
497
+ if (control instanceof FormControl) {
498
+ validationStatus[fullKey] = control.valid;
499
+ }
500
+ else if (control instanceof FormArray) {
501
+ traverseForm(control, fullKey);
502
+ }
503
+ else if (control instanceof FormGroup) {
504
+ traverseForm(control, fullKey);
505
+ }
506
+ });
507
+ }
508
+ else if (form instanceof FormArray) {
509
+ form.controls.forEach((control, index) => {
510
+ const fullKey = prefix ? `${prefix}[${index}]` : `[${index}]`;
511
+ if (control instanceof FormControl) {
512
+ validationStatus[fullKey] = control.valid;
513
+ }
514
+ else if (control instanceof FormArray) {
515
+ traverseForm(control, fullKey);
516
+ }
517
+ else if (control instanceof FormGroup) {
518
+ traverseForm(control, fullKey);
519
+ }
520
+ });
521
+ }
522
+ };
523
+ traverseForm(formEntity);
524
+ return validationStatus;
525
+ }
526
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
527
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, providedIn: 'root' }); }
528
+ }
529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, decorators: [{
530
+ type: Injectable,
531
+ args: [{
532
+ providedIn: 'root'
533
+ }]
534
+ }], ctorParameters: () => [] });
535
+
536
+ class FieldGroupAdminService {
537
+ constructor(restService) {
538
+ this.restService = restService;
539
+ this.apiName = 'CmsAdmin';
540
+ this.create = (input, config) => this.restService.request({
541
+ method: 'POST',
542
+ url: '/api/cms-admin/field-groups',
543
+ body: input,
544
+ }, { apiName: this.apiName, ...config });
545
+ this.delete = (id, config) => this.restService.request({
546
+ method: 'DELETE',
547
+ url: `/api/cms-admin/field-groups/${id}`,
548
+ }, { apiName: this.apiName, ...config });
549
+ this.get = (id, config) => this.restService.request({
550
+ method: 'GET',
551
+ url: `/api/cms-admin/field-groups/${id}`,
552
+ }, { apiName: this.apiName, ...config });
553
+ this.getList = (input, config) => this.restService.request({
554
+ method: 'GET',
555
+ url: '/api/cms-admin/field-groups',
556
+ params: { input },
557
+ }, { apiName: this.apiName, ...config });
558
+ this.update = (id, input, config) => this.restService.request({
559
+ method: 'PUT',
560
+ url: `/api/cms-admin/field-groups/${id}`,
561
+ body: input,
562
+ }, { apiName: this.apiName, ...config });
563
+ }
564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
565
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, providedIn: 'root' }); }
566
+ }
567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, decorators: [{
568
+ type: Injectable,
569
+ args: [{
570
+ providedIn: 'root',
571
+ }]
572
+ }], ctorParameters: () => [{ type: i1.RestService }] });
573
+
574
+ class FormAdminService {
575
+ constructor(restService) {
576
+ this.restService = restService;
577
+ this.apiName = 'CmsAdmin';
578
+ this.getFormControls = (config) => this.restService.request({
579
+ method: 'GET',
580
+ url: '/api/cms-admin/dynamic-forms/forms',
581
+ }, { apiName: this.apiName, ...config });
582
+ }
583
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
584
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, providedIn: 'root' }); }
585
+ }
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, decorators: [{
587
+ type: Injectable,
588
+ args: [{
589
+ providedIn: 'root',
590
+ }]
591
+ }], ctorParameters: () => [{ type: i1.RestService }] });
592
+
593
+ class FieldAbstractsService {
594
+ constructor(_FieldGroupAdminService, _FormAdminService) {
595
+ this._FieldGroupAdminService = _FieldGroupAdminService;
596
+ this._FormAdminService = _FormAdminService;
597
+ /**字段分组列表 */
598
+ this.fieldGroupList = [];
599
+ /**表单控件类型 */
600
+ this.fromControlList = [];
601
+ }
602
+ /**获取字段分组列表 */
603
+ getfieldGroupList() {
604
+ this._FieldGroupAdminService.getList({}).subscribe(res => {
605
+ this.fieldGroupList = res.items;
606
+ });
607
+ }
608
+ /**获取表单控件类型 */
609
+ getFromControlList() {
610
+ return new Promise((resolve, reject) => {
611
+ this._FormAdminService.getFormControls({}).subscribe(res => {
612
+ this.fromControlList = res.items;
613
+ resolve(res.items);
614
+ });
615
+ });
616
+ }
617
+ getExcludeAssignControl(typeName) {
618
+ // return this.fromControlList.filter(el => el.name !== typeName)
619
+ return this.fromControlList;
620
+ }
621
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, deps: [{ token: FieldGroupAdminService }, { token: FormAdminService }], target: i0.ɵɵFactoryTarget.Injectable }); }
622
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, providedIn: 'root' }); }
623
+ }
624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, decorators: [{
625
+ type: Injectable,
626
+ args: [{
627
+ providedIn: 'root'
628
+ }]
629
+ }], ctorParameters: () => [{ type: FieldGroupAdminService }, { type: FormAdminService }] });
630
+
631
+ class CmsService {
632
+ constructor(restService) {
633
+ this.restService = restService;
634
+ this.apiName = 'Cms';
635
+ }
636
+ sample() {
637
+ return this.restService.request({ method: 'GET', url: '/api/Cms/sample' }, { apiName: this.apiName });
638
+ }
639
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
640
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, providedIn: 'root' }); }
641
+ }
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, decorators: [{
643
+ type: Injectable,
644
+ args: [{
645
+ providedIn: 'root',
646
+ }]
647
+ }], ctorParameters: () => [{ type: i1.RestService }] });
648
+
649
+ class CmsApiService {
650
+ constructor(titleService) {
651
+ this.titleService = titleService;
652
+ }
653
+ /**动态设置浏览器标题 */
654
+ setBrowserTitle(title) {
655
+ this.titleService.setTitle(title);
656
+ }
657
+ /**
658
+ * 识别中文转化为拼音,固定返回类型
659
+ * 汉字转拼音
660
+ * 大写转小写
661
+ *
662
+ * */
663
+ chineseToPinyin(value) {
664
+ //去除字符串中所有的空格
665
+ // let val = value
666
+ let val = value.replaceAll(' ', "-");
667
+ let array = val.split('');
668
+ let newArray = [];
669
+ array.forEach((el, index) => {
670
+ //转化为小写
671
+ let elChange = el.toLowerCase();
672
+ let isChinese = (str) => {
673
+ return /^[\u4e00-\u9fa5]+$/.test(str);
674
+ };
675
+ if (isChinese(elChange)) {
676
+ const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
677
+ elChange = resultWithoutTone.toString();
678
+ if (index < array.length - 1)
679
+ elChange += '-';
680
+ }
681
+ ;
682
+ newArray.push(elChange);
683
+ });
684
+ let pinyinstr = newArray.join('');
685
+ return pinyinstr || val;
686
+ }
687
+ /**
688
+ * 深拷贝--方法 */
689
+ deepClone(obj) {
690
+ if (typeof obj !== 'object' || obj === null)
691
+ return obj;
692
+ const result = Array.isArray(obj) ? [] : {};
693
+ for (let key in obj) {
694
+ if (obj.hasOwnProperty(key)) {
695
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
696
+ if (obj[key] instanceof Date) {
697
+ result[key] = new Date(obj[key].getTime());
698
+ }
699
+ else if (obj[key] instanceof RegExp) {
700
+ result[key] = new RegExp(obj[key]);
701
+ }
702
+ else {
703
+ result[key] = this.deepClone(obj[key]);
704
+ }
705
+ }
706
+ else {
707
+ result[key] = obj[key];
708
+ }
709
+ }
710
+ }
711
+ return result;
712
+ }
713
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, deps: [{ token: i1$2.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
714
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, providedIn: 'root' }); }
715
+ }
716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, decorators: [{
717
+ type: Injectable,
718
+ args: [{
719
+ providedIn: 'root'
720
+ }]
721
+ }], ctorParameters: () => [{ type: i1$2.Title }] });
722
+
723
+ class SimpleReuseStrategy {
724
+ static { this.cacheRouters = new Map(); }
725
+ static deleteRouteCache(url) {
726
+ if (SimpleReuseStrategy.cacheRouters.has(url)) {
727
+ const handle = SimpleReuseStrategy.cacheRouters.get(url);
728
+ try {
729
+ handle.componentRef.destory();
730
+ }
731
+ catch (e) { }
732
+ SimpleReuseStrategy.cacheRouters.delete(url);
733
+ }
734
+ }
735
+ static deleteAllRouteCache() {
736
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
737
+ SimpleReuseStrategy.deleteRouteCache(key);
738
+ });
739
+ }
740
+ // one 进入路由触发,是否同一路由时复用路由
741
+ shouldReuseRoute(future, curr) {
742
+ return future.routeConfig === curr.routeConfig &&
743
+ JSON.stringify(future.params) === JSON.stringify(curr.params);
744
+ }
745
+ // 获取存储路由
746
+ retrieve(route) {
747
+ const url = this.getFullRouteURL(route);
748
+ if (route.data.keep && SimpleReuseStrategy.cacheRouters.has(url)) {
749
+ return SimpleReuseStrategy.cacheRouters.get(url);
750
+ }
751
+ else {
752
+ return null;
753
+ }
754
+ }
755
+ // 是否允许复用路由
756
+ shouldDetach(route) {
757
+ return Boolean(route.data.keep);
758
+ }
759
+ // 当路由离开时会触发,存储路由
760
+ store(route, handle) {
761
+ const url = this.getFullRouteURL(route);
762
+ // 先把之前缓存的删除,
763
+ SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
764
+ SimpleReuseStrategy.deleteRouteCache(key);
765
+ });
766
+ SimpleReuseStrategy.cacheRouters.set(url, handle);
767
+ }
768
+ // 是否允许还原路由
769
+ shouldAttach(route) {
770
+ const url = this.getFullRouteURL(route);
771
+ return Boolean(route.data.keep) && SimpleReuseStrategy.cacheRouters.has(url);
772
+ }
773
+ // 获取当前路由url
774
+ getFullRouteURL(route) {
775
+ const { pathFromRoot } = route;
776
+ let fullRouteUrlPath = [];
777
+ pathFromRoot.forEach((item) => {
778
+ fullRouteUrlPath = fullRouteUrlPath.concat(this.getRouteUrlPath(item));
779
+ });
780
+ return `/${fullRouteUrlPath.join('/')}`;
781
+ }
782
+ getRouteUrlPath(route) {
783
+ return route.url.map(urlSegment => urlSegment.path);
784
+ }
785
+ }
786
+
787
+ class CreateOrEditEntriesComponent {
788
+ constructor(toaster, _location, configState, _SectionAdminService, _EntryAdminService, datePipe, _LocalizationService, router, _CmsApiService) {
789
+ this.toaster = toaster;
790
+ this._location = _location;
791
+ this.configState = configState;
792
+ this._SectionAdminService = _SectionAdminService;
793
+ this._EntryAdminService = _EntryAdminService;
794
+ this.datePipe = datePipe;
795
+ this._LocalizationService = _LocalizationService;
796
+ this.router = router;
797
+ this._CmsApiService = _CmsApiService;
798
+ /**语言 */
799
+ this.cultureName = '';
800
+ /**条目类型id */
801
+ this.entryTypeId = '';
802
+ /**新建版本的版本id,同条目id */
803
+ this.RevisionEntryId = '';
804
+ /**选择的条目项 */
805
+ this.entryTypesItem = '';
806
+ /**版块id */
807
+ this.sectionId = '';
808
+ /**版块详情 */
809
+ this.SectionSelect = '';
810
+ /**语言列表 */
811
+ this.languagesList = [];
812
+ /**条目类型列表-用于选择上级条目 */
813
+ this.entryTypesList = [];
814
+ /**版本列表 */
815
+ this.AllVersionsList = [];
816
+ /**是否是编辑 */
817
+ this.isEdit = false;
818
+ /**来自父组件的传值 */
819
+ this.FromParentQueryParams = '';
820
+ /**指定id的条目信息 */
821
+ this.entrySelect = '';
822
+ this.time = 0;
823
+ this.config = inject(ConfigStateService);
824
+ }
825
+ set ParentQueryParams(v) {
826
+ if (v) {
827
+ this.FromParentQueryParams = v;
828
+ }
829
+ }
830
+ set entity(v) {
831
+ if (v) {
832
+ this._entity = v;
833
+ }
834
+ }
835
+ set parentEntrySelect(v) {
836
+ if (v) {
837
+ let V_extraProperties = this._CmsApiService.deepClone(this.convertExtraProperties(v.extraProperties));
838
+ v.extraProperties = V_extraProperties;
839
+ this.entrySelect = v;
840
+ }
841
+ }
842
+ /**将对象中的ExtraProperties赋值到extraProperties */
843
+ convertExtraProperties(obj) {
844
+ for (let key in obj) {
845
+ if (Array.isArray(obj[key])) {
846
+ obj[key].forEach(item => {
847
+ if (item.hasOwnProperty('ExtraProperties')) {
848
+ item['extraProperties'] = item['ExtraProperties'];
849
+ }
850
+ });
851
+ }
852
+ }
853
+ return obj;
854
+ }
855
+ /**别名表单实体 */
856
+ get sluginput() {
857
+ return this._entity.get('slug');
858
+ }
859
+ /**语言表单实体 */
860
+ get cultureinput() {
861
+ return this._entity.get('culture');
862
+ }
863
+ /**语言表单实体影子 */
864
+ get culture_shadowInput() {
865
+ return this._entity.get('culture_shadow');
866
+ }
867
+ /**extraProperties配置表单实体 */
868
+ get extraProperties() {
869
+ return this._entity.get('extraProperties');
870
+ }
871
+ async ngAfterContentInit() {
872
+ //Called after ngOnInit when the component's or directive's content has been initialized.
873
+ //Add 'implements AfterContentInit' to the class.
874
+ let queryParams = this.FromParentQueryParams;
875
+ if (this._entity && this.FromParentQueryParams) {
876
+ this._entity.setControl('slug', new FormControl('', {
877
+ validators: Validators.required,
878
+ asyncValidators: this.repetitionAsyncValidator(),
879
+ updateOn: 'blur'
880
+ }));
881
+ this._entity.setControl('culture_shadow', new FormControl('', {
882
+ validators: [Validators.required],
883
+ asyncValidators: this.cultureAsyncValidator_test(),
884
+ }));
885
+ this._entity.get('culture').disable();
886
+ if (queryParams.RevisionEntryId && this.entrySelect) {
887
+ this.RevisionEntryId = queryParams.RevisionEntryId;
888
+ this.setEntryconfig(this.entrySelect);
889
+ }
890
+ else {
891
+ this.setEntryconfig(queryParams);
892
+ }
893
+ if (this.sectionId)
894
+ await this.getSectionSelect();
895
+ if (this.RevisionEntryId)
896
+ await this.getAllVersionsList();
897
+ }
898
+ }
899
+ /**定义自定义异步验证 */
900
+ cultureAsyncValidator_test() {
901
+ return (ctrl) => {
902
+ return new Promise(resolve => {
903
+ let subculture = this._entity?.get('culture').value;
904
+ if (subculture == this.entrySelect?.culture || this.SectionSelect.type !== 0) {
905
+ resolve(null);
906
+ return;
907
+ }
908
+ this._EntryAdminService.cultureExistWithSingleSection({
909
+ culture: subculture,
910
+ sectionId: this.sectionId,
911
+ entryTypeId: this.entryTypeId
912
+ }).subscribe(res => {
913
+ if (res) {
914
+ resolve({ repetition: this._LocalizationService.instant(`Cms::EntriesAlreadyExistEntryType`, this.entryTypesItem.displayName, this.languagesList.find(el => el.cultureName == subculture).displayName) });
915
+ }
916
+ else {
917
+ resolve(null);
918
+ }
919
+ });
920
+ });
921
+ };
922
+ }
923
+ /**
924
+ * 设置条目详情
925
+ * @param {object} source - 数据源对象
926
+ */
927
+ setEntryconfig(source) {
928
+ this.entryTypeId = source.entryTypeId;
929
+ this.cultureName = source.culture || source.cultureName;
930
+ this.sectionId = source.sectionId;
931
+ }
932
+ /**定义自定义异步验证 */
933
+ repetitionAsyncValidator() {
934
+ return (ctrl) => {
935
+ return new Promise(resolve => {
936
+ let subslug = this._entity?.get('slug').value;
937
+ if (subslug == this.entrySelect?.slug) {
938
+ resolve(null);
939
+ return;
940
+ }
941
+ this._EntryAdminService.slugExists({
942
+ culture: this.cultureName,
943
+ sectionId: this.sectionId,
944
+ slug: subslug
945
+ }).subscribe(res => {
946
+ if (res) {
947
+ resolve({ repetition: this._LocalizationService.instant(`Cms::EntrySlug{0}AlreadyExist`, ctrl.value) });
948
+ }
949
+ else {
950
+ resolve(null);
951
+ }
952
+ });
953
+ });
954
+ };
955
+ }
956
+ /**获取版块详情 */
957
+ getSectionSelect() {
958
+ return new Promise((resolve, rejects) => {
959
+ this._SectionAdminService.get(this.sectionId).subscribe(async (res) => {
960
+ let languages = this.configState.getDeep('localization.languages');
961
+ this.languagesList = languages;
962
+ let entryTypesItem = res.entryTypes.find(el => el.id == this.entryTypeId);
963
+ this.SectionSelect = res;
964
+ await this.getTypeEntryList();
965
+ this.entryTypesItem = entryTypesItem;
966
+ this.entryTypesList = res.entryTypes.filter(el => el.id == this.entryTypeId);
967
+ this._entity.patchValue({
968
+ ...this.entrySelect,
969
+ initialVersionId: this.entrySelect?.initialVersionId || this.RevisionEntryId || '',
970
+ culture: this.cultureName,
971
+ culture_shadow: this.cultureName,
972
+ entryTypeId: this.entryTypeId,
973
+ publishTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
974
+ });
975
+ resolve(true);
976
+ });
977
+ });
978
+ }
979
+ /**获取条目类型下所有条目列表 */
980
+ getTypeEntryList() {
981
+ return new Promise((resolve, rejects) => {
982
+ this._EntryAdminService.getList({
983
+ sectionId: this.sectionId,
984
+ maxResultCount: 1000,
985
+ culture: this.cultureName
986
+ }).subscribe((res) => {
987
+ let entryTypesList = res.items.filter(el => el.id != this.entrySelect.id);
988
+ let parentList = entryTypesList.filter(el => !el.parentId);
989
+ parentList.forEach(el => {
990
+ let layer = 0;
991
+ el.layer = new Array(layer);
992
+ el.children = this.groupByParentId(entryTypesList, el.id, (layer + 1));
993
+ });
994
+ this.entryTypesList = parentList;
995
+ resolve(res);
996
+ });
997
+ });
998
+ }
999
+ /**对数组按照父子关系进行分组 */
1000
+ groupByParentId(arr, id = '', layer) {
1001
+ let result = [];
1002
+ result = arr.filter(el => el.parentId == id);
1003
+ result.forEach(el => {
1004
+ el.layer = new Array(layer);
1005
+ el.children = this.groupByParentId(arr, el.id, (layer + 1));
1006
+ });
1007
+ return result;
1008
+ }
1009
+ /**获取条目版本列表 */
1010
+ getAllVersionsList() {
1011
+ return new Promise((resolve, rejects) => {
1012
+ this._EntryAdminService.getAllVersions(this.RevisionEntryId).subscribe(res => {
1013
+ this.AllVersionsList = res.items;
1014
+ resolve(res);
1015
+ });
1016
+ });
1017
+ }
1018
+ /**标题转化别名 */
1019
+ setTitleToSlugBlur(event) {
1020
+ let val = event.target.value;
1021
+ let slug = this._entity.get('slug');
1022
+ let pinyinstr = '';
1023
+ if (slug.value)
1024
+ return;
1025
+ pinyinstr = this._CmsApiService.chineseToPinyin(val);
1026
+ this._entity.patchValue({
1027
+ slug: pinyinstr || val
1028
+ });
1029
+ }
1030
+ /**使用Unicode编码范围判断是否是中文字符 */
1031
+ isChinese(str) {
1032
+ return /^[\u4e00-\u9fa5]+$/.test(str);
1033
+ }
1034
+ /**激活 */
1035
+ ActivatedVersion(VersionId) {
1036
+ this._EntryAdminService.activate(VersionId).subscribe((res) => {
1037
+ this.AllVersionsList.forEach(el => {
1038
+ el.isActivatedVersion = el.id === VersionId;
1039
+ });
1040
+ return;
1041
+ });
1042
+ }
1043
+ /**编辑版本 */
1044
+ toEditUrl(id) {
1045
+ this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
1046
+ this.router.navigate([`/cms/admin/entries/${id}/edit`]);
1047
+ });
1048
+ }
1049
+ /**删除版本 */
1050
+ delectVersion(vid) {
1051
+ this._EntryAdminService.delete(vid).subscribe(res => {
1052
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1053
+ this.getAllVersionsList();
1054
+ });
1055
+ }
1056
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditEntriesComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i1.ConfigStateService }, { token: SectionAdminService }, { token: EntryAdminService }, { token: i2.DatePipe }, { token: i1.LocalizationService }, { token: i3$1.Router }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1057
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: { isEdit: "isEdit", ParentQueryParams: "ParentQueryParams", entity: "entity", parentEntrySelect: "parentEntrySelect" }, viewQueries: [{ propertyName: "FormDynamicontrolRef", predicate: ["FormDynamicontrolRef"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\" *ngIf=\"SectionSelect.type===1\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd\n HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1058
+ }
1059
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditEntriesComponent, decorators: [{
1060
+ type: Component,
1061
+ args: [{ selector: 'cms-create-or-edit-entries', template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\" *ngIf=\"SectionSelect.type===1\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd\n HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
1062
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i1.ConfigStateService }, { type: SectionAdminService }, { type: EntryAdminService }, { type: i2.DatePipe }, { type: i1.LocalizationService }, { type: i3$1.Router }, { type: CmsApiService }], propDecorators: { isEdit: [{
1063
+ type: Input
1064
+ }], ParentQueryParams: [{
1065
+ type: Input
1066
+ }], entity: [{
1067
+ type: Input
1068
+ }], parentEntrySelect: [{
1069
+ type: Input
1070
+ }], FormDynamicontrolRef: [{
1071
+ type: ViewChildren,
1072
+ args: ['FormDynamicontrolRef', { read: ViewContainerRef }]
1073
+ }] } });
1074
+
1075
+ class CreateComponent {
1076
+ constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
1077
+ this.toaster = toaster;
1078
+ this._location = _location;
1079
+ this.route = route;
1080
+ this._EntryAdminService = _EntryAdminService;
1081
+ this._LocalizationService = _LocalizationService;
1082
+ this.fb = inject(FormBuilder);
1083
+ this._updateListService = inject(UpdateListService);
1084
+ /**是否是草稿 */
1085
+ this.draftType = false;
1086
+ /**页面传值用于传递到子组件 */
1087
+ this.queryParams = '';
1088
+ /**指定id的条目信息 */
1089
+ this.entrySelect = '';
1090
+ this._ValidatorsService = inject(ValidatorsService);
1091
+ /**表单验证状态
1092
+ * {
1093
+ * title:true,
1094
+ * }
1095
+ */
1096
+ this.formValidation = '';
1097
+ this.isSubmit = false;
1098
+ }
1099
+ async ngOnInit() {
1100
+ this.queryParams = this.route.snapshot.queryParams;
1101
+ this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1102
+ if (this.queryParams.RevisionEntryId)
1103
+ await this.getEntrySelect();
1104
+ }
1105
+ /**获取条目信息 */
1106
+ getEntrySelect() {
1107
+ return new Promise((resolve, rejects) => {
1108
+ this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1109
+ this.entrySelect = res;
1110
+ resolve(res);
1111
+ });
1112
+ });
1113
+ }
1114
+ /**保存 */
1115
+ save(draft) {
1116
+ this.newEntity.patchValue({
1117
+ draft: draft
1118
+ });
1119
+ this.newEntity.get('culture').enable();
1120
+ let input = this.newEntity.value;
1121
+ input.publishTime = new Date(new Date(input.publishTime).getTime() + (8 * 60 * 60 * 1000)).toISOString();
1122
+ input.culture = this.newEntity.get('culture').value;
1123
+ if (!this.isSubmit)
1124
+ return;
1125
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1126
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1127
+ return;
1128
+ if (!this.newEntity.valid)
1129
+ return;
1130
+ this._EntryAdminService.create(input).subscribe(res => {
1131
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1132
+ this._location.back();
1133
+ this._updateListService.updateList();
1134
+ });
1135
+ }
1136
+ /**触发点击按钮替身 */
1137
+ clickSubmit(type) {
1138
+ this.isSubmit = true;
1139
+ this.draftType = type;
1140
+ this.submitclick.nativeElement.click();
1141
+ }
1142
+ /**返回上一页 */
1143
+ backTo() {
1144
+ this._location.back();
1145
+ }
1146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1147
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateComponent, selector: "cms-create", providers: [
1148
+ {
1149
+ provide: EXTENSIONS_IDENTIFIER,
1150
+ useValue: ECmsComponent.Entries_Create,
1151
+ },
1152
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1153
+ }
1154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, decorators: [{
1155
+ type: Component,
1156
+ args: [{ selector: 'cms-create', providers: [
1157
+ {
1158
+ provide: EXTENSIONS_IDENTIFIER,
1159
+ useValue: ECmsComponent.Entries_Create,
1160
+ },
1161
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"] }]
1162
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1163
+ type: ViewChild,
1164
+ args: ['submitclick', { static: true }]
1165
+ }] } });
1166
+
1167
+ /* eslint-disable @angular-eslint/use-lifecycle-interface */
1168
+ class EditComponent {
1169
+ constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
1170
+ this.toaster = toaster;
1171
+ this._location = _location;
1172
+ this.route = route;
1173
+ this._EntryAdminService = _EntryAdminService;
1174
+ this._LocalizationService = _LocalizationService;
1175
+ this.fb = inject(FormBuilder);
1176
+ this._updateListService = inject(UpdateListService);
1177
+ /**是否是草稿 */
1178
+ this.draftType = false;
1179
+ /**页面传值用于传递到子组件 */
1180
+ this.queryParams = {};
1181
+ /**指定id的条目信息 */
1182
+ this.entrySelect = '';
1183
+ this._ValidatorsService = inject(ValidatorsService);
1184
+ /**表单验证状态
1185
+ * {
1186
+ * title:true,
1187
+ * }
1188
+ */
1189
+ this.formValidation = '';
1190
+ this.isSubmit = false;
1191
+ }
1192
+ async ngOnInit() {
1193
+ this.queryParams.RevisionEntryId = this.route.snapshot.params.entrieId;
1194
+ this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1195
+ await this.getEntrySelect();
1196
+ }
1197
+ /**获取条目信息 */
1198
+ getEntrySelect() {
1199
+ return new Promise((resolve, rejects) => {
1200
+ this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1201
+ this.entrySelect = res;
1202
+ resolve(res);
1203
+ });
1204
+ });
1205
+ }
1206
+ /**保存 */
1207
+ save(draft) {
1208
+ this.newEntity.patchValue({
1209
+ draft: draft,
1210
+ });
1211
+ this.newEntity.get('culture').enable();
1212
+ let input = this.newEntity.value;
1213
+ input.publishTime = new Date(new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000).toISOString();
1214
+ input.culture = this.newEntity.get('culture').value;
1215
+ input.concurrencyStamp = this.entrySelect.concurrencyStamp;
1216
+ if (!this.isSubmit)
1217
+ return;
1218
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1219
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1220
+ return;
1221
+ if (!this.newEntity.valid)
1222
+ return;
1223
+ this._EntryAdminService.update(this.entrySelect.id, input).subscribe(res => {
1224
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1225
+ this.backTo();
1226
+ this._updateListService.updateList();
1227
+ });
1228
+ }
1229
+ /**触发点击按钮替身 */
1230
+ clickSubmit(type) {
1231
+ this.draftType = type;
1232
+ this.isSubmit = true;
1233
+ this.submitclick.nativeElement.click();
1234
+ }
1235
+ /**返回上一页 */
1236
+ backTo() {
1237
+ this._location.back();
1238
+ }
1239
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1240
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditComponent, selector: "cms-edit", providers: [
1241
+ {
1242
+ provide: EXTENSIONS_IDENTIFIER,
1243
+ useValue: ECmsComponent.Entries_Edit,
1244
+ },
1245
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1246
+ }
1247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, decorators: [{
1248
+ type: Component,
1249
+ args: [{ selector: 'cms-edit', providers: [
1250
+ {
1251
+ provide: EXTENSIONS_IDENTIFIER,
1252
+ useValue: ECmsComponent.Entries_Edit,
1253
+ },
1254
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
1255
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1256
+ type: ViewChild,
1257
+ args: ['submitclick', { static: true }]
1258
+ }] } });
1259
+
1260
+ class FieldAdminService {
1261
+ constructor(restService) {
1262
+ this.restService = restService;
1263
+ this.apiName = 'CmsAdmin';
1264
+ this.create = (input, config) => this.restService.request({
1265
+ method: 'POST',
1266
+ url: '/api/cms-admin/fields',
1267
+ body: input,
1268
+ }, { apiName: this.apiName, ...config });
1269
+ this.delete = (id, config) => this.restService.request({
1270
+ method: 'DELETE',
1271
+ url: `/api/cms-admin/fields/${id}`,
1272
+ }, { apiName: this.apiName, ...config });
1273
+ this.get = (id, config) => this.restService.request({
1274
+ method: 'GET',
1275
+ url: `/api/cms-admin/fields/${id}`,
1276
+ }, { apiName: this.apiName, ...config });
1277
+ this.getList = (input, config) => this.restService.request({
1278
+ method: 'GET',
1279
+ url: '/api/cms-admin/fields',
1280
+ params: { filter: input.filter, groupId: input.groupId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
1281
+ }, { apiName: this.apiName, ...config });
1282
+ this.nameExists = (name, config) => this.restService.request({
1283
+ method: 'GET',
1284
+ url: `/api/cms-admin/fields/name-exists/${name}`,
1285
+ }, { apiName: this.apiName, ...config });
1286
+ this.update = (id, input, config) => this.restService.request({
1287
+ method: 'PUT',
1288
+ url: `/api/cms-admin/fields/${id}`,
1289
+ body: input,
1290
+ }, { apiName: this.apiName, ...config });
1291
+ }
1292
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1293
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, providedIn: 'root' }); }
1294
+ }
1295
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, decorators: [{
1296
+ type: Injectable,
1297
+ args: [{
1298
+ providedIn: 'root',
1299
+ }]
1300
+ }], ctorParameters: () => [{ type: i1.RestService }] });
1301
+
1302
+ class FieldGroupComponent {
1303
+ constructor(fb, _FieldGroupAdminService, toaster, confirmation, _FieldAbstractsService, _LocalizationService) {
1304
+ this.fb = fb;
1305
+ this._FieldGroupAdminService = _FieldGroupAdminService;
1306
+ this.toaster = toaster;
1307
+ this.confirmation = confirmation;
1308
+ this._FieldAbstractsService = _FieldAbstractsService;
1309
+ this._LocalizationService = _LocalizationService;
1310
+ /**表单已存在的值 */
1311
+ this.selected = {};
1312
+ /**选择的字段分组id */
1313
+ this.fieldGroupId = '';
1314
+ /**创建分组模态框状态 */
1315
+ this.createGroupOpen = false;
1316
+ /**用于确定模态的繁忙状态是否为真 */
1317
+ this.modalBusy = false;
1318
+ /**编辑分组模态框状态 */
1319
+ this.editGroupOpen = false;
1320
+ /**点击分组回调 */
1321
+ this.OnGroupClickBack = new EventEmitter();
1322
+ this._ValidatorsService = inject(ValidatorsService);
1323
+ /**表单验证状态
1324
+ * {
1325
+ * title:true,
1326
+ * }
1327
+ */
1328
+ this.formValidation = '';
1329
+ }
1330
+ ngOnInit() {
1331
+ this._FieldAbstractsService.getfieldGroupList();
1332
+ }
1333
+ /**创建字段分组 */
1334
+ createGroupBtn() {
1335
+ this.createGroupOpen = true;
1336
+ this.formValidation = '';
1337
+ this.createForm = this.fb.group({
1338
+ name: ['', [Validators.required]],
1339
+ });
1340
+ }
1341
+ /**创建分组模态框状态改变 */
1342
+ createGroupVisibleChange(event) {
1343
+ if (!event) {
1344
+ return;
1345
+ }
1346
+ }
1347
+ /**编辑字段分组 */
1348
+ editGroupBtn(itemName) {
1349
+ this.editGroupOpen = true;
1350
+ this.formValidation = '';
1351
+ this.editGroupForm = this.fb.group({
1352
+ name: [itemName, [Validators.required]],
1353
+ });
1354
+ }
1355
+ /**编辑分组模态框状态改变 */
1356
+ editGroupVisibleChange(event) {
1357
+ if (!event) {
1358
+ return;
1359
+ }
1360
+ }
1361
+ /**创建字段分组保存 */
1362
+ createSave() {
1363
+ let input = this.createForm.value;
1364
+ this.modalBusy = true;
1365
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1366
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1367
+ return;
1368
+ this._FieldGroupAdminService.create(input).pipe(finalize$1(() => {
1369
+ this.modalBusy = false;
1370
+ this.createGroupOpen = false;
1371
+ this.formValidation = '';
1372
+ })).subscribe(res => {
1373
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1374
+ this._FieldAbstractsService.getfieldGroupList();
1375
+ });
1376
+ }
1377
+ /**编辑字段分组保存 */
1378
+ editSave() {
1379
+ let input = this.editGroupForm.value;
1380
+ this.modalBusy = true;
1381
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1382
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1383
+ return;
1384
+ this._FieldGroupAdminService.update(this.fieldGroupId, input).pipe(finalize$1(() => {
1385
+ this.modalBusy = false;
1386
+ this.editGroupOpen = false;
1387
+ this.formValidation = '';
1388
+ })).subscribe(res => {
1389
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1390
+ this._FieldAbstractsService.getfieldGroupList();
1391
+ });
1392
+ }
1393
+ /**删除字段分组1 */
1394
+ deleteGroupbtn(fieldGroupitem) {
1395
+ this.confirmation.warn(fieldGroupitem.name, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1396
+ if (status == 'confirm') {
1397
+ this._FieldGroupAdminService.delete(this.fieldGroupId).pipe(finalize$1(() => {
1398
+ })).subscribe(res => {
1399
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1400
+ this.fieldGroupId = '';
1401
+ this._FieldAbstractsService.getfieldGroupList();
1402
+ });
1403
+ }
1404
+ });
1405
+ }
1406
+ /**字段分组改变 */
1407
+ fieldGroupChange(event) {
1408
+ this.fieldGroupId = event;
1409
+ this.OnGroupClickBack.emit(event);
1410
+ }
1411
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldGroupAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: FieldAbstractsService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1412
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FieldGroupComponent, selector: "cms-field-group", outputs: { OnGroupClickBack: "OnGroupClickBack" }, ngImport: i0, template: "<div class=\"card-header px-2 py-sm-2 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'Cms::FieldGroup' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-link btn-sm ms-2\"><i class=\"fas fa-plus-circle\" aria-hidden=\"true\"\n (click)=\"createGroupBtn()\"></i></button>\n</div>\n<div class=\"card-body p-0\">\n <div class=\"container-height overflow-auto\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item list-group-item-action active\" [class.active]=\"fieldGroupId===''\"\n (click)=\"fieldGroupChange('')\">{{'Cms::AllFields' | abpLocalization}}</li>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <li class=\"list-group-item list-group-item-action d-flex justify-content-between align-items-center\"\n [class.active]=\"fieldGroupId===item.id\" (click)=\"fieldGroupChange(item.id)\">\n <div>{{item.name}}</div>\n <div *ngIf=\"fieldGroupId===item.id\">\n <i class=\"fas fa-trash px-1\" role=\"button\" (click.stop)=\"deleteGroupbtn(item)\"></i>\n <i class=\"fas fa-edit px-1\" role=\"button\" (click.stop)=\"editGroupBtn(item.name)\"></i>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"createGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'Cms::New' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"createForm; else loaderRef\" [formGroup]=\"createForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"createForm?.invalid\" (click)=\"createSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"editGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"editGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"editGroupForm; else loaderRef\" [formGroup]=\"editGroupForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"editSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"editGroupForm?.invalid\" (click)=\"editSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1413
+ }
1414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupComponent, decorators: [{
1415
+ type: Component,
1416
+ args: [{ selector: 'cms-field-group', template: "<div class=\"card-header px-2 py-sm-2 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'Cms::FieldGroup' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-link btn-sm ms-2\"><i class=\"fas fa-plus-circle\" aria-hidden=\"true\"\n (click)=\"createGroupBtn()\"></i></button>\n</div>\n<div class=\"card-body p-0\">\n <div class=\"container-height overflow-auto\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item list-group-item-action active\" [class.active]=\"fieldGroupId===''\"\n (click)=\"fieldGroupChange('')\">{{'Cms::AllFields' | abpLocalization}}</li>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <li class=\"list-group-item list-group-item-action d-flex justify-content-between align-items-center\"\n [class.active]=\"fieldGroupId===item.id\" (click)=\"fieldGroupChange(item.id)\">\n <div>{{item.name}}</div>\n <div *ngIf=\"fieldGroupId===item.id\">\n <i class=\"fas fa-trash px-1\" role=\"button\" (click.stop)=\"deleteGroupbtn(item)\"></i>\n <i class=\"fas fa-edit px-1\" role=\"button\" (click.stop)=\"editGroupBtn(item.name)\"></i>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"createGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'Cms::New' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"createForm; else loaderRef\" [formGroup]=\"createForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"createForm?.invalid\" (click)=\"createSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"editGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"editGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"editGroupForm; else loaderRef\" [formGroup]=\"editGroupForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"editSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"editGroupForm?.invalid\" (click)=\"editSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
1417
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldGroupAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: FieldAbstractsService }, { type: i1.LocalizationService }], propDecorators: { OnGroupClickBack: [{
1418
+ type: Output
1419
+ }] } });
1420
+
1421
+ class FieldsComponent {
1422
+ constructor(list, _FieldAdminService, toaster, confirmation, _LocalizationService, router) {
1423
+ this.list = list;
1424
+ this._FieldAdminService = _FieldAdminService;
1425
+ this.toaster = toaster;
1426
+ this.confirmation = confirmation;
1427
+ this._LocalizationService = _LocalizationService;
1428
+ this.router = router;
1429
+ this._UpdateListService = inject(UpdateListService);
1430
+ /**表格单元格布局类型 */
1431
+ this.ColumnMode = ColumnMode;
1432
+ /**表格数据 */
1433
+ this.data = {
1434
+ items: [],
1435
+ totalCount: 0,
1436
+ };
1437
+ /**过滤器 */
1438
+ this.filters = {};
1439
+ }
1440
+ ngOnInit() {
1441
+ this.hookToQuery();
1442
+ this._UpdateListService.updateListEvent.subscribe(() => {
1443
+ this.list.get();
1444
+ });
1445
+ }
1446
+ getData() {
1447
+ this.list.get();
1448
+ }
1449
+ /**字段分组选择回调 */
1450
+ fieldGroupChange(event) {
1451
+ this.filters.groupId = event;
1452
+ this.list.page = 0;
1453
+ this.list.get();
1454
+ }
1455
+ /**使用abp的list获取表格的字段数据列表 */
1456
+ hookToQuery() {
1457
+ const getData = (query) => this._FieldAdminService.getList({
1458
+ ...query,
1459
+ ...this.filters,
1460
+ });
1461
+ const setData = (list) => (this.data = list);
1462
+ this.list.hookToQuery(getData).subscribe(setData);
1463
+ }
1464
+ /**新建字段按钮 */
1465
+ toFieldsCreateBtn() {
1466
+ this.router.navigate(['/cms/admin/fields/create'], {
1467
+ queryParams: {}
1468
+ });
1469
+ }
1470
+ /**删除字段 */
1471
+ deletefield(row) {
1472
+ this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1473
+ if (status == 'confirm') {
1474
+ this._FieldAdminService.delete(row.id).pipe(finalize(() => {
1475
+ })).subscribe(res => {
1476
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1477
+ this.list.get();
1478
+ });
1479
+ }
1480
+ });
1481
+ }
1482
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, deps: [{ token: i1.ListService }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.LocalizationService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1483
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FieldsComponent, selector: "cms-fields", providers: [
1484
+ // [Required]
1485
+ ListService,
1486
+ // [Optional]
1487
+ // Provide this token if you want a different debounce time.
1488
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1489
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1490
+ {
1491
+ provide: EXTENSIONS_IDENTIFIER,
1492
+ useValue: ECmsComponent.Fields,
1493
+ },
1494
+ ], ngImport: i0, template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: FieldGroupComponent, selector: "cms-field-group", outputs: ["OnGroupClickBack"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1495
+ }
1496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, decorators: [{
1497
+ type: Component,
1498
+ args: [{ selector: 'cms-fields', providers: [
1499
+ // [Required]
1500
+ ListService,
1501
+ // [Optional]
1502
+ // Provide this token if you want a different debounce time.
1503
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1504
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1505
+ {
1506
+ provide: EXTENSIONS_IDENTIFIER,
1507
+ useValue: ECmsComponent.Fields,
1508
+ },
1509
+ ], template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"] }]
1510
+ }], ctorParameters: () => [{ type: i1.ListService }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.LocalizationService }, { type: i3$1.Router }] });
1511
+
1512
+ class CreateOrUpdateFieldInputBase {
1513
+ constructor(data) {
1514
+ /**分组id */
1515
+ this.groupId = ['', []];
1516
+ /**字段名称 Display name of this field */
1517
+ this.displayName = ['', [Validators.required]];
1518
+ /**字段唯一名称 Unique Name*/
1519
+ this.name = ['', [Validators.required]];
1520
+ /**描述 说明 */
1521
+ this.description = ['', []];
1522
+ /**FieldType字段类型 表单控件名称 */
1523
+ this.formControlName = [undefined, [Validators.required]];
1524
+ /**动态表单配置 */
1525
+ this.formConfiguration = new FormGroup({});
1526
+ if (data) {
1527
+ for (const key in data) {
1528
+ if (data.hasOwnProperty(key)) {
1529
+ this[key] = data[key];
1530
+ }
1531
+ }
1532
+ }
1533
+ }
1534
+ }
1535
+
1536
+ class CreateOrEditFieldComponent {
1537
+ constructor(_FieldAbstractsService, _CmsApiService, _FieldAdminService, _LocalizationService) {
1538
+ this._FieldAbstractsService = _FieldAbstractsService;
1539
+ this._CmsApiService = _CmsApiService;
1540
+ this._FieldAdminService = _FieldAdminService;
1541
+ this._LocalizationService = _LocalizationService;
1542
+ if (this._FieldAbstractsService.fieldGroupList.length == 0) {
1543
+ this._FieldAbstractsService.getfieldGroupList();
1544
+ }
1545
+ }
1546
+ set Entity(v) {
1547
+ if (v) {
1548
+ this._Entity = v;
1549
+ this.dataLoaded();
1550
+ }
1551
+ }
1552
+ get formControlName() {
1553
+ return this._Entity.get('formControlName');
1554
+ }
1555
+ set selected(v) {
1556
+ if (v) {
1557
+ this._selected = v || '';
1558
+ this._selected_copy = v;
1559
+ this.dataLoaded();
1560
+ }
1561
+ }
1562
+ async dataLoaded() {
1563
+ if (this._FieldAbstractsService.fromControlList.length == 0) {
1564
+ await this._FieldAbstractsService.getFromControlList();
1565
+ }
1566
+ if (this._Entity) {
1567
+ if (!this.formControlName.value) {
1568
+ this._Entity.patchValue({
1569
+ formControlName: this._FieldAbstractsService.fromControlList[0]?.name,
1570
+ });
1571
+ }
1572
+ this._Entity.setControl('name', new FormControl(this.nameInput.value || '', {
1573
+ validators: Validators.required,
1574
+ asyncValidators: [this.repetitionAsyncValidator()],
1575
+ updateOn: 'change'
1576
+ }));
1577
+ this.submitclick?.nativeElement?.click();
1578
+ }
1579
+ }
1580
+ /**name表单控件 */
1581
+ get nameInput() {
1582
+ return this._Entity.get('name');
1583
+ }
1584
+ nameInputBlur(event) {
1585
+ let value = event.target.value;
1586
+ this.nameInput.patchValue(value);
1587
+ }
1588
+ /**字段标签input失去标点生成字段名字 */
1589
+ disPlayNameInputBlur(event) {
1590
+ let value = event.target.value;
1591
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
1592
+ let nameInput = this.nameInput;
1593
+ if (nameInput.value)
1594
+ return;
1595
+ nameInput.patchValue(pinyin);
1596
+ }
1597
+ /**定义异步验证方法 */
1598
+ repetitionAsyncValidator() {
1599
+ return (ctrl) => {
1600
+ return new Promise(resolve => {
1601
+ if (ctrl.value == this._selected?.name || !ctrl.value) {
1602
+ resolve(null);
1603
+ return;
1604
+ }
1605
+ this._FieldAdminService.nameExists(ctrl.value).subscribe(res => {
1606
+ if (res) {
1607
+ resolve({ repetition: this._LocalizationService.instant(`Cms::FieldName{0}AlreadyExist`, ctrl.value) });
1608
+ }
1609
+ else {
1610
+ resolve(null);
1611
+ }
1612
+ });
1613
+ });
1614
+ };
1615
+ }
1616
+ formControlNameChange(event) {
1617
+ // this._selected='';
1618
+ }
1619
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditFieldComponent, deps: [{ token: FieldAbstractsService }, { token: CmsApiService }, { token: FieldAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1620
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: { Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "FormDynamicRef", first: true, predicate: ["FormDynamicRef"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" required (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange($event)\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1621
+ }
1622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditFieldComponent, decorators: [{
1623
+ type: Component,
1624
+ args: [{ selector: 'cms-create-or-edit-field', template: "<form [formGroup]=\"_Entity\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" required (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange($event)\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
1625
+ }], ctorParameters: () => [{ type: FieldAbstractsService }, { type: CmsApiService }, { type: FieldAdminService }, { type: i1.LocalizationService }], propDecorators: { FormDynamicRef: [{
1626
+ type: ViewChild,
1627
+ args: ['FormDynamicRef', { read: ViewContainerRef, static: true }]
1628
+ }], submitclick: [{
1629
+ type: ViewChild,
1630
+ args: ['submitclick', { static: true }]
1631
+ }], Entity: [{
1632
+ type: Input
1633
+ }], selected: [{
1634
+ type: Input
1635
+ }] } });
1636
+
1637
+ class CreateFieldComponent {
1638
+ constructor(fb, _FieldAdminService, toaster, _location, _LocalizationService, _CmsApiService) {
1639
+ this.fb = fb;
1640
+ this._FieldAdminService = _FieldAdminService;
1641
+ this.toaster = toaster;
1642
+ this._location = _location;
1643
+ this._LocalizationService = _LocalizationService;
1644
+ this._CmsApiService = _CmsApiService;
1645
+ this._UpdateListService = inject(UpdateListService);
1646
+ this.isSubmit = false;
1647
+ this._ValidatorsService = inject(ValidatorsService);
1648
+ /**表单验证状态
1649
+ * {
1650
+ * title:true,
1651
+ * }
1652
+ */
1653
+ this.formValidation = '';
1654
+ }
1655
+ ngOnInit() {
1656
+ //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
1657
+ //Add 'implements OnInit' to the class.
1658
+ this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
1659
+ }
1660
+ /**触发提交按钮 */
1661
+ submitclickBtn() {
1662
+ this.isSubmit = true;
1663
+ this.submitclick.nativeElement.click();
1664
+ }
1665
+ /**保存表单 */
1666
+ save() {
1667
+ let input = this.newEntity.value;
1668
+ // if (!this.isSubmit) return;
1669
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1670
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1671
+ return;
1672
+ if (!this.newEntity.valid)
1673
+ return;
1674
+ this._FieldAdminService.create(input).subscribe(res => {
1675
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1676
+ this._location.back();
1677
+ this._UpdateListService.updateList();
1678
+ });
1679
+ }
1680
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1681
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateFieldComponent, selector: "cms-create-field", providers: [
1682
+ {
1683
+ provide: EXTENSIONS_IDENTIFIER,
1684
+ useValue: ECmsComponent.FieldsCreate,
1685
+ },
1686
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button form-type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: ["::ng-deep .create-field-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-field-page .form-control,::ng-deep .create-field-page .form-select{padding:.475rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: ["Entity", "selected"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1687
+ }
1688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, decorators: [{
1689
+ type: Component,
1690
+ args: [{ selector: 'cms-create-field', providers: [
1691
+ {
1692
+ provide: EXTENSIONS_IDENTIFIER,
1693
+ useValue: ECmsComponent.FieldsCreate,
1694
+ },
1695
+ ], template: "<form [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button form-type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: ["::ng-deep .create-field-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-field-page .form-control,::ng-deep .create-field-page .form-select{padding:.475rem 1.25rem}\n"] }]
1696
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1697
+ type: ViewChild,
1698
+ args: ['submitclick', { static: true }]
1699
+ }] } });
1700
+
1701
+ class EditFieldComponent {
1702
+ constructor(fb, _FieldAbstractsService, _FieldAdminService, route, toaster, _location, _LocalizationService, _CmsApiService) {
1703
+ this.fb = fb;
1704
+ this._FieldAbstractsService = _FieldAbstractsService;
1705
+ this._FieldAdminService = _FieldAdminService;
1706
+ this.route = route;
1707
+ this.toaster = toaster;
1708
+ this._location = _location;
1709
+ this._LocalizationService = _LocalizationService;
1710
+ this._CmsApiService = _CmsApiService;
1711
+ /**字段id */
1712
+ this.fieldId = '';
1713
+ this._UpdateListService = inject(UpdateListService);
1714
+ this.isSubmit = false;
1715
+ this._ValidatorsService = inject(ValidatorsService);
1716
+ /**表单验证状态
1717
+ * {
1718
+ * title:true,
1719
+ * }
1720
+ */
1721
+ this.formValidation = '';
1722
+ }
1723
+ async ngOnInit() {
1724
+ const _fieldId = this.route.snapshot.params.id;
1725
+ if (_fieldId) {
1726
+ this.fieldId = _fieldId;
1727
+ this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
1728
+ await Promise.all([this._FieldAbstractsService.getFromControlList(), this.getFieldEdit()]);
1729
+ this.newEntity.patchValue({
1730
+ ...this.fieldDetails,
1731
+ formConfiguration: this.fieldDetails.formConfiguration,
1732
+ });
1733
+ }
1734
+ }
1735
+ /**获取字段详情 */
1736
+ getFieldEdit() {
1737
+ return new Promise((resolve, reject) => {
1738
+ this._FieldAdminService.get(this.fieldId).subscribe(res => {
1739
+ res.groupId = res.groupId ? res.groupId : '';
1740
+ this.fieldDetails = res;
1741
+ resolve(res);
1742
+ });
1743
+ });
1744
+ }
1745
+ /**触发提交按钮 */
1746
+ submitclickBtn() {
1747
+ this.isSubmit = true;
1748
+ this.submitclick.nativeElement.click();
1749
+ }
1750
+ /**保存表单 */
1751
+ save() {
1752
+ let input = this.newEntity.value;
1753
+ if (!this.isSubmit)
1754
+ return;
1755
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1756
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1757
+ return;
1758
+ if (!this.newEntity.valid)
1759
+ return;
1760
+ this._FieldAdminService.update(this.fieldId, input).subscribe(res => {
1761
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1762
+ this._location.back();
1763
+ this._UpdateListService.updateList();
1764
+ });
1765
+ }
1766
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAbstractsService }, { token: FieldAdminService }, { token: i3$1.ActivatedRoute }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1767
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditFieldComponent, selector: "cms-edit-field", providers: [
1768
+ {
1769
+ provide: EXTENSIONS_IDENTIFIER,
1770
+ useValue: ECmsComponent.FieldsEdit,
1771
+ },
1772
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::EditField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <!-- <div class=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"\n [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: ["Entity", "selected"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1773
+ }
1774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditFieldComponent, decorators: [{
1775
+ type: Component,
1776
+ args: [{ selector: 'cms-edit-field', providers: [
1777
+ {
1778
+ provide: EXTENSIONS_IDENTIFIER,
1779
+ useValue: ECmsComponent.FieldsEdit,
1780
+ },
1781
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::EditField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <!-- <div class=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"\n [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\n</form>" }]
1782
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAbstractsService }, { type: FieldAdminService }, { type: i3$1.ActivatedRoute }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1783
+ type: ViewChild,
1784
+ args: ['submitclick', { static: true }]
1785
+ }] } });
1786
+
1787
+ var SectionType;
1788
+ (function (SectionType) {
1789
+ SectionType[SectionType["Single"] = 0] = "Single";
1790
+ SectionType[SectionType["Structure"] = 1] = "Structure";
1791
+ SectionType[SectionType["Channel"] = 2] = "Channel";
1792
+ })(SectionType || (SectionType = {}));
1793
+ const sectionTypeOptions = mapEnumToOptions(SectionType);
1794
+
1795
+ class CreateOrUpdateSectionsInputBase {
1796
+ constructor(data) {
1797
+ /**版块类型 */
1798
+ this.type = [0, [Validators.required]];
1799
+ /**字段名称 Display name of this field */
1800
+ this.displayName = ['', [Validators.required]];
1801
+ /**字段唯一名称 Unique Name*/
1802
+ this.name = ['', [Validators.required]];
1803
+ /**条目路由 */
1804
+ this.route = ['', [Validators.required]];
1805
+ /**页面模板 */
1806
+ this.template = ['', [Validators.required]];
1807
+ /**是否默认 */
1808
+ this.isDefault = [false, []];
1809
+ /**是否激活 */
1810
+ this.isActive = [true, []];
1811
+ if (data) {
1812
+ for (const key in data) {
1813
+ if (data.hasOwnProperty(key)) {
1814
+ this[key] = data[key];
1815
+ }
1816
+ }
1817
+ }
1818
+ }
1819
+ }
1820
+
1821
+ class SectionsComponent {
1822
+ constructor(list, _SectionAdminService, toaster, confirmation, fb, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
1823
+ this.list = list;
1824
+ this._SectionAdminService = _SectionAdminService;
1825
+ this.toaster = toaster;
1826
+ this.confirmation = confirmation;
1827
+ this.fb = fb;
1828
+ this._EntryTypeAdminService = _EntryTypeAdminService;
1829
+ this._LocalizationService = _LocalizationService;
1830
+ this._CmsApiService = _CmsApiService;
1831
+ this._UpdateListService = inject(UpdateListService);
1832
+ this.siteList = [];
1833
+ this.ColumnMode = ColumnMode;
1834
+ this.data = { items: [], totalCount: 0 };
1835
+ this.filters = {};
1836
+ this.visibleOpen = false;
1837
+ this.modalBusy = false;
1838
+ this._SectionType = SectionType;
1839
+ this._sectionTypeOptions = sectionTypeOptions;
1840
+ this._ValidatorsService = inject(ValidatorsService);
1841
+ /**表单验证状态
1842
+ * {
1843
+ * title:true,
1844
+ * }
1845
+ */
1846
+ this.formValidation = '';
1847
+ }
1848
+ hookToQuery() {
1849
+ const getData = (query) => this._SectionAdminService.getList({ ...query, ...this.filters });
1850
+ const setData = (list) => (this.data = list);
1851
+ this.list.hookToQuery(getData).subscribe(setData);
1852
+ }
1853
+ async ngOnInit() {
1854
+ this.hookToQuery();
1855
+ this._UpdateListService.updateListEvent.subscribe(() => {
1856
+ this.list.get();
1857
+ });
1858
+ }
1859
+ siteIdChange() {
1860
+ this.list.page = 0;
1861
+ this.list.get();
1862
+ }
1863
+ VisibleChange(event) {
1864
+ if (!event) {
1865
+ this.selected = '';
1866
+ return;
1867
+ }
1868
+ }
1869
+ createSectionBtn() {
1870
+ this.visibleOpen = true;
1871
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1872
+ this.setAsyncValidatorsFn();
1873
+ }
1874
+ editSectionBtn(row) {
1875
+ this.visibleOpen = true;
1876
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1877
+ this.setAsyncValidatorsFn();
1878
+ this._SectionAdminService.get(row.id).subscribe(res => {
1879
+ this.createOrEditForm.patchValue(res);
1880
+ this.selected = res;
1881
+ });
1882
+ }
1883
+ deleteEntryType(row) {
1884
+ this.confirmation
1885
+ .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1886
+ .subscribe((status) => {
1887
+ if (status == 'confirm') {
1888
+ this._EntryTypeAdminService
1889
+ .delete(row.id)
1890
+ .pipe(finalize(() => { }))
1891
+ .subscribe(res => {
1892
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1893
+ this.list.get();
1894
+ });
1895
+ }
1896
+ });
1897
+ }
1898
+ createOrEditSave() {
1899
+ if (this.selected) {
1900
+ return this.EditSave();
1901
+ }
1902
+ this.createSave();
1903
+ }
1904
+ createSave() {
1905
+ let input = this.createOrEditForm.value;
1906
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1907
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1908
+ return;
1909
+ if (!this.createOrEditForm.valid)
1910
+ return;
1911
+ this.modalBusy = true;
1912
+ this._SectionAdminService
1913
+ .create(input)
1914
+ .pipe(finalize(() => {
1915
+ this.modalBusy = false;
1916
+ this.visibleOpen = false;
1917
+ }))
1918
+ .subscribe(res => {
1919
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1920
+ this.list.get();
1921
+ });
1922
+ }
1923
+ EditSave() {
1924
+ setTimeout(() => {
1925
+ let input = this.createOrEditForm.value;
1926
+ input.concurrencyStamp = this.selected.concurrencyStamp;
1927
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1928
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1929
+ return;
1930
+ if (!this.createOrEditForm.valid)
1931
+ return;
1932
+ this.modalBusy = true;
1933
+ this._SectionAdminService
1934
+ .update(this.selected.id, input)
1935
+ .pipe(finalize(() => {
1936
+ this.modalBusy = false;
1937
+ this.visibleOpen = false;
1938
+ }))
1939
+ .subscribe(res => {
1940
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1941
+ this.list.get();
1942
+ });
1943
+ }, 100);
1944
+ }
1945
+ deletefield(row) {
1946
+ this.confirmation
1947
+ .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1948
+ .subscribe((status) => {
1949
+ if (status == 'confirm') {
1950
+ this._SectionAdminService
1951
+ .delete(row.id)
1952
+ .pipe(finalize(() => { }))
1953
+ .subscribe(res => {
1954
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1955
+ this.list.get();
1956
+ });
1957
+ }
1958
+ });
1959
+ }
1960
+ get displayNameInput() {
1961
+ return this.createOrEditForm.get('displayName');
1962
+ }
1963
+ get nameInput() {
1964
+ return this.createOrEditForm.get('name');
1965
+ }
1966
+ get routeInput() {
1967
+ return this.createOrEditForm.get('route');
1968
+ }
1969
+ get templateInput() {
1970
+ return this.createOrEditForm.get('template');
1971
+ }
1972
+ get typeInput() {
1973
+ return this.createOrEditForm.get('type');
1974
+ }
1975
+ radiochange() {
1976
+ this.routeInput.patchValue(this.routeInput.value);
1977
+ }
1978
+ disPlayNameInputBlur(event) {
1979
+ let value = event.target.value;
1980
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
1981
+ let nameInput = this.nameInput;
1982
+ let routeInput = this.routeInput;
1983
+ let templateInput = this.templateInput;
1984
+ if (nameInput.value)
1985
+ return;
1986
+ nameInput.patchValue(pinyin);
1987
+ if (routeInput.value)
1988
+ return;
1989
+ routeInput.patchValue(pinyin + (this.typeInput.value === 0 ? '' : '/{slug}'));
1990
+ if (templateInput.value)
1991
+ return;
1992
+ templateInput.patchValue(pinyin + '/index');
1993
+ }
1994
+ setAsyncValidatorsFn() {
1995
+ this.createOrEditForm.setControl('name', new FormControl(this.nameInput.value || '', {
1996
+ validators: Validators.required,
1997
+ asyncValidators: this.nameRepetitionAsyncValidator(),
1998
+ }));
1999
+ this.createOrEditForm.setControl('route', new FormControl(this.routeInput.value || '', {
2000
+ validators: [Validators.required, this.forbiddenNameValidator()],
2001
+ asyncValidators: [this.routeRepetitionAsyncValidator()],
2002
+ }));
2003
+ }
2004
+ forbiddenNameValidator() {
2005
+ return (control) => {
2006
+ let inputValue = control.value.toLocaleLowerCase();
2007
+ let forbidden = this.typeInput.value == 0 ? false : inputValue.includes('{slug}') ? false : true;
2008
+ return forbidden
2009
+ ? {
2010
+ repetition: this._LocalizationService.instant(`Cms::RouteVerificationTips`, this._LocalizationService.instant(`Cms::Enum:SectionType:` + SectionType[this.typeInput.value]), '{slug}'),
2011
+ }
2012
+ : null;
2013
+ };
2014
+ }
2015
+ nameRepetitionAsyncValidator() {
2016
+ return (ctrl) => {
2017
+ return new Promise(resolve => {
2018
+ let subslug = this.createOrEditForm?.get('name');
2019
+ if (subslug.value == this.selected?.name) {
2020
+ resolve(null);
2021
+ return;
2022
+ }
2023
+ this._SectionAdminService.nameExists({ name: subslug.value }).subscribe(res => {
2024
+ if (res) {
2025
+ resolve({
2026
+ repetition: this._LocalizationService.instant(`Cms::SectionName{0}AlreadyExist`, ctrl.value),
2027
+ });
2028
+ }
2029
+ else {
2030
+ resolve(null);
2031
+ }
2032
+ });
2033
+ });
2034
+ };
2035
+ }
2036
+ routeRepetitionAsyncValidator() {
2037
+ return (ctrl) => {
2038
+ return new Promise(resolve => {
2039
+ let subslug = this.createOrEditForm?.get('route').value;
2040
+ if (subslug == this.selected?.route) {
2041
+ resolve(null);
2042
+ return;
2043
+ }
2044
+ this._SectionAdminService.routeExists({ route: subslug }).subscribe(res => {
2045
+ if (res) {
2046
+ resolve({
2047
+ repetition: this._LocalizationService.instant(`Cms::SectionRoute{0}AlreadyExist`, ctrl.value),
2048
+ });
2049
+ }
2050
+ else {
2051
+ resolve(null);
2052
+ }
2053
+ });
2054
+ });
2055
+ };
2056
+ }
2057
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionsComponent, deps: [{ token: i1.ListService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1$1.FormBuilder }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
2058
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SectionsComponent, selector: "cms-sections", providers: [
2059
+ // [Required]
2060
+ ListService,
2061
+ // [Optional]
2062
+ // Provide this token if you want a different debounce time.
2063
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
2064
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
2065
+ {
2066
+ provide: EXTENSIONS_IDENTIFIER,
2067
+ useValue: ECmsComponent.Sections,
2068
+ },
2069
+ ], viewQueries: [{ propertyName: "createOrEditModalSubmitBtn", first: true, predicate: ["createOrEditModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2070
+ }
2071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionsComponent, decorators: [{
2072
+ type: Component,
2073
+ args: [{ selector: 'cms-sections', providers: [
2074
+ // [Required]
2075
+ ListService,
2076
+ // [Optional]
2077
+ // Provide this token if you want a different debounce time.
2078
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
2079
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
2080
+ {
2081
+ provide: EXTENSIONS_IDENTIFIER,
2082
+ useValue: ECmsComponent.Sections,
2083
+ },
2084
+ ], template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
2085
+ }], ctorParameters: () => [{ type: i1.ListService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1$1.FormBuilder }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { createOrEditModalSubmitBtn: [{
2086
+ type: ViewChild,
2087
+ args: ['createOrEditModalSubmitBtn', { static: false }]
2088
+ }] } });
2089
+
2090
+ class CreateOrEditEntryTypeInputBase {
2091
+ constructor(data) {
2092
+ /**显示名称 Display name of this field */
2093
+ this.displayName = ['', [Validators.required]];
2094
+ /**名称 Unique Name*/
2095
+ this.name = ['', [Validators.required]];
2096
+ /**条目路由 */
2097
+ this.fieldTabs = new FormArray([]);
2098
+ if (data) {
2099
+ for (const key in data) {
2100
+ if (data.hasOwnProperty(key)) {
2101
+ this[key] = data[key];
2102
+ }
2103
+ }
2104
+ }
2105
+ }
2106
+ }
2107
+ class fieldTabsBase {
2108
+ constructor(data) {
2109
+ /**名称 Unique Name*/
2110
+ this.name = ['', [Validators.required]];
2111
+ this.fields = [[], []];
2112
+ if (data) {
2113
+ for (const key in data) {
2114
+ if (data.hasOwnProperty(key)) {
2115
+ this[key] = data[key];
2116
+ }
2117
+ }
2118
+ }
2119
+ }
2120
+ }
2121
+ class fieldsBase {
2122
+ constructor(data) {
2123
+ /**字段id Unique Name*/
2124
+ this.fieldId = ['', [Validators.required]];
2125
+ /**显示名称 Unique Name*/
2126
+ this.displayName = ['', [Validators.required]];
2127
+ /**必填 Unique Name*/
2128
+ this.required = [false, []];
2129
+ /**是否在列表中显示 Unique Name*/
2130
+ this.showOnList = [false, []];
2131
+ if (data) {
2132
+ for (const key in data) {
2133
+ if (data.hasOwnProperty(key)) {
2134
+ this[key] = data[key];
2135
+ }
2136
+ }
2137
+ }
2138
+ }
2139
+ }
2140
+ class fieldsInputBase {
2141
+ constructor(data) {
2142
+ /**字段id */
2143
+ this.fieldId = ['', [Validators.required]];
2144
+ /**显示名称 Display name of this field */
2145
+ this.displayName = ['', [Validators.required]];
2146
+ /**是否必填 Unique Name*/
2147
+ this.required = [false, []];
2148
+ /**在列表中展示 Unique Name*/
2149
+ this.showOnList = [false, []];
2150
+ if (data) {
2151
+ for (const key in data) {
2152
+ if (data.hasOwnProperty(key)) {
2153
+ this[key] = data[key];
2154
+ }
2155
+ }
2156
+ }
2157
+ }
2158
+ }
2159
+
2160
+ class CreateOrEditComponent {
2161
+ constructor(toaster, _location, route, _FieldGroupAdminService, _FieldAdminService, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
2162
+ this.toaster = toaster;
2163
+ this._location = _location;
2164
+ this.route = route;
2165
+ this._FieldGroupAdminService = _FieldGroupAdminService;
2166
+ this._FieldAdminService = _FieldAdminService;
2167
+ this._EntryTypeAdminService = _EntryTypeAdminService;
2168
+ this._LocalizationService = _LocalizationService;
2169
+ this._CmsApiService = _CmsApiService;
2170
+ this.fb = inject(FormBuilder);
2171
+ this._UpdateListService = inject(UpdateListService);
2172
+ /**表单实体 */
2173
+ this.newEntity = this.fb.group(new CreateOrEditEntryTypeInputBase());
2174
+ /**版块id */
2175
+ this.sectionId = '';
2176
+ /**条目类型id */
2177
+ this.entryTypesId = '';
2178
+ /**
2179
+ * 拖拽 功能*/
2180
+ /**数据源 */
2181
+ /**数据源-字段分组数据-包含字段数据 fields */
2182
+ this.fieldGroupList = [];
2183
+ /**数据源-所有字段列表 */
2184
+ this.fieldList = [];
2185
+ /**目标源 结果*/
2186
+ this.resultSource = [];
2187
+ /**来自数据源的集合,用于从目标源拖回数据源时的判断,与取值 */
2188
+ this.formRightGroup = [];
2189
+ this._ValidatorsService = inject(ValidatorsService);
2190
+ /**表单验证状态
2191
+ * {
2192
+ * title:true,
2193
+ * }
2194
+ */
2195
+ this.formValidation = '';
2196
+ /**模态框状态 */
2197
+ this.visibleTabsOpen = false;
2198
+ /**是否是忙碌状态 */
2199
+ this.modalBusy = false;
2200
+ /**正在选中的nav */
2201
+ this.navActive = 0;
2202
+ /**编辑字段模态框状态 */
2203
+ this.visibleEditFieldOpen = false;
2204
+ }
2205
+ get fieldTabs() {
2206
+ return this.newEntity.get('fieldTabs');
2207
+ }
2208
+ /**触发提交按钮 */
2209
+ submitclickBtn() {
2210
+ this.submitclick.nativeElement.click();
2211
+ }
2212
+ ngOnInit() {
2213
+ let sectionId = this.route.snapshot.params.sectionsId;
2214
+ this.entryTypesId = this.route.snapshot.params.entryTypesId || '';
2215
+ if (sectionId) {
2216
+ this.sectionId = sectionId;
2217
+ this.addControlToFieldTabs();
2218
+ this.getFieldGroup();
2219
+ }
2220
+ }
2221
+ /**给fieldTabs添加新控件 */
2222
+ addControlToFieldTabs(nameValue = '') {
2223
+ const newFormGroup = this.fb.group(new fieldTabsBase({
2224
+ name: this.fieldTabs.length === 0
2225
+ ? this._LocalizationService.instant(`Cms::FieldTab`)
2226
+ : nameValue,
2227
+ }));
2228
+ this.fieldTabs.push(newFormGroup);
2229
+ this.resultSource.push(newFormGroup.value);
2230
+ this.navActive = this.resultSource.length - 1;
2231
+ }
2232
+ /**获取字段分组 */
2233
+ getFieldGroup() {
2234
+ this._FieldGroupAdminService.getList({}).subscribe(async (res) => {
2235
+ let fieldList = await this.getFieldList();
2236
+ let fieldGroupList = res.items;
2237
+ fieldGroupList.unshift({
2238
+ id: null,
2239
+ name: 'UngroupedFields',
2240
+ });
2241
+ fieldGroupList.forEach((el, index) => {
2242
+ el.fields = fieldList.filter(els => els.groupId === el.id);
2243
+ });
2244
+ this.fieldGroupList = fieldGroupList;
2245
+ this.fieldList = this.deepClone(fieldList);
2246
+ let entryTypesId = this.entryTypesId;
2247
+ if (entryTypesId) {
2248
+ this.entryTypesId = entryTypesId;
2249
+ this.getEntryTypes();
2250
+ }
2251
+ });
2252
+ }
2253
+ /**获取条目类型详情 */
2254
+ getEntryTypes() {
2255
+ let fieldList = this.deepClone(this.fieldList);
2256
+ this._EntryTypeAdminService.get(this.entryTypesId).subscribe(res => {
2257
+ res.fieldTabs.forEach(el => {
2258
+ el.fields.forEach((eld) => {
2259
+ eld.id = eld.fieldId;
2260
+ eld.groupId = fieldList.find(elfd => elfd.id == eld.fieldId).groupId;
2261
+ this.formRightGroup.push(eld);
2262
+ let fieldindex = fieldList.findIndex(elfl => elfl.id == eld.fieldId);
2263
+ fieldList.splice(fieldindex, 1);
2264
+ });
2265
+ });
2266
+ this.fieldGroupList.forEach((el, index) => {
2267
+ el.fields = fieldList.filter(els => els.groupId === el.id);
2268
+ });
2269
+ this.newEntity.patchValue(res);
2270
+ this.entryTypesSelect = res;
2271
+ this.resultSource = res.fieldTabs;
2272
+ });
2273
+ }
2274
+ /**
2275
+ * 深拷贝--方法
2276
+ * $api.deepClone() */
2277
+ deepClone(obj) {
2278
+ if (typeof obj !== 'object' || obj === null)
2279
+ return obj;
2280
+ const result = Array.isArray(obj) ? [] : {};
2281
+ for (let key in obj) {
2282
+ if (obj.hasOwnProperty(key)) {
2283
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
2284
+ if (obj[key] instanceof Date) {
2285
+ result[key] = new Date(obj[key].getTime());
2286
+ }
2287
+ else if (obj[key] instanceof RegExp) {
2288
+ result[key] = new RegExp(obj[key]);
2289
+ }
2290
+ else {
2291
+ result[key] = this.deepClone(obj[key]);
2292
+ }
2293
+ }
2294
+ else {
2295
+ result[key] = obj[key];
2296
+ }
2297
+ }
2298
+ }
2299
+ return result;
2300
+ }
2301
+ /**
2302
+ *
2303
+ * @param nameValue 获取所有字段
2304
+ */
2305
+ getFieldList() {
2306
+ return new Promise((resolve, rejects) => {
2307
+ this._FieldAdminService
2308
+ .getList({
2309
+ maxResultCount: 1000,
2310
+ })
2311
+ .subscribe((res) => {
2312
+ res.items.forEach(el => {
2313
+ el.required = false;
2314
+ el.showOnList = false;
2315
+ });
2316
+ resolve(res.items);
2317
+ });
2318
+ });
2319
+ }
2320
+ /**从数据源开始拖拽 */
2321
+ fromDataSourceDragStart(element, fieldIndex, groupIndex) {
2322
+ this.fromDataSourceDragEl = element;
2323
+ this.DataSourceFieldIndex = fieldIndex;
2324
+ this.DataSourceGroupIndex = groupIndex;
2325
+ this.fromResultSourceDragEl = undefined;
2326
+ }
2327
+ /**从目标源开始拖拽 */
2328
+ fromResultSourceDragStart(element) {
2329
+ this.fromResultSourceDragEl = element;
2330
+ this.fromDataSourceDragEl = undefined;
2331
+ this.DataSourceFieldIndex = undefined;
2332
+ this.DataSourceGroupIndex = undefined;
2333
+ }
2334
+ /**拖拽到数据源时触发 */
2335
+ dragToDataSourceDropped() {
2336
+ //从数据源拖拽到数据源-排序
2337
+ if (this.fromDataSourceDragEl) {
2338
+ }
2339
+ let _fromResultSourceDragEl = this.fromResultSourceDragEl;
2340
+ let formRightGroup = this.deepClone(this.formRightGroup);
2341
+ let fieldList = this.deepClone(this.fieldList);
2342
+ if (_fromResultSourceDragEl) {
2343
+ //移动
2344
+ //从目标源拖拽到数据源
2345
+ // 拖拽目标源的下标
2346
+ let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2347
+ //删除目标源中的数据
2348
+ this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2349
+ formRightGroup.splice(formRightGroup.findIndex(el => el.id == _fromResultSourceDragEl.id), 1);
2350
+ this.fieldGroupList.forEach(el => {
2351
+ if (el.id == _fromResultSourceDragEl.groupId) {
2352
+ const elFieldsAll = fieldList.filter(els => els.groupId === el.id);
2353
+ el.fields = elFieldsAll.filter(item => !formRightGroup.some(itemB => item.id === itemB.id));
2354
+ }
2355
+ });
2356
+ this.formRightGroup = formRightGroup;
2357
+ }
2358
+ this.setfieldTabsFrom();
2359
+ }
2360
+ /**拖拽到目标源时触发
2361
+ *
2362
+ */
2363
+ dragToResultSourceDropped(fieldTabstem, fieldTabsIndex) {
2364
+ const _fromDataSourceDragEl = this.fromDataSourceDragEl;
2365
+ //从数据源拖拽到目标源
2366
+ if (_fromDataSourceDragEl) {
2367
+ this.fieldGroupList[this.DataSourceGroupIndex].fields.splice(this.DataSourceFieldIndex, 1);
2368
+ this.resultSource[fieldTabsIndex].fields.push(_fromDataSourceDragEl);
2369
+ this.formRightGroup.push(_fromDataSourceDragEl);
2370
+ }
2371
+ this.setfieldTabsFrom();
2372
+ }
2373
+ /** 从目标源拖拽到目标源*/
2374
+ dragToResultSourceItemDropped(fieldsIndex) {
2375
+ const _fromResultSourceDragEl = this.fromResultSourceDragEl;
2376
+ if (_fromResultSourceDragEl) {
2377
+ // 拖拽目标源的下标
2378
+ let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2379
+ //删除目标源中的数据
2380
+ this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2381
+ this.resultSource[this.navActive].fields.splice(fieldsIndex, 0, _fromResultSourceDragEl);
2382
+ }
2383
+ this.setfieldTabsFrom();
2384
+ }
2385
+ /**设置formA表单 */
2386
+ setfieldTabsFrom() {
2387
+ let setArray = [];
2388
+ this.resultSource.forEach(el => {
2389
+ let fieldsArray = [];
2390
+ el.fields.forEach(item => {
2391
+ fieldsArray.push({
2392
+ fieldId: item.id || item.fieldId,
2393
+ displayName: item.displayName,
2394
+ required: item?.required,
2395
+ showOnList: item?.showOnList,
2396
+ });
2397
+ });
2398
+ setArray.push({
2399
+ name: el.name,
2400
+ fields: fieldsArray,
2401
+ });
2402
+ });
2403
+ this.newEntity.patchValue({
2404
+ fieldTabs: setArray,
2405
+ });
2406
+ }
2407
+ /**保存表单 */
2408
+ save() {
2409
+ let input = this.newEntity.value;
2410
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
2411
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
2412
+ return;
2413
+ if (this.entryTypesSelect) {
2414
+ this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).subscribe(res => {
2415
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2416
+ this._location.back();
2417
+ this._UpdateListService.updateList();
2418
+ });
2419
+ return;
2420
+ }
2421
+ input.sectionId = this.sectionId;
2422
+ this._EntryTypeAdminService.create(input).subscribe(res => {
2423
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2424
+ this._location.back();
2425
+ this._UpdateListService.updateList();
2426
+ });
2427
+ }
2428
+ /**模态框状态改变回调 */
2429
+ VisibleTabsChange(event) {
2430
+ if (!event) {
2431
+ this.editFieldTabsSelect = '';
2432
+ return;
2433
+ }
2434
+ }
2435
+ /**新建增加FieldTabs */
2436
+ addFieldTabs() {
2437
+ this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
2438
+ this.visibleTabsOpen = true;
2439
+ }
2440
+ /**编辑FieldTabs */
2441
+ editFieldTabs(item, i) {
2442
+ this.editFieldTabsFrom = this.fb.group(new fieldTabsBase({
2443
+ name: item.name,
2444
+ }));
2445
+ this.editFieldTabsSelect = item;
2446
+ this.visibleTabsOpen = true;
2447
+ this.newEditFieldTabsIndex = i;
2448
+ }
2449
+ /**保存编辑tabs表单 */
2450
+ editFieldTabsSave() {
2451
+ //编辑
2452
+ if (this.editFieldTabsSelect) {
2453
+ this.resultSource[this.newEditFieldTabsIndex].name = this.editFieldTabsFrom.value.name;
2454
+ this.navActive = this.newEditFieldTabsIndex;
2455
+ }
2456
+ else {
2457
+ //新建
2458
+ this.addControlToFieldTabs(this.editFieldTabsFrom.value.name);
2459
+ }
2460
+ this.visibleTabsOpen = false;
2461
+ this.setfieldTabsFrom();
2462
+ }
2463
+ /**删除某个tabs表单 */
2464
+ deleteFieldTabs(index) {
2465
+ this.fieldTabs.removeAt(index);
2466
+ this.resultSource.splice(index, 1);
2467
+ }
2468
+ /**编辑字段模态框状态状态改变回调 */
2469
+ VisibleEditFieldChange(event) {
2470
+ if (!event) {
2471
+ this.EditFieldIndex = undefined;
2472
+ return;
2473
+ }
2474
+ }
2475
+ /**打开编辑字段模态框 */
2476
+ EditFieldModalOpen(items, elIndex) {
2477
+ this.visibleEditFieldOpen = true;
2478
+ this.EditFieldIndex = elIndex;
2479
+ this.editFieldFrom = this.fb.group(new fieldsBase(this.fieldTabs.value[this.navActive].fields[elIndex]));
2480
+ }
2481
+ /**保存编辑字段 */
2482
+ editFieldSave() {
2483
+ let input = this.editFieldFrom.value;
2484
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].displayName = input.displayName;
2485
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].required = input.required;
2486
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].showOnList = input.showOnList;
2487
+ this.visibleEditFieldOpen = false;
2488
+ this.setfieldTabsFrom();
2489
+ }
2490
+ /**name表单控件 */
2491
+ get nameInput() {
2492
+ return this.newEntity.get('name');
2493
+ }
2494
+ /**字段标签input失去标点生成字段名字 */
2495
+ disPlayNameInputBlur(event) {
2496
+ let value = event.target.value;
2497
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2498
+ let nameInput = this.nameInput;
2499
+ if (nameInput.value)
2500
+ return;
2501
+ nameInput.patchValue(pinyin);
2502
+ }
2503
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: FieldGroupAdminService }, { token: FieldAdminService }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
2504
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditComponent, selector: "cms-create-or-edit", providers: [
2505
+ {
2506
+ provide: EXTENSIONS_IDENTIFIER,
2507
+ useValue: ECmsComponent.SectionsCreateOrEdit,
2508
+ },
2509
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "editFieldTabsModalSubmitBtn", first: true, predicate: ["editFieldTabsModalSubmitBtn"], descendants: true }, { propertyName: "editFieldModalSubmitBtn", first: true, predicate: ["editFieldModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n\n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\" (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}}\n </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i10.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i10.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i10.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i10.NgbNavLinkButton, selector: "button[ngbNavLink]" }, { kind: "directive", type: i10.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i10.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i10.NgbAccordionButton, selector: "button[ngbAccordionButton]" }, { kind: "directive", type: i10.NgbAccordionDirective, selector: "[ngbAccordion]", inputs: ["animation", "closeOthers", "destroyOnHide"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordion"] }, { kind: "directive", type: i10.NgbAccordionItem, selector: "[ngbAccordionItem]", inputs: ["ngbAccordionItem", "destroyOnHide", "disabled", "collapsed"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordionItem"] }, { kind: "directive", type: i10.NgbAccordionHeader, selector: "[ngbAccordionHeader]" }, { kind: "directive", type: i10.NgbAccordionBody, selector: "[ngbAccordionBody]" }, { kind: "directive", type: i10.NgbAccordionCollapse, selector: "[ngbAccordionCollapse]", exportAs: ["ngbAccordionCollapse"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2510
+ }
2511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditComponent, decorators: [{
2512
+ type: Component,
2513
+ args: [{ selector: 'cms-create-or-edit', providers: [
2514
+ {
2515
+ provide: EXTENSIONS_IDENTIFIER,
2516
+ useValue: ECmsComponent.SectionsCreateOrEdit,
2517
+ },
2518
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n\n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\" (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}}\n </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"] }]
2519
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: FieldGroupAdminService }, { type: FieldAdminService }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
2520
+ type: ViewChild,
2521
+ args: ['submitclick', { static: true }]
2522
+ }], editFieldTabsModalSubmitBtn: [{
2523
+ type: ViewChild,
2524
+ args: ['editFieldTabsModalSubmitBtn', { static: false }]
2525
+ }], editFieldModalSubmitBtn: [{
2526
+ type: ViewChild,
2527
+ args: ['editFieldModalSubmitBtn', { static: false }]
2528
+ }] } });
2529
+
2530
+ class EntryConfig {
2531
+ constructor(data) {
2532
+ /**多选 */
2533
+ this['Entry.Multiple'] = [false, []];
2534
+ /**占位符 */
2535
+ this['Entry.Placeholder'] = ['', []];
2536
+ /**版块id */
2537
+ this['Entry.SectionId'] = ['', []];
2538
+ if (data) {
2539
+ for (const key in data) {
2540
+ if (data.hasOwnProperty(key)) {
2541
+ this[key] = data[key];
2542
+ }
2543
+ }
2544
+ }
2545
+ }
2546
+ }
2547
+
2548
+ class EntryConfigComponent {
2549
+ constructor(fb,
2550
+ // private _SiteAdminService: SiteAdminService,
2551
+ _SectionAdminService) {
2552
+ this.fb = fb;
2553
+ this._SectionAdminService = _SectionAdminService;
2554
+ /**站点列表 */
2555
+ this.siteList = [];
2556
+ /**选择的站点id */
2557
+ // siteId: string = ''
2558
+ this.siteId = new FormControl('');
2559
+ /**站点下的版块 */
2560
+ this.SiteOfSectionList = [];
2561
+ }
2562
+ set type(v) {
2563
+ if (v == this._type)
2564
+ return;
2565
+ this._type = v;
2566
+ }
2567
+ set Entity(v) {
2568
+ this._Entity = v;
2569
+ }
2570
+ set selected(v) {
2571
+ this._selected = v;
2572
+ }
2573
+ set culture(v) {
2574
+ this._culture = v;
2575
+ }
2576
+ get formConfiguration() {
2577
+ return this._Entity.get('formConfiguration');
2578
+ }
2579
+ ngAfterContentInit() {
2580
+ //Called after ngOnInit when the component's or directive's content has been initialized.
2581
+ //Add 'implements AfterContentInit' to the class.
2582
+ this.dataLoaded(2);
2583
+ }
2584
+ async dataLoaded(val) {
2585
+ if (this._Entity && this._type) {
2586
+ await this.AfterInit();
2587
+ this.submitclick.nativeElement.click();
2588
+ }
2589
+ }
2590
+ AfterInit() {
2591
+ return new Promise(async (resolve, rejects) => {
2592
+ this._Entity.setControl('formConfiguration', this.fb.group(new EntryConfig()));
2593
+ // await this.getsiteList()
2594
+ await this.getSiteOfSectionList();
2595
+ if (this._selected) {
2596
+ this.formConfiguration.patchValue({
2597
+ ...this._selected.formConfiguration
2598
+ });
2599
+ }
2600
+ resolve(true);
2601
+ });
2602
+ }
2603
+ /**获取站点列表 */
2604
+ // getsiteList() {
2605
+ // return new Promise((resolve, rejects) => {
2606
+ // this._SiteAdminService.getList({}).subscribe(res => {
2607
+ // this.siteList = res.items
2608
+ // this.siteId = res.items[0]?.id || ''
2609
+ // resolve(res.items)
2610
+ // })
2611
+ // })
2612
+ // }
2613
+ /**获取站点下的版块 */
2614
+ getSiteOfSectionList() {
2615
+ return new Promise((resolve, rejects) => {
2616
+ this._SectionAdminService.getList({
2617
+ maxResultCount: 1000,
2618
+ // siteId: this.siteId
2619
+ }).subscribe(res => {
2620
+ this.SiteOfSectionList = res.items;
2621
+ this.formConfiguration.patchValue({
2622
+ 'Entry.SectionId': res.items[0]?.id || ''
2623
+ });
2624
+ resolve(res.items);
2625
+ });
2626
+ });
2627
+ }
2628
+ /**切换站点 */
2629
+ async siteIdChange() {
2630
+ await this.getSiteOfSectionList();
2631
+ }
2632
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: SectionAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
2633
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntryConfigComponent, selector: "cms-entry-config", inputs: { type: "type", Entity: "Entity", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<!-- <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div> -->\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2634
+ }
2635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, decorators: [{
2636
+ type: Component,
2637
+ args: [{ selector: 'cms-entry-config', template: "<!-- <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div> -->\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"] }]
2638
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: SectionAdminService }], propDecorators: { type: [{
2639
+ type: Input
2640
+ }], Entity: [{
2641
+ type: Input
2642
+ }], selected: [{
2643
+ type: Input
2644
+ }], culture: [{
2645
+ type: Input
2646
+ }], submitclick: [{
2647
+ type: ViewChild,
2648
+ args: ['submitclick', { static: true }]
2649
+ }] } });
2650
+
2651
+ /* eslint-disable @angular-eslint/component-selector */
2652
+ class EntryControlComponent {
2653
+ constructor() {
2654
+ this.fb = inject(FormBuilder);
2655
+ this._EntryAdminService = inject(EntryAdminService);
2656
+ /**字段配置列表 */
2657
+ this._fields = '';
2658
+ /** */
2659
+ this.listOfOption = [];
2660
+ }
2661
+ set entity(v) {
2662
+ this._entity = v;
2663
+ if (v)
2664
+ this.dataLoaded();
2665
+ }
2666
+ set fields(v) {
2667
+ this._fields = v;
2668
+ if (v)
2669
+ this.dataLoaded();
2670
+ }
2671
+ set parentFiledName(v) {
2672
+ this._parentFiledName = v;
2673
+ if (v)
2674
+ this.dataLoaded();
2675
+ }
2676
+ set selected(v) {
2677
+ this._selected = v || [];
2678
+ if (v)
2679
+ this.dataLoaded();
2680
+ }
2681
+ set culture(v) {
2682
+ if (v) {
2683
+ this._culture = v;
2684
+ this.dataLoaded();
2685
+ }
2686
+ }
2687
+ async dataLoaded() {
2688
+ if (this._fields && this._entity && this._parentFiledName && this._culture) {
2689
+ await this.AfterInit();
2690
+ await this.getEntryAssignList();
2691
+ this.submitclick.nativeElement.click();
2692
+ }
2693
+ }
2694
+ AfterInit() {
2695
+ return new Promise((resolve, rejects) => {
2696
+ let ValidatorsArray = [];
2697
+ if (this._fields.required) {
2698
+ ValidatorsArray.push(Validators.required);
2699
+ }
2700
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
2701
+ let extraProperties = this._entity.get(this._parentFiledName);
2702
+ extraProperties.setControl(this._fields.field.name, newControl);
2703
+ resolve(true);
2704
+ });
2705
+ }
2706
+ /**获取对应的条目 */
2707
+ getEntryAssignList(filter = '') {
2708
+ return new Promise((resolve, rejects) => {
2709
+ this._EntryAdminService.getList({
2710
+ culture: this._culture,
2711
+ sectionId: this._fields.field.formConfiguration['Entry.SectionId'],
2712
+ skipCount: 0,
2713
+ maxResultCount: 30,
2714
+ status: EntryStatus.Published,
2715
+ filter: filter
2716
+ }).subscribe(res => {
2717
+ this.listOfOption = res.items;
2718
+ resolve(true);
2719
+ });
2720
+ });
2721
+ }
2722
+ /** */
2723
+ async SelectChange(event) {
2724
+ await this.getEntryAssignList(event);
2725
+ }
2726
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2727
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntryControlComponent, selector: "cms-entry-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] }); }
2728
+ }
2729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, decorators: [{
2730
+ type: Component,
2731
+ args: [{ selector: 'cms-entry-control', template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"] }]
2732
+ }], ctorParameters: () => [], propDecorators: { entity: [{
2733
+ type: Input
2734
+ }], fields: [{
2735
+ type: Input
2736
+ }], parentFiledName: [{
2737
+ type: Input
2738
+ }], selected: [{
2739
+ type: Input
2740
+ }], culture: [{
2741
+ type: Input
2742
+ }], submitclick: [{
2743
+ type: ViewChild,
2744
+ args: ['submitclick', { static: true }]
2745
+ }] } });
2746
+
2747
+ class MatrixConfig {
2748
+ constructor(data) {
2749
+ // 矩阵类型
2750
+ this['MatrixBlockTypes'] = new FormArray([]);
2751
+ if (data) {
2752
+ for (const key in data) {
2753
+ if (data.hasOwnProperty(key)) {
2754
+ this[key] = data[key];
2755
+ }
2756
+ }
2757
+ }
2758
+ }
2759
+ }
2760
+ class MatrixItemConfig {
2761
+ constructor(data) {
2762
+ this.displayName = ['', [Validators.required]];
2763
+ /**字段名字 */
2764
+ this.name = ['', [Validators.required]];
2765
+ if (data) {
2766
+ for (const key in data) {
2767
+ if (data.hasOwnProperty(key)) {
2768
+ this[key] = data[key];
2769
+ }
2770
+ }
2771
+ }
2772
+ }
2773
+ }
2774
+ class matrixFieldInputBase {
2775
+ constructor(data) {
2776
+ /**字段名称 Display name of this field */
2777
+ this.displayName = ['', [Validators.required]];
2778
+ /**字段唯一名称 Unique Name*/
2779
+ this.name = ['', [Validators.required]];
2780
+ /**描述 说明 */
2781
+ this.description = ['', []];
2782
+ /**FieldType字段类型 表单控件名称 */
2783
+ this.formControlName = ['TextEdit', [Validators.required]];
2784
+ /**动态表单配置 */
2785
+ this.formConfiguration = new FormGroup({});
2786
+ if (data) {
2787
+ for (const key in data) {
2788
+ if (data.hasOwnProperty(key)) {
2789
+ this[key] = data[key];
2790
+ }
2791
+ }
2792
+ }
2793
+ }
2794
+ }
2795
+
2796
+ /* eslint-disable @angular-eslint/component-selector */
2797
+ class MatrixConfigComponent {
2798
+ constructor(fb, _CmsApiService, _FieldAbstractsService) {
2799
+ this.fb = fb;
2800
+ this._CmsApiService = _CmsApiService;
2801
+ this._FieldAbstractsService = _FieldAbstractsService;
2802
+ /**模态框-状态 */
2803
+ this.matrixModalOpen = false;
2804
+ /**模态框-是否正在编辑 */
2805
+ this.isMatrixModalEdit = false;
2806
+ /**模态框-用于确定模态的繁忙状态是否为真 */
2807
+ this.modalBusy = false;
2808
+ /**矩阵块-选择的下标 */
2809
+ this.selectMatrixBlockIndex = 0;
2810
+ /**矩阵块-选择的矩阵下字段的下标 */
2811
+ this.selectMatrixFieldIndex = 0;
2812
+ }
2813
+ set type(v) {
2814
+ this._type = v;
2815
+ this.dataLoaded();
2816
+ }
2817
+ set Entity(v) {
2818
+ this._Entity = v;
2819
+ this.dataLoaded();
2820
+ }
2821
+ set selected(v) {
2822
+ if (v) {
2823
+ this._selected = v;
2824
+ this.dataLoaded();
2825
+ }
2826
+ }
2827
+ async dataLoaded() {
2828
+ if (this._Entity && this._type) {
2829
+ await this.AfterInit();
2830
+ this.submitclick.nativeElement.click();
2831
+ }
2832
+ }
2833
+ AfterInit() {
2834
+ return new Promise(async (resolve, rejects) => {
2835
+ this._FieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
2836
+ this._Entity.setControl('formConfiguration', this.fb.group(new MatrixConfig()));
2837
+ await this.setSelectValue();
2838
+ this.formConfiguration.patchValue(this._selected.formConfiguration);
2839
+ resolve(true);
2840
+ });
2841
+ }
2842
+ setSelectValue() {
2843
+ return new Promise((resolve, rejects) => {
2844
+ if (this._selected && this._selected.formControlName == this._type) {
2845
+ this._selected.formConfiguration['MatrixBlockTypes'].forEach(((el, index) => {
2846
+ this.addMatrixBlockTypeItem(el);
2847
+ el.fields.forEach((elf, indexf) => {
2848
+ this.addMatrixFieldItem(elf, index);
2849
+ });
2850
+ }));
2851
+ resolve(true);
2852
+ }
2853
+ });
2854
+ }
2855
+ /**获取表单配置 */
2856
+ get formConfiguration() {
2857
+ return this._Entity.get('formConfiguration');
2858
+ }
2859
+ /**获取表单配置下的矩阵块表单数组 */
2860
+ get MatrixBlockTypes() {
2861
+ return this.formConfiguration.controls['MatrixBlockTypes'];
2862
+ }
2863
+ /**模态框-状态改变 */
2864
+ matrixModalVisibleChange(event) {
2865
+ if (!event) {
2866
+ this.isMatrixModalEdit = false;
2867
+ this.matrixModalForm = undefined;
2868
+ return;
2869
+ }
2870
+ }
2871
+ /**矩阵块--新增-打开模态框 */
2872
+ addMatrixBlockType() {
2873
+ this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2874
+ this.matrixModalOpen = true;
2875
+ }
2876
+ /**模态框--矩阵表单保存提交 */
2877
+ createOrEditSave() {
2878
+ let input = this.matrixModalForm.value;
2879
+ if (!this.matrixModalForm.valid)
2880
+ return;
2881
+ if (this.isMatrixModalEdit) {
2882
+ let MatrixBlockTypesItem = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2883
+ MatrixBlockTypesItem.patchValue({
2884
+ ...input
2885
+ });
2886
+ }
2887
+ else {
2888
+ this.addMatrixBlockTypeItem(input);
2889
+ }
2890
+ this.matrixModalOpen = false;
2891
+ }
2892
+ /**新增矩阵块-向数组表单中增加项 */
2893
+ addMatrixBlockTypeItem(input) {
2894
+ this.MatrixBlockTypes.push(new FormGroup({
2895
+ displayName: new FormControl(input.displayName, Validators.required),
2896
+ name: new FormControl(input.name, Validators.required),
2897
+ fields: new FormArray([])
2898
+ }));
2899
+ }
2900
+ /**编辑矩阵块 */
2901
+ EditMatrixBlock(input) {
2902
+ this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2903
+ this.matrixModalForm.patchValue({
2904
+ ...input
2905
+ });
2906
+ this.matrixModalOpen = true;
2907
+ this.isMatrixModalEdit = true;
2908
+ }
2909
+ /**删除矩阵块 */
2910
+ DeleteMatrixBlock(index) {
2911
+ this.MatrixBlockTypes.removeAt(index);
2912
+ }
2913
+ /**矩阵块-选择 */
2914
+ selectMatrixBlockChange(index) {
2915
+ this.selectMatrixBlockIndex = index;
2916
+ }
2917
+ /**矩阵字段-新增 */
2918
+ addMatrixField() {
2919
+ this.addMatrixFieldItem('', this.selectMatrixBlockIndex);
2920
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2921
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2922
+ this.selectMatrixFieldChange(0, MatrixFieldItemForm.length - 1);
2923
+ }
2924
+ /**矩阵字段-新增矩阵字段项 */
2925
+ addMatrixFieldItem(input = '', selectMatrixBlockIndex) {
2926
+ /**矩阵下标的矩阵项Form */
2927
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(selectMatrixBlockIndex);
2928
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2929
+ MatrixFieldItemForm.push(this.fb.group({
2930
+ /**字段名称 Display name of this field */
2931
+ displayName: [input.displayName, [Validators.required]],
2932
+ /**字段唯一名称 Unique Name*/
2933
+ name: [input.name, [Validators.required]],
2934
+ /**描述 说明 */
2935
+ description: [input.description, []],
2936
+ /**FieldType字段类型 表单控件名称 */
2937
+ formControlName: [input.formControlName || 'TextEdit', [Validators.required]],
2938
+ //动态表单配置
2939
+ formConfiguration: new FormGroup({}),
2940
+ }));
2941
+ //
2942
+ }
2943
+ /**删除矩阵字段项 */
2944
+ deleteMatrixField(MatrixFieldForm, index) {
2945
+ MatrixFieldForm.removeAt(index);
2946
+ this.selectMatrixFieldIndex = 0;
2947
+ }
2948
+ /**矩阵字段-选择 */
2949
+ selectMatrixFieldChange(MatrixBlockIndex, MatrixFieldIndex) {
2950
+ this.selectMatrixFieldIndex = MatrixFieldIndex;
2951
+ }
2952
+ get nameInput() {
2953
+ return this.matrixModalForm?.get('name');
2954
+ }
2955
+ get FieldnameInput() {
2956
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2957
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2958
+ return MatrixFieldItemForm.at(this.selectMatrixFieldIndex).get('name');
2959
+ }
2960
+ /**矩阵displayNameInput字段失去焦点 */
2961
+ displayNameInputBlur(event) {
2962
+ let value = event.target.value;
2963
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2964
+ let nameInput = this.nameInput;
2965
+ if (nameInput.value)
2966
+ return;
2967
+ nameInput.patchValue(pinyin);
2968
+ }
2969
+ /**矩阵displayNameInput字段失去焦点 */
2970
+ MatrixFieldDisplayNameInputBlur(event) {
2971
+ let value = event.target.value;
2972
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2973
+ let FieldnameInput = this.FieldnameInput;
2974
+ if (FieldnameInput.value)
2975
+ return;
2976
+ FieldnameInput.patchValue(pinyin);
2977
+ }
2978
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
2979
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: MatrixConfigComponent, selector: "df-matrix-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "matrixModalModalSubmit", first: true, predicate: ["matrixModalModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2980
+ }
2981
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, decorators: [{
2982
+ type: Component,
2983
+ args: [{ selector: 'df-matrix-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
2984
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { type: [{
2985
+ type: Input
2986
+ }], Entity: [{
2987
+ type: Input
2988
+ }], selected: [{
2989
+ type: Input
2990
+ }], submitclick: [{
2991
+ type: ViewChild,
2992
+ args: ['submitclick', { static: true }]
2993
+ }], matrixModalModalSubmit: [{
2994
+ type: ViewChild,
2995
+ args: ['matrixModalModalSubmit', { static: false }]
2996
+ }] } });
2997
+
2998
+ /* eslint-disable @angular-eslint/component-selector */
2999
+ class MatrixControlComponent {
3000
+ constructor(fb) {
3001
+ this.fb = fb;
3002
+ /**字段配置列表 */
3003
+ this._fields = '';
3004
+ /**矩阵列表 */
3005
+ this.MatrixBlockTypesList = [];
3006
+ }
3007
+ set entity(v) {
3008
+ this._entity = v;
3009
+ this.dataLoaded();
3010
+ }
3011
+ set fields(v) {
3012
+ this._fields = v;
3013
+ this.dataLoaded();
3014
+ }
3015
+ set parentFiledName(v) {
3016
+ this._parentFiledName = v;
3017
+ this.dataLoaded();
3018
+ }
3019
+ set selected(v) {
3020
+ this._selected = v;
3021
+ if (v) {
3022
+ this.dataLoaded();
3023
+ }
3024
+ }
3025
+ set culture(v) {
3026
+ this._culture = v;
3027
+ }
3028
+ /**数据加载完成 */
3029
+ async dataLoaded() {
3030
+ if (this._fields && this._entity && this._parentFiledName) {
3031
+ this.extraProperties = this._entity.get(this._parentFiledName);
3032
+ await this.AfterInit();
3033
+ this.submitclick.nativeElement.click();
3034
+ if (this._selected)
3035
+ this.fieldNameControl.patchValue(this._selected);
3036
+ }
3037
+ }
3038
+ AfterInit() {
3039
+ return new Promise((resolve, rejects) => {
3040
+ let formConfiguration = this._fields.field.formConfiguration;
3041
+ let newArrayGroup = this.fb.array([]);
3042
+ this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
3043
+ this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
3044
+ if (this._selected) {
3045
+ this._selected.forEach(el => {
3046
+ this.addMatrixControl(formConfiguration.MatrixBlockTypes.find(item => item.name == el.matrixBlockTypeName));
3047
+ });
3048
+ }
3049
+ this.MatrixBlockTypesList = formConfiguration.MatrixBlockTypes;
3050
+ resolve(true);
3051
+ });
3052
+ }
3053
+ /**增加指定矩阵控件项 */
3054
+ addMatrixControl(item) {
3055
+ this.fieldNameControl.push(this.fb.group({
3056
+ extraProperties: new FormGroup({
3057
+ name: new FormControl('')
3058
+ }),
3059
+ matrixBlockTypeName: [item.name],
3060
+ displayName: [item.displayName]
3061
+ }));
3062
+ }
3063
+ /**删除矩阵控件 */
3064
+ deleteMatrixControl(index) {
3065
+ this.fieldNameControl.removeAt(index);
3066
+ }
3067
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3068
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: MatrixControlComponent, selector: "df-matrix-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_selected[i][_parentFiledName][elf.name]:'': ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] }); }
3069
+ }
3070
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, decorators: [{
3071
+ type: Component,
3072
+ args: [{ selector: 'df-matrix-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_selected[i][_parentFiledName][elf.name]:'': ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>" }]
3073
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { entity: [{
3074
+ type: Input
3075
+ }], fields: [{
3076
+ type: Input
3077
+ }], parentFiledName: [{
3078
+ type: Input
3079
+ }], selected: [{
3080
+ type: Input
3081
+ }], culture: [{
3082
+ type: Input
3083
+ }], submitclick: [{
3084
+ type: ViewChild,
3085
+ args: ['submitclick', { static: true }]
3086
+ }] } });
3087
+
3088
+ class TableConfig {
3089
+ constructor(data) {
3090
+ // 选项
3091
+ this.TableColumns = new FormArray([]);
3092
+ if (data) {
3093
+ for (const key in data) {
3094
+ if (data.hasOwnProperty(key)) {
3095
+ this[key] = data[key];
3096
+ }
3097
+ }
3098
+ }
3099
+ }
3100
+ }
3101
+ class TableFormControl {
3102
+ constructor(data) {
3103
+ /**列标题 */
3104
+ this.displayName = ['', [Validators.required]];
3105
+ /**空间配置 */
3106
+ this.formConfiguration = new FormGroup({});
3107
+ /**列名 */
3108
+ this.name = ['', [Validators.required]];
3109
+ //控件标识
3110
+ this.formControlName = ['', [Validators.required]];
3111
+ /**是否必填 */
3112
+ this.required = [false];
3113
+ /**描述 */
3114
+ this.description = [''];
3115
+ if (data) {
3116
+ for (const key in data) {
3117
+ if (data.hasOwnProperty(key)) {
3118
+ this[key] = data[key];
3119
+ }
3120
+ }
3121
+ }
3122
+ }
3123
+ }
3124
+
3125
+ /* eslint-disable @angular-eslint/component-selector */
3126
+ class TableConfigComponent {
3127
+ constructor(fb, _CmsApiService, _FieldAbstractsService) {
3128
+ this.fb = fb;
3129
+ this._CmsApiService = _CmsApiService;
3130
+ this._FieldAbstractsService = _FieldAbstractsService;
3131
+ /**创建站点模态框状态 */
3132
+ this.tableSelectOpen = false;
3133
+ /**用于确定模态的繁忙状态是否为真 */
3134
+ this.modalBusy = false;
3135
+ }
3136
+ set Entity(v) {
3137
+ this._Entity = v;
3138
+ this.dataLoaded();
3139
+ }
3140
+ set selected(v) {
3141
+ if (v) {
3142
+ this._selected = v;
3143
+ this.dataLoaded();
3144
+ }
3145
+ }
3146
+ set type(v) {
3147
+ this._type = v;
3148
+ this.dataLoaded();
3149
+ }
3150
+ get formConfiguration() {
3151
+ return this._Entity.get('formConfiguration');
3152
+ }
3153
+ get TableColumns() {
3154
+ return this.formConfiguration.controls['TableColumns'];
3155
+ }
3156
+ async dataLoaded() {
3157
+ if (this._Entity && this._type) {
3158
+ await this.AfterInit();
3159
+ this.submitclick.nativeElement.click();
3160
+ }
3161
+ }
3162
+ /**增加选项 */
3163
+ addTableColumns() {
3164
+ this.TableColumns.push(this.fb.group({
3165
+ ...new TableFormControl(),
3166
+ formConfiguration: [{}]
3167
+ }));
3168
+ }
3169
+ /**删除某个选项 */
3170
+ deleteTableColumns(index) {
3171
+ this.TableColumns.removeAt(index);
3172
+ }
3173
+ AfterInit() {
3174
+ return new Promise((resolve, rejects) => {
3175
+ this._Entity.setControl('formConfiguration', this.fb.group(new TableConfig()));
3176
+ this._fieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
3177
+ if (this._selected && this._selected.formControlName == this._type) {
3178
+ this._selected.formConfiguration['TableColumns'].forEach(el => {
3179
+ this.addTableColumns();
3180
+ });
3181
+ this.formConfiguration.patchValue(this._selected.formConfiguration);
3182
+ }
3183
+ else {
3184
+ this.addTableColumns();
3185
+ }
3186
+ resolve(true);
3187
+ });
3188
+ }
3189
+ /**选择表格的表单控件 */
3190
+ selectTableControl(event, i, item) {
3191
+ this.CurrentSelectionTableControlName = event.target.value;
3192
+ this.tableSelectOpen = true;
3193
+ this.tableSelectForm = this.fb.group(new TableFormControl());
3194
+ this.TableColumnsIndex = i;
3195
+ this.itemForm = item;
3196
+ }
3197
+ /**创建站点模态框状态改变 */
3198
+ tableSelectVisibleChange(event) {
3199
+ if (!event) {
3200
+ this._tableSelected = undefined;
3201
+ this.tableSelectForm = undefined;
3202
+ this.CurrentSelectionTableControlName = undefined;
3203
+ this.TableColumnsIndex = undefined;
3204
+ return;
3205
+ }
3206
+ }
3207
+ /**表单保存提交 */
3208
+ createOrEditSave() {
3209
+ const formGroup = this.TableColumns.at(this.TableColumnsIndex);
3210
+ let formConfigurationgroup = formGroup.get('formConfiguration');
3211
+ formConfigurationgroup.setValue({
3212
+ ...this.tableSelectForm.value['formConfiguration'],
3213
+ });
3214
+ this.tableSelectOpen = false;
3215
+ }
3216
+ /**编辑站点按钮 */
3217
+ EditSitesBtn(rows, i) {
3218
+ this.CurrentSelectionTableControlName = rows.get('formControlName').value;
3219
+ this.tableSelectForm = this.fb.group(new TableFormControl());
3220
+ this.tableSelectForm.patchValue({
3221
+ ...rows.value
3222
+ });
3223
+ this.tableSelectForm.get('formConfiguration').patchValue({
3224
+ ...rows.value['formConfiguration']
3225
+ });
3226
+ this._tableSelected = rows.value;
3227
+ this.TableColumnsIndex = i;
3228
+ this.tableSelectOpen = true;
3229
+ }
3230
+ /**调整表格位置 */
3231
+ TableArrowUpOrDown(type, index) {
3232
+ let controlAt = this.TableColumns.at(index);
3233
+ this.TableColumns.removeAt(index);
3234
+ let lastindex = type == 'up' ? index - 1 : index + 1;
3235
+ this.TableColumns.insert(lastindex, controlAt);
3236
+ }
3237
+ /**字段标签input失去标点生成字段名字 */
3238
+ disPlayNameInputBlur(event, item) {
3239
+ let value = event.target.value;
3240
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
3241
+ let nameInput = item.get('name');
3242
+ if (nameInput.value)
3243
+ return;
3244
+ nameInput.patchValue(pinyin);
3245
+ }
3246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
3247
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TableConfigComponent, selector: "df-table-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "tableSelectModalSubmit", first: true, predicate: ["tableSelectModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
3248
+ }
3249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, decorators: [{
3250
+ type: Component,
3251
+ args: [{ selector: 'df-table-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
3252
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { Entity: [{
3253
+ type: Input
3254
+ }], selected: [{
3255
+ type: Input
3256
+ }], type: [{
3257
+ type: Input
3258
+ }], submitclick: [{
3259
+ type: ViewChild,
3260
+ args: ['submitclick', { static: true }]
3261
+ }], tableSelectModalSubmit: [{
3262
+ type: ViewChild,
3263
+ args: ['tableSelectModalSubmit', { static: false }]
3264
+ }] } });
3265
+
3266
+ class TableControlComponent {
3267
+ constructor() {
3268
+ this.fb = inject(FormBuilder);
3269
+ /**字段配置列表 */
3270
+ this._fields = '';
3271
+ }
3272
+ set entity(v) {
3273
+ this._entity = v;
3274
+ this.dataLoaded();
3275
+ }
3276
+ set fields(v) {
3277
+ this._fields = v;
3278
+ this.dataLoaded();
3279
+ }
3280
+ set parentFiledName(v) {
3281
+ this._parentFiledName = v;
3282
+ this.dataLoaded();
3283
+ }
3284
+ set selected(v) {
3285
+ this._selected = v;
3286
+ if (v) {
3287
+ this.dataLoaded();
3288
+ }
3289
+ }
3290
+ set culture(v) {
3291
+ this._culture = v;
3292
+ }
3293
+ /**数据加载完成 */
3294
+ async dataLoaded() {
3295
+ if (this._fields && this._entity && this._parentFiledName) {
3296
+ this.extraProperties = this._entity.get(this._parentFiledName);
3297
+ await this.AfterInit();
3298
+ this.submitclick.nativeElement.click();
3299
+ }
3300
+ }
3301
+ AfterInit() {
3302
+ return new Promise((resolve, rejects) => {
3303
+ let ValidatorsArray = [];
3304
+ if (this._fields.required) {
3305
+ ValidatorsArray.push(Validators.required);
3306
+ }
3307
+ let formConfiguration = this._fields.field.formConfiguration;
3308
+ this.formConfiguration = formConfiguration;
3309
+ let newArrayGroup = this.fb.array([]);
3310
+ this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
3311
+ this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
3312
+ if (this._selected) {
3313
+ this._selected.forEach(el => {
3314
+ this.addTableControlItem();
3315
+ });
3316
+ this.fieldNameControl.patchValue(this._selected);
3317
+ }
3318
+ else {
3319
+ this.addTableControlItem();
3320
+ }
3321
+ resolve(true);
3322
+ });
3323
+ }
3324
+ /**增加表格项 */
3325
+ addTableControlItem() {
3326
+ this.fieldNameControl.push(this.fb.group({
3327
+ 'extraProperties': this.fb.group({})
3328
+ }));
3329
+ }
3330
+ /**删除表格项 */
3331
+ minusTableControlItem(index) {
3332
+ this.fieldNameControl.removeAt(index);
3333
+ }
3334
+ /**调整表格位置 */
3335
+ TableArrowUpOrDown(type, index) {
3336
+ let controlAt = this.fieldNameControl.at(index);
3337
+ this.fieldNameControl.removeAt(index);
3338
+ let lastindex = type == 'up' ? index - 1 : index + 1;
3339
+ this.fieldNameControl.insert(lastindex, controlAt);
3340
+ this._selected = this.fieldNameControl.value;
3341
+ }
3342
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3343
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TableControlComponent, selector: "df-table-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] }); }
3344
+ }
3345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, decorators: [{
3346
+ type: Component,
3347
+ args: [{ selector: 'df-table-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
3348
+ }], ctorParameters: () => [], propDecorators: { entity: [{
3349
+ type: Input
3350
+ }], fields: [{
3351
+ type: Input
3352
+ }], parentFiledName: [{
3353
+ type: Input
3354
+ }], selected: [{
3355
+ type: Input
3356
+ }], culture: [{
3357
+ type: Input
3358
+ }], submitclick: [{
3359
+ type: ViewChild,
3360
+ args: ['submitclick', { static: true }]
3361
+ }] } });
3362
+
3363
+ /**
3364
+ * 表单控件分组-包含配置,控件,显示的数组
3365
+ */
3366
+ const FieldControlGroup = [
3367
+ {
3368
+ displayName: '表格',
3369
+ name: 'Table',
3370
+ fieldConfigComponent: TableConfigComponent,
3371
+ fieldComponent: TableControlComponent,
3372
+ },
3373
+ {
3374
+ displayName: '矩阵',
3375
+ name: 'Matrix',
3376
+ fieldConfigComponent: MatrixConfigComponent,
3377
+ fieldComponent: MatrixControlComponent,
3378
+ },
3379
+ {
3380
+ displayName: '条目',
3381
+ name: 'Entry',
3382
+ fieldConfigComponent: EntryConfigComponent,
3383
+ fieldComponent: EntryControlComponent,
3384
+ },
3385
+ ];
3386
+
3387
+ var styles = `
3388
+ .lpx-content-container .lpx-content{min-height:calc(100vh - 34px);padding:1.25em 2em 1.25em}h1,h2,h3,h4,h5,h6{color:inherit}.lpx-settings .lpx-context-menu{overflow:auto}
3389
+ a {
3390
+ text-decoration: unset;
3391
+ }
3392
+
3393
+ .form-label{
3394
+ font-size: 12px;
3395
+ }
3396
+ :root select{
3397
+ cursor: pointer; /* this will show the pointer when hovering */
3398
+ }
3399
+ .cdk-global-overlay-wrapper, .cdk-overlay-container {pointer-events: none;top: 0;left: 0;height: 100%;width: 100% }.cdk-overlay-container {position: fixed;z-index: 1000 }.cdk-overlay-container:empty {display: none }.cdk-global-overlay-wrapper, .cdk-overlay-connected-position-bounding-box, .cdk-overlay-pane {position: absolute;z-index: 1000;display: flex }.cdk-overlay-pane {pointer-events: auto;box-sizing: border-box;max-width: 100%;max-height: 100% }.cdk-overlay-backdrop {position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 1000;pointer-events: auto;transition: opacity .4s cubic-bezier(.25, .8, .25, 1);opacity: 0 }.cdk-overlay-backdrop.cdk-overlay-backdrop-showing {opacity: 1 }.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing {opacity: .6 }.cdk-overlay-dark-backdrop {background: rgba(0, 0, 0, .32) }.cdk-overlay-transparent-backdrop {transition: visibility 1ms linear, opacity 1ms linear;visibility: hidden;opacity: 1 }.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing {opacity: 0;visibility: visible }.cdk-overlay-backdrop-noop-animation {transition: none }.cdk-overlay-connected-position-bounding-box {flex-direction: column;min-width: 1px;min-height: 1px }.cdk-global-scrollblock {position: fixed;width: 100%;overflow-y: scroll }.cdk-visually-hidden {border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;outline: 0;-webkit-appearance: none;-moz-appearance: none }.nz-overlay-transparent-backdrop, .nz-overlay-transparent-backdrop.cdk-overlay-backdrop-showing {opacity: 0 }.ant-select, .ant-select-dropdown {margin: 0;line-height: 1.5715;box-sizing: border-box;font-feature-settings: 'tnum';list-style: none }.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottom, .ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomLeft, .ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomRight, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottom, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomLeft, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomRight, .ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-bottomLeft, .ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-bottomLeft {animation-name: antSlideUpIn }.ant-select-dropdown.ant-select-tree-dropdown {top: 100%;left: 0;position: relative;width: 100%;margin-top: 4px;margin-bottom: 4px;overflow: auto }.ant-select-dropdown-hidden, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info::before {display: none }.ant-select-dropdown {top: 100%;left: 0;position: relative;width: 100%;margin-top: 4px;margin-bottom: 4px;display: block }.ant-select-dropdown .cdk-virtual-scroll-content-wrapper {right: 0 }.ant-select-dropdown .full-width {contain: initial }.ant-select-dropdown .full-width .cdk-virtual-scroll-content-wrapper {position: static }.ant-select-dropdown .full-width .cdk-virtual-scroll-spacer {position: absolute;top: 0;width: 1px }.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topLeft, .ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topLeft {animation-name: antSlideDownIn }.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-bottomLeft {animation-name: antSlideUpOut }.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topLeft {animation-name: antSlideDownOut }
3400
+
3401
+ /*** 表单验证样式 start */
3402
+ .was-validated .form-control:invalid, .form-control.is-invalid{
3403
+ border-color: #c00d49 !important;
3404
+ }
3405
+ /*** 表单验证样式 end */
3406
+ `;
3407
+
3408
+ let isAppentStyle = false;
3409
+ function appentStyle() {
3410
+ /**确保该路由守卫只会执行一次 */
3411
+ if (isAppentStyle)
3412
+ return;
3413
+ isAppentStyle = true;
3414
+ const rendererFactory = inject(RendererFactory2);
3415
+ let renderer = rendererFactory.createRenderer(null, null);
3416
+ const style = renderer.createElement('style');
3417
+ renderer.setProperty(style, 'innerHTML', styles);
3418
+ renderer.appendChild(document.head, style);
3419
+ }
3420
+
3421
+ /**版块 */
3422
+ const Sections_Defaults_Toolbar_Action = ToolbarAction.createMany([
3423
+ {
3424
+ text: 'Cms::New',
3425
+ action: data => {
3426
+ const component = data.getInjected(SectionsComponent);
3427
+ component.createSectionBtn();
3428
+ },
3429
+ btnClass: '',
3430
+ permission: 'CmsAdmin.Entry.Create',
3431
+ icon: 'fa fa-plus',
3432
+ },
3433
+ ]);
3434
+ /**版块-创建-编辑 */
3435
+ const Sections_Create_Or_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3436
+ {
3437
+ text: 'AbpUi::Save',
3438
+ action: data => {
3439
+ const component = data.getInjected(CreateOrEditComponent);
3440
+ component.submitclickBtn();
3441
+ },
3442
+ btnClass: '',
3443
+ permission: 'CmsAdmin.Entry.Create',
3444
+ icon: 'fas fa-save',
3445
+ },
3446
+ ]);
3447
+ /**站点 */
3448
+ // export const Sites_Defaults_Toolbar_Action = ToolbarAction.createMany<any[]>([
3449
+ // {
3450
+ // text: 'Cms::New',
3451
+ // action: data => {
3452
+ // const component = data.getInjected(SitesComponent);
3453
+ // // component.createSitesBtn();
3454
+ // },
3455
+ // btnClass: '',
3456
+ // permission: 'CmsAdmin.Entry.Create',
3457
+ // icon: 'fa fa-plus',
3458
+ // },
3459
+ // ]);
3460
+ /**字段 */
3461
+ const Fields_Defaults_Toolbar_Action = ToolbarAction.createMany([
3462
+ {
3463
+ text: 'Cms::New',
3464
+ action: data => {
3465
+ const component = data.getInjected(FieldsComponent);
3466
+ component.toFieldsCreateBtn();
3467
+ },
3468
+ btnClass: '',
3469
+ permission: 'CmsAdmin.Entry.Create',
3470
+ icon: 'fa fa-plus',
3471
+ },
3472
+ ]);
3473
+ /**字段-创建 */
3474
+ const Fields_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3475
+ {
3476
+ text: 'AbpUi::Save',
3477
+ action: data => {
3478
+ const component = data.getInjected(CreateFieldComponent);
3479
+ component.submitclickBtn();
3480
+ },
3481
+ btnClass: '',
3482
+ permission: 'CmsAdmin.Entry.Create',
3483
+ icon: 'fas fa-save',
3484
+ },
3485
+ ]);
3486
+ /**字段-创建 */
3487
+ const Fields_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3488
+ {
3489
+ text: 'AbpUi::Save',
3490
+ action: data => {
3491
+ const component = data.getInjected(EditFieldComponent);
3492
+ component.submitclickBtn();
3493
+ },
3494
+ btnClass: '',
3495
+ permission: 'CmsAdmin.Entry.Create',
3496
+ icon: 'fas fa-save',
3497
+ },
3498
+ ]);
3499
+ /**条目 */
3500
+ const Entries_Defaults_Toolbar_Action = ToolbarAction.createMany([
3501
+ {
3502
+ text: 'Cms::New',
3503
+ action: data => {
3504
+ const component = data.getInjected(EntriesComponent);
3505
+ component.createEntriesBtn();
3506
+ },
3507
+ btnClass: '',
3508
+ permission: 'CmsAdmin.Entry.Create',
3509
+ icon: 'fa fa-plus',
3510
+ },
3511
+ ]);
3512
+ /**条目-创建 */
3513
+ const Entries_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3514
+ {
3515
+ text: 'AbpUi::Cancel',
3516
+ action: data => {
3517
+ const component = data.getInjected(CreateComponent);
3518
+ component.backTo();
3519
+ },
3520
+ btnClass: 'btn btn-light btn-sm',
3521
+ permission: 'CmsAdmin.Entry.Create',
3522
+ icon: '',
3523
+ },
3524
+ {
3525
+ text: 'AbpUi::Save',
3526
+ action: data => {
3527
+ const component = data.getInjected(CreateComponent);
3528
+ component.clickSubmit(true);
3529
+ },
3530
+ btnClass: 'btn btn-info btn-sm',
3531
+ permission: 'CmsAdmin.Entry.Create',
3532
+ icon: 'fas fa-save',
3533
+ },
3534
+ {
3535
+ text: 'Cms::Publish',
3536
+ action: data => {
3537
+ const component = data.getInjected(CreateComponent);
3538
+ component.clickSubmit(false);
3539
+ },
3540
+ btnClass: '',
3541
+ permission: 'CmsAdmin.Entry.Create',
3542
+ icon: 'fa fa-paper-plane',
3543
+ },
3544
+ ]);
3545
+ /**条目编辑 */
3546
+ const Entries_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3547
+ {
3548
+ text: 'AbpUi::Cancel',
3549
+ action: data => {
3550
+ const component = data.getInjected(EditComponent);
3551
+ component.backTo();
3552
+ },
3553
+ btnClass: 'btn btn-light btn-sm',
3554
+ permission: 'CmsAdmin.Entry.Create',
3555
+ icon: '',
3556
+ },
3557
+ {
3558
+ text: 'AbpUi::Save',
3559
+ action: data => {
3560
+ const component = data.getInjected(EditComponent);
3561
+ component.clickSubmit(true);
3562
+ },
3563
+ btnClass: 'btn btn-info btn-sm',
3564
+ permission: 'CmsAdmin.Entry.Create',
3565
+ icon: 'fas fa-save',
3566
+ },
3567
+ {
3568
+ text: 'Cms::Publish',
3569
+ action: data => {
3570
+ const component = data.getInjected(EditComponent);
3571
+ component.clickSubmit(false);
3572
+ },
3573
+ btnClass: '',
3574
+ permission: 'CmsAdmin.Entry.Create',
3575
+ icon: 'fa fa-paper-plane',
3576
+ },
3577
+ ]);
3578
+
3579
+ /**默认-实体-操作 */
3580
+ const Default_Entity_Actions = {
3581
+ // [ModuleComponent.AbpTable]: Abp_Table_Entity_Action,
3582
+ };
3583
+ /**默认实体属性-表格列名 */
3584
+ const Default_Entity_Props = {
3585
+ // [PageName.Guides]: Guides_Entity_Props,
3586
+ };
3587
+ /**默认-工具栏-操作 */
3588
+ const Default_Toolbar_Actions = {
3589
+ // [ModuleComponent.Page]: Page_Toolbar_Action,
3590
+ // [eCmsKitPageName.FaqQuestion]:FaqQuestion_Toolbar_Action
3591
+ [ECmsComponent.Entries]: Entries_Defaults_Toolbar_Action,
3592
+ [ECmsComponent.Entries_Create]: Entries_Create_Defaults_Toolbar_Action,
3593
+ [ECmsComponent.Entries_Edit]: Entries_Edit_Defaults_Toolbar_Action,
3594
+ [ECmsComponent.Fields]: Fields_Defaults_Toolbar_Action,
3595
+ [ECmsComponent.FieldsCreate]: Fields_Create_Defaults_Toolbar_Action,
3596
+ [ECmsComponent.FieldsEdit]: Fields_Edit_Defaults_Toolbar_Action,
3597
+ [ECmsComponent.Sections]: Sections_Defaults_Toolbar_Action,
3598
+ [ECmsComponent.SectionsCreateOrEdit]: Sections_Create_Or_Edit_Defaults_Toolbar_Action,
3599
+ };
3600
+ /**
3601
+ *
3602
+ * @param 在Extensions_Props_Action_Token_Resolver方法中使用
3603
+ * @param 在.module.ts中使用,
3604
+ export class CmsModule {
3605
+ static forChild(options: any = {}): ModuleWithProviders<CmsModule> {
3606
+ return {
3607
+ ngModule: CmsModule,
3608
+ providers: [
3609
+ {
3610
+ provide: Toolbar_Action_Contributors,
3611
+ useValue: options.toolbarActionContributors,
3612
+ },
3613
+ {
3614
+ provide: Entity_Action_Contributors,
3615
+ useValue: options.entityActionContributors,
3616
+ },
3617
+ {
3618
+ provide: Entity_Props_Contributors,
3619
+ useValue: options.entityPropContributors,
3620
+ },
3621
+ ]
3622
+ };
3623
+ }
3624
+ static forLazy(options: any = {}): NgModuleFactory<CmsModule> {
3625
+ return new LazyModuleFactory(CmsModule.forChild(options));
3626
+ }
3627
+ }
3628
+ *
3629
+ *
3630
+ */
3631
+ /**实体-操作-贡献者 */
3632
+ const Entity_Action_Contributors = new InjectionToken('Entity_Action_Contributors');
3633
+ /**实体-属性-贡献者 */
3634
+ const Entity_Props_Contributors = new InjectionToken('Entity_Props_Contributors');
3635
+ const Toolbar_Action_Contributors = new InjectionToken('Toolbar_Action_Contributors');
3636
+ /**
3637
+ * 属性-操作-贡献者-解析器
3638
+ *
3639
+ * 用于放在-routing.module.ts路由守卫中
3640
+ *
3641
+ *
3642
+ const routes: Routes = [
3643
+ {
3644
+ path: 'demo',
3645
+ canActivate: [AuthGuard, PermissionGuard],
3646
+ resolve: [Extensions_Props_Action_Token_Resolver],
3647
+ children: []
3648
+ },
3649
+ ]
3650
+ *
3651
+ *
3652
+ */
3653
+ const Extensions_Props_Action_Token_Resolver = () => {
3654
+ const configState = inject(ConfigStateService);
3655
+ const extensions = inject(ExtensionsService);
3656
+ const config = { optional: true };
3657
+ const actionContributors = inject(Entity_Action_Contributors, config) || {};
3658
+ const propContributors = inject(Entity_Props_Contributors, config) || {};
3659
+ const toolbarContributors = inject(Toolbar_Action_Contributors, config) || {};
3660
+ return getObjectExtensionEntitiesFromStore(configState, 'TenantManagement').pipe(map(entities => ({
3661
+ // [ModuleComponent.AbpTable]: entities.Tenant,
3662
+ })), mapEntitiesToContributors(configState, 'TenantManagement'), tap(objectExtensionContributors => {
3663
+ //actions
3664
+ mergeWithDefaultActions(extensions.entityActions, Default_Entity_Actions, actionContributors);
3665
+ //props
3666
+ mergeWithDefaultProps(extensions.entityProps, Default_Entity_Props, objectExtensionContributors.prop, propContributors);
3667
+ //Toolbar
3668
+ mergeWithDefaultActions(extensions.toolbarActions, Default_Toolbar_Actions, toolbarContributors);
3669
+ }));
3670
+ };
3671
+ // /**
3672
+ // * @deprecated Use `tenantManagementExtensions_Props_Action_Token_Resolver` *function* instead.
3673
+ // */
3674
+ // @Injectable()
3675
+ // export class TenantManagementExtensionsGuard implements IAbpGuard {
3676
+ // protected readonly configState = inject(ConfigStateService);
3677
+ // protected readonly extensions = inject(ExtensionsService);
3678
+ // canActivate(): Observable<boolean> {
3679
+ // const config = { optional: true };
3680
+ // const actionContributors = inject(TENANT_MANAGEMENT_Entity_Action_Contributors, config) || {};
3681
+ // const propContributors = inject(TENANT_MANAGEMENT_Entity_Props_Contributors, config) || {};
3682
+ // return getObjectExtensionEntitiesFromStore(this.configState, 'TenantManagement').pipe(
3683
+ // map(entities => ({
3684
+ // // [eTenantManagementComponents.Tenants]: entities.Tenant,
3685
+ // })),
3686
+ // mapEntitiesToContributors(this.configState, 'TenantManagement'),
3687
+ // tap(objectExtensionContributors => {
3688
+ // mergeWithDefaultActions(
3689
+ // this.extensions.entityActions,
3690
+ // DEFAULT_TENANT_MANAGEMENT_ENTITY_ACTIONS,
3691
+ // actionContributors,
3692
+ // );
3693
+ // mergeWithDefaultProps(
3694
+ // this.extensions.entityProps,
3695
+ // DEFAULT_TENANT_MANAGEMENT_ENTITY_PROPS,
3696
+ // objectExtensionContributors.prop,
3697
+ // propContributors,
3698
+ // );
3699
+ // }),
3700
+ // map(() => true),
3701
+ // );
3702
+ // }
3703
+ // }
3704
+
3705
+ const routes = [
3706
+ {
3707
+ path: 'admin',
3708
+ canActivate: [AuthGuard, PermissionGuard],
3709
+ resolve: [Extensions_Props_Action_Token_Resolver, appentStyle],
3710
+ children: [
3711
+ {
3712
+ path: 'entries',
3713
+ children: [
3714
+ {
3715
+ path: '',
3716
+ component: EntriesComponent,
3717
+ data: { keep: true }
3718
+ },
3719
+ {
3720
+ path: 'create',
3721
+ component: CreateComponent,
3722
+ },
3723
+ {
3724
+ path: ':entrieId/edit',
3725
+ component: EditComponent,
3726
+ },
3727
+ ],
3728
+ },
3729
+ {
3730
+ path: '',
3731
+ children: [
3732
+ {
3733
+ path: 'fields',
3734
+ children: [
3735
+ {
3736
+ path: '',
3737
+ component: FieldsComponent,
3738
+ data: { keep: true }
3739
+ },
3740
+ {
3741
+ path: 'create',
3742
+ component: CreateFieldComponent,
3743
+ },
3744
+ {
3745
+ path: ':id/edit',
3746
+ component: EditFieldComponent,
3747
+ },
3748
+ ],
3749
+ },
3750
+ {
3751
+ path: 'sections',
3752
+ children: [
3753
+ {
3754
+ path: '',
3755
+ data: { keep: true },
3756
+ component: SectionsComponent,
3757
+ },
3758
+ {
3759
+ path: ':sectionsId/entry-types',
3760
+ children: [
3761
+ {
3762
+ path: 'create',
3763
+ component: CreateOrEditComponent,
3764
+ },
3765
+ {
3766
+ path: ':entryTypesId/edit',
3767
+ component: CreateOrEditComponent,
3768
+ },
3769
+ ],
3770
+ },
3771
+ ],
3772
+ },
3773
+ ],
3774
+ },
3775
+ ],
3776
+ },
3777
+ ];
3778
+ class CmsRoutingModule {
3779
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3780
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] }); }
3781
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
3782
+ }
3783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, decorators: [{
3784
+ type: NgModule,
3785
+ args: [{
3786
+ imports: [RouterModule.forChild(routes)],
3787
+ exports: [RouterModule],
3788
+ }]
3789
+ }] });
3790
+
3791
+ class CmsModule {
3792
+ static forChild(options = {}) {
3793
+ return {
3794
+ ngModule: CmsModule,
3795
+ providers: [
3796
+ {
3797
+ provide: Toolbar_Action_Contributors,
3798
+ useValue: options.toolbarActionContributors,
3799
+ },
3800
+ {
3801
+ provide: Entity_Action_Contributors,
3802
+ useValue: options.entityActionContributors,
3803
+ },
3804
+ {
3805
+ provide: Entity_Props_Contributors,
3806
+ useValue: options.entityPropContributors,
3807
+ },
3808
+ ],
3809
+ };
3810
+ }
3811
+ static forLazy(options = {}) {
3812
+ return new LazyModuleFactory(CmsModule.forChild(options));
3813
+ }
3814
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3815
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, declarations: [EntriesComponent,
3816
+ FieldsComponent,
3817
+ SectionsComponent,
3818
+ FieldGroupComponent,
3819
+ CreateFieldComponent,
3820
+ EditFieldComponent,
3821
+ CreateOrEditFieldComponent,
3822
+ CreateOrEditComponent,
3823
+ CreateComponent,
3824
+ EditComponent,
3825
+ CreateOrEditEntriesComponent,
3826
+ TableConfigComponent,
3827
+ TableControlComponent,
3828
+ MatrixConfigComponent,
3829
+ MatrixControlComponent,
3830
+ EntryConfigComponent,
3831
+ EntryControlComponent], imports: [CoreModule,
3832
+ ThemeSharedModule,
3833
+ FormsModule,
3834
+ CmsRoutingModule,
3835
+ NgbNavModule,
3836
+ NgbAccordionModule,
3837
+ NgbDropdownModule,
3838
+ PageModule,
3839
+ NzSelectModule, i8$2.DynamicFormModule], exports: [TableConfigComponent,
3840
+ TableControlComponent,
3841
+ MatrixConfigComponent,
3842
+ MatrixControlComponent,
3843
+ EntryConfigComponent,
3844
+ EntryControlComponent] }); }
3845
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, imports: [CoreModule,
3846
+ ThemeSharedModule,
3847
+ FormsModule,
3848
+ CmsRoutingModule,
3849
+ NgbNavModule,
3850
+ NgbAccordionModule,
3851
+ NgbDropdownModule,
3852
+ PageModule,
3853
+ NzSelectModule,
3854
+ DynamicFormModule.forRoot({
3855
+ cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3856
+ })] }); }
3857
+ }
3858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, decorators: [{
3859
+ type: NgModule,
3860
+ args: [{
3861
+ declarations: [
3862
+ EntriesComponent,
3863
+ FieldsComponent,
3864
+ SectionsComponent,
3865
+ FieldGroupComponent,
3866
+ CreateFieldComponent,
3867
+ EditFieldComponent,
3868
+ CreateOrEditFieldComponent,
3869
+ CreateOrEditComponent,
3870
+ CreateComponent,
3871
+ EditComponent,
3872
+ CreateOrEditEntriesComponent,
3873
+ TableConfigComponent,
3874
+ TableControlComponent,
3875
+ MatrixConfigComponent,
3876
+ MatrixControlComponent,
3877
+ EntryConfigComponent,
3878
+ EntryControlComponent,
3879
+ ],
3880
+ imports: [
3881
+ CoreModule,
3882
+ ThemeSharedModule,
3883
+ FormsModule,
3884
+ CmsRoutingModule,
3885
+ NgbNavModule,
3886
+ NgbAccordionModule,
3887
+ NgbDropdownModule,
3888
+ PageModule,
3889
+ NzSelectModule,
3890
+ DynamicFormModule.forRoot({
3891
+ cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3892
+ }),
3893
+ ],
3894
+ exports: [
3895
+ TableConfigComponent,
3896
+ TableControlComponent,
3897
+ MatrixConfigComponent,
3898
+ MatrixControlComponent,
3899
+ EntryConfigComponent,
3900
+ EntryControlComponent,
3901
+ ],
3902
+ providers: [],
3903
+ }]
3904
+ }] });
3905
+
3906
+ /*
3907
+ * Public API Surface of cms
3908
+ */
3909
+
3910
+ /**
3911
+ * Generated bundle index. Do not edit.
3912
+ */
3913
+
3914
+ export { CmsModule, EntryConfig, EntryConfigComponent, EntryControlComponent, FieldControlGroup, MatrixConfig, MatrixConfigComponent, MatrixControlComponent, MatrixItemConfig, TableConfig, TableConfigComponent, TableControlComponent, TableFormControl, matrixFieldInputBase };
3915
+ //# sourceMappingURL=dignite-ng-expand.cms.mjs.map