@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
|
@@ -26,6 +26,9 @@ class Form extends Component {
|
|
|
26
26
|
vertical: this.props.vertical || false,
|
|
27
27
|
requiredFields: [],
|
|
28
28
|
formContext: {
|
|
29
|
+
getValues: () => {
|
|
30
|
+
return this.state.values;
|
|
31
|
+
},
|
|
29
32
|
getValue: (name, def) => {
|
|
30
33
|
if (this.state.values) {
|
|
31
34
|
return getIn(this.state.values, name, def);
|
|
@@ -311,6 +311,13 @@ class FormField extends Component {
|
|
|
311
311
|
return null;
|
|
312
312
|
},
|
|
313
313
|
getName: () => this.props.name,
|
|
314
|
+
getValues: () => {
|
|
315
|
+
if (this.props.form) {
|
|
316
|
+
return this.props.form.getValues();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return null;
|
|
320
|
+
},
|
|
314
321
|
getValue: def => {
|
|
315
322
|
if (this.props.form && this.props.name) {
|
|
316
323
|
return this.props.form.getValue(this.props.name, def);
|
|
@@ -28,6 +28,7 @@ class FormFieldText extends Component {
|
|
|
28
28
|
autoFocus,
|
|
29
29
|
autoComplete,
|
|
30
30
|
autoheight,
|
|
31
|
+
inputProps,
|
|
31
32
|
...props
|
|
32
33
|
} = this.props;
|
|
33
34
|
return /*#__PURE__*/React.createElement(FormField, _extends({
|
|
@@ -40,7 +41,7 @@ class FormFieldText extends Component {
|
|
|
40
41
|
getValue,
|
|
41
42
|
setValue,
|
|
42
43
|
isDisabled
|
|
43
|
-
}) => multiline ? /*#__PURE__*/React.createElement(TextArea, {
|
|
44
|
+
}) => multiline ? /*#__PURE__*/React.createElement(TextArea, _extends({
|
|
44
45
|
id: getId(),
|
|
45
46
|
name: getName(),
|
|
46
47
|
value: getValue(''),
|
|
@@ -52,7 +53,7 @@ class FormFieldText extends Component {
|
|
|
52
53
|
autoFocus: autoFocus,
|
|
53
54
|
autoComplete: autoComplete,
|
|
54
55
|
autoheight: autoheight
|
|
55
|
-
}) : /*#__PURE__*/React.createElement(Input, {
|
|
56
|
+
}, inputProps)) : /*#__PURE__*/React.createElement(Input, _extends({
|
|
56
57
|
id: getId(),
|
|
57
58
|
name: getName(),
|
|
58
59
|
className: `${baseClassName}__input`,
|
|
@@ -63,7 +64,7 @@ class FormFieldText extends Component {
|
|
|
63
64
|
placeholder: placeholder,
|
|
64
65
|
autoFocus: autoFocus,
|
|
65
66
|
autoComplete: autoComplete
|
|
66
|
-
}));
|
|
67
|
+
}, inputProps)));
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
}
|
|
@@ -134,7 +135,13 @@ FormFieldText.propTypes = {
|
|
|
134
135
|
* Adjust height automatically when multiline option is set to true.
|
|
135
136
|
* @since 1.9.0
|
|
136
137
|
*/
|
|
137
|
-
autoheight: PropTypes.bool
|
|
138
|
+
autoheight: PropTypes.bool,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Props of underlying input element.
|
|
142
|
+
* @since 3.28.1
|
|
143
|
+
*/
|
|
144
|
+
inputProps: PropTypes.object
|
|
138
145
|
};
|
|
139
146
|
FormFieldText.defaultProps = {
|
|
140
147
|
size: undefined,
|
|
@@ -147,6 +154,7 @@ FormFieldText.defaultProps = {
|
|
|
147
154
|
multi: undefined,
|
|
148
155
|
className: undefined,
|
|
149
156
|
baseClassName: `${CLS_PREFIX}form-field-text`,
|
|
150
|
-
autoheight: false
|
|
157
|
+
autoheight: false,
|
|
158
|
+
inputProps: undefined
|
|
151
159
|
};
|
|
152
160
|
export default FormFieldText;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
// Copyright 1999-
|
|
2
|
+
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
|
|
3
3
|
import React, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -24,6 +24,7 @@ const InputFile = ({
|
|
|
24
24
|
disabled = false,
|
|
25
25
|
locale,
|
|
26
26
|
testId,
|
|
27
|
+
accept,
|
|
27
28
|
...props
|
|
28
29
|
}) => {
|
|
29
30
|
const [file, setFile] = useState();
|
|
@@ -81,7 +82,8 @@ const InputFile = ({
|
|
|
81
82
|
ref: inputRef,
|
|
82
83
|
"data-test": testId && `${testId}--file-input`,
|
|
83
84
|
onFocus: handleFocus,
|
|
84
|
-
onBlur: handleBlur
|
|
85
|
+
onBlur: handleBlur,
|
|
86
|
+
accept: accept
|
|
85
87
|
}), /*#__PURE__*/React.createElement(Translate, {
|
|
86
88
|
namespace: "InputFile",
|
|
87
89
|
content: "browseButton",
|
package/esm/index.js
CHANGED