@panneau/field-number 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 +40 -34
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
1
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import isNaN from 'lodash-es/isNaN';
|
|
6
7
|
import isNumber from 'lodash-es/isNumber';
|
|
7
|
-
import
|
|
8
|
+
import { useCallback, useState } from 'react';
|
|
8
9
|
import Icon from '@panneau/element-icon';
|
|
9
10
|
import TextField from '@panneau/field-text';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
12
|
|
|
11
13
|
var styles = {"container":"panneau-field-number-container","arrow":"panneau-field-number-arrow","dataListItems":"panneau-field-number-dataListItems","dataListItem":"panneau-field-number-dataListItem","dataListItemButton":"panneau-field-number-dataListItemButton"};
|
|
12
14
|
|
|
@@ -85,39 +87,43 @@ function NumberField(_ref) {
|
|
|
85
87
|
setDataListActive(false);
|
|
86
88
|
}
|
|
87
89
|
}, [onChange, setDataListActive, parseValue]);
|
|
88
|
-
return /*#__PURE__*/
|
|
89
|
-
className: classNames([styles.container, _defineProperty({}, className, className !== null)])
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
90
|
+
return /*#__PURE__*/jsxs("div", {
|
|
91
|
+
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
92
|
+
children: [/*#__PURE__*/jsx(TextField, _objectSpread({
|
|
93
|
+
type: "number",
|
|
94
|
+
className: styles.input,
|
|
95
|
+
value: value !== null ? "".concat(value) : '',
|
|
96
|
+
step: _float ? floatStep : step,
|
|
97
|
+
autoComplete: autoComplete ? 'on' : 'off',
|
|
98
|
+
onChange: onInputChange,
|
|
99
|
+
onFocus: onInputFocus,
|
|
100
|
+
onBlur: onInputBlur,
|
|
101
|
+
disabled: disabled
|
|
102
|
+
}, props)), !disabled && hasDataList ? /*#__PURE__*/jsx("div", {
|
|
103
|
+
className: styles.arrow,
|
|
104
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
105
|
+
name: dataListActive ? 'caret-up' : 'caret-down'
|
|
106
|
+
})
|
|
107
|
+
}) : null, !disabled && hasDataList && dataListActive ? /*#__PURE__*/jsx("ul", {
|
|
108
|
+
className: styles.dataListItems,
|
|
109
|
+
children: dataList.map(function (dataListValue) {
|
|
110
|
+
return /*#__PURE__*/jsx("li", {
|
|
111
|
+
className: styles.dataListItem,
|
|
112
|
+
children: /*#__PURE__*/jsx("button", {
|
|
113
|
+
className: styles.dataListItemButton,
|
|
114
|
+
type: "button",
|
|
115
|
+
onTouchStart: function onTouchStart() {
|
|
116
|
+
onDataListClick(dataListValue);
|
|
117
|
+
},
|
|
118
|
+
onMouseDown: function onMouseDown() {
|
|
119
|
+
onDataListClick(dataListValue);
|
|
120
|
+
},
|
|
121
|
+
children: dataListValue
|
|
122
|
+
})
|
|
123
|
+
}, "data-list-".concat(dataListValue));
|
|
124
|
+
})
|
|
125
|
+
}) : null]
|
|
126
|
+
});
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
var definition = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-number",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "A number field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/runtime": "^7.12.5",
|
|
62
|
-
"@panneau/core": "^4.0.
|
|
63
|
-
"@panneau/element-icon": "^4.0.
|
|
64
|
-
"@panneau/field-text": "^4.0.
|
|
65
|
-
"@panneau/themes": "^4.0.
|
|
62
|
+
"@panneau/core": "^4.0.4",
|
|
63
|
+
"@panneau/element-icon": "^4.0.4",
|
|
64
|
+
"@panneau/field-text": "^4.0.4",
|
|
65
|
+
"@panneau/themes": "^4.0.4",
|
|
66
66
|
"classnames": "^2.5.1",
|
|
67
67
|
"lodash-es": "^4.17.21",
|
|
68
68
|
"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
|
}
|