@elliemae/ds-controlled-form 2.4.2-rc.12 → 2.4.2-rc.15
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 +0 -1
- package/cjs/autocomplete/parts/A11yFocusedOption.js +9 -6
- package/cjs/autocomplete/parts/container/Container.js +1 -1
- package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/cjs/autocomplete/parts/menu-list/MenuList.js +3 -5
- package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
- package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/cjs/checkbox/config/useValidateProps.js +6 -3
- package/cjs/checkbox/styles.js +72 -28
- package/cjs/checkbox/utils/styleHelpers.js +20 -2
- package/cjs/combobox/config/useComboBox.js +1 -2
- package/cjs/combobox/config/useCorrectOptions.js +1 -2
- package/cjs/combobox/parts/A11yFocusedOption.js +4 -4
- package/cjs/combobox/parts/A11ySelectedValues.js +2 -2
- package/cjs/combobox/parts/DropdownIndicator.js +13 -5
- package/cjs/combobox/parts/container/Container.js +1 -1
- package/cjs/combobox/parts/container/styled.js +11 -10
- package/cjs/combobox/parts/controls/Controls.js +3 -9
- package/cjs/combobox/parts/controls/styled.js +54 -22
- package/cjs/combobox/parts/controls/useOnPillsNavigation.js +4 -12
- package/cjs/combobox/parts/controls-input/styled.js +41 -11
- package/cjs/combobox/parts/controls-input/useControlsInput.js +1 -5
- package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +4 -6
- package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +1 -1
- package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
- package/cjs/combobox/parts/header-list/styled.js +39 -10
- package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +4 -11
- package/cjs/combobox/parts/menu-list/MenuList.js +2 -2
- package/cjs/combobox/parts/menu-list/styled.js +37 -21
- package/cjs/combobox/parts/menu-list/useItemRenderer.js +3 -3
- package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/cjs/combobox/parts/styled.js +6 -7
- package/cjs/combobox/sharedTypes.js +2 -2
- package/cjs/combobox/utils/listHelper.js +4 -9
- package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
- package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/cjs/date-time-picker/config/useChangeHandlers.js +3 -3
- package/cjs/date-time-picker/config/useControlledDateTimePicker.js +1 -1
- package/cjs/date-time-picker/config/useFocusTracker.js +1 -1
- package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/cjs/date-time-picker/config/useGetReferences.js +1 -1
- package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/cjs/date-time-picker/config/useValidateProps.js +42 -11
- package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
- package/cjs/date-time-picker/parts/DateInputs/DDInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/MMInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
- package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
- package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +1 -2
- package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
- package/cjs/date-time-picker/parts/Styleds.js +12 -6
- package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
- package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
- package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
- package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
- package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
- package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
- package/cjs/input-group/styled.js +79 -13
- package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/cjs/large-text-input/styles.js +27 -13
- package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
- package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
- package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
- package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
- package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/cjs/mask-hook/utils/flatStringArray.js +0 -1
- package/cjs/text-input/config/useInputText.js +0 -1
- package/cjs/text-input/styled/borders.js +18 -11
- package/cjs/text-input/styled/components.js +49 -10
- package/cjs/toggle/ControlledToggle.js +2 -3
- package/cjs/toggle/styles.js +7 -5
- package/esm/autocomplete/config/useAutocomplete.js +0 -1
- package/esm/autocomplete/parts/A11yFocusedOption.js +9 -5
- package/esm/autocomplete/parts/container/Container.js +1 -1
- package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/esm/autocomplete/parts/menu-list/MenuList.js +3 -5
- package/esm/autocomplete/parts/menu-list/styled.js +2 -2
- package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/esm/checkbox/config/useValidateProps.js +6 -3
- package/esm/checkbox/styles.js +72 -24
- package/esm/checkbox/utils/styleHelpers.js +20 -2
- package/esm/combobox/config/useComboBox.js +0 -1
- package/esm/combobox/config/useCorrectOptions.js +1 -2
- package/esm/combobox/parts/A11yFocusedOption.js +4 -4
- package/esm/combobox/parts/A11ySelectedValues.js +2 -2
- package/esm/combobox/parts/DropdownIndicator.js +13 -4
- package/esm/combobox/parts/container/Container.js +1 -1
- package/esm/combobox/parts/container/styled.js +11 -6
- package/esm/combobox/parts/controls/Controls.js +3 -9
- package/esm/combobox/parts/controls/styled.js +54 -18
- package/esm/combobox/parts/controls/useOnPillsNavigation.js +4 -12
- package/esm/combobox/parts/controls-input/styled.js +41 -7
- package/esm/combobox/parts/controls-input/useControlsInput.js +1 -5
- package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +4 -6
- package/esm/combobox/parts/controls-input/useMaskedOnChange.js +1 -1
- package/esm/combobox/parts/header-list/HeaderList.js +1 -1
- package/esm/combobox/parts/header-list/styled.js +40 -7
- package/esm/combobox/parts/header-list/useHeaderListHandlers.js +4 -11
- package/esm/combobox/parts/menu-list/MenuList.js +2 -2
- package/esm/combobox/parts/menu-list/styled.js +37 -17
- package/esm/combobox/parts/menu-list/useItemRenderer.js +3 -3
- package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/esm/combobox/parts/styled.js +6 -3
- package/esm/combobox/sharedTypes.js +2 -2
- package/esm/combobox/utils/listHelper.js +4 -9
- package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
- package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/esm/date-time-picker/config/useChangeHandlers.js +3 -3
- package/esm/date-time-picker/config/useControlledDateTimePicker.js +1 -1
- package/esm/date-time-picker/config/useFocusTracker.js +1 -1
- package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/esm/date-time-picker/config/useGetReferences.js +1 -1
- package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/esm/date-time-picker/config/useValidateProps.js +42 -11
- package/esm/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
- package/esm/date-time-picker/parts/DateInputs/DDInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/MMInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
- package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
- package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +0 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
- package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
- package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
- package/esm/date-time-picker/parts/Styleds.js +12 -6
- package/esm/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
- package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
- package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
- package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
- package/esm/date-time-picker/utils/dateHelpers.js +17 -34
- package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/esm/date-time-picker/utils/stringHelpers.js +5 -11
- package/esm/input-group/styled.js +79 -9
- package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/esm/large-text-input/styles.js +27 -9
- package/esm/mask-hook/hooks/useNumberMask.js +1 -5
- package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
- package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
- package/esm/mask-hook/hooks/useSSNMask.js +1 -4
- package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/esm/mask-hook/utils/flatStringArray.js +0 -1
- package/esm/text-input/config/useInputText.js +0 -1
- package/esm/text-input/styled/borders.js +18 -7
- package/esm/text-input/styled/components.js +49 -6
- package/esm/toggle/ControlledToggle.js +0 -1
- package/esm/toggle/styles.js +7 -5
- package/package.json +15 -15
- package/types/text-input/config/useInputText.d.ts +3 -3
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
6
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
7
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
8
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
7
6
|
require('core-js/modules/esnext.async-iterator.find.js');
|
|
8
7
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
8
|
require('core-js/modules/esnext.iterator.find.js');
|
|
@@ -15,11 +14,14 @@ var listHelper = require('../utils/listHelper.js');
|
|
|
15
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
15
|
|
|
17
16
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
18
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
const isSeparator = el => el?.type === 'separator';
|
|
19
|
+
const StyledA11ySelectedValues = dsSystem.styled.span`
|
|
20
|
+
width: 1px;
|
|
21
|
+
height: 1px;
|
|
22
|
+
position: absolute;
|
|
23
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
24
|
+
`;
|
|
23
25
|
const A11yFocusedOption = () => {
|
|
24
26
|
const {
|
|
25
27
|
props: {
|
|
@@ -34,7 +36,8 @@ const A11yFocusedOption = () => {
|
|
|
34
36
|
const focusSelectableOptionIdx = selectabledOptions.findIndex(option => option.dsId === focusOptionIdx);
|
|
35
37
|
return /*#__PURE__*/_jsx__default["default"](StyledA11ySelectedValues, {
|
|
36
38
|
"aria-live": "polite"
|
|
37
|
-
}, void 0, !isSeparator(focusOption) && showPopover && focusOption &&
|
|
39
|
+
}, void 0, !isSeparator(focusOption) && showPopover && focusOption && `option ${focusOption.label} focused.${focusSelectableOptionIdx + 1} of ${selectabledOptions.length}
|
|
40
|
+
`);
|
|
38
41
|
}, [options, showPopover, focusOptionIdx]);
|
|
39
42
|
};
|
|
40
43
|
|
|
@@ -57,7 +57,7 @@ const Container = () => {
|
|
|
57
57
|
const childrenWithProps = /*#__PURE__*/React__default["default"].isValidElement(input) ? /*#__PURE__*/React__default["default"].cloneElement(input, {
|
|
58
58
|
'aria-activedescendant': focusOptionIdx
|
|
59
59
|
}) : input;
|
|
60
|
-
const idList = React.useMemo(() =>
|
|
60
|
+
const idList = React.useMemo(() => `${id ? `${id}-` : ''}listbox`, [id]);
|
|
61
61
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
62
62
|
children: [_A11yFocusedOption || (_A11yFocusedOption = /*#__PURE__*/_jsx__default["default"](A11yFocusedOption.A11yFocusedOption, {})), /*#__PURE__*/jsxRuntime.jsxs(styled.StyledContainer, {
|
|
63
63
|
id: id,
|
|
@@ -35,7 +35,7 @@ const useKeyboardNavigation = () => {
|
|
|
35
35
|
|
|
36
36
|
if (e.key === 'Enter' && showPopover) {
|
|
37
37
|
e.preventDefault();
|
|
38
|
-
onSelect(currentItem
|
|
38
|
+
onSelect(currentItem?.label, e);
|
|
39
39
|
setShowPopover(false);
|
|
40
40
|
} // =============================================================================
|
|
41
41
|
// ARROWS UP AND DOWN
|
|
@@ -68,7 +68,7 @@ const useKeyboardNavigation = () => {
|
|
|
68
68
|
if (e.key === 'Escape') {
|
|
69
69
|
setShowPopover(false);
|
|
70
70
|
}
|
|
71
|
-
}, [currentItem
|
|
71
|
+
}, [currentItem?.label, currentItemIndex, onSelect, options, scrollOptionIntoView, setCurrentOption, setShowPopover, showPopover]);
|
|
72
72
|
return {
|
|
73
73
|
onInputKeyDown
|
|
74
74
|
};
|
|
@@ -30,15 +30,13 @@ const MenuList = () => {
|
|
|
30
30
|
} = React.useContext(AutocompleteCTX.AutocompleteContext);
|
|
31
31
|
const ItemRenderer = useItemRenderer.useItemRenderer();
|
|
32
32
|
const handleOnFocus = React.useCallback(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
33
|
+
inputRef.current?.focus();
|
|
36
34
|
}, [inputRef]);
|
|
37
|
-
const idList = React.useMemo(() =>
|
|
35
|
+
const idList = React.useMemo(() => `${id ? `${id}-` : ''}listbox`, [id]);
|
|
38
36
|
return /*#__PURE__*/_jsx__default["default"](styled.StyledListWrapper, {
|
|
39
37
|
tabIndex: -1,
|
|
40
38
|
onMouseDown: e => e.preventDefault(),
|
|
41
|
-
minWidth: referenceElement
|
|
39
|
+
minWidth: referenceElement?.offsetWidth,
|
|
42
40
|
id: idList,
|
|
43
41
|
role: "listbox"
|
|
44
42
|
}, void 0, options.length > 0 && /*#__PURE__*/jsxRuntime.jsx(styled.StyledVirtualListWrapper, {
|
|
@@ -14,7 +14,7 @@ const StyledListWrapper = /*#__PURE__*/styled__default["default"].div.withConfig
|
|
|
14
14
|
let {
|
|
15
15
|
minWidth
|
|
16
16
|
} = _ref;
|
|
17
|
-
return minWidth ?
|
|
17
|
+
return minWidth ? `${minWidth}px` : '100%';
|
|
18
18
|
});
|
|
19
19
|
const StyledList = /*#__PURE__*/styled__default["default"].ul.withConfig({
|
|
20
20
|
componentId: "sc-qt1kwv-1"
|
|
@@ -25,7 +25,7 @@ const StyledVirtualListWrapper = /*#__PURE__*/styled__default["default"].div.wit
|
|
|
25
25
|
let {
|
|
26
26
|
maxHeight
|
|
27
27
|
} = _ref2;
|
|
28
|
-
return
|
|
28
|
+
return `${!maxHeight ? '400' : maxHeight}px`;
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
exports.StyledList = StyledList;
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/es.error.cause.js');
|
|
5
6
|
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
6
7
|
|
|
7
8
|
const throwError = message => {
|
|
8
|
-
throw new Error(
|
|
9
|
+
throw new Error(`DSControlledCheckbox:: ${message}
|
|
10
|
+
`);
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
const useValidateProps = (props, propTypes) => {
|
|
12
14
|
dsPropsHelpers.useValidateTypescriptPropTypes(props, propTypes);
|
|
13
15
|
|
|
14
16
|
if (typeof props.label === 'undefined' && typeof props['aria-label'] === 'undefined') {
|
|
15
|
-
throwError(
|
|
17
|
+
throwError(`Please provide a label or ariaLabel property to use this component.`);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
if (props.checked === 'mixed' && typeof props['aria-controls'] === 'undefined') {
|
|
19
|
-
throwError(
|
|
21
|
+
throwError(`Please provide an ariaControls property to use a checkbox mixed state.
|
|
22
|
+
This property must be a string containing all the ids that this mixed checkbox is controlling.`);
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
|
package/cjs/checkbox/styles.js
CHANGED
|
@@ -2,48 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
5
|
var dsSystem = require('@elliemae/ds-system');
|
|
7
6
|
var styleHelpers = require('./utils/styleHelpers.js');
|
|
8
7
|
var theming = require('./exported-related/theming.js');
|
|
9
8
|
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
13
|
-
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
15
9
|
const StyledContainer = dsSystem.styled('div', {
|
|
16
10
|
name: theming.DSCheckboxName,
|
|
17
11
|
slot: theming.DSCheckboxSlots.CONTAINER
|
|
18
|
-
})
|
|
12
|
+
})`
|
|
13
|
+
display: inline-grid;
|
|
14
|
+
grid-template-rows: min-content;
|
|
15
|
+
grid-template-columns: ${_ref => {
|
|
19
16
|
let {
|
|
20
17
|
theme
|
|
21
18
|
} = _ref;
|
|
22
19
|
return theme.space.xs;
|
|
23
|
-
}
|
|
24
|
-
|
|
20
|
+
}} auto;
|
|
21
|
+
align-items: center;
|
|
22
|
+
`;
|
|
23
|
+
const StyledCheckBox = dsSystem.styled('span')`
|
|
24
|
+
width: ${_ref2 => {
|
|
25
25
|
let {
|
|
26
26
|
theme
|
|
27
27
|
} = _ref2;
|
|
28
28
|
return theme.space.xs;
|
|
29
|
-
}
|
|
29
|
+
}};
|
|
30
|
+
height: ${_ref3 => {
|
|
30
31
|
let {
|
|
31
32
|
theme
|
|
32
33
|
} = _ref3;
|
|
33
34
|
return theme.space.xs;
|
|
34
|
-
}
|
|
35
|
+
}};
|
|
36
|
+
border: 1px solid ${_ref4 => {
|
|
35
37
|
let {
|
|
36
38
|
theme,
|
|
37
39
|
hasError
|
|
38
40
|
} = _ref4;
|
|
39
41
|
return hasError ? theme.colors.danger[900] : theme.colors.neutral[400];
|
|
40
|
-
}
|
|
42
|
+
}};
|
|
43
|
+
border-radius: 2px;
|
|
44
|
+
position: relative;
|
|
45
|
+
background: ${_ref5 => {
|
|
41
46
|
let {
|
|
42
47
|
theme,
|
|
43
48
|
disabled
|
|
44
49
|
} = _ref5;
|
|
45
50
|
return styleHelpers.handleBackgroundColor(theme, disabled);
|
|
46
|
-
}
|
|
51
|
+
}};
|
|
52
|
+
${_ref6 => {
|
|
47
53
|
let {
|
|
48
54
|
theme,
|
|
49
55
|
checked,
|
|
@@ -52,14 +58,18 @@ const StyledCheckBox = dsSystem.styled('span')(_templateObject2 || (_templateObj
|
|
|
52
58
|
hasError
|
|
53
59
|
} = _ref6;
|
|
54
60
|
return styleHelpers.handleCheckmark(theme, checked, disabled, readOnly, hasError);
|
|
55
|
-
}
|
|
61
|
+
}}
|
|
62
|
+
&:focus-within {
|
|
63
|
+
${_ref7 => {
|
|
56
64
|
let {
|
|
57
65
|
theme,
|
|
58
66
|
hasError,
|
|
59
67
|
disabled
|
|
60
68
|
} = _ref7;
|
|
61
|
-
return !disabled && !hasError ?
|
|
62
|
-
}
|
|
69
|
+
return !disabled && !hasError ? `border: 1px solid ${theme.colors.brand[700]}; outline : 1px solid ${theme.colors.brand[700]} ` : undefined;
|
|
70
|
+
}};
|
|
71
|
+
&:hover {
|
|
72
|
+
${_ref8 => {
|
|
63
73
|
let {
|
|
64
74
|
theme,
|
|
65
75
|
checked,
|
|
@@ -68,41 +78,71 @@ const StyledCheckBox = dsSystem.styled('span')(_templateObject2 || (_templateObj
|
|
|
68
78
|
hasError
|
|
69
79
|
} = _ref8;
|
|
70
80
|
return styleHelpers.handleCheckmark(theme, checked, disabled, readOnly, hasError, true);
|
|
71
|
-
}
|
|
81
|
+
}}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
&:hover {
|
|
85
|
+
background: ${_ref9 => {
|
|
72
86
|
let {
|
|
73
87
|
theme,
|
|
74
88
|
checked,
|
|
75
89
|
disabled
|
|
76
90
|
} = _ref9;
|
|
77
91
|
return !disabled && (checked === 'mixed' || checked) ? theme.colors.brand[200] : undefined;
|
|
78
|
-
}
|
|
92
|
+
}};
|
|
93
|
+
${_ref10 => {
|
|
79
94
|
let {
|
|
80
95
|
theme,
|
|
81
96
|
hasError,
|
|
82
97
|
disabled,
|
|
83
98
|
readOnly
|
|
84
99
|
} = _ref10;
|
|
85
|
-
return !hasError && !disabled && !readOnly ?
|
|
86
|
-
}
|
|
87
|
-
|
|
100
|
+
return !hasError && !disabled && !readOnly ? ` border: 1px solid ${theme.colors.brand[600]}` : undefined;
|
|
101
|
+
}};
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
const checkboxStyles = dsSystem.css`
|
|
105
|
+
&:hover {
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
&:disabled {
|
|
109
|
+
cursor: not-allowed;
|
|
110
|
+
}
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
position: absolute;
|
|
114
|
+
top: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
opacity: 0;
|
|
117
|
+
`;
|
|
88
118
|
const StyledInput = dsSystem.styled('input', {
|
|
89
119
|
name: theming.DSCheckboxName,
|
|
90
120
|
slot: theming.DSCheckboxSlots.INPUT
|
|
91
|
-
})
|
|
121
|
+
})`
|
|
122
|
+
${checkboxStyles}
|
|
123
|
+
`;
|
|
92
124
|
const StyledInputMixed = dsSystem.styled('div', {
|
|
93
125
|
name: theming.DSCheckboxName,
|
|
94
126
|
slot: theming.DSCheckboxSlots.INPUT
|
|
95
|
-
})
|
|
127
|
+
})`
|
|
128
|
+
${checkboxStyles}
|
|
129
|
+
`;
|
|
96
130
|
const StyledLabel = dsSystem.styled('label', {
|
|
97
131
|
name: theming.DSCheckboxName,
|
|
98
132
|
slot: theming.DSCheckboxSlots.LABEL
|
|
99
|
-
})
|
|
133
|
+
})`
|
|
134
|
+
&:hover {
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
${_ref11 => {
|
|
100
138
|
let {
|
|
101
139
|
wrapLabel,
|
|
102
140
|
theme
|
|
103
141
|
} = _ref11;
|
|
104
|
-
return wrapLabel ? 'padding: 8px 0px 8px 8px;' :
|
|
105
|
-
}
|
|
142
|
+
return wrapLabel ? 'padding: 8px 0px 8px 8px;' : `padding-left: ${theme.space.xxs}`;
|
|
143
|
+
}};
|
|
144
|
+
|
|
145
|
+
color: ${_ref12 => {
|
|
106
146
|
let {
|
|
107
147
|
theme,
|
|
108
148
|
disabled,
|
|
@@ -110,8 +150,12 @@ const StyledLabel = dsSystem.styled('label', {
|
|
|
110
150
|
checked
|
|
111
151
|
} = _ref12;
|
|
112
152
|
return disabled && checked !== true || readOnly ? theme.colors.neutral[500] : theme.colors.neutral[800];
|
|
113
|
-
}
|
|
114
|
-
|
|
153
|
+
}};
|
|
154
|
+
font-size: 13px;
|
|
155
|
+
line-height: 13px;
|
|
156
|
+
display: inherit;
|
|
157
|
+
`;
|
|
158
|
+
const StyledWrapLabel = dsSystem.styled('span')``;
|
|
115
159
|
|
|
116
160
|
exports.StyledCheckBox = StyledCheckBox;
|
|
117
161
|
exports.StyledContainer = StyledContainer;
|
|
@@ -26,11 +26,29 @@ const handleCheckmark = function (theme, checked, disabled, readOnly, hasError)
|
|
|
26
26
|
let isHovering = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
27
27
|
|
|
28
28
|
if (checked === 'mixed') {
|
|
29
|
-
return
|
|
29
|
+
return `&:before {
|
|
30
|
+
position: absolute;
|
|
31
|
+
content: '';
|
|
32
|
+
top: 6px;
|
|
33
|
+
left: 3px;
|
|
34
|
+
background: ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
|
|
35
|
+
width: ${theme.space.xxs};
|
|
36
|
+
height: 2px;
|
|
37
|
+
}`;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
if (checked) {
|
|
33
|
-
return
|
|
41
|
+
return `&:before {
|
|
42
|
+
position: absolute;
|
|
43
|
+
content: '';
|
|
44
|
+
top: 3px;
|
|
45
|
+
left: 2px;
|
|
46
|
+
border-left: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
|
|
47
|
+
border-bottom: 2px solid ${handleCheckMarkColor(theme, checked, isHovering, disabled, readOnly, hasError)};
|
|
48
|
+
height: 5px;
|
|
49
|
+
width: 10px;
|
|
50
|
+
transform: rotate(-45deg);
|
|
51
|
+
}`;
|
|
34
52
|
}
|
|
35
53
|
|
|
36
54
|
return '';
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
5
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
6
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
7
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
8
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
9
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
11
|
var React = require('react');
|
|
13
12
|
var reactVirtual = require('react-virtual');
|
|
14
13
|
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var uid = require('uid');
|
|
8
7
|
var constants = require('../constants.js');
|
|
@@ -28,7 +27,7 @@ const useCorrectOptions = (propsWithDefaults, inputValue, showSelectedOptions) =
|
|
|
28
27
|
if (onCreate && inputValue && filteredOptions.findIndex(option => option.type === constants.MENU_OPTION_TYPES.OPTION && option.label === inputValue) === -1) {
|
|
29
28
|
const creatableUuid = uid.uid();
|
|
30
29
|
const creatableItem = {
|
|
31
|
-
dsId:
|
|
30
|
+
dsId: `creatable-${creatableUuid}`,
|
|
32
31
|
label: inputValue,
|
|
33
32
|
type: 'creatable'
|
|
34
33
|
};
|
|
@@ -27,7 +27,7 @@ const A11yFocusedOption = () => {
|
|
|
27
27
|
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
28
28
|
const selectabledOptions = listHelper.getSelectableOptions(filteredOptions);
|
|
29
29
|
const focusOption = filteredOptions.find(option => option.dsId === focusOptionIdx);
|
|
30
|
-
const isFocusOptionSelected =
|
|
30
|
+
const isFocusOptionSelected = focusOption?.type === 'option' && listHelper.isSelected(selectedValues, focusOption);
|
|
31
31
|
const focusSelectableOptionIdx = selectabledOptions.findIndex(option => option.dsId === focusOptionIdx);
|
|
32
32
|
const navigationContext = 'Use up and down to choose options,press enter to choose focused option, press Escape to excuse dropdown menu';
|
|
33
33
|
return React.useMemo(() => {
|
|
@@ -35,12 +35,12 @@ const A11yFocusedOption = () => {
|
|
|
35
35
|
"aria-live": "polite",
|
|
36
36
|
"aria-atomic": "false",
|
|
37
37
|
"aria-relevant": "additions text"
|
|
38
|
-
}, menuState,
|
|
39
|
-
if (
|
|
38
|
+
}, menuState, `option ${focusOption?.label} ${isFocusOptionSelected ? 'selected and ' : ''}focused .${focusSelectableOptionIdx + 1} of ${selectabledOptions.length}. ${navigationContext} `);
|
|
39
|
+
if (focusOption?.type === 'creatable') return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
|
|
40
40
|
"aria-live": "assertive",
|
|
41
41
|
"aria-atomic": "false",
|
|
42
42
|
"aria-relevant": "additions text"
|
|
43
|
-
}, menuState,
|
|
43
|
+
}, menuState, `Press enter to Add: ${focusOption?.label}. ${navigationContext}`);
|
|
44
44
|
return null;
|
|
45
45
|
}, [focusOption, menuState, isFocusOptionSelected, focusSelectableOptionIdx, selectabledOptions.length]);
|
|
46
46
|
};
|
|
@@ -25,10 +25,10 @@ const A11ySelectedValues = () => {
|
|
|
25
25
|
|
|
26
26
|
if (Array.isArray(selectedValues)) {
|
|
27
27
|
if (selectedValues.length > 0) {
|
|
28
|
-
msg =
|
|
28
|
+
msg = `Options selected: ${selectedValues.map(item => item.label).join(', ')}`;
|
|
29
29
|
}
|
|
30
30
|
} else if (selectedValues) {
|
|
31
|
-
msg =
|
|
31
|
+
msg = `Option selected: ${selectedValues?.label}`;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var dsSystem = require('@elliemae/ds-system');
|
|
9
8
|
var DSButton = require('@elliemae/ds-button');
|
|
@@ -14,16 +13,25 @@ var ComboboxDataTestids = require('../ComboboxDataTestids.js');
|
|
|
14
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
14
|
|
|
16
15
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const StyledDropDownButton = dsSystem.styled(DSButton.DSButtonV2)`
|
|
18
|
+
&:focus::after {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
&:hover:not(:disabled) {
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& svg {
|
|
26
|
+
fill: ${_ref => {
|
|
21
27
|
let {
|
|
22
28
|
theme,
|
|
23
29
|
disabled
|
|
24
30
|
} = _ref;
|
|
25
31
|
return disabled ? theme.colors.neutral['400'] : theme.colors.brand['700'];
|
|
26
|
-
}
|
|
32
|
+
}};
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
27
35
|
const DropdownIndicator = () => {
|
|
28
36
|
const {
|
|
29
37
|
props: {
|
|
@@ -61,7 +61,7 @@ const Container = () => {
|
|
|
61
61
|
}, []);
|
|
62
62
|
const handleCloseMenu = React.useCallback(() => {
|
|
63
63
|
setMenuState(false, 'blur');
|
|
64
|
-
if (innerRef
|
|
64
|
+
if (innerRef?.current) innerRef.current.blur();
|
|
65
65
|
}, [innerRef, setMenuState]);
|
|
66
66
|
React.useEffect(() => {
|
|
67
67
|
const closeMenuOnWindowBlur = () => {
|
|
@@ -2,30 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
5
|
var dsSystem = require('@elliemae/ds-system');
|
|
7
6
|
var theming = require('../../theming.js');
|
|
8
7
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
12
|
-
|
|
13
|
-
var _templateObject, _templateObject2;
|
|
14
8
|
const StyledContainer = dsSystem.styled('div', {
|
|
15
9
|
name: theming.DSComboBoxName,
|
|
16
10
|
slot: theming.DSComboboxSlots.CONTAINER
|
|
17
|
-
})
|
|
11
|
+
})`
|
|
12
|
+
position: relative;
|
|
13
|
+
cursor: ${_ref => {
|
|
18
14
|
let {
|
|
19
15
|
disabled
|
|
20
16
|
} = _ref;
|
|
21
17
|
return disabled ? 'not-allowed' : 'default';
|
|
22
|
-
}
|
|
23
|
-
|
|
18
|
+
}};
|
|
19
|
+
`;
|
|
20
|
+
const StyledPopperWrapper = dsSystem.styled('div')`
|
|
21
|
+
position: relative;
|
|
22
|
+
cursor: ${_ref2 => {
|
|
24
23
|
let {
|
|
25
24
|
disabled
|
|
26
25
|
} = _ref2;
|
|
27
26
|
return disabled ? 'not-allowed' : 'default';
|
|
28
|
-
}
|
|
27
|
+
}};
|
|
28
|
+
overflow: auto;
|
|
29
|
+
`;
|
|
29
30
|
|
|
30
31
|
exports.StyledContainer = StyledContainer;
|
|
31
32
|
exports.StyledPopperWrapper = StyledPopperWrapper;
|
|
@@ -42,20 +42,16 @@ const Controls = () => {
|
|
|
42
42
|
controlsWrapperRef
|
|
43
43
|
} = React.useContext(ComboBoxCTX.ComboBoxContext);
|
|
44
44
|
const handleOnClick = React.useCallback(() => {
|
|
45
|
-
var _innerRef$current2;
|
|
46
|
-
|
|
47
45
|
if (disabled) return;
|
|
48
46
|
|
|
49
47
|
if (hasFocus && menuState && !inline) {
|
|
50
|
-
var _innerRef$current;
|
|
51
|
-
|
|
52
48
|
setMenuState(false);
|
|
53
49
|
setFocusOptionIdx('');
|
|
54
|
-
|
|
50
|
+
innerRef.current?.blur();
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
57
53
|
|
|
58
|
-
|
|
54
|
+
innerRef.current?.focus();
|
|
59
55
|
setMenuState(true);
|
|
60
56
|
window.requestAnimationFrame(() => {
|
|
61
57
|
window.requestAnimationFrame(() => {
|
|
@@ -68,9 +64,7 @@ const Controls = () => {
|
|
|
68
64
|
if (menuState || disabled) {
|
|
69
65
|
e.stopPropagation();
|
|
70
66
|
} else {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.focus();
|
|
67
|
+
innerRef.current?.focus();
|
|
74
68
|
setMenuState(true);
|
|
75
69
|
}
|
|
76
70
|
}, [menuState, innerRef, disabled, setMenuState]); // callback to prevent onBlur on the input when clicking in all the wrapper
|