@antelopejs/interface-dms 0.9.1 → 0.10.0

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 (515) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/dist/attachments.js +3 -1
  3. package/dist/attachments.js.map +1 -1
  4. package/dist/auth/db/models/sessions.model.js +1 -5
  5. package/dist/auth/db/models/sessions.model.js.map +1 -1
  6. package/dist/auth/db/tables/users.table.js.map +1 -1
  7. package/dist/auth/index.js +4 -1
  8. package/dist/auth/index.js.map +1 -1
  9. package/dist/auth/internal/jwt-auth-decorator.js +7 -5
  10. package/dist/auth/internal/jwt-auth-decorator.js.map +1 -1
  11. package/dist/auth/internal/request-authenticators.js +4 -1
  12. package/dist/auth/internal/request-authenticators.js.map +1 -1
  13. package/dist/auth/internal/request-principal.js +1 -0
  14. package/dist/auth/internal/request-principal.js.map +1 -1
  15. package/dist/base/activity-feed.d.ts +26 -26
  16. package/dist/base/banner.d.ts +14 -14
  17. package/dist/base/banner.js +1 -0
  18. package/dist/base/banner.js.map +1 -1
  19. package/dist/base/block-registry/helpers.js +1 -0
  20. package/dist/base/block-registry/helpers.js.map +1 -1
  21. package/dist/base/block-registry/internal/describe.js +107 -85
  22. package/dist/base/block-registry/internal/describe.js.map +1 -1
  23. package/dist/base/block-registry/presentation.js +0 -5
  24. package/dist/base/block-registry/presentation.js.map +1 -1
  25. package/dist/base/block-registry/registry.js +4 -1
  26. package/dist/base/block-registry/registry.js.map +1 -1
  27. package/dist/base/block-types.js +0 -2
  28. package/dist/base/block-types.js.map +1 -1
  29. package/dist/base/card.d.ts +8 -8
  30. package/dist/base/chart-card.d.ts +2 -2
  31. package/dist/base/chart-card.js +2 -2
  32. package/dist/base/chart-card.js.map +1 -1
  33. package/dist/base/chart-schemas.d.ts +66 -66
  34. package/dist/base/chart-schemas.js +19 -21
  35. package/dist/base/chart-schemas.js.map +1 -1
  36. package/dist/base/chart.js +1 -0
  37. package/dist/base/chart.js.map +1 -1
  38. package/dist/base/code-block.js +1 -0
  39. package/dist/base/code-block.js.map +1 -1
  40. package/dist/base/confirm-dialog.d.ts +2 -6
  41. package/dist/base/confirm-dialog.js +36 -15
  42. package/dist/base/confirm-dialog.js.map +1 -1
  43. package/dist/base/data-sources.js +6 -2
  44. package/dist/base/data-sources.js.map +1 -1
  45. package/dist/base/data-types/compare-types.js +82 -68
  46. package/dist/base/data-types/compare-types.js.map +1 -1
  47. package/dist/base/data-types/core.d.ts +8 -101
  48. package/dist/base/data-types/core.js +40 -143
  49. package/dist/base/data-types/core.js.map +1 -1
  50. package/dist/base/data-types/default/address.d.ts +126 -0
  51. package/dist/base/data-types/default/address.js +57 -0
  52. package/dist/base/data-types/default/address.js.map +1 -0
  53. package/dist/base/data-types/default/choices.d.ts +54 -0
  54. package/dist/base/data-types/default/choices.js +135 -0
  55. package/dist/base/data-types/default/choices.js.map +1 -0
  56. package/dist/base/data-types/default/files.d.ts +86 -0
  57. package/dist/base/data-types/default/files.js +214 -0
  58. package/dist/base/data-types/default/files.js.map +1 -0
  59. package/dist/base/data-types/default/inputs.d.ts +11 -0
  60. package/dist/base/data-types/default/inputs.js +26 -0
  61. package/dist/base/data-types/default/inputs.js.map +1 -0
  62. package/dist/base/data-types/default/numbers.d.ts +62 -0
  63. package/dist/base/data-types/default/numbers.js +287 -0
  64. package/dist/base/data-types/default/numbers.js.map +1 -0
  65. package/dist/base/data-types/default/options.d.ts +133 -0
  66. package/dist/base/data-types/default/options.js +3 -0
  67. package/dist/base/data-types/default/options.js.map +1 -0
  68. package/dist/base/data-types/default/relations.d.ts +267 -0
  69. package/dist/base/data-types/default/relations.js +149 -0
  70. package/dist/base/data-types/default/relations.js.map +1 -0
  71. package/dist/base/data-types/default/strings.d.ts +35 -0
  72. package/dist/base/data-types/default/strings.js +154 -0
  73. package/dist/base/data-types/default/strings.js.map +1 -0
  74. package/dist/base/data-types/default-types.d.ts +73 -753
  75. package/dist/base/data-types/default-types.js +39 -991
  76. package/dist/base/data-types/default-types.js.map +1 -1
  77. package/dist/base/data-types/field-types.js +2 -6
  78. package/dist/base/data-types/field-types.js.map +1 -1
  79. package/dist/base/data-types/index.js +1 -20
  80. package/dist/base/data-types/index.js.map +1 -1
  81. package/dist/base/data-types/internal/compare-types.js +0 -2
  82. package/dist/base/data-types/internal/compare-types.js.map +1 -1
  83. package/dist/base/data-types/internal/relation-add-form.d.ts +7 -0
  84. package/dist/base/data-types/internal/relation-add-form.js +21 -0
  85. package/dist/base/data-types/internal/relation-add-form.js.map +1 -0
  86. package/dist/base/data-types/internal/relation-endpoints.d.ts +8 -0
  87. package/dist/base/data-types/internal/relation-endpoints.js +36 -0
  88. package/dist/base/data-types/internal/relation-endpoints.js.map +1 -0
  89. package/dist/base/data-types/status-type.js +0 -6
  90. package/dist/base/data-types/status-type.js.map +1 -1
  91. package/dist/base/display.d.ts +6 -6
  92. package/dist/base/display.js +15 -10
  93. package/dist/base/display.js.map +1 -1
  94. package/dist/base/empty-state.d.ts +8 -8
  95. package/dist/base/export-jobs.js.map +1 -1
  96. package/dist/base/form-block-schema.d.ts +36 -36
  97. package/dist/base/form-block-schema.js +0 -5
  98. package/dist/base/form-block-schema.js.map +1 -1
  99. package/dist/base/form-schema.d.ts +5 -1
  100. package/dist/base/form-schema.js +44 -206
  101. package/dist/base/form-schema.js.map +1 -1
  102. package/dist/base/form-types.d.ts +4 -84
  103. package/dist/base/form-types.js.map +1 -1
  104. package/dist/base/form.js +0 -7
  105. package/dist/base/form.js.map +1 -1
  106. package/dist/base/guard.d.ts +14 -14
  107. package/dist/base/helpers/archive-mode-helpers.js +11 -11
  108. package/dist/base/helpers/archive-mode-helpers.js.map +1 -1
  109. package/dist/base/helpers/file-refs.js +20 -7
  110. package/dist/base/helpers/file-refs.js.map +1 -1
  111. package/dist/base/index.js +0 -5
  112. package/dist/base/index.js.map +1 -1
  113. package/dist/base/internal/button-availability.d.ts +3 -17
  114. package/dist/base/internal/button-availability.js +36 -31
  115. package/dist/base/internal/button-availability.js.map +1 -1
  116. package/dist/base/internal/chart-schemas.js +0 -2
  117. package/dist/base/internal/chart-schemas.js.map +1 -1
  118. package/dist/base/internal/composed-text.js +0 -2
  119. package/dist/base/internal/composed-text.js.map +1 -1
  120. package/dist/base/internal/confirm-dialog.d.ts +3 -13
  121. package/dist/base/internal/confirm-dialog.js +37 -21
  122. package/dist/base/internal/confirm-dialog.js.map +1 -1
  123. package/dist/base/internal/display.js +3 -1
  124. package/dist/base/internal/display.js.map +1 -1
  125. package/dist/base/internal/form-schema-components.d.ts +12 -0
  126. package/dist/base/internal/form-schema-components.js +61 -0
  127. package/dist/base/internal/form-schema-components.js.map +1 -0
  128. package/dist/base/internal/form-schema-validation.d.ts +16 -0
  129. package/dist/base/internal/form-schema-validation.js +68 -0
  130. package/dist/base/internal/form-schema-validation.js.map +1 -0
  131. package/dist/base/internal/form-schema.d.ts +2 -7
  132. package/dist/base/internal/form-schema.js +36 -28
  133. package/dist/base/internal/form-schema.js.map +1 -1
  134. package/dist/base/internal/layouts.d.ts +1 -59
  135. package/dist/base/internal/searchable.js +3 -1
  136. package/dist/base/internal/searchable.js.map +1 -1
  137. package/dist/base/key-value-list.d.ts +12 -12
  138. package/dist/base/kpi-card.d.ts +2 -2
  139. package/dist/base/kpi-card.js +2 -0
  140. package/dist/base/kpi-card.js.map +1 -1
  141. package/dist/base/layouts.d.ts +6 -80
  142. package/dist/base/layouts.js +38 -54
  143. package/dist/base/layouts.js.map +1 -1
  144. package/dist/base/live-toggle.d.ts +2 -2
  145. package/dist/base/meter.d.ts +25 -25
  146. package/dist/base/meter.js +0 -1
  147. package/dist/base/meter.js.map +1 -1
  148. package/dist/base/nav-card-grid.d.ts +13 -13
  149. package/dist/base/page-toolbar.d.ts +2 -2
  150. package/dist/base/page-toolbar.js +0 -6
  151. package/dist/base/page-toolbar.js.map +1 -1
  152. package/dist/base/period-selector.d.ts +2 -2
  153. package/dist/base/period-selector.js +0 -4
  154. package/dist/base/period-selector.js.map +1 -1
  155. package/dist/base/query-response.js +3 -5
  156. package/dist/base/query-response.js.map +1 -1
  157. package/dist/base/resource-form-schema.js +0 -4
  158. package/dist/base/resource-form-schema.js.map +1 -1
  159. package/dist/base/searchable.d.ts +5 -0
  160. package/dist/base/searchable.js +11 -2
  161. package/dist/base/searchable.js.map +1 -1
  162. package/dist/base/stat-group.d.ts +15 -15
  163. package/dist/base/tab.d.ts +8 -8
  164. package/dist/base/tab.js +1 -0
  165. package/dist/base/tab.js.map +1 -1
  166. package/dist/base/table-view/column-display.js +0 -1
  167. package/dist/base/table-view/column-display.js.map +1 -1
  168. package/dist/base/table-view/data-functions.d.ts +10 -10
  169. package/dist/base/table-view/data-functions.js.map +1 -1
  170. package/dist/base/table-view/factory.js +32 -204
  171. package/dist/base/table-view/factory.js.map +1 -1
  172. package/dist/base/table-view/internal/auth.js +5 -19
  173. package/dist/base/table-view/internal/auth.js.map +1 -1
  174. package/dist/base/table-view/internal/column-conditions.js +0 -5
  175. package/dist/base/table-view/internal/column-conditions.js.map +1 -1
  176. package/dist/base/table-view/internal/column-display.js +5 -3
  177. package/dist/base/table-view/internal/column-display.js.map +1 -1
  178. package/dist/base/table-view/internal/factory-helpers.js +24 -158
  179. package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
  180. package/dist/base/table-view/internal/factory-lifecycle-created.d.ts +21 -0
  181. package/dist/base/table-view/internal/factory-lifecycle-created.js +96 -0
  182. package/dist/base/table-view/internal/factory-lifecycle-created.js.map +1 -0
  183. package/dist/base/table-view/internal/factory-lifecycle-filter.d.ts +15 -0
  184. package/dist/base/table-view/internal/factory-lifecycle-filter.js +37 -0
  185. package/dist/base/table-view/internal/factory-lifecycle-filter.js.map +1 -0
  186. package/dist/base/table-view/internal/factory-lifecycle-options.d.ts +41 -0
  187. package/dist/base/table-view/internal/factory-lifecycle-options.js +99 -0
  188. package/dist/base/table-view/internal/factory-lifecycle-options.js.map +1 -0
  189. package/dist/base/table-view/internal/factory-private-actions.d.ts +32 -0
  190. package/dist/base/table-view/internal/factory-private-actions.js +77 -0
  191. package/dist/base/table-view/internal/factory-private-actions.js.map +1 -0
  192. package/dist/base/table-view/internal/factory-private-displays.d.ts +5 -0
  193. package/dist/base/table-view/internal/factory-private-displays.js +21 -0
  194. package/dist/base/table-view/internal/factory-private-displays.js.map +1 -0
  195. package/dist/base/table-view/internal/factory-private-urls.d.ts +15 -0
  196. package/dist/base/table-view/internal/factory-private-urls.js +43 -0
  197. package/dist/base/table-view/internal/factory-private-urls.js.map +1 -0
  198. package/dist/base/table-view/internal/files.js +3 -4
  199. package/dist/base/table-view/internal/files.js.map +1 -1
  200. package/dist/base/table-view/internal/footer.js +5 -3
  201. package/dist/base/table-view/internal/footer.js.map +1 -1
  202. package/dist/base/table-view/internal/guards.js +7 -10
  203. package/dist/base/table-view/internal/guards.js.map +1 -1
  204. package/dist/base/table-view/internal/meta-helpers.d.ts +27 -0
  205. package/dist/base/table-view/internal/meta-helpers.js +75 -0
  206. package/dist/base/table-view/internal/meta-helpers.js.map +1 -0
  207. package/dist/base/table-view/internal/meta.js +8 -2
  208. package/dist/base/table-view/internal/meta.js.map +1 -1
  209. package/dist/base/table-view/internal/nav-badges.js +5 -3
  210. package/dist/base/table-view/internal/nav-badges.js.map +1 -1
  211. package/dist/base/table-view/internal/option-contract.d.ts +403 -0
  212. package/dist/base/table-view/internal/option-contract.js +3 -0
  213. package/dist/base/table-view/internal/option-contract.js.map +1 -0
  214. package/dist/base/table-view/internal/option-displays.d.ts +125 -0
  215. package/dist/base/table-view/internal/option-displays.js +3 -0
  216. package/dist/base/table-view/internal/option-displays.js.map +1 -0
  217. package/dist/base/table-view/internal/option-empty-states.d.ts +43 -0
  218. package/dist/base/table-view/internal/option-empty-states.js +3 -0
  219. package/dist/base/table-view/internal/option-empty-states.js.map +1 -0
  220. package/dist/base/table-view/internal/option-expandable.d.ts +66 -0
  221. package/dist/base/table-view/internal/option-expandable.js +3 -0
  222. package/dist/base/table-view/internal/option-expandable.js.map +1 -0
  223. package/dist/base/table-view/internal/option-filtering.d.ts +85 -0
  224. package/dist/base/table-view/internal/option-filtering.js +4 -0
  225. package/dist/base/table-view/internal/option-filtering.js.map +1 -0
  226. package/dist/base/table-view/internal/option-footer.d.ts +64 -0
  227. package/dist/base/table-view/internal/option-footer.js +3 -0
  228. package/dist/base/table-view/internal/option-footer.js.map +1 -0
  229. package/dist/base/table-view/internal/option-forms.d.ts +62 -0
  230. package/dist/base/table-view/internal/option-forms.js +3 -0
  231. package/dist/base/table-view/internal/option-forms.js.map +1 -0
  232. package/dist/base/table-view/internal/option-row-actions.d.ts +76 -0
  233. package/dist/base/table-view/internal/option-row-actions.js +3 -0
  234. package/dist/base/table-view/internal/option-row-actions.js.map +1 -0
  235. package/dist/base/table-view/internal/option-views.d.ts +199 -0
  236. package/dist/base/table-view/internal/option-views.js +3 -0
  237. package/dist/base/table-view/internal/option-views.js.map +1 -0
  238. package/dist/base/table-view/internal/options.d.ts +2 -6
  239. package/dist/base/table-view/internal/options.js +35 -6
  240. package/dist/base/table-view/internal/options.js.map +1 -1
  241. package/dist/base/table-view/internal/realtime.js +15 -5
  242. package/dist/base/table-view/internal/realtime.js.map +1 -1
  243. package/dist/base/table-view/internal/request-filter.js +12 -12
  244. package/dist/base/table-view/internal/request-filter.js.map +1 -1
  245. package/dist/base/table-view/internal/resource-form.js +1 -10
  246. package/dist/base/table-view/internal/resource-form.js.map +1 -1
  247. package/dist/base/table-view/internal/row-actions-schema.js +0 -6
  248. package/dist/base/table-view/internal/row-actions-schema.js.map +1 -1
  249. package/dist/base/table-view/internal/row-rule-shape.d.ts +10 -0
  250. package/dist/base/table-view/internal/row-rule-shape.js +43 -0
  251. package/dist/base/table-view/internal/row-rule-shape.js.map +1 -0
  252. package/dist/base/table-view/internal/row-rules.js +1 -4
  253. package/dist/base/table-view/internal/row-rules.js.map +1 -1
  254. package/dist/base/table-view/internal/tabs.js +3 -6
  255. package/dist/base/table-view/internal/tabs.js.map +1 -1
  256. package/dist/base/table-view/internal/validation.js +2 -16
  257. package/dist/base/table-view/internal/validation.js.map +1 -1
  258. package/dist/base/table-view/internal/writer.js +1 -0
  259. package/dist/base/table-view/internal/writer.js.map +1 -1
  260. package/dist/base/table-view/meta.js +11 -93
  261. package/dist/base/table-view/meta.js.map +1 -1
  262. package/dist/base/table-view/options.d.ts +61 -1099
  263. package/dist/base/table-view/options.js.map +1 -1
  264. package/dist/base/table-view/resource-form.js +0 -2
  265. package/dist/base/table-view/resource-form.js.map +1 -1
  266. package/dist/base/table-view/routes.js +10 -9
  267. package/dist/base/table-view/routes.js.map +1 -1
  268. package/dist/base/table-view/schema.d.ts +93 -93
  269. package/dist/base/table-view/schema.js +4 -22
  270. package/dist/base/table-view/schema.js.map +1 -1
  271. package/dist/base/table-view/source.js +0 -5
  272. package/dist/base/table-view/source.js.map +1 -1
  273. package/dist/base/table-view/views.js +0 -3
  274. package/dist/base/table-view/views.js.map +1 -1
  275. package/dist/base/table-view/writer.js +0 -5
  276. package/dist/base/table-view/writer.js.map +1 -1
  277. package/dist/base/top-list-card.d.ts +13 -13
  278. package/dist/base/top-list-card.js +2 -0
  279. package/dist/base/top-list-card.js.map +1 -1
  280. package/dist/base/types/action-target.d.ts +1 -302
  281. package/dist/base/types/button.d.ts +2 -7
  282. package/dist/base/types/button.js +35 -8
  283. package/dist/base/types/button.js.map +1 -1
  284. package/dist/base/types/confirm-dialog.d.ts +1 -127
  285. package/dist/base/types/custom-button.d.ts +1 -87
  286. package/dist/base/types/error.js +2 -1
  287. package/dist/base/types/error.js.map +1 -1
  288. package/dist/base/types/export-status.d.ts +2 -8
  289. package/dist/base/types/export-status.js +35 -9
  290. package/dist/base/types/export-status.js.map +1 -1
  291. package/dist/base/types/form-values.d.ts +1 -4
  292. package/dist/base/types/internal/action-target.d.ts +2 -8
  293. package/dist/base/types/internal/action-target.js +36 -15
  294. package/dist/base/types/internal/action-target.js.map +1 -1
  295. package/dist/base/types/row-action-operators.d.ts +3 -29
  296. package/dist/base/types/row-action-operators.js +35 -18
  297. package/dist/base/types/row-action-operators.js.map +1 -1
  298. package/dist/base/types/row-action.d.ts +3 -36
  299. package/dist/base/types/size.d.ts +1 -3
  300. package/dist/base/types/size.js +0 -3
  301. package/dist/base/types/size.js.map +1 -1
  302. package/dist/base/types/tone.d.ts +3 -8
  303. package/dist/base/types/tone.js +35 -15
  304. package/dist/base/types/tone.js.map +1 -1
  305. package/dist/base/types/watch.d.ts +5 -19
  306. package/dist/base/types/watch.js +35 -3
  307. package/dist/base/types/watch.js.map +1 -1
  308. package/dist/component-options/action-target.d.ts +304 -0
  309. package/dist/component-options/action-target.js +3 -0
  310. package/dist/component-options/action-target.js.map +1 -0
  311. package/dist/component-options/button.d.ts +93 -0
  312. package/dist/component-options/button.js +12 -0
  313. package/dist/component-options/button.js.map +1 -0
  314. package/dist/component-options/confirm-dialog.d.ts +132 -0
  315. package/dist/component-options/confirm-dialog.js +18 -0
  316. package/dist/component-options/confirm-dialog.js.map +1 -0
  317. package/dist/component-options/data-type.d.ts +101 -0
  318. package/dist/component-options/data-type.js +146 -0
  319. package/dist/component-options/data-type.js.map +1 -0
  320. package/dist/component-options/form-field.d.ts +88 -0
  321. package/dist/component-options/form-field.js +3 -0
  322. package/dist/component-options/form-field.js.map +1 -0
  323. package/dist/component-options/internal/action-target.d.ts +8 -0
  324. package/dist/component-options/internal/action-target.js +18 -0
  325. package/dist/component-options/internal/action-target.js.map +1 -0
  326. package/dist/component-options/internal/button-availability.d.ts +17 -0
  327. package/dist/component-options/internal/button-availability.js +34 -0
  328. package/dist/component-options/internal/button-availability.js.map +1 -0
  329. package/dist/component-options/internal/confirm-dialog.d.ts +13 -0
  330. package/dist/component-options/internal/confirm-dialog.js +24 -0
  331. package/dist/component-options/internal/confirm-dialog.js.map +1 -0
  332. package/dist/component-options/internal/form-field.d.ts +7 -0
  333. package/dist/component-options/internal/form-field.js +31 -0
  334. package/dist/component-options/internal/form-field.js.map +1 -0
  335. package/dist/component-options/internal/page-layout.d.ts +71 -0
  336. package/dist/component-options/internal/page-layout.js +10 -0
  337. package/dist/component-options/internal/page-layout.js.map +1 -0
  338. package/dist/component-options/page-layout.d.ts +80 -0
  339. package/dist/component-options/page-layout.js +57 -0
  340. package/dist/component-options/page-layout.js.map +1 -0
  341. package/dist/component-options/row-action.d.ts +66 -0
  342. package/dist/component-options/row-action.js +22 -0
  343. package/dist/component-options/row-action.js.map +1 -0
  344. package/dist/component-slots.js.map +1 -1
  345. package/dist/component.d.ts +2 -2
  346. package/dist/component.js +38 -193
  347. package/dist/component.js.map +1 -1
  348. package/dist/data-controllers/members.js +2 -8
  349. package/dist/data-controllers/members.js.map +1 -1
  350. package/dist/data-controllers/roles.js +0 -5
  351. package/dist/data-controllers/roles.js.map +1 -1
  352. package/dist/db/internal/exportJobs.model.js +10 -6
  353. package/dist/db/internal/exportJobs.model.js.map +1 -1
  354. package/dist/db/internal/tenantLifecycle.model.js +0 -2
  355. package/dist/db/internal/tenantLifecycle.model.js.map +1 -1
  356. package/dist/db/tables/exportJobs.table.d.ts +1 -1
  357. package/dist/db/tables/roles.table.js.map +1 -1
  358. package/dist/db/tables/user_invites.table.d.ts +1 -1
  359. package/dist/db/tables/user_invites.table.js.map +1 -1
  360. package/dist/export-status.d.ts +8 -0
  361. package/dist/export-status.js +13 -0
  362. package/dist/export-status.js.map +1 -0
  363. package/dist/hooks.d.ts +1 -1
  364. package/dist/hooks.js +2 -4
  365. package/dist/hooks.js.map +1 -1
  366. package/dist/index.js +0 -9
  367. package/dist/index.js.map +1 -1
  368. package/dist/internal/component-builder.d.ts +17 -0
  369. package/dist/internal/component-builder.js +58 -0
  370. package/dist/internal/component-builder.js.map +1 -0
  371. package/dist/internal/component-permissions.d.ts +13 -0
  372. package/dist/internal/component-permissions.js +45 -0
  373. package/dist/internal/component-permissions.js.map +1 -0
  374. package/dist/internal/component-serialization.d.ts +10 -0
  375. package/dist/internal/component-serialization.js +42 -0
  376. package/dist/internal/component-serialization.js.map +1 -0
  377. package/dist/internal/component-slots.js +7 -4
  378. package/dist/internal/component-slots.js.map +1 -1
  379. package/dist/internal/component-watches.d.ts +17 -0
  380. package/dist/internal/component-watches.js +110 -0
  381. package/dist/internal/component-watches.js.map +1 -0
  382. package/dist/internal/invite-membership.js +0 -1
  383. package/dist/internal/invite-membership.js.map +1 -1
  384. package/dist/invite-extension-payloads.d.ts +2 -0
  385. package/dist/invite-extension-payloads.js +3 -0
  386. package/dist/invite-extension-payloads.js.map +1 -0
  387. package/dist/invite-extensions/internal/delivery.js +4 -1
  388. package/dist/invite-extensions/internal/delivery.js.map +1 -1
  389. package/dist/invite-extensions/internal/edit.js +5 -4
  390. package/dist/invite-extensions/internal/edit.js.map +1 -1
  391. package/dist/invite-extensions/internal/form-slot.js +5 -35
  392. package/dist/invite-extensions/internal/form-slot.js.map +1 -1
  393. package/dist/invite-extensions/internal/payload-slices.js +10 -3
  394. package/dist/invite-extensions/internal/payload-slices.js.map +1 -1
  395. package/dist/invite-extensions/internal/registry.js +3 -5
  396. package/dist/invite-extensions/internal/registry.js.map +1 -1
  397. package/dist/invite-extensions/registry.js +3 -8
  398. package/dist/invite-extensions/registry.js.map +1 -1
  399. package/dist/invite-extensions/types.d.ts +1 -2
  400. package/dist/invite-resolution.js +2 -1
  401. package/dist/invite-resolution.js.map +1 -1
  402. package/dist/layout-banners.js.map +1 -1
  403. package/dist/notifications/builder.js +25 -5
  404. package/dist/notifications/builder.js.map +1 -1
  405. package/dist/notifications/internal.js +0 -3
  406. package/dist/notifications/internal.js.map +1 -1
  407. package/dist/notifications/sendable.js.map +1 -1
  408. package/dist/page/categories.js +1 -4
  409. package/dist/page/categories.js.map +1 -1
  410. package/dist/page/controllers.js +9 -55
  411. package/dist/page/controllers.js.map +1 -1
  412. package/dist/page/form-page-routes.js +0 -7
  413. package/dist/page/form-page-routes.js.map +1 -1
  414. package/dist/page/internal/categories.d.ts +1 -1
  415. package/dist/page/internal/categories.js +12 -36
  416. package/dist/page/internal/categories.js.map +1 -1
  417. package/dist/page/internal/category-permission.d.ts +10 -0
  418. package/dist/page/internal/category-permission.js +20 -0
  419. package/dist/page/internal/category-permission.js.map +1 -0
  420. package/dist/page/internal/component-target.js +2 -2
  421. package/dist/page/internal/component-target.js.map +1 -1
  422. package/dist/page/internal/component-tree.js +0 -2
  423. package/dist/page/internal/component-tree.js.map +1 -1
  424. package/dist/page/internal/controller-options.d.ts +6 -0
  425. package/dist/page/internal/controller-options.js +40 -0
  426. package/dist/page/internal/controller-options.js.map +1 -0
  427. package/dist/page/internal/extension-assembly.js +2 -7
  428. package/dist/page/internal/extension-assembly.js.map +1 -1
  429. package/dist/page/internal/layout-filter.js +7 -3
  430. package/dist/page/internal/layout-filter.js.map +1 -1
  431. package/dist/page/internal/metadata-components.d.ts +47 -0
  432. package/dist/page/internal/metadata-components.js +136 -0
  433. package/dist/page/internal/metadata-components.js.map +1 -0
  434. package/dist/page/internal/metadata-extension-contributions.d.ts +14 -0
  435. package/dist/page/internal/metadata-extension-contributions.js +56 -0
  436. package/dist/page/internal/metadata-extension-contributions.js.map +1 -0
  437. package/dist/page/internal/metadata-extensions.d.ts +8 -0
  438. package/dist/page/internal/metadata-extensions.js +21 -0
  439. package/dist/page/internal/metadata-extensions.js.map +1 -0
  440. package/dist/page/internal/metadata-helpers.js +0 -14
  441. package/dist/page/internal/metadata-helpers.js.map +1 -1
  442. package/dist/page/internal/metadata-info.d.ts +5 -0
  443. package/dist/page/internal/metadata-info.js +39 -0
  444. package/dist/page/internal/metadata-info.js.map +1 -0
  445. package/dist/page/internal/metadata-layout-response.d.ts +32 -0
  446. package/dist/page/internal/metadata-layout-response.js +76 -0
  447. package/dist/page/internal/metadata-layout-response.js.map +1 -0
  448. package/dist/page/internal/metadata-layout.d.ts +10 -0
  449. package/dist/page/internal/metadata-layout.js +44 -0
  450. package/dist/page/internal/metadata-layout.js.map +1 -0
  451. package/dist/page/internal/metadata-lifecycle.d.ts +52 -0
  452. package/dist/page/internal/metadata-lifecycle.js +241 -0
  453. package/dist/page/internal/metadata-lifecycle.js.map +1 -0
  454. package/dist/page/internal/metadata-owner.d.ts +53 -0
  455. package/dist/page/internal/metadata-owner.js +14 -0
  456. package/dist/page/internal/metadata-owner.js.map +1 -0
  457. package/dist/page/internal/metadata-publish.d.ts +20 -0
  458. package/dist/page/internal/metadata-publish.js +55 -0
  459. package/dist/page/internal/metadata-publish.js.map +1 -0
  460. package/dist/page/internal/metadata-registration.d.ts +8 -0
  461. package/dist/page/internal/metadata-registration.js +72 -0
  462. package/dist/page/internal/metadata-registration.js.map +1 -0
  463. package/dist/page/internal/metadata-upload-registration.d.ts +16 -0
  464. package/dist/page/internal/metadata-upload-registration.js +64 -0
  465. package/dist/page/internal/metadata-upload-registration.js.map +1 -0
  466. package/dist/page/internal/metadata-uploads.d.ts +18 -0
  467. package/dist/page/internal/metadata-uploads.js +46 -0
  468. package/dist/page/internal/metadata-uploads.js.map +1 -0
  469. package/dist/page/internal/nav-badges.d.ts +1 -1
  470. package/dist/page/internal/nav-badges.js +3 -1
  471. package/dist/page/internal/nav-badges.js.map +1 -1
  472. package/dist/page/internal/page-record.d.ts +2 -9
  473. package/dist/page/internal/page-record.js +8 -5
  474. package/dist/page/internal/page-record.js.map +1 -1
  475. package/dist/page/internal/page-registration.js +0 -4
  476. package/dist/page/internal/page-registration.js.map +1 -1
  477. package/dist/page/internal/registry.js +2 -1
  478. package/dist/page/internal/registry.js.map +1 -1
  479. package/dist/page/internal/table-view-ids.js +3 -2
  480. package/dist/page/internal/table-view-ids.js.map +1 -1
  481. package/dist/page/layout-filter.js +1 -0
  482. package/dist/page/layout-filter.js.map +1 -1
  483. package/dist/page/metadata.js +192 -558
  484. package/dist/page/metadata.js.map +1 -1
  485. package/dist/page/roots.js +3 -5
  486. package/dist/page/roots.js.map +1 -1
  487. package/dist/page/types.d.ts +1 -1
  488. package/dist/page/types.js.map +1 -1
  489. package/dist/permissions.js +0 -18
  490. package/dist/permissions.js.map +1 -1
  491. package/dist/realtime.js +0 -3
  492. package/dist/realtime.js.map +1 -1
  493. package/dist/request-tenant.js +4 -1
  494. package/dist/request-tenant.js.map +1 -1
  495. package/dist/tenant-lifecycle.js +2 -2
  496. package/dist/tenant-lifecycle.js.map +1 -1
  497. package/dist/tones.d.ts +8 -0
  498. package/dist/tones.js +19 -0
  499. package/dist/tones.js.map +1 -0
  500. package/dist/uploads.js +15 -4
  501. package/dist/uploads.js.map +1 -1
  502. package/dist/utils/internal/row-instance.js +2 -3
  503. package/dist/utils/internal/row-instance.js.map +1 -1
  504. package/dist/utils/internal/type-check.d.ts +10 -1
  505. package/dist/utils/internal/type-check.js +12 -3
  506. package/dist/utils/internal/type-check.js.map +1 -1
  507. package/dist/utils/internal/value-parser.js +7 -2
  508. package/dist/utils/internal/value-parser.js.map +1 -1
  509. package/dist/watch-actions.d.ts +19 -0
  510. package/dist/watch-actions.js +7 -0
  511. package/dist/watch-actions.js.map +1 -0
  512. package/docs/3.base/2.types.md +1 -1
  513. package/docs/3.base/8.data-types.md +2 -0
  514. package/docs/4.notifications/3.sending.md +1 -1
  515. package/package.json +3 -3
