@elliemae/ds-form 2.0.0-rc.6 → 2.0.0
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/ComboBox/v1/DSComboBox.js +18 -22
- package/cjs/ComboBox/v1/withSelectStringValueConverter.js +3 -4
- package/cjs/ComboBox/v3/ComboBoxCTX.js +16 -17
- package/cjs/ComboBox/v3/config/useComboBox.js +6 -6
- package/cjs/ComboBox/v3/parts/container/Container.js +1 -1
- package/cjs/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
- package/cjs/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
- package/cjs/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
- package/cjs/ComboBox/v3/parts/menu-list/MenuList.js +7 -8
- package/cjs/ComboBox/v3/parts/menu-list/styled.js +8 -4
- package/cjs/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
- package/cjs/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
- package/cjs/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
- package/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
- package/cjs/FormItem/ValidationFieldWrapper.js +2 -3
- package/cjs/Input/InputAddonWrapper.js +2 -3
- package/cjs/Input/InputImpl.js +16 -18
- package/cjs/InputGroup/AddonWrapper.js +4 -6
- package/cjs/InputMask/DSInputMaskDeprecated.js +10 -12
- package/cjs/SearchBox/NavSearchBox.js +5 -1
- package/cjs/SearchBox/withSearchable.js +3 -5
- package/cjs/Toggle/DSToggleImpl.js +28 -28
- package/esm/ComboBox/v1/DSComboBox.js +17 -21
- package/esm/ComboBox/v1/withSelectStringValueConverter.js +3 -4
- package/esm/ComboBox/v3/ComboBoxCTX.js +5 -6
- package/esm/ComboBox/v3/config/useComboBox.js +6 -6
- package/esm/ComboBox/v3/parts/container/Container.js +1 -1
- package/esm/ComboBox/v3/parts/controls-input/ControlsInput.js +5 -3
- package/esm/ComboBox/v3/parts/controls-input/useControlsInput.js +8 -8
- package/esm/ComboBox/v3/parts/header-list/HeaderList.js +5 -3
- package/esm/ComboBox/v3/parts/menu-list/MenuList.js +8 -9
- package/esm/ComboBox/v3/parts/menu-list/styled.js +8 -4
- package/esm/ComboBox/v3/parts/menu-list/useItemRenderer.js +10 -9
- package/esm/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +5 -5
- package/esm/ComboBox/v3/utils/hooks/useOnElementResize.js +4 -4
- package/esm/FloatingLabelInput/FloatingLabelInputImpl.js +4 -7
- package/esm/FormItem/ValidationFieldWrapper.js +2 -3
- package/esm/Input/InputAddonWrapper.js +2 -3
- package/esm/Input/InputImpl.js +15 -17
- package/esm/InputGroup/AddonWrapper.js +5 -7
- package/esm/InputMask/DSInputMaskDeprecated.js +10 -12
- package/esm/SearchBox/NavSearchBox.js +5 -1
- package/esm/SearchBox/withSearchable.js +2 -4
- package/esm/Toggle/DSToggleImpl.js +28 -28
- package/package.json +31 -23
- package/types/Checkbox/DSCheckbox.d.ts +78 -13
- package/types/Checkbox/props.d.ts +58 -12
- package/types/CheckboxGroup/DSCheckboxGroup.d.ts +51 -7
- package/types/CheckboxGroup/props.d.ts +37 -6
- package/types/ComboBox/v2/Combobox.d.ts +56 -1
- package/types/ComboBox/v3/ComboBox.d.ts +54 -16
- package/types/ComboBox/v3/parts/controls-input/useControlsInput.d.ts +3 -3
- package/types/ComboBox/v3/parts/dropdown-indicator/styled.d.ts +1 -60
- package/types/ComboBox/v3/parts/header-list/styled.d.ts +4 -208
- package/types/ComboBox/v3/parts/menu-list/styled.d.ts +4 -3
- package/types/ComboBox/v3/parts/menu-list/useItemRenderer.d.ts +1 -1
- package/types/ComboBox/v3/propTypes.d.ts +49 -15
- package/types/ComboBox/v3/utils/hooks/useKeyboardNavigation.d.ts +4 -1
- package/types/ComboBox/v3/utils/listHelper.d.ts +1 -1
- package/types/DateInput/DSDateInput.d.ts +97 -16
- package/types/DateInput/props.d.ts +97 -16
- package/types/DateInputV2/components/DSDateInput.d.ts +72 -5
- package/types/DateInputV2/components/props.d.ts +61 -10
- package/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +118 -20
- package/types/FormItem/DSFormItemLayout.d.ts +390 -60
- package/types/FormItem/Error/DSError.d.ts +21 -3
- package/types/FormItem/defaultProps.d.ts +118 -20
- package/types/FormItem/props.d.ts +229 -39
- package/types/InputGroup/DSInputGroup.d.ts +56 -8
- package/types/InputGroup/props.d.ts +43 -7
- package/types/InputMask/DSInputMask.d.ts +172 -30
- package/types/InputMask/mask_types/DateInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/DateTimeInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/DictionaryInputMask.d.ts +37 -36
- package/types/InputMask/mask_types/NumberInputMask.d.ts +46 -45
- package/types/InputMask/mask_types/PhoneInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/PhoneInternationalInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/SsnInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/UsZipCodeInputMask.d.ts +34 -33
- package/types/InputMask/mask_types/ZipCodeSearchInputMask.d.ts +34 -33
- package/types/InputMask/props.d.ts +172 -30
- package/types/InputProtected/DSInputProtected.d.ts +56 -7
- package/types/InputProtected/props.d.ts +43 -8
- package/types/LargeInputText/DSLargeInputText.d.ts +163 -27
- package/types/LargeInputText/props.d.ts +163 -27
- package/types/MenuItem/components/MenuItem/index.d.ts +12 -3
- package/types/MenuItem/components/MultiMenuItem/MultiMenuItem.d.ts +12 -3
- package/types/MenuItem/components/Section/index.d.ts +4 -1
- package/types/MenuItem/components/Section/props.d.ts +4 -1
- package/types/MenuItem/components/SingleMenuItem/SingleMenuItem.d.ts +7 -2
- package/types/MenuItem/components/SubmenuItem/index.d.ts +12 -3
- package/types/MenuItem/props.d.ts +7 -2
- package/types/Radio/DSRadio.d.ts +79 -13
- package/types/RadioGroup/DSRadioGroup.d.ts +51 -7
- package/types/RadioGroup/props.d.ts +37 -6
- package/types/SearchBox/DSSearchBox.d.ts +146 -21
- package/types/SearchBox/NavSearchBox.d.ts +18 -3
- package/types/SearchBox/SButton.d.ts +13 -2
- package/types/SearchBox/index.d.ts +1 -1
- package/types/SearchBox/props.d.ts +133 -22
- package/types/SearchBox/styled.d.ts +1 -49
- package/types/TextBox/DSTextBox.d.ts +146 -21
- package/types/TimeInput/DSTimeInput.d.ts +83 -12
- package/types/TimeInput/utils.d.ts +1 -1
- package/types/Toggle/DSToggle.d.ts +84 -12
- package/cjs/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -31
- package/esm/ComboBox/v3/utils/hooks/useOnWindowResize.js +0 -27
- package/types/ComboBox/v3/utils/hooks/useOnWindowResize.d.ts +0 -5
|
@@ -28,22 +28,25 @@ const useItemRenderer = () => {
|
|
|
28
28
|
inputRef,
|
|
29
29
|
setShowPopover,
|
|
30
30
|
focusOptionIdx,
|
|
31
|
-
virtualListHelpers
|
|
32
|
-
virtualItems
|
|
33
|
-
}
|
|
31
|
+
virtualListHelpers
|
|
34
32
|
} = useContext(ComboBoxContext);
|
|
33
|
+
const {
|
|
34
|
+
virtualItems
|
|
35
|
+
} = virtualListHelpers;
|
|
35
36
|
const multiple = Array.isArray(selectedValues);
|
|
36
37
|
const CBItem = multiple ? MultiMenuItem : SingleMenuItem;
|
|
37
38
|
const handleClick = useCallback((option, e) => {
|
|
39
|
+
var _inputRef$current;
|
|
40
|
+
|
|
38
41
|
if (!multiple) {
|
|
39
42
|
setShowPopover(false);
|
|
40
|
-
inputRef.current.value = '';
|
|
41
|
-
} else {
|
|
43
|
+
if (inputRef.current) inputRef.current.value = '';
|
|
44
|
+
} else if (inputRef.current) {
|
|
42
45
|
onFilter(inputRef.current.value);
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
onChange(option);
|
|
46
|
-
inputRef.current.focus();
|
|
49
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
47
50
|
e.stopPropagation();
|
|
48
51
|
e.preventDefault();
|
|
49
52
|
}, [onFilter, onChange, setShowPopover, multiple, inputRef]);
|
|
@@ -88,9 +91,7 @@ const useItemRenderer = () => {
|
|
|
88
91
|
|
|
89
92
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
90
93
|
}), [options, focusOptionIdx, selectedValues, inputRef, virtualItems]);
|
|
91
|
-
return
|
|
92
|
-
ItemRenderer
|
|
93
|
-
}), [ItemRenderer]);
|
|
94
|
+
return ItemRenderer;
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
export { useItemRenderer };
|
|
@@ -33,7 +33,7 @@ const useKeyboardNavigation = () => {
|
|
|
33
33
|
const currentItem = options.find(item => item.dsId === focusOptionIdx);
|
|
34
34
|
const selectOption = useCallback(() => {
|
|
35
35
|
if (multiple) {
|
|
36
|
-
onFilter(inputRef.current.value);
|
|
36
|
+
if (inputRef.current) onFilter(inputRef.current.value);
|
|
37
37
|
} else {
|
|
38
38
|
onFilter('');
|
|
39
39
|
if (inputRef.current) inputRef.current.value = '';
|
|
@@ -81,7 +81,6 @@ const useKeyboardNavigation = () => {
|
|
|
81
81
|
|
|
82
82
|
if (e.key === 'a' && e.ctrlKey && multiple) {
|
|
83
83
|
onSelectAll();
|
|
84
|
-
setShowPopover(false);
|
|
85
84
|
} // =============================================================================
|
|
86
85
|
// ARROWS UP AND DOWN
|
|
87
86
|
// =============================================================================
|
|
@@ -130,8 +129,7 @@ const useKeyboardNavigation = () => {
|
|
|
130
129
|
|
|
131
130
|
if (e.key === 'Backspace' && targetElement.value.length <= 0 && !inline) {
|
|
132
131
|
if (multiple && !targetElement.value) {
|
|
133
|
-
|
|
134
|
-
if (multiSelectedValues.length > 0) onChange(multiSelectedValues[multiSelectedValues.length - 1]);
|
|
132
|
+
if (selectedValues.length > 0) onChange(selectedValues[selectedValues.length - 1]);
|
|
135
133
|
} else {
|
|
136
134
|
onChange(null);
|
|
137
135
|
}
|
|
@@ -142,7 +140,9 @@ const useKeyboardNavigation = () => {
|
|
|
142
140
|
|
|
143
141
|
if (e.key === 'Tab' && inline) ;
|
|
144
142
|
}, [scrollOptionIntoView, currentItemIndex, options, currentItem, selectableOptions, inputRef, multiple, showPopover, selectedValues, inline, onKeyDown, onSelectAll, onChange, onCreate, onFilter, setCurrentOption, setShowPopover, setShowSelectedValue, selectOption]);
|
|
145
|
-
return
|
|
143
|
+
return {
|
|
144
|
+
onInputKeyDown
|
|
145
|
+
};
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
export { useKeyboardNavigation };
|
|
@@ -11,10 +11,10 @@ const useOnElementResize = targetRef => {
|
|
|
11
11
|
const observer = useRef(null);
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
function outputsize() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (targetRef.current) {
|
|
15
|
+
setWidth(targetRef.current.offsetWidth);
|
|
16
|
+
setHeight(targetRef.current.offsetHeight);
|
|
17
|
+
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
observer.current = new ResizeObserver(outputsize).observe(targetRef.current);
|
|
@@ -44,11 +44,8 @@ const shouldUpdateSvgPath = (_ref2, prevSizes) => {
|
|
|
44
44
|
class FloatingLabelInputImpl extends Component {
|
|
45
45
|
constructor(props) {
|
|
46
46
|
super(props);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_defineProperty(this, "prevSizes", {});
|
|
51
|
-
|
|
47
|
+
this.resizeObserver = new ResizeObserver(() => this.updatePath());
|
|
48
|
+
this.prevSizes = {};
|
|
52
49
|
this.wrapperRef = /*#__PURE__*/React.createRef();
|
|
53
50
|
this.outlinePathRef = /*#__PURE__*/React.createRef();
|
|
54
51
|
this.outlineIdleRef = /*#__PURE__*/React.createRef();
|
|
@@ -188,8 +185,8 @@ class FloatingLabelInputImpl extends Component {
|
|
|
188
185
|
|
|
189
186
|
}
|
|
190
187
|
|
|
191
|
-
|
|
188
|
+
FloatingLabelInputImpl.defaultProps = {
|
|
192
189
|
onChange: () => null
|
|
193
|
-
}
|
|
190
|
+
};
|
|
194
191
|
|
|
195
192
|
export { FloatingLabelInputImpl as default };
|
|
@@ -105,8 +105,7 @@ class ValidationFieldWrapper extends Component {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
_defineProperty(ValidationFieldWrapper, "defaultProps", {
|
|
108
|
+
ValidationFieldWrapper.defaultProps = {
|
|
110
109
|
validateOnBlur: false,
|
|
111
110
|
validateOnChange: false,
|
|
112
111
|
name: '',
|
|
@@ -115,6 +114,6 @@ _defineProperty(ValidationFieldWrapper, "defaultProps", {
|
|
|
115
114
|
validate: () => null,
|
|
116
115
|
onChange: () => null,
|
|
117
116
|
onBlur: () => null
|
|
118
|
-
}
|
|
117
|
+
};
|
|
119
118
|
|
|
120
119
|
export { ValidationFieldWrapper as default };
|
|
@@ -105,11 +105,10 @@ class InputAddonWrapper extends Component {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
_defineProperty(InputAddonWrapper, "defaultProps", {
|
|
108
|
+
InputAddonWrapper.defaultProps = {
|
|
110
109
|
rightComponents: [],
|
|
111
110
|
leftComponents: [],
|
|
112
111
|
containerProps: {}
|
|
113
|
-
}
|
|
112
|
+
};
|
|
114
113
|
|
|
115
114
|
export { InputAddonWrapper as default };
|
package/esm/Input/InputImpl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
1
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
3
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
4
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
5
5
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
6
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
@@ -54,12 +54,10 @@ const noop = () => null;
|
|
|
54
54
|
class InputImpl extends Component {
|
|
55
55
|
constructor(props) {
|
|
56
56
|
super(props);
|
|
57
|
+
this.ref = void 0;
|
|
58
|
+
this.refTooltip = void 0;
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_defineProperty(this, "refTooltip", void 0);
|
|
61
|
-
|
|
62
|
-
_defineProperty(this, "handleOnChange", e => {
|
|
60
|
+
this.handleOnChange = e => {
|
|
63
61
|
const {
|
|
64
62
|
onChange,
|
|
65
63
|
max
|
|
@@ -75,9 +73,9 @@ class InputImpl extends Component {
|
|
|
75
73
|
isEllipsisOn: this.ref.current.offsetWidth < this.ref.current.scrollWidth
|
|
76
74
|
});
|
|
77
75
|
}
|
|
78
|
-
}
|
|
76
|
+
};
|
|
79
77
|
|
|
80
|
-
|
|
78
|
+
this.handleBlur = e => {
|
|
81
79
|
const {
|
|
82
80
|
onBlur,
|
|
83
81
|
onChange,
|
|
@@ -99,9 +97,9 @@ class InputImpl extends Component {
|
|
|
99
97
|
this.setState({
|
|
100
98
|
active: false
|
|
101
99
|
});
|
|
102
|
-
}
|
|
100
|
+
};
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
this.handleFocus = e => {
|
|
105
103
|
const {
|
|
106
104
|
onFocus
|
|
107
105
|
} = this.props;
|
|
@@ -109,30 +107,30 @@ class InputImpl extends Component {
|
|
|
109
107
|
this.setState({
|
|
110
108
|
active: true
|
|
111
109
|
});
|
|
112
|
-
}
|
|
110
|
+
};
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
this.handleMouseEnter = () => {
|
|
115
113
|
if (!this.state.showTooltip) {
|
|
116
114
|
this.setState({
|
|
117
115
|
showTooltip: true
|
|
118
116
|
});
|
|
119
117
|
}
|
|
120
|
-
}
|
|
118
|
+
};
|
|
121
119
|
|
|
122
|
-
|
|
120
|
+
this.handleMouseLeave = () => {
|
|
123
121
|
if (this.state.showTooltip) {
|
|
124
122
|
this.setState({
|
|
125
123
|
showTooltip: false
|
|
126
124
|
});
|
|
127
125
|
}
|
|
128
|
-
}
|
|
126
|
+
};
|
|
129
127
|
|
|
130
|
-
|
|
128
|
+
this.setWidth = () => {
|
|
131
129
|
const client = this.refTooltip.current.getBoundingClientRect();
|
|
132
130
|
this.setState({
|
|
133
131
|
width: client.width
|
|
134
132
|
});
|
|
135
|
-
}
|
|
133
|
+
};
|
|
136
134
|
|
|
137
135
|
this.state = {
|
|
138
136
|
width: -1,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
5
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
7
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
9
|
import { Component } from 'react';
|
|
10
10
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
11
11
|
import { jsxs } from 'react/jsx-runtime';
|
|
@@ -19,8 +19,7 @@ const InputAddon = aggregatedClasses('span')(blockName, 'addon');
|
|
|
19
19
|
class AddonWrapper extends Component {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "state", {});
|
|
22
|
+
this.state = {};
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
render() {
|
|
@@ -40,7 +39,6 @@ class AddonWrapper extends Component {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
_defineProperty(AddonWrapper, "defaultProps", {});
|
|
42
|
+
AddonWrapper.defaultProps = {};
|
|
45
43
|
|
|
46
44
|
export { AddonWrapper as default };
|
|
@@ -88,12 +88,10 @@ class DSInputMaskDeprecated extends Component {
|
|
|
88
88
|
|
|
89
89
|
super(props);
|
|
90
90
|
_this = this;
|
|
91
|
+
this.lastkey = null;
|
|
92
|
+
this.lastkeycode = null;
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
_defineProperty(this, "lastkeycode", null);
|
|
95
|
-
|
|
96
|
-
_defineProperty(this, "conformValue", function (rawValueOrEvent, currentCaretPosition) {
|
|
94
|
+
this.conformValue = function (rawValueOrEvent, currentCaretPosition) {
|
|
97
95
|
let {
|
|
98
96
|
skipCaretPositioning = false,
|
|
99
97
|
skipOnChangeCallback = false
|
|
@@ -205,9 +203,9 @@ class DSInputMaskDeprecated extends Component {
|
|
|
205
203
|
if (!skipOnChangeCallback) onChange(event);
|
|
206
204
|
if (!skipCaretPositioning) setTimeout(() => setCaretPosition(_this.inputref, caretPos));
|
|
207
205
|
});
|
|
208
|
-
}
|
|
206
|
+
};
|
|
209
207
|
|
|
210
|
-
|
|
208
|
+
this.handleOnChange = e => {
|
|
211
209
|
var _e$target;
|
|
212
210
|
|
|
213
211
|
const rawValue = (e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || '';
|
|
@@ -216,9 +214,9 @@ class DSInputMaskDeprecated extends Component {
|
|
|
216
214
|
} = e.target;
|
|
217
215
|
const currentCaretPosition = selectionEnd;
|
|
218
216
|
this.conformValue(rawValue, currentCaretPosition);
|
|
219
|
-
}
|
|
217
|
+
};
|
|
220
218
|
|
|
221
|
-
|
|
219
|
+
this.handleKeyDown = e => {
|
|
222
220
|
e.stopPropagation();
|
|
223
221
|
const {
|
|
224
222
|
onKeyDown
|
|
@@ -226,9 +224,9 @@ class DSInputMaskDeprecated extends Component {
|
|
|
226
224
|
this.lastkey = e.key;
|
|
227
225
|
this.lastkeycode = e.keyCode;
|
|
228
226
|
onKeyDown(e);
|
|
229
|
-
}
|
|
227
|
+
};
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
this.handleBlur = e => {
|
|
232
230
|
const {
|
|
233
231
|
onBlur
|
|
234
232
|
} = this.props;
|
|
@@ -236,7 +234,7 @@ class DSInputMaskDeprecated extends Component {
|
|
|
236
234
|
focus: false
|
|
237
235
|
});
|
|
238
236
|
onBlur(e);
|
|
239
|
-
}
|
|
237
|
+
};
|
|
240
238
|
|
|
241
239
|
this.inputref = /*#__PURE__*/React.createRef();
|
|
242
240
|
this.state = {
|
|
@@ -123,7 +123,9 @@ const NavSearchBox = props => {
|
|
|
123
123
|
totalResults,
|
|
124
124
|
value,
|
|
125
125
|
onBlur,
|
|
126
|
-
placeholder
|
|
126
|
+
placeholder,
|
|
127
|
+
autoFocus,
|
|
128
|
+
innerRef
|
|
127
129
|
} = props;
|
|
128
130
|
|
|
129
131
|
const handleChange = e => {
|
|
@@ -154,6 +156,8 @@ const NavSearchBox = props => {
|
|
|
154
156
|
onKeyDown: handleKeyDown,
|
|
155
157
|
placeholder: placeholder,
|
|
156
158
|
value: value,
|
|
159
|
+
autoFocus: autoFocus,
|
|
160
|
+
innerRef: innerRef,
|
|
157
161
|
rightComponent: /*#__PURE__*/_jsx(ToolbarRightAddons, {
|
|
158
162
|
showClear: !!value,
|
|
159
163
|
onNext: onNext,
|
|
@@ -3,8 +3,8 @@ import 'core-js/modules/esnext.iterator.constructor.js';
|
|
|
3
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
7
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
8
|
import React, { Component } from 'react';
|
|
9
9
|
import { debounce } from '@elliemae/ds-utilities';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -19,9 +19,7 @@ const withSearchable = WrappedComponent => {
|
|
|
19
19
|
class Searchable extends Component {
|
|
20
20
|
constructor(props) {
|
|
21
21
|
super(props);
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "debouncedSearch", debounce(this.handleSearch, 200));
|
|
24
|
-
|
|
22
|
+
this.debouncedSearch = debounce(this.handleSearch, 200);
|
|
25
23
|
this.state = {
|
|
26
24
|
value: props.value
|
|
27
25
|
};
|
|
@@ -17,7 +17,7 @@ class DSToggleImpl extends Component {
|
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(props);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
this.onDragStart = clientX => {
|
|
21
21
|
const {
|
|
22
22
|
startPoint,
|
|
23
23
|
checked,
|
|
@@ -37,9 +37,9 @@ class DSToggleImpl extends Component {
|
|
|
37
37
|
drag
|
|
38
38
|
}); // else this.setDragOnChange(checkedProp != null ? checkedProp : checked) // set initial position
|
|
39
39
|
else this.setDragOnChange(checked); // set initial position
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
this.onDragStop = e => {
|
|
43
43
|
const {
|
|
44
44
|
checked
|
|
45
45
|
} = this.state; // const { checked: checkedProp, } = this.props
|
|
@@ -49,25 +49,25 @@ class DSToggleImpl extends Component {
|
|
|
49
49
|
this.setState(cleanDrag); // } else this.setDragOnChange(checkedProp != null ? checkedProp : checked) // set initial position
|
|
50
50
|
} else this.setDragOnChange(checked); // set initial position
|
|
51
51
|
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
this.onBlur = e => {
|
|
55
55
|
const {
|
|
56
56
|
onBlur,
|
|
57
57
|
id
|
|
58
58
|
} = this.props;
|
|
59
59
|
if (onBlur) onBlur(e, id);
|
|
60
|
-
}
|
|
60
|
+
};
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
this.onFocus = e => {
|
|
63
63
|
const {
|
|
64
64
|
onFocus,
|
|
65
65
|
id
|
|
66
66
|
} = this.props;
|
|
67
67
|
if (onFocus) onFocus(e, id);
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
this.onChange = e => {
|
|
71
71
|
const {
|
|
72
72
|
checked
|
|
73
73
|
} = this.state;
|
|
@@ -90,26 +90,26 @@ class DSToggleImpl extends Component {
|
|
|
90
90
|
onChange(e, id); // this.setDragOnChange(checkedProp != null ? checkedProp : newCheck) // set new position
|
|
91
91
|
|
|
92
92
|
this.setDragOnChange(newCheck); // set new position
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
this.onMouseEnter = () => {
|
|
96
96
|
this.setState({
|
|
97
97
|
inside: true
|
|
98
98
|
});
|
|
99
|
-
}
|
|
99
|
+
};
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
this.onMouseLeave = () => {
|
|
102
102
|
this.setState({
|
|
103
103
|
inside: false
|
|
104
104
|
});
|
|
105
|
-
}
|
|
105
|
+
};
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
this.onMouseMove = event => {
|
|
108
108
|
event.preventDefault();
|
|
109
109
|
this.onDragStart(event.clientX);
|
|
110
|
-
}
|
|
110
|
+
};
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
this.onMouseDown = event => {
|
|
113
113
|
this.onDragStart(event.clientX);
|
|
114
114
|
this.setState({
|
|
115
115
|
startPoint: event.clientX,
|
|
@@ -117,36 +117,36 @@ class DSToggleImpl extends Component {
|
|
|
117
117
|
});
|
|
118
118
|
window.addEventListener('mousemove', this.onMouseMove);
|
|
119
119
|
window.addEventListener('mouseup', this.onMouseUp);
|
|
120
|
-
}
|
|
120
|
+
};
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
this.onMouseUp = event => {
|
|
123
123
|
this.onDragStop(event);
|
|
124
124
|
window.removeEventListener('mousemove', this.onMouseMove);
|
|
125
125
|
window.removeEventListener('mouseup', this.onMouseUp);
|
|
126
|
-
}
|
|
126
|
+
};
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
this.onTouchCancel = () => {
|
|
129
129
|
this.setState({
|
|
130
130
|
inside: false
|
|
131
131
|
});
|
|
132
|
-
}
|
|
132
|
+
};
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
this.onTouchEnd = event => {
|
|
135
135
|
event.preventDefault();
|
|
136
136
|
this.onDragStop(event);
|
|
137
|
-
}
|
|
137
|
+
};
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
this.onTouchMove = event => {
|
|
140
140
|
this.onDragStart(event.touches[0].clientX);
|
|
141
|
-
}
|
|
141
|
+
};
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
this.onTouchStart = event => {
|
|
144
144
|
this.onDragStart(event.touches[0].clientX);
|
|
145
145
|
this.setState({
|
|
146
146
|
startPoint: event.touches[0].clientX,
|
|
147
147
|
isDragging: true
|
|
148
148
|
});
|
|
149
|
-
}
|
|
149
|
+
};
|
|
150
150
|
|
|
151
151
|
this.state = {
|
|
152
152
|
checked: props.checked || false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Form",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -515,10 +515,6 @@
|
|
|
515
515
|
"import": "./esm/ComboBox/v3/utils/listHelper.js",
|
|
516
516
|
"require": "./cjs/ComboBox/v3/utils/listHelper.js"
|
|
517
517
|
},
|
|
518
|
-
"./ComboBox/v3/utils/hooks/useOnWindowResize": {
|
|
519
|
-
"import": "./esm/ComboBox/v3/utils/hooks/useOnWindowResize.js",
|
|
520
|
-
"require": "./cjs/ComboBox/v3/utils/hooks/useOnWindowResize.js"
|
|
521
|
-
},
|
|
522
518
|
"./ComboBox/v3/utils/hooks/useOnElementResize": {
|
|
523
519
|
"import": "./esm/ComboBox/v3/utils/hooks/useOnElementResize.js",
|
|
524
520
|
"require": "./cjs/ComboBox/v3/utils/hooks/useOnElementResize.js"
|
|
@@ -936,22 +932,28 @@
|
|
|
936
932
|
"build": "node ../../scripts/build/build.js"
|
|
937
933
|
},
|
|
938
934
|
"dependencies": {
|
|
939
|
-
"@elliemae/ds-button": "2.0.0
|
|
940
|
-
"@elliemae/ds-circular-progress-indicator": "2.0.0
|
|
941
|
-
"@elliemae/ds-classnames": "2.0.0
|
|
942
|
-
"@elliemae/ds-
|
|
943
|
-
"@elliemae/ds-
|
|
944
|
-
"@elliemae/ds-
|
|
945
|
-
"@elliemae/ds-
|
|
946
|
-
"@elliemae/ds-
|
|
947
|
-
"@elliemae/ds-
|
|
948
|
-
"@elliemae/ds-
|
|
949
|
-
"@elliemae/ds-
|
|
950
|
-
"@elliemae/ds-
|
|
951
|
-
"@elliemae/ds-
|
|
952
|
-
"@elliemae/ds-
|
|
953
|
-
"@elliemae/ds-
|
|
954
|
-
"@elliemae/ds-
|
|
935
|
+
"@elliemae/ds-button": "2.0.0",
|
|
936
|
+
"@elliemae/ds-circular-progress-indicator": "2.0.0",
|
|
937
|
+
"@elliemae/ds-classnames": "2.0.0",
|
|
938
|
+
"@elliemae/ds-controlled-form": "2.0.0",
|
|
939
|
+
"@elliemae/ds-dropdownmenu": "2.0.0",
|
|
940
|
+
"@elliemae/ds-form": "2.0.0",
|
|
941
|
+
"@elliemae/ds-grid": "2.0.0",
|
|
942
|
+
"@elliemae/ds-icon": "2.0.0",
|
|
943
|
+
"@elliemae/ds-icons": "2.0.0",
|
|
944
|
+
"@elliemae/ds-menu": "2.0.0",
|
|
945
|
+
"@elliemae/ds-overlay": "2.0.0",
|
|
946
|
+
"@elliemae/ds-pills": "2.0.0",
|
|
947
|
+
"@elliemae/ds-popper": "2.0.0",
|
|
948
|
+
"@elliemae/ds-popperjs": "2.0.0",
|
|
949
|
+
"@elliemae/ds-props-helpers": "2.0.0",
|
|
950
|
+
"@elliemae/ds-separator": "2.0.0",
|
|
951
|
+
"@elliemae/ds-shared": "2.0.0",
|
|
952
|
+
"@elliemae/ds-system": "2.0.0",
|
|
953
|
+
"@elliemae/ds-text-wrapper": "2.0.0",
|
|
954
|
+
"@elliemae/ds-tooltip": "2.0.0",
|
|
955
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0",
|
|
956
|
+
"@elliemae/ds-utilities": "2.0.0",
|
|
955
957
|
"memoize-one": "~5.1.1",
|
|
956
958
|
"moment": "~2.29.1",
|
|
957
959
|
"prop-types": "~15.7.2",
|
|
@@ -966,13 +968,19 @@
|
|
|
966
968
|
"uid": "~2.0.0"
|
|
967
969
|
},
|
|
968
970
|
"devDependencies": {
|
|
969
|
-
"
|
|
971
|
+
"@testing-library/dom": "~8.11.1",
|
|
972
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
973
|
+
"@testing-library/react": "~12.1.2",
|
|
974
|
+
"@testing-library/user-event": "~13.5.0",
|
|
975
|
+
"styled-components": "~5.3.3",
|
|
976
|
+
"styled-system": "~5.1.5"
|
|
970
977
|
},
|
|
971
978
|
"peerDependencies": {
|
|
972
979
|
"lodash": "^4.17.21",
|
|
973
980
|
"react": "~17.0.2",
|
|
974
981
|
"react-dom": "^17.0.2",
|
|
975
|
-
"styled-components": "^5.3.3"
|
|
982
|
+
"styled-components": "^5.3.3",
|
|
983
|
+
"styled-system": "^5.1.5"
|
|
976
984
|
},
|
|
977
985
|
"publishConfig": {
|
|
978
986
|
"access": "public",
|