@gisce/ooui 2.15.0 → 2.16.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.
- package/dist/Steps.d.ts +3 -0
- package/dist/Steps.d.ts.map +1 -1
- package/dist/ooui.es.js +51 -44
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Steps.ts +13 -0
- package/src/spec/Steps.spec.ts +21 -1
package/dist/Steps.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ declare class Steps extends Field {
|
|
|
12
12
|
_errorField: string | null;
|
|
13
13
|
get errorField(): string | null;
|
|
14
14
|
set errorField(value: string | null);
|
|
15
|
+
_lastStep: boolean | null;
|
|
16
|
+
get lastStep(): boolean | null;
|
|
17
|
+
set lastStep(value: boolean | null);
|
|
15
18
|
constructor(props: any);
|
|
16
19
|
}
|
|
17
20
|
export default Steps;
|
package/dist/Steps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../src/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,KAAM,SAAQ,KAAK;IACvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IACvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAElC;gBAEW,KAAK,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../src/Steps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,KAAM,SAAQ,KAAK;IACvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IACvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAElC;IAED,SAAS,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEjC,IAAI,QAAQ,IAAI,OAAO,GAAG,IAAI,CAE7B;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,EAEjC;gBAEW,KAAK,EAAE,GAAG;CAgBvB;AAED,eAAe,KAAK,CAAC"}
|
package/dist/ooui.es.js
CHANGED
|
@@ -171,7 +171,7 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
171
171
|
modifiedExpectedValue: null,
|
|
172
172
|
directOutcome: !1
|
|
173
173
|
} : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
|
|
174
|
-
},
|
|
174
|
+
}, pe = ({
|
|
175
175
|
attrs: i,
|
|
176
176
|
values: t,
|
|
177
177
|
fields: e,
|
|
@@ -179,11 +179,11 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
179
179
|
}) => {
|
|
180
180
|
const h = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(h), u = JSON.parse(_), d = {};
|
|
181
181
|
for (const f of Object.keys(u)) {
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const p = u[f].map((y) => ye({ entry: y, values: t, fields: e })).every((y) => y);
|
|
183
|
+
p ? d[f] = !0 : f === "readonly" && !p && s === "button" && (d[f] = !1);
|
|
184
184
|
}
|
|
185
185
|
return d;
|
|
186
|
-
},
|
|
186
|
+
}, xe = ({
|
|
187
187
|
attrs: i,
|
|
188
188
|
values: t,
|
|
189
189
|
fields: e,
|
|
@@ -224,14 +224,14 @@ const be = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), ye
|
|
|
224
224
|
fallbackMode: r = !0
|
|
225
225
|
}) => {
|
|
226
226
|
let a = {}, l = {};
|
|
227
|
-
if (i.attrs && (l =
|
|
227
|
+
if (i.attrs && (l = pe({
|
|
228
228
|
attrs: i.attrs,
|
|
229
229
|
values: t,
|
|
230
230
|
fields: e,
|
|
231
231
|
widgetType: s
|
|
232
232
|
})), i.json_attrs)
|
|
233
233
|
try {
|
|
234
|
-
a =
|
|
234
|
+
a = xe({
|
|
235
235
|
attrs: i.json_attrs,
|
|
236
236
|
values: t,
|
|
237
237
|
fields: e,
|
|
@@ -608,8 +608,8 @@ const O = class O extends C {
|
|
|
608
608
|
}
|
|
609
609
|
};
|
|
610
610
|
n(O, "_defaultColspan", 6);
|
|
611
|
-
let
|
|
612
|
-
const T = class T extends
|
|
611
|
+
let x = O;
|
|
612
|
+
const T = class T extends x {
|
|
613
613
|
constructor(e) {
|
|
614
614
|
super(e);
|
|
615
615
|
n(this, "_tabPosition", "top");
|
|
@@ -634,7 +634,7 @@ const T = class T extends p {
|
|
|
634
634
|
};
|
|
635
635
|
n(T, "_defaultColspan", 3);
|
|
636
636
|
let M = T;
|
|
637
|
-
class Fe extends
|
|
637
|
+
class Fe extends x {
|
|
638
638
|
constructor(e) {
|
|
639
639
|
super(e);
|
|
640
640
|
n(this, "_icon", null);
|
|
@@ -647,7 +647,7 @@ class Fe extends p {
|
|
|
647
647
|
this._icon = e;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
class Ce extends
|
|
650
|
+
class Ce extends x {
|
|
651
651
|
constructor(e) {
|
|
652
652
|
super(e);
|
|
653
653
|
n(this, "_icon", null);
|
|
@@ -732,7 +732,7 @@ class X extends g {
|
|
|
732
732
|
this._danger = e;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
class ke extends
|
|
735
|
+
class ke extends x {
|
|
736
736
|
constructor(e) {
|
|
737
737
|
super(e);
|
|
738
738
|
n(this, "_defaultName", "");
|
|
@@ -959,9 +959,9 @@ class L extends g {
|
|
|
959
959
|
}
|
|
960
960
|
class Ee extends L {
|
|
961
961
|
}
|
|
962
|
-
class
|
|
962
|
+
class We extends g {
|
|
963
963
|
}
|
|
964
|
-
class
|
|
964
|
+
class Ie extends L {
|
|
965
965
|
}
|
|
966
966
|
class Se extends g {
|
|
967
967
|
constructor(t) {
|
|
@@ -1274,7 +1274,8 @@ class Re extends g {
|
|
|
1274
1274
|
*/
|
|
1275
1275
|
n(this, "_relation", "");
|
|
1276
1276
|
n(this, "_errorField", null);
|
|
1277
|
-
|
|
1277
|
+
n(this, "_lastStep", !0);
|
|
1278
|
+
e && (e.relation && (this._relation = e.relation), this.parsedWidgetProps.hasOwnProperty("error_field") && (this._errorField = this.parsedWidgetProps.error_field), this.parsedWidgetProps.hasOwnProperty("last_step") && (this._lastStep = this.parsedWidgetProps.last_step));
|
|
1278
1279
|
}
|
|
1279
1280
|
get relation() {
|
|
1280
1281
|
return this._relation;
|
|
@@ -1288,6 +1289,12 @@ class Re extends g {
|
|
|
1288
1289
|
set errorField(e) {
|
|
1289
1290
|
this._errorField = e;
|
|
1290
1291
|
}
|
|
1292
|
+
get lastStep() {
|
|
1293
|
+
return this._lastStep;
|
|
1294
|
+
}
|
|
1295
|
+
set lastStep(e) {
|
|
1296
|
+
this._lastStep = e;
|
|
1297
|
+
}
|
|
1291
1298
|
}
|
|
1292
1299
|
class ee extends B {
|
|
1293
1300
|
constructor(e) {
|
|
@@ -1307,7 +1314,7 @@ class qe extends g {
|
|
|
1307
1314
|
super(t);
|
|
1308
1315
|
}
|
|
1309
1316
|
}
|
|
1310
|
-
class Je extends
|
|
1317
|
+
class Je extends x {
|
|
1311
1318
|
constructor(e) {
|
|
1312
1319
|
super(e);
|
|
1313
1320
|
/**
|
|
@@ -1430,7 +1437,7 @@ class G {
|
|
|
1430
1437
|
this._widgetClass = ze;
|
|
1431
1438
|
break;
|
|
1432
1439
|
case "progressbar":
|
|
1433
|
-
this._widgetClass =
|
|
1440
|
+
this._widgetClass = Ie;
|
|
1434
1441
|
break;
|
|
1435
1442
|
case "markdown":
|
|
1436
1443
|
this._widgetClass = Te;
|
|
@@ -1498,7 +1505,7 @@ class G {
|
|
|
1498
1505
|
this._widgetClass = qe;
|
|
1499
1506
|
break;
|
|
1500
1507
|
case "html_preview":
|
|
1501
|
-
this._widgetClass =
|
|
1508
|
+
this._widgetClass = We;
|
|
1502
1509
|
break;
|
|
1503
1510
|
case "alert":
|
|
1504
1511
|
this._widgetClass = Je;
|
|
@@ -1595,12 +1602,12 @@ const te = ({
|
|
|
1595
1602
|
return d.forEach((c) => {
|
|
1596
1603
|
const m = c[1];
|
|
1597
1604
|
if (!c[1].includes("'") && c[1] !== "true" && c[1] !== "false") {
|
|
1598
|
-
const
|
|
1605
|
+
const p = Ue({
|
|
1599
1606
|
values: t,
|
|
1600
1607
|
fields: e,
|
|
1601
1608
|
fieldName: m === "active_id" ? "id" : m
|
|
1602
1609
|
});
|
|
1603
|
-
f[c[0].replace(/'/g, "")] =
|
|
1610
|
+
f[c[0].replace(/'/g, "")] = p || void 0;
|
|
1604
1611
|
} else
|
|
1605
1612
|
c[1] === "true" ? f[c[0].replace(/'/g, "")] = !0 : c[1] === "false" ? f[c[0].replace(/'/g, "")] = !1 : f[c[0].replace(/'/g, "")] = c[1].replace(
|
|
1606
1613
|
/'/g,
|
|
@@ -1642,7 +1649,7 @@ function Ze(i) {
|
|
|
1642
1649
|
function e(s) {
|
|
1643
1650
|
const r = [];
|
|
1644
1651
|
for (const a of s)
|
|
1645
|
-
a instanceof
|
|
1652
|
+
a instanceof x ? e(a._container.rows.flat()) : r.push(a);
|
|
1646
1653
|
r.length > 0 && t.push(r);
|
|
1647
1654
|
}
|
|
1648
1655
|
for (const s of i)
|
|
@@ -1773,9 +1780,9 @@ class Ct {
|
|
|
1773
1780
|
const { tagName: l, attributes: o, children: h } = a;
|
|
1774
1781
|
let _ = l, u = o;
|
|
1775
1782
|
if (l === "field") {
|
|
1776
|
-
const { name: v, widget:
|
|
1777
|
-
if (
|
|
1778
|
-
_ =
|
|
1783
|
+
const { name: v, widget: W } = o;
|
|
1784
|
+
if (W)
|
|
1785
|
+
_ = W;
|
|
1779
1786
|
else if (v) {
|
|
1780
1787
|
if (!this._fields[v])
|
|
1781
1788
|
throw new Error(
|
|
@@ -1814,16 +1821,16 @@ class Ct {
|
|
|
1814
1821
|
));
|
|
1815
1822
|
let m;
|
|
1816
1823
|
q(u.domain) ? m = u.domain : q((F = this._fields[u.name]) == null ? void 0 : F.domain) && (m = this._fields[u.name].domain), this._keyIdx = this._keyIdx + 1;
|
|
1817
|
-
const
|
|
1824
|
+
const p = {
|
|
1818
1825
|
...d,
|
|
1819
1826
|
...f,
|
|
1820
1827
|
context: c,
|
|
1821
1828
|
domain: m,
|
|
1822
1829
|
key: `${this._keyIdx}`
|
|
1823
1830
|
};
|
|
1824
|
-
e.readOnly && (
|
|
1825
|
-
const y = r.createWidget(_,
|
|
1826
|
-
y.invisible && y instanceof g && this._invisibleFields.push(
|
|
1831
|
+
e.readOnly && (p.readonly = !0);
|
|
1832
|
+
const y = r.createWidget(_, p);
|
|
1833
|
+
y.invisible && y instanceof g && this._invisibleFields.push(p.name), y instanceof x && this.parseNode({
|
|
1827
1834
|
fields: h,
|
|
1828
1835
|
container: y.container,
|
|
1829
1836
|
values: s
|
|
@@ -2193,7 +2200,7 @@ const rt = {
|
|
|
2193
2200
|
line: j,
|
|
2194
2201
|
bar: j,
|
|
2195
2202
|
pie: j
|
|
2196
|
-
},
|
|
2203
|
+
}, Wt = (i) => {
|
|
2197
2204
|
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2198
2205
|
if (!e)
|
|
2199
2206
|
throw new Error(`${e} is not a valid graph`);
|
|
@@ -2265,7 +2272,7 @@ function $({
|
|
|
2265
2272
|
}
|
|
2266
2273
|
return { value: r, label: r };
|
|
2267
2274
|
}
|
|
2268
|
-
const
|
|
2275
|
+
const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2269
2276
|
__proto__: null,
|
|
2270
2277
|
getFieldsToRetrieve: ot,
|
|
2271
2278
|
getValueAndLabelForField: $
|
|
@@ -2468,7 +2475,7 @@ const mt = {
|
|
|
2468
2475
|
}), a = [];
|
|
2469
2476
|
i.y.forEach((c) => {
|
|
2470
2477
|
Object.keys(r).forEach((m) => {
|
|
2471
|
-
const
|
|
2478
|
+
const p = r[m].label, y = r[m].entries;
|
|
2472
2479
|
if (c.label) {
|
|
2473
2480
|
const w = A({
|
|
2474
2481
|
fieldName: c.label,
|
|
@@ -2476,7 +2483,7 @@ const mt = {
|
|
|
2476
2483
|
fields: e
|
|
2477
2484
|
});
|
|
2478
2485
|
Object.keys(w).forEach((F) => {
|
|
2479
|
-
const v = w[F].entries,
|
|
2486
|
+
const v = w[F].entries, W = w[F].label, ue = N({
|
|
2480
2487
|
entries: v,
|
|
2481
2488
|
fields: e,
|
|
2482
2489
|
fieldName: c.name
|
|
@@ -2485,9 +2492,9 @@ const mt = {
|
|
|
2485
2492
|
operator: c.operator
|
|
2486
2493
|
});
|
|
2487
2494
|
a.push({
|
|
2488
|
-
x:
|
|
2495
|
+
x: p || !1,
|
|
2489
2496
|
value: he,
|
|
2490
|
-
type:
|
|
2497
|
+
type: W,
|
|
2491
2498
|
operator: c.operator,
|
|
2492
2499
|
stacked: c.stacked
|
|
2493
2500
|
});
|
|
@@ -2502,7 +2509,7 @@ const mt = {
|
|
|
2502
2509
|
operator: c.operator
|
|
2503
2510
|
});
|
|
2504
2511
|
a.push({
|
|
2505
|
-
x:
|
|
2512
|
+
x: p || !1,
|
|
2506
2513
|
value: F,
|
|
2507
2514
|
type: ce({
|
|
2508
2515
|
yAxis: c,
|
|
@@ -2559,26 +2566,26 @@ function V({
|
|
|
2559
2566
|
case "count":
|
|
2560
2567
|
return t.length;
|
|
2561
2568
|
case "+":
|
|
2562
|
-
return
|
|
2569
|
+
return I(
|
|
2563
2570
|
t.reduce(function(e, s) {
|
|
2564
2571
|
return e + s;
|
|
2565
2572
|
})
|
|
2566
2573
|
);
|
|
2567
2574
|
case "-":
|
|
2568
|
-
return
|
|
2575
|
+
return I(
|
|
2569
2576
|
t.reduce(function(e, s) {
|
|
2570
2577
|
return e - s;
|
|
2571
2578
|
})
|
|
2572
2579
|
);
|
|
2573
2580
|
case "*":
|
|
2574
|
-
return
|
|
2581
|
+
return I(
|
|
2575
2582
|
t.reduce(function(e, s) {
|
|
2576
2583
|
return e * s;
|
|
2577
2584
|
})
|
|
2578
2585
|
);
|
|
2579
2586
|
case "avg": {
|
|
2580
2587
|
const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
|
|
2581
|
-
return
|
|
2588
|
+
return I(s);
|
|
2582
2589
|
}
|
|
2583
2590
|
case "min":
|
|
2584
2591
|
return Math.min(...t);
|
|
@@ -2586,7 +2593,7 @@ function V({
|
|
|
2586
2593
|
return Math.max(...t);
|
|
2587
2594
|
}
|
|
2588
2595
|
}
|
|
2589
|
-
function
|
|
2596
|
+
function I(i) {
|
|
2590
2597
|
return Math.round((i + Number.EPSILON) * 100) / 100;
|
|
2591
2598
|
}
|
|
2592
2599
|
function A({
|
|
@@ -2649,7 +2656,7 @@ export {
|
|
|
2649
2656
|
ee as CodeEditor,
|
|
2650
2657
|
He as Comments,
|
|
2651
2658
|
z as Container,
|
|
2652
|
-
|
|
2659
|
+
x as ContainerWidget,
|
|
2653
2660
|
Et as Dashboard,
|
|
2654
2661
|
tt as DashboardItem,
|
|
2655
2662
|
Se as Date,
|
|
@@ -2666,7 +2673,7 @@ export {
|
|
|
2666
2673
|
lt as GraphXAxis,
|
|
2667
2674
|
at as GraphYAxis,
|
|
2668
2675
|
Ce as Group,
|
|
2669
|
-
|
|
2676
|
+
We as HTMLPreview,
|
|
2670
2677
|
je as Image,
|
|
2671
2678
|
Ae as Indicator,
|
|
2672
2679
|
Pe as Integer,
|
|
@@ -2679,7 +2686,7 @@ export {
|
|
|
2679
2686
|
M as Notebook,
|
|
2680
2687
|
K as One2many,
|
|
2681
2688
|
Fe as Page,
|
|
2682
|
-
|
|
2689
|
+
Ie as ProgressBar,
|
|
2683
2690
|
Ge as Radio,
|
|
2684
2691
|
Ye as Reference,
|
|
2685
2692
|
et as SearchFieldTypes,
|
|
@@ -2695,12 +2702,12 @@ export {
|
|
|
2695
2702
|
Ne as Timeline,
|
|
2696
2703
|
kt as Tree,
|
|
2697
2704
|
C as Widget,
|
|
2698
|
-
|
|
2705
|
+
It as graphFieldUtils,
|
|
2699
2706
|
St as graphProcessor,
|
|
2700
2707
|
te as parseContext,
|
|
2701
2708
|
Ft as parseContextFields,
|
|
2702
2709
|
Pt as parseDomainFields,
|
|
2703
|
-
|
|
2710
|
+
Wt as parseGraph,
|
|
2704
2711
|
Tt as transformDomainForChildWidget
|
|
2705
2712
|
};
|
|
2706
2713
|
//# sourceMappingURL=ooui.es.js.map
|