@visactor/vrender-components 0.21.11 → 0.21.12

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/title/title.ts"],"names":[],"mappings":";;;AAIA,6CAA6E;AAC7E,uCAAiD;AAGjD,0CAAqD;AACrD,yCAAgD;AAEhD,IAAA,6BAAkB,GAAE,CAAC;AACrB,MAAa,KAAM,SAAQ,wBAAuC;IAyBhE,YAAY,UAAsB,EAAE,OAA0B;QAC5D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB5F,SAAI,GAAG,OAAO,CAAC;IA0Bf,CAAC;IAES,MAAM;;QACd,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,GAAG,EAAE,EACd,OAAO,EACP,YAAY,GAAG,EAAE,EACjB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,KAAK,EACL,aAAa,EACb,OAAO,GAAG,CAAC,EACZ,GAAG,IAAI,CAAC,SAAuB,CAAC;QAEjC,MAAM,aAAa,GAAG,IAAA,yBAAgB,EAAC,OAAO,CAAC,CAAC;QAEhD,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CACpC,iBAAiB,EACjB,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACvD,OAAO,CACE,CAAC;QAEZ,MAAM,oBAAoB,GAAG,MAAA,SAAS,CAAC,MAAM,mCAAI,MAAM,CAAC;QACxD,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,KAAK,KAAK,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B;IAC9C,SAAS,EAAE;QACT,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;CACF,CAAC","file":"title.js","sourcesContent":["/**\n * @description 标题组件\n */\nimport type { IGroup, IText, IRichText, IRichTextCharacter } from '@visactor/vrender-core';\nimport { merge, isValid, normalizePadding, isArray } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { TitleAttrs } from './type';\nimport type { ComponentOptions } from '../interface';\nimport { DEFAULT_HTML_TEXT_SPEC } from '../constant';\nimport { loadTitleComponent } from './register';\n\nloadTitleComponent();\nexport class Title extends AbstractComponent<Required<TitleAttrs>> {\n name = 'title';\n\n private _mainTitle?: IText | IRichText;\n private _subTitle?: IText | IRichText;\n\n static defaultAttributes: Partial<TitleAttrs> = {\n textStyle: {\n ellipsis: '...',\n fill: '#333',\n fontSize: 20,\n fontWeight: 'bold',\n textAlign: 'left',\n textBaseline: 'top'\n },\n subtextStyle: {\n ellipsis: '...',\n fill: '#6F6F6F',\n fontSize: 16,\n fontWeight: 'normal',\n textAlign: 'left',\n textBaseline: 'top'\n }\n };\n\n constructor(attributes: TitleAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, Title.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n textType,\n text,\n subtextType,\n textStyle = {},\n subtext,\n subtextStyle = {},\n width,\n height,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n align,\n verticalAlign,\n padding = 0\n } = this.attribute as TitleAttrs;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild(\n 'title-container',\n { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 },\n 'group'\n ) as IGroup;\n\n const fixedMainTitleHeight = textStyle.height ?? height;\n if (this.attribute.visible !== false && textStyle.visible !== false) {\n const {\n width: mainTitleWidth,\n maxHeight: mainTitleMaxHeight,\n maxWidth: mainTitleMaxWidth,\n x = 0,\n y = 0,\n ellipsis = true,\n wordBreak = 'break-word',\n maxWidth,\n lineClamp\n } = textStyle;\n if (textType === 'rich' || isValid(textStyle.character)) {\n const attr = {\n x,\n y,\n width: mainTitleWidth ?? width ?? 0,\n height: fixedMainTitleHeight ?? 0,\n ellipsis: ellipsis ?? true,\n wordBreak: wordBreak ?? 'break-word',\n maxHeight: mainTitleMaxHeight ?? maxHeight,\n maxWidth: mainTitleMaxWidth ?? maxWidth,\n // 兼容旧版富文本配置,如果未设置textType === 'rich',text内容为string 易报错\n textConfig: textStyle.character ?? (text as IRichTextCharacter[]),\n ...textStyle\n };\n this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext') as IRichText;\n } else if (textType === 'html') {\n const attr = {\n html: {\n dom: text as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...textStyle\n },\n x,\n y,\n width: mainTitleWidth ?? width ?? 0,\n height: fixedMainTitleHeight ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: mainTitleMaxHeight ?? maxHeight,\n maxWidth: mainTitleMaxWidth ?? maxWidth,\n textConfig: [] as any[],\n ...textStyle\n };\n this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext') as IRichText;\n } else if (isValid(text)) {\n this._mainTitle = group.createOrUpdateChild(\n 'mainTitle',\n {\n text: isArray(text) ? (text as any) : [text as string],\n whiteSpace: 'normal',\n ...textStyle,\n maxLineWidth: textStyle.maxLineWidth ?? mainTitleWidth ?? width,\n heightLimit: textStyle.height ?? maxHeight,\n lineClamp,\n ellipsis,\n x,\n y\n },\n 'text'\n ) as IText;\n }\n }\n\n const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;\n const mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;\n\n // 目前 height 限制等于 0 时,相当于 Infinity,无限制\n\n if (this.attribute.visible !== false && subtextStyle.visible !== false) {\n const {\n width: subTitleWidth,\n height: subTitleHeight,\n maxWidth: subTitleMaxWidth,\n maxHeight: subTitleMaxHeight,\n x = 0,\n y = 0,\n ellipsis = true,\n wordBreak = 'break-word',\n lineClamp\n } = subtextStyle;\n const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);\n\n if (subtextType === 'rich' || isValid(subtextStyle.character)) {\n const attr: any = {\n x,\n y,\n width: subTitleWidth ?? width ?? 0,\n height: subTitleHeight ?? height ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: subTitleMaxHeight ?? maxSubTextHeight,\n maxWidth: subTitleMaxWidth ?? maxWidth,\n // 兼容旧版富文本配置,如果未设置textType === 'rich',text内容为string 易报错\n textConfig: subtextStyle.character ?? (subtext as IRichTextCharacter[]),\n ...subtextStyle\n };\n this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext') as IRichText;\n } else if (subtextType === 'html') {\n const attr: any = {\n html: {\n dom: subtext as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...subtextStyle\n },\n x,\n y,\n width: subTitleWidth ?? width ?? 0,\n height: subTitleHeight ?? height ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: subTitleMaxHeight ?? maxSubTextHeight,\n maxWidth: subTitleMaxWidth ?? maxWidth,\n textConfig: [] as any[],\n ...subtextStyle\n };\n this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext') as IRichText;\n } else if (isValid(subtext)) {\n this._subTitle = group.createOrUpdateChild(\n 'subTitle',\n {\n text: isArray(subtext) ? (subtext as any) : [subtext as string],\n whiteSpace: 'normal',\n ...subtextStyle,\n maxLineWidth: subtextStyle.maxLineWidth ?? width,\n heightLimit: subtextStyle.heightLimit ?? maxSubTextHeight,\n lineClamp,\n ellipsis,\n x: 0,\n y: mainTextBoundsHeight\n },\n 'text'\n ) as IText;\n }\n }\n\n const subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;\n const subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;\n\n // 设置宽高\n let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth);\n let totalHeight = mainTextBoundsHeight + (subtextStyle.height ?? subTextBoundsHeight);\n\n if (isValid(width)) {\n totalWidth = width;\n }\n\n if (isValid(height)) {\n totalHeight = height;\n }\n\n if (isValid(minWidth) && totalWidth < minWidth) {\n totalWidth = minWidth;\n }\n if (isValid(maxWidth)) {\n if (totalWidth > maxWidth) {\n totalWidth = maxWidth;\n }\n }\n\n if (isValid(minHeight) && totalHeight < minHeight) {\n totalHeight = minHeight;\n }\n\n if (isValid(maxHeight)) {\n if (totalHeight > maxHeight) {\n totalHeight = maxHeight;\n }\n }\n\n group.attribute.width = totalWidth;\n group.attribute.height = totalHeight;\n group.attribute.boundsPadding = parsedPadding;\n\n // 设置对齐\n if (this._mainTitle) {\n if (isValid(align) || isValid(textStyle.align)) {\n const mainTitleAlign = textStyle.align ? textStyle.align : align;\n const mainTitleWidth = textStyle.width ?? totalWidth;\n if (mainTitleAlign === 'center') {\n this._mainTitle.setAttribute('x', mainTitleWidth / 2);\n this._mainTitle.setAttribute('textAlign', 'center');\n } else if (mainTitleAlign === 'right') {\n this._mainTitle.setAttribute('x', mainTitleWidth);\n this._mainTitle.setAttribute('textAlign', 'right');\n } else {\n this._mainTitle.setAttribute('x', 0);\n this._mainTitle.setAttribute('textAlign', 'left');\n }\n }\n\n if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {\n const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;\n if (mainTitleVerticalAlign === 'middle' && isValid(fixedMainTitleHeight)) {\n this._mainTitle.setAttribute('y', fixedMainTitleHeight / 2);\n this._mainTitle.setAttribute('textBaseline', 'middle');\n } else if (mainTitleVerticalAlign === 'bottom' && isValid(fixedMainTitleHeight)) {\n this._mainTitle.setAttribute('y', fixedMainTitleHeight);\n this._mainTitle.setAttribute('textBaseline', 'bottom');\n } else {\n this._mainTitle.setAttribute('y', 0);\n this._mainTitle.setAttribute('textBaseline', 'top');\n }\n }\n }\n\n if (this._subTitle) {\n if (isValid(align) || isValid(subtextStyle.align)) {\n const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;\n // 当subText没有设置显示的宽度,但是mainText设置了显示的宽度的时候,为mainText为主,因为默认subText要和mainText对齐\n const subTitleWidth = subtextStyle.width ?? textStyle.width ?? totalWidth;\n if (subTitleAlign === 'center') {\n this._subTitle.setAttribute('x', subTitleWidth / 2);\n this._subTitle.setAttribute('textAlign', 'center');\n } else if (subTitleAlign === 'right') {\n this._subTitle.setAttribute('x', subTitleWidth);\n this._subTitle.setAttribute('textAlign', 'right');\n } else {\n this._subTitle.setAttribute('x', 0);\n this._subTitle.setAttribute('textAlign', 'left');\n }\n }\n\n if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {\n const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;\n const subTitleYStart = this._mainTitle\n ? isValid(fixedMainTitleHeight)\n ? // 如果是用户指定的高度,根据bounds的height 和指定高度求最大值\n this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)\n : this._mainTitle.AABBBounds.y2\n : 0;\n const subTitleHeight = subtextStyle.height ?? height;\n if (subTitleVerticalAlign === 'middle' && isValid(subTitleHeight)) {\n this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);\n this._subTitle.setAttribute('textBaseline', 'middle');\n } else if (subTitleVerticalAlign === 'bottom' && isValid(subTitleHeight)) {\n this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);\n this._subTitle.setAttribute('textBaseline', 'bottom');\n } else {\n this._subTitle.setAttribute('y', subTitleYStart);\n this._subTitle.setAttribute('textBaseline', 'top');\n }\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/title/title.ts"],"names":[],"mappings":";;;AAIA,6CAA6E;AAC7E,uCAAiD;AAGjD,0CAAqD;AACrD,yCAAgD;AAGhD,IAAA,6BAAkB,GAAE,CAAC;AACrB,MAAa,KAAM,SAAQ,wBAAuC;IAyBhE,YAAY,UAAsB,EAAE,OAA0B;QAC5D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB5F,SAAI,GAAG,OAAO,CAAC;IA0Bf,CAAC;IAES,MAAM;;QACd,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,GAAG,EAAE,EACd,OAAO,EACP,YAAY,GAAG,EAAE,EACjB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,KAAK,EACL,aAAa,EACb,OAAO,GAAG,CAAC,EACZ,GAAG,IAAI,CAAC,SAAuB,CAAC;QAEjC,MAAM,aAAa,GAAG,IAAA,yBAAgB,EAAC,OAAO,CAAC,CAAC;QAEhD,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CACpC,iBAAiB,EACjB,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACvD,OAAO,CACE,CAAC;QAEZ,MAAM,oBAAoB,GAAG,MAAA,SAAS,CAAC,MAAM,mCAAI,MAAM,CAAC;QACxD,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,KAAK,KAAK,IAAI,SAAS,CAAC,OAAO,KAAK,KAAK,EAAE;YACnE,MAAM,E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H,CAAC;;AAjTH,sBAkTC;AA5SQ,uBAAiB,GAAwB;IAC9C,SAAS,EAAE;QACT,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;CACF,CAAC","file":"title.js","sourcesContent":["/**\n * @description 标题组件\n */\nimport type { IGroup, IText, IRichText, IRichTextCharacter } from '@visactor/vrender-core';\nimport { merge, isValid, normalizePadding, isArray } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { TitleAttrs } from './type';\nimport type { ComponentOptions } from '../interface';\nimport { DEFAULT_HTML_TEXT_SPEC } from '../constant';\nimport { loadTitleComponent } from './register';\nimport { Text } from '@visactor/vrender-core';\n\nloadTitleComponent();\nexport class Title extends AbstractComponent<Required<TitleAttrs>> {\n name = 'title';\n\n private _mainTitle?: IText | IRichText;\n private _subTitle?: IText | IRichText;\n\n static defaultAttributes: Partial<TitleAttrs> = {\n textStyle: {\n ellipsis: '...',\n fill: '#333',\n fontSize: 20,\n fontWeight: 'bold',\n textAlign: 'left',\n textBaseline: 'top'\n },\n subtextStyle: {\n ellipsis: '...',\n fill: '#6F6F6F',\n fontSize: 16,\n fontWeight: 'normal',\n textAlign: 'left',\n textBaseline: 'top'\n }\n };\n\n constructor(attributes: TitleAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, Title.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n textType,\n text,\n subtextType,\n textStyle = {},\n subtext,\n subtextStyle = {},\n width,\n height,\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n align,\n verticalAlign,\n padding = 0\n } = this.attribute as TitleAttrs;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild(\n 'title-container',\n { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 },\n 'group'\n ) as IGroup;\n\n const fixedMainTitleHeight = textStyle.height ?? height;\n if (this.attribute.visible !== false && textStyle.visible !== false) {\n const {\n width: mainTitleWidth,\n maxHeight: mainTitleMaxHeight,\n maxWidth: mainTitleMaxWidth,\n x = 0,\n y = 0,\n ellipsis = true,\n wordBreak = 'break-word',\n maxWidth,\n lineClamp\n } = textStyle;\n if (textType === 'rich' || isValid(textStyle.character)) {\n const attr = {\n x,\n y,\n width: mainTitleWidth ?? width ?? 0,\n height: fixedMainTitleHeight ?? 0,\n ellipsis: ellipsis ?? true,\n wordBreak: wordBreak ?? 'break-word',\n maxHeight: mainTitleMaxHeight ?? maxHeight,\n maxWidth: mainTitleMaxWidth ?? maxWidth,\n // 兼容旧版富文本配置,如果未设置textType === 'rich',text内容为string 易报错\n textConfig: textStyle.character ?? (text as IRichTextCharacter[]),\n ...textStyle\n };\n this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext') as IRichText;\n } else if (textType === 'html') {\n const attr = {\n html: {\n dom: text as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...textStyle\n },\n x,\n y,\n width: mainTitleWidth ?? width ?? 0,\n height: fixedMainTitleHeight ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: mainTitleMaxHeight ?? maxHeight,\n maxWidth: mainTitleMaxWidth ?? maxWidth,\n textConfig: [] as any[],\n ...textStyle\n };\n this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext') as IRichText;\n } else if (isValid(text)) {\n this._mainTitle = group.createOrUpdateChild(\n 'mainTitle',\n {\n text: isArray(text) ? (text as any) : [text as string],\n whiteSpace: 'normal',\n ...textStyle,\n maxLineWidth: textStyle.maxLineWidth ?? mainTitleWidth ?? width,\n heightLimit: textStyle.height ?? maxHeight,\n lineClamp,\n ellipsis,\n x,\n y\n },\n 'text'\n ) as IText;\n }\n }\n\n const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;\n const mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;\n\n // 目前 height 限制等于 0 时,相当于 Infinity,无限制\n\n if (this.attribute.visible !== false && subtextStyle.visible !== false) {\n const {\n width: subTitleWidth,\n height: subTitleHeight,\n maxWidth: subTitleMaxWidth,\n maxHeight: subTitleMaxHeight,\n x = 0,\n y = 0,\n ellipsis = true,\n wordBreak = 'break-word',\n lineClamp\n } = subtextStyle;\n const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);\n\n if (subtextType === 'rich' || isValid(subtextStyle.character)) {\n const attr: any = {\n x,\n y,\n width: subTitleWidth ?? width ?? 0,\n height: subTitleHeight ?? height ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: subTitleMaxHeight ?? maxSubTextHeight,\n maxWidth: subTitleMaxWidth ?? maxWidth,\n // 兼容旧版富文本配置,如果未设置textType === 'rich',text内容为string 易报错\n textConfig: subtextStyle.character ?? (subtext as IRichTextCharacter[]),\n ...subtextStyle\n };\n this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext') as IRichText;\n } else if (subtextType === 'html') {\n const attr: any = {\n html: {\n dom: subtext as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...subtextStyle\n },\n x,\n y,\n width: subTitleWidth ?? width ?? 0,\n height: subTitleHeight ?? height ?? 0,\n ellipsis,\n wordBreak,\n maxHeight: subTitleMaxHeight ?? maxSubTextHeight,\n maxWidth: subTitleMaxWidth ?? maxWidth,\n textConfig: [] as any[],\n ...subtextStyle\n };\n this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext') as IRichText;\n } else if (isValid(subtext)) {\n this._subTitle = group.createOrUpdateChild(\n 'subTitle',\n {\n text: isArray(subtext) ? (subtext as any) : [subtext as string],\n whiteSpace: 'normal',\n ...subtextStyle,\n maxLineWidth: subtextStyle.maxLineWidth ?? width,\n heightLimit: subtextStyle.heightLimit ?? maxSubTextHeight,\n lineClamp,\n ellipsis,\n x: 0,\n y: mainTextBoundsHeight\n },\n 'text'\n ) as IText;\n }\n }\n\n const subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;\n const subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;\n\n // 设置宽高\n let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth);\n let totalHeight = mainTextBoundsHeight + (subtextStyle.height ?? subTextBoundsHeight);\n\n if (isValid(width)) {\n totalWidth = width;\n }\n\n if (isValid(height)) {\n totalHeight = height;\n }\n\n if (isValid(minWidth) && totalWidth < minWidth) {\n totalWidth = minWidth;\n }\n if (isValid(maxWidth)) {\n if (totalWidth > maxWidth) {\n totalWidth = maxWidth;\n }\n }\n\n if (isValid(minHeight) && totalHeight < minHeight) {\n totalHeight = minHeight;\n }\n\n if (isValid(maxHeight)) {\n if (totalHeight > maxHeight) {\n totalHeight = maxHeight;\n }\n }\n\n group.attribute.width = totalWidth;\n group.attribute.height = totalHeight;\n group.attribute.boundsPadding = parsedPadding;\n\n // 设置对齐\n if (this._mainTitle) {\n if (isValid(align) || isValid(textStyle.align)) {\n const mainTitleAlign = textStyle.align ? textStyle.align : align;\n const mainTitleWidth = textStyle.width ?? totalWidth;\n if (mainTitleAlign === 'center') {\n this._mainTitle.setAttribute('x', mainTitleWidth / 2);\n this._mainTitle.setAttribute('textAlign', 'center');\n } else if (mainTitleAlign === 'right') {\n this._mainTitle.setAttribute('x', mainTitleWidth);\n this._mainTitle.setAttribute('textAlign', 'right');\n } else {\n this._mainTitle.setAttribute('x', 0);\n this._mainTitle.setAttribute('textAlign', 'left');\n }\n }\n\n const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;\n const mainTitleHeight =\n fixedMainTitleHeight ?? (this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height());\n\n if (mainTitleVerticalAlign === 'middle') {\n this._mainTitle.setAttribute('y', mainTitleHeight / 2);\n this._mainTitle.setAttribute('textBaseline', 'middle');\n } else if (mainTitleVerticalAlign === 'bottom') {\n this._mainTitle.setAttribute('y', mainTitleHeight);\n this._mainTitle.setAttribute('textBaseline', 'bottom');\n } else {\n // 如果没有显示的设置verticalAlign,默认top\n this._mainTitle.setAttribute('y', 0);\n this._mainTitle.setAttribute('textBaseline', 'top');\n }\n }\n\n if (this._subTitle) {\n if (isValid(align) || isValid(subtextStyle.align)) {\n const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;\n // 当subText没有设置显示的宽度,但是mainText设置了显示的宽度的时候,为mainText为主,因为默认subText要和mainText对齐\n const subTitleWidth = subtextStyle.width ?? textStyle.width ?? totalWidth;\n if (subTitleAlign === 'center') {\n this._subTitle.setAttribute('x', subTitleWidth / 2);\n this._subTitle.setAttribute('textAlign', 'center');\n } else if (subTitleAlign === 'right') {\n this._subTitle.setAttribute('x', subTitleWidth);\n this._subTitle.setAttribute('textAlign', 'right');\n } else {\n this._subTitle.setAttribute('x', 0);\n this._subTitle.setAttribute('textAlign', 'left');\n }\n }\n\n const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;\n\n const subTitleYStart = this._mainTitle\n ? isValid(fixedMainTitleHeight)\n ? // 如果是用户指定的高度,根据bounds的height 和指定高度求最大值\n this._mainTitle.AABBBounds.y1 +\n Math.max(this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)\n : this._mainTitle.AABBBounds.y2\n : 0;\n const subTitleHeight =\n subtextStyle.height ?? height ?? (this._subTitle.AABBBounds.empty() ? 0 : this._subTitle.AABBBounds.height());\n if (subTitleVerticalAlign === 'middle') {\n this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);\n this._subTitle.setAttribute('textBaseline', 'middle');\n } else if (subTitleVerticalAlign === 'bottom') {\n this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);\n this._subTitle.setAttribute('textBaseline', 'bottom');\n } else {\n this._subTitle.setAttribute('y', subTitleYStart);\n this._subTitle.setAttribute('textBaseline', 'top');\n }\n }\n }\n}\n"]}
package/dist/index.es.js CHANGED
@@ -434,12 +434,15 @@ class Container {
434
434
  serviceIdentifier: injectIdentifier,
435
435
  constructorArgsMetadata: constructorArgsMetadata
436
436
  },
437
- request = {
437
+ bindings = (this._bindingDictionary.get(injectIdentifier) || []).filter(b => b.constraint(target));
438
+ if (bindings.length) {
439
+ const request = {
438
440
  injectIdentifier: injectIdentifier,
439
441
  metadata: constructorArgsMetadata,
440
- bindings: this._bindingDictionary.get(injectIdentifier).filter(b => b.constraint(target))
442
+ bindings: bindings
441
443
  };
442
- arr.push(request);
444
+ arr.push(request);
445
+ }
443
446
  }
444
447
  return arr;
445
448
  }
@@ -4625,7 +4628,8 @@ class IncreaseCount extends ACustomAnimate {
4625
4628
  }
4626
4629
  onEnd() {}
4627
4630
  onUpdate(end, ratio, out) {
4628
- !1 !== this.valid && (out.text = end ? this.toNumber : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
4631
+ var _a;
4632
+ !1 !== this.valid && (out.text = end ? null === (_a = this.to) || void 0 === _a ? void 0 : _a.text : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
4629
4633
  }
4630
4634
  }
4631
4635
  var Direction;
@@ -12462,7 +12466,7 @@ var __decorate$q = undefined && undefined.__decorate || function (decorators, ta
12462
12466
  };
12463
12467
  let DefaultDrawContribution = class {
12464
12468
  constructor(contributions, drawItemInterceptorContributions) {
12465
- this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, this.init();
12469
+ this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, isArray(this.contributions) || (this.contributions = [this.contributions]), this.init();
12466
12470
  }
12467
12471
  init() {
12468
12472
  this.contributions.forEach(item => {
@@ -13264,6 +13268,7 @@ class PickerBase {
13264
13268
  contains(graphic, point, params) {
13265
13269
  if (!graphic.AABBBounds.containsPoint(point)) return !1;
13266
13270
  if ("imprecise" === graphic.attribute.pickMode) return !0;
13271
+ if (!this.canvasRenderer) return !0;
13267
13272
  const {
13268
13273
  pickContext: pickContext
13269
13274
  } = null != params ? params : {};
@@ -19870,13 +19875,13 @@ class LabelBase extends AbstractComponent {
19870
19875
  }
19871
19876
  let labels = this._initText(data);
19872
19877
  if (isFunction(customLayoutFunc)) {
19873
- labels = customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
19878
+ labels = customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null, this);
19874
19879
  }
19875
19880
  else {
19876
19881
  labels = this._layout(labels);
19877
19882
  }
19878
19883
  if (isFunction(customOverlapFunc)) {
19879
- labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
19884
+ labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null, this);
19880
19885
  }
19881
19886
  else {
19882
19887
  if (overlap !== false) {
@@ -19884,7 +19889,7 @@ class LabelBase extends AbstractComponent {
19884
19889
  }
19885
19890
  }
19886
19891
  if (isFunction(this.attribute.onAfterOverlapping)) {
19887
- this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
19892
+ this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null, this);
19888
19893
  }
19889
19894
  if (labels && labels.length) {
19890
19895
  labels.forEach(label => {
@@ -27432,7 +27437,7 @@ class Title extends AbstractComponent {
27432
27437
  this.name = 'title';
27433
27438
  }
27434
27439
  render() {
27435
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
27440
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
27436
27441
  const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
27437
27442
  const parsedPadding = normalizePadding(padding);
27438
27443
  const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
@@ -27525,20 +27530,19 @@ class Title extends AbstractComponent {
27525
27530
  this._mainTitle.setAttribute('textAlign', 'left');
27526
27531
  }
27527
27532
  }
27528
- if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
27529
- const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
27530
- if (mainTitleVerticalAlign === 'middle' && isValid(fixedMainTitleHeight)) {
27531
- this._mainTitle.setAttribute('y', fixedMainTitleHeight / 2);
27532
- this._mainTitle.setAttribute('textBaseline', 'middle');
27533
- }
27534
- else if (mainTitleVerticalAlign === 'bottom' && isValid(fixedMainTitleHeight)) {
27535
- this._mainTitle.setAttribute('y', fixedMainTitleHeight);
27536
- this._mainTitle.setAttribute('textBaseline', 'bottom');
27537
- }
27538
- else {
27539
- this._mainTitle.setAttribute('y', 0);
27540
- this._mainTitle.setAttribute('textBaseline', 'top');
27541
- }
27533
+ const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
27534
+ const mainTitleHeight = fixedMainTitleHeight !== null && fixedMainTitleHeight !== void 0 ? fixedMainTitleHeight : (this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height());
27535
+ if (mainTitleVerticalAlign === 'middle') {
27536
+ this._mainTitle.setAttribute('y', mainTitleHeight / 2);
27537
+ this._mainTitle.setAttribute('textBaseline', 'middle');
27538
+ }
27539
+ else if (mainTitleVerticalAlign === 'bottom') {
27540
+ this._mainTitle.setAttribute('y', mainTitleHeight);
27541
+ this._mainTitle.setAttribute('textBaseline', 'bottom');
27542
+ }
27543
+ else {
27544
+ this._mainTitle.setAttribute('y', 0);
27545
+ this._mainTitle.setAttribute('textBaseline', 'top');
27542
27546
  }
27543
27547
  }
27544
27548
  if (this._subTitle) {
@@ -27558,27 +27562,26 @@ class Title extends AbstractComponent {
27558
27562
  this._subTitle.setAttribute('textAlign', 'left');
27559
27563
  }
27560
27564
  }
27561
- if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
27562
- const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
27563
- const subTitleYStart = this._mainTitle
27564
- ? isValid(fixedMainTitleHeight)
27565
- ?
27566
- this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)
27567
- : this._mainTitle.AABBBounds.y2
27568
- : 0;
27569
- const subTitleHeight = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height;
27570
- if (subTitleVerticalAlign === 'middle' && isValid(subTitleHeight)) {
27571
- this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
27572
- this._subTitle.setAttribute('textBaseline', 'middle');
27573
- }
27574
- else if (subTitleVerticalAlign === 'bottom' && isValid(subTitleHeight)) {
27575
- this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
27576
- this._subTitle.setAttribute('textBaseline', 'bottom');
27577
- }
27578
- else {
27579
- this._subTitle.setAttribute('y', subTitleYStart);
27580
- this._subTitle.setAttribute('textBaseline', 'top');
27581
- }
27565
+ const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
27566
+ const subTitleYStart = this._mainTitle
27567
+ ? isValid(fixedMainTitleHeight)
27568
+ ?
27569
+ this._mainTitle.AABBBounds.y1 +
27570
+ Math.max(this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)
27571
+ : this._mainTitle.AABBBounds.y2
27572
+ : 0;
27573
+ const subTitleHeight = (_v = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height) !== null && _v !== void 0 ? _v : (this._subTitle.AABBBounds.empty() ? 0 : this._subTitle.AABBBounds.height());
27574
+ if (subTitleVerticalAlign === 'middle') {
27575
+ this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
27576
+ this._subTitle.setAttribute('textBaseline', 'middle');
27577
+ }
27578
+ else if (subTitleVerticalAlign === 'bottom') {
27579
+ this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
27580
+ this._subTitle.setAttribute('textBaseline', 'bottom');
27581
+ }
27582
+ else {
27583
+ this._subTitle.setAttribute('y', subTitleYStart);
27584
+ this._subTitle.setAttribute('textBaseline', 'top');
27582
27585
  }
27583
27586
  }
27584
27587
  }
@@ -30261,6 +30264,6 @@ Switch.defaultAttributes = {
30261
30264
  spaceBetweenTextAndCircle: 6
30262
30265
  };
30263
30266
 
30264
- const version = "0.21.11";
30267
+ const version = "0.21.12";
30265
30268
 
30266
30269
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.21.11";
1
+ export declare const version = "0.21.12";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.21.11";
1
+ export const version = "0.21.12";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.11\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\nexport * from './switch';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.12\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\nexport * from './switch';\n"]}
package/es/label/base.js CHANGED
@@ -102,9 +102,9 @@ export class LabelBase extends AbstractComponent {
102
102
  data = data.filter((d => !seenIds.has(d.id) && seenIds.add(d.id)));
103
103
  }
104
104
  let labels = this._initText(data);
105
- labels = isFunction(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : this._layout(labels),
106
- isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : !1 !== overlap && (labels = this._overlapping(labels)),
107
- isFunction(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null),
105
+ labels = isFunction(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels),
106
+ isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : !1 !== overlap && (labels = this._overlapping(labels)),
107
+ isFunction(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this),
108
108
  labels && labels.length && labels.forEach((label => {
109
109
  this._bindEvent(label), this._setStatesOfText(label);
110
110
  })), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);