@gisce/ooui 2.6.4 → 2.7.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/Char.d.ts +1 -0
- package/dist/Char.d.ts.map +1 -1
- package/dist/Text.d.ts +7 -0
- package/dist/Text.d.ts.map +1 -1
- package/dist/ooui.es.js +48 -32
- package/dist/ooui.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Char.ts +4 -0
- package/src/Text.ts +19 -0
- package/src/spec/Char.spec.ts +31 -0
- package/src/spec/Text.spec.ts +67 -0
package/dist/Char.d.ts
CHANGED
package/dist/Char.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Char.d.ts","sourceRoot":"","sources":["../src/Char.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,IAAK,SAAQ,KAAK;IACtB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAM;IAC1B,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEjC;IAED,WAAW,EAAE,OAAO,CAAS;IAC7B,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAE5B;IAED,aAAa,EAAE,OAAO,CAAS;IAC/B,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;gBAEW,KAAK,EAAE,GAAG;CAmBvB;AAED,eAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"Char.d.ts","sourceRoot":"","sources":["../src/Char.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,IAAK,SAAQ,KAAK;IACtB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAM;IAC1B,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEjC;IAED,WAAW,EAAE,OAAO,CAAS;IAC7B,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAE5B;IAED,aAAa,EAAE,OAAO,CAAS;IAC/B,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;gBAEW,KAAK,EAAE,GAAG;CAmBvB;AAED,eAAe,IAAI,CAAC"}
|
package/dist/Text.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ declare class Text extends Field {
|
|
|
9
9
|
_placeholder: string;
|
|
10
10
|
get placeholder(): string;
|
|
11
11
|
set placeholder(value: string);
|
|
12
|
+
get showCount(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Field size
|
|
15
|
+
*/
|
|
16
|
+
_size: number | undefined;
|
|
17
|
+
get size(): number | undefined;
|
|
18
|
+
set size(value: number | undefined);
|
|
12
19
|
/**
|
|
13
20
|
* Must expand widget
|
|
14
21
|
*/
|
package/dist/Text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../src/Text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAG5B;;GAEG;AACH,cAAM,IAAK,SA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IAC5B,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEnC;IAED,aAAa,EAAE,OAAO,CAAS;IAC/B,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;gBAEW,KAAK,EAAE,GAAG;CA8BvB;AAED,eAAe,IAAI,CAAC"}
|
package/dist/ooui.es.js
CHANGED
|
@@ -3,7 +3,7 @@ var de = (i, t, e) => t in i ? ce(i, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var n = (i, t, e) => (de(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { decode as ue } from "html-entities";
|
|
5
5
|
import { evaluateCondition as he } from "@gisce/conscheck";
|
|
6
|
-
import * as
|
|
6
|
+
import * as Y from "txml";
|
|
7
7
|
import T from "moment";
|
|
8
8
|
const C = class C {
|
|
9
9
|
constructor(t) {
|
|
@@ -414,7 +414,7 @@ class H extends g {
|
|
|
414
414
|
this._fieldForLabel = e;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class z {
|
|
418
418
|
constructor(t = 4, e = 6, s = !1, r = void 0) {
|
|
419
419
|
/**
|
|
420
420
|
* Number of columns the container is divided
|
|
@@ -538,7 +538,7 @@ const k = class k extends F {
|
|
|
538
538
|
* Container label
|
|
539
539
|
*/
|
|
540
540
|
n(this, "_label", "");
|
|
541
|
-
this._container = new
|
|
541
|
+
this._container = new z(
|
|
542
542
|
e == null ? void 0 : e.col,
|
|
543
543
|
k._defaultColspan,
|
|
544
544
|
this.readOnly,
|
|
@@ -738,7 +738,7 @@ class we extends w {
|
|
|
738
738
|
return this._container.rows[0].filter((e) => !e.invisible);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
class
|
|
741
|
+
class D extends g {
|
|
742
742
|
constructor(e) {
|
|
743
743
|
super(e);
|
|
744
744
|
/**
|
|
@@ -759,6 +759,9 @@ class z extends g {
|
|
|
759
759
|
set placeholder(e) {
|
|
760
760
|
this._placeholder = e;
|
|
761
761
|
}
|
|
762
|
+
get showCount() {
|
|
763
|
+
return this.parsedWidgetProps.showCount || !1;
|
|
764
|
+
}
|
|
762
765
|
get size() {
|
|
763
766
|
return this._size;
|
|
764
767
|
}
|
|
@@ -785,6 +788,10 @@ class B extends g {
|
|
|
785
788
|
* Field place holder
|
|
786
789
|
*/
|
|
787
790
|
n(this, "_placeholder", "");
|
|
791
|
+
/**
|
|
792
|
+
* Field size
|
|
793
|
+
*/
|
|
794
|
+
n(this, "_size");
|
|
788
795
|
/**
|
|
789
796
|
* Must expand widget
|
|
790
797
|
*/
|
|
@@ -801,7 +808,7 @@ class B extends g {
|
|
|
801
808
|
} catch {
|
|
802
809
|
this._height = void 0;
|
|
803
810
|
}
|
|
804
|
-
e.translate && (this.translatable = e.translate === "True" || e.translate === !0);
|
|
811
|
+
e.translate && (this.translatable = e.translate === "True" || e.translate === !0), e.size && (this.size = parseInt(e.size));
|
|
805
812
|
}
|
|
806
813
|
}
|
|
807
814
|
get placeholder() {
|
|
@@ -810,6 +817,15 @@ class B extends g {
|
|
|
810
817
|
set placeholder(e) {
|
|
811
818
|
this._placeholder = e;
|
|
812
819
|
}
|
|
820
|
+
get showCount() {
|
|
821
|
+
return this.parsedWidgetProps.showCount || !1;
|
|
822
|
+
}
|
|
823
|
+
get size() {
|
|
824
|
+
return this._size;
|
|
825
|
+
}
|
|
826
|
+
set size(e) {
|
|
827
|
+
this._size = e;
|
|
828
|
+
}
|
|
813
829
|
get mustExpand() {
|
|
814
830
|
return this._mustExpand;
|
|
815
831
|
}
|
|
@@ -1070,14 +1086,14 @@ class Se extends g {
|
|
|
1070
1086
|
this._filenameField = e;
|
|
1071
1087
|
}
|
|
1072
1088
|
}
|
|
1073
|
-
class
|
|
1089
|
+
class ze extends g {
|
|
1074
1090
|
}
|
|
1075
|
-
class
|
|
1091
|
+
class Ve extends g {
|
|
1076
1092
|
constructor(t) {
|
|
1077
1093
|
super(t);
|
|
1078
1094
|
}
|
|
1079
1095
|
}
|
|
1080
|
-
class
|
|
1096
|
+
class Ye extends U {
|
|
1081
1097
|
constructor(e) {
|
|
1082
1098
|
super(e);
|
|
1083
1099
|
/**
|
|
@@ -1109,7 +1125,7 @@ class De extends U {
|
|
|
1109
1125
|
return this.parsedWidgetProps.colorField;
|
|
1110
1126
|
}
|
|
1111
1127
|
}
|
|
1112
|
-
class
|
|
1128
|
+
class De extends P {
|
|
1113
1129
|
constructor(e) {
|
|
1114
1130
|
super(e);
|
|
1115
1131
|
n(this, "_nolabel", !0);
|
|
@@ -1325,7 +1341,7 @@ class G {
|
|
|
1325
1341
|
this._widgetClass = H;
|
|
1326
1342
|
break;
|
|
1327
1343
|
case "char":
|
|
1328
|
-
this._widgetClass =
|
|
1344
|
+
this._widgetClass = D;
|
|
1329
1345
|
break;
|
|
1330
1346
|
case "text":
|
|
1331
1347
|
this._widgetClass = B;
|
|
@@ -1378,10 +1394,10 @@ class G {
|
|
|
1378
1394
|
this._widgetClass = Ie;
|
|
1379
1395
|
break;
|
|
1380
1396
|
case "url":
|
|
1381
|
-
this._widgetClass =
|
|
1397
|
+
this._widgetClass = D;
|
|
1382
1398
|
break;
|
|
1383
1399
|
case "email":
|
|
1384
|
-
this._widgetClass =
|
|
1400
|
+
this._widgetClass = D;
|
|
1385
1401
|
break;
|
|
1386
1402
|
case "reference":
|
|
1387
1403
|
this._widgetClass = We;
|
|
@@ -1390,16 +1406,16 @@ class G {
|
|
|
1390
1406
|
this._widgetClass = Se;
|
|
1391
1407
|
break;
|
|
1392
1408
|
case "image":
|
|
1393
|
-
this._widgetClass =
|
|
1409
|
+
this._widgetClass = ze;
|
|
1394
1410
|
break;
|
|
1395
1411
|
case "fiber_grid":
|
|
1396
|
-
this._widgetClass =
|
|
1412
|
+
this._widgetClass = Ve;
|
|
1397
1413
|
break;
|
|
1398
1414
|
case "timeline":
|
|
1399
|
-
this._widgetClass =
|
|
1415
|
+
this._widgetClass = Ye;
|
|
1400
1416
|
break;
|
|
1401
1417
|
case "indicator":
|
|
1402
|
-
this._widgetClass =
|
|
1418
|
+
this._widgetClass = De;
|
|
1403
1419
|
break;
|
|
1404
1420
|
case "tags":
|
|
1405
1421
|
this._widgetClass = je;
|
|
@@ -1621,7 +1637,7 @@ class pt {
|
|
|
1621
1637
|
* Context for each field in the form
|
|
1622
1638
|
*/
|
|
1623
1639
|
n(this, "_contextForFields", {});
|
|
1624
|
-
this._fields = t, this._container = new
|
|
1640
|
+
this._fields = t, this._container = new z(e, 6, !1, "root");
|
|
1625
1641
|
}
|
|
1626
1642
|
get fields() {
|
|
1627
1643
|
return this._fields;
|
|
@@ -1673,7 +1689,7 @@ class pt {
|
|
|
1673
1689
|
}
|
|
1674
1690
|
parse(t, e) {
|
|
1675
1691
|
var o;
|
|
1676
|
-
const { values: s = {}, readOnly: r = !1 } = e || {}, a =
|
|
1692
|
+
const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((u) => u.tagName === "form")[0];
|
|
1677
1693
|
this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
|
|
1678
1694
|
fields: a.children,
|
|
1679
1695
|
container: this._container,
|
|
@@ -1817,7 +1833,7 @@ class wt {
|
|
|
1817
1833
|
this._contextForFields = t;
|
|
1818
1834
|
}
|
|
1819
1835
|
parse(t) {
|
|
1820
|
-
const e =
|
|
1836
|
+
const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
|
|
1821
1837
|
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;
|
|
1822
1838
|
const s = new G();
|
|
1823
1839
|
e.children.forEach((r) => {
|
|
@@ -1883,7 +1899,7 @@ class vt {
|
|
|
1883
1899
|
n(this, "_fields");
|
|
1884
1900
|
n(this, "_simpleSearchContainer");
|
|
1885
1901
|
n(this, "_advancedSearchContainer");
|
|
1886
|
-
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new
|
|
1902
|
+
this._searchFields = t, this._fields = e, this._simpleSearchContainer = new z(s), this._advancedSearchContainer = new z(s);
|
|
1887
1903
|
}
|
|
1888
1904
|
get searchFields() {
|
|
1889
1905
|
return this._searchFields;
|
|
@@ -1963,7 +1979,7 @@ class kt {
|
|
|
1963
1979
|
constructor(t) {
|
|
1964
1980
|
n(this, "_string", null);
|
|
1965
1981
|
n(this, "_items", []);
|
|
1966
|
-
const e =
|
|
1982
|
+
const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
|
|
1967
1983
|
this._string = e.attributes.string || null;
|
|
1968
1984
|
const { children: s } = e;
|
|
1969
1985
|
s.forEach((r) => {
|
|
@@ -2098,7 +2114,7 @@ const tt = {
|
|
|
2098
2114
|
bar: j,
|
|
2099
2115
|
pie: j
|
|
2100
2116
|
}, Ot = (i) => {
|
|
2101
|
-
const t =
|
|
2117
|
+
const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
|
|
2102
2118
|
if (!e)
|
|
2103
2119
|
throw new Error(`${e} is not a valid graph`);
|
|
2104
2120
|
const s = tt[e];
|
|
@@ -2258,7 +2274,7 @@ function ot({
|
|
|
2258
2274
|
groupBy: "all"
|
|
2259
2275
|
});
|
|
2260
2276
|
return Object.keys(r).forEach((a) => {
|
|
2261
|
-
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u =
|
|
2277
|
+
const l = r[a], o = l[0].operator === "count" ? "+" : l[0].operator, u = V({
|
|
2262
2278
|
values: l.map((_) => _.value),
|
|
2263
2279
|
operator: o
|
|
2264
2280
|
});
|
|
@@ -2384,7 +2400,7 @@ const ht = {
|
|
|
2384
2400
|
entries: E,
|
|
2385
2401
|
fields: e,
|
|
2386
2402
|
fieldName: c.name
|
|
2387
|
-
}), oe =
|
|
2403
|
+
}), oe = V({
|
|
2388
2404
|
values: I,
|
|
2389
2405
|
operator: c.operator
|
|
2390
2406
|
});
|
|
@@ -2401,7 +2417,7 @@ const ht = {
|
|
|
2401
2417
|
entries: x,
|
|
2402
2418
|
fields: e,
|
|
2403
2419
|
fieldName: c.name
|
|
2404
|
-
}), v =
|
|
2420
|
+
}), v = V({
|
|
2405
2421
|
values: m,
|
|
2406
2422
|
operator: c.operator
|
|
2407
2423
|
});
|
|
@@ -2447,7 +2463,7 @@ function A({
|
|
|
2447
2463
|
fields: e
|
|
2448
2464
|
})).map(({ value: s, label: r }) => r);
|
|
2449
2465
|
}
|
|
2450
|
-
function
|
|
2466
|
+
function V({
|
|
2451
2467
|
operator: i,
|
|
2452
2468
|
values: t
|
|
2453
2469
|
}) {
|
|
@@ -2517,7 +2533,7 @@ function le({
|
|
|
2517
2533
|
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2518
2534
|
__proto__: null,
|
|
2519
2535
|
getAllObjectsInGroupedValues: ft,
|
|
2520
|
-
getValueForOperator:
|
|
2536
|
+
getValueForOperator: V,
|
|
2521
2537
|
getValuesForYField: A,
|
|
2522
2538
|
getValuesGroupedByField: N,
|
|
2523
2539
|
getYAxisFieldname: le,
|
|
@@ -2531,9 +2547,9 @@ export {
|
|
|
2531
2547
|
X as Boolean,
|
|
2532
2548
|
Q as Button,
|
|
2533
2549
|
we as ButtonGroup,
|
|
2534
|
-
|
|
2550
|
+
D as Char,
|
|
2535
2551
|
Le as CodeEditor,
|
|
2536
|
-
|
|
2552
|
+
z as Container,
|
|
2537
2553
|
w as ContainerWidget,
|
|
2538
2554
|
kt as Dashboard,
|
|
2539
2555
|
Ue as DashboardItem,
|
|
@@ -2552,8 +2568,8 @@ export {
|
|
|
2552
2568
|
it as GraphYAxis,
|
|
2553
2569
|
pe as Group,
|
|
2554
2570
|
Oe as HTMLPreview,
|
|
2555
|
-
|
|
2556
|
-
|
|
2571
|
+
ze as Image,
|
|
2572
|
+
De as Indicator,
|
|
2557
2573
|
Ce as Integer,
|
|
2558
2574
|
H as Label,
|
|
2559
2575
|
ve as Many2one,
|
|
@@ -2576,7 +2592,7 @@ export {
|
|
|
2576
2592
|
je as Tags,
|
|
2577
2593
|
B as Text,
|
|
2578
2594
|
Ge as Time,
|
|
2579
|
-
|
|
2595
|
+
Ye as Timeline,
|
|
2580
2596
|
wt as Tree,
|
|
2581
2597
|
F as Widget,
|
|
2582
2598
|
Tt as graphFieldUtils,
|