@gisce/ooui 1.0.0-alpha.3 → 1.0.0-alpha.4
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/Form.d.ts.map +1 -1
- package/dist/helpers/attributeParser.d.ts +2 -1
- package/dist/helpers/attributeParser.d.ts.map +1 -1
- package/dist/ooui.es.js +150 -144
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Form.ts +11 -2
- package/src/helpers/attributeParser.ts +12 -0
- package/src/spec/Form.spec.ts +41 -0
package/dist/ooui.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var n = (s, t, e) => (
|
|
4
|
-
import { decode as
|
|
1
|
+
var le = Object.defineProperty;
|
|
2
|
+
var oe = (s, t, e) => t in s ? le(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var n = (s, t, e) => (oe(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { decode as ce } from "html-entities";
|
|
5
5
|
import * as N from "txml";
|
|
6
6
|
import P from "moment";
|
|
7
7
|
const F = class F {
|
|
@@ -107,7 +107,7 @@ const F = class F {
|
|
|
107
107
|
*/
|
|
108
108
|
n(F, "_defaultColspan", 1);
|
|
109
109
|
let v = F;
|
|
110
|
-
const
|
|
110
|
+
const de = ({
|
|
111
111
|
entry: s,
|
|
112
112
|
values: t,
|
|
113
113
|
fields: e
|
|
@@ -138,26 +138,31 @@ const ce = ({
|
|
|
138
138
|
default:
|
|
139
139
|
return !1;
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, b = (s) => ce(s, { level: "xml" }), ue = ({
|
|
142
142
|
attrs: s,
|
|
143
143
|
values: t,
|
|
144
|
-
fields: e
|
|
144
|
+
fields: e,
|
|
145
|
+
widgetType: i
|
|
145
146
|
}) => {
|
|
146
|
-
const
|
|
147
|
-
for (const
|
|
148
|
-
|
|
147
|
+
const h = s.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
148
|
+
for (const c of Object.keys(u)) {
|
|
149
|
+
const p = u[c].map((m) => de({ entry: m, values: t, fields: e })).every((m) => m);
|
|
150
|
+
p ? d[c] = !0 : c === "readonly" && !p && i === "button" && (d[c] = !1);
|
|
151
|
+
}
|
|
149
152
|
return d;
|
|
150
|
-
},
|
|
153
|
+
}, he = ({
|
|
151
154
|
tagAttributes: s,
|
|
152
155
|
values: t,
|
|
153
|
-
fields: e
|
|
156
|
+
fields: e,
|
|
157
|
+
widgetType: i
|
|
154
158
|
}) => {
|
|
155
|
-
const
|
|
159
|
+
const r = s.attrs ? ue({
|
|
156
160
|
attrs: s.attrs,
|
|
157
161
|
values: t,
|
|
158
|
-
fields: e
|
|
162
|
+
fields: e,
|
|
163
|
+
widgetType: i
|
|
159
164
|
}) : {};
|
|
160
|
-
return { ...s, ...
|
|
165
|
+
return { ...s, ...r, attrs: void 0 };
|
|
161
166
|
};
|
|
162
167
|
class g extends v {
|
|
163
168
|
constructor(e) {
|
|
@@ -201,7 +206,7 @@ class g extends v {
|
|
|
201
206
|
* Values and keys
|
|
202
207
|
*/
|
|
203
208
|
n(this, "_selectionValues", /* @__PURE__ */ new Map([]));
|
|
204
|
-
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label =
|
|
209
|
+
this._activated = !0, e && (e.name && (this._id = e.name), e.activated && (this._activated = e.activated), e.string && (this._label = b(e.string)), e.help && (this._tooltip = b(e.help)), e.nolabel && (e.nolabel === "1" || typeof e.nolabel == "boolean" && e.nolabel === !0) && (this._nolabel = !0), e.required && (e.required === "1" || e.required === !0 || e.required === "True") && (this._required = !0), e.sum && (this._sum = e.sum), e.selection && (this._selectionValues = new Map(e.selection)));
|
|
205
210
|
}
|
|
206
211
|
get id() {
|
|
207
212
|
return this._id;
|
|
@@ -259,7 +264,7 @@ class g extends v {
|
|
|
259
264
|
return this._id === e ? this : null;
|
|
260
265
|
}
|
|
261
266
|
}
|
|
262
|
-
class
|
|
267
|
+
class _e extends g {
|
|
263
268
|
}
|
|
264
269
|
class R extends v {
|
|
265
270
|
findById(t) {
|
|
@@ -451,7 +456,7 @@ const k = class k extends v {
|
|
|
451
456
|
k._defaultColspan,
|
|
452
457
|
this.readOnly,
|
|
453
458
|
e == null ? void 0 : e.key
|
|
454
|
-
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label =
|
|
459
|
+
), e && (e.name && (this._id = e.name), e.colspan ? this._container.colspan = +e.colspan : this._mustExpand = !0, e.string && (this._label = b(e.string)));
|
|
455
460
|
}
|
|
456
461
|
get id() {
|
|
457
462
|
return this._id;
|
|
@@ -524,7 +529,7 @@ const T = class T extends C {
|
|
|
524
529
|
};
|
|
525
530
|
n(T, "_defaultColspan", 3);
|
|
526
531
|
let V = T;
|
|
527
|
-
class
|
|
532
|
+
class fe extends C {
|
|
528
533
|
constructor(e) {
|
|
529
534
|
super(e);
|
|
530
535
|
n(this, "_icon", null);
|
|
@@ -537,7 +542,7 @@ class _e extends C {
|
|
|
537
542
|
this._icon = e;
|
|
538
543
|
}
|
|
539
544
|
}
|
|
540
|
-
class
|
|
545
|
+
class ge extends C {
|
|
541
546
|
constructor(e) {
|
|
542
547
|
super(e);
|
|
543
548
|
n(this, "_icon", null);
|
|
@@ -550,7 +555,7 @@ class fe extends C {
|
|
|
550
555
|
this._icon = e;
|
|
551
556
|
}
|
|
552
557
|
}
|
|
553
|
-
class
|
|
558
|
+
class H extends g {
|
|
554
559
|
constructor(e) {
|
|
555
560
|
super({
|
|
556
561
|
...e,
|
|
@@ -575,7 +580,7 @@ class ge extends g {
|
|
|
575
580
|
n(this, "_primary", !1);
|
|
576
581
|
n(this, "_danger", !1);
|
|
577
582
|
if (e) {
|
|
578
|
-
if (e.string && (this._caption =
|
|
583
|
+
if (e.string && (this._caption = b(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = b(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
|
|
579
584
|
const i = e.primary;
|
|
580
585
|
(i === "1" || i === 1 || i === !0) && (this._primary = !0);
|
|
581
586
|
}
|
|
@@ -703,7 +708,7 @@ class G extends g {
|
|
|
703
708
|
n(this, "_height");
|
|
704
709
|
n(this, "_translatable", !1);
|
|
705
710
|
if (e) {
|
|
706
|
-
if (e.placeholder && (this._placeholder =
|
|
711
|
+
if (e.placeholder && (this._placeholder = b(e.placeholder)), e.colspan || (this._mustExpand = !0), e.height)
|
|
707
712
|
try {
|
|
708
713
|
this._height = parseInt(e.height);
|
|
709
714
|
} catch {
|
|
@@ -737,7 +742,7 @@ class G extends g {
|
|
|
737
742
|
this._translatable = e;
|
|
738
743
|
}
|
|
739
744
|
}
|
|
740
|
-
class
|
|
745
|
+
class O extends g {
|
|
741
746
|
constructor(e) {
|
|
742
747
|
super(e);
|
|
743
748
|
/**
|
|
@@ -781,7 +786,7 @@ class be extends g {
|
|
|
781
786
|
}
|
|
782
787
|
class ye extends G {
|
|
783
788
|
}
|
|
784
|
-
class
|
|
789
|
+
class Q extends g {
|
|
785
790
|
constructor(t) {
|
|
786
791
|
super(t);
|
|
787
792
|
}
|
|
@@ -874,7 +879,7 @@ class Fe extends g {
|
|
|
874
879
|
this._mustExpand = e;
|
|
875
880
|
}
|
|
876
881
|
}
|
|
877
|
-
class
|
|
882
|
+
class X extends g {
|
|
878
883
|
constructor(e) {
|
|
879
884
|
super(e);
|
|
880
885
|
/**
|
|
@@ -948,7 +953,7 @@ class ke extends v {
|
|
|
948
953
|
*/
|
|
949
954
|
n(this, "_label", "");
|
|
950
955
|
n(this, "_icon", null);
|
|
951
|
-
e && (e.string && (this._label =
|
|
956
|
+
e && (e.string && (this._label = b(e.string)), e.icon && (this._icon = e.icon));
|
|
952
957
|
}
|
|
953
958
|
get label() {
|
|
954
959
|
return this._label;
|
|
@@ -966,7 +971,7 @@ class ke extends v {
|
|
|
966
971
|
return null;
|
|
967
972
|
}
|
|
968
973
|
}
|
|
969
|
-
class Te extends
|
|
974
|
+
class Te extends O {
|
|
970
975
|
}
|
|
971
976
|
class Pe extends g {
|
|
972
977
|
constructor(e) {
|
|
@@ -984,14 +989,14 @@ class Pe extends g {
|
|
|
984
989
|
this._filenameField = e;
|
|
985
990
|
}
|
|
986
991
|
}
|
|
987
|
-
class Ee extends g {
|
|
988
|
-
}
|
|
989
992
|
class Oe extends g {
|
|
993
|
+
}
|
|
994
|
+
class Ee extends g {
|
|
990
995
|
constructor(t) {
|
|
991
996
|
super(t);
|
|
992
997
|
}
|
|
993
998
|
}
|
|
994
|
-
class ze extends
|
|
999
|
+
class ze extends X {
|
|
995
1000
|
constructor(e) {
|
|
996
1001
|
super(e);
|
|
997
1002
|
/**
|
|
@@ -1023,7 +1028,7 @@ class ze extends Q {
|
|
|
1023
1028
|
return this.parsedWidgetProps.colorField;
|
|
1024
1029
|
}
|
|
1025
1030
|
}
|
|
1026
|
-
class We extends
|
|
1031
|
+
class We extends O {
|
|
1027
1032
|
constructor(e) {
|
|
1028
1033
|
super(e);
|
|
1029
1034
|
n(this, "_nolabel", !0);
|
|
@@ -1051,7 +1056,7 @@ class We extends E {
|
|
|
1051
1056
|
this._suffix = e;
|
|
1052
1057
|
}
|
|
1053
1058
|
}
|
|
1054
|
-
class
|
|
1059
|
+
class U extends g {
|
|
1055
1060
|
constructor(e) {
|
|
1056
1061
|
super(e);
|
|
1057
1062
|
/**
|
|
@@ -1104,14 +1109,14 @@ class X extends g {
|
|
|
1104
1109
|
this._columns = e;
|
|
1105
1110
|
}
|
|
1106
1111
|
}
|
|
1107
|
-
class Se extends
|
|
1112
|
+
class Se extends U {
|
|
1108
1113
|
}
|
|
1109
|
-
class Ye extends
|
|
1114
|
+
class Ye extends O {
|
|
1110
1115
|
get colors() {
|
|
1111
1116
|
return this._parsedWidgetProps.colors || {};
|
|
1112
1117
|
}
|
|
1113
1118
|
}
|
|
1114
|
-
class De extends
|
|
1119
|
+
class De extends O {
|
|
1115
1120
|
constructor(e) {
|
|
1116
1121
|
super(e);
|
|
1117
1122
|
/**
|
|
@@ -1127,7 +1132,7 @@ class De extends E {
|
|
|
1127
1132
|
this._direction = e;
|
|
1128
1133
|
}
|
|
1129
1134
|
}
|
|
1130
|
-
class Ne extends
|
|
1135
|
+
class Ne extends Q {
|
|
1131
1136
|
}
|
|
1132
1137
|
class Ie extends g {
|
|
1133
1138
|
constructor(e) {
|
|
@@ -1183,10 +1188,10 @@ class j {
|
|
|
1183
1188
|
this._widgetClass = V;
|
|
1184
1189
|
break;
|
|
1185
1190
|
case "page":
|
|
1186
|
-
this._widgetClass =
|
|
1191
|
+
this._widgetClass = fe;
|
|
1187
1192
|
break;
|
|
1188
1193
|
case "group":
|
|
1189
|
-
this._widgetClass =
|
|
1194
|
+
this._widgetClass = ge;
|
|
1190
1195
|
break;
|
|
1191
1196
|
case "label":
|
|
1192
1197
|
this._widgetClass = J;
|
|
@@ -1198,19 +1203,19 @@ class j {
|
|
|
1198
1203
|
this._widgetClass = G;
|
|
1199
1204
|
break;
|
|
1200
1205
|
case "button":
|
|
1201
|
-
this._widgetClass =
|
|
1206
|
+
this._widgetClass = H;
|
|
1202
1207
|
break;
|
|
1203
1208
|
case "buttonGroup":
|
|
1204
1209
|
this._widgetClass = me;
|
|
1205
1210
|
break;
|
|
1206
1211
|
case "selection":
|
|
1207
|
-
this._widgetClass =
|
|
1212
|
+
this._widgetClass = O;
|
|
1208
1213
|
break;
|
|
1209
1214
|
case "many2one":
|
|
1210
1215
|
this._widgetClass = be;
|
|
1211
1216
|
break;
|
|
1212
1217
|
case "boolean":
|
|
1213
|
-
this._widgetClass =
|
|
1218
|
+
this._widgetClass = Q;
|
|
1214
1219
|
break;
|
|
1215
1220
|
case "integer":
|
|
1216
1221
|
this._widgetClass = pe;
|
|
@@ -1238,7 +1243,7 @@ class j {
|
|
|
1238
1243
|
break;
|
|
1239
1244
|
case "one2many":
|
|
1240
1245
|
case "one2many_list":
|
|
1241
|
-
this._widgetClass =
|
|
1246
|
+
this._widgetClass = X;
|
|
1242
1247
|
break;
|
|
1243
1248
|
case "newline":
|
|
1244
1249
|
this._widgetClass = R;
|
|
@@ -1259,10 +1264,10 @@ class j {
|
|
|
1259
1264
|
this._widgetClass = Pe;
|
|
1260
1265
|
break;
|
|
1261
1266
|
case "image":
|
|
1262
|
-
this._widgetClass =
|
|
1267
|
+
this._widgetClass = Oe;
|
|
1263
1268
|
break;
|
|
1264
1269
|
case "fiber_grid":
|
|
1265
|
-
this._widgetClass =
|
|
1270
|
+
this._widgetClass = Ee;
|
|
1266
1271
|
break;
|
|
1267
1272
|
case "timeline":
|
|
1268
1273
|
this._widgetClass = ze;
|
|
@@ -1277,13 +1282,13 @@ class j {
|
|
|
1277
1282
|
this._widgetClass = Ye;
|
|
1278
1283
|
break;
|
|
1279
1284
|
case "avatar":
|
|
1280
|
-
this._widgetClass =
|
|
1285
|
+
this._widgetClass = _e;
|
|
1281
1286
|
break;
|
|
1282
1287
|
case "radio":
|
|
1283
1288
|
this._widgetClass = De;
|
|
1284
1289
|
break;
|
|
1285
1290
|
case "multicheckbox":
|
|
1286
|
-
this._widgetClass =
|
|
1291
|
+
this._widgetClass = U;
|
|
1287
1292
|
break;
|
|
1288
1293
|
case "switch":
|
|
1289
1294
|
this._widgetClass = Ne;
|
|
@@ -1333,8 +1338,8 @@ const Ae = ({
|
|
|
1333
1338
|
if (t.state === a) {
|
|
1334
1339
|
const h = i[a];
|
|
1335
1340
|
for (const _ of h) {
|
|
1336
|
-
const [
|
|
1337
|
-
o[
|
|
1341
|
+
const [u, d] = _;
|
|
1342
|
+
o[u] || (o[u] = []), o[u].push(d);
|
|
1338
1343
|
}
|
|
1339
1344
|
}
|
|
1340
1345
|
for (const a of Object.keys(o)) {
|
|
@@ -1368,23 +1373,23 @@ const Le = ({
|
|
|
1368
1373
|
try {
|
|
1369
1374
|
if (!s)
|
|
1370
1375
|
return;
|
|
1371
|
-
if (
|
|
1376
|
+
if (Z(s) || typeof s != "string")
|
|
1372
1377
|
return s;
|
|
1373
|
-
const i =
|
|
1378
|
+
const i = K(s);
|
|
1374
1379
|
if (i !== null)
|
|
1375
1380
|
return i;
|
|
1376
1381
|
if (s.trim().length === 0)
|
|
1377
1382
|
return;
|
|
1378
|
-
const
|
|
1379
|
-
return
|
|
1380
|
-
const
|
|
1383
|
+
const d = s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((f) => f.split(":")), c = {};
|
|
1384
|
+
return d.forEach((f) => {
|
|
1385
|
+
const y = f[1];
|
|
1381
1386
|
if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
|
|
1382
|
-
const
|
|
1387
|
+
const p = Ge({
|
|
1383
1388
|
values: t,
|
|
1384
1389
|
fields: e,
|
|
1385
|
-
fieldName:
|
|
1390
|
+
fieldName: y === "active_id" ? "id" : y
|
|
1386
1391
|
});
|
|
1387
|
-
c[f[0].replace(/'/g, "")] =
|
|
1392
|
+
c[f[0].replace(/'/g, "")] = p || void 0;
|
|
1388
1393
|
} else
|
|
1389
1394
|
f[1] === "true" ? c[f[0].replace(/'/g, "")] = !0 : f[1] === "false" ? c[f[0].replace(/'/g, "")] = !1 : c[f[0].replace(/'/g, "")] = f[1].replace(
|
|
1390
1395
|
/'/g,
|
|
@@ -1397,21 +1402,21 @@ const Le = ({
|
|
|
1397
1402
|
}, ht = (s) => {
|
|
1398
1403
|
const t = [];
|
|
1399
1404
|
try {
|
|
1400
|
-
return !s ||
|
|
1401
|
-
!
|
|
1405
|
+
return !s || Z(s) || typeof s != "string" ? t : K(s) !== null ? [] : (s.trim().length === 0 || s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
|
|
1406
|
+
!d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
|
|
1402
1407
|
}), t);
|
|
1403
1408
|
} catch {
|
|
1404
1409
|
}
|
|
1405
1410
|
return t;
|
|
1406
1411
|
};
|
|
1407
|
-
function
|
|
1412
|
+
function K(s) {
|
|
1408
1413
|
try {
|
|
1409
1414
|
return JSON.parse(s.replace(/'/g, '"'));
|
|
1410
1415
|
} catch {
|
|
1411
1416
|
return null;
|
|
1412
1417
|
}
|
|
1413
1418
|
}
|
|
1414
|
-
function
|
|
1419
|
+
function Z(s) {
|
|
1415
1420
|
return typeof s == "object" && s !== null && typeof s != "string";
|
|
1416
1421
|
}
|
|
1417
1422
|
const je = (s) => {
|
|
@@ -1515,7 +1520,7 @@ class _t {
|
|
|
1515
1520
|
parse(t, e) {
|
|
1516
1521
|
var l;
|
|
1517
1522
|
const { values: i = {}, readOnly: r = !1 } = e || {}, o = N.parse(t).filter((a) => a.tagName === "form")[0];
|
|
1518
|
-
this._string = ((l = o.attributes) == null ? void 0 : l.string) || null, this._string && (this._string =
|
|
1523
|
+
this._string = ((l = o.attributes) == null ? void 0 : l.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1519
1524
|
fields: o.children,
|
|
1520
1525
|
container: this._container,
|
|
1521
1526
|
values: i
|
|
@@ -1528,9 +1533,9 @@ class _t {
|
|
|
1528
1533
|
}) {
|
|
1529
1534
|
const r = new j();
|
|
1530
1535
|
t.filter((o) => typeof o == "object").forEach((o) => {
|
|
1531
|
-
var w,
|
|
1536
|
+
var w, E;
|
|
1532
1537
|
const { tagName: l, attributes: a, children: h } = o;
|
|
1533
|
-
let _ = l,
|
|
1538
|
+
let _ = l, u = a;
|
|
1534
1539
|
if (l === "field") {
|
|
1535
1540
|
const { name: x, widget: z } = a;
|
|
1536
1541
|
if (z)
|
|
@@ -1542,48 +1547,49 @@ class _t {
|
|
|
1542
1547
|
);
|
|
1543
1548
|
_ = this._fields[x].type;
|
|
1544
1549
|
}
|
|
1545
|
-
|
|
1550
|
+
u = {
|
|
1546
1551
|
...this._fields[x],
|
|
1547
1552
|
...a,
|
|
1548
1553
|
fieldsWidgetType: this._fields[x].type
|
|
1549
1554
|
};
|
|
1550
1555
|
}
|
|
1551
|
-
const
|
|
1552
|
-
tagAttributes:
|
|
1556
|
+
const d = he({
|
|
1557
|
+
tagAttributes: u,
|
|
1553
1558
|
values: i,
|
|
1554
|
-
fields: this._fields
|
|
1559
|
+
fields: this._fields,
|
|
1560
|
+
widgetType: l
|
|
1555
1561
|
});
|
|
1556
1562
|
let c;
|
|
1557
|
-
l === "button" &&
|
|
1558
|
-
states:
|
|
1563
|
+
l === "button" && u.states ? c = Be({
|
|
1564
|
+
states: u.states,
|
|
1559
1565
|
values: i
|
|
1560
1566
|
}) : c = Ae({
|
|
1561
|
-
fieldName:
|
|
1567
|
+
fieldName: u.name,
|
|
1562
1568
|
values: i,
|
|
1563
1569
|
fields: this._fields
|
|
1564
1570
|
});
|
|
1565
1571
|
const f = Le({
|
|
1566
|
-
context:
|
|
1572
|
+
context: u.context || ((w = this._fields[u.name]) == null ? void 0 : w.context),
|
|
1567
1573
|
values: i,
|
|
1568
1574
|
fields: this._fields
|
|
1569
1575
|
});
|
|
1570
|
-
|
|
1571
|
-
|
|
1576
|
+
u.on_change && (this._onChangeFields[u.name] = je(
|
|
1577
|
+
u.on_change
|
|
1572
1578
|
));
|
|
1573
|
-
let
|
|
1574
|
-
q(
|
|
1575
|
-
const
|
|
1576
|
-
...
|
|
1579
|
+
let y;
|
|
1580
|
+
q(u.domain) && (y = u.domain), q((E = this._fields[u.name]) == null ? void 0 : E.domain) && (y = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1581
|
+
const p = {
|
|
1582
|
+
...d,
|
|
1577
1583
|
...c,
|
|
1578
1584
|
context: f,
|
|
1579
|
-
domain:
|
|
1585
|
+
domain: y,
|
|
1580
1586
|
key: `${this._keyIdx}`
|
|
1581
|
-
},
|
|
1582
|
-
|
|
1587
|
+
}, m = r.createWidget(_, p);
|
|
1588
|
+
m.invisible && m instanceof g && this._invisibleFields.push(p.name), m instanceof C && this.parseNode({
|
|
1583
1589
|
fields: h,
|
|
1584
|
-
container:
|
|
1590
|
+
container: m.container,
|
|
1585
1591
|
values: i
|
|
1586
|
-
}),
|
|
1592
|
+
}), m instanceof H && m.readOnly !== void 0 || (m.readOnly = m.readOnly || this.readOnly), e.addWidget(m);
|
|
1587
1593
|
});
|
|
1588
1594
|
}
|
|
1589
1595
|
/**
|
|
@@ -1643,27 +1649,27 @@ class ft {
|
|
|
1643
1649
|
}
|
|
1644
1650
|
parse(t) {
|
|
1645
1651
|
const e = N.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
1646
|
-
this._string = e.attributes.string || null, this._string && (this._string =
|
|
1652
|
+
this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null;
|
|
1647
1653
|
const i = new j();
|
|
1648
1654
|
e.children.forEach((r) => {
|
|
1649
1655
|
const { tagName: o, attributes: l } = r;
|
|
1650
1656
|
let a = null;
|
|
1651
1657
|
if (o === "field") {
|
|
1652
1658
|
const { name: h, widget: _ } = l;
|
|
1653
|
-
let
|
|
1659
|
+
let u = l;
|
|
1654
1660
|
if (h) {
|
|
1655
1661
|
if (!this._fields[h])
|
|
1656
1662
|
throw new Error(`Field ${h} doesn't exist in fields defintion`);
|
|
1657
|
-
const
|
|
1658
|
-
a =
|
|
1659
|
-
...
|
|
1663
|
+
const d = this._fields[h];
|
|
1664
|
+
a = d.type, (Array.isArray(d == null ? void 0 : d.domain) && (d == null ? void 0 : d.domain.length) === 0 || (d == null ? void 0 : d.domain) === !1) && l.domain && l.domain.length > 0 && delete d.domain, u = {
|
|
1665
|
+
...d,
|
|
1660
1666
|
...l,
|
|
1661
|
-
fieldsWidgetType:
|
|
1667
|
+
fieldsWidgetType: d == null ? void 0 : d.type
|
|
1662
1668
|
};
|
|
1663
1669
|
}
|
|
1664
|
-
if (_ && (a = _), !
|
|
1665
|
-
const
|
|
1666
|
-
this._columns.push(
|
|
1670
|
+
if (_ && (a = _), !u.invisible) {
|
|
1671
|
+
const d = i.createWidget(a, u);
|
|
1672
|
+
this._columns.push(d);
|
|
1667
1673
|
}
|
|
1668
1674
|
}
|
|
1669
1675
|
});
|
|
@@ -1795,7 +1801,7 @@ class yt {
|
|
|
1795
1801
|
return this._items;
|
|
1796
1802
|
}
|
|
1797
1803
|
}
|
|
1798
|
-
class
|
|
1804
|
+
class ee {
|
|
1799
1805
|
constructor(t) {
|
|
1800
1806
|
n(this, "_string", null);
|
|
1801
1807
|
n(this, "_type");
|
|
@@ -1813,7 +1819,7 @@ class Z {
|
|
|
1813
1819
|
}
|
|
1814
1820
|
}
|
|
1815
1821
|
const Re = (s) => s === 1 || s === "1" || s === !0 || s === "True";
|
|
1816
|
-
class
|
|
1822
|
+
class te extends ee {
|
|
1817
1823
|
constructor(e, i) {
|
|
1818
1824
|
super(i);
|
|
1819
1825
|
n(this, "_color", null);
|
|
@@ -1821,7 +1827,7 @@ class ee extends Z {
|
|
|
1821
1827
|
n(this, "_totalDomain", null);
|
|
1822
1828
|
n(this, "_showPercent", !1);
|
|
1823
1829
|
n(this, "_suffix", null);
|
|
1824
|
-
this._type = e, this._color = i.attributes.color || null, this._color && (this._color =
|
|
1830
|
+
this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Re(i.attributes.showPercent);
|
|
1825
1831
|
}
|
|
1826
1832
|
get color() {
|
|
1827
1833
|
return this._color;
|
|
@@ -1839,7 +1845,7 @@ class ee extends Z {
|
|
|
1839
1845
|
return this._suffix;
|
|
1840
1846
|
}
|
|
1841
1847
|
}
|
|
1842
|
-
class Je extends
|
|
1848
|
+
class Je extends te {
|
|
1843
1849
|
constructor(e, i) {
|
|
1844
1850
|
super(e, i);
|
|
1845
1851
|
n(this, "_field");
|
|
@@ -1889,7 +1895,7 @@ const He = (s) => {
|
|
|
1889
1895
|
y: t
|
|
1890
1896
|
};
|
|
1891
1897
|
};
|
|
1892
|
-
class M extends
|
|
1898
|
+
class M extends ee {
|
|
1893
1899
|
constructor(e, i) {
|
|
1894
1900
|
super(i);
|
|
1895
1901
|
n(this, "_x");
|
|
@@ -1906,7 +1912,7 @@ class M extends Z {
|
|
|
1906
1912
|
}
|
|
1907
1913
|
}
|
|
1908
1914
|
const Qe = {
|
|
1909
|
-
indicator:
|
|
1915
|
+
indicator: te,
|
|
1910
1916
|
indicatorField: Je,
|
|
1911
1917
|
line: M,
|
|
1912
1918
|
bar: M,
|
|
@@ -1920,7 +1926,7 @@ const Qe = {
|
|
|
1920
1926
|
throw new Error(`${e} not found as a GraphModel`);
|
|
1921
1927
|
return new i(e, t);
|
|
1922
1928
|
};
|
|
1923
|
-
class
|
|
1929
|
+
class se {
|
|
1924
1930
|
constructor({ name: t, axis: e }) {
|
|
1925
1931
|
n(this, "_name");
|
|
1926
1932
|
n(this, "_axis");
|
|
@@ -1933,7 +1939,7 @@ class te {
|
|
|
1933
1939
|
return this._axis;
|
|
1934
1940
|
}
|
|
1935
1941
|
}
|
|
1936
|
-
class Xe extends
|
|
1942
|
+
class Xe extends se {
|
|
1937
1943
|
constructor({
|
|
1938
1944
|
name: e,
|
|
1939
1945
|
operator: i,
|
|
@@ -1956,7 +1962,7 @@ class Xe extends te {
|
|
|
1956
1962
|
return this._stacked;
|
|
1957
1963
|
}
|
|
1958
1964
|
}
|
|
1959
|
-
class Ue extends
|
|
1965
|
+
class Ue extends se {
|
|
1960
1966
|
constructor({ name: t }) {
|
|
1961
1967
|
super({ name: t, axis: "x" });
|
|
1962
1968
|
}
|
|
@@ -2006,7 +2012,7 @@ function et({
|
|
|
2006
2012
|
timerange: t
|
|
2007
2013
|
}) {
|
|
2008
2014
|
let e = [];
|
|
2009
|
-
const i =
|
|
2015
|
+
const i = ne({
|
|
2010
2016
|
values: s,
|
|
2011
2017
|
groupBy: "type-stacked"
|
|
2012
2018
|
}), r = `${t}s`;
|
|
@@ -2016,10 +2022,10 @@ function et({
|
|
|
2016
2022
|
const _ = a[h];
|
|
2017
2023
|
if (e.push(_), h === a.length - 1)
|
|
2018
2024
|
return;
|
|
2019
|
-
const
|
|
2020
|
-
if (!
|
|
2025
|
+
const u = _.x, d = a[h + 1].x;
|
|
2026
|
+
if (!ie([u, d], r)) {
|
|
2021
2027
|
const c = tt({
|
|
2022
|
-
dates: [
|
|
2028
|
+
dates: [u, d],
|
|
2023
2029
|
timerange: t
|
|
2024
2030
|
});
|
|
2025
2031
|
e = e.concat(
|
|
@@ -2044,7 +2050,7 @@ function tt({
|
|
|
2044
2050
|
const r = s.sort((o, l) => o < l ? -1 : o > l ? 1 : 0);
|
|
2045
2051
|
for (let o = 0; o < r.length - 1; o++) {
|
|
2046
2052
|
const l = r[o], a = r[o + 1];
|
|
2047
|
-
if (!
|
|
2053
|
+
if (!ie([l, a], i)) {
|
|
2048
2054
|
const h = P(l, S(i)).add(1, i), _ = P(a, S(i));
|
|
2049
2055
|
for (; h.isBefore(_); )
|
|
2050
2056
|
e.push(h.format(S(i))), h.add(1, i);
|
|
@@ -2059,7 +2065,7 @@ function st({
|
|
|
2059
2065
|
const e = it({
|
|
2060
2066
|
values: s,
|
|
2061
2067
|
timerange: t
|
|
2062
|
-
}), i = [], r =
|
|
2068
|
+
}), i = [], r = ne({
|
|
2063
2069
|
values: e,
|
|
2064
2070
|
groupBy: "all"
|
|
2065
2071
|
});
|
|
@@ -2119,7 +2125,7 @@ function nt({
|
|
|
2119
2125
|
function rt(s) {
|
|
2120
2126
|
return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
2121
2127
|
}
|
|
2122
|
-
function
|
|
2128
|
+
function ie(s, t) {
|
|
2123
2129
|
let e = !1;
|
|
2124
2130
|
const i = S(t);
|
|
2125
2131
|
if (s.length === 0)
|
|
@@ -2132,7 +2138,7 @@ function se(s, t) {
|
|
|
2132
2138
|
}
|
|
2133
2139
|
return e;
|
|
2134
2140
|
}
|
|
2135
|
-
function
|
|
2141
|
+
function ne({
|
|
2136
2142
|
values: s,
|
|
2137
2143
|
groupBy: t
|
|
2138
2144
|
}) {
|
|
@@ -2178,43 +2184,43 @@ const at = {
|
|
|
2178
2184
|
}), o = [];
|
|
2179
2185
|
s.y.forEach((c) => {
|
|
2180
2186
|
Object.keys(r).forEach((f) => {
|
|
2181
|
-
const
|
|
2187
|
+
const y = r[f].label, p = r[f].entries;
|
|
2182
2188
|
if (c.label) {
|
|
2183
|
-
const
|
|
2189
|
+
const m = B({
|
|
2184
2190
|
fieldName: c.label,
|
|
2185
|
-
values:
|
|
2191
|
+
values: p,
|
|
2186
2192
|
fields: e
|
|
2187
2193
|
});
|
|
2188
|
-
Object.keys(
|
|
2189
|
-
const
|
|
2190
|
-
entries:
|
|
2194
|
+
Object.keys(m).forEach((w) => {
|
|
2195
|
+
const E = m[w].entries, x = m[w].label, z = A({
|
|
2196
|
+
entries: E,
|
|
2191
2197
|
fields: e,
|
|
2192
2198
|
fieldName: c.name
|
|
2193
|
-
}),
|
|
2199
|
+
}), ae = D({
|
|
2194
2200
|
values: z,
|
|
2195
2201
|
operator: c.operator
|
|
2196
2202
|
});
|
|
2197
2203
|
o.push({
|
|
2198
|
-
x:
|
|
2199
|
-
value:
|
|
2204
|
+
x: y || !1,
|
|
2205
|
+
value: ae,
|
|
2200
2206
|
type: x,
|
|
2201
2207
|
operator: c.operator,
|
|
2202
2208
|
stacked: c.stacked
|
|
2203
2209
|
});
|
|
2204
2210
|
});
|
|
2205
2211
|
} else {
|
|
2206
|
-
const
|
|
2207
|
-
entries:
|
|
2212
|
+
const m = A({
|
|
2213
|
+
entries: p,
|
|
2208
2214
|
fields: e,
|
|
2209
2215
|
fieldName: c.name
|
|
2210
2216
|
}), w = D({
|
|
2211
|
-
values:
|
|
2217
|
+
values: m,
|
|
2212
2218
|
operator: c.operator
|
|
2213
2219
|
});
|
|
2214
2220
|
o.push({
|
|
2215
|
-
x:
|
|
2221
|
+
x: y || !1,
|
|
2216
2222
|
value: w,
|
|
2217
|
-
type:
|
|
2223
|
+
type: re({
|
|
2218
2224
|
yAxis: c,
|
|
2219
2225
|
fields: e
|
|
2220
2226
|
}),
|
|
@@ -2227,16 +2233,16 @@ const at = {
|
|
|
2227
2233
|
const l = s.y.some((c) => c.label !== void 0), a = s.y.some((c) => c.stacked !== void 0);
|
|
2228
2234
|
let _ = [...o.sort((c, f) => c.x < f.x ? -1 : c.x > f.x ? 1 : 0)];
|
|
2229
2235
|
a && s.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
|
|
2230
|
-
let
|
|
2231
|
-
s.type === "pie" &&
|
|
2236
|
+
let u = [..._];
|
|
2237
|
+
s.type === "pie" && u.some((c) => c.x === !1) ? u = u.map((c) => c.x === !1 ? { ...c, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (u = u.filter(
|
|
2232
2238
|
(c) => c.x !== !1
|
|
2233
2239
|
));
|
|
2234
|
-
let
|
|
2235
|
-
return s.timerange ?
|
|
2236
|
-
values:
|
|
2240
|
+
let d = u;
|
|
2241
|
+
return s.timerange ? d = Ze({
|
|
2242
|
+
values: d,
|
|
2237
2243
|
timerange: s.timerange
|
|
2238
|
-
}) : s.type == "pie" && (
|
|
2239
|
-
data:
|
|
2244
|
+
}) : s.type == "pie" && (d = u.sort((c, f) => f.value - c.value)), {
|
|
2245
|
+
data: d,
|
|
2240
2246
|
isGroup: a || l,
|
|
2241
2247
|
isStack: a
|
|
2242
2248
|
};
|
|
@@ -2312,7 +2318,7 @@ function ot(s) {
|
|
|
2312
2318
|
t = t.concat(i.entries);
|
|
2313
2319
|
}), t;
|
|
2314
2320
|
}
|
|
2315
|
-
function
|
|
2321
|
+
function re({
|
|
2316
2322
|
yAxis: s,
|
|
2317
2323
|
fields: t
|
|
2318
2324
|
}) {
|
|
@@ -2325,15 +2331,15 @@ const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2325
2331
|
getValueForOperator: D,
|
|
2326
2332
|
getValuesForYField: A,
|
|
2327
2333
|
getValuesGroupedByField: B,
|
|
2328
|
-
getYAxisFieldname:
|
|
2334
|
+
getYAxisFieldname: re,
|
|
2329
2335
|
labelsForOperator: at,
|
|
2330
2336
|
processGraphData: lt
|
|
2331
2337
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2332
2338
|
export {
|
|
2333
|
-
|
|
2339
|
+
_e as Avatar,
|
|
2334
2340
|
Pe as Binary,
|
|
2335
|
-
|
|
2336
|
-
|
|
2341
|
+
Q as Boolean,
|
|
2342
|
+
H as Button,
|
|
2337
2343
|
me as ButtonGroup,
|
|
2338
2344
|
I as Char,
|
|
2339
2345
|
Me as CodeEditor,
|
|
@@ -2347,32 +2353,32 @@ export {
|
|
|
2347
2353
|
L as Float,
|
|
2348
2354
|
xe as FloatTime,
|
|
2349
2355
|
_t as Form,
|
|
2350
|
-
|
|
2351
|
-
|
|
2356
|
+
ee as Graph,
|
|
2357
|
+
se as GraphAxis,
|
|
2352
2358
|
M as GraphChart,
|
|
2353
|
-
|
|
2359
|
+
te as GraphIndicator,
|
|
2354
2360
|
Je as GraphIndicatorField,
|
|
2355
2361
|
Ue as GraphXAxis,
|
|
2356
2362
|
Xe as GraphYAxis,
|
|
2357
|
-
|
|
2358
|
-
|
|
2363
|
+
ge as Group,
|
|
2364
|
+
Oe as Image,
|
|
2359
2365
|
We as Indicator,
|
|
2360
2366
|
pe as Integer,
|
|
2361
2367
|
J as Label,
|
|
2362
2368
|
Fe as Many2many,
|
|
2363
2369
|
be as Many2one,
|
|
2364
2370
|
ye as Markdown,
|
|
2365
|
-
|
|
2371
|
+
U as MultiCheckbox,
|
|
2366
2372
|
R as NewLine,
|
|
2367
2373
|
V as Notebook,
|
|
2368
|
-
|
|
2369
|
-
|
|
2374
|
+
X as One2many,
|
|
2375
|
+
fe as Page,
|
|
2370
2376
|
we as ProgressBar,
|
|
2371
2377
|
De as Radio,
|
|
2372
2378
|
Te as Reference,
|
|
2373
2379
|
$e as SearchFieldTypes,
|
|
2374
2380
|
gt as SearchFilter,
|
|
2375
|
-
|
|
2381
|
+
O as Selection,
|
|
2376
2382
|
ke as Separator,
|
|
2377
2383
|
Ie as Steps,
|
|
2378
2384
|
Ne as Switch,
|