@visactor/vrender-components 0.17.23 → 0.17.24

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
- export declare const version = "0.17.23";
1
+ export declare const version = "0.17.24";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.17.23", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.17.24", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./scrollbar"), exports), __exportStar(require("./tag"), exports),
22
22
  __exportStar(require("./poptip"), exports), __exportStar(require("./crosshair"), exports),
23
23
  __exportStar(require("./label"), exports), __exportStar(require("./axis"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.17.23\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.17.24\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './util';\n"]}
@@ -165,6 +165,7 @@ export declare class DataZoom extends AbstractComponent<Required<DataZoomAttribu
165
165
  y: number;
166
166
  };
167
167
  private _onHandlerPointerDown;
168
+ private _pointerMove;
168
169
  private _onHandlerPointerMove;
169
170
  private _onHandlerPointerUp;
170
171
  private _onHandlerPointerEnter;
@@ -67,11 +67,10 @@ export class DataZoom extends AbstractComponent {
67
67
  this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e),
68
68
  this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vglobal.env && (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
69
69
  capture: !0
70
- }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp.bind(this))),
71
- this.addEventListener("pointermove", this._onHandlerPointerMove, {
70
+ }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)), this.addEventListener("pointermove", this._onHandlerPointerMove, {
72
71
  capture: !0
73
72
  });
74
- }, this._onHandlerPointerMove = delayMap[this.attribute.delayType]((e => {
73
+ }, this._pointerMove = e => {
75
74
  e.stopPropagation();
76
75
  const {start: startAttr, end: endAttr, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute, pos = this.eventPosToStagePos(e), {attPos: attPos, max: max} = this._layoutCache, dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
77
76
  let {start: start, end: end} = this.state;
@@ -79,13 +78,31 @@ export class DataZoom extends AbstractComponent {
79
78
  end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start,
80
79
  start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis),
81
80
  this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1),
82
- end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0),
81
+ end = Math.min(Math.max(end, 0), 1), !realTime || startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0),
83
82
  this._dispatchEvent("change", {
84
83
  start: start,
85
84
  end: end,
86
85
  tag: this._activeTag
87
86
  }));
88
- }), this.attribute.delayTime);
87
+ }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap[this.attribute.delayType](this._pointerMove, this.attribute.delayTime),
88
+ this._onHandlerPointerUp = e => {
89
+ e.preventDefault();
90
+ const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
91
+ if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
92
+ const pos = this.eventPosToStagePos(e);
93
+ this.backgroundDragZoom(this._activeCache.startPos, pos);
94
+ }
95
+ this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0),
96
+ this._dispatchEvent("change", {
97
+ start: this.state.start,
98
+ end: this.state.end,
99
+ tag: this._activeTag
100
+ })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
101
+ capture: !0
102
+ }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
103
+ capture: !0
104
+ }), this.removeEventListener("pointerup", this._onHandlerPointerUp);
105
+ };
89
106
  const {position: position, showDetail: showDetail} = attributes;
90
107
  this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail,
91
108
  this.setPropsFromAttrs();
@@ -129,25 +146,6 @@ export class DataZoom extends AbstractComponent {
129
146
  y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
130
147
  };
131
148
  }
132
- _onHandlerPointerUp(e) {
133
- e.preventDefault();
134
- const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
135
- if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
136
- const pos = this.eventPosToStagePos(e);
137
- this.backgroundDragZoom(this._activeCache.startPos, pos);
138
- }
139
- this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0),
140
- this._dispatchEvent("change", {
141
- start: this.state.start,
142
- end: this.state.end,
143
- tag: this._activeTag
144
- })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
145
- capture: !0
146
- }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp.bind(this))),
147
- this.removeEventListener("pointermove", this._onHandlerPointerMove, {
148
- capture: !0
149
- });
150
- }
151
149
  _onHandlerPointerEnter(e) {
152
150
  e.stopPropagation(), this._showText = !0, this.renderText();
153
151
  }
@@ -279,7 +277,7 @@ export class DataZoom extends AbstractComponent {
279
277
  }, this._layoutAttrFromConfig;
280
278
  }
