@nivaro/react 0.3.44 → 0.3.45
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +38 -5
- package/dist/shared/components/CollectionBrowserView.js +1390 -1358
- package/dist/shared/components/DataTable.js +356 -334
- package/dist/shared/components/ProfileView.js +16 -21
- package/dist/shared/components/command-center/CommandCenterView.js +90 -355
- package/dist/shared/components/command-center/Header.js +70 -0
- package/dist/shared/components/command-center/PeekPanel.js +6 -0
- package/dist/shared/components/command-center/api.js +26 -0
- package/dist/shared/components/command-center/panels/AttentionPanel.js +6 -0
- package/dist/shared/components/command-center/panels/FeedPanel.js +33 -0
- package/dist/shared/components/command-center/panels/FlowPanel.js +61 -0
- package/dist/shared/components/command-center/panels/ForecastPanel.js +6 -0
- package/dist/shared/components/command-center/panels/MapPanel.js +74 -0
- package/dist/shared/components/command-center/panels/PartnersPanel.js +6 -0
- package/dist/shared/components/command-center/panels/PeoplePanel.js +47 -0
- package/dist/shared/components/command-center/panels/RegionPicker.js +6 -0
- package/dist/shared/components/command-center/panels/SystemPanel.js +53 -0
- package/dist/shared/components/command-center/panels/ThroughputPanel.js +6 -0
- package/dist/shared/components/command-center/panels/TimeBar.js +10 -0
- package/dist/shared/components/command-center/panels/TrafficPanel.js +11 -0
- package/dist/shared/components/command-center/panels/WorkloadPanel.js +6 -0
- package/dist/shared/components/command-center/panels/registry.js +28 -0
- package/dist/shared/components/command-center/state.js +12 -0
- package/dist/shared/components/command-center/theme.js +66 -0
- package/dist/shared/components/imports/ImportConsole.js +48 -47
- package/dist/shared/components/notifications/TestMyRules.js +39 -38
- package/dist/shared/components/profile/TeamsConnect.js +2 -2
- package/dist/shared/components/queue/QueueQuickFilters.js +81 -63
- package/dist/shared/components/queue/QueueWorklist.js +598 -586
- package/dist/shared/lib/quick-filter-cascade.js +29 -0
- package/package.json +1 -1
|
@@ -1,116 +1,134 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { MultiPick as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
def:
|
|
8
|
-
selected:
|
|
9
|
-
onChange:
|
|
10
|
-
badge:
|
|
1
|
+
import { jsxs as f, jsx as i, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as N } from "@tanstack/react-query";
|
|
3
|
+
import { useState as x, useEffect as O, useMemo as C } from "react";
|
|
4
|
+
import { MultiPick as q } from "../CollectionBrowserView.js";
|
|
5
|
+
const d = (r) => Array.isArray(r) ? r : r ? [r] : [];
|
|
6
|
+
function v({
|
|
7
|
+
def: r,
|
|
8
|
+
selected: n,
|
|
9
|
+
onChange: h,
|
|
10
|
+
badge: y,
|
|
11
|
+
narrowBy: p
|
|
11
12
|
}) {
|
|
12
|
-
const [
|
|
13
|
-
queryKey: ["queue-quick-facet",
|
|
14
|
-
queryFn: () =>
|
|
15
|
-
enabled: !!
|
|
13
|
+
const [c, g] = x(!1), [o, m] = x(""), u = r.loadOptions, e = JSON.stringify(p), { data: a = [], isLoading: l } = N({
|
|
14
|
+
queryKey: ["queue-quick-facet", r.key, o, e],
|
|
15
|
+
queryFn: () => u ? u(o, { narrowBy: p }) : Promise.resolve([]),
|
|
16
|
+
enabled: !!u && (c || n.length > 0),
|
|
16
17
|
staleTime: 6e4
|
|
17
|
-
}),
|
|
18
|
-
const
|
|
19
|
-
return [...
|
|
20
|
-
}, [
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
18
|
+
}), k = C(() => {
|
|
19
|
+
const s = new Set(a.map((t) => t.value));
|
|
20
|
+
return [...a, ...n.filter((t) => !s.has(t)).map((t) => ({ label: t, value: t }))];
|
|
21
|
+
}, [a, n]);
|
|
22
|
+
return /* @__PURE__ */ i(
|
|
23
|
+
q,
|
|
23
24
|
{
|
|
24
|
-
label:
|
|
25
|
-
options:
|
|
26
|
-
selected:
|
|
27
|
-
onChange: (
|
|
28
|
-
loading:
|
|
29
|
-
badge:
|
|
30
|
-
onSearch:
|
|
31
|
-
onOpenChange: (
|
|
32
|
-
|
|
25
|
+
label: r.placeholder,
|
|
26
|
+
options: k,
|
|
27
|
+
selected: n,
|
|
28
|
+
onChange: (s) => h(s.map(String)),
|
|
29
|
+
loading: l,
|
|
30
|
+
badge: y,
|
|
31
|
+
onSearch: m,
|
|
32
|
+
onOpenChange: (s) => {
|
|
33
|
+
s && g(!0);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
);
|
|
36
37
|
}
|
|
37
38
|
function Q({
|
|
38
|
-
defs:
|
|
39
|
-
values:
|
|
40
|
-
seededKeys:
|
|
41
|
-
onApply:
|
|
42
|
-
onClear:
|
|
43
|
-
right:
|
|
39
|
+
defs: r,
|
|
40
|
+
values: n,
|
|
41
|
+
seededKeys: h,
|
|
42
|
+
onApply: y,
|
|
43
|
+
onClear: p,
|
|
44
|
+
right: c
|
|
44
45
|
}) {
|
|
45
|
-
const
|
|
46
|
-
|
|
46
|
+
const g = JSON.stringify(r.map((e) => [e.key, d(n[e.key])])), [o, m] = x({});
|
|
47
|
+
O(() => {
|
|
47
48
|
const e = {};
|
|
48
|
-
for (const
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
const u =
|
|
52
|
-
(e) => JSON.stringify(
|
|
49
|
+
for (const a of r) e[a.key] = d(n[a.key]);
|
|
50
|
+
m(e);
|
|
51
|
+
}, [g]);
|
|
52
|
+
const u = r.some(
|
|
53
|
+
(e) => JSON.stringify(o[e.key] ?? []) !== JSON.stringify(d(n[e.key]))
|
|
53
54
|
);
|
|
54
|
-
return
|
|
55
|
+
return r.length === 0 && !c ? null : /* @__PURE__ */ f(
|
|
55
56
|
"div",
|
|
56
57
|
{
|
|
57
58
|
className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
|
|
58
59
|
"data-queue-quick-filters": !0,
|
|
59
60
|
children: [
|
|
60
|
-
|
|
61
|
-
const
|
|
61
|
+
r.map((e) => {
|
|
62
|
+
const a = o[e.key] ?? [], l = e.restricted ? {
|
|
62
63
|
label: "restricted",
|
|
63
64
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
64
65
|
title: `Options limited to your restricted ${e.placeholder} scope`
|
|
65
|
-
} :
|
|
66
|
+
} : h.has(e.key) && a.length > 0 ? {
|
|
66
67
|
label: "your default",
|
|
67
68
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
68
69
|
title: `Pre-selected from your default ${e.placeholder} scope — adjust freely`
|
|
69
|
-
} : null,
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
} : null, k = (t) => {
|
|
71
|
+
m((b) => ({ ...b, [e.key]: t })), t.length === 0 && d(n[e.key]).length > 0 && y({ [e.key]: e.multi || e.type === "combobox" ? [] : "" });
|
|
72
|
+
}, s = r.filter((t) => {
|
|
73
|
+
var b;
|
|
74
|
+
return t.key !== e.key && t.cascade && (((b = o[t.key]) == null ? void 0 : b.length) ?? 0) > 0;
|
|
75
|
+
}).map((t) => ({
|
|
76
|
+
collection: t.cascade.collection,
|
|
77
|
+
field: t.cascade.field,
|
|
78
|
+
values: o[t.key] ?? []
|
|
79
|
+
}));
|
|
80
|
+
return e.loadOptions ? /* @__PURE__ */ i(
|
|
81
|
+
v,
|
|
82
|
+
{
|
|
83
|
+
def: e,
|
|
84
|
+
selected: a,
|
|
85
|
+
onChange: k,
|
|
86
|
+
badge: l,
|
|
87
|
+
narrowBy: s
|
|
88
|
+
},
|
|
89
|
+
e.key
|
|
90
|
+
) : /* @__PURE__ */ i(
|
|
91
|
+
q,
|
|
74
92
|
{
|
|
75
93
|
label: e.placeholder,
|
|
76
94
|
options: e.options ?? [],
|
|
77
|
-
selected:
|
|
78
|
-
onChange: (
|
|
79
|
-
badge:
|
|
95
|
+
selected: a,
|
|
96
|
+
onChange: (t) => k(t.map(String)),
|
|
97
|
+
badge: l
|
|
80
98
|
},
|
|
81
99
|
e.key
|
|
82
100
|
);
|
|
83
101
|
}),
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */
|
|
102
|
+
r.length > 0 && /* @__PURE__ */ f(S, { children: [
|
|
103
|
+
/* @__PURE__ */ i(
|
|
86
104
|
"button",
|
|
87
105
|
{
|
|
88
106
|
type: "button",
|
|
89
107
|
onClick: () => {
|
|
90
108
|
const e = {};
|
|
91
|
-
for (const
|
|
92
|
-
const
|
|
93
|
-
e[
|
|
109
|
+
for (const a of r) {
|
|
110
|
+
const l = o[a.key] ?? [];
|
|
111
|
+
e[a.key] = a.multi || a.type === "combobox" ? l : l[0] ?? "";
|
|
94
112
|
}
|
|
95
|
-
|
|
113
|
+
y(e);
|
|
96
114
|
},
|
|
97
115
|
className: `h-6 rounded px-2.5 text-[11px] font-semibold text-white transition-[filter] hover:brightness-110 ${u ? "bg-nvr-cyan" : "bg-nvr-cyan opacity-60"}`,
|
|
98
116
|
"data-queue-quick-apply": !0,
|
|
99
117
|
children: "Apply"
|
|
100
118
|
}
|
|
101
119
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ i(
|
|
103
121
|
"button",
|
|
104
122
|
{
|
|
105
123
|
type: "button",
|
|
106
|
-
onClick:
|
|
124
|
+
onClick: p,
|
|
107
125
|
className: "h-6 rounded border border-slate-200 px-2 text-[11px] text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
|
|
108
126
|
"data-queue-quick-clear": !0,
|
|
109
127
|
children: "Clear"
|
|
110
128
|
}
|
|
111
129
|
)
|
|
112
130
|
] }),
|
|
113
|
-
|
|
131
|
+
c && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", children: c })
|
|
114
132
|
]
|
|
115
133
|
}
|
|
116
134
|
);
|