@webiny/app-admin 5.43.2 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/Admin.js +25 -35
- package/base/Admin.js.map +1 -1
- package/base/Base/Menus/SupportMenuItems.d.ts +2 -0
- package/base/Base/Menus/SupportMenuItems.js +20 -0
- package/base/Base/Menus/SupportMenuItems.js.map +1 -0
- package/base/Base/Menus/WebinyVersion.d.ts +2 -0
- package/base/Base/Menus/WebinyVersion.js +24 -0
- package/base/Base/Menus/WebinyVersion.js.map +1 -0
- package/base/Base/Menus.d.ts +2 -0
- package/base/Base/Menus.js +129 -0
- package/base/Base/Menus.js.map +1 -0
- package/base/Base/Routes.d.ts +2 -0
- package/base/Base/Routes.js +24 -0
- package/base/Base/Routes.js.map +1 -0
- package/base/Base/Tenant/wby-logo.svg +3 -0
- package/base/Base/Tenant.d.ts +2 -0
- package/base/Base/Tenant.js +19 -0
- package/base/Base/Tenant.js.map +1 -0
- package/base/Base.js +11 -79
- package/base/Base.js.map +1 -1
- package/base/WebinyVersion.d.ts +2 -0
- package/base/WebinyVersion.js +24 -0
- package/base/WebinyVersion.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.js +11 -21
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.d.ts +1 -0
- package/base/providers/AdminUiStateProvider.js +14 -0
- package/base/providers/AdminUiStateProvider.js.map +1 -0
- package/base/providers/ApolloProvider.js +9 -15
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.js +12 -18
- package/base/providers/TelemetryProvider.js.map +1 -1
- package/base/providers/UiProviders.d.ts +1 -0
- package/base/providers/UiProviders.js +14 -0
- package/base/providers/UiProviders.js.map +1 -0
- package/base/providers/UiStateProvider.js +9 -15
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.js +33 -44
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.js +5 -12
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.js +12 -43
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.js +5 -12
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.js +42 -56
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.js +8 -16
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.js +5 -12
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.js +9 -15
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.d.ts +0 -5
- package/base/ui/Logo.js +5 -26
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.d.ts +0 -57
- package/base/ui/Navigation.js +5 -146
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js +5 -12
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.js +14 -19
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/{Search.d.ts → TenantSelector.d.ts} +2 -18
- package/base/ui/TenantSelector.js +8 -0
- package/base/ui/TenantSelector.js.map +1 -0
- package/base/ui/UserMenu/UserMenu.d.ts +39 -0
- package/base/ui/UserMenu/UserMenu.js +8 -0
- package/base/ui/UserMenu/UserMenu.js.map +1 -0
- package/base/ui/UserMenu/UserMenuHandle.d.ts +39 -0
- package/base/ui/UserMenu/UserMenuHandle.js +8 -0
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -0
- package/base/ui/UserMenu/UserMenuItem.d.ts +81 -0
- package/base/ui/UserMenu/UserMenuItem.js +19 -0
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -0
- package/base/ui/UserMenu/UserMenuLink.d.ts +81 -0
- package/base/ui/UserMenu/UserMenuLink.js +19 -0
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -0
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +42 -0
- package/base/ui/UserMenu/UserMenuSeparator.js +9 -0
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -0
- package/base/ui/UserMenu.d.ts +3 -79
- package/base/ui/UserMenu.js +14 -101
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +7 -13
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.js +57 -67
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.js +49 -69
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.js +10 -16
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.js +8 -15
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.js +81 -91
- package/components/AppInstaller/useInstaller.js.map +1 -1
- package/components/BulkActions/Worker.js +95 -141
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.js +2 -27
- package/components/BulkActions/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +20 -33
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.js +1 -16
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +45 -52
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/Buttons/Buttons.d.ts +7 -6
- package/components/Buttons/Buttons.js +58 -56
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.js +2 -9
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.js +2 -25
- package/components/Buttons/index.js.map +1 -1
- package/components/Buttons/useButtons.js +13 -19
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/Dialogs/CustomDialog.js +30 -37
- package/components/Dialogs/CustomDialog.js.map +1 -1
- package/components/Dialogs/Dialog.d.ts +8 -4
- package/components/Dialogs/Dialog.js +56 -41
- package/components/Dialogs/Dialog.js.map +1 -1
- package/components/Dialogs/DialogsContext.d.ts +9 -3
- package/components/Dialogs/DialogsContext.js +96 -107
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Dialogs/useDialogs.js +5 -17
- package/components/Dialogs/useDialogs.js.map +1 -1
- package/components/EmptyView.d.ts +1 -1
- package/components/EmptyView.js +31 -41
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.js +12 -20
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/FiltersToggle.d.ts +7 -0
- package/components/Filters/FiltersToggle.js +26 -0
- package/components/Filters/FiltersToggle.js.map +1 -0
- package/components/Filters/index.d.ts +1 -0
- package/components/Filters/index.js +2 -16
- package/components/Filters/index.js.map +1 -1
- package/components/FloatingActionButton.js +7 -13
- package/components/FloatingActionButton.js.map +1 -1
- package/components/FloatingPanel.js +44 -68
- package/components/FloatingPanel.js.map +1 -1
- package/components/IconPicker/IconPicker.d.ts +1 -1
- package/components/IconPicker/IconPicker.js +25 -32
- package/components/IconPicker/IconPicker.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.d.ts +5 -5
- package/components/IconPicker/IconPickerComponent.js +67 -87
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.d.ts +5 -4
- package/components/IconPicker/IconPickerPresenter.js +68 -109
- package/components/IconPicker/IconPickerPresenter.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.test.js +21 -23
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js +10 -17
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.d.ts +2 -1
- package/components/IconPicker/IconPickerTab.js +103 -113
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.js +16 -24
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/IconRepository.js +41 -73
- package/components/IconPicker/IconRepository.js.map +1 -1
- package/components/IconPicker/IconRepository.test.js +11 -13
- package/components/IconPicker/IconRepository.test.js.map +1 -1
- package/components/IconPicker/IconRepositoryFactory.js +14 -37
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
- package/components/IconPicker/Loading.js +42 -68
- package/components/IconPicker/Loading.js.map +1 -1
- package/components/IconPicker/components/IconPickerCell.d.ts +12 -0
- package/components/IconPicker/components/IconPickerCell.js +27 -0
- package/components/IconPicker/components/IconPickerCell.js.map +1 -0
- package/components/IconPicker/components/IconPickerContent.d.ts +11 -0
- package/components/IconPicker/components/IconPickerContent.js +41 -0
- package/components/IconPicker/components/IconPickerContent.js.map +1 -0
- package/components/IconPicker/components/IconPickerRow.d.ts +4 -0
- package/components/IconPicker/components/IconPickerRow.js +14 -0
- package/components/IconPicker/components/IconPickerRow.js.map +1 -0
- package/components/IconPicker/components/IconPickerTrigger.d.ts +13 -0
- package/components/IconPicker/components/IconPickerTrigger.js +52 -0
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -0
- package/components/IconPicker/components/index.d.ts +4 -0
- package/components/IconPicker/components/index.js +6 -0
- package/components/IconPicker/components/index.js.map +1 -0
- package/components/IconPicker/config/Emojis.js +9 -16
- package/components/IconPicker/config/Emojis.js.map +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js +30 -43
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
- package/components/IconPicker/config/IconPackProvider.js +10 -16
- package/components/IconPicker/config/IconPackProvider.js.map +1 -1
- package/components/IconPicker/config/IconType.js +52 -55
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.js +35 -53
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/defaultIcon.js +1 -7
- package/components/IconPicker/defaultIcon.js.map +1 -1
- package/components/IconPicker/index.js +6 -47
- package/components/IconPicker/index.js.map +1 -1
- package/components/IconPicker/plugins/customPlugin.js +71 -96
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js +80 -117
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/graphql.js +19 -10
- package/components/IconPicker/plugins/graphql.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js +62 -93
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.d.ts +1 -1
- package/components/IconPicker/types.js +3 -8
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.js +24 -31
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/index.js +1 -12
- package/components/LexicalEditor/index.js.map +1 -1
- package/components/MultiImageUpload.d.ts +1 -1
- package/components/MultiImageUpload.js +8 -31
- package/components/MultiImageUpload.js.map +1 -1
- package/components/OptionsMenu/OptionsMenu.d.ts +1 -0
- package/components/OptionsMenu/OptionsMenu.js +17 -23
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuItem.d.ts +1 -0
- package/components/OptionsMenu/OptionsMenuItem.js +12 -17
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuLink.d.ts +1 -0
- package/components/OptionsMenu/OptionsMenuLink.js +13 -36
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
- package/components/OptionsMenu/index.js +4 -51
- package/components/OptionsMenu/index.js.map +1 -1
- package/components/OptionsMenu/useOptionsMenuItem.js +12 -18
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.d.ts +6 -16
- package/components/OverlayLayout/OverlayLayout.js +42 -147
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.d.ts +7 -0
- package/components/OverlayLayout/components/OverlayBackdrop.js +15 -0
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -0
- package/components/OverlayLayout/components/OverlayContent.d.ts +6 -0
- package/components/OverlayLayout/components/OverlayContent.js +21 -0
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -0
- package/components/OverlayLayout/components/OverlayHeader.d.ts +13 -0
- package/components/OverlayLayout/components/OverlayHeader.js +44 -0
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -0
- package/components/OverlayLayout/components/OverlayRoot.d.ts +9 -0
- package/components/OverlayLayout/components/OverlayRoot.js +19 -0
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -0
- package/components/OverlayLayout/components/index.d.ts +4 -0
- package/components/OverlayLayout/components/index.js +6 -0
- package/components/OverlayLayout/components/index.js.map +1 -0
- package/components/OverlayLayout/index.js +1 -16
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/CannotUseAaclAlert.js +5 -12
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.js +37 -48
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.d.ts +6 -0
- package/components/Permissions/PermissionsGroup.js +18 -0
- package/components/Permissions/PermissionsGroup.js.map +1 -0
- package/components/Permissions/StyledComponents.d.ts +1 -2
- package/components/Permissions/StyledComponents.js +12 -25
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.d.ts +1 -0
- package/components/Permissions/index.js +4 -35
- package/components/Permissions/index.js.map +1 -1
- package/components/ResizablePanels/index.js +1 -42
- package/components/ResizablePanels/index.js.map +1 -1
- package/components/RichTextEditor/RichTextEditor.js +13 -21
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js +2 -19
- package/components/RichTextEditor/index.js.map +1 -1
- package/components/RichTextEditor/tools/header/index.js +455 -521
- package/components/RichTextEditor/tools/header/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/index.js +147 -182
- package/components/RichTextEditor/tools/image/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/svgs.js +4 -10
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
- package/components/RichTextEditor/tools/image/tunes.js +75 -96
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
- package/components/RichTextEditor/tools/image/types.js +1 -5
- package/components/RichTextEditor/tools/image/ui.js +143 -174
- package/components/RichTextEditor/tools/image/ui.js.map +1 -1
- package/components/RichTextEditor/tools/paragraph/index.js +337 -389
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
- package/components/RichTextEditor/tools/textColor/index.js +164 -202
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
- package/components/RichTextEditor/tools/utils.js +3 -9
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.js +14 -23
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.d.ts +2 -1
- package/components/SearchUI.js +22 -48
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +14 -7
- package/components/SimpleForm/SimpleForm.js +72 -77
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +1 -30
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.js +39 -47
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +19 -1
- package/components/SingleImageUpload.js +39 -75
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +4 -4
- package/components/SplitView/SplitView.js +41 -88
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +1 -24
- package/components/SplitView/index.js.map +1 -1
- package/components/StateInspector.js +28 -28
- package/components/StateInspector.js.map +1 -1
- package/components/Wcp.js +21 -25
- package/components/Wcp.js.map +1 -1
- package/components/index.js +3 -26
- package/components/index.js.map +1 -1
- package/config/AdminConfig/Menu/MenuGroup.d.ts +62 -0
- package/config/AdminConfig/Menu/MenuGroup.js +14 -0
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -0
- package/config/AdminConfig/Menu/MenuItem.d.ts +43 -0
- package/config/AdminConfig/Menu/MenuItem.js +14 -0
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/MenuLink.d.ts +43 -0
- package/config/AdminConfig/Menu/MenuLink.js +18 -0
- package/config/AdminConfig/Menu/MenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +43 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +13 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +24 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +13 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu.d.ts +72 -0
- package/config/AdminConfig/Menu/SupportMenu.js +49 -0
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.d.ts +41 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +7 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.d.ts +41 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +7 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.d.ts +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +3 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/types.d.ts +7 -0
- package/config/AdminConfig/Menu/UserMenu/types.js +3 -0
- package/config/AdminConfig/Menu/UserMenu/types.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu.d.ts +129 -0
- package/config/AdminConfig/Menu/UserMenu.js +61 -0
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -0
- package/config/AdminConfig/Menu/types.d.ts +7 -0
- package/config/AdminConfig/Menu/types.js +3 -0
- package/config/AdminConfig/Menu/types.js.map +1 -0
- package/config/AdminConfig/Menu.d.ts +350 -0
- package/config/AdminConfig/Menu.js +75 -0
- package/config/AdminConfig/Menu.js.map +1 -0
- package/config/AdminConfig/Route.d.ts +3 -0
- package/config/AdminConfig/Route.js +8 -0
- package/config/AdminConfig/Route.js.map +1 -0
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +23 -0
- package/config/AdminConfig/Tenant/TenantLogo.js +16 -0
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -0
- package/config/AdminConfig/Tenant/TenantName.d.ts +23 -0
- package/config/AdminConfig/Tenant/TenantName.js +16 -0
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -0
- package/config/AdminConfig/Tenant.d.ts +66 -0
- package/config/AdminConfig/Tenant.js +23 -0
- package/config/AdminConfig/Tenant.js.map +1 -0
- package/config/AdminConfig/Theme/assignColor.d.ts +2 -0
- package/config/AdminConfig/Theme/assignColor.js +22 -0
- package/config/AdminConfig/Theme/assignColor.js.map +1 -0
- package/config/AdminConfig/Theme/consts.d.ts +2 -0
- package/config/AdminConfig/Theme/consts.js +4 -0
- package/config/AdminConfig/Theme/consts.js.map +1 -0
- package/config/AdminConfig/Theme/types.d.ts +3 -0
- package/config/AdminConfig/Theme/types.js +3 -0
- package/config/AdminConfig/Theme/types.js.map +1 -0
- package/config/AdminConfig/Theme.d.ts +16 -0
- package/config/AdminConfig/Theme.js +22 -0
- package/config/AdminConfig/Theme.js.map +1 -0
- package/config/AdminConfig.d.ts +434 -0
- package/config/AdminConfig.js +47 -0
- package/config/AdminConfig.js.map +1 -0
- package/config/createAdminConfig.d.ts +57 -0
- package/config/createAdminConfig.js +94 -0
- package/config/createAdminConfig.js.map +1 -0
- package/hooks/index.js +10 -115
- package/hooks/index.js.map +1 -1
- package/hooks/useConfirmationDialog.js +26 -39
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +16 -21
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useIsMounted.js +6 -14
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useKeyHandler.js +28 -46
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js +9 -20
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useShiftKey.js +13 -26
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useSnackbar.js +22 -43
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.js +8 -18
- package/hooks/useStateIfMounted.js.map +1 -1
- package/hooks/useStateWithCallback.js +7 -20
- package/hooks/useStateWithCallback.js.map +1 -1
- package/index.d.ts +2 -5
- package/index.js +52 -491
- package/index.js.map +1 -1
- package/package.json +25 -23
- package/plugins/MenuPlugin.js +15 -36
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.js +15 -36
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +39 -48
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/styles.scss +7 -3
- package/types.d.ts +1 -36
- package/types.js +4 -11
- package/types.js.map +1 -1
- package/ui/UIElement.js +1 -18
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js +1 -18
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js +1 -12
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js +1 -24
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.js +43 -74
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.js +46 -79
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.js +12 -31
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js +1 -16
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.js +15 -37
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.js +67 -119
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +2 -20
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +8 -29
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.js +20 -40
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.js +20 -43
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js +1 -16
- package/ui/elements/ViewElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +17 -33
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement.js +90 -127
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +7 -23
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +40 -65
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +56 -82
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.js +37 -35
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
- package/ui/elements/form/FileManagerElement.js +43 -81
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.js +17 -40
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.js +100 -158
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.js +21 -42
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.js +28 -49
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.js +26 -48
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.js +38 -64
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.js +30 -50
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +19 -42
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +57 -90
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +16 -35
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +16 -35
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +16 -35
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
- package/ui/views/AdminView/components/Dialog.js +30 -36
- package/ui/views/AdminView/components/Dialog.js.map +1 -1
- package/ui/views/AdminView/components/Hamburger.js +12 -21
- package/ui/views/AdminView/components/Hamburger.js.map +1 -1
- package/ui/views/FormView/FormContainerElement.js +16 -53
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.d.ts +3 -1
- package/ui/views/FormView/FormContentElement.js +7 -19
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.js +11 -45
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.js +26 -75
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.js +104 -148
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.js +12 -31
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.js +62 -99
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +21 -44
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +16 -27
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.js +72 -123
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +28 -64
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.js +51 -82
- package/ui/views/SplitView.js.map +1 -1
- package/base/Version.d.ts +0 -3
- package/base/Version.js +0 -56
- package/base/Version.js.map +0 -1
- package/base/ui/Menu.d.ts +0 -51
- package/base/ui/Menu.js +0 -133
- package/base/ui/Menu.js.map +0 -1
- package/base/ui/Search.js +0 -61
- package/base/ui/Search.js.map +0 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +0 -20
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js +0 -48
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js.map +0 -1
- package/components/Dialogs/styled.d.ts +0 -10
- package/components/Dialogs/styled.js +0 -40
- package/components/Dialogs/styled.js.map +0 -1
- package/components/Filters/Filters.styled.d.ts +0 -13
- package/components/Filters/Filters.styled.js +0 -53
- package/components/Filters/Filters.styled.js.map +0 -1
- package/components/IconPicker/IconPicker.styles.d.ts +0 -63
- package/components/IconPicker/IconPicker.styles.js +0 -187
- package/components/IconPicker/IconPicker.styles.js.map +0 -1
- package/components/OptionsMenu/OptionsMenu.styled.d.ts +0 -3
- package/components/OptionsMenu/OptionsMenu.styled.js +0 -26
- package/components/OptionsMenu/OptionsMenu.styled.js.map +0 -1
- package/components/OverlayLayout/icons/close.svg +0 -13
- package/components/OverlayLayout/icons/navigate_before.svg +0 -16
- package/plugins/globalSearch/SearchBar.d.ts +0 -34
- package/plugins/globalSearch/SearchBar.js +0 -225
- package/plugins/globalSearch/SearchBar.js.map +0 -1
- package/plugins/globalSearch/SearchBarDropdown.d.ts +0 -23
- package/plugins/globalSearch/SearchBarDropdown.js +0 -82
- package/plugins/globalSearch/SearchBarDropdown.js.map +0 -1
- package/plugins/globalSearch/icons/round-search-24px.svg +0 -20
- package/plugins/globalSearch/index.d.ts +0 -6
- package/plugins/globalSearch/index.js +0 -17
- package/plugins/globalSearch/index.js.map +0 -1
- package/plugins/globalSearch/styled.d.ts +0 -18
- package/plugins/globalSearch/styled.js +0 -133
- package/plugins/globalSearch/styled.js.map +0 -1
- package/styles/material-theme-assignments.scss +0 -375
- package/styles/material.scss +0 -42
- package/styles/reset.scss +0 -1
- package/styles/theme.scss +0 -76
- package/ui/views/AdminView/components/Snackbar.d.ts +0 -3
- package/ui/views/AdminView/components/Snackbar.js +0 -33
- package/ui/views/AdminView/components/Snackbar.js.map +0 -1
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _UIElement2 = require("../../UIElement");
|
|
18
|
-
var FormElement = exports.FormElement = /*#__PURE__*/function (_UIElement) {
|
|
19
|
-
function FormElement(id, config) {
|
|
20
|
-
var _this;
|
|
21
|
-
(0, _classCallCheck2.default)(this, FormElement);
|
|
22
|
-
_this = (0, _callSuper2.default)(this, FormElement, [id, config]);
|
|
23
|
-
_this.useGrid(false);
|
|
24
|
-
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
|
+
})));
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
return (0, _createClass2.default)(FormElement, [{
|
|
28
|
-
key: "render",
|
|
29
|
-
value: function render(props) {
|
|
30
|
-
var _this2 = this;
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
32
|
-
onSubmit: this.config.onSubmit,
|
|
33
|
-
data: this.config.getData()
|
|
34
|
-
}, function (formProps) {
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, (0, _superPropGet2.default)(FormElement, "render", _this2, 3)([(0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
36
|
-
formProps: formProps
|
|
37
|
-
})]));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}]);
|
|
41
|
-
}(_UIElement2.UIElement);
|
|
18
|
+
}
|
|
42
19
|
|
|
43
20
|
//# sourceMappingURL=FormElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
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 { 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,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,QAA4C,cAAc;AACvE,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,171 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _UIElement2 = require("../../UIElement");
|
|
15
|
-
var FormFieldElement = exports.FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
16
|
-
function FormFieldElement(id, config) {
|
|
17
|
-
var _this;
|
|
18
|
-
(0, _classCallCheck2.default)(this, FormFieldElement);
|
|
19
|
-
_this = (0, _callSuper2.default)(this, FormFieldElement, [id, config]);
|
|
20
|
-
(0, _defineProperty2.default)(_this, "_beforeChange", []);
|
|
21
|
-
(0, _defineProperty2.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);
|
|
22
7
|
if (config.beforeChange) {
|
|
23
|
-
|
|
8
|
+
this._beforeChange.push(config.beforeChange);
|
|
24
9
|
}
|
|
25
10
|
if (config.afterChange) {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
_this.applyPlugins(FormFieldElement);
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
(0, _inherits2.default)(FormFieldElement, _UIElement);
|
|
32
|
-
return (0, _createClass2.default)(FormFieldElement, [{
|
|
33
|
-
key: "getName",
|
|
34
|
-
value: function getName() {
|
|
35
|
-
return this.config.name;
|
|
36
|
-
}
|
|
37
|
-
}, {
|
|
38
|
-
key: "getValidators",
|
|
39
|
-
value: function getValidators(props) {
|
|
40
|
-
if (!this.config.validators || typeof this.config.validators !== "function") {
|
|
41
|
-
return function () {
|
|
42
|
-
return true;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return this.config.validators(props);
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "getDefaultValue",
|
|
49
|
-
value: function getDefaultValue(props) {
|
|
50
|
-
if (typeof this.config.defaultValue === "function") {
|
|
51
|
-
return this.config.defaultValue(props);
|
|
52
|
-
}
|
|
53
|
-
return this.config.defaultValue;
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
key: "getLabel",
|
|
57
|
-
value: function getLabel(props) {
|
|
58
|
-
if (typeof this.config.label === "function") {
|
|
59
|
-
return this.config.label(props);
|
|
60
|
-
}
|
|
61
|
-
return this.config.label;
|
|
11
|
+
this._afterChange.push(config.afterChange);
|
|
62
12
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
13
|
+
this.applyPlugins(FormFieldElement);
|
|
14
|
+
}
|
|
15
|
+
getName() {
|
|
16
|
+
return this.config.name;
|
|
17
|
+
}
|
|
18
|
+
getValidators(props) {
|
|
19
|
+
if (!this.config.validators || typeof this.config.validators !== "function") {
|
|
20
|
+
return () => true;
|
|
70
21
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
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);
|
|
78
27
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
28
|
+
return this.config.defaultValue;
|
|
29
|
+
}
|
|
30
|
+
getLabel(props) {
|
|
31
|
+
if (typeof this.config.label === "function") {
|
|
32
|
+
return this.config.label(props);
|
|
83
33
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
34
|
+
return this.config.label;
|
|
35
|
+
}
|
|
36
|
+
getDescription(props) {
|
|
37
|
+
if (typeof this.config.description === "function") {
|
|
38
|
+
return this.config.description(props);
|
|
88
39
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
40
|
+
return this.config.description;
|
|
41
|
+
}
|
|
42
|
+
getPlaceholder(props) {
|
|
43
|
+
if (typeof this.config.placeholder === "function") {
|
|
44
|
+
return this.config.placeholder(props);
|
|
93
45
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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);
|
|
98
63
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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;
|
|
104
79
|
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (!callbackCallable) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
callbackCallable(val, form);
|
|
141
|
-
};
|
|
142
|
-
next(value);
|
|
143
|
-
}
|
|
144
|
-
}, {
|
|
145
|
-
key: "addBeforeChange",
|
|
146
|
-
value: function addBeforeChange(cb) {
|
|
147
|
-
this._beforeChange.push(cb);
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "addAfterChange",
|
|
151
|
-
value: function addAfterChange(cb) {
|
|
152
|
-
/**
|
|
153
|
-
* TODO @ts-refactor possibly different subtype. Or so TS complains.
|
|
154
|
-
*/
|
|
155
|
-
// @ts-expect-error
|
|
156
|
-
this._afterChange.push(cb);
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "setBeforeChange",
|
|
160
|
-
value: function setBeforeChange(cb) {
|
|
161
|
-
this._beforeChange = [cb];
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
key: "setAfterChange",
|
|
165
|
-
value: function setAfterChange(cb) {
|
|
166
|
-
this._afterChange = [cb];
|
|
167
|
-
}
|
|
168
|
-
}]);
|
|
169
|
-
}(_UIElement2.UIElement);
|
|
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
|
+
}
|
|
170
112
|
|
|
171
113
|
//# sourceMappingURL=FormFieldElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_UIElement2","require","FormFieldElement","exports","_UIElement","id","config","_this","_classCallCheck2","default","_callSuper2","_defineProperty2","beforeChange","_beforeChange","push","afterChange","_afterChange","applyPlugins","_inherits2","_createClass2","key","value","getName","name","getValidators","props","validators","getDefaultValue","defaultValue","getLabel","label","getDescription","description","getPlaceholder","placeholder","setLabel","setDescription","setPlaceholder","setDefaultValue","getIsDisabled","isDisabled","setIsDisabled","setValidators","onBeforeChange","cb","callbacks","_toConsumableArray2","next","val","callbackCallable","pop","onAfterChange","form","addBeforeChange","addAfterChange","setBeforeChange","setAfterChange","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-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":";;;;;;;;;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAA4D,IAqC/CC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,0BAAAE,UAAA;EAMzB,S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C;IACf;EAAC;IAAAD,GAAA;IAAAC,KAAA,EAED,SAAO8B,aAAaA,CAAC9B,KAAa,EAAE+B,IAAa,EAAQ;MACrD,IAAMP,SAAS,OAAAC,mBAAA,CAAArC,OAAA,EAAO,IAAI,CAACO,YAAY,CAAC;MACxC,IAAM+B,IAAI,GAAG,SAAPA,IAAIA,CAAIC,GAAW,EAAK;QAC1B,IAAMC,gBAAgB,GAAGJ,SAAS,CAACK,GAAG,CAAC,CAAC;QACxC,IAAI,CAACD,gBAAgB,EAAE;UACnB;QACJ;QACAA,gBAAgB,CAACD,GAAG,EAAEI,IAAI,CAAC;MAC/B,CAAC;MAEDL,IAAI,CAAC1B,KAAK,CAAC;IACf;EAAC;IAAAD,GAAA;IAAAC,KAAA,EAED,SAAOgC,eAAeA,CAACT,EAAgB,EAAQ;MAC3C,IAAI,CAAC/B,aAAa,CAACC,IAAI,CAAC8B,EAAE,CAAC;IAC/B;EAAC;IAAAxB,GAAA;IAAAC,KAAA,EAED,SAAOiC,cAAcA,CACjBV,EAAqB,EACjB;MACJ;AACR;AACA;MACQ;MACA,IAAI,CAAC5B,YAAY,CAACF,IAAI,CAAC8B,EAAE,CAAC;IAC9B;EAAC;IAAAxB,GAAA;IAAAC,KAAA,EAED,SAAOkC,eAAeA,CAACX,EAAgB,EAAQ;MAC3C,IAAI,CAAC/B,aAAa,GAAG,CAAC+B,EAAE,CAAC;IAC7B;EAAC;IAAAxB,GAAA;IAAAC,KAAA,EAED,SAAOmC,cAAcA,CAACZ,EAAe,EAAQ;MACzC,IAAI,CAAC5B,YAAY,GAAG,CAAC4B,EAAE,CAAC;IAC5B;EAAC;AAAA,EA9IKa,qBAAS","ignoreList":[]}
|
|
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 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-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":"AAEA,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,IA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IACJ;AACR;AACA;IACQ;IACA,IAAI,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,46 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.HiddenElement = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _FormFieldElement2 = require("./FormFieldElement");
|
|
14
|
-
var HiddenElement = exports.HiddenElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
15
|
-
function HiddenElement(id, config) {
|
|
16
|
-
var _this;
|
|
17
|
-
(0, _classCallCheck2.default)(this, HiddenElement);
|
|
18
|
-
_this = (0, _callSuper2.default)(this, HiddenElement, [id, config]);
|
|
19
|
-
_this.applyPlugins(HiddenElement);
|
|
20
|
-
return _this;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormFieldElement } from "./FormFieldElement";
|
|
3
|
+
export class HiddenElement extends FormFieldElement {
|
|
4
|
+
constructor(id, config) {
|
|
5
|
+
super(id, config);
|
|
6
|
+
this.applyPlugins(HiddenElement);
|
|
21
7
|
}
|
|
22
|
-
(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
value: function render(props) {
|
|
26
|
-
var _this2 = this;
|
|
27
|
-
if (!props.formProps) {
|
|
28
|
-
throw Error("HiddenElement must be placed inside of a FormElement.");
|
|
29
|
-
}
|
|
30
|
-
var Bind = props.formProps.Bind;
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
32
|
-
name: this.getName(),
|
|
33
|
-
validators: this.getValidators(props),
|
|
34
|
-
defaultValue: this.getDefaultValue(props),
|
|
35
|
-
beforeChange: function beforeChange(value, cb) {
|
|
36
|
-
return _this2.onBeforeChange(value, cb);
|
|
37
|
-
},
|
|
38
|
-
afterChange: function afterChange(value, form) {
|
|
39
|
-
return _this2.onAfterChange(value, form);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
8
|
+
render(props) {
|
|
9
|
+
if (!props.formProps) {
|
|
10
|
+
throw Error(`HiddenElement must be placed inside of a FormElement.`);
|
|
42
11
|
}
|
|
43
|
-
|
|
44
|
-
|
|
12
|
+
const {
|
|
13
|
+
Bind
|
|
14
|
+
} = props.formProps;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Bind, {
|
|
16
|
+
name: this.getName(),
|
|
17
|
+
validators: this.getValidators(props),
|
|
18
|
+
defaultValue: this.getDefaultValue(props),
|
|
19
|
+
beforeChange: (value, cb) => this.onBeforeChange(value, cb),
|
|
20
|
+
afterChange: (value, form) => this.onAfterChange(value, form)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
45
24
|
|
|
46
25
|
//# sourceMappingURL=HiddenElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","FormFieldElement","HiddenElement","constructor","id","config","applyPlugins","render","props","formProps","Error","Bind","createElement","name","getName","validators","getValidators","defaultValue","getDefaultValue","beforeChange","value","cb","onBeforeChange","afterChange","form","onAfterChange"],"sources":["HiddenElement.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport class HiddenElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(HiddenElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`HiddenElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n />\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACIC,gBAAgB;AAKpB,OAAO,MAAMC,aAAa,SAASD,gBAAgB,CAAC;EACzCE,WAAWA,CAACC,EAAU,EAAEC,MAA8B,EAAE;IAC3D,KAAK,CAACD,EAAE,EAAEC,MAAM,CAAC;IAEjB,IAAI,CAACC,YAAY,CAACJ,aAAa,CAAC;EACpC;EAEgBK,MAAMA,CAACC,KAAkC,EAAmB;IACxE,IAAI,CAACA,KAAK,CAACC,SAAS,EAAE;MAClB,MAAMC,KAAK,CAAC,uDAAuD,CAAC;IACxE;IAEA,MAAM;MAAEC;IAAK,CAAC,GAAGH,KAAK,CAACC,SAAS;IAEhC,oBACIT,KAAA,CAAAY,aAAA,CAACD,IAAI;MACDE,IAAI,EAAE,IAAI,CAACC,OAAO,CAAC,CAAE;MACrBC,UAAU,EAAE,IAAI,CAACC,aAAa,CAACR,KAAK,CAAE;MACtCS,YAAY,EAAE,IAAI,CAACC,eAAe,CAACV,KAAK,CAAE;MAC1CW,YAAY,EAAEA,CAACC,KAAa,EAAEC,EAAE,KAAK,IAAI,CAACC,cAAc,CAACF,KAAK,EAAEC,EAAE,CAAE;MACpEE,WAAW,EAAEA,CAACH,KAAa,EAAEI,IAAI,KAAK,IAAI,CAACC,aAAa,CAACL,KAAK,EAAEI,IAAI;IAAE,CACzE,CAAC;EAEV;AACJ","ignoreList":[]}
|
|
@@ -1,53 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _Input = require("@webiny/ui/Input");
|
|
14
|
-
var _FormFieldElement2 = require("./FormFieldElement");
|
|
15
|
-
var InputElement = exports.InputElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
16
|
-
function InputElement(id, config) {
|
|
17
|
-
var _this;
|
|
18
|
-
(0, _classCallCheck2.default)(this, InputElement);
|
|
19
|
-
_this = (0, _callSuper2.default)(this, InputElement, [id, config]);
|
|
20
|
-
_this.applyPlugins(InputElement);
|
|
21
|
-
return _this;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Input } from "@webiny/ui/Input";
|
|
3
|
+
import { FormFieldElement } from "./FormFieldElement";
|
|
4
|
+
export class InputElement extends FormFieldElement {
|
|
5
|
+
constructor(id, config) {
|
|
6
|
+
super(id, config);
|
|
7
|
+
this.applyPlugins(InputElement);
|
|
22
8
|
}
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
value: function render(props) {
|
|
27
|
-
var _this2 = this;
|
|
28
|
-
if (!props.formProps) {
|
|
29
|
-
throw Error("InputElement must be placed inside of a FormElement.");
|
|
30
|
-
}
|
|
31
|
-
var Bind = props.formProps.Bind;
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
33
|
-
name: this.getName(),
|
|
34
|
-
validators: this.getValidators(props),
|
|
35
|
-
defaultValue: this.getDefaultValue(props),
|
|
36
|
-
beforeChange: function beforeChange(value, cb) {
|
|
37
|
-
return _this2.onBeforeChange(value, cb);
|
|
38
|
-
},
|
|
39
|
-
afterChange: function afterChange(value, form) {
|
|
40
|
-
return _this2.onAfterChange(value, form);
|
|
41
|
-
}
|
|
42
|
-
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
43
|
-
"data-testid": "input-element-".concat(this.getLabel(props)),
|
|
44
|
-
label: this.getLabel(props),
|
|
45
|
-
placeholder: this.getPlaceholder(props),
|
|
46
|
-
disabled: this.getIsDisabled(props),
|
|
47
|
-
description: this.getDescription(props)
|
|
48
|
-
}));
|
|
9
|
+
render(props) {
|
|
10
|
+
if (!props.formProps) {
|
|
11
|
+
throw Error(`InputElement must be placed inside of a FormElement.`);
|
|
49
12
|
}
|
|
50
|
-
|
|
51
|
-
|
|
13
|
+
const {
|
|
14
|
+
Bind
|
|
15
|
+
} = props.formProps;
|
|
16
|
+
return /*#__PURE__*/React.createElement(Bind, {
|
|
17
|
+
name: this.getName(),
|
|
18
|
+
validators: this.getValidators(props),
|
|
19
|
+
defaultValue: this.getDefaultValue(props),
|
|
20
|
+
beforeChange: (value, cb) => this.onBeforeChange(value, cb),
|
|
21
|
+
afterChange: (value, form) => this.onAfterChange(value, form)
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
23
|
+
"data-testid": `input-element-${this.getLabel(props)}`,
|
|
24
|
+
label: this.getLabel(props),
|
|
25
|
+
placeholder: this.getPlaceholder(props),
|
|
26
|
+
disabled: this.getIsDisabled(props),
|
|
27
|
+
description: this.getDescription(props)
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
52
31
|
|
|
53
32
|
//# sourceMappingURL=InputElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Input","FormFieldElement","InputElement","constructor","id","config","applyPlugins","render","props","formProps","Error","Bind","createElement","name","getName","validators","getValidators","defaultValue","getDefaultValue","beforeChange","value","cb","onBeforeChange","afterChange","form","onAfterChange","getLabel","label","placeholder","getPlaceholder","disabled","getIsDisabled","description","getDescription"],"sources":["InputElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/ui/Input\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport type InputElementRenderProps = FormFieldElementRenderProps;\nexport class InputElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(InputElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`InputElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Input\n data-testid={`input-element-${this.getLabel(props)}`}\n label={this.getLabel(props)}\n placeholder={this.getPlaceholder(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SACIC,gBAAgB;AAMpB,OAAO,MAAMC,YAAY,SAASD,gBAAgB,CAAC;EACxCE,WAAWA,CAACC,EAAU,EAAEC,MAA8B,EAAE;IAC3D,KAAK,CAACD,EAAE,EAAEC,MAAM,CAAC;IAEjB,IAAI,CAACC,YAAY,CAACJ,YAAY,CAAC;EACnC;EAEgBK,MAAMA,CAACC,KAAkC,EAAmB;IACxE,IAAI,CAACA,KAAK,CAACC,SAAS,EAAE;MAClB,MAAMC,KAAK,CAAC,sDAAsD,CAAC;I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