@webiny/app-admin 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd
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/assets/icons/file_download.svg +1 -0
- package/assets/icons/file_upload.svg +1 -0
- package/base/Admin.d.ts +1 -1
- package/base/Admin.js +3 -1
- package/base/Admin.js.map +1 -1
- package/base/Base.d.ts +1 -1
- package/base/Base.js +3 -1
- package/base/Base.js.map +1 -1
- package/base/plugins/AddGraphQLQuerySelection.d.ts +1 -2
- package/base/plugins/AddGraphQLQuerySelection.js +5 -3
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/ApolloProvider.d.ts +4 -1
- package/base/providers/ApolloProvider.js +3 -1
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.d.ts +5 -1
- package/base/providers/TelemetryProvider.js +3 -6
- package/base/providers/TelemetryProvider.js.map +1 -1
- package/base/providers/UiStateProvider.d.ts +5 -1
- package/base/providers/UiStateProvider.js +3 -1
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.d.ts +4 -1
- package/base/providers/ViewCompositionProvider.js +3 -1
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.d.ts +9 -2
- package/base/ui/Brand.js +3 -1
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +5 -1
- package/base/ui/CenteredView.js +3 -1
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.d.ts +9 -2
- package/base/ui/Dashboard.js +3 -1
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.d.ts +7 -4
- package/base/ui/FileManager.js +19 -4
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.d.ts +8 -2
- package/base/ui/Layout.js +3 -1
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.d.ts +9 -2
- package/base/ui/LocaleSelector.js +3 -1
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.d.ts +5 -2
- package/base/ui/LoginScreen.js +3 -1
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.d.ts +9 -3
- package/base/ui/Logo.js +3 -1
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Menu.d.ts +6 -1
- package/base/ui/Menu.js +4 -3
- package/base/ui/Menu.js.map +1 -1
- package/base/ui/Navigation.d.ts +18 -6
- package/base/ui/Navigation.js +9 -5
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.d.ts +9 -2
- package/base/ui/NotFound.js +3 -1
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Search.d.ts +15 -4
- package/base/ui/Search.js +3 -1
- package/base/ui/Search.js.map +1 -1
- package/base/ui/Tags.d.ts +1 -1
- package/base/ui/Tags.js +7 -2
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/UserMenu.d.ts +35 -9
- package/base/ui/UserMenu.js +3 -1
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.d.ts +2 -1
- package/components/AdminLayout.js +3 -1
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.d.ts +5 -1
- package/components/AppInstaller/AppInstaller.js +9 -3
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.d.ts +2 -2
- package/components/AppInstaller/Sidebar.js +3 -1
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.js +3 -1
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.d.ts +0 -2
- package/components/AppInstaller/styled.js +3 -1
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.js +28 -58
- package/components/AppInstaller/useInstaller.js.map +1 -1
- package/components/BulkActions/Worker.d.ts +81 -0
- package/components/BulkActions/Worker.js +172 -0
- package/components/BulkActions/Worker.js.map +1 -0
- package/components/BulkActions/index.d.ts +2 -0
- package/components/BulkActions/index.js +29 -0
- package/components/BulkActions/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +5 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +31 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/index.d.ts +1 -0
- package/components/BulkActions/useDialogWithReport/index.js +18 -0
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +17 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +79 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +20 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js +28 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js.map +1 -0
- package/components/Buttons/Buttons.d.ts +23 -0
- package/components/Buttons/Buttons.js +78 -0
- package/components/Buttons/Buttons.js.map +1 -0
- package/components/Buttons/Buttons.styles.d.ts +5 -0
- package/components/Buttons/Buttons.styles.js +15 -0
- package/components/Buttons/Buttons.styles.js.map +1 -0
- package/components/Buttons/index.d.ts +2 -0
- package/components/Buttons/index.js +27 -0
- package/components/Buttons/index.js.map +1 -0
- package/components/Buttons/useButtons.d.ts +14 -0
- package/components/Buttons/useButtons.js +32 -0
- package/components/Buttons/useButtons.js.map +1 -0
- package/components/EmptyView.d.ts +2 -2
- package/components/EmptyView.js +3 -1
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.d.ts +16 -0
- package/components/Filters/Filters.js +30 -0
- package/components/Filters/Filters.js.map +1 -0
- package/components/Filters/Filters.styled.d.ts +13 -0
- package/components/Filters/Filters.styled.js +25 -0
- package/components/Filters/Filters.styled.js.map +1 -0
- package/components/Filters/index.d.ts +1 -0
- package/components/Filters/index.js +18 -0
- package/components/Filters/index.js.map +1 -0
- package/components/FloatingActionButton.d.ts +4 -1
- package/components/FloatingActionButton.js +3 -1
- package/components/FloatingActionButton.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.js +4 -2
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/index.js +3 -1
- package/components/LexicalEditor/index.js.map +1 -1
- package/components/MultiImageUpload.d.ts +2 -2
- package/components/MultiImageUpload.js +9 -3
- package/components/MultiImageUpload.js.map +1 -1
- package/components/OptionsMenu/OptionsMenu.d.ts +9 -0
- package/components/OptionsMenu/OptionsMenu.js +30 -0
- package/components/OptionsMenu/OptionsMenu.js.map +1 -0
- package/components/OptionsMenu/OptionsMenu.styled.d.ts +34 -0
- package/components/OptionsMenu/OptionsMenu.styled.js +16 -0
- package/components/OptionsMenu/OptionsMenu.styled.js.map +1 -0
- package/components/OptionsMenu/OptionsMenuItem.d.ts +9 -0
- package/components/OptionsMenu/OptionsMenuItem.js +23 -0
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -0
- package/components/OptionsMenu/OptionsMenuLink.d.ts +10 -0
- package/components/OptionsMenu/OptionsMenuLink.js +41 -0
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -0
- package/components/OptionsMenu/index.d.ts +4 -0
- package/components/OptionsMenu/index.js +53 -0
- package/components/OptionsMenu/index.js.map +1 -0
- package/components/OptionsMenu/useOptionsMenuItem.d.ts +13 -0
- package/components/OptionsMenu/useOptionsMenuItem.js +31 -0
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +0 -1
- package/components/OverlayLayout/OverlayLayout.js +3 -1
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/index.js +3 -1
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/CannotUseAaclAlert.d.ts +2 -2
- package/components/Permissions/CannotUseAaclAlert.js +3 -1
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.d.ts +2 -2
- package/components/Permissions/Permissions.js +3 -1
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/StyledComponents.d.ts +2 -2
- package/components/Permissions/StyledComponents.js +3 -1
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js +3 -1
- package/components/Permissions/index.js.map +1 -1
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/RichTextEditor.js +3 -1
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js +3 -1
- package/components/RichTextEditor/index.js.map +1 -1
- package/components/RichTextEditor/tools/header/index.d.ts +0 -2
- package/components/RichTextEditor/tools/header/index.js +3 -11
- package/components/RichTextEditor/tools/header/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/index.d.ts +0 -2
- package/components/RichTextEditor/tools/image/index.js +3 -8
- package/components/RichTextEditor/tools/image/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/svgs.js +3 -1
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
- package/components/RichTextEditor/tools/image/tunes.d.ts +0 -2
- package/components/RichTextEditor/tools/image/tunes.js +3 -6
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
- package/components/RichTextEditor/tools/image/types.js +3 -1
- package/components/RichTextEditor/tools/image/ui.d.ts +0 -2
- package/components/RichTextEditor/tools/image/ui.js +15 -14
- package/components/RichTextEditor/tools/image/ui.js.map +1 -1
- package/components/RichTextEditor/tools/paragraph/index.d.ts +0 -2
- package/components/RichTextEditor/tools/paragraph/index.js +13 -12
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
- package/components/RichTextEditor/tools/textColor/index.d.ts +0 -3
- package/components/RichTextEditor/tools/textColor/index.js +3 -11
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
- package/components/RichTextEditor/tools/utils.js +7 -5
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.d.ts +2 -2
- package/components/Routes.js +3 -1
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.d.ts +2 -2
- package/components/SearchUI.js +3 -1
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +9 -5
- package/components/SimpleForm/SimpleForm.js +5 -2
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +3 -1
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.d.ts +1 -2
- package/components/SimpleUI/InputField.js +3 -1
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +1 -1
- package/components/SingleImageUpload.js +3 -1
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +3 -3
- package/components/SplitView/SplitView.js +7 -5
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +3 -1
- package/components/SplitView/index.js.map +1 -1
- package/components/Wcp.d.ts +9 -0
- package/components/Wcp.js +20 -0
- package/components/Wcp.js.map +1 -0
- package/components/index.js +3 -1
- package/components/index.js.map +1 -1
- package/hooks/index.d.ts +7 -0
- package/hooks/index.js +84 -0
- package/hooks/index.js.map +1 -0
- package/hooks/useConfirmationDialog.js +3 -1
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +5 -1
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useIsMounted.d.ts +3 -0
- package/hooks/useIsMounted.js +24 -0
- package/hooks/useIsMounted.js.map +1 -0
- package/hooks/useKeyHandler.d.ts +8 -0
- package/hooks/useKeyHandler.js +82 -0
- package/hooks/useKeyHandler.js.map +1 -0
- package/hooks/useModKey.d.ts +1 -0
- package/hooks/useModKey.js +41 -0
- package/hooks/useModKey.js.map +1 -0
- package/hooks/useShiftKey.d.ts +1 -0
- package/hooks/useShiftKey.js +46 -0
- package/hooks/useShiftKey.js.map +1 -0
- package/hooks/useSnackbar.js +3 -1
- package/hooks/useSnackbar.js.map +1 -1
- package/index.d.ts +6 -3
- package/index.js +51 -17
- package/index.js.map +1 -1
- package/package.json +27 -25
- package/plugins/MenuPlugin.js +3 -3
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.js +3 -3
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/globalSearch/SearchBar.d.ts +5 -1
- package/plugins/globalSearch/SearchBar.js +16 -12
- package/plugins/globalSearch/SearchBar.js.map +1 -1
- package/plugins/globalSearch/SearchBarDropdown.js +3 -1
- package/plugins/globalSearch/SearchBarDropdown.js.map +1 -1
- package/plugins/globalSearch/index.d.ts +0 -1
- package/plugins/globalSearch/index.js +3 -1
- package/plugins/globalSearch/index.js.map +1 -1
- package/plugins/globalSearch/styled.d.ts +0 -2
- package/plugins/globalSearch/styled.js +3 -4
- package/plugins/globalSearch/styled.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +3 -1
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/styles/material-theme-assignments.scss +1 -1
- package/types.d.ts +14 -2
- package/types.js +3 -1
- package/types.js.map +1 -1
- package/ui/UIElement.js +3 -1
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js +3 -1
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js +3 -1
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js +3 -1
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.js +4 -2
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.js +6 -4
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.js +3 -1
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js +3 -1
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.js +3 -1
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.d.ts +1 -1
- package/ui/elements/NavigationMenuElement.js +7 -5
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +3 -1
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +3 -1
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.js +3 -1
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.js +3 -1
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js +3 -1
- package/ui/elements/ViewElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +3 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement.js +3 -1
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +3 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +3 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +3 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +0 -2
- package/ui/elements/form/FileManagerElement/styled.js +3 -1
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
- package/ui/elements/form/FileManagerElement.js +3 -4
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.js +3 -1
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.js +4 -2
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.js +3 -1
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.js +3 -1
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.js +3 -1
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.js +3 -1
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.js +3 -1
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +3 -1
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +6 -4
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
- package/ui/views/AdminView/components/Dialog.d.ts +2 -2
- package/ui/views/AdminView/components/Dialog.js +12 -10
- package/ui/views/AdminView/components/Dialog.js.map +1 -1
- package/ui/views/AdminView/components/Hamburger.d.ts +2 -2
- package/ui/views/AdminView/components/Hamburger.js +3 -1
- package/ui/views/AdminView/components/Hamburger.js.map +1 -1
- package/ui/views/AdminView/components/Snackbar.d.ts +2 -2
- package/ui/views/AdminView/components/Snackbar.js +6 -4
- package/ui/views/AdminView/components/Snackbar.js.map +1 -1
- package/ui/views/FormView/FormContainerElement.js +3 -1
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.js +3 -1
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.js +3 -1
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.js +3 -1
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.js +3 -1
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.js +3 -1
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.js +3 -2
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +3 -1
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +3 -1
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.js +7 -7
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +3 -1
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.js +3 -3
- package/ui/views/SplitView.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SearchWrapper","styled","width","height","display","position","top","left","bottom","pointerEvents","alignItems","paddingLeft","color","padding","outline","border","textTransform","letterSpacing","Search","value","onChange","onEnter","inputPlaceholder","inputOnKeyDown","useCallback","e","key"],"sources":["SearchUI.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport styled from \"@emotion/styled\";\nimport InputField from \"./SimpleUI/InputField\";\nimport { ReactComponent as SearchIcon } from \"@material-design-icons/svg/outlined/search.svg\";\n\nconst SearchWrapper = styled(\"div\")({\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n position: \"relative\",\n\n \"& .search__icon\": {\n position: \"absolute\",\n top: 0,\n left: 0,\n bottom: 0,\n pointerEvents: \"none\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: \"0.25rem\",\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n },\n\n \"& .search__input\": {\n width: \"100%\",\n padding: \"0.5rem 0.5rem 0.5rem 2.25rem\",\n outline: \"none\",\n border: \"none\",\n color: \"var(--mdc-theme-text-primary-on-background)\",\n \"&:focus\": {\n outline: \"none\"\n },\n \"&::placeholder\": {\n textTransform: \"uppercase\",\n letterSpacing: \"0.05em\",\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n }\n }\n});\n\nexport interface SearchProps {\n value: string;\n onChange: (value: string) => void;\n onEnter?: () => any;\n inputPlaceholder?: string;\n}\nconst Search
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_styled","_interopRequireDefault","_InputField","_search","SearchWrapper","styled","target","label","width","height","display","position","top","left","bottom","pointerEvents","alignItems","paddingLeft","color","padding","outline","border","textTransform","letterSpacing","Search","_ref","value","onChange","onEnter","_ref$inputPlaceholder","inputPlaceholder","inputOnKeyDown","useCallback","e","key","default","createElement","className","ReactComponent","onKeyDown","placeholder","autoComplete","_default","exports"],"sources":["SearchUI.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport styled from \"@emotion/styled\";\nimport InputField from \"./SimpleUI/InputField\";\nimport { ReactComponent as SearchIcon } from \"@material-design-icons/svg/outlined/search.svg\";\n\nconst SearchWrapper = styled(\"div\")({\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n position: \"relative\",\n\n \"& .search__icon\": {\n position: \"absolute\",\n top: 0,\n left: 0,\n bottom: 0,\n pointerEvents: \"none\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: \"0.25rem\",\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n },\n\n \"& .search__input\": {\n width: \"100%\",\n padding: \"0.5rem 0.5rem 0.5rem 2.25rem\",\n outline: \"none\",\n border: \"none\",\n color: \"var(--mdc-theme-text-primary-on-background)\",\n \"&:focus\": {\n outline: \"none\"\n },\n \"&::placeholder\": {\n textTransform: \"uppercase\",\n letterSpacing: \"0.05em\",\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n }\n }\n});\n\nexport interface SearchProps {\n value: string;\n onChange: (value: string) => void;\n onEnter?: () => any;\n inputPlaceholder?: string;\n}\nconst Search = ({ value, onChange, onEnter, inputPlaceholder = \"Search...\" }: SearchProps) => {\n const inputOnKeyDown = useCallback(\n e => {\n if (typeof onEnter === \"function\" && e.key === \"Enter\") {\n onEnter();\n }\n },\n [onEnter]\n );\n\n return (\n <SearchWrapper data-testid={\"default-data-list.search\"}>\n <div className=\"search__icon\">\n <SearchIcon />\n </div>\n <InputField\n onKeyDown={inputOnKeyDown}\n className=\"search__input\"\n placeholder={inputPlaceholder}\n value={value}\n onChange={onChange}\n autoComplete=\"off\"\n />\n </SearchWrapper>\n );\n};\n\nexport default Search;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAMK,aAAa,oBAAGC,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAE;EAChCC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAE,MAAM;EACfC,QAAQ,EAAE,UAAU;EAEpB,iBAAiB,EAAE;IACfA,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE,MAAM;IACrBL,OAAO,EAAE,MAAM;IACfM,UAAU,EAAE,QAAQ;IACpBC,WAAW,EAAE,SAAS;IACtBC,KAAK,EAAE;EACX,CAAC;EAED,kBAAkB,EAAE;IAChBV,KAAK,EAAE,MAAM;IACbW,OAAO,EAAE,8BAA8B;IACvCC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,MAAM;IACdH,KAAK,EAAE,6CAA6C;IACpD,SAAS,EAAE;MACPE,OAAO,EAAE;IACb,CAAC;IACD,gBAAgB,EAAE;MACdE,aAAa,EAAE,WAAW;MAC1BC,aAAa,EAAE,QAAQ;MACvBL,KAAK,EAAE;IACX;EACJ;AACJ,CAAC,CAAC;AAQF,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAkF;EAAA,IAA5EC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAAC,qBAAA,GAAAJ,IAAA,CAAEK,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,WAAW,GAAAA,qBAAA;EACtE,IAAME,cAAc,GAAG,IAAAC,kBAAW,EAC9B,UAAAC,CAAC,EAAI;IACD,IAAI,OAAOL,OAAO,KAAK,UAAU,IAAIK,CAAC,CAACC,GAAG,KAAK,OAAO,EAAE;MACpDN,OAAO,CAAC,CAAC;IACb;EACJ,CAAC,EACD,CAACA,OAAO,CACZ,CAAC;EAED,oBACI/B,MAAA,CAAAsC,OAAA,CAAAC,aAAA,CAAChC,aAAa;IAAC,eAAa;EAA2B,gBACnDP,MAAA,CAAAsC,OAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAc,gBACzBxC,MAAA,CAAAsC,OAAA,CAAAC,aAAA,CAACjC,OAAA,CAAAmC,cAAU,MAAE,CACZ,CAAC,eACNzC,MAAA,CAAAsC,OAAA,CAAAC,aAAA,CAAClC,WAAA,CAAAiC,OAAU;IACPI,SAAS,EAAER,cAAe;IAC1BM,SAAS,EAAC,eAAe;IACzBG,WAAW,EAAEV,gBAAiB;IAC9BJ,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBc,YAAY,EAAC;EAAK,CACrB,CACU,CAAC;AAExB,CAAC;AAAC,IAAAC,QAAA,GAEalB,MAAM;AAAAmB,OAAA,CAAAR,OAAA,GAAAO,QAAA"}
|
|
@@ -5,17 +5,21 @@ interface SimpleFormProps {
|
|
|
5
5
|
noElevation?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const SimpleForm:
|
|
8
|
+
export declare const SimpleForm: (props: SimpleFormProps) => JSX.Element;
|
|
9
9
|
interface SimpleFormHeaderProps {
|
|
10
10
|
title: React.ReactNode;
|
|
11
11
|
icon?: React.ReactElement<any>;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
|
+
["data-testid"]?: string;
|
|
13
14
|
}
|
|
14
|
-
export declare const SimpleFormHeader:
|
|
15
|
-
interface SimpleFormFooterProps {
|
|
15
|
+
export declare const SimpleFormHeader: (props: SimpleFormHeaderProps) => JSX.Element;
|
|
16
|
+
export interface SimpleFormFooterProps {
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
className?: string;
|
|
18
19
|
}
|
|
19
|
-
export declare const SimpleFormFooter:
|
|
20
|
-
|
|
20
|
+
export declare const SimpleFormFooter: (props: SimpleFormFooterProps) => JSX.Element;
|
|
21
|
+
interface SimpleFormContentProps {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const SimpleFormContent: (props: SimpleFormContentProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
21
25
|
export {};
|
|
@@ -50,7 +50,8 @@ var SimpleForm = function SimpleForm(props) {
|
|
|
50
50
|
exports.SimpleForm = SimpleForm;
|
|
51
51
|
var SimpleFormHeader = function SimpleFormHeader(props) {
|
|
52
52
|
return /*#__PURE__*/React.createElement(_Grid.Grid, {
|
|
53
|
-
className: header
|
|
53
|
+
className: header,
|
|
54
|
+
"data-testid": props["data-testid"]
|
|
54
55
|
}, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
55
56
|
span: props.children ? 6 : 12,
|
|
56
57
|
className: title
|
|
@@ -74,4 +75,6 @@ exports.SimpleFormFooter = SimpleFormFooter;
|
|
|
74
75
|
var SimpleFormContent = function SimpleFormContent(props) {
|
|
75
76
|
return props.children;
|
|
76
77
|
};
|
|
77
|
-
exports.SimpleFormContent = SimpleFormContent;
|
|
78
|
+
exports.SimpleFormContent = SimpleFormContent;
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=SimpleForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SimpleFormContainer","styled","position","margin","header","css","borderBottom","color","title","display","alignItems","actions","justifyContent","icon","marginRight","footer","SimpleForm","props","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_styled","_interopRequireDefault","_emotion","_classnames","_Grid","_Typography","_Elevation","_Icon","SimpleFormContainer","styled","target","label","position","margin","header","css","borderBottom","color","title","display","alignItems","actions","justifyContent","icon","marginRight","footer","SimpleForm","props","createElement","className","classNames","noElevation","children","Elevation","z","exports","SimpleFormHeader","Grid","Cell","span","Fragment","Icon","Typography","use","SimpleFormFooter","SimpleFormContent"],"sources":["SimpleForm.tsx"],"sourcesContent":["import * as React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { Icon } from \"@webiny/ui/Icon\";\n\nconst SimpleFormContainer = styled(\"div\")({\n position: \"relative\",\n margin: \"17px 50px\"\n});\n\nconst header = css({\n borderBottom: \"1px solid var(--mdc-theme-on-background)\",\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst title = css({\n display: \"flex\",\n alignItems: \"center\"\n});\n\nconst actions = css({\n display: \"flex\",\n justifyContent: \"flex-end\",\n alignItems: \"center\"\n});\n\nconst icon = css({\n marginRight: 15,\n color: \"var(--mdc-theme-text-primary-on-background)\"\n});\n\nconst footer = css`\n display: flex;\n justify-content: flex-end;\n flex-wrap: wrap;\n border-top: 1px solid var(--mdc-theme-on-background);\n padding: 24px;\n box-sizing: border-box;\n min-height: 52px;\n button:last-of-type {\n margin-left: 8px;\n }\n`;\n\ninterface SimpleFormProps {\n children: React.ReactNode;\n \"data-testid\"?: string;\n noElevation?: boolean;\n className?: string;\n}\nexport const SimpleForm = (props: SimpleFormProps) => {\n return (\n <SimpleFormContainer\n className={classNames(\"webiny-data-list\", props.className)}\n data-testid={props[\"data-testid\"]}\n >\n {props.noElevation ? props.children : <Elevation z={1}>{props.children}</Elevation>}\n </SimpleFormContainer>\n );\n};\n\ninterface SimpleFormHeaderProps {\n title: React.ReactNode;\n icon?: React.ReactElement<any>;\n children?: React.ReactNode;\n [\"data-testid\"]?: string;\n}\nexport const SimpleFormHeader = (props: SimpleFormHeaderProps) => {\n return (\n <Grid className={header} data-testid={props[\"data-testid\"]}>\n <Cell span={props.children ? 6 : 12} className={title}>\n <React.Fragment>\n {props.icon && <Icon className={icon} icon={props.icon} />}\n <Typography use=\"headline5\">{props.title}</Typography>\n </React.Fragment>\n </Cell>\n {props.children && (\n <Cell span={6} className={actions}>\n {props.children}\n </Cell>\n )}\n </Grid>\n );\n};\n\nexport interface SimpleFormFooterProps {\n children: React.ReactNode;\n className?: string;\n}\nexport const SimpleFormFooter = (props: SimpleFormFooterProps) => {\n return <div className={classNames(footer, props.className)}>{props.children}</div>;\n};\n\ninterface SimpleFormContentProps {\n children: React.ReactNode;\n}\n\nexport const SimpleFormContent = (props: SimpleFormContentProps) => {\n return props.children as unknown as React.ReactElement;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAEA,IAAMS,mBAAmB,oBAAGC,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAE;EACtCC,QAAQ,EAAE,UAAU;EACpBC,MAAM,EAAE;AACZ,CAAC,CAAC;AAEF,IAAMC,MAAM,gBAAG,IAAAC,YAAG,EAAC;EACfC,YAAY,EAAE,0CAA0C;EACxDC,KAAK,EAAE;AACX,CAAC,kBAAC;AAEF,IAAMC,KAAK,gBAAG,IAAAH,YAAG,EAAC;EACdI,OAAO,EAAE,MAAM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,CAACrB,KAAA,CAAAkC,IAAI;IAACZ,SAAS,EAAEN,IAAK;IAACA,IAAI,EAAEI,KAAK,CAACJ;EAAK,CAAE,CAAC,eAC1D1B,KAAA,CAAA+B,aAAA,CAACvB,WAAA,CAAAqC,UAAU;IAACC,GAAG,EAAC;EAAW,GAAEhB,KAAK,CAACT,KAAkB,CACzC,CACd,CAAC,EACNS,KAAK,CAACK,QAAQ,iBACXnC,KAAA,CAAA+B,aAAA,CAACxB,KAAA,CAAAkC,IAAI;IAACC,IAAI,EAAE,CAAE;IAACV,SAAS,EAAER;EAAQ,GAC7BM,KAAK,CAACK,QACL,CAER,CAAC;AAEf,CAAC;AAACG,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAMK,IAAMQ,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIjB,KAA4B,EAAK;EAC9D,oBAAO9B,KAAA,CAAA+B,aAAA;IAAKC,SAAS,EAAE,IAAAC,mBAAU,EAACL,MAAM,EAAEE,KAAK,CAACE,SAAS;EAAE,GAAEF,KAAK,CAACK,QAAc,CAAC;AACtF,CAAC;AAACG,OAAA,CAAAS,gBAAA,GAAAA,gBAAA;AAMK,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIlB,KAA6B,EAAK;EAChE,OAAOA,KAAK,CAACK,QAAQ;AACzB,CAAC;AAACG,OAAA,CAAAU,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SimpleForm, SimpleFormHeader, SimpleFormFooter, SimpleFormContent } from \"./SimpleForm\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA"}
|
|
1
|
+
{"version":3,"names":["_SimpleForm","require"],"sources":["index.ts"],"sourcesContent":["export { SimpleForm, SimpleFormHeader, SimpleFormFooter, SimpleFormContent } from \"./SimpleForm\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="web" />
|
|
2
1
|
import React from "react";
|
|
3
2
|
interface InputBoxProps {
|
|
4
3
|
value?: string | number;
|
|
@@ -8,5 +7,5 @@ interface InputBoxProps {
|
|
|
8
7
|
type?: "string" | "number";
|
|
9
8
|
[key: string]: any;
|
|
10
9
|
}
|
|
11
|
-
declare const _default: React.
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ className, value, onChange, onKeyDown, label, description, validation, defaultValue, ...props }: InputBoxProps) => JSX.Element>;
|
|
12
11
|
export default _default;
|
|
@@ -99,4 +99,6 @@ var InputField = function InputField(_ref) {
|
|
|
99
99
|
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description));
|
|
100
100
|
};
|
|
101
101
|
var _default = /*#__PURE__*/_react.default.memo(InputField);
|
|
102
|
-
exports.default = _default;
|
|
102
|
+
exports.default = _default;
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=InputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["inputStyle","css","boxSizing","border","width","height","padding","textAlign","minHeight","backgroundColor","transition","opacity","cursor","WebkitAppearance","margin","labelStyle","marginBottom","color","getValue","params","value","defaultValue","type","isNaN","InputField","className","onChange","onKeyDown","label","description","validation","isValid","props","classNames","ev","target","toLowerCase","omit","message","React","memo"],"sources":["InputField.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\nimport omit from \"lodash/omit\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { FormElementMessage } from \"@webiny/ui/FormElementMessage\";\n\nconst inputStyle = css({\n boxSizing: \"border-box\",\n border: \"1px solid var(--mdc-theme-on-background)\",\n width: \"100%\",\n height: \"100%\",\n padding: \"4px 8px\",\n textAlign: \"left\",\n minHeight: 32,\n backgroundColor: \"var(--mdc-theme-surface)\",\n transition: \"150ms all ease-in-out\",\n \"&:focus:not(:disabled)\": {\n backgroundColor: \"var(--mdc-theme-on-background)\"\n },\n \"&:hover:not(:disabled)\": {\n backgroundColor: \"var(--mdc-theme-on-background)\"\n },\n \"&:disabled\": {\n opacity: 0.5,\n cursor: \"not-allowed\"\n },\n\n \"&.text-center\": {\n textAlign: \"center\",\n padding: 4\n },\n\n \"&::-webkit-inner-spin-button\": {\n WebkitAppearance: \"none\",\n margin: 0\n },\n \"&::-webkit-outer-spin-button\": {\n WebkitAppearance: \"none\",\n margin: 0\n }\n});\n\nconst labelStyle = css({\n marginBottom: 8,\n padding: \"0px 8px\",\n \"& span\": {\n color: \"var(--mdc-theme-text-primary-on-background)\"\n }\n});\n\ninterface GetValueParams {\n value: string | number | undefined;\n defaultValue: string | number;\n type: \"number\" | \"string\";\n}\nconst getValue = (params: GetValueParams): string => {\n const { value, defaultValue, type } = params;\n if (type === \"number\") {\n return (isNaN(value as number) ? defaultValue : value) as string;\n }\n return (value || defaultValue) as string;\n};\n\ninterface InputBoxProps {\n value?: string | number;\n onChange?: (value: any) => void;\n onKeyDown?: (e: React.SyntheticEvent<HTMLInputElement>) => any;\n defaultValue?: string | number;\n type?: \"string\" | \"number\";\n [key: string]: any;\n}\nconst InputField
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_emotion","_classnames","_omit","_Typography","_FormElementMessage","_excluded","inputStyle","css","boxSizing","border","width","height","padding","textAlign","minHeight","backgroundColor","transition","opacity","cursor","WebkitAppearance","margin","labelStyle","marginBottom","color","getValue","params","value","defaultValue","type","isNaN","InputField","_ref","className","onChange","onKeyDown","label","description","_ref$validation","validation","isValid","_ref$defaultValue","props","_objectWithoutProperties2","default","createElement","Fragment","Typography","use","Object","assign","classNames","ev","target","toLowerCase","omit","FormElementMessage","error","message","_default","React","memo","exports"],"sources":["InputField.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"emotion\";\nimport classNames from \"classnames\";\nimport omit from \"lodash/omit\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { FormElementMessage } from \"@webiny/ui/FormElementMessage\";\n\nconst inputStyle = css({\n boxSizing: \"border-box\",\n border: \"1px solid var(--mdc-theme-on-background)\",\n width: \"100%\",\n height: \"100%\",\n padding: \"4px 8px\",\n textAlign: \"left\",\n minHeight: 32,\n backgroundColor: \"var(--mdc-theme-surface)\",\n transition: \"150ms all ease-in-out\",\n \"&:focus:not(:disabled)\": {\n backgroundColor: \"var(--mdc-theme-on-background)\"\n },\n \"&:hover:not(:disabled)\": {\n backgroundColor: \"var(--mdc-theme-on-background)\"\n },\n \"&:disabled\": {\n opacity: 0.5,\n cursor: \"not-allowed\"\n },\n\n \"&.text-center\": {\n textAlign: \"center\",\n padding: 4\n },\n\n \"&::-webkit-inner-spin-button\": {\n WebkitAppearance: \"none\",\n margin: 0\n },\n \"&::-webkit-outer-spin-button\": {\n WebkitAppearance: \"none\",\n margin: 0\n }\n});\n\nconst labelStyle = css({\n marginBottom: 8,\n padding: \"0px 8px\",\n \"& span\": {\n color: \"var(--mdc-theme-text-primary-on-background)\"\n }\n});\n\ninterface GetValueParams {\n value: string | number | undefined;\n defaultValue: string | number;\n type: \"number\" | \"string\";\n}\nconst getValue = (params: GetValueParams): string => {\n const { value, defaultValue, type } = params;\n if (type === \"number\") {\n return (isNaN(value as number) ? defaultValue : value) as string;\n }\n return (value || defaultValue) as string;\n};\n\ninterface InputBoxProps {\n value?: string | number;\n onChange?: (value: any) => void;\n onKeyDown?: (e: React.SyntheticEvent<HTMLInputElement>) => any;\n defaultValue?: string | number;\n type?: \"string\" | \"number\";\n [key: string]: any;\n}\nconst InputField = ({\n className,\n value,\n onChange,\n onKeyDown,\n label,\n description,\n validation = { isValid: true },\n defaultValue = \"\",\n ...props\n}: InputBoxProps) => {\n return (\n <React.Fragment>\n {label && (\n <div className={labelStyle}>\n <Typography use={\"body2\"}>{label}</Typography>\n </div>\n )}\n <input\n className={classNames(inputStyle, className)}\n value={getValue({\n value,\n type: props.type || \"string\",\n defaultValue\n })}\n onKeyDown={onKeyDown}\n onChange={ev => {\n if (!onChange) {\n return;\n }\n onChange((ev.target.value || \"\").toLowerCase());\n }}\n {...omit(props, \"validate\")}\n />\n {validation.isValid === false && (\n <FormElementMessage error>{validation.message}</FormElementMessage>\n )}\n {validation.isValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </React.Fragment>\n );\n};\n\nexport default React.memo(InputField);\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAAmE,IAAAM,SAAA;AAEnE,IAAMC,UAAU,gBAAG,IAAAC,YAAG,EAAC;EACnBC,SAAS,EAAE,YAAY;EACvBC,MAAM,EAAE,0CAA0C;EAClDC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,MAAM;EACjBC,SAAS,EAAE,EAAE;EACbC,eAAe,EAAE,0BAA0B;EAC3CC,UAAU,EAAE,uBAAuB;EACnC,wBAAwB,EAAE;IACtBD,eAAe,EAAE;EACrB,CAAC;EACD,wBAAwB,EAAE;IACtBA,eAAe,EAAE;EACrB,CAAC;EACD,YAAY,EAAE;IACVE,OAAO,EAAE,GAAG;IACZC,MAAM,EAAE;EACZ,CAAC;EAED,eAAe,EAAE;IACbL,SAAS,EAAE,QAAQ;IACnBD,OAAO,EAAE;EACb,CAAC;EAED,8BAA8B,EAAE;IAC5BO,gBAAgB,EAAE,MAAM;IACxBC,MAAM,EAAE;EACZ,CAAC;EACD,8BAA8B,EAAE;IAC5BD,gBAAgB,EAAE,MAAM;IACxBC,MAAM,EAAE;EAC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|
|
|
51
51
|
*/
|
|
52
52
|
onChangePick?: string[];
|
|
53
53
|
}
|
|
54
|
-
declare const SingleImageUpload:
|
|
54
|
+
declare const SingleImageUpload: (props: SingleImageUploadProps) => JSX.Element;
|
|
55
55
|
export default SingleImageUpload;
|
|
@@ -95,4 +95,6 @@ var SingleImageUpload = function SingleImageUpload(props) {
|
|
|
95
95
|
}, validationMessage), validationIsValid !== false && description && /*#__PURE__*/React.createElement(_FormElementMessage.FormElementMessage, null, description));
|
|
96
96
|
};
|
|
97
97
|
var _default = SingleImageUpload;
|
|
98
|
-
exports.default = _default;
|
|
98
|
+
exports.default = _default;
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=SingleImageUpload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ImageUploadWrapper","styled","position","opacity","pointerEvents","transform","top","left","color","SingleImageUpload","props","className","value","validation","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_Image","Ui","_","_FormElementMessage","_styled","_interopRequireDefault","ImageUploadWrapper","styled","target","label","position","opacity","pointerEvents","transform","top","left","color","SingleImageUpload","props","className","value","validation","description","accept","_props$includeFileMet","includeFileMeta","maxSize","imagePreviewProps","round","_ref","validationIsValid","isValid","validationMessage","message","onChange","useCallback","id","src","createElement","FileManager","images","render","_ref2","showFileManager","Image","renderImagePreview","renderImageProps","Object","assign","style","width","height","uploadImage","removeImage","FormElementMessage","error","_default","exports","default"],"sources":["SingleImageUpload.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Image } from \"@webiny/app/components/Image\";\nimport * as Ui from \"@webiny/ui/ImageUpload\";\nimport { FileManager, FileManagerFileItem } from \"~/index\";\nimport { FormComponentProps } from \"@webiny/ui/types\";\nimport { FormElementMessage } from \"@webiny/ui/FormElementMessage\";\nimport styled from \"@emotion/styled\";\nimport { useCallback } from \"react\";\n\nconst ImageUploadWrapper = styled(\"div\")({\n position: \"relative\",\n \".disabled\": {\n opacity: 0.75,\n pointerEvents: \"none\"\n },\n \".mdc-floating-label--float-above\": {\n transform: \"scale(0.75)\",\n top: 10,\n left: 10,\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n },\n \".mdc-text-field-helper-text\": {\n color: \"var(--mdc-theme-text-secondary-on-background)\"\n }\n});\n\nexport interface SingleImageUploadProps extends FormComponentProps {\n /**\n * Accept types\n */\n accept?: string[];\n\n /**\n * Component label.\n */\n label?: string;\n\n /**\n * Is component disabled?\n */\n disabled?: boolean;\n\n /**\n * Description beneath the image.\n */\n description?: React.ReactNode;\n\n /**\n * A className for the root element.\n */\n className?: string;\n\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 */\n maxSize?: number | string;\n\n /**\n * onChange callback when a file is set or unset.\n * It is marked as `optional` because this component is often used in conjunction with <Bind>, which injects the\n * `onChange` into its child element. In that case, that prop is not passed by the developer.\n */\n onChange?: (value: FileManagerFileItem | null) => void;\n\n /**\n * Optional custom props, passed to the preview image.\n */\n imagePreviewProps?: any;\n\n /**\n * By default, file meta is not included in the data passed to `onChange`. If you need it, set this flag to true.\n */\n includeFileMeta?: boolean;\n\n /**\n * Is the wrapper round?\n */\n round?: boolean;\n\n /**\n * Define the properties that are returned on file(s) selection.\n * @deprecated Pick the desired file attributes in the `onChange` callback, or `beforeChange` on the `<Bind>` element.\n */\n onChangePick?: string[];\n}\n\nconst SingleImageUpload = (props: SingleImageUploadProps) => {\n const {\n className,\n value,\n validation,\n label,\n description,\n accept,\n includeFileMeta = false,\n maxSize,\n imagePreviewProps,\n round\n } = props;\n\n const { isValid: validationIsValid, message: validationMessage } = validation || {};\n\n const onChange = useCallback(\n (value: FileManagerFileItem | null) => {\n if (!props.onChange) {\n return;\n }\n\n if (value && !includeFileMeta) {\n props.onChange({ id: value.id, src: value.src });\n return;\n }\n\n if (value && includeFileMeta) {\n props.onChange(value);\n return;\n }\n\n props.onChange(null);\n },\n [props.onChange]\n );\n\n return (\n <ImageUploadWrapper className={className}>\n {label && (\n <div className=\"mdc-floating-label mdc-floating-label--float-above\">{label}</div>\n )}\n\n <FileManager\n onChange={onChange}\n accept={accept}\n images={!accept}\n maxSize={maxSize}\n render={({ showFileManager }) => (\n <Ui.Image\n renderImagePreview={renderImageProps => (\n <Image {...renderImageProps} {...imagePreviewProps} />\n )}\n style={{ width: \"100%\", height: \"auto\" }}\n value={value}\n uploadImage={showFileManager}\n removeImage={() => onChange(null)}\n round={round}\n />\n )}\n />\n\n {validationIsValid === false && (\n <FormElementMessage error>{validationMessage}</FormElementMessage>\n )}\n {validationIsValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </ImageUploadWrapper>\n );\n};\n\nexport default SingleImageUpload;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,CAAA,GAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AAGA,IAAMO,kBAAkB,oBAAGC,eAAM,EAAC,KAAK;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAE;EACrCC,QAAQ,EAAE,UAAU;EACpB,WAAW,EAAE;IACTC,OAAO,EAAE,IAAI;IACbC,aAAa,EAAE;EACnB,CAAC;EACD,kCAAkC,EAAE;IAChCC,SAAS,EAAE,aAAa;IACxBC,GAAG,EAAE,EAAE;IACPC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE;EACX,CAAC;EACD,6BAA6B,EAAE;IAC3BA,KAAK,EAAE;EACX;AACJ,CAAC,CAAC;AA+DF,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,KAA6B,EAAK;EACzD,IACIC,SAAS,GAUTD,KAAK,CAVLC,SAAS;IACTC,KAAK,GASLF,KAAK,CATLE,K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qC,WAAW;IACRL,QAAQ,EAAEA,QAAS;IACnBX,MAAM,EAAEA,MAAO;IACfiB,MAAM,EAAE,CAACjB,MAAO;IAChBG,OAAO,EAAEA,OAAQ;IACjBe,MAAM,EAAE,SAAAA,OAAAC,KAAA;MAAA,IAAGC,eAAe,GAAAD,KAAA,CAAfC,eAAe;MAAA,oBACtB9C,KAAA,CAAAyC,aAAA,CAACrC,EAAE,CAAC2C,KAAK;QACLC,kBAAkB,EAAE,SAAAA,mBAAAC,gBAAgB;UAAA,oBAChCjD,KAAA,CAAAyC,aAAA,CAACtC,MAAA,CAAA4C,KAAK,EAAAG,MAAA,CAAAC,MAAA,KAAKF,gBAAgB,EAAMnB,iBAAiB,CAAG,CAAC;QAAA,CACxD;QACFsB,KAAK,EAAE;UAAEC,KAAK,EAAE,MAAM;UAAEC,MAAM,EAAE;QAAO,CAAE;QACzC/B,KAAK,EAAEA,KAAM;QACbgC,WAAW,EAAET,eAAgB;QAC7BU,WAAW,EAAE,SAAAA,YAAA;UAAA,OAAMnB,QAAQ,CAAC,IAAI,CAAC;QAAA,CAAC;QAClCN,KAAK,EAAEA;MAAM,CAChB,CAAC;IAAA;EACJ,CACL,CAAC,EAEDE,iBAAiB,KAAK,KAAK,iBACxBjC,KAAA,CAAAyC,aAAA,CAACnC,mBAAA,CAAAmD,kBAAkB;IAACC,KAAK;EAAA,GAAEvB,iBAAsC,CACpE,EACAF,iBAAiB,KAAK,KAAK,IAAIR,WAAW,iBACvCzB,KAAA,CAAAyC,aAAA,CAACnC,mBAAA,CAAAmD,kBAAkB,QAAEhC,WAAgC,CAEzC,CAAC;AAE7B,CAAC;AAAC,IAAAkC,QAAA,GAEavC,iBAAiB;AAAAwC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,7 +5,7 @@ interface SplitViewProps {
|
|
|
5
5
|
children: React.ReactElement<any> | React.ReactElement<any>[];
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const SplitView:
|
|
9
|
-
declare const LeftPanel:
|
|
10
|
-
declare const RightPanel:
|
|
8
|
+
declare const SplitView: (props: SplitViewProps) => JSX.Element;
|
|
9
|
+
declare const LeftPanel: (props: CellProps) => JSX.Element;
|
|
10
|
+
declare const RightPanel: (props: CellProps) => JSX.Element;
|
|
11
11
|
export { SplitView, LeftPanel, RightPanel };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.leftPanel = exports.SplitView = exports.RightPanel = exports.LeftPanel = void 0;
|
|
9
|
-
var _clone2 = _interopRequireDefault(require("lodash/clone"));
|
|
10
9
|
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
11
|
var _Grid = require("@webiny/ui/Grid");
|
|
13
12
|
var _emotion = require("emotion");
|
|
14
13
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
14
|
+
var _clone = _interopRequireDefault(require("lodash/clone"));
|
|
15
15
|
var _Helpers = require("@webiny/ui/Helpers");
|
|
16
16
|
var grid = /*#__PURE__*/(0, _emotion.css)({
|
|
17
17
|
"&.mdc-layout-grid": {
|
|
@@ -56,7 +56,7 @@ var SplitView = function SplitView(props) {
|
|
|
56
56
|
};
|
|
57
57
|
exports.SplitView = SplitView;
|
|
58
58
|
var LeftPanel = function LeftPanel(props) {
|
|
59
|
-
var propList = (0,
|
|
59
|
+
var propList = (0, _clone.default)(props);
|
|
60
60
|
if (!propList.hasOwnProperty("span")) {
|
|
61
61
|
propList.span = 5;
|
|
62
62
|
}
|
|
@@ -64,7 +64,7 @@ var LeftPanel = function LeftPanel(props) {
|
|
|
64
64
|
};
|
|
65
65
|
exports.LeftPanel = LeftPanel;
|
|
66
66
|
var RightPanel = function RightPanel(props) {
|
|
67
|
-
var propList = (0,
|
|
67
|
+
var propList = (0, _clone.default)(props);
|
|
68
68
|
if (!propList.hasOwnProperty("span")) {
|
|
69
69
|
propList.span = 7;
|
|
70
70
|
}
|
|
@@ -73,4 +73,6 @@ var RightPanel = function RightPanel(props) {
|
|
|
73
73
|
id: "webiny-split-view-right-panel"
|
|
74
74
|
}, propList.children));
|
|
75
75
|
};
|
|
76
|
-
exports.RightPanel = RightPanel;
|
|
76
|
+
exports.RightPanel = RightPanel;
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=SplitView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["grid","css","padding","margin","backgroundColor","gridGap","RightPanelWrapper","styled","overflow","height","leftPanel","display","flexDirection","maxHeight","SplitView","props","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Grid","_emotion","_styled","_clone","_Helpers","grid","css","padding","margin","backgroundColor","gridGap","RightPanelWrapper","styled","target","label","overflow","height","leftPanel","display","flexDirection","maxHeight","exports","SplitView","props","createElement","Grid","className","classSet","children","LeftPanel","propList","clone","hasOwnProperty","span","Cell","getClasses","RightPanel","id"],"sources":["SplitView.tsx"],"sourcesContent":["import * as React from \"react\";\nimport classSet from \"classnames\";\nimport { Cell, Grid, CellProps } from \"@webiny/ui/Grid\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport clone from \"lodash/clone\";\nimport { getClasses } from \"@webiny/ui/Helpers\";\n\nconst grid = css({\n \"&.mdc-layout-grid\": {\n padding: 0,\n margin: \"-3px auto 0 auto\",\n backgroundColor: \"var(--mdc-theme-background)\",\n \">.mdc-layout-grid__inner\": {\n gridGap: 0\n }\n }\n});\n\nconst RightPanelWrapper = styled(\"div\")({\n backgroundColor: \"var(--mdc-theme-background)\",\n overflow: \"auto\",\n height: \"calc(100vh - 70px)\"\n});\n\nexport const leftPanel = css({\n backgroundColor: \"var(--mdc-theme-surface)\",\n \">.webiny-data-list\": {\n display: \"flex\",\n flexDirection: \"column\",\n height: \"calc(100vh - 70px)\",\n \".mdc-list\": {\n overflow: \"auto\"\n }\n },\n \">.mdc-list\": {\n display: \"flex\",\n flexDirection: \"column\",\n maxHeight: \"calc(100vh - 70px)\",\n overflow: \"auto\"\n }\n});\n\ninterface SplitViewProps {\n children: React.ReactElement<any> | React.ReactElement<any>[];\n className?: string;\n}\n\nconst SplitView = (props: SplitViewProps) => {\n return (\n <Grid className={classSet(grid, props.className, \"webiny-split-view\")}>\n {props.children}\n </Grid>\n );\n};\n\nconst LeftPanel = (props: CellProps) => {\n const propList = clone(props);\n if (!propList.hasOwnProperty(\"span\")) {\n propList.span = 5;\n }\n\n return (\n <Cell\n {...getClasses(\n propList,\n classSet(leftPanel, props.className, \"webiny-split-view__left-panel\")\n )}\n >\n {propList.children}\n </Cell>\n );\n};\n\nconst RightPanel = (props: CellProps) => {\n const propList = clone(props);\n if (!propList.hasOwnProperty(\"span\")) {\n propList.span = 7;\n }\n\n return (\n <Cell {...getClasses(propList, \"webiny-split-view__right-panel\")}>\n <RightPanelWrapper\n className={\"webiny-split-view__right-panel-wrapper\"}\n id={\"webiny-split-view-right-panel\"}\n >\n {propList.children}\n </RightPanelWrapper>\n </Cell>\n );\n};\n\nexport { SplitView, LeftPanel, RightPanel };\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,QAAA,GAAAP,OA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I,CAACO,QAAQ,CAACE,cAAc,CAAC,MAAM,CAAC,EAAE;IAClCF,QAAQ,CAACG,IAAI,GAAG,CAAC;EACrB;EAEA,oBACItC,KAAA,CAAA6B,aAAA,CAACxB,KAAA,CAAAkC,IAAI,EACG,IAAAC,mBAAU,EACVL,QAAQ,EACR,IAAAH,mBAAQ,EAACV,SAAS,EAAEM,KAAK,CAACG,SAAS,EAAE,+BAA+B,CACxE,CAAC,EAEAI,QAAQ,CAACF,QACR,CAAC;AAEf,CAAC;AAACP,OAAA,CAAAQ,SAAA,GAAAA,SAAA;AAEF,IAAMO,UAAU,GAAG,SAAbA,UAAUA,CAAIb,KAAgB,EAAK;EACrC,IAAMO,QAAQ,GAAG,IAAAC,cAAK,EAACR,KAAK,CAAC;EAC7B,IAAI,CAACO,QAAQ,CAACE,cAAc,CAAC,MAAM,CAAC,EAAE;IAClCF,QAAQ,CAACG,IAAI,GAAG,CAAC;EACrB;EAEA,oBACItC,KAAA,CAAA6B,aAAA,CAACxB,KAAA,CAAAkC,IAAI,EAAK,IAAAC,mBAAU,EAACL,QAAQ,EAAE,gCAAgC,CAAC,eAC5DnC,KAAA,CAAA6B,aAAA,CAACb,iBAAiB;IACde,SAAS,EAAE,wCAAyC;IACpDW,EAAE,EAAE;EAAgC,GAEnCP,QAAQ,CAACF,QACK,CACjB,CAAC;AAEf,CAAC;AAACP,OAAA,CAAAe,UAAA,GAAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { SplitView, LeftPanel, RightPanel } from \"./SplitView\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA"}
|
|
1
|
+
{"version":3,"names":["_SplitView","require"],"sources":["index.ts"],"sourcesContent":["export { SplitView, LeftPanel, RightPanel } from \"./SplitView\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface CanUsePrivateFilesProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare function CanUsePrivateFiles({ children }: CanUsePrivateFilesProps): JSX.Element | null;
|
|
6
|
+
export declare const Wcp: {
|
|
7
|
+
CanUsePrivateFiles: typeof CanUsePrivateFiles;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Wcp = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _appWcp = require("@webiny/app-wcp");
|
|
10
|
+
function CanUsePrivateFiles(_ref) {
|
|
11
|
+
var children = _ref.children;
|
|
12
|
+
var wcp = (0, _appWcp.useWcp)();
|
|
13
|
+
return wcp.canUsePrivateFiles() ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children) : null;
|
|
14
|
+
}
|
|
15
|
+
var Wcp = {
|
|
16
|
+
CanUsePrivateFiles: CanUsePrivateFiles
|
|
17
|
+
};
|
|
18
|
+
exports.Wcp = Wcp;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=Wcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_appWcp","CanUsePrivateFiles","_ref","children","wcp","useWcp","canUsePrivateFiles","default","createElement","Fragment","Wcp","exports"],"sources":["Wcp.tsx"],"sourcesContent":["import React from \"react\";\nimport { useWcp } from \"@webiny/app-wcp\";\n\ninterface CanUsePrivateFilesProps {\n children: React.ReactNode;\n}\n\nfunction CanUsePrivateFiles({ children }: CanUsePrivateFilesProps) {\n const wcp = useWcp();\n\n return wcp.canUsePrivateFiles() ? <>{children}</> : null;\n}\n\nexport const Wcp = {\n CanUsePrivateFiles\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAMA,SAASE,kBAAkBA,CAAAC,IAAA,EAAwC;EAAA,IAArCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAClC,IAAMC,GAAG,GAAG,IAAAC,cAAM,EAAC,CAAC;EAEpB,OAAOD,GAAG,CAACE,kBAAkB,CAAC,CAAC,gBAAGT,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAAAX,MAAA,CAAAU,OAAA,CAAAE,QAAA,QAAGN,QAAW,CAAC,GAAG,IAAI;AAC5D;AAEO,IAAMO,GAAG,GAAG;EACfT,kBAAkB,EAAlBA;AACJ,CAAC;AAACU,OAAA,CAAAD,GAAA,GAAAA,GAAA"}
|
package/components/index.js
CHANGED
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { FileManager } from \"~/base/ui/FileManager\";\n"],"mappings":";;;;;;;;;;;AAAA"}
|
|
1
|
+
{"version":3,"names":["_FileManager","require"],"sources":["index.ts"],"sourcesContent":["export { FileManager } from \"~/base/ui/FileManager\";\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA"}
|
package/hooks/index.d.ts
ADDED
package/hooks/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useConfirmationDialog = require("./useConfirmationDialog");
|
|
7
|
+
Object.keys(_useConfirmationDialog).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useConfirmationDialog[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _useConfirmationDialog[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _useDialog = require("./useDialog");
|
|
18
|
+
Object.keys(_useDialog).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useDialog[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _useDialog[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _useSnackbar = require("./useSnackbar");
|
|
29
|
+
Object.keys(_useSnackbar).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _useSnackbar[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _useSnackbar[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _useKeyHandler = require("./useKeyHandler");
|
|
40
|
+
Object.keys(_useKeyHandler).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _useKeyHandler[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _useKeyHandler[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _useShiftKey = require("./useShiftKey");
|
|
51
|
+
Object.keys(_useShiftKey).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _useShiftKey[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _useShiftKey[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _useModKey = require("./useModKey");
|
|
62
|
+
Object.keys(_useModKey).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _useModKey[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function get() {
|
|
68
|
+
return _useModKey[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _useIsMounted = require("./useIsMounted");
|
|
73
|
+
Object.keys(_useIsMounted).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _useIsMounted[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function get() {
|
|
79
|
+
return _useIsMounted[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useConfirmationDialog","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDialog","_useSnackbar","_useKeyHandler","_useShiftKey","_useModKey","_useIsMounted"],"sources":["index.ts"],"sourcesContent":["export * from \"./useConfirmationDialog\";\nexport * from \"./useDialog\";\nexport * from \"./useSnackbar\";\nexport * from \"./useKeyHandler\";\nexport * from \"./useShiftKey\";\nexport * from \"./useModKey\";\nexport * from \"./useIsMounted\";\n"],"mappings":";;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA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AA;IAAA;EAAA;AAAA;AACA,IAAAQ,YAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,YAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,YAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAI,YAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,UAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,UAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,UAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAK,UAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,aAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,aAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,aAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,aAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["t","i18n","ns","useConfirmationDialog","title","message","acceptLabel","cancelLabel","loading","options","ui","useUi","showConfirmation","onAccept","onCancel","setState","dialog","actions","accept","label","onClick","cancel"],"sources":["useConfirmationDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\n\nconst t = i18n.ns(\"app-admin/hooks/use-confirmation-dialog\");\n\ninterface Params {\n title?: React.ReactNode;\n message?: React.ReactNode;\n acceptLabel?: React.ReactNode;\n cancelLabel?: React.ReactNode;\n loading?: React.ReactNode;\n [key: string]: any;\n}\n\nexport type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);\n\nexport interface UseConfirmationDialogResponse {\n showConfirmation: (onAccept: ShowConfirmationOnAccept, onCancel?: () => void) => void;\n}\n\nconst useConfirmationDialog = ({\n title = t`Confirmation`,\n message,\n acceptLabel = t`Confirm`,\n cancelLabel = t`Cancel`,\n loading = <CircularProgress />,\n ...options\n}: Params = {}): UseConfirmationDialogResponse => {\n const ui = useUi();\n\n return {\n showConfirmation: (onAccept, onCancel) => {\n ui.setState(ui => {\n return {\n ...ui,\n dialog: {\n message: message || t`Are you sure you want to continue?`,\n options: {\n ...options,\n title,\n loading,\n actions: {\n accept: {\n label: acceptLabel,\n onClick: onAccept\n },\n cancel: {\n label: cancelLabel,\n onClick: onCancel\n }\n }\n }\n }\n };\n });\n }\n };\n};\n\nexport { useConfirmationDialog };\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AAAuD;AAAA;AAEvD,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_useUi","_i18n","_Progress","_templateObject","_templateObject2","_templateObject3","_templateObject4","_excluded","t","i18n","ns","useConfirmationDialog","_ref","arguments","length","undefined","_ref$title","title","_taggedTemplateLiteral2","default","message","_ref$acceptLabel","acceptLabel","_ref$cancelLabel","cancelLabel","_ref$loading","loading","createElement","CircularProgress","options","_objectWithoutProperties2","ui","useUi","showConfirmation","onAccept","onCancel","setState","_objectSpread2","dialog","actions","accept","label","onClick","cancel","exports"],"sources":["useConfirmationDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\n\nconst t = i18n.ns(\"app-admin/hooks/use-confirmation-dialog\");\n\ninterface Params {\n title?: React.ReactNode;\n message?: React.ReactNode;\n acceptLabel?: React.ReactNode;\n cancelLabel?: React.ReactNode;\n loading?: React.ReactNode;\n [key: string]: any;\n}\n\nexport type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);\n\nexport interface UseConfirmationDialogResponse {\n showConfirmation: (onAccept: ShowConfirmationOnAccept, onCancel?: () => void) => void;\n}\n\nconst useConfirmationDialog = ({\n title = t`Confirmation`,\n message,\n acceptLabel = t`Confirm`,\n cancelLabel = t`Cancel`,\n loading = <CircularProgress />,\n ...options\n}: Params = {}): UseConfirmationDialogResponse => {\n const ui = useUi();\n\n return {\n showConfirmation: (onAccept, onCancel) => {\n ui.setState(ui => {\n return {\n ...ui,\n dialog: {\n message: message || t`Are you sure you want to continue?`,\n options: {\n ...options,\n title,\n loading,\n actions: {\n accept: {\n label: acceptLabel,\n onClick: onAccept\n },\n cancel: {\n label: cancelLabel,\n onClick: onCancel\n }\n }\n }\n }\n };\n });\n }\n };\n};\n\nexport { useConfirmationDialog };\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAuD,IAAAI,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAAA,IAAAC,SAAA;AAEvD,IAAMC,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,yCAAyC,CAAC;AAiB5D,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAA,EAOuB;EAAA,IAAAC,I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lB,OAAA,MAAAkB,cAAA,CAAAlB,OAAA,MACAU,OAAO;cACVZ,KAAK,EAALA,KAAK;cACLS,OAAO,EAAPA,OAAO;cACPa,OAAO,EAAE;gBACLC,MAAM,EAAE;kBACJC,KAAK,EAAEnB,WAAW;kBAClBoB,OAAO,EAAER;gBACb,CAAC;gBACDS,MAAM,EAAE;kBACJF,KAAK,EAAEjB,WAAW;kBAClBkB,OAAO,EAAEP;gBACb;cACJ;YAAC;UAET;QAAC;MAET,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAACS,OAAA,CAAAjC,qBAAA,GAAAA,qBAAA"}
|
package/hooks/useDialog.js
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useDialog = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _useUi = require("@webiny/app/hooks/useUi");
|
|
10
|
+
// TODO @ts-refactor
|
|
11
|
+
|
|
10
12
|
var useDialog = function useDialog() {
|
|
11
13
|
var ui = (0, _useUi.useUi)();
|
|
12
14
|
return {
|
|
@@ -29,4 +31,6 @@ var useDialog = function useDialog() {
|
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
|
-
exports.useDialog = useDialog;
|
|
34
|
+
exports.useDialog = useDialog;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=useDialog.js.map
|
package/hooks/useDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDialog","ui","useUi","showDialog","message","options","setState","dialog","hideDialog"],"sources":["useDialog.ts"],"sourcesContent":["import React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\n\n// TODO @ts-refactor\ninterface UseDialogResponseShowDialogOptions {\n [key: string]: any;\n}\ninterface UseDialogResponse {\n showDialog: (message: React.ReactNode, options?: UseDialogResponseShowDialogOptions) => void;\n hideDialog: () => void;\n}\nconst useDialog = (): UseDialogResponse => {\n const ui = useUi();\n return {\n showDialog: (message, options) => {\n ui.setState(ui => {\n return { ...ui, dialog: { message, options } };\n });\n },\n hideDialog: () => {\n ui.setState(ui => {\n return { ...ui, dialog: null };\n });\n }\n };\n};\n\nexport { useDialog };\n"],"mappings":";;;;;;;;AACA;
|
|
1
|
+
{"version":3,"names":["_useUi","require","useDialog","ui","useUi","showDialog","message","options","setState","_objectSpread2","default","dialog","hideDialog","exports"],"sources":["useDialog.ts"],"sourcesContent":["import React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\n\n// TODO @ts-refactor\ninterface UseDialogResponseShowDialogOptions {\n [key: string]: any;\n}\ninterface UseDialogResponse {\n showDialog: (message: React.ReactNode, options?: UseDialogResponseShowDialogOptions) => void;\n hideDialog: () => void;\n}\nconst useDialog = (): UseDialogResponse => {\n const ui = useUi();\n return {\n showDialog: (message, options) => {\n ui.setState(ui => {\n return { ...ui, dialog: { message, options } };\n });\n },\n hideDialog: () => {\n ui.setState(ui => {\n return { ...ui, dialog: null };\n });\n }\n };\n};\n\nexport { useDialog };\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA;;AAQA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAA,EAA4B;EACvC,IAAMC,EAAE,GAAG,IAAAC,YAAK,EAAC,CAAC;EAClB,OAAO;IACHC,UAAU,EAAE,SAAAA,WAACC,OAAO,EAAEC,OAAO,EAAK;MAC9BJ,EAAE,CAACK,QAAQ,CAAC,UAAAL,EAAE,EAAI;QACd,WAAAM,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MAAYP,EAAE;UAAEQ,MAAM,EAAE;YAAEL,OAAO,EAAPA,OAAO;YAAEC,OAAO,EAAPA;UAAQ;QAAC;MAChD,CAAC,CAAC;IACN,CAAC;IACDK,UAAU,EAAE,SAAAA,WAAA,EAAM;MACdT,EAAE,CAACK,QAAQ,CAAC,UAAAL,EAAE,EAAI;QACd,WAAAM,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MAAYP,EAAE;UAAEQ,MAAM,EAAE;QAAI;MAChC,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAX,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useIsMounted = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var useIsMounted = function useIsMounted() {
|
|
9
|
+
var isMountedRef = (0, _react.useRef)(false);
|
|
10
|
+
(0, _react.useEffect)(function () {
|
|
11
|
+
isMountedRef.current = true;
|
|
12
|
+
return function () {
|
|
13
|
+
isMountedRef.current = false;
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
return {
|
|
17
|
+
isMounted: function isMounted() {
|
|
18
|
+
return isMountedRef.current;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.useIsMounted = useIsMounted;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=useIsMounted.js.map
|