@elliemae/ds-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/DSToolbarItemV2.js +17 -4
- package/dist/cjs/DSToolbarItemV2.js.map +1 -1
- package/dist/cjs/DSToolbarV2.js +18 -1
- package/dist/cjs/DSToolbarV2.js.map +1 -1
- package/dist/cjs/deprecated/DSToolbar.js +49 -14
- package/dist/cjs/deprecated/DSToolbar.js.map +1 -1
- package/dist/cjs/deprecated/ToolbarItem.js +35 -7
- package/dist/cjs/deprecated/ToolbarItem.js.map +1 -1
- package/dist/cjs/deprecated/decorateToolbarChildren.js +19 -4
- package/dist/cjs/deprecated/decorateToolbarChildren.js.map +1 -1
- package/dist/esm/DSToolbarItemV2.js +19 -4
- package/dist/esm/DSToolbarItemV2.js.map +1 -1
- package/dist/esm/DSToolbarV2.js +20 -1
- package/dist/esm/DSToolbarV2.js.map +1 -1
- package/dist/esm/deprecated/DSToolbar.js +51 -14
- package/dist/esm/deprecated/DSToolbar.js.map +1 -1
- package/dist/esm/deprecated/ToolbarItem.js +37 -7
- package/dist/esm/deprecated/ToolbarItem.js.map +1 -1
- package/dist/esm/deprecated/decorateToolbarChildren.js +21 -4
- package/dist/esm/deprecated/decorateToolbarChildren.js.map +1 -1
- package/package.json +11 -10
- package/dist/types/DSToolbarItemV2.d.ts +0 -8
- package/dist/types/DSToolbarSeparatorV2.d.ts +0 -2
- package/dist/types/DSToolbarV2.d.ts +0 -10
- package/dist/types/DSToolbarV2Context.d.ts +0 -8
- package/dist/types/deprecated/DSToolbar.d.ts +0 -51
- package/dist/types/deprecated/ToolbarDivider.d.ts +0 -3
- package/dist/types/deprecated/ToolbarGroup.d.ts +0 -15
- package/dist/types/deprecated/ToolbarItem.d.ts +0 -16
- package/dist/types/deprecated/decorateToolbarChildren.d.ts +0 -2
- package/dist/types/deprecated/index.d.ts +0 -2
- package/dist/types/index.d.ts +0 -5
- package/dist/types/props.d.ts +0 -18
- package/dist/types/styled.d.ts +0 -4
- package/dist/types/tests/DSToolbar.test.d.ts +0 -1
- package/dist/types/useToolbarItemHandlers.d.ts +0 -3
|
@@ -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)
|
|
@@ -44,12 +58,11 @@ const DSToolbarItemV2 = ({ render }) => {
|
|
|
44
58
|
return id;
|
|
45
59
|
}, [registerReference, ref]);
|
|
46
60
|
const handlers = (0, import_useToolbarItemHandlers.useToolbarItemHandlers)(toolbarItemId);
|
|
47
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarItem, {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledToolbarItem, __spreadValues({
|
|
48
62
|
id: toolbarItemId,
|
|
49
63
|
"data-testid": "ds-toolbar-item",
|
|
50
|
-
className: "ds-toolbar-item"
|
|
51
|
-
|
|
52
|
-
}, render({ innerRef: ref }));
|
|
64
|
+
className: "ds-toolbar-item"
|
|
65
|
+
}, handlers), render({ innerRef: ref }));
|
|
53
66
|
};
|
|
54
67
|
module.exports = __toCommonJS(DSToolbarItemV2_exports);
|
|
55
68
|
//# sourceMappingURL=DSToolbarItemV2.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSToolbarItemV2.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAqE;AACrE,iBAAoB;AACpB,gCAAmC;AACnC,oBAAkC;AAClC,oCAAuC;AAMhC,MAAM,kBAAyD,CAAC,EAAE,aAAa;AACpF,QAAM,EAAE,sBAAsB,6BAAW;AACzC,QAAM,MAAM,yBAAO;AAEnB,QAAM,gBAAgB,0BAAQ,MAAM;AAClC,UAAM,KAAK,mBAAmB;AAC9B,sBAAkB,IAAI;AACtB,WAAO;AAAA,KACN,CAAC,mBAAmB;AAEvB,QAAM,WAAW,0DAAuB;AAExC,SACE,mDAAC,iCAAD;AAAA,IAAmB,IAAI;AAAA,IAAe,eAAY;AAAA,IAAkB,WAAU;AAAA,KAAsB,WACjG,OAAO,EAAE,UAAU;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/DSToolbarV2.js
CHANGED
|
@@ -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)
|
|
@@ -44,7 +61,7 @@ const DSToolbarV2 = (props) => {
|
|
|
44
61
|
const toolbarUid = (0, import_react.useMemo)(() => `ds-toolbar-${(0, import_uid.uid)()}`, []);
|
|
45
62
|
const [itemReferences, setItemReferences] = (0, import_react.useState)({});
|
|
46
63
|
const registerReference = (0, import_react.useCallback)((itemId, ref) => {
|
|
47
|
-
setItemReferences((prevItemReferences) => ({
|
|
64
|
+
setItemReferences((prevItemReferences) => __spreadProps(__spreadValues({}, prevItemReferences), { [itemId]: ref }));
|
|
48
65
|
}, [setItemReferences]);
|
|
49
66
|
return /* @__PURE__ */ import_react.default.createElement(import_DSToolbarV2Context.DSToolbarV2Context.Provider, {
|
|
50
67
|
value: { toolbarUid, registerReference, itemReferences }
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSToolbarV2.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2Schema);\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAsD;AACtD,8BAA+C;AAC/C,wBAAyB;AACzB,iBAAoB;AACpB,gCAAmC;AACnC,mBAAkC;AAClC,oBAAqC;AAQrC,MAAM,cAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,WAAW,WAAW,SAAS,UAAU,aAAa;AAE9D,8DAA+B,OAAO;AAEtC,QAAM,aAAa,0BAAQ,MAAM,cAAc,yBAAS;AAExD,QAAM,CAAC,gBAAgB,qBAAqB,2BAAS;AAErD,QAAM,oBAAoB,8BACxB,CAAC,QAAgB,QAA6C;AAC5D,sBAAkB,CAAC,uBAAwB,iCAAK,qBAAL,GAA0B,SAAS;AAAA,KAEhF,CAAC;AAGH,SACE,mDAAC,6CAAmB,UAApB;AAAA,IAA6B,OAAO,EAAE,YAAY,mBAAmB;AAAA,KACnE,mDAAC,oCAAD;AAAA,IACE,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,IAAI;AAAA,IACJ,YAAW;AAAA,IACX,gBAAgB,cAAc,SAAS,eAAe;AAAA,IACtD;AAAA,IACA,MAAM,qBAAM,SAAS,IAAI,UAAU,MAAM,CAAC;AAAA,IAC1C,QAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,KAEJ;AAAA;AAMT,YAAY,YAAY;AACxB,YAAY,eAAe;AAAA,EACzB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA;AAEX,MAAM,wBAAwB,gCAAS,aAAa,YAAY;AAChE,sBAAsB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,39 @@
|
|
|
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 });
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
8
37
|
var __export = (target, all) => {
|
|
9
38
|
for (var name in all)
|
|
10
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -50,16 +79,24 @@ const ToolbarContainer = (0, import_ds_classnames.aggregatedClasses)("div")(bloc
|
|
|
50
79
|
[alignment]: !!alignment,
|
|
51
80
|
[size]: size
|
|
52
81
|
}));
|
|
53
|
-
const DSToolbar = ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
82
|
+
const DSToolbar = (_a) => {
|
|
83
|
+
var _b = _a, {
|
|
84
|
+
containerProps = {},
|
|
85
|
+
innerRef,
|
|
86
|
+
withDepth = true,
|
|
87
|
+
alignment = "right",
|
|
88
|
+
autoFocusOnMount = true,
|
|
89
|
+
children = [],
|
|
90
|
+
size = "normal"
|
|
91
|
+
} = _b, otherProps = __objRest(_b, [
|
|
92
|
+
"containerProps",
|
|
93
|
+
"innerRef",
|
|
94
|
+
"withDepth",
|
|
95
|
+
"alignment",
|
|
96
|
+
"autoFocusOnMount",
|
|
97
|
+
"children",
|
|
98
|
+
"size"
|
|
99
|
+
]);
|
|
63
100
|
const containerRef = (0, import_react.useRef)(null);
|
|
64
101
|
return /* @__PURE__ */ import_react.default.createElement(import_FocusGroupManager.default, {
|
|
65
102
|
autoFocusOnMount,
|
|
@@ -68,12 +105,10 @@ const DSToolbar = ({
|
|
|
68
105
|
Tab: "next"
|
|
69
106
|
},
|
|
70
107
|
orientation: "horizontal"
|
|
71
|
-
}, /* @__PURE__ */ import_react.default.createElement(ToolbarContainer, {
|
|
72
|
-
...containerProps,
|
|
73
|
-
...otherProps,
|
|
108
|
+
}, /* @__PURE__ */ import_react.default.createElement(ToolbarContainer, __spreadProps(__spreadValues(__spreadValues({}, containerProps), otherProps), {
|
|
74
109
|
classProps: { withDepth, alignment, size },
|
|
75
110
|
innerRef: (0, import_ds_utilities.mergeRefs)(innerRef, containerRef)
|
|
76
|
-
}, (0, import_decorateToolbarChildren.default)(children)));
|
|
111
|
+
}), (0, import_decorateToolbarChildren.default)(children)));
|
|
77
112
|
};
|
|
78
113
|
const toolbarProps = {
|
|
79
114
|
containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/DSToolbar.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAC9B,wBAAoC;AACpC,2BAAkC;AAClC,+BAA+B;AAC/B,0BAA0B;AAC1B,qCAAoC;AACpC,yBAAiB;AACjB,0BAAyB;AACzB,4BAAoB;AAEpB,MAAM,YAAY;AAElB,MAAM,mBAAmB,4CAAkB,OACzC,WACA,MACA,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACnC,iBAAiB,CAAC;AAAA,GACjB,YAAY,CAAC,CAAC;AAAA,GACd,OAAO;AAAA;AAIZ,MAAM,YAAY,CAAC,OASb;AATa,eACjB;AAAA,qBAAiB;AAAA,IACjB;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,OAAO;AAAA,MAPU,IAQd,uBARc,IAQd;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,yBAAO;AAC5B,SACE,mDAAC,kCAAD;AAAA,IACE;AAAA,IACA,cAAc,MAAM,aAAa;AAAA,IACjC,aAAa;AAAA,MACX,KAAK;AAAA;AAAA,IAEP,aAAY;AAAA,KAEZ,mDAAC,kBAAD,gDACM,iBACA,aAFN;AAAA,IAGE,YAAY,EAAE,WAAW,WAAW;AAAA,IACpC,UAAU,mCAAU,UAAU;AAAA,MAE7B,4CAAwB;AAAA;AAMjC,MAAM,eAAe;AAAA,EACnB,gBAAgB,4BAAU,OAAO,YAC/B;AAAA,EAEF,WAAW,4BAAU,KAClB,YAAY,mCACZ,aAAa;AAAA,EAChB,WAAW,4BAAU,MAAM,CAAC,SAAS,SAClC,YAAY,2CACZ,aAAa;AAAA,EAChB,MAAM,4BAAU,MAAM,CAAC,UAAU,YAC9B,YAAY,gBACZ,aAAa;AAAA,EAChB,kBAAkB,4BAAU,KACzB,YAAY,uDACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,UAAU;AAAA,IAC5B,4BAAU;AAAA,IACV,4BAAU;AAAA,IACV,4BAAU;AAAA,KACT,YAAY,iBAAiB;AAAA,EAChC,UAAU,4BAAU,OAAO,YACzB;AAAA;AAIJ,UAAU,YAAY;AAEtB,MAAM,oBAAoB,gCAAS;AACnC,kBAAkB,YAAY;AAU9B,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,39 @@
|
|
|
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 });
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
8
37
|
var __export = (target, all) => {
|
|
9
38
|
for (var name in all)
|
|
10
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -35,22 +64,21 @@ var import_prop_types = __toESM(require("prop-types"));
|
|
|
35
64
|
var import_FocusGroup = require("@elliemae/ds-shared/FocusGroup");
|
|
36
65
|
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
37
66
|
var import_ds_popper = require("@elliemae/ds-popper");
|
|
38
|
-
const ToolbarItem = (
|
|
67
|
+
const ToolbarItem = (_a) => {
|
|
68
|
+
var _b = _a, { icon, labelText, menu = void 0 } = _b, otherProps = __objRest(_b, ["icon", "labelText", "menu"]);
|
|
39
69
|
const [ref, setRef] = (0, import_react.useState)(null);
|
|
40
70
|
(0, import_FocusGroup.useFocusGroupWithState)(ref);
|
|
41
|
-
const btn = /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
42
|
-
...otherProps,
|
|
71
|
+
const btn = /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, __spreadProps(__spreadValues({}, otherProps), {
|
|
43
72
|
buttonType: "text",
|
|
44
73
|
icon,
|
|
45
74
|
innerRef: (r) => setRef(r),
|
|
46
75
|
labelText
|
|
47
|
-
});
|
|
76
|
+
}));
|
|
48
77
|
if (menu) {
|
|
49
|
-
return import_react.default.cloneElement(menu, {
|
|
50
|
-
...menu.props,
|
|
78
|
+
return import_react.default.cloneElement(menu, __spreadProps(__spreadValues({}, menu.props), {
|
|
51
79
|
placement: import_ds_popper.PopperPositions.BOTTOM_END,
|
|
52
80
|
triggerComponent: btn
|
|
53
|
-
});
|
|
81
|
+
}));
|
|
54
82
|
}
|
|
55
83
|
return btn;
|
|
56
84
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/ToolbarItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAgC;AAChC,wBAAsB;AACtB,wBAAuC;AACvC,uBAAqB;AACrB,uBAA4C;AAE5C,MAAM,cAAc,CAAC,OAAyD;AAAzD,eAAE,QAAM,WAAW,OAAO,WAA1B,IAAwC,uBAAxC,IAAwC,CAAtC,QAAM,aAAW;AACtC,QAAM,CAAC,KAAK,UAAU,2BAAS;AAE/B,gDAAuB;AACvB,QAAM,MACJ,mDAAC,0BAAD,iCAAc,aAAd;AAAA,IAA0B,YAAW;AAAA,IAAO;AAAA,IAAY,UAAU,CAAC,MAAM,OAAO;AAAA,IAAI;AAAA;AAEtF,MAAI,MAAM;AACR,WAAO,qBAAM,aAAa,MAAM,iCAC3B,KAAK,QADsB;AAAA,MAE9B,WAAW,iCAAS;AAAA,MACpB,kBAAkB;AAAA;AAAA;AAGtB,SAAO;AAAA;AAGT,YAAY,cAAc;AAE1B,YAAY,YAAY;AAAA,EACtB,MAAM,0BAAU;AAAA,EAChB,WAAW,0BAAU;AAAA;AAGvB,IAAO,sBAAQ;",
|
|
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)
|
|
@@ -31,10 +48,8 @@ __export(decorateToolbarChildren_exports, {
|
|
|
31
48
|
});
|
|
32
49
|
var React = __toESM(require("react"));
|
|
33
50
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var decorateToolbarChildren_default = (children, extraProps = {}) => import_react.default.Children.map(children, (component) => component ? (0, import_react.cloneElement)(component, {
|
|
35
|
-
...extraProps,
|
|
36
|
-
...component.props,
|
|
51
|
+
var decorateToolbarChildren_default = (children, extraProps = {}) => import_react.default.Children.map(children, (component) => component ? (0, import_react.cloneElement)(component, __spreadProps(__spreadValues(__spreadValues({}, extraProps), component.props), {
|
|
37
52
|
className: `${component.props.className} toolbar-item`
|
|
38
|
-
}) : component, null);
|
|
53
|
+
})) : component, null);
|
|
39
54
|
module.exports = __toCommonJS(decorateToolbarChildren_exports);
|
|
40
55
|
//# sourceMappingURL=decorateToolbarChildren.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/decorateToolbarChildren.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAEpC,IAAO,kCAAQ,CAAC,UAAU,aAAa,OACrC,qBAAM,SAAS,IACb,UACA,eACE,YACI,+BAAa,WAAW,gDACnB,aACA,UAAU,QAFS;AAAA,EAGtB,WAAW,GAAG,UAAU,MAAM;AAAA,MAEhC,WACN;",
|
|
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, { useContext, useMemo, useRef } from "react";
|
|
3
19
|
import { uid } from "uid";
|
|
@@ -13,12 +29,11 @@ const DSToolbarItemV2 = ({ render }) => {
|
|
|
13
29
|
return id;
|
|
14
30
|
}, [registerReference, ref]);
|
|
15
31
|
const handlers = useToolbarItemHandlers(toolbarItemId);
|
|
16
|
-
return /* @__PURE__ */ React2.createElement(StyledToolbarItem, {
|
|
32
|
+
return /* @__PURE__ */ React2.createElement(StyledToolbarItem, __spreadValues({
|
|
17
33
|
id: toolbarItemId,
|
|
18
34
|
"data-testid": "ds-toolbar-item",
|
|
19
|
-
className: "ds-toolbar-item"
|
|
20
|
-
|
|
21
|
-
}, render({ innerRef: ref }));
|
|
35
|
+
className: "ds-toolbar-item"
|
|
36
|
+
}, handlers), render({ innerRef: ref }));
|
|
22
37
|
};
|
|
23
38
|
export {
|
|
24
39
|
DSToolbarItemV2
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarItemV2.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AAMO,MAAM,kBAAyD,CAAC,EAAE,aAAa;AACpF,QAAM,EAAE,sBAAsB,WAAW;AACzC,QAAM,MAAM,OAAO;AAEnB,QAAM,gBAAgB,QAAQ,MAAM;AAClC,UAAM,KAAK,mBAAmB;AAC9B,sBAAkB,IAAI;AACtB,WAAO;AAAA,KACN,CAAC,mBAAmB;AAEvB,QAAM,WAAW,uBAAuB;AAExC,SACE,qCAAC,mBAAD;AAAA,IAAmB,IAAI;AAAA,IAAe,eAAY;AAAA,IAAkB,WAAU;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AAMO,MAAM,kBAAyD,CAAC,EAAE,aAAa;AACpF,QAAM,EAAE,sBAAsB,WAAW;AACzC,QAAM,MAAM,OAAO;AAEnB,QAAM,gBAAgB,QAAQ,MAAM;AAClC,UAAM,KAAK,mBAAmB;AAC9B,sBAAkB,IAAI;AACtB,WAAO;AAAA,KACN,CAAC,mBAAmB;AAEvB,QAAM,WAAW,uBAAuB;AAExC,SACE,qCAAC,mBAAD;AAAA,IAAmB,IAAI;AAAA,IAAe,eAAY;AAAA,IAAkB,WAAU;AAAA,KAAsB,WACjG,OAAO,EAAE,UAAU;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSToolbarV2.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
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, { useCallback, useMemo, useState } from "react";
|
|
3
22
|
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
@@ -12,7 +31,7 @@ const DSToolbarV2 = (props) => {
|
|
|
12
31
|
const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);
|
|
13
32
|
const [itemReferences, setItemReferences] = useState({});
|
|
14
33
|
const registerReference = useCallback((itemId, ref) => {
|
|
15
|
-
setItemReferences((prevItemReferences) => ({
|
|
34
|
+
setItemReferences((prevItemReferences) => __spreadProps(__spreadValues({}, prevItemReferences), { [itemId]: ref }));
|
|
16
35
|
}, [setItemReferences]);
|
|
17
36
|
return /* @__PURE__ */ React2.createElement(DSToolbarV2Context.Provider, {
|
|
18
37
|
value: { toolbarUid, registerReference, itemReferences }
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarV2.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2Schema);\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,MAAM,cAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,WAAW,WAAW,SAAS,UAAU,aAAa;AAE9D,iCAA+B,OAAO;AAEtC,QAAM,aAAa,QAAQ,MAAM,cAAc,SAAS;AAExD,QAAM,CAAC,gBAAgB,qBAAqB,SAAS;AAErD,QAAM,oBAAoB,YACxB,CAAC,QAAgB,QAA6C;AAC5D,sBAAkB,CAAC,uBAAwB,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,MAAM,cAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,WAAW,WAAW,SAAS,UAAU,aAAa;AAE9D,iCAA+B,OAAO;AAEtC,QAAM,aAAa,QAAQ,MAAM,cAAc,SAAS;AAExD,QAAM,CAAC,gBAAgB,qBAAqB,SAAS;AAErD,QAAM,oBAAoB,YACxB,CAAC,QAAgB,QAA6C;AAC5D,sBAAkB,CAAC,uBAAwB,iCAAK,qBAAL,GAA0B,SAAS;AAAA,KAEhF,CAAC;AAGH,SACE,qCAAC,mBAAmB,UAApB;AAAA,IAA6B,OAAO,EAAE,YAAY,mBAAmB;AAAA,KACnE,qCAAC,sBAAD;AAAA,IACE,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,IAAI;AAAA,IACJ,YAAW;AAAA,IACX,gBAAgB,cAAc,SAAS,eAAe;AAAA,IACtD;AAAA,IACA,MAAM,OAAM,SAAS,IAAI,UAAU,MAAM,CAAC;AAAA,IAC1C,QAAO;AAAA,IACP;AAAA,IACA,KAAK;AAAA,KAEJ;AAAA;AAMT,YAAY,YAAY;AACxB,YAAY,eAAe;AAAA,EACzB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA;AAEX,MAAM,wBAAwB,SAAS,aAAa,YAAY;AAChE,sBAAsB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,34 @@
|
|
|
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));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2, { useRef } from "react";
|
|
3
34
|
import { describe, PropTypes } from "react-desc";
|
|
@@ -14,16 +45,24 @@ const ToolbarContainer = aggregatedClasses("div")(blockName, null, ({ withDepth,
|
|
|
14
45
|
[alignment]: !!alignment,
|
|
15
46
|
[size]: size
|
|
16
47
|
}));
|
|
17
|
-
const DSToolbar = ({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
48
|
+
const DSToolbar = (_a) => {
|
|
49
|
+
var _b = _a, {
|
|
50
|
+
containerProps = {},
|
|
51
|
+
innerRef,
|
|
52
|
+
withDepth = true,
|
|
53
|
+
alignment = "right",
|
|
54
|
+
autoFocusOnMount = true,
|
|
55
|
+
children = [],
|
|
56
|
+
size = "normal"
|
|
57
|
+
} = _b, otherProps = __objRest(_b, [
|
|
58
|
+
"containerProps",
|
|
59
|
+
"innerRef",
|
|
60
|
+
"withDepth",
|
|
61
|
+
"alignment",
|
|
62
|
+
"autoFocusOnMount",
|
|
63
|
+
"children",
|
|
64
|
+
"size"
|
|
65
|
+
]);
|
|
27
66
|
const containerRef = useRef(null);
|
|
28
67
|
return /* @__PURE__ */ React2.createElement(FocusGroupProvider, {
|
|
29
68
|
autoFocusOnMount,
|
|
@@ -32,12 +71,10 @@ const DSToolbar = ({
|
|
|
32
71
|
Tab: "next"
|
|
33
72
|
},
|
|
34
73
|
orientation: "horizontal"
|
|
35
|
-
}, /* @__PURE__ */ React2.createElement(ToolbarContainer, {
|
|
36
|
-
...containerProps,
|
|
37
|
-
...otherProps,
|
|
74
|
+
}, /* @__PURE__ */ React2.createElement(ToolbarContainer, __spreadProps(__spreadValues(__spreadValues({}, containerProps), otherProps), {
|
|
38
75
|
classProps: { withDepth, alignment, size },
|
|
39
76
|
innerRef: mergeRefs(innerRef, containerRef)
|
|
40
|
-
}, decorateToolbarChildren(children)));
|
|
77
|
+
}), decorateToolbarChildren(children)));
|
|
41
78
|
};
|
|
42
79
|
const toolbarProps = {
|
|
43
80
|
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/DSToolbar.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,OACzC,WACA,MACA,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACnC,iBAAiB,CAAC;AAAA,GACjB,YAAY,CAAC,CAAC;AAAA,GACd,OAAO;AAAA;AAIZ,MAAM,YAAY,CAAC;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,OACzC,WACA,MACA,CAAC,EAAE,WAAW,WAAW,WAAY;AAAA,EACnC,iBAAiB,CAAC;AAAA,GACjB,YAAY,CAAC,CAAC;AAAA,GACd,OAAO;AAAA;AAIZ,MAAM,YAAY,CAAC,OASb;AATa,eACjB;AAAA,qBAAiB;AAAA,IACjB;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,OAAO;AAAA,MAPU,IAQd,uBARc,IAQd;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,OAAO;AAC5B,SACE,qCAAC,oBAAD;AAAA,IACE;AAAA,IACA,cAAc,MAAM,aAAa;AAAA,IACjC,aAAa;AAAA,MACX,KAAK;AAAA;AAAA,IAEP,aAAY;AAAA,KAEZ,qCAAC,kBAAD,gDACM,iBACA,aAFN;AAAA,IAGE,YAAY,EAAE,WAAW,WAAW;AAAA,IACpC,UAAU,UAAU,UAAU;AAAA,MAE7B,wBAAwB;AAAA;AAMjC,MAAM,eAAe;AAAA,EACnB,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAEF,WAAW,UAAU,KAClB,YAAY,mCACZ,aAAa;AAAA,EAChB,WAAW,UAAU,MAAM,CAAC,SAAS,SAClC,YAAY,2CACZ,aAAa;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,YAC9B,YAAY,gBACZ,aAAa;AAAA,EAChB,kBAAkB,UAAU,KACzB,YAAY,uDACZ,aAAa;AAAA,EAChB,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,KACT,YAAY,iBAAiB;AAAA,EAChC,UAAU,UAAU,OAAO,YACzB;AAAA;AAIJ,UAAU,YAAY;AAEtB,MAAM,oBAAoB,SAAS;AACnC,kBAAkB,YAAY;AAU9B,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,25 +1,55 @@
|
|
|
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));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2, { useState } from "react";
|
|
3
34
|
import PropTypes from "prop-types";
|
|
4
35
|
import { useFocusGroupWithState } from "@elliemae/ds-shared/FocusGroup";
|
|
5
36
|
import DSButton from "@elliemae/ds-button";
|
|
6
37
|
import { PopperPositions as Position } from "@elliemae/ds-popper";
|
|
7
|
-
const ToolbarItem = (
|
|
38
|
+
const ToolbarItem = (_a) => {
|
|
39
|
+
var _b = _a, { icon, labelText, menu = void 0 } = _b, otherProps = __objRest(_b, ["icon", "labelText", "menu"]);
|
|
8
40
|
const [ref, setRef] = useState(null);
|
|
9
41
|
useFocusGroupWithState(ref);
|
|
10
|
-
const btn = /* @__PURE__ */ React2.createElement(DSButton, {
|
|
11
|
-
...otherProps,
|
|
42
|
+
const btn = /* @__PURE__ */ React2.createElement(DSButton, __spreadProps(__spreadValues({}, otherProps), {
|
|
12
43
|
buttonType: "text",
|
|
13
44
|
icon,
|
|
14
45
|
innerRef: (r) => setRef(r),
|
|
15
46
|
labelText
|
|
16
|
-
});
|
|
47
|
+
}));
|
|
17
48
|
if (menu) {
|
|
18
|
-
return React2.cloneElement(menu, {
|
|
19
|
-
...menu.props,
|
|
49
|
+
return React2.cloneElement(menu, __spreadProps(__spreadValues({}, menu.props), {
|
|
20
50
|
placement: Position.BOTTOM_END,
|
|
21
51
|
triggerComponent: btn
|
|
22
|
-
});
|
|
52
|
+
}));
|
|
23
53
|
}
|
|
24
54
|
return btn;
|
|
25
55
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/ToolbarItem.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,OAAyD;AAAzD,eAAE,QAAM,WAAW,OAAO,WAA1B,IAAwC,uBAAxC,IAAwC,CAAtC,QAAM,aAAW;AACtC,QAAM,CAAC,KAAK,UAAU,SAAS;AAE/B,yBAAuB;AACvB,QAAM,MACJ,qCAAC,UAAD,iCAAc,aAAd;AAAA,IAA0B,YAAW;AAAA,IAAO;AAAA,IAAY,UAAU,CAAC,MAAM,OAAO;AAAA,IAAI;AAAA;AAEtF,MAAI,MAAM;AACR,WAAO,OAAM,aAAa,MAAM,iCAC3B,KAAK,QADsB;AAAA,MAE9B,WAAW,SAAS;AAAA,MACpB,kBAAkB;AAAA;AAAA;AAGtB,SAAO;AAAA;AAGT,YAAY,cAAc;AAE1B,YAAY,YAAY;AAAA,EACtB,MAAM,UAAU;AAAA,EAChB,WAAW,UAAU;AAAA;AAGvB,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,27 @@
|
|
|
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, { cloneElement } from "react";
|
|
3
|
-
var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(children, (component) => component ? cloneElement(component, {
|
|
4
|
-
...extraProps,
|
|
5
|
-
...component.props,
|
|
22
|
+
var decorateToolbarChildren_default = (children, extraProps = {}) => React2.Children.map(children, (component) => component ? cloneElement(component, __spreadProps(__spreadValues(__spreadValues({}, extraProps), component.props), {
|
|
6
23
|
className: `${component.props.className} toolbar-item`
|
|
7
|
-
}) : component, null);
|
|
24
|
+
})) : component, null);
|
|
8
25
|
export {
|
|
9
26
|
decorateToolbarChildren_default as default
|
|
10
27
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/decorateToolbarChildren.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEA,IAAO,kCAAQ,CAAC,UAAU,aAAa,OACrC,OAAM,SAAS,IACb,UACA,eACE,YACI,aAAa,WAAW
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAEA,IAAO,kCAAQ,CAAC,UAAU,aAAa,OACrC,OAAM,SAAS,IACb,UACA,eACE,YACI,aAAa,WAAW,gDACnB,aACA,UAAU,QAFS;AAAA,EAGtB,WAAW,GAAG,UAAU,MAAM;AAAA,MAEhC,WACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toolbar",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Toolbar",
|
|
6
6
|
"files": [
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
"indent": 4
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@elliemae/ds-button": "3.0.0-alpha.
|
|
91
|
-
"@elliemae/ds-classnames": "3.0.0-alpha.
|
|
92
|
-
"@elliemae/ds-grid": "3.0.0-alpha.
|
|
93
|
-
"@elliemae/ds-icons": "3.0.0-alpha.
|
|
94
|
-
"@elliemae/ds-popper": "3.0.0-alpha.
|
|
95
|
-
"@elliemae/ds-props-helpers": "3.0.0-alpha.
|
|
96
|
-
"@elliemae/ds-shared": "3.0.0-alpha.
|
|
97
|
-
"@elliemae/ds-system": "3.0.0-alpha.
|
|
98
|
-
"@elliemae/ds-utilities": "3.0.0-alpha.
|
|
90
|
+
"@elliemae/ds-button": "3.0.0-alpha.1",
|
|
91
|
+
"@elliemae/ds-classnames": "3.0.0-alpha.1",
|
|
92
|
+
"@elliemae/ds-grid": "3.0.0-alpha.1",
|
|
93
|
+
"@elliemae/ds-icons": "3.0.0-alpha.1",
|
|
94
|
+
"@elliemae/ds-popper": "3.0.0-alpha.1",
|
|
95
|
+
"@elliemae/ds-props-helpers": "3.0.0-alpha.1",
|
|
96
|
+
"@elliemae/ds-shared": "3.0.0-alpha.1",
|
|
97
|
+
"@elliemae/ds-system": "3.0.0-alpha.1",
|
|
98
|
+
"@elliemae/ds-utilities": "3.0.0-alpha.1",
|
|
99
99
|
"prop-types": "~15.7.2",
|
|
100
100
|
"react-desc": "~4.1.3",
|
|
101
101
|
"uid": "2.0.0"
|
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
121
121
|
"test": "node ../../scripts/testing/test.mjs",
|
|
122
122
|
"lint": "node ../../scripts/lint.mjs",
|
|
123
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
123
124
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
124
125
|
}
|
|
125
126
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ToolbarProps {
|
|
3
|
-
alignment?: 'left' | 'right';
|
|
4
|
-
withDepth?: boolean;
|
|
5
|
-
compact?: boolean;
|
|
6
|
-
innerRef?: React.MutableRefObject<HTMLDivElement>;
|
|
7
|
-
}
|
|
8
|
-
declare const DSToolbarV2: React.ComponentType<ToolbarProps>;
|
|
9
|
-
declare const DSToolbarV2WithSchema: any;
|
|
10
|
-
export { DSToolbarV2, DSToolbarV2WithSchema };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
interface IDSToolbarV2Context {
|
|
3
|
-
registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;
|
|
4
|
-
itemReferences: Record<string, MutableRefObject<HTMLElement>>;
|
|
5
|
-
toolbarUid: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const DSToolbarV2Context: import("react").Context<IDSToolbarV2Context>;
|
|
8
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
import Item from './ToolbarItem';
|
|
4
|
-
import ToolbarGroup from './ToolbarGroup';
|
|
5
|
-
import Divider from './ToolbarDivider';
|
|
6
|
-
declare const DSToolbar: {
|
|
7
|
-
({ containerProps, innerRef, withDepth, alignment, autoFocusOnMount, children, size, ...otherProps }: {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
containerProps?: {} | undefined;
|
|
10
|
-
innerRef: any;
|
|
11
|
-
withDepth?: boolean | undefined;
|
|
12
|
-
alignment?: string | undefined;
|
|
13
|
-
autoFocusOnMount?: boolean | undefined;
|
|
14
|
-
children?: never[] | undefined;
|
|
15
|
-
size?: string | undefined;
|
|
16
|
-
}): JSX.Element;
|
|
17
|
-
propTypes: {
|
|
18
|
-
containerProps: {
|
|
19
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
20
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
21
|
-
};
|
|
22
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
23
|
-
};
|
|
24
|
-
withDepth: {
|
|
25
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
-
};
|
|
27
|
-
alignment: {
|
|
28
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
-
};
|
|
30
|
-
size: {
|
|
31
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
-
};
|
|
33
|
-
autoFocusOnMount: {
|
|
34
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
-
};
|
|
36
|
-
children: import("react-desc").PropTypesDescValue;
|
|
37
|
-
innerRef: {
|
|
38
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
39
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
-
};
|
|
41
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
declare const ToolbarWithSchema: {
|
|
46
|
-
(props?: unknown): JSX.Element;
|
|
47
|
-
propTypes: unknown;
|
|
48
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
49
|
-
};
|
|
50
|
-
export { DSToolbar, Item as ToolbarItem, ToolbarGroup, Divider as ToolbarDivider, ToolbarWithSchema, };
|
|
51
|
-
export default DSToolbar;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const ToolbarGroup: {
|
|
4
|
-
({ children, size, space }: {
|
|
5
|
-
children: any;
|
|
6
|
-
size: any;
|
|
7
|
-
space?: number | undefined;
|
|
8
|
-
}): JSX.Element;
|
|
9
|
-
propTypes: {
|
|
10
|
-
children: PropTypes.Requireable<any>;
|
|
11
|
-
size: PropTypes.Requireable<number>;
|
|
12
|
-
space: PropTypes.Requireable<number>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default ToolbarGroup;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const ToolbarItem: {
|
|
4
|
-
({ icon, labelText, menu, ...otherProps }: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
icon: any;
|
|
7
|
-
labelText: any;
|
|
8
|
-
menu?: undefined;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
propTypes: {
|
|
12
|
-
icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
13
|
-
labelText: PropTypes.Requireable<string>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export default ToolbarItem;
|
package/dist/types/index.d.ts
DELETED
package/dist/types/props.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
export declare const DSToolbarV2Schema: {
|
|
3
|
-
alignment: {
|
|
4
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
5
|
-
};
|
|
6
|
-
withDepth: {
|
|
7
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
8
|
-
};
|
|
9
|
-
compact: {
|
|
10
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
-
};
|
|
12
|
-
innerRef: {
|
|
13
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
14
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
15
|
-
};
|
|
16
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
17
|
-
};
|
|
18
|
-
};
|
package/dist/types/styled.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const StyledToolbarWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const StyledToolbarItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const StyledSeparator: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|