@wcardinal/wcardinal-ui 0.294.0 → 0.296.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.
Files changed (26) hide show
  1. package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +6 -1
  2. package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +2 -0
  3. package/dist/types/wcardinal/ui/d-table-data-tree-item-accessor.d.ts +9 -4
  4. package/dist/types/wcardinal/ui/d-table-data-tree-selection-impl.d.ts +2 -1
  5. package/dist/types/wcardinal/ui/d-table-data-tree.d.ts +2 -2
  6. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +22 -15
  7. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  8. package/dist/wcardinal/ui/d-chart-coordinate-base.js +12 -3
  9. package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -1
  10. package/dist/wcardinal/ui/d-table-data-tree-filter.js +12 -8
  11. package/dist/wcardinal/ui/d-table-data-tree-filter.js.map +1 -1
  12. package/dist/wcardinal/ui/d-table-data-tree-item-accessor.js +13 -3
  13. package/dist/wcardinal/ui/d-table-data-tree-item-accessor.js.map +1 -1
  14. package/dist/wcardinal/ui/d-table-data-tree-selection-impl.js +7 -5
  15. package/dist/wcardinal/ui/d-table-data-tree-selection-impl.js.map +1 -1
  16. package/dist/wcardinal/ui/d-table-data-tree.js +5 -4
  17. package/dist/wcardinal/ui/d-table-data-tree.js.map +1 -1
  18. package/dist/wcardinal-ui-theme-dark.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-white.js +1 -1
  21. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  22. package/dist/wcardinal-ui.cjs.js +106 -74
  23. package/dist/wcardinal-ui.js +106 -74
  24. package/dist/wcardinal-ui.min.js +2 -2
  25. package/dist/wcardinal-ui.min.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.294.0
2
+ Winter Cardinal UI v0.296.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -73263,6 +73263,41 @@ var DChartAxisBaseTickMinor = /** @class */ (function () {
73263
73263
  return DChartAxisBaseTickMinor;
73264
73264
  }());
73265
73265
 
