@elliemae/ds-form 2.1.0-rc.3 → 2.1.0-rc.7

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.
Files changed (155) hide show
  1. package/cjs/ComboBox/index.js +0 -3
  2. package/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +0 -1
  3. package/cjs/MenuItem/components/MultiMenuItem/MultiMenuItem.js +2 -1
  4. package/cjs/index.js +0 -2
  5. package/esm/ComboBox/index.js +0 -1
  6. package/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js +0 -1
  7. package/esm/MenuItem/components/MultiMenuItem/MultiMenuItem.js +2 -1
  8. package/esm/index.js +0 -1
  9. package/package.json +23 -207
  10. package/types/ComboBox/index.d.ts +0 -1
  11. package/types/MenuItem/components/SubmenuItem/styled.d.ts +1 -1
  12. package/types/MenuItem/components/styled.d.ts +3 -3
  13. package/types/MenuItem/props.d.ts +1 -0
  14. package/cjs/ComboBox/v3/ComboBox.js +0 -33
  15. package/cjs/ComboBox/v3/ComboBoxCTX.js +0 -55
  16. package/cjs/ComboBox/v3/ComboboxDataTestids.js +0 -17
  17. package/cjs/ComboBox/v3/config/constants.js +0 -14
  18. package/cjs/ComboBox/v3/config/useComboBox.js +0 -122
  19. package/cjs/ComboBox/v3/config/useGetPropsWithDefault.js +0 -11
  20. package/cjs/ComboBox/v3/index.d.js +0 -2
  21. package/cjs/ComboBox/v3/index.js +0 -10
  22. package/cjs/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.js +0 -33
  23. package/cjs/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.js +0 -28
  24. package/cjs/ComboBox/v3/parts/a11y-messages/index.js +0 -11
  25. package/cjs/ComboBox/v3/parts/a11y-messages/styled.js +0 -15
  26. package/cjs/ComboBox/v3/parts/container/Container.js +0 -67
  27. package/cjs/ComboBox/v3/parts/container/index.js +0 -9
  28. package/cjs/ComboBox/v3/parts/container/styled.js +0 -23
  29. package/cjs/ComboBox/v3/parts/controls/Controls.js +0 -71
  30. package/cjs/ComboBox/v3/parts/controls/index.js +0 -9
  31. package/cjs/ComboBox/v3/parts/controls/styled.js +0 -65
  32. package/cjs/ComboBox/v3/parts/controls-input/ControlsInput.js +0 -67
  33. package/cjs/ComboBox/v3/parts/controls-input/styled.js +0 -27
  34. package/cjs/ComboBox/v3/parts/controls-input/useControlsInput.js +0 -77
  35. package/cjs/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.js +0 -33
  36. package/cjs/ComboBox/v3/parts/dropdown-indicator/index.js +0 -2
  37. package/cjs/ComboBox/v3/parts/dropdown-indicator/styled.js +0 -17
  38. package/cjs/ComboBox/v3/parts/empty-state/index.js +0 -27
  39. package/cjs/ComboBox/v3/parts/empty-state/styled.js +0 -19
  40. package/cjs/ComboBox/v3/parts/header-list/HeaderList.js +0 -113
  41. package/cjs/ComboBox/v3/parts/header-list/index.js +0 -9
  42. package/cjs/ComboBox/v3/parts/header-list/styled.js +0 -58
  43. package/cjs/ComboBox/v3/parts/header-list/useHeaderListHandlers.js +0 -73
  44. package/cjs/ComboBox/v3/parts/menu-list/MenuList.js +0 -81
  45. package/cjs/ComboBox/v3/parts/menu-list/index.js +0 -9
  46. package/cjs/ComboBox/v3/parts/menu-list/styled.js +0 -33
  47. package/cjs/ComboBox/v3/parts/menu-list/useItemRenderer.js +0 -105
  48. package/cjs/ComboBox/v3/parts/menu-list/useMenuList.js +0 -61
  49. package/cjs/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +0 -63
  50. package/cjs/ComboBox/v3/parts/multi-selected-values-container/index.js +0 -9
  51. package/cjs/ComboBox/v3/parts/multi-selected-values-container/styled.js +0 -23
  52. package/cjs/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.js +0 -71
  53. package/cjs/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.js +0 -28
  54. package/cjs/ComboBox/v3/parts/single-selected-value-container/index.js +0 -9
  55. package/cjs/ComboBox/v3/parts/single-selected-value-container/styled.js +0 -15
  56. package/cjs/ComboBox/v3/propTypes.js +0 -25
  57. package/cjs/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +0 -152
  58. package/cjs/ComboBox/v3/utils/hooks/useOnElementResize.js +0 -37
  59. package/cjs/ComboBox/v3/utils/listHelper.js +0 -39
  60. package/esm/ComboBox/v3/ComboBox.js +0 -24
  61. package/esm/ComboBox/v3/ComboBoxCTX.js +0 -49
  62. package/esm/ComboBox/v3/ComboboxDataTestids.js +0 -13
  63. package/esm/ComboBox/v3/config/constants.js +0 -10
  64. package/esm/ComboBox/v3/config/useComboBox.js +0 -114
  65. package/esm/ComboBox/v3/config/useGetPropsWithDefault.js +0 -7
  66. package/esm/ComboBox/v3/index.d.js +0 -1
  67. package/esm/ComboBox/v3/index.js +0 -1
  68. package/esm/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.js +0 -25
  69. package/esm/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.js +0 -20
  70. package/esm/ComboBox/v3/parts/a11y-messages/index.js +0 -2
  71. package/esm/ComboBox/v3/parts/a11y-messages/styled.js +0 -7
  72. package/esm/ComboBox/v3/parts/container/Container.js +0 -59
  73. package/esm/ComboBox/v3/parts/container/index.js +0 -1
  74. package/esm/ComboBox/v3/parts/container/styled.js +0 -13
  75. package/esm/ComboBox/v3/parts/controls/Controls.js +0 -63
  76. package/esm/ComboBox/v3/parts/controls/index.js +0 -1
  77. package/esm/ComboBox/v3/parts/controls/styled.js +0 -52
  78. package/esm/ComboBox/v3/parts/controls-input/ControlsInput.js +0 -59
  79. package/esm/ComboBox/v3/parts/controls-input/styled.js +0 -16
  80. package/esm/ComboBox/v3/parts/controls-input/useControlsInput.js +0 -73
  81. package/esm/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.js +0 -26
  82. package/esm/ComboBox/v3/parts/dropdown-indicator/index.js +0 -1
  83. package/esm/ComboBox/v3/parts/dropdown-indicator/styled.js +0 -8
  84. package/esm/ComboBox/v3/parts/empty-state/index.js +0 -19
  85. package/esm/ComboBox/v3/parts/empty-state/styled.js +0 -10
  86. package/esm/ComboBox/v3/parts/header-list/HeaderList.js +0 -105
  87. package/esm/ComboBox/v3/parts/header-list/index.js +0 -1
  88. package/esm/ComboBox/v3/parts/header-list/styled.js +0 -41
  89. package/esm/ComboBox/v3/parts/header-list/useHeaderListHandlers.js +0 -69
  90. package/esm/ComboBox/v3/parts/menu-list/MenuList.js +0 -73
  91. package/esm/ComboBox/v3/parts/menu-list/index.js +0 -1
  92. package/esm/ComboBox/v3/parts/menu-list/styled.js +0 -23
  93. package/esm/ComboBox/v3/parts/menu-list/useItemRenderer.js +0 -97
  94. package/esm/ComboBox/v3/parts/menu-list/useMenuList.js +0 -57
  95. package/esm/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +0 -54
  96. package/esm/ComboBox/v3/parts/multi-selected-values-container/index.js +0 -1
  97. package/esm/ComboBox/v3/parts/multi-selected-values-container/styled.js +0 -13
  98. package/esm/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.js +0 -67
  99. package/esm/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.js +0 -20
  100. package/esm/ComboBox/v3/parts/single-selected-value-container/index.js +0 -1
  101. package/esm/ComboBox/v3/parts/single-selected-value-container/styled.js +0 -7
  102. package/esm/ComboBox/v3/propTypes.js +0 -21
  103. package/esm/ComboBox/v3/utils/hooks/useKeyboardNavigation.js +0 -148
  104. package/esm/ComboBox/v3/utils/hooks/useOnElementResize.js +0 -33
  105. package/esm/ComboBox/v3/utils/listHelper.js +0 -30
  106. package/types/ComboBox/v3/ComboBox.d.ts +0 -62
  107. package/types/ComboBox/v3/ComboBoxCTX.d.ts +0 -6
  108. package/types/ComboBox/v3/ComboboxDataTestids.d.ts +0 -11
  109. package/types/ComboBox/v3/config/constants.d.ts +0 -8
  110. package/types/ComboBox/v3/config/useComboBox.d.ts +0 -2
  111. package/types/ComboBox/v3/config/useGetPropsWithDefault.d.ts +0 -2
  112. package/types/ComboBox/v3/index.d.ts +0 -1
  113. package/types/ComboBox/v3/parts/a11y-messages/MultiAllyMessages.d.ts +0 -3
  114. package/types/ComboBox/v3/parts/a11y-messages/SingleAllyMessages.d.ts +0 -3
  115. package/types/ComboBox/v3/parts/a11y-messages/index.d.ts +0 -2
  116. package/types/ComboBox/v3/parts/a11y-messages/styled.d.ts +0 -1
  117. package/types/ComboBox/v3/parts/container/Container.d.ts +0 -3
  118. package/types/ComboBox/v3/parts/container/index.d.ts +0 -1
  119. package/types/ComboBox/v3/parts/container/styled.d.ts +0 -3
  120. package/types/ComboBox/v3/parts/controls/Controls.d.ts +0 -3
  121. package/types/ComboBox/v3/parts/controls/index.d.ts +0 -1
  122. package/types/ComboBox/v3/parts/controls/styled.d.ts +0 -7
  123. package/types/ComboBox/v3/parts/controls-input/ControlsInput.d.ts +0 -3
  124. package/types/ComboBox/v3/parts/controls-input/styled.d.ts +0 -4
  125. package/types/ComboBox/v3/parts/controls-input/useControlsInput.d.ts +0 -12
  126. package/types/ComboBox/v3/parts/dropdown-indicator/DropdownIndicator.d.ts +0 -3
  127. package/types/ComboBox/v3/parts/dropdown-indicator/index.d.ts +0 -0
  128. package/types/ComboBox/v3/parts/dropdown-indicator/styled.d.ts +0 -1
  129. package/types/ComboBox/v3/parts/empty-state/index.d.ts +0 -3
  130. package/types/ComboBox/v3/parts/empty-state/styled.d.ts +0 -2
  131. package/types/ComboBox/v3/parts/header-list/HeaderList.d.ts +0 -3
  132. package/types/ComboBox/v3/parts/header-list/index.d.ts +0 -1
  133. package/types/ComboBox/v3/parts/header-list/styled.d.ts +0 -7
  134. package/types/ComboBox/v3/parts/header-list/useHeaderListHandlers.d.ts +0 -12
  135. package/types/ComboBox/v3/parts/menu-list/MenuList.d.ts +0 -3
  136. package/types/ComboBox/v3/parts/menu-list/index.d.ts +0 -1
  137. package/types/ComboBox/v3/parts/menu-list/styled.d.ts +0 -10
  138. package/types/ComboBox/v3/parts/menu-list/useItemRenderer.d.ts +0 -2
  139. package/types/ComboBox/v3/parts/menu-list/useMenuList.d.ts +0 -2
  140. package/types/ComboBox/v3/parts/multi-selected-values-container/MultiSelectedValuesContainer.d.ts +0 -3
  141. package/types/ComboBox/v3/parts/multi-selected-values-container/index.d.ts +0 -1
  142. package/types/ComboBox/v3/parts/multi-selected-values-container/styled.d.ts +0 -3
  143. package/types/ComboBox/v3/parts/multi-selected-values-container/useGroupPills.d.ts +0 -2
  144. package/types/ComboBox/v3/parts/single-selected-value-container/SingleSelectedValueContainer.d.ts +0 -3
  145. package/types/ComboBox/v3/parts/single-selected-value-container/index.d.ts +0 -1
  146. package/types/ComboBox/v3/parts/single-selected-value-container/styled.d.ts +0 -1
  147. package/types/ComboBox/v3/propTypes.d.ts +0 -51
  148. package/types/ComboBox/v3/tests/combobox-general.test.d.ts +0 -1
  149. package/types/ComboBox/v3/tests/combobox-multi-select.test.d.ts +0 -1
  150. package/types/ComboBox/v3/tests/combobox-single-select.test.d.ts +0 -1
  151. package/types/ComboBox/v3/tests/combobox-special-keys.test.d.ts +0 -1
  152. package/types/ComboBox/v3/tests/utils.d.ts +0 -22
  153. package/types/ComboBox/v3/utils/hooks/useKeyboardNavigation.d.ts +0 -4
  154. package/types/ComboBox/v3/utils/hooks/useOnElementResize.d.ts +0 -3
  155. package/types/ComboBox/v3/utils/listHelper.d.ts +0 -7
