@gisce/ooui 2.4.0 → 2.4.1-alpha.2

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.
@@ -45,6 +45,12 @@ declare class One2many extends Field {
45
45
  _height?: number;
46
46
  get height(): number | undefined;
47
47
  set height(value: number);
48
+ /**
49
+ * Infinite mode
50
+ */
51
+ _infinite: boolean;
52
+ get infinite(): boolean;
53
+ set infinite(value: boolean);
48
54
  constructor(props: any);
49
55
  }
50
56
  export default One2many;
@@ -1 +1 @@
1
- {"version":3,"file":"One2many.d.ts","sourceRoot":"","sources":["../src/One2many.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,QAAS,SAAQ,KAAK;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAO;IACpB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IACvB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEtC;IAED;;OAEG;IACH,MAAM,EAAE,GAAG,CAAQ;IACnB,IAAI,KAAK,IAAI,GAAG,CAEf;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,EAEnB;IAED;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,IAAI,IAAI,IAAI,MAAM,EAAE,CAEnB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAEvB;IAED;;OAEG;IACH,WAAW,EAAE,OAAO,CAAS;IAC7B,IAAI,U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,EAE5B;IAED;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IAED;;OAEG;IACH,SAAS,EAAE,OAAO,CAAS;IAC3B,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAE1B;gBAEW,KAAK,EAAE,GAAG;CAiDvB;AAED,eAAe,QAAQ,CAAC"}
package/dist/ooui.es.js CHANGED
@@ -43,7 +43,7 @@ const F = class F {
43
43
  t.widget_props.replace(/'/g, '"')
44
44
  );
45
45
  } catch {
46
- throw new Error("Error parsing widget_props");
46
+ console.error("Error parsing widget_props");
47
47
  }
48
48
  t.key && (this._key = t.key);
49
49
  }
@@ -414,7 +414,7 @@ class H extends g {
414
414
  this._fieldForLabel = e;
415
415
  }
416
416
  }