281
279
  render() {
282
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
280
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
283
281
  this._layoutAttrFromConfig = null;
284
282
  const {orient: orient, backgroundStyle: backgroundStyle, backgroundChartStyle: backgroundChartStyle = {}, selectedBackgroundStyle: selectedBackgroundStyle = {}, selectedBackgroundChartStyle: selectedBackgroundChartStyle = {}, middleHandlerStyle: middleHandlerStyle = {}, startHandlerStyle: startHandlerStyle = {}, endHandlerStyle: endHandlerStyle = {}, brushSelect: brushSelect, zoomLock: zoomLock} = this.attribute, {start: start, end: end} = this.state, {position: position, width: width, height: height} = this.getLayoutAttrFromConfig(), startHandlerMinSize = null !== (_a = startHandlerStyle.triggerMinSize) && void 0 !== _a ? _a : 40, endHandlerMinSize = null !== (_b = endHandlerStyle.triggerMinSize) && void 0 !== _b ? _b : 40, group = this.createOrUpdateChild("dataZoom-container", {}, "group");
285
283
  if (this._container = group, this._background = group.createOrUpdateChild("background", Object.assign(Object.assign({
@@ -289,9 +287,9 @@ export class DataZoom extends AbstractComponent {
289
287
  height: height,
290
288
  cursor: brushSelect ? "crosshair" : "auto"
291
289
  }, backgroundStyle), {
292
- pickable: !zoomLock
293
- }), "rect"), (null === (_c = backgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setPreviewAttributes("line", group),
294
- (null === (_d = backgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("area", group),
290
+ pickable: !zoomLock && (null === (_c = backgroundStyle.pickable) || void 0 === _c || _c)
291
+ }), "rect"), (null === (_d = backgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("line", group),
292
+ (null === (_e = backgroundChartStyle.area) || void 0 === _e ? void 0 : _e.visible) && this.setPreviewAttributes("area", group),
295
293
  brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
296
294
  x: position.x + start * width,
297
295
  y: position.y,
@@ -299,7 +297,7 @@ export class DataZoom extends AbstractComponent {
299
297
  height: height,
300
298
  cursor: brushSelect ? "crosshair" : "move"
301
299
  }, selectedBackgroundStyle), {
302
- pickable: !zoomLock
300
+ pickable: !zoomLock && (null === (_f = selectedBackgroundChartStyle.pickable) || void 0 === _f || _f)
303
301
  }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
304
302
  x: position.x,
305
303
  y: position.y + start * height,
@@ -307,43 +305,43 @@ export class DataZoom extends AbstractComponent {
307
305
  height: (end - start) * height,
308
306
  cursor: brushSelect ? "crosshair" : "move"
309
307
  }, selectedBackgroundStyle), {
310
- pickable: !zoomLock
311
- }), "rect"), (null === (_e = selectedBackgroundChartStyle.line) || void 0 === _e ? void 0 : _e.visible) && this.setSelectedPreviewAttributes("line", group),
312
- (null === (_f = selectedBackgroundChartStyle.area) || void 0 === _f ? void 0 : _f.visible) && this.setSelectedPreviewAttributes("area", group),
308
+ pickable: !zoomLock && (null === (_g = selectedBackgroundStyle.pickable) || void 0 === _g || _g)
309
+ }), "rect"), (null === (_h = selectedBackgroundChartStyle.line) || void 0 === _h ? void 0 : _h.visible) && this.setSelectedPreviewAttributes("line", group),
310
+ (null === (_j = selectedBackgroundChartStyle.area) || void 0 === _j ? void 0 : _j.visible) && this.setSelectedPreviewAttributes("area", group),
313
311
  this._isHorizontal) {
314
312
  if (middleHandlerStyle.visible) {
315
- const middleHandlerBackgroundSize = (null === (_g = middleHandlerStyle.background) || void 0 === _g ? void 0 : _g.size) || 10;
313
+ const middleHandlerBackgroundSize = (null === (_k = middleHandlerStyle.background) || void 0 === _k ? void 0 : _k.size) || 10;
316
314
  this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
317
315
  x: position.x + start * width,
318
316
  y: position.y - middleHandlerBackgroundSize,
319
317
  width: (end - start) * width,
320
318
  height: middleHandlerBackgroundSize
321
- }, null === (_h = middleHandlerStyle.background) || void 0 === _h ? void 0 : _h.style), {
322
- pickable: !zoomLock
319
+ }, null === (_l = middleHandlerStyle.background) || void 0 === _l ? void 0 : _l.style), {
320
+ pickable: !zoomLock && (null === (_p = null === (_o = null === (_m = middleHandlerStyle.background) || void 0 === _m ? void 0 : _m.style) || void 0 === _o ? void 0 : _o.pickable) || void 0 === _p || _p)
323
321
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
324
322
  x: position.x + (start + end) / 2 * width,
325
323
  y: position.y - middleHandlerBackgroundSize / 2,
326
324
  strokeBoundsBuffer: 0,
327
325
  angle: 0,
328
- symbolType: null !== (_k = null === (_j = middleHandlerStyle.icon) || void 0 === _j ? void 0 : _j.symbolType) && void 0 !== _k ? _k : "square"
326
+ symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square"
329
327
  }, middleHandlerStyle.icon), {
330
- pickable: !zoomLock
328
+ pickable: !zoomLock && (null === (_s = middleHandlerStyle.icon.pickable) || void 0 === _s || _s)
331
329
  }), "symbol");
