@visactor/react-vtable 1.18.0 → 1.18.1

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.
@@ -64,4 +64,5 @@ function RadioComponent(baseProps, ref) {
64
64
  }, rest));
65
65
  }
66
66
 
67
- exports.Radio = react_1.default.forwardRef(RadioComponent), exports.Radio.displayName = "Radio";
67
+ exports.Radio = react_1.default.forwardRef(RadioComponent), exports.Radio.displayName = "Radio";
68
+ //# sourceMappingURL=radio.js.map
@@ -44,5 +44,4 @@ function TagComponent(baseProps, ref) {
44
44
  }, rest));
45
45
  }
46
46
 
47
- exports.Tag = react_1.default.forwardRef(TagComponent), exports.Tag.displayName = "Tag";
48
- //# sourceMappingURL=tag.js.map
47
+ exports.Tag = react_1.default.forwardRef(TagComponent), exports.Tag.displayName = "Tag";
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './tables';
2
2
  export * from './table-components';
3
3
  export * from './components';
4
- export declare const version = "1.18.0";
4
+ export declare const version = "1.18.1";
package/cjs/index.js CHANGED
@@ -18,5 +18,5 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), exports.version = void 0, __exportStar(require("./tables"), exports), __exportStar(require("./table-components"), exports),
21
- __exportStar(require("./components"), exports), exports.version = "1.18.0";
21
+ __exportStar(require("./components"), exports), exports.version = "1.18.1";
22
22
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC;AACnC,+CAA6B;AAEhB,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './tables';\nexport * from './table-components';\nexport * from './components';\n\nexport const version = \"1.18.0\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC;AACnC,+CAA6B;AAEhB,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './tables';\nexport * from './table-components';\nexport * from './components';\n\nexport const version = \"1.18.1\";\n"]}
@@ -3424,6 +3424,11 @@
3424
3424
  return this.context.tryUpdateLength();
3425
3425
  }
3426
3426
  };
3427
+ class StepClosed extends Step$1 {
3428
+ lineEnd() {
3429
+ this.context.closePath();
3430
+ }
3431
+ }
3427
3432
  function genStepSegments(points, t) {
3428
3433
  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3429
3434
  const {
@@ -3437,6 +3442,16 @@
3437
3442
  function genStepTypeSegments(path, points) {
3438
3443
  return genCurveSegments(path, points);
3439
3444
  }
3445
+ function genStepClosedSegments(points, t) {
3446
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3447
+ const {
3448
+ direction: direction,
3449
+ startPoint: startPoint
3450
+ } = params;
3451
+ if (points.length < 2 - Number(!!startPoint)) return null;
3452
+ const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction.ROW : Direction.COLUMN);
3453
+ return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
3454
+ }
3440
3455
 
3441
3456
  class LinearClosed extends Linear {
3442
3457
  lineEnd() {
@@ -3666,6 +3681,8 @@
3666
3681
  return genMonotoneYSegments(points, params);
3667
3682
  case "step":
3668
3683
  return genStepSegments(points, .5, params);
3684
+ case "stepClosed":
3685
+ return genStepClosedSegments(points, .5, params);
3669
3686
  case "stepBefore":
3670
3687
  return genStepSegments(points, 0, params);
3671
3688
  case "stepAfter":
@@ -4540,7 +4557,7 @@
4540
4557
  function createColor(context, c, params) {
4541
4558
  let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
4542
4559
  let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
4543
- var _a, _b;
4560
+ var _a, _b, _c, _d;
4544
4561
  if (!c || !0 === c) return "black";
4545
4562
  let result, color;
4546
4563
  if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
@@ -4557,7 +4574,7 @@
4557
4574
  scaleY = 1,
4558
4575
  angle = 0
4559
4576
  } = params.attribute;
4560
- w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = 0, y = 0, w = null !== (_a = params.widthWithoutTransform) && void 0 !== _a ? _a : w, h = null !== (_b = params.heightWithoutTransform) && void 0 !== _b ? _b : h);
4577
+ w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = null !== (_a = params.x1WithoutTransform) && void 0 !== _a ? _a : 0, y = null !== (_b = params.y1WithoutTransform) && void 0 !== _b ? _b : 0, w = null !== (_c = params.widthWithoutTransform) && void 0 !== _c ? _c : w, h = null !== (_d = params.heightWithoutTransform) && void 0 !== _d ? _d : h);
4561
4578
  }
