@codbex/harmonia 1.4.2 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmonia.css +2 -2
- package/dist/harmonia.esm.js +150 -107
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +149 -108
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +10 -10
package/dist/harmonia.esm.js
CHANGED
|
@@ -1915,23 +1915,18 @@ function unsafeStringify(arr, offset3 = 0) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
|
|
1917
1917
|
// node_modules/uuid/dist/rng.js
|
|
1918
|
-
var getRandomValues;
|
|
1919
1918
|
var rnds8 = new Uint8Array(16);
|
|
1920
1919
|
function rng() {
|
|
1921
|
-
|
|
1922
|
-
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
1923
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1924
|
-
}
|
|
1925
|
-
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
1926
|
-
}
|
|
1927
|
-
return getRandomValues(rnds8);
|
|
1920
|
+
return crypto.getRandomValues(rnds8);
|
|
1928
1921
|
}
|
|
1929
1922
|
|
|
1930
|
-
// node_modules/uuid/dist/native.js
|
|
1931
|
-
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1932
|
-
var native_default = { randomUUID };
|
|
1933
|
-
|
|
1934
1923
|
// node_modules/uuid/dist/v4.js
|
|
1924
|
+
function v4(options, buf, offset3) {
|
|
1925
|
+
if (!buf && !options && crypto.randomUUID) {
|
|
1926
|
+
return crypto.randomUUID();
|
|
1927
|
+
}
|
|
1928
|
+
return _v4(options, buf, offset3);
|
|
1929
|
+
}
|
|
1935
1930
|
function _v4(options, buf, offset3) {
|
|
1936
1931
|
options = options || {};
|
|
1937
1932
|
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
@@ -1952,12 +1947,6 @@ function _v4(options, buf, offset3) {
|
|
|
1952
1947
|
}
|
|
1953
1948
|
return unsafeStringify(rnds);
|
|
1954
1949
|
}
|
|
1955
|
-
function v4(options, buf, offset3) {
|
|
1956
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
1957
|
-
return native_default.randomUUID();
|
|
1958
|
-
}
|
|
1959
|
-
return _v4(options, buf, offset3);
|
|
1960
|
-
}
|
|
1961
1950
|
var v4_default = v4;
|
|
1962
1951
|
|
|
1963
1952
|
// src/common/icons.js
|
|
@@ -2210,10 +2199,10 @@ function accordion_default(Alpine) {
|
|
|
2210
2199
|
}) : { single: false };
|
|
2211
2200
|
el.setAttribute("data-slot", "accordion");
|
|
2212
2201
|
});
|
|
2213
|
-
Alpine.directive("h-accordion-item", (el, { original, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
|
|
2202
|
+
Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
|
|
2214
2203
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
2215
2204
|
if (!accordion) {
|
|
2216
|
-
throw new Error(`${
|
|
2205
|
+
throw new Error(`${original2} must be inside an accordion`);
|
|
2217
2206
|
}
|
|
2218
2207
|
el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
|
|
2219
2208
|
el.setAttribute("data-slot", "accordion-item");
|
|
@@ -2241,14 +2230,14 @@ function accordion_default(Alpine) {
|
|
|
2241
2230
|
setAttributes();
|
|
2242
2231
|
effect(setAttributes);
|
|
2243
2232
|
});
|
|
2244
|
-
Alpine.directive("h-accordion-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
2233
|
+
Alpine.directive("h-accordion-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
2245
2234
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
2246
|
-
throw new Error(`${
|
|
2235
|
+
throw new Error(`${original2} must be a header element`);
|
|
2247
2236
|
}
|
|
2248
2237
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
2249
2238
|
const accordionItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordionItem"));
|
|
2250
2239
|
if (!accordionItem || !accordion) {
|
|
2251
|
-
throw new Error(`${
|
|
2240
|
+
throw new Error(`${original2} must have an accordion and accordion item parent elements`);
|
|
2252
2241
|
}
|
|
2253
2242
|
el.classList.add(
|
|
2254
2243
|
"flex",
|
|
@@ -2433,10 +2422,10 @@ function avatar_default(Alpine) {
|
|
|
2433
2422
|
el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
2434
2423
|
}
|
|
2435
2424
|
});
|
|
2436
|
-
Alpine.directive("h-avatar-image", (el, { original }, { cleanup }) => {
|
|
2425
|
+
Alpine.directive("h-avatar-image", (el, { original: original2 }, { cleanup }) => {
|
|
2437
2426
|
const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
|
|
2438
2427
|
if (!avatar) {
|
|
2439
|
-
throw new Error(`${
|
|
2428
|
+
throw new Error(`${original2} must be inside an avatar element`);
|
|
2440
2429
|
}
|
|
2441
2430
|
el.classList.add("aspect-square", "size-full");
|
|
2442
2431
|
el.setAttribute("data-slot", "avatar-image");
|
|
@@ -2467,10 +2456,10 @@ function avatar_default(Alpine) {
|
|
|
2467
2456
|
observer.disconnect();
|
|
2468
2457
|
});
|
|
2469
2458
|
});
|
|
2470
|
-
Alpine.directive("h-avatar-fallback", (el, { original }, { effect }) => {
|
|
2459
|
+
Alpine.directive("h-avatar-fallback", (el, { original: original2 }, { effect }) => {
|
|
2471
2460
|
const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
|
|
2472
2461
|
if (!avatar) {
|
|
2473
|
-
throw new Error(`${
|
|
2462
|
+
throw new Error(`${original2} must be inside an avatar element`);
|
|
2474
2463
|
}
|
|
2475
2464
|
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
|
|
2476
2465
|
el.setAttribute("data-slot", "avatar-fallback");
|
|
@@ -2679,7 +2668,7 @@ var getButtonSize = (size3, isAddon = false) => {
|
|
|
2679
2668
|
}
|
|
2680
2669
|
};
|
|
2681
2670
|
function button_default(Alpine) {
|
|
2682
|
-
Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
|
|
2671
|
+
Alpine.directive("h-button", (el, { original: original2, modifiers }, { cleanup }) => {
|
|
2683
2672
|
setButtonClasses(el);
|
|
2684
2673
|
if (!el.hasAttribute("data-slot")) {
|
|
2685
2674
|
el.setAttribute("data-slot", "button");
|
|
@@ -2696,7 +2685,7 @@ function button_default(Alpine) {
|
|
|
2696
2685
|
el.classList.remove(...getButtonSize(lastSize, isAddon));
|
|
2697
2686
|
el.classList.add(...getButtonSize(size3, isAddon));
|
|
2698
2687
|
if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
2699
|
-
console.error(`${
|
|
2688
|
+
console.error(`${original2}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
|
|
2700
2689
|
}
|
|
2701
2690
|
lastSize = size3;
|
|
2702
2691
|
}
|
|
@@ -4250,7 +4239,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
4250
4239
|
|
|
4251
4240
|
// src/components/calendar.js
|
|
4252
4241
|
function calendar_default(Alpine) {
|
|
4253
|
-
Alpine.directive("h-calendar", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
4242
|
+
Alpine.directive("h-calendar", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
4254
4243
|
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
|
|
4255
4244
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
4256
4245
|
el.setAttribute("tabindex", "-1");
|
|
@@ -4294,7 +4283,7 @@ function calendar_default(Alpine) {
|
|
|
4294
4283
|
const onInputChange = () => {
|
|
4295
4284
|
const newValue = new Date(datepicker._h_datepicker.input.value);
|
|
4296
4285
|
if (isNaN(newValue)) {
|
|
4297
|
-
console.error(`${
|
|
4286
|
+
console.error(`${original2}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
|
|
4298
4287
|
datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4299
4288
|
return;
|
|
4300
4289
|
} else if (selected.getTime() !== newValue.getTime()) {
|
|
@@ -4311,7 +4300,7 @@ function calendar_default(Alpine) {
|
|
|
4311
4300
|
if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
|
|
4312
4301
|
selected = new Date(el._x_model.get());
|
|
4313
4302
|
if (isNaN(selected)) {
|
|
4314
|
-
console.error(`${
|
|
4303
|
+
console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4315
4304
|
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4316
4305
|
else el.setAttribute("data-invalid", "true");
|
|
4317
4306
|
} else if (datepicker) {
|
|
@@ -4820,10 +4809,10 @@ function collapsible_default(Alpine) {
|
|
|
4820
4809
|
});
|
|
4821
4810
|
}
|
|
4822
4811
|
});
|
|
4823
|
-
Alpine.directive("h-collapsible-trigger", (el, { original, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
4812
|
+
Alpine.directive("h-collapsible-trigger", (el, { original: original2, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
4824
4813
|
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
4825
4814
|
if (!collapsible) {
|
|
4826
|
-
throw new Error(`${
|
|
4815
|
+
throw new Error(`${original2} must be inside a collapsible element`);
|
|
4827
4816
|
}
|
|
4828
4817
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
|
|
4829
4818
|
if (modifiers.includes("chevron")) {
|
|
@@ -4842,10 +4831,10 @@ function collapsible_default(Alpine) {
|
|
|
4842
4831
|
el.removeEventListener("click", handler);
|
|
4843
4832
|
});
|
|
4844
4833
|
});
|
|
4845
|
-
Alpine.directive("h-collapsible-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
4834
|
+
Alpine.directive("h-collapsible-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
4846
4835
|
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
4847
4836
|
if (!collapsible) {
|
|
4848
|
-
throw new Error(`${
|
|
4837
|
+
throw new Error(`${original2} must be inside an h-collapsible element`);
|
|
4849
4838
|
}
|
|
4850
4839
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
|
|
4851
4840
|
el.classList.add("data-[state=closed]:!hidden");
|
|
@@ -4876,7 +4865,7 @@ function sizeObserver(el) {
|
|
|
4876
4865
|
|
|
4877
4866
|
// src/components/datepicker.js
|
|
4878
4867
|
function datepicker_default(Alpine) {
|
|
4879
|
-
Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
4868
|
+
Alpine.directive("h-date-picker", (el, { original: original2, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
4880
4869
|
const state = Alpine2.reactive({
|
|
4881
4870
|
expanded: false
|
|
4882
4871
|
});
|
|
@@ -4889,7 +4878,7 @@ function datepicker_default(Alpine) {
|
|
|
4889
4878
|
};
|
|
4890
4879
|
el._h_datepicker.input = el.querySelector("input");
|
|
4891
4880
|
if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
|
|
4892
|
-
throw new Error(`${
|
|
4881
|
+
throw new Error(`${original2} must contain an input`);
|
|
4893
4882
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
4894
4883
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
4895
4884
|
} else {
|
|
@@ -4966,16 +4955,16 @@ function datepicker_default(Alpine) {
|
|
|
4966
4955
|
observer.disconnect();
|
|
4967
4956
|
});
|
|
4968
4957
|
});
|
|
4969
|
-
Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
4958
|
+
Alpine.directive("h-date-picker-trigger", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
4970
4959
|
if (el.tagName !== "BUTTON") {
|
|
4971
|
-
throw new Error(`${
|
|
4960
|
+
throw new Error(`${original2} must be a button`);
|
|
4972
4961
|
}
|
|
4973
4962
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
4974
|
-
throw new Error(`${
|
|
4963
|
+
throw new Error(`${original2}: must have an "aria-label" or "aria-labelledby" attribute`);
|
|
4975
4964
|
}
|
|
4976
4965
|
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
|
|
4977
4966
|
if (!datepicker) {
|
|
4978
|
-
throw new Error(`${
|
|
4967
|
+
throw new Error(`${original2} must be inside an date-picker element`);
|
|
4979
4968
|
}
|
|
4980
4969
|
el.classList.add("cursor-pointer", "inline-flex", "items-center", "justify-center", "h-full", "aspect-square", "bg-transparent", "hover:bg-secondary", "active:bg-secondary-active", "outline-none");
|
|
4981
4970
|
if (datepicker._h_datepicker.inTable) {
|
|
@@ -5255,13 +5244,13 @@ function fieldset_default(Alpine) {
|
|
|
5255
5244
|
|
|
5256
5245
|
// src/components/icon.js
|
|
5257
5246
|
function icon_default(Alpine) {
|
|
5258
|
-
Alpine.directive("h-icon", (el, { original, modifiers }) => {
|
|
5247
|
+
Alpine.directive("h-icon", (el, { original: original2, modifiers }) => {
|
|
5259
5248
|
if (el.tagName.toLowerCase() !== "svg") {
|
|
5260
|
-
throw new Error(`${
|
|
5249
|
+
throw new Error(`${original2} works only on svg elements`);
|
|
5261
5250
|
} else if (!el.hasAttribute("role")) {
|
|
5262
|
-
throw new Error(`${
|
|
5251
|
+
throw new Error(`${original2} must have a role`);
|
|
5263
5252
|
} else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5264
|
-
throw new Error(`${
|
|
5253
|
+
throw new Error(`${original2}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5265
5254
|
}
|
|
5266
5255
|
el.classList.add("fill-current");
|
|
5267
5256
|
el.setAttribute("data-slot", "icon");
|
|
@@ -5478,7 +5467,7 @@ function input_default(Alpine) {
|
|
|
5478
5467
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
5479
5468
|
el.setAttribute("data-slot", "label");
|
|
5480
5469
|
});
|
|
5481
|
-
Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
|
|
5470
|
+
Alpine.directive("h-input-number", (el, { original: original2 }, { cleanup }) => {
|
|
5482
5471
|
el.classList.add(
|
|
5483
5472
|
"overflow-hidden",
|
|
5484
5473
|
"group/input-number",
|
|
@@ -5511,7 +5500,7 @@ function input_default(Alpine) {
|
|
|
5511
5500
|
el.setAttribute("data-slot", "input-number");
|
|
5512
5501
|
const input = el.querySelector("input");
|
|
5513
5502
|
if (!input || input.getAttribute("type") !== "number") {
|
|
5514
|
-
throw new Error(`${
|
|
5503
|
+
throw new Error(`${original2} must contain an input of type 'number'`);
|
|
5515
5504
|
}
|
|
5516
5505
|
if (!input.hasAttribute("type")) input.setAttribute("type", "number");
|
|
5517
5506
|
if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
|
|
@@ -5757,13 +5746,13 @@ function list_default(Alpine) {
|
|
|
5757
5746
|
el.setAttribute("data-slot", "list");
|
|
5758
5747
|
el.setAttribute("role", "group");
|
|
5759
5748
|
});
|
|
5760
|
-
Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
|
|
5749
|
+
Alpine.directive("h-list-header", (el, { original: original2 }, { Alpine: Alpine2 }) => {
|
|
5761
5750
|
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
5762
5751
|
el.setAttribute("role", "presentation");
|
|
5763
5752
|
el.setAttribute("data-slot", "list-header");
|
|
5764
5753
|
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
5765
5754
|
if (!list) {
|
|
5766
|
-
throw new Error(`${
|
|
5755
|
+
throw new Error(`${original2} must be placed inside a list element`);
|
|
5767
5756
|
}
|
|
5768
5757
|
if (!el.hasAttribute("id")) {
|
|
5769
5758
|
const id = `lbh${v4_default()}`;
|
|
@@ -5815,9 +5804,9 @@ function menu_default(Alpine) {
|
|
|
5815
5804
|
};
|
|
5816
5805
|
el.setAttribute("data-state", "closed");
|
|
5817
5806
|
});
|
|
5818
|
-
Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
5807
|
+
Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
5819
5808
|
if (el.tagName !== "UL") {
|
|
5820
|
-
throw new Error(`${
|
|
5809
|
+
throw new Error(`${original2} must be an ul element`);
|
|
5821
5810
|
}
|
|
5822
5811
|
el.classList.add("hidden", "fixed", "bg-popover", "text-popover-foreground", "font-normal", "z-50", "min-w-[8rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "p-1", "shadow-md", "border", "outline-none");
|
|
5823
5812
|
el.setAttribute("role", "menu");
|
|
@@ -5825,7 +5814,7 @@ function menu_default(Alpine) {
|
|
|
5825
5814
|
el.setAttribute("tabindex", "-1");
|
|
5826
5815
|
el.setAttribute("data-slot", "menu");
|
|
5827
5816
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5828
|
-
throw new Error(`${
|
|
5817
|
+
throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5829
5818
|
}
|
|
5830
5819
|
const isSubmenu = modifiers.includes("sub");
|
|
5831
5820
|
const menuTrigger = (() => {
|
|
@@ -5837,7 +5826,7 @@ function menu_default(Alpine) {
|
|
|
5837
5826
|
return sibling;
|
|
5838
5827
|
})();
|
|
5839
5828
|
if (!isSubmenu && !menuTrigger) {
|
|
5840
|
-
throw new Error(`${
|
|
5829
|
+
throw new Error(`${original2} menu must be placed after a menu trigger element`);
|
|
5841
5830
|
}
|
|
5842
5831
|
let menuSubItem;
|
|
5843
5832
|
if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
@@ -6056,9 +6045,9 @@ function menu_default(Alpine) {
|
|
|
6056
6045
|
el.removeEventListener("keydown", onKeyDown);
|
|
6057
6046
|
});
|
|
6058
6047
|
});
|
|
6059
|
-
Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6048
|
+
Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
6060
6049
|
if (el.tagName !== "LI") {
|
|
6061
|
-
throw new Error(`${
|
|
6050
|
+
throw new Error(`${original2} must be a li element`);
|
|
6062
6051
|
}
|
|
6063
6052
|
el.classList.add(
|
|
6064
6053
|
"focus:bg-secondary-hover",
|
|
@@ -6112,7 +6101,7 @@ function menu_default(Alpine) {
|
|
|
6112
6101
|
el.removeEventListener("mouseleave", focusOut);
|
|
6113
6102
|
});
|
|
6114
6103
|
});
|
|
6115
|
-
Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6104
|
+
Alpine.directive("h-menu-sub", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
6116
6105
|
el.classList.add(
|
|
6117
6106
|
"focus:bg-secondary-hover",
|
|
6118
6107
|
"hover:bg-secondary-hover",
|
|
@@ -6144,7 +6133,7 @@ function menu_default(Alpine) {
|
|
|
6144
6133
|
const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
|
|
6145
6134
|
el.appendChild(chevronRight);
|
|
6146
6135
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6147
|
-
if (!parentMenu) throw new Error(`${
|
|
6136
|
+
if (!parentMenu) throw new Error(`${original2} must have a parent`);
|
|
6148
6137
|
el._menu_sub = {
|
|
6149
6138
|
open: void 0,
|
|
6150
6139
|
close: void 0,
|
|
@@ -6238,9 +6227,9 @@ function menu_default(Alpine) {
|
|
|
6238
6227
|
el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
|
|
6239
6228
|
el.setAttribute("data-slot", "menu-label");
|
|
6240
6229
|
});
|
|
6241
|
-
Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6230
|
+
Alpine.directive("h-menu-checkbox-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
6242
6231
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6243
|
-
throw new Error(`${
|
|
6232
|
+
throw new Error(`${original2} must be a li or div element`);
|
|
6244
6233
|
}
|
|
6245
6234
|
el.classList.add(
|
|
6246
6235
|
"focus:bg-secondary-hover",
|
|
@@ -6306,9 +6295,9 @@ function menu_default(Alpine) {
|
|
|
6306
6295
|
el.removeEventListener("mouseleave", focusOut);
|
|
6307
6296
|
});
|
|
6308
6297
|
});
|
|
6309
|
-
Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
6298
|
+
Alpine.directive("h-menu-radio-item", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
6310
6299
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6311
|
-
throw new Error(`${
|
|
6300
|
+
throw new Error(`${original2} must be a li or div element`);
|
|
6312
6301
|
}
|
|
6313
6302
|
el.classList.add(
|
|
6314
6303
|
"focus:bg-secondary-hover",
|
|
@@ -6537,7 +6526,7 @@ function popover_default(Alpine) {
|
|
|
6537
6526
|
});
|
|
6538
6527
|
}
|
|
6539
6528
|
});
|
|
6540
|
-
Alpine.directive("h-popover", (el, { original, modifiers }, { effect }) => {
|
|
6529
|
+
Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
|
|
6541
6530
|
const popover = (() => {
|
|
6542
6531
|
let sibling = el.previousElementSibling;
|
|
6543
6532
|
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
@@ -6546,7 +6535,7 @@ function popover_default(Alpine) {
|
|
|
6546
6535
|
return sibling;
|
|
6547
6536
|
})();
|
|
6548
6537
|
if (!popover) {
|
|
6549
|
-
throw new Error(`${
|
|
6538
|
+
throw new Error(`${original2} must be placed after a popover element`);
|
|
6550
6539
|
}
|
|
6551
6540
|
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-md", "border", "shadow-md", "outline-hidden", "overflow-auto");
|
|
6552
6541
|
el.setAttribute("data-slot", "popover");
|
|
@@ -6749,9 +6738,9 @@ function select_default(Alpine) {
|
|
|
6749
6738
|
});
|
|
6750
6739
|
}
|
|
6751
6740
|
});
|
|
6752
|
-
Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
6741
|
+
Alpine.directive("h-select-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
6753
6742
|
if (el.tagName !== "INPUT") {
|
|
6754
|
-
throw new Error(`${
|
|
6743
|
+
throw new Error(`${original2} must be an input of type "text"`);
|
|
6755
6744
|
}
|
|
6756
6745
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
6757
6746
|
const label = (() => {
|
|
@@ -6762,7 +6751,7 @@ function select_default(Alpine) {
|
|
|
6762
6751
|
return;
|
|
6763
6752
|
})();
|
|
6764
6753
|
if (!select) {
|
|
6765
|
-
throw new Error(`${
|
|
6754
|
+
throw new Error(`${original2} must be inside a select element`);
|
|
6766
6755
|
} else if (el.hasOwnProperty("_x_model")) {
|
|
6767
6756
|
select._h_select.multiple = Array.isArray(el._x_model.get());
|
|
6768
6757
|
select._h_model.set = (value) => {
|
|
@@ -6782,6 +6771,7 @@ function select_default(Alpine) {
|
|
|
6782
6771
|
} else {
|
|
6783
6772
|
el._x_model.set("");
|
|
6784
6773
|
}
|
|
6774
|
+
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
6785
6775
|
};
|
|
6786
6776
|
select._h_model.get = el._x_model.get;
|
|
6787
6777
|
} else {
|
|
@@ -7022,10 +7012,10 @@ function select_default(Alpine) {
|
|
|
7022
7012
|
}
|
|
7023
7013
|
});
|
|
7024
7014
|
});
|
|
7025
|
-
Alpine.directive("h-select-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
7015
|
+
Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
7026
7016
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7027
7017
|
if (!select) {
|
|
7028
|
-
throw new Error(`${
|
|
7018
|
+
throw new Error(`${original2} must be inside a select element`);
|
|
7029
7019
|
}
|
|
7030
7020
|
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "p-1", "top-0", "left-0", "z-50", "min-w-[1rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "border", "shadow-md");
|
|
7031
7021
|
el.setAttribute("data-slot", "select-content");
|
|
@@ -7034,7 +7024,7 @@ function select_default(Alpine) {
|
|
|
7034
7024
|
el.setAttribute("tabindex", "-1");
|
|
7035
7025
|
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7036
7026
|
if (!select._h_select.trigger) {
|
|
7037
|
-
throw new Error(`${
|
|
7027
|
+
throw new Error(`${original2}: trigger not found`);
|
|
7038
7028
|
}
|
|
7039
7029
|
let autoUpdateCleanup;
|
|
7040
7030
|
function updatePosition() {
|
|
@@ -7076,10 +7066,10 @@ function select_default(Alpine) {
|
|
|
7076
7066
|
}
|
|
7077
7067
|
});
|
|
7078
7068
|
});
|
|
7079
|
-
Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7069
|
+
Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7080
7070
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7081
7071
|
if (!select) {
|
|
7082
|
-
throw new Error(`${
|
|
7072
|
+
throw new Error(`${original2} must be inside an h-select element`);
|
|
7083
7073
|
} else {
|
|
7084
7074
|
select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
|
|
7085
7075
|
}
|
|
@@ -7151,10 +7141,10 @@ function select_default(Alpine) {
|
|
|
7151
7141
|
selectGroup._h_selectGroup.labelledby = id;
|
|
7152
7142
|
}
|
|
7153
7143
|
});
|
|
7154
|
-
Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
|
|
7144
|
+
Alpine.directive("h-select-option", (el, { original: original2, expression }, { effect, evaluateLater, cleanup }) => {
|
|
7155
7145
|
const select = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7156
7146
|
if (!select) {
|
|
7157
|
-
throw new Error(`${
|
|
7147
|
+
throw new Error(`${original2} must be inside an h-select element`);
|
|
7158
7148
|
}
|
|
7159
7149
|
el.classList.add(
|
|
7160
7150
|
"focus:bg-primary",
|
|
@@ -7408,10 +7398,10 @@ function sidebar_default(Alpine) {
|
|
|
7408
7398
|
});
|
|
7409
7399
|
}
|
|
7410
7400
|
});
|
|
7411
|
-
Alpine.directive("h-sidebar-group-label", (el, { original }, { cleanup }) => {
|
|
7401
|
+
Alpine.directive("h-sidebar-group-label", (el, { original: original2 }, { cleanup }) => {
|
|
7412
7402
|
const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
|
|
7413
7403
|
if (!group) {
|
|
7414
|
-
throw new Error(`${
|
|
7404
|
+
throw new Error(`${original2} must be placed inside a sidebar group`);
|
|
7415
7405
|
}
|
|
7416
7406
|
el.classList.add(
|
|
7417
7407
|
"ring-sidebar-ring",
|
|
@@ -7498,10 +7488,10 @@ function sidebar_default(Alpine) {
|
|
|
7498
7488
|
}
|
|
7499
7489
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
7500
7490
|
});
|
|
7501
|
-
Alpine.directive("h-sidebar-group-content", (el, { original }, { effect }) => {
|
|
7491
|
+
Alpine.directive("h-sidebar-group-content", (el, { original: original2 }, { effect }) => {
|
|
7502
7492
|
const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
|
|
7503
7493
|
if (!group) {
|
|
7504
|
-
throw new Error(`${
|
|
7494
|
+
throw new Error(`${original2} must be placed inside a sidebar group`);
|
|
7505
7495
|
}
|
|
7506
7496
|
el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
|
|
7507
7497
|
el.setAttribute("data-slot", "sidebar-group-content");
|
|
@@ -7514,16 +7504,16 @@ function sidebar_default(Alpine) {
|
|
|
7514
7504
|
});
|
|
7515
7505
|
}
|
|
7516
7506
|
});
|
|
7517
|
-
Alpine.directive("h-sidebar-menu", (el, { original }) => {
|
|
7507
|
+
Alpine.directive("h-sidebar-menu", (el, { original: original2 }) => {
|
|
7518
7508
|
if (el.tagName !== "UL") {
|
|
7519
|
-
throw new Error(`${
|
|
7509
|
+
throw new Error(`${original2} must be an ul element`);
|
|
7520
7510
|
}
|
|
7521
7511
|
el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
|
|
7522
7512
|
el.setAttribute("data-slot", "sidebar-menu");
|
|
7523
7513
|
});
|
|
7524
|
-
Alpine.directive("h-sidebar-menu-item", (el, { original, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
7514
|
+
Alpine.directive("h-sidebar-menu-item", (el, { original: original2, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
7525
7515
|
if (el.tagName !== "LI") {
|
|
7526
|
-
throw new Error(`${
|
|
7516
|
+
throw new Error(`${original2} must be a li element`);
|
|
7527
7517
|
}
|
|
7528
7518
|
el._h_sidebar_menu_item = {
|
|
7529
7519
|
isSub: false,
|
|
@@ -7559,9 +7549,9 @@ function sidebar_default(Alpine) {
|
|
|
7559
7549
|
});
|
|
7560
7550
|
}
|
|
7561
7551
|
});
|
|
7562
|
-
Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7552
|
+
Alpine.directive("h-sidebar-menu-button", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
7563
7553
|
if (el.tagName !== "BUTTON" && el.tagName !== "A") {
|
|
7564
|
-
throw new Error(`${
|
|
7554
|
+
throw new Error(`${original2} must be a button or a link`);
|
|
7565
7555
|
} else if (el.tagName === "BUTTON") {
|
|
7566
7556
|
el.setAttribute("type", "button");
|
|
7567
7557
|
}
|
|
@@ -7697,9 +7687,9 @@ function sidebar_default(Alpine) {
|
|
|
7697
7687
|
}
|
|
7698
7688
|
el.setAttribute("data-slot", "sidebar-menu-action");
|
|
7699
7689
|
});
|
|
7700
|
-
Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
|
|
7690
|
+
Alpine.directive("h-sidebar-menu-badge", (el, { original: original2 }) => {
|
|
7701
7691
|
if (el.tagName !== "SPAN") {
|
|
7702
|
-
throw new Error(`${
|
|
7692
|
+
throw new Error(`${original2} must be a span element`);
|
|
7703
7693
|
}
|
|
7704
7694
|
el.classList.add("flex-1", "pointer-events-none", "flex", "h-full", "min-w-min", "items-center", "justify-end", "text-xs", "font-medium", "tabular-nums", "select-none", "group-data-[collapsed=true]/sidebar:hidden");
|
|
7705
7695
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
@@ -7725,13 +7715,13 @@ function sidebar_default(Alpine) {
|
|
|
7725
7715
|
el.setAttribute("data-slot", "sidebar-separator");
|
|
7726
7716
|
el.setAttribute("role", "none");
|
|
7727
7717
|
});
|
|
7728
|
-
Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
7718
|
+
Alpine.directive("h-sidebar-menu-sub", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
7729
7719
|
if (el.tagName !== "UL") {
|
|
7730
|
-
throw new Error(`${
|
|
7720
|
+
throw new Error(`${original2} must be an ul element`);
|
|
7731
7721
|
}
|
|
7732
7722
|
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_menu_item"));
|
|
7733
7723
|
if (!menuItem) {
|
|
7734
|
-
throw new Error(`${
|
|
7724
|
+
throw new Error(`${original2} must be placed inside a sidebar menu item`);
|
|
7735
7725
|
}
|
|
7736
7726
|
el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "pl-2.5", "py-0.5", "ml-3.5", "data-[collapsed=true]:!hidden", "group-data-[collapsed=true]/sidebar:!hidden");
|
|
7737
7727
|
if (el.getAttribute("data-line") !== "false") {
|
|
@@ -8000,10 +7990,10 @@ function split_default(Alpine) {
|
|
|
8000
7990
|
observer.disconnect();
|
|
8001
7991
|
});
|
|
8002
7992
|
});
|
|
8003
|
-
Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7993
|
+
Alpine.directive("h-split-panel", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8004
7994
|
const split = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_split"));
|
|
8005
7995
|
if (!split) {
|
|
8006
|
-
throw new Error(`${
|
|
7996
|
+
throw new Error(`${original2} must be inside an split element`);
|
|
8007
7997
|
}
|
|
8008
7998
|
el.classList.add("flex", "shrink", "grow-0", "box-border", "min-w-0", "min-h-0", "overflow-visible");
|
|
8009
7999
|
el.setAttribute("tabindex", "-1");
|
|
@@ -8527,7 +8517,7 @@ function tabs_default(Alpine) {
|
|
|
8527
8517
|
el.setAttribute("role", "tablist");
|
|
8528
8518
|
el.setAttribute("data-slot", "tab-list");
|
|
8529
8519
|
});
|
|
8530
|
-
Alpine.directive("h-tab", (el, { original }) => {
|
|
8520
|
+
Alpine.directive("h-tab", (el, { original: original2 }) => {
|
|
8531
8521
|
el.classList.add(
|
|
8532
8522
|
"cursor-pointer",
|
|
8533
8523
|
"focus-visible:border-ring",
|
|
@@ -8574,8 +8564,8 @@ function tabs_default(Alpine) {
|
|
|
8574
8564
|
);
|
|
8575
8565
|
el.setAttribute("role", "tab");
|
|
8576
8566
|
el.setAttribute("data-slot", "tab");
|
|
8577
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
8578
|
-
if (!el.hasAttribute("aria-controls")) throw new Error(`${
|
|
8567
|
+
if (!el.hasAttribute("id")) throw new Error(`${original2}: Tabs must have an id`);
|
|
8568
|
+
if (!el.hasAttribute("aria-controls")) throw new Error(`${original2}: aria-controls must be set to the tab-content id.`);
|
|
8579
8569
|
});
|
|
8580
8570
|
Alpine.directive("h-tab-action", (el) => {
|
|
8581
8571
|
el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
|
|
@@ -8609,13 +8599,13 @@ function tabs_default(Alpine) {
|
|
|
8609
8599
|
el.setAttribute("role", "button");
|
|
8610
8600
|
el.setAttribute("data-slot", "tab-list-action");
|
|
8611
8601
|
});
|
|
8612
|
-
Alpine.directive("h-tabs-content", (el, { original }) => {
|
|
8602
|
+
Alpine.directive("h-tabs-content", (el, { original: original2 }) => {
|
|
8613
8603
|
el.classList.add("flex-1", "outline-none");
|
|
8614
8604
|
el.setAttribute("role", "tabpanel");
|
|
8615
8605
|
el.setAttribute("tabindex", "0");
|
|
8616
8606
|
el.setAttribute("data-slot", "tabs-content");
|
|
8617
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
8618
|
-
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${
|
|
8607
|
+
if (!el.hasAttribute("id")) throw new Error(`${original2}: Tab content must have an id`);
|
|
8608
|
+
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original2}: aria-labelledby must be set to the tab id.`);
|
|
8619
8609
|
});
|
|
8620
8610
|
}
|
|
8621
8611
|
|
|
@@ -9008,13 +8998,13 @@ function timepicker_default(Alpine) {
|
|
|
9008
8998
|
top.removeEventListener("click", el._h_timepicker.close);
|
|
9009
8999
|
});
|
|
9010
9000
|
});
|
|
9011
|
-
Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
9001
|
+
Alpine.directive("h-time-picker-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
9012
9002
|
if (el.tagName !== "INPUT") {
|
|
9013
|
-
throw new Error(`${
|
|
9003
|
+
throw new Error(`${original2} must be a readonly input of type "text"`);
|
|
9014
9004
|
}
|
|
9015
9005
|
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_timepicker"));
|
|
9016
9006
|
if (!timepicker) {
|
|
9017
|
-
throw new Error(`${
|
|
9007
|
+
throw new Error(`${original2} must be inside a time-picker element`);
|
|
9018
9008
|
}
|
|
9019
9009
|
timepicker._h_timepicker.focusInput = () => {
|
|
9020
9010
|
el.focus();
|
|
@@ -9663,7 +9653,7 @@ function tooltip_default(Alpine) {
|
|
|
9663
9653
|
el.removeEventListener("pointerleave", handler);
|
|
9664
9654
|
});
|
|
9665
9655
|
});
|
|
9666
|
-
Alpine.directive("h-tooltip", (el, { original }, { effect }) => {
|
|
9656
|
+
Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
|
|
9667
9657
|
const tooltip = (() => {
|
|
9668
9658
|
let sibling = el.previousElementSibling;
|
|
9669
9659
|
while (sibling && !sibling.hasOwnProperty("_tooltip")) {
|
|
@@ -9672,7 +9662,7 @@ function tooltip_default(Alpine) {
|
|
|
9672
9662
|
return sibling;
|
|
9673
9663
|
})();
|
|
9674
9664
|
if (!tooltip) {
|
|
9675
|
-
throw new Error(`${
|
|
9665
|
+
throw new Error(`${original2} must be placed after a tooltip trigger element`);
|
|
9676
9666
|
}
|
|
9677
9667
|
el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
|
|
9678
9668
|
el.setAttribute("data-slot", "tooltip");
|
|
@@ -9878,9 +9868,9 @@ function tree_default(Alpine) {
|
|
|
9878
9868
|
});
|
|
9879
9869
|
}
|
|
9880
9870
|
});
|
|
9881
|
-
Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
|
|
9871
|
+
Alpine.directive("h-tree-button", (el, { original: original2 }, { effect }) => {
|
|
9882
9872
|
const treeItem = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_tree_item"));
|
|
9883
|
-
if (!treeItem) throw new Error(`${
|
|
9873
|
+
if (!treeItem) throw new Error(`${original2} must be inside a tree item`);
|
|
9884
9874
|
el.classList.add(
|
|
9885
9875
|
"flex",
|
|
9886
9876
|
"w-full",
|
|
@@ -9943,7 +9933,7 @@ function tree_default(Alpine) {
|
|
|
9943
9933
|
}
|
|
9944
9934
|
|
|
9945
9935
|
// package.json
|
|
9946
|
-
var version = "1.
|
|
9936
|
+
var version = "1.5.1";
|
|
9947
9937
|
|
|
9948
9938
|
// src/utils/breakpoint-listener.js
|
|
9949
9939
|
function getBreakpointListener(handler, breakpoint = 768) {
|
|
@@ -10023,6 +10013,12 @@ var getColorScheme = () => {
|
|
|
10023
10013
|
}
|
|
10024
10014
|
return "light";
|
|
10025
10015
|
};
|
|
10016
|
+
var getSystemColorScheme = () => {
|
|
10017
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
10018
|
+
return "dark";
|
|
10019
|
+
}
|
|
10020
|
+
return "light";
|
|
10021
|
+
};
|
|
10026
10022
|
var addColorSchemeListener = (callback) => {
|
|
10027
10023
|
callbacks.push(callback);
|
|
10028
10024
|
};
|
|
@@ -10048,9 +10044,53 @@ function focus_default(Alpine) {
|
|
|
10048
10044
|
});
|
|
10049
10045
|
}
|
|
10050
10046
|
|
|
10047
|
+
// src/utils/include.js
|
|
10048
|
+
function include_default(Alpine) {
|
|
10049
|
+
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect }) => {
|
|
10050
|
+
const getUrl = evaluateLater(expression);
|
|
10051
|
+
function getHtml(url) {
|
|
10052
|
+
const parsed = new URL(url, window.location.origin);
|
|
10053
|
+
if (parsed.origin === window.location.origin) {
|
|
10054
|
+
fetch(url).then((response) => {
|
|
10055
|
+
if (response.status === 200) return response.text();
|
|
10056
|
+
throw response;
|
|
10057
|
+
}).then((content) => {
|
|
10058
|
+
if (modifiers.includes("js")) {
|
|
10059
|
+
const container = document.createElement("div");
|
|
10060
|
+
container.innerHTML = content;
|
|
10061
|
+
let staticScript = container.querySelector("script");
|
|
10062
|
+
const script = document.createElement("script");
|
|
10063
|
+
for (let a = 0; a < staticScript.attributes.length; a++) {
|
|
10064
|
+
script.setAttribute(staticScript.attributes[a].name, staticScript.attributes[a].value);
|
|
10065
|
+
}
|
|
10066
|
+
script.appendChild(document.createTextNode(staticScript.innerHTML));
|
|
10067
|
+
staticScript.remove();
|
|
10068
|
+
while (container.childNodes.length > 0) {
|
|
10069
|
+
el.appendChild(container.childNodes[0]);
|
|
10070
|
+
}
|
|
10071
|
+
el.appendChild(script);
|
|
10072
|
+
} else {
|
|
10073
|
+
el.innerHTML = content;
|
|
10074
|
+
}
|
|
10075
|
+
}).catch((response) => {
|
|
10076
|
+
console.error(response);
|
|
10077
|
+
});
|
|
10078
|
+
} else {
|
|
10079
|
+
throw new Error(`${original}: external requests not allowed`);
|
|
10080
|
+
}
|
|
10081
|
+
}
|
|
10082
|
+
effect(() => {
|
|
10083
|
+
getUrl((url) => {
|
|
10084
|
+
if (url) getHtml(url);
|
|
10085
|
+
else el.innerHTML = "";
|
|
10086
|
+
});
|
|
10087
|
+
});
|
|
10088
|
+
}).before("bind");
|
|
10089
|
+
}
|
|
10090
|
+
|
|
10051
10091
|
// src/utils/template.js
|
|
10052
10092
|
function template_default(Alpine) {
|
|
10053
|
-
Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
10093
|
+
Alpine.directive("h-template", (el, { original: original2, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
10054
10094
|
if (el.hasAttribute(Alpine2.prefixed("data"))) {
|
|
10055
10095
|
const template = evaluate2(expression);
|
|
10056
10096
|
const clone = template.content.cloneNode(true).firstElementChild;
|
|
@@ -10064,7 +10104,7 @@ function template_default(Alpine) {
|
|
|
10064
10104
|
clone.remove();
|
|
10065
10105
|
});
|
|
10066
10106
|
} else {
|
|
10067
|
-
console.error(`${
|
|
10107
|
+
console.error(`${original2}: ${Alpine2.prefixed("data")} directive is missing`);
|
|
10068
10108
|
}
|
|
10069
10109
|
});
|
|
10070
10110
|
}
|
|
@@ -10085,6 +10125,7 @@ var registerComponents = (registerPlugin) => {
|
|
|
10085
10125
|
registerPlugin(fieldset_default);
|
|
10086
10126
|
registerPlugin(focus_default);
|
|
10087
10127
|
registerPlugin(icon_default);
|
|
10128
|
+
registerPlugin(include_default);
|
|
10088
10129
|
registerPlugin(info_page_default);
|
|
10089
10130
|
registerPlugin(input_default);
|
|
10090
10131
|
registerPlugin(label_default);
|
|
@@ -10131,6 +10172,7 @@ export {
|
|
|
10131
10172
|
fieldset_default as Fieldset,
|
|
10132
10173
|
focus_default as Focus,
|
|
10133
10174
|
icon_default as Icon,
|
|
10175
|
+
include_default as Include,
|
|
10134
10176
|
info_page_default as InfoPage,
|
|
10135
10177
|
input_default as Input,
|
|
10136
10178
|
label_default as Label,
|
|
@@ -10164,6 +10206,7 @@ export {
|
|
|
10164
10206
|
module_default as default,
|
|
10165
10207
|
getBreakpointListener,
|
|
10166
10208
|
getColorScheme,
|
|
10209
|
+
getSystemColorScheme,
|
|
10167
10210
|
registerComponents,
|
|
10168
10211
|
removeColorSchemeListener,
|
|
10169
10212
|
setColorScheme,
|