@stsdti/funky-ui-kit 1.8.3 → 1.8.5
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/funky-ui-kit.esm.js +766 -19
- package/dist/funky-ui-kit.esm.js.map +1 -1
- package/package.json +2 -1
- package/web-types.json +17 -1
package/dist/funky-ui-kit.esm.js
CHANGED
|
@@ -67832,7 +67832,7 @@ function normalizePosition(position) {
|
|
|
67832
67832
|
function startTimer(item) {
|
|
67833
67833
|
item.startedAt = Date.now();
|
|
67834
67834
|
item.timer = setTimeout(() => {
|
|
67835
|
-
remove(item.id);
|
|
67835
|
+
remove$1(item.id);
|
|
67836
67836
|
}, item.remaining);
|
|
67837
67837
|
}
|
|
67838
67838
|
function open(options = {}) {
|
|
@@ -67893,7 +67893,7 @@ function recomputeHeights() {
|
|
|
67893
67893
|
if (element && element.style.overflow !== "hidden") setHeight(id, element.offsetHeight);
|
|
67894
67894
|
});
|
|
67895
67895
|
}
|
|
67896
|
-
async function remove(idOrItem) {
|
|
67896
|
+
async function remove$1(idOrItem) {
|
|
67897
67897
|
const id = typeof idOrItem === "object" ? idOrItem?.id : idOrItem;
|
|
67898
67898
|
if (!toastState.toasts[id]) return;
|
|
67899
67899
|
const item = toastState.toasts[id];
|
|
@@ -68080,7 +68080,7 @@ var ToastUtils = class {
|
|
|
68080
68080
|
return open(options);
|
|
68081
68081
|
}
|
|
68082
68082
|
static remove(idOrItem) {
|
|
68083
|
-
remove(idOrItem);
|
|
68083
|
+
remove$1(idOrItem);
|
|
68084
68084
|
}
|
|
68085
68085
|
static removeAll() {
|
|
68086
68086
|
removeAll();
|
|
@@ -68409,7 +68409,7 @@ var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uF
|
|
|
68409
68409
|
* @param {Boolean} [allOwnKeys = false]
|
|
68410
68410
|
* @returns {any}
|
|
68411
68411
|
*/
|
|
68412
|
-
function forEach$
|
|
68412
|
+
function forEach$2(obj, fn, { allOwnKeys = false } = {}) {
|
|
68413
68413
|
if (obj === null || typeof obj === "undefined") return;
|
|
68414
68414
|
let i;
|
|
68415
68415
|
let l;
|
|
@@ -68469,7 +68469,7 @@ function merge$1() {
|
|
|
68469
68469
|
else if (isArray$3(val)) result[targetKey] = val.slice();
|
|
68470
68470
|
else result[targetKey] = val;
|
|
68471
68471
|
};
|
|
68472
|
-
for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach$
|
|
68472
|
+
for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach$2(arguments[i], assignValue);
|
|
68473
68473
|
return result;
|
|
68474
68474
|
}
|
|
68475
68475
|
/**
|
|
@@ -68483,7 +68483,7 @@ function merge$1() {
|
|
|
68483
68483
|
* @returns {Object} The resulting value of object a
|
|
68484
68484
|
*/
|
|
68485
68485
|
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
68486
|
-
forEach$
|
|
68486
|
+
forEach$2(b, (val, key) => {
|
|
68487
68487
|
if (thisArg && isFunction(val)) a[key] = bind(val, thisArg);
|
|
68488
68488
|
else a[key] = val;
|
|
68489
68489
|
}, { allOwnKeys });
|
|
@@ -68638,7 +68638,7 @@ var isRegExp = kindOfTest("RegExp");
|
|
|
68638
68638
|
var reduceDescriptors = (obj, reducer) => {
|
|
68639
68639
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
68640
68640
|
const reducedDescriptors = {};
|
|
68641
|
-
forEach$
|
|
68641
|
+
forEach$2(descriptors, (descriptor, name) => {
|
|
68642
68642
|
let ret;
|
|
68643
68643
|
if ((ret = reducer(descriptor, name, obj)) !== false) reducedDescriptors[name] = ret || descriptor;
|
|
68644
68644
|
});
|
|
@@ -68699,7 +68699,7 @@ var toJSONObject = (obj) => {
|
|
|
68699
68699
|
if (!("toJSON" in source)) {
|
|
68700
68700
|
stack[i] = source;
|
|
68701
68701
|
const target = isArray$3(source) ? [] : {};
|
|
68702
|
-
forEach$
|
|
68702
|
+
forEach$2(source, (value, key) => {
|
|
68703
68703
|
const reducedValue = visit(value, i + 1);
|
|
68704
68704
|
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
68705
68705
|
});
|
|
@@ -68750,7 +68750,7 @@ var utils_default = {
|
|
|
68750
68750
|
isURLSearchParams,
|
|
68751
68751
|
isTypedArray,
|
|
68752
68752
|
isFileList,
|
|
68753
|
-
forEach: forEach$
|
|
68753
|
+
forEach: forEach$2,
|
|
68754
68754
|
merge: merge$1,
|
|
68755
68755
|
extend,
|
|
68756
68756
|
trim,
|
|
@@ -77908,7 +77908,7 @@ function addMonths(date, amount, options) {
|
|
|
77908
77908
|
* .toString();
|
|
77909
77909
|
* //=> "2017-06-15T15:29:20"
|
|
77910
77910
|
*/
|
|
77911
|
-
function add(date, duration, options) {
|
|
77911
|
+
function add$1(date, duration, options) {
|
|
77912
77912
|
const { years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0 } = duration;
|
|
77913
77913
|
const _date = toDate(date, options?.in);
|
|
77914
77914
|
const dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date;
|
|
@@ -86378,7 +86378,7 @@ var St = {
|
|
|
86378
86378
|
return !m.validateTime(e, r);
|
|
86379
86379
|
}
|
|
86380
86380
|
return !1;
|
|
86381
|
-
}, K = computed(() => (e) => !Y(+m[e] + +D.value[`${e}Increment`], e) || G(e, !0) || m.disabled), J = computed(() => (e) => !Y(m[e] - +D.value[`${e}Increment`], e) || G(e, !1) || m.disabled), se = (e, t) => add(set$2(h(), e), t), ce = (e, t) => sub(set$2(h(), e), t), le = computed(() => ({
|
|
86381
|
+
}, K = computed(() => (e) => !Y(+m[e] + +D.value[`${e}Increment`], e) || G(e, !0) || m.disabled), J = computed(() => (e) => !Y(m[e] - +D.value[`${e}Increment`], e) || G(e, !1) || m.disabled), se = (e, t) => add$1(set$2(h(), e), t), ce = (e, t) => sub(set$2(h(), e), t), le = computed(() => ({
|
|
86382
86382
|
"dp--time-col": !0,
|
|
86383
86383
|
"dp--time-col-block": !D.value.timePickerInline,
|
|
86384
86384
|
"dp--time-col-reg-block": !D.value.enableSeconds && D.value.is24 && !D.value.timePickerInline,
|
|
@@ -87432,7 +87432,7 @@ var St = {
|
|
|
87432
87432
|
};
|
|
87433
87433
|
}, me = (e = o(), t = !1) => {
|
|
87434
87434
|
if ((!v.value.count || !v.value.static || t) && G(0, getMonth(e), getYear(e), t), v.value.count && (!p.value || fe() || !v.value.solo) && (!v.value.solo || t)) for (let e = 1; e < v.value.count; e++) {
|
|
87435
|
-
let t = add(set$2(o(), {
|
|
87435
|
+
let t = add$1(set$2(o(), {
|
|
87436
87436
|
month: u.value(e - 1),
|
|
87437
87437
|
year: d.value(e - 1)
|
|
87438
87438
|
}), { months: 1 });
|
|
@@ -125164,8 +125164,9 @@ var _sfc_main$63 = {
|
|
|
125164
125164
|
"download",
|
|
125165
125165
|
"removed"
|
|
125166
125166
|
],
|
|
125167
|
-
setup(__props) {
|
|
125167
|
+
setup(__props, { emit: __emit }) {
|
|
125168
125168
|
const props = __props;
|
|
125169
|
+
const fileUploadContext = inject("fileUploadContext", null);
|
|
125169
125170
|
const { getFilename, getFileTypeClass, getStatus, getExtension } = AppFileNewUtils_default;
|
|
125170
125171
|
const getFileStatusLabel = (file) => getStatus(file)?.label;
|
|
125171
125172
|
const actions = [
|
|
@@ -125185,6 +125186,7 @@ var _sfc_main$63 = {
|
|
|
125185
125186
|
emit: "removed"
|
|
125186
125187
|
}
|
|
125187
125188
|
];
|
|
125189
|
+
const passthroughSlots = computed(() => Object.keys(useSlots()).filter((slotName) => !["status", "actions"].includes(slotName)));
|
|
125188
125190
|
const gridStyles = computed(() => ({
|
|
125189
125191
|
display: "grid",
|
|
125190
125192
|
gridTemplateColumns: `repeat(${props.columns}, minmax(0, 1fr))`,
|
|
@@ -125213,22 +125215,25 @@ var _sfc_main$63 = {
|
|
|
125213
125215
|
class: "file-name"
|
|
125214
125216
|
}, null, 8, ["value"]), createElementVNode("div", _hoisted_2$4, [
|
|
125215
125217
|
createElementVNode("span", null, toDisplayString(file?.size ? (file.size / (1024 * 1024)).toFixed(2) + " MB" : "N/A"), 1),
|
|
125216
|
-
createElementVNode("span", { class: normalizeClass(getFileStatusClass(file)) }, [createVNode(_component_app_icon, {
|
|
125218
|
+
renderSlot(_ctx.$slots, "status", { file }, () => [createElementVNode("span", { class: normalizeClass(getFileStatusClass(file)) }, [createVNode(_component_app_icon, {
|
|
125217
125219
|
value: getFileStatusIcon(file),
|
|
125218
125220
|
class: "status-icon"
|
|
125219
|
-
}, null, 8, ["value"]), createTextVNode(" " + toDisplayString(getFileStatusLabel(file)), 1)], 2),
|
|
125220
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
125221
|
+
}, null, 8, ["value"]), createTextVNode(" " + toDisplayString(getFileStatusLabel(file)), 1)], 2)]),
|
|
125222
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(passthroughSlots.value, (slotName) => {
|
|
125221
125223
|
return renderSlot(_ctx.$slots, slotName, {
|
|
125222
125224
|
key: slotName,
|
|
125223
|
-
file
|
|
125225
|
+
file,
|
|
125226
|
+
fileUpload: _ctx.fileUpload
|
|
125224
125227
|
});
|
|
125225
125228
|
}), 128))
|
|
125226
125229
|
])]),
|
|
125227
125230
|
unref(getStatus)(file) === unref(fileStatus).uploaded ? (openBlock(), createElementBlock("div", _hoisted_3$3, [(openBlock(), createElementBlock(Fragment, null, renderList(actions, (action) => {
|
|
125228
125231
|
return renderSlot(_ctx.$slots, action.name, {
|
|
125229
125232
|
key: action.name,
|
|
125233
|
+
action,
|
|
125230
125234
|
file,
|
|
125231
|
-
index
|
|
125235
|
+
index,
|
|
125236
|
+
fileUploadContext: unref(fileUploadContext)
|
|
125232
125237
|
}, () => [createVNode(_component_app_button, {
|
|
125233
125238
|
disabled: action.name === "removed" && __props.disabled,
|
|
125234
125239
|
class: "btn-transparent",
|
|
@@ -125392,6 +125397,7 @@ var _sfc_main$16 = {
|
|
|
125392
125397
|
const emit = __emit;
|
|
125393
125398
|
const previewModal = ref(null);
|
|
125394
125399
|
const fileUpload = useFileUpload(modelValue, props, emit);
|
|
125400
|
+
provide("fileUploadContext", fileUpload);
|
|
125395
125401
|
const fileInput = fileUpload.fileInput;
|
|
125396
125402
|
const appFileNewUtils = AppFileNewUtils_default;
|
|
125397
125403
|
const appFileNewRepository = AppFileNewRepository_default(props);
|
|
@@ -126408,6 +126414,734 @@ var _sfc_main$58 = {
|
|
|
126408
126414
|
}
|
|
126409
126415
|
};
|
|
126410
126416
|
//#endregion
|
|
126417
|
+
//#region node_modules/@formkit/auto-animate/index.mjs
|
|
126418
|
+
/**
|
|
126419
|
+
* A set of all the parents currently being observe. This is the only non weak
|
|
126420
|
+
* registry.
|
|
126421
|
+
*/
|
|
126422
|
+
var parents = /* @__PURE__ */ new Set();
|
|
126423
|
+
/**
|
|
126424
|
+
* Element coordinates that is constantly kept up to date.
|
|
126425
|
+
*/
|
|
126426
|
+
var coords = /* @__PURE__ */ new WeakMap();
|
|
126427
|
+
/**
|
|
126428
|
+
* Siblings of elements that have been removed from the dom.
|
|
126429
|
+
*/
|
|
126430
|
+
var siblings = /* @__PURE__ */ new WeakMap();
|
|
126431
|
+
/**
|
|
126432
|
+
* Animations that are currently running.
|
|
126433
|
+
*/
|
|
126434
|
+
var animations = /* @__PURE__ */ new WeakMap();
|
|
126435
|
+
/**
|
|
126436
|
+
* A map of existing intersection observers used to track element movements.
|
|
126437
|
+
*/
|
|
126438
|
+
var intersections = /* @__PURE__ */ new WeakMap();
|
|
126439
|
+
/**
|
|
126440
|
+
* A map of existing mutation observers used to track element movements.
|
|
126441
|
+
*/
|
|
126442
|
+
var mutationObservers = /* @__PURE__ */ new WeakMap();
|
|
126443
|
+
/**
|
|
126444
|
+
* Intervals for automatically checking the position of elements occasionally.
|
|
126445
|
+
*/
|
|
126446
|
+
var intervals = /* @__PURE__ */ new WeakMap();
|
|
126447
|
+
/**
|
|
126448
|
+
* The configuration options for each group of elements.
|
|
126449
|
+
*/
|
|
126450
|
+
var options = /* @__PURE__ */ new WeakMap();
|
|
126451
|
+
/**
|
|
126452
|
+
* Debounce counters by id, used to debounce calls to update positions.
|
|
126453
|
+
*/
|
|
126454
|
+
var debounces = /* @__PURE__ */ new WeakMap();
|
|
126455
|
+
/**
|
|
126456
|
+
* All parents that are currently enabled are tracked here.
|
|
126457
|
+
*/
|
|
126458
|
+
var enabled = /* @__PURE__ */ new WeakSet();
|
|
126459
|
+
/**
|
|
126460
|
+
* The document used to calculate transitions.
|
|
126461
|
+
*/
|
|
126462
|
+
var root;
|
|
126463
|
+
/**
|
|
126464
|
+
* The root’s XY scroll positions.
|
|
126465
|
+
*/
|
|
126466
|
+
var scrollX = 0;
|
|
126467
|
+
var scrollY = 0;
|
|
126468
|
+
/**
|
|
126469
|
+
* Used to sign an element as the target.
|
|
126470
|
+
*/
|
|
126471
|
+
var TGT = "__aa_tgt";
|
|
126472
|
+
/**
|
|
126473
|
+
* Used to sign an element as being part of a removal.
|
|
126474
|
+
*/
|
|
126475
|
+
var DEL = "__aa_del";
|
|
126476
|
+
/**
|
|
126477
|
+
* Used to sign an element as being "new". When an element is removed from the
|
|
126478
|
+
* dom, but may cycle back in we can sign it with new to ensure the next time
|
|
126479
|
+
* it is recognized we consider it new.
|
|
126480
|
+
*/
|
|
126481
|
+
var NEW = "__aa_new";
|
|
126482
|
+
/**
|
|
126483
|
+
* Callback for handling all mutations.
|
|
126484
|
+
* @param mutations - A mutation list
|
|
126485
|
+
*/
|
|
126486
|
+
var handleMutations = (mutations) => {
|
|
126487
|
+
const elements = getElements(mutations);
|
|
126488
|
+
if (elements) elements.forEach((el) => animate(el));
|
|
126489
|
+
};
|
|
126490
|
+
/**
|
|
126491
|
+
*
|
|
126492
|
+
* @param entries - Elements that have been resized.
|
|
126493
|
+
*/
|
|
126494
|
+
var handleResizes = (entries) => {
|
|
126495
|
+
entries.forEach((entry) => {
|
|
126496
|
+
if (entry.target === root) updateAllPos();
|
|
126497
|
+
if (coords.has(entry.target)) updatePos(entry.target);
|
|
126498
|
+
});
|
|
126499
|
+
};
|
|
126500
|
+
/**
|
|
126501
|
+
* Determine if an element is fully outside of the current viewport.
|
|
126502
|
+
* @param el - Element to test
|
|
126503
|
+
*/
|
|
126504
|
+
function isOffscreen(el) {
|
|
126505
|
+
const rect = el.getBoundingClientRect();
|
|
126506
|
+
const vw = (root === null || root === void 0 ? void 0 : root.clientWidth) || 0;
|
|
126507
|
+
const vh = (root === null || root === void 0 ? void 0 : root.clientHeight) || 0;
|
|
126508
|
+
return rect.bottom < 0 || rect.top > vh || rect.right < 0 || rect.left > vw;
|
|
126509
|
+
}
|
|
126510
|
+
/**
|
|
126511
|
+
* Observe this elements position.
|
|
126512
|
+
* @param el - The element to observe the position of.
|
|
126513
|
+
*/
|
|
126514
|
+
function observePosition(el) {
|
|
126515
|
+
const oldObserver = intersections.get(el);
|
|
126516
|
+
oldObserver === null || oldObserver === void 0 || oldObserver.disconnect();
|
|
126517
|
+
let rect = coords.get(el);
|
|
126518
|
+
let invocations = 0;
|
|
126519
|
+
const buffer = 5;
|
|
126520
|
+
if (!rect) {
|
|
126521
|
+
rect = getCoords(el);
|
|
126522
|
+
coords.set(el, rect);
|
|
126523
|
+
}
|
|
126524
|
+
const { offsetWidth, offsetHeight } = root;
|
|
126525
|
+
const rootMargin = [
|
|
126526
|
+
rect.top - buffer,
|
|
126527
|
+
offsetWidth - (rect.left + buffer + rect.width),
|
|
126528
|
+
offsetHeight - (rect.top + buffer + rect.height),
|
|
126529
|
+
rect.left - buffer
|
|
126530
|
+
].map((px) => `${-1 * Math.floor(px)}px`).join(" ");
|
|
126531
|
+
const observer = new IntersectionObserver(() => {
|
|
126532
|
+
++invocations > 1 && updatePos(el);
|
|
126533
|
+
}, {
|
|
126534
|
+
root,
|
|
126535
|
+
threshold: 1,
|
|
126536
|
+
rootMargin
|
|
126537
|
+
});
|
|
126538
|
+
observer.observe(el);
|
|
126539
|
+
intersections.set(el, observer);
|
|
126540
|
+
}
|
|
126541
|
+
/**
|
|
126542
|
+
* Update the exact position of a given element.
|
|
126543
|
+
* @param el - An element to update the position of.
|
|
126544
|
+
* @param debounce - Whether or not to debounce the update. After an animation is finished, it should update as soon as possible to prevent flickering on quick toggles.
|
|
126545
|
+
*/
|
|
126546
|
+
function updatePos(el, debounce = true) {
|
|
126547
|
+
clearTimeout(debounces.get(el));
|
|
126548
|
+
const optionsOrPlugin = getOptions(el);
|
|
126549
|
+
const delay = debounce ? isPlugin(optionsOrPlugin) ? 500 : optionsOrPlugin.duration : 0;
|
|
126550
|
+
debounces.set(el, setTimeout(async () => {
|
|
126551
|
+
const currentAnimation = animations.get(el);
|
|
126552
|
+
try {
|
|
126553
|
+
await (currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.finished);
|
|
126554
|
+
coords.set(el, getCoords(el));
|
|
126555
|
+
observePosition(el);
|
|
126556
|
+
} catch {}
|
|
126557
|
+
}, delay));
|
|
126558
|
+
}
|
|
126559
|
+
/**
|
|
126560
|
+
* Updates all positions that are currently being tracked.
|
|
126561
|
+
*/
|
|
126562
|
+
function updateAllPos() {
|
|
126563
|
+
clearTimeout(debounces.get(root));
|
|
126564
|
+
debounces.set(root, setTimeout(() => {
|
|
126565
|
+
parents.forEach((parent) => forEach(parent, (el) => lowPriority(() => updatePos(el))));
|
|
126566
|
+
}, 100));
|
|
126567
|
+
}
|
|
126568
|
+
/**
|
|
126569
|
+
* Its possible for a quick scroll or other fast events to get past the
|
|
126570
|
+
* intersection observer, so occasionally we need want "cold-poll" for the
|
|
126571
|
+
* latests and greatest position. We try to do this in the most non-disruptive
|
|
126572
|
+
* fashion possible. First we only do this ever couple seconds, staggard by a
|
|
126573
|
+
* random offset.
|
|
126574
|
+
* @param el - Element
|
|
126575
|
+
*/
|
|
126576
|
+
function poll(el) {
|
|
126577
|
+
setTimeout(() => {
|
|
126578
|
+
intervals.set(el, setInterval(() => lowPriority(updatePos.bind(null, el)), 2e3));
|
|
126579
|
+
}, Math.round(2e3 * Math.random()));
|
|
126580
|
+
}
|
|
126581
|
+
/**
|
|
126582
|
+
* Perform some operation that is non critical at some point.
|
|
126583
|
+
* @param callback
|
|
126584
|
+
*/
|
|
126585
|
+
function lowPriority(callback) {
|
|
126586
|
+
if (typeof requestIdleCallback === "function") requestIdleCallback(() => callback());
|
|
126587
|
+
else requestAnimationFrame(() => callback());
|
|
126588
|
+
}
|
|
126589
|
+
/**
|
|
126590
|
+
* A resize observer, responsible for recalculating elements on resize.
|
|
126591
|
+
*/
|
|
126592
|
+
var resize;
|
|
126593
|
+
/**
|
|
126594
|
+
* Ensure the browser is supported.
|
|
126595
|
+
*/
|
|
126596
|
+
var supportedBrowser = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
126597
|
+
/**
|
|
126598
|
+
* If this is in a browser, initialize our Web APIs
|
|
126599
|
+
*/
|
|
126600
|
+
if (supportedBrowser) {
|
|
126601
|
+
root = document.documentElement;
|
|
126602
|
+
new MutationObserver(handleMutations);
|
|
126603
|
+
resize = new ResizeObserver(handleResizes);
|
|
126604
|
+
window.addEventListener("scroll", () => {
|
|
126605
|
+
scrollY = window.scrollY;
|
|
126606
|
+
scrollX = window.scrollX;
|
|
126607
|
+
});
|
|
126608
|
+
resize.observe(root);
|
|
126609
|
+
}
|
|
126610
|
+
/**
|
|
126611
|
+
* Retrieves all the elements that may have been affected by the last mutation
|
|
126612
|
+
* including ones that have been removed and are no longer in the DOM.
|
|
126613
|
+
* @param mutations - A mutation list.
|
|
126614
|
+
* @returns
|
|
126615
|
+
*/
|
|
126616
|
+
function getElements(mutations) {
|
|
126617
|
+
if (mutations.reduce((nodes, mutation) => {
|
|
126618
|
+
return [
|
|
126619
|
+
...nodes,
|
|
126620
|
+
...Array.from(mutation.addedNodes),
|
|
126621
|
+
...Array.from(mutation.removedNodes)
|
|
126622
|
+
];
|
|
126623
|
+
}, []).every((node) => node.nodeName === "#comment")) return false;
|
|
126624
|
+
return mutations.reduce((elements, mutation) => {
|
|
126625
|
+
if (elements === false) return false;
|
|
126626
|
+
if (mutation.target instanceof Element) {
|
|
126627
|
+
target(mutation.target);
|
|
126628
|
+
if (!elements.has(mutation.target)) {
|
|
126629
|
+
elements.add(mutation.target);
|
|
126630
|
+
for (let i = 0; i < mutation.target.children.length; i++) {
|
|
126631
|
+
const child = mutation.target.children.item(i);
|
|
126632
|
+
if (!child) continue;
|
|
126633
|
+
if (DEL in child) return false;
|
|
126634
|
+
target(mutation.target, child);
|
|
126635
|
+
elements.add(child);
|
|
126636
|
+
}
|
|
126637
|
+
}
|
|
126638
|
+
if (mutation.removedNodes.length) for (let i = 0; i < mutation.removedNodes.length; i++) {
|
|
126639
|
+
const child = mutation.removedNodes[i];
|
|
126640
|
+
if (DEL in child) return false;
|
|
126641
|
+
if (child instanceof Element) {
|
|
126642
|
+
elements.add(child);
|
|
126643
|
+
target(mutation.target, child);
|
|
126644
|
+
siblings.set(child, [mutation.previousSibling, mutation.nextSibling]);
|
|
126645
|
+
}
|
|
126646
|
+
}
|
|
126647
|
+
}
|
|
126648
|
+
return elements;
|
|
126649
|
+
}, /* @__PURE__ */ new Set());
|
|
126650
|
+
}
|
|
126651
|
+
/**
|
|
126652
|
+
* Assign the target to an element.
|
|
126653
|
+
* @param el - The root element
|
|
126654
|
+
* @param child
|
|
126655
|
+
*/
|
|
126656
|
+
function target(el, child) {
|
|
126657
|
+
if (!child && !(TGT in el)) Object.defineProperty(el, TGT, { value: el });
|
|
126658
|
+
else if (child && !(TGT in child)) Object.defineProperty(child, TGT, { value: el });
|
|
126659
|
+
}
|
|
126660
|
+
/**
|
|
126661
|
+
* Determines what kind of change took place on the given element and then
|
|
126662
|
+
* performs the proper animation based on that.
|
|
126663
|
+
* @param el - The specific element to animate.
|
|
126664
|
+
*/
|
|
126665
|
+
function animate(el) {
|
|
126666
|
+
var _a, _b;
|
|
126667
|
+
const isMounted = el.isConnected;
|
|
126668
|
+
const preExisting = coords.has(el);
|
|
126669
|
+
if (isMounted && siblings.has(el)) siblings.delete(el);
|
|
126670
|
+
if (((_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.playState) !== "finished") (_b = animations.get(el)) === null || _b === void 0 || _b.cancel();
|
|
126671
|
+
if (NEW in el) add(el);
|
|
126672
|
+
else if (preExisting && isMounted) remain(el);
|
|
126673
|
+
else if (preExisting && !isMounted) remove(el);
|
|
126674
|
+
else add(el);
|
|
126675
|
+
}
|
|
126676
|
+
/**
|
|
126677
|
+
* Removes all non-digits from a string and casts to a number.
|
|
126678
|
+
* @param str - A string containing a pixel value.
|
|
126679
|
+
* @returns
|
|
126680
|
+
*/
|
|
126681
|
+
function raw(str) {
|
|
126682
|
+
return Number(str.replace(/[^0-9.\-]/g, ""));
|
|
126683
|
+
}
|
|
126684
|
+
/**
|
|
126685
|
+
* Get the scroll offset of elements
|
|
126686
|
+
* @param el - Element
|
|
126687
|
+
* @returns
|
|
126688
|
+
*/
|
|
126689
|
+
function getScrollOffset(el) {
|
|
126690
|
+
let p = el.parentElement;
|
|
126691
|
+
while (p) {
|
|
126692
|
+
if (p.scrollLeft || p.scrollTop) return {
|
|
126693
|
+
x: p.scrollLeft,
|
|
126694
|
+
y: p.scrollTop
|
|
126695
|
+
};
|
|
126696
|
+
p = p.parentElement;
|
|
126697
|
+
}
|
|
126698
|
+
return {
|
|
126699
|
+
x: 0,
|
|
126700
|
+
y: 0
|
|
126701
|
+
};
|
|
126702
|
+
}
|
|
126703
|
+
/**
|
|
126704
|
+
* Get the coordinates of elements adjusted for scroll position.
|
|
126705
|
+
* @param el - Element
|
|
126706
|
+
* @returns
|
|
126707
|
+
*/
|
|
126708
|
+
function getCoords(el) {
|
|
126709
|
+
const rect = el.getBoundingClientRect();
|
|
126710
|
+
const { x, y } = getScrollOffset(el);
|
|
126711
|
+
return {
|
|
126712
|
+
top: rect.top + y,
|
|
126713
|
+
left: rect.left + x,
|
|
126714
|
+
width: rect.width,
|
|
126715
|
+
height: rect.height
|
|
126716
|
+
};
|
|
126717
|
+
}
|
|
126718
|
+
/**
|
|
126719
|
+
* Returns the width/height that the element should be transitioned between.
|
|
126720
|
+
* This takes into account box-sizing.
|
|
126721
|
+
* @param el - Element being animated
|
|
126722
|
+
* @param oldCoords - Old set of Coordinates coordinates
|
|
126723
|
+
* @param newCoords - New set of Coordinates coordinates
|
|
126724
|
+
* @returns
|
|
126725
|
+
*/
|
|
126726
|
+
function getTransitionSizes(el, oldCoords, newCoords) {
|
|
126727
|
+
let widthFrom = oldCoords.width;
|
|
126728
|
+
let heightFrom = oldCoords.height;
|
|
126729
|
+
let widthTo = newCoords.width;
|
|
126730
|
+
let heightTo = newCoords.height;
|
|
126731
|
+
const styles = getComputedStyle(el);
|
|
126732
|
+
if (styles.getPropertyValue("box-sizing") === "content-box") {
|
|
126733
|
+
const paddingY = raw(styles.paddingTop) + raw(styles.paddingBottom) + raw(styles.borderTopWidth) + raw(styles.borderBottomWidth);
|
|
126734
|
+
const paddingX = raw(styles.paddingLeft) + raw(styles.paddingRight) + raw(styles.borderRightWidth) + raw(styles.borderLeftWidth);
|
|
126735
|
+
widthFrom -= paddingX;
|
|
126736
|
+
widthTo -= paddingX;
|
|
126737
|
+
heightFrom -= paddingY;
|
|
126738
|
+
heightTo -= paddingY;
|
|
126739
|
+
}
|
|
126740
|
+
return [
|
|
126741
|
+
widthFrom,
|
|
126742
|
+
widthTo,
|
|
126743
|
+
heightFrom,
|
|
126744
|
+
heightTo
|
|
126745
|
+
].map(Math.round);
|
|
126746
|
+
}
|
|
126747
|
+
/**
|
|
126748
|
+
* Retrieves animation options for the current element.
|
|
126749
|
+
* @param el - Element to retrieve options for.
|
|
126750
|
+
* @returns
|
|
126751
|
+
*/
|
|
126752
|
+
function getOptions(el) {
|
|
126753
|
+
return TGT in el && options.has(el[TGT]) ? options.get(el[TGT]) : {
|
|
126754
|
+
duration: 250,
|
|
126755
|
+
easing: "ease-in-out"
|
|
126756
|
+
};
|
|
126757
|
+
}
|
|
126758
|
+
/**
|
|
126759
|
+
* Returns the target of a given animation (generally the parent).
|
|
126760
|
+
* @param el - An element to check for a target
|
|
126761
|
+
* @returns
|
|
126762
|
+
*/
|
|
126763
|
+
function getTarget(el) {
|
|
126764
|
+
if (TGT in el) return el[TGT];
|
|
126765
|
+
}
|
|
126766
|
+
/**
|
|
126767
|
+
* Checks if animations are enabled or disabled for a given element.
|
|
126768
|
+
* @param el - Any element
|
|
126769
|
+
* @returns
|
|
126770
|
+
*/
|
|
126771
|
+
function isEnabled(el) {
|
|
126772
|
+
const target = getTarget(el);
|
|
126773
|
+
return target ? enabled.has(target) : false;
|
|
126774
|
+
}
|
|
126775
|
+
/**
|
|
126776
|
+
* Iterate over the children of a given parent.
|
|
126777
|
+
* @param parent - A parent element
|
|
126778
|
+
* @param callback - A callback
|
|
126779
|
+
*/
|
|
126780
|
+
function forEach(parent, ...callbacks) {
|
|
126781
|
+
callbacks.forEach((callback) => callback(parent, options.has(parent)));
|
|
126782
|
+
for (let i = 0; i < parent.children.length; i++) {
|
|
126783
|
+
const child = parent.children.item(i);
|
|
126784
|
+
if (child) callbacks.forEach((callback) => callback(child, options.has(child)));
|
|
126785
|
+
}
|
|
126786
|
+
}
|
|
126787
|
+
/**
|
|
126788
|
+
* Always return tuple to provide consistent interface
|
|
126789
|
+
*/
|
|
126790
|
+
function getPluginTuple(pluginReturn) {
|
|
126791
|
+
if (Array.isArray(pluginReturn)) return pluginReturn;
|
|
126792
|
+
return [pluginReturn];
|
|
126793
|
+
}
|
|
126794
|
+
/**
|
|
126795
|
+
* Determine if config is plugin
|
|
126796
|
+
*/
|
|
126797
|
+
function isPlugin(config) {
|
|
126798
|
+
return typeof config === "function";
|
|
126799
|
+
}
|
|
126800
|
+
/**
|
|
126801
|
+
* The element in question is remaining in the DOM.
|
|
126802
|
+
* @param el - Element to flip
|
|
126803
|
+
* @returns
|
|
126804
|
+
*/
|
|
126805
|
+
function remain(el) {
|
|
126806
|
+
const oldCoords = coords.get(el);
|
|
126807
|
+
const newCoords = getCoords(el);
|
|
126808
|
+
if (!isEnabled(el)) return coords.set(el, newCoords);
|
|
126809
|
+
if (isOffscreen(el)) {
|
|
126810
|
+
coords.set(el, newCoords);
|
|
126811
|
+
observePosition(el);
|
|
126812
|
+
return;
|
|
126813
|
+
}
|
|
126814
|
+
let animation;
|
|
126815
|
+
if (!oldCoords) return;
|
|
126816
|
+
const pluginOrOptions = getOptions(el);
|
|
126817
|
+
if (typeof pluginOrOptions !== "function") {
|
|
126818
|
+
let deltaLeft = oldCoords.left - newCoords.left;
|
|
126819
|
+
let deltaTop = oldCoords.top - newCoords.top;
|
|
126820
|
+
const deltaRight = oldCoords.left + oldCoords.width - (newCoords.left + newCoords.width);
|
|
126821
|
+
if (oldCoords.top + oldCoords.height - (newCoords.top + newCoords.height) == 0) deltaTop = 0;
|
|
126822
|
+
if (deltaRight == 0) deltaLeft = 0;
|
|
126823
|
+
const [widthFrom, widthTo, heightFrom, heightTo] = getTransitionSizes(el, oldCoords, newCoords);
|
|
126824
|
+
const start = { transform: `translate(${deltaLeft}px, ${deltaTop}px)` };
|
|
126825
|
+
const end = { transform: `translate(0, 0)` };
|
|
126826
|
+
if (widthFrom !== widthTo) {
|
|
126827
|
+
start.width = `${widthFrom}px`;
|
|
126828
|
+
end.width = `${widthTo}px`;
|
|
126829
|
+
}
|
|
126830
|
+
if (heightFrom !== heightTo) {
|
|
126831
|
+
start.height = `${heightFrom}px`;
|
|
126832
|
+
end.height = `${heightTo}px`;
|
|
126833
|
+
}
|
|
126834
|
+
animation = el.animate([start, end], {
|
|
126835
|
+
duration: pluginOrOptions.duration,
|
|
126836
|
+
easing: pluginOrOptions.easing
|
|
126837
|
+
});
|
|
126838
|
+
} else {
|
|
126839
|
+
const [keyframes] = getPluginTuple(pluginOrOptions(el, "remain", oldCoords, newCoords));
|
|
126840
|
+
animation = new Animation(keyframes);
|
|
126841
|
+
animation.play();
|
|
126842
|
+
}
|
|
126843
|
+
animations.set(el, animation);
|
|
126844
|
+
coords.set(el, newCoords);
|
|
126845
|
+
animation.addEventListener("finish", updatePos.bind(null, el, false), { once: true });
|
|
126846
|
+
}
|
|
126847
|
+
/**
|
|
126848
|
+
* Adds the element with a transition.
|
|
126849
|
+
* @param el - Animates the element being added.
|
|
126850
|
+
*/
|
|
126851
|
+
function add(el) {
|
|
126852
|
+
if (NEW in el) delete el[NEW];
|
|
126853
|
+
const newCoords = getCoords(el);
|
|
126854
|
+
coords.set(el, newCoords);
|
|
126855
|
+
const pluginOrOptions = getOptions(el);
|
|
126856
|
+
if (!isEnabled(el)) return;
|
|
126857
|
+
if (isOffscreen(el)) {
|
|
126858
|
+
observePosition(el);
|
|
126859
|
+
return;
|
|
126860
|
+
}
|
|
126861
|
+
let animation;
|
|
126862
|
+
if (typeof pluginOrOptions !== "function") animation = el.animate([
|
|
126863
|
+
{
|
|
126864
|
+
transform: "scale(.98)",
|
|
126865
|
+
opacity: 0
|
|
126866
|
+
},
|
|
126867
|
+
{
|
|
126868
|
+
transform: "scale(0.98)",
|
|
126869
|
+
opacity: 0,
|
|
126870
|
+
offset: .5
|
|
126871
|
+
},
|
|
126872
|
+
{
|
|
126873
|
+
transform: "scale(1)",
|
|
126874
|
+
opacity: 1
|
|
126875
|
+
}
|
|
126876
|
+
], {
|
|
126877
|
+
duration: pluginOrOptions.duration * 1.5,
|
|
126878
|
+
easing: "ease-in"
|
|
126879
|
+
});
|
|
126880
|
+
else {
|
|
126881
|
+
const [keyframes] = getPluginTuple(pluginOrOptions(el, "add", newCoords));
|
|
126882
|
+
animation = new Animation(keyframes);
|
|
126883
|
+
animation.play();
|
|
126884
|
+
}
|
|
126885
|
+
animations.set(el, animation);
|
|
126886
|
+
animation.addEventListener("finish", updatePos.bind(null, el, false), { once: true });
|
|
126887
|
+
}
|
|
126888
|
+
/**
|
|
126889
|
+
* Clean up after removing an element from the dom.
|
|
126890
|
+
* @param el - Element being removed
|
|
126891
|
+
* @param styles - Optional styles that should be removed from the element.
|
|
126892
|
+
*/
|
|
126893
|
+
function cleanUp(el, styles) {
|
|
126894
|
+
var _a;
|
|
126895
|
+
el.remove();
|
|
126896
|
+
coords.delete(el);
|
|
126897
|
+
siblings.delete(el);
|
|
126898
|
+
animations.delete(el);
|
|
126899
|
+
(_a = intersections.get(el)) === null || _a === void 0 || _a.disconnect();
|
|
126900
|
+
setTimeout(() => {
|
|
126901
|
+
if (DEL in el) delete el[DEL];
|
|
126902
|
+
Object.defineProperty(el, NEW, {
|
|
126903
|
+
value: true,
|
|
126904
|
+
configurable: true
|
|
126905
|
+
});
|
|
126906
|
+
if (styles && el instanceof HTMLElement) for (const style in styles) el.style[style] = "";
|
|
126907
|
+
}, 0);
|
|
126908
|
+
}
|
|
126909
|
+
/**
|
|
126910
|
+
* Animates the removal of an element.
|
|
126911
|
+
* @param el - Element to remove
|
|
126912
|
+
*/
|
|
126913
|
+
function remove(el) {
|
|
126914
|
+
var _a;
|
|
126915
|
+
if (!siblings.has(el) || !coords.has(el)) return;
|
|
126916
|
+
const [prev, next] = siblings.get(el);
|
|
126917
|
+
Object.defineProperty(el, DEL, {
|
|
126918
|
+
value: true,
|
|
126919
|
+
configurable: true
|
|
126920
|
+
});
|
|
126921
|
+
const finalX = window.scrollX;
|
|
126922
|
+
const finalY = window.scrollY;
|
|
126923
|
+
if (next && next.parentNode && next.parentNode instanceof Element) next.parentNode.insertBefore(el, next);
|
|
126924
|
+
else if (prev && prev.parentNode) prev.parentNode.appendChild(el);
|
|
126925
|
+
else (_a = getTarget(el)) === null || _a === void 0 || _a.appendChild(el);
|
|
126926
|
+
if (!isEnabled(el)) return cleanUp(el);
|
|
126927
|
+
const [top, left, width, height] = deletePosition(el);
|
|
126928
|
+
const optionsOrPlugin = getOptions(el);
|
|
126929
|
+
const oldCoords = coords.get(el);
|
|
126930
|
+
if (finalX !== scrollX || finalY !== scrollY) adjustScroll(el, finalX, finalY, optionsOrPlugin);
|
|
126931
|
+
let animation;
|
|
126932
|
+
let styleReset = {
|
|
126933
|
+
position: "absolute",
|
|
126934
|
+
top: `${top}px`,
|
|
126935
|
+
left: `${left}px`,
|
|
126936
|
+
width: `${width}px`,
|
|
126937
|
+
height: `${height}px`,
|
|
126938
|
+
margin: "0",
|
|
126939
|
+
pointerEvents: "none",
|
|
126940
|
+
transformOrigin: "center",
|
|
126941
|
+
zIndex: "100"
|
|
126942
|
+
};
|
|
126943
|
+
if (!isPlugin(optionsOrPlugin)) {
|
|
126944
|
+
Object.assign(el.style, styleReset);
|
|
126945
|
+
animation = el.animate([{
|
|
126946
|
+
transform: "scale(1)",
|
|
126947
|
+
opacity: 1
|
|
126948
|
+
}, {
|
|
126949
|
+
transform: "scale(.98)",
|
|
126950
|
+
opacity: 0
|
|
126951
|
+
}], {
|
|
126952
|
+
duration: optionsOrPlugin.duration,
|
|
126953
|
+
easing: "ease-out"
|
|
126954
|
+
});
|
|
126955
|
+
} else {
|
|
126956
|
+
const [keyframes, options] = getPluginTuple(optionsOrPlugin(el, "remove", oldCoords));
|
|
126957
|
+
if ((options === null || options === void 0 ? void 0 : options.styleReset) !== false) {
|
|
126958
|
+
styleReset = (options === null || options === void 0 ? void 0 : options.styleReset) || styleReset;
|
|
126959
|
+
Object.assign(el.style, styleReset);
|
|
126960
|
+
}
|
|
126961
|
+
animation = new Animation(keyframes);
|
|
126962
|
+
animation.play();
|
|
126963
|
+
}
|
|
126964
|
+
animations.set(el, animation);
|
|
126965
|
+
animation.addEventListener("finish", () => cleanUp(el, styleReset), { once: true });
|
|
126966
|
+
}
|
|
126967
|
+
/**
|
|
126968
|
+
* If the element being removed is at the very bottom of the page, and the
|
|
126969
|
+
* the page was scrolled into a space being "made available" by the element
|
|
126970
|
+
* that was removed, the page scroll will have jumped up some amount. We need
|
|
126971
|
+
* to offset the jump by the amount that the page was "automatically" scrolled
|
|
126972
|
+
* up. We can do this by comparing the scroll position before and after the
|
|
126973
|
+
* element was removed, and then offsetting by that amount.
|
|
126974
|
+
*
|
|
126975
|
+
* @param el - The element being deleted
|
|
126976
|
+
* @param finalX - The final X scroll position
|
|
126977
|
+
* @param finalY - The final Y scroll position
|
|
126978
|
+
* @param optionsOrPlugin - The options or plugin
|
|
126979
|
+
* @returns
|
|
126980
|
+
*/
|
|
126981
|
+
function adjustScroll(el, finalX, finalY, optionsOrPlugin) {
|
|
126982
|
+
const scrollDeltaX = scrollX - finalX;
|
|
126983
|
+
const scrollDeltaY = scrollY - finalY;
|
|
126984
|
+
const scrollBefore = document.documentElement.style.scrollBehavior;
|
|
126985
|
+
if (getComputedStyle(root).scrollBehavior === "smooth") document.documentElement.style.scrollBehavior = "auto";
|
|
126986
|
+
window.scrollTo(window.scrollX + scrollDeltaX, window.scrollY + scrollDeltaY);
|
|
126987
|
+
if (!el.parentElement) return;
|
|
126988
|
+
const parent = el.parentElement;
|
|
126989
|
+
let lastHeight = parent.clientHeight;
|
|
126990
|
+
let lastWidth = parent.clientWidth;
|
|
126991
|
+
const startScroll = performance.now();
|
|
126992
|
+
function smoothScroll() {
|
|
126993
|
+
requestAnimationFrame(() => {
|
|
126994
|
+
if (!isPlugin(optionsOrPlugin)) {
|
|
126995
|
+
const deltaY = lastHeight - parent.clientHeight;
|
|
126996
|
+
const deltaX = lastWidth - parent.clientWidth;
|
|
126997
|
+
if (startScroll + optionsOrPlugin.duration > performance.now()) {
|
|
126998
|
+
window.scrollTo({
|
|
126999
|
+
left: window.scrollX - deltaX,
|
|
127000
|
+
top: window.scrollY - deltaY
|
|
127001
|
+
});
|
|
127002
|
+
lastHeight = parent.clientHeight;
|
|
127003
|
+
lastWidth = parent.clientWidth;
|
|
127004
|
+
smoothScroll();
|
|
127005
|
+
} else document.documentElement.style.scrollBehavior = scrollBefore;
|
|
127006
|
+
}
|
|
127007
|
+
});
|
|
127008
|
+
}
|
|
127009
|
+
smoothScroll();
|
|
127010
|
+
}
|
|
127011
|
+
/**
|
|
127012
|
+
* Determines the position of the element being removed.
|
|
127013
|
+
* @param el - The element being deleted
|
|
127014
|
+
* @returns
|
|
127015
|
+
*/
|
|
127016
|
+
function deletePosition(el) {
|
|
127017
|
+
var _a;
|
|
127018
|
+
const oldCoords = coords.get(el);
|
|
127019
|
+
const [width, , height] = getTransitionSizes(el, oldCoords, getCoords(el));
|
|
127020
|
+
let offsetParent = el.parentElement;
|
|
127021
|
+
while (offsetParent && (getComputedStyle(offsetParent).position === "static" || offsetParent instanceof HTMLBodyElement)) offsetParent = offsetParent.parentElement;
|
|
127022
|
+
if (!offsetParent) offsetParent = document.body;
|
|
127023
|
+
const parentStyles = getComputedStyle(offsetParent);
|
|
127024
|
+
const parentCoords = !animations.has(el) || ((_a = animations.get(el)) === null || _a === void 0 ? void 0 : _a.playState) === "finished" ? getCoords(offsetParent) : coords.get(offsetParent);
|
|
127025
|
+
return [
|
|
127026
|
+
Math.round(oldCoords.top - parentCoords.top) - raw(parentStyles.borderTopWidth),
|
|
127027
|
+
Math.round(oldCoords.left - parentCoords.left) - raw(parentStyles.borderLeftWidth),
|
|
127028
|
+
width,
|
|
127029
|
+
height
|
|
127030
|
+
];
|
|
127031
|
+
}
|
|
127032
|
+
/**
|
|
127033
|
+
* A function that automatically adds animation effects to itself and its
|
|
127034
|
+
* immediate children. Specifically it adds effects for adding, moving, and
|
|
127035
|
+
* removing DOM elements.
|
|
127036
|
+
* @param el - A parent element to add animations to.
|
|
127037
|
+
* @param options - An optional object of options.
|
|
127038
|
+
*/
|
|
127039
|
+
function autoAnimate(el, config = {}) {
|
|
127040
|
+
if (supportedBrowser && resize) {
|
|
127041
|
+
if (!(window.matchMedia("(prefers-reduced-motion: reduce)").matches && !isPlugin(config) && !config.disrespectUserMotionPreference)) {
|
|
127042
|
+
enabled.add(el);
|
|
127043
|
+
if (getComputedStyle(el).position === "static") Object.assign(el.style, { position: "relative" });
|
|
127044
|
+
forEach(el, updatePos, poll, (element) => resize === null || resize === void 0 ? void 0 : resize.observe(element));
|
|
127045
|
+
if (isPlugin(config)) options.set(el, config);
|
|
127046
|
+
else options.set(el, {
|
|
127047
|
+
duration: 250,
|
|
127048
|
+
easing: "ease-in-out",
|
|
127049
|
+
...config
|
|
127050
|
+
});
|
|
127051
|
+
const mo = new MutationObserver(handleMutations);
|
|
127052
|
+
mo.observe(el, { childList: true });
|
|
127053
|
+
mutationObservers.set(el, mo);
|
|
127054
|
+
parents.add(el);
|
|
127055
|
+
}
|
|
127056
|
+
}
|
|
127057
|
+
return Object.freeze({
|
|
127058
|
+
parent: el,
|
|
127059
|
+
enable: () => {
|
|
127060
|
+
enabled.add(el);
|
|
127061
|
+
},
|
|
127062
|
+
disable: () => {
|
|
127063
|
+
enabled.delete(el);
|
|
127064
|
+
forEach(el, (node) => {
|
|
127065
|
+
const a = animations.get(node);
|
|
127066
|
+
try {
|
|
127067
|
+
a === null || a === void 0 || a.cancel();
|
|
127068
|
+
} catch {}
|
|
127069
|
+
animations.delete(node);
|
|
127070
|
+
const d = debounces.get(node);
|
|
127071
|
+
if (d) clearTimeout(d);
|
|
127072
|
+
debounces.delete(node);
|
|
127073
|
+
const i = intervals.get(node);
|
|
127074
|
+
if (i) clearInterval(i);
|
|
127075
|
+
intervals.delete(node);
|
|
127076
|
+
});
|
|
127077
|
+
},
|
|
127078
|
+
isEnabled: () => enabled.has(el),
|
|
127079
|
+
destroy: () => {
|
|
127080
|
+
enabled.delete(el);
|
|
127081
|
+
parents.delete(el);
|
|
127082
|
+
options.delete(el);
|
|
127083
|
+
const mo = mutationObservers.get(el);
|
|
127084
|
+
mo === null || mo === void 0 || mo.disconnect();
|
|
127085
|
+
mutationObservers.delete(el);
|
|
127086
|
+
forEach(el, (node) => {
|
|
127087
|
+
resize === null || resize === void 0 || resize.unobserve(node);
|
|
127088
|
+
const a = animations.get(node);
|
|
127089
|
+
try {
|
|
127090
|
+
a === null || a === void 0 || a.cancel();
|
|
127091
|
+
} catch {}
|
|
127092
|
+
animations.delete(node);
|
|
127093
|
+
const io = intersections.get(node);
|
|
127094
|
+
io === null || io === void 0 || io.disconnect();
|
|
127095
|
+
intersections.delete(node);
|
|
127096
|
+
const i = intervals.get(node);
|
|
127097
|
+
if (i) clearInterval(i);
|
|
127098
|
+
intervals.delete(node);
|
|
127099
|
+
const d = debounces.get(node);
|
|
127100
|
+
if (d) clearTimeout(d);
|
|
127101
|
+
debounces.delete(node);
|
|
127102
|
+
coords.delete(node);
|
|
127103
|
+
siblings.delete(node);
|
|
127104
|
+
});
|
|
127105
|
+
}
|
|
127106
|
+
});
|
|
127107
|
+
}
|
|
127108
|
+
//#endregion
|
|
127109
|
+
//#region node_modules/@formkit/auto-animate/vue/index.mjs
|
|
127110
|
+
/**
|
|
127111
|
+
* AutoAnimate hook for adding dead-simple transitions and animations to Vue.
|
|
127112
|
+
* @param options - Auto animate options or a plugin
|
|
127113
|
+
* @returns A template ref. Use the `ref` attribute of your parent element
|
|
127114
|
+
* to store the element in this template ref.
|
|
127115
|
+
*/
|
|
127116
|
+
function useAutoAnimate(options) {
|
|
127117
|
+
const element = ref();
|
|
127118
|
+
let controller;
|
|
127119
|
+
function setEnabled(enabled) {
|
|
127120
|
+
if (controller) enabled ? controller.enable() : controller.disable();
|
|
127121
|
+
}
|
|
127122
|
+
onMounted(() => {
|
|
127123
|
+
watchEffect((onCleanup) => {
|
|
127124
|
+
let el;
|
|
127125
|
+
if (element.value instanceof HTMLElement) el = element.value;
|
|
127126
|
+
else if (element.value && "$el" in element.value && element.value.$el instanceof HTMLElement) el = element.value.$el;
|
|
127127
|
+
if (el) {
|
|
127128
|
+
controller = autoAnimate(el, options || {});
|
|
127129
|
+
onCleanup(() => {
|
|
127130
|
+
var _a;
|
|
127131
|
+
(_a = controller === null || controller === void 0 ? void 0 : controller.destroy) === null || _a === void 0 || _a.call(controller);
|
|
127132
|
+
controller = void 0;
|
|
127133
|
+
});
|
|
127134
|
+
}
|
|
127135
|
+
});
|
|
127136
|
+
});
|
|
127137
|
+
onBeforeUnmount(() => {
|
|
127138
|
+
var _a;
|
|
127139
|
+
(_a = controller === null || controller === void 0 ? void 0 : controller.destroy) === null || _a === void 0 || _a.call(controller);
|
|
127140
|
+
controller = void 0;
|
|
127141
|
+
});
|
|
127142
|
+
return [element, setEnabled];
|
|
127143
|
+
}
|
|
127144
|
+
//#endregion
|
|
126411
127145
|
//#region src/components/small/app-card-grid/AppBoard.vue
|
|
126412
127146
|
var _hoisted_1$1 = { key: 0 };
|
|
126413
127147
|
var _sfc_main$1 = {
|
|
@@ -126425,6 +127159,10 @@ var _sfc_main$1 = {
|
|
|
126425
127159
|
disabled: {
|
|
126426
127160
|
default: false,
|
|
126427
127161
|
type: Boolean
|
|
127162
|
+
},
|
|
127163
|
+
isAnimated: {
|
|
127164
|
+
default: false,
|
|
127165
|
+
type: Boolean
|
|
126428
127166
|
}
|
|
126429
127167
|
}, {
|
|
126430
127168
|
"modelValue": {},
|
|
@@ -126441,6 +127179,7 @@ var _sfc_main$1 = {
|
|
|
126441
127179
|
return props.isMultiSelect ? value : (0, import_lodash.head)(value);
|
|
126442
127180
|
}
|
|
126443
127181
|
});
|
|
127182
|
+
const [parent, enableAnimation] = useAutoAnimate();
|
|
126444
127183
|
const isSelected = (item) => {
|
|
126445
127184
|
return modelValue.value.some((selectedItem) => (0, import_lodash.isEqual)(selectedItem, item));
|
|
126446
127185
|
};
|
|
@@ -126449,18 +127188,26 @@ var _sfc_main$1 = {
|
|
|
126449
127188
|
newValue = props.isMultiSelect ? newValue : [(0, import_lodash.last)(newValue)];
|
|
126450
127189
|
modelValue.value = newValue;
|
|
126451
127190
|
};
|
|
126452
|
-
const boardStyle = computed(() => ({
|
|
127191
|
+
const boardStyle = computed(() => ({
|
|
127192
|
+
gridTemplateColumns: `repeat(auto-fill, ${props.cellWidth}px)`,
|
|
127193
|
+
minHeight: "200px"
|
|
127194
|
+
}));
|
|
126453
127195
|
const computedClass = computed(() => {
|
|
126454
127196
|
return { "disabled-element": props.disabled };
|
|
126455
127197
|
});
|
|
126456
127198
|
const getCellClass = (item) => {
|
|
126457
127199
|
return { selected: isSelected(item) };
|
|
126458
127200
|
};
|
|
127201
|
+
onMounted(() => {
|
|
127202
|
+
enableAnimation(props.isAnimated);
|
|
127203
|
+
});
|
|
126459
127204
|
return (_ctx, _cache) => {
|
|
126460
127205
|
return openBlock(), createElementBlock("div", {
|
|
126461
127206
|
style: { "min-height": "100px" },
|
|
126462
127207
|
class: normalizeClass(computedClass.value)
|
|
126463
127208
|
}, [_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$1, [renderSlot(_ctx.$slots, "header")])) : createCommentVNode("", true), createElementVNode("div", {
|
|
127209
|
+
ref_key: "parent",
|
|
127210
|
+
ref: parent,
|
|
126464
127211
|
class: "app-board",
|
|
126465
127212
|
style: normalizeStyle(boardStyle.value)
|
|
126466
127213
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item, index) => {
|