@elliemae/ds-app-picker 1.57.1 → 2.0.0-alpha.11
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 +86 -99
- package/cjs/DSAppPicker.js +62 -92
- package/cjs/index.js +1 -15
- package/cjs/propTypes.js +7 -4
- package/cjs/types/AppPickerTypes.js +0 -1
- package/cjs/utils.js +1 -2
- package/esm/AppPickerImpl.js +85 -98
- package/esm/DSAppPicker.js +58 -87
- package/esm/index.js +0 -14
- package/esm/propTypes.js +2 -3
- package/esm/types/AppPickerTypes.js +0 -1
- package/esm/utils.js +1 -2
- package/package.json +50 -14
- package/types/AppPickerImpl.d.ts +3 -0
- package/types/DSAppPicker.d.ts +5 -0
- package/types/index.d.ts +2 -0
- package/types/propTypes.d.ts +14 -0
- package/types/tests/AppPicker.test.d.ts +1 -0
- package/types/types/AppPickerTypes.d.ts +37 -0
- package/types/utils.d.ts +12 -0
- package/AppPickerImpl/package.json +0 -10
- package/DSAppPicker/package.json +0 -10
- package/cjs/AppPickerImpl.js.map +0 -1
- package/cjs/DSAppPicker.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/types/AppPickerTypes.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/esm/AppPickerImpl.js.map +0 -1
- package/esm/DSAppPicker.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/types/AppPickerTypes.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/propTypes/package.json +0 -10
- package/types/AppPickerTypes/package.json +0 -10
- package/utils/package.json +0 -10
package/esm/AppPickerImpl.js
CHANGED
|
@@ -1,47 +1,42 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
2
3
|
import { chunk } from 'lodash';
|
|
3
4
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
4
5
|
import { keys } from './utils.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
wrapperRef = _ref2.wrapperRef,
|
|
37
|
-
onKeyDown = _ref2.onKeyDown,
|
|
38
|
-
triggerRef = _ref2.triggerRef;
|
|
39
|
-
var allFocusableButtons = useRef([]);
|
|
40
|
-
var selectedButton = useRef(null);
|
|
41
|
-
useEffect(function () {
|
|
6
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var _Separator;
|
|
9
|
+
const blockName = 'app-picker';
|
|
10
|
+
const Wrapper = aggregatedClasses('ul')(blockName, 'wrapper');
|
|
11
|
+
const Grid = aggregatedClasses('div')(blockName, 'grid');
|
|
12
|
+
const Row = aggregatedClasses('div')(blockName, 'row');
|
|
13
|
+
const Chip = aggregatedClasses('button')(blockName, 'chip', ({
|
|
14
|
+
disabled,
|
|
15
|
+
selected
|
|
16
|
+
}) => ({
|
|
17
|
+
disabled,
|
|
18
|
+
selected
|
|
19
|
+
}));
|
|
20
|
+
const ChipLabel = aggregatedClasses('p')(blockName, 'chip-label');
|
|
21
|
+
const Separator = aggregatedClasses('hr')(blockName, 'separator');
|
|
22
|
+
const SectionTitle = aggregatedClasses('p')(blockName, 'section-title');
|
|
23
|
+
|
|
24
|
+
const AppPickerImpl = ({
|
|
25
|
+
apps = [],
|
|
26
|
+
customApps = [],
|
|
27
|
+
sectionTitle = 'APPLICATIONS',
|
|
28
|
+
customSectionTitle = 'CUSTOM APPLICATIONS',
|
|
29
|
+
close = () => null,
|
|
30
|
+
wrapperRef,
|
|
31
|
+
onKeyDown,
|
|
32
|
+
triggerRef
|
|
33
|
+
}) => {
|
|
34
|
+
const allFocusableButtons = useRef([]);
|
|
35
|
+
const selectedButton = useRef(null);
|
|
36
|
+
useEffect(() => {
|
|
42
37
|
var _wrapperRef$current;
|
|
43
38
|
|
|
44
|
-
wrapperRef === null || wrapperRef === void 0 ? void 0 : (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelectorAll('button').forEach(
|
|
39
|
+
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
40
|
if (!e.hasAttribute('disabled')) {
|
|
46
41
|
var _allFocusableButtons$;
|
|
47
42
|
|
|
@@ -64,7 +59,7 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
|
|
|
64
59
|
}
|
|
65
60
|
}, [wrapperRef]); // eslint-disable-next-line max-statements
|
|
66
61
|
|
|
67
|
-
|
|
62
|
+
const handleKeyDown = e => {
|
|
68
63
|
var _triggerRef$current;
|
|
69
64
|
|
|
70
65
|
switch (e.key) {
|
|
@@ -92,10 +87,10 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
|
|
|
92
87
|
}
|
|
93
88
|
};
|
|
94
89
|
|
|
95
|
-
|
|
90
|
+
const handleOnClick = useCallback((e, app) => {
|
|
96
91
|
if (app.onClick) app.onClick(e, app);
|
|
97
92
|
}, []);
|
|
98
|
-
|
|
93
|
+
const handleOnKeyDownWrapper = useCallback(e => {
|
|
99
94
|
if (onKeyDown) onKeyDown(e);
|
|
100
95
|
|
|
101
96
|
if (!onKeyDown && e.key === keys.ESC) {
|
|
@@ -103,70 +98,62 @@ var AppPickerImpl = function AppPickerImpl(_ref2) {
|
|
|
103
98
|
}
|
|
104
99
|
}, [onKeyDown, close]);
|
|
105
100
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
135
|
-
className: "app-picker__icon",
|
|
136
|
-
size: "m"
|
|
137
|
-
}), /*#__PURE__*/React.createElement(ChipLabel, null, label));
|
|
138
|
-
}));
|
|
139
|
-
});
|
|
101
|
+
const buildRows = (appList, prevIndex = 0) => {
|
|
102
|
+
const rows = chunk(appList, 3); // divides array in subarrays of 3 items
|
|
103
|
+
|
|
104
|
+
const formattedRows = rows.map((row, index) => /*#__PURE__*/_jsx(Row, {}, index, row.map((app, key) => {
|
|
105
|
+
const {
|
|
106
|
+
label,
|
|
107
|
+
disabled,
|
|
108
|
+
selected,
|
|
109
|
+
icon: Icon
|
|
110
|
+
} = app;
|
|
111
|
+
return /*#__PURE__*/_jsx(Chip, {
|
|
112
|
+
classProps: {
|
|
113
|
+
disabled,
|
|
114
|
+
selected
|
|
115
|
+
},
|
|
116
|
+
onClick: e => handleOnClick(e, app),
|
|
117
|
+
onKeyDown: handleKeyDown,
|
|
118
|
+
"data-testid": "app-picker__chip",
|
|
119
|
+
"aria-disabled": disabled,
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
"aria-selected": selected,
|
|
122
|
+
"aria-setsize": apps.length + customApps.length,
|
|
123
|
+
"aria-posinset": key + prevIndex
|
|
124
|
+
}, key, /*#__PURE__*/_jsx(Icon, {
|
|
125
|
+
className: "app-picker__icon",
|
|
126
|
+
size: "m"
|
|
127
|
+
}), /*#__PURE__*/_jsx(ChipLabel, {}, void 0, label));
|
|
128
|
+
})));
|
|
140
129
|
return formattedRows;
|
|
141
130
|
};
|
|
142
131
|
|
|
143
|
-
|
|
144
|
-
return buildRows(apps, 1);
|
|
145
|
-
};
|
|
132
|
+
const AppsRows = () => buildRows(apps, 1);
|
|
146
133
|
|
|
147
|
-
|
|
148
|
-
return buildRows(customApps, apps.length);
|
|
149
|
-
};
|
|
134
|
+
const CustomRows = () => buildRows(customApps, apps.length);
|
|
150
135
|
|
|
151
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/jsxs(Wrapper, {
|
|
152
137
|
role: "listbox",
|
|
153
138
|
ref: wrapperRef,
|
|
154
139
|
onKeyDown: handleOnKeyDownWrapper,
|
|
155
|
-
"data-testid": "app-picker__wrapper"
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
140
|
+
"data-testid": "app-picker__wrapper",
|
|
141
|
+
children: [/*#__PURE__*/_jsx(SectionTitle, {
|
|
142
|
+
"data-testid": "app-picker__main-title",
|
|
143
|
+
"aria-hidden": true
|
|
144
|
+
}, void 0, sectionTitle), /*#__PURE__*/_jsx(Grid, {
|
|
145
|
+
"data-testid": "app-picker__main-grid"
|
|
146
|
+
}, void 0, /*#__PURE__*/_jsx(AppsRows, {})), !!customApps.length && /*#__PURE__*/jsxs(Fragment, {
|
|
147
|
+
children: [_Separator || (_Separator = /*#__PURE__*/_jsx(Separator, {
|
|
148
|
+
"aria-hidden": true
|
|
149
|
+
})), /*#__PURE__*/_jsx(SectionTitle, {
|
|
150
|
+
"data-testid": "app-picker__custom-title",
|
|
151
|
+
"aria-hidden": true
|
|
152
|
+
}, void 0, customSectionTitle), /*#__PURE__*/_jsx(Grid, {
|
|
153
|
+
"data-testid": "app-picker__custom-grid"
|
|
154
|
+
}, void 0, /*#__PURE__*/_jsx(CustomRows, {}))]
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
169
157
|
};
|
|
170
158
|
|
|
171
159
|
export { AppPickerImpl as default };
|
|
172
|
-
//# sourceMappingURL=AppPickerImpl.js.map
|
package/esm/DSAppPicker.js
CHANGED
|
@@ -1,73 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
4
|
import { describe } from 'react-desc';
|
|
5
|
-
import
|
|
5
|
+
import MenuPicker from '@elliemae/ds-icons/MenuPicker';
|
|
6
6
|
import DSButton from '@elliemae/ds-button';
|
|
7
7
|
import DSPopover from '@elliemae/ds-popover';
|
|
8
8
|
import { mergeRefs } from '@elliemae/ds-utilities';
|
|
9
9
|
import AppPickerImpl from './AppPickerImpl.js';
|
|
10
10
|
import { propTypes } from './propTypes.js';
|
|
11
|
-
import 'lodash';
|
|
12
|
-
import '@elliemae/ds-classnames';
|
|
13
|
-
import './utils.js';
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onClose = _ref$onClose === void 0 ? function () {
|
|
35
|
-
return null;
|
|
36
|
-
} : _ref$onClose,
|
|
37
|
-
actionRef = _ref.actionRef,
|
|
38
|
-
onKeyDown = _ref.onKeyDown,
|
|
39
|
-
_ref$onClick = _ref.onClick,
|
|
40
|
-
_onClick = _ref$onClick === void 0 ? function () {
|
|
41
|
-
return null;
|
|
42
|
-
} : _ref$onClick,
|
|
43
|
-
_ref$onClickOutside = _ref.onClickOutside,
|
|
44
|
-
onClickOutside = _ref$onClickOutside === void 0 ? function () {
|
|
45
|
-
return null;
|
|
46
|
-
} : _ref$onClickOutside,
|
|
47
|
-
triggerRef = _ref.triggerRef;
|
|
12
|
+
const DSAppPicker = ({
|
|
13
|
+
apps = [],
|
|
14
|
+
customApps = [],
|
|
15
|
+
sectionTitle = 'APPLICATIONS',
|
|
16
|
+
customSectionTitle = 'CUSTOM APPLICATIONS',
|
|
17
|
+
icon: Icon = () => /*#__PURE__*/_jsx(MenuPicker, {
|
|
18
|
+
fill: ['brand-primary', 700],
|
|
19
|
+
size: "m"
|
|
20
|
+
}),
|
|
21
|
+
renderTrigger,
|
|
22
|
+
isOpen,
|
|
23
|
+
onClose = () => null,
|
|
24
|
+
actionRef,
|
|
25
|
+
onKeyDown,
|
|
26
|
+
onClick = () => null,
|
|
27
|
+
onClickOutside = () => null,
|
|
28
|
+
triggerRef
|
|
29
|
+
}) => {
|
|
30
|
+
var _Icon;
|
|
48
31
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var wrapperRef = useRef(null);
|
|
55
|
-
var defaultTriggerRef = useRef(null);
|
|
56
|
-
useEffect(function () {
|
|
32
|
+
const [open, setOpen] = useState(false);
|
|
33
|
+
const wrapperRef = useRef(null);
|
|
34
|
+
const defaultTriggerRef = useRef(null);
|
|
35
|
+
useEffect(() => {
|
|
57
36
|
if (actionRef) {
|
|
58
|
-
actionRef.current.focusToIndex =
|
|
37
|
+
actionRef.current.focusToIndex = index => {
|
|
59
38
|
if (wrapperRef.current) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var buttons = _toConsumableArray(parent.querySelectorAll('button'));
|
|
63
|
-
|
|
39
|
+
const parent = wrapperRef.current;
|
|
40
|
+
const buttons = [...parent.querySelectorAll('button')];
|
|
64
41
|
buttons[index].focus();
|
|
65
42
|
}
|
|
66
43
|
};
|
|
67
44
|
}
|
|
68
45
|
}, [actionRef, apps, customApps]);
|
|
69
46
|
|
|
70
|
-
|
|
47
|
+
const handleOnClose = () => {
|
|
71
48
|
if (typeof isOpen === 'boolean') {
|
|
72
49
|
setOpen(isOpen);
|
|
73
50
|
} else {
|
|
@@ -77,43 +54,39 @@ var DSAppPicker = function DSAppPicker(_ref) {
|
|
|
77
54
|
onClose();
|
|
78
55
|
};
|
|
79
56
|
|
|
80
|
-
|
|
57
|
+
const handleOnClickOutside = e => {
|
|
81
58
|
setOpen(false);
|
|
82
59
|
onClose();
|
|
83
60
|
onClickOutside(e);
|
|
84
61
|
};
|
|
85
62
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var RenderTrigger = renderTrigger || function (_ref2) {
|
|
100
|
-
var ref = _ref2.ref;
|
|
101
|
-
return /*#__PURE__*/React.createElement(DSButton, {
|
|
102
|
-
"data-testid": "app-picker__button",
|
|
103
|
-
id: "app-picker__button",
|
|
104
|
-
buttonType: "text",
|
|
105
|
-
icon: /*#__PURE__*/React.createElement(Icon, null),
|
|
106
|
-
innerRef: mergeRefs(ref, defaultTriggerRef),
|
|
107
|
-
onClick: function onClick(e) {
|
|
108
|
-
_onClick(e);
|
|
63
|
+
const AppPickerContent = () => /*#__PURE__*/_jsx(AppPickerImpl, {
|
|
64
|
+
apps: apps,
|
|
65
|
+
customApps: customApps,
|
|
66
|
+
sectionTitle: sectionTitle,
|
|
67
|
+
customSectionTitle: customSectionTitle,
|
|
68
|
+
close: handleOnClose,
|
|
69
|
+
wrapperRef: wrapperRef,
|
|
70
|
+
onKeyDown: onKeyDown,
|
|
71
|
+
triggerRef: triggerRef || defaultTriggerRef
|
|
72
|
+
});
|
|
109
73
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
74
|
+
const RenderTrigger = renderTrigger || (({
|
|
75
|
+
ref
|
|
76
|
+
}) => /*#__PURE__*/_jsx(DSButton, {
|
|
77
|
+
"data-testid": "app-picker__button",
|
|
78
|
+
id: "app-picker__button",
|
|
79
|
+
buttonType: "text",
|
|
80
|
+
icon: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {})),
|
|
81
|
+
innerRef: mergeRefs(ref, defaultTriggerRef),
|
|
82
|
+
onClick: e => {
|
|
83
|
+
onClick(e);
|
|
84
|
+
setOpen(true);
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
114
87
|
|
|
115
|
-
return /*#__PURE__*/
|
|
116
|
-
content: /*#__PURE__*/
|
|
88
|
+
return /*#__PURE__*/_jsx(DSPopover, {
|
|
89
|
+
content: /*#__PURE__*/_jsx(AppPickerContent, {}),
|
|
117
90
|
isOpen: typeof isOpen === 'boolean' ? isOpen : open,
|
|
118
91
|
onClickOutside: handleOnClickOutside,
|
|
119
92
|
placement: "bottom",
|
|
@@ -127,9 +100,7 @@ var DSAppPicker = function DSAppPicker(_ref) {
|
|
|
127
100
|
});
|
|
128
101
|
};
|
|
129
102
|
|
|
130
|
-
|
|
131
|
-
var AppPickerWithSchema = describe(DSAppPicker);
|
|
103
|
+
const AppPickerWithSchema = describe(DSAppPicker);
|
|
132
104
|
AppPickerWithSchema.propTypes = propTypes;
|
|
133
105
|
|
|
134
106
|
export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default };
|
|
135
|
-
//# sourceMappingURL=DSAppPicker.js.map
|
package/esm/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
1
|
export { AppPickerWithSchema, DSAppPicker, DSAppPicker as default } from './DSAppPicker.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
3
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react-desc';
|
|
6
|
-
import '@elliemae/ds-icons';
|
|
7
|
-
import '@elliemae/ds-button';
|
|
8
|
-
import '@elliemae/ds-popover';
|
|
9
|
-
import '@elliemae/ds-utilities';
|
|
10
|
-
import './AppPickerImpl.js';
|
|
11
|
-
import 'lodash';
|
|
12
|
-
import '@elliemae/ds-classnames';
|
|
13
|
-
import './utils.js';
|
|
14
|
-
import './propTypes.js';
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/esm/propTypes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropTypes } from 'react-desc';
|
|
2
|
-
import
|
|
2
|
+
import MenuPicker from '@elliemae/ds-icons/MenuPicker';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const propTypes = {
|
|
5
5
|
apps: PropTypes.array.description('Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]').isRequired,
|
|
6
6
|
customApps: PropTypes.array.description('Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]'),
|
|
7
7
|
sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),
|
|
@@ -19,4 +19,3 @@ var propTypes = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { propTypes };
|
|
22
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-app-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"module": "esm/index.js",
|
|
7
|
-
"main": "cjs/index.js",
|
|
5
|
+
"description": "ICE MT - Dimsum - App Picker",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils": {
|
|
15
|
+
"import": "./esm/utils.js",
|
|
16
|
+
"require": "./cjs/utils.js"
|
|
17
|
+
},
|
|
18
|
+
"./types/AppPickerTypes": {
|
|
19
|
+
"import": "./esm/types/AppPickerTypes.js",
|
|
20
|
+
"require": "./cjs/types/AppPickerTypes.js"
|
|
21
|
+
},
|
|
22
|
+
"./propTypes": {
|
|
23
|
+
"import": "./esm/propTypes.js",
|
|
24
|
+
"require": "./cjs/propTypes.js"
|
|
25
|
+
},
|
|
26
|
+
"./DSAppPicker": {
|
|
27
|
+
"import": "./esm/DSAppPicker.js",
|
|
28
|
+
"require": "./cjs/DSAppPicker.js"
|
|
29
|
+
},
|
|
30
|
+
"./AppPickerImpl": {
|
|
31
|
+
"import": "./esm/AppPickerImpl.js",
|
|
32
|
+
"require": "./cjs/AppPickerImpl.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
8
35
|
"sideEffects": [
|
|
9
36
|
"*.css",
|
|
10
37
|
"*.scss"
|
|
11
38
|
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"npm": ">=7",
|
|
45
|
+
"node": ">=14"
|
|
46
|
+
},
|
|
47
|
+
"author": "ICE MT",
|
|
12
48
|
"scripts": {
|
|
13
49
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
50
|
"prebuild": "exit 0",
|
|
@@ -16,20 +52,20 @@
|
|
|
16
52
|
"build": "node ../../scripts/build/build.js"
|
|
17
53
|
},
|
|
18
54
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-button": "
|
|
20
|
-
"@elliemae/ds-classnames": "
|
|
21
|
-
"@elliemae/ds-icons": "
|
|
22
|
-
"@elliemae/ds-popover": "
|
|
23
|
-
"
|
|
24
|
-
"react-desc": "^4.1.2"
|
|
55
|
+
"@elliemae/ds-button": "2.0.0-alpha.11",
|
|
56
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.11",
|
|
57
|
+
"@elliemae/ds-icons": "2.0.0-alpha.11",
|
|
58
|
+
"@elliemae/ds-popover": "2.0.0-alpha.11",
|
|
59
|
+
"react-desc": "^4.1.3"
|
|
25
60
|
},
|
|
26
61
|
"peerDependencies": {
|
|
27
|
-
"lodash": "^4.17.
|
|
28
|
-
"react": "^17.0.
|
|
29
|
-
"react-dom": "^17.0.
|
|
62
|
+
"lodash": "^4.17.21",
|
|
63
|
+
"react": "^17.0.2",
|
|
64
|
+
"react-dom": "^17.0.2"
|
|
30
65
|
},
|
|
31
66
|
"publishConfig": {
|
|
32
67
|
"access": "public",
|
|
33
|
-
"directory": "dist"
|
|
68
|
+
"directory": "dist",
|
|
69
|
+
"generateSubmodules": true
|
|
34
70
|
}
|
|
35
71
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const propTypes: {
|
|
2
|
+
apps: any;
|
|
3
|
+
customApps: any;
|
|
4
|
+
sectionTitle: any;
|
|
5
|
+
customSectionTitle: any;
|
|
6
|
+
icon: any;
|
|
7
|
+
renderTrigger: any;
|
|
8
|
+
actionRef: any;
|
|
9
|
+
isOpen: any;
|
|
10
|
+
onClose: any;
|
|
11
|
+
onKeyDown: any;
|
|
12
|
+
onClick: any;
|
|
13
|
+
onClickOutside: any;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { SvgIconType } from '@elliemae/ds-icons';
|
|
3
|
+
export interface AppItemType {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: React.Component;
|
|
6
|
+
onClick: () => void | null;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface AppPickerPropsType {
|
|
11
|
+
apps: AppItemType[];
|
|
12
|
+
customApps: AppItemType[];
|
|
13
|
+
sectionTitle: string;
|
|
14
|
+
customSectionTitle: string;
|
|
15
|
+
icon: SvgIconType;
|
|
16
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
17
|
+
actionRef?: React.RefObject<{
|
|
18
|
+
focusToIndex: (index: number) => void;
|
|
19
|
+
}>;
|
|
20
|
+
onClick?: (e: MouseEvent) => void;
|
|
21
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
22
|
+
renderTrigger?: JSX.Element;
|
|
23
|
+
isOpen?: boolean;
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface AppPickerImplProps {
|
|
27
|
+
apps: AppItemType[];
|
|
28
|
+
customApps: AppItemType[];
|
|
29
|
+
sectionTitle: string;
|
|
30
|
+
customSectionTitle: string;
|
|
31
|
+
close?: () => void;
|
|
32
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
33
|
+
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
34
|
+
triggerRef: React.RefObject<HTMLElement>;
|
|
35
|
+
}
|
|
36
|
+
export declare type DSAppPickerImplType = React.ComponentType<AppPickerImplProps>;
|
|
37
|
+
export declare type DSAppPickerType = React.ComponentType<AppPickerPropsType>;
|
package/types/utils.d.ts
ADDED