@overvis/hmi-workspace-ui 0.1.0 → 0.1.1
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/alarm-list-sheAq-pb.js +414 -0
- package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
- package/dist/alert-dialog-B60PF7S9.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
- package/dist/diagnostic-text-CsbENUNI.js +116 -0
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
- package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
- package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
- package/dist/editor-page-BWbVGJvU.js +1337 -0
- package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
- package/dist/entity-controls-BCuRx882.js +71 -0
- package/dist/errors-Cawve9yD.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
- package/dist/host.js +8143 -675
- package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5149 -5345
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-CH28rYUt.js} +54 -58
- package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
- package/dist/page-DpdkOGGb.js +449 -0
- package/dist/page-HCGXXGjy.js +507 -0
- package/dist/panel-BCwBlB_h.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
- package/dist/presence-code-cT6wxlTg.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
- package/dist/retention-note-nequESpo.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
- package/dist/run-text-DneX9rWh.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-yM4B49nd.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-CjXPq9Lk.js} +1 -2
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { i as A } from "./run-text-DvaO8LDF.js";
|
|
1
|
+
import { rr as e } from "./quick-report-DEqqwQxR.js";
|
|
2
|
+
import { f as t, h as n, m as r } from "./i18n-Dt6xbSK6.js";
|
|
3
|
+
import { X as i, Y as a, jt as o } from "./alert-dialog-B60PF7S9.js";
|
|
4
|
+
import { A as s, G as c, H as l, L as u, M as d, R as f, U as p, V as m, Y as h, a as g, c as _, n as v, o as y, r as b, z as x } from "./spinner-BRcNKwjH.js";
|
|
5
|
+
import { A as S, C, E as w, S as T, w as E, x as D } from "./panel-BCwBlB_h.js";
|
|
6
|
+
import { r as O, t as k } from "./alarm-rule-lists-DaA4soF4.js";
|
|
7
|
+
import { i as A } from "./run-text-DneX9rWh.js";
|
|
9
8
|
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
10
9
|
import { ChevronRightIcon as P, PlusIcon as F, Trash2Icon as I } from "lucide-react";
|
|
11
10
|
import { resolveLocalized as L } from "@overvis/hmi-shared";
|
|
12
11
|
import { automationCommandRoles as R, automationSeverities as z } from "@overvis/hmi-shared/automation";
|
|
13
12
|
import { starterPlaceholderShown as B } from "@overvis/hmi-shared/starter";
|
|
14
|
-
|
|
13
|
+
// src/workspace/setup/starters/starter-form.ts
|
|
15
14
|
var V = {
|
|
16
15
|
s: 1e3,
|
|
17
16
|
min: 6e4,
|
|
@@ -160,8 +159,7 @@ function re(e) {
|
|
|
160
159
|
}
|
|
161
160
|
return t;
|
|
162
161
|
}
|
|
163
|
-
|
|
164
|
-
//#region src/workspace/setup/starters/starter-fields.tsx
|
|
162
|
+
// src/workspace/setup/starters/starter-fields.tsx
|
|
165
163
|
var ie = ["view_only", ...R], ae = [
|
|
166
164
|
1,
|
|
167
165
|
2,
|
|
@@ -176,27 +174,27 @@ var ie = ["view_only", ...R], ae = [
|
|
|
176
174
|
"recipients",
|
|
177
175
|
"text"
|
|
178
176
|
]);
|
|
179
|
-
function oe({ starters: e, onPick:
|
|
180
|
-
let r =
|
|
177
|
+
function oe({ starters: e, onPick: t }) {
|
|
178
|
+
let r = n();
|
|
181
179
|
return /* @__PURE__ */ M(w, {
|
|
182
180
|
className: "gap-2",
|
|
183
|
-
children: e.map((e) => /* @__PURE__ */ N(
|
|
181
|
+
children: e.map((e) => /* @__PURE__ */ N(D, {
|
|
184
182
|
variant: "outline",
|
|
185
183
|
render: /* @__PURE__ */ M("button", { type: "button" }),
|
|
186
184
|
className: "text-left",
|
|
187
185
|
onClick: () => {
|
|
188
|
-
|
|
186
|
+
t(e.id);
|
|
189
187
|
},
|
|
190
|
-
children: [/* @__PURE__ */ N(
|
|
188
|
+
children: [/* @__PURE__ */ N(C, { children: [/* @__PURE__ */ M(S, { children: L(e.name, r) }), /* @__PURE__ */ M(E, {
|
|
191
189
|
className: "line-clamp-none",
|
|
192
190
|
children: L(e.description, r)
|
|
193
|
-
})] }), /* @__PURE__ */ M(
|
|
191
|
+
})] }), /* @__PURE__ */ M(T, { children: /* @__PURE__ */ M(P, { className: "size-4 text-muted-foreground" }) })]
|
|
194
192
|
}, e.id))
|
|
195
193
|
});
|
|
196
194
|
}
|
|
197
195
|
function se({ workspaceId: e, placeholders: t, values: n, onChange: r, problems: i, data: a, newKey: o }) {
|
|
198
196
|
let s = re(i), c = (e, t) => s.get(e)?.map((e) => Z(e, t));
|
|
199
|
-
return /* @__PURE__ */ M(
|
|
197
|
+
return /* @__PURE__ */ M(m, { children: t.filter((e) => B(e, t, n)).map((t) => t.kind === "list" ? /* @__PURE__ */ M(ue, {
|
|
200
198
|
workspaceId: e,
|
|
201
199
|
placeholder: t,
|
|
202
200
|
rows: Y(n[t.name]),
|
|
@@ -224,52 +222,52 @@ function se({ workspaceId: e, placeholders: t, values: n, onChange: r, problems:
|
|
|
224
222
|
problems: c(`/${t.name}`, t)
|
|
225
223
|
}, t.name)) });
|
|
226
224
|
}
|
|
227
|
-
function Z(
|
|
228
|
-
let r = (e) => e === void 0 ? "" : n.kind === "duration" && typeof e == "number" ? `${H(n, e)} ${Q(n.unit)}` : String(e), { args: i } =
|
|
229
|
-
switch (
|
|
230
|
-
case "required": return
|
|
231
|
-
case "invalid": return
|
|
232
|
-
case "unknown_placeholder": return
|
|
233
|
-
case "out_of_range": return i.min !== void 0 && i.max !== void 0 ?
|
|
225
|
+
function Z(e, n) {
|
|
226
|
+
let r = (e) => e === void 0 ? "" : n.kind === "duration" && typeof e == "number" ? `${H(n, e)} ${Q(n.unit)}` : String(e), { args: i } = e;
|
|
227
|
+
switch (e.code) {
|
|
228
|
+
case "required": return t("starter_problem_required");
|
|
229
|
+
case "invalid": return t("starter_problem_invalid");
|
|
230
|
+
case "unknown_placeholder": return t("starter_problem_unknown_placeholder");
|
|
231
|
+
case "out_of_range": return i.min !== void 0 && i.max !== void 0 ? t("starter_problem_out_of_range", {
|
|
234
232
|
min: r(i.min),
|
|
235
233
|
max: r(i.max)
|
|
236
|
-
}) : i.min === void 0 ? i.max === void 0 ?
|
|
237
|
-
case "too_few": return
|
|
238
|
-
case "too_many": return
|
|
239
|
-
case "duplicate": return
|
|
240
|
-
case "parameter_not_found": return
|
|
241
|
-
case "parameter_type": return i.expected === "boolean" ?
|
|
242
|
-
case "parameter_not_writable": return
|
|
243
|
-
case "parameter_not_on_endpoint": return
|
|
244
|
-
case "parameter_encoding": return
|
|
245
|
-
case "endpoint_not_found": return
|
|
246
|
-
case "alarm_rule_not_found": return
|
|
247
|
-
case "member_not_found": return
|
|
248
|
-
case "branch_not_found": return
|
|
249
|
-
case "file_name_invalid": return
|
|
250
|
-
case "file_name_taken": return
|
|
234
|
+
}) : i.min === void 0 ? i.max === void 0 ? t("starter_problem_invalid") : t("starter_problem_out_of_range_max", { max: r(i.max) }) : t("starter_problem_out_of_range_min", { min: r(i.min) });
|
|
235
|
+
case "too_few": return t("starter_problem_too_few", { min: String(i.min ?? "") });
|
|
236
|
+
case "too_many": return t("starter_problem_too_many", { max: String(i.max ?? "") });
|
|
237
|
+
case "duplicate": return t("starter_problem_duplicate");
|
|
238
|
+
case "parameter_not_found": return t("starter_problem_parameter_not_found");
|
|
239
|
+
case "parameter_type": return i.expected === "boolean" ? t("starter_problem_parameter_type_boolean") : i.expected === "number" ? t("starter_problem_parameter_type_number") : t("starter_problem_parameter_type", { expected: String(i.expected ?? "") });
|
|
240
|
+
case "parameter_not_writable": return t("starter_problem_parameter_not_writable");
|
|
241
|
+
case "parameter_not_on_endpoint": return t("starter_problem_parameter_not_on_endpoint");
|
|
242
|
+
case "parameter_encoding": return t("starter_problem_parameter_encoding");
|
|
243
|
+
case "endpoint_not_found": return t("starter_problem_endpoint_not_found");
|
|
244
|
+
case "alarm_rule_not_found": return t("starter_problem_alarm_rule_not_found");
|
|
245
|
+
case "member_not_found": return t("starter_problem_member_not_found");
|
|
246
|
+
case "branch_not_found": return t("starter_problem_branch_not_found");
|
|
247
|
+
case "file_name_invalid": return t("starter_problem_file_name_invalid");
|
|
248
|
+
case "file_name_taken": return t("starter_problem_file_name_taken");
|
|
251
249
|
}
|
|
252
250
|
}
|
|
253
|
-
function Q(
|
|
254
|
-
switch (
|
|
255
|
-
case "s": return
|
|
256
|
-
case "min": return
|
|
257
|
-
case "h": return
|
|
251
|
+
function Q(e) {
|
|
252
|
+
switch (e) {
|
|
253
|
+
case "s": return t("starter_unit_s");
|
|
254
|
+
case "min": return t("starter_unit_min");
|
|
255
|
+
case "h": return t("starter_unit_h");
|
|
258
256
|
}
|
|
259
257
|
}
|
|
260
|
-
function ce(
|
|
261
|
-
switch (
|
|
262
|
-
case 1: return
|
|
263
|
-
case 2: return
|
|
264
|
-
case 3: return
|
|
265
|
-
case 4: return
|
|
266
|
-
case 5: return
|
|
267
|
-
case 6: return
|
|
268
|
-
default: return
|
|
258
|
+
function ce(e) {
|
|
259
|
+
switch (e) {
|
|
260
|
+
case 1: return t("report_weekday_mon");
|
|
261
|
+
case 2: return t("report_weekday_tue");
|
|
262
|
+
case 3: return t("report_weekday_wed");
|
|
263
|
+
case 4: return t("report_weekday_thu");
|
|
264
|
+
case 5: return t("report_weekday_fri");
|
|
265
|
+
case 6: return t("report_weekday_sat");
|
|
266
|
+
default: return t("report_weekday_sun");
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
269
|
function le() {
|
|
272
|
-
let e =
|
|
270
|
+
let e = r();
|
|
273
271
|
return (t) => {
|
|
274
272
|
switch (t) {
|
|
275
273
|
case "owner": return e("automation_role_owner");
|
|
@@ -280,52 +278,52 @@ function le() {
|
|
|
280
278
|
}
|
|
281
279
|
};
|
|
282
280
|
}
|
|
283
|
-
function ue({ workspaceId: e, placeholder:
|
|
284
|
-
let d =
|
|
281
|
+
function ue({ workspaceId: e, placeholder: t, rows: i, onChange: a, data: s, newKey: l, problemsAt: u }) {
|
|
282
|
+
let d = r(), f = n(), m = `/${t.name}`, h = t.itemLabel === void 0 ? void 0 : L(t.itemLabel, f), g = (e) => h === void 0 ? d("starter_row", { number: String(e + 1) }) : `${h} ${String(e + 1)}`, _ = t.fields.filter((e) => X.has(e.kind)), v = t.fields.filter((e) => !X.has(e.kind)), y = (e, n) => /* @__PURE__ */ M(o, {
|
|
285
283
|
type: "button",
|
|
286
284
|
variant: "ghost",
|
|
287
285
|
size: "icon-sm",
|
|
288
|
-
"aria-label": d("starter_remove_row", { row:
|
|
289
|
-
disabled: i.length <=
|
|
286
|
+
"aria-label": d("starter_remove_row", { row: g(n) }),
|
|
287
|
+
disabled: i.length <= t.minItems,
|
|
290
288
|
onClick: () => {
|
|
291
|
-
|
|
289
|
+
a(i.filter((t) => t.key !== e.key));
|
|
292
290
|
},
|
|
293
291
|
children: /* @__PURE__ */ M(I, {})
|
|
294
|
-
}),
|
|
295
|
-
id: `starter-${
|
|
292
|
+
}), b = (n, r, o, c = !1) => /* @__PURE__ */ M($, {
|
|
293
|
+
id: `starter-${t.name}-${n.key}-${o.name}`,
|
|
296
294
|
workspaceId: e,
|
|
297
|
-
placeholder:
|
|
295
|
+
placeholder: o,
|
|
298
296
|
...c ? {
|
|
299
|
-
label:
|
|
297
|
+
label: g(r),
|
|
300
298
|
labelHidden: c
|
|
301
299
|
} : {},
|
|
302
|
-
value:
|
|
300
|
+
value: n.fields[o.name],
|
|
303
301
|
onChange: (e) => {
|
|
304
|
-
|
|
305
|
-
...
|
|
302
|
+
a(i.map((t) => t.key === n.key ? {
|
|
303
|
+
...t,
|
|
306
304
|
fields: {
|
|
307
|
-
...
|
|
308
|
-
[
|
|
305
|
+
...t.fields,
|
|
306
|
+
[o.name]: e
|
|
309
307
|
}
|
|
310
|
-
} :
|
|
308
|
+
} : t), `${m}/${String(r)}/${o.name}`);
|
|
311
309
|
},
|
|
312
310
|
data: s,
|
|
313
|
-
problems:
|
|
314
|
-
},
|
|
315
|
-
return /* @__PURE__ */ N(
|
|
316
|
-
/* @__PURE__ */ M(
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */ M(O, { texts:
|
|
319
|
-
|
|
311
|
+
problems: u(`${m}/${String(r)}/${o.name}`, o)
|
|
312
|
+
}, o.name), [S] = t.fields;
|
|
313
|
+
return /* @__PURE__ */ N(c, { children: [
|
|
314
|
+
/* @__PURE__ */ M(p, { children: L(t.label, f) }),
|
|
315
|
+
t.help === void 0 ? null : /* @__PURE__ */ M(x, { children: L(t.help, f) }),
|
|
316
|
+
/* @__PURE__ */ M(O, { texts: u(m, t) }),
|
|
317
|
+
t.fields.length === 1 && S !== void 0 ? /* @__PURE__ */ M("div", {
|
|
320
318
|
className: "flex flex-col gap-2",
|
|
321
319
|
children: i.map((e, t) => /* @__PURE__ */ N("div", {
|
|
322
320
|
className: "flex items-start gap-2",
|
|
323
321
|
children: [/* @__PURE__ */ M("div", {
|
|
324
322
|
className: "min-w-0 flex-1",
|
|
325
|
-
children:
|
|
323
|
+
children: b(e, t, S, !0)
|
|
326
324
|
}), /* @__PURE__ */ M("div", {
|
|
327
325
|
className: "flex h-9 items-center",
|
|
328
|
-
children:
|
|
326
|
+
children: y(e, t)
|
|
329
327
|
})]
|
|
330
328
|
}, e.key))
|
|
331
329
|
}) : /* @__PURE__ */ M("div", {
|
|
@@ -337,52 +335,52 @@ function ue({ workspaceId: e, placeholder: r, rows: i, onChange: o, data: s, new
|
|
|
337
335
|
className: "flex items-center justify-between gap-2",
|
|
338
336
|
children: [/* @__PURE__ */ M("span", {
|
|
339
337
|
className: "font-medium",
|
|
340
|
-
children:
|
|
341
|
-
}),
|
|
338
|
+
children: g(t)
|
|
339
|
+
}), y(e, t)]
|
|
342
340
|
}),
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
_.map((n) => b(e, t, n)),
|
|
342
|
+
v.length === 0 ? null : /* @__PURE__ */ M("div", {
|
|
345
343
|
className: "\n grid grid-cols-1 gap-3\n sm:grid-cols-2\n ",
|
|
346
|
-
children:
|
|
344
|
+
children: v.map((n) => b(e, t, n))
|
|
347
345
|
})
|
|
348
346
|
]
|
|
349
347
|
}, e.key))
|
|
350
348
|
}),
|
|
351
|
-
/* @__PURE__ */ M("div", { children: /* @__PURE__ */ N(
|
|
349
|
+
/* @__PURE__ */ M("div", { children: /* @__PURE__ */ N(o, {
|
|
352
350
|
type: "button",
|
|
353
351
|
variant: "outline",
|
|
354
352
|
size: "sm",
|
|
355
|
-
disabled: i.length >=
|
|
353
|
+
disabled: i.length >= t.maxItems,
|
|
356
354
|
onClick: () => {
|
|
357
|
-
|
|
355
|
+
a([...i, G(t.fields, l())]);
|
|
358
356
|
},
|
|
359
357
|
children: [/* @__PURE__ */ M(F, { "data-icon": "inline-start" }), d("starter_add_row")]
|
|
360
358
|
}) })
|
|
361
359
|
] });
|
|
362
360
|
}
|
|
363
|
-
function $({ id:
|
|
364
|
-
let E =
|
|
361
|
+
function $({ id: t, workspaceId: o, placeholder: c, label: p, labelHidden: m = !1, value: S, onChange: C, data: w, problems: T }) {
|
|
362
|
+
let E = r(), D = n(), P = le(), F = "optional" in c && (c.optional ?? !1), I = p ?? L(c.label, D), R = c.help === void 0 ? void 0 : L(c.help, D), B = typeof S == "string" ? S : "", V = T !== void 0 && T.length > 0, H = F ? /* @__PURE__ */ M("span", {
|
|
365
363
|
className: "font-normal text-muted-foreground",
|
|
366
364
|
children: E("starter_optional")
|
|
367
|
-
}) : null, U = /* @__PURE__ */ N(
|
|
368
|
-
htmlFor:
|
|
369
|
-
className:
|
|
365
|
+
}) : null, U = /* @__PURE__ */ N(l, {
|
|
366
|
+
htmlFor: t,
|
|
367
|
+
className: m ? "sr-only" : void 0,
|
|
370
368
|
children: [I, H]
|
|
371
|
-
}), W = /* @__PURE__ */ N(j, { children: [R === void 0 ? null : /* @__PURE__ */ M(
|
|
369
|
+
}), W = /* @__PURE__ */ N(j, { children: [R === void 0 ? null : /* @__PURE__ */ M(x, { children: R }), /* @__PURE__ */ M(O, { texts: T })] }), G = (e, n) => /* @__PURE__ */ N(u, {
|
|
372
370
|
"data-invalid": V || void 0,
|
|
373
371
|
children: [
|
|
374
372
|
U,
|
|
375
|
-
/* @__PURE__ */ N(
|
|
376
|
-
id:
|
|
373
|
+
/* @__PURE__ */ N(s, {
|
|
374
|
+
id: t,
|
|
377
375
|
value: B,
|
|
378
376
|
"aria-invalid": V || void 0,
|
|
379
377
|
onChange: (e) => {
|
|
380
378
|
C(e.target.value);
|
|
381
379
|
},
|
|
382
|
-
children: [n ? /* @__PURE__ */ M(
|
|
380
|
+
children: [n ? /* @__PURE__ */ M(d, {
|
|
383
381
|
value: "",
|
|
384
382
|
children: E("starter_choose")
|
|
385
|
-
}) : null,
|
|
383
|
+
}) : null, e.map((e) => /* @__PURE__ */ M(d, {
|
|
386
384
|
value: e.id,
|
|
387
385
|
children: e.name
|
|
388
386
|
}, e.id))]
|
|
@@ -390,52 +388,52 @@ function $({ id: e, workspaceId: a, placeholder: u, label: d, labelHidden: y = !
|
|
|
390
388
|
W
|
|
391
389
|
]
|
|
392
390
|
});
|
|
393
|
-
switch (
|
|
391
|
+
switch (c.kind) {
|
|
394
392
|
case "parameter": {
|
|
395
|
-
let
|
|
396
|
-
return /* @__PURE__ */ M(
|
|
397
|
-
name:
|
|
393
|
+
let n = T !== void 0 || B === "" ? null : w.parameterProblem?.(c, B), r = n == null ? T : [Z(n, c)];
|
|
394
|
+
return /* @__PURE__ */ M(e, {
|
|
395
|
+
name: t,
|
|
398
396
|
label: I,
|
|
399
397
|
labelSuffix: H,
|
|
400
|
-
labelHidden:
|
|
401
|
-
workspaceId:
|
|
398
|
+
labelHidden: m,
|
|
399
|
+
workspaceId: o,
|
|
402
400
|
value: B,
|
|
403
401
|
onChange: C,
|
|
404
|
-
preferred: (e) => w.parameterFits(
|
|
402
|
+
preferred: (e) => w.parameterFits(c, e),
|
|
405
403
|
...R === void 0 ? {} : { description: R },
|
|
406
|
-
invalid:
|
|
407
|
-
errors: (
|
|
404
|
+
invalid: r !== void 0 && r.length > 0,
|
|
405
|
+
errors: (r ?? []).map((e) => ({ message: e }))
|
|
408
406
|
});
|
|
409
407
|
}
|
|
410
408
|
case "endpoint": return G(w.endpoints, !0);
|
|
411
409
|
case "alarmRule": return G(w.alarmRules, !0);
|
|
412
410
|
case "branch": return G(w.branches, !0);
|
|
413
|
-
case "choice": return G(
|
|
411
|
+
case "choice": return G(c.options.map((e) => ({
|
|
414
412
|
id: e.value,
|
|
415
413
|
name: L(e.label, D)
|
|
416
|
-
})),
|
|
414
|
+
})), c.default === void 0);
|
|
417
415
|
case "severity": return G(z.map((e) => ({
|
|
418
416
|
id: e,
|
|
419
417
|
name: A(e)
|
|
420
|
-
})),
|
|
418
|
+
})), c.default === void 0);
|
|
421
419
|
case "number":
|
|
422
420
|
case "duration": {
|
|
423
|
-
let
|
|
424
|
-
return /* @__PURE__ */ N(
|
|
421
|
+
let e = c.kind === "duration" ? Q(c.unit) : c.unit === void 0 ? "" : L(c.unit, D);
|
|
422
|
+
return /* @__PURE__ */ N(u, {
|
|
425
423
|
"data-invalid": V || void 0,
|
|
426
424
|
children: [
|
|
427
425
|
U,
|
|
428
|
-
/* @__PURE__ */ N(
|
|
429
|
-
id:
|
|
430
|
-
inputMode:
|
|
426
|
+
/* @__PURE__ */ N(v, { children: [/* @__PURE__ */ M(g, {
|
|
427
|
+
id: t,
|
|
428
|
+
inputMode: c.kind === "number" && c.integer === !0 ? "numeric" : "decimal",
|
|
431
429
|
value: B,
|
|
432
430
|
"aria-invalid": V || void 0,
|
|
433
431
|
onChange: (e) => {
|
|
434
432
|
C(e.target.value);
|
|
435
433
|
}
|
|
436
|
-
}),
|
|
434
|
+
}), e === "" ? null : /* @__PURE__ */ M(b, {
|
|
437
435
|
align: "inline-end",
|
|
438
|
-
children: /* @__PURE__ */ M(
|
|
436
|
+
children: /* @__PURE__ */ M(y, { children: e })
|
|
439
437
|
})] }),
|
|
440
438
|
W
|
|
441
439
|
]
|
|
@@ -444,16 +442,16 @@ function $({ id: e, workspaceId: a, placeholder: u, label: d, labelHidden: y = !
|
|
|
444
442
|
case "timeOfDay":
|
|
445
443
|
case "text":
|
|
446
444
|
case "fileName":
|
|
447
|
-
case "phone": return /* @__PURE__ */ N(
|
|
445
|
+
case "phone": return /* @__PURE__ */ N(u, {
|
|
448
446
|
"data-invalid": V || void 0,
|
|
449
447
|
children: [
|
|
450
448
|
U,
|
|
451
|
-
/* @__PURE__ */ M(
|
|
452
|
-
id:
|
|
453
|
-
...
|
|
449
|
+
/* @__PURE__ */ M(_, {
|
|
450
|
+
id: t,
|
|
451
|
+
...c.kind === "timeOfDay" ? {
|
|
454
452
|
type: "time",
|
|
455
453
|
step: 60
|
|
456
|
-
} :
|
|
454
|
+
} : c.kind === "text" ? { maxLength: c.maxLength } : c.kind === "phone" ? {
|
|
457
455
|
type: "tel",
|
|
458
456
|
autoComplete: "off"
|
|
459
457
|
} : {
|
|
@@ -470,39 +468,39 @@ function $({ id: e, workspaceId: a, placeholder: u, label: d, labelHidden: y = !
|
|
|
470
468
|
W
|
|
471
469
|
]
|
|
472
470
|
});
|
|
473
|
-
case "boolean": return /* @__PURE__ */ N(
|
|
471
|
+
case "boolean": return /* @__PURE__ */ N(u, {
|
|
474
472
|
orientation: "horizontal",
|
|
475
473
|
"data-invalid": V || void 0,
|
|
476
|
-
children: [/* @__PURE__ */ M(
|
|
477
|
-
id:
|
|
474
|
+
children: [/* @__PURE__ */ M(h, {
|
|
475
|
+
id: t,
|
|
478
476
|
checked: S === !0,
|
|
479
477
|
onCheckedChange: (e) => {
|
|
480
478
|
C(e);
|
|
481
479
|
}
|
|
482
|
-
}), /* @__PURE__ */ N(
|
|
483
|
-
htmlFor:
|
|
480
|
+
}), /* @__PURE__ */ N(f, { children: [/* @__PURE__ */ M(l, {
|
|
481
|
+
htmlFor: t,
|
|
484
482
|
children: I
|
|
485
483
|
}), W] })]
|
|
486
484
|
});
|
|
487
|
-
case "weekdays": return /* @__PURE__ */ N(
|
|
485
|
+
case "weekdays": return /* @__PURE__ */ N(u, {
|
|
488
486
|
"data-invalid": V || void 0,
|
|
489
487
|
children: [
|
|
490
|
-
/* @__PURE__ */ M(
|
|
491
|
-
id:
|
|
488
|
+
/* @__PURE__ */ M(l, {
|
|
489
|
+
id: t,
|
|
492
490
|
children: I
|
|
493
491
|
}),
|
|
494
|
-
/* @__PURE__ */ M(
|
|
492
|
+
/* @__PURE__ */ M(a, {
|
|
495
493
|
multiple: !0,
|
|
496
494
|
variant: "outline",
|
|
497
495
|
size: "sm",
|
|
498
496
|
spacing: 0,
|
|
499
497
|
className: "w-full",
|
|
500
|
-
"aria-labelledby":
|
|
498
|
+
"aria-labelledby": t,
|
|
501
499
|
value: (Array.isArray(S) ? S : []).map(String),
|
|
502
500
|
onValueChange: (e) => {
|
|
503
501
|
C(e.map(Number).filter((e) => Number.isInteger(e) && e >= 1 && e <= 7).sort((e, t) => e - t));
|
|
504
502
|
},
|
|
505
|
-
children: ae.map((e) => /* @__PURE__ */ M(
|
|
503
|
+
children: ae.map((e) => /* @__PURE__ */ M(i, {
|
|
506
504
|
value: String(e),
|
|
507
505
|
className: "min-w-0 flex-1 px-1",
|
|
508
506
|
children: ce(e)
|
|
@@ -512,67 +510,67 @@ function $({ id: e, workspaceId: a, placeholder: u, label: d, labelHidden: y = !
|
|
|
512
510
|
]
|
|
513
511
|
});
|
|
514
512
|
case "recipients": {
|
|
515
|
-
let
|
|
513
|
+
let e = typeof S == "object" && !Array.isArray(S) ? S : {
|
|
516
514
|
kind: "none",
|
|
517
515
|
roles: [],
|
|
518
516
|
memberIds: []
|
|
519
517
|
};
|
|
520
|
-
return /* @__PURE__ */ N(
|
|
518
|
+
return /* @__PURE__ */ N(u, {
|
|
521
519
|
"data-invalid": V || void 0,
|
|
522
520
|
children: [
|
|
523
521
|
U,
|
|
524
|
-
/* @__PURE__ */ N(
|
|
525
|
-
id:
|
|
526
|
-
value:
|
|
527
|
-
onChange: (
|
|
522
|
+
/* @__PURE__ */ N(s, {
|
|
523
|
+
id: t,
|
|
524
|
+
value: e.kind,
|
|
525
|
+
onChange: (t) => {
|
|
528
526
|
let n = [
|
|
529
527
|
"none",
|
|
530
528
|
"roles",
|
|
531
529
|
"members"
|
|
532
|
-
].find((
|
|
530
|
+
].find((e) => e === t.target.value);
|
|
533
531
|
n !== void 0 && C({
|
|
534
|
-
...
|
|
532
|
+
...e,
|
|
535
533
|
kind: n
|
|
536
534
|
});
|
|
537
535
|
},
|
|
538
536
|
children: [
|
|
539
|
-
F ? /* @__PURE__ */ M(
|
|
537
|
+
F ? /* @__PURE__ */ M(d, {
|
|
540
538
|
value: "none",
|
|
541
539
|
children: E("starter_recipients_none")
|
|
542
540
|
}) : null,
|
|
543
|
-
/* @__PURE__ */ M(
|
|
541
|
+
/* @__PURE__ */ M(d, {
|
|
544
542
|
value: "roles",
|
|
545
543
|
children: E("alarm_rule_recipients_roles")
|
|
546
544
|
}),
|
|
547
|
-
/* @__PURE__ */ M(
|
|
545
|
+
/* @__PURE__ */ M(d, {
|
|
548
546
|
value: "members",
|
|
549
547
|
children: E("alarm_rule_recipients_members")
|
|
550
548
|
})
|
|
551
549
|
]
|
|
552
550
|
}),
|
|
553
|
-
|
|
551
|
+
e.kind === "roles" ? /* @__PURE__ */ M("div", {
|
|
554
552
|
className: "flex flex-wrap gap-4",
|
|
555
|
-
children: ie.map((
|
|
553
|
+
children: ie.map((t) => /* @__PURE__ */ N("label", {
|
|
556
554
|
className: "flex items-center gap-2 text-sm",
|
|
557
|
-
children: [/* @__PURE__ */ M(
|
|
558
|
-
checked:
|
|
555
|
+
children: [/* @__PURE__ */ M(h, {
|
|
556
|
+
checked: e.roles.includes(t),
|
|
559
557
|
onCheckedChange: (n) => {
|
|
560
|
-
let r = n ? [...
|
|
558
|
+
let r = n ? [...e.roles, t] : e.roles.filter((e) => e !== t);
|
|
561
559
|
C({
|
|
562
|
-
...
|
|
560
|
+
...e,
|
|
563
561
|
roles: r
|
|
564
562
|
});
|
|
565
563
|
}
|
|
566
|
-
}), P(
|
|
567
|
-
},
|
|
564
|
+
}), P(t)]
|
|
565
|
+
}, t))
|
|
568
566
|
}) : null,
|
|
569
|
-
|
|
567
|
+
e.kind === "members" ? /* @__PURE__ */ M(k, {
|
|
570
568
|
members: w.members,
|
|
571
|
-
value:
|
|
572
|
-
onChange: (
|
|
569
|
+
value: e.memberIds,
|
|
570
|
+
onChange: (t) => {
|
|
573
571
|
C({
|
|
574
|
-
...
|
|
575
|
-
memberIds:
|
|
572
|
+
...e,
|
|
573
|
+
memberIds: t
|
|
576
574
|
});
|
|
577
575
|
}
|
|
578
576
|
}) : null,
|
|
@@ -582,5 +580,4 @@ function $({ id: e, workspaceId: a, placeholder: u, label: d, labelHidden: y = !
|
|
|
582
580
|
}
|
|
583
581
|
}
|
|
584
582
|
}
|
|
585
|
-
//#endregion
|
|
586
583
|
export { ne as i, se as n, K as r, oe as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Value as e } from "typebox/value";
|
|
2
2
|
import { alarmRuleType as t, automationType as n } from "@overvis/hmi-shared/automation";
|
|
3
|
-
|
|
3
|
+
// src/workspace/setup/automations/starter-handoff.ts
|
|
4
4
|
function r(e) {
|
|
5
5
|
return { overvisAutomationStarter: e };
|
|
6
6
|
}
|
|
@@ -15,5 +15,4 @@ function o(n) {
|
|
|
15
15
|
let r = i(n);
|
|
16
16
|
return e.Check(t, r) ? r : void 0;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { a as n, r, o as t };
|