@visactor/react-vtable 1.19.10-alpha.0 → 1.19.10-alpha.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.
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.19.10-alpha.0";
4
+ export declare const version = "1.19.10-alpha.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.19.10-alpha.0";
21
+ __exportStar(require("./components"), exports), exports.version = "1.19.10-alpha.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,iBAAiB,CAAC","file":"index.js","sourcesContent":["export * from './tables';\nexport * from './table-components';\nexport * from './components';\n\nexport const version = \"1.19.10-alpha.0\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC;AACnC,+CAA6B;AAEhB,QAAA,OAAO,GAAG,iBAAiB,CAAC","file":"index.js","sourcesContent":["export * from './tables';\nexport * from './table-components';\nexport * from './components';\n\nexport const version = \"1.19.10-alpha.1\";\n"]}
@@ -1381,15 +1381,7 @@
1381
1381
  const EnvContribution = Symbol.for("EnvContribution");
1382
1382
  const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
1383
1383
 
1384
- const container = new Container();
1385
-
1386
- const RenderService = Symbol.for("RenderService");
1387
-
1388
- class Application {
1389
- get renderService() {
1390
- return this._renderService || (this._renderService = container.get(RenderService)), this._renderService;
1391
- }
1392
- }
1384
+ class Application {}
1393
1385
  const application = new Application();
1394
1386
 
1395
1387
  var MeasureModeEnum;
@@ -3757,8 +3749,7 @@
3757
3749
  y1: 0,
3758
3750
  strokeBoundsBuffer: 0,
3759
3751
  cornerRadius: 0,
3760
- cornerType: "round",
3761
- drawStrokeWhenZeroWH: !1
3752
+ cornerType: "round"
3762
3753
  });
3763
3754
  Object.assign(Object.assign({}, DefaultAttribute), {
3764
3755
  width: 0,
@@ -3767,8 +3758,7 @@
3767
3758
  y1: 0,
3768
3759
  cornerRadius: 0,
3769
3760
  length: 0,
3770
- cornerType: "round",
3771
- drawStrokeWhenZeroWH: !1
3761
+ cornerType: "round"
3772
3762
  });
3773
3763
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
3774
3764
  symbolType: "circle",
@@ -3995,34 +3985,6 @@
3995
3985
  }
3996
3986
  return c;
3997
3987
  }
3998
- static processColorStops(colorStops) {
3999
- if (!colorStops || 0 === colorStops.length) return [];
4000
- if (colorStops.some(item => item.length)) {
4001
- const stops = colorStops.map(item => ({
4002
- color: item.value,
4003
- offset: item.length ? parseFloat(item.length.value) / 100 : -1
4004
- }));
4005
- stops[0].offset < 0 && (stops[0].offset = 0), stops[stops.length - 1].offset < 0 && (stops[stops.length - 1].offset = 1);
4006
- for (let i = 1; i < stops.length - 1; i++) if (stops[i].offset < 0) {
4007
- const prevWithOffsetIdx = i - 1;
4008
- let nextWithOffsetIdx = i + 1;
4009
- for (; nextWithOffsetIdx < stops.length && stops[nextWithOffsetIdx].offset < 0;) nextWithOffsetIdx++;
4010
- const startOffset = stops[prevWithOffsetIdx].offset,
4011
- endOffset = stops[nextWithOffsetIdx].offset,
4012
- unspecCount = nextWithOffsetIdx - prevWithOffsetIdx;
4013
- for (let j = 1; j < unspecCount; j++) stops[prevWithOffsetIdx + j].offset = startOffset + (endOffset - startOffset) * j / unspecCount;
4014
- i = nextWithOffsetIdx - 1;
4015
- }
4016
- return stops;
4017
- }
4018
- return colorStops.map((item, index) => {
4019
- const offset = colorStops.length > 1 ? index / (colorStops.length - 1) : 0;
4020
- return {
4021
- color: item.value,
4022
- offset: offset
4023
- };
4024
- });
4025
- }
4026
3988
  static ParseConic(datum) {
4027
3989
  const {
4028
3990
  orientation: orientation,
@@ -4036,7 +3998,10 @@
4036
3998
  y: .5,
4037
3999
  startAngle: sa,
4038
4000
  endAngle: sa + pi2,
4039
- stops: GradientParser.processColorStops(colorStops)
4001
+ stops: colorStops.map(item => ({
4002
+ color: item.value,
4003
+ offset: parseFloat(item.length.value) / 100
4004
+ }))
4040
4005
  };
4041
4006
  }
