@elliemae/ds-controlled-form 2.4.1-rc.9 → 2.4.2-rc.1
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/autocomplete/config/useAutocomplete.js +1 -3
- package/cjs/checkbox/ControlledCheckbox.js +49 -33
- package/cjs/checkbox/exported-related/data-test-ids.js +10 -0
- package/cjs/checkbox/exported-related/index.js +12 -0
- package/cjs/checkbox/exported-related/theming.js +13 -0
- package/cjs/checkbox/react-desc-prop-types.js +0 -1
- package/cjs/checkbox/styles.js +26 -15
- package/cjs/combobox/ComboBoxCTX.js +1 -1
- package/cjs/combobox/ComboboxDataTestids.js +1 -1
- package/cjs/combobox/config/useComboBox.js +6 -4
- package/cjs/combobox/index.js +5 -0
- package/cjs/combobox/parts/DropdownIndicator.js +2 -2
- package/cjs/combobox/parts/container/Container.js +5 -5
- package/cjs/combobox/parts/container/styled.js +13 -7
- package/cjs/combobox/parts/controls/Controls.js +14 -4
- package/cjs/combobox/parts/controls/styled.js +22 -13
- package/cjs/combobox/parts/controls-input/ControlsInput.js +1 -1
- package/cjs/combobox/parts/controls-input/styled.js +7 -3
- package/cjs/combobox/parts/controls-input/useControlsInput.js +3 -4
- package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +30 -15
- package/cjs/combobox/parts/header-list/HeaderList.js +4 -3
- package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +9 -5
- package/cjs/combobox/parts/menu-list/MenuList.js +5 -2
- package/cjs/combobox/parts/menu-list/styled.js +12 -7
- package/cjs/combobox/parts/menu-list/useItemRenderer.js +5 -4
- package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +2 -0
- package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +13 -10
- package/cjs/combobox/theming.js +13 -0
- package/cjs/combobox/utils/listHelper.js +2 -1
- package/cjs/index.js +16 -7
- package/cjs/input-group/InputGroup.js +69 -0
- package/cjs/input-group/InputGroupDataTestIds.js +12 -0
- package/cjs/input-group/index.js +12 -0
- package/cjs/input-group/react-desc-prop-types.js +14 -0
- package/cjs/input-group/styled.js +46 -0
- package/cjs/mask-hook/hooks/index.js +0 -1
- package/cjs/mask-hook/hooks/usePhoneMask.js +2 -2
- package/cjs/mask-hook/hooks/useRegExpMask.js +0 -1
- package/cjs/mask-hook/index.js +0 -1
- package/cjs/text-input/styled/borders.js +1 -1
- package/esm/autocomplete/config/useAutocomplete.js +1 -3
- package/esm/checkbox/ControlledCheckbox.js +52 -36
- package/esm/checkbox/exported-related/data-test-ids.js +6 -0
- package/esm/checkbox/exported-related/index.js +2 -0
- package/esm/checkbox/exported-related/theming.js +8 -0
- package/esm/checkbox/react-desc-prop-types.js +0 -1
- package/esm/checkbox/styles.js +25 -15
- package/esm/combobox/ComboBoxCTX.js +1 -1
- package/esm/combobox/ComboboxDataTestids.js +1 -1
- package/esm/combobox/config/useComboBox.js +6 -4
- package/esm/combobox/index.js +2 -0
- package/esm/combobox/parts/DropdownIndicator.js +2 -2
- package/esm/combobox/parts/container/Container.js +7 -7
- package/esm/combobox/parts/container/styled.js +13 -6
- package/esm/combobox/parts/controls/Controls.js +14 -4
- package/esm/combobox/parts/controls/styled.js +22 -13
- package/esm/combobox/parts/controls-input/ControlsInput.js +1 -1
- package/esm/combobox/parts/controls-input/styled.js +7 -3
- package/esm/combobox/parts/controls-input/useControlsInput.js +3 -4
- package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +30 -15
- package/esm/combobox/parts/header-list/HeaderList.js +4 -3
- package/esm/combobox/parts/header-list/useHeaderListHandlers.js +9 -5
- package/esm/combobox/parts/menu-list/MenuList.js +5 -2
- package/esm/combobox/parts/menu-list/styled.js +12 -7
- package/esm/combobox/parts/menu-list/useItemRenderer.js +5 -4
- package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +2 -0
- package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +13 -10
- package/esm/combobox/theming.js +8 -0
- package/esm/combobox/utils/listHelper.js +2 -1
- package/esm/index.js +5 -1
- package/esm/input-group/InputGroup.js +59 -0
- package/esm/input-group/InputGroupDataTestIds.js +8 -0
- package/esm/input-group/index.js +2 -0
- package/esm/input-group/react-desc-prop-types.js +10 -0
- package/esm/input-group/styled.js +35 -0
- package/esm/mask-hook/hooks/index.js +1 -1
- package/esm/mask-hook/hooks/usePhoneMask.js +2 -2
- package/esm/mask-hook/hooks/useRegExpMask.js +1 -1
- package/esm/mask-hook/index.js +1 -1
- package/esm/text-input/styled/borders.js +1 -1
- package/package.json +51 -19
- package/types/checkbox/exported-related/data-test-ids.d.ts +4 -0
- package/types/checkbox/exported-related/index.d.ts +2 -0
- package/types/checkbox/exported-related/theming.d.ts +6 -0
- package/types/checkbox/react-desc-prop-types.d.ts +3 -3
- package/types/checkbox/styles.d.ts +5 -5
- package/types/combobox/ComboboxDataTestids.d.ts +1 -1
- package/types/combobox/index.d.ts +2 -0
- package/types/combobox/parts/container/styled.d.ts +1 -2
- package/types/combobox/theming.d.ts +6 -0
- package/types/index.d.ts +1 -0
- package/types/input-group/InputGroup.d.ts +5 -0
- package/types/input-group/InputGroupDataTestIds.d.ts +6 -0
- package/types/input-group/index.d.ts +2 -0
- package/types/input-group/react-desc-prop-types.d.ts +19 -0
- package/types/input-group/styled.d.ts +7 -0
- package/types/input-group/tests/DSInputGroup.test.d.ts +1 -0
- package/types/mask-hook/hooks/useRegExpMask.d.ts +0 -1
- package/types/text-input/config/useInputText.d.ts +5 -5
- package/cjs/combobox/parts/menu-list/useMenuListSetFocusOption.js +0 -51
- package/esm/combobox/parts/menu-list/useMenuListSetFocusOption.js +0 -47
- package/types/combobox/parts/menu-list/useMenuListSetFocusOption.d.ts +0 -1
|
@@ -32,6 +32,7 @@ const useKeyboardNavigation = () => {
|
|
|
32
32
|
inputValue,
|
|
33
33
|
showPopover,
|
|
34
34
|
focusOptionIdx,
|
|
35
|
+
listRef,
|
|
35
36
|
selectAllCheckboxRef,
|
|
36
37
|
toggleSelectionButtonRef,
|
|
37
38
|
setShowPopover,
|
|
@@ -51,6 +52,14 @@ const useKeyboardNavigation = () => {
|
|
|
51
52
|
|
|
52
53
|
if (['ArrowDown', 'ArrowUp', 'Enter', 'Spacebar'].includes(e.key) || e.keyCode >= 48 && e.keyCode <= 90) {
|
|
53
54
|
setShowPopover(true);
|
|
55
|
+
window.requestAnimationFrame(() => {
|
|
56
|
+
if (listRef.current && window.scrollY < listRef.current.offsetHeight) {
|
|
57
|
+
window.scrollTo({
|
|
58
|
+
top: listRef.current.offsetHeight,
|
|
59
|
+
behavior: 'smooth'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
54
63
|
} // =============================================================================
|
|
55
64
|
// ESCAPE
|
|
56
65
|
// =============================================================================
|
|
@@ -71,7 +80,7 @@ const useKeyboardNavigation = () => {
|
|
|
71
80
|
|
|
72
81
|
|
|
73
82
|
if (e.key === 'Enter' && (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === constants.INTERNAL_MENU_OPTION_TYPES.CREATABLE && onCreate) {
|
|
74
|
-
onCreate(inputValue); //blank active item to force search last one
|
|
83
|
+
onCreate(inputValue); // blank active item to force search last one
|
|
75
84
|
|
|
76
85
|
setFocusOptionIdx('');
|
|
77
86
|
if (onFilter) onFilter(allOptions, '');
|
|
@@ -114,9 +123,12 @@ const useKeyboardNavigation = () => {
|
|
|
114
123
|
e.stopPropagation();
|
|
115
124
|
|
|
116
125
|
if ((showPopover || inline) && selectableOptions.length) {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
const nextItemIndexIndex = listHelper.findInCircularList(filteredOptions, currentItemIndex, isOptionFocuseable);
|
|
127
|
+
|
|
128
|
+
if (nextItemIndexIndex > -1) {
|
|
129
|
+
setFocusOptionIdx(filteredOptions[nextItemIndexIndex].dsId);
|
|
130
|
+
scrollOptionIntoView(filteredOptions[nextItemIndexIndex].dsId);
|
|
131
|
+
}
|
|
120
132
|
}
|
|
121
133
|
}
|
|
122
134
|
|
|
@@ -126,16 +138,19 @@ const useKeyboardNavigation = () => {
|
|
|
126
138
|
if (!selectableOptions.length) return;
|
|
127
139
|
const prevItemIndex = listHelper.findInCircularList(filteredOptions, currentItemIndex, isOptionFocuseable, -1);
|
|
128
140
|
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
if (prevItemIndex > -1) {
|
|
142
|
+
if (showPopover || inline) {
|
|
143
|
+
setFocusOptionIdx(filteredOptions[prevItemIndex].dsId);
|
|
144
|
+
scrollOptionIntoView(filteredOptions[prevItemIndex].dsId);
|
|
145
|
+
} else {
|
|
146
|
+
// open menu and search last item to focused
|
|
147
|
+
setShowPopover(true);
|
|
148
|
+
const lastItemIndex = listHelper.findInCircularList(filteredOptions, 0, isOptionFocuseable, -1);
|
|
149
|
+
setFocusOptionIdx(filteredOptions[lastItemIndex].dsId);
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
scrollOptionIntoView(filteredOptions[lastItemIndex].dsId);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
139
154
|
}
|
|
140
155
|
} // =============================================================================
|
|
141
156
|
// BACKSPACE
|
|
@@ -167,7 +182,7 @@ const useKeyboardNavigation = () => {
|
|
|
167
182
|
setShowPopover(false);
|
|
168
183
|
}
|
|
169
184
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
170
|
-
[onKeyDown, currentItem, onCreate, multiple, inputValue, inline, withoutPortal, setShowPopover, onCancel, onFilter, setInputValue, focusOptionIdx, showPopover, selectableOptions.length, filteredOptions, currentItemIndex, setFocusOptionIdx, selectedValues, onChange, selectAllCheckboxRef, toggleSelectionButtonRef]);
|
|
185
|
+
[onKeyDown, currentItem, onCreate, multiple, inputValue, inline, withoutPortal, setShowPopover, onCancel, onFilter, setInputValue, listRef, focusOptionIdx, showPopover, selectableOptions.length, filteredOptions, currentItemIndex, setFocusOptionIdx, selectedValues, onChange, selectAllCheckboxRef, toggleSelectionButtonRef]);
|
|
171
186
|
return {
|
|
172
187
|
onInputKeyDown
|
|
173
188
|
};
|
|
@@ -22,6 +22,7 @@ const HeaderList = () => {
|
|
|
22
22
|
const {
|
|
23
23
|
props: {
|
|
24
24
|
selectedValues,
|
|
25
|
+
filteredOptions,
|
|
25
26
|
onSelectAll
|
|
26
27
|
},
|
|
27
28
|
showSelectedOptions,
|
|
@@ -40,15 +41,15 @@ const HeaderList = () => {
|
|
|
40
41
|
} = useHeaderListHandlers.useHeaderListHandlers();
|
|
41
42
|
return /*#__PURE__*/_jsx__default["default"](styled.StyledHeaderListWrapper, {
|
|
42
43
|
onKeyDown: handleKeyDown,
|
|
43
|
-
onMouseDown: handleOnMouseDown
|
|
44
|
+
onMouseDown: handleOnMouseDown,
|
|
45
|
+
"data-testid": ComboboxDataTestids.ComboboxDataTestid.MULTISELECT.HEADER_LIST
|
|
44
46
|
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledSelectAllCheckbox, {}, void 0, onSelectAll && /*#__PURE__*/_jsx__default["default"](ControlledCheckbox.DSControlledCheckbox, {
|
|
45
47
|
checked: checkboxStatus,
|
|
46
|
-
"aria-controls":
|
|
48
|
+
"aria-controls": filteredOptions.map(item => item.dsId).join(' '),
|
|
47
49
|
name: "select-all-checkbox",
|
|
48
50
|
"aria-label": "Select/Unselect All Items",
|
|
49
51
|
id: "select-all-checkbox",
|
|
50
52
|
onChange: handleSelectAllCheckboxChange,
|
|
51
|
-
"data-testid": ComboboxDataTestids.ComboboxDataTestid.MULTISELECT.SELECT_ALL_CHECKBOX,
|
|
52
53
|
onKeyDown: handleCheckAllOnTab,
|
|
53
54
|
innerRef: selectAllCheckboxRef
|
|
54
55
|
})), /*#__PURE__*/_jsx__default["default"](styled.StyledSelectedItems, {}, void 0, multiSelectedValues.length > 0 ? /*#__PURE__*/_jsx__default["default"](styled.StyledButtonSelection, {
|
|
@@ -55,27 +55,31 @@ const useHeaderListHandlers = () => {
|
|
|
55
55
|
e.preventDefault();
|
|
56
56
|
setShowSelectedOptions(!showSelectedOptions);
|
|
57
57
|
}, [setShowSelectedOptions, showSelectedOptions]); // when pressing escape on each header list button we close the menu
|
|
58
|
+
// and set focus on input
|
|
58
59
|
|
|
59
60
|
const handleKeyDown = React.useCallback(e => {
|
|
60
61
|
if (e.key === 'Escape') {
|
|
62
|
+
var _innerRef$current;
|
|
63
|
+
|
|
61
64
|
setShowPopover(false);
|
|
65
|
+
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
|
|
62
66
|
}
|
|
63
|
-
}, [setShowPopover]); // when hitting tab on selected values button filter we target the input again
|
|
67
|
+
}, [setShowPopover, innerRef]); // when hitting tab on selected values button filter we target the input again
|
|
64
68
|
|
|
65
69
|
const handleFilterSelectionBtnOnTab = React.useCallback(e => {
|
|
66
70
|
if (e.key === 'Tab' && !e.shiftKey) {
|
|
67
|
-
var _innerRef$
|
|
71
|
+
var _innerRef$current2;
|
|
68
72
|
|
|
69
73
|
e.preventDefault();
|
|
70
|
-
(_innerRef$
|
|
74
|
+
(_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.focus();
|
|
71
75
|
}
|
|
72
76
|
}, [innerRef]);
|
|
73
77
|
const handleCheckAllOnTab = React.useCallback(e => {
|
|
74
78
|
if (e.key === 'Tab' && !e.shiftKey && multiSelectedValues.length === 0) {
|
|
75
|
-
var _innerRef$
|
|
79
|
+
var _innerRef$current3;
|
|
76
80
|
|
|
77
81
|
e.preventDefault();
|
|
78
|
-
(_innerRef$
|
|
82
|
+
(_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.focus();
|
|
79
83
|
}
|
|
80
84
|
}, [innerRef, multiSelectedValues]);
|
|
81
85
|
React.useEffect(() => {
|
|
@@ -48,7 +48,9 @@ const MenuList = () => {
|
|
|
48
48
|
inline: inline,
|
|
49
49
|
onMouseDown: preventLoseInputFocus,
|
|
50
50
|
width: width,
|
|
51
|
-
minWidth: menuMinWidth
|
|
51
|
+
minWidth: menuMinWidth // we use width as key to force react virtual re-render on window resize
|
|
52
|
+
// and update the item height accordly
|
|
53
|
+
,
|
|
52
54
|
children: [withHeader && (_HeaderList || (_HeaderList = /*#__PURE__*/_jsx__default["default"](HeaderList.HeaderList, {}))), filteredOptions.length > 0 || onCreate ? /*#__PURE__*/jsxRuntime.jsx(styled.StyledVirtualListWrapper, {
|
|
53
55
|
inline: inline,
|
|
54
56
|
maxHeight: menuMaxHeight,
|
|
@@ -64,9 +66,10 @@ const MenuList = () => {
|
|
|
64
66
|
}
|
|
65
67
|
}, void 0, ItemRenderer)
|
|
66
68
|
}) : _StyledNoResultsWrapp || (_StyledNoResultsWrapp = /*#__PURE__*/_jsx__default["default"](styled.StyledNoResultsWrapper, {
|
|
69
|
+
role: "alert",
|
|
67
70
|
"aria-live": "polite"
|
|
68
71
|
}, void 0, "No matches found"))]
|
|
69
|
-
}), [wrapperListRef, inline, preventLoseInputFocus,
|
|
72
|
+
}, width), [wrapperListRef, inline, preventLoseInputFocus, menuMinWidth, withHeader, filteredOptions.length, onCreate, menuMaxHeight, listRef, virtualListHelpers === null || virtualListHelpers === void 0 ? void 0 : virtualListHelpers.totalSize, ItemRenderer, width]);
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
exports.MenuList = MenuList;
|
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
11
11
|
|
|
12
12
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
13
|
-
const StyledListWrapper = dsSystem.styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n min-width: ", ";\n width: ", ";\n background-color: #ffffff;\n"])), _ref => {
|
|
13
|
+
const StyledListWrapper = dsSystem.styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n min-width: ", ";\n width: ", ";\n background-color: #ffffff;\n max-height: ", ";\n z-index: 100;\n"])), _ref => {
|
|
14
14
|
let {
|
|
15
15
|
inline,
|
|
16
16
|
minWidth
|
|
@@ -21,18 +21,23 @@ const StyledListWrapper = dsSystem.styled.div(_templateObject || (_templateObjec
|
|
|
21
21
|
width
|
|
22
22
|
} = _ref2;
|
|
23
23
|
return "".concat(width, "px");
|
|
24
|
+
}, _ref3 => {
|
|
25
|
+
let {
|
|
26
|
+
maxHeight
|
|
27
|
+
} = _ref3;
|
|
28
|
+
return "".concat(maxHeight, "px");
|
|
24
29
|
});
|
|
25
|
-
const StyledList = dsSystem.styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n position: relative;\n padding: 0;\n"])));
|
|
26
|
-
const StyledVirtualListWrapper = dsSystem.styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n overflow-y: auto;\n margin-top: ", ";\n
|
|
30
|
+
const StyledList = dsSystem.styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n position: relative;\n padding: 0;\n background-color: #ffffff;\n"])));
|
|
31
|
+
const StyledVirtualListWrapper = dsSystem.styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n overflow-y: auto;\n margin-top: ", ";\n max-height: ", ";\n"])), _ref4 => {
|
|
27
32
|
let {
|
|
28
33
|
withHeader
|
|
29
|
-
} =
|
|
34
|
+
} = _ref4;
|
|
30
35
|
return withHeader ? '28px' : '';
|
|
31
|
-
},
|
|
36
|
+
}, _ref5 => {
|
|
32
37
|
let {
|
|
33
38
|
maxHeight
|
|
34
|
-
} =
|
|
35
|
-
return
|
|
39
|
+
} = _ref5;
|
|
40
|
+
return maxHeight ? "".concat(maxHeight, "px") : '300px';
|
|
36
41
|
});
|
|
37
42
|
const StyledCreatableLabel = dsSystem.styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral__default["default"](["\n font-weight: bold;\n font-style: italic;\n"])));
|
|
38
43
|
const StyledNoResultsWrapper = dsSystem.styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral__default["default"](["\n padding: 16px;\n"])));
|
|
@@ -87,9 +87,10 @@ const useItemRenderer = () => {
|
|
|
87
87
|
const generalProps = {
|
|
88
88
|
wrapperStyles: {
|
|
89
89
|
position: 'absolute',
|
|
90
|
-
top:
|
|
90
|
+
top: 0,
|
|
91
91
|
left: 0,
|
|
92
|
-
width: '100%'
|
|
92
|
+
width: '100%',
|
|
93
|
+
transform: "translateY(".concat(vItem.start, "px)")
|
|
93
94
|
},
|
|
94
95
|
key: "".concat(option.dsId),
|
|
95
96
|
innerRef: vItem.measureRef
|
|
@@ -114,8 +115,8 @@ const useItemRenderer = () => {
|
|
|
114
115
|
onClick: e => handleClick(option, e),
|
|
115
116
|
onMouseDown: handleOnMouseDown,
|
|
116
117
|
isActive: option.dsId === focusOptionIdx,
|
|
117
|
-
isSelected: listHelper.isSelected(selectedValues, option)
|
|
118
|
-
|
|
118
|
+
isSelected: listHelper.isSelected(selectedValues, option) //tabIndex={-1}
|
|
119
|
+
|
|
119
120
|
}));
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -29,7 +29,7 @@ const MultiSelectedValuesContainer = () => {
|
|
|
29
29
|
const correctPillsToShow = useGroupPills.useGroupPills();
|
|
30
30
|
return React.useMemo(() => /*#__PURE__*/_jsx__default["default"]("div", {
|
|
31
31
|
style: {
|
|
32
|
-
width: 'max-content'
|
|
32
|
+
width: multiSelectedValue.length > 0 ? 'max-content' : '0px'
|
|
33
33
|
},
|
|
34
34
|
"data-testid": ComboboxDataTestids.ComboboxDataTestid.SELECTED_VALUES
|
|
35
35
|
}, void 0, /*#__PURE__*/_jsx__default["default"](dsPills.DSPillGroupV2, {
|
|
@@ -33,6 +33,8 @@ const RemovableSelectedValuePill = props => {
|
|
|
33
33
|
onRemove: e => {
|
|
34
34
|
var _innerRef$current;
|
|
35
35
|
|
|
36
|
+
// preventing the menu to be opened
|
|
37
|
+
e.stopPropagation();
|
|
36
38
|
onChange(listHelper.getSuggestedValueOnChange(pill, selectedValues), pill, e);
|
|
37
39
|
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
|
|
38
40
|
}
|
|
@@ -29,8 +29,11 @@ const useGroupPills = () => {
|
|
|
29
29
|
controlsWrapperRef,
|
|
30
30
|
pillGroupRef
|
|
31
31
|
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
32
|
-
const multiSelectedValues = selectedValues;
|
|
33
|
-
|
|
32
|
+
const multiSelectedValues = selectedValues; // 30 represent 30 pills maximum to calculate the grouped pill. this fix the load time issue
|
|
33
|
+
// when combobox is receiving a huge amount of options.
|
|
34
|
+
|
|
35
|
+
const selectedValuesLength = Math.min(30, multiSelectedValues.length);
|
|
36
|
+
const [pillsToShow, setPillsToShow] = React.useState(selectedValuesLength);
|
|
34
37
|
const {
|
|
35
38
|
width
|
|
36
39
|
} = dsUtilities.useOnElementResize(controlsWrapperRef);
|
|
@@ -38,28 +41,28 @@ const useGroupPills = () => {
|
|
|
38
41
|
width: widthInput
|
|
39
42
|
} = dsUtilities.useOnElementResize(innerRef || null);
|
|
40
43
|
React.useEffect(() => {
|
|
41
|
-
if (
|
|
42
|
-
setPillsToShow(
|
|
44
|
+
if (selectedValuesLength !== pillsToShow) {
|
|
45
|
+
setPillsToShow(selectedValuesLength);
|
|
43
46
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
47
|
|
|
45
|
-
}, [
|
|
48
|
+
}, [selectedValuesLength, width, widthInput]);
|
|
46
49
|
React.useLayoutEffect(() => {
|
|
47
|
-
if (selectedOptionsRef.current) {
|
|
50
|
+
if (selectedOptionsRef.current && pillGroupRef.current) {
|
|
48
51
|
if (pillGroupRef.current) pillGroupRef.current.style.width = 'max-content';
|
|
49
52
|
let lastPillFit = -1;
|
|
50
53
|
let currentWidth = 0;
|
|
51
54
|
const referenceWidth = selectedOptionsRef.current.offsetWidth;
|
|
52
|
-
const pills = [...
|
|
55
|
+
const pills = [...pillGroupRef.current.querySelectorAll(disabled ? '.ds-pill-wrapper-value' : '.ds-pill-wrapper-removable')];
|
|
53
56
|
const pillsWidth = pills.map(pill => pill === null || pill === void 0 ? void 0 : pill.offsetWidth);
|
|
54
57
|
pillsWidth.forEach((pillWidth, idx) => {
|
|
55
58
|
currentWidth += pillWidth;
|
|
56
59
|
|
|
57
|
-
if (currentWidth + getGroupedPillWidth(
|
|
60
|
+
if (currentWidth + getGroupedPillWidth(selectedValuesLength - idx - 1) <= referenceWidth) {
|
|
58
61
|
lastPillFit = idx;
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
64
|
|
|
62
|
-
if (!(
|
|
65
|
+
if (!(selectedValuesLength > 0 && pillsToShow !== selectedValuesLength)) {
|
|
63
66
|
const nextPillsToShow = lastPillFit + 1;
|
|
64
67
|
|
|
65
68
|
if (nextPillsToShow !== pillsToShow) {
|
|
@@ -69,7 +72,7 @@ const useGroupPills = () => {
|
|
|
69
72
|
|
|
70
73
|
if (pillGroupRef.current) pillGroupRef.current.style.width = 'fit-content';
|
|
71
74
|
}
|
|
72
|
-
}, [selectedOptionsRef, innerRef, multiSelectedValues, pillsToShow, pillGroupRef, width, widthInput, disabled]);
|
|
75
|
+
}, [selectedOptionsRef, innerRef, multiSelectedValues, pillsToShow, pillGroupRef, width, widthInput, disabled, selectedValuesLength]);
|
|
73
76
|
return pillsToShow || 1;
|
|
74
77
|
};
|
|
75
78
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const DSComboBoxName = 'ds-combobox';
|
|
6
|
+
const DSComboboxSlots = {
|
|
7
|
+
CONTAINER: 'root',
|
|
8
|
+
INPUT_WRAPPER: 'input-wrapper',
|
|
9
|
+
INPUT: 'input'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.DSComboBoxName = DSComboBoxName;
|
|
13
|
+
exports.DSComboboxSlots = DSComboboxSlots;
|
|
@@ -51,7 +51,8 @@ const getFirstOption = (options, selectedValues, inputValue) => {
|
|
|
51
51
|
|
|
52
52
|
for (let i = 0; i < options.length; i += 1) if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {
|
|
53
53
|
return options[i].dsId;
|
|
54
|
-
}
|
|
54
|
+
} // list of disabled item results return ''
|
|
55
|
+
|
|
55
56
|
|
|
56
57
|
return '';
|
|
57
58
|
};
|
package/cjs/index.js
CHANGED
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var Autocomplete = require('./autocomplete/Autocomplete.js');
|
|
6
|
+
var InputGroup = require('./input-group/InputGroup.js');
|
|
7
|
+
var InputGroupDataTestIds = require('./input-group/InputGroupDataTestIds.js');
|
|
6
8
|
var ControlledCheckbox = require('./checkbox/ControlledCheckbox.js');
|
|
7
9
|
var ComboBox = require('./combobox/ComboBox.js');
|
|
10
|
+
var theming = require('./combobox/theming.js');
|
|
11
|
+
var ComboboxDataTestids = require('./combobox/ComboboxDataTestids.js');
|
|
8
12
|
var ControlledDateRangePicker = require('./date-range-picker/ControlledDateRangePicker.js');
|
|
9
13
|
var ControlledDateRangePickerDatatestid = require('./date-range-picker/ControlledDateRangePickerDatatestid.js');
|
|
10
14
|
var ControlledDateRangePickerTypes = require('./date-range-picker/ControlledDateRangePickerTypes.js');
|
|
@@ -22,21 +26,27 @@ var useRegExpMask = require('./mask-hook/hooks/useRegExpMask.js');
|
|
|
22
26
|
var useZipCodeMask = require('./mask-hook/hooks/useZipCodeMask.js');
|
|
23
27
|
var DSInputText = require('./text-input/DSInputText.js');
|
|
24
28
|
var dataTestIds = require('./text-input/exported-related/data-test-ids.js');
|
|
25
|
-
var theming = require('./text-input/exported-related/theming.js');
|
|
29
|
+
var theming$1 = require('./text-input/exported-related/theming.js');
|
|
26
30
|
var ControlledToggle = require('./toggle/ControlledToggle.js');
|
|
27
31
|
var DSControlledLargeTextInput = require('./large-text-input/DSControlledLargeTextInput.js');
|
|
28
32
|
var dataTestIds$1 = require('./large-text-input/exported-related/data-test-ids.js');
|
|
29
|
-
var theming$
|
|
33
|
+
var theming$2 = require('./large-text-input/exported-related/theming.js');
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
exports.DSAutocomplete = Autocomplete.DSAutocomplete;
|
|
34
38
|
exports.DSAutocompleteWithSchema = Autocomplete.DSAutocompleteWithSchema;
|
|
39
|
+
exports.DSInputGroup = InputGroup.DSInputGroup;
|
|
40
|
+
exports.DSInputGroupWithSchema = InputGroup.DSInputGroupWithSchema;
|
|
41
|
+
exports.InputGroupDataTestIds = InputGroupDataTestIds.InputGroupDataTestIds;
|
|
35
42
|
exports.DSControlledCheckbox = ControlledCheckbox.DSControlledCheckbox;
|
|
36
43
|
exports.DSControlledCheckboxWithSchema = ControlledCheckbox.DSControlledCheckboxWithSchema;
|
|
37
44
|
exports.DSComboBox = ComboBox.DSComboBox;
|
|
38
45
|
exports.DSComboBoxV3 = ComboBox.DSComboBox;
|
|
39
46
|
exports.DSComboBoxWithSchema = ComboBox.DSComboBoxWithSchema;
|
|
47
|
+
exports.DSComboBoxName = theming.DSComboBoxName;
|
|
48
|
+
exports.DSComboboxSlots = theming.DSComboboxSlots;
|
|
49
|
+
exports.ComboboxDataTestid = ComboboxDataTestids.ComboboxDataTestid;
|
|
40
50
|
exports.DSControlledDateRangePicker = ControlledDateRangePicker.DSControlledDateRangePicker;
|
|
41
51
|
exports.DSControlledDateRangePickerWithSchema = ControlledDateRangePicker.DSControlledDateRangePickerWithSchema;
|
|
42
52
|
exports.ControlledDateRangePickerDatatestid = ControlledDateRangePickerDatatestid.ControlledDateRangePickerDatatestid;
|
|
@@ -63,7 +73,6 @@ exports.UseSSNMaskWithSchema = useSSNMask.UseSSNMaskWithSchema;
|
|
|
63
73
|
exports.getSSNMaskedValue = useSSNMask.getSSNMaskedValue;
|
|
64
74
|
exports.useSSNMask = useSSNMask.useSSNMask;
|
|
65
75
|
exports.UseRegExpMaskWithSchema = useRegExpMask.UseRegExpMaskWithSchema;
|
|
66
|
-
exports.isRegExp = useRegExpMask.isRegExp;
|
|
67
76
|
exports.useRegExpMask = useRegExpMask.useRegExpMask;
|
|
68
77
|
exports.UseZipCodeMaskWithSchema = useZipCodeMask.UseZipCodeMaskWithSchema;
|
|
69
78
|
exports.getUseZipMaskedValue = useZipCodeMask.getUseZipMaskedValue;
|
|
@@ -71,12 +80,12 @@ exports.useZipCodeMask = useZipCodeMask.useZipCodeMask;
|
|
|
71
80
|
exports.DSInputText = DSInputText.DSInputText;
|
|
72
81
|
exports.DSInputTextWithSchema = DSInputText.DSInputTextWithSchema;
|
|
73
82
|
exports.DSInputTextDataTestIds = dataTestIds.DSInputTextDataTestIds;
|
|
74
|
-
exports.DSInputTextName = theming.DSInputTextName;
|
|
75
|
-
exports.DSInputTextSlots = theming.DSInputTextSlots;
|
|
83
|
+
exports.DSInputTextName = theming$1.DSInputTextName;
|
|
84
|
+
exports.DSInputTextSlots = theming$1.DSInputTextSlots;
|
|
76
85
|
exports.DSControlledToggle = ControlledToggle.DSControlledToggle;
|
|
77
86
|
exports.DSControlledToggleWithSchema = ControlledToggle.DSControlledToggleWithSchema;
|
|
78
87
|
exports.DSControlledLargeTextInput = DSControlledLargeTextInput.DSControlledLargeTextInput;
|
|
79
88
|
exports.DSControlledLargeTextInputWithSchema = DSControlledLargeTextInput.DSControlledLargeTextInputWithSchema;
|
|
80
89
|
exports.DSControlledLargetTextInputDatatestids = dataTestIds$1.DSControlledLargetTextInputDatatestids;
|
|
81
|
-
exports.DSControlledLargeTextInputName = theming$
|
|
82
|
-
exports.DSControlledLargeTextInputSlots = theming$
|
|
90
|
+
exports.DSControlledLargeTextInputName = theming$2.DSControlledLargeTextInputName;
|
|
91
|
+
exports.DSControlledLargeTextInputSlots = theming$2.DSControlledLargeTextInputSlots;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
+
var React = require('react');
|
|
13
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
14
|
+
var styled = require('./styled.js');
|
|
15
|
+
var reactDescPropTypes = require('./react-desc-prop-types.js');
|
|
16
|
+
var InputGroupDataTestIds = require('./InputGroupDataTestIds.js');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
const DSInputGroup = props => {
|
|
29
|
+
dsPropsHelpers.useValidateTypescriptPropTypes(props, reactDescPropTypes.propTypes);
|
|
30
|
+
const {
|
|
31
|
+
children,
|
|
32
|
+
leftAddon,
|
|
33
|
+
rightAddon
|
|
34
|
+
} = props;
|
|
35
|
+
const globals = dsPropsHelpers.useGetGlobalAttributes(props);
|
|
36
|
+
const cols = React.useMemo(() => {
|
|
37
|
+
if (leftAddon && rightAddon) {
|
|
38
|
+
return ['max-content', 'auto', 'max-content'];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (leftAddon && !rightAddon) {
|
|
42
|
+
return ['max-content', 'auto'];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!leftAddon && rightAddon) {
|
|
46
|
+
return ['auto', 'max-content'];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return ['auto'];
|
|
50
|
+
}, [leftAddon, rightAddon]);
|
|
51
|
+
return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledContainer, _objectSpread(_objectSpread({
|
|
52
|
+
cols: cols,
|
|
53
|
+
"data-testid": InputGroupDataTestIds.InputGroupDataTestIds.CONTAINER
|
|
54
|
+
}, globals), {}, {
|
|
55
|
+
children: [leftAddon && /*#__PURE__*/_jsx__default["default"](styled.StyledLeftAddon, {
|
|
56
|
+
"data-testid": InputGroupDataTestIds.InputGroupDataTestIds.LEFTADDON
|
|
57
|
+
}, void 0, leftAddon), /*#__PURE__*/_jsx__default["default"](styled.StyledInput, {
|
|
58
|
+
"data-testid": InputGroupDataTestIds.InputGroupDataTestIds.INPUTCONTAINER
|
|
59
|
+
}, void 0, children), rightAddon && /*#__PURE__*/_jsx__default["default"](styled.StyledRightAddon, {
|
|
60
|
+
"data-testid": InputGroupDataTestIds.InputGroupDataTestIds.RIGHTADDON
|
|
61
|
+
}, void 0, rightAddon)]
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const DSInputGroupWithSchema = dsPropsHelpers.describe(DSInputGroup);
|
|
66
|
+
DSInputGroupWithSchema.propTypes = reactDescPropTypes.propTypes;
|
|
67
|
+
|
|
68
|
+
exports.DSInputGroup = DSInputGroup;
|
|
69
|
+
exports.DSInputGroupWithSchema = DSInputGroupWithSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const InputGroupDataTestIds = {
|
|
6
|
+
CONTAINER: 'ds-input-group-container',
|
|
7
|
+
LEFTADDON: 'ds-input-group-left-addon',
|
|
8
|
+
RIGHTADDON: 'ds-input-group-right-addon',
|
|
9
|
+
INPUTCONTAINER: 'ds-input-group-input-container'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.InputGroupDataTestIds = InputGroupDataTestIds;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var InputGroup = require('./InputGroup.js');
|
|
6
|
+
var InputGroupDataTestIds = require('./InputGroupDataTestIds.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DSInputGroup = InputGroup.DSInputGroup;
|
|
11
|
+
exports.DSInputGroupWithSchema = InputGroup.DSInputGroupWithSchema;
|
|
12
|
+
exports.InputGroupDataTestIds = InputGroupDataTestIds.InputGroupDataTestIds;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
|
+
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8
|
+
const propTypes = {
|
|
9
|
+
leftAddon: dsPropsHelpers.PropTypes.element.description('Component to be added at the left side of the input'),
|
|
10
|
+
rightAddon: dsPropsHelpers.PropTypes.element.description('Component to be added at the right side of the input'),
|
|
11
|
+
children: dsPropsHelpers.PropTypes.node.isRequired.description('React component to apply autocomplete functionality').defaultValue('')
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.propTypes = propTypes;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var dsGrid = require('@elliemae/ds-grid');
|
|
7
|
+
require('../text-input/DSInputText.js');
|
|
8
|
+
var theming = require('../text-input/exported-related/theming.js');
|
|
9
|
+
require('../combobox/ComboBox.js');
|
|
10
|
+
var theming$1 = require('../combobox/theming.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
|
+
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
17
|
+
const StyledContainer = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
18
|
+
componentId: "sc-12elcva-0"
|
|
19
|
+
})(["width:100%;height:28px;& > div:nth-child(1){.", "-", ",.", "-", ",.", "-", "{border-top-right-radius:0;border-bottom-right-radius:0;}}& > div:nth-child(2):nth-last-child(2){.", "-", ",.", "-", ",.", "-", "{border-radius:0;}}& > div:nth-child(2):nth-last-child(1){.", "-", ",.", "-", ",.", "-", "{border-top-left-radius:0;border-bottom-left-radius:0;}}"], theming.DSInputTextName, theming.DSInputTextSlots.INPUT_WRAPPER, theming.DSInputTextName, theming.DSInputTextSlots.INPUT, theming$1.DSComboBoxName, theming$1.DSComboboxSlots.INPUT_WRAPPER, theming.DSInputTextName, theming.DSInputTextSlots.INPUT_WRAPPER, theming.DSInputTextName, theming.DSInputTextSlots.INPUT, theming$1.DSComboBoxName, theming$1.DSComboboxSlots.INPUT_WRAPPER, theming.DSInputTextName, theming.DSInputTextSlots.INPUT_WRAPPER, theming.DSInputTextName, theming.DSInputTextSlots.INPUT, theming$1.DSComboBoxName, theming$1.DSComboboxSlots.INPUT_WRAPPER);
|
|
20
|
+
const StyledAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
21
|
+
componentId: "sc-12elcva-1"
|
|
22
|
+
})(["outline:1px solid ", ";outline-offset:-1px;height:inherit;display:flex;button{border-width:1px;}&:hover{z-index:1;button:not(:disabled){border:1px solid ", ";}}&:focus-within{z-index:1;}"], _ref => {
|
|
23
|
+
let {
|
|
24
|
+
theme
|
|
25
|
+
} = _ref;
|
|
26
|
+
return theme.colors.neutral['400'];
|
|
27
|
+
}, _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
theme
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return theme.colors.brand['700'];
|
|
32
|
+
});
|
|
33
|
+
const StyledLeftAddon = /*#__PURE__*/styled__default["default"](StyledAddon).withConfig({
|
|
34
|
+
componentId: "sc-12elcva-2"
|
|
35
|
+
})(["border-top-left-radius:2px;border-bottom-left-radius:2px;margin-right:-1px;&:hover{button:not(:disabled){border-top-right-radius:0px;border-bottom-right-radius:0px;}}"]);
|
|
36
|
+
const StyledRightAddon = /*#__PURE__*/styled__default["default"](StyledAddon).withConfig({
|
|
37
|
+
componentId: "sc-12elcva-3"
|
|
38
|
+
})(["border-top-right-radius:2px;border-bottom-right-radius:2px;margin-left:-1px;&:hover{button:not(:disabled){border-top-left-radius:0px;border-bottom-left-radius:0px;}}"]);
|
|
39
|
+
const StyledInput = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
40
|
+
componentId: "sc-12elcva-4"
|
|
41
|
+
})(["&:focus-within,&:hover{z-index:1;}"]);
|
|
42
|
+
|
|
43
|
+
exports.StyledContainer = StyledContainer;
|
|
44
|
+
exports.StyledInput = StyledInput;
|
|
45
|
+
exports.StyledLeftAddon = StyledLeftAddon;
|
|
46
|
+
exports.StyledRightAddon = StyledRightAddon;
|
|
@@ -20,7 +20,6 @@ exports.UseSSNMaskWithSchema = useSSNMask.UseSSNMaskWithSchema;
|
|
|
20
20
|
exports.getSSNMaskedValue = useSSNMask.getSSNMaskedValue;
|
|
21
21
|
exports.useSSNMask = useSSNMask.useSSNMask;
|
|
22
22
|
exports.UseRegExpMaskWithSchema = useRegExpMask.UseRegExpMaskWithSchema;
|
|
23
|
-
exports.isRegExp = useRegExpMask.isRegExp;
|
|
24
23
|
exports.useRegExpMask = useRegExpMask.useRegExpMask;
|
|
25
24
|
exports.UseZipCodeMaskWithSchema = useZipCodeMask.UseZipCodeMaskWithSchema;
|
|
26
25
|
exports.getUseZipMaskedValue = useZipCodeMask.getUseZipMaskedValue;
|
|
@@ -22,8 +22,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
22
22
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
23
|
|
|
24
24
|
const _excluded = ["valueSetter", "onChange", "onKeyDown", "onBlur"];
|
|
25
|
-
const phoneSpecialChars = [['(', 0], [') ', 4], ['-', 9]];
|
|
26
|
-
const internationalPhoneSpecialChars = [['+1 (', 0], [') ', 7], ['-', 12]];
|
|
25
|
+
const phoneSpecialChars = [['(', 0], [') ', 4], [' - ', 9]];
|
|
26
|
+
const internationalPhoneSpecialChars = [['+1 (', 0], [') ', 7], [' - ', 12]];
|
|
27
27
|
|
|
28
28
|
const conformValue = (rawValue, cursorPos, lastKeyCode, opts) => {
|
|
29
29
|
const characters = rawValue.split(''); // Work with digits only
|
|
@@ -118,5 +118,4 @@ const UseRegExpMaskWithSchema = dsPropsHelpers.describe(useRegExpMask);
|
|
|
118
118
|
UseRegExpMaskWithSchema.propTypes = reactDescPropTypes.DSMaskRegExpHookPropsTypes;
|
|
119
119
|
|
|
120
120
|
exports.UseRegExpMaskWithSchema = UseRegExpMaskWithSchema;
|
|
121
|
-
exports.isRegExp = isRegExp;
|
|
122
121
|
exports.useRegExpMask = useRegExpMask;
|
package/cjs/mask-hook/index.js
CHANGED
|
@@ -20,7 +20,6 @@ exports.UseSSNMaskWithSchema = useSSNMask.UseSSNMaskWithSchema;
|
|
|
20
20
|
exports.getSSNMaskedValue = useSSNMask.getSSNMaskedValue;
|
|
21
21
|
exports.useSSNMask = useSSNMask.useSSNMask;
|
|
22
22
|
exports.UseRegExpMaskWithSchema = useRegExpMask.UseRegExpMaskWithSchema;
|
|
23
|
-
exports.isRegExp = useRegExpMask.isRegExp;
|
|
24
23
|
exports.useRegExpMask = useRegExpMask.useRegExpMask;
|
|
25
24
|
exports.UseZipCodeMaskWithSchema = useZipCodeMask.UseZipCodeMaskWithSchema;
|
|
26
25
|
exports.getUseZipMaskedValue = useZipCodeMask.getUseZipMaskedValue;
|
|
@@ -15,7 +15,7 @@ const readOnlyBorderCss = dsSystem.css(_templateObject2 || (_templateObject2 = _
|
|
|
15
15
|
const disabledBorderCss = commonBorderCss;
|
|
16
16
|
const hasErrorBorderCss = dsSystem.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n border: 1px solid ", ";\n"])), dsSystem.th.color('danger-900'));
|
|
17
17
|
const hoverBorderCss = dsSystem.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral__default["default"](["\n border: 1px solid ", ";\n"])), dsSystem.th.color('brand-700'));
|
|
18
|
-
const focusBorderCss = dsSystem.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral__default["default"](["\n border: 1px solid transparent;\n outline: 2px solid ", ";\n outline-offset: -
|
|
18
|
+
const focusBorderCss = dsSystem.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral__default["default"](["\n border: 1px solid transparent;\n outline: 2px solid ", ";\n outline-offset: -2px;\n"])), dsSystem.th.color('brand-700'));
|
|
19
19
|
const getBorderCss = props => {
|
|
20
20
|
if (props.isDisabled) return disabledBorderCss;
|
|
21
21
|
if (props.hasFocus) return focusBorderCss;
|