@visactor/vrender-components 0.16.14 → 0.16.15

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.
@@ -17,5 +17,4 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), __exportStar(require("./brush"), exports), __exportStar(require("./type"), exports);
21
- //# sourceMappingURL=index.js.map
20
+ }), __exportStar(require("./brush"), exports), __exportStar(require("./type"), exports);
@@ -17,4 +17,5 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), __exportStar(require("./checkbox"), exports), __exportStar(require("./type"), exports);
20
+ }), __exportStar(require("./checkbox"), exports), __exportStar(require("./type"), exports);
21
+ //# sourceMappingURL=index.js.map
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.16.14";
1
+ export declare const version = "0.16.15";
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.16.14", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.16.15", __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","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.16.14\";\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';\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","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.16.15\";\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';\n"]}
@@ -8,6 +8,7 @@ export declare class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
8
8
  private _itemHeight;
9
9
  private _itemMaxWidth;
10
10
  private _pager;
11
+ private _lastActiveItem;
11
12
  static defaultAttributes: Partial<DiscreteLegendAttrs>;
12
13
  constructor(attributes: DiscreteLegendAttrs);
13
14
  setSelected(selectedData: (string | number)[]): void;
@@ -18,6 +19,8 @@ export declare class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
18
19
  private _onHover;
19
20
  private _onUnHover;
20
21
  private _onClick;
22
+ private _hover;
23
+ private _unHover;
21
24
  private _setLegendItemState;
22
25
  private _removeLegendItemState;
23
26
  private _getSelectedLegends;
@@ -31,26 +31,14 @@ class DiscreteLegend extends base_1.LegendBase {
31
31
  const target = e.target;
32
32
  if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(constant_1.LEGEND_ELEMENT_NAME.item)) {
33
33
  const legendItem = target.delegate;
34
- legendItem.hasState(constant_1.LegendStateValue.selected) ? this._setLegendItemState(legendItem, constant_1.LegendStateValue.selectedHover, e) : this._setLegendItemState(legendItem, constant_1.LegendStateValue.unSelectedHover, e);
35
- const focusButton = legendItem.getChildren()[0].find((node => node.name === constant_1.LEGEND_ELEMENT_NAME.focus), !1);
36
- focusButton && focusButton.setAttribute("visible", !0), this._dispatchEvent(constant_1.LegendEvent.legendItemHover, legendItem, e);
37
- }
34
+ if (this._lastActiveItem) {
35
+ if (this._lastActiveItem.id === legendItem.id) return;
36
+ this._unHover(this._lastActiveItem, e);
37
+ }
38
+ this._hover(legendItem, e);
39
+ } else this._lastActiveItem && (this._unHover(this._lastActiveItem, e), this._lastActiveItem = null);
38
40
  }, this._onUnHover = e => {
39
- var _a;
40
- const target = e.target;
41
- if (null === (_a = null == target ? void 0 : target.name) || void 0 === _a ? void 0 : _a.startsWith(constant_1.LEGEND_ELEMENT_NAME.item)) {
42
- const legendItem = target.delegate;
43
- let attributeUpdate = !1;
44
- (legendItem.hasState(constant_1.LegendStateValue.unSelectedHover) || legendItem.hasState(constant_1.LegendStateValue.selectedHover)) && (attributeUpdate = !0),
45
- legendItem.removeState(constant_1.LegendStateValue.unSelectedHover), legendItem.removeState(constant_1.LegendStateValue.selectedHover),
46
- legendItem.getChildren()[0].getChildren().forEach((child => {
47
- attributeUpdate || !child.hasState(constant_1.LegendStateValue.unSelectedHover) && !child.hasState(constant_1.LegendStateValue.selectedHover) || (attributeUpdate = !0),
48
- child.removeState(constant_1.LegendStateValue.unSelectedHover), child.removeState(constant_1.LegendStateValue.selectedHover);
49
- }));
50
- const focusButton = legendItem.getChildren()[0].find((node => node.name === constant_1.LEGEND_ELEMENT_NAME.focus), !1);
51
- focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(constant_1.LegendEvent.legendItemAttributeUpdate, legendItem, e),
52
- this._dispatchEvent(constant_1.LegendEvent.legendItemUnHover, legendItem, e);
53
- }
41
+ this._lastActiveItem && (this._unHover(this._lastActiveItem, e), this._lastActiveItem = null);
54
42
  }, this._onClick = e => {
55
43
  var _a, _b, _c, _d, _e;
56
44
  const target = e.target;
@@ -137,7 +125,7 @@ class DiscreteLegend extends base_1.LegendBase {
137
125
  if (this.attribute.disableTriggerEvent) return;
138
126
  if (!this._itemsContainer) return;
139
127
  const {hover: hover = !0, select: select = !0} = this.attribute;
140
- hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("pointerout", this._onUnHover)),
128
+ hover && (this._itemsContainer.addEventListener("pointermove", this._onHover), this._itemsContainer.addEventListener("pointerleave", this._onUnHover)),
141
129
  select && this._itemsContainer.addEventListener("pointerdown", this._onClick);
142
130
  }
143
131
  _renderEachItem(item, isSelected, index, items) {
@@ -156,7 +144,7 @@ class DiscreteLegend extends base_1.LegendBase {
156
144
  x: 0,
157
145
  y: 0
158
146
  }, null == background ? void 0 : background.style)), this._appendDataToShape(itemGroup, constant_1.LEGEND_ELEMENT_NAME.item, item, itemGroup, null == background ? void 0 : background.state)),
