@elliemae/ds-app-picker 2.2.0-alpha.4 → 3.0.0-next.2
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/AppPickerImpl.js +143 -113
- package/cjs/DSAppPicker.js +101 -104
- package/cjs/index.js +11 -36
- package/cjs/propTypes.js +23 -48
- package/cjs/styles.js +158 -184
- package/cjs/types/AppPickerTypes.js +2 -27
- package/cjs/utils.js +16 -44
- package/esm/AppPickerImpl.js +128 -85
- package/esm/DSAppPicker.js +81 -67
- package/esm/index.js +1 -7
- package/esm/propTypes.js +19 -19
- package/esm/styles.js +148 -159
- package/esm/types/AppPickerTypes.js +1 -2
- package/esm/utils.js +12 -15
- package/package.json +6 -6
- package/cjs/AppPickerImpl.js.map +0 -7
- package/cjs/DSAppPicker.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/cjs/types/AppPickerTypes.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/AppPickerImpl.js.map +0 -7
- package/esm/DSAppPicker.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
- package/esm/types/AppPickerTypes.js.map +0 -7
- package/esm/utils.js.map +0 -7
package/esm/AppPickerImpl.js
CHANGED
|
@@ -1,131 +1,174 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
7
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
11
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
12
|
+
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
13
|
+
import { chunk } from 'lodash';
|
|
14
|
+
import { keys } from './utils.js';
|
|
15
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
16
|
+
import { StyledWrapper, StyledTitle, StyledGrid, StyledSeparator, StyledRow, StyledChip, StyledChipLabel } from './styles.js';
|
|
17
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
var _StyledSeparator;
|
|
20
|
+
|
|
21
|
+
const _excluded = ["label", "disabled", "selected", "icon", "id"];
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
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(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; }
|
|
26
|
+
|
|
27
|
+
const AppPickerImpl = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
apps = [],
|
|
30
|
+
customApps = [],
|
|
31
|
+
sectionTitle = 'APPLICATIONS',
|
|
32
|
+
customSectionTitle = 'CUSTOM APPLICATIONS',
|
|
33
|
+
close = () => null,
|
|
34
|
+
wrapperRef,
|
|
35
|
+
onKeyDown,
|
|
36
|
+
triggerRef,
|
|
37
|
+
isOverflow
|
|
38
|
+
} = _ref;
|
|
27
39
|
const allFocusableButtons = useRef([]);
|
|
28
40
|
const selectedButton = useRef(null);
|
|
29
41
|
useEffect(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
var _wrapperRef$current;
|
|
43
|
+
|
|
44
|
+
wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelectorAll('button').forEach((e, index) => {
|
|
45
|
+
if (!e.hasAttribute('disabled')) {
|
|
46
|
+
var _allFocusableButtons$;
|
|
47
|
+
|
|
48
|
+
allFocusableButtons === null || allFocusableButtons === void 0 ? void 0 : (_allFocusableButtons$ = allFocusableButtons.current) === null || _allFocusableButtons$ === void 0 ? void 0 : _allFocusableButtons$.push(e);
|
|
33
49
|
}
|
|
34
|
-
|
|
50
|
+
|
|
51
|
+
if (e.getAttribute('aria-selected') === 'true') {
|
|
35
52
|
selectedButton.current = index;
|
|
36
53
|
}
|
|
37
54
|
});
|
|
55
|
+
|
|
38
56
|
if (selectedButton.current) {
|
|
39
|
-
|
|
57
|
+
var _wrapperRef$current2;
|
|
58
|
+
|
|
59
|
+
wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current2 = wrapperRef.current) === null || _wrapperRef$current2 === void 0 ? void 0 : _wrapperRef$current2.querySelectorAll('button')[selectedButton.current].focus();
|
|
40
60
|
} else {
|
|
41
|
-
|
|
61
|
+
var _allFocusableButtons$2;
|
|
62
|
+
|
|
63
|
+
allFocusableButtons === null || allFocusableButtons === void 0 ? void 0 : (_allFocusableButtons$2 = allFocusableButtons.current[0]) === null || _allFocusableButtons$2 === void 0 ? void 0 : _allFocusableButtons$2.focus();
|
|
42
64
|
}
|
|
43
|
-
}, [wrapperRef]);
|
|
44
|
-
|
|
65
|
+
}, [wrapperRef]); // eslint-disable-next-line max-statements
|
|
66
|
+
|
|
67
|
+
const handleKeyDown = e => {
|
|
68
|
+
var _triggerRef$current;
|
|
69
|
+
|
|
45
70
|
switch (e.key) {
|
|
46
71
|
case keys.ESC:
|
|
47
|
-
triggerRef
|
|
72
|
+
triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
48
73
|
close();
|
|
49
74
|
break;
|
|
75
|
+
|
|
50
76
|
case keys.TAB:
|
|
51
77
|
if (e.shiftKey) {
|
|
52
78
|
if (e.target === allFocusableButtons.current[0]) {
|
|
79
|
+
var _allFocusableButtons$3;
|
|
80
|
+
|
|
53
81
|
e.preventDefault();
|
|
54
|
-
allFocusableButtons
|
|
82
|
+
allFocusableButtons === null || allFocusableButtons === void 0 ? void 0 : (_allFocusableButtons$3 = allFocusableButtons.current[allFocusableButtons.current.length - 1]) === null || _allFocusableButtons$3 === void 0 ? void 0 : _allFocusableButtons$3.focus();
|
|
55
83
|
}
|
|
56
84
|
} else if (e.target === allFocusableButtons.current[allFocusableButtons.current.length - 1]) {
|
|
85
|
+
var _allFocusableButtons$4;
|
|
86
|
+
|
|
57
87
|
e.preventDefault();
|
|
58
|
-
allFocusableButtons
|
|
88
|
+
allFocusableButtons === null || allFocusableButtons === void 0 ? void 0 : (_allFocusableButtons$4 = allFocusableButtons.current[0]) === null || _allFocusableButtons$4 === void 0 ? void 0 : _allFocusableButtons$4.focus();
|
|
59
89
|
}
|
|
60
|
-
|
|
61
|
-
default:
|
|
90
|
+
|
|
62
91
|
break;
|
|
63
92
|
}
|
|
64
93
|
};
|
|
94
|
+
|
|
65
95
|
const handleOnClick = useCallback((e, app) => {
|
|
66
|
-
if (app.onClick)
|
|
67
|
-
app.onClick(e, app);
|
|
96
|
+
if (app.onClick) app.onClick(e, app);
|
|
68
97
|
}, []);
|
|
69
|
-
const handleOnKeyDownWrapper = useCallback(
|
|
70
|
-
if (onKeyDown)
|
|
71
|
-
|
|
98
|
+
const handleOnKeyDownWrapper = useCallback(e => {
|
|
99
|
+
if (onKeyDown) onKeyDown(e);
|
|
100
|
+
|
|
72
101
|
if (!onKeyDown && e.key === keys.ESC) {
|
|
73
102
|
close();
|
|
74
103
|
}
|
|
75
104
|
}, [onKeyDown, close]);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
|
|
106
|
+
const buildRows = function (appList) {
|
|
107
|
+
let prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
108
|
+
const rows = chunk(appList, 3); // divides array in subarrays of 3 items
|
|
109
|
+
|
|
110
|
+
const formattedRows = rows.map((row, index) => /*#__PURE__*/_jsx(StyledRow, {}, index, row.map((app, key) => {
|
|
111
|
+
const {
|
|
112
|
+
label,
|
|
113
|
+
disabled,
|
|
114
|
+
selected,
|
|
115
|
+
icon: Icon,
|
|
116
|
+
id
|
|
117
|
+
} = app,
|
|
118
|
+
otherProps = _objectWithoutProperties(app, _excluded);
|
|
119
|
+
|
|
120
|
+
return /*#__PURE__*/jsxs(StyledChip, _objectSpread(_objectSpread({
|
|
121
|
+
onClick: e => handleOnClick(e, app),
|
|
85
122
|
onKeyDown: handleKeyDown,
|
|
86
123
|
"data-testid": "app-picker__chip",
|
|
87
124
|
"aria-disabled": disabled,
|
|
88
|
-
disabled,
|
|
89
|
-
selected,
|
|
125
|
+
disabled: disabled,
|
|
126
|
+
selected: selected,
|
|
90
127
|
"aria-selected": selected,
|
|
91
128
|
"aria-setsize": apps.length + customApps.length,
|
|
92
129
|
"aria-posinset": key + prevIndex,
|
|
93
|
-
id
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
130
|
+
id: id
|
|
131
|
+
}, getDataProps(otherProps)), {}, {
|
|
132
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
133
|
+
className: "app-picker__icon",
|
|
134
|
+
size: "m"
|
|
135
|
+
}), /*#__PURE__*/_jsx(StyledChipLabel, {}, void 0, /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
136
|
+
value: label,
|
|
137
|
+
placement: "bottom"
|
|
138
|
+
}))]
|
|
139
|
+
}), key);
|
|
102
140
|
})));
|
|
103
|
-
return
|
|
141
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
142
|
+
children: formattedRows
|
|
143
|
+
});
|
|
104
144
|
};
|
|
145
|
+
|
|
105
146
|
const AppsRows = () => buildRows(apps, 1);
|
|
147
|
+
|
|
106
148
|
const CustomRows = () => buildRows(customApps, apps.length);
|
|
107
|
-
|
|
149
|
+
|
|
150
|
+
return /*#__PURE__*/jsxs(StyledWrapper, {
|
|
108
151
|
role: "listbox",
|
|
109
152
|
ref: wrapperRef,
|
|
110
153
|
onKeyDown: handleOnKeyDownWrapper,
|
|
111
154
|
"data-testid": "app-picker__wrapper",
|
|
112
|
-
isOverflow
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
AppPickerImpl_default as default
|
|
155
|
+
isOverflow: isOverflow,
|
|
156
|
+
children: [/*#__PURE__*/_jsx(StyledTitle, {
|
|
157
|
+
"data-testid": "app-picker__main-title",
|
|
158
|
+
"aria-hidden": true
|
|
159
|
+
}, void 0, sectionTitle), /*#__PURE__*/_jsx(StyledGrid, {
|
|
160
|
+
"data-testid": "app-picker__main-grid"
|
|
161
|
+
}, void 0, /*#__PURE__*/_jsx(AppsRows, {})), !!customApps.length && /*#__PURE__*/jsxs(Fragment, {
|
|
162
|
+
children: [_StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx(StyledSeparator, {
|
|
163
|
+
"aria-hidden": true
|
|
164
|
+
})), /*#__PURE__*/_jsx(StyledTitle, {
|
|
165
|
+
"data-testid": "app-picker__custom-title",
|
|
166
|
+
"aria-hidden": true
|
|
167
|
+
}, void 0, customSectionTitle), /*#__PURE__*/_jsx(StyledGrid, {
|
|
168
|
+
"data-testid": "app-picker__custom-grid"
|
|
169
|
+
}, void 0, /*#__PURE__*/_jsx(CustomRows, {}))]
|
|
170
|
+
})]
|
|
171
|
+
});
|
|
130
172
|
};
|
|
131
|
-
|
|
173
|
+
|
|
174
|
+
export { AppPickerImpl as default };
|
package/esm/DSAppPicker.js
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { describe } from 'react-desc';
|
|
5
|
+
import { MenuPicker } from '@elliemae/ds-icons';
|
|
6
|
+
import DSButton from '@elliemae/ds-button';
|
|
7
|
+
import DSPopover from '@elliemae/ds-popover';
|
|
8
|
+
import { mergeRefs } from '@elliemae/ds-utilities';
|
|
9
|
+
import AppPickerImpl from './AppPickerImpl.js';
|
|
10
|
+
import { propTypes } from './propTypes.js';
|
|
11
|
+
|
|
12
|
+
const DSAppPicker = _ref => {
|
|
13
|
+
var _Icon;
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
apps = [],
|
|
17
|
+
customApps = [],
|
|
18
|
+
sectionTitle = 'APPLICATIONS',
|
|
19
|
+
customSectionTitle = 'CUSTOM APPLICATIONS',
|
|
20
|
+
icon: Icon = () => /*#__PURE__*/_jsx(MenuPicker, {
|
|
21
|
+
fill: ['brand-primary', 700],
|
|
22
|
+
size: "m"
|
|
23
|
+
}),
|
|
24
|
+
renderTrigger,
|
|
25
|
+
isOpen,
|
|
26
|
+
onClose = () => null,
|
|
27
|
+
actionRef,
|
|
28
|
+
onKeyDown,
|
|
29
|
+
onClick = () => null,
|
|
30
|
+
onClickOutside = () => null,
|
|
31
|
+
triggerRef
|
|
32
|
+
} = _ref;
|
|
28
33
|
const [open, setOpen] = useState(false);
|
|
29
34
|
const [isOverflow, setIsOverflow] = useState(false);
|
|
30
35
|
const wrapperRef = useRef(null);
|
|
31
36
|
const defaultTriggerRef = useRef(null);
|
|
32
37
|
useEffect(() => {
|
|
33
38
|
if (actionRef && actionRef.current) {
|
|
34
|
-
actionRef.current.focusToIndex =
|
|
39
|
+
actionRef.current.focusToIndex = index => {
|
|
35
40
|
if (wrapperRef.current) {
|
|
36
41
|
const parent = wrapperRef.current;
|
|
37
|
-
const buttons = [...parent.querySelectorAll(
|
|
42
|
+
const buttons = [...parent.querySelectorAll('button')];
|
|
38
43
|
buttons[index].focus();
|
|
39
44
|
}
|
|
40
45
|
};
|
|
@@ -43,70 +48,79 @@ const DSAppPicker = ({
|
|
|
43
48
|
useEffect(() => {
|
|
44
49
|
setTimeout(() => {
|
|
45
50
|
if (wrapperRef.current) {
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
const {
|
|
52
|
+
scrollHeight,
|
|
53
|
+
clientHeight
|
|
54
|
+
} = wrapperRef.current;
|
|
55
|
+
if (scrollHeight > clientHeight) return setIsOverflow(true);
|
|
49
56
|
}
|
|
57
|
+
|
|
50
58
|
return setIsOverflow(false);
|
|
51
59
|
});
|
|
52
60
|
}, [isOpen, open]);
|
|
61
|
+
|
|
53
62
|
const handleOnClose = () => {
|
|
54
|
-
if (typeof isOpen ===
|
|
63
|
+
if (typeof isOpen === 'boolean') {
|
|
55
64
|
setOpen(isOpen);
|
|
56
65
|
} else {
|
|
57
66
|
setOpen(false);
|
|
58
67
|
}
|
|
68
|
+
|
|
59
69
|
onClose();
|
|
60
70
|
};
|
|
61
|
-
|
|
71
|
+
|
|
72
|
+
const handleOnClickOutside = e => {
|
|
62
73
|
setOpen(false);
|
|
63
74
|
onClose();
|
|
64
75
|
onClickOutside(e);
|
|
65
76
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
|
|
78
|
+
const AppPickerContent = () => /*#__PURE__*/_jsx(AppPickerImpl, {
|
|
79
|
+
apps: apps,
|
|
80
|
+
customApps: customApps,
|
|
81
|
+
sectionTitle: sectionTitle,
|
|
82
|
+
customSectionTitle: customSectionTitle,
|
|
71
83
|
close: handleOnClose,
|
|
72
|
-
wrapperRef,
|
|
73
|
-
onKeyDown,
|
|
84
|
+
wrapperRef: wrapperRef,
|
|
85
|
+
onKeyDown: onKeyDown,
|
|
74
86
|
triggerRef: triggerRef || defaultTriggerRef,
|
|
75
|
-
isOverflow
|
|
87
|
+
isOverflow: isOverflow
|
|
76
88
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
|
|
90
|
+
const RenderTrigger = renderTrigger || (_ref2 => {
|
|
91
|
+
let {
|
|
92
|
+
ref
|
|
93
|
+
} = _ref2;
|
|
94
|
+
return /*#__PURE__*/_jsx(DSButton, {
|
|
95
|
+
"data-testid": "app-picker__button",
|
|
96
|
+
id: "app-picker__button",
|
|
97
|
+
buttonType: "text",
|
|
98
|
+
icon: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {})),
|
|
99
|
+
innerRef: mergeRefs(ref, defaultTriggerRef),
|
|
100
|
+
onClick: e => {
|
|
101
|
+
onClick(e);
|
|
102
|
+
setOpen(true);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return /*#__PURE__*/_jsx(DSPopover, {
|
|
108
|
+
content: /*#__PURE__*/_jsx(AppPickerContent, {}),
|
|
109
|
+
isOpen: typeof isOpen === 'boolean' ? isOpen : open,
|
|
91
110
|
onClickOutside: handleOnClickOutside,
|
|
92
111
|
placement: "bottom",
|
|
93
112
|
interactionType: "click",
|
|
94
113
|
renderTrigger: RenderTrigger,
|
|
95
114
|
showArrow: true,
|
|
96
115
|
style: {
|
|
97
|
-
padding:
|
|
98
|
-
maxWidth:
|
|
99
|
-
width:
|
|
116
|
+
padding: '0',
|
|
117
|
+
maxWidth: '1000px',
|
|
118
|
+
width: 'fit-content'
|
|
100
119
|
}
|
|
101
120
|
});
|
|
102
121
|
};
|
|
103
|
-
|
|
122
|
+
|
|
104
123
|
const AppPickerWithSchema = describe(DSAppPicker);
|
|
105
124
|
AppPickerWithSchema.propTypes = propTypes;
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
AppPickerWithSchema,
|
|
109
|
-
DSAppPicker,
|
|
110
|
-
DSAppPicker_default as default
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=DSAppPicker.js.map
|
|
125
|
+
|
|
126
|
+
export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default };
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./DSAppPicker";
|
|
3
|
-
import { default as default2 } from "./DSAppPicker";
|
|
4
|
-
export {
|
|
5
|
-
default2 as default
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default } from './DSAppPicker.js';
|
package/esm/propTypes.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { MenuPicker } from '@elliemae/ds-icons';
|
|
3
|
+
|
|
4
4
|
const propTypes = {
|
|
5
|
-
apps: PropTypes.array.description(
|
|
6
|
-
customApps: PropTypes.array.description(
|
|
7
|
-
sectionTitle: PropTypes.string.description(
|
|
8
|
-
customSectionTitle: PropTypes.string.description(
|
|
9
|
-
icon: PropTypes.func.description(
|
|
10
|
-
renderTrigger: PropTypes.func.description(
|
|
11
|
-
actionRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
apps: PropTypes.array.description('Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]').isRequired,
|
|
6
|
+
customApps: PropTypes.array.description('Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]'),
|
|
7
|
+
sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),
|
|
8
|
+
customSectionTitle: PropTypes.string.description('custom section title').defaultValue('CUSTOM APPLICATIONS'),
|
|
9
|
+
icon: PropTypes.func.description('trigger button s icon').defaultValue(MenuPicker),
|
|
10
|
+
renderTrigger: PropTypes.func.description('Custom trigger component.'),
|
|
11
|
+
actionRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
12
|
+
current: PropTypes.any
|
|
13
|
+
})]).description('Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker.'),
|
|
14
|
+
isOpen: PropTypes.bool.description('Wether the AppPicker should be open or not.'),
|
|
15
|
+
onClose: PropTypes.func.description('Callback function when the AppPicker closes'),
|
|
16
|
+
onKeyDown: PropTypes.func.description('OnKeyDown handler callback.'),
|
|
17
|
+
onClick: PropTypes.func.description('Custom onClick for Trigger component.'),
|
|
18
|
+
onClickOutside: PropTypes.func.description('Callback event when the user clicks outside the App Picker.')
|
|
17
19
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=propTypes.js.map
|
|
20
|
+
|
|
21
|
+
export { propTypes };
|