@deviceinsight/ng-ui-scale-lib 9.26.0 → 10.0.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.
Files changed (71) hide show
  1. package/README.md +1 -1
  2. package/dist/AccessEditModal-x6TMxYkb.js +90 -0
  3. package/dist/AccessEditModal-x6TMxYkb.js.map +1 -0
  4. package/dist/BundleManagementContainer-B49bT5K-.js +16 -0
  5. package/dist/BundleManagementContainer-B49bT5K-.js.map +1 -0
  6. package/dist/BundlesContainer-BHzbWPe9.js +914 -0
  7. package/dist/BundlesContainer-BHzbWPe9.js.map +1 -0
  8. package/dist/DatapointImport-BSFXGuOh.js +293 -0
  9. package/dist/DatapointImport-BSFXGuOh.js.map +1 -0
  10. package/dist/FileUploadInput-Ccq_3cug.js +45 -0
  11. package/dist/FileUploadInput-Ccq_3cug.js.map +1 -0
  12. package/dist/Files-BniY5cJF.js +347 -0
  13. package/dist/Files-BniY5cJF.js.map +1 -0
  14. package/dist/GlobalPowerBiReports-CayA5Bqf.js +103 -0
  15. package/dist/GlobalPowerBiReports-CayA5Bqf.js.map +1 -0
  16. package/dist/Graph-BqYDNKEo.js +53 -0
  17. package/dist/Graph-BqYDNKEo.js.map +1 -0
  18. package/dist/JsonSettingWidget-pI5gCFnm.js +53 -0
  19. package/dist/JsonSettingWidget-pI5gCFnm.js.map +1 -0
  20. package/dist/LicensesEditPage-Bef9P-VO.js +145 -0
  21. package/dist/LicensesEditPage-Bef9P-VO.js.map +1 -0
  22. package/dist/LicensesList-Bwb2a9OS.js +149 -0
  23. package/dist/LicensesList-Bwb2a9OS.js.map +1 -0
  24. package/dist/PropertiesEditPage-OrwneFF4.js +373 -0
  25. package/dist/PropertiesEditPage-OrwneFF4.js.map +1 -0
  26. package/dist/{PropertiesList-59c05fe4.js → PropertiesList-DRYRjsEu.js} +56 -58
  27. package/dist/PropertiesList-DRYRjsEu.js.map +1 -0
  28. package/dist/TemplateEditPage-B9v3VwGH.js +508 -0
  29. package/dist/TemplateEditPage-B9v3VwGH.js.map +1 -0
  30. package/dist/TemplateTextInput-CZFJ0oAT.js +45 -0
  31. package/dist/TemplateTextInput-CZFJ0oAT.js.map +1 -0
  32. package/dist/TemplatesListPage-BIZ0egkq.js +330 -0
  33. package/dist/TemplatesListPage-BIZ0egkq.js.map +1 -0
  34. package/dist/UserGroupAssignments-Wk1S9obw.js +297 -0
  35. package/dist/UserGroupAssignments-Wk1S9obw.js.map +1 -0
  36. package/dist/{UserGroupTheme-6768666a.js → UserGroupTheme-BLBu4kUe.js} +51 -53
  37. package/dist/UserGroupTheme-BLBu4kUe.js.map +1 -0
  38. package/dist/api.d.ts +805 -802
  39. package/dist/api.js +73 -77
  40. package/dist/api.js.map +1 -0
  41. package/dist/{consts-012135e5.js → consts-CZ_QkIyI.js} +1 -2
  42. package/dist/consts-CZ_QkIyI.js.map +1 -0
  43. package/dist/{customFileCategories-1b64ed45.js → customFileCategories-bG5S9qSy.js} +1 -0
  44. package/dist/customFileCategories-bG5S9qSy.js.map +1 -0
  45. package/dist/index.d.ts +3 -7
  46. package/dist/index.js +4729 -17113
  47. package/dist/index.js.map +1 -0
  48. package/dist/setTitle-Ck-71vC0.js +39377 -0
  49. package/dist/setTitle-Ck-71vC0.js.map +1 -0
  50. package/dist/style.css +1 -1
  51. package/dist/{useCanDeleteBundleVersion-64f35949.js → useCanDeleteBundleVersion-CUD1pDJ0.js} +1 -0
  52. package/dist/useCanDeleteBundleVersion-CUD1pDJ0.js.map +1 -0
  53. package/package.json +85 -108
  54. package/dist/AccessEditModal-c2178ad5.js +0 -92
  55. package/dist/BundleManagementContainer-60c28e65.js +0 -20
  56. package/dist/BundlesContainer-b3ee1991.js +0 -912
  57. package/dist/ContextBarContext-a6c59c97.js +0 -88776
  58. package/dist/DatapointImport-f6bdbdbc.js +0 -864
  59. package/dist/FileUploadInput-81bb787f.js +0 -44
  60. package/dist/Files-dc240d97.js +0 -364
  61. package/dist/GlobalPowerBiReports-3b7feef9.js +0 -11081
  62. package/dist/Graph-f5463f47.js +0 -25012
  63. package/dist/JsonSettingWidget-307658b8.js +0 -56
  64. package/dist/LicensesEditPage-f62cca26.js +0 -146
  65. package/dist/LicensesList-85279448.js +0 -150
  66. package/dist/PropertiesEditPage-4edb93b7.js +0 -371
  67. package/dist/TemplateEditPage-fe1b5f44.js +0 -508
  68. package/dist/TemplateTextInput-34e4356f.js +0 -49
  69. package/dist/TemplatesListPage-cd3194a7.js +0 -330
  70. package/dist/UserGroupAssignments-291f29f0.js +0 -297
  71. package/dist/index-738ab9ab.js +0 -18679
