@panneau/field-text 4.0.2 → 4.0.5
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 -18
- 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,54 @@ 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
|
-
// React.forwardRef((props, ref) => <InputField inputRef={ref} {...props} />);
|
|
130
135
|
|
|
131
136
|
function EmailField(props) {
|
|
132
|
-
return /*#__PURE__*/
|
|
137
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
133
138
|
type: "email"
|
|
134
139
|
}));
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
function PasswordField(props) {
|
|
138
|
-
return /*#__PURE__*/
|
|
143
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
139
144
|
type: "password"
|
|
140
145
|
}));
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
function TelephoneField(props) {
|
|
144
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
145
150
|
type: "tel"
|
|
146
151
|
}));
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
function TextareaField(props) {
|
|
150
|
-
return /*#__PURE__*/
|
|
155
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
151
156
|
type: "textarea"
|
|
152
157
|
}));
|
|
153
158
|
}
|
|
154
159
|
|
|
155
160
|
function TextField(props) {
|
|
156
|
-
return /*#__PURE__*/
|
|
161
|
+
return /*#__PURE__*/jsx(InputField, _objectSpread(_objectSpread({}, props), {}, {
|
|
157
162
|
type: "text"
|
|
158
163
|
}));
|
|
159
164
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-text",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
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.5",
|
|
63
|
+
"@panneau/field-input-group": "^4.0.5",
|
|
64
|
+
"@panneau/themes": "^4.0.5",
|
|
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": "ac8b065e8c7ada1d176d15eff1c0fa53599ad31f"
|
|
74
74
|
}
|