@tanstack/query-devtools 5.103.2 → 5.103.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Devtools-DP9QP4ya.cjs +1237 -0
- package/build/Devtools-DpIxfOum.js +1238 -0
- package/build/Devtools-DpIxfOum.js.map +1 -0
- package/build/{Devtools-QIchsTu4.cjs → Devtools-XuAvSfeN.cjs} +923 -903
- package/build/{Devtools-B8gBVih5.js → Devtools-xfqOl5Dl.js} +923 -903
- package/build/{DevtoolsComponent-Cb-WvQCr.js → DevtoolsComponent-BEFw32kp.js} +2 -2
- package/build/DevtoolsComponent-BEFw32kp.js.map +1 -0
- package/build/{DevtoolsComponent-CFsAhafd.js → DevtoolsComponent-DRjJuLRU.js} +2 -2
- package/build/{DevtoolsComponent-ChtbiwqS.cjs → DevtoolsComponent-DjkCvfLf.cjs} +2 -2
- package/build/{DevtoolsComponent-B932o_Kt.cjs → DevtoolsComponent-bl_b_SFT.cjs} +1 -1
- package/build/{DevtoolsPanelComponent-Be8narGM.js → DevtoolsPanelComponent-BE6hbJd6.js} +2 -2
- package/build/DevtoolsPanelComponent-BE6hbJd6.js.map +1 -0
- package/build/{DevtoolsPanelComponent-CHpU_w5-.cjs → DevtoolsPanelComponent-BTfH8T_h.cjs} +2 -2
- package/build/{DevtoolsPanelComponent-B9zkHqmD.js → DevtoolsPanelComponent-CkmpODyJ.js} +2 -2
- package/build/{DevtoolsPanelComponent-Dm3BbKKd.cjs → DevtoolsPanelComponent-DfaRC3RE.cjs} +1 -1
- package/build/dev.cjs +3 -3
- package/build/dev.js +3 -3
- package/build/index.cjs +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/{utils-BLwigsFG.cjs → utils-BSq_mRvI.cjs} +60 -26
- package/build/{utils-CESniQp_.js → utils-Fz9uQv9N.js} +60 -26
- package/build/utils-po3vZo_N.js +2 -0
- package/build/utils-po3vZo_N.js.map +1 -0
- package/build/utils-y9H3sLL0.cjs +1 -0
- package/package.json +11 -11
- package/src/Devtools.tsx +14 -10
- package/src/utils.tsx +4 -5
- package/build/Devtools-C2baIe1r.cjs +0 -1248
- package/build/Devtools-CFKbGy8Z.js +0 -1249
- package/build/Devtools-CFKbGy8Z.js.map +0 -1
- package/build/DevtoolsComponent-Cb-WvQCr.js.map +0 -1
- package/build/DevtoolsPanelComponent-Be8narGM.js.map +0 -1
- package/build/utils-BPMMmTje.js +0 -2
- package/build/utils-BPMMmTje.js.map +0 -1
- package/build/utils-DzxoHwL2.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_utils = require("./utils-
|
|
1
|
+
const require_utils = require("./utils-BSq_mRvI.cjs");
|
|
2
2
|
const isNonNullable = (i) => i != null;
|
|
3
3
|
const filterNonNullable = (arr) => arr.filter(isNonNullable);
|
|
4
4
|
/**
|
|
@@ -56,7 +56,7 @@ function handleDiffArray(current, prev, handleAdded, handleRemoved) {
|
|
|
56
56
|
for (currEl of current) if (!prev.includes(currEl)) handleAdded(currEl);
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+storage@1.3.11_solid-js@1.9.
|
|
59
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+storage@1.3.11_solid-js@1.9.15/node_modules/@solid-primitives/storage/dist/index.js
|
|
60
60
|
function createStorage(props) {
|
|
61
61
|
const [error, setError] = require_utils.createSignal();
|
|
62
62
|
const handleError = props?.throw ? (err, fallback) => {
|
|
@@ -232,17 +232,7 @@ var cookieStorage = addClearMethod({
|
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
234
|
//#endregion
|
|
235
|
-
//#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@
|
|
236
|
-
/**
|
|
237
|
-
* match-sorter-utils
|
|
238
|
-
*
|
|
239
|
-
* Copyright (c) TanStack
|
|
240
|
-
*
|
|
241
|
-
* This source code is licensed under the MIT license found in the
|
|
242
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
243
|
-
*
|
|
244
|
-
* @license MIT
|
|
245
|
-
*/
|
|
235
|
+
//#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.1.2/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js
|
|
246
236
|
const characterMap = {
|
|
247
237
|
À: "A",
|
|
248
238
|
Á: "A",
|
|
@@ -651,6 +641,8 @@ function removeAccents(str) {
|
|
|
651
641
|
return characterMap[match];
|
|
652
642
|
});
|
|
653
643
|
}
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.1.2/node_modules/@tanstack/match-sorter-utils/dist/index.js
|
|
654
646
|
/**
|
|
655
647
|
* @name match-sorter
|
|
656
648
|
* @license MIT license.
|
|
@@ -668,16 +660,15 @@ const rankings = {
|
|
|
668
660
|
NO_MATCH: 0
|
|
669
661
|
};
|
|
670
662
|
/**
|
|
671
|
-
* Gets the highest ranking
|
|
663
|
+
* Gets the highest ranking value for the given item based on its values for the given keys
|
|
672
664
|
* @param {*} item - the item to rank
|
|
673
665
|
* @param {String} value - the value to rank against
|
|
674
666
|
* @param {Object} options - options to control the ranking
|
|
675
667
|
* @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking
|
|
676
668
|
*/
|
|
677
669
|
function rankItem(item, value, options) {
|
|
678
|
-
var _options$threshold;
|
|
679
670
|
options = options || {};
|
|
680
|
-
options.threshold =
|
|
671
|
+
options.threshold = options.threshold ?? rankings.MATCHES;
|
|
681
672
|
if (!options.accessors) {
|
|
682
673
|
const rank = getMatchRanking(item, value, options);
|
|
683
674
|
return {
|
|
@@ -791,8 +782,7 @@ function getClosenessRanking(testString, stringToRank) {
|
|
|
791
782
|
* @param {Object} options - {keepDiacritics: whether to remove diacritics}
|
|
792
783
|
* @return {String} the prepared value
|
|
793
784
|
*/
|
|
794
|
-
function prepareValueForComparison(value,
|
|
795
|
-
let { keepDiacritics } = _ref;
|
|
785
|
+
function prepareValueForComparison(value, { keepDiacritics }) {
|
|
796
786
|
value = `${value}`;
|
|
797
787
|
if (!keepDiacritics) value = removeAccents(value);
|
|
798
788
|
return value;
|
|
@@ -847,7 +837,7 @@ function getAccessorAttributes(accessor) {
|
|
|
847
837
|
};
|
|
848
838
|
}
|
|
849
839
|
//#endregion
|
|
850
|
-
//#region ../../node_modules/.pnpm/goober@2.1.
|
|
840
|
+
//#region ../../node_modules/.pnpm/goober@2.1.19_csstype@3.2.3/node_modules/goober/dist/goober.modern.js
|
|
851
841
|
let e = { data: "" };
|
|
852
842
|
let t = (t) => {
|
|
853
843
|
if ("object" == typeof window) {
|
|
@@ -859,28 +849,28 @@ let t = (t) => {
|
|
|
859
849
|
}
|
|
860
850
|
return t || e;
|
|
861
851
|
};
|
|
862
|
-
let
|
|
863
|
-
let
|
|
852
|
+
let a = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
|
|
853
|
+
let l = /\/\*[^]*?\*\/| +/g;
|
|
864
854
|
let n = /\n+/g;
|
|
865
855
|
let o = (e, t) => {
|
|
866
|
-
let r = "",
|
|
856
|
+
let r = "", a = "", l = "";
|
|
867
857
|
for (let n in e) {
|
|
868
858
|
let c = e[n];
|
|
869
|
-
"@" == n[0] ? "i" == n[1] ? r = n + " " + c + ";" :
|
|
859
|
+
"@" == n[0] ? "i" == n[1] ? r = n + " " + c + ";" : a += "f" == n[1] ? o(c, n) : n + "{" + o(c, "k" == n[1] ? "" : t) + "}" : "object" == typeof c ? a += o(c, t ? t.replace(/([^,])+/g, (e) => n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t) => /&/.test(t) ? t.replace(/&/g, e) : e ? e + " " + t : t)) : n) : null != c && (n = "-" == n[1] ? n : n.replace(/[A-Z]/g, "-$&").toLowerCase(), l += o.p ? o.p(n, c) : n + ":" + c + ";");
|
|
870
860
|
}
|
|
871
|
-
return r + (t &&
|
|
861
|
+
return r + (t && l ? t + "{" + l + "}" : l) + a;
|
|
872
862
|
};
|
|
873
863
|
let c = {};
|
|
874
|
-
let
|
|
864
|
+
let i = (e) => {
|
|
875
865
|
if ("object" == typeof e) {
|
|
876
866
|
let t = "";
|
|
877
|
-
for (let r in e) t += r +
|
|
867
|
+
for (let r in e) t += r + i(e[r]);
|
|
878
868
|
return t;
|
|
879
869
|
}
|
|
880
870
|
return e;
|
|
881
871
|
};
|
|
882
|
-
let
|
|
883
|
-
let u =
|
|
872
|
+
let s = (e, t, r, s, p) => {
|
|
873
|
+
let u = i(e), d = c[u] || (c[u] = ((e) => {
|
|
884
874
|
let t = 0, r = 11;
|
|
885
875
|
for (; t < e.length;) r = 101 * r + e.charCodeAt(t++) >>> 0;
|
|
886
876
|
return "go" + r;
|
|
@@ -888,27 +878,27 @@ let i = (e, t, r, i, p) => {
|
|
|
888
878
|
if (!c[d]) {
|
|
889
879
|
let t = u !== e ? e : ((e) => {
|
|
890
880
|
let t, r, o = [{}];
|
|
891
|
-
for (; t =
|
|
881
|
+
for (; t = a.exec(e.replace(l, ""));) t[4] ? o.shift() : t[3] ? (r = t[3].replace(n, " ").trim(), o.unshift(o[0][r] = o[0][r] || {})) : o[0][t[1]] = t[2].replace(n, " ").trim();
|
|
892
882
|
return o[0];
|
|
893
883
|
})(e);
|
|
894
884
|
c[d] = o(p ? { ["@keyframes " + d]: t } : t, r ? "" : "." + d);
|
|
895
885
|
}
|
|
896
|
-
let f = r && c.g
|
|
897
|
-
return r && (c.g = c[d]), ((e, t, r,
|
|
898
|
-
|
|
899
|
-
})(c[d], t,
|
|
886
|
+
let f = r && c.g;
|
|
887
|
+
return r && (c.g = c[d]), ((e, t, r, a) => {
|
|
888
|
+
a ? t.data = t.data.replace(a, e) : -1 === t.data.indexOf(e) && (t.data = r ? e + t.data : t.data + e);
|
|
889
|
+
})(c[d], t, s, f), d;
|
|
900
890
|
};
|
|
901
|
-
let p = (e, t, r) => e.reduce((e,
|
|
902
|
-
let n = t[
|
|
891
|
+
let p = (e, t, r) => e.reduce((e, a, l) => {
|
|
892
|
+
let n = t[l];
|
|
903
893
|
if (n && n.call) {
|
|
904
894
|
let e = n(r), t = e && e.props && e.props.className || /^go/.test(e) && e;
|
|
905
895
|
n = t ? "." + t : e && "object" == typeof e ? e.props ? "" : o(e, "") : !1 === e ? "" : e;
|
|
906
896
|
}
|
|
907
|
-
return e +
|
|
897
|
+
return e + a + (null == n ? "" : n);
|
|
908
898
|
}, "");
|
|
909
899
|
function u(e) {
|
|
910
|
-
let r = this || {},
|
|
911
|
-
return
|
|
900
|
+
let r = this || {}, a = e.call ? e(r.p) : e;
|
|
901
|
+
return s(a.unshift ? a.raw ? p(a, [].slice.call(arguments, 1), r.p) : a.reduce((e, t) => Object.assign(e, t && t.call ? t(r.p) : t), {}) : a, t(r.target), r.g, r.o, r.k);
|
|
912
902
|
}
|
|
913
903
|
u.bind({ g: 1 });
|
|
914
904
|
u.bind({ k: 1 });
|
|
@@ -928,7 +918,7 @@ function clsx() {
|
|
|
928
918
|
return n;
|
|
929
919
|
}
|
|
930
920
|
//#endregion
|
|
931
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+transition-group@1.1.2_solid-js@1.9.
|
|
921
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+transition-group@1.1.2_solid-js@1.9.15/node_modules/@solid-primitives/transition-group/dist/index.js
|
|
932
922
|
const noop$1 = () => {};
|
|
933
923
|
/**
|
|
934
924
|
* Create an element list transition interface for changes to the list of elements.
|
|
@@ -1024,7 +1014,7 @@ function createListTransition(source, options) {
|
|
|
1024
1014
|
}, options.appear ? [] : initSource.slice());
|
|
1025
1015
|
}
|
|
1026
1016
|
//#endregion
|
|
1027
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+refs@1.1.3_solid-js@1.9.
|
|
1017
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+refs@1.1.3_solid-js@1.9.15/node_modules/@solid-primitives/refs/dist/index.js
|
|
1028
1018
|
/**
|
|
1029
1019
|
* Utility for chaining multiple `ref` assignments with `props.ref` forwarding.
|
|
1030
1020
|
* @param refs list of ref setters. Can be a `props.ref` prop for ref forwarding or a setter to a local variable (`el => ref = el`).
|
|
@@ -1087,7 +1077,7 @@ function resolveElements(fn, predicate = defaultElementPredicate, serverPredicat
|
|
|
1087
1077
|
return memo;
|
|
1088
1078
|
}
|
|
1089
1079
|
//#endregion
|
|
1090
|
-
//#region ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.9.
|
|
1080
|
+
//#region ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.9.15/node_modules/solid-transition-group/dist/index.js
|
|
1091
1081
|
function createClassnames(props) {
|
|
1092
1082
|
return require_utils.createMemo(() => {
|
|
1093
1083
|
const name = props.name || "s";
|
|
@@ -1200,7 +1190,7 @@ var TransitionGroup = (props) => {
|
|
|
1200
1190
|
});
|
|
1201
1191
|
};
|
|
1202
1192
|
//#endregion
|
|
1203
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+keyed@1.5.3_solid-js@1.9.
|
|
1193
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+keyed@1.5.3_solid-js@1.9.15/node_modules/@solid-primitives/keyed/dist/index.js
|
|
1204
1194
|
const FALLBACK = Symbol("fallback");
|
|
1205
1195
|
function dispose(list) {
|
|
1206
1196
|
for (const o of list) o.dispose();
|
|
@@ -1300,7 +1290,7 @@ function Key(props) {
|
|
|
1300
1290
|
return require_utils.createMemo(keyArray(() => props.each, typeof by === "function" ? by : (v) => v[by], props.children, "fallback" in props ? { fallback: () => props.fallback } : void 0));
|
|
1301
1291
|
}
|
|
1302
1292
|
//#endregion
|
|
1303
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+event-listener@2.4.
|
|
1293
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+event-listener@2.4.6_solid-js@1.9.15/node_modules/@solid-primitives/event-listener/dist/eventListener.js
|
|
1304
1294
|
function makeEventListener(target, type, handler, options) {
|
|
1305
1295
|
target.addEventListener(type, handler, options);
|
|
1306
1296
|
return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));
|
|
@@ -1315,7 +1305,7 @@ function createEventListener(targets, type, handler, options) {
|
|
|
1315
1305
|
else require_utils.createRenderEffect(attachListeners);
|
|
1316
1306
|
}
|
|
1317
1307
|
//#endregion
|
|
1318
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+resize-observer@2.
|
|
1308
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+resize-observer@2.2.0_solid-js@1.9.15/node_modules/@solid-primitives/resize-observer/dist/index.js
|
|
1319
1309
|
/**
|
|
1320
1310
|
* Instantiate a new ResizeObserver that automatically get's disposed on cleanup.
|
|
1321
1311
|
*
|
|
@@ -1366,7 +1356,7 @@ function createResizeObserver(targets, onResize, options) {
|
|
|
1366
1356
|
}, []);
|
|
1367
1357
|
}
|
|
1368
1358
|
//#endregion
|
|
1369
|
-
//#region ../../node_modules/.pnpm/@solid-primitives+props@3.2.3_solid-js@1.9.
|
|
1359
|
+
//#region ../../node_modules/.pnpm/@solid-primitives+props@3.2.3_solid-js@1.9.15/node_modules/@solid-primitives/props/dist/combineProps.js
|
|
1370
1360
|
const extractCSSregex = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
|
|
1371
1361
|
/**
|
|
1372
1362
|
* converts inline string styles to object form
|
|
@@ -1391,7 +1381,7 @@ function combineStyle(a, b) {
|
|
|
1391
1381
|
};
|
|
1392
1382
|
}
|
|
1393
1383
|
//#endregion
|
|
1394
|
-
//#region ../../node_modules/.pnpm/@kobalte+utils@0.9.
|
|
1384
|
+
//#region ../../node_modules/.pnpm/@kobalte+utils@0.9.2_solid-js@1.9.15/node_modules/@kobalte/utils/dist/index.js
|
|
1395
1385
|
function addItemToArray(array, item, index = -1) {
|
|
1396
1386
|
if (!(index in array)) return [...array, item];
|
|
1397
1387
|
return [
|
|
@@ -1657,7 +1647,7 @@ function mergeDefaultProps(defaultProps, props) {
|
|
|
1657
1647
|
var transitionsByElement = /* @__PURE__ */ new Map();
|
|
1658
1648
|
var transitionCallbacks = /* @__PURE__ */ new Set();
|
|
1659
1649
|
function setupGlobalEvents() {
|
|
1660
|
-
if (typeof window === "undefined") return;
|
|
1650
|
+
if (typeof window === "undefined" || document.body === null) return;
|
|
1661
1651
|
const onTransitionStart = (e) => {
|
|
1662
1652
|
if (!e.target) return;
|
|
1663
1653
|
let transitions = transitionsByElement.get(e.target);
|
|
@@ -1756,153 +1746,7 @@ var visuallyHiddenStyles = {
|
|
|
1756
1746
|
"white-space": "nowrap"
|
|
1757
1747
|
};
|
|
1758
1748
|
//#endregion
|
|
1759
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
1760
|
-
function createTagName(ref, fallback) {
|
|
1761
|
-
const [tagName, setTagName] = require_utils.createSignal(stringOrUndefined(fallback?.()));
|
|
1762
|
-
require_utils.createEffect(() => {
|
|
1763
|
-
setTagName(ref()?.tagName.toLowerCase() || stringOrUndefined(fallback?.()));
|
|
1764
|
-
});
|
|
1765
|
-
return tagName;
|
|
1766
|
-
}
|
|
1767
|
-
function stringOrUndefined(value) {
|
|
1768
|
-
return isString(value) ? value : void 0;
|
|
1769
|
-
}
|
|
1770
|
-
//#endregion
|
|
1771
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/6Y7B2NEO.js
|
|
1772
|
-
function Polymorphic(props) {
|
|
1773
|
-
const [local, others] = require_utils.splitProps(props, ["as"]);
|
|
1774
|
-
if (!local.as) throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");
|
|
1775
|
-
return require_utils.createComponent(require_utils.Dynamic, require_utils.mergeProps(others, { get component() {
|
|
1776
|
-
return local.as;
|
|
1777
|
-
} }));
|
|
1778
|
-
}
|
|
1779
|
-
//#endregion
|
|
1780
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/5ZKAE4VZ.js
|
|
1781
|
-
var __defProp = Object.defineProperty;
|
|
1782
|
-
var __export = (target, all) => {
|
|
1783
|
-
for (var name in all) __defProp(target, name, {
|
|
1784
|
-
get: all[name],
|
|
1785
|
-
enumerable: true
|
|
1786
|
-
});
|
|
1787
|
-
};
|
|
1788
|
-
__export({}, {
|
|
1789
|
-
Button: () => Button,
|
|
1790
|
-
Root: () => ButtonRoot
|
|
1791
|
-
});
|
|
1792
|
-
var BUTTON_INPUT_TYPES = [
|
|
1793
|
-
"button",
|
|
1794
|
-
"color",
|
|
1795
|
-
"file",
|
|
1796
|
-
"image",
|
|
1797
|
-
"reset",
|
|
1798
|
-
"submit"
|
|
1799
|
-
];
|
|
1800
|
-
function isButton(element) {
|
|
1801
|
-
const tagName = element.tagName.toLowerCase();
|
|
1802
|
-
if (tagName === "button") return true;
|
|
1803
|
-
if (tagName === "input" && element.type) return BUTTON_INPUT_TYPES.indexOf(element.type) !== -1;
|
|
1804
|
-
return false;
|
|
1805
|
-
}
|
|
1806
|
-
function ButtonRoot(props) {
|
|
1807
|
-
let ref;
|
|
1808
|
-
const mergedProps = mergeDefaultProps({ type: "button" }, props);
|
|
1809
|
-
const [local, others] = require_utils.splitProps(mergedProps, [
|
|
1810
|
-
"ref",
|
|
1811
|
-
"type",
|
|
1812
|
-
"disabled"
|
|
1813
|
-
]);
|
|
1814
|
-
const tagName = createTagName(() => ref, () => "button");
|
|
1815
|
-
const isNativeButton = require_utils.createMemo(() => {
|
|
1816
|
-
const elementTagName = tagName();
|
|
1817
|
-
if (elementTagName == null) return false;
|
|
1818
|
-
return isButton({
|
|
1819
|
-
tagName: elementTagName,
|
|
1820
|
-
type: local.type
|
|
1821
|
-
});
|
|
1822
|
-
});
|
|
1823
|
-
const isNativeInput = require_utils.createMemo(() => {
|
|
1824
|
-
return tagName() === "input";
|
|
1825
|
-
});
|
|
1826
|
-
const isNativeLink = require_utils.createMemo(() => {
|
|
1827
|
-
return tagName() === "a" && ref?.getAttribute("href") != null;
|
|
1828
|
-
});
|
|
1829
|
-
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({
|
|
1830
|
-
as: "button",
|
|
1831
|
-
ref(r$) {
|
|
1832
|
-
const _ref$ = mergeRefs((el) => ref = el, local.ref);
|
|
1833
|
-
typeof _ref$ === "function" && _ref$(r$);
|
|
1834
|
-
},
|
|
1835
|
-
get type() {
|
|
1836
|
-
return isNativeButton() || isNativeInput() ? local.type : void 0;
|
|
1837
|
-
},
|
|
1838
|
-
get role() {
|
|
1839
|
-
return !isNativeButton() && !isNativeLink() ? "button" : void 0;
|
|
1840
|
-
},
|
|
1841
|
-
get tabIndex() {
|
|
1842
|
-
return !isNativeButton() && !isNativeLink() && !local.disabled ? 0 : void 0;
|
|
1843
|
-
},
|
|
1844
|
-
get disabled() {
|
|
1845
|
-
return isNativeButton() || isNativeInput() ? local.disabled : void 0;
|
|
1846
|
-
},
|
|
1847
|
-
get ["aria-disabled"]() {
|
|
1848
|
-
return !isNativeButton() && !isNativeInput() && local.disabled ? true : void 0;
|
|
1849
|
-
},
|
|
1850
|
-
get ["data-disabled"]() {
|
|
1851
|
-
return local.disabled ? "" : void 0;
|
|
1852
|
-
}
|
|
1853
|
-
}, others));
|
|
1854
|
-
}
|
|
1855
|
-
var Button = ButtonRoot;
|
|
1856
|
-
//#endregion
|
|
1857
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/BLN63FDC.js
|
|
1858
|
-
function createControllableSignal(props) {
|
|
1859
|
-
const [_value, _setValue] = require_utils.createSignal(props.defaultValue?.());
|
|
1860
|
-
const isControlled = require_utils.createMemo(() => props.value?.() !== void 0);
|
|
1861
|
-
const value = require_utils.createMemo(() => isControlled() ? props.value?.() : _value());
|
|
1862
|
-
const setValue = (next) => {
|
|
1863
|
-
require_utils.untrack(() => {
|
|
1864
|
-
const nextValue = accessWith(next, value());
|
|
1865
|
-
if (!Object.is(nextValue, value())) {
|
|
1866
|
-
if (!isControlled()) _setValue(nextValue);
|
|
1867
|
-
props.onChange?.(nextValue);
|
|
1868
|
-
}
|
|
1869
|
-
return nextValue;
|
|
1870
|
-
});
|
|
1871
|
-
};
|
|
1872
|
-
return [value, setValue];
|
|
1873
|
-
}
|
|
1874
|
-
function createControllableBooleanSignal(props) {
|
|
1875
|
-
const [_value, setValue] = createControllableSignal(props);
|
|
1876
|
-
const value = () => _value() ?? false;
|
|
1877
|
-
return [value, setValue];
|
|
1878
|
-
}
|
|
1879
|
-
function createControllableArraySignal(props) {
|
|
1880
|
-
const [_value, setValue] = createControllableSignal(props);
|
|
1881
|
-
const value = () => _value() ?? [];
|
|
1882
|
-
return [value, setValue];
|
|
1883
|
-
}
|
|
1884
|
-
//#endregion
|
|
1885
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/YGDQXQ2B.js
|
|
1886
|
-
function createToggleState(props = {}) {
|
|
1887
|
-
const [isSelected, _setIsSelected] = createControllableBooleanSignal({
|
|
1888
|
-
value: () => access$1(props.isSelected),
|
|
1889
|
-
defaultValue: () => !!access$1(props.defaultIsSelected),
|
|
1890
|
-
onChange: (value) => props.onSelectedChange?.(value)
|
|
1891
|
-
});
|
|
1892
|
-
const setIsSelected = (value) => {
|
|
1893
|
-
if (!access$1(props.isReadOnly) && !access$1(props.isDisabled)) _setIsSelected(value);
|
|
1894
|
-
};
|
|
1895
|
-
const toggle = () => {
|
|
1896
|
-
if (!access$1(props.isReadOnly) && !access$1(props.isDisabled)) _setIsSelected(!isSelected());
|
|
1897
|
-
};
|
|
1898
|
-
return {
|
|
1899
|
-
isSelected,
|
|
1900
|
-
setIsSelected,
|
|
1901
|
-
toggle
|
|
1902
|
-
};
|
|
1903
|
-
}
|
|
1904
|
-
//#endregion
|
|
1905
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/JMA2RWU6.js
|
|
1749
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/3NGA46QE.js
|
|
1906
1750
|
function buildNodes(params) {
|
|
1907
1751
|
let index = params.startIndex ?? 0;
|
|
1908
1752
|
const level = params.startLevel ?? 0;
|
|
@@ -1997,7 +1841,7 @@ function createCollection(props, deps = []) {
|
|
|
1997
1841
|
});
|
|
1998
1842
|
}
|
|
1999
1843
|
//#endregion
|
|
2000
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
1844
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/7TPOQ36Z.js
|
|
2001
1845
|
var RTL_SCRIPTS = /* @__PURE__ */ new Set([
|
|
2002
1846
|
"Avst",
|
|
2003
1847
|
"Arab",
|
|
@@ -2096,7 +1940,35 @@ function createCollator(options) {
|
|
|
2096
1940
|
});
|
|
2097
1941
|
}
|
|
2098
1942
|
//#endregion
|
|
2099
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
1943
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/BLN63FDC.js
|
|
1944
|
+
function createControllableSignal(props) {
|
|
1945
|
+
const [_value, _setValue] = require_utils.createSignal(props.defaultValue?.());
|
|
1946
|
+
const isControlled = require_utils.createMemo(() => props.value?.() !== void 0);
|
|
1947
|
+
const value = require_utils.createMemo(() => isControlled() ? props.value?.() : _value());
|
|
1948
|
+
const setValue = (next) => {
|
|
1949
|
+
require_utils.untrack(() => {
|
|
1950
|
+
const nextValue = accessWith(next, value());
|
|
1951
|
+
if (!Object.is(nextValue, value())) {
|
|
1952
|
+
if (!isControlled()) _setValue(nextValue);
|
|
1953
|
+
props.onChange?.(nextValue);
|
|
1954
|
+
}
|
|
1955
|
+
return nextValue;
|
|
1956
|
+
});
|
|
1957
|
+
};
|
|
1958
|
+
return [value, setValue];
|
|
1959
|
+
}
|
|
1960
|
+
function createControllableBooleanSignal(props) {
|
|
1961
|
+
const [_value, setValue] = createControllableSignal(props);
|
|
1962
|
+
const value = () => _value() ?? false;
|
|
1963
|
+
return [value, setValue];
|
|
1964
|
+
}
|
|
1965
|
+
function createControllableArraySignal(props) {
|
|
1966
|
+
const [_value, setValue] = createControllableSignal(props);
|
|
1967
|
+
const value = () => _value() ?? [];
|
|
1968
|
+
return [value, setValue];
|
|
1969
|
+
}
|
|
1970
|
+
//#endregion
|
|
1971
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/3D6FM2PJ.js
|
|
2100
1972
|
var Selection = class _Selection extends Set {
|
|
2101
1973
|
anchorKey;
|
|
2102
1974
|
currentKey;
|
|
@@ -2334,9 +2206,9 @@ function createSelectableCollection(props, ref, scrollRef) {
|
|
|
2334
2206
|
}
|
|
2335
2207
|
break;
|
|
2336
2208
|
case "Escape":
|
|
2337
|
-
if (!e.defaultPrevented) {
|
|
2209
|
+
if (!e.defaultPrevented && !access$1(mergedProps.disallowEmptySelection)) {
|
|
2338
2210
|
e.preventDefault();
|
|
2339
|
-
|
|
2211
|
+
manager.clearSelection();
|
|
2340
2212
|
}
|
|
2341
2213
|
break;
|
|
2342
2214
|
case "Tab": if (!access$1(mergedProps.allowsTabNavigation)) {
|
|
@@ -2810,7 +2682,7 @@ function createListState(props) {
|
|
|
2810
2682
|
};
|
|
2811
2683
|
}
|
|
2812
2684
|
//#endregion
|
|
2813
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
2685
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/7CVNMTYF.js
|
|
2814
2686
|
var DomCollectionContext = require_utils.createContext();
|
|
2815
2687
|
function useOptionalDomCollectionContext() {
|
|
2816
2688
|
return require_utils.useContext(DomCollectionContext);
|
|
@@ -2935,83 +2807,334 @@ function createDomCollectionItem(props) {
|
|
|
2935
2807
|
});
|
|
2936
2808
|
}
|
|
2937
2809
|
//#endregion
|
|
2938
|
-
//#region ../../node_modules/.pnpm/@
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
"right",
|
|
2946
|
-
"bottom",
|
|
2947
|
-
"left"
|
|
2948
|
-
];
|
|
2949
|
-
const min = Math.min;
|
|
2950
|
-
const max = Math.max;
|
|
2951
|
-
const round = Math.round;
|
|
2952
|
-
const floor = Math.floor;
|
|
2953
|
-
const createCoords = (v) => ({
|
|
2954
|
-
x: v,
|
|
2955
|
-
y: v
|
|
2956
|
-
});
|
|
2957
|
-
const oppositeSideMap = {
|
|
2958
|
-
left: "right",
|
|
2959
|
-
right: "left",
|
|
2960
|
-
bottom: "top",
|
|
2961
|
-
top: "bottom"
|
|
2962
|
-
};
|
|
2963
|
-
function clamp(start, value, end) {
|
|
2964
|
-
return max(start, min(value, end));
|
|
2965
|
-
}
|
|
2966
|
-
function evaluate(value, param) {
|
|
2967
|
-
return typeof value === "function" ? value(param) : value;
|
|
2968
|
-
}
|
|
2969
|
-
function getSide(placement) {
|
|
2970
|
-
return placement.split("-")[0];
|
|
2971
|
-
}
|
|
2972
|
-
function getAlignment(placement) {
|
|
2973
|
-
return placement.split("-")[1];
|
|
2974
|
-
}
|
|
2975
|
-
function getOppositeAxis(axis) {
|
|
2976
|
-
return axis === "x" ? "y" : "x";
|
|
2977
|
-
}
|
|
2978
|
-
function getAxisLength(axis) {
|
|
2979
|
-
return axis === "y" ? "height" : "width";
|
|
2980
|
-
}
|
|
2981
|
-
function getSideAxis(placement) {
|
|
2982
|
-
const firstChar = placement[0];
|
|
2983
|
-
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
2984
|
-
}
|
|
2985
|
-
function getAlignmentAxis(placement) {
|
|
2986
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
2987
|
-
}
|
|
2988
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
2989
|
-
if (rtl === void 0) rtl = false;
|
|
2990
|
-
const alignment = getAlignment(placement);
|
|
2991
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
2992
|
-
const length = getAxisLength(alignmentAxis);
|
|
2993
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
2994
|
-
if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
2995
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
2996
|
-
}
|
|
2997
|
-
function getExpandedPlacements(placement) {
|
|
2998
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
2999
|
-
return [
|
|
3000
|
-
getOppositeAlignmentPlacement(placement),
|
|
3001
|
-
oppositePlacement,
|
|
3002
|
-
getOppositeAlignmentPlacement(oppositePlacement)
|
|
3003
|
-
];
|
|
3004
|
-
}
|
|
3005
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
3006
|
-
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
2810
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/6Y7B2NEO.js
|
|
2811
|
+
function Polymorphic(props) {
|
|
2812
|
+
const [local, others] = require_utils.splitProps(props, ["as"]);
|
|
2813
|
+
if (!local.as) throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");
|
|
2814
|
+
return require_utils.createComponent(require_utils.Dynamic, require_utils.mergeProps(others, { get component() {
|
|
2815
|
+
return local.as;
|
|
2816
|
+
} }));
|
|
3007
2817
|
}
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
2818
|
+
//#endregion
|
|
2819
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/5ZKAE4VZ.js
|
|
2820
|
+
var __defProp = Object.defineProperty;
|
|
2821
|
+
var __export = (target, all) => {
|
|
2822
|
+
for (var name in all) __defProp(target, name, {
|
|
2823
|
+
get: all[name],
|
|
2824
|
+
enumerable: true
|
|
2825
|
+
});
|
|
2826
|
+
};
|
|
2827
|
+
//#endregion
|
|
2828
|
+
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.15/node_modules/@corvu/utils/dist/chunk/ZV6G25TT.js
|
|
2829
|
+
var access = (v) => typeof v === "function" ? v() : v;
|
|
2830
|
+
//#endregion
|
|
2831
|
+
//#region ../../node_modules/.pnpm/solid-presence@0.2.0_solid-js@1.9.15/node_modules/solid-presence/dist/index.js
|
|
2832
|
+
var createPresence = (props) => {
|
|
2833
|
+
const refStyles = require_utils.createMemo(() => {
|
|
2834
|
+
const element = access(props.element);
|
|
2835
|
+
if (!element) return;
|
|
2836
|
+
return getComputedStyle(element);
|
|
2837
|
+
});
|
|
2838
|
+
const getAnimationName = () => {
|
|
2839
|
+
return refStyles()?.animationName ?? "none";
|
|
2840
|
+
};
|
|
2841
|
+
const [presentState, setPresentStateInternal] = require_utils.createSignal(access(props.show) ? "present" : "hidden");
|
|
2842
|
+
const setPresentState = (state) => {
|
|
2843
|
+
setPresentStateInternal(state);
|
|
2844
|
+
props.onStateChange?.(state);
|
|
2845
|
+
};
|
|
2846
|
+
let animationName = "none";
|
|
2847
|
+
require_utils.createEffect((prevShow) => {
|
|
2848
|
+
const show = access(props.show);
|
|
2849
|
+
require_utils.untrack(() => {
|
|
2850
|
+
if (prevShow === show) return show;
|
|
2851
|
+
const prevAnimationName = animationName;
|
|
2852
|
+
const currentAnimationName = getAnimationName();
|
|
2853
|
+
if (show) setPresentState("present");
|
|
2854
|
+
else if (currentAnimationName === "none" || refStyles()?.display === "none") setPresentState("hidden");
|
|
2855
|
+
else if (prevShow === true && prevAnimationName !== currentAnimationName) setPresentState("hiding");
|
|
2856
|
+
else setPresentState("hidden");
|
|
2857
|
+
});
|
|
2858
|
+
return show;
|
|
2859
|
+
}, access(props.show));
|
|
2860
|
+
require_utils.createEffect(() => {
|
|
2861
|
+
const element = access(props.element);
|
|
2862
|
+
if (!element) return;
|
|
2863
|
+
const handleAnimationStart = (event) => {
|
|
2864
|
+
if (event.target === element) animationName = getAnimationName();
|
|
2865
|
+
};
|
|
2866
|
+
const handleAnimationEnd = (event) => {
|
|
2867
|
+
const isCurrentAnimation = getAnimationName().includes(event.animationName);
|
|
2868
|
+
if (event.target === element && isCurrentAnimation && presentState() === "hiding") setPresentState("hidden");
|
|
2869
|
+
};
|
|
2870
|
+
element.addEventListener("animationstart", handleAnimationStart);
|
|
2871
|
+
element.addEventListener("animationcancel", handleAnimationEnd);
|
|
2872
|
+
element.addEventListener("animationend", handleAnimationEnd);
|
|
2873
|
+
require_utils.onCleanup(() => {
|
|
2874
|
+
element.removeEventListener("animationstart", handleAnimationStart);
|
|
2875
|
+
element.removeEventListener("animationcancel", handleAnimationEnd);
|
|
2876
|
+
element.removeEventListener("animationend", handleAnimationEnd);
|
|
2877
|
+
});
|
|
2878
|
+
});
|
|
2879
|
+
return {
|
|
2880
|
+
present: () => presentState() === "present" || presentState() === "hiding",
|
|
2881
|
+
state: presentState
|
|
2882
|
+
};
|
|
2883
|
+
};
|
|
2884
|
+
var index_default$1 = createPresence;
|
|
2885
|
+
//#endregion
|
|
2886
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/2YCOH52P.js
|
|
2887
|
+
var DATA_TOP_LAYER_ATTR = "data-kb-top-layer";
|
|
2888
|
+
var originalBodyPointerEvents;
|
|
2889
|
+
var hasDisabledBodyPointerEvents = false;
|
|
2890
|
+
var layers = [];
|
|
2891
|
+
function indexOf(node) {
|
|
2892
|
+
return layers.findIndex((layer) => layer.node === node);
|
|
2893
|
+
}
|
|
2894
|
+
function find(node) {
|
|
2895
|
+
return layers[indexOf(node)];
|
|
2896
|
+
}
|
|
2897
|
+
function isTopMostLayer(node) {
|
|
2898
|
+
return layers.length > 0 && layers[layers.length - 1].node === node;
|
|
2899
|
+
}
|
|
2900
|
+
function getPointerBlockingLayers() {
|
|
2901
|
+
return layers.filter((layer) => layer.isPointerBlocking);
|
|
2902
|
+
}
|
|
2903
|
+
function getTopMostPointerBlockingLayer() {
|
|
2904
|
+
return [...getPointerBlockingLayers()].slice(-1)[0];
|
|
2905
|
+
}
|
|
2906
|
+
function hasPointerBlockingLayer() {
|
|
2907
|
+
return getPointerBlockingLayers().length > 0;
|
|
2908
|
+
}
|
|
2909
|
+
function isBelowPointerBlockingLayer(node) {
|
|
2910
|
+
const highestBlockingIndex = indexOf(getTopMostPointerBlockingLayer()?.node);
|
|
2911
|
+
return indexOf(node) < highestBlockingIndex;
|
|
2912
|
+
}
|
|
2913
|
+
function addLayer(layer) {
|
|
2914
|
+
layers.push(layer);
|
|
2915
|
+
}
|
|
2916
|
+
function removeLayer(node) {
|
|
2917
|
+
const index = indexOf(node);
|
|
2918
|
+
if (index < 0) return;
|
|
2919
|
+
layers.splice(index, 1);
|
|
2920
|
+
}
|
|
2921
|
+
function assignPointerEventToLayers() {
|
|
2922
|
+
for (const { node } of layers) node.style.pointerEvents = isBelowPointerBlockingLayer(node) ? "none" : "auto";
|
|
2923
|
+
}
|
|
2924
|
+
function disableBodyPointerEvents(node) {
|
|
2925
|
+
if (hasPointerBlockingLayer() && !hasDisabledBodyPointerEvents) {
|
|
2926
|
+
const ownerDocument = getDocument(node);
|
|
2927
|
+
originalBodyPointerEvents = document.body.style.pointerEvents;
|
|
2928
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
2929
|
+
hasDisabledBodyPointerEvents = true;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
function restoreBodyPointerEvents(node) {
|
|
2933
|
+
if (hasPointerBlockingLayer()) return;
|
|
2934
|
+
const ownerDocument = getDocument(node);
|
|
2935
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
2936
|
+
if (ownerDocument.body.style.length === 0) ownerDocument.body.removeAttribute("style");
|
|
2937
|
+
hasDisabledBodyPointerEvents = false;
|
|
2938
|
+
}
|
|
2939
|
+
var layerStack = {
|
|
2940
|
+
layers,
|
|
2941
|
+
isTopMostLayer,
|
|
2942
|
+
hasPointerBlockingLayer,
|
|
2943
|
+
isBelowPointerBlockingLayer,
|
|
2944
|
+
addLayer,
|
|
2945
|
+
removeLayer,
|
|
2946
|
+
indexOf,
|
|
2947
|
+
find,
|
|
2948
|
+
assignPointerEventToLayers,
|
|
2949
|
+
disableBodyPointerEvents,
|
|
2950
|
+
restoreBodyPointerEvents
|
|
2951
|
+
};
|
|
2952
|
+
//#endregion
|
|
2953
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/ET5T45DO.js
|
|
2954
|
+
function createTagName(ref, fallback) {
|
|
2955
|
+
const [tagName, setTagName] = require_utils.createSignal(stringOrUndefined(fallback?.()));
|
|
2956
|
+
require_utils.createEffect(() => {
|
|
2957
|
+
setTagName(ref()?.tagName.toLowerCase() || stringOrUndefined(fallback?.()));
|
|
2958
|
+
});
|
|
2959
|
+
return tagName;
|
|
2960
|
+
}
|
|
2961
|
+
function stringOrUndefined(value) {
|
|
2962
|
+
return isString(value) ? value : void 0;
|
|
2963
|
+
}
|
|
2964
|
+
__export({}, {
|
|
2965
|
+
Button: () => Button,
|
|
2966
|
+
Root: () => ButtonRoot
|
|
2967
|
+
});
|
|
2968
|
+
var BUTTON_INPUT_TYPES = [
|
|
2969
|
+
"button",
|
|
2970
|
+
"color",
|
|
2971
|
+
"file",
|
|
2972
|
+
"image",
|
|
2973
|
+
"reset",
|
|
2974
|
+
"submit"
|
|
2975
|
+
];
|
|
2976
|
+
function isButton(element) {
|
|
2977
|
+
const tagName = element.tagName.toLowerCase();
|
|
2978
|
+
if (tagName === "button") return true;
|
|
2979
|
+
if (tagName === "input" && element.type) return BUTTON_INPUT_TYPES.indexOf(element.type) !== -1;
|
|
2980
|
+
return false;
|
|
2981
|
+
}
|
|
2982
|
+
function ButtonRoot(props) {
|
|
2983
|
+
let ref;
|
|
2984
|
+
const mergedProps = mergeDefaultProps({ type: "button" }, props);
|
|
2985
|
+
const [local, others] = require_utils.splitProps(mergedProps, [
|
|
2986
|
+
"ref",
|
|
2987
|
+
"type",
|
|
2988
|
+
"disabled"
|
|
2989
|
+
]);
|
|
2990
|
+
const tagName = createTagName(() => ref, () => "button");
|
|
2991
|
+
const isNativeButton = require_utils.createMemo(() => {
|
|
2992
|
+
const elementTagName = tagName();
|
|
2993
|
+
if (elementTagName == null) return false;
|
|
2994
|
+
return isButton({
|
|
2995
|
+
tagName: elementTagName,
|
|
2996
|
+
type: local.type
|
|
2997
|
+
});
|
|
2998
|
+
});
|
|
2999
|
+
const isNativeInput = require_utils.createMemo(() => {
|
|
3000
|
+
return tagName() === "input";
|
|
3001
|
+
});
|
|
3002
|
+
const isNativeLink = require_utils.createMemo(() => {
|
|
3003
|
+
return tagName() === "a" && ref?.getAttribute("href") != null;
|
|
3004
|
+
});
|
|
3005
|
+
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({
|
|
3006
|
+
as: "button",
|
|
3007
|
+
ref(r$) {
|
|
3008
|
+
const _ref$ = mergeRefs((el) => ref = el, local.ref);
|
|
3009
|
+
typeof _ref$ === "function" && _ref$(r$);
|
|
3010
|
+
},
|
|
3011
|
+
get type() {
|
|
3012
|
+
return isNativeButton() || isNativeInput() ? local.type : void 0;
|
|
3013
|
+
},
|
|
3014
|
+
get role() {
|
|
3015
|
+
return !isNativeButton() && !isNativeLink() ? "button" : void 0;
|
|
3016
|
+
},
|
|
3017
|
+
get tabIndex() {
|
|
3018
|
+
return !isNativeButton() && !isNativeLink() && !local.disabled ? 0 : void 0;
|
|
3019
|
+
},
|
|
3020
|
+
get disabled() {
|
|
3021
|
+
return isNativeButton() || isNativeInput() ? local.disabled : void 0;
|
|
3022
|
+
},
|
|
3023
|
+
get ["aria-disabled"]() {
|
|
3024
|
+
return !isNativeButton() && !isNativeInput() && local.disabled ? true : void 0;
|
|
3025
|
+
},
|
|
3026
|
+
get ["data-disabled"]() {
|
|
3027
|
+
return local.disabled ? "" : void 0;
|
|
3028
|
+
}
|
|
3029
|
+
}, others));
|
|
3030
|
+
}
|
|
3031
|
+
var Button = ButtonRoot;
|
|
3032
|
+
//#endregion
|
|
3033
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/E4R2EMM4.js
|
|
3034
|
+
function createRegisterId(setter) {
|
|
3035
|
+
return (id) => {
|
|
3036
|
+
setter(id);
|
|
3037
|
+
return () => setter(void 0);
|
|
3038
|
+
};
|
|
3039
|
+
}
|
|
3040
|
+
//#endregion
|
|
3041
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/YGDQXQ2B.js
|
|
3042
|
+
function createToggleState(props = {}) {
|
|
3043
|
+
const [isSelected, _setIsSelected] = createControllableBooleanSignal({
|
|
3044
|
+
value: () => access$1(props.isSelected),
|
|
3045
|
+
defaultValue: () => !!access$1(props.defaultIsSelected),
|
|
3046
|
+
onChange: (value) => props.onSelectedChange?.(value)
|
|
3047
|
+
});
|
|
3048
|
+
const setIsSelected = (value) => {
|
|
3049
|
+
if (!access$1(props.isReadOnly) && !access$1(props.isDisabled)) _setIsSelected(value);
|
|
3050
|
+
};
|
|
3051
|
+
const toggle = () => {
|
|
3052
|
+
if (!access$1(props.isReadOnly) && !access$1(props.isDisabled)) _setIsSelected(!isSelected());
|
|
3053
|
+
};
|
|
3054
|
+
return {
|
|
3055
|
+
isSelected,
|
|
3056
|
+
setIsSelected,
|
|
3057
|
+
toggle
|
|
3058
|
+
};
|
|
3059
|
+
}
|
|
3060
|
+
//#endregion
|
|
3061
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
3062
|
+
/**
|
|
3063
|
+
* Custom positioning reference element.
|
|
3064
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
3065
|
+
*/
|
|
3066
|
+
const sides = [
|
|
3067
|
+
"top",
|
|
3068
|
+
"right",
|
|
3069
|
+
"bottom",
|
|
3070
|
+
"left"
|
|
3071
|
+
];
|
|
3072
|
+
const min = Math.min;
|
|
3073
|
+
const max = Math.max;
|
|
3074
|
+
const round = Math.round;
|
|
3075
|
+
const floor = Math.floor;
|
|
3076
|
+
const createCoords = (v) => ({
|
|
3077
|
+
x: v,
|
|
3078
|
+
y: v
|
|
3079
|
+
});
|
|
3080
|
+
const oppositeSideMap = {
|
|
3081
|
+
left: "right",
|
|
3082
|
+
right: "left",
|
|
3083
|
+
bottom: "top",
|
|
3084
|
+
top: "bottom"
|
|
3085
|
+
};
|
|
3086
|
+
function clamp(start, value, end) {
|
|
3087
|
+
return max(start, min(value, end));
|
|
3088
|
+
}
|
|
3089
|
+
function evaluate(value, param) {
|
|
3090
|
+
return typeof value === "function" ? value(param) : value;
|
|
3091
|
+
}
|
|
3092
|
+
function getSide(placement) {
|
|
3093
|
+
return placement.split("-")[0];
|
|
3094
|
+
}
|
|
3095
|
+
function getAlignment(placement) {
|
|
3096
|
+
return placement.split("-")[1];
|
|
3097
|
+
}
|
|
3098
|
+
function getOppositeAxis(axis) {
|
|
3099
|
+
return axis === "x" ? "y" : "x";
|
|
3100
|
+
}
|
|
3101
|
+
function getAxisLength(axis) {
|
|
3102
|
+
return axis === "y" ? "height" : "width";
|
|
3103
|
+
}
|
|
3104
|
+
function getSideAxis(placement) {
|
|
3105
|
+
const firstChar = placement[0];
|
|
3106
|
+
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
3107
|
+
}
|
|
3108
|
+
function getAlignmentAxis(placement) {
|
|
3109
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
3110
|
+
}
|
|
3111
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
3112
|
+
if (rtl === void 0) rtl = false;
|
|
3113
|
+
const alignment = getAlignment(placement);
|
|
3114
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
3115
|
+
const length = getAxisLength(alignmentAxis);
|
|
3116
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
3117
|
+
if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
3118
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
3119
|
+
}
|
|
3120
|
+
function getExpandedPlacements(placement) {
|
|
3121
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
3122
|
+
return [
|
|
3123
|
+
getOppositeAlignmentPlacement(placement),
|
|
3124
|
+
oppositePlacement,
|
|
3125
|
+
getOppositeAlignmentPlacement(oppositePlacement)
|
|
3126
|
+
];
|
|
3127
|
+
}
|
|
3128
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
3129
|
+
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
3130
|
+
}
|
|
3131
|
+
const lrPlacement = ["left", "right"];
|
|
3132
|
+
const rlPlacement = ["right", "left"];
|
|
3133
|
+
const tbPlacement = ["top", "bottom"];
|
|
3134
|
+
const btPlacement = ["bottom", "top"];
|
|
3135
|
+
function getSideList(side, isStart, rtl) {
|
|
3136
|
+
switch (side) {
|
|
3137
|
+
case "top":
|
|
3015
3138
|
case "bottom":
|
|
3016
3139
|
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
3017
3140
|
return isStart ? lrPlacement : rlPlacement;
|
|
@@ -4218,7 +4341,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
4218
4341
|
});
|
|
4219
4342
|
};
|
|
4220
4343
|
//#endregion
|
|
4221
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4344
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/BK63AFY4.js
|
|
4222
4345
|
var PopperContext = require_utils.createContext();
|
|
4223
4346
|
function usePopperContext() {
|
|
4224
4347
|
const context = require_utils.useContext(PopperContext);
|
|
@@ -4485,81 +4608,53 @@ function PopperRoot(props) {
|
|
|
4485
4608
|
}
|
|
4486
4609
|
});
|
|
4487
4610
|
}
|
|
4488
|
-
var Popper = Object.assign(PopperRoot, {
|
|
4489
|
-
Arrow: PopperArrow,
|
|
4490
|
-
Context: PopperContext,
|
|
4491
|
-
usePopperContext,
|
|
4492
|
-
Positioner: PopperPositioner
|
|
4493
|
-
});
|
|
4611
|
+
var Popper = Object.assign(PopperRoot, {
|
|
4612
|
+
Arrow: PopperArrow,
|
|
4613
|
+
Context: PopperContext,
|
|
4614
|
+
usePopperContext,
|
|
4615
|
+
Positioner: PopperPositioner
|
|
4616
|
+
});
|
|
4617
|
+
//#endregion
|
|
4618
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/QEMPLYZX.js
|
|
4619
|
+
function createEscapeKeyDown(props) {
|
|
4620
|
+
const handleKeyDown = (event) => {
|
|
4621
|
+
if (event.key === EventKey.Escape) props.onEscapeKeyDown?.(event);
|
|
4622
|
+
};
|
|
4623
|
+
require_utils.createEffect(() => {
|
|
4624
|
+
if (access$1(props.isDisabled)) return;
|
|
4625
|
+
const document = props.ownerDocument?.() ?? getDocument();
|
|
4626
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
4627
|
+
require_utils.onCleanup(() => {
|
|
4628
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
4629
|
+
});
|
|
4630
|
+
});
|
|
4631
|
+
}
|
|
4494
4632
|
//#endregion
|
|
4495
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
var layers = [];
|
|
4500
|
-
function indexOf(node) {
|
|
4501
|
-
return layers.findIndex((layer) => layer.node === node);
|
|
4502
|
-
}
|
|
4503
|
-
function find(node) {
|
|
4504
|
-
return layers[indexOf(node)];
|
|
4505
|
-
}
|
|
4506
|
-
function isTopMostLayer(node) {
|
|
4507
|
-
return layers[layers.length - 1].node === node;
|
|
4508
|
-
}
|
|
4509
|
-
function getPointerBlockingLayers() {
|
|
4510
|
-
return layers.filter((layer) => layer.isPointerBlocking);
|
|
4511
|
-
}
|
|
4512
|
-
function getTopMostPointerBlockingLayer() {
|
|
4513
|
-
return [...getPointerBlockingLayers()].slice(-1)[0];
|
|
4514
|
-
}
|
|
4515
|
-
function hasPointerBlockingLayer() {
|
|
4516
|
-
return getPointerBlockingLayers().length > 0;
|
|
4517
|
-
}
|
|
4518
|
-
function isBelowPointerBlockingLayer(node) {
|
|
4519
|
-
const highestBlockingIndex = indexOf(getTopMostPointerBlockingLayer()?.node);
|
|
4520
|
-
return indexOf(node) < highestBlockingIndex;
|
|
4521
|
-
}
|
|
4522
|
-
function addLayer(layer) {
|
|
4523
|
-
layers.push(layer);
|
|
4524
|
-
}
|
|
4525
|
-
function removeLayer(node) {
|
|
4526
|
-
const index = indexOf(node);
|
|
4527
|
-
if (index < 0) return;
|
|
4528
|
-
layers.splice(index, 1);
|
|
4529
|
-
}
|
|
4530
|
-
function assignPointerEventToLayers() {
|
|
4531
|
-
for (const { node } of layers) node.style.pointerEvents = isBelowPointerBlockingLayer(node) ? "none" : "auto";
|
|
4633
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/3MORIDD7.js
|
|
4634
|
+
function getEventTarget(event) {
|
|
4635
|
+
const target = (typeof event.composedPath === "function" ? event.composedPath() : void 0)?.[0] ?? event.target;
|
|
4636
|
+
return target instanceof Element ? target : null;
|
|
4532
4637
|
}
|
|
4533
|
-
function
|
|
4534
|
-
if (
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4638
|
+
function containsComposed(parent, child) {
|
|
4639
|
+
if (!parent) return false;
|
|
4640
|
+
let node = child;
|
|
4641
|
+
while (node) {
|
|
4642
|
+
if (contains$1(parent, node)) return true;
|
|
4643
|
+
const root = node.getRootNode();
|
|
4644
|
+
node = root instanceof ShadowRoot ? root.host : null;
|
|
4539
4645
|
}
|
|
4646
|
+
return false;
|
|
4540
4647
|
}
|
|
4541
|
-
function
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4648
|
+
function closestComposed(element, selector) {
|
|
4649
|
+
let node = element;
|
|
4650
|
+
while (node) {
|
|
4651
|
+
const match = node.closest(selector);
|
|
4652
|
+
if (match) return match;
|
|
4653
|
+
const root = node.getRootNode();
|
|
4654
|
+
node = root instanceof ShadowRoot ? root.host : null;
|
|
4655
|
+
}
|
|
4656
|
+
return null;
|
|
4547
4657
|
}
|
|
4548
|
-
var layerStack = {
|
|
4549
|
-
layers,
|
|
4550
|
-
isTopMostLayer,
|
|
4551
|
-
hasPointerBlockingLayer,
|
|
4552
|
-
isBelowPointerBlockingLayer,
|
|
4553
|
-
addLayer,
|
|
4554
|
-
removeLayer,
|
|
4555
|
-
indexOf,
|
|
4556
|
-
find,
|
|
4557
|
-
assignPointerEventToLayers,
|
|
4558
|
-
disableBodyPointerEvents,
|
|
4559
|
-
restoreBodyPointerEvents
|
|
4560
|
-
};
|
|
4561
|
-
//#endregion
|
|
4562
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/KKN23NY7.js
|
|
4563
4658
|
var POINTER_DOWN_OUTSIDE_EVENT = "interactOutside.pointerDownOutside";
|
|
4564
4659
|
var FOCUS_OUTSIDE_EVENT = "interactOutside.focusOutside";
|
|
4565
4660
|
function createInteractOutside(props, ref) {
|
|
@@ -4570,17 +4665,17 @@ function createInteractOutside(props, ref) {
|
|
|
4570
4665
|
const onFocusOutside = (e) => props.onFocusOutside?.(e);
|
|
4571
4666
|
const onInteractOutside = (e) => props.onInteractOutside?.(e);
|
|
4572
4667
|
const isEventOutside = (e) => {
|
|
4573
|
-
const target = e
|
|
4574
|
-
if (!
|
|
4575
|
-
if (target
|
|
4576
|
-
if (!
|
|
4577
|
-
if (
|
|
4668
|
+
const target = getEventTarget(e);
|
|
4669
|
+
if (!target) return false;
|
|
4670
|
+
if (closestComposed(target, `[data-kb-top-layer]`)) return false;
|
|
4671
|
+
if (!containsComposed(ownerDocument(), target)) return false;
|
|
4672
|
+
if (containsComposed(ref(), target)) return false;
|
|
4578
4673
|
return !props.shouldExcludeElement?.(target);
|
|
4579
4674
|
};
|
|
4580
4675
|
const onPointerDown = (e) => {
|
|
4581
4676
|
function handler() {
|
|
4582
4677
|
const container = ref();
|
|
4583
|
-
const target = e
|
|
4678
|
+
const target = getEventTarget(e);
|
|
4584
4679
|
if (!container || !target || !isEventOutside(e)) return;
|
|
4585
4680
|
const handler2 = composeEventHandlers([onPointerDownOutside, onInteractOutside]);
|
|
4586
4681
|
target.addEventListener(POINTER_DOWN_OUTSIDE_EVENT, handler2, { once: true });
|
|
@@ -4602,7 +4697,7 @@ function createInteractOutside(props, ref) {
|
|
|
4602
4697
|
};
|
|
4603
4698
|
const onFocusIn = (e) => {
|
|
4604
4699
|
const container = ref();
|
|
4605
|
-
const target = e
|
|
4700
|
+
const target = getEventTarget(e);
|
|
4606
4701
|
if (!container || !target || !isEventOutside(e)) return;
|
|
4607
4702
|
const handler = composeEventHandlers([onFocusOutside, onInteractOutside]);
|
|
4608
4703
|
target.addEventListener(FOCUS_OUTSIDE_EVENT, handler, { once: true });
|
|
@@ -4631,22 +4726,7 @@ function createInteractOutside(props, ref) {
|
|
|
4631
4726
|
});
|
|
4632
4727
|
}
|
|
4633
4728
|
//#endregion
|
|
4634
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4635
|
-
function createEscapeKeyDown(props) {
|
|
4636
|
-
const handleKeyDown = (event) => {
|
|
4637
|
-
if (event.key === EventKey.Escape) props.onEscapeKeyDown?.(event);
|
|
4638
|
-
};
|
|
4639
|
-
require_utils.createEffect(() => {
|
|
4640
|
-
if (access$1(props.isDisabled)) return;
|
|
4641
|
-
const document = props.ownerDocument?.() ?? getDocument();
|
|
4642
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
4643
|
-
require_utils.onCleanup(() => {
|
|
4644
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
4645
|
-
});
|
|
4646
|
-
});
|
|
4647
|
-
}
|
|
4648
|
-
//#endregion
|
|
4649
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/BASJUNIE.js
|
|
4729
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/EGUPPEWQ.js
|
|
4650
4730
|
var DismissableLayerContext = require_utils.createContext();
|
|
4651
4731
|
function useOptionalDismissableLayerContext() {
|
|
4652
4732
|
return require_utils.useContext(DismissableLayerContext);
|
|
@@ -4751,7 +4831,7 @@ function DismissableLayer(props) {
|
|
|
4751
4831
|
});
|
|
4752
4832
|
}
|
|
4753
4833
|
//#endregion
|
|
4754
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4834
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/7LCANGHD.js
|
|
4755
4835
|
function createDisclosureState(props = {}) {
|
|
4756
4836
|
const [isOpen, setIsOpen] = createControllableBooleanSignal({
|
|
4757
4837
|
value: () => access$1(props.open),
|
|
@@ -4776,70 +4856,7 @@ function createDisclosureState(props = {}) {
|
|
|
4776
4856
|
};
|
|
4777
4857
|
}
|
|
4778
4858
|
//#endregion
|
|
4779
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4780
|
-
function createRegisterId(setter) {
|
|
4781
|
-
return (id) => {
|
|
4782
|
-
setter(id);
|
|
4783
|
-
return () => setter(void 0);
|
|
4784
|
-
};
|
|
4785
|
-
}
|
|
4786
|
-
//#endregion
|
|
4787
|
-
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.12/node_modules/@corvu/utils/dist/chunk/ZV6G25TT.js
|
|
4788
|
-
var access = (v) => typeof v === "function" ? v() : v;
|
|
4789
|
-
//#endregion
|
|
4790
|
-
//#region ../../node_modules/.pnpm/solid-presence@0.1.8_solid-js@1.9.12/node_modules/solid-presence/dist/index.js
|
|
4791
|
-
var createPresence = (props) => {
|
|
4792
|
-
const refStyles = require_utils.createMemo(() => {
|
|
4793
|
-
const element = access(props.element);
|
|
4794
|
-
if (!element) return;
|
|
4795
|
-
return getComputedStyle(element);
|
|
4796
|
-
});
|
|
4797
|
-
const getAnimationName = () => {
|
|
4798
|
-
return refStyles()?.animationName ?? "none";
|
|
4799
|
-
};
|
|
4800
|
-
const [presentState, setPresentState] = require_utils.createSignal(access(props.show) ? "present" : "hidden");
|
|
4801
|
-
let animationName = "none";
|
|
4802
|
-
require_utils.createEffect((prevShow) => {
|
|
4803
|
-
const show = access(props.show);
|
|
4804
|
-
require_utils.untrack(() => {
|
|
4805
|
-
if (prevShow === show) return show;
|
|
4806
|
-
const prevAnimationName = animationName;
|
|
4807
|
-
const currentAnimationName = getAnimationName();
|
|
4808
|
-
if (show) setPresentState("present");
|
|
4809
|
-
else if (currentAnimationName === "none" || refStyles()?.display === "none") setPresentState("hidden");
|
|
4810
|
-
else if (prevShow === true && prevAnimationName !== currentAnimationName) setPresentState("hiding");
|
|
4811
|
-
else setPresentState("hidden");
|
|
4812
|
-
});
|
|
4813
|
-
return show;
|
|
4814
|
-
});
|
|
4815
|
-
require_utils.createEffect(() => {
|
|
4816
|
-
const element = access(props.element);
|
|
4817
|
-
if (!element) return;
|
|
4818
|
-
const handleAnimationStart = (event) => {
|
|
4819
|
-
if (event.target === element) animationName = getAnimationName();
|
|
4820
|
-
};
|
|
4821
|
-
const handleAnimationEnd = (event) => {
|
|
4822
|
-
const isCurrentAnimation = getAnimationName().includes(event.animationName);
|
|
4823
|
-
if (event.target === element && isCurrentAnimation && presentState() === "hiding") setPresentState("hidden");
|
|
4824
|
-
};
|
|
4825
|
-
element.addEventListener("animationstart", handleAnimationStart);
|
|
4826
|
-
element.addEventListener("animationcancel", handleAnimationEnd);
|
|
4827
|
-
element.addEventListener("animationend", handleAnimationEnd);
|
|
4828
|
-
require_utils.onCleanup(() => {
|
|
4829
|
-
element.removeEventListener("animationstart", handleAnimationStart);
|
|
4830
|
-
element.removeEventListener("animationcancel", handleAnimationEnd);
|
|
4831
|
-
element.removeEventListener("animationend", handleAnimationEnd);
|
|
4832
|
-
});
|
|
4833
|
-
});
|
|
4834
|
-
return {
|
|
4835
|
-
present: () => presentState() === "present" || presentState() === "hiding",
|
|
4836
|
-
state: presentState,
|
|
4837
|
-
setState: setPresentState
|
|
4838
|
-
};
|
|
4839
|
-
};
|
|
4840
|
-
var src_default$1 = createPresence;
|
|
4841
|
-
//#endregion
|
|
4842
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/YKGT7A57.js
|
|
4859
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/YKGT7A57.js
|
|
4843
4860
|
var FORM_CONTROL_PROP_NAMES = [
|
|
4844
4861
|
"id",
|
|
4845
4862
|
"name",
|
|
@@ -4908,66 +4925,116 @@ function FormControlDescription(props) {
|
|
|
4908
4925
|
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({ as: "div" }, () => context.dataset(), mergedProps));
|
|
4909
4926
|
}
|
|
4910
4927
|
//#endregion
|
|
4911
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4928
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/I2LBZHJH.js
|
|
4929
|
+
var ListKeyboardDelegate = class {
|
|
4930
|
+
collection;
|
|
4931
|
+
ref;
|
|
4932
|
+
collator;
|
|
4933
|
+
constructor(collection, ref, collator) {
|
|
4934
|
+
this.collection = collection;
|
|
4935
|
+
this.ref = ref;
|
|
4936
|
+
this.collator = collator;
|
|
4937
|
+
}
|
|
4938
|
+
getKeyBelow(key) {
|
|
4939
|
+
let keyAfter = this.collection().getKeyAfter(key);
|
|
4940
|
+
while (keyAfter != null) {
|
|
4941
|
+
const item = this.collection().getItem(keyAfter);
|
|
4942
|
+
if (item && item.type === "item" && !item.disabled) return keyAfter;
|
|
4943
|
+
keyAfter = this.collection().getKeyAfter(keyAfter);
|
|
4927
4944
|
}
|
|
4928
|
-
}
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4945
|
+
}
|
|
4946
|
+
getKeyAbove(key) {
|
|
4947
|
+
let keyBefore = this.collection().getKeyBefore(key);
|
|
4948
|
+
while (keyBefore != null) {
|
|
4949
|
+
const item = this.collection().getItem(keyBefore);
|
|
4950
|
+
if (item && item.type === "item" && !item.disabled) return keyBefore;
|
|
4951
|
+
keyBefore = this.collection().getKeyBefore(keyBefore);
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4954
|
+
getFirstKey() {
|
|
4955
|
+
let key = this.collection().getFirstKey();
|
|
4956
|
+
while (key != null) {
|
|
4957
|
+
const item = this.collection().getItem(key);
|
|
4958
|
+
if (item && item.type === "item" && !item.disabled) return key;
|
|
4959
|
+
key = this.collection().getKeyAfter(key);
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4962
|
+
getLastKey() {
|
|
4963
|
+
let key = this.collection().getLastKey();
|
|
4964
|
+
while (key != null) {
|
|
4965
|
+
const item = this.collection().getItem(key);
|
|
4966
|
+
if (item && item.type === "item" && !item.disabled) return key;
|
|
4967
|
+
key = this.collection().getKeyBefore(key);
|
|
4968
|
+
}
|
|
4969
|
+
}
|
|
4970
|
+
getItem(key) {
|
|
4971
|
+
return this.ref?.()?.querySelector(`[data-key="${key}"]`) ?? null;
|
|
4972
|
+
}
|
|
4973
|
+
getKeyPageAbove(key) {
|
|
4974
|
+
const menu = this.ref?.();
|
|
4975
|
+
let item = this.getItem(key);
|
|
4976
|
+
if (!menu || !item) return;
|
|
4977
|
+
const pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);
|
|
4978
|
+
let keyAbove = key;
|
|
4979
|
+
while (keyAbove && item && item.offsetTop > pageY) {
|
|
4980
|
+
keyAbove = this.getKeyAbove(keyAbove);
|
|
4981
|
+
item = keyAbove != null ? this.getItem(keyAbove) : null;
|
|
4982
|
+
}
|
|
4983
|
+
return keyAbove;
|
|
4984
|
+
}
|
|
4985
|
+
getKeyPageBelow(key) {
|
|
4986
|
+
const menu = this.ref?.();
|
|
4987
|
+
let item = this.getItem(key);
|
|
4988
|
+
if (!menu || !item) return;
|
|
4989
|
+
const pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);
|
|
4990
|
+
let keyBelow = key;
|
|
4991
|
+
while (keyBelow && item && item.offsetTop < pageY) {
|
|
4992
|
+
keyBelow = this.getKeyBelow(keyBelow);
|
|
4993
|
+
item = keyBelow != null ? this.getItem(keyBelow) : null;
|
|
4994
|
+
}
|
|
4995
|
+
return keyBelow;
|
|
4996
|
+
}
|
|
4997
|
+
getKeyForSearch(search, fromKey) {
|
|
4998
|
+
const collator = this.collator?.();
|
|
4999
|
+
if (!collator) return;
|
|
5000
|
+
let key = fromKey != null ? this.getKeyBelow(fromKey) : this.getFirstKey();
|
|
5001
|
+
while (key != null) {
|
|
5002
|
+
const item = this.collection().getItem(key);
|
|
5003
|
+
if (item) {
|
|
5004
|
+
const substring = item.textValue.slice(0, search.length);
|
|
5005
|
+
if (item.textValue && collator.compare(substring, search) === 0) return key;
|
|
5006
|
+
}
|
|
5007
|
+
key = this.getKeyBelow(key);
|
|
4966
5008
|
}
|
|
5009
|
+
}
|
|
5010
|
+
};
|
|
5011
|
+
function createSelectableList(props, ref, scrollRef) {
|
|
5012
|
+
const collator = createCollator({
|
|
5013
|
+
usage: "search",
|
|
5014
|
+
sensitivity: "base"
|
|
4967
5015
|
});
|
|
5016
|
+
return createSelectableCollection({
|
|
5017
|
+
selectionManager: () => access$1(props.selectionManager),
|
|
5018
|
+
keyboardDelegate: require_utils.createMemo(() => {
|
|
5019
|
+
const keyboardDelegate = access$1(props.keyboardDelegate);
|
|
5020
|
+
if (keyboardDelegate) return keyboardDelegate;
|
|
5021
|
+
return new ListKeyboardDelegate(props.collection, ref, collator);
|
|
5022
|
+
}),
|
|
5023
|
+
autoFocus: () => access$1(props.autoFocus),
|
|
5024
|
+
deferAutoFocus: () => access$1(props.deferAutoFocus),
|
|
5025
|
+
shouldFocusWrap: () => access$1(props.shouldFocusWrap),
|
|
5026
|
+
disallowEmptySelection: () => access$1(props.disallowEmptySelection),
|
|
5027
|
+
selectOnFocus: () => access$1(props.selectOnFocus),
|
|
5028
|
+
disallowTypeAhead: () => access$1(props.disallowTypeAhead),
|
|
5029
|
+
shouldUseVirtualFocus: () => access$1(props.shouldUseVirtualFocus),
|
|
5030
|
+
allowsTabNavigation: () => access$1(props.allowsTabNavigation),
|
|
5031
|
+
isVirtualized: () => access$1(props.isVirtualized),
|
|
5032
|
+
scrollToKey: (key) => access$1(props.scrollToKey)?.(key),
|
|
5033
|
+
orientation: () => access$1(props.orientation)
|
|
5034
|
+
}, ref, scrollRef);
|
|
4968
5035
|
}
|
|
4969
5036
|
//#endregion
|
|
4970
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
5037
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/G3KI2B4X.js
|
|
4971
5038
|
var AUTOFOCUS_ON_MOUNT_EVENT = "focusScope.autoFocusOnMount";
|
|
4972
5039
|
var AUTOFOCUS_ON_UNMOUNT_EVENT = "focusScope.autoFocusOnUnmount";
|
|
4973
5040
|
var EVENT_OPTIONS = {
|
|
@@ -5121,10 +5188,10 @@ function createFocusScope(props, ref) {
|
|
|
5121
5188
|
});
|
|
5122
5189
|
}
|
|
5123
5190
|
//#endregion
|
|
5124
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
5191
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/YA7DCYMB.js
|
|
5125
5192
|
var DATA_LIVE_ANNOUNCER_ATTR = "data-live-announcer";
|
|
5126
5193
|
//#endregion
|
|
5127
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
5194
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/2FYCRCMB.js
|
|
5128
5195
|
function createHideOutside(props) {
|
|
5129
5196
|
require_utils.createEffect(() => {
|
|
5130
5197
|
if (access$1(props.isDisabled)) return;
|
|
@@ -5157,7 +5224,7 @@ function ariaHideOutside(targets, root = document.body) {
|
|
|
5157
5224
|
const hide = (node) => {
|
|
5158
5225
|
const refCount = refCountMap.get(node) ?? 0;
|
|
5159
5226
|
if (node.getAttribute("aria-hidden") === "true" && refCount === 0) return;
|
|
5160
|
-
if (refCount === 0) node.setAttribute("aria-hidden", "true");
|
|
5227
|
+
if (refCount === 0) setTimeout(() => requestAnimationFrame(() => node.setAttribute("aria-hidden", "true")));
|
|
5161
5228
|
hiddenNodes.add(node);
|
|
5162
5229
|
refCountMap.set(node, refCount + 1);
|
|
5163
5230
|
};
|
|
@@ -5197,10 +5264,14 @@ function ariaHideOutside(targets, root = document.body) {
|
|
|
5197
5264
|
for (const node of hiddenNodes) {
|
|
5198
5265
|
const count = refCountMap.get(node);
|
|
5199
5266
|
if (count == null) return;
|
|
5200
|
-
if (count === 1) {
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5267
|
+
if (count === 1) setTimeout(() => requestAnimationFrame(() => {
|
|
5268
|
+
const currentCount = refCountMap.get(node);
|
|
5269
|
+
if (currentCount === 1) {
|
|
5270
|
+
node.removeAttribute("aria-hidden");
|
|
5271
|
+
refCountMap.delete(node);
|
|
5272
|
+
} else if (currentCount != null && currentCount > 1) refCountMap.set(node, currentCount - 1);
|
|
5273
|
+
}));
|
|
5274
|
+
else refCountMap.set(node, count - 1);
|
|
5204
5275
|
}
|
|
5205
5276
|
if (observerWrapper === observerStack[observerStack.length - 1]) {
|
|
5206
5277
|
observerStack.pop();
|
|
@@ -5209,7 +5280,66 @@ function ariaHideOutside(targets, root = document.body) {
|
|
|
5209
5280
|
};
|
|
5210
5281
|
}
|
|
5211
5282
|
//#endregion
|
|
5212
|
-
//#region ../../node_modules/.pnpm/@
|
|
5283
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/7ZHN3PYD.js
|
|
5284
|
+
function FormControlLabel(props) {
|
|
5285
|
+
let ref;
|
|
5286
|
+
const context = useFormControlContext();
|
|
5287
|
+
const mergedProps = mergeDefaultProps({ id: context.generateId("label") }, props);
|
|
5288
|
+
const [local, others] = require_utils.splitProps(mergedProps, ["ref"]);
|
|
5289
|
+
const tagName = createTagName(() => ref, () => "label");
|
|
5290
|
+
require_utils.createEffect(() => require_utils.onCleanup(context.registerLabel(others.id)));
|
|
5291
|
+
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({
|
|
5292
|
+
as: "label",
|
|
5293
|
+
ref(r$) {
|
|
5294
|
+
const _ref$ = mergeRefs((el) => ref = el, local.ref);
|
|
5295
|
+
typeof _ref$ === "function" && _ref$(r$);
|
|
5296
|
+
},
|
|
5297
|
+
get ["for"]() {
|
|
5298
|
+
return require_utils.memo(() => tagName() === "label")() ? context.fieldId() : void 0;
|
|
5299
|
+
}
|
|
5300
|
+
}, () => context.dataset(), others));
|
|
5301
|
+
}
|
|
5302
|
+
//#endregion
|
|
5303
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/ANN3A2QM.js
|
|
5304
|
+
function createFormResetListener(element, handler) {
|
|
5305
|
+
require_utils.createEffect(require_utils.on(element, (element2) => {
|
|
5306
|
+
if (element2 == null) return;
|
|
5307
|
+
const form = getClosestForm(element2);
|
|
5308
|
+
if (form == null) return;
|
|
5309
|
+
form.addEventListener("reset", handler, { passive: true });
|
|
5310
|
+
require_utils.onCleanup(() => {
|
|
5311
|
+
form.removeEventListener("reset", handler);
|
|
5312
|
+
});
|
|
5313
|
+
}));
|
|
5314
|
+
}
|
|
5315
|
+
function getClosestForm(element) {
|
|
5316
|
+
return isFormElement(element) ? element.form : element.closest("form");
|
|
5317
|
+
}
|
|
5318
|
+
function isFormElement(element) {
|
|
5319
|
+
return element.matches("textarea, input, select, button");
|
|
5320
|
+
}
|
|
5321
|
+
//#endregion
|
|
5322
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/ICNSTULC.js
|
|
5323
|
+
function FormControlErrorMessage(props) {
|
|
5324
|
+
const context = useFormControlContext();
|
|
5325
|
+
const mergedProps = mergeDefaultProps({ id: context.generateId("error-message") }, props);
|
|
5326
|
+
const [local, others] = require_utils.splitProps(mergedProps, ["forceMount"]);
|
|
5327
|
+
const isInvalid = () => context.validationState() === "invalid";
|
|
5328
|
+
require_utils.createEffect(() => {
|
|
5329
|
+
if (!isInvalid()) return;
|
|
5330
|
+
require_utils.onCleanup(context.registerErrorMessage(others.id));
|
|
5331
|
+
});
|
|
5332
|
+
return require_utils.createComponent(require_utils.Show, {
|
|
5333
|
+
get when() {
|
|
5334
|
+
return local.forceMount || isInvalid();
|
|
5335
|
+
},
|
|
5336
|
+
get children() {
|
|
5337
|
+
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({ as: "div" }, () => context.dataset(), others));
|
|
5338
|
+
}
|
|
5339
|
+
});
|
|
5340
|
+
}
|
|
5341
|
+
//#endregion
|
|
5342
|
+
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.15/node_modules/@corvu/utils/dist/chunk/SEUPK2SH.js
|
|
5213
5343
|
var contains = (wrapper, target) => {
|
|
5214
5344
|
if (wrapper.contains(target)) return true;
|
|
5215
5345
|
let currentElement = target;
|
|
@@ -5220,7 +5350,7 @@ var contains = (wrapper, target) => {
|
|
|
5220
5350
|
return false;
|
|
5221
5351
|
};
|
|
5222
5352
|
//#endregion
|
|
5223
|
-
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.
|
|
5353
|
+
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.15/node_modules/@corvu/utils/dist/create/style.js
|
|
5224
5354
|
var activeStyles = /* @__PURE__ */ new Map();
|
|
5225
5355
|
var createStyle = (props) => {
|
|
5226
5356
|
require_utils.createEffect(() => {
|
|
@@ -5254,7 +5384,7 @@ var createStyle = (props) => {
|
|
|
5254
5384
|
};
|
|
5255
5385
|
var style_default = createStyle;
|
|
5256
5386
|
//#endregion
|
|
5257
|
-
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.
|
|
5387
|
+
//#region ../../node_modules/.pnpm/@corvu+utils@0.4.2_solid-js@1.9.15/node_modules/@corvu/utils/dist/scroll/index.js
|
|
5258
5388
|
var getScrollDimensions = (element, axis) => {
|
|
5259
5389
|
switch (axis) {
|
|
5260
5390
|
case "x": return [
|
|
@@ -5293,7 +5423,7 @@ var getScrollAtLocation = (location, axis, stopAt) => {
|
|
|
5293
5423
|
return [availableScroll, availableScrollTop];
|
|
5294
5424
|
};
|
|
5295
5425
|
//#endregion
|
|
5296
|
-
//#region ../../node_modules/.pnpm/solid-prevent-scroll@0.1.
|
|
5426
|
+
//#region ../../node_modules/.pnpm/solid-prevent-scroll@0.1.11_solid-js@1.9.15/node_modules/solid-prevent-scroll/dist/index.js
|
|
5297
5427
|
var [preventScrollStack, setPreventScrollStack] = require_utils.createSignal([]);
|
|
5298
5428
|
var isActive = (id) => preventScrollStack().indexOf(id) === preventScrollStack().length - 1;
|
|
5299
5429
|
var createPreventScroll = (props) => {
|
|
@@ -5319,14 +5449,14 @@ var createPreventScroll = (props) => {
|
|
|
5319
5449
|
});
|
|
5320
5450
|
require_utils.createEffect(() => {
|
|
5321
5451
|
if (!access(defaultedProps.enabled) || !access(defaultedProps.hideScrollbar)) return;
|
|
5322
|
-
const {
|
|
5323
|
-
const scrollbarWidth = window.innerWidth -
|
|
5452
|
+
const { documentElement } = document;
|
|
5453
|
+
const scrollbarWidth = window.innerWidth - documentElement.clientWidth;
|
|
5324
5454
|
if (access(defaultedProps.preventScrollbarShift)) {
|
|
5325
5455
|
const style = { overflow: "hidden" };
|
|
5326
5456
|
const properties = [];
|
|
5327
5457
|
if (scrollbarWidth > 0) {
|
|
5328
|
-
if (access(defaultedProps.preventScrollbarShiftMode) === "padding") style.paddingRight = `calc(${window.getComputedStyle(
|
|
5329
|
-
else style.marginRight = `calc(${window.getComputedStyle(
|
|
5458
|
+
if (access(defaultedProps.preventScrollbarShiftMode) === "padding") style.paddingRight = `calc(${window.getComputedStyle(documentElement).paddingRight} + ${scrollbarWidth}px)`;
|
|
5459
|
+
else style.marginRight = `calc(${window.getComputedStyle(documentElement).marginRight} + ${scrollbarWidth}px)`;
|
|
5330
5460
|
properties.push({
|
|
5331
5461
|
key: "--scrollbar-width",
|
|
5332
5462
|
value: `${scrollbarWidth}px`
|
|
@@ -5336,7 +5466,7 @@ var createPreventScroll = (props) => {
|
|
|
5336
5466
|
const offsetLeft = window.scrollX;
|
|
5337
5467
|
style_default({
|
|
5338
5468
|
key: "prevent-scroll",
|
|
5339
|
-
element:
|
|
5469
|
+
element: documentElement,
|
|
5340
5470
|
style,
|
|
5341
5471
|
properties,
|
|
5342
5472
|
cleanup: () => {
|
|
@@ -5345,7 +5475,7 @@ var createPreventScroll = (props) => {
|
|
|
5345
5475
|
});
|
|
5346
5476
|
} else style_default({
|
|
5347
5477
|
key: "prevent-scroll",
|
|
5348
|
-
element:
|
|
5478
|
+
element: documentElement,
|
|
5349
5479
|
style: { overflow: "hidden" }
|
|
5350
5480
|
});
|
|
5351
5481
|
});
|
|
@@ -5406,9 +5536,9 @@ var wouldScroll = (target, axis, delta, wrapper) => {
|
|
|
5406
5536
|
if (delta < 0 && Math.abs(availableScrollTop) < 1) return false;
|
|
5407
5537
|
return true;
|
|
5408
5538
|
};
|
|
5409
|
-
var
|
|
5539
|
+
var index_default = createPreventScroll;
|
|
5410
5540
|
//#endregion
|
|
5411
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
5541
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/DBKNBLZP.js
|
|
5412
5542
|
var radio_group_exports = {};
|
|
5413
5543
|
__export(radio_group_exports, {
|
|
5414
5544
|
Description: () => FormControlDescription,
|
|
@@ -5504,13 +5634,13 @@ function RadioGroupItemControl(props) {
|
|
|
5504
5634
|
const onClick = (e) => {
|
|
5505
5635
|
callHandler(e, local.onClick);
|
|
5506
5636
|
context.select();
|
|
5507
|
-
context.inputRef()?.focus();
|
|
5637
|
+
context.inputRef()?.focus({ preventScroll: true });
|
|
5508
5638
|
};
|
|
5509
5639
|
const onKeyDown = (e) => {
|
|
5510
5640
|
callHandler(e, local.onKeyDown);
|
|
5511
5641
|
if (e.key === EventKey.Space) {
|
|
5512
5642
|
context.select();
|
|
5513
|
-
context.inputRef()?.focus();
|
|
5643
|
+
context.inputRef()?.focus({ preventScroll: true });
|
|
5514
5644
|
}
|
|
5515
5645
|
};
|
|
5516
5646
|
return require_utils.createComponent(Polymorphic, require_utils.mergeProps({
|
|
@@ -5530,7 +5660,7 @@ function RadioGroupItemIndicator(props) {
|
|
|
5530
5660
|
const mergedProps = mergeDefaultProps({ id: context.generateId("indicator") }, props);
|
|
5531
5661
|
const [local, others] = require_utils.splitProps(mergedProps, ["ref", "forceMount"]);
|
|
5532
5662
|
const [ref, setRef] = require_utils.createSignal();
|
|
5533
|
-
const { present } =
|
|
5663
|
+
const { present } = index_default$1({
|
|
5534
5664
|
show: () => local.forceMount || context.isSelected(),
|
|
5535
5665
|
element: () => ref() ?? null
|
|
5536
5666
|
});
|
|
@@ -5766,116 +5896,7 @@ var RadioGroup = Object.assign(RadioGroupRoot, {
|
|
|
5766
5896
|
Label: RadioGroupLabel
|
|
5767
5897
|
});
|
|
5768
5898
|
//#endregion
|
|
5769
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
5770
|
-
var ListKeyboardDelegate = class {
|
|
5771
|
-
collection;
|
|
5772
|
-
ref;
|
|
5773
|
-
collator;
|
|
5774
|
-
constructor(collection, ref, collator) {
|
|
5775
|
-
this.collection = collection;
|
|
5776
|
-
this.ref = ref;
|
|
5777
|
-
this.collator = collator;
|
|
5778
|
-
}
|
|
5779
|
-
getKeyBelow(key) {
|
|
5780
|
-
let keyAfter = this.collection().getKeyAfter(key);
|
|
5781
|
-
while (keyAfter != null) {
|
|
5782
|
-
const item = this.collection().getItem(keyAfter);
|
|
5783
|
-
if (item && item.type === "item" && !item.disabled) return keyAfter;
|
|
5784
|
-
keyAfter = this.collection().getKeyAfter(keyAfter);
|
|
5785
|
-
}
|
|
5786
|
-
}
|
|
5787
|
-
getKeyAbove(key) {
|
|
5788
|
-
let keyBefore = this.collection().getKeyBefore(key);
|
|
5789
|
-
while (keyBefore != null) {
|
|
5790
|
-
const item = this.collection().getItem(keyBefore);
|
|
5791
|
-
if (item && item.type === "item" && !item.disabled) return keyBefore;
|
|
5792
|
-
keyBefore = this.collection().getKeyBefore(keyBefore);
|
|
5793
|
-
}
|
|
5794
|
-
}
|
|
5795
|
-
getFirstKey() {
|
|
5796
|
-
let key = this.collection().getFirstKey();
|
|
5797
|
-
while (key != null) {
|
|
5798
|
-
const item = this.collection().getItem(key);
|
|
5799
|
-
if (item && item.type === "item" && !item.disabled) return key;
|
|
5800
|
-
key = this.collection().getKeyAfter(key);
|
|
5801
|
-
}
|
|
5802
|
-
}
|
|
5803
|
-
getLastKey() {
|
|
5804
|
-
let key = this.collection().getLastKey();
|
|
5805
|
-
while (key != null) {
|
|
5806
|
-
const item = this.collection().getItem(key);
|
|
5807
|
-
if (item && item.type === "item" && !item.disabled) return key;
|
|
5808
|
-
key = this.collection().getKeyBefore(key);
|
|
5809
|
-
}
|
|
5810
|
-
}
|
|
5811
|
-
getItem(key) {
|
|
5812
|
-
return this.ref?.()?.querySelector(`[data-key="${key}"]`) ?? null;
|
|
5813
|
-
}
|
|
5814
|
-
getKeyPageAbove(key) {
|
|
5815
|
-
const menu = this.ref?.();
|
|
5816
|
-
let item = this.getItem(key);
|
|
5817
|
-
if (!menu || !item) return;
|
|
5818
|
-
const pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);
|
|
5819
|
-
let keyAbove = key;
|
|
5820
|
-
while (keyAbove && item && item.offsetTop > pageY) {
|
|
5821
|
-
keyAbove = this.getKeyAbove(keyAbove);
|
|
5822
|
-
item = keyAbove != null ? this.getItem(keyAbove) : null;
|
|
5823
|
-
}
|
|
5824
|
-
return keyAbove;
|
|
5825
|
-
}
|
|
5826
|
-
getKeyPageBelow(key) {
|
|
5827
|
-
const menu = this.ref?.();
|
|
5828
|
-
let item = this.getItem(key);
|
|
5829
|
-
if (!menu || !item) return;
|
|
5830
|
-
const pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);
|
|
5831
|
-
let keyBelow = key;
|
|
5832
|
-
while (keyBelow && item && item.offsetTop < pageY) {
|
|
5833
|
-
keyBelow = this.getKeyBelow(keyBelow);
|
|
5834
|
-
item = keyBelow != null ? this.getItem(keyBelow) : null;
|
|
5835
|
-
}
|
|
5836
|
-
return keyBelow;
|
|
5837
|
-
}
|
|
5838
|
-
getKeyForSearch(search, fromKey) {
|
|
5839
|
-
const collator = this.collator?.();
|
|
5840
|
-
if (!collator) return;
|
|
5841
|
-
let key = fromKey != null ? this.getKeyBelow(fromKey) : this.getFirstKey();
|
|
5842
|
-
while (key != null) {
|
|
5843
|
-
const item = this.collection().getItem(key);
|
|
5844
|
-
if (item) {
|
|
5845
|
-
const substring = item.textValue.slice(0, search.length);
|
|
5846
|
-
if (item.textValue && collator.compare(substring, search) === 0) return key;
|
|
5847
|
-
}
|
|
5848
|
-
key = this.getKeyBelow(key);
|
|
5849
|
-
}
|
|
5850
|
-
}
|
|
5851
|
-
};
|
|
5852
|
-
function createSelectableList(props, ref, scrollRef) {
|
|
5853
|
-
const collator = createCollator({
|
|
5854
|
-
usage: "search",
|
|
5855
|
-
sensitivity: "base"
|
|
5856
|
-
});
|
|
5857
|
-
return createSelectableCollection({
|
|
5858
|
-
selectionManager: () => access$1(props.selectionManager),
|
|
5859
|
-
keyboardDelegate: require_utils.createMemo(() => {
|
|
5860
|
-
const keyboardDelegate = access$1(props.keyboardDelegate);
|
|
5861
|
-
if (keyboardDelegate) return keyboardDelegate;
|
|
5862
|
-
return new ListKeyboardDelegate(props.collection, ref, collator);
|
|
5863
|
-
}),
|
|
5864
|
-
autoFocus: () => access$1(props.autoFocus),
|
|
5865
|
-
deferAutoFocus: () => access$1(props.deferAutoFocus),
|
|
5866
|
-
shouldFocusWrap: () => access$1(props.shouldFocusWrap),
|
|
5867
|
-
disallowEmptySelection: () => access$1(props.disallowEmptySelection),
|
|
5868
|
-
selectOnFocus: () => access$1(props.selectOnFocus),
|
|
5869
|
-
disallowTypeAhead: () => access$1(props.disallowTypeAhead),
|
|
5870
|
-
shouldUseVirtualFocus: () => access$1(props.shouldUseVirtualFocus),
|
|
5871
|
-
allowsTabNavigation: () => access$1(props.allowsTabNavigation),
|
|
5872
|
-
isVirtualized: () => access$1(props.isVirtualized),
|
|
5873
|
-
scrollToKey: (key) => access$1(props.scrollToKey)?.(key),
|
|
5874
|
-
orientation: () => access$1(props.orientation)
|
|
5875
|
-
}, ref, scrollRef);
|
|
5876
|
-
}
|
|
5877
|
-
//#endregion
|
|
5878
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.11_solid-js@1.9.12/node_modules/@kobalte/core/dist/chunk/46NU5BYI.js
|
|
5899
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/77ALM4RG.js
|
|
5879
5900
|
var MenubarContext = require_utils.createContext();
|
|
5880
5901
|
function useOptionalMenubarContext() {
|
|
5881
5902
|
return require_utils.useContext(MenubarContext);
|
|
@@ -5884,14 +5905,234 @@ var NavigationMenuContext = require_utils.createContext();
|
|
|
5884
5905
|
function useOptionalNavigationMenuContext() {
|
|
5885
5906
|
return require_utils.useContext(NavigationMenuContext);
|
|
5886
5907
|
}
|
|
5887
|
-
var MenuContext = require_utils.createContext();
|
|
5888
|
-
function useOptionalMenuContext() {
|
|
5889
|
-
return require_utils.useContext(MenuContext);
|
|
5908
|
+
var MenuContext = require_utils.createContext();
|
|
5909
|
+
function useOptionalMenuContext() {
|
|
5910
|
+
return require_utils.useContext(MenuContext);
|
|
5911
|
+
}
|
|
5912
|
+
function useMenuContext() {
|
|
5913
|
+
const context = useOptionalMenuContext();
|
|
5914
|
+
if (context === void 0) throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");
|
|
5915
|
+
return context;
|
|
5916
|
+
}
|
|
5917
|
+
var MenuRootContext = require_utils.createContext();
|
|
5918
|
+
function useMenuRootContext() {
|
|
5919
|
+
const context = require_utils.useContext(MenuRootContext);
|
|
5920
|
+
if (context === void 0) throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");
|
|
5921
|
+
return context;
|
|
5922
|
+
}
|
|
5923
|
+
function getPointerGraceArea(placement, event, contentEl) {
|
|
5924
|
+
const basePlacement = placement.split("-")[0];
|
|
5925
|
+
const contentRect = contentEl.getBoundingClientRect();
|
|
5926
|
+
const polygon = [];
|
|
5927
|
+
const pointerX = event.clientX;
|
|
5928
|
+
const pointerY = event.clientY;
|
|
5929
|
+
switch (basePlacement) {
|
|
5930
|
+
case "top":
|
|
5931
|
+
polygon.push([pointerX, pointerY + 5]);
|
|
5932
|
+
polygon.push([contentRect.left, contentRect.bottom]);
|
|
5933
|
+
polygon.push([contentRect.left, contentRect.top]);
|
|
5934
|
+
polygon.push([contentRect.right, contentRect.top]);
|
|
5935
|
+
polygon.push([contentRect.right, contentRect.bottom]);
|
|
5936
|
+
break;
|
|
5937
|
+
case "right":
|
|
5938
|
+
polygon.push([pointerX - 5, pointerY]);
|
|
5939
|
+
polygon.push([contentRect.left, contentRect.top]);
|
|
5940
|
+
polygon.push([contentRect.right, contentRect.top]);
|
|
5941
|
+
polygon.push([contentRect.right, contentRect.bottom]);
|
|
5942
|
+
polygon.push([contentRect.left, contentRect.bottom]);
|
|
5943
|
+
break;
|
|
5944
|
+
case "bottom":
|
|
5945
|
+
polygon.push([pointerX, pointerY - 5]);
|
|
5946
|
+
polygon.push([contentRect.right, contentRect.top]);
|
|
5947
|
+
polygon.push([contentRect.right, contentRect.bottom]);
|
|
5948
|
+
polygon.push([contentRect.left, contentRect.bottom]);
|
|
5949
|
+
polygon.push([contentRect.left, contentRect.top]);
|
|
5950
|
+
break;
|
|
5951
|
+
case "left":
|
|
5952
|
+
polygon.push([pointerX + 5, pointerY]);
|
|
5953
|
+
polygon.push([contentRect.right, contentRect.bottom]);
|
|
5954
|
+
polygon.push([contentRect.left, contentRect.bottom]);
|
|
5955
|
+
polygon.push([contentRect.left, contentRect.top]);
|
|
5956
|
+
polygon.push([contentRect.right, contentRect.top]);
|
|
5957
|
+
}
|
|
5958
|
+
return polygon;
|
|
5959
|
+
}
|
|
5960
|
+
function isPointerInGraceArea(event, area) {
|
|
5961
|
+
if (!area) return false;
|
|
5962
|
+
return isPointInPolygon([event.clientX, event.clientY], area);
|
|
5890
5963
|
}
|
|
5891
|
-
function
|
|
5892
|
-
const
|
|
5893
|
-
|
|
5894
|
-
|
|
5964
|
+
function Menu(props) {
|
|
5965
|
+
const rootContext = useMenuRootContext();
|
|
5966
|
+
const parentDomCollectionContext = useOptionalDomCollectionContext();
|
|
5967
|
+
const parentMenuContext = useOptionalMenuContext();
|
|
5968
|
+
const optionalMenubarContext = useOptionalMenubarContext();
|
|
5969
|
+
const optionalNavigationMenuContext = useOptionalNavigationMenuContext();
|
|
5970
|
+
const mergedProps = mergeDefaultProps({ placement: rootContext.orientation() === "horizontal" ? "bottom-start" : "right-start" }, props);
|
|
5971
|
+
const [local, others] = require_utils.splitProps(mergedProps, [
|
|
5972
|
+
"open",
|
|
5973
|
+
"defaultOpen",
|
|
5974
|
+
"onOpenChange"
|
|
5975
|
+
]);
|
|
5976
|
+
let pointerGraceTimeoutId = 0;
|
|
5977
|
+
let pointerGraceIntent = null;
|
|
5978
|
+
let pointerDir = "right";
|
|
5979
|
+
const [triggerId, setTriggerId] = require_utils.createSignal();
|
|
5980
|
+
const [contentId, setContentId] = require_utils.createSignal();
|
|
5981
|
+
const [triggerRef, setTriggerRef] = require_utils.createSignal();
|
|
5982
|
+
const [contentRef, setContentRef] = require_utils.createSignal();
|
|
5983
|
+
const [focusStrategy, setFocusStrategy] = require_utils.createSignal(true);
|
|
5984
|
+
const [currentPlacement, setCurrentPlacement] = require_utils.createSignal(others.placement);
|
|
5985
|
+
const [nestedMenus, setNestedMenus] = require_utils.createSignal([]);
|
|
5986
|
+
const [items, setItems] = require_utils.createSignal([]);
|
|
5987
|
+
const { DomCollectionProvider } = createDomCollection({
|
|
5988
|
+
items,
|
|
5989
|
+
onItemsChange: setItems
|
|
5990
|
+
});
|
|
5991
|
+
const disclosureState = createDisclosureState({
|
|
5992
|
+
open: () => local.open,
|
|
5993
|
+
defaultOpen: () => local.defaultOpen,
|
|
5994
|
+
onOpenChange: (isOpen) => local.onOpenChange?.(isOpen)
|
|
5995
|
+
});
|
|
5996
|
+
const { present: contentPresent } = index_default$1({
|
|
5997
|
+
show: () => rootContext.forceMount() || disclosureState.isOpen(),
|
|
5998
|
+
element: () => contentRef() ?? null
|
|
5999
|
+
});
|
|
6000
|
+
const listState = createListState({
|
|
6001
|
+
selectionMode: "none",
|
|
6002
|
+
dataSource: items
|
|
6003
|
+
});
|
|
6004
|
+
const open = (focusStrategy2) => {
|
|
6005
|
+
setFocusStrategy(focusStrategy2);
|
|
6006
|
+
disclosureState.open();
|
|
6007
|
+
};
|
|
6008
|
+
const close = (recursively = false) => {
|
|
6009
|
+
disclosureState.close();
|
|
6010
|
+
if (recursively && parentMenuContext) parentMenuContext.close(true);
|
|
6011
|
+
};
|
|
6012
|
+
const toggle = (focusStrategy2) => {
|
|
6013
|
+
setFocusStrategy(focusStrategy2);
|
|
6014
|
+
disclosureState.toggle();
|
|
6015
|
+
};
|
|
6016
|
+
const _focusContent = () => {
|
|
6017
|
+
const content = contentRef();
|
|
6018
|
+
if (content) {
|
|
6019
|
+
focusWithoutScrolling(content);
|
|
6020
|
+
listState.selectionManager().setFocused(true);
|
|
6021
|
+
listState.selectionManager().setFocusedKey(void 0);
|
|
6022
|
+
}
|
|
6023
|
+
};
|
|
6024
|
+
const focusContent = () => {
|
|
6025
|
+
if (optionalNavigationMenuContext != null) setTimeout(() => _focusContent());
|
|
6026
|
+
else _focusContent();
|
|
6027
|
+
};
|
|
6028
|
+
const registerNestedMenu = (element) => {
|
|
6029
|
+
setNestedMenus((prev) => [...prev, element]);
|
|
6030
|
+
const parentUnregister = parentMenuContext?.registerNestedMenu(element);
|
|
6031
|
+
return () => {
|
|
6032
|
+
setNestedMenus((prev) => removeItemFromArray(prev, element));
|
|
6033
|
+
parentUnregister?.();
|
|
6034
|
+
};
|
|
6035
|
+
};
|
|
6036
|
+
const isPointerMovingToSubmenu = (e) => {
|
|
6037
|
+
return pointerDir === pointerGraceIntent?.side && isPointerInGraceArea(e, pointerGraceIntent?.area);
|
|
6038
|
+
};
|
|
6039
|
+
const onItemEnter = (e) => {
|
|
6040
|
+
if (isPointerMovingToSubmenu(e)) e.preventDefault();
|
|
6041
|
+
};
|
|
6042
|
+
const onItemLeave = (e) => {
|
|
6043
|
+
if (isPointerMovingToSubmenu(e)) return;
|
|
6044
|
+
focusContent();
|
|
6045
|
+
};
|
|
6046
|
+
const onTriggerLeave = (e) => {
|
|
6047
|
+
if (isPointerMovingToSubmenu(e)) e.preventDefault();
|
|
6048
|
+
};
|
|
6049
|
+
createHideOutside({
|
|
6050
|
+
isDisabled: () => {
|
|
6051
|
+
return !(parentMenuContext == null && disclosureState.isOpen() && rootContext.isModal());
|
|
6052
|
+
},
|
|
6053
|
+
targets: () => [contentRef(), ...nestedMenus()].filter(Boolean)
|
|
6054
|
+
});
|
|
6055
|
+
require_utils.createEffect(() => {
|
|
6056
|
+
const contentEl = contentRef();
|
|
6057
|
+
if (!contentEl || !parentMenuContext) return;
|
|
6058
|
+
const parentUnregister = parentMenuContext.registerNestedMenu(contentEl);
|
|
6059
|
+
require_utils.onCleanup(() => {
|
|
6060
|
+
parentUnregister();
|
|
6061
|
+
});
|
|
6062
|
+
});
|
|
6063
|
+
require_utils.createEffect(() => {
|
|
6064
|
+
if (parentMenuContext !== void 0) return;
|
|
6065
|
+
optionalMenubarContext?.registerMenu(rootContext.value(), [contentRef(), ...nestedMenus()]);
|
|
6066
|
+
});
|
|
6067
|
+
require_utils.createEffect(() => {
|
|
6068
|
+
if (parentMenuContext !== void 0 || optionalMenubarContext === void 0) return;
|
|
6069
|
+
if (optionalMenubarContext.value() === rootContext.value()) {
|
|
6070
|
+
triggerRef()?.focus();
|
|
6071
|
+
if (optionalMenubarContext.autoFocusMenu()) open(true);
|
|
6072
|
+
} else close();
|
|
6073
|
+
});
|
|
6074
|
+
require_utils.createEffect(() => {
|
|
6075
|
+
if (parentMenuContext !== void 0 || optionalMenubarContext === void 0) return;
|
|
6076
|
+
if (disclosureState.isOpen()) optionalMenubarContext.setValue(rootContext.value());
|
|
6077
|
+
});
|
|
6078
|
+
require_utils.onCleanup(() => {
|
|
6079
|
+
if (parentMenuContext !== void 0) return;
|
|
6080
|
+
optionalMenubarContext?.unregisterMenu(rootContext.value());
|
|
6081
|
+
});
|
|
6082
|
+
const context = {
|
|
6083
|
+
dataset: require_utils.createMemo(() => ({
|
|
6084
|
+
"data-expanded": disclosureState.isOpen() ? "" : void 0,
|
|
6085
|
+
"data-closed": !disclosureState.isOpen() ? "" : void 0
|
|
6086
|
+
})),
|
|
6087
|
+
isOpen: disclosureState.isOpen,
|
|
6088
|
+
contentPresent,
|
|
6089
|
+
nestedMenus,
|
|
6090
|
+
currentPlacement,
|
|
6091
|
+
pointerGraceTimeoutId: () => pointerGraceTimeoutId,
|
|
6092
|
+
autoFocus: focusStrategy,
|
|
6093
|
+
listState: () => listState,
|
|
6094
|
+
parentMenuContext: () => parentMenuContext,
|
|
6095
|
+
triggerRef,
|
|
6096
|
+
contentRef,
|
|
6097
|
+
triggerId,
|
|
6098
|
+
contentId,
|
|
6099
|
+
setTriggerRef,
|
|
6100
|
+
setContentRef,
|
|
6101
|
+
open,
|
|
6102
|
+
close,
|
|
6103
|
+
toggle,
|
|
6104
|
+
focusContent,
|
|
6105
|
+
onItemEnter,
|
|
6106
|
+
onItemLeave,
|
|
6107
|
+
onTriggerLeave,
|
|
6108
|
+
setPointerDir: (dir) => pointerDir = dir,
|
|
6109
|
+
setPointerGraceTimeoutId: (id) => pointerGraceTimeoutId = id,
|
|
6110
|
+
setPointerGraceIntent: (intent) => pointerGraceIntent = intent,
|
|
6111
|
+
registerNestedMenu,
|
|
6112
|
+
registerItemToParentDomCollection: parentDomCollectionContext?.registerItem,
|
|
6113
|
+
registerTriggerId: createRegisterId(setTriggerId),
|
|
6114
|
+
registerContentId: createRegisterId(setContentId)
|
|
6115
|
+
};
|
|
6116
|
+
return require_utils.createComponent(DomCollectionProvider, { get children() {
|
|
6117
|
+
return require_utils.createComponent(MenuContext.Provider, {
|
|
6118
|
+
value: context,
|
|
6119
|
+
get children() {
|
|
6120
|
+
return require_utils.createComponent(require_utils.Show, {
|
|
6121
|
+
when: optionalNavigationMenuContext === void 0,
|
|
6122
|
+
get fallback() {
|
|
6123
|
+
return others.children;
|
|
6124
|
+
},
|
|
6125
|
+
get children() {
|
|
6126
|
+
return require_utils.createComponent(Popper, require_utils.mergeProps({
|
|
6127
|
+
anchorRef: triggerRef,
|
|
6128
|
+
contentRef,
|
|
6129
|
+
onCurrentPlacementChange: setCurrentPlacement
|
|
6130
|
+
}, others));
|
|
6131
|
+
}
|
|
6132
|
+
});
|
|
6133
|
+
}
|
|
6134
|
+
});
|
|
6135
|
+
} });
|
|
5895
6136
|
}
|
|
5896
6137
|
var MenuItemContext = require_utils.createContext();
|
|
5897
6138
|
function useMenuItemContext() {
|
|
@@ -5899,12 +6140,6 @@ function useMenuItemContext() {
|
|
|
5899
6140
|
if (context === void 0) throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");
|
|
5900
6141
|
return context;
|
|
5901
6142
|
}
|
|
5902
|
-
var MenuRootContext = require_utils.createContext();
|
|
5903
|
-
function useMenuRootContext() {
|
|
5904
|
-
const context = require_utils.useContext(MenuRootContext);
|
|
5905
|
-
if (context === void 0) throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");
|
|
5906
|
-
return context;
|
|
5907
|
-
}
|
|
5908
6143
|
function MenuItemBase(props) {
|
|
5909
6144
|
let ref;
|
|
5910
6145
|
const rootContext = useMenuRootContext();
|
|
@@ -5937,7 +6172,7 @@ function MenuItemBase(props) {
|
|
|
5937
6172
|
local.onSelect?.();
|
|
5938
6173
|
if (local.closeOnSelect) setTimeout(() => {
|
|
5939
6174
|
menuContext.close(true);
|
|
5940
|
-
});
|
|
6175
|
+
}, 1);
|
|
5941
6176
|
};
|
|
5942
6177
|
createDomCollectionItem({ getItem: () => ({
|
|
5943
6178
|
ref: () => ref,
|
|
@@ -6279,7 +6514,6 @@ function MenuContentBase(props) {
|
|
|
6279
6514
|
context.close(true);
|
|
6280
6515
|
optionalMenubarContext.setAutoFocusMenu(true);
|
|
6281
6516
|
optionalMenubarContext.previousMenu();
|
|
6282
|
-
break;
|
|
6283
6517
|
}
|
|
6284
6518
|
}
|
|
6285
6519
|
};
|
|
@@ -6384,7 +6618,7 @@ function MenuContent(props) {
|
|
|
6384
6618
|
const rootContext = useMenuRootContext();
|
|
6385
6619
|
const context = useMenuContext();
|
|
6386
6620
|
const [local, others] = require_utils.splitProps(props, ["ref"]);
|
|
6387
|
-
|
|
6621
|
+
index_default({
|
|
6388
6622
|
element: () => ref ?? null,
|
|
6389
6623
|
enabled: () => context.contentPresent() && rootContext.preventScroll()
|
|
6390
6624
|
});
|
|
@@ -6523,242 +6757,72 @@ function MenuRadioGroup(props) {
|
|
|
6523
6757
|
value: {
|
|
6524
6758
|
isDisabled: () => local.disabled,
|
|
6525
6759
|
isSelectedValue: (value) => value === selected(),
|
|
6526
|
-
setSelectedValue: (value) => setSelected(value)
|
|
6527
|
-
},
|
|
6528
|
-
get children() {
|
|
6529
|
-
return require_utils.createComponent(MenuGroup, others);
|
|
6530
|
-
}
|
|
6531
|
-
});
|
|
6532
|
-
}
|
|
6533
|
-
function MenuRadioItem(props) {
|
|
6534
|
-
const context = useMenuRadioGroupContext();
|
|
6535
|
-
const mergedProps = mergeDefaultProps({ closeOnSelect: false }, props);
|
|
6536
|
-
const [local, others] = require_utils.splitProps(mergedProps, ["value", "onSelect"]);
|
|
6537
|
-
const onSelect = () => {
|
|
6538
|
-
local.onSelect?.();
|
|
6539
|
-
context.setSelectedValue(local.value);
|
|
6540
|
-
};
|
|
6541
|
-
return require_utils.createComponent(MenuItemBase, require_utils.mergeProps({
|
|
6542
|
-
role: "menuitemradio",
|
|
6543
|
-
get checked() {
|
|
6544
|
-
return context.isSelectedValue(local.value);
|
|
6545
|
-
},
|
|
6546
|
-
onSelect
|
|
6547
|
-
}, others));
|
|
6548
|
-
}
|
|
6549
|
-
function getPointerGraceArea(placement, event, contentEl) {
|
|
6550
|
-
const basePlacement = placement.split("-")[0];
|
|
6551
|
-
const contentRect = contentEl.getBoundingClientRect();
|
|
6552
|
-
const polygon = [];
|
|
6553
|
-
const pointerX = event.clientX;
|
|
6554
|
-
const pointerY = event.clientY;
|
|
6555
|
-
switch (basePlacement) {
|
|
6556
|
-
case "top":
|
|
6557
|
-
polygon.push([pointerX, pointerY + 5]);
|
|
6558
|
-
polygon.push([contentRect.left, contentRect.bottom]);
|
|
6559
|
-
polygon.push([contentRect.left, contentRect.top]);
|
|
6560
|
-
polygon.push([contentRect.right, contentRect.top]);
|
|
6561
|
-
polygon.push([contentRect.right, contentRect.bottom]);
|
|
6562
|
-
break;
|
|
6563
|
-
case "right":
|
|
6564
|
-
polygon.push([pointerX - 5, pointerY]);
|
|
6565
|
-
polygon.push([contentRect.left, contentRect.top]);
|
|
6566
|
-
polygon.push([contentRect.right, contentRect.top]);
|
|
6567
|
-
polygon.push([contentRect.right, contentRect.bottom]);
|
|
6568
|
-
polygon.push([contentRect.left, contentRect.bottom]);
|
|
6569
|
-
break;
|
|
6570
|
-
case "bottom":
|
|
6571
|
-
polygon.push([pointerX, pointerY - 5]);
|
|
6572
|
-
polygon.push([contentRect.right, contentRect.top]);
|
|
6573
|
-
polygon.push([contentRect.right, contentRect.bottom]);
|
|
6574
|
-
polygon.push([contentRect.left, contentRect.bottom]);
|
|
6575
|
-
polygon.push([contentRect.left, contentRect.top]);
|
|
6576
|
-
break;
|
|
6577
|
-
case "left":
|
|
6578
|
-
polygon.push([pointerX + 5, pointerY]);
|
|
6579
|
-
polygon.push([contentRect.right, contentRect.bottom]);
|
|
6580
|
-
polygon.push([contentRect.left, contentRect.bottom]);
|
|
6581
|
-
polygon.push([contentRect.left, contentRect.top]);
|
|
6582
|
-
polygon.push([contentRect.right, contentRect.top]);
|
|
6583
|
-
}
|
|
6584
|
-
return polygon;
|
|
6760
|
+
setSelectedValue: (value) => setSelected(value)
|
|
6761
|
+
},
|
|
6762
|
+
get children() {
|
|
6763
|
+
return require_utils.createComponent(MenuGroup, others);
|
|
6764
|
+
}
|
|
6765
|
+
});
|
|
6585
6766
|
}
|
|
6586
|
-
function
|
|
6587
|
-
|
|
6588
|
-
|
|
6767
|
+
function MenuRadioItem(props) {
|
|
6768
|
+
const context = useMenuRadioGroupContext();
|
|
6769
|
+
const mergedProps = mergeDefaultProps({ closeOnSelect: false }, props);
|
|
6770
|
+
const [local, others] = require_utils.splitProps(mergedProps, ["value", "onSelect"]);
|
|
6771
|
+
const onSelect = () => {
|
|
6772
|
+
local.onSelect?.();
|
|
6773
|
+
context.setSelectedValue(local.value);
|
|
6774
|
+
};
|
|
6775
|
+
return require_utils.createComponent(MenuItemBase, require_utils.mergeProps({
|
|
6776
|
+
role: "menuitemradio",
|
|
6777
|
+
get checked() {
|
|
6778
|
+
return context.isSelectedValue(local.value);
|
|
6779
|
+
},
|
|
6780
|
+
onSelect
|
|
6781
|
+
}, others));
|
|
6589
6782
|
}
|
|
6590
|
-
function
|
|
6591
|
-
const rootContext = useMenuRootContext();
|
|
6592
|
-
const parentDomCollectionContext = useOptionalDomCollectionContext();
|
|
6593
|
-
const parentMenuContext = useOptionalMenuContext();
|
|
6783
|
+
function MenuRoot(props) {
|
|
6594
6784
|
const optionalMenubarContext = useOptionalMenubarContext();
|
|
6595
|
-
const
|
|
6596
|
-
|
|
6785
|
+
const mergedProps = mergeDefaultProps({
|
|
6786
|
+
id: `menu-${require_utils.createUniqueId()}`,
|
|
6787
|
+
modal: true
|
|
6788
|
+
}, props);
|
|
6597
6789
|
const [local, others] = require_utils.splitProps(mergedProps, [
|
|
6790
|
+
"id",
|
|
6791
|
+
"modal",
|
|
6792
|
+
"preventScroll",
|
|
6793
|
+
"forceMount",
|
|
6598
6794
|
"open",
|
|
6599
6795
|
"defaultOpen",
|
|
6600
|
-
"onOpenChange"
|
|
6796
|
+
"onOpenChange",
|
|
6797
|
+
"value",
|
|
6798
|
+
"orientation"
|
|
6601
6799
|
]);
|
|
6602
|
-
let pointerGraceTimeoutId = 0;
|
|
6603
|
-
let pointerGraceIntent = null;
|
|
6604
|
-
let pointerDir = "right";
|
|
6605
|
-
const [triggerId, setTriggerId] = require_utils.createSignal();
|
|
6606
|
-
const [contentId, setContentId] = require_utils.createSignal();
|
|
6607
|
-
const [triggerRef, setTriggerRef] = require_utils.createSignal();
|
|
6608
|
-
const [contentRef, setContentRef] = require_utils.createSignal();
|
|
6609
|
-
const [focusStrategy, setFocusStrategy] = require_utils.createSignal(true);
|
|
6610
|
-
const [currentPlacement, setCurrentPlacement] = require_utils.createSignal(others.placement);
|
|
6611
|
-
const [nestedMenus, setNestedMenus] = require_utils.createSignal([]);
|
|
6612
|
-
const [items, setItems] = require_utils.createSignal([]);
|
|
6613
|
-
const { DomCollectionProvider } = createDomCollection({
|
|
6614
|
-
items,
|
|
6615
|
-
onItemsChange: setItems
|
|
6616
|
-
});
|
|
6617
6800
|
const disclosureState = createDisclosureState({
|
|
6618
6801
|
open: () => local.open,
|
|
6619
6802
|
defaultOpen: () => local.defaultOpen,
|
|
6620
6803
|
onOpenChange: (isOpen) => local.onOpenChange?.(isOpen)
|
|
6621
6804
|
});
|
|
6622
|
-
const
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
});
|
|
6630
|
-
const open = (focusStrategy2) => {
|
|
6631
|
-
setFocusStrategy(focusStrategy2);
|
|
6632
|
-
disclosureState.open();
|
|
6633
|
-
};
|
|
6634
|
-
const close = (recursively = false) => {
|
|
6635
|
-
disclosureState.close();
|
|
6636
|
-
if (recursively && parentMenuContext) parentMenuContext.close(true);
|
|
6637
|
-
};
|
|
6638
|
-
const toggle = (focusStrategy2) => {
|
|
6639
|
-
setFocusStrategy(focusStrategy2);
|
|
6640
|
-
disclosureState.toggle();
|
|
6805
|
+
const context = {
|
|
6806
|
+
isModal: () => local.modal ?? true,
|
|
6807
|
+
preventScroll: () => local.preventScroll ?? context.isModal(),
|
|
6808
|
+
forceMount: () => local.forceMount ?? false,
|
|
6809
|
+
generateId: createGenerateId(() => local.id),
|
|
6810
|
+
value: () => local.value,
|
|
6811
|
+
orientation: () => local.orientation ?? optionalMenubarContext?.orientation() ?? "horizontal"
|
|
6641
6812
|
};
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6813
|
+
return require_utils.createComponent(MenuRootContext.Provider, {
|
|
6814
|
+
value: context,
|
|
6815
|
+
get children() {
|
|
6816
|
+
return require_utils.createComponent(Menu, require_utils.mergeProps({
|
|
6817
|
+
get open() {
|
|
6818
|
+
return disclosureState.isOpen();
|
|
6819
|
+
},
|
|
6820
|
+
get onOpenChange() {
|
|
6821
|
+
return disclosureState.setIsOpen;
|
|
6822
|
+
}
|
|
6823
|
+
}, others));
|
|
6648
6824
|
}
|
|
6649
|
-
};
|
|
6650
|
-
const focusContent = () => {
|
|
6651
|
-
if (optionalNavigationMenuContext != null) setTimeout(() => _focusContent());
|
|
6652
|
-
else _focusContent();
|
|
6653
|
-
};
|
|
6654
|
-
const registerNestedMenu = (element) => {
|
|
6655
|
-
setNestedMenus((prev) => [...prev, element]);
|
|
6656
|
-
const parentUnregister = parentMenuContext?.registerNestedMenu(element);
|
|
6657
|
-
return () => {
|
|
6658
|
-
setNestedMenus((prev) => removeItemFromArray(prev, element));
|
|
6659
|
-
parentUnregister?.();
|
|
6660
|
-
};
|
|
6661
|
-
};
|
|
6662
|
-
const isPointerMovingToSubmenu = (e) => {
|
|
6663
|
-
return pointerDir === pointerGraceIntent?.side && isPointerInGraceArea(e, pointerGraceIntent?.area);
|
|
6664
|
-
};
|
|
6665
|
-
const onItemEnter = (e) => {
|
|
6666
|
-
if (isPointerMovingToSubmenu(e)) e.preventDefault();
|
|
6667
|
-
};
|
|
6668
|
-
const onItemLeave = (e) => {
|
|
6669
|
-
if (isPointerMovingToSubmenu(e)) return;
|
|
6670
|
-
focusContent();
|
|
6671
|
-
};
|
|
6672
|
-
const onTriggerLeave = (e) => {
|
|
6673
|
-
if (isPointerMovingToSubmenu(e)) e.preventDefault();
|
|
6674
|
-
};
|
|
6675
|
-
createHideOutside({
|
|
6676
|
-
isDisabled: () => {
|
|
6677
|
-
return !(parentMenuContext == null && disclosureState.isOpen() && rootContext.isModal());
|
|
6678
|
-
},
|
|
6679
|
-
targets: () => [contentRef(), ...nestedMenus()].filter(Boolean)
|
|
6680
|
-
});
|
|
6681
|
-
require_utils.createEffect(() => {
|
|
6682
|
-
const contentEl = contentRef();
|
|
6683
|
-
if (!contentEl || !parentMenuContext) return;
|
|
6684
|
-
const parentUnregister = parentMenuContext.registerNestedMenu(contentEl);
|
|
6685
|
-
require_utils.onCleanup(() => {
|
|
6686
|
-
parentUnregister();
|
|
6687
|
-
});
|
|
6688
|
-
});
|
|
6689
|
-
require_utils.createEffect(() => {
|
|
6690
|
-
if (parentMenuContext !== void 0) return;
|
|
6691
|
-
optionalMenubarContext?.registerMenu(rootContext.value(), [contentRef(), ...nestedMenus()]);
|
|
6692
|
-
});
|
|
6693
|
-
require_utils.createEffect(() => {
|
|
6694
|
-
if (parentMenuContext !== void 0 || optionalMenubarContext === void 0) return;
|
|
6695
|
-
if (optionalMenubarContext.value() === rootContext.value()) {
|
|
6696
|
-
triggerRef()?.focus();
|
|
6697
|
-
if (optionalMenubarContext.autoFocusMenu()) open(true);
|
|
6698
|
-
} else close();
|
|
6699
|
-
});
|
|
6700
|
-
require_utils.createEffect(() => {
|
|
6701
|
-
if (parentMenuContext !== void 0 || optionalMenubarContext === void 0) return;
|
|
6702
|
-
if (disclosureState.isOpen()) optionalMenubarContext.setValue(rootContext.value());
|
|
6703
|
-
});
|
|
6704
|
-
require_utils.onCleanup(() => {
|
|
6705
|
-
if (parentMenuContext !== void 0) return;
|
|
6706
|
-
optionalMenubarContext?.unregisterMenu(rootContext.value());
|
|
6707
6825
|
});
|
|
6708
|
-
const context = {
|
|
6709
|
-
dataset: require_utils.createMemo(() => ({
|
|
6710
|
-
"data-expanded": disclosureState.isOpen() ? "" : void 0,
|
|
6711
|
-
"data-closed": !disclosureState.isOpen() ? "" : void 0
|
|
6712
|
-
})),
|
|
6713
|
-
isOpen: disclosureState.isOpen,
|
|
6714
|
-
contentPresent,
|
|
6715
|
-
nestedMenus,
|
|
6716
|
-
currentPlacement,
|
|
6717
|
-
pointerGraceTimeoutId: () => pointerGraceTimeoutId,
|
|
6718
|
-
autoFocus: focusStrategy,
|
|
6719
|
-
listState: () => listState,
|
|
6720
|
-
parentMenuContext: () => parentMenuContext,
|
|
6721
|
-
triggerRef,
|
|
6722
|
-
contentRef,
|
|
6723
|
-
triggerId,
|
|
6724
|
-
contentId,
|
|
6725
|
-
setTriggerRef,
|
|
6726
|
-
setContentRef,
|
|
6727
|
-
open,
|
|
6728
|
-
close,
|
|
6729
|
-
toggle,
|
|
6730
|
-
focusContent,
|
|
6731
|
-
onItemEnter,
|
|
6732
|
-
onItemLeave,
|
|
6733
|
-
onTriggerLeave,
|
|
6734
|
-
setPointerDir: (dir) => pointerDir = dir,
|
|
6735
|
-
setPointerGraceTimeoutId: (id) => pointerGraceTimeoutId = id,
|
|
6736
|
-
setPointerGraceIntent: (intent) => pointerGraceIntent = intent,
|
|
6737
|
-
registerNestedMenu,
|
|
6738
|
-
registerItemToParentDomCollection: parentDomCollectionContext?.registerItem,
|
|
6739
|
-
registerTriggerId: createRegisterId(setTriggerId),
|
|
6740
|
-
registerContentId: createRegisterId(setContentId)
|
|
6741
|
-
};
|
|
6742
|
-
return require_utils.createComponent(DomCollectionProvider, { get children() {
|
|
6743
|
-
return require_utils.createComponent(MenuContext.Provider, {
|
|
6744
|
-
value: context,
|
|
6745
|
-
get children() {
|
|
6746
|
-
return require_utils.createComponent(require_utils.Show, {
|
|
6747
|
-
when: optionalNavigationMenuContext === void 0,
|
|
6748
|
-
get fallback() {
|
|
6749
|
-
return others.children;
|
|
6750
|
-
},
|
|
6751
|
-
get children() {
|
|
6752
|
-
return require_utils.createComponent(Popper, require_utils.mergeProps({
|
|
6753
|
-
anchorRef: triggerRef,
|
|
6754
|
-
contentRef,
|
|
6755
|
-
onCurrentPlacementChange: setCurrentPlacement
|
|
6756
|
-
}, others));
|
|
6757
|
-
}
|
|
6758
|
-
});
|
|
6759
|
-
}
|
|
6760
|
-
});
|
|
6761
|
-
} });
|
|
6762
6826
|
}
|
|
6763
6827
|
function MenuSub(props) {
|
|
6764
6828
|
const { direction } = useLocale();
|
|
@@ -6999,50 +7063,6 @@ function MenuSubTrigger(props) {
|
|
|
6999
7063
|
onPointerLeave
|
|
7000
7064
|
}, () => context.dataset(), others));
|
|
7001
7065
|
}
|
|
7002
|
-
function MenuRoot(props) {
|
|
7003
|
-
const optionalMenubarContext = useOptionalMenubarContext();
|
|
7004
|
-
const mergedProps = mergeDefaultProps({
|
|
7005
|
-
id: `menu-${require_utils.createUniqueId()}`,
|
|
7006
|
-
modal: true
|
|
7007
|
-
}, props);
|
|
7008
|
-
const [local, others] = require_utils.splitProps(mergedProps, [
|
|
7009
|
-
"id",
|
|
7010
|
-
"modal",
|
|
7011
|
-
"preventScroll",
|
|
7012
|
-
"forceMount",
|
|
7013
|
-
"open",
|
|
7014
|
-
"defaultOpen",
|
|
7015
|
-
"onOpenChange",
|
|
7016
|
-
"value",
|
|
7017
|
-
"orientation"
|
|
7018
|
-
]);
|
|
7019
|
-
const disclosureState = createDisclosureState({
|
|
7020
|
-
open: () => local.open,
|
|
7021
|
-
defaultOpen: () => local.defaultOpen,
|
|
7022
|
-
onOpenChange: (isOpen) => local.onOpenChange?.(isOpen)
|
|
7023
|
-
});
|
|
7024
|
-
const context = {
|
|
7025
|
-
isModal: () => local.modal ?? true,
|
|
7026
|
-
preventScroll: () => local.preventScroll ?? context.isModal(),
|
|
7027
|
-
forceMount: () => local.forceMount ?? false,
|
|
7028
|
-
generateId: createGenerateId(() => local.id),
|
|
7029
|
-
value: () => local.value,
|
|
7030
|
-
orientation: () => local.orientation ?? optionalMenubarContext?.orientation() ?? "horizontal"
|
|
7031
|
-
};
|
|
7032
|
-
return require_utils.createComponent(MenuRootContext.Provider, {
|
|
7033
|
-
value: context,
|
|
7034
|
-
get children() {
|
|
7035
|
-
return require_utils.createComponent(Menu, require_utils.mergeProps({
|
|
7036
|
-
get open() {
|
|
7037
|
-
return disclosureState.isOpen();
|
|
7038
|
-
},
|
|
7039
|
-
get onOpenChange() {
|
|
7040
|
-
return disclosureState.setIsOpen;
|
|
7041
|
-
}
|
|
7042
|
-
}, others));
|
|
7043
|
-
}
|
|
7044
|
-
});
|
|
7045
|
-
}
|
|
7046
7066
|
__export({}, {
|
|
7047
7067
|
Root: () => SeparatorRoot,
|
|
7048
7068
|
Separator: () => Separator
|
|
@@ -7071,7 +7091,7 @@ function SeparatorRoot(props) {
|
|
|
7071
7091
|
}
|
|
7072
7092
|
var Separator = SeparatorRoot;
|
|
7073
7093
|
//#endregion
|
|
7074
|
-
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.
|
|
7094
|
+
//#region ../../node_modules/.pnpm/@kobalte+core@0.13.14_solid-js@1.9.15/node_modules/@kobalte/core/dist/chunk/VPR4IPXB.js
|
|
7075
7095
|
var dropdown_menu_exports = {};
|
|
7076
7096
|
__export(dropdown_menu_exports, {
|
|
7077
7097
|
Arrow: () => PopperArrow,
|