@@ -1,371 +0,0 @@
1
- import { ax as e, cC as E, aO as V, dq as F, dh as L, dp as B, ag as d, ah as G, bg as D, bj as U, bm as h, b8 as w, dr as R, dm as P, ds as O, al as M, dt as H, du as X, bS as _, aY as Y, dv as $ } from "./ContextBarContext-a6c59c97.js";
2
- import { useState as T, useEffect as z } from "react";
3
- import { Prompt as J, useLocation as Q, useHistory as W, useParams as Z } from "react-router-dom";
4
- import { getPropertyById as ee, updateProperty as re, createProperty as te } from "@deviceinsight/ng-ui-api-client";
5
- import { Button as v, Checkbox as A, Icon as k, ButtonRow as se, Spinner as ae } from "@deviceinsight/ng-ui-basic-components";
6
- import { messageBoxError as K, ContentHeader as ne } from "@deviceinsight/ng-ui-components";
7
- import "react-i18next";
8
- import "react-dom";
9
- import "i18next";
10
- import "ux4iot-react";
11
- function le(r) {
12
- const { options: s, children: x, onChange: c, values: i, ...t } = r;
13
- function a(u) {
14
- i.includes(u.value) ? c(i.filter((f) => f !== u.value)) : c([...i, u.value]);
15
- }
16
- return /* @__PURE__ */ e.jsx(E, { ...t, children: /* @__PURE__ */ e.jsx("div", { className: "buttonpicker", children: s.map((u) => /* @__PURE__ */ e.jsx(
17
- v,
18
- {
19
- onClick: () => a(u),
20
- className: V({
21
- active: i.includes(u.value)
22
- }),
23
- disabled: r.disabled,
24
- children: /* @__PURE__ */ e.jsx(F, { translationDescriptor: u.label })
25
- },
26
- String(u.value)
27
- )) }) });
28
- }
29
- function ie() {
30
- const {
31
- getValues: r,
32
- formState: { errors: s },
33
- trigger: x
34
- } = L(), [c, i] = T(!!r("allowedValues")), {
35
- field: { value: t, onChange: a },
36
- fieldState: { invalid: u }
37
- } = B({
38
- name: "allowedValues",
39
- rules: {
40
- validate: (n) => n == null || n != null && n.some((p) => p !== "") ? void 0 : "Required"
41
- }
42
- });
43
- function f(n) {
44
- a(t == null ? void 0 : t.filter((p, m) => m !== n));
45
- }
46
- function b(n) {
47
- a(t ? [...t, n] : [n]);
48
- }
49
- function g(n, p) {
50
- a(t == null ? void 0 : t.map((m, j) => p === j ? n : m));
51
- }
52
- async function y(n) {
53
- a(n ? [] : null), i(n), !n && u && await x();
54
- }
55
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
56
- /* @__PURE__ */ e.jsxs(
57
- E,
58
- {
59
- label: /* @__PURE__ */ e.jsxs("div", { className: "di allowed-values-header", children: [
60
- /* @__PURE__ */ e.jsx(A, { type: "toggle", value: c, toggleSmall: !0, onChange: y }),
61
- " ",
62
- /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.allowedValues", children: "Allowed Values" })
63
- ] }),
64
- error: s.allowedValues ? "Required" : void 0,
65
- className: "di allowed-values-container",
66
- children: [
67
- /* @__PURE__ */ e.jsx(A, { value: c, onChange: y }),
68
- (t == null ? void 0 : t.length) === 0 ? /* @__PURE__ */ e.jsx("div", { className: "empty-placeholder", children: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.allowedValuesEmptyPlaceholder", children: "No values" }) }) : /* @__PURE__ */ e.jsx("ul", { children: t == null ? void 0 : t.map((n, p) => /* @__PURE__ */ e.jsxs("li", { className: "item", children: [
69
- /* @__PURE__ */ e.jsx(E, { className: "value-container", children: /* @__PURE__ */ e.jsx(
70
- "input",
71
- {
72
- type: "text",
73
- value: n,
74
- onChange: (m) => g(m.target.value, p)
75
- }
76
- ) }),
77
- /* @__PURE__ */ e.jsx(v, { onClick: () => f(p), children: /* @__PURE__ */ e.jsx(k, { del: !0 }) })
78
- ] }, p)) })
79
- ]
80
- }
81
- ),
82
- c && /* @__PURE__ */ e.jsxs(v, { onClick: () => b(""), children: [
83
- /* @__PURE__ */ e.jsx(k, { add: !0 }),
84
- /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.allowedValuesAdd", children: "Add" })
85
- ] })
86
- ] });
87
- }
88
- const oe = ["STRING", "TEXT", "DATE", "LONG", "DOUBLE", "BOOLEAN", "IP", "GEO"].map((r) => ({
89
- value: r,
90
- name: r
91
- })), de = ["ASSET", "ASSET_GROUP", "ACCOUNT", "ACCOUNT_GROUP", "DATAPOINT"].map(
92
- (r) => ({
93
- value: r,
94
- label: r
95
- })
96
- );
97
- function ce() {
98
- return {
99
- key: "",
100
- type: "STRING",
101
- entityTargets: [],
102
- addToAll: !1,
103
- deletable: !0
104
- };
105
- }
106
- function ue({ editedProperty: r, isReadonly: s, onSubmit: x, onCancel: c }) {
107
- const { t: i } = G(), t = D({
108
- defaultValues: r || ce()
109
- }), {
110
- control: a,
111
- handleSubmit: u,
112
- watch: f,
113
- setError: b,
114
- formState: { isSubmitting: g, isDirty: y }
115
- } = t;
116
- function n() {
117
- async function l(o) {
118
- try {
119
- await x(o);
120
- } catch (S) {
121
- if (M.isAxiosError(S)) {
122
- const { fieldName: N, message: C } = H(S, i);
123
- N ? b(N, { message: C }) : K(C);
124
- } else
125
- K(X(i));
126
- }
127
- }
128
- return u(l, (o) => {
129
- console.warn("Validation error", o);
130
- })();
131
- }
132
- const p = f("type"), m = !!r, j = p === "STRING" || p === "TEXT", I = !!f("allowedValues");
133
- return /* @__PURE__ */ e.jsx(U, { ...t, children: /* @__PURE__ */ e.jsxs("div", { className: "property-form", children: [
134
- /* @__PURE__ */ e.jsx(
135
- h,
136
- {
137
- name: "key",
138
- control: a,
139
- rules: {
140
- required: i("properties.form.validation.key.required", {
141
- defaultValue: "Please enter a property key"
142
- })
143
- },
144
- render: ({ field: l, fieldState: { error: o } }) => /* @__PURE__ */ e.jsx(
145
- w,
146
- {
147
- ...l,
148
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.key", children: "Key" }),
149
- error: o == null ? void 0 : o.message,
150
- required: !0,
151
- disabled: s || m
152
- }
153
- )
154
- }
155
- ),
156
- /* @__PURE__ */ e.jsx(
157
- h,
158
- {
159
- name: "type",
160
- control: a,
161
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
162
- R,
163
- {
164
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.type", children: "Type" }),
165
- ...l,
166
- options: oe,
167
- required: !0,
168
- disabled: s || m
169
- }
170
- )
171
- }
172
- ),
173
- /* @__PURE__ */ e.jsx(
174
- h,
175
- {
176
- name: "entityTargets",
177
- control: a,
178
- rules: { validate: (l) => l.length === 0 ? "Required" : void 0 },
179
- render: ({ field: { value: l, onChange: o }, fieldState: { error: S } }) => /* @__PURE__ */ e.jsx(
180
- le,
181
- {
182
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.entityTargets", children: "Entity targets" }),
183
- values: l,
184
- onChange: o,
185
- options: de,
186
- error: S ? i("properties.form.validation.entityTargets.required", {
187
- defaultValue: "Please select a at least one entity target"
188
- }) : void 0,
189
- required: !0,
190
- disabled: s
191
- }
192
- )
193
- }
194
- ),
195
- /* @__PURE__ */ e.jsx(
196
- h,
197
- {
198
- name: "addToAll",
199
- control: a,
200
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
201
- P,
202
- {
203
- ...l,
204
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.addToSearch", children: "Add to Search" }),
205
- disabled: s || m
206
- }
207
- )
208
- }
209
- ),
210
- /* @__PURE__ */ e.jsx(
211
- h,
212
- {
213
- name: "unique",
214
- control: a,
215
- render: ({ field: { value: l, onChange: o } }) => /* @__PURE__ */ e.jsx(
216
- P,
217
- {
218
- value: !!l,
219
- onChange: o,
220
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.unique", children: "Unique" }),
221
- disabled: s
222
- }
223
- )
224
- }
225
- ),
226
- /* @__PURE__ */ e.jsx(
227
- h,
228
- {
229
- name: "final",
230
- control: a,
231
- render: ({ field: { value: l, onChange: o } }) => /* @__PURE__ */ e.jsx(
232
- P,
233
- {
234
- value: !!l,
235
- onChange: o,
236
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.final", children: "Final" }),
237
- disabled: s
238
- }
239
- )
240
- }
241
- ),
242
- j && !I && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
243
- /* @__PURE__ */ e.jsx(
244
- h,
245
- {
246
- name: "minLength",
247
- control: a,
248
- render: ({ field: { value: l, ...o } }) => /* @__PURE__ */ e.jsx(
249
- O,
250
- {
251
- ...o,
252
- value: l ?? void 0,
253
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.label.minLength", children: "Minimum length" }),
254
- placeholder: s ? i("properties.placeholder.notSet", { defaultValue: "Not set" }) : "0",
255
- readOnly: s
256
- }
257
- )
258
- }
259
- ),
260
- /* @__PURE__ */ e.jsx(
261
- h,
262
- {
263
- name: "maxLength",
264
- control: a,
265
- render: ({ field: { value: l, ...o } }) => /* @__PURE__ */ e.jsx(
266
- O,
267
- {
268
- ...o,
269
- value: l ?? void 0,
270
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.label.maxLength", children: "Maximum length" }),
271
- placeholder: s ? i("properties.placeholder.notSet", { defaultValue: "Not set" }) : "0",
272
- readOnly: s
273
- }
274
- )
275
- }
276
- ),
277
- /* @__PURE__ */ e.jsx(
278
- h,
279
- {
280
- name: "regularExpression",
281
- control: a,
282
- render: ({ field: { value: l, ...o } }) => /* @__PURE__ */ e.jsx(
283
- w,
284
- {
285
- ...o,
286
- value: l ?? void 0,
287
- label: /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.labels.regularExpression", children: "Regular expression" }),
288
- readOnly: s,
289
- placeholder: s ? i("properties.placeholder.notSet", { defaultValue: "Not set" }) : ""
290
- }
291
- )
292
- }
293
- )
294
- ] }),
295
- p === "STRING" && /* @__PURE__ */ e.jsx(ie, {}),
296
- /* @__PURE__ */ e.jsxs("div", { className: "formRequired", children: [
297
- "* ",
298
- /* @__PURE__ */ e.jsx(d, { i18nKey: "form.field.required", children: "required" })
299
- ] }),
300
- /* @__PURE__ */ e.jsxs(se, { dividing: !0, children: [
301
- /* @__PURE__ */ e.jsx(v, { className: "with-spinner", primary: !0, onClick: n, disabled: g, children: /* @__PURE__ */ e.jsx(d, { i18nKey: "general.actions.save", children: "Save" }) }),
302
- /* @__PURE__ */ e.jsx(v, { disabled: g, onClick: c, children: /* @__PURE__ */ e.jsx(d, { i18nKey: "general.actions.cancel", children: "Cancel" }) })
303
- ] }),
304
- /* @__PURE__ */ e.jsx(J, { message: "", when: y && !g })
305
- ] }) });
306
- }
307
- const pe = (r) => r ? {
308
- id: "properties.create.title",
309
- defaultValue: "Create Property"
310
- } : {
311
- id: "properties.edit.title",
312
- defaultValue: "Edit Property"
313
- }, me = /* @__PURE__ */ e.jsx(d, { i18nKey: "properties.saveSuccessMessage", children: "Property has been saved successfully." });
314
- function q(r) {
315
- if (r.type === "STRING" && r.allowedValues && r.allowedValues.length > 0) {
316
- const { regularExpression: s, maxLength: x, minLength: c, allowedValues: i, ...t } = r;
317
- return { ...t, allowedValues: [...new Set(i.filter((a) => a !== ""))] };
318
- }
319
- if (r.allowedValues && r.allowedValues.length === 0) {
320
- const { allowedValues: s, ...x } = r;
321
- return x;
322
- }
323
- if (r.type !== "STRING" && r.type !== "TEXT") {
324
- const { regularExpression: s, maxLength: x, minLength: c, ...i } = r;
325
- return i;
326
- }
327
- return r;
328
- }
329
- function Pe() {
330
- const { pathname: r } = Q(), s = W(), { propertyKey: x } = Z(), [c, i] = T(void 0), [t, a] = T(!0), [u, f] = T(!1);
331
- async function b(m) {
332
- try {
333
- const j = await ee(m);
334
- i(j);
335
- } catch (j) {
336
- console.error(j), f(!0);
337
- } finally {
338
- a(!1);
339
- }
340
- }
341
- z(() => {
342
- x && x !== "create" ? b(x) : a(!1);
343
- }, [x]);
344
- function g() {
345
- s.push(r.substring(0, r.lastIndexOf("/")));
346
- }
347
- async function y(m) {
348
- c ? await re(q(m)) : await te(q(m)), $(me), g();
349
- }
350
- function n() {
351
- g();
352
- }
353
- if (u)
354
- return /* @__PURE__ */ e.jsx(_, {});
355
- const p = pe(!c);
356
- return t ? /* @__PURE__ */ e.jsx(ae, { center: !0 }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
357
- /* @__PURE__ */ e.jsx(ne, { title: p, parentPageLink: !0 }),
358
- /* @__PURE__ */ e.jsx(
359
- ue,
360
- {
361
- editedProperty: c,
362
- isReadonly: !!c && !Y(["UPDATE_PROPERTY"]),
363
- onSubmit: y,
364
- onCancel: n
365
- }
366
- )
367
- ] });
368
- }
369
- export {
370
- Pe as default
371
- };