@elliemae/ds-number-range-field 2.0.0-alpha.11 → 2.0.0-alpha.12
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 +27 -22
- package/esm/DSNumberRangeField.js +34 -31
- package/esm/impl/NumberRangeFieldImpl.js +23 -17
- package/package.json +5 -3
- package/types/DSNumberRangeField.d.ts +83 -14
|
@@ -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'),
|
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
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');
|
|
6
11
|
var react = require('react');
|
|
7
12
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
8
|
-
var
|
|
13
|
+
var dsForm = require('@elliemae/ds-form');
|
|
9
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
15
|
|
|
11
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
17
|
|
|
13
18
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
14
19
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
|
-
var DSInputMask__default = /*#__PURE__*/_interopDefaultLegacy(DSInputMask);
|
|
16
20
|
|
|
17
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; }
|
|
18
22
|
|
|
@@ -23,22 +27,23 @@ const {
|
|
|
23
27
|
classNameBlock
|
|
24
28
|
} = dsClassnames.convertPropToCssClassName('query-builder-addon-number-range-field');
|
|
25
29
|
|
|
26
|
-
const DSSearchFieldImpl =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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;
|
|
42
47
|
const [valueFrom, setValueFrom] = react.useState();
|
|
43
48
|
const [valueTo, setValueTo] = react.useState();
|
|
44
49
|
react.useEffect(() => {
|
|
@@ -65,14 +70,14 @@ const DSSearchFieldImpl = ({
|
|
|
65
70
|
className: "".concat(cssClassName),
|
|
66
71
|
children: /*#__PURE__*/_jsx__default["default"]("div", {
|
|
67
72
|
className: classNameBlock('wrapper')
|
|
68
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
73
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSInputMask, {
|
|
69
74
|
type: type,
|
|
70
75
|
max: maxFrom,
|
|
71
76
|
min: minFrom,
|
|
72
77
|
step: stepFrom,
|
|
73
78
|
value: valueFrom === null || valueFrom === void 0 ? void 0 : valueFrom.toString(),
|
|
74
79
|
placeholder: placeholderFrom,
|
|
75
|
-
mask: number =>
|
|
80
|
+
mask: number => dsForm.MASK_TYPES.NUMBER(maskConfig)(number),
|
|
76
81
|
onChange: e => {
|
|
77
82
|
const newValueFrom = e.target.value;
|
|
78
83
|
handleOnChange(newValueFrom, valueTo);
|
|
@@ -80,14 +85,14 @@ const DSSearchFieldImpl = ({
|
|
|
80
85
|
"data-testid": "ds-number-range-field__from-input"
|
|
81
86
|
}), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
82
87
|
className: classNameElement('separator')
|
|
83
|
-
}, void 0, separator), /*#__PURE__*/_jsx__default["default"](
|
|
88
|
+
}, void 0, separator), /*#__PURE__*/_jsx__default["default"](dsForm.DSInputMask, {
|
|
84
89
|
type: type,
|
|
85
90
|
max: maxTo,
|
|
86
91
|
min: minTo,
|
|
87
92
|
step: stepTo,
|
|
88
93
|
value: valueTo === null || valueTo === void 0 ? void 0 : valueTo.toString(),
|
|
89
94
|
placeholder: placeholderTo,
|
|
90
|
-
mask: number =>
|
|
95
|
+
mask: number => dsForm.MASK_TYPES.NUMBER(maskConfig)(number),
|
|
91
96
|
onChange: e => {
|
|
92
97
|
const newValueTo = e.target.value;
|
|
93
98
|
handleOnChange(valueFrom, newValueTo);
|
|
@@ -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,9 +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';
|
|
3
8
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
9
|
import { useState, useEffect } from 'react';
|
|
5
10
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
6
|
-
import DSInputMask,
|
|
11
|
+
import { DSInputMask, MASK_TYPES } from '@elliemae/ds-form';
|
|
7
12
|
import { jsx } from 'react/jsx-runtime';
|
|
8
13
|
|
|
9
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; }
|
|
@@ -15,22 +20,23 @@ const {
|
|
|
15
20
|
classNameBlock
|
|
16
21
|
} = convertPropToCssClassName('query-builder-addon-number-range-field');
|
|
17
22
|
|
|
18
|
-
const DSSearchFieldImpl =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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;
|
|
34
40
|
const [valueFrom, setValueFrom] = useState();
|
|
35
41
|
const [valueTo, setValueTo] = useState();
|
|
36
42
|
useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-number-range-field",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
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-
|
|
44
|
-
"@elliemae/ds-
|
|
43
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
44
|
+
"@elliemae/ds-form": "2.0.0-alpha.12",
|
|
45
|
+
"@elliemae/ds-number-range-field": "2.0.0-alpha.12",
|
|
46
|
+
"react-desc": "~4.1.3"
|
|
45
47
|
},
|
|
46
48
|
"peerDependencies": {
|
|
47
49
|
"lodash": "^4.17.21",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const DSNumberRangeField: {
|
|
3
4
|
({ containerProps, maxFrom, minFrom, maxTo, minTo, onChange, placeholderFrom, placeholderTo, stepFrom, stepTo, value, separator, maskOptions, type, }: {
|
|
@@ -17,22 +18,90 @@ declare const DSNumberRangeField: {
|
|
|
17
18
|
type: any;
|
|
18
19
|
}): JSX.Element;
|
|
19
20
|
propTypes: {
|
|
20
|
-
containerProps:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
containerProps: {
|
|
22
|
+
defaultValue<T = unknown>(arg: T): {
|
|
23
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
24
|
+
};
|
|
25
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
maxFrom: {
|
|
28
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
minFrom: {
|
|
31
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
+
};
|
|
33
|
+
maxTo: {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
minTo: {
|
|
37
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
onChange: {
|
|
40
|
+
defaultValue<T = unknown>(arg: T): {
|
|
41
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
placeholderFrom: {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
placeholderTo: {
|
|
49
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
stepFrom: {
|
|
52
|
+
defaultValue<T = unknown>(arg: T): {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
stepTo: {
|
|
58
|
+
defaultValue<T = unknown>(arg: T): {
|
|
59
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
+
};
|
|
61
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
value: {
|
|
64
|
+
defaultValue<T = unknown>(arg: T): {
|
|
65
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
68
|
+
};
|
|
69
|
+
separator: {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
72
|
+
maskOptions: {
|
|
73
|
+
defaultValue<T = unknown>(arg: T): {
|
|
74
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
75
|
+
};
|
|
76
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
78
|
+
type: {
|
|
79
|
+
defaultValue<T = unknown>(arg: T): {
|
|
80
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
81
|
+
};
|
|
82
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
declare const NumberRangeFieldWithSchema: {
|
|
87
|
+
(props?: {
|
|
88
|
+
containerProps?: {} | undefined;
|
|
89
|
+
maxFrom?: null | undefined;
|
|
90
|
+
minFrom?: number | undefined;
|
|
91
|
+
maxTo?: null | undefined;
|
|
92
|
+
minTo?: number | undefined;
|
|
93
|
+
onChange?: (() => null) | undefined;
|
|
94
|
+
placeholderFrom?: string | undefined;
|
|
95
|
+
placeholderTo?: string | undefined;
|
|
96
|
+
stepFrom?: number | undefined;
|
|
97
|
+
stepTo?: number | undefined;
|
|
98
|
+
value?: never[] | undefined;
|
|
99
|
+
separator?: string | undefined;
|
|
32
100
|
maskOptions: any;
|
|
33
101
|
type: any;
|
|
34
|
-
};
|
|
102
|
+
} | undefined): JSX.Element;
|
|
103
|
+
propTypes: unknown;
|
|
104
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
35
105
|
};
|
|
36
|
-
declare const NumberRangeFieldWithSchema: any;
|
|
37
106
|
export { NumberRangeFieldWithSchema };
|
|
38
107
|
export default DSNumberRangeField;
|