@webiny/app-admin 0.0.0-mt-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/assets/icons/add-18px.svg +3 -0
- package/assets/icons/arrow_drop_down-24px.svg +4 -0
- package/assets/icons/attach_file_black_24dp.svg +1 -0
- package/assets/icons/baseline-menu-24px.svg +4 -0
- package/assets/icons/baseline-notification_important-24px.svg +4 -0
- package/assets/icons/baseline-security-24px.svg +4 -0
- package/assets/icons/filter-24px.svg +8 -0
- package/assets/icons/github-brands.svg +1 -0
- package/assets/icons/highlight-24px.svg +1 -0
- package/assets/icons/icon-community.svg +16 -0
- package/assets/icons/icon-documentation.svg +16 -0
- package/assets/icons/info.svg +1 -0
- package/assets/icons/insert_drive_file-24px.svg +1 -0
- package/assets/icons/insert_photo-24px.svg +1 -0
- package/assets/icons/label-24px.svg +1 -0
- package/assets/icons/round-account_circle-24px.svg +1 -0
- package/assets/icons/round-add-24px.svg +16 -0
- package/assets/icons/round-arrow_drop_down-24px.svg +1 -0
- package/assets/icons/round-chevron_right-24px.svg +12 -0
- package/assets/icons/round-feedback-24px.svg +54 -0
- package/assets/icons/round-help-24px.svg +1 -0
- package/assets/icons/round-invert_colors-24px.svg +52 -0
- package/assets/icons/round-keyboard_arrow_down-24px.svg +16 -0
- package/assets/icons/round-keyboard_arrow_up-24px.svg +16 -0
- package/assets/icons/round-lock_open-24px.svg +60 -0
- package/assets/icons/round-more_vert-24px.svg +12 -0
- package/assets/icons/round-open_in_new-24px.svg +44 -0
- package/assets/icons/round-settings-24px.svg +4 -0
- package/assets/icons/search-24px.svg +20 -0
- package/assets/icons/slack-logo.svg +1 -0
- package/assets/icons/today-24px.svg +1 -0
- package/assets/icons/touch_app.svg +1 -0
- package/assets/images/arr.png +0 -0
- package/assets/images/arr_2.png +0 -0
- package/assets/images/header_bg.jpg +0 -0
- package/assets/images/icons.png +0 -0
- package/assets/images/icons_retina.png +0 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/logo_orange.png +0 -0
- package/assets/images/public/bg-login.png +0 -0
- package/assets/images/public/favicon.ico +0 -0
- package/assets/images/public/logo_orange.png +0 -0
- package/assets/images/public/preloader_2.png +0 -0
- package/assets/images/swich.png +0 -0
- package/assets/images/table_img.jpg +0 -0
- package/assets/images/webiny-logo.svg +20 -0
- package/assets/images/webiny-orange-logo.svg +20 -0
- package/components/AdminLayout.d.ts +7 -0
- package/components/AdminLayout.js +35 -0
- package/components/AppInstaller/Sidebar.d.ts +7 -0
- package/components/AppInstaller/Sidebar.js +158 -0
- package/components/AppInstaller/assets/sign-in-divider.svg +19 -0
- package/components/AppInstaller/index.d.ts +5 -0
- package/components/AppInstaller/index.js +134 -0
- package/components/AppInstaller/styled.d.ts +7 -0
- package/components/AppInstaller/styled.js +73 -0
- package/components/AppInstaller/useInstaller.d.ts +11 -0
- package/components/AppInstaller/useInstaller.js +279 -0
- package/components/EmptyView.d.ts +8 -0
- package/components/EmptyView.js +56 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +5 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +35 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +5 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.js +47 -0
- package/components/FileManager/BottomInfoBar.d.ts +3 -0
- package/components/FileManager/BottomInfoBar.js +42 -0
- package/components/FileManager/DropFilesHere.d.ts +8 -0
- package/components/FileManager/DropFilesHere.js +58 -0
- package/components/FileManager/File.d.ts +18 -0
- package/components/FileManager/File.js +129 -0
- package/components/FileManager/FileDetails/Name.d.ts +6 -0
- package/components/FileManager/FileDetails/Name.js +113 -0
- package/components/FileManager/FileDetails/Tags.d.ts +6 -0
- package/components/FileManager/FileDetails/Tags.js +241 -0
- package/components/FileManager/FileDetails.d.ts +23 -0
- package/components/FileManager/FileDetails.js +392 -0
- package/components/FileManager/FileManagerContext.d.ts +23 -0
- package/components/FileManager/FileManagerContext.js +174 -0
- package/components/FileManager/FileManagerView.d.ts +23 -0
- package/components/FileManager/FileManagerView.js +632 -0
- package/components/FileManager/LeftSidebar.d.ts +8 -0
- package/components/FileManager/LeftSidebar.js +95 -0
- package/components/FileManager/NoPermissionView.d.ts +3 -0
- package/components/FileManager/NoPermissionView.js +70 -0
- package/components/FileManager/NoResults.d.ts +2 -0
- package/components/FileManager/NoResults.js +13 -0
- package/components/FileManager/getFileTypePlugin.d.ts +1 -0
- package/components/FileManager/getFileTypePlugin.js +27 -0
- package/components/FileManager/getFileUploader.d.ts +2 -0
- package/components/FileManager/getFileUploader.js +10 -0
- package/components/FileManager/graphql.d.ts +6 -0
- package/components/FileManager/graphql.js +17 -0
- package/components/FileManager/icons/content_copy-black-24px.svg +1 -0
- package/components/FileManager/icons/delete.svg +12 -0
- package/components/FileManager/icons/privacy_tip-24px.svg +10 -0
- package/components/FileManager/icons/round-check_box-24px.svg +4 -0
- package/components/FileManager/icons/round-check_box_outline_blank-24px.svg +4 -0
- package/components/FileManager/icons/round-cloud_download-24px.svg +4 -0
- package/components/FileManager/icons/round-cloud_upload-24px.svg +4 -0
- package/components/FileManager/icons/round-description-24px.svg +4 -0
- package/components/FileManager/icons/round-edit-24px.svg +4 -0
- package/components/FileManager/icons/round-info-24px.svg +4 -0
- package/components/FileManager/icons/round-label-24px.svg +4 -0
- package/components/FileManager/icons/round-more_vert-24px.svg +4 -0
- package/components/FileManager/icons/round-search-24px.svg +20 -0
- package/components/FileManager/outputFileSelectionError.d.ts +2 -0
- package/components/FileManager/outputFileSelectionError.js +39 -0
- package/components/FileManager.d.ts +18 -0
- package/components/FileManager.js +133 -0
- package/components/FloatingActionButton.d.ts +3 -0
- package/components/FloatingActionButton.js +17 -0
- package/components/MultiImageUpload.d.ts +4 -0
- package/components/MultiImageUpload.js +20 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +25 -0
- package/components/OverlayLayout/OverlayLayout.js +159 -0
- package/components/OverlayLayout/icons/close.svg +13 -0
- package/components/OverlayLayout/icons/navigate_before.svg +16 -0
- package/components/OverlayLayout/index.d.ts +1 -0
- package/components/OverlayLayout/index.js +1 -0
- package/components/Permissions/Permissions.d.ts +7 -0
- package/components/Permissions/Permissions.js +37 -0
- package/components/Permissions/StyledComponents.d.ts +6 -0
- package/components/Permissions/StyledComponents.js +19 -0
- package/components/Permissions/index.d.ts +2 -0
- package/components/Permissions/index.js +2 -0
- package/components/RichTextEditor/RichTextEditor.d.ts +3 -0
- package/components/RichTextEditor/RichTextEditor.js +15 -0
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/RichTextEditor/index.js +2 -0
- package/components/RichTextEditor/styles.scss +64 -0
- package/components/RichTextEditor/tools/header/index.d.ts +228 -0
- package/components/RichTextEditor/tools/header/index.js +731 -0
- package/components/RichTextEditor/tools/header/styles.scss +48 -0
- package/components/RichTextEditor/tools/image/index.d.ts +97 -0
- package/components/RichTextEditor/tools/image/index.js +257 -0
- package/components/RichTextEditor/tools/image/styles.scss +90 -0
- package/components/RichTextEditor/tools/image/svgs.d.ts +6 -0
- package/components/RichTextEditor/tools/image/svgs.js +5 -0
- package/components/RichTextEditor/tools/image/tunes.d.ts +58 -0
- package/components/RichTextEditor/tools/image/tunes.js +134 -0
- package/components/RichTextEditor/tools/image/ui.d.ts +111 -0
- package/components/RichTextEditor/tools/image/ui.js +281 -0
- package/components/RichTextEditor/tools/paragraph/index.d.ts +211 -0
- package/components/RichTextEditor/tools/paragraph/index.js +520 -0
- package/components/RichTextEditor/tools/paragraph/styles.scss +29 -0
- package/components/RichTextEditor/tools/textColor/index.d.ts +58 -0
- package/components/RichTextEditor/tools/textColor/index.js +232 -0
- package/components/RichTextEditor/tools/textColor/styles.scss +21 -0
- package/components/RichTextEditor/tools/utils.d.ts +19 -0
- package/components/RichTextEditor/tools/utils.js +24 -0
- package/components/SearchUI.d.ts +8 -0
- package/components/SearchUI.js +59 -0
- package/components/SimpleForm/SimpleForm.d.ts +21 -0
- package/components/SimpleForm/SimpleForm.js +75 -0
- package/components/SimpleForm/index.d.ts +1 -0
- package/components/SimpleForm/index.js +1 -0
- package/components/SimpleUI/InputField.d.ts +9 -0
- package/components/SimpleUI/InputField.js +97 -0
- package/components/SingleImageUpload.d.ts +25 -0
- package/components/SingleImageUpload.js +102 -0
- package/components/SplitView/SplitView.d.ts +10 -0
- package/components/SplitView/SplitView.js +76 -0
- package/components/SplitView/index.d.ts +1 -0
- package/components/SplitView/index.js +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/hooks/useConfirmationDialog.d.ts +10 -0
- package/hooks/useConfirmationDialog.js +47 -0
- package/hooks/useDialog.d.ts +5 -0
- package/hooks/useDialog.js +27 -0
- package/hooks/useSnackbar.d.ts +4 -0
- package/hooks/useSnackbar.js +25 -0
- package/package.json +101 -0
- package/plugins/FileManagerFileTypePlugin.d.ts +33 -0
- package/plugins/FileManagerFileTypePlugin.js +46 -0
- package/plugins/MenuPlugin.d.ts +20 -0
- package/plugins/MenuPlugin.js +41 -0
- package/plugins/PermissionRendererPlugin.d.ts +22 -0
- package/plugins/PermissionRendererPlugin.js +41 -0
- package/plugins/fileManager/fileDefault.d.ts +3 -0
- package/plugins/fileManager/fileDefault.js +20 -0
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +3 -0
- package/plugins/fileManager/fileImage/DeleteAction.js +62 -0
- package/plugins/fileManager/fileImage/EditAction.d.ts +9 -0
- package/plugins/fileManager/fileImage/EditAction.js +143 -0
- package/plugins/fileManager/fileImage/index.d.ts +3 -0
- package/plugins/fileManager/fileImage/index.js +29 -0
- package/plugins/fileManager/icons/edit.svg +17 -0
- package/plugins/fileManager/icons/round-description-24px.svg +1 -0
- package/plugins/fileManager/index.d.ts +2 -0
- package/plugins/fileManager/index.js +3 -0
- package/plugins/globalSearch/SearchBar.d.ts +3 -0
- package/plugins/globalSearch/SearchBar.js +241 -0
- package/plugins/globalSearch/SearchBarDropdown.d.ts +5 -0
- package/plugins/globalSearch/SearchBarDropdown.js +82 -0
- package/plugins/globalSearch/icons/round-search-24px.svg +20 -0
- package/plugins/globalSearch/index.d.ts +8 -0
- package/plugins/globalSearch/index.js +30 -0
- package/plugins/globalSearch/styled.d.ts +9 -0
- package/plugins/globalSearch/styled.js +115 -0
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +8 -0
- package/plugins/logo/Logo.d.ts +22 -0
- package/plugins/logo/Logo.js +108 -0
- package/plugins/logo/index.d.ts +5 -0
- package/plugins/logo/index.js +32 -0
- package/plugins/menu/documentation.d.ts +4 -0
- package/plugins/menu/documentation.js +16 -0
- package/plugins/menu/fileManager.d.ts +4 -0
- package/plugins/menu/fileManager.js +64 -0
- package/plugins/menu/index.d.ts +6 -0
- package/plugins/menu/index.js +24 -0
- package/plugins/menu/renderers/MenuGroupRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuGroupRenderer.js +126 -0
- package/plugins/menu/renderers/MenuLinkRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuLinkRenderer.js +52 -0
- package/plugins/menu/renderers/MenuSectionItemRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuSectionItemRenderer.js +77 -0
- package/plugins/menu/renderers/MenuSectionRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuSectionRenderer.js +51 -0
- package/plugins/menu/slack.d.ts +4 -0
- package/plugins/menu/slack.js +16 -0
- package/plugins/menu/source.d.ts +4 -0
- package/plugins/menu/source.js +16 -0
- package/plugins/uiLayoutRenderer/index.d.ts +3 -0
- package/plugins/uiLayoutRenderer/index.js +63 -0
- package/plugins/userMenu/UserMenuElement.d.ts +7 -0
- package/plugins/userMenu/UserMenuElement.js +43 -0
- package/plugins/userMenu/UserMenuRenderer.d.ts +6 -0
- package/plugins/userMenu/UserMenuRenderer.js +47 -0
- package/plugins/userMenu/index.d.ts +4 -0
- package/plugins/userMenu/index.js +16 -0
- package/styles/material-theme-assignments.scss +333 -0
- package/styles/material.scss +74 -0
- package/styles/theme.scss +43 -0
- package/styles.scss +2 -0
- package/types.d.ts +100 -0
- package/types.js +1 -0
- package/ui/UIElement.d.ts +2 -0
- package/ui/UIElement.js +1 -0
- package/ui/UILayout.d.ts +1 -0
- package/ui/UILayout.js +1 -0
- package/ui/UIRenderer.d.ts +2 -0
- package/ui/UIRenderer.js +1 -0
- package/ui/UIView.d.ts +2 -0
- package/ui/UIView.js +1 -0
- package/ui/elements/AccordionElement.d.ts +27 -0
- package/ui/elements/AccordionElement.js +86 -0
- package/ui/elements/ButtonElement.d.ts +24 -0
- package/ui/elements/ButtonElement.js +78 -0
- package/ui/elements/ButtonGroupElement.d.ts +6 -0
- package/ui/elements/ButtonGroupElement.js +48 -0
- package/ui/elements/GenericElement.d.ts +1 -0
- package/ui/elements/GenericElement.js +1 -0
- package/ui/elements/LabelElement.d.ts +16 -0
- package/ui/elements/LabelElement.js +47 -0
- package/ui/elements/NavigationMenuElement.d.ts +32 -0
- package/ui/elements/NavigationMenuElement.js +158 -0
- package/ui/elements/PanelElement.d.ts +3 -0
- package/ui/elements/PanelElement.js +17 -0
- package/ui/elements/PlaceholderElement.d.ts +5 -0
- package/ui/elements/PlaceholderElement.js +30 -0
- package/ui/elements/SmallButtonElement.d.ts +6 -0
- package/ui/elements/SmallButtonElement.js +47 -0
- package/ui/elements/TypographyElement.d.ts +13 -0
- package/ui/elements/TypographyElement.js +49 -0
- package/ui/elements/ViewElement.d.ts +1 -0
- package/ui/elements/ViewElement.js +1 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +6 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +44 -0
- package/ui/elements/form/DynamicFieldsetElement.d.ts +42 -0
- package/ui/elements/form/DynamicFieldsetElement.js +127 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.d.ts +4 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +24 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +7 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +72 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +13 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +95 -0
- package/ui/elements/form/FileManagerElement/styled.d.ts +14 -0
- package/ui/elements/form/FileManagerElement/styled.js +106 -0
- package/ui/elements/form/FileManagerElement.d.ts +24 -0
- package/ui/elements/form/FileManagerElement.js +91 -0
- package/ui/elements/form/FormElement.d.ts +21 -0
- package/ui/elements/form/FormElement.js +45 -0
- package/ui/elements/form/FormFieldElement.d.ts +55 -0
- package/ui/elements/form/FormFieldElement.js +183 -0
- package/ui/elements/form/HiddenElement.d.ts +6 -0
- package/ui/elements/form/HiddenElement.js +49 -0
- package/ui/elements/form/InputElement.d.ts +6 -0
- package/ui/elements/form/InputElement.js +55 -0
- package/ui/elements/form/PasswordElement.d.ts +6 -0
- package/ui/elements/form/PasswordElement.js +50 -0
- package/ui/elements/form/README.md +2 -0
- package/ui/elements/form/SelectElement.d.ts +15 -0
- package/ui/elements/form/SelectElement.js +71 -0
- package/ui/elements/form/TextareaElement.d.ts +15 -0
- package/ui/elements/form/TextareaElement.js +56 -0
- package/ui/views/AdminView/ContentElement.d.ts +4 -0
- package/ui/views/AdminView/ContentElement.js +62 -0
- package/ui/views/AdminView/HeaderElement.d.ts +13 -0
- package/ui/views/AdminView/HeaderElement.js +111 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.js +42 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.js +42 -0
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionRightElement.js +42 -0
- package/ui/views/AdminView/components/Dialog.d.ts +2 -0
- package/ui/views/AdminView/components/Dialog.js +40 -0
- package/ui/views/AdminView/components/Hamburger.d.ts +3 -0
- package/ui/views/AdminView/components/Hamburger.js +25 -0
- package/ui/views/AdminView/components/Snackbar.d.ts +3 -0
- package/ui/views/AdminView/components/Snackbar.js +28 -0
- package/ui/views/AdminView.d.ts +12 -0
- package/ui/views/AdminView.js +90 -0
- package/ui/views/FormView/FormContainerElement.d.ts +12 -0
- package/ui/views/FormView/FormContainerElement.js +51 -0
- package/ui/views/FormView/FormContentElement.d.ts +3 -0
- package/ui/views/FormView/FormContentElement.js +17 -0
- package/ui/views/FormView/FormFooterElement.d.ts +6 -0
- package/ui/views/FormView/FormFooterElement.js +49 -0
- package/ui/views/FormView/FormHeaderElement.d.ts +14 -0
- package/ui/views/FormView/FormHeaderElement.js +81 -0
- package/ui/views/FormView.d.ts +40 -0
- package/ui/views/FormView.js +160 -0
- package/ui/views/NavigationView/ContentElement.d.ts +10 -0
- package/ui/views/NavigationView/ContentElement.js +86 -0
- package/ui/views/NavigationView/FooterElement.d.ts +13 -0
- package/ui/views/NavigationView/FooterElement.js +57 -0
- package/ui/views/NavigationView/HeaderElement.d.ts +16 -0
- package/ui/views/NavigationView/HeaderElement.js +66 -0
- package/ui/views/NavigationView/NavigationViewRenderer.d.ts +6 -0
- package/ui/views/NavigationView/NavigationViewRenderer.js +38 -0
- package/ui/views/NavigationView/Styled.d.ts +7 -0
- package/ui/views/NavigationView/Styled.js +47 -0
- package/ui/views/NavigationView/legacyMenu.d.ts +22 -0
- package/ui/views/NavigationView/legacyMenu.js +1 -0
- package/ui/views/NavigationView/useNavigation.d.ts +6 -0
- package/ui/views/NavigationView/useNavigation.js +22 -0
- package/ui/views/NavigationView.d.ts +26 -0
- package/ui/views/NavigationView.js +204 -0
- package/ui/views/OverlayView/ContentElement.d.ts +6 -0
- package/ui/views/OverlayView/ContentElement.js +42 -0
- package/ui/views/OverlayView/HeaderElement.d.ts +24 -0
- package/ui/views/OverlayView/HeaderElement.js +115 -0
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +13 -0
- package/ui/views/OverlayView/HeaderTitleElement.js +54 -0
- package/ui/views/OverlayView/useOverlayView.d.ts +6 -0
- package/ui/views/OverlayView/useOverlayView.js +38 -0
- package/ui/views/OverlayView.d.ts +31 -0
- package/ui/views/OverlayView.js +176 -0
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +11 -0
- package/ui/views/SplitView/SplitViewPanelElement.js +72 -0
- package/ui/views/SplitView.d.ts +21 -0
- package/ui/views/SplitView.js +142 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
var COLOR_TOOL_CLASS = "cdx-text-color";
|
|
5
|
+
|
|
6
|
+
var TextColorTool = /*#__PURE__*/function () {
|
|
7
|
+
function TextColorTool(_ref) {
|
|
8
|
+
var api = _ref.api,
|
|
9
|
+
config = _ref.config;
|
|
10
|
+
|
|
11
|
+
_classCallCheck(this, TextColorTool);
|
|
12
|
+
|
|
13
|
+
_defineProperty(this, "_state", void 0);
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "color", void 0);
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "api", void 0);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "tag", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "class", void 0);
|
|
22
|
+
|
|
23
|
+
_defineProperty(this, "colorPicker", void 0);
|
|
24
|
+
|
|
25
|
+
_defineProperty(this, "button", void 0);
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "config", void 0);
|
|
28
|
+
|
|
29
|
+
_defineProperty(this, "_CSS", void 0);
|
|
30
|
+
|
|
31
|
+
this.api = api;
|
|
32
|
+
this.button = null;
|
|
33
|
+
this._state = false;
|
|
34
|
+
this.tag = "SPAN";
|
|
35
|
+
this.color = "red";
|
|
36
|
+
this.class = COLOR_TOOL_CLASS;
|
|
37
|
+
this.config = config || {
|
|
38
|
+
themeColors: ["#44bd32"]
|
|
39
|
+
};
|
|
40
|
+
this._CSS = {
|
|
41
|
+
colorPicker: "ce-text-color-tool",
|
|
42
|
+
colorBox: "ce-text-color-tool__color-box",
|
|
43
|
+
colorBoxActive: "ce-text-color-tool__color-box--active"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
_createClass(TextColorTool, [{
|
|
48
|
+
key: "state",
|
|
49
|
+
get: function get() {
|
|
50
|
+
return this._state;
|
|
51
|
+
},
|
|
52
|
+
set: function set(state) {
|
|
53
|
+
this._state = state;
|
|
54
|
+
this.button.classList.toggle(this.api.styles.inlineToolButtonActive, state);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Render method must return HTML element of the button for Inline Toolbar.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
}, {
|
|
61
|
+
key: "render",
|
|
62
|
+
value: function render() {
|
|
63
|
+
this.button = document.createElement("button");
|
|
64
|
+
this.button.type = "button";
|
|
65
|
+
this.button.innerHTML = '<svg width="20" height="18"><path d="M10.458 12.04l2.919 1.686-.781 1.417-.984-.03-.974 1.687H8.674l1.49-2.583-.508-.775.802-1.401zm.546-.952l3.624-6.327a1.597 1.597 0 0 1 2.182-.59 1.632 1.632 0 0 1 .615 2.201l-3.519 6.391-2.902-1.675zm-7.73 3.467h3.465a1.123 1.123 0 1 1 0 2.247H3.273a1.123 1.123 0 1 1 0-2.247z"/></svg>';
|
|
66
|
+
this.button.classList.add(this.api.styles.inlineToolButton);
|
|
67
|
+
return this.button;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Input for the link
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
}, {
|
|
74
|
+
key: "renderActions",
|
|
75
|
+
value: function renderActions() {
|
|
76
|
+
var _this = this;
|
|
77
|
+
|
|
78
|
+
// Create action element
|
|
79
|
+
this.colorPicker = document.createElement("div"); // Add element properties
|
|
80
|
+
|
|
81
|
+
this.colorPicker.classList.add(this._CSS.colorPicker);
|
|
82
|
+
this.config.themeColors.forEach(function (color) {
|
|
83
|
+
// create element
|
|
84
|
+
var colorBox = document.createElement("button"); // add properties
|
|
85
|
+
|
|
86
|
+
colorBox.style.backgroundColor = color;
|
|
87
|
+
colorBox.classList.add(_this._CSS.colorBox);
|
|
88
|
+
colorBox.addEventListener("click", function () {
|
|
89
|
+
if (_this.color === color) {
|
|
90
|
+
// reset the color
|
|
91
|
+
_this.color = "unset";
|
|
92
|
+
} else {
|
|
93
|
+
// set color
|
|
94
|
+
_this.color = color;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_this.colorPicker.childNodes.forEach(function (node) {
|
|
98
|
+
if (node.classList.contains(_this._CSS.colorBoxActive)) {
|
|
99
|
+
// remove active class
|
|
100
|
+
node.classList.remove(_this._CSS.colorBoxActive);
|
|
101
|
+
}
|
|
102
|
+
}); // add active class
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
colorBox.classList.add(_this._CSS.colorBoxActive);
|
|
106
|
+
}); // save element
|
|
107
|
+
|
|
108
|
+
_this.colorPicker.appendChild(colorBox);
|
|
109
|
+
}); // Return element
|
|
110
|
+
|
|
111
|
+
return this.colorPicker;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Finally, when button is pressed Editor calls
|
|
115
|
+
* surround method of the tool with Range object as an argument.
|
|
116
|
+
* @param range
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
}, {
|
|
120
|
+
key: "surround",
|
|
121
|
+
value: function surround(range) {
|
|
122
|
+
if (this.state) {
|
|
123
|
+
this.unwrap(range);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.wrap(range);
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "wrap",
|
|
131
|
+
value: function wrap(range) {
|
|
132
|
+
var selectedText = range.extractContents();
|
|
133
|
+
var mark = document.createElement(this.tag);
|
|
134
|
+
mark.classList.add(this.class);
|
|
135
|
+
mark.appendChild(selectedText);
|
|
136
|
+
range.insertNode(mark);
|
|
137
|
+
this.api.selection.expandToTag(mark);
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
key: "unwrap",
|
|
141
|
+
value: function unwrap(range) {
|
|
142
|
+
var mark = this.api.selection.findParentTag(this.tag, this.class);
|
|
143
|
+
var text = range.extractContents();
|
|
144
|
+
mark.remove();
|
|
145
|
+
range.insertNode(text);
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "showActions",
|
|
149
|
+
value: function showActions(mark) {
|
|
150
|
+
var _this2 = this;
|
|
151
|
+
|
|
152
|
+
this.colorPicker.onclick = function () {
|
|
153
|
+
mark.style.color = _this2.color;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
this.colorPicker.hidden = false;
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "hideActions",
|
|
160
|
+
value: function hideActions() {
|
|
161
|
+
this.colorPicker.onchange = null;
|
|
162
|
+
this.colorPicker.hidden = true;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* CheckState method of each Inline Tool is called by Editor with current `Selection`
|
|
166
|
+
* when user selects some text
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
}, {
|
|
170
|
+
key: "checkState",
|
|
171
|
+
value: function checkState() {
|
|
172
|
+
var mark = this.api.selection.findParentTag(this.tag);
|
|
173
|
+
this.state = !!mark;
|
|
174
|
+
|
|
175
|
+
if (this.state) {
|
|
176
|
+
this.showActions(mark);
|
|
177
|
+
} else {
|
|
178
|
+
this.hideActions();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "convertToHex",
|
|
183
|
+
value: function convertToHex(color) {
|
|
184
|
+
var rgb = color.match(/(\d+)/g);
|
|
185
|
+
var hexR = parseInt(rgb[0]).toString(16);
|
|
186
|
+
var hexG = parseInt(rgb[1]).toString(16);
|
|
187
|
+
var hexB = parseInt(rgb[2]).toString(16);
|
|
188
|
+
hexR = hexR.length === 1 ? "0" + hexR : hexR;
|
|
189
|
+
hexG = hexG.length === 1 ? "0" + hexG : hexG;
|
|
190
|
+
hexB = hexB.length === 1 ? "0" + hexB : hexB;
|
|
191
|
+
return "#" + hexR + hexG + hexB;
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "clear",
|
|
195
|
+
value: function clear() {
|
|
196
|
+
this.hideActions();
|
|
197
|
+
}
|
|
198
|
+
}], [{
|
|
199
|
+
key: "isInline",
|
|
200
|
+
get: function get() {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Sanitize method returns rules to let Editor know which HTML tags it should respect.
|
|
205
|
+
* @returns {object} sanitizer configuration.
|
|
206
|
+
* https://editorjs.io/sanitizer
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
}, {
|
|
210
|
+
key: "sanitize",
|
|
211
|
+
get: function get() {
|
|
212
|
+
// Block Tools are not connected with Inline ones,
|
|
213
|
+
// so markup added by Inline Tool will be removed on pasting or on saving.
|
|
214
|
+
// We need this config so that `class` & `style` attributes will remain intact for "span".
|
|
215
|
+
return {
|
|
216
|
+
span: function span(el) {
|
|
217
|
+
// Respect `class` and `style` attributes if this condition is meet.
|
|
218
|
+
if (el.classList.contains(COLOR_TOOL_CLASS)) {
|
|
219
|
+
return {
|
|
220
|
+
class: COLOR_TOOL_CLASS,
|
|
221
|
+
style: el.style
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}]);
|
|
228
|
+
|
|
229
|
+
return TextColorTool;
|
|
230
|
+
}();
|
|
231
|
+
|
|
232
|
+
export default TextColorTool;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.ce-text-color-tool {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
4
|
+
grid-template-rows: 1fr 1fr 1fr;
|
|
5
|
+
gap: 16px 16px;
|
|
6
|
+
padding: 16px;
|
|
7
|
+
border-top: 1px solid #eee;
|
|
8
|
+
}
|
|
9
|
+
.ce-text-color-tool__color-box {
|
|
10
|
+
width: 42px;
|
|
11
|
+
height: 30px;
|
|
12
|
+
padding: 8px 12px;
|
|
13
|
+
margin: 0;
|
|
14
|
+
border: none;
|
|
15
|
+
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
16
|
+
border-radius: 2px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
.ce-text-color-tool__color-box--active {
|
|
20
|
+
border: 1px solid #616161;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum TextAlign {
|
|
2
|
+
START = "start",
|
|
3
|
+
END = "end",
|
|
4
|
+
CENTER = "center"
|
|
5
|
+
}
|
|
6
|
+
export declare type Alignment = {
|
|
7
|
+
name: TextAlign;
|
|
8
|
+
svg: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const ALIGNMENT_ICONS: {
|
|
11
|
+
start: string;
|
|
12
|
+
end: string;
|
|
13
|
+
center: string;
|
|
14
|
+
justify: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const ALIGNMENTS: {
|
|
17
|
+
name: TextAlign;
|
|
18
|
+
svg: string;
|
|
19
|
+
}[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var TextAlign;
|
|
2
|
+
|
|
3
|
+
(function (TextAlign) {
|
|
4
|
+
TextAlign["START"] = "start";
|
|
5
|
+
TextAlign["END"] = "end";
|
|
6
|
+
TextAlign["CENTER"] = "center";
|
|
7
|
+
})(TextAlign || (TextAlign = {}));
|
|
8
|
+
|
|
9
|
+
export var ALIGNMENT_ICONS = {
|
|
10
|
+
start: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n' + ' <path fill="none" d="M0 0h24v24H0V0z"/>\n' + " <g>\n" + ' <path fill="currentColor" d="M14 15H4c-.55 0-1 .45-1 1s.45 1 1 1h10c.55 0 1-.45 1-1s-.45-1-1-1zm0-8H4c-.55 0-1 .45-1 1s.45 1 1 1h10c.55 0 1-.45 1-1s-.45-1-1-1zM4 13h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0 8h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 4c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z"/>\n' + " </g>\n" + "</svg>",
|
|
11
|
+
end: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n' + ' <path fill="none" d="M0 0h24v24H0V0z"/>\n' + " <g>\n" + ' <path fill="currentColor" d="M4 21h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm6-4h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1zm-6-4h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm6-4h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1zM3 4c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z"/>\n' + " </g>\n" + "</svg>",
|
|
12
|
+
center: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n' + ' <path fill="none" d="M0 0h24v24H0V0z"/>\n' + " <g>\n" + ' <path fill="currentColor" d="M7 16c0 .55.45 1 1 1h8c.55 0 1-.45 1-1s-.45-1-1-1H8c-.55 0-1 .45-1 1zm-3 5h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-8h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm3-5c0 .55.45 1 1 1h8c.55 0 1-.45 1-1s-.45-1-1-1H8c-.55 0-1 .45-1 1zM3 4c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z"/>\n' + " </g>\n" + "</svg>",
|
|
13
|
+
justify: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n' + ' <path fill="none" d="M0 0h24v24H0V0z"/>\n' + " <g>\n" + ' <path fill="currentColor" d="M4 21h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-4h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-4h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-4h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 4c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z"/>\n' + " </g>\n" + "</svg>"
|
|
14
|
+
};
|
|
15
|
+
export var ALIGNMENTS = [{
|
|
16
|
+
name: TextAlign.START,
|
|
17
|
+
svg: ALIGNMENT_ICONS.start
|
|
18
|
+
}, {
|
|
19
|
+
name: TextAlign.CENTER,
|
|
20
|
+
svg: ALIGNMENT_ICONS.center
|
|
21
|
+
}, {
|
|
22
|
+
name: TextAlign.END,
|
|
23
|
+
svg: ALIGNMENT_ICONS.end
|
|
24
|
+
}];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type SearchProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
inputPlaceholder?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const Search: ({ value, onChange, inputPlaceholder }: SearchProps) => JSX.Element;
|
|
8
|
+
export default Search;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import InputField from "./SimpleUI/InputField";
|
|
4
|
+
import { ReactComponent as SearchIcon } from "@svgr/webpack!../assets/icons/search-24px.svg";
|
|
5
|
+
var SearchWrapper = /*#__PURE__*/styled("div", {
|
|
6
|
+
target: "epa3kz70",
|
|
7
|
+
label: "SearchWrapper"
|
|
8
|
+
})({
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "100%",
|
|
11
|
+
display: "flex",
|
|
12
|
+
position: "relative",
|
|
13
|
+
"& .search__icon": {
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
bottom: 0,
|
|
18
|
+
pointerEvents: "none",
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
paddingLeft: "0.25rem",
|
|
22
|
+
color: "var(--mdc-theme-text-secondary-on-background)"
|
|
23
|
+
},
|
|
24
|
+
"& .search__input": {
|
|
25
|
+
width: "100%",
|
|
26
|
+
padding: "0.5rem 0.5rem 0.5rem 2.25rem",
|
|
27
|
+
outline: "none",
|
|
28
|
+
border: "none",
|
|
29
|
+
color: "var(--mdc-theme-text-primary-on-background)",
|
|
30
|
+
"&:focus": {
|
|
31
|
+
outline: "none"
|
|
32
|
+
},
|
|
33
|
+
"&::placeholder": {
|
|
34
|
+
textTransform: "uppercase",
|
|
35
|
+
letterSpacing: "0.05em",
|
|
36
|
+
color: "var(--mdc-theme-text-secondary-on-background)"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var Search = function Search(_ref) {
|
|
42
|
+
var value = _ref.value,
|
|
43
|
+
onChange = _ref.onChange,
|
|
44
|
+
_ref$inputPlaceholder = _ref.inputPlaceholder,
|
|
45
|
+
inputPlaceholder = _ref$inputPlaceholder === void 0 ? "Search..." : _ref$inputPlaceholder;
|
|
46
|
+
return /*#__PURE__*/React.createElement(SearchWrapper, {
|
|
47
|
+
"data-testid": "default-data-list.search"
|
|
48
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: "search__icon"
|
|
50
|
+
}, /*#__PURE__*/React.createElement(SearchIcon, null)), /*#__PURE__*/React.createElement(InputField, {
|
|
51
|
+
className: "search__input",
|
|
52
|
+
placeholder: inputPlaceholder,
|
|
53
|
+
value: value,
|
|
54
|
+
onChange: onChange,
|
|
55
|
+
autoComplete: "off"
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default Search;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const title: string;
|
|
3
|
+
declare const icon: string;
|
|
4
|
+
export declare const SimpleForm: (props: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
"data-testid"?: string;
|
|
7
|
+
noElevation?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) => JSX.Element;
|
|
10
|
+
export declare const SimpleFormHeader: (props: {
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
icon?: React.ReactElement<any>;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}) => JSX.Element;
|
|
15
|
+
export declare const SimpleFormFooter: (props: {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}) => JSX.Element;
|
|
18
|
+
export declare const SimpleFormContent: (props: {
|
|
19
|
+
children: any;
|
|
20
|
+
}) => any;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { css } from "emotion";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { Cell, Grid } from "@webiny/ui/Grid";
|
|
6
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
7
|
+
import { Elevation } from "@webiny/ui/Elevation";
|
|
8
|
+
import { Icon } from "@webiny/ui/Icon";
|
|
9
|
+
var SimpleFormContainer = /*#__PURE__*/styled("div", {
|
|
10
|
+
target: "ep5jo8l0",
|
|
11
|
+
label: "SimpleFormContainer"
|
|
12
|
+
})({
|
|
13
|
+
position: "relative",
|
|
14
|
+
margin: "17px 50px"
|
|
15
|
+
});
|
|
16
|
+
var header = /*#__PURE__*/css({
|
|
17
|
+
borderBottom: "1px solid var(--mdc-theme-on-background)",
|
|
18
|
+
color: "var(--mdc-theme-text-primary-on-background)"
|
|
19
|
+
}, "label:header;");
|
|
20
|
+
var title = /*#__PURE__*/css({
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "center"
|
|
23
|
+
}, "label:title;");
|
|
24
|
+
var actions = /*#__PURE__*/css({
|
|
25
|
+
display: "flex",
|
|
26
|
+
justifyContent: "flex-end",
|
|
27
|
+
alignItems: "center"
|
|
28
|
+
}, "label:actions;");
|
|
29
|
+
var icon = /*#__PURE__*/css({
|
|
30
|
+
marginRight: 15,
|
|
31
|
+
color: "var(--mdc-theme-text-primary-on-background)"
|
|
32
|
+
}, "label:icon;");
|
|
33
|
+
var footer = /*#__PURE__*/css({
|
|
34
|
+
borderTop: "1px solid var(--mdc-theme-on-background)",
|
|
35
|
+
color: "var(--mdc-theme-text-primary-on-background)",
|
|
36
|
+
textAlign: "right",
|
|
37
|
+
"&.mdc-layout-grid": {
|
|
38
|
+
padding: 25 // "25px 50px"
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
}, "label:footer;");
|
|
42
|
+
export var SimpleForm = function SimpleForm(props) {
|
|
43
|
+
return /*#__PURE__*/React.createElement(SimpleFormContainer, {
|
|
44
|
+
className: classNames("webiny-data-list", props.className),
|
|
45
|
+
"data-testid": props["data-testid"]
|
|
46
|
+
}, props.noElevation ? props.children : /*#__PURE__*/React.createElement(Elevation, {
|
|
47
|
+
z: 1
|
|
48
|
+
}, props.children));
|
|
49
|
+
};
|
|
50
|
+
export var SimpleFormHeader = function SimpleFormHeader(props) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
52
|
+
className: header
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Cell, {
|
|
54
|
+
span: props.children ? 6 : 12,
|
|
55
|
+
className: title
|
|
56
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, props.icon && /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
+
className: icon,
|
|
58
|
+
icon: props.icon
|
|
59
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
60
|
+
use: "headline5"
|
|
61
|
+
}, props.title))), props.children && /*#__PURE__*/React.createElement(Cell, {
|
|
62
|
+
span: 6,
|
|
63
|
+
className: actions
|
|
64
|
+
}, props.children));
|
|
65
|
+
};
|
|
66
|
+
export var SimpleFormFooter = function SimpleFormFooter(props) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
68
|
+
className: footer
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Cell, {
|
|
70
|
+
span: 12
|
|
71
|
+
}, props.children));
|
|
72
|
+
};
|
|
73
|
+
export var SimpleFormContent = function SimpleFormContent(props) {
|
|
74
|
+
return props.children;
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SimpleForm, SimpleFormHeader, SimpleFormFooter, SimpleFormContent } from "./SimpleForm";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SimpleForm, SimpleFormHeader, SimpleFormFooter, SimpleFormContent } from "./SimpleForm";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type InputBoxProps = {
|
|
3
|
+
value?: string | number;
|
|
4
|
+
onChange?: (value: any) => void;
|
|
5
|
+
defaultValue?: string | number;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ className, value, onChange, label, description, validation, defaultValue, ...props }: InputBoxProps) => JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["className", "value", "onChange", "label", "description", "validation", "defaultValue"];
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { css } from "emotion";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import omit from "lodash/omit";
|
|
7
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
8
|
+
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
9
|
+
var inputStyle = /*#__PURE__*/css({
|
|
10
|
+
boxSizing: "border-box",
|
|
11
|
+
border: "1px solid var(--mdc-theme-on-background)",
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "100%",
|
|
14
|
+
padding: "4px 8px",
|
|
15
|
+
textAlign: "left",
|
|
16
|
+
minHeight: 32,
|
|
17
|
+
backgroundColor: "var(--mdc-theme-surface)",
|
|
18
|
+
transition: "150ms all ease-in-out",
|
|
19
|
+
"&:focus:not(:disabled)": {
|
|
20
|
+
backgroundColor: "var(--mdc-theme-on-background)"
|
|
21
|
+
},
|
|
22
|
+
"&:hover:not(:disabled)": {
|
|
23
|
+
backgroundColor: "var(--mdc-theme-on-background)"
|
|
24
|
+
},
|
|
25
|
+
"&:disabled": {
|
|
26
|
+
opacity: 0.5,
|
|
27
|
+
cursor: "not-allowed"
|
|
28
|
+
},
|
|
29
|
+
"&.text-center": {
|
|
30
|
+
textAlign: "center",
|
|
31
|
+
padding: 4
|
|
32
|
+
},
|
|
33
|
+
"&::-webkit-inner-spin-button": {
|
|
34
|
+
WebkitAppearance: "none",
|
|
35
|
+
margin: 0
|
|
36
|
+
},
|
|
37
|
+
"&::-webkit-outer-spin-button": {
|
|
38
|
+
WebkitAppearance: "none",
|
|
39
|
+
margin: 0
|
|
40
|
+
}
|
|
41
|
+
}, "label:inputStyle;");
|
|
42
|
+
var labelStyle = /*#__PURE__*/css({
|
|
43
|
+
marginBottom: 8,
|
|
44
|
+
padding: "0px 8px",
|
|
45
|
+
"& span": {
|
|
46
|
+
color: "var(--mdc-theme-text-primary-on-background)"
|
|
47
|
+
}
|
|
48
|
+
}, "label:labelStyle;");
|
|
49
|
+
|
|
50
|
+
var getValue = function getValue(_ref) {
|
|
51
|
+
var value = _ref.value,
|
|
52
|
+
defaultValue = _ref.defaultValue,
|
|
53
|
+
type = _ref.type;
|
|
54
|
+
|
|
55
|
+
if (type === "number") {
|
|
56
|
+
return isNaN(value) ? defaultValue : value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return value || defaultValue;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var InputField = function InputField(_ref2) {
|
|
63
|
+
var className = _ref2.className,
|
|
64
|
+
value = _ref2.value,
|
|
65
|
+
_onChange = _ref2.onChange,
|
|
66
|
+
label = _ref2.label,
|
|
67
|
+
description = _ref2.description,
|
|
68
|
+
_ref2$validation = _ref2.validation,
|
|
69
|
+
validation = _ref2$validation === void 0 ? {
|
|
70
|
+
isValid: true
|
|
71
|
+
} : _ref2$validation,
|
|
72
|
+
_ref2$defaultValue = _ref2.defaultValue,
|
|
73
|
+
defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
|
|
74
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
75
|
+
|
|
76
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: labelStyle
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
79
|
+
use: "subtitle2"
|
|
80
|
+
}, label)), /*#__PURE__*/React.createElement("input", Object.assign({
|
|
81
|
+
className: classNames(inputStyle, className),
|
|
82
|
+
value: getValue({
|
|
83
|
+
value: value,
|
|
84
|
+
type: props.type,
|
|
85
|
+
defaultValue: defaultValue
|
|
86
|
+
}),
|
|
87
|
+
onChange: function onChange(_ref3) {
|
|
88
|
+
var value = _ref3.target.value;
|
|
89
|
+
|
|
90
|
+
_onChange(value.toLowerCase());
|
|
91
|
+
}
|
|
92
|
+
}, omit(props, "validate"))), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
93
|
+
error: true
|
|
94
|
+
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default /*#__PURE__*/React.memo(InputField);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormComponentProps } from "@webiny/ui/types";
|
|
3
|
+
declare type SingleImageUploadProps = FormComponentProps & {
|
|
4
|
+
accept?: string[];
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
maxSize?: number | string;
|
|
10
|
+
multipleMaxCount?: number;
|
|
11
|
+
multipleMaxSize?: number | string;
|
|
12
|
+
onChange?: Function;
|
|
13
|
+
imagePreviewProps?: any;
|
|
14
|
+
round?: boolean;
|
|
15
|
+
onChangePick?: string[];
|
|
16
|
+
};
|
|
17
|
+
export default class SingleImageUpload extends React.Component<SingleImageUploadProps> {
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
validation: {
|
|
20
|
+
isValid: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
render(): JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
export {};
|