@webiny/app-admin 6.3.0 → 6.4.0-beta.1

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 (921) hide show
  1. package/assets/icons/add-18px.js +20 -0
  2. package/assets/icons/add-18px.js.map +1 -0
  3. package/assets/icons/arrow_drop_down-24px.js +20 -0
  4. package/assets/icons/arrow_drop_down-24px.js.map +1 -0
  5. package/assets/icons/attach_file_black_24dp.js +20 -0
  6. package/assets/icons/attach_file_black_24dp.js.map +1 -0
  7. package/assets/icons/baseline-menu-24px.js +20 -0
  8. package/assets/icons/baseline-menu-24px.js.map +1 -0
  9. package/assets/icons/baseline-notification_important-24px.js +19 -0
  10. package/assets/icons/baseline-notification_important-24px.js.map +1 -0
  11. package/assets/icons/baseline-security-24px.js +19 -0
  12. package/assets/icons/baseline-security-24px.js.map +1 -0
  13. package/assets/icons/file_download.js +19 -0
  14. package/assets/icons/file_download.js.map +1 -0
  15. package/assets/icons/file_upload.js +19 -0
  16. package/assets/icons/file_upload.js.map +1 -0
  17. package/assets/icons/filter-24px.js +23 -0
  18. package/assets/icons/filter-24px.js.map +1 -0
  19. package/assets/icons/github-brands.js +19 -0
  20. package/assets/icons/github-brands.js.map +1 -0
  21. package/assets/icons/highlight-24px.js +19 -0
  22. package/assets/icons/highlight-24px.js.map +1 -0
  23. package/assets/icons/icon-community.js +18 -0
  24. package/assets/icons/icon-community.js.map +1 -0
  25. package/assets/icons/icon-documentation.js +18 -0
  26. package/assets/icons/icon-documentation.js.map +1 -0
  27. package/assets/icons/info.js +19 -0
  28. package/assets/icons/info.js.map +1 -0
  29. package/assets/icons/insert_drive_file-24px.js +19 -0
  30. package/assets/icons/insert_drive_file-24px.js.map +1 -0
  31. package/assets/icons/insert_photo-24px.js +19 -0
  32. package/assets/icons/insert_photo-24px.js.map +1 -0
  33. package/assets/icons/label-24px.js +19 -0
  34. package/assets/icons/label-24px.js.map +1 -0
  35. package/assets/icons/round-account_circle-24px.js +19 -0
  36. package/assets/icons/round-account_circle-24px.js.map +1 -0
  37. package/assets/icons/round-add-24px.js +20 -0
  38. package/assets/icons/round-add-24px.js.map +1 -0
  39. package/assets/icons/round-arrow_drop_down-24px.js +19 -0
  40. package/assets/icons/round-arrow_drop_down-24px.js.map +1 -0
  41. package/assets/icons/round-chevron_right-24px.js +20 -0
  42. package/assets/icons/round-chevron_right-24px.js.map +1 -0
  43. package/assets/icons/round-feedback-24px.js +20 -0
  44. package/assets/icons/round-feedback-24px.js.map +1 -0
  45. package/assets/icons/round-help-24px.js +19 -0
  46. package/assets/icons/round-help-24px.js.map +1 -0
  47. package/assets/icons/round-invert_colors-24px.js +20 -0
  48. package/assets/icons/round-invert_colors-24px.js.map +1 -0
  49. package/assets/icons/round-keyboard_arrow_down-24px.js +17 -0
  50. package/assets/icons/round-keyboard_arrow_down-24px.js.map +1 -0
  51. package/assets/icons/round-keyboard_arrow_up-24px.js +17 -0
  52. package/assets/icons/round-keyboard_arrow_up-24px.js.map +1 -0
  53. package/assets/icons/round-lock_open-24px.js +22 -0
  54. package/assets/icons/round-lock_open-24px.js.map +1 -0
  55. package/assets/icons/round-more_vert-24px.js +20 -0
  56. package/assets/icons/round-more_vert-24px.js.map +1 -0
  57. package/assets/icons/round-open_in_new-24px.js +20 -0
  58. package/assets/icons/round-open_in_new-24px.js.map +1 -0
  59. package/assets/icons/round-settings-24px.js +20 -0
  60. package/assets/icons/round-settings-24px.js.map +1 -0
  61. package/assets/icons/search-24px.js +21 -0
  62. package/assets/icons/search-24px.js.map +1 -0
  63. package/assets/icons/slack-logo.js +14 -0
  64. package/assets/icons/slack-logo.js.map +1 -0
  65. package/assets/icons/today-24px.js +19 -0
  66. package/assets/icons/today-24px.js.map +1 -0
  67. package/assets/icons/touch_app.js +20 -0
  68. package/assets/icons/touch_app.js.map +1 -0
  69. package/assets/images/webiny-logo.js +34 -0
  70. package/assets/images/webiny-logo.js.map +1 -0
  71. package/assets/images/webiny-orange-logo.js +34 -0
  72. package/assets/images/webiny-orange-logo.js.map +1 -0
  73. package/base/Admin.js +37 -28
  74. package/base/Admin.js.map +1 -1
  75. package/base/Base/DefaultFieldRenderers.js +73 -70
  76. package/base/Base/DefaultFieldRenderers.js.map +1 -1
  77. package/base/Base/DefaultLayoutRenderers.js +9 -10
  78. package/base/Base/DefaultLayoutRenderers.js.map +1 -1
  79. package/base/Base/FieldRenderers/CheckboxesRenderer.js +22 -23
  80. package/base/Base/FieldRenderers/CheckboxesRenderer.js.map +1 -1
  81. package/base/Base/FieldRenderers/CodeEditorRenderer.js +10 -13
  82. package/base/Base/FieldRenderers/CodeEditorRenderer.js.map +1 -1
  83. package/base/Base/FieldRenderers/DateTimeInputsRenderer.js +60 -60
  84. package/base/Base/FieldRenderers/DateTimeInputsRenderer.js.map +1 -1
  85. package/base/Base/FieldRenderers/DateTimeRenderer.js +38 -39
  86. package/base/Base/FieldRenderers/DateTimeRenderer.js.map +1 -1
  87. package/base/Base/FieldRenderers/FilePickerRenderer.d.ts +2 -1
  88. package/base/Base/FieldRenderers/FilePickerRenderer.js +37 -40
  89. package/base/Base/FieldRenderers/FilePickerRenderer.js.map +1 -1
  90. package/base/Base/FieldRenderers/FileUrlPickerRenderer.js +15 -20
  91. package/base/Base/FieldRenderers/FileUrlPickerRenderer.js.map +1 -1
  92. package/base/Base/FieldRenderers/HiddenRenderer.js +3 -3
  93. package/base/Base/FieldRenderers/HiddenRenderer.js.map +1 -1
  94. package/base/Base/FieldRenderers/HorizontalTabsRenderer.js +20 -21
  95. package/base/Base/FieldRenderers/HorizontalTabsRenderer.js.map +1 -1
  96. package/base/Base/FieldRenderers/InputRenderer.js +16 -20
  97. package/base/Base/FieldRenderers/InputRenderer.js.map +1 -1
  98. package/base/Base/FieldRenderers/MultiFilePickerRenderer.d.ts +13 -0
  99. package/base/Base/FieldRenderers/MultiFilePickerRenderer.js +70 -0
  100. package/base/Base/FieldRenderers/MultiFilePickerRenderer.js.map +1 -0
  101. package/base/Base/FieldRenderers/NumberInputRenderer.js +16 -19
  102. package/base/Base/FieldRenderers/NumberInputRenderer.js.map +1 -1
  103. package/base/Base/FieldRenderers/NumberInputsRenderer.js +45 -44
  104. package/base/Base/FieldRenderers/NumberInputsRenderer.js.map +1 -1
  105. package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js +10 -13
  106. package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js.map +1 -1
  107. package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js +50 -56
  108. package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
  109. package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js +87 -99
  110. package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js.map +1 -1
  111. package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js +41 -48
  112. package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
  113. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +1 -2
  114. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +62 -78
  115. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
  116. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +12 -15
  117. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
  118. package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +48 -54
  119. package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
  120. package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +62 -79
  121. package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +1 -1
  122. package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +14 -17
  123. package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
  124. package/base/Base/FieldRenderers/PassthroughRenderer.js +8 -11
  125. package/base/Base/FieldRenderers/PassthroughRenderer.js.map +1 -1
  126. package/base/Base/FieldRenderers/RadioButtonsRenderer.js +21 -22
  127. package/base/Base/FieldRenderers/RadioButtonsRenderer.js.map +1 -1
  128. package/base/Base/FieldRenderers/SelectRenderer.js +23 -24
  129. package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
  130. package/base/Base/FieldRenderers/SwitchRenderer.js +12 -15
  131. package/base/Base/FieldRenderers/SwitchRenderer.js.map +1 -1
  132. package/base/Base/FieldRenderers/TagsRenderer.js +15 -16
  133. package/base/Base/FieldRenderers/TagsRenderer.js.map +1 -1
  134. package/base/Base/FieldRenderers/TextInputsRenderer.js +44 -43
  135. package/base/Base/FieldRenderers/TextInputsRenderer.js.map +1 -1
  136. package/base/Base/FieldRenderers/TextareaRenderer.js +17 -21
  137. package/base/Base/FieldRenderers/TextareaRenderer.js.map +1 -1
  138. package/base/Base/FieldRenderers/TextareasRenderer.js +47 -46
  139. package/base/Base/FieldRenderers/TextareasRenderer.js.map +1 -1
  140. package/base/Base/FieldRenderers/VerticalTabsRenderer.js +35 -36
  141. package/base/Base/FieldRenderers/VerticalTabsRenderer.js.map +1 -1
  142. package/base/Base/LexicalPreset.js +56 -60
  143. package/base/Base/LexicalPreset.js.map +1 -1
  144. package/base/Base/Menus/SupportMenuItems.js +9 -13
  145. package/base/Base/Menus/SupportMenuItems.js.map +1 -1
  146. package/base/Base/Menus/WebinyVersion.js +19 -20
  147. package/base/Base/Menus/WebinyVersion.js.map +1 -1
  148. package/base/Base/Menus.js +52 -66
  149. package/base/Base/Menus.js.map +1 -1
  150. package/base/Base/RoutesConfig.js +21 -29
  151. package/base/Base/RoutesConfig.js.map +1 -1
  152. package/base/Base/Tenant/wby-horizontal.js +33 -0
  153. package/base/Base/Tenant/wby-horizontal.js.map +1 -0
  154. package/base/Base/Tenant/wby-square.js +20 -0
  155. package/base/Base/Tenant/wby-square.js.map +1 -0
  156. package/base/Base/Tenant.js +17 -19
  157. package/base/Base/Tenant.js.map +1 -1
  158. package/base/Base/UserMenu/ExitTenant.js +18 -29
  159. package/base/Base/UserMenu/ExitTenant.js.map +1 -1
  160. package/base/Base/UserMenu/SignOut.js +13 -14
  161. package/base/Base/UserMenu/SignOut.js.map +1 -1
  162. package/base/Base/UserMenu/UserInfo.js +23 -36
  163. package/base/Base/UserMenu/UserInfo.js.map +1 -1
  164. package/base/Base/UserMenu.js +12 -13
  165. package/base/Base/UserMenu.js.map +1 -1
  166. package/base/Base.js +4 -5
  167. package/base/Base.js.map +1 -1
  168. package/base/TelemetryAdminAppStart.js +9 -12
  169. package/base/TelemetryAdminAppStart.js.map +1 -1
  170. package/base/WebinyVersion.js +19 -20
  171. package/base/WebinyVersion.js.map +1 -1
  172. package/base/createRootContainer.js +42 -40
  173. package/base/createRootContainer.js.map +1 -1
  174. package/base/plugins/AddGraphQLQuerySelection.js +12 -11
  175. package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
  176. package/base/providers/AdminUiStateProvider.js +5 -10
  177. package/base/providers/AdminUiStateProvider.js.map +1 -1
  178. package/base/providers/ApolloProvider.js +8 -11
  179. package/base/providers/ApolloProvider.js.map +1 -1
  180. package/base/providers/UiProviders.js +18 -27
  181. package/base/providers/UiProviders.js.map +1 -1
  182. package/base/providers/UiStateProvider.js +5 -10
  183. package/base/providers/UiStateProvider.js.map +1 -1
  184. package/base/ui/Brand.js +4 -5
  185. package/base/ui/Brand.js.map +1 -1
  186. package/base/ui/CenteredView.d.ts +1 -1
  187. package/base/ui/CenteredView.js +9 -13
  188. package/base/ui/CenteredView.js.map +1 -1
  189. package/base/ui/Dashboard.js +4 -5
  190. package/base/ui/Dashboard.js.map +1 -1
  191. package/base/ui/FileManager.js +38 -60
  192. package/base/ui/FileManager.js.map +1 -1
  193. package/base/ui/Layout.js +4 -8
  194. package/base/ui/Layout.js.map +1 -1
  195. package/base/ui/LoginScreen.js +16 -21
  196. package/base/ui/LoginScreen.js.map +1 -1
  197. package/base/ui/Logo.js +4 -5
  198. package/base/ui/Logo.js.map +1 -1
  199. package/base/ui/Navigation.js +11 -14
  200. package/base/ui/Navigation.js.map +1 -1
  201. package/base/ui/NotFound.js +4 -5
  202. package/base/ui/NotFound.js.map +1 -1
  203. package/base/ui/Tags.js +12 -16
  204. package/base/ui/Tags.js.map +1 -1
  205. package/base/ui/TenantSelector.js +4 -5
  206. package/base/ui/TenantSelector.js.map +1 -1
  207. package/base/ui/UserMenu/UserMenu.js +4 -5
  208. package/base/ui/UserMenu/UserMenu.js.map +1 -1
  209. package/base/ui/UserMenu/UserMenuHandle.js +4 -5
  210. package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
  211. package/base/ui/UserMenu/UserMenuItem.d.ts +4 -4
  212. package/base/ui/UserMenu/UserMenuItem.js +5 -15
  213. package/base/ui/UserMenu/UserMenuItem.js.map +1 -1
  214. package/base/ui/UserMenu/UserMenuLink.d.ts +4 -4
  215. package/base/ui/UserMenu/UserMenuLink.js +5 -15
  216. package/base/ui/UserMenu/UserMenuLink.js.map +1 -1
  217. package/base/ui/UserMenu/UserMenuSeparator.d.ts +2 -2
  218. package/base/ui/UserMenu/UserMenuSeparator.js +3 -5
  219. package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -1
  220. package/base/ui/UserMenu.js +6 -13
  221. package/base/ui/UserMenu.js.map +1 -1
  222. package/components/AdminLayout.js +6 -10
  223. package/components/AdminLayout.js.map +1 -1
  224. package/components/BulkActions/Worker.js +57 -120
  225. package/components/BulkActions/Worker.js.map +1 -1
  226. package/components/BulkActions/index.js +0 -2
  227. package/components/BulkActions/useDialogWithReport/DialogMessage.js +17 -21
  228. package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
  229. package/components/BulkActions/useDialogWithReport/index.js +0 -2
  230. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +33 -44
  231. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
  232. package/components/Buttons/Buttons.js +44 -71
  233. package/components/Buttons/Buttons.js.map +1 -1
  234. package/components/Buttons/Buttons.styles.js +9 -15
  235. package/components/Buttons/Buttons.styles.js.map +1 -1
  236. package/components/Buttons/index.js +1 -3
  237. package/components/Buttons/useButtons.js +15 -20
  238. package/components/Buttons/useButtons.js.map +1 -1
  239. package/components/DeveloperMode/DeveloperMode.js +5 -14
  240. package/components/DeveloperMode/DeveloperMode.js.map +1 -1
  241. package/components/DeveloperMode/index.js +0 -2
  242. package/components/Dialogs/Dialog.d.ts +2 -2
  243. package/components/Dialogs/Dialog.js +46 -59
  244. package/components/Dialogs/Dialog.js.map +1 -1
  245. package/components/Dialogs/DialogParamsContext.js +6 -7
  246. package/components/Dialogs/DialogParamsContext.js.map +1 -1
  247. package/components/Dialogs/DialogsContext.d.ts +2 -2
  248. package/components/Dialogs/DialogsContext.js +129 -149
  249. package/components/Dialogs/DialogsContext.js.map +1 -1
  250. package/components/Dialogs/useDialogs.js +5 -6
  251. package/components/Dialogs/useDialogs.js.map +1 -1
  252. package/components/EmptyView.js +26 -31
  253. package/components/EmptyView.js.map +1 -1
  254. package/components/Filters/Filters.js +15 -16
  255. package/components/Filters/Filters.js.map +1 -1
  256. package/components/Filters/FiltersToggle.js +18 -23
  257. package/components/Filters/FiltersToggle.js.map +1 -1
  258. package/components/Filters/index.js +0 -2
  259. package/components/FloatingActionButton.js +13 -15
  260. package/components/FloatingActionButton.js.map +1 -1
  261. package/components/IconPicker/IconPicker.js +24 -26
  262. package/components/IconPicker/IconPicker.js.map +1 -1
  263. package/components/IconPicker/IconPickerComponent.js +56 -72
  264. package/components/IconPicker/IconPickerComponent.js.map +1 -1
  265. package/components/IconPicker/IconPickerPresenter.js +64 -70
  266. package/components/IconPicker/IconPickerPresenter.js.map +1 -1
  267. package/components/IconPicker/IconPickerPresenter.test.js +79 -105
  268. package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
  269. package/components/IconPicker/IconPickerPresenterProvider.js +10 -16
  270. package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
  271. package/components/IconPicker/IconPickerTab.js +97 -140
  272. package/components/IconPicker/IconPickerTab.js.map +1 -1
  273. package/components/IconPicker/IconRenderer.js +15 -23
  274. package/components/IconPicker/IconRenderer.js.map +1 -1
  275. package/components/IconPicker/IconRepository.js +41 -40
  276. package/components/IconPicker/IconRepository.js.map +1 -1
  277. package/components/IconPicker/IconRepository.test.js +56 -63
  278. package/components/IconPicker/IconRepository.test.js.map +1 -1
  279. package/components/IconPicker/IconRepositoryFactory.js +15 -11
  280. package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
  281. package/components/IconPicker/Loading.js +47 -46
  282. package/components/IconPicker/Loading.js.map +1 -1
  283. package/components/IconPicker/components/IconPickerCell.js +18 -20
  284. package/components/IconPicker/components/IconPickerCell.js.map +1 -1
  285. package/components/IconPicker/components/IconPickerContent.js +27 -35
  286. package/components/IconPicker/components/IconPickerContent.js.map +1 -1
  287. package/components/IconPicker/components/IconPickerRow.js +5 -10
  288. package/components/IconPicker/components/IconPickerRow.js.map +1 -1
  289. package/components/IconPicker/components/IconPickerTrigger.js +42 -44
  290. package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
  291. package/components/IconPicker/components/index.js +0 -2
  292. package/components/IconPicker/config/Emojis.js +19 -21
  293. package/components/IconPicker/config/Emojis.js.map +1 -1
  294. package/components/IconPicker/config/FontAwesomeIcons.js +54 -58
  295. package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
  296. package/components/IconPicker/config/IconPackProvider.js +17 -19
  297. package/components/IconPicker/config/IconPackProvider.js.map +1 -1
  298. package/components/IconPicker/config/IconType.js +48 -80
  299. package/components/IconPicker/config/IconType.js.map +1 -1
  300. package/components/IconPicker/config/index.js +28 -31
  301. package/components/IconPicker/config/index.js.map +1 -1
  302. package/components/IconPicker/defaultIcon.js +6 -5
  303. package/components/IconPicker/defaultIcon.js.map +1 -1
  304. package/components/IconPicker/index.js +0 -2
  305. package/components/IconPicker/plugins/customPlugin.js +87 -110
  306. package/components/IconPicker/plugins/customPlugin.js.map +1 -1
  307. package/components/IconPicker/plugins/emojisPlugin.js +90 -115
  308. package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
  309. package/components/IconPicker/plugins/graphql.js +3 -8
  310. package/components/IconPicker/plugins/graphql.js.map +1 -1
  311. package/components/IconPicker/plugins/iconsPlugin.js +73 -104
  312. package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
  313. package/components/IconPicker/types.js +4 -7
  314. package/components/IconPicker/types.js.map +1 -1
  315. package/components/LexicalEditor/LexicalEditor.js +40 -38
  316. package/components/LexicalEditor/LexicalEditor.js.map +1 -1
  317. package/components/LexicalEditor/LexicalLinkForm.js +80 -86
  318. package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
  319. package/components/LexicalEditor/index.js +0 -2
  320. package/components/LexicalEditor/lexicalValueFromHtml.js +21 -28
  321. package/components/LexicalEditor/lexicalValueFromHtml.js.map +1 -1
  322. package/components/LexicalEditor/lexicalValueWithHtml.js +24 -30
  323. package/components/LexicalEditor/lexicalValueWithHtml.js.map +1 -1
  324. package/components/MultiImageUpload.js +4 -13
  325. package/components/MultiImageUpload.js.map +1 -1
  326. package/components/NotAuthorizedError/NotAuthorizedError.js +16 -17
  327. package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
  328. package/components/NotAuthorizedError/SecureRouteError.js +297 -0
  329. package/components/NotAuthorizedError/SecureRouteError.js.map +1 -0
  330. package/components/NotAuthorizedError/index.js +0 -2
  331. package/components/OptionsMenu/OptionsMenu.js +20 -19
  332. package/components/OptionsMenu/OptionsMenu.js.map +1 -1
  333. package/components/OptionsMenu/OptionsMenuItem.js +15 -14
  334. package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
  335. package/components/OptionsMenu/OptionsMenuLink.js +13 -14
  336. package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
  337. package/components/OptionsMenu/index.js +0 -2
  338. package/components/OptionsMenu/useOptionsMenuItem.js +13 -18
  339. package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
  340. package/components/OverlayLayout/OverlayLayout.js +35 -38
  341. package/components/OverlayLayout/OverlayLayout.js.map +1 -1
  342. package/components/OverlayLayout/components/OverlayBackdrop.js +6 -11
  343. package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -1
  344. package/components/OverlayLayout/components/OverlayContent.js +18 -17
  345. package/components/OverlayLayout/components/OverlayContent.js.map +1 -1
  346. package/components/OverlayLayout/components/OverlayHeader.js +30 -37
  347. package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
  348. package/components/OverlayLayout/components/OverlayRoot.js +13 -17
  349. package/components/OverlayLayout/components/OverlayRoot.js.map +1 -1
  350. package/components/OverlayLayout/components/index.js +0 -2
  351. package/components/OverlayLayout/index.js +0 -2
  352. package/components/Permissions/CannotUseAaclAlert.js +10 -11
  353. package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
  354. package/components/Permissions/Permissions.js +32 -41
  355. package/components/Permissions/Permissions.js.map +1 -1
  356. package/components/Permissions/PermissionsGroup.js +9 -15
  357. package/components/Permissions/PermissionsGroup.js.map +1 -1
  358. package/components/Permissions/StyledComponents.js +9 -16
  359. package/components/Permissions/StyledComponents.js.map +1 -1
  360. package/components/Permissions/index.js +1 -3
  361. package/components/RegisterFeature.js +14 -21
  362. package/components/RegisterFeature.js.map +1 -1
  363. package/components/ResizablePanels/index.js +0 -2
  364. package/components/RoleAutocomplete/graphql.js +3 -2
  365. package/components/RoleAutocomplete/graphql.js.map +1 -1
  366. package/components/RoleAutocomplete/index.d.ts +5 -3
  367. package/components/RoleAutocomplete/index.js +21 -13
  368. package/components/RoleAutocomplete/index.js.map +1 -1
  369. package/components/RolesMultiAutocomplete/graphql.js +3 -2
  370. package/components/RolesMultiAutocomplete/graphql.js.map +1 -1
  371. package/components/RolesMultiAutocomplete/index.d.ts +5 -3
  372. package/components/RolesMultiAutocomplete/index.js +21 -14
  373. package/components/RolesMultiAutocomplete/index.js.map +1 -1
  374. package/components/SearchUI.js +18 -25
  375. package/components/SearchUI.js.map +1 -1
  376. package/components/SimpleForm/SimpleForm.d.ts +1 -1
  377. package/components/SimpleForm/SimpleForm.js +54 -73
  378. package/components/SimpleForm/SimpleForm.js.map +1 -1
  379. package/components/SimpleForm/index.js +1 -3
  380. package/components/SimpleUI/InputField.js +71 -64
  381. package/components/SimpleUI/InputField.js.map +1 -1
  382. package/components/SingleImageUpload.d.ts +2 -2
  383. package/components/SingleImageUpload.js +37 -58
  384. package/components/SingleImageUpload.js.map +1 -1
  385. package/components/SplitView/SplitView.js +47 -57
  386. package/components/SplitView/SplitView.js.map +1 -1
  387. package/components/SplitView/index.js +1 -3
  388. package/components/TeamAutocomplete/graphql.js +3 -2
  389. package/components/TeamAutocomplete/graphql.js.map +1 -1
  390. package/components/TeamAutocomplete/index.d.ts +5 -3
  391. package/components/TeamAutocomplete/index.js +21 -13
  392. package/components/TeamAutocomplete/index.js.map +1 -1
  393. package/components/TeamsMultiAutocomplete/graphql.js +3 -2
  394. package/components/TeamsMultiAutocomplete/graphql.js.map +1 -1
  395. package/components/TeamsMultiAutocomplete/index.d.ts +5 -3
  396. package/components/TeamsMultiAutocomplete/index.js +21 -14
  397. package/components/TeamsMultiAutocomplete/index.js.map +1 -1
  398. package/components/Wcp.js +27 -38
  399. package/components/Wcp.js.map +1 -1
  400. package/components/index.js +10 -13
  401. package/config/AdminConfig/Dashboard.js +3 -2
  402. package/config/AdminConfig/Dashboard.js.map +1 -1
  403. package/config/AdminConfig/Dialog.js +15 -17
  404. package/config/AdminConfig/Dialog.js.map +1 -1
  405. package/config/AdminConfig/FieldRenderer.js +15 -17
  406. package/config/AdminConfig/FieldRenderer.js.map +1 -1
  407. package/config/AdminConfig/Form.js +4 -3
  408. package/config/AdminConfig/Form.js.map +1 -1
  409. package/config/AdminConfig/LayoutRenderer.js +15 -17
  410. package/config/AdminConfig/LayoutRenderer.js.map +1 -1
  411. package/config/AdminConfig/LexicalTheme/Color.js +34 -41
  412. package/config/AdminConfig/LexicalTheme/Color.js.map +1 -1
  413. package/config/AdminConfig/LexicalTheme/Typography.js +61 -74
  414. package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
  415. package/config/AdminConfig/LexicalTheme.js +4 -3
  416. package/config/AdminConfig/LexicalTheme.js.map +1 -1
  417. package/config/AdminConfig/Logo.d.ts +1 -1
  418. package/config/AdminConfig/Logo.js +15 -17
  419. package/config/AdminConfig/Logo.js.map +1 -1
  420. package/config/AdminConfig/Menu/MenuGroup.d.ts +3 -3
  421. package/config/AdminConfig/Menu/MenuGroup.js +7 -9
  422. package/config/AdminConfig/Menu/MenuGroup.js.map +1 -1
  423. package/config/AdminConfig/Menu/MenuItem.d.ts +2 -2
  424. package/config/AdminConfig/Menu/MenuItem.js +5 -7
  425. package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
  426. package/config/AdminConfig/Menu/MenuLink.d.ts +2 -2
  427. package/config/AdminConfig/Menu/MenuLink.js +12 -15
  428. package/config/AdminConfig/Menu/MenuLink.js.map +1 -1
  429. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +2 -2
  430. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +6 -8
  431. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -1
  432. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +1 -1
  433. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +4 -6
  434. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -1
  435. package/config/AdminConfig/Menu/SupportMenu.d.ts +3 -3
  436. package/config/AdminConfig/Menu/SupportMenu.js +30 -41
  437. package/config/AdminConfig/Menu/SupportMenu.js.map +1 -1
  438. package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +4 -4
  439. package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -1
  440. package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +4 -4
  441. package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -1
  442. package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +0 -2
  443. package/config/AdminConfig/Menu/UserMenu/types.js +0 -3
  444. package/config/AdminConfig/Menu/UserMenu.d.ts +31 -31
  445. package/config/AdminConfig/Menu/UserMenu.js +39 -52
  446. package/config/AdminConfig/Menu/UserMenu.js.map +1 -1
  447. package/config/AdminConfig/Menu/types.js +0 -3
  448. package/config/AdminConfig/Menu.d.ts +42 -42
  449. package/config/AdminConfig/Menu.js +57 -73
  450. package/config/AdminConfig/Menu.js.map +1 -1
  451. package/config/AdminConfig/Route.js +4 -5
  452. package/config/AdminConfig/Route.js.map +1 -1
  453. package/config/AdminConfig/Security.js +3 -2
  454. package/config/AdminConfig/Security.js.map +1 -1
  455. package/config/AdminConfig/SecurityPermissions.js +20 -27
  456. package/config/AdminConfig/SecurityPermissions.js.map +1 -1
  457. package/config/AdminConfig/Tenant/TenantLogo.d.ts +1 -1
  458. package/config/AdminConfig/Tenant/TenantLogo.js +18 -20
  459. package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -1
  460. package/config/AdminConfig/Tenant/TenantName.d.ts +1 -1
  461. package/config/AdminConfig/Tenant/TenantName.js +14 -15
  462. package/config/AdminConfig/Tenant/TenantName.js.map +1 -1
  463. package/config/AdminConfig/Tenant.js +6 -9
  464. package/config/AdminConfig/Tenant.js.map +1 -1
  465. package/config/AdminConfig/Theme/assignColor.js +51 -18
  466. package/config/AdminConfig/Theme/assignColor.js.map +1 -1
  467. package/config/AdminConfig/Theme/consts.js +20 -2
  468. package/config/AdminConfig/Theme/consts.js.map +1 -1
  469. package/config/AdminConfig/Theme/types.js +0 -3
  470. package/config/AdminConfig/Theme.js +8 -15
  471. package/config/AdminConfig/Theme.js.map +1 -1
  472. package/config/AdminConfig/Title.d.ts +1 -1
  473. package/config/AdminConfig/Title.js +11 -12
  474. package/config/AdminConfig/Title.js.map +1 -1
  475. package/config/AdminConfig/Widget.js +24 -31
  476. package/config/AdminConfig/Widget.js.map +1 -1
  477. package/config/AdminConfig.js +47 -59
  478. package/config/AdminConfig.js.map +1 -1
  479. package/config/createAdminConfig.js +55 -86
  480. package/config/createAdminConfig.js.map +1 -1
  481. package/domain/Identity.js +78 -88
  482. package/domain/Identity.js.map +1 -1
  483. package/errors/ErrorOverlayNetworkErrorHandler.js +37 -52
  484. package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -1
  485. package/errors/TenantIsDisabled.js +19 -20
  486. package/errors/TenantIsDisabled.js.map +1 -1
  487. package/exports/admin/build-params.js +0 -5
  488. package/exports/admin/configs.js +0 -2
  489. package/exports/admin/form.js +3 -18
  490. package/exports/admin/security.js +1 -7
  491. package/exports/admin/tenancy.js +0 -2
  492. package/exports/admin/ui.js +1 -4
  493. package/exports/admin.js +1 -4
  494. package/features/apolloClient/abstraction.js +2 -1
  495. package/features/apolloClient/abstraction.js.map +1 -1
  496. package/features/apolloClient/feature.js +22 -30
  497. package/features/apolloClient/feature.js.map +1 -1
  498. package/features/buildParams/BuildParams.js +20 -14
  499. package/features/buildParams/BuildParams.js.map +1 -1
  500. package/features/buildParams/abstractions.js +3 -2
  501. package/features/buildParams/abstractions.js.map +1 -1
  502. package/features/buildParams/feature.js +11 -10
  503. package/features/buildParams/feature.js.map +1 -1
  504. package/features/buildParams/index.js +0 -2
  505. package/features/formModel/ConditionRuleEvaluator.js +39 -46
  506. package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
  507. package/features/formModel/Field.d.ts +1 -0
  508. package/features/formModel/Field.js +334 -411
  509. package/features/formModel/Field.js.map +1 -1
  510. package/features/formModel/FieldBuilder.d.ts +2 -1
  511. package/features/formModel/FieldBuilder.js +148 -171
  512. package/features/formModel/FieldBuilder.js.map +1 -1
  513. package/features/formModel/FieldBuilder.test.js +217 -201
  514. package/features/formModel/FieldBuilder.test.js.map +1 -1
  515. package/features/formModel/FieldBuilderRegistry.js +23 -25
  516. package/features/formModel/FieldBuilderRegistry.js.map +1 -1
  517. package/features/formModel/FocusManager.js +69 -95
  518. package/features/formModel/FocusManager.js.map +1 -1
  519. package/features/formModel/FormErrors.d.ts +9 -0
  520. package/features/formModel/FormErrors.js +35 -0
  521. package/features/formModel/FormErrors.js.map +1 -0
  522. package/features/formModel/FormModel.d.ts +2 -0
  523. package/features/formModel/FormModel.js +391 -396
  524. package/features/formModel/FormModel.js.map +1 -1
  525. package/features/formModel/FormModel.test.js +3791 -3354
  526. package/features/formModel/FormModel.test.js.map +1 -1
  527. package/features/formModel/FormModelFactory.js +27 -17
  528. package/features/formModel/FormModelFactory.js.map +1 -1
  529. package/features/formModel/FormView.d.ts +2 -1
  530. package/features/formModel/FormView.js +168 -156
  531. package/features/formModel/FormView.js.map +1 -1
  532. package/features/formModel/LayoutBuilderFactory.js +300 -370
  533. package/features/formModel/LayoutBuilderFactory.js.map +1 -1
  534. package/features/formModel/LayoutMutator.js +118 -125
  535. package/features/formModel/LayoutMutator.js.map +1 -1
  536. package/features/formModel/LayoutResolver.js +174 -214
  537. package/features/formModel/LayoutResolver.js.map +1 -1
  538. package/features/formModel/ObjectField.js +524 -724
  539. package/features/formModel/ObjectField.js.map +1 -1
  540. package/features/formModel/PresenterErrors.d.ts +9 -0
  541. package/features/formModel/PresenterErrors.js +32 -0
  542. package/features/formModel/PresenterErrors.js.map +1 -0
  543. package/features/formModel/Rules.test.js +311 -276
  544. package/features/formModel/Rules.test.js.map +1 -1
  545. package/features/formModel/abstractions.d.ts +10 -0
  546. package/features/formModel/abstractions.js +5 -114
  547. package/features/formModel/abstractions.js.map +1 -1
  548. package/features/formModel/createFieldRenderer.js +33 -10
  549. package/features/formModel/createFieldRenderer.js.map +1 -1
  550. package/features/formModel/demo/FieldRenderersDemoPresenter.js +289 -220
  551. package/features/formModel/demo/FieldRenderersDemoPresenter.js.map +1 -1
  552. package/features/formModel/demo/FormModelDemo.js +191 -215
  553. package/features/formModel/demo/FormModelDemo.js.map +1 -1
  554. package/features/formModel/demo/FormModelDemoPresenter.js +132 -113
  555. package/features/formModel/demo/FormModelDemoPresenter.js.map +1 -1
  556. package/features/formModel/demo/FormModelPhase11Presenter.js +101 -98
  557. package/features/formModel/demo/FormModelPhase11Presenter.js.map +1 -1
  558. package/features/formModel/demo/FormModelPhase8c1Presenter.js +64 -57
  559. package/features/formModel/demo/FormModelPhase8c1Presenter.js.map +1 -1
  560. package/features/formModel/feature.js +23 -22
  561. package/features/formModel/feature.js.map +1 -1
  562. package/features/formModel/fieldTypes/BooleanFieldType.js +18 -15
  563. package/features/formModel/fieldTypes/BooleanFieldType.js.map +1 -1
  564. package/features/formModel/fieldTypes/DateTimeFieldType.js +218 -341
  565. package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
  566. package/features/formModel/fieldTypes/FileFieldType.d.ts +12 -1
  567. package/features/formModel/fieldTypes/FileFieldType.js +48 -12
  568. package/features/formModel/fieldTypes/FileFieldType.js.map +1 -1
  569. package/features/formModel/fieldTypes/FileUrlFieldType.js +15 -12
  570. package/features/formModel/fieldTypes/FileUrlFieldType.js.map +1 -1
  571. package/features/formModel/fieldTypes/NumberFieldType.js +19 -18
  572. package/features/formModel/fieldTypes/NumberFieldType.js.map +1 -1
  573. package/features/formModel/fieldTypes/ObjectFieldType.js +80 -94
  574. package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
  575. package/features/formModel/fieldTypes/TextFieldType.js +15 -12
  576. package/features/formModel/fieldTypes/TextFieldType.js.map +1 -1
  577. package/features/formModel/fieldTypes/index.js +7 -9
  578. package/features/formModel/index.d.ts +2 -0
  579. package/features/formModel/index.js +11 -29
  580. package/features/formModel/renderers.js +0 -4
  581. package/features/formModel/useFieldRenderers.js +10 -14
  582. package/features/formModel/useFieldRenderers.js.map +1 -1
  583. package/features/formModel/useLayoutRenderers.js +10 -14
  584. package/features/formModel/useLayoutRenderers.js.map +1 -1
  585. package/features/listCache/ListCache.d.ts +28 -0
  586. package/features/listCache/ListCache.js +48 -0
  587. package/features/listCache/ListCache.js.map +1 -0
  588. package/features/listCache/index.d.ts +2 -0
  589. package/features/listCache/index.js +1 -0
  590. package/features/security/AuthenticationContext/AuthenticationContext.js +27 -26
  591. package/features/security/AuthenticationContext/AuthenticationContext.js.map +1 -1
  592. package/features/security/AuthenticationContext/GraphQLClientDecorator.js +23 -22
  593. package/features/security/AuthenticationContext/GraphQLClientDecorator.js.map +1 -1
  594. package/features/security/AuthenticationContext/InternalIdTokenProvider.js +15 -12
  595. package/features/security/AuthenticationContext/InternalIdTokenProvider.js.map +1 -1
  596. package/features/security/AuthenticationContext/abstractions.js +3 -2
  597. package/features/security/AuthenticationContext/abstractions.js.map +1 -1
  598. package/features/security/AuthenticationContext/feature.js +15 -14
  599. package/features/security/AuthenticationContext/feature.js.map +1 -1
  600. package/features/security/AuthenticationContext/index.js +0 -2
  601. package/features/security/AuthenticationContext/types.js +0 -3
  602. package/features/security/IdentityContext/IdentityContext.js +18 -17
  603. package/features/security/IdentityContext/IdentityContext.js.map +1 -1
  604. package/features/security/IdentityContext/abstractions.js +2 -1
  605. package/features/security/IdentityContext/abstractions.js.map +1 -1
  606. package/features/security/IdentityContext/feature.js +13 -12
  607. package/features/security/IdentityContext/feature.js.map +1 -1
  608. package/features/security/IdentityContext/index.js +0 -2
  609. package/features/security/LogIn/IdentityMapper.js +8 -7
  610. package/features/security/LogIn/IdentityMapper.js.map +1 -1
  611. package/features/security/LogIn/LogInGateway.js +17 -19
  612. package/features/security/LogIn/LogInGateway.js.map +1 -1
  613. package/features/security/LogIn/LogInRepository.js +16 -14
  614. package/features/security/LogIn/LogInRepository.js.map +1 -1
  615. package/features/security/LogIn/LogInUseCase.js +23 -31
  616. package/features/security/LogIn/LogInUseCase.js.map +1 -1
  617. package/features/security/LogIn/abstractions.js +5 -16
  618. package/features/security/LogIn/abstractions.js.map +1 -1
  619. package/features/security/LogIn/createLoginMutation.js +2 -3
  620. package/features/security/LogIn/createLoginMutation.js.map +1 -1
  621. package/features/security/LogIn/feature.js +16 -15
  622. package/features/security/LogIn/feature.js.map +1 -1
  623. package/features/security/LogIn/index.js +0 -2
  624. package/features/security/LogOut/LogOutUseCase.js +18 -16
  625. package/features/security/LogOut/LogOutUseCase.js.map +1 -1
  626. package/features/security/LogOut/abstractions.js +2 -1
  627. package/features/security/LogOut/abstractions.js.map +1 -1
  628. package/features/security/LogOut/feature.js +12 -11
  629. package/features/security/LogOut/feature.js.map +1 -1
  630. package/features/security/LogOut/index.js +0 -2
  631. package/features/security/SecurityFeature.js +9 -8
  632. package/features/security/SecurityFeature.js.map +1 -1
  633. package/features/telemetry/TelemetryService.js +11 -12
  634. package/features/telemetry/TelemetryService.js.map +1 -1
  635. package/features/telemetry/abstractions.js +2 -1
  636. package/features/telemetry/abstractions.js.map +1 -1
  637. package/features/telemetry/feature.js +13 -12
  638. package/features/telemetry/feature.js.map +1 -1
  639. package/features/telemetry/index.js +0 -2
  640. package/features/tenancy/GraphQLClientDecorator.js +23 -20
  641. package/features/tenancy/GraphQLClientDecorator.js.map +1 -1
  642. package/features/tenancy/TenantContext.js +46 -50
  643. package/features/tenancy/TenantContext.js.map +1 -1
  644. package/features/tenancy/abstractions.js +2 -1
  645. package/features/tenancy/abstractions.js.map +1 -1
  646. package/features/tenancy/feature.js +25 -35
  647. package/features/tenancy/feature.js.map +1 -1
  648. package/features/tenancy/types.js +0 -3
  649. package/features/tools/LexicalContext/LexicalContext.js +20 -17
  650. package/features/tools/LexicalContext/LexicalContext.js.map +1 -1
  651. package/features/tools/LexicalContext/abstractions.js +2 -1
  652. package/features/tools/LexicalContext/abstractions.js.map +1 -1
  653. package/features/tools/LexicalContext/index.js +0 -2
  654. package/features/tools/ToolPipelineRunner.js +26 -24
  655. package/features/tools/ToolPipelineRunner.js.map +1 -1
  656. package/features/tools/ToolRegistry.js +32 -23
  657. package/features/tools/ToolRegistry.js.map +1 -1
  658. package/features/tools/abstractions.js +4 -3
  659. package/features/tools/abstractions.js.map +1 -1
  660. package/features/tools/feature.js +17 -16
  661. package/features/tools/feature.js.map +1 -1
  662. package/features/tools/index.js +1 -3
  663. package/features/wcp/ReactLicense.js +53 -52
  664. package/features/wcp/ReactLicense.js.map +1 -1
  665. package/features/wcp/WcpGateway.js +21 -20
  666. package/features/wcp/WcpGateway.js.map +1 -1
  667. package/features/wcp/WcpService.js +57 -67
  668. package/features/wcp/WcpService.js.map +1 -1
  669. package/features/wcp/abstractions.js +3 -2
  670. package/features/wcp/abstractions.js.map +1 -1
  671. package/features/wcp/feature.js +14 -13
  672. package/features/wcp/feature.js.map +1 -1
  673. package/features/wcp/types.js +0 -3
  674. package/features/webinySdk/WebinySdk.js +19 -18
  675. package/features/webinySdk/WebinySdk.js.map +1 -1
  676. package/features/webinySdk/abstractions.js +2 -5
  677. package/features/webinySdk/abstractions.js.map +1 -1
  678. package/features/webinySdk/feature.js +13 -12
  679. package/features/webinySdk/feature.js.map +1 -1
  680. package/features/webinySdk/index.js +0 -2
  681. package/hooks/index.js +0 -2
  682. package/hooks/useConfirmationDialog.d.ts +1 -1
  683. package/hooks/useConfirmationDialog.js +31 -38
  684. package/hooks/useConfirmationDialog.js.map +1 -1
  685. package/hooks/useDialog.js +14 -15
  686. package/hooks/useDialog.js.map +1 -1
  687. package/hooks/useHotkeys.js +52 -85
  688. package/hooks/useHotkeys.js.map +1 -1
  689. package/hooks/useIsMounted.js +12 -11
  690. package/hooks/useIsMounted.js.map +1 -1
  691. package/hooks/useKeyHandler.js +45 -53
  692. package/hooks/useKeyHandler.js.map +1 -1
  693. package/hooks/useModKey.js +20 -25
  694. package/hooks/useModKey.js.map +1 -1
  695. package/hooks/useOpenDialog.js +13 -13
  696. package/hooks/useOpenDialog.js.map +1 -1
  697. package/hooks/useShiftKey.d.ts +5 -1
  698. package/hooks/useShiftKey.js +38 -29
  699. package/hooks/useShiftKey.js.map +1 -1
  700. package/hooks/useSnackbar.d.ts +3 -0
  701. package/hooks/useSnackbar.js +26 -28
  702. package/hooks/useSnackbar.js.map +1 -1
  703. package/hooks/useStateIfMounted.js +14 -12
  704. package/hooks/useStateIfMounted.js.map +1 -1
  705. package/hooks/useStateWithCallback.js +18 -14
  706. package/hooks/useStateWithCallback.js.map +1 -1
  707. package/hooks/useToggler.js +12 -11
  708. package/hooks/useToggler.js.map +1 -1
  709. package/index.d.ts +4 -1
  710. package/index.js +15 -31
  711. package/package.json +29 -29
  712. package/permissions/PermissionRenderer.js +179 -193
  713. package/permissions/PermissionRenderer.js.map +1 -1
  714. package/permissions/PermissionValueContext.js +13 -20
  715. package/permissions/PermissionValueContext.js.map +1 -1
  716. package/permissions/createHasPermission.js +32 -40
  717. package/permissions/createHasPermission.js.map +1 -1
  718. package/permissions/createPermissionSchema.js +6 -5
  719. package/permissions/createPermissionSchema.js.map +1 -1
  720. package/permissions/createPermissions.js +125 -185
  721. package/permissions/createPermissions.js.map +1 -1
  722. package/permissions/createPermissions.test.js +190 -158
  723. package/permissions/createPermissions.test.js.map +1 -1
  724. package/permissions/index.js +2 -4
  725. package/permissions/types.js +0 -3
  726. package/permissions/usePermissionForm.js +133 -232
  727. package/permissions/usePermissionForm.js.map +1 -1
  728. package/permissions/usePermissions.js +6 -5
  729. package/permissions/usePermissions.js.map +1 -1
  730. package/plugins/MenuPlugin.js +15 -14
  731. package/plugins/MenuPlugin.js.map +1 -1
  732. package/presentation/browserFilePicker/BrowserFilePicker.d.ts +3 -0
  733. package/presentation/browserFilePicker/BrowserFilePicker.js +88 -0
  734. package/presentation/browserFilePicker/BrowserFilePicker.js.map +1 -0
  735. package/presentation/browserFilePicker/BrowserFilePickerPresenter.d.ts +10 -0
  736. package/presentation/browserFilePicker/BrowserFilePickerPresenter.js +84 -0
  737. package/presentation/browserFilePicker/BrowserFilePickerPresenter.js.map +1 -0
  738. package/presentation/browserFilePicker/index.d.ts +3 -0
  739. package/presentation/browserFilePicker/index.js +2 -0
  740. package/presentation/browserFilePicker/types.d.ts +53 -0
  741. package/presentation/browserFilePicker/types.js +0 -0
  742. package/presentation/browserFilePicker/utils.d.ts +2 -0
  743. package/presentation/browserFilePicker/utils.js +16 -0
  744. package/presentation/browserFilePicker/utils.js.map +1 -0
  745. package/presentation/buildParams/useBuildParams.js +2 -3
  746. package/presentation/buildParams/useBuildParams.js.map +1 -1
  747. package/presentation/installation/components/SystemInstaller/SystemInstaller.js +46 -53
  748. package/presentation/installation/components/SystemInstaller/SystemInstaller.js.map +1 -1
  749. package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js +9 -14
  750. package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js.map +1 -1
  751. package/presentation/installation/components/SystemInstaller/index.js +0 -2
  752. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +14 -29
  753. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +1 -1
  754. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +11 -10
  755. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +1 -1
  756. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +60 -60
  757. package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
  758. package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js +75 -85
  759. package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
  760. package/presentation/installation/components/SystemInstaller/steps/Center.js +5 -8
  761. package/presentation/installation/components/SystemInstaller/steps/Center.js.map +1 -1
  762. package/presentation/installation/components/SystemInstaller/steps/Container.js +18 -24
  763. package/presentation/installation/components/SystemInstaller/steps/Container.js.map +1 -1
  764. package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +48 -53
  765. package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
  766. package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js +13 -16
  767. package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js.map +1 -1
  768. package/presentation/installation/components/SystemInstaller/steps/introduction.js +723 -0
  769. package/presentation/installation/components/SystemInstaller/steps/introduction.js.map +1 -0
  770. package/presentation/installation/components/SystemInstaller/steps/referralSources.js +14 -1
  771. package/presentation/installation/components/SystemInstaller/steps/referralSources.js.map +1 -1
  772. package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js +27 -28
  773. package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js.map +1 -1
  774. package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +117 -124
  775. package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
  776. package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js +23 -21
  777. package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js.map +1 -1
  778. package/presentation/installation/presenters/SystemInstaller/abstractions.js +4 -3
  779. package/presentation/installation/presenters/SystemInstaller/abstractions.js.map +1 -1
  780. package/presentation/installation/presenters/SystemInstaller/feature.js +15 -14
  781. package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -1
  782. package/presentation/installation/presenters/SystemInstaller/index.js +0 -2
  783. package/presentation/lexicalContext/useLexicalContext.js +11 -8
  784. package/presentation/lexicalContext/useLexicalContext.js.map +1 -1
  785. package/presentation/listPresenter/ListPresenter.d.ts +30 -0
  786. package/presentation/listPresenter/ListPresenter.js +216 -0
  787. package/presentation/listPresenter/ListPresenter.js.map +1 -0
  788. package/presentation/listPresenter/ListPresenter.test.d.ts +1 -0
  789. package/presentation/listPresenter/ListPresenter.test.js +816 -0
  790. package/presentation/listPresenter/ListPresenter.test.js.map +1 -0
  791. package/presentation/listPresenter/SelectionController.d.ts +21 -0
  792. package/presentation/listPresenter/SelectionController.js +74 -0
  793. package/presentation/listPresenter/SelectionController.js.map +1 -0
  794. package/presentation/listPresenter/abstractions.d.ts +107 -0
  795. package/presentation/listPresenter/abstractions.js +5 -0
  796. package/presentation/listPresenter/abstractions.js.map +1 -0
  797. package/presentation/listPresenter/feature.d.ts +3 -0
  798. package/presentation/listPresenter/feature.js +17 -0
  799. package/presentation/listPresenter/feature.js.map +1 -0
  800. package/presentation/listPresenter/index.d.ts +3 -0
  801. package/presentation/listPresenter/index.js +2 -0
  802. package/presentation/security/components/HasPermission.js +15 -25
  803. package/presentation/security/components/HasPermission.js.map +1 -1
  804. package/presentation/security/components/SecureRoute.js +6 -12
  805. package/presentation/security/components/SecureRoute.js.map +1 -1
  806. package/presentation/security/hooks/useAuthentication.js +11 -17
  807. package/presentation/security/hooks/useAuthentication.js.map +1 -1
  808. package/presentation/security/hooks/useIdentity.js +19 -18
  809. package/presentation/security/hooks/useIdentity.js.map +1 -1
  810. package/presentation/security/hooks/useSecurity.js +14 -24
  811. package/presentation/security/hooks/useSecurity.js.map +1 -1
  812. package/presentation/tenancy/TenancyProvider.js +23 -36
  813. package/presentation/tenancy/TenancyProvider.js.map +1 -1
  814. package/presentation/tenancy/createTenancyProvider.js +6 -11
  815. package/presentation/tenancy/createTenancyProvider.js.map +1 -1
  816. package/presentation/tenancy/useTenantContext.js +17 -18
  817. package/presentation/tenancy/useTenantContext.js.map +1 -1
  818. package/presentation/textToLexicalTool/TextToLexicalTool.js +20 -18
  819. package/presentation/textToLexicalTool/TextToLexicalTool.js.map +1 -1
  820. package/presentation/textToLexicalTool/feature.js +6 -5
  821. package/presentation/textToLexicalTool/feature.js.map +1 -1
  822. package/presentation/textToLexicalTool/textToLexicalState.js +28 -28
  823. package/presentation/textToLexicalTool/textToLexicalState.js.map +1 -1
  824. package/presentation/wcp/WcpProvider.js +16 -26
  825. package/presentation/wcp/WcpProvider.js.map +1 -1
  826. package/presentation/wcp/useWcp.js +11 -12
  827. package/presentation/wcp/useWcp.js.map +1 -1
  828. package/routes.d.ts +0 -1
  829. package/routes.js +14 -17
  830. package/routes.js.map +1 -1
  831. package/static/svg/SecureRouteError.e8b15981.svg +1 -0
  832. package/static/svg/add-18px.b3062af6.svg +3 -0
  833. package/static/svg/arrow_drop_down-24px.da74d713.svg +4 -0
  834. package/static/svg/attach_file_black_24dp.7fb13a7e.svg +1 -0
  835. package/static/svg/baseline-menu-24px.071b179d.svg +4 -0
  836. package/static/svg/baseline-notification_important-24px.29277e73.svg +4 -0
  837. package/static/svg/baseline-security-24px.12e519cc.svg +4 -0
  838. package/static/svg/file_download.afe3fbec.svg +1 -0
  839. package/static/svg/file_upload.6865d820.svg +1 -0
  840. package/static/svg/filter-24px.886d9ff0.svg +8 -0
  841. package/static/svg/github-brands.6311f0fa.svg +1 -0
  842. package/static/svg/highlight-24px.959a97f7.svg +1 -0
  843. package/static/svg/icon-community.cd087355.svg +16 -0
  844. package/static/svg/icon-documentation.a189d24c.svg +16 -0
  845. package/static/svg/info.fe810b72.svg +1 -0
  846. package/static/svg/insert_drive_file-24px.39d490eb.svg +1 -0
  847. package/static/svg/insert_photo-24px.81a5f945.svg +1 -0
  848. package/static/svg/introduction.108720aa.svg +154 -0
  849. package/static/svg/label-24px.9deafa4f.svg +1 -0
  850. package/static/svg/round-account_circle-24px.f0b48cb7.svg +1 -0
  851. package/static/svg/round-add-24px.4a5219b4.svg +16 -0
  852. package/static/svg/round-arrow_drop_down-24px.5fdf92d1.svg +1 -0
  853. package/static/svg/round-chevron_right-24px.34936511.svg +12 -0
  854. package/static/svg/round-feedback-24px.4dae7231.svg +54 -0
  855. package/static/svg/round-help-24px.a61b1d66.svg +1 -0
  856. package/static/svg/round-invert_colors-24px.a229a1dd.svg +52 -0
  857. package/static/svg/round-keyboard_arrow_down-24px.6febe804.svg +16 -0
  858. package/static/svg/round-keyboard_arrow_up-24px.b1f7db34.svg +16 -0
  859. package/static/svg/round-lock_open-24px.d527f6a5.svg +60 -0
  860. package/static/svg/round-more_vert-24px.68d41b07.svg +12 -0
  861. package/static/svg/round-open_in_new-24px.be5b4ddd.svg +44 -0
  862. package/static/svg/round-settings-24px.c0b3056f.svg +4 -0
  863. package/static/svg/search-24px.3c0f88dd.svg +20 -0
  864. package/static/svg/slack-logo.7ee35e7f.svg +1 -0
  865. package/static/svg/today-24px.df206362.svg +1 -0
  866. package/static/svg/touch_app.debf3744.svg +1 -0
  867. package/static/svg/wby-horizontal.03327bf6.svg +23 -0
  868. package/static/svg/wby-square.ff8f47c3.svg +3 -0
  869. package/static/svg/webiny-logo.ef56725c.svg +20 -0
  870. package/static/svg/webiny-orange-logo.4eccf0f2.svg +20 -0
  871. package/types.js +0 -3
  872. package/components/BulkActions/index.js.map +0 -1
  873. package/components/BulkActions/useDialogWithReport/index.js.map +0 -1
  874. package/components/Buttons/index.js.map +0 -1
  875. package/components/DeveloperMode/index.js.map +0 -1
  876. package/components/Filters/index.js.map +0 -1
  877. package/components/IconPicker/components/index.js.map +0 -1
  878. package/components/IconPicker/index.js.map +0 -1
  879. package/components/LexicalEditor/index.js.map +0 -1
  880. package/components/NotAuthorizedError/index.js.map +0 -1
  881. package/components/OptionsMenu/index.js.map +0 -1
  882. package/components/OverlayLayout/components/index.js.map +0 -1
  883. package/components/OverlayLayout/index.js.map +0 -1
  884. package/components/Permissions/index.js.map +0 -1
  885. package/components/ResizablePanels/index.js.map +0 -1
  886. package/components/SimpleForm/index.js.map +0 -1
  887. package/components/SplitView/index.js.map +0 -1
  888. package/components/index.js.map +0 -1
  889. package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +0 -1
  890. package/config/AdminConfig/Menu/UserMenu/types.js.map +0 -1
  891. package/config/AdminConfig/Menu/types.js.map +0 -1
  892. package/config/AdminConfig/Theme/types.js.map +0 -1
  893. package/exports/admin/build-params.js.map +0 -1
  894. package/exports/admin/configs.js.map +0 -1
  895. package/exports/admin/form.js.map +0 -1
  896. package/exports/admin/security.js.map +0 -1
  897. package/exports/admin/tenancy.js.map +0 -1
  898. package/exports/admin/ui.js.map +0 -1
  899. package/exports/admin.js.map +0 -1
  900. package/features/buildParams/index.js.map +0 -1
  901. package/features/formModel/fieldTypes/index.js.map +0 -1
  902. package/features/formModel/index.js.map +0 -1
  903. package/features/formModel/renderers.js.map +0 -1
  904. package/features/security/AuthenticationContext/index.js.map +0 -1
  905. package/features/security/AuthenticationContext/types.js.map +0 -1
  906. package/features/security/IdentityContext/index.js.map +0 -1
  907. package/features/security/LogIn/index.js.map +0 -1
  908. package/features/security/LogOut/index.js.map +0 -1
  909. package/features/telemetry/index.js.map +0 -1
  910. package/features/tenancy/types.js.map +0 -1
  911. package/features/tools/LexicalContext/index.js.map +0 -1
  912. package/features/tools/index.js.map +0 -1
  913. package/features/wcp/types.js.map +0 -1
  914. package/features/webinySdk/index.js.map +0 -1
  915. package/hooks/index.js.map +0 -1
  916. package/index.js.map +0 -1
  917. package/permissions/index.js.map +0 -1
  918. package/permissions/types.js.map +0 -1
  919. package/presentation/installation/components/SystemInstaller/index.js.map +0 -1
  920. package/presentation/installation/presenters/SystemInstaller/index.js.map +0 -1
  921. package/types.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { describe, it, expect } from "vitest";
