@elliemae/ds-mini-toolbar 3.3.0-next.3 → 3.3.0-next.6
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 +14 -21
- package/dist/cjs/Components/ToolbarShortcut.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/Button.js +3 -19
- package/dist/cjs/Components/outOfTheBox/Button.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/ComboBox.js +3 -15
- package/dist/cjs/Components/outOfTheBox/ComboBox.js.map +1 -1
- package/dist/cjs/Components/outOfTheBox/SearchBox.js +4 -17
- package/dist/cjs/Components/outOfTheBox/SearchBox.js.map +1 -1
- package/dist/cjs/hooks/useGenerateItems.js +4 -15
- package/dist/cjs/hooks/useGenerateItems.js.map +1 -1
- package/dist/esm/Components/ToolbarShortcut.js +14 -23
- package/dist/esm/Components/ToolbarShortcut.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/Button.js +3 -21
- package/dist/esm/Components/outOfTheBox/Button.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/ComboBox.js +3 -17
- package/dist/esm/Components/outOfTheBox/ComboBox.js.map +1 -1
- package/dist/esm/Components/outOfTheBox/SearchBox.js +4 -19
- package/dist/esm/Components/outOfTheBox/SearchBox.js.map +1 -1
- package/dist/esm/hooks/useGenerateItems.js +4 -17
- package/dist/esm/hooks/useGenerateItems.js.map +1 -1
- package/package.json +7 -7
|
@@ -3,22 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
8
|
var __export = (target, all) => {
|
|
23
9
|
for (var name in all)
|
|
24
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -49,7 +35,10 @@ const ToolbarShortcut = (props) => {
|
|
|
49
35
|
const timerRight = (0, import_react.useRef)(null);
|
|
50
36
|
const { position = "left", isOpen = false } = contextualRegionProps || {};
|
|
51
37
|
const { style } = shortcutProps || {};
|
|
52
|
-
const mergedProps =
|
|
38
|
+
const mergedProps = {
|
|
39
|
+
...sharedProps,
|
|
40
|
+
...shortcutProps
|
|
41
|
+
};
|
|
53
42
|
(0, import_react.useEffect)(() => {
|
|
54
43
|
if (isOpen && leftRef.current) {
|
|
55
44
|
timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);
|
|
@@ -62,12 +51,16 @@ const ToolbarShortcut = (props) => {
|
|
|
62
51
|
clearTimeout(timerRight.current);
|
|
63
52
|
};
|
|
64
53
|
}, [isOpen, leftRef, rightRef]);
|
|
65
|
-
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,
|
|
66
|
-
innerRef: leftRef
|
|
67
|
-
|
|
54
|
+
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, {
|
|
55
|
+
innerRef: leftRef,
|
|
56
|
+
...contextualRegionProps
|
|
57
|
+
})), Component && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, {
|
|
68
58
|
style
|
|
69
|
-
}, /* @__PURE__ */ import_react.default.createElement(Component,
|
|
70
|
-
|
|
71
|
-
},
|
|
59
|
+
}, /* @__PURE__ */ import_react.default.createElement(Component, {
|
|
60
|
+
...mergedProps
|
|
61
|
+
})), isOpen && position === "right" && /* @__PURE__ */ import_react.default.createElement(import_styles.Item, null, /* @__PURE__ */ import_react.default.createElement(ContextualRegion, {
|
|
62
|
+
innerRef: rightRef,
|
|
63
|
+
...contextualRegionProps
|
|
64
|
+
})));
|
|
72
65
|
};
|
|
73
66
|
//# 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;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AACzC,oBAAqB;AAGrB,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,yBAA2B,IAAI;AAC/C,QAAM,WAAW,yBAA2B,IAAI;AAChD,QAAM,YAAY,yBAA8C,IAAI;AACpE,QAAM,aAAa,yBAA8C,IAAI;AAErE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB,CAAC;AACxE,QAAM,EAAE,UAAU,iBAAiB,CAAC;AAEpC,QAAM,cAAc;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,MAAM,GAAG,GAAG;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,MAAM,GAAG,GAAG;AAAA,IACrE;AAEA,WAAO,MAAM;AACX,mBAAa,UAAU,OAAO;AAC9B,mBAAa,WAAW,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,QAAQ,CAAC;AAE9B,SACE,wFACG,UAAU,aAAa,UACtB,mDAAC,0BACC,mDAAC;AAAA,IAAiB,UAAU;AAAA,IAAU,GAAG;AAAA,GAAuB,CAClE,GAED,aACC,mDAAC;AAAA,IAAK;AAAA,KACJ,mDAAC;AAAA,IAAW,GAAG;AAAA,GAAa,CAC9B,GAED,UAAU,aAAa,WACtB,mDAAC,0BACC,mDAAC;AAAA,IAAiB,UAAU;AAAA,IAAW,GAAG;AAAA,GAAuB,CACnE,CAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
8
|
var __export = (target, all) => {
|
|
26
9
|
for (var name in all)
|
|
27
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,8 +27,9 @@ module.exports = __toCommonJS(Button_exports);
|
|
|
44
27
|
var React = __toESM(require("react"));
|
|
45
28
|
var import_react = __toESM(require("react"));
|
|
46
29
|
var import_ds_button = require("@elliemae/ds-button");
|
|
47
|
-
const MiniToolbarButton = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButton,
|
|
30
|
+
const MiniToolbarButton = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButton, {
|
|
31
|
+
...props,
|
|
48
32
|
"aria-label": props.ariaLabel,
|
|
49
33
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
50
|
-
})
|
|
34
|
+
});
|
|
51
35
|
//# 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;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAAyB;AAEzB,MAAM,oBAAoB,CAAC,UACzB,mDAAC;AAAA,EAAU,GAAG;AAAA,EAAO,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA,CAA4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,22 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
8
|
var __export = (target, all) => {
|
|
23
9
|
for (var name in all)
|
|
24
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -41,5 +27,7 @@ module.exports = __toCommonJS(ComboBox_exports);
|
|
|
41
27
|
var React = __toESM(require("react"));
|
|
42
28
|
var import_react = __toESM(require("react"));
|
|
43
29
|
var import_ds_form = require("@elliemae/ds-form");
|
|
44
|
-
const MiniToolbarComboBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSComboBox2,
|
|
30
|
+
const MiniToolbarComboBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSComboBox2, {
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
45
33
|
//# 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;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,qBAA4B;AAE5B,MAAM,sBAAsB,CAAC,UAAuD,mDAAC;AAAA,EAAa,GAAG;AAAA,CAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,22 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
8
|
var __export = (target, all) => {
|
|
23
9
|
for (var name in all)
|
|
24
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -58,8 +44,9 @@ const MiniToolbarSearchButton = (props) => {
|
|
|
58
44
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
59
45
|
});
|
|
60
46
|
};
|
|
61
|
-
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox,
|
|
47
|
+
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSSearchBox, {
|
|
62
48
|
clearable: true,
|
|
63
|
-
showIcon: false
|
|
64
|
-
|
|
49
|
+
showIcon: false,
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
65
52
|
//# 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;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;AAAA,IACC,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,mDAAC;AAAA,MAAO;AAAA,MAAY;AAAA,KAAc;AAAA,IAC5C,eAAY;AAAA,GACd;AAEJ;AAEA,MAAM,uBAAuB,CAAC,UAC5B,mDAAC;AAAA,EAAY,WAAS;AAAA,EAAC,UAAU;AAAA,EAAQ,GAAG;AAAA,CAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,22 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
8
|
var __export = (target, all) => {
|
|
23
9
|
for (var name in all)
|
|
24
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -83,7 +69,10 @@ const useGenerateItems = (items) => {
|
|
|
83
69
|
const dropdownMenuItems = (0, import_react.useMemo)(() => items.map((item, index) => {
|
|
84
70
|
const { component, sharedProps, dropdownComponentProps } = item;
|
|
85
71
|
const dropdownItem = {};
|
|
86
|
-
const { Icon, color, label, onClick } =
|
|
72
|
+
const { Icon, color, label, onClick } = {
|
|
73
|
+
...sharedProps,
|
|
74
|
+
...dropdownComponentProps
|
|
75
|
+
};
|
|
87
76
|
if (component === import_outOfTheBox.SEPARATOR)
|
|
88
77
|
dropdownItem.type = "separator";
|
|
89
78
|
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;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,CAAC,GAAG,CAAC,CAAC;AAE5C,QAAM,gBAAgB,0BACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,iCAAc,KAAK,gBAAgB,EAC3F,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,mDAAC,6CAAqB;AAC1D,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,MACd;AACA,yBAAmB;AAAA,IACrB;AACA,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA,IACrB;AACA,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA,IACd;AAEA,WACE,mDAAC;AAAA,MACC,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,KACF;AAAA,EAEJ,CAAC,GACL,CAAC,aAAa,KAAK,CACrB;AAEA,QAAM,oBAAoB,0BACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC,CAAC;AAE9C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY;AAAA,MACtC,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAEA,QAAI,cAAc;AAAW,mBAAa,OAAO;AAAA,SAC5C;AACH,mBAAa,KAAK,GAAG,wBAAwB;AAC7C,mBAAa,UAAU,MAAM,QAAQ,IAAI;AACzC,mBAAa,QAAQ;AACrB,mBAAa,YAAY,CAAC,MAA2B;AACnD,YAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,kBAAQ,IAAI;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAEA,QAAI,cAAc,8BAAW;AAC3B,mBAAa,YAAY,mDAAC;AAAA,QAAK;AAAA,OAAc;AAAA,IAC/C,WAAW,cAAc,+BAAY;AACnC,mBAAa,YAAY,mDAAC;AAAA,QAAO;AAAA,OAAc;AAAA,IACjD,WAAW,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,MAAM;AACrE,eAAO,YAAY,CAAC,MAA2B;AAC7C,cAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,mCAAuB,iBAAiB,MAAM;AAAA,UAChD;AAAA,QACF;AACA,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT,CAAC,GACH,CAAC,aAAa,KAAK,CACrB;AAEA,SAAO,CAAC,eAAe,iBAAiB;AAC1C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2, { useRef, useEffect } from "react";
|
|
20
4
|
import { Item } from "../styles";
|
|
@@ -26,7 +10,10 @@ const ToolbarShortcut = (props) => {
|
|
|
26
10
|
const timerRight = useRef(null);
|
|
27
11
|
const { position = "left", isOpen = false } = contextualRegionProps || {};
|
|
28
12
|
const { style } = shortcutProps || {};
|
|
29
|
-
const mergedProps =
|
|
13
|
+
const mergedProps = {
|
|
14
|
+
...sharedProps,
|
|
15
|
+
...shortcutProps
|
|
16
|
+
};
|
|
30
17
|
useEffect(() => {
|
|
31
18
|
if (isOpen && leftRef.current) {
|
|
32
19
|
timerLeft.current = setTimeout(() => leftRef.current.focus(), 200);
|
|
@@ -39,13 +26,17 @@ const ToolbarShortcut = (props) => {
|
|
|
39
26
|
clearTimeout(timerRight.current);
|
|
40
27
|
};
|
|
41
28
|
}, [isOpen, leftRef, rightRef]);
|
|
42
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion,
|
|
43
|
-
innerRef: leftRef
|
|
44
|
-
|
|
29
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, isOpen && position === "left" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, {
|
|
30
|
+
innerRef: leftRef,
|
|
31
|
+
...contextualRegionProps
|
|
32
|
+
})), Component && /* @__PURE__ */ React2.createElement(Item, {
|
|
45
33
|
style
|
|
46
|
-
}, /* @__PURE__ */ React2.createElement(Component,
|
|
47
|
-
|
|
48
|
-
},
|
|
34
|
+
}, /* @__PURE__ */ React2.createElement(Component, {
|
|
35
|
+
...mergedProps
|
|
36
|
+
})), isOpen && position === "right" && /* @__PURE__ */ React2.createElement(Item, null, /* @__PURE__ */ React2.createElement(ContextualRegion, {
|
|
37
|
+
innerRef: rightRef,
|
|
38
|
+
...contextualRegionProps
|
|
39
|
+
})));
|
|
49
40
|
};
|
|
50
41
|
export {
|
|
51
42
|
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": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAAqD;AAC5E,QAAM,EAAE,WAAW,eAAe,aAAa,kBAAkB,0BAA0B;AAC3F,QAAM,UAAU,OAA2B,IAAI;AAC/C,QAAM,WAAW,OAA2B,IAAI;AAChD,QAAM,YAAY,OAA8C,IAAI;AACpE,QAAM,aAAa,OAA8C,IAAI;AAErE,QAAM,EAAE,WAAW,QAAQ,SAAS,UAAU,yBAAyB,CAAC;AACxE,QAAM,EAAE,UAAU,iBAAiB,CAAC;AAEpC,QAAM,cAAc;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,YAAU,MAAM;AACd,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,UAAU,WAAW,MAAM,QAAQ,QAAQ,MAAM,GAAG,GAAG;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,SAAS;AAC9B,iBAAW,UAAU,WAAW,MAAM,SAAS,QAAQ,MAAM,GAAG,GAAG;AAAA,IACrE;AAEA,WAAO,MAAM;AACX,mBAAa,UAAU,OAAO;AAC9B,mBAAa,WAAW,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,QAAQ,CAAC;AAE9B,SACE,4DACG,UAAU,aAAa,UACtB,qCAAC,YACC,qCAAC;AAAA,IAAiB,UAAU;AAAA,IAAU,GAAG;AAAA,GAAuB,CAClE,GAED,aACC,qCAAC;AAAA,IAAK;AAAA,KACJ,qCAAC;AAAA,IAAW,GAAG;AAAA,GAAa,CAC9B,GAED,UAAU,aAAa,WACtB,qCAAC,YACC,qCAAC;AAAA,IAAiB,UAAU;AAAA,IAAW,GAAG;AAAA,GAAuB,CACnE,CAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
import * as React from "react";
|
|
22
3
|
import React2 from "react";
|
|
23
4
|
import { DSButton } from "@elliemae/ds-button";
|
|
24
|
-
const MiniToolbarButton = (props) => /* @__PURE__ */ React2.createElement(DSButton,
|
|
5
|
+
const MiniToolbarButton = (props) => /* @__PURE__ */ React2.createElement(DSButton, {
|
|
6
|
+
...props,
|
|
25
7
|
"aria-label": props.ariaLabel,
|
|
26
8
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
27
|
-
})
|
|
9
|
+
});
|
|
28
10
|
export {
|
|
29
11
|
MiniToolbarButton
|
|
30
12
|
};
|
|
@@ -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": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AAEA,MAAM,oBAAoB,CAAC,UACzB,qCAAC;AAAA,EAAU,GAAG;AAAA,EAAO,cAAY,MAAM;AAAA,EAAW,eAAY;AAAA,CAA4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2 from "react";
|
|
20
4
|
import { DSComboBox2 } from "@elliemae/ds-form";
|
|
21
|
-
const MiniToolbarComboBox = (props) => /* @__PURE__ */ React2.createElement(DSComboBox2,
|
|
5
|
+
const MiniToolbarComboBox = (props) => /* @__PURE__ */ React2.createElement(DSComboBox2, {
|
|
6
|
+
...props
|
|
7
|
+
});
|
|
22
8
|
export {
|
|
23
9
|
MiniToolbarComboBox
|
|
24
10
|
};
|
|
@@ -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": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AAEA,MAAM,sBAAsB,CAAC,UAAuD,qCAAC;AAAA,EAAa,GAAG;AAAA,CAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2 from "react";
|
|
20
4
|
import { Search } from "@elliemae/ds-icons";
|
|
@@ -34,10 +18,11 @@ const MiniToolbarSearchButton = (props) => {
|
|
|
34
18
|
"data-testid": "ds-mini-toolbar__shortcut"
|
|
35
19
|
});
|
|
36
20
|
};
|
|
37
|
-
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ React2.createElement(DSSearchBox,
|
|
21
|
+
const MiniToolbarSearchBox = (props) => /* @__PURE__ */ React2.createElement(DSSearchBox, {
|
|
38
22
|
clearable: true,
|
|
39
|
-
showIcon: false
|
|
40
|
-
|
|
23
|
+
showIcon: false,
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
41
26
|
export {
|
|
42
27
|
MiniToolbarSearchBox,
|
|
43
28
|
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": "
|
|
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;AAAA,IACC,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,qCAAC;AAAA,MAAO;AAAA,MAAY;AAAA,KAAc;AAAA,IAC5C,eAAY;AAAA,GACd;AAEJ;AAEA,MAAM,uBAAuB,CAAC,UAC5B,qCAAC;AAAA,EAAY,WAAS;AAAA,EAAC,UAAU;AAAA,EAAQ,GAAG;AAAA,CAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2, { useMemo } from "react";
|
|
20
4
|
import { uid } from "uid";
|
|
@@ -71,7 +55,10 @@ const useGenerateItems = (items) => {
|
|
|
71
55
|
const dropdownMenuItems = useMemo(() => items.map((item, index) => {
|
|
72
56
|
const { component, sharedProps, dropdownComponentProps } = item;
|
|
73
57
|
const dropdownItem = {};
|
|
74
|
-
const { Icon, color, label, onClick } =
|
|
58
|
+
const { Icon, color, label, onClick } = {
|
|
59
|
+
...sharedProps,
|
|
60
|
+
...dropdownComponentProps
|
|
61
|
+
};
|
|
75
62
|
if (component === SEPARATOR)
|
|
76
63
|
dropdownItem.type = "separator";
|
|
77
64
|
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": "
|
|
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,CAAC,GAAG,CAAC,CAAC;AAE5C,QAAM,gBAAgB,QACpB,MACE,MACG,OAAO,CAAC,SAAS,KAAK,eAAe,KAAK,cAAc,cAAc,KAAK,gBAAgB,EAC3F,IAAI,CAAC,MAAM,UAAU;AACpB,UAAM,EAAE,WAAW,mBAAmB,eAAe,aAAa,kBAAkB,0BAClF;AAEF,QAAI;AACJ,QAAI;AAEJ,QAAI,cAAc;AAAW,aAAO,qCAAC,0BAAqB;AAC1D,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,MACd;AACA,yBAAmB;AAAA,IACrB;AACA,QAAI,CAAC,kBAAkB;AACrB,yBAAmB;AAAA,IACrB;AACA,QAAI,CAAC,WAAW;AACd,kBAAY;AAAA,IACd;AAEA,WACE,qCAAC;AAAA,MACC,KAAK,GAAG,wBAAwB;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,KACF;AAAA,EAEJ,CAAC,GACL,CAAC,aAAa,KAAK,CACrB;AAEA,QAAM,oBAAoB,QACxB,MACE,MAAM,IAAI,CAAC,MAAM,UAAU;AACzB,UAAM,EAAE,WAAW,aAAa,2BAA2B;AAC3D,UAAM,eAAuC,CAAC;AAE9C,UAAM,EAAE,MAAM,OAAO,OAAO,YAAY;AAAA,MACtC,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAEA,QAAI,cAAc;AAAW,mBAAa,OAAO;AAAA,SAC5C;AACH,mBAAa,KAAK,GAAG,wBAAwB;AAC7C,mBAAa,UAAU,MAAM,QAAQ,IAAI;AACzC,mBAAa,QAAQ;AACrB,mBAAa,YAAY,CAAC,MAA2B;AACnD,YAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;AACtC,kBAAQ,IAAI;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAEA,QAAI,cAAc,WAAW;AAC3B,mBAAa,YAAY,qCAAC;AAAA,QAAK;AAAA,OAAc;AAAA,IAC/C,WAAW,cAAc,YAAY;AACnC,mBAAa,YAAY,qCAAC;AAAA,QAAO;AAAA,OAAc;AAAA,IACjD,WAAW,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,MAAM;AACrE,eAAO,YAAY,CAAC,MAA2B;AAC7C,cAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,mCAAuB,iBAAiB,MAAM;AAAA,UAChD;AAAA,QACF;AACA,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT,CAAC,GACH,CAAC,aAAa,KAAK,CACrB;AAEA,SAAO,CAAC,eAAe,iBAAiB;AAC1C;",
|
|
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.3.0-next.
|
|
3
|
+
"version": "3.3.0-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - MiniToolbar",
|
|
6
6
|
"files": [
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
"indent": 4
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@elliemae/ds-button": "3.3.0-next.
|
|
79
|
-
"@elliemae/ds-dropdownmenu": "3.3.0-next.
|
|
80
|
-
"@elliemae/ds-form": "3.3.0-next.
|
|
81
|
-
"@elliemae/ds-icons": "3.3.0-next.
|
|
82
|
-
"@elliemae/ds-system": "3.3.0-next.
|
|
83
|
-
"@elliemae/ds-utilities": "3.3.0-next.
|
|
78
|
+
"@elliemae/ds-button": "3.3.0-next.6",
|
|
79
|
+
"@elliemae/ds-dropdownmenu": "3.3.0-next.6",
|
|
80
|
+
"@elliemae/ds-form": "3.3.0-next.6",
|
|
81
|
+
"@elliemae/ds-icons": "3.3.0-next.6",
|
|
82
|
+
"@elliemae/ds-system": "3.3.0-next.6",
|
|
83
|
+
"@elliemae/ds-utilities": "3.3.0-next.6",
|
|
84
84
|
"uid": "~2.0.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|