@overvis/hmi-workspace-ui 0.1.0 → 0.1.2

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.
Files changed (130) hide show
  1. package/dist/alarm-list-DKFio0hg.js +414 -0
  2. package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
  3. package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
  4. package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
  5. package/dist/alert-dialog-D_iDv2lQ.js +891 -0
  6. package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
  7. package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
  8. package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
  9. package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
  10. package/dist/dashboard-bindings.js +1 -2
  11. package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
  12. package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
  13. package/dist/diagnostic-text-CYZFPiND.js +116 -0
  14. package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
  15. package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
  16. package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
  17. package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
  18. package/dist/editor-page-CaN52OQh.js +1337 -0
  19. package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
  20. package/dist/entity-controls-DJT47yeV.js +71 -0
  21. package/dist/errors-BAWoH_5w.js +25 -0
  22. package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
  23. package/dist/host.js +8254 -675
  24. package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
  25. package/dist/i18n.js +1 -2
  26. package/dist/index.js +5168 -5353
  27. package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
  28. package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
  29. package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.js} +6 -6
  30. package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
  31. package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
  32. package/dist/{notice-card-DyGywFsW.js → notice-card-V_0K0lO0.js} +54 -58
  33. package/dist/page-B5te_1Lc.js +449 -0
  34. package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
  35. package/dist/page-DxF7FOve.js +507 -0
  36. package/dist/panel-DuZD-cBP.js +949 -0
  37. package/dist/parameter-values.js +3 -16
  38. package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
  39. package/dist/presence-code-DsabLTZs.js +73 -0
  40. package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
  41. package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
  42. package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
  43. package/dist/retention-note-CmMeHV_u.js +40 -0
  44. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  45. package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
  46. package/dist/run-text-CDdfbKbg.js +112 -0
  47. package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
  48. package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
  49. package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
  50. package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
  51. package/dist/src/code-editor/code-editor.d.ts +3 -0
  52. package/dist/src/code-editor/taskfile-language.d.ts +22 -2
  53. package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
  54. package/dist/src/i18n/catalogs/de.d.ts +3 -0
  55. package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
  56. package/dist/src/i18n/catalogs/en.d.ts +3 -0
  57. package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
  58. package/dist/src/i18n/catalogs/pl.d.ts +3 -0
  59. package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
  60. package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
  61. package/dist/src/i18n/catalogs/ru.d.ts +7 -4
  62. package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
  63. package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
  64. package/dist/src/i18n/catalogs/uk.d.ts +7 -4
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
  67. package/dist/src/workspace/local-workspace-app.d.ts +1 -1
  68. package/dist/src/workspace/routes.d.ts +1 -1
  69. package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
  70. package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
  71. package/dist/styles.css +1 -1
  72. package/dist/ui.js +334 -374
  73. package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
  74. package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
  75. package/package.json +15 -9
  76. package/dist/alarm-list-BL3xQ5Lf.js +0 -423
  77. package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
  78. package/dist/alert-B8MAoIO8.js +0 -45
  79. package/dist/alert-dialog-CYkuMg5D.js +0 -129
  80. package/dist/api-error-9rQmUN5L.js +0 -93
  81. package/dist/breadcrumb-DzVL1yHa.js +0 -74
  82. package/dist/button-6SxPBYMz.js +0 -44
  83. package/dist/context-u9KJQmdB.js +0 -102
  84. package/dist/copyable-id-DYGiAcnq.js +0 -40
  85. package/dist/dashboard-context-CBfG6DoT.js +0 -191
  86. package/dist/date-time-picker-C3FhMXk6.js +0 -266
  87. package/dist/diagnostic-text-BAkzW0SE.js +0 -111
  88. package/dist/diagnostic-text-DiKd2i1w.js +0 -76
  89. package/dist/dialog-BIhQXcZC.js +0 -237
  90. package/dist/dialog-BqyIxMD-.js +0 -54
  91. package/dist/dropdown-menu-DSzbBq3v.js +0 -136
  92. package/dist/editor-page-BiSZJz5b.js +0 -1353
  93. package/dist/empty-B-QJ-06w.js +0 -59
  94. package/dist/entity-controls-D1K4Ot3O.js +0 -76
  95. package/dist/errors-CcsvDHu8.js +0 -26
  96. package/dist/history-page-sAAhG54V.js +0 -1400
  97. package/dist/icon-D-pR9htW.js +0 -57
  98. package/dist/index-page-DMH82fZe.js +0 -214
  99. package/dist/item-B5SaTFQU.js +0 -120
  100. package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
  101. package/dist/mutations-THtGG6Ai.js +0 -240
  102. package/dist/page-2KPemaAj.js +0 -328
  103. package/dist/page-6rIoTg2L.js +0 -459
  104. package/dist/page-C6giEoEd.js +0 -1935
  105. package/dist/page-DCbTxKsi.js +0 -313
  106. package/dist/page-DWO427hT.js +0 -208
  107. package/dist/page-LXu_2zm3.js +0 -137
  108. package/dist/page-aaUiVOnk.js +0 -513
  109. package/dist/page-header-RB2YFWlE.js +0 -55
  110. package/dist/page-title-CdCbiLt8.js +0 -14
  111. package/dist/panel-DDy8tUNR.js +0 -338
  112. package/dist/presence-code-BfSXr50g.js +0 -83
  113. package/dist/progress-C7cxNJA1.js +0 -83
  114. package/dist/provider-BOeYHi0n.js +0 -134
  115. package/dist/quick-report-CUVJnbKP.js +0 -416
  116. package/dist/radio-group-CZGqVbkJ.js +0 -26
  117. package/dist/retention-note-CHhA6gjY.js +0 -42
  118. package/dist/run-text-DvaO8LDF.js +0 -113
  119. package/dist/select-eNgZdZ30.js +0 -521
  120. package/dist/skeleton-6yk8Tdh5.js +0 -19
  121. package/dist/slider-DorDsoF8.js +0 -37
  122. package/dist/status-page-DAHiKM9P.js +0 -3286
  123. package/dist/switch-BqD0RH_G.js +0 -18
  124. package/dist/table-Q2-voLuw.js +0 -65
  125. package/dist/tabs-CSIucYFP.js +0 -57
  126. package/dist/theme-provider-BkRohQFU.js +0 -61
  127. package/dist/toggle-group-9Bs0Mm3r.js +0 -82
  128. package/dist/trpc-CvJUuUXp.js +0 -153
  129. package/dist/utils-CX-Pz5p6.js +0 -8
  130. package/dist/writability-BuH-spxv.js +0 -57
