@hpcc-js/layout 3.6.6 → 3.6.8
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 +56 -90
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
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.
|
|
17
|
+
}) : n, e)), N = "@hpcc-js/layout", te = "3.6.8", ne = "3.32.0", 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()
|
|
294
|
-
|
|
295
|
-
let
|
|
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
|
-
}),
|
|
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
|
-
|
|
331
|
-
let
|
|
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: -
|
|
335
|
+
px: -f.height - p.height,
|
|
338
336
|
"%": 100
|
|
339
337
|
},
|
|
340
338
|
top: {
|
|
341
|
-
px:
|
|
339
|
+
px: f.height,
|
|
342
340
|
"%": 0
|
|
343
341
|
},
|
|
344
342
|
left: {
|
|
345
343
|
px: 0,
|
|
346
344
|
"%": 0
|
|
347
345
|
}
|
|
348
|
-
}),
|
|
346
|
+
}), h = _sectionPlacementObject({
|
|
349
347
|
width: {
|
|
350
348
|
px: l,
|
|
351
349
|
"%": u
|
|
352
350
|
},
|
|
353
351
|
height: {
|
|
354
|
-
px: -
|
|
352
|
+
px: -f.height - p.height,
|
|
355
353
|
"%": 100
|
|
356
354
|
},
|
|
357
355
|
top: {
|
|
358
|
-
px:
|
|
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
|
-
|
|
367
|
-
let
|
|
364
|
+
h.left -= h.width;
|
|
365
|
+
let g = _sectionPlacementObject({
|
|
368
366
|
width: {
|
|
369
|
-
px: -
|
|
367
|
+
px: -h.width - m.width,
|
|
370
368
|
"%": 100
|
|
371
369
|
},
|
|
372
370
|
height: {
|
|
373
|
-
px: -
|
|
371
|
+
px: -f.height - p.height,
|
|
374
372
|
"%": 100
|
|
375
373
|
},
|
|
376
374
|
top: {
|
|
377
|
-
px:
|
|
375
|
+
px: f.height,
|
|
378
376
|
"%": 0
|
|
379
377
|
},
|
|
380
378
|
left: {
|
|
381
|
-
px:
|
|
379
|
+
px: m.width,
|
|
382
380
|
"%": 0
|
|
383
381
|
}
|
|
384
382
|
});
|
|
385
|
-
return t.top =
|
|
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
|
}
|
|
@@ -815,10 +809,12 @@ Path.prototype = path.prototype = {
|
|
|
815
809
|
var a = this._x1, o = this._y1, s = n - e, c = r - t, l = a - e, u = o - t, d = l * l + u * u;
|
|
816
810
|
if (i < 0) throw Error("negative radius: " + i);
|
|
817
811
|
if (this._x1 === null) this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);
|
|
818
|
-
else if (d > I)
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
812
|
+
else if (d > I) {
|
|
813
|
+
if (!(Math.abs(u * s - c * l) > I) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);
|
|
814
|
+
else {
|
|
815
|
+
var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((P - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;
|
|
816
|
+
Math.abs(y - 1) > I && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);
|
|
817
|
+
}
|
|
822
818
|
}
|
|
823
819
|
},
|
|
824
820
|
arc: function(e, t, n, r, i, a) {
|
|
@@ -913,7 +909,8 @@ var pe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fun
|
|
|
913
909
|
if (t.length === 0) return e;
|
|
914
910
|
for (var a = t.length; a < e.length; a++) t.push(e[a]);
|
|
915
911
|
return t;
|
|
916
|
-
}
|
|
912
|
+
}
|
|
913
|
+
if (typeof t == "function") {
|
|
917
914
|
for (var o = [], s = e.length, c = 0; c < s; c++) o.push(t({
|
|
918
915
|
i: c,
|
|
919
916
|
genLength: s,
|
|
@@ -1175,9 +1172,7 @@ var Legend = class extends c {
|
|
|
1175
1172
|
case "chart":
|
|
1176
1173
|
case "columns":
|
|
1177
1174
|
case "data":
|
|
1178
|
-
case "paletteID":
|
|
1179
|
-
e.lazyRender();
|
|
1180
|
-
break;
|
|
1175
|
+
case "paletteID": e.lazyRender();
|
|
1181
1176
|
}
|
|
1182
1177
|
});
|
|
1183
1178
|
}
|
|
@@ -1249,11 +1244,9 @@ var Legend = class extends c {
|
|
|
1249
1244
|
];
|
|
1250
1245
|
}, this);
|
|
1251
1246
|
break;
|
|
1252
|
-
default:
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
}, this);
|
|
1256
|
-
break;
|
|
1247
|
+
default: e = this.columns().map(function(e) {
|
|
1248
|
+
return [a(void 0, e, !1), e];
|
|
1249
|
+
}, this);
|
|
1257
1250
|
}
|
|
1258
1251
|
break;
|
|
1259
1252
|
case "rainbow":
|
|
@@ -1264,7 +1257,6 @@ var Legend = class extends c {
|
|
|
1264
1257
|
Math.floor(n) > parseInt(e[0][1]) && (n = Math.floor(n)), e.push([s(n, d, f), c(n)]);
|
|
1265
1258
|
}
|
|
1266
1259
|
e.push([s(f, d, f), c(f)]);
|
|
1267
|
-
break;
|
|
1268
1260
|
}
|
|
1269
1261
|
}
|
|
1270
1262
|
return {
|
|
@@ -1319,40 +1311,27 @@ var Legend = class extends c {
|
|
|
1319
1311
|
}
|
|
1320
1312
|
}
|
|
1321
1313
|
onClick(e, t) {
|
|
1322
|
-
|
|
1323
|
-
case "
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
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;
|
|
1314
|
+
if (this.getPaletteType() === "ordinal") switch (this.dataFamily()) {
|
|
1315
|
+
case "2D":
|
|
1316
|
+
case "ND":
|
|
1317
|
+
let t = this._disabled.indexOf(e);
|
|
1318
|
+
t < 0 ? this._disabled.push(e) : this._disabled.splice(t, 1), this._owner.refreshColumns(), this._owner.refreshData(), this._owner.render();
|
|
1332
1319
|
}
|
|
1333
1320
|
}
|
|
1334
1321
|
onOver(e, t) {
|
|
1335
1322
|
if (E(this._owner)) switch (this.getPaletteType()) {
|
|
1336
|
-
case "ordinal":
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
this._disabled.indexOf(e) < 0 && this._owner.highlightColumn(e);
|
|
1341
|
-
break;
|
|
1342
|
-
}
|
|
1343
|
-
break;
|
|
1323
|
+
case "ordinal": switch (this.dataFamily()) {
|
|
1324
|
+
case "2D":
|
|
1325
|
+
case "ND": this._disabled.indexOf(e) < 0 && this._owner.highlightColumn(e);
|
|
1326
|
+
}
|
|
1344
1327
|
}
|
|
1345
1328
|
}
|
|
1346
1329
|
onOut(e, t) {
|
|
1347
1330
|
if (E(this._owner)) switch (this.getPaletteType()) {
|
|
1348
|
-
case "ordinal":
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
this._owner.highlightColumn();
|
|
1353
|
-
break;
|
|
1354
|
-
}
|
|
1355
|
-
break;
|
|
1331
|
+
case "ordinal": switch (this.dataFamily()) {
|
|
1332
|
+
case "2D":
|
|
1333
|
+
case "ND": this._owner.highlightColumn();
|
|
1334
|
+
}
|
|
1356
1335
|
}
|
|
1357
1336
|
}
|
|
1358
1337
|
onDblClick(e, t) {}
|
|
@@ -1616,17 +1595,10 @@ var ChartPanel = class extends Border2 {
|
|
|
1616
1595
|
case "small":
|
|
1617
1596
|
this.preUpdateSmall(t);
|
|
1618
1597
|
break;
|
|
1619
|
-
case "regular":
|
|
1620
|
-
this.preUpdateRegular(t);
|
|
1621
|
-
break;
|
|
1598
|
+
case "regular": this.preUpdateRegular(t);
|
|
1622
1599
|
}
|
|
1623
1600
|
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()
|
|
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) {
|
|
1601
|
+
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
1602
|
this._prevChart = n;
|
|
1631
1603
|
let e = n ? n._titleBar || n._iconBar : void 0;
|
|
1632
1604
|
if (e && e instanceof i) {
|
|
@@ -1650,9 +1622,7 @@ var ChartPanel = class extends Border2 {
|
|
|
1650
1622
|
case "small":
|
|
1651
1623
|
this.postUpdateSmall(t);
|
|
1652
1624
|
break;
|
|
1653
|
-
case "regular":
|
|
1654
|
-
this.postUpdateRegular(t);
|
|
1655
|
-
break;
|
|
1625
|
+
case "regular": this.postUpdateRegular(t);
|
|
1656
1626
|
}
|
|
1657
1627
|
}
|
|
1658
1628
|
postUpdateTiny(e) {
|
|
@@ -2008,19 +1978,19 @@ var $ = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((e, t) => {
|
|
|
2008
1978
|
getCell(e, t) {
|
|
2009
1979
|
let n = null;
|
|
2010
1980
|
return this.content().some(function(r) {
|
|
2011
|
-
return e >= r.gridRow() && e < r.gridRow() + r.gridRowSpan() && t >= r.gridCol() && t < r.gridCol() + r.gridColSpan()
|
|
1981
|
+
return e >= r.gridRow() && e < r.gridRow() + r.gridRowSpan() && t >= r.gridCol() && t < r.gridCol() + r.gridColSpan() && (n = r, !0);
|
|
2012
1982
|
}), n;
|
|
2013
1983
|
}
|
|
2014
1984
|
getWidgetCell(e) {
|
|
2015
1985
|
let t = null;
|
|
2016
1986
|
return this.content().some(function(n) {
|
|
2017
|
-
return n.widget().id() === e
|
|
1987
|
+
return n.widget().id() === e && (t = n, !0);
|
|
2018
1988
|
}), t;
|
|
2019
1989
|
}
|
|
2020
1990
|
getContent(e) {
|
|
2021
1991
|
let t = null;
|
|
2022
1992
|
return this.content().some(function(n) {
|
|
2023
|
-
return n.widget().id() === e
|
|
1993
|
+
return n.widget().id() === e && (t = n.widget(), !0);
|
|
2024
1994
|
}), t;
|
|
2025
1995
|
}
|
|
2026
1996
|
cellToGridItem(e) {
|
|
@@ -2328,9 +2298,7 @@ var Popup = class extends r {
|
|
|
2328
2298
|
case "window":
|
|
2329
2299
|
n = window.innerWidth / 2 - this.widget().width() / 2, r = window.innerHeight / 2 - this.widget().height() / 2, this.position("fixed");
|
|
2330
2300
|
break;
|
|
2331
|
-
default:
|
|
2332
|
-
n = 0, r = 0, this.position(this._originalPosition);
|
|
2333
|
-
break;
|
|
2301
|
+
default: n = 0, r = 0, this.position(this._originalPosition);
|
|
2334
2302
|
}
|
|
2335
2303
|
this.pos({
|
|
2336
2304
|
x: n,
|
|
@@ -2420,9 +2388,7 @@ var Tabbed = class extends r {
|
|
|
2420
2388
|
case "bottom":
|
|
2421
2389
|
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
2390
|
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;
|
|
2391
|
+
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
2392
|
}
|
|
2427
2393
|
}
|
|
2428
2394
|
click(e, t, n) {}
|