@hpcc-js/layout 3.6.6 → 3.6.7

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/index.js CHANGED
@@ -11,10 +11,10 @@ var D = Object.create, O = Object.defineProperty, __name = (e, t) => O(e, "name"
11
11
  enumerable: !(r = k(t, s)) || r.enumerable
12
12
  });
13
13
  return e;
14
- }, __toESM = (e, t, n) => (n = e == null ? {} : D(j(e)), __copyProps(t || !e || !e.__esModule ? O(n, "default", {
14
+ }, __toESM = (e, t, n) => (n = e == null ? {} : D(j(e)), __copyProps(t || !e || !e.__esModule || !M.call(e, "default") ? O(n, "default", {
15
15
  value: e,
16
16
  enumerable: !0
17
- }) : n, e)), N = "@hpcc-js/layout", te = "3.6.6", ne = "3.29.1", AbsoluteSurface = class extends r {
17
+ }) : n, e)), N = "@hpcc-js/layout", te = "3.6.7", ne = "3.31.1", AbsoluteSurface = class extends r {
18
18
  constructor() {
19
19
  super(), this._tag = "div";
20
20
  }
@@ -28,9 +28,7 @@ var D = Object.create, O = Object.defineProperty, __name = (e, t) => O(e, "name"
28
28
  case "pixels":
29
29
  n = this.widgetX(), r = this.widgetY(), i = this.widgetWidth() === "" ? i - n : Number(this.widgetWidth()), a = this.widgetHeight() === "" ? a - r : Number(this.widgetHeight());
30
30
  break;
31
- case "percent":
32
- n = this.widgetX() * i / 100, r = this.widgetY() * a / 100, i = this.widgetWidth() === "" ? i - n : Number(this.widgetWidth()) * i / 100, a = this.widgetHeight() === "" ? a - r : Number(this.widgetHeight()) * a / 100;
33
- break;
31
+ case "percent": n = this.widgetX() * i / 100, r = this.widgetY() * a / 100, i = this.widgetWidth() === "" ? i - n : Number(this.widgetWidth()) * i / 100, a = this.widgetHeight() === "" ? a - r : Number(this.widgetHeight()) * a / 100;
34
32
  }
35
33
  t.style("opacity", this.opacity());
36
34
  let o = t.selectAll("#" + this._id + " > .placeholder").data(this.widget() ? [this.widget()] : [], function(e) {
@@ -290,9 +288,9 @@ var Border = class extends r {
290
288
  }
291
289
  }
292
290
  borderLayoutObject(e) {
293
- let t = {}, n = this, r, i, a, o, s, c, l, u, d = this.target().getBoundingClientRect(), f = {};
294
- f.top = d.top, f.left = d.left, f.bottom = d.bottom, f.right = d.right, this.target() instanceof SVGElement ? (f.width = parseFloat(this.target().getAttribute("width")), f.height = parseFloat(this.target().getAttribute("height"))) : (f.width = d.width, f.height = d.height), this.sectionTypes().indexOf("top") !== -1 && (r = this.topSize(), i = this.topPercentage(), this._shrinkWrapBoxes.top !== void 0 && (r = this._shrinkWrapBoxes.top.height + this.gutter(), i = 0)), this.sectionTypes().indexOf("bottom") !== -1 && (a = this.bottomSize(), o = this.bottomPercentage(), this._shrinkWrapBoxes.bottom !== void 0 && (a = this._shrinkWrapBoxes.bottom.height + this.gutter(), o = 0)), this.sectionTypes().indexOf("left") !== -1 && (s = this.leftSize(), c = this.leftPercentage(), this._shrinkWrapBoxes.left !== void 0 && (s = this._shrinkWrapBoxes.left.width + this.gutter(), c = 0)), this.sectionTypes().indexOf("right") !== -1 && (l = this.rightSize(), u = this.rightPercentage(), this._shrinkWrapBoxes.right !== void 0 && (l = this._shrinkWrapBoxes.right.width + this.gutter(), u = 0));
295
- let p = _sectionPlacementObject({
291
+ let t = {}, n = this, r, i, a, o, s, c, l, u, d = this.target().getBoundingClientRect();
292
+ d.top, d.left, d.bottom, d.right, this.target() instanceof SVGElement ? (parseFloat(this.target().getAttribute("width")), parseFloat(this.target().getAttribute("height"))) : (d.width, d.height), this.sectionTypes().indexOf("top") !== -1 && (r = this.topSize(), i = this.topPercentage(), this._shrinkWrapBoxes.top !== void 0 && (r = this._shrinkWrapBoxes.top.height + this.gutter(), i = 0)), this.sectionTypes().indexOf("bottom") !== -1 && (a = this.bottomSize(), o = this.bottomPercentage(), this._shrinkWrapBoxes.bottom !== void 0 && (a = this._shrinkWrapBoxes.bottom.height + this.gutter(), o = 0)), this.sectionTypes().indexOf("left") !== -1 && (s = this.leftSize(), c = this.leftPercentage(), this._shrinkWrapBoxes.left !== void 0 && (s = this._shrinkWrapBoxes.left.width + this.gutter(), c = 0)), this.sectionTypes().indexOf("right") !== -1 && (l = this.rightSize(), u = this.rightPercentage(), this._shrinkWrapBoxes.right !== void 0 && (l = this._shrinkWrapBoxes.right.width + this.gutter(), u = 0));
293
+ let f = _sectionPlacementObject({
296
294
  width: {
297
295
  px: 0,
298
296
  "%": 100
@@ -309,7 +307,7 @@ var Border = class extends r {
309
307
  px: 0,
310
308
  "%": 0
311
309
  }
312
- }), m = _sectionPlacementObject({
310
+ }), p = _sectionPlacementObject({
313
311
  width: {
314
312
  px: 0,
315
313
  "%": 100
@@ -327,35 +325,35 @@ var Border = class extends r {
327
325
  "%": 0
328
326
  }
329
327
  });
330
- m.top -= m.height;
331
- let h = _sectionPlacementObject({
328
+ p.top -= p.height;
329
+ let m = _sectionPlacementObject({
332
330
  width: {
333
331
  px: s,
334
332
  "%": c
335
333
  },
336
334
  height: {
337
- px: -p.height - m.height,
335
+ px: -f.height - p.height,
338
336
  "%": 100
339
337
  },
340
338
  top: {
341
- px: p.height,
339
+ px: f.height,
342
340
  "%": 0
343
341
  },
344
342
  left: {
345
343
  px: 0,
346
344
  "%": 0
347
345
  }
348
- }), g = _sectionPlacementObject({
346
+ }), h = _sectionPlacementObject({
349
347
  width: {
350
348
  px: l,
351
349
  "%": u
352
350
  },
353
351
  height: {
354
- px: -p.height - m.height,
352
+ px: -f.height - p.height,
355
353
  "%": 100
356
354
  },
357
355
  top: {
358
- px: p.height,
356
+ px: f.height,
359
357
  "%": 0
360
358
  },
361
359
  left: {
@@ -363,26 +361,26 @@ var Border = class extends r {
363
361
  "%": 100
364
362
  }
365
363
  });
366
- g.left -= g.width;
367
- let _ = _sectionPlacementObject({
364
+ h.left -= h.width;
365
+ let g = _sectionPlacementObject({
368
366
  width: {
369
- px: -g.width - h.width,
367
+ px: -h.width - m.width,
370
368
  "%": 100
371
369
  },
372
370
  height: {
373
- px: -p.height - m.height,
371
+ px: -f.height - p.height,
374
372
  "%": 100
375
373
  },
376
374
  top: {
377
- px: p.height,
375
+ px: f.height,
378
376
  "%": 0
379
377
  },
380
378
  left: {
381
- px: h.width,
379
+ px: m.width,
382
380
  "%": 0
383
381
  }
384
382
  });
385
- return t.top = p, t.bottom = m, t.right = g, t.left = h, t.center = _, t;
383
+ return t.top = f, t.bottom = p, t.right = h, t.left = m, t.center = g, t;
386
384
  function _sectionPlacementObject(e) {
387
385
  return e.width.px = e.width.px === void 0 ? 0 : e.width.px, e.width["%"] = e.width["%"] === void 0 ? 0 : e.width["%"], e.height.px = e.height.px === void 0 ? 0 : e.height.px, e.height["%"] = e.height["%"] === void 0 ? 0 : e.height["%"], {
388
386
  width: e.width.px + e.width["%"] / 100 * n.width(),
@@ -438,9 +436,7 @@ var Border = class extends r {
438
436
  _moveHandles(e, i);
439
437
  break;
440
438
  case "right":
441
- case "left":
442
- _moveHandles(e, r);
443
- break;
439
+ case "left": _moveHandles(e, r);
444
440
  }
445
441
  function _moveHandles(e, n) {
446
442
  if (n === 0) return;
@@ -464,9 +460,7 @@ var Border = class extends r {
464
460
  case "bottom":
465
461
  r !== 0 && (this.bottomPercentage(0), this.bottomSize(this.bottomSize() === 0 ? this.getContent("bottom").getBBox().height + r : this.bottomSize() + r));
466
462
  break;
467
- case "left":
468
- n !== 0 && (this.leftPercentage(0), this.leftSize(this.leftSize() === 0 ? this.getContent("left").getBBox().width - n : this.leftSize() - n));
469
- break;
463
+ case "left": n !== 0 && (this.leftPercentage(0), this.leftSize(this.leftSize() === 0 ? this.getContent("left").getBBox().width - n : this.leftSize() - n));
470
464
  }
471
465
  this._dragPrevX = t.sourceEvent.clientX, this._dragPrevY = t.sourceEvent.clientY;
472
466
  }
@@ -913,7 +907,8 @@ var pe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fun
913
907
  if (t.length === 0) return e;
914
908
  for (var a = t.length; a < e.length; a++) t.push(e[a]);
915
909
  return t;
916
- } else if (typeof t == "function") {
910
+ }
911
+ if (typeof t == "function") {
917
912
  for (var o = [], s = e.length, c = 0; c < s; c++) o.push(t({
918
913
  i: c,
919
914
  genLength: s,
@@ -1175,9 +1170,7 @@ var Legend = class extends c {
1175
1170
  case "chart":
1176
1171
  case "columns":
1177
1172
  case "data":
1178
- case "paletteID":
1179
- e.lazyRender();
1180
- break;
1173
+ case "paletteID": e.lazyRender();
1181
1174
  }
1182
1175
  });
1183
1176
  }
@@ -1249,11 +1242,9 @@ var Legend = class extends c {
1249
1242
  ];
1250
1243
  }, this);
1251
1244
  break;
1252
- default:
1253
- e = this.columns().map(function(e) {
1254
- return [a(void 0, e, !1), e];
1255
- }, this);
1256
- break;
1245
+ default: e = this.columns().map(function(e) {
1246
+ return [a(void 0, e, !1), e];
1247
+ }, this);
1257
1248
  }
1258
1249
  break;
1259
1250
  case "rainbow":
@@ -1264,7 +1255,6 @@ var Legend = class extends c {
1264
1255
  Math.floor(n) > parseInt(e[0][1]) && (n = Math.floor(n)), e.push([s(n, d, f), c(n)]);
1265
1256
  }
1266
1257
  e.push([s(f, d, f), c(f)]);
1267
- break;
1268
1258
  }
1269
1259
  }
1270
1260
  return {
@@ -1319,40 +1309,27 @@ var Legend = class extends c {
1319
1309
  }
1320
1310
  }
1321
1311
  onClick(e, t) {
1322
- switch (this.getPaletteType()) {
1323
- case "ordinal":
1324
- switch (this.dataFamily()) {
1325
- case "2D":
1326
- case "ND":
1327
- let t = this._disabled.indexOf(e);
1328
- t < 0 ? this._disabled.push(e) : this._disabled.splice(t, 1), this._owner.refreshColumns(), this._owner.refreshData(), this._owner.render();
1329
- break;
1330
- }
1331
- break;
1312
+ if (this.getPaletteType() === "ordinal") switch (this.dataFamily()) {
1313
+ case "2D":
1314
+ case "ND":
1315
+ let t = this._disabled.indexOf(e);
1316
+ t < 0 ? this._disabled.push(e) : this._disabled.splice(t, 1), this._owner.refreshColumns(), this._owner.refreshData(), this._owner.render();
1332
1317
  }
1333
1318
  }
1334
1319
  onOver(e, t) {
1335
1320
  if (E(this._owner)) switch (this.getPaletteType()) {
1336
- case "ordinal":
1337
- switch (this.dataFamily()) {
1338
- case "2D":
1339
- case "ND":
1340
- this._disabled.indexOf(e) < 0 && this._owner.highlightColumn(e);
1341
- break;
1342
- }
1343
- break;
1321
+ case "ordinal": switch (this.dataFamily()) {
1322
+ case "2D":
1323
+ case "ND": this._disabled.indexOf(e) < 0 && this._owner.highlightColumn(e);
1324
+ }
1344
1325
  }
1345
1326
  }
1346
1327
  onOut(e, t) {
1347
1328
  if (E(this._owner)) switch (this.getPaletteType()) {
1348
- case "ordinal":
1349
- switch (this.dataFamily()) {
1350
- case "2D":
1351
- case "ND":
1352
- this._owner.highlightColumn();
1353
- break;
1354
- }
1355
- break;
1329
+ case "ordinal": switch (this.dataFamily()) {
1330
+ case "2D":
1331
+ case "ND": this._owner.highlightColumn();
1332
+ }
1356
1333
  }
1357
1334
  }
1358
1335
  onDblClick(e, t) {}
@@ -1616,17 +1593,10 @@ var ChartPanel = class extends Border2 {
1616
1593
  case "small":
1617
1594
  this.preUpdateSmall(t);
1618
1595
  break;
1619
- case "regular":
1620
- this.preUpdateRegular(t);
1621
- break;
1596
+ case "regular": this.preUpdateRegular(t);
1622
1597
  }
1623
1598
  let n = this._widget.classID() === "composite_MultiChart" ? this._widget.chart() : this._widget;
1624
- if (this._legend.dataFamily(n._dataFamily || "any"), this._prevChartDataFamily !== this._legend.dataFamily()) switch (this._prevChartDataFamily = this._legend.dataFamily(), this._prevChartDataFamily) {
1625
- case "any":
1626
- this._toggleLegend.selected(!1), this._legend.visible(!1);
1627
- break;
1628
- }
1629
- if (t.style("box-shadow", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : "none"), this._hideLegendToggleList.indexOf(n.classID()) === -1 ? (this._spacer.visible(!0), this._toggleLegend.visible(!0)) : (this._spacer.visible(!1), this._toggleLegend.visible(!1)), this._prevChart !== n) {
1599
+ if (this._legend.dataFamily(n._dataFamily || "any"), this._prevChartDataFamily !== this._legend.dataFamily() && (this._prevChartDataFamily = this._legend.dataFamily(), this._prevChartDataFamily === "any") && (this._toggleLegend.selected(!1), this._legend.visible(!1)), t.style("box-shadow", this.highlight() ? `inset 0px 0px 0px ${this.highlightSize()}px ${this.highlightColor()}` : "none"), this._hideLegendToggleList.indexOf(n.classID()) === -1 ? (this._spacer.visible(!0), this._toggleLegend.visible(!0)) : (this._spacer.visible(!1), this._toggleLegend.visible(!1)), this._prevChart !== n) {
1630
1600
  this._prevChart = n;
1631
1601
  let e = n ? n._titleBar || n._iconBar : void 0;
1632
1602
  if (e && e instanceof i) {
@@ -1650,9 +1620,7 @@ var ChartPanel = class extends Border2 {
1650
1620
  case "small":
1651
1621
  this.postUpdateSmall(t);
1652
1622
  break;
1653
- case "regular":
1654
- this.postUpdateRegular(t);
1655
- break;
1623
+ case "regular": this.postUpdateRegular(t);
1656
1624
  }
1657
1625
  }
1658
1626
  postUpdateTiny(e) {
@@ -2008,19 +1976,19 @@ var $ = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((e, t) => {
2008
1976
  getCell(e, t) {
2009
1977
  let n = null;
2010
1978
  return this.content().some(function(r) {
2011
- return e >= r.gridRow() && e < r.gridRow() + r.gridRowSpan() && t >= r.gridCol() && t < r.gridCol() + r.gridColSpan() ? (n = r, !0) : !1;
1979
+ return e >= r.gridRow() && e < r.gridRow() + r.gridRowSpan() && t >= r.gridCol() && t < r.gridCol() + r.gridColSpan() && (n = r, !0);
2012
1980
  }), n;
2013
1981
  }
2014
1982
  getWidgetCell(e) {
2015
1983
  let t = null;
2016
1984
  return this.content().some(function(n) {
2017
- return n.widget().id() === e ? (t = n, !0) : !1;
1985
+ return n.widget().id() === e && (t = n, !0);
2018
1986
  }), t;
2019
1987
  }
2020
1988
  getContent(e) {
2021
1989
  let t = null;
2022
1990
  return this.content().some(function(n) {
2023
- return n.widget().id() === e ? (t = n.widget(), !0) : !1;
1991
+ return n.widget().id() === e && (t = n.widget(), !0);
2024
1992
  }), t;
2025
1993
  }
2026
1994
  cellToGridItem(e) {
@@ -2328,9 +2296,7 @@ var Popup = class extends r {
2328
2296
  case "window":
2329
2297
  n = window.innerWidth / 2 - this.widget().width() / 2, r = window.innerHeight / 2 - this.widget().height() / 2, this.position("fixed");
2330
2298
  break;
2331
- default:
2332
- n = 0, r = 0, this.position(this._originalPosition);
2333
- break;
2299
+ default: n = 0, r = 0, this.position(this._originalPosition);
2334
2300
  }
2335
2301
  this.pos({
2336
2302
  x: n,
@@ -2420,9 +2386,7 @@ var Tabbed = class extends r {
2420
2386
  case "bottom":
2421
2387
  this._tabContainer.attr("class", "on_bottom").style("top", this._contentContainer.node().offsetHeight + this.surfacePadding() + "px").style("position", "absolute"), this._contentContainer.style("top", this.surfacePadding_exists() ? this.surfacePadding() + "px" : null).style("position", "absolute");
2422
2388
  break;
2423
- default:
2424
- this._tabContainer.attr("class", "on_top").style("top", null).style("position", "relative"), this._contentContainer.style("top", this._tabContainer.node().offsetHeight + this.surfacePadding() + "px").style("position", "absolute");
2425
- break;
2389
+ default: this._tabContainer.attr("class", "on_top").style("top", null).style("position", "relative"), this._contentContainer.style("top", this._tabContainer.node().offsetHeight + this.surfacePadding() + "px").style("position", "absolute");
2426
2390
  }
2427
2391
  }
2428
2392
  click(e, t, n) {}