73266
+ /*
73267
+ * Copyright (C) 2019 Toshiba Corporation
73268
+ * SPDX-License-Identifier: Apache-2.0
73269
+ */
73270
+ var DChartRegionImpl = /** @class */ (function () {
73271
+ function DChartRegionImpl(from, to) {
73272
+ this.from = from;
73273
+ this.to = to;
73274
+ }
73275
+ DChartRegionImpl.prototype.set = function (from, to) {
73276
+ if (from != null) {
73277
+ this.from = from;
73278
+ }
73279
+ if (to != null) {
73280
+ this.to = to;
73281
+ }
73282
+ return this;
73283
+ };
73284
+ DChartRegionImpl.prototype.add = function (from, to) {
73285
+ if (!isNaN$1(from)) {
73286
+ this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
73287
+ }
73288
+ if (!isNaN$1(to)) {
73289
+ this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
73290
+ }
73291
+ return this;
73292
+ };
73293
+ DChartRegionImpl.prototype.clear = function () {
73294
+ this.from = NaN;
73295
+ this.to = NaN;
73296
+ return this;
73297
+ };
73298
+ return DChartRegionImpl;
73299
+ }());
73300
+
73266
73301
  var DChartAxisBaseTickContainer = /** @class */ (function () {
73267
73302
  function DChartAxisBaseTickContainer(parser, options) {
73268
73303
  this._parser = parser;
@@ -73271,6 +73306,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73271
73306
  this._minor = this.newMinor(parser, options);
73272
73307
  this._majorTicks = [];
73273
73308
  this._minorTicks = [];
73309
+ this._work = new DChartRegionImpl(0, 0);
73274
73310
  }
73275
73311
  Object.defineProperty(DChartAxisBaseTickContainer.prototype, "major", {
73276
73312
  get: function () {
@@ -73310,7 +73346,6 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73310
73346
  var minorShapes = this._minor.shapes;
73311
73347
  if (container != null && majorShapes && minorShapes) {
73312
73348
  var plotArea = container.plotArea;
73313
- var bounds = plotArea.getBoundsInContainer();
73314
73349
  var transform = plotArea.container.transform.localTransform;
73315
73350
  var gridlineShapes = this._major.gridline.shapes;
73316
73351
  var parser = this._parser;
@@ -73320,43 +73355,49 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73320
73355
  case DChartAxisPosition.TOP:
73321
73356
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
73322
73357
  if (coordinate) {
73323
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
73324
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
73358
+ var domain = this.getDomain(plotArea, coordinate, this._work);
73325
73359
  var plotAreaHeight = plotArea.height;
73326
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
73360
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaHeight);
73327
73361
  }
73328
73362
  break;
73329
73363
  case DChartAxisPosition.BOTTOM:
73330
73364
  coordinate = plotArea.coordinate.x.get(parser.coordinate);
73331
73365
  if (coordinate) {
73332
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.x));
73333
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.x + bounds.width));
73366
+ var domain = this.getDomain(plotArea, coordinate, this._work);
73334
73367
  var plotAreaHeight = plotArea.height;
73335
- return this.updateX(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
73368
+ return this.updateX(domain.from, domain.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaHeight + offset, transform, plotAreaHeight);
73336
73369
  }
73337
73370
  break;
73338
73371
  case DChartAxisPosition.LEFT:
73339
73372
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
73340
73373
  if (coordinate) {
73341
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
73342
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
73374
+ var range = this.getRange(plotArea, coordinate, this._work);
73343
73375
  var plotAreaWidth = plotArea.width;
73344
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
73376
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, 0 - offset, transform, plotAreaWidth);
73345
73377
  }
73346
73378
  break;
73347
73379
  case DChartAxisPosition.RIGHT:
73348
73380
  coordinate = plotArea.coordinate.y.get(parser.coordinate);
73349
73381
  if (coordinate) {
73350
- var domainFrom = coordinate.unmap(coordinate.transform.unmap(bounds.y));
73351
- var domainTo = coordinate.unmap(coordinate.transform.unmap(bounds.y + bounds.height));
73382
+ var range = this.getRange(plotArea, coordinate, this._work);
73352
73383
  var plotAreaWidth = plotArea.width;
73353
- return this.updateY(domainFrom, domainTo, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
73384
+ return this.updateY(range.from, range.to, coordinate, majorShapes, minorShapes, gridlineShapes, plotAreaWidth + offset, transform, plotAreaWidth);
73354
73385
  }
73355
73386
  break;
73356
73387
  }
73357
73388
  }
73358
73389
  return false;
73359
73390
  };
73391
+ DChartAxisBaseTickContainer.prototype.getDomain = function (plotArea, coordinate, result) {
73392
+ var bounds = plotArea.getBoundsInContainer();
73393
+ var transform = coordinate.transform;
73394
+ return result.set(coordinate.unmap(transform.unmap(bounds.x)), coordinate.unmap(transform.unmap(bounds.x + bounds.width)));
73395
+ };
73396
+ DChartAxisBaseTickContainer.prototype.getRange = function (plotArea, coordinate, result) {
73397
+ var bounds = plotArea.getBoundsInContainer();
73398
+ var transform = coordinate.transform;
73399
+ return result.set(coordinate.unmap(transform.unmap(bounds.y)), coordinate.unmap(transform.unmap(bounds.y + bounds.height)));
73400
+ };
73360
73401
  DChartAxisBaseTickContainer.prototype.updateX = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionY, transform, plotAreaHeight) {
73361
73402
  var tick = this._parser.tick;
73362
73403
  var majorTick = tick.major;
@@ -73410,7 +73451,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73410
73451
  }
73411
73452
  return true;
73412
73453
  };
