@vmscloud/moz-ui-components-core 0.1.64 → 0.1.65
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.cjs +370 -370
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +817 -811
- package/dist/index.js.map +1 -1
- package/dist/runtime/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import "dayjs/locale/ko.js";
|
|
|
19
19
|
import "dayjs/locale/en.js";
|
|
20
20
|
import "dayjs/locale/zh.js";
|
|
21
21
|
import "dayjs/locale/ja.js";
|
|
22
|
-
import { createRef as Se, ref as
|
|
22
|
+
import { createRef as Se, ref as ne } from "lit-html/directives/ref.js";
|
|
23
23
|
import { Virtualizer as xt, elementScroll as Lt, observeElementOffset as Tt, observeElementRect as Mt } from "@tanstack/virtual-core";
|
|
24
24
|
class ws {
|
|
25
25
|
constructor(t) {
|
|
@@ -2260,18 +2260,17 @@ const lo = {
|
|
|
2260
2260
|
let ks = 0;
|
|
2261
2261
|
function $e(e) {
|
|
2262
2262
|
return (t, o, l, n) => {
|
|
2263
|
-
var fe;
|
|
2264
2263
|
const r = e.portal ? new _t() : null, h = r ? r.open() : t, d = `h${++ks}:`, s = new bs();
|
|
2265
2264
|
if (n != null && n.slots)
|
|
2266
|
-
for (const [
|
|
2265
|
+
for (const [A, _] of Object.entries(n.slots)) s.register(A, _);
|
|
2267
2266
|
n != null && n.slotResolver && s.setResolver(n.slotResolver);
|
|
2268
|
-
const m = new Set(Object.keys(o)), i = n != null && n.providedKeys ? new Set(n.providedKeys) : null, u = (
|
|
2269
|
-
const
|
|
2270
|
-
if (!
|
|
2271
|
-
const
|
|
2272
|
-
for (const
|
|
2273
|
-
|
|
2274
|
-
return
|
|
2267
|
+
const m = new Set(Object.keys(o)), i = n != null && n.providedKeys ? new Set(n.providedKeys) : null, u = (A) => {
|
|
2268
|
+
const _ = e.defaults;
|
|
2269
|
+
if (!_) return A;
|
|
2270
|
+
const G = { ...A };
|
|
2271
|
+
for (const oe of Object.keys(_))
|
|
2272
|
+
G[oe] === void 0 && (G[oe] = _[oe]);
|
|
2273
|
+
return G;
|
|
2275
2274
|
};
|
|
2276
2275
|
let p = u({ ...o }), w = (n == null ? void 0 : n.locale) ?? lo;
|
|
2277
2276
|
const S = (n == null ? void 0 : n.validator) ?? null, I = [];
|
|
@@ -2283,39 +2282,39 @@ function $e(e) {
|
|
|
2283
2282
|
emit: l,
|
|
2284
2283
|
slots: s,
|
|
2285
2284
|
requestUpdate: () => Z.requestUpdate(),
|
|
2286
|
-
onCleanup: (
|
|
2287
|
-
px: (
|
|
2285
|
+
onCleanup: (A) => I.push(A),
|
|
2286
|
+
px: (A) => Le(A),
|
|
2288
2287
|
get locale() {
|
|
2289
2288
|
return w;
|
|
2290
2289
|
},
|
|
2291
2290
|
validator: S,
|
|
2292
|
-
controlled: (
|
|
2293
|
-
slot(
|
|
2294
|
-
if (!s.has(
|
|
2295
|
-
const
|
|
2296
|
-
P.set(
|
|
2297
|
-
const
|
|
2298
|
-
return C.set(
|
|
2291
|
+
controlled: (A) => i ? i.has(A) : m.has(A),
|
|
2292
|
+
slot(A, _) {
|
|
2293
|
+
if (!s.has(A)) return v;
|
|
2294
|
+
const G = P.get(A) ?? 0;
|
|
2295
|
+
P.set(A, G + 1);
|
|
2296
|
+
const oe = `${A}#${G}`;
|
|
2297
|
+
return C.set(oe, { name: A, scope: _ }), a`<span data-moz-slot=${A} data-moz-slot-id=${d + oe}></span>`;
|
|
2299
2298
|
}
|
|
2300
2299
|
}, U = e.setup(V);
|
|
2301
|
-
class
|
|
2300
|
+
class W extends ws {
|
|
2302
2301
|
template() {
|
|
2303
2302
|
return C = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), U.render();
|
|
2304
2303
|
}
|
|
2305
2304
|
renderNow() {
|
|
2306
2305
|
super.renderNow();
|
|
2307
|
-
let
|
|
2306
|
+
let _ = null;
|
|
2308
2307
|
if (U.renderPortal) {
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2308
|
+
const G = U.renderPortal(), oe = U.getPortalContainer ? U.getPortalContainer() : document.body;
|
|
2309
|
+
G === v || G == null || oe == null ? $ && $.isOpen && (kt(v, $.element), $.close()) : ($ || ($ = new _t()), _ = $.isOpen ? $.element : $.open("moz-overlay-portal", oe), kt(G, _));
|
|
2311
2310
|
}
|
|
2312
|
-
for (const [
|
|
2313
|
-
const
|
|
2314
|
-
let
|
|
2315
|
-
!
|
|
2311
|
+
for (const [G, { name: oe, scope: Q }] of C) {
|
|
2312
|
+
const B = `[data-moz-slot-id="${d + G}"]`;
|
|
2313
|
+
let se = this.container.querySelector(B);
|
|
2314
|
+
!se && _ && (se = _.querySelector(B)), se && s.fill(G, oe, se, Q);
|
|
2316
2315
|
}
|
|
2317
|
-
for (const
|
|
2318
|
-
C.has(
|
|
2316
|
+
for (const G of y)
|
|
2317
|
+
C.has(G) || s.clear(G);
|
|
2319
2318
|
y = new Set(C.keys());
|
|
2320
2319
|
}
|
|
2321
2320
|
/** microtask 배치를 건너뛰고 즉시 렌더 (`update({ sync: true })` 전용) */
|
|
@@ -2323,34 +2322,41 @@ function $e(e) {
|
|
|
2323
2322
|
this.isMounted && this.renderNow();
|
|
2324
2323
|
}
|
|
2325
2324
|
onDestroy() {
|
|
2326
|
-
for (const
|
|
2325
|
+
for (const _ of I.splice(0))
|
|
2327
2326
|
try {
|
|
2328
|
-
|
|
2327
|
+
_();
|
|
2329
2328
|
} catch {
|
|
2330
2329
|
}
|
|
2331
2330
|
s.destroy();
|
|
2332
2331
|
}
|
|
2333
2332
|
}
|
|
2334
|
-
const Z = new
|
|
2335
|
-
|
|
2333
|
+
const Z = new W(h);
|
|
2334
|
+
Z.mount();
|
|
2335
|
+
let ie = !1;
|
|
2336
|
+
const fe = () => {
|
|
2337
|
+
var A;
|
|
2338
|
+
ie || !Z.isMounted || (ie = !0, (A = U.onMounted) == null || A.call(U, h.firstElementChild));
|
|
2339
|
+
};
|
|
2340
|
+
return n != null && n.deferMounted || fe(), {
|
|
2336
2341
|
// 스냅샷이 아니라 매번 읽는다 — 조건부 루트로 템플릿이 통째로 교체되면 마운트
|
|
2337
2342
|
// 시점에 잡아 둔 element 는 문서에서 떨어진 낡은 참조가 된다.
|
|
2338
2343
|
// portal 모드에서는 renderRoot 가 포털 루트다(문서화된 동작).
|
|
2339
2344
|
get el() {
|
|
2340
2345
|
return h.firstElementChild;
|
|
2341
2346
|
},
|
|
2342
|
-
update(
|
|
2343
|
-
|
|
2344
|
-
for (const
|
|
2345
|
-
|
|
2347
|
+
update(A, _) {
|
|
2348
|
+
_ != null && _.replace ? (p = u({ ...A }), m.clear()) : p = u({ ...p, ...A });
|
|
2349
|
+
for (const G of Object.keys(A)) m.add(G);
|
|
2350
|
+
_ != null && _.sync ? Z.flush() : Z.requestUpdate();
|
|
2346
2351
|
},
|
|
2347
2352
|
destroy() {
|
|
2348
2353
|
Z.destroy(), r == null || r.close(), $ == null || $.close();
|
|
2349
2354
|
},
|
|
2350
|
-
setLocale(
|
|
2351
|
-
|
|
2355
|
+
setLocale(A) {
|
|
2356
|
+
A !== w && (w = A ?? lo, Z.requestUpdate());
|
|
2352
2357
|
},
|
|
2353
|
-
api: U.api ?? {}
|
|
2358
|
+
api: U.api ?? {},
|
|
2359
|
+
notifyMounted: fe
|
|
2354
2360
|
};
|
|
2355
2361
|
};
|
|
2356
2362
|
}
|
|
@@ -2425,7 +2431,7 @@ class Es extends ds {
|
|
|
2425
2431
|
}
|
|
2426
2432
|
}
|
|
2427
2433
|
const me = as(Es);
|
|
2428
|
-
function
|
|
2434
|
+
function D(...e) {
|
|
2429
2435
|
return us(e);
|
|
2430
2436
|
}
|
|
2431
2437
|
function Ps() {
|
|
@@ -2606,7 +2612,7 @@ function yt(e, t = {}) {
|
|
|
2606
2612
|
return a`
|
|
2607
2613
|
<button
|
|
2608
2614
|
type=${e.nativeType ?? "button"}
|
|
2609
|
-
class=${
|
|
2615
|
+
class=${D(
|
|
2610
2616
|
"moz-button",
|
|
2611
2617
|
xo(e.type),
|
|
2612
2618
|
{ loading: !!e.loading, disabled: o, "moz-icon-text-button": l },
|
|
@@ -2620,7 +2626,7 @@ function yt(e, t = {}) {
|
|
|
2620
2626
|
${e.loading ? a`<span class="spinner" data-part="spinner"
|
|
2621
2627
|
>${zo({ circleClass: "fill-accent-50", progressClass: "fill-accent-400" })}</span
|
|
2622
2628
|
>` : t.icon ?? v}
|
|
2623
|
-
${e.text || t.content != null ? a`<span class=${
|
|
2629
|
+
${e.text || t.content != null ? a`<span class=${D("text", { "has-icon-text": l })} data-part="label"
|
|
2624
2630
|
>${e.text ?? ""}${t.content ?? v}</span
|
|
2625
2631
|
>` : v}
|
|
2626
2632
|
</button>
|
|
@@ -2656,7 +2662,7 @@ const Vs = $e({
|
|
|
2656
2662
|
return a`
|
|
2657
2663
|
<button
|
|
2658
2664
|
type=${n.nativeType ?? "button"}
|
|
2659
|
-
class=${
|
|
2665
|
+
class=${D(
|
|
2660
2666
|
"moz-button",
|
|
2661
2667
|
xo(n.type),
|
|
2662
2668
|
{
|
|
@@ -2674,7 +2680,7 @@ const Vs = $e({
|
|
|
2674
2680
|
${t ? a`<span class="spinner" data-part="spinner"
|
|
2675
2681
|
>${zo({ circleClass: "fill-accent-50", progressClass: "fill-accent-400" })}</span
|
|
2676
2682
|
>` : e.slot("icon", { disabled: h })}
|
|
2677
|
-
${n.text || e.slots.has("default") ? a`<span class=${
|
|
2683
|
+
${n.text || e.slots.has("default") ? a`<span class=${D("text", { "has-icon-text": r })} data-part="label"
|
|
2678
2684
|
>${n.text ?? ""}${e.slot("default", { disabled: h })}</span
|
|
2679
2685
|
>` : v}
|
|
2680
2686
|
</button>
|
|
@@ -2692,7 +2698,7 @@ const Vs = $e({
|
|
|
2692
2698
|
expose: !0
|
|
2693
2699
|
}, As = /* @__PURE__ */ new Set(["for", "disabled", "required", "isReadOnly", "class", "style"]);
|
|
2694
2700
|
function Lo(e, t) {
|
|
2695
|
-
return
|
|
2701
|
+
return D("moz-label", { disabled: !!e.disabled, "read-only": !!e.isReadOnly }, t, e.class);
|
|
2696
2702
|
}
|
|
2697
2703
|
function Ke(e, t, o) {
|
|
2698
2704
|
return a`<label class=${Lo(e, o)} for=${Ee(e.for)}
|
|
@@ -2739,13 +2745,13 @@ function Wt(e) {
|
|
|
2739
2745
|
return a`
|
|
2740
2746
|
<div
|
|
2741
2747
|
data-part="root"
|
|
2742
|
-
class=${
|
|
2748
|
+
class=${D(e.class)}
|
|
2743
2749
|
style=${X({ ...ve(e.style), ...e.visible === !1 ? { display: "none" } : {} })}
|
|
2744
2750
|
${me(e.rest ?? {})}
|
|
2745
2751
|
>
|
|
2746
2752
|
<div class="moz-switch">
|
|
2747
2753
|
${e.labelPosition !== "right" ? Ke({ for: e.id, disabled: e.disabled, required: e.required }, e.label ?? "", "label-left") : v}
|
|
2748
|
-
<div class=${
|
|
2754
|
+
<div class=${D("moz-switch-box", { active: t, disabled: !!e.disabled })}>
|
|
2749
2755
|
<input
|
|
2750
2756
|
id=${e.id}
|
|
2751
2757
|
class="moz-switch-input"
|
|
@@ -2758,7 +2764,7 @@ function Wt(e) {
|
|
|
2758
2764
|
@change=${e.onChange}
|
|
2759
2765
|
@click=${e.onClick}
|
|
2760
2766
|
/>
|
|
2761
|
-
<div class=${
|
|
2767
|
+
<div class=${D("moz-switch-handler", { active: t, disabled: !!e.disabled })}></div>
|
|
2762
2768
|
</div>
|
|
2763
2769
|
${e.labelPosition === "right" ? Ke({ for: e.id, disabled: e.disabled }, e.label ?? "", "label-right") : v}
|
|
2764
2770
|
</div>
|
|
@@ -2851,7 +2857,7 @@ function Ao(e) {
|
|
|
2851
2857
|
<div
|
|
2852
2858
|
role="navigation"
|
|
2853
2859
|
aria-label=${e.ariaLabel ?? "breadcrumb"}
|
|
2854
|
-
class=${
|
|
2860
|
+
class=${D("moz-bread-crumb", e.class)}
|
|
2855
2861
|
style=${X(ve(e.style))}
|
|
2856
2862
|
${me(e.rest ?? {})}
|
|
2857
2863
|
>
|
|
@@ -2877,11 +2883,11 @@ const Fs = $e({
|
|
|
2877
2883
|
return a`
|
|
2878
2884
|
<nav
|
|
2879
2885
|
aria-label=${e.locale.BreadCrumb.navigation}
|
|
2880
|
-
class=${
|
|
2886
|
+
class=${D("moz-bread-crumb", "moz-bread-crumb-items", n.class)}
|
|
2881
2887
|
style=${X(ve(n.style))}
|
|
2882
2888
|
${me(Ce(n, no))}
|
|
2883
2889
|
>
|
|
2884
|
-
<ol class=${
|
|
2890
|
+
<ol class=${D("moz-bread-crumb-list", n.listClass)}>
|
|
2885
2891
|
${l.map(
|
|
2886
2892
|
(s, m) => a`
|
|
2887
2893
|
<li class="moz-bread-crumb-item" aria-current=${s.current ? "page" : v}>
|
|
@@ -3000,7 +3006,7 @@ const Fs = $e({
|
|
|
3000
3006
|
if (l.composed)
|
|
3001
3007
|
return a`
|
|
3002
3008
|
<div
|
|
3003
|
-
class=${
|
|
3009
|
+
class=${D("empty-container", "empty-composed", "moz-empty-state", l.class)}
|
|
3004
3010
|
style=${X(ve(l.style))}
|
|
3005
3011
|
${me(n)}
|
|
3006
3012
|
>
|
|
@@ -3015,7 +3021,7 @@ const Fs = $e({
|
|
|
3015
3021
|
if (!r) return v;
|
|
3016
3022
|
const h = Us[r] || Do, d = typeof l.headerMsg == "string" ? l.headerMsg : t(_s[r] || "customEmptyHeader"), s = typeof l.contentMsg == "string" ? l.contentMsg : t(Ws[r] || "customEmptyContent"), m = e.slots.has("icon") ? a`<div class="empty-icon">${e.slot("icon")}</div>` : l.useImg ? a`<img src=${h} alt="Empty state" class="empty-img" />` : v;
|
|
3017
3023
|
return a`
|
|
3018
|
-
<div class=${
|
|
3024
|
+
<div class=${D("empty-container", "moz-empty-state", l.class)} style=${X(ve(l.style))} ${me(n)}>
|
|
3019
3025
|
${m}
|
|
3020
3026
|
<div class="empty-heading">${d}</div>
|
|
3021
3027
|
<div class="empty-content"><span>${ko(s)}</span></div>
|
|
@@ -3093,7 +3099,7 @@ function Ot(e = {}) {
|
|
|
3093
3099
|
};
|
|
3094
3100
|
return a`
|
|
3095
3101
|
<div
|
|
3096
|
-
class=${
|
|
3102
|
+
class=${D(
|
|
3097
3103
|
"moz-checkbox",
|
|
3098
3104
|
{ "cursor-pointer": !o, "cursor-not-allowed": o, disabled: o },
|
|
3099
3105
|
e.class
|
|
@@ -3105,7 +3111,7 @@ function Ot(e = {}) {
|
|
|
3105
3111
|
<div class="checkbox-icon-wrapper">
|
|
3106
3112
|
<input
|
|
3107
3113
|
type="checkbox"
|
|
3108
|
-
class=${
|
|
3114
|
+
class=${D("checkbox-input", { "cursor-pointer": !o, "cursor-not-allowed": o })}
|
|
3109
3115
|
.checked=${t}
|
|
3110
3116
|
?disabled=${o}
|
|
3111
3117
|
tabindex=${o ? -1 : 0}
|
|
@@ -3158,7 +3164,7 @@ const Ys = $e({
|
|
|
3158
3164
|
const u = e.props, p = u.fieldId || t, w = l(), S = Ce(u, Gs);
|
|
3159
3165
|
return a`
|
|
3160
3166
|
<div
|
|
3161
|
-
class=${
|
|
3167
|
+
class=${D(
|
|
3162
3168
|
"moz-checkbox",
|
|
3163
3169
|
{
|
|
3164
3170
|
"cursor-pointer": !u.disabled && !u.readonly,
|
|
@@ -3175,7 +3181,7 @@ const Ys = $e({
|
|
|
3175
3181
|
<input
|
|
3176
3182
|
id=${p}
|
|
3177
3183
|
type="checkbox"
|
|
3178
|
-
class=${
|
|
3184
|
+
class=${D("checkbox-input", {
|
|
3179
3185
|
"cursor-pointer": !u.disabled && !u.readonly,
|
|
3180
3186
|
"cursor-not-allowed": u.disabled,
|
|
3181
3187
|
"cursor-default": u.readonly && !u.disabled
|
|
@@ -3190,7 +3196,7 @@ const Ys = $e({
|
|
|
3190
3196
|
@blur=${i}
|
|
3191
3197
|
@keydown=${s}
|
|
3192
3198
|
/>
|
|
3193
|
-
<div class=${
|
|
3199
|
+
<div class=${D("checkbox-visual", { focused: o })}>
|
|
3194
3200
|
${u.indeterminate ? Fo(void 0, !!u.disabled, "checked-icon") : w ? Io(void 0, !!u.disabled, "checked-icon") : qo(void 0, !!u.disabled, "check-icon")}
|
|
3195
3201
|
</div>
|
|
3196
3202
|
</div>
|
|
@@ -3257,7 +3263,7 @@ const Ys = $e({
|
|
|
3257
3263
|
return !!m.disabled || s[m.disabledExpr ?? "disabled"] === !0;
|
|
3258
3264
|
}, h = (s, m) => {
|
|
3259
3265
|
const i = e.props, u = i.itemsSource ?? [];
|
|
3260
|
-
return
|
|
3266
|
+
return D("label-container", {
|
|
3261
3267
|
boxed: i.variant === "boxed",
|
|
3262
3268
|
"first-h": i.variant === "boxed" && i.direction === "horizontal" && s === 0,
|
|
3263
3269
|
"last-h": i.variant === "boxed" && i.direction === "horizontal" && s === u.length - 1,
|
|
@@ -3274,7 +3280,7 @@ const Ys = $e({
|
|
|
3274
3280
|
const s = e.props, m = s.itemsSource ?? [], i = s.valueExpr ?? "value", u = s.displayExpr ?? "label", p = !!s.disabled, w = s.modelValue, S = s.value !== void 0 && m.length === 0, I = !S && s.variant === "segment", C = Ce(s, js), y = () => a`
|
|
3275
3281
|
<div class="radio-container">
|
|
3276
3282
|
<div class="radio">
|
|
3277
|
-
<label for=${t} class=${
|
|
3283
|
+
<label for=${t} class=${D("label-container", { disabled: p })}>
|
|
3278
3284
|
<div class="radio-icon-wrapper">
|
|
3279
3285
|
<input
|
|
3280
3286
|
type="radio"
|
|
@@ -3283,15 +3289,15 @@ const Ys = $e({
|
|
|
3283
3289
|
.checked=${String(w) === String(s.value)}
|
|
3284
3290
|
?disabled=${p}
|
|
3285
3291
|
class="radio-input"
|
|
3286
|
-
@keydown=${(
|
|
3287
|
-
o(
|
|
3292
|
+
@keydown=${(W) => {
|
|
3293
|
+
o(W) && !p && e.emit("update:modelValue", String(s.value));
|
|
3288
3294
|
}}
|
|
3289
3295
|
@change=${() => {
|
|
3290
3296
|
p || e.emit("update:modelValue", String(s.value));
|
|
3291
3297
|
}}
|
|
3292
3298
|
/>
|
|
3293
3299
|
<span
|
|
3294
|
-
class=${
|
|
3300
|
+
class=${D("dot", {
|
|
3295
3301
|
active: String(w) === String(s.value),
|
|
3296
3302
|
disabled: p,
|
|
3297
3303
|
"borderless-focus": !p
|
|
@@ -3303,26 +3309,26 @@ const Ys = $e({
|
|
|
3303
3309
|
</div>
|
|
3304
3310
|
</div>
|
|
3305
3311
|
`, P = () => {
|
|
3306
|
-
const
|
|
3312
|
+
const W = (K) => String(w) === String(K[i] ?? ""), Z = m.length, ie = m.findIndex(W), fe = (K, E) => {
|
|
3307
3313
|
for (let k = 1; k <= Z; k += 1) {
|
|
3308
|
-
const M = (
|
|
3314
|
+
const M = (K + E * k + Z * Z) % Z;
|
|
3309
3315
|
if (!r(m[M])) return M;
|
|
3310
3316
|
}
|
|
3311
3317
|
return -1;
|
|
3312
|
-
},
|
|
3318
|
+
}, le = (K) => {
|
|
3313
3319
|
for (let E = 0; E < Z; E += 1) {
|
|
3314
|
-
const k =
|
|
3320
|
+
const k = K === 1 ? E : Z - 1 - E;
|
|
3315
3321
|
if (!r(m[k])) return k;
|
|
3316
3322
|
}
|
|
3317
3323
|
return -1;
|
|
3318
|
-
},
|
|
3324
|
+
}, A = ie >= 0 && !r(m[ie]) ? ie : le(1), _ = (K) => Array.from(K.querySelectorAll('[role="radio"]')), G = (K, E) => {
|
|
3319
3325
|
if (E < 0) return;
|
|
3320
|
-
|
|
3321
|
-
const k =
|
|
3326
|
+
K.preventDefault(), K.stopPropagation();
|
|
3327
|
+
const k = K.currentTarget, M = _(k)[E];
|
|
3322
3328
|
M == null || M.focus(), e.emit("update:modelValue", m[E][i] ?? "");
|
|
3323
3329
|
let x = 0;
|
|
3324
3330
|
const q = () => {
|
|
3325
|
-
const f =
|
|
3331
|
+
const f = _(k)[E];
|
|
3326
3332
|
if (f && f.getAttribute("aria-checked") === "true") {
|
|
3327
3333
|
document.activeElement !== f && f.focus();
|
|
3328
3334
|
return;
|
|
@@ -3330,59 +3336,59 @@ const Ys = $e({
|
|
|
3330
3336
|
++x < 20 && l(q);
|
|
3331
3337
|
};
|
|
3332
3338
|
l(q);
|
|
3333
|
-
},
|
|
3339
|
+
}, oe = (K) => {
|
|
3334
3340
|
var q, f;
|
|
3335
3341
|
if (p || Z === 0) return;
|
|
3336
|
-
const E =
|
|
3337
|
-
switch (
|
|
3342
|
+
const E = K.currentTarget, k = (f = (q = K.target) == null ? void 0 : q.closest) == null ? void 0 : f.call(q, '[role="radio"]'), M = k ? _(E).indexOf(k) : -1, x = M >= 0 ? M : ie >= 0 ? ie : 0;
|
|
3343
|
+
switch (K.key) {
|
|
3338
3344
|
case "ArrowRight":
|
|
3339
3345
|
case "ArrowDown":
|
|
3340
|
-
|
|
3346
|
+
G(K, fe(x, 1));
|
|
3341
3347
|
break;
|
|
3342
3348
|
case "ArrowLeft":
|
|
3343
3349
|
case "ArrowUp":
|
|
3344
|
-
|
|
3350
|
+
G(K, fe(x, -1));
|
|
3345
3351
|
break;
|
|
3346
3352
|
case "Home":
|
|
3347
|
-
|
|
3353
|
+
G(K, le(1));
|
|
3348
3354
|
break;
|
|
3349
3355
|
case "End":
|
|
3350
|
-
|
|
3356
|
+
G(K, le(-1));
|
|
3351
3357
|
break;
|
|
3352
3358
|
}
|
|
3353
|
-
}, Q = !!s.iconOnly,
|
|
3359
|
+
}, Q = !!s.iconOnly, B = e.slots.has("item-icon"), se = !Q && e.slots.has("item-badge");
|
|
3354
3360
|
return a`
|
|
3355
3361
|
<div
|
|
3356
|
-
class=${
|
|
3362
|
+
class=${D("radio-container", {
|
|
3357
3363
|
segment: !0,
|
|
3358
3364
|
"disabled-container": p,
|
|
3359
3365
|
"size-sm": s.size === "sm",
|
|
3360
3366
|
"size-md": s.size !== "sm",
|
|
3361
3367
|
"icon-only": Q
|
|
3362
3368
|
})}
|
|
3363
|
-
@keydown=${
|
|
3364
|
-
@click=${(
|
|
3369
|
+
@keydown=${oe}
|
|
3370
|
+
@click=${(K) => K.stopPropagation()}
|
|
3365
3371
|
>
|
|
3366
|
-
${m.map((
|
|
3367
|
-
const k = K
|
|
3372
|
+
${m.map((K, E) => {
|
|
3373
|
+
const k = W(K), M = r(K), x = String(K[u] ?? ""), q = x || String(K[i] ?? ""), f = { item: K, index: E, active: k, disabled: M };
|
|
3368
3374
|
return a`
|
|
3369
3375
|
<button
|
|
3370
3376
|
type="button"
|
|
3371
3377
|
role="radio"
|
|
3372
3378
|
aria-checked=${k ? "true" : "false"}
|
|
3373
3379
|
aria-label=${Q ? q : v}
|
|
3374
|
-
data-value=${String(
|
|
3375
|
-
data-tone=${n(
|
|
3376
|
-
tabindex=${E ===
|
|
3380
|
+
data-value=${String(K[i] ?? "")}
|
|
3381
|
+
data-tone=${n(K) ?? v}
|
|
3382
|
+
tabindex=${E === A ? "0" : "-1"}
|
|
3377
3383
|
?disabled=${M}
|
|
3378
|
-
class=${
|
|
3384
|
+
class=${D("segment-button", { "is-active": k, disabled: M })}
|
|
3379
3385
|
@click=${() => {
|
|
3380
|
-
M || e.emit("update:modelValue",
|
|
3386
|
+
M || e.emit("update:modelValue", K[i] ?? "");
|
|
3381
3387
|
}}
|
|
3382
3388
|
>
|
|
3383
|
-
${
|
|
3389
|
+
${B ? a`<span class="segment-icon">${e.slot("item-icon", f)}</span>` : v}
|
|
3384
3390
|
${Q ? v : x}
|
|
3385
|
-
${
|
|
3391
|
+
${se ? a`<span class="segment-badge">${e.slot("item-badge", f)}</span>` : v}
|
|
3386
3392
|
</button>
|
|
3387
3393
|
`;
|
|
3388
3394
|
})}
|
|
@@ -3390,19 +3396,19 @@ const Ys = $e({
|
|
|
3390
3396
|
`;
|
|
3391
3397
|
}, $ = () => a`
|
|
3392
3398
|
<div
|
|
3393
|
-
class=${
|
|
3399
|
+
class=${D("radio-container", {
|
|
3394
3400
|
"disabled-container": p,
|
|
3395
3401
|
borderless: s.variant === "borderless",
|
|
3396
3402
|
vertical: s.direction === "vertical"
|
|
3397
3403
|
})}
|
|
3398
3404
|
>
|
|
3399
|
-
${m.map((
|
|
3400
|
-
const
|
|
3405
|
+
${m.map((W, Z) => {
|
|
3406
|
+
const ie = r(W);
|
|
3401
3407
|
return a`
|
|
3402
3408
|
<div class="radio">
|
|
3403
3409
|
<label
|
|
3404
3410
|
for=${`${t}_${Z}`}
|
|
3405
|
-
class=${h(Z,
|
|
3411
|
+
class=${h(Z, ie)}
|
|
3406
3412
|
style=${X(d(Z))}
|
|
3407
3413
|
>
|
|
3408
3414
|
<div class="radio-icon-wrapper">
|
|
@@ -3410,23 +3416,23 @@ const Ys = $e({
|
|
|
3410
3416
|
type="radio"
|
|
3411
3417
|
name=${s.name || t}
|
|
3412
3418
|
id=${`${t}_${Z}`}
|
|
3413
|
-
.checked=${w === String(
|
|
3414
|
-
?disabled=${
|
|
3419
|
+
.checked=${w === String(W[i] ?? "")}
|
|
3420
|
+
?disabled=${ie}
|
|
3415
3421
|
class="radio-input"
|
|
3416
3422
|
@keydown=${(fe) => {
|
|
3417
|
-
o(fe) && e.emit("update:modelValue", String(
|
|
3423
|
+
o(fe) && e.emit("update:modelValue", String(W[i] ?? ""));
|
|
3418
3424
|
}}
|
|
3419
|
-
@change=${() => e.emit("update:modelValue", String(
|
|
3425
|
+
@change=${() => e.emit("update:modelValue", String(W[i] ?? ""))}
|
|
3420
3426
|
/>
|
|
3421
3427
|
<span
|
|
3422
|
-
class=${
|
|
3423
|
-
active: w === String(
|
|
3424
|
-
disabled:
|
|
3425
|
-
"borderless-focus": s.variant !== "boxed" && !
|
|
3428
|
+
class=${D("dot", {
|
|
3429
|
+
active: w === String(W[i] ?? ""),
|
|
3430
|
+
disabled: ie,
|
|
3431
|
+
"borderless-focus": s.variant !== "boxed" && !ie
|
|
3426
3432
|
})}
|
|
3427
3433
|
></span>
|
|
3428
3434
|
</div>
|
|
3429
|
-
<span class="radio-label-text">${String(
|
|
3435
|
+
<span class="radio-label-text">${String(W[u] ?? "")}</span>
|
|
3430
3436
|
</label>
|
|
3431
3437
|
</div>
|
|
3432
3438
|
`;
|
|
@@ -3435,7 +3441,7 @@ const Ys = $e({
|
|
|
3435
3441
|
`, V = "aria-label" in C || "aria-labelledby" in C, U = I && !V && s.label ? s.label : v;
|
|
3436
3442
|
return a`
|
|
3437
3443
|
<div
|
|
3438
|
-
class=${
|
|
3444
|
+
class=${D("moz-radio-buttons", { "label-position-left": s.labelPosition === "left" }, s.class)}
|
|
3439
3445
|
style=${X(ve(s.style))}
|
|
3440
3446
|
role=${I ? "radiogroup" : v}
|
|
3441
3447
|
aria-label=${U}
|
|
@@ -3561,13 +3567,13 @@ const Qs = /* @__PURE__ */ new Set([
|
|
|
3561
3567
|
const i = e.props, u = String(i.modelValue ?? ""), p = t.save || t.blur || t.change, w = !!i.useInvalidV2, S = i.width ? typeof i.width == "number" ? `${i.width}px` : i.width : "100%", I = Ce(i, Qs);
|
|
3562
3568
|
return a`
|
|
3563
3569
|
<div
|
|
3564
|
-
class=${
|
|
3570
|
+
class=${D("moz-input-wrapper", { "is-invalid": p !== "" }, i.class)}
|
|
3565
3571
|
style=${X({ width: S, ...ve(i.style) })}
|
|
3566
3572
|
>
|
|
3567
3573
|
<div class="input-wrapper">
|
|
3568
3574
|
${i.label ? Ke({ isReadOnly: i.isReadOnly, required: i.required }, i.label, "input-label") : v}
|
|
3569
3575
|
<input
|
|
3570
|
-
class=${
|
|
3576
|
+
class=${D("moz-input", {
|
|
3571
3577
|
disabled: i.disabled,
|
|
3572
3578
|
"read-only": i.isReadOnly,
|
|
3573
3579
|
"has-inside-message": !w && i.messagePosition === "inside" && p !== "" && !o,
|
|
@@ -3588,7 +3594,7 @@ const Qs = /* @__PURE__ */ new Set([
|
|
|
3588
3594
|
${w && p !== "" && !o ? a`<div class="moz-input-invalid-icon-v2">
|
|
3589
3595
|
${e.slots.has("invalidTooltip") ? e.slot("invalidTooltip", { message: p }) : a`<div title=${p}>${Ro("var(--moz-color-danger)")}</div>`}
|
|
3590
3596
|
</div>` : v}
|
|
3591
|
-
${!w && p !== "" && !o ? a`<span class=${
|
|
3597
|
+
${!w && p !== "" && !o ? a`<span class=${D("moz-input-invalid-message", `position-${i.messagePosition}`)}
|
|
3592
3598
|
>${p}</span
|
|
3593
3599
|
>` : v}
|
|
3594
3600
|
</div>
|
|
@@ -3718,7 +3724,7 @@ const ol = /* @__PURE__ */ new Set([
|
|
|
3718
3724
|
const w = String(p.modelValue ?? ""), S = t.save || t.blur || t.change, I = !!p.useInvalidV2, C = p.width ? typeof p.width == "number" ? `${p.width}px` : p.width : "100%", y = Ce(p, ol);
|
|
3719
3725
|
return a`
|
|
3720
3726
|
<div
|
|
3721
|
-
class=${
|
|
3727
|
+
class=${D("moz-password-input-container", { "is-invalid": S !== "", disabled: p.disabled }, p.class)}
|
|
3722
3728
|
style=${X(ve(p.style))}
|
|
3723
3729
|
>
|
|
3724
3730
|
<div class="input-wrapper">
|
|
@@ -3727,7 +3733,7 @@ const ol = /* @__PURE__ */ new Set([
|
|
|
3727
3733
|
<input
|
|
3728
3734
|
autocomplete="new-password"
|
|
3729
3735
|
style="width:${C}"
|
|
3730
|
-
class=${
|
|
3736
|
+
class=${D("moz-input", sl, {
|
|
3731
3737
|
disabled: p.disabled,
|
|
3732
3738
|
"has-inside-message": !I && p.messagePosition === "inside" && S !== "" && !o,
|
|
3733
3739
|
"has-invalid-icon": I && S !== "" && !o
|
|
@@ -3747,7 +3753,7 @@ const ol = /* @__PURE__ */ new Set([
|
|
|
3747
3753
|
type="button"
|
|
3748
3754
|
aria-label=${l ? e.locale.PasswordInput.hidePassword : e.locale.PasswordInput.showPassword}
|
|
3749
3755
|
aria-pressed=${l ? "true" : "false"}
|
|
3750
|
-
class=${
|
|
3756
|
+
class=${D("icon-container password-icon", {
|
|
3751
3757
|
"cursor-pointer": !p.disabled,
|
|
3752
3758
|
"cursor-not-allowed": p.disabled
|
|
3753
3759
|
})}
|
|
@@ -3759,7 +3765,7 @@ const ol = /* @__PURE__ */ new Set([
|
|
|
3759
3765
|
${I && S !== "" && !o ? a`<div class="moz-input-invalid-icon-v2">
|
|
3760
3766
|
${e.slots.has("invalidTooltip") ? e.slot("invalidTooltip", { message: S }) : a`<div title=${S}>${Ro("var(--moz-color-danger)")}</div>`}
|
|
3761
3767
|
</div>` : v}
|
|
3762
|
-
${!I && S !== "" && !o ? a`<span class=${
|
|
3768
|
+
${!I && S !== "" && !o ? a`<span class=${D("moz-input-invalid-message", `position-${p.messagePosition}`)}
|
|
3763
3769
|
>${S}</span
|
|
3764
3770
|
>` : v}
|
|
3765
3771
|
</div>
|
|
@@ -3863,19 +3869,19 @@ const ol = /* @__PURE__ */ new Set([
|
|
|
3863
3869
|
const s = e.props, m = String(s.modelValue ?? ""), i = t.save || t.blur || t.change, u = s.width ? typeof s.width == "number" ? `${Le(s.width)}rem` : s.width : "100%", p = `${Le(s.height ?? 80)}rem`, w = s.resize ?? "none", S = w === "none" ? { height: p } : { minHeight: p }, I = m.length, C = Ce(s, nl);
|
|
3864
3870
|
return a`
|
|
3865
3871
|
<div
|
|
3866
|
-
class=${
|
|
3872
|
+
class=${D("moz-textarea-wrapper", { disabled: s.disabled }, s.class)}
|
|
3867
3873
|
style=${X({ width: u, ...S, ...ve(s.style) })}
|
|
3868
3874
|
>
|
|
3869
3875
|
<div class="textarea-inner">
|
|
3870
3876
|
${s.label ? Ke({ for: s.id, disabled: s.disabled, required: s.required }, s.label) : v}
|
|
3871
|
-
<div class=${
|
|
3877
|
+
<div class=${D("moz-textarea-box", { disabled: s.disabled, invalid: i !== "" })}>
|
|
3872
3878
|
<textarea
|
|
3873
3879
|
id=${Ee(s.id)}
|
|
3874
3880
|
${me(C)}
|
|
3875
3881
|
.value=${zt(m)}
|
|
3876
3882
|
?disabled=${!!s.disabled}
|
|
3877
3883
|
maxlength=${Ee(s.maxLength ?? void 0)}
|
|
3878
|
-
class=${
|
|
3884
|
+
class=${D("moz-textarea", { disabled: s.disabled })}
|
|
3879
3885
|
style=${X({
|
|
3880
3886
|
// 스타일시트의 `resize: none` 을 prop 값으로 덮는다. `'none'` 이면
|
|
3881
3887
|
// 인라인 값을 만들지 않아 종전과 동일하다.
|
|
@@ -4007,8 +4013,8 @@ const ul = /* @__PURE__ */ new Set([
|
|
|
4007
4013
|
return {
|
|
4008
4014
|
onMounted: (d) => e.emit("mounted", (d == null ? void 0 : d.querySelector("input")) ?? null),
|
|
4009
4015
|
render() {
|
|
4010
|
-
const d = e.props, s = d.modelValue, m = !!d.disabled, i = d.min, u = d.max, p = typeof d.width == "number" ? `${Le(d.width)}rem` : d.width, w = Ce(d, ul), S = (C) =>
|
|
4011
|
-
<div class=${
|
|
4016
|
+
const d = e.props, s = d.modelValue, m = !!d.disabled, i = d.min, u = d.max, p = typeof d.width == "number" ? `${Le(d.width)}rem` : d.width, w = Ce(d, ul), S = (C) => D("moz-button", "moz-icon-button", "moz-icon-accent-button", "num-change-btn", C), I = a`
|
|
4017
|
+
<div class=${D("moz-number-input", { "input-border": d.shortMode })}>
|
|
4012
4018
|
<input
|
|
4013
4019
|
name=${Ee(d.name)}
|
|
4014
4020
|
?disabled=${m}
|
|
@@ -4030,7 +4036,7 @@ const ul = /* @__PURE__ */ new Set([
|
|
|
4030
4036
|
</div>
|
|
4031
4037
|
`;
|
|
4032
4038
|
return a`
|
|
4033
|
-
<div class=${
|
|
4039
|
+
<div class=${D("moz-number-input-container", { disabled: m }, d.class)} style=${X(ve(d.style))}>
|
|
4034
4040
|
${d.label ? Ke(
|
|
4035
4041
|
{ disabled: m },
|
|
4036
4042
|
a`${d.label}${d.required ? a`<span class="require-mark">*</span>` : v}`
|
|
@@ -4126,12 +4132,12 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4126
4132
|
});
|
|
4127
4133
|
return a`
|
|
4128
4134
|
<div
|
|
4129
|
-
class=${
|
|
4135
|
+
class=${D("moz-tabs-container", { vertical: s.vertical }, s.class)}
|
|
4130
4136
|
style=${X(ve(s.style))}
|
|
4131
4137
|
${me(u)}
|
|
4132
4138
|
>
|
|
4133
4139
|
<div
|
|
4134
|
-
class=${
|
|
4140
|
+
class=${D("moz-tabs", { vertical: s.vertical })}
|
|
4135
4141
|
role="tablist"
|
|
4136
4142
|
aria-orientation=${s.vertical ? "vertical" : "horizontal"}
|
|
4137
4143
|
>
|
|
@@ -4139,7 +4145,7 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4139
4145
|
const S = i === w.id;
|
|
4140
4146
|
return a`
|
|
4141
4147
|
<div
|
|
4142
|
-
class=${
|
|
4148
|
+
class=${D("moz-tab", { "current-tab": S, vertical: s.vertical, closeable: s.closeAble })}
|
|
4143
4149
|
style=${p}
|
|
4144
4150
|
id=${o(w.id)}
|
|
4145
4151
|
role="tab"
|
|
@@ -4152,7 +4158,7 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4152
4158
|
}}
|
|
4153
4159
|
@keydown=${(I) => h(I, w.id)}
|
|
4154
4160
|
>
|
|
4155
|
-
${e.slots.has(`${w.id}-tab`) ? e.slot(`${w.id}-tab`, { text: w.text, active: S }) : a`<p class=${
|
|
4161
|
+
${e.slots.has(`${w.id}-tab`) ? e.slot(`${w.id}-tab`, { text: w.text, active: S }) : a`<p class=${D("tab-label", { active: S })}>${w.text}</p>`}
|
|
4156
4162
|
${s.closeAble ? a`<button type="button"
|
|
4157
4163
|
class="tab-close-btn"
|
|
4158
4164
|
aria-label=${e.locale.Tab.closeTab.replace("{label}", w.text ?? "")}
|
|
@@ -4170,7 +4176,7 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4170
4176
|
${m.map(
|
|
4171
4177
|
(w) => a`
|
|
4172
4178
|
<div
|
|
4173
|
-
class=${
|
|
4179
|
+
class=${D("tab-panel", { active: i === w.id })}
|
|
4174
4180
|
id=${l(w.id)}
|
|
4175
4181
|
role="tabpanel"
|
|
4176
4182
|
aria-labelledby=${o(w.id)}
|
|
@@ -4229,10 +4235,10 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4229
4235
|
render() {
|
|
4230
4236
|
const u = e.props, p = u.modelValue ?? 0, w = !!u.disabled, S = u.min, I = u.max, C = typeof u.width == "number" ? `${Le(u.width)}rem` : u.width, y = typeof u.width == "number" ? u.width : Number.isNaN(parseFloat(String(u.width))) ? 150 : parseFloat(String(u.width)), $ = (p - S) / (I - S) * (y - 18), V = $ < 0 ? 0 : $, U = Ce(u, gl);
|
|
4231
4237
|
return a`
|
|
4232
|
-
<div class=${
|
|
4238
|
+
<div class=${D("moz-slider-wrapper", u.class)} style=${X(ve(u.style))} ${me(U)}>
|
|
4233
4239
|
${u.label ? Ke({ for: u.id }, u.label) : v}
|
|
4234
4240
|
<div
|
|
4235
|
-
class=${
|
|
4241
|
+
class=${D("moz-slider-container", { disabled: w, label: !!u.label })}
|
|
4236
4242
|
role="slider"
|
|
4237
4243
|
aria-valuenow=${String(p ?? 0)}
|
|
4238
4244
|
aria-valuemin=${String(u.min ?? 0)}
|
|
@@ -4250,7 +4256,7 @@ const hl = /* @__PURE__ */ new Set(["itemSource", "vertical", "tabWidth", "maxTa
|
|
|
4250
4256
|
<div class="moz-slider-track" style="width:${Le(V + 10)}rem"></div>
|
|
4251
4257
|
</div>
|
|
4252
4258
|
<div
|
|
4253
|
-
class=${
|
|
4259
|
+
class=${D("moz-slider-handle", { focused: t && !w })}
|
|
4254
4260
|
style="left:${Le(V)}rem"
|
|
4255
4261
|
></div>
|
|
4256
4262
|
</div>
|
|
@@ -4344,20 +4350,20 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4344
4350
|
render() {
|
|
4345
4351
|
const $ = e.props;
|
|
4346
4352
|
$.modelValue !== o && (o = $.modelValue, t = $.modelValue ? xe($.modelValue) : xe());
|
|
4347
|
-
const V = $.rowHeight ?? 36, U = ["ko", "zh", "zh-cn"].includes(xe().locale()),
|
|
4353
|
+
const V = $.rowHeight ?? 36, U = ["ko", "zh", "zh-cn"].includes(xe().locale()), W = t.hour(), Z = t.minute(), ie = t.second(), fe = (M) => M.set("hour", W || 0).set("minute", Z || 0).set("second", ie || 0), le = Sl([0, 1, 2, 3, 4, 5, 6], ...$.exceptWeeks ?? []), A = [];
|
|
4348
4354
|
{
|
|
4349
4355
|
const M = fe(t.endOf("M"));
|
|
4350
4356
|
let x = fe(t.startOf("M")).startOf("w");
|
|
4351
4357
|
do
|
|
4352
|
-
|
|
4358
|
+
A.push(x), x = x.add(7, "d");
|
|
4353
4359
|
while (x.diff(M) <= 0);
|
|
4354
4360
|
}
|
|
4355
|
-
const
|
|
4356
|
-
|
|
4357
|
-
const
|
|
4361
|
+
const _ = V * A.length + 126;
|
|
4362
|
+
_ !== h && (h = _, queueMicrotask(() => e.emit("setMaxHeight", _)));
|
|
4363
|
+
const G = (M, x) => {
|
|
4358
4364
|
const q = M.add(x, "d");
|
|
4359
4365
|
return t.format("YYYYMMDD") !== q.format("YYYYMMDD") ? t.format("MM") === q.format("MM") ? "" : "moz-calendar-column-otherMonth" : "";
|
|
4360
|
-
},
|
|
4366
|
+
}, oe = $.modelValue ? xe($.modelValue).format("YYYYMMDD") : "", Q = (M, x, q) => a`<button
|
|
4361
4367
|
type="button"
|
|
4362
4368
|
aria-label=${q}
|
|
4363
4369
|
class="moz-button moz-icon-button"
|
|
@@ -4365,7 +4371,7 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4365
4371
|
@click=${x}
|
|
4366
4372
|
>
|
|
4367
4373
|
${M}
|
|
4368
|
-
</button>`,
|
|
4374
|
+
</button>`, B = a`
|
|
4369
4375
|
<div class="moz-calendar-header">
|
|
4370
4376
|
<div class="moz-calendar-select">
|
|
4371
4377
|
${U ? a`
|
|
@@ -4388,29 +4394,29 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4388
4394
|
)}${Q(Cl(), u, "다음 달")}
|
|
4389
4395
|
</div>
|
|
4390
4396
|
</div>
|
|
4391
|
-
`,
|
|
4397
|
+
`, se = a`
|
|
4392
4398
|
<div class="moz-calendar-row">
|
|
4393
|
-
${
|
|
4399
|
+
${le.map(
|
|
4394
4400
|
(M) => a`<div
|
|
4395
4401
|
class="moz-calendar-column moz-calendar-column-day"
|
|
4396
|
-
style="width: ${100 /
|
|
4402
|
+
style="width: ${100 / le.length}%; height: ${Le(V)}rem;"
|
|
4397
4403
|
>
|
|
4398
4404
|
${xe().day(M).format("ddd")}
|
|
4399
4405
|
</div>`
|
|
4400
4406
|
)}
|
|
4401
4407
|
</div>
|
|
4402
|
-
${
|
|
4408
|
+
${A.map(
|
|
4403
4409
|
(M) => a`<div class="moz-calendar-row">
|
|
4404
|
-
${
|
|
4410
|
+
${le.map((x) => {
|
|
4405
4411
|
const q = M.add(x, "d");
|
|
4406
4412
|
return a`<div
|
|
4407
|
-
class=${
|
|
4413
|
+
class=${D(
|
|
4408
4414
|
"moz-calendar-column",
|
|
4409
|
-
|
|
4410
|
-
|
|
4415
|
+
G(M, x),
|
|
4416
|
+
oe === q.format("YYYYMMDD") ? "moz-calendar-selected" : "",
|
|
4411
4417
|
d(q) ? "date-disable" : "moz-calendar-column--hoverable"
|
|
4412
4418
|
)}
|
|
4413
|
-
style="width: ${100 /
|
|
4419
|
+
style="width: ${100 / le.length}%; height: ${Le(V)}rem"
|
|
4414
4420
|
@click=${() => y(q)}
|
|
4415
4421
|
>
|
|
4416
4422
|
${q.format("DD")}
|
|
@@ -4419,20 +4425,20 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4419
4425
|
</div>`
|
|
4420
4426
|
)}
|
|
4421
4427
|
`;
|
|
4422
|
-
let
|
|
4428
|
+
let K = v;
|
|
4423
4429
|
if (n) {
|
|
4424
4430
|
const M = [], x = xe().add(100, "y").startOf("y");
|
|
4425
4431
|
let q = xe().subtract(100, "y").startOf("y");
|
|
4426
4432
|
do
|
|
4427
4433
|
M.push(q), q = q.add(1, "y");
|
|
4428
4434
|
while (q.diff(x) <= 0);
|
|
4429
|
-
|
|
4435
|
+
K = a`<div
|
|
4430
4436
|
class="moz-calendar-row moz-calendar-row--wrap"
|
|
4431
|
-
style="max-height: ${Le(V *
|
|
4437
|
+
style="max-height: ${Le(V * A.length)}rem"
|
|
4432
4438
|
>
|
|
4433
4439
|
${M.map(
|
|
4434
4440
|
(f) => a`<div
|
|
4435
|
-
class=${
|
|
4441
|
+
class=${D(
|
|
4436
4442
|
"moz-calendar-column",
|
|
4437
4443
|
t.format("YYYY") === f.format("YYYY") ? "moz-calendar-selected" : "",
|
|
4438
4444
|
s(f) ? "date-disable" : "moz-calendar-column--hoverable"
|
|
@@ -4455,7 +4461,7 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4455
4461
|
E = a`<div class="moz-calendar-row moz-calendar-row--wrap">
|
|
4456
4462
|
${M.map(
|
|
4457
4463
|
(f) => a`<div
|
|
4458
|
-
class=${
|
|
4464
|
+
class=${D(
|
|
4459
4465
|
"moz-calendar-column",
|
|
4460
4466
|
t.format("YYYYMM") === f.format("YYYYMM") ? "moz-calendar-selected" : "",
|
|
4461
4467
|
m(f) ? "date-disable" : "moz-calendar-column--hoverable"
|
|
@@ -4470,8 +4476,8 @@ const $l = /* @__PURE__ */ new Set(["rowHeight", "exceptWeeks", "min", "max", "m
|
|
|
4470
4476
|
}
|
|
4471
4477
|
const k = Ce($, $l);
|
|
4472
4478
|
return a`
|
|
4473
|
-
<div class=${
|
|
4474
|
-
${
|
|
4479
|
+
<div class=${D("moz-calendar-container", $.class)} style=${X(ve($.style))} ${me(k)}>
|
|
4480
|
+
${B}${l ? se : v}${K}${E}
|
|
4475
4481
|
</div>
|
|
4476
4482
|
`;
|
|
4477
4483
|
}
|
|
@@ -4575,29 +4581,29 @@ const zl = "YYYY-MM-DD", xl = /* @__PURE__ */ new Set([
|
|
|
4575
4581
|
const C = e.props;
|
|
4576
4582
|
if (C.modelValue !== l) {
|
|
4577
4583
|
l = C.modelValue;
|
|
4578
|
-
const
|
|
4579
|
-
queueMicrotask(() => e.emit("change",
|
|
4584
|
+
const ie = C.modelValue;
|
|
4585
|
+
queueMicrotask(() => e.emit("change", ie)), r && r.update({ modelValue: C.modelValue });
|
|
4580
4586
|
}
|
|
4581
|
-
const y = C.format || zl, P = typeof C.width == "number" ? `${Le(C.width)}rem` : C.width, $ = C.modelValue ? xe(C.modelValue).format(y) : "", V = !!C.min && xe($).isSameOrBefore(xe(C.min), "day"), U = !!C.max && xe($).isSameOrAfter(xe(C.max), "day"),
|
|
4587
|
+
const y = C.format || zl, P = typeof C.width == "number" ? `${Le(C.width)}rem` : C.width, $ = C.modelValue ? xe(C.modelValue).format(y) : "", V = !!C.min && xe($).isSameOrBefore(xe(C.min), "day"), U = !!C.max && xe($).isSameOrAfter(xe(C.max), "day"), W = Ce(C, xl), Z = (ie, fe, le, A) => a`<button
|
|
4582
4588
|
type="button"
|
|
4583
4589
|
aria-label=${fe === "left" ? e.locale.DateInput.prevDate : e.locale.DateInput.nextDate}
|
|
4584
|
-
class=${
|
|
4590
|
+
class=${D(
|
|
4585
4591
|
"moz-button",
|
|
4586
4592
|
"moz-icon-button",
|
|
4587
4593
|
"moz-icon-accent-button",
|
|
4588
4594
|
"moz-icon-text-button",
|
|
4589
4595
|
"date-move-btn",
|
|
4590
4596
|
`date-move-btn--${fe}`,
|
|
4591
|
-
{ "date-move-btn--disabled":
|
|
4597
|
+
{ "date-move-btn--disabled": le }
|
|
4592
4598
|
)}
|
|
4593
|
-
?disabled=${
|
|
4594
|
-
@click=${
|
|
4599
|
+
?disabled=${le}
|
|
4600
|
+
@click=${A}
|
|
4595
4601
|
>
|
|
4596
|
-
${
|
|
4602
|
+
${ie}
|
|
4597
4603
|
</button>`;
|
|
4598
4604
|
return a`
|
|
4599
4605
|
<div
|
|
4600
|
-
class=${
|
|
4606
|
+
class=${D("moz-date-input-container", { disabled: C.disabled }, C.class)}
|
|
4601
4607
|
style=${X({ ...ve(C.style), width: P })}
|
|
4602
4608
|
>
|
|
4603
4609
|
${C.label ? Ke(
|
|
@@ -4612,7 +4618,7 @@ const zl = "YYYY-MM-DD", xl = /* @__PURE__ */ new Set([
|
|
|
4612
4618
|
w
|
|
4613
4619
|
) : v}
|
|
4614
4620
|
<div
|
|
4615
|
-
class=${
|
|
4621
|
+
class=${D("moz-date-input", {
|
|
4616
4622
|
"moz-date-input--no-lr-border": C.showSpin,
|
|
4617
4623
|
"moz-date-input--radius": !C.showSpin,
|
|
4618
4624
|
"moz-date-input--disabled": C.disabled
|
|
@@ -4624,14 +4630,14 @@ const zl = "YYYY-MM-DD", xl = /* @__PURE__ */ new Set([
|
|
|
4624
4630
|
name=${Ee(C.name)}
|
|
4625
4631
|
?disabled=${!!C.disabled}
|
|
4626
4632
|
?readonly=${!!C.readonly}
|
|
4627
|
-
class=${
|
|
4628
|
-
${me(
|
|
4633
|
+
class=${D("moz-date-input__field", { "moz-date-input__field--disabled": C.disabled })}
|
|
4634
|
+
${me(W)}
|
|
4629
4635
|
@change=${I}
|
|
4630
4636
|
/>
|
|
4631
4637
|
${C.readonly ? v : a`<div class="moz-date-input__icon-container">
|
|
4632
4638
|
${Pl(
|
|
4633
4639
|
"currentColor",
|
|
4634
|
-
|
|
4640
|
+
D("moz-date-input__icon", { "moz-date-input__icon--disabled": C.disabled })
|
|
4635
4641
|
)}
|
|
4636
4642
|
</div>`}
|
|
4637
4643
|
</div>
|
|
@@ -4850,40 +4856,40 @@ const Il = () => {
|
|
|
4850
4856
|
const P = !0;
|
|
4851
4857
|
let $ = null;
|
|
4852
4858
|
const V = { mouseDown: !1, dragging: !1, offset: { x: 0, y: 0 } };
|
|
4853
|
-
let U = m(),
|
|
4854
|
-
const
|
|
4859
|
+
let U = m(), W = !1, Z = !1, ie = null, fe = [];
|
|
4860
|
+
const le = () => {
|
|
4855
4861
|
const z = t.value;
|
|
4856
4862
|
if (z)
|
|
4857
4863
|
for (const pe of Array.from(document.body.children))
|
|
4858
4864
|
pe instanceof HTMLElement && (pe.contains(z) || pe.getAttribute("aria-hidden") !== "true" && (pe.setAttribute("aria-hidden", "true"), fe.push(pe)));
|
|
4859
|
-
},
|
|
4865
|
+
}, A = () => {
|
|
4860
4866
|
for (const z of fe) z.removeAttribute("aria-hidden");
|
|
4861
4867
|
fe = [];
|
|
4862
|
-
},
|
|
4868
|
+
}, _ = () => {
|
|
4863
4869
|
const z = t.value;
|
|
4864
4870
|
return z ? Array.from(z.querySelectorAll(Rl)).filter(
|
|
4865
4871
|
(pe) => pe.getAttribute("aria-hidden") !== "true"
|
|
4866
4872
|
) : [];
|
|
4867
|
-
},
|
|
4873
|
+
}, G = () => {
|
|
4868
4874
|
const z = document.querySelectorAll(".moz-popup");
|
|
4869
4875
|
return z.length > 0 && z[z.length - 1] === t.value;
|
|
4870
|
-
},
|
|
4876
|
+
}, oe = () => {
|
|
4871
4877
|
r || (r = Po(() => N()));
|
|
4872
4878
|
}, Q = () => {
|
|
4873
4879
|
r == null || r.release(), r = null;
|
|
4874
|
-
},
|
|
4875
|
-
|
|
4880
|
+
}, B = () => {
|
|
4881
|
+
W || (W = !0, oe(), e.props.lockScroll && (Il(), Z = !0), e.props.focusTrap && (ie = document.activeElement instanceof HTMLElement ? document.activeElement : null, queueMicrotask(() => {
|
|
4876
4882
|
const z = t.value;
|
|
4877
|
-
!z || !m() || (
|
|
4883
|
+
!z || !m() || (_()[0] ?? z).focus();
|
|
4878
4884
|
})), e.props.hideOthers && queueMicrotask(() => {
|
|
4879
|
-
m() &&
|
|
4885
|
+
m() && le();
|
|
4880
4886
|
}));
|
|
4881
|
-
},
|
|
4882
|
-
if (Q(), !
|
|
4883
|
-
|
|
4884
|
-
const z =
|
|
4885
|
-
|
|
4886
|
-
},
|
|
4887
|
+
}, se = () => {
|
|
4888
|
+
if (Q(), !W) return;
|
|
4889
|
+
W = !1, Z && (Fl(), Z = !1), A();
|
|
4890
|
+
const z = ie;
|
|
4891
|
+
ie = null, z && z.isConnected && z.focus();
|
|
4892
|
+
}, K = () => {
|
|
4887
4893
|
const z = t.value;
|
|
4888
4894
|
if (!z) return;
|
|
4889
4895
|
const pe = e.props, De = pe.top != null ? pe.top : window.innerHeight / 2 - z.offsetHeight / 2, Ne = pe.left != null ? pe.left : window.innerWidth / 2 - z.offsetWidth / 2;
|
|
@@ -4894,16 +4900,16 @@ const Il = () => {
|
|
|
4894
4900
|
if (typeof ResizeObserver > "u") return;
|
|
4895
4901
|
const z = t.value;
|
|
4896
4902
|
!z || z === k || (E ?? (E = new ResizeObserver(() => {
|
|
4897
|
-
!m() || e.props.side || e.props.autoPosition === !1 || y ||
|
|
4903
|
+
!m() || e.props.side || e.props.autoPosition === !1 || y || K();
|
|
4898
4904
|
})), k && E.unobserve(k), E.observe(z), k = z);
|
|
4899
4905
|
}, x = () => {
|
|
4900
4906
|
e.props.side || e.props.autoPosition === !1 || queueMicrotask(() => {
|
|
4901
|
-
|
|
4907
|
+
K(), M();
|
|
4902
4908
|
});
|
|
4903
4909
|
}, q = () => {
|
|
4904
4910
|
!m() || e.props.side || e.props.autoPosition === !1 || y || x();
|
|
4905
4911
|
}, f = () => {
|
|
4906
|
-
m() || i(!0), e.emit("open"), x(),
|
|
4912
|
+
m() || i(!0), e.emit("open"), x(), B();
|
|
4907
4913
|
}, R = async () => {
|
|
4908
4914
|
let z = !0;
|
|
4909
4915
|
return e.props.onBeforeClose ? z = await e.props.onBeforeClose() ?? !0 : e.emit("close:before", z), z;
|
|
@@ -4919,7 +4925,7 @@ const Il = () => {
|
|
|
4919
4925
|
}, je = () => {
|
|
4920
4926
|
e.props.closeOnOutsideClick && N();
|
|
4921
4927
|
}, He = (z) => {
|
|
4922
|
-
z ? f() : (
|
|
4928
|
+
z ? f() : (se(), Ve(), N());
|
|
4923
4929
|
}, c = (z, pe) => {
|
|
4924
4930
|
document.addEventListener("mouseup", z), document.addEventListener("mousemove", pe);
|
|
4925
4931
|
}, T = (z, pe) => {
|
|
@@ -4944,24 +4950,24 @@ const Il = () => {
|
|
|
4944
4950
|
const De = pe.getBoundingClientRect(), Ne = u() ?? De.width, Ge = w() ?? De.height;
|
|
4945
4951
|
if (!Ne || !Ge) return;
|
|
4946
4952
|
const Re = Ne / Ge, Ue = { x: z.clientX, y: z.clientY }, _e = e.props, g = (F) => {
|
|
4947
|
-
let
|
|
4953
|
+
let J = F.clientX - Ue.x, ee = F.clientY - Ue.y;
|
|
4948
4954
|
if (_e.keepAspectRatio) {
|
|
4949
|
-
const ye =
|
|
4950
|
-
Math.abs(
|
|
4955
|
+
const ye = J / Re;
|
|
4956
|
+
Math.abs(ee) > Math.abs(ye) ? ee = ye : J = ee * Re;
|
|
4951
4957
|
}
|
|
4952
|
-
const he = Math.max(_e.minWidth, Math.min(Ne +
|
|
4953
|
-
let we = Math.max(_e.minHeight, Math.min(Ge +
|
|
4958
|
+
const he = Math.max(_e.minWidth, Math.min(Ne + J, _e.maxWidth));
|
|
4959
|
+
let we = Math.max(_e.minHeight, Math.min(Ge + ee, _e.maxHeight));
|
|
4954
4960
|
_e.keepAspectRatio && he / we !== Re && (we = he / Re), p(he), S(we);
|
|
4955
4961
|
}, H = () => {
|
|
4956
4962
|
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", H);
|
|
4957
4963
|
};
|
|
4958
4964
|
document.addEventListener("mousemove", g), document.addEventListener("mouseup", H);
|
|
4959
|
-
},
|
|
4960
|
-
if (z.key === "Tab" && e.props.focusTrap && m() &&
|
|
4965
|
+
}, te = (z) => {
|
|
4966
|
+
if (z.key === "Tab" && e.props.focusTrap && m() && G()) {
|
|
4961
4967
|
if (r && !r.isTopmost()) return;
|
|
4962
4968
|
const pe = t.value;
|
|
4963
4969
|
if (!pe) return;
|
|
4964
|
-
const De =
|
|
4970
|
+
const De = _();
|
|
4965
4971
|
if (De.length === 0) {
|
|
4966
4972
|
z.preventDefault(), pe.focus();
|
|
4967
4973
|
return;
|
|
@@ -4972,7 +4978,7 @@ const Il = () => {
|
|
|
4972
4978
|
}
|
|
4973
4979
|
};
|
|
4974
4980
|
e.onCleanup(() => {
|
|
4975
|
-
E == null || E.disconnect(), E = null, k = null,
|
|
4981
|
+
E == null || E.disconnect(), E = null, k = null, se(), window.removeEventListener("keydown", te), window.removeEventListener("resize", q), Ve(), window.removeEventListener("unload", Ve), T(ze, ue);
|
|
4976
4982
|
});
|
|
4977
4983
|
const Te = () => {
|
|
4978
4984
|
const z = e.props;
|
|
@@ -5006,13 +5012,13 @@ const Il = () => {
|
|
|
5006
5012
|
return {
|
|
5007
5013
|
api: { resetPosition: x },
|
|
5008
5014
|
onMounted: () => {
|
|
5009
|
-
window.addEventListener("keydown",
|
|
5015
|
+
window.addEventListener("keydown", te), window.addEventListener("resize", q), window.addEventListener("unload", Ve), queueMicrotask(() => e.emit("init", o.value ?? null)), m() && (x(), B());
|
|
5010
5016
|
},
|
|
5011
5017
|
render() {
|
|
5012
5018
|
const z = e.props, pe = m();
|
|
5013
5019
|
if (pe !== U) {
|
|
5014
5020
|
const Qe = pe;
|
|
5015
|
-
U = pe, Qe ?
|
|
5021
|
+
U = pe, Qe ? oe() : Q(), queueMicrotask(() => He(Qe));
|
|
5016
5022
|
}
|
|
5017
5023
|
if (!(z.useVShow ? !0 : pe)) return v;
|
|
5018
5024
|
const Ne = z.useVShow ? !pe : !1, Ge = u(), Re = w(), Ue = z.side, _e = !!Ue || z.autoPosition === !1, g = {
|
|
@@ -5022,27 +5028,27 @@ const Il = () => {
|
|
|
5022
5028
|
...Ge ? { width: `${Le(Ge)}rem` } : {},
|
|
5023
5029
|
...Re ? { height: `${Le(Re)}rem` } : {},
|
|
5024
5030
|
..._e ? {} : { left: `${Le(I)}rem`, top: `${Le(C)}rem` }
|
|
5025
|
-
}, H = !!z.draggable && !_e, F = !!z.resizeable && !Ue,
|
|
5031
|
+
}, H = !!z.draggable && !_e, F = !!z.resizeable && !Ue, J = typeof z.contentsPadding == "number" ? `${Le(z.contentsPadding)}rem` : z.contentsPadding, ee = Te(), he = Ce(z, ql), we = e.slots.has("title") ? e.slot("title") : a`<span class="truncate">${z.title}</span>`, ye = e.slots.has("description"), Me = e.slots.has("default") ? e.slot("default") : a`<div class="moz-dialog-body">
|
|
5026
5032
|
${Ae(z.dialogIcon)}
|
|
5027
5033
|
<div class="dialog-message">${z.dialogMessage != null ? ko(z.dialogMessage) : v}</div>
|
|
5028
5034
|
</div>`, We = e.slots.has("footer") ? e.slot("footer", { onConfirm: ke, onCancel: N }) : a`
|
|
5029
|
-
${
|
|
5035
|
+
${ee.positive ? yt(
|
|
5030
5036
|
{
|
|
5031
5037
|
class: "preset-btn",
|
|
5032
5038
|
loading: z.loading,
|
|
5033
5039
|
disabled: z.disabledConfirmButton,
|
|
5034
5040
|
style: "min-width: 80px"
|
|
5035
5041
|
},
|
|
5036
|
-
{ onClick: ke, content:
|
|
5042
|
+
{ onClick: ke, content: ee.positive }
|
|
5037
5043
|
) : v}
|
|
5038
|
-
${
|
|
5044
|
+
${ee.negative ? yt(
|
|
5039
5045
|
{ class: "preset-btn", type: "outline", disabled: z.loading, style: "min-width: 80px" },
|
|
5040
|
-
{ onClick: N, content:
|
|
5046
|
+
{ onClick: N, content: ee.negative }
|
|
5041
5047
|
) : v}
|
|
5042
5048
|
`;
|
|
5043
5049
|
return a`
|
|
5044
5050
|
<div
|
|
5045
|
-
class=${
|
|
5051
|
+
class=${D(
|
|
5046
5052
|
"moz-popup-container",
|
|
5047
5053
|
z.class,
|
|
5048
5054
|
Ue ? `moz-popup-side moz-popup-side-${Ue}` : null,
|
|
@@ -5052,19 +5058,19 @@ const Il = () => {
|
|
|
5052
5058
|
>
|
|
5053
5059
|
${z.showBackdrop === !1 ? v : a`<div class="moz-popup-backdrop" aria-hidden="true" @click=${je}></div>`}
|
|
5054
5060
|
<div
|
|
5055
|
-
class=${
|
|
5061
|
+
class=${D("moz-popup", z.dialogClass)}
|
|
5056
5062
|
role="dialog"
|
|
5057
5063
|
aria-modal="true"
|
|
5058
5064
|
aria-labelledby=${Ee(z.showHeader === !1 ? void 0 : l)}
|
|
5059
5065
|
aria-describedby=${Ee(ye ? n : void 0)}
|
|
5060
5066
|
tabindex=${Ee(z.focusTrap ? "-1" : void 0)}
|
|
5061
5067
|
style=${X(g)}
|
|
5062
|
-
${
|
|
5068
|
+
${ne(t)}
|
|
5063
5069
|
${me(he)}
|
|
5064
5070
|
>
|
|
5065
5071
|
${z.showHeader === !1 ? v : a`<div
|
|
5066
5072
|
id=${l}
|
|
5067
|
-
class=${
|
|
5073
|
+
class=${D("moz-popup-title", { draggable: H })}
|
|
5068
5074
|
@mousedown=${Pe}
|
|
5069
5075
|
@touchstart=${Pe}
|
|
5070
5076
|
>
|
|
@@ -5075,8 +5081,8 @@ const Il = () => {
|
|
|
5075
5081
|
) : v}
|
|
5076
5082
|
</div>`}
|
|
5077
5083
|
${ye ? a`<div id=${n} class="moz-popup-description">${e.slot("description")}</div>` : v}
|
|
5078
|
-
<div class="moz-popup-body" style=${X({ padding:
|
|
5079
|
-
${z.preset !== "no-footer" ? a`<div class=${
|
|
5084
|
+
<div class="moz-popup-body" style=${X({ padding: J })} ${ne(o)}>${Me}</div>
|
|
5085
|
+
${z.preset !== "no-footer" ? a`<div class=${D("moz-popup-footer", { "with-border": z.showFooterBorder })}>
|
|
5080
5086
|
${We}
|
|
5081
5087
|
</div>` : v}
|
|
5082
5088
|
${F ? a`<div class="resize-handler" @mousedown=${ce}></div>` : v}
|
|
@@ -5292,7 +5298,7 @@ const Ul = $e({
|
|
|
5292
5298
|
onChange: () => e.requestUpdate()
|
|
5293
5299
|
});
|
|
5294
5300
|
e.onCleanup(() => {
|
|
5295
|
-
|
|
5301
|
+
B == null || B.release(), B = null;
|
|
5296
5302
|
}), e.onCleanup(y._didMount());
|
|
5297
5303
|
const P = (c) => {
|
|
5298
5304
|
d = c ?? null, c && (y._willUpdate(), e.requestUpdate());
|
|
@@ -5301,7 +5307,7 @@ const Ul = $e({
|
|
|
5301
5307
|
if (!c && isNaN(Number(c))) return null;
|
|
5302
5308
|
const T = e.props.useObjBinding ? c : $(c);
|
|
5303
5309
|
return T ? typeof e.props.displayProp == "function" ? e.props.displayProp(T) : T[e.props.displayProp] : null;
|
|
5304
|
-
},
|
|
5310
|
+
}, W = () => {
|
|
5305
5311
|
if (!p) return e.props.itemsSource ?? [];
|
|
5306
5312
|
const c = p.toLowerCase();
|
|
5307
5313
|
return (e.props.itemsSource ?? []).filter((T) => V(T).toLowerCase().indexOf(c) > -1);
|
|
@@ -5312,14 +5318,14 @@ const Ul = $e({
|
|
|
5312
5318
|
part: re,
|
|
5313
5319
|
highlight: p.toLowerCase() === re.toLowerCase()
|
|
5314
5320
|
}));
|
|
5315
|
-
},
|
|
5321
|
+
}, ie = () => S.save || S.blur || S.change, fe = () => {
|
|
5316
5322
|
const c = [];
|
|
5317
5323
|
return e.props.required && c.push({
|
|
5318
5324
|
message: e.props.requiredMessage ?? e.locale.Select.requiredMessage.replace("{label}", e.props.label || ""),
|
|
5319
5325
|
type: "save",
|
|
5320
5326
|
validator: (T) => !!T
|
|
5321
5327
|
}), [...c, ...e.props.rules ?? []];
|
|
5322
|
-
},
|
|
5328
|
+
}, le = async (c, T) => {
|
|
5323
5329
|
const Y = fe();
|
|
5324
5330
|
if (Y.length <= 0 || e.props.disabled) return !0;
|
|
5325
5331
|
S[T] = "", e.requestUpdate();
|
|
@@ -5328,17 +5334,17 @@ const Ul = $e({
|
|
|
5328
5334
|
if (!await ue.validator(c))
|
|
5329
5335
|
return S[T] = ue.message, e.requestUpdate(), !1;
|
|
5330
5336
|
return !0;
|
|
5331
|
-
},
|
|
5332
|
-
validate:
|
|
5337
|
+
}, A = async (c = "save") => ie() !== "" ? !1 : await le(m(), c), _ = {
|
|
5338
|
+
validate: A,
|
|
5333
5339
|
initValidator: () => {
|
|
5334
5340
|
S.change = "", S.blur = "", S.save = "", e.requestUpdate();
|
|
5335
5341
|
}
|
|
5336
5342
|
};
|
|
5337
|
-
e.validator && (e.validator.addValidator(
|
|
5343
|
+
e.validator && (e.validator.addValidator(_), e.onCleanup(() => {
|
|
5338
5344
|
var c;
|
|
5339
|
-
return (c = e.validator) == null ? void 0 : c.removeValidator(
|
|
5345
|
+
return (c = e.validator) == null ? void 0 : c.removeValidator(_);
|
|
5340
5346
|
}));
|
|
5341
|
-
const
|
|
5347
|
+
const G = new At({
|
|
5342
5348
|
anchor: () => o.value ?? null,
|
|
5343
5349
|
panel: () => l.value ?? null,
|
|
5344
5350
|
maxHeight: () => io,
|
|
@@ -5347,19 +5353,19 @@ const Ul = $e({
|
|
|
5347
5353
|
listWidth: () => e.props.listWidth,
|
|
5348
5354
|
ignoreScrollTargets: (c) => c === d,
|
|
5349
5355
|
requestClose: () => {
|
|
5350
|
-
u &&
|
|
5356
|
+
u && se(!1);
|
|
5351
5357
|
}
|
|
5352
5358
|
});
|
|
5353
|
-
e.onCleanup(() =>
|
|
5354
|
-
const
|
|
5355
|
-
`${c.ctrlKey ? "ctrl+" : ""}${c.altKey ? "alt+" : ""}${c.key.toLowerCase()}` === "escape" &&
|
|
5359
|
+
e.onCleanup(() => G.destroy());
|
|
5360
|
+
const oe = (c) => {
|
|
5361
|
+
`${c.ctrlKey ? "ctrl+" : ""}${c.altKey ? "alt+" : ""}${c.key.toLowerCase()}` === "escape" && se(!1);
|
|
5356
5362
|
}, Q = (c) => {
|
|
5357
5363
|
const Y = at * c - io / 2;
|
|
5358
5364
|
return Math.max(0, Y + at);
|
|
5359
5365
|
};
|
|
5360
|
-
let
|
|
5361
|
-
const
|
|
5362
|
-
u !== c && (u = c, e.requestUpdate(), c ? (
|
|
5366
|
+
let B = null;
|
|
5367
|
+
const se = (c) => {
|
|
5368
|
+
u !== c && (u = c, e.requestUpdate(), c ? (B = Dt(), G.open(), S.save = "", window.addEventListener("keydown", oe), queueMicrotask(() => {
|
|
5363
5369
|
var Y;
|
|
5364
5370
|
const T = m();
|
|
5365
5371
|
if (T && d) {
|
|
@@ -5367,19 +5373,19 @@ const Ul = $e({
|
|
|
5367
5373
|
d.scrollTop = Q(re);
|
|
5368
5374
|
}
|
|
5369
5375
|
h.value ? h.value.focus() : (Y = r.value) == null || Y.focus();
|
|
5370
|
-
})) : (
|
|
5376
|
+
})) : (B == null || B.release(), B = null, G.close(), e.emit("close"), le(m(), "blur"), window.removeEventListener("keydown", oe), p = "", e.emit("close"), queueMicrotask(() => {
|
|
5371
5377
|
var T;
|
|
5372
5378
|
return (T = r.value) == null ? void 0 : T.focus();
|
|
5373
5379
|
})));
|
|
5374
|
-
},
|
|
5380
|
+
}, K = () => {
|
|
5375
5381
|
var c;
|
|
5376
|
-
e.props.disabled || (
|
|
5382
|
+
e.props.disabled || (se(!u), (c = r.value) == null || c.focus());
|
|
5377
5383
|
}, E = (c) => {
|
|
5378
5384
|
var T;
|
|
5379
|
-
i(c),
|
|
5385
|
+
i(c), se(!1), (T = r.value) == null || T.focus();
|
|
5380
5386
|
}, k = Hl((c) => {
|
|
5381
5387
|
p = c.target.value, e.requestUpdate(), queueMicrotask(() => {
|
|
5382
|
-
const T =
|
|
5388
|
+
const T = W().length;
|
|
5383
5389
|
y.setOptions({ ...y.options, count: T }), y.measure(), d && (d.scrollTop = 0, y.scrollToIndex(0), y.measure());
|
|
5384
5390
|
});
|
|
5385
5391
|
}, 300), M = (c) => {
|
|
@@ -5408,7 +5414,7 @@ const Ul = $e({
|
|
|
5408
5414
|
const Y = T.indexOf(document.activeElement), re = Y < 0 ? c > 0 ? 0 : T.length - 1 : Math.min(T.length - 1, Math.max(0, Y + c));
|
|
5409
5415
|
(ue = T[re]) == null || ue.focus();
|
|
5410
5416
|
}, N = (c) => c.find((T) => T.getAttribute("aria-selected") === "true") ?? null, j = (c) => {
|
|
5411
|
-
|
|
5417
|
+
se(!0), queueMicrotask(
|
|
5412
5418
|
() => queueMicrotask(() => {
|
|
5413
5419
|
if (h.value) return;
|
|
5414
5420
|
const T = f();
|
|
@@ -5417,7 +5423,7 @@ const Ul = $e({
|
|
|
5417
5423
|
);
|
|
5418
5424
|
}, ke = () => {
|
|
5419
5425
|
var c;
|
|
5420
|
-
|
|
5426
|
+
se(!1), (c = r.value) == null || c.focus();
|
|
5421
5427
|
}, Ve = (c) => {
|
|
5422
5428
|
if (c.key === "Tab") {
|
|
5423
5429
|
M(c);
|
|
@@ -5460,7 +5466,7 @@ const Ul = $e({
|
|
|
5460
5466
|
(c.key === "Enter" || c.key === " ") && E(T);
|
|
5461
5467
|
};
|
|
5462
5468
|
return {
|
|
5463
|
-
api: { validate:
|
|
5469
|
+
api: { validate: A },
|
|
5464
5470
|
// 트리거(제자리) — 드롭다운은 renderPortal 로 body 포털에 분리(조상 transform 탈출)
|
|
5465
5471
|
render() {
|
|
5466
5472
|
const c = e.props, T = m();
|
|
@@ -5468,7 +5474,7 @@ const Ul = $e({
|
|
|
5468
5474
|
I = T;
|
|
5469
5475
|
const Te = T;
|
|
5470
5476
|
queueMicrotask(() => {
|
|
5471
|
-
|
|
5477
|
+
le(Te, "change"), e.emit(
|
|
5472
5478
|
"change",
|
|
5473
5479
|
c.useObjBinding ? Te : Te && Te[C()],
|
|
5474
5480
|
Te
|
|
@@ -5485,18 +5491,18 @@ const Ul = $e({
|
|
|
5485
5491
|
aria-controls=${w}
|
|
5486
5492
|
aria-label=${Ee(ue["aria-label"] ?? c.label ?? void 0)}
|
|
5487
5493
|
@keydown=${Ve}
|
|
5488
|
-
${
|
|
5494
|
+
${ne(r)}
|
|
5489
5495
|
?disabled=${!!c.disabled}
|
|
5490
5496
|
>
|
|
5491
5497
|
${Pe}
|
|
5492
|
-
</button>`,
|
|
5498
|
+
</button>`, te = e.slots.has("input-container") ? a`<div
|
|
5493
5499
|
class="moz-input-container select-input-container"
|
|
5494
5500
|
style=${X({ width: Y })}
|
|
5495
|
-
@click=${
|
|
5496
|
-
${
|
|
5501
|
+
@click=${K}
|
|
5502
|
+
${ne(o)}
|
|
5497
5503
|
>
|
|
5498
5504
|
<div
|
|
5499
|
-
class=${
|
|
5505
|
+
class=${D("input-container-wrapper", { "input-container-wrapper--disabled": c.disabled })}
|
|
5500
5506
|
>
|
|
5501
5507
|
${e.slot("input-container", { text: U(), item: T })}
|
|
5502
5508
|
</div>
|
|
@@ -5504,8 +5510,8 @@ const Ul = $e({
|
|
|
5504
5510
|
</div>` : a`<div
|
|
5505
5511
|
class="moz-input-container select-input-container"
|
|
5506
5512
|
style=${X({ width: Y })}
|
|
5507
|
-
@click=${
|
|
5508
|
-
${
|
|
5513
|
+
@click=${K}
|
|
5514
|
+
${ne(o)}
|
|
5509
5515
|
>
|
|
5510
5516
|
<input
|
|
5511
5517
|
${me(ze)}
|
|
@@ -5515,17 +5521,17 @@ const Ul = $e({
|
|
|
5515
5521
|
?disabled=${!!c.disabled}
|
|
5516
5522
|
readonly
|
|
5517
5523
|
tabindex="-1"
|
|
5518
|
-
class=${
|
|
5524
|
+
class=${D("select-display-input", { "select-display-input--disabled": c.disabled })}
|
|
5519
5525
|
/>
|
|
5520
5526
|
${e.slot("input")}
|
|
5521
5527
|
${ce}
|
|
5522
5528
|
</div>`;
|
|
5523
5529
|
return a`
|
|
5524
5530
|
<div
|
|
5525
|
-
class=${
|
|
5531
|
+
class=${D(
|
|
5526
5532
|
"moz-select",
|
|
5527
5533
|
{
|
|
5528
|
-
"is-invalid":
|
|
5534
|
+
"is-invalid": ie() !== "",
|
|
5529
5535
|
"is-open": u,
|
|
5530
5536
|
disabled: !!c.disabled
|
|
5531
5537
|
},
|
|
@@ -5535,21 +5541,21 @@ const Ul = $e({
|
|
|
5535
5541
|
c.class
|
|
5536
5542
|
)}
|
|
5537
5543
|
style=${X(ve(c.style))}
|
|
5538
|
-
${
|
|
5544
|
+
${ne(t)}
|
|
5539
5545
|
>
|
|
5540
5546
|
<div class="input-wrapper">
|
|
5541
5547
|
${c.label ? Ke({ disabled: c.disabled, required: c.required }, c.label) : v}
|
|
5542
|
-
${
|
|
5548
|
+
${te}
|
|
5543
5549
|
</div>
|
|
5544
5550
|
|
|
5545
|
-
${
|
|
5551
|
+
${ie() !== "" ? a`<span class="moz-input-invalid-message">${ie()}</span>` : v}
|
|
5546
5552
|
</div>
|
|
5547
5553
|
`;
|
|
5548
5554
|
},
|
|
5549
5555
|
// 드롭다운(.list-box) — body 포털. Overlay 가 position:fixed 로 배치(뷰포트 기준, transform 무관).
|
|
5550
5556
|
renderPortal() {
|
|
5551
5557
|
if (!u) return v;
|
|
5552
|
-
const c = e.props, T = m(), Y = C(), re =
|
|
5558
|
+
const c = e.props, T = m(), Y = C(), re = W();
|
|
5553
5559
|
y.options.count !== re.length && y.setOptions({ ...y.options, count: re.length }), y._willUpdate();
|
|
5554
5560
|
const ue = Vt(
|
|
5555
5561
|
y.getVirtualItems(),
|
|
@@ -5558,17 +5564,17 @@ const Ul = $e({
|
|
|
5558
5564
|
d
|
|
5559
5565
|
), ze = y.getTotalSize(), Pe = ue.map((ce) => {
|
|
5560
5566
|
if (ce.index >= re.length) return null;
|
|
5561
|
-
const
|
|
5562
|
-
return
|
|
5567
|
+
const te = re[ce.index];
|
|
5568
|
+
return te ? { index: ce.index, value: te, size: ce.size, start: ce.start } : null;
|
|
5563
5569
|
}).filter((ce) => ce !== null);
|
|
5564
5570
|
return a`<div
|
|
5565
|
-
class=${
|
|
5571
|
+
class=${D("list-box moz-select-list", { "no-label": !c.label })}
|
|
5566
5572
|
@keydown=${je}
|
|
5567
|
-
${
|
|
5573
|
+
${ne(l)}
|
|
5568
5574
|
>
|
|
5569
5575
|
${c.useFilter ? a`<div class="filter-input">
|
|
5570
5576
|
<input
|
|
5571
|
-
${
|
|
5577
|
+
${ne(h)}
|
|
5572
5578
|
@mousedown=${(ce) => ce.stopPropagation()}
|
|
5573
5579
|
placeholder=${c.searchPlaceholder ?? e.locale.Select.searchPlaceholder}
|
|
5574
5580
|
@input=${k}
|
|
@@ -5579,33 +5585,33 @@ const Ul = $e({
|
|
|
5579
5585
|
<div
|
|
5580
5586
|
id=${w}
|
|
5581
5587
|
role="listbox"
|
|
5582
|
-
class=${
|
|
5583
|
-
${
|
|
5588
|
+
class=${D("list-box-container", { "list-box-container--with-filter": c.useFilter })}
|
|
5589
|
+
${ne(P)}
|
|
5584
5590
|
>
|
|
5585
|
-
<div class="inner-container" style=${X({ height: `${ze}px` })} ${
|
|
5586
|
-
${Pe.map(({ index: ce, value:
|
|
5587
|
-
const Ae = c.useObjBinding ?
|
|
5591
|
+
<div class="inner-container" style=${X({ height: `${ze}px` })} ${ne(n)}>
|
|
5592
|
+
${Pe.map(({ index: ce, value: te, start: Te }) => {
|
|
5593
|
+
const Ae = c.useObjBinding ? te && T && te[Y] === T[Y] : te[Y] === T;
|
|
5588
5594
|
return a`<div
|
|
5589
5595
|
data-index=${ce}
|
|
5590
5596
|
role="option"
|
|
5591
5597
|
aria-selected=${Ae ? "true" : "false"}
|
|
5592
|
-
${
|
|
5598
|
+
${ne((z) => {
|
|
5593
5599
|
z && y.measureElement(z);
|
|
5594
5600
|
})}
|
|
5595
5601
|
style=${X({ transform: `translateY(${Te}px)` })}
|
|
5596
|
-
class=${
|
|
5597
|
-
@click=${() => E(c.useObjBinding ?
|
|
5602
|
+
class=${D("list-box-item virtual-row", { "list-selected": te[Y] === T })}
|
|
5603
|
+
@click=${() => E(c.useObjBinding ? te : te[Y])}
|
|
5598
5604
|
tabindex="0"
|
|
5599
|
-
@keydown=${(z) => He(z, c.useObjBinding ?
|
|
5605
|
+
@keydown=${(z) => He(z, c.useObjBinding ? te : te[Y])}
|
|
5600
5606
|
>
|
|
5601
5607
|
${e.slots.has("list-item") ? e.slot("list-item", {
|
|
5602
|
-
text: V(
|
|
5603
|
-
item:
|
|
5608
|
+
text: V(te),
|
|
5609
|
+
item: te,
|
|
5604
5610
|
index: ce,
|
|
5605
|
-
highlightText: Z(V(
|
|
5606
|
-
}) : a`<div class="highlight-container" title=${V(
|
|
5607
|
-
${Z(V(
|
|
5608
|
-
(z) => a`<span class=${
|
|
5611
|
+
highlightText: Z(V(te))
|
|
5612
|
+
}) : a`<div class="highlight-container" title=${V(te)}>
|
|
5613
|
+
${Z(V(te)).map(
|
|
5614
|
+
(z) => a`<span class=${D({ highlight: z.highlight })}>${z.part}</span>`
|
|
5609
5615
|
)}
|
|
5610
5616
|
</div>`}
|
|
5611
5617
|
${Ae ? jt("12", "var(--moz-color-accent)", !1, "icon-check") : v}
|
|
@@ -5780,7 +5786,7 @@ const Zl = $e({
|
|
|
5780
5786
|
} catch {
|
|
5781
5787
|
return 24;
|
|
5782
5788
|
}
|
|
5783
|
-
})(),
|
|
5789
|
+
})(), W = new xt({
|
|
5784
5790
|
count: 0,
|
|
5785
5791
|
getScrollElement: () => h,
|
|
5786
5792
|
estimateSize: () => U,
|
|
@@ -5792,29 +5798,29 @@ const Zl = $e({
|
|
|
5792
5798
|
});
|
|
5793
5799
|
e.onCleanup(() => {
|
|
5794
5800
|
ce == null || ce.release(), ce = null;
|
|
5795
|
-
}), e.onCleanup(
|
|
5801
|
+
}), e.onCleanup(W._didMount());
|
|
5796
5802
|
const Z = (g) => {
|
|
5797
|
-
h = g ?? null, g && (
|
|
5798
|
-
},
|
|
5803
|
+
h = g ?? null, g && (W._willUpdate(), e.requestUpdate());
|
|
5804
|
+
}, ie = (g) => typeof e.props.displayProp == "function" ? e.props.displayProp(g) : typeof g == "object" ? g[e.props.displayProp] ?? "" : g, fe = () => {
|
|
5799
5805
|
const g = /* @__PURE__ */ new Map();
|
|
5800
5806
|
return (e.props.itemsSource ?? []).forEach((H) => g.set(H[d()], H)), g;
|
|
5801
|
-
},
|
|
5807
|
+
}, le = () => {
|
|
5802
5808
|
if (e.props.filterMode === "remote" || !S) return e.props.itemsSource ?? [];
|
|
5803
5809
|
const g = S.toLowerCase();
|
|
5804
|
-
return (e.props.itemsSource ?? []).filter((H) =>
|
|
5805
|
-
},
|
|
5810
|
+
return (e.props.itemsSource ?? []).filter((H) => ie(H).toLowerCase().indexOf(g) > -1);
|
|
5811
|
+
}, A = (g) => {
|
|
5806
5812
|
if (!S) return [{ part: g, highlight: !1 }];
|
|
5807
5813
|
const H = Yl(S), F = new RegExp(`(${H})`, "gi");
|
|
5808
|
-
return g.split(F).map((
|
|
5809
|
-
},
|
|
5810
|
-
const g = i(), H =
|
|
5814
|
+
return g.split(F).map((J) => ({ part: J, highlight: S.toLowerCase() === J.toLowerCase() }));
|
|
5815
|
+
}, _ = (g) => new Set(i()).has(g[d()]), G = (g) => P.some((H) => ut(H.item, g)), oe = () => {
|
|
5816
|
+
const g = i(), H = le();
|
|
5811
5817
|
if (g.length < H.length || g.length === 0 || H.length === 0) return !1;
|
|
5812
5818
|
const F = new Set(g);
|
|
5813
|
-
return H.every((
|
|
5814
|
-
}, Q = () => new Set(
|
|
5815
|
-
const g = Q(), H =
|
|
5819
|
+
return H.every((J) => F.has(J[d()]));
|
|
5820
|
+
}, Q = () => new Set(le().map((g) => g[d()])), B = () => new Set(i()), se = () => {
|
|
5821
|
+
const g = Q(), H = B();
|
|
5816
5822
|
return !g.size || !H.size || H.size < g.size ? !1 : Array.from(g).every((F) => H.has(F));
|
|
5817
|
-
},
|
|
5823
|
+
}, K = () => $.save || $.blur || $.change, E = () => {
|
|
5818
5824
|
const g = [];
|
|
5819
5825
|
return e.props.required && g.push({
|
|
5820
5826
|
message: e.locale.MultiSelect.required.replace("{label}", e.props.label || ""),
|
|
@@ -5826,12 +5832,12 @@ const Zl = $e({
|
|
|
5826
5832
|
if (F.length <= 0) return;
|
|
5827
5833
|
if (e.props.disabled) return !0;
|
|
5828
5834
|
$[H] = "", e.requestUpdate();
|
|
5829
|
-
const
|
|
5830
|
-
for (const
|
|
5831
|
-
if (!await
|
|
5832
|
-
return $[H] =
|
|
5835
|
+
const J = F.filter((ee) => ee.type === H);
|
|
5836
|
+
for (const ee of J)
|
|
5837
|
+
if (!await ee.validator(g))
|
|
5838
|
+
return $[H] = ee.message, e.requestUpdate(), !1;
|
|
5833
5839
|
return !0;
|
|
5834
|
-
}, M = async (g = "save") =>
|
|
5840
|
+
}, M = async (g = "save") => K() !== "" ? !1 : await k(i(), g) ?? !0, x = {
|
|
5835
5841
|
validate: M,
|
|
5836
5842
|
initValidator: () => {
|
|
5837
5843
|
$.change = "", $.blur = "", $.save = "", e.requestUpdate();
|
|
@@ -5844,57 +5850,57 @@ const Zl = $e({
|
|
|
5844
5850
|
const q = (g) => {
|
|
5845
5851
|
if (e.props.disabled || e.props.readonly || e.props.loading) return;
|
|
5846
5852
|
const H = fe(), F = /* @__PURE__ */ new Set();
|
|
5847
|
-
i().forEach((
|
|
5848
|
-
const he = H.get(
|
|
5849
|
-
(he == null ? void 0 : he[s()]) === !0 && F.add(
|
|
5850
|
-
}), g.forEach((
|
|
5851
|
-
const he = H.get(
|
|
5852
|
-
(he && he[s()] !== !0 || !he && e.props.preserveMissingValues) && F.add(
|
|
5853
|
+
i().forEach((ee) => {
|
|
5854
|
+
const he = H.get(ee);
|
|
5855
|
+
(he == null ? void 0 : he[s()]) === !0 && F.add(ee);
|
|
5856
|
+
}), g.forEach((ee) => {
|
|
5857
|
+
const he = H.get(ee);
|
|
5858
|
+
(he && he[s()] !== !0 || !he && e.props.preserveMissingValues) && F.add(ee);
|
|
5853
5859
|
});
|
|
5854
|
-
const
|
|
5855
|
-
ut(i(),
|
|
5860
|
+
const J = Array.from(F);
|
|
5861
|
+
ut(i(), J) || (u(J), e.emit(
|
|
5856
5862
|
"change",
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
), k(
|
|
5860
|
-
}, f = (g, H) => g.filter((F) =>
|
|
5863
|
+
J,
|
|
5864
|
+
J.map((ee) => H.get(ee)).filter(Boolean)
|
|
5865
|
+
), k(J, "change"));
|
|
5866
|
+
}, f = (g, H) => g.filter((F) => _(F) !== H).map((F) => F[d()]), R = (g, H, F) => {
|
|
5861
5867
|
if (F.shiftKey && P.length > 0) {
|
|
5862
|
-
const
|
|
5863
|
-
P =
|
|
5868
|
+
const J = P[0], ee = Math.min(J.index, H), he = Math.max(J.index, H);
|
|
5869
|
+
P = le().slice(ee, he + 1).map((we, ye) => ({ item: we, index: ee + ye }));
|
|
5864
5870
|
} else F.ctrlKey ? P.push({ item: g, index: H }) : P = [{ item: g, index: H }];
|
|
5865
5871
|
return P.length;
|
|
5866
5872
|
}, N = (g = !0) => {
|
|
5867
|
-
const H = P.map((
|
|
5868
|
-
let
|
|
5869
|
-
g ?
|
|
5873
|
+
const H = P.map((ee) => ee.item), F = f(H, g);
|
|
5874
|
+
let J = i();
|
|
5875
|
+
g ? J = [...J, ...F] : J = J.filter((ee) => !F.some((he) => ee === he)), q(J);
|
|
5870
5876
|
}, j = (g, H, F) => {
|
|
5871
5877
|
if (g[s()] === !0) return;
|
|
5872
|
-
const
|
|
5873
|
-
(P.length <= 1 || !
|
|
5874
|
-
const
|
|
5875
|
-
N(!
|
|
5878
|
+
const J = P.some((he) => he.item[d()] === g[d()]);
|
|
5879
|
+
(P.length <= 1 || !J) && R(g, H, { shiftKey: !1, ctrlKey: !1 });
|
|
5880
|
+
const ee = i().some((he) => he === g[d()]);
|
|
5881
|
+
N(!ee), F.stopPropagation();
|
|
5876
5882
|
}, ke = (g, H, F) => {
|
|
5877
5883
|
g[s()] !== !0 && (!F.ctrlKey && !F.shiftKey && P.length <= 1 && j(g, H, F), R(g, H, F), e.requestUpdate());
|
|
5878
5884
|
}, Ve = (g, H, F) => {
|
|
5879
5885
|
if (g[s()] === !0) return;
|
|
5880
|
-
const
|
|
5881
|
-
q(
|
|
5886
|
+
const J = i(), ee = B().size !== 0 && J.every((he) => he === g[d()]);
|
|
5887
|
+
q(ee ? [] : [g[d()]]), R(g, H, F), F.stopPropagation();
|
|
5882
5888
|
}, je = (g) => {
|
|
5883
5889
|
g.stopPropagation();
|
|
5884
|
-
const H = Q().size ===
|
|
5885
|
-
if (
|
|
5890
|
+
const H = Q().size === B().size && [...Q()].every((F) => B().has(F));
|
|
5891
|
+
if (oe() && H) {
|
|
5886
5892
|
const F = new Set(
|
|
5887
|
-
(e.props.itemsSource ?? []).filter((
|
|
5893
|
+
(e.props.itemsSource ?? []).filter((J) => J[s()] === !0).map((J) => J[d()])
|
|
5888
5894
|
);
|
|
5889
5895
|
q(Array.from(F));
|
|
5890
5896
|
} else {
|
|
5891
5897
|
const F = new Set(
|
|
5892
|
-
|
|
5898
|
+
le().filter((J) => J[s()] !== !0).map((J) => J[d()])
|
|
5893
5899
|
);
|
|
5894
5900
|
q(Array.from(F));
|
|
5895
5901
|
}
|
|
5896
5902
|
}, He = (g) => {
|
|
5897
|
-
if (g.stopPropagation(),
|
|
5903
|
+
if (g.stopPropagation(), se()) {
|
|
5898
5904
|
const H = Q();
|
|
5899
5905
|
q(i().filter((F) => !H.has(F)));
|
|
5900
5906
|
} else {
|
|
@@ -5906,17 +5912,17 @@ const Zl = $e({
|
|
|
5906
5912
|
}, T = () => {
|
|
5907
5913
|
const g = i();
|
|
5908
5914
|
if (!(g != null && g.length)) return "";
|
|
5909
|
-
const H = fe(), F = g.map((
|
|
5910
|
-
(
|
|
5911
|
-
),
|
|
5912
|
-
return F.length ===
|
|
5915
|
+
const H = fe(), F = g.map((ee) => H.get(ee)).filter(Boolean).map(
|
|
5916
|
+
(ee) => typeof e.props.displayProp == "function" ? e.props.displayProp(ee) : ee[e.props.displayProp] || ""
|
|
5917
|
+
), J = e.props.itemsSource ?? [];
|
|
5918
|
+
return F.length === J.length && F.length > 2 ? `${e.props.headerFormat.replace(/\{count(:.*?)?}/g, "ALL")}` : F.length > 1 ? e.props.headerFormat.replace(
|
|
5913
5919
|
/\{count(:.*?)?}/g,
|
|
5914
5920
|
`${F.length.toLocaleString()}`
|
|
5915
5921
|
) : F.join(", ") || "";
|
|
5916
5922
|
}, Y = (g, H, F = 10) => {
|
|
5917
|
-
const
|
|
5923
|
+
const J = window.innerHeight || document.documentElement.clientHeight, ee = window.innerWidth || document.documentElement.clientWidth, he = g.getBoundingClientRect(), we = H.getBoundingClientRect(), ye = he.bottom + we.height + F > J;
|
|
5918
5924
|
if (!ye) return !1;
|
|
5919
|
-
const Me = he.top - we.height - F < 0, We = he.right + we.width + F >
|
|
5925
|
+
const Me = he.top - we.height - F < 0, We = he.right + we.width + F > ee, Qe = he.left - we.width - F < 0;
|
|
5920
5926
|
return ye && !Me || We && !Qe;
|
|
5921
5927
|
}, re = () => {
|
|
5922
5928
|
const g = o.value;
|
|
@@ -5930,34 +5936,34 @@ const Zl = $e({
|
|
|
5930
5936
|
}, e.requestUpdate();
|
|
5931
5937
|
}, ue = (g) => {
|
|
5932
5938
|
var H;
|
|
5933
|
-
(H = l.value) != null && H.contains(g.target) ||
|
|
5939
|
+
(H = l.value) != null && H.contains(g.target) || te(!1);
|
|
5934
5940
|
}, ze = (g) => {
|
|
5935
5941
|
var H, F;
|
|
5936
|
-
!((H = t.value) != null && H.contains(g.target)) && !((F = l.value) != null && F.contains(g.target)) && (
|
|
5942
|
+
!((H = t.value) != null && H.contains(g.target)) && !((F = l.value) != null && F.contains(g.target)) && (te(!1), document.removeEventListener("click", ze, { capture: !0 }));
|
|
5937
5943
|
}, Pe = (g) => {
|
|
5938
5944
|
var F;
|
|
5939
|
-
`${g.ctrlKey ? "ctrl+" : ""}${g.altKey ? "alt+" : ""}${g.key.toLowerCase()}` === "escape" && (
|
|
5945
|
+
`${g.ctrlKey ? "ctrl+" : ""}${g.altKey ? "alt+" : ""}${g.key.toLowerCase()}` === "escape" && (te(!1), (F = n.value) == null || F.focus());
|
|
5940
5946
|
};
|
|
5941
5947
|
e.onCleanup(() => {
|
|
5942
5948
|
document.body.removeEventListener("scroll", ue, { capture: !0 }), document.removeEventListener("click", ze, { capture: !0 }), window.removeEventListener("keydown", Pe);
|
|
5943
5949
|
});
|
|
5944
5950
|
let ce = null;
|
|
5945
|
-
const
|
|
5951
|
+
const te = (g) => {
|
|
5946
5952
|
if (p === g) return;
|
|
5947
5953
|
const H = p;
|
|
5948
5954
|
if (p = g, e.requestUpdate(), g)
|
|
5949
5955
|
ce = Dt(), document.body.addEventListener("scroll", ue, { capture: !0 }), document.addEventListener("click", ze, { capture: !0 }), $.save = "", window.addEventListener("keydown", Pe), re(), queueMicrotask(() => {
|
|
5950
5956
|
var F;
|
|
5951
|
-
o.value && h && (C = Y(o.value, h)), re(),
|
|
5957
|
+
o.value && h && (C = Y(o.value, h)), re(), W.measure(), h && (h.scrollTop = 0), r.value ? r.value.focus() : (F = n.value) == null || F.focus();
|
|
5952
5958
|
});
|
|
5953
5959
|
else if (ce == null || ce.release(), ce = null, S = "", r.value && (r.value.value = ""), document.body.removeEventListener("scroll", ue, { capture: !0 }), document.removeEventListener("click", ze, { capture: !0 }), k(i(), "blur"), window.removeEventListener("keydown", Pe), H && !g) {
|
|
5954
5960
|
const F = i();
|
|
5955
5961
|
if (e.props.selectAllWhenEmpty && (!F || F.length === 0)) {
|
|
5956
|
-
const
|
|
5957
|
-
|
|
5962
|
+
const J = (e.props.itemsSource ?? []).filter((ee) => ee[s()] !== !0).map((ee) => ee[d()]);
|
|
5963
|
+
J.length > 0 && (u(J), e.emit(
|
|
5958
5964
|
"change",
|
|
5959
|
-
|
|
5960
|
-
(e.props.itemsSource ?? []).filter((
|
|
5965
|
+
J,
|
|
5966
|
+
(e.props.itemsSource ?? []).filter((ee) => J.includes(ee[d()]))
|
|
5961
5967
|
));
|
|
5962
5968
|
}
|
|
5963
5969
|
e.emit("close");
|
|
@@ -5970,56 +5976,56 @@ const Zl = $e({
|
|
|
5970
5976
|
F == null || F.focus();
|
|
5971
5977
|
}
|
|
5972
5978
|
}, Ae = (g) => {
|
|
5973
|
-
var
|
|
5974
|
-
const H = ((
|
|
5975
|
-
(g.target === F || g.target ===
|
|
5979
|
+
var ee, he, we;
|
|
5980
|
+
const H = ((ee = l.value) == null ? void 0 : ee.querySelectorAll("input, button")) ?? [], F = H[0], J = H[H.length - 1];
|
|
5981
|
+
(g.target === F || g.target === J) && n.value && (g.target === F && g.shiftKey ? (g.stopPropagation(), g.preventDefault(), (he = n.value) == null || he.focus()) : g.target === J && !g.shiftKey && (g.stopPropagation(), g.preventDefault(), (we = n.value) == null || we.focus()));
|
|
5976
5982
|
}, z = (g) => {
|
|
5977
5983
|
g.key === "Tab" && Te(g);
|
|
5978
5984
|
}, pe = (g) => {
|
|
5979
5985
|
!e.props.inline && g.key === "Tab" && Ae(g);
|
|
5980
5986
|
}, De = (g) => {
|
|
5981
5987
|
!p && !e.props.inline || (S = g.target.value, P = [], e.emit("update:filterValue", S), e.requestUpdate(), queueMicrotask(() => {
|
|
5982
|
-
|
|
5988
|
+
W.setOptions({ ...W.options, count: le().length }), W.measure(), h && (h.scrollTop = 0);
|
|
5983
5989
|
}));
|
|
5984
5990
|
}, Ne = () => {
|
|
5985
5991
|
var g;
|
|
5986
|
-
e.props.disabled || (
|
|
5992
|
+
e.props.disabled || (te(!p), (g = n.value) == null || g.focus());
|
|
5987
5993
|
}, Ge = (g, H) => {
|
|
5988
|
-
var F,
|
|
5994
|
+
var F, J;
|
|
5989
5995
|
if (g.key === "Enter" || g.key === " ") {
|
|
5990
5996
|
g.preventDefault(), g.stopPropagation(), H();
|
|
5991
5997
|
return;
|
|
5992
5998
|
}
|
|
5993
5999
|
if (g.key === "ArrowDown" || g.key === "ArrowUp") {
|
|
5994
6000
|
g.preventDefault(), g.stopPropagation();
|
|
5995
|
-
const
|
|
6001
|
+
const ee = Array.from(((F = l.value) == null ? void 0 : F.querySelectorAll('[tabindex="0"]')) ?? []), he = ee.indexOf(g.currentTarget), we = ee[he + (g.key === "ArrowDown" ? 1 : -1)];
|
|
5996
6002
|
we == null || we.focus();
|
|
5997
6003
|
return;
|
|
5998
6004
|
}
|
|
5999
|
-
g.key === "Escape" && !e.props.inline && (g.preventDefault(), g.stopPropagation(),
|
|
6005
|
+
g.key === "Escape" && !e.props.inline && (g.preventDefault(), g.stopPropagation(), te(!1), (J = n.value) == null || J.focus());
|
|
6000
6006
|
}, Re = (g, H) => {
|
|
6001
6007
|
ke(g, H, { ctrlKey: !1, shiftKey: !1, stopPropagation() {
|
|
6002
6008
|
} });
|
|
6003
6009
|
}, Ue = (g, H) => {
|
|
6004
6010
|
if (P = [], e.props.preserveMissingValues || JSON.stringify(g) === JSON.stringify(H)) return;
|
|
6005
|
-
const F = new Set(g.map((
|
|
6011
|
+
const F = new Set(g.map((ee) => ee[d()])), J = i();
|
|
6006
6012
|
if (e.props.autoSelectNewItems && H) {
|
|
6007
|
-
const
|
|
6013
|
+
const ee = new Set(H.map((we) => we[d()])), he = g.filter((we) => !ee.has(we[d()])).map((we) => we[d()]);
|
|
6008
6014
|
if (he.length > 0) {
|
|
6009
|
-
const we =
|
|
6015
|
+
const we = J.filter((ye) => F.has(ye));
|
|
6010
6016
|
u([.../* @__PURE__ */ new Set([...we, ...he])]);
|
|
6011
6017
|
} else
|
|
6012
|
-
u(
|
|
6018
|
+
u(J.filter((we) => F.has(we)));
|
|
6013
6019
|
} else {
|
|
6014
|
-
const
|
|
6015
|
-
if (ut(
|
|
6016
|
-
u(
|
|
6020
|
+
const ee = J.filter((he) => F.has(he));
|
|
6021
|
+
if (ut(J, ee)) return;
|
|
6022
|
+
u(ee);
|
|
6017
6023
|
}
|
|
6018
6024
|
}, _e = () => {
|
|
6019
|
-
const g = e.props, H = d(), F = g.loading ? [] :
|
|
6020
|
-
|
|
6021
|
-
const
|
|
6022
|
-
|
|
6025
|
+
const g = e.props, H = d(), F = g.loading ? [] : le();
|
|
6026
|
+
W.options.count !== F.length && W.setOptions({ ...W.options, count: F.length }), W._willUpdate();
|
|
6027
|
+
const J = new Set(i()), ee = Vt(
|
|
6028
|
+
W.getVirtualItems(),
|
|
6023
6029
|
F.length,
|
|
6024
6030
|
U,
|
|
6025
6031
|
h
|
|
@@ -6031,16 +6037,16 @@ const Zl = $e({
|
|
|
6031
6037
|
value: Me,
|
|
6032
6038
|
size: ye.size,
|
|
6033
6039
|
start: ye.start,
|
|
6034
|
-
isSelected:
|
|
6040
|
+
isSelected: J.has(Me[H]),
|
|
6035
6041
|
isDisabled: !!g.disabled || !!g.readonly || Me[s()] === !0,
|
|
6036
|
-
isFocused:
|
|
6042
|
+
isFocused: G(Me)
|
|
6037
6043
|
} : null;
|
|
6038
|
-
}).filter((ye) => ye !== null), he =
|
|
6044
|
+
}).filter((ye) => ye !== null), he = W.getTotalSize(), we = S ? e.locale.MultiSelect.selectFiltered : e.locale.MultiSelect.selectAll;
|
|
6039
6045
|
return a`<div
|
|
6040
|
-
class=${
|
|
6046
|
+
class=${D("list-box moz-multi-select-list", { "no-label": !g.label, "show-top": C, "moz-multiselect-inline-list": !!g.inline }, g.class)}
|
|
6041
6047
|
style=${X(g.inline ? { "--moz-multiselect-list-height": `${g.listBoxHeight ?? 224}px` } : y)}
|
|
6042
6048
|
@keydown=${pe}
|
|
6043
|
-
${
|
|
6049
|
+
${ne(l)}
|
|
6044
6050
|
>
|
|
6045
6051
|
${g.useFilter ? a`<div class="filter-input">
|
|
6046
6052
|
<input
|
|
@@ -6049,16 +6055,16 @@ const Zl = $e({
|
|
|
6049
6055
|
.value=${S}
|
|
6050
6056
|
?disabled=${!!g.disabled || !!g.readonly}
|
|
6051
6057
|
@input=${De}
|
|
6052
|
-
${
|
|
6058
|
+
${ne(r)}
|
|
6053
6059
|
/>
|
|
6054
6060
|
<div class="search-icon">${Kl("12", "var(--moz-color-text-subtle)")}</div>
|
|
6055
6061
|
</div>` : v}
|
|
6056
6062
|
${g.useSelectAll && (g.itemsSource ?? []).length > 0 && F.length > 0 ? a`<div
|
|
6057
|
-
class=${
|
|
6063
|
+
class=${D("list-box-item multi-select-item multi-select-all", { "is-scrolled": I })}
|
|
6058
6064
|
role="button"
|
|
6059
6065
|
tabindex=${g.disabled || g.readonly || g.loading ? "-1" : "0"}
|
|
6060
6066
|
aria-disabled=${g.disabled || g.readonly || g.loading ? "true" : "false"}
|
|
6061
|
-
aria-pressed=${
|
|
6067
|
+
aria-pressed=${se() ? "true" : "false"}
|
|
6062
6068
|
aria-label=${we}
|
|
6063
6069
|
@click=${He}
|
|
6064
6070
|
@keydown=${(ye) => Ge(ye, () => He({ stopPropagation() {
|
|
@@ -6068,8 +6074,8 @@ const Zl = $e({
|
|
|
6068
6074
|
type="checkbox"
|
|
6069
6075
|
aria-hidden="true"
|
|
6070
6076
|
tabindex="-1"
|
|
6071
|
-
class=${
|
|
6072
|
-
.checked=${
|
|
6077
|
+
class=${D("moz-checkbox", { "is-indeterminate": F.some((ye) => J.has(ye[H])) && !oe() })}
|
|
6078
|
+
.checked=${se()}
|
|
6073
6079
|
/>
|
|
6074
6080
|
<div class="highlight-container">
|
|
6075
6081
|
<span title=${we}>${we}</span>
|
|
@@ -6087,11 +6093,11 @@ const Zl = $e({
|
|
|
6087
6093
|
aria-busy=${g.loading ? "true" : "false"}
|
|
6088
6094
|
class="list-box-container"
|
|
6089
6095
|
@scroll=${c}
|
|
6090
|
-
${
|
|
6096
|
+
${ne(Z)}
|
|
6091
6097
|
>
|
|
6092
6098
|
<div class="inner-container" style=${X({ height: `${he}px` })}>
|
|
6093
|
-
${
|
|
6094
|
-
class=${
|
|
6099
|
+
${ee.map(({ index: ye, value: Me, start: We, size: Qe, isSelected: rt, isDisabled: st, isFocused: It }) => a`<div
|
|
6100
|
+
class=${D("list-box-item multi-select-item virtual-row", {
|
|
6095
6101
|
"list-selected": rt,
|
|
6096
6102
|
"moz-multi-focus": It
|
|
6097
6103
|
})}
|
|
@@ -6112,9 +6118,9 @@ const Zl = $e({
|
|
|
6112
6118
|
?disabled=${st}
|
|
6113
6119
|
@click=${(Je) => j(Me, ye, Je)}
|
|
6114
6120
|
/>
|
|
6115
|
-
${e.slots.has("list-item") ? e.slot("list-item", { text:
|
|
6116
|
-
${
|
|
6117
|
-
(Je) => a`<span class=${
|
|
6121
|
+
${e.slots.has("list-item") ? e.slot("list-item", { text: ie(Me), item: Me }) : a`<div class="highlight-container" title=${ie(Me)}>
|
|
6122
|
+
${A(ie(Me)).map(
|
|
6123
|
+
(Je) => a`<span class=${D("text-part", { highlight: Je.highlight })}>${Je.part}</span>`
|
|
6118
6124
|
)}
|
|
6119
6125
|
</div>`}
|
|
6120
6126
|
${g.useSpecificSelect && !st ? a`<button type="button" class="item-only" @click=${(Je) => Ve(Me, ye, Je)}>
|
|
@@ -6136,30 +6142,30 @@ const Zl = $e({
|
|
|
6136
6142
|
const we = V, ye = g.itemsSource;
|
|
6137
6143
|
V = g.itemsSource, queueMicrotask(() => Ue(ye ?? [], we ?? []));
|
|
6138
6144
|
}
|
|
6139
|
-
const H = typeof g.width == "number" ? `${Le(g.width)}rem` : g.width, F = Ce(g, Gl), { aria:
|
|
6145
|
+
const H = typeof g.width == "number" ? `${Le(g.width)}rem` : g.width, F = Ce(g, Gl), { aria: J, dom: ee } = ht(F);
|
|
6140
6146
|
if (g.inline)
|
|
6141
6147
|
return a`<div class="moz-multi-select moz-multi-select-inline"
|
|
6142
6148
|
style=${X({ width: H, ...ve(g.style) })}
|
|
6143
|
-
${
|
|
6149
|
+
${ne(t)}>${_e()}</div>`;
|
|
6144
6150
|
const he = e.slots.has("icon") ? e.slot("icon", { isOpen: p }) : p ? Wl("14", "var(--moz-color-accent)") : _l("14", g.disabled ? "var(--moz-color-text-muted)" : "var(--moz-color-text-subtle)");
|
|
6145
6151
|
return a`
|
|
6146
6152
|
<div
|
|
6147
|
-
class=${
|
|
6148
|
-
"is-invalid":
|
|
6153
|
+
class=${D("moz-multi-select", {
|
|
6154
|
+
"is-invalid": K() !== "",
|
|
6149
6155
|
"is-open": p,
|
|
6150
6156
|
disabled: !!g.disabled
|
|
6151
6157
|
})}
|
|
6152
6158
|
style=${X({ width: H, ...ve(g.style) })}
|
|
6153
|
-
${
|
|
6159
|
+
${ne(t)}
|
|
6154
6160
|
>
|
|
6155
6161
|
<div class="input-wrapper">
|
|
6156
6162
|
${g.label ? Ke(
|
|
6157
6163
|
{},
|
|
6158
6164
|
a`${g.label}${g.required ? a`<span class="require-mark">*</span>` : v}`
|
|
6159
6165
|
) : v}
|
|
6160
|
-
<div class="moz-input-container" @click=${Ne} ${
|
|
6166
|
+
<div class="moz-input-container" @click=${Ne} ${ne(o)}>
|
|
6161
6167
|
<input
|
|
6162
|
-
${me(
|
|
6168
|
+
${me(ee)}
|
|
6163
6169
|
.value=${T()}
|
|
6164
6170
|
autocomplete="off"
|
|
6165
6171
|
readonly
|
|
@@ -6168,22 +6174,22 @@ const Zl = $e({
|
|
|
6168
6174
|
<button
|
|
6169
6175
|
type="button"
|
|
6170
6176
|
class="icon-container"
|
|
6171
|
-
${me(
|
|
6177
|
+
${me(J)}
|
|
6172
6178
|
role="combobox"
|
|
6173
6179
|
aria-haspopup="listbox"
|
|
6174
6180
|
aria-expanded=${p ? "true" : "false"}
|
|
6175
6181
|
aria-controls=${w}
|
|
6176
|
-
aria-label=${Ee(
|
|
6182
|
+
aria-label=${Ee(J["aria-label"] ?? g.label ?? void 0)}
|
|
6177
6183
|
?disabled=${!!g.disabled}
|
|
6178
6184
|
@keydown=${z}
|
|
6179
|
-
${
|
|
6185
|
+
${ne(n)}
|
|
6180
6186
|
>
|
|
6181
6187
|
${he}
|
|
6182
6188
|
</button>
|
|
6183
6189
|
</div>
|
|
6184
6190
|
</div>
|
|
6185
6191
|
|
|
6186
|
-
${
|
|
6192
|
+
${K() !== "" ? a`<span class="moz-input-invalid-message">${K()}</span>` : v}
|
|
6187
6193
|
</div>
|
|
6188
6194
|
`;
|
|
6189
6195
|
},
|
|
@@ -6292,10 +6298,10 @@ const Xl = /* @__PURE__ */ new Set([
|
|
|
6292
6298
|
setup(e) {
|
|
6293
6299
|
const t = Se(), o = Se(), l = Se(), n = Se(), r = Se(), h = Se();
|
|
6294
6300
|
let d = !1, s = 9, m = 0, i = "", u = "";
|
|
6295
|
-
const p = (
|
|
6296
|
-
if (
|
|
6297
|
-
const [
|
|
6298
|
-
!isNaN(
|
|
6301
|
+
const p = (A) => {
|
|
6302
|
+
if (A && A.includes(":")) {
|
|
6303
|
+
const [_, G] = A.split(":").map(Number);
|
|
6304
|
+
!isNaN(_) && !isNaN(G) && (s = _, m = G, i = A, u = A);
|
|
6299
6305
|
}
|
|
6300
6306
|
};
|
|
6301
6307
|
p(e.props.modelValue);
|
|
@@ -6313,130 +6319,130 @@ const Xl = /* @__PURE__ */ new Set([
|
|
|
6313
6319
|
e.onCleanup(() => I.destroy());
|
|
6314
6320
|
const C = () => {
|
|
6315
6321
|
r.value && (r.value.scrollTop = s * 24 - 72), h.value && (h.value.scrollTop = m * 24 - 72);
|
|
6316
|
-
}, y = (
|
|
6317
|
-
d !==
|
|
6322
|
+
}, y = (A) => {
|
|
6323
|
+
d !== A && (d = A, e.requestUpdate(), A ? (I.open(), queueMicrotask(C)) : I.close());
|
|
6318
6324
|
}, P = () => {
|
|
6319
|
-
const
|
|
6320
|
-
i =
|
|
6321
|
-
}, $ = (
|
|
6322
|
-
s =
|
|
6323
|
-
}, V = (
|
|
6324
|
-
m =
|
|
6325
|
+
const A = `${s.toString().padStart(2, "0")}:${m.toString().padStart(2, "0")}`;
|
|
6326
|
+
i = A, u = A, e.emit("update:modelValue", A), e.requestUpdate();
|
|
6327
|
+
}, $ = (A) => {
|
|
6328
|
+
s = A, P();
|
|
6329
|
+
}, V = (A) => {
|
|
6330
|
+
m = A, y(!1), P();
|
|
6325
6331
|
}, U = () => {
|
|
6326
6332
|
s = (/* @__PURE__ */ new Date()).getHours(), m = (/* @__PURE__ */ new Date()).getMinutes(), P(), y(!1);
|
|
6327
|
-
},
|
|
6328
|
-
let
|
|
6329
|
-
return
|
|
6330
|
-
}, Z = (
|
|
6333
|
+
}, W = (A) => {
|
|
6334
|
+
let _ = A.replace(/[^\d:]/g, "");
|
|
6335
|
+
return _.length > 5 && (_ = _.slice(0, 5)), _;
|
|
6336
|
+
}, Z = (A) => {
|
|
6331
6337
|
y(!1);
|
|
6332
|
-
const
|
|
6333
|
-
if (!/^\d$/.test(
|
|
6334
|
-
const
|
|
6335
|
-
if (
|
|
6336
|
-
|
|
6337
|
-
const
|
|
6338
|
-
let E =
|
|
6339
|
-
|
|
6340
|
-
let k = E, M =
|
|
6338
|
+
const _ = A.target, G = A.key;
|
|
6339
|
+
if (!/^\d$/.test(G)) return;
|
|
6340
|
+
const oe = _.selectionStart || 0, Q = i;
|
|
6341
|
+
if (_.selectionStart !== _.selectionEnd || oe >= Q.length) return;
|
|
6342
|
+
A.preventDefault();
|
|
6343
|
+
const B = Q.replace(/:/g, ""), se = (Q.slice(0, oe).match(/:/g) || []).length, K = oe - se;
|
|
6344
|
+
let E = B.substring(0, K) + G;
|
|
6345
|
+
K + 1 < B.length && (E += B.substring(K + 1)), E.length > 4 && (E = E.slice(0, 4));
|
|
6346
|
+
let k = E, M = K + 1;
|
|
6341
6347
|
if (E.length >= 2) {
|
|
6342
6348
|
const x = E.slice(0, 2), q = E.slice(2);
|
|
6343
6349
|
k = `${x}:${q}`, M > 2 && (M = M + 1);
|
|
6344
6350
|
}
|
|
6345
|
-
i = k, u = k, e.requestUpdate(), queueMicrotask(() =>
|
|
6346
|
-
},
|
|
6347
|
-
const
|
|
6348
|
-
let Q =
|
|
6349
|
-
const
|
|
6350
|
-
Q =
|
|
6351
|
-
const
|
|
6352
|
-
if (!
|
|
6353
|
-
const
|
|
6351
|
+
i = k, u = k, e.requestUpdate(), queueMicrotask(() => _.setSelectionRange(M, M));
|
|
6352
|
+
}, ie = (A) => {
|
|
6353
|
+
const _ = A.target, G = _.selectionStart || 0, oe = u;
|
|
6354
|
+
let Q = _.value;
|
|
6355
|
+
const B = Q.length < oe.length;
|
|
6356
|
+
Q = W(Q);
|
|
6357
|
+
const se = Q.replace(/:/g, "");
|
|
6358
|
+
if (!B && se.length >= 2) {
|
|
6359
|
+
const K = (Q.slice(0, G).match(/:/g) || []).length, E = G - K, k = se.slice(0, 2), M = se.slice(2);
|
|
6354
6360
|
Q = k + (M ? `:${M}` : ":");
|
|
6355
6361
|
let x = E;
|
|
6356
|
-
E > 2 && (x = E + 1), i = Q, u = Q, e.requestUpdate(), setTimeout(() =>
|
|
6362
|
+
E > 2 && (x = E + 1), i = Q, u = Q, e.requestUpdate(), setTimeout(() => _.setSelectionRange(x, x), 0);
|
|
6357
6363
|
return;
|
|
6358
6364
|
}
|
|
6359
6365
|
i = Q, u = Q, e.requestUpdate();
|
|
6360
|
-
}, fe = () => y(!0),
|
|
6366
|
+
}, fe = () => y(!0), le = () => {
|
|
6361
6367
|
if (!i) {
|
|
6362
6368
|
P();
|
|
6363
6369
|
return;
|
|
6364
6370
|
}
|
|
6365
|
-
let
|
|
6366
|
-
!
|
|
6367
|
-
const
|
|
6368
|
-
let
|
|
6369
|
-
if (
|
|
6370
|
-
const Q = parseInt(
|
|
6371
|
-
isNaN(Q) || (Q >= 0 && Q <= 23 ?
|
|
6371
|
+
let A = i;
|
|
6372
|
+
!A.includes(":") && A.length >= 2 && (A = `${A.slice(0, 2)}:${A.slice(2)}`);
|
|
6373
|
+
const _ = A.split(":");
|
|
6374
|
+
let G = s, oe = m;
|
|
6375
|
+
if (_[0]) {
|
|
6376
|
+
const Q = parseInt(_[0], 10);
|
|
6377
|
+
isNaN(Q) || (Q >= 0 && Q <= 23 ? G = Q : Q > 23 ? G = 23 : G = 0);
|
|
6372
6378
|
}
|
|
6373
|
-
if (
|
|
6374
|
-
const Q = parseInt(
|
|
6375
|
-
isNaN(Q) || (Q >= 0 && Q <= 59 ?
|
|
6379
|
+
if (_[1]) {
|
|
6380
|
+
const Q = parseInt(_[1], 10);
|
|
6381
|
+
isNaN(Q) || (Q >= 0 && Q <= 59 ? oe = Q : Q > 59 ? oe = 59 : oe = 0);
|
|
6376
6382
|
}
|
|
6377
|
-
s =
|
|
6383
|
+
s = G, m = oe, P();
|
|
6378
6384
|
};
|
|
6379
6385
|
return {
|
|
6380
6386
|
render() {
|
|
6381
|
-
const
|
|
6382
|
-
if (
|
|
6387
|
+
const A = e.props;
|
|
6388
|
+
if (A.modelValue !== w && (w = A.modelValue, p(A.modelValue)), i !== S) {
|
|
6383
6389
|
S = i;
|
|
6384
|
-
const
|
|
6385
|
-
if (/^\d{2}:\d{2}$/.test(
|
|
6386
|
-
const [
|
|
6387
|
-
!isNaN(
|
|
6390
|
+
const B = i;
|
|
6391
|
+
if (/^\d{2}:\d{2}$/.test(B)) {
|
|
6392
|
+
const [se, K] = B.split(":").map(Number);
|
|
6393
|
+
!isNaN(se) && !isNaN(K) && se >= 0 && se <= 23 && K >= 0 && K <= 59 && B !== A.modelValue && (s = se, m = K, queueMicrotask(() => e.emit("update:modelValue", B)));
|
|
6388
6394
|
}
|
|
6389
6395
|
}
|
|
6390
|
-
const
|
|
6391
|
-
for (let
|
|
6392
|
-
|
|
6396
|
+
const _ = A.disabled ? "var(--moz-color-text-muted)" : d ? "var(--moz-color-accent)" : "var(--moz-color-text-subtle)", G = Ce(A, Xl), oe = "__:__", Q = [];
|
|
6397
|
+
for (let B = 0; B < oe.length; B++)
|
|
6398
|
+
B < i.length ? Q.push({ char: i[B], isInput: !0 }) : Q.push({ char: oe[B], isInput: !1 });
|
|
6393
6399
|
return a`
|
|
6394
6400
|
<div
|
|
6395
|
-
class=${
|
|
6396
|
-
style=${X({ width:
|
|
6397
|
-
${me(
|
|
6398
|
-
${
|
|
6401
|
+
class=${D("custom-time-picker", A.class, { "custom-time-picker--has-class": !!A.class })}
|
|
6402
|
+
style=${X({ width: A.width, ...ve(A.style) })}
|
|
6403
|
+
${me(G)}
|
|
6404
|
+
${ne(t)}
|
|
6399
6405
|
>
|
|
6400
|
-
${
|
|
6406
|
+
${A.label ? Ke({ disabled: A.disabled, required: A.required }, A.label) : v}
|
|
6401
6407
|
<div
|
|
6402
|
-
class=${
|
|
6403
|
-
"time-input-wrapper--disabled":
|
|
6404
|
-
"time-input-wrapper--open": d && !
|
|
6408
|
+
class=${D("time-input-wrapper", {
|
|
6409
|
+
"time-input-wrapper--disabled": A.disabled,
|
|
6410
|
+
"time-input-wrapper--open": d && !A.disabled
|
|
6405
6411
|
})}
|
|
6406
|
-
${
|
|
6412
|
+
${ne(o)}
|
|
6407
6413
|
>
|
|
6408
6414
|
<div class="input-with-mask">
|
|
6409
6415
|
<input
|
|
6410
6416
|
type="text"
|
|
6411
6417
|
.value=${i}
|
|
6412
6418
|
@keydown=${Z}
|
|
6413
|
-
@input=${
|
|
6414
|
-
@blur=${
|
|
6419
|
+
@input=${ie}
|
|
6420
|
+
@blur=${le}
|
|
6415
6421
|
@focus=${fe}
|
|
6416
6422
|
@click=${() => y(!0)}
|
|
6417
|
-
class=${
|
|
6418
|
-
"time-input--disabled":
|
|
6423
|
+
class=${D("time-input", {
|
|
6424
|
+
"time-input--disabled": A.disabled,
|
|
6419
6425
|
"time-input--open": d
|
|
6420
6426
|
})}
|
|
6421
|
-
?disabled=${!!
|
|
6427
|
+
?disabled=${!!A.disabled}
|
|
6422
6428
|
maxlength="5"
|
|
6423
|
-
${
|
|
6429
|
+
${ne(l)}
|
|
6424
6430
|
/>
|
|
6425
6431
|
<div class="time-mask">
|
|
6426
6432
|
${Q.map(
|
|
6427
|
-
(
|
|
6428
|
-
class=${
|
|
6429
|
-
"mask-input":
|
|
6430
|
-
"mask-placeholder": !
|
|
6431
|
-
"mask-input--disabled":
|
|
6433
|
+
(B) => a`<span
|
|
6434
|
+
class=${D({
|
|
6435
|
+
"mask-input": B.isInput && !A.disabled,
|
|
6436
|
+
"mask-placeholder": !B.isInput,
|
|
6437
|
+
"mask-input--disabled": B.isInput && !!A.disabled
|
|
6432
6438
|
})}
|
|
6433
|
-
>${
|
|
6439
|
+
>${B.char}</span
|
|
6434
6440
|
>`
|
|
6435
6441
|
)}
|
|
6436
6442
|
</div>
|
|
6437
6443
|
</div>
|
|
6438
6444
|
<div class="icon-container">
|
|
6439
|
-
<span @click=${() => y(!0)}>${jl("14",
|
|
6445
|
+
<span @click=${() => y(!0)}>${jl("14", _)}</span>
|
|
6440
6446
|
</div>
|
|
6441
6447
|
</div>
|
|
6442
6448
|
</div>
|
|
@@ -6444,30 +6450,30 @@ const Xl = /* @__PURE__ */ new Set([
|
|
|
6444
6450
|
},
|
|
6445
6451
|
renderPortal() {
|
|
6446
6452
|
if (!d) return v;
|
|
6447
|
-
const
|
|
6448
|
-
return a`<div class="time-picker-dropdown" ${
|
|
6453
|
+
const A = e.props;
|
|
6454
|
+
return a`<div class="time-picker-dropdown" ${ne(n)}>
|
|
6449
6455
|
<div class="time-picker-content">
|
|
6450
6456
|
<div class="time-column">
|
|
6451
|
-
<div class="time-label">${
|
|
6457
|
+
<div class="time-label">${A.hourLabel ?? e.locale.TimePicker.hour}</div>
|
|
6452
6458
|
<div class="time-list">
|
|
6453
|
-
<div class="time-option-wrapper" ${
|
|
6459
|
+
<div class="time-option-wrapper" ${ne(r)}>
|
|
6454
6460
|
${Ql.map(
|
|
6455
|
-
(
|
|
6456
|
-
<div class="time-option-text">${
|
|
6457
|
-
${s ===
|
|
6461
|
+
(_) => a`<div @click=${() => $(_)} class="time-option">
|
|
6462
|
+
<div class="time-option-text">${_.toString().padStart(2, "0")}</div>
|
|
6463
|
+
${s === _ ? ro("12", "var(--moz-color-accent)", !1, "check-icon") : v}
|
|
6458
6464
|
</div>`
|
|
6459
6465
|
)}
|
|
6460
6466
|
</div>
|
|
6461
6467
|
</div>
|
|
6462
6468
|
</div>
|
|
6463
6469
|
<div class="time-column">
|
|
6464
|
-
<div class="time-label">${
|
|
6470
|
+
<div class="time-label">${A.minuteLabel ?? e.locale.TimePicker.minute}</div>
|
|
6465
6471
|
<div class="time-list">
|
|
6466
|
-
<div class="time-option-wrapper" ${
|
|
6472
|
+
<div class="time-option-wrapper" ${ne(h)}>
|
|
6467
6473
|
${Jl.map(
|
|
6468
|
-
(
|
|
6469
|
-
<div class="time-option-text">${
|
|
6470
|
-
${m ===
|
|
6474
|
+
(_) => a`<div @click=${() => V(_)} class="time-option">
|
|
6475
|
+
<div class="time-option-text">${_.toString().padStart(2, "0")}</div>
|
|
6476
|
+
${m === _ ? ro("12", "var(--moz-color-accent)", !1, "check-icon") : v}
|
|
6471
6477
|
</div>`
|
|
6472
6478
|
)}
|
|
6473
6479
|
</div>
|
|
@@ -6475,7 +6481,7 @@ const Xl = /* @__PURE__ */ new Set([
|
|
|
6475
6481
|
</div>
|
|
6476
6482
|
</div>
|
|
6477
6483
|
<div class="time-picker-footer" @click=${U}>
|
|
6478
|
-
${
|
|
6484
|
+
${A.currentTimeLabel ?? e.locale.TimePicker.currentTime}
|
|
6479
6485
|
</div>
|
|
6480
6486
|
</div>`;
|
|
6481
6487
|
}
|
|
@@ -6603,8 +6609,8 @@ const ln = $e({
|
|
|
6603
6609
|
}
|
|
6604
6610
|
};
|
|
6605
6611
|
V();
|
|
6606
|
-
let U = i().modelValue,
|
|
6607
|
-
const
|
|
6612
|
+
let U = i().modelValue, W = i().itemsSource, Z = w().toString();
|
|
6613
|
+
const ie = () => {
|
|
6608
6614
|
if (!t.value || !o.value) return;
|
|
6609
6615
|
const f = t.value.getBoundingClientRect();
|
|
6610
6616
|
let R = f.left;
|
|
@@ -6618,34 +6624,34 @@ const ln = $e({
|
|
|
6618
6624
|
const R = f.target, N = () => {
|
|
6619
6625
|
d && i().pushOnBlur && C(d, !0) && e.emit("modelChange", w()), d = "", h = !1, r = !1;
|
|
6620
6626
|
};
|
|
6621
|
-
R.className && Array.from(String(R.className).split(" ")).includes("tag-input-not-close") || N(),
|
|
6622
|
-
},
|
|
6623
|
-
r = !0, window.addEventListener("mousedown", fe), e.requestUpdate(), queueMicrotask(
|
|
6627
|
+
R.className && Array.from(String(R.className).split(" ")).includes("tag-input-not-close") || N(), B(""), window.removeEventListener("mousedown", fe), e.requestUpdate();
|
|
6628
|
+
}, le = () => {
|
|
6629
|
+
r = !0, window.addEventListener("mousedown", fe), e.requestUpdate(), queueMicrotask(ie);
|
|
6624
6630
|
};
|
|
6625
6631
|
e.onCleanup(() => window.removeEventListener("mousedown", fe));
|
|
6626
|
-
const
|
|
6632
|
+
const A = (f) => {
|
|
6627
6633
|
setTimeout(() => {
|
|
6628
6634
|
const R = o.value, N = R == null ? void 0 : R.querySelector(`[data-edit-idx="${f}"] .moz-auto-input`);
|
|
6629
6635
|
N == null || N.focus();
|
|
6630
6636
|
}, 0);
|
|
6631
|
-
},
|
|
6632
|
-
n[f].isEditing = !0, e.requestUpdate(),
|
|
6633
|
-
},
|
|
6634
|
-
h = !0,
|
|
6635
|
-
},
|
|
6637
|
+
}, _ = (f) => {
|
|
6638
|
+
n[f].isEditing = !0, e.requestUpdate(), A(f);
|
|
6639
|
+
}, G = () => {
|
|
6640
|
+
h = !0, le(), setTimeout(() => l == null ? void 0 : l.focus(), 0);
|
|
6641
|
+
}, oe = (f) => {
|
|
6636
6642
|
if (f.key === "Enter" && d === "" && e.emit("onEnterEmpty", w()), (f.key === "Enter" || f.key === "Tab" && i().pushOnBlur) && d !== "" && (C(d, !0) && (e.emit("modelChange", w()), d = ""), e.requestUpdate()), f.key === "Tab" && (r = !1, h = !1, e.requestUpdate()), f.key === "Backspace") {
|
|
6637
6643
|
const R = f.target, N = p();
|
|
6638
6644
|
R.selectionStart === 0 && N.length > 0 && (I(N[N.length - 1].idx, !1), e.requestUpdate());
|
|
6639
6645
|
}
|
|
6640
6646
|
}, Q = (f) => {
|
|
6641
|
-
i().dynamicSearch && i().requestRead && (s = !0, e.requestUpdate(),
|
|
6642
|
-
},
|
|
6647
|
+
i().dynamicSearch && i().requestRead && (s = !0, e.requestUpdate(), B(f.target.value));
|
|
6648
|
+
}, B = sn((f) => {
|
|
6643
6649
|
i().requestRead && i().requestRead(f).then(() => {
|
|
6644
6650
|
s = !1, e.requestUpdate();
|
|
6645
6651
|
});
|
|
6646
|
-
}, 300),
|
|
6652
|
+
}, 300), se = (f, R) => {
|
|
6647
6653
|
f.key === "Backspace" && n[R].value === "" && n.length > 1 && (y(R), e.requestUpdate());
|
|
6648
|
-
},
|
|
6654
|
+
}, K = (f) => {
|
|
6649
6655
|
f.key === "Enter" && (h = !0, e.requestUpdate(), setTimeout(() => l == null ? void 0 : l.focus(), 0));
|
|
6650
6656
|
}, E = (f) => {
|
|
6651
6657
|
n[f].value === "" && y(f), (n.length > 1 || n[f] && n[f].value !== "") && n[f] && (n[f].isEditing = !1), n[f] && P(f), e.requestUpdate();
|
|
@@ -6659,7 +6665,7 @@ const ln = $e({
|
|
|
6659
6665
|
class="moz-auto-input tag-input-common tag-input-add"
|
|
6660
6666
|
.value=${f.value}
|
|
6661
6667
|
style="width:1px"
|
|
6662
|
-
${
|
|
6668
|
+
${ne((N) => {
|
|
6663
6669
|
var ke;
|
|
6664
6670
|
const j = N ?? null;
|
|
6665
6671
|
j && M(j), (ke = f.captureEl) == null || ke.call(f, j);
|
|
@@ -6684,7 +6690,7 @@ const ln = $e({
|
|
|
6684
6690
|
/>`;
|
|
6685
6691
|
}, q = (f, R, N) => a`<div class="tag-input-controller" style=${X({ display: f.isSelected !== -1 ? "" : "none" })}>
|
|
6686
6692
|
<div
|
|
6687
|
-
class=${
|
|
6693
|
+
class=${D("tag-input-item", { invalid: !f.isValid })}
|
|
6688
6694
|
data-isValid=${String(f.isValid)}
|
|
6689
6695
|
data-edit-idx=${f.idx}
|
|
6690
6696
|
@mousedown=${(j) => j.stopPropagation()}
|
|
@@ -6694,8 +6700,8 @@ const ln = $e({
|
|
|
6694
6700
|
setValue: (j) => {
|
|
6695
6701
|
n[f.idx].value = j, e.requestUpdate();
|
|
6696
6702
|
},
|
|
6697
|
-
onKeydown: (j) =>
|
|
6698
|
-
onKeyup: (j) =>
|
|
6703
|
+
onKeydown: (j) => se(j, f.idx),
|
|
6704
|
+
onKeyup: (j) => K(j),
|
|
6699
6705
|
onBlur: () => E(f.idx)
|
|
6700
6706
|
}) : a`<span class="tag-input-preview tag-input-common">${f.value}</span>`}
|
|
6701
6707
|
<div class="tag-input-btn-wrapper">
|
|
@@ -6704,9 +6710,9 @@ const ln = $e({
|
|
|
6704
6710
|
role="button"
|
|
6705
6711
|
tabindex="0"
|
|
6706
6712
|
aria-label=${e.locale.TagInput.editTag.replace("{label}", f.value ?? "")}
|
|
6707
|
-
@click=${() =>
|
|
6713
|
+
@click=${() => _(f.idx)}
|
|
6708
6714
|
@keydown=${(j) => {
|
|
6709
|
-
j.key !== "Enter" && j.key !== " " || (j.preventDefault(),
|
|
6715
|
+
j.key !== "Enter" && j.key !== " " || (j.preventDefault(), _(f.idx));
|
|
6710
6716
|
}}
|
|
6711
6717
|
>${ao("10")}</span
|
|
6712
6718
|
>` : v}
|
|
@@ -6730,7 +6736,7 @@ const ln = $e({
|
|
|
6730
6736
|
api: { isValid: S },
|
|
6731
6737
|
render() {
|
|
6732
6738
|
const f = e.props;
|
|
6733
|
-
f.modelValue !== U && (U = f.modelValue, V()), f.itemsSource !==
|
|
6739
|
+
f.modelValue !== U && (U = f.modelValue, V()), f.itemsSource !== W && (W = f.itemsSource, $());
|
|
6734
6740
|
const R = w().toString();
|
|
6735
6741
|
if (R !== Z) {
|
|
6736
6742
|
Z = R;
|
|
@@ -6739,20 +6745,20 @@ const ln = $e({
|
|
|
6739
6745
|
}
|
|
6740
6746
|
const N = Ce(f, on);
|
|
6741
6747
|
return a`
|
|
6742
|
-
<div class=${
|
|
6743
|
-
${f.label ? a`<label class=${
|
|
6748
|
+
<div class=${D("moz-tag-input-wrapper", f.class)} style=${X(ve(f.style))} ${me(N)}>
|
|
6749
|
+
${f.label ? a`<label class=${D("tag-input-label", { required: f.required })}>${f.label}</label>` : v}
|
|
6744
6750
|
<div class="tag-input-grid">
|
|
6745
6751
|
<div
|
|
6746
6752
|
class="tag-input-not-close tag-input-row scrollbar-none"
|
|
6747
6753
|
@mousedown=${(j) => {
|
|
6748
|
-
j.stopPropagation(),
|
|
6754
|
+
j.stopPropagation(), G();
|
|
6749
6755
|
}}
|
|
6750
|
-
@click=${
|
|
6751
|
-
${
|
|
6756
|
+
@click=${le}
|
|
6757
|
+
${ne(t)}
|
|
6752
6758
|
>
|
|
6753
6759
|
${e.slot("left")}
|
|
6754
6760
|
${p().map((j, ke) => q(j, ke, !1))}
|
|
6755
|
-
${h ? a`<span class="tag-input-preview tag-input-common" @click=${
|
|
6761
|
+
${h ? a`<span class="tag-input-preview tag-input-common" @click=${G}>${d}</span>` : v}
|
|
6756
6762
|
${f.limitItemLength && h ? a`<div class="tag-input-counter">${p().length} / ${f.limitItemLength}</div>` : v}
|
|
6757
6763
|
${h ? v : a`<span class="tag-input-add-to">${f.addButtonLabel ? f.addButtonLabel : e.locale.TagInput.add} </span>`}
|
|
6758
6764
|
<div class="flex-1"></div>
|
|
@@ -6769,9 +6775,9 @@ const ln = $e({
|
|
|
6769
6775
|
<div
|
|
6770
6776
|
class="tag-input-placeholder-float tag-input-not-close scrollbar-none shown"
|
|
6771
6777
|
@mousedown=${(R) => {
|
|
6772
|
-
R.stopPropagation(),
|
|
6778
|
+
R.stopPropagation(), G();
|
|
6773
6779
|
}}
|
|
6774
|
-
${
|
|
6780
|
+
${ne(o)}
|
|
6775
6781
|
>
|
|
6776
6782
|
${p().map((R, N) => q(R, N, !0))}
|
|
6777
6783
|
${h ? x({
|
|
@@ -6779,7 +6785,7 @@ const ln = $e({
|
|
|
6779
6785
|
setValue: (R) => {
|
|
6780
6786
|
d = R, e.requestUpdate();
|
|
6781
6787
|
},
|
|
6782
|
-
onKeydown:
|
|
6788
|
+
onKeydown: oe,
|
|
6783
6789
|
onKeyup: () => {
|
|
6784
6790
|
},
|
|
6785
6791
|
onBlur: () => {
|
|
@@ -6794,19 +6800,19 @@ const ln = $e({
|
|
|
6794
6800
|
<div class="tag-input-loading-ball-2"></div>
|
|
6795
6801
|
<div class="tag-input-loading-ball-3"></div>
|
|
6796
6802
|
</div>` : v}
|
|
6797
|
-
${f.limitItemLength && h ? a`<div class="tag-input-counter" @click=${
|
|
6803
|
+
${f.limitItemLength && h ? a`<div class="tag-input-counter" @click=${G}>
|
|
6798
6804
|
${p().length} / ${f.limitItemLength}
|
|
6799
6805
|
</div>` : v}
|
|
6800
6806
|
${h ? v : a`<span class="tag-input-add-to flex-1">${f.addButtonLabel ? f.addButtonLabel : ""} </span>`}
|
|
6801
6807
|
</div>
|
|
6802
6808
|
${f.simplify ? v : a`<div class="tag-input-dropdown-outer-wrapper" @mousedown=${(R) => R.stopPropagation()}>
|
|
6803
|
-
<div class=${
|
|
6809
|
+
<div class=${D("tag-input-dropdown-wrapper", { "expand-top": f.isExpandTop })}>
|
|
6804
6810
|
<div class="tag-input-dropdown-inner-wrapper">
|
|
6805
6811
|
<div class="tag-input-dropdown-title"></div>
|
|
6806
6812
|
${n.map(
|
|
6807
6813
|
(R, N) => a`<div class="dropdown-tag-input-item-wrapper tag-input-controller">
|
|
6808
6814
|
<div
|
|
6809
|
-
class=${
|
|
6815
|
+
class=${D("tag-input-item tag-item-limit-width", { invalid: !R.isValid })}
|
|
6810
6816
|
data-isValid=${String(R.isValid)}
|
|
6811
6817
|
data-edit-idx=${N}
|
|
6812
6818
|
@click=${() => k(N)}
|
|
@@ -6816,8 +6822,8 @@ const ln = $e({
|
|
|
6816
6822
|
setValue: (j) => {
|
|
6817
6823
|
n[N].value = j, e.requestUpdate();
|
|
6818
6824
|
},
|
|
6819
|
-
onKeydown: (j) =>
|
|
6820
|
-
onKeyup: (j) =>
|
|
6825
|
+
onKeydown: (j) => se(j, N),
|
|
6826
|
+
onKeyup: (j) => K(j),
|
|
6821
6827
|
onBlur: () => E(N)
|
|
6822
6828
|
}) : a`<span class="tag-input-preview tag-input-common">
|
|
6823
6829
|
<span>${R.value}</span>
|
|
@@ -6825,7 +6831,7 @@ const ln = $e({
|
|
|
6825
6831
|
${!R.isEditing && !f.disableUpdate ? a`<span
|
|
6826
6832
|
class="tag-input-button cursor-pointer"
|
|
6827
6833
|
@click=${(j) => {
|
|
6828
|
-
j.stopPropagation(),
|
|
6834
|
+
j.stopPropagation(), _(N);
|
|
6829
6835
|
}}
|
|
6830
6836
|
>${ao("10")}</span
|
|
6831
6837
|
>` : v}
|
|
@@ -6920,11 +6926,11 @@ const an = 500, dn = $e({
|
|
|
6920
6926
|
}, U = () => {
|
|
6921
6927
|
(e.props.beforeClose ?? (() => {
|
|
6922
6928
|
})) && (P(!1), window.removeEventListener("mousedown", V), window.removeEventListener("resize", U));
|
|
6923
|
-
},
|
|
6929
|
+
}, W = (E, k) => {
|
|
6924
6930
|
E instanceof Function && (s = E(k)), $(!0), setTimeout(() => $(!0), 60);
|
|
6925
6931
|
}, Z = () => {
|
|
6926
|
-
n ? U() :
|
|
6927
|
-
},
|
|
6932
|
+
n ? U() : W();
|
|
6933
|
+
}, ie = () => {
|
|
6928
6934
|
const E = e.props.fixPosition;
|
|
6929
6935
|
if (!E) return;
|
|
6930
6936
|
const k = E.selector && document.querySelector(E.selector) || t;
|
|
@@ -6932,49 +6938,49 @@ const an = 500, dn = $e({
|
|
|
6932
6938
|
const M = k.getBoundingClientRect(), x = l.value.getBoundingClientRect();
|
|
6933
6939
|
m = M.left + k.clientWidth < x.left + o.clientWidth, i = M.left + k.clientWidth < x.left + o.clientWidth * 2, u = M.top + k.clientHeight < x.top + o.clientHeight, E.useTeleport ? (o.style.left = `${x.left}px`, o.style.top = `${x.top}px`) : (o.style.left = `${l.value.offsetLeft}px`, o.style.top = `${l.value.offsetTop}px`), e.requestUpdate();
|
|
6934
6940
|
}, fe = (E) => {
|
|
6935
|
-
d || (o && t && (e.props.fixPosition ?
|
|
6941
|
+
d || (o && t && (e.props.fixPosition ? ie() : (m = t.clientWidth < E.clientX + o.clientWidth, i = t.clientWidth < E.clientX + o.clientWidth * 2, u = t.clientHeight < E.clientY + o.clientHeight, o.style.left = `${E.clientX}px`, o.style.top = `${E.clientY}px`)), t && (t.style.pointerEvents = "none"), window.addEventListener("mousedown", V), window.addEventListener("resize", U), d = !0, e.requestUpdate());
|
|
6936
6942
|
};
|
|
6937
6943
|
e.onCleanup(() => {
|
|
6938
6944
|
window.removeEventListener("mousedown", V), window.removeEventListener("resize", U);
|
|
6939
6945
|
});
|
|
6940
|
-
const
|
|
6946
|
+
const le = (E) => {
|
|
6941
6947
|
let k = C.get(E);
|
|
6942
6948
|
return k || (k = rn((M, x, q) => {
|
|
6943
|
-
x.children && (
|
|
6949
|
+
x.children && (A(q, x), w.set(q, M), e.requestUpdate());
|
|
6944
6950
|
}, 400), C.set(E, k)), k;
|
|
6945
|
-
},
|
|
6951
|
+
}, A = (E, k) => {
|
|
6946
6952
|
if (!k.children || S.get(E)) return;
|
|
6947
6953
|
const M = I.get(E);
|
|
6948
6954
|
if (!M) return;
|
|
6949
6955
|
const x = M.getBoundingClientRect();
|
|
6950
6956
|
S.set(E, M.clientHeight + x.top > document.body.offsetHeight);
|
|
6951
|
-
},
|
|
6952
|
-
E.function ? (E.function(), U()) : E.children && (
|
|
6953
|
-
},
|
|
6954
|
-
const q = w.get(x) ?? !1, f = S.get(x) ?? !1, R =
|
|
6957
|
+
}, _ = (E, k) => {
|
|
6958
|
+
E.function ? (E.function(), U()) : E.children && (A(k, E), w.set(k, !0), e.requestUpdate());
|
|
6959
|
+
}, G = (E) => typeof E.disabled == "function" ? E.disabled() : !!E.disabled, oe = (E, k, M, x) => {
|
|
6960
|
+
const q = w.get(x) ?? !1, f = S.get(x) ?? !1, R = le(x);
|
|
6955
6961
|
return a`<div
|
|
6956
|
-
class=${
|
|
6962
|
+
class=${D({
|
|
6957
6963
|
"context-menu-item-enable-hover": !("hover" in E) || E.hover,
|
|
6958
6964
|
"context-menu-item-wrapper": !0,
|
|
6959
6965
|
"context-menu-item-wrapper-selected": q,
|
|
6960
|
-
"context-menu-item-wrapper-disabled":
|
|
6966
|
+
"context-menu-item-wrapper-disabled": G(E)
|
|
6961
6967
|
})}
|
|
6962
6968
|
@mouseenter=${() => R(!0, E, x)}
|
|
6963
6969
|
@mouseleave=${() => R(!1, E, x)}
|
|
6964
6970
|
>
|
|
6965
6971
|
<div
|
|
6966
|
-
class=${
|
|
6972
|
+
class=${D({
|
|
6967
6973
|
"context-menu-sub-items-wrapper-right": M && !f,
|
|
6968
6974
|
"context-menu-sub-items-wrapper-bottom": f && !M,
|
|
6969
6975
|
"context-menu-sub-items-wrapper-bottom-right": f && M,
|
|
6970
6976
|
"context-menu-sub-items-wrapper-hide": !E.children || !q,
|
|
6971
6977
|
"context-menu-sub-items-wrapper": !f && !M
|
|
6972
6978
|
})}
|
|
6973
|
-
${
|
|
6979
|
+
${ne((N) => {
|
|
6974
6980
|
N && I.set(x, N);
|
|
6975
6981
|
})}
|
|
6976
6982
|
>
|
|
6977
|
-
${E.children ?
|
|
6983
|
+
${E.children ? B(E.children, k + 1, M, x) : v}
|
|
6978
6984
|
</div>
|
|
6979
6985
|
${E.template ? a`<div
|
|
6980
6986
|
class=${`context-menu-item-${E.template}`}
|
|
@@ -6988,9 +6994,9 @@ const an = 500, dn = $e({
|
|
|
6988
6994
|
class="context-menu-item"
|
|
6989
6995
|
role="menuitem"
|
|
6990
6996
|
tabindex="-1"
|
|
6991
|
-
aria-disabled=${
|
|
6997
|
+
aria-disabled=${G(E) ? "true" : "false"}
|
|
6992
6998
|
aria-haspopup=${E.children ? "menu" : "false"}
|
|
6993
|
-
@click=${() =>
|
|
6999
|
+
@click=${() => _(E, x)}
|
|
6994
7000
|
>
|
|
6995
7001
|
<div class="context-menu-item-left">${E.text}</div>
|
|
6996
7002
|
${E.children ? a`<div class="context-menu-item-right"></div>` : v}
|
|
@@ -6999,11 +7005,11 @@ const an = 500, dn = $e({
|
|
|
6999
7005
|
}, Q = (E) => {
|
|
7000
7006
|
const k = E.template, M = k.includes("[col-padding]") ? "col-padding" : k.includes("[row-padding]") ? "row-padding" : k.includes("[padding]") ? "padding" : null, x = e.slots.has(k) ? e.slot(k, { props: { ...E, close: U } }) : v;
|
|
7001
7007
|
return M ? a`<div class="context-menu-item-template" data-layout=${M}>${x}</div>` : a`${x}`;
|
|
7002
|
-
},
|
|
7008
|
+
}, B = (E, k, M, x) => {
|
|
7003
7009
|
const q = k === 0;
|
|
7004
7010
|
return a`<div
|
|
7005
7011
|
role=${q ? "menu" : "group"}
|
|
7006
|
-
class=${
|
|
7012
|
+
class=${D("context-menu-content-wrapper", q ? e.props.class : void 0)}
|
|
7007
7013
|
data-noPadding=${String(!!e.props.noPadding)}
|
|
7008
7014
|
style=${X({
|
|
7009
7015
|
minWidth: e.props.minWidth,
|
|
@@ -7015,19 +7021,19 @@ const an = 500, dn = $e({
|
|
|
7015
7021
|
${E.map((f, R) => {
|
|
7016
7022
|
const N = `${x}/${k}-${R}`;
|
|
7017
7023
|
return a`<div class="context-menu-item-outer-wrapper" style=${X({ display: f != null && f.hidden ? "none" : "" })}>
|
|
7018
|
-
${f.separator ? a`<div class="context-menu-separator"></div>` :
|
|
7024
|
+
${f.separator ? a`<div class="context-menu-separator"></div>` : oe(f, k, M, N)}
|
|
7019
7025
|
</div>`;
|
|
7020
7026
|
})}
|
|
7021
7027
|
</div>`;
|
|
7022
|
-
},
|
|
7028
|
+
}, se = () => {
|
|
7023
7029
|
const E = e.props.fixPosition;
|
|
7024
7030
|
return E ? (typeof E.left == "string" || typeof E.left == "number" || typeof E.top == "string" || typeof E.top == "number") && E.useTeleport !== !0 : !1;
|
|
7025
|
-
},
|
|
7031
|
+
}, K = () => {
|
|
7026
7032
|
const E = e.props, k = s || E.itemSource;
|
|
7027
7033
|
if (!n || !k) return v;
|
|
7028
7034
|
const M = E.transition, x = E.direction;
|
|
7029
7035
|
return a`<div
|
|
7030
|
-
class=${
|
|
7036
|
+
class=${D({
|
|
7031
7037
|
[`before-${M}`]: !0,
|
|
7032
7038
|
[`after-${M}`]: r && h,
|
|
7033
7039
|
"context-menu-content-hide": !n,
|
|
@@ -7042,17 +7048,17 @@ const an = 500, dn = $e({
|
|
|
7042
7048
|
...E.toBottomCenter ? { transform: "translate(-50%, 0)" } : {}
|
|
7043
7049
|
})}
|
|
7044
7050
|
@contextmenu=${(q) => q.preventDefault()}
|
|
7045
|
-
${
|
|
7051
|
+
${ne((q) => {
|
|
7046
7052
|
q && (o = q, y());
|
|
7047
7053
|
})}
|
|
7048
7054
|
>
|
|
7049
|
-
${
|
|
7055
|
+
${B(k, 0, i, "root")}
|
|
7050
7056
|
</div>`;
|
|
7051
7057
|
};
|
|
7052
7058
|
return {
|
|
7053
7059
|
api: {
|
|
7054
7060
|
state: () => n,
|
|
7055
|
-
open:
|
|
7061
|
+
open: W,
|
|
7056
7062
|
close: U,
|
|
7057
7063
|
toggle: Z
|
|
7058
7064
|
},
|
|
@@ -7064,9 +7070,9 @@ const an = 500, dn = $e({
|
|
|
7064
7070
|
left: typeof E.fixPosition.left == "string" ? E.fixPosition.left : `${E.fixPosition.left}px`,
|
|
7065
7071
|
top: typeof E.fixPosition.top == "string" ? E.fixPosition.top : `${E.fixPosition.top}px`
|
|
7066
7072
|
})}
|
|
7067
|
-
${
|
|
7073
|
+
${ne(l)}
|
|
7068
7074
|
></div>
|
|
7069
|
-
${
|
|
7075
|
+
${se() ? K() : v}` : v;
|
|
7070
7076
|
},
|
|
7071
7077
|
renderPortal() {
|
|
7072
7078
|
const E = s || e.props.itemSource;
|
|
@@ -7075,11 +7081,11 @@ const an = 500, dn = $e({
|
|
|
7075
7081
|
class="context-menu-wrapper"
|
|
7076
7082
|
@mouseenter=${fe}
|
|
7077
7083
|
@contextmenu=${(k) => k.preventDefault()}
|
|
7078
|
-
${
|
|
7084
|
+
${ne((k) => {
|
|
7079
7085
|
k && (t = k);
|
|
7080
7086
|
})}
|
|
7081
7087
|
></div>
|
|
7082
|
-
${
|
|
7088
|
+
${se() ? v : K()}
|
|
7083
7089
|
`;
|
|
7084
7090
|
}
|
|
7085
7091
|
};
|
|
@@ -7184,41 +7190,41 @@ const vn = $e({
|
|
|
7184
7190
|
}, V = (c) => {
|
|
7185
7191
|
const T = m();
|
|
7186
7192
|
return T == null ? !1 : e.props.useObjKeyProp ? typeof T != "object" ? !1 : y().every((Y) => c[Y] === T[Y]) : c[C()] === T;
|
|
7187
|
-
}, U = () => m() == null || !e.props.itemsSource ? null : e.props.itemsSource.find((c) => V(c)) ?? null,
|
|
7193
|
+
}, U = () => m() == null || !e.props.itemsSource ? null : e.props.itemsSource.find((c) => V(c)) ?? null, W = (c) => e.props.itemsSource ? e.props.itemsSource.find((T) => T[C()] === c) ?? null : null, Z = () => {
|
|
7188
7194
|
const c = m();
|
|
7189
7195
|
if (c == null) return null;
|
|
7190
|
-
const T = e.props.useObjKeyProp ? U() :
|
|
7196
|
+
const T = e.props.useObjKeyProp ? U() : W(c);
|
|
7191
7197
|
return T ? y().map((Y) => String(T[Y] ?? "")).join(e.props.separator) : null;
|
|
7192
|
-
},
|
|
7198
|
+
}, ie = () => {
|
|
7193
7199
|
const c = y(), T = e.props.columnWidths ?? [], Y = c.reduce((ue, ze, Pe) => ue + (T[Pe] ?? uo), 0), re = Math.max(0, c.length - 1) * mn;
|
|
7194
7200
|
return Y + re + pn + po;
|
|
7195
7201
|
}, fe = () => {
|
|
7196
7202
|
const c = e.props.width;
|
|
7197
|
-
return c != null ? typeof c == "number" ? `${Le(c)}rem` : c : `${
|
|
7198
|
-
},
|
|
7203
|
+
return c != null ? typeof c == "number" ? `${Le(c)}rem` : c : `${ie()}px`;
|
|
7204
|
+
}, le = (c) => {
|
|
7199
7205
|
const T = (e.props.columnWidths ?? [])[c] ?? uo, Y = c === y().length - 1;
|
|
7200
7206
|
return `${T + (Y ? po : 0)}px`;
|
|
7201
|
-
},
|
|
7207
|
+
}, A = () => {
|
|
7202
7208
|
if (!p) return e.props.itemsSource ?? [];
|
|
7203
7209
|
const c = p.toLowerCase();
|
|
7204
7210
|
return (e.props.itemsSource ?? []).filter(
|
|
7205
7211
|
(T) => y().some((Y) => String(T[Y] ?? "").toLowerCase().indexOf(c) > -1)
|
|
7206
7212
|
);
|
|
7207
|
-
},
|
|
7213
|
+
}, _ = (c) => {
|
|
7208
7214
|
if (!p) return [{ part: c, highlight: !1 }];
|
|
7209
7215
|
const T = gn(p), Y = new RegExp(`(${T})`, "gi");
|
|
7210
7216
|
return c.split(Y).map((re) => ({ part: re, highlight: p.toLowerCase() === re.toLowerCase() }));
|
|
7211
|
-
},
|
|
7217
|
+
}, G = () => {
|
|
7212
7218
|
const c = m();
|
|
7213
7219
|
return e.props.useObjKeyProp ? c == null ? "" : String(c) : c;
|
|
7214
|
-
},
|
|
7220
|
+
}, oe = () => S.save || S.blur || S.change, Q = () => {
|
|
7215
7221
|
const c = [];
|
|
7216
7222
|
return e.props.required && c.push({
|
|
7217
7223
|
message: e.props.requiredMessage ?? e.locale.TableSelect.requiredMessage.replace("{label}", e.props.label || ""),
|
|
7218
7224
|
type: "save",
|
|
7219
7225
|
validator: (T) => !!T
|
|
7220
7226
|
}), [...c, ...e.props.rules ?? []];
|
|
7221
|
-
},
|
|
7227
|
+
}, B = async (c, T) => {
|
|
7222
7228
|
const Y = Q();
|
|
7223
7229
|
if (Y.length <= 0 || e.props.disabled) return !0;
|
|
7224
7230
|
S[T] = "", e.requestUpdate();
|
|
@@ -7227,15 +7233,15 @@ const vn = $e({
|
|
|
7227
7233
|
if (!await ue.validator(c))
|
|
7228
7234
|
return S[T] = ue.message, e.requestUpdate(), !1;
|
|
7229
7235
|
return !0;
|
|
7230
|
-
},
|
|
7231
|
-
validate:
|
|
7236
|
+
}, se = async (c = "save") => oe() !== "" ? !1 : await B(G(), c), K = {
|
|
7237
|
+
validate: se,
|
|
7232
7238
|
initValidator: () => {
|
|
7233
7239
|
S.change = "", S.blur = "", S.save = "", e.requestUpdate();
|
|
7234
7240
|
}
|
|
7235
7241
|
};
|
|
7236
|
-
e.validator && (e.validator.addValidator(
|
|
7242
|
+
e.validator && (e.validator.addValidator(K), e.onCleanup(() => {
|
|
7237
7243
|
var c;
|
|
7238
|
-
return (c = e.validator) == null ? void 0 : c.removeValidator(
|
|
7244
|
+
return (c = e.validator) == null ? void 0 : c.removeValidator(K);
|
|
7239
7245
|
}));
|
|
7240
7246
|
const E = new At({
|
|
7241
7247
|
anchor: () => o.value ?? null,
|
|
@@ -7261,11 +7267,11 @@ const vn = $e({
|
|
|
7261
7267
|
u !== c && (u = c, e.requestUpdate(), c ? (x = Dt(), E.open(), S.save = "", window.addEventListener("keydown", k), queueMicrotask(() => {
|
|
7262
7268
|
var Y;
|
|
7263
7269
|
if (m() != null) {
|
|
7264
|
-
const re =
|
|
7270
|
+
const re = A().findIndex((ue) => V(ue));
|
|
7265
7271
|
re >= 0 && (w = re, d && (d.scrollTop = M(re)), e.requestUpdate());
|
|
7266
7272
|
}
|
|
7267
7273
|
h.value ? h.value.focus() : (Y = r.value) == null || Y.focus();
|
|
7268
|
-
})) : (x == null || x.release(), x = null, E.close(), e.emit("close"),
|
|
7274
|
+
})) : (x == null || x.release(), x = null, E.close(), e.emit("close"), B(G(), "blur"), w = -1, window.removeEventListener("keydown", k), p = "", e.emit("close"), queueMicrotask(() => {
|
|
7269
7275
|
var T;
|
|
7270
7276
|
return (T = r.value) == null ? void 0 : T.focus();
|
|
7271
7277
|
})));
|
|
@@ -7280,48 +7286,48 @@ const vn = $e({
|
|
|
7280
7286
|
queueMicrotask(() => P.scrollToIndex(w, { align: "auto" }));
|
|
7281
7287
|
}, j = (c) => {
|
|
7282
7288
|
c.preventDefault();
|
|
7283
|
-
const T =
|
|
7289
|
+
const T = A().length - 1;
|
|
7284
7290
|
T < 0 || (w = w >= T ? 0 : w + 1, e.requestUpdate(), N());
|
|
7285
7291
|
}, ke = (c) => {
|
|
7286
7292
|
c.preventDefault();
|
|
7287
|
-
const T =
|
|
7293
|
+
const T = A().length - 1;
|
|
7288
7294
|
T < 0 || (w = w <= 0 ? T : w - 1, e.requestUpdate(), N());
|
|
7289
7295
|
}, Ve = (c) => {
|
|
7290
7296
|
c.preventDefault();
|
|
7291
|
-
const T =
|
|
7297
|
+
const T = A();
|
|
7292
7298
|
w >= 0 && w < T.length && R(T[w]);
|
|
7293
7299
|
}, je = (c) => {
|
|
7294
7300
|
c.key === "ArrowDown" ? j(c) : c.key === "ArrowUp" ? ke(c) : c.key === "Enter" && Ve(c);
|
|
7295
7301
|
}, He = fn((c) => {
|
|
7296
7302
|
p = c.target.value;
|
|
7297
|
-
const T =
|
|
7303
|
+
const T = A().length;
|
|
7298
7304
|
w = T > 0 ? 0 : -1, e.requestUpdate(), queueMicrotask(() => {
|
|
7299
7305
|
P.setOptions({ ...P.options, count: T }), P.measure(), d && (d.scrollTop = 0, P.scrollToIndex(0), P.measure());
|
|
7300
7306
|
});
|
|
7301
7307
|
}, 300);
|
|
7302
7308
|
return {
|
|
7303
|
-
api: { validate:
|
|
7309
|
+
api: { validate: se },
|
|
7304
7310
|
render() {
|
|
7305
7311
|
const c = e.props, T = m();
|
|
7306
7312
|
if (T !== I) {
|
|
7307
7313
|
I = T;
|
|
7308
7314
|
const ze = T;
|
|
7309
7315
|
queueMicrotask(() => {
|
|
7310
|
-
|
|
7316
|
+
B(G(), "change");
|
|
7311
7317
|
let Pe = null;
|
|
7312
|
-
c.useObjKeyProp ? Pe = U() : ze != null && (Pe =
|
|
7318
|
+
c.useObjKeyProp ? Pe = U() : ze != null && (Pe = W(ze)), e.emit("change", ze, Pe);
|
|
7313
7319
|
});
|
|
7314
7320
|
}
|
|
7315
7321
|
const Y = Ce(c, hn), { aria: re, dom: ue } = ht(Y);
|
|
7316
7322
|
return a`
|
|
7317
7323
|
<div
|
|
7318
|
-
class=${
|
|
7319
|
-
"is-invalid":
|
|
7324
|
+
class=${D("moz-table-select", {
|
|
7325
|
+
"is-invalid": oe() !== "",
|
|
7320
7326
|
"is-open": u,
|
|
7321
7327
|
disabled: !!c.disabled
|
|
7322
7328
|
})}
|
|
7323
7329
|
style=${X(ve(c.style))}
|
|
7324
|
-
${
|
|
7330
|
+
${ne(t)}
|
|
7325
7331
|
>
|
|
7326
7332
|
<div class="input-wrapper">
|
|
7327
7333
|
${c.label ? Ke({ disabled: c.disabled, required: c.required }, c.label) : v}
|
|
@@ -7329,7 +7335,7 @@ const vn = $e({
|
|
|
7329
7335
|
class="moz-input-container select-input-container"
|
|
7330
7336
|
style=${X({ width: fe() })}
|
|
7331
7337
|
@click=${f}
|
|
7332
|
-
${
|
|
7338
|
+
${ne(o)}
|
|
7333
7339
|
>
|
|
7334
7340
|
<input
|
|
7335
7341
|
${me(ue)}
|
|
@@ -7338,7 +7344,7 @@ const vn = $e({
|
|
|
7338
7344
|
?disabled=${!!c.disabled}
|
|
7339
7345
|
readonly
|
|
7340
7346
|
tabindex="-1"
|
|
7341
|
-
class=${
|
|
7347
|
+
class=${D("select-display-input", { "select-display-input--disabled": c.disabled })}
|
|
7342
7348
|
/>
|
|
7343
7349
|
<button
|
|
7344
7350
|
type="button"
|
|
@@ -7349,19 +7355,19 @@ const vn = $e({
|
|
|
7349
7355
|
aria-expanded=${u ? "true" : "false"}
|
|
7350
7356
|
aria-label=${Ee(re["aria-label"] ?? c.label)}
|
|
7351
7357
|
?disabled=${!!c.disabled}
|
|
7352
|
-
${
|
|
7358
|
+
${ne(r)}
|
|
7353
7359
|
>
|
|
7354
7360
|
${u ? Qt("14", "var(--moz-color-accent)") : Xt("14", "var(--moz-color-text-subtle)", c.disabled)}
|
|
7355
7361
|
</button>
|
|
7356
7362
|
</div>
|
|
7357
7363
|
</div>
|
|
7358
|
-
${
|
|
7364
|
+
${oe() !== "" ? a`<span class="moz-input-invalid-message">${oe()}</span>` : v}
|
|
7359
7365
|
</div>
|
|
7360
7366
|
`;
|
|
7361
7367
|
},
|
|
7362
7368
|
renderPortal() {
|
|
7363
7369
|
if (!u) return v;
|
|
7364
|
-
const c = e.props, T = y(), Y =
|
|
7370
|
+
const c = e.props, T = y(), Y = A(), re = !!c.columnHeaders && c.columnHeaders.length > 0;
|
|
7365
7371
|
P.options.count !== Y.length && P.setOptions({ ...P.options, count: Y.length }), P._willUpdate();
|
|
7366
7372
|
const ue = P.getTotalSize(), ze = Vt(
|
|
7367
7373
|
P.getVirtualItems(),
|
|
@@ -7370,19 +7376,19 @@ const vn = $e({
|
|
|
7370
7376
|
d
|
|
7371
7377
|
).map((ce) => {
|
|
7372
7378
|
if (ce.index >= Y.length) return null;
|
|
7373
|
-
const
|
|
7374
|
-
return
|
|
7379
|
+
const te = Y[ce.index];
|
|
7380
|
+
return te ? { index: ce.index, value: te, start: ce.start } : null;
|
|
7375
7381
|
}).filter((ce) => ce !== null), Pe = c.listWidth ? typeof c.listWidth == "number" ? `${c.listWidth}px` : c.listWidth : void 0;
|
|
7376
7382
|
return a`<div
|
|
7377
|
-
class=${
|
|
7383
|
+
class=${D("table-list-box moz-table-select-list", { "no-label": !c.label }, c.class)}
|
|
7378
7384
|
style=${X({ width: Pe })}
|
|
7379
7385
|
@keydown=${je}
|
|
7380
|
-
${
|
|
7386
|
+
${ne(l)}
|
|
7381
7387
|
>
|
|
7382
7388
|
${c.useFilter ? a`<div class="filter-input">
|
|
7383
7389
|
<div class="search-icon">${Jt("12", "var(--moz-color-text-subtle)")}</div>
|
|
7384
7390
|
<input
|
|
7385
|
-
${
|
|
7391
|
+
${ne(h)}
|
|
7386
7392
|
@mousedown=${(ce) => ce.stopPropagation()}
|
|
7387
7393
|
placeholder=${c.searchPlaceholder ?? e.locale.TableSelect.searchPlaceholder}
|
|
7388
7394
|
@input=${He}
|
|
@@ -7391,33 +7397,33 @@ const vn = $e({
|
|
|
7391
7397
|
</div>` : v}
|
|
7392
7398
|
${re ? a`<div class="table-header">
|
|
7393
7399
|
${T.map(
|
|
7394
|
-
(ce,
|
|
7400
|
+
(ce, te) => a`<div
|
|
7395
7401
|
class="table-header-cell"
|
|
7396
|
-
style=${X({ width:
|
|
7402
|
+
style=${X({ width: le(te), minWidth: le(te), maxWidth: le(te) })}
|
|
7397
7403
|
>
|
|
7398
|
-
${(c.columnHeaders ?? [])[
|
|
7404
|
+
${(c.columnHeaders ?? [])[te] ?? ""}
|
|
7399
7405
|
</div>`
|
|
7400
7406
|
)}
|
|
7401
7407
|
</div>` : v}
|
|
7402
7408
|
<div
|
|
7403
|
-
class=${
|
|
7409
|
+
class=${D("list-box-container", {
|
|
7404
7410
|
"list-box-container--with-filter": c.useFilter,
|
|
7405
7411
|
"list-box-container--with-header": re,
|
|
7406
7412
|
"list-box-container--with-filter-header": c.useFilter && re
|
|
7407
7413
|
})}
|
|
7408
|
-
${
|
|
7414
|
+
${ne($)}
|
|
7409
7415
|
>
|
|
7410
|
-
<div class="inner-container" style=${X({ height: `${ue}px` })} ${
|
|
7411
|
-
${ze.map(({ index: ce, value:
|
|
7412
|
-
const Ae = V(
|
|
7416
|
+
<div class="inner-container" style=${X({ height: `${ue}px` })} ${ne(n)}>
|
|
7417
|
+
${ze.map(({ index: ce, value: te, start: Te }) => {
|
|
7418
|
+
const Ae = V(te);
|
|
7413
7419
|
return a`<div
|
|
7414
7420
|
data-index=${ce}
|
|
7415
|
-
${
|
|
7421
|
+
${ne((z) => {
|
|
7416
7422
|
z && P.measureElement(z);
|
|
7417
7423
|
})}
|
|
7418
7424
|
style=${X({ transform: `translateY(${Te}px)` })}
|
|
7419
|
-
class=${
|
|
7420
|
-
@click=${() => R(
|
|
7425
|
+
class=${D("virtual-row table-row", { "row-selected": Ae, "row-focused": ce === w })}
|
|
7426
|
+
@click=${() => R(te)}
|
|
7421
7427
|
@mouseenter=${() => {
|
|
7422
7428
|
w = ce, e.requestUpdate();
|
|
7423
7429
|
}}
|
|
@@ -7426,11 +7432,11 @@ const vn = $e({
|
|
|
7426
7432
|
${T.map(
|
|
7427
7433
|
(z, pe) => a`<div
|
|
7428
7434
|
class="table-cell"
|
|
7429
|
-
style=${X({ width:
|
|
7430
|
-
title=${String(
|
|
7435
|
+
style=${X({ width: le(pe), minWidth: le(pe), maxWidth: le(pe) })}
|
|
7436
|
+
title=${String(te[z] ?? "")}
|
|
7431
7437
|
>
|
|
7432
|
-
${
|
|
7433
|
-
(De) => a`<span class=${
|
|
7438
|
+
${_(String(te[z] ?? "")).map(
|
|
7439
|
+
(De) => a`<span class=${D({ highlight: De.highlight })}>${De.part}</span>`
|
|
7434
7440
|
)}
|
|
7435
7441
|
</div>`
|
|
7436
7442
|
)}
|
|
@@ -7696,8 +7702,8 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7696
7702
|
}, I = (b) => {
|
|
7697
7703
|
e.controlled("modelValue") || (p = b), e.emit("update:modelValue", b), e.requestUpdate();
|
|
7698
7704
|
};
|
|
7699
|
-
let C = !1, y = "", P = !1, $ = !1, V = !1, U = {},
|
|
7700
|
-
const Z = { change: "", blur: "", save: "" },
|
|
7705
|
+
let C = !1, y = "", P = !1, $ = !1, V = !1, U = {}, W = [];
|
|
7706
|
+
const Z = { change: "", blur: "", save: "" }, ie = /* @__PURE__ */ new Set(), fe = /* @__PURE__ */ new Set(), le = { categoryLv1Set: ie, categoryLv2Set: fe }, A = (() => {
|
|
7701
7707
|
try {
|
|
7702
7708
|
const b = getComputedStyle(document.documentElement).getPropertyValue("--size-input-dropdown-item-height");
|
|
7703
7709
|
return b ? +b.trim().replace("px", "") : 24;
|
|
@@ -7705,22 +7711,22 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7705
7711
|
return 24;
|
|
7706
7712
|
}
|
|
7707
7713
|
})();
|
|
7708
|
-
let
|
|
7709
|
-
const
|
|
7710
|
-
let
|
|
7711
|
-
const
|
|
7712
|
-
|
|
7714
|
+
let _ = A;
|
|
7715
|
+
const G = () => e.slots.has("list-item");
|
|
7716
|
+
let oe = [], Q = [], B = e.props.itemsSource;
|
|
7717
|
+
const se = () => {
|
|
7718
|
+
oe = $n(e.props.itemsSource ?? [], u()), Q = Sn(oe);
|
|
7713
7719
|
};
|
|
7714
|
-
|
|
7715
|
-
const
|
|
7720
|
+
se();
|
|
7721
|
+
const K = () => {
|
|
7716
7722
|
const b = /* @__PURE__ */ new Map();
|
|
7717
|
-
return
|
|
7718
|
-
}, E = (b) => b.name ?? "", k = (b) => new Set(S()).has(b.code), M = (b) =>
|
|
7723
|
+
return oe.forEach((L) => b.set(L.code, L)), b;
|
|
7724
|
+
}, E = (b) => b.name ?? "", k = (b) => new Set(S()).has(b.code), M = (b) => W.some((L) => ut(L.item, b)), x = () => new Set(S()), q = () => {
|
|
7719
7725
|
let b = [];
|
|
7720
7726
|
if (!y)
|
|
7721
7727
|
b = Q;
|
|
7722
7728
|
else {
|
|
7723
|
-
const L = [],
|
|
7729
|
+
const L = [], O = /* @__PURE__ */ new Set(), de = (ae) => `depth${ae.depth}_${ae.code}`;
|
|
7724
7730
|
for (const ae of Q)
|
|
7725
7731
|
if (ae.depth !== s) {
|
|
7726
7732
|
for (; L.length && L[L.length - 1].depth >= ae.depth; ) L.pop();
|
|
@@ -7728,14 +7734,14 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7728
7734
|
} else if (E(ae).toLowerCase().indexOf(y.toLowerCase()) > -1) {
|
|
7729
7735
|
for (const be of L) {
|
|
7730
7736
|
const qe = de(be);
|
|
7731
|
-
|
|
7737
|
+
O.has(qe) || (b.push(be), O.add(qe));
|
|
7732
7738
|
}
|
|
7733
7739
|
const ge = de(ae);
|
|
7734
|
-
|
|
7740
|
+
O.has(ge) || (b.push(ae), O.add(ge));
|
|
7735
7741
|
}
|
|
7736
7742
|
}
|
|
7737
7743
|
if (V) {
|
|
7738
|
-
const L = /* @__PURE__ */ new Set(),
|
|
7744
|
+
const L = /* @__PURE__ */ new Set(), O = K(), de = x();
|
|
7739
7745
|
b.filter((ge) => {
|
|
7740
7746
|
if (ke(ge, de)) return !0;
|
|
7741
7747
|
if (m() && !Xe(d, ge.depth)) {
|
|
@@ -7746,32 +7752,32 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7746
7752
|
}).forEach((ge) => {
|
|
7747
7753
|
let be = ge;
|
|
7748
7754
|
for (; be && (L.add(be.code), !!be.parent); )
|
|
7749
|
-
be =
|
|
7755
|
+
be = O.get(be.parent);
|
|
7750
7756
|
}), b = b.filter((ge) => L.has(ge.code));
|
|
7751
7757
|
}
|
|
7752
7758
|
return b;
|
|
7753
7759
|
}, f = () => q().filter((b) => !(b.categoryLv1ID || b.categoryLv2ID)), R = () => {
|
|
7754
7760
|
const b = f();
|
|
7755
7761
|
return q().filter((L) => !b.includes(L));
|
|
7756
|
-
}, N = () => new Set(R().map((b) => b.code)), j = () => kn(R()), ke = (b, L) => m() ? Xe(s, b.depth) ? L.has(b.code) :
|
|
7762
|
+
}, N = () => new Set(R().map((b) => b.code)), j = () => kn(R()), ke = (b, L) => m() ? Xe(s, b.depth) ? L.has(b.code) : ie.has(b.code) || fe.has(b.code) : w() === b.code, Ve = (b) => {
|
|
7757
7763
|
if (Xe(d, b.depth)) return !0;
|
|
7758
7764
|
const L = $t(q(), b);
|
|
7759
7765
|
return L.length === 0 ? !0 : ho(wt(L), x());
|
|
7760
7766
|
}, je = () => {
|
|
7761
7767
|
const b = S().length, L = f().length;
|
|
7762
7768
|
if (b < L || b === 0 || L === 0) return !1;
|
|
7763
|
-
for (const
|
|
7764
|
-
if (!x().has(
|
|
7769
|
+
for (const O of j())
|
|
7770
|
+
if (!x().has(O)) return !1;
|
|
7765
7771
|
return !0;
|
|
7766
7772
|
}, He = () => {
|
|
7767
7773
|
const b = j(), L = x();
|
|
7768
|
-
return !b.size || !L.size || L.size < b.size ? !1 : Array.from(b).every((
|
|
7774
|
+
return !b.size || !L.size || L.size < b.size ? !1 : Array.from(b).every((O) => L.has(O));
|
|
7769
7775
|
}, c = () => m() ? !!e.props.useSelectAll : !1, T = () => {
|
|
7770
|
-
const b = w(), L =
|
|
7776
|
+
const b = w(), L = K();
|
|
7771
7777
|
if (typeof b == "string")
|
|
7772
7778
|
return L.has(b) ? L.get(b).name : b;
|
|
7773
|
-
const
|
|
7774
|
-
return
|
|
7779
|
+
const O = Array.isArray(b) ? b : [], de = O.filter((ae) => L.has(ae)).map((ae) => L.get(ae).name);
|
|
7780
|
+
return O.length ? m() && de.length > 1 ? e.props.headerFormat.replace(/\{count(:.*?)?}/g, `${de.length.toLocaleString()}`) : de.join(", ") || "" : "";
|
|
7775
7781
|
}, Y = () => Z.save || Z.blur || Z.change, re = () => {
|
|
7776
7782
|
const b = [];
|
|
7777
7783
|
return e.props.required && b.push({
|
|
@@ -7780,11 +7786,11 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7780
7786
|
validator: (L) => !!L.length
|
|
7781
7787
|
}), [...b, ...e.props.rules ?? []];
|
|
7782
7788
|
}, ue = async (b, L) => {
|
|
7783
|
-
const
|
|
7784
|
-
if (
|
|
7789
|
+
const O = re();
|
|
7790
|
+
if (O.length <= 0) return;
|
|
7785
7791
|
if (e.props.disabled) return !0;
|
|
7786
7792
|
Z[L] = "", e.requestUpdate();
|
|
7787
|
-
const de =
|
|
7793
|
+
const de = O.filter((ae) => ae.type === L);
|
|
7788
7794
|
for (const ae of de)
|
|
7789
7795
|
if (!await ae.validator(b))
|
|
7790
7796
|
return Z[L] = ae.message, e.requestUpdate(), !1;
|
|
@@ -7801,55 +7807,55 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7801
7807
|
var b;
|
|
7802
7808
|
return (b = e.validator) == null ? void 0 : b.removeValidator(Pe);
|
|
7803
7809
|
}));
|
|
7804
|
-
const ce = (b, L) => b.filter((
|
|
7810
|
+
const ce = (b, L) => b.filter((O) => k(O) !== L).map((O) => O.code), te = (b) => {
|
|
7805
7811
|
const L = Array.from(new Set(b));
|
|
7806
7812
|
ut(S(), L) || (I(L), e.emit("change", L, L.filter(Boolean)), ue(L, "change"), Te(L));
|
|
7807
7813
|
}, Te = (b) => {
|
|
7808
|
-
b.length ===
|
|
7809
|
-
const
|
|
7810
|
-
|
|
7814
|
+
b.length === oe.length ? f().forEach((L) => mt(le, L.depth, L.code)) : b.forEach((L) => {
|
|
7815
|
+
const O = R().find((de) => de.code === L);
|
|
7816
|
+
O && En(le, O.categoryLv1ID ?? "", O.categoryLv2ID ?? "");
|
|
7811
7817
|
});
|
|
7812
|
-
}, Ae = (b, L,
|
|
7813
|
-
if (
|
|
7814
|
-
const de =
|
|
7815
|
-
|
|
7816
|
-
} else
|
|
7818
|
+
}, Ae = (b, L, O) => {
|
|
7819
|
+
if (O.shiftKey && W.length > 0) {
|
|
7820
|
+
const de = W[0], ae = Math.min(de.index, L), ge = Math.max(de.index, L);
|
|
7821
|
+
W = q().slice(ae, ge + 1).map((be, qe) => ({ item: be, index: ae + qe }));
|
|
7822
|
+
} else O.ctrlKey ? W.push({ item: b, index: L }) : W = [{ item: b, index: L }];
|
|
7817
7823
|
}, z = (b, L) => {
|
|
7818
7824
|
if (!Xe(d, b.depth)) {
|
|
7819
|
-
const { childDepthList:
|
|
7825
|
+
const { childDepthList: O } = Bt(q(), b);
|
|
7820
7826
|
if (L) {
|
|
7821
|
-
const de = wt(
|
|
7822
|
-
I(S().filter((ae) => !de.has(ae))), go(
|
|
7827
|
+
const de = wt(O);
|
|
7828
|
+
I(S().filter((ae) => !de.has(ae))), go(le, q(), b, s);
|
|
7823
7829
|
} else {
|
|
7824
|
-
const de =
|
|
7830
|
+
const de = O.map((ae) => ae.code);
|
|
7825
7831
|
I([...S(), ...de]);
|
|
7826
7832
|
}
|
|
7827
7833
|
}
|
|
7828
7834
|
}, pe = (b, L) => {
|
|
7829
|
-
const de =
|
|
7835
|
+
const de = W.map((be) => be.item).filter((be) => be.depth === s), ae = ce(de, b);
|
|
7830
7836
|
let ge = [];
|
|
7831
7837
|
if (L.depth !== d) {
|
|
7832
7838
|
const { childDepthList: be } = Bt(q(), L), qe = wt(be);
|
|
7833
7839
|
ge = S().filter((Ye) => !qe.has(Ye));
|
|
7834
7840
|
} else
|
|
7835
7841
|
ge = S();
|
|
7836
|
-
b ? L.depth === d ? ge = [...ge, ...ae] : fo(
|
|
7837
|
-
}, De = (b, L,
|
|
7838
|
-
const ae =
|
|
7839
|
-
(
|
|
7840
|
-
}, Ne = (b, L,
|
|
7841
|
-
b[i()] !== !0 && (!
|
|
7842
|
-
}, Ge = (b, L,
|
|
7842
|
+
b ? L.depth === d ? ge = [...ge, ...ae] : fo(le, q(), L, s) : (bt(le), ge = ge.filter((be) => !ae.some((qe) => be === qe))), te(ge);
|
|
7843
|
+
}, De = (b, L, O, de) => {
|
|
7844
|
+
const ae = W.some((ge) => ge.item.code === b.code);
|
|
7845
|
+
(W.length <= 1 || !ae) && Ae(b, L, { shiftKey: !1, ctrlKey: !1 }), pe(!de, b), z(b, de), e.requestUpdate();
|
|
7846
|
+
}, Ne = (b, L, O, de) => {
|
|
7847
|
+
b[i()] !== !0 && (!O.ctrlKey && !O.shiftKey && W.length <= 1 && De(b, L, O, de), Ae(b, L, O), e.requestUpdate());
|
|
7848
|
+
}, Ge = (b, L, O) => {
|
|
7843
7849
|
if (b[i()] === !0) return;
|
|
7844
7850
|
let de = [], ae = !1;
|
|
7845
7851
|
const ge = b.code;
|
|
7846
7852
|
if (Xe(d, b.depth))
|
|
7847
|
-
ae = S().length === 1 && S()[0] === ge, ae || (de = [ge]), bt(
|
|
7853
|
+
ae = S().length === 1 && S()[0] === ge, ae || (de = [ge]), bt(le);
|
|
7848
7854
|
else {
|
|
7849
7855
|
const { childDepthList: be } = Bt(q(), b), qe = wt(be);
|
|
7850
|
-
ae = ho(qe, x()) && qe.size === x().size, ae ? go(
|
|
7856
|
+
ae = ho(qe, x()) && qe.size === x().size, ae ? go(le, q(), b, s) : (de = [], bt(le), fo(le, q(), b, s));
|
|
7851
7857
|
}
|
|
7852
|
-
|
|
7858
|
+
te(de), z(b, ae), Ae(b, L, O), e.requestUpdate();
|
|
7853
7859
|
}, Re = (b) => {
|
|
7854
7860
|
I(b), Qe(!1);
|
|
7855
7861
|
}, Ue = (b, L) => {
|
|
@@ -7865,45 +7871,45 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7865
7871
|
L.isExpanded = b, L.depth > 0 ? L.isHidden = !b : L.isHidden = !1;
|
|
7866
7872
|
}), queueMicrotask(() => Fe.measure()), e.requestUpdate();
|
|
7867
7873
|
}, H = (b) => {
|
|
7868
|
-
b.stopPropagation(), N().size === x().size && [...N()].every((
|
|
7874
|
+
b.stopPropagation(), N().size === x().size && [...N()].every((O) => x().has(O)) ? (f().forEach((O) => Pt(le, O.depth, O.code)), te([])) : (bt(le), f().forEach((O) => mt(le, O.depth, O.code)), te([...N()]));
|
|
7869
7875
|
}, F = (b) => {
|
|
7870
7876
|
if (b.stopPropagation(), He()) {
|
|
7871
7877
|
const L = j();
|
|
7872
|
-
|
|
7878
|
+
te(S().filter((O) => !L.has(O))), f().forEach((O) => Pt(le, O.depth, O.code));
|
|
7873
7879
|
} else {
|
|
7874
7880
|
const L = /* @__PURE__ */ new Set([...S(), ...N()]);
|
|
7875
|
-
|
|
7881
|
+
te(Array.from(L)), f().forEach((O) => mt(le, O.depth, O.code));
|
|
7876
7882
|
}
|
|
7877
|
-
},
|
|
7883
|
+
}, J = (b) => {
|
|
7878
7884
|
P = b.target.scrollTop > 0, e.requestUpdate();
|
|
7879
|
-
},
|
|
7885
|
+
}, ee = () => {
|
|
7880
7886
|
const b = o.value;
|
|
7881
7887
|
if (!b) return;
|
|
7882
7888
|
const L = b.getBoundingClientRect();
|
|
7883
|
-
let
|
|
7884
|
-
e.props.listBoxWidth && (
|
|
7885
|
-
}, he = (b, L,
|
|
7886
|
-
const de = window.innerHeight || document.documentElement.clientHeight, ae = window.innerWidth || document.documentElement.clientWidth, ge = b.getBoundingClientRect(), be = L.getBoundingClientRect(), qe = ge.bottom + be.height +
|
|
7889
|
+
let O = `${L.width}px`;
|
|
7890
|
+
e.props.listBoxWidth && (O = typeof e.props.listBoxWidth == "number" ? `${e.props.listBoxWidth}px` : e.props.listBoxWidth), U = { width: String(O), left: `${L.left}px`, top: `${L.top + ($ ? 0 : L.height)}px` }, e.requestUpdate();
|
|
7891
|
+
}, he = (b, L, O = 10) => {
|
|
7892
|
+
const de = window.innerHeight || document.documentElement.clientHeight, ae = window.innerWidth || document.documentElement.clientWidth, ge = b.getBoundingClientRect(), be = L.getBoundingClientRect(), qe = ge.bottom + be.height + O > de;
|
|
7887
7893
|
if (!qe) return !1;
|
|
7888
|
-
const Ye = ge.top - be.height -
|
|
7894
|
+
const Ye = ge.top - be.height - O < 0, Oe = ge.right + be.width + O > ae, Ze = ge.left - be.width - O < 0;
|
|
7889
7895
|
return qe && !Ye || Oe && !Ze;
|
|
7890
7896
|
}, we = (b) => {
|
|
7891
7897
|
b.target !== h && Qe(!1);
|
|
7892
7898
|
}, ye = (b) => {
|
|
7893
|
-
var L,
|
|
7894
|
-
!((L = t.value) != null && L.contains(b.target)) && !((
|
|
7899
|
+
var L, O;
|
|
7900
|
+
!((L = t.value) != null && L.contains(b.target)) && !((O = l.value) != null && O.contains(b.target)) && (Qe(!1), document.removeEventListener("click", ye, { capture: !0 }));
|
|
7895
7901
|
}, Me = (b) => {
|
|
7896
|
-
var
|
|
7897
|
-
`${b.ctrlKey ? "ctrl+" : ""}${b.altKey ? "alt+" : ""}${b.key.toLowerCase()}` === "escape" && (Qe(!1), (
|
|
7902
|
+
var O;
|
|
7903
|
+
`${b.ctrlKey ? "ctrl+" : ""}${b.altKey ? "alt+" : ""}${b.key.toLowerCase()}` === "escape" && (Qe(!1), (O = n.value) == null || O.focus());
|
|
7898
7904
|
};
|
|
7899
7905
|
e.onCleanup(() => {
|
|
7900
7906
|
document.body.removeEventListener("scroll", we, { capture: !0 }), document.removeEventListener("click", ye, { capture: !0 }), window.removeEventListener("keydown", Me);
|
|
7901
7907
|
});
|
|
7902
7908
|
let We = null;
|
|
7903
7909
|
const Qe = (b) => {
|
|
7904
|
-
C !== b && (C = b, e.requestUpdate(), b ? (We = Dt(), document.body.addEventListener("scroll", we, { capture: !0 }), document.addEventListener("click", ye, { capture: !0 }), Z.save = "", window.addEventListener("keydown", Me),
|
|
7910
|
+
C !== b && (C = b, e.requestUpdate(), b ? (We = Dt(), document.body.addEventListener("scroll", we, { capture: !0 }), document.addEventListener("click", ye, { capture: !0 }), Z.save = "", window.addEventListener("keydown", Me), ee(), queueMicrotask(() => {
|
|
7905
7911
|
var L;
|
|
7906
|
-
o.value && h && ($ = he(o.value, h)),
|
|
7912
|
+
o.value && h && ($ = he(o.value, h)), ee(), r.value ? r.value.focus() : (L = n.value) == null || L.focus();
|
|
7907
7913
|
})) : (We == null || We.release(), We = null, document.body.removeEventListener("scroll", we, { capture: !0 }), document.removeEventListener("click", ye, { capture: !0 }), ue(S(), "blur"), window.removeEventListener("keydown", Me), y = "", e.emit("close")));
|
|
7908
7914
|
}, rt = () => {
|
|
7909
7915
|
e.props.disabled || Qe(!C);
|
|
@@ -7925,7 +7931,7 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7925
7931
|
getScrollElement: () => h,
|
|
7926
7932
|
estimateSize: (b) => {
|
|
7927
7933
|
const L = q()[b];
|
|
7928
|
-
return L != null && L.isHidden ? 0 :
|
|
7934
|
+
return L != null && L.isHidden ? 0 : G() && L && Xe(d, L.depth) ? _ : A;
|
|
7929
7935
|
},
|
|
7930
7936
|
// 드롭다운이 아직 배치되지 않은 시점에는 높이가 0 으로 읽힌다. 0 을 캐시하면 행이 겹쳐 사라지고,
|
|
7931
7937
|
// 다음 측정에서 virtual-core 가 그 차이만큼 스크롤을 보정해 목록이 열리자마자 아래로 밀린다.
|
|
@@ -7944,31 +7950,31 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7944
7950
|
h = b ?? null, b && (Fe._willUpdate(), e.requestUpdate());
|
|
7945
7951
|
}, os = (b, L) => {
|
|
7946
7952
|
if (!b || L !== d) return;
|
|
7947
|
-
const
|
|
7948
|
-
|
|
7953
|
+
const O = b.getBoundingClientRect().height;
|
|
7954
|
+
O > 0 && (_ = O);
|
|
7949
7955
|
}, ss = (b) => b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), to = (b, L) => {
|
|
7950
7956
|
if (!y || !Xe(d, L)) return [{ part: b, highlight: !1 }];
|
|
7951
|
-
const
|
|
7952
|
-
return b.split(
|
|
7957
|
+
const O = new RegExp(`(${ss(y)})`, "gi");
|
|
7958
|
+
return b.split(O).map((de) => ({ part: de, highlight: y.toLowerCase() === de.toLowerCase() }));
|
|
7953
7959
|
};
|
|
7954
7960
|
let oo = w();
|
|
7955
7961
|
const ls = (b) => {
|
|
7956
|
-
const { index: L, item:
|
|
7957
|
-
if (
|
|
7958
|
-
const Ye = e.props, Oe =
|
|
7959
|
-
Oe !== d ? _e(
|
|
7962
|
+
const { index: L, item: O, start: de, isSelected: ae, isIndeterminate: ge, isDisabled: be, isFocused: qe } = b;
|
|
7963
|
+
if (O.isHidden) return v;
|
|
7964
|
+
const Ye = e.props, Oe = O.depth, Ze = Xe(d, Oe), et = m(), it = (Be) => {
|
|
7965
|
+
Oe !== d ? _e(O, Be) : Re(O.code);
|
|
7960
7966
|
}, gt = (Be) => {
|
|
7961
|
-
et ? Ne(
|
|
7967
|
+
et ? Ne(O, L, Be, ae && Ve(O)) : it(Be);
|
|
7962
7968
|
}, Ft = () => {
|
|
7963
|
-
De(
|
|
7969
|
+
De(O, L, {}, ae && Ve(O));
|
|
7964
7970
|
}, Rt = Ze ? "하나만" : "그룹만";
|
|
7965
7971
|
return a`<div
|
|
7966
7972
|
data-index=${L}
|
|
7967
|
-
${
|
|
7973
|
+
${ne((Be) => {
|
|
7968
7974
|
Be && (Fe.measureElement(Be), os(Be, Oe));
|
|
7969
7975
|
})}
|
|
7970
7976
|
style=${X({ transform: `translateY(${de}px)` })}
|
|
7971
|
-
class=${
|
|
7977
|
+
class=${D("list-box-item virtual-row tree-item", {
|
|
7972
7978
|
"list-selected": ae,
|
|
7973
7979
|
"moz-multi-focus": qe,
|
|
7974
7980
|
"is-selected": ae,
|
|
@@ -7977,12 +7983,12 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7977
7983
|
})}
|
|
7978
7984
|
>
|
|
7979
7985
|
<div
|
|
7980
|
-
class=${
|
|
7986
|
+
class=${D("depth-indicator", {
|
|
7981
7987
|
"depth-indicator--parent": !Ze,
|
|
7982
7988
|
"depth-indicator--last-depth": Ze,
|
|
7983
|
-
"depth-indicator--custom-item":
|
|
7989
|
+
"depth-indicator--custom-item": G()
|
|
7984
7990
|
})}
|
|
7985
|
-
style=${X({ "--depth": String(Oe), "--last-depth-item-height": String(
|
|
7991
|
+
style=${X({ "--depth": String(Oe), "--last-depth-item-height": String(_) })}
|
|
7986
7992
|
@click=${(Be) => {
|
|
7987
7993
|
et || it(Be);
|
|
7988
7994
|
}}
|
|
@@ -7991,11 +7997,11 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
7991
7997
|
${Ze ? v : a`<button
|
|
7992
7998
|
type="button"
|
|
7993
7999
|
class="icon-container"
|
|
7994
|
-
aria-expanded=${
|
|
7995
|
-
aria-label=${
|
|
7996
|
-
@click=${(Be) => _e(
|
|
8000
|
+
aria-expanded=${O.isExpanded ? "true" : "false"}
|
|
8001
|
+
aria-label=${O.isExpanded ? e.locale.TreeSelect.collapse : e.locale.TreeSelect.expand}
|
|
8002
|
+
@click=${(Be) => _e(O, Be)}
|
|
7997
8003
|
>
|
|
7998
|
-
${e.slots.has("icon") ? e.slot("icon") :
|
|
8004
|
+
${e.slots.has("icon") ? e.slot("icon") : O.isExpanded ? bn("var(--moz-color-accent)") : wn("var(--moz-color-text-subtle)")}
|
|
7999
8005
|
</button>`}
|
|
8000
8006
|
${et ? Ot({
|
|
8001
8007
|
checked: ae,
|
|
@@ -8004,16 +8010,16 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8004
8010
|
onChange: Ft
|
|
8005
8011
|
}) : v}
|
|
8006
8012
|
<div class="highlight-container">
|
|
8007
|
-
${
|
|
8008
|
-
text: { text: E(
|
|
8009
|
-
item:
|
|
8010
|
-
highlightText: to(E(
|
|
8011
|
-
}) : a`${to(E(
|
|
8012
|
-
(Be) => a`<span class=${
|
|
8013
|
+
${G() && Ze ? e.slot("list-item", {
|
|
8014
|
+
text: { text: E(O), depth: Oe },
|
|
8015
|
+
item: O,
|
|
8016
|
+
highlightText: to(E(O), Oe)
|
|
8017
|
+
}) : a`${to(E(O), Oe).map(
|
|
8018
|
+
(Be) => a`<span class=${D({ highlight: Be.highlight })}>${Be.part}</span>`
|
|
8013
8019
|
)}`}
|
|
8014
8020
|
</div>
|
|
8015
8021
|
${!et && ae && Ze ? jt("12", "var(--moz-color-accent)", !1, "icon-check") : v}
|
|
8016
|
-
${et && Ye.useSpecificSelect && !be ? a`<button type="button" class="item-only item-only-btn" @click=${(Be) => Ge(
|
|
8022
|
+
${et && Ye.useSpecificSelect && !be ? a`<button type="button" class="item-only item-only-btn" @click=${(Be) => Ge(O, L, Be)}>
|
|
8017
8023
|
${Rt}
|
|
8018
8024
|
</button>` : v}
|
|
8019
8025
|
</div>
|
|
@@ -8023,14 +8029,14 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8023
8029
|
api: { validate: ze },
|
|
8024
8030
|
render() {
|
|
8025
8031
|
const b = e.props;
|
|
8026
|
-
b.itemsSource !==
|
|
8032
|
+
b.itemsSource !== B && (B = b.itemsSource, se());
|
|
8027
8033
|
const L = w();
|
|
8028
8034
|
L !== oo && (oo = L, typeof L != "string" && Te(S()));
|
|
8029
|
-
const
|
|
8035
|
+
const O = typeof b.width == "number" ? `${Le(b.width)}rem` : b.width, de = e.slots.has("icon") ? e.slot("icon", { isOpen: C }) : C ? Qt("14", "var(--moz-color-accent)") : Xt("14", "var(--moz-color-text-subtle)", b.disabled), ae = Ce(b, Pn), { aria: ge, dom: be } = ht(ae);
|
|
8030
8036
|
return a`
|
|
8031
8037
|
<div
|
|
8032
8038
|
${me(be)}
|
|
8033
|
-
class=${
|
|
8039
|
+
class=${D(
|
|
8034
8040
|
"moz-multi-select moz-tree-select",
|
|
8035
8041
|
// 소비자 class 는 루트로 — Select 와 같은 결함이 있었다(포털된 `.list-box` 에만 붙음).
|
|
8036
8042
|
b.class,
|
|
@@ -8040,12 +8046,12 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8040
8046
|
disabled: !!b.disabled
|
|
8041
8047
|
}
|
|
8042
8048
|
)}
|
|
8043
|
-
style=${X({ width:
|
|
8044
|
-
${
|
|
8049
|
+
style=${X({ width: O, ...ve(b.style) })}
|
|
8050
|
+
${ne(t)}
|
|
8045
8051
|
>
|
|
8046
8052
|
<div class="input-wrapper">
|
|
8047
8053
|
${b.label ? Ke({}, a`${b.label}${b.required ? a`<span class="require-mark">*</span>` : v}`) : v}
|
|
8048
|
-
<div class="moz-input-container" @click=${rt} ${
|
|
8054
|
+
<div class="moz-input-container" @click=${rt} ${ne(o)}>
|
|
8049
8055
|
<input
|
|
8050
8056
|
.value=${T()}
|
|
8051
8057
|
placeholder=${Ee(b.placeholder ?? void 0)}
|
|
@@ -8062,7 +8068,7 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8062
8068
|
aria-expanded=${C ? "true" : "false"}
|
|
8063
8069
|
aria-label=${Ee(ge["aria-label"] ?? b.label)}
|
|
8064
8070
|
?disabled=${!!b.disabled}
|
|
8065
|
-
${
|
|
8071
|
+
${ne(n)}
|
|
8066
8072
|
>
|
|
8067
8073
|
${de}
|
|
8068
8074
|
</button>
|
|
@@ -8076,10 +8082,10 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8076
8082
|
if (!C) return v;
|
|
8077
8083
|
const b = e.props, L = q();
|
|
8078
8084
|
Fe.options.count !== L.length && Fe.setOptions({ ...Fe.options, count: L.length }), Fe._willUpdate();
|
|
8079
|
-
const
|
|
8085
|
+
const O = Fe.getTotalSize(), de = x(), ae = Vt(
|
|
8080
8086
|
Fe.getVirtualItems(),
|
|
8081
8087
|
L.length,
|
|
8082
|
-
|
|
8088
|
+
A,
|
|
8083
8089
|
h
|
|
8084
8090
|
).map((Ye) => {
|
|
8085
8091
|
if (Ye.index >= L.length) return null;
|
|
@@ -8106,7 +8112,7 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8106
8112
|
(Ye) => Ye !== null
|
|
8107
8113
|
), ge = y ? e.locale.TreeSelect.selectFiltered : e.locale.TreeSelect.selectAll, be = w(), qe = Array.isArray(be) ? be.length : be ? 1 : 0;
|
|
8108
8114
|
return a`<div
|
|
8109
|
-
class=${
|
|
8115
|
+
class=${D(
|
|
8110
8116
|
"list-box moz-tree-select-list",
|
|
8111
8117
|
{ "no-label": !b.label, "show-top": $ },
|
|
8112
8118
|
// 원본 TreeSelect.vue 는 포털 목록에도 소비자 class 를 붙였다(`[$attrs.class]`).
|
|
@@ -8114,12 +8120,12 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8114
8120
|
b.class
|
|
8115
8121
|
)}
|
|
8116
8122
|
style=${X(U)}
|
|
8117
|
-
${
|
|
8123
|
+
${ne(l)}
|
|
8118
8124
|
>
|
|
8119
8125
|
<div class="filter-input-wrapper">
|
|
8120
8126
|
${b.useFilter ? a`<div class="filter-input">
|
|
8121
8127
|
<div class="search-icon">${Jt("12", "var(--moz-color-text-subtle)")}</div>
|
|
8122
|
-
<input placeholder=${e.locale.TreeSelect.search} @input=${It} ${
|
|
8128
|
+
<input placeholder=${e.locale.TreeSelect.search} @input=${It} ${ne(r)} />
|
|
8123
8129
|
</div>` : v}
|
|
8124
8130
|
<div class="tree-controls">
|
|
8125
8131
|
<span class="control-btn" @click=${() => g(!0)}>${Cn("currentColor")}</span>
|
|
@@ -8127,7 +8133,7 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8127
8133
|
</div>
|
|
8128
8134
|
</div>
|
|
8129
8135
|
|
|
8130
|
-
${c() &&
|
|
8136
|
+
${c() && oe.length > 0 && L.length > 0 ? a`<div class=${D("list-box-item multi-select-item multi-select-all", { "is-scrolled": P })} @click=${F}>
|
|
8131
8137
|
<div class="select-all-content">
|
|
8132
8138
|
${Ot({ indeterminate: qe > 0 && je() === !1, checked: He() })}
|
|
8133
8139
|
<div><span title=${ge}>${ge}</span></div>
|
|
@@ -8135,8 +8141,8 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8135
8141
|
${y && L.length > 0 ? a`<button type="button" class="item-only" @click=${H}>${e.locale.TreeSelect.specificResults}</button>` : v}
|
|
8136
8142
|
</div>` : v}
|
|
8137
8143
|
|
|
8138
|
-
<div class="list-box-container" @scroll=${
|
|
8139
|
-
<div class="inner-container" style=${X({ height: `${
|
|
8144
|
+
<div class="list-box-container" @scroll=${J} ${ne(ts)}>
|
|
8145
|
+
<div class="inner-container" style=${X({ height: `${O}px` })}>
|
|
8140
8146
|
${ae.map((Ye) => ls(Ye))}
|
|
8141
8147
|
</div>
|
|
8142
8148
|
${L.length <= 0 ? a`<div class="list-box-item loading not-hover">
|
|
@@ -8195,66 +8201,66 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8195
8201
|
const l = [], n = [], r = [], h = [];
|
|
8196
8202
|
let d = [], s = !1, m = 0, i = 0, u = -1, p = -1, w = -1, S = null, I = null, C = 0;
|
|
8197
8203
|
const y = () => !!e.props.horizontal, P = () => e.props.panes ?? [], $ = () => {
|
|
8198
|
-
d = P().map((
|
|
8204
|
+
d = P().map((B) => B.hidden ? "0" : B.size != null ? String(B.size) : "1fr");
|
|
8199
8205
|
};
|
|
8200
8206
|
$();
|
|
8201
|
-
const V = (
|
|
8207
|
+
const V = (B) => y() ? B.clientHeight : B.clientWidth, U = () => V(r[p]), W = () => V(h[p]), Z = () => V(r[w]), ie = () => V(h[w]), fe = (B) => {
|
|
8202
8208
|
if (!s) return;
|
|
8203
|
-
let
|
|
8204
|
-
S = +(
|
|
8205
|
-
const
|
|
8206
|
-
(S === 0 && E > 10 || S === 1 && E < -10) && (
|
|
8209
|
+
let se = y() ? B.movementY : B.movementX;
|
|
8210
|
+
S = +(se > 0), S !== I && I !== null && (p = u, w = u + 1), I = S;
|
|
8211
|
+
const K = n[u].getBoundingClientRect(), E = y() ? B.clientY - K.top + window.scrollY : B.clientX - K.left + window.scrollX;
|
|
8212
|
+
(S === 0 && E > 10 || S === 1 && E < -10) && (se = se / (Math.abs(E) / 10)), (S === 0 && y() ? B.clientY < K.top : B.clientX < K.left) && (C = 0), (S === 1 && y() ? B.clientY > K.top : B.clientX > K.left) && (C = 0);
|
|
8207
8213
|
const k = (q) => l[q][y() ? "clientHeight" : "clientWidth"];
|
|
8208
|
-
if (m = k(p) +
|
|
8214
|
+
if (m = k(p) + se, i = k(w) + k(p) - m, !(m > U() && m < W() || m < U() && S === 1 || m > U() && S === 0)) {
|
|
8209
8215
|
if (m < U()) {
|
|
8210
8216
|
if (p - 1 < 0 && S === 0) {
|
|
8211
|
-
C += y() ?
|
|
8217
|
+
C += y() ? B.movementY : B.movementX;
|
|
8212
8218
|
return;
|
|
8213
8219
|
}
|
|
8214
8220
|
p = p - 1 >= 0 ? p - 1 : 0;
|
|
8215
|
-
} else if (m >
|
|
8221
|
+
} else if (m > W()) {
|
|
8216
8222
|
if (p - 1 < 0) {
|
|
8217
|
-
C += y() ?
|
|
8223
|
+
C += y() ? B.movementY : B.movementX;
|
|
8218
8224
|
return;
|
|
8219
8225
|
}
|
|
8220
8226
|
p = p - 1 >= 0 ? p - 1 : 0;
|
|
8221
8227
|
}
|
|
8222
8228
|
}
|
|
8223
|
-
if (!(i > Z() && i <
|
|
8229
|
+
if (!(i > Z() && i < ie() || i < Z() && S === 0 || i > Z() && S === 1)) {
|
|
8224
8230
|
if (i < Z()) {
|
|
8225
8231
|
if (w + 1 >= d.length) {
|
|
8226
|
-
C += y() ?
|
|
8232
|
+
C += y() ? B.movementY : B.movementX;
|
|
8227
8233
|
return;
|
|
8228
8234
|
}
|
|
8229
8235
|
w = w + 1 < d.length ? w + 1 : d.length - 1;
|
|
8230
|
-
} else if (i >
|
|
8236
|
+
} else if (i > ie()) {
|
|
8231
8237
|
if (w + 1 >= d.length) {
|
|
8232
|
-
C += y() ?
|
|
8238
|
+
C += y() ? B.movementY : B.movementX;
|
|
8233
8239
|
return;
|
|
8234
8240
|
}
|
|
8235
8241
|
w = w + 1 < d.length ? w + 1 : d.length - 1;
|
|
8236
8242
|
}
|
|
8237
8243
|
}
|
|
8238
|
-
if (S === 0 && C > 0 || S === 1 && C < 0 || S === 0 && i >
|
|
8244
|
+
if (S === 0 && C > 0 || S === 1 && C < 0 || S === 0 && i > ie() || S === 1 && i < Z() || S === 0 && m < U() || S === 1 && m > W())
|
|
8239
8245
|
return;
|
|
8240
|
-
const M = t[y() ? "clientHeight" : "clientWidth"], x = k(p) +
|
|
8241
|
-
d[p] = `clamp(${U()}px, ${x / M * 100}%, ${
|
|
8246
|
+
const M = t[y() ? "clientHeight" : "clientWidth"], x = k(p) + se;
|
|
8247
|
+
d[p] = `clamp(${U()}px, ${x / M * 100}%, ${W()}px)`, d[w] = "1fr", e.requestUpdate(), queueMicrotask(() => {
|
|
8242
8248
|
const q = k(w);
|
|
8243
|
-
d[w] = `clamp(${Z()}px, ${q / M * 100}%, ${
|
|
8249
|
+
d[w] = `clamp(${Z()}px, ${q / M * 100}%, ${ie()}px)`, e.requestUpdate();
|
|
8244
8250
|
});
|
|
8245
|
-
},
|
|
8246
|
-
u = -1, p = -1, w = -1, s = !1, C = 0, document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup",
|
|
8247
|
-
},
|
|
8248
|
-
|
|
8249
|
-
},
|
|
8250
|
-
u =
|
|
8251
|
+
}, le = () => {
|
|
8252
|
+
u = -1, p = -1, w = -1, s = !1, C = 0, document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup", le), e.requestUpdate();
|
|
8253
|
+
}, A = (B) => {
|
|
8254
|
+
B.preventDefault(), s = !0, y() ? B.clientY : B.clientX, document.addEventListener("mousemove", fe), document.addEventListener("mouseup", le), e.requestUpdate();
|
|
8255
|
+
}, _ = (B, se) => {
|
|
8256
|
+
u = se, p = se, w = se + 1, C = 0, A(B);
|
|
8251
8257
|
};
|
|
8252
|
-
let
|
|
8253
|
-
const
|
|
8258
|
+
let G = null;
|
|
8259
|
+
const oe = () => {
|
|
8254
8260
|
t && o && (o.style.width = `${t.clientWidth}px`, o.style.height = `${t.clientHeight}px`);
|
|
8255
8261
|
};
|
|
8256
8262
|
e.onCleanup(() => {
|
|
8257
|
-
document.removeEventListener("mouseup",
|
|
8263
|
+
document.removeEventListener("mouseup", le), document.removeEventListener("mousemove", fe), G == null || G.disconnect();
|
|
8258
8264
|
});
|
|
8259
8265
|
let Q = e.props.panes;
|
|
8260
8266
|
return {
|
|
@@ -8262,44 +8268,44 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8262
8268
|
$(), e.requestUpdate();
|
|
8263
8269
|
},
|
|
8264
8270
|
render() {
|
|
8265
|
-
const
|
|
8271
|
+
const B = P();
|
|
8266
8272
|
e.props.panes !== Q && (Q = e.props.panes, queueMicrotask(() => {
|
|
8267
8273
|
$(), e.requestUpdate();
|
|
8268
8274
|
}));
|
|
8269
|
-
const
|
|
8275
|
+
const se = y() ? "gridTemplateRows" : "gridTemplateColumns", K = B.length - 1, E = Ce(e.props, xn);
|
|
8270
8276
|
return a`
|
|
8271
8277
|
<div
|
|
8272
8278
|
${me(E)}
|
|
8273
|
-
class=${
|
|
8279
|
+
class=${D("splitter", e.props.class)}
|
|
8274
8280
|
style=${X({
|
|
8275
8281
|
display: "grid",
|
|
8276
|
-
[
|
|
8282
|
+
[se]: d.join(" "),
|
|
8277
8283
|
width: "100%",
|
|
8278
8284
|
height: "100%",
|
|
8279
8285
|
overflow: "hidden",
|
|
8280
8286
|
cursor: s ? y() ? "row-resize" : "col-resize" : "unset"
|
|
8281
8287
|
})}
|
|
8282
|
-
${
|
|
8283
|
-
t = k ?? null, t && o && (
|
|
8288
|
+
${ne((k) => {
|
|
8289
|
+
t = k ?? null, t && o && (oe(), !G && typeof ResizeObserver < "u" && (G = new ResizeObserver(() => oe()), G.observe(t)));
|
|
8284
8290
|
})}
|
|
8285
8291
|
>
|
|
8286
|
-
${
|
|
8287
|
-
const x = M ===
|
|
8292
|
+
${B.map((k, M) => {
|
|
8293
|
+
const x = M === K ? "100%" : d[M + 1] !== "0" ? "calc(100% - 10px) 10px" : "100%";
|
|
8288
8294
|
return a`<div
|
|
8289
|
-
style=${X({ display: "grid", [
|
|
8290
|
-
${
|
|
8295
|
+
style=${X({ display: "grid", [se]: x, overflow: "hidden" })}
|
|
8296
|
+
${ne((q) => {
|
|
8291
8297
|
l[M] = q ?? null;
|
|
8292
8298
|
})}
|
|
8293
8299
|
>
|
|
8294
8300
|
<div style="width: 100%; height: 100%; overflow: hidden">${e.slot(`pane-${M}`)}</div>
|
|
8295
|
-
${M !==
|
|
8301
|
+
${M !== K && d[M + 1] !== "0" ? a`<div
|
|
8296
8302
|
class=${y() ? "resizer resizer-horizontal" : "resizer resizer-vertical"}
|
|
8297
8303
|
role="separator"
|
|
8298
8304
|
aria-orientation=${y() ? "horizontal" : "vertical"}
|
|
8299
8305
|
aria-label=${e.locale.SplitPane.resizeHandle}
|
|
8300
8306
|
tabindex="0"
|
|
8301
|
-
@mousedown=${(q) =>
|
|
8302
|
-
${
|
|
8307
|
+
@mousedown=${(q) => _(q, M)}
|
|
8308
|
+
${ne((q) => {
|
|
8303
8309
|
n[M] = q ?? null;
|
|
8304
8310
|
})}
|
|
8305
8311
|
></div>` : v}
|
|
@@ -8308,23 +8314,23 @@ const Pn = /* @__PURE__ */ new Set([
|
|
|
8308
8314
|
|
|
8309
8315
|
<div
|
|
8310
8316
|
style="pointer-events: none; position: fixed"
|
|
8311
|
-
${
|
|
8312
|
-
o = k ?? null, t && o &&
|
|
8317
|
+
${ne((k) => {
|
|
8318
|
+
o = k ?? null, t && o && oe();
|
|
8313
8319
|
})}
|
|
8314
8320
|
>
|
|
8315
|
-
${
|
|
8321
|
+
${B.map((k, M) => {
|
|
8316
8322
|
const x = vo(k.minSize, "10px"), q = vo(k.maxSize, "100%");
|
|
8317
8323
|
return a`<div
|
|
8318
8324
|
class="size-calculator min-size"
|
|
8319
8325
|
style=${X({ width: x, height: x })}
|
|
8320
|
-
${
|
|
8326
|
+
${ne((f) => {
|
|
8321
8327
|
r[M] = f ?? null;
|
|
8322
8328
|
})}
|
|
8323
8329
|
></div>
|
|
8324
8330
|
<div
|
|
8325
8331
|
class="size-calculator max-size"
|
|
8326
8332
|
style=${X({ width: q, height: q })}
|
|
8327
|
-
${
|
|
8333
|
+
${ne((f) => {
|
|
8328
8334
|
h[M] = f ?? null;
|
|
8329
8335
|
})}
|
|
8330
8336
|
></div>`;
|
|
@@ -8491,7 +8497,7 @@ const Rn = $e({
|
|
|
8491
8497
|
}), P = Ce(p, qn);
|
|
8492
8498
|
return a`
|
|
8493
8499
|
<div
|
|
8494
|
-
class=${
|
|
8500
|
+
class=${D("moz-controller-root", p.class)}
|
|
8495
8501
|
style=${X(ve(p.containerStyle))}
|
|
8496
8502
|
${me(P)}
|
|
8497
8503
|
>
|
|
@@ -8743,13 +8749,13 @@ const Go = $e({
|
|
|
8743
8749
|
role=${y.type === "error" ? "alert" : "status"}
|
|
8744
8750
|
aria-live=${y.type === "error" ? "assertive" : "polite"}
|
|
8745
8751
|
aria-atomic="true"
|
|
8746
|
-
class=${
|
|
8752
|
+
class=${D("moz-toast", "moz-toast-composed", bo(y.type), y.class)}
|
|
8747
8753
|
style=${t ? v : "display: none;"}
|
|
8748
8754
|
@mouseenter=${() => p(!0)}
|
|
8749
8755
|
@mouseleave=${() => p(!1)}
|
|
8750
8756
|
>
|
|
8751
8757
|
${y.showProgress && P > 0 ? a`<div class="moz-toast-progress" aria-hidden="true">
|
|
8752
|
-
<div class=${
|
|
8758
|
+
<div class=${D("moz-toast-progress-bar", y.progressClass)} style=${`width: ${h}%`}></div>
|
|
8753
8759
|
</div>` : v}
|
|
8754
8760
|
${e.slots.has("icon") ? a`<div class="moz-toast-icon">${e.slot("icon")}</div>` : v}
|
|
8755
8761
|
<div class="moz-toast-content">
|
|
@@ -8771,7 +8777,7 @@ const Go = $e({
|
|
|
8771
8777
|
role=${y.type === "error" ? "alert" : "status"}
|
|
8772
8778
|
aria-live=${y.type === "error" ? "assertive" : "polite"}
|
|
8773
8779
|
aria-atomic="true"
|
|
8774
|
-
class=${
|
|
8780
|
+
class=${D("moz-toast", bo(y.type), _n(y.position), y.class)}
|
|
8775
8781
|
style=${t ? v : "display: none;"}
|
|
8776
8782
|
@mouseenter=${() => p(!0)}
|
|
8777
8783
|
@mouseleave=${() => p(!1)}
|
|
@@ -8957,8 +8963,8 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
8957
8963
|
const m = (o == null ? void 0 : o.side) ?? s.side ?? "top", i = Ce(s, Zn), u = m === "top" || m === "bottom" ? "left" : "top";
|
|
8958
8964
|
return a`
|
|
8959
8965
|
<div
|
|
8960
|
-
${
|
|
8961
|
-
class=${
|
|
8966
|
+
${ne(t)}
|
|
8967
|
+
class=${D("moz-tooltip", s.class)}
|
|
8962
8968
|
role="tooltip"
|
|
8963
8969
|
id=${s.tooltipId ?? v}
|
|
8964
8970
|
data-side=${m}
|
|
@@ -9058,8 +9064,8 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9058
9064
|
if (!s() || !(h != null && h.isTopmost())) return;
|
|
9059
9065
|
const V = t.value, U = $.target;
|
|
9060
9066
|
if (!V || !U || V.contains(U)) return;
|
|
9061
|
-
const
|
|
9062
|
-
e.emit("interactOutside",
|
|
9067
|
+
const W = u("moz.interactOutside", { originalEvent: $ });
|
|
9068
|
+
e.emit("interactOutside", W), W.defaultPrevented || p("interactOutside");
|
|
9063
9069
|
}, I = ($) => {
|
|
9064
9070
|
if ($.key !== "Tab" || !e.props.trapFocus) return;
|
|
9065
9071
|
const V = m();
|
|
@@ -9067,8 +9073,8 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9067
9073
|
$.preventDefault();
|
|
9068
9074
|
return;
|
|
9069
9075
|
}
|
|
9070
|
-
const U = V[0],
|
|
9071
|
-
$.shiftKey && (Z === U || Z === t.value) ? ($.preventDefault(),
|
|
9076
|
+
const U = V[0], W = V[V.length - 1], Z = document.activeElement;
|
|
9077
|
+
$.shiftKey && (Z === U || Z === t.value) ? ($.preventDefault(), W.focus()) : !$.shiftKey && Z === W && ($.preventDefault(), U.focus());
|
|
9072
9078
|
}, C = () => {
|
|
9073
9079
|
d = document.activeElement ?? null, h = Po(w), document.addEventListener("pointerdown", S, !0), $o(() => {
|
|
9074
9080
|
var V;
|
|
@@ -9093,15 +9099,15 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9093
9099
|
return v;
|
|
9094
9100
|
},
|
|
9095
9101
|
renderPortal() {
|
|
9096
|
-
var
|
|
9102
|
+
var ie;
|
|
9097
9103
|
const $ = e.props, V = s();
|
|
9098
9104
|
if (V !== r && (r = V, V ? C() : y()), !V) return v;
|
|
9099
9105
|
$o(i);
|
|
9100
|
-
const U = (o == null ? void 0 : o.side) ?? $.side ?? "bottom",
|
|
9106
|
+
const U = (o == null ? void 0 : o.side) ?? $.side ?? "bottom", W = Ce($, Jn), Z = ((ie = $.anchor) == null ? void 0 : ie.offsetWidth) ?? 0;
|
|
9101
9107
|
return a`
|
|
9102
9108
|
<div
|
|
9103
|
-
${
|
|
9104
|
-
class=${
|
|
9109
|
+
${ne(t)}
|
|
9110
|
+
class=${D("moz-popover", $.class)}
|
|
9105
9111
|
role="dialog"
|
|
9106
9112
|
id=${$.popoverId ?? v}
|
|
9107
9113
|
tabindex="-1"
|
|
@@ -9130,7 +9136,7 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9130
9136
|
"--moz-popover-available-height": `${(o == null ? void 0 : o.availableHeight) ?? 0}px`,
|
|
9131
9137
|
...$.matchTriggerWidth ? { width: `${Z}px` } : {}
|
|
9132
9138
|
})}
|
|
9133
|
-
${me(
|
|
9139
|
+
${me(W)}
|
|
9134
9140
|
>
|
|
9135
9141
|
${e.slot("content")}
|
|
9136
9142
|
</div>
|
|
@@ -9195,8 +9201,8 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9195
9201
|
if (!s && !d.forceMount) return v;
|
|
9196
9202
|
const m = Ce(d, oi);
|
|
9197
9203
|
return a`<div
|
|
9198
|
-
${
|
|
9199
|
-
class=${
|
|
9204
|
+
${ne(h)}
|
|
9205
|
+
class=${D("moz-collapsible-content", d.class)}
|
|
9200
9206
|
id=${Ee(d.contentId)}
|
|
9201
9207
|
data-state=${s ? "open" : "closed"}
|
|
9202
9208
|
data-disabled=${d.disabled ? "" : v}
|
|
@@ -9258,17 +9264,17 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9258
9264
|
m();
|
|
9259
9265
|
const i = e.props, u = Ce(i, ni), p = t === "loaded", w = !p && l;
|
|
9260
9266
|
return a`<span
|
|
9261
|
-
class=${
|
|
9267
|
+
class=${D("moz-avatar", i.class)}
|
|
9262
9268
|
data-status=${t}
|
|
9263
9269
|
style=${X(ve(i.style))}
|
|
9264
9270
|
${me(u)}
|
|
9265
9271
|
>
|
|
9266
9272
|
${p ? a`<img
|
|
9267
|
-
class=${
|
|
9273
|
+
class=${D("moz-avatar-image", i.imageClass)}
|
|
9268
9274
|
src=${Ee(i.src)}
|
|
9269
9275
|
alt=${Ee(i.alt)}
|
|
9270
9276
|
/>` : v}
|
|
9271
|
-
${w ? a`<span class=${
|
|
9277
|
+
${w ? a`<span class=${D("moz-avatar-fallback", i.fallbackClass)}>${e.slot("fallback")}</span>` : v}
|
|
9272
9278
|
</span>`;
|
|
9273
9279
|
},
|
|
9274
9280
|
api: {
|
|
@@ -9297,28 +9303,28 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9297
9303
|
u = k ?? null;
|
|
9298
9304
|
}, U = (k) => {
|
|
9299
9305
|
k.pointerType !== "touch" && (w = !0, e.requestUpdate());
|
|
9300
|
-
},
|
|
9306
|
+
}, W = (k) => {
|
|
9301
9307
|
k.pointerType !== "touch" && (w = y(k.relatedTarget), e.requestUpdate());
|
|
9302
9308
|
}, Z = () => {
|
|
9303
9309
|
$();
|
|
9304
|
-
},
|
|
9310
|
+
}, ie = () => {
|
|
9305
9311
|
e.requestUpdate();
|
|
9306
9312
|
}, fe = () => {
|
|
9307
|
-
I == null || I(), p == null || p.disconnect(), p = null, i == null || i.removeEventListener("pointerenter", U), i == null || i.removeEventListener("pointerleave",
|
|
9308
|
-
},
|
|
9313
|
+
I == null || I(), p == null || p.disconnect(), p = null, i == null || i.removeEventListener("pointerenter", U), i == null || i.removeEventListener("pointerleave", W), i == null || i.removeEventListener("focusin", Z), i == null || i.removeEventListener("focusout", ie), i = null, w = S = !1;
|
|
9314
|
+
}, le = () => {
|
|
9309
9315
|
(C == null ? void 0 : C.getAttribute("tabindex")) === "0" && C.removeAttribute("tabindex"), C = null;
|
|
9310
|
-
},
|
|
9316
|
+
}, A = () => {
|
|
9311
9317
|
var x;
|
|
9312
9318
|
const k = e.props.interactionRoot ?? t;
|
|
9313
|
-
k !== i && (fe(), i = k, k && (k.addEventListener("pointerenter", U), k.addEventListener("pointerleave",
|
|
9319
|
+
k !== i && (fe(), i = k, k && (k.addEventListener("pointerenter", U), k.addEventListener("pointerleave", W), k.addEventListener("focusin", Z), k.addEventListener("focusout", ie)));
|
|
9314
9320
|
const M = (x = k == null ? void 0 : k.ownerDocument.defaultView) == null ? void 0 : x.MutationObserver;
|
|
9315
|
-
e.props.scrollbarVisibility === "hover" && k && !p && M ? (p = new M($), p.observe(k, { childList: !0, subtree: !0 })) : e.props.scrollbarVisibility !== "hover" && (p == null || p.disconnect(), p = null), S = P(), e.props.scrollbarVisibility !== "hover" ?
|
|
9316
|
-
},
|
|
9321
|
+
e.props.scrollbarVisibility === "hover" && k && !p && M ? (p = new M($), p.observe(k, { childList: !0, subtree: !0 })) : e.props.scrollbarVisibility !== "hover" && (p == null || p.disconnect(), p = null), S = P(), e.props.scrollbarVisibility !== "hover" ? le() : t && !t.hasAttribute("tabindex") && (t.tabIndex = 0, C = t);
|
|
9322
|
+
}, _ = (k) => {
|
|
9317
9323
|
const M = e.props.orientation ?? "vertical";
|
|
9318
9324
|
return M === "both" || M === k;
|
|
9319
|
-
},
|
|
9325
|
+
}, G = (k) => {
|
|
9320
9326
|
const M = t;
|
|
9321
|
-
if (!M || !
|
|
9327
|
+
if (!M || !_(k)) return !1;
|
|
9322
9328
|
const x = k === "vertical", q = x ? M.scrollHeight : M.scrollWidth, f = x ? M.clientHeight : M.clientWidth;
|
|
9323
9329
|
if (q <= f + 1 || f <= 0) return !1;
|
|
9324
9330
|
const R = x ? n : r, N = x ? o : l;
|
|
@@ -9327,25 +9333,25 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9327
9333
|
if (j <= 0) return !0;
|
|
9328
9334
|
const ke = f / q, Ve = Math.max(j * ke, ai), je = j - Ve, He = x ? M.scrollTop : M.scrollLeft, c = q - f, T = c > 0 ? He / c * je : 0;
|
|
9329
9335
|
return x ? (N.style.height = `${Ve}px`, N.style.transform = `translateY(${T}px)`) : (N.style.width = `${Ve}px`, N.style.transform = `translateX(${T}px)`), !0;
|
|
9330
|
-
},
|
|
9331
|
-
const k =
|
|
9336
|
+
}, oe = () => {
|
|
9337
|
+
const k = G("vertical"), M = G("horizontal");
|
|
9332
9338
|
k === h && M === d || (h = k, d = M, e.requestUpdate());
|
|
9333
9339
|
}, Q = () => {
|
|
9334
9340
|
const k = t;
|
|
9335
|
-
k && (
|
|
9336
|
-
},
|
|
9337
|
-
fe(),
|
|
9338
|
-
},
|
|
9341
|
+
k && (oe(), e.emit("scroll", { scrollTop: k.scrollTop, scrollLeft: k.scrollLeft }));
|
|
9342
|
+
}, B = () => {
|
|
9343
|
+
fe(), le(), t && t.removeEventListener("scroll", Q), s == null || s.disconnect(), s = null, m == null || m.disconnect(), m = null, t = null;
|
|
9344
|
+
}, se = () => {
|
|
9339
9345
|
const k = e.props.viewport ?? null;
|
|
9340
|
-
if (k !== t && (
|
|
9346
|
+
if (k !== t && (B(), t = k, !!t)) {
|
|
9341
9347
|
if (t.addEventListener("scroll", Q, { passive: !0 }), typeof ResizeObserver < "u") {
|
|
9342
|
-
s = new ResizeObserver(() =>
|
|
9348
|
+
s = new ResizeObserver(() => oe()), s.observe(t);
|
|
9343
9349
|
const M = t.firstElementChild;
|
|
9344
|
-
M && (m = new ResizeObserver(() =>
|
|
9350
|
+
M && (m = new ResizeObserver(() => oe()), m.observe(M));
|
|
9345
9351
|
}
|
|
9346
|
-
|
|
9352
|
+
oe();
|
|
9347
9353
|
}
|
|
9348
|
-
},
|
|
9354
|
+
}, K = (k, M) => {
|
|
9349
9355
|
var ce;
|
|
9350
9356
|
const x = t, q = x == null ? void 0 : x.ownerDocument.defaultView;
|
|
9351
9357
|
if (!x || !q || I || M.button !== 0) return;
|
|
@@ -9354,25 +9360,25 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9354
9360
|
M.preventDefault();
|
|
9355
9361
|
const j = f ? M.clientY : M.clientX, ke = f ? x.scrollTop : x.scrollLeft, Ve = f ? R.clientHeight : R.clientWidth, je = f ? N.offsetHeight : N.offsetWidth, He = f ? x.scrollHeight : x.scrollWidth, c = f ? x.clientHeight : x.clientWidth, T = Ve - je, Y = He - c;
|
|
9356
9362
|
if (T <= 0 || Y <= 0) return;
|
|
9357
|
-
const re = M.pointerId, ue = (
|
|
9358
|
-
w =
|
|
9363
|
+
const re = M.pointerId, ue = (te) => {
|
|
9364
|
+
w = te.pointerType !== "touch" && [i, n, r].some((Te) => {
|
|
9359
9365
|
if (!Te || Te.hidden) return !1;
|
|
9360
9366
|
const Ae = Te.getBoundingClientRect();
|
|
9361
|
-
return
|
|
9367
|
+
return te.clientX >= Ae.left && te.clientX < Ae.right && te.clientY >= Ae.top && te.clientY < Ae.bottom;
|
|
9362
9368
|
});
|
|
9363
|
-
}, ze = (
|
|
9364
|
-
if (
|
|
9365
|
-
ue(
|
|
9366
|
-
const Te = (f ?
|
|
9369
|
+
}, ze = (te) => {
|
|
9370
|
+
if (te.pointerId !== re) return;
|
|
9371
|
+
ue(te);
|
|
9372
|
+
const Te = (f ? te.clientY : te.clientX) - j, Ae = ke + Te / T * Y;
|
|
9367
9373
|
f ? x.scrollTop = Ae : x.scrollLeft = Ae;
|
|
9368
|
-
}, Pe = (
|
|
9369
|
-
|
|
9374
|
+
}, Pe = (te) => {
|
|
9375
|
+
te.pointerId === re && (ue(te), te.type !== "pointerup" && (w = !1), I == null || I(), e.requestUpdate());
|
|
9370
9376
|
};
|
|
9371
9377
|
I = () => {
|
|
9372
|
-
var
|
|
9378
|
+
var te;
|
|
9373
9379
|
I = null, q.removeEventListener("pointermove", ze), q.removeEventListener("pointerup", Pe), q.removeEventListener("pointercancel", Pe), N.removeEventListener("lostpointercapture", Pe);
|
|
9374
9380
|
try {
|
|
9375
|
-
(
|
|
9381
|
+
(te = N.releasePointerCapture) == null || te.call(N, re);
|
|
9376
9382
|
} catch {
|
|
9377
9383
|
}
|
|
9378
9384
|
}, q.addEventListener("pointermove", ze), q.addEventListener("pointerup", Pe), q.addEventListener("pointercancel", Pe), N.addEventListener("lostpointercapture", Pe);
|
|
@@ -9382,44 +9388,44 @@ const Yn = Yo, Zn = /* @__PURE__ */ new Set([
|
|
|
9382
9388
|
}
|
|
9383
9389
|
e.requestUpdate();
|
|
9384
9390
|
};
|
|
9385
|
-
e.onCleanup(
|
|
9391
|
+
e.onCleanup(B);
|
|
9386
9392
|
const E = (k, M) => {
|
|
9387
9393
|
const x = k === "vertical", q = (R) => {
|
|
9388
9394
|
x ? n = R ?? null : r = R ?? null;
|
|
9389
9395
|
}, f = (R) => {
|
|
9390
|
-
x ? o = R ?? null : l = R ?? null, R &&
|
|
9396
|
+
x ? o = R ?? null : l = R ?? null, R && oe();
|
|
9391
9397
|
};
|
|
9392
9398
|
return a`<div
|
|
9393
|
-
class=${
|
|
9399
|
+
class=${D("moz-scroll-area-scrollbar", e.props.scrollbarClass)}
|
|
9394
9400
|
data-orientation=${k}
|
|
9395
9401
|
?hidden=${!M}
|
|
9396
|
-
${
|
|
9402
|
+
${ne(q)}
|
|
9397
9403
|
>
|
|
9398
9404
|
<div
|
|
9399
|
-
class=${
|
|
9400
|
-
@pointerdown=${(R) =>
|
|
9401
|
-
${
|
|
9405
|
+
class=${D("moz-scroll-area-thumb", e.props.thumbClass)}
|
|
9406
|
+
@pointerdown=${(R) => K(k, R)}
|
|
9407
|
+
${ne(f)}
|
|
9402
9408
|
></div>
|
|
9403
9409
|
</div>`;
|
|
9404
9410
|
};
|
|
9405
9411
|
return {
|
|
9406
9412
|
render() {
|
|
9407
|
-
|
|
9408
|
-
const k = e.props, M = Ce(k, ri), x =
|
|
9413
|
+
se(), A();
|
|
9414
|
+
const k = e.props, M = Ce(k, ri), x = _("vertical") && _("horizontal");
|
|
9409
9415
|
return a`<div
|
|
9410
|
-
class=${
|
|
9416
|
+
class=${D("moz-scroll-area-bars", k.class)}
|
|
9411
9417
|
data-orientation=${k.orientation ?? "vertical"}
|
|
9412
9418
|
data-state=${k.scrollbarVisibility !== "hover" || w || S || I ? "visible" : "hidden"}
|
|
9413
9419
|
style=${X(ve(k.style))}
|
|
9414
9420
|
@pointerenter=${U}
|
|
9415
|
-
@pointerleave=${
|
|
9421
|
+
@pointerleave=${W}
|
|
9416
9422
|
@focusin=${Z}
|
|
9417
|
-
@focusout=${
|
|
9418
|
-
${
|
|
9423
|
+
@focusout=${ie}
|
|
9424
|
+
${ne(V)}
|
|
9419
9425
|
${me(M)}
|
|
9420
9426
|
>
|
|
9421
|
-
${
|
|
9422
|
-
${
|
|
9427
|
+
${_("vertical") ? E("vertical", h) : v}
|
|
9428
|
+
${_("horizontal") ? E("horizontal", d) : v}
|
|
9423
9429
|
${x && h && d ? a`<div class="moz-scroll-area-corner"></div>` : v}
|
|
9424
9430
|
</div>`;
|
|
9425
9431
|
}
|
|
@@ -9446,7 +9452,7 @@ const hi = $e({
|
|
|
9446
9452
|
render() {
|
|
9447
9453
|
const t = e.props, o = Ce(t, mi), l = Nt(ci, t.tone, "neutral"), n = Nt(ui, t.appearance, "soft"), r = Nt(pi, t.size, "md"), h = e.slots.has("default") ? e.slot("default") : t.text ?? v;
|
|
9448
9454
|
return a`<span
|
|
9449
|
-
class=${
|
|
9455
|
+
class=${D("moz-badge", `size-${r}`, t.class)}
|
|
9450
9456
|
data-tone=${l}
|
|
9451
9457
|
data-appearance=${n}
|
|
9452
9458
|
style=${X(ve(t.style))}
|
|
@@ -9508,7 +9514,7 @@ const bi = $e({
|
|
|
9508
9514
|
>${m}${i}</button
|
|
9509
9515
|
>` : a`<span class="moz-chip-label">${m}${i}</span>`;
|
|
9510
9516
|
return a`<span
|
|
9511
|
-
class=${
|
|
9517
|
+
class=${D("moz-chip", "removable", `size-${d}`, { disabled: s }, l.class)}
|
|
9512
9518
|
data-tone=${r}
|
|
9513
9519
|
data-appearance=${h}
|
|
9514
9520
|
style=${X(ve(l.style))}
|
|
@@ -9526,7 +9532,7 @@ const bi = $e({
|
|
|
9526
9532
|
const u = !!l.selected;
|
|
9527
9533
|
return a`<button
|
|
9528
9534
|
type="button"
|
|
9529
|
-
class=${
|
|
9535
|
+
class=${D("moz-chip", `size-${d}`, { "is-selected": u, disabled: s }, l.class)}
|
|
9530
9536
|
data-tone=${r}
|
|
9531
9537
|
data-appearance=${h}
|
|
9532
9538
|
aria-pressed=${u ? "true" : "false"}
|
|
@@ -9659,7 +9665,7 @@ const ki = $e({
|
|
|
9659
9665
|
render() {
|
|
9660
9666
|
const o = e.props, l = Ce(o, yi), n = Si(o.tone), r = n === "danger" || n === "warning", h = !!o.live, s = e.slots.has("heading") ? e.slot("heading") : o.title ? o.title : void 0, m = e.slots.has("default") ? e.slot("default") : o.text ?? v;
|
|
9661
9667
|
return a`<div
|
|
9662
|
-
class=${
|
|
9668
|
+
class=${D("moz-callout", { compact: !!o.compact }, o.class)}
|
|
9663
9669
|
data-tone=${n}
|
|
9664
9670
|
role=${Ee(h ? r ? "alert" : "status" : void 0)}
|
|
9665
9671
|
aria-live=${Ee(h ? r ? "assertive" : "polite" : void 0)}
|
|
@@ -9778,11 +9784,11 @@ const es = $e({
|
|
|
9778
9784
|
});
|
|
9779
9785
|
const y = () => {
|
|
9780
9786
|
if (l) return v;
|
|
9781
|
-
const P = e.props, $ = Li(P.tone), V = $ === "danger", U = typeof P.onSelect == "function",
|
|
9787
|
+
const P = e.props, $ = Li(P.tone), V = $ === "danger", U = typeof P.onSelect == "function", W = e.slots.has("heading") ? e.slot("heading") : P.title ? P.title : void 0, Z = e.slots.has("description") ? e.slot("description") : P.body ? P.body : void 0;
|
|
9782
9788
|
return a`<div
|
|
9783
9789
|
data-testid="notification-card"
|
|
9784
9790
|
${me(Ce(P, zi))}
|
|
9785
|
-
class=${
|
|
9791
|
+
class=${D("moz-notification-card", { "is-selectable": U }, P.class)}
|
|
9786
9792
|
data-tone=${$}
|
|
9787
9793
|
role=${V ? "alert" : "status"}
|
|
9788
9794
|
aria-live=${V ? "assertive" : "polite"}
|
|
@@ -9804,7 +9810,7 @@ const es = $e({
|
|
|
9804
9810
|
@click=${I}
|
|
9805
9811
|
@keydown=${U ? C : v}
|
|
9806
9812
|
>
|
|
9807
|
-
${
|
|
9813
|
+
${W !== void 0 ? a`<div class="moz-notification-card-heading">${W}</div>` : v}
|
|
9808
9814
|
${Z !== void 0 ? a`<div class="moz-notification-card-description">${Z}</div>` : v}
|
|
9809
9815
|
${P.time ? a`<time class="moz-notification-card-time" datetime=${Ee(P.datetime || void 0)}
|
|
9810
9816
|
>${P.time}</time
|
|
@@ -9847,7 +9853,7 @@ const es = $e({
|
|
|
9847
9853
|
};
|
|
9848
9854
|
return {
|
|
9849
9855
|
render() {
|
|
9850
|
-
const o = e.props, l = Ce(o, Ti), n = !!o.unread, r = e.slots.has("heading") ? e.slot("heading") : o.title ? o.title : void 0, h = e.slots.has("description") ? e.slot("description") : o.body ? o.body : void 0, d =
|
|
9856
|
+
const o = e.props, l = Ce(o, Ti), n = !!o.unread, r = e.slots.has("heading") ? e.slot("heading") : o.title ? o.title : void 0, h = e.slots.has("description") ? e.slot("description") : o.body ? o.body : void 0, d = D("moz-notification-item", { "is-unread": n }, o.class), s = X(ve(o.style)), m = a`
|
|
9851
9857
|
<span class="moz-notification-item-header">
|
|
9852
9858
|
${r !== void 0 ? a`<span class="moz-notification-item-heading">${r}</span>` : v}
|
|
9853
9859
|
${n ? a`<span class="moz-notification-item-unread"
|
|
@@ -10015,7 +10021,7 @@ export {
|
|
|
10015
10021
|
yt as buttonTemplate,
|
|
10016
10022
|
Ot as checkboxTemplate,
|
|
10017
10023
|
zo as circleLoader,
|
|
10018
|
-
|
|
10024
|
+
D as cn,
|
|
10019
10025
|
Yn as computeTooltipPlacement,
|
|
10020
10026
|
ii as createAvatar,
|
|
10021
10027
|
hi as createBadge,
|