1
+ import { describe, expect, it } from "vitest";
2
2
  import { z } from "zod";
3
3
  import { Container } from "@webiny/di";
4
4
  import { FormModelFeature } from "./feature.js";
@@ -8,213 +8,229 @@ import { NumberFieldBuilder } from "./fieldTypes/NumberFieldType.js";
8
8
  import { BooleanFieldBuilder } from "./fieldTypes/BooleanFieldType.js";
9
9
  import { DateTimeFieldBuilder } from "./fieldTypes/DateTimeFieldType.js";
10
10
  function createRegistry() {
11
- const container = new Container();
12
- FormModelFeature.register(container);
13
- return container.resolve(FieldBuilderRegistry);
11
+ const container = new Container();
12
+ FormModelFeature.register(container);
13
+ return container.resolve(FieldBuilderRegistry);
14
14
  }
15
- describe("TextFieldBuilder", () => {
16
- it("should build a text field config with all fluent methods", () => {
17
- const builder = new TextFieldBuilder().label("Title").placeholder("Enter title").required("Title is required").defaultValue("Untitled").renderer("custom-text").schema(z.string().min(1));
18
- const config = builder.build("title");
19
- expect(config.name).toBe("title");
20
- expect(config.type).toBe("text");
21
- expect(config.label).toBe("Title");
22
- expect(config.placeholder).toBe("Enter title");
23
- expect(config.required).toBe(true);
24
- expect(config.requiredMessage).toBe("Title is required");
25
- expect(config.defaultValue).toBe("Untitled");
26
- expect(config.renderer).toBe("custom-text");
27
- expect(config.hidden).toBe(false);
28
- expect(config.disabled).toBe(false);
29
- expect(config.schema).toBeDefined();
30
- });
31
- it("should support hidden() method", () => {
32
- const config = new TextFieldBuilder().hidden().build("secret");
33
- expect(config.hidden).toBe(true);
34
- });
35
- it("should support disabled() method", () => {
36
- const config = new TextFieldBuilder().disabled().build("readonly");
37
- expect(config.disabled).toBe(true);
38
- });
39
- it("should default disabled to false", () => {
40
- const config = new TextFieldBuilder().build("field");
41
- expect(config.disabled).toBe(false);
42
- });
15
+ describe("TextFieldBuilder", ()=>{
16
+ it("should build a text field config with all fluent methods", ()=>{
17
+ const builder = new TextFieldBuilder().label("Title").placeholder("Enter title").required("Title is required").defaultValue("Untitled").renderer("custom-text").schema(z.string().min(1));
18
+ const config = builder.build("title");
19
+ expect(config.name).toBe("title");
20
+ expect(config.type).toBe("text");
21
+ expect(config.label).toBe("Title");
22
+ expect(config.placeholder).toBe("Enter title");
23
+ expect(config.required).toBe(true);
24
+ expect(config.requiredMessage).toBe("Title is required");
25
+ expect(config.defaultValue).toBe("Untitled");
26
+ expect(config.renderer).toBe("custom-text");
27
+ expect(config.hidden).toBe(false);
28
+ expect(config.disabled).toBe(false);
29
+ expect(config.schema).toBeDefined();
30
+ });
31
+ it("should support hidden() method", ()=>{
32
+ const config = new TextFieldBuilder().hidden().build("secret");
33
+ expect(config.hidden).toBe(true);
34
+ });
35
+ it("should support disabled() method", ()=>{
36
+ const config = new TextFieldBuilder().disabled().build("readonly");
37
+ expect(config.disabled).toBe(true);
38
+ });
39
+ it("should default disabled to false", ()=>{
40
+ const config = new TextFieldBuilder().build("field");
41
+ expect(config.disabled).toBe(false);
42
+ });
43
43
  });
44
- describe("TextFieldBuilder - beforeChange / afterChange", () => {
45
- it("should store beforeChange callbacks in config", () => {
46
- const cb1 = value => value;
47
- const cb2 = value => value;
48
- const config = new TextFieldBuilder().beforeChange(cb1).beforeChange(cb2).build("field");
49
- expect(config.beforeChangeCallbacks).toHaveLength(2);
50
- expect(config.beforeChangeCallbacks[0]).toBe(cb1);
51
- expect(config.beforeChangeCallbacks[1]).toBe(cb2);
52
- });
53
- it("should store afterChange callbacks in config", () => {
54
- const cb = () => {};
55
- const config = new TextFieldBuilder().afterChange(cb).build("field");
56
- expect(config.afterChangeCallbacks).toHaveLength(1);
57
- expect(config.afterChangeCallbacks[0]).toBe(cb);
58
- });
59
- it("should not have callback arrays when none are added", () => {
60
- const config = new TextFieldBuilder().build("field");
61
- expect(config.beforeChangeCallbacks).toBeUndefined();
62
- expect(config.afterChangeCallbacks).toBeUndefined();
63
- });
64
- it("should support chaining callbacks with other builder methods", () => {
65
- const config = new TextFieldBuilder().label("Title").beforeChange(value => value).required("Required").afterChange(() => {}).build("title");
66
- expect(config.label).toBe("Title");
67
- expect(config.required).toBe(true);
68
- expect(config.beforeChangeCallbacks).toHaveLength(1);
69
- expect(config.afterChangeCallbacks).toHaveLength(1);
70
- });
44
+ describe("TextFieldBuilder - beforeChange / afterChange", ()=>{
45
+ it("should store beforeChange callbacks in config", ()=>{
46
+ const cb1 = (value)=>value;
47
+ const cb2 = (value)=>value;
48
+ const config = new TextFieldBuilder().beforeChange(cb1).beforeChange(cb2).build("field");
49
+ expect(config.beforeChangeCallbacks).toHaveLength(2);
50
+ expect(config.beforeChangeCallbacks[0]).toBe(cb1);
51
+ expect(config.beforeChangeCallbacks[1]).toBe(cb2);
52
+ });
53
+ it("should store afterChange callbacks in config", ()=>{
54
+ const cb = ()=>{};
55
+ const config = new TextFieldBuilder().afterChange(cb).build("field");
56
+ expect(config.afterChangeCallbacks).toHaveLength(1);
57
+ expect(config.afterChangeCallbacks[0]).toBe(cb);
58
+ });
59
+ it("should not have callback arrays when none are added", ()=>{
60
+ const config = new TextFieldBuilder().build("field");
61
+ expect(config.beforeChangeCallbacks).toBeUndefined();
62
+ expect(config.afterChangeCallbacks).toBeUndefined();
63
+ });
64
+ it("should support chaining callbacks with other builder methods", ()=>{
65
+ const config = new TextFieldBuilder().label("Title").beforeChange((value)=>value).required("Required").afterChange(()=>{}).build("title");
66
+ expect(config.label).toBe("Title");
67
+ expect(config.required).toBe(true);
68
+ expect(config.beforeChangeCallbacks).toHaveLength(1);
69
+ expect(config.afterChangeCallbacks).toHaveLength(1);
70
+ });
71
71
  });
72
- describe("TextFieldBuilder - options", () => {
73
- it("should build a text field config with static options", () => {
74
- const options = [{
75
- label: "English",
76
- value: "en"
77
- }, {
78
- label: "German",
79
- value: "de"
80
- }];
81
- const config = new TextFieldBuilder().label("Language").options(options).required().build("language");
82
- expect(config.name).toBe("language");
83
- expect(config.type).toBe("text");
84
- expect(config.label).toBe("Language");
85
- expect(config.required).toBe(true);
86
- expect(config.options).toEqual(options);
87
- expect(config.renderer).toBe("dropdown");
88
- });
89
- it("should support reactive options function", () => {
90
- const optionsFn = () => [{
91
- label: "A",
92
- value: "a"
93
- }];
94
- const config = new TextFieldBuilder().options(optionsFn).build("dynamic");
95
- expect(typeof config.options).toBe("function");
96
- });
97
- it("should auto-switch renderer to dropdown when options are set", () => {
98
- const config = new TextFieldBuilder().options([{
99
- label: "A",
100
- value: "a"
101
- }]).build("field");
102
- expect(config.renderer).toBe("dropdown");
103
- });
104
- it("should not override an explicitly set renderer", () => {
105
- const config = new TextFieldBuilder().renderer("radioButtons").options([{
106
- label: "A",
107
- value: "a"
108
- }]).build("field");
109
- expect(config.renderer).toBe("radioButtons");
110
- });
72
+ describe("TextFieldBuilder - options", ()=>{
73
+ it("should build a text field config with static options", ()=>{
74
+ const options = [
75
+ {
76
+ label: "English",
77
+ value: "en"
78
+ },
79
+ {
80
+ label: "German",
81
+ value: "de"
82
+ }
83
+ ];
84
+ const config = new TextFieldBuilder().label("Language").options(options).required().build("language");
85
+ expect(config.name).toBe("language");
86
+ expect(config.type).toBe("text");
87
+ expect(config.label).toBe("Language");
88
+ expect(config.required).toBe(true);
89
+ expect(config.options).toEqual(options);
90
+ expect(config.renderer).toBe("dropdown");
91
+ });
92
+ it("should support reactive options function", ()=>{
93
+ const optionsFn = ()=>[
94
+ {
95
+ label: "A",
96
+ value: "a"
97
+ }
98
+ ];
99
+ const config = new TextFieldBuilder().options(optionsFn).build("dynamic");
100
+ expect(typeof config.options).toBe("function");
101
+ });
102
+ it("should auto-switch renderer to dropdown when options are set", ()=>{
103
+ const config = new TextFieldBuilder().options([
104
+ {
105
+ label: "A",
106
+ value: "a"
107
+ }
108
+ ]).build("field");
109
+ expect(config.renderer).toBe("dropdown");
110
+ });
111
+ it("should not override an explicitly set renderer", ()=>{
112
+ const config = new TextFieldBuilder().renderer("radioButtons").options([
113
+ {
114
+ label: "A",
115
+ value: "a"
116
+ }
117
+ ]).build("field");
118
+ expect(config.renderer).toBe("radioButtons");
119
+ });
111
120
  });
112
- describe("NumberFieldBuilder - options", () => {
113
- it("should build a number field config with options", () => {
114
- const options = [{
115
- label: "One",
116
- value: "1"
117
- }, {
118
- label: "Two",
119
- value: "2"
120
- }];
121
- const config = new NumberFieldBuilder().label("Count").options(options).build("count");
122
- expect(config.type).toBe("number");
123
- expect(config.options).toEqual(options);
124
- expect(config.renderer).toBe("dropdown");
125
- });
126
- it("should not override an explicitly set renderer", () => {
127
- const config = new NumberFieldBuilder().renderer("radioButtons").options([{
128
- label: "1",
129
- value: "1"
130
- }]).build("field");
131
- expect(config.renderer).toBe("radioButtons");
132
- });
121
+ describe("NumberFieldBuilder - options", ()=>{
122
+ it("should build a number field config with options", ()=>{
123
+ const options = [
124
+ {
125
+ label: "One",
126
+ value: "1"
127
+ },
128
+ {
129
+ label: "Two",
130
+ value: "2"
131
+ }
132
+ ];
133
+ const config = new NumberFieldBuilder().label("Count").options(options).build("count");
134
+ expect(config.type).toBe("number");
135
+ expect(config.options).toEqual(options);
136
+ expect(config.renderer).toBe("dropdown");
137
+ });
138
+ it("should not override an explicitly set renderer", ()=>{
139
+ const config = new NumberFieldBuilder().renderer("radioButtons").options([
140
+ {
141
+ label: "1",
142
+ value: "1"
143
+ }
144
+ ]).build("field");
145
+ expect(config.renderer).toBe("radioButtons");
146
+ });
133
147
  });
134
- describe("DateTimeFieldBuilder", () => {
135
- it("should build a datetime field with default renderer", () => {
136
- const config = new DateTimeFieldBuilder().label("Created").build("created");
137
- expect(config.type).toBe("datetime");
138
- expect(config.renderer).toBe("dateTimeInput");
139
- expect(config.label).toBe("Created");
140
- });
148
+ describe("DateTimeFieldBuilder", ()=>{
149
+ it("should build a datetime field with default renderer", ()=>{
150
+ const config = new DateTimeFieldBuilder().label("Created").build("created");
151
+ expect(config.type).toBe("datetime");
152
+ expect(config.renderer).toBe("dateTimeInput");
153
+ expect(config.label).toBe("Created");
154
+ });
141
155
  });
142
- describe("FieldBuilderRegistry", () => {
143
- it("should create text builders via registry.text()", () => {
144
- const registry = createRegistry();
145
- const builder = registry.text();
146
- expect(builder).toBeInstanceOf(TextFieldBuilder);
147
- });
148
- it("should create number builders via registry.number()", () => {
149
- const registry = createRegistry();
150
- const builder = registry.number();
151
- expect(builder).toBeInstanceOf(NumberFieldBuilder);
152
- });
153
- it("should create boolean builders via registry.boolean()", () => {
154
- const registry = createRegistry();
155
- const builder = registry.boolean();
156
- expect(builder).toBeInstanceOf(BooleanFieldBuilder);
157
- });
158
- it("should create datetime builders via registry.datetime()", () => {
159
- const registry = createRegistry();
160
- const builder = registry.datetime();
161
- expect(builder).toBeInstanceOf(DateTimeFieldBuilder);
162
- });
163
- it("should support chaining on registry-created builders", () => {
164
- const registry = createRegistry();
165
- const config = registry.text().label("Name").required().build("name");
166
- expect(config.label).toBe("Name");
167
- expect(config.required).toBe(true);
168
- });
169
- it("should support options on text builders from registry", () => {
170
- const registry = createRegistry();
171
- const config = registry.text().options([{
172
- label: "A",
173
- value: "a"
174
- }]).build("field");
175
- expect(config.options).toHaveLength(1);
176
- expect(config.renderer).toBe("dropdown");
177
- });
156
+ describe("FieldBuilderRegistry", ()=>{
157
+ it("should create text builders via registry.text()", ()=>{
158
+ const registry = createRegistry();
159
+ const builder = registry.text();
160
+ expect(builder).toBeInstanceOf(TextFieldBuilder);
161
+ });
162
+ it("should create number builders via registry.number()", ()=>{
163
+ const registry = createRegistry();
164
+ const builder = registry.number();
165
+ expect(builder).toBeInstanceOf(NumberFieldBuilder);
166
+ });
167
+ it("should create boolean builders via registry.boolean()", ()=>{
168
+ const registry = createRegistry();
169
+ const builder = registry.boolean();
170
+ expect(builder).toBeInstanceOf(BooleanFieldBuilder);
171
+ });
172
+ it("should create datetime builders via registry.datetime()", ()=>{
173
+ const registry = createRegistry();
174
+ const builder = registry.datetime();
175
+ expect(builder).toBeInstanceOf(DateTimeFieldBuilder);
176
+ });
177
+ it("should support chaining on registry-created builders", ()=>{
178
+ const registry = createRegistry();
179
+ const config = registry.text().label("Name").required().build("name");
180
+ expect(config.label).toBe("Name");
181
+ expect(config.required).toBe(true);
182
+ });
183
+ it("should support options on text builders from registry", ()=>{
184
+ const registry = createRegistry();
185
+ const config = registry.text().options([
186
+ {
187
+ label: "A",
188
+ value: "a"
189
+ }
190
+ ]).build("field");
191
+ expect(config.options).toHaveLength(1);
192
+ expect(config.renderer).toBe("dropdown");
193
+ });
178
194
  });
179
- describe("normalizeValue", () => {
180
- it("should be identity for TextFieldBuilder", () => {
181
- const builder = new TextFieldBuilder();
182
- expect(builder.normalizeValue("hello")).toBe("hello");
183
- expect(builder.normalizeValue(42)).toBe(42);
184
- expect(builder.normalizeValue(null)).toBe(null);
185
- });
186
- it("should coerce string to number for NumberFieldBuilder", () => {
187
- const builder = new NumberFieldBuilder();
188
- expect(builder.normalizeValue("42")).toBe(42);
189
- expect(builder.normalizeValue("3.14")).toBe(3.14);
190
- expect(builder.normalizeValue("0")).toBe(0);
191
- });
192
- it("should return null for non-numeric values in NumberFieldBuilder", () => {
193
- const builder = new NumberFieldBuilder();
194
- expect(builder.normalizeValue(null)).toBe(null);
195
- expect(builder.normalizeValue(undefined)).toBe(null);
196
- expect(builder.normalizeValue("")).toBe(null);
197
- expect(builder.normalizeValue("abc")).toBe(null);
198
- });
199
- it("should coerce to boolean for BooleanFieldBuilder", () => {
200
- const builder = new BooleanFieldBuilder();
201
- expect(builder.normalizeValue(1)).toBe(true);
202
- expect(builder.normalizeValue(0)).toBe(false);
203
- expect(builder.normalizeValue("")).toBe(false);
204
- expect(builder.normalizeValue("yes")).toBe(true);
205
- expect(builder.normalizeValue(null)).toBe(false);
206
- });
207
- it("should be identity for DateTimeFieldBuilder", () => {
208
- const builder = new DateTimeFieldBuilder();
209
- expect(builder.normalizeValue("2024-01-01")).toBe("2024-01-01");
210
- expect(builder.normalizeValue(null)).toBe(null);
211
- });
212
- it("should capture normalizeValue into config at build time", () => {
213
- const config = new NumberFieldBuilder().label("Count").build("count");
214
- expect(config.normalizeValue).toBeDefined();
215
- expect(config.normalizeValue("42")).toBe(42);
216
- expect(config.normalizeValue(null)).toBe(null);
217
- });
195
+ describe("normalizeValue", ()=>{
196
+ it("should be identity for TextFieldBuilder", ()=>{
197
+ const builder = new TextFieldBuilder();
198
+ expect(builder.normalizeValue("hello")).toBe("hello");
199
+ expect(builder.normalizeValue(42)).toBe(42);
200
+ expect(builder.normalizeValue(null)).toBe(null);
201
+ });
202
+ it("should coerce string to number for NumberFieldBuilder", ()=>{
203
+ const builder = new NumberFieldBuilder();
204
+ expect(builder.normalizeValue("42")).toBe(42);
205
+ expect(builder.normalizeValue("3.14")).toBe(3.14);
206
+ expect(builder.normalizeValue("0")).toBe(0);
207
+ });
208
+ it("should return null for non-numeric values in NumberFieldBuilder", ()=>{
209
+ const builder = new NumberFieldBuilder();
210
+ expect(builder.normalizeValue(null)).toBe(null);
211
+ expect(builder.normalizeValue(void 0)).toBe(null);
212
+ expect(builder.normalizeValue("")).toBe(null);
213
+ expect(builder.normalizeValue("abc")).toBe(null);
214
+ });
215
+ it("should coerce to boolean for BooleanFieldBuilder", ()=>{
216
+ const builder = new BooleanFieldBuilder();
217
+ expect(builder.normalizeValue(1)).toBe(true);
218
+ expect(builder.normalizeValue(0)).toBe(false);
219
+ expect(builder.normalizeValue("")).toBe(false);
220
+ expect(builder.normalizeValue("yes")).toBe(true);
221
+ expect(builder.normalizeValue(null)).toBe(false);
222
+ });
223
+ it("should be identity for DateTimeFieldBuilder", ()=>{
224
+ const builder = new DateTimeFieldBuilder();
225
+ expect(builder.normalizeValue("2024-01-01")).toBe("2024-01-01");
226
+ expect(builder.normalizeValue(null)).toBe(null);
227
+ });
228
+ it("should capture normalizeValue into config at build time", ()=>{
229
+ const config = new NumberFieldBuilder().label("Count").build("count");
230
+ expect(config.normalizeValue).toBeDefined();
231
+ expect(config.normalizeValue("42")).toBe(42);
232
+ expect(config.normalizeValue(null)).toBe(null);
233
+ });
218
234
  });
219
235
 
220
236
  //# sourceMappingURL=FieldBuilder.test.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["describe","it","expect","z","Container","FormModelFeature","FieldBuilderRegistry","TextFieldBuilder","NumberFieldBuilder","BooleanFieldBuilder","DateTimeFieldBuilder","createRegistry","container","register","resolve","builder","label","placeholder","required","defaultValue","renderer","schema","string","min","config","build","name","toBe","type","requiredMessage","hidden","disabled","toBeDefined","cb1","value","cb2","beforeChange","beforeChangeCallbacks","toHaveLength","cb","afterChange","afterChangeCallbacks","toBeUndefined","options","toEqual","optionsFn","registry","text","toBeInstanceOf","number","boolean","datetime","normalizeValue","undefined"],"sources":["FieldBuilder.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { z } from \"zod\";\nimport { Container } from \"@webiny/di\";\nimport { FormModelFeature } from \"./feature.js\";\nimport { FieldBuilderRegistry, type IFieldBuilderRegistry } from \"./abstractions.js\";\nimport { TextFieldBuilder } from \"./fieldTypes/TextFieldType.js\";\nimport { NumberFieldBuilder } from \"./fieldTypes/NumberFieldType.js\";\nimport { BooleanFieldBuilder } from \"./fieldTypes/BooleanFieldType.js\";\nimport { DateTimeFieldBuilder } from \"./fieldTypes/DateTimeFieldType.js\";\n\nfunction createRegistry(): IFieldBuilderRegistry {\n const container = new Container();\n FormModelFeature.register(container);\n return container.resolve(FieldBuilderRegistry);\n}\n\ndescribe(\"TextFieldBuilder\", () => {\n it(\"should build a text field config with all fluent methods\", () => {\n const builder = new TextFieldBuilder()\n .label(\"Title\")\n .placeholder(\"Enter title\")\n .required(\"Title is required\")\n .defaultValue(\"Untitled\")\n .renderer(\"custom-text\")\n .schema(z.string().min(1));\n\n const config = builder.build(\"title\");\n\n expect(config.name).toBe(\"title\");\n expect(config.type).toBe(\"text\");\n expect(config.label).toBe(\"Title\");\n expect(config.placeholder).toBe(\"Enter title\");\n expect(config.required).toBe(true);\n expect(config.requiredMessage).toBe(\"Title is required\");\n expect(config.defaultValue).toBe(\"Untitled\");\n expect(config.renderer).toBe(\"custom-text\");\n expect(config.hidden).toBe(false);\n expect(config.disabled).toBe(false);\n expect(config.schema).toBeDefined();\n });\n\n it(\"should support hidden() method\", () => {\n const config = new TextFieldBuilder().hidden().build(\"secret\");\n expect(config.hidden).toBe(true);\n });\n\n it(\"should support disabled() method\", () => {\n const config = new TextFieldBuilder().disabled().build(\"readonly\");\n expect(config.disabled).toBe(true);\n });\n\n it(\"should default disabled to false\", () => {\n const config = new TextFieldBuilder().build(\"field\");\n expect(config.disabled).toBe(false);\n });\n});\n\ndescribe(\"TextFieldBuilder - beforeChange / afterChange\", () => {\n it(\"should store beforeChange callbacks in config\", () => {\n const cb1 = (value: unknown) => value;\n const cb2 = (value: unknown) => value;\n\n const config = new TextFieldBuilder().beforeChange(cb1).beforeChange(cb2).build(\"field\");\n\n expect(config.beforeChangeCallbacks).toHaveLength(2);\n expect(config.beforeChangeCallbacks![0]).toBe(cb1);\n expect(config.beforeChangeCallbacks![1]).toBe(cb2);\n });\n\n it(\"should store afterChange callbacks in config\", () => {\n const cb = () => {};\n const config = new TextFieldBuilder().afterChange(cb).build(\"field\");\n\n expect(config.afterChangeCallbacks).toHaveLength(1);\n expect(config.afterChangeCallbacks![0]).toBe(cb);\n });\n\n it(\"should not have callback arrays when none are added\", () => {\n const config = new TextFieldBuilder().build(\"field\");\n expect(config.beforeChangeCallbacks).toBeUndefined();\n expect(config.afterChangeCallbacks).toBeUndefined();\n });\n\n it(\"should support chaining callbacks with other builder methods\", () => {\n const config = new TextFieldBuilder()\n .label(\"Title\")\n .beforeChange(value => value)\n .required(\"Required\")\n .afterChange(() => {})\n .build(\"title\");\n\n expect(config.label).toBe(\"Title\");\n expect(config.required).toBe(true);\n expect(config.beforeChangeCallbacks).toHaveLength(1);\n expect(config.afterChangeCallbacks).toHaveLength(1);\n });\n});\n\ndescribe(\"TextFieldBuilder - options\", () => {\n it(\"should build a text field config with static options\", () => {\n const options = [\n { label: \"English\", value: \"en\" },\n { label: \"German\", value: \"de\" }\n ];\n\n const config = new TextFieldBuilder()\n .label(\"Language\")\n .options(options)\n .required()\n .build(\"language\");\n\n expect(config.name).toBe(\"language\");\n expect(config.type).toBe(\"text\");\n expect(config.label).toBe(\"Language\");\n expect(config.required).toBe(true);\n expect(config.options).toEqual(options);\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should support reactive options function\", () => {\n const optionsFn = () => [{ label: \"A\", value: \"a\" }];\n const config = new TextFieldBuilder().options(optionsFn).build(\"dynamic\");\n expect(typeof config.options).toBe(\"function\");\n });\n\n it(\"should auto-switch renderer to dropdown when options are set\", () => {\n const config = new TextFieldBuilder().options([{ label: \"A\", value: \"a\" }]).build(\"field\");\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should not override an explicitly set renderer\", () => {\n const config = new TextFieldBuilder()\n .renderer(\"radioButtons\")\n .options([{ label: \"A\", value: \"a\" }])\n .build(\"field\");\n expect(config.renderer).toBe(\"radioButtons\");\n });\n});\n\ndescribe(\"NumberFieldBuilder - options\", () => {\n it(\"should build a number field config with options\", () => {\n const options = [\n { label: \"One\", value: \"1\" },\n { label: \"Two\", value: \"2\" }\n ];\n\n const config = new NumberFieldBuilder().label(\"Count\").options(options).build(\"count\");\n\n expect(config.type).toBe(\"number\");\n expect(config.options).toEqual(options);\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should not override an explicitly set renderer\", () => {\n const config = new NumberFieldBuilder()\n .renderer(\"radioButtons\")\n .options([{ label: \"1\", value: \"1\" }])\n .build(\"field\");\n expect(config.renderer).toBe(\"radioButtons\");\n });\n});\n\ndescribe(\"DateTimeFieldBuilder\", () => {\n it(\"should build a datetime field with default renderer\", () => {\n const config = new DateTimeFieldBuilder().label(\"Created\").build(\"created\");\n expect(config.type).toBe(\"datetime\");\n expect(config.renderer).toBe(\"dateTimeInput\");\n expect(config.label).toBe(\"Created\");\n });\n});\n\ndescribe(\"FieldBuilderRegistry\", () => {\n it(\"should create text builders via registry.text()\", () => {\n const registry = createRegistry();\n const builder = registry.text();\n expect(builder).toBeInstanceOf(TextFieldBuilder);\n });\n\n it(\"should create number builders via registry.number()\", () => {\n const registry = createRegistry();\n const builder = registry.number();\n expect(builder).toBeInstanceOf(NumberFieldBuilder);\n });\n\n it(\"should create boolean builders via registry.boolean()\", () => {\n const registry = createRegistry();\n const builder = registry.boolean();\n expect(builder).toBeInstanceOf(BooleanFieldBuilder);\n });\n\n it(\"should create datetime builders via registry.datetime()\", () => {\n const registry = createRegistry();\n const builder = registry.datetime();\n expect(builder).toBeInstanceOf(DateTimeFieldBuilder);\n });\n\n it(\"should support chaining on registry-created builders\", () => {\n const registry = createRegistry();\n const config = registry.text().label(\"Name\").required().build(\"name\");\n expect(config.label).toBe(\"Name\");\n expect(config.required).toBe(true);\n });\n\n it(\"should support options on text builders from registry\", () => {\n const registry = createRegistry();\n const config = registry\n .text()\n .options([{ label: \"A\", value: \"a\" }])\n .build(\"field\");\n expect(config.options).toHaveLength(1);\n expect(config.renderer).toBe(\"dropdown\");\n });\n});\n\ndescribe(\"normalizeValue\", () => {\n it(\"should be identity for TextFieldBuilder\", () => {\n const builder = new TextFieldBuilder();\n expect(builder.normalizeValue(\"hello\")).toBe(\"hello\");\n expect(builder.normalizeValue(42)).toBe(42);\n expect(builder.normalizeValue(null)).toBe(null);\n });\n\n it(\"should coerce string to number for NumberFieldBuilder\", () => {\n const builder = new NumberFieldBuilder();\n expect(builder.normalizeValue(\"42\")).toBe(42);\n expect(builder.normalizeValue(\"3.14\")).toBe(3.14);\n expect(builder.normalizeValue(\"0\")).toBe(0);\n });\n\n it(\"should return null for non-numeric values in NumberFieldBuilder\", () => {\n const builder = new NumberFieldBuilder();\n expect(builder.normalizeValue(null)).toBe(null);\n expect(builder.normalizeValue(undefined)).toBe(null);\n expect(builder.normalizeValue(\"\")).toBe(null);\n expect(builder.normalizeValue(\"abc\")).toBe(null);\n });\n\n it(\"should coerce to boolean for BooleanFieldBuilder\", () => {\n const builder = new BooleanFieldBuilder();\n expect(builder.normalizeValue(1)).toBe(true);\n expect(builder.normalizeValue(0)).toBe(false);\n expect(builder.normalizeValue(\"\")).toBe(false);\n expect(builder.normalizeValue(\"yes\")).toBe(true);\n expect(builder.normalizeValue(null)).toBe(false);\n });\n\n it(\"should be identity for DateTimeFieldBuilder\", () => {\n const builder = new DateTimeFieldBuilder();\n expect(builder.normalizeValue(\"2024-01-01\")).toBe(\"2024-01-01\");\n expect(builder.normalizeValue(null)).toBe(null);\n });\n\n it(\"should capture normalizeValue into config at build time\", () => {\n const config = new NumberFieldBuilder().label(\"Count\").build(\"count\");\n expect(config.normalizeValue).toBeDefined();\n expect(config.normalizeValue!(\"42\")).toBe(42);\n expect(config.normalizeValue!(null)).toBe(null);\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,QAAQ;AAC7C,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,SAAS,QAAQ,YAAY;AACtC,SAASC,gBAAgB;AACzB,SAASC,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,kBAAkB;AAC3B,SAASC,mBAAmB;AAC5B,SAASC,oBAAoB;AAE7B,SAASC,cAAcA,CAAA,EAA0B;EAC7C,MAAMC,SAAS,GAAG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AC,CAACzB,IAAI,CAAC,KAAK,CAAC;IAC9CzB,MAAM,CAACa,OAAO,CAACqC,cAAc,CAAC,KAAK,CAAC,CAAC,CAACzB,IAAI,CAAC,IAAI,CAAC;IAChDzB,MAAM,CAACa,OAAO,CAACqC,cAAc,CAAC,IAAI,CAAC,CAAC,CAACzB,IAAI,CAAC,KAAK,CAAC;EACpD,CAAC,CAAC;EAEF1B,EAAE,CAAC,6CAA6C,EAAE,MAAM;IACpD,MAAMc,OAAO,GAAG,IAAIL,oBAAoB,CAAC,CAAC;IAC1CR,MAAM,CAACa,OAAO,CAACqC,cAAc,CAAC,YAAY,CAAC,CAAC,CAACzB,IAAI,CAAC,YAAY,CAAC;IAC/DzB,MAAM,CAACa,OAAO,CAACqC,cAAc,CAAC,IAAI,CAAC,CAAC,CAACzB,IAAI,CAAC,IAAI,CAAC;EACnD,CAAC,CAAC;EAEF1B,EAAE,CAAC,yDAAyD,EAAE,MAAM;IAChE,MAAMuB,MAAM,GAAG,IAAIhB,kBAAkB,CAAC,CAAC,CAACQ,KAAK,CAAC,OAAO,CAAC,CAACS,KAAK,CAAC,OAAO,CAAC;IACrEvB,MAAM,CAACsB,MAAM,CAAC4B,cAAc,CAAC,CAACpB,WAAW,CAAC,CAAC;IAC3C9B,MAAM,CAACsB,MAAM,CAAC4B,cAAc,CAAE,IAAI,CAAC,CAAC,CAACzB,IAAI,CAAC,EAAE,CAAC;IAC7CzB,MAAM,CAACsB,MAAM,CAAC4B,cAAc,CAAE,IAAI,CAAC,CAAC,CAACzB,IAAI,CAAC,IAAI,CAAC;EACnD,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/formModel/FieldBuilder.test.js","sources":["../../../src/features/formModel/FieldBuilder.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { z } from \"zod\";\nimport { Container } from \"@webiny/di\";\nimport { FormModelFeature } from \"./feature.js\";\nimport { FieldBuilderRegistry, type IFieldBuilderRegistry } from \"./abstractions.js\";\nimport { TextFieldBuilder } from \"./fieldTypes/TextFieldType.js\";\nimport { NumberFieldBuilder } from \"./fieldTypes/NumberFieldType.js\";\nimport { BooleanFieldBuilder } from \"./fieldTypes/BooleanFieldType.js\";\nimport { DateTimeFieldBuilder } from \"./fieldTypes/DateTimeFieldType.js\";\n\nfunction createRegistry(): IFieldBuilderRegistry {\n const container = new Container();\n FormModelFeature.register(container);\n return container.resolve(FieldBuilderRegistry);\n}\n\ndescribe(\"TextFieldBuilder\", () => {\n it(\"should build a text field config with all fluent methods\", () => {\n const builder = new TextFieldBuilder()\n .label(\"Title\")\n .placeholder(\"Enter title\")\n .required(\"Title is required\")\n .defaultValue(\"Untitled\")\n .renderer(\"custom-text\")\n .schema(z.string().min(1));\n\n const config = builder.build(\"title\");\n\n expect(config.name).toBe(\"title\");\n expect(config.type).toBe(\"text\");\n expect(config.label).toBe(\"Title\");\n expect(config.placeholder).toBe(\"Enter title\");\n expect(config.required).toBe(true);\n expect(config.requiredMessage).toBe(\"Title is required\");\n expect(config.defaultValue).toBe(\"Untitled\");\n expect(config.renderer).toBe(\"custom-text\");\n expect(config.hidden).toBe(false);\n expect(config.disabled).toBe(false);\n expect(config.schema).toBeDefined();\n });\n\n it(\"should support hidden() method\", () => {\n const config = new TextFieldBuilder().hidden().build(\"secret\");\n expect(config.hidden).toBe(true);\n });\n\n it(\"should support disabled() method\", () => {\n const config = new TextFieldBuilder().disabled().build(\"readonly\");\n expect(config.disabled).toBe(true);\n });\n\n it(\"should default disabled to false\", () => {\n const config = new TextFieldBuilder().build(\"field\");\n expect(config.disabled).toBe(false);\n });\n});\n\ndescribe(\"TextFieldBuilder - beforeChange / afterChange\", () => {\n it(\"should store beforeChange callbacks in config\", () => {\n const cb1 = (value: unknown) => value;\n const cb2 = (value: unknown) => value;\n\n const config = new TextFieldBuilder().beforeChange(cb1).beforeChange(cb2).build(\"field\");\n\n expect(config.beforeChangeCallbacks).toHaveLength(2);\n expect(config.beforeChangeCallbacks![0]).toBe(cb1);\n expect(config.beforeChangeCallbacks![1]).toBe(cb2);\n });\n\n it(\"should store afterChange callbacks in config\", () => {\n const cb = () => {};\n const config = new TextFieldBuilder().afterChange(cb).build(\"field\");\n\n expect(config.afterChangeCallbacks).toHaveLength(1);\n expect(config.afterChangeCallbacks![0]).toBe(cb);\n });\n\n it(\"should not have callback arrays when none are added\", () => {\n const config = new TextFieldBuilder().build(\"field\");\n expect(config.beforeChangeCallbacks).toBeUndefined();\n expect(config.afterChangeCallbacks).toBeUndefined();\n });\n\n it(\"should support chaining callbacks with other builder methods\", () => {\n const config = new TextFieldBuilder()\n .label(\"Title\")\n .beforeChange(value => value)\n .required(\"Required\")\n .afterChange(() => {})\n .build(\"title\");\n\n expect(config.label).toBe(\"Title\");\n expect(config.required).toBe(true);\n expect(config.beforeChangeCallbacks).toHaveLength(1);\n expect(config.afterChangeCallbacks).toHaveLength(1);\n });\n});\n\ndescribe(\"TextFieldBuilder - options\", () => {\n it(\"should build a text field config with static options\", () => {\n const options = [\n { label: \"English\", value: \"en\" },\n { label: \"German\", value: \"de\" }\n ];\n\n const config = new TextFieldBuilder()\n .label(\"Language\")\n .options(options)\n .required()\n .build(\"language\");\n\n expect(config.name).toBe(\"language\");\n expect(config.type).toBe(\"text\");\n expect(config.label).toBe(\"Language\");\n expect(config.required).toBe(true);\n expect(config.options).toEqual(options);\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should support reactive options function\", () => {\n const optionsFn = () => [{ label: \"A\", value: \"a\" }];\n const config = new TextFieldBuilder().options(optionsFn).build(\"dynamic\");\n expect(typeof config.options).toBe(\"function\");\n });\n\n it(\"should auto-switch renderer to dropdown when options are set\", () => {\n const config = new TextFieldBuilder().options([{ label: \"A\", value: \"a\" }]).build(\"field\");\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should not override an explicitly set renderer\", () => {\n const config = new TextFieldBuilder()\n .renderer(\"radioButtons\")\n .options([{ label: \"A\", value: \"a\" }])\n .build(\"field\");\n expect(config.renderer).toBe(\"radioButtons\");\n });\n});\n\ndescribe(\"NumberFieldBuilder - options\", () => {\n it(\"should build a number field config with options\", () => {\n const options = [\n { label: \"One\", value: \"1\" },\n { label: \"Two\", value: \"2\" }\n ];\n\n const config = new NumberFieldBuilder().label(\"Count\").options(options).build(\"count\");\n\n expect(config.type).toBe(\"number\");\n expect(config.options).toEqual(options);\n expect(config.renderer).toBe(\"dropdown\");\n });\n\n it(\"should not override an explicitly set renderer\", () => {\n const config = new NumberFieldBuilder()\n .renderer(\"radioButtons\")\n .options([{ label: \"1\", value: \"1\" }])\n .build(\"field\");\n expect(config.renderer).toBe(\"radioButtons\");\n });\n});\n\ndescribe(\"DateTimeFieldBuilder\", () => {\n it(\"should build a datetime field with default renderer\", () => {\n const config = new DateTimeFieldBuilder().label(\"Created\").build(\"created\");\n expect(config.type).toBe(\"datetime\");\n expect(config.renderer).toBe(\"dateTimeInput\");\n expect(config.label).toBe(\"Created\");\n });\n});\n\ndescribe(\"FieldBuilderRegistry\", () => {\n it(\"should create text builders via registry.text()\", () => {\n const registry = createRegistry();\n const builder = registry.text();\n expect(builder).toBeInstanceOf(TextFieldBuilder);\n });\n\n it(\"should create number builders via registry.number()\", () => {\n const registry = createRegistry();\n const builder = registry.number();\n expect(builder).toBeInstanceOf(NumberFieldBuilder);\n });\n\n it(\"should create boolean builders via registry.boolean()\", () => {\n const registry = createRegistry();\n const builder = registry.boolean();\n expect(builder).toBeInstanceOf(BooleanFieldBuilder);\n });\n\n it(\"should create datetime builders via registry.datetime()\", () => {\n const registry = createRegistry();\n const builder = registry.datetime();\n expect(builder).toBeInstanceOf(DateTimeFieldBuilder);\n });\n\n it(\"should support chaining on registry-created builders\", () => {\n const registry = createRegistry();\n const config = registry.text().label(\"Name\").required().build(\"name\");\n expect(config.label).toBe(\"Name\");\n expect(config.required).toBe(true);\n });\n\n it(\"should support options on text builders from registry\", () => {\n const registry = createRegistry();\n const config = registry\n .text()\n .options([{ label: \"A\", value: \"a\" }])\n .build(\"field\");\n expect(config.options).toHaveLength(1);\n expect(config.renderer).toBe(\"dropdown\");\n });\n});\n\ndescribe(\"normalizeValue\", () => {\n it(\"should be identity for TextFieldBuilder\", () => {\n const builder = new TextFieldBuilder();\n expect(builder.normalizeValue(\"hello\")).toBe(\"hello\");\n expect(builder.normalizeValue(42)).toBe(42);\n expect(builder.normalizeValue(null)).toBe(null);\n });\n\n it(\"should coerce string to number for NumberFieldBuilder\", () => {\n const builder = new NumberFieldBuilder();\n expect(builder.normalizeValue(\"42\")).toBe(42);\n expect(builder.normalizeValue(\"3.14\")).toBe(3.14);\n expect(builder.normalizeValue(\"0\")).toBe(0);\n });\n\n it(\"should return null for non-numeric values in NumberFieldBuilder\", () => {\n const builder = new NumberFieldBuilder();\n expect(builder.normalizeValue(null)).toBe(null);\n expect(builder.normalizeValue(undefined)).toBe(null);\n expect(builder.normalizeValue(\"\")).toBe(null);\n expect(builder.normalizeValue(\"abc\")).toBe(null);\n });\n\n it(\"should coerce to boolean for BooleanFieldBuilder\", () => {\n const builder = new BooleanFieldBuilder();\n expect(builder.normalizeValue(1)).toBe(true);\n expect(builder.normalizeValue(0)).toBe(false);\n expect(builder.normalizeValue(\"\")).toBe(false);\n expect(builder.normalizeValue(\"yes\")).toBe(true);\n expect(builder.normalizeValue(null)).toBe(false);\n });\n\n it(\"should be identity for DateTimeFieldBuilder\", () => {\n const builder = new DateTimeFieldBuilder();\n expect(builder.normalizeValue(\"2024-01-01\")).toBe(\"2024-01-01\");\n expect(builder.normalizeValue(null)).toBe(null);\n });\n\n it(\"should capture normalizeValue into config at build time\", () => {\n const config = new NumberFieldBuilder().label(\"Count\").build(\"count\");\n expect(config.normalizeValue).toBeDefined();\n expect(config.normalizeValue!(\"42\")).toBe(42);\n expect(config.normalizeValue!(null)).toBe(null);\n });\n});\n"],"names":["createRegistry","container","Container","FormModelFeature","FieldBuilderRegistry","describe","it","builder","TextFieldBuilder","z","config","expect","cb1","value","cb2","cb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OJ,QAAQ,cAAc,CAAC,IAAI,IAAI,CAAC;QACvCI,OAAOJ,QAAQ,cAAc,CAAC,IAAI,IAAI,CAAC;QACvCI,OAAOJ,QAAQ,cAAc,CAAC,KAAK,IAAI,CAAC;QACxCI,OAAOJ,QAAQ,cAAc,CAAC,QAAQ,IAAI,CAAC;QAC3CI,OAAOJ,QAAQ,cAAc,CAAC,OAAO,IAAI,CAAC;IAC9C;IAEAD,GAAG,+CAA+C;QAC9C,MAAMC,UAAU,IAAIY;QACpBR,OAAOJ,QAAQ,cAAc,CAAC,eAAe,IAAI,CAAC;QAClDI,OAAOJ,QAAQ,cAAc,CAAC,OAAO,IAAI,CAAC;IAC9C;IAEAD,GAAG,2DAA2D;QAC1D,MAAMI,SAAS,IAAIQ,qBAAqB,KAAK,CAAC,SAAS,KAAK,CAAC;QAC7DP,OAAOD,OAAO,cAAc,EAAE,WAAW;QACzCC,OAAOD,OAAO,cAAc,CAAE,OAAO,IAAI,CAAC;QAC1CC,OAAOD,OAAO,cAAc,CAAE,OAAO,IAAI,CAAC;IAC9C;AACJ"}
@@ -1,31 +1,29 @@
1
- import { FieldBuilderRegistry as Abstraction, FieldType } from "./abstractions.js";
2
-
3
- // @ts-expect-error The interface is augmented dynamically, and TS complains about those dynamic methods.
1
+ import { FieldBuilderRegistry, FieldType } from "./abstractions.js";
4
2
  class FieldBuilderRegistryImpl {
5
- fieldTypes = new Map();
6
- constructor(factories) {
7
- for (const factory of factories) {
8
- this.fieldTypes.set(factory.type, factory);
3
+ constructor(factories){
4
+ this.fieldTypes = new Map();
5
+ for (const factory of factories)this.fieldTypes.set(factory.type, factory);
6
+ const proxy = new Proxy(this, {
7
+ get (target, prop) {
8
+ const factory = target.fieldTypes.get(prop);
9
+ if (factory) return ()=>factory.create(proxy);
10
+ return target[prop];
11
+ }
12
+ });
13
+ return proxy;
9
14
  }
10
- const proxy = new Proxy(this, {
11
- get(target, prop) {
12
- const factory = target.fieldTypes.get(prop);
13
- if (factory) {
14
- return () => factory.create(proxy);
15
- }
16
- return target[prop];
17
- }
18
- });
19
- return proxy;
20
- }
21
15
  }
22
- export const FieldBuilderRegistry = Abstraction.createImplementation({
23
- // @ts-expect-error
24
- implementation: FieldBuilderRegistryImpl,
25
- // @ts-expect-error
26
- dependencies: [[FieldType, {
27
- multiple: true
28
- }]]
16
+ const FieldBuilderRegistry_FieldBuilderRegistry = FieldBuilderRegistry.createImplementation({
17
+ implementation: FieldBuilderRegistryImpl,
18
+ dependencies: [
19
+ [
20
+ FieldType,
21
+ {
22
+ multiple: true
23
+ }
24
+ ]
25
+ ]
29
26
  });
27
+ export { FieldBuilderRegistry_FieldBuilderRegistry as FieldBuilderRegistry };
30
28
 
31
29
  //# sourceMappingURL=FieldBuilderRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FieldBuilderRegistry","Abstraction","FieldType","FieldBuilderRegistryImpl","fieldTypes","Map","constructor","factories","factory","set","type","proxy","Proxy","get","target","prop","create","createImplementation","implementation","dependencies","multiple"],"sources":["FieldBuilderRegistry.ts"],"sourcesContent":["import {\n FieldBuilderRegistry as Abstraction,\n FieldType,\n type IFieldBuilderRegistry\n} from \"./abstractions.js\";\n\n// @ts-expect-error The interface is augmented dynamically, and TS complains about those dynamic methods.\nclass FieldBuilderRegistryImpl implements Abstraction.Interface {\n private fieldTypes = new Map<string, FieldType.Interface>();\n\n constructor(factories: FieldType.Interface[]) {\n for (const factory of factories) {\n this.fieldTypes.set(factory.type, factory);\n }\n\n const proxy = new Proxy(this, {\n get(target, prop: string) {\n const factory = target.fieldTypes.get(prop);\n if (factory) {\n return () => factory.create(proxy as unknown as IFieldBuilderRegistry);\n }\n return target[prop as keyof typeof target];\n }\n }) as any;\n\n return proxy;\n }\n}\n\nexport const FieldBuilderRegistry = Abstraction.createImplementation({\n // @ts-expect-error\n implementation: FieldBuilderRegistryImpl,\n // @ts-expect-error\n dependencies: [[FieldType, { multiple: true }]]\n});\n"],"mappings":"AAAA,SACIA,oBAAoB,IAAIC,WAAW,EACnCC,SAAS;;AAIb;AACA,MAAMC,wBAAwB,CAAkC;EACpDC,UAAU,GAAG,IAAIC,GAAG,CAA8B,CAAC;EAE3DC,WAAWA,CAACC,SAAgC,EAAE;IAC1C,KAAK,MAAMC,OAAO,IAAID,SAAS,EAAE;MAC7B,IAAI,CAACH,UAAU,CAACK,GAAG,CAACD,OAAO,CAACE,IAAI,EAAEF,OAAO,CAAC;IAC9C;IAEA,MAAMG,KAAK,GAAG,IAAIC,KAAK,CAAC,IAAI,EAAE;MAC1BC,GAAGA,CAACC,MAAM,EAAEC,IAAY,EAAE;QACtB,MAAMP,OAAO,GAAGM,MAAM,CAACV,UAAU,CAACS,GAAG,CAACE,IAAI,CAAC;QAC3C,IAAIP,OAAO,EAAE;UACT,OAAO,MAAMA,OAAO,CAACQ,MAAM,CAACL,KAAyC,CAAC;QAC1E;QACA,OAAOG,MAAM,CAACC,IAAI,CAAwB;MAC9C;IACJ,CAAC,CAAQ;IAET,OAAOJ,KAAK;EAChB;AACJ;AAEA,OAAO,MAAMX,oBAAoB,GAAGC,WAAW,CAACgB,oBAAoB,CAAC;EACjE;EACAC,cAAc,EAAEf,wBAAwB;EACxC;EACAgB,YAAY,EAAE,CAAC,CAACjB,SAAS,EAAE;IAAEkB,QAAQ,EAAE;EAAK,CAAC,CAAC;AAClD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/formModel/FieldBuilderRegistry.js","sources":["../../../src/features/formModel/FieldBuilderRegistry.ts"],"sourcesContent":["import {\n FieldBuilderRegistry as Abstraction,\n FieldType,\n type IFieldBuilderRegistry\n} from \"./abstractions.js\";\n\n// @ts-expect-error The interface is augmented dynamically, and TS complains about those dynamic methods.\nclass FieldBuilderRegistryImpl implements Abstraction.Interface {\n private fieldTypes = new Map<string, FieldType.Interface>();\n\n constructor(factories: FieldType.Interface[]) {\n for (const factory of factories) {\n this.fieldTypes.set(factory.type, factory);\n }\n\n const proxy = new Proxy(this, {\n get(target, prop: string) {\n const factory = target.fieldTypes.get(prop);\n if (factory) {\n return () => factory.create(proxy as unknown as IFieldBuilderRegistry);\n }\n return target[prop as keyof typeof target];\n }\n }) as any;\n\n return proxy;\n }\n}\n\nexport const FieldBuilderRegistry = Abstraction.createImplementation({\n // @ts-expect-error\n implementation: FieldBuilderRegistryImpl,\n // @ts-expect-error\n dependencies: [[FieldType, { multiple: true }]]\n});\n"],"names":["FieldBuilderRegistryImpl","factories","Map","factory","proxy","Proxy","target","prop","FieldBuilderRegistry","Abstraction","FieldType"],"mappings":";AAOA,MAAMA;IAGF,YAAYC,SAAgC,CAAE;aAFtC,UAAU,GAAG,IAAIC;QAGrB,KAAK,MAAMC,WAAWF,UAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAACE,QAAQ,IAAI,EAAEA;QAGtC,MAAMC,QAAQ,IAAIC,MAAM,IAAI,EAAE;YAC1B,KAAIC,MAAM,EAAEC,IAAY;gBACpB,MAAMJ,UAAUG,OAAO,UAAU,CAAC,GAAG,CAACC;gBACtC,IAAIJ,SACA,OAAO,IAAMA,QAAQ,MAAM,CAACC;gBAEhC,OAAOE,MAAM,CAACC,KAA4B;YAC9C;QACJ;QAEA,OAAOH;IACX;AACJ;AAEO,MAAMI,4CAAuBC,qBAAAA,oBAAgC,CAAC;IAEjE,gBAAgBT;IAEhB,cAAc;QAAC;YAACU;YAAW;gBAAE,UAAU;YAAK;SAAE;KAAC;AACnD"}