73413
- DChartAxisBaseTickContainer.prototype.updateY = function (domainMin, domainMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
73454
+ DChartAxisBaseTickContainer.prototype.updateY = function (rangeMin, rangeMax, coordinate, majorShapes, minorShapes, gridlineShapes, shapePositionX, transform, plotAreaWidth) {
73414
73455
  var tick = this._parser.tick;
73415
73456
  var majorTick = tick.major;
73416
73457
  var majorCount = majorTick.count;
@@ -73424,7 +73465,7 @@ var DChartAxisBaseTickContainer = /** @class */ (function () {
73424
73465
  var minorFormatter = minorTick.formatter;
73425
73466
  var majorTicks = this._majorTicks;
73426
73467
  var minorTicks = this._minorTicks;
73427
- this.newTicks(coordinate, domainMin, domainMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73468
+ this.newTicks(coordinate, rangeMin, rangeMax, majorCount, majorCapacity, majorStep, minorCountPerMajor, minorCount, minorStep, majorTicks, minorTicks);
73428
73469
  var d = transform.d;
73429
73470
  var ty = transform.ty;
73430
73471
  for (var i = 0; i < majorCapacity; ++i) {
@@ -73925,41 +73966,6 @@ var DChartCoordinateTransformMarkImpl = /** @class */ (function () {
73925
73966
  return DChartCoordinateTransformMarkImpl;
73926
73967
  }());
73927
73968
 
73928
- /*
73929
- * Copyright (C) 2019 Toshiba Corporation
73930
- * SPDX-License-Identifier: Apache-2.0
73931
- */
73932
- var DChartRegionImpl = /** @class */ (function () {
73933
- function DChartRegionImpl(from, to) {
73934
- this.from = from;
73935
- this.to = to;
73936
- }
73937
- DChartRegionImpl.prototype.set = function (from, to) {
73938
- if (from != null) {
73939
- this.from = from;
73940
- }
73941
- if (to != null) {
73942
- this.to = to;
73943
- }
73944
- return this;
73945
- };
73946
- DChartRegionImpl.prototype.add = function (from, to) {
73947
- if (!isNaN$1(from)) {
73948
- this.from = isNaN$1(this.from) ? from : Math.min(this.from, from);
73949
- }
73950
- if (!isNaN$1(to)) {
73951
- this.to = isNaN$1(this.to) ? to : Math.max(this.to, to);
73952
- }
73953
- return this;
73954
- };
73955
- DChartRegionImpl.prototype.clear = function () {
73956
- this.from = NaN;
73957
- this.to = NaN;
73958
- return this;
73959
- };
73960
- return DChartRegionImpl;
73961
- }());
73962
-
73963
73969
  /*
73964
73970
  * Copyright (C) 2019 Toshiba Corporation
73965
73971
  * SPDX-License-Identifier: Apache-2.0
@@ -74031,18 +74037,27 @@ var DChartCoordinateBase = /** @class */ (function () {
74031
74037
  var container = this._container;
74032
74038
  if (container) {
74033
74039
  var plotArea = container.container.plotArea;
74034
- var padding = plotArea.padding;
74035
74040
  var work = this._work;
74036
74041
  switch (this._direction) {
74037
74042
  case DChartCoordinateDirection.X:
74038
- this.doFit_(padding.getLeft(), plotArea.width - padding.getRight(), this.toFitDomain(from, to, plotArea, work), result);
74043
+ this.getPixelDomain(plotArea, work);
74044
+ this.doFit_(work.from, work.to, this.toFitDomain(from, to, plotArea, work), result);
74039
74045
  break;
74040
74046
  case DChartCoordinateDirection.Y:
74041
- this.doFit_(plotArea.height - padding.getBottom(), padding.getTop(), this.toFitRange(from, to, plotArea, work), result);
74047
+ this.getPixelRange(plotArea, work);
74048
+ this.doFit_(work.from, work.to, this.toFitRange(from, to, plotArea, work), result);
74042
74049
  break;
74043
74050
  }
74044
74051
  }
74045
74052
  };
74053
+ DChartCoordinateBase.prototype.getPixelDomain = function (plotArea, result) {
74054
+ var padding = plotArea.padding;
74055
+ return result.set(padding.getLeft(), plotArea.width - padding.getRight());
74056
+ };
74057
+ DChartCoordinateBase.prototype.getPixelRange = function (plotArea, result) {
74058
+ var padding = plotArea.padding;
74059
+ return result.set(plotArea.height - padding.getBottom(), padding.getTop());
74060
+ };
74046
74061
  DChartCoordinateBase.prototype.toFitDomain = function (from, to, plotArea, result) {
74047
74062
  if (from == null) {
74048
74063
  from = this._from;
@@ -87882,43 +87897,47 @@ var DTableDataTreeFilter = /** @class */ (function (_super) {
87882
87897
  }
87883
87898
  };
87884
87899
  DTableDataTreeFilter.prototype.hasFiltered = function (parent, nodes, filter) {
87885
- var toChildren = this._parent.accessor.toChildren;
87900
+ var accessor = this._parent.accessor;
87901
+ var toChildren = accessor.toChildren;
87902
+ var hasChildren = accessor.hasChildren;
87886
87903
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
87887
87904
  var node = nodes[i];
87888
87905
  if (this.isFiltered(node, -1, filter)) {
87889
87906
  return true;
87890
87907
  }
87891
87908
  var children = toChildren(node);
87892
- if (children != null &&
87893
- 0 < children.length &&
87894
- this.hasFiltered(parent, children, filter)) {
87909
+ if (hasChildren(node, children) && this.hasFiltered(parent, children, filter)) {
87895
87910
  return true;
87896
87911
  }
87897
87912
  }
87898
87913
  return false;
87899
87914
  };
87900
87915
  DTableDataTreeFilter.prototype.addAllToFiltered = function (parent, nodes, filtered, cursor) {
87901
- var toChildren = this._parent.accessor.toChildren;
87916
+ var accessor = this._parent.accessor;
87917
+ var toChildren = accessor.toChildren;
87918
+ var hasChildren = accessor.hasChildren;
87902
87919
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
87903
87920
  var node = nodes[i];
87904
87921
  filtered.push(cursor[0]);
87905
87922
  cursor[0] += 1;
87906
87923
  var children = toChildren(node);
87907
- if (children != null && 0 < children.length && parent.isOpened(node)) {
87924
+ if (hasChildren(node, children) && parent.isOpened(node)) {
87908
87925
  this.addAllToFiltered(parent, children, filtered, cursor);
87909
87926
  }
87910
87927
  }
87911
87928
  };
87912
87929
  DTableDataTreeFilter.prototype.newFilteredSub = function (parent, nodes, filter, filtered, cursor) {
87913
87930
  var result = false;
87914
- var toChildren = this._parent.accessor.toChildren;
87931
+ var accessor = this._parent.accessor;
87932
+ var toChildren = accessor.toChildren;
87933
+ var hasChildren = accessor.hasChildren;
87915
87934
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
87916
87935
  var node = nodes[i];
87917
87936
  var index = cursor[0];
87918
87937
  cursor[0] += 1;
87919
87938
  var isFiltered = this.isFiltered(node, index, filter);
87920
87939
  var children = toChildren(node);
87921
- if (children != null && 0 < children.length) {
87940
+ if (hasChildren(node, children)) {
87922
87941
  if (parent.isOpened(node)) {
87923
87942
  if (isFiltered) {
87924
87943
  filtered.push(index);
@@ -88026,11 +88045,21 @@ var toParent = function (node) {
88026
88045
  var toChildren$1 = function (node) {
88027
88046
  return node.children;
88028
88047
  };
88048
+ var hasChildren = function (node, children) {
88049
+ return children != null && 0 < children.length;
88050
+ };
88029
88051
  var DTableDataTreeItemAccessor = /** @class */ (function () {
88030
88052
  function DTableDataTreeItemAccessor(options) {
88031
- var _a, _b;
88032
- this.toParent = (_a = options === null || options === void 0 ? void 0 : options.toParent) !== null && _a !== void 0 ? _a : toParent;
88033
- this.toChildren = (_b = options === null || options === void 0 ? void 0 : options.toChildren) !== null && _b !== void 0 ? _b : toChildren$1;
88053
+ if (options != null) {
88054
+ this.toParent = options.toParent || toParent;
88055
+ this.toChildren = options.toChildren || toChildren$1;
88056
+ this.hasChildren = options.hasChildren || hasChildren;
88057
+ }
88058
+ else {
88059
+ this.toParent = toParent;
88060
+ this.toChildren = toChildren$1;
88061
+ this.hasChildren = hasChildren;
88062
+ }
88034
88063
  }
88035
88064
  return DTableDataTreeItemAccessor;
88036
88065
  }());
@@ -88072,9 +88101,11 @@ var DTableDataTreeSelectionImpl = /** @class */ (function (_super) {
88072
88101
  });
88073
88102
  DTableDataTreeSelectionImpl.prototype.onNodeChange = function (nodes) {
88074
88103
  if (nodes != null) {
88075
- var toChildren = this._parent.accessor.toChildren;
88104
+ var accessor = this._parent.accessor;
88105
+ var toChildren = accessor.toChildren;
88106
+ var hasChildren = accessor.hasChildren;
88076
88107
  var oldRows = this._rows;
88077
- var newRows = this.newRows(nodes, toChildren, oldRows, new Set());
88108
+ var newRows = this.newRows(nodes, toChildren, hasChildren, oldRows, new Set());
88078
88109
  if (oldRows.size !== newRows.size) {
88079
88110
  this._rows = newRows;
88080
88111
  this.onChange();
@@ -88088,15 +88119,15 @@ var DTableDataTreeSelectionImpl = /** @class */ (function (_super) {
88088
88119
  }
88089
88120
  }
88090
88121
  };
88091
- DTableDataTreeSelectionImpl.prototype.newRows = function (nodes, toChildren, rows, result) {
88122
+ DTableDataTreeSelectionImpl.prototype.newRows = function (nodes, toChildren, hasChildren, rows, result) {
88092
88123
  for (var i = 0, imax = nodes.length; i < imax; ++i) {
88093
88124
  var node = nodes[i];
88094
88125
  if (rows.has(node)) {
88095
88126
  result.add(node);
88096
88127
  }
88097
88128
  var children = toChildren(node);
88098
- if (children != null) {
88099
- this.newRows(children, toChildren, rows, result);
88129
+ if (hasChildren(node, children)) {
88130
+ this.newRows(children, toChildren, hasChildren, rows, result);
88100
88131
  }
88101
88132
  }
88102
88133
  return result;
@@ -88535,7 +88566,8 @@ var DTableDataTree = /** @class */ (function (_super) {
88535
88566
  var supplimentals = this._supplimentals;
88536
88567
  var flags = this._flags;
88537
88568
  if (nodes != null) {
88538
- var irows = this.newRows(nodes, 0, 0, rows, supplimentals, flags, this._reverse, this._accessor.toChildren);
88569
+ var accessor = this._accessor;
88570
+ var irows = this.newRows(nodes, 0, 0, rows, supplimentals, flags, this._reverse, accessor.toChildren, accessor.hasChildren);
88539
88571
  if (irows !== rows.length) {
88540
88572
  rows.length = irows;
88541
88573
  supplimentals.length = irows;
@@ -88549,7 +88581,7 @@ var DTableDataTree = /** @class */ (function (_super) {
88549
88581
  DTableDataTree.prototype.toSupplimental = function (ilevel, hasChildren, isOpened) {
88550
88582
  return (ilevel << 2) | (hasChildren ? 2 : 0) | (isOpened ? 1 : 0);
88551
88583
  };
88552
- DTableDataTree.prototype.newRows = function (nodes, irows, ilevel, rows, supplimentals, flags, reverse, toChildren) {
88584
+ DTableDataTree.prototype.newRows = function (nodes, irows, ilevel, rows, supplimentals, flags, reverse, toChildren, hasChildren) {
88553
88585
  var nodesLength = nodes.length;
88554
88586
  var istart = reverse ? nodesLength - 1 : 0;
88555
88587
  var idelta = reverse ? -1 : +1;
@@ -88557,7 +88589,7 @@ var DTableDataTree = /** @class */ (function (_super) {
88557
88589
  var node = nodes[i];
88558
88590
  var children = toChildren(node);
88559
88591
  var isOpened = flags.has(node);
88560
- var supplimental = this.toSupplimental(ilevel, !!(children && 0 < children.length), isOpened);
88592
+ var supplimental = this.toSupplimental(ilevel, hasChildren(node, children), isOpened);
88561
88593
  if (irows < rows.length) {
88562
88594
  rows[irows] = node;
88563
88595
  supplimentals[irows] = supplimental;
@@ -88568,7 +88600,7 @@ var DTableDataTree = /** @class */ (function (_super) {
88568
88600
  }
88569
88601
  irows += 1;
88570
88602
  if (isOpened && children) {
88571
- irows = this.newRows(children, irows, ilevel + 1, rows, supplimentals, flags, reverse, toChildren);
88603
+ irows = this.newRows(children, irows, ilevel + 1, rows, supplimentals, flags, reverse, toChildren, hasChildren);
88572
88604
  }
88573
88605
  }
88574
88606
  return irows;