@panneau/field-text 4.0.2 → 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 +23 -17
- package/package.json +5 -5
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
1
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
4
|
import classNames from 'classnames';
|
|
@@ -5,6 +6,7 @@ import isEmpty from 'lodash-es/isEmpty';
|
|
|
5
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,51 +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
137
|
function EmailField(props) {
|
|
132
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
133
139
|
type: "email"
|
|
134
140
|
}));
|
|
135
141
|
}
|
|
136
142
|
|
|
137
143
|
function PasswordField(props) {
|
|
138
|
-
return /*#__PURE__*/
|
|
144
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
139
145
|
type: "password"
|
|
140
146
|
}));
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
function TelephoneField(props) {
|
|
144
|
-
return /*#__PURE__*/
|
|
150
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
145
151
|
type: "tel"
|
|
146
152
|
}));
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
function TextareaField(props) {
|
|
150
|
-
return /*#__PURE__*/
|
|
156
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
151
157
|
type: "textarea"
|
|
152
158
|
}));
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
function TextField(props) {
|
|
156
|
-
return /*#__PURE__*/
|
|
162
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
157
163
|
type: "text"
|
|
158
164
|
}));
|
|
159
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
|
}
|