@webiny/app-admin 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.9bd236cf5e

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 (657) hide show
  1. package/assets/icons/file_download.svg +1 -0
  2. package/assets/icons/file_upload.svg +1 -0
  3. package/base/Admin.d.ts +2 -2
  4. package/base/Admin.js +27 -41
  5. package/base/Admin.js.map +1 -1
  6. package/base/Base/Menus/SupportMenuItems.d.ts +2 -0
  7. package/base/Base/Menus/SupportMenuItems.js +20 -0
  8. package/base/Base/Menus/SupportMenuItems.js.map +1 -0
  9. package/base/Base/Menus/WebinyVersion.d.ts +2 -0
  10. package/base/Base/Menus/WebinyVersion.js +24 -0
  11. package/base/Base/Menus/WebinyVersion.js.map +1 -0
  12. package/base/Base/Menus.d.ts +2 -0
  13. package/base/Base/Menus.js +129 -0
  14. package/base/Base/Menus.js.map +1 -0
  15. package/base/Base/Routes.d.ts +2 -0
  16. package/base/Base/Routes.js +24 -0
  17. package/base/Base/Routes.js.map +1 -0
  18. package/base/Base/Tenant/wby-logo.svg +3 -0
  19. package/base/Base/Tenant.d.ts +2 -0
  20. package/base/Base/Tenant.js +19 -0
  21. package/base/Base/Tenant.js.map +1 -0
  22. package/base/Base.d.ts +1 -1
  23. package/base/Base.js +13 -74
  24. package/base/Base.js.map +1 -1
  25. package/base/WebinyVersion.d.ts +2 -0
  26. package/base/WebinyVersion.js +24 -0
  27. package/base/WebinyVersion.js.map +1 -0
  28. package/base/plugins/AddGraphQLQuerySelection.d.ts +2 -3
  29. package/base/plugins/AddGraphQLQuerySelection.js +13 -22
  30. package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
  31. package/base/providers/AdminUiStateProvider.d.ts +1 -0
  32. package/base/providers/AdminUiStateProvider.js +14 -0
  33. package/base/providers/AdminUiStateProvider.js.map +1 -0
  34. package/base/providers/ApolloProvider.d.ts +5 -2
  35. package/base/providers/ApolloProvider.js +11 -16
  36. package/base/providers/ApolloProvider.js.map +1 -1
  37. package/base/providers/TelemetryProvider.d.ts +1 -2
  38. package/base/providers/TelemetryProvider.js +15 -24
  39. package/base/providers/TelemetryProvider.js.map +1 -1
  40. package/base/providers/UiProviders.d.ts +1 -0
  41. package/base/providers/UiProviders.js +14 -0
  42. package/base/providers/UiProviders.js.map +1 -0
  43. package/base/providers/UiStateProvider.d.ts +1 -2
  44. package/base/providers/UiStateProvider.js +12 -16
  45. package/base/providers/UiStateProvider.js.map +1 -1
  46. package/base/providers/ViewCompositionProvider.d.ts +5 -1
  47. package/base/providers/ViewCompositionProvider.js +35 -45
  48. package/base/providers/ViewCompositionProvider.js.map +1 -1
  49. package/base/ui/Brand.d.ts +39 -2
  50. package/base/ui/Brand.js +7 -14
  51. package/base/ui/Brand.js.map +1 -1
  52. package/base/ui/CenteredView.d.ts +21 -1
  53. package/base/ui/CenteredView.js +14 -34
  54. package/base/ui/CenteredView.js.map +1 -1
  55. package/base/ui/Dashboard.d.ts +39 -2
  56. package/base/ui/Dashboard.js +7 -14
  57. package/base/ui/Dashboard.js.map +1 -1
  58. package/base/ui/FileManager.d.ts +28 -10
  59. package/base/ui/FileManager.js +51 -53
  60. package/base/ui/FileManager.js.map +1 -1
  61. package/base/ui/Layout.d.ts +40 -2
  62. package/base/ui/Layout.js +10 -18
  63. package/base/ui/Layout.js.map +1 -1
  64. package/base/ui/LocaleSelector.d.ts +39 -2
  65. package/base/ui/LocaleSelector.js +7 -14
  66. package/base/ui/LocaleSelector.js.map +1 -1
  67. package/base/ui/LoginScreen.d.ts +21 -2
  68. package/base/ui/LoginScreen.js +21 -17
  69. package/base/ui/LoginScreen.js.map +1 -1
  70. package/base/ui/Logo.d.ts +38 -7
  71. package/base/ui/Logo.js +7 -29
  72. package/base/ui/Logo.js.map +1 -1
  73. package/base/ui/Navigation.d.ts +39 -23
  74. package/base/ui/Navigation.js +14 -146
  75. package/base/ui/Navigation.js.map +1 -1
  76. package/base/ui/NotFound.d.ts +39 -2
  77. package/base/ui/NotFound.js +7 -14
  78. package/base/ui/NotFound.js.map +1 -1
  79. package/base/ui/Tags.d.ts +2 -2
  80. package/base/ui/Tags.js +16 -18
  81. package/base/ui/Tags.js.map +1 -1
  82. package/base/ui/TenantSelector.d.ts +39 -0
  83. package/base/ui/TenantSelector.js +8 -0
  84. package/base/ui/TenantSelector.js.map +1 -0
  85. package/base/ui/UserMenu/UserMenu.d.ts +39 -0
  86. package/base/ui/UserMenu/UserMenu.js +8 -0
  87. package/base/ui/UserMenu/UserMenu.js.map +1 -0
  88. package/base/ui/UserMenu/UserMenuHandle.d.ts +39 -0
  89. package/base/ui/UserMenu/UserMenuHandle.js +8 -0
  90. package/base/ui/UserMenu/UserMenuHandle.js.map +1 -0
  91. package/base/ui/UserMenu/UserMenuItem.d.ts +81 -0
  92. package/base/ui/UserMenu/UserMenuItem.js +19 -0
  93. package/base/ui/UserMenu/UserMenuItem.js.map +1 -0
  94. package/base/ui/UserMenu/UserMenuLink.d.ts +81 -0
  95. package/base/ui/UserMenu/UserMenuLink.js +19 -0
  96. package/base/ui/UserMenu/UserMenuLink.js.map +1 -0
  97. package/base/ui/UserMenu/UserMenuSeparator.d.ts +42 -0
  98. package/base/ui/UserMenu/UserMenuSeparator.js +9 -0
  99. package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -0
  100. package/base/ui/UserMenu.d.ts +79 -29
  101. package/base/ui/UserMenu.js +16 -110
  102. package/base/ui/UserMenu.js.map +1 -1
  103. package/components/AdminLayout.d.ts +2 -1
  104. package/components/AdminLayout.js +9 -14
  105. package/components/AdminLayout.js.map +1 -1
  106. package/components/AppInstaller/AppInstaller.d.ts +5 -1
  107. package/components/AppInstaller/AppInstaller.js +63 -67
  108. package/components/AppInstaller/AppInstaller.js.map +1 -1
  109. package/components/AppInstaller/Sidebar.d.ts +2 -2
  110. package/components/AppInstaller/Sidebar.js +71 -108
  111. package/components/AppInstaller/Sidebar.js.map +1 -1
  112. package/components/AppInstaller/index.d.ts +2 -2
  113. package/components/AppInstaller/index.js +12 -17
  114. package/components/AppInstaller/index.js.map +1 -1
  115. package/components/AppInstaller/styled.d.ts +4 -6
  116. package/components/AppInstaller/styled.js +57 -69
  117. package/components/AppInstaller/styled.js.map +1 -1
  118. package/components/AppInstaller/useInstaller.d.ts +1 -1
  119. package/components/AppInstaller/useInstaller.js +97 -138
  120. package/components/AppInstaller/useInstaller.js.map +1 -1
  121. package/components/BulkActions/Worker.d.ts +83 -0
  122. package/components/BulkActions/Worker.js +126 -0
  123. package/components/BulkActions/Worker.js.map +1 -0
  124. package/components/BulkActions/index.d.ts +2 -0
  125. package/components/BulkActions/index.js +4 -0
  126. package/components/BulkActions/index.js.map +1 -0
  127. package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +5 -0
  128. package/components/BulkActions/useDialogWithReport/DialogMessage.js +23 -0
  129. package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -0
  130. package/components/BulkActions/useDialogWithReport/index.d.ts +1 -0
  131. package/components/BulkActions/useDialogWithReport/index.js +3 -0
  132. package/components/BulkActions/useDialogWithReport/index.js.map +1 -0
  133. package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +19 -0
  134. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +51 -0
  135. package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -0
  136. package/components/Buttons/Buttons.d.ts +24 -0
  137. package/components/Buttons/Buttons.js +77 -0
  138. package/components/Buttons/Buttons.js.map +1 -0
  139. package/components/Buttons/Buttons.styles.d.ts +5 -0
  140. package/components/Buttons/Buttons.styles.js +18 -0
  141. package/components/Buttons/Buttons.styles.js.map +1 -0
  142. package/components/Buttons/index.d.ts +2 -0
  143. package/components/Buttons/index.js +4 -0
  144. package/components/Buttons/index.js.map +1 -0
  145. package/components/Buttons/useButtons.d.ts +14 -0
  146. package/components/Buttons/useButtons.js +24 -0
  147. package/components/Buttons/useButtons.js.map +1 -0
  148. package/components/Dialogs/CustomDialog.d.ts +17 -0
  149. package/components/Dialogs/CustomDialog.js +48 -0
  150. package/components/Dialogs/CustomDialog.js.map +1 -0
  151. package/components/Dialogs/Dialog.d.ts +21 -0
  152. package/components/Dialogs/Dialog.js +62 -0
  153. package/components/Dialogs/Dialog.js.map +1 -0
  154. package/components/Dialogs/DialogsContext.d.ts +43 -0
  155. package/components/Dialogs/DialogsContext.js +141 -0
  156. package/components/Dialogs/DialogsContext.js.map +1 -0
  157. package/components/Dialogs/useDialogs.d.ts +3 -0
  158. package/components/Dialogs/useDialogs.js +12 -0
  159. package/components/Dialogs/useDialogs.js.map +1 -0
  160. package/components/EmptyView.d.ts +4 -3
  161. package/components/EmptyView.js +31 -58
  162. package/components/EmptyView.js.map +1 -1
  163. package/components/Filters/Filters.d.ts +16 -0
  164. package/components/Filters/Filters.js +21 -0
  165. package/components/Filters/Filters.js.map +1 -0
  166. package/components/Filters/FiltersToggle.d.ts +7 -0
  167. package/components/Filters/FiltersToggle.js +26 -0
  168. package/components/Filters/FiltersToggle.js.map +1 -0
  169. package/components/Filters/index.d.ts +2 -0
  170. package/components/Filters/index.js +4 -0
  171. package/components/Filters/index.js.map +1 -0
  172. package/components/FloatingActionButton.d.ts +4 -1
  173. package/components/FloatingActionButton.js +9 -14
  174. package/components/FloatingActionButton.js.map +1 -1
  175. package/components/FloatingPanel.d.ts +13 -0
  176. package/components/FloatingPanel.js +96 -0
  177. package/components/FloatingPanel.js.map +1 -0
  178. package/components/IconPicker/IconPicker.d.ts +13 -0
  179. package/components/IconPicker/IconPicker.js +39 -0
  180. package/components/IconPicker/IconPicker.js.map +1 -0
  181. package/components/IconPicker/IconPickerComponent.d.ts +17 -0
  182. package/components/IconPicker/IconPickerComponent.js +81 -0
  183. package/components/IconPicker/IconPickerComponent.js.map +1 -0
  184. package/components/IconPicker/IconPickerPresenter.d.ts +53 -0
  185. package/components/IconPicker/IconPickerPresenter.js +77 -0
  186. package/components/IconPicker/IconPickerPresenter.js.map +1 -0
  187. package/components/IconPicker/IconPickerPresenter.test.d.ts +1 -0
  188. package/components/IconPicker/IconPickerPresenter.test.js +109 -0
  189. package/components/IconPicker/IconPickerPresenter.test.js.map +1 -0
  190. package/components/IconPicker/IconPickerPresenterProvider.d.ts +9 -0
  191. package/components/IconPicker/IconPickerPresenterProvider.js +19 -0
  192. package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -0
  193. package/components/IconPicker/IconPickerTab.d.ts +33 -0
  194. package/components/IconPicker/IconPickerTab.js +159 -0
  195. package/components/IconPicker/IconPickerTab.js.map +1 -0
  196. package/components/IconPicker/IconRenderer.d.ts +34 -0
  197. package/components/IconPicker/IconRenderer.js +27 -0
  198. package/components/IconPicker/IconRenderer.js.map +1 -0
  199. package/components/IconPicker/IconRepository.d.ts +19 -0
  200. package/components/IconPicker/IconRepository.js +47 -0
  201. package/components/IconPicker/IconRepository.js.map +1 -0
  202. package/components/IconPicker/IconRepository.test.d.ts +1 -0
  203. package/components/IconPicker/IconRepository.test.js +66 -0
  204. package/components/IconPicker/IconRepository.test.js.map +1 -0
  205. package/components/IconPicker/IconRepositoryFactory.d.ts +9 -0
  206. package/components/IconPicker/IconRepositoryFactory.js +17 -0
  207. package/components/IconPicker/IconRepositoryFactory.js.map +1 -0
  208. package/components/IconPicker/Loading.d.ts +14 -0
  209. package/components/IconPicker/Loading.js +50 -0
  210. package/components/IconPicker/Loading.js.map +1 -0
  211. package/components/IconPicker/components/IconPickerCell.d.ts +12 -0
  212. package/components/IconPicker/components/IconPickerCell.js +27 -0
  213. package/components/IconPicker/components/IconPickerCell.js.map +1 -0
  214. package/components/IconPicker/components/IconPickerContent.d.ts +11 -0
  215. package/components/IconPicker/components/IconPickerContent.js +41 -0
  216. package/components/IconPicker/components/IconPickerContent.js.map +1 -0
  217. package/components/IconPicker/components/IconPickerRow.d.ts +4 -0
  218. package/components/IconPicker/components/IconPickerRow.js +14 -0
  219. package/components/IconPicker/components/IconPickerRow.js.map +1 -0
  220. package/components/IconPicker/components/IconPickerTrigger.d.ts +13 -0
  221. package/components/IconPicker/components/IconPickerTrigger.js +52 -0
  222. package/components/IconPicker/components/IconPickerTrigger.js.map +1 -0
  223. package/components/IconPicker/components/index.d.ts +4 -0
  224. package/components/IconPicker/components/index.js +6 -0
  225. package/components/IconPicker/components/index.js.map +1 -0
  226. package/components/IconPicker/config/Emojis.d.ts +2 -0
  227. package/components/IconPicker/config/Emojis.js +24 -0
  228. package/components/IconPicker/config/Emojis.js.map +1 -0
  229. package/components/IconPicker/config/FontAwesomeIcons.d.ts +2 -0
  230. package/components/IconPicker/config/FontAwesomeIcons.js +61 -0
  231. package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -0
  232. package/components/IconPicker/config/IconPackProvider.d.ts +7 -0
  233. package/components/IconPicker/config/IconPackProvider.js +23 -0
  234. package/components/IconPicker/config/IconPackProvider.js.map +1 -0
  235. package/components/IconPicker/config/IconType.d.ts +32 -0
  236. package/components/IconPicker/config/IconType.js +89 -0
  237. package/components/IconPicker/config/IconType.js.map +1 -0
  238. package/components/IconPicker/config/index.d.ts +31 -0
  239. package/components/IconPicker/config/index.js +45 -0
  240. package/components/IconPicker/config/index.js.map +1 -0
  241. package/components/IconPicker/defaultIcon.d.ts +6 -0
  242. package/components/IconPicker/defaultIcon.js +8 -0
  243. package/components/IconPicker/defaultIcon.js.map +1 -0
  244. package/components/IconPicker/index.d.ts +7 -0
  245. package/components/IconPicker/index.js +8 -0
  246. package/components/IconPicker/index.js.map +1 -0
  247. package/components/IconPicker/plugins/customPlugin.d.ts +2 -0
  248. package/components/IconPicker/plugins/customPlugin.js +132 -0
  249. package/components/IconPicker/plugins/customPlugin.js.map +1 -0
  250. package/components/IconPicker/plugins/emojisPlugin.d.ts +2 -0
  251. package/components/IconPicker/plugins/emojisPlugin.js +127 -0
  252. package/components/IconPicker/plugins/emojisPlugin.js.map +1 -0
  253. package/components/IconPicker/plugins/graphql.d.ts +20 -0
  254. package/components/IconPicker/plugins/graphql.js +27 -0
  255. package/components/IconPicker/plugins/graphql.js.map +1 -0
  256. package/components/IconPicker/plugins/iconsPlugin.d.ts +2 -0
  257. package/components/IconPicker/plugins/iconsPlugin.js +115 -0
  258. package/components/IconPicker/plugins/iconsPlugin.js.map +1 -0
  259. package/components/IconPicker/types.d.ts +22 -0
  260. package/components/IconPicker/types.js +10 -0
  261. package/components/IconPicker/types.js.map +1 -0
  262. package/components/LexicalEditor/LexicalEditor.d.ts +5 -5
  263. package/components/LexicalEditor/LexicalEditor.js +28 -27
  264. package/components/LexicalEditor/LexicalEditor.js.map +1 -1
  265. package/components/LexicalEditor/index.js +2 -11
  266. package/components/LexicalEditor/index.js.map +1 -1
  267. package/components/MultiImageUpload.d.ts +1 -1
  268. package/components/MultiImageUpload.js +14 -32
  269. package/components/MultiImageUpload.js.map +1 -1
  270. package/components/OptionsMenu/OptionsMenu.d.ts +10 -0
  271. package/components/OptionsMenu/OptionsMenu.js +23 -0
  272. package/components/OptionsMenu/OptionsMenu.js.map +1 -0
  273. package/components/OptionsMenu/OptionsMenuItem.d.ts +10 -0
  274. package/components/OptionsMenu/OptionsMenuItem.js +17 -0
  275. package/components/OptionsMenu/OptionsMenuItem.js.map +1 -0
  276. package/components/OptionsMenu/OptionsMenuLink.d.ts +12 -0
  277. package/components/OptionsMenu/OptionsMenuLink.js +17 -0
  278. package/components/OptionsMenu/OptionsMenuLink.js.map +1 -0
  279. package/components/OptionsMenu/index.d.ts +4 -0
  280. package/components/OptionsMenu/index.js +6 -0
  281. package/components/OptionsMenu/index.js.map +1 -0
  282. package/components/OptionsMenu/useOptionsMenuItem.d.ts +13 -0
  283. package/components/OptionsMenu/useOptionsMenuItem.js +23 -0
  284. package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -0
  285. package/components/OverlayLayout/OverlayLayout.d.ts +6 -17
  286. package/components/OverlayLayout/OverlayLayout.js +45 -153
  287. package/components/OverlayLayout/OverlayLayout.js.map +1 -1
  288. package/components/OverlayLayout/components/OverlayBackdrop.d.ts +7 -0
  289. package/components/OverlayLayout/components/OverlayBackdrop.js +15 -0
  290. package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -0
  291. package/components/OverlayLayout/components/OverlayContent.d.ts +6 -0
  292. package/components/OverlayLayout/components/OverlayContent.js +21 -0
  293. package/components/OverlayLayout/components/OverlayContent.js.map +1 -0
  294. package/components/OverlayLayout/components/OverlayHeader.d.ts +13 -0
  295. package/components/OverlayLayout/components/OverlayHeader.js +44 -0
  296. package/components/OverlayLayout/components/OverlayHeader.js.map +1 -0
  297. package/components/OverlayLayout/components/OverlayRoot.d.ts +9 -0
  298. package/components/OverlayLayout/components/OverlayRoot.js +19 -0
  299. package/components/OverlayLayout/components/OverlayRoot.js.map +1 -0
  300. package/components/OverlayLayout/components/index.d.ts +4 -0
  301. package/components/OverlayLayout/components/index.js +6 -0
  302. package/components/OverlayLayout/components/index.js.map +1 -0
  303. package/components/OverlayLayout/index.js +2 -15
  304. package/components/OverlayLayout/index.js.map +1 -1
  305. package/components/Permissions/CannotUseAaclAlert.d.ts +1 -1
  306. package/components/Permissions/CannotUseAaclAlert.js +7 -13
  307. package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
  308. package/components/Permissions/Permissions.d.ts +3 -3
  309. package/components/Permissions/Permissions.js +39 -49
  310. package/components/Permissions/Permissions.js.map +1 -1
  311. package/components/Permissions/PermissionsGroup.d.ts +6 -0
  312. package/components/Permissions/PermissionsGroup.js +18 -0
  313. package/components/Permissions/PermissionsGroup.js.map +1 -0
  314. package/components/Permissions/StyledComponents.d.ts +2 -3
  315. package/components/Permissions/StyledComponents.js +14 -28
  316. package/components/Permissions/StyledComponents.js.map +1 -1
  317. package/components/Permissions/index.d.ts +1 -0
  318. package/components/Permissions/index.js +5 -34
  319. package/components/Permissions/index.js.map +1 -1
  320. package/components/ResizablePanels/index.d.ts +1 -0
  321. package/components/ResizablePanels/index.js +3 -0
  322. package/components/ResizablePanels/index.js.map +1 -0
  323. package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
  324. package/components/RichTextEditor/RichTextEditor.js +15 -22
  325. package/components/RichTextEditor/RichTextEditor.js.map +1 -1
  326. package/components/RichTextEditor/index.js +3 -18
  327. package/components/RichTextEditor/index.js.map +1 -1
  328. package/components/RichTextEditor/tools/header/index.d.ts +3 -4
  329. package/components/RichTextEditor/tools/header/index.js +457 -533
  330. package/components/RichTextEditor/tools/header/index.js.map +1 -1
  331. package/components/RichTextEditor/tools/image/index.d.ts +2 -4
  332. package/components/RichTextEditor/tools/image/index.js +149 -191
  333. package/components/RichTextEditor/tools/image/index.js.map +1 -1
  334. package/components/RichTextEditor/tools/image/svgs.js +6 -11
  335. package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
  336. package/components/RichTextEditor/tools/image/tunes.d.ts +2 -4
  337. package/components/RichTextEditor/tools/image/tunes.js +77 -103
  338. package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
  339. package/components/RichTextEditor/tools/image/types.js +2 -4
  340. package/components/RichTextEditor/tools/image/types.js.map +1 -1
  341. package/components/RichTextEditor/tools/image/ui.d.ts +2 -4
  342. package/components/RichTextEditor/tools/image/ui.js +152 -185
  343. package/components/RichTextEditor/tools/image/ui.js.map +1 -1
  344. package/components/RichTextEditor/tools/paragraph/index.d.ts +3 -4
  345. package/components/RichTextEditor/tools/paragraph/index.js +349 -402
  346. package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
  347. package/components/RichTextEditor/tools/textColor/index.d.ts +1 -4
  348. package/components/RichTextEditor/tools/textColor/index.js +165 -213
  349. package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
  350. package/components/RichTextEditor/tools/utils.d.ts +1 -1
  351. package/components/RichTextEditor/tools/utils.js +7 -14
  352. package/components/RichTextEditor/tools/utils.js.map +1 -1
  353. package/components/Routes.d.ts +1 -1
  354. package/components/Routes.js +16 -24
  355. package/components/Routes.js.map +1 -1
  356. package/components/SearchUI.d.ts +2 -1
  357. package/components/SearchUI.js +25 -69
  358. package/components/SearchUI.js.map +1 -1
  359. package/components/SimpleForm/SimpleForm.d.ts +19 -8
  360. package/components/SimpleForm/SimpleForm.js +74 -70
  361. package/components/SimpleForm/SimpleForm.js.map +1 -1
  362. package/components/SimpleForm/index.js +2 -29
  363. package/components/SimpleForm/index.js.map +1 -1
  364. package/components/SimpleUI/InputField.d.ts +3 -3
  365. package/components/SimpleUI/InputField.js +43 -50
  366. package/components/SimpleUI/InputField.js.map +1 -1
  367. package/components/SingleImageUpload.d.ts +22 -4
  368. package/components/SingleImageUpload.js +41 -77
  369. package/components/SingleImageUpload.js.map +1 -1
  370. package/components/SplitView/SplitView.d.ts +10 -8
  371. package/components/SplitView/SplitView.js +53 -72
  372. package/components/SplitView/SplitView.js.map +1 -1
  373. package/components/SplitView/index.js +2 -23
  374. package/components/SplitView/index.js.map +1 -1
  375. package/components/StateInspector.d.ts +8 -0
  376. package/components/StateInspector.js +36 -0
  377. package/components/StateInspector.js.map +1 -0
  378. package/components/Wcp.d.ts +13 -0
  379. package/components/Wcp.js +27 -0
  380. package/components/Wcp.js.map +1 -0
  381. package/components/index.d.ts +2 -0
  382. package/components/index.js +4 -11
  383. package/components/index.js.map +1 -1
  384. package/config/AdminConfig/Menu/MenuGroup.d.ts +62 -0
  385. package/config/AdminConfig/Menu/MenuGroup.js +14 -0
  386. package/config/AdminConfig/Menu/MenuGroup.js.map +1 -0
  387. package/config/AdminConfig/Menu/MenuItem.d.ts +43 -0
  388. package/config/AdminConfig/Menu/MenuItem.js +14 -0
  389. package/config/AdminConfig/Menu/MenuItem.js.map +1 -0
  390. package/config/AdminConfig/Menu/MenuLink.d.ts +43 -0
  391. package/config/AdminConfig/Menu/MenuLink.js +18 -0
  392. package/config/AdminConfig/Menu/MenuLink.js.map +1 -0
  393. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +43 -0
  394. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +13 -0
  395. package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -0
  396. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +24 -0
  397. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +13 -0
  398. package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -0
  399. package/config/AdminConfig/Menu/SupportMenu.d.ts +72 -0
  400. package/config/AdminConfig/Menu/SupportMenu.js +49 -0
  401. package/config/AdminConfig/Menu/SupportMenu.js.map +1 -0
  402. package/config/AdminConfig/Menu/UserMenu/UserMenuItem.d.ts +41 -0
  403. package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +7 -0
  404. package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -0
  405. package/config/AdminConfig/Menu/UserMenu/UserMenuLink.d.ts +41 -0
  406. package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +7 -0
  407. package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -0
  408. package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.d.ts +1 -0
  409. package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +3 -0
  410. package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +1 -0
  411. package/config/AdminConfig/Menu/UserMenu/types.d.ts +7 -0
  412. package/config/AdminConfig/Menu/UserMenu/types.js +3 -0
  413. package/config/AdminConfig/Menu/UserMenu/types.js.map +1 -0
  414. package/config/AdminConfig/Menu/UserMenu.d.ts +129 -0
  415. package/config/AdminConfig/Menu/UserMenu.js +61 -0
  416. package/config/AdminConfig/Menu/UserMenu.js.map +1 -0
  417. package/config/AdminConfig/Menu/types.d.ts +7 -0
  418. package/config/AdminConfig/Menu/types.js +3 -0
  419. package/config/AdminConfig/Menu/types.js.map +1 -0
  420. package/config/AdminConfig/Menu.d.ts +350 -0
  421. package/config/AdminConfig/Menu.js +75 -0
  422. package/config/AdminConfig/Menu.js.map +1 -0
  423. package/config/AdminConfig/Route.d.ts +3 -0
  424. package/config/AdminConfig/Route.js +8 -0
  425. package/config/AdminConfig/Route.js.map +1 -0
  426. package/config/AdminConfig/Tenant/TenantLogo.d.ts +23 -0
  427. package/config/AdminConfig/Tenant/TenantLogo.js +16 -0
  428. package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -0
  429. package/config/AdminConfig/Tenant/TenantName.d.ts +23 -0
  430. package/config/AdminConfig/Tenant/TenantName.js +16 -0
  431. package/config/AdminConfig/Tenant/TenantName.js.map +1 -0
  432. package/config/AdminConfig/Tenant.d.ts +66 -0
  433. package/config/AdminConfig/Tenant.js +23 -0
  434. package/config/AdminConfig/Tenant.js.map +1 -0
  435. package/config/AdminConfig/Theme/assignColor.d.ts +2 -0
  436. package/config/AdminConfig/Theme/assignColor.js +22 -0
  437. package/config/AdminConfig/Theme/assignColor.js.map +1 -0
  438. package/config/AdminConfig/Theme/consts.d.ts +2 -0
  439. package/config/AdminConfig/Theme/consts.js +4 -0
  440. package/config/AdminConfig/Theme/consts.js.map +1 -0
  441. package/config/AdminConfig/Theme/types.d.ts +3 -0
  442. package/config/AdminConfig/Theme/types.js +3 -0
  443. package/config/AdminConfig/Theme/types.js.map +1 -0
  444. package/config/AdminConfig/Theme.d.ts +16 -0
  445. package/config/AdminConfig/Theme.js +22 -0
  446. package/config/AdminConfig/Theme.js.map +1 -0
  447. package/config/AdminConfig.d.ts +434 -0
  448. package/config/AdminConfig.js +47 -0
  449. package/config/AdminConfig.js.map +1 -0
  450. package/config/createAdminConfig.d.ts +57 -0
  451. package/config/createAdminConfig.js +94 -0
  452. package/config/createAdminConfig.js.map +1 -0
  453. package/hooks/index.d.ts +10 -0
  454. package/hooks/index.js +12 -0
  455. package/hooks/index.js.map +1 -0
  456. package/hooks/useConfirmationDialog.d.ts +1 -1
  457. package/hooks/useConfirmationDialog.js +28 -40
  458. package/hooks/useConfirmationDialog.js.map +1 -1
  459. package/hooks/useDialog.d.ts +21 -2
  460. package/hooks/useDialog.js +18 -22
  461. package/hooks/useDialog.js.map +1 -1
  462. package/hooks/useIsMounted.d.ts +3 -0
  463. package/hooks/useIsMounted.js +15 -0
  464. package/hooks/useIsMounted.js.map +1 -0
  465. package/hooks/useKeyHandler.d.ts +8 -0
  466. package/hooks/useKeyHandler.js +64 -0
  467. package/hooks/useKeyHandler.js.map +1 -0
  468. package/hooks/useModKey.d.ts +1 -0
  469. package/hooks/useModKey.js +30 -0
  470. package/hooks/useModKey.js.map +1 -0
  471. package/hooks/useShiftKey.d.ts +1 -0
  472. package/hooks/useShiftKey.js +33 -0
  473. package/hooks/useShiftKey.js.map +1 -0
  474. package/hooks/useSnackbar.d.ts +1 -0
  475. package/hooks/useSnackbar.js +25 -26
  476. package/hooks/useSnackbar.js.map +1 -1
  477. package/hooks/useStateIfMounted.d.ts +2 -0
  478. package/hooks/useStateIfMounted.js +16 -0
  479. package/hooks/useStateIfMounted.js.map +1 -0
  480. package/hooks/useStateWithCallback.d.ts +5 -0
  481. package/hooks/useStateWithCallback.js +18 -0
  482. package/hooks/useStateWithCallback.js.map +1 -0
  483. package/index.d.ts +21 -11
  484. package/index.js +52 -343
  485. package/index.js.map +1 -1
  486. package/package.json +61 -44
  487. package/plugins/MenuPlugin.d.ts +1 -1
  488. package/plugins/MenuPlugin.js +17 -41
  489. package/plugins/MenuPlugin.js.map +1 -1
  490. package/plugins/PermissionRendererPlugin.d.ts +1 -1
  491. package/plugins/PermissionRendererPlugin.js +17 -41
  492. package/plugins/PermissionRendererPlugin.js.map +1 -1
  493. package/plugins/uiLayoutRenderer/index.js +41 -49
  494. package/plugins/uiLayoutRenderer/index.js.map +1 -1
  495. package/styles.scss +7 -2
  496. package/types.d.ts +26 -44
  497. package/types.js +6 -4
  498. package/types.js.map +1 -1
  499. package/ui/UIElement.js +2 -17
  500. package/ui/UIElement.js.map +1 -1
  501. package/ui/UILayout.js +2 -17
  502. package/ui/UILayout.js.map +1 -1
  503. package/ui/UIRenderer.js +2 -11
  504. package/ui/UIRenderer.js.map +1 -1
  505. package/ui/UIView.js +2 -23
  506. package/ui/UIView.js.map +1 -1
  507. package/ui/elements/AccordionElement.d.ts +2 -1
  508. package/ui/elements/AccordionElement.js +45 -81
  509. package/ui/elements/AccordionElement.js.map +1 -1
  510. package/ui/elements/ButtonElement.d.ts +4 -3
  511. package/ui/elements/ButtonElement.js +48 -82
  512. package/ui/elements/ButtonElement.js.map +1 -1
  513. package/ui/elements/ButtonGroupElement.d.ts +2 -1
  514. package/ui/elements/ButtonGroupElement.js +25 -44
  515. package/ui/elements/ButtonGroupElement.js.map +1 -1
  516. package/ui/elements/GenericElement.js +2 -15
  517. package/ui/elements/GenericElement.js.map +1 -1
  518. package/ui/elements/LabelElement.d.ts +3 -2
  519. package/ui/elements/LabelElement.js +17 -40
  520. package/ui/elements/LabelElement.js.map +1 -1
  521. package/ui/elements/NavigationMenuElement.d.ts +5 -4
  522. package/ui/elements/NavigationMenuElement.js +71 -127
  523. package/ui/elements/NavigationMenuElement.js.map +1 -1
  524. package/ui/elements/PanelElement.js +3 -21
  525. package/ui/elements/PanelElement.js.map +1 -1
  526. package/ui/elements/PlaceholderElement.js +10 -32
  527. package/ui/elements/PlaceholderElement.js.map +1 -1
  528. package/ui/elements/SmallButtonElement.d.ts +4 -2
  529. package/ui/elements/SmallButtonElement.js +22 -43
  530. package/ui/elements/SmallButtonElement.js.map +1 -1
  531. package/ui/elements/TypographyElement.d.ts +3 -2
  532. package/ui/elements/TypographyElement.js +22 -47
  533. package/ui/elements/TypographyElement.js.map +1 -1
  534. package/ui/elements/ViewElement.js +2 -15
  535. package/ui/elements/ViewElement.js.map +1 -1
  536. package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +3 -2
  537. package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +19 -37
  538. package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
  539. package/ui/elements/form/DynamicFieldsetElement.d.ts +3 -2
  540. package/ui/elements/form/DynamicFieldsetElement.js +92 -130
  541. package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
  542. package/ui/elements/form/FileManagerElement/EmptyStateElement.js +9 -25
  543. package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
  544. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +4 -3
  545. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +42 -68
  546. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
  547. package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +4 -3
  548. package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +69 -100
  549. package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
  550. package/ui/elements/form/FileManagerElement/styled.d.ts +5 -9
  551. package/ui/elements/form/FileManagerElement/styled.js +86 -93
  552. package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
  553. package/ui/elements/form/FileManagerElement.d.ts +3 -2
  554. package/ui/elements/form/FileManagerElement.js +45 -87
  555. package/ui/elements/form/FileManagerElement.js.map +1 -1
  556. package/ui/elements/form/FormElement.d.ts +3 -2
  557. package/ui/elements/form/FormElement.js +19 -44
  558. package/ui/elements/form/FormElement.js.map +1 -1
  559. package/ui/elements/form/FormFieldElement.d.ts +6 -5
  560. package/ui/elements/form/FormFieldElement.js +101 -161
  561. package/ui/elements/form/FormFieldElement.js.map +1 -1
  562. package/ui/elements/form/HiddenElement.d.ts +2 -1
  563. package/ui/elements/form/HiddenElement.js +23 -45
  564. package/ui/elements/form/HiddenElement.js.map +1 -1
  565. package/ui/elements/form/InputElement.d.ts +3 -2
  566. package/ui/elements/form/InputElement.js +30 -52
  567. package/ui/elements/form/InputElement.js.map +1 -1
  568. package/ui/elements/form/PasswordElement.d.ts +1 -1
  569. package/ui/elements/form/PasswordElement.js +28 -50
  570. package/ui/elements/form/PasswordElement.js.map +1 -1
  571. package/ui/elements/form/SelectElement.d.ts +2 -1
  572. package/ui/elements/form/SelectElement.js +40 -67
  573. package/ui/elements/form/SelectElement.js.map +1 -1
  574. package/ui/elements/form/TextareaElement.d.ts +3 -2
  575. package/ui/elements/form/TextareaElement.js +32 -53
  576. package/ui/elements/form/TextareaElement.js.map +1 -1
  577. package/ui/views/AdminView/ContentElement.js +32 -49
  578. package/ui/views/AdminView/ContentElement.js.map +1 -1
  579. package/ui/views/AdminView/HeaderElement.js +62 -98
  580. package/ui/views/AdminView/HeaderElement.js.map +1 -1
  581. package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -1
  582. package/ui/views/AdminView/HeaderSectionCenterElement.js +19 -40
  583. package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
  584. package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -1
  585. package/ui/views/AdminView/HeaderSectionLeftElement.js +19 -40
  586. package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
  587. package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -1
  588. package/ui/views/AdminView/HeaderSectionRightElement.js +19 -40
  589. package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
  590. package/ui/views/AdminView/components/Dialog.d.ts +1 -1
  591. package/ui/views/AdminView/components/Dialog.js +32 -37
  592. package/ui/views/AdminView/components/Dialog.js.map +1 -1
  593. package/ui/views/AdminView/components/Hamburger.d.ts +1 -1
  594. package/ui/views/AdminView/components/Hamburger.js +14 -22
  595. package/ui/views/AdminView/components/Hamburger.js.map +1 -1
  596. package/ui/views/FormView/FormContainerElement.d.ts +4 -3
  597. package/ui/views/FormView/FormContainerElement.js +18 -49
  598. package/ui/views/FormView/FormContainerElement.js.map +1 -1
  599. package/ui/views/FormView/FormContentElement.d.ts +3 -0
  600. package/ui/views/FormView/FormContentElement.js +9 -21
  601. package/ui/views/FormView/FormContentElement.js.map +1 -1
  602. package/ui/views/FormView/FormFooterElement.d.ts +4 -3
  603. package/ui/views/FormView/FormFooterElement.js +12 -47
  604. package/ui/views/FormView/FormFooterElement.js.map +1 -1
  605. package/ui/views/FormView/FormHeaderElement.d.ts +3 -2
  606. package/ui/views/FormView/FormHeaderElement.js +28 -79
  607. package/ui/views/FormView/FormHeaderElement.js.map +1 -1
  608. package/ui/views/FormView.d.ts +3 -3
  609. package/ui/views/FormView.js +106 -152
  610. package/ui/views/FormView.js.map +1 -1
  611. package/ui/views/OverlayView/ContentElement.d.ts +2 -1
  612. package/ui/views/OverlayView/ContentElement.js +25 -38
  613. package/ui/views/OverlayView/ContentElement.js.map +1 -1
  614. package/ui/views/OverlayView/HeaderElement.d.ts +2 -1
  615. package/ui/views/OverlayView/HeaderElement.js +65 -105
  616. package/ui/views/OverlayView/HeaderElement.js.map +1 -1
  617. package/ui/views/OverlayView/HeaderTitleElement.d.ts +4 -2
  618. package/ui/views/OverlayView/HeaderTitleElement.js +23 -49
  619. package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
  620. package/ui/views/OverlayView/useOverlayView.js +19 -29
  621. package/ui/views/OverlayView/useOverlayView.js.map +1 -1
  622. package/ui/views/OverlayView.d.ts +3 -2
  623. package/ui/views/OverlayView.js +80 -136
  624. package/ui/views/OverlayView.js.map +1 -1
  625. package/ui/views/SplitView/SplitViewPanelElement.d.ts +2 -1
  626. package/ui/views/SplitView/SplitViewPanelElement.js +29 -68
  627. package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
  628. package/ui/views/SplitView.d.ts +1 -1
  629. package/ui/views/SplitView.js +58 -94
  630. package/ui/views/SplitView.js.map +1 -1
  631. package/base/ui/Menu.d.ts +0 -31
  632. package/base/ui/Menu.js +0 -137
  633. package/base/ui/Menu.js.map +0 -1
  634. package/base/ui/Search.d.ts +0 -19
  635. package/base/ui/Search.js +0 -63
  636. package/base/ui/Search.js.map +0 -1
  637. package/components/OverlayLayout/icons/close.svg +0 -13
  638. package/components/OverlayLayout/icons/navigate_before.svg +0 -16
  639. package/plugins/globalSearch/SearchBar.d.ts +0 -15
  640. package/plugins/globalSearch/SearchBar.js +0 -225
  641. package/plugins/globalSearch/SearchBar.js.map +0 -1
  642. package/plugins/globalSearch/SearchBarDropdown.d.ts +0 -23
  643. package/plugins/globalSearch/SearchBarDropdown.js +0 -83
  644. package/plugins/globalSearch/SearchBarDropdown.js.map +0 -1
  645. package/plugins/globalSearch/icons/round-search-24px.svg +0 -20
  646. package/plugins/globalSearch/index.d.ts +0 -7
  647. package/plugins/globalSearch/index.js +0 -16
  648. package/plugins/globalSearch/index.js.map +0 -1
  649. package/plugins/globalSearch/styled.d.ts +0 -20
  650. package/plugins/globalSearch/styled.js +0 -131
  651. package/plugins/globalSearch/styled.js.map +0 -1
  652. package/styles/material-theme-assignments.scss +0 -350
  653. package/styles/material.scss +0 -43
  654. package/styles/theme.scss +0 -76
  655. package/ui/views/AdminView/components/Snackbar.d.ts +0 -3
  656. package/ui/views/AdminView/components/Snackbar.js +0 -32
  657. package/ui/views/AdminView/components/Snackbar.js.map +0 -1