4042
4007
  static ParseRadial(datum) {
@@ -4051,7 +4016,10 @@
4051
4016
  y1: .5,
4052
4017
  r0: 0,
4053
4018
  r1: 1,
4054
- stops: GradientParser.processColorStops(colorStops)
4019
+ stops: colorStops.map(item => ({
4020
+ color: item.value,
4021
+ offset: parseFloat(item.length.value) / 100
4022
+ }))
4055
4023
  };
4056
4024
  }
4057
4025
  static ParseLinear(datum) {
@@ -4073,7 +4041,10 @@
4073
4041
  y0: y0,
4074
4042
  x1: x1,
4075
4043
  y1: y1,
4076
- stops: GradientParser.processColorStops(colorStops)
4044
+ stops: colorStops.map(item => ({
4045
+ color: item.value,
4046
+ offset: parseFloat(item.length.value) / 100
4047
+ }))
4077
4048
  };
4078
4049
  }
4079
4050
  }
@@ -4261,6 +4232,8 @@
4261
4232
  return result.width += space, result;
4262
4233
  }
4263
4234
 
4235
+ const container = new Container();
4236
+
4264
4237
  const CanvasFactory = Symbol.for("CanvasFactory");
4265
4238
 
4266
4239
  function wrapCanvas(params) {
@@ -6754,7 +6727,7 @@
6754
6727
  });
6755
6728
  }
6756
6729
  setAttributes(params, forceUpdateTag = !1, context) {
6757
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
6730
+ (params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context);
6758
6731
  }
6759
6732
  _setAttributes(params, forceUpdateTag = !1, context) {
6760
6733
  const keys = Object.keys(params);
@@ -7389,8 +7362,8 @@
7389
7362
  function strokeVisible(opacity, strokeOpacity) {
7390
7363
  return opacity * strokeOpacity > 0;
7391
7364
  }
7392
- function rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH) {
7393
- return drawStrokeWhenZeroWH ? opacity * strokeOpacity > 0 : opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
7365
+ function rectStrokeVisible(opacity, strokeOpacity, width, height) {
7366
+ return opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
7394
7367
  }
7395
7368
 
7396
7369
  const ImageRenderContribution = Symbol.for("ImageRenderContribution");
@@ -7752,7 +7725,7 @@
7752
7725
  this.cache.layoutData.lines.forEach(item => {
7753
7726
  mergedText += item.str;
7754
7727
  });
7755
- return (Array.isArray(text) ? text.join("") : text).toString() !== mergedText;
7728
+ return (Array.isArray(text) ? text.join("") : text) !== mergedText;
7756
7729
  }
7757
7730
  return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
7758
7731
  }
@@ -7851,7 +7824,7 @@
7851
7824
  return fontSize ? .1 * fontSize : 0;
7852
7825
  }
7853
7826
  updateHorizontalMultilineAABBBounds(text) {
7854
- var _a, _b;
7827
+ var _a;
7855
7828
  const textTheme = this.getGraphicTheme(),
7856
7829
  attribute = this.attribute,
7857
7830
  {
@@ -7878,7 +7851,7 @@
7878
7851
  const bbox = this.cache.layoutData.bbox;
7879
7852
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
7880
7853
  }
7881
- const textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)),
7854
+ const textMeasure = application.graphicUtil.textMeasure,
7882
7855
  layoutData = new CanvasTextLayout(fontFamily, {
7883
7856
  fontSize: fontSize,
7884
7857
  fontWeight: fontWeight,
@@ -7896,7 +7869,7 @@
7896
7869
  return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
7897
7870
  }
7898
7871
  updateWrapAABBBounds(text) {
7899
- var _a, _b, _c, _d;
7872
+ var _a, _b, _c;
7900
7873
  const textTheme = this.getGraphicTheme(),
7901
7874
  {
7902
7875
  fontFamily = textTheme.fontFamily,
@@ -7922,7 +7895,7 @@
7922
7895
  const bbox = this.cache.layoutData.bbox;
7923
7896
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
7924
7897
  }
7925
- const textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_b = this.stage) || void 0 === _b ? void 0 : _b.textMeasureId)),
7898
+ const textMeasure = application.graphicUtil.textMeasure,
7926
7899
  textOptions = {
7927
7900
  fontSize: fontSize,
7928
7901
  fontWeight: fontWeight,
@@ -7954,7 +7927,7 @@
7954
7927
  if ("" !== str && "" === clip.str || clip.wordBreaked) {
7955
7928
  if (ellipsis) {
7956
7929
  const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
7957
- clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
7930
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
7958
7931
  } else clip.str = "", clip.width = 0;
7959
7932
  needCut = !1;
7960
7933
  }
@@ -8017,9 +7990,9 @@
8017
7990
  return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
8018
7991
  }