159
- itemGroup.addState(isSelected ? constant_1.LegendStateValue.selected : constant_1.LegendStateValue.unSelected);
147
+ itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? constant_1.LegendStateValue.selected : constant_1.LegendStateValue.unSelected);
160
148
  const innerGroup = (0, vrender_core_1.createGroup)({
161
149
  x: 0,
162
150
  y: 0,
@@ -310,6 +298,24 @@ class DiscreteLegend extends base_1.LegendBase {
310
298
  return this._pager.addEventListener("toPrev", onPaging), this._pager.addEventListener("toNext", onPaging),
311
299
  !0;
312
300
  }
301
+ _hover(legendItem, e) {
302
+ this._lastActiveItem = legendItem;
303
+ legendItem.hasState(constant_1.LegendStateValue.selected) ? this._setLegendItemState(legendItem, constant_1.LegendStateValue.selectedHover, e) : this._setLegendItemState(legendItem, constant_1.LegendStateValue.unSelectedHover, e);
304
+ const focusButton = legendItem.getChildren()[0].find((node => node.name === constant_1.LEGEND_ELEMENT_NAME.focus), !1);
305
+ focusButton && focusButton.setAttribute("visible", !0), this._dispatchEvent(constant_1.LegendEvent.legendItemHover, legendItem, e);
306
+ }
307
+ _unHover(legendItem, e) {
308
+ let attributeUpdate = !1;
309
+ (legendItem.hasState(constant_1.LegendStateValue.unSelectedHover) || legendItem.hasState(constant_1.LegendStateValue.selectedHover)) && (attributeUpdate = !0),
310
+ legendItem.removeState(constant_1.LegendStateValue.unSelectedHover), legendItem.removeState(constant_1.LegendStateValue.selectedHover),
311
+ legendItem.getChildren()[0].getChildren().forEach((child => {
312
+ attributeUpdate || !child.hasState(constant_1.LegendStateValue.unSelectedHover) && !child.hasState(constant_1.LegendStateValue.selectedHover) || (attributeUpdate = !0),
313
+ child.removeState(constant_1.LegendStateValue.unSelectedHover), child.removeState(constant_1.LegendStateValue.selectedHover);
314
+ }));
315
+ const focusButton = legendItem.getChildren()[0].find((node => node.name === constant_1.LEGEND_ELEMENT_NAME.focus), !1);
316
+ focusButton && focusButton.setAttribute("visible", !1), attributeUpdate && this._dispatchEvent(constant_1.LegendEvent.legendItemAttributeUpdate, legendItem, e),
317
+ this._dispatchEvent(constant_1.LegendEvent.legendItemUnHover, legendItem, e);
318
+ }
313
319
  _setLegendItemState(legendItem, stateName, e) {
314
320
  let attributeUpdate = !1;
315
321
  legendItem.hasState(stateName) || (attributeUpdate = !0), legendItem.addState(stateName, true),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/legend/discrete/discrete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,6CAAsH;AAWtH,yDAA4F;AAC5F,kCAAqC;AACrC,uCAAoC;AACpC,0CAYqB;AAGrB,MAAM,cAAc,GAAG;IACrB,CAAC,2BAAgB,CAAC,KAAK,CAAC,EAAE,EAAE;IAC5B,CAAC,2BAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC/B,CAAC,2BAAgB,CAAC,aAAa,CAAC,EAAE,EAAE;IACpC,CAAC,2BAAgB,CAAC,UAAU,CAAC,EAAE,EAAE;IACjC,CAAC,2BAAgB,CAAC,eAAe,CAAC,EAAE,EAAE;CACvC,CAAC;AAEF,MAAa,cAAe,SAAQ,iBAA+B;IAmGjE,YAAY,UAA+B;QACzC,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,cAAc,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAnGjE,SAAI,GAAG,gBAAgB,CAAC;QAEhB,oBAAe,GAAkB,IAAI,CAAC;QAEtC,sBAAiB,GAAuB,SAAS,CAAC;QAClD,gBAAW,GAAG,CAAC,CAAC;QAChB,kBAAa,GAAG,CAAC,CAAC;QAgnBlB,aAAQ,GAAG,CAAC,CAAw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ete.js","sourcesContent":["/**\n * @description 离散图例\n * @author 章伟星\n */\nimport { merge, isEmpty, normalizePadding, get, isValid, Dict, isBoolean, isNil, isFunction } from '@visactor/vutils';\nimport type {\n FederatedPointerEvent,\n IGroup,\n IGraphic,\n INode,\n IGroupGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { createGroup, createText, createSymbol, CustomEvent } from '@visactor/vrender-core';\nimport { LegendBase } from '../base';\nimport { Pager } from '../../pager';\nimport {\n DEFAULT_TITLE_SPACE,\n DEFAULT_ITEM_SPACE_COL,\n DEFAULT_ITEM_SPACE_ROW,\n DEFAULT_SHAPE_SPACE,\n DEFAULT_SHAPE_SIZE,\n DEFAULT_LABEL_SPACE,\n DEFAULT_PAGER_SPACE,\n LegendStateValue,\n DEFAULT_VALUE_SPACE,\n LegendEvent,\n LEGEND_ELEMENT_NAME\n} from '../constant';\nimport type { DiscreteLegendAttrs, LegendItem, LegendItemDatum } from './type';\n\nconst DEFAULT_STATES = {\n [LegendStateValue.focus]: {},\n [LegendStateValue.selected]: {},\n [LegendStateValue.selectedHover]: {},\n [LegendStateValue.unSelected]: {},\n [LegendStateValue.unSelectedHover]: {}\n};\n\nexport class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {\n name = 'discreteLegend';\n\n private _itemsContainer: IGroup | null = null;\n private _itemWidthByUser: number | undefined;\n private _itemHeightByUser: number | undefined = undefined;\n private _itemHeight = 0; // 存储每一个图例项的高度\n private _itemMaxWidth = 0; // 存储图例项的最大的宽度\n private _pager!: Pager;\n\n static defaultAttributes: Partial<DiscreteLegendAttrs> = {\n layout: 'horizontal',\n title: {\n align: 'start',\n space: DEFAULT_TITLE_SPACE,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: DEFAULT_ITEM_SPACE_COL,\n spaceRow: DEFAULT_ITEM_SPACE_ROW,\n shape: {\n space: DEFAULT_SHAPE_SPACE,\n style: {\n size: DEFAULT_SHAPE_SIZE,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n opacity: 0.5\n }\n }\n },\n label: {\n space: DEFAULT_LABEL_SPACE,\n style: {\n fontSize: 12,\n fill: '#2C3542',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n }\n },\n focus: false,\n focusIconStyle: {\n size: DEFAULT_SHAPE_SIZE,\n symbolType:\n 'M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z',\n fill: '#333',\n cursor: 'pointer'\n }\n },\n autoPage: true,\n pager: {\n space: DEFAULT_PAGER_SPACE,\n handler: {\n style: { size: 10 },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: true\n };\n\n constructor(attributes: DiscreteLegendAttrs) {\n super(merge({}, DiscreteLegend.defaultAttributes, attributes));\n }\n\n /**\n * 更新选中数据\n * @param value 选中数据范围\n * @returns\n */\n setSelected(selectedData: (string | number)[]) {\n (this._itemsContainer?.getChildren() as IGroup[]).forEach(item => {\n // @ts-ignore\n const itemData = item.data as LegendItemDatum;\n if (selectedData.includes(itemData.label)) {\n this._setLegendItemState(item, LegendStateValue.selected);\n this._removeLegendItemState(item, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover]);\n } else {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(item, [LegendStateValue.selected, LegendStateValue.selectedHover]);\n this._setLegendItemState(item, LegendStateValue.unSelected);\n }\n });\n }\n\n protected _renderContent() {\n const { item = {}, items, reversed, maxCol = 1, maxRow = 2 } = this.attribute as DiscreteLegendAttrs;\n if (item.visible === false || isEmpty(items)) {\n return;\n }\n\n let legendItems = items;\n if (reversed) {\n legendItems = items?.reverse();\n }\n\n const itemsContainer = createGroup({\n x: 0,\n y: 0\n });\n this._itemsContainer = itemsContainer;\n\n const { layout, maxWidth, maxHeight, defaultSelected = [], autoPage } = this.attribute;\n const isHorizontal = layout === 'horizontal';\n\n const {\n spaceCol = DEFAULT_ITEM_SPACE_COL,\n spaceRow = DEFAULT_ITEM_SPACE_ROW,\n maxWidth: maxItemWidth,\n width: itemWidth,\n height: itemHeight\n } = item;\n\n // 根据用户声明的 maxItemWidth 和 itemWidth 获取图例项宽度\n if (isValid(maxItemWidth)) {\n if (isValid(itemWidth)) {\n this._itemWidthByUser = Math.min(maxItemWidth, itemWidth);\n } else {\n this._itemWidthByUser = maxItemWidth;\n }\n } else if (isValid(itemWidth)) {\n this._itemWidthByUser = itemWidth;\n }\n\n // 存储用户指定图例项高度\n if (isValid(itemHeight)) {\n this._itemHeightByUser = itemHeight;\n }\n let doWrap = false; // 水平布局换行标识\n let maxWidthInCol = 0; // 存储每一列最大的宽度,用于垂直布局的换列\n let startX = 0;\n let startY = 0;\n let maxPages = 1;\n let pages = 1;\n legendItems.forEach((item, index) => {\n if (!item.id) {\n item.id = item.label; // 如果没有设置 id,默认使用 label\n }\n item.index = index; // 用于维护图例的顺序\n\n const itemGroup = this._renderEachItem(\n item,\n isEmpty(defaultSelected) ? true : defaultSelected?.includes(item.label),\n index,\n legendItems\n );\n const itemWidth = itemGroup.attribute.width;\n const itemHeight = itemGroup.attribute.height;\n this._itemHeight = Math.max(this._itemHeight, itemHeight);\n maxWidthInCol = Math.max(itemWidth, maxWidthInCol);\n\n this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth);\n\n if (isHorizontal) {\n maxPages = maxRow;\n // 水平布局\n if (isValid(maxWidth)) {\n if (itemWidth >= maxWidth) {\n // 如果图例项本身就大于 maxWidth\n doWrap = true;\n if (index > 0) {\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n } else if (maxWidth < startX + itemWidth) {\n // 检测是否需要换行:如果用户声明了 maxWidth 并且超出了,则进行换行\n doWrap = true;\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + itemWidth;\n } else {\n maxPages = maxCol;\n // 垂直布局\n if (isValid(maxHeight) && maxHeight < startY + itemHeight) {\n // 检测是否换列:如果用户声明了 maxHeight 并且超出了,则进行换列\n doWrap = true;\n startY = 0;\n startX += maxWidthInCol + spaceCol;\n maxWidthInCol = 0;\n pages += 1;\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + itemHeight;\n }\n\n itemsContainer.add(itemGroup);\n });\n\n // TODO: 添加测试用例\n let pagerRendered = false;\n if (doWrap && autoPage && pages > maxPages) {\n // 进行分页处理\n pagerRendered = this._renderPager(isHorizontal);\n }\n\n if (!pagerRendered) {\n itemsContainer.setAttribute(\n 'y',\n this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0\n );\n this._innerView.add(itemsContainer);\n }\n }\n\n protected _bindEvents() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n if (!this._itemsContainer) {\n return;\n }\n\n const { hover = true, select = true } = this.attribute;\n if (hover) {\n this._itemsContainer.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._itemsContainer.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._itemsContainer.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _renderEachItem(item: LegendItemDatum, isSelected: boolean, index: number, items: LegendItemDatum[]) {\n const { id, label, value, shape } = item;\n const { padding = 0, focus, focusIconStyle = {} } = this.attribute.item as LegendItem;\n\n let {\n shape: shapeAttr = {},\n label: labelAttr = {},\n value: valueAttr = {},\n background = {}\n } = this.attribute.item as LegendItem;\n\n shapeAttr = this._handleStyle(shapeAttr, item, isSelected, index, items);\n labelAttr = this._handleStyle(labelAttr, item, isSelected, index, items);\n valueAttr = this._handleStyle(valueAttr, item, isSelected, index, items);\n background = this._handleStyle(background, item, isSelected, index, items);\n\n const parsedPadding = normalizePadding(padding);\n\n let itemGroup;\n if (background.visible === false) {\n itemGroup = createGroup({\n x: 0,\n y: 0,\n cursor: (background?.style as IGroupGraphicAttribute).cursor\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup);\n } else {\n itemGroup = createGroup({\n x: 0,\n y: 0,\n ...background?.style\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, background?.state);\n }\n\n itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n const innerGroup = createGroup({\n x: 0,\n y: 0,\n pickable: false\n });\n itemGroup.add(innerGroup);\n\n let focusStartX = 0;\n const shapeSize = get(shapeAttr, 'style.size', DEFAULT_SHAPE_SIZE);\n const shapeSpace = get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);\n const itemShape = createSymbol({\n x: 0,\n y: 0,\n symbolType: 'circle',\n strokeBoundsBuffer: 0,\n ...shape,\n ...shapeAttr.style\n });\n // 处理下 shape 的 fill stroke\n Object.keys(shapeAttr.state || {}).forEach(key => {\n const color =\n (shapeAttr.state[key] as ISymbolGraphicAttribute).fill ||\n (shapeAttr.state[key] as ISymbolGraphicAttribute).stroke;\n if (shape.fill && isNil((shapeAttr.state[key] as ISymbolGraphicAttribute).fill) && color) {\n (shapeAttr.state[key] as ISymbolGraphicAttribute).fill = color as string;\n }\n\n if (shape.stroke && isNil((shapeAttr.state[key] as ISymbolGraphicAttribute).stroke) && color) {\n (shapeAttr.state[key] as ISymbolGraphicAttribute).stroke = color as string;\n }\n });\n this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeAttr?.state);\n\n itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(itemShape);\n\n let focusShape;\n let focusSpace = 0;\n\n if (focus) {\n const focusSize = get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);\n // 绘制聚焦按钮\n focusShape = createSymbol({\n x: 0,\n y: -focusSize / 2 - 1,\n strokeBoundsBuffer: 0,\n ...focusIconStyle,\n visible: false,\n pickMode: 'imprecise',\n boundsPadding: parsedPadding\n });\n this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup);\n\n focusSpace = focusSize;\n }\n\n const labelShape = createText({\n x: shapeSize / 2 + shapeSpace,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (labelAttr?.style as ITextGraphicAttribute).fontSize,\n ...labelAttr?.style,\n text: labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label\n });\n this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelAttr?.state);\n labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(labelShape);\n const labelSpace = get(labelAttr, 'space', DEFAULT_LABEL_SPACE);\n if (isValid(value)) {\n const valueSpace = get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);\n const valueShape = createText({\n x: 0,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (valueAttr?.style as ITextGraphicAttribute).fontSize,\n ...valueAttr?.style,\n text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value\n });\n this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueAttr?.state);\n valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n if (this._itemWidthByUser) {\n // 计算用来防止文本的宽度\n const layoutWidth =\n this._itemWidthByUser -\n parsedPadding[1] -\n parsedPadding[3] -\n shapeSize -\n shapeSpace -\n labelSpace -\n focusSpace -\n valueSpace;\n const valueBounds = valueShape.AABBBounds;\n const labelBounds = labelShape.AABBBounds;\n const valueWidth = valueBounds.width();\n const labelWidth = labelBounds.width();\n if (labelWidth > layoutWidth) {\n if ((layoutWidth - valueWidth) / labelWidth > 0.4) {\n // 设置一个值,如果剩余的宽度和 label 自身的比例不低于 0.4 的话,优先展示全 label\n labelShape.setAttribute('maxLineWidth', layoutWidth - valueWidth);\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n labelShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n }\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth - labelWidth);\n }\n\n if (valueAttr.alignRight) {\n valueShape.setAttributes({\n // @ts-ignore\n textAlign: 'right',\n x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace\n });\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n focusStartX = valueShape.AABBBounds.x2 + valueSpace;\n\n innerGroup.add(valueShape);\n } else if (this._itemWidthByUser) {\n labelShape.setAttribute(\n 'maxLineWidth',\n this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace\n );\n\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n } else {\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n }\n\n if (focusShape) {\n focusShape.setAttribute('x', focusStartX);\n innerGroup.add(focusShape);\n }\n\n const innerGroupBounds = innerGroup.AABBBounds;\n const innerGroupWidth = innerGroupBounds.width();\n const innerGroupHeight = innerGroupBounds.height();\n const itemGroupWidth = isValid(this.attribute.item.width)\n ? this.attribute.item.width\n : innerGroupWidth + parsedPadding[1] + parsedPadding[3];\n const itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];\n itemGroup.attribute.width = itemGroupWidth;\n itemGroup.attribute.height = itemGroupHeight;\n\n innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]);\n return itemGroup;\n }\n\n private _renderPager(isHorizontal: boolean) {\n const renderStartY = this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0;\n const { maxWidth, maxHeight, maxCol = 1, maxRow = 2, item = {}, pager = {}, disableTriggerEvent } = this.attribute;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = item;\n const itemsContainer = this._itemsContainer as IGroup;\n const {\n animation = true,\n animationDuration = 450,\n animationEasing = 'quadIn',\n space: pagerSpace = DEFAULT_PAGER_SPACE,\n ...pageStyle\n } = pager;\n\n let pagerComp: Pager;\n let pageHeight = 0; // 每页的高度\n let pageWidth = 0; // 每页的宽度\n let startX = 0; // 临时变量,用来存储布局的起始点\n let startY = 0; // 临时变量,用来存储布局的起始点\n let pages = 1; // 页数\n\n if (isHorizontal) {\n // 水平布局,支持上下翻页\n pagerComp = new Pager({\n layout: maxRow === 1 ? 'horizontal' : 'vertical',\n total: 99,\n ...merge(\n {\n handler: {\n preShape: 'triangleUp',\n nextShape: 'triangleDown'\n }\n },\n pageStyle\n ),\n disableTriggerEvent\n });\n this._pager = pagerComp;\n this._innerView.add(pagerComp as unknown as INode);\n pageHeight = (maxRow - 1) * spaceRow + this._itemHeight * maxRow;\n pageWidth = (maxWidth as number) - pagerComp.AABBBounds.width() - pagerSpace;\n\n if (pageWidth <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(pagerComp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { width, height } = item.attribute;\n\n if (pageWidth < startX + (width as number)) {\n // 超出了,则换行\n startX = 0;\n startY += (height as number) + spaceRow;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + (width as number);\n });\n\n pagerComp.setAttributes({\n total: Math.ceil(pages / maxRow),\n x: pageWidth,\n y: renderStartY + pageHeight / 2 - pagerComp.AABBBounds.height() / 2\n });\n } else {\n // 垂直布局,支持左右翻页\n pagerComp = new Pager({\n layout: 'horizontal',\n total: 99, // 用于估算,\n disableTriggerEvent,\n ...pageStyle\n });\n this._pager = pagerComp;\n this._innerView.add(pagerComp as unknown as INode);\n\n pageWidth = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol;\n pageHeight = (maxHeight as number) - pagerComp.AABBBounds.height() - pagerSpace - renderStartY;\n\n if (pageHeight <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(pagerComp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { height } = item.attribute;\n if (pageHeight < startY + (height as number)) {\n startY = 0;\n startX += this._itemMaxWidth + spaceCol;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + (height as number);\n });\n\n pagerComp.setAttributes({\n total: Math.ceil(pages / maxCol),\n x: (pageWidth - pagerComp.AABBBounds.width()) / 2,\n y: (maxHeight as number) - pagerComp.AABBBounds.height()\n });\n }\n\n // 初始化 defaultCurrent\n if (pager.defaultCurrent > 1) {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(pager.defaultCurrent - 1) * (pageHeight + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(pager.defaultCurrent - 1) * (pageWidth + spaceCol));\n }\n }\n\n const clipGroup = createGroup({\n x: 0,\n y: renderStartY,\n width: pageWidth,\n height: pageHeight,\n clip: true,\n pickable: false\n });\n clipGroup.add(itemsContainer);\n this._innerView.add(clipGroup);\n\n const onPaging = (e: CustomEvent) => {\n const { current } = e.detail;\n\n if (animation) {\n itemsContainer\n .animate()\n .to(\n isHorizontal\n ? { y: -(current - 1) * (pageHeight + spaceRow) }\n : { x: -(current - 1) * (pageWidth + spaceCol) },\n animationDuration,\n animationEasing\n );\n } else {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(current - 1) * (pageHeight + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(current - 1) * (pageWidth + spaceCol));\n }\n }\n };\n\n this._pager.addEventListener('toPrev', onPaging);\n this._pager.addEventListener('toNext', onPaging);\n\n return true;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target?.name?.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n const selected = legendItem.hasState(LegendStateValue.selected);\n\n if (selected) {\n // use selectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.selectedHover, e);\n } else {\n // use unSelectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.unSelectedHover, e);\n }\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', true);\n }\n\n this._dispatchEvent(LegendEvent.legendItemHover, legendItem, e);\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target?.name?.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n let attributeUpdate = false;\n if (\n legendItem.hasState(LegendStateValue.unSelectedHover) ||\n legendItem.hasState(LegendStateValue.selectedHover)\n ) {\n attributeUpdate = true;\n }\n legendItem.removeState(LegendStateValue.unSelectedHover);\n legendItem.removeState(LegendStateValue.selectedHover);\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: any) => {\n if (\n !attributeUpdate &&\n (child.hasState(LegendStateValue.unSelectedHover) || child.hasState(LegendStateValue.selectedHover))\n ) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(LegendStateValue.unSelectedHover);\n (child as unknown as IGraphic).removeState(LegendStateValue.selectedHover);\n });\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', false);\n }\n\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem, e);\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target?.name?.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 图例聚焦功能\n if (target.name === LEGEND_ELEMENT_NAME.focus) {\n const isFocusSelected = legendItem.hasState(LegendStateValue.focus);\n legendItem.toggleState(LegendStateValue.focus);\n\n if (isFocusSelected) {\n // 当前为选中态,则再次点击变成全选\n this._itemsContainer?.getChildren().forEach(item => {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.unSelected, LegendStateValue.unSelectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.selected, e);\n });\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n } else {\n // 清除 focus 状态\n this._itemsContainer?.getChildren().forEach(item => {\n (item as unknown as IGroup).removeState(LegendStateValue.focus);\n });\n const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;\n const isSelected = legendItem.hasState(LegendStateValue.selected);\n const currentSelectedItems = this._getSelectedLegends();\n if (selectMode === 'multiple') {\n if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {\n this._dispatchEvent(LegendEvent.legendItemClick, legendItem, e);\n return;\n }\n // 多选逻辑\n if (isSelected) {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(legendItem, [LegendStateValue.selected, LegendStateValue.selectedHover], e);\n this._setLegendItemState(legendItem, LegendStateValue.unSelected, e);\n } else {\n // 如果当前为非选中态,则设置为选中状态\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n }\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n }\n\n this._dispatchEvent(LegendEvent.legendItemClick, legendItem, e);\n }\n };\n\n private _setLegendItemState(legendItem: IGroup, stateName: string, e?: FederatedPointerEvent) {\n const keepCurrentStates = true;\n let attributeUpdate = false;\n if (!legendItem.hasState(stateName)) {\n attributeUpdate = true;\n }\n legendItem.addState(stateName, keepCurrentStates);\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: IGraphic) => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n if (!attributeUpdate && !child.hasState(stateName)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).addState(stateName, keepCurrentStates);\n }\n });\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n private _removeLegendItemState(legendItem: IGroup, stateNames: string[], e?: FederatedPointerEvent) {\n let attributeUpdate = false;\n stateNames.forEach(name => {\n if (!attributeUpdate && legendItem.hasState(name)) {\n attributeUpdate = true;\n }\n legendItem.removeState(name);\n });\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach(child => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n stateNames.forEach(name => {\n if (!attributeUpdate && (child as unknown as IGraphic).hasState(name)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(name);\n });\n }\n });\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n // 获取当前选中的图例项\n private _getSelectedLegends() {\n const selectedData: LegendItemDatum[] = [];\n this._itemsContainer?.getChildren().forEach(item => {\n if ((item as unknown as IGroup).hasState(LegendStateValue.selected)) {\n // @ts-ignore\n selectedData.push(item.data);\n }\n });\n\n return selectedData;\n }\n\n private _appendDataToShape(shape: any, name: string, data: any, delegateShape: any, states: any = {}) {\n shape.name = name;\n shape.data = data;\n shape.delegate = delegateShape;\n shape.states = merge({}, DEFAULT_STATES, states);\n }\n\n private _dispatchEvent(eventName: string, legendItem: any, event: FederatedPointerEvent) {\n const currentSelectedItems = this._getSelectedLegends();\n // 需要保持显示顺序\n currentSelectedItems.sort((pre: LegendItemDatum, next: LegendItemDatum) => pre.index - next.index);\n\n const currentSelected = currentSelectedItems.map((obj: LegendItemDatum) => obj.label);\n\n // 封装事件\n const changeEvent = new CustomEvent(eventName, {\n item: legendItem, // 当前被选中的图例项整体\n data: legendItem.data, // 当前图例项的数据\n selected: legendItem.hasState(LegendStateValue.selected), // 当前图例项是否被选中\n currentSelectedItems,\n currentSelected,\n event\n });\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n\n // 处理回调函数\n private _handleStyle(\n config: any,\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n items: LegendItemDatum[]\n ) {\n const newConfig = merge({}, config);\n // 处理下样式\n if (config.style && isFunction(config.style)) {\n newConfig.style = config.style(item, isSelected, index, items);\n }\n if (config.state) {\n Object.keys(config.state).forEach(key => {\n if (config.state[key] && isFunction(config.state[key])) {\n newConfig.state[key] = config.state[key](item, isSelected, index, items);\n }\n });\n }\n\n return newConfig;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/legend/discrete/discrete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,6CAAsH;AAWtH,yDAA4F;AAC5F,kCAAqC;AACrC,uCAAoC;AACpC,0CAYqB;AAGrB,MAAM,cAAc,GAAG;IACrB,CAAC,2BAAgB,CAAC,KAAK,CAAC,EAAE,EAAE;IAC5B,CAAC,2BAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC/B,CAAC,2BAAgB,CAAC,aAAa,CAAC,EAAE,EAAE;IACpC,CAAC,2BAAgB,CAAC,UAAU,CAAC,EAAE,EAAE;IACjC,CAAC,2BAAgB,CAAC,eAAe,CAAC,EAAE,EAAE;CACvC,CAAC;AAEF,MAAa,cAAe,SAAQ,iBAA+B;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AAS;aAClB;YACD,KAAK,EAAE;gBACL,aAAa,EAAE;oBACb,OAAO,EAAE,IAAI;iBACd;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;QACD,KAAK,EAAE;YACL,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,SAAS;aAClB;YACD,KAAK,EAAE;gBACL,aAAa,EAAE;oBACb,OAAO,EAAE,IAAI;iBACd;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,MAAM,EAAE,SAAS;aAClB;SACF;QACD,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE;YACd,IAAI,EAAE,6BAAkB;YACxB,UAAU,EACR,4pBAA4pB;YAC9pB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,SAAS;SAClB;KACF;IACD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,KAAK,EAAE,8BAAmB;QAC1B,OAAO,EAAE;YACP,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACnB,KAAK,EAAE,CAAC;SACT;KACF;IACD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,UAAU;IACtB,gBAAgB,EAAE,IAAI;CACvB,CAAC","file":"discrete.js","sourcesContent":["/**\n * @description 离散图例\n * @author 章伟星\n */\nimport { merge, isEmpty, normalizePadding, get, isValid, Dict, isBoolean, isNil, isFunction } from '@visactor/vutils';\nimport type {\n FederatedPointerEvent,\n IGroup,\n IGraphic,\n INode,\n IGroupGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { createGroup, createText, createSymbol, CustomEvent } from '@visactor/vrender-core';\nimport { LegendBase } from '../base';\nimport { Pager } from '../../pager';\nimport {\n DEFAULT_TITLE_SPACE,\n DEFAULT_ITEM_SPACE_COL,\n DEFAULT_ITEM_SPACE_ROW,\n DEFAULT_SHAPE_SPACE,\n DEFAULT_SHAPE_SIZE,\n DEFAULT_LABEL_SPACE,\n DEFAULT_PAGER_SPACE,\n LegendStateValue,\n DEFAULT_VALUE_SPACE,\n LegendEvent,\n LEGEND_ELEMENT_NAME\n} from '../constant';\nimport type { DiscreteLegendAttrs, LegendItem, LegendItemDatum } from './type';\n\nconst DEFAULT_STATES = {\n [LegendStateValue.focus]: {},\n [LegendStateValue.selected]: {},\n [LegendStateValue.selectedHover]: {},\n [LegendStateValue.unSelected]: {},\n [LegendStateValue.unSelectedHover]: {}\n};\n\nexport class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {\n name = 'discreteLegend';\n\n private _itemsContainer: IGroup | null = null;\n private _itemWidthByUser: number | undefined;\n private _itemHeightByUser: number | undefined = undefined;\n private _itemHeight = 0; // 存储每一个图例项的高度\n private _itemMaxWidth = 0; // 存储图例项的最大的宽度\n private _pager!: Pager;\n private _lastActiveItem: IGroup;\n\n static defaultAttributes: Partial<DiscreteLegendAttrs> = {\n layout: 'horizontal',\n title: {\n align: 'start',\n space: DEFAULT_TITLE_SPACE,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: DEFAULT_ITEM_SPACE_COL,\n spaceRow: DEFAULT_ITEM_SPACE_ROW,\n shape: {\n space: DEFAULT_SHAPE_SPACE,\n style: {\n size: DEFAULT_SHAPE_SIZE,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n opacity: 0.5\n }\n }\n },\n label: {\n space: DEFAULT_LABEL_SPACE,\n style: {\n fontSize: 12,\n fill: '#2C3542',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n }\n },\n focus: false,\n focusIconStyle: {\n size: DEFAULT_SHAPE_SIZE,\n symbolType:\n 'M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z',\n fill: '#333',\n cursor: 'pointer'\n }\n },\n autoPage: true,\n pager: {\n space: DEFAULT_PAGER_SPACE,\n handler: {\n style: { size: 10 },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: true\n };\n\n constructor(attributes: DiscreteLegendAttrs) {\n super(merge({}, DiscreteLegend.defaultAttributes, attributes));\n }\n\n /**\n * 更新选中数据\n * @param value 选中数据范围\n * @returns\n */\n setSelected(selectedData: (string | number)[]) {\n (this._itemsContainer?.getChildren() as IGroup[]).forEach(item => {\n // @ts-ignore\n const itemData = item.data as LegendItemDatum;\n if (selectedData.includes(itemData.label)) {\n this._setLegendItemState(item, LegendStateValue.selected);\n this._removeLegendItemState(item, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover]);\n } else {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(item, [LegendStateValue.selected, LegendStateValue.selectedHover]);\n this._setLegendItemState(item, LegendStateValue.unSelected);\n }\n });\n }\n\n protected _renderContent() {\n const { item = {}, items, reversed, maxCol = 1, maxRow = 2 } = this.attribute as DiscreteLegendAttrs;\n if (item.visible === false || isEmpty(items)) {\n return;\n }\n\n let legendItems = items;\n if (reversed) {\n legendItems = items?.reverse();\n }\n\n const itemsContainer = createGroup({\n x: 0,\n y: 0\n });\n this._itemsContainer = itemsContainer;\n\n const { layout, maxWidth, maxHeight, defaultSelected = [], autoPage } = this.attribute;\n const isHorizontal = layout === 'horizontal';\n\n const {\n spaceCol = DEFAULT_ITEM_SPACE_COL,\n spaceRow = DEFAULT_ITEM_SPACE_ROW,\n maxWidth: maxItemWidth,\n width: itemWidth,\n height: itemHeight\n } = item;\n\n // 根据用户声明的 maxItemWidth 和 itemWidth 获取图例项宽度\n if (isValid(maxItemWidth)) {\n if (isValid(itemWidth)) {\n this._itemWidthByUser = Math.min(maxItemWidth, itemWidth);\n } else {\n this._itemWidthByUser = maxItemWidth;\n }\n } else if (isValid(itemWidth)) {\n this._itemWidthByUser = itemWidth;\n }\n\n // 存储用户指定图例项高度\n if (isValid(itemHeight)) {\n this._itemHeightByUser = itemHeight;\n }\n let doWrap = false; // 水平布局换行标识\n let maxWidthInCol = 0; // 存储每一列最大的宽度,用于垂直布局的换列\n let startX = 0;\n let startY = 0;\n let maxPages = 1;\n let pages = 1;\n legendItems.forEach((item, index) => {\n if (!item.id) {\n item.id = item.label; // 如果没有设置 id,默认使用 label\n }\n item.index = index; // 用于维护图例的顺序\n\n const itemGroup = this._renderEachItem(\n item,\n isEmpty(defaultSelected) ? true : defaultSelected?.includes(item.label),\n index,\n legendItems\n );\n const itemWidth = itemGroup.attribute.width;\n const itemHeight = itemGroup.attribute.height;\n this._itemHeight = Math.max(this._itemHeight, itemHeight);\n maxWidthInCol = Math.max(itemWidth, maxWidthInCol);\n\n this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth);\n\n if (isHorizontal) {\n maxPages = maxRow;\n // 水平布局\n if (isValid(maxWidth)) {\n if (itemWidth >= maxWidth) {\n // 如果图例项本身就大于 maxWidth\n doWrap = true;\n if (index > 0) {\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n } else if (maxWidth < startX + itemWidth) {\n // 检测是否需要换行:如果用户声明了 maxWidth 并且超出了,则进行换行\n doWrap = true;\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + itemWidth;\n } else {\n maxPages = maxCol;\n // 垂直布局\n if (isValid(maxHeight) && maxHeight < startY + itemHeight) {\n // 检测是否换列:如果用户声明了 maxHeight 并且超出了,则进行换列\n doWrap = true;\n startY = 0;\n startX += maxWidthInCol + spaceCol;\n maxWidthInCol = 0;\n pages += 1;\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + itemHeight;\n }\n\n itemsContainer.add(itemGroup);\n });\n\n // TODO: 添加测试用例\n let pagerRendered = false;\n if (doWrap && autoPage && pages > maxPages) {\n // 进行分页处理\n pagerRendered = this._renderPager(isHorizontal);\n }\n\n if (!pagerRendered) {\n itemsContainer.setAttribute(\n 'y',\n this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0\n );\n this._innerView.add(itemsContainer);\n }\n }\n\n protected _bindEvents() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n if (!this._itemsContainer) {\n return;\n }\n\n const { hover = true, select = true } = this.attribute;\n if (hover) {\n this._itemsContainer.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._itemsContainer.addEventListener('pointerleave', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._itemsContainer.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _renderEachItem(item: LegendItemDatum, isSelected: boolean, index: number, items: LegendItemDatum[]) {\n const { id, label, value, shape } = item;\n const { padding = 0, focus, focusIconStyle = {} } = this.attribute.item as LegendItem;\n\n let {\n shape: shapeAttr = {},\n label: labelAttr = {},\n value: valueAttr = {},\n background = {}\n } = this.attribute.item as LegendItem;\n\n shapeAttr = this._handleStyle(shapeAttr, item, isSelected, index, items);\n labelAttr = this._handleStyle(labelAttr, item, isSelected, index, items);\n valueAttr = this._handleStyle(valueAttr, item, isSelected, index, items);\n background = this._handleStyle(background, item, isSelected, index, items);\n\n const parsedPadding = normalizePadding(padding);\n\n let itemGroup;\n if (background.visible === false) {\n itemGroup = createGroup({\n x: 0,\n y: 0,\n cursor: (background?.style as IGroupGraphicAttribute).cursor\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup);\n } else {\n itemGroup = createGroup({\n x: 0,\n y: 0,\n ...background?.style\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, background?.state);\n }\n itemGroup.id = `${id ?? label}-${index}`;\n\n itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n const innerGroup = createGroup({\n x: 0,\n y: 0,\n pickable: false\n });\n itemGroup.add(innerGroup);\n\n let focusStartX = 0;\n const shapeSize = get(shapeAttr, 'style.size', DEFAULT_SHAPE_SIZE);\n const shapeSpace = get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);\n const itemShape = createSymbol({\n x: 0,\n y: 0,\n symbolType: 'circle',\n strokeBoundsBuffer: 0,\n ...shape,\n ...shapeAttr.style\n });\n // 处理下 shape 的 fill stroke\n Object.keys(shapeAttr.state || {}).forEach(key => {\n const color =\n (shapeAttr.state[key] as ISymbolGraphicAttribute).fill ||\n (shapeAttr.state[key] as ISymbolGraphicAttribute).stroke;\n if (shape.fill && isNil((shapeAttr.state[key] as ISymbolGraphicAttribute).fill) && color) {\n (shapeAttr.state[key] as ISymbolGraphicAttribute).fill = color as string;\n }\n\n if (shape.stroke && isNil((shapeAttr.state[key] as ISymbolGraphicAttribute).stroke) && color) {\n (shapeAttr.state[key] as ISymbolGraphicAttribute).stroke = color as string;\n }\n });\n this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeAttr?.state);\n\n itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(itemShape);\n\n let focusShape;\n let focusSpace = 0;\n\n if (focus) {\n const focusSize = get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);\n // 绘制聚焦按钮\n focusShape = createSymbol({\n x: 0,\n y: -focusSize / 2 - 1,\n strokeBoundsBuffer: 0,\n ...focusIconStyle,\n visible: false,\n pickMode: 'imprecise',\n boundsPadding: parsedPadding\n });\n this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup);\n\n focusSpace = focusSize;\n }\n\n const labelShape = createText({\n x: shapeSize / 2 + shapeSpace,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (labelAttr?.style as ITextGraphicAttribute).fontSize,\n ...labelAttr?.style,\n text: labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label\n });\n this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelAttr?.state);\n labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(labelShape);\n const labelSpace = get(labelAttr, 'space', DEFAULT_LABEL_SPACE);\n if (isValid(value)) {\n const valueSpace = get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);\n const valueShape = createText({\n x: 0,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (valueAttr?.style as ITextGraphicAttribute).fontSize,\n ...valueAttr?.style,\n text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value\n });\n this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueAttr?.state);\n valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n if (this._itemWidthByUser) {\n // 计算用来防止文本的宽度\n const layoutWidth =\n this._itemWidthByUser -\n parsedPadding[1] -\n parsedPadding[3] -\n shapeSize -\n shapeSpace -\n labelSpace -\n focusSpace -\n valueSpace;\n const valueBounds = valueShape.AABBBounds;\n const labelBounds = labelShape.AABBBounds;\n const valueWidth = valueBounds.width();\n const labelWidth = labelBounds.width();\n if (labelWidth > layoutWidth) {\n if ((layoutWidth - valueWidth) / labelWidth > 0.4) {\n // 设置一个值,如果剩余的宽度和 label 自身的比例不低于 0.4 的话,优先展示全 label\n labelShape.setAttribute('maxLineWidth', layoutWidth - valueWidth);\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n labelShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n }\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth - labelWidth);\n }\n\n if (valueAttr.alignRight) {\n valueShape.setAttributes({\n // @ts-ignore\n textAlign: 'right',\n x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace\n });\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n focusStartX = valueShape.AABBBounds.x2 + valueSpace;\n\n innerGroup.add(valueShape);\n } else if (this._itemWidthByUser) {\n labelShape.setAttribute(\n 'maxLineWidth',\n this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace\n );\n\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n } else {\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n }\n\n if (focusShape) {\n focusShape.setAttribute('x', focusStartX);\n innerGroup.add(focusShape);\n }\n\n const innerGroupBounds = innerGroup.AABBBounds;\n const innerGroupWidth = innerGroupBounds.width();\n const innerGroupHeight = innerGroupBounds.height();\n const itemGroupWidth = isValid(this.attribute.item.width)\n ? this.attribute.item.width\n : innerGroupWidth + parsedPadding[1] + parsedPadding[3];\n const itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];\n itemGroup.attribute.width = itemGroupWidth;\n itemGroup.attribute.height = itemGroupHeight;\n\n innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]);\n return itemGroup;\n }\n\n private _renderPager(isHorizontal: boolean) {\n const renderStartY = this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0;\n const { maxWidth, maxHeight, maxCol = 1, maxRow = 2, item = {}, pager = {}, disableTriggerEvent } = this.attribute;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = item;\n const itemsContainer = this._itemsContainer as IGroup;\n const {\n animation = true,\n animationDuration = 450,\n animationEasing = 'quadIn',\n space: pagerSpace = DEFAULT_PAGER_SPACE,\n ...pageStyle\n } = pager;\n\n let pagerComp: Pager;\n let pageHeight = 0; // 每页的高度\n let pageWidth = 0; // 每页的宽度\n let startX = 0; // 临时变量,用来存储布局的起始点\n let startY = 0; // 临时变量,用来存储布局的起始点\n let pages = 1; // 页数\n\n if (isHorizontal) {\n // 水平布局,支持上下翻页\n pagerComp = new Pager({\n layout: maxRow === 1 ? 'horizontal' : 'vertical',\n total: 99,\n ...merge(\n {\n handler: {\n preShape: 'triangleUp',\n nextShape: 'triangleDown'\n }\n },\n pageStyle\n ),\n disableTriggerEvent\n });\n this._pager = pagerComp;\n this._innerView.add(pagerComp as unknown as INode);\n pageHeight = (maxRow - 1) * spaceRow + this._itemHeight * maxRow;\n pageWidth = (maxWidth as number) - pagerComp.AABBBounds.width() - pagerSpace;\n\n if (pageWidth <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(pagerComp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { width, height } = item.attribute;\n\n if (pageWidth < startX + (width as number)) {\n // 超出了,则换行\n startX = 0;\n startY += (height as number) + spaceRow;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + (width as number);\n });\n\n pagerComp.setAttributes({\n total: Math.ceil(pages / maxRow),\n x: pageWidth,\n y: renderStartY + pageHeight / 2 - pagerComp.AABBBounds.height() / 2\n });\n } else {\n // 垂直布局,支持左右翻页\n pagerComp = new Pager({\n layout: 'horizontal',\n total: 99, // 用于估算,\n disableTriggerEvent,\n ...pageStyle\n });\n this._pager = pagerComp;\n this._innerView.add(pagerComp as unknown as INode);\n\n pageWidth = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol;\n pageHeight = (maxHeight as number) - pagerComp.AABBBounds.height() - pagerSpace - renderStartY;\n\n if (pageHeight <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(pagerComp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { height } = item.attribute;\n if (pageHeight < startY + (height as number)) {\n startY = 0;\n startX += this._itemMaxWidth + spaceCol;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + (height as number);\n });\n\n pagerComp.setAttributes({\n total: Math.ceil(pages / maxCol),\n x: (pageWidth - pagerComp.AABBBounds.width()) / 2,\n y: (maxHeight as number) - pagerComp.AABBBounds.height()\n });\n }\n\n // 初始化 defaultCurrent\n if (pager.defaultCurrent > 1) {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(pager.defaultCurrent - 1) * (pageHeight + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(pager.defaultCurrent - 1) * (pageWidth + spaceCol));\n }\n }\n\n const clipGroup = createGroup({\n x: 0,\n y: renderStartY,\n width: pageWidth,\n height: pageHeight,\n clip: true,\n pickable: false\n });\n clipGroup.add(itemsContainer);\n this._innerView.add(clipGroup);\n\n const onPaging = (e: CustomEvent) => {\n const { current } = e.detail;\n\n if (animation) {\n itemsContainer\n .animate()\n .to(\n isHorizontal\n ? { y: -(current - 1) * (pageHeight + spaceRow) }\n : { x: -(current - 1) * (pageWidth + spaceCol) },\n animationDuration,\n animationEasing\n );\n } else {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(current - 1) * (pageHeight + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(current - 1) * (pageWidth + spaceCol));\n }\n }\n };\n\n this._pager.addEventListener('toPrev', onPaging);\n this._pager.addEventListener('toNext', onPaging);\n\n return true;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target?.name?.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 如果上个激活元素存在,则判断当前元素是否和上个激活元素相同,相同则不做处理,不相同则触发 unhover\n if (this._lastActiveItem) {\n if (this._lastActiveItem.id === legendItem.id) {\n return;\n }\n this._unHover(this._lastActiveItem, e);\n }\n this._hover(legendItem, e);\n } else if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target?.name?.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 图例聚焦功能\n if (target.name === LEGEND_ELEMENT_NAME.focus) {\n const isFocusSelected = legendItem.hasState(LegendStateValue.focus);\n legendItem.toggleState(LegendStateValue.focus);\n\n if (isFocusSelected) {\n // 当前为选中态,则再次点击变成全选\n this._itemsContainer?.getChildren().forEach(item => {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.unSelected, LegendStateValue.unSelectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.selected, e);\n });\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n } else {\n // 清除 focus 状态\n this._itemsContainer?.getChildren().forEach(item => {\n (item as unknown as IGroup).removeState(LegendStateValue.focus);\n });\n const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;\n const isSelected = legendItem.hasState(LegendStateValue.selected);\n const currentSelectedItems = this._getSelectedLegends();\n if (selectMode === 'multiple') {\n if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {\n this._dispatchEvent(LegendEvent.legendItemClick, legendItem, e);\n return;\n }\n // 多选逻辑\n if (isSelected) {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(legendItem, [LegendStateValue.selected, LegendStateValue.selectedHover], e);\n this._setLegendItemState(legendItem, LegendStateValue.unSelected, e);\n } else {\n // 如果当前为非选中态,则设置为选中状态\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n }\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n }\n\n this._dispatchEvent(LegendEvent.legendItemClick, legendItem, e);\n }\n };\n\n private _hover(legendItem: IGroup, e: FederatedPointerEvent) {\n this._lastActiveItem = legendItem;\n const selected = legendItem.hasState(LegendStateValue.selected);\n\n if (selected) {\n // use selectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.selectedHover, e);\n } else {\n // use unSelectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.unSelectedHover, e);\n }\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', true);\n }\n\n this._dispatchEvent(LegendEvent.legendItemHover, legendItem, e);\n }\n\n private _unHover(legendItem: IGroup, e: FederatedPointerEvent) {\n let attributeUpdate = false;\n if (legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) {\n attributeUpdate = true;\n }\n legendItem.removeState(LegendStateValue.unSelectedHover);\n legendItem.removeState(LegendStateValue.selectedHover);\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: any) => {\n if (\n !attributeUpdate &&\n (child.hasState(LegendStateValue.unSelectedHover) || child.hasState(LegendStateValue.selectedHover))\n ) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(LegendStateValue.unSelectedHover);\n (child as unknown as IGraphic).removeState(LegendStateValue.selectedHover);\n });\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', false);\n }\n\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n this._dispatchEvent(LegendEvent.legendItemUnHover, legendItem, e);\n }\n\n private _setLegendItemState(legendItem: IGroup, stateName: string, e?: FederatedPointerEvent) {\n const keepCurrentStates = true;\n let attributeUpdate = false;\n if (!legendItem.hasState(stateName)) {\n attributeUpdate = true;\n }\n legendItem.addState(stateName, keepCurrentStates);\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: IGraphic) => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n if (!attributeUpdate && !child.hasState(stateName)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).addState(stateName, keepCurrentStates);\n }\n });\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n private _removeLegendItemState(legendItem: IGroup, stateNames: string[], e?: FederatedPointerEvent) {\n let attributeUpdate = false;\n stateNames.forEach(name => {\n if (!attributeUpdate && legendItem.hasState(name)) {\n attributeUpdate = true;\n }\n legendItem.removeState(name);\n });\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach(child => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n stateNames.forEach(name => {\n if (!attributeUpdate && (child as unknown as IGraphic).hasState(name)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(name);\n });\n }\n });\n if (attributeUpdate) {\n this._dispatchEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n // 获取当前选中的图例项\n private _getSelectedLegends() {\n const selectedData: LegendItemDatum[] = [];\n this._itemsContainer?.getChildren().forEach(item => {\n if ((item as unknown as IGroup).hasState(LegendStateValue.selected)) {\n // @ts-ignore\n selectedData.push(item.data);\n }\n });\n\n return selectedData;\n }\n\n private _appendDataToShape(shape: any, name: string, data: any, delegateShape: any, states: any = {}) {\n shape.name = name;\n shape.data = data;\n shape.delegate = delegateShape;\n shape.states = merge({}, DEFAULT_STATES, states);\n }\n\n private _dispatchEvent(eventName: string, legendItem: any, event: FederatedPointerEvent) {\n const currentSelectedItems = this._getSelectedLegends();\n // 需要保持显示顺序\n currentSelectedItems.sort((pre: LegendItemDatum, next: LegendItemDatum) => pre.index - next.index);\n\n const currentSelected = currentSelectedItems.map((obj: LegendItemDatum) => obj.label);\n\n // 封装事件\n const changeEvent = new CustomEvent(eventName, {\n item: legendItem, // 当前被选中的图例项整体\n data: legendItem.data, // 当前图例项的数据\n selected: legendItem.hasState(LegendStateValue.selected), // 当前图例项是否被选中\n currentSelectedItems,\n currentSelected,\n event\n });\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n\n // 处理回调函数\n private _handleStyle(\n config: any,\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n items: LegendItemDatum[]\n ) {\n const newConfig = merge({}, config);\n // 处理下样式\n if (config.style && isFunction(config.style)) {\n newConfig.style = config.style(item, isSelected, index, items);\n }\n if (config.state) {\n Object.keys(config.state).forEach(key => {\n if (config.state[key] && isFunction(config.state[key])) {\n newConfig.state[key] = config.state[key](item, isSelected, index, items);\n }\n });\n }\n\n return newConfig;\n }\n}\n"]}
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=type.js.map
6
+ //# sourceMappingURL=type.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=type.js.map
6
+ //# sourceMappingURL=type.js.map
package/dist/index.js CHANGED
@@ -27820,51 +27820,23 @@
27820
27820
  const target = e.target;
27821
27821
  if ((_a = target === null || target === void 0 ? void 0 : target.name) === null || _a === void 0 ? void 0 : _a.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
27822
27822
  const legendItem = target.delegate;
27823
- const selected = legendItem.hasState(exports.LegendStateValue.selected);
27824
- if (selected) {
27825
- this._setLegendItemState(legendItem, exports.LegendStateValue.selectedHover, e);
27826
- }
27827
- else {
27828
- this._setLegendItemState(legendItem, exports.LegendStateValue.unSelectedHover, e);
27829
- }
27830
- const focusButton = legendItem.getChildren()[0].find(node => node.name === exports.LEGEND_ELEMENT_NAME.focus, false);
27831
- if (focusButton) {
27832
- focusButton.setAttribute('visible', true);
27823
+ if (this._lastActiveItem) {
27824
+ if (this._lastActiveItem.id === legendItem.id) {
27825
+ return;
27826
+ }
27827
+ this._unHover(this._lastActiveItem, e);
27833
27828
  }
27834
- this._dispatchEvent(exports.LegendEvent.legendItemHover, legendItem, e);
27829
+ this._hover(legendItem, e);
27830
+ }
27831
+ else if (this._lastActiveItem) {
27832
+ this._unHover(this._lastActiveItem, e);
27833
+ this._lastActiveItem = null;
27835
27834
  }
27836
27835
  };
27837
27836
  this._onUnHover = (e) => {
27838
- var _a;
27839
- const target = e.target;
27840
- if ((_a = target === null || target === void 0 ? void 0 : target.name) === null || _a === void 0 ? void 0 : _a.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
27841
- const legendItem = target.delegate;
27842
- let attributeUpdate = false;
27843
- if (legendItem.hasState(exports.LegendStateValue.unSelectedHover) ||
27844
- legendItem.hasState(exports.LegendStateValue.selectedHover)) {
27845
- attributeUpdate = true;
27846
- }
27847
- legendItem.removeState(exports.LegendStateValue.unSelectedHover);
27848
- legendItem.removeState(exports.LegendStateValue.selectedHover);
27849
- legendItem
27850
- .getChildren()[0]
27851
- .getChildren()
27852
- .forEach((child) => {
27853
- if (!attributeUpdate &&
27854
- (child.hasState(exports.LegendStateValue.unSelectedHover) || child.hasState(exports.LegendStateValue.selectedHover))) {
27855
- attributeUpdate = true;
27856
- }
27857
- child.removeState(exports.LegendStateValue.unSelectedHover);
27858
- child.removeState(exports.LegendStateValue.selectedHover);
27859
- });
27860
- const focusButton = legendItem.getChildren()[0].find(node => node.name === exports.LEGEND_ELEMENT_NAME.focus, false);
27861
- if (focusButton) {
27862
- focusButton.setAttribute('visible', false);
27863
- }
27864
- if (attributeUpdate) {
27865
- this._dispatchEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
27866
- }
27867
- this._dispatchEvent(exports.LegendEvent.legendItemUnHover, legendItem, e);
27837
+ if (this._lastActiveItem) {
27838
+ this._unHover(this._lastActiveItem, e);
27839
+ this._lastActiveItem = null;
27868
27840
  }
27869
27841
  };
27870
27842
  this._onClick = (e) => {
@@ -28054,7 +28026,7 @@
28054
28026
  const { hover = true, select = true } = this.attribute;
28055
28027
  if (hover) {
28056
28028
  this._itemsContainer.addEventListener('pointermove', this._onHover);
28057
- this._itemsContainer.addEventListener('pointerout', this._onUnHover);
28029
+ this._itemsContainer.addEventListener('pointerleave', this._onUnHover);
28058
28030
  }
28059
28031
  if (select) {
28060
28032
  this._itemsContainer.addEventListener('pointerdown', this._onClick);
@@ -28082,6 +28054,7 @@
28082
28054
  itemGroup = createGroup(Object.assign({ x: 0, y: 0 }, background === null || background === void 0 ? void 0 : background.style));
28083
28055
  this._appendDataToShape(itemGroup, exports.LEGEND_ELEMENT_NAME.item, item, itemGroup, background === null || background === void 0 ? void 0 : background.state);
28084
28056
  }
28057
+ itemGroup.id = `${id !== null && id !== void 0 ? id : label}-${index}`;
28085
28058
  itemGroup.addState(isSelected ? exports.LegendStateValue.selected : exports.LegendStateValue.unSelected);
28086
28059
  const innerGroup = createGroup({
28087
28060
  x: 0,
@@ -28307,6 +28280,48 @@
28307
28280
  this._pager.addEventListener('toNext', onPaging);
28308
28281
  return true;
28309
28282
  }
28283
+ _hover(legendItem, e) {
28284
+ this._lastActiveItem = legendItem;
28285
+ const selected = legendItem.hasState(exports.LegendStateValue.selected);
28286
+ if (selected) {
28287
+ this._setLegendItemState(legendItem, exports.LegendStateValue.selectedHover, e);
28288
+ }
28289
+ else {
28290
+ this._setLegendItemState(legendItem, exports.LegendStateValue.unSelectedHover, e);
28291
+ }
28292
+ const focusButton = legendItem.getChildren()[0].find(node => node.name === exports.LEGEND_ELEMENT_NAME.focus, false);
28293
+ if (focusButton) {
28294
+ focusButton.setAttribute('visible', true);
28295
+ }
28296
+ this._dispatchEvent(exports.LegendEvent.legendItemHover, legendItem, e);
28297
+ }
28298
+ _unHover(legendItem, e) {
28299
+ let attributeUpdate = false;
28300
+ if (legendItem.hasState(exports.LegendStateValue.unSelectedHover) || legendItem.hasState(exports.LegendStateValue.selectedHover)) {
28301
+ attributeUpdate = true;
28302
+ }
28303
+ legendItem.removeState(exports.LegendStateValue.unSelectedHover);
28304
+ legendItem.removeState(exports.LegendStateValue.selectedHover);
28305
+ legendItem
28306
+ .getChildren()[0]
28307
+ .getChildren()
28308
+ .forEach((child) => {
28309
+ if (!attributeUpdate &&
28310
+ (child.hasState(exports.LegendStateValue.unSelectedHover) || child.hasState(exports.LegendStateValue.selectedHover))) {
28311
+ attributeUpdate = true;
28312
+ }
28313
+ child.removeState(exports.LegendStateValue.unSelectedHover);
28314
+ child.removeState(exports.LegendStateValue.selectedHover);
28315
+ });
28316
+ const focusButton = legendItem.getChildren()[0].find(node => node.name === exports.LEGEND_ELEMENT_NAME.focus, false);
28317
+ if (focusButton) {
28318
+ focusButton.setAttribute('visible', false);
28319
+ }
28320
+ if (attributeUpdate) {
28321
+ this._dispatchEvent(exports.LegendEvent.legendItemAttributeUpdate, legendItem, e);
28322
+ }
28323
+ this._dispatchEvent(exports.LegendEvent.legendItemUnHover, legendItem, e);
28324
+ }
28310
28325
  _setLegendItemState(legendItem, stateName, e) {
28311
28326
  const keepCurrentStates = true;
28312
28327
  let attributeUpdate = false;
@@ -31494,7 +31509,7 @@
31494
31509
  }
31495
31510
  };
31496
31511
 
31497
- const version = "0.16.14";
31512
+ const version = "0.16.15";
31498
31513
 
31499
31514
  exports.AbstractComponent = AbstractComponent;
31500
31515
  exports.ArcInfo = ArcInfo;