@visactor/vrender-components 0.21.12-alpha.0 → 0.21.12-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/axis/util.js +1 -2
- package/cjs/brush/type.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/title/title.js +18 -12
- package/cjs/title/title.js.map +1 -1
- package/dist/index.es.js +48 -37
- package/es/axis/util.js +1 -2
- package/es/brush/type.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/title/title.js +15 -11
- package/es/title/title.js.map +1 -1
- package/package.json +5 -5
package/cjs/axis/util.js
CHANGED
|
@@ -104,5 +104,4 @@ exports.getAxisBreakSymbolAttrs = getAxisBreakSymbolAttrs, exports.getElMap = ge
|
|
|
104
104
|
exports.getVerticalCoord = getVerticalCoord, exports.getCircleVerticalVector = getCircleVerticalVector,
|
|
105
105
|
exports.angleLabelOrientAttribute = angleLabelOrientAttribute, exports.getPolarAngleLabelPosition = getPolarAngleLabelPosition,
|
|
106
106
|
exports.getCirclePoints = getCirclePoints, exports.getPolygonPath = getPolygonPath,
|
|
107
|
-
exports.textIntersect = textIntersect, exports.hasOverlap = hasOverlap;
|
|
108
|
-
//# sourceMappingURL=util.js.map
|
|
107
|
+
exports.textIntersect = textIntersect, exports.hasOverlap = hasOverlap;
|
package/cjs/brush/type.js
CHANGED
|
@@ -8,4 +8,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
|
|
9
9
|
IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
|
|
10
10
|
IOperateType.brushClear = "brushClear";
|
|
11
|
-
}(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
|
|
11
|
+
}(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
|
|
12
|
+
//# sourceMappingURL=type.js.map
|
package/cjs/index.d.ts
CHANGED
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.21.12-alpha.
|
|
20
|
+
}), exports.version = void 0, exports.version = "0.21.12-alpha.1", __exportStar(require("./core/base"), exports),
|
|
21
21
|
__exportStar(require("./core/type"), exports), __exportStar(require("./scrollbar"), exports),
|
|
22
22
|
__exportStar(require("./tag"), exports), __exportStar(require("./poptip"), exports),
|
|
23
23
|
__exportStar(require("./crosshair"), exports), __exportStar(require("./label"), exports),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,8CAA4B;AAC5B,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,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.12-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,8CAA4B;AAC5B,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,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.12-alpha.1\";\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/cjs/title/title.js
CHANGED
|
@@ -14,7 +14,7 @@ class Title extends base_1.AbstractComponent {
|
|
|
14
14
|
this.name = "title";
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
18
18
|
const {textType: textType, text: text, subtextType: subtextType, textStyle: textStyle = {}, subtext: subtext, subtextStyle: subtextStyle = {}, width: width, height: height, minWidth: minWidth, maxWidth: maxWidth, minHeight: minHeight, maxHeight: maxHeight, align: align, verticalAlign: verticalAlign, padding: padding = 0} = this.attribute, parsedPadding = (0,
|
|
19
19
|
vutils_1.normalizePadding)(padding), group = this.createOrUpdateChild("title-container", {
|
|
20
20
|
x: parsedPadding[3],
|
|
@@ -124,11 +124,14 @@ class Title extends base_1.AbstractComponent {
|
|
|
124
124
|
this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0),
|
|
125
125
|
this._mainTitle.setAttribute("textAlign", "left"));
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
if ((0, vutils_1.isValid)(verticalAlign) || (0, vutils_1.isValid)(textStyle.verticalAlign)) {
|
|
128
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
129
|
+
"middle" === mainTitleVerticalAlign && (0, vutils_1.isValid)(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight / 2),
|
|
130
|
+
this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (0,
|
|
131
|
+
vutils_1.isValid)(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight),
|
|
132
|
+
this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0),
|
|
133
|
+
this._mainTitle.setAttribute("textBaseline", "top"));
|
|
134
|
+
}
|
|
132
135
|
}
|
|
133
136
|
if (this._subTitle) {
|
|
134
137
|
if ((0, vutils_1.isValid)(align) || (0, vutils_1.isValid)(subtextStyle.align)) {
|
|
@@ -138,12 +141,15 @@ class Title extends base_1.AbstractComponent {
|
|
|
138
141
|
this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0),
|
|
139
142
|
this._subTitle.setAttribute("textAlign", "left"));
|
|
140
143
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
if ((0, vutils_1.isValid)(verticalAlign) || (0, vutils_1.isValid)(textStyle.verticalAlign)) {
|
|
145
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign, subTitleYStart = this._mainTitle ? (0,
|
|
146
|
+
vutils_1.isValid)(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0, subTitleHeight = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height;
|
|
147
|
+
"middle" === subTitleVerticalAlign && (0, vutils_1.isValid)(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2),
|
|
148
|
+
this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && (0,
|
|
149
|
+
vutils_1.isValid)(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight),
|
|
150
|
+
this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart),
|
|
151
|
+
this._subTitle.setAttribute("textBaseline", "top"));
|
|
152
|
+
}
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
}
|
package/cjs/title/title.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,CA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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"]}
|
|
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,E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AAE,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"]}
|
package/dist/index.es.js
CHANGED
|
@@ -2699,6 +2699,9 @@ let ATextMeasure = class {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
compatibleMetrics(metrics, options) {
|
|
2701
2701
|
if (null == metrics.actualBoundingBoxAscent || null == metrics.actualBoundingBoxDescent || null == metrics.fontBoundingBoxAscent || null == metrics.fontBoundingBoxDescent) {
|
|
2702
|
+
metrics = {
|
|
2703
|
+
width: metrics.width
|
|
2704
|
+
};
|
|
2702
2705
|
const {
|
|
2703
2706
|
ascent: ascent,
|
|
2704
2707
|
descent: descent
|
|
@@ -2706,6 +2709,13 @@ let ATextMeasure = class {
|
|
|
2706
2709
|
metrics.actualBoundingBoxAscent = ascent, metrics.actualBoundingBoxDescent = descent, metrics.fontBoundingBoxAscent = ascent, metrics.fontBoundingBoxDescent = descent;
|
|
2707
2710
|
}
|
|
2708
2711
|
if (null == metrics.actualBoundingBoxLeft || null == metrics.actualBoundingBoxRight) {
|
|
2712
|
+
metrics = {
|
|
2713
|
+
width: metrics.width,
|
|
2714
|
+
actualBoundingBoxAscent: metrics.actualBoundingBoxAscent,
|
|
2715
|
+
actualBoundingBoxDescent: metrics.actualBoundingBoxDescent,
|
|
2716
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
2717
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
2718
|
+
};
|
|
2709
2719
|
const {
|
|
2710
2720
|
left: left,
|
|
2711
2721
|
right: right
|
|
@@ -4625,8 +4635,7 @@ class IncreaseCount extends ACustomAnimate {
|
|
|
4625
4635
|
}
|
|
4626
4636
|
onEnd() {}
|
|
4627
4637
|
onUpdate(end, ratio, out) {
|
|
4628
|
-
|
|
4629
|
-
!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));
|
|
4638
|
+
!1 !== this.valid && (out.text = end ? this.toNumber : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
|
|
4630
4639
|
}
|
|
4631
4640
|
}
|
|
4632
4641
|
var Direction;
|
|
@@ -27433,7 +27442,7 @@ class Title extends AbstractComponent {
|
|
|
27433
27442
|
this.name = 'title';
|
|
27434
27443
|
}
|
|
27435
27444
|
render() {
|
|
27436
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
27445
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
27437
27446
|
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
27438
27447
|
const parsedPadding = normalizePadding(padding);
|
|
27439
27448
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
@@ -27526,19 +27535,20 @@ class Title extends AbstractComponent {
|
|
|
27526
27535
|
this._mainTitle.setAttribute('textAlign', 'left');
|
|
27527
27536
|
}
|
|
27528
27537
|
}
|
|
27529
|
-
|
|
27530
|
-
|
|
27531
|
-
|
|
27532
|
-
|
|
27533
|
-
|
|
27534
|
-
|
|
27535
|
-
|
|
27536
|
-
|
|
27537
|
-
|
|
27538
|
-
|
|
27539
|
-
|
|
27540
|
-
|
|
27541
|
-
|
|
27538
|
+
if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
|
|
27539
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
27540
|
+
if (mainTitleVerticalAlign === 'middle' && isValid(fixedMainTitleHeight)) {
|
|
27541
|
+
this._mainTitle.setAttribute('y', fixedMainTitleHeight / 2);
|
|
27542
|
+
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
27543
|
+
}
|
|
27544
|
+
else if (mainTitleVerticalAlign === 'bottom' && isValid(fixedMainTitleHeight)) {
|
|
27545
|
+
this._mainTitle.setAttribute('y', fixedMainTitleHeight);
|
|
27546
|
+
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
27547
|
+
}
|
|
27548
|
+
else {
|
|
27549
|
+
this._mainTitle.setAttribute('y', 0);
|
|
27550
|
+
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
27551
|
+
}
|
|
27542
27552
|
}
|
|
27543
27553
|
}
|
|
27544
27554
|
if (this._subTitle) {
|
|
@@ -27558,26 +27568,27 @@ class Title extends AbstractComponent {
|
|
|
27558
27568
|
this._subTitle.setAttribute('textAlign', 'left');
|
|
27559
27569
|
}
|
|
27560
27570
|
}
|
|
27561
|
-
|
|
27562
|
-
|
|
27563
|
-
|
|
27564
|
-
?
|
|
27565
|
-
|
|
27566
|
-
|
|
27567
|
-
|
|
27568
|
-
|
|
27569
|
-
|
|
27570
|
-
|
|
27571
|
-
|
|
27572
|
-
|
|
27573
|
-
|
|
27574
|
-
|
|
27575
|
-
|
|
27576
|
-
|
|
27577
|
-
|
|
27578
|
-
|
|
27579
|
-
|
|
27580
|
-
|
|
27571
|
+
if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
|
|
27572
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
|
|
27573
|
+
const subTitleYStart = this._mainTitle
|
|
27574
|
+
? isValid(fixedMainTitleHeight)
|
|
27575
|
+
?
|
|
27576
|
+
this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)
|
|
27577
|
+
: this._mainTitle.AABBBounds.y2
|
|
27578
|
+
: 0;
|
|
27579
|
+
const subTitleHeight = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height;
|
|
27580
|
+
if (subTitleVerticalAlign === 'middle' && isValid(subTitleHeight)) {
|
|
27581
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
27582
|
+
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
27583
|
+
}
|
|
27584
|
+
else if (subTitleVerticalAlign === 'bottom' && isValid(subTitleHeight)) {
|
|
27585
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
27586
|
+
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
27587
|
+
}
|
|
27588
|
+
else {
|
|
27589
|
+
this._subTitle.setAttribute('y', subTitleYStart);
|
|
27590
|
+
this._subTitle.setAttribute('textBaseline', 'top');
|
|
27591
|
+
}
|
|
27581
27592
|
}
|
|
27582
27593
|
}
|
|
27583
27594
|
}
|
|
@@ -30260,6 +30271,6 @@ Switch.defaultAttributes = {
|
|
|
30260
30271
|
spaceBetweenTextAndCircle: 6
|
|
30261
30272
|
};
|
|
30262
30273
|
|
|
30263
|
-
const version = "0.21.12-alpha.
|
|
30274
|
+
const version = "0.21.12-alpha.1";
|
|
30264
30275
|
|
|
30265
30276
|
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/axis/util.js
CHANGED
package/es/brush/type.js
CHANGED
|
@@ -4,4 +4,5 @@ export var IOperateType;
|
|
|
4
4
|
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
|
|
5
5
|
IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
|
|
6
6
|
IOperateType.brushClear = "brushClear";
|
|
7
|
-
}(IOperateType || (IOperateType = {}));
|
|
7
|
+
}(IOperateType || (IOperateType = {}));
|
|
8
|
+
//# sourceMappingURL=type.js.map
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAEzC,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-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAEzC,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-alpha.1\";\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/title/title.js
CHANGED
|
@@ -14,7 +14,7 @@ export class Title extends AbstractComponent {
|
|
|
14
14
|
this.name = "title";
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
18
18
|
const {textType: textType, text: text, subtextType: subtextType, textStyle: textStyle = {}, subtext: subtext, subtextStyle: subtextStyle = {}, width: width, height: height, minWidth: minWidth, maxWidth: maxWidth, minHeight: minHeight, maxHeight: maxHeight, align: align, verticalAlign: verticalAlign, padding: padding = 0} = this.attribute, parsedPadding = normalizePadding(padding), group = this.createOrUpdateChild("title-container", {
|
|
19
19
|
x: parsedPadding[3],
|
|
20
20
|
y: parsedPadding[0],
|
|
@@ -121,11 +121,13 @@ export class Title extends AbstractComponent {
|
|
|
121
121
|
this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0),
|
|
122
122
|
this._mainTitle.setAttribute("textAlign", "left"));
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
|
|
125
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
126
|
+
"middle" === mainTitleVerticalAlign && isValid(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight / 2),
|
|
127
|
+
this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && isValid(fixedMainTitleHeight) ? (this._mainTitle.setAttribute("y", fixedMainTitleHeight),
|
|
128
|
+
this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0),
|
|
129
|
+
this._mainTitle.setAttribute("textBaseline", "top"));
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
132
|
if (this._subTitle) {
|
|
131
133
|
if (isValid(align) || isValid(subtextStyle.align)) {
|
|
@@ -135,11 +137,13 @@ export class Title extends AbstractComponent {
|
|
|
135
137
|
this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0),
|
|
136
138
|
this._subTitle.setAttribute("textAlign", "left"));
|
|
137
139
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
|
|
141
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign, subTitleYStart = this._mainTitle ? isValid(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0, subTitleHeight = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height;
|
|
142
|
+
"middle" === subTitleVerticalAlign && isValid(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2),
|
|
143
|
+
this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && isValid(subTitleHeight) ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight),
|
|
144
|
+
this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart),
|
|
145
|
+
this._subTitle.setAttribute("textBaseline", "top"));
|
|
146
|
+
}
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
}
|
package/es/title/title.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/title/title.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,kBAAkB,EAAE,CAAC;AACrB,MAAM,OAAO,KAAM,SAAQ,iBAAuC;IAyBhE,YAAY,UAAsB,EAAE,OAA0B;QAC5D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB5F,SAAI,GAAG,OAAO,CAAC;IA0Bf,CAAC;IAES,MAAM;;QACd,MAAM,EACJ,Q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E;gBACtC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,GAAG,CAAC,CAAC,CAAC;gBACtE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;aACvD;iBAAM,IAAI,qBAAqB,KAAK,QAAQ,EAAE;gBAC7C,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC;gBAClE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;aACvD;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;gBACjD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;aACpD;SACF;IACH,CAAC;;AA3SM,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"]}
|
|
1
|
+
{"version":3,"sources":["../src/title/title.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,kBAAkB,EAAE,CAAC;AACrB,MAAM,OAAO,KAAM,SAAQ,iBAAuC;IAyBhE,YAAY,UAAsB,EAAE,OAA0B;QAC5D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAA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c,GAAG,cAAc,GAAG,CAAC,CAAC,CAAC;oBACtE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;iBACvD;qBAAM,IAAI,qBAAqB,KAAK,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC,EAAE;oBACxE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC;oBAClE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;iBACvD;qBAAM;oBACL,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;oBACjD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;iBACpD;aACF;SACF;IACH,CAAC;;AAxSM,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';\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-components",
|
|
3
|
-
"version": "0.21.12-alpha.
|
|
3
|
+
"version": "0.21.12-alpha.1",
|
|
4
4
|
"description": "components library for dp visualization",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@visactor/vutils": "~0.19.3",
|
|
16
16
|
"@visactor/vscale": "~0.19.3",
|
|
17
|
-
"@visactor/vrender-core": "0.21.12-alpha.
|
|
18
|
-
"@visactor/vrender-kits": "0.21.12-alpha.
|
|
17
|
+
"@visactor/vrender-core": "0.21.12-alpha.1",
|
|
18
|
+
"@visactor/vrender-kits": "0.21.12-alpha.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"typescript": "4.9.5",
|
|
31
31
|
"cross-env": "^7.0.3",
|
|
32
32
|
"@internal/bundler": "0.0.1",
|
|
33
|
-
"@internal/
|
|
34
|
-
"@internal/
|
|
33
|
+
"@internal/eslint-config": "0.0.1",
|
|
34
|
+
"@internal/ts-config": "0.0.1"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"VisActor",
|