@salesforce/design-system-react 11.0.0-alpha.7 → 11.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/filter/filter.cjs +1 -1
- package/dist/cjs/components/filter/filter.cjs.map +1 -1
- package/dist/cjs/components/modal/check-props.cjs +2 -0
- package/dist/cjs/components/modal/check-props.cjs.map +1 -0
- package/dist/cjs/components/modal/component.cjs +2 -0
- package/dist/cjs/components/modal/component.cjs.map +1 -0
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/popover/component.cjs +2 -0
- package/dist/cjs/components/popover/component.cjs.map +1 -0
- package/dist/cjs/components/popover/edit-dialog.cjs +1 -1
- package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/slider/check-props.cjs +1 -1
- package/dist/cjs/components/slider/check-props.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/spinner/check-props.cjs +2 -0
- package/dist/cjs/components/spinner/check-props.cjs.map +1 -0
- package/dist/cjs/components/spinner/component.cjs +2 -0
- package/dist/cjs/components/spinner/component.cjs.map +1 -0
- package/dist/cjs/components/spinner/index.cjs +1 -1
- package/dist/cjs/components/spinner/index.cjs.map +1 -1
- package/dist/cjs/components/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/check-props.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +1 -1
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +2 -2
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/filter/filter.js +1 -1
- package/dist/es/components/filter/filter.js.map +1 -1
- package/dist/es/components/modal/check-props.js +22 -0
- package/dist/es/components/modal/check-props.js.map +1 -0
- package/dist/es/components/modal/component.js +35 -0
- package/dist/es/components/modal/component.js.map +1 -0
- package/dist/es/components/modal/index.js +118 -104
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/popover/component.js +59 -0
- package/dist/es/components/popover/component.js.map +1 -0
- package/dist/es/components/popover/edit-dialog.js +1 -1
- package/dist/es/components/popover/edit-dialog.js.map +1 -1
- package/dist/es/components/popover/popover.js +235 -191
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/slider/check-props.js +1 -1
- package/dist/es/components/slider/check-props.js.map +1 -1
- package/dist/es/components/slider/index.js +63 -60
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/spinner/check-props.js +13 -0
- package/dist/es/components/spinner/check-props.js.map +1 -0
- package/dist/es/components/spinner/component.js +17 -0
- package/dist/es/components/spinner/component.js.map +1 -0
- package/dist/es/components/spinner/index.js +43 -29
- package/dist/es/components/spinner/index.js.map +1 -1
- package/dist/es/components/tree/check-props.js +1 -1
- package/dist/es/components/tree/check-props.js.map +1 -1
- package/dist/es/components/tree/tree.js +79 -73
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/vertical-navigation/index.js +17 -16
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/welcome-mat/index.js +51 -50
- package/dist/es/components/welcome-mat/index.js.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/modal/check-props.d.ts +3 -0
- package/dist/types/components/modal/check-props.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +21 -13
- package/dist/types/components/modal/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +24 -14
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/slider/check-props.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +9 -7
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/spinner/check-props.d.ts +3 -0
- package/dist/types/components/spinner/check-props.d.ts.map +1 -0
- package/dist/types/components/spinner/index.d.ts +18 -9
- package/dist/types/components/spinner/index.d.ts.map +1 -1
- package/dist/types/components/tree/check-props.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +8 -4
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/index.d.ts +7 -7
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/index.d.ts +5 -6
- package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { TREE as e } from "../../utilities/constants.js";
|
|
|
2
2
|
import t from "./private/branch.js";
|
|
3
3
|
import n from "./check-props.js";
|
|
4
4
|
import r from "./component.js";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { forwardRef as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
6
|
+
import l from "classnames";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region components/tree/tree.tsx
|
|
9
|
-
var
|
|
9
|
+
var f = (e, t, n = "", r = !0) => {
|
|
10
10
|
if (!e.nodes) return [{
|
|
11
11
|
node: e,
|
|
12
12
|
treeIndex: n
|
|
@@ -17,57 +17,59 @@ var d = (e, t, n = "", r = !0) => {
|
|
|
17
17
|
}];
|
|
18
18
|
if (e.expanded) for (let a = 0; a < e.nodes.length; a += 1) {
|
|
19
19
|
let o = r ? e.nodes[a] : t(e)?.[a];
|
|
20
|
-
o && (i = i.concat(
|
|
20
|
+
o && (i = i.concat(f(o, t, n ? `${n}-${a}` : `${a}`, !1)));
|
|
21
21
|
}
|
|
22
22
|
return i;
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
nodes:
|
|
23
|
+
}, p = (e) => e.nodes, m = i(({ assistiveText: i, className: m, classNameList: h, listClassName: g, getNodes: _ = p, heading: v, id: y, labels: b, nodes: x, onSelect: S, onClick: C, onRequestToggle: w, onExpandClick: T, onScroll: E, searchTerm: D, styleList: O, listStyle: k }, A) => {
|
|
24
|
+
let j = i?.heading ?? i?.label, M = b?.heading ?? v, N = s(!1), P = a(() => f({
|
|
25
|
+
nodes: _({ nodes: x }),
|
|
26
26
|
expanded: !0
|
|
27
|
-
},
|
|
28
|
-
let e =
|
|
27
|
+
}, _).slice(1), [_, x]), [F, I] = c(P), [L, R] = c(() => {
|
|
28
|
+
let e = P().find((e) => e.node.selected);
|
|
29
29
|
return e ? [e.treeIndex] : [];
|
|
30
|
-
}), [
|
|
31
|
-
|
|
30
|
+
}), [z, B] = c(() => P().find((e) => e.node.selected)?.treeIndex);
|
|
31
|
+
o(() => {
|
|
32
32
|
n(e, {
|
|
33
|
-
assistiveText:
|
|
33
|
+
assistiveText: i,
|
|
34
34
|
className: m,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
classNameList: h,
|
|
36
|
+
listClassName: g,
|
|
37
|
+
getNodes: _,
|
|
38
|
+
heading: v,
|
|
39
|
+
id: y,
|
|
40
|
+
labels: b,
|
|
41
|
+
nodes: x,
|
|
42
|
+
onSelect: S,
|
|
43
|
+
onClick: C,
|
|
44
|
+
onRequestToggle: w,
|
|
45
|
+
onExpandClick: T,
|
|
46
|
+
onScroll: E,
|
|
47
|
+
searchTerm: D,
|
|
48
|
+
styleList: O,
|
|
49
|
+
listStyle: k
|
|
48
50
|
}, r);
|
|
49
|
-
}, []),
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
let
|
|
53
|
-
n &&
|
|
51
|
+
}, []), o(() => {
|
|
52
|
+
I(P());
|
|
53
|
+
}, [P, x]);
|
|
54
|
+
let V = a(({ event: e, data: t, clearSelectedNodes: n, fromFocus: r }) => {
|
|
55
|
+
n && F.forEach((e) => {
|
|
54
56
|
e.node.selected && (e.node.selected = !1);
|
|
55
|
-
}), r || (
|
|
57
|
+
}), r || (S ? S(e, {
|
|
56
58
|
node: t.node,
|
|
57
59
|
isSelected: t.select
|
|
58
|
-
}) :
|
|
60
|
+
}) : C && C(e, t));
|
|
59
61
|
let i;
|
|
60
|
-
i = t.select ? [...
|
|
62
|
+
i = t.select ? [...L, t.treeIndex] : L.filter((e) => e !== t.treeIndex), N.current = !0, B(t.treeIndex), R(i);
|
|
61
63
|
}, [
|
|
62
|
-
|
|
63
|
-
x,
|
|
64
|
+
F,
|
|
64
65
|
S,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
C,
|
|
67
|
+
L
|
|
68
|
+
]), H = a(() => {
|
|
69
|
+
N.current = !1;
|
|
70
|
+
}, []), U = a(({ event: e, data: t }) => {
|
|
69
71
|
if (t.select) {
|
|
70
|
-
!
|
|
72
|
+
!w && T ? (N.current = !0, T(e, t), B(t.treeIndex)) : V({
|
|
71
73
|
event: e,
|
|
72
74
|
data: {
|
|
73
75
|
node: t.node,
|
|
@@ -78,44 +80,48 @@ var d = (e, t, n = "", r = !0) => {
|
|
|
78
80
|
});
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
N.current = !0, w ? w(e, {
|
|
82
84
|
node: t.node,
|
|
83
85
|
isExpanded: t.expand
|
|
84
|
-
}) :
|
|
86
|
+
}) : T && T(e, t);
|
|
85
87
|
}, [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
]),
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
id:
|
|
92
|
-
className:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
V,
|
|
89
|
+
w,
|
|
90
|
+
T
|
|
91
|
+
]), W = j || M;
|
|
92
|
+
return /* @__PURE__ */ d("div", {
|
|
93
|
+
id: y,
|
|
94
|
+
className: l("slds-tree_container", m),
|
|
95
|
+
ref: A,
|
|
96
|
+
children: [/* @__PURE__ */ u("h4", {
|
|
97
|
+
className: l("slds-tree__group-header", { "slds-assistive-text": !!j }),
|
|
98
|
+
id: `${y}__heading`,
|
|
99
|
+
children: W
|
|
100
|
+
}), /* @__PURE__ */ u(t, {
|
|
101
|
+
getNodes: _,
|
|
102
|
+
initalClassName: l(g, h),
|
|
103
|
+
htmlId: y,
|
|
104
|
+
initialStyle: k || O ? {
|
|
105
|
+
...k,
|
|
106
|
+
...O
|
|
107
|
+
} : void 0,
|
|
102
108
|
level: 0,
|
|
103
|
-
node: { nodes:
|
|
104
|
-
flattenedNodes:
|
|
105
|
-
selectedNodeIndexes:
|
|
106
|
-
focusedNodeIndex:
|
|
107
|
-
treeHasFocus:
|
|
108
|
-
onNodeBlur:
|
|
109
|
-
onSelect:
|
|
110
|
-
onExpand:
|
|
111
|
-
onScroll:
|
|
112
|
-
searchTerm:
|
|
113
|
-
treeId:
|
|
109
|
+
node: { nodes: x },
|
|
110
|
+
flattenedNodes: F,
|
|
111
|
+
selectedNodeIndexes: L,
|
|
112
|
+
focusedNodeIndex: z,
|
|
113
|
+
treeHasFocus: N.current,
|
|
114
|
+
onNodeBlur: H,
|
|
115
|
+
onSelect: V,
|
|
116
|
+
onExpand: U,
|
|
117
|
+
onScroll: E,
|
|
118
|
+
searchTerm: D,
|
|
119
|
+
treeId: y
|
|
114
120
|
})]
|
|
115
121
|
});
|
|
116
|
-
};
|
|
117
|
-
|
|
122
|
+
});
|
|
123
|
+
m.displayName = e;
|
|
118
124
|
//#endregion
|
|
119
|
-
export {
|
|
125
|
+
export { m as default };
|
|
120
126
|
|
|
121
127
|
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","names":[],"sources":["../../../../components/tree/tree.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { useState, useCallback, useEffect, useRef } from 'react';\nimport classNames from 'classnames';\n// Using native Array.find instead of lodash for better TypeScript support\n\n// Child components\nimport Branch from './private/branch';\n\n// Similar to React's PropTypes check\nimport checkProps from './check-props';\n\n// Constants\nimport { TREE } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nimport {\n\tTreeNode,\n\tFlattenedNode,\n\tTreeAssistiveText,\n\tTreeLabels,\n\tTreeNodeSelectData,\n\tTreeRequestToggleData,\n\tTreeSelectData,\n\tTreeExpandData,\n\tTreeScrollData,\n} from './types';\n\nexport interface TreeProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `heading`: Visually hidden tree heading. Set this or `labels.heading`.\n\t */\n\tassistiveText?: TreeAssistiveText;\n\t/** Class names for the container element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names for the top-level ul element */\n\tlistClassName?: string | string[] | Record<string, boolean>;\n\t/** Function to get child nodes from a parent node */\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\t/** @deprecated Use `labels.heading` instead. */\n\theading?: ReactNode;\n\t/** HTML id of the tree container (required) */\n\tid: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `heading`: Visible tree heading that describes its contents. Set this or `assistiveText.heading`.\n\t */\n\tlabels?: TreeLabels;\n\t/** Array of tree nodes */\n\tnodes: TreeNode[];\n\t/**\n\t * Called when an item or branch is selected or deselected: by click, by focus, or by keyboard\n\t * (Enter, Up/Down arrows, Right arrow into an expanded branch, Left arrow to the parent node).\n\t * `data.isSelected` is the requested selection state. Update `node.selected` in `nodes` to apply it.\n\t */\n\tonSelect?: (event: React.SyntheticEvent, data: TreeNodeSelectData) => void;\n\t/**\n\t * Called when an item or branch is selected.\n\t * @deprecated Use `onSelect`, which receives `{ node, isSelected }`. Ignored when `onSelect` is passed.\n\t */\n\tonClick?: (event: React.SyntheticEvent, data: TreeSelectData) => void;\n\t/**\n\t * Called when a branch is asked to expand or collapse: by clicking its toggle button, by Right\n\t * arrow on a collapsed branch, or by Left arrow on an expanded branch. `data.isExpanded` is the\n\t * requested expansion state. Update `node.expanded` in `nodes` to apply it.\n\t */\n\tonRequestToggle?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: TreeRequestToggleData\n\t) => void;\n\t/**\n\t * Called when a branch's expand/collapse button is clicked, or when the Left arrow is pressed\n\t * on a collapsed branch or item (with `data.select: true` and `data.node` set to the parent).\n\t * @deprecated Use `onRequestToggle`, which receives `{ node, isExpanded }`. With\n\t * `onRequestToggle`, Left arrow on a collapsed branch or item selects the parent via\n\t * `onSelect` instead. Ignored when `onRequestToggle` is passed.\n\t */\n\tonExpandClick?: (event: React.SyntheticEvent, data: TreeExpandData) => void;\n\t/** Callback when the tree list scrolls. `data.ratio` is the scroll position from `0` to `1`. */\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\t/** Search term to highlight in node labels */\n\tsearchTerm?: string;\n\t/** Styles for the top-level ul element */\n\tlistStyle?: React.CSSProperties;\n}\n\ntype ReactNode = React.ReactNode;\n\n/**\n * Flattens hierarchical tree structure into a flat array.\n * The first item is the whole tree and should be removed with slice(1).\n */\nconst flattenTree = (\n\troot: { nodes?: TreeNode[]; expanded?: boolean },\n\tgetNodes: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined,\n\ttreeIndex = '',\n\tfirstLevel = true\n): FlattenedNode[] => {\n\tif (!root.nodes) {\n\t\treturn [{ node: root as TreeNode, treeIndex }];\n\t}\n\tlet nodes: FlattenedNode[] = [{ node: root as TreeNode, treeIndex }];\n\tif (root.expanded) {\n\t\tfor (let index = 0; index < root.nodes.length; index += 1) {\n\t\t\tconst curNode = firstLevel ? root.nodes[index] : getNodes(root)?.[index];\n\t\t\tif (curNode) {\n\t\t\t\tnodes = nodes.concat(\n\t\t\t\t\tflattenTree(\n\t\t\t\t\t\tcurNode,\n\t\t\t\t\t\tgetNodes,\n\t\t\t\t\t\ttreeIndex ? `${treeIndex}-${index}` : `${index}`,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn nodes;\n};\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A tree is visualization of a structure hierarchy.\n * A branch can be expanded or collapsed.\n * This is a controlled component, since visual state is present in the nodes data.\n */\nconst Tree: React.FC<TreeProps> = ({\n\tassistiveText: assistiveTextProp,\n\tclassName,\n\tlistClassName,\n\tgetNodes = defaultGetNodes,\n\theading: headingProp,\n\tid,\n\tlabels,\n\tnodes,\n\tonSelect,\n\tonClick,\n\tonRequestToggle,\n\tonExpandClick,\n\tonScroll,\n\tsearchTerm,\n\tlistStyle,\n}) => {\n\t// `assistiveText.label` is deprecated\n\tconst assistiveHeading =\n\t\tassistiveTextProp?.heading ?? assistiveTextProp?.label;\n\t// `heading` is deprecated\n\tconst visibleHeading = labels?.heading ?? headingProp;\n\n\t// Track if tree has focus\n\tconst treeHasFocusRef = useRef(false);\n\n\t// Compute flattened nodes\n\tconst computeFlattenedNodes = useCallback(() => {\n\t\treturn flattenTree(\n\t\t\t{\n\t\t\t\tnodes: getNodes({ nodes }),\n\t\t\t\texpanded: true,\n\t\t\t},\n\t\t\tgetNodes\n\t\t).slice(1);\n\t}, [getNodes, nodes]);\n\n\t// Initialize state\n\tconst [flattenedNodes, setFlattenedNodes] = useState<FlattenedNode[]>(\n\t\tcomputeFlattenedNodes\n\t);\n\tconst [selectedNodeIndexes, setSelectedNodeIndexes] = useState<string[]>(\n\t\t() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode ? [selectedNode.treeIndex] : [];\n\t\t}\n\t);\n\tconst [focusedNodeIndex, setFocusedNodeIndex] = useState<string | undefined>(\n\t\t() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode?.treeIndex;\n\t\t}\n\t);\n\n\t// Check props on mount\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tTREE,\n\t\t\t{\n\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\tclassName,\n\t\t\t\tlistClassName,\n\t\t\t\tgetNodes,\n\t\t\t\theading: headingProp,\n\t\t\t\tid,\n\t\t\t\tlabels,\n\t\t\t\tnodes,\n\t\t\t\tonSelect,\n\t\t\t\tonClick,\n\t\t\t\tonRequestToggle,\n\t\t\t\tonExpandClick,\n\t\t\t\tonScroll,\n\t\t\t\tsearchTerm,\n\t\t\t\tlistStyle,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Update flattened nodes when nodes prop changes\n\tuseEffect(() => {\n\t\tsetFlattenedNodes(computeFlattenedNodes());\n\t}, [computeFlattenedNodes, nodes]);\n\n\t// Handle node selection\n\tconst handleSelect = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tdata,\n\t\t\tclearSelectedNodes,\n\t\t\tfromFocus,\n\t\t}: {\n\t\t\tevent: React.SyntheticEvent;\n\t\t\tdata: TreeSelectData;\n\t\t\tclearSelectedNodes?: boolean;\n\t\t\tfromFocus?: boolean;\n\t\t}) => {\n\t\t\t// When triggered by a key event, other nodes should be deselected\n\t\t\tif (clearSelectedNodes) {\n\t\t\t\tflattenedNodes.forEach((flattenedNode) => {\n\t\t\t\t\tif (flattenedNode.node.selected) {\n\t\t\t\t\t\tflattenedNode.node.selected = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Prevent firing twice on first click due to focus event\n\t\t\tif (!fromFocus) {\n\t\t\t\tif (onSelect) {\n\t\t\t\t\tonSelect(event, { node: data.node, isSelected: data.select });\n\t\t\t\t} else if (onClick) {\n\t\t\t\t\tonClick(event, data);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update selected and focused nodes\n\t\t\tlet newSelectedNodeIndexes: string[];\n\t\t\tif (data.select) {\n\t\t\t\tnewSelectedNodeIndexes = [...selectedNodeIndexes, data.treeIndex];\n\t\t\t} else {\n\t\t\t\tnewSelectedNodeIndexes = selectedNodeIndexes.filter(\n\t\t\t\t\t(treeIndex) => treeIndex !== data.treeIndex\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\tsetSelectedNodeIndexes(newSelectedNodeIndexes);\n\t\t},\n\t\t[flattenedNodes, onSelect, onClick, selectedNodeIndexes]\n\t);\n\n\t// Handle node blur\n\tconst handleNodeBlur = useCallback(() => {\n\t\ttreeHasFocusRef.current = false;\n\t}, []);\n\n\t// Handle expand/collapse\n\tconst handleExpand = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tdata,\n\t\t}: {\n\t\t\tevent: React.SyntheticEvent;\n\t\t\tdata: TreeExpandData;\n\t\t}) => {\n\t\t\t// `data.select` marks Left arrow on a collapsed branch or item: move to the parent node.\n\t\t\tif (data.select) {\n\t\t\t\tif (!onRequestToggle && onExpandClick) {\n\t\t\t\t\t// Deprecated behavior: report it to `onExpandClick` with the parent node\n\t\t\t\t\ttreeHasFocusRef.current = true;\n\t\t\t\t\tonExpandClick(event, data);\n\t\t\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\t\t} else {\n\t\t\t\t\t// Not an expand/collapse request: select the parent, like Up/Down arrows do\n\t\t\t\t\thandleSelect({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tdata: { node: data.node, select: true, treeIndex: data.treeIndex },\n\t\t\t\t\t\tclearSelectedNodes: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttreeHasFocusRef.current = true;\n\t\t\tif (onRequestToggle) {\n\t\t\t\tonRequestToggle(event, { node: data.node, isExpanded: data.expand });\n\t\t\t} else if (onExpandClick) {\n\t\t\t\tonExpandClick(event, data);\n\t\t\t}\n\t\t},\n\t\t[handleSelect, onRequestToggle, onExpandClick]\n\t);\n\n\t// Determine heading text\n\tconst headingText = assistiveHeading || visibleHeading;\n\n\treturn (\n\t\t<div id={id} className={classNames('slds-tree_container', className)}>\n\t\t\t<h4\n\t\t\t\tclassName={classNames('slds-tree__group-header', {\n\t\t\t\t\t'slds-assistive-text': !!assistiveHeading,\n\t\t\t\t})}\n\t\t\t\tid={`${id}__heading`}\n\t\t\t>\n\t\t\t\t{headingText}\n\t\t\t</h4>\n\t\t\t<Branch\n\t\t\t\tgetNodes={getNodes}\n\t\t\t\tinitalClassName={listClassName}\n\t\t\t\thtmlId={id}\n\t\t\t\tinitialStyle={listStyle}\n\t\t\t\tlevel={0}\n\t\t\t\tnode={{ nodes }}\n\t\t\t\tflattenedNodes={flattenedNodes}\n\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\tfocusedNodeIndex={focusedNodeIndex}\n\t\t\t\ttreeHasFocus={treeHasFocusRef.current}\n\t\t\t\tonNodeBlur={handleNodeBlur}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t\tonExpand={handleExpand}\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tsearchTerm={searchTerm}\n\t\t\t\ttreeId={id}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nTree.displayName = TREE;\n\nexport default Tree;\n"],"mappings":";;;;;;;;AAiGA,IAAM,KACL,GACA,GACA,IAAY,IACZ,IAAa,OACQ;CACrB,IAAI,CAAC,EAAK,OACT,OAAO,CAAC;EAAE,MAAM;EAAkB;CAAU,CAAC;CAE9C,IAAI,IAAyB,CAAC;EAAE,MAAM;EAAkB;CAAU,CAAC;CACnE,IAAI,EAAK,UACR,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAK,MAAM,QAAQ,KAAS,GAAG;EAC1D,IAAM,IAAU,IAAa,EAAK,MAAM,KAAS,EAAS,CAAI,CAAC,GAAG;EAClE,AAAI,MACH,IAAQ,EAAM,OACb,EACC,GACA,GACA,IAAY,GAAG,EAAU,GAAG,MAAU,GAAG,KACzC,EACD,CACD;CAEF;CAED,OAAO;AACR,GAEM,KAAmB,MAAiC,EAAK,OAOzD,KAA6B,EAClC,eAAe,GACf,cACA,kBACA,cAAW,GACX,SAAS,GACT,OACA,WACA,UACA,aACA,YACA,oBACA,kBACA,aACA,eACA,mBACK;CAEL,IAAM,IACL,GAAmB,WAAW,GAAmB,OAE5C,IAAiB,GAAQ,WAAW,GAGpC,IAAkB,EAAO,EAAK,GAG9B,IAAwB,QACtB,EACN;EACC,OAAO,EAAS,EAAE,SAAM,CAAC;EACzB,UAAU;CACX,GACA,CACD,CAAC,CAAC,MAAM,CAAC,GACP,CAAC,GAAU,CAAK,CAAC,GAGd,CAAC,GAAgB,KAAqB,EAC3C,CACD,GACM,CAAC,GAAqB,KAA0B,QAC/C;EAEL,IAAM,IADY,EACG,CAAA,CAAU,MAAM,MAAY,EAAQ,KAAK,QAAQ;EACtE,OAAO,IAAe,CAAC,EAAa,SAAS,IAAI,CAAC;CACnD,CACD,GACM,CAAC,GAAkB,KAAuB,QAE5B,EACG,CAAA,CAAU,MAAM,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c,GAAO,CAAI;CAE3B,GACA;EAAC;EAAc;EAAiB;CAAa,CAC9C,GAGM,IAAc,KAAoB;CAExC,OACC,kBAAC,OAAD;EAAS;EAAI,WAAW,EAAW,uBAAuB,CAAS;EAAnE,UAAA,CACC,kBAAC,MAAD;GACC,WAAW,EAAW,2BAA2B,EAChD,uBAAuB,CAAC,CAAC,EAC1B,CAAC;GACD,IAAI,GAAG,EAAG;GAET,UAAA;EACE,CAAA,GACJ,kBAAC,GAAD;GACW;GACV,iBAAiB;GACjB,QAAQ;GACR,cAAc;GACd,OAAO;GACP,MAAM,EAAE,SAAM;GACE;GACK;GACH;GAClB,cAAc,EAAgB;GAC9B,YAAY;GACZ,UAAU;GACV,UAAU;GACA;GACE;GACZ,QAAQ;EACR,CAAA,CACG;;AAEP;AAEA,EAAK,cAAc"}
|
|
1
|
+
{"version":3,"file":"tree.js","names":[],"sources":["../../../../components/tree/tree.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tforwardRef,\n\tuseState,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n} from 'react';\nimport classNames from 'classnames';\n// Using native Array.find instead of lodash for better TypeScript support\n\n// Child components\nimport Branch from './private/branch';\n\n// Similar to React's PropTypes check\nimport checkProps from './check-props';\n\n// Constants\nimport { TREE } from '../../utilities/constants';\nimport componentDoc from './component.json';\n\nimport {\n\tTreeNode,\n\tFlattenedNode,\n\tTreeAssistiveText,\n\tTreeLabels,\n\tTreeNodeSelectData,\n\tTreeRequestToggleData,\n\tTreeSelectData,\n\tTreeExpandData,\n\tTreeScrollData,\n} from './types';\n\nexport interface TreeProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `heading`: Visually hidden tree heading. Set this or `labels.heading`.\n\t */\n\tassistiveText?: TreeAssistiveText;\n\t/** Class names for the root `.slds-tree_container` div */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names for the top-level `ul.slds-tree` element */\n\tclassNameList?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `classNameList`. */\n\tlistClassName?: string | string[] | Record<string, boolean>;\n\t/** Function to get child nodes from a parent node */\n\tgetNodes?: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined;\n\t/** @deprecated Use `labels.heading` instead. */\n\theading?: ReactNode;\n\t/** HTML id of the tree container (required) */\n\tid: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `heading`: Visible tree heading that describes its contents. Set this or `assistiveText.heading`.\n\t */\n\tlabels?: TreeLabels;\n\t/** Array of tree nodes */\n\tnodes: TreeNode[];\n\t/**\n\t * Called when an item or branch is selected or deselected: by click, by focus, or by keyboard\n\t * (Enter, Up/Down arrows, Right arrow into an expanded branch, Left arrow to the parent node).\n\t * `data.isSelected` is the requested selection state. Update `node.selected` in `nodes` to apply it.\n\t */\n\tonSelect?: (event: React.SyntheticEvent, data: TreeNodeSelectData) => void;\n\t/**\n\t * Called when an item or branch is selected.\n\t * @deprecated Use `onSelect`, which receives `{ node, isSelected }`. Ignored when `onSelect` is passed.\n\t */\n\tonClick?: (event: React.SyntheticEvent, data: TreeSelectData) => void;\n\t/**\n\t * Called when a branch is asked to expand or collapse: by clicking its toggle button, by Right\n\t * arrow on a collapsed branch, or by Left arrow on an expanded branch. `data.isExpanded` is the\n\t * requested expansion state. Update `node.expanded` in `nodes` to apply it.\n\t */\n\tonRequestToggle?: (\n\t\tevent: React.SyntheticEvent,\n\t\tdata: TreeRequestToggleData\n\t) => void;\n\t/**\n\t * Called when a branch's expand/collapse button is clicked, or when the Left arrow is pressed\n\t * on a collapsed branch or item (with `data.select: true` and `data.node` set to the parent).\n\t * @deprecated Use `onRequestToggle`, which receives `{ node, isExpanded }`. With\n\t * `onRequestToggle`, Left arrow on a collapsed branch or item selects the parent via\n\t * `onSelect` instead. Ignored when `onRequestToggle` is passed.\n\t */\n\tonExpandClick?: (event: React.SyntheticEvent, data: TreeExpandData) => void;\n\t/** Callback when the tree list scrolls. `data.ratio` is the scroll position from `0` to `1`. */\n\tonScroll?: (\n\t\tevent: React.UIEvent<HTMLUListElement>,\n\t\tdata: TreeScrollData\n\t) => void;\n\t/** Search term to highlight in node labels */\n\tsearchTerm?: string;\n\t/** Styles for the top-level `ul.slds-tree` element */\n\tstyleList?: React.CSSProperties;\n\t/** @deprecated Use `styleList`. */\n\tlistStyle?: React.CSSProperties;\n}\n\ntype ReactNode = React.ReactNode;\n\n/**\n * Flattens hierarchical tree structure into a flat array.\n * The first item is the whole tree and should be removed with slice(1).\n */\nconst flattenTree = (\n\troot: { nodes?: TreeNode[]; expanded?: boolean },\n\tgetNodes: (node: { nodes?: TreeNode[] }) => TreeNode[] | undefined,\n\ttreeIndex = '',\n\tfirstLevel = true\n): FlattenedNode[] => {\n\tif (!root.nodes) {\n\t\treturn [{ node: root as TreeNode, treeIndex }];\n\t}\n\tlet nodes: FlattenedNode[] = [{ node: root as TreeNode, treeIndex }];\n\tif (root.expanded) {\n\t\tfor (let index = 0; index < root.nodes.length; index += 1) {\n\t\t\tconst curNode = firstLevel ? root.nodes[index] : getNodes(root)?.[index];\n\t\t\tif (curNode) {\n\t\t\t\tnodes = nodes.concat(\n\t\t\t\t\tflattenTree(\n\t\t\t\t\t\tcurNode,\n\t\t\t\t\t\tgetNodes,\n\t\t\t\t\t\ttreeIndex ? `${treeIndex}-${index}` : `${index}`,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn nodes;\n};\n\nconst defaultGetNodes = (node: { nodes?: TreeNode[] }) => node.nodes;\n\n/**\n * A tree is visualization of a structure hierarchy.\n * A branch can be expanded or collapsed.\n * This is a controlled component, since visual state is present in the nodes data.\n */\nconst Tree = forwardRef<HTMLDivElement, TreeProps>(\n\t(\n\t\t{\n\t\t\tassistiveText: assistiveTextProp,\n\t\t\tclassName,\n\t\t\tclassNameList,\n\t\t\tlistClassName,\n\t\t\tgetNodes = defaultGetNodes,\n\t\t\theading: headingProp,\n\t\t\tid,\n\t\t\tlabels,\n\t\t\tnodes,\n\t\t\tonSelect,\n\t\t\tonClick,\n\t\t\tonRequestToggle,\n\t\t\tonExpandClick,\n\t\t\tonScroll,\n\t\t\tsearchTerm,\n\t\t\tstyleList,\n\t\t\tlistStyle,\n\t\t},\n\t\tref\n\t) => {\n\t\t// `assistiveText.label` is deprecated\n\t\tconst assistiveHeading =\n\t\t\tassistiveTextProp?.heading ?? assistiveTextProp?.label;\n\t\t// `heading` is deprecated\n\t\tconst visibleHeading = labels?.heading ?? headingProp;\n\n\t\t// Track if tree has focus\n\t\tconst treeHasFocusRef = useRef(false);\n\n\t\t// Compute flattened nodes\n\t\tconst computeFlattenedNodes = useCallback(() => {\n\t\t\treturn flattenTree(\n\t\t\t\t{\n\t\t\t\t\tnodes: getNodes({ nodes }),\n\t\t\t\t\texpanded: true,\n\t\t\t\t},\n\t\t\t\tgetNodes\n\t\t\t).slice(1);\n\t\t}, [getNodes, nodes]);\n\n\t\t// Initialize state\n\t\tconst [flattenedNodes, setFlattenedNodes] = useState<FlattenedNode[]>(\n\t\t\tcomputeFlattenedNodes\n\t\t);\n\t\tconst [selectedNodeIndexes, setSelectedNodeIndexes] = useState<string[]>(\n\t\t\t() => {\n\t\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\t\treturn selectedNode ? [selectedNode.treeIndex] : [];\n\t\t\t}\n\t\t);\n\t\tconst [focusedNodeIndex, setFocusedNodeIndex] = useState<\n\t\t\tstring | undefined\n\t\t>(() => {\n\t\t\tconst flattened = computeFlattenedNodes();\n\t\t\tconst selectedNode = flattened.find((curNode) => curNode.node.selected);\n\t\t\treturn selectedNode?.treeIndex;\n\t\t});\n\n\t\t// Check props on mount\n\t\tuseEffect(() => {\n\t\t\tcheckProps(\n\t\t\t\tTREE,\n\t\t\t\t{\n\t\t\t\t\tassistiveText: assistiveTextProp,\n\t\t\t\t\tclassName,\n\t\t\t\t\tclassNameList,\n\t\t\t\t\tlistClassName,\n\t\t\t\t\tgetNodes,\n\t\t\t\t\theading: headingProp,\n\t\t\t\t\tid,\n\t\t\t\t\tlabels,\n\t\t\t\t\tnodes,\n\t\t\t\t\tonSelect,\n\t\t\t\t\tonClick,\n\t\t\t\t\tonRequestToggle,\n\t\t\t\t\tonExpandClick,\n\t\t\t\t\tonScroll,\n\t\t\t\t\tsearchTerm,\n\t\t\t\t\tstyleList,\n\t\t\t\t\tlistStyle,\n\t\t\t\t},\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, []);\n\n\t\t// Update flattened nodes when nodes prop changes\n\t\tuseEffect(() => {\n\t\t\tsetFlattenedNodes(computeFlattenedNodes());\n\t\t}, [computeFlattenedNodes, nodes]);\n\n\t\t// Handle node selection\n\t\tconst handleSelect = useCallback(\n\t\t\t({\n\t\t\t\tevent,\n\t\t\t\tdata,\n\t\t\t\tclearSelectedNodes,\n\t\t\t\tfromFocus,\n\t\t\t}: {\n\t\t\t\tevent: React.SyntheticEvent;\n\t\t\t\tdata: TreeSelectData;\n\t\t\t\tclearSelectedNodes?: boolean;\n\t\t\t\tfromFocus?: boolean;\n\t\t\t}) => {\n\t\t\t\t// When triggered by a key event, other nodes should be deselected\n\t\t\t\tif (clearSelectedNodes) {\n\t\t\t\t\tflattenedNodes.forEach((flattenedNode) => {\n\t\t\t\t\t\tif (flattenedNode.node.selected) {\n\t\t\t\t\t\t\tflattenedNode.node.selected = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Prevent firing twice on first click due to focus event\n\t\t\t\tif (!fromFocus) {\n\t\t\t\t\tif (onSelect) {\n\t\t\t\t\t\tonSelect(event, { node: data.node, isSelected: data.select });\n\t\t\t\t\t} else if (onClick) {\n\t\t\t\t\t\tonClick(event, data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update selected and focused nodes\n\t\t\t\tlet newSelectedNodeIndexes: string[];\n\t\t\t\tif (data.select) {\n\t\t\t\t\tnewSelectedNodeIndexes = [...selectedNodeIndexes, data.treeIndex];\n\t\t\t\t} else {\n\t\t\t\t\tnewSelectedNodeIndexes = selectedNodeIndexes.filter(\n\t\t\t\t\t\t(treeIndex) => treeIndex !== data.treeIndex\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\ttreeHasFocusRef.current = true;\n\t\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\t\tsetSelectedNodeIndexes(newSelectedNodeIndexes);\n\t\t\t},\n\t\t\t[flattenedNodes, onSelect, onClick, selectedNodeIndexes]\n\t\t);\n\n\t\t// Handle node blur\n\t\tconst handleNodeBlur = useCallback(() => {\n\t\t\ttreeHasFocusRef.current = false;\n\t\t}, []);\n\n\t\t// Handle expand/collapse\n\t\tconst handleExpand = useCallback(\n\t\t\t({\n\t\t\t\tevent,\n\t\t\t\tdata,\n\t\t\t}: {\n\t\t\t\tevent: React.SyntheticEvent;\n\t\t\t\tdata: TreeExpandData;\n\t\t\t}) => {\n\t\t\t\t// `data.select` marks Left arrow on a collapsed branch or item: move to the parent node.\n\t\t\t\tif (data.select) {\n\t\t\t\t\tif (!onRequestToggle && onExpandClick) {\n\t\t\t\t\t\t// Deprecated behavior: report it to `onExpandClick` with the parent node\n\t\t\t\t\t\ttreeHasFocusRef.current = true;\n\t\t\t\t\t\tonExpandClick(event, data);\n\t\t\t\t\t\tsetFocusedNodeIndex(data.treeIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Not an expand/collapse request: select the parent, like Up/Down arrows do\n\t\t\t\t\t\thandleSelect({\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tnode: data.node,\n\t\t\t\t\t\t\t\tselect: true,\n\t\t\t\t\t\t\t\ttreeIndex: data.treeIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclearSelectedNodes: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttreeHasFocusRef.current = true;\n\t\t\t\tif (onRequestToggle) {\n\t\t\t\t\tonRequestToggle(event, { node: data.node, isExpanded: data.expand });\n\t\t\t\t} else if (onExpandClick) {\n\t\t\t\t\tonExpandClick(event, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\t[handleSelect, onRequestToggle, onExpandClick]\n\t\t);\n\n\t\t// Determine heading text\n\t\tconst headingText = assistiveHeading || visibleHeading;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={id}\n\t\t\t\tclassName={classNames('slds-tree_container', className)}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<h4\n\t\t\t\t\tclassName={classNames('slds-tree__group-header', {\n\t\t\t\t\t\t'slds-assistive-text': !!assistiveHeading,\n\t\t\t\t\t})}\n\t\t\t\t\tid={`${id}__heading`}\n\t\t\t\t>\n\t\t\t\t\t{headingText}\n\t\t\t\t</h4>\n\t\t\t\t<Branch\n\t\t\t\t\tgetNodes={getNodes}\n\t\t\t\t\tinitalClassName={classNames(listClassName, classNameList)}\n\t\t\t\t\thtmlId={id}\n\t\t\t\t\tinitialStyle={\n\t\t\t\t\t\tlistStyle || styleList ? { ...listStyle, ...styleList } : undefined\n\t\t\t\t\t}\n\t\t\t\t\tlevel={0}\n\t\t\t\t\tnode={{ nodes }}\n\t\t\t\t\tflattenedNodes={flattenedNodes}\n\t\t\t\t\tselectedNodeIndexes={selectedNodeIndexes}\n\t\t\t\t\tfocusedNodeIndex={focusedNodeIndex}\n\t\t\t\t\ttreeHasFocus={treeHasFocusRef.current}\n\t\t\t\t\tonNodeBlur={handleNodeBlur}\n\t\t\t\t\tonSelect={handleSelect}\n\t\t\t\t\tonExpand={handleExpand}\n\t\t\t\t\tonScroll={onScroll}\n\t\t\t\t\tsearchTer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,EAAc,GAAO,CAAI;CAE3B,GACA;EAAC;EAAc;EAAiB;CAAa,CAC9C,GAGM,IAAc,KAAoB;CAExC,OACC,kBAAC,OAAD;EACK;EACJ,WAAW,EAAW,uBAAuB,CAAS;EACjD;EAHN,UAAA,CAKC,kBAAC,MAAD;GACC,WAAW,EAAW,2BAA2B,EAChD,uBAAuB,CAAC,CAAC,EAC1B,CAAC;GACD,IAAI,GAAG,EAAG;GAET,UAAA;EACE,CAAA,GACJ,kBAAC,GAAD;GACW;GACV,iBAAiB,EAAW,GAAe,CAAa;GACxD,QAAQ;GACR,cACC,KAAa,IAAY;IAAE,GAAG;IAAW,GAAG;GAAU,IAAI,KAAA;GAE3D,OAAO;GACP,MAAM,EAAE,SAAM;GACE;GACK;GACH;GAClB,cAAc,EAAgB;GAC9B,YAAY;GACZ,UAAU;GACV,UAAU;GACA;GACE;GACZ,QAAQ;EACR,CAAA,CACG;;AAEP,CACD;AAEA,EAAK,cAAc"}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { VERTICAL_NAVIGATION as e } from "../../utilities/constants.js";
|
|
2
2
|
import t from "./private/item.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
3
|
+
import { forwardRef as n, useId as r, useMemo as i } from "react";
|
|
4
|
+
import a from "classnames";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
//#region components/vertical-navigation/index.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
7
|
+
var c = n(({ categories: e, className: n, id: c, onSelect: l, selectedId: u }, d) => {
|
|
8
|
+
let f = r(), p = c || f, m = i(() => {
|
|
9
9
|
if (u) return u;
|
|
10
10
|
if (e.length > 0 && e[0].items?.length > 0) return e[0].items[0].id;
|
|
11
11
|
}, [u, e]);
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
id:
|
|
14
|
-
className:
|
|
12
|
+
return /* @__PURE__ */ o("nav", {
|
|
13
|
+
id: p,
|
|
14
|
+
className: a("slds-nav-vertical", n),
|
|
15
|
+
ref: d,
|
|
15
16
|
children: e.map((e) => {
|
|
16
|
-
let n = `${
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
let n = `${p}-${e.id}`;
|
|
18
|
+
return /* @__PURE__ */ s("div", {
|
|
18
19
|
className: "slds-nav-vertical__section",
|
|
19
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ o("h2", {
|
|
20
21
|
id: n,
|
|
21
22
|
className: "slds-nav-vertical__title",
|
|
22
23
|
children: e.label
|
|
23
|
-
}), /* @__PURE__ */
|
|
24
|
+
}), /* @__PURE__ */ o("ul", { children: e.items.map((e) => /* @__PURE__ */ o(t, {
|
|
24
25
|
item: e,
|
|
25
|
-
isSelected: e.id ===
|
|
26
|
+
isSelected: e.id === m,
|
|
26
27
|
categoryId: n,
|
|
27
28
|
onSelect: l
|
|
28
29
|
}, e.id)) }, n)]
|
|
29
30
|
}, `${n}-header`);
|
|
30
31
|
})
|
|
31
32
|
});
|
|
32
|
-
};
|
|
33
|
-
|
|
33
|
+
});
|
|
34
|
+
c.displayName = e;
|
|
34
35
|
//#endregion
|
|
35
|
-
export {
|
|
36
|
+
export { c as default };
|
|
36
37
|
|
|
37
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/vertical-navigation/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/vertical-navigation/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport {\n\tforwardRef,\n\tuseId,\n\tuseMemo,\n\ttype MouseEvent,\n\ttype ReactElement,\n} from 'react';\nimport classNames from 'classnames';\nimport { VERTICAL_NAVIGATION } from '../../utilities/constants';\nimport type { BadgeProps } from '../badge';\nimport type { IconProps } from '../icon';\nimport Item from './private/item';\n\n/**\n * Navigation item structure\n */\nexport interface NavigationItem {\n\t/** Unique identifier */\n\tid: string;\n\t/** Display label */\n\tlabel: string;\n\t/** URL for the link */\n\turl: string;\n\t/** `Icon` rendered before the label. Its `size` sets the right margin. */\n\ticon?: ReactElement<IconProps>;\n\t/** `Badge` rendered after the label, aligned right */\n\tnotificationBadge?: ReactElement<BadgeProps>;\n}\n\n/**\n * Navigation category structure\n */\nexport interface NavigationCategory {\n\t/** Unique identifier */\n\tid: string;\n\t/** Category label */\n\tlabel: string;\n\t/** Items in this category */\n\titems: NavigationItem[];\n}\n\n/**\n * Selection event data\n */\nexport interface NavigationSelectData {\n\titem: NavigationItem;\n}\n\n/**\n * Props for the VerticalNavigation component\n */\nexport interface VerticalNavigationProps {\n\t/** Array of navigation categories */\n\tcategories: NavigationCategory[];\n\t/** CSS classes for the root `nav.slds-nav-vertical` element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Selection callback */\n\tonSelect?: (\n\t\tevent: MouseEvent<HTMLAnchorElement>,\n\t\tdata: NavigationSelectData\n\t) => void;\n\t/** Currently selected item ID */\n\tselectedId?: string;\n}\n\n/**\n * Vertical Navigation represents a list of links that either take the user\n * to another page or parts of the page the user is in.\n */\nconst VerticalNavigation = forwardRef<HTMLElement, VerticalNavigationProps>(\n\t(\n\t\t{ categories, className, id: propId, onSelect, selectedId: propSelectedId },\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst rootId = propId || generatedId;\n\n\t\t// Determine selected ID (default to first item if not specified)\n\t\tconst selectedId = useMemo(() => {\n\t\t\tif (propSelectedId) {\n\t\t\t\treturn propSelectedId;\n\t\t\t}\n\t\t\tif (categories.length > 0 && categories[0].items?.length > 0) {\n\t\t\t\treturn categories[0].items[0].id;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}, [propSelectedId, categories]);\n\n\t\treturn (\n\t\t\t<nav\n\t\t\t\tid={rootId}\n\t\t\t\tclassName={classNames('slds-nav-vertical', className)}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{categories.map((category) => {\n\t\t\t\t\tconst categoryId = `${rootId}-${category.id}`;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={`${categoryId}-header`}\n\t\t\t\t\t\t\tclassName=\"slds-nav-vertical__section\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 id={categoryId} className=\"slds-nav-vertical__title\">\n\t\t\t\t\t\t\t\t{category.label}\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t<ul key={categoryId}>\n\t\t\t\t\t\t\t\t{category.items.map((item) => (\n\t\t\t\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\t\tisSelected={item.id === selectedId}\n\t\t\t\t\t\t\t\t\t\tcategoryId={categoryId}\n\t\t\t\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</nav>\n\t\t);\n\t}\n);\n\nVerticalNavigation.displayName = VERTICAL_NAVIGATION;\n\nexport default VerticalNavigation;\n"],"mappings":";;;;;;AA0EA,IAAM,IAAqB,GAEzB,EAAE,eAAY,cAAW,IAAI,GAAQ,aAAU,YAAY,KAC3D,MACI;CACJ,IAAM,IAAc,EAAM,GACpB,IAAS,KAAU,GAGnB,IAAa,QAAc;EAChC,IAAI,GACH,OAAO;EAER,IAAI,EAAW,SAAS,KAAK,EAAW,EAAE,CAAC,OAAO,SAAS,GAC1D,OAAO,EAAW,EAAE,CAAC,MAAM,EAAE,CAAC;CAGhC,GAAG,CAAC,GAAgB,CAAU,CAAC;CAE/B,OACC,kBAAC,OAAD;EACC,IAAI;EACJ,WAAW,EAAW,qBAAqB,CAAS;EAC/C;EAEJ,UAAA,EAAW,KAAK,MAAa;GAC7B,IAAM,IAAa,GAAG,EAAO,GAAG,EAAS;GACzC,OACC,kBAAC,OAAD;IAEC,WAAU;IAFX,UAAA,CAIC,kBAAC,MAAD;KAAI,IAAI;KAAY,WAAU;KAC5B,UAAA,EAAS;IACP,CAAA,GACJ,kBAAC,MAAD,EAAA,UACE,EAAS,MAAM,KAAK,MACpB,kBAAC,GAAD;KAEO;KACN,YAAY,EAAK,OAAO;KACZ;KACF;IACV,GALK,EAAK,EAKV,CACD,EACE,GAVK,CAUL,CACA;GAjBC,GAAA,GAAG,EAAW,QAiBf;EAEP,CAAC;CACG,CAAA;AAEP,CACD;AAEA,EAAmB,cAAc"}
|
|
@@ -3,96 +3,97 @@ import t from "../modal/index.js";
|
|
|
3
3
|
import n from "../progress-bar/index.js";
|
|
4
4
|
import r from "./check-props.js";
|
|
5
5
|
import i from "./component.js";
|
|
6
|
-
import a, {
|
|
7
|
-
import
|
|
8
|
-
import { Fragment as
|
|
6
|
+
import a, { forwardRef as o, useEffect as s, useId as c, useMemo as l } from "react";
|
|
7
|
+
import u from "classnames";
|
|
8
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
9
|
//#region components/welcome-mat/index.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
...
|
|
10
|
+
var m = { unitsCompletedAfter: "units completed" }, h = o(({ children: o, className: h, doNotShowAgainCheckbox: g, id: _, infoActions: v, infoBadge: y, isOpen: b = !0, labels: x, onRequestClose: S, onRenderInfoActions: C, variant: w = "steps" }, T) => {
|
|
11
|
+
let E = c(), D = _ || E, O = {
|
|
12
|
+
...m,
|
|
13
13
|
...x
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
s(() => {
|
|
16
16
|
r(e, { onRenderInfoActions: C }, i);
|
|
17
17
|
}, [C]);
|
|
18
|
-
let { totalSteps:
|
|
19
|
-
let e = a.Children.count(
|
|
18
|
+
let { totalSteps: k, completedSteps: A, progress: j } = l(() => {
|
|
19
|
+
let e = a.Children.count(o), t = a.Children.toArray(o).filter((e) => a.isValidElement(e) && e.props.isComplete).length;
|
|
20
20
|
return {
|
|
21
21
|
totalSteps: e,
|
|
22
22
|
completedSteps: t,
|
|
23
23
|
progress: e > 0 ? t / e * 100 : 0
|
|
24
24
|
};
|
|
25
|
-
}, [
|
|
26
|
-
className:
|
|
27
|
-
id: `${
|
|
25
|
+
}, [o]), M = /* @__PURE__ */ p("div", {
|
|
26
|
+
className: "slds-welcome-mat__info-content",
|
|
27
|
+
id: `${D}-content`,
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ f("h2", {
|
|
30
30
|
className: "slds-welcome-mat__info-title",
|
|
31
|
-
id: `${
|
|
32
|
-
children:
|
|
31
|
+
id: `${D}-label`,
|
|
32
|
+
children: O.title
|
|
33
33
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ f("div", {
|
|
35
35
|
className: "slds-welcome-mat__info-description slds-text-longform",
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ f("p", { children: O.description })
|
|
37
37
|
}),
|
|
38
|
-
(w === "info-only" || w === "splash") && /* @__PURE__ */
|
|
38
|
+
(w === "info-only" || w === "splash") && /* @__PURE__ */ p("div", {
|
|
39
39
|
className: "slds-welcome-mat__info-actions",
|
|
40
|
-
children: [v ?? C?.(), g && /* @__PURE__ */
|
|
40
|
+
children: [v ?? C?.(), g && /* @__PURE__ */ f("div", {
|
|
41
41
|
className: "slds-m-top_large",
|
|
42
42
|
children: g
|
|
43
43
|
})]
|
|
44
44
|
}),
|
|
45
|
-
(w === "steps" || w === "trailhead-connected") &&
|
|
46
|
-
className:
|
|
47
|
-
children: [w === "trailhead-connected" && a.Children.map(y, (e) => a.isValidElement(e) ? a.cloneElement(e, { isComplete:
|
|
48
|
-
|
|
45
|
+
(w === "steps" || w === "trailhead-connected") && o && /* @__PURE__ */ p("div", {
|
|
46
|
+
className: u("slds-welcome-mat__info-progress", { "slds-welcome-mat__info-progress_complete": A === k }),
|
|
47
|
+
children: [w === "trailhead-connected" && a.Children.map(y, (e) => a.isValidElement(e) ? a.cloneElement(e, { isComplete: A === k || void 0 }) : e), (A !== k || w !== "trailhead-connected") && /* @__PURE__ */ p(d, { children: [w === "trailhead-connected" ? /* @__PURE__ */ p("p", { children: [
|
|
48
|
+
A,
|
|
49
49
|
"/",
|
|
50
|
-
O,
|
|
51
|
-
" ",
|
|
52
|
-
D.unitsCompletedAfter
|
|
53
|
-
] }) : /* @__PURE__ */ d("p", { children: /* @__PURE__ */ f("strong", { children: [
|
|
54
50
|
k,
|
|
51
|
+
" ",
|
|
52
|
+
O.unitsCompletedAfter
|
|
53
|
+
] }) : /* @__PURE__ */ f("p", { children: /* @__PURE__ */ p("strong", { children: [
|
|
54
|
+
A,
|
|
55
55
|
"/",
|
|
56
|
-
|
|
56
|
+
k,
|
|
57
57
|
" ",
|
|
58
|
-
|
|
59
|
-
] }) }), /* @__PURE__ */
|
|
60
|
-
value:
|
|
58
|
+
O.unitsCompletedAfter
|
|
59
|
+
] }) }), /* @__PURE__ */ f(n, {
|
|
60
|
+
value: j,
|
|
61
61
|
radius: "circular"
|
|
62
62
|
})] })]
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
65
|
});
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
assistiveText: { dialogLabelledBy: `${
|
|
66
|
+
return /* @__PURE__ */ f(t, {
|
|
67
|
+
assistiveText: { dialogLabelledBy: `${D}-label` },
|
|
68
68
|
isOpen: b,
|
|
69
69
|
onRequestClose: S,
|
|
70
70
|
size: "small",
|
|
71
|
-
id: `${
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
className:
|
|
71
|
+
id: `${D}-modal`,
|
|
72
|
+
children: /* @__PURE__ */ f("div", {
|
|
73
|
+
className: u("slds-welcome-mat", {
|
|
74
74
|
"slds-welcome-mat_info-only": w === "info-only",
|
|
75
|
-
"slds-welcome-mat_splash": !
|
|
76
|
-
}),
|
|
77
|
-
id:
|
|
78
|
-
|
|
75
|
+
"slds-welcome-mat_splash": !o
|
|
76
|
+
}, h),
|
|
77
|
+
id: D,
|
|
78
|
+
ref: T,
|
|
79
|
+
children: /* @__PURE__ */ f("div", {
|
|
79
80
|
className: "slds-welcome-mat__content slds-grid",
|
|
80
|
-
children:
|
|
81
|
+
children: o ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
|
|
81
82
|
className: "slds-welcome-mat__info slds-size_1-of-2",
|
|
82
|
-
children:
|
|
83
|
-
}), /* @__PURE__ */
|
|
84
|
-
className:
|
|
85
|
-
children: a.Children.map(
|
|
86
|
-
})] }) : /* @__PURE__ */
|
|
83
|
+
children: M
|
|
84
|
+
}), /* @__PURE__ */ f("div", {
|
|
85
|
+
className: u("slds-welcome-mat__tiles", "slds-size_1-of-2", { "slds-welcome-mat__tiles_info-only": w === "info-only" }),
|
|
86
|
+
children: a.Children.map(o, (e) => a.isValidElement(e) ? a.cloneElement(e, { variant: w }) : e)
|
|
87
|
+
})] }) : /* @__PURE__ */ f("div", {
|
|
87
88
|
className: "slds-welcome-mat__info slds-size_1-of-1",
|
|
88
|
-
children:
|
|
89
|
+
children: M
|
|
89
90
|
})
|
|
90
91
|
})
|
|
91
92
|
})
|
|
92
93
|
});
|
|
93
|
-
};
|
|
94
|
-
|
|
94
|
+
});
|
|
95
|
+
h.displayName = e;
|
|
95
96
|
//#endregion
|
|
96
|
-
export {
|
|
97
|
+
export { h as default };
|
|
97
98
|
|
|
98
99
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/welcome-mat/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\nimport classNames from 'classnames';\nimport Modal, {\n\ttype ModalRequestCloseData,\n\ttype ModalRequestCloseEvent,\n\ttype ModalRequestCloseTrigger,\n} from '../modal';\nimport ProgressBar from '../progress-bar';\nimport { WELCOME_MAT } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Welcome mat variant types\n */\nexport type WelcomeMatVariant =\n\t'steps' | 'info-only' | 'splash' | 'trailhead-connected';\n\n/**\n * Labels for WelcomeMat\n */\nexport interface WelcomeMatLabels {\n\t/** Title text */\n\ttitle?: string;\n\t/** Description text */\n\tdescription?: string;\n\t/** Text after units completed number */\n\tunitsCompletedAfter?: string;\n}\n\n/**\n * What caused a WelcomeMat close request (same as the underlying Modal's)\n */\nexport type WelcomeMatRequestCloseTrigger = ModalRequestCloseTrigger;\n\n/**\n * Data passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseData = ModalRequestCloseData;\n\n/**\n * Event passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseEvent = ModalRequestCloseEvent;\n\ninterface WelcomeMatBaseProps {\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether modal is open */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: WelcomeMatLabels;\n\t/**\n\t * Close request handler, forwarded from the underlying Modal. Receives the triggering\n\t * click or keydown event and `data.trigger`: `'close-button'`, `'escape'`, or `'click-outside'`.\n\t */\n\tonRequestClose?: (\n\t\tevent: WelcomeMatRequestCloseEvent,\n\t\tdata: WelcomeMatRequestCloseData\n\t) => void;\n}\n\n/**\n * `variant` decides what the info panel shows. `steps` and\n * `trailhead-connected` show progress through `WelcomeMatTile` children;\n * `info-only` and `splash` show actions instead.\n */\nexport type WelcomeMatVariantProps =\n\t| {\n\t\t\t/** Tiles with a progress bar */\n\t\t\tvariant?: 'steps';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\tinfoBadge?: never;\n\t\t\tinfoActions?: never;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with Trailhead progress and an info badge */\n\t\t\tvariant: 'trailhead-connected';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\t/** WelcomeMatInfoBadge shown above the progress */\n\t\t\tinfoBadge?: ReactNode;\n\t\t\tinfoActions?: never;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with actions instead of progress */\n\t\t\tvariant: 'info-only';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Actions shown below the description */\n\t\t\tinfoActions?: ReactNode;\n\t\t\t/** @deprecated Use `infoActions` instead. */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t }\n\t| {\n\t\t\t/** Info panel only, with actions and no tiles */\n\t\t\tvariant: 'splash';\n\t\t\tchildren?: never;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Actions shown below the description */\n\t\t\tinfoActions?: ReactNode;\n\t\t\t/** @deprecated Use `infoActions` instead. */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t };\n\n/**\n * Props for the WelcomeMat component\n */\nexport type WelcomeMatProps = WelcomeMatBaseProps & WelcomeMatVariantProps;\n\nconst defaultLabels: WelcomeMatLabels = {\n\tunitsCompletedAfter: 'units completed',\n};\n\n/**\n * A Welcome Mat provides a series of unordered items a user can click to learn about a thematic topic.\n */\nconst WelcomeMat = ({\n\tchildren,\n\tclassName,\n\tdoNotShowAgainCheckbox,\n\tid: propId,\n\tinfoActions,\n\tinfoBadge,\n\tisOpen = true,\n\tlabels: propLabels,\n\tonRequestClose,\n\tonRenderInfoActions,\n\tvariant = 'steps',\n}: WelcomeMatProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tuseEffect(() => {\n\t\tcheckProps(WELCOME_MAT, { onRenderInfoActions }, componentDoc);\n\t}, [onRenderInfoActions]);\n\n\t// Calculate progress from children\n\tconst { totalSteps, completedSteps, progress } = useMemo(() => {\n\t\tconst total = React.Children.count(children);\n\t\tconst completed = React.Children.toArray(children).filter(\n\t\t\t(c) =>\n\t\t\t\tReact.isValidElement(c) &&\n\t\t\t\t(c.props as { isComplete?: boolean }).isComplete\n\t\t).length;\n\t\treturn {\n\t\t\ttotalSteps: total,\n\t\t\tcompletedSteps: completed,\n\t\t\tprogress: total > 0 ? (completed / total) * 100 : 0,\n\t\t};\n\t}, [children]);\n\n\tconst splash = (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-welcome-mat__info-content',\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tid={`${id}-content`}\n\t\t>\n\t\t\t<h2 className=\"slds-welcome-mat__info-title\" id={`${id}-label`}>\n\t\t\t\t{labels.title}\n\t\t\t</h2>\n\t\t\t<div className=\"slds-welcome-mat__info-description slds-text-longform\">\n\t\t\t\t<p>{labels.description}</p>\n\t\t\t</div>\n\t\t\t{(variant === 'info-only' || variant === 'splash') && (\n\t\t\t\t<div className=\"slds-welcome-mat__info-actions\">\n\t\t\t\t\t{infoActions ?? onRenderInfoActions?.()}\n\t\t\t\t\t{doNotShowAgainCheckbox && (\n\t\t\t\t\t\t<div className=\"slds-m-top_large\">{doNotShowAgainCheckbox}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{(variant === 'steps' || variant === 'trailhead-connected') &&\n\t\t\t\tchildren && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={classNames('slds-welcome-mat__info-progress', {\n\t\t\t\t\t\t\t'slds-welcome-mat__info-progress_complete':\n\t\t\t\t\t\t\t\tcompletedSteps === totalSteps,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t{variant === 'trailhead-connected' &&\n\t\t\t\t\t\t\tReact.Children.map(infoBadge, (child) =>\n\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{ isComplete?: boolean }>,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tisComplete: completedSteps === totalSteps || undefined,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t{(completedSteps !== totalSteps ||\n\t\t\t\t\t\t\tvariant !== 'trailhead-connected') && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{variant === 'trailhead-connected' ? (\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<ProgressBar value={progress} radius=\"circular\" />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<Modal\n\t\t\tassistiveText={{\n\t\t\t\tdialogLabelledBy: `${id}-label`,\n\t\t\t}}\n\t\t\tisOpen={isOpen}\n\t\t\tonRequestClose={onRequestClose}\n\t\t\tsize=\"small\"\n\t\t\tid={`${id}-modal`}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames('slds-welcome-mat', {\n\t\t\t\t\t'slds-welcome-mat_info-only': variant === 'info-only',\n\t\t\t\t\t'slds-welcome-mat_splash': !children,\n\t\t\t\t})}\n\t\t\t\tid={id}\n\t\t\t>\n\t\t\t\t<div className=\"slds-welcome-mat__content slds-grid\">\n\t\t\t\t\t{children ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-2\">\n\t\t\t\t\t\t\t\t{splash}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles',\n\t\t\t\t\t\t\t\t\t'slds-size_1-of-2',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles_info-only':\n\t\t\t\t\t\t\t\t\t\t\tvariant === 'info-only',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{React.Children.map(children, (child) =>\n\t\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{ variant?: WelcomeMatVariant }>,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-1\">\n\t\t\t\t\t\t\t{splash}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n};\n\nWelcomeMat.displayName = WELCOME_MAT;\n\nexport default WelcomeMat;\n"],"mappings":";;;;;;;;;AAmIA,IAAM,IAAkC,EACvC,qBAAqB,kBACtB,GAKM,KAAc,EACnB,aACA,cACA,2BACA,IAAI,GACJ,gBACA,cACA,YAAS,IACT,QAAQ,GACR,mBACA,wBACA,aAAU,cACgC;CAC1C,IAAM,IAAc,EAAM,GACpB,IAAK,KAAU,GACf,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW;CAEjD,QAAgB;EACf,EAAW,GAAa,EAAE,uBAAoB,GAAG,CAAY;CAC9D,GAAG,CAAC,CAAmB,CAAC;CAGxB,IAAM,EAAE,eAAY,mBAAgB,gBAAa,QAAc;EAC9D,IAAM,IAAQ,EAAM,SAAS,MAAM,CAAQ,GACrC,IAAY,EAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,QACjD,MACA,EAAM,eAAe,CAAC,KACrB,EAAE,MAAmC,UACxC,CAAC,CAAC;EACF,OAAO;GACN,YAAY;GACZ,gBAAgB;GAChB,UAAU,IAAQ,IAAK,IAAY,IAAS,MAAM;EACnD;CACD,GAAG,CAAC,CAAQ,CAAC,GAEP,IACL,kBAAC,OAAD;EACC,WAAW,EACV,kCACA,CACD;EACA,IAAI,GAAG,EAAG;EALX,UAAA;GAOC,kBAAC,MAAD;IAAI,WAAU;IAA+B,IAAI,GAAG,EAAG;I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AAU;KACb,UAAA;IACG,CAAA,GACL,kBAAC,OAAD;KACC,WAAW,EACV,2BACA,oBACA,EACC,qCACC,MAAY,YACd,CACD;KAEC,UAAA,EAAM,SAAS,IAAI,IAAW,MAC9B,EAAM,eAAe,CAAK,IACvB,EAAM,aACN,GACA,EACC,WACD,CACD,IACC,CACJ;IACI,CAAA,CACJ,EAAA,CAAA,IAEF,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA;GAEF,CAAA;EACD,CAAA;CACC,CAAA;AAET;AAEA,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/welcome-mat/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\ttype ReactNode,\n\ttype ReactElement,\n} from 'react';\nimport classNames from 'classnames';\nimport Modal, {\n\ttype ModalRequestCloseData,\n\ttype ModalRequestCloseEvent,\n\ttype ModalRequestCloseTrigger,\n} from '../modal';\nimport ProgressBar from '../progress-bar';\nimport { WELCOME_MAT } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Welcome mat variant types\n */\nexport type WelcomeMatVariant =\n\t'steps' | 'info-only' | 'splash' | 'trailhead-connected';\n\n/**\n * Labels for WelcomeMat\n */\nexport interface WelcomeMatLabels {\n\t/** Title text */\n\ttitle?: string;\n\t/** Description text */\n\tdescription?: string;\n\t/** Text after units completed number */\n\tunitsCompletedAfter?: string;\n}\n\n/**\n * What caused a WelcomeMat close request (same as the underlying Modal's)\n */\nexport type WelcomeMatRequestCloseTrigger = ModalRequestCloseTrigger;\n\n/**\n * Data passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseData = ModalRequestCloseData;\n\n/**\n * Event passed to `onRequestClose` (forwarded from the underlying Modal)\n */\nexport type WelcomeMatRequestCloseEvent = ModalRequestCloseEvent;\n\ninterface WelcomeMatBaseProps {\n\t/** CSS classes for the root `.slds-welcome-mat` div */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Whether modal is open */\n\tisOpen?: boolean;\n\t/** Text labels */\n\tlabels?: WelcomeMatLabels;\n\t/**\n\t * Close request handler, forwarded from the underlying Modal. Receives the triggering\n\t * click or keydown event and `data.trigger`: `'close-button'`, `'escape'`, or `'click-outside'`.\n\t */\n\tonRequestClose?: (\n\t\tevent: WelcomeMatRequestCloseEvent,\n\t\tdata: WelcomeMatRequestCloseData\n\t) => void;\n}\n\n/**\n * `variant` decides what the info panel shows. `steps` and\n * `trailhead-connected` show progress through `WelcomeMatTile` children;\n * `info-only` and `splash` show actions instead.\n */\nexport type WelcomeMatVariantProps =\n\t| {\n\t\t\t/** Tiles with a progress bar */\n\t\t\tvariant?: 'steps';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\tinfoBadge?: never;\n\t\t\tinfoActions?: never;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with Trailhead progress and an info badge */\n\t\t\tvariant: 'trailhead-connected';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\tdoNotShowAgainCheckbox?: never;\n\t\t\t/** WelcomeMatInfoBadge shown above the progress */\n\t\t\tinfoBadge?: ReactNode;\n\t\t\tinfoActions?: never;\n\t\t\tonRenderInfoActions?: never;\n\t }\n\t| {\n\t\t\t/** Tiles with actions instead of progress */\n\t\t\tvariant: 'info-only';\n\t\t\t/** WelcomeMatTile children */\n\t\t\tchildren: ReactNode;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Actions shown below the description */\n\t\t\tinfoActions?: ReactNode;\n\t\t\t/** @deprecated Use `infoActions` instead. */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t }\n\t| {\n\t\t\t/** Info panel only, with actions and no tiles */\n\t\t\tvariant: 'splash';\n\t\t\tchildren?: never;\n\t\t\t/** Do not show again checkbox element */\n\t\t\tdoNotShowAgainCheckbox?: ReactNode;\n\t\t\tinfoBadge?: never;\n\t\t\t/** Actions shown below the description */\n\t\t\tinfoActions?: ReactNode;\n\t\t\t/** @deprecated Use `infoActions` instead. */\n\t\t\tonRenderInfoActions?: () => ReactNode;\n\t };\n\n/**\n * Props for the WelcomeMat component\n */\nexport type WelcomeMatProps = WelcomeMatBaseProps & WelcomeMatVariantProps;\n\nconst defaultLabels: WelcomeMatLabels = {\n\tunitsCompletedAfter: 'units completed',\n};\n\n/**\n * A Welcome Mat provides a series of unordered items a user can click to learn about a thematic topic.\n */\nconst WelcomeMat = forwardRef<HTMLDivElement, WelcomeMatProps>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdoNotShowAgainCheckbox,\n\t\t\tid: propId,\n\t\t\tinfoActions,\n\t\t\tinfoBadge,\n\t\t\tisOpen = true,\n\t\t\tlabels: propLabels,\n\t\t\tonRequestClose,\n\t\t\tonRenderInfoActions,\n\t\t\tvariant = 'steps',\n\t\t},\n\t\tref\n\t) => {\n\t\tconst generatedId = useId();\n\t\tconst id = propId || generatedId;\n\t\tconst labels = { ...defaultLabels, ...propLabels };\n\n\t\tuseEffect(() => {\n\t\t\tcheckProps(WELCOME_MAT, { onRenderInfoActions }, componentDoc);\n\t\t}, [onRenderInfoActions]);\n\n\t\t// Calculate progress from children\n\t\tconst { totalSteps, completedSteps, progress } = useMemo(() => {\n\t\t\tconst total = React.Children.count(children);\n\t\t\tconst completed = React.Children.toArray(children).filter(\n\t\t\t\t(c) =>\n\t\t\t\t\tReact.isValidElement(c) &&\n\t\t\t\t\t(c.props as { isComplete?: boolean }).isComplete\n\t\t\t).length;\n\t\t\treturn {\n\t\t\t\ttotalSteps: total,\n\t\t\t\tcompletedSteps: completed,\n\t\t\t\tprogress: total > 0 ? (completed / total) * 100 : 0,\n\t\t\t};\n\t\t}, [children]);\n\n\t\tconst splash = (\n\t\t\t<div className=\"slds-welcome-mat__info-content\" id={`${id}-content`}>\n\t\t\t\t<h2 className=\"slds-welcome-mat__info-title\" id={`${id}-label`}>\n\t\t\t\t\t{labels.title}\n\t\t\t\t</h2>\n\t\t\t\t<div className=\"slds-welcome-mat__info-description slds-text-longform\">\n\t\t\t\t\t<p>{labels.description}</p>\n\t\t\t\t</div>\n\t\t\t\t{(variant === 'info-only' || variant === 'splash') && (\n\t\t\t\t\t<div className=\"slds-welcome-mat__info-actions\">\n\t\t\t\t\t\t{infoActions ?? onRenderInfoActions?.()}\n\t\t\t\t\t\t{doNotShowAgainCheckbox && (\n\t\t\t\t\t\t\t<div className=\"slds-m-top_large\">{doNotShowAgainCheckbox}</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{(variant === 'steps' || variant === 'trailhead-connected') &&\n\t\t\t\t\tchildren && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames('slds-welcome-mat__info-progress', {\n\t\t\t\t\t\t\t\t'slds-welcome-mat__info-progress_complete':\n\t\t\t\t\t\t\t\t\tcompletedSteps === totalSteps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{variant === 'trailhead-connected' &&\n\t\t\t\t\t\t\t\tReact.Children.map(infoBadge, (child) =>\n\t\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{ isComplete?: boolean }>,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tisComplete:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompletedSteps === totalSteps || undefined,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{(completedSteps !== totalSteps ||\n\t\t\t\t\t\t\t\tvariant !== 'trailhead-connected') && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{variant === 'trailhead-connected' ? (\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps} {labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t\t{completedSteps}/{totalSteps}{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t{labels.unitsCompletedAfter}\n\t\t\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<ProgressBar value={progress} radius=\"circular\" />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tassistiveText={{\n\t\t\t\t\tdialogLabelledBy: `${id}-label`,\n\t\t\t\t}}\n\t\t\t\tisOpen={isOpen}\n\t\t\t\tonRequestClose={onRequestClose}\n\t\t\t\tsize=\"small\"\n\t\t\t\tid={`${id}-modal`}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-welcome-mat',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-welcome-mat_info-only': variant === 'info-only',\n\t\t\t\t\t\t\t'slds-welcome-mat_splash': !children,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tid={id}\n\t\t\t\t\tref={ref}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"slds-welcome-mat__content slds-grid\">\n\t\t\t\t\t\t{children ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-2\">\n\t\t\t\t\t\t\t\t\t{splash}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles',\n\t\t\t\t\t\t\t\t\t\t'slds-size_1-of-2',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'slds-welcome-mat__tiles_info-only':\n\t\t\t\t\t\t\t\t\t\t\t\tvariant === 'info-only',\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{React.Children.map(children, (child) =>\n\t\t\t\t\t\t\t\t\t\tReact.isValidElement(child)\n\t\t\t\t\t\t\t\t\t\t\t? React.cloneElement(\n\t\t\t\t\t\t\t\t\t\t\t\t\tchild as ReactElement<{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant?: WelcomeMatVariant;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}>,\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t: child\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"slds-welcome-mat__info slds-size_1-of-1\">\n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kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA;GAEF,CAAA;EACD,CAAA;CACC,CAAA;AAET,CACD;AAEA,EAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../../components/color-picker/color-picker.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAmBf,OAAO,EAEN,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAEjB,UAAU,oBAAoB;IAC7B,uCAAuC;IACvC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D,kCAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gCAAgC;IAChC,YAAY,CAAC,EAAE,UAAU,GAAG,yBAAyB,GAAG,UAAU,CAAC;IACnE,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM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AE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../../components/color-picker/color-picker.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAmBf,OAAO,EAEN,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAEjB,UAAU,oBAAoB;IAC7B,uCAAuC;IACvC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D,kCAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sBAAsB;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gCAAgC;IAChC,YAAY,CAAC,EAAE,UAAU,GAAG,yBAAyB,GAAG,UAAU,CAAC;IACnE,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,OAAO,CAAC,EAAE,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|
+
{"version":3,"file":"check-props.d.ts","sourceRoot":"","sources":["../../../../components/modal/check-props.js"],"names":[],"mappings":"AAgBA,QAAA,IAAI,UAAU,YAAmC,CAAC;eAkBnC,UAAU"}
|