8019
7992
  updateVerticalMultilineAABBBounds(text) {
8020
- var _a, _b, _c;
7993
+ var _a, _b;
8021
7994
  const textTheme = this.getGraphicTheme(),
8022
- textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.textMeasureId));
7995
+ textMeasure = application.graphicUtil.textMeasure;
8023
7996
  let width;
8024
7997
  const attribute = this.attribute,
8025
7998
  {
@@ -8040,7 +8013,7 @@
8040
8013
  } = attribute;
8041
8014
  if (!verticalMode) {
8042
8015
  const t = textAlign;
8043
- textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left", textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
8016
+ textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
8044
8017
  }
8045
8018
  if (width = 0, !this.shouldUpdateShape() && this.cache) {
8046
8019
  this.cache.verticalList.forEach(item => {
@@ -8154,7 +8127,7 @@
8154
8127
  return isArray$1(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
8155
8128
  }
8156
8129
  updateMultilineAABBBounds(text) {
8157
- var _a, _b, _c, _d, _e;
8130
+ var _a, _b, _c, _d;
8158
8131
  const textTheme = this.getGraphicTheme(),
8159
8132
  {
8160
8133
  fontFamily = textTheme.fontFamily,
@@ -8178,7 +8151,7 @@
8178
8151
  const bbox = this.cache.layoutData.bbox;
8179
8152
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
8180
8153
  }
8181
- const textMeasure = application.graphicUtil.getTextMeasureInstance(this.textMeasureId || (null === (_c = this.stage) || void 0 === _c ? void 0 : _c.textMeasureId)),
8154
+ const textMeasure = application.graphicUtil.textMeasure,
8182
8155
  layoutObj = new CanvasTextLayout(fontFamily, {
8183
8156
  fontSize: fontSize,
8184
8157
  fontWeight: fontWeight,
@@ -8207,7 +8180,7 @@
8207
8180
  if ("" !== str && "" === clip.str) {
8208
8181
  if (ellipsis) {
8209
8182
  const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
8210
- clip.str = null !== (_d = clipEllipsis.str) && void 0 !== _d ? _d : "", clip.width = null !== (_e = clipEllipsis.width) && void 0 !== _e ? _e : 0;
8183
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
8211
8184
  } else clip.str = "", clip.width = 0;
8212
8185
  needCut = !1;
8213
8186
  }
@@ -9221,7 +9194,7 @@
9221
9194
  case "right":
9222
9195
  deltaX = -aabbBounds.width();
9223
9196
  }
9224
- return height || ("middle" === this.verticalDirection ? deltaY -= aabbBounds.height() / 2 : "bottom" === this.verticalDirection && (deltaY -= aabbBounds.height())), aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
9197
+ return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
9225
9198
  }
9226
9199
  needUpdateTags(keys) {
9227
9200
  return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
@@ -10435,8 +10408,7 @@
10435
10408
  y1: y1,
10436
10409
  x: originX = rectAttribute.x,
10437
10410
  y: originY = rectAttribute.y,
10438
- fillStrokeOrder = rectAttribute.fillStrokeOrder,
10439
- drawStrokeWhenZeroWH = rectAttribute.drawStrokeWhenZeroWH
10411
+ fillStrokeOrder = rectAttribute.fillStrokeOrder
10440
10412
  } = rect.attribute;
10441
10413
  let {
10442
10414
  width: width,
@@ -10444,7 +10416,7 @@
10444
10416
  } = rect.attribute;
10445
10417
  width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
10446
10418
  const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
10447
- sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
10419
+ sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
10448
10420
  doFill = runFill(fill, background),
10449
10421
  doStroke = runStroke(stroke, lineWidth);
10450
10422
  if (!rect.valid || !visible) return;
@@ -19816,7 +19788,7 @@
19816
19788
  const Checkbox = React.forwardRef(CheckboxComponent);
19817
19789
  Checkbox.displayName = 'Checkbox';
19818
19790
 
19819
- const version = "1.19.10-alpha.0";
19791
+ const version = "1.19.10-alpha.1";
19820
19792
 
19821
19793
  Object.defineProperty(exports, 'register', {
19822
19794
  enumerable: true,