@nivaro/react 0.3.68 → 0.3.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/ItemEditForm.js +1754 -1742
- package/dist/shared/components/item-edit/FieldRenderer.js +186 -182
- package/dist/shared/components/item-edit/FileDownloadCount.js +94 -0
- package/dist/shared/components/item-edit/FilePickerField.js +319 -302
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +175 -138
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +53 -52
- package/dist/shared/lib/activity-sentence.js +154 -144
- package/dist/shared/lib/placement-behaviour.js +39 -31
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function o(t) {
|
|
2
2
|
if (typeof t == "string")
|
|
3
3
|
try {
|
|
4
4
|
const e = JSON.parse(t);
|
|
@@ -10,17 +10,17 @@ function c(t) {
|
|
|
10
10
|
}
|
|
11
11
|
const u = (t) => Array.isArray(t) ? t.filter((e) => typeof e == "string" && e !== "") : [], f = (t) => typeof t == "string" && t.trim() !== "" ? t : void 0;
|
|
12
12
|
function y(t) {
|
|
13
|
-
const e =
|
|
13
|
+
const e = o(t).text_rules;
|
|
14
14
|
if (!Array.isArray(e)) return [];
|
|
15
15
|
const r = [];
|
|
16
16
|
for (const n of e) {
|
|
17
17
|
if (!n || typeof n != "object") continue;
|
|
18
|
-
const i = n,
|
|
19
|
-
if (!
|
|
20
|
-
const
|
|
21
|
-
typeof i.pipeline_id == "string" && i.pipeline_id && (
|
|
18
|
+
const i = n, c = i.type === "role" ? "role" : i.type === "pipeline_state" ? "pipeline_state" : null;
|
|
19
|
+
if (!c) continue;
|
|
20
|
+
const s = { type: c };
|
|
21
|
+
typeof i.pipeline_id == "string" && i.pipeline_id && (s.pipeline_id = i.pipeline_id), c === "pipeline_state" ? s.state_keys = u(i.state_keys) : s.role_ids = u(i.role_ids);
|
|
22
22
|
const l = f(i.label), a = f(i.note);
|
|
23
|
-
l !== void 0 && (
|
|
23
|
+
l !== void 0 && (s.label = l), a !== void 0 && (s.note = a), r.push(s);
|
|
24
24
|
}
|
|
25
25
|
return r;
|
|
26
26
|
}
|
|
@@ -39,24 +39,30 @@ function h(t, e) {
|
|
|
39
39
|
break;
|
|
40
40
|
return r;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
42
|
+
function F(t) {
|
|
43
|
+
const e = o(t);
|
|
44
44
|
return e.recommended === !0 && e.required !== !0;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function U(t) {
|
|
47
47
|
return t == null || t === "" ? !0 : Array.isArray(t) ? t.length === 0 : typeof t == "string" && t.trim() === "";
|
|
48
48
|
}
|
|
49
49
|
function m(t) {
|
|
50
|
-
const e =
|
|
50
|
+
const e = o(t).confirm_change;
|
|
51
51
|
return e === !0 ? { state_keys: [] } : !e || typeof e != "object" || Array.isArray(e) ? null : { state_keys: u(e.state_keys) };
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function k(t, e) {
|
|
54
54
|
const r = m(t);
|
|
55
55
|
return r ? r.state_keys.length === 0 ? !0 : !!e && r.state_keys.includes(e) : !1;
|
|
56
56
|
}
|
|
57
|
+
function w(t) {
|
|
58
|
+
return o(t).file_used_in !== !1;
|
|
59
|
+
}
|
|
60
|
+
function D(t) {
|
|
61
|
+
return o(t).file_downloads !== !1;
|
|
62
|
+
}
|
|
57
63
|
const d = 1e6;
|
|
58
|
-
function
|
|
59
|
-
const e =
|
|
64
|
+
function _(t) {
|
|
65
|
+
const e = o(t).counter;
|
|
60
66
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
61
67
|
const r = e, n = Number(r.limit);
|
|
62
68
|
return {
|
|
@@ -64,13 +70,13 @@ function g(t) {
|
|
|
64
70
|
limit: r.limit != null && r.limit !== "" && Number.isFinite(n) && n > 0 ? Math.min(d, Math.floor(n)) : null
|
|
65
71
|
};
|
|
66
72
|
}
|
|
67
|
-
function
|
|
73
|
+
function g(t) {
|
|
68
74
|
if (t == null) return "";
|
|
69
75
|
const e = typeof t == "string" ? t : typeof t == "object" ? JSON.stringify(t) : String(t);
|
|
70
76
|
return /<[a-z!/][^>]*>/i.test(e) ? e.replace(/<(br|\/p|\/div|\/li|\/h[1-6])\b[^>]*>/gi, " ").replace(/<[^>]*>/g, "").replace(/ /g, " ").replace(/&(amp|lt|gt|quot|#39);/g, "x") : e;
|
|
71
77
|
}
|
|
72
78
|
function b(t, e) {
|
|
73
|
-
const r =
|
|
79
|
+
const r = g(t);
|
|
74
80
|
if (e === "words") {
|
|
75
81
|
const n = r.trim();
|
|
76
82
|
return n ? n.split(/\s+/).length : 0;
|
|
@@ -81,16 +87,16 @@ function L(t, e) {
|
|
|
81
87
|
return e == null ? "ok" : t > e ? "over" : t >= e * 0.9 ? "near" : "ok";
|
|
82
88
|
}
|
|
83
89
|
function x(t, e, r) {
|
|
84
|
-
const n =
|
|
90
|
+
const n = _(e);
|
|
85
91
|
if (!n || n.limit == null) return null;
|
|
86
92
|
const i = b(t, n.unit);
|
|
87
93
|
return i <= n.limit ? null : `${r} is over its limit of ${n.limit.toLocaleString("en-US")} ${n.unit} (${i.toLocaleString("en-US")})`;
|
|
88
94
|
}
|
|
89
95
|
const S = /^__calc_[a-z0-9_]{1,40}__$/;
|
|
90
|
-
function
|
|
96
|
+
function O(t) {
|
|
91
97
|
return S.test(t);
|
|
92
98
|
}
|
|
93
|
-
function
|
|
99
|
+
function j(t) {
|
|
94
100
|
const e = new Set(t);
|
|
95
101
|
for (let r = 1; ; r++) {
|
|
96
102
|
const n = `__calc_${r}__`;
|
|
@@ -98,13 +104,13 @@ function w(t) {
|
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
106
|
const A = ["", "integer", "number", "currency", "percent"];
|
|
101
|
-
function
|
|
102
|
-
const e =
|
|
107
|
+
function $(t) {
|
|
108
|
+
const e = o(t).display_formula;
|
|
103
109
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
104
110
|
const r = e, n = A.includes(r.format) ? r.format : "", i = typeof r.currency == "string" && /^[A-Z]{3}$/.test(r.currency) ? r.currency : null;
|
|
105
111
|
return { expr: typeof r.expr == "string" ? r.expr : "", format: n, currency: i };
|
|
106
112
|
}
|
|
107
|
-
function
|
|
113
|
+
function M(t, e) {
|
|
108
114
|
if (t == null || !Number.isFinite(t)) return "—";
|
|
109
115
|
switch (e.format) {
|
|
110
116
|
case "integer":
|
|
@@ -125,20 +131,22 @@ function j(t, e) {
|
|
|
125
131
|
}
|
|
126
132
|
export {
|
|
127
133
|
d as COUNTER_LIMIT_MAX,
|
|
128
|
-
|
|
134
|
+
k as confirmChangeApplies,
|
|
129
135
|
m as confirmChangeOf,
|
|
130
136
|
b as countValue,
|
|
131
137
|
x as counterError,
|
|
132
|
-
|
|
138
|
+
_ as counterOf,
|
|
133
139
|
L as counterState,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
$ as displayFormulaOf,
|
|
141
|
+
M as formatDisplayValue,
|
|
142
|
+
O as isDisplayFormulaField,
|
|
143
|
+
U as isEmptyValue,
|
|
144
|
+
F as isRecommended,
|
|
145
|
+
j as nextDisplayFormulaField,
|
|
146
|
+
o as overridesObject,
|
|
141
147
|
h as resolvePlacementText,
|
|
148
|
+
D as showsFileDownloads,
|
|
149
|
+
w as showsFileUsage,
|
|
142
150
|
p as textRuleMatches,
|
|
143
151
|
y as textRulesOf
|
|
144
152
|
};
|