@opentiny/tiny-robot 0.2.0-alpha.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/close.js +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index2.js +37 -37
- package/dist/index3.js +3717 -129
- package/dist/index4.js +7 -7
- package/dist/index5.js +2011 -931
- package/dist/index6.js +875 -1001
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/close.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -394,20 +394,20 @@ disabled: boolean;
|
|
|
394
394
|
type: string;
|
|
395
395
|
ellipsis: boolean;
|
|
396
396
|
mask: boolean;
|
|
397
|
-
vertical: boolean;
|
|
398
|
-
customClass: string;
|
|
399
397
|
tiny_mode_root: boolean;
|
|
400
398
|
_constants: Record<string, any>;
|
|
401
399
|
tabindex: string;
|
|
400
|
+
contentStyle: Record<string, any>;
|
|
401
|
+
customClass: string;
|
|
402
402
|
showTitle: boolean;
|
|
403
403
|
readonly: boolean;
|
|
404
404
|
hoverExpand: boolean;
|
|
405
405
|
memorySpace: number;
|
|
406
|
+
vertical: boolean;
|
|
406
407
|
selectMenu: {
|
|
407
408
|
id: string;
|
|
408
409
|
label: string;
|
|
409
410
|
}[];
|
|
410
|
-
contentStyle: Record<string, any>;
|
|
411
411
|
isSelect: boolean;
|
|
412
412
|
counter: boolean;
|
|
413
413
|
autosize: boolean | Record<string, any>;
|
|
@@ -621,20 +621,20 @@ disabled: boolean;
|
|
|
621
621
|
type: string;
|
|
622
622
|
ellipsis: boolean;
|
|
623
623
|
mask: boolean;
|
|
624
|
-
vertical: boolean;
|
|
625
|
-
customClass: string;
|
|
626
624
|
tiny_mode_root: boolean;
|
|
627
625
|
_constants: Record<string, any>;
|
|
628
626
|
tabindex: string;
|
|
627
|
+
contentStyle: Record<string, any>;
|
|
628
|
+
customClass: string;
|
|
629
629
|
showTitle: boolean;
|
|
630
630
|
readonly: boolean;
|
|
631
631
|
hoverExpand: boolean;
|
|
632
632
|
memorySpace: number;
|
|
633
|
+
vertical: boolean;
|
|
633
634
|
selectMenu: {
|
|
634
635
|
id: string;
|
|
635
636
|
label: string;
|
|
636
637
|
}[];
|
|
637
|
-
contentStyle: Record<string, any>;
|
|
638
638
|
isSelect: boolean;
|
|
639
639
|
counter: boolean;
|
|
640
640
|
autosize: boolean | Record<string, any>;
|
|
@@ -1176,20 +1176,20 @@ declare function __VLS_template_5(): {
|
|
|
1176
1176
|
type: string;
|
|
1177
1177
|
ellipsis: boolean;
|
|
1178
1178
|
mask: boolean;
|
|
1179
|
-
vertical: boolean;
|
|
1180
|
-
customClass: string;
|
|
1181
1179
|
tiny_mode_root: boolean;
|
|
1182
1180
|
_constants: Record<string, any>;
|
|
1183
1181
|
tabindex: string;
|
|
1182
|
+
contentStyle: Record<string, any>;
|
|
1183
|
+
customClass: string;
|
|
1184
1184
|
showTitle: boolean;
|
|
1185
1185
|
readonly: boolean;
|
|
1186
1186
|
hoverExpand: boolean;
|
|
1187
1187
|
memorySpace: number;
|
|
1188
|
+
vertical: boolean;
|
|
1188
1189
|
selectMenu: {
|
|
1189
1190
|
id: string;
|
|
1190
1191
|
label: string;
|
|
1191
1192
|
}[];
|
|
1192
|
-
contentStyle: Record<string, any>;
|
|
1193
1193
|
isSelect: boolean;
|
|
1194
1194
|
counter: boolean;
|
|
1195
1195
|
autosize: boolean | Record<string, any>;
|
|
@@ -1403,20 +1403,20 @@ declare function __VLS_template_5(): {
|
|
|
1403
1403
|
type: string;
|
|
1404
1404
|
ellipsis: boolean;
|
|
1405
1405
|
mask: boolean;
|
|
1406
|
-
vertical: boolean;
|
|
1407
|
-
customClass: string;
|
|
1408
1406
|
tiny_mode_root: boolean;
|
|
1409
1407
|
_constants: Record<string, any>;
|
|
1410
1408
|
tabindex: string;
|
|
1409
|
+
contentStyle: Record<string, any>;
|
|
1410
|
+
customClass: string;
|
|
1411
1411
|
showTitle: boolean;
|
|
1412
1412
|
readonly: boolean;
|
|
1413
1413
|
hoverExpand: boolean;
|
|
1414
1414
|
memorySpace: number;
|
|
1415
|
+
vertical: boolean;
|
|
1415
1416
|
selectMenu: {
|
|
1416
1417
|
id: string;
|
|
1417
1418
|
label: string;
|
|
1418
1419
|
}[];
|
|
1419
|
-
contentStyle: Record<string, any>;
|
|
1420
1420
|
isSelect: boolean;
|
|
1421
1421
|
counter: boolean;
|
|
1422
1422
|
autosize: boolean | Record<string, any>;
|
package/dist/index2.js
CHANGED
|
@@ -60,7 +60,7 @@ function Se(...e) {
|
|
|
60
60
|
function K(e) {
|
|
61
61
|
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function D(e) {
|
|
64
64
|
return Array.isArray(e) ? e : [e];
|
|
65
65
|
}
|
|
66
66
|
function ye(e) {
|
|
@@ -126,19 +126,19 @@ function E(e) {
|
|
|
126
126
|
const o = g(e);
|
|
127
127
|
return (t = o == null ? void 0 : o.$el) != null ? t : o;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function W(...e) {
|
|
130
130
|
const t = [], o = () => {
|
|
131
131
|
t.forEach((i) => i()), t.length = 0;
|
|
132
132
|
}, n = (i, l, s, h) => (i.addEventListener(l, s, h), () => i.removeEventListener(l, s, h)), v = I(() => {
|
|
133
|
-
const i =
|
|
133
|
+
const i = D(g(e[0])).filter((l) => l != null);
|
|
134
134
|
return i.every((l) => typeof l != "string") ? i : void 0;
|
|
135
135
|
}), c = We(
|
|
136
136
|
() => {
|
|
137
137
|
var i, l;
|
|
138
138
|
return [
|
|
139
139
|
(l = (i = v.value) == null ? void 0 : i.map((s) => E(s))) != null ? l : [R].filter((s) => s != null),
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
D(g(v.value ? e[1] : e[0])),
|
|
141
|
+
D(de(v.value ? e[2] : e[1])),
|
|
142
142
|
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
143
143
|
g(v.value ? e[3] : e[2])
|
|
144
144
|
];
|
|
@@ -169,7 +169,7 @@ function Fe(e, t, o = {}) {
|
|
|
169
169
|
if (we && !Z) {
|
|
170
170
|
Z = !0;
|
|
171
171
|
const u = { passive: !0 };
|
|
172
|
-
Array.from(n.document.body.children).forEach((f) => f
|
|
172
|
+
Array.from(n.document.body.children).forEach((f) => W(f, "click", x, u)), W(n.document.documentElement, "click", x, u);
|
|
173
173
|
}
|
|
174
174
|
let l = !0;
|
|
175
175
|
const s = (u) => g(v).some((f) => {
|
|
@@ -186,7 +186,7 @@ function Fe(e, t, o = {}) {
|
|
|
186
186
|
}
|
|
187
187
|
function r(u, f) {
|
|
188
188
|
const p = g(u), F = p.$.subTree && p.$.subTree.children;
|
|
189
|
-
return F == null || !Array.isArray(F) ? !1 : F.some((
|
|
189
|
+
return F == null || !Array.isArray(F) ? !1 : F.some((L) => L.el === f.target || f.composedPath().includes(L.el));
|
|
190
190
|
}
|
|
191
191
|
const a = (u) => {
|
|
192
192
|
const f = E(e);
|
|
@@ -200,16 +200,16 @@ function Fe(e, t, o = {}) {
|
|
|
200
200
|
};
|
|
201
201
|
let m = !1;
|
|
202
202
|
const b = [
|
|
203
|
-
|
|
203
|
+
W(n, "click", (u) => {
|
|
204
204
|
m || (m = !0, setTimeout(() => {
|
|
205
205
|
m = !1;
|
|
206
206
|
}, 0), a(u));
|
|
207
207
|
}, { passive: !0, capture: c }),
|
|
208
|
-
|
|
208
|
+
W(n, "pointerdown", (u) => {
|
|
209
209
|
const f = E(e);
|
|
210
210
|
l = !s(u) && !!(f && !u.composedPath().includes(f));
|
|
211
211
|
}, { passive: !0 }),
|
|
212
|
-
d &&
|
|
212
|
+
d && W(n, "blur", (u) => {
|
|
213
213
|
setTimeout(() => {
|
|
214
214
|
var f;
|
|
215
215
|
const p = E(e);
|
|
@@ -243,7 +243,7 @@ function Oe(e, t, o = {}) {
|
|
|
243
243
|
const d = G(() => n && "MutationObserver" in n), i = () => {
|
|
244
244
|
c && (c.disconnect(), c = void 0);
|
|
245
245
|
}, l = I(() => {
|
|
246
|
-
const a = g(e), m =
|
|
246
|
+
const a = g(e), m = D(a).map(E).filter(he);
|
|
247
247
|
return new Set(m);
|
|
248
248
|
}), s = _(
|
|
249
249
|
() => l.value,
|
|
@@ -281,7 +281,7 @@ function Pe(e, t = {}) {
|
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
283
|
v.value && (d.value = o.matchMedia(g(e)), i.value = d.value.matches);
|
|
284
|
-
}),
|
|
284
|
+
}), W(d, "change", l, { passive: !0 }), I(() => i.value);
|
|
285
285
|
}
|
|
286
286
|
function le(e, t, o = {}) {
|
|
287
287
|
const { window: n = R, ...v } = o;
|
|
@@ -309,7 +309,7 @@ function le(e, t, o = {}) {
|
|
|
309
309
|
stop: h
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Ce(e, t = {}) {
|
|
313
313
|
const {
|
|
314
314
|
reset: o = !0,
|
|
315
315
|
windowResize: n = !0,
|
|
@@ -331,7 +331,7 @@ function Le(e, t = {}) {
|
|
|
331
331
|
}
|
|
332
332
|
return le(e, u), _(() => E(e), (f) => !f && u()), Oe(e, u, {
|
|
333
333
|
attributeFilter: ["style", "class"]
|
|
334
|
-
}), v &&
|
|
334
|
+
}), v && W("scroll", u, { capture: !0, passive: !0 }), n && W("resize", u, { passive: !0 }), V(() => {
|
|
335
335
|
c && u();
|
|
336
336
|
}), {
|
|
337
337
|
height: i,
|
|
@@ -345,7 +345,7 @@ function Le(e, t = {}) {
|
|
|
345
345
|
update: u
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function ke(e, t = { width: 0, height: 0 }, o = {}) {
|
|
349
349
|
const { window: n = R, box: v = "content-box" } = o, c = I(() => {
|
|
350
350
|
var r, a;
|
|
351
351
|
return (a = (r = E(e)) == null ? void 0 : r.namespaceURI) == null ? void 0 : a.includes("svg");
|
|
@@ -360,7 +360,7 @@ function Ce(e, t = { width: 0, height: 0 }, o = {}) {
|
|
|
360
360
|
d.value = b.width, i.value = b.height;
|
|
361
361
|
}
|
|
362
362
|
} else if (a) {
|
|
363
|
-
const m =
|
|
363
|
+
const m = D(a);
|
|
364
364
|
d.value = m.reduce((b, { inlineSize: y }) => b + y, 0), i.value = m.reduce((b, { blockSize: y }) => b + y, 0);
|
|
365
365
|
} else
|
|
366
366
|
d.value = r.contentRect.width, i.value = r.contentRect.height;
|
|
@@ -387,7 +387,7 @@ function Ce(e, t = { width: 0, height: 0 }, o = {}) {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
const ee = 1;
|
|
390
|
-
function
|
|
390
|
+
function De(e, t = {}) {
|
|
391
391
|
const {
|
|
392
392
|
throttle: o = 0,
|
|
393
393
|
idle: n = 200,
|
|
@@ -424,18 +424,18 @@ function ke(e, t = {}) {
|
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
426
|
function y(w, P) {
|
|
427
|
-
var T,
|
|
427
|
+
var T, C, k, j;
|
|
428
428
|
if (!s)
|
|
429
429
|
return;
|
|
430
|
-
const
|
|
431
|
-
if (!
|
|
430
|
+
const M = g(e);
|
|
431
|
+
if (!M)
|
|
432
432
|
return;
|
|
433
|
-
(
|
|
433
|
+
(k = M instanceof Document ? s.document.body : M) == null || k.scrollTo({
|
|
434
434
|
top: (T = g(P)) != null ? T : b.value,
|
|
435
|
-
left: (
|
|
435
|
+
left: (C = g(w)) != null ? C : m.value,
|
|
436
436
|
behavior: g(l)
|
|
437
437
|
});
|
|
438
|
-
const O = ((j =
|
|
438
|
+
const O = ((j = M == null ? void 0 : M.document) == null ? void 0 : j.documentElement) || (M == null ? void 0 : M.documentElement) || M;
|
|
439
439
|
m != null && (r.value = O.scrollLeft), b != null && (a.value = O.scrollTop);
|
|
440
440
|
}
|
|
441
441
|
const u = S(!1), f = J({
|
|
@@ -450,26 +450,26 @@ function ke(e, t = {}) {
|
|
|
450
450
|
bottom: !1
|
|
451
451
|
}), F = (w) => {
|
|
452
452
|
u.value && (u.value = !1, p.left = !1, p.right = !1, p.top = !1, p.bottom = !1, v(w));
|
|
453
|
-
},
|
|
453
|
+
}, L = Ee(F, o + n), z = (w) => {
|
|
454
454
|
var P;
|
|
455
455
|
if (!s)
|
|
456
456
|
return;
|
|
457
|
-
const T = ((P = w == null ? void 0 : w.document) == null ? void 0 : P.documentElement) || (w == null ? void 0 : w.documentElement) || E(w), { display:
|
|
457
|
+
const T = ((P = w == null ? void 0 : w.document) == null ? void 0 : P.documentElement) || (w == null ? void 0 : w.documentElement) || E(w), { display: C, flexDirection: k, direction: j } = getComputedStyle(T), M = j === "rtl" ? -1 : 1, O = T.scrollLeft;
|
|
458
458
|
p.left = O < r.value, p.right = O > r.value;
|
|
459
|
-
const Q = Math.abs(O *
|
|
460
|
-
|
|
459
|
+
const Q = Math.abs(O * M) <= (d.left || 0), X = Math.abs(O * M) + T.clientWidth >= T.scrollWidth - (d.right || 0) - ee;
|
|
460
|
+
C === "flex" && k === "row-reverse" ? (f.left = X, f.right = Q) : (f.left = Q, f.right = X), r.value = O;
|
|
461
461
|
let A = T.scrollTop;
|
|
462
462
|
w === s.document && !A && (A = s.document.body.scrollTop), p.top = A < a.value, p.bottom = A > a.value;
|
|
463
463
|
const U = Math.abs(A) <= (d.top || 0), q = Math.abs(A) + T.clientHeight >= T.scrollHeight - (d.bottom || 0) - ee;
|
|
464
|
-
|
|
464
|
+
C === "flex" && k === "column-reverse" ? (f.top = q, f.bottom = U) : (f.top = U, f.bottom = q), a.value = A;
|
|
465
465
|
}, Y = (w) => {
|
|
466
466
|
var P;
|
|
467
467
|
if (!s)
|
|
468
468
|
return;
|
|
469
469
|
const T = (P = w.target.documentElement) != null ? P : w.target;
|
|
470
|
-
z(T), u.value = !0,
|
|
470
|
+
z(T), u.value = !0, L(w), c(w);
|
|
471
471
|
};
|
|
472
|
-
return
|
|
472
|
+
return W(
|
|
473
473
|
e,
|
|
474
474
|
"scroll",
|
|
475
475
|
o ? Te(Y, o, !0, !1) : Y,
|
|
@@ -483,7 +483,7 @@ function ke(e, t = {}) {
|
|
|
483
483
|
} catch (w) {
|
|
484
484
|
h(w);
|
|
485
485
|
}
|
|
486
|
-
}),
|
|
486
|
+
}), W(
|
|
487
487
|
e,
|
|
488
488
|
"scrollend",
|
|
489
489
|
F,
|
|
@@ -500,7 +500,7 @@ function ke(e, t = {}) {
|
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Le(e = {}) {
|
|
504
504
|
const {
|
|
505
505
|
window: t = R,
|
|
506
506
|
initialWidth: o = Number.POSITIVE_INFINITY,
|
|
@@ -519,18 +519,18 @@ function De(e = {}) {
|
|
|
519
519
|
};
|
|
520
520
|
s(), V(s);
|
|
521
521
|
const h = { passive: !0 };
|
|
522
|
-
if (
|
|
522
|
+
if (W("resize", s, h), t && d === "visual" && t.visualViewport && W(t.visualViewport, "resize", s, h), v) {
|
|
523
523
|
const r = Pe("(orientation: portrait)");
|
|
524
524
|
_(r, () => s());
|
|
525
525
|
}
|
|
526
526
|
return { width: i, height: l };
|
|
527
527
|
}
|
|
528
528
|
export {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
Le as a,
|
|
530
|
+
ke as b,
|
|
531
|
+
Ce as c,
|
|
532
532
|
Pe as d,
|
|
533
533
|
Fe as o,
|
|
534
|
-
|
|
534
|
+
De as u,
|
|
535
535
|
_e as w
|
|
536
536
|
};
|