@elliemae/ds-left-navigation 3.22.0-next.3 → 3.22.0-next.31
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/LeftNavigation.js +3 -3
- package/dist/cjs/LeftNavigation.js.map +3 -3
- package/dist/cjs/LeftNavigationContext.js +2 -1
- package/dist/cjs/LeftNavigationContext.js.map +3 -3
- package/dist/cjs/common/getItemBackgroundStyle.js.map +3 -3
- package/dist/cjs/common/getLeftBorderStyle.js.map +3 -3
- package/dist/cjs/common/getScrollbarStyle.js.map +1 -1
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/configs/index.js.map +1 -1
- package/dist/cjs/configs/useLeftNavConfig.js +31 -26
- package/dist/cjs/configs/useLeftNavConfig.js.map +3 -3
- package/dist/cjs/configs/useLeftNavItems.js +4 -2
- package/dist/cjs/configs/useLeftNavItems.js.map +3 -3
- package/dist/cjs/configs/useLeftNavSmoothExpand.js.map +3 -3
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/exported-related/ChevronItem/index.js.map +3 -3
- package/dist/cjs/exported-related/Icon/index.js.map +3 -3
- package/dist/cjs/exported-related/ItemRenderer/index.js +8 -5
- package/dist/cjs/exported-related/ItemRenderer/index.js.map +3 -3
- package/dist/cjs/exported-related/ItemRenderer/styled.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +3 -3
- package/dist/cjs/exported-related/Notifications/index.js.map +1 -1
- package/dist/cjs/exported-related/OpenWindowItem/index.js.map +3 -3
- package/dist/cjs/exported-related/constants.js +13 -1
- package/dist/cjs/exported-related/constants.js.map +3 -3
- package/dist/cjs/exported-related/index.js.map +1 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useExpandableOnClickHandler.js.map +3 -3
- package/dist/cjs/hooks/useKeyboardNavigation.js +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +3 -3
- package/dist/cjs/hooks/useOpenableOnClickHandler.js.map +3 -3
- package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +3 -3
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemHeader/index.js +2 -1
- package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemLink/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSection/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js +7 -5
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +2 -1
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js +1 -1
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/index.js.map +3 -3
- package/dist/cjs/outOfTheBox/styled.js.map +2 -2
- package/dist/cjs/parts/LeftNavContent/index.js +30 -4
- package/dist/cjs/parts/LeftNavContent/index.js.map +3 -3
- package/dist/cjs/parts/LeftNavContent/styled.js +2 -2
- package/dist/cjs/parts/LeftNavContent/styled.js.map +3 -3
- package/dist/cjs/parts/LeftNavFooterItem/index.js +14 -5
- package/dist/cjs/parts/LeftNavFooterItem/index.js.map +3 -3
- package/dist/cjs/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +3 -3
- package/dist/cjs/parts/LeftNavLoading/index.js.map +1 -1
- package/dist/cjs/parts/OutOfTheBoxMapItem.js +7 -1
- package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +3 -3
- package/dist/cjs/{prop-types.js → react-desc-prop-types.js} +9 -6
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js +186 -0
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
- package/dist/esm/LeftNavigation.js +1 -1
- package/dist/esm/LeftNavigation.js.map +3 -3
- package/dist/esm/LeftNavigationContext.js +2 -1
- package/dist/esm/LeftNavigationContext.js.map +3 -3
- package/dist/esm/common/getItemBackgroundStyle.js.map +3 -3
- package/dist/esm/common/getLeftBorderStyle.js.map +3 -3
- package/dist/esm/common/getScrollbarStyle.js.map +1 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/configs/index.js.map +1 -1
- package/dist/esm/configs/useLeftNavConfig.js +31 -26
- package/dist/esm/configs/useLeftNavConfig.js.map +3 -3
- package/dist/esm/configs/useLeftNavItems.js +4 -2
- package/dist/esm/configs/useLeftNavItems.js.map +3 -3
- package/dist/esm/configs/useLeftNavSmoothExpand.js.map +3 -3
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/constants/index.js.map +1 -1
- package/dist/esm/exported-related/ChevronItem/index.js.map +3 -3
- package/dist/esm/exported-related/Icon/index.js.map +3 -3
- package/dist/esm/exported-related/ItemRenderer/index.js +8 -5
- package/dist/esm/exported-related/ItemRenderer/index.js.map +3 -3
- package/dist/esm/exported-related/ItemRenderer/styled.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +3 -3
- package/dist/esm/exported-related/Notifications/index.js.map +1 -1
- package/dist/esm/exported-related/OpenWindowItem/index.js.map +3 -3
- package/dist/esm/exported-related/constants.js +13 -1
- package/dist/esm/exported-related/constants.js.map +3 -3
- package/dist/esm/exported-related/index.js.map +1 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useExpandableOnClickHandler.js.map +3 -3
- package/dist/esm/hooks/useKeyboardNavigation.js +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js.map +3 -3
- package/dist/esm/hooks/useOpenableOnClickHandler.js.map +3 -3
- package/dist/esm/hooks/useSelectFirstBodyItem.js.map +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemHeader/index.js +2 -1
- package/dist/esm/outOfTheBox/ItemHeader/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemLink/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSection/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js +7 -5
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js +2 -1
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +3 -3
- package/dist/esm/outOfTheBox/ItemWithDate/index.js +1 -1
- package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +3 -3
- package/dist/esm/outOfTheBox/index.js.map +3 -3
- package/dist/esm/outOfTheBox/styled.js.map +2 -2
- package/dist/esm/parts/LeftNavContent/index.js +30 -4
- package/dist/esm/parts/LeftNavContent/index.js.map +3 -3
- package/dist/esm/parts/LeftNavContent/styled.js +2 -2
- package/dist/esm/parts/LeftNavContent/styled.js.map +3 -3
- package/dist/esm/parts/LeftNavFooterItem/index.js +15 -6
- package/dist/esm/parts/LeftNavFooterItem/index.js.map +3 -3
- package/dist/esm/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/esm/parts/LeftNavFooterItem/styled.js.map +3 -3
- package/dist/esm/parts/LeftNavLoading/index.js.map +1 -1
- package/dist/esm/parts/OutOfTheBoxMapItem.js +7 -1
- package/dist/esm/parts/OutOfTheBoxMapItem.js.map +3 -3
- package/dist/esm/{prop-types.js → react-desc-prop-types.js} +6 -3
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js +163 -0
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
- package/dist/types/LeftNavigation.d.ts +6 -17
- package/dist/types/LeftNavigationContext.d.ts +4 -4
- package/dist/types/common/getItemBackgroundStyle.d.ts +2 -2
- package/dist/types/common/getLeftBorderStyle.d.ts +2 -2
- package/dist/types/configs/useLeftNavConfig.d.ts +16 -3
- package/dist/types/configs/useLeftNavItems.d.ts +5 -5
- package/dist/types/configs/useLeftNavSmoothExpand.d.ts +2 -2
- package/dist/types/exported-related/ChevronItem/index.d.ts +3 -1
- package/dist/types/exported-related/Icon/index.d.ts +2 -1
- package/dist/types/exported-related/ItemRenderer/index.d.ts +2 -2
- package/dist/types/exported-related/ItemRenderer/styled.d.ts +1 -0
- package/dist/types/exported-related/ItemRenderer/usePropsWithDefaults.d.ts +2 -2
- package/dist/types/exported-related/Notifications/index.d.ts +1 -0
- package/dist/types/exported-related/OpenWindowItem/index.d.ts +3 -1
- package/dist/types/exported-related/constants.d.ts +11 -0
- package/dist/types/hooks/useExpandableOnClickHandler.d.ts +2 -2
- package/dist/types/hooks/useKeyboardNavigation.d.ts +4 -4
- package/dist/types/hooks/useOpenableOnClickHandler.d.ts +3 -2
- package/dist/types/hooks/useSelectFirstBodyItem.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/outOfTheBox/ItemControlledDrilldown/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemHeader/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemLink/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSection/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSeparator/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSkeleton/index.d.ts +8 -2
- package/dist/types/outOfTheBox/ItemSubmenu/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemTextLabel/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemUncontrolledDrilldown/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemWithDate/index.d.ts +3 -2
- package/dist/types/outOfTheBox/index.d.ts +2 -2
- package/dist/types/outOfTheBox/styled.d.ts +2 -1
- package/dist/types/parts/LeftNavContent/styled.d.ts +2 -0
- package/dist/types/parts/LeftNavFooterItem/styled.d.ts +6 -4
- package/dist/types/parts/OutOfTheBoxMapItem.d.ts +2 -2
- package/dist/types/react-desc-prop-types.d.ts +100 -0
- package/dist/types/typescript-testing/typescript-left-navigation-valid.d.ts +1 -0
- package/package.json +17 -17
- package/dist/cjs/index.d.js +0 -28
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/prop-types.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/prop-types.js.map +0 -7
- package/dist/types/index.d.d.ts +0 -78
- package/dist/types/prop-types.d.ts +0 -22
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import__ = require("../index.js");
|
|
28
|
+
var import_constants = require("../exported-related/constants.js");
|
|
29
|
+
const ref = (0, import_react.createRef)();
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
selectedItem: "selected item",
|
|
32
|
+
selectedParent: "parent",
|
|
33
|
+
disableDefaultSelection: true,
|
|
34
|
+
withoutBodyShadow: true,
|
|
35
|
+
actionRef: ref,
|
|
36
|
+
HeaderComponent: {
|
|
37
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
38
|
+
dsId: "application-header-id",
|
|
39
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
40
|
+
itemOpts: {
|
|
41
|
+
label: "Notifications"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
BodyHeaderComponent: {
|
|
45
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,
|
|
46
|
+
dsId: "application-submenu-forms-id",
|
|
47
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
48
|
+
itemOpts: {
|
|
49
|
+
label: "Forms"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const testPartialDefaults = {};
|
|
54
|
+
const testProps = {
|
|
55
|
+
...testOptionalProps,
|
|
56
|
+
...testPartialDefaults
|
|
57
|
+
};
|
|
58
|
+
const testPropsAsSyntax = {
|
|
59
|
+
...testOptionalProps,
|
|
60
|
+
...testPartialDefaults
|
|
61
|
+
};
|
|
62
|
+
const testCompleteDefaults = {
|
|
63
|
+
expanded: true,
|
|
64
|
+
expandedWidth: "100px",
|
|
65
|
+
openedItem: "opened item",
|
|
66
|
+
items: [
|
|
67
|
+
{
|
|
68
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
69
|
+
dsId: "application-header-id",
|
|
70
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
71
|
+
itemOpts: {
|
|
72
|
+
label: "Notifications"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
footerLabel: "",
|
|
77
|
+
onSelectedChange: () => null,
|
|
78
|
+
onFocusChange: () => null,
|
|
79
|
+
onFooterExpand: () => null,
|
|
80
|
+
onFooterClose: () => null,
|
|
81
|
+
labelOverflow: "wrap",
|
|
82
|
+
onItemClick: () => null,
|
|
83
|
+
isSkeleton: false,
|
|
84
|
+
loading: false
|
|
85
|
+
};
|
|
86
|
+
const testInternalProps = {
|
|
87
|
+
...testOptionalProps,
|
|
88
|
+
...testCompleteDefaults
|
|
89
|
+
};
|
|
90
|
+
const testInternalPropsAsSyntax = {
|
|
91
|
+
...testOptionalProps,
|
|
92
|
+
...testCompleteDefaults
|
|
93
|
+
};
|
|
94
|
+
const testExplicitDefinition = {
|
|
95
|
+
expanded: true,
|
|
96
|
+
expandedWidth: "100px",
|
|
97
|
+
openedItem: "opened item",
|
|
98
|
+
items: [
|
|
99
|
+
{
|
|
100
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
101
|
+
dsId: "application-header-id",
|
|
102
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
103
|
+
itemOpts: {
|
|
104
|
+
label: "Notifications"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
footerLabel: "",
|
|
109
|
+
onSelectedChange: () => null,
|
|
110
|
+
onFocusChange: () => null,
|
|
111
|
+
onFooterExpand: () => null,
|
|
112
|
+
onFooterClose: () => null,
|
|
113
|
+
labelOverflow: "wrap",
|
|
114
|
+
onItemClick: () => null,
|
|
115
|
+
isSkeleton: false,
|
|
116
|
+
loading: false
|
|
117
|
+
};
|
|
118
|
+
const testInferedTypeCompatibility = {
|
|
119
|
+
expanded: true,
|
|
120
|
+
expandedWidth: "100px",
|
|
121
|
+
openedItem: "opened item",
|
|
122
|
+
items: [
|
|
123
|
+
{
|
|
124
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
125
|
+
dsId: "application-header-id",
|
|
126
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
127
|
+
itemOpts: {
|
|
128
|
+
label: "Notifications"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
footerLabel: "",
|
|
133
|
+
onSelectedChange: () => null,
|
|
134
|
+
onFocusChange: () => null,
|
|
135
|
+
onFooterExpand: () => null,
|
|
136
|
+
onFooterClose: () => null,
|
|
137
|
+
labelOverflow: "wrap",
|
|
138
|
+
onItemClick: () => null,
|
|
139
|
+
isSkeleton: false,
|
|
140
|
+
loading: false
|
|
141
|
+
};
|
|
142
|
+
const testDefinitionAsConst = {
|
|
143
|
+
expanded: true,
|
|
144
|
+
expandedWidth: "100px",
|
|
145
|
+
openedItem: "opened item",
|
|
146
|
+
footerLabel: "",
|
|
147
|
+
onSelectedChange: () => null,
|
|
148
|
+
onFocusChange: () => null,
|
|
149
|
+
onFooterExpand: () => null,
|
|
150
|
+
onFooterClose: () => null,
|
|
151
|
+
labelOverflow: "wrap",
|
|
152
|
+
onItemClick: () => null,
|
|
153
|
+
isSkeleton: false,
|
|
154
|
+
loading: false
|
|
155
|
+
};
|
|
156
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testExplicitDefinition }),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testInferedTypeCompatibility }),
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testDefinitionAsConst }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
import__.LeftNavigation,
|
|
162
|
+
{
|
|
163
|
+
expanded: true,
|
|
164
|
+
expandedWidth: "100px",
|
|
165
|
+
openedItem: "opened item",
|
|
166
|
+
items: [
|
|
167
|
+
{
|
|
168
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
169
|
+
dsId: "application-header-id",
|
|
170
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
171
|
+
itemOpts: {
|
|
172
|
+
label: "Notifications"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
footerLabel: "",
|
|
177
|
+
onSelectedChange: () => null,
|
|
178
|
+
onFocusChange: () => null,
|
|
179
|
+
onFooterExpand: () => null,
|
|
180
|
+
onFooterClose: () => null,
|
|
181
|
+
labelOverflow: "wrap",
|
|
182
|
+
onItemClick: () => null
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] });
|
|
186
|
+
//# sourceMappingURL=typescript-left-navigation-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-left-navigation-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { LeftNavigation } from '../index.js';\nimport type { DSLeftNavigationT } from '../index.js';\nimport { ITEM_TYPES } from '../exported-related/constants.js';\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSLeftNavigationT.Props;\ntype ComponentPropsInternals = DSLeftNavigationT.InternalProps;\ntype ComponentPropsDefaultProps = DSLeftNavigationT.DefaultProps;\ntype ComponentPropsOptionalProps = DSLeftNavigationT.OptionalProps;\n\nconst ref = createRef<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>();\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n selectedItem: 'selected item',\n selectedParent: 'parent',\n disableDefaultSelection: true,\n withoutBodyShadow: true,\n actionRef: ref,\n HeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n BodyHeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,\n dsId: 'application-submenu-forms-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Forms',\n },\n },\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <LeftNavigation {...testExplicitDefinition} />\n <LeftNavigation {...testInferedTypeCompatibility} />\n <LeftNavigation {...testDefinitionAsConst} />\n {/* works with inline values */}\n <LeftNavigation\n expanded\n expandedWidth=\"100px\"\n openedItem=\"opened item\"\n items={[\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ]}\n footerLabel=\"\"\n onSelectedChange={() => null}\n onFocusChange={() => null}\n onFooterExpand={() => null}\n onFooterClose={() => null}\n labelOverflow=\"wrap\"\n onItemClick={() => null}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACsBO;AArB9B,mBAA0B;AAC1B,eAA+B;AAE/B,uBAA2B;AAO3B,MAAM,UAAM,wBAAmF;AAE/F,MAAM,oBAAiD;AAAA,EACrD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,iBAAiB;AAAA,IACf,MAAM,4BAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,4CAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,IACnB,MAAM,4BAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,4CAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAIA,MAAM,sBAA2D,CAAC;AAClE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAo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react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import { leftNavigationProps } from "./prop-types.js";
|
|
4
|
+
import { leftNavigationProps } from "./react-desc-prop-types.js";
|
|
5
5
|
import LeftNavigationContext, { defaultProps } from "./LeftNavigationContext.js";
|
|
6
6
|
import { useLeftNavConfig } from "./configs/useLeftNavConfig.js";
|
|
7
7
|
import LeftNavContent from "./parts/LeftNavContent/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { leftNavigationProps } from './prop-types.js';\nimport LeftNavigationContext, { defaultProps } from './LeftNavigationContext.js';\nimport { useLeftNavConfig } from './configs/useLeftNavConfig.js';\nimport LeftNavContent from './parts/LeftNavContent/index.js';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,OAAO,yBAAyB,oBAAoB;AACpD,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;AAGpB,MAAM,iBAAiB,CAAC,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/LeftNavigation.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { leftNavigationProps } from './react-desc-prop-types.js';\nimport LeftNavigationContext, { defaultProps } from './LeftNavigationContext.js';\nimport { useLeftNavConfig } from './configs/useLeftNavConfig.js';\nimport LeftNavContent from './parts/LeftNavContent/index.js';\nimport type { DSLeftNavigationT } from './react-desc-prop-types.js';\n\nexport const LeftNavigation = (props: DSLeftNavigationT.Props): JSX.Element => {\n const leftNavConfig = useLeftNavConfig(props);\n\n return (\n <LeftNavigationContext.Provider value={leftNavConfig}>\n <LeftNavContent />\n </LeftNavigationContext.Provider>\n );\n};\n\nLeftNavigation.propTypes = leftNavigationProps;\nLeftNavigation.defaultProps = defaultProps;\nLeftNavigation.displayName = 'LeftNavigation';\nexport const LeftNavigationWithSchema = describe(LeftNavigation).description('Left Navigation');\nLeftNavigationWithSchema.propTypes = leftNavigationProps;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,OAAO,yBAAyB,oBAAoB;AACpD,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;AAGpB,MAAM,iBAAiB,CAAC,UAAgD;AAC7E,QAAM,gBAAgB,iBAAiB,KAAK;AAE5C,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,eACrC,8BAAC,kBAAe,GAClB;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,eAAe;AAC9B,eAAe,cAAc;AACtB,MAAM,2BAA2B,SAAS,cAAc,EAAE,YAAY,iBAAiB;AAC9F,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { MutableRefObject, RefObject } from 'react';\nimport type React from 'react';\nimport { createContext } from 'react';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,qBAAqB;AAkBvB,MAAM,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/LeftNavigationContext.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { MutableRefObject, RefObject } from 'react';\nimport type React from 'react';\nimport { createContext } from 'react';\nimport type { DSLeftNavigationT } from './react-desc-prop-types.js';\n\nexport type ContextProps = {\n selectedItem: string | null;\n setSelectedItem: React.Dispatch<React.SetStateAction<string | null>>;\n selectedParent: string | null;\n setSelectedParent: React.Dispatch<React.SetStateAction<string | null>>;\n focusedItem: string | null;\n setFocusedItem: React.Dispatch<React.SetStateAction<string | null>>;\n openedDrilldowns: string[];\n setOpenedDrilldowns: React.Dispatch<React.SetStateAction<string[]>>;\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;\n leftNavProps: DSLeftNavigationT.InternalProps;\n expandedForAnimation: boolean;\n};\n\nexport const defaultProps: DSLeftNavigationT.DefaultProps = {\n expandedWidth: '240px',\n loading: false,\n expanded: false,\n openedItem: null,\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n items: [],\n labelOverflow: 'wrap' as DSLeftNavigationT.LabelOveflowT,\n onItemClick: () => null,\n isSkeleton: false,\n};\n\nexport const defaultContext: ContextProps = {\n leftNavProps: defaultProps,\n selectedItem: null,\n setSelectedItem: () => null,\n selectedParent: null,\n setSelectedParent: () => null,\n focusedItem: null,\n setFocusedItem: () => null,\n expandedForAnimation: true,\n openedDrilldowns: [],\n setOpenedDrilldowns: () => null,\n visibleItems: [],\n visibleItemsRefs: { current: {} },\n};\n\nexport const LeftNavContext = createContext<ContextProps>(defaultContext);\n\nexport default LeftNavContext;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,qBAAqB;AAkBvB,MAAM,eAA+C;AAAA,EAC1D,eAAe;AAAA,EACf,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB,MAAM;AAAA,EACxB,eAAe,MAAM;AAAA,EACrB,gBAAgB,MAAM;AAAA,EACtB,eAAe,MAAM;AAAA,EACrB,OAAO,CAAC;AAAA,EACR,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,YAAY;AACd;AAEO,MAAM,iBAA+B;AAAA,EAC1C,cAAc;AAAA,EACd,cAAc;AAAA,EACd,iBAAiB,MAAM;AAAA,EACvB,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA,EACzB,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EACtB,sBAAsB;AAAA,EACtB,kBAAkB,CAAC;AAAA,EACnB,qBAAqB,MAAM;AAAA,EAC3B,cAAc,CAAC;AAAA,EACf,kBAAkB,EAAE,SAAS,CAAC,EAAE;AAClC;AAEO,MAAM,iBAAiB,cAA4B,cAAc;AAExE,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/ds-system';\n\nconst commonItemBackgroundStyle = (color: string, hoverColor: string, activeColor: string): string => `\n\n background: ${color};\n\n\n :active {\n background: ${activeColor};\n }\n`;\n\nexport const getItemBackgroundStyle = (props: { theme: Theme; selected
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,4BAA4B,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,gBAEtF;AAAA;AAAA;AAAA;AAAA,kBAIE;AAAA;AAAA;AAIX,MAAM,yBAAyB,CAAC,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/getItemBackgroundStyle.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/ds-system';\n\nconst commonItemBackgroundStyle = (color: string, hoverColor: string, activeColor: string): string => `\n\n background: ${color};\n\n\n :active {\n background: ${activeColor};\n }\n`;\n\nexport const getItemBackgroundStyle = (props: { theme: Theme; selected?: boolean; opened?: boolean }): string => {\n if (props.selected && !props.opened)\n return commonItemBackgroundStyle(\n props.theme.colors.brand[200],\n props.theme.colors.brand[200],\n props.theme.colors.brand[200],\n );\n\n return commonItemBackgroundStyle(\n props.theme.colors.neutral['000'],\n props.theme.colors.neutral['080'],\n props.theme.colors.brand[200],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,4BAA4B,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,gBAEtF;AAAA;AAAA;AAAA;AAAA,kBAIE;AAAA;AAAA;AAIX,MAAM,yBAAyB,CAAC,UAA0E;AAC/G,MAAI,MAAM,YAAY,CAAC,MAAM;AAC3B,WAAO;AAAA,MACL,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,IAC9B;AAEF,SAAO;AAAA,IACL,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,IAChC,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA,IAChC,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,EAC9B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/ds-system';\n\nconst commonLeftBorderStyle = (color: string, hoverColor: string, activeColor: string): string => `\n\n -webkit-box-shadow: inset 4px 0 0 0 ${color};\n box-shadow: inset 4px 0 0 0 ${color};\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};\n box-shadow: inset 4px 0 0 0 ${hoverColor};\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ${activeColor};\n box-shadow: inset 4px 0 0 0 ${activeColor};\n }\n`;\n\nexport const getLeftBorderStyle = (props: { theme: Theme; selected
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,wBAAwB,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,wCAE1D;AAAA,wCACA;AAAA;AAAA;AAAA,0CAGE;AAAA,0CACA;AAAA;AAAA;AAAA;AAAA,0CAIA;AAAA,0CACA;AAAA;AAAA;AAInC,MAAM,qBAAqB,CAAC,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/getLeftBorderStyle.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/ds-system';\n\nconst commonLeftBorderStyle = (color: string, hoverColor: string, activeColor: string): string => `\n\n -webkit-box-shadow: inset 4px 0 0 0 ${color};\n box-shadow: inset 4px 0 0 0 ${color};\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};\n box-shadow: inset 4px 0 0 0 ${hoverColor};\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ${activeColor};\n box-shadow: inset 4px 0 0 0 ${activeColor};\n }\n`;\n\nexport const getLeftBorderStyle = (props: { theme: Theme; selected?: boolean; selectedParent?: boolean }): string => {\n if (props.selected || props.selectedParent)\n return commonLeftBorderStyle(\n props.theme.colors.brand[400],\n props.theme.colors.brand[400],\n props.theme.colors.brand[400],\n );\n\n return commonLeftBorderStyle('transparent', props.theme.colors.brand[300], props.theme.colors.brand[400]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,wBAAwB,CAAC,OAAe,YAAoB,gBAAgC;AAAA;AAAA,wCAE1D;AAAA,wCACA;AAAA;AAAA;AAAA,0CAGE;AAAA,0CACA;AAAA;AAAA;AAAA;AAAA,0CAIA;AAAA,0CACA;AAAA;AAAA;AAInC,MAAM,qBAAqB,CAAC,UAAkF;AACnH,MAAI,MAAM,YAAY,MAAM;AAC1B,WAAO;AAAA,MACL,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,MAC5B,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,IAC9B;AAEF,SAAO,sBAAsB,eAAe,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAC1G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/getScrollbarStyle.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const getScrolbarStyle = (): string => `\n ::-webkit-scrollbar {\n width: 14px;\n }\n ::-webkit-scrollbar-thumb {\n height: 6px;\n border: 4px solid rgba(0, 0, 0, 0);\n\n background-clip: padding-box;\n\n background-color: rgba(105, 116, 137, 0.5);\n\n border-radius: 7px;\n -webkit-border-radius: 7px;\n }\n ::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n }\n ::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n`;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/common/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './getItemBackgroundStyle.js';\nexport * from './getLeftBorderStyle.js';\nexport * from './getScrollbarStyle.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useLeftNavConfig } from './useLeftNavConfig.js';\n\nexport { useLeftNavConfig } from './useLeftNavConfig.js';\nexport default useLeftNavConfig;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB;AAEjC,SAAS,oBAAAA,yBAAwB;AACjC,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["useLeftNavConfig"]
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2 from "react";
|
|
3
|
+
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { defaultProps } from "../LeftNavigationContext.js";
|
|
3
5
|
import useLeftNavItems from "./useLeftNavItems.js";
|
|
4
6
|
import { useLeftNavSmoothExpand } from "./useLeftNavSmoothExpand.js";
|
|
5
7
|
import { useSelectFirstBodyItem } from "../hooks/useSelectFirstBodyItem.js";
|
|
6
8
|
const useLeftNavConfig = (props) => {
|
|
7
|
-
const
|
|
9
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
10
|
+
const { expanded, openedItem, onSelectedChange, onFocusChange, items } = propsWithDefaults;
|
|
8
11
|
const [selectedItem, setSelectedItem] = React2.useState(null);
|
|
9
12
|
const [selectedParent, setSelectedParent] = React2.useState(null);
|
|
10
13
|
const [focusedItem, setFocusedItem] = React2.useState(null);
|
|
@@ -19,46 +22,53 @@ const useLeftNavConfig = (props) => {
|
|
|
19
22
|
}),
|
|
20
23
|
[expandedForAnimation, timeoutRef, setExpandedForAnimation]
|
|
21
24
|
);
|
|
22
|
-
useLeftNavSmoothExpand(
|
|
25
|
+
useLeftNavSmoothExpand(propsWithDefaults, smoothExpandOpts);
|
|
23
26
|
React2.useEffect(() => {
|
|
24
|
-
onSelectedChange
|
|
27
|
+
if (onSelectedChange)
|
|
28
|
+
onSelectedChange(selectedItem);
|
|
25
29
|
}, [selectedItem, onSelectedChange]);
|
|
26
30
|
React2.useEffect(() => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
31
|
+
if (propsWithDefaults.actionRef && propsWithDefaults.actionRef.current) {
|
|
32
|
+
propsWithDefaults.actionRef.current.setFocusedItem = setFocusedItem;
|
|
29
33
|
}
|
|
30
|
-
}, [
|
|
34
|
+
}, [propsWithDefaults.actionRef]);
|
|
31
35
|
React2.useEffect(() => {
|
|
32
|
-
if (openedItem
|
|
36
|
+
if (openedItem)
|
|
33
37
|
setSelectedParent(openedItem);
|
|
34
38
|
}, [openedItem]);
|
|
35
39
|
React2.useEffect(() => {
|
|
36
|
-
onFocusChange
|
|
40
|
+
if (onFocusChange)
|
|
41
|
+
onFocusChange(focusedItem);
|
|
37
42
|
}, [focusedItem, onFocusChange]);
|
|
38
43
|
useSelectFirstBodyItem(
|
|
39
|
-
items,
|
|
40
|
-
openedItem,
|
|
41
|
-
|
|
44
|
+
items ?? [],
|
|
45
|
+
openedItem ?? "",
|
|
46
|
+
propsWithDefaults.selectedItem !== void 0 ? propsWithDefaults.selectedItem : selectedItem,
|
|
42
47
|
setSelectedItem,
|
|
43
|
-
|
|
48
|
+
propsWithDefaults.disableDefaultSelection
|
|
44
49
|
);
|
|
45
50
|
const leftNavItemsProps = React2.useMemo(
|
|
46
51
|
() => ({
|
|
47
|
-
headerItem:
|
|
48
|
-
bodyHeaderItem:
|
|
49
|
-
items:
|
|
52
|
+
headerItem: propsWithDefaults.HeaderComponent,
|
|
53
|
+
bodyHeaderItem: propsWithDefaults.BodyHeaderComponent,
|
|
54
|
+
items: propsWithDefaults.items,
|
|
50
55
|
openedDrilldowns
|
|
51
56
|
}),
|
|
52
|
-
[
|
|
57
|
+
[
|
|
58
|
+
propsWithDefaults.HeaderComponent,
|
|
59
|
+
propsWithDefaults.BodyHeaderComponent,
|
|
60
|
+
propsWithDefaults.items,
|
|
61
|
+
openedDrilldowns
|
|
62
|
+
]
|
|
53
63
|
);
|
|
54
64
|
const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);
|
|
55
|
-
|
|
65
|
+
return React2.useMemo(
|
|
56
66
|
() => ({
|
|
57
|
-
leftNavProps:
|
|
67
|
+
leftNavProps: propsWithDefaults,
|
|
58
68
|
expandedForAnimation,
|
|
59
|
-
selectedItem:
|
|
69
|
+
selectedItem: propsWithDefaults.selectedItem !== void 0 ? propsWithDefaults.selectedItem : selectedItem,
|
|
60
70
|
setSelectedItem,
|
|
61
|
-
selectedParent:
|
|
71
|
+
selectedParent: propsWithDefaults.selectedParent !== void 0 ? propsWithDefaults.selectedParent : selectedParent,
|
|
62
72
|
setSelectedParent,
|
|
63
73
|
focusedItem,
|
|
64
74
|
setFocusedItem,
|
|
@@ -68,21 +78,16 @@ const useLeftNavConfig = (props) => {
|
|
|
68
78
|
visibleItemsRefs
|
|
69
79
|
}),
|
|
70
80
|
[
|
|
71
|
-
|
|
81
|
+
propsWithDefaults,
|
|
72
82
|
expandedForAnimation,
|
|
73
83
|
selectedItem,
|
|
74
|
-
setSelectedItem,
|
|
75
|
-
setSelectedParent,
|
|
76
84
|
selectedParent,
|
|
77
85
|
focusedItem,
|
|
78
|
-
setFocusedItem,
|
|
79
86
|
openedDrilldowns,
|
|
80
|
-
setOpenedDrilldowns,
|
|
81
87
|
visibleItems,
|
|
82
88
|
visibleItemsRefs
|
|
83
89
|
]
|
|
84
90
|
);
|
|
85
|
-
return finalConfig;
|
|
86
91
|
};
|
|
87
92
|
var useLeftNavConfig_default = useLeftNavConfig;
|
|
88
93
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavConfig.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from '../LeftNavigationContext.js';\n// import { leftNavigationProps } from '../react-desc-prop-types.js';\n// import { DSLeftNavigationName } from '../constants/constants.js';\nimport useLeftNavItems from './useLeftNavItems.js';\nimport { useLeftNavSmoothExpand } from './useLeftNavSmoothExpand.js';\nimport { useSelectFirstBodyItem } from '../hooks/useSelectFirstBodyItem.js';\n\nexport const useLeftNavConfig = (props: DSLeftNavigationT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSLeftNavigationT.InternalProps>(props, defaultProps);\n // useValidateTypescriptPropTypes(propsWithDefaults, leftNavigationProps, DSLeftNavigationName);\n const { expanded, openedItem, onSelectedChange, onFocusChange, items } = propsWithDefaults;\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * INTERNAL STATE *\n // ************************** ------------ **************************\n // Selection related\n const [selectedItem, setSelectedItem] = React.useState<string | null>(null);\n const [selectedParent, setSelectedParent] = React.useState<string | null>(null);\n // Focus related\n const [focusedItem, setFocusedItem] = React.useState<string | null>(null);\n // Opened uncontrolled drilldowns\n const [openedDrilldowns, setOpenedDrilldowns] = React.useState<string[]>([]);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * EXPAND ANIMATION *\n // ************************** ------------ **************************\n const [expandedForAnimation, setExpandedForAnimation] = React.useState(expanded);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>(null);\n const smoothExpandOpts = React.useMemo(\n () => ({\n expandedForAnimation,\n timeoutRef,\n setExpandedForAnimation,\n }),\n [expandedForAnimation, timeoutRef, setExpandedForAnimation],\n );\n useLeftNavSmoothExpand(propsWithDefaults, smoothExpandOpts);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * SIDE EFFECTS *\n // ************************** ------------ **************************\n React.useEffect(() => {\n if (onSelectedChange) onSelectedChange(selectedItem);\n }, [selectedItem, onSelectedChange]);\n\n React.useEffect(() => {\n if (propsWithDefaults.actionRef && propsWithDefaults.actionRef.current) {\n propsWithDefaults.actionRef.current.setFocusedItem = setFocusedItem;\n }\n }, [propsWithDefaults.actionRef]);\n\n React.useEffect(() => {\n if (openedItem) setSelectedParent(openedItem);\n }, [openedItem]);\n\n React.useEffect(() => {\n if (onFocusChange) onFocusChange(focusedItem);\n }, [focusedItem, onFocusChange]);\n\n useSelectFirstBodyItem(\n items ?? [],\n openedItem ?? '',\n propsWithDefaults.selectedItem !== undefined ? propsWithDefaults.selectedItem : selectedItem,\n setSelectedItem,\n propsWithDefaults.disableDefaultSelection,\n );\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * ITEMS MANAGEMENT *\n // ************************** ------------ **************************\n\n const leftNavItemsProps = React.useMemo(\n () => ({\n headerItem: propsWithDefaults.HeaderComponent,\n bodyHeaderItem: propsWithDefaults.BodyHeaderComponent,\n items: propsWithDefaults.items,\n openedDrilldowns,\n }),\n [\n propsWithDefaults.HeaderComponent,\n propsWithDefaults.BodyHeaderComponent,\n propsWithDefaults.items,\n openedDrilldowns,\n ],\n );\n\n // We need to know the current visible items since we have drilldowns\n const { visibleItems, visibleItemsRefs } = useLeftNavItems(leftNavItemsProps);\n\n // -----------------------------------------------------------------------------\n // ************************** ------------ **************************\n // * LEFTNAV CONFIG *\n // ************************** ------------ **************************\n return React.useMemo(\n () => ({\n leftNavProps: propsWithDefaults,\n expandedForAnimation,\n selectedItem: propsWithDefaults.selectedItem !== undefined ? propsWithDefaults.selectedItem : selectedItem,\n setSelectedItem,\n selectedParent:\n propsWithDefaults.selectedParent !== undefined ? propsWithDefaults.selectedParent : selectedParent,\n setSelectedParent,\n focusedItem,\n setFocusedItem,\n openedDrilldowns,\n setOpenedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n }),\n [\n propsWithDefaults,\n expandedForAnimation,\n selectedItem,\n selectedParent,\n focusedItem,\n openedDrilldowns,\n visibleItems,\n visibleItemsRefs,\n ],\n );\n};\n\nexport default useLeftNavConfig;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAElB,SAAS,oCAAoC;AAC7C,SAAS,oBAAoB;AAG7B,OAAO,qBAAqB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AAEhC,MAAM,mBAAmB,CAAC,UAAmC;AAClE,QAAM,oBAAoB,6BAA8D,OAAO,YAAY;AAE3G,QAAM,EAAE,UAAU,YAAY,kBAAkB,eAAe,MAAM,IAAI;AAOzE,QAAM,CAAC,cAAc,eAAe,IAAIA,OAAM,SAAwB,IAAI;AAC1E,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,OAAM,SAAwB,IAAI;AAE9E,QAAM,CAAC,aAAa,cAAc,IAAIA,OAAM,SAAwB,IAAI;AAExE,QAAM,CAAC,kBAAkB,mBAAmB,IAAIA,OAAM,SAAmB,CAAC,CAAC;AAM3E,QAAM,CAAC,sBAAsB,uBAAuB,IAAIA,OAAM,SAAS,QAAQ;AAC/E,QAAM,aAAaA,OAAM,OAAsC,IAAI;AACnE,QAAM,mBAAmBA,OAAM;AAAA,IAC7B,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,YAAY,uBAAuB;AAAA,EAC5D;AACA,yBAAuB,mBAAmB,gBAAgB;AAM1D,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI;AAAkB,uBAAiB,YAAY;AAAA,EACrD,GAAG,CAAC,cAAc,gBAAgB,CAAC;AAEnC,EAAAA,OAAM,UAAU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6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ import { FOOTER_DS_ID } from "../exported-related/constants.js";
|
|
|
5
5
|
const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];
|
|
6
6
|
const walkItems = (items, openedDrilldowns, callback) => {
|
|
7
7
|
items.forEach((item) => {
|
|
8
|
-
if (typeof item.type === "string") {
|
|
8
|
+
if (typeof item.type === "string" && item.dsId) {
|
|
9
9
|
if (notFocuseableItems.includes(item.type))
|
|
10
10
|
return;
|
|
11
11
|
callback(item.dsId);
|
|
@@ -13,7 +13,7 @@ const walkItems = (items, openedDrilldowns, callback) => {
|
|
|
13
13
|
walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);
|
|
14
14
|
if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)
|
|
15
15
|
walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);
|
|
16
|
-
} else {
|
|
16
|
+
} else if (item.dsId) {
|
|
17
17
|
if (!item.itemOpts?.focuseable)
|
|
18
18
|
return;
|
|
19
19
|
callback(item.dsId);
|
|
@@ -23,6 +23,8 @@ const walkItems = (items, openedDrilldowns, callback) => {
|
|
|
23
23
|
const useLeftNavItems = (props) => {
|
|
24
24
|
const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;
|
|
25
25
|
const items = useMemo(() => {
|
|
26
|
+
if (!bodyItems)
|
|
27
|
+
return [];
|
|
26
28
|
const itemsArray = [...bodyItems];
|
|
27
29
|
if (bodyHeaderItem)
|
|
28
30
|
itemsArray.unshift(bodyHeaderItem);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport type { MutableRefObject, RefObject } from 'react';\nimport { createRef, useMemo, useRef } from 'react';\nimport { ITEM_TYPES } from '../exported-related/index.js';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW,qBAAqB;AAIhG,MAAM,YAAY,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavItems.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport type { MutableRefObject, RefObject } from 'react';\nimport { createRef, useMemo, useRef } from 'react';\nimport { ITEM_TYPES } from '../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\nimport { FOOTER_DS_ID } from '../exported-related/constants.js';\n\nconst notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION];\n\n// Walks the array of items\n// Drilldowns are tree-like structures\nconst walkItems = (\n items: DSLeftNavigationT.GenericItemItemProps[],\n openedDrilldowns: string[],\n callback: (dsId: string) => void,\n) => {\n items.forEach((item) => {\n if (typeof item.type === 'string' && item.dsId) {\n // Out of the box item\n if (notFocuseableItems.includes(item.type)) return; // not focuseable\n\n callback(item.dsId);\n\n // If it's an opened uncontrolled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId))\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n\n // If it's an opened controlled drilldown\n if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && item.itemOpts?.isOpened)\n walkItems(item.itemOpts?.items ?? [], openedDrilldowns, callback);\n } else if (item.dsId) {\n // Custom item\n if (!item.itemOpts?.focuseable) return; // not focuseable specified\n callback(item.dsId);\n }\n });\n};\n\nexport const useLeftNavItems = (props: {\n headerItem?: DSLeftNavigationT.GenericItemItemProps;\n bodyHeaderItem?: DSLeftNavigationT.GenericItemItemProps;\n items?: DSLeftNavigationT.GenericItemItemProps[];\n openedDrilldowns: string[];\n}): {\n visibleItems: string[];\n visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;\n} => {\n const { headerItem, bodyHeaderItem, items: bodyItems, openedDrilldowns } = props;\n\n // Place the header and body header items into the array of items\n const items = useMemo(() => {\n if (!bodyItems) return [];\n const itemsArray: DSLeftNavigationT.GenericItemItemProps[] = [...bodyItems];\n if (bodyHeaderItem) itemsArray.unshift(bodyHeaderItem);\n if (headerItem) itemsArray.unshift(headerItem);\n return itemsArray;\n }, [headerItem, bodyHeaderItem, bodyItems]);\n\n const visibleItemsRefs = useRef<Record<string, RefObject<HTMLDivElement>>>({});\n\n const visibleItems: string[] = useMemo(() => {\n const visibleItemsArray: string[] = [];\n walkItems(items, openedDrilldowns, (dsId: string) => {\n visibleItemsArray.push(dsId);\n });\n visibleItemsArray.push(FOOTER_DS_ID);\n return visibleItemsArray;\n }, [items, openedDrilldowns]);\n\n visibleItems.forEach((dsId) => {\n if (!(dsId in visibleItemsRefs.current)) visibleItemsRefs.current[dsId] = createRef();\n });\n\n return { visibleItems, visibleItemsRefs };\n};\n\nexport default useLeftNavItems;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,MAAM,qBAAqB,CAAC,WAAW,yBAAyB,WAAW,qBAAqB;AAIhG,MAAM,YAAY,CAChB,OACA,kBACA,aACG;AACH,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,OAAO,KAAK,SAAS,YAAY,KAAK,MAAM;AAE9C,UAAI,mBAAmB,SAAS,KAAK,IAAI;AAAG;AAE5C,eAAS,KAAK,IAAI;AAGlB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
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAQX,MAAM,yBAAyB,CAAC,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useLeftNavSmoothExpand.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\n\ninterface SmoothExpandOptsT {\n expandedForAnimation: boolean;\n timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>;\n setExpandedForAnimation: React.Dispatch<React.SetStateAction<boolean>>;\n}\nexport const useLeftNavSmoothExpand = (props: DSLeftNavigationT.Props, smoothExpandOpts: SmoothExpandOptsT): void => {\n const { expanded } = props;\n const { expandedForAnimation, timeoutRef, setExpandedForAnimation } = smoothExpandOpts;\n\n React.useEffect(() => {\n // If expanded changes, we need to smoothly transition to the non-expanded state\n // so we need to wait for 350ms\n if (!expanded && expandedForAnimation) {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => setExpandedForAnimation(false), 350);\n } else if (expanded) setExpandedForAnimation(true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [expanded]);\n\n React.useEffect(\n () => () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n },\n [timeoutRef],\n );\n};\n\nexport default useLeftNavSmoothExpand;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAQX,MAAM,yBAAyB,CAAC,OAAgC,qBAA8C;AACnH,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,sBAAsB,YAAY,wBAAwB,IAAI;AAEtE,EAAAA,OAAM,UAAU,MAAM;AAGpB,QAAI,CAAC,YAAY,sBAAsB;AACrC,UAAI,WAAW;AAAS,qBAAa,WAAW,OAAO;AACvD,iBAAW,UAAU,WAAW,MAAM,wBAAwB,KAAK,GAAG,GAAG;AAAA,IAC3E,WAAW;AAAU,8BAAwB,IAAI;AAAA,EAEnD,GAAG,CAAC,QAAQ,CAAC;AAEb,EAAAA,OAAM;AAAA,IACJ,MAAM,MAAM;AACV,UAAI,WAAW;AAAS,qBAAa,WAAW,OAAO;AAAA,IACzD;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AACF;AAEA,IAAO,iCAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/constants.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSLeftNavigationName = 'DSLeftNavigation';\n\nexport const DSLeftNavigationSlots = {\n ROOT: 'root',\n\n AREAS_CONTAINER: 'areas-container',\n BODY_AREAS_CONTAINER: 'body-areas-container',\n FOOTER_AREA: 'footer-area',\n LOADER_WRAPPER: 'loader-wrapper',\n HEADER_AREA: 'header-area',\n BODY_HEADER_AREA: 'body-header-area',\n BODY_ITEMS_AREA: 'body-items-area',\n\n FOOTER_MENU: 'footer-menu',\n FOOTER_ITEM: 'footer-item',\n FOOTER_LABEL: 'footer-label',\n FOOTER_SEPARATOR: 'footer-separator',\n FOOTER_MENU_COLLAPSE: 'footer-menu-collapse',\n\n NOTIFICATIONS_CONTAINER: 'notifications-container',\n\n ITEM_SEPARATOR: 'item-separator',\n\n SECTION_LABEL: 'section-label',\n SECTION_RIGHT_LABEL: 'section-right-label',\n VERTICAL_SEPARATOR: 'vertical-separator',\n SECTION_CONTAINER: 'section-container',\n\n ITEM_LABEL: 'item-label',\n LEFT_CONTAINER: 'left-container',\n BOTTOM_CONTAINER: 'bottom-container',\n RIGHT_CONTAINER: 'right-container',\n ITEM_DATE: 'item-date',\n ITEM_CHEVRON_BACK: 'item-chevron-back',\n\n ITEM: 'item',\n COLLAPSED_CONTAINER: 'collapsed-container',\n ARROW_CONTAINER: 'arrow-container',\n ITEM_BORDER_BOTTOM: 'item-border-bottom',\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,uBAAuB;AAE7B,MAAM,wBAAwB;AAAA,EACnC,MAAM;AAAA,EAEN,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EAEjB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EAEtB,yBAAyB;AAAA,EAEzB,gBAAgB;AAAA,EAEhB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EAEnB,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,mBAAmB;AAAA,EAEnB,MAAM;AAAA,EACN,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './constants.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
6
|
"names": []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight } from '@elliemae/ds-icons';\n\nexport const ChevronItem = (props
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIrB;AAHF,SAAS,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ChevronItem/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ChevronSmallRight, type SvgIconT } from '@elliemae/ds-icons';\n\nexport const ChevronItem = (props?: SvgIconT.Props): JSX.Element => (\n <ChevronSmallRight size=\"m\" color={['brand-primary', '800']} {...props} />\n);\n\nexport default ChevronItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIrB;AAHF,SAAS,yBAAwC;AAE1C,MAAM,cAAc,CAAC,UAC1B,oBAAC,qBAAkB,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAI,GAAG,OAAO;AAG1E,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|