@panneau/field-text 1.0.0-alpha.236 → 1.0.0-alpha.247
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 +5 -0
- package/lib/index.js +5 -0
- package/package.json +5 -5
package/es/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var propTypes$5 = {
|
|
|
33
33
|
errors: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
34
34
|
required: PropTypes.bool,
|
|
35
35
|
disabled: PropTypes.bool,
|
|
36
|
+
readOnly: PropTypes.bool,
|
|
36
37
|
nativeOnChange: PropTypes.bool,
|
|
37
38
|
type: PropTypes.oneOf(['text', 'email', 'tel', 'password', 'textarea', 'number']),
|
|
38
39
|
placeholder: PropTypes.string,
|
|
@@ -59,6 +60,7 @@ var defaultProps$5 = {
|
|
|
59
60
|
errors: null,
|
|
60
61
|
required: false,
|
|
61
62
|
disabled: false,
|
|
63
|
+
readOnly: false,
|
|
62
64
|
nativeOnChange: false,
|
|
63
65
|
type: null,
|
|
64
66
|
placeholder: null,
|
|
@@ -85,6 +87,7 @@ var InputField = function InputField(_ref) {
|
|
|
85
87
|
errors = _ref.errors,
|
|
86
88
|
required = _ref.required,
|
|
87
89
|
disabled = _ref.disabled,
|
|
90
|
+
readOnly = _ref.readOnly,
|
|
88
91
|
nativeOnChange = _ref.nativeOnChange,
|
|
89
92
|
type = _ref.type,
|
|
90
93
|
placeholder = _ref.placeholder,
|
|
@@ -104,6 +107,7 @@ var InputField = function InputField(_ref) {
|
|
|
104
107
|
var dataListId = useMemo(function () {
|
|
105
108
|
return dataList !== null ? v1() : null;
|
|
106
109
|
}, [dataList]);
|
|
110
|
+
console.log(readOnly);
|
|
107
111
|
var elProps = {
|
|
108
112
|
ref: inputRef,
|
|
109
113
|
className: classNames([styles.inputElement, 'form-control', (_ref2 = {}, _defineProperty(_ref2, "form-control-".concat(size), size !== null), _defineProperty(_ref2, 'is-valid', feedback === 'valid'), _defineProperty(_ref2, 'is-invalid', feedback === 'invalid' || errors !== null), _defineProperty(_ref2, className, className !== null), _ref2)]),
|
|
@@ -120,6 +124,7 @@ var InputField = function InputField(_ref) {
|
|
|
120
124
|
max: max,
|
|
121
125
|
required: required,
|
|
122
126
|
disabled: disabled,
|
|
127
|
+
readOnly: readOnly,
|
|
123
128
|
list: dataListId,
|
|
124
129
|
onChange: nativeOnChange ? onChange : function (_ref3) {
|
|
125
130
|
var _ref3$target$value = _ref3.target.value,
|
package/lib/index.js
CHANGED
|
@@ -47,6 +47,7 @@ var propTypes$5 = {
|
|
|
47
47
|
errors: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)]),
|
|
48
48
|
required: PropTypes__default["default"].bool,
|
|
49
49
|
disabled: PropTypes__default["default"].bool,
|
|
50
|
+
readOnly: PropTypes__default["default"].bool,
|
|
50
51
|
nativeOnChange: PropTypes__default["default"].bool,
|
|
51
52
|
type: PropTypes__default["default"].oneOf(['text', 'email', 'tel', 'password', 'textarea', 'number']),
|
|
52
53
|
placeholder: PropTypes__default["default"].string,
|
|
@@ -73,6 +74,7 @@ var defaultProps$5 = {
|
|
|
73
74
|
errors: null,
|
|
74
75
|
required: false,
|
|
75
76
|
disabled: false,
|
|
77
|
+
readOnly: false,
|
|
76
78
|
nativeOnChange: false,
|
|
77
79
|
type: null,
|
|
78
80
|
placeholder: null,
|
|
@@ -99,6 +101,7 @@ var InputField = function InputField(_ref) {
|
|
|
99
101
|
errors = _ref.errors,
|
|
100
102
|
required = _ref.required,
|
|
101
103
|
disabled = _ref.disabled,
|
|
104
|
+
readOnly = _ref.readOnly,
|
|
102
105
|
nativeOnChange = _ref.nativeOnChange,
|
|
103
106
|
type = _ref.type,
|
|
104
107
|
placeholder = _ref.placeholder,
|
|
@@ -118,6 +121,7 @@ var InputField = function InputField(_ref) {
|
|
|
118
121
|
var dataListId = React.useMemo(function () {
|
|
119
122
|
return dataList !== null ? uuid.v1() : null;
|
|
120
123
|
}, [dataList]);
|
|
124
|
+
console.log(readOnly);
|
|
121
125
|
var elProps = {
|
|
122
126
|
ref: inputRef,
|
|
123
127
|
className: classNames__default["default"]([styles.inputElement, 'form-control', (_ref2 = {}, _defineProperty__default["default"](_ref2, "form-control-".concat(size), size !== null), _defineProperty__default["default"](_ref2, 'is-valid', feedback === 'valid'), _defineProperty__default["default"](_ref2, 'is-invalid', feedback === 'invalid' || errors !== null), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)]),
|
|
@@ -134,6 +138,7 @@ var InputField = function InputField(_ref) {
|
|
|
134
138
|
max: max,
|
|
135
139
|
required: required,
|
|
136
140
|
disabled: disabled,
|
|
141
|
+
readOnly: readOnly,
|
|
137
142
|
list: dataListId,
|
|
138
143
|
onChange: nativeOnChange ? onChange : function (_ref3) {
|
|
139
144
|
var _ref3$target$value = _ref3.target.value,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-text",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.247",
|
|
4
4
|
"description": "A text field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/runtime": "^7.12.5",
|
|
56
|
-
"@panneau/core": "^1.0.0-alpha.
|
|
57
|
-
"@panneau/field-input-group": "^1.0.0-alpha.
|
|
58
|
-
"@panneau/themes": "^1.0.0-alpha.
|
|
56
|
+
"@panneau/core": "^1.0.0-alpha.242",
|
|
57
|
+
"@panneau/field-input-group": "^1.0.0-alpha.242",
|
|
58
|
+
"@panneau/themes": "^1.0.0-alpha.242",
|
|
59
59
|
"classnames": "^2.2.6",
|
|
60
60
|
"lodash": "^4.17.21",
|
|
61
61
|
"prop-types": "^15.7.2",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "cd40162975fef5731ec4879cddd205d02a0ec9ef"
|
|
68
68
|
}
|