@elliemae/ds-mini-toolbar 3.0.0-alpha.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Components/ToolbarShortcut.js +21 -14
- package/dist/cjs/Components/ToolbarShortcut.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/Button.js +19 -3
- package/dist/cjs/Components/outOfTheBox/Button.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/ComboBox.js +15 -3
- package/dist/cjs/Components/outOfTheBox/ComboBox.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/SearchBox.js +17 -4
- package/dist/cjs/Components/outOfTheBox/SearchBox.js.map +1 -1
- package/dist/cjs/hooks/useGenerateItems.js +15 -4
- package/dist/cjs/hooks/useGenerateItems.js.map +1 -1
- package/dist/esm/Components/ToolbarShortcut.js +23 -14
- package/dist/esm/Components/ToolbarShortcut.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/Button.js +21 -3
- package/dist/esm/Components/outOfTheBox/Button.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/ComboBox.js +17 -3
- package/dist/esm/Components/outOfTheBox/ComboBox.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/SearchBox.js +19 -4
- package/dist/esm/Components/outOfTheBox/SearchBox.js.map +1 -1
- package/dist/esm/hooks/useGenerateItems.js +17 -4
- package/dist/esm/hooks/useGenerateItems.js.map +1 -1
- package/package.json +7 -6
- package/dist/types/Components/MiniToolbar.d.ts +0 -21
- package/dist/types/Components/ToolbarShortcut.d.ts +0 -4
- package/dist/types/Components/outOfTheBox/Button.d.ts +0 -3
- package/dist/types/Components/outOfTheBox/ComboBox.d.ts +0 -3
- package/dist/types/Components/outOfTheBox/IconItem.d.ts +0 -4
- package/dist/types/Components/outOfTheBox/SearchBox.d.ts +0 -5
- package/dist/types/Components/outOfTheBox/Separator.d.ts +0 -3
- package/dist/types/Components/outOfTheBox/index.d.ts +0 -10
- package/dist/types/hooks/useGenerateItems.d.ts +0 -4
- package/dist/types/index.d.d.ts +0 -75
- package/dist/types/index.d.ts +0 -2
- package/dist/types/propTypes.d.ts +0 -17
- package/dist/types/styles.d.ts +0 -5
- package/dist/types/tests/DSMiniToolbar.events.test.d.ts +0 -1
- package/dist/types/tests/DSMiniToolbar.keyboard.test.d.ts +0 -1
- package/dist/types/tests/DSMiniToolbar.test.d.ts +0 -1
- package/dist/types/tests/utils.test.d.ts +0 -161
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -40,10 +54,7 @@ const ToolbarShortcut = (props) => {
|
|
|
40
54
|
const timerRight = (0, import_react.useRef)(null);
|
|
41
55
|
const { position = "left", isOpen = false } = contextualRegionProps || {};
|
|
42
56
|
const { style } = shortcutProps || {};
|
|
43
|
-
const mergedProps = {
|
|
44
|
-
...sharedProps,
|
|
45
|
-
...shortcutProps
|
|
46
|
-
};
|
|
57
|
+
const mergedProps = __spreadValues(__spreadValues({}, sharedProps), shortcutProps);
|
|
47
58
|
(0, import_react.useEffect)(() => {
|
|
48
59
|
if (isOpen && leftRef.current) {
|
|
49
60
|
timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);
|
|
@@ -56,17 +67,13 @@ const ToolbarShortcut = (props) => {
|
|
|
56
67
|
clearTimeout(timerRight.current);
|
|
57
68
|
};
|
|
58
69
|
}, [isOpen, leftRef, rightRef]);
|
|
59
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, null, /* @__PURE__ */ import_react.default.createElement(ContextualRegion, {
|
|
60
|
-
innerRef: leftRef
|
|
61
|
-
|
|
62
|
-
})), Component && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, {
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, null, /* @__PURE__ */ import_react.default.createElement(ContextualRegion, __spreadValues({
|
|
71
|
+
innerRef: leftRef
|
|
72
|
+
}, contextualRegionProps))), Component && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, {
|
|
63
73
|
style
|
|
64
|
-
}, /* @__PURE__ */ import_react.default.createElement(Component, {
|
|
65
|
-
|
|
66
|
-
}))
|
|
67
|
-
innerRef: rightRef,
|
|
68
|
-
...contextualRegionProps
|
|
69
|
-
})));
|
|
74
|
+
}, /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, mergedProps))), isOpen && position === "right" && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, null, /* @__PURE__ */ import_react.default.createElement(ContextualRegion, __spreadValues({
|
|
75
|
+
innerRef: rightRef
|
|
76
|
+
}, contextualRegionProps))));
|
|
70
77
|
};
|
|
71
78
|
module.exports = __toCommonJS(ToolbarShortcut_exports);
|
|
72
79
|
//# sourceMappingURL=ToolbarShortcut.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Components/ToolbarShortcut.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useRef, useEffect } from 'react';\nimport { Item } from '../styles';\nimport { ToolbarShortcutPropsT } from '../index.d';\n\nconst ToolbarShortcut = (props: ToolbarShortcutPropsT): React.ReactElement => {\n const { Component, shortcutProps, sharedProps, ContextualRegion, contextualRegionProps } = props;\n const leftRef = useRef<HTMLElement | null>(null);\n const rightRef = useRef<HTMLElement | null>(null);\n const timerLeft = useRef<ReturnType<typeof setInterval> | null>(null);\n const timerRight = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const { position = 'left', isOpen = false } = contextualRegionProps || {};\n const { style } = shortcutProps || {};\n\n const mergedProps = {\n ...sharedProps,\n ...shortcutProps,\n };\n\n useEffect(() => {\n if (isOpen && leftRef.current) {\n timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);\n }\n if (isOpen && rightRef.current) {\n timerRight.current = setTimeout(() => rightRef.current.focus(), 200);\n }\n\n return () => {\n clearTimeout(timerLeft.current);\n clearTimeout(timerRight.current);\n };\n }, [isOpen, leftRef, rightRef]);\n\n return (\n <>\n {isOpen && position === 'left' && (\n <Item>\n <ContextualRegion innerRef={leftRef} {...contextualRegionProps} />\n </Item>\n )}\n {Component && (\n <Item style={style}>\n <Component {...mergedProps} />\n </Item>\n )}\n {isOpen && position === 'right' && (\n <Item>\n <ContextualRegion innerRef={rightRef} {...contextualRegionProps} />\n </Item>\n )}\n </>\n );\n};\n\nexport { ToolbarShortcut };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,oBAAqB;AAGrB,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,yBAA2B;AAC3C,QAAM,WAAW,yBAA2B;AAC5C,QAAM,YAAY,yBAA8C;AAChE,QAAM,aAAa,yBAA8C;AAEjE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB;AACvE,QAAM,EAAE,UAAU,iBAAiB;AAEnC,QAAM,cAAc,kCACf,cACA;AAGL,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,SAAS;AAAA;AAEhE,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,SAAS;AAAA;AAGlE,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,mBAAa,WAAW;AAAA;AAAA,KAEzB,CAAC,QAAQ,SAAS;AAErB,SACE,wFACG,UAAU,aAAa,UACtB,mDAAC,oBAAD,MACE,mDAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,KAAa,0BAG5C,aACC,mDAAC,oBAAD;AAAA,IAAM;AAAA,KACJ,mDAAC,WAAD,mBAAe,gBAGlB,UAAU,aAAa,WACtB,mDAAC,oBAAD,MACE,mDAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,KAAc;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -32,10 +49,9 @@ __export(Button_exports, {
|
|
|
32
49
|
var React = __toESM(require("react"));
|
|
33
50
|
var import_react = __toESM(require("react"));
|
|
34
51
|
var import_ds_button = require("@elliemae/ds-button");
|
|
35
|
-
const MiniToolbarButton = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButton, {
|
|
36
|
-
...props,
|
|
52
|
+
const MiniToolbarButton = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButton, __spreadProps(__spreadValues({}, props), {
|
|
37
53
|
"aria-label": props.ariaLabel,
|
|
38
54
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
39
|
-
});
|
|
55
|
+
}));
|
|
40
56
|
module.exports = __toCommonJS(Button_exports);
|
|
41
57
|
//# sourceMappingURL=Button.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/Components/outOfTheBox/Button.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst MiniToolbarButton = (props: Record<string, unknown>): React.ReactElement => (\n <DSButton {...props} aria-label={props.ariaLabel} data-testid=\"ds-mini-toolbar__shortcut\" />\n);\n\nexport { MiniToolbarButton };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAAyB;AAEzB,MAAM,oBAAoB,CAAC,UACzB,mDAAC,2BAAD,iCAAc,QAAd;AAAA,EAAqB,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -32,8 +46,6 @@ __export(ComboBox_exports, {
|
|
|
32
46
|
var React = __toESM(require("react"));
|
|
33
47
|
var import_react = __toESM(require("react"));
|
|
34
48
|
var import_ds_form = require("@elliemae/ds-form");
|
|
35
|
-
const MiniToolbarComboBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSComboBox2, {
|
|
36
|
-
...props
|
|
37
|
-
});
|
|
49
|
+
const MiniToolbarComboBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSComboBox2, __spreadValues({}, props));
|
|
38
50
|
module.exports = __toCommonJS(ComboBox_exports);
|
|
39
51
|
//# sourceMappingURL=ComboBox.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/Components/outOfTheBox/ComboBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { DSComboBox2 } from '@elliemae/ds-form';\n\nconst MiniToolbarComboBox = (props: Record<string, unknown>): React.ReactElement => <DSComboBox2 {...props} />;\n\nexport { MiniToolbarComboBox };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,qBAA4B;AAE5B,MAAM,sBAAsB,CAAC,UAAuD,mDAAC,4BAAD,mBAAiB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -49,10 +63,9 @@ const MiniToolbarSearchButton = (props) => {
|
|
|
49
63
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
50
64
|
});
|
|
51
65
|
};
|
|
52
|
-
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, {
|
|
66
|
+
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, __spreadValues({
|
|
53
67
|
clearable: true,
|
|
54
|
-
showIcon: false
|
|
55
|
-
|
|
56
|
-
});
|
|
68
|
+
showIcon: false
|
|
69
|
+
}, props));
|
|
57
70
|
module.exports = __toCommonJS(SearchBox_exports);
|
|
58
71
|
//# sourceMappingURL=SearchBox.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/Components/outOfTheBox/SearchBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarSearchButton = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Search size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nconst MiniToolbarSearchBox = (props: Record<string, unknown>): JSX.Element => (\n <DSSearchBox clearable showIcon={false} {...props} />\n);\n\nexport { MiniToolbarSearchButton, MiniToolbarSearchBox };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,sBAAuB;AACvB,qBAA4B;AAC5B,oBAA6B;AAG7B,MAAM,0BAA0B,CAAC,UAAyD;AACxF,QAAM,EAAE,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAE7E,SACE,mDAAC,4BAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,mDAAC,wBAAD;AAAA,MAAQ;AAAA,MAAY;AAAA;AAAA,IAC9B,eAAY;AAAA;AAAA;AAKlB,MAAM,uBAAuB,CAAC,UAC5B,mDAAC,4BAAD;AAAA,EAAa,WAAS;AAAA,EAAC,UAAU;AAAA,GAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,22 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
@@ -74,10 +88,7 @@ const useGenerateItems = (items) => {
|
|
|
74
88
|
const dropdownMenuItems = (0, import_react.useMemo)(() => items.map((item, index) => {
|
|
75
89
|
const { component, sharedProps, dropdownComponentProps } = item;
|
|
76
90
|
const dropdownItem = {};
|
|
77
|
-
const { Icon, color, label, onClick } = {
|
|
78
|
-
...sharedProps,
|
|
79
|
-
...dropdownComponentProps
|
|
80
|
-
};
|
|
91
|
+
const { Icon, color, label, onClick } = __spreadValues(__spreadValues({}, sharedProps), dropdownComponentProps);
|
|
81
92
|
if (component === import_outOfTheBox.SEPARATOR)
|
|
82
93
|
dropdownItem.type = "separator";
|
|
83
94
|
else {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useGenerateItems.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { Search } from '@elliemae/ds-icons';\nimport {\n ICON_ITEM,\n SEPARATOR,\n BUTTON,\n SEARCH_BOX,\n COMBO_BOX,\n MiniToolbarButton,\n MiniToolbarSeparator,\n MiniToolbarSearchBox,\n MiniToolbarIcon,\n MiniToolbarComboBox,\n} from '../Components/outOfTheBox';\nimport { ToolbarShortcut } from '../Components/ToolbarShortcut';\nimport { MiniToolbarSearchButton } from '../Components/outOfTheBox/SearchBox';\nimport { GeneratedDropdownItemT, MiniToolbarItemT } from '../index.d';\n\nconst useGenerateItems = (items: MiniToolbarItemT[]): [React.ReactElement[], GeneratedDropdownItemT[]] => {\n const instanceUID = useMemo(() => uid(6), []);\n\n const shortcutItems = useMemo(\n () =>\n items\n .filter((item) => item.hasShortcut || item.component === SEARCH_BOX || item.contextualRegion)\n .map((item, index) => {\n const { component, shortcutComponent, shortcutProps, sharedProps, contextualRegion, contextualRegionProps } =\n item;\n\n let Component;\n let ContextualRegion;\n\n if (component === SEPARATOR) return <MiniToolbarSeparator />;\n if (component === BUTTON) Component = MiniToolbarButton;\n else if (component === ICON_ITEM) Component = MiniToolbarIcon;\n else if (component === COMBO_BOX) Component = MiniToolbarComboBox;\n else if (component === SEARCH_BOX) {\n if (item.hasShortcut) {\n Component = MiniToolbarSearchButton;\n }\n ContextualRegion = MiniToolbarSearchBox;\n }\n if (!ContextualRegion) {\n ContextualRegion = contextualRegion;\n }\n if (!Component) {\n Component = shortcutComponent;\n }\n\n return (\n <ToolbarShortcut\n key={`${instanceUID}-shortcut-${index}`}\n Component={Component}\n shortcutProps={shortcutProps}\n sharedProps={sharedProps}\n ContextualRegion={ContextualRegion}\n contextualRegionProps={contextualRegionProps}\n />\n );\n }),\n [instanceUID, items],\n );\n\n const dropdownMenuItems = useMemo(\n () =>\n items.map((item, index) => {\n const { component, sharedProps, dropdownComponentProps } = item;\n const dropdownItem: GeneratedDropdownItemT = {};\n\n const { Icon, color, label, onClick } = {\n ...sharedProps,\n ...dropdownComponentProps,\n };\n\n if (component === SEPARATOR) dropdownItem.type = 'separator';\n else {\n dropdownItem.id = `${instanceUID}-dropdown-${index}`;\n dropdownItem.onClick = () => onClick(item);\n dropdownItem.label = label;\n dropdownItem.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick(item);\n }\n };\n }\n\n if (component === ICON_ITEM) {\n dropdownItem.leftAddon = <Icon color={color} />;\n } else if (component === SEARCH_BOX) {\n dropdownItem.leftAddon = <Search color={color} />;\n } else if (component === COMBO_BOX) {\n dropdownItem.type = 'subMenu';\n dropdownItem.label = label;\n dropdownItem.subItems = sharedProps.options.map((option, index) => {\n option.id = `${instanceUID}-option-${index}`;\n option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);\n option.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n dropdownComponentProps.onSelectMenuItem(option);\n }\n };\n return option;\n });\n }\n\n return dropdownItem;\n }),\n [instanceUID, items],\n );\n\n return [shortcutItems, dropdownMenuItems];\n};\n\nexport { useGenerateItems };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,iBAAoB;AACpB,sBAAuB;AACvB,yBAWO;AACP,6BAAgC;AAChC,uBAAwC;AAGxC,MAAM,mBAAmB,CAAC,UAAgF;AACxG,QAAM,cAAc,0BAAQ,MAAM,oBAAI,IAAI;AAE1C,QAAM,gBAAgB,0BACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,iCAAc,KAAK,kBAC3E,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,mDAAC,yCAAD;AACpC,QAAI,cAAc;AAAQ,kBAAY;AAAA,aAC7B,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc,+BAAY;AACjC,UAAI,KAAK,aAAa;AACpB,oBAAY;AAAA;AAEd,yBAAmB;AAAA;AAErB,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA;AAErB,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA;AAGd,WACE,mDAAC,wCAAD;AAAA,MACE,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAIV,CAAC,aAAa;AAGhB,QAAM,oBAAoB,0BACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC;AAE7C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY,kCACnC,cACA;AAGL,QAAI,cAAc;AAAW,mBAAa,OAAO;AAAA,SAC5C;AACH,mBAAa,KAAK,GAAG,wBAAwB;AAC7C,mBAAa,UAAU,MAAM,QAAQ;AACrC,mBAAa,QAAQ;AACrB,mBAAa,YAAY,CAAC,MAA2B;AACnD,YAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,kBAAQ;AAAA;AAAA;AAAA;AAKd,QAAI,cAAc,8BAAW;AAC3B,mBAAa,YAAY,mDAAC,MAAD;AAAA,QAAM;AAAA;AAAA,eACtB,cAAc,+BAAY;AACnC,mBAAa,YAAY,mDAAC,wBAAD;AAAA,QAAQ;AAAA;AAAA,eACxB,cAAc,8BAAW;AAClC,mBAAa,OAAO;AACpB,mBAAa,QAAQ;AACrB,mBAAa,WAAW,YAAY,QAAQ,IAAI,CAAC,QAAQ,WAAU;AACjE,eAAO,KAAK,GAAG,sBAAsB;AACrC,eAAO,UAAU,MAAM,uBAAuB,iBAAiB;AAC/D,eAAO,YAAY,CAAC,MAA2B;AAC7C,cAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,mCAAuB,iBAAiB;AAAA;AAAA;AAG5C,eAAO;AAAA;AAAA;AAIX,WAAO;AAAA,MAEX,CAAC,aAAa;AAGhB,SAAO,CAAC,eAAe;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2, { useRef, useEffect } from "react";
|
|
3
19
|
import { Item } from "../styles";
|
|
@@ -9,10 +25,7 @@ const ToolbarShortcut = (props) => {
|
|
|
9
25
|
const timerRight = useRef(null);
|
|
10
26
|
const { position = "left", isOpen = false } = contextualRegionProps || {};
|
|
11
27
|
const { style } = shortcutProps || {};
|
|
12
|
-
const mergedProps = {
|
|
13
|
-
...sharedProps,
|
|
14
|
-
...shortcutProps
|
|
15
|
-
};
|
|
28
|
+
const mergedProps = __spreadValues(__spreadValues({}, sharedProps), shortcutProps);
|
|
16
29
|
useEffect(() => {
|
|
17
30
|
if (isOpen && leftRef.current) {
|
|
18
31
|
timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);
|
|
@@ -25,17 +38,13 @@ const ToolbarShortcut = (props) => {
|
|
|
25
38
|
clearTimeout(timerRight.current);
|
|
26
39
|
};
|
|
27
40
|
}, [isOpen, leftRef, rightRef]);
|
|
28
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, {
|
|
29
|
-
innerRef: leftRef
|
|
30
|
-
|
|
31
|
-
})), Component && /* @__PURE__ */ React2.createElement(Item, {
|
|
41
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, __spreadValues({
|
|
42
|
+
innerRef: leftRef
|
|
43
|
+
}, contextualRegionProps))), Component && /* @__PURE__ */ React2.createElement(Item, {
|
|
32
44
|
style
|
|
33
|
-
}, /* @__PURE__ */ React2.createElement(Component, {
|
|
34
|
-
|
|
35
|
-
}))
|
|
36
|
-
innerRef: rightRef,
|
|
37
|
-
...contextualRegionProps
|
|
38
|
-
})));
|
|
45
|
+
}, /* @__PURE__ */ React2.createElement(Component, __spreadValues({}, mergedProps))), isOpen && position === "right" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, __spreadValues({
|
|
46
|
+
innerRef: rightRef
|
|
47
|
+
}, contextualRegionProps))));
|
|
39
48
|
};
|
|
40
49
|
export {
|
|
41
50
|
ToolbarShortcut
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/Components/ToolbarShortcut.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useEffect } from 'react';\nimport { Item } from '../styles';\nimport { ToolbarShortcutPropsT } from '../index.d';\n\nconst ToolbarShortcut = (props: ToolbarShortcutPropsT): React.ReactElement => {\n const { Component, shortcutProps, sharedProps, ContextualRegion, contextualRegionProps } = props;\n const leftRef = useRef<HTMLElement | null>(null);\n const rightRef = useRef<HTMLElement | null>(null);\n const timerLeft = useRef<ReturnType<typeof setInterval> | null>(null);\n const timerRight = useRef<ReturnType<typeof setInterval> | null>(null);\n\n const { position = 'left', isOpen = false } = contextualRegionProps || {};\n const { style } = shortcutProps || {};\n\n const mergedProps = {\n ...sharedProps,\n ...shortcutProps,\n };\n\n useEffect(() => {\n if (isOpen && leftRef.current) {\n timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);\n }\n if (isOpen && rightRef.current) {\n timerRight.current = setTimeout(() => rightRef.current.focus(), 200);\n }\n\n return () => {\n clearTimeout(timerLeft.current);\n clearTimeout(timerRight.current);\n };\n }, [isOpen, leftRef, rightRef]);\n\n return (\n <>\n {isOpen && position === 'left' && (\n <Item>\n <ContextualRegion innerRef={leftRef} {...contextualRegionProps} />\n </Item>\n )}\n {Component && (\n <Item style={style}>\n <Component {...mergedProps} />\n </Item>\n )}\n {isOpen && position === 'right' && (\n <Item>\n <ContextualRegion innerRef={rightRef} {...contextualRegionProps} />\n </Item>\n )}\n </>\n );\n};\n\nexport { ToolbarShortcut };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,OAA2B;AAC3C,QAAM,WAAW,OAA2B;AAC5C,QAAM,YAAY,OAA8C;AAChE,QAAM,aAAa,OAA8C;AAEjE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB;AACvE,QAAM,EAAE,UAAU,iBAAiB;AAEnC,QAAM,cAAc
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,OAA2B;AAC3C,QAAM,WAAW,OAA2B;AAC5C,QAAM,YAAY,OAA8C;AAChE,QAAM,aAAa,OAA8C;AAEjE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB;AACvE,QAAM,EAAE,UAAU,iBAAiB;AAEnC,QAAM,cAAc,kCACf,cACA;AAGL,YAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,SAAS;AAAA;AAEhE,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,SAAS;AAAA;AAGlE,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,mBAAa,WAAW;AAAA;AAAA,KAEzB,CAAC,QAAQ,SAAS;AAErB,SACE,4DACG,UAAU,aAAa,UACtB,qCAAC,MAAD,MACE,qCAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,KAAa,0BAG5C,aACC,qCAAC,MAAD;AAAA,IAAM;AAAA,KACJ,qCAAC,WAAD,mBAAe,gBAGlB,UAAU,aAAa,WACtB,qCAAC,MAAD,MACE,qCAAC,kBAAD;AAAA,IAAkB,UAAU;AAAA,KAAc;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import * as React from "react";
|
|
2
21
|
import React2 from "react";
|
|
3
22
|
import { DSButton } from "@elliemae/ds-button";
|
|
4
|
-
const MiniToolbarButton = (props) => /* @__PURE__ */ React2.createElement(DSButton, {
|
|
5
|
-
...props,
|
|
23
|
+
const MiniToolbarButton = (props) => /* @__PURE__ */ React2.createElement(DSButton, __spreadProps(__spreadValues({}, props), {
|
|
6
24
|
"aria-label": props.ariaLabel,
|
|
7
25
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
8
|
-
});
|
|
26
|
+
}));
|
|
9
27
|
export {
|
|
10
28
|
MiniToolbarButton
|
|
11
29
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/Button.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\n\nconst MiniToolbarButton = (props: Record<string, unknown>): React.ReactElement => (\n <DSButton {...props} aria-label={props.ariaLabel} data-testid=\"ds-mini-toolbar__shortcut\" />\n);\n\nexport { MiniToolbarButton };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,oBAAoB,CAAC,UACzB,qCAAC,UAAD
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,MAAM,oBAAoB,CAAC,UACzB,qCAAC,UAAD,iCAAc,QAAd;AAAA,EAAqB,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2 from "react";
|
|
3
19
|
import { DSComboBox2 } from "@elliemae/ds-form";
|
|
4
|
-
const MiniToolbarComboBox = (props) => /* @__PURE__ */ React2.createElement(DSComboBox2, {
|
|
5
|
-
...props
|
|
6
|
-
});
|
|
20
|
+
const MiniToolbarComboBox = (props) => /* @__PURE__ */ React2.createElement(DSComboBox2, __spreadValues({}, props));
|
|
7
21
|
export {
|
|
8
22
|
MiniToolbarComboBox
|
|
9
23
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/ComboBox.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSComboBox2 } from '@elliemae/ds-form';\n\nconst MiniToolbarComboBox = (props: Record<string, unknown>): React.ReactElement => <DSComboBox2 {...props} />;\n\nexport { MiniToolbarComboBox };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,sBAAsB,CAAC,UAAuD,qCAAC,aAAD
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,MAAM,sBAAsB,CAAC,UAAuD,qCAAC,aAAD,mBAAiB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2 from "react";
|
|
3
19
|
import { Search } from "@elliemae/ds-icons";
|
|
@@ -17,11 +33,10 @@ const MiniToolbarSearchButton = (props) => {
|
|
|
17
33
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
18
34
|
});
|
|
19
35
|
};
|
|
20
|
-
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ React2.createElement(DSSearchBox, {
|
|
36
|
+
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ React2.createElement(DSSearchBox, __spreadValues({
|
|
21
37
|
clearable: true,
|
|
22
|
-
showIcon: false
|
|
23
|
-
|
|
24
|
-
});
|
|
38
|
+
showIcon: false
|
|
39
|
+
}, props));
|
|
25
40
|
export {
|
|
26
41
|
MiniToolbarSearchBox,
|
|
27
42
|
MiniToolbarSearchButton
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/Components/outOfTheBox/SearchBox.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { DSSearchBox } from '@elliemae/ds-form';\nimport { StyledButton } from '../../styles';\nimport { MiniToolbarIconItemPropsT } from '../../index.d';\n\nconst MiniToolbarSearchButton = (props: MiniToolbarIconItemPropsT): React.ReactElement => {\n const { size, color, onClick, ariaLabel, style, buttonType = 'secondary' } = props;\n\n return (\n <StyledButton\n aria-label={ariaLabel}\n buttonType={buttonType}\n onClick={onClick}\n style={style}\n leftIcon={<Search size={size} color={color} />}\n data-testid=\"ds-mini-toolbar__shortcut\"\n />\n );\n};\n\nconst MiniToolbarSearchBox = (props: Record<string, unknown>): JSX.Element => (\n <DSSearchBox clearable showIcon={false} {...props} />\n);\n\nexport { MiniToolbarSearchButton, MiniToolbarSearchBox };\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAGA,MAAM,0BAA0B,CAAC,UAAyD;AACxF,QAAM,EAAE,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAE7E,SACE,qCAAC,cAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,qCAAC,QAAD;AAAA,MAAQ;AAAA,MAAY;AAAA;AAAA,IAC9B,eAAY;AAAA;AAAA;AAKlB,MAAM,uBAAuB,CAAC,UAC5B,qCAAC,aAAD;AAAA,EAAa,WAAS;AAAA,EAAC,UAAU;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AAGA,MAAM,0BAA0B,CAAC,UAAyD;AACxF,QAAM,EAAE,MAAM,OAAO,SAAS,WAAW,OAAO,aAAa,gBAAgB;AAE7E,SACE,qCAAC,cAAD;AAAA,IACE,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,qCAAC,QAAD;AAAA,MAAQ;AAAA,MAAY;AAAA;AAAA,IAC9B,eAAY;AAAA;AAAA;AAKlB,MAAM,uBAAuB,CAAC,UAC5B,qCAAC,aAAD;AAAA,EAAa,WAAS;AAAA,EAAC,UAAU;AAAA,GAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2, { useMemo } from "react";
|
|
3
19
|
import { uid } from "uid";
|
|
@@ -54,10 +70,7 @@ const useGenerateItems = (items) => {
|
|
|
54
70
|
const dropdownMenuItems = useMemo(() => items.map((item, index) => {
|
|
55
71
|
const { component, sharedProps, dropdownComponentProps } = item;
|
|
56
72
|
const dropdownItem = {};
|
|
57
|
-
const { Icon, color, label, onClick } = {
|
|
58
|
-
...sharedProps,
|
|
59
|
-
...dropdownComponentProps
|
|
60
|
-
};
|
|
73
|
+
const { Icon, color, label, onClick } = __spreadValues(__spreadValues({}, sharedProps), dropdownComponentProps);
|
|
61
74
|
if (component === SEPARATOR)
|
|
62
75
|
dropdownItem.type = "separator";
|
|
63
76
|
else {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useGenerateItems.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { uid } from 'uid';\nimport { Search } from '@elliemae/ds-icons';\nimport {\n ICON_ITEM,\n SEPARATOR,\n BUTTON,\n SEARCH_BOX,\n COMBO_BOX,\n MiniToolbarButton,\n MiniToolbarSeparator,\n MiniToolbarSearchBox,\n MiniToolbarIcon,\n MiniToolbarComboBox,\n} from '../Components/outOfTheBox';\nimport { ToolbarShortcut } from '../Components/ToolbarShortcut';\nimport { MiniToolbarSearchButton } from '../Components/outOfTheBox/SearchBox';\nimport { GeneratedDropdownItemT, MiniToolbarItemT } from '../index.d';\n\nconst useGenerateItems = (items: MiniToolbarItemT[]): [React.ReactElement[], GeneratedDropdownItemT[]] => {\n const instanceUID = useMemo(() => uid(6), []);\n\n const shortcutItems = useMemo(\n () =>\n items\n .filter((item) => item.hasShortcut || item.component === SEARCH_BOX || item.contextualRegion)\n .map((item, index) => {\n const { component, shortcutComponent, shortcutProps, sharedProps, contextualRegion, contextualRegionProps } =\n item;\n\n let Component;\n let ContextualRegion;\n\n if (component === SEPARATOR) return <MiniToolbarSeparator />;\n if (component === BUTTON) Component = MiniToolbarButton;\n else if (component === ICON_ITEM) Component = MiniToolbarIcon;\n else if (component === COMBO_BOX) Component = MiniToolbarComboBox;\n else if (component === SEARCH_BOX) {\n if (item.hasShortcut) {\n Component = MiniToolbarSearchButton;\n }\n ContextualRegion = MiniToolbarSearchBox;\n }\n if (!ContextualRegion) {\n ContextualRegion = contextualRegion;\n }\n if (!Component) {\n Component = shortcutComponent;\n }\n\n return (\n <ToolbarShortcut\n key={`${instanceUID}-shortcut-${index}`}\n Component={Component}\n shortcutProps={shortcutProps}\n sharedProps={sharedProps}\n ContextualRegion={ContextualRegion}\n contextualRegionProps={contextualRegionProps}\n />\n );\n }),\n [instanceUID, items],\n );\n\n const dropdownMenuItems = useMemo(\n () =>\n items.map((item, index) => {\n const { component, sharedProps, dropdownComponentProps } = item;\n const dropdownItem: GeneratedDropdownItemT = {};\n\n const { Icon, color, label, onClick } = {\n ...sharedProps,\n ...dropdownComponentProps,\n };\n\n if (component === SEPARATOR) dropdownItem.type = 'separator';\n else {\n dropdownItem.id = `${instanceUID}-dropdown-${index}`;\n dropdownItem.onClick = () => onClick(item);\n dropdownItem.label = label;\n dropdownItem.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick(item);\n }\n };\n }\n\n if (component === ICON_ITEM) {\n dropdownItem.leftAddon = <Icon color={color} />;\n } else if (component === SEARCH_BOX) {\n dropdownItem.leftAddon = <Search color={color} />;\n } else if (component === COMBO_BOX) {\n dropdownItem.type = 'subMenu';\n dropdownItem.label = label;\n dropdownItem.subItems = sharedProps.options.map((option, index) => {\n option.id = `${instanceUID}-option-${index}`;\n option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);\n option.onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n dropdownComponentProps.onSelectMenuItem(option);\n }\n };\n return option;\n });\n }\n\n return dropdownItem;\n }),\n [instanceUID, items],\n );\n\n return [shortcutItems, dropdownMenuItems];\n};\n\nexport { useGenerateItems };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AACA;AAGA,MAAM,mBAAmB,CAAC,UAAgF;AACxG,QAAM,cAAc,QAAQ,MAAM,IAAI,IAAI;AAE1C,QAAM,gBAAgB,QACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,cAAc,KAAK,kBAC3E,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,qCAAC,sBAAD;AACpC,QAAI,cAAc;AAAQ,kBAAY;AAAA,aAC7B,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc,YAAY;AACjC,UAAI,KAAK,aAAa;AACpB,oBAAY;AAAA;AAEd,yBAAmB;AAAA;AAErB,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA;AAErB,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA;AAGd,WACE,qCAAC,iBAAD;AAAA,MACE,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAIV,CAAC,aAAa;AAGhB,QAAM,oBAAoB,QACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC;AAE7C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AACA;AAGA,MAAM,mBAAmB,CAAC,UAAgF;AACxG,QAAM,cAAc,QAAQ,MAAM,IAAI,IAAI;AAE1C,QAAM,gBAAgB,QACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,cAAc,KAAK,kBAC3E,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,qCAAC,sBAAD;AACpC,QAAI,cAAc;AAAQ,kBAAY;AAAA,aAC7B,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc;AAAW,kBAAY;AAAA,aACrC,cAAc,YAAY;AACjC,UAAI,KAAK,aAAa;AACpB,oBAAY;AAAA;AAEd,yBAAmB;AAAA;AAErB,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA;AAErB,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA;AAGd,WACE,qCAAC,iBAAD;AAAA,MACE,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAIV,CAAC,aAAa;AAGhB,QAAM,oBAAoB,QACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC;AAE7C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY,kCACnC,cACA;AAGL,QAAI,cAAc;AAAW,mBAAa,OAAO;AAAA,SAC5C;AACH,mBAAa,KAAK,GAAG,wBAAwB;AAC7C,mBAAa,UAAU,MAAM,QAAQ;AACrC,mBAAa,QAAQ;AACrB,mBAAa,YAAY,CAAC,MAA2B;AACnD,YAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,kBAAQ;AAAA;AAAA;AAAA;AAKd,QAAI,cAAc,WAAW;AAC3B,mBAAa,YAAY,qCAAC,MAAD;AAAA,QAAM;AAAA;AAAA,eACtB,cAAc,YAAY;AACnC,mBAAa,YAAY,qCAAC,QAAD;AAAA,QAAQ;AAAA;AAAA,eACxB,cAAc,WAAW;AAClC,mBAAa,OAAO;AACpB,mBAAa,QAAQ;AACrB,mBAAa,WAAW,YAAY,QAAQ,IAAI,CAAC,QAAQ,WAAU;AACjE,eAAO,KAAK,GAAG,sBAAsB;AACrC,eAAO,UAAU,MAAM,uBAAuB,iBAAiB;AAC/D,eAAO,YAAY,CAAC,MAA2B;AAC7C,cAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,mCAAuB,iBAAiB;AAAA;AAAA;AAG5C,eAAO;AAAA;AAAA;AAIX,WAAO;AAAA,MAEX,CAAC,aAAa;AAGhB,SAAO,CAAC,eAAe;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-mini-toolbar",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - MiniToolbar",
|
|
6
6
|
"files": [
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"indent": 4
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@elliemae/ds-button": "3.0.0-alpha.
|
|
79
|
-
"@elliemae/ds-dropdownmenu": "3.0.0-alpha.
|
|
80
|
-
"@elliemae/ds-form": "3.0.0-alpha.
|
|
81
|
-
"@elliemae/ds-icons": "3.0.0-alpha.
|
|
82
|
-
"@elliemae/ds-system": "3.0.0-alpha.
|
|
78
|
+
"@elliemae/ds-button": "3.0.0-alpha.1",
|
|
79
|
+
"@elliemae/ds-dropdownmenu": "3.0.0-alpha.1",
|
|
80
|
+
"@elliemae/ds-form": "3.0.0-alpha.1",
|
|
81
|
+
"@elliemae/ds-icons": "3.0.0-alpha.1",
|
|
82
|
+
"@elliemae/ds-system": "3.0.0-alpha.1",
|
|
83
83
|
"react-desc": "~4.1.3",
|
|
84
84
|
"uid": "~2.0.0"
|
|
85
85
|
},
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
103
103
|
"test": "node ../../scripts/testing/test.mjs",
|
|
104
104
|
"lint": "node ../../scripts/lint.mjs",
|
|
105
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
105
106
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { MiniToolbarPropsT } from '../index.d';
|
|
4
|
-
declare const MiniToolbar: {
|
|
5
|
-
({ items, overflowButtonProps }: MiniToolbarPropsT): React.ReactElement;
|
|
6
|
-
propTypes: {
|
|
7
|
-
items: import("react-desc").PropTypesDescValue;
|
|
8
|
-
overflowButtonProps: {
|
|
9
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
10
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
-
};
|
|
12
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
declare const MiniToolbarWithSchema: {
|
|
17
|
-
(props?: unknown): JSX.Element;
|
|
18
|
-
propTypes: unknown;
|
|
19
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
20
|
-
};
|
|
21
|
-
export { MiniToolbar, MiniToolbarWithSchema };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MiniToolbarIconItemPropsT } from '../../index.d';
|
|
3
|
-
declare const MiniToolbarSearchButton: (props: MiniToolbarIconItemPropsT) => React.ReactElement;
|
|
4
|
-
declare const MiniToolbarSearchBox: (props: Record<string, unknown>) => JSX.Element;
|
|
5
|
-
export { MiniToolbarSearchButton, MiniToolbarSearchBox };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { MiniToolbarButton } from './Button';
|
|
2
|
-
export { MiniToolbarIcon } from './IconItem';
|
|
3
|
-
export { MiniToolbarSearchBox } from './SearchBox';
|
|
4
|
-
export { MiniToolbarSeparator } from './Separator';
|
|
5
|
-
export { MiniToolbarComboBox } from './ComboBox';
|
|
6
|
-
export declare const ICON_ITEM = "ds-icon-item";
|
|
7
|
-
export declare const SEPARATOR = "ds-separator";
|
|
8
|
-
export declare const BUTTON = "ds-button";
|
|
9
|
-
export declare const SEARCH_BOX = "ds-search-box";
|
|
10
|
-
export declare const COMBO_BOX = "ds-combo-box";
|
package/dist/types/index.d.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type SvgIconSizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
3
|
-
declare type SvgIconColorType = ['neutral', '900'] | ['neutral', '500'] | ['neutral', '0'] | ['danger', '900'] | ['warning', '600'] | ['success', '900'] | ['brand-primary', '600'];
|
|
4
|
-
declare type SharedProps = {
|
|
5
|
-
options?: Record<string, unknown>[];
|
|
6
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
7
|
-
Icon?: React.ComponentType<Record<string, unknown>>;
|
|
8
|
-
label?: string;
|
|
9
|
-
} & Record<string, unknown>;
|
|
10
|
-
declare type ShortcutProps = {
|
|
11
|
-
style?: React.CSSProperties;
|
|
12
|
-
} & Record<string, unknown>;
|
|
13
|
-
declare type ContextualRegionProps = {
|
|
14
|
-
position?: 'left' | 'right';
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
} & Record<string, unknown>;
|
|
17
|
-
declare type DropdownComponentProps = {
|
|
18
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
19
|
-
label?: string;
|
|
20
|
-
Icon?: React.ComponentType<Record<string, unknown>>;
|
|
21
|
-
color?: SvgIconColorType;
|
|
22
|
-
onSelectMenuItem: (option: Record<string, unknown>) => void;
|
|
23
|
-
} & Record<string, unknown>;
|
|
24
|
-
declare type OverflowButtonProps = {
|
|
25
|
-
ariaLabel?: string;
|
|
26
|
-
style?: React.CSSProperties;
|
|
27
|
-
buttonType?: 'secondary' | 'text';
|
|
28
|
-
};
|
|
29
|
-
interface DefaultIconItemProps {
|
|
30
|
-
Icon: React.ComponentType<{
|
|
31
|
-
size: SvgIconSizeType;
|
|
32
|
-
color: SvgIconColorType;
|
|
33
|
-
}>;
|
|
34
|
-
size?: SvgIconSizeType;
|
|
35
|
-
color?: SvgIconColorType;
|
|
36
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
37
|
-
ariaLabel?: string;
|
|
38
|
-
style?: React.CSSProperties;
|
|
39
|
-
}
|
|
40
|
-
declare type MiniToolbarIconItemPropsT = DefaultIconItemProps & Record<string, unknown>;
|
|
41
|
-
declare type MiniToolbarButtonPropsT = {
|
|
42
|
-
ariaLabel: string;
|
|
43
|
-
} & Record<string, unknown>;
|
|
44
|
-
interface MiniToolbarItemT {
|
|
45
|
-
component: 'ds-button' | 'ds-icon-item' | 'ds-separator' | 'ds-search-box' | 'ds-combo-box' | React.ReactElement;
|
|
46
|
-
hasShortcut?: boolean;
|
|
47
|
-
shortcutComponent?: React.ReactElement;
|
|
48
|
-
shortcutProps?: ShortcutProps;
|
|
49
|
-
dropdownComponentProps?: DropdownComponentProps;
|
|
50
|
-
sharedProps?: SharedProps;
|
|
51
|
-
contextualRegion?: React.ReactElement;
|
|
52
|
-
contextualRegionProps?: ContextualRegionProps;
|
|
53
|
-
[key: string]: unknown;
|
|
54
|
-
}
|
|
55
|
-
interface ToolbarShortcutPropsT {
|
|
56
|
-
Component: React.ComponentType<Record<string, unknown>>;
|
|
57
|
-
shortcutProps: ShortcutProps;
|
|
58
|
-
sharedProps: SharedProps;
|
|
59
|
-
ContextualRegion: React.ComponentType<Record<string, unknown>>;
|
|
60
|
-
contextualRegionProps: ContextualRegionProps;
|
|
61
|
-
}
|
|
62
|
-
interface MiniToolbarPropsT {
|
|
63
|
-
items: MiniToolbarItemT[];
|
|
64
|
-
overflowButtonProps?: OverflowButtonProps;
|
|
65
|
-
}
|
|
66
|
-
declare type GeneratedDropdownItemT = {
|
|
67
|
-
id?: string;
|
|
68
|
-
label?: string;
|
|
69
|
-
onClick?: (item: MiniToolbarItemT) => void;
|
|
70
|
-
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
71
|
-
leftAddon?: React.ReactElement;
|
|
72
|
-
subItems?: Record<string, unknown>[];
|
|
73
|
-
type?: 'separator' | 'subMenu';
|
|
74
|
-
};
|
|
75
|
-
export { MiniToolbarIconItemPropsT, MiniToolbarButtonPropsT, MiniToolbarItemT, ToolbarShortcutPropsT, MiniToolbarPropsT, GeneratedDropdownItemT, };
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
declare const miniToolbarProps: {
|
|
4
|
-
items: import("react-desc").PropTypesDescValue;
|
|
5
|
-
overflowButtonProps: {
|
|
6
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
7
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
8
|
-
};
|
|
9
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
declare const ToolbarItemWithSchema: {
|
|
13
|
-
(props?: unknown): JSX.Element;
|
|
14
|
-
propTypes: unknown;
|
|
15
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
16
|
-
};
|
|
17
|
-
export { ToolbarItemWithSchema, miniToolbarProps };
|
package/dist/types/styles.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const Container: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
-
declare const Separator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
declare const Item: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
declare const StyledButton: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, any, any>;
|
|
5
|
-
export { Container, Separator, Item, StyledButton };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export const testItems: ({
|
|
2
|
-
component: string;
|
|
3
|
-
hasShortcut: boolean;
|
|
4
|
-
shortcutProps: {
|
|
5
|
-
size: string;
|
|
6
|
-
onClick: jest.Mock<null, []>;
|
|
7
|
-
ariaLabel: string;
|
|
8
|
-
};
|
|
9
|
-
dropdownComponentProps: {
|
|
10
|
-
label: string;
|
|
11
|
-
size: string;
|
|
12
|
-
onClick: jest.Mock<null, []>;
|
|
13
|
-
};
|
|
14
|
-
sharedProps: {
|
|
15
|
-
Icon: (rest: any) => JSX.Element;
|
|
16
|
-
color: string[];
|
|
17
|
-
onClick?: undefined;
|
|
18
|
-
};
|
|
19
|
-
} | {
|
|
20
|
-
component: string;
|
|
21
|
-
hasShortcut: boolean;
|
|
22
|
-
shortcutProps: {
|
|
23
|
-
size: string;
|
|
24
|
-
onClick?: undefined;
|
|
25
|
-
ariaLabel?: undefined;
|
|
26
|
-
};
|
|
27
|
-
dropdownComponentProps: {
|
|
28
|
-
label: string;
|
|
29
|
-
size: string;
|
|
30
|
-
onClick?: undefined;
|
|
31
|
-
};
|
|
32
|
-
sharedProps: {
|
|
33
|
-
Icon: (rest: any) => JSX.Element;
|
|
34
|
-
onClick: jest.Mock<null, []>;
|
|
35
|
-
color: string[];
|
|
36
|
-
};
|
|
37
|
-
} | {
|
|
38
|
-
component: string;
|
|
39
|
-
hasShortcut: boolean;
|
|
40
|
-
shortcutProps: {
|
|
41
|
-
size: string;
|
|
42
|
-
onClick: jest.Mock<null, []>;
|
|
43
|
-
ariaLabel?: undefined;
|
|
44
|
-
};
|
|
45
|
-
dropdownComponentProps: {
|
|
46
|
-
label: string;
|
|
47
|
-
size: string;
|
|
48
|
-
onClick: jest.Mock<null, []>;
|
|
49
|
-
};
|
|
50
|
-
sharedProps: {
|
|
51
|
-
Icon: (rest: any) => JSX.Element;
|
|
52
|
-
color: string[];
|
|
53
|
-
onClick: jest.Mock<null, []>;
|
|
54
|
-
};
|
|
55
|
-
} | {
|
|
56
|
-
component: string;
|
|
57
|
-
hasShortcut: boolean;
|
|
58
|
-
shortcutProps?: undefined;
|
|
59
|
-
dropdownComponentProps?: undefined;
|
|
60
|
-
sharedProps?: undefined;
|
|
61
|
-
} | {
|
|
62
|
-
component: string;
|
|
63
|
-
hasShortcut: boolean;
|
|
64
|
-
shortcutProps: {
|
|
65
|
-
size: string;
|
|
66
|
-
onClick?: undefined;
|
|
67
|
-
ariaLabel?: undefined;
|
|
68
|
-
};
|
|
69
|
-
dropdownComponentProps: {
|
|
70
|
-
label: string;
|
|
71
|
-
size: string;
|
|
72
|
-
onClick?: undefined;
|
|
73
|
-
};
|
|
74
|
-
sharedProps: {
|
|
75
|
-
Icon: (rest: any) => JSX.Element;
|
|
76
|
-
color: string[];
|
|
77
|
-
onClick?: undefined;
|
|
78
|
-
};
|
|
79
|
-
})[];
|
|
80
|
-
export function addContextualRegionToItems(isOpen: any): ({
|
|
81
|
-
component: string;
|
|
82
|
-
hasShortcut: boolean;
|
|
83
|
-
shortcutProps: {
|
|
84
|
-
size: string;
|
|
85
|
-
onClick: jest.Mock<null, []>;
|
|
86
|
-
ariaLabel: string;
|
|
87
|
-
};
|
|
88
|
-
dropdownComponentProps: {
|
|
89
|
-
label: string;
|
|
90
|
-
size: string;
|
|
91
|
-
onClick: jest.Mock<null, []>;
|
|
92
|
-
};
|
|
93
|
-
sharedProps: {
|
|
94
|
-
Icon: (rest: any) => JSX.Element;
|
|
95
|
-
color: string[];
|
|
96
|
-
onClick?: undefined;
|
|
97
|
-
};
|
|
98
|
-
} | {
|
|
99
|
-
component: string;
|
|
100
|
-
hasShortcut: boolean;
|
|
101
|
-
shortcutProps: {
|
|
102
|
-
size: string;
|
|
103
|
-
onClick?: undefined;
|
|
104
|
-
ariaLabel?: undefined;
|
|
105
|
-
};
|
|
106
|
-
dropdownComponentProps: {
|
|
107
|
-
label: string;
|
|
108
|
-
size: string;
|
|
109
|
-
onClick?: undefined;
|
|
110
|
-
};
|
|
111
|
-
sharedProps: {
|
|
112
|
-
Icon: (rest: any) => JSX.Element;
|
|
113
|
-
onClick: jest.Mock<null, []>;
|
|
114
|
-
color: string[];
|
|
115
|
-
};
|
|
116
|
-
} | {
|
|
117
|
-
component: string;
|
|
118
|
-
hasShortcut: boolean;
|
|
119
|
-
shortcutProps: {
|
|
120
|
-
size: string;
|
|
121
|
-
onClick: jest.Mock<null, []>;
|
|
122
|
-
ariaLabel?: undefined;
|
|
123
|
-
};
|
|
124
|
-
dropdownComponentProps: {
|
|
125
|
-
label: string;
|
|
126
|
-
size: string;
|
|
127
|
-
onClick: jest.Mock<null, []>;
|
|
128
|
-
};
|
|
129
|
-
sharedProps: {
|
|
130
|
-
Icon: (rest: any) => JSX.Element;
|
|
131
|
-
color: string[];
|
|
132
|
-
onClick: jest.Mock<null, []>;
|
|
133
|
-
};
|
|
134
|
-
} | {
|
|
135
|
-
component: string;
|
|
136
|
-
hasShortcut: boolean;
|
|
137
|
-
shortcutProps?: undefined;
|
|
138
|
-
dropdownComponentProps?: undefined;
|
|
139
|
-
sharedProps?: undefined;
|
|
140
|
-
} | {
|
|
141
|
-
component: string;
|
|
142
|
-
hasShortcut: boolean;
|
|
143
|
-
shortcutProps: {
|
|
144
|
-
size: string;
|
|
145
|
-
onClick?: undefined;
|
|
146
|
-
ariaLabel?: undefined;
|
|
147
|
-
};
|
|
148
|
-
dropdownComponentProps: {
|
|
149
|
-
label: string;
|
|
150
|
-
size: string;
|
|
151
|
-
onClick?: undefined;
|
|
152
|
-
};
|
|
153
|
-
sharedProps: {
|
|
154
|
-
Icon: (rest: any) => JSX.Element;
|
|
155
|
-
color: string[];
|
|
156
|
-
onClick?: undefined;
|
|
157
|
-
};
|
|
158
|
-
})[];
|
|
159
|
-
export const shortcutCb: jest.Mock<null, []>;
|
|
160
|
-
export const dropdownCb: jest.Mock<null, []>;
|
|
161
|
-
export const sharedCb: jest.Mock<null, []>;
|