@clement_lores/adminjs 7.8.17 → 7.8.18

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 (415) hide show
  1. package/lib/frontend/assets/scripts/app-bundle.development.js +38842 -0
  2. package/package.json +2 -2
  3. package/types/spec/backend/helpers/helper-stub.d.ts +0 -21
  4. package/types/spec/backend/helpers/resource-stub.d.ts +0 -15
  5. package/types/src/adminjs-options.interface.d.ts +0 -453
  6. package/types/src/adminjs.d.ts +0 -125
  7. package/types/src/adminjs.spec.d.ts +0 -1
  8. package/types/src/backend/actions/action.interface.d.ts +0 -619
  9. package/types/src/backend/actions/bulk-delete/bulk-delete-action.d.ts +0 -11
  10. package/types/src/backend/actions/bulk-delete/bulk-delete-action.spec.d.ts +0 -1
  11. package/types/src/backend/actions/delete/delete-action.d.ts +0 -12
  12. package/types/src/backend/actions/delete/delete-action.spec.d.ts +0 -1
  13. package/types/src/backend/actions/edit/edit-action.d.ts +0 -14
  14. package/types/src/backend/actions/index.d.ts +0 -12
  15. package/types/src/backend/actions/list/list-action.d.ts +0 -33
  16. package/types/src/backend/actions/new/new-action.d.ts +0 -12
  17. package/types/src/backend/actions/search/search-action.d.ts +0 -25
  18. package/types/src/backend/actions/show/show-action.d.ts +0 -12
  19. package/types/src/backend/adapters/database/base-database.d.ts +0 -28
  20. package/types/src/backend/adapters/database/index.d.ts +0 -1
  21. package/types/src/backend/adapters/index.d.ts +0 -4
  22. package/types/src/backend/adapters/property/base-property.d.ts +0 -112
  23. package/types/src/backend/adapters/property/index.d.ts +0 -2
  24. package/types/src/backend/adapters/record/base-record.d.ts +0 -183
  25. package/types/src/backend/adapters/record/base-record.spec.d.ts +0 -1
  26. package/types/src/backend/adapters/record/index.d.ts +0 -2
  27. package/types/src/backend/adapters/record/params.type.d.ts +0 -10
  28. package/types/src/backend/adapters/resource/base-resource.d.ts +0 -204
  29. package/types/src/backend/adapters/resource/base-resource.spec.d.ts +0 -1
  30. package/types/src/backend/adapters/resource/index.d.ts +0 -2
  31. package/types/src/backend/adapters/resource/supported-databases.type.d.ts +0 -1
  32. package/types/src/backend/bundler/app.bundler.d.ts +0 -3
  33. package/types/src/backend/bundler/components.bundler.d.ts +0 -3
  34. package/types/src/backend/bundler/generate-user-component-entry.d.ts +0 -16
  35. package/types/src/backend/bundler/globals.bundler.d.ts +0 -3
  36. package/types/src/backend/bundler/index.d.ts +0 -6
  37. package/types/src/backend/bundler/utils/asset-bundler.d.ts +0 -32
  38. package/types/src/backend/bundler/utils/constants.d.ts +0 -4
  39. package/types/src/backend/controllers/api-controller.d.ts +0 -131
  40. package/types/src/backend/controllers/app-controller.d.ts +0 -16
  41. package/types/src/backend/controllers/index.d.ts +0 -2
  42. package/types/src/backend/decorators/action/action-decorator.d.ts +0 -130
  43. package/types/src/backend/decorators/action/action-decorator.spec.d.ts +0 -1
  44. package/types/src/backend/decorators/action/index.d.ts +0 -1
  45. package/types/src/backend/decorators/index.d.ts +0 -3
  46. package/types/src/backend/decorators/property/index.d.ts +0 -3
  47. package/types/src/backend/decorators/property/property-decorator.d.ts +0 -164
  48. package/types/src/backend/decorators/property/property-decorator.spec.d.ts +0 -1
  49. package/types/src/backend/decorators/property/property-options.interface.d.ts +0 -137
  50. package/types/src/backend/decorators/property/utils/index.d.ts +0 -1
  51. package/types/src/backend/decorators/property/utils/override-from-options.d.ts +0 -4
  52. package/types/src/backend/decorators/property/utils/override-from-options.spec.d.ts +0 -1
  53. package/types/src/backend/decorators/resource/index.d.ts +0 -2
  54. package/types/src/backend/decorators/resource/resource-decorator.d.ts +0 -149
  55. package/types/src/backend/decorators/resource/resource-decorator.spec.d.ts +0 -1
  56. package/types/src/backend/decorators/resource/resource-options.interface.d.ts +0 -134
  57. package/types/src/backend/decorators/resource/utils/decorate-actions.d.ts +0 -16
  58. package/types/src/backend/decorators/resource/utils/decorate-properties.d.ts +0 -15
  59. package/types/src/backend/decorators/resource/utils/decorate-properties.spec.d.ts +0 -1
  60. package/types/src/backend/decorators/resource/utils/find-sub-property.d.ts +0 -12
  61. package/types/src/backend/decorators/resource/utils/flat-sub-properties.d.ts +0 -14
  62. package/types/src/backend/decorators/resource/utils/get-navigation.d.ts +0 -10
  63. package/types/src/backend/decorators/resource/utils/get-navigation.spec.d.ts +0 -1
  64. package/types/src/backend/decorators/resource/utils/get-property-by-key.d.ts +0 -3
  65. package/types/src/backend/decorators/resource/utils/index.d.ts +0 -6
  66. package/types/src/backend/index.d.ts +0 -6
  67. package/types/src/backend/services/action-error-handler/action-error-handler.d.ts +0 -8
  68. package/types/src/backend/services/action-error-handler/action-error-handler.spec.d.ts +0 -1
  69. package/types/src/backend/services/action-error-handler/index.d.ts +0 -1
  70. package/types/src/backend/services/index.d.ts +0 -2
  71. package/types/src/backend/services/sort-setter/index.d.ts +0 -1
  72. package/types/src/backend/services/sort-setter/sort-setter.d.ts +0 -27
  73. package/types/src/backend/utils/auth/base-auth-provider.d.ts +0 -63
  74. package/types/src/backend/utils/auth/default-auth-provider.d.ts +0 -12
  75. package/types/src/backend/utils/auth/index.d.ts +0 -2
  76. package/types/src/backend/utils/build-feature/build-feature.d.ts +0 -40
  77. package/types/src/backend/utils/build-feature/build-feature.spec.d.ts +0 -1
  78. package/types/src/backend/utils/build-feature/index.d.ts +0 -1
  79. package/types/src/backend/utils/component-loader.d.ts +0 -15
  80. package/types/src/backend/utils/errors/app-error.d.ts +0 -35
  81. package/types/src/backend/utils/errors/configuration-error.d.ts +0 -14
  82. package/types/src/backend/utils/errors/forbidden-error.d.ts +0 -26
  83. package/types/src/backend/utils/errors/index.d.ts +0 -7
  84. package/types/src/backend/utils/errors/not-found-error.d.ts +0 -27
  85. package/types/src/backend/utils/errors/not-implemented-error.d.ts +0 -13
  86. package/types/src/backend/utils/errors/record-error.d.ts +0 -17
  87. package/types/src/backend/utils/errors/validation-error.d.ts +0 -34
  88. package/types/src/backend/utils/filter/filter.d.ts +0 -66
  89. package/types/src/backend/utils/filter/index.d.ts +0 -1
  90. package/types/src/backend/utils/index.d.ts +0 -13
  91. package/types/src/backend/utils/layout-element-parser/index.d.ts +0 -1
  92. package/types/src/backend/utils/layout-element-parser/layout-element-parser.d.ts +0 -82
  93. package/types/src/backend/utils/layout-element-parser/layout-element-parser.spec.d.ts +0 -1
  94. package/types/src/backend/utils/options-parser/index.d.ts +0 -1
  95. package/types/src/backend/utils/options-parser/options-parser.d.ts +0 -10
  96. package/types/src/backend/utils/populator/index.d.ts +0 -2
  97. package/types/src/backend/utils/populator/populate-property.d.ts +0 -13
  98. package/types/src/backend/utils/populator/populate-property.spec.d.ts +0 -1
  99. package/types/src/backend/utils/populator/populator.d.ts +0 -10
  100. package/types/src/backend/utils/populator/populator.spec.d.ts +0 -1
  101. package/types/src/backend/utils/request-parser/index.d.ts +0 -1
  102. package/types/src/backend/utils/request-parser/request-parser.d.ts +0 -14
  103. package/types/src/backend/utils/request-parser/request-parser.spec.d.ts +0 -1
  104. package/types/src/backend/utils/resources-factory/index.d.ts +0 -1
  105. package/types/src/backend/utils/resources-factory/resources-factory.d.ts +0 -57
  106. package/types/src/backend/utils/router/index.d.ts +0 -1
  107. package/types/src/backend/utils/router/router.d.ts +0 -24
  108. package/types/src/backend/utils/router/router.spec.d.ts +0 -1
  109. package/types/src/backend/utils/uploaded-file.type.d.ts +0 -25
  110. package/types/src/backend/utils/view-helpers/index.d.ts +0 -1
  111. package/types/src/backend/utils/view-helpers/view-helpers.d.ts +0 -184
  112. package/types/src/backend/utils/view-helpers/view-helpers.spec.d.ts +0 -1
  113. package/types/src/constants.d.ts +0 -7
  114. package/types/src/core-scripts.interface.d.ts +0 -41
  115. package/types/src/current-admin.interface.d.ts +0 -42
  116. package/types/src/frontend/components/actions/action.props.d.ts +0 -29
  117. package/types/src/frontend/components/actions/bulk-delete.d.ts +0 -15
  118. package/types/src/frontend/components/actions/edit.d.ts +0 -7
  119. package/types/src/frontend/components/actions/index.d.ts +0 -31
  120. package/types/src/frontend/components/actions/list.d.ts +0 -7
  121. package/types/src/frontend/components/actions/new.d.ts +0 -7
  122. package/types/src/frontend/components/actions/show.d.ts +0 -14
  123. package/types/src/frontend/components/actions/utils/append-force-refresh.d.ts +0 -13
  124. package/types/src/frontend/components/actions/utils/append-force-refresh.spec.d.ts +0 -1
  125. package/types/src/frontend/components/actions/utils/index.d.ts +0 -1
  126. package/types/src/frontend/components/actions/utils/layout-element-renderer.d.ts +0 -12
  127. package/types/src/frontend/components/app/action-button/action-button.d.ts +0 -40
  128. package/types/src/frontend/components/app/action-button/index.d.ts +0 -1
  129. package/types/src/frontend/components/app/action-header/action-header-props.d.ts +0 -24
  130. package/types/src/frontend/components/app/action-header/action-header.d.ts +0 -19
  131. package/types/src/frontend/components/app/action-header/actions-to-button-group.d.ts +0 -12
  132. package/types/src/frontend/components/app/action-header/actions-to-button-group.spec.d.ts +0 -1
  133. package/types/src/frontend/components/app/action-header/index.d.ts +0 -2
  134. package/types/src/frontend/components/app/action-header/styled-back-button.d.ts +0 -9
  135. package/types/src/frontend/components/app/admin-modal.d.ts +0 -3
  136. package/types/src/frontend/components/app/app-loader.d.ts +0 -2
  137. package/types/src/frontend/components/app/auth-background-component.d.ts +0 -6
  138. package/types/src/frontend/components/app/base-action-component.d.ts +0 -52
  139. package/types/src/frontend/components/app/breadcrumbs.d.ts +0 -30
  140. package/types/src/frontend/components/app/default-dashboard.d.ts +0 -4
  141. package/types/src/frontend/components/app/drawer-portal.d.ts +0 -35
  142. package/types/src/frontend/components/app/error-boundary.d.ts +0 -10
  143. package/types/src/frontend/components/app/error-message.d.ts +0 -36
  144. package/types/src/frontend/components/app/filter-drawer.d.ts +0 -10
  145. package/types/src/frontend/components/app/footer.d.ts +0 -6
  146. package/types/src/frontend/components/app/index.d.ts +0 -21
  147. package/types/src/frontend/components/app/language-select/index.d.ts +0 -1
  148. package/types/src/frontend/components/app/language-select/language-select.d.ts +0 -3
  149. package/types/src/frontend/components/app/logged-in.d.ts +0 -13
  150. package/types/src/frontend/components/app/notice.d.ts +0 -33
  151. package/types/src/frontend/components/app/records-table/index.d.ts +0 -6
  152. package/types/src/frontend/components/app/records-table/no-records.d.ts +0 -11
  153. package/types/src/frontend/components/app/records-table/property-header.d.ts +0 -23
  154. package/types/src/frontend/components/app/records-table/property-header.spec.d.ts +0 -2
  155. package/types/src/frontend/components/app/records-table/record-in-list.d.ts +0 -16
  156. package/types/src/frontend/components/app/records-table/records-table-header.d.ts +0 -81
  157. package/types/src/frontend/components/app/records-table/records-table-header.spec.d.ts +0 -2
  158. package/types/src/frontend/components/app/records-table/records-table.d.ts +0 -53
  159. package/types/src/frontend/components/app/records-table/records-table.spec.d.ts +0 -3
  160. package/types/src/frontend/components/app/records-table/selected-records.d.ts +0 -11
  161. package/types/src/frontend/components/app/records-table/utils/display.d.ts +0 -1
  162. package/types/src/frontend/components/app/records-table/utils/get-bulk-actions-from-records.d.ts +0 -3
  163. package/types/src/frontend/components/app/records-table/utils/get-bulk-actions-from-records.spec.d.ts +0 -2
  164. package/types/src/frontend/components/app/sidebar/index.d.ts +0 -3
  165. package/types/src/frontend/components/app/sidebar/sidebar-branding.d.ts +0 -12
  166. package/types/src/frontend/components/app/sidebar/sidebar-footer.d.ts +0 -7
  167. package/types/src/frontend/components/app/sidebar/sidebar-pages.d.ts +0 -11
  168. package/types/src/frontend/components/app/sidebar/sidebar-resource-section.d.ts +0 -29
  169. package/types/src/frontend/components/app/sidebar/sidebar.d.ts +0 -11
  170. package/types/src/frontend/components/app/sort-link.d.ts +0 -9
  171. package/types/src/frontend/components/app/top-bar.d.ts +0 -9
  172. package/types/src/frontend/components/app/utils/discord-logo-svg.d.ts +0 -4
  173. package/types/src/frontend/components/app/utils/rocket-svg.d.ts +0 -4
  174. package/types/src/frontend/components/app/version.d.ts +0 -10
  175. package/types/src/frontend/components/application.d.ts +0 -6
  176. package/types/src/frontend/components/index.d.ts +0 -6
  177. package/types/src/frontend/components/login/index.d.ts +0 -10
  178. package/types/src/frontend/components/property-type/array/add-new-item-translation.d.ts +0 -9
  179. package/types/src/frontend/components/property-type/array/convert-to-sub-property.d.ts +0 -14
  180. package/types/src/frontend/components/property-type/array/edit.d.ts +0 -6
  181. package/types/src/frontend/components/property-type/array/edit.spec.d.ts +0 -4
  182. package/types/src/frontend/components/property-type/array/index.d.ts +0 -4
  183. package/types/src/frontend/components/property-type/array/list.d.ts +0 -6
  184. package/types/src/frontend/components/property-type/array/remove-sub-property.d.ts +0 -15
  185. package/types/src/frontend/components/property-type/array/remove-sub-property.spec.d.ts +0 -1
  186. package/types/src/frontend/components/property-type/array/show.d.ts +0 -11
  187. package/types/src/frontend/components/property-type/base-property-component.d.ts +0 -12
  188. package/types/src/frontend/components/property-type/base-property-props.d.ts +0 -160
  189. package/types/src/frontend/components/property-type/boolean/boolean-property-value.d.ts +0 -6
  190. package/types/src/frontend/components/property-type/boolean/edit.d.ts +0 -9
  191. package/types/src/frontend/components/property-type/boolean/filter.d.ts +0 -10
  192. package/types/src/frontend/components/property-type/boolean/index.d.ts +0 -5
  193. package/types/src/frontend/components/property-type/boolean/list.d.ts +0 -6
  194. package/types/src/frontend/components/property-type/boolean/map-value.d.ts +0 -2
  195. package/types/src/frontend/components/property-type/boolean/show.d.ts +0 -6
  196. package/types/src/frontend/components/property-type/clean-property-component.d.ts +0 -12
  197. package/types/src/frontend/components/property-type/currency/currency-input-wrapper.d.ts +0 -12
  198. package/types/src/frontend/components/property-type/currency/edit.d.ts +0 -9
  199. package/types/src/frontend/components/property-type/currency/filter.d.ts +0 -9
  200. package/types/src/frontend/components/property-type/currency/format-value.d.ts +0 -2
  201. package/types/src/frontend/components/property-type/currency/index.d.ts +0 -5
  202. package/types/src/frontend/components/property-type/currency/list.d.ts +0 -6
  203. package/types/src/frontend/components/property-type/currency/show.d.ts +0 -9
  204. package/types/src/frontend/components/property-type/datetime/edit.d.ts +0 -9
  205. package/types/src/frontend/components/property-type/datetime/filter.d.ts +0 -10
  206. package/types/src/frontend/components/property-type/datetime/index.d.ts +0 -5
  207. package/types/src/frontend/components/property-type/datetime/list.d.ts +0 -6
  208. package/types/src/frontend/components/property-type/datetime/map-value.d.ts +0 -3
  209. package/types/src/frontend/components/property-type/datetime/show.d.ts +0 -6
  210. package/types/src/frontend/components/property-type/datetime/strip-time-from-iso.d.ts +0 -1
  211. package/types/src/frontend/components/property-type/default-type/default-property-value.d.ts +0 -6
  212. package/types/src/frontend/components/property-type/default-type/edit.d.ts +0 -9
  213. package/types/src/frontend/components/property-type/default-type/filter.d.ts +0 -10
  214. package/types/src/frontend/components/property-type/default-type/index.d.ts +0 -5
  215. package/types/src/frontend/components/property-type/default-type/list.d.ts +0 -6
  216. package/types/src/frontend/components/property-type/default-type/show.d.ts +0 -6
  217. package/types/src/frontend/components/property-type/default-type/show.spec.d.ts +0 -3
  218. package/types/src/frontend/components/property-type/index.d.ts +0 -16
  219. package/types/src/frontend/components/property-type/key-value/edit.d.ts +0 -15
  220. package/types/src/frontend/components/property-type/key-value/index.d.ts +0 -3
  221. package/types/src/frontend/components/property-type/key-value/show.d.ts +0 -8
  222. package/types/src/frontend/components/property-type/mixed/convert-to-sub-property.d.ts +0 -2
  223. package/types/src/frontend/components/property-type/mixed/edit.d.ts +0 -14
  224. package/types/src/frontend/components/property-type/mixed/index.d.ts +0 -4
  225. package/types/src/frontend/components/property-type/mixed/list.d.ts +0 -16
  226. package/types/src/frontend/components/property-type/mixed/show.d.ts +0 -9
  227. package/types/src/frontend/components/property-type/password/edit.d.ts +0 -9
  228. package/types/src/frontend/components/property-type/password/index.d.ts +0 -2
  229. package/types/src/frontend/components/property-type/phone/edit.d.ts +0 -9
  230. package/types/src/frontend/components/property-type/phone/filter.d.ts +0 -10
  231. package/types/src/frontend/components/property-type/phone/index.d.ts +0 -5
  232. package/types/src/frontend/components/property-type/phone/list.d.ts +0 -6
  233. package/types/src/frontend/components/property-type/phone/show.d.ts +0 -6
  234. package/types/src/frontend/components/property-type/record-property-is-equal.d.ts +0 -8
  235. package/types/src/frontend/components/property-type/reference/edit.d.ts +0 -10
  236. package/types/src/frontend/components/property-type/reference/filter.d.ts +0 -10
  237. package/types/src/frontend/components/property-type/reference/index.d.ts +0 -5
  238. package/types/src/frontend/components/property-type/reference/list.d.ts +0 -6
  239. package/types/src/frontend/components/property-type/reference/reference-value.d.ts +0 -7
  240. package/types/src/frontend/components/property-type/reference/show.d.ts +0 -6
  241. package/types/src/frontend/components/property-type/richtext/edit.d.ts +0 -9
  242. package/types/src/frontend/components/property-type/richtext/index.d.ts +0 -4
  243. package/types/src/frontend/components/property-type/richtext/list.d.ts +0 -6
  244. package/types/src/frontend/components/property-type/richtext/show.d.ts +0 -9
  245. package/types/src/frontend/components/property-type/textarea/edit.d.ts +0 -9
  246. package/types/src/frontend/components/property-type/textarea/index.d.ts +0 -3
  247. package/types/src/frontend/components/property-type/textarea/show.d.ts +0 -6
  248. package/types/src/frontend/components/property-type/utils/index.d.ts +0 -2
  249. package/types/src/frontend/components/property-type/utils/property-description/index.d.ts +0 -1
  250. package/types/src/frontend/components/property-type/utils/property-description/property-description.d.ts +0 -9
  251. package/types/src/frontend/components/property-type/utils/property-label/index.d.ts +0 -1
  252. package/types/src/frontend/components/property-type/utils/property-label/property-label.d.ts +0 -12
  253. package/types/src/frontend/components/routes/bulk-action.d.ts +0 -5
  254. package/types/src/frontend/components/routes/dashboard.d.ts +0 -28
  255. package/types/src/frontend/components/routes/index.d.ts +0 -6
  256. package/types/src/frontend/components/routes/page.d.ts +0 -5
  257. package/types/src/frontend/components/routes/record-action.d.ts +0 -5
  258. package/types/src/frontend/components/routes/record-action.spec.d.ts +0 -1
  259. package/types/src/frontend/components/routes/resource-action.d.ts +0 -11
  260. package/types/src/frontend/components/routes/resource.d.ts +0 -11
  261. package/types/src/frontend/components/routes/utils/should-action-re-fetch-data.d.ts +0 -13
  262. package/types/src/frontend/components/routes/utils/wrapper.d.ts +0 -3
  263. package/types/src/frontend/components/spec/action-json.factory.d.ts +0 -1
  264. package/types/src/frontend/components/spec/factory.d.ts +0 -7
  265. package/types/src/frontend/components/spec/initialize-translations.d.ts +0 -1
  266. package/types/src/frontend/components/spec/page-json.factory.d.ts +0 -1
  267. package/types/src/frontend/components/spec/property-json.factory.d.ts +0 -1
  268. package/types/src/frontend/components/spec/record-json.factory.d.ts +0 -1
  269. package/types/src/frontend/components/spec/resource-json.factory.d.ts +0 -1
  270. package/types/src/frontend/components/spec/test-context-provider.d.ts +0 -7
  271. package/types/src/frontend/hoc/allow-override.d.ts +0 -17
  272. package/types/src/frontend/hoc/index.d.ts +0 -3
  273. package/types/src/frontend/hoc/with-no-ssr.d.ts +0 -10
  274. package/types/src/frontend/hoc/with-notice.d.ts +0 -38
  275. package/types/src/frontend/hooks/index.d.ts +0 -14
  276. package/types/src/frontend/hooks/use-action/index.d.ts +0 -3
  277. package/types/src/frontend/hooks/use-action/use-action-response-handler.d.ts +0 -3
  278. package/types/src/frontend/hooks/use-action/use-action.d.ts +0 -15
  279. package/types/src/frontend/hooks/use-action/use-action.types.d.ts +0 -30
  280. package/types/src/frontend/hooks/use-current-admin.d.ts +0 -39
  281. package/types/src/frontend/hooks/use-filter-drawer.d.ts +0 -7
  282. package/types/src/frontend/hooks/use-history-listen.d.ts +0 -2
  283. package/types/src/frontend/hooks/use-local-storage/index.d.ts +0 -2
  284. package/types/src/frontend/hooks/use-local-storage/use-local-storage-result.type.d.ts +0 -16
  285. package/types/src/frontend/hooks/use-local-storage/use-local-storage.d.ts +0 -15
  286. package/types/src/frontend/hooks/use-modal.d.ts +0 -2
  287. package/types/src/frontend/hooks/use-navigation-resources.d.ts +0 -4
  288. package/types/src/frontend/hooks/use-notice.d.ts +0 -29
  289. package/types/src/frontend/hooks/use-query-params.d.ts +0 -35
  290. package/types/src/frontend/hooks/use-record/filter-record.d.ts +0 -4
  291. package/types/src/frontend/hooks/use-record/filter-record.spec.d.ts +0 -1
  292. package/types/src/frontend/hooks/use-record/index.d.ts +0 -6
  293. package/types/src/frontend/hooks/use-record/is-entire-record-given.d.ts +0 -3
  294. package/types/src/frontend/hooks/use-record/merge-record-response.d.ts +0 -14
  295. package/types/src/frontend/hooks/use-record/params-to-form-data.d.ts +0 -17
  296. package/types/src/frontend/hooks/use-record/params-to-form-data.spec.d.ts +0 -1
  297. package/types/src/frontend/hooks/use-record/update-record.d.ts +0 -29
  298. package/types/src/frontend/hooks/use-record/update-record.spec.d.ts +0 -1
  299. package/types/src/frontend/hooks/use-record/use-record.d.ts +0 -15
  300. package/types/src/frontend/hooks/use-record/use-record.type.d.ts +0 -92
  301. package/types/src/frontend/hooks/use-records/index.d.ts +0 -2
  302. package/types/src/frontend/hooks/use-records/use-records-result.type.d.ts +0 -29
  303. package/types/src/frontend/hooks/use-records/use-records.d.ts +0 -14
  304. package/types/src/frontend/hooks/use-resource/index.d.ts +0 -1
  305. package/types/src/frontend/hooks/use-resource/use-resource.d.ts +0 -11
  306. package/types/src/frontend/hooks/use-selected-records/index.d.ts +0 -2
  307. package/types/src/frontend/hooks/use-selected-records/use-selected-records-result.type.d.ts +0 -17
  308. package/types/src/frontend/hooks/use-selected-records/use-selected-records.d.ts +0 -14
  309. package/types/src/frontend/hooks/use-translation.d.ts +0 -51
  310. package/types/src/frontend/index.d.ts +0 -6
  311. package/types/src/frontend/interfaces/action/action-has-component.d.ts +0 -3
  312. package/types/src/frontend/interfaces/action/action-href.d.ts +0 -3
  313. package/types/src/frontend/interfaces/action/action-json.interface.d.ts +0 -84
  314. package/types/src/frontend/interfaces/action/build-action-api-call-trigger.d.ts +0 -12
  315. package/types/src/frontend/interfaces/action/build-action-click-handler.d.ts +0 -16
  316. package/types/src/frontend/interfaces/action/build-action-test-id.d.ts +0 -2
  317. package/types/src/frontend/interfaces/action/call-action-api.d.ts +0 -5
  318. package/types/src/frontend/interfaces/action/index.d.ts +0 -10
  319. package/types/src/frontend/interfaces/action/is-bulk-action.d.ts +0 -4
  320. package/types/src/frontend/interfaces/action/is-record-action.d.ts +0 -4
  321. package/types/src/frontend/interfaces/action/is-resource-action.d.ts +0 -3
  322. package/types/src/frontend/interfaces/index.d.ts +0 -7
  323. package/types/src/frontend/interfaces/modal.interface.d.ts +0 -19
  324. package/types/src/frontend/interfaces/noticeMessage.interface.d.ts +0 -14
  325. package/types/src/frontend/interfaces/page-json.interface.d.ts +0 -19
  326. package/types/src/frontend/interfaces/property-json/index.d.ts +0 -1
  327. package/types/src/frontend/interfaces/property-json/property-json.interface.d.ts +0 -157
  328. package/types/src/frontend/interfaces/record-json.interface.d.ts +0 -51
  329. package/types/src/frontend/interfaces/resource-json.interface.d.ts +0 -71
  330. package/types/src/frontend/layout-template.d.ts +0 -14
  331. package/types/src/frontend/layout-template.spec.d.ts +0 -1
  332. package/types/src/frontend/login-template.d.ts +0 -8
  333. package/types/src/frontend/login-template.spec.d.ts +0 -1
  334. package/types/src/frontend/store/actions/add-notice.d.ts +0 -8
  335. package/types/src/frontend/store/actions/drop-notice.d.ts +0 -8
  336. package/types/src/frontend/store/actions/filter-drawer.d.ts +0 -11
  337. package/types/src/frontend/store/actions/index.d.ts +0 -16
  338. package/types/src/frontend/store/actions/initialize-assets.d.ts +0 -7
  339. package/types/src/frontend/store/actions/initialize-branding.d.ts +0 -7
  340. package/types/src/frontend/store/actions/initialize-dashboard.d.ts +0 -7
  341. package/types/src/frontend/store/actions/initialize-locale.d.ts +0 -7
  342. package/types/src/frontend/store/actions/initialize-pages.d.ts +0 -7
  343. package/types/src/frontend/store/actions/initialize-paths.d.ts +0 -7
  344. package/types/src/frontend/store/actions/initialize-resources.d.ts +0 -7
  345. package/types/src/frontend/store/actions/initialize-theme.d.ts +0 -7
  346. package/types/src/frontend/store/actions/initialize-versions.d.ts +0 -7
  347. package/types/src/frontend/store/actions/modal.d.ts +0 -5
  348. package/types/src/frontend/store/actions/route-changed.d.ts +0 -9
  349. package/types/src/frontend/store/actions/set-current-admin.d.ts +0 -7
  350. package/types/src/frontend/store/actions/set-drawer-preroute.d.ts +0 -11
  351. package/types/src/frontend/store/actions/set-notice-progress.d.ts +0 -10
  352. package/types/src/frontend/store/index.d.ts +0 -5
  353. package/types/src/frontend/store/initialize-store.d.ts +0 -6
  354. package/types/src/frontend/store/reducers/assetsReducer.d.ts +0 -5
  355. package/types/src/frontend/store/reducers/brandingReducer.d.ts +0 -5
  356. package/types/src/frontend/store/reducers/dashboardReducer.d.ts +0 -7
  357. package/types/src/frontend/store/reducers/drawerReducer.d.ts +0 -10
  358. package/types/src/frontend/store/reducers/filterDrawerReducer.d.ts +0 -7
  359. package/types/src/frontend/store/reducers/index.d.ts +0 -15
  360. package/types/src/frontend/store/reducers/localesReducer.d.ts +0 -6
  361. package/types/src/frontend/store/reducers/modalReducer.d.ts +0 -10
  362. package/types/src/frontend/store/reducers/noticesReducer.d.ts +0 -12
  363. package/types/src/frontend/store/reducers/pagesReducer.d.ts +0 -6
  364. package/types/src/frontend/store/reducers/pathsReducer.d.ts +0 -10
  365. package/types/src/frontend/store/reducers/resourcesReducer.d.ts +0 -6
  366. package/types/src/frontend/store/reducers/routerReducer.d.ts +0 -22
  367. package/types/src/frontend/store/reducers/sessionReducer.d.ts +0 -6
  368. package/types/src/frontend/store/reducers/themeReducer.d.ts +0 -8
  369. package/types/src/frontend/store/reducers/versionsReducer.d.ts +0 -5
  370. package/types/src/frontend/store/store.d.ts +0 -21
  371. package/types/src/frontend/store/utils/pages-to-store.d.ts +0 -3
  372. package/types/src/frontend/utils/adminjs.i18n.d.ts +0 -11
  373. package/types/src/frontend/utils/api-client.d.ts +0 -130
  374. package/types/src/frontend/utils/data-css-name.d.ts +0 -3
  375. package/types/src/frontend/utils/index.d.ts +0 -3
  376. package/types/src/frontend/utils/overridable-component.d.ts +0 -11
  377. package/types/src/index.d.ts +0 -9
  378. package/types/src/locale/config.d.ts +0 -87
  379. package/types/src/locale/default-config.d.ts +0 -5
  380. package/types/src/locale/index.d.ts +0 -4
  381. package/types/src/utils/error-type.enum.d.ts +0 -10
  382. package/types/src/utils/file-resolver.d.ts +0 -6
  383. package/types/src/utils/flat/constants.d.ts +0 -2
  384. package/types/src/utils/flat/filter-out-params.d.ts +0 -10
  385. package/types/src/utils/flat/filter-out-params.spec.d.ts +0 -1
  386. package/types/src/utils/flat/flat-module.d.ts +0 -28
  387. package/types/src/utils/flat/flat.types.d.ts +0 -36
  388. package/types/src/utils/flat/get.d.ts +0 -13
  389. package/types/src/utils/flat/get.spec.d.ts +0 -1
  390. package/types/src/utils/flat/index.d.ts +0 -2
  391. package/types/src/utils/flat/merge.d.ts +0 -11
  392. package/types/src/utils/flat/merge.spec.d.ts +0 -1
  393. package/types/src/utils/flat/path-parts.type.d.ts +0 -1
  394. package/types/src/utils/flat/path-to-parts.d.ts +0 -22
  395. package/types/src/utils/flat/property-key-regex.d.ts +0 -2
  396. package/types/src/utils/flat/remove-path.d.ts +0 -10
  397. package/types/src/utils/flat/remove-path.spec.d.ts +0 -1
  398. package/types/src/utils/flat/select-params.d.ts +0 -11
  399. package/types/src/utils/flat/select-params.spec.d.ts +0 -1
  400. package/types/src/utils/flat/set.d.ts +0 -11
  401. package/types/src/utils/flat/set.spec.d.ts +0 -1
  402. package/types/src/utils/index.d.ts +0 -4
  403. package/types/src/utils/param-converter/constants.d.ts +0 -2
  404. package/types/src/utils/param-converter/convert-nested-param.d.ts +0 -3
  405. package/types/src/utils/param-converter/convert-nested-param.spec.d.ts +0 -1
  406. package/types/src/utils/param-converter/convert-param.d.ts +0 -2
  407. package/types/src/utils/param-converter/convert-param.spec.d.ts +0 -1
  408. package/types/src/utils/param-converter/index.d.ts +0 -1
  409. package/types/src/utils/param-converter/param-converter-module.d.ts +0 -11
  410. package/types/src/utils/param-converter/prepare-params.d.ts +0 -3
  411. package/types/src/utils/param-converter/validate-param.d.ts +0 -8
  412. package/types/src/utils/slash/index.d.ts +0 -1
  413. package/types/src/utils/theme-bundler.d.ts +0 -2
  414. package/types/src/utils/translate-functions.factory.d.ts +0 -142
  415. package/types/vendor-types/global.d.ts +0 -15
