@mongodb-js/compass-components 1.43.0 → 1.44.0
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/lib/components/document-list/document-edit-actions-footer.d.ts.map +1 -1
- package/lib/components/document-list/document-edit-actions-footer.js +31 -26
- package/lib/components/document-list/document-edit-actions-footer.js.map +1 -1
- package/lib/components/drawer/constants.d.ts +9 -0
- package/lib/components/drawer/constants.d.ts.map +1 -0
- package/lib/components/drawer/constants.js +13 -0
- package/lib/components/drawer/constants.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.constants.d.ts +3 -0
- package/lib/components/drawer/drawer/drawer.constants.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.constants.js +6 -0
- package/lib/components/drawer/drawer/drawer.constants.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.d.ts +4 -0
- package/lib/components/drawer/drawer/drawer.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.js +137 -0
- package/lib/components/drawer/drawer/drawer.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.styles.d.ts +29 -0
- package/lib/components/drawer/drawer/drawer.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.styles.js +174 -0
- package/lib/components/drawer/drawer/drawer.styles.js.map +1 -0
- package/lib/components/drawer/drawer/drawer.types.d.ts +35 -0
- package/lib/components/drawer/drawer/drawer.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer/drawer.types.js +13 -0
- package/lib/components/drawer/drawer/drawer.types.js.map +1 -0
- package/lib/components/drawer/drawer/index.d.ts +5 -0
- package/lib/components/drawer/drawer/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer/index.js +12 -0
- package/lib/components/drawer/drawer/index.js.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.d.ts +17 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.js +57 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.js.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.d.ts +34 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.js +3 -0
- package/lib/components/drawer/drawer-layout/drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-layout/index.js +6 -0
- package/lib/components/drawer/drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.d.ts +8 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.js +71 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.d.ts +21 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.js +3 -0
- package/lib/components/drawer/drawer-stack-context/drawer-stack-context.types.js.map +1 -0
- package/lib/components/drawer/drawer-stack-context/index.d.ts +3 -0
- package/lib/components/drawer/drawer-stack-context/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-stack-context/index.js +8 -0
- package/lib/components/drawer/drawer-stack-context/index.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.d.ts +6 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.js +85 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.d.ts +37 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.js +3 -0
- package/lib/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/index.d.ts +2 -0
- package/lib/components/drawer/drawer-toolbar-context/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-context/index.js +7 -0
- package/lib/components/drawer/drawer-toolbar-context/index.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.d.ts +18 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.js +82 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.d.ts +15 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.js +50 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.d.ts +2 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.js +11 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.styles.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.d.ts +44 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.js +3 -0
- package/lib/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout.types.js.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.d.ts +3 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.js +6 -0
- package/lib/components/drawer/drawer-toolbar-layout/index.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.d.ts +11 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.js +63 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.d.ts +10 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.js +137 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.styles.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.d.ts +11 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.js +3 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/drawer-with-toolbar-wrapper.types.js.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.d.ts +2 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.d.ts.map +1 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.js +6 -0
- package/lib/components/drawer/drawer-with-toolbar-wrapper/index.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.d.ts +12 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.js +55 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.d.ts +6 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.js +54 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.styles.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.d.ts +8 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.js +3 -0
- package/lib/components/drawer/embedded-drawer-layout/embedded-drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/embedded-drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/embedded-drawer-layout/index.js +6 -0
- package/lib/components/drawer/embedded-drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/index.d.ts +6 -0
- package/lib/components/drawer/index.d.ts.map +1 -0
- package/lib/components/drawer/index.js +17 -0
- package/lib/components/drawer/index.js.map +1 -0
- package/lib/components/drawer/layout-component/index.d.ts +3 -0
- package/lib/components/drawer/layout-component/index.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/index.js +6 -0
- package/lib/components/drawer/layout-component/index.js.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.d.ts +18 -0
- package/lib/components/drawer/layout-component/layout-component.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.js +53 -0
- package/lib/components/drawer/layout-component/layout-component.js.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.styles.d.ts +20 -0
- package/lib/components/drawer/layout-component/layout-component.styles.d.ts.map +1 -0
- package/lib/components/drawer/layout-component/layout-component.styles.js +3 -0
- package/lib/components/drawer/layout-component/layout-component.styles.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/index.d.ts +3 -0
- package/lib/components/drawer/overlay-drawer-layout/index.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/index.js +6 -0
- package/lib/components/drawer/overlay-drawer-layout/index.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.d.ts +11 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.js +54 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.d.ts +5 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.js +27 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.styles.js.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.d.ts +3 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.d.ts.map +1 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.js +3 -0
- package/lib/components/drawer/overlay-drawer-layout/overlay-drawer-layout.types.js.map +1 -0
- package/lib/components/drawer/utils/get-lg-ids.d.ts +8 -0
- package/lib/components/drawer/utils/get-lg-ids.d.ts.map +1 -0
- package/lib/components/drawer/utils/get-lg-ids.js +11 -0
- package/lib/components/drawer/utils/get-lg-ids.js.map +1 -0
- package/lib/components/drawer/utils/index.d.ts +2 -0
- package/lib/components/drawer/utils/index.d.ts.map +1 -0
- package/lib/components/drawer/utils/index.js +7 -0
- package/lib/components/drawer/utils/index.js.map +1 -0
- package/lib/components/leafygreen.d.ts +1 -0
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +9 -2
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/toolbar/constants.d.ts +3 -0
- package/lib/components/toolbar/constants.d.ts.map +1 -0
- package/lib/components/toolbar/constants.js +6 -0
- package/lib/components/toolbar/constants.js.map +1 -0
- package/lib/components/toolbar/context/index.d.ts +3 -0
- package/lib/components/toolbar/context/index.d.ts.map +1 -0
- package/lib/components/toolbar/context/index.js +10 -0
- package/lib/components/toolbar/context/index.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.d.ts +6 -0
- package/lib/components/toolbar/context/toolbar-context.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.js +65 -0
- package/lib/components/toolbar/context/toolbar-context.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.types.d.ts +21 -0
- package/lib/components/toolbar/context/toolbar-context.types.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-context.types.js +3 -0
- package/lib/components/toolbar/context/toolbar-context.types.js.map +1 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.d.ts +5 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.d.ts.map +1 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.js +10 -0
- package/lib/components/toolbar/context/toolbar-descendants-context.js.map +1 -0
- package/lib/components/toolbar/index.d.ts +5 -0
- package/lib/components/toolbar/index.d.ts.map +1 -0
- package/lib/components/toolbar/index.js +27 -0
- package/lib/components/toolbar/index.js.map +1 -0
- package/lib/components/toolbar/toolbar/index.d.ts +4 -0
- package/lib/components/toolbar/toolbar/index.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/index.js +8 -0
- package/lib/components/toolbar/toolbar/index.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.d.ts +4 -0
- package/lib/components/toolbar/toolbar/toolbar.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.js +93 -0
- package/lib/components/toolbar/toolbar/toolbar.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.d.ts +7 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.js +26 -0
- package/lib/components/toolbar/toolbar/toolbar.styles.js.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.types.d.ts +6 -0
- package/lib/components/toolbar/toolbar/toolbar.types.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar/toolbar.types.js +3 -0
- package/lib/components/toolbar/toolbar/toolbar.types.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/index.d.ts +3 -0
- package/lib/components/toolbar/toolbar-icon-button/index.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/index.js +6 -0
- package/lib/components/toolbar/toolbar-icon-button/index.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.d.ts +4 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.js +77 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.d.ts +13 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.js +38 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.styles.js.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.d.ts +19 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.d.ts.map +1 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.js +3 -0
- package/lib/components/toolbar/toolbar-icon-button/toolbar-icon-button.types.js.map +1 -0
- package/lib/components/toolbar/utils/get-lg-ids.d.ts +8 -0
- package/lib/components/toolbar/utils/get-lg-ids.d.ts.map +1 -0
- package/lib/components/toolbar/utils/get-lg-ids.js +14 -0
- package/lib/components/toolbar/utils/get-lg-ids.js.map +1 -0
- package/lib/components/toolbar/utils/index.d.ts +2 -0
- package/lib/components/toolbar/utils/index.d.ts.map +1 -0
- package/lib/components/toolbar/utils/index.js +7 -0
- package/lib/components/toolbar/utils/index.js.map +1 -0
- package/package.json +11 -9
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisplayMode = exports.drawerClassName = exports.MOBILE_BREAKPOINT = exports.Drawer = void 0;
|
|
4
|
+
var drawer_1 = require("./drawer");
|
|
5
|
+
Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return drawer_1.Drawer; } });
|
|
6
|
+
var drawer_constants_1 = require("./drawer.constants");
|
|
7
|
+
Object.defineProperty(exports, "MOBILE_BREAKPOINT", { enumerable: true, get: function () { return drawer_constants_1.MOBILE_BREAKPOINT; } });
|
|
8
|
+
var drawer_styles_1 = require("./drawer.styles");
|
|
9
|
+
Object.defineProperty(exports, "drawerClassName", { enumerable: true, get: function () { return drawer_styles_1.drawerClassName; } });
|
|
10
|
+
var drawer_types_1 = require("./drawer.types");
|
|
11
|
+
Object.defineProperty(exports, "DisplayMode", { enumerable: true, get: function () { return drawer_types_1.DisplayMode; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uDAAuD;AAA9C,qHAAA,iBAAiB,OAAA;AAC1B,iDAAkD;AAAzC,gHAAA,eAAe,OAAA;AACxB,+CAA+D;AAAtD,2GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `DrawerLayout` is a component that provides a flexible layout for displaying content in a drawer.
|
|
4
|
+
* It can be used in both `overlay` and `embedded` modes, with or without a `Toolbar`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DrawerLayout: React.ForwardRefExoticComponent<(Omit<{
|
|
7
|
+
toolbarData: import("./drawer-layout.types").DrawerLayoutPropsWithToolbar["toolbarData"];
|
|
8
|
+
} & Omit<import("../drawer-toolbar-layout").DrawerToolbarLayoutProps, "displayMode"> & {
|
|
9
|
+
isDrawerOpen?: never;
|
|
10
|
+
} & import("./drawer-layout.types").BaseDrawerLayoutProps, "ref"> | Omit<{
|
|
11
|
+
toolbarData?: never;
|
|
12
|
+
} & Omit<import("../layout-component").LayoutComponentProps, "displayMode" | "isDrawerOpen"> & {
|
|
13
|
+
toolbarData?: never;
|
|
14
|
+
onClose?: never;
|
|
15
|
+
isDrawerOpen?: boolean;
|
|
16
|
+
} & import("./drawer-layout.types").BaseDrawerLayoutProps, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//# sourceMappingURL=drawer-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-layout.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/drawer-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;yGA0CxB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DrawerLayout = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const lib_1 = require("@leafygreen-ui/lib");
|
|
39
|
+
const drawer_types_1 = require("../drawer/drawer.types");
|
|
40
|
+
const drawer_toolbar_layout_1 = require("../drawer-toolbar-layout");
|
|
41
|
+
const layout_component_1 = require("../layout-component");
|
|
42
|
+
/**
|
|
43
|
+
* `DrawerLayout` is a component that provides a flexible layout for displaying content in a drawer.
|
|
44
|
+
* It can be used in both `overlay` and `embedded` modes, with or without a `Toolbar`.
|
|
45
|
+
*/
|
|
46
|
+
exports.DrawerLayout = (0, react_1.forwardRef)(({ toolbarData, children, displayMode = drawer_types_1.DisplayMode.Overlay, isDrawerOpen = false, ...rest }, forwardedRef) => {
|
|
47
|
+
// If there is data, we render the DrawerToolbarLayout.
|
|
48
|
+
if (toolbarData) {
|
|
49
|
+
return (react_1.default.createElement(drawer_toolbar_layout_1.DrawerToolbarLayout, { ref: forwardedRef, toolbarData: toolbarData, displayMode: displayMode, ...rest }, children));
|
|
50
|
+
}
|
|
51
|
+
lib_1.consoleOnce.warn('Using a Drawer without a toolbar is not recommended. To include a toolbar, pass a toolbarData prop containing the desired toolbar items.');
|
|
52
|
+
// If there is no data, we render the LayoutComponent.
|
|
53
|
+
// The LayoutComponent will read the displayMode and render the appropriate layout.
|
|
54
|
+
return (react_1.default.createElement(layout_component_1.LayoutComponent, { ref: forwardedRef, displayMode: displayMode, isDrawerOpen: isDrawerOpen, ...rest }, children));
|
|
55
|
+
});
|
|
56
|
+
exports.DrawerLayout.displayName = 'DrawerLayout';
|
|
57
|
+
//# sourceMappingURL=drawer-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-layout.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/drawer-layout.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,4CAAiD;AAEjD,yDAAqD;AACrD,oEAA+D;AAC/D,0DAAsD;AAItD;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,kBAAU,EACpC,CACE,EACE,WAAW,EACX,QAAQ,EACR,WAAW,GAAG,0BAAW,CAAC,OAAO,EACjC,YAAY,GAAG,KAAK,EACpB,GAAG,IAAI,EACW,EACpB,YAAY,EACZ,EAAE;IACF,uDAAuD;IACvD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CACL,8BAAC,2CAAmB,IAClB,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,KACpB,IAAI,IAEP,QAAQ,CACW,CACvB,CAAC;IACJ,CAAC;IAED,iBAAW,CAAC,IAAI,CACd,0IAA0I,CAC3I,CAAC;IAEF,sDAAsD;IACtD,mFAAmF;IACnF,OAAO,CACL,8BAAC,kCAAe,IACd,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,KACtB,IAAI,IAEP,QAAQ,CACO,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DarkModeProps, HTMLElementProps } from '@leafygreen-ui/lib';
|
|
2
|
+
import type { DrawerProps } from '../drawer/drawer.types';
|
|
3
|
+
import type { DrawerToolbarLayoutProps } from '../drawer-toolbar-layout';
|
|
4
|
+
import type { LayoutComponentProps } from '../layout-component';
|
|
5
|
+
export type PickedDrawerProps = Pick<DrawerProps, 'displayMode'>;
|
|
6
|
+
export interface BaseDrawerLayoutProps extends PickedDrawerProps, HTMLElementProps<'div'>, DarkModeProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export type DrawerLayoutPropsWithoutToolbar = Omit<LayoutComponentProps, 'displayMode' | 'isDrawerOpen'> & {
|
|
10
|
+
/**
|
|
11
|
+
* An array of data that will be used to render the toolbar items and the drawer content.
|
|
12
|
+
*/
|
|
13
|
+
toolbarData?: never;
|
|
14
|
+
/**
|
|
15
|
+
* Event handler called on close button click. If provided, a close button will be rendered in the Drawer header.
|
|
16
|
+
*/
|
|
17
|
+
onClose?: never;
|
|
18
|
+
/**
|
|
19
|
+
* Determines if the Drawer is open. This is only needed if using the Drawer without a toolbar. This will shift the layout to the right by the width of the drawer if `displayMode` is set to 'embedded'.
|
|
20
|
+
*/
|
|
21
|
+
isDrawerOpen?: boolean;
|
|
22
|
+
} & BaseDrawerLayoutProps;
|
|
23
|
+
export type DrawerLayoutPropsWithToolbar = Omit<DrawerToolbarLayoutProps, 'displayMode'> & {
|
|
24
|
+
/**
|
|
25
|
+
* Determines if the Drawer is open. This is only needed if using the Drawer without a toolbar. This will shift the layout to the right by the width of the drawer if `displayMode` is set to 'embedded'.
|
|
26
|
+
*/
|
|
27
|
+
isDrawerOpen?: never;
|
|
28
|
+
} & BaseDrawerLayoutProps;
|
|
29
|
+
export type DrawerLayoutProps = ({
|
|
30
|
+
toolbarData: DrawerLayoutPropsWithToolbar['toolbarData'];
|
|
31
|
+
} & DrawerLayoutPropsWithToolbar) | ({
|
|
32
|
+
toolbarData?: never;
|
|
33
|
+
} & DrawerLayoutPropsWithoutToolbar);
|
|
34
|
+
//# sourceMappingURL=drawer-layout.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-layout.types.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/drawer-layout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAEjE,MAAM,WAAW,qBACf,SAAQ,iBAAiB,EACvB,gBAAgB,CAAC,KAAK,CAAC,EACvB,aAAa;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,oBAAoB,EACpB,aAAa,GAAG,cAAc,CAC/B,GAAG;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,qBAAqB,CAAC;AAE1B,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,wBAAwB,EACxB,aAAa,CACd,GAAG;IACF;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,GAAG,qBAAqB,CAAC;AAE1B,MAAM,MAAM,iBAAiB,GACzB,CAAC;IACC,WAAW,EAAE,4BAA4B,CAAC,aAAa,CAAC,CAAC;CAC1D,GAAG,4BAA4B,CAAC,GACjC,CAAC;IAAE,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG,+BAA+B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-layout.types.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/drawer-layout.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DrawerLayout = void 0;
|
|
4
|
+
var drawer_layout_1 = require("./drawer-layout");
|
|
5
|
+
Object.defineProperty(exports, "DrawerLayout", { enumerable: true, get: function () { return drawer_layout_1.DrawerLayout; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-layout/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DrawerStackContextType } from './drawer-stack-context.types';
|
|
3
|
+
export declare const DrawerStackContext: React.Context<DrawerStackContextType>;
|
|
4
|
+
export declare const DrawerStackProvider: ({ children, }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export declare const useDrawerStackContext: () => DrawerStackContextType;
|
|
8
|
+
//# sourceMappingURL=drawer-stack-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-stack-context.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/drawer-stack-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,eAAO,MAAM,kBAAkB,uCAI7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,eAEjC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAwCA,CAAC;AAEF,eAAO,MAAM,qBAAqB,8BAIjC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useDrawerStackContext = exports.DrawerStackProvider = exports.DrawerStackContext = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
exports.DrawerStackContext = (0, react_1.createContext)({
|
|
39
|
+
getDrawerIndex: () => 0,
|
|
40
|
+
registerDrawer: () => { },
|
|
41
|
+
unregisterDrawer: () => { },
|
|
42
|
+
});
|
|
43
|
+
const DrawerStackProvider = ({ children, }) => {
|
|
44
|
+
const [stack, setStack] = (0, react_1.useState)([]);
|
|
45
|
+
const getDrawerIndex = (0, react_1.useCallback)((id) => {
|
|
46
|
+
return stack.indexOf(id);
|
|
47
|
+
}, [stack]);
|
|
48
|
+
const registerDrawer = (0, react_1.useCallback)((id) => {
|
|
49
|
+
setStack((prev) => {
|
|
50
|
+
if (prev.includes(id))
|
|
51
|
+
return prev;
|
|
52
|
+
return [...prev, id];
|
|
53
|
+
});
|
|
54
|
+
}, [setStack]);
|
|
55
|
+
const unregisterDrawer = (0, react_1.useCallback)((id) => {
|
|
56
|
+
setStack((prev) => {
|
|
57
|
+
if (!prev.includes(id))
|
|
58
|
+
return prev;
|
|
59
|
+
return prev.filter((item) => item !== id);
|
|
60
|
+
});
|
|
61
|
+
}, [setStack]);
|
|
62
|
+
const value = (0, react_1.useMemo)(() => ({ getDrawerIndex, registerDrawer, unregisterDrawer }), [getDrawerIndex, registerDrawer, unregisterDrawer]);
|
|
63
|
+
return (react_1.default.createElement(exports.DrawerStackContext.Provider, { value: value }, children));
|
|
64
|
+
};
|
|
65
|
+
exports.DrawerStackProvider = DrawerStackProvider;
|
|
66
|
+
const useDrawerStackContext = () => {
|
|
67
|
+
const context = (0, react_1.useContext)(exports.DrawerStackContext);
|
|
68
|
+
return context;
|
|
69
|
+
};
|
|
70
|
+
exports.useDrawerStackContext = useDrawerStackContext;
|
|
71
|
+
//# sourceMappingURL=drawer-stack-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-stack-context.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/drawer-stack-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AAIF,QAAA,kBAAkB,GAAG,IAAA,qBAAa,EAAyB;IACtE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;IACvB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC3B,CAAC,CAAC;AAEI,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,GAGT,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAgB,EAAE,CAAC,CAAC;IAEtD,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,EAAU,EAAE,EAAE;QACb,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,EAAU,EAAE,EAAE;QACb,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAAE,OAAO,IAAI,CAAC;YACnC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,EAAU,EAAE,EAAE;QACb,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAAE,OAAO,IAAI,CAAC;YACpC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC,EAC5D,CAAC,cAAc,EAAE,cAAc,EAAE,gBAAgB,CAAC,CACnD,CAAC;IAEF,OAAO,CACL,8BAAC,0BAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACtC,QAAQ,CACmB,CAC/B,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,mBAAmB,uBA4C9B;AAEK,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,0BAAkB,CAAC,CAAC;IAE/C,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DrawerStackContextType {
|
|
2
|
+
/**
|
|
3
|
+
* Returns the index of a drawer instance in the drawer stack
|
|
4
|
+
* @param id - The id of the drawer instance to get the index of
|
|
5
|
+
* @returns The index of the drawer instance in the stack
|
|
6
|
+
*/
|
|
7
|
+
getDrawerIndex: (id: string) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Registers a drawer instance in the drawer stack
|
|
10
|
+
* @param id - The id of the drawer instance to register
|
|
11
|
+
* @returns void
|
|
12
|
+
*/
|
|
13
|
+
registerDrawer: (id: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Unregisters a drawer instance from the drawer stack
|
|
16
|
+
* @param id - The id of the drawer instance to unregister
|
|
17
|
+
* @returns void
|
|
18
|
+
*/
|
|
19
|
+
unregisterDrawer: (id: string) => void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=drawer-stack-context.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-stack-context.types.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/drawer-stack-context.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAEvC;;;;OAIG;IACH,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-stack-context.types.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/drawer-stack-context.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDrawerStackContext = exports.DrawerStackProvider = exports.DrawerStackContext = void 0;
|
|
4
|
+
var drawer_stack_context_1 = require("./drawer-stack-context");
|
|
5
|
+
Object.defineProperty(exports, "DrawerStackContext", { enumerable: true, get: function () { return drawer_stack_context_1.DrawerStackContext; } });
|
|
6
|
+
Object.defineProperty(exports, "DrawerStackProvider", { enumerable: true, get: function () { return drawer_stack_context_1.DrawerStackProvider; } });
|
|
7
|
+
Object.defineProperty(exports, "useDrawerStackContext", { enumerable: true, get: function () { return drawer_stack_context_1.useDrawerStackContext; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-stack-context/index.ts"],"names":[],"mappings":";;;AAAA,+DAIgC;AAH9B,0HAAA,kBAAkB,OAAA;AAClB,2HAAA,mBAAmB,OAAA;AACnB,6HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DrawerToolbarContextType, DrawerToolbarProviderProps } from './drawer-toolbar-context.types';
|
|
3
|
+
export declare const DrawerToolbarContext: React.Context<DrawerToolbarContextType | null>;
|
|
4
|
+
export declare const DrawerToolbarProvider: ({ children, data, }: DrawerToolbarProviderProps) => React.JSX.Element;
|
|
5
|
+
export declare const useDrawerToolbarContext: () => DrawerToolbarContextType;
|
|
6
|
+
//# sourceMappingURL=drawer-toolbar-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-context.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/drawer-toolbar-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAGV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,oBAAoB,gDACqB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,GAAI,qBAGnC,0BAA0B,sBAqD5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,gCAUnC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.useDrawerToolbarContext = exports.DrawerToolbarProvider = exports.DrawerToolbarContext = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const drawer_styles_1 = require("../drawer/drawer.styles");
|
|
39
|
+
exports.DrawerToolbarContext = (0, react_1.createContext)(null);
|
|
40
|
+
const DrawerToolbarProvider = ({ children, data, }) => {
|
|
41
|
+
const [content, setContent] = (0, react_1.useState)(undefined);
|
|
42
|
+
const [isDrawerOpen, setIsDrawerOpen] = (0, react_1.useState)(false);
|
|
43
|
+
const openDrawer = (0, react_1.useCallback)((id) => {
|
|
44
|
+
const activeDrawerContent = data.find((item) => item?.id === id && item?.content);
|
|
45
|
+
if (activeDrawerContent) {
|
|
46
|
+
setIsDrawerOpen(true);
|
|
47
|
+
setContent((prev) => {
|
|
48
|
+
if (prev?.id === id)
|
|
49
|
+
return prev;
|
|
50
|
+
return activeDrawerContent;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.error(`No matching item found in the toolbar for the provided id: ${id}. Please verify that the id is correct.`);
|
|
56
|
+
}
|
|
57
|
+
}, [setContent, data, setIsDrawerOpen]);
|
|
58
|
+
const closeDrawer = (0, react_1.useCallback)(() => {
|
|
59
|
+
// Delay the removal of the content to allow the drawer to close before removing the content
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
setContent(undefined);
|
|
62
|
+
}, drawer_styles_1.drawerTransitionDuration);
|
|
63
|
+
setIsDrawerOpen(false);
|
|
64
|
+
}, [setContent]);
|
|
65
|
+
const getActiveDrawerContent = (0, react_1.useCallback)(() => {
|
|
66
|
+
return content;
|
|
67
|
+
}, [content]);
|
|
68
|
+
const value = (0, react_1.useMemo)(() => ({
|
|
69
|
+
openDrawer,
|
|
70
|
+
closeDrawer,
|
|
71
|
+
getActiveDrawerContent,
|
|
72
|
+
isDrawerOpen,
|
|
73
|
+
}), [openDrawer, closeDrawer, getActiveDrawerContent, isDrawerOpen]);
|
|
74
|
+
return (react_1.default.createElement(exports.DrawerToolbarContext.Provider, { value: value }, children));
|
|
75
|
+
};
|
|
76
|
+
exports.DrawerToolbarProvider = DrawerToolbarProvider;
|
|
77
|
+
const useDrawerToolbarContext = () => {
|
|
78
|
+
const context = (0, react_1.useContext)(exports.DrawerToolbarContext);
|
|
79
|
+
if (!context) {
|
|
80
|
+
throw new Error('useDrawerToolbarContext must be used within a DrawerToolbarProvider');
|
|
81
|
+
}
|
|
82
|
+
return context;
|
|
83
|
+
};
|
|
84
|
+
exports.useDrawerToolbarContext = useDrawerToolbarContext;
|
|
85
|
+
//# sourceMappingURL=drawer-toolbar-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-context.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/drawer-toolbar-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AAEf,2DAAmE;AAStD,QAAA,oBAAoB,GAC/B,IAAA,qBAAa,EAAkC,IAAI,CAAC,CAAC;AAEhD,MAAM,qBAAqB,GAAG,CAAC,EACpC,QAAQ,EACR,IAAI,GACuB,EAAE,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAc,SAAS,CAAC,CAAC;IAC/D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,CAAC,EAAU,EAAE,EAAE;QACb,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CACnC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,OAAO,CAC3C,CAAC;QAEF,IAAI,mBAAmB,EAAE,CAAC;YACxB,eAAe,CAAC,IAAI,CAAC,CAAC;YACtB,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClB,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE;oBAAE,OAAO,IAAI,CAAC;gBACjC,OAAO,mBAAmB,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,sCAAsC;YACtC,OAAO,CAAC,KAAK,CACX,8DAA8D,EAAE,yCAAyC,CAC1G,CAAC;QACJ,CAAC;IACH,CAAC,EACD,CAAC,UAAU,EAAE,IAAI,EAAE,eAAe,CAAC,CACpC,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,4FAA4F;QAC5F,UAAU,CAAC,GAAG,EAAE;YACd,UAAU,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC,EAAE,wCAAwB,CAAC,CAAC;QAC7B,eAAe,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC9C,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE,CAAC,CAAC;QACL,UAAU;QACV,WAAW;QACX,sBAAsB;QACtB,YAAY;KACb,CAAC,EACF,CAAC,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,YAAY,CAAC,CAChE,CAAC;IAEF,OAAO,CACL,8BAAC,4BAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACxC,QAAQ,CACqB,CACjC,CAAC;AACJ,CAAC,CAAC;AAxDW,QAAA,qBAAqB,yBAwDhC;AAEK,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,4BAAoB,CAAC,CAAC;IAEjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LayoutData } from '../drawer-toolbar-layout';
|
|
2
|
+
export type ContextData = LayoutData | undefined;
|
|
3
|
+
export type DataId = LayoutData['id'];
|
|
4
|
+
export interface DrawerToolbarContextType {
|
|
5
|
+
/**
|
|
6
|
+
* This function is used to open the drawer with the given data.
|
|
7
|
+
* @param id - The id of the drawer to open
|
|
8
|
+
* @returns void
|
|
9
|
+
*/
|
|
10
|
+
openDrawer: (id: DataId) => void;
|
|
11
|
+
/**
|
|
12
|
+
* This function is used to clear the active drawer data and indicates that the drawer should close.
|
|
13
|
+
* @returns void
|
|
14
|
+
*/
|
|
15
|
+
closeDrawer: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates whether the drawer should be closed. Used to manage transition states.
|
|
18
|
+
* For example, during close animations, content should remain until the transition completes.
|
|
19
|
+
*/
|
|
20
|
+
isDrawerOpen: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This function is used to get the active drawer content.
|
|
23
|
+
* @returns The active drawer data
|
|
24
|
+
*/
|
|
25
|
+
getActiveDrawerContent: () => ContextData;
|
|
26
|
+
}
|
|
27
|
+
export interface DrawerToolbarProviderProps {
|
|
28
|
+
/**
|
|
29
|
+
* The children of the provider
|
|
30
|
+
*/
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* The data to be used in the drawer
|
|
34
|
+
*/
|
|
35
|
+
data: Array<ContextData>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=drawer-toolbar-context.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-context.types.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjD,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AAEtC,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,WAAW,CAAC;CAC3C;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-context.types.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/drawer-toolbar-context.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDrawerToolbarContext = exports.DrawerToolbarProvider = void 0;
|
|
4
|
+
var drawer_toolbar_context_1 = require("./drawer-toolbar-context");
|
|
5
|
+
Object.defineProperty(exports, "DrawerToolbarProvider", { enumerable: true, get: function () { return drawer_toolbar_context_1.DrawerToolbarProvider; } });
|
|
6
|
+
Object.defineProperty(exports, "useDrawerToolbarContext", { enumerable: true, get: function () { return drawer_toolbar_context_1.useDrawerToolbarContext; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-context/index.ts"],"names":[],"mappings":";;;AAAA,mEAGkC;AAFhC,+HAAA,qBAAqB,OAAA;AACrB,iIAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DisplayMode } from '../drawer/drawer.types';
|
|
3
|
+
import type { LayoutData } from './drawer-toolbar-layout.types';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*
|
|
7
|
+
* DrawerToolbarLayoutContainer is a component that provides a layout for displaying content in a drawer with a toolbar.
|
|
8
|
+
* It manages the state of the drawer and toolbar, and renders the appropriate components based on the display mode.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DrawerToolbarLayoutContainer: React.ForwardRefExoticComponent<{
|
|
11
|
+
onClose?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
12
|
+
displayMode?: DisplayMode | undefined;
|
|
13
|
+
} & import("@leafygreen-ui/lib").DarkModeProps & import("@leafygreen-ui/lib").LgIdProps & {
|
|
14
|
+
toolbarData: Array<LayoutData>;
|
|
15
|
+
className?: string;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//# sourceMappingURL=drawer-toolbar-layout-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-layout-container.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOrD,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,+BAA+B,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;wCA0FxC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DrawerToolbarLayoutContainer = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const toolbar_1 = require("../../toolbar");
|
|
39
|
+
const drawer_1 = require("../drawer/drawer");
|
|
40
|
+
const drawer_types_1 = require("../drawer/drawer.types");
|
|
41
|
+
const drawer_toolbar_context_1 = require("../drawer-toolbar-context");
|
|
42
|
+
const drawer_with_toolbar_wrapper_1 = require("../drawer-with-toolbar-wrapper");
|
|
43
|
+
const layout_component_1 = require("../layout-component");
|
|
44
|
+
const utils_1 = require("../utils");
|
|
45
|
+
const drawer_toolbar_layout_styles_1 = require("./drawer-toolbar-layout.styles");
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*
|
|
49
|
+
* DrawerToolbarLayoutContainer is a component that provides a layout for displaying content in a drawer with a toolbar.
|
|
50
|
+
* It manages the state of the drawer and toolbar, and renders the appropriate components based on the display mode.
|
|
51
|
+
*/
|
|
52
|
+
exports.DrawerToolbarLayoutContainer = (0, react_1.forwardRef)(({ children, displayMode = drawer_types_1.DisplayMode.Overlay, toolbarData, onClose,
|
|
53
|
+
// darkMode: darkModeProp,
|
|
54
|
+
'data-lgid': dataLgId = utils_1.DEFAULT_LGID_ROOT, ...rest }, forwardRef) => {
|
|
55
|
+
const { openDrawer, closeDrawer, getActiveDrawerContent, isDrawerOpen } = (0, drawer_toolbar_context_1.useDrawerToolbarContext)();
|
|
56
|
+
const { id, title, content } = getActiveDrawerContent() || {};
|
|
57
|
+
const lgIds = (0, utils_1.getLgIds)(dataLgId);
|
|
58
|
+
const hasData = toolbarData && toolbarData.length > 0;
|
|
59
|
+
const handleOnClose = (event) => {
|
|
60
|
+
onClose?.(event);
|
|
61
|
+
closeDrawer();
|
|
62
|
+
};
|
|
63
|
+
const handleIconClick = (event, id, onClick) => {
|
|
64
|
+
onClick?.(event);
|
|
65
|
+
openDrawer(id);
|
|
66
|
+
};
|
|
67
|
+
return (react_1.default.createElement(layout_component_1.LayoutComponent, { ...rest, ref: forwardRef, displayMode: displayMode, hasToolbar: hasData, isDrawerOpen: isDrawerOpen },
|
|
68
|
+
react_1.default.createElement("div", { className: drawer_toolbar_layout_styles_1.contentStyles }, children),
|
|
69
|
+
react_1.default.createElement(drawer_with_toolbar_wrapper_1.DrawerWithToolbarWrapper, { displayMode: displayMode, isDrawerOpen: isDrawerOpen },
|
|
70
|
+
react_1.default.createElement(toolbar_1.Toolbar, { "data-lgid": lgIds.toolbar, "data-testid": lgIds.toolbar }, toolbarData?.map((toolbarItem) => (react_1.default.createElement(toolbar_1.ToolbarIconButton, { key: toolbarItem.glyph, glyph: toolbarItem.glyph, label: toolbarItem.label, onClick: (event) => {
|
|
71
|
+
if (!toolbarItem.content) {
|
|
72
|
+
// If the toolbar item does not have content, we don't want to open/update/close the drawer
|
|
73
|
+
// but we still want to call the onClick function if it exists. E.g. open a modal or perform an action
|
|
74
|
+
toolbarItem.onClick?.(event);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
return handleIconClick(event, toolbarItem.id, toolbarItem.onClick);
|
|
78
|
+
}, active: toolbarItem.id === id, disabled: toolbarItem.disabled })))),
|
|
79
|
+
react_1.default.createElement(drawer_1.Drawer, { displayMode: displayMode, open: isDrawerOpen, onClose: handleOnClose, title: title, "data-lgid": `${dataLgId}`, "data-testid": `${dataLgId}`, "aria-live": "polite", "aria-atomic": "true" }, content))));
|
|
80
|
+
});
|
|
81
|
+
exports.DrawerToolbarLayoutContainer.displayName = 'DrawerToolbarLayoutContainer';
|
|
82
|
+
//# sourceMappingURL=drawer-toolbar-layout-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-toolbar-layout-container.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer-toolbar-layout/drawer-toolbar-layout-container.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,2CAA2D;AAE3D,6CAA0C;AAC1C,yDAAqD;AACrD,sEAAoE;AACpE,gFAA0E;AAC1E,0DAAsD;AACtD,oCAAuD;AAEvD,iFAA+D;AAM/D;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG,IAAA,kBAAU,EAIpD,CACE,EACE,QAAQ,EACR,WAAW,GAAG,0BAAW,CAAC,OAAO,EACjC,WAAW,EACX,OAAO;AACP,0BAA0B;AAC1B,WAAW,EAAE,QAAQ,GAAG,yBAAiB,EACzC,GAAG,IAAI,EAC2B,EACpC,UAAU,EACV,EAAE;IACF,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,YAAY,EAAE,GACrE,IAAA,gDAAuB,GAAE,CAAC;IAC5B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,sBAAsB,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;IAEtD,MAAM,aAAa,GAAG,CAAC,KAA0C,EAAE,EAAE;QACnE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACjB,WAAW,EAAE,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,CACtB,KAA0C,EAC1C,EAAoB,EACpB,OAA8D,EAC9D,EAAE;QACF,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACjB,UAAU,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,kCAAe,OACV,IAAI,EACR,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,OAAO,EACnB,YAAY,EAAE,YAAY;QAE1B,uCAAK,SAAS,EAAE,4CAAa,IAAG,QAAQ,CAAO;QAC/C,8BAAC,sDAAwB,IACvB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY;YAE1B,8BAAC,iBAAO,iBAAY,KAAK,CAAC,OAAO,iBAAe,KAAK,CAAC,OAAO,IAC1D,WAAW,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACjC,8BAAC,2BAAiB,IAChB,GAAG,EAAE,WAAW,CAAC,KAAK,EACtB,KAAK,EAAE,WAAW,CAAC,KAAK,EACxB,KAAK,EAAE,WAAW,CAAC,KAAK,EACxB,OAAO,EAAE,CAAC,KAA0C,EAAE,EAAE;oBACtD,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;wBACzB,2FAA2F;wBAC3F,sGAAsG;wBACtG,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;wBAC7B,OAAO;oBACT,CAAC;oBAED,OAAO,eAAe,CACpB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,WAAW,CAAC,OAAO,CACpB,CAAC;gBACJ,CAAC,EACD,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,EAAE,EAC7B,QAAQ,EAAE,WAAW,CAAC,QAAQ,GAC9B,CACH,CAAC,CACM;YACV,8BAAC,eAAM,IACL,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,eACD,GAAG,QAAQ,EAAE,iBACX,GAAG,QAAQ,EAAE,eAChB,QAAQ,iBACN,MAAM,IAEjB,OAAO,CACD,CACgB,CACX,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oCAA4B,CAAC,WAAW,GAAG,8BAA8B,CAAC"}
|