@webiny/app-admin 5.40.0-beta.1 → 5.40.0-beta.3
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.d.ts +1 -1
- package/base/Admin.js +7 -4
- package/base/Admin.js.map +1 -1
- package/base/Base.d.ts +1 -1
- package/base/Base.js +7 -2
- package/base/Base.js.map +1 -1
- package/base/Version.d.ts +3 -0
- package/base/Version.js +56 -0
- package/base/Version.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.js +1 -2
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/ApolloProvider.d.ts +1 -1
- package/base/providers/ApolloProvider.js +1 -2
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.d.ts +2 -1
- package/base/providers/TelemetryProvider.js +2 -3
- package/base/providers/TelemetryProvider.js.map +1 -1
- package/base/providers/UiStateProvider.d.ts +2 -1
- package/base/providers/UiStateProvider.js +1 -2
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.d.ts +2 -1
- package/base/providers/ViewCompositionProvider.js +1 -2
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.d.ts +5 -3
- package/base/ui/Brand.js +2 -4
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +2 -1
- package/base/ui/CenteredView.js +20 -11
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.d.ts +5 -3
- package/base/ui/Dashboard.js +2 -4
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.d.ts +3 -2
- package/base/ui/FileManager.js +3 -6
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.d.ts +4 -2
- package/base/ui/Layout.js +2 -4
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.d.ts +5 -3
- package/base/ui/LocaleSelector.js +2 -4
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.d.ts +3 -2
- package/base/ui/LoginScreen.js +2 -4
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.d.ts +6 -4
- package/base/ui/Logo.js +3 -6
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Menu.d.ts +9 -6
- package/base/ui/Menu.js +3 -8
- package/base/ui/Menu.js.map +1 -1
- package/base/ui/Navigation.d.ts +16 -6
- package/base/ui/Navigation.js +7 -13
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.d.ts +5 -3
- package/base/ui/NotFound.js +2 -4
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Search.d.ts +6 -3
- package/base/ui/Search.js +4 -8
- package/base/ui/Search.js.map +1 -1
- package/base/ui/Tags.d.ts +1 -1
- package/base/ui/Tags.js +2 -4
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/UserMenu.d.ts +16 -8
- package/base/ui/UserMenu.js +9 -18
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.d.ts +1 -1
- package/components/AdminLayout.js +1 -2
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.d.ts +1 -1
- package/components/AppInstaller/AppInstaller.js +5 -3
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.d.ts +2 -2
- package/components/AppInstaller/Sidebar.js +39 -58
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.d.ts +2 -2
- package/components/AppInstaller/index.js +1 -2
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.d.ts +4 -4
- package/components/AppInstaller/styled.js +54 -61
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.js +1 -2
- package/components/AppInstaller/useInstaller.js.map +1 -1
- package/components/BulkActions/Worker.d.ts +2 -1
- package/components/BulkActions/Worker.js +4 -8
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +2 -2
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +5 -4
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +2 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +10 -3
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js +35 -15
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js.map +1 -1
- package/components/Buttons/Buttons.d.ts +5 -5
- package/components/Buttons/Buttons.js +5 -10
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.d.ts +1 -1
- package/components/Buttons/Buttons.styles.js +15 -5
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.js.map +1 -1
- package/components/Buttons/useButtons.d.ts +1 -1
- package/components/Buttons/useButtons.js +2 -4
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/Dialogs/CustomDialog.d.ts +17 -0
- package/components/Dialogs/CustomDialog.js +55 -0
- package/components/Dialogs/CustomDialog.js.map +1 -0
- package/components/Dialogs/Dialog.d.ts +15 -0
- package/components/Dialogs/Dialog.js +45 -0
- package/components/Dialogs/Dialog.js.map +1 -0
- package/components/Dialogs/DialogsContext.d.ts +43 -0
- package/components/Dialogs/DialogsContext.js +121 -0
- package/components/Dialogs/DialogsContext.js.map +1 -0
- package/components/Dialogs/styled.d.ts +10 -0
- package/components/Dialogs/styled.js +40 -0
- package/components/Dialogs/styled.js.map +1 -0
- package/components/Dialogs/useDialogs.d.ts +3 -0
- package/components/Dialogs/useDialogs.js +24 -0
- package/components/Dialogs/useDialogs.js.map +1 -0
- package/components/EmptyView.d.ts +2 -2
- package/components/EmptyView.js +14 -33
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.d.ts +1 -1
- package/components/Filters/Filters.js +1 -2
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/Filters.styled.d.ts +3 -3
- package/components/Filters/Filters.styled.js +43 -15
- package/components/Filters/Filters.styled.js.map +1 -1
- package/components/Filters/index.js.map +1 -1
- package/components/FloatingActionButton.d.ts +1 -1
- package/components/FloatingActionButton.js +1 -2
- package/components/FloatingActionButton.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.d.ts +2 -2
- package/components/LexicalEditor/LexicalEditor.js +1 -2
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/index.js.map +1 -1
- package/components/MultiImageUpload.d.ts +2 -2
- package/components/MultiImageUpload.js +1 -2
- package/components/MultiImageUpload.js.map +1 -1
- package/components/OptionsMenu/OptionsMenu.d.ts +1 -1
- package/components/OptionsMenu/OptionsMenu.js +1 -2
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/OptionsMenu.styled.d.ts +3 -34
- package/components/OptionsMenu/OptionsMenu.styled.js +15 -5
- package/components/OptionsMenu/OptionsMenu.styled.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuItem.d.ts +1 -1
- package/components/OptionsMenu/OptionsMenuItem.js +1 -2
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuLink.d.ts +1 -1
- package/components/OptionsMenu/OptionsMenuLink.js +1 -2
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
- package/components/OptionsMenu/index.js.map +1 -1
- package/components/OptionsMenu/useOptionsMenuItem.d.ts +1 -1
- package/components/OptionsMenu/useOptionsMenuItem.js +2 -4
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.d.ts +1 -1
- package/components/OverlayLayout/OverlayLayout.js +21 -27
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/CannotUseAaclAlert.d.ts +2 -2
- package/components/Permissions/CannotUseAaclAlert.js +1 -2
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.d.ts +2 -2
- package/components/Permissions/Permissions.js +1 -2
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/StyledComponents.d.ts +2 -2
- package/components/Permissions/StyledComponents.js +5 -8
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js.map +1 -1
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/RichTextEditor.js +1 -2
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js.map +1 -1
- package/components/RichTextEditor/tools/header/index.js +2 -4
- package/components/RichTextEditor/tools/header/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/index.js +2 -4
- package/components/RichTextEditor/tools/image/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/svgs.js +1 -2
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
- package/components/RichTextEditor/tools/image/tunes.js +2 -4
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
- package/components/RichTextEditor/tools/image/types.js.map +1 -1
- package/components/RichTextEditor/tools/image/ui.js +3 -6
- package/components/RichTextEditor/tools/image/ui.js.map +1 -1
- package/components/RichTextEditor/tools/paragraph/index.js +2 -4
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
- package/components/RichTextEditor/tools/textColor/index.js +2 -4
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
- package/components/RichTextEditor/tools/utils.js +3 -6
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.d.ts +2 -2
- package/components/Routes.js +1 -2
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.d.ts +2 -2
- package/components/SearchUI.js +15 -36
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +3 -3
- package/components/SimpleForm/SimpleForm.js +28 -22
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.d.ts +3 -2
- package/components/SimpleUI/InputField.js +5 -6
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +1 -1
- package/components/SingleImageUpload.js +18 -22
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +3 -3
- package/components/SplitView/SplitView.js +24 -21
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js.map +1 -1
- package/components/Wcp.d.ts +1 -1
- package/components/Wcp.js +1 -2
- package/components/Wcp.js.map +1 -1
- package/components/index.js.map +1 -1
- package/hooks/createGenericContext.d.ts +1 -1
- package/hooks/createGenericContext.js.map +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -1
- package/hooks/useConfirmationDialog.js +1 -2
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +1 -2
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useIsMounted.js +1 -2
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useSnackbar.js +1 -2
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.js.map +1 -1
- package/hooks/useStateWithCallback.d.ts +5 -0
- package/hooks/useStateWithCallback.js +31 -0
- package/hooks/useStateWithCallback.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +20 -0
- package/index.js.map +1 -1
- package/package.json +33 -31
- package/plugins/MenuPlugin.js +5 -8
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.js +5 -8
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/globalSearch/SearchBar.d.ts +3 -2
- package/plugins/globalSearch/SearchBar.js +11 -15
- package/plugins/globalSearch/SearchBar.js.map +1 -1
- package/plugins/globalSearch/SearchBarDropdown.d.ts +1 -1
- package/plugins/globalSearch/SearchBarDropdown.js +5 -8
- package/plugins/globalSearch/SearchBarDropdown.js.map +1 -1
- package/plugins/globalSearch/index.js +1 -2
- package/plugins/globalSearch/index.js.map +1 -1
- package/plugins/globalSearch/styled.d.ts +3 -3
- package/plugins/globalSearch/styled.js +49 -46
- package/plugins/globalSearch/styled.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +1 -2
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/styles/material-theme-assignments.scss +62 -43
- package/styles/material.scss +0 -1
- package/styles/reset.scss +1 -0
- package/styles.scss +1 -0
- package/types.d.ts +3 -0
- package/types.js.map +1 -1
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.js +9 -15
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.js +5 -8
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.js +18 -19
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.js +5 -8
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.js +8 -13
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +4 -6
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +5 -8
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.js +5 -8
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.js +5 -8
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +5 -8
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement.js +5 -8
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +4 -6
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +5 -8
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +18 -25
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +5 -7
- package/ui/elements/form/FileManagerElement/styled.js +58 -69
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
- package/ui/elements/form/FileManagerElement.js +5 -8
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.js +5 -8
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.js +7 -11
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.js +5 -8
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.js +5 -8
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.js +5 -8
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.js +5 -8
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.js +5 -8
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +20 -16
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +8 -13
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +7 -10
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +7 -10
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +7 -10
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- package/ui/views/AdminView/components/Snackbar.js.map +1 -1
- package/ui/views/FormView/FormContainerElement.d.ts +2 -2
- package/ui/views/FormView/FormContainerElement.js +18 -13
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.js +4 -6
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.d.ts +2 -2
- package/ui/views/FormView/FormFooterElement.js +18 -20
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.js +13 -16
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.js +5 -8
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.js +18 -13
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.js +9 -13
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +8 -13
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +3 -4
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.js +21 -25
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +7 -11
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.js +14 -18
- package/ui/views/SplitView.js.map +1 -1
|
@@ -15,12 +15,12 @@ var _mobx = require("mobx");
|
|
|
15
15
|
/**
|
|
16
16
|
* Class for collecting processing results
|
|
17
17
|
*/
|
|
18
|
-
var Report = /*#__PURE__*/function () {
|
|
18
|
+
var Report = exports.Report = /*#__PURE__*/function () {
|
|
19
19
|
function Report() {
|
|
20
20
|
(0, _classCallCheck2.default)(this, Report);
|
|
21
21
|
(0, _defineProperty2.default)(this, "_results", []);
|
|
22
22
|
}
|
|
23
|
-
(0, _createClass2.default)(Report, [{
|
|
23
|
+
return (0, _createClass2.default)(Report, [{
|
|
24
24
|
key: "success",
|
|
25
25
|
value:
|
|
26
26
|
/**
|
|
@@ -66,14 +66,12 @@ var Report = /*#__PURE__*/function () {
|
|
|
66
66
|
this._results.push(result);
|
|
67
67
|
}
|
|
68
68
|
}]);
|
|
69
|
-
return Report;
|
|
70
69
|
}();
|
|
71
70
|
/**
|
|
72
71
|
* A generic worker class for processing items.
|
|
73
72
|
* @template T - The type of items being processed.
|
|
74
73
|
*/
|
|
75
|
-
exports.
|
|
76
|
-
var Worker = /*#__PURE__*/function () {
|
|
74
|
+
var Worker = exports.Worker = /*#__PURE__*/function () {
|
|
77
75
|
function Worker() {
|
|
78
76
|
(0, _classCallCheck2.default)(this, Worker);
|
|
79
77
|
this._items = [];
|
|
@@ -85,7 +83,7 @@ var Worker = /*#__PURE__*/function () {
|
|
|
85
83
|
* Process the items using the provided callback function.
|
|
86
84
|
* @param callback - The callback function to process the items.
|
|
87
85
|
*/
|
|
88
|
-
(0, _createClass2.default)(Worker, [{
|
|
86
|
+
return (0, _createClass2.default)(Worker, [{
|
|
89
87
|
key: "process",
|
|
90
88
|
value: function process(callback) {
|
|
91
89
|
callback(this._items);
|
|
@@ -165,8 +163,6 @@ var Worker = /*#__PURE__*/function () {
|
|
|
165
163
|
}
|
|
166
164
|
}
|
|
167
165
|
}]);
|
|
168
|
-
return Worker;
|
|
169
166
|
}();
|
|
170
|
-
exports.Worker = Worker;
|
|
171
167
|
|
|
172
168
|
//# sourceMappingURL=Worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chunk","_interopRequireDefault","require","_mobx","Report","_classCallCheck2","default","_defineProperty2","_createClass2","key","value","success","result","addResult","_objectSpread2","status","error","get","_results","push","
|
|
1
|
+
{"version":3,"names":["_chunk","_interopRequireDefault","require","_mobx","Report","exports","_classCallCheck2","default","_defineProperty2","_createClass2","key","value","success","result","addResult","_objectSpread2","status","error","get","_results","push","Worker","_items","_report","makeAutoObservable","process","callback","processInSeries","_this","chunkSize","arguments","length","undefined","chunks","chunk","promises","map","processChunk","Promise","all","results","set","items","_iterator","_createForOfIteratorHelper2","_step","s","n","done","item","allItems","report","err","e","f"],"sources":["Worker.ts"],"sourcesContent":["import chunk from \"lodash/chunk\";\nimport { makeAutoObservable } from \"mobx\";\n\nexport interface CallbackParams<T> {\n item: T;\n allItems: T[];\n report: Report;\n}\n\nexport interface Result {\n title: string;\n status: \"success\" | \"failure\";\n message?: string | React.ReactElement;\n}\n\n/**\n * Class for collecting processing results\n */\nexport class Report {\n private _results: Result[] = [];\n\n /**\n * Record a successful result in the report\n * @param {Omit<Result, \"status\">} result - The successful result to be recorded\n */\n public success(result: Omit<Result, \"status\">): void {\n this.addResult({\n ...result,\n status: \"success\"\n });\n }\n\n /**\n * Record an error result in the report.\n * @param {Omit<Result, \"status\">} result - The error result to be recorded.\n */\n public error(result: Omit<Result, \"status\">): void {\n this.addResult({\n ...result,\n status: \"failure\"\n });\n }\n\n /**\n * Get the array of recorded results.\n * @returns {Result[]} - An array of recorded results.\n */\n get results(): Result[] {\n return this._results;\n }\n\n /**\n * Internal method to add a result to the report.\n * @private\n * @param {Result} result - The result to be added to the report.\n */\n private addResult(result: Result): void {\n this._results.push(result);\n }\n}\n\n/**\n * A generic worker class for processing items.\n * @template T - The type of items being processed.\n */\nexport class Worker<T> {\n private _items: T[];\n private _report: Report;\n\n constructor() {\n this._items = [];\n this._report = new Report();\n makeAutoObservable(this);\n }\n\n /**\n * Process the items using the provided callback function.\n * @param callback - The callback function to process the items.\n */\n public process(callback: (items: T[]) => void): void {\n callback(this._items);\n }\n\n /**\n * Process the items in series with the given chunk size.\n * @param callback - The callback function to process each item.\n * @param {number} [chunkSize=10] - The size of each chunk for processing in series.\n * @returns {Promise<void>}\n */\n public async processInSeries(\n callback: ({ item, allItems, report }: CallbackParams<T>) => Promise<void>,\n chunkSize = 10\n ): Promise<void> {\n const chunks = chunk(this._items, chunkSize);\n const promises = chunks.map(chunk => this.processChunk(callback, chunk));\n await Promise.all(promises);\n }\n\n /**\n * Get the array of results collected by the worker.\n * @returns {Result[]} - An array of collected results.\n */\n get results(): Result[] {\n return this._report.results;\n }\n\n /**\n * Get the current items in the worker.\n * @returns {T[]} - An array of items in the worker.\n */\n get items(): T[] {\n return this._items;\n }\n\n /**\n * Set the items in the worker.\n * @param {T[]} items - The items to be set in the worker.\n */\n set items(items: T[]) {\n this._items = items;\n }\n\n /**\n * Internal method to process a chunk of items using the provided callback.\n * @private\n * @param callback - The callback function to process each item.\n * @param {T[]} chunk - The chunk of items to be processed.\n * @returns {Promise<void>}\n */\n private async processChunk(\n callback: ({ item, allItems, report }: CallbackParams<T>) => void | Promise<void>,\n chunk: T[]\n ): Promise<void> {\n for (const item of chunk) {\n await callback({ item, allItems: this._items, report: this._report });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAcA;AACA;AACA;AAFA,IAGaE,MAAM,GAAAC,OAAA,CAAAD,MAAA;EAAA,SAAAA,OAAA;IAAA,IAAAE,gBAAA,CAAAC,OAAA,QAAAH,MAAA;IAAA,IAAAI,gBAAA,CAAAD,OAAA,oBACc,EAAE;EA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e,QAAQ,CAAC;YAAEuB,IAAI,EAAJA,IAAI;YAAEC,QAAQ,EAAE,IAAI,CAAC5B,MAAM;YAAE6B,MAAM,EAAE,IAAI,CAAC5B;UAAQ,CAAC,CAAC;QACzE;MAAC,SAAA6B,GAAA;QAAAT,SAAA,CAAAU,CAAA,CAAAD,GAAA;MAAA;QAAAT,SAAA,CAAAW,CAAA;MAAA;IACL;EAAC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useDialogWithReport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Worker"],"sources":["index.ts"],"sourcesContent":["export * from \"./useDialogWithReport\";\nexport * from \"./Worker\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_useDialogWithReport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Worker"],"sources":["index.ts"],"sourcesContent":["export * from \"./useDialogWithReport\";\nexport * from \"./Worker\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { ShowResultsDialogParams } from "./index";
|
|
3
3
|
declare type ResultDialogMessageProps = Pick<ShowResultsDialogParams, "results" | "message">;
|
|
4
|
-
export declare const ResultDialogMessage: ({ results, message }: ResultDialogMessageProps) => JSX.Element;
|
|
4
|
+
export declare const ResultDialogMessage: ({ results, message }: ResultDialogMessageProps) => React.JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -11,14 +11,16 @@ var _check_circle = require("@material-design-icons/svg/round/check_circle.svg")
|
|
|
11
11
|
var _Icon = require("@webiny/ui/Icon");
|
|
12
12
|
var _List = require("@webiny/ui/List");
|
|
13
13
|
var _useDialogWithReport = require("./useDialogWithReport.styled");
|
|
14
|
-
var ResultDialogMessage = function ResultDialogMessage(_ref) {
|
|
14
|
+
var ResultDialogMessage = exports.ResultDialogMessage = function ResultDialogMessage(_ref) {
|
|
15
15
|
var results = _ref.results,
|
|
16
16
|
message = _ref.message;
|
|
17
17
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, message && /*#__PURE__*/_react.default.createElement(_useDialogWithReport.MessageContainer, null, message), /*#__PURE__*/_react.default.createElement(_List.List, {
|
|
18
|
-
nonInteractive: true
|
|
18
|
+
nonInteractive: true,
|
|
19
|
+
twoLine: true
|
|
19
20
|
}, results.map(function (result, index) {
|
|
20
21
|
return /*#__PURE__*/_react.default.createElement(_useDialogWithReport.ListItem, {
|
|
21
|
-
key: "item-".concat(index)
|
|
22
|
+
key: "item-".concat(index),
|
|
23
|
+
ripple: false
|
|
22
24
|
}, /*#__PURE__*/_react.default.createElement(_useDialogWithReport.ListItemGraphic, {
|
|
23
25
|
status: result.status
|
|
24
26
|
}, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
@@ -26,6 +28,5 @@ var ResultDialogMessage = function ResultDialogMessage(_ref) {
|
|
|
26
28
|
})), /*#__PURE__*/_react.default.createElement(_List.ListItemText, null, /*#__PURE__*/_react.default.createElement(_List.ListItemTextPrimary, null, result.title), /*#__PURE__*/_react.default.createElement(_List.ListItemTextSecondary, null, result.message)));
|
|
27
29
|
})));
|
|
28
30
|
};
|
|
29
|
-
exports.ResultDialogMessage = ResultDialogMessage;
|
|
30
31
|
|
|
31
32
|
//# sourceMappingURL=DialogMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_error","_check_circle","_Icon","_List","_useDialogWithReport","ResultDialogMessage","_ref","results","message","default","createElement","Fragment","MessageContainer","List","nonInteractive","map","result","index","ListItem","key","concat","ListItemGraphic","status","Icon","icon","ReactComponent","ListItemText","ListItemTextPrimary","title","ListItemTextSecondary"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_error","_check_circle","_Icon","_List","_useDialogWithReport","ResultDialogMessage","exports","_ref","results","message","default","createElement","Fragment","MessageContainer","List","nonInteractive","twoLine","map","result","index","ListItem","key","concat","ripple","ListItemGraphic","status","Icon","icon","ReactComponent","ListItemText","ListItemTextPrimary","title","ListItemTextSecondary"],"sources":["DialogMessage.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as ErrorIcon } from \"@material-design-icons/svg/round/error.svg\";\nimport { ReactComponent as SuccessIcon } from \"@material-design-icons/svg/round/check_circle.svg\";\nimport { Icon } from \"@webiny/ui/Icon\";\nimport { List, ListItemText, ListItemTextPrimary, ListItemTextSecondary } from \"@webiny/ui/List\";\nimport { ShowResultsDialogParams } from \"./index\";\n\nimport { ListItem, ListItemGraphic, MessageContainer } from \"./useDialogWithReport.styled\";\n\ntype ResultDialogMessageProps = Pick<ShowResultsDialogParams, \"results\" | \"message\">;\n\nexport const ResultDialogMessage = ({ results, message }: ResultDialogMessageProps) => {\n return (\n <>\n {message && <MessageContainer>{message}</MessageContainer>}\n <List nonInteractive={true} twoLine={true}>\n {results.map((result, index) => (\n <ListItem key={`item-${index}`} ripple={false}>\n <ListItemGraphic status={result.status}>\n <Icon\n icon={result.status === \"success\" ? <SuccessIcon /> : <ErrorIcon />}\n />\n </ListItemGraphic>\n <ListItemText>\n <ListItemTextPrimary>{result.title}</ListItemTextPrimary>\n <ListItemTextSecondary>{result.message}</ListItemTextSecondary>\n </ListItemText>\n </ListItem>\n ))}\n </List>\n </>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,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,aAAA,CAACR,KAAA,CAAA2B,mBAAmB,QAAEZ,MAAM,CAACa,KAA2B,CAAC,eACzDlC,MAAA,CAAAa,OAAA,CAAAC,aAAA,CAACR,KAAA,CAAA6B,qBAAqB,QAAEd,MAAM,CAACT,OAA+B,CACpD,CACR,CAAC;EAAA,CACd,CACC,CACR,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useDialogWithReport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.tsx"],"sourcesContent":["export * from \"./useDialogWithReport\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_useDialogWithReport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.tsx"],"sourcesContent":["export * from \"./useDialogWithReport\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -9,9 +9,11 @@ export interface ShowResultsDialogParams {
|
|
|
9
9
|
results: Result[];
|
|
10
10
|
title?: string;
|
|
11
11
|
message?: string;
|
|
12
|
+
onCancel?: () => Promise<void>;
|
|
12
13
|
}
|
|
13
14
|
export interface UseDialogWithReportResponse {
|
|
14
15
|
showConfirmationDialog: (params: ShowConfirmationDialogParams) => void;
|
|
15
16
|
showResultsDialog: (results: ShowResultsDialogParams) => void;
|
|
17
|
+
hideResultsDialog: () => void;
|
|
16
18
|
}
|
|
17
19
|
export declare const useDialogWithReport: () => UseDialogWithReportResponse;
|
|
@@ -16,7 +16,7 @@ var _DialogMessage = require("./DialogMessage");
|
|
|
16
16
|
var _excluded = ["title"];
|
|
17
17
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
18
18
|
var t = _i18n.i18n.ns("app-admin/hooks/use-dialog-with-report");
|
|
19
|
-
var useDialogWithReport = function useDialogWithReport() {
|
|
19
|
+
var useDialogWithReport = exports.useDialogWithReport = function useDialogWithReport() {
|
|
20
20
|
var ui = (0, _useUi.useUi)();
|
|
21
21
|
var showConfirmationDialog = function showConfirmationDialog(_ref) {
|
|
22
22
|
var execute = _ref.execute,
|
|
@@ -69,11 +69,18 @@ var useDialogWithReport = function useDialogWithReport() {
|
|
|
69
69
|
});
|
|
70
70
|
}, 10);
|
|
71
71
|
};
|
|
72
|
+
var hideResultsDialog = function hideResultsDialog() {
|
|
73
|
+
ui.setState(function (ui) {
|
|
74
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, ui), {}, {
|
|
75
|
+
dialog: null
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
72
79
|
return {
|
|
73
80
|
showConfirmationDialog: showConfirmationDialog,
|
|
74
|
-
showResultsDialog: showResultsDialog
|
|
81
|
+
showResultsDialog: showResultsDialog,
|
|
82
|
+
hideResultsDialog: hideResultsDialog
|
|
75
83
|
};
|
|
76
84
|
};
|
|
77
|
-
exports.useDialogWithReport = useDialogWithReport;
|
|
78
85
|
|
|
79
86
|
//# sourceMappingURL=useDialogWithReport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_useUi","_i18n","_Progress","_DialogMessage","_excluded","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","t","i18n","ns","useDialogWithReport","ui","useUi","showConfirmationDialog","_ref","execute","title","message","loadingLabel","setState","_objectSpread2","default","dialog","_taggedTemplateLiteral2","options","loading","createElement","CircularProgress","label","actions","accept","onClick","cancel","showResultsDialog","_ref2","params","_objectWithoutProperties2","setTimeout","ResultDialogMessage","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_useUi","_i18n","_Progress","_DialogMessage","_excluded","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","t","i18n","ns","useDialogWithReport","exports","ui","useUi","showConfirmationDialog","_ref","execute","title","message","loadingLabel","setState","_objectSpread2","default","dialog","_taggedTemplateLiteral2","options","loading","createElement","CircularProgress","label","actions","accept","onClick","cancel","showResultsDialog","_ref2","params","_objectWithoutProperties2","setTimeout","ResultDialogMessage","hideResultsDialog"],"sources":["useDialogWithReport.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\";\nimport { ResultDialogMessage } from \"./DialogMessage\";\nimport { Result } from \"../Worker\";\n\nconst t = i18n.ns(\"app-admin/hooks/use-dialog-with-report\");\n\nexport interface ShowConfirmationDialogParams {\n execute: (() => void) | (() => Promise<void>);\n title?: string;\n message?: string;\n loadingLabel?: string;\n}\n\nexport interface ShowResultsDialogParams {\n results: Result[];\n title?: string;\n message?: string;\n onCancel?: () => Promise<void>;\n}\n\nexport interface UseDialogWithReportResponse {\n showConfirmationDialog: (params: ShowConfirmationDialogParams) => void;\n showResultsDialog: (results: ShowResultsDialogParams) => void;\n hideResultsDialog: () => void;\n}\n\nexport const useDialogWithReport = (): UseDialogWithReportResponse => {\n const ui = useUi();\n\n const showConfirmationDialog = ({\n execute,\n title,\n message,\n loadingLabel\n }: ShowConfirmationDialogParams) => {\n ui.setState(ui => {\n return {\n ...ui,\n dialog: {\n message: message || t`Are you sure you want to continue?`,\n options: {\n title: title || t`Confirm`,\n loading: <CircularProgress label={loadingLabel} />,\n actions: {\n accept: {\n label: t`Confirm`,\n onClick: async () => {\n await execute();\n }\n },\n cancel: {\n label: t`Cancel`\n }\n }\n }\n }\n };\n });\n };\n\n const showResultsDialog = ({ title, ...params }: ShowResultsDialogParams) => {\n setTimeout(() => {\n ui.setState(ui => {\n return {\n ...ui,\n dialog: {\n message: <ResultDialogMessage {...params} />,\n options: {\n title: title || t`Results`,\n actions: {\n cancel: {\n label: t`Close`\n }\n }\n }\n }\n };\n });\n }, 10);\n };\n\n const hideResultsDialog = () => {\n ui.setState(ui => {\n return { ...ui, dialog: null };\n });\n };\n\n return {\n showConfirmationDialog,\n showResultsDialog,\n hideResultsDialog\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAAsD,IAAAK,SAAA;AAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAGtD,IAAMC,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,wCAAwC,CAAC;AAsBpD,IAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,SAAtBA,mBAAmBA,CAAA,EAAsC;EAClE,IAAME,EAAE,GAAG,IAAAC,YAAK,EAAC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mB,MAAM,OAAAC,yBAAA,CAAAf,OAAA,EAAAa,KAAA,EAAAnC,SAAA;IACzCsC,UAAU,CAAC,YAAM;MACb1B,EAAE,CAACQ,QAAQ,CAAC,UAAAR,EAAE,EAAI;QACd,WAAAS,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MACOV,EAAE;UACLW,MAAM,EAAE;YACJL,OAAO,eAAEzB,MAAA,CAAA6B,OAAA,CAAAK,aAAA,CAAC5B,cAAA,CAAAwC,mBAAmB,EAAKH,MAAS,CAAC;YAC5CX,OAAO,EAAE;cACLR,KAAK,EAAEA,KAAK,IAAIV,CAAC,CAAAF,gBAAA,KAAAA,gBAAA,OAAAmB,uBAAA,CAAAF,OAAA,gBAAS;cAC1BQ,OAAO,EAAE;gBACLG,MAAM,EAAE;kBACJJ,KAAK,EAAEtB,CAAC,CAAAD,gBAAA,KAAAA,gBAAA,OAAAkB,uBAAA,CAAAF,OAAA;gBACZ;cACJ;YACJ;UACJ;QAAC;MAET,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC;EACV,CAAC;EAED,IAAMkB,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAA,EAAS;IAC5B5B,EAAE,CAACQ,QAAQ,CAAC,UAAAR,EAAE,EAAI;MACd,WAAAS,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MAAYV,EAAE;QAAEW,MAAM,EAAE;MAAI;IAChC,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHT,sBAAsB,EAAtBA,sBAAsB;IACtBoB,iBAAiB,EAAjBA,iBAAiB;IACjBM,iBAAiB,EAAjBA;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const MessageContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
6
|
export declare const ListItem: import("@emotion/styled").StyledComponent<import("@rmwc/list").ListItemProps & {
|
|
7
7
|
children: import("react").ReactNode;
|
|
@@ -5,24 +5,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.MessageContainer = exports.ListItemGraphic = exports.ListItem = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
9
|
var _List = require("@webiny/ui/List");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
target: "ehsgn2s0"
|
|
13
|
-
})("margin-bottom:16px;");
|
|
14
|
-
exports.MessageContainer = MessageContainer;
|
|
15
|
-
var ListItem = /*#__PURE__*/(0, _styled.default)(_List.ListItem, {
|
|
16
|
-
label: "ListItem",
|
|
17
|
-
target: "ehsgn2s1"
|
|
18
|
-
})("overflow:visible !important;");
|
|
19
|
-
exports.ListItem = ListItem;
|
|
20
|
-
var ListItemGraphic = /*#__PURE__*/(0, _styled.default)(_List.ListItemGraphic, {
|
|
21
|
-
label: "ListItemGraphic",
|
|
10
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
|
+
var MessageContainer = exports.MessageContainer = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
22
12
|
target: "ehsgn2s2"
|
|
13
|
+
} : {
|
|
14
|
+
target: "ehsgn2s2",
|
|
15
|
+
label: "MessageContainer"
|
|
16
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
17
|
+
name: "18uqayh",
|
|
18
|
+
styles: "margin-bottom:16px"
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vcilcIlxuICAgICAgICAgICAgOiBcInZhcigtLW1kYy10aGVtZS1zZWNvbmRhcnkpXCJ9ICFpbXBvcnRhbnQ7XG5gO1xuIl19 */",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
});
|
|
25
|
+
var ListItem = exports.ListItem = /*#__PURE__*/(0, _base.default)(_List.ListItem, process.env.NODE_ENV === "production" ? {
|
|
26
|
+
target: "ehsgn2s1"
|
|
27
|
+
} : {
|
|
28
|
+
target: "ehsgn2s1",
|
|
29
|
+
label: "ListItem"
|
|
30
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
31
|
+
name: "uj3cyk",
|
|
32
|
+
styles: "overflow:visible!important"
|
|
33
|
+
} : {
|
|
34
|
+
name: "uj3cyk",
|
|
35
|
+
styles: "overflow:visible!important",
|
|
36
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVzZURpYWxvZ1dpdGhSZXBvcnQuc3R5bGVkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPNEMiLCJmaWxlIjoidXNlRGlhbG9nV2l0aFJlcG9ydC5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBMaXN0SXRlbUdyYXBoaWMgYXMgQmFzZUxpc3RJdGVtR3JhcGhpYywgTGlzdEl0ZW0gYXMgQmFzZUxpc3RJdGVtIH0gZnJvbSBcIkB3ZWJpbnkvdWkvTGlzdFwiO1xuXG5leHBvcnQgY29uc3QgTWVzc2FnZUNvbnRhaW5lciA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tYm90dG9tOiAxNnB4O1xuYDtcblxuZXhwb3J0IGNvbnN0IExpc3RJdGVtID0gc3R5bGVkKEJhc2VMaXN0SXRlbSlgXG4gICAgb3ZlcmZsb3c6IHZpc2libGUgIWltcG9ydGFudDtcbmA7XG5cbnR5cGUgTGlzdEl0ZW1HcmFwaGljUHJvcHMgPSB7XG4gICAgc3RhdHVzOiBcInN1Y2Nlc3NcIiB8IFwiZmFpbHVyZVwiO1xufTtcblxuZXhwb3J0IGNvbnN0IExpc3RJdGVtR3JhcGhpYyA9IHN0eWxlZChCYXNlTGlzdEl0ZW1HcmFwaGljKTxMaXN0SXRlbUdyYXBoaWNQcm9wcz5gXG4gICAgY29sb3I6ICR7cHJvcHMgPT5cbiAgICAgICAgcHJvcHMuc3RhdHVzID09PSBcImZhaWx1cmVcIlxuICAgICAgICAgICAgPyBcInZhcigtLW1kYy10aGVtZS1lcnJvcilcIlxuICAgICAgICAgICAgOiBcInZhcigtLW1kYy10aGVtZS1zZWNvbmRhcnkpXCJ9ICFpbXBvcnRhbnQ7XG5gO1xuIl19 */",
|
|
37
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
|
+
});
|
|
39
|
+
var ListItemGraphic = exports.ListItemGraphic = /*#__PURE__*/(0, _base.default)(_List.ListItemGraphic, process.env.NODE_ENV === "production" ? {
|
|
40
|
+
target: "ehsgn2s0"
|
|
41
|
+
} : {
|
|
42
|
+
target: "ehsgn2s0",
|
|
43
|
+
label: "ListItemGraphic"
|
|
23
44
|
})("color:", function (props) {
|
|
24
45
|
return props.status === "failure" ? "var(--mdc-theme-error)" : "var(--mdc-theme-secondary)";
|
|
25
|
-
}, "
|
|
26
|
-
exports.ListItemGraphic = ListItemGraphic;
|
|
46
|
+
}, "!important;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVzZURpYWxvZ1dpdGhSZXBvcnQuc3R5bGVkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlZ0YiLCJmaWxlIjoidXNlRGlhbG9nV2l0aFJlcG9ydC5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBMaXN0SXRlbUdyYXBoaWMgYXMgQmFzZUxpc3RJdGVtR3JhcGhpYywgTGlzdEl0ZW0gYXMgQmFzZUxpc3RJdGVtIH0gZnJvbSBcIkB3ZWJpbnkvdWkvTGlzdFwiO1xuXG5leHBvcnQgY29uc3QgTWVzc2FnZUNvbnRhaW5lciA9IHN0eWxlZChcImRpdlwiKWBcbiAgICBtYXJnaW4tYm90dG9tOiAxNnB4O1xuYDtcblxuZXhwb3J0IGNvbnN0IExpc3RJdGVtID0gc3R5bGVkKEJhc2VMaXN0SXRlbSlgXG4gICAgb3ZlcmZsb3c6IHZpc2libGUgIWltcG9ydGFudDtcbmA7XG5cbnR5cGUgTGlzdEl0ZW1HcmFwaGljUHJvcHMgPSB7XG4gICAgc3RhdHVzOiBcInN1Y2Nlc3NcIiB8IFwiZmFpbHVyZVwiO1xufTtcblxuZXhwb3J0IGNvbnN0IExpc3RJdGVtR3JhcGhpYyA9IHN0eWxlZChCYXNlTGlzdEl0ZW1HcmFwaGljKTxMaXN0SXRlbUdyYXBoaWNQcm9wcz5gXG4gICAgY29sb3I6ICR7cHJvcHMgPT5cbiAgICAgICAgcHJvcHMuc3RhdHVzID09PSBcImZhaWx1cmVcIlxuICAgICAgICAgICAgPyBcInZhcigtLW1kYy10aGVtZS1lcnJvcilcIlxuICAgICAgICAgICAgOiBcInZhcigtLW1kYy10aGVtZS1zZWNvbmRhcnkpXCJ9ICFpbXBvcnRhbnQ7XG5gO1xuIl19 */"));
|
|
27
47
|
|
|
28
48
|
//# sourceMappingURL=useDialogWithReport.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_List","require","_EMOTION_STRINGIFIED_CSS_ERROR__","MessageContainer","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","ListItem","BaseListItem","ListItemGraphic","BaseListItemGraphic","props","status"],"sources":["useDialogWithReport.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { ListItemGraphic as BaseListItemGraphic, ListItem as BaseListItem } from \"@webiny/ui/List\";\n\nexport const MessageContainer = styled(\"div\")`\n margin-bottom: 16px;\n`;\n\nexport const ListItem = styled(BaseListItem)`\n overflow: visible !important;\n`;\n\ntype ListItemGraphicProps = {\n status: \"success\" | \"failure\";\n};\n\nexport const ListItemGraphic = styled(BaseListItemGraphic)<ListItemGraphicProps>`\n color: ${props =>\n props.status === \"failure\"\n ? \"var(--mdc-theme-error)\"\n : \"var(--mdc-theme-secondary)\"} !important;\n`;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAAmG,SAAAC,iCAAA;AAE5F,IAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,gBAAG,IAAAE,KAAA,CAAAC,OAAA,EAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAb;AAAA,EAE5C;AAEM,IAAMc,QAAQ,GAAAZ,OAAA,CAAAY,QAAA,gBAAG,IAAAX,KAAA,CAAAC,OAAA,EAAOW,cAAY,EAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAb;AAAA,EAE3C;AAMM,IAAMgB,eAAe,GAAAd,OAAA,CAAAc,eAAA,gBAAG,IAAAb,KAAA,CAAAC,OAAA,EAAOa,qBAAmB,EAAAZ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,WAC7C,UAAAS,KAAK;EAAA,OACVA,KAAK,CAACC,MAAM,KAAK,SAAS,GACpB,wBAAwB,GACxB,4BAA4B;AAAA,oBAAAd,OAAA,CAAAC,GAAA,CAAAC,QAAA,goCACzC","ignoreList":[]}
|
|
@@ -15,9 +15,9 @@ export interface ButtonsProps {
|
|
|
15
15
|
element: React.ReactElement;
|
|
16
16
|
}[];
|
|
17
17
|
}
|
|
18
|
-
export declare const Buttons: (props: ButtonsProps) => JSX.Element | null;
|
|
18
|
+
export declare const Buttons: (props: ButtonsProps) => React.JSX.Element | null;
|
|
19
19
|
export { ButtonContainer };
|
|
20
|
-
export declare const ButtonDefault: ({ onAction, ...other }: ButtonProps) => JSX.Element;
|
|
21
|
-
export declare const ButtonPrimary: ({ onAction, ...other }: ButtonProps) => JSX.Element;
|
|
22
|
-
export declare const ButtonSecondary: ({ onAction, ...other }: ButtonProps) => JSX.Element;
|
|
23
|
-
export declare const IconButton: ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => JSX.Element;
|
|
20
|
+
export declare const ButtonDefault: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
|
|
21
|
+
export declare const ButtonPrimary: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
|
|
22
|
+
export declare const ButtonSecondary: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
|
|
23
|
+
export declare const IconButton: ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => React.JSX.Element;
|
|
@@ -21,7 +21,7 @@ var _excluded = ["onAction"],
|
|
|
21
21
|
_excluded2 = ["onAction"],
|
|
22
22
|
_excluded3 = ["onAction"],
|
|
23
23
|
_excluded4 = ["label", "onAction", "tooltipPlacement"];
|
|
24
|
-
var Buttons = function Buttons(props) {
|
|
24
|
+
var Buttons = exports.Buttons = function Buttons(props) {
|
|
25
25
|
if (!props.actions.length) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
@@ -31,32 +31,28 @@ var Buttons = function Buttons(props) {
|
|
|
31
31
|
}, /*#__PURE__*/_react.default.createElement(_useButtons.ButtonsProvider, null, action.element));
|
|
32
32
|
}));
|
|
33
33
|
};
|
|
34
|
-
exports.
|
|
35
|
-
var ButtonDefault = function ButtonDefault(_ref) {
|
|
34
|
+
var ButtonDefault = exports.ButtonDefault = function ButtonDefault(_ref) {
|
|
36
35
|
var onAction = _ref.onAction,
|
|
37
36
|
other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
37
|
return /*#__PURE__*/_react.default.createElement(_Button.ButtonDefault, Object.assign({}, other, {
|
|
39
38
|
onClick: onAction
|
|
40
39
|
}));
|
|
41
40
|
};
|
|
42
|
-
exports.
|
|
43
|
-
var ButtonPrimary = function ButtonPrimary(_ref2) {
|
|
41
|
+
var ButtonPrimary = exports.ButtonPrimary = function ButtonPrimary(_ref2) {
|
|
44
42
|
var onAction = _ref2.onAction,
|
|
45
43
|
other = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
46
44
|
return /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, Object.assign({}, other, {
|
|
47
45
|
onClick: onAction
|
|
48
46
|
}));
|
|
49
47
|
};
|
|
50
|
-
exports.
|
|
51
|
-
var ButtonSecondary = function ButtonSecondary(_ref3) {
|
|
48
|
+
var ButtonSecondary = exports.ButtonSecondary = function ButtonSecondary(_ref3) {
|
|
52
49
|
var onAction = _ref3.onAction,
|
|
53
50
|
other = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
|
|
54
51
|
return /*#__PURE__*/_react.default.createElement(_Button.ButtonSecondary, Object.assign({}, other, {
|
|
55
52
|
onClick: onAction
|
|
56
53
|
}));
|
|
57
54
|
};
|
|
58
|
-
exports.
|
|
59
|
-
var IconButton = function IconButton(_ref4) {
|
|
55
|
+
var IconButton = exports.IconButton = function IconButton(_ref4) {
|
|
60
56
|
var label = _ref4.label,
|
|
61
57
|
onAction = _ref4.onAction,
|
|
62
58
|
tooltipPlacement = _ref4.tooltipPlacement,
|
|
@@ -73,6 +69,5 @@ var IconButton = function IconButton(_ref4) {
|
|
|
73
69
|
onClick: onAction
|
|
74
70
|
}));
|
|
75
71
|
};
|
|
76
|
-
exports.IconButton = IconButton;
|
|
77
72
|
|
|
78
73
|
//# sourceMappingURL=Buttons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_Button","_Tooltip","_useButtons","_Buttons","_excluded","_excluded2","_excluded3","_excluded4","Buttons","props","actions","length","default","createElement","Fragment","map","action","ButtonContainer","key","name","ButtonsProvider","element","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Button","_Tooltip","_useButtons","_Buttons","_excluded","_excluded2","_excluded3","_excluded4","Buttons","exports","props","actions","length","default","createElement","Fragment","map","action","ButtonContainer","key","name","ButtonsProvider","element","ButtonDefault","_ref","onAction","other","_objectWithoutProperties2","Object","assign","onClick","ButtonPrimary","_ref2","ButtonSecondary","_ref3","IconButton","_ref4","label","tooltipPlacement","Tooltip","content","placement"],"sources":["Buttons.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n ButtonDefault as BaseButtonDefault,\n ButtonPrimary as BaseButtonPrimary,\n ButtonSecondary as BaseButtonSecondary,\n IconButton as BaseIconButton,\n ButtonProps as BaseButtonProps,\n IconButtonProps as BaseIconButtonProps\n} from \"@webiny/ui/Button\";\nimport { Tooltip, TooltipProps } from \"@webiny/ui/Tooltip\";\n\nimport { ButtonsProvider } from \"./useButtons\";\nimport { ButtonContainer } from \"./Buttons.styles\";\n\ninterface ButtonProps extends Omit<BaseButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n}\n\ninterface IconButtonProps extends Omit<BaseIconButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n tooltipPlacement?: TooltipProps[\"placement\"];\n}\n\nexport interface ButtonsProps {\n actions: {\n name: string;\n element: React.ReactElement;\n }[];\n}\n\nexport const Buttons = (props: ButtonsProps) => {\n if (!props.actions.length) {\n return null;\n }\n\n return (\n <>\n {props.actions.map(action => (\n <ButtonContainer key={action.name}>\n <ButtonsProvider>{action.element}</ButtonsProvider>\n </ButtonContainer>\n ))}\n </>\n );\n};\n\nexport { ButtonContainer };\n\nexport const ButtonDefault = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonDefault {...other} onClick={onAction} />;\n};\n\nexport const ButtonPrimary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonPrimary {...other} onClick={onAction} />;\n};\n\nexport const ButtonSecondary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonSecondary {...other} onClick={onAction} />;\n};\n\nexport const IconButton = ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => {\n if (label) {\n return (\n <Tooltip content={label} placement={tooltipPlacement}>\n <BaseIconButton {...other} onClick={onAction} />\n </Tooltip>\n );\n }\n\n return <BaseIconButton {...other} onClick={onAction} />;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD,IAAAK,SAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;AAkB5C,IAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAAIE,KAAmB,EAAK;EAC5C,IAAI,CAACA,KAAK,CAACC,OAAO,CAACC,MAAM,EAAE;IACvB,OAAO,IAAI;EACf;EAEA,oBACIf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAAjB,MAAA,CAAAgB,OAAA,CAAAE,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A,CAAAd,OAAA,EAAAqB,KAAA,EAAA5B,UAAA;EAChD,oBAAOT,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,OAAA,CAAAiC,eAAmB,EAAAL,MAAA,CAAAC,MAAA,KAAKH,KAAK;IAAEI,OAAO,EAAEL;EAAS,EAAE,CAAC;AAChE,CAAC;AAEM,IAAMU,UAAU,GAAA1B,OAAA,CAAA0B,UAAA,GAAG,SAAbA,UAAUA,CAAAC,KAAA,EAAyE;EAAA,IAAnEC,KAAK,GAAAD,KAAA,CAALC,KAAK;IAAEZ,QAAQ,GAAAW,KAAA,CAARX,QAAQ;IAAEa,gBAAgB,GAAAF,KAAA,CAAhBE,gBAAgB;IAAKZ,KAAK,OAAAC,yBAAA,CAAAd,OAAA,EAAAuB,KAAA,EAAA7B,UAAA;EACpE,IAAI8B,KAAK,EAAE;IACP,oBACIxC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACb,QAAA,CAAAsC,OAAO;MAACC,OAAO,EAAEH,KAAM;MAACI,SAAS,EAAEH;IAAiB,gBACjDzC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,OAAA,CAAAmC,UAAc,EAAAP,MAAA,CAAAC,MAAA,KAAKH,KAAK;MAAEI,OAAO,EAAEL;IAAS,EAAE,CAC1C,CAAC;EAElB;EAEA,oBAAO5B,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,OAAA,CAAAmC,UAAc,EAAAP,MAAA,CAAAC,MAAA,KAAKH,KAAK;IAAEI,OAAO,EAAEL;EAAS,EAAE,CAAC;AAC3D,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const ButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -5,11 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ButtonContainer = void 0;
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
|
+
var ButtonContainer = exports.ButtonContainer = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
11
11
|
target: "e1ubuzv90"
|
|
12
|
-
}
|
|
13
|
-
|
|
12
|
+
} : {
|
|
13
|
+
target: "e1ubuzv90",
|
|
14
|
+
label: "ButtonContainer"
|
|
15
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "178lqee",
|
|
17
|
+
styles: "margin-left:16px;text-wrap:nowrap"
|
|
18
|
+
} : {
|
|
19
|
+
name: "178lqee",
|
|
20
|
+
styles: "margin-left:16px;text-wrap:nowrap",
|
|
21
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJ1dHRvbnMuc3R5bGVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFNEMiLCJmaWxlIjoiQnV0dG9ucy5zdHlsZXMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5cbmV4cG9ydCBjb25zdCBCdXR0b25Db250YWluZXIgPSBzdHlsZWQoXCJkaXZcIilgXG4gICAgbWFyZ2luLWxlZnQ6IDE2cHg7XG4gICAgdGV4dC13cmFwOiBub3dyYXA7XG5gO1xuIl19 */",
|
|
22
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
+
});
|
|
14
24
|
|
|
15
25
|
//# sourceMappingURL=Buttons.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ButtonContainer","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["Buttons.styles.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const ButtonContainer = styled(\"div\")`\n margin-left: 16px;\n text-wrap: nowrap;\n`;\n"],"mappings":";;;;;;;;;AAEO,IAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,gBAAG,IAAAE,KAAA,CAAAC,OAAA,EAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAG3C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Buttons","require","_useButtons"],"sources":["index.ts"],"sourcesContent":["export { Buttons, ButtonContainer } from \"./Buttons\";\nexport { useButtons } from \"./useButtons\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA"}
|
|
1
|
+
{"version":3,"names":["_Buttons","require","_useButtons"],"sources":["index.ts"],"sourcesContent":["export { Buttons, ButtonContainer } from \"./Buttons\";\nexport { useButtons } from \"./useButtons\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -9,6 +9,6 @@ export interface ButtonsProviderContext {
|
|
|
9
9
|
interface ButtonsProviderProps {
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}
|
|
12
|
-
export declare const ButtonsProvider: ({ children }: ButtonsProviderProps) => JSX.Element;
|
|
12
|
+
export declare const ButtonsProvider: ({ children }: ButtonsProviderProps) => React.JSX.Element;
|
|
13
13
|
export declare const useButtons: () => ButtonsProviderContext;
|
|
14
14
|
export {};
|
|
@@ -8,7 +8,7 @@ exports.useButtons = exports.ButtonsProvider = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Buttons = require("./Buttons");
|
|
10
10
|
var ButtonsContext = /*#__PURE__*/_react.default.createContext(undefined);
|
|
11
|
-
var ButtonsProvider = function ButtonsProvider(_ref) {
|
|
11
|
+
var ButtonsProvider = exports.ButtonsProvider = function ButtonsProvider(_ref) {
|
|
12
12
|
var children = _ref.children;
|
|
13
13
|
return /*#__PURE__*/_react.default.createElement(ButtonsContext.Provider, {
|
|
14
14
|
value: {
|
|
@@ -19,14 +19,12 @@ var ButtonsProvider = function ButtonsProvider(_ref) {
|
|
|
19
19
|
}
|
|
20
20
|
}, children);
|
|
21
21
|
};
|
|
22
|
-
exports.
|
|
23
|
-
var useButtons = function useButtons() {
|
|
22
|
+
var useButtons = exports.useButtons = function useButtons() {
|
|
24
23
|
var context = _react.default.useContext(ButtonsContext);
|
|
25
24
|
if (!context) {
|
|
26
25
|
throw new Error("useButtons must be used within a ButtonsContext");
|
|
27
26
|
}
|
|
28
27
|
return context;
|
|
29
28
|
};
|
|
30
|
-
exports.useButtons = useButtons;
|
|
31
29
|
|
|
32
30
|
//# sourceMappingURL=useButtons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_Buttons","ButtonsContext","React","createContext","undefined","ButtonsProvider","_ref","children","default","createElement","Provider","value","ButtonDefault","ButtonPrimary","ButtonSecondary","IconButton","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Buttons","ButtonsContext","React","createContext","undefined","ButtonsProvider","exports","_ref","children","default","createElement","Provider","value","ButtonDefault","ButtonPrimary","ButtonSecondary","IconButton","useButtons","context","useContext","Error"],"sources":["useButtons.tsx"],"sourcesContent":["import React from \"react\";\nimport { ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton } from \"./Buttons\";\n\nexport interface ButtonsProviderContext {\n ButtonDefault: typeof ButtonDefault;\n ButtonPrimary: typeof ButtonPrimary;\n ButtonSecondary: typeof ButtonSecondary;\n IconButton: typeof IconButton;\n}\n\nconst ButtonsContext = React.createContext<ButtonsProviderContext | undefined>(undefined);\n\ninterface ButtonsProviderProps {\n children: React.ReactNode;\n}\n\nexport const ButtonsProvider = ({ children }: ButtonsProviderProps) => {\n return (\n <ButtonsContext.Provider\n value={{ ButtonDefault, ButtonPrimary, ButtonSecondary, IconButton }}\n >\n {children}\n </ButtonsContext.Provider>\n );\n};\n\nexport const useButtons = (): ButtonsProviderContext => {\n const context = React.useContext(ButtonsContext);\n\n if (!context) {\n throw new Error(\"useButtons must be used within a ButtonsContext\");\n }\n\n return context;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAME,cAAc,gBAAGC,cAAK,CAACC,aAAa,CAAqCC,SAAS,CAAC;AAMlF,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAAE,IAAA,EAA2C;EAAA,IAArCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACtC,oBACIX,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACT,cAAc,CAACU,QAAQ;IACpBC,KAAK,EAAE;MAAEC,aAAa,EAAbA,sBAAa;MAAEC,aAAa,EAAbA,sBAAa;MAAEC,eAAe,EAAfA,wBAAe;MAAEC,UAAU,EAAVA;IAAW;EAAE,GAEpER,QACoB,CAAC;AAElC,CAAC;AAEM,IAAMS,UAAU,GAAAX,OAAA,CAAAW,UAAA,GAAG,SAAbA,UAAUA,CAAA,EAAiC;EACpD,IAAMC,OAAO,GAAGhB,cAAK,CAACiB,UAAU,CAAClB,cAAc,CAAC;EAEhD,IAAI,CAACiB,OAAO,EAAE;IACV,MAAM,IAAIE,KAAK,CAAC,iDAAiD,CAAC;EACtE;EAEA,OAAOF,OAAO;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GenericFormData } from "@webiny/form";
|
|
3
|
+
interface DialogProps {
|
|
4
|
+
onSubmit: (data: GenericFormData) => void;
|
|
5
|
+
closeDialog: () => void;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
open: boolean;
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare const CustomDialog: ({ open, loading, closeDialog, onSubmit, children }: DialogProps) => React.JSX.Element;
|
|
11
|
+
export interface CustomDialogContext {
|
|
12
|
+
loading: boolean;
|
|
13
|
+
closeDialog: () => void;
|
|
14
|
+
submit: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const useCustomDialog: () => CustomDialogContext;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useCustomDialog = exports.CustomDialog = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _form = require("@webiny/form");
|
|
10
|
+
var _styled = require("./styled");
|
|
11
|
+
var CustomDialog = exports.CustomDialog = function CustomDialog(_ref) {
|
|
12
|
+
var open = _ref.open,
|
|
13
|
+
loading = _ref.loading,
|
|
14
|
+
closeDialog = _ref.closeDialog,
|
|
15
|
+
onSubmit = _ref.onSubmit,
|
|
16
|
+
children = _ref.children;
|
|
17
|
+
var handleSubmit = function handleSubmit(data) {
|
|
18
|
+
onSubmit(data);
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_styled.DialogContainer, {
|
|
21
|
+
open: open,
|
|
22
|
+
onClose: closeDialog
|
|
23
|
+
}, open ? /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
24
|
+
onSubmit: handleSubmit
|
|
25
|
+
}, function () {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(CustomDialogProvider, {
|
|
27
|
+
loading: loading,
|
|
28
|
+
closeDialog: closeDialog
|
|
29
|
+
}, children);
|
|
30
|
+
}) : null);
|
|
31
|
+
};
|
|
32
|
+
var CustomDialogContext = /*#__PURE__*/_react.default.createContext(undefined);
|
|
33
|
+
var CustomDialogProvider = function CustomDialogProvider(_ref2) {
|
|
34
|
+
var loading = _ref2.loading,
|
|
35
|
+
closeDialog = _ref2.closeDialog,
|
|
36
|
+
children = _ref2.children;
|
|
37
|
+
var form = (0, _form.useForm)();
|
|
38
|
+
var context = {
|
|
39
|
+
submit: form.submit,
|
|
40
|
+
loading: loading,
|
|
41
|
+
closeDialog: closeDialog
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(CustomDialogContext.Provider, {
|
|
44
|
+
value: context
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
47
|
+
var useCustomDialog = exports.useCustomDialog = function useCustomDialog() {
|
|
48
|
+
var context = (0, _react.useContext)(CustomDialogContext);
|
|
49
|
+
if (!context) {
|
|
50
|
+
throw new Error("useCustomDialog must be used within the CustomDialogProvider.");
|
|
51
|
+
}
|
|
52
|
+
return context;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=CustomDialog.js.map
|