@declarion/react 0.87.0 → 0.89.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/dist-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { usePreferencesStore as e } from "../../stores/preferences.js";
|
|
2
|
+
import { pluralText as t } from "../../lib/language.js";
|
|
3
|
+
import { Icon as n } from "../primitives/Icons.js";
|
|
4
|
+
import { Dropdown as r } from "../primitives/Dropdown.js";
|
|
5
|
+
import { useText as i } from "../../hooks/useText.js";
|
|
6
|
+
import { MenuItem as a } from "../primitives/MenuItem.js";
|
|
7
|
+
import { DynamicIcon as o } from "../shared/DynamicIcon.js";
|
|
8
|
+
import { shortcutLabel as s } from "../../lib/shortcut.js";
|
|
9
|
+
import { tabIdsForCloseScope as c, useTabStore as l } from "../../stores/tabs.js";
|
|
10
|
+
import { pageInsetX as u } from "../../lib/page-inset.js";
|
|
11
|
+
import { useTabTitle as d } from "../../hooks/useTabTitle.js";
|
|
12
|
+
import { useCallback as f, useEffect as p, useRef as m, useState as h } from "react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import { useNavigate as v } from "react-router";
|
|
14
15
|
//#region src/components/layout/TabStrip.tsx
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
let e =
|
|
16
|
+
function y({ onNew: r, onCloseRequest: a } = {}) {
|
|
17
|
+
let y = i(), x = d(), S = v(), C = m(null), w = m(null), T = m(null), E = m(!1), [D, O] = h(!1), k = l((e) => e.tabs), A = l((e) => e.activeTabId), j = e((e) => e.tabsMaxOpen), M = l((e) => e.switchTab), N = l((e) => e.closeTab), P = k.findIndex((e) => e.id === A);
|
|
18
|
+
p(() => {
|
|
19
|
+
let e = P === k.length - 1 ? T.current : w.current;
|
|
19
20
|
e && (e.scrollIntoView({
|
|
20
21
|
block: "nearest",
|
|
21
22
|
inline: "nearest",
|
|
22
|
-
behavior:
|
|
23
|
-
}),
|
|
23
|
+
behavior: E.current ? "smooth" : "auto"
|
|
24
|
+
}), E.current = !0);
|
|
24
25
|
}, [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
A,
|
|
27
|
+
P,
|
|
28
|
+
k.length
|
|
28
29
|
]);
|
|
29
|
-
let
|
|
30
|
-
let n =
|
|
31
|
-
n && (
|
|
30
|
+
let F = f((e, t) => {
|
|
31
|
+
let n = k[e];
|
|
32
|
+
n && (M(n.id), S({
|
|
32
33
|
pathname: n.pathname,
|
|
33
34
|
search: n.search || void 0
|
|
34
35
|
}));
|
|
35
36
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
40
|
-
let t =
|
|
37
|
+
k,
|
|
38
|
+
M,
|
|
39
|
+
S
|
|
40
|
+
]), I = f((e) => {
|
|
41
|
+
let t = k[e];
|
|
41
42
|
if (!t) return;
|
|
42
|
-
if (
|
|
43
|
-
|
|
43
|
+
if (a) {
|
|
44
|
+
a("current", t.id);
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
|
-
let n = t.id ===
|
|
47
|
-
if (
|
|
48
|
-
let n =
|
|
47
|
+
let n = t.id === A;
|
|
48
|
+
if (N(t.id), n) {
|
|
49
|
+
let n = k.filter((e) => e.id !== t.id);
|
|
49
50
|
if (n.length > 0) {
|
|
50
51
|
let t = n[e < n.length ? e : n.length - 1];
|
|
51
|
-
|
|
52
|
+
S({
|
|
52
53
|
pathname: t.pathname,
|
|
53
54
|
search: t.search || void 0
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}, [
|
|
58
|
-
O,
|
|
59
59
|
k,
|
|
60
|
-
|
|
61
|
-
x,
|
|
62
|
-
i
|
|
63
|
-
]), I = d((e) => {
|
|
64
|
-
D(!1), i ? i(e) : e === "current" && N >= 0 && F(N);
|
|
65
|
-
}, [
|
|
60
|
+
A,
|
|
66
61
|
N,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]), L =
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
S,
|
|
63
|
+
a
|
|
64
|
+
]), L = f((e) => {
|
|
65
|
+
O(!1), a ? a(e) : e === "current" && P >= 0 && I(P);
|
|
66
|
+
}, [
|
|
67
|
+
P,
|
|
68
|
+
I,
|
|
69
|
+
a
|
|
70
|
+
]), R = f(() => {
|
|
71
|
+
r ? r() : S("/");
|
|
72
|
+
}, [r, S]);
|
|
73
|
+
if (k.length === 0) return null;
|
|
74
|
+
let z = P >= 0 && k.length > 1 && k[P]?.closable !== !1, B = c(k, A, "others").length > 0, V = c(k, A, "right").length > 0, H = k.length >= j ? "danger" : k.length >= Math.ceil(j * .8) ? "warning" : "normal", U = H === "danger" ? "var(--danger)" : H === "warning" ? "var(--warn)" : "var(--text-3)";
|
|
75
|
+
return /* @__PURE__ */ _("div", {
|
|
75
76
|
style: {
|
|
76
77
|
display: "flex",
|
|
77
78
|
alignItems: "stretch",
|
|
@@ -81,7 +82,7 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
81
82
|
overflow: "hidden",
|
|
82
83
|
flexShrink: 0
|
|
83
84
|
},
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ _("div", {
|
|
85
86
|
className: "scrollbar-none",
|
|
86
87
|
style: {
|
|
87
88
|
display: "flex",
|
|
@@ -90,22 +91,22 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
90
91
|
flex: 1,
|
|
91
92
|
gap: 0
|
|
92
93
|
},
|
|
93
|
-
children: [
|
|
94
|
-
let r =
|
|
95
|
-
return /* @__PURE__ */
|
|
94
|
+
children: [k.map((e, t) => {
|
|
95
|
+
let r = t === P, i = k.length > 1 && e.closable !== !1;
|
|
96
|
+
return /* @__PURE__ */ _("div", {
|
|
96
97
|
"data-testid": "tabstrip-tab",
|
|
97
|
-
ref: r ?
|
|
98
|
-
onClick: (e) =>
|
|
98
|
+
ref: r ? w : void 0,
|
|
99
|
+
onClick: (e) => F(t, { newTab: e.metaKey || e.ctrlKey }),
|
|
99
100
|
onAuxClick: (e) => {
|
|
100
|
-
e.button === 1 && (e.preventDefault(),
|
|
101
|
+
e.button === 1 && (e.preventDefault(), I(t));
|
|
101
102
|
},
|
|
102
|
-
title:
|
|
103
|
+
title: x(e),
|
|
103
104
|
style: {
|
|
104
105
|
display: "flex",
|
|
105
106
|
alignItems: "center",
|
|
106
107
|
gap: 6,
|
|
107
108
|
height: "100%",
|
|
108
|
-
...
|
|
109
|
+
...u(11),
|
|
109
110
|
background: r ? "var(--surface)" : "transparent",
|
|
110
111
|
borderRight: "1px solid var(--border)",
|
|
111
112
|
borderTop: r ? "2px solid var(--accent)" : "2px solid transparent",
|
|
@@ -120,26 +121,26 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
120
121
|
fontWeight: r ? 500 : 400
|
|
121
122
|
},
|
|
122
123
|
children: [
|
|
123
|
-
e.icon && /* @__PURE__ */
|
|
124
|
+
e.icon && /* @__PURE__ */ g("span", {
|
|
124
125
|
style: {
|
|
125
126
|
color: r ? "var(--accent)" : "var(--text-4)",
|
|
126
127
|
display: "flex"
|
|
127
128
|
},
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ g(o, {
|
|
129
130
|
name: e.icon,
|
|
130
131
|
size: 12
|
|
131
132
|
})
|
|
132
133
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ g("span", {
|
|
134
135
|
style: {
|
|
135
136
|
flex: 1,
|
|
136
137
|
whiteSpace: "nowrap",
|
|
137
138
|
overflow: "hidden",
|
|
138
139
|
textOverflow: "ellipsis"
|
|
139
140
|
},
|
|
140
|
-
children:
|
|
141
|
+
children: x(e)
|
|
141
142
|
}),
|
|
142
|
-
e.dirty && /* @__PURE__ */
|
|
143
|
+
e.dirty && /* @__PURE__ */ g("span", {
|
|
143
144
|
style: {
|
|
144
145
|
width: 6,
|
|
145
146
|
height: 6,
|
|
@@ -147,14 +148,14 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
147
148
|
background: "var(--warn)",
|
|
148
149
|
flexShrink: 0
|
|
149
150
|
},
|
|
150
|
-
title:
|
|
151
|
+
title: y("shell.tabs.unsaved", "Unsaved changes")
|
|
151
152
|
}),
|
|
152
|
-
i && /* @__PURE__ */
|
|
153
|
+
i && /* @__PURE__ */ g("button", {
|
|
153
154
|
onClick: (e) => {
|
|
154
|
-
e.stopPropagation(),
|
|
155
|
+
e.stopPropagation(), I(t);
|
|
155
156
|
},
|
|
156
|
-
"aria-label":
|
|
157
|
-
title:
|
|
157
|
+
"aria-label": y("shell.tabs.close_named", "Close {title}", { title: x(e) }),
|
|
158
|
+
title: y("shell.tabs.close_tab", "Close tab"),
|
|
158
159
|
style: {
|
|
159
160
|
display: "flex",
|
|
160
161
|
background: "transparent",
|
|
@@ -171,14 +172,14 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
171
172
|
onMouseLeave: (e) => {
|
|
172
173
|
e.currentTarget.style.background = "transparent", e.currentTarget.style.color = "var(--text-4)";
|
|
173
174
|
},
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ g(n.x, { size: 11 })
|
|
175
176
|
})
|
|
176
177
|
]
|
|
177
178
|
}, e.id);
|
|
178
|
-
}), /* @__PURE__ */
|
|
179
|
-
ref:
|
|
180
|
-
onClick:
|
|
181
|
-
title:
|
|
179
|
+
}), /* @__PURE__ */ g("button", {
|
|
180
|
+
ref: T,
|
|
181
|
+
onClick: R,
|
|
182
|
+
title: y("shell.tabs.new", "New tab ({keys})", { keys: s("T") }),
|
|
182
183
|
style: {
|
|
183
184
|
width: 32,
|
|
184
185
|
background: "transparent",
|
|
@@ -190,12 +191,12 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
190
191
|
alignItems: "center",
|
|
191
192
|
justifyContent: "center"
|
|
192
193
|
},
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ g(n.plus, { size: 13 })
|
|
194
195
|
})]
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ _("div", {
|
|
196
197
|
className: "tabstrip-utility",
|
|
197
198
|
style: {
|
|
198
|
-
...
|
|
199
|
+
...u(10),
|
|
199
200
|
fontSize: 11,
|
|
200
201
|
color: "var(--text-4)",
|
|
201
202
|
display: "flex",
|
|
@@ -205,32 +206,32 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
205
206
|
flexShrink: 0
|
|
206
207
|
},
|
|
207
208
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ _("span", {
|
|
209
210
|
"data-testid": "tabstrip-tab-count",
|
|
210
211
|
style: {
|
|
211
212
|
display: "flex",
|
|
212
213
|
alignItems: "center",
|
|
213
214
|
gap: 3,
|
|
214
|
-
color:
|
|
215
|
-
fontWeight:
|
|
215
|
+
color: U,
|
|
216
|
+
fontWeight: H === "normal" ? 400 : 600
|
|
216
217
|
},
|
|
217
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ _("span", {
|
|
218
219
|
className: "mono num",
|
|
219
220
|
children: [
|
|
220
|
-
|
|
221
|
+
k.length,
|
|
221
222
|
"/",
|
|
222
|
-
|
|
223
|
+
j
|
|
223
224
|
]
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ g("span", {
|
|
225
226
|
className: "tabstrip-tabs-label",
|
|
226
227
|
style: { color: "var(--text-3)" },
|
|
227
|
-
children:
|
|
228
|
+
children: t(y, "shell.tabs.count_label", j, {
|
|
228
229
|
one: "tab",
|
|
229
230
|
other: "tabs"
|
|
230
231
|
})
|
|
231
232
|
})]
|
|
232
233
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ g("span", {
|
|
234
235
|
className: "tabstrip-utility-divider",
|
|
235
236
|
style: {
|
|
236
237
|
width: 1,
|
|
@@ -238,11 +239,11 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
238
239
|
background: "var(--border)"
|
|
239
240
|
}
|
|
240
241
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
ref:
|
|
243
|
-
onClick: () =>
|
|
244
|
-
title:
|
|
245
|
-
"aria-label":
|
|
242
|
+
/* @__PURE__ */ g("button", {
|
|
243
|
+
ref: C,
|
|
244
|
+
onClick: () => O(!0),
|
|
245
|
+
title: y("shell.tabs.actions", "Tab actions"),
|
|
246
|
+
"aria-label": y("shell.tabs.actions", "Tab actions"),
|
|
246
247
|
"data-testid": "tabstrip-actions-button",
|
|
247
248
|
style: {
|
|
248
249
|
width: 24,
|
|
@@ -262,54 +263,54 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
|
|
|
262
263
|
onMouseLeave: (e) => {
|
|
263
264
|
e.currentTarget.style.background = "transparent";
|
|
264
265
|
},
|
|
265
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ g(n.more, { size: 13 })
|
|
266
267
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
open:
|
|
269
|
-
anchor:
|
|
270
|
-
onClose: () =>
|
|
271
|
-
canCloseCurrent:
|
|
272
|
-
canCloseOthers:
|
|
273
|
-
canCloseRight:
|
|
274
|
-
onAction:
|
|
268
|
+
/* @__PURE__ */ g(b, {
|
|
269
|
+
open: D,
|
|
270
|
+
anchor: C.current,
|
|
271
|
+
onClose: () => O(!1),
|
|
272
|
+
canCloseCurrent: z,
|
|
273
|
+
canCloseOthers: B,
|
|
274
|
+
canCloseRight: V,
|
|
275
|
+
onAction: L
|
|
275
276
|
})
|
|
276
277
|
]
|
|
277
278
|
})]
|
|
278
279
|
});
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
let d =
|
|
282
|
-
return /* @__PURE__ */
|
|
281
|
+
function b({ open: e, anchor: t, onClose: o, canCloseCurrent: s, canCloseOthers: c, canCloseRight: l, onAction: u }) {
|
|
282
|
+
let d = i();
|
|
283
|
+
return /* @__PURE__ */ _(r, {
|
|
283
284
|
open: e,
|
|
284
285
|
onClose: o,
|
|
285
|
-
anchor:
|
|
286
|
+
anchor: t,
|
|
286
287
|
align: "end",
|
|
287
288
|
width: 230,
|
|
288
289
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
icon: /* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ g(a, {
|
|
291
|
+
icon: /* @__PURE__ */ g(n.x, { size: 13 }),
|
|
291
292
|
disabled: !s,
|
|
292
293
|
title: s ? void 0 : d("shell.tabs.none_closable", "No current tab can be closed"),
|
|
293
294
|
onClick: () => u("current"),
|
|
294
295
|
children: d("shell.tabs.close_current", "Close current tab")
|
|
295
296
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
icon: /* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ g(a, {
|
|
298
|
+
icon: /* @__PURE__ */ g(n.x, { size: 13 }),
|
|
298
299
|
disabled: !c,
|
|
299
300
|
title: c ? void 0 : d("shell.tabs.no_others", "No other tabs"),
|
|
300
301
|
onClick: () => u("others"),
|
|
301
302
|
children: d("shell.tabs.close_others", "Close others")
|
|
302
303
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
icon: /* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ g(a, {
|
|
305
|
+
icon: /* @__PURE__ */ g(n.x, { size: 13 }),
|
|
305
306
|
disabled: !l,
|
|
306
307
|
title: l ? void 0 : d("shell.tabs.none_right", "No tabs to the right"),
|
|
307
308
|
onClick: () => u("right"),
|
|
308
309
|
children: d("shell.tabs.close_right", "Close tabs to the right")
|
|
309
310
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
icon: /* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ g(a, { divider: !0 }),
|
|
312
|
+
/* @__PURE__ */ g(a, {
|
|
313
|
+
icon: /* @__PURE__ */ g(n.trash, { size: 13 }),
|
|
313
314
|
danger: !0,
|
|
314
315
|
onClick: () => u("all"),
|
|
315
316
|
children: d("shell.tabs.close_all", "Close all tabs")
|
|
@@ -318,4 +319,4 @@ function y({ open: e, anchor: a, onClose: o, canCloseCurrent: s, canCloseOthers:
|
|
|
318
319
|
});
|
|
319
320
|
}
|
|
320
321
|
//#endregion
|
|
321
|
-
export {
|
|
322
|
+
export { y as TabStrip };
|
|
@@ -33,38 +33,38 @@ var f = {
|
|
|
33
33
|
function m(e) {
|
|
34
34
|
return e ? f[e] ?? p : f.production;
|
|
35
35
|
}
|
|
36
|
-
function h({ tenant: s, tenants: d,
|
|
37
|
-
let
|
|
38
|
-
if (!
|
|
39
|
-
let t =
|
|
36
|
+
function h({ tenant: s, tenants: d, role: f, onSwitch: p, busy: h, compact: _, locked: v, lockedReason: y }) {
|
|
37
|
+
let b = r(), x = f ?? b("profile.role.none", "No role"), [S, C] = o(!1), [w, T] = o(""), E = a(null), D = s?.env, O = m(D), k = s?.name || "—", A = i(() => d.filter((e) => e.is_member !== !1), [d]), j = i(() => d.filter((e) => e.is_member === !1), [d]), M = d.length >= u, N = (e) => {
|
|
38
|
+
if (!w) return !0;
|
|
39
|
+
let t = w.toLowerCase();
|
|
40
40
|
return e.name.toLowerCase().includes(t) || e.code.toLowerCase().includes(t);
|
|
41
|
-
},
|
|
41
|
+
}, P = A.filter(N), F = j.filter(N), I = w !== "" && P.length === 0 && F.length === 0;
|
|
42
42
|
return /* @__PURE__ */ l("div", {
|
|
43
43
|
style: { position: "relative" },
|
|
44
44
|
children: [/* @__PURE__ */ l("button", {
|
|
45
|
-
ref:
|
|
46
|
-
onClick: () => !
|
|
45
|
+
ref: E,
|
|
46
|
+
onClick: () => !v && C((e) => !e),
|
|
47
47
|
"data-testid": "tenant-chip",
|
|
48
|
-
"data-locked":
|
|
48
|
+
"data-locked": v ? "true" : void 0,
|
|
49
49
|
style: {
|
|
50
50
|
display: "flex",
|
|
51
51
|
alignItems: "center",
|
|
52
52
|
gap: 8,
|
|
53
53
|
height: 28,
|
|
54
54
|
padding: "0 8px 0 8px",
|
|
55
|
-
maxWidth:
|
|
55
|
+
maxWidth: _ ? "100%" : void 0,
|
|
56
56
|
minWidth: 0,
|
|
57
57
|
background: "var(--surface-2)",
|
|
58
58
|
border: "1px solid var(--border)",
|
|
59
59
|
borderRadius: "var(--radius-md)",
|
|
60
|
-
cursor:
|
|
60
|
+
cursor: v ? "not-allowed" : "pointer",
|
|
61
61
|
color: "var(--text)",
|
|
62
62
|
fontSize: 12.5,
|
|
63
63
|
fontWeight: 500,
|
|
64
|
-
opacity:
|
|
64
|
+
opacity: v ? .6 : 1
|
|
65
65
|
},
|
|
66
|
-
title:
|
|
67
|
-
disabled:
|
|
66
|
+
title: v ? y || b("shell.tenant.switch_disabled", "Tenant switching is disabled") : b("shell.tenant.current", "Current tenant / environment"),
|
|
67
|
+
disabled: h || v,
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ c(t.tenant, {
|
|
70
70
|
size: 13,
|
|
@@ -77,13 +77,13 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
77
77
|
style: {
|
|
78
78
|
fontWeight: 600,
|
|
79
79
|
minWidth: 0,
|
|
80
|
-
overflow:
|
|
81
|
-
textOverflow:
|
|
82
|
-
whiteSpace:
|
|
80
|
+
overflow: _ ? "hidden" : void 0,
|
|
81
|
+
textOverflow: _ ? "ellipsis" : void 0,
|
|
82
|
+
whiteSpace: _ ? "nowrap" : void 0
|
|
83
83
|
},
|
|
84
|
-
children:
|
|
84
|
+
children: k
|
|
85
85
|
}),
|
|
86
|
-
|
|
86
|
+
D && /* @__PURE__ */ c("span", {
|
|
87
87
|
className: "mono",
|
|
88
88
|
style: {
|
|
89
89
|
padding: "2px 6px",
|
|
@@ -92,12 +92,12 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
92
92
|
fontWeight: 700,
|
|
93
93
|
letterSpacing: "0.06em",
|
|
94
94
|
textTransform: "uppercase",
|
|
95
|
-
background:
|
|
96
|
-
color:
|
|
97
|
-
border: `1px solid ${
|
|
95
|
+
background: O.bg,
|
|
96
|
+
color: O.fg,
|
|
97
|
+
border: `1px solid ${O.border}`,
|
|
98
98
|
flex: "none"
|
|
99
99
|
},
|
|
100
|
-
children:
|
|
100
|
+
children: D
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ c(t.down, {
|
|
103
103
|
size: 11,
|
|
@@ -108,9 +108,9 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
108
108
|
})
|
|
109
109
|
]
|
|
110
110
|
}), /* @__PURE__ */ l(n, {
|
|
111
|
-
open:
|
|
112
|
-
anchor:
|
|
113
|
-
onClose: () =>
|
|
111
|
+
open: S,
|
|
112
|
+
anchor: E.current,
|
|
113
|
+
onClose: () => C(!1),
|
|
114
114
|
width: 300,
|
|
115
115
|
align: "start",
|
|
116
116
|
children: [
|
|
@@ -128,7 +128,7 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
128
128
|
fontWeight: 700,
|
|
129
129
|
textTransform: "uppercase"
|
|
130
130
|
},
|
|
131
|
-
children:
|
|
131
|
+
children: b("shell.tenant.active_scope", "Active scope")
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ l("div", {
|
|
134
134
|
style: {
|
|
@@ -147,9 +147,9 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
147
147
|
fontSize: 13,
|
|
148
148
|
fontWeight: 600
|
|
149
149
|
},
|
|
150
|
-
children:
|
|
150
|
+
children: k
|
|
151
151
|
}),
|
|
152
|
-
|
|
152
|
+
D && /* @__PURE__ */ c("span", {
|
|
153
153
|
className: "mono",
|
|
154
154
|
style: {
|
|
155
155
|
marginLeft: "auto",
|
|
@@ -157,10 +157,10 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
157
157
|
borderRadius: "var(--radius-xs)",
|
|
158
158
|
fontSize: 10,
|
|
159
159
|
fontWeight: 700,
|
|
160
|
-
background:
|
|
161
|
-
color:
|
|
160
|
+
background: O.bg,
|
|
161
|
+
color: O.fg
|
|
162
162
|
},
|
|
163
|
-
children:
|
|
163
|
+
children: D
|
|
164
164
|
})
|
|
165
165
|
]
|
|
166
166
|
}),
|
|
@@ -170,26 +170,26 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
170
170
|
fontSize: 11,
|
|
171
171
|
color: "var(--text-3)"
|
|
172
172
|
},
|
|
173
|
-
children: e(
|
|
173
|
+
children: e(b("shell.tenant.role", "Role: {role}"), { role: /* @__PURE__ */ c("span", {
|
|
174
174
|
style: {
|
|
175
175
|
color: "var(--text-2)",
|
|
176
176
|
fontWeight: 500
|
|
177
177
|
},
|
|
178
|
-
children:
|
|
178
|
+
children: x
|
|
179
179
|
}) })
|
|
180
180
|
})
|
|
181
181
|
]
|
|
182
182
|
}),
|
|
183
|
-
|
|
183
|
+
M && /* @__PURE__ */ c("div", {
|
|
184
184
|
style: {
|
|
185
185
|
padding: "8px 10px 4px",
|
|
186
186
|
borderBottom: "1px solid var(--divider)"
|
|
187
187
|
},
|
|
188
188
|
children: /* @__PURE__ */ c("input", {
|
|
189
189
|
type: "text",
|
|
190
|
-
value:
|
|
191
|
-
onChange: (e) =>
|
|
192
|
-
placeholder:
|
|
190
|
+
value: w,
|
|
191
|
+
onChange: (e) => T(e.target.value),
|
|
192
|
+
placeholder: b("shell.tenant.search", "Search tenants…"),
|
|
193
193
|
autoFocus: !0,
|
|
194
194
|
"data-testid": "tenant-switch-search",
|
|
195
195
|
style: {
|
|
@@ -212,29 +212,29 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
212
212
|
},
|
|
213
213
|
children: [
|
|
214
214
|
/* @__PURE__ */ c(g, {
|
|
215
|
-
label:
|
|
216
|
-
tenants:
|
|
215
|
+
label: j.length > 0 ? b("shell.tenant.yours", "Your tenants") : b("shell.tenant.switch", "Switch tenant"),
|
|
216
|
+
tenants: P,
|
|
217
217
|
activeID: s?.id,
|
|
218
218
|
onPick: (e) => {
|
|
219
|
-
|
|
219
|
+
C(!1), p(e);
|
|
220
220
|
}
|
|
221
221
|
}),
|
|
222
|
-
|
|
223
|
-
label:
|
|
224
|
-
tenants:
|
|
222
|
+
F.length > 0 && /* @__PURE__ */ c(g, {
|
|
223
|
+
label: b("shell.tenant.all_admin", "All tenants (admin)"),
|
|
224
|
+
tenants: F,
|
|
225
225
|
activeID: s?.id,
|
|
226
226
|
onPick: (e) => {
|
|
227
|
-
|
|
227
|
+
C(!1), p(e);
|
|
228
228
|
}
|
|
229
229
|
}),
|
|
230
|
-
|
|
230
|
+
I && /* @__PURE__ */ c("div", {
|
|
231
231
|
style: {
|
|
232
232
|
padding: "12px 12px",
|
|
233
233
|
fontSize: 12,
|
|
234
234
|
color: "var(--text-3)",
|
|
235
235
|
textAlign: "center"
|
|
236
236
|
},
|
|
237
|
-
children:
|
|
237
|
+
children: b("shell.tenant.no_matches", "No tenants match “{query}”.", { query: w })
|
|
238
238
|
})
|
|
239
239
|
]
|
|
240
240
|
}),
|
|
@@ -254,7 +254,7 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
|
|
|
254
254
|
marginTop: 2,
|
|
255
255
|
flexShrink: 0
|
|
256
256
|
}
|
|
257
|
-
}), /* @__PURE__ */ c("span", { children:
|
|
257
|
+
}), /* @__PURE__ */ c("span", { children: b("shell.tenant.switch_hint", "Switching tenant reloads all data. Unsaved changes in open tabs will prompt.") })]
|
|
258
258
|
})
|
|
259
259
|
]
|
|
260
260
|
})]
|
|
@@ -334,13 +334,6 @@ function _({ tenant: e, tone: n, active: i, onPick: a }) {
|
|
|
334
334
|
children: e.env
|
|
335
335
|
}) : null,
|
|
336
336
|
/* @__PURE__ */ c("span", { style: { flex: 1 } }),
|
|
337
|
-
e.role && /* @__PURE__ */ c("span", {
|
|
338
|
-
style: {
|
|
339
|
-
fontSize: 10.5,
|
|
340
|
-
color: "var(--text-3)"
|
|
341
|
-
},
|
|
342
|
-
children: e.role
|
|
343
|
-
}),
|
|
344
337
|
i && /* @__PURE__ */ c(t.check, {
|
|
345
338
|
size: 12,
|
|
346
339
|
style: {
|