@@ -1,16 +0,0 @@
1
- import AdminJS from '../../adminjs.js';
2
- /**
3
- * Generates entry file for all UsersComponents.
4
- * Entry consists of 3 parts:
5
- * 1. Setup AdminJS.UserComponents map.
6
- * 2. List of all environmental variables passed to AdminJS in configuration option.
7
- * 3. Imports of user components defined by ComponentLoader.
8
- *
9
- * @param {AdminJS} admin
10
- * @param {String} entryPath path to folder where entry file is located
11
- * @return {String} content of an entry file
12
- *
13
- * @private
14
- */
15
- declare const generateUserComponentEntry: (admin: AdminJS, entryPath: string) => string;
16
- export default generateUserComponentEntry;
@@ -1,3 +0,0 @@
1
- import { AssetBundler } from './utils/asset-bundler.js';
2
- declare const bundler: AssetBundler;
3
- export default bundler;
@@ -1,6 +0,0 @@
1
- export { default as appBundler } from './app.bundler.js';
2
- export { default as globalsBundler } from './globals.bundler.js';
3
- export { default as componentsBundler } from './components.bundler.js';
4
- export { default as generateUserComponentEntry } from './generate-user-component-entry.js';
5
- export * from './utils/constants.js';
6
- export { AssetBundler } from './utils/asset-bundler.js';
@@ -1,32 +0,0 @@
1
- import { InputOptions, OutputOptions } from 'rollup';
2
- export declare class AssetBundler {
3
- static DEFAULT_EXTENSIONS: string[];
4
- static DEFAULT_GLOBALS: {
5
- react: string;
6
- redux: string;
7
- 'react-feather': string;
8
- '@clement_lores/admin-design-system/styled-components': string;
9
- 'prop-types': string;
10
- 'react-dom': string;
11
- 'react-redux': string;
12
- 'react-router': string;
13
- 'react-router-dom': string;
14
- adminjs: string;
15
- '@clement_lores/admin-design-system': string;
16
- };
17
- static DEFAULT_EXTERNALS: string[];
18
- protected inputOptions: InputOptions;
19
- protected outputOptions: OutputOptions;
20
- constructor(input: InputOptions, output: OutputOptions);
21
- build(): Promise<void>;
22
- watch(): Promise<void>;
23
- createEntry({ dir, content, }: {
24
- write?: boolean;
25
- dir?: string;
26
- content: string;
27
- }): Promise<void>;
28
- getOutput(): Promise<string | null>;
29
- createConfiguration(input: InputOptions, output: OutputOptions): void;
30
- setInputOption<T = any>(key: string, value: T): this;
31
- setOutputOption<T = any>(key: string, value: T): this;
32
- }
@@ -1,4 +0,0 @@
1
- export declare const NODE_ENV: string;
2
- export declare const ADMIN_JS_TMP_DIR: string;
3
- export declare const COMPONENTS_ENTRY_PATH: string;
4
- export declare const COMPONENTS_OUTPUT_PATH: string;
@@ -1,131 +0,0 @@
1
- import { ActionContext, ActionRequest, RecordActionResponse, ActionResponse, BulkActionResponse } from '../actions/action.interface.js';
2
- import { SearchActionResponse } from '../actions/search/search-action.js';
3
- /**
4
- * Controller responsible for the auto-generated API: `/admin_root/api/...`, where
5
- * _admin_root_ is the `rootPath` given in {@link AdminJSOptions}.
6
- *
7
- * The best way to utilise it is to use {@link ApiClient} on the frontend.
8
- *
9
- * ### Available API endpoints
10
- *
11
- * <div class='table-container'>
12
- *
13
- * | Endpoint | Method | Description |
14
- * |--------------------------|-----------------------|-------------|
15
- * | .../api/resources/{resourceId}/actions/{action} | {@link ApiController#resourceAction} | Perform customized resource action |
16
- * | .../api/resources/{resourceId}/records/{recordId}/{action} | {@link ApiController#recordAction} | Perform customized record action |
17
- * | .../api/resources/{resourceId}/bulk/{action}?recordIds={recordIds} | {@link ApiController#bulkAction} | Perform customized bulk action |
18
- * | .../api/pages/{pageName}_ | {@link ApiController#page} | Perform customized page action |
19
- * | .../api/dashboard_ | {@link ApiController#dashboard} | Perform customized dashboard action |
20
- *
21
- * </div>
22
- *
23
- * ### Responsibility
24
- *
25
- * In general this controllers takes handler functions you define in {@link AdminJSOptions} and:
26
- * - find all the [context information]{@link ActionContext} which is needed by the action
27
- * and is passed to the {@link Action#handler}, {@link Action#before} and {@link Action#after}
28
- * - checks if action can be invoked by particular user {@link Action#isAccessible}
29
- * - invokes {@link Action#before} and {@link Action#after} hooks
30
- *
31
- * You probably don't want to modify it, but you can call its methods by using {@link ApiClient}
32
- *
33
- * @hideconstructor
34
- */
35
- declare class ApiController {
36
- private _admin;
37
- private currentAdmin;
38
- /**
39
- * @param {Object} options
40
- * @param {AdminJSOptions} options.admin
41
- * @param {CurrentAdmin} [currentAdmin]
42
- */
43
- constructor({ admin }: {
44
- admin: any;
45
- }, currentAdmin: any);
46
- /**
47
- * Returns context for given action
48
- * @private
49
- *
50
- * @param {ActionRequest} request request object
51
- * @return {Promise<ActionContext>} action context
52
- */
53
- getActionContext(request: ActionRequest): Promise<ActionContext>;
54
- /**
55
- * Search records by query string.
56
- *
57
- * Handler function responsible for a _.../api/resources/{resourceId}/search/{query}_ route
58
- *
59
- * @param {ActionRequest} request with __params.query__ set
60
- * @param {any} response
61
- *
62
- * @return {Promise<SearchActionResponse>} found records
63
- */
64
- search(request: ActionRequest, response: any): Promise<SearchActionResponse>;
65
- /**
66
- * Performs a customized {@link Action resource action}.
67
- * To call it use {@link ApiClient#resourceAction} method.
68
- *
69
- * Handler function responsible for a _.../api/resources/{resourceId}/actions/{action}_
70
- *
71
- * @param {ActionRequest} originalRequest
72
- * @param {any} response object from the plugin (i.e. adminjs-expressjs)
73
- *
74
- * @return {Promise<ActionResponse>} action response
75
- */
76
- resourceAction(originalRequest: ActionRequest, response: any): Promise<ActionResponse>;
77
- /**
78
- * Performs a customized {@link Action record action}.
79
- * To call it use {@link ApiClient#recordAction} method.
80
- *
81
- * Handler function responsible for a _.../api/resources/{resourceId}/records/{recordId}/{action}_
82
- *
83
- * @param {ActionRequest} originalRequest
84
- * @param {any} response
85
- *
86
- * @return {Promise<RecordActionResponse>} action response
87
- * @throws ConfigurationError When given record action doesn't return {@link RecordJSON}
88
- * @throws ConfigurationError when action handler doesn't return Promise<{@link RecordActionResponse}>
89
- */
90
- recordAction(originalRequest: ActionRequest, response: any): Promise<RecordActionResponse>;
91
- /**
92
- * Performs a customized {@link Action bulk action}.
93
- * To call it use {@link ApiClient#bulkAction} method.
94
- *
95
- * Handler function responsible for a _.../api/resources/{resourceId}/bulk/{action}?recordIds={recordIds}_
96
- *
97
- * @param {ActionRequest} request
98
- * @param {any} response
99
- *
100
- * @return {Promise<BulkActionResponse>} action response
101
- * @throws NotFoundError when recordIds are missing in query or they don't exists in
102
- * the database
103
- * @throws ConfigurationError when action handler doesn't return Promise<{@link BulkActionResponse}>
104
- */
105
- bulkAction(originalRequest: ActionRequest, response: any): Promise<BulkActionResponse>;
106
- /**
107
- * Gets optional data needed by the dashboard.
108
- * To call it use {@link ApiClient#getDashboard} method.
109
- *
110
- * Handler function responsible for a _.../api/dashboard_
111
- *
112
- * @param {ActionRequest} request
113
- * @param {any} response
114
- *
115
- * @return {Promise<any>} action response
116
- */
117
- dashboard(request: any, response: any): Promise<any>;
118
- /**
119
- * Gets optional data needed by the page.
120
- * To call it use {@link ApiClient#getPage} method.
121
- *
122
- * Handler function responsible for a _.../api/pages/{pageName}_
123
- *
124
- * @param {ActionRequest} request
125
- * @param {any} response
126
- *
127
- * @return {Promise<any>} action response
128
- */
129
- page(request: any, response: any): Promise<any>;
130
- }
131
- export default ApiController;
@@ -1,16 +0,0 @@
1
- import { ActionRequest } from '../actions/action.interface.js';
2
- export default class AppController {
3
- private _admin;
4
- private h;
5
- private currentAdmin;
6
- constructor({ admin }: {
7
- admin: any;
8
- }, currentAdmin: any);
9
- index(): Promise<string>;
10
- resourceAction({ params }: ActionRequest): Promise<string>;
11
- bulkAction({ params, query }: ActionRequest): Promise<string>;
12
- resource({ params }: ActionRequest): Promise<string>;
13
- recordAction({ params }: ActionRequest): Promise<string>;
14
- page({ params }: ActionRequest): Promise<string>;
15
- bundleComponents(): Promise<string | null>;
16
- }
@@ -1,2 +0,0 @@
1
- export { default as AppController } from './app-controller.js';
2
- export { default as ApiController } from './api-controller.js';
@@ -1,130 +0,0 @@
1
- import { VariantType } from '@clement_lores/admin-design-system';
2
- import AdminJS from '../../../adminjs.js';
3
- import BaseResource from '../../adapters/resource/base-resource.js';
4
- import { Action, ActionContext, ActionRequest, ActionResponse } from '../../actions/action.interface.js';
5
- import { CurrentAdmin } from '../../../current-admin.interface.js';
6
- import { ActionJSON } from '../../../frontend/interfaces/action/action-json.interface.js';
7
- import BaseRecord from '../../adapters/record/base-record.js';
8
- import { ParsedLayoutElement } from '../../utils/layout-element-parser/index.js';
9
- /**
10
- * Decorates an action
11
- *
12
- * @category Decorators
13
- */
14
- declare class ActionDecorator {
15
- name: string;
16
- private _admin;
17
- private _resource;
18
- private h;
19
- private action;
20
- /**
21
- * @param {Object} params
22
- * @param {Action} params.action
23
- * @param {BaseResource} params.resource
24
- * @param {AdminJS} params.admin current instance of AdminJS
25
- */
26
- constructor({ action, admin, resource }: {
27
- action: Action<ActionResponse>;
28
- admin: AdminJS;
29
- resource: BaseResource;
30
- });
31
- /**
32
- * Original handler wrapped with the hook `before` and `after` methods.
33
- *
34
- * @param {ActionRequest} request
35
- * @param {any} response
36
- * @param {ActionContext} context
37
- *
38
- * @return {Promise<any>}
39
- */
40
- handler(request: ActionRequest, response: any, context: ActionContext): Promise<any>;
41
- /**
42
- * Invokes before action hooks if there are any
43
- *
44
- * @param {ActionRequest} request
45
- * @param {ActionContext} context
46
- *
47
- * @return {Promise<ActionRequest>}
48
- */
49
- invokeBeforeHook(request: ActionRequest, context: ActionContext): Promise<ActionRequest>;
50
- /**
51
- * Invokes action handler if there is any
52
- *
53
- * @param {ActionRequest} request
54
- * @param {any} response
55
- * @param {ActionContext} context
56
- *
57
- * @return {Promise<ActionResponse>}
58
- */
59
- invokeHandler(request: ActionRequest, response: any, context: ActionContext): Promise<ActionResponse>;
60
- /**
61
- * Invokes after action hooks if there are any
62
- *
63
- * @param {ActionResponse} response
64
- * @param {ActionRequest} request
65
- * @param {ActionContext} context
66
- *
67
- * @return {Promise<ActionResponse>}
68
- */
69
- invokeAfterHook(response: ActionResponse, request: ActionRequest, context: ActionContext): Promise<ActionResponse>;
70
- /**
71
- * Returns true when action can be performed on a record
72
- *
73
- * @return {Boolean}
74
- */
75
- isRecordType(): boolean;
76
- /**
77
- * Returns true when action can be performed on an entire resource
78
- *
79
- * @return {Boolean}
80
- */
81
- isResourceType(): boolean;
82
- /**
83
- * Returns true when action can be performed on selected records
84
- *
85
- * @return {Boolean}
86
- */
87
- isBulkType(): boolean;
88
- is(what: 'isAccessible' | 'isVisible', currentAdmin?: CurrentAdmin, record?: BaseRecord): boolean;
89
- /**
90
- * Is action visible in the UI
91
- * @param {CurrentAdmin} [currentAdmin] currently logged in admin user
92
- * @param {BaseRecord} [record]
93
- *
94
- * @return {Boolean}
95
- */
96
- isVisible(currentAdmin?: CurrentAdmin, record?: BaseRecord): boolean;
97
- /**
98
- * Is action accessible
99
- *
100
- * @param {CurrentAdmin} [currentAdmin] currently logged in admin user
101
- * @param {BaseRecord} [record]
102
- * @return {Boolean}
103
- */
104
- isAccessible(currentAdmin?: CurrentAdmin, record?: BaseRecord): boolean;
105
- /**
106
- * Indicates if user can invoke given action
107
- *
108
- * @param {ActionContext} context passed action context
109
- *
110
- * @return {boolean} true given user has rights to the action
111
- * @throws {ForbiddenError} when user cannot perform given action
112
- */
113
- canInvokeAction(context: ActionContext): boolean;
114
- containerWidth(): ActionJSON['containerWidth'];
115
- layout(currentAdmin?: CurrentAdmin): Array<ParsedLayoutElement> | null;
116
- variant(): VariantType;
117
- parent(): string | null;
118
- custom(): Record<string, any>;
119
- hasHandler(): boolean;
120
- showResourceActions(): boolean;
121
- /**
122
- * Serializes action to JSON format
123
- *
124
- * @param {CurrentAdmin} [currentAdmin]
125
- *
126
- * @return {ActionJSON} serialized action
127
- */
128
- toJSON(currentAdmin?: CurrentAdmin): ActionJSON;
129
- }
130
- export default ActionDecorator;
@@ -1 +0,0 @@
1
- export { default as ActionDecorator } from './action-decorator.js';
@@ -1,3 +0,0 @@
1
- export * from './action/index.js';
2
- export * from './property/index.js';
3
- export * from './resource/index.js';
@@ -1,3 +0,0 @@
1
- export { PropertyDecorator } from './property-decorator.js';
2
- export type { default as PropertyOptions } from './property-options.interface.js';
3
- export * from './property-options.interface.js';
@@ -1,164 +0,0 @@
1
- import AdminJS from '../../../adminjs.js';
2
- import { BasePropertyJSON, PropertyPlace } from '../../../frontend/interfaces/index.js';
3
- import BaseProperty, { PropertyType } from '../../adapters/property/base-property.js';
4
- import BaseResource from '../../adapters/resource/base-resource.js';
5
- import ResourceDecorator from '../resource/resource-decorator.js';
6
- import PropertyOptions from './property-options.interface.js';
7
- /**
8
- * Decorates property
9
- *
10
- * @category Decorators
11
- */
12
- export declare class PropertyDecorator {
13
- property: BaseProperty;
14
- /**
15
- * Property path including all parents.
16
- * For root property (this without a parent) it will be its name.
17
- * But when property has children their paths will include parent path:
18
- * `parentName.subPropertyName`.
19
- *
20
- * This path serves as a key in {@link PropertyOptions} to identify which
21
- * property has to be updated
22
- */
23
- propertyPath: string;
24
- /**
25
- * Indicates if given property has been created in AdminJS and hasn't been returned by the
26
- * database adapter
27
- */
28
- isVirtual: boolean;
29
- private _admin;
30
- private _resource;
31
- options: PropertyOptions;
32
- /**
33
- * Array of all subProperties which were added in {@link ResourceOption} interface rather than
34
- * in the database
35
- *
36
- * @private
37
- */
38
- private virtualSubProperties;
39
- /**
40
- * @param {Object} opts
41
- * @param {BaseProperty} opts.property
42
- * @param {AdminJS} opts.admin current instance of AdminJS
43
- * @param {PropertyOptions} opts.options
44
- * @param {ResourceDecorator} opts.resource
45
- */
46
- constructor({ property, admin, options, resource, path, isVirtual }: {
47
- property: BaseProperty;
48
- admin: AdminJS;
49
- options?: PropertyOptions;
50
- resource: ResourceDecorator;
51
- path?: string;
52
- isVirtual?: boolean;
53
- });
54
- /**
55
- * True if given property can be sortable
56
- *
57
- * @returns {boolean}
58
- */
59
- isSortable(): boolean;
60
- /**
61
- * When given property is a reference to another Resource - it returns this Resource
62
- *
63
- * @return {BaseResource} reference resource
64
- */
65
- reference(): BaseResource | null;
66
- referenceName(): string | null;
67
- /**
68
- * Name of the property
69
- *
70
- * @returns {string}
71
- */
72
- name(): string;
73
- /**
74
- * Resource decorator of given property
75
- */
76
- resource(): ResourceDecorator;
77
- /**
78
- * Label of a property
79
- *
80
- * @return {string}
81
- */
82
- label(): string;
83
- /**
84
- * Property type
85
- *
86
- * @returns {PropertyType}
87
- */
88
- type(): PropertyType;
89
- /**
90
- * If given property has limited number of available values
91
- * it returns them.
92
- *
93
- * @returns {Array<{value: string, label: string}>}
94
- */
95
- availableValues(): null | Array<{
96
- value: string | number;
97
- label?: string;
98
- }>;
99
- isArray(): boolean;
100
- isDraggable(): boolean;
101
- /**
102
- * Indicates if given property should be visible
103
- *
104
- * @param {'list' | 'edit' | 'show' | 'filter'} where
105
- */
106
- isVisible(where: PropertyPlace): boolean;
107
- /**
108
- * Position of the field
109
- *
110
- * @return {number}
111
- */
112
- position(): number;
113
- /**
114
- * If property should be treated as an ID field
115
- *
116
- * @return {boolean}
117
- */
118
- isId(): boolean;
119
- /**
120
- * If property should be marked as a required with a star (*)
121
- *
122
- * @return {boolean}
123
- */
124
- isRequired(): boolean;
125
- /**
126
- * If property should be treated as an title field
127
- * Title field is used as a link to the resource page
128
- * in the list view and in the breadcrumbs
129
- *
130
- * @return {boolean}
131
- */
132
- isTitle(): boolean;
133
- /**
134
- * If property should be disabled in the UI
135
- *
136
- * @return {boolean}
137
- */
138
- isDisabled(): boolean;
139
- /**
140
- * Returns JSON representation of a property
141
- *
142
- * @param {PropertyPlace} [where]
143
- *
144
- * @return {PropertyJSON}
145
- */
146
- toJSON(where?: PropertyPlace): BasePropertyJSON;
147
- /**
148
- * Decorates subProperties
149
- *
150
- * @return {Array<PropertyDecorator>} decorated subProperties
151
- */
152
- subProperties(): Array<PropertyDecorator>;
153
- addSubProperty(subProperty: PropertyDecorator): void;
154
- /**
155
- * Returns PropertyOptions passed by the user for a subProperty. Furthermore
156
- * it changes property name to the nested property key.
157
- *
158
- * @param {String} propertyPath
159
- * @return {PropertyOptions}
160
- * @private
161
- */
162
- private getOptionsForSubProperty;
163
- }
164
- export default PropertyDecorator;
@@ -1,137 +0,0 @@
1
- import { PropertyType } from '../../adapters/property/base-property.js';
2
- /**
3
- * Options passed to a given property
4
- */
5
- export default interface PropertyOptions {
6
- /**
7
- * if given property should be visible. It can be either boolean for all possible views, or
8
- * you can verify which view in particular should be hidden/shown.
9
- */
10
- isVisible?: boolean | {
11
- show?: boolean;
12
- list?: boolean;
13
- edit?: boolean;
14
- filter?: boolean;
15
- };
16
- /**
17
- * List of possible overridden components for given property.
18
- */
19
- components?: {
20
- show?: string;
21
- list?: string;
22
- edit?: string;
23
- filter?: string;
24
- };
25
- /**
26
- * Property type
27
- */
28
- type?: PropertyType;
29
- /**
30
- * Indicates if property should be treated as an ID
31
- */
32
- isId?: boolean;
33
- /**
34
- * One of given property should be treated as an "title property". Title property is "clickable"
35
- * when user sees the record in a list or show views.
36
- *
37
- * @deprecated Use ResourceOptions#titleProperty
38
- */
39
- isTitle?: boolean;
40
- /**
41
- * Indicates if given property should be treated as array of elements.
42
- * @new In version 3.3
43
- */
44
- isArray?: boolean;
45
- /**
46
- * Indicates if array elements should be draggable when editing.
47
- * It is only usable if the property is an array.
48
- * @new In version 3.5
49
- */
50
- isDraggable?: boolean;
51
- /**
52
- * position of the field in a list,
53
- * title field (isTitle) gets position -1 by default other
54
- * fields gets position = 100.
55
- */
56
- position?: number;
57
- /**
58
- * If options should be limited to finite set. After setting this
59
- * in the UI you will see select box instead of the input
60
- */
61
- availableValues?: Array<{
62
- value: string | number;
63
- label?: string;
64
- }>;
65
- /**
66
- * Custom properties passed to the frontend in {@link PropertyJSON}
67
- */
68
- custom?: {
69
- [key: string]: any;
70
- };
71
- /**
72
- * Additional props passed to the actual React component rendering given property in Edit
73
- * component.
74
- *
75
- * @new in version 3.3
76
- */
77
- props?: {
78
- [key: string]: any;
79
- };
80
- /**
81
- * Whether given property should be editable or not.
82
- */
83
- isDisabled?: boolean;
84
- /**
85
- * Whether given property should be sortable on list or not.
86
- */
87
- isSortable?: boolean;
88
- /**
89
- * Whether given property should be marked as required.
90
- */
91
- isRequired?: boolean;
92
- /**
93
- * Whether label should be hidden - false by default
94
- */
95
- hideLabel?: boolean;
96
- /**
97
- * Name of the resource to which this property should be a reference.
98
- * If set - {@link PropertyOptions.type} always returns `reference`
99
- * @new In version 3.3
100
- */
101
- reference?: string;
102
- /**
103
- * Description of field. Shown as hoverable hint after label.
104
- *
105
- * To use translations provide it in locale with specified options key from resource
106
- * @example
107
- * ```js
108
- * new AdminJS({
109
- * resources: [
110
- * {
111
- * resource: myResource,
112
- * options: {
113
- * properties: {
114
- * myAwesomeProperty: {
115
- * description: "Plane description" || "awesomeHint", // <- message key in locale
116
- * },
117
- * },
118
- * },
119
- * },
120
- * ],
121
- * locale: {
122
- * translations: {
123
- * resources: {
124
- * myResource: {
125
- * messages: {
126
- * awesomeHint: "Locale description",
127
- * },
128
- * },
129
- * },
130
- * },
131
- * },
132
- * });
133
- * ```
134
- * @new In version 5.6
135
- */
136
- description?: string;
137
- }
@@ -1 +0,0 @@
1
- export * from './override-from-options.js';
@@ -1,4 +0,0 @@
1
- import { BaseProperty } from '../../../adapters/property/index.js';
2
- import PropertyOptions from '../property-options.interface.js';
3
- export type OverridableFromOptionsType = keyof Pick<BaseProperty, 'isSortable' | 'type' | 'isId' | 'isRequired' | 'isTitle'>;
4
- export declare function overrideFromOptions<T extends OverridableFromOptionsType>(optionName: T, property: BaseProperty, options: PropertyOptions): ReturnType<BaseProperty[OverridableFromOptionsType]> | null | undefined;