@pareto-engineering/design-system 4.0.0-alpha.62 → 4.0.0-alpha.63
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/dist/cjs/f/FormInput/FormInput.js +43 -13
- package/dist/cjs/f/common/V2/Description/Description.js +76 -0
- package/dist/cjs/f/common/V2/Description/index.js +13 -0
- package/dist/cjs/f/common/V2/Description/styles.scss +10 -0
- package/dist/cjs/f/common/V2/Label/Label.js +84 -0
- package/dist/cjs/f/common/V2/Label/index.js +13 -0
- package/dist/cjs/f/common/V2/Label/styles.scss +9 -0
- package/dist/cjs/f/common/V2/index.js +19 -0
- package/dist/cjs/f/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/Checkbox/Checkbox.js +122 -0
- package/dist/cjs/f/fields/V2/Checkbox/index.js +13 -0
- package/dist/cjs/f/fields/V2/Checkbox/styles.scss +16 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/ChoicesInput.js +154 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/Choice.js +104 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/index.js +13 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/dist/cjs/f/fields/V2/EditorInput/EditorInput.js +197 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/Toolbar.js +257 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/TreeViewPlugin.js +18 -0
- package/dist/cjs/f/fields/V2/EditorInput/common/index.js +20 -0
- package/dist/cjs/f/fields/V2/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/EditorInput/styles.scss +149 -0
- package/dist/cjs/f/fields/V2/LinkInput/LinkInput.js +156 -0
- package/dist/cjs/f/fields/V2/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/LinkInput/styles.scss +90 -0
- package/dist/cjs/f/fields/V2/QueryChoices/QueryChoices.js +137 -0
- package/dist/cjs/f/fields/V2/QueryChoices/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/QueryCombobox.js +229 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +236 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/Menu.js +83 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +300 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/common/index.js +26 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/index.js +13 -0
- package/dist/cjs/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/dist/cjs/f/fields/V2/QuerySelect/QuerySelect.js +198 -0
- package/dist/cjs/f/fields/V2/QuerySelect/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/RatingsInput.js +130 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/Rating.js +117 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/common/index.js +12 -0
- package/dist/cjs/f/fields/V2/RatingsInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/dist/cjs/f/fields/V2/SelectInput/SelectInput.js +154 -0
- package/dist/cjs/f/fields/V2/SelectInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/SelectInput/styles.scss +87 -0
- package/dist/cjs/f/fields/V2/TextInput/TextInput.js +155 -0
- package/dist/cjs/f/fields/V2/TextInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/TextInput/styles.scss +78 -0
- package/dist/cjs/f/fields/V2/TextareaInput/TextareaInput.js +152 -0
- package/dist/cjs/f/fields/V2/TextareaInput/index.js +13 -0
- package/dist/cjs/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/dist/cjs/f/fields/V2/index.js +82 -0
- package/dist/cjs/f/fields/index.js +26 -1
- package/dist/es/f/FormInput/FormInput.js +33 -3
- package/dist/es/f/common/V2/Description/Description.js +68 -0
- package/dist/es/f/common/V2/Description/index.js +2 -0
- package/dist/es/f/common/V2/Description/styles.scss +10 -0
- package/dist/es/f/common/V2/Label/Label.js +76 -0
- package/dist/es/f/common/V2/Label/index.js +2 -0
- package/dist/es/f/common/V2/Label/styles.scss +9 -0
- package/dist/es/f/common/V2/index.js +2 -0
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/fields/V2/Checkbox/Checkbox.js +114 -0
- package/dist/es/f/fields/V2/Checkbox/index.js +2 -0
- package/dist/es/f/fields/V2/Checkbox/styles.scss +16 -0
- package/dist/es/f/fields/V2/ChoicesInput/ChoicesInput.js +148 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/Choice.js +97 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/index.js +2 -0
- package/dist/es/f/fields/V2/ChoicesInput/common/index.js +1 -0
- package/dist/es/f/fields/V2/ChoicesInput/index.js +2 -0
- package/dist/es/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/dist/es/f/fields/V2/EditorInput/EditorInput.js +192 -0
- package/dist/es/f/fields/V2/EditorInput/common/Toolbar.js +246 -0
- package/dist/es/f/fields/V2/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/V2/EditorInput/common/index.js +2 -0
- package/dist/es/f/fields/V2/EditorInput/index.js +2 -0
- package/dist/es/f/fields/V2/EditorInput/styles.scss +149 -0
- package/dist/es/f/fields/V2/LinkInput/LinkInput.js +148 -0
- package/dist/es/f/fields/V2/LinkInput/index.js +2 -0
- package/dist/es/f/fields/V2/LinkInput/styles.scss +90 -0
- package/dist/es/f/fields/V2/QueryChoices/QueryChoices.js +126 -0
- package/dist/es/f/fields/V2/QueryChoices/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/QueryCombobox.js +221 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +229 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/Menu.js +73 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +293 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/common/index.js +3 -0
- package/dist/es/f/fields/V2/QueryCombobox/index.js +2 -0
- package/dist/es/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/dist/es/f/fields/V2/QuerySelect/QuerySelect.js +186 -0
- package/dist/es/f/fields/V2/QuerySelect/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/RatingsInput.js +124 -0
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/Rating.js +109 -0
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/common/index.js +1 -0
- package/dist/es/f/fields/V2/RatingsInput/index.js +2 -0
- package/dist/es/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/dist/es/f/fields/V2/SelectInput/SelectInput.js +146 -0
- package/dist/es/f/fields/V2/SelectInput/index.js +2 -0
- package/dist/es/f/fields/V2/SelectInput/styles.scss +87 -0
- package/dist/es/f/fields/V2/TextInput/TextInput.js +147 -0
- package/dist/es/f/fields/V2/TextInput/index.js +2 -0
- package/dist/es/f/fields/V2/TextInput/styles.scss +78 -0
- package/dist/es/f/fields/V2/TextareaInput/TextareaInput.js +146 -0
- package/dist/es/f/fields/V2/TextareaInput/index.js +2 -0
- package/dist/es/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/dist/es/f/fields/V2/index.js +11 -0
- package/dist/es/f/fields/index.js +2 -1
- package/package.json +3 -3
- package/src/stories/f/v2/Checkbox.stories.jsx +102 -0
- package/src/stories/f/v2/ChoicesInput.stories.jsx +139 -0
- package/src/stories/f/v2/EditorInput.stories.jsx +81 -0
- package/src/stories/f/v2/LinkInput.stories.jsx +93 -0
- package/src/stories/f/v2/QueryChoices.stories.jsx +144 -0
- package/src/stories/f/v2/QueryCombobox.stories.jsx +301 -0
- package/src/stories/f/v2/QuerySelect.stories.jsx +150 -0
- package/src/stories/f/v2/RatingsInput.stories.jsx +77 -0
- package/src/stories/f/v2/SelectInput.stories.jsx +95 -0
- package/src/stories/f/v2/TextInput.stories.jsx +120 -0
- package/src/stories/f/v2/TextareaInput.stories.jsx +107 -0
- package/src/stories/f/v2/__generated__/FormInputAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/f/v2/__generated__/FormInputAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/v2/__generated__/QueryChoicesAllTaskStatusesQuery.graphql.js +122 -0
- package/src/stories/f/v2/__generated__/QueryComboboxAllTeamsQuery.graphql.js +139 -0
- package/src/stories/f/v2/__generated__/QuerySelectAllTaskStatusesQuery.graphql.js +122 -0
- package/src/ui/f/FormInput/FormInput.jsx +57 -12
- package/src/ui/f/common/V2/Description/Description.jsx +94 -0
- package/src/ui/f/common/V2/Description/index.js +2 -0
- package/src/ui/f/common/V2/Description/styles.scss +10 -0
- package/src/ui/f/common/V2/Label/Label.jsx +102 -0
- package/src/ui/f/common/V2/Label/index.js +2 -0
- package/src/ui/f/common/V2/Label/styles.scss +9 -0
- package/src/ui/f/common/V2/index.js +2 -0
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/fields/V2/Checkbox/Checkbox.jsx +146 -0
- package/src/ui/f/fields/V2/Checkbox/index.js +2 -0
- package/src/ui/f/fields/V2/Checkbox/styles.scss +16 -0
- package/src/ui/f/fields/V2/ChoicesInput/ChoicesInput.jsx +183 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/Choice.jsx +125 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/index.js +2 -0
- package/src/ui/f/fields/V2/ChoicesInput/common/index.js +1 -0
- package/src/ui/f/fields/V2/ChoicesInput/index.js +2 -0
- package/src/ui/f/fields/V2/ChoicesInput/styles.scss +79 -0
- package/src/ui/f/fields/V2/EditorInput/EditorInput.jsx +244 -0
- package/src/ui/f/fields/V2/EditorInput/common/Toolbar.jsx +356 -0
- package/src/ui/f/fields/V2/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/V2/EditorInput/common/index.jsx +2 -0
- package/src/ui/f/fields/V2/EditorInput/index.js +2 -0
- package/src/ui/f/fields/V2/EditorInput/styles.scss +149 -0
- package/src/ui/f/fields/V2/LinkInput/LinkInput.jsx +187 -0
- package/src/ui/f/fields/V2/LinkInput/index.js +2 -0
- package/src/ui/f/fields/V2/LinkInput/styles.scss +90 -0
- package/src/ui/f/fields/V2/QueryChoices/QueryChoices.jsx +153 -0
- package/src/ui/f/fields/V2/QueryChoices/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/QueryCombobox.jsx +254 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/Combobox.jsx +276 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/Menu.jsx +103 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +362 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/common/index.js +3 -0
- package/src/ui/f/fields/V2/QueryCombobox/index.js +2 -0
- package/src/ui/f/fields/V2/QueryCombobox/styles.scss +127 -0
- package/src/ui/f/fields/V2/QuerySelect/QuerySelect.jsx +220 -0
- package/src/ui/f/fields/V2/QuerySelect/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/RatingsInput.jsx +152 -0
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/Rating.jsx +142 -0
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/common/index.js +1 -0
- package/src/ui/f/fields/V2/RatingsInput/index.js +2 -0
- package/src/ui/f/fields/V2/RatingsInput/styles.scss +48 -0
- package/src/ui/f/fields/V2/SelectInput/SelectInput.jsx +187 -0
- package/src/ui/f/fields/V2/SelectInput/index.js +2 -0
- package/src/ui/f/fields/V2/SelectInput/styles.scss +87 -0
- package/src/ui/f/fields/V2/TextInput/TextInput.jsx +192 -0
- package/src/ui/f/fields/V2/TextInput/index.js +2 -0
- package/src/ui/f/fields/V2/TextInput/styles.scss +78 -0
- package/src/ui/f/fields/V2/TextareaInput/TextareaInput.jsx +180 -0
- package/src/ui/f/fields/V2/TextareaInput/index.js +2 -0
- package/src/ui/f/fields/V2/TextareaInput/styles.scss +53 -0
- package/src/ui/f/fields/V2/index.js +11 -0
- package/src/ui/f/fields/index.js +1 -0
- package/tests/__snapshots__/Storyshots.test.js.snap +5909 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var React = _react;
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
11
|
+
var _formik = require("formik");
|
|
12
|
+
var _common = require("../../../common");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /* @pareto-engineering/generator-front 1.0.12 */
|
|
17
|
+
// Local Definitions
|
|
18
|
+
|
|
19
|
+
const baseClassName = _exports.default.base;
|
|
20
|
+
const componentClassName = 'text-input';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This is the component description.
|
|
24
|
+
*/
|
|
25
|
+
const TextInput = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
id,
|
|
28
|
+
className: userClassName,
|
|
29
|
+
style,
|
|
30
|
+
type,
|
|
31
|
+
name,
|
|
32
|
+
label,
|
|
33
|
+
color,
|
|
34
|
+
labelColor,
|
|
35
|
+
validate,
|
|
36
|
+
description,
|
|
37
|
+
disabled,
|
|
38
|
+
placeholder,
|
|
39
|
+
optional,
|
|
40
|
+
autoComplete,
|
|
41
|
+
symbol,
|
|
42
|
+
...otherProps
|
|
43
|
+
} = _ref;
|
|
44
|
+
(0, _react.useInsertionEffect)(() => {
|
|
45
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
46
|
+
}, []);
|
|
47
|
+
const [field] = (0, _formik.useField)({
|
|
48
|
+
name,
|
|
49
|
+
validate
|
|
50
|
+
});
|
|
51
|
+
const symbolStyle = symbol ? {
|
|
52
|
+
'--symbol': symbol
|
|
53
|
+
} : {};
|
|
54
|
+
const InputWrapper = symbol ? 'div' : React.Fragment;
|
|
55
|
+
const inputWrapperProps = symbol ? {
|
|
56
|
+
className: 'input-wrapper'
|
|
57
|
+
} : {};
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
id: id,
|
|
60
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color} ${symbol ? 'has-symbol' : ''}`].filter(e => e).join(' '),
|
|
61
|
+
style: {
|
|
62
|
+
...symbolStyle,
|
|
63
|
+
...style
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/React.createElement(_common.FormLabelV2, {
|
|
66
|
+
name: name,
|
|
67
|
+
color: labelColor,
|
|
68
|
+
optional: optional
|
|
69
|
+
// {...otherProps}
|
|
70
|
+
}, label), /*#__PURE__*/React.createElement(InputWrapper, inputWrapperProps, /*#__PURE__*/React.createElement("input", _extends({
|
|
71
|
+
id: name,
|
|
72
|
+
className: "input",
|
|
73
|
+
type: type,
|
|
74
|
+
disabled: disabled,
|
|
75
|
+
placeholder: placeholder,
|
|
76
|
+
autoComplete: autoComplete
|
|
77
|
+
}, field, otherProps))), /*#__PURE__*/React.createElement(_common.FormDescriptionV2, {
|
|
78
|
+
className: "s-1",
|
|
79
|
+
description: description,
|
|
80
|
+
name: name
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
TextInput.propTypes = {
|
|
84
|
+
/**
|
|
85
|
+
* The HTML id for this element
|
|
86
|
+
*/
|
|
87
|
+
id: _propTypes.default.string,
|
|
88
|
+
/**
|
|
89
|
+
* The HTML class names for this element
|
|
90
|
+
*/
|
|
91
|
+
className: _propTypes.default.string,
|
|
92
|
+
/**
|
|
93
|
+
* The React-written, css properties for this element.
|
|
94
|
+
*/
|
|
95
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
96
|
+
/**
|
|
97
|
+
* The input name (html - and Formik state)
|
|
98
|
+
*/
|
|
99
|
+
name: _propTypes.default.string.isRequired,
|
|
100
|
+
/**
|
|
101
|
+
* The input label
|
|
102
|
+
*/
|
|
103
|
+
label: _propTypes.default.string.isRequired,
|
|
104
|
+
/**
|
|
105
|
+
* The input label color
|
|
106
|
+
*/
|
|
107
|
+
labelColor: _propTypes.default.string,
|
|
108
|
+
/**
|
|
109
|
+
* The type of the input (html)
|
|
110
|
+
*/
|
|
111
|
+
type: _propTypes.default.oneOf(['text', 'email', 'password', 'number', 'date', 'time', 'datetime', 'month', 'tel', 'hidden', 'url']),
|
|
112
|
+
/**
|
|
113
|
+
* The input field validator function
|
|
114
|
+
*/
|
|
115
|
+
validate: _propTypes.default.func,
|
|
116
|
+
/**
|
|
117
|
+
* If the slide will only have one input
|
|
118
|
+
*/
|
|
119
|
+
oneInputLabel: _propTypes.default.bool,
|
|
120
|
+
/**
|
|
121
|
+
* Input description
|
|
122
|
+
*/
|
|
123
|
+
description: _propTypes.default.string,
|
|
124
|
+
/**
|
|
125
|
+
* Whether the text input should be disabled
|
|
126
|
+
*/
|
|
127
|
+
disabled: _propTypes.default.bool,
|
|
128
|
+
/**
|
|
129
|
+
* The placeholder text for the input
|
|
130
|
+
*/
|
|
131
|
+
placeholder: _propTypes.default.string,
|
|
132
|
+
/**
|
|
133
|
+
* The text input color
|
|
134
|
+
*/
|
|
135
|
+
color: _propTypes.default.string,
|
|
136
|
+
/**
|
|
137
|
+
* Whether the input is optional or not
|
|
138
|
+
*/
|
|
139
|
+
optional: _propTypes.default.bool,
|
|
140
|
+
/**
|
|
141
|
+
* The autoComplete value that the browser should watch for the input
|
|
142
|
+
* `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
|
|
143
|
+
*/
|
|
144
|
+
autoComplete: _propTypes.default.string,
|
|
145
|
+
/**
|
|
146
|
+
* A symbol to be set inside the input field
|
|
147
|
+
*/
|
|
148
|
+
symbol: _propTypes.default.string
|
|
149
|
+
};
|
|
150
|
+
TextInput.defaultProps = {
|
|
151
|
+
type: 'text',
|
|
152
|
+
color: 'paragraph',
|
|
153
|
+
disabled: false
|
|
154
|
+
};
|
|
155
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(TextInput);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TextInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TextInput.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@pareto-engineering/styles/src/mixins";
|
|
5
|
+
@use "@pareto-engineering/styles/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-padding: .55em .75em;
|
|
8
|
+
$default-symbol-left: 1em;
|
|
9
|
+
$default-padding-with-symbol:
|
|
10
|
+
.55em
|
|
11
|
+
calc($default-symbol-left - 1em)
|
|
12
|
+
.55em
|
|
13
|
+
calc($default-symbol-left + 1em);
|
|
14
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
15
|
+
$default-border: var(--theme-default-input-border);
|
|
16
|
+
$hover-border: var(--theme-hover-input-border);
|
|
17
|
+
$focus-border: var(--theme-focus-input-border);
|
|
18
|
+
$default-background: var(--background-inputs);
|
|
19
|
+
$disabled-background: var(--background-inputs-30);
|
|
20
|
+
|
|
21
|
+
.#{bem.$base}.text-input {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
> .#{bem.$base}.form-label {
|
|
26
|
+
margin-bottom: var(--gap);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
&.has-symbol {
|
|
31
|
+
> .input-wrapper {
|
|
32
|
+
position: relative;
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
color: var(--y);
|
|
36
|
+
content: var(--symbol);
|
|
37
|
+
left: $default-symbol-left;
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
transform: translate(-50%, -50%);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
input {
|
|
45
|
+
padding: $default-padding-with-symbol;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.input {
|
|
50
|
+
background-color: $default-background;
|
|
51
|
+
border: $default-border;
|
|
52
|
+
border-radius: $default-input-border-radius;
|
|
53
|
+
color: var(--y);
|
|
54
|
+
outline: none;
|
|
55
|
+
padding: $default-padding;
|
|
56
|
+
width: 100%;
|
|
57
|
+
|
|
58
|
+
&::placeholder {
|
|
59
|
+
color: var(--metadata);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:disabled {
|
|
63
|
+
background-color: $disabled-background;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:not(:disabled) {
|
|
67
|
+
&:hover,
|
|
68
|
+
&:active {
|
|
69
|
+
border: $hover-border;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:focus {
|
|
73
|
+
border: $focus-border;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var React = _react;
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
11
|
+
var _formik = require("formik");
|
|
12
|
+
var _common = require("../../../common");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /* @pareto-engineering/generator-front 1.0.12 */ // Local Definitions
|
|
17
|
+
const baseClassName = _exports.default.base;
|
|
18
|
+
const componentClassName = 'text-area-input';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This is the component description.
|
|
22
|
+
*/
|
|
23
|
+
const TextareaInput = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
id,
|
|
26
|
+
className: userClassName,
|
|
27
|
+
style,
|
|
28
|
+
name,
|
|
29
|
+
label,
|
|
30
|
+
validate,
|
|
31
|
+
color,
|
|
32
|
+
rows,
|
|
33
|
+
optional,
|
|
34
|
+
labelColor,
|
|
35
|
+
description,
|
|
36
|
+
disabled,
|
|
37
|
+
placeholder,
|
|
38
|
+
autoComplete,
|
|
39
|
+
resize
|
|
40
|
+
// ...otherProps
|
|
41
|
+
} = _ref;
|
|
42
|
+
(0, _react.useInsertionEffect)(() => {
|
|
43
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
44
|
+
}, []);
|
|
45
|
+
const [field] = (0, _formik.useField)({
|
|
46
|
+
name,
|
|
47
|
+
validate
|
|
48
|
+
});
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
id: id,
|
|
51
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
52
|
+
style: style
|
|
53
|
+
}, /*#__PURE__*/React.createElement(_common.FormLabelV2, {
|
|
54
|
+
name: name,
|
|
55
|
+
color: labelColor,
|
|
56
|
+
optional: optional
|
|
57
|
+
// {...otherProps}
|
|
58
|
+
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
59
|
+
id: name,
|
|
60
|
+
className: "textarea"
|
|
61
|
+
}, field, {
|
|
62
|
+
style: {
|
|
63
|
+
resize
|
|
64
|
+
},
|
|
65
|
+
placeholder: placeholder,
|
|
66
|
+
rows: rows,
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
autoComplete: autoComplete
|
|
69
|
+
})), /*#__PURE__*/React.createElement(_common.FormDescriptionV2, {
|
|
70
|
+
className: "s-1",
|
|
71
|
+
description: description,
|
|
72
|
+
name: name
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
TextareaInput.propTypes = {
|
|
76
|
+
/**
|
|
77
|
+
* The HTML id for this element
|
|
78
|
+
*/
|
|
79
|
+
id: _propTypes.default.string,
|
|
80
|
+
/**
|
|
81
|
+
* The HTML class names for this element
|
|
82
|
+
*/
|
|
83
|
+
className: _propTypes.default.string,
|
|
84
|
+
/**
|
|
85
|
+
* The React-written, css properties for this element.
|
|
86
|
+
*/
|
|
87
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
88
|
+
/**
|
|
89
|
+
* The input name (html - and Formik state)
|
|
90
|
+
*/
|
|
91
|
+
name: _propTypes.default.string.isRequired,
|
|
92
|
+
/**
|
|
93
|
+
* The input label
|
|
94
|
+
*/
|
|
95
|
+
label: _propTypes.default.string.isRequired,
|
|
96
|
+
/**
|
|
97
|
+
* The input value validator function
|
|
98
|
+
*/
|
|
99
|
+
validate: _propTypes.default.func,
|
|
100
|
+
/**
|
|
101
|
+
* If the text area depends on it's label's text as the default description
|
|
102
|
+
*/
|
|
103
|
+
labelAsDescription: _propTypes.default.bool,
|
|
104
|
+
/**
|
|
105
|
+
* The textarea id
|
|
106
|
+
*/
|
|
107
|
+
textAreaId: _propTypes.default.string,
|
|
108
|
+
/**
|
|
109
|
+
* The number of rows int the text area
|
|
110
|
+
*/
|
|
111
|
+
rows: _propTypes.default.number,
|
|
112
|
+
/**
|
|
113
|
+
* Color of the text
|
|
114
|
+
*/
|
|
115
|
+
color: _propTypes.default.string,
|
|
116
|
+
/**
|
|
117
|
+
* Label base color
|
|
118
|
+
*/
|
|
119
|
+
labelColor: _propTypes.default.string,
|
|
120
|
+
/**
|
|
121
|
+
* Text area description
|
|
122
|
+
*/
|
|
123
|
+
description: _propTypes.default.string,
|
|
124
|
+
/**
|
|
125
|
+
* Whether the text area should be disabled
|
|
126
|
+
*/
|
|
127
|
+
disabled: _propTypes.default.bool,
|
|
128
|
+
/**
|
|
129
|
+
* The textarea placeholder text
|
|
130
|
+
*/
|
|
131
|
+
placeholder: _propTypes.default.string,
|
|
132
|
+
/**
|
|
133
|
+
* The autoComplete value that the browser should watch for the input
|
|
134
|
+
*/
|
|
135
|
+
autoComplete: _propTypes.default.string,
|
|
136
|
+
/**
|
|
137
|
+
* Whether to disable or allow only a certain method of resizing the area
|
|
138
|
+
* Textarea docs - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
139
|
+
*/
|
|
140
|
+
resize: _propTypes.default.string,
|
|
141
|
+
/**
|
|
142
|
+
* Whether the input is optional or not
|
|
143
|
+
*/
|
|
144
|
+
optional: _propTypes.default.bool
|
|
145
|
+
};
|
|
146
|
+
TextareaInput.defaultProps = {
|
|
147
|
+
rows: 10,
|
|
148
|
+
disabled: false,
|
|
149
|
+
resize: 'vertical',
|
|
150
|
+
color: 'paragraph'
|
|
151
|
+
};
|
|
152
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(TextareaInput);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TextareaInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TextareaInput.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _TextareaInput = _interopRequireDefault(require("./TextareaInput"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@pareto-engineering/styles/src/mixins";
|
|
5
|
+
@use "@pareto-engineering/styles/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-padding: .55em .75em;
|
|
8
|
+
$default-border: 1px solid var(--outline-inputs);
|
|
9
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
10
|
+
$default-border: var(--theme-default-input-border);
|
|
11
|
+
$hover-border: var(--theme-hover-input-border);
|
|
12
|
+
$focus-border: var(--theme-focus-input-border);
|
|
13
|
+
$default-background: var(--background-inputs);
|
|
14
|
+
$disabled-background: var(--background-inputs-30);
|
|
15
|
+
|
|
16
|
+
.#{bem.$base}.text-area-input {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
|
|
20
|
+
> .#{bem.$base}.form-label {
|
|
21
|
+
margin-bottom: var(--gap);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
> .textarea {
|
|
26
|
+
background: $default-background;
|
|
27
|
+
border: $default-border;
|
|
28
|
+
border-radius: $default-input-border-radius;
|
|
29
|
+
color: var(--y);
|
|
30
|
+
outline: none;
|
|
31
|
+
padding: $default-padding;
|
|
32
|
+
width: 100%;
|
|
33
|
+
|
|
34
|
+
&::placeholder {
|
|
35
|
+
color: var(--metadata);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:disabled {
|
|
39
|
+
background-color: $disabled-background;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:not(:disabled) {
|
|
43
|
+
&:hover,
|
|
44
|
+
&:active {
|
|
45
|
+
border: $hover-border;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus {
|
|
49
|
+
border: $focus-border;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CheckboxV2", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Checkbox.Checkbox;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ChoicesInputV2", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ChoicesInput.ChoicesInput;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "EditorInputV2", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _EditorInput.EditorInput;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "LinkInputV2", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _LinkInput.LinkInput;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "QueryChoicesV2", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _QueryChoices.QueryChoices;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "QueryComboboxV2", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _QueryCombobox.QueryCombobox;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "QuerySelectV2", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _QuerySelect.QuerySelect;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "RatingsInputV2", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _RatingsInput.RatingsInput;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "SelectInputV2", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _SelectInput.SelectInput;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "TextInputV2", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _TextInput.TextInput;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "TextareaInputV2", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _TextareaInput.TextareaInput;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var _TextInput = require("./TextInput");
|
|
73
|
+
var _SelectInput = require("./SelectInput");
|
|
74
|
+
var _ChoicesInput = require("./ChoicesInput");
|
|
75
|
+
var _TextareaInput = require("./TextareaInput");
|
|
76
|
+
var _RatingsInput = require("./RatingsInput");
|
|
77
|
+
var _QueryCombobox = require("./QueryCombobox");
|
|
78
|
+
var _QuerySelect = require("./QuerySelect");
|
|
79
|
+
var _Checkbox = require("./Checkbox");
|
|
80
|
+
var _QueryChoices = require("./QueryChoices");
|
|
81
|
+
var _LinkInput = require("./LinkInput");
|
|
82
|
+
var _EditorInput = require("./EditorInput");
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
TextInput: true,
|
|
8
|
+
SelectInput: true,
|
|
9
|
+
ChoicesInput: true,
|
|
10
|
+
TextareaInput: true,
|
|
11
|
+
RatingsInput: true,
|
|
12
|
+
QueryCombobox: true,
|
|
13
|
+
QuerySelect: true,
|
|
14
|
+
Checkbox: true,
|
|
15
|
+
QueryChoices: true,
|
|
16
|
+
LinkInput: true,
|
|
17
|
+
EditorInput: true
|
|
18
|
+
};
|
|
6
19
|
Object.defineProperty(exports, "Checkbox", {
|
|
7
20
|
enumerable: true,
|
|
8
21
|
get: function () {
|
|
@@ -79,4 +92,16 @@ var _QuerySelect = require("./QuerySelect");
|
|
|
79
92
|
var _Checkbox = require("./Checkbox");
|
|
80
93
|
var _QueryChoices = require("./QueryChoices");
|
|
81
94
|
var _LinkInput = require("./LinkInput");
|
|
82
|
-
var _EditorInput = require("./EditorInput");
|
|
95
|
+
var _EditorInput = require("./EditorInput");
|
|
96
|
+
var _V = require("./V2");
|
|
97
|
+
Object.keys(_V).forEach(function (key) {
|
|
98
|
+
if (key === "default" || key === "__esModule") return;
|
|
99
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
100
|
+
if (key in exports && exports[key] === _V[key]) return;
|
|
101
|
+
Object.defineProperty(exports, key, {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () {
|
|
104
|
+
return _V[key];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { TextInput, TextareaInput, ChoicesInput, SelectInput, QueryCombobox, QuerySelect, RatingsInput, Checkbox, QueryChoices, LinkInput, EditorInput } from "../fields";
|
|
6
|
+
import { TextInput as TextInputV1, TextareaInput as TextareaInputV1, ChoicesInput as ChoicesInputV1, SelectInput as SelectInputV1, QueryCombobox as QueryComboboxV1, QuerySelect as QuerySelectV1, RatingsInput as RatingsInputV1, Checkbox as CheckboxV1, QueryChoices as QueryChoicesV1, LinkInput as LinkInputV1, EditorInput as EditorInputV1, TextInputV2, TextareaInputV2, ChoicesInputV2, SelectInputV2, QueryComboboxV2, QuerySelectV2, RatingsInputV2, CheckboxV2, QueryChoicesV2, LinkInputV2, EditorInputV2 } from "../fields";
|
|
7
7
|
import "./styles.scss";
|
|
8
8
|
|
|
9
9
|
// Local Definitions
|
|
@@ -20,9 +20,34 @@ const FormInput = ({
|
|
|
20
20
|
type,
|
|
21
21
|
extraTypes,
|
|
22
22
|
disabled,
|
|
23
|
+
isVersionTwo,
|
|
23
24
|
...otherProps
|
|
24
25
|
}) => {
|
|
25
26
|
const newClassName = [className, componentClassName].filter(Boolean).join(' ');
|
|
27
|
+
let TextInput = TextInputV1;
|
|
28
|
+
let TextareaInput = TextareaInputV1;
|
|
29
|
+
let ChoicesInput = ChoicesInputV1;
|
|
30
|
+
let SelectInput = SelectInputV1;
|
|
31
|
+
let QueryCombobox = QueryComboboxV1;
|
|
32
|
+
let QuerySelect = QuerySelectV1;
|
|
33
|
+
let RatingsInput = RatingsInputV1;
|
|
34
|
+
let Checkbox = CheckboxV1;
|
|
35
|
+
let QueryChoices = QueryChoicesV1;
|
|
36
|
+
let LinkInput = LinkInputV1;
|
|
37
|
+
let EditorInput = EditorInputV1;
|
|
38
|
+
if (isVersionTwo) {
|
|
39
|
+
TextInput = TextInputV2;
|
|
40
|
+
TextareaInput = TextareaInputV2;
|
|
41
|
+
ChoicesInput = ChoicesInputV2;
|
|
42
|
+
SelectInput = SelectInputV2;
|
|
43
|
+
QueryCombobox = QueryComboboxV2;
|
|
44
|
+
QuerySelect = QuerySelectV2;
|
|
45
|
+
RatingsInput = RatingsInputV2;
|
|
46
|
+
Checkbox = CheckboxV2;
|
|
47
|
+
QueryChoices = QueryChoicesV2;
|
|
48
|
+
LinkInput = LinkInputV2;
|
|
49
|
+
EditorInput = EditorInputV2;
|
|
50
|
+
}
|
|
26
51
|
if (type === 'textarea') {
|
|
27
52
|
return /*#__PURE__*/React.createElement(TextareaInput, _extends({
|
|
28
53
|
className: newClassName,
|
|
@@ -113,9 +138,14 @@ FormInput.propTypes = {
|
|
|
113
138
|
/**
|
|
114
139
|
* Whether the Form input input should be disabled
|
|
115
140
|
*/
|
|
116
|
-
disabled: PropTypes.bool
|
|
141
|
+
disabled: PropTypes.bool,
|
|
142
|
+
/**
|
|
143
|
+
* Whethe the Form input is version 2
|
|
144
|
+
*/
|
|
145
|
+
isVersionTwo: PropTypes.bool
|
|
117
146
|
};
|
|
118
147
|
FormInput.defaultProps = {
|
|
119
|
-
disabled: false
|
|
148
|
+
disabled: false,
|
|
149
|
+
isVersionTwo: false
|
|
120
150
|
};
|
|
121
151
|
export default /*#__PURE__*/memo(FormInput);
|