@codbex/harmonia 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmonia.css +1 -1
- package/dist/harmonia.esm.js +317 -226
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +3 -3
- package/dist/harmonia.js +317 -226
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +3 -3
- package/package.json +1 -1
package/dist/harmonia.esm.js
CHANGED
|
@@ -2210,10 +2210,10 @@ function accordion_default(Alpine) {
|
|
|
2210
2210
|
}) : { single: false };
|
|
2211
2211
|
el.setAttribute("data-slot", "accordion");
|
|
2212
2212
|
});
|
|
2213
|
-
Alpine.directive("h-accordion-item", (el, { original
|
|
2213
|
+
Alpine.directive("h-accordion-item", (el, { original, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
|
|
2214
2214
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
2215
2215
|
if (!accordion) {
|
|
2216
|
-
throw new Error(`${
|
|
2216
|
+
throw new Error(`${original} must be inside an accordion`);
|
|
2217
2217
|
}
|
|
2218
2218
|
el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
|
|
2219
2219
|
el.setAttribute("data-slot", "accordion-item");
|
|
@@ -2241,14 +2241,14 @@ function accordion_default(Alpine) {
|
|
|
2241
2241
|
setAttributes();
|
|
2242
2242
|
effect(setAttributes);
|
|
2243
2243
|
});
|
|
2244
|
-
Alpine.directive("h-accordion-trigger", (el, { original
|
|
2244
|
+
Alpine.directive("h-accordion-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
2245
2245
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
2246
|
-
throw new Error(`${
|
|
2246
|
+
throw new Error(`${original} must be a header element`);
|
|
2247
2247
|
}
|
|
2248
2248
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
2249
2249
|
const accordionItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordionItem"));
|
|
2250
2250
|
if (!accordionItem || !accordion) {
|
|
2251
|
-
throw new Error(`${
|
|
2251
|
+
throw new Error(`${original} must have an accordion and accordion item parent elements`);
|
|
2252
2252
|
}
|
|
2253
2253
|
el.classList.add(
|
|
2254
2254
|
"flex",
|
|
@@ -2433,10 +2433,10 @@ function avatar_default(Alpine) {
|
|
|
2433
2433
|
el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
2434
2434
|
}
|
|
2435
2435
|
});
|
|
2436
|
-
Alpine.directive("h-avatar-image", (el, { original
|
|
2436
|
+
Alpine.directive("h-avatar-image", (el, { original }, { cleanup }) => {
|
|
2437
2437
|
const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
|
|
2438
2438
|
if (!avatar) {
|
|
2439
|
-
throw new Error(`${
|
|
2439
|
+
throw new Error(`${original} must be inside an avatar element`);
|
|
2440
2440
|
}
|
|
2441
2441
|
el.classList.add("aspect-square", "size-full");
|
|
2442
2442
|
el.setAttribute("data-slot", "avatar-image");
|
|
@@ -2467,10 +2467,10 @@ function avatar_default(Alpine) {
|
|
|
2467
2467
|
observer.disconnect();
|
|
2468
2468
|
});
|
|
2469
2469
|
});
|
|
2470
|
-
Alpine.directive("h-avatar-fallback", (el, { original
|
|
2470
|
+
Alpine.directive("h-avatar-fallback", (el, { original }, { effect }) => {
|
|
2471
2471
|
const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
|
|
2472
2472
|
if (!avatar) {
|
|
2473
|
-
throw new Error(`${
|
|
2473
|
+
throw new Error(`${original} must be inside an avatar element`);
|
|
2474
2474
|
}
|
|
2475
2475
|
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
|
|
2476
2476
|
el.setAttribute("data-slot", "avatar-fallback");
|
|
@@ -2679,7 +2679,7 @@ var getButtonSize = (size3, isAddon = false) => {
|
|
|
2679
2679
|
}
|
|
2680
2680
|
};
|
|
2681
2681
|
function button_default(Alpine) {
|
|
2682
|
-
Alpine.directive("h-button", (el, { original
|
|
2682
|
+
Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
|
|
2683
2683
|
setButtonClasses(el);
|
|
2684
2684
|
if (!el.hasAttribute("data-slot")) {
|
|
2685
2685
|
el.setAttribute("data-slot", "button");
|
|
@@ -2696,7 +2696,7 @@ function button_default(Alpine) {
|
|
|
2696
2696
|
el.classList.remove(...getButtonSize(lastSize, isAddon));
|
|
2697
2697
|
el.classList.add(...getButtonSize(size3, isAddon));
|
|
2698
2698
|
if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
2699
|
-
console.error(`${
|
|
2699
|
+
console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
|
|
2700
2700
|
}
|
|
2701
2701
|
lastSize = size3;
|
|
2702
2702
|
}
|
|
@@ -4245,7 +4245,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
4245
4245
|
|
|
4246
4246
|
// src/components/calendar.js
|
|
4247
4247
|
function calendar_default(Alpine) {
|
|
4248
|
-
Alpine.directive("h-calendar", (el, { original
|
|
4248
|
+
Alpine.directive("h-calendar", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
4249
4249
|
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
|
|
4250
4250
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
4251
4251
|
el.setAttribute("tabindex", "-1");
|
|
@@ -4289,7 +4289,7 @@ function calendar_default(Alpine) {
|
|
|
4289
4289
|
const onInputChange = () => {
|
|
4290
4290
|
const newValue = new Date(datepicker._h_datepicker.input.value);
|
|
4291
4291
|
if (isNaN(newValue)) {
|
|
4292
|
-
console.error(`${
|
|
4292
|
+
console.error(`${original}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
|
|
4293
4293
|
datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4294
4294
|
return;
|
|
4295
4295
|
} else if (selected.getTime() !== newValue.getTime()) {
|
|
@@ -4306,7 +4306,7 @@ function calendar_default(Alpine) {
|
|
|
4306
4306
|
if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
|
|
4307
4307
|
selected = new Date(el._x_model.get());
|
|
4308
4308
|
if (isNaN(selected)) {
|
|
4309
|
-
console.error(`${
|
|
4309
|
+
console.error(`${original}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4310
4310
|
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4311
4311
|
else el.setAttribute("data-invalid", "true");
|
|
4312
4312
|
} else if (datepicker) {
|
|
@@ -4815,10 +4815,10 @@ function collapsible_default(Alpine) {
|
|
|
4815
4815
|
});
|
|
4816
4816
|
}
|
|
4817
4817
|
});
|
|
4818
|
-
Alpine.directive("h-collapsible-trigger", (el, { original
|
|
4818
|
+
Alpine.directive("h-collapsible-trigger", (el, { original, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
4819
4819
|
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
4820
4820
|
if (!collapsible) {
|
|
4821
|
-
throw new Error(`${
|
|
4821
|
+
throw new Error(`${original} must be inside a collapsible element`);
|
|
4822
4822
|
}
|
|
4823
4823
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
|
|
4824
4824
|
if (modifiers.includes("chevron")) {
|
|
@@ -4837,10 +4837,10 @@ function collapsible_default(Alpine) {
|
|
|
4837
4837
|
el.removeEventListener("click", handler);
|
|
4838
4838
|
});
|
|
4839
4839
|
});
|
|
4840
|
-
Alpine.directive("h-collapsible-content", (el, { original
|
|
4840
|
+
Alpine.directive("h-collapsible-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
4841
4841
|
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
4842
4842
|
if (!collapsible) {
|
|
4843
|
-
throw new Error(`${
|
|
4843
|
+
throw new Error(`${original} must be inside an h-collapsible element`);
|
|
4844
4844
|
}
|
|
4845
4845
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
|
|
4846
4846
|
el.classList.add("data-[state=closed]:!hidden");
|
|
@@ -4871,7 +4871,7 @@ function sizeObserver(el) {
|
|
|
4871
4871
|
|
|
4872
4872
|
// src/components/datepicker.js
|
|
4873
4873
|
function datepicker_default(Alpine) {
|
|
4874
|
-
Alpine.directive("h-date-picker", (el, { original
|
|
4874
|
+
Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
4875
4875
|
const state = Alpine2.reactive({
|
|
4876
4876
|
expanded: false
|
|
4877
4877
|
});
|
|
@@ -4884,7 +4884,7 @@ function datepicker_default(Alpine) {
|
|
|
4884
4884
|
};
|
|
4885
4885
|
el._h_datepicker.input = el.querySelector("input");
|
|
4886
4886
|
if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
|
|
4887
|
-
throw new Error(`${
|
|
4887
|
+
throw new Error(`${original} must contain an input`);
|
|
4888
4888
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
4889
4889
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
4890
4890
|
} else {
|
|
@@ -4961,16 +4961,16 @@ function datepicker_default(Alpine) {
|
|
|
4961
4961
|
observer.disconnect();
|
|
4962
4962
|
});
|
|
4963
4963
|
});
|
|
4964
|
-
Alpine.directive("h-date-picker-trigger", (el, { original
|
|
4964
|
+
Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
4965
4965
|
if (el.tagName !== "BUTTON") {
|
|
4966
|
-
throw new Error(`${
|
|
4966
|
+
throw new Error(`${original} must be a button`);
|
|
4967
4967
|
}
|
|
4968
4968
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
4969
|
-
throw new Error(`${
|
|
4969
|
+
throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
|
|
4970
4970
|
}
|
|
4971
4971
|
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
|
|
4972
4972
|
if (!datepicker) {
|
|
4973
|
-
throw new Error(`${
|
|
4973
|
+
throw new Error(`${original} must be inside an date-picker element`);
|
|
4974
4974
|
}
|
|
4975
4975
|
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");
|
|
4976
4976
|
if (datepicker._h_datepicker.inTable) {
|
|
@@ -5250,13 +5250,13 @@ function fieldset_default(Alpine) {
|
|
|
5250
5250
|
|
|
5251
5251
|
// src/components/icon.js
|
|
5252
5252
|
function icon_default(Alpine) {
|
|
5253
|
-
Alpine.directive("h-icon", (el, { original
|
|
5253
|
+
Alpine.directive("h-icon", (el, { original, modifiers }) => {
|
|
5254
5254
|
if (el.tagName.toLowerCase() !== "svg") {
|
|
5255
|
-
throw new Error(`${
|
|
5255
|
+
throw new Error(`${original} works only on svg elements`);
|
|
5256
5256
|
} else if (!el.hasAttribute("role")) {
|
|
5257
|
-
throw new Error(`${
|
|
5257
|
+
throw new Error(`${original} must have a role`);
|
|
5258
5258
|
} else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5259
|
-
throw new Error(`${
|
|
5259
|
+
throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5260
5260
|
}
|
|
5261
5261
|
el.classList.add("fill-current");
|
|
5262
5262
|
el.setAttribute("data-slot", "icon");
|
|
@@ -5473,7 +5473,7 @@ function input_default(Alpine) {
|
|
|
5473
5473
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
5474
5474
|
el.setAttribute("data-slot", "label");
|
|
5475
5475
|
});
|
|
5476
|
-
Alpine.directive("h-input-number", (el, { original
|
|
5476
|
+
Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
|
|
5477
5477
|
el.classList.add(
|
|
5478
5478
|
"overflow-hidden",
|
|
5479
5479
|
"group/input-number",
|
|
@@ -5506,7 +5506,7 @@ function input_default(Alpine) {
|
|
|
5506
5506
|
el.setAttribute("data-slot", "input-number");
|
|
5507
5507
|
const input = el.querySelector("input");
|
|
5508
5508
|
if (!input || input.getAttribute("type") !== "number") {
|
|
5509
|
-
throw new Error(`${
|
|
5509
|
+
throw new Error(`${original} must contain an input of type 'number'`);
|
|
5510
5510
|
}
|
|
5511
5511
|
if (!input.hasAttribute("type")) input.setAttribute("type", "number");
|
|
5512
5512
|
if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
|
|
@@ -5752,13 +5752,13 @@ function list_default(Alpine) {
|
|
|
5752
5752
|
el.setAttribute("data-slot", "list");
|
|
5753
5753
|
el.setAttribute("role", "group");
|
|
5754
5754
|
});
|
|
5755
|
-
Alpine.directive("h-list-header", (el, { original
|
|
5755
|
+
Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
|
|
5756
5756
|
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
5757
5757
|
el.setAttribute("role", "presentation");
|
|
5758
5758
|
el.setAttribute("data-slot", "list-header");
|
|
5759
5759
|
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
5760
5760
|
if (!list) {
|
|
5761
|
-
throw new Error(`${
|
|
5761
|
+
throw new Error(`${original} must be placed inside a list element`);
|
|
5762
5762
|
}
|
|
5763
5763
|
if (!el.hasAttribute("id")) {
|
|
5764
5764
|
const id = `lbh${v4_default()}`;
|
|
@@ -5810,9 +5810,9 @@ function menu_default(Alpine) {
|
|
|
5810
5810
|
};
|
|
5811
5811
|
el.setAttribute("data-state", "closed");
|
|
5812
5812
|
});
|
|
5813
|
-
Alpine.directive("h-menu", (el, { original
|
|
5813
|
+
Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
5814
5814
|
if (el.tagName !== "UL") {
|
|
5815
|
-
throw new Error(`${
|
|
5815
|
+
throw new Error(`${original} must be an ul element`);
|
|
5816
5816
|
}
|
|
5817
5817
|
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");
|
|
5818
5818
|
el.setAttribute("role", "menu");
|
|
@@ -5820,7 +5820,7 @@ function menu_default(Alpine) {
|
|
|
5820
5820
|
el.setAttribute("tabindex", "-1");
|
|
5821
5821
|
el.setAttribute("data-slot", "menu");
|
|
5822
5822
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5823
|
-
throw new Error(`${
|
|
5823
|
+
throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5824
5824
|
}
|
|
5825
5825
|
const isSubmenu = modifiers.includes("sub");
|
|
5826
5826
|
const menuTrigger = (() => {
|
|
@@ -5832,7 +5832,7 @@ function menu_default(Alpine) {
|
|
|
5832
5832
|
return sibling;
|
|
5833
5833
|
})();
|
|
5834
5834
|
if (!isSubmenu && !menuTrigger) {
|
|
5835
|
-
throw new Error(`${
|
|
5835
|
+
throw new Error(`${original} menu must be placed after a menu trigger element`);
|
|
5836
5836
|
}
|
|
5837
5837
|
let menuSubItem;
|
|
5838
5838
|
if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
@@ -6051,9 +6051,9 @@ function menu_default(Alpine) {
|
|
|
6051
6051
|
el.removeEventListener("keydown", onKeyDown);
|
|
6052
6052
|
});
|
|
6053
6053
|
});
|
|
6054
|
-
Alpine.directive("h-menu-item", (el, { original
|
|
6054
|
+
Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6055
6055
|
if (el.tagName !== "LI") {
|
|
6056
|
-
throw new Error(`${
|
|
6056
|
+
throw new Error(`${original} must be a li element`);
|
|
6057
6057
|
}
|
|
6058
6058
|
el.classList.add(
|
|
6059
6059
|
"focus:bg-secondary-hover",
|
|
@@ -6107,7 +6107,7 @@ function menu_default(Alpine) {
|
|
|
6107
6107
|
el.removeEventListener("mouseleave", focusOut);
|
|
6108
6108
|
});
|
|
6109
6109
|
});
|
|
6110
|
-
Alpine.directive("h-menu-sub", (el, { original
|
|
6110
|
+
Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6111
6111
|
el.classList.add(
|
|
6112
6112
|
"focus:bg-secondary-hover",
|
|
6113
6113
|
"hover:bg-secondary-hover",
|
|
@@ -6139,7 +6139,7 @@ function menu_default(Alpine) {
|
|
|
6139
6139
|
const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
|
|
6140
6140
|
el.appendChild(chevronRight);
|
|
6141
6141
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6142
|
-
if (!parentMenu) throw new Error(`${
|
|
6142
|
+
if (!parentMenu) throw new Error(`${original} must have a parent`);
|
|
6143
6143
|
el._menu_sub = {
|
|
6144
6144
|
open: void 0,
|
|
6145
6145
|
close: void 0,
|
|
@@ -6233,9 +6233,9 @@ function menu_default(Alpine) {
|
|
|
6233
6233
|
el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
|
|
6234
6234
|
el.setAttribute("data-slot", "menu-label");
|
|
6235
6235
|
});
|
|
6236
|
-
Alpine.directive("h-menu-checkbox-item", (el, { original
|
|
6236
|
+
Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6237
6237
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6238
|
-
throw new Error(`${
|
|
6238
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6239
6239
|
}
|
|
6240
6240
|
el.classList.add(
|
|
6241
6241
|
"focus:bg-secondary-hover",
|
|
@@ -6301,9 +6301,9 @@ function menu_default(Alpine) {
|
|
|
6301
6301
|
el.removeEventListener("mouseleave", focusOut);
|
|
6302
6302
|
});
|
|
6303
6303
|
});
|
|
6304
|
-
Alpine.directive("h-menu-radio-item", (el, { original
|
|
6304
|
+
Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
6305
6305
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6306
|
-
throw new Error(`${
|
|
6306
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6307
6307
|
}
|
|
6308
6308
|
el.classList.add(
|
|
6309
6309
|
"focus:bg-secondary-hover",
|
|
@@ -6507,6 +6507,7 @@ function popover_default(Alpine) {
|
|
|
6507
6507
|
const close = () => {
|
|
6508
6508
|
el._popover.expanded = false;
|
|
6509
6509
|
el.addEventListener("click", handler);
|
|
6510
|
+
setAttributes();
|
|
6510
6511
|
};
|
|
6511
6512
|
const handler = () => {
|
|
6512
6513
|
el._popover.expanded = !el._popover.expanded;
|
|
@@ -6531,7 +6532,7 @@ function popover_default(Alpine) {
|
|
|
6531
6532
|
});
|
|
6532
6533
|
}
|
|
6533
6534
|
});
|
|
6534
|
-
Alpine.directive("h-popover", (el, { original
|
|
6535
|
+
Alpine.directive("h-popover", (el, { original, modifiers }, { effect }) => {
|
|
6535
6536
|
const popover = (() => {
|
|
6536
6537
|
let sibling = el.previousElementSibling;
|
|
6537
6538
|
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
@@ -6540,9 +6541,9 @@ function popover_default(Alpine) {
|
|
|
6540
6541
|
return sibling;
|
|
6541
6542
|
})();
|
|
6542
6543
|
if (!popover) {
|
|
6543
|
-
throw new Error(`${
|
|
6544
|
+
throw new Error(`${original} must be placed after a popover element`);
|
|
6544
6545
|
}
|
|
6545
|
-
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-
|
|
6546
|
+
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");
|
|
6546
6547
|
el.setAttribute("data-slot", "popover");
|
|
6547
6548
|
el.setAttribute("role", "dialog");
|
|
6548
6549
|
el.setAttribute("tabindex", "-1");
|
|
@@ -6695,7 +6696,8 @@ var FilterType = Object.freeze({
|
|
|
6695
6696
|
function select_default(Alpine) {
|
|
6696
6697
|
Alpine.directive("h-select", (el, { modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
6697
6698
|
el._h_select = Alpine2.reactive({
|
|
6698
|
-
|
|
6699
|
+
fieldLabelId: void 0,
|
|
6700
|
+
trigger: void 0,
|
|
6699
6701
|
controls: `hsc${v4_default()}`,
|
|
6700
6702
|
expanded: false,
|
|
6701
6703
|
multiple: false,
|
|
@@ -6742,13 +6744,20 @@ function select_default(Alpine) {
|
|
|
6742
6744
|
});
|
|
6743
6745
|
}
|
|
6744
6746
|
});
|
|
6745
|
-
Alpine.directive("h-select-input", (el, { original
|
|
6747
|
+
Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
6746
6748
|
if (el.tagName !== "INPUT") {
|
|
6747
|
-
throw new Error(`${
|
|
6749
|
+
throw new Error(`${original} must be an input of type "text"`);
|
|
6748
6750
|
}
|
|
6749
6751
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
6752
|
+
const label = (() => {
|
|
6753
|
+
const field = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "field");
|
|
6754
|
+
if (field) {
|
|
6755
|
+
return field.querySelector("[data-slot=field-label]");
|
|
6756
|
+
}
|
|
6757
|
+
return;
|
|
6758
|
+
})();
|
|
6750
6759
|
if (!select) {
|
|
6751
|
-
throw new Error(`${
|
|
6760
|
+
throw new Error(`${original} must be inside a select element`);
|
|
6752
6761
|
} else if (el.hasOwnProperty("_x_model")) {
|
|
6753
6762
|
select._h_select.multiple = Array.isArray(el._x_model.get());
|
|
6754
6763
|
select._h_model.set = (value) => {
|
|
@@ -6786,6 +6795,19 @@ function select_default(Alpine) {
|
|
|
6786
6795
|
fakeTrigger.setAttribute("data-slot", "select-value");
|
|
6787
6796
|
fakeTrigger.setAttribute("tabindex", "0");
|
|
6788
6797
|
fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[data-state=open]>svg]:rotate-180");
|
|
6798
|
+
select._h_select.trigger = fakeTrigger;
|
|
6799
|
+
let labelObserver;
|
|
6800
|
+
if (label) {
|
|
6801
|
+
if (!label.hasAttribute("id")) {
|
|
6802
|
+
label.setAttribute("id", `hsil${v4_default()}`);
|
|
6803
|
+
}
|
|
6804
|
+
select._h_select.fieldLabelId = label.getAttribute("id");
|
|
6805
|
+
fakeTrigger.setAttribute("aria-labelledby", label.getAttribute("id"));
|
|
6806
|
+
labelObserver = new MutationObserver(() => {
|
|
6807
|
+
select._h_select.fieldLabelId = label.getAttribute("id");
|
|
6808
|
+
});
|
|
6809
|
+
labelObserver.observe(label, { attributes: true, attributeFilter: ["id"] });
|
|
6810
|
+
}
|
|
6789
6811
|
function getPlaceholder() {
|
|
6790
6812
|
if (!el.value) {
|
|
6791
6813
|
const value = el.getAttribute("placeholder");
|
|
@@ -6798,17 +6820,10 @@ function select_default(Alpine) {
|
|
|
6798
6820
|
}
|
|
6799
6821
|
}
|
|
6800
6822
|
getPlaceholder();
|
|
6801
|
-
const observer = new MutationObserver((
|
|
6802
|
-
|
|
6803
|
-
if (mutation.attributeName === "data-id") {
|
|
6804
|
-
select._h_select.id = el.getAttribute("data-id");
|
|
6805
|
-
fakeTrigger.setAttribute("id", select._h_select.id);
|
|
6806
|
-
} else if (mutation.attributeName === "placeholder" && !select._h_select.label.length) {
|
|
6807
|
-
getPlaceholder();
|
|
6808
|
-
}
|
|
6809
|
-
});
|
|
6823
|
+
const observer = new MutationObserver(() => {
|
|
6824
|
+
getPlaceholder();
|
|
6810
6825
|
});
|
|
6811
|
-
observer.observe(el, { attributes: true, attributeFilter: ["
|
|
6826
|
+
observer.observe(el, { attributes: true, attributeFilter: ["placeholder"] });
|
|
6812
6827
|
effect(() => {
|
|
6813
6828
|
if (select._h_select.label.length === 1) {
|
|
6814
6829
|
displayValue.innerText = select._h_select.label[0];
|
|
@@ -6821,8 +6836,6 @@ function select_default(Alpine) {
|
|
|
6821
6836
|
}
|
|
6822
6837
|
});
|
|
6823
6838
|
fakeTrigger.setAttribute("data-slot", "select-input");
|
|
6824
|
-
select._h_select.id = el.hasAttribute("data-id") ? el.getAttribute("data-id") : `hs${v4_default()}`;
|
|
6825
|
-
fakeTrigger.setAttribute("id", select._h_select.id);
|
|
6826
6839
|
fakeTrigger.setAttribute("aria-controls", select._h_select.controls);
|
|
6827
6840
|
fakeTrigger.setAttribute("aria-haspopup", "listbox");
|
|
6828
6841
|
fakeTrigger.setAttribute("aria-autocomplete", "none");
|
|
@@ -6984,9 +6997,9 @@ function select_default(Alpine) {
|
|
|
6984
6997
|
const onInputChange = () => {
|
|
6985
6998
|
select._h_select.label.length = 0;
|
|
6986
6999
|
for (let i = 0; i < select._h_select.listeners.length; i++) {
|
|
6987
|
-
const
|
|
6988
|
-
if (
|
|
6989
|
-
select._h_select.label.push(
|
|
7000
|
+
const label2 = select._h_select.listeners[i](select._h_model.get());
|
|
7001
|
+
if (label2) {
|
|
7002
|
+
select._h_select.label.push(label2);
|
|
6990
7003
|
}
|
|
6991
7004
|
}
|
|
6992
7005
|
};
|
|
@@ -6999,27 +7012,28 @@ function select_default(Alpine) {
|
|
|
6999
7012
|
top.removeEventListener("click", close);
|
|
7000
7013
|
el.removeEventListener("change", onInputChange);
|
|
7001
7014
|
observer.disconnect();
|
|
7015
|
+
if (labelObserver) {
|
|
7016
|
+
labelObserver.disconnect();
|
|
7017
|
+
}
|
|
7002
7018
|
});
|
|
7003
7019
|
});
|
|
7004
|
-
Alpine.directive("h-select-content", (el, { original
|
|
7020
|
+
Alpine.directive("h-select-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
7005
7021
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7006
7022
|
if (!select) {
|
|
7007
|
-
throw new Error(`${
|
|
7023
|
+
throw new Error(`${original} must be inside a select element`);
|
|
7008
7024
|
}
|
|
7009
7025
|
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");
|
|
7010
7026
|
el.setAttribute("data-slot", "select-content");
|
|
7011
7027
|
el.setAttribute("role", "listbox");
|
|
7012
|
-
el.setAttribute("role", "presentation");
|
|
7013
7028
|
el.setAttribute("id", select._h_select.controls);
|
|
7014
7029
|
el.setAttribute("tabindex", "-1");
|
|
7015
7030
|
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
throw new Error(`${original2}: trigger not found`);
|
|
7031
|
+
if (!select._h_select.trigger) {
|
|
7032
|
+
throw new Error(`${original}: trigger not found`);
|
|
7019
7033
|
}
|
|
7020
7034
|
let autoUpdateCleanup;
|
|
7021
7035
|
function updatePosition() {
|
|
7022
|
-
computePosition2(
|
|
7036
|
+
computePosition2(select._h_select.trigger, el, {
|
|
7023
7037
|
placement: el.getAttribute("data-align") || "bottom-start",
|
|
7024
7038
|
middleware: [
|
|
7025
7039
|
offset2(4),
|
|
@@ -7042,12 +7056,12 @@ function select_default(Alpine) {
|
|
|
7042
7056
|
});
|
|
7043
7057
|
}
|
|
7044
7058
|
effect(() => {
|
|
7045
|
-
el.setAttribute("aria-labelledby", select._h_select.
|
|
7059
|
+
el.setAttribute("aria-labelledby", select._h_select.fieldLabelId);
|
|
7046
7060
|
});
|
|
7047
7061
|
effect(() => {
|
|
7048
7062
|
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7049
7063
|
if (select._h_select.expanded) {
|
|
7050
|
-
autoUpdateCleanup = autoUpdate(
|
|
7064
|
+
autoUpdateCleanup = autoUpdate(select._h_select.trigger, el, updatePosition);
|
|
7051
7065
|
} else {
|
|
7052
7066
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
7053
7067
|
Object.assign(el.style, {
|
|
@@ -7057,10 +7071,10 @@ function select_default(Alpine) {
|
|
|
7057
7071
|
}
|
|
7058
7072
|
});
|
|
7059
7073
|
});
|
|
7060
|
-
Alpine.directive("h-select-search", (el, { original
|
|
7074
|
+
Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7061
7075
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7062
7076
|
if (!select) {
|
|
7063
|
-
throw new Error(`${
|
|
7077
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
7064
7078
|
} else {
|
|
7065
7079
|
select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
|
|
7066
7080
|
}
|
|
@@ -7132,10 +7146,10 @@ function select_default(Alpine) {
|
|
|
7132
7146
|
selectGroup._h_selectGroup.labelledby = id;
|
|
7133
7147
|
}
|
|
7134
7148
|
});
|
|
7135
|
-
Alpine.directive("h-select-option", (el, { original
|
|
7149
|
+
Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
|
|
7136
7150
|
const select = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7137
7151
|
if (!select) {
|
|
7138
|
-
throw new Error(`${
|
|
7152
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
7139
7153
|
}
|
|
7140
7154
|
el.classList.add(
|
|
7141
7155
|
"focus:bg-primary",
|
|
@@ -7366,13 +7380,35 @@ function sidebar_default(Alpine) {
|
|
|
7366
7380
|
el.classList.add("vbox", "min-h-0", "flex-1", "gap-2", "overflow-auto", "group-data-[collapsed=true]/sidebar:overflow-hidden");
|
|
7367
7381
|
el.setAttribute("data-slot", "sidebar-content");
|
|
7368
7382
|
});
|
|
7369
|
-
Alpine.directive("h-sidebar-group", (el) => {
|
|
7383
|
+
Alpine.directive("h-sidebar-group", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
7370
7384
|
el.classList.add("relative", "vbox", "w-full", "min-w-0", "p-2");
|
|
7371
7385
|
el.setAttribute("data-slot", "sidebar-group");
|
|
7386
|
+
el._h_sidebar_group = {
|
|
7387
|
+
collapsable: modifiers.includes("collapsed"),
|
|
7388
|
+
controlId: void 0,
|
|
7389
|
+
controls: void 0,
|
|
7390
|
+
state: Alpine2.reactive({
|
|
7391
|
+
collapsed: evaluate2(expression || "false")
|
|
7392
|
+
})
|
|
7393
|
+
};
|
|
7394
|
+
if (expression) {
|
|
7395
|
+
el._h_sidebar_group.state = Alpine2.reactive({
|
|
7396
|
+
collapsed: evaluate2(expression || "false")
|
|
7397
|
+
});
|
|
7398
|
+
const getCollapsed = evaluateLater(expression);
|
|
7399
|
+
effect(() => {
|
|
7400
|
+
getCollapsed((collapsed) => {
|
|
7401
|
+
el._h_sidebar_group.state.collapsed = collapsed;
|
|
7402
|
+
});
|
|
7403
|
+
});
|
|
7404
|
+
}
|
|
7372
7405
|
});
|
|
7373
|
-
Alpine.directive("h-sidebar-group-label", (el, {
|
|
7406
|
+
Alpine.directive("h-sidebar-group-label", (el, { original }, { cleanup }) => {
|
|
7407
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
|
|
7408
|
+
if (!group) {
|
|
7409
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
7410
|
+
}
|
|
7374
7411
|
el.classList.add(
|
|
7375
|
-
"text-sidebar-foreground/70",
|
|
7376
7412
|
"ring-sidebar-ring",
|
|
7377
7413
|
"flex",
|
|
7378
7414
|
"h-8",
|
|
@@ -7380,7 +7416,6 @@ function sidebar_default(Alpine) {
|
|
|
7380
7416
|
"items-center",
|
|
7381
7417
|
"rounded-md",
|
|
7382
7418
|
"px-2",
|
|
7383
|
-
"text-xs",
|
|
7384
7419
|
"font-medium",
|
|
7385
7420
|
"outline-hidden",
|
|
7386
7421
|
"transition-[margin,opacity]",
|
|
@@ -7391,8 +7426,39 @@ function sidebar_default(Alpine) {
|
|
|
7391
7426
|
"[&>svg]:shrink-0",
|
|
7392
7427
|
"group-data-[collapsed=true]/sidebar:!hidden"
|
|
7393
7428
|
);
|
|
7394
|
-
if (modifiers.includes("action")) el.classList.add("hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
7395
7429
|
el.setAttribute("data-slot", "sidebar-group-label");
|
|
7430
|
+
if (group._h_sidebar_group.collapsable) {
|
|
7431
|
+
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
7432
|
+
if (el.hasAttribute("id")) {
|
|
7433
|
+
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
7434
|
+
} else {
|
|
7435
|
+
group._h_sidebar_group.controlId = `sgl${v4_default()}`;
|
|
7436
|
+
el.setAttribute("id", group._h_sidebar_group.controlId);
|
|
7437
|
+
}
|
|
7438
|
+
group._h_sidebar_group.controls = `sgc${v4_default()}`;
|
|
7439
|
+
el.setAttribute("aria-controls", group._h_sidebar_group.controls);
|
|
7440
|
+
el.setAttribute("aria-expanded", !group._h_sidebar_group.state.collapsed);
|
|
7441
|
+
const handler = () => {
|
|
7442
|
+
group._h_sidebar_group.state.collapsed = !group._h_sidebar_group.state.collapsed;
|
|
7443
|
+
el.setAttribute("aria-expanded", !group._h_sidebar_group.state.collapsed);
|
|
7444
|
+
};
|
|
7445
|
+
el.appendChild(
|
|
7446
|
+
createSvg({
|
|
7447
|
+
icon: ChevronRight,
|
|
7448
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
7449
|
+
attrs: {
|
|
7450
|
+
"aria-hidden": true,
|
|
7451
|
+
role: "presentation"
|
|
7452
|
+
}
|
|
7453
|
+
})
|
|
7454
|
+
);
|
|
7455
|
+
el.addEventListener("click", handler);
|
|
7456
|
+
cleanup(() => {
|
|
7457
|
+
el.removeEventListener("click", handler);
|
|
7458
|
+
});
|
|
7459
|
+
} else {
|
|
7460
|
+
el.classList.add("text-sidebar-foreground/70", "text-xs");
|
|
7461
|
+
}
|
|
7396
7462
|
});
|
|
7397
7463
|
Alpine.directive("h-sidebar-group-action", (el) => {
|
|
7398
7464
|
el.classList.add(
|
|
@@ -7427,41 +7493,85 @@ function sidebar_default(Alpine) {
|
|
|
7427
7493
|
}
|
|
7428
7494
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
7429
7495
|
});
|
|
7430
|
-
Alpine.directive("h-sidebar-group-content", (el) => {
|
|
7431
|
-
el.
|
|
7496
|
+
Alpine.directive("h-sidebar-group-content", (el, { original }, { effect }) => {
|
|
7497
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_group"));
|
|
7498
|
+
if (!group) {
|
|
7499
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
7500
|
+
}
|
|
7501
|
+
el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
|
|
7432
7502
|
el.setAttribute("data-slot", "sidebar-group-content");
|
|
7503
|
+
if (group._h_sidebar_group.collapsable) {
|
|
7504
|
+
el.setAttribute("id", group._h_sidebar_group.controls);
|
|
7505
|
+
el.setAttribute("aria-labelledby", group._h_sidebar_group.controlId);
|
|
7506
|
+
el.setAttribute("data-collapsed", group._h_sidebar_group.state.collapsed);
|
|
7507
|
+
effect(() => {
|
|
7508
|
+
el.setAttribute("data-collapsed", group._h_sidebar_group.state.collapsed);
|
|
7509
|
+
});
|
|
7510
|
+
}
|
|
7433
7511
|
});
|
|
7434
|
-
Alpine.directive("h-sidebar-menu", (el) => {
|
|
7512
|
+
Alpine.directive("h-sidebar-menu", (el, { original }) => {
|
|
7513
|
+
if (el.tagName !== "UL") {
|
|
7514
|
+
throw new Error(`${original} must be an ul element`);
|
|
7515
|
+
}
|
|
7435
7516
|
el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
|
|
7436
7517
|
el.setAttribute("data-slot", "sidebar-menu");
|
|
7437
7518
|
});
|
|
7438
|
-
Alpine.directive("h-sidebar-menu-item", (el, { original:
|
|
7439
|
-
if (el.tagName !== "
|
|
7440
|
-
throw new Error(`${
|
|
7519
|
+
Alpine.directive("h-sidebar-menu-item", (el, { original, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
7520
|
+
if (el.tagName !== "LI") {
|
|
7521
|
+
throw new Error(`${original} must be a li element`);
|
|
7522
|
+
}
|
|
7523
|
+
el._h_sidebar_menu_item = {
|
|
7524
|
+
isSub: false,
|
|
7525
|
+
collapsable: modifiers.includes("collapsed"),
|
|
7526
|
+
controlId: void 0,
|
|
7527
|
+
controls: void 0,
|
|
7528
|
+
state: Alpine2.reactive({
|
|
7529
|
+
collapsed: evaluate2(expression || "false")
|
|
7530
|
+
})
|
|
7531
|
+
};
|
|
7532
|
+
let parent = el.parentElement;
|
|
7533
|
+
while (parent) {
|
|
7534
|
+
if (parent.getAttribute("data-slot") === "sidebar-menu-sub") {
|
|
7535
|
+
el._h_sidebar_menu_item.isSub = true;
|
|
7536
|
+
break;
|
|
7537
|
+
} else if (parent.getAttribute("data-slot") === "sidebar") {
|
|
7538
|
+
break;
|
|
7539
|
+
}
|
|
7540
|
+
parent = parent.parentElement;
|
|
7541
|
+
}
|
|
7542
|
+
if (!el._h_sidebar_menu_item.isSub) {
|
|
7543
|
+
el.classList.add("group/menu-item", "relative");
|
|
7544
|
+
} else {
|
|
7545
|
+
el.classList.add("relative");
|
|
7441
7546
|
}
|
|
7442
|
-
el.classList.add("group/menu-item", "relative");
|
|
7443
|
-
el.setAttribute("type", "button");
|
|
7444
7547
|
el.setAttribute("data-slot", "sidebar-menu-item");
|
|
7548
|
+
if (expression) {
|
|
7549
|
+
const getCollapsed = evaluateLater(expression);
|
|
7550
|
+
effect(() => {
|
|
7551
|
+
getCollapsed((collapsed) => {
|
|
7552
|
+
el._h_sidebar_menu_item.state.collapsed = collapsed;
|
|
7553
|
+
});
|
|
7554
|
+
});
|
|
7555
|
+
}
|
|
7445
7556
|
});
|
|
7446
|
-
Alpine.directive("h-sidebar-menu-button", (el) => {
|
|
7447
|
-
if (el.tagName !== "BUTTON") {
|
|
7448
|
-
throw new Error(`${original} must be a button`);
|
|
7557
|
+
Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7558
|
+
if (el.tagName !== "BUTTON" && el.tagName !== "A") {
|
|
7559
|
+
throw new Error(`${original} must be a button or a link`);
|
|
7560
|
+
} else if (el.tagName === "BUTTON") {
|
|
7561
|
+
el.setAttribute("type", "button");
|
|
7449
7562
|
}
|
|
7563
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_menu_item"));
|
|
7450
7564
|
el.classList.add(
|
|
7451
|
-
"peer/menu-button",
|
|
7452
7565
|
"flex",
|
|
7453
7566
|
"w-full",
|
|
7454
7567
|
"items-center",
|
|
7455
7568
|
"gap-2",
|
|
7456
7569
|
"overflow-hidden",
|
|
7457
7570
|
"rounded-md",
|
|
7458
|
-
"p-2",
|
|
7459
|
-
"text-left",
|
|
7460
|
-
"text-sm",
|
|
7461
7571
|
"align-middle",
|
|
7572
|
+
"[&>span]:align-middle",
|
|
7462
7573
|
"outline-hidden",
|
|
7463
7574
|
"ring-sidebar-ring",
|
|
7464
|
-
"transition-[width,height,padding]",
|
|
7465
7575
|
"hover:bg-sidebar-secondary",
|
|
7466
7576
|
"hover:text-sidebar-secondary-foreground",
|
|
7467
7577
|
"focus-visible:ring-2",
|
|
@@ -7469,25 +7579,14 @@ function sidebar_default(Alpine) {
|
|
|
7469
7579
|
"active:text-sidebar-primary-foreground",
|
|
7470
7580
|
"disabled:pointer-events-none",
|
|
7471
7581
|
"disabled:opacity-50",
|
|
7472
|
-
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
7473
7582
|
"aria-disabled:pointer-events-none",
|
|
7474
7583
|
"aria-disabled:opacity-50",
|
|
7475
7584
|
"data-[active=true]:bg-sidebar-primary",
|
|
7476
|
-
"data-[active=true]:font-medium",
|
|
7477
7585
|
"data-[active=true]:text-sidebar-primary-foreground",
|
|
7478
|
-
"data-[state=open]:hover:bg-sidebar-secondary",
|
|
7479
|
-
"data-[state=open]:hover:text-sidebar-secondary-foreground",
|
|
7480
|
-
"group-data-[collapsed=true]/sidebar:!size-8",
|
|
7481
|
-
"group-data-[collapsed=true]/sidebar:!p-2",
|
|
7482
|
-
"group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden",
|
|
7483
7586
|
"[&>span]:truncate",
|
|
7484
|
-
"[&>span]:align-middle",
|
|
7485
7587
|
"[&>svg]:size-4",
|
|
7486
|
-
"[&>svg]:shrink-0"
|
|
7487
|
-
"[&>svg:not(:first-child):last-child]:ml-auto"
|
|
7588
|
+
"[&>svg]:shrink-0"
|
|
7488
7589
|
);
|
|
7489
|
-
el.setAttribute("type", "button");
|
|
7490
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "sidebar-menu-button");
|
|
7491
7590
|
const sizes = {
|
|
7492
7591
|
default: ["h-8", "text-sm"],
|
|
7493
7592
|
sm: ["h-7", "text-xs"],
|
|
@@ -7498,22 +7597,77 @@ function sidebar_default(Alpine) {
|
|
|
7498
7597
|
el.classList.add(...sizes[size3]);
|
|
7499
7598
|
}
|
|
7500
7599
|
}
|
|
7501
|
-
|
|
7502
|
-
|
|
7600
|
+
setSize2(el.getAttribute("data-size") || "default");
|
|
7601
|
+
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "sidebar-menu-button");
|
|
7602
|
+
if (menuItem && menuItem._h_sidebar_menu_item.isSub) {
|
|
7603
|
+
el.classList.add("text-sidebar-foreground", "h-7", "min-w-0", "-translate-x-px", "px-2", "[&>svg:not(:first-child):last-child]:ml-auto", "group-data-[collapsed=true]/sidebar:hidden");
|
|
7604
|
+
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "sidebar-menu-sub-button");
|
|
7605
|
+
} else {
|
|
7606
|
+
el.classList.add(
|
|
7607
|
+
"peer/menu-button",
|
|
7608
|
+
"p-2",
|
|
7609
|
+
"text-left",
|
|
7610
|
+
"text-sm",
|
|
7611
|
+
"duration-200",
|
|
7612
|
+
"transition-[width,height,padding]",
|
|
7613
|
+
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
7614
|
+
"data-[active=true]:font-medium",
|
|
7615
|
+
"data-[state=open]:hover:bg-sidebar-secondary",
|
|
7616
|
+
"data-[state=open]:hover:text-sidebar-secondary-foreground",
|
|
7617
|
+
"group-data-[collapsed=true]/sidebar:!size-8",
|
|
7618
|
+
"group-data-[collapsed=true]/sidebar:!p-2",
|
|
7619
|
+
"group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden"
|
|
7620
|
+
);
|
|
7621
|
+
}
|
|
7622
|
+
if (menuItem && menuItem._h_sidebar_menu_item.collapsable) {
|
|
7623
|
+
if (el.hasAttribute("id")) {
|
|
7624
|
+
menuItem._h_sidebar_menu_item.controlId = el.getAttribute("id");
|
|
7625
|
+
} else {
|
|
7626
|
+
menuItem._h_sidebar_menu_item.controlId = `sgl${v4_default()}`;
|
|
7627
|
+
el.setAttribute("id", menuItem._h_sidebar_menu_item.controlId);
|
|
7628
|
+
}
|
|
7629
|
+
menuItem._h_sidebar_menu_item.controls = `sgc${v4_default()}`;
|
|
7630
|
+
el.setAttribute("aria-controls", menuItem._h_sidebar_menu_item.controls);
|
|
7631
|
+
el.setAttribute("aria-expanded", !menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7632
|
+
const handler = () => {
|
|
7633
|
+
menuItem._h_sidebar_menu_item.state.collapsed = !menuItem._h_sidebar_menu_item.state.collapsed;
|
|
7634
|
+
el.setAttribute("aria-expanded", !menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7635
|
+
};
|
|
7636
|
+
el.appendChild(
|
|
7637
|
+
createSvg({
|
|
7638
|
+
icon: ChevronRight,
|
|
7639
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
7640
|
+
attrs: {
|
|
7641
|
+
"aria-hidden": true,
|
|
7642
|
+
role: "presentation"
|
|
7643
|
+
}
|
|
7644
|
+
})
|
|
7645
|
+
);
|
|
7646
|
+
el.addEventListener("click", handler);
|
|
7647
|
+
cleanup(() => {
|
|
7648
|
+
el.removeEventListener("click", handler);
|
|
7649
|
+
});
|
|
7650
|
+
} else {
|
|
7651
|
+
el.classList.add("[&>svg:not(:first-child):last-child]:ml-auto");
|
|
7652
|
+
}
|
|
7503
7653
|
});
|
|
7504
7654
|
Alpine.directive("h-sidebar-menu-action", (el, { modifiers }) => {
|
|
7505
7655
|
el.classList.add(
|
|
7506
7656
|
"text-sidebar-foreground",
|
|
7507
7657
|
"ring-sidebar-ring",
|
|
7508
7658
|
"hover:bg-sidebar-secondary",
|
|
7659
|
+
"active:bg-sidebar-secondary/70",
|
|
7509
7660
|
"hover:text-sidebar-secondary-foreground",
|
|
7510
7661
|
"peer-hover/menu-button:text-sidebar-secondary-foreground",
|
|
7662
|
+
"peer-active/menu-button:text-sidebar-primary-foreground",
|
|
7663
|
+
"peer-data-[active=true]/menu-button:text-sidebar-primary-foreground",
|
|
7511
7664
|
"absolute",
|
|
7512
|
-
"top-
|
|
7513
|
-
"right-
|
|
7665
|
+
"top-0.5",
|
|
7666
|
+
"right-0.5",
|
|
7667
|
+
"bottom-0.5",
|
|
7514
7668
|
"flex",
|
|
7515
7669
|
"aspect-square",
|
|
7516
|
-
"
|
|
7670
|
+
"h-auto",
|
|
7517
7671
|
"items-center",
|
|
7518
7672
|
"justify-center",
|
|
7519
7673
|
"rounded-md",
|
|
@@ -7526,13 +7680,10 @@ function sidebar_default(Alpine) {
|
|
|
7526
7680
|
"after:absolute",
|
|
7527
7681
|
"after:-inset-2",
|
|
7528
7682
|
"md:after:hidden",
|
|
7529
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
7530
|
-
"peer-data-[size=default]/menu-button:top-1.5",
|
|
7531
|
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
7532
7683
|
"group-data-[collapsed=true]/sidebar:hidden"
|
|
7533
7684
|
);
|
|
7534
7685
|
if (modifiers.includes("autohide")) {
|
|
7535
|
-
el.classList.add("
|
|
7686
|
+
el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "data-[state=open]:opacity-100", "md:opacity-0");
|
|
7536
7687
|
}
|
|
7537
7688
|
if (el.tagName !== "BUTTON") {
|
|
7538
7689
|
el.setAttribute("role", "button");
|
|
@@ -7541,30 +7692,11 @@ function sidebar_default(Alpine) {
|
|
|
7541
7692
|
}
|
|
7542
7693
|
el.setAttribute("data-slot", "sidebar-menu-action");
|
|
7543
7694
|
});
|
|
7544
|
-
Alpine.directive("h-sidebar-menu-badge", (el) => {
|
|
7545
|
-
el.
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
"right-1.5",
|
|
7550
|
-
"flex",
|
|
7551
|
-
"h-5",
|
|
7552
|
-
"min-w-5",
|
|
7553
|
-
"items-center",
|
|
7554
|
-
"justify-center",
|
|
7555
|
-
"rounded-md",
|
|
7556
|
-
"px-1",
|
|
7557
|
-
"text-xs",
|
|
7558
|
-
"font-medium",
|
|
7559
|
-
"tabular-nums",
|
|
7560
|
-
"select-none",
|
|
7561
|
-
"peer-hover/menu-button:text-sidebar-secondary-foreground",
|
|
7562
|
-
"peer-data-[active=true]/menu-button:text-sidebar-primary-foreground",
|
|
7563
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
7564
|
-
"peer-data-[size=default]/menu-button:top-1.5",
|
|
7565
|
-
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
7566
|
-
"group-data-[collapsed=true]/sidebar:hidden"
|
|
7567
|
-
);
|
|
7695
|
+
Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
|
|
7696
|
+
if (el.tagName !== "SPAN") {
|
|
7697
|
+
throw new Error(`${original} must be a span element`);
|
|
7698
|
+
}
|
|
7699
|
+
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");
|
|
7568
7700
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
7569
7701
|
});
|
|
7570
7702
|
Alpine.directive("h-sidebar-menu-skeleton", (el, { modifiers }) => {
|
|
@@ -7585,68 +7717,27 @@ function sidebar_default(Alpine) {
|
|
|
7585
7717
|
el.setAttribute("data-slot", "sidebar-separator");
|
|
7586
7718
|
el.setAttribute("role", "none");
|
|
7587
7719
|
});
|
|
7588
|
-
Alpine.directive("h-sidebar-menu-sub", (el, {
|
|
7589
|
-
el.
|
|
7590
|
-
|
|
7591
|
-
el.classList.add("border-sidebar-border", "mx-3.5", "border-l", "px-2.5");
|
|
7720
|
+
Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
7721
|
+
if (el.tagName !== "UL") {
|
|
7722
|
+
throw new Error(`${original} must be an ul element`);
|
|
7592
7723
|
}
|
|
7593
|
-
el.
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
el.classList.add("group/menu-sub-item", "relative");
|
|
7597
|
-
el.setAttribute("data-slot", "sidebar-menu-sub-item");
|
|
7598
|
-
});
|
|
7599
|
-
Alpine.directive("h-sidebar-menu-sub-button", (el) => {
|
|
7600
|
-
if (el.tagName !== "BUTTON") {
|
|
7601
|
-
throw new Error(`${original} must be a button`);
|
|
7724
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sidebar_menu_item"));
|
|
7725
|
+
if (!menuItem) {
|
|
7726
|
+
throw new Error(`${original} must be placed inside a sidebar menu item`);
|
|
7602
7727
|
}
|
|
7603
|
-
el.classList.add(
|
|
7604
|
-
|
|
7605
|
-
"
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
"
|
|
7610
|
-
"
|
|
7611
|
-
"
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
"-translate-x-px",
|
|
7616
|
-
"items-center",
|
|
7617
|
-
"gap-2",
|
|
7618
|
-
"overflow-hidden",
|
|
7619
|
-
"rounded-md",
|
|
7620
|
-
"px-2",
|
|
7621
|
-
"align-middle",
|
|
7622
|
-
"outline-hidden",
|
|
7623
|
-
"focus-visible:ring-2",
|
|
7624
|
-
"disabled:pointer-events-none",
|
|
7625
|
-
"disabled:opacity-50",
|
|
7626
|
-
"aria-disabled:pointer-events-none",
|
|
7627
|
-
"aria-disabled:opacity-50",
|
|
7628
|
-
"[&>span]:truncate",
|
|
7629
|
-
"[&>span]:align-middle",
|
|
7630
|
-
"[&>svg]:size-4",
|
|
7631
|
-
"[&>svg]:shrink-0",
|
|
7632
|
-
"[&>svg:not(:first-child):last-child]:ml-auto",
|
|
7633
|
-
"data-[active=true]:bg-sidebar-primary",
|
|
7634
|
-
"data-[active=true]:text-sidebar-primary-foreground",
|
|
7635
|
-
"group-data-[collapsed=true]/sidebar:hidden"
|
|
7636
|
-
);
|
|
7637
|
-
el.setAttribute("type", "button");
|
|
7638
|
-
el.setAttribute("data-slot", "sidebar-menu-sub-button");
|
|
7639
|
-
const sizes = {
|
|
7640
|
-
sm: ["text-xs"],
|
|
7641
|
-
md: ["text-sm"]
|
|
7642
|
-
};
|
|
7643
|
-
function setSize2(size3) {
|
|
7644
|
-
if (sizes.hasOwnProperty(size3)) {
|
|
7645
|
-
el.classList.add(...sizes[size3]);
|
|
7646
|
-
}
|
|
7728
|
+
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");
|
|
7729
|
+
if (el.getAttribute("data-line") !== "false") {
|
|
7730
|
+
el.classList.add("border-sidebar-border", "border-l");
|
|
7731
|
+
}
|
|
7732
|
+
el.setAttribute("data-slot", "sidebar-menu-sub");
|
|
7733
|
+
if (menuItem._h_sidebar_menu_item.collapsable) {
|
|
7734
|
+
el.setAttribute("id", menuItem._h_sidebar_menu_item.controls);
|
|
7735
|
+
el.setAttribute("aria-labelledby", menuItem._h_sidebar_menu_item.controlId);
|
|
7736
|
+
el.setAttribute("data-collapsed", menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7737
|
+
effect(() => {
|
|
7738
|
+
el.setAttribute("data-collapsed", menuItem._h_sidebar_menu_item.state.collapsed);
|
|
7739
|
+
});
|
|
7647
7740
|
}
|
|
7648
|
-
if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "md");
|
|
7649
|
-
setSize2(el.getAttribute("data-size"));
|
|
7650
7741
|
});
|
|
7651
7742
|
Alpine.directive("h-sidebar-footer", (el) => {
|
|
7652
7743
|
el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-t");
|
|
@@ -7897,10 +7988,10 @@ function split_default(Alpine) {
|
|
|
7897
7988
|
observer.disconnect();
|
|
7898
7989
|
});
|
|
7899
7990
|
});
|
|
7900
|
-
Alpine.directive("h-split-panel", (el, { original
|
|
7991
|
+
Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7901
7992
|
const split = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_split"));
|
|
7902
7993
|
if (!split) {
|
|
7903
|
-
throw new Error(`${
|
|
7994
|
+
throw new Error(`${original} must be inside an split element`);
|
|
7904
7995
|
}
|
|
7905
7996
|
el.classList.add("flex", "shrink", "grow-0", "box-border", "min-w-0", "min-h-0", "overflow-visible");
|
|
7906
7997
|
el.setAttribute("tabindex", "-1");
|
|
@@ -8420,7 +8511,7 @@ function tabs_default(Alpine) {
|
|
|
8420
8511
|
el.setAttribute("role", "tablist");
|
|
8421
8512
|
el.setAttribute("data-slot", "tab-list");
|
|
8422
8513
|
});
|
|
8423
|
-
Alpine.directive("h-tab", (el, { original
|
|
8514
|
+
Alpine.directive("h-tab", (el, { original }) => {
|
|
8424
8515
|
el.classList.add(
|
|
8425
8516
|
"cursor-pointer",
|
|
8426
8517
|
"focus-visible:border-ring",
|
|
@@ -8467,8 +8558,8 @@ function tabs_default(Alpine) {
|
|
|
8467
8558
|
);
|
|
8468
8559
|
el.setAttribute("role", "tab");
|
|
8469
8560
|
el.setAttribute("data-slot", "tab");
|
|
8470
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
8471
|
-
if (!el.hasAttribute("aria-controls")) throw new Error(`${
|
|
8561
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tabs must have an id`);
|
|
8562
|
+
if (!el.hasAttribute("aria-controls")) throw new Error(`${original}: aria-controls must be set to the tab-content id.`);
|
|
8472
8563
|
});
|
|
8473
8564
|
Alpine.directive("h-tab-action", (el) => {
|
|
8474
8565
|
el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
|
|
@@ -8502,13 +8593,13 @@ function tabs_default(Alpine) {
|
|
|
8502
8593
|
el.setAttribute("role", "button");
|
|
8503
8594
|
el.setAttribute("data-slot", "tab-list-action");
|
|
8504
8595
|
});
|
|
8505
|
-
Alpine.directive("h-tabs-content", (el, { original
|
|
8596
|
+
Alpine.directive("h-tabs-content", (el, { original }) => {
|
|
8506
8597
|
el.classList.add("flex-1", "outline-none");
|
|
8507
8598
|
el.setAttribute("role", "tabpanel");
|
|
8508
8599
|
el.setAttribute("tabindex", "0");
|
|
8509
8600
|
el.setAttribute("data-slot", "tabs-content");
|
|
8510
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
8511
|
-
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${
|
|
8601
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tab content must have an id`);
|
|
8602
|
+
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original}: aria-labelledby must be set to the tab id.`);
|
|
8512
8603
|
});
|
|
8513
8604
|
}
|
|
8514
8605
|
|
|
@@ -8901,13 +8992,13 @@ function timepicker_default(Alpine) {
|
|
|
8901
8992
|
top.removeEventListener("click", el._h_timepicker.close);
|
|
8902
8993
|
});
|
|
8903
8994
|
});
|
|
8904
|
-
Alpine.directive("h-time-picker-input", (el, { original
|
|
8995
|
+
Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8905
8996
|
if (el.tagName !== "INPUT") {
|
|
8906
|
-
throw new Error(`${
|
|
8997
|
+
throw new Error(`${original} must be a readonly input of type "text"`);
|
|
8907
8998
|
}
|
|
8908
8999
|
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_timepicker"));
|
|
8909
9000
|
if (!timepicker) {
|
|
8910
|
-
throw new Error(`${
|
|
9001
|
+
throw new Error(`${original} must be inside a time-picker element`);
|
|
8911
9002
|
}
|
|
8912
9003
|
timepicker._h_timepicker.focusInput = () => {
|
|
8913
9004
|
el.focus();
|
|
@@ -9224,7 +9315,7 @@ function timepicker_default(Alpine) {
|
|
|
9224
9315
|
timeContainer.addEventListener("click", setTime);
|
|
9225
9316
|
el.appendChild(timeContainer);
|
|
9226
9317
|
const hoursList = document.createElement("ul");
|
|
9227
|
-
hoursList.classList.add("flex-1", "overflow-y-
|
|
9318
|
+
hoursList.classList.add("flex-1", "overflow-y-auto", "[scrollbar-width:thin]");
|
|
9228
9319
|
hoursList.setAttribute("role", "listbox");
|
|
9229
9320
|
hoursList.setAttribute("tabindex", "-1");
|
|
9230
9321
|
hoursList.setAttribute("aria-label", el.dataset.labelHours ?? "Select hour");
|
|
@@ -9241,7 +9332,7 @@ function timepicker_default(Alpine) {
|
|
|
9241
9332
|
hoursList.appendChild(hour);
|
|
9242
9333
|
}
|
|
9243
9334
|
const minutesList = document.createElement("ul");
|
|
9244
|
-
minutesList.classList.add("flex-1", "overflow-y-
|
|
9335
|
+
minutesList.classList.add("flex-1", "overflow-y-auto", "[scrollbar-width:thin]");
|
|
9245
9336
|
minutesList.setAttribute("role", "listbox");
|
|
9246
9337
|
minutesList.setAttribute("tabindex", "-1");
|
|
9247
9338
|
minutesList.setAttribute("aria-label", el.dataset.labelMinutes ?? "Select minute");
|
|
@@ -9258,7 +9349,7 @@ function timepicker_default(Alpine) {
|
|
|
9258
9349
|
minutesList.appendChild(minute);
|
|
9259
9350
|
}
|
|
9260
9351
|
const secondsList = document.createElement("ul");
|
|
9261
|
-
secondsList.classList.add("flex-1", "overflow-y-
|
|
9352
|
+
secondsList.classList.add("flex-1", "overflow-y-auto", "[scrollbar-width:thin]");
|
|
9262
9353
|
if (!timepicker._h_timepicker.seconds) {
|
|
9263
9354
|
secondsList.classList.add("hidden");
|
|
9264
9355
|
}
|
|
@@ -9278,7 +9369,7 @@ function timepicker_default(Alpine) {
|
|
|
9278
9369
|
secondsList.appendChild(second);
|
|
9279
9370
|
}
|
|
9280
9371
|
const periodList = document.createElement("ul");
|
|
9281
|
-
periodList.classList.add("flex-1", "overflow-y-
|
|
9372
|
+
periodList.classList.add("flex-1", "overflow-y-auto", "[scrollbar-width:thin]");
|
|
9282
9373
|
if (!timepicker._h_timepicker.is12Hour) {
|
|
9283
9374
|
periodList.classList.add("hidden");
|
|
9284
9375
|
}
|
|
@@ -9556,7 +9647,7 @@ function tooltip_default(Alpine) {
|
|
|
9556
9647
|
el.removeEventListener("pointerleave", handler);
|
|
9557
9648
|
});
|
|
9558
9649
|
});
|
|
9559
|
-
Alpine.directive("h-tooltip", (el, { original
|
|
9650
|
+
Alpine.directive("h-tooltip", (el, { original }, { effect }) => {
|
|
9560
9651
|
const tooltip = (() => {
|
|
9561
9652
|
let sibling = el.previousElementSibling;
|
|
9562
9653
|
while (sibling && !sibling.hasOwnProperty("_tooltip")) {
|
|
@@ -9565,7 +9656,7 @@ function tooltip_default(Alpine) {
|
|
|
9565
9656
|
return sibling;
|
|
9566
9657
|
})();
|
|
9567
9658
|
if (!tooltip) {
|
|
9568
|
-
throw new Error(`${
|
|
9659
|
+
throw new Error(`${original} must be placed after a tooltip trigger element`);
|
|
9569
9660
|
}
|
|
9570
9661
|
el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
|
|
9571
9662
|
el.setAttribute("data-slot", "tooltip");
|
|
@@ -9771,9 +9862,9 @@ function tree_default(Alpine) {
|
|
|
9771
9862
|
});
|
|
9772
9863
|
}
|
|
9773
9864
|
});
|
|
9774
|
-
Alpine.directive("h-tree-button", (el, { original
|
|
9865
|
+
Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
|
|
9775
9866
|
const treeItem = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_tree_item"));
|
|
9776
|
-
if (!treeItem) throw new Error(`${
|
|
9867
|
+
if (!treeItem) throw new Error(`${original} must be inside a tree item`);
|
|
9777
9868
|
el.classList.add(
|
|
9778
9869
|
"flex",
|
|
9779
9870
|
"w-full",
|
|
@@ -9836,7 +9927,7 @@ function tree_default(Alpine) {
|
|
|
9836
9927
|
}
|
|
9837
9928
|
|
|
9838
9929
|
// package.json
|
|
9839
|
-
var version = "1.
|
|
9930
|
+
var version = "1.4.0";
|
|
9840
9931
|
|
|
9841
9932
|
// src/utils/breakpoint-listener.js
|
|
9842
9933
|
function getBreakpointListener(handler, breakpoint = 768) {
|
|
@@ -9943,7 +10034,7 @@ function focus_default(Alpine) {
|
|
|
9943
10034
|
|
|
9944
10035
|
// src/utils/template.js
|
|
9945
10036
|
function template_default(Alpine) {
|
|
9946
|
-
Alpine.directive("h-template", (el, { original
|
|
10037
|
+
Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
9947
10038
|
if (el.hasAttribute(Alpine2.prefixed("data"))) {
|
|
9948
10039
|
const template = evaluate2(expression);
|
|
9949
10040
|
const clone = template.content.cloneNode(true).firstElementChild;
|
|
@@ -9957,7 +10048,7 @@ function template_default(Alpine) {
|
|
|
9957
10048
|
clone.remove();
|
|
9958
10049
|
});
|
|
9959
10050
|
} else {
|
|
9960
|
-
console.error(`${
|
|
10051
|
+
console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
|
|
9961
10052
|
}
|
|
9962
10053
|
});
|
|
9963
10054
|
}
|