@cratis/scene.blueprint.default 4.36.0 → 4.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComponentName.ts +9 -0
- package/defaultBlueprintComponents.ts +4 -1
- package/dist/cjs/ComponentName.js +3 -0
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/defaultBlueprint.js +1 -0
- package/dist/cjs/defaultBlueprint.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +1 -0
- package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponents.js +7 -1
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ApprovalChainStepper.js +130 -0
- package/dist/cjs/foundation/ApprovalChainStepper.js.map +1 -0
- package/dist/cjs/foundation/OrgTree.js +188 -0
- package/dist/cjs/foundation/OrgTree.js.map +1 -0
- package/dist/cjs/foundation/PermissionMatrix.js +136 -0
- package/dist/cjs/foundation/PermissionMatrix.js.map +1 -0
- package/dist/cjs/foundation/approvalModel.js +87 -0
- package/dist/cjs/foundation/approvalModel.js.map +1 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js +21 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +118 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +116 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +12 -1
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/orgModel.js +106 -0
- package/dist/cjs/foundation/orgModel.js.map +1 -0
- package/dist/cjs/foundation/permissionModel.js +84 -0
- package/dist/cjs/foundation/permissionModel.js.map +1 -0
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ComponentName.d.ts +4 -1
- package/dist/esm/ComponentName.d.ts.map +1 -1
- package/dist/esm/ComponentName.js +3 -0
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/defaultBlueprint.js +1 -0
- package/dist/esm/defaultBlueprint.js.map +1 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +1 -0
- package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +7 -1
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ApprovalChainStepper.d.ts +3 -0
- package/dist/esm/foundation/ApprovalChainStepper.d.ts.map +1 -0
- package/dist/esm/foundation/ApprovalChainStepper.js +128 -0
- package/dist/esm/foundation/ApprovalChainStepper.js.map +1 -0
- package/dist/esm/foundation/Foundation.stories.d.ts +8 -0
- package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
- package/dist/esm/foundation/Foundation.stories.js +8 -0
- package/dist/esm/foundation/Foundation.stories.js.map +1 -1
- package/dist/esm/foundation/OrgTree.d.ts +3 -0
- package/dist/esm/foundation/OrgTree.d.ts.map +1 -0
- package/dist/esm/foundation/OrgTree.js +186 -0
- package/dist/esm/foundation/OrgTree.js.map +1 -0
- package/dist/esm/foundation/PermissionMatrix.d.ts +3 -0
- package/dist/esm/foundation/PermissionMatrix.d.ts.map +1 -0
- package/dist/esm/foundation/PermissionMatrix.js +134 -0
- package/dist/esm/foundation/PermissionMatrix.js.map +1 -0
- package/dist/esm/foundation/approvalModel.d.ts +27 -0
- package/dist/esm/foundation/approvalModel.d.ts.map +1 -0
- package/dist/esm/foundation/approvalModel.js +81 -0
- package/dist/esm/foundation/approvalModel.js.map +1 -0
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +21 -0
- package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.js +118 -0
- package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
- package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
- package/dist/esm/foundation/foundationSamples.js +116 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +11 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +12 -1
- package/dist/esm/foundation/foundationStrings.js.map +1 -1
- package/dist/esm/foundation/index.d.ts +6 -0
- package/dist/esm/foundation/index.d.ts.map +1 -1
- package/dist/esm/foundation/index.js +6 -0
- package/dist/esm/foundation/index.js.map +1 -1
- package/dist/esm/foundation/orgModel.d.ts +20 -0
- package/dist/esm/foundation/orgModel.d.ts.map +1 -0
- package/dist/esm/foundation/orgModel.js +99 -0
- package/dist/esm/foundation/orgModel.js.map +1 -0
- package/dist/esm/foundation/permissionModel.d.ts +24 -0
- package/dist/esm/foundation/permissionModel.d.ts.map +1 -0
- package/dist/esm/foundation/permissionModel.js +77 -0
- package/dist/esm/foundation/permissionModel.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ApprovalChainStepper.tsx +66 -0
- package/foundation/Foundation.stories.tsx +8 -0
- package/foundation/OrgTree.tsx +101 -0
- package/foundation/PermissionMatrix.tsx +82 -0
- package/foundation/approvalModel.ts +88 -0
- package/foundation/foundationComponentMetadata.ts +3 -0
- package/foundation/foundationDescriptors.ts +74 -0
- package/foundation/foundationSamples.ts +30 -0
- package/foundation/foundationStrings.ts +11 -0
- package/foundation/index.ts +6 -0
- package/foundation/orgModel.ts +85 -0
- package/foundation/permissionModel.ts +85 -0
- package/package.json +8 -8
- package/shell/layout.css +184 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Foundation.stories.js","sourceRoot":"","sources":["../../../foundation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U,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;AAC1R,MAAM,CAAC,MAAM,4BAA4B,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrgTree.d.ts","sourceRoot":"","sources":["../../../foundation/OrgTree.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAkB,MAAM,qBAAqB,CAAC;AAe/E,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,wBAAwB,+BAiF1F"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo, useState, useEffect } from 'react';
|
|
3
|
+
import { useValueOutput } from '@cratis/scene.react';
|
|
4
|
+
import { readComponentState, ComponentState } from './ComponentState.js';
|
|
5
|
+
import { FoundationIcon } from './FoundationIcon.js';
|
|
6
|
+
import { readFoundationStrings, formatText } from './foundationStrings.js';
|
|
7
|
+
import { readOrgNodes, buildOrgTree, expandedToDepth, visibleNodes, placements, descendantCount } from './orgModel.js';
|
|
8
|
+
import { FoundationFrame } from './StateFrame.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The `orgTree` component: an organization as an expandable tree of people and units.
|
|
12
|
+
*
|
|
13
|
+
* `nodes` are flat rows - `id`, `label`, `title`, `parentId` - as a query returns them; the tree is built from them, so someone whose manager is
|
|
14
|
+
* missing becomes a root and a reporting cycle is cut instead of looping. It follows the ARIA tree pattern: one tab stop, Up and Down move,
|
|
15
|
+
* Right expands or enters, Left collapses or goes to the parent, Home and End jump, Enter or Space selects. Each item says how many reports it
|
|
16
|
+
* has in words. The selected id is published as the `value` output; `expandedDepth` is how many levels are open at first.
|
|
17
|
+
*/ function OrgTree({ element, interactions, bindingOutputs }) {
|
|
18
|
+
const nodes = useMemo(()=>readOrgNodes(element.properties.nodes), [
|
|
19
|
+
element.properties.nodes
|
|
20
|
+
]);
|
|
21
|
+
const roots = useMemo(()=>buildOrgTree(nodes), [
|
|
22
|
+
nodes
|
|
23
|
+
]);
|
|
24
|
+
const depth = typeof element.properties.expandedDepth === 'number' ? element.properties.expandedDepth : 2;
|
|
25
|
+
const initial = useMemo(()=>expandedToDepth(roots, depth), [
|
|
26
|
+
roots,
|
|
27
|
+
depth
|
|
28
|
+
]);
|
|
29
|
+
const [expanded, setExpanded] = useState(initial);
|
|
30
|
+
const [selected, setSelected] = useState(typeof element.properties.selected === 'string' ? element.properties.selected : undefined);
|
|
31
|
+
const [focused, setFocused] = useState(undefined);
|
|
32
|
+
const strings = readFoundationStrings(element);
|
|
33
|
+
const state = readComponentState(element, nodes.length > 0);
|
|
34
|
+
const visible = visibleNodes(roots, expanded);
|
|
35
|
+
const placed = useMemo(()=>placements(roots), [
|
|
36
|
+
roots
|
|
37
|
+
]);
|
|
38
|
+
const tabStop = visible.find((node)=>node.id === focused)?.id ?? visible.find((node)=>node.id === selected)?.id ?? visible[0]?.id;
|
|
39
|
+
const emptyElement = state === ComponentState.Empty ? {
|
|
40
|
+
...element,
|
|
41
|
+
properties: {
|
|
42
|
+
emptyHeadline: strings.orgNone,
|
|
43
|
+
...element.properties
|
|
44
|
+
}
|
|
45
|
+
} : element;
|
|
46
|
+
useEffect(()=>setExpanded(initial), [
|
|
47
|
+
initial
|
|
48
|
+
]);
|
|
49
|
+
useValueOutput(bindingOutputs, selected);
|
|
50
|
+
const move = (node, event)=>{
|
|
51
|
+
const index = visible.indexOf(node);
|
|
52
|
+
const focus = (target)=>{
|
|
53
|
+
if (!target) return;
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
setFocused(target.id);
|
|
56
|
+
requestAnimationFrame(()=>document.getElementById(`${element.id}-${target.id}`)?.focus());
|
|
57
|
+
};
|
|
58
|
+
const toggle = (open)=>setExpanded((current)=>{
|
|
59
|
+
const next = new Set(current);
|
|
60
|
+
if (open) next.add(node.id);
|
|
61
|
+
else next.delete(node.id);
|
|
62
|
+
return next;
|
|
63
|
+
});
|
|
64
|
+
const parent = placed.get(node.id)?.parent;
|
|
65
|
+
switch(event.key){
|
|
66
|
+
case 'ArrowDown':
|
|
67
|
+
focus(visible[index + 1]);
|
|
68
|
+
break;
|
|
69
|
+
case 'ArrowUp':
|
|
70
|
+
focus(visible[index - 1]);
|
|
71
|
+
break;
|
|
72
|
+
case 'Home':
|
|
73
|
+
focus(visible[0]);
|
|
74
|
+
break;
|
|
75
|
+
case 'End':
|
|
76
|
+
focus(visible[visible.length - 1]);
|
|
77
|
+
break;
|
|
78
|
+
case 'ArrowRight':
|
|
79
|
+
if (node.children.length > 0 && !expanded.has(node.id)) {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
toggle(true);
|
|
82
|
+
} else focus(node.children[0]);
|
|
83
|
+
break;
|
|
84
|
+
case 'ArrowLeft':
|
|
85
|
+
if (node.children.length > 0 && expanded.has(node.id)) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
toggle(false);
|
|
88
|
+
} else focus(parent);
|
|
89
|
+
break;
|
|
90
|
+
case 'Enter':
|
|
91
|
+
case ' ':
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
setSelected(node.id);
|
|
94
|
+
interactions?.onSelect?.();
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/ jsx(FoundationFrame, {
|
|
99
|
+
element: emptyElement,
|
|
100
|
+
interactions: interactions,
|
|
101
|
+
name: "org-tree",
|
|
102
|
+
state: state,
|
|
103
|
+
skeleton: [
|
|
104
|
+
50,
|
|
105
|
+
70,
|
|
106
|
+
70,
|
|
107
|
+
60
|
|
108
|
+
],
|
|
109
|
+
children: (state === ComponentState.Ready || state === ComponentState.Partial) && /*#__PURE__*/ jsx("ul", {
|
|
110
|
+
role: "tree",
|
|
111
|
+
"aria-label": strings.orgTree,
|
|
112
|
+
className: "foundation-tree",
|
|
113
|
+
children: visible.map((node)=>{
|
|
114
|
+
const siblings = placed.get(node.id)?.siblings ?? [
|
|
115
|
+
node
|
|
116
|
+
];
|
|
117
|
+
const reports = descendantCount(node);
|
|
118
|
+
const open = expanded.has(node.id);
|
|
119
|
+
return /*#__PURE__*/ jsxs("li", {
|
|
120
|
+
id: `${element.id}-${node.id}`,
|
|
121
|
+
role: "treeitem",
|
|
122
|
+
tabIndex: node.id === tabStop ? 0 : -1,
|
|
123
|
+
"aria-level": node.depth,
|
|
124
|
+
"aria-setsize": siblings.length,
|
|
125
|
+
"aria-posinset": siblings.findIndex((sibling)=>sibling.id === node.id) + 1,
|
|
126
|
+
"aria-expanded": node.children.length > 0 ? open : undefined,
|
|
127
|
+
"aria-selected": node.id === selected,
|
|
128
|
+
className: "foundation-tree-item",
|
|
129
|
+
"data-selected": node.id === selected,
|
|
130
|
+
style: {
|
|
131
|
+
paddingInlineStart: `calc(var(--foundation-space-4) * ${node.depth - 1})`
|
|
132
|
+
},
|
|
133
|
+
onKeyDown: (event)=>move(node, event),
|
|
134
|
+
onFocus: ()=>setFocused(node.id),
|
|
135
|
+
onClick: ()=>{
|
|
136
|
+
setSelected(node.id);
|
|
137
|
+
interactions?.onSelect?.();
|
|
138
|
+
},
|
|
139
|
+
children: [
|
|
140
|
+
node.children.length > 0 ? /*#__PURE__*/ jsx("button", {
|
|
141
|
+
type: "button",
|
|
142
|
+
tabIndex: -1,
|
|
143
|
+
className: "foundation-icon-button",
|
|
144
|
+
"aria-hidden": "true",
|
|
145
|
+
onClick: (event)=>{
|
|
146
|
+
event.stopPropagation();
|
|
147
|
+
setExpanded((current)=>{
|
|
148
|
+
const next = new Set(current);
|
|
149
|
+
if (open) next.delete(node.id);
|
|
150
|
+
else next.add(node.id);
|
|
151
|
+
return next;
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
children: /*#__PURE__*/ jsx(FoundationIcon, {
|
|
155
|
+
name: open ? 'chevron-down' : 'chevron-right'
|
|
156
|
+
})
|
|
157
|
+
}) : /*#__PURE__*/ jsx("span", {
|
|
158
|
+
className: "foundation-tree-spacer"
|
|
159
|
+
}),
|
|
160
|
+
/*#__PURE__*/ jsxs("span", {
|
|
161
|
+
className: "foundation-tree-text",
|
|
162
|
+
children: [
|
|
163
|
+
/*#__PURE__*/ jsx("strong", {
|
|
164
|
+
children: node.label
|
|
165
|
+
}),
|
|
166
|
+
node.title && /*#__PURE__*/ jsx("span", {
|
|
167
|
+
className: "foundation-count",
|
|
168
|
+
children: node.title
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
}),
|
|
172
|
+
reports > 0 && /*#__PURE__*/ jsx("span", {
|
|
173
|
+
className: "foundation-count",
|
|
174
|
+
children: formatText(strings.orgReports, {
|
|
175
|
+
count: reports
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
}, node.id);
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export { OrgTree };
|
|
186
|
+
//# sourceMappingURL=OrgTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrgTree.js","sources":["../../../foundation/OrgTree.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { KeyboardEvent, useEffect, useMemo, useState } from 'react';\nimport { RegisteredComponentProps, useValueOutput } from '@cratis/scene.react';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { FoundationIcon } from './FoundationIcon';\nimport { formatText, readFoundationStrings } from './foundationStrings';\nimport { descendantCount, expandedToDepth, OrgTreeNode, buildOrgTree, placements, readOrgNodes, visibleNodes } from './orgModel';\nimport { FoundationFrame } from './StateFrame';\n\n/**\n * The `orgTree` component: an organization as an expandable tree of people and units.\n *\n * `nodes` are flat rows - `id`, `label`, `title`, `parentId` - as a query returns them; the tree is built from them, so someone whose manager is\n * missing becomes a root and a reporting cycle is cut instead of looping. It follows the ARIA tree pattern: one tab stop, Up and Down move,\n * Right expands or enters, Left collapses or goes to the parent, Home and End jump, Enter or Space selects. Each item says how many reports it\n * has in words. The selected id is published as the `value` output; `expandedDepth` is how many levels are open at first.\n */\nexport function OrgTree({ element, interactions, bindingOutputs }: RegisteredComponentProps) {\n const nodes = useMemo(() => readOrgNodes(element.properties.nodes), [element.properties.nodes]);\n const roots = useMemo(() => buildOrgTree(nodes), [nodes]);\n const depth = typeof element.properties.expandedDepth === 'number' ? element.properties.expandedDepth : 2;\n const initial = useMemo(() => expandedToDepth(roots, depth), [roots, depth]);\n const [expanded, setExpanded] = useState<Set<string>>(initial);\n const [selected, setSelected] = useState<string | undefined>(typeof element.properties.selected === 'string' ? element.properties.selected : undefined);\n const [focused, setFocused] = useState<string | undefined>(undefined);\n const strings = readFoundationStrings(element);\n const state = readComponentState(element, nodes.length > 0);\n const visible = visibleNodes(roots, expanded);\n const placed = useMemo(() => placements(roots), [roots]);\n const tabStop = visible.find(node => node.id === focused)?.id ?? visible.find(node => node.id === selected)?.id ?? visible[0]?.id;\n const emptyElement = state === ComponentState.Empty ? { ...element, properties: { emptyHeadline: strings.orgNone, ...element.properties } } : element;\n\n useEffect(() => setExpanded(initial), [initial]);\n useValueOutput(bindingOutputs, selected);\n\n const move = (node: OrgTreeNode, event: KeyboardEvent) => {\n const index = visible.indexOf(node);\n const focus = (target: OrgTreeNode | undefined) => {\n if (!target) return;\n event.preventDefault();\n setFocused(target.id);\n requestAnimationFrame(() => document.getElementById(`${element.id}-${target.id}`)?.focus());\n };\n const toggle = (open: boolean) => setExpanded(current => { const next = new Set(current); if (open) next.add(node.id); else next.delete(node.id); return next; });\n const parent = placed.get(node.id)?.parent;\n\n switch (event.key) {\n case 'ArrowDown': focus(visible[index + 1]); break;\n case 'ArrowUp': focus(visible[index - 1]); break;\n case 'Home': focus(visible[0]); break;\n case 'End': focus(visible[visible.length - 1]); break;\n case 'ArrowRight':\n if (node.children.length > 0 && !expanded.has(node.id)) { event.preventDefault(); toggle(true); } else focus(node.children[0]);\n break;\n case 'ArrowLeft':\n if (node.children.length > 0 && expanded.has(node.id)) { event.preventDefault(); toggle(false); } else focus(parent);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n setSelected(node.id);\n interactions?.onSelect?.();\n break;\n default: break;\n }\n };\n\n return (\n <FoundationFrame element={emptyElement} interactions={interactions} name='org-tree' state={state} skeleton={[50, 70, 70, 60]}>\n {(state === ComponentState.Ready || state === ComponentState.Partial) && (\n <ul role='tree' aria-label={strings.orgTree} className='foundation-tree'>\n {visible.map(node => {\n const siblings = placed.get(node.id)?.siblings ?? [node];\n const reports = descendantCount(node);\n const open = expanded.has(node.id);\n return (\n <li key={node.id} id={`${element.id}-${node.id}`} role='treeitem' tabIndex={node.id === tabStop ? 0 : -1} aria-level={node.depth}\n aria-setsize={siblings.length} aria-posinset={siblings.findIndex(sibling => sibling.id === node.id) + 1} aria-expanded={node.children.length > 0 ? open : undefined} aria-selected={node.id === selected}\n className='foundation-tree-item' data-selected={node.id === selected} style={{ paddingInlineStart: `calc(var(--foundation-space-4) * ${node.depth - 1})` }}\n onKeyDown={event => move(node, event)} onFocus={() => setFocused(node.id)} onClick={() => { setSelected(node.id); interactions?.onSelect?.(); }}>\n {node.children.length > 0 ? (\n <button type='button' tabIndex={-1} className='foundation-icon-button' aria-hidden='true'\n onClick={event => { event.stopPropagation(); setExpanded(current => { const next = new Set(current); if (open) next.delete(node.id); else next.add(node.id); return next; }); }}>\n <FoundationIcon name={open ? 'chevron-down' : 'chevron-right'} />\n </button>\n ) : <span className='foundation-tree-spacer' />}\n <span className='foundation-tree-text'>\n <strong>{node.label}</strong>\n {node.title && <span className='foundation-count'>{node.title}</span>}\n </span>\n {reports > 0 && <span className='foundation-count'>{formatText(strings.orgReports, { count: reports })}</span>}\n </li>\n );\n })}\n </ul>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["OrgTree","element","interactions","bindingOutputs","nodes","useMemo","readOrgNodes","properties","roots","buildOrgTree","depth","expandedDepth","initial","expandedToDepth","expanded","setExpanded","useState","selected","setSelected","undefined","focused","setFocused","strings","readFoundationStrings","state","readComponentState","length","visible","visibleNodes","placed","placements","tabStop","find","node","id","emptyElement","ComponentState","Empty","emptyHeadline","orgNone","useEffect","useValueOutput","move","event","index","indexOf","focus","target","preventDefault","requestAnimationFrame","document","getElementById","toggle","open","current","next","Set","add","delete","parent","get","key","children","has","onSelect","_jsx","FoundationFrame","name","skeleton","Ready","Partial","ul","role","aria-label","orgTree","className","map","siblings","reports","descendantCount","_jsxs","li","tabIndex","aria-level","aria-setsize","aria-posinset","findIndex","sibling","aria-expanded","aria-selected","data-selected","style","paddingInlineStart","onKeyDown","onFocus","onClick","button","type","aria-hidden","stopPropagation","FoundationIcon","span","strong","label","title","formatText","orgReports","count"],"mappings":";;;;;;;;;AAWA;;;;;;;IAQO,SAASA,OAAAA,CAAQ,EAAEC,OAAO,EAAEC,YAAY,EAAEC,cAAc,EAA4B,EAAA;IACvF,MAAMC,KAAAA,GAAQC,QAAQ,IAAMC,YAAAA,CAAaL,QAAQM,UAAU,CAACH,KAAK,CAAA,EAAG;QAACH,OAAAA,CAAQM,UAAU,CAACH;AAAM,KAAA,CAAA;AAC9F,IAAA,MAAMI,KAAAA,GAAQH,OAAAA,CAAQ,IAAMI,YAAAA,CAAaL,KAAAA,CAAAA,EAAQ;AAACA,QAAAA;AAAM,KAAA,CAAA;AACxD,IAAA,MAAMM,KAAAA,GAAQ,OAAOT,OAAAA,CAAQM,UAAU,CAACI,aAAa,KAAK,QAAA,GAAWV,OAAAA,CAAQM,UAAU,CAACI,aAAa,G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EAAE,EAAE,wBAAwB,+BA4DnG"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo, useState, useEffect, Fragment } from 'react';
|
|
3
|
+
import { useValueOutput } from '@cratis/scene.react';
|
|
4
|
+
import { readComponentState, ComponentState } from './ComponentState.js';
|
|
5
|
+
import { FoundationIcon } from './FoundationIcon.js';
|
|
6
|
+
import { readFoundationStrings, formatText } from './foundationStrings.js';
|
|
7
|
+
import { readRoles, readPermissions, readGrants, sectionsOf, isGranted, setGrant } from './permissionModel.js';
|
|
8
|
+
import { readPermissionRule } from './PermissionRule.js';
|
|
9
|
+
import { FoundationFrame } from './StateFrame.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The `permissionMatrix` component: roles across, permissions down, a checkbox where they meet.
|
|
13
|
+
*
|
|
14
|
+
* `roles` and `permissions` (optionally grouped) give the axes and `grants` - rows of `role` and `permission` - what is held; a grant of a role
|
|
15
|
+
* or permission that does not exist is ignored. Each box is named in words ("Grant Edit deals to Sales") and every header is a real header
|
|
16
|
+
* cell, so a screen reader announces the row and column of the box it is on. Changes are published as the `value` output - the grants,
|
|
17
|
+
* in the same shape - for the screen to save. With `editPermission` not enabled the matrix is read-only and each cell says "Allowed" or
|
|
18
|
+
* "Not allowed" in words and by icon. Wide matrices scroll sideways inside a keyboard-focusable region, keeping the permission column in view.
|
|
19
|
+
*/ function PermissionMatrix({ element, interactions, bindingOutputs }) {
|
|
20
|
+
const roles = useMemo(()=>readRoles(element.properties.roles), [
|
|
21
|
+
element.properties.roles
|
|
22
|
+
]);
|
|
23
|
+
const permissions = useMemo(()=>readPermissions(element.properties.permissions), [
|
|
24
|
+
element.properties.permissions
|
|
25
|
+
]);
|
|
26
|
+
const supplied = useMemo(()=>readGrants(element.properties.grants, roles, permissions), [
|
|
27
|
+
element.properties.grants,
|
|
28
|
+
roles,
|
|
29
|
+
permissions
|
|
30
|
+
]);
|
|
31
|
+
const suppliedKey = JSON.stringify(supplied);
|
|
32
|
+
const [grants, setGrants] = useState(supplied);
|
|
33
|
+
const strings = readFoundationStrings(element);
|
|
34
|
+
const state = readComponentState(element, roles.length > 0 && permissions.length > 0);
|
|
35
|
+
const readOnly = readPermissionRule(element, 'editPermission') !== 'enabled';
|
|
36
|
+
const sections = useMemo(()=>sectionsOf(permissions), [
|
|
37
|
+
permissions
|
|
38
|
+
]);
|
|
39
|
+
useEffect(()=>setGrants(supplied), [
|
|
40
|
+
suppliedKey
|
|
41
|
+
]);
|
|
42
|
+
useValueOutput(bindingOutputs, grants);
|
|
43
|
+
return /*#__PURE__*/ jsx(FoundationFrame, {
|
|
44
|
+
element: element,
|
|
45
|
+
interactions: interactions,
|
|
46
|
+
name: "permission-matrix",
|
|
47
|
+
state: state,
|
|
48
|
+
skeleton: [
|
|
49
|
+
100,
|
|
50
|
+
100,
|
|
51
|
+
100,
|
|
52
|
+
100
|
|
53
|
+
],
|
|
54
|
+
children: (state === ComponentState.Ready || state === ComponentState.Partial) && /*#__PURE__*/ jsx("div", {
|
|
55
|
+
className: "foundation-matrix-scroll",
|
|
56
|
+
role: "region",
|
|
57
|
+
tabIndex: 0,
|
|
58
|
+
"aria-label": strings.matrixScroll,
|
|
59
|
+
children: /*#__PURE__*/ jsxs("table", {
|
|
60
|
+
className: "foundation-matrix",
|
|
61
|
+
children: [
|
|
62
|
+
/*#__PURE__*/ jsx("thead", {
|
|
63
|
+
children: /*#__PURE__*/ jsxs("tr", {
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ jsx("th", {
|
|
66
|
+
scope: "col",
|
|
67
|
+
children: strings.matrixPermission
|
|
68
|
+
}),
|
|
69
|
+
roles.map((role)=>/*#__PURE__*/ jsx("th", {
|
|
70
|
+
scope: "col",
|
|
71
|
+
children: role.label
|
|
72
|
+
}, role.id))
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ jsx("tbody", {
|
|
77
|
+
children: sections.map((section, index)=>/*#__PURE__*/ jsxs(Fragment, {
|
|
78
|
+
children: [
|
|
79
|
+
section.group && /*#__PURE__*/ jsx("tr", {
|
|
80
|
+
className: "foundation-matrix-group",
|
|
81
|
+
children: /*#__PURE__*/ jsx("th", {
|
|
82
|
+
scope: "colgroup",
|
|
83
|
+
colSpan: roles.length + 1,
|
|
84
|
+
children: section.group
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
section.permissions.map((permission)=>/*#__PURE__*/ jsxs("tr", {
|
|
88
|
+
children: [
|
|
89
|
+
/*#__PURE__*/ jsx("th", {
|
|
90
|
+
scope: "row",
|
|
91
|
+
children: permission.label
|
|
92
|
+
}),
|
|
93
|
+
roles.map((role)=>{
|
|
94
|
+
const granted = isGranted(grants, role.id, permission.id);
|
|
95
|
+
return /*#__PURE__*/ jsx("td", {
|
|
96
|
+
"data-granted": granted,
|
|
97
|
+
children: readOnly ? /*#__PURE__*/ jsxs("span", {
|
|
98
|
+
className: "foundation-matrix-state",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ jsx(FoundationIcon, {
|
|
101
|
+
name: granted ? 'check' : 'minus'
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ jsx("span", {
|
|
104
|
+
className: "foundation-visually-hidden",
|
|
105
|
+
children: granted ? strings.matrixAllowed : strings.matrixDenied
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
}) : /*#__PURE__*/ jsx("input", {
|
|
109
|
+
type: "checkbox",
|
|
110
|
+
checked: granted,
|
|
111
|
+
"aria-label": formatText(strings.matrixGrant, {
|
|
112
|
+
permission: permission.label,
|
|
113
|
+
role: role.label
|
|
114
|
+
}),
|
|
115
|
+
onChange: (event)=>{
|
|
116
|
+
setGrants(setGrant(grants, role.id, permission.id, event.target.checked));
|
|
117
|
+
interactions?.onChange?.();
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
}, role.id);
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}, permission.id))
|
|
124
|
+
]
|
|
125
|
+
}, section.group ?? `ungrouped-${index}`))
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { PermissionMatrix };
|
|
134
|
+
//# sourceMappingURL=PermissionMatrix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionMatrix.js","sources":["../../../foundation/PermissionMatrix.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Fragment, useEffect, useMemo, useState } from 'react';\nimport { RegisteredComponentProps, useValueOutput } from '@cratis/scene.react';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { FoundationIcon } from './FoundationIcon';\nimport { formatText, readFoundationStrings } from './foundationStrings';\nimport { isGranted, MatrixGrant, readGrants, readPermissions, readRoles, sectionsOf, setGrant } from './permissionModel';\nimport { readPermissionRule } from './PermissionRule';\nimport { FoundationFrame } from './StateFrame';\n\n/**\n * The `permissionMatrix` component: roles across, permissions down, a checkbox where they meet.\n *\n * `roles` and `permissions` (optionally grouped) give the axes and `grants` - rows of `role` and `permission` - what is held; a grant of a role\n * or permission that does not exist is ignored. Each box is named in words (\"Grant Edit deals to Sales\") and every header is a real header\n * cell, so a screen reader announces the row and column of the box it is on. Changes are published as the `value` output - the grants,\n * in the same shape - for the screen to save. With `editPermission` not enabled the matrix is read-only and each cell says \"Allowed\" or\n * \"Not allowed\" in words and by icon. Wide matrices scroll sideways inside a keyboard-focusable region, keeping the permission column in view.\n */\nexport function PermissionMatrix({ element, interactions, bindingOutputs }: RegisteredComponentProps) {\n const roles = useMemo(() => readRoles(element.properties.roles), [element.properties.roles]);\n const permissions = useMemo(() => readPermissions(element.properties.permissions), [element.properties.permissions]);\n const supplied = useMemo(() => readGrants(element.properties.grants, roles, permissions), [element.properties.grants, roles, permissions]);\n const suppliedKey = JSON.stringify(supplied);\n const [grants, setGrants] = useState<MatrixGrant[]>(supplied);\n const strings = readFoundationStrings(element);\n const state = readComponentState(element, roles.length > 0 && permissions.length > 0);\n const readOnly = readPermissionRule(element, 'editPermission') !== 'enabled';\n const sections = useMemo(() => sectionsOf(permissions), [permissions]);\n\n useEffect(() => setGrants(supplied), [suppliedKey]);\n useValueOutput(bindingOutputs, grants);\n\n return (\n <FoundationFrame element={element} interactions={interactions} name='permission-matrix' state={state} skeleton={[100, 100, 100, 100]}>\n {(state === ComponentState.Ready || state === ComponentState.Partial) && (\n <div className='foundation-matrix-scroll' role='region' tabIndex={0} aria-label={strings.matrixScroll}>\n <table className='foundation-matrix'>\n <thead>\n <tr>\n <th scope='col'>{strings.matrixPermission}</th>\n {roles.map(role => <th key={role.id} scope='col'>{role.label}</th>)}\n </tr>\n </thead>\n <tbody>\n {sections.map((section, index) => (\n <Fragment key={section.group ?? `ungrouped-${index}`}>\n {section.group && (\n <tr className='foundation-matrix-group'><th scope='colgroup' colSpan={roles.length + 1}>{section.group}</th></tr>\n )}\n {section.permissions.map(permission => (\n <tr key={permission.id}>\n <th scope='row'>{permission.label}</th>\n {roles.map(role => {\n const granted = isGranted(grants, role.id, permission.id);\n return (\n <td key={role.id} data-granted={granted}>\n {readOnly ? (\n <span className='foundation-matrix-state'>\n <FoundationIcon name={granted ? 'check' : 'minus'} />\n <span className='foundation-visually-hidden'>{granted ? strings.matrixAllowed : strings.matrixDenied}</span>\n </span>\n ) : (\n <input type='checkbox' checked={granted} aria-label={formatText(strings.matrixGrant, { permission: permission.label, role: role.label })}\n onChange={event => { setGrants(setGrant(grants, role.id, permission.id, event.target.checked)); interactions?.onChange?.(); }} />\n )}\n </td>\n );\n })}\n </tr>\n ))}\n </Fragment>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["PermissionMatrix","element","interactions","bindingOutputs","roles","useMemo","readRoles","properties","permissions","readPermissions","supplied","readGrants","grants","suppliedKey","JSON","stringify","setGrants","useState","strings","readFoundationStrings","state","readComponentState","length","readOnly","readPermissionRule","sections","sectionsOf","useEffect","useValueOutput","_jsx","FoundationFrame","name","skeleton","ComponentState","Ready","Partial","div","className","role","tabIndex","aria-label","matrixScroll","_jsxs","table","thead","tr","th","scope","matrixPermission","map","label","id","tbody","section","index","Fragment","group","colSpan","permission","granted","isGranted","td","data-granted","span","FoundationIcon","matrixAllowed","matrixDenied","input","type","checked","formatText","matrixGrant","onChange","event","setGrant","target"],"mappings":";;;;;;;;;;AAYA;;;;;;;;IASO,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,YAAY,EAAEC,cAAc,EAA4B,EAAA;IAChG,MAAMC,KAAAA,GAAQC,QAAQ,IAAMC,SAAAA,CAAUL,QAAQM,UAAU,CAACH,KAAK,CAAA,EAAG;QAACH,OAAAA,CAAQM,UAAU,CAACH;AAAM,KAAA,CAAA;IAC3F,MAAMI,WAAAA,GAAcH,QAAQ,IAAMI,eAAAA,CAAgBR,QAAQM,UAAU,CAACC,WAAW,CAAA,EAAG;QAACP,OAAAA,CAAQM,UAAU,CAACC;AAAY,KAAA,CAAA;IACnH,MAAME,QAAAA,GAAWL,OAAAA,CAAQ,IAAMM,UAAAA,CAAWV,OAAAA,CAAQM,UAAU,CAACK,MAAM,EAAER,KAAAA,EAAOI,WAAAA,CAAAA,EAAc;QAACP,OAAAA,CAAQM,UAAU,CAACK,MAAM;AAAER,QAAAA,KAAAA;AAAOI,QAAAA;AAAY,KAAA,CAAA;IACzI,MAAMK,WAAAA,GAAcC,IAAAA,CAAKC,SAAS,CAACL,QAAAA,CAAAA;AACnC,IAAA,MAAM,CAACE,MAAAA,EAAQI,SAAAA,CAAU,GAAGC,QAAAA,CAAwBP,QAAAA,CAAAA;AACpD,IAAA,MAAMQ,UAAUC,qBAAAA,CAAsBlB,OAAAA,CAAAA;IACtC,MAAMmB,KAAAA,GAAQC,mBA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;;8EACZR,GAAA,CAACmC,cAAAA,EAAAA;AAAejC,oEAAAA,IAAAA,EAAM4B,UAAU,OAAA,GAAU;;8EAC1C9B,GAAA,CAACkC,MAAAA,EAAAA;oEAAK1B,SAAAA,EAAU,4BAAA;AAA8BsB,oEAAAA,QAAAA,EAAAA,OAAAA,GAAUzC,OAAAA,CAAQ+C,aAAa,GAAG/C,OAAAA,CAAQgD;;;2EAG5FrC,GAAA,CAACsC,OAAAA,EAAAA;4DAAMC,IAAAA,EAAK,UAAA;4DAAWC,OAAAA,EAASV,OAAAA;4DAASnB,YAAAA,EAAY8B,UAAAA,CAAWpD,OAAAA,CAAQqD,WAAW,EAAE;AAAEb,gEAAAA,UAAAA,EAAYA,WAAWR,KAAK;AAAEZ,gEAAAA,IAAAA,EAAMA,KAAKY;AAAM,6DAAA,CAAA;AAClIsB,4DAAAA,QAAAA,EAAUC,CAAAA,KAAAA,GAAAA;gEAAWzD,SAAAA,CAAU0D,QAAAA,CAAS9D,MAAAA,EAAQ0B,IAAAA,CAAKa,EAAE,EAAEO,UAAAA,CAAWP,EAAE,EAAEsB,KAAAA,CAAME,MAAM,CAACN,OAAO,CAAA,CAAA;gEAAInE,YAAAA,EAAcsE,QAAAA,IAAAA;AAAc,4DAAA;;AAR/HlC,qDAAAA,EAAAA,IAAAA,CAAKa,EAAE,CAAA;AAYxB,gDAAA,CAAA;;AAjBKO,yCAAAA,EAAAA,UAAAA,CAAWP,EAAE,CAAA;;AALfE,6BAAAA,EAAAA,OAAAA,CAAQG,KAAK,IAAI,CAAC,UAAU,EAAEF,KAAAA,CAAAA,CAAO,CAAA;;;;;;AAiCpF;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum ApprovalState {
|
|
2
|
+
Pending = "pending",
|
|
3
|
+
Current = "current",
|
|
4
|
+
Approved = "approved",
|
|
5
|
+
Rejected = "rejected",
|
|
6
|
+
Skipped = "skipped"
|
|
7
|
+
}
|
|
8
|
+
export interface ApprovalStep {
|
|
9
|
+
label: string;
|
|
10
|
+
approver?: string;
|
|
11
|
+
state: ApprovalState;
|
|
12
|
+
at?: string;
|
|
13
|
+
comment?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface EffectiveStep extends ApprovalStep {
|
|
16
|
+
notReached: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare enum ChainOutcome {
|
|
19
|
+
Approved = "approved",
|
|
20
|
+
Rejected = "rejected",
|
|
21
|
+
InProgress = "inProgress",
|
|
22
|
+
Pending = "pending"
|
|
23
|
+
}
|
|
24
|
+
export declare function readSteps(value: unknown): ApprovalStep[];
|
|
25
|
+
export declare function effectiveSteps(steps: ApprovalStep[]): EffectiveStep[];
|
|
26
|
+
export declare function chainOutcome(steps: ApprovalStep[]): ChainOutcome;
|
|
27
|
+
//# sourceMappingURL=approvalModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approvalModel.d.ts","sourceRoot":"","sources":["../../../foundation/approvalModel.ts"],"names":[],"mappings":"AAIA,oBAAY,aAAa;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACtB;AAGD,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,aAAc,SAAQ,YAAY;IAE/C,UAAU,EAAE,OAAO,CAAC;CACvB;AAGD,oBAAY,YAAY;IAEpB,QAAQ,aAAa;IAGrB,QAAQ,aAAa;IAGrB,UAAU,eAAe;IAGzB,OAAO,YAAY;CACtB;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,EAAE,CAgBxD;AASD,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,CAWrE;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAKhE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** Where one step of an approval chain stands. */ var ApprovalState = /*#__PURE__*/ function(ApprovalState) {
|
|
4
|
+
ApprovalState["Pending"] = "pending";
|
|
5
|
+
ApprovalState["Current"] = "current";
|
|
6
|
+
ApprovalState["Approved"] = "approved";
|
|
7
|
+
ApprovalState["Rejected"] = "rejected";
|
|
8
|
+
ApprovalState["Skipped"] = "skipped";
|
|
9
|
+
return ApprovalState;
|
|
10
|
+
}({});
|
|
11
|
+
/** How the chain as a whole stands. */ var ChainOutcome = /*#__PURE__*/ function(ChainOutcome) {
|
|
12
|
+
/** Every step approved. */ ChainOutcome["Approved"] = "approved";
|
|
13
|
+
/** A step rejected: the chain stops there. */ ChainOutcome["Rejected"] = "rejected";
|
|
14
|
+
/** At least one step is decided and the rest are waiting. */ ChainOutcome["InProgress"] = "inProgress";
|
|
15
|
+
/** Nothing decided yet. */ ChainOutcome["Pending"] = "pending";
|
|
16
|
+
return ChainOutcome;
|
|
17
|
+
}({});
|
|
18
|
+
/** Reads steps out of a property value, dropping entries without a label; an unknown state is pending. */ function readSteps(value) {
|
|
19
|
+
if (!Array.isArray(value)) return [];
|
|
20
|
+
return value.flatMap((entry)=>{
|
|
21
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];
|
|
22
|
+
const { label, approver, state, at, comment } = entry;
|
|
23
|
+
if (typeof label !== 'string' || label.length === 0) return [];
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
label,
|
|
27
|
+
state: Object.values(ApprovalState).includes(state) ? state : "pending",
|
|
28
|
+
...typeof approver === 'string' ? {
|
|
29
|
+
approver
|
|
30
|
+
} : {},
|
|
31
|
+
...typeof at === 'string' ? {
|
|
32
|
+
at
|
|
33
|
+
} : {},
|
|
34
|
+
...typeof comment === 'string' && comment.length > 0 ? {
|
|
35
|
+
comment
|
|
36
|
+
} : {}
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Applies the chain's rules to the steps as written.
|
|
43
|
+
*
|
|
44
|
+
* A rejection stops the chain: every step after the first rejected one has not been reached, so it is drawn skipped however it was written.
|
|
45
|
+
* With no step marked current and no rejection, the first step that is not yet decided is the current one - the person the chain is waiting
|
|
46
|
+
* for - so a chain written only as approved and pending steps still says whose turn it is. Only one step is ever current.
|
|
47
|
+
*/ function effectiveSteps(steps) {
|
|
48
|
+
const rejected = steps.findIndex((step)=>step.state === "rejected");
|
|
49
|
+
const explicitCurrent = steps.findIndex((step)=>step.state === "current");
|
|
50
|
+
const waiting = rejected >= 0 ? -1 : explicitCurrent >= 0 ? explicitCurrent : steps.findIndex((step)=>step.state === "pending");
|
|
51
|
+
return steps.map((step, index)=>{
|
|
52
|
+
if (rejected >= 0 && index > rejected) return {
|
|
53
|
+
...step,
|
|
54
|
+
state: "skipped",
|
|
55
|
+
notReached: true
|
|
56
|
+
};
|
|
57
|
+
if (step.state === "current" && index !== waiting) return {
|
|
58
|
+
...step,
|
|
59
|
+
state: "pending",
|
|
60
|
+
notReached: false
|
|
61
|
+
};
|
|
62
|
+
if (index === waiting && step.state === "pending") return {
|
|
63
|
+
...step,
|
|
64
|
+
state: "current",
|
|
65
|
+
notReached: false
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
...step,
|
|
69
|
+
notReached: false
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** The state of the chain as a whole. A skipped step counts as decided, because it was never going to be asked. */ function chainOutcome(steps) {
|
|
74
|
+
const effective = effectiveSteps(steps);
|
|
75
|
+
if (effective.some((step)=>step.state === "rejected")) return "rejected";
|
|
76
|
+
if (effective.length > 0 && effective.every((step)=>step.state === "approved" || step.state === "skipped")) return "approved";
|
|
77
|
+
return effective.some((step)=>step.state === "approved") ? "inProgress" : "pending";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { ApprovalState, ChainOutcome, chainOutcome, effectiveSteps, readSteps };
|
|
81
|
+
//# sourceMappingURL=approvalModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approvalModel.js","sources":["../../../foundation/approvalModel.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Where one step of an approval chain stands. */\nexport enum ApprovalState {\n Pending = 'pending',\n Current = 'current',\n Approved = 'approved',\n Rejected = 'rejected',\n Skipped = 'skipped',\n}\n\n/** One step of an approval chain: who decides, and what they decided. */\nexport interface ApprovalStep {\n label: string;\n approver?: string;\n state: ApprovalState;\n at?: string;\n comment?: string;\n}\n\n/** A step as it is drawn, after the chain's own rules are applied. */\nexport interface EffectiveStep extends ApprovalStep {\n /** True when an earlier rejection stopped the chain before this step was reached. */\n notReached: boolean;\n}\n\n/** How the chain as a whole stands. */\nexport enum ChainOutcome {\n /** Every step approved. */\n Approved = 'approved',\n\n /** A step rejected: the chain stops there. */\n Rejected = 'rejected',\n\n /** At least one step is decided and the rest are waiting. */\n InProgress = 'inProgress',\n\n /** Nothing decided yet. */\n Pending = 'pending',\n}\n\n/** Reads steps out of a property value, dropping entries without a label; an unknown state is pending. */\nexport function readSteps(value: unknown): ApprovalStep[] {\n if (!Array.isArray(value)) return [];\n\n return value.flatMap((entry): ApprovalStep[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];\n const { label, approver, state, at, comment } = entry as Record<string, unknown>;\n if (typeof label !== 'string' || label.length === 0) return [];\n\n return [{\n label,\n state: (Object.values(ApprovalState) as string[]).includes(state as string) ? (state as ApprovalState) : ApprovalState.Pending,\n ...(typeof approver === 'string' ? { approver } : {}),\n ...(typeof at === 'string' ? { at } : {}),\n ...(typeof comment === 'string' && comment.length > 0 ? { comment } : {}),\n }];\n });\n}\n\n/**\n * Applies the chain's rules to the steps as written.\n *\n * A rejection stops the chain: every step after the first rejected one has not been reached, so it is drawn skipped however it was written.\n * With no step marked current and no rejection, the first step that is not yet decided is the current one - the person the chain is waiting\n * for - so a chain written only as approved and pending steps still says whose turn it is. Only one step is ever current.\n */\nexport function effectiveSteps(steps: ApprovalStep[]): EffectiveStep[] {\n const rejected = steps.findIndex(step => step.state === ApprovalState.Rejected);\n const explicitCurrent = steps.findIndex(step => step.state === ApprovalState.Current);\n const waiting = rejected >= 0 ? -1 : explicitCurrent >= 0 ? explicitCurrent : steps.findIndex(step => step.state === ApprovalState.Pending);\n\n return steps.map((step, index) => {\n if (rejected >= 0 && index > rejected) return { ...step, state: ApprovalState.Skipped, notReached: true };\n if (step.state === ApprovalState.Current && index !== waiting) return { ...step, state: ApprovalState.Pending, notReached: false };\n if (index === waiting && step.state === ApprovalState.Pending) return { ...step, state: ApprovalState.Current, notReached: false };\n return { ...step, notReached: false };\n });\n}\n\n/** The state of the chain as a whole. A skipped step counts as decided, because it was never going to be asked. */\nexport function chainOutcome(steps: ApprovalStep[]): ChainOutcome {\n const effective = effectiveSteps(steps);\n if (effective.some(step => step.state === ApprovalState.Rejected)) return ChainOutcome.Rejected;\n if (effective.length > 0 && effective.every(step => step.state === ApprovalState.Approved || step.state === ApprovalState.Skipped)) return ChainOutcome.Approved;\n return effective.some(step => step.state === ApprovalState.Approved) ? ChainOutcome.InProgress : ChainOutcome.Pending;\n}\n"],"names":["ApprovalState","ChainOutcome","readSteps","value","Array","isArray","flatMap","entry","label","approver","state","at","comment","length","Object","values","includes","effectiveSteps","steps","rejected","findIndex","step","explicitCurrent","waiting","map","index","notReached","chainOutcome","effective","some","every"],"mappings":"AAAA;AACA;AAEA,mDACO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;;;;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AAM,SAAA;AACxC,IAAA,CAAA,CAAA;AACJ;AAEA,oHACO,SAASC,YAAAA,CAAaT,KAAqB,EAAA;AAC9C,IAAA,MAAMU,YAAYX,cAAAA,CAAeC,KAAAA,CAAAA;AACjC,IAAA,IAAIU,UAAUC,IAAI,CAACR,CAAAA,IAAAA,GAAQA,IAAAA,CAAKX,KAAK,KAAA,UAAA,CAAA,EAA8B,OAAA,UAAA;AACnE,IAAA,IAAIkB,SAAAA,CAAUf,MAAM,GAAG,CAAA,IAAKe,UAAUE,KAAK,CAACT,CAAAA,IAAAA,GAAQA,IAAAA,CAAKX,KAAK,KAAA,UAAA,IAA+BW,IAAAA,CAAKX,KAAK,KAAA,SAAA,CAAA,EAA6B,OAAA,UAAA;AACpI,IAAA,OAAOkB,UAAUC,IAAI,CAACR,CAAAA,IAAAA,GAAQA,KAAKX,KAAK,KAAA,UAAA,CAAA,GAAA,YAAA,GAAA,SAAA;AAC5C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationComponentMetadata.d.ts","sourceRoot":"","sources":["../../../foundation/foundationComponentMetadata.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAA0B,MAAM,qBAAqB,CAAC;AAOhF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"foundationComponentMetadata.d.ts","sourceRoot":"","sources":["../../../foundation/foundationComponentMetadata.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAA0B,MAAM,qBAAqB,CAAC;AAOhF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAgBzE,CAAC"}
|
|
@@ -86,6 +86,27 @@ import { ComponentName } from '../ComponentName.js';
|
|
|
86
86
|
'files',
|
|
87
87
|
'drop zone',
|
|
88
88
|
'documents'
|
|
89
|
+
]),
|
|
90
|
+
[ComponentName.ApprovalChainStepper]: componentMetadata('Approval chain', ComponentCategory.Navigation, 'workflow', [
|
|
91
|
+
'approvals',
|
|
92
|
+
'steps',
|
|
93
|
+
'workflow',
|
|
94
|
+
'sign off',
|
|
95
|
+
'stepper'
|
|
96
|
+
]),
|
|
97
|
+
[ComponentName.OrgTree]: componentMetadata('Org tree', ComponentCategory.DataDisplay, 'network', [
|
|
98
|
+
'organization',
|
|
99
|
+
'hierarchy',
|
|
100
|
+
'org chart',
|
|
101
|
+
'reports to',
|
|
102
|
+
'tree'
|
|
103
|
+
]),
|
|
104
|
+
[ComponentName.PermissionMatrix]: componentMetadata('Permission matrix', ComponentCategory.Input, 'shield-check', [
|
|
105
|
+
'roles',
|
|
106
|
+
'permissions',
|
|
107
|
+
'access',
|
|
108
|
+
'grants',
|
|
109
|
+
'rbac'
|
|
89
110
|
])
|
|
90
111
|
};
|
|
91
112
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationComponentMetadata.js","sources":["../../../foundation/foundationComponentMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentCategory } from '@cratis/scene.model';\nimport { ComponentMetadata, componentMetadata as m } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\n\n/**\n * The category, icon, keywords and picker badge of every foundation component (CMP1), keyed by bare component name.\n * The names are those of `ComponentName`; the metadata of the rest of the package lives in `defaultBlueprintComponentMetadata`.\n */\nexport const foundationComponentMetadata: Record<string, ComponentMetadata> = {\n [ComponentName.EmptyState]: m('Empty state', ComponentCategory.Feedback, 'inbox', ['no data', 'nothing', 'blank slate', 'zero state']),\n [ComponentName.StatCard]: m('Stat card', ComponentCategory.DataDisplay, 'gauge', ['kpi', 'metric', 'figure', 'number', 'dashboard']),\n [ComponentName.TrendChip]: m('Trend chip', ComponentCategory.DataDisplay, 'trending-up', ['delta', 'change', 'arrow', 'comparison']),\n [ComponentName.StatusChip]: m('Status chip', ComponentCategory.DataDisplay, 'badge-check', ['badge', 'state', 'tag', 'label']),\n [ComponentName.ChartWrapper]: m('Chart', ComponentCategory.DataDisplay, 'chart-line', ['graph', 'line', 'bar', 'stacked', 'donut', 'pie', 'funnel', 'plot']),\n [ComponentName.FilterBuilder]: m('Filter builder', ComponentCategory.Input, 'list-filter', ['filter', 'query', 'conditions', 'and or', 'search']),\n [ComponentName.ColumnChooser]: m('Column chooser', ComponentCategory.Actions, 'columns-3', ['columns', 'fields', 'show hide', 'table']),\n [ComponentName.SavedViewsMenu]: m('Saved views menu', ComponentCategory.Actions, 'bookmark', ['views', 'presets', 'saved filters']),\n [ComponentName.ChecklistSection]: m('Checklist', ComponentCategory.DataDisplay, 'list-checks', ['tasks', 'todo', 'onboarding', 'progress', 'steps']),\n [ComponentName.ActivityFeed]: m('Activity feed', ComponentCategory.DataDisplay, 'activity', ['timeline', 'history', 'comments', 'audit', 'log']),\n [ComponentName.AvatarStack]: m('Avatar stack', ComponentCategory.DataDisplay, 'users', ['people', 'members', 'assignees', 'team']),\n [ComponentName.FileUploader]: m('File uploader', ComponentCategory.Input, 'upload', ['attachments', 'files', 'drop zone', 'documents']),\n};\n"],"names":["foundationComponentMetadata","ComponentName","EmptyState","m","ComponentCategory","Feedback","StatCard","DataDisplay","TrendChip","StatusChip","ChartWrapper","FilterBuilder","Input","ColumnChooser","Actions","SavedViewsMenu","ChecklistSection","ActivityFeed","AvatarStack","FileUploader"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,2BAAAA,GAAiE;IAC1E,CAACC,aAAAA,CAAcC,UAAU,GAAGC,kBAAE,aAAA,EAAeC,iBAAAA,CAAkBC,QAAQ,EAAE,OAAA,EAAS;AAAC,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA,aAAA;AAAe,QAAA;AAAa,KAAA,CAAA;IACrI,CAACJ,aAAAA,CAAcK,QAAQ,GAAGH,kBAAE,WAAA,EAAaC,iBAAAA,CAAkBG,WAAW,EAAE,OAAA,EAAS;AA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Y;AAAC,QAAA,OAAA;AAAS,QAAA,SAAA;AAAW,QAAA;AAAgB,KAAA,CAAA;IAClI,CAACb,aAAAA,CAAce,gBAAgB,GAAGb,kBAAE,WAAA,EAAaC,iBAAAA,CAAkBG,WAAW,EAAE,aAAA,EAAe;AAAC,QAAA,OAAA;AAAS,QAAA,MAAA;AAAQ,QAAA,YAAA;AAAc,QAAA,UAAA;AAAY,QAAA;AAAQ,KAAA,CAAA;IACnJ,CAACN,aAAAA,CAAcgB,YAAY,GAAGd,kBAAE,eAAA,EAAiBC,iBAAAA,CAAkBG,WAAW,EAAE,UAAA,EAAY;AAAC,QAAA,UAAA;AAAY,QAAA,SAAA;AAAW,QAAA,UAAA;AAAY,QAAA,OAAA;AAAS,QAAA;AAAM,KAAA,CAAA;IAC/I,CAACN,aAAAA,CAAciB,WAAW,GAAGf,kBAAE,cAAA,EAAgBC,iBAAAA,CAAkBG,WAAW,EAAE,OAAA,EAAS;AAAC,QAAA,QAAA;AAAU,QAAA,SAAA;AAAW,QAAA,WAAA;AAAa,QAAA;AAAO,KAAA,CAAA;IACjI,CAACN,aAAAA,CAAckB,YAAY,GAAGhB,kBAAE,eAAA,EAAiBC,iBAAAA,CAAkBQ,KAAK,EAAE,QAAA,EAAU;AAAC,QAAA,aAAA;AAAe,QAAA,OAAA;AAAS,QAAA,WAAA;AAAa,QAAA;AAAY,KAAA;
|
|
1
|
+
{"version":3,"file":"foundationComponentMetadata.js","sources":["../../../foundation/foundationComponentMetadata.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentCategory } from '@cratis/scene.model';\nimport { ComponentMetadata, componentMetadata as m } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\n\n/**\n * The category, icon, keywords and picker badge of every foundation component (CMP1), keyed by bare component name.\n * The names are those of `ComponentName`; the metadata of the rest of the package lives in `defaultBlueprintComponentMetadata`.\n */\nexport const foundationComponentMetadata: Record<string, ComponentMetadata> = {\n [ComponentName.EmptyState]: m('Empty state', ComponentCategory.Feedback, 'inbox', ['no data', 'nothing', 'blank slate', 'zero state']),\n [ComponentName.StatCard]: m('Stat card', ComponentCategory.DataDisplay, 'gauge', ['kpi', 'metric', 'figure', 'number', 'dashboard']),\n [ComponentName.TrendChip]: m('Trend chip', ComponentCategory.DataDisplay, 'trending-up', ['delta', 'change', 'arrow', 'comparison']),\n [ComponentName.StatusChip]: m('Status chip', ComponentCategory.DataDisplay, 'badge-check', ['badge', 'state', 'tag', 'label']),\n [ComponentName.ChartWrapper]: m('Chart', ComponentCategory.DataDisplay, 'chart-line', ['graph', 'line', 'bar', 'stacked', 'donut', 'pie', 'funnel', 'plot']),\n [ComponentName.FilterBuilder]: m('Filter builder', ComponentCategory.Input, 'list-filter', ['filter', 'query', 'conditions', 'and or', 'search']),\n [ComponentName.ColumnChooser]: m('Column chooser', ComponentCategory.Actions, 'columns-3', ['columns', 'fields', 'show hide', 'table']),\n [ComponentName.SavedViewsMenu]: m('Saved views menu', ComponentCategory.Actions, 'bookmark', ['views', 'presets', 'saved filters']),\n [ComponentName.ChecklistSection]: m('Checklist', ComponentCategory.DataDisplay, 'list-checks', ['tasks', 'todo', 'onboarding', 'progress', 'steps']),\n [ComponentName.ActivityFeed]: m('Activity feed', ComponentCategory.DataDisplay, 'activity', ['timeline', 'history', 'comments', 'audit', 'log']),\n [ComponentName.AvatarStack]: m('Avatar stack', ComponentCategory.DataDisplay, 'users', ['people', 'members', 'assignees', 'team']),\n [ComponentName.FileUploader]: m('File uploader', ComponentCategory.Input, 'upload', ['attachments', 'files', 'drop zone', 'documents']),\n [ComponentName.ApprovalChainStepper]: m('Approval chain', ComponentCategory.Navigation, 'workflow', ['approvals', 'steps', 'workflow', 'sign off', 'stepper']),\n [ComponentName.OrgTree]: m('Org tree', ComponentCategory.DataDisplay, 'network', ['organization', 'hierarchy', 'org chart', 'reports to', 'tree']),\n [ComponentName.PermissionMatrix]: m('Permission matrix', ComponentCategory.Input, 'shield-check', ['roles', 'permissions', 'access', 'grants', 'rbac']),\n};\n"],"names":["foundationComponentMetadata","ComponentName","EmptyState","m","ComponentCategory","Feedback","StatCard","DataDisplay","TrendChip","StatusChip","ChartWrapper","FilterBuilder","Input","ColumnChooser","Actions","SavedViewsMenu","ChecklistSection","ActivityFeed","AvatarStack","FileUploader","ApprovalChainStepper","Navigation","OrgTree","PermissionMatrix"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,2BAAAA,GAAiE;IAC1E,CAACC,aAAAA,CAAcC,UAAU,GAAGC,kBAAE,aAAA,EAAeC,iBAAAA,CAAkBC,QAAQ,EAAE,OAAA,EAAS;AAAC,QAAA,SAAA;AAAW,QAAA,SAAA;AAAW,QAAA,aAAA;AAAe,QAAA;AAAa,KAAA,CAAA;IACrI,CAACJ,aAAAA,CAAcK,QAAQ,GAAGH,kBAAE,WAAA,EAAaC,iBAAAA,CAAkBG,WAAW,EAAE,OAAA,EAAS;AAAC,QAAA,KAAA;AAAO,QAAA,QAAA;AAAU,QAAA,QAAA;AAAU,QAAA,QAAA;AAAU,QAAA;AAAY,KAAA,CAAA;IACnI,CAACN,aAAAA,CAAcO,SAAS,GAAGL,kBAAE,YAAA,EAAcC,iBAAAA,CAAkBG,WAAW,EAAE,aAAA,EAAe;AAAC,QAAA,OAAA;AAAS,QAAA,QAAA;AAAU,QAAA,OAAA;AAAS,QAAA;AAAa,KAAA,CAAA;IACnI,CAACN,aAAAA,CAAcQ,UAAU,GAAGN,kBAAE,aAAA,EAAeC,iBAAAA,CAAkBG,WAAW,EAAE,aAAA,EAAe;AAAC,QAAA,OAAA;AAAS,QAAA,OAAA;AAAS,QAAA,KAAA;AAAO,QAAA;AAAQ,KAAA,CAAA;IAC7H,CAACN,aAAAA,CAAcS,YAAY,GAAGP,kBAAE,OAAA,EAASC,iBAAAA,CAAkBG,WAAW,EAAE,YAAA,EAAc;AAAC,QAAA,OAAA;AAAS,QAAA,MAAA;AAAQ,QAA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