@@ -1,423 +0,0 @@
1
- import { r as e } from "./trpc-CvJUuUXp.js";
2
- import { h as t, m as n, n as r } from "./i18n-BgzakKoC.js";
3
- import { a as i, d as a, n as o, t as s } from "./mutation-form-validators-BNz5bsv1.js";
4
- import { A as c, G as l, H as u, L as d, M as f, U as p, V as m, Y as h, z as g } from "./spinner-C-HPNxOc.js";
5
- import { t as _ } from "./button-6SxPBYMz.js";
6
- import { n as v } from "./skeleton-6yk8Tdh5.js";
7
- import { n as y } from "./api-error-9rQmUN5L.js";
8
- import { t as b } from "./diagnostic-text-BAkzW0SE.js";
9
- import { t as x } from "./mutations-THtGG6Ai.js";
10
- import { n as S, r as C, t as w } from "./dialog-BqyIxMD-.js";
11
- import { n as T, r as E, t as D } from "./query-gate-DVhNIkge.js";
12
- import { i as O, n as k, r as A, t as j } from "./alarm-rule-lists-C5v1Kf7A.js";
13
- import { n as ee, t as te } from "./base-revision-YCO27zR4.js";
14
- import { i as M } from "./run-text-DvaO8LDF.js";
15
- import { r as N } from "./editor-language-To9MxloY.js";
16
- import { t as P } from "./starter-handoff-BA3ucMKL.js";
17
- import { useMemo as F, useRef as ne, useState as I } from "react";
18
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
19
- import { resolveLocalized as B } from "@overvis/hmi-shared";
20
- import { alarmRuleDiagnosticField as V, alarmRuleFormKey as H, alarmRuleFormSchema as U, alarmRuleFormToDocument as W, alarmRuleFormValues as G, alarmRuleFormVariables as K, automationCommandRoles as q, automationContextOf as J, automationDocumentVariables as Y, automationSeverities as X, newAlarmRuleFormValues as re, validateAlarmRule as Z } from "@overvis/hmi-shared/automation";
21
- import { useNavigate as Q } from "@tanstack/react-router";
22
- //#region src/workspace/setup/automations/alarm-rule-dialog.tsx
23
- var ie = ["view_only", ...q];
24
- function ae() {
25
- let e = n();
26
- return (t) => {
27
- switch (t) {
28
- case "owner": return e("automation_role_owner");
29
- case "admin": return e("automation_role_admin");
30
- case "editor": return e("automation_role_editor");
31
- case "operator": return e("automation_role_operator");
32
- case "view_only": return e("automation_role_view_only");
33
- default: return t;
34
- }
35
- };
36
- }
37
- function $(e, t, r, i) {
38
- let a = n();
39
- return F(() => {
40
- let n = /* @__PURE__ */ new Map(), o = W(e, r, i);
41
- if (!o.ok) return n.set(o.field, [o.problem === "duplicate_param" ? a("alarm_rule_param_duplicate") : o.problem === "unnamed_param" ? a("alarm_rule_param_unnamed") : a("alarm_rule_seconds_invalid")]), {
42
- byField: n,
43
- errors: 1
44
- };
45
- let s = Z(o.input, J(t), t.limits);
46
- for (let t of s.diagnostics) {
47
- let r = V(t.path, e) ?? "", i = t.code === "invalid_shape", o = i && /^\/variables\/\d+\/source\//.test(t.path) ? a("alarm_rule_variable_choose_source") : i && /^\/recipients\/(?:userIds|roles)$/.test(t.path) ? a("alarm_rule_recipients_choose") : b(t);
48
- n.set(r, [...n.get(r) ?? [], o]);
49
- }
50
- return {
51
- byField: n,
52
- errors: s.diagnostics.filter((e) => e.severity === "error").length
53
- };
54
- }, [
55
- e,
56
- t,
57
- r,
58
- i,
59
- a
60
- ]);
61
- }
62
- function oe({ workspaceId: r, alarmRuleId: i, starterHandoff: a }) {
63
- let o = n(), s = t(), c = Q(), l = e.useUtils(), [u, d] = I(0), f = i != null, [p] = I(() => f ? void 0 : P(a)), m = () => {
64
- c({
65
- to: "/workspace/$workspaceId/setup/automations/alarm-rules",
66
- params: { workspaceId: r }
67
- });
68
- }, h = e.automation.validationContext.useQuery({ workspaceId: r }), g = e.alarmRule.get.useQuery({ id: i ?? "" }, { enabled: f }), _ = e.endpoint.list.useQuery({ workspaceId: r }), b = e.alarmRule.list.useQuery({ workspaceId: r }), x = e.automation.list.useQuery({ workspaceId: r }), S = e.automation.members.useQuery({ workspaceId: r }), O = (e) => e.map((e) => ({
69
- id: e.id,
70
- name: B(e.name, s)
71
- })), k = h.data != null && _.data != null && b.data != null && x.data != null && S.data != null && (!f || g.data != null), A = h.isError || _.isError || b.isError || x.isError || S.isError || f && g.isError, j = {
72
- isLoading: h.isLoading || _.isLoading || b.isLoading || x.isLoading || S.isLoading || f && g.isLoading,
73
- isError: !k && A,
74
- error: f ? g.error : null,
75
- data: k ? {
76
- context: h.data,
77
- detail: g.data,
78
- endpoints: O(_.data.endpoints),
79
- alarmRules: O(b.data.items.filter((e) => e.id !== i)),
80
- automations: O(x.data.items),
81
- members: S.data.members
82
- } : void 0
83
- };
84
- return /* @__PURE__ */ R(w, {
85
- onClose: m,
86
- title: o(f ? "alarm_rule_edit_title" : "alarm_rule_create_title"),
87
- ...i == null ? {} : { entityId: i },
88
- contentClassName: "max-w-2xl sm:max-w-2xl",
89
- stickyChrome: !0,
90
- children: /* @__PURE__ */ R(E, {
91
- query: j,
92
- loading: /* @__PURE__ */ z("div", {
93
- className: "flex flex-col gap-4 p-4",
94
- children: [/* @__PURE__ */ R(v, { className: "h-8 w-64" }), /* @__PURE__ */ R(v, { className: "h-40 w-full" })]
95
- }),
96
- error: (e) => /* @__PURE__ */ R(T, {
97
- className: "p-4",
98
- message: f ? y(e ?? "alarm_rule_not_found") : o("error_request_failed"),
99
- onRetry: () => Promise.all([
100
- h.refetch(),
101
- _.refetch(),
102
- b.refetch(),
103
- x.refetch(),
104
- S.refetch(),
105
- ...f ? [g.refetch()] : []
106
- ])
107
- }),
108
- children: (e) => /* @__PURE__ */ z(C, { children: [A ? /* @__PURE__ */ R(D, {
109
- className: "m-4 mb-0",
110
- message: o("error_request_failed"),
111
- onRetry: () => Promise.all([
112
- h.refetch(),
113
- _.refetch(),
114
- b.refetch(),
115
- x.refetch(),
116
- S.refetch(),
117
- ...f ? [g.refetch()] : []
118
- ])
119
- }) : null, /* @__PURE__ */ R(se, {
120
- workspaceId: r,
121
- data: e,
122
- ...p === void 0 ? {} : { starter: p },
123
- onClose: m,
124
- onReload: async () => {
125
- if (i == null) return;
126
- let e = await l.client.alarmRule.get.query({ id: i });
127
- l.alarmRule.get.setData({ id: i }, e), d((e) => e + 1);
128
- }
129
- }, `${i ?? "new"}-${String(u)}`)] })
130
- })
131
- });
132
- }
133
- function se({ workspaceId: e, data: v, starter: y, onClose: b, onReload: C }) {
134
- let w = n(), T = r(), [E] = I(t()), D = ae(), N = x(e), { detail: P, context: F } = v, B = ee(P?.revision), [V] = I(P?.document ?? y ?? null), [K] = I(() => P == null ? y === void 0 ? re(w("alarm_rule_new_name"), Math.max(1e4, F.limits.minTriggerIntervalMs)) : G(y, null, E) : G(P.document, P.dashboardId, E)), q = ne(1e3), Y = () => H(q.current++), Q = i({
135
- defaultValues: K,
136
- validators: s({
137
- schema: U,
138
- submit: async (t) => {
139
- let n = W(t, V, E);
140
- if (!n.ok) return o(n, (e) => e.problem === "duplicate_param" ? w("alarm_rule_param_duplicate") : e.problem === "unnamed_param" ? w("alarm_rule_param_unnamed") : w("alarm_rule_seconds_invalid"));
141
- if (!Z(n.input, J(F), F.limits).ok) return {
142
- form: () => w("automation_editor_save_has_errors"),
143
- fields: {}
144
- };
145
- let r = t.dashboardId === "" ? null : t.dashboardId;
146
- return P == null ? await N.create.mutateAsync({
147
- workspaceId: e,
148
- document: n.input,
149
- dashboardId: r
150
- }) : await N.update.mutateAsync({
151
- id: P.id,
152
- document: n.input,
153
- dashboardId: r,
154
- ...B.baseRevision === void 0 ? {} : { baseRevision: B.baseRevision }
155
- }), null;
156
- },
157
- mapError: B.mapError(),
158
- onError: B.onError
159
- }),
160
- onSubmitInvalid: a,
161
- onSubmit: () => {
162
- T.success(w(P == null ? "alarm_rule_create_toast" : "alarm_rule_save_toast")), b();
163
- }
164
- }), $ = (t, n, r) => {
165
- let i = (e, t, r) => /* @__PURE__ */ z("div", {
166
- className: "flex flex-col gap-1",
167
- children: [/* @__PURE__ */ R(Q.AppField, {
168
- name: e,
169
- children: (e) => /* @__PURE__ */ R(e.TextField, {
170
- label: t,
171
- inputMode: "decimal",
172
- ...r === void 0 ? {} : { description: r }
173
- })
174
- }), /* @__PURE__ */ R(A, { texts: n(e) })]
175
- }), a = (e, t, i) => /* @__PURE__ */ z("div", {
176
- className: "flex flex-col gap-1",
177
- children: [/* @__PURE__ */ R(Q.AppField, {
178
- name: e,
179
- children: (n) => /* @__PURE__ */ R(n.FormulaField, {
180
- label: t,
181
- id: `alarm-rule-${e}`,
182
- language: r.condition,
183
- ...i === void 0 ? {} : { description: i }
184
- })
185
- }), /* @__PURE__ */ R(A, { texts: n(e) })]
186
- });
187
- return /* @__PURE__ */ z("div", {
188
- className: "flex flex-col gap-6",
189
- children: [
190
- /* @__PURE__ */ R(A, { texts: n("") }),
191
- /* @__PURE__ */ z(l, { children: [/* @__PURE__ */ R(p, { children: w("alarm_rule_section_rule") }), /* @__PURE__ */ z(m, { children: [
192
- /* @__PURE__ */ z("div", {
193
- className: "flex flex-col gap-1",
194
- children: [/* @__PURE__ */ R(Q.AppField, {
195
- name: "name",
196
- children: (e) => /* @__PURE__ */ R(e.TextField, {
197
- label: w("alarm_rule_field_name"),
198
- autoFocus: !0
199
- })
200
- }), /* @__PURE__ */ R(A, { texts: n("name") })]
201
- }),
202
- /* @__PURE__ */ R(Q.AppField, {
203
- name: "description",
204
- children: (e) => /* @__PURE__ */ R(e.TextAreaField, {
205
- label: w("alarm_rule_field_description"),
206
- rows: 2
207
- })
208
- }),
209
- /* @__PURE__ */ z("div", {
210
- className: "\n grid grid-cols-1 gap-4\n sm:grid-cols-2\n ",
211
- children: [/* @__PURE__ */ R(Q.AppField, {
212
- name: "severity",
213
- children: (e) => /* @__PURE__ */ z(d, { children: [/* @__PURE__ */ R(u, {
214
- htmlFor: "alarm-rule-severity",
215
- children: w("alarm_rule_field_severity")
216
- }), /* @__PURE__ */ R(c, {
217
- id: "alarm-rule-severity",
218
- value: e.state.value,
219
- onChange: (t) => {
220
- let n = X.find((e) => e === t.target.value);
221
- n !== void 0 && e.handleChange(n);
222
- },
223
- children: X.map((e) => /* @__PURE__ */ R(f, {
224
- value: e,
225
- children: M(e)
226
- }, e))
227
- })] })
228
- }), i("pollIntervalSeconds", w("alarm_rule_field_poll_interval"))]
229
- }),
230
- /* @__PURE__ */ R(Q.AppField, {
231
- name: "dashboardId",
232
- children: (t) => /* @__PURE__ */ R(t.DashboardPickerField, {
233
- label: w("automation_field_dashboard"),
234
- workspaceId: e,
235
- description: w("automation_field_dashboard_description")
236
- })
237
- })
238
- ] })] }),
239
- /* @__PURE__ */ z(l, { children: [
240
- /* @__PURE__ */ R(p, { children: w("alarm_rule_section_inputs") }),
241
- /* @__PURE__ */ R(g, { children: w("alarm_rule_section_inputs_description") }),
242
- /* @__PURE__ */ R(Q.AppField, {
243
- name: "variables",
244
- children: (t) => /* @__PURE__ */ R(O, {
245
- value: t.state.value,
246
- onChange: t.handleChange,
247
- formulaLanguage: r.value,
248
- data: v,
249
- workspaceId: e,
250
- at: n,
251
- newKey: Y
252
- })
253
- })
254
- ] }),
255
- /* @__PURE__ */ z(l, { children: [/* @__PURE__ */ R(p, { children: w("alarm_rule_section_condition") }), /* @__PURE__ */ z(m, { children: [
256
- a("condition", w("alarm_rule_field_condition"), w("alarm_rule_field_condition_description")),
257
- i("holdSeconds", w("alarm_rule_field_hold"), w("alarm_rule_field_hold_description")),
258
- a("clearCondition", w("alarm_rule_field_clear_condition"), w("alarm_rule_field_clear_condition_description")),
259
- i("clearHoldSeconds", w("alarm_rule_field_clear_hold"), w("alarm_rule_field_optional")),
260
- /* @__PURE__ */ R(Q.AppField, {
261
- name: "latching",
262
- children: (e) => /* @__PURE__ */ R(e.CheckboxField, {
263
- label: w("alarm_rule_field_latching"),
264
- description: w("alarm_rule_field_latching_description")
265
- })
266
- }),
267
- i("unavailableAfterSeconds", w("alarm_rule_field_unavailable_after"), w("alarm_rule_field_unavailable_after_description"))
268
- ] })] }),
269
- /* @__PURE__ */ z(l, { children: [/* @__PURE__ */ R(p, { children: w("alarm_rule_section_message") }), /* @__PURE__ */ z(m, { children: [
270
- /* @__PURE__ */ z("div", {
271
- className: "flex flex-col gap-1",
272
- children: [/* @__PURE__ */ R(Q.AppField, {
273
- name: "title",
274
- children: (e) => /* @__PURE__ */ R(e.TextField, {
275
- label: w("alarm_rule_field_title"),
276
- description: w("alarm_rule_field_title_description")
277
- })
278
- }), /* @__PURE__ */ R(A, { texts: n("title") })]
279
- }),
280
- /* @__PURE__ */ z("div", {
281
- className: "flex flex-col gap-1",
282
- children: [/* @__PURE__ */ R(Q.AppField, {
283
- name: "body",
284
- children: (e) => /* @__PURE__ */ R(e.TextAreaField, {
285
- label: w("alarm_rule_field_body"),
286
- rows: 3
287
- })
288
- }), /* @__PURE__ */ R(A, { texts: n("body") })]
289
- }),
290
- /* @__PURE__ */ R(Q.AppField, {
291
- name: "params",
292
- children: (e) => /* @__PURE__ */ R(k, {
293
- value: e.state.value,
294
- onChange: e.handleChange,
295
- formulaLanguage: r.value,
296
- at: n,
297
- newKey: Y
298
- })
299
- }),
300
- i("notifyDelaySeconds", w("alarm_rule_field_notify_delay"), w("alarm_rule_field_notify_delay_description")),
301
- /* @__PURE__ */ R(Q.AppField, {
302
- name: "recipients",
303
- children: (e) => /* @__PURE__ */ z(d, { children: [
304
- /* @__PURE__ */ R(u, {
305
- htmlFor: "alarm-rule-recipients",
306
- children: w("alarm_rule_field_recipients")
307
- }),
308
- /* @__PURE__ */ z(c, {
309
- id: "alarm-rule-recipients",
310
- value: e.state.value,
311
- onChange: (t) => {
312
- let n = [
313
- "default",
314
- "roles",
315
- "members"
316
- ].find((e) => e === t.target.value);
317
- n !== void 0 && e.handleChange(n);
318
- },
319
- children: [
320
- /* @__PURE__ */ R(f, {
321
- value: "default",
322
- children: w("alarm_rule_recipients_default")
323
- }),
324
- /* @__PURE__ */ R(f, {
325
- value: "roles",
326
- children: w("alarm_rule_recipients_roles")
327
- }),
328
- /* @__PURE__ */ R(f, {
329
- value: "members",
330
- children: w("alarm_rule_recipients_members")
331
- })
332
- ]
333
- }),
334
- /* @__PURE__ */ R(A, { texts: n("recipients") })
335
- ] })
336
- }),
337
- t.recipients === "roles" ? /* @__PURE__ */ R(Q.AppField, {
338
- name: "roles",
339
- children: (e) => /* @__PURE__ */ R("div", {
340
- className: "flex flex-wrap gap-4",
341
- children: ie.map((t) => /* @__PURE__ */ z("label", {
342
- className: "flex items-center gap-2 text-sm",
343
- children: [/* @__PURE__ */ R(h, {
344
- checked: e.state.value.includes(t),
345
- onCheckedChange: (n) => {
346
- e.handleChange(n ? [...e.state.value, t] : e.state.value.filter((e) => e !== t));
347
- }
348
- }), D(t)]
349
- }, t))
350
- })
351
- }) : null,
352
- t.recipients === "members" ? /* @__PURE__ */ R(Q.AppField, {
353
- name: "memberIds",
354
- children: (e) => /* @__PURE__ */ R(j, {
355
- members: v.members,
356
- value: e.state.value,
357
- onChange: e.handleChange
358
- })
359
- }) : null
360
- ] })] })
361
- ]
362
- });
363
- };
364
- return /* @__PURE__ */ R(Q.AppForm, { children: /* @__PURE__ */ R(Q.FormRoot, {
365
- layout: "dialog-fill",
366
- children: /* @__PURE__ */ R(S, {
367
- notice: /* @__PURE__ */ R(te, {
368
- base: B,
369
- onReload: C
370
- }),
371
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(_, {
372
- type: "button",
373
- variant: "outline",
374
- onClick: b,
375
- children: w("action_cancel")
376
- }), /* @__PURE__ */ R(Q.SubmitButton, {
377
- label: w(P == null ? "alarm_rule_create_submit" : "action_save"),
378
- pendingLabel: w("action_saving")
379
- })] }),
380
- children: /* @__PURE__ */ R(Q.Subscribe, {
381
- selector: (e) => ({
382
- values: e.values,
383
- show: P != null || y !== void 0 || e.isDirty || e.submissionAttempts > 0
384
- }),
385
- children: ({ values: e, show: t }) => /* @__PURE__ */ R(le, {
386
- values: e,
387
- context: F,
388
- original: V,
389
- locale: E,
390
- show: t,
391
- children: (t, n) => $(e, t, n)
392
- })
393
- })
394
- })
395
- }) });
396
- }
397
- function ce(e, t) {
398
- let r = n()("automation_language_docs");
399
- return F(() => {
400
- let n = Y({ variables: K(e) }, J(t));
401
- return {
402
- condition: N({
403
- variables: n,
404
- time: !0,
405
- result: ["boolean"]
406
- }, r),
407
- value: N({
408
- variables: n,
409
- time: !0
410
- }, r)
411
- };
412
- }, [
413
- e,
414
- t,
415
- r
416
- ]);
417
- }
418
- function le({ values: e, context: t, original: n, locale: r, show: i, children: a }) {
419
- let o = $(e, t, n, r);
420
- return a((e) => i ? o.byField.get(e) : void 0, ce(e, t));
421
- }
422
- //#endregion
423
- export { oe as SetupAlarmRuleFormDialog };
@@ -1,45 +0,0 @@
1
- import { t as e } from "./utils-CX-Pz5p6.js";
2
- import "react";
3
- import { jsx as t } from "react/jsx-runtime";
4
- import { cva as n } from "class-variance-authority";
5
- //#region src/ui/alert.tsx
6
- var r = n("\n group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm\n has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18\n has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2\n *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current\n *:[svg:not([class*='size-'])]:size-4\n ", {
7
- variants: { variant: {
8
- default: "bg-card text-card-foreground",
9
- destructive: "\n bg-card text-destructive\n *:data-[slot=alert-description]:text-destructive/90\n *:[svg]:text-current\n ",
10
- warning: "\n border-amber-500/40 bg-amber-500/10 text-amber-950\n *:data-[slot=alert-description]:text-amber-950/80\n dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100\n dark:*:data-[slot=alert-description]:text-amber-100/80\n *:[svg]:text-amber-700\n dark:*:[svg]:text-amber-300\n ",
11
- info: "\n border-sky-500/40 bg-sky-500/10 text-sky-950\n *:data-[slot=alert-description]:text-sky-950/80\n dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-100\n dark:*:data-[slot=alert-description]:text-sky-100/80\n *:[svg]:text-sky-700\n dark:*:[svg]:text-sky-300\n "
12
- } },
13
- defaultVariants: { variant: "default" }
14
- });
15
- function i({ className: n, variant: i, ...a }) {
16
- return /* @__PURE__ */ t("div", {
17
- "data-slot": "alert",
18
- role: "alert",
19
- className: e(r({ variant: i }), n),
20
- ...a
21
- });
22
- }
23
- function a({ className: n, ...r }) {
24
- return /* @__PURE__ */ t("div", {
25
- "data-slot": "alert-title",
26
- className: e("\n font-medium\n group-has-[>svg]/alert:col-start-2\n [&_a]:underline [&_a]:underline-offset-3\n [&_a]:hover:text-foreground\n ", n),
27
- ...r
28
- });
29
- }
30
- function o({ className: n, ...r }) {
31
- return /* @__PURE__ */ t("div", {
32
- "data-slot": "alert-description",
33
- className: e("\n text-sm text-balance text-muted-foreground\n md:text-pretty\n [&_a]:underline [&_a]:underline-offset-3\n [&_a]:hover:text-foreground\n [&_p:not(:last-child)]:mb-4\n ", n),
34
- ...r
35
- });
36
- }
37
- function s({ className: n, ...r }) {
38
- return /* @__PURE__ */ t("div", {
39
- "data-slot": "alert-action",
40
- className: e("absolute top-2 right-2", n),
41
- ...r
42
- });
43
- }
44
- //#endregion
45
- export { a as i, s as n, o as r, i as t };
@@ -1,129 +0,0 @@
1
- import { t as e } from "./utils-CX-Pz5p6.js";
2
- import { t } from "./button-6SxPBYMz.js";
3
- import { b as n, d as r, h as i, m as a, y as o } from "./dialog-BIhQXcZC.js";
4
- import * as s from "react";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { Dialog as u } from "@base-ui/react/dialog";
7
- //#region src/ui/alert-dialog.tsx
8
- var d = s.createContext(null);
9
- function f(e, t) {
10
- typeof e == "function" ? e(t) : e != null && (e.current = t);
11
- }
12
- function p({ onOpenChange: e, ...t }) {
13
- let n = s.useRef(null);
14
- return /* @__PURE__ */ c(d.Provider, {
15
- value: n,
16
- children: /* @__PURE__ */ c(u.Root, {
17
- "data-slot": "alert-dialog",
18
- ...r({
19
- ...t,
20
- disablePointerDismissal: !0,
21
- modal: !1,
22
- onOpenChange: (t, r) => {
23
- t || n.current?.focus(), e?.(t, r);
24
- }
25
- })
26
- })
27
- });
28
- }
29
- function m({ ref: e, ...t }) {
30
- let n = s.useContext(d);
31
- return /* @__PURE__ */ c(u.Trigger, {
32
- "data-slot": "alert-dialog-trigger",
33
- ...t,
34
- ref: (t) => {
35
- n != null && (n.current = t), f(e, t);
36
- }
37
- });
38
- }
39
- function h({ ...e }) {
40
- let t = n(), r = t?.container;
41
- return t != null && r == null ? null : /* @__PURE__ */ c(u.Portal, {
42
- "data-slot": "alert-dialog-portal",
43
- container: r ?? void 0,
44
- ...e
45
- });
46
- }
47
- function g({ className: t, ...r }) {
48
- o();
49
- let i = n();
50
- return /* @__PURE__ */ c(u.Backdrop, {
51
- "data-slot": "alert-dialog-overlay",
52
- forceRender: !0,
53
- className: e("\n inset-0 isolate z-50 bg-black/10 duration-100\n supports-backdrop-filter:backdrop-blur-xs\n data-open:animate-in data-open:fade-in-0\n data-closed:animate-out data-closed:fade-out-0\n ", i?.container == null ? "fixed" : "absolute", t),
54
- ...r
55
- });
56
- }
57
- function _({ className: t, size: r = "default", onKeyDown: o, ...s }) {
58
- let d = n(), f = a();
59
- return /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(g, {}), /* @__PURE__ */ c(u.Popup, {
60
- "data-slot": "alert-dialog-content",
61
- "data-theme": f,
62
- "data-size": r,
63
- className: e("\n group/alert-dialog-content top-1/2 left-1/2 z-50 grid max-h-[calc(100%-2rem)] w-full\n -translate-1/2 gap-4 overflow-y-auto rounded-xl border bg-popover p-4\n text-popover-foreground shadow-xl duration-100 outline-none\n data-[size=default]:max-w-xs\n data-[size=sm]:max-w-xs\n data-[size=default]:sm:max-w-sm\n data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95\n data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\n ", d?.container == null ? "fixed" : "absolute", t),
64
- onKeyDown: (e) => {
65
- i(e, e.currentTarget), o?.(e);
66
- },
67
- ...s,
68
- role: "alertdialog"
69
- })] });
70
- }
71
- function v({ className: t, ...n }) {
72
- return /* @__PURE__ */ c("div", {
73
- "data-slot": "alert-dialog-header",
74
- className: e("\n grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center\n has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr]\n has-data-[slot=alert-dialog-media]:gap-x-4\n sm:group-data-[size=default]/alert-dialog-content:place-items-start\n sm:group-data-[size=default]/alert-dialog-content:text-left\n sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]\n ", t),
75
- ...n
76
- });
77
- }
78
- function y({ className: t, ...n }) {
79
- return /* @__PURE__ */ c("div", {
80
- "data-slot": "alert-dialog-footer",
81
- className: e("\n -mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4\n group-data-[size=sm]/alert-dialog-content:grid\n group-data-[size=sm]/alert-dialog-content:grid-cols-2\n sm:flex-row sm:justify-end\n ", t),
82
- ...n
83
- });
84
- }
85
- function b({ className: t, ...n }) {
86
- return /* @__PURE__ */ c("div", {
87
- "data-slot": "alert-dialog-media",
88
- className: e("\n mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted\n sm:group-data-[size=default]/alert-dialog-content:row-span-2\n *:[svg:not([class*='size-'])]:size-6\n ", t),
89
- ...n
90
- });
91
- }
92
- function x({ className: t, ...n }) {
93
- return /* @__PURE__ */ c(u.Title, {
94
- "data-slot": "alert-dialog-title",
95
- className: e("\n text-base font-medium\n sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2\n ", t),
96
- ...n
97
- });
98
- }
99
- function S({ className: t, ...n }) {
100
- return /* @__PURE__ */ c(u.Description, {
101
- "data-slot": "alert-dialog-description",
102
- className: e("\n text-sm text-balance text-muted-foreground\n md:text-pretty\n *:[a]:underline *:[a]:underline-offset-3\n *:[a]:hover:text-foreground\n ", t),
103
- ...n
104
- });
105
- }
106
- function C({ className: n, variant: r = "default", size: i = "default", ...a }) {
107
- return /* @__PURE__ */ c(u.Close, {
108
- "data-slot": "alert-dialog-action",
109
- className: e(n),
110
- render: /* @__PURE__ */ c(t, {
111
- variant: r,
112
- size: i
113
- }),
114
- ...a
115
- });
116
- }
117
- function w({ className: n, variant: r = "outline", size: i = "default", ...a }) {
118
- return /* @__PURE__ */ c(u.Close, {
119
- "data-slot": "alert-dialog-cancel",
120
- className: e(n),
121
- render: /* @__PURE__ */ c(t, {
122
- variant: r,
123
- size: i
124
- }),
125
- ...a
126
- });
127
- }
128
- //#endregion
129
- export { S as a, b as c, x as d, m as f, _ as i, g as l, C as n, y as o, w as r, v as s, p as t, h as u };
@@ -1,93 +0,0 @@
1
- import { u as e, v as t } from "./i18n-BgzakKoC.js";
2
- import { isPublicApiErrorCode as n, publicApiErrorStatus as r } from "@overvis/hmi-shared/api-errors";
3
- import { API_INPUT_INVALID_CODE as i, API_INTERNAL_ERROR_CODE as a } from "@overvis/hmi-shared";
4
- //#region src/form/trpc-error-data.ts
5
- function o(e) {
6
- return typeof e == "object" && !!e && !Array.isArray(e);
7
- }
8
- function s(e) {
9
- return typeof e == "string" && e.length > 0 ? e : null;
10
- }
11
- function c(e) {
12
- if (!Array.isArray(e)) return;
13
- let t = e.filter(o).map((e) => {
14
- let t = Array.isArray(e.path) ? e.path.filter((e) => typeof e == "string" || typeof e == "number").map(String) : [], n = e.params;
15
- return {
16
- path: t,
17
- keyword: s(e.keyword) ?? "invalid",
18
- ...o(n) ? { params: { ...n } } : {}
19
- };
20
- });
21
- return t.length > 0 ? t : void 0;
22
- }
23
- function l(e) {
24
- return e != null && (e.code === "INTERNAL_SERVER_ERROR" || e.httpStatus === 500);
25
- }
26
- function u(e) {
27
- if (typeof e == "string") return {
28
- message: e.trim() || null,
29
- isInternalServerError: !1
30
- };
31
- if (!o(e)) return {
32
- message: null,
33
- isInternalServerError: !1
34
- };
35
- let t = o(e.shape) ? e.shape : void 0, n = o(e.data) ? e.data : void 0, r = o(t?.data) ? t.data : void 0, i = [n, r].filter((e) => e != null), a = i.map((e) => c(e.issues)).find((e) => e != null), u = i.map((e) => e.details).find(o);
36
- return {
37
- message: s(t?.message) ?? s(n?.message) ?? s(e.message),
38
- ...a == null ? {} : { issues: a },
39
- ...u == null ? {} : { details: { ...u } },
40
- isInternalServerError: l(n ?? r) || l(e)
41
- };
42
- }
43
- //#endregion
44
- //#region src/form/api-error.ts
45
- function d(e) {
46
- if (e == null) return null;
47
- if (n(e)) return e;
48
- let t = null;
49
- for (let i of Object.keys(r)) n(i) && e.includes(i) && i.length > (t?.length ?? 0) && (t = i);
50
- return t;
51
- }
52
- function f(e) {
53
- if (!(e instanceof Error) || e.name !== "TRPCClientError") return !1;
54
- let t = "shape" in e && e.shape != null || "data" in e && e.data != null, n = e.cause instanceof Error && e.cause.name === "AbortError";
55
- return !t && !n;
56
- }
57
- function p(e) {
58
- return d(u(e).message);
59
- }
60
- var m = [
61
- "name",
62
- "id",
63
- "branchId",
64
- "endpointId",
65
- "paramIds",
66
- "branchIds",
67
- "inputParamIds",
68
- "workspaceIds",
69
- "reason",
70
- "problem",
71
- "constraint",
72
- "templateId",
73
- "paths"
74
- ];
75
- function h(e, t) {
76
- if (t == null) return e;
77
- let n = [];
78
- for (let e of m) {
79
- let r = t[e];
80
- typeof r == "string" && r.length > 0 ? n.push(`${e}=${r}`) : Array.isArray(r) && r.length > 0 && r.every((e) => typeof e == "string") && n.push(`${e}=${r.join(",")}`);
81
- }
82
- return n.length === 0 ? e : `${e} (${n.join("; ")})`;
83
- }
84
- function g(n, r = t()) {
85
- let o = e(r);
86
- if (f(n)) return o("error_api_unreachable");
87
- let s = u(n);
88
- if (s.message === i) return o("error_input_invalid");
89
- let c = d(s.message);
90
- return c == null ? s.isInternalServerError || s.message === a ? o("error_request_failed") : o("error_unexpected_api", { code: s.message ?? "unknown" }) : h(o(`error_${c}`), s.details);
91
- }
92
- //#endregion
93
- export { g as n, u as r, p as t };