x-runtime-lib 0.8.166 → 0.8.167
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.js +34 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -424,25 +424,46 @@ function yt(t, n, e) {
|
|
|
424
424
|
o.eventBus.off(i, e);
|
|
425
425
|
}));
|
|
426
426
|
}
|
|
427
|
-
const Qo = (t, n, e, o) => {
|
|
427
|
+
const Qo = async (t, n, e, o) => {
|
|
428
428
|
let i;
|
|
429
|
-
if (t
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
429
|
+
if (t)
|
|
430
|
+
try {
|
|
431
|
+
i = await t.getElementProperty(n.basic.id, e);
|
|
432
|
+
} catch (r) {
|
|
433
|
+
console.error("getProperty get element property failed", r);
|
|
434
|
+
}
|
|
435
|
+
else
|
|
436
|
+
i = ze(n, e);
|
|
437
|
+
if (o)
|
|
438
|
+
if (typeof i == "string") {
|
|
439
|
+
let r;
|
|
440
|
+
try {
|
|
441
|
+
r = JSON.parse(i);
|
|
442
|
+
} catch (l) {
|
|
443
|
+
console.error("getProperty JSON.parse failed", l);
|
|
444
|
+
}
|
|
445
|
+
return r ?? {};
|
|
446
|
+
} else
|
|
447
|
+
return console.error("getProperty unexpected type"), {};
|
|
448
|
+
else
|
|
435
449
|
return i;
|
|
436
|
-
}, es = (t, n, e, o, i) => {
|
|
450
|
+
}, es = async (t, n, e, o, i) => {
|
|
437
451
|
let r;
|
|
438
|
-
i ? typeof o == "object" ? r = JSON.stringify(o, null, 2) : (console.
|
|
452
|
+
if (i ? typeof o == "object" ? r = JSON.stringify(o, null, 2) : (console.error("setProperty unexpected type"), r = "{}") : r = o, t)
|
|
453
|
+
try {
|
|
454
|
+
await t.setElementProperty(n.basic.id, e, r);
|
|
455
|
+
} catch (l) {
|
|
456
|
+
console.error("setProperty set element property failed", l);
|
|
457
|
+
}
|
|
458
|
+
else
|
|
459
|
+
yn(n, e, r);
|
|
439
460
|
};
|
|
440
461
|
function a(t, n, e) {
|
|
441
462
|
const o = oe(), i = te();
|
|
442
|
-
return Ve(() => {
|
|
443
|
-
i.value = Qo(o, t.value, n, e);
|
|
444
|
-
}), ue(i, (r, l) => {
|
|
445
|
-
ye(r, l) || es(o, t.value, n, i.value, e);
|
|
463
|
+
return Ve(async () => {
|
|
464
|
+
i.value = await Qo(o, t.value, n, e);
|
|
465
|
+
}), ue(i, async (r, l) => {
|
|
466
|
+
ye(r, l) || await es(o, t.value, n, i.value, e);
|
|
446
467
|
}), { property: i };
|
|
447
468
|
}
|
|
448
469
|
function be(t, n, e) {
|