@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.
Files changed (2) hide show
  1. package/es/index.js +23 -17
  2. 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__*/React.createElement("input", Object.assign({}, cleanProps, {
114
+ var inputElement = type !== 'textarea' ? /*#__PURE__*/jsx("input", _objectSpread(_objectSpread({}, cleanProps), {}, {
113
115
  style: style || undefined
114
- })) : /*#__PURE__*/React.createElement("textarea", Object.assign({
116
+ })) : /*#__PURE__*/jsx("textarea", _objectSpread({
115
117
  style: style || undefined
116
118
  }, cleanProps));
117
119
  var withInputGroup = prepend !== null || append !== null;
118
- return /*#__PURE__*/React.createElement(React.Fragment, null, withInputGroup ? /*#__PURE__*/React.createElement(InputGroup, {
119
- prepend: prepend,
120
- append: append
121
- }, inputElement) : inputElement, dataListId !== null ? /*#__PURE__*/React.createElement("datalist", {
122
- id: dataListId
123
- }, dataList.map(function (data, dataIndex) {
124
- return /*#__PURE__*/React.createElement("option", {
125
- key: "option-".concat(dataIndex)
126
- }, data);
127
- })) : null);
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__*/React.createElement(InputField, Object.assign({}, props, {
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__*/React.createElement(InputField, Object.assign({}, props, {
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__*/React.createElement(InputField, Object.assign({}, props, {
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__*/React.createElement(InputField, Object.assign({}, props, {
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__*/React.createElement(InputField, Object.assign({}, props, {
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.2",
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.2",
63
- "@panneau/field-input-group": "^4.0.2",
64
- "@panneau/themes": "^4.0.2",
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": "53ad0f27e467992c23158732e0f7d39d8615780b"
73
+ "gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
74
74
  }