@activecollab/components 2.0.582 → 2.0.583
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/DrilldownMenu/DrilldownMenu.js +3 -1
- package/dist/cjs/components/DrilldownMenu/DrilldownMenu.js.map +1 -1
- package/dist/esm/components/DrilldownMenu/DrilldownMenu.d.ts +3 -1
- package/dist/esm/components/DrilldownMenu/DrilldownMenu.d.ts.map +1 -1
- package/dist/esm/components/DrilldownMenu/DrilldownMenu.js +3 -1
- package/dist/esm/components/DrilldownMenu/DrilldownMenu.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ var DrilldownMenu = exports.DrilldownMenu = function DrilldownMenu(_ref) {
|
|
|
21
21
|
onOpen = _ref.onOpen,
|
|
22
22
|
onClose = _ref.onClose,
|
|
23
23
|
position = _ref.position,
|
|
24
|
+
anchorPoint = _ref.anchorPoint,
|
|
24
25
|
width = _ref.width,
|
|
25
26
|
header = _ref.header,
|
|
26
27
|
listClassName = _ref.listClassName,
|
|
@@ -47,7 +48,8 @@ var DrilldownMenu = exports.DrilldownMenu = function DrilldownMenu(_ref) {
|
|
|
47
48
|
open: open,
|
|
48
49
|
onOpen: onOpen,
|
|
49
50
|
onClose: onClose,
|
|
50
|
-
position: position
|
|
51
|
+
position: position,
|
|
52
|
+
anchorPoint: anchorPoint
|
|
51
53
|
}, /*#__PURE__*/_react.default.createElement(_DrilldownMenuContent.DrilldownMenuContent, {
|
|
52
54
|
key: contentKey,
|
|
53
55
|
width: width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrilldownMenu.js","names":["_react","_interopRequireWildcard","require","_DrilldownMenuContent","_Styles","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","NO_SUBMENUS","DrilldownMenu","exports","_ref","target","open","onOpen","onClose","position","width","header","listClassName","backLabel","_ref$submenus","submenus","children","_useState","useState","_useState2","contentKey","setContentKey","showPanes","paneWidth","DEFAULT_PANE_WIDTH","useEffect","key","createElement","StyledMenu","$paned","DrilldownMenuContent","paneProps","Fragment","StyledIndexList","className","style","displayName"],"sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useState } from \"react\";\n\nimport {\n DEFAULT_PANE_WIDTH,\n DrilldownMenuContent,\n DrilldownMenuContentProps,\n DrilldownSubmenu,\n IndexRenderProps,\n} from \"./DrilldownMenuContent\";\nimport { StyledIndexList, StyledMenu } from \"./Styles\";\nimport { IMenu } from \"../Menu\";\n\nconst NO_SUBMENUS: DrilldownSubmenu[] = [];\n\nexport interface DrilldownMenuProps\n extends Pick<DrilldownMenuContentProps, \"width\" | \"submenus\" | \"backLabel\"> {\n /** Element the menu hangs off */\n target: IMenu[\"target\"];\n /** Whether the menu is open. The caller owns this */\n open: boolean;\n onOpen: () => void;\n onClose: () => void;\n /** Where the menu sits against its target */\n position?: IMenu[\"position\"];\n /** Sits above the index list, inside the same pane */\n header?: ReactNode;\n /** Applied to the index list, next to its own vertical padding */\n listClassName?: string;\n /** Index items, or a function that receives `openSubmenu` */\n children?: ReactNode | ((props: IndexRenderProps) => ReactNode);\n}\n\nexport const DrilldownMenu = ({\n target,\n open,\n onOpen,\n onClose,\n position,\n width,\n header,\n listClassName,\n backLabel,\n submenus = NO_SUBMENUS,\n children,\n}: DrilldownMenuProps): JSX.Element => {\n const [contentKey, setContentKey] = useState(0);\n\n const showPanes = submenus.length > 0;\n const paneWidth = width || DEFAULT_PANE_WIDTH;\n\n useEffect(() => {\n if (!open) {\n setContentKey((key) => key + 1);\n }\n }, [open]);\n\n return (\n <StyledMenu\n $paned={showPanes}\n target={target}\n open={open}\n onOpen={onOpen}\n onClose={onClose}\n position={position}\n >\n <DrilldownMenuContent\n key={contentKey}\n width={width}\n submenus={submenus}\n backLabel={backLabel}\n >\n {(paneProps: IndexRenderProps) => (\n <>\n {header}\n <StyledIndexList\n className={listClassName}\n style={{ width: showPanes ? paneWidth : \"100%\" }}\n >\n {typeof children === \"function\" ? children(paneProps) : children}\n </StyledIndexList>\n </>\n )}\n </DrilldownMenuContent>\n </StyledMenu>\n );\n};\n\nDrilldownMenu.displayName = \"DrilldownMenu\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAD,OAAA;AAOA,IAAAE,OAAA,GAAAF,OAAA;AAAuD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,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AA,SAAAkB,sBAAAnB,CAAA,EAAAiC,CAAA,QAAAnC,CAAA,WAAAE,CAAA,gCAAAkC,MAAA,IAAAlC,CAAA,CAAAkC,MAAA,CAAAC,QAAA,KAAAnC,CAAA,4BAAAF,CAAA,QAAAD,CAAA,EAAAI,CAAA,EAAAG,CAAA,EAAAgC,CAAA,EAAAb,CAAA,OAAAlB,CAAA,OAAAF,CAAA,iBAAAC,CAAA,IAAAN,CAAA,GAAAA,CAAA,CAAAe,IAAA,CAAAb,CAAA,GAAAqC,IAAA,QAAAJ,CAAA,QAAAnB,MAAA,CAAAhB,CAAA,MAAAA,CAAA,UAAAO,CAAA,uBAAAA,CAAA,IAAAR,CAAA,GAAAO,CAAA,CAAAS,IAAA,CAAAf,CAAA,GAAAwC,IAAA,MAAAf,CAAA,CAAAgB,IAAA,CAAA1C,CAAA,CAAA2C,KAAA,GAAAjB,CAAA,CAAAS,MAAA,KAAAC,CAAA,GAAA5B,CAAA,iBAAAL,CAAA,IAAAG,CAAA,OAAAF,CAAA,GAAAD,CAAA,yBAAAK,CAAA,YAAAP,CAAA,CAAA2C,MAAA,KAAAL,CAAA,GAAAtC,CAAA,CAAA2C,MAAA,IAAA3B,MAAA,CAAAsB,CAAA,MAAAA,CAAA,2BAAAjC,CAAA,QAAAF,CAAA,aAAAsB,CAAA;AAAA,SAAAL,gBAAAlB,CAAA,QAAA6B,KAAA,CAAAa,OAAA,CAAA1C,CAAA,UAAAA,CAAA;AAGvD,IAAM2C,WAA+B,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"DrilldownMenu.js","names":["_react","_interopRequireWildcard","require","_DrilldownMenuContent","_Styles","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","NO_SUBMENUS","DrilldownMenu","exports","_ref","target","open","onOpen","onClose","position","anchorPoint","width","header","listClassName","backLabel","_ref$submenus","submenus","children","_useState","useState","_useState2","contentKey","setContentKey","showPanes","paneWidth","DEFAULT_PANE_WIDTH","useEffect","key","createElement","StyledMenu","$paned","DrilldownMenuContent","paneProps","Fragment","StyledIndexList","className","style","displayName"],"sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useState } from \"react\";\n\nimport {\n DEFAULT_PANE_WIDTH,\n DrilldownMenuContent,\n DrilldownMenuContentProps,\n DrilldownSubmenu,\n IndexRenderProps,\n} from \"./DrilldownMenuContent\";\nimport { StyledIndexList, StyledMenu } from \"./Styles\";\nimport { IMenu } from \"../Menu\";\n\nconst NO_SUBMENUS: DrilldownSubmenu[] = [];\n\nexport interface DrilldownMenuProps\n extends Pick<DrilldownMenuContentProps, \"width\" | \"submenus\" | \"backLabel\"> {\n /** Element the menu hangs off */\n target: IMenu[\"target\"];\n /** Whether the menu is open. The caller owns this */\n open: boolean;\n onOpen: () => void;\n onClose: () => void;\n /** Where the menu sits against its target */\n position?: IMenu[\"position\"];\n /** A point in client coordinates, such as a right-click, that the menu opens at instead of at its target */\n anchorPoint?: IMenu[\"anchorPoint\"];\n /** Sits above the index list, inside the same pane */\n header?: ReactNode;\n /** Applied to the index list, next to its own vertical padding */\n listClassName?: string;\n /** Index items, or a function that receives `openSubmenu` */\n children?: ReactNode | ((props: IndexRenderProps) => ReactNode);\n}\n\nexport const DrilldownMenu = ({\n target,\n open,\n onOpen,\n onClose,\n position,\n anchorPoint,\n width,\n header,\n listClassName,\n backLabel,\n submenus = NO_SUBMENUS,\n children,\n}: DrilldownMenuProps): JSX.Element => {\n const [contentKey, setContentKey] = useState(0);\n\n const showPanes = submenus.length > 0;\n const paneWidth = width || DEFAULT_PANE_WIDTH;\n\n useEffect(() => {\n if (!open) {\n setContentKey((key) => key + 1);\n }\n }, [open]);\n\n return (\n <StyledMenu\n $paned={showPanes}\n target={target}\n open={open}\n onOpen={onOpen}\n onClose={onClose}\n position={position}\n anchorPoint={anchorPoint}\n >\n <DrilldownMenuContent\n key={contentKey}\n width={width}\n submenus={submenus}\n backLabel={backLabel}\n >\n {(paneProps: IndexRenderProps) => (\n <>\n {header}\n <StyledIndexList\n className={listClassName}\n style={{ width: showPanes ? paneWidth : \"100%\" }}\n >\n {typeof children === \"function\" ? children(paneProps) : children}\n </StyledIndexList>\n </>\n )}\n </DrilldownMenuContent>\n </StyledMenu>\n );\n};\n\nDrilldownMenu.displayName = \"DrilldownMenu\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAD,OAAA;AAOA,IAAAE,OAAA,GAAAF,OAAA;AAAuD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAA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MAAA,CAAAe,OAAA,CAAA+D,aAAA,CAAA9E,MAAA,CAAAe,OAAA,CAAAoE,QAAA,QACGrB,MAAM,eACP9D,MAAA,CAAAe,OAAA,CAAA+D,aAAA,CAAC1E,OAAA,CAAAgF,eAAe;MACdC,SAAS,EAAEtB,aAAc;MACzBuB,KAAK,EAAE;QAAEzB,KAAK,EAAEY,SAAS,GAAGC,SAAS,GAAG;MAAO;IAAE,GAEhD,OAAOP,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACe,SAAS,CAAC,GAAGf,QACzC,CACjB,CAAC;EAAA,CAEe,CACZ,CAAC;AAEjB,CAAC;AAEDf,aAAa,CAACmC,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -10,6 +10,8 @@ export interface DrilldownMenuProps extends Pick<DrilldownMenuContentProps, "wid
|
|
|
10
10
|
onClose: () => void;
|
|
11
11
|
/** Where the menu sits against its target */
|
|
12
12
|
position?: IMenu["position"];
|
|
13
|
+
/** A point in client coordinates, such as a right-click, that the menu opens at instead of at its target */
|
|
14
|
+
anchorPoint?: IMenu["anchorPoint"];
|
|
13
15
|
/** Sits above the index list, inside the same pane */
|
|
14
16
|
header?: ReactNode;
|
|
15
17
|
/** Applied to the index list, next to its own vertical padding */
|
|
@@ -18,7 +20,7 @@ export interface DrilldownMenuProps extends Pick<DrilldownMenuContentProps, "wid
|
|
|
18
20
|
children?: ReactNode | ((props: IndexRenderProps) => ReactNode);
|
|
19
21
|
}
|
|
20
22
|
export declare const DrilldownMenu: {
|
|
21
|
-
({ target, open, onOpen, onClose, position, width, header, listClassName, backLabel, submenus, children, }: DrilldownMenuProps): JSX.Element;
|
|
23
|
+
({ target, open, onOpen, onClose, position, anchorPoint, width, header, listClassName, backLabel, submenus, children, }: DrilldownMenuProps): JSX.Element;
|
|
22
24
|
displayName: string;
|
|
23
25
|
};
|
|
24
26
|
//# sourceMappingURL=DrilldownMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrilldownMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAGL,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IAC3E,iCAAiC;IACjC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,qDAAqD;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,SAAS,CAAC,CAAC;CACjE;AAED,eAAO,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"DrilldownMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAGL,yBAAyB,EAEzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IAC3E,iCAAiC;IACjC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,qDAAqD;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B,4GAA4G;IAC5G,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACnC,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,SAAS,CAAC,CAAC;CACjE;AAED,eAAO,MAAM,aAAa;6HAavB,kBAAkB,GAAG,GAAG,CAAC,OAAO;;CA0ClC,CAAC"}
|
|
@@ -8,6 +8,7 @@ export const DrilldownMenu = _ref => {
|
|
|
8
8
|
onOpen = _ref.onOpen,
|
|
9
9
|
onClose = _ref.onClose,
|
|
10
10
|
position = _ref.position,
|
|
11
|
+
anchorPoint = _ref.anchorPoint,
|
|
11
12
|
width = _ref.width,
|
|
12
13
|
header = _ref.header,
|
|
13
14
|
listClassName = _ref.listClassName,
|
|
@@ -31,7 +32,8 @@ export const DrilldownMenu = _ref => {
|
|
|
31
32
|
open: open,
|
|
32
33
|
onOpen: onOpen,
|
|
33
34
|
onClose: onClose,
|
|
34
|
-
position: position
|
|
35
|
+
position: position,
|
|
36
|
+
anchorPoint: anchorPoint
|
|
35
37
|
}, /*#__PURE__*/React.createElement(DrilldownMenuContent, {
|
|
36
38
|
key: contentKey,
|
|
37
39
|
width: width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrilldownMenu.js","names":["React","useEffect","useState","DEFAULT_PANE_WIDTH","DrilldownMenuContent","StyledIndexList","StyledMenu","NO_SUBMENUS","DrilldownMenu","_ref","target","open","onOpen","onClose","position","width","header","listClassName","backLabel","_ref$submenus","submenus","children","_useState","contentKey","setContentKey","showPanes","length","paneWidth","key","createElement","$paned","paneProps","Fragment","className","style","displayName"],"sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useState } from \"react\";\n\nimport {\n DEFAULT_PANE_WIDTH,\n DrilldownMenuContent,\n DrilldownMenuContentProps,\n DrilldownSubmenu,\n IndexRenderProps,\n} from \"./DrilldownMenuContent\";\nimport { StyledIndexList, StyledMenu } from \"./Styles\";\nimport { IMenu } from \"../Menu\";\n\nconst NO_SUBMENUS: DrilldownSubmenu[] = [];\n\nexport interface DrilldownMenuProps\n extends Pick<DrilldownMenuContentProps, \"width\" | \"submenus\" | \"backLabel\"> {\n /** Element the menu hangs off */\n target: IMenu[\"target\"];\n /** Whether the menu is open. The caller owns this */\n open: boolean;\n onOpen: () => void;\n onClose: () => void;\n /** Where the menu sits against its target */\n position?: IMenu[\"position\"];\n /** Sits above the index list, inside the same pane */\n header?: ReactNode;\n /** Applied to the index list, next to its own vertical padding */\n listClassName?: string;\n /** Index items, or a function that receives `openSubmenu` */\n children?: ReactNode | ((props: IndexRenderProps) => ReactNode);\n}\n\nexport const DrilldownMenu = ({\n target,\n open,\n onOpen,\n onClose,\n position,\n width,\n header,\n listClassName,\n backLabel,\n submenus = NO_SUBMENUS,\n children,\n}: DrilldownMenuProps): JSX.Element => {\n const [contentKey, setContentKey] = useState(0);\n\n const showPanes = submenus.length > 0;\n const paneWidth = width || DEFAULT_PANE_WIDTH;\n\n useEffect(() => {\n if (!open) {\n setContentKey((key) => key + 1);\n }\n }, [open]);\n\n return (\n <StyledMenu\n $paned={showPanes}\n target={target}\n open={open}\n onOpen={onOpen}\n onClose={onClose}\n position={position}\n >\n <DrilldownMenuContent\n key={contentKey}\n width={width}\n submenus={submenus}\n backLabel={backLabel}\n >\n {(paneProps: IndexRenderProps) => (\n <>\n {header}\n <StyledIndexList\n className={listClassName}\n style={{ width: showPanes ? paneWidth : \"100%\" }}\n >\n {typeof children === \"function\" ? children(paneProps) : children}\n </StyledIndexList>\n </>\n )}\n </DrilldownMenuContent>\n </StyledMenu>\n );\n};\n\nDrilldownMenu.displayName = \"DrilldownMenu\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAeC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE7D,SACEC,kBAAkB,EAClBC,oBAAoB,QAIf,wBAAwB;AAC/B,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AAGtD,MAAMC,WAA+B,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"DrilldownMenu.js","names":["React","useEffect","useState","DEFAULT_PANE_WIDTH","DrilldownMenuContent","StyledIndexList","StyledMenu","NO_SUBMENUS","DrilldownMenu","_ref","target","open","onOpen","onClose","position","anchorPoint","width","header","listClassName","backLabel","_ref$submenus","submenus","children","_useState","contentKey","setContentKey","showPanes","length","paneWidth","key","createElement","$paned","paneProps","Fragment","className","style","displayName"],"sources":["../../../../src/components/DrilldownMenu/DrilldownMenu.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useState } from \"react\";\n\nimport {\n DEFAULT_PANE_WIDTH,\n DrilldownMenuContent,\n DrilldownMenuContentProps,\n DrilldownSubmenu,\n IndexRenderProps,\n} from \"./DrilldownMenuContent\";\nimport { StyledIndexList, StyledMenu } from \"./Styles\";\nimport { IMenu } from \"../Menu\";\n\nconst NO_SUBMENUS: DrilldownSubmenu[] = [];\n\nexport interface DrilldownMenuProps\n extends Pick<DrilldownMenuContentProps, \"width\" | \"submenus\" | \"backLabel\"> {\n /** Element the menu hangs off */\n target: IMenu[\"target\"];\n /** Whether the menu is open. The caller owns this */\n open: boolean;\n onOpen: () => void;\n onClose: () => void;\n /** Where the menu sits against its target */\n position?: IMenu[\"position\"];\n /** A point in client coordinates, such as a right-click, that the menu opens at instead of at its target */\n anchorPoint?: IMenu[\"anchorPoint\"];\n /** Sits above the index list, inside the same pane */\n header?: ReactNode;\n /** Applied to the index list, next to its own vertical padding */\n listClassName?: string;\n /** Index items, or a function that receives `openSubmenu` */\n children?: ReactNode | ((props: IndexRenderProps) => ReactNode);\n}\n\nexport const DrilldownMenu = ({\n target,\n open,\n onOpen,\n onClose,\n position,\n anchorPoint,\n width,\n header,\n listClassName,\n backLabel,\n submenus = NO_SUBMENUS,\n children,\n}: DrilldownMenuProps): JSX.Element => {\n const [contentKey, setContentKey] = useState(0);\n\n const showPanes = submenus.length > 0;\n const paneWidth = width || DEFAULT_PANE_WIDTH;\n\n useEffect(() => {\n if (!open) {\n setContentKey((key) => key + 1);\n }\n }, [open]);\n\n return (\n <StyledMenu\n $paned={showPanes}\n target={target}\n open={open}\n onOpen={onOpen}\n onClose={onClose}\n position={position}\n anchorPoint={anchorPoint}\n >\n <DrilldownMenuContent\n key={contentKey}\n width={width}\n submenus={submenus}\n backLabel={backLabel}\n >\n {(paneProps: IndexRenderProps) => (\n <>\n {header}\n <StyledIndexList\n className={listClassName}\n style={{ width: showPanes ? paneWidth : \"100%\" }}\n >\n {typeof children === \"function\" ? children(paneProps) : children}\n </StyledIndexList>\n </>\n )}\n </DrilldownMenuContent>\n </StyledMenu>\n );\n};\n\nDrilldownMenu.displayName = \"DrilldownMenu\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAeC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE7D,SACEC,kBAAkB,EAClBC,oBAAoB,QAIf,wBAAwB;AAC/B,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AAGtD,MAAMC,WAA+B,GAAG,EAAE;AAsB1C,OAAO,MAAMC,aAAa,GAAGC,IAAA,IAaU;EAAA,IAZrCC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IAC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,aAAA,CAACzB,eAAe;IACd6B,SAAS,EAAEhB,aAAc;IACzBiB,KAAK,EAAE;MAAEnB,KAAK,EAAEU,SAAS,GAAGE,SAAS,GAAG;IAAO;EAAE,GAEhD,OAAON,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACU,SAAS,CAAC,GAAGV,QACzC,CACjB,CAEgB,CACZ,CAAC;AAEjB,CAAC;AAEDd,aAAa,CAAC4B,WAAW,GAAG,eAAe","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -31266,6 +31266,7 @@
|
|
|
31266
31266
|
onOpen = _ref.onOpen,
|
|
31267
31267
|
onClose = _ref.onClose,
|
|
31268
31268
|
position = _ref.position,
|
|
31269
|
+
anchorPoint = _ref.anchorPoint,
|
|
31269
31270
|
width = _ref.width,
|
|
31270
31271
|
header = _ref.header,
|
|
31271
31272
|
listClassName = _ref.listClassName,
|
|
@@ -31292,7 +31293,8 @@
|
|
|
31292
31293
|
open: open,
|
|
31293
31294
|
onOpen: onOpen,
|
|
31294
31295
|
onClose: onClose,
|
|
31295
|
-
position: position
|
|
31296
|
+
position: position,
|
|
31297
|
+
anchorPoint: anchorPoint
|
|
31296
31298
|
}, /*#__PURE__*/React__default["default"].createElement(DrilldownMenuContent, {
|
|
31297
31299
|
key: contentKey,
|
|
31298
31300
|
width: width,
|