417
- class W {
417
+ class I {
418
418
  constructor(t = 4, e = 6, i = !1, r = void 0) {
419
419
  /**
420
420
  * Number of columns the container is divided
@@ -538,7 +538,7 @@ const k = class k extends v {
538
538
  * Container label
539
539
  */
540
540
  n(this, "_label", "");
541
- this._container = new W(
541
+ this._container = new I(
542
542
  e == null ? void 0 : e.col,
543
543
  k._defaultColspan,
544
544
  this.readOnly,
@@ -829,7 +829,7 @@ class B extends g {
829
829
  this._translatable = e;
830
830
  }
831
831
  }
832
- class T extends g {
832
+ class P extends g {
833
833
  constructor(e) {
834
834
  super(e);
835
835
  /**
@@ -927,12 +927,12 @@ class Ee extends g {
927
927
  super(t);
928
928
  }
929
929
  }
930
- class Te extends g {
930
+ class Pe extends g {
931
931
  constructor(t) {
932
932
  super(t);
933
933
  }
934
934
  }
935
- class Pe extends g {
935
+ class Te extends g {
936
936
  constructor(e) {
937
937
  super(e);
938
938
  /**
@@ -999,12 +999,19 @@ class U extends g {
999
999
  * Height
1000
1000
  */
1001
1001
  n(this, "_height");
1002
- if (e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height))
1003
- try {
1004
- this._height = parseInt(e.height);
1005
- } catch {
1006
- this._height = void 0;
1007
- }
1002
+ /**
1003
+ * Infinite mode
1004
+ */
1005
+ n(this, "_infinite", !1);
1006
+ if (e) {
1007
+ if (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height)
1008
+ try {
1009
+ this._height = parseInt(e.height);
1010
+ } catch {
1011
+ this._height = void 0;
1012
+ }
1013
+ e.widget_props && (this.parsedWidgetProps.infinite === "1" || this.parsedWidgetProps.infinite === 1 || this.parsedWidgetProps.infinite === !0) && (this._infinite = !0);
1014
+ }
1008
1015
  }
1009
1016
  get size() {
1010
1017
  return this._size;
@@ -1048,8 +1055,14 @@ class U extends g {
1048
1055
  set height(e) {
1049
1056
  this._height = e;
1050
1057
  }
1058
+ get infinite() {
1059
+ return this._infinite;
1060
+ }
1061
+ set infinite(e) {
1062
+ this._infinite = e;
1063
+ }
1051
1064
  }
1052
- class ze extends v {
1065
+ class We extends v {
1053
1066
  constructor(e) {
1054
1067
  super(e);
1055
1068
  /**
@@ -1075,9 +1088,9 @@ class ze extends v {
1075
1088
  return null;
1076
1089
  }
1077
1090
  }
1078
- class Se extends T {
1091
+ class ze extends P {
1079
1092
  }
1080
- class Ie extends g {
1093
+ class Se extends g {
1081
1094
  constructor(e) {
1082
1095
  super(e);
1083
1096
  /**
@@ -1093,7 +1106,7 @@ class Ie extends g {
1093
1106
  this._filenameField = e;
1094
1107
  }
1095
1108
  }
1096
- class We extends g {
1109
+ class Ie extends g {
1097
1110
  }
1098
1111
  class Ve extends g {
1099
1112
  constructor(t) {
@@ -1132,7 +1145,7 @@ class Ye extends U {
1132
1145
  return this.parsedWidgetProps.colorField;
1133
1146
  }
1134
1147
  }
1135
- class De extends T {
1148
+ class De extends P {
1136
1149
  constructor(e) {
1137
1150
  super(e);
1138
1151
  n(this, "_nolabel", !0);
@@ -1215,12 +1228,12 @@ class K extends g {
1215
1228
  }
1216
1229
  class je extends K {
1217
1230
  }
1218
- class Me extends T {
1231
+ class Me extends P {
1219
1232
  get colors() {
1220
1233
  return this._parsedWidgetProps.colors || {};
1221
1234
  }
1222
1235
  }
1223
- class Ne extends T {
1236
+ class Ne extends P {
1224
1237
  constructor(e) {
1225
1238
  super(e);
1226
1239
  /**
@@ -1313,7 +1326,7 @@ class G {
1313
1326
  this._widgetClass = xe;
1314
1327
  break;
1315
1328
  case "selection":
1316
- this._widgetClass = T;
1329
+ this._widgetClass = P;
1317
1330
  break;
1318
1331
  case "many2one":
1319
1332
  this._widgetClass = we;
@@ -1334,13 +1347,13 @@ class G {
1334
1347
  this._widgetClass = Ee;
1335
1348
  break;
1336
1349
  case "datetime":
1337
- this._widgetClass = Te;
1350
+ this._widgetClass = Pe;
1338
1351
  break;
1339
1352
  case "progressbar":
1340
1353
  this._widgetClass = Oe;
1341
1354
  break;
1342
1355
  case "many2many":
1343
- this._widgetClass = Pe;
1356
+ this._widgetClass = Te;
1344
1357
  break;
1345
1358
  case "markdown":
1346
1359
  this._widgetClass = ve;
@@ -1353,7 +1366,7 @@ class G {
1353
1366
  this._widgetClass = J;
1354
1367
  break;
1355
1368
  case "separator":
1356
- this._widgetClass = ze;
1369
+ this._widgetClass = We;
1357
1370
  break;
1358
1371
  case "url":
1359
1372
  this._widgetClass = D;
@@ -1362,13 +1375,13 @@ class G {
1362
1375
  this._widgetClass = D;
1363
1376
  break;
1364
1377
  case "reference":
1365
- this._widgetClass = Se;
1378
+ this._widgetClass = ze;
1366
1379
  break;
1367
1380
  case "binary":
1368
- this._widgetClass = Ie;
1381
+ this._widgetClass = Se;
1369
1382
  break;
1370
1383
  case "image":
1371
- this._widgetClass = We;
1384
+ this._widgetClass = Ie;
1372
1385
  break;
1373
1386
  case "fiber_grid":
1374
1387
  this._widgetClass = Ve;
@@ -1580,7 +1593,7 @@ class pt {
1580
1593
  * List of invisible fields
1581
1594
  */
1582
1595
  n(this, "_invisibleFields", []);
1583
- this._fields = t, this._container = new W(e, 6, !1, "root");
1596
+ this._fields = t, this._container = new I(e, 6, !1, "root");
1584
1597
  }
1585
1598
  get fields() {
1586
1599
  return this._fields;
@@ -1640,13 +1653,13 @@ class pt {
1640
1653
  }) {
1641
1654
  const r = new G();
1642
1655
  t.filter((a) => typeof a == "object").forEach((a) => {
1643
- var w, P;
1656
+ var w, T;
1644
1657
  const { tagName: l, attributes: o, children: h } = a;
1645
1658
  let _ = l, d = o;
1646
1659
  if (l === "field") {
1647
- const { name: x, widget: z } = o;
1648
- if (z)
1649
- _ = z;
1660
+ const { name: x, widget: W } = o;
1661
+ if (W)
1662
+ _ = W;
1650
1663
  else if (x) {
1651
1664
  if (!this._fields[x])
1652
1665
  throw new Error(
@@ -1684,7 +1697,7 @@ class pt {
1684
1697
  d.on_change
1685
1698
  ));
1686
1699
  let y;
1687
- R(d.domain) && (y = d.domain), R((P = this._fields[d.name]) == null ? void 0 : P.domain) && (y = this._fields[d.name].domain), this._keyIdx = this._keyIdx + 1;
1700
+ R(d.domain) && (y = d.domain), R((T = this._fields[d.name]) == null ? void 0 : T.domain) && (y = this._fields[d.name].domain), this._keyIdx = this._keyIdx + 1;
1688
1701
  const p = {
1689
1702
  ...u,
1690
1703
  ...c,
@@ -1816,7 +1829,7 @@ class wt {
1816
1829
  n(this, "_fields");
1817
1830
  n(this, "_simpleSearchContainer");
1818
1831
  n(this, "_advancedSearchContainer");
1819
- this._searchFields = t, this._fields = e, this._simpleSearchContainer = new W(i), this._advancedSearchContainer = new W(i);
1832
+ this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(i), this._advancedSearchContainer = new I(i);
1820
1833
  }
1821
1834
  get searchFields() {
1822
1835
  return this._searchFields;
@@ -2169,12 +2182,12 @@ function at({
2169
2182
  for (let l = 0; l < a.length - 1; l++) {
2170
2183
  const o = a[l], h = a[l + 1];
2171
2184
  if (!ne([o, h], r)) {
2172
- const _ = E(o, I(r)).add(
2185
+ const _ = E(o, S(r)).add(
2173
2186
  e,
2174
2187
  r
2175
- ), d = E(h, I(r));
2188
+ ), d = E(h, S(r));
2176
2189
  for (; _.isBefore(d); )
2177
- i.push(_.format(I(r))), _.add(e, r);
2190
+ i.push(_.format(S(r))), _.add(e, r);
2178
2191
  }
2179
2192
  }
2180
2193
  return i;
@@ -2248,7 +2261,7 @@ function dt(s) {
2248
2261
  }
2249
2262
  function ne(s, t) {
2250
2263
  let e = !1;
2251
- const i = I(t);
2264
+ const i = S(t);
2252
2265
  if (s.length === 0)
2253
2266
  return !1;
2254
2267
  if (s.length === 1)
@@ -2269,7 +2282,7 @@ function re({
2269
2282
  e[o] || (e[o] = []), e[o].push(i);
2270
2283
  }), e;
2271
2284
  }
2272
- function I(s) {
2285
+ function S(s) {
2273
2286
  switch (s) {
2274
2287
  case "days":
2275
2288
  return "YYYY-MM-DD";
@@ -2313,12 +2326,12 @@ const ut = {
2313
2326
  fields: e
2314
2327
  });
2315
2328
  Object.keys(m).forEach((w) => {
2316
- const P = m[w].entries, x = m[w].label, z = N({
2317
- entries: P,
2329
+ const T = m[w].entries, x = m[w].label, W = N({
2330
+ entries: T,
2318
2331
  fields: e,
2319
2332
  fieldName: c.name
2320
2333
  }), le = V({
2321
- values: z,
2334
+ values: W,
2322
2335
  operator: c.operator
2323
2336
  });
2324
2337
  a.push({
@@ -2388,26 +2401,26 @@ function V({
2388
2401
  case "count":
2389
2402
  return t.length;
2390
2403
  case "+":
2391
- return S(
2404
+ return z(
2392
2405
  t.reduce(function(e, i) {
2393
2406
  return e + i;
2394
2407
  })
2395
2408
  );
2396
2409
  case "-":
2397
- return S(
2410
+ return z(
2398
2411
  t.reduce(function(e, i) {
2399
2412
  return e - i;
2400
2413
  })
2401
2414
  );
2402
2415
  case "*":
2403
- return S(
2416
+ return z(
2404
2417
  t.reduce(function(e, i) {
2405
2418
  return e * i;
2406
2419
  })
2407
2420
  );
2408
2421
  case "avg": {
2409
2422
  const i = t.reduce((r, a) => r + a, 0) / t.length || 0;
2410
- return S(i);
2423
+ return z(i);
2411
2424
  }
2412
2425
  case "min":
2413
2426
  return Math.min(...t);
@@ -2415,7 +2428,7 @@ function V({
2415
2428
  return Math.max(...t);
2416
2429
  }
2417
2430
  }
2418
- function S(s) {
2431
+ function z(s) {
2419
2432
  return Math.round((s + Number.EPSILON) * 100) / 100;
2420
2433
  }
2421
2434
  function A({
@@ -2459,18 +2472,18 @@ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2459
2472
  }, Symbol.toStringTag, { value: "Module" }));
2460
2473
  export {
2461
2474
  be as Avatar,
2462
- Ie as Binary,
2475
+ Se as Binary,
2463
2476
  X as Boolean,
2464
2477
  Q as Button,
2465
2478
  xe as ButtonGroup,
2466
2479
  D as Char,
2467
2480
  Le as CodeEditor,
2468
- W as Container,
2481
+ I as Container,
2469
2482
  C as ContainerWidget,
2470
2483
  Ft as Dashboard,
2471
2484
  Xe as DashboardItem,
2472
2485
  Ee as Date,
2473
- Te as DateTime,
2486
+ Pe as DateTime,
2474
2487
  g as Field,
2475
2488
  L as Float,
2476
2489
  Fe as FloatTime,
@@ -2484,11 +2497,11 @@ export {
2484
2497
  tt as GraphYAxis,
2485
2498
  pe as Group,
2486
2499
  ke as HTMLPreview,
2487
- We as Image,
2500
+ Ie as Image,
2488
2501
  De as Indicator,
2489
2502
  Ce as Integer,
2490
2503
  H as Label,
2491
- Pe as Many2many,
2504
+ Te as Many2many,
2492
2505
  we as Many2one,
2493
2506
  ve as Markdown,
2494
2507
  K as MultiCheckbox,
@@ -2498,11 +2511,11 @@ export {
2498
2511
  ye as Page,
2499
2512
  Oe as ProgressBar,
2500
2513
  Ne as Radio,
2501
- Se as Reference,
2514
+ ze as Reference,
2502
2515
  Qe as SearchFieldTypes,
2503
2516
  wt as SearchFilter,
2504
- T as Selection,
2505
- ze as Separator,
2517
+ P as Selection,
2518
+ We as Separator,
2506
2519
  Be as Steps,
2507
2520
  Ae as Switch,
2508
2521
  Me as Tag,