@webiny/app-admin 0.0.0-unstable.611c5af35e → 0.0.0-unstable.615a930a68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/Admin.js +15 -1
- package/base/Admin.js.map +1 -1
- package/base/Base.js +23 -4
- package/base/Base.js.map +1 -1
- package/base/plugins/AddGraphQLQuerySelection.js +8 -0
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/ApolloProvider.js +5 -0
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.js +7 -1
- package/base/providers/TelemetryProvider.js.map +1 -1
- package/base/providers/UiStateProvider.js +5 -0
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.js +16 -3
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.js +4 -0
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.js +7 -2
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.js +4 -0
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/Layout.js +6 -1
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.js +4 -0
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.js +6 -0
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.js +6 -0
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Menu.js +31 -2
- package/base/ui/Menu.js.map +1 -1
- package/base/ui/Navigation.js +44 -11
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js +4 -0
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Search.js +23 -5
- package/base/ui/Search.js.map +1 -1
- package/base/ui/Tags.js +8 -1
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/UserMenu.js +29 -5
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +6 -1
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.js +52 -18
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.js +32 -9
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.js +7 -0
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.js +4 -0
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.js +69 -17
- package/components/AppInstaller/useInstaller.js.map +1 -1
- package/components/EmptyView.js +11 -3
- package/components/EmptyView.js.map +1 -1
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +14 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js.map +1 -1
- package/components/FileManager/BottomInfoBar/UploadStatus.js +9 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.js.map +1 -1
- package/components/FileManager/BottomInfoBar.js +12 -0
- package/components/FileManager/BottomInfoBar.js.map +1 -1
- package/components/FileManager/DropFilesHere.js +12 -3
- package/components/FileManager/DropFilesHere.js.map +1 -1
- package/components/FileManager/File.js +18 -5
- package/components/FileManager/File.js.map +1 -1
- package/components/FileManager/FileDetails/Name.js +32 -4
- package/components/FileManager/FileDetails/Name.js.map +1 -1
- package/components/FileManager/FileDetails/Tags.js +77 -26
- package/components/FileManager/FileDetails/Tags.js.map +1 -1
- package/components/FileManager/FileDetails.js +146 -81
- package/components/FileManager/FileDetails.js.map +1 -1
- package/components/FileManager/FileManagerContext.js +45 -12
- package/components/FileManager/FileManagerContext.js.map +1 -1
- package/components/FileManager/FileManagerView.js +152 -45
- package/components/FileManager/FileManagerView.js.map +1 -1
- package/components/FileManager/LeftSidebar.js +29 -10
- package/components/FileManager/LeftSidebar.js.map +1 -1
- package/components/FileManager/NoPermissionView.js +13 -0
- package/components/FileManager/NoPermissionView.js.map +1 -1
- package/components/FileManager/NoResults.js +6 -0
- package/components/FileManager/NoResults.js.map +1 -1
- package/components/FileManager/getFileTypePlugin.js +15 -9
- package/components/FileManager/getFileTypePlugin.js.map +1 -1
- package/components/FileManager/getFileUploader.js +5 -0
- package/components/FileManager/getFileUploader.js.map +1 -1
- package/components/FileManager/graphql.js +14 -3
- package/components/FileManager/graphql.js.map +1 -1
- package/components/FileManager/outputFileSelectionError.js +14 -0
- package/components/FileManager/outputFileSelectionError.js.map +1 -1
- package/components/FileManager.js +43 -17
- package/components/FileManager.js.map +1 -1
- package/components/FloatingActionButton.js +6 -0
- package/components/FloatingActionButton.js.map +1 -1
- package/components/MultiImageUpload.js +10 -1
- package/components/MultiImageUpload.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.js +36 -7
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/index.js +2 -0
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/Permissions.js +27 -16
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/StyledComponents.js +7 -0
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js +3 -0
- package/components/Permissions/index.js.map +1 -1
- package/components/RichTextEditor/RichTextEditor.js +7 -0
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js +2 -0
- package/components/RichTextEditor/index.js.map +1 -1
- package/components/RichTextEditor/tools/header/index.js +102 -62
- package/components/RichTextEditor/tools/header/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/index.js +36 -15
- package/components/RichTextEditor/tools/image/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
- package/components/RichTextEditor/tools/image/tunes.js +22 -5
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
- package/components/RichTextEditor/tools/image/ui.js +39 -16
- package/components/RichTextEditor/tools/image/ui.js.map +1 -1
- package/components/RichTextEditor/tools/paragraph/index.js +81 -55
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
- package/components/RichTextEditor/tools/textColor/index.js +41 -15
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
- package/components/RichTextEditor/tools/utils.js +2 -0
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.js +13 -6
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.js +11 -3
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.js +20 -0
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +1 -0
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.js +29 -13
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.js +28 -12
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.js +20 -0
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +1 -0
- package/components/SplitView/index.js.map +1 -1
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/hooks/useConfirmationDialog.js +14 -2
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +5 -0
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useSnackbar.js +5 -0
- package/hooks/useSnackbar.js.map +1 -1
- package/index.js +48 -0
- package/index.js.map +1 -1
- package/package.json +19 -19
- package/plugins/FileManagerFileTypePlugin.js +15 -0
- package/plugins/FileManagerFileTypePlugin.js.map +1 -1
- package/plugins/MenuPlugin.js +15 -0
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.js +15 -0
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/fileManager/fileDefault.js +6 -0
- package/plugins/fileManager/fileDefault.js.map +1 -1
- package/plugins/fileManager/fileImage/DeleteAction.js +29 -7
- package/plugins/fileManager/fileImage/DeleteAction.js.map +1 -1
- package/plugins/fileManager/fileImage/EditAction.js +43 -9
- package/plugins/fileManager/fileImage/EditAction.js.map +1 -1
- package/plugins/fileManager/fileImage/index.js +8 -0
- package/plugins/fileManager/fileImage/index.js.map +1 -1
- package/plugins/fileManager/index.js +2 -0
- package/plugins/fileManager/index.js.map +1 -1
- package/plugins/globalSearch/SearchBar.js +51 -3
- package/plugins/globalSearch/SearchBar.js.map +1 -1
- package/plugins/globalSearch/SearchBarDropdown.js +31 -13
- package/plugins/globalSearch/SearchBarDropdown.js.map +1 -1
- package/plugins/globalSearch/index.js.map +1 -1
- package/plugins/globalSearch/styled.js +5 -1
- package/plugins/globalSearch/styled.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +16 -2
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/ui/UIElement.js +1 -0
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js +1 -0
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js +1 -0
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js +1 -0
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.js +28 -2
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.js +19 -0
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.js +19 -0
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js +2 -0
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.js +14 -0
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.js +36 -3
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +11 -0
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +11 -0
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.js +19 -0
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.js +19 -0
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js +2 -0
- package/ui/elements/ViewElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +16 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement.js +34 -11
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +15 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +22 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +36 -7
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.js +5 -0
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
- package/ui/elements/form/FileManagerElement.js +20 -0
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.js +21 -0
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.js +33 -0
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.js +17 -0
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.js +18 -0
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.js +15 -0
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.js +19 -1
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.js +17 -0
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +25 -1
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +40 -0
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +20 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +20 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +20 -0
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
- package/ui/views/AdminView/components/Dialog.js +21 -10
- package/ui/views/AdminView/components/Dialog.js.map +1 -1
- package/ui/views/AdminView/components/Hamburger.js +8 -0
- package/ui/views/AdminView/components/Hamburger.js.map +1 -1
- package/ui/views/AdminView/components/Snackbar.js +9 -0
- package/ui/views/AdminView/components/Snackbar.js.map +1 -1
- package/ui/views/FormView/FormContainerElement.js +21 -0
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.js +11 -0
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.js +19 -0
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.js +24 -2
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.js +41 -0
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.js +19 -0
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.js +25 -3
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +22 -0
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +13 -3
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.js +37 -3
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +22 -2
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.js +40 -0
- package/ui/views/SplitView.js.map +1 -1
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.FormFieldElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
9
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
10
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
11
16
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
12
18
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
13
20
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
|
+
|
|
14
22
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
15
24
|
var _UIElement2 = require("../../UIElement");
|
|
25
|
+
|
|
16
26
|
var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
17
27
|
(0, _inherits2.default)(FormFieldElement, _UIElement);
|
|
28
|
+
|
|
18
29
|
var _super = (0, _createSuper2.default)(FormFieldElement);
|
|
30
|
+
|
|
19
31
|
function FormFieldElement(id, config) {
|
|
20
32
|
var _this;
|
|
33
|
+
|
|
21
34
|
(0, _classCallCheck2.default)(this, FormFieldElement);
|
|
22
35
|
_this = _super.call(this, id, config);
|
|
23
36
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_beforeChange", []);
|
|
24
37
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_afterChange", []);
|
|
38
|
+
|
|
25
39
|
if (config.beforeChange) {
|
|
26
40
|
_this._beforeChange.push(config.beforeChange);
|
|
27
41
|
}
|
|
42
|
+
|
|
28
43
|
if (config.afterChange) {
|
|
29
44
|
_this._afterChange.push(config.afterChange);
|
|
30
45
|
}
|
|
46
|
+
|
|
31
47
|
_this.applyPlugins(FormFieldElement);
|
|
48
|
+
|
|
32
49
|
return _this;
|
|
33
50
|
}
|
|
51
|
+
|
|
34
52
|
(0, _createClass2.default)(FormFieldElement, [{
|
|
35
53
|
key: "getName",
|
|
36
54
|
value: function getName() {
|
|
@@ -44,6 +62,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
44
62
|
return true;
|
|
45
63
|
};
|
|
46
64
|
}
|
|
65
|
+
|
|
47
66
|
return this.config.validators(props);
|
|
48
67
|
}
|
|
49
68
|
}, {
|
|
@@ -52,6 +71,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
52
71
|
if (typeof this.config.defaultValue === "function") {
|
|
53
72
|
return this.config.defaultValue(props);
|
|
54
73
|
}
|
|
74
|
+
|
|
55
75
|
return this.config.defaultValue;
|
|
56
76
|
}
|
|
57
77
|
}, {
|
|
@@ -60,6 +80,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
60
80
|
if (typeof this.config.label === "function") {
|
|
61
81
|
return this.config.label(props);
|
|
62
82
|
}
|
|
83
|
+
|
|
63
84
|
return this.config.label;
|
|
64
85
|
}
|
|
65
86
|
}, {
|
|
@@ -68,6 +89,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
68
89
|
if (typeof this.config.description === "function") {
|
|
69
90
|
return this.config.description(props);
|
|
70
91
|
}
|
|
92
|
+
|
|
71
93
|
return this.config.description;
|
|
72
94
|
}
|
|
73
95
|
}, {
|
|
@@ -76,6 +98,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
76
98
|
if (typeof this.config.placeholder === "function") {
|
|
77
99
|
return this.config.placeholder(props);
|
|
78
100
|
}
|
|
101
|
+
|
|
79
102
|
return this.config.placeholder;
|
|
80
103
|
}
|
|
81
104
|
}, {
|
|
@@ -104,6 +127,7 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
104
127
|
if (typeof this.config.isDisabled === "function") {
|
|
105
128
|
return this.config.isDisabled(props);
|
|
106
129
|
}
|
|
130
|
+
|
|
107
131
|
return this.config.isDisabled;
|
|
108
132
|
}
|
|
109
133
|
}, {
|
|
@@ -120,27 +144,35 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
120
144
|
key: "onBeforeChange",
|
|
121
145
|
value: function onBeforeChange(value, cb) {
|
|
122
146
|
var callbacks = (0, _toConsumableArray2.default)(this._beforeChange);
|
|
147
|
+
|
|
123
148
|
var next = function next(val) {
|
|
124
149
|
var callbackCallable = callbacks.pop();
|
|
150
|
+
|
|
125
151
|
if (!callbackCallable) {
|
|
126
152
|
cb(val);
|
|
127
153
|
return;
|
|
128
154
|
}
|
|
155
|
+
|
|
129
156
|
callbackCallable(val, next);
|
|
130
157
|
};
|
|
158
|
+
|
|
131
159
|
next(value);
|
|
132
160
|
}
|
|
133
161
|
}, {
|
|
134
162
|
key: "onAfterChange",
|
|
135
163
|
value: function onAfterChange(value, form) {
|
|
136
164
|
var callbacks = (0, _toConsumableArray2.default)(this._afterChange);
|
|
165
|
+
|
|
137
166
|
var next = function next(val) {
|
|
138
167
|
var callbackCallable = callbacks.pop();
|
|
168
|
+
|
|
139
169
|
if (!callbackCallable) {
|
|
140
170
|
return;
|
|
141
171
|
}
|
|
172
|
+
|
|
142
173
|
callbackCallable(val, form);
|
|
143
174
|
};
|
|
175
|
+
|
|
144
176
|
next(value);
|
|
145
177
|
}
|
|
146
178
|
}, {
|
|
@@ -170,4 +202,5 @@ var FormFieldElement = /*#__PURE__*/function (_UIElement) {
|
|
|
170
202
|
}]);
|
|
171
203
|
return FormFieldElement;
|
|
172
204
|
}(_UIElement2.UIElement);
|
|
205
|
+
|
|
173
206
|
exports.FormFieldElement = FormFieldElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormFieldElement","id","config","beforeChange","_beforeChange","push","afterChange","_afterChange","applyPlugins","name","props","validators","defaultValue","label","description","placeholder","value","isDisabled","cb","callbacks","next","val","callbackCallable","pop","form","UIElement"],"sources":["FormFieldElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { FormRenderPropParams, FormAPI } from \"@webiny/form\";\nimport { UIElement, UIElementConfig } from \"~/ui/UIElement\";\nimport { FormElementRenderProps } from \"~/ui/elements/form/FormElement\";\nimport { Validator } from \"@webiny/validation/types\";\n\nexport interface FormFieldElementConfig<TRenderProps = FormRenderPropParams>\n extends UIElementConfig<TRenderProps> {\n name: string;\n validators?: GetterWithProps<Validator | Validator[]>;\n beforeChange?: BeforeChange;\n afterChange?: AfterChange;\n defaultValue?: any | GetterWithProps<any>;\n isDisabled?: boolean | GetterWithProps<boolean>;\n label?: string | GetterWithProps<string>;\n description?: string | React.ReactElement | GetterWithProps<string | React.ReactElement>;\n placeholder?: string | GetterWithProps<string>;\n}\n\nexport interface FormFieldElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\ninterface BeforeChange {\n (value: any, callback: BeforeChangeCallback): void;\n}\n\ninterface BeforeChangeCallback {\n (value: any): void;\n}\n\ninterface AfterChange<T = any, D extends Record<string, any> = Record<string, any>> {\n (value: T, form: FormAPI<D>): void;\n}\n\ninterface GetterWithProps<T> {\n (props: FormElementRenderProps): T;\n}\n\nexport class FormFieldElement<\n TConfig extends FormFieldElementConfig = FormFieldElementConfig\n> extends UIElement<TConfig> {\n private _beforeChange: BeforeChange[] = [];\n private _afterChange: AfterChange[] = [];\n\n public constructor(id: string, config: TConfig) {\n super(id, config);\n\n if (config.beforeChange) {\n this._beforeChange.push(config.beforeChange);\n }\n\n if (config.afterChange) {\n this._afterChange.push(config.afterChange);\n }\n\n this.applyPlugins(FormFieldElement);\n }\n\n public getName(): string {\n return this.config.name;\n }\n\n public getValidators(props?: FormFieldElementRenderProps): Validator | Validator[] {\n if (!this.config.validators || typeof this.config.validators !== \"function\") {\n return () => true;\n }\n\n return this.config.validators(props as FormFieldElementRenderProps);\n }\n\n public getDefaultValue(props?: FormFieldElementRenderProps): any {\n if (typeof this.config.defaultValue === \"function\") {\n return this.config.defaultValue(props);\n }\n\n return this.config.defaultValue;\n }\n\n public getLabel(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.label === \"function\") {\n return this.config.label(props as FormFieldElementRenderProps);\n }\n\n return this.config.label as string;\n }\n\n public getDescription(props?: FormFieldElementRenderProps): string | React.ReactElement {\n if (typeof this.config.description === \"function\") {\n return this.config.description(props as FormFieldElementRenderProps);\n }\n\n return this.config.description as string;\n }\n\n public getPlaceholder(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.placeholder === \"function\") {\n return this.config.placeholder(props as FormFieldElementRenderProps);\n }\n\n return this.config.placeholder as string;\n }\n\n public setLabel(label: string | GetterWithProps<string>): void {\n this.config.label = label;\n }\n\n public setDescription(\n description: string | React.ReactElement | GetterWithProps<string | React.ReactElement>\n ): void {\n this.config.description = description;\n }\n\n public setPlaceholder(placeholder: string | GetterWithProps<string>): void {\n this.config.placeholder = placeholder;\n }\n\n public setDefaultValue(value: any | GetterWithProps<any>): void {\n this.config.defaultValue = value;\n }\n\n public getIsDisabled(props?: FormFieldElementRenderProps): boolean {\n if (typeof this.config.isDisabled === \"function\") {\n return this.config.isDisabled(props as FormFieldElementRenderProps);\n }\n return this.config.isDisabled as boolean;\n }\n\n public setIsDisabled(isDisabled: boolean | GetterWithProps<boolean>): void {\n this.config.isDisabled = isDisabled;\n }\n\n public setValidators(validators: GetterWithProps<Validator>): void {\n this.config.validators = validators;\n }\n\n public onBeforeChange(value: string, cb: (value: string) => void): void {\n const callbacks = [...this._beforeChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n cb(val);\n return;\n }\n callbackCallable(val, next);\n };\n\n next(value);\n }\n\n public onAfterChange(value: string, form: FormAPI): void {\n const callbacks = [...this._afterChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n return;\n }\n callbackCallable(val, form);\n };\n\n next(value);\n }\n\n public addBeforeChange(cb: BeforeChange): void {\n this._beforeChange.push(cb);\n }\n\n public addAfterChange<T = any, D extends Record<string, any> = Record<string, any>>(\n cb: AfterChange<T, D>\n ): void {\n /**\n * TODO @ts-refactor possibly different subtype. Or so TS complains.\n */\n // @ts-ignore\n this._afterChange.push(cb);\n }\n\n public setBeforeChange(cb: BeforeChange): void {\n this._beforeChange = [cb];\n }\n\n public setAfterChange(cb: AfterChange): void {\n this._afterChange = [cb];\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["FormFieldElement","id","config","beforeChange","_beforeChange","push","afterChange","_afterChange","applyPlugins","name","props","validators","defaultValue","label","description","placeholder","value","isDisabled","cb","callbacks","next","val","callbackCallable","pop","form","UIElement"],"sources":["FormFieldElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { FormRenderPropParams, FormAPI } from \"@webiny/form\";\nimport { UIElement, UIElementConfig } from \"~/ui/UIElement\";\nimport { FormElementRenderProps } from \"~/ui/elements/form/FormElement\";\nimport { Validator } from \"@webiny/validation/types\";\n\nexport interface FormFieldElementConfig<TRenderProps = FormRenderPropParams>\n extends UIElementConfig<TRenderProps> {\n name: string;\n validators?: GetterWithProps<Validator | Validator[]>;\n beforeChange?: BeforeChange;\n afterChange?: AfterChange;\n defaultValue?: any | GetterWithProps<any>;\n isDisabled?: boolean | GetterWithProps<boolean>;\n label?: string | GetterWithProps<string>;\n description?: string | React.ReactElement | GetterWithProps<string | React.ReactElement>;\n placeholder?: string | GetterWithProps<string>;\n}\n\nexport interface FormFieldElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\ninterface BeforeChange {\n (value: any, callback: BeforeChangeCallback): void;\n}\n\ninterface BeforeChangeCallback {\n (value: any): void;\n}\n\ninterface AfterChange<T = any, D extends Record<string, any> = Record<string, any>> {\n (value: T, form: FormAPI<D>): void;\n}\n\ninterface GetterWithProps<T> {\n (props: FormElementRenderProps): T;\n}\n\nexport class FormFieldElement<\n TConfig extends FormFieldElementConfig = FormFieldElementConfig\n> extends UIElement<TConfig> {\n private _beforeChange: BeforeChange[] = [];\n private _afterChange: AfterChange[] = [];\n\n public constructor(id: string, config: TConfig) {\n super(id, config);\n\n if (config.beforeChange) {\n this._beforeChange.push(config.beforeChange);\n }\n\n if (config.afterChange) {\n this._afterChange.push(config.afterChange);\n }\n\n this.applyPlugins(FormFieldElement);\n }\n\n public getName(): string {\n return this.config.name;\n }\n\n public getValidators(props?: FormFieldElementRenderProps): Validator | Validator[] {\n if (!this.config.validators || typeof this.config.validators !== \"function\") {\n return () => true;\n }\n\n return this.config.validators(props as FormFieldElementRenderProps);\n }\n\n public getDefaultValue(props?: FormFieldElementRenderProps): any {\n if (typeof this.config.defaultValue === \"function\") {\n return this.config.defaultValue(props);\n }\n\n return this.config.defaultValue;\n }\n\n public getLabel(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.label === \"function\") {\n return this.config.label(props as FormFieldElementRenderProps);\n }\n\n return this.config.label as string;\n }\n\n public getDescription(props?: FormFieldElementRenderProps): string | React.ReactElement {\n if (typeof this.config.description === \"function\") {\n return this.config.description(props as FormFieldElementRenderProps);\n }\n\n return this.config.description as string;\n }\n\n public getPlaceholder(props?: FormFieldElementRenderProps): string {\n if (typeof this.config.placeholder === \"function\") {\n return this.config.placeholder(props as FormFieldElementRenderProps);\n }\n\n return this.config.placeholder as string;\n }\n\n public setLabel(label: string | GetterWithProps<string>): void {\n this.config.label = label;\n }\n\n public setDescription(\n description: string | React.ReactElement | GetterWithProps<string | React.ReactElement>\n ): void {\n this.config.description = description;\n }\n\n public setPlaceholder(placeholder: string | GetterWithProps<string>): void {\n this.config.placeholder = placeholder;\n }\n\n public setDefaultValue(value: any | GetterWithProps<any>): void {\n this.config.defaultValue = value;\n }\n\n public getIsDisabled(props?: FormFieldElementRenderProps): boolean {\n if (typeof this.config.isDisabled === \"function\") {\n return this.config.isDisabled(props as FormFieldElementRenderProps);\n }\n return this.config.isDisabled as boolean;\n }\n\n public setIsDisabled(isDisabled: boolean | GetterWithProps<boolean>): void {\n this.config.isDisabled = isDisabled;\n }\n\n public setValidators(validators: GetterWithProps<Validator>): void {\n this.config.validators = validators;\n }\n\n public onBeforeChange(value: string, cb: (value: string) => void): void {\n const callbacks = [...this._beforeChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n cb(val);\n return;\n }\n callbackCallable(val, next);\n };\n\n next(value);\n }\n\n public onAfterChange(value: string, form: FormAPI): void {\n const callbacks = [...this._afterChange];\n const next = (val: string) => {\n const callbackCallable = callbacks.pop();\n if (!callbackCallable) {\n return;\n }\n callbackCallable(val, form);\n };\n\n next(value);\n }\n\n public addBeforeChange(cb: BeforeChange): void {\n this._beforeChange.push(cb);\n }\n\n public addAfterChange<T = any, D extends Record<string, any> = Record<string, any>>(\n cb: AfterChange<T, D>\n ): void {\n /**\n * TODO @ts-refactor possibly different subtype. Or so TS complains.\n */\n // @ts-ignore\n this._afterChange.push(cb);\n }\n\n public setBeforeChange(cb: BeforeChange): void {\n this._beforeChange = [cb];\n }\n\n public setAfterChange(cb: AfterChange): void {\n this._afterChange = [cb];\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.HiddenElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
11
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
13
20
|
var _FormFieldElement2 = require("./FormFieldElement");
|
|
21
|
+
|
|
14
22
|
var HiddenElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
15
23
|
(0, _inherits2.default)(HiddenElement, _FormFieldElement);
|
|
24
|
+
|
|
16
25
|
var _super = (0, _createSuper2.default)(HiddenElement);
|
|
26
|
+
|
|
17
27
|
function HiddenElement(id, config) {
|
|
18
28
|
var _this;
|
|
29
|
+
|
|
19
30
|
(0, _classCallCheck2.default)(this, HiddenElement);
|
|
20
31
|
_this = _super.call(this, id, config);
|
|
32
|
+
|
|
21
33
|
_this.applyPlugins(HiddenElement);
|
|
34
|
+
|
|
22
35
|
return _this;
|
|
23
36
|
}
|
|
37
|
+
|
|
24
38
|
(0, _createClass2.default)(HiddenElement, [{
|
|
25
39
|
key: "render",
|
|
26
40
|
value: function render(props) {
|
|
27
41
|
var _this2 = this;
|
|
42
|
+
|
|
28
43
|
if (!props.formProps) {
|
|
29
44
|
throw Error("HiddenElement must be placed inside of a FormElement.");
|
|
30
45
|
}
|
|
46
|
+
|
|
31
47
|
var Bind = props.formProps.Bind;
|
|
32
48
|
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
33
49
|
name: this.getName(),
|
|
@@ -44,4 +60,5 @@ var HiddenElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
44
60
|
}]);
|
|
45
61
|
return HiddenElement;
|
|
46
62
|
}(_FormFieldElement2.FormFieldElement);
|
|
63
|
+
|
|
47
64
|
exports.HiddenElement = HiddenElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HiddenElement","id","config","applyPlugins","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","FormFieldElement"],"sources":["HiddenElement.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport class HiddenElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(HiddenElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`HiddenElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n />\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["HiddenElement","id","config","applyPlugins","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","FormFieldElement"],"sources":["HiddenElement.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport class HiddenElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(HiddenElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`HiddenElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;IAMaA,a;;;;;EACT,uBAAmBC,EAAnB,EAA+BC,MAA/B,EAA+D;IAAA;;IAAA;IAC3D,0BAAMD,EAAN,EAAUC,MAAV;;IAEA,MAAKC,YAAL,CAAkBH,aAAlB;;IAH2D;EAI9D;;;;WAED,gBAAuBI,KAAvB,EAA4E;MAAA;;MACxE,IAAI,CAACA,KAAK,CAACC,SAAX,EAAsB;QAClB,MAAMC,KAAK,yDAAX;MACH;;MAED,IAAQC,IAAR,GAAiBH,KAAK,CAACC,SAAvB,CAAQE,IAAR;MAEA,oBACI,6BAAC,IAAD;QACI,IAAI,EAAE,KAAKC,OAAL,EADV;QAEI,UAAU,EAAE,KAAKC,aAAL,CAAmBL,KAAnB,CAFhB;QAGI,YAAY,EAAE,KAAKM,eAAL,CAAqBN,KAArB,CAHlB;QAII,YAAY,EAAE,sBAACO,KAAD,EAAgBC,EAAhB;UAAA,OAAuB,MAAI,CAACC,cAAL,CAAoBF,KAApB,EAA2BC,EAA3B,CAAvB;QAAA,CAJlB;QAKI,WAAW,EAAE,qBAACD,KAAD,EAAgBG,IAAhB;UAAA,OAAyB,MAAI,CAACC,aAAL,CAAmBJ,KAAnB,EAA0BG,IAA1B,CAAzB;QAAA;MALjB,EADJ;IASH;;;EAvB8BE,mC"}
|
|
@@ -1,34 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.InputElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
11
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
13
20
|
var _Input = require("@webiny/ui/Input");
|
|
21
|
+
|
|
14
22
|
var _FormFieldElement2 = require("./FormFieldElement");
|
|
23
|
+
|
|
15
24
|
var InputElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
16
25
|
(0, _inherits2.default)(InputElement, _FormFieldElement);
|
|
26
|
+
|
|
17
27
|
var _super = (0, _createSuper2.default)(InputElement);
|
|
28
|
+
|
|
18
29
|
function InputElement(id, config) {
|
|
19
30
|
var _this;
|
|
31
|
+
|
|
20
32
|
(0, _classCallCheck2.default)(this, InputElement);
|
|
21
33
|
_this = _super.call(this, id, config);
|
|
34
|
+
|
|
22
35
|
_this.applyPlugins(InputElement);
|
|
36
|
+
|
|
23
37
|
return _this;
|
|
24
38
|
}
|
|
39
|
+
|
|
25
40
|
(0, _createClass2.default)(InputElement, [{
|
|
26
41
|
key: "render",
|
|
27
42
|
value: function render(props) {
|
|
28
43
|
var _this2 = this;
|
|
44
|
+
|
|
29
45
|
if (!props.formProps) {
|
|
30
46
|
throw Error("InputElement must be placed inside of a FormElement.");
|
|
31
47
|
}
|
|
48
|
+
|
|
32
49
|
var Bind = props.formProps.Bind;
|
|
33
50
|
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
34
51
|
name: this.getName(),
|
|
@@ -51,4 +68,5 @@ var InputElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
51
68
|
}]);
|
|
52
69
|
return InputElement;
|
|
53
70
|
}(_FormFieldElement2.FormFieldElement);
|
|
71
|
+
|
|
54
72
|
exports.InputElement = InputElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InputElement","id","config","applyPlugins","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getPlaceholder","getIsDisabled","getDescription","FormFieldElement"],"sources":["InputElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/ui/Input\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport type InputElementRenderProps = FormFieldElementRenderProps;\nexport class InputElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(InputElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`InputElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Input\n data-testid={`input-element-${this.getLabel(props)}`}\n label={this.getLabel(props)}\n placeholder={this.getPlaceholder(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["InputElement","id","config","applyPlugins","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getPlaceholder","getIsDisabled","getDescription","FormFieldElement"],"sources":["InputElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/ui/Input\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport type InputElementRenderProps = FormFieldElementRenderProps;\nexport class InputElement extends FormFieldElement {\n public constructor(id: string, config: FormFieldElementConfig) {\n super(id, config);\n\n this.applyPlugins(InputElement);\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`InputElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Input\n data-testid={`input-element-${this.getLabel(props)}`}\n label={this.getLabel(props)}\n placeholder={this.getPlaceholder(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;IAOaA,Y;;;;;EACT,sBAAmBC,EAAnB,EAA+BC,MAA/B,EAA+D;IAAA;;IAAA;IAC3D,0BAAMD,EAAN,EAAUC,MAAV;;IAEA,MAAKC,YAAL,CAAkBH,YAAlB;;IAH2D;EAI9D;;;;WAED,gBAAuBI,KAAvB,EAA4E;MAAA;;MACxE,IAAI,CAACA,KAAK,CAACC,SAAX,EAAsB;QAClB,MAAMC,KAAK,wDAAX;MACH;;MAED,IAAQC,IAAR,GAAiBH,KAAK,CAACC,SAAvB,CAAQE,IAAR;MAEA,oBACI,6BAAC,IAAD;QACI,IAAI,EAAE,KAAKC,OAAL,EADV;QAEI,UAAU,EAAE,KAAKC,aAAL,CAAmBL,KAAnB,CAFhB;QAGI,YAAY,EAAE,KAAKM,eAAL,CAAqBN,KAArB,CAHlB;QAII,YAAY,EAAE,sBAACO,KAAD,EAAgBC,EAAhB;UAAA,OAAuB,MAAI,CAACC,cAAL,CAAoBF,KAApB,EAA2BC,EAA3B,CAAvB;QAAA,CAJlB;QAKI,WAAW,EAAE,qBAACD,KAAD,EAAgBG,IAAhB;UAAA,OAAyB,MAAI,CAACC,aAAL,CAAmBJ,KAAnB,EAA0BG,IAA1B,CAAzB;QAAA;MALjB,gBAOI,6BAAC,YAAD;QACI,uCAA8B,KAAKE,QAAL,CAAcZ,KAAd,CAA9B,CADJ;QAEI,KAAK,EAAE,KAAKY,QAAL,CAAcZ,KAAd,CAFX;QAGI,WAAW,EAAE,KAAKa,cAAL,CAAoBb,KAApB,CAHjB;QAII,QAAQ,EAAE,KAAKc,aAAL,CAAmBd,KAAnB,CAJd;QAKI,WAAW,EAAE,KAAKe,cAAL,CAAoBf,KAApB;MALjB,EAPJ,CADJ;IAiBH;;;EA/B6BgB,mC"}
|
|
@@ -1,31 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.PasswordElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
11
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
13
20
|
var _InputElement2 = require("./InputElement");
|
|
21
|
+
|
|
14
22
|
var _Input = require("@webiny/ui/Input");
|
|
23
|
+
|
|
15
24
|
var PasswordElement = /*#__PURE__*/function (_InputElement) {
|
|
16
25
|
(0, _inherits2.default)(PasswordElement, _InputElement);
|
|
26
|
+
|
|
17
27
|
var _super = (0, _createSuper2.default)(PasswordElement);
|
|
28
|
+
|
|
18
29
|
function PasswordElement() {
|
|
19
30
|
(0, _classCallCheck2.default)(this, PasswordElement);
|
|
20
31
|
return _super.apply(this, arguments);
|
|
21
32
|
}
|
|
33
|
+
|
|
22
34
|
(0, _createClass2.default)(PasswordElement, [{
|
|
23
35
|
key: "render",
|
|
24
36
|
value: function render(props) {
|
|
25
37
|
var _this = this;
|
|
38
|
+
|
|
26
39
|
if (!props.formProps) {
|
|
27
40
|
throw Error("PasswordElement must be placed inside of a FormElement.");
|
|
28
41
|
}
|
|
42
|
+
|
|
29
43
|
var Bind = props.formProps.Bind;
|
|
30
44
|
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
31
45
|
name: this.getName(),
|
|
@@ -48,4 +62,5 @@ var PasswordElement = /*#__PURE__*/function (_InputElement) {
|
|
|
48
62
|
}]);
|
|
49
63
|
return PasswordElement;
|
|
50
64
|
}(_InputElement2.InputElement);
|
|
65
|
+
|
|
51
66
|
exports.PasswordElement = PasswordElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PasswordElement","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getPlaceholder","getIsDisabled","getDescription","InputElement"],"sources":["PasswordElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { InputElement } from \"./InputElement\";\nimport { FormFieldElementRenderProps } from \"~/ui/elements/form/FormFieldElement\";\nimport { Input } from \"@webiny/ui/Input\";\n\nexport class PasswordElement extends InputElement {\n public override render(props: FormFieldElementRenderProps): React.ReactElement {\n if (!props.formProps) {\n throw Error(`PasswordElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Input\n type={\"password\"}\n label={this.getLabel(props)}\n placeholder={this.getPlaceholder(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["PasswordElement","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getPlaceholder","getIsDisabled","getDescription","InputElement"],"sources":["PasswordElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { InputElement } from \"./InputElement\";\nimport { FormFieldElementRenderProps } from \"~/ui/elements/form/FormFieldElement\";\nimport { Input } from \"@webiny/ui/Input\";\n\nexport class PasswordElement extends InputElement {\n public override render(props: FormFieldElementRenderProps): React.ReactElement {\n if (!props.formProps) {\n throw Error(`PasswordElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Input\n type={\"password\"}\n label={this.getLabel(props)}\n placeholder={this.getPlaceholder(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;IAEaA,e;;;;;;;;;;;;WACT,gBAAuBC,KAAvB,EAA+E;MAAA;;MAC3E,IAAI,CAACA,KAAK,CAACC,SAAX,EAAsB;QAClB,MAAMC,KAAK,2DAAX;MACH;;MAED,IAAQC,IAAR,GAAiBH,KAAK,CAACC,SAAvB,CAAQE,IAAR;MAEA,oBACI,6BAAC,IAAD;QACI,IAAI,EAAE,KAAKC,OAAL,EADV;QAEI,UAAU,EAAE,KAAKC,aAAL,CAAmBL,KAAnB,CAFhB;QAGI,YAAY,EAAE,KAAKM,eAAL,CAAqBN,KAArB,CAHlB;QAII,YAAY,EAAE,sBAACO,KAAD,EAAgBC,EAAhB;UAAA,OAAuB,KAAI,CAACC,cAAL,CAAoBF,KAApB,EAA2BC,EAA3B,CAAvB;QAAA,CAJlB;QAKI,WAAW,EAAE,qBAACD,KAAD,EAAgBG,IAAhB;UAAA,OAAyB,KAAI,CAACC,aAAL,CAAmBJ,KAAnB,EAA0BG,IAA1B,CAAzB;QAAA;MALjB,gBAOI,6BAAC,YAAD;QACI,IAAI,EAAE,UADV;QAEI,KAAK,EAAE,KAAKE,QAAL,CAAcZ,KAAd,CAFX;QAGI,WAAW,EAAE,KAAKa,cAAL,CAAoBb,KAApB,CAHjB;QAII,QAAQ,EAAE,KAAKc,aAAL,CAAmBd,KAAnB,CAJd;QAKI,WAAW,EAAE,KAAKe,cAAL,CAAoBf,KAApB;MALjB,EAPJ,CADJ;IAiBH;;;EAzBgCgB,2B"}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.SelectElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
11
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
13
20
|
var _Select = require("@webiny/ui/Select");
|
|
21
|
+
|
|
14
22
|
var _FormFieldElement2 = require("./FormFieldElement");
|
|
23
|
+
|
|
15
24
|
var SelectElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
16
25
|
(0, _inherits2.default)(SelectElement, _FormFieldElement);
|
|
26
|
+
|
|
17
27
|
var _super = (0, _createSuper2.default)(SelectElement);
|
|
28
|
+
|
|
18
29
|
function SelectElement(id, config) {
|
|
19
30
|
var _this;
|
|
31
|
+
|
|
20
32
|
(0, _classCallCheck2.default)(this, SelectElement);
|
|
21
33
|
_this = _super.call(this, id, config);
|
|
34
|
+
|
|
22
35
|
_this.applyPlugins(SelectElement);
|
|
36
|
+
|
|
23
37
|
return _this;
|
|
24
38
|
}
|
|
39
|
+
|
|
25
40
|
(0, _createClass2.default)(SelectElement, [{
|
|
26
41
|
key: "setOptions",
|
|
27
42
|
value: function setOptions(options) {
|
|
@@ -36,9 +51,11 @@ var SelectElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
36
51
|
key: "render",
|
|
37
52
|
value: function render(props) {
|
|
38
53
|
var _this2 = this;
|
|
54
|
+
|
|
39
55
|
if (!props.formProps) {
|
|
40
56
|
throw Error("SelectElement must be placed inside of a FormElement.");
|
|
41
57
|
}
|
|
58
|
+
|
|
42
59
|
var Bind = props.formProps.Bind;
|
|
43
60
|
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
44
61
|
name: this.getName(),
|
|
@@ -56,7 +73,7 @@ var SelectElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
56
73
|
description: this.getDefaultValue(props)
|
|
57
74
|
}, (this.getOptions() || []).map(function (_ref) {
|
|
58
75
|
var value = _ref.value,
|
|
59
|
-
|
|
76
|
+
label = _ref.label;
|
|
60
77
|
return /*#__PURE__*/_react.default.createElement("option", {
|
|
61
78
|
key: value,
|
|
62
79
|
value: value
|
|
@@ -66,4 +83,5 @@ var SelectElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
66
83
|
}]);
|
|
67
84
|
return SelectElement;
|
|
68
85
|
}(_FormFieldElement2.FormFieldElement);
|
|
86
|
+
|
|
69
87
|
exports.SelectElement = SelectElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SelectElement","id","config","applyPlugins","options","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getIsDisabled","getOptions","map","label","FormFieldElement"],"sources":["SelectElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Select } from \"@webiny/ui/Select\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport interface SelectElementOption {\n value: string;\n label: string;\n}\n\nexport interface SelectElementConfig extends FormFieldElementConfig {\n options?: SelectElementOption[];\n}\n\nexport class SelectElement extends FormFieldElement<SelectElementConfig> {\n public constructor(id: string, config: SelectElementConfig) {\n super(id, config);\n\n this.applyPlugins(SelectElement);\n }\n\n public setOptions(options: SelectElementOption[]): void {\n this.config.options = options;\n }\n\n public getOptions(): SelectElementOption[] | undefined {\n return this.config.options;\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`SelectElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Select\n label={this.getLabel(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDefaultValue(props)}\n >\n {(this.getOptions() || []).map(({ value, label }) => (\n <option key={value} value={value}>\n {label}\n </option>\n ))}\n </Select>\n </Bind>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SelectElement","id","config","applyPlugins","options","props","formProps","Error","Bind","getName","getValidators","getDefaultValue","value","cb","onBeforeChange","form","onAfterChange","getLabel","getIsDisabled","getOptions","map","label","FormFieldElement"],"sources":["SelectElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Select } from \"@webiny/ui/Select\";\nimport {\n FormFieldElement,\n FormFieldElementConfig,\n FormFieldElementRenderProps\n} from \"~/ui/elements/form/FormFieldElement\";\n\nexport interface SelectElementOption {\n value: string;\n label: string;\n}\n\nexport interface SelectElementConfig extends FormFieldElementConfig {\n options?: SelectElementOption[];\n}\n\nexport class SelectElement extends FormFieldElement<SelectElementConfig> {\n public constructor(id: string, config: SelectElementConfig) {\n super(id, config);\n\n this.applyPlugins(SelectElement);\n }\n\n public setOptions(options: SelectElementOption[]): void {\n this.config.options = options;\n }\n\n public getOptions(): SelectElementOption[] | undefined {\n return this.config.options;\n }\n\n public override render(props: FormFieldElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`SelectElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind\n name={this.getName()}\n validators={this.getValidators(props)}\n defaultValue={this.getDefaultValue(props)}\n beforeChange={(value: string, cb) => this.onBeforeChange(value, cb)}\n afterChange={(value: string, form) => this.onAfterChange(value, form)}\n >\n <Select\n label={this.getLabel(props)}\n disabled={this.getIsDisabled(props)}\n description={this.getDefaultValue(props)}\n >\n {(this.getOptions() || []).map(({ value, label }) => (\n <option key={value} value={value}>\n {label}\n </option>\n ))}\n </Select>\n </Bind>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;IAeaA,a;;;;;EACT,uBAAmBC,EAAnB,EAA+BC,MAA/B,EAA4D;IAAA;;IAAA;IACxD,0BAAMD,EAAN,EAAUC,MAAV;;IAEA,MAAKC,YAAL,CAAkBH,aAAlB;;IAHwD;EAI3D;;;;WAED,oBAAkBI,OAAlB,EAAwD;MACpD,KAAKF,MAAL,CAAYE,OAAZ,GAAsBA,OAAtB;IACH;;;WAED,sBAAuD;MACnD,OAAO,KAAKF,MAAL,CAAYE,OAAnB;IACH;;;WAED,gBAAuBC,KAAvB,EAA4E;MAAA;;MACxE,IAAI,CAACA,KAAK,CAACC,SAAX,EAAsB;QAClB,MAAMC,KAAK,yDAAX;MACH;;MAED,IAAQC,IAAR,GAAiBH,KAAK,CAACC,SAAvB,CAAQE,IAAR;MAEA,oBACI,6BAAC,IAAD;QACI,IAAI,EAAE,KAAKC,OAAL,EADV;QAEI,UAAU,EAAE,KAAKC,aAAL,CAAmBL,KAAnB,CAFhB;QAGI,YAAY,EAAE,KAAKM,eAAL,CAAqBN,KAArB,CAHlB;QAII,YAAY,EAAE,sBAACO,KAAD,EAAgBC,EAAhB;UAAA,OAAuB,MAAI,CAACC,cAAL,CAAoBF,KAApB,EAA2BC,EAA3B,CAAvB;QAAA,CAJlB;QAKI,WAAW,EAAE,qBAACD,KAAD,EAAgBG,IAAhB;UAAA,OAAyB,MAAI,CAACC,aAAL,CAAmBJ,KAAnB,EAA0BG,IAA1B,CAAzB;QAAA;MALjB,gBAOI,6BAAC,cAAD;QACI,KAAK,EAAE,KAAKE,QAAL,CAAcZ,KAAd,CADX;QAEI,QAAQ,EAAE,KAAKa,aAAL,CAAmBb,KAAnB,CAFd;QAGI,WAAW,EAAE,KAAKM,eAAL,CAAqBN,KAArB;MAHjB,GAKK,CAAC,KAAKc,UAAL,MAAqB,EAAtB,EAA0BC,GAA1B,CAA8B;QAAA,IAAGR,KAAH,QAAGA,KAAH;QAAA,IAAUS,KAAV,QAAUA,KAAV;QAAA,oBAC3B;UAAQ,GAAG,EAAET,KAAb;UAAoB,KAAK,EAAEA;QAA3B,GACKS,KADL,CAD2B;MAAA,CAA9B,CALL,CAPJ,CADJ;IAqBH;;;EA3C8BC,mC"}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.TextareaElement = void 0;
|
|
9
|
+
|
|
8
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
9
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
10
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
11
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
13
20
|
var _Input = require("@webiny/ui/Input");
|
|
21
|
+
|
|
14
22
|
var _FormFieldElement2 = require("./FormFieldElement");
|
|
23
|
+
|
|
15
24
|
var TextareaElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
16
25
|
(0, _inherits2.default)(TextareaElement, _FormFieldElement);
|
|
26
|
+
|
|
17
27
|
var _super = (0, _createSuper2.default)(TextareaElement);
|
|
28
|
+
|
|
18
29
|
function TextareaElement(id, config) {
|
|
19
30
|
var _this;
|
|
31
|
+
|
|
20
32
|
(0, _classCallCheck2.default)(this, TextareaElement);
|
|
21
33
|
_this = _super.call(this, id, config);
|
|
34
|
+
|
|
22
35
|
_this.applyPlugins(TextareaElement);
|
|
36
|
+
|
|
23
37
|
return _this;
|
|
24
38
|
}
|
|
39
|
+
|
|
25
40
|
(0, _createClass2.default)(TextareaElement, [{
|
|
26
41
|
key: "setRows",
|
|
27
42
|
value: function setRows(rows) {
|
|
@@ -38,6 +53,7 @@ var TextareaElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
38
53
|
if (!props.formProps) {
|
|
39
54
|
throw Error("TextareaElement must be placed inside of a FormElement.");
|
|
40
55
|
}
|
|
56
|
+
|
|
41
57
|
var Bind = props.formProps.Bind;
|
|
42
58
|
return /*#__PURE__*/_react.default.createElement(Bind, {
|
|
43
59
|
name: this.getName(),
|
|
@@ -52,4 +68,5 @@ var TextareaElement = /*#__PURE__*/function (_FormFieldElement) {
|
|
|
52
68
|
}]);
|
|
53
69
|
return TextareaElement;
|
|
54
70
|
}(_FormFieldElement2.FormFieldElement);
|
|
71
|
+
|
|
55
72
|
exports.TextareaElement = TextareaElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextareaElement","id","config","applyPlugins","rows","props","formProps","Error","Bind","getName","getValidators","getLabel","getIsDisabled","getRows","getDescription","FormFieldElement"],"sources":["TextareaElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { FormRenderPropParams } from \"@webiny/form\";\nimport { FormFieldElement, FormFieldElementConfig } from \"~/ui/elements/form/FormFieldElement\";\n\nexport interface TextareaElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\nexport interface TextareaElementConfig extends FormFieldElementConfig {\n rows: number;\n}\n\nexport class TextareaElement extends FormFieldElement<TextareaElementConfig> {\n constructor(id: string, config: TextareaElementConfig) {\n super(id, config);\n\n this.applyPlugins(TextareaElement);\n }\n\n public setRows(rows: number): void {\n this.config.rows = rows;\n }\n\n public getRows(): number {\n return this.config.rows;\n }\n\n public override render(props: TextareaElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`TextareaElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind name={this.getName()} validators={this.getValidators(props)}>\n <Input\n label={this.getLabel(props)}\n disabled={this.getIsDisabled(props)}\n rows={this.getRows()}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["TextareaElement","id","config","applyPlugins","rows","props","formProps","Error","Bind","getName","getValidators","getLabel","getIsDisabled","getRows","getDescription","FormFieldElement"],"sources":["TextareaElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { FormRenderPropParams } from \"@webiny/form\";\nimport { FormFieldElement, FormFieldElementConfig } from \"~/ui/elements/form/FormFieldElement\";\n\nexport interface TextareaElementRenderProps {\n formProps: FormRenderPropParams;\n}\n\nexport interface TextareaElementConfig extends FormFieldElementConfig {\n rows: number;\n}\n\nexport class TextareaElement extends FormFieldElement<TextareaElementConfig> {\n constructor(id: string, config: TextareaElementConfig) {\n super(id, config);\n\n this.applyPlugins(TextareaElement);\n }\n\n public setRows(rows: number): void {\n this.config.rows = rows;\n }\n\n public getRows(): number {\n return this.config.rows;\n }\n\n public override render(props: TextareaElementRenderProps): React.ReactNode {\n if (!props.formProps) {\n throw Error(`TextareaElement must be placed inside of a FormElement.`);\n }\n\n const { Bind } = props.formProps;\n\n return (\n <Bind name={this.getName()} validators={this.getValidators(props)}>\n <Input\n label={this.getLabel(props)}\n disabled={this.getIsDisabled(props)}\n rows={this.getRows()}\n description={this.getDescription(props)}\n />\n </Bind>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;IAUaA,e;;;;;EACT,yBAAYC,EAAZ,EAAwBC,MAAxB,EAAuD;IAAA;;IAAA;IACnD,0BAAMD,EAAN,EAAUC,MAAV;;IAEA,MAAKC,YAAL,CAAkBH,eAAlB;;IAHmD;EAItD;;;;WAED,iBAAeI,IAAf,EAAmC;MAC/B,KAAKF,MAAL,CAAYE,IAAZ,GAAmBA,IAAnB;IACH;;;WAED,mBAAyB;MACrB,OAAO,KAAKF,MAAL,CAAYE,IAAnB;IACH;;;WAED,gBAAuBC,KAAvB,EAA2E;MACvE,IAAI,CAACA,KAAK,CAACC,SAAX,EAAsB;QAClB,MAAMC,KAAK,2DAAX;MACH;;MAED,IAAQC,IAAR,GAAiBH,KAAK,CAACC,SAAvB,CAAQE,IAAR;MAEA,oBACI,6BAAC,IAAD;QAAM,IAAI,EAAE,KAAKC,OAAL,EAAZ;QAA4B,UAAU,EAAE,KAAKC,aAAL,CAAmBL,KAAnB;MAAxC,gBACI,6BAAC,YAAD;QACI,KAAK,EAAE,KAAKM,QAAL,CAAcN,KAAd,CADX;QAEI,QAAQ,EAAE,KAAKO,aAAL,CAAmBP,KAAnB,CAFd;QAGI,IAAI,EAAE,KAAKQ,OAAL,EAHV;QAII,WAAW,EAAE,KAAKC,cAAL,CAAoBT,KAApB;MAJjB,EADJ,CADJ;IAUH;;;EAhCgCU,mC"}
|