@@ -0,0 +1,304 @@
1
+ import type { Component, ComponentInfoSerialized } from "../component";
2
+ export type ModalSize = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl"
3
+ /** The whole window: a near full-screen modal, a drawer as wide as the window. */
4
+ | "full";
5
+ /** The edge of the window a `drawer` action target slides in from. */
6
+ export type DrawerDirection = "top" | "right" | "bottom" | "left";
7
+ /**
8
+ * What a side panel says when the row its link names is gone: the `?record=`
9
+ * of a deep link, or a `fetchRowUrl` / `get` route answering 404. Texts are
10
+ * `$`-prefixed i18n keys or literals.
11
+ */
12
+ export interface SidePanelNotFoundTexts {
13
+ /**
14
+ * Title of the state, e.g. `"$api.request.not_found_title"` for "This
15
+ * request is no longer stored". Defaults to the DMS's generic "This entry
16
+ * is no longer available".
17
+ */
18
+ title?: string;
19
+ /**
20
+ * Text under it, e.g. "It was pruned by the log retention, or the link is
21
+ * wrong." Defaults to the DMS's generic one.
22
+ */
23
+ description?: string;
24
+ }
25
+ /**
26
+ * What a `sidePanel` action target sets besides its component, shared by the
27
+ * declared and the serialized target.
28
+ */
29
+ export interface SidePanelTargetOptions {
30
+ /**
31
+ * Title of the panel header. `$`-prefixed: an i18n key. Defaults to the
32
+ * action's label.
33
+ */
34
+ title?: string;
35
+ /**
36
+ * Title of the header while a row is open, in place of `title`: an i18n key
37
+ * (`$`-prefixed) or a literal receiving the row's fields, as a
38
+ * confirmation's texts do. `"$api.request.heading"` translated "{method}
39
+ * {path}" reads "POST /api/orders". `title` stays the header of a panel
40
+ * showing no row (a missing one).
41
+ * @example "{method} {path}"
42
+ */
43
+ rowTitle?: string;
44
+ /**
45
+ * Position of the open row among all the rows the table lists (its count,
46
+ * not the page loaded), drawn under the title: an i18n key (`$`-prefixed)
47
+ * receiving `{ index }` (from 1) and `{ total }`, both written with the
48
+ * locale's digit grouping ("26 120"), e.g.
49
+ * `"$api.request.position"` for "Request {index} of {total}". Defaults to
50
+ * the DMS's generic "{index} of {total}".
51
+ */
52
+ positionLabel?: string;
53
+ /**
54
+ * The open row is kept in the URL (`?record=<id>`, `?<tableId>.record=<id>`
55
+ * on a page with several table views): a link or a reload opens the panel
56
+ * again on that row, and closing it removes the key. On by default for a
57
+ * side panel: `false` opts out. The action's own `deepLink` wins when set.
58
+ */
59
+ deepLink?: boolean;
60
+ /**
61
+ * The words of the panel opened on a row that no longer exists (a deep link
62
+ * to a deleted row): the DMS draws the state and a close button under the
63
+ * header, in place of the component. See {@link SidePanelNotFoundTexts}.
64
+ * @example { title: "$api.request.not_found_title", description: "$api.request.not_found_description" }
65
+ */
66
+ notFound?: SidePanelNotFoundTexts;
67
+ }
68
+ /**
69
+ * What a `drawer` action target sets besides its component and texts, shared
70
+ * by the declared and the serialized target. A drawer opened on a row takes
71
+ * the row options of a side panel, so a detail panel moves from `sidePanel`
72
+ * to `drawer` without losing any of them.
73
+ */
74
+ export interface DrawerTargetOptions extends Omit<SidePanelTargetOptions, "title" | "deepLink"> {
75
+ /**
76
+ * Width a `left` or `right` drawer opens at from `lg`, before the user
77
+ * resizes it: a modal's width at that size (`sm` 384px … `5xl` 1024px),
78
+ * `full` the whole window. Without one it opens at 600px. Capped to the window; below `lg` an
79
+ * unsized one is 440px wide, and on a phone every side drawer, sized or
80
+ * not, leaves a 2rem strip of backdrop (only `full` fills the screen).
81
+ * A `top` or `bottom` drawer ignores it.
82
+ */
83
+ size?: ModalSize;
84
+ /**
85
+ * The DMS draws the row header, as a side panel's: the title naming the
86
+ * open row (`rowTitle`), its position (`positionLabel`), previous and next
87
+ * buttons next to the close button. On when `rowTitle` or `positionLabel`
88
+ * is set; `false` leaves the header to the drawer's title, `true` draws it
89
+ * with the defaults. A drawer opened on no row, or on a selection, never
90
+ * draws it.
91
+ */
92
+ rowHeader?: boolean;
93
+ /**
94
+ * The open row is kept in the URL (`?record=<id>`), as the action's own
95
+ * `deepLink` does (which wins when set). Off by default for a drawer.
96
+ */
97
+ deepLink?: boolean;
98
+ }
99
+ /**
100
+ * A `download` action target: the file is fetched with the user's session and
101
+ * saved, the page left as it is.
102
+ */
103
+ export interface DownloadActionTarget {
104
+ type: "download";
105
+ /**
106
+ * The file to fetch, with the user's session: takes the same
107
+ * `{{row.field}}` and page URL tokens (`{{params.X}}`, `{{query.X}}`) as a `page` target, a
108
+ * query pair whose token the page has no value for being left out.
109
+ * @example "/api/lang/translations/export?workspace={{query.workspace}}&locale={{query.locale}}"
110
+ */
111
+ url: string;
112
+ /**
113
+ * The saved file's name, same tokens (written as they are, not encoded).
114
+ * Else, or while a token is left without a value, the server's
115
+ * `Content-Disposition` name, else the URL's last path segment.
116
+ * @example "{{query.locale}}.json"
117
+ */
118
+ filename?: string;
119
+ }
120
+ export type ActionTarget = ({
121
+ /**
122
+ * A drawer: a modal sheet sliding in from an edge of the window. The
123
+ * container for a detail or record panel: from `lg` the user resizes it
124
+ * by its inner edge, and it opens again at that size. Opened on a row,
125
+ * it steps through the rows (J and K) and takes the row options of a
126
+ * side panel (see {@link DrawerTargetOptions}).
127
+ */
128
+ type: "drawer";
129
+ component: Component;
130
+ title?: string;
131
+ description?: string;
132
+ /**
133
+ * Edge the drawer slides in from (`bottom` by default). A `left` or
134
+ * `right` drawer is a side sheet spanning the window's height, 600px
135
+ * wide from `lg` unless `size` says otherwise.
136
+ */
137
+ direction?: DrawerDirection;
138
+ } & DrawerTargetOptions) | {
139
+ type: "modal";
140
+ size?: ModalSize;
141
+ component: Component;
142
+ title?: string;
143
+ description?: string;
144
+ } | ({
145
+ /**
146
+ * A non-modal panel docked on the right of the page, next to the table,
147
+ * which stays usable. Meant for global, page-independent panels (an
148
+ * assistant dock): a detail or record panel opens in a `drawer`, which
149
+ * takes the same row options. The DMS draws its header: the title, the row's
150
+ * position among all the rows the table lists ("3 of 87", past the
151
+ * page loaded), previous and next buttons (J and K too, turning the
152
+ * table's page past it) and a close button (Esc too). Its component receives the
153
+ * same props as a drawer's (`rowData`, `navigation`…), and is mounted
154
+ * anew on each row, its options' `{{row.X}}` tokens filled with that
155
+ * row (a `ResourceForm` reading `rowId: "{{row._id}}"`). A container
156
+ * block (a `Card` holding blocks) is drawn with its children, their
157
+ * options filled likewise, as in a drawer or a modal. One panel is open
158
+ * at a time: opening it closes a module's side panel, and the other way
159
+ * round.
160
+ */
161
+ type: "sidePanel";
162
+ component: Component;
163
+ } & SidePanelTargetOptions) | {
164
+ type: "page";
165
+ /**
166
+ * The page to open. On a row action the row's fields fill
167
+ * `{{row.field}}`;
168
+ * `{{params.X}}` and `{{query.X}}` name the page the action sits on, a
169
+ * query pair whose token the page has no value for being left out.
170
+ */
171
+ url: string;
172
+ } | {
173
+ type: "external";
174
+ /** Takes the same `{{row.field}}` and page URL tokens as `page`. */
175
+ url: string;
176
+ newTab?: boolean;
177
+ } | DownloadActionTarget | {
178
+ type: "quickAction";
179
+ /**
180
+ * Key of the quick action to run: `category:id`, or the bare id when no
181
+ * other category uses it. The action is left out for users the quick
182
+ * action is not served to.
183
+ */
184
+ id: string;
185
+ } | {
186
+ type: "api";
187
+ /** Takes the page URL tokens and `{{row.field}}`, as a `page` target. */
188
+ url: string;
189
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
190
+ /**
191
+ * JSON body sent with the request. The values of the action's confirm
192
+ * `fields` are merged into it, the input winning.
193
+ */
194
+ body?: Record<string, unknown>;
195
+ /**
196
+ * Field of the JSON response copied to the clipboard on success (a
197
+ * share link, a token).
198
+ */
199
+ copy?: string;
200
+ successMessage: string;
201
+ } | {
202
+ type: "exportJob";
203
+ /** Takes the page URL tokens and `{{row.field}}`, as a `page` target. */
204
+ url: string;
205
+ method?: "GET" | "POST";
206
+ /** As `url`, plus `{{job.id}}`: the id of the job the start answered. */
207
+ statusUrl?: string;
208
+ /** As `url`, plus `{{job.id}}`: the id of the job the start answered. */
209
+ downloadUrl?: string;
210
+ labels?: {
211
+ title?: string;
212
+ exporting?: string;
213
+ downloading?: string;
214
+ successTitle?: string;
215
+ successMessage?: string;
216
+ errorTitle?: string;
217
+ retry?: string;
218
+ };
219
+ };
220
+ export type ActionTargetSerialized = ({
221
+ /**
222
+ * A drawer: a modal sheet sliding in from an edge of the window. The
223
+ * container for a detail or record panel: from `lg` the user resizes it
224
+ * by its inner edge, and it opens again at that size. Opened on a row,
225
+ * it steps through the rows (J and K) and takes the row options of a
226
+ * side panel (see {@link DrawerTargetOptions}).
227
+ */
228
+ type: "drawer";
229
+ component: ComponentInfoSerialized;
230
+ title?: string;
231
+ description?: string;
232
+ /**
233
+ * Edge the drawer slides in from (`bottom` by default). A `left` or
234
+ * `right` drawer is a side sheet spanning the window's height, 600px
235
+ * wide from `lg` unless `size` says otherwise.
236
+ */
237
+ direction?: DrawerDirection;
238
+ } & DrawerTargetOptions) | {
239
+ type: "modal";
240
+ size?: ModalSize;
241
+ component: ComponentInfoSerialized;
242
+ title?: string;
243
+ description?: string;
244
+ } | ({
245
+ /**
246
+ * A non-modal panel docked on the right of the page, next to the table,
247
+ * which stays usable. Meant for global, page-independent panels (an
248
+ * assistant dock): a detail or record panel opens in a `drawer`, which
249
+ * takes the same row options. The DMS draws its header: the title, the row's
250
+ * position among all the rows the table lists ("3 of 87", past the
251
+ * page loaded), previous and next buttons (J and K too, turning the
252
+ * table's page past it) and a close button (Esc too). Its component receives the
253
+ * same props as a drawer's (`rowData`, `navigation`…), and is mounted
254
+ * anew on each row. One panel is open at a time: opening it closes a
255
+ * module's side panel, and the other way round.
256
+ */
257
+ type: "sidePanel";
258
+ component: ComponentInfoSerialized;
259
+ } & SidePanelTargetOptions) | {
260
+ type: "page";
261
+ url: string;
262
+ } | {
263
+ type: "external";
264
+ url: string;
265
+ newTab?: boolean;
266
+ } | DownloadActionTarget | {
267
+ type: "quickAction";
268
+ /**
269
+ * Key of the quick action to run: `category:id`, or the bare id when no
270
+ * other category uses it. The action is left out for users the quick
271
+ * action is not served to.
272
+ */
273
+ id: string;
274
+ } | {
275
+ type: "api";
276
+ url: string;
277
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
278
+ /**
279
+ * JSON body sent with the request. The values of the action's confirm
280
+ * `fields` are merged into it, the input winning.
281
+ */
282
+ body?: Record<string, unknown>;
283
+ /**
284
+ * Field of the JSON response copied to the clipboard on success (a
285
+ * share link, a token).
286
+ */
287
+ copy?: string;
288
+ successMessage: string;
289
+ } | {
290
+ type: "exportJob";
291
+ url: string;
292
+ method?: "GET" | "POST";
293
+ statusUrl?: string;
294
+ downloadUrl?: string;
295
+ labels?: {
296
+ title?: string;
297
+ exporting?: string;
298
+ downloading?: string;
299
+ successTitle?: string;
300
+ successMessage?: string;
301
+ errorTitle?: string;
302
+ retry?: string;
303
+ };
304
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=action-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-target.js","sourceRoot":"","sources":["../../src/component-options/action-target.ts"],"names":[],"mappings":""}
@@ -0,0 +1,93 @@
1
+ import type { ButtonPermission, ComponentFilterContext } from "../component";
2
+ import type { MaybePromise } from "../types";
3
+ import type { Tone } from "../tones";
4
+ import type { ActionTarget, ActionTargetSerialized } from "./action-target";
5
+ import type { ActionConfirm, ActionConfirmSerialized } from "./confirm-dialog";
6
+ export declare enum ButtonVariant {
7
+ solid = "solid",
8
+ outline = "outline",
9
+ soft = "soft",
10
+ ghost = "ghost",
11
+ link = "link"
12
+ }
13
+ /** The `color` of a button or an action: one of the semantic tones. */
14
+ export type ButtonColor = Tone;
15
+ /** Where a table's button is drawn: its toolbar, or its page's header. */
16
+ export type ButtonPlacement = "toolbar" | "header";
17
+ /** Why a button cannot be pressed right now. */
18
+ export interface CustomButtonUnavailability {
19
+ /**
20
+ * Shown next to the disabled button: what blocks it, and how to lift the
21
+ * block when the user can. A `$`-prefixed value resolves as an i18n key.
22
+ */
23
+ reason: string;
24
+ }
25
+ /**
26
+ * The button is left out of what a request is served, as if its permission
27
+ * were missing: for a button that makes no sense in the current scope (an
28
+ * "Add key" on a read-only workspace), where a disabled one would only be
29
+ * noise.
30
+ */
31
+ export interface CustomButtonHidden {
32
+ hidden: true;
33
+ }
34
+ /**
35
+ * Decides, per request, whether a button can be pressed. Runs server-side
36
+ * while the page layout is filtered, so the button reaches the client already
37
+ * disabled, or not at all. Returning `undefined` leaves it enabled, `{ reason
38
+ * }` disables it with that reason, and `{ hidden: true }` leaves it out.
39
+ *
40
+ * In a page header, `context.query` holds the query of the page URL and
41
+ * `context.params` its route parameters (`:id`), and the header asks again
42
+ * whenever that query changes: a button can depend on the record `?id=` or
43
+ * `/:id` names, and hide itself when that record does not exist. A table's
44
+ * toolbar button gets neither.
45
+ *
46
+ * It only shapes the UI: whatever the button triggers must still refuse the
47
+ * operation on its own.
48
+ */
49
+ export type CustomButtonAvailability = (context: ComponentFilterContext) => MaybePromise<CustomButtonUnavailability | CustomButtonHidden | undefined>;
50
+ export interface CustomButton {
51
+ /**
52
+ * Names the button so a quick action can press it (`type: "button"`); the
53
+ * action then inherits the button's `permission`. Unique within its table.
54
+ */
55
+ id?: string;
56
+ label: string;
57
+ icon?: string;
58
+ variant?: ButtonVariant;
59
+ color?: ButtonColor;
60
+ target: ActionTarget;
61
+ /** Asked before the button's target runs: a fixed dialog, or `{ from }`. */
62
+ confirm?: ActionConfirm;
63
+ /**
64
+ * Gate the button behind a permission: one of the owning table's actions by
65
+ * name (e.g. `"add"`) — in a page header (`DefaultLayout({ headerActions
66
+ * })`), an action of the page, relative to its permission id — or an
67
+ * `Action` of any component (e.g. another table's `add`). The button is
68
+ * stripped from the served options when the caller lacks the permission.
69
+ */
70
+ permission?: ButtonPermission;
71
+ /** Absolute permission id the button requires; wins over `permission`. */
72
+ permissionId?: string;
73
+ /**
74
+ * Disables the button for a request it answers with a reason, or leaves it
75
+ * out for one it answers `{ hidden: true }`. A button the caller lacks the
76
+ * permission for is stripped before this runs.
77
+ */
78
+ availability?: CustomButtonAvailability;
79
+ /**
80
+ * Where the button is drawn: in the table's toolbar (the default), or in
81
+ * the header of the page carrying the table, which the server adds it to —
82
+ * the table still runs it. Either way a quick action can press it by `id`.
83
+ */
84
+ placement?: ButtonPlacement;
85
+ }
86
+ export interface CustomButtonSerialized extends Omit<CustomButton, "target" | "permission" | "permissionId" | "availability" | "confirm"> {
87
+ target: ActionTargetSerialized;
88
+ confirm?: ActionConfirmSerialized;
89
+ /** Set when the button's `availability` refused this request. */
90
+ disabled?: boolean;
91
+ /** The reason `availability` gave, shown next to the disabled button. */
92
+ disabledReason?: string;
93
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonVariant = void 0;
4
+ var ButtonVariant;
5
+ (function (ButtonVariant) {
6
+ ButtonVariant["solid"] = "solid";
7
+ ButtonVariant["outline"] = "outline";
8
+ ButtonVariant["soft"] = "soft";
9
+ ButtonVariant["ghost"] = "ghost";
10
+ ButtonVariant["link"] = "link";
11
+ })(ButtonVariant || (exports.ButtonVariant = ButtonVariant = {}));
12
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/component-options/button.ts"],"names":[],"mappings":";;;AAMA,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,8BAAa,CAAA;AACf,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB"}
@@ -0,0 +1,132 @@
1
+ import type { Component, ComponentInfoSerialized } from "../component";
2
+ import type { ActionTarget } from "./action-target";
3
+ import type { ButtonColor } from "./button";
4
+ import type { FormField, FormFieldSerialized } from "./form-field";
5
+ /** One dependent a confirmed action affects, listed in its dialog. */
6
+ export interface ConfirmDialogImpact {
7
+ icon: string;
8
+ /** `$`-prefixed: an i18n key, receiving the dialog's `params`. */
9
+ label: string;
10
+ count?: number | string;
11
+ }
12
+ /**
13
+ * A file a dialog's secondary action downloads, the dialog staying open. The
14
+ * URL is fetched with the user's session, like an `api` target: a path is
15
+ * read from the DMS API, an absolute URL as it is.
16
+ */
17
+ export interface ConfirmDialogDownloadTarget {
18
+ type: "download";
19
+ /**
20
+ * Takes the page URL tokens (`{{params.X}}`, `{{query.X}}`), then the
21
+ * dialog's parameters and the row's fields (`{{row.field}}`).
22
+ */
23
+ url: string;
24
+ /**
25
+ * Name the file is saved under, with the same tokens as `url`, written as
26
+ * they are. Defaults to the name the response's
27
+ * `Content-Disposition` gives, else the URL's last path segment.
28
+ */
29
+ filename?: string;
30
+ }
31
+ /**
32
+ * Where a dialog's secondary action leads: a link (`external`, as on an
33
+ * action), or a file to download.
34
+ */
35
+ export type ConfirmDialogSecondaryTarget = Extract<ActionTarget, {
36
+ type: "external";
37
+ }> | ConfirmDialogDownloadTarget;
38
+ /**
39
+ * A button drawn next to cancel and confirm that neither answers the
40
+ * dialog: it runs its target and leaves the dialog open ("Download a backup"
41
+ * before removing).
42
+ */
43
+ export interface ConfirmDialogSecondaryAction {
44
+ /** Text of the button, interpolated like the dialog's other texts. */
45
+ label: string;
46
+ icon?: string;
47
+ /**
48
+ * Its URL is filled in with the dialog's `params` and, on a row action,
49
+ * the row's fields (`{name}`).
50
+ */
51
+ target: ConfirmDialogSecondaryTarget;
52
+ }
53
+ /**
54
+ * The dialog an action asks in before it runs, the same for every action:
55
+ * built-in (delete, archive, edit…) and custom, whatever its target. Texts
56
+ * are i18n keys (with `$`) or literals, both interpolated with `params` —
57
+ * and, on a row action, with the row's fields ("Remove {name}?").
58
+ */
59
+ export interface ConfirmDialog {
60
+ title: string;
61
+ description?: string;
62
+ /** Values the texts are interpolated with, besides the row's fields. */
63
+ params?: Record<string, unknown>;
64
+ /** Header icon. */
65
+ icon?: string;
66
+ /** Color of the confirm button and the header icon well. */
67
+ color?: ButtonColor;
68
+ /** Text of the confirm button. */
69
+ confirmLabel?: string;
70
+ /** Text of the cancel button. */
71
+ cancelLabel?: string;
72
+ /** What the action takes with it, listed above the buttons. */
73
+ impact?: ConfirmDialogImpact[];
74
+ /**
75
+ * A button next to cancel and confirm, leaving the dialog open: a link,
76
+ * or a file to download first.
77
+ */
78
+ secondaryAction?: ConfirmDialogSecondaryAction;
79
+ /**
80
+ * The action cannot run (the last owner, a locked row): the dialog only
81
+ * explains why, with a close button.
82
+ */
83
+ blocked?: boolean;
84
+ /**
85
+ * Text the user must type to confirm (type-to-confirm). A `$`-prefixed i18n
86
+ * key is translated, and `{field}` reads the row like the other texts
87
+ * (`"{name}"`: the row's name).
88
+ */
89
+ confirmText?: string;
90
+ /**
91
+ * Compares the typed text with `confirmText` ignoring case (`acme` matches
92
+ * `ACME`): for a name the user reads but would not care to retype exactly.
93
+ */
94
+ confirmTextCaseInsensitive?: boolean;
95
+ /**
96
+ * Fields the user fills in before confirming. Their values are sent with
97
+ * the action's request — merged into an `api` target's `body`, the input
98
+ * winning — and a field error the server answers shows under its field.
99
+ */
100
+ fields?: FormField[];
101
+ /**
102
+ * Escape hatch: a frontend component drawn in the dialog's body, resolved
103
+ * by name from the global registry.
104
+ */
105
+ component?: Component;
106
+ }
107
+ /**
108
+ * A confirmation the server words for the row an action targets: a URL
109
+ * answering a {@link ConfirmDialogSerialized}. On a row action, built-in or
110
+ * custom, `{{row.id}}` is filled in with the row's id (read through the
111
+ * table's `rowIdKey`) and `{{row.<field>}}` with any of the row's fields;
112
+ * a bulk custom action appends its selection to the query instead.
113
+ * The page URL's `{{params.X}}` / `{{query.X}}` are filled first, as in an
114
+ * action's target URL.
115
+ */
116
+ export interface ConfirmDialogFrom {
117
+ from: string;
118
+ }
119
+ /** The confirmation of an action: a fixed dialog, or one the server words. */
120
+ export type ActionConfirm = ConfirmDialog | ConfirmDialogFrom;
121
+ /** A confirmation dialog as it reaches the client. */
122
+ export interface ConfirmDialogSerialized extends Omit<ConfirmDialog, "fields" | "component"> {
123
+ fields?: FormFieldSerialized[];
124
+ component?: ComponentInfoSerialized;
125
+ }
126
+ /** The confirmation of an action as it reaches the client. */
127
+ export type ActionConfirmSerialized = ConfirmDialogSerialized | ConfirmDialogFrom;
128
+ /**
129
+ * A confirmation dialog as the client reads it: its fields and component
130
+ * serialized. A route answering a `confirm: { from }` request returns this.
131
+ */
132
+ export declare function serializeConfirmDialog(dialog: ConfirmDialog): ConfirmDialogSerialized;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeConfirmDialog = serializeConfirmDialog;
4
+ const form_field_1 = require("./internal/form-field");
5
+ /**
6
+ * A confirmation dialog as the client reads it: its fields and component
7
+ * serialized. A route answering a `confirm: { from }` request returns this.
8
+ */
9
+ function serializeConfirmDialog(dialog) {
10
+ const { fields, component, ...texts } = dialog;
11
+ const serialized = texts;
12
+ if (fields)
13
+ serialized.fields = fields.map(form_field_1.serializeFormField);
14
+ if (component)
15
+ serialized.component = component.serializeSync();
16
+ return serialized;
17
+ }
18
+ //# sourceMappingURL=confirm-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-dialog.js","sourceRoot":"","sources":["../../src/component-options/confirm-dialog.ts"],"names":[],"mappings":";;AAoJA,wDAQC;AA3JD,sDAA2D;AA+I3D;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,MAAqB;IAErB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IAC/C,MAAM,UAAU,GAA4B,KAAK,CAAC;IAClD,IAAI,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,+BAAkB,CAAC,CAAC;IAC/D,IAAI,SAAS;QAAE,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;IAChE,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type { RequestContext } from "@antelopejs/interface-api";
2
+ import { type Class, type ClassDecorator } from "@antelopejs/interface-core/decorators";
3
+ import type { ValueProxy, ValueProxyOrValue } from "@antelopejs/interface-database";
4
+ import type { ComponentInfoSerialized } from "../component";
5
+ import type { z } from "zod";
6
+ export type FilterComponent = ComponentInfoSerialized | "noInput";
7
+ export interface DataCompareMode {
8
+ filter(context: RequestContext, proxy: ValueProxy<unknown>, key: string, value: unknown, row: ValueProxy<Record<string, unknown>>): ValueProxyOrValue<boolean>;
9
+ }
10
+ export declare abstract class DataType {
11
+ readonly compareModes: Class<DataCompareMode>[];
12
+ readonly defaultCompareMode?: Class<DataCompareMode> | undefined;
13
+ readonly options?: Record<string, unknown> | undefined;
14
+ constructor(compareModes?: Class<DataCompareMode>[], defaultCompareMode?: Class<DataCompareMode> | undefined, options?: Record<string, unknown> | undefined);
15
+ filter(context: RequestContext, proxy: ValueProxy<unknown>, key: string, value: string, mode: string, row: ValueProxy<Record<string, unknown>>): ValueProxyOrValue<boolean>;
16
+ /**
17
+ * Returns the default input component for this data type.
18
+ * Override this method in subclasses to provide a custom input component.
19
+ *
20
+ * @returns The default input component for this data type
21
+ */
22
+ protected abstract defaultInputComponent(): ComponentInfoSerialized;
23
+ /**
24
+ * Returns filters components for this data type.
25
+ * This component is used in filters for filtering values of this data type.
26
+ * Must include a 'default' component, and can optionally include
27
+ * mode-specific components for different compare modes.
28
+ * Override this method in subclasses for custom filter components per mode.
29
+ *
30
+ * @returns A record of filter components with at least a 'default' key
31
+ */
32
+ filterComponents(): Record<string, ComponentInfoSerialized> & {
33
+ default: ComponentInfoSerialized;
34
+ };
35
+ /**
36
+ * Returns the form input component for this data type.
37
+ * This component is used in forms for editing values of this data type.
38
+ *
39
+ * @returns The input component for this data type
40
+ */
41
+ inputComponent(): ComponentInfoSerialized;
42
+ /**
43
+ * The input component a value of this type is described with where
44
+ * nothing is entered through it: a table column's type, whose cells, cards
45
+ * and quick filters read its options, and a read-only form field. Defaults
46
+ * to {@link inputComponent}; a type whose input carries what only an
47
+ * editable control uses (a relation's inline "add" form) leaves it out, so
48
+ * a page does not ship it once per column.
49
+ *
50
+ * @returns The input component, without what only editing uses
51
+ */
52
+ describedInputComponent(): ComponentInfoSerialized;
53
+ /**
54
+ * Returns a Zod schema for validating values of this data type.
55
+ * This schema is used in the edit or new process in data-api to validate values
56
+ * before saving to the database.
57
+ *
58
+ * @returns A Zod schema for this data type
59
+ */
60
+ abstract getValidation(): z.ZodType;
61
+ /**
62
+ * Called to add additional decorators on the field using this data type.
63
+ *
64
+ * @param target Class prototype
65
+ * @param key Property name
66
+ * @param descriptor Property descriptor
67
+ */
68
+ decorateField?(target: unknown, key: PropertyKey, descriptor?: PropertyDescriptor): void;
69
+ }
70
+ /**
71
+ * Register a new data type
72
+ * @param id - The id of the data type
73
+ * @returns The data type class decorator
74
+ */
75
+ export declare const RegisterDataType: (id: string) => ClassDecorator<Class<DataType>>;
76
+ /**
77
+ * Register a new data compare mode
78
+ * @param id - The id of the data compare mode
79
+ * @param noInput - Whether this compare mode requires no input (default: false)
80
+ * @returns The data compare mode class decorator
81
+ */
82
+ export declare const RegisterDataCompareMode: (id: string, noInput?: boolean) => ClassDecorator<Class<DataCompareMode>>;
83
+ /**
84
+ * Create a new data type instance
85
+ * @param id - The id of the data type
86
+ * @param options - The options for the data type
87
+ * @returns The data type instance
88
+ */
89
+ export declare function CreateDataType(id: string, options?: unknown): DataType;
90
+ /**
91
+ * Get the ID of a DataType instance
92
+ */
93
+ export declare function getDataTypeId(instance: DataType): string | undefined;
94
+ export interface DataTypeSerialized {
95
+ id: string;
96
+ compareModes: string[];
97
+ defaultCompareMode?: string;
98
+ filterComponents: Record<string, FilterComponent>;
99
+ inputComponent: ComponentInfoSerialized;
100
+ }
101
+ export declare function serializeType(instance?: DataType): DataTypeSerialized | undefined;