@plesk/ui-library 3.28.0 → 3.28.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/cjs/components/Form/Form.js +3 -0
- package/cjs/components/FormField/FormField.js +7 -0
- package/cjs/components/FormFieldText/FormFieldText.js +13 -5
- package/cjs/components/InputFile/InputFile.js +4 -2
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +27 -7
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Form/Form.js +3 -0
- package/esm/components/FormField/FormField.js +7 -0
- package/esm/components/FormFieldText/FormFieldText.js +13 -5
- package/esm/components/InputFile/InputFile.js +4 -2
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/styleguide/build/bundle.fa6ff17e.js +2 -0
- package/styleguide/build/{bundle.24d5b0eb.js.LICENSE.txt → bundle.fa6ff17e.js.LICENSE.txt} +0 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/Form/Form.d.ts +4 -82
- package/types/src/components/Form/FormContext.d.ts +2 -14
- package/types/src/components/Form/types.d.ts +125 -0
- package/types/src/components/InputFile/InputFile.d.ts +6 -1
- package/types/src/components/TextArea/TextArea.d.ts +2 -2
- package/styleguide/build/bundle.24d5b0eb.js +0 -2
|
@@ -52,6 +52,9 @@ class Form extends _react.Component {
|
|
|
52
52
|
vertical: this.props.vertical || false,
|
|
53
53
|
requiredFields: [],
|
|
54
54
|
formContext: {
|
|
55
|
+
getValues: () => {
|
|
56
|
+
return this.state.values;
|
|
57
|
+
},
|
|
55
58
|
getValue: (name, def) => {
|
|
56
59
|
if (this.state.values) {
|
|
57
60
|
return (0, _utils.getIn)(this.state.values, name, def);
|
|
@@ -335,6 +335,13 @@ class FormField extends _react.Component {
|
|
|
335
335
|
return null;
|
|
336
336
|
},
|
|
337
337
|
getName: () => this.props.name,
|
|
338
|
+
getValues: () => {
|
|
339
|
+
if (this.props.form) {
|
|
340
|
+
return this.props.form.getValues();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return null;
|
|
344
|
+
},
|
|
338
345
|
getValue: def => {
|
|
339
346
|
if (this.props.form && this.props.name) {
|
|
340
347
|
return this.props.form.getValue(this.props.name, def);
|
|
@@ -49,6 +49,7 @@ class FormFieldText extends _react.Component {
|
|
|
49
49
|
autoFocus,
|
|
50
50
|
autoComplete,
|
|
51
51
|
autoheight,
|
|
52
|
+
inputProps,
|
|
52
53
|
...props
|
|
53
54
|
} = this.props;
|
|
54
55
|
return /*#__PURE__*/_react.default.createElement(_FormField.default, (0, _extends2.default)({
|
|
@@ -61,7 +62,7 @@ class FormFieldText extends _react.Component {
|
|
|
61
62
|
getValue,
|
|
62
63
|
setValue,
|
|
63
64
|
isDisabled
|
|
64
|
-
}) => multiline ? /*#__PURE__*/_react.default.createElement(_TextArea.default, {
|
|
65
|
+
}) => multiline ? /*#__PURE__*/_react.default.createElement(_TextArea.default, (0, _extends2.default)({
|
|
65
66
|
id: getId(),
|
|
66
67
|
name: getName(),
|
|
67
68
|
value: getValue(''),
|
|
@@ -73,7 +74,7 @@ class FormFieldText extends _react.Component {
|
|
|
73
74
|
autoFocus: autoFocus,
|
|
74
75
|
autoComplete: autoComplete,
|
|
75
76
|
autoheight: autoheight
|
|
76
|
-
}) : /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
77
|
+
}, inputProps)) : /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
|
|
77
78
|
id: getId(),
|
|
78
79
|
name: getName(),
|
|
79
80
|
className: `${baseClassName}__input`,
|
|
@@ -84,7 +85,7 @@ class FormFieldText extends _react.Component {
|
|
|
84
85
|
placeholder: placeholder,
|
|
85
86
|
autoFocus: autoFocus,
|
|
86
87
|
autoComplete: autoComplete
|
|
87
|
-
}));
|
|
88
|
+
}, inputProps)));
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
}
|
|
@@ -155,7 +156,13 @@ FormFieldText.propTypes = {
|
|
|
155
156
|
* Adjust height automatically when multiline option is set to true.
|
|
156
157
|
* @since 1.9.0
|
|
157
158
|
*/
|
|
158
|
-
autoheight: _propTypes.default.bool
|
|
159
|
+
autoheight: _propTypes.default.bool,
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Props of underlying input element.
|
|
163
|
+
* @since 3.28.1
|
|
164
|
+
*/
|
|
165
|
+
inputProps: _propTypes.default.object
|
|
159
166
|
};
|
|
160
167
|
FormFieldText.defaultProps = {
|
|
161
168
|
size: undefined,
|
|
@@ -168,7 +175,8 @@ FormFieldText.defaultProps = {
|
|
|
168
175
|
multi: undefined,
|
|
169
176
|
className: undefined,
|
|
170
177
|
baseClassName: `${_constants.CLS_PREFIX}form-field-text`,
|
|
171
|
-
autoheight: false
|
|
178
|
+
autoheight: false,
|
|
179
|
+
inputProps: undefined
|
|
172
180
|
};
|
|
173
181
|
var _default = FormFieldText;
|
|
174
182
|
exports.default = _default;
|
|
@@ -29,7 +29,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
-
// Copyright 1999-
|
|
32
|
+
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
|
|
33
33
|
const generateId = () => Math.random().toString(36).slice(2);
|
|
34
34
|
/**
|
|
35
35
|
* `InputFile` component is used for browsing and choosing a file from the local disk.
|
|
@@ -45,6 +45,7 @@ const InputFile = ({
|
|
|
45
45
|
disabled = false,
|
|
46
46
|
locale,
|
|
47
47
|
testId,
|
|
48
|
+
accept,
|
|
48
49
|
...props
|
|
49
50
|
}) => {
|
|
50
51
|
const [file, setFile] = (0, _react.useState)();
|
|
@@ -102,7 +103,8 @@ const InputFile = ({
|
|
|
102
103
|
ref: inputRef,
|
|
103
104
|
"data-test": testId && `${testId}--file-input`,
|
|
104
105
|
onFocus: handleFocus,
|
|
105
|
-
onBlur: handleBlur
|
|
106
|
+
onBlur: handleBlur,
|
|
107
|
+
accept: accept
|
|
106
108
|
}), /*#__PURE__*/_react.default.createElement(_Translate.default, {
|
|
107
109
|
namespace: "InputFile",
|
|
108
110
|
content: "browseButton",
|
package/cjs/index.js
CHANGED