@@ -1,122 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- require('core-js/modules/web.dom-collections.iterator.js');
7
- require('core-js/modules/esnext.async-iterator.for-each.js');
8
- require('core-js/modules/esnext.iterator.constructor.js');
9
- require('core-js/modules/esnext.iterator.for-each.js');
10
- require('core-js/modules/esnext.async-iterator.find.js');
11
- require('core-js/modules/esnext.iterator.find.js');
12
- require('core-js/modules/esnext.async-iterator.filter.js');
13
- require('core-js/modules/esnext.iterator.filter.js');
14
- var React = require('react');
15
- var reactVirtual = require('react-virtual');
16
- var useGetPropsWithDefault = require('./useGetPropsWithDefault.js');
17
-
18
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
-
20
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
21
-
22
- 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; }
23
-
24
- 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; }
25
- const useComboBox = props => {
26
- const [showPopover, setShowPopover] = React.useState(false);
27
- const [referenceElement, setReferenceElement] = React.useState(null);
28
- const [showSelectedValue, setShowSelectedValue] = React.useState(false);
29
- const [showSelectedOptions, setShowSelectedOptions] = React.useState(false);
30
- const [hasFocus, setHasFocus] = React.useState(false);
31
- const [focusOptionIdx, setCurrentOption] = React.useState('');
32
- const inputRef = React.useRef(null);
33
- const listRef = React.useRef(null);
34
- const wrapperListRef = React.useRef(null);
35
- const selectedOptionsRef = React.useRef(null);
36
- const controlsWrapperRef = React.useRef(null);
37
- const pillGroupRef = React.useRef(null);
38
- const propsWithDefaults = useGetPropsWithDefault.useGetComboBoxWithDefaultsProps(props);
39
- const {
40
- options,
41
- selectedValues
42
- } = propsWithDefaults; // ---------------------------------------------------------------------------
43
- // Menu Options with/out selected filter
44
- // ---------------------------------------------------------------------------
45
-
46
- const selectedValuesWithSections = React.useCallback(() => {
47
- var _items2;
48
-
49
- const multiSelectedValue = selectedValues;
50
- const items = [];
51
- options.forEach(option => {
52
- const isSelectedValue = multiSelectedValue.find(item => item.dsId === option.dsId);
53
-
54
- if (isSelectedValue) {
55
- items.push(option);
56
- }
57
-
58
- if (option.type === 'section') {
59
- var _items;
60
-
61
- if (((_items = items[items.length - 1]) === null || _items === void 0 ? void 0 : _items.type) === 'section') {
62
- items[items.length - 1] = option;
63
- } else {
64
- items.push(option);
65
- }
66
- }
67
- });
68
-
69
- if (((_items2 = items[items.length - 1]) === null || _items2 === void 0 ? void 0 : _items2.type) === 'section') {
70
- items.pop();
71
- }
72
-
73
- return items;
74
- }, [options, selectedValues]);
75
- const correctOptions = React.useMemo(() => showSelectedOptions && Array.isArray(selectedValues) && selectedValues.length > 0 ? selectedValuesWithSections() : options, [options, selectedValuesWithSections, selectedValues, showSelectedOptions]); // ===========================================================================
76
- // Virtualization setup
77
- // ===========================================================================
78
-
79
- const virtualListHelpers = reactVirtual.useVirtual({
80
- size: correctOptions.length,
81
- parentRef: listRef,
82
- overscan: 15,
83
- paddingStart: 0
84
- }); // ===========================================================================
85
- // Scroll into view function
86
- // ===========================================================================
87
-
88
- const scrollOptionIntoView = React.useCallback(function (dsId) {
89
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
90
- align: 'center'
91
- };
92
- virtualListHelpers.scrollToIndex(correctOptions.findIndex(opt => opt.dsId === dsId), opts);
93
- }, [correctOptions, virtualListHelpers]);
94
- const ctx = React.useMemo(() => ({
95
- props: _objectSpread(_objectSpread({}, propsWithDefaults), {}, {
96
- options: correctOptions
97
- }),
98
- virtualListHelpers,
99
- showPopover,
100
- referenceElement,
101
- inputRef,
102
- showSelectedValue,
103
- listRef,
104
- focusOptionIdx,
105
- selectedOptionsRef,
106
- controlsWrapperRef,
107
- hasFocus,
108
- pillGroupRef,
109
- showSelectedOptions,
110
- wrapperListRef,
111
- setShowSelectedOptions,
112
- setHasFocus,
113
- setCurrentOption,
114
- scrollOptionIntoView,
115
- setShowSelectedValue,
116
- setReferenceElement,
117
- setShowPopover
118
- }), [scrollOptionIntoView, correctOptions, propsWithDefaults, virtualListHelpers, focusOptionIdx, showSelectedValue, wrapperListRef, showSelectedOptions, showPopover, pillGroupRef, referenceElement, inputRef, selectedOptionsRef, controlsWrapperRef, hasFocus, listRef]);
119
- return ctx;
120
- };
121
-
122
- exports.useComboBox = useComboBox;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
- var ComboBoxCTX = require('../ComboBoxCTX.js');
7
-
8
- // we have to merge the "default" nested default values with what the user gives us...
9
- const useGetComboBoxWithDefaultsProps = props => dsPropsHelpers.useMemoMergePropsWithDefault(props, ComboBoxCTX.defaultProps);
10
-
11
- exports.useGetComboBoxWithDefaultsProps = useGetComboBoxWithDefaultsProps;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var ComboBox = require('./ComboBox.js');
6
-
7
-
8
-
9
- exports.DSComboBox = ComboBox.DSComboBox;
10
- exports.DSComboBoxWithSchema = ComboBox.DSComboBoxWithSchema;
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('core-js/modules/esnext.async-iterator.map.js');
7
- require('core-js/modules/esnext.iterator.map.js');
8
- var React = require('react');
9
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
10
- var listHelper = require('../../utils/listHelper.js');
11
- var styled = require('./styled.js');
12
-
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
-
15
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
16
-
17
- const MultiAllyMessages = () => {
18
- const {
19
- props: {
20
- options,
21
- selectedValues
22
- }
23
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
24
- const selectableOptions = listHelper.getSelectableOptions(options);
25
- const multipleSelectedValues = selectedValues;
26
- return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
27
- "aria-live": "polite",
28
- "aria-atomic": "false",
29
- "aria-relevant": "additions text"
30
- }, void 0, "Options selected: ".concat(multipleSelectedValues.map(item => item.label).join(', '), ". ").concat(multipleSelectedValues.length, " of ").concat(selectableOptions.length));
31
- };
32
-
33
- exports.MultiAllyMessages = MultiAllyMessages;
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
8
- var styled = require('./styled.js');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
13
-
14
- const SingleAllyMessages = () => {
15
- const {
16
- props: {
17
- selectedValues
18
- }
19
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
20
- const singleSelectedValue = selectedValues;
21
- return /*#__PURE__*/_jsx__default["default"](styled.StyledA11ySelectedValues, {
22
- "aria-live": "polite",
23
- "aria-atomic": "false",
24
- "aria-relevant": "additions text"
25
- }, void 0, "Option selected: ".concat(singleSelectedValue.label, "."));
26
- };
27
-
28
- exports.SingleAllyMessages = SingleAllyMessages;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var MultiAllyMessages = require('./MultiAllyMessages.js');
6
- var SingleAllyMessages = require('./SingleAllyMessages.js');
7
-
8
-
9
-
10
- exports.MultiAllyMessages = MultiAllyMessages.MultiAllyMessages;
11
- exports.SingleAllyMessages = SingleAllyMessages.SingleAllyMessages;
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
-
11
- const StyledA11ySelectedValues = /*#__PURE__*/styled__default["default"].span.withConfig({
12
- componentId: "sc-4xp40i-0"
13
- })(["width:1px;height:1px;position:absolute;clip:rect(1px,1px,1px,1px);"]);
14
-
15
- exports.StyledA11ySelectedValues = StyledA11ySelectedValues;
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var dsPopperjs = require('@elliemae/ds-popperjs');
8
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
9
- var styled = require('./styled.js');
10
- var Controls = require('../controls/Controls.js');
11
- var MenuList = require('../menu-list/MenuList.js');
12
- var jsxRuntime = require('react/jsx-runtime');
13
-
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
-
18
- var _Controls, _MenuList, _MenuList2;
19
-
20
- const Container = () => {
21
- const {
22
- props: {
23
- inline,
24
- startPlacementPreference,
25
- placementOrderPreference
26
- },
27
- showPopover,
28
- inputRef,
29
- setReferenceElement,
30
- setShowPopover,
31
- referenceElement
32
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
33
- const handleCloseMenu = React.useCallback(() => {
34
- setShowPopover(false);
35
- if (inputRef.current) inputRef.current.blur();
36
- }, [inputRef, setShowPopover]);
37
- const handleMouseDown = React.useCallback(e => {
38
- e.preventDefault();
39
- }, []);
40
- const handleOnClickContainer = React.useCallback(() => {
41
- setShowPopover(!showPopover);
42
- }, [setShowPopover, showPopover]);
43
- const StyledContainer = inline ? styled.StyledContainerInline : styled.StyledContainerWithPopper;
44
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
45
- children: [/*#__PURE__*/jsxRuntime.jsxs(StyledContainer, {
46
- ref: setReferenceElement,
47
- onClick: handleOnClickContainer,
48
- children: [_Controls || (_Controls = /*#__PURE__*/_jsx__default["default"](Controls.Controls, {})), inline ? _MenuList || (_MenuList = /*#__PURE__*/_jsx__default["default"](MenuList.MenuList, {})) : null]
49
- }), !inline ? /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
50
- customOffset: [0, 5],
51
- closeContextMenu: handleCloseMenu,
52
- referenceElement: referenceElement,
53
- showPopover: showPopover,
54
- startPlacementPreference: startPlacementPreference,
55
- placementOrderPreference: placementOrderPreference,
56
- withoutPortal: true,
57
- withoutArrow: true,
58
- withoutAnimation: true,
59
- zIndex: 10
60
- }, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledPopperWrapper, {
61
- tabIndex: -1,
62
- onMouseDown: handleMouseDown
63
- }, void 0, _MenuList2 || (_MenuList2 = /*#__PURE__*/_jsx__default["default"](MenuList.MenuList, {})))) : null]
64
- });
65
- };
66
-
67
- exports.Container = Container;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Container = require('./Container.js');
6
-
7
-
8
-
9
- exports.Container = Container.Container;
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
-
11
- const StyledContainerWithPopper = /*#__PURE__*/styled__default["default"].div.withConfig({
12
- componentId: "sc-17wftik-0"
13
- })(["width:100%;height:28px;position:relative;"]);
14
- const StyledContainerInline = /*#__PURE__*/styled__default["default"].div.withConfig({
15
- componentId: "sc-17wftik-1"
16
- })(["width:100%;position:relative;"]);
17
- const StyledPopperWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
18
- componentId: "sc-17wftik-2"
19
- })(["background:#fff;overflow:auto;position:relative;"]);
20
-
21
- exports.StyledContainerInline = StyledContainerInline;
22
- exports.StyledContainerWithPopper = StyledContainerWithPopper;
23
- exports.StyledPopperWrapper = StyledPopperWrapper;
@@ -1,71 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var DropdownIndicator = require('../dropdown-indicator/DropdownIndicator.js');
8
- var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
9
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
10
- var styled = require('./styled.js');
11
- var MultiSelectedValuesContainer = require('../multi-selected-values-container/MultiSelectedValuesContainer.js');
12
- var ControlsInput = require('../controls-input/ControlsInput.js');
13
- var SingleSelectedValueContainer = require('../single-selected-value-container/SingleSelectedValueContainer.js');
14
- var jsxRuntime = require('react/jsx-runtime');
15
-
16
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
-
18
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
19
-
20
- var _MultiSelectedValuesC, _SingleSelectedValueC, _ControlsInput, _StyledHeaderActionsW;
21
-
22
- const Controls = () => {
23
- const {
24
- props: {
25
- inline,
26
- inputMinWidth,
27
- hasError,
28
- selectedValues
29
- },
30
- inputRef,
31
- selectedOptionsRef,
32
- setShowPopover,
33
- showPopover,
34
- hasFocus,
35
- controlsWrapperRef
36
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
37
- const handleOnClick = React.useCallback(() => {
38
- if (hasFocus && showPopover && !inline) {
39
- inputRef.current.blur();
40
- } else if (hasFocus) {
41
- setShowPopover(true);
42
- } else {
43
- inputRef.current.focus();
44
- }
45
- }, [hasFocus, setShowPopover, showPopover, inputRef, inline]);
46
-
47
- const handleOnMouseDown = e => {
48
- if (hasFocus || inline) {
49
- e.preventDefault();
50
- }
51
- };
52
-
53
- const cols = !inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '29px'] : ['minmax(0px, auto)'];
54
- return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledControlsWrapper, {
55
- ref: controlsWrapperRef,
56
- cols: cols,
57
- minWidth: inputMinWidth,
58
- hasError: hasError,
59
- hasFocus: hasFocus,
60
- inline: inline,
61
- onClick: handleOnClick,
62
- onMouseDown: handleOnMouseDown,
63
- children: [!inline && /*#__PURE__*/jsxRuntime.jsx(styled.StyledSelection, {
64
- ref: selectedOptionsRef,
65
- "data-testid": ComboboxDataTestids.ComboboxDataTestid.SELECTED_VALUES,
66
- children: Array.isArray(selectedValues) ? _MultiSelectedValuesC || (_MultiSelectedValuesC = /*#__PURE__*/_jsx__default["default"](MultiSelectedValuesContainer.MultiSelectedValuesContainer, {})) : _SingleSelectedValueC || (_SingleSelectedValueC = /*#__PURE__*/_jsx__default["default"](SingleSelectedValueContainer.SingleSelectedValueContainer, {}))
67
- }), _ControlsInput || (_ControlsInput = /*#__PURE__*/_jsx__default["default"](ControlsInput.ControlsInput, {})), !inline && (_StyledHeaderActionsW || (_StyledHeaderActionsW = /*#__PURE__*/_jsx__default["default"](styled.StyledHeaderActionsWrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyleHeaderActionsSeparator, {}), /*#__PURE__*/_jsx__default["default"](DropdownIndicator, {}))))]
68
- });
69
- };
70
-
71
- exports.Controls = Controls;
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Controls = require('./Controls.js');
6
-
7
-
8
-
9
- exports.Controls = Controls.Controls;
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
- var styled = require('styled-components');
7
- var dsSystem = require('@elliemae/ds-system');
8
- var Grid = require('@elliemae/ds-grid');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
13
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
-
15
- var _templateObject, _templateObject2;
16
- const normalBorder = dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n border: 1px solid\n ", ";\n"])), props => {
17
- if (props.hasError) {
18
- return props.theme.colors.danger[900];
19
- }
20
-
21
- return props.theme.colors.neutral[400];
22
- });
23
- const focusBorder = dsSystem.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n border: 2px solid ", ";\n"])), _ref => {
24
- let {
25
- theme
26
- } = _ref;
27
- return theme.colors.brand[700];
28
- });
29
- const StyledControlsWrapper = /*#__PURE__*/styled__default["default"](Grid.Grid).withConfig({
30
- componentId: "sc-64uci7-0"
31
- })(["background:transparent;position:relative;border-radius:2px;min-width:", ";align-items:center;align-content:center;height:28px;padding-left:8px;margin:", ";&::after{display:block;content:' ';position:absolute;top:0;left:0;right:0;bottom:0;border-radius:2px;", " pointer-events:none;z-index:7;}"], _ref2 => {
32
- let {
33
- minWidth,
34
- inline
35
- } = _ref2;
36
- return inline ? '' : "".concat(minWidth, "px");
37
- }, _ref3 => {
38
- let {
39
- inline
40
- } = _ref3;
41
- return inline ? '10px 16px' : 'none';
42
- }, _ref4 => {
43
- let {
44
- hasFocus
45
- } = _ref4;
46
- return hasFocus ? focusBorder : normalBorder;
47
- });
48
- const StyledSelection = /*#__PURE__*/styled__default["default"].div.withConfig({
49
- componentId: "sc-64uci7-1"
50
- })(["font-size:13px;margin-right:3px;line-height:13px;display:flex;"]);
51
- const StyledHeaderActionsWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
52
- componentId: "sc-64uci7-2"
53
- })(["align-items:center;align-self:stretch;display:flex;box-sizing:border-box;height:28px;.em-ds-button--text:focus::after{border:none;}"]);
54
- const StyleDropdownIndicator = /*#__PURE__*/styled__default["default"].div.withConfig({
55
- componentId: "sc-64uci7-3"
56
- })([""]);
57
- const StyleHeaderActionsSeparator = /*#__PURE__*/styled__default["default"].span.withConfig({
58
- componentId: "sc-64uci7-4"
59
- })(["align-self:stretch;margin:4px 0px;width:1px;background-color:", ";"], props => props.theme.colors.neutral['500']);
60
-
61
- exports.StyleDropdownIndicator = StyleDropdownIndicator;
62
- exports.StyleHeaderActionsSeparator = StyleHeaderActionsSeparator;
63
- exports.StyledControlsWrapper = StyledControlsWrapper;
64
- exports.StyledHeaderActionsWrapper = StyledHeaderActionsWrapper;
65
- exports.StyledSelection = StyledSelection;
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
8
- var ComboboxDataTestids = require('../../ComboboxDataTestids.js');
9
- var styled = require('./styled.js');
10
- var useKeyboardNavigation = require('../../utils/hooks/useKeyboardNavigation.js');
11
- var useControlsInput = require('./useControlsInput.js');
12
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
13
- var jsxRuntime = require('react/jsx-runtime');
14
-
15
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
-
17
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
18
-
19
- const ControlsInput = () => {
20
- const {
21
- props: {
22
- autoFocus
23
- },
24
- showPopover,
25
- focusOptionIdx,
26
- inputRef
27
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
28
- const {
29
- onInputKeyDown
30
- } = useKeyboardNavigation.useKeyboardNavigation();
31
- const {
32
- spanReference,
33
- width,
34
- spanReferenceText,
35
- showPlaceholder,
36
- handleOnBlur,
37
- handleOnChange,
38
- handleOnFocus
39
- } = useControlsInput.useControlsInput();
40
- return /*#__PURE__*/_jsx__default["default"](styled.StyledInputWrapper, {}, void 0, /*#__PURE__*/jsxRuntime.jsx(styled.StyledInputWidthReference, {
41
- ref: spanReference,
42
- children: spanReferenceText
43
- }), /*#__PURE__*/_jsx__default["default"](styled.StyledInputPlaceHolder, {}, void 0, /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText.SimpleTruncatedTooltipText, {
44
- value: showPlaceholder
45
- })), /*#__PURE__*/jsxRuntime.jsx(styled.StyledInput, {
46
- "data-testid": ComboboxDataTestids.ComboboxDataTestid.INPUT,
47
- autoFocus: autoFocus,
48
- "aria-labelledby": "combo-label",
49
- "aria-controls": "combo-listbox",
50
- "aria-owns": "combo-listbox",
51
- "aria-activedescendant": focusOptionIdx,
52
- "aria-expanded": showPopover,
53
- "aria-haspopup": "listbox",
54
- role: "combobox",
55
- style: {
56
- width
57
- },
58
- ref: inputRef,
59
- type: "text",
60
- onKeyDown: onInputKeyDown,
61
- onChange: handleOnChange,
62
- onBlur: handleOnBlur,
63
- onFocus: handleOnFocus
64
- }));
65
- };
66
-
67
- exports.ControlsInput = ControlsInput;
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
-
11
- const StyledInput = /*#__PURE__*/styled__default["default"].input.withConfig({
12
- componentId: "sc-1ue5xik-0"
13
- })(["font-size:13px;line-height:13px;border:none;padding:0;outline:none;color:", ";&:focus{outline:none;}"], props => props.theme.colors.neutral[700]);
14
- const StyledInputPlaceHolder = /*#__PURE__*/styled__default["default"].div.withConfig({
15
- componentId: "sc-1ue5xik-1"
16
- })(["font-style:italic;color:", ";position:absolute;display:flex;align-items:center;width:100%;user-select:none;height:28px;"], props => props.theme.colors.neutral[500]);
17
- const StyledInputWidthReference = /*#__PURE__*/styled__default["default"].span.withConfig({
18
- componentId: "sc-1ue5xik-2"
19
- })(["visibility:hidden;position:absolute;top:-9999px;"]);
20
- const StyledInputWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
21
- componentId: "sc-1ue5xik-3"
22
- })(["position:relative;flex:1;margin-right:5px;display:flex;align-items:center;"]);
23
-
24
- exports.StyledInput = StyledInput;
25
- exports.StyledInputPlaceHolder = StyledInputPlaceHolder;
26
- exports.StyledInputWidthReference = StyledInputWidthReference;
27
- exports.StyledInputWrapper = StyledInputWrapper;
@@ -1,77 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
- require('core-js/modules/es.string.replace.js');
7
- var React = require('react');
8
- var ComboBoxCTX = require('../../ComboBoxCTX.js');
9
- var listHelper = require('../../utils/listHelper.js');
10
-
11
- const useControlsInput = () => {
12
- var _inputRef$current, _inputRef$current2, _inputRef$current3;
13
-
14
- const {
15
- props: {
16
- selectedValues,
17
- placeholder,
18
- onFilter
19
- },
20
- setShowPopover,
21
- setCurrentOption,
22
- inputRef,
23
- wrapperListRef,
24
- setHasFocus,
25
- setShowSelectedValue,
26
- setShowSelectedOptions
27
- } = React.useContext(ComboBoxCTX.ComboBoxContext);
28
- const [width, setWidth] = React.useState(1);
29
- const spanReference = React.useRef(null);
30
- React.useEffect(() => {
31
- var _spanReference$curren;
32
-
33
- setWidth(((_spanReference$curren = spanReference.current) === null || _spanReference$curren === void 0 ? void 0 : _spanReference$curren.offsetWidth) || 1);
34
- }, [(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value]);
35
- React.useEffect(() => {
36
- setShowSelectedValue(true);
37
- }, [selectedValues, setShowSelectedValue]); // When writting open popover
38
- // and refresh selected values and update filter outside value.
39
-
40
- const handleOnChange = React.useCallback(e => {
41
- setShowSelectedOptions(false);
42
- if (e.currentTarget.value) setShowSelectedValue(false);
43
- setShowPopover(true);
44
- onFilter(e.currentTarget.value);
45
- }, [onFilter, setShowPopover, setShowSelectedOptions, setShowSelectedValue]);
46
- const handleOnBlur = React.useCallback(() => {
47
- setHasFocus(false);
48
- setTimeout(() => {
49
- var _wrapperListRef$curre;
50
-
51
- if (!(wrapperListRef !== null && wrapperListRef !== void 0 && (_wrapperListRef$curre = wrapperListRef.current) !== null && _wrapperListRef$curre !== void 0 && _wrapperListRef$curre.contains(document.activeElement))) {
52
- setShowPopover(false);
53
- }
54
-
55
- setCurrentOption('');
56
- setShowSelectedValue(true);
57
- onFilter('');
58
- if (inputRef.current) inputRef.current.value = '';
59
- });
60
- }, [setHasFocus, setCurrentOption, wrapperListRef, onFilter, inputRef, setShowPopover, setShowSelectedValue]);
61
- const handleOnFocus = React.useCallback(() => {
62
- setHasFocus(true);
63
- }, [setHasFocus]);
64
- const showPlaceholder = !((_inputRef$current2 = inputRef.current) !== null && _inputRef$current2 !== void 0 && _inputRef$current2.value) && listHelper.isSelectedValueEmpty(selectedValues) ? placeholder : null;
65
- const spanReferenceText = (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.value.replace(/\s/g, '\u00a0');
66
- return React.useMemo(() => ({
67
- handleOnFocus,
68
- handleOnBlur,
69
- handleOnChange,
70
- showPlaceholder,
71
- spanReferenceText,
72
- width,
73
- spanReference
74
- }), [handleOnFocus, handleOnBlur, handleOnChange, spanReferenceText, showPlaceholder, width, spanReference]);
75
- };
76
-
77
- exports.useControlsInput = useControlsInput;