332
330
  }
333
331
  this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
334
332
  x: position.x + start * width,
335
333
  y: position.y + height / 2,
336
334
  size: height,
337
- symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
335
+ symbolType: null !== (_t = startHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
338
336
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
339
- pickable: !zoomLock
337
+ pickable: !zoomLock && (null === (_u = startHandlerStyle.pickable) || void 0 === _u || _u)
340
338
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
341
339
  x: position.x + end * width,
342
340
  y: position.y + height / 2,
343
341
  size: height,
344
- symbolType: null !== (_m = endHandlerStyle.symbolType) && void 0 !== _m ? _m : "square"
342
+ symbolType: null !== (_v = endHandlerStyle.symbolType) && void 0 !== _v ? _v : "square"
345
343
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
346
- pickable: !zoomLock
344
+ pickable: !zoomLock && (null === (_w = endHandlerStyle.pickable) || void 0 === _w || _w)
347
345
  }), "symbol");
348
346
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize), startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize), endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize), endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
349
347
  this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({
@@ -369,38 +367,38 @@ export class DataZoom extends AbstractComponent {
369
367
  }), "rect");
370
368
  } else {
371
369
  if (middleHandlerStyle.visible) {
372
- const middleHandlerBackgroundSize = (null === (_o = middleHandlerStyle.background) || void 0 === _o ? void 0 : _o.size) || 10;
370
+ const middleHandlerBackgroundSize = (null === (_x = middleHandlerStyle.background) || void 0 === _x ? void 0 : _x.size) || 10;
373
371
  this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
374
372
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
375
373
  y: position.y + start * height,
376
374
  width: middleHandlerBackgroundSize,
377
375
  height: (end - start) * height
378
- }, null === (_p = middleHandlerStyle.background) || void 0 === _p ? void 0 : _p.style), {
379
- pickable: !zoomLock
376
+ }, null === (_y = middleHandlerStyle.background) || void 0 === _y ? void 0 : _y.style), {
377
+ pickable: !zoomLock && (null === (_1 = null === (_0 = null === (_z = middleHandlerStyle.background) || void 0 === _z ? void 0 : _z.style) || void 0 === _0 ? void 0 : _0.pickable) || void 0 === _1 || _1)
380
378
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
381
379
  x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
382
380
  y: position.y + (start + end) / 2 * height,
383
381
  angle: Math.PI / 180 * 90,
384
- symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square",
382
+ symbolType: null !== (_3 = null === (_2 = middleHandlerStyle.icon) || void 0 === _2 ? void 0 : _2.symbolType) && void 0 !== _3 ? _3 : "square",
385
383
  strokeBoundsBuffer: 0
386
384
  }, middleHandlerStyle.icon), {
387
- pickable: !zoomLock
385
+ pickable: !zoomLock && (null === (_5 = null === (_4 = middleHandlerStyle.icon) || void 0 === _4 ? void 0 : _4.pickable) || void 0 === _5 || _5)
388
386
  }), "symbol");
389
387
  }
390
388
  this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
391
389
  x: position.x + width / 2,
392
390
  y: position.y + start * height,
393
391
  size: width,
394
- symbolType: null !== (_s = startHandlerStyle.symbolType) && void 0 !== _s ? _s : "square"
392
+ symbolType: null !== (_6 = startHandlerStyle.symbolType) && void 0 !== _6 ? _6 : "square"
395
393
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
396
- pickable: !zoomLock
394
+ pickable: !zoomLock && (null === (_7 = startHandlerStyle.pickable) || void 0 === _7 || _7)
397
395
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
398
396
  x: position.x + width / 2,
399
397
  y: position.y + end * height,
400
398
  size: width,
401
- symbolType: null !== (_t = endHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
399
+ symbolType: null !== (_8 = endHandlerStyle.symbolType) && void 0 !== _8 ? _8 : "square"
402
400
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
403
- pickable: !zoomLock
401
+ pickable: !zoomLock && (null === (_9 = endHandlerStyle.pickable) || void 0 === _9 || _9)
404
402
  }), "symbol");
405
403
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize), startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize), endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize), endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
406
404
  this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({