@@ -1,88 +1,46 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FileManagerElement = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
13
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
- var _FormFieldElement2 = require("./FormFieldElement");
15
- var _FileManagerElementRenderer = require("./FileManagerElement/FileManagerElementRenderer");
16
- var _EmptyStateElement = require("./FileManagerElement/EmptyStateElement");
17
- var FileManagerElement = /*#__PURE__*/function (_FormFieldElement) {
18
- (0, _inherits2.default)(FileManagerElement, _FormFieldElement);
19
- var _super = (0, _createSuper2.default)(FileManagerElement);
20
- function FileManagerElement(id, config) {
21
- var _this;
22
- (0, _classCallCheck2.default)(this, FileManagerElement);
23
- _this = _super.call(this, id, config);
24
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_emptyStateElement", void 0);
25
- _this.addRenderer(new _FileManagerElementRenderer.FileManagerElementRenderer());
26
- _this._emptyStateElement = new _EmptyStateElement.EmptyStateElement("emptyState");
27
- _this.applyPlugins(FileManagerElement);
28
- return _this;
1
+ import { FormFieldElement } from "./FormFieldElement";
2
+ import { FileManagerElementRenderer } from "./FileManagerElement/FileManagerElementRenderer";
3
+ import { EmptyStateElement } from "./FileManagerElement/EmptyStateElement";
4
+ export class FileManagerElement extends FormFieldElement {
5
+ constructor(id, config) {
6
+ super(id, config);
7
+ this.addRenderer(new FileManagerElementRenderer());
8
+ this._emptyStateElement = new EmptyStateElement("emptyState");
9
+ this.applyPlugins(FileManagerElement);
10
+ }
11
+ getEmptyStateElement() {
12
+ return this._emptyStateElement;
13
+ }
14
+ getAccept() {
15
+ return this.config.accept;
16
+ }
17
+ setAccept(accept) {
18
+ this.config.accept = accept;
19
+ }
20
+ getMaxSize() {
21
+ return this.config.maxSize;
22
+ }
23
+ setMaxSize(maxSize) {
24
+ this.config.maxSize = maxSize;
25
+ }
26
+ getMultipleMaxCount() {
27
+ return this.config.multipleMaxCount;
29
28
  }
30
- (0, _createClass2.default)(FileManagerElement, [{
31
- key: "getEmptyStateElement",
32
- value: function getEmptyStateElement() {
33
- return this._emptyStateElement;
34
- }
35
- }, {
36
- key: "getAccept",
37
- value: function getAccept() {
38
- return this.config.accept;
39
- }
40
- }, {
41
- key: "setAccept",
42
- value: function setAccept(accept) {
43
- this.config.accept = accept;
44
- }
45
- }, {
46
- key: "getMaxSize",
47
- value: function getMaxSize() {
48
- return this.config.maxSize;
49
- }
50
- }, {
51
- key: "setMaxSize",
52
- value: function setMaxSize(maxSize) {
53
- this.config.maxSize = maxSize;
54
- }
55
- }, {
56
- key: "getMultipleMaxCount",
57
- value: function getMultipleMaxCount() {
58
- return this.config.multipleMaxCount;
59
- }
60
- }, {
61
- key: "setMultipleMaxCount",
62
- value: function setMultipleMaxCount(multipleMaxCount) {
63
- this.config.multipleMaxCount = multipleMaxCount;
64
- }
65
- }, {
66
- key: "getMultipleMaxSize",
67
- value: function getMultipleMaxSize() {
68
- return this.config.multipleMaxSize;
69
- }
70
- }, {
71
- key: "setMultipleMaxSize",
72
- value: function setMultipleMaxSize(multipleMaxSize) {
73
- this.config.multipleMaxSize = multipleMaxSize;
74
- }
75
- }, {
76
- key: "getOnChangePickAttributes",
77
- value: function getOnChangePickAttributes() {
78
- return this.config.onChangePickAttributes;
79
- }
80
- }, {
81
- key: "setOnChangePickAttributes",
82
- value: function setOnChangePickAttributes(attributes) {
83
- this.config.onChangePickAttributes = attributes;
84
- }
85
- }]);
86
- return FileManagerElement;
87
- }(_FormFieldElement2.FormFieldElement);
88
- exports.FileManagerElement = FileManagerElement;
29
+ setMultipleMaxCount(multipleMaxCount) {
30
+ this.config.multipleMaxCount = multipleMaxCount;
31
+ }
32
+ getMultipleMaxSize() {
33
+ return this.config.multipleMaxSize;
34
+ }
35
+ setMultipleMaxSize(multipleMaxSize) {
36
+ this.config.multipleMaxSize = multipleMaxSize;
37
+ }
38
+ getOnChangePickAttributes() {
39
+ return this.config.onChangePickAttributes;
40
+ }
41
+ setOnChangePickAttributes(attributes) {
42
+ this.config.onChangePickAttributes = attributes;
43
+ }
44
+ }
45
+
46
+ //# sourceMappingURL=FileManagerElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FileManagerElement","id","config","addRenderer","FileManagerElementRenderer","_emptyStateElement","EmptyStateElement","applyPlugins","accept","maxSize","multipleMaxCount","multipleMaxSize","onChangePickAttributes","attributes","FormFieldElement"],"sources":["FileManagerElement.tsx"],"sourcesContent":["import { UIElement } from \"~/ui/UIElement\";\nimport { FormFieldElement, FormFieldElementConfig } from \"./FormFieldElement\";\nimport { FileManagerElementRenderer } from \"./FileManagerElement/FileManagerElementRenderer\";\nimport { EmptyStateElement } from \"./FileManagerElement/EmptyStateElement\";\n\nexport interface FileManagerElementConfig extends FormFieldElementConfig {\n // Define mime types that will be shown and accepted by FileManager\n accept?: string[];\n\n // Define file's max allowed size (default is \"10mb\").\n // Uses \"bytes\" (https://www.npmjs.com/package/bytes) library to convert string notation to actual number.\n maxSize?: number | string;\n\n // Max number of files in a single batch.\n multipleMaxCount?: number;\n\n // Max size of files in a single batch.\n multipleMaxSize?: number | string;\n\n // Define properties that are returned on file(s) selection.\n onChangePickAttributes?: string[];\n\n // Define whether multiple files can be selected1.\n // TODO: multiple?: boolean; - create a new renderer for \"multiple=true\" to render multiple files\n // It should work as in Headless CMS content entry form, see that for an example.\n}\n\nexport class FileManagerElement extends FormFieldElement<FileManagerElementConfig> {\n private readonly _emptyStateElement: UIElement;\n\n public constructor(id: string, config: FileManagerElementConfig) {\n super(id, config);\n\n this.addRenderer(new FileManagerElementRenderer());\n\n this._emptyStateElement = new EmptyStateElement(\"emptyState\");\n\n this.applyPlugins(FileManagerElement);\n }\n\n public getEmptyStateElement() {\n return this._emptyStateElement;\n }\n\n public getAccept() {\n return this.config.accept;\n }\n\n public setAccept(accept: string[]) {\n this.config.accept = accept;\n }\n\n public getMaxSize() {\n return this.config.maxSize;\n }\n\n public setMaxSize(maxSize: number | string) {\n this.config.maxSize = maxSize;\n }\n\n public getMultipleMaxCount() {\n return this.config.multipleMaxCount;\n }\n\n public setMultipleMaxCount(multipleMaxCount: number) {\n this.config.multipleMaxCount = multipleMaxCount;\n }\n\n public getMultipleMaxSize() {\n return this.config.multipleMaxSize;\n }\n\n public setMultipleMaxSize(multipleMaxSize: number | string) {\n this.config.multipleMaxSize = multipleMaxSize;\n }\n\n public getOnChangePickAttributes() {\n return this.config.onChangePickAttributes;\n }\n\n public setOnChangePickAttributes(attributes: string[]) {\n this.config.onChangePickAttributes = attributes;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA;AACA;AACA;A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EAAE;MACnD,IAAI,CAACX,MAAM,CAACU,sBAAsB,GAAGC,UAAU;IACnD;EAAC;EAAA;AAAA,EAvDmCC,mCAAgB;AAAA"}
1
+ {"version":3,"names":["FormFieldElement","FileManagerElementRenderer","EmptyStateElement","FileManagerElement","constructor","id","config","addRenderer","_emptyStateElement","applyPlugins","getEmptyStateElement","getAccept","accept","setAccept","getMaxSize","maxSize","setMaxSize","getMultipleMaxCount","multipleMaxCount","setMultipleMaxCount","getMultipleMaxSize","multipleMaxSize","setMultipleMaxSize","getOnChangePickAttributes","onChangePickAttributes","setOnChangePickAttributes","attributes"],"sources":["FileManagerElement.tsx"],"sourcesContent":["import type { UIElement } from \"~/ui/UIElement\";\nimport type { FormFieldElementConfig } from \"./FormFieldElement\";\nimport { FormFieldElement } from \"./FormFieldElement\";\nimport { FileManagerElementRenderer } from \"./FileManagerElement/FileManagerElementRenderer\";\nimport { EmptyStateElement } from \"./FileManagerElement/EmptyStateElement\";\n\nexport interface FileManagerElementConfig extends FormFieldElementConfig {\n // Define mime types that will be shown and accepted by FileManager\n accept?: string[];\n\n // Define file's max allowed size (default is \"10mb\").\n // Uses \"bytes\" (https://www.npmjs.com/package/bytes) library to convert string notation to actual number.\n maxSize?: number | string;\n\n // Max number of files in a single batch.\n multipleMaxCount?: number;\n\n // Max size of files in a single batch.\n multipleMaxSize?: number | string;\n\n // Define properties that are returned on file(s) selection.\n onChangePickAttributes?: string[];\n\n // Define whether multiple files can be selected1.\n // TODO: multiple?: boolean; - create a new renderer for \"multiple=true\" to render multiple files\n // It should work as in Headless CMS content entry form, see that for an example.\n}\n\nexport class FileManagerElement extends FormFieldElement<FileManagerElementConfig> {\n private readonly _emptyStateElement: UIElement;\n\n public constructor(id: string, config: FileManagerElementConfig) {\n super(id, config);\n\n this.addRenderer(new FileManagerElementRenderer());\n\n this._emptyStateElement = new EmptyStateElement(\"emptyState\");\n\n this.applyPlugins(FileManagerElement);\n }\n\n public getEmptyStateElement() {\n return this._emptyStateElement;\n }\n\n public getAccept() {\n return this.config.accept;\n }\n\n public setAccept(accept: string[]) {\n this.config.accept = accept;\n }\n\n public getMaxSize() {\n return this.config.maxSize;\n }\n\n public setMaxSize(maxSize: number | string) {\n this.config.maxSize = maxSize;\n }\n\n public getMultipleMaxCount() {\n return this.config.multipleMaxCount;\n }\n\n public setMultipleMaxCount(multipleMaxCount: number) {\n this.config.multipleMaxCount = multipleMaxCount;\n }\n\n public getMultipleMaxSize() {\n return this.config.multipleMaxSize;\n }\n\n public setMultipleMaxSize(multipleMaxSize: number | string) {\n this.config.multipleMaxSize = multipleMaxSize;\n }\n\n public getOnChangePickAttributes() {\n return this.config.onChangePickAttributes;\n }\n\n public setOnChangePickAttributes(attributes: string[]) {\n this.config.onChangePickAttributes = attributes;\n }\n}\n"],"mappings":"AAEA,SAASA,gBAAgB;AACzB,SAASC,0BAA0B;AACnC,SAASC,iBAAiB;AAwB1B,OAAO,MAAMC,kBAAkB,SAASH,gBAAgB,CAA2B;EAGxEI,WAAWA,CAACC,EAAU,EAAEC,MAAgC,EAAE;IAC7D,KAAK,CAACD,EAAE,EAAEC,MAAM,CAAC;IAEjB,IAAI,CAACC,WAAW,CAAC,IAAIN,0BAA0B,CAAC,CAAC,CAAC;IAElD,IAAI,CAACO,kBAAkB,GAAG,IAAIN,iBAAiB,CAAC,YAAY,CAAC;IAE7D,IAAI,CAACO,YAAY,CAACN,kBAAkB,CAAC;EACzC;EAEOO,oBAAoBA,CAAA,EAAG;IAC1B,OAAO,IAAI,CAACF,kBAAkB;EAClC;EAEOG,SAASA,CAAA,EAAG;IACf,OAAO,IAAI,CAACL,MAAM,CAACM,MAAM;EAC7B;EAEOC,SAASA,CAACD,MAAgB,EAAE;IAC/B,IAAI,CAACN,MAAM,CAACM,MAAM,GAAGA,MAAM;EAC/B;EAEOE,UAAUA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACR,MAAM,CAACS,OAAO;EAC9B;EAEOC,UAAUA,CAACD,OAAwB,EAAE;IACxC,IAAI,CAACT,MAAM,CAACS,OAAO,GAAGA,OAAO;EACjC;EAEOE,mBAAmBA,CAAA,EAAG;IACzB,OAAO,IAAI,CAACX,MAAM,CAACY,gBAAgB;EACvC;EAEOC,mBAAmBA,CAACD,gBAAwB,EAAE;IACjD,IAAI,CAACZ,MAAM,CAACY,gBAAgB,GAAGA,gBAAgB;EACnD;EAEOE,kBAAkBA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACd,MAAM,CAACe,eAAe;EACtC;EAEOC,kBAAkBA,CAACD,eAAgC,EAAE;IACxD,IAAI,CAACf,MAAM,CAACe,eAAe,GAAGA,eAAe;EACjD;EAEOE,yBAAyBA,CAAA,EAAG;IAC/B,OAAO,IAAI,CAACjB,MAAM,CAACkB,sBAAsB;EAC7C;EAEOC,yBAAyBA,CAACC,UAAoB,EAAE;IACnD,IAAI,CAACpB,MAAM,CAACkB,sBAAsB,GAAGE,UAAU;EACnD;AACJ","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import { FormOnSubmit, FormRenderPropParams } from "@webiny/form";
3
- import { UIElement, UIElementConfig, UiElementRenderProps } from "../../UIElement";
2
+ import type { FormOnSubmit, FormRenderPropParams } from "@webiny/form";
3
+ import type { UIElementConfig, UiElementRenderProps } from "../../UIElement";
4
+ import { UIElement } from "../../UIElement";
4
5
  interface FormElementConfig extends UIElementConfig {
5
6
  onSubmit: FormOnSubmit;
6
7
  getData(): Record<string, any>;
@@ -1,45 +1,20 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.FormElement = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
16
- var _react = _interopRequireWildcard(require("react"));
17
- var _form = require("@webiny/form");
18
- var _UIElement2 = require("../../UIElement");
19
- var FormElement = /*#__PURE__*/function (_UIElement) {
20
- (0, _inherits2.default)(FormElement, _UIElement);
21
- var _super = (0, _createSuper2.default)(FormElement);
22
- function FormElement(id, config) {
23
- var _this;
24
- (0, _classCallCheck2.default)(this, FormElement);
25
- _this = _super.call(this, id, config);
26
- _this.useGrid(false);
27
- return _this;
1
+ import React, { Fragment } from "react";
2
+ import { Form } from "@webiny/form";
3
+ import { UIElement } from "../../UIElement";
4
+ export class FormElement extends UIElement {
5
+ constructor(id, config) {
6
+ super(id, config);
7
+ this.useGrid(false);
8
+ }
9
+ render(props) {
10
+ return /*#__PURE__*/React.createElement(Form, {
11
+ onSubmit: this.config.onSubmit,
12
+ data: this.config.getData()
13
+ }, formProps => /*#__PURE__*/React.createElement(Fragment, null, super.render({
14
+ ...props,
15
+ formProps
16
+ })));
28
17
  }
29
- (0, _createClass2.default)(FormElement, [{
30
- key: "render",
31
- value: function render(props) {
32
- var _this2 = this;
33
- return /*#__PURE__*/_react.default.createElement(_form.Form, {
34
- onSubmit: this.config.onSubmit,
35
- data: this.config.getData()
36
- }, function (formProps) {
37
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, (0, _get2.default)((0, _getPrototypeOf2.default)(FormElement.prototype), "render", _this2).call(_this2, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
38
- formProps: formProps
39
- })));
40
- });
41
- }
42
- }]);
43
- return FormElement;
44
- }(_UIElement2.UIElement);
45
- exports.FormElement = FormElement;
18
+ }
19
+
20
+ //# sourceMappingURL=FormElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FormElement","id","config","useGrid","props","onSubmit","getData","formProps","UIElement"],"sources":["FormElement.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { Form, FormOnSubmit, FormRenderPropParams } from \"@webiny/form\";\nimport { UIElement, UIElementConfig, UiElementRenderProps } from \"~/ui/UIElement\";\n\ninterface FormElementConfig extends UIElementConfig {\n onSubmit: FormOnSubmit;\n getData(): Record<string, any>;\n getInvalidFields?(): Record<string, any>;\n isDisabled?(): boolean;\n onChange?: FormOnSubmit;\n onInvalid?: () => void;\n submitOnEnter?: boolean;\n validateOnFirstSubmit?: boolean;\n}\n\nexport interface FormElementRenderProps extends UiElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\nexport class FormElement extends UIElement<FormElementConfig> {\n public constructor(id: string, config: FormElementConfig) {\n super(id, config);\n\n this.useGrid(false);\n }\n\n public override render(props: FormElementRenderProps): React.ReactNode {\n return (\n <Form onSubmit={this.config.onSubmit} data={this.config.getData()}>\n {formProps => <Fragment>{super.render({ ...props, formProps })}</Fragment>}\n </Form>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAkF,IAiBrEA,WAAW;EAAA;EAAA;EACpB,qBAAmBC,EAAU,EAAEC,MAAyB,EAAE;IAAA;IAAA;IACtD,0BAAMD,EAAE,EAAEC,MAAM;IAEhB,MAAKC,OAAO,CAAC,KAAK,CAAC;IAAC;EACxB;EAAC;IAAA;IAAA,OAED,gBAAuBC,KAA6B,EAAmB;MAAA;MACnE,oBACI,6BAAC,UAAI;QAAC,QAAQ,EAAE,IAAI,CAACF,MAAM,CAACG,QAAS;QAAC,IAAI,EAAE,IAAI,CAACH,MAAM,CAACI,OAAO;MAAG,GAC7D,UAAAC,SAAS;QAAA,oBAAI,6BAAC,eAAQ,4KAAoBH,KAAK;UAAEG,SAAS,EAATA;QAAS,IAAe;MAAA,EACvE;IAEf;EAAC;EAAA;AAAA,EAb4BC,qBAAS;AAAA"}
1
+ {"version":3,"names":["React","Fragment","Form","UIElement","FormElement","constructor","id","config","useGrid","render","props","createElement","onSubmit","data","getData","formProps"],"sources":["FormElement.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport type { FormOnSubmit, FormRenderPropParams } from \"@webiny/form\";\nimport { Form } from \"@webiny/form\";\nimport type { UIElementConfig, UiElementRenderProps } from \"~/ui/UIElement\";\nimport { UIElement } from \"~/ui/UIElement\";\n\ninterface FormElementConfig extends UIElementConfig {\n onSubmit: FormOnSubmit;\n getData(): Record<string, any>;\n getInvalidFields?(): Record<string, any>;\n isDisabled?(): boolean;\n onChange?: FormOnSubmit;\n onInvalid?: () => void;\n submitOnEnter?: boolean;\n validateOnFirstSubmit?: boolean;\n}\n\nexport interface FormElementRenderProps extends UiElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\nexport class FormElement extends UIElement<FormElementConfig> {\n public constructor(id: string, config: FormElementConfig) {\n super(id, config);\n\n this.useGrid(false);\n }\n\n public override render(props: FormElementRenderProps): React.ReactNode {\n return (\n <Form onSubmit={this.config.onSubmit} data={this.config.getData()}>\n {formProps => <Fragment>{super.render({ ...props, formProps })}</Fragment>}\n </Form>\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AAEvC,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,SAAS;AAiBlB,OAAO,MAAMC,WAAW,SAASD,SAAS,CAAoB;EACnDE,WAAWA,CAACC,EAAU,EAAEC,MAAyB,EAAE;IACtD,KAAK,CAACD,EAAE,EAAEC,MAAM,CAAC;IAEjB,IAAI,CAACC,OAAO,CAAC,KAAK,CAAC;EACvB;EAEgBC,MAAMA,CAACC,KAA6B,EAAmB;IACnE,oBACIV,KAAA,CAAAW,aAAA,CAACT,IAAI;MAACU,QAAQ,EAAE,IAAI,CAACL,MAAM,CAACK,QAAS;MAACC,IAAI,EAAE,IAAI,CAACN,MAAM,CAACO,OAAO,CAAC;IAAE,GAC7DC,SAAS,iBAAIf,KAAA,CAAAW,aAAA,CAACV,QAAQ,QAAE,KAAK,CAACQ,MAAM,CAAC;MAAE,GAAGC,KAAK;MAAEK;IAAU,CAAC,CAAY,CACvE,CAAC;EAEf;AACJ","ignoreList":[]}
@@ -1,8 +1,9 @@
1
- import React from "react";
2
- import { FormRenderPropParams, FormAPI } from "@webiny/form";
3
- import { UIElement, UIElementConfig } from "../../UIElement";
4
- import { FormElementRenderProps } from "./FormElement";
5
- import { Validator } from "@webiny/validation/types";
1
+ import type React from "react";
2
+ import type { FormRenderPropParams, FormAPI } from "@webiny/form";
3
+ import type { UIElementConfig } from "../../UIElement";
4
+ import { UIElement } from "../../UIElement";
5
+ import type { FormElementRenderProps } from "./FormElement";
6
+ import type { Validator } from "@webiny/validation/types";
6
7
  export interface FormFieldElementConfig<TRenderProps = FormRenderPropParams> extends UIElementConfig<TRenderProps> {
7
8
  name: string;
8
9
  validators?: GetterWithProps<Validator | Validator[]>;
@@ -1,173 +1,113 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FormFieldElement = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
- var _UIElement2 = require("../../UIElement");
16
- var FormFieldElement = /*#__PURE__*/function (_UIElement) {
17
- (0, _inherits2.default)(FormFieldElement, _UIElement);
18
- var _super = (0, _createSuper2.default)(FormFieldElement);
19
- function FormFieldElement(id, config) {
20
- var _this;
21
- (0, _classCallCheck2.default)(this, FormFieldElement);
22
- _this = _super.call(this, id, config);
23
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_beforeChange", []);
24
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_afterChange", []);
1
+ import { UIElement } from "../../UIElement";
2
+ export class FormFieldElement extends UIElement {
3
+ _beforeChange = [];
4
+ _afterChange = [];
5
+ constructor(id, config) {
6
+ super(id, config);
25
7
  if (config.beforeChange) {
26
- _this._beforeChange.push(config.beforeChange);
8
+ this._beforeChange.push(config.beforeChange);
27
9
  }
28
10
  if (config.afterChange) {
29
- _this._afterChange.push(config.afterChange);
11
+ this._afterChange.push(config.afterChange);
30
12
  }
31
- _this.applyPlugins(FormFieldElement);
32
- return _this;
13
+ this.applyPlugins(FormFieldElement);
33
14
  }
34
- (0, _createClass2.default)(FormFieldElement, [{
35
- key: "getName",
36
- value: function getName() {
37
- return this.config.name;
38
- }
39
- }, {
40
- key: "getValidators",
41
- value: function getValidators(props) {
42
- if (!this.config.validators || typeof this.config.validators !== "function") {
43
- return function () {
44
- return true;
45
- };
46
- }
47
- return this.config.validators(props);
48
- }
49
- }, {
50
- key: "getDefaultValue",
51
- value: function getDefaultValue(props) {
52
- if (typeof this.config.defaultValue === "function") {
53
- return this.config.defaultValue(props);
54
- }
55
- return this.config.defaultValue;
56
- }
57
- }, {
58
- key: "getLabel",
59
- value: function getLabel(props) {
60
- if (typeof this.config.label === "function") {
61
- return this.config.label(props);
62
- }
63
- return this.config.label;
64
- }
65
- }, {
66
- key: "getDescription",
67
- value: function getDescription(props) {
68
- if (typeof this.config.description === "function") {
69
- return this.config.description(props);
70
- }
71
- return this.config.description;
15
+ getName() {
16
+ return this.config.name;
17
+ }
18
+ getValidators(props) {
19
+ if (!this.config.validators || typeof this.config.validators !== "function") {
20
+ return () => true;
72
21
  }
73
- }, {
74
- key: "getPlaceholder",
75
- value: function getPlaceholder(props) {
76
- if (typeof this.config.placeholder === "function") {
77
- return this.config.placeholder(props);
78
- }
79
- return this.config.placeholder;
22
+ return this.config.validators(props);
23
+ }
24
+ getDefaultValue(props) {
25
+ if (typeof this.config.defaultValue === "function") {
26
+ return this.config.defaultValue(props);
80
27
  }
81
- }, {
82
- key: "setLabel",
83
- value: function setLabel(label) {
84
- this.config.label = label;
28
+ return this.config.defaultValue;
29
+ }
30
+ getLabel(props) {
31
+ if (typeof this.config.label === "function") {
32
+ return this.config.label(props);
85
33
  }
86
- }, {
87
- key: "setDescription",
88
- value: function setDescription(description) {
89
- this.config.description = description;
34
+ return this.config.label;
35
+ }
36
+ getDescription(props) {
37
+ if (typeof this.config.description === "function") {
38
+ return this.config.description(props);
90
39
  }
91
- }, {
92
- key: "setPlaceholder",
93
- value: function setPlaceholder(placeholder) {
94
- this.config.placeholder = placeholder;
40
+ return this.config.description;
41
+ }
42
+ getPlaceholder(props) {
43
+ if (typeof this.config.placeholder === "function") {
44
+ return this.config.placeholder(props);
95
45
  }
96
- }, {
97
- key: "setDefaultValue",
98
- value: function setDefaultValue(value) {
99
- this.config.defaultValue = value;
46
+ return this.config.placeholder;
47
+ }
48
+ setLabel(label) {
49
+ this.config.label = label;
50
+ }
51
+ setDescription(description) {
52
+ this.config.description = description;
53
+ }
54
+ setPlaceholder(placeholder) {
55
+ this.config.placeholder = placeholder;
56
+ }
57
+ setDefaultValue(value) {
58
+ this.config.defaultValue = value;
59
+ }
60
+ getIsDisabled(props) {
61
+ if (typeof this.config.isDisabled === "function") {
62
+ return this.config.isDisabled(props);
100
63
  }
101
- }, {
102
- key: "getIsDisabled",
103
- value: function getIsDisabled(props) {
104
- if (typeof this.config.isDisabled === "function") {
105
- return this.config.isDisabled(props);
64
+ return this.config.isDisabled;
65
+ }
66
+ setIsDisabled(isDisabled) {
67
+ this.config.isDisabled = isDisabled;
68
+ }
69
+ setValidators(validators) {
70
+ this.config.validators = validators;
71
+ }
72
+ onBeforeChange(value, cb) {
73
+ const callbacks = [...this._beforeChange];
74
+ const next = val => {
75
+ const callbackCallable = callbacks.pop();
76
+ if (!callbackCallable) {
77
+ cb(val);
78
+ return;
106
79
  }
107
- return this.config.isDisabled;
108
- }
109
- }, {
110
- key: "setIsDisabled",
111
- value: function setIsDisabled(isDisabled) {
112
- this.config.isDisabled = isDisabled;
113
- }
114
- }, {
115
- key: "setValidators",
116
- value: function setValidators(validators) {
117
- this.config.validators = validators;
118
- }
119
- }, {
120
- key: "onBeforeChange",
121
- value: function onBeforeChange(value, cb) {
122
- var callbacks = (0, _toConsumableArray2.default)(this._beforeChange);
123
- var next = function next(val) {
124
- var callbackCallable = callbacks.pop();
125
- if (!callbackCallable) {
126
- cb(val);
127
- return;
128
- }
129
- callbackCallable(val, next);
130
- };
131
- next(value);
132
- }
133
- }, {
134
- key: "onAfterChange",
135
- value: function onAfterChange(value, form) {
136
- var callbacks = (0, _toConsumableArray2.default)(this._afterChange);
137
- var next = function next(val) {
138
- var callbackCallable = callbacks.pop();
139
- if (!callbackCallable) {
140
- return;
141
- }
142
- callbackCallable(val, form);
143
- };
144
- next(value);
145
- }
146
- }, {
147
- key: "addBeforeChange",
148
- value: function addBeforeChange(cb) {
149
- this._beforeChange.push(cb);
150
- }
151
- }, {
152
- key: "addAfterChange",
153
- value: function addAfterChange(cb) {
154
- /**
155
- * TODO @ts-refactor possibly different subtype. Or so TS complains.
156
- */
157
- // @ts-ignore
158
- this._afterChange.push(cb);
159
- }
160
- }, {
161
- key: "setBeforeChange",
162
- value: function setBeforeChange(cb) {
163
- this._beforeChange = [cb];
164
- }
165
- }, {
166
- key: "setAfterChange",
167
- value: function setAfterChange(cb) {
168
- this._afterChange = [cb];
169
- }
170
- }]);
171
- return FormFieldElement;
172
- }(_UIElement2.UIElement);
173
- exports.FormFieldElement = FormFieldElement;
80
+ callbackCallable(val, next);
81
+ };
82
+ next(value);
83
+ }
84
+ onAfterChange(value, form) {
85
+ const callbacks = [...this._afterChange];
86
+ const next = val => {
87
+ const callbackCallable = callbacks.pop();
88
+ if (!callbackCallable) {
89
+ return;
90
+ }
91
+ callbackCallable(val, form);
92
+ };
93
+ next(value);
94
+ }
95
+ addBeforeChange(cb) {
96
+ this._beforeChange.push(cb);
97
+ }
98
+ addAfterChange(cb) {
99
+ /**
100
+ * TODO @ts-refactor possibly different subtype. Or so TS complains.
101
+ */
102
+ // @ts-expect-error
103
+ this._afterChange.push(cb);
104
+ }
105
+ setBeforeChange(cb) {
106
+ this._beforeChange = [cb];
107
+ }
108
+ setAfterChange(cb) {
109
+ this._afterChange = [cb];
110
+ }
111
+ }
112
+
113
+ //# sourceMappingURL=FormFieldElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FormFieldElement","id","config","beforeChange","_beforeChange","push","afterChange","_afterChange","applyPlugins","name","props","validators","defaultValue","label","description","placeholder","value","isDisabled","cb","callbacks","next","val","callbackCallable","pop","form","UIElement"],"sources":["FormFieldElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { FormRenderPropParams, FormAPI } from \"@webiny/form\";\nimport { UIElement, UIElementConfig } from \"~/ui/UIElement\";\nimport { FormElementRenderProps } from \"~/ui/elements/form/FormElement\";\nimport { Validator } from \"@webiny/validation/types\";\n\nexport interface FormFieldElementConfig<TRenderProps = FormRenderPropParams>\n extends UIElementConfig<TRenderProps> {\n name: string;\n validators?: GetterWithProps<Validator | Validator[]>;\n beforeChange?: BeforeChange;\n afterChange?: AfterChange;\n defaultValue?: any | GetterWithProps<any>;\n isDisabled?: boolean | GetterWithProps<boolean>;\n label?: string | GetterWithProps<string>;\n description?: string | React.ReactElement | GetterWithProps<string | React.ReactElement>;\n placeholder?: string | GetterWithProps<string>;\n}\n\nexport interface FormFieldElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\ninterface BeforeChange {\n (value: any, callback: BeforeChangeCallback): void;\n}\n\ninterface BeforeChangeCallback {\n (value: any): void;\n}\n\ninterface AfterChange<T = any, D extends Record<string, any> = Record<string, any>> {\n (value: T, form: FormAPI<D>): void;\n}\n\ninterface GetterWithProps<T> {\n (props: FormElementRenderProps): T;\n}\n\nexport class FormFieldElement<\n TConfig extends FormFieldElementConfig = FormFieldElementConfig\n> extends UIElement<TConfig> {\n private _beforeChange: BeforeChange[] = [];\n private _afterChange: AfterChange[] = [];\n\n public constructor(id: string, config: TConfig) {\n super(id, config);\n\n if (config.beforeChange) {\n this._beforeChange.push(config.beforeChange);\n }\n\n if (config.afterChange) {\n this._afterChange.push(config.afterChange);\n }\n\n this.applyPlugins(FormFieldElement);\n }\n\n public getName(): string {\n return this.config.name;\n }\n\n public getValidators(props?: FormFieldElementRenderProps): Validator | Validator[] {\n if (!this.config.validators || typeof this.config.validators !== \"function\") {\n return () => true;\n }\n\n return this.config.validators(props as FormFieldElementRenderProps);\n }\n\n public getDefaultValue(props?: FormFieldElementRenderProps): any {\n if (typeof this.config.defaultValue === \"function\") {\n return this.config.defaultValue(props);\n }\n\n return this.config.defaultValue;\n }\n\n public getLabel(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.label === \"function\") {\n return this.config.label(props as FormFieldElementRenderProps);\n }\n\n return this.config.label as string;\n }\n\n public getDescription(props?: FormFieldElementRenderProps): string | React.ReactElement {\n if (typeof this.config.description === \"function\") {\n return this.config.description(props as FormFieldElementRenderProps);\n }\n\n return this.config.description as string;\n }\n\n public getPlaceholder(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.placeholder === \"function\") {\n return this.config.placeholder(props as FormFieldElementRenderProps);\n }\n\n return this.config.placeholder as string;\n }\n\n public setLabel(label: string | GetterWithProps<string>): void {\n this.config.label = label;\n }\n\n public setDescription(\n description: string | React.ReactElement | GetterWithProps<string | React.ReactElement>\n ): void {\n this.config.description = description;\n }\n\n public setPlaceholder(placeholder: string | GetterWithProps<string>): void {\n this.config.placeholder = placeholder;\n }\n\n public setDefaultValue(value: any | GetterWithProps<any>): void {\n this.config.defaultValue = value;\n }\n\n public getIsDisabled(props?: FormFieldElementRenderProps): boolean {\n if (typeof this.config.isDisabled === \"function\") {\n return this.config.isDisabled(props as FormFieldElementRenderProps);\n }\n return this.config.isDisabled as boolean;\n }\n\n public setIsDisabled(isDisabled: boolean | GetterWithProps<boolean>): void {\n this.config.isDisabled = isDisabled;\n }\n\n public setValidators(validators: GetterWithProps<Validator>): void {\n this.config.validators = validators;\n }\n\n public onBeforeChange(value: string, cb: (value: string) => void): void {\n const callbacks = [...this._beforeChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n cb(val);\n return;\n }\n callbackCallable(val, next);\n };\n\n next(value);\n }\n\n public onAfterChange(value: string, form: FormAPI): void {\n const callbacks = [...this._afterChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n return;\n }\n callbackCallable(val, form);\n };\n\n next(value);\n }\n\n public addBeforeChange(cb: BeforeChange): void {\n this._beforeChange.push(cb);\n }\n\n public addAfterChange<T = any, D extends Record<string, any> = Record<string, any>>(\n cb: AfterChange<T, D>\n ): void {\n /**\n * TODO @ts-refactor possibly different subtype. Or so TS complains.\n */\n // @ts-ignore\n this._afterChange.push(cb);\n }\n\n public setBeforeChange(cb: BeforeChange): void {\n this._beforeChange = [cb];\n }\n\n public setAfterChange(cb: AfterChange): void {\n this._afterChange = [cb];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA;AAA4D,IAqC/CA,gBAAgB;EAAA;EAAA;EAMzB,0BAAmBC,EAAU,EAAEC,MAAe,EAAE;IAAA;IAAA;IAC5C,0BAAMD,EAAE,EAAEC,MAAM;IAAE,4FAJkB,EAAE;IAAA,2FACJ,EAAE;IAKpC,IAAIA,MAAM,CAACC,YAAY,EAAE;MACrB,MAAKC,aAAa,CAACC,IAAI,CAACH,MAAM,CAACC,YAAY,CAAC;IAChD;IAEA,IAAID,MAAM,CAACI,WAAW,EAAE;MACpB,MAAKC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AAgB,EAAE;UACnBJ,EAAE,CAACG,GAAG,CAAC;UACP;QACJ;QACAC,gBAAgB,CAACD,GAAG,EAAED,IAAI,CAAC;MAC/B,CAAC;MAEDA,IAAI,CAACJ,KAAK,CAAC;IACf;EAAC;IAAA;IAAA,OAED,uBAAqBA,KAAa,EAAEQ,IAAa,EAAQ;MACrD,IAAML,SAAS,oCAAO,IAAI,CAACZ,YAAY,CAAC;MACxC,IAAMa,IAAI,GAAG,SAAPA,IAAI,CAAIC,GAAW,EAAK;QAC1B,IAAMC,gBAAgB,GAAGH,SAAS,CAACI,GAAG,EAAE;QACxC,IAAI,CAACD,gBAAgB,EAAE;UACnB;QACJ;QACAA,gBAAgB,CAACD,GAAG,EAAEG,IAAI,CAAC;MAC/B,CAAC;MAEDJ,IAAI,CAACJ,KAAK,CAAC;IACf;EAAC;IAAA;IAAA,OAED,yBAAuBE,EAAgB,EAAQ;MAC3C,IAAI,CAACd,aAAa,CAACC,IAAI,CAACa,EAAE,CAAC;IAC/B;EAAC;IAAA;IAAA,OAED,wBACIA,EAAqB,EACjB;MACJ;AACR;AACA;MACQ;MACA,IAAI,CAACX,YAAY,CAACF,IAAI,CAACa,EAAE,CAAC;IAC9B;EAAC;IAAA;IAAA,OAED,yBAAuBA,EAAgB,EAAQ;MAC3C,IAAI,CAACd,aAAa,GAAG,CAACc,EAAE,CAAC;IAC7B;EAAC;IAAA;IAAA,OAED,wBAAsBA,EAAe,EAAQ;MACzC,IAAI,CAACX,YAAY,GAAG,CAACW,EAAE,CAAC;IAC5B;EAAC;EAAA;AAAA,EA9IKO,qBAAS;AAAA"}
1
+ {"version":3,"names":["UIElement","FormFieldElement","_beforeChange","_afterChange","constructor","id","config","beforeChange","push","afterChange","applyPlugins","getName","name","getValidators","props","validators","getDefaultValue","defaultValue","getLabel","label","getDescription","description","getPlaceholder","placeholder","setLabel","setDescription","setPlaceholder","setDefaultValue","value","getIsDisabled","isDisabled","setIsDisabled","setValidators","onBeforeChange","cb","callbacks","next","val","callbackCallable","pop","onAfterChange","form","addBeforeChange","addAfterChange","setBeforeChange","setAfterChange"],"sources":["FormFieldElement.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { FormRenderPropParams, FormAPI } from \"@webiny/form\";\nimport type { UIElementConfig } from \"~/ui/UIElement\";\nimport { UIElement } from \"~/ui/UIElement\";\nimport type { FormElementRenderProps } from \"~/ui/elements/form/FormElement\";\nimport type { Validator } from \"@webiny/validation/types\";\n\nexport interface FormFieldElementConfig<TRenderProps = FormRenderPropParams>\n extends UIElementConfig<TRenderProps> {\n name: string;\n validators?: GetterWithProps<Validator | Validator[]>;\n beforeChange?: BeforeChange;\n afterChange?: AfterChange;\n defaultValue?: any | GetterWithProps<any>;\n isDisabled?: boolean | GetterWithProps<boolean>;\n label?: string | GetterWithProps<string>;\n description?: string | React.ReactElement | GetterWithProps<string | React.ReactElement>;\n placeholder?: string | GetterWithProps<string>;\n}\n\nexport interface FormFieldElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\ninterface BeforeChange {\n (value: any, callback: BeforeChangeCallback): void;\n}\n\ninterface BeforeChangeCallback {\n (value: any): void;\n}\n\ninterface AfterChange<T = any, D extends Record<string, any> = Record<string, any>> {\n (value: T, form: FormAPI<D>): void;\n}\n\ninterface GetterWithProps<T> {\n (props: FormElementRenderProps): T;\n}\n\nexport class FormFieldElement<\n TConfig extends FormFieldElementConfig = FormFieldElementConfig\n> extends UIElement<TConfig> {\n private _beforeChange: BeforeChange[] = [];\n private _afterChange: AfterChange[] = [];\n\n public constructor(id: string, config: TConfig) {\n super(id, config);\n\n if (config.beforeChange) {\n this._beforeChange.push(config.beforeChange);\n }\n\n if (config.afterChange) {\n this._afterChange.push(config.afterChange);\n }\n\n this.applyPlugins(FormFieldElement);\n }\n\n public getName(): string {\n return this.config.name;\n }\n\n public getValidators(props?: FormFieldElementRenderProps): Validator | Validator[] {\n if (!this.config.validators || typeof this.config.validators !== \"function\") {\n return () => true;\n }\n\n return this.config.validators(props as FormFieldElementRenderProps);\n }\n\n public getDefaultValue(props?: FormFieldElementRenderProps): any {\n if (typeof this.config.defaultValue === \"function\") {\n return this.config.defaultValue(props);\n }\n\n return this.config.defaultValue;\n }\n\n public getLabel(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.label === \"function\") {\n return this.config.label(props as FormFieldElementRenderProps);\n }\n\n return this.config.label as string;\n }\n\n public getDescription(props?: FormFieldElementRenderProps): string | React.ReactElement {\n if (typeof this.config.description === \"function\") {\n return this.config.description(props as FormFieldElementRenderProps);\n }\n\n return this.config.description as string;\n }\n\n public getPlaceholder(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.placeholder === \"function\") {\n return this.config.placeholder(props as FormFieldElementRenderProps);\n }\n\n return this.config.placeholder as string;\n }\n\n public setLabel(label: string | GetterWithProps<string>): void {\n this.config.label = label;\n }\n\n public setDescription(\n description: string | React.ReactElement | GetterWithProps<string | React.ReactElement>\n ): void {\n this.config.description = description;\n }\n\n public setPlaceholder(placeholder: string | GetterWithProps<string>): void {\n this.config.placeholder = placeholder;\n }\n\n public setDefaultValue(value: any | GetterWithProps<any>): void {\n this.config.defaultValue = value;\n }\n\n public getIsDisabled(props?: FormFieldElementRenderProps): boolean {\n if (typeof this.config.isDisabled === \"function\") {\n return this.config.isDisabled(props as FormFieldElementRenderProps);\n }\n return this.config.isDisabled as boolean;\n }\n\n public setIsDisabled(isDisabled: boolean | GetterWithProps<boolean>): void {\n this.config.isDisabled = isDisabled;\n }\n\n public setValidators(validators: GetterWithProps<Validator>): void {\n this.config.validators = validators;\n }\n\n public onBeforeChange(value: string, cb: (value: string) => void): void {\n const callbacks = [...this._beforeChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n cb(val);\n return;\n }\n callbackCallable(val, next);\n };\n\n next(value);\n }\n\n public onAfterChange(value: string, form: FormAPI): void {\n const callbacks = [...this._afterChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n return;\n }\n callbackCallable(val, form);\n };\n\n next(value);\n }\n\n public addBeforeChange(cb: BeforeChange): void {\n this._beforeChange.push(cb);\n }\n\n public addAfterChange<T = any, D extends Record<string, any> = Record<string, any>>(\n cb: AfterChange<T, D>\n ): void {\n /**\n * TODO @ts-refactor possibly different subtype. Or so TS complains.\n */\n // @ts-expect-error\n this._afterChange.push(cb);\n }\n\n public setBeforeChange(cb: BeforeChange): void {\n this._beforeChange = [cb];\n }\n\n public setAfterChange(cb: AfterChange): void {\n this._afterChange = [cb];\n }\n}\n"],"mappings":"AAGA,SAASA,SAAS;AAqClB,OAAO,MAAMC,gBAAgB,SAEnBD,SAAS,CAAU;EACjBE,aAAa,GAAmB,EAAE;EAClCC,YAAY,GAAkB,EAAE;EAEjCC,WAAWA,CAACC,EAAU,EAAEC,MAAe,EAAE;IAC5C,KAAK,CAACD,EAAE,EAAEC,MAAM,CAAC;IAEjB,IAAIA,MAAM,CAACC,YAAY,EAAE;MACrB,IAAI,CAACL,aAAa,CAACM,IAAI,CAACF,MAAM,CAACC,YAAY,CAAC;IAChD;IAEA,IAAID,MAAM,CAACG,WAAW,EAAE;MACpB,IAAI,CAACN,YAAY,CAACK,IAAI,CAACF,MAAM,CAACG,WAAW,CAAC;IAC9C;IAEA,IAAI,CAACC,YAAY,CAACT,gBAAgB,CAAC;EACvC;EAEOU,OAAOA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACL,MAAM,CAACM,IAAI;EAC3B;EAEOC,aAAaA,CAACC,KAAmC,EAA2B;IAC/E,IAAI,CAAC,IAAI,CAACR,MAAM,CAACS,UAAU,IAAI,OAAO,IAAI,CAACT,MAAM,CAACS,UAAU,KAAK,UAAU,EAAE;MACzE,OAAO,MAAM,IAAI;IACrB;IAEA,OAAO,IAAI,CAACT,MAAM,CAACS,UAAU,CAACD,KAAoC,CAAC;EACvE;EAEOE,eAAeA,CAACF,KAAmC,EAAO;IAC7D,IAAI,OAAO,IAAI,CAACR,MAAM,CAACW,YAAY,KAA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,CAAC/B,YAAY,CAACK,IAAI,CAAC0B,EAAE,CAAC;EAC9B;EAEOU,eAAeA,CAACV,EAAgB,EAAQ;IAC3C,IAAI,CAAChC,aAAa,GAAG,CAACgC,EAAE,CAAC;EAC7B;EAEOW,cAAcA,CAACX,EAAe,EAAQ;IACzC,IAAI,CAAC/B,YAAY,GAAG,CAAC+B,EAAE,CAAC;EAC5B;AACJ","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { FormFieldElement, FormFieldElementConfig, FormFieldElementRenderProps } from "./FormFieldElement";
2
+ import type { FormFieldElementConfig, FormFieldElementRenderProps } from "./FormFieldElement";
3
+ import { FormFieldElement } from "./FormFieldElement";
3
4
  export declare class HiddenElement extends FormFieldElement {
4
5
  constructor(id: string, config: FormFieldElementConfig);
5
6
  render(props: FormFieldElementRenderProps): React.ReactNode;