@panneau/field-number 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 +39 -33
  2. package/package.json +6 -6
package/es/index.js CHANGED
@@ -1,3 +1,4 @@
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';
@@ -7,6 +8,7 @@ import isNumber from 'lodash-es/isNumber';
7
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__*/React.createElement("div", {
89
- className: classNames([styles.container, _defineProperty({}, className, className !== null)])
90
- }, /*#__PURE__*/React.createElement(TextField, Object.assign({
91
- type: "number",
92
- className: styles.input,
93
- value: value !== null ? "".concat(value) : '',
94
- step: _float ? floatStep : step,
95
- autoComplete: autoComplete ? 'on' : 'off',
96
- onChange: onInputChange,
97
- onFocus: onInputFocus,
98
- onBlur: onInputBlur,
99
- disabled: disabled
100
- }, props)), !disabled && hasDataList ? /*#__PURE__*/React.createElement("div", {
101
- className: styles.arrow
102
- }, /*#__PURE__*/React.createElement(Icon, {
103
- name: dataListActive ? 'caret-up' : 'caret-down'
104
- })) : null, !disabled && hasDataList && dataListActive ? /*#__PURE__*/React.createElement("ul", {
105
- className: styles.dataListItems
106
- }, dataList.map(function (dataListValue) {
107
- return /*#__PURE__*/React.createElement("li", {
108
- key: "data-list-".concat(dataListValue),
109
- className: styles.dataListItem
110
- }, /*#__PURE__*/React.createElement("button", {
111
- className: styles.dataListItemButton,
112
- type: "button",
113
- onTouchStart: function onTouchStart() {
114
- onDataListClick(dataListValue);
115
- },
116
- onMouseDown: function onMouseDown() {
117
- onDataListClick(dataListValue);
118
- }
119
- }, dataListValue));
120
- })) : null);
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.2",
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.2",
63
- "@panneau/element-icon": "^4.0.2",
64
- "@panneau/field-text": "^4.0.2",
65
- "@panneau/themes": "^4.0.2",
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": "53ad0f27e467992c23158732e0f7d39d8615780b"
73
+ "gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
74
74
  }