@elliemae/ds-number-range-field 2.0.0-next.0 → 2.0.0-next.13
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/cjs/DSNumberRangeField.js +34 -31
- package/cjs/impl/NumberRangeFieldImpl.js +29 -23
- package/cjs/stories/DSNumberRangeField-overview.stories.js +1 -0
- package/esm/DSNumberRangeField.js +34 -31
- package/esm/impl/NumberRangeFieldImpl.js +25 -18
- package/esm/stories/DSNumberRangeField-overview.stories.js +1 -0
- package/package.json +5 -3
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -11,37 +11,40 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
|
|
12
12
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
13
|
|
|
14
|
-
const DSNumberRangeField =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
14
|
+
const DSNumberRangeField = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
containerProps = {},
|
|
17
|
+
maxFrom = null,
|
|
18
|
+
minFrom = 0,
|
|
19
|
+
maxTo = null,
|
|
20
|
+
minTo = 0,
|
|
21
|
+
onChange = () => null,
|
|
22
|
+
placeholderFrom = 'From',
|
|
23
|
+
placeholderTo = 'To',
|
|
24
|
+
stepFrom = 1,
|
|
25
|
+
stepTo = 1,
|
|
26
|
+
value = [],
|
|
27
|
+
separator = '-',
|
|
28
|
+
maskOptions,
|
|
29
|
+
type
|
|
30
|
+
} = _ref;
|
|
31
|
+
return /*#__PURE__*/_jsx__default["default"](NumberRangeFieldImpl, {
|
|
32
|
+
containerProps: containerProps,
|
|
33
|
+
maxFrom: maxFrom,
|
|
34
|
+
maxTo: maxTo,
|
|
35
|
+
minFrom: minFrom,
|
|
36
|
+
minTo: minTo,
|
|
37
|
+
onChange: onChange,
|
|
38
|
+
placeholderFrom: placeholderFrom,
|
|
39
|
+
placeholderTo: placeholderTo,
|
|
40
|
+
separator: separator,
|
|
41
|
+
stepFrom: stepFrom,
|
|
42
|
+
stepTo: stepTo,
|
|
43
|
+
value: value,
|
|
44
|
+
maskOptions: maskOptions,
|
|
45
|
+
type: type
|
|
46
|
+
});
|
|
47
|
+
};
|
|
45
48
|
|
|
46
49
|
const numberRangeFieldProps = {
|
|
47
50
|
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
11
|
var react = require('react');
|
|
6
12
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
7
|
-
var
|
|
13
|
+
var dsForm = require('@elliemae/ds-form');
|
|
8
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
15
|
|
|
10
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
17
|
|
|
12
18
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
19
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
-
var DSInputMask__default = /*#__PURE__*/_interopDefaultLegacy(DSInputMask);
|
|
15
20
|
|
|
16
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
22
|
|
|
@@ -22,22 +27,23 @@ const {
|
|
|
22
27
|
classNameBlock
|
|
23
28
|
} = dsClassnames.convertPropToCssClassName('query-builder-addon-number-range-field');
|
|
24
29
|
|
|
25
|
-
const DSSearchFieldImpl =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
const DSSearchFieldImpl = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
onChange,
|
|
33
|
+
containerProps,
|
|
34
|
+
maxFrom,
|
|
35
|
+
maxTo,
|
|
36
|
+
minFrom,
|
|
37
|
+
minTo,
|
|
38
|
+
placeholderFrom,
|
|
39
|
+
placeholderTo,
|
|
40
|
+
separator,
|
|
41
|
+
stepFrom,
|
|
42
|
+
stepTo,
|
|
43
|
+
value,
|
|
44
|
+
maskOptions,
|
|
45
|
+
type
|
|
46
|
+
} = _ref;
|
|
41
47
|
const [valueFrom, setValueFrom] = react.useState();
|
|
42
48
|
const [valueTo, setValueTo] = react.useState();
|
|
43
49
|
react.useEffect(() => {
|
|
@@ -61,17 +67,17 @@ const DSSearchFieldImpl = ({
|
|
|
61
67
|
}, maskOptions);
|
|
62
68
|
|
|
63
69
|
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
64
|
-
className:
|
|
70
|
+
className: "".concat(cssClassName),
|
|
65
71
|
children: /*#__PURE__*/_jsx__default["default"]("div", {
|
|
66
72
|
className: classNameBlock('wrapper')
|
|
67
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
73
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSInputMask, {
|
|
68
74
|
type: type,
|
|
69
75
|
max: maxFrom,
|
|
70
76
|
min: minFrom,
|
|
71
77
|
step: stepFrom,
|
|
72
78
|
value: valueFrom === null || valueFrom === void 0 ? void 0 : valueFrom.toString(),
|
|
73
79
|
placeholder: placeholderFrom,
|
|
74
|
-
mask: number =>
|
|
80
|
+
mask: number => dsForm.MASK_TYPES.NUMBER(maskConfig)(number),
|
|
75
81
|
onChange: e => {
|
|
76
82
|
const newValueFrom = e.target.value;
|
|
77
83
|
handleOnChange(newValueFrom, valueTo);
|
|
@@ -79,14 +85,14 @@ const DSSearchFieldImpl = ({
|
|
|
79
85
|
"data-testid": "ds-number-range-field__from-input"
|
|
80
86
|
}), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
81
87
|
className: classNameElement('separator')
|
|
82
|
-
}, void 0, separator), /*#__PURE__*/_jsx__default["default"](
|
|
88
|
+
}, void 0, separator), /*#__PURE__*/_jsx__default["default"](dsForm.DSInputMask, {
|
|
83
89
|
type: type,
|
|
84
90
|
max: maxTo,
|
|
85
91
|
min: minTo,
|
|
86
92
|
step: stepTo,
|
|
87
93
|
value: valueTo === null || valueTo === void 0 ? void 0 : valueTo.toString(),
|
|
88
94
|
placeholder: placeholderTo,
|
|
89
|
-
mask: number =>
|
|
95
|
+
mask: number => dsForm.MASK_TYPES.NUMBER(maskConfig)(number),
|
|
90
96
|
onChange: e => {
|
|
91
97
|
const newValueTo = e.target.value;
|
|
92
98
|
handleOnChange(valueFrom, newValueTo);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
7
|
var react = require('react');
|
|
7
8
|
var DSNumberRangeField = require('@elliemae/ds-number-range-field');
|
|
8
9
|
|
|
@@ -3,37 +3,40 @@ import 'react';
|
|
|
3
3
|
import { PropTypes, describe } from 'react-desc';
|
|
4
4
|
import DSSearchFieldImpl from './impl/NumberRangeFieldImpl.js';
|
|
5
5
|
|
|
6
|
-
const DSNumberRangeField =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
6
|
+
const DSNumberRangeField = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
containerProps = {},
|
|
9
|
+
maxFrom = null,
|
|
10
|
+
minFrom = 0,
|
|
11
|
+
maxTo = null,
|
|
12
|
+
minTo = 0,
|
|
13
|
+
onChange = () => null,
|
|
14
|
+
placeholderFrom = 'From',
|
|
15
|
+
placeholderTo = 'To',
|
|
16
|
+
stepFrom = 1,
|
|
17
|
+
stepTo = 1,
|
|
18
|
+
value = [],
|
|
19
|
+
separator = '-',
|
|
20
|
+
maskOptions,
|
|
21
|
+
type
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/_jsx(DSSearchFieldImpl, {
|
|
24
|
+
containerProps: containerProps,
|
|
25
|
+
maxFrom: maxFrom,
|
|
26
|
+
maxTo: maxTo,
|
|
27
|
+
minFrom: minFrom,
|
|
28
|
+
minTo: minTo,
|
|
29
|
+
onChange: onChange,
|
|
30
|
+
placeholderFrom: placeholderFrom,
|
|
31
|
+
placeholderTo: placeholderTo,
|
|
32
|
+
separator: separator,
|
|
33
|
+
stepFrom: stepFrom,
|
|
34
|
+
stepTo: stepTo,
|
|
35
|
+
value: value,
|
|
36
|
+
maskOptions: maskOptions,
|
|
37
|
+
type: type
|
|
38
|
+
});
|
|
39
|
+
};
|
|
37
40
|
|
|
38
41
|
const numberRangeFieldProps = {
|
|
39
42
|
containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
9
|
import { useState, useEffect } from 'react';
|
|
4
10
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
5
|
-
import DSInputMask,
|
|
11
|
+
import { DSInputMask, MASK_TYPES } from '@elliemae/ds-form';
|
|
6
12
|
import { jsx } from 'react/jsx-runtime';
|
|
7
13
|
|
|
8
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -14,22 +20,23 @@ const {
|
|
|
14
20
|
classNameBlock
|
|
15
21
|
} = convertPropToCssClassName('query-builder-addon-number-range-field');
|
|
16
22
|
|
|
17
|
-
const DSSearchFieldImpl =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
const DSSearchFieldImpl = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
onChange,
|
|
26
|
+
containerProps,
|
|
27
|
+
maxFrom,
|
|
28
|
+
maxTo,
|
|
29
|
+
minFrom,
|
|
30
|
+
minTo,
|
|
31
|
+
placeholderFrom,
|
|
32
|
+
placeholderTo,
|
|
33
|
+
separator,
|
|
34
|
+
stepFrom,
|
|
35
|
+
stepTo,
|
|
36
|
+
value,
|
|
37
|
+
maskOptions,
|
|
38
|
+
type
|
|
39
|
+
} = _ref;
|
|
33
40
|
const [valueFrom, setValueFrom] = useState();
|
|
34
41
|
const [valueTo, setValueTo] = useState();
|
|
35
42
|
useEffect(() => {
|
|
@@ -53,7 +60,7 @@ const DSSearchFieldImpl = ({
|
|
|
53
60
|
}, maskOptions);
|
|
54
61
|
|
|
55
62
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
56
|
-
className:
|
|
63
|
+
className: "".concat(cssClassName),
|
|
57
64
|
children: /*#__PURE__*/_jsx("div", {
|
|
58
65
|
className: classNameBlock('wrapper')
|
|
59
66
|
}, void 0, /*#__PURE__*/_jsx(DSInputMask, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-number-range-field",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Number Range Field",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -40,8 +40,10 @@
|
|
|
40
40
|
"build": "node ../../scripts/build/build.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-basic": "2.0.0-next.
|
|
44
|
-
"@elliemae/ds-classnames": "2.0.0-next.
|
|
43
|
+
"@elliemae/ds-basic": "2.0.0-next.13",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-next.13",
|
|
45
|
+
"@elliemae/ds-number-range-field": "2.0.0-next.13",
|
|
46
|
+
"react-desc": "~4.1.3"
|
|
45
47
|
},
|
|
46
48
|
"peerDependencies": {
|
|
47
49
|
"lodash": "^4.17.21",
|
package/cjs/package.json
DELETED