reke-ui 0.3.0 → 0.4.0
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/custom-elements.json +991 -20
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/components/reke-chip/reke-chip.d.ts +7 -0
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +8 -2
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +32 -0
- package/dist/components/reke-combobox/reke-combobox.d.ts +21 -1
- package/dist/components/reke-combobox/reke-combobox.d.ts.map +1 -1
- package/dist/components/reke-combobox/reke-combobox.js +76 -16
- package/dist/components/reke-combobox/reke-combobox.styles.d.ts.map +1 -1
- package/dist/components/reke-combobox/reke-combobox.styles.js +128 -0
- package/dist/components/reke-input/reke-input.d.ts +14 -0
- package/dist/components/reke-input/reke-input.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.js +41 -22
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +44 -16
- package/dist/components/reke-menu/reke-menu.d.ts +51 -0
- package/dist/components/reke-menu/reke-menu.d.ts.map +1 -0
- package/dist/components/reke-menu/reke-menu.js +106 -0
- package/dist/components/reke-menu/reke-menu.styles.d.ts +2 -0
- package/dist/components/reke-menu/reke-menu.styles.d.ts.map +1 -0
- package/dist/components/reke-menu/reke-menu.styles.js +25 -0
- package/dist/components/reke-menu-item/reke-menu-item.d.ts +32 -0
- package/dist/components/reke-menu-item/reke-menu-item.d.ts.map +1 -0
- package/dist/components/reke-menu-item/reke-menu-item.js +49 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.d.ts +2 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.d.ts.map +1 -0
- package/dist/components/reke-menu-item/reke-menu-item.styles.js +53 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts +59 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts.map +1 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.js +117 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.d.ts +2 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.d.ts.map +1 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.js +28 -0
- package/dist/components/reke-table/reke-table.d.ts +1 -0
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- package/dist/node_modules/echarts/lib/animation/basicTransition.js +70 -0
- package/dist/node_modules/echarts/lib/chart/custom/customSeriesRegister.js +7 -0
- package/dist/node_modules/echarts/lib/chart/helper/createRenderPlanner.js +11 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js +11 -0
- package/dist/node_modules/echarts/lib/chart/helper/sectorHelper.js +19 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieSeries.js +112 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieView.js +119 -0
- package/dist/node_modules/echarts/lib/chart/pie/install.js +12 -0
- package/dist/node_modules/echarts/lib/chart/pie/labelLayout.js +190 -0
- package/dist/node_modules/echarts/lib/chart/pie/pieLayout.js +72 -0
- package/dist/node_modules/echarts/lib/component/axis/AxisBuilder.js +554 -0
- package/dist/node_modules/echarts/lib/component/axis/AxisView.js +36 -0
- package/dist/node_modules/echarts/lib/component/axis/axisAction.js +4 -0
- package/dist/node_modules/echarts/lib/component/axis/axisBreakHelper.js +5 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js +57 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/AxisPointerView.js +28 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js +174 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js +65 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/axisTrigger.js +189 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js +27 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/globalListener.js +56 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/install.js +25 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/modelHelper.js +117 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/viewHelper.js +103 -0
- package/dist/node_modules/echarts/lib/component/helper/listComponent.js +20 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendModel.js +184 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendView.js +227 -0
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendModel.js +45 -0
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendView.js +145 -0
- package/dist/node_modules/echarts/lib/component/legend/install.js +9 -0
- package/dist/node_modules/echarts/lib/component/legend/installLegendPlain.js +12 -0
- package/dist/node_modules/echarts/lib/component/legend/installLegendScroll.js +11 -0
- package/dist/node_modules/echarts/lib/component/legend/legendAction.js +38 -0
- package/dist/node_modules/echarts/lib/component/legend/legendFilter.js +12 -0
- package/dist/node_modules/echarts/lib/component/legend/scrollableLegendAction.js +15 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js +170 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipModel.js +55 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipRichContent.js +102 -0
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipView.js +367 -0
- package/dist/node_modules/echarts/lib/component/tooltip/helper.js +37 -0
- package/dist/node_modules/echarts/lib/component/tooltip/install.js +19 -0
- package/dist/node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js +56 -0
- package/dist/node_modules/echarts/lib/component/tooltip/tooltipMarkup.js +173 -0
- package/dist/node_modules/echarts/lib/coord/axisBand.js +31 -0
- package/dist/node_modules/echarts/lib/coord/axisHelper.js +21 -0
- package/dist/node_modules/echarts/lib/coord/axisStatistics.js +38 -0
- package/dist/node_modules/echarts/lib/coord/axisTickLabelBuilder.js +14 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js +31 -0
- package/dist/node_modules/echarts/lib/core/CoordinateSystem.js +50 -0
- package/dist/node_modules/echarts/lib/core/ExtensionAPI.js +32 -0
- package/dist/node_modules/echarts/lib/core/Scheduler.js +203 -0
- package/dist/node_modules/echarts/lib/core/echarts.js +986 -0
- package/dist/node_modules/echarts/lib/core/impl.js +11 -0
- package/dist/node_modules/echarts/lib/core/lifecycle.js +5 -0
- package/dist/node_modules/echarts/lib/core/locale.js +27 -0
- package/dist/node_modules/echarts/lib/core/task.js +81 -0
- package/dist/node_modules/echarts/lib/data/DataDiffer.js +68 -0
- package/dist/node_modules/echarts/lib/data/DataStore.js +359 -0
- package/dist/node_modules/echarts/lib/data/SeriesData.js +328 -0
- package/dist/node_modules/echarts/lib/data/SeriesDimensionDefine.js +10 -0
- package/dist/node_modules/echarts/lib/data/Source.js +132 -0
- package/dist/node_modules/echarts/lib/data/helper/SeriesDataSchema.js +80 -0
- package/dist/node_modules/echarts/lib/data/helper/createDimensions.js +105 -0
- package/dist/node_modules/echarts/lib/data/helper/dataProvider.js +155 -0
- package/dist/node_modules/echarts/lib/data/helper/dataValueHelper.js +87 -0
- package/dist/node_modules/echarts/lib/data/helper/dimensionHelper.js +50 -0
- package/dist/node_modules/echarts/lib/data/helper/sourceHelper.js +98 -0
- package/dist/node_modules/echarts/lib/data/helper/sourceManager.js +115 -0
- package/dist/node_modules/echarts/lib/data/helper/transform.js +145 -0
- package/dist/node_modules/echarts/lib/extension.js +62 -0
- package/dist/node_modules/echarts/lib/i18n/langEN.js +148 -0
- package/dist/node_modules/echarts/lib/i18n/langZH.js +148 -0
- package/dist/node_modules/echarts/lib/label/labelGuideHelper.js +106 -0
- package/dist/node_modules/echarts/lib/label/labelLayoutHelper.js +152 -0
- package/dist/node_modules/echarts/lib/label/labelStyle.js +190 -0
- package/dist/node_modules/echarts/lib/legacy/dataSelectAction.js +53 -0
- package/dist/node_modules/echarts/lib/loading/default.js +85 -0
- package/dist/node_modules/echarts/lib/model/Component.js +64 -0
- package/dist/node_modules/echarts/lib/model/Global.js +320 -0
- package/dist/node_modules/echarts/lib/model/Model.js +50 -0
- package/dist/node_modules/echarts/lib/model/OptionManager.js +78 -0
- package/dist/node_modules/echarts/lib/model/Series.js +216 -0
- package/dist/node_modules/echarts/lib/model/globalDefault.js +94 -0
- package/dist/node_modules/echarts/lib/model/internalComponentCreator.js +14 -0
- package/dist/node_modules/echarts/lib/model/mixin/areaStyle.js +16 -0
- package/dist/node_modules/echarts/lib/model/mixin/dataFormat.js +63 -0
- package/dist/node_modules/echarts/lib/model/mixin/itemStyle.js +24 -0
- package/dist/node_modules/echarts/lib/model/mixin/lineStyle.js +23 -0
- package/dist/node_modules/echarts/lib/model/mixin/makeStyleMapper.js +17 -0
- package/dist/node_modules/echarts/lib/model/mixin/palette.js +32 -0
- package/dist/node_modules/echarts/lib/model/mixin/textStyle.js +36 -0
- package/dist/node_modules/echarts/lib/preprocessor/backwardCompat.js +89 -0
- package/dist/node_modules/echarts/lib/preprocessor/helper/compatStyle.js +118 -0
- package/dist/node_modules/echarts/lib/processor/dataFilter.js +18 -0
- package/dist/node_modules/echarts/lib/processor/dataStack.js +52 -0
- package/dist/node_modules/echarts/lib/processor/negativeDataFilter.js +16 -0
- package/dist/node_modules/echarts/lib/renderer/installCanvasRenderer.js +7 -0
- package/dist/node_modules/echarts/lib/scale/break.js +9 -0
- package/dist/node_modules/echarts/lib/scale/helper.js +9 -0
- package/dist/node_modules/echarts/lib/scale/scaleMapper.js +26 -0
- package/dist/node_modules/echarts/lib/theme/dark.js +159 -0
- package/dist/node_modules/echarts/lib/util/ECEventProcessor.js +52 -0
- package/dist/node_modules/echarts/lib/util/clazz.js +99 -0
- package/dist/node_modules/echarts/lib/util/component.js +75 -0
- package/dist/node_modules/echarts/lib/util/cycleCache.js +14 -0
- package/dist/node_modules/echarts/lib/util/decal.js +162 -0
- package/dist/node_modules/echarts/lib/util/event.js +7 -0
- package/dist/node_modules/echarts/lib/util/format.js +87 -0
- package/dist/node_modules/echarts/lib/util/graphic.js +361 -0
- package/dist/node_modules/echarts/lib/util/innerStore.js +13 -0
- package/dist/node_modules/echarts/lib/util/layout.js +174 -0
- package/dist/node_modules/echarts/lib/util/log.js +54 -0
- package/dist/node_modules/echarts/lib/util/model.js +296 -0
- package/dist/node_modules/echarts/lib/util/number.js +132 -0
- package/dist/node_modules/echarts/lib/util/states.js +323 -0
- package/dist/node_modules/echarts/lib/util/symbol.js +146 -0
- package/dist/node_modules/echarts/lib/util/throttle.js +37 -0
- package/dist/node_modules/echarts/lib/util/time.js +43 -0
- package/dist/node_modules/echarts/lib/util/types.js +13 -0
- package/dist/node_modules/echarts/lib/view/Chart.js +81 -0
- package/dist/node_modules/echarts/lib/view/Component.js +16 -0
- package/dist/node_modules/echarts/lib/visual/LegendVisualProvider.js +18 -0
- package/dist/node_modules/echarts/lib/visual/decal.js +25 -0
- package/dist/node_modules/echarts/lib/visual/helper.js +23 -0
- package/dist/node_modules/echarts/lib/visual/style.js +79 -0
- package/dist/node_modules/echarts/lib/visual/symbol.js +47 -0
- package/dist/node_modules/echarts/lib/visual/tokens.js +108 -0
- package/dist/node_modules/echarts/node_modules/tslib/tslib.es6.js +18 -0
- package/dist/node_modules/zrender/lib/Element.js +442 -0
- package/dist/node_modules/zrender/lib/Handler.js +167 -0
- package/dist/node_modules/zrender/lib/Storage.js +68 -0
- package/dist/node_modules/zrender/lib/animation/Animation.js +65 -0
- package/dist/node_modules/zrender/lib/animation/Animator.js +348 -0
- package/dist/node_modules/zrender/lib/animation/Clip.js +31 -0
- package/dist/node_modules/zrender/lib/animation/cubicEasing.js +17 -0
- package/dist/node_modules/zrender/lib/animation/easing.js +104 -0
- package/dist/node_modules/zrender/lib/animation/requestAnimationFrame.js +7 -0
- package/dist/node_modules/zrender/lib/canvas/Layer.js +135 -0
- package/dist/node_modules/zrender/lib/canvas/Painter.js +352 -0
- package/dist/node_modules/zrender/lib/canvas/dashStyle.js +17 -0
- package/dist/node_modules/zrender/lib/canvas/graphic.js +199 -0
- package/dist/node_modules/zrender/lib/canvas/helper.js +33 -0
- package/dist/node_modules/zrender/lib/config.js +7 -0
- package/dist/node_modules/zrender/lib/contain/arc.js +20 -0
- package/dist/node_modules/zrender/lib/contain/cubic.js +9 -0
- package/dist/node_modules/zrender/lib/contain/line.js +12 -0
- package/dist/node_modules/zrender/lib/contain/path.js +133 -0
- package/dist/node_modules/zrender/lib/contain/quadratic.js +9 -0
- package/dist/node_modules/zrender/lib/contain/text.js +106 -0
- package/dist/node_modules/zrender/lib/contain/util.js +7 -0
- package/dist/node_modules/zrender/lib/contain/windingLine.js +10 -0
- package/dist/node_modules/zrender/lib/core/BoundingRect.js +111 -0
- package/dist/node_modules/zrender/lib/core/Eventful.js +82 -0
- package/dist/node_modules/zrender/lib/core/GestureMgr.js +56 -0
- package/dist/node_modules/zrender/lib/core/LRU.js +49 -0
- package/dist/node_modules/zrender/lib/core/OrientedBoundingRect.js +41 -0
- package/dist/node_modules/zrender/lib/core/PathProxy.js +288 -0
- package/dist/node_modules/zrender/lib/core/Point.js +72 -0
- package/dist/node_modules/zrender/lib/core/Transformable.js +96 -0
- package/dist/node_modules/zrender/lib/core/WeakMap.js +25 -0
- package/dist/node_modules/zrender/lib/core/bbox.js +40 -0
- package/dist/node_modules/zrender/lib/core/curve.js +142 -0
- package/dist/node_modules/zrender/lib/core/dom.js +74 -0
- package/dist/node_modules/zrender/lib/core/env.js +22 -0
- package/dist/node_modules/zrender/lib/core/event.js +58 -0
- package/dist/node_modules/zrender/lib/core/fourPointsTransform.js +109 -0
- package/dist/node_modules/zrender/lib/core/matrix.js +39 -0
- package/dist/node_modules/zrender/lib/core/platform.js +42 -0
- package/dist/node_modules/zrender/lib/core/timsort.js +246 -0
- package/dist/node_modules/zrender/lib/core/util.js +314 -0
- package/dist/node_modules/zrender/lib/core/vector.js +52 -0
- package/dist/node_modules/zrender/lib/dom/HandlerProxy.js +190 -0
- package/dist/node_modules/zrender/lib/graphic/CompoundPath.js +25 -0
- package/dist/node_modules/zrender/lib/graphic/Displayable.js +133 -0
- package/dist/node_modules/zrender/lib/graphic/Gradient.js +14 -0
- package/dist/node_modules/zrender/lib/graphic/Group.js +86 -0
- package/dist/node_modules/zrender/lib/graphic/Image.js +49 -0
- package/dist/node_modules/zrender/lib/graphic/IncrementalDisplayable.js +65 -0
- package/dist/node_modules/zrender/lib/graphic/LinearGradient.js +13 -0
- package/dist/node_modules/zrender/lib/graphic/Path.js +200 -0
- package/dist/node_modules/zrender/lib/graphic/RadialGradient.js +13 -0
- package/dist/node_modules/zrender/lib/graphic/TSpan.js +39 -0
- package/dist/node_modules/zrender/lib/graphic/Text.js +216 -0
- package/dist/node_modules/zrender/lib/graphic/helper/image.js +39 -0
- package/dist/node_modules/zrender/lib/graphic/helper/parseText.js +226 -0
- package/dist/node_modules/zrender/lib/graphic/helper/poly.js +21 -0
- package/dist/node_modules/zrender/lib/graphic/helper/roundRect.js +9 -0
- package/dist/node_modules/zrender/lib/graphic/helper/roundSector.js +85 -0
- package/dist/node_modules/zrender/lib/graphic/helper/smoothBezier.js +26 -0
- package/dist/node_modules/zrender/lib/graphic/helper/subPixelOptimize.js +25 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Arc.js +28 -0
- package/dist/node_modules/zrender/lib/graphic/shape/BezierCurve.js +40 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Circle.js +22 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Ellipse.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Line.js +37 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Polygon.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Polyline.js +28 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Rect.js +31 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Ring.js +23 -0
- package/dist/node_modules/zrender/lib/graphic/shape/Sector.js +25 -0
- package/dist/node_modules/zrender/lib/mixin/Draggable.js +28 -0
- package/dist/node_modules/zrender/lib/svg/helper.js +19 -0
- package/dist/node_modules/zrender/lib/tool/color.js +1039 -0
- package/dist/node_modules/zrender/lib/tool/path.js +153 -0
- package/dist/node_modules/zrender/lib/tool/transformPath.js +41 -0
- package/dist/node_modules/zrender/lib/zrender.js +124 -0
- package/dist/node_modules/zrender/node_modules/tslib/tslib.es6.js +18 -0
- package/dist/react-bridge/table.d.ts.map +1 -1
- package/dist/react-bridge/table.js +36 -21
- package/dist/react.d.ts +8 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +58 -46
- package/dist/shared/base-element.d.ts +1 -0
- package/dist/shared/base-element.d.ts.map +1 -1
- package/dist/shared/base-element.js +6 -0
- package/dist/shared/tailwind.js +1 -1
- package/dist/tokens/reke-tokens.css +15 -0
- package/package.json +14 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { clone as e, createObject as t, defaults as n, extend as r, isString as i, keys as a } from "../core/util.js";
|
|
2
|
+
import { __extends as o } from "../../node_modules/tslib/tslib.es6.js";
|
|
3
|
+
import { TRANSFORMABLE_PROPS as s } from "../core/Transformable.js";
|
|
4
|
+
import { lum as c } from "../tool/color.js";
|
|
5
|
+
import { DARK_LABEL_COLOR as l, LIGHTER_LABEL_COLOR as u, LIGHT_LABEL_COLOR as d } from "../config.js";
|
|
6
|
+
import f, { DEFAULT_COMMON_ANIMATION_PROPS as p, DEFAULT_COMMON_STYLE as m } from "./Displayable.js";
|
|
7
|
+
import h from "../core/PathProxy.js";
|
|
8
|
+
import { contain as g, containStroke as _ } from "../contain/path.js";
|
|
9
|
+
//#region node_modules/zrender/lib/graphic/Path.js
|
|
10
|
+
var v = n({
|
|
11
|
+
fill: "#000",
|
|
12
|
+
stroke: null,
|
|
13
|
+
strokePercent: 1,
|
|
14
|
+
fillOpacity: 1,
|
|
15
|
+
strokeOpacity: 1,
|
|
16
|
+
lineDashOffset: 0,
|
|
17
|
+
lineWidth: 1,
|
|
18
|
+
lineCap: "butt",
|
|
19
|
+
miterLimit: 10,
|
|
20
|
+
strokeNoScale: !1,
|
|
21
|
+
strokeFirst: !1
|
|
22
|
+
}, m), y = { style: n({
|
|
23
|
+
fill: !0,
|
|
24
|
+
stroke: !0,
|
|
25
|
+
strokePercent: !0,
|
|
26
|
+
fillOpacity: !0,
|
|
27
|
+
strokeOpacity: !0,
|
|
28
|
+
lineDashOffset: !0,
|
|
29
|
+
lineWidth: !0,
|
|
30
|
+
miterLimit: !0
|
|
31
|
+
}, p.style) }, b = s.concat([
|
|
32
|
+
"invisible",
|
|
33
|
+
"culling",
|
|
34
|
+
"z",
|
|
35
|
+
"z2",
|
|
36
|
+
"zlevel",
|
|
37
|
+
"parent"
|
|
38
|
+
]), x = function(n) {
|
|
39
|
+
o(s, n);
|
|
40
|
+
function s(e) {
|
|
41
|
+
return n.call(this, e) || this;
|
|
42
|
+
}
|
|
43
|
+
return s.prototype.update = function() {
|
|
44
|
+
var e = this;
|
|
45
|
+
n.prototype.update.call(this);
|
|
46
|
+
var t = this.style;
|
|
47
|
+
if (t.decal) {
|
|
48
|
+
var r = this._decalEl = this._decalEl || new s();
|
|
49
|
+
r.buildPath === s.prototype.buildPath && (r.buildPath = function(t) {
|
|
50
|
+
e.buildPath(t, e.shape);
|
|
51
|
+
}), r.silent = !0;
|
|
52
|
+
var i = r.style;
|
|
53
|
+
for (var a in t) i[a] !== t[a] && (i[a] = t[a]);
|
|
54
|
+
i.fill = t.fill ? t.decal : null, i.decal = null, i.shadowColor = null, t.strokeFirst && (i.stroke = null);
|
|
55
|
+
for (var o = 0; o < b.length; ++o) r[b[o]] = this[b[o]];
|
|
56
|
+
r.__dirty |= 1;
|
|
57
|
+
} else this._decalEl &&= null;
|
|
58
|
+
}, s.prototype.getDecalElement = function() {
|
|
59
|
+
return this._decalEl;
|
|
60
|
+
}, s.prototype._init = function(e) {
|
|
61
|
+
var t = a(e);
|
|
62
|
+
this.shape = this.getDefaultShape();
|
|
63
|
+
var i = this.getDefaultStyle();
|
|
64
|
+
i && this.useStyle(i);
|
|
65
|
+
for (var o = 0; o < t.length; o++) {
|
|
66
|
+
var s = t[o], c = e[s];
|
|
67
|
+
s === "style" ? this.style ? r(this.style, c) : this.useStyle(c) : s === "shape" ? r(this.shape, c) : n.prototype.attrKV.call(this, s, c);
|
|
68
|
+
}
|
|
69
|
+
this.style || this.useStyle({});
|
|
70
|
+
}, s.prototype.getDefaultStyle = function() {
|
|
71
|
+
return null;
|
|
72
|
+
}, s.prototype.getDefaultShape = function() {
|
|
73
|
+
return {};
|
|
74
|
+
}, s.prototype.canBeInsideText = function() {
|
|
75
|
+
return this.hasFill();
|
|
76
|
+
}, s.prototype.getInsideTextFill = function() {
|
|
77
|
+
var e = this.style.fill;
|
|
78
|
+
if (e !== "none") {
|
|
79
|
+
if (i(e)) {
|
|
80
|
+
var t = c(e, 0);
|
|
81
|
+
return t > .5 ? l : t > .2 ? u : d;
|
|
82
|
+
} else if (e) return d;
|
|
83
|
+
}
|
|
84
|
+
return l;
|
|
85
|
+
}, s.prototype.getInsideTextStroke = function(e) {
|
|
86
|
+
var t = this.style.fill;
|
|
87
|
+
if (i(t)) {
|
|
88
|
+
var n = this.__zr;
|
|
89
|
+
if (!!(n && n.isDarkMode()) == c(e, 0) < .4) return t;
|
|
90
|
+
}
|
|
91
|
+
}, s.prototype.buildPath = function(e, t, n) {}, s.prototype.pathUpdated = function() {
|
|
92
|
+
this.__dirty &= -5;
|
|
93
|
+
}, s.prototype.getUpdatedPathProxy = function(e) {
|
|
94
|
+
return !this.path && this.createPathProxy(), this.path.beginPath(), this.buildPath(this.path, this.shape, e), this.path;
|
|
95
|
+
}, s.prototype.createPathProxy = function() {
|
|
96
|
+
this.path = new h(!1);
|
|
97
|
+
}, s.prototype.hasStroke = function() {
|
|
98
|
+
var e = this.style, t = e.stroke;
|
|
99
|
+
return !(t == null || t === "none" || !(e.lineWidth > 0));
|
|
100
|
+
}, s.prototype.hasFill = function() {
|
|
101
|
+
var e = this.style.fill;
|
|
102
|
+
return e != null && e !== "none";
|
|
103
|
+
}, s.prototype.getBoundingRect = function() {
|
|
104
|
+
var e = this._rect, t = this.style, n = !e;
|
|
105
|
+
if (n) {
|
|
106
|
+
var r = !1;
|
|
107
|
+
this.path || (r = !0, this.createPathProxy());
|
|
108
|
+
var i = this.path;
|
|
109
|
+
(r || this.__dirty & 4) && (i.beginPath(), this.buildPath(i, this.shape, !1), this.pathUpdated()), e = i.getBoundingRect();
|
|
110
|
+
}
|
|
111
|
+
if (this._rect = e, this.hasStroke() && this.path && this.path.len() > 0) {
|
|
112
|
+
var a = this._rectStroke ||= e.clone();
|
|
113
|
+
if (this.__dirty || n) {
|
|
114
|
+
a.copy(e);
|
|
115
|
+
var o = t.strokeNoScale ? this.getLineScale() : 1, s = t.lineWidth;
|
|
116
|
+
if (!this.hasFill()) {
|
|
117
|
+
var c = this.strokeContainThreshold;
|
|
118
|
+
s = Math.max(s, c ?? 4);
|
|
119
|
+
}
|
|
120
|
+
o > 1e-10 && (a.width += s / o, a.height += s / o, a.x -= s / o / 2, a.y -= s / o / 2);
|
|
121
|
+
}
|
|
122
|
+
return a;
|
|
123
|
+
}
|
|
124
|
+
return e;
|
|
125
|
+
}, s.prototype.contain = function(e, t) {
|
|
126
|
+
var n = this.transformCoordToLocal(e, t), r = this.getBoundingRect(), i = this.style;
|
|
127
|
+
if (e = n[0], t = n[1], r.contain(e, t)) {
|
|
128
|
+
var a = this.path;
|
|
129
|
+
if (this.hasStroke()) {
|
|
130
|
+
var o = i.lineWidth, s = i.strokeNoScale ? this.getLineScale() : 1;
|
|
131
|
+
if (s > 1e-10 && (this.hasFill() || (o = Math.max(o, this.strokeContainThreshold)), _(a, o / s, e, t))) return !0;
|
|
132
|
+
}
|
|
133
|
+
if (this.hasFill()) return g(a, e, t);
|
|
134
|
+
}
|
|
135
|
+
return !1;
|
|
136
|
+
}, s.prototype.dirtyShape = function() {
|
|
137
|
+
this.__dirty |= 4, this._rect &&= null, this._decalEl && this._decalEl.dirtyShape(), this.markRedraw();
|
|
138
|
+
}, s.prototype.dirty = function() {
|
|
139
|
+
this.dirtyStyle(), this.dirtyShape();
|
|
140
|
+
}, s.prototype.animateShape = function(e) {
|
|
141
|
+
return this.animate("shape", e);
|
|
142
|
+
}, s.prototype.updateDuringAnimation = function(e) {
|
|
143
|
+
e === "style" ? this.dirtyStyle() : e === "shape" ? this.dirtyShape() : this.markRedraw();
|
|
144
|
+
}, s.prototype.attrKV = function(e, t) {
|
|
145
|
+
e === "shape" ? this.setShape(t) : n.prototype.attrKV.call(this, e, t);
|
|
146
|
+
}, s.prototype.setShape = function(e, t) {
|
|
147
|
+
var n = this.shape;
|
|
148
|
+
return n ||= this.shape = {}, typeof e == "string" ? n[e] = t : r(n, e), this.dirtyShape(), this;
|
|
149
|
+
}, s.prototype.shapeChanged = function() {
|
|
150
|
+
return !!(this.__dirty & 4);
|
|
151
|
+
}, s.prototype.createStyle = function(e) {
|
|
152
|
+
return t(v, e);
|
|
153
|
+
}, s.prototype._innerSaveToNormal = function(e) {
|
|
154
|
+
n.prototype._innerSaveToNormal.call(this, e);
|
|
155
|
+
var t = this._normalState;
|
|
156
|
+
e.shape && !t.shape && (t.shape = r({}, this.shape));
|
|
157
|
+
}, s.prototype._applyStateObj = function(e, t, i, o, s, c) {
|
|
158
|
+
if (n.prototype._applyStateObj.call(this, e, t, i, o, s, c), this.__inHover !== 1) {
|
|
159
|
+
var l = !(t && o), u;
|
|
160
|
+
if (t && t.shape ? s ? o ? u = t.shape : (u = r({}, i.shape), r(u, t.shape)) : (u = r({}, o ? this.shape : i.shape), r(u, t.shape)) : l && (u = i.shape), u) if (s) {
|
|
161
|
+
this.shape = r({}, this.shape);
|
|
162
|
+
for (var d = {}, f = a(u), p = 0; p < f.length; p++) {
|
|
163
|
+
var m = f[p];
|
|
164
|
+
typeof u[m] == "object" ? this.shape[m] = u[m] : d[m] = u[m];
|
|
165
|
+
}
|
|
166
|
+
this._transitionState(e, { shape: d }, c);
|
|
167
|
+
} else this.shape = u, this.dirtyShape();
|
|
168
|
+
}
|
|
169
|
+
}, s.prototype._mergeStates = function(e) {
|
|
170
|
+
for (var t = n.prototype._mergeStates.call(this, e), r, i = 0; i < e.length; i++) {
|
|
171
|
+
var a = e[i];
|
|
172
|
+
a.shape && (r ||= {}, this._mergeStyle(r, a.shape));
|
|
173
|
+
}
|
|
174
|
+
return r && (t.shape = r), t;
|
|
175
|
+
}, s.prototype.getAnimationStyleProps = function() {
|
|
176
|
+
return y;
|
|
177
|
+
}, s.prototype.isZeroArea = function() {
|
|
178
|
+
return !1;
|
|
179
|
+
}, s.extend = function(t) {
|
|
180
|
+
var n = function(n) {
|
|
181
|
+
o(r, n);
|
|
182
|
+
function r(e) {
|
|
183
|
+
var r = n.call(this, e) || this;
|
|
184
|
+
return t.init && t.init.call(r, e), r;
|
|
185
|
+
}
|
|
186
|
+
return r.prototype.getDefaultStyle = function() {
|
|
187
|
+
return e(t.style);
|
|
188
|
+
}, r.prototype.getDefaultShape = function() {
|
|
189
|
+
return e(t.shape);
|
|
190
|
+
}, r;
|
|
191
|
+
}(s);
|
|
192
|
+
for (var r in t) typeof t[r] == "function" && (n.prototype[r] = t[r]);
|
|
193
|
+
return n;
|
|
194
|
+
}, s.initDefaultProps = (function() {
|
|
195
|
+
var e = s.prototype;
|
|
196
|
+
e.type = "path", e.strokeContainThreshold = 5, e.segmentIgnoreThreshold = 0, e.subPixelOptimize = !1, e.autoBatch = !1, e.__dirty = 7;
|
|
197
|
+
})(), s;
|
|
198
|
+
}(f);
|
|
199
|
+
//#endregion
|
|
200
|
+
export { v as DEFAULT_PATH_STYLE, x as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __extends as e } from "../../node_modules/tslib/tslib.es6.js";
|
|
2
|
+
import t from "./Gradient.js";
|
|
3
|
+
//#region node_modules/zrender/lib/graphic/RadialGradient.js
|
|
4
|
+
var n = function(t) {
|
|
5
|
+
e(n, t);
|
|
6
|
+
function n(e, n, r, i, a) {
|
|
7
|
+
var o = t.call(this, i) || this;
|
|
8
|
+
return o.x = e ?? .5, o.y = n ?? .5, o.r = r ?? .5, o.type = "radial", o.global = a || !1, o;
|
|
9
|
+
}
|
|
10
|
+
return n;
|
|
11
|
+
}(t);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DEFAULT_FONT as e } from "../core/platform.js";
|
|
2
|
+
import { createObject as t, defaults as n } from "../core/util.js";
|
|
3
|
+
import { __extends as r } from "../../node_modules/tslib/tslib.es6.js";
|
|
4
|
+
import i from "./Displayable.js";
|
|
5
|
+
import { DEFAULT_PATH_STYLE as a } from "./Path.js";
|
|
6
|
+
import { tSpanCreateBoundingRect as o, tSpanHasStroke as s } from "./helper/parseText.js";
|
|
7
|
+
//#region node_modules/zrender/lib/graphic/TSpan.js
|
|
8
|
+
var c = n({
|
|
9
|
+
strokeFirst: !0,
|
|
10
|
+
font: e,
|
|
11
|
+
x: 0,
|
|
12
|
+
y: 0,
|
|
13
|
+
textAlign: "left",
|
|
14
|
+
textBaseline: "top",
|
|
15
|
+
miterLimit: 2
|
|
16
|
+
}, a), l = function(e) {
|
|
17
|
+
r(n, e);
|
|
18
|
+
function n() {
|
|
19
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
20
|
+
}
|
|
21
|
+
return n.prototype.hasStroke = function() {
|
|
22
|
+
return s(this.style);
|
|
23
|
+
}, n.prototype.hasFill = function() {
|
|
24
|
+
var e = this.style.fill;
|
|
25
|
+
return e != null && e !== "none";
|
|
26
|
+
}, n.prototype.createStyle = function(e) {
|
|
27
|
+
return t(c, e);
|
|
28
|
+
}, n.prototype.setBoundingRect = function(e) {
|
|
29
|
+
this._rect = e;
|
|
30
|
+
}, n.prototype.getBoundingRect = function() {
|
|
31
|
+
return this._rect ||= o(this.style), this._rect;
|
|
32
|
+
}, n.initDefaultProps = (function() {
|
|
33
|
+
var e = n.prototype;
|
|
34
|
+
e.dirtyRectTolerance = 10;
|
|
35
|
+
})(), n;
|
|
36
|
+
}(i);
|
|
37
|
+
l.prototype.type = "tspan";
|
|
38
|
+
//#endregion
|
|
39
|
+
export { l as default };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import "../core/platform.js";
|
|
2
|
+
import { defaults as e, each as t, extend as n, keys as r, normalizeCssArray as i, retrieve2 as a, retrieve3 as o, trim as s } from "../core/util.js";
|
|
3
|
+
import { __extends as c } from "../../node_modules/tslib/tslib.es6.js";
|
|
4
|
+
import l from "../core/BoundingRect.js";
|
|
5
|
+
import { adjustTextX as u, adjustTextY as d } from "../contain/text.js";
|
|
6
|
+
import f, { DEFAULT_COMMON_ANIMATION_PROPS as p } from "./Displayable.js";
|
|
7
|
+
import m from "./Image.js";
|
|
8
|
+
import { calcInnerTextOverflowArea as h, parsePlainText as g, parseRichText as _, tSpanCreateBoundingRect2 as v } from "./helper/parseText.js";
|
|
9
|
+
import y from "./TSpan.js";
|
|
10
|
+
import b from "./shape/Rect.js";
|
|
11
|
+
//#region node_modules/zrender/lib/graphic/Text.js
|
|
12
|
+
var x = { fill: "#000" }, S = 2, C = {}, w = { style: e({
|
|
13
|
+
fill: !0,
|
|
14
|
+
stroke: !0,
|
|
15
|
+
fillOpacity: !0,
|
|
16
|
+
strokeOpacity: !0,
|
|
17
|
+
lineWidth: !0,
|
|
18
|
+
fontSize: !0,
|
|
19
|
+
lineHeight: !0,
|
|
20
|
+
width: !0,
|
|
21
|
+
height: !0,
|
|
22
|
+
textShadowColor: !0,
|
|
23
|
+
textShadowBlur: !0,
|
|
24
|
+
textShadowOffsetX: !0,
|
|
25
|
+
textShadowOffsetY: !0,
|
|
26
|
+
backgroundColor: !0,
|
|
27
|
+
padding: !0,
|
|
28
|
+
borderColor: !0,
|
|
29
|
+
borderWidth: !0,
|
|
30
|
+
borderRadius: !0
|
|
31
|
+
}, p.style) }, T = function(e) {
|
|
32
|
+
c(t, e);
|
|
33
|
+
function t(t) {
|
|
34
|
+
var n = e.call(this) || this;
|
|
35
|
+
return n.type = "text", n._children = [], n._defaultStyle = x, n.attr(t), n;
|
|
36
|
+
}
|
|
37
|
+
return t.prototype.childrenRef = function() {
|
|
38
|
+
return this._children;
|
|
39
|
+
}, t.prototype.update = function() {
|
|
40
|
+
e.prototype.update.call(this), this.styleChanged() && this._updateSubTexts();
|
|
41
|
+
for (var t = 0; t < this._children.length; t++) {
|
|
42
|
+
var n = this._children[t];
|
|
43
|
+
n.zlevel = this.zlevel, n.z = this.z, n.z2 = this.z2, n.culling = this.culling, n.cursor = this.cursor, n.invisible = this.invisible;
|
|
44
|
+
}
|
|
45
|
+
}, t.prototype.updateTransform = function() {
|
|
46
|
+
var t = this.innerTransformable;
|
|
47
|
+
t ? (t.updateTransform(), t.transform && (this.transform = t.transform)) : e.prototype.updateTransform.call(this);
|
|
48
|
+
}, t.prototype.getLocalTransform = function(t) {
|
|
49
|
+
var n = this.innerTransformable;
|
|
50
|
+
return n ? n.getLocalTransform(t) : e.prototype.getLocalTransform.call(this, t);
|
|
51
|
+
}, t.prototype.getComputedTransform = function() {
|
|
52
|
+
return this.__hostTarget && (this.__hostTarget.getComputedTransform(), this.__hostTarget.updateInnerText(!0)), e.prototype.getComputedTransform.call(this);
|
|
53
|
+
}, t.prototype._updateSubTexts = function() {
|
|
54
|
+
this._childCursor = 0, M(this.style), this.style.rich ? this._updateRichTexts() : this._updatePlainTexts(), this._children.length = this._childCursor, this.styleUpdated();
|
|
55
|
+
}, t.prototype.addSelfToZr = function(t) {
|
|
56
|
+
e.prototype.addSelfToZr.call(this, t);
|
|
57
|
+
for (var n = 0; n < this._children.length; n++) this._children[n].__zr = t;
|
|
58
|
+
}, t.prototype.removeSelfFromZr = function(t) {
|
|
59
|
+
e.prototype.removeSelfFromZr.call(this, t);
|
|
60
|
+
for (var n = 0; n < this._children.length; n++) this._children[n].__zr = null;
|
|
61
|
+
}, t.prototype.getBoundingRect = function() {
|
|
62
|
+
if (this.styleChanged() && this._updateSubTexts(), !this._rect) {
|
|
63
|
+
for (var e = new l(0, 0, 0, 0), t = this._children, n = [], r = null, i = 0; i < t.length; i++) {
|
|
64
|
+
var a = t[i], o = a.getBoundingRect(), s = a.getLocalTransform(n);
|
|
65
|
+
s ? (e.copy(o), e.applyTransform(s), r ||= e.clone(), r.union(e)) : (r ||= o.clone(), r.union(o));
|
|
66
|
+
}
|
|
67
|
+
this._rect = r || e;
|
|
68
|
+
}
|
|
69
|
+
return this._rect;
|
|
70
|
+
}, t.prototype.setDefaultTextStyle = function(e) {
|
|
71
|
+
this._defaultStyle = e || x;
|
|
72
|
+
}, t.prototype.setTextContent = function(e) {
|
|
73
|
+
if (process.env.NODE_ENV !== "production") throw Error("Can't attach text on another text");
|
|
74
|
+
}, t.prototype._mergeStyle = function(e, t) {
|
|
75
|
+
if (!t) return e;
|
|
76
|
+
var r = t.rich, i = e.rich || r && {};
|
|
77
|
+
return n(e, t), r && i ? (this._mergeRich(i, r), e.rich = i) : i && (e.rich = i), e;
|
|
78
|
+
}, t.prototype._mergeRich = function(e, t) {
|
|
79
|
+
for (var i = r(t), a = 0; a < i.length; a++) {
|
|
80
|
+
var o = i[a];
|
|
81
|
+
e[o] = e[o] || {}, n(e[o], t[o]);
|
|
82
|
+
}
|
|
83
|
+
}, t.prototype.getAnimationStyleProps = function() {
|
|
84
|
+
return w;
|
|
85
|
+
}, t.prototype._getOrCreateChild = function(e) {
|
|
86
|
+
var t = this._children[this._childCursor];
|
|
87
|
+
return (!t || !(t instanceof e)) && (t = new e()), this._children[this._childCursor++] = t, t.__zr = this.__zr, t.parent = this, t;
|
|
88
|
+
}, t.prototype._updatePlainTexts = function() {
|
|
89
|
+
var e = this.style, t = e.font || "12px sans-serif", n = e.padding, r = this._defaultStyle, i = e.x || 0, a = e.y || 0, o = e.align || r.align || "left", s = e.verticalAlign || r.verticalAlign || "top";
|
|
90
|
+
h(C, r.overflowRect, i, a, o, s), i = C.baseX, a = C.baseY;
|
|
91
|
+
var c = g(L(e), e, C.outerWidth, C.outerHeight), l = R(e), f = !!e.backgroundColor, p = c.outerHeight, m = c.outerWidth, _ = c.lines, b = c.lineHeight;
|
|
92
|
+
this.isTruncated = !!c.isTruncated;
|
|
93
|
+
var x = i, w = d(a, c.contentHeight, s);
|
|
94
|
+
if (l || n) {
|
|
95
|
+
var T = u(i, m, o), E = d(a, p, s);
|
|
96
|
+
l && this._renderBackground(e, e, T, E, m, p);
|
|
97
|
+
}
|
|
98
|
+
w += b / 2, n && (x = I(i, o, n), s === "top" ? w += n[0] : s === "bottom" && (w -= n[2]));
|
|
99
|
+
for (var D = 0, O = !1, k = !1, j = F("fill" in e ? e.fill : (k = !0, r.fill)), M = P("stroke" in e ? e.stroke : !f && (!r.autoStroke || k) ? (D = S, O = !0, r.stroke) : null), N = e.textShadowBlur > 0, z = 0; z < _.length; z++) {
|
|
100
|
+
var B = this._getOrCreateChild(y), V = B.createStyle();
|
|
101
|
+
B.useStyle(V), V.text = _[z], V.x = x, V.y = w, o && (V.textAlign = o), V.textBaseline = "middle", V.opacity = e.opacity, V.strokeFirst = !0, N && (V.shadowBlur = e.textShadowBlur || 0, V.shadowColor = e.textShadowColor || "transparent", V.shadowOffsetX = e.textShadowOffsetX || 0, V.shadowOffsetY = e.textShadowOffsetY || 0), V.stroke = M, V.fill = j, M && (V.lineWidth = e.lineWidth || D, V.lineDash = e.lineDash, V.lineDashOffset = e.lineDashOffset || 0), V.font = t, A(V, e), w += b, B.setBoundingRect(v(V, c.contentWidth, c.calculatedLineHeight, O ? 0 : null));
|
|
102
|
+
}
|
|
103
|
+
}, t.prototype._updateRichTexts = function() {
|
|
104
|
+
var e = this.style, t = this._defaultStyle, n = e.align || t.align, r = e.verticalAlign || t.verticalAlign, i = e.x || 0, a = e.y || 0;
|
|
105
|
+
h(C, t.overflowRect, i, a, n, r), i = C.baseX, a = C.baseY;
|
|
106
|
+
var o = _(L(e), e, C.outerWidth, C.outerHeight, n), s = o.width, c = o.outerWidth, l = o.outerHeight, f = e.padding;
|
|
107
|
+
this.isTruncated = !!o.isTruncated;
|
|
108
|
+
var p = u(i, c, n), m = d(a, l, r), g = p, v = m;
|
|
109
|
+
f && (g += f[3], v += f[0]);
|
|
110
|
+
var y = g + s;
|
|
111
|
+
R(e) && this._renderBackground(e, e, p, m, c, l);
|
|
112
|
+
for (var b = !!e.backgroundColor, x = 0; x < o.lines.length; x++) {
|
|
113
|
+
for (var S = o.lines[x], w = S.tokens, T = w.length, E = S.lineHeight, D = S.width, O = 0, k = g, A = y, j = T - 1, M = void 0; O < T && (M = w[O], !M.align || M.align === "left");) this._placeToken(M, e, E, v, k, "left", b), D -= M.width, k += M.width, O++;
|
|
114
|
+
for (; j >= 0 && (M = w[j], M.align === "right");) this._placeToken(M, e, E, v, A, "right", b), D -= M.width, A -= M.width, j--;
|
|
115
|
+
for (k += (s - (k - g) - (y - A) - D) / 2; O <= j;) M = w[O], this._placeToken(M, e, E, v, k + M.width / 2, "center", b), k += M.width, O++;
|
|
116
|
+
v += E;
|
|
117
|
+
}
|
|
118
|
+
}, t.prototype._placeToken = function(e, t, n, r, i, s, c) {
|
|
119
|
+
var l = t.rich[e.styleName] || {};
|
|
120
|
+
l.text = e.text;
|
|
121
|
+
var u = e.verticalAlign, d = r + n / 2;
|
|
122
|
+
u === "top" ? d = r + e.height / 2 : u === "bottom" && (d = r + n - e.height / 2), !e.isLineHolder && R(l) && this._renderBackground(l, t, s === "right" ? i - e.width : s === "center" ? i - e.width / 2 : i, d - e.height / 2, e.width, e.height);
|
|
123
|
+
var f = !!l.backgroundColor, p = e.textPadding;
|
|
124
|
+
p && (i = I(i, s, p), d -= e.height / 2 - p[0] - e.innerHeight / 2);
|
|
125
|
+
var m = this._getOrCreateChild(y), h = m.createStyle();
|
|
126
|
+
m.useStyle(h);
|
|
127
|
+
var g = this._defaultStyle, _ = !1, b = 0, x = !1, C = F("fill" in l ? l.fill : "fill" in t ? t.fill : (_ = !0, g.fill)), w = P("stroke" in l ? l.stroke : "stroke" in t ? t.stroke : !f && !c && (!g.autoStroke || _) ? (b = S, x = !0, g.stroke) : null), T = l.textShadowBlur > 0 || t.textShadowBlur > 0;
|
|
128
|
+
h.text = e.text, h.x = i, h.y = d, T && (h.shadowBlur = l.textShadowBlur || t.textShadowBlur || 0, h.shadowColor = l.textShadowColor || t.textShadowColor || "transparent", h.shadowOffsetX = l.textShadowOffsetX || t.textShadowOffsetX || 0, h.shadowOffsetY = l.textShadowOffsetY || t.textShadowOffsetY || 0), h.textAlign = s, h.textBaseline = "middle", h.font = e.font || "12px sans-serif", h.opacity = o(l.opacity, t.opacity, 1), A(h, l), w && (h.lineWidth = o(l.lineWidth, t.lineWidth, b), h.lineDash = a(l.lineDash, t.lineDash), h.lineDashOffset = t.lineDashOffset || 0, h.stroke = w), C && (h.fill = C), m.setBoundingRect(v(h, e.contentWidth, e.contentHeight, x ? 0 : null));
|
|
129
|
+
}, t.prototype._renderBackground = function(e, t, n, r, i, s) {
|
|
130
|
+
var c = e.backgroundColor, l = e.borderWidth, u = e.borderColor, d = c && c.image, f = c && !d, p = e.borderRadius, h = this, g, _;
|
|
131
|
+
if (f || e.lineHeight || l && u) {
|
|
132
|
+
g = this._getOrCreateChild(b), g.useStyle(g.createStyle()), g.style.fill = null;
|
|
133
|
+
var v = g.shape;
|
|
134
|
+
v.x = n, v.y = r, v.width = i, v.height = s, v.r = p, g.dirtyShape();
|
|
135
|
+
}
|
|
136
|
+
if (f) {
|
|
137
|
+
var y = g.style;
|
|
138
|
+
y.fill = c || null, y.fillOpacity = a(e.fillOpacity, 1);
|
|
139
|
+
} else if (d) {
|
|
140
|
+
_ = this._getOrCreateChild(m), _.onload = function() {
|
|
141
|
+
h.dirtyStyle();
|
|
142
|
+
};
|
|
143
|
+
var x = _.style;
|
|
144
|
+
x.image = c.image, x.x = n, x.y = r, x.width = i, x.height = s;
|
|
145
|
+
}
|
|
146
|
+
if (l && u) {
|
|
147
|
+
var y = g.style;
|
|
148
|
+
y.lineWidth = l, y.stroke = u, y.strokeOpacity = a(e.strokeOpacity, 1), y.lineDash = e.borderDash, y.lineDashOffset = e.borderDashOffset || 0, g.strokeContainThreshold = 0, g.hasFill() && g.hasStroke() && (y.strokeFirst = !0, y.lineWidth *= 2);
|
|
149
|
+
}
|
|
150
|
+
var S = (g || _).style;
|
|
151
|
+
S.shadowBlur = e.shadowBlur || 0, S.shadowColor = e.shadowColor || "transparent", S.shadowOffsetX = e.shadowOffsetX || 0, S.shadowOffsetY = e.shadowOffsetY || 0, S.opacity = o(e.opacity, t.opacity, 1);
|
|
152
|
+
}, t.makeFont = function(e) {
|
|
153
|
+
var t = "";
|
|
154
|
+
return j(e) && (t = [
|
|
155
|
+
e.fontStyle,
|
|
156
|
+
e.fontWeight,
|
|
157
|
+
k(e.fontSize),
|
|
158
|
+
e.fontFamily || "sans-serif"
|
|
159
|
+
].join(" ")), t && s(t) || e.textFont || e.font;
|
|
160
|
+
}, t;
|
|
161
|
+
}(f), E = {
|
|
162
|
+
left: !0,
|
|
163
|
+
right: 1,
|
|
164
|
+
center: 1
|
|
165
|
+
}, D = {
|
|
166
|
+
top: 1,
|
|
167
|
+
bottom: 1,
|
|
168
|
+
middle: 1
|
|
169
|
+
}, O = [
|
|
170
|
+
"fontStyle",
|
|
171
|
+
"fontWeight",
|
|
172
|
+
"fontSize",
|
|
173
|
+
"fontFamily"
|
|
174
|
+
];
|
|
175
|
+
function k(e) {
|
|
176
|
+
return typeof e == "string" && (e.indexOf("px") !== -1 || e.indexOf("rem") !== -1 || e.indexOf("em") !== -1) ? e : isNaN(+e) ? "12px" : e + "px";
|
|
177
|
+
}
|
|
178
|
+
function A(e, t) {
|
|
179
|
+
for (var n = 0; n < O.length; n++) {
|
|
180
|
+
var r = O[n], i = t[r];
|
|
181
|
+
i != null && (e[r] = i);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function j(e) {
|
|
185
|
+
return e.fontSize != null || e.fontFamily || e.fontWeight;
|
|
186
|
+
}
|
|
187
|
+
function M(e) {
|
|
188
|
+
return N(e), t(e.rich, N), e;
|
|
189
|
+
}
|
|
190
|
+
function N(e) {
|
|
191
|
+
if (e) {
|
|
192
|
+
e.font = T.makeFont(e);
|
|
193
|
+
var t = e.align;
|
|
194
|
+
t === "middle" && (t = "center"), e.align = t == null || E[t] ? t : "left";
|
|
195
|
+
var n = e.verticalAlign;
|
|
196
|
+
n === "center" && (n = "middle"), e.verticalAlign = n == null || D[n] ? n : "top", e.padding &&= i(e.padding);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function P(e, t) {
|
|
200
|
+
return e == null || t <= 0 || e === "transparent" || e === "none" ? null : e.image || e.colorStops ? "#000" : e;
|
|
201
|
+
}
|
|
202
|
+
function F(e) {
|
|
203
|
+
return e == null || e === "none" ? null : e.image || e.colorStops ? "#000" : e;
|
|
204
|
+
}
|
|
205
|
+
function I(e, t, n) {
|
|
206
|
+
return t === "right" ? e - n[1] : t === "center" ? e + n[3] / 2 - n[1] / 2 : e + n[3];
|
|
207
|
+
}
|
|
208
|
+
function L(e) {
|
|
209
|
+
var t = e.text;
|
|
210
|
+
return t != null && (t += ""), t;
|
|
211
|
+
}
|
|
212
|
+
function R(e) {
|
|
213
|
+
return !!(e.backgroundColor || e.lineHeight || e.borderWidth && e.borderColor);
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
export { T as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { platformApi as e } from "../../core/platform.js";
|
|
2
|
+
import t from "../../core/LRU.js";
|
|
3
|
+
//#region node_modules/zrender/lib/graphic/helper/image.js
|
|
4
|
+
var n = new t(50);
|
|
5
|
+
function r(e) {
|
|
6
|
+
if (typeof e == "string") {
|
|
7
|
+
var t = n.get(e);
|
|
8
|
+
return t && t.image;
|
|
9
|
+
} else return e;
|
|
10
|
+
}
|
|
11
|
+
function i(t, r, i, s, c) {
|
|
12
|
+
if (!t) return r;
|
|
13
|
+
if (typeof t == "string") {
|
|
14
|
+
if (r && r.__zrImageSrc === t || !i) return r;
|
|
15
|
+
var l = n.get(t), u = {
|
|
16
|
+
hostEl: i,
|
|
17
|
+
cb: s,
|
|
18
|
+
cbPayload: c
|
|
19
|
+
};
|
|
20
|
+
return l ? (r = l.image, !o(r) && l.pending.push(u)) : (r = e.loadImage(t, a, a), r.__zrImageSrc = t, n.put(t, r.__cachedImgObj = {
|
|
21
|
+
image: r,
|
|
22
|
+
pending: [u]
|
|
23
|
+
})), r;
|
|
24
|
+
} else return t;
|
|
25
|
+
}
|
|
26
|
+
function a() {
|
|
27
|
+
var e = this.__cachedImgObj;
|
|
28
|
+
this.onload = this.onerror = this.__cachedImgObj = null;
|
|
29
|
+
for (var t = 0; t < e.pending.length; t++) {
|
|
30
|
+
var n = e.pending[t], r = n.cb;
|
|
31
|
+
r && r(this, n.cbPayload), n.hostEl.dirty();
|
|
32
|
+
}
|
|
33
|
+
e.pending.length = 0;
|
|
34
|
+
}
|
|
35
|
+
function o(e) {
|
|
36
|
+
return e && e.width && e.height;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { i as createOrUpdateImage, r as findExistImage, o as isImageReady };
|