@ibiz-template/runtime 0.5.7-alpha.2 → 0.5.7-alpha.3
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/index.esm.js +1840 -78
- package/dist/index.system.min.js +1 -1
- package/out/application.d.ts +7 -0
- package/out/application.d.ts.map +1 -1
- package/out/application.js +23 -10
- package/out/constant/index.d.ts +1 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -0
- package/out/constant/preset-identifier.d.ts +15 -0
- package/out/constant/preset-identifier.d.ts.map +1 -0
- package/out/constant/preset-identifier.js +16 -0
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +4 -0
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts +23 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts.map +1 -1
- package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.js +56 -4
- package/out/global/global-util/global-util.d.ts +9 -1
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +9 -1
- package/out/interface/common/i-app-service/i-app-service.d.ts +16 -1
- package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
- package/out/interface/util/i-animation-util/i-animation-options.d.ts +31 -0
- package/out/interface/util/i-animation-util/i-animation-options.d.ts.map +1 -0
- package/out/interface/util/i-animation-util/i-animation-options.js +1 -0
- package/out/interface/util/index.d.ts +1 -0
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +11 -0
- package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
- package/out/service/mqtt/mqtt.service.js +1 -0
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +4 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +4 -4
- package/out/service/utils/de-cache/de-cache.d.ts +2 -4
- package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
- package/out/service/utils/de-cache/de-cache.js +4 -8
- package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts +21 -0
- package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts.map +1 -0
- package/out/service/utils/dyna-sys-params/dyna-sys-params.js +48 -0
- package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
- package/out/service/utils/dynamic-code-list/dynamic-code-list.js +9 -5
- package/out/service/utils/index.d.ts +1 -0
- package/out/service/utils/index.d.ts.map +1 -1
- package/out/service/utils/index.js +1 -0
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +8 -0
- package/out/ui-action/uiaction-util.d.ts +23 -0
- package/out/ui-action/uiaction-util.d.ts.map +1 -1
- package/out/ui-action/uiaction-util.js +39 -1
- package/out/utils/anime/anime-element-util.d.ts +44 -0
- package/out/utils/anime/anime-element-util.d.ts.map +1 -0
- package/out/utils/anime/anime-element-util.js +108 -0
- package/out/utils/anime/anime-util/anime-util.d.ts +60 -0
- package/out/utils/anime/anime-util/anime-util.d.ts.map +1 -0
- package/out/utils/anime/anime-util/anime-util.js +96 -0
- package/out/utils/anime/anime.d.ts +27 -0
- package/out/utils/anime/anime.d.ts.map +1 -0
- package/out/utils/anime/anime.js +86 -0
- package/out/utils/anime/index.d.ts +2 -0
- package/out/utils/anime/index.d.ts.map +1 -0
- package/out/utils/anime/index.js +1 -0
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/package.json +8 -4
- package/src/application.ts +31 -16
- package/src/constant/index.ts +1 -0
- package/src/constant/preset-identifier.ts +15 -0
- package/src/controller/common/editor/editor.controller.ts +11 -1
- package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts +68 -4
- package/src/global/global-util/global-util.ts +10 -0
- package/src/interface/common/i-app-service/i-app-service.ts +18 -0
- package/src/interface/util/i-animation-util/i-animation-options.ts +34 -0
- package/src/interface/util/index.ts +1 -0
- package/src/service/dto/method.dto.ts +16 -0
- package/src/service/mqtt/mqtt.service.ts +1 -0
- package/src/service/service/auth/v7-auth.service.ts +5 -0
- package/src/service/service/entity/method/de-action.ts +2 -12
- package/src/service/utils/de-cache/de-cache.ts +4 -18
- package/src/service/utils/dyna-sys-params/dyna-sys-params.ts +66 -0
- package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +9 -6
- package/src/service/utils/index.ts +1 -0
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +8 -0
- package/src/ui-action/uiaction-util.ts +48 -1
- package/src/utils/anime/anime-element-util.ts +141 -0
- package/src/utils/anime/anime-util/anime-util.ts +123 -0
- package/src/utils/anime/anime.ts +111 -0
- package/src/utils/anime/index.ts +1 -0
- package/src/utils/index.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -1073,10 +1073,10 @@ function getViewEngines(view) {
|
|
|
1073
1073
|
if (viewLayoutPanel) {
|
|
1074
1074
|
appViewEngines.push(...viewLayoutPanel.appViewEngines || []);
|
|
1075
1075
|
}
|
|
1076
|
-
return appViewEngines.filter((
|
|
1077
|
-
switch (
|
|
1076
|
+
return appViewEngines.filter((engine2) => {
|
|
1077
|
+
switch (engine2.engineCat) {
|
|
1078
1078
|
case "CTRL":
|
|
1079
|
-
ibiz.log.warn("\u672A\u652F\u6301\u7684\u5F15\u64CE\u5206\u7C7B\uFF1A".concat(
|
|
1079
|
+
ibiz.log.warn("\u672A\u652F\u6301\u7684\u5F15\u64CE\u5206\u7C7B\uFF1A".concat(engine2.engineType));
|
|
1080
1080
|
return false;
|
|
1081
1081
|
default:
|
|
1082
1082
|
return true;
|
|
@@ -2644,6 +2644,12 @@ var ViewType = /* @__PURE__ */ ((ViewType2) => {
|
|
|
2644
2644
|
return ViewType2;
|
|
2645
2645
|
})(ViewType || {});
|
|
2646
2646
|
|
|
2647
|
+
// src/constant/preset-identifier.ts
|
|
2648
|
+
var PresetIdentifier = /* @__PURE__ */ ((PresetIdentifier2) => {
|
|
2649
|
+
PresetIdentifier2["MESSAGE"] = "preset-message";
|
|
2650
|
+
return PresetIdentifier2;
|
|
2651
|
+
})(PresetIdentifier || {});
|
|
2652
|
+
|
|
2647
2653
|
// src/utils/modal/modal.ts
|
|
2648
2654
|
var Modal = class {
|
|
2649
2655
|
constructor(opts) {
|
|
@@ -3236,6 +3242,1608 @@ async function handleAllSettled(values, isThrow = true) {
|
|
|
3236
3242
|
return successResult;
|
|
3237
3243
|
}
|
|
3238
3244
|
|
|
3245
|
+
// src/utils/anime/anime-element-util.ts
|
|
3246
|
+
var baseStyle = {
|
|
3247
|
+
position: "fixed",
|
|
3248
|
+
zIndex: "10000"
|
|
3249
|
+
};
|
|
3250
|
+
function cloneElement(clone31, teleport = document.body, isRemoveChild = true) {
|
|
3251
|
+
const element = getAnimationElement(clone31);
|
|
3252
|
+
if (element == null) {
|
|
3253
|
+
throw new Error("Cannot clone a null or undefined element.");
|
|
3254
|
+
}
|
|
3255
|
+
const clonedElement = element.cloneNode(true);
|
|
3256
|
+
if (isRemoveChild) {
|
|
3257
|
+
while (clonedElement.firstChild) {
|
|
3258
|
+
clonedElement.removeChild(clonedElement.firstChild);
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
const styles = getElementAttribute(element);
|
|
3262
|
+
setElementStyle(clonedElement, styles);
|
|
3263
|
+
teleport.appendChild(clonedElement);
|
|
3264
|
+
return clonedElement;
|
|
3265
|
+
}
|
|
3266
|
+
function setElementStyle(element, {
|
|
3267
|
+
width,
|
|
3268
|
+
height,
|
|
3269
|
+
boundingLeft,
|
|
3270
|
+
boundingTop
|
|
3271
|
+
}) {
|
|
3272
|
+
element.style.left = "".concat(boundingLeft, "px");
|
|
3273
|
+
element.style.top = "".concat(boundingTop, "px");
|
|
3274
|
+
element.style.width = "".concat(width, "px");
|
|
3275
|
+
element.style.height = "".concat(height, "px");
|
|
3276
|
+
Object.assign(element.style, baseStyle);
|
|
3277
|
+
}
|
|
3278
|
+
function getElementAttribute(element) {
|
|
3279
|
+
const width = element.offsetWidth;
|
|
3280
|
+
const height = element.offsetHeight;
|
|
3281
|
+
const styles = window.getComputedStyle(element);
|
|
3282
|
+
const padding = parseFloat(styles.padding);
|
|
3283
|
+
const { left: boundingLeft, top: boundingTop } = element.getBoundingClientRect();
|
|
3284
|
+
return {
|
|
3285
|
+
width,
|
|
3286
|
+
height,
|
|
3287
|
+
padding,
|
|
3288
|
+
boundingLeft,
|
|
3289
|
+
boundingTop
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
function getAnimationElement(element) {
|
|
3293
|
+
if (typeof element === "string") {
|
|
3294
|
+
return document.querySelector(element);
|
|
3295
|
+
}
|
|
3296
|
+
return element;
|
|
3297
|
+
}
|
|
3298
|
+
function destroyElement(ele) {
|
|
3299
|
+
if (ele) {
|
|
3300
|
+
ele.remove();
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
// ../../node_modules/.pnpm/animejs@3.2.2/node_modules/animejs/lib/anime.es.js
|
|
3305
|
+
var defaultInstanceSettings = {
|
|
3306
|
+
update: null,
|
|
3307
|
+
begin: null,
|
|
3308
|
+
loopBegin: null,
|
|
3309
|
+
changeBegin: null,
|
|
3310
|
+
change: null,
|
|
3311
|
+
changeComplete: null,
|
|
3312
|
+
loopComplete: null,
|
|
3313
|
+
complete: null,
|
|
3314
|
+
loop: 1,
|
|
3315
|
+
direction: "normal",
|
|
3316
|
+
autoplay: true,
|
|
3317
|
+
timelineOffset: 0
|
|
3318
|
+
};
|
|
3319
|
+
var defaultTweenSettings = {
|
|
3320
|
+
duration: 1e3,
|
|
3321
|
+
delay: 0,
|
|
3322
|
+
endDelay: 0,
|
|
3323
|
+
easing: "easeOutElastic(1, .5)",
|
|
3324
|
+
round: 0
|
|
3325
|
+
};
|
|
3326
|
+
var validTransforms = ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skew", "skewX", "skewY", "perspective", "matrix", "matrix3d"];
|
|
3327
|
+
var cache = {
|
|
3328
|
+
CSS: {},
|
|
3329
|
+
springs: {}
|
|
3330
|
+
};
|
|
3331
|
+
function minMax(val, min, max) {
|
|
3332
|
+
return Math.min(Math.max(val, min), max);
|
|
3333
|
+
}
|
|
3334
|
+
function stringContains(str, text) {
|
|
3335
|
+
return str.indexOf(text) > -1;
|
|
3336
|
+
}
|
|
3337
|
+
function applyArguments(func, args) {
|
|
3338
|
+
return func.apply(null, args);
|
|
3339
|
+
}
|
|
3340
|
+
var is = {
|
|
3341
|
+
arr: function(a) {
|
|
3342
|
+
return Array.isArray(a);
|
|
3343
|
+
},
|
|
3344
|
+
obj: function(a) {
|
|
3345
|
+
return stringContains(Object.prototype.toString.call(a), "Object");
|
|
3346
|
+
},
|
|
3347
|
+
pth: function(a) {
|
|
3348
|
+
return is.obj(a) && a.hasOwnProperty("totalLength");
|
|
3349
|
+
},
|
|
3350
|
+
svg: function(a) {
|
|
3351
|
+
return a instanceof SVGElement;
|
|
3352
|
+
},
|
|
3353
|
+
inp: function(a) {
|
|
3354
|
+
return a instanceof HTMLInputElement;
|
|
3355
|
+
},
|
|
3356
|
+
dom: function(a) {
|
|
3357
|
+
return a.nodeType || is.svg(a);
|
|
3358
|
+
},
|
|
3359
|
+
str: function(a) {
|
|
3360
|
+
return typeof a === "string";
|
|
3361
|
+
},
|
|
3362
|
+
fnc: function(a) {
|
|
3363
|
+
return typeof a === "function";
|
|
3364
|
+
},
|
|
3365
|
+
und: function(a) {
|
|
3366
|
+
return typeof a === "undefined";
|
|
3367
|
+
},
|
|
3368
|
+
nil: function(a) {
|
|
3369
|
+
return is.und(a) || a === null;
|
|
3370
|
+
},
|
|
3371
|
+
hex: function(a) {
|
|
3372
|
+
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a);
|
|
3373
|
+
},
|
|
3374
|
+
rgb: function(a) {
|
|
3375
|
+
return /^rgb/.test(a);
|
|
3376
|
+
},
|
|
3377
|
+
hsl: function(a) {
|
|
3378
|
+
return /^hsl/.test(a);
|
|
3379
|
+
},
|
|
3380
|
+
col: function(a) {
|
|
3381
|
+
return is.hex(a) || is.rgb(a) || is.hsl(a);
|
|
3382
|
+
},
|
|
3383
|
+
key: function(a) {
|
|
3384
|
+
return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== "targets" && a !== "keyframes";
|
|
3385
|
+
}
|
|
3386
|
+
};
|
|
3387
|
+
function parseEasingParameters(string) {
|
|
3388
|
+
var match = /\(([^)]+)\)/.exec(string);
|
|
3389
|
+
return match ? match[1].split(",").map(function(p) {
|
|
3390
|
+
return parseFloat(p);
|
|
3391
|
+
}) : [];
|
|
3392
|
+
}
|
|
3393
|
+
function spring(string, duration) {
|
|
3394
|
+
var params = parseEasingParameters(string);
|
|
3395
|
+
var mass = minMax(is.und(params[0]) ? 1 : params[0], 0.1, 100);
|
|
3396
|
+
var stiffness = minMax(is.und(params[1]) ? 100 : params[1], 0.1, 100);
|
|
3397
|
+
var damping = minMax(is.und(params[2]) ? 10 : params[2], 0.1, 100);
|
|
3398
|
+
var velocity = minMax(is.und(params[3]) ? 0 : params[3], 0.1, 100);
|
|
3399
|
+
var w0 = Math.sqrt(stiffness / mass);
|
|
3400
|
+
var zeta = damping / (2 * Math.sqrt(stiffness * mass));
|
|
3401
|
+
var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
|
|
3402
|
+
var a = 1;
|
|
3403
|
+
var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
|
|
3404
|
+
function solver(t) {
|
|
3405
|
+
var progress = duration ? duration * t / 1e3 : t;
|
|
3406
|
+
if (zeta < 1) {
|
|
3407
|
+
progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));
|
|
3408
|
+
} else {
|
|
3409
|
+
progress = (a + b * progress) * Math.exp(-progress * w0);
|
|
3410
|
+
}
|
|
3411
|
+
if (t === 0 || t === 1) {
|
|
3412
|
+
return t;
|
|
3413
|
+
}
|
|
3414
|
+
return 1 - progress;
|
|
3415
|
+
}
|
|
3416
|
+
function getDuration() {
|
|
3417
|
+
var cached = cache.springs[string];
|
|
3418
|
+
if (cached) {
|
|
3419
|
+
return cached;
|
|
3420
|
+
}
|
|
3421
|
+
var frame = 1 / 6;
|
|
3422
|
+
var elapsed = 0;
|
|
3423
|
+
var rest = 0;
|
|
3424
|
+
while (true) {
|
|
3425
|
+
elapsed += frame;
|
|
3426
|
+
if (solver(elapsed) === 1) {
|
|
3427
|
+
rest++;
|
|
3428
|
+
if (rest >= 16) {
|
|
3429
|
+
break;
|
|
3430
|
+
}
|
|
3431
|
+
} else {
|
|
3432
|
+
rest = 0;
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
var duration2 = elapsed * frame * 1e3;
|
|
3436
|
+
cache.springs[string] = duration2;
|
|
3437
|
+
return duration2;
|
|
3438
|
+
}
|
|
3439
|
+
return duration ? solver : getDuration;
|
|
3440
|
+
}
|
|
3441
|
+
function steps(steps2) {
|
|
3442
|
+
if (steps2 === void 0)
|
|
3443
|
+
steps2 = 10;
|
|
3444
|
+
return function(t) {
|
|
3445
|
+
return Math.ceil(minMax(t, 1e-6, 1) * steps2) * (1 / steps2);
|
|
3446
|
+
};
|
|
3447
|
+
}
|
|
3448
|
+
var bezier = function() {
|
|
3449
|
+
var kSplineTableSize = 11;
|
|
3450
|
+
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
3451
|
+
function A(aA1, aA2) {
|
|
3452
|
+
return 1 - 3 * aA2 + 3 * aA1;
|
|
3453
|
+
}
|
|
3454
|
+
function B(aA1, aA2) {
|
|
3455
|
+
return 3 * aA2 - 6 * aA1;
|
|
3456
|
+
}
|
|
3457
|
+
function C(aA1) {
|
|
3458
|
+
return 3 * aA1;
|
|
3459
|
+
}
|
|
3460
|
+
function calcBezier(aT, aA1, aA2) {
|
|
3461
|
+
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
|
|
3462
|
+
}
|
|
3463
|
+
function getSlope(aT, aA1, aA2) {
|
|
3464
|
+
return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);
|
|
3465
|
+
}
|
|
3466
|
+
function binarySubdivide(aX, aA, aB, mX1, mX2) {
|
|
3467
|
+
var currentX, currentT, i = 0;
|
|
3468
|
+
do {
|
|
3469
|
+
currentT = aA + (aB - aA) / 2;
|
|
3470
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
3471
|
+
if (currentX > 0) {
|
|
3472
|
+
aB = currentT;
|
|
3473
|
+
} else {
|
|
3474
|
+
aA = currentT;
|
|
3475
|
+
}
|
|
3476
|
+
} while (Math.abs(currentX) > 1e-7 && ++i < 10);
|
|
3477
|
+
return currentT;
|
|
3478
|
+
}
|
|
3479
|
+
function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
|
|
3480
|
+
for (var i = 0; i < 4; ++i) {
|
|
3481
|
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
3482
|
+
if (currentSlope === 0) {
|
|
3483
|
+
return aGuessT;
|
|
3484
|
+
}
|
|
3485
|
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
3486
|
+
aGuessT -= currentX / currentSlope;
|
|
3487
|
+
}
|
|
3488
|
+
return aGuessT;
|
|
3489
|
+
}
|
|
3490
|
+
function bezier2(mX1, mY1, mX2, mY2) {
|
|
3491
|
+
if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
|
|
3492
|
+
return;
|
|
3493
|
+
}
|
|
3494
|
+
var sampleValues = new Float32Array(kSplineTableSize);
|
|
3495
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
3496
|
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
|
3497
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
function getTForX(aX) {
|
|
3501
|
+
var intervalStart = 0;
|
|
3502
|
+
var currentSample = 1;
|
|
3503
|
+
var lastSample = kSplineTableSize - 1;
|
|
3504
|
+
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
3505
|
+
intervalStart += kSampleStepSize;
|
|
3506
|
+
}
|
|
3507
|
+
--currentSample;
|
|
3508
|
+
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
3509
|
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
|
3510
|
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
|
3511
|
+
if (initialSlope >= 1e-3) {
|
|
3512
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
3513
|
+
} else if (initialSlope === 0) {
|
|
3514
|
+
return guessForT;
|
|
3515
|
+
} else {
|
|
3516
|
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
return function(x) {
|
|
3520
|
+
if (mX1 === mY1 && mX2 === mY2) {
|
|
3521
|
+
return x;
|
|
3522
|
+
}
|
|
3523
|
+
if (x === 0 || x === 1) {
|
|
3524
|
+
return x;
|
|
3525
|
+
}
|
|
3526
|
+
return calcBezier(getTForX(x), mY1, mY2);
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
return bezier2;
|
|
3530
|
+
}();
|
|
3531
|
+
var penner = function() {
|
|
3532
|
+
var eases = { linear: function() {
|
|
3533
|
+
return function(t) {
|
|
3534
|
+
return t;
|
|
3535
|
+
};
|
|
3536
|
+
} };
|
|
3537
|
+
var functionEasings = {
|
|
3538
|
+
Sine: function() {
|
|
3539
|
+
return function(t) {
|
|
3540
|
+
return 1 - Math.cos(t * Math.PI / 2);
|
|
3541
|
+
};
|
|
3542
|
+
},
|
|
3543
|
+
Expo: function() {
|
|
3544
|
+
return function(t) {
|
|
3545
|
+
return t ? Math.pow(2, 10 * t - 10) : 0;
|
|
3546
|
+
};
|
|
3547
|
+
},
|
|
3548
|
+
Circ: function() {
|
|
3549
|
+
return function(t) {
|
|
3550
|
+
return 1 - Math.sqrt(1 - t * t);
|
|
3551
|
+
};
|
|
3552
|
+
},
|
|
3553
|
+
Back: function() {
|
|
3554
|
+
return function(t) {
|
|
3555
|
+
return t * t * (3 * t - 2);
|
|
3556
|
+
};
|
|
3557
|
+
},
|
|
3558
|
+
Bounce: function() {
|
|
3559
|
+
return function(t) {
|
|
3560
|
+
var pow2, b = 4;
|
|
3561
|
+
while (t < ((pow2 = Math.pow(2, --b)) - 1) / 11) {
|
|
3562
|
+
}
|
|
3563
|
+
return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - t, 2);
|
|
3564
|
+
};
|
|
3565
|
+
},
|
|
3566
|
+
Elastic: function(amplitude, period) {
|
|
3567
|
+
if (amplitude === void 0)
|
|
3568
|
+
amplitude = 1;
|
|
3569
|
+
if (period === void 0)
|
|
3570
|
+
period = 0.5;
|
|
3571
|
+
var a = minMax(amplitude, 1, 10);
|
|
3572
|
+
var p = minMax(period, 0.1, 2);
|
|
3573
|
+
return function(t) {
|
|
3574
|
+
return t === 0 || t === 1 ? t : -a * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1 - p / (Math.PI * 2) * Math.asin(1 / a)) * (Math.PI * 2) / p);
|
|
3575
|
+
};
|
|
3576
|
+
}
|
|
3577
|
+
};
|
|
3578
|
+
var baseEasings = ["Quad", "Cubic", "Quart", "Quint"];
|
|
3579
|
+
baseEasings.forEach(function(name, i) {
|
|
3580
|
+
functionEasings[name] = function() {
|
|
3581
|
+
return function(t) {
|
|
3582
|
+
return Math.pow(t, i + 2);
|
|
3583
|
+
};
|
|
3584
|
+
};
|
|
3585
|
+
});
|
|
3586
|
+
Object.keys(functionEasings).forEach(function(name) {
|
|
3587
|
+
var easeIn = functionEasings[name];
|
|
3588
|
+
eases["easeIn" + name] = easeIn;
|
|
3589
|
+
eases["easeOut" + name] = function(a, b) {
|
|
3590
|
+
return function(t) {
|
|
3591
|
+
return 1 - easeIn(a, b)(1 - t);
|
|
3592
|
+
};
|
|
3593
|
+
};
|
|
3594
|
+
eases["easeInOut" + name] = function(a, b) {
|
|
3595
|
+
return function(t) {
|
|
3596
|
+
return t < 0.5 ? easeIn(a, b)(t * 2) / 2 : 1 - easeIn(a, b)(t * -2 + 2) / 2;
|
|
3597
|
+
};
|
|
3598
|
+
};
|
|
3599
|
+
eases["easeOutIn" + name] = function(a, b) {
|
|
3600
|
+
return function(t) {
|
|
3601
|
+
return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 : (easeIn(a, b)(t * 2 - 1) + 1) / 2;
|
|
3602
|
+
};
|
|
3603
|
+
};
|
|
3604
|
+
});
|
|
3605
|
+
return eases;
|
|
3606
|
+
}();
|
|
3607
|
+
function parseEasings(easing, duration) {
|
|
3608
|
+
if (is.fnc(easing)) {
|
|
3609
|
+
return easing;
|
|
3610
|
+
}
|
|
3611
|
+
var name = easing.split("(")[0];
|
|
3612
|
+
var ease = penner[name];
|
|
3613
|
+
var args = parseEasingParameters(easing);
|
|
3614
|
+
switch (name) {
|
|
3615
|
+
case "spring":
|
|
3616
|
+
return spring(easing, duration);
|
|
3617
|
+
case "cubicBezier":
|
|
3618
|
+
return applyArguments(bezier, args);
|
|
3619
|
+
case "steps":
|
|
3620
|
+
return applyArguments(steps, args);
|
|
3621
|
+
default:
|
|
3622
|
+
return applyArguments(ease, args);
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
function selectString(str) {
|
|
3626
|
+
try {
|
|
3627
|
+
var nodes = document.querySelectorAll(str);
|
|
3628
|
+
return nodes;
|
|
3629
|
+
} catch (e) {
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
function filterArray(arr, callback) {
|
|
3634
|
+
var len = arr.length;
|
|
3635
|
+
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
|
|
3636
|
+
var result = [];
|
|
3637
|
+
for (var i = 0; i < len; i++) {
|
|
3638
|
+
if (i in arr) {
|
|
3639
|
+
var val = arr[i];
|
|
3640
|
+
if (callback.call(thisArg, val, i, arr)) {
|
|
3641
|
+
result.push(val);
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
return result;
|
|
3646
|
+
}
|
|
3647
|
+
function flattenArray(arr) {
|
|
3648
|
+
return arr.reduce(function(a, b) {
|
|
3649
|
+
return a.concat(is.arr(b) ? flattenArray(b) : b);
|
|
3650
|
+
}, []);
|
|
3651
|
+
}
|
|
3652
|
+
function toArray(o) {
|
|
3653
|
+
if (is.arr(o)) {
|
|
3654
|
+
return o;
|
|
3655
|
+
}
|
|
3656
|
+
if (is.str(o)) {
|
|
3657
|
+
o = selectString(o) || o;
|
|
3658
|
+
}
|
|
3659
|
+
if (o instanceof NodeList || o instanceof HTMLCollection) {
|
|
3660
|
+
return [].slice.call(o);
|
|
3661
|
+
}
|
|
3662
|
+
return [o];
|
|
3663
|
+
}
|
|
3664
|
+
function arrayContains(arr, val) {
|
|
3665
|
+
return arr.some(function(a) {
|
|
3666
|
+
return a === val;
|
|
3667
|
+
});
|
|
3668
|
+
}
|
|
3669
|
+
function cloneObject(o) {
|
|
3670
|
+
var clone31 = {};
|
|
3671
|
+
for (var p in o) {
|
|
3672
|
+
clone31[p] = o[p];
|
|
3673
|
+
}
|
|
3674
|
+
return clone31;
|
|
3675
|
+
}
|
|
3676
|
+
function replaceObjectProps(o1, o2) {
|
|
3677
|
+
var o = cloneObject(o1);
|
|
3678
|
+
for (var p in o1) {
|
|
3679
|
+
o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p];
|
|
3680
|
+
}
|
|
3681
|
+
return o;
|
|
3682
|
+
}
|
|
3683
|
+
function mergeObjects(o1, o2) {
|
|
3684
|
+
var o = cloneObject(o1);
|
|
3685
|
+
for (var p in o2) {
|
|
3686
|
+
o[p] = is.und(o1[p]) ? o2[p] : o1[p];
|
|
3687
|
+
}
|
|
3688
|
+
return o;
|
|
3689
|
+
}
|
|
3690
|
+
function rgbToRgba(rgbValue) {
|
|
3691
|
+
var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue);
|
|
3692
|
+
return rgb ? "rgba(" + rgb[1] + ",1)" : rgbValue;
|
|
3693
|
+
}
|
|
3694
|
+
function hexToRgba(hexValue) {
|
|
3695
|
+
var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
3696
|
+
var hex = hexValue.replace(rgx, function(m, r2, g2, b2) {
|
|
3697
|
+
return r2 + r2 + g2 + g2 + b2 + b2;
|
|
3698
|
+
});
|
|
3699
|
+
var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
3700
|
+
var r = parseInt(rgb[1], 16);
|
|
3701
|
+
var g = parseInt(rgb[2], 16);
|
|
3702
|
+
var b = parseInt(rgb[3], 16);
|
|
3703
|
+
return "rgba(" + r + "," + g + "," + b + ",1)";
|
|
3704
|
+
}
|
|
3705
|
+
function hslToRgba(hslValue) {
|
|
3706
|
+
var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue);
|
|
3707
|
+
var h = parseInt(hsl[1], 10) / 360;
|
|
3708
|
+
var s = parseInt(hsl[2], 10) / 100;
|
|
3709
|
+
var l = parseInt(hsl[3], 10) / 100;
|
|
3710
|
+
var a = hsl[4] || 1;
|
|
3711
|
+
function hue2rgb(p2, q2, t) {
|
|
3712
|
+
if (t < 0) {
|
|
3713
|
+
t += 1;
|
|
3714
|
+
}
|
|
3715
|
+
if (t > 1) {
|
|
3716
|
+
t -= 1;
|
|
3717
|
+
}
|
|
3718
|
+
if (t < 1 / 6) {
|
|
3719
|
+
return p2 + (q2 - p2) * 6 * t;
|
|
3720
|
+
}
|
|
3721
|
+
if (t < 1 / 2) {
|
|
3722
|
+
return q2;
|
|
3723
|
+
}
|
|
3724
|
+
if (t < 2 / 3) {
|
|
3725
|
+
return p2 + (q2 - p2) * (2 / 3 - t) * 6;
|
|
3726
|
+
}
|
|
3727
|
+
return p2;
|
|
3728
|
+
}
|
|
3729
|
+
var r, g, b;
|
|
3730
|
+
if (s == 0) {
|
|
3731
|
+
r = g = b = l;
|
|
3732
|
+
} else {
|
|
3733
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
3734
|
+
var p = 2 * l - q;
|
|
3735
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
3736
|
+
g = hue2rgb(p, q, h);
|
|
3737
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
3738
|
+
}
|
|
3739
|
+
return "rgba(" + r * 255 + "," + g * 255 + "," + b * 255 + "," + a + ")";
|
|
3740
|
+
}
|
|
3741
|
+
function colorToRgb(val) {
|
|
3742
|
+
if (is.rgb(val)) {
|
|
3743
|
+
return rgbToRgba(val);
|
|
3744
|
+
}
|
|
3745
|
+
if (is.hex(val)) {
|
|
3746
|
+
return hexToRgba(val);
|
|
3747
|
+
}
|
|
3748
|
+
if (is.hsl(val)) {
|
|
3749
|
+
return hslToRgba(val);
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
function getUnit(val) {
|
|
3753
|
+
var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);
|
|
3754
|
+
if (split) {
|
|
3755
|
+
return split[1];
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
function getTransformUnit(propName) {
|
|
3759
|
+
if (stringContains(propName, "translate") || propName === "perspective") {
|
|
3760
|
+
return "px";
|
|
3761
|
+
}
|
|
3762
|
+
if (stringContains(propName, "rotate") || stringContains(propName, "skew")) {
|
|
3763
|
+
return "deg";
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
function getFunctionValue(val, animatable) {
|
|
3767
|
+
if (!is.fnc(val)) {
|
|
3768
|
+
return val;
|
|
3769
|
+
}
|
|
3770
|
+
return val(animatable.target, animatable.id, animatable.total);
|
|
3771
|
+
}
|
|
3772
|
+
function getAttribute(el, prop) {
|
|
3773
|
+
return el.getAttribute(prop);
|
|
3774
|
+
}
|
|
3775
|
+
function convertPxToUnit(el, value, unit) {
|
|
3776
|
+
var valueUnit = getUnit(value);
|
|
3777
|
+
if (arrayContains([unit, "deg", "rad", "turn"], valueUnit)) {
|
|
3778
|
+
return value;
|
|
3779
|
+
}
|
|
3780
|
+
var cached = cache.CSS[value + unit];
|
|
3781
|
+
if (!is.und(cached)) {
|
|
3782
|
+
return cached;
|
|
3783
|
+
}
|
|
3784
|
+
var baseline = 100;
|
|
3785
|
+
var tempEl = document.createElement(el.tagName);
|
|
3786
|
+
var parentEl = el.parentNode && el.parentNode !== document ? el.parentNode : document.body;
|
|
3787
|
+
parentEl.appendChild(tempEl);
|
|
3788
|
+
tempEl.style.position = "absolute";
|
|
3789
|
+
tempEl.style.width = baseline + unit;
|
|
3790
|
+
var factor = baseline / tempEl.offsetWidth;
|
|
3791
|
+
parentEl.removeChild(tempEl);
|
|
3792
|
+
var convertedUnit = factor * parseFloat(value);
|
|
3793
|
+
cache.CSS[value + unit] = convertedUnit;
|
|
3794
|
+
return convertedUnit;
|
|
3795
|
+
}
|
|
3796
|
+
function getCSSValue(el, prop, unit) {
|
|
3797
|
+
if (prop in el.style) {
|
|
3798
|
+
var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3799
|
+
var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || "0";
|
|
3800
|
+
return unit ? convertPxToUnit(el, value, unit) : value;
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3803
|
+
function getAnimationType(el, prop) {
|
|
3804
|
+
if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || is.svg(el) && el[prop])) {
|
|
3805
|
+
return "attribute";
|
|
3806
|
+
}
|
|
3807
|
+
if (is.dom(el) && arrayContains(validTransforms, prop)) {
|
|
3808
|
+
return "transform";
|
|
3809
|
+
}
|
|
3810
|
+
if (is.dom(el) && (prop !== "transform" && getCSSValue(el, prop))) {
|
|
3811
|
+
return "css";
|
|
3812
|
+
}
|
|
3813
|
+
if (el[prop] != null) {
|
|
3814
|
+
return "object";
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
function getElementTransforms(el) {
|
|
3818
|
+
if (!is.dom(el)) {
|
|
3819
|
+
return;
|
|
3820
|
+
}
|
|
3821
|
+
var str = el.style.transform || "";
|
|
3822
|
+
var reg2 = /(\w+)\(([^)]*)\)/g;
|
|
3823
|
+
var transforms = /* @__PURE__ */ new Map();
|
|
3824
|
+
var m;
|
|
3825
|
+
while (m = reg2.exec(str)) {
|
|
3826
|
+
transforms.set(m[1], m[2]);
|
|
3827
|
+
}
|
|
3828
|
+
return transforms;
|
|
3829
|
+
}
|
|
3830
|
+
function getTransformValue(el, propName, animatable, unit) {
|
|
3831
|
+
var defaultVal = stringContains(propName, "scale") ? 1 : 0 + getTransformUnit(propName);
|
|
3832
|
+
var value = getElementTransforms(el).get(propName) || defaultVal;
|
|
3833
|
+
if (animatable) {
|
|
3834
|
+
animatable.transforms.list.set(propName, value);
|
|
3835
|
+
animatable.transforms["last"] = propName;
|
|
3836
|
+
}
|
|
3837
|
+
return unit ? convertPxToUnit(el, value, unit) : value;
|
|
3838
|
+
}
|
|
3839
|
+
function getOriginalTargetValue(target, propName, unit, animatable) {
|
|
3840
|
+
switch (getAnimationType(target, propName)) {
|
|
3841
|
+
case "transform":
|
|
3842
|
+
return getTransformValue(target, propName, animatable, unit);
|
|
3843
|
+
case "css":
|
|
3844
|
+
return getCSSValue(target, propName, unit);
|
|
3845
|
+
case "attribute":
|
|
3846
|
+
return getAttribute(target, propName);
|
|
3847
|
+
default:
|
|
3848
|
+
return target[propName] || 0;
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
function getRelativeValue(to, from) {
|
|
3852
|
+
var operator = /^(\*=|\+=|-=)/.exec(to);
|
|
3853
|
+
if (!operator) {
|
|
3854
|
+
return to;
|
|
3855
|
+
}
|
|
3856
|
+
var u = getUnit(to) || 0;
|
|
3857
|
+
var x = parseFloat(from);
|
|
3858
|
+
var y = parseFloat(to.replace(operator[0], ""));
|
|
3859
|
+
switch (operator[0][0]) {
|
|
3860
|
+
case "+":
|
|
3861
|
+
return x + y + u;
|
|
3862
|
+
case "-":
|
|
3863
|
+
return x - y + u;
|
|
3864
|
+
case "*":
|
|
3865
|
+
return x * y + u;
|
|
3866
|
+
}
|
|
3867
|
+
}
|
|
3868
|
+
function validateValue(val, unit) {
|
|
3869
|
+
if (is.col(val)) {
|
|
3870
|
+
return colorToRgb(val);
|
|
3871
|
+
}
|
|
3872
|
+
if (/\s/g.test(val)) {
|
|
3873
|
+
return val;
|
|
3874
|
+
}
|
|
3875
|
+
var originalUnit = getUnit(val);
|
|
3876
|
+
var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;
|
|
3877
|
+
if (unit) {
|
|
3878
|
+
return unitLess + unit;
|
|
3879
|
+
}
|
|
3880
|
+
return unitLess;
|
|
3881
|
+
}
|
|
3882
|
+
function getDistance(p1, p2) {
|
|
3883
|
+
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
|
|
3884
|
+
}
|
|
3885
|
+
function getCircleLength(el) {
|
|
3886
|
+
return Math.PI * 2 * getAttribute(el, "r");
|
|
3887
|
+
}
|
|
3888
|
+
function getRectLength(el) {
|
|
3889
|
+
return getAttribute(el, "width") * 2 + getAttribute(el, "height") * 2;
|
|
3890
|
+
}
|
|
3891
|
+
function getLineLength(el) {
|
|
3892
|
+
return getDistance(
|
|
3893
|
+
{ x: getAttribute(el, "x1"), y: getAttribute(el, "y1") },
|
|
3894
|
+
{ x: getAttribute(el, "x2"), y: getAttribute(el, "y2") }
|
|
3895
|
+
);
|
|
3896
|
+
}
|
|
3897
|
+
function getPolylineLength(el) {
|
|
3898
|
+
var points = el.points;
|
|
3899
|
+
var totalLength = 0;
|
|
3900
|
+
var previousPos;
|
|
3901
|
+
for (var i = 0; i < points.numberOfItems; i++) {
|
|
3902
|
+
var currentPos = points.getItem(i);
|
|
3903
|
+
if (i > 0) {
|
|
3904
|
+
totalLength += getDistance(previousPos, currentPos);
|
|
3905
|
+
}
|
|
3906
|
+
previousPos = currentPos;
|
|
3907
|
+
}
|
|
3908
|
+
return totalLength;
|
|
3909
|
+
}
|
|
3910
|
+
function getPolygonLength(el) {
|
|
3911
|
+
var points = el.points;
|
|
3912
|
+
return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));
|
|
3913
|
+
}
|
|
3914
|
+
function getTotalLength(el) {
|
|
3915
|
+
if (el.getTotalLength) {
|
|
3916
|
+
return el.getTotalLength();
|
|
3917
|
+
}
|
|
3918
|
+
switch (el.tagName.toLowerCase()) {
|
|
3919
|
+
case "circle":
|
|
3920
|
+
return getCircleLength(el);
|
|
3921
|
+
case "rect":
|
|
3922
|
+
return getRectLength(el);
|
|
3923
|
+
case "line":
|
|
3924
|
+
return getLineLength(el);
|
|
3925
|
+
case "polyline":
|
|
3926
|
+
return getPolylineLength(el);
|
|
3927
|
+
case "polygon":
|
|
3928
|
+
return getPolygonLength(el);
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
function setDashoffset(el) {
|
|
3932
|
+
var pathLength = getTotalLength(el);
|
|
3933
|
+
el.setAttribute("stroke-dasharray", pathLength);
|
|
3934
|
+
return pathLength;
|
|
3935
|
+
}
|
|
3936
|
+
function getParentSvgEl(el) {
|
|
3937
|
+
var parentEl = el.parentNode;
|
|
3938
|
+
while (is.svg(parentEl)) {
|
|
3939
|
+
if (!is.svg(parentEl.parentNode)) {
|
|
3940
|
+
break;
|
|
3941
|
+
}
|
|
3942
|
+
parentEl = parentEl.parentNode;
|
|
3943
|
+
}
|
|
3944
|
+
return parentEl;
|
|
3945
|
+
}
|
|
3946
|
+
function getParentSvg(pathEl, svgData) {
|
|
3947
|
+
var svg = svgData || {};
|
|
3948
|
+
var parentSvgEl = svg.el || getParentSvgEl(pathEl);
|
|
3949
|
+
var rect = parentSvgEl.getBoundingClientRect();
|
|
3950
|
+
var viewBoxAttr = getAttribute(parentSvgEl, "viewBox");
|
|
3951
|
+
var width = rect.width;
|
|
3952
|
+
var height = rect.height;
|
|
3953
|
+
var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(" ") : [0, 0, width, height]);
|
|
3954
|
+
return {
|
|
3955
|
+
el: parentSvgEl,
|
|
3956
|
+
viewBox,
|
|
3957
|
+
x: viewBox[0] / 1,
|
|
3958
|
+
y: viewBox[1] / 1,
|
|
3959
|
+
w: width,
|
|
3960
|
+
h: height,
|
|
3961
|
+
vW: viewBox[2],
|
|
3962
|
+
vH: viewBox[3]
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
function getPath(path2, percent) {
|
|
3966
|
+
var pathEl = is.str(path2) ? selectString(path2)[0] : path2;
|
|
3967
|
+
var p = percent || 100;
|
|
3968
|
+
return function(property) {
|
|
3969
|
+
return {
|
|
3970
|
+
property,
|
|
3971
|
+
el: pathEl,
|
|
3972
|
+
svg: getParentSvg(pathEl),
|
|
3973
|
+
totalLength: getTotalLength(pathEl) * (p / 100)
|
|
3974
|
+
};
|
|
3975
|
+
};
|
|
3976
|
+
}
|
|
3977
|
+
function getPathProgress(path2, progress, isPathTargetInsideSVG) {
|
|
3978
|
+
function point(offset) {
|
|
3979
|
+
if (offset === void 0)
|
|
3980
|
+
offset = 0;
|
|
3981
|
+
var l = progress + offset >= 1 ? progress + offset : 0;
|
|
3982
|
+
return path2.el.getPointAtLength(l);
|
|
3983
|
+
}
|
|
3984
|
+
var svg = getParentSvg(path2.el, path2.svg);
|
|
3985
|
+
var p = point();
|
|
3986
|
+
var p0 = point(-1);
|
|
3987
|
+
var p1 = point(1);
|
|
3988
|
+
var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW;
|
|
3989
|
+
var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH;
|
|
3990
|
+
switch (path2.property) {
|
|
3991
|
+
case "x":
|
|
3992
|
+
return (p.x - svg.x) * scaleX;
|
|
3993
|
+
case "y":
|
|
3994
|
+
return (p.y - svg.y) * scaleY;
|
|
3995
|
+
case "angle":
|
|
3996
|
+
return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
function decomposeValue(val, unit) {
|
|
4000
|
+
var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g;
|
|
4001
|
+
var value = validateValue(is.pth(val) ? val.totalLength : val, unit) + "";
|
|
4002
|
+
return {
|
|
4003
|
+
original: value,
|
|
4004
|
+
numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],
|
|
4005
|
+
strings: is.str(val) || unit ? value.split(rgx) : []
|
|
4006
|
+
};
|
|
4007
|
+
}
|
|
4008
|
+
function parseTargets(targets) {
|
|
4009
|
+
var targetsArray = targets ? flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets)) : [];
|
|
4010
|
+
return filterArray(targetsArray, function(item, pos, self) {
|
|
4011
|
+
return self.indexOf(item) === pos;
|
|
4012
|
+
});
|
|
4013
|
+
}
|
|
4014
|
+
function getAnimatables(targets) {
|
|
4015
|
+
var parsed = parseTargets(targets);
|
|
4016
|
+
return parsed.map(function(t, i) {
|
|
4017
|
+
return { target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };
|
|
4018
|
+
});
|
|
4019
|
+
}
|
|
4020
|
+
function normalizePropertyTweens(prop, tweenSettings) {
|
|
4021
|
+
var settings = cloneObject(tweenSettings);
|
|
4022
|
+
if (/^spring/.test(settings.easing)) {
|
|
4023
|
+
settings.duration = spring(settings.easing);
|
|
4024
|
+
}
|
|
4025
|
+
if (is.arr(prop)) {
|
|
4026
|
+
var l = prop.length;
|
|
4027
|
+
var isFromTo = l === 2 && !is.obj(prop[0]);
|
|
4028
|
+
if (!isFromTo) {
|
|
4029
|
+
if (!is.fnc(tweenSettings.duration)) {
|
|
4030
|
+
settings.duration = tweenSettings.duration / l;
|
|
4031
|
+
}
|
|
4032
|
+
} else {
|
|
4033
|
+
prop = { value: prop };
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
var propArray = is.arr(prop) ? prop : [prop];
|
|
4037
|
+
return propArray.map(function(v, i) {
|
|
4038
|
+
var obj = is.obj(v) && !is.pth(v) ? v : { value: v };
|
|
4039
|
+
if (is.und(obj.delay)) {
|
|
4040
|
+
obj.delay = !i ? tweenSettings.delay : 0;
|
|
4041
|
+
}
|
|
4042
|
+
if (is.und(obj.endDelay)) {
|
|
4043
|
+
obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0;
|
|
4044
|
+
}
|
|
4045
|
+
return obj;
|
|
4046
|
+
}).map(function(k) {
|
|
4047
|
+
return mergeObjects(k, settings);
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
function flattenKeyframes(keyframes) {
|
|
4051
|
+
var propertyNames = filterArray(flattenArray(keyframes.map(function(key) {
|
|
4052
|
+
return Object.keys(key);
|
|
4053
|
+
})), function(p) {
|
|
4054
|
+
return is.key(p);
|
|
4055
|
+
}).reduce(function(a, b) {
|
|
4056
|
+
if (a.indexOf(b) < 0) {
|
|
4057
|
+
a.push(b);
|
|
4058
|
+
}
|
|
4059
|
+
return a;
|
|
4060
|
+
}, []);
|
|
4061
|
+
var properties = {};
|
|
4062
|
+
var loop = function(i2) {
|
|
4063
|
+
var propName = propertyNames[i2];
|
|
4064
|
+
properties[propName] = keyframes.map(function(key) {
|
|
4065
|
+
var newKey = {};
|
|
4066
|
+
for (var p in key) {
|
|
4067
|
+
if (is.key(p)) {
|
|
4068
|
+
if (p == propName) {
|
|
4069
|
+
newKey.value = key[p];
|
|
4070
|
+
}
|
|
4071
|
+
} else {
|
|
4072
|
+
newKey[p] = key[p];
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
return newKey;
|
|
4076
|
+
});
|
|
4077
|
+
};
|
|
4078
|
+
for (var i = 0; i < propertyNames.length; i++)
|
|
4079
|
+
loop(i);
|
|
4080
|
+
return properties;
|
|
4081
|
+
}
|
|
4082
|
+
function getProperties(tweenSettings, params) {
|
|
4083
|
+
var properties = [];
|
|
4084
|
+
var keyframes = params.keyframes;
|
|
4085
|
+
if (keyframes) {
|
|
4086
|
+
params = mergeObjects(flattenKeyframes(keyframes), params);
|
|
4087
|
+
}
|
|
4088
|
+
for (var p in params) {
|
|
4089
|
+
if (is.key(p)) {
|
|
4090
|
+
properties.push({
|
|
4091
|
+
name: p,
|
|
4092
|
+
tweens: normalizePropertyTweens(params[p], tweenSettings)
|
|
4093
|
+
});
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
return properties;
|
|
4097
|
+
}
|
|
4098
|
+
function normalizeTweenValues(tween, animatable) {
|
|
4099
|
+
var t = {};
|
|
4100
|
+
for (var p in tween) {
|
|
4101
|
+
var value = getFunctionValue(tween[p], animatable);
|
|
4102
|
+
if (is.arr(value)) {
|
|
4103
|
+
value = value.map(function(v) {
|
|
4104
|
+
return getFunctionValue(v, animatable);
|
|
4105
|
+
});
|
|
4106
|
+
if (value.length === 1) {
|
|
4107
|
+
value = value[0];
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
t[p] = value;
|
|
4111
|
+
}
|
|
4112
|
+
t.duration = parseFloat(t.duration);
|
|
4113
|
+
t.delay = parseFloat(t.delay);
|
|
4114
|
+
return t;
|
|
4115
|
+
}
|
|
4116
|
+
function normalizeTweens(prop, animatable) {
|
|
4117
|
+
var previousTween;
|
|
4118
|
+
return prop.tweens.map(function(t) {
|
|
4119
|
+
var tween = normalizeTweenValues(t, animatable);
|
|
4120
|
+
var tweenValue = tween.value;
|
|
4121
|
+
var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;
|
|
4122
|
+
var toUnit = getUnit(to);
|
|
4123
|
+
var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);
|
|
4124
|
+
var previousValue = previousTween ? previousTween.to.original : originalValue;
|
|
4125
|
+
var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;
|
|
4126
|
+
var fromUnit = getUnit(from) || getUnit(originalValue);
|
|
4127
|
+
var unit = toUnit || fromUnit;
|
|
4128
|
+
if (is.und(to)) {
|
|
4129
|
+
to = previousValue;
|
|
4130
|
+
}
|
|
4131
|
+
tween.from = decomposeValue(from, unit);
|
|
4132
|
+
tween.to = decomposeValue(getRelativeValue(to, from), unit);
|
|
4133
|
+
tween.start = previousTween ? previousTween.end : 0;
|
|
4134
|
+
tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;
|
|
4135
|
+
tween.easing = parseEasings(tween.easing, tween.duration);
|
|
4136
|
+
tween.isPath = is.pth(tweenValue);
|
|
4137
|
+
tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target);
|
|
4138
|
+
tween.isColor = is.col(tween.from.original);
|
|
4139
|
+
if (tween.isColor) {
|
|
4140
|
+
tween.round = 1;
|
|
4141
|
+
}
|
|
4142
|
+
previousTween = tween;
|
|
4143
|
+
return tween;
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
var setProgressValue = {
|
|
4147
|
+
css: function(t, p, v) {
|
|
4148
|
+
return t.style[p] = v;
|
|
4149
|
+
},
|
|
4150
|
+
attribute: function(t, p, v) {
|
|
4151
|
+
return t.setAttribute(p, v);
|
|
4152
|
+
},
|
|
4153
|
+
object: function(t, p, v) {
|
|
4154
|
+
return t[p] = v;
|
|
4155
|
+
},
|
|
4156
|
+
transform: function(t, p, v, transforms, manual) {
|
|
4157
|
+
transforms.list.set(p, v);
|
|
4158
|
+
if (p === transforms.last || manual) {
|
|
4159
|
+
var str = "";
|
|
4160
|
+
transforms.list.forEach(function(value, prop) {
|
|
4161
|
+
str += prop + "(" + value + ") ";
|
|
4162
|
+
});
|
|
4163
|
+
t.style.transform = str;
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4166
|
+
};
|
|
4167
|
+
function setTargetsValue(targets, properties) {
|
|
4168
|
+
var animatables = getAnimatables(targets);
|
|
4169
|
+
animatables.forEach(function(animatable) {
|
|
4170
|
+
for (var property in properties) {
|
|
4171
|
+
var value = getFunctionValue(properties[property], animatable);
|
|
4172
|
+
var target = animatable.target;
|
|
4173
|
+
var valueUnit = getUnit(value);
|
|
4174
|
+
var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);
|
|
4175
|
+
var unit = valueUnit || getUnit(originalValue);
|
|
4176
|
+
var to = getRelativeValue(validateValue(value, unit), originalValue);
|
|
4177
|
+
var animType = getAnimationType(target, property);
|
|
4178
|
+
setProgressValue[animType](target, property, to, animatable.transforms, true);
|
|
4179
|
+
}
|
|
4180
|
+
});
|
|
4181
|
+
}
|
|
4182
|
+
function createAnimation(animatable, prop) {
|
|
4183
|
+
var animType = getAnimationType(animatable.target, prop.name);
|
|
4184
|
+
if (animType) {
|
|
4185
|
+
var tweens = normalizeTweens(prop, animatable);
|
|
4186
|
+
var lastTween = tweens[tweens.length - 1];
|
|
4187
|
+
return {
|
|
4188
|
+
type: animType,
|
|
4189
|
+
property: prop.name,
|
|
4190
|
+
animatable,
|
|
4191
|
+
tweens,
|
|
4192
|
+
duration: lastTween.end,
|
|
4193
|
+
delay: tweens[0].delay,
|
|
4194
|
+
endDelay: lastTween.endDelay
|
|
4195
|
+
};
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
function getAnimations(animatables, properties) {
|
|
4199
|
+
return filterArray(flattenArray(animatables.map(function(animatable) {
|
|
4200
|
+
return properties.map(function(prop) {
|
|
4201
|
+
return createAnimation(animatable, prop);
|
|
4202
|
+
});
|
|
4203
|
+
})), function(a) {
|
|
4204
|
+
return !is.und(a);
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
function getInstanceTimings(animations, tweenSettings) {
|
|
4208
|
+
var animLength = animations.length;
|
|
4209
|
+
var getTlOffset = function(anim) {
|
|
4210
|
+
return anim.timelineOffset ? anim.timelineOffset : 0;
|
|
4211
|
+
};
|
|
4212
|
+
var timings = {};
|
|
4213
|
+
timings.duration = animLength ? Math.max.apply(Math, animations.map(function(anim) {
|
|
4214
|
+
return getTlOffset(anim) + anim.duration;
|
|
4215
|
+
})) : tweenSettings.duration;
|
|
4216
|
+
timings.delay = animLength ? Math.min.apply(Math, animations.map(function(anim) {
|
|
4217
|
+
return getTlOffset(anim) + anim.delay;
|
|
4218
|
+
})) : tweenSettings.delay;
|
|
4219
|
+
timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function(anim) {
|
|
4220
|
+
return getTlOffset(anim) + anim.duration - anim.endDelay;
|
|
4221
|
+
})) : tweenSettings.endDelay;
|
|
4222
|
+
return timings;
|
|
4223
|
+
}
|
|
4224
|
+
var instanceID = 0;
|
|
4225
|
+
function createNewInstance(params) {
|
|
4226
|
+
var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);
|
|
4227
|
+
var tweenSettings = replaceObjectProps(defaultTweenSettings, params);
|
|
4228
|
+
var properties = getProperties(tweenSettings, params);
|
|
4229
|
+
var animatables = getAnimatables(params.targets);
|
|
4230
|
+
var animations = getAnimations(animatables, properties);
|
|
4231
|
+
var timings = getInstanceTimings(animations, tweenSettings);
|
|
4232
|
+
var id = instanceID;
|
|
4233
|
+
instanceID++;
|
|
4234
|
+
return mergeObjects(instanceSettings, {
|
|
4235
|
+
id,
|
|
4236
|
+
children: [],
|
|
4237
|
+
animatables,
|
|
4238
|
+
animations,
|
|
4239
|
+
duration: timings.duration,
|
|
4240
|
+
delay: timings.delay,
|
|
4241
|
+
endDelay: timings.endDelay
|
|
4242
|
+
});
|
|
4243
|
+
}
|
|
4244
|
+
var activeInstances = [];
|
|
4245
|
+
var engine = function() {
|
|
4246
|
+
var raf;
|
|
4247
|
+
function play() {
|
|
4248
|
+
if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) {
|
|
4249
|
+
raf = requestAnimationFrame(step);
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
function step(t) {
|
|
4253
|
+
var activeInstancesLength = activeInstances.length;
|
|
4254
|
+
var i = 0;
|
|
4255
|
+
while (i < activeInstancesLength) {
|
|
4256
|
+
var activeInstance = activeInstances[i];
|
|
4257
|
+
if (!activeInstance.paused) {
|
|
4258
|
+
activeInstance.tick(t);
|
|
4259
|
+
i++;
|
|
4260
|
+
} else {
|
|
4261
|
+
activeInstances.splice(i, 1);
|
|
4262
|
+
activeInstancesLength--;
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
raf = i > 0 ? requestAnimationFrame(step) : void 0;
|
|
4266
|
+
}
|
|
4267
|
+
function handleVisibilityChange() {
|
|
4268
|
+
if (!anime.suspendWhenDocumentHidden) {
|
|
4269
|
+
return;
|
|
4270
|
+
}
|
|
4271
|
+
if (isDocumentHidden()) {
|
|
4272
|
+
raf = cancelAnimationFrame(raf);
|
|
4273
|
+
} else {
|
|
4274
|
+
activeInstances.forEach(
|
|
4275
|
+
function(instance) {
|
|
4276
|
+
return instance._onDocumentVisibility();
|
|
4277
|
+
}
|
|
4278
|
+
);
|
|
4279
|
+
engine();
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
if (typeof document !== "undefined") {
|
|
4283
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
4284
|
+
}
|
|
4285
|
+
return play;
|
|
4286
|
+
}();
|
|
4287
|
+
function isDocumentHidden() {
|
|
4288
|
+
return !!document && document.hidden;
|
|
4289
|
+
}
|
|
4290
|
+
function anime(params) {
|
|
4291
|
+
if (params === void 0)
|
|
4292
|
+
params = {};
|
|
4293
|
+
var startTime = 0, lastTime = 0, now = 0;
|
|
4294
|
+
var children, childrenLength = 0;
|
|
4295
|
+
var resolve = null;
|
|
4296
|
+
function makePromise(instance2) {
|
|
4297
|
+
var promise2 = window.Promise && new Promise(function(_resolve) {
|
|
4298
|
+
return resolve = _resolve;
|
|
4299
|
+
});
|
|
4300
|
+
instance2.finished = promise2;
|
|
4301
|
+
return promise2;
|
|
4302
|
+
}
|
|
4303
|
+
var instance = createNewInstance(params);
|
|
4304
|
+
var promise = makePromise(instance);
|
|
4305
|
+
function toggleInstanceDirection() {
|
|
4306
|
+
var direction = instance.direction;
|
|
4307
|
+
if (direction !== "alternate") {
|
|
4308
|
+
instance.direction = direction !== "normal" ? "normal" : "reverse";
|
|
4309
|
+
}
|
|
4310
|
+
instance.reversed = !instance.reversed;
|
|
4311
|
+
children.forEach(function(child) {
|
|
4312
|
+
return child.reversed = instance.reversed;
|
|
4313
|
+
});
|
|
4314
|
+
}
|
|
4315
|
+
function adjustTime(time) {
|
|
4316
|
+
return instance.reversed ? instance.duration - time : time;
|
|
4317
|
+
}
|
|
4318
|
+
function resetTime() {
|
|
4319
|
+
startTime = 0;
|
|
4320
|
+
lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
|
|
4321
|
+
}
|
|
4322
|
+
function seekChild(time, child) {
|
|
4323
|
+
if (child) {
|
|
4324
|
+
child.seek(time - child.timelineOffset);
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
function syncInstanceChildren(time) {
|
|
4328
|
+
if (!instance.reversePlayback) {
|
|
4329
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
4330
|
+
seekChild(time, children[i]);
|
|
4331
|
+
}
|
|
4332
|
+
} else {
|
|
4333
|
+
for (var i$1 = childrenLength; i$1--; ) {
|
|
4334
|
+
seekChild(time, children[i$1]);
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
function setAnimationsProgress(insTime) {
|
|
4339
|
+
var i = 0;
|
|
4340
|
+
var animations = instance.animations;
|
|
4341
|
+
var animationsLength = animations.length;
|
|
4342
|
+
while (i < animationsLength) {
|
|
4343
|
+
var anim = animations[i];
|
|
4344
|
+
var animatable = anim.animatable;
|
|
4345
|
+
var tweens = anim.tweens;
|
|
4346
|
+
var tweenLength = tweens.length - 1;
|
|
4347
|
+
var tween = tweens[tweenLength];
|
|
4348
|
+
if (tweenLength) {
|
|
4349
|
+
tween = filterArray(tweens, function(t) {
|
|
4350
|
+
return insTime < t.end;
|
|
4351
|
+
})[0] || tween;
|
|
4352
|
+
}
|
|
4353
|
+
var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;
|
|
4354
|
+
var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);
|
|
4355
|
+
var strings = tween.to.strings;
|
|
4356
|
+
var round = tween.round;
|
|
4357
|
+
var numbers = [];
|
|
4358
|
+
var toNumbersLength = tween.to.numbers.length;
|
|
4359
|
+
var progress = void 0;
|
|
4360
|
+
for (var n = 0; n < toNumbersLength; n++) {
|
|
4361
|
+
var value = void 0;
|
|
4362
|
+
var toNumber = tween.to.numbers[n];
|
|
4363
|
+
var fromNumber = tween.from.numbers[n] || 0;
|
|
4364
|
+
if (!tween.isPath) {
|
|
4365
|
+
value = fromNumber + eased * (toNumber - fromNumber);
|
|
4366
|
+
} else {
|
|
4367
|
+
value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG);
|
|
4368
|
+
}
|
|
4369
|
+
if (round) {
|
|
4370
|
+
if (!(tween.isColor && n > 2)) {
|
|
4371
|
+
value = Math.round(value * round) / round;
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
numbers.push(value);
|
|
4375
|
+
}
|
|
4376
|
+
var stringsLength = strings.length;
|
|
4377
|
+
if (!stringsLength) {
|
|
4378
|
+
progress = numbers[0];
|
|
4379
|
+
} else {
|
|
4380
|
+
progress = strings[0];
|
|
4381
|
+
for (var s = 0; s < stringsLength; s++) {
|
|
4382
|
+
var a = strings[s];
|
|
4383
|
+
var b = strings[s + 1];
|
|
4384
|
+
var n$1 = numbers[s];
|
|
4385
|
+
if (!isNaN(n$1)) {
|
|
4386
|
+
if (!b) {
|
|
4387
|
+
progress += n$1 + " ";
|
|
4388
|
+
} else {
|
|
4389
|
+
progress += n$1 + b;
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
}
|
|
4393
|
+
}
|
|
4394
|
+
setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);
|
|
4395
|
+
anim.currentValue = progress;
|
|
4396
|
+
i++;
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
function setCallback(cb) {
|
|
4400
|
+
if (instance[cb] && !instance.passThrough) {
|
|
4401
|
+
instance[cb](instance);
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
function countIteration() {
|
|
4405
|
+
if (instance.remaining && instance.remaining !== true) {
|
|
4406
|
+
instance.remaining--;
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
function setInstanceProgress(engineTime) {
|
|
4410
|
+
var insDuration = instance.duration;
|
|
4411
|
+
var insDelay = instance.delay;
|
|
4412
|
+
var insEndDelay = insDuration - instance.endDelay;
|
|
4413
|
+
var insTime = adjustTime(engineTime);
|
|
4414
|
+
instance.progress = minMax(insTime / insDuration * 100, 0, 100);
|
|
4415
|
+
instance.reversePlayback = insTime < instance.currentTime;
|
|
4416
|
+
if (children) {
|
|
4417
|
+
syncInstanceChildren(insTime);
|
|
4418
|
+
}
|
|
4419
|
+
if (!instance.began && instance.currentTime > 0) {
|
|
4420
|
+
instance.began = true;
|
|
4421
|
+
setCallback("begin");
|
|
4422
|
+
}
|
|
4423
|
+
if (!instance.loopBegan && instance.currentTime > 0) {
|
|
4424
|
+
instance.loopBegan = true;
|
|
4425
|
+
setCallback("loopBegin");
|
|
4426
|
+
}
|
|
4427
|
+
if (insTime <= insDelay && instance.currentTime !== 0) {
|
|
4428
|
+
setAnimationsProgress(0);
|
|
4429
|
+
}
|
|
4430
|
+
if (insTime >= insEndDelay && instance.currentTime !== insDuration || !insDuration) {
|
|
4431
|
+
setAnimationsProgress(insDuration);
|
|
4432
|
+
}
|
|
4433
|
+
if (insTime > insDelay && insTime < insEndDelay) {
|
|
4434
|
+
if (!instance.changeBegan) {
|
|
4435
|
+
instance.changeBegan = true;
|
|
4436
|
+
instance.changeCompleted = false;
|
|
4437
|
+
setCallback("changeBegin");
|
|
4438
|
+
}
|
|
4439
|
+
setCallback("change");
|
|
4440
|
+
setAnimationsProgress(insTime);
|
|
4441
|
+
} else {
|
|
4442
|
+
if (instance.changeBegan) {
|
|
4443
|
+
instance.changeCompleted = true;
|
|
4444
|
+
instance.changeBegan = false;
|
|
4445
|
+
setCallback("changeComplete");
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
instance.currentTime = minMax(insTime, 0, insDuration);
|
|
4449
|
+
if (instance.began) {
|
|
4450
|
+
setCallback("update");
|
|
4451
|
+
}
|
|
4452
|
+
if (engineTime >= insDuration) {
|
|
4453
|
+
lastTime = 0;
|
|
4454
|
+
countIteration();
|
|
4455
|
+
if (!instance.remaining) {
|
|
4456
|
+
instance.paused = true;
|
|
4457
|
+
if (!instance.completed) {
|
|
4458
|
+
instance.completed = true;
|
|
4459
|
+
setCallback("loopComplete");
|
|
4460
|
+
setCallback("complete");
|
|
4461
|
+
if (!instance.passThrough && "Promise" in window) {
|
|
4462
|
+
resolve();
|
|
4463
|
+
promise = makePromise(instance);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
} else {
|
|
4467
|
+
startTime = now;
|
|
4468
|
+
setCallback("loopComplete");
|
|
4469
|
+
instance.loopBegan = false;
|
|
4470
|
+
if (instance.direction === "alternate") {
|
|
4471
|
+
toggleInstanceDirection();
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
}
|
|
4475
|
+
}
|
|
4476
|
+
instance.reset = function() {
|
|
4477
|
+
var direction = instance.direction;
|
|
4478
|
+
instance.passThrough = false;
|
|
4479
|
+
instance.currentTime = 0;
|
|
4480
|
+
instance.progress = 0;
|
|
4481
|
+
instance.paused = true;
|
|
4482
|
+
instance.began = false;
|
|
4483
|
+
instance.loopBegan = false;
|
|
4484
|
+
instance.changeBegan = false;
|
|
4485
|
+
instance.completed = false;
|
|
4486
|
+
instance.changeCompleted = false;
|
|
4487
|
+
instance.reversePlayback = false;
|
|
4488
|
+
instance.reversed = direction === "reverse";
|
|
4489
|
+
instance.remaining = instance.loop;
|
|
4490
|
+
children = instance.children;
|
|
4491
|
+
childrenLength = children.length;
|
|
4492
|
+
for (var i = childrenLength; i--; ) {
|
|
4493
|
+
instance.children[i].reset();
|
|
4494
|
+
}
|
|
4495
|
+
if (instance.reversed && instance.loop !== true || direction === "alternate" && instance.loop === 1) {
|
|
4496
|
+
instance.remaining++;
|
|
4497
|
+
}
|
|
4498
|
+
setAnimationsProgress(instance.reversed ? instance.duration : 0);
|
|
4499
|
+
};
|
|
4500
|
+
instance._onDocumentVisibility = resetTime;
|
|
4501
|
+
instance.set = function(targets, properties) {
|
|
4502
|
+
setTargetsValue(targets, properties);
|
|
4503
|
+
return instance;
|
|
4504
|
+
};
|
|
4505
|
+
instance.tick = function(t) {
|
|
4506
|
+
now = t;
|
|
4507
|
+
if (!startTime) {
|
|
4508
|
+
startTime = now;
|
|
4509
|
+
}
|
|
4510
|
+
setInstanceProgress((now + (lastTime - startTime)) * anime.speed);
|
|
4511
|
+
};
|
|
4512
|
+
instance.seek = function(time) {
|
|
4513
|
+
setInstanceProgress(adjustTime(time));
|
|
4514
|
+
};
|
|
4515
|
+
instance.pause = function() {
|
|
4516
|
+
instance.paused = true;
|
|
4517
|
+
resetTime();
|
|
4518
|
+
};
|
|
4519
|
+
instance.play = function() {
|
|
4520
|
+
if (!instance.paused) {
|
|
4521
|
+
return;
|
|
4522
|
+
}
|
|
4523
|
+
if (instance.completed) {
|
|
4524
|
+
instance.reset();
|
|
4525
|
+
}
|
|
4526
|
+
instance.paused = false;
|
|
4527
|
+
activeInstances.push(instance);
|
|
4528
|
+
resetTime();
|
|
4529
|
+
engine();
|
|
4530
|
+
};
|
|
4531
|
+
instance.reverse = function() {
|
|
4532
|
+
toggleInstanceDirection();
|
|
4533
|
+
instance.completed = instance.reversed ? false : true;
|
|
4534
|
+
resetTime();
|
|
4535
|
+
};
|
|
4536
|
+
instance.restart = function() {
|
|
4537
|
+
instance.reset();
|
|
4538
|
+
instance.play();
|
|
4539
|
+
};
|
|
4540
|
+
instance.remove = function(targets) {
|
|
4541
|
+
var targetsArray = parseTargets(targets);
|
|
4542
|
+
removeTargetsFromInstance(targetsArray, instance);
|
|
4543
|
+
};
|
|
4544
|
+
instance.reset();
|
|
4545
|
+
if (instance.autoplay) {
|
|
4546
|
+
instance.play();
|
|
4547
|
+
}
|
|
4548
|
+
return instance;
|
|
4549
|
+
}
|
|
4550
|
+
function removeTargetsFromAnimations(targetsArray, animations) {
|
|
4551
|
+
for (var a = animations.length; a--; ) {
|
|
4552
|
+
if (arrayContains(targetsArray, animations[a].animatable.target)) {
|
|
4553
|
+
animations.splice(a, 1);
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
4557
|
+
function removeTargetsFromInstance(targetsArray, instance) {
|
|
4558
|
+
var animations = instance.animations;
|
|
4559
|
+
var children = instance.children;
|
|
4560
|
+
removeTargetsFromAnimations(targetsArray, animations);
|
|
4561
|
+
for (var c = children.length; c--; ) {
|
|
4562
|
+
var child = children[c];
|
|
4563
|
+
var childAnimations = child.animations;
|
|
4564
|
+
removeTargetsFromAnimations(targetsArray, childAnimations);
|
|
4565
|
+
if (!childAnimations.length && !child.children.length) {
|
|
4566
|
+
children.splice(c, 1);
|
|
4567
|
+
}
|
|
4568
|
+
}
|
|
4569
|
+
if (!animations.length && !children.length) {
|
|
4570
|
+
instance.pause();
|
|
4571
|
+
}
|
|
4572
|
+
}
|
|
4573
|
+
function removeTargetsFromActiveInstances(targets) {
|
|
4574
|
+
var targetsArray = parseTargets(targets);
|
|
4575
|
+
for (var i = activeInstances.length; i--; ) {
|
|
4576
|
+
var instance = activeInstances[i];
|
|
4577
|
+
removeTargetsFromInstance(targetsArray, instance);
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
function stagger(val, params) {
|
|
4581
|
+
if (params === void 0)
|
|
4582
|
+
params = {};
|
|
4583
|
+
var direction = params.direction || "normal";
|
|
4584
|
+
var easing = params.easing ? parseEasings(params.easing) : null;
|
|
4585
|
+
var grid = params.grid;
|
|
4586
|
+
var axis = params.axis;
|
|
4587
|
+
var fromIndex = params.from || 0;
|
|
4588
|
+
var fromFirst = fromIndex === "first";
|
|
4589
|
+
var fromCenter = fromIndex === "center";
|
|
4590
|
+
var fromLast = fromIndex === "last";
|
|
4591
|
+
var isRange = is.arr(val);
|
|
4592
|
+
var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);
|
|
4593
|
+
var val2 = isRange ? parseFloat(val[1]) : 0;
|
|
4594
|
+
var unit = getUnit(isRange ? val[1] : val) || 0;
|
|
4595
|
+
var start = params.start || 0 + (isRange ? val1 : 0);
|
|
4596
|
+
var values = [];
|
|
4597
|
+
var maxValue = 0;
|
|
4598
|
+
return function(el, i, t) {
|
|
4599
|
+
if (fromFirst) {
|
|
4600
|
+
fromIndex = 0;
|
|
4601
|
+
}
|
|
4602
|
+
if (fromCenter) {
|
|
4603
|
+
fromIndex = (t - 1) / 2;
|
|
4604
|
+
}
|
|
4605
|
+
if (fromLast) {
|
|
4606
|
+
fromIndex = t - 1;
|
|
4607
|
+
}
|
|
4608
|
+
if (!values.length) {
|
|
4609
|
+
for (var index = 0; index < t; index++) {
|
|
4610
|
+
if (!grid) {
|
|
4611
|
+
values.push(Math.abs(fromIndex - index));
|
|
4612
|
+
} else {
|
|
4613
|
+
var fromX = !fromCenter ? fromIndex % grid[0] : (grid[0] - 1) / 2;
|
|
4614
|
+
var fromY = !fromCenter ? Math.floor(fromIndex / grid[0]) : (grid[1] - 1) / 2;
|
|
4615
|
+
var toX = index % grid[0];
|
|
4616
|
+
var toY = Math.floor(index / grid[0]);
|
|
4617
|
+
var distanceX = fromX - toX;
|
|
4618
|
+
var distanceY = fromY - toY;
|
|
4619
|
+
var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
|
|
4620
|
+
if (axis === "x") {
|
|
4621
|
+
value = -distanceX;
|
|
4622
|
+
}
|
|
4623
|
+
if (axis === "y") {
|
|
4624
|
+
value = -distanceY;
|
|
4625
|
+
}
|
|
4626
|
+
values.push(value);
|
|
4627
|
+
}
|
|
4628
|
+
maxValue = Math.max.apply(Math, values);
|
|
4629
|
+
}
|
|
4630
|
+
if (easing) {
|
|
4631
|
+
values = values.map(function(val3) {
|
|
4632
|
+
return easing(val3 / maxValue) * maxValue;
|
|
4633
|
+
});
|
|
4634
|
+
}
|
|
4635
|
+
if (direction === "reverse") {
|
|
4636
|
+
values = values.map(function(val3) {
|
|
4637
|
+
return axis ? val3 < 0 ? val3 * -1 : -val3 : Math.abs(maxValue - val3);
|
|
4638
|
+
});
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
var spacing = isRange ? (val2 - val1) / maxValue : val1;
|
|
4642
|
+
return start + spacing * (Math.round(values[i] * 100) / 100) + unit;
|
|
4643
|
+
};
|
|
4644
|
+
}
|
|
4645
|
+
function timeline(params) {
|
|
4646
|
+
if (params === void 0)
|
|
4647
|
+
params = {};
|
|
4648
|
+
var tl = anime(params);
|
|
4649
|
+
tl.duration = 0;
|
|
4650
|
+
tl.add = function(instanceParams, timelineOffset) {
|
|
4651
|
+
var tlIndex = activeInstances.indexOf(tl);
|
|
4652
|
+
var children = tl.children;
|
|
4653
|
+
if (tlIndex > -1) {
|
|
4654
|
+
activeInstances.splice(tlIndex, 1);
|
|
4655
|
+
}
|
|
4656
|
+
function passThrough(ins2) {
|
|
4657
|
+
ins2.passThrough = true;
|
|
4658
|
+
}
|
|
4659
|
+
for (var i = 0; i < children.length; i++) {
|
|
4660
|
+
passThrough(children[i]);
|
|
4661
|
+
}
|
|
4662
|
+
var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));
|
|
4663
|
+
insParams.targets = insParams.targets || params.targets;
|
|
4664
|
+
var tlDuration = tl.duration;
|
|
4665
|
+
insParams.autoplay = false;
|
|
4666
|
+
insParams.direction = tl.direction;
|
|
4667
|
+
insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);
|
|
4668
|
+
passThrough(tl);
|
|
4669
|
+
tl.seek(insParams.timelineOffset);
|
|
4670
|
+
var ins = anime(insParams);
|
|
4671
|
+
passThrough(ins);
|
|
4672
|
+
children.push(ins);
|
|
4673
|
+
var timings = getInstanceTimings(children, params);
|
|
4674
|
+
tl.delay = timings.delay;
|
|
4675
|
+
tl.endDelay = timings.endDelay;
|
|
4676
|
+
tl.duration = timings.duration;
|
|
4677
|
+
tl.seek(0);
|
|
4678
|
+
tl.reset();
|
|
4679
|
+
if (tl.autoplay) {
|
|
4680
|
+
tl.play();
|
|
4681
|
+
}
|
|
4682
|
+
return tl;
|
|
4683
|
+
};
|
|
4684
|
+
return tl;
|
|
4685
|
+
}
|
|
4686
|
+
anime.version = "3.2.1";
|
|
4687
|
+
anime.speed = 1;
|
|
4688
|
+
anime.suspendWhenDocumentHidden = true;
|
|
4689
|
+
anime.running = activeInstances;
|
|
4690
|
+
anime.remove = removeTargetsFromActiveInstances;
|
|
4691
|
+
anime.get = getOriginalTargetValue;
|
|
4692
|
+
anime.set = setTargetsValue;
|
|
4693
|
+
anime.convertPx = convertPxToUnit;
|
|
4694
|
+
anime.path = getPath;
|
|
4695
|
+
anime.setDashoffset = setDashoffset;
|
|
4696
|
+
anime.stagger = stagger;
|
|
4697
|
+
anime.timeline = timeline;
|
|
4698
|
+
anime.easing = parseEasings;
|
|
4699
|
+
anime.penner = penner;
|
|
4700
|
+
anime.random = function(min, max) {
|
|
4701
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
4702
|
+
};
|
|
4703
|
+
var anime_es_default = anime;
|
|
4704
|
+
|
|
4705
|
+
// src/utils/anime/anime.ts
|
|
4706
|
+
var defaultOptions = {
|
|
4707
|
+
// 动画时间
|
|
4708
|
+
duration: 1e3,
|
|
4709
|
+
// 循环执行
|
|
4710
|
+
loop: false,
|
|
4711
|
+
// 运行速度曲线
|
|
4712
|
+
easing: "easeInOutSine"
|
|
4713
|
+
};
|
|
4714
|
+
function handleBefore(AnimeParams, extraOptions) {
|
|
4715
|
+
const params = {};
|
|
4716
|
+
if (extraOptions.complete && AnimeParams.complete) {
|
|
4717
|
+
const optionComplete = extraOptions.complete;
|
|
4718
|
+
const animeComplete = AnimeParams.complete;
|
|
4719
|
+
params.complete = (ins) => {
|
|
4720
|
+
optionComplete(ins);
|
|
4721
|
+
animeComplete(ins);
|
|
4722
|
+
};
|
|
4723
|
+
}
|
|
4724
|
+
return { ...AnimeParams, ...extraOptions, ...params };
|
|
4725
|
+
}
|
|
4726
|
+
function moveToTarget(moveElement, targetElement, extraOpts = {}) {
|
|
4727
|
+
const { left: toLeft, top: toTop } = moveElement.getBoundingClientRect();
|
|
4728
|
+
const { left: clientX, top: clientY } = targetElement.getBoundingClientRect();
|
|
4729
|
+
const x = clientX - toLeft;
|
|
4730
|
+
const y = clientY - toTop;
|
|
4731
|
+
return new Promise((resolve) => {
|
|
4732
|
+
const opts = {
|
|
4733
|
+
targets: moveElement,
|
|
4734
|
+
translateX: x,
|
|
4735
|
+
translateY: y,
|
|
4736
|
+
...defaultOptions,
|
|
4737
|
+
// 完成回调
|
|
4738
|
+
complete: () => {
|
|
4739
|
+
resolve(true);
|
|
4740
|
+
}
|
|
4741
|
+
};
|
|
4742
|
+
const options = handleBefore(opts, extraOpts);
|
|
4743
|
+
anime_es_default(options);
|
|
4744
|
+
});
|
|
4745
|
+
}
|
|
4746
|
+
function resize(targets, extraOpts = {}) {
|
|
4747
|
+
return new Promise((resolve) => {
|
|
4748
|
+
const opts = {
|
|
4749
|
+
scale: [1, 0.8, 1],
|
|
4750
|
+
targets,
|
|
4751
|
+
...defaultOptions,
|
|
4752
|
+
// 完成回调
|
|
4753
|
+
complete: () => {
|
|
4754
|
+
resolve(true);
|
|
4755
|
+
}
|
|
4756
|
+
};
|
|
4757
|
+
const options = handleBefore(opts, extraOpts);
|
|
4758
|
+
anime_es_default(options);
|
|
4759
|
+
});
|
|
4760
|
+
}
|
|
4761
|
+
|
|
4762
|
+
// src/utils/anime/anime-util/anime-util.ts
|
|
4763
|
+
var AnimeUtil = class {
|
|
4764
|
+
/**
|
|
4765
|
+
* 元素移动到指定位置 移动点至指定元素
|
|
4766
|
+
*
|
|
4767
|
+
* @author zk
|
|
4768
|
+
* @date 2024-01-24 09:01:37
|
|
4769
|
+
* @param {Event} event
|
|
4770
|
+
* @param {HTMLElement} toElement
|
|
4771
|
+
* @param {anime.AnimeParams} [options={}]
|
|
4772
|
+
* @return {*} {Promise<boolean>}
|
|
4773
|
+
* @memberof AnimeUtil
|
|
4774
|
+
*/
|
|
4775
|
+
async movePoint(element, tElement, options = {}) {
|
|
4776
|
+
const targetElement = getAnimationElement(tElement);
|
|
4777
|
+
if (!targetElement) {
|
|
4778
|
+
ibiz.log.debug("\u7EC8\u70B9\u5143\u7D20\u4E0D\u5B58\u5728");
|
|
4779
|
+
return false;
|
|
4780
|
+
}
|
|
4781
|
+
const moveElement = cloneElement(element, document.body);
|
|
4782
|
+
if (!moveElement) {
|
|
4783
|
+
ibiz.log.debug("\u52A8\u753B\u5143\u7D20\u4E0D\u5B58\u5728");
|
|
4784
|
+
return false;
|
|
4785
|
+
}
|
|
4786
|
+
const { padding, width, height } = getElementAttribute(moveElement);
|
|
4787
|
+
const option = {
|
|
4788
|
+
borderRadius: ["0%", "50%"],
|
|
4789
|
+
maxWidth: [width, "6px"],
|
|
4790
|
+
maxHeight: [height, "6px"],
|
|
4791
|
+
minWidth: [width, "6px"],
|
|
4792
|
+
minHeight: [height, "6px"],
|
|
4793
|
+
padding: [padding, "6px"],
|
|
4794
|
+
duration: 700
|
|
4795
|
+
};
|
|
4796
|
+
Object.assign(option, options);
|
|
4797
|
+
const result = await moveToTarget(moveElement, targetElement, option);
|
|
4798
|
+
destroyElement(moveElement);
|
|
4799
|
+
return result;
|
|
4800
|
+
}
|
|
4801
|
+
/**
|
|
4802
|
+
* 元素移动动画 元素a 移动到元素b
|
|
4803
|
+
*
|
|
4804
|
+
* @author zk
|
|
4805
|
+
* @date 2024-01-24 06:01:35\
|
|
4806
|
+
* @param {HTMLElement} element
|
|
4807
|
+
* @param {HTMLElement} toElement
|
|
4808
|
+
* @param {IAnimationOptions} [options={}]
|
|
4809
|
+
* @return {*} {Promise<boolean>}
|
|
4810
|
+
* @memberof AnimeUtil
|
|
4811
|
+
*/
|
|
4812
|
+
moveToTarget(element, toElement, options = {}) {
|
|
4813
|
+
return moveToTarget(element, toElement, options);
|
|
4814
|
+
}
|
|
4815
|
+
/**
|
|
4816
|
+
* 目标调整大小
|
|
4817
|
+
*
|
|
4818
|
+
* @author zk
|
|
4819
|
+
* @date 2024-01-22 03:01:42
|
|
4820
|
+
* @param {HTMLElement} target
|
|
4821
|
+
* @param {anime.AnimeParams} [options={}]
|
|
4822
|
+
* @param {IData} [builtInParams={}]
|
|
4823
|
+
*/
|
|
4824
|
+
resize(targets, options = {}) {
|
|
4825
|
+
return resize(targets, options);
|
|
4826
|
+
}
|
|
4827
|
+
/**
|
|
4828
|
+
* 目标移动和调整大小
|
|
4829
|
+
*
|
|
4830
|
+
* @author zk
|
|
4831
|
+
* @date 2024-01-24 06:01:15
|
|
4832
|
+
* @param {HTMLElement} element
|
|
4833
|
+
* @param {HTMLElement} toElement
|
|
4834
|
+
* @param {IAnimationOptions} [options={}]
|
|
4835
|
+
* @return {*} {Promise<boolean>}
|
|
4836
|
+
* @memberof AnimeUtil
|
|
4837
|
+
*/
|
|
4838
|
+
async moveAndResize(element, toElement, options = {}) {
|
|
4839
|
+
const result = await this.movePoint(element, toElement, options);
|
|
4840
|
+
if (result) {
|
|
4841
|
+
await this.resize(toElement, { duration: 500 });
|
|
4842
|
+
}
|
|
4843
|
+
return result;
|
|
4844
|
+
}
|
|
4845
|
+
};
|
|
4846
|
+
|
|
3239
4847
|
// src/command/app/open-app-view/open-app-view.ts
|
|
3240
4848
|
import { ModelError as ModelError15, RuntimeError as RuntimeError24 } from "@ibiz-template/core";
|
|
3241
4849
|
import { clone as clone17 } from "ramda";
|
|
@@ -4648,7 +6256,7 @@ var DynamicCodeListCache = class {
|
|
|
4648
6256
|
const { predefinedType } = this.codeList;
|
|
4649
6257
|
if (predefinedType) {
|
|
4650
6258
|
this.isPredefined = true;
|
|
4651
|
-
if (!["OPERATOR", "RUNTIME"].includes(predefinedType)) {
|
|
6259
|
+
if (!["OPERATOR", "RUNTIME", "DEMAINSTATE"].includes(predefinedType)) {
|
|
4652
6260
|
throw new ModelError5(
|
|
4653
6261
|
this.codeList,
|
|
4654
6262
|
"\u9884\u5B9A\u4E49\u7C7B\u578B".concat(predefinedType, "\u6682\u4E0D\u652F\u6301")
|
|
@@ -4759,8 +6367,11 @@ var DynamicCodeListCache = class {
|
|
|
4759
6367
|
tempParams.size = 1e4;
|
|
4760
6368
|
}
|
|
4761
6369
|
if (this.isPredefined && this.codeList.codeName) {
|
|
4762
|
-
|
|
4763
|
-
|
|
6370
|
+
let tag = this.codeList.codeName;
|
|
6371
|
+
if (this.codeList.predefinedType === "OPERATOR") {
|
|
6372
|
+
const index = this.codeList.codeName.indexOf("__");
|
|
6373
|
+
tag = index !== -1 ? this.codeList.codeName.substring(index + 2) : this.codeList.codeName;
|
|
6374
|
+
}
|
|
4764
6375
|
const res2 = await app.net.get(
|
|
4765
6376
|
"/dictionaries/codelist/".concat(tag),
|
|
4766
6377
|
tempParams
|
|
@@ -4958,14 +6569,13 @@ var DECache = class {
|
|
|
4958
6569
|
*
|
|
4959
6570
|
* @param {*} context
|
|
4960
6571
|
* @param {IDataEntity} entity
|
|
4961
|
-
* @param {boolean} [ignoreDuplicate=true] 是否忽略主键重复(不忽略报错,忽略则覆盖)
|
|
4962
6572
|
* @return {*} {boolean}
|
|
4963
6573
|
* @memberof EntityCache
|
|
4964
6574
|
*/
|
|
4965
|
-
add(context, entity
|
|
6575
|
+
add(context, entity) {
|
|
4966
6576
|
if (this.isUnionKey) {
|
|
4967
6577
|
this.calcUnionKey(entity);
|
|
4968
|
-
if (
|
|
6578
|
+
if (this.checkData(context, entity.srfkey)) {
|
|
4969
6579
|
throw new RuntimeError15(
|
|
4970
6580
|
"\u65B0\u5EFA\u8054\u5408\u4E3B\u952E\u6570\u636E\u5931\u8D25\uFF0C\u5DF2\u6709\u4E3B\u952E\u4E3A".concat(entity.srfkey, "\u7684\u6570\u636E")
|
|
4971
6581
|
);
|
|
@@ -5019,15 +6629,14 @@ var DECache = class {
|
|
|
5019
6629
|
*
|
|
5020
6630
|
* @param {IContext} context
|
|
5021
6631
|
* @param {IDataEntity} entity
|
|
5022
|
-
* @param {boolean} [ignoreDuplicate=true] 是否忽略主键重复(不忽略报错,忽略则覆盖)
|
|
5023
6632
|
* @return {*} {IDataEntity}
|
|
5024
6633
|
* @memberof EntityCache
|
|
5025
6634
|
*/
|
|
5026
|
-
update(context, entity
|
|
6635
|
+
update(context, entity) {
|
|
5027
6636
|
const oldKey = entity.srfkey;
|
|
5028
6637
|
if (this.isUnionKey) {
|
|
5029
6638
|
this.calcUnionKey(entity);
|
|
5030
|
-
if (
|
|
6639
|
+
if (oldKey !== entity.srfkey && this.checkData(context, entity.srfkey)) {
|
|
5031
6640
|
throw new RuntimeError15(
|
|
5032
6641
|
"\u66F4\u65B0\u8054\u5408\u4E3B\u952E\u6570\u636E\u5931\u8D25\uFF0C\u5DF2\u6709\u4E3B\u952E\u4E3A".concat(entity.srfkey, "\u7684\u6570\u636E")
|
|
5033
6642
|
);
|
|
@@ -5477,6 +7086,34 @@ function fieldValueToBoolean(value) {
|
|
|
5477
7086
|
return [1, "1", true, "true"].includes(value);
|
|
5478
7087
|
}
|
|
5479
7088
|
|
|
7089
|
+
// src/service/utils/dyna-sys-params/dyna-sys-params.ts
|
|
7090
|
+
async function calcDynaSysParams(appDataEntityId, context, opts = {}) {
|
|
7091
|
+
const appId2 = opts.appId || context.srfappid;
|
|
7092
|
+
const viewParams = opts.viewParams || {};
|
|
7093
|
+
const loadModelParams = {};
|
|
7094
|
+
const appDe = await ibiz.hub.getAppDataEntity(appDataEntityId, appId2);
|
|
7095
|
+
if (viewParams.srfkey) {
|
|
7096
|
+
loadModelParams.srfkey = viewParams.srfkey;
|
|
7097
|
+
} else {
|
|
7098
|
+
const srfkey = context[appDe.codeName.toLowerCase()];
|
|
7099
|
+
if (srfkey) {
|
|
7100
|
+
loadModelParams.srfkey = srfkey;
|
|
7101
|
+
}
|
|
7102
|
+
}
|
|
7103
|
+
if (viewParams.srfparentkey && viewParams.srfparentdeanme) {
|
|
7104
|
+
loadModelParams.srfparentkey = viewParams.srfparentkey;
|
|
7105
|
+
loadModelParams.srfparentdeanme = viewParams.srfparentdeanme;
|
|
7106
|
+
} else {
|
|
7107
|
+
const match = getMatchResPath(context, appDe);
|
|
7108
|
+
if (match && match.keys.length > 1) {
|
|
7109
|
+
const parentDeKey = match.keys[match.keys.length - 2];
|
|
7110
|
+
loadModelParams.srfparentkey = viewParams.srfparentkey || context[parentDeKey];
|
|
7111
|
+
loadModelParams.srfparentdeanme = viewParams.srfparentdeanme || parentDeKey;
|
|
7112
|
+
}
|
|
7113
|
+
}
|
|
7114
|
+
return loadModelParams;
|
|
7115
|
+
}
|
|
7116
|
+
|
|
5480
7117
|
// src/service/service/code-list/code-list.service.ts
|
|
5481
7118
|
import { RuntimeError as RuntimeError16 } from "@ibiz-template/core";
|
|
5482
7119
|
var CodeListService = class {
|
|
@@ -6459,6 +8096,7 @@ var MethodDto = class {
|
|
|
6459
8096
|
* @return {*} {Promise<IDataEntity[]>}
|
|
6460
8097
|
*/
|
|
6461
8098
|
async sets(context, data) {
|
|
8099
|
+
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
6462
8100
|
return Promise.all(
|
|
6463
8101
|
data.map(async (datum) => {
|
|
6464
8102
|
const all = this.fields.filter((field) => field.type === "DTOS").map(async (field) => {
|
|
@@ -6469,7 +8107,14 @@ var MethodDto = class {
|
|
|
6469
8107
|
if (!field.refAppDataEntityId) {
|
|
6470
8108
|
return;
|
|
6471
8109
|
}
|
|
8110
|
+
const configs = uiDomain.getDERConfig(field.refAppDataEntityId);
|
|
8111
|
+
const deRs = configs.find((rs) => {
|
|
8112
|
+
return rs.majorAppDataEntityId === this.entity.id;
|
|
8113
|
+
});
|
|
6472
8114
|
const dto = await this.getFieldDto(context, field);
|
|
8115
|
+
if (!deRs) {
|
|
8116
|
+
dto.service.local.clear();
|
|
8117
|
+
}
|
|
6473
8118
|
const items = datum[key];
|
|
6474
8119
|
if (items && items.length > 0) {
|
|
6475
8120
|
const pKey = datum[this.entity.keyAppDEFieldId];
|
|
@@ -7575,6 +9220,9 @@ var V7AuthService = class {
|
|
|
7575
9220
|
true
|
|
7576
9221
|
);
|
|
7577
9222
|
}
|
|
9223
|
+
ibiz.hub.getAllApps().forEach((app) => {
|
|
9224
|
+
app.initMqtt();
|
|
9225
|
+
});
|
|
7578
9226
|
}
|
|
7579
9227
|
this.extendLogin();
|
|
7580
9228
|
}, wait);
|
|
@@ -9173,18 +10821,13 @@ var DEActionMethod = class extends Method {
|
|
|
9173
10821
|
if (isArray6(addData)) {
|
|
9174
10822
|
resultData = await Promise.all(
|
|
9175
10823
|
addData.map(
|
|
9176
|
-
(item) => this.service.local.add(
|
|
9177
|
-
context,
|
|
9178
|
-
this.attach(context, item),
|
|
9179
|
-
false
|
|
9180
|
-
)
|
|
10824
|
+
(item) => this.service.local.add(context, this.attach(context, item))
|
|
9181
10825
|
)
|
|
9182
10826
|
);
|
|
9183
10827
|
} else {
|
|
9184
10828
|
resultData = await this.service.local.add(
|
|
9185
10829
|
context,
|
|
9186
|
-
this.attach(context, addData)
|
|
9187
|
-
false
|
|
10830
|
+
this.attach(context, addData)
|
|
9188
10831
|
);
|
|
9189
10832
|
}
|
|
9190
10833
|
return new HttpResponse3(resultData);
|
|
@@ -9356,18 +10999,13 @@ var DEActionMethod = class extends Method {
|
|
|
9356
10999
|
if (isArray6(updateData)) {
|
|
9357
11000
|
resultData = await Promise.all(
|
|
9358
11001
|
updateData.map(
|
|
9359
|
-
(item) => this.service.local.update(
|
|
9360
|
-
context,
|
|
9361
|
-
this.attach(context, item),
|
|
9362
|
-
false
|
|
9363
|
-
)
|
|
11002
|
+
(item) => this.service.local.update(context, this.attach(context, item))
|
|
9364
11003
|
)
|
|
9365
11004
|
);
|
|
9366
11005
|
} else {
|
|
9367
11006
|
resultData = await this.service.local.update(
|
|
9368
11007
|
context,
|
|
9369
|
-
this.attach(context, updateData)
|
|
9370
|
-
false
|
|
11008
|
+
this.attach(context, updateData)
|
|
9371
11009
|
);
|
|
9372
11010
|
}
|
|
9373
11011
|
if (resultData) {
|
|
@@ -9798,6 +11436,9 @@ var TreeDataSetNodeData = class _TreeDataSetNodeData extends TreeNodeData {
|
|
|
9798
11436
|
const dataItemKeyMap = /* @__PURE__ */ new Map();
|
|
9799
11437
|
const dataItemDefaultMap = /* @__PURE__ */ new Map();
|
|
9800
11438
|
(_a = model.detreeNodeDataItems) == null ? void 0 : _a.forEach((dataItem) => {
|
|
11439
|
+
if (!dataItem.appDEFieldId) {
|
|
11440
|
+
return;
|
|
11441
|
+
}
|
|
9801
11442
|
const dataItemKey = dataItem.id.toLowerCase();
|
|
9802
11443
|
const deFieldKey = dataItem.appDEFieldId.toLowerCase();
|
|
9803
11444
|
dataItemKeyMap.set(dataItemKey, deFieldKey);
|
|
@@ -9807,6 +11448,9 @@ var TreeDataSetNodeData = class _TreeDataSetNodeData extends TreeNodeData {
|
|
|
9807
11448
|
});
|
|
9808
11449
|
const nodeColumnKeyMap = /* @__PURE__ */ new Map();
|
|
9809
11450
|
(_b = model.detreeNodeColumns) == null ? void 0 : _b.forEach((column) => {
|
|
11451
|
+
if (column.columnType !== "DEFGRIDCOLUMN") {
|
|
11452
|
+
return;
|
|
11453
|
+
}
|
|
9810
11454
|
const columnKey = column.detreeColumnId;
|
|
9811
11455
|
const dataItemKey = column.dataItemName;
|
|
9812
11456
|
if (!columnKey || !dataItemKey) {
|
|
@@ -10505,6 +12149,7 @@ var MqttService = class {
|
|
|
10505
12149
|
close() {
|
|
10506
12150
|
var _a;
|
|
10507
12151
|
(_a = this.client) == null ? void 0 : _a.end();
|
|
12152
|
+
this.evt.reset();
|
|
10508
12153
|
}
|
|
10509
12154
|
};
|
|
10510
12155
|
|
|
@@ -11034,17 +12679,7 @@ var Application = class {
|
|
|
11034
12679
|
async init() {
|
|
11035
12680
|
await this.authority.init();
|
|
11036
12681
|
await this.loadAppModelStyle();
|
|
11037
|
-
|
|
11038
|
-
this.mqtt = new MqttService(
|
|
11039
|
-
ibiz.appData.mqtttopic,
|
|
11040
|
-
getToken(),
|
|
11041
|
-
this.model.appId
|
|
11042
|
-
);
|
|
11043
|
-
this.mqtt.evt.on("message", (message) => {
|
|
11044
|
-
ibiz.mc.command.asyncAction.next(message);
|
|
11045
|
-
});
|
|
11046
|
-
await this.mqtt.connect();
|
|
11047
|
-
}
|
|
12682
|
+
await this.initMqtt();
|
|
11048
12683
|
}
|
|
11049
12684
|
/**
|
|
11050
12685
|
* 加载应用模型全局样式
|
|
@@ -11140,6 +12775,28 @@ var Application = class {
|
|
|
11140
12775
|
return logic.id === deUILogicId;
|
|
11141
12776
|
});
|
|
11142
12777
|
}
|
|
12778
|
+
/**
|
|
12779
|
+
* 初始化Mqtt服务
|
|
12780
|
+
* @author lxm
|
|
12781
|
+
* @date 2024-01-25 10:47:06
|
|
12782
|
+
* @return {*} {Promise<void>}
|
|
12783
|
+
*/
|
|
12784
|
+
async initMqtt() {
|
|
12785
|
+
if (this.mqtt) {
|
|
12786
|
+
this.mqtt.close();
|
|
12787
|
+
}
|
|
12788
|
+
if (ibiz.env.enableMqtt && ibiz.appData && ibiz.appData.mqtttopic && ibiz.auth.isAnonymous !== true) {
|
|
12789
|
+
this.mqtt = new MqttService(
|
|
12790
|
+
ibiz.appData.mqtttopic,
|
|
12791
|
+
getToken(),
|
|
12792
|
+
this.model.appId
|
|
12793
|
+
);
|
|
12794
|
+
this.mqtt.evt.on("message", (message) => {
|
|
12795
|
+
ibiz.mc.command.asyncAction.next(message);
|
|
12796
|
+
});
|
|
12797
|
+
await this.mqtt.connect();
|
|
12798
|
+
}
|
|
12799
|
+
}
|
|
11143
12800
|
};
|
|
11144
12801
|
|
|
11145
12802
|
// src/hub/convert/app-menu-convert/app-menu-convert.ts
|
|
@@ -12758,12 +14415,12 @@ var ViewController = class extends BaseController {
|
|
|
12758
14415
|
initEngines() {
|
|
12759
14416
|
const engineModels = getViewEngines(this.model);
|
|
12760
14417
|
if (engineModels.length) {
|
|
12761
|
-
engineModels.forEach((
|
|
12762
|
-
const ins = ibiz.engine.getEngine(
|
|
14418
|
+
engineModels.forEach((engine2) => {
|
|
14419
|
+
const ins = ibiz.engine.getEngine(engine2, this);
|
|
12763
14420
|
if (ins) {
|
|
12764
14421
|
this.engines.push(ins);
|
|
12765
14422
|
} else {
|
|
12766
|
-
ibiz.log.warn("\u672A\u627E\u5230\u89C6\u56FE\u5F15\u64CE\u5B9E\u73B0\uFF1A",
|
|
14423
|
+
ibiz.log.warn("\u672A\u627E\u5230\u89C6\u56FE\u5F15\u64CE\u5B9E\u73B0\uFF1A", engine2);
|
|
12767
14424
|
}
|
|
12768
14425
|
});
|
|
12769
14426
|
} else {
|
|
@@ -12854,14 +14511,14 @@ var ViewController = class extends BaseController {
|
|
|
12854
14511
|
}
|
|
12855
14512
|
this.initViewMsg();
|
|
12856
14513
|
if (this.engines.length) {
|
|
12857
|
-
await Promise.all(this.engines.map((
|
|
14514
|
+
await Promise.all(this.engines.map((engine2) => engine2.onCreated()));
|
|
12858
14515
|
}
|
|
12859
14516
|
}
|
|
12860
14517
|
async onMounted() {
|
|
12861
14518
|
var _a;
|
|
12862
14519
|
await super.onMounted();
|
|
12863
14520
|
if (this.engines.length) {
|
|
12864
|
-
await Promise.all(this.engines.map((
|
|
14521
|
+
await Promise.all(this.engines.map((engine2) => engine2.onMounted()));
|
|
12865
14522
|
}
|
|
12866
14523
|
(_a = this.scheduler) == null ? void 0 : _a.startTimerTrigger();
|
|
12867
14524
|
}
|
|
@@ -12869,7 +14526,7 @@ var ViewController = class extends BaseController {
|
|
|
12869
14526
|
const srfSessionId = this.context.srfsessionid;
|
|
12870
14527
|
await super.onDestroyed();
|
|
12871
14528
|
if (this.engines.length) {
|
|
12872
|
-
await Promise.all(this.engines.map((
|
|
14529
|
+
await Promise.all(this.engines.map((engine2) => engine2.onDestroyed()));
|
|
12873
14530
|
}
|
|
12874
14531
|
Object.values(this.counters).forEach((counter) => counter.destroy());
|
|
12875
14532
|
this.ctx.destroy();
|
|
@@ -12914,8 +14571,8 @@ var ViewController = class extends BaseController {
|
|
|
12914
14571
|
}
|
|
12915
14572
|
async call(key, args) {
|
|
12916
14573
|
let result;
|
|
12917
|
-
for (const
|
|
12918
|
-
result = await
|
|
14574
|
+
for (const engine2 of this.engines) {
|
|
14575
|
+
result = await engine2.call(key, args);
|
|
12919
14576
|
if (result !== void 0) {
|
|
12920
14577
|
break;
|
|
12921
14578
|
}
|
|
@@ -13168,6 +14825,11 @@ var EditorController = class {
|
|
|
13168
14825
|
this.style.height = "".concat(height, "px");
|
|
13169
14826
|
}
|
|
13170
14827
|
}
|
|
14828
|
+
if (this.model.editorItems) {
|
|
14829
|
+
this.model.editorItems = this.model.editorItems.filter(
|
|
14830
|
+
(item) => item.id !== this.model.id
|
|
14831
|
+
);
|
|
14832
|
+
}
|
|
13171
14833
|
}
|
|
13172
14834
|
/**
|
|
13173
14835
|
* 公共参数处理,计算上下文和视图参数
|
|
@@ -14585,13 +16247,13 @@ import { RuntimeModelError as RuntimeModelError29 } from "@ibiz-template/core";
|
|
|
14585
16247
|
// src/controller/control/chart/generator/base-series-generator.ts
|
|
14586
16248
|
import { plus, RuntimeModelError as RuntimeModelError28, toNumberOrNil } from "@ibiz-template/core";
|
|
14587
16249
|
import dayjs4 from "dayjs";
|
|
14588
|
-
import
|
|
16250
|
+
import minMax2 from "dayjs/plugin/minMax";
|
|
14589
16251
|
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
14590
16252
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
14591
16253
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
14592
16254
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
14593
16255
|
import { clone as clone19, isNil as isNil22, mergeDeepRight } from "ramda";
|
|
14594
|
-
dayjs4.extend(
|
|
16256
|
+
dayjs4.extend(minMax2);
|
|
14595
16257
|
dayjs4.extend(isSameOrBefore);
|
|
14596
16258
|
dayjs4.extend(quarterOfYear);
|
|
14597
16259
|
dayjs4.extend(weekOfYear);
|
|
@@ -17164,6 +18826,43 @@ var UIActionUtil = class {
|
|
|
17164
18826
|
default:
|
|
17165
18827
|
}
|
|
17166
18828
|
}
|
|
18829
|
+
const action = await getUIActionById(actionId, appId2);
|
|
18830
|
+
if (action.asyncAction && !result.cancel) {
|
|
18831
|
+
this.handleAsyncAction(params.event);
|
|
18832
|
+
}
|
|
18833
|
+
}
|
|
18834
|
+
/**
|
|
18835
|
+
* 处理异步行为
|
|
18836
|
+
*
|
|
18837
|
+
* @author zk
|
|
18838
|
+
* @date 2024-01-23 11:01:58
|
|
18839
|
+
* @static
|
|
18840
|
+
* @param {(Event | undefined)} event
|
|
18841
|
+
* @return {*} {Promise<void>}
|
|
18842
|
+
* @memberof UIActionUtil
|
|
18843
|
+
*/
|
|
18844
|
+
static async handleAsyncAction(event) {
|
|
18845
|
+
this.handleAsyncActionAnime(event);
|
|
18846
|
+
}
|
|
18847
|
+
/**
|
|
18848
|
+
* 处理异步行为动画
|
|
18849
|
+
*
|
|
18850
|
+
* @author zk
|
|
18851
|
+
* @date 2024-01-24 04:01:29
|
|
18852
|
+
* @private
|
|
18853
|
+
* @static
|
|
18854
|
+
* @param {(Event | undefined)} event
|
|
18855
|
+
* @return {*} {Promise<void>}
|
|
18856
|
+
* @memberof UIActionUtil
|
|
18857
|
+
*/
|
|
18858
|
+
static async handleAsyncActionAnime(event) {
|
|
18859
|
+
if (!event || !event.target) {
|
|
18860
|
+
return;
|
|
18861
|
+
}
|
|
18862
|
+
await ibiz.util.anime.moveAndResize(
|
|
18863
|
+
event.target,
|
|
18864
|
+
"#".concat("preset-message" /* MESSAGE */)
|
|
18865
|
+
);
|
|
17167
18866
|
}
|
|
17168
18867
|
};
|
|
17169
18868
|
|
|
@@ -28853,10 +30552,10 @@ var KanbanController = class extends DataViewControlController {
|
|
|
28853
30552
|
} else {
|
|
28854
30553
|
if (lastSort >= item[sortField]) {
|
|
28855
30554
|
if (cacheArr.length > 0) {
|
|
28856
|
-
cacheArr.forEach((
|
|
28857
|
-
|
|
28858
|
-
modifiedItems.push(
|
|
28859
|
-
cacheLastSort =
|
|
30555
|
+
cacheArr.forEach((cache2) => {
|
|
30556
|
+
cache2[sortField] = getNextSort(cacheLastSort);
|
|
30557
|
+
modifiedItems.push(cache2);
|
|
30558
|
+
cacheLastSort = cache2[sortField];
|
|
28860
30559
|
});
|
|
28861
30560
|
lastSort = cacheLastSort;
|
|
28862
30561
|
cacheLastSort = 0;
|
|
@@ -30051,8 +31750,60 @@ var TreeGridExFieldColumnController = class extends TreeGridExColumnController {
|
|
|
30051
31750
|
};
|
|
30052
31751
|
|
|
30053
31752
|
// src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts
|
|
30054
|
-
import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
|
|
30055
31753
|
var TreeGridExUAColumnController = class extends TreeGridExColumnController {
|
|
31754
|
+
constructor() {
|
|
31755
|
+
super(...arguments);
|
|
31756
|
+
/**
|
|
31757
|
+
* 该树表格列对应不同节点模型的节点列控制器
|
|
31758
|
+
* @author lxm
|
|
31759
|
+
* @date 2024-01-08 05:40:56
|
|
31760
|
+
* @type {Map<string, IDETreeNodeUAColumn>}
|
|
31761
|
+
*/
|
|
31762
|
+
this.nodeColumnMap = /* @__PURE__ */ new Map();
|
|
31763
|
+
}
|
|
31764
|
+
async init() {
|
|
31765
|
+
await this.onInit();
|
|
31766
|
+
await this.initNodeColumnMap();
|
|
31767
|
+
}
|
|
31768
|
+
/**
|
|
31769
|
+
* 解析模型初始化节点对应的节点列模型
|
|
31770
|
+
* @author lxm
|
|
31771
|
+
* @date 2024-01-24 02:41:05
|
|
31772
|
+
*/
|
|
31773
|
+
initNodeColumnMap() {
|
|
31774
|
+
var _a;
|
|
31775
|
+
(_a = this.treeGrid.model.detreeNodes) == null ? void 0 : _a.forEach((node) => {
|
|
31776
|
+
var _a2;
|
|
31777
|
+
if (node.treeNodeType !== "DE") {
|
|
31778
|
+
return;
|
|
31779
|
+
}
|
|
31780
|
+
const nodeColumn = (_a2 = node.detreeNodeColumns) == null ? void 0 : _a2.find(
|
|
31781
|
+
(column) => {
|
|
31782
|
+
return column.detreeColumnId === this.model.id;
|
|
31783
|
+
}
|
|
31784
|
+
);
|
|
31785
|
+
if (nodeColumn) {
|
|
31786
|
+
this.nodeColumnMap.set(node.id, nodeColumn);
|
|
31787
|
+
}
|
|
31788
|
+
});
|
|
31789
|
+
}
|
|
31790
|
+
/**
|
|
31791
|
+
* 获取界面行为组mode
|
|
31792
|
+
* @author lxm
|
|
31793
|
+
* @date 2024-01-24 04:13:03
|
|
31794
|
+
* @param {ITreeGridExRowState} row
|
|
31795
|
+
* @return {*} {(IUIActionGroup | undefined)}
|
|
31796
|
+
*/
|
|
31797
|
+
getUIActionGroup(row) {
|
|
31798
|
+
let { deuiactionGroup } = this.model;
|
|
31799
|
+
if (row.data._nodeType === "DE" && this.nodeColumnMap.get(row.data._nodeId)) {
|
|
31800
|
+
const nodeColumn = this.nodeColumnMap.get(row.data._nodeId);
|
|
31801
|
+
if (nodeColumn.deuiactionGroup) {
|
|
31802
|
+
deuiactionGroup = nodeColumn.deuiactionGroup;
|
|
31803
|
+
}
|
|
31804
|
+
}
|
|
31805
|
+
return deuiactionGroup;
|
|
31806
|
+
}
|
|
30056
31807
|
/**
|
|
30057
31808
|
* 给rowController初始化操作列的状态
|
|
30058
31809
|
*
|
|
@@ -30062,10 +31813,10 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
|
|
|
30062
31813
|
*/
|
|
30063
31814
|
initActionStates(row) {
|
|
30064
31815
|
var _a;
|
|
30065
|
-
const
|
|
31816
|
+
const deuiactionGroup = this.getUIActionGroup(row);
|
|
30066
31817
|
if (!deuiactionGroup) {
|
|
31818
|
+
ibiz.log.warn("".concat(this.model.id, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4"));
|
|
30067
31819
|
return;
|
|
30068
|
-
throw new RuntimeModelError69(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
|
|
30069
31820
|
}
|
|
30070
31821
|
if (!((_a = deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
|
|
30071
31822
|
ibiz.log.debug("\u64CD\u4F5C\u5217\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
|
|
@@ -30119,7 +31870,7 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
|
|
|
30119
31870
|
};
|
|
30120
31871
|
|
|
30121
31872
|
// src/controller/control/tree-grid/tree-grid.controller.ts
|
|
30122
|
-
import { RuntimeModelError as
|
|
31873
|
+
import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
|
|
30123
31874
|
var TreeGridController = class extends GridController {
|
|
30124
31875
|
constructor() {
|
|
30125
31876
|
super(...arguments);
|
|
@@ -30164,10 +31915,10 @@ var TreeGridController = class extends GridController {
|
|
|
30164
31915
|
return item.treeColumnMode === 2 || item.treeColumnMode === 3;
|
|
30165
31916
|
});
|
|
30166
31917
|
if (!treeGridParent) {
|
|
30167
|
-
throw new
|
|
31918
|
+
throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
|
|
30168
31919
|
}
|
|
30169
31920
|
if (!treeGridValue) {
|
|
30170
|
-
throw new
|
|
31921
|
+
throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
|
|
30171
31922
|
}
|
|
30172
31923
|
this.treeGridValueField = treeGridValue.appDEFieldId.toLowerCase();
|
|
30173
31924
|
this.treeGridParentField = treeGridParent.appDEFieldId.toLowerCase();
|
|
@@ -31651,8 +33402,8 @@ var EngineFactory = class {
|
|
|
31651
33402
|
* @param {string} key
|
|
31652
33403
|
* @param {IViewEngine} engine
|
|
31653
33404
|
*/
|
|
31654
|
-
register(key,
|
|
31655
|
-
this.viewEngines.set(key,
|
|
33405
|
+
register(key, engine2) {
|
|
33406
|
+
this.viewEngines.set(key, engine2);
|
|
31656
33407
|
}
|
|
31657
33408
|
/**
|
|
31658
33409
|
* 注销视图引擎
|
|
@@ -31892,7 +33643,7 @@ var ViewEngineBase = class {
|
|
|
31892
33643
|
};
|
|
31893
33644
|
|
|
31894
33645
|
// src/engine/md-view.engine.ts
|
|
31895
|
-
import { RuntimeModelError as
|
|
33646
|
+
import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
|
|
31896
33647
|
import { clone as clone30 } from "ramda";
|
|
31897
33648
|
var MDViewEngine = class extends ViewEngineBase {
|
|
31898
33649
|
/**
|
|
@@ -32080,7 +33831,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
32080
33831
|
view: this.view
|
|
32081
33832
|
}));
|
|
32082
33833
|
if (result === -1) {
|
|
32083
|
-
throw new
|
|
33834
|
+
throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
32084
33835
|
} else {
|
|
32085
33836
|
return {
|
|
32086
33837
|
cancel: !result.ok
|
|
@@ -32103,7 +33854,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
32103
33854
|
(item) => item.id === "newdata"
|
|
32104
33855
|
);
|
|
32105
33856
|
if (!openAppViewLogic) {
|
|
32106
|
-
throw new
|
|
33857
|
+
throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
32107
33858
|
}
|
|
32108
33859
|
const params = clone30(this.view.params);
|
|
32109
33860
|
if (copyMode) {
|
|
@@ -32117,7 +33868,7 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
32117
33868
|
view: this.view
|
|
32118
33869
|
}));
|
|
32119
33870
|
if (result === -1) {
|
|
32120
|
-
throw new
|
|
33871
|
+
throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
32121
33872
|
} else {
|
|
32122
33873
|
return {
|
|
32123
33874
|
cancel: !result.ok
|
|
@@ -32292,6 +34043,14 @@ var GlobalUtil = class {
|
|
|
32292
34043
|
* @date 2024-01-18 14:01:23
|
|
32293
34044
|
*/
|
|
32294
34045
|
this.viewStack = new ViewStack();
|
|
34046
|
+
/**
|
|
34047
|
+
* 动画工具类
|
|
34048
|
+
*
|
|
34049
|
+
* @author zk
|
|
34050
|
+
* @date 2024-01-22 09:01:33
|
|
34051
|
+
* @memberof GlobalUtil
|
|
34052
|
+
*/
|
|
34053
|
+
this.anime = new AnimeUtil();
|
|
32295
34054
|
this.error.register(new DefaultErrorHandler());
|
|
32296
34055
|
}
|
|
32297
34056
|
/**
|
|
@@ -32435,13 +34194,13 @@ var ScriptExecutor = class extends LogicExecutor {
|
|
|
32435
34194
|
};
|
|
32436
34195
|
|
|
32437
34196
|
// src/logic-scheduler/executor/app-de-ui-logic-executor.ts
|
|
32438
|
-
import { RuntimeModelError as
|
|
34197
|
+
import { RuntimeModelError as RuntimeModelError71 } from "@ibiz-template/core";
|
|
32439
34198
|
var AppDEUILogicExecutor = class extends LogicExecutor {
|
|
32440
34199
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32441
34200
|
execute(executeParams) {
|
|
32442
34201
|
const { appDEUILogicId, appDataEntityId } = this.logic;
|
|
32443
34202
|
if (!appDEUILogicId) {
|
|
32444
|
-
throw new
|
|
34203
|
+
throw new RuntimeModelError71(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
32445
34204
|
}
|
|
32446
34205
|
execUILogic(appDEUILogicId, appDataEntityId, executeParams);
|
|
32447
34206
|
}
|
|
@@ -32899,7 +34658,7 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
|
|
|
32899
34658
|
};
|
|
32900
34659
|
|
|
32901
34660
|
// src/logic-scheduler/trigger/timer-trigger.ts
|
|
32902
|
-
import { RuntimeError as RuntimeError69, RuntimeModelError as
|
|
34661
|
+
import { RuntimeError as RuntimeError69, RuntimeModelError as RuntimeModelError72 } from "@ibiz-template/core";
|
|
32903
34662
|
var TimerTrigger = class extends LogicTrigger {
|
|
32904
34663
|
constructor() {
|
|
32905
34664
|
super(...arguments);
|
|
@@ -32907,7 +34666,7 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
32907
34666
|
}
|
|
32908
34667
|
start() {
|
|
32909
34668
|
if (!this.logic.timer) {
|
|
32910
|
-
throw new
|
|
34669
|
+
throw new RuntimeModelError72(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
|
|
32911
34670
|
}
|
|
32912
34671
|
this.timer = setInterval(() => {
|
|
32913
34672
|
if (!this.scheduler.defaultParamsCb) {
|
|
@@ -32929,7 +34688,7 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
32929
34688
|
import {
|
|
32930
34689
|
ModelError as ModelError34,
|
|
32931
34690
|
RuntimeError as RuntimeError70,
|
|
32932
|
-
RuntimeModelError as
|
|
34691
|
+
RuntimeModelError as RuntimeModelError73
|
|
32933
34692
|
} from "@ibiz-template/core";
|
|
32934
34693
|
import { notNilEmpty as notNilEmpty9 } from "qx-util";
|
|
32935
34694
|
var AppUILogicExecutor = class extends LogicExecutor {
|
|
@@ -32975,7 +34734,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
32975
34734
|
} else {
|
|
32976
34735
|
openViewRef = appUILogic.openDataAppView;
|
|
32977
34736
|
if (!openViewRef) {
|
|
32978
|
-
throw new
|
|
34737
|
+
throw new RuntimeModelError73(
|
|
32979
34738
|
appUILogic,
|
|
32980
34739
|
"opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
|
|
32981
34740
|
);
|
|
@@ -32983,7 +34742,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
32983
34742
|
}
|
|
32984
34743
|
const openView = openViewRef.refAppViewId;
|
|
32985
34744
|
if (!openView) {
|
|
32986
|
-
throw new
|
|
34745
|
+
throw new RuntimeModelError73(
|
|
32987
34746
|
appUILogic,
|
|
32988
34747
|
"opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
|
|
32989
34748
|
);
|
|
@@ -33013,7 +34772,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33013
34772
|
);
|
|
33014
34773
|
const typeFileName = appDataEntity.formTypeAppDEFieldId || appDataEntity.dataTypeAppDEFieldId;
|
|
33015
34774
|
if (!typeFileName) {
|
|
33016
|
-
throw new
|
|
34775
|
+
throw new RuntimeModelError73(
|
|
33017
34776
|
appUILogic,
|
|
33018
34777
|
"".concat(appDataEntity.codeName, "[\u591A\u8868\u5355\u5B9E\u4F53] or [\u7D22\u5F15\u5B9E\u4F53]\u7F3A\u5C11\u7C7B\u578B\u5C5E\u6027\u914D\u7F6E")
|
|
33019
34778
|
);
|
|
@@ -33021,7 +34780,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33021
34780
|
const { data } = parameters;
|
|
33022
34781
|
const formTypeValue = data[0][typeFileName];
|
|
33023
34782
|
if (!formTypeValue) {
|
|
33024
|
-
throw new
|
|
34783
|
+
throw new RuntimeModelError73(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
33025
34784
|
}
|
|
33026
34785
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
33027
34786
|
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
@@ -33063,7 +34822,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33063
34822
|
return viewRef.refMode.toLowerCase() !== parentDeName;
|
|
33064
34823
|
});
|
|
33065
34824
|
if (!newViewRef) {
|
|
33066
|
-
throw new
|
|
34825
|
+
throw new RuntimeModelError73(
|
|
33067
34826
|
appUILogic,
|
|
33068
34827
|
"\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
|
|
33069
34828
|
);
|
|
@@ -33073,7 +34832,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33073
34832
|
} else {
|
|
33074
34833
|
newViewRef = newDataAppView;
|
|
33075
34834
|
if (!newViewRef || !newViewRef.refAppViewId) {
|
|
33076
|
-
throw new
|
|
34835
|
+
throw new RuntimeModelError73(
|
|
33077
34836
|
appUILogic,
|
|
33078
34837
|
"newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
|
|
33079
34838
|
);
|
|
@@ -33137,7 +34896,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33137
34896
|
const { wizardAppView, newDataAppViews } = appUILogic;
|
|
33138
34897
|
const { context, params, ...rest } = parameters;
|
|
33139
34898
|
if (!wizardAppView || !wizardAppView.refAppViewId) {
|
|
33140
|
-
throw new
|
|
34899
|
+
throw new RuntimeModelError73(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
|
|
33141
34900
|
}
|
|
33142
34901
|
const result = await ibiz.commands.execute(
|
|
33143
34902
|
OpenAppViewCommand.TAG,
|
|
@@ -33188,7 +34947,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
33188
34947
|
const minorDERs = selfDe.minorAppDERSs;
|
|
33189
34948
|
const pickParentDeName = newViewRef.refMode.toLowerCase();
|
|
33190
34949
|
if (!minorDERs) {
|
|
33191
|
-
throw new
|
|
34950
|
+
throw new RuntimeModelError73(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
|
|
33192
34951
|
}
|
|
33193
34952
|
let pickParentFieldName = "";
|
|
33194
34953
|
minorDERs == null ? void 0 : minorDERs.forEach((item) => {
|
|
@@ -33285,12 +35044,12 @@ var ControlEventTrigger = class extends LogicTrigger {
|
|
|
33285
35044
|
};
|
|
33286
35045
|
|
|
33287
35046
|
// src/logic-scheduler/executor/app-ui-action-executor.ts
|
|
33288
|
-
import { RuntimeModelError as
|
|
35047
|
+
import { RuntimeModelError as RuntimeModelError74 } from "@ibiz-template/core";
|
|
33289
35048
|
var AppDEUIActionExecutor = class extends LogicExecutor {
|
|
33290
35049
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33291
35050
|
execute(executeParams) {
|
|
33292
35051
|
if (!this.logic.appDEUIActionId) {
|
|
33293
|
-
throw new
|
|
35052
|
+
throw new RuntimeModelError74(
|
|
33294
35053
|
this.logic,
|
|
33295
35054
|
"\u903B\u8F91\u4E2D\u7F3A\u5C11\u89E6\u53D1\u5E94\u7528\u5B9E\u4F53\u754C\u9762\u884C\u4E3Aid"
|
|
33296
35055
|
);
|
|
@@ -33468,6 +35227,7 @@ export {
|
|
|
33468
35227
|
AcFetchMethod,
|
|
33469
35228
|
ActionBarPortletController,
|
|
33470
35229
|
ActivityCounter,
|
|
35230
|
+
AnimeUtil,
|
|
33471
35231
|
AppCounter,
|
|
33472
35232
|
AppDECounter,
|
|
33473
35233
|
AppDECounterProvider,
|
|
@@ -33618,6 +35378,7 @@ export {
|
|
|
33618
35378
|
PluginStaticResource,
|
|
33619
35379
|
PortletPartController,
|
|
33620
35380
|
PortletPartState,
|
|
35381
|
+
PresetIdentifier,
|
|
33621
35382
|
QXEventEx,
|
|
33622
35383
|
RawItemPortletController,
|
|
33623
35384
|
RawValueUtil,
|
|
@@ -33690,6 +35451,7 @@ export {
|
|
|
33690
35451
|
calcContentAlignStyle,
|
|
33691
35452
|
calcDeCodeNameById,
|
|
33692
35453
|
calcDynaClass,
|
|
35454
|
+
calcDynaSysParams,
|
|
33693
35455
|
calcGridLayoutPos,
|
|
33694
35456
|
calcLayoutHeightWidth,
|
|
33695
35457
|
calcMainStateOPPrivsStrs,
|