@panneau/field-text 4.0.1 → 4.0.4
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/es/index.js +24 -23
- package/package.json +5 -5
package/es/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import isEmpty from 'lodash-es/isEmpty';
|
|
6
|
+
import { useMemo } from 'react';
|
|
6
7
|
import { v1 } from 'uuid';
|
|
7
8
|
import InputGroup from '@panneau/field-input-group';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
10
|
|
|
9
11
|
var definition = [{
|
|
10
12
|
id: 'text',
|
|
@@ -109,56 +111,55 @@ function InputField(_ref) {
|
|
|
109
111
|
var _ref4 = elProps;
|
|
110
112
|
_ref4.horizontal;
|
|
111
113
|
var cleanProps = _objectWithoutProperties(_ref4, _excluded);
|
|
112
|
-
var inputElement = type !== 'textarea' ? /*#__PURE__*/
|
|
114
|
+
var inputElement = type !== 'textarea' ? /*#__PURE__*/jsx("input", _objectSpread(_objectSpread({}, cleanProps), {}, {
|
|
113
115
|
style: style || undefined
|
|
114
|
-
})) : /*#__PURE__*/
|
|
116
|
+
})) : /*#__PURE__*/jsx("textarea", _objectSpread({
|
|
115
117
|
style: style || undefined
|
|
116
118
|
}, cleanProps));
|
|
117
119
|
var withInputGroup = prepend !== null || append !== null;
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
121
|
+
children: [withInputGroup ? /*#__PURE__*/jsx(InputGroup, {
|
|
122
|
+
prepend: prepend,
|
|
123
|
+
append: append,
|
|
124
|
+
children: inputElement
|
|
125
|
+
}) : inputElement, dataListId !== null ? /*#__PURE__*/jsx("datalist", {
|
|
126
|
+
id: dataListId,
|
|
127
|
+
children: dataList.map(function (data, dataIndex) {
|
|
128
|
+
return /*#__PURE__*/jsx("option", {
|
|
129
|
+
children: data
|
|
130
|
+
}, "option-".concat(dataIndex));
|
|
131
|
+
})
|
|
132
|
+
}) : null]
|
|
133
|
+
});
|
|
128
134
|
}
|
|
129
135
|
// React.forwardRef((props, ref) => <InputField inputRef={ref} {...props} />);
|
|
130
136
|
|
|
131
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
132
137
|
function EmailField(props) {
|
|
133
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
134
139
|
type: "email"
|
|
135
140
|
}));
|
|
136
141
|
}
|
|
137
142
|
|
|
138
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
139
143
|
function PasswordField(props) {
|
|
140
|
-
return /*#__PURE__*/
|
|
144
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
141
145
|
type: "password"
|
|
142
146
|
}));
|
|
143
147
|
}
|
|
144
148
|
|
|
145
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
146
149
|
function TelephoneField(props) {
|
|
147
|
-
return /*#__PURE__*/
|
|
150
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
148
151
|
type: "tel"
|
|
149
152
|
}));
|
|
150
153
|
}
|
|
151
154
|
|
|
152
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
153
155
|
function TextareaField(props) {
|
|
154
|
-
return /*#__PURE__*/
|
|
156
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
155
157
|
type: "textarea"
|
|
156
158
|
}));
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
160
161
|
function TextField(props) {
|
|
161
|
-
return /*#__PURE__*/
|
|
162
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
162
163
|
type: "text"
|
|
163
164
|
}));
|
|
164
165
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-text",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "A text field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.12.5",
|
|
62
|
-
"@panneau/core": "^4.0.
|
|
63
|
-
"@panneau/field-input-group": "^4.0.
|
|
64
|
-
"@panneau/themes": "^4.0.
|
|
62
|
+
"@panneau/core": "^4.0.4",
|
|
63
|
+
"@panneau/field-input-group": "^4.0.4",
|
|
64
|
+
"@panneau/themes": "^4.0.4",
|
|
65
65
|
"classnames": "^2.5.1",
|
|
66
66
|
"lodash-es": "^4.17.21",
|
|
67
67
|
"prop-types": "^15.7.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
|
|
74
74
|
}
|