4562
4579
  "linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
4563
4580
  }
@@ -4582,7 +4599,7 @@
4582
4599
  const canvasGradient = context.createConicGradient(x + (null !== (_a = color.x) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y) && void 0 !== _b ? _b : 0) * h, color.startAngle, color.endAngle);
4583
4600
  return color.stops.forEach(stop => {
4584
4601
  canvasGradient.addColorStop(stop.offset, stop.color);
4585
- }), canvasGradient.GetPattern(w + x, h + y, undefined);
4602
+ }), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
4586
4603
  }
4587
4604
 
4588
4605
  const DIRECTION_KEY = {
@@ -6615,7 +6632,7 @@
6615
6632
  }
6616
6633
  var rect = new RectSymbol();
6617
6634
 
6618
- const tempBounds$1 = new AABBBounds();
6635
+ const tempBounds = new AABBBounds();
6619
6636
  class CustomSymbolClass {
6620
6637
  constructor(type, path) {
6621
6638
  let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
@@ -6644,7 +6661,7 @@
6644
6661
  let {
6645
6662
  path: path
6646
6663
  } = _ref;
6647
- tempBounds$1.x1 = path.bounds.x1 * size, tempBounds$1.y1 = path.bounds.y1 * size, tempBounds$1.x2 = path.bounds.x2 * size, tempBounds$1.y2 = path.bounds.y2 * size, bounds.union(tempBounds$1);
6664
+ tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
6648
6665
  });
6649
6666
  }
6650
6667
  this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
@@ -6957,8 +6974,8 @@
6957
6974
  const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
6958
6975
 
6959
6976
  const _tempBounds = new AABBBounds(),
6960
- tempMatrix = new Matrix(),
6961
- tempBounds = new AABBBounds();
6977
+ tempMatrix = new Matrix();
6978
+ new AABBBounds();
6962
6979
  const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
6963
6980
  const tempConstantXYKey = ["x", "y"],
6964
6981
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
@@ -7477,25 +7494,12 @@
7477
7494
  needUpdateLayout() {
7478
7495
  return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
7479
7496
  }
7480
- getAnchor(anchor, params) {
7497
+ getAnchor(anchor, params, resetScale) {
7481
7498
  const _anchor = [0, 0],
7482
7499
  getBounds = () => {
7483
7500
  if (params.b) return params.b;
7484
- const {
7485
- scaleX: scaleX,
7486
- scaleY: scaleY,
7487
- angle: angle,
7488
- scaleCenter: scaleCenter
7489
- } = this.attribute;
7490
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
7491
- angle: 0,
7492
- scaleCenter: null
7493
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
7494
- scaleX: scaleX,
7495
- scaleY: scaleY,
7496
- angle: angle,
7497
- scaleCenter: scaleCenter
7498
- }), params.b;
7501
+ const graphic = this.clone();
7502
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
7499
7503
  };
7500
7504
  if ("string" == typeof anchor[0]) {
7501
7505
  const ratio = parseFloat(anchor[0]) / 100,
@@ -7524,7 +7528,7 @@
7524
7528
  const params = {};
7525
7529
  if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
7526
7530
  const m = this._transMatrix;
7527
- m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
7531
+ m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
7528
7532
  x: _anchor[0],
7529
7533
  y: _anchor[1]
7530
7534
  });
@@ -9040,7 +9044,7 @@
9040
9044
  tb1: tb1,
9041
9045
  tb2: tb2
9042
9046
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
9043
- updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
9047
+ updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, this.x1WithoutTransform = aabbBounds.x1, this.y1WithoutTransform = aabbBounds.y1;
9044
9048
  const {
9045
9049
  lineJoin = symbolTheme.lineJoin
9046
9050
  } = attribute;
@@ -20484,7 +20488,7 @@
20484
20488
  const Checkbox = React.forwardRef(CheckboxComponent);
20485
20489
  Checkbox.displayName = 'Checkbox';
20486
20490
 
20487
- const version = "1.18.0";
20491
+ const version = "1.18.1";
20488
20492
 
20489
20493
  Object.defineProperty(exports, 'register', {
20490
20494
  enumerable: true,