@leafer-ui/miniapp 1.10.1 → 1.11.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/dist/miniapp.module.js +55 -35
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/miniapp.module.js
CHANGED
|
@@ -872,9 +872,10 @@ const PointHelper = {
|
|
|
872
872
|
getAtan2(t, to) {
|
|
873
873
|
return atan2$2(to.y - t.y, to.x - t.x);
|
|
874
874
|
},
|
|
875
|
-
getDistancePoint(t, to, distance, changeTo) {
|
|
875
|
+
getDistancePoint(t, to, distance, changeTo, fromTo) {
|
|
876
876
|
const r = getAtan2(t, to);
|
|
877
|
-
|
|
877
|
+
fromTo && (t = to);
|
|
878
|
+
changeTo || (to = {});
|
|
878
879
|
to.x = t.x + cos$4(r) * distance;
|
|
879
880
|
to.y = t.y + sin$4(r) * distance;
|
|
880
881
|
return to;
|
|
@@ -884,6 +885,9 @@ const PointHelper = {
|
|
|
884
885
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
885
886
|
return points;
|
|
886
887
|
},
|
|
888
|
+
isSame(t, point) {
|
|
889
|
+
return t.x === point.x && t.y === point.y;
|
|
890
|
+
},
|
|
887
891
|
reset(t) {
|
|
888
892
|
P$5.reset(t);
|
|
889
893
|
}
|
|
@@ -948,8 +952,8 @@ class Point {
|
|
|
948
952
|
getDistance(to) {
|
|
949
953
|
return PointHelper.getDistance(this, to);
|
|
950
954
|
}
|
|
951
|
-
getDistancePoint(to, distance, changeTo) {
|
|
952
|
-
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo));
|
|
955
|
+
getDistancePoint(to, distance, changeTo, fromTo) {
|
|
956
|
+
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
|
|
953
957
|
}
|
|
954
958
|
getAngle(to) {
|
|
955
959
|
return PointHelper.getAngle(this, to);
|
|
@@ -957,6 +961,9 @@ class Point {
|
|
|
957
961
|
getAtan2(to) {
|
|
958
962
|
return PointHelper.getAtan2(this, to);
|
|
959
963
|
}
|
|
964
|
+
isSame(point) {
|
|
965
|
+
return PointHelper.isSame(this, point);
|
|
966
|
+
}
|
|
960
967
|
reset() {
|
|
961
968
|
PointHelper.reset(this);
|
|
962
969
|
return this;
|
|
@@ -2876,6 +2883,15 @@ const EllipseHelper = {
|
|
|
2876
2883
|
}
|
|
2877
2884
|
};
|
|
2878
2885
|
|
|
2886
|
+
const PathCommandNodeHelper = {
|
|
2887
|
+
toCommand(_nodes) {
|
|
2888
|
+
return [];
|
|
2889
|
+
},
|
|
2890
|
+
toNode(_data) {
|
|
2891
|
+
return [];
|
|
2892
|
+
}
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2879
2895
|
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$4, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2880
2896
|
|
|
2881
2897
|
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
@@ -3154,30 +3170,34 @@ const PathConvert = {
|
|
|
3154
3170
|
return data;
|
|
3155
3171
|
},
|
|
3156
3172
|
objectToCanvasData(list) {
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3173
|
+
if (list[0].name.length > 1) {
|
|
3174
|
+
return PathCommandNodeHelper.toCommand(list);
|
|
3175
|
+
} else {
|
|
3176
|
+
const data = [];
|
|
3177
|
+
list.forEach(item => {
|
|
3178
|
+
switch (item.name) {
|
|
3179
|
+
case "M":
|
|
3180
|
+
data.push(M$4, item.x, item.y);
|
|
3181
|
+
break;
|
|
3163
3182
|
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3183
|
+
case "L":
|
|
3184
|
+
data.push(L$5, item.x, item.y);
|
|
3185
|
+
break;
|
|
3167
3186
|
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3187
|
+
case "C":
|
|
3188
|
+
data.push(C$3, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
3189
|
+
break;
|
|
3171
3190
|
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3191
|
+
case "Q":
|
|
3192
|
+
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
3193
|
+
break;
|
|
3175
3194
|
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3195
|
+
case "Z":
|
|
3196
|
+
data.push(Z$4);
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3199
|
+
return data;
|
|
3200
|
+
}
|
|
3181
3201
|
},
|
|
3182
3202
|
copyData(data, old, index, count) {
|
|
3183
3203
|
for (let i = index, end = index + count; i < end; i++) {
|
|
@@ -6835,7 +6855,7 @@ class LeafLevelList {
|
|
|
6835
6855
|
}
|
|
6836
6856
|
}
|
|
6837
6857
|
|
|
6838
|
-
const version = "1.
|
|
6858
|
+
const version = "1.11.0";
|
|
6839
6859
|
|
|
6840
6860
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6841
6861
|
get allowBackgroundColor() {
|
|
@@ -7958,7 +7978,9 @@ const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
|
|
|
7958
7978
|
|
|
7959
7979
|
const {stintSet: stintSet$3} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
|
|
7960
7980
|
|
|
7961
|
-
const emptyPaint = {
|
|
7981
|
+
const emptyPaint = {
|
|
7982
|
+
originPaint: {}
|
|
7983
|
+
};
|
|
7962
7984
|
|
|
7963
7985
|
const debug$2 = Debug.get("UIData");
|
|
7964
7986
|
|
|
@@ -9182,7 +9204,7 @@ let Box = class Box extends Group {
|
|
|
9182
9204
|
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
9183
9205
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
9184
9206
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
9185
|
-
if (isScrollMode = overflow.includes("scroll")) {
|
|
9207
|
+
if (isScrollMode = overflow && overflow.includes("scroll")) {
|
|
9186
9208
|
add(childrenRenderBounds, boxBounds);
|
|
9187
9209
|
scroll(childrenRenderBounds, data);
|
|
9188
9210
|
}
|
|
@@ -10382,10 +10404,12 @@ class Dragger {
|
|
|
10382
10404
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
10383
10405
|
this.dragData.path = path;
|
|
10384
10406
|
if (this.moving) {
|
|
10407
|
+
data.moving = true;
|
|
10385
10408
|
this.dragData.moveType = "drag";
|
|
10386
10409
|
interaction.emit(MoveEvent.BEFORE_MOVE, this.dragData);
|
|
10387
10410
|
interaction.emit(MoveEvent.MOVE, this.dragData);
|
|
10388
10411
|
} else if (this.dragging) {
|
|
10412
|
+
data.dragging = true;
|
|
10389
10413
|
this.dragReal();
|
|
10390
10414
|
interaction.emit(DragEvent.BEFORE_DRAG, this.dragData);
|
|
10391
10415
|
interaction.emit(DragEvent.DRAG, this.dragData);
|
|
@@ -10492,13 +10516,9 @@ function emit$1(type, data, path, excludePath) {
|
|
|
10492
10516
|
if (!path && !data.path) return;
|
|
10493
10517
|
let leaf;
|
|
10494
10518
|
data.type = type;
|
|
10495
|
-
if (path) {
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
});
|
|
10499
|
-
} else {
|
|
10500
|
-
path = data.path;
|
|
10501
|
-
}
|
|
10519
|
+
if (path) data = Object.assign(Object.assign({}, data), {
|
|
10520
|
+
path: path
|
|
10521
|
+
}); else path = data.path;
|
|
10502
10522
|
data.target = path.indexAt(0);
|
|
10503
10523
|
try {
|
|
10504
10524
|
for (let i = path.length - 1; i > -1; i--) {
|
|
@@ -13041,4 +13061,4 @@ try {
|
|
|
13041
13061
|
if (wx) useCanvas("miniapp", wx);
|
|
13042
13062
|
} catch (_a) {}
|
|
13043
13063
|
|
|
13044
|
-
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
13064
|
+
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|