@visactor/vchart 1.13.23-alpha.0 → 1.13.23
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/build/es5/index.js +1 -1
- package/build/index.es.js +20 -4
- package/build/index.js +20 -4
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/title/title.js +16 -12
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/core/index.js +2 -1
- package/cjs/core/interface.js +1 -2
- package/cjs/event/bubble.js +1 -1
- package/cjs/interaction/config.js +1 -1
- package/esm/component/title/title.js +15 -12
- package/esm/component/title/title.js.map +1 -1
- package/esm/core/index.js +2 -1
- package/esm/core/interface.js +1 -2
- package/esm/event/bubble.js +1 -1
- package/esm/interaction/config.js +1 -1
- package/package.json +5 -5
package/build/index.es.js
CHANGED
|
@@ -98888,7 +98888,7 @@ class Title extends BaseComponent {
|
|
|
98888
98888
|
};
|
|
98889
98889
|
}
|
|
98890
98890
|
_getTitleAttrs() {
|
|
98891
|
-
var _a, _b, _c, _d, _e, _f
|
|
98891
|
+
var _a, _b, _c, _d, _e, _f;
|
|
98892
98892
|
if (this._spec.visible === false) {
|
|
98893
98893
|
return { visible: false };
|
|
98894
98894
|
}
|
|
@@ -98896,10 +98896,26 @@ class Title extends BaseComponent {
|
|
|
98896
98896
|
const titleWidth = calcLayoutNumber(this._spec.width, layoutRect.width, null, layoutRect.width);
|
|
98897
98897
|
const titleMaxWidth = calcLayoutNumber(this._spec.maxWidth, layoutRect.width, null, layoutRect.width);
|
|
98898
98898
|
const maxWidth = Math.max(Math.min(titleWidth, titleMaxWidth, layoutRect.width), 0);
|
|
98899
|
-
const
|
|
98899
|
+
const hasText = isValid$1(this._spec.text) && this._spec.text !== '';
|
|
98900
|
+
const hasSubtext = isValid$1(this._spec.subtext) && this._spec.subtext !== '';
|
|
98901
|
+
const attrs = Object.assign(Object.assign({}, pickWithout(this._spec, ['padding'])), { textType: (_a = this._spec.textType) !== null && _a !== void 0 ? _a : 'text', text: hasText ? this._spec.text : undefined, subtextType: (_b = this._spec.subtextType) !== null && _b !== void 0 ? _b : 'text', subtext: hasSubtext ? this._spec.subtext : undefined, x: (_c = this._spec.x) !== null && _c !== void 0 ? _c : 0, y: (_d = this._spec.y) !== null && _d !== void 0 ? _d : 0, height: this._spec.height, minWidth: this._spec.minWidth, maxWidth, minHeight: this._spec.minHeight, maxHeight: this._spec.maxHeight, padding: this._spec.innerPadding, align: (_e = this._spec.align) !== null && _e !== void 0 ? _e : 'left', verticalAlign: (_f = this._spec.verticalAlign) !== null && _f !== void 0 ? _f : 'top', textStyle: Object.assign({ maxLineWidth: maxWidth }, this._spec.textStyle), subtextStyle: Object.assign({ maxLineWidth: maxWidth }, this._spec.subtextStyle) });
|
|
98902
|
+
if (hasText) {
|
|
98903
|
+
attrs.textStyle.width = maxWidth;
|
|
98904
|
+
}
|
|
98905
|
+
if (hasSubtext) {
|
|
98906
|
+
attrs.subtextStyle.width = maxWidth;
|
|
98907
|
+
}
|
|
98900
98908
|
if (isValid$1(this._spec.width)) {
|
|
98901
|
-
|
|
98902
|
-
|
|
98909
|
+
const clampedWidth = Math.max(Math.min(titleWidth, layoutRect.width), 0);
|
|
98910
|
+
if (hasText) {
|
|
98911
|
+
attrs.textStyle.width = clampedWidth;
|
|
98912
|
+
}
|
|
98913
|
+
else {
|
|
98914
|
+
delete attrs.textStyle.width;
|
|
98915
|
+
}
|
|
98916
|
+
if (hasSubtext) {
|
|
98917
|
+
attrs.subtextStyle.width = clampedWidth;
|
|
98918
|
+
}
|
|
98903
98919
|
}
|
|
98904
98920
|
return attrs;
|
|
98905
98921
|
}
|
package/build/index.js
CHANGED
|
@@ -98894,7 +98894,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98894
98894
|
};
|
|
98895
98895
|
}
|
|
98896
98896
|
_getTitleAttrs() {
|
|
98897
|
-
var _a, _b, _c, _d, _e, _f
|
|
98897
|
+
var _a, _b, _c, _d, _e, _f;
|
|
98898
98898
|
if (this._spec.visible === false) {
|
|
98899
98899
|
return { visible: false };
|
|
98900
98900
|
}
|
|
@@ -98902,10 +98902,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98902
98902
|
const titleWidth = calcLayoutNumber(this._spec.width, layoutRect.width, null, layoutRect.width);
|
|
98903
98903
|
const titleMaxWidth = calcLayoutNumber(this._spec.maxWidth, layoutRect.width, null, layoutRect.width);
|
|
98904
98904
|
const maxWidth = Math.max(Math.min(titleWidth, titleMaxWidth, layoutRect.width), 0);
|
|
98905
|
-
const
|
|
98905
|
+
const hasText = isValid$1(this._spec.text) && this._spec.text !== '';
|
|
98906
|
+
const hasSubtext = isValid$1(this._spec.subtext) && this._spec.subtext !== '';
|
|
98907
|
+
const attrs = Object.assign(Object.assign({}, pickWithout(this._spec, ['padding'])), { textType: (_a = this._spec.textType) !== null && _a !== void 0 ? _a : 'text', text: hasText ? this._spec.text : undefined, subtextType: (_b = this._spec.subtextType) !== null && _b !== void 0 ? _b : 'text', subtext: hasSubtext ? this._spec.subtext : undefined, x: (_c = this._spec.x) !== null && _c !== void 0 ? _c : 0, y: (_d = this._spec.y) !== null && _d !== void 0 ? _d : 0, height: this._spec.height, minWidth: this._spec.minWidth, maxWidth, minHeight: this._spec.minHeight, maxHeight: this._spec.maxHeight, padding: this._spec.innerPadding, align: (_e = this._spec.align) !== null && _e !== void 0 ? _e : 'left', verticalAlign: (_f = this._spec.verticalAlign) !== null && _f !== void 0 ? _f : 'top', textStyle: Object.assign({ maxLineWidth: maxWidth }, this._spec.textStyle), subtextStyle: Object.assign({ maxLineWidth: maxWidth }, this._spec.subtextStyle) });
|
|
98908
|
+
if (hasText) {
|
|
98909
|
+
attrs.textStyle.width = maxWidth;
|
|
98910
|
+
}
|
|
98911
|
+
if (hasSubtext) {
|
|
98912
|
+
attrs.subtextStyle.width = maxWidth;
|
|
98913
|
+
}
|
|
98906
98914
|
if (isValid$1(this._spec.width)) {
|
|
98907
|
-
|
|
98908
|
-
|
|
98915
|
+
const clampedWidth = Math.max(Math.min(titleWidth, layoutRect.width), 0);
|
|
98916
|
+
if (hasText) {
|
|
98917
|
+
attrs.textStyle.width = clampedWidth;
|
|
98918
|
+
}
|
|
98919
|
+
else {
|
|
98920
|
+
delete attrs.textStyle.width;
|
|
98921
|
+
}
|
|
98922
|
+
if (hasSubtext) {
|
|
98923
|
+
attrs.subtextStyle.width = clampedWidth;
|
|
98924
|
+
}
|
|
98909
98925
|
}
|
|
98910
98926
|
return attrs;
|
|
98911
98927
|
}
|