@codbex/harmonia 1.9.0 → 1.9.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.esm.js +191 -178
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +3 -3
- package/dist/harmonia.js +191 -178
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +3 -3
- package/package.json +7 -1
package/dist/harmonia.esm.js
CHANGED
|
@@ -2503,10 +2503,10 @@ function accordion_default(Alpine) {
|
|
|
2503
2503
|
}) : { single: false };
|
|
2504
2504
|
el.setAttribute("data-slot", "accordion");
|
|
2505
2505
|
});
|
|
2506
|
-
Alpine.directive("h-accordion-item", (el, { original
|
|
2507
|
-
const accordion = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
2506
|
+
Alpine.directive("h-accordion-item", (el, { original, expression, modifiers }, { Alpine: Alpine2 }) => {
|
|
2507
|
+
const accordion = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_accordion"));
|
|
2508
2508
|
if (!accordion) {
|
|
2509
|
-
throw new Error(`${
|
|
2509
|
+
throw new Error(`${original} must be inside an accordion`);
|
|
2510
2510
|
}
|
|
2511
2511
|
el.classList.add("border-b", "last:border-b-0");
|
|
2512
2512
|
el.setAttribute("data-slot", "accordion-item");
|
|
@@ -2529,14 +2529,14 @@ function accordion_default(Alpine) {
|
|
|
2529
2529
|
expanded: getIsExpanded()
|
|
2530
2530
|
});
|
|
2531
2531
|
});
|
|
2532
|
-
Alpine.directive("h-accordion-trigger", (el, { original
|
|
2532
|
+
Alpine.directive("h-accordion-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
2533
2533
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
2534
|
-
throw new Error(`${
|
|
2534
|
+
throw new Error(`${original} must be a header element`);
|
|
2535
2535
|
}
|
|
2536
|
-
const accordion = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
2537
|
-
const accordionItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
2536
|
+
const accordion = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_accordion"));
|
|
2537
|
+
const accordionItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_accordionItem"));
|
|
2538
2538
|
if (!accordionItem || !accordion) {
|
|
2539
|
-
throw new Error(`${
|
|
2539
|
+
throw new Error(`${original} must have an accordion and accordion item parent elements`);
|
|
2540
2540
|
}
|
|
2541
2541
|
el.classList.add("flex", "h-12", "min-h-12", "[[data-size=md]_&]:h-10", "[[data-size=md]_&]:min-h-10", "[[data-size=sm]_&]:h-8", "[[data-size=sm]_&]:min-h-8");
|
|
2542
2542
|
el.setAttribute("tabIndex", "-1");
|
|
@@ -2609,7 +2609,7 @@ function accordion_default(Alpine) {
|
|
|
2609
2609
|
Alpine.directive("h-accordion-content", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
2610
2610
|
el.classList.add("pb-0", "overflow-hidden", "text-sm", "hidden", "transition-[opacity,max-height,padding-bottom]", "motion-reduce:transition-none", "duration-200", "ease-out", "opacity-0");
|
|
2611
2611
|
el.setAttribute("data-slot", "accordion-content");
|
|
2612
|
-
const parent = Alpine2.findClosest(el.parentElement, (parent2) =>
|
|
2612
|
+
const parent = Alpine2.findClosest(el.parentElement, (parent2) => Object.prototype.hasOwnProperty.call(parent2, "_h_accordionItem"));
|
|
2613
2613
|
if (parent) {
|
|
2614
2614
|
let onTransitionEnd = function(event) {
|
|
2615
2615
|
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
@@ -2686,7 +2686,7 @@ function alert_default(Alpine) {
|
|
|
2686
2686
|
for (const [_, value] of Object.entries(variants)) {
|
|
2687
2687
|
el.classList.remove(...value);
|
|
2688
2688
|
}
|
|
2689
|
-
if (
|
|
2689
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
2690
2690
|
}
|
|
2691
2691
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
2692
2692
|
const observer = new MutationObserver(() => {
|
|
@@ -2767,10 +2767,10 @@ function avatar_default(Alpine) {
|
|
|
2767
2767
|
el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
2768
2768
|
}
|
|
2769
2769
|
});
|
|
2770
|
-
Alpine.directive("h-avatar-image", (el, { original
|
|
2771
|
-
const avatar = Alpine.findClosest(el.parentElement, (parent) =>
|
|
2770
|
+
Alpine.directive("h-avatar-image", (el, { original }, { cleanup }) => {
|
|
2771
|
+
const avatar = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_avatar"));
|
|
2772
2772
|
if (!avatar) {
|
|
2773
|
-
throw new Error(`${
|
|
2773
|
+
throw new Error(`${original} must be inside an avatar element`);
|
|
2774
2774
|
}
|
|
2775
2775
|
el.classList.add("aspect-square", "size-full", "rounded-[inherit]");
|
|
2776
2776
|
el.setAttribute("data-slot", "avatar-image");
|
|
@@ -2801,10 +2801,10 @@ function avatar_default(Alpine) {
|
|
|
2801
2801
|
observer.disconnect();
|
|
2802
2802
|
});
|
|
2803
2803
|
});
|
|
2804
|
-
Alpine.directive("h-avatar-fallback", (el, { original
|
|
2805
|
-
const avatar = Alpine.findClosest(el.parentElement, (parent) =>
|
|
2804
|
+
Alpine.directive("h-avatar-fallback", (el, { original }, { effect }) => {
|
|
2805
|
+
const avatar = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_avatar"));
|
|
2806
2806
|
if (!avatar) {
|
|
2807
|
-
throw new Error(`${
|
|
2807
|
+
throw new Error(`${original} must be inside an avatar element`);
|
|
2808
2808
|
}
|
|
2809
2809
|
el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center", "rounded-[inherit]");
|
|
2810
2810
|
el.setAttribute("data-slot", "avatar-fallback");
|
|
@@ -2857,7 +2857,7 @@ function badge_default(Alpine) {
|
|
|
2857
2857
|
for (const [_2, value] of Object.entries(variants)) {
|
|
2858
2858
|
el.classList.remove(...value);
|
|
2859
2859
|
}
|
|
2860
|
-
if (
|
|
2860
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
2861
2861
|
}
|
|
2862
2862
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
2863
2863
|
const observer = new MutationObserver(() => {
|
|
@@ -2910,7 +2910,7 @@ function badge_default(Alpine) {
|
|
|
2910
2910
|
for (const [_2, value] of Object.entries(variants)) {
|
|
2911
2911
|
el.classList.remove(...value);
|
|
2912
2912
|
}
|
|
2913
|
-
if (
|
|
2913
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
2914
2914
|
}
|
|
2915
2915
|
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
2916
2916
|
const observer = new MutationObserver(() => {
|
|
@@ -3100,7 +3100,7 @@ var getButtonSize = (size3, isAddon = false) => {
|
|
|
3100
3100
|
}
|
|
3101
3101
|
};
|
|
3102
3102
|
function button_default(Alpine) {
|
|
3103
|
-
Alpine.directive("h-button", (el, { original
|
|
3103
|
+
Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
|
|
3104
3104
|
setButtonClasses(el);
|
|
3105
3105
|
if (!el.hasAttribute("data-slot")) {
|
|
3106
3106
|
el.setAttribute("data-slot", "button");
|
|
@@ -3111,13 +3111,13 @@ function button_default(Alpine) {
|
|
|
3111
3111
|
for (const [_, value] of Object.entries(buttonVariants)) {
|
|
3112
3112
|
el.classList.remove(...value);
|
|
3113
3113
|
}
|
|
3114
|
-
if (
|
|
3114
|
+
if (Object.prototype.hasOwnProperty.call(buttonVariants, variant)) el.classList.add(...buttonVariants[variant]);
|
|
3115
3115
|
}
|
|
3116
3116
|
function setSize2(size3 = "default") {
|
|
3117
3117
|
el.classList.remove(...getButtonSize(lastSize, isAddon));
|
|
3118
3118
|
el.classList.add(...getButtonSize(size3, isAddon));
|
|
3119
3119
|
if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
3120
|
-
console.error(`${
|
|
3120
|
+
console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
|
|
3121
3121
|
}
|
|
3122
3122
|
lastSize = size3;
|
|
3123
3123
|
}
|
|
@@ -3170,7 +3170,7 @@ function button_default(Alpine) {
|
|
|
3170
3170
|
for (const [_, value] of Object.entries(variants)) {
|
|
3171
3171
|
el.classList.remove(...value);
|
|
3172
3172
|
}
|
|
3173
|
-
if (
|
|
3173
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
3174
3174
|
}
|
|
3175
3175
|
setVariant(el.getAttribute("data-orientation") ?? "horizontal");
|
|
3176
3176
|
});
|
|
@@ -3196,8 +3196,8 @@ var oppositeSideMap = {
|
|
|
3196
3196
|
bottom: "top",
|
|
3197
3197
|
top: "bottom"
|
|
3198
3198
|
};
|
|
3199
|
-
function clamp(start, value,
|
|
3200
|
-
return max(start, min(value,
|
|
3199
|
+
function clamp(start, value, end) {
|
|
3200
|
+
return max(start, min(value, end));
|
|
3201
3201
|
}
|
|
3202
3202
|
function evaluate(value, param) {
|
|
3203
3203
|
return typeof value === "function" ? value(param) : value;
|
|
@@ -4671,8 +4671,8 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
4671
4671
|
|
|
4672
4672
|
// src/components/calendar.js
|
|
4673
4673
|
function calendar_default(Alpine) {
|
|
4674
|
-
Alpine.directive("h-calendar", (el, { original
|
|
4675
|
-
const datepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
4674
|
+
Alpine.directive("h-calendar", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
4675
|
+
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_datepicker"));
|
|
4676
4676
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
4677
4677
|
el.setAttribute("tabindex", "-1");
|
|
4678
4678
|
if (datepicker) {
|
|
@@ -4729,7 +4729,7 @@ function calendar_default(Alpine) {
|
|
|
4729
4729
|
const onInputChange = () => {
|
|
4730
4730
|
const newValue = new Date(datepicker._h_datepicker.input.value);
|
|
4731
4731
|
if (isNaN(newValue)) {
|
|
4732
|
-
console.error(`${
|
|
4732
|
+
console.error(`${original}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
|
|
4733
4733
|
datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4734
4734
|
return;
|
|
4735
4735
|
} else if (selected.getTime() !== newValue.getTime()) {
|
|
@@ -4745,7 +4745,7 @@ function calendar_default(Alpine) {
|
|
|
4745
4745
|
function setFromModel() {
|
|
4746
4746
|
selected = new Date(el._x_model.get());
|
|
4747
4747
|
if (isNaN(selected)) {
|
|
4748
|
-
console.error(`${
|
|
4748
|
+
console.error(`${original}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4749
4749
|
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4750
4750
|
else el.setAttribute("data-invalid", "true");
|
|
4751
4751
|
} else if (datepicker) {
|
|
@@ -4753,7 +4753,7 @@ function calendar_default(Alpine) {
|
|
|
4753
4753
|
}
|
|
4754
4754
|
}
|
|
4755
4755
|
function checkForModel() {
|
|
4756
|
-
if (
|
|
4756
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model") && el._x_model.get()) {
|
|
4757
4757
|
setFromModel();
|
|
4758
4758
|
}
|
|
4759
4759
|
}
|
|
@@ -4957,8 +4957,8 @@ function calendar_default(Alpine) {
|
|
|
4957
4957
|
const year = date.getFullYear();
|
|
4958
4958
|
const month = date.getMonth();
|
|
4959
4959
|
const start = new Date(year, month, 1);
|
|
4960
|
-
const
|
|
4961
|
-
const days =
|
|
4960
|
+
const end = new Date(year, month + 1, 0);
|
|
4961
|
+
const days = end.getDate();
|
|
4962
4962
|
const prevEndDay = new Date(year, month, 1);
|
|
4963
4963
|
prevEndDay.setDate(prevEndDay.getDate() - 1);
|
|
4964
4964
|
let lastPrevMonthDay = prevEndDay.getDate();
|
|
@@ -5065,7 +5065,7 @@ function calendar_default(Alpine) {
|
|
|
5065
5065
|
break;
|
|
5066
5066
|
case "End":
|
|
5067
5067
|
event.preventDefault();
|
|
5068
|
-
newDay.setDate(
|
|
5068
|
+
newDay.setDate(new Date(newDay.getFullYear(), newDay.getMonth() + 1, 0).getDate());
|
|
5069
5069
|
break;
|
|
5070
5070
|
case "PageUp":
|
|
5071
5071
|
event.preventDefault();
|
|
@@ -5174,7 +5174,7 @@ function calendar_default(Alpine) {
|
|
|
5174
5174
|
if (datepicker) {
|
|
5175
5175
|
el.addEventListener("transitionend", onTransitionEnd);
|
|
5176
5176
|
}
|
|
5177
|
-
if (
|
|
5177
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
5178
5178
|
const modelExpression = el.getAttribute("x-model");
|
|
5179
5179
|
const evaluateModel = evaluateLater(modelExpression);
|
|
5180
5180
|
effect(() => {
|
|
@@ -5303,7 +5303,7 @@ function sizeObserver(el) {
|
|
|
5303
5303
|
|
|
5304
5304
|
// src/components/datepicker.js
|
|
5305
5305
|
function datepicker_default(Alpine) {
|
|
5306
|
-
Alpine.directive("h-date-picker", (el, { original
|
|
5306
|
+
Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
5307
5307
|
const state = Alpine2.reactive({
|
|
5308
5308
|
expanded: false
|
|
5309
5309
|
});
|
|
@@ -5316,7 +5316,7 @@ function datepicker_default(Alpine) {
|
|
|
5316
5316
|
};
|
|
5317
5317
|
el._h_datepicker.input = el.querySelector("input");
|
|
5318
5318
|
if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
|
|
5319
|
-
throw new Error(`${
|
|
5319
|
+
throw new Error(`${original} must contain an input`);
|
|
5320
5320
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
5321
5321
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
5322
5322
|
} else {
|
|
@@ -5395,16 +5395,16 @@ function datepicker_default(Alpine) {
|
|
|
5395
5395
|
observer.disconnect();
|
|
5396
5396
|
});
|
|
5397
5397
|
});
|
|
5398
|
-
Alpine.directive("h-date-picker-trigger", (el, { original
|
|
5398
|
+
Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
5399
5399
|
if (el.tagName !== "BUTTON") {
|
|
5400
|
-
throw new Error(`${
|
|
5400
|
+
throw new Error(`${original} must be a button`);
|
|
5401
5401
|
}
|
|
5402
5402
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5403
|
-
throw new Error(`${
|
|
5403
|
+
throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5404
5404
|
}
|
|
5405
|
-
const datepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5405
|
+
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_datepicker"));
|
|
5406
5406
|
if (!datepicker) {
|
|
5407
|
-
throw new Error(`${
|
|
5407
|
+
throw new Error(`${original} must be inside an date-picker element`);
|
|
5408
5408
|
}
|
|
5409
5409
|
el.classList.add(
|
|
5410
5410
|
"cursor-pointer",
|
|
@@ -5692,13 +5692,13 @@ function expansion_panel_default(Alpine) {
|
|
|
5692
5692
|
});
|
|
5693
5693
|
}
|
|
5694
5694
|
});
|
|
5695
|
-
Alpine.directive("h-exp-panel-trigger", (el, { original
|
|
5695
|
+
Alpine.directive("h-exp-panel-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
5696
5696
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
5697
|
-
throw new Error(`${
|
|
5697
|
+
throw new Error(`${original} must be a header element`);
|
|
5698
5698
|
}
|
|
5699
|
-
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5699
|
+
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_expPanelItem"));
|
|
5700
5700
|
if (!expPanelItem) {
|
|
5701
|
-
throw new Error(`${
|
|
5701
|
+
throw new Error(`${original} must have an exp-panel-item parent element`);
|
|
5702
5702
|
}
|
|
5703
5703
|
el.classList.add(
|
|
5704
5704
|
"bg-object-header",
|
|
@@ -5879,13 +5879,13 @@ function fieldset_default(Alpine) {
|
|
|
5879
5879
|
|
|
5880
5880
|
// src/components/icon.js
|
|
5881
5881
|
function icon_default(Alpine) {
|
|
5882
|
-
Alpine.directive("h-icon", (el, { original
|
|
5882
|
+
Alpine.directive("h-icon", (el, { original, modifiers }) => {
|
|
5883
5883
|
if (el.tagName.toLowerCase() !== "svg") {
|
|
5884
|
-
throw new Error(`${
|
|
5884
|
+
throw new Error(`${original} works only on svg elements`);
|
|
5885
5885
|
} else if (!el.hasAttribute("role")) {
|
|
5886
|
-
throw new Error(`${
|
|
5886
|
+
throw new Error(`${original} must have a role`);
|
|
5887
5887
|
} else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5888
|
-
throw new Error(`${
|
|
5888
|
+
throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5889
5889
|
}
|
|
5890
5890
|
el.classList.add("fill-current");
|
|
5891
5891
|
el.setAttribute("data-slot", "icon");
|
|
@@ -6086,7 +6086,7 @@ function input_default(Alpine) {
|
|
|
6086
6086
|
"block-end": ["order-last", "w-full", "justify-start", "px-3", "pb-3", "[.border-t]:pt-3", "group-has-[>input]/input-group:pb-2.5"]
|
|
6087
6087
|
};
|
|
6088
6088
|
function setVariant(variant) {
|
|
6089
|
-
if (
|
|
6089
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
6090
6090
|
}
|
|
6091
6091
|
setVariant(el.getAttribute("data-align") ?? "inline-start");
|
|
6092
6092
|
const handler = (event) => {
|
|
@@ -6106,7 +6106,7 @@ function input_default(Alpine) {
|
|
|
6106
6106
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
6107
6107
|
el.setAttribute("data-slot", "label");
|
|
6108
6108
|
});
|
|
6109
|
-
Alpine.directive("h-input-number", (el, { original
|
|
6109
|
+
Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
|
|
6110
6110
|
el.classList.add(
|
|
6111
6111
|
"overflow-hidden",
|
|
6112
6112
|
"group/input-number",
|
|
@@ -6142,7 +6142,7 @@ function input_default(Alpine) {
|
|
|
6142
6142
|
el.setAttribute("data-slot", "input-number");
|
|
6143
6143
|
const input = el.querySelector("input");
|
|
6144
6144
|
if (!input || input.getAttribute("type") !== "number") {
|
|
6145
|
-
throw new Error(`${
|
|
6145
|
+
throw new Error(`${original} must contain an input of type 'number'`);
|
|
6146
6146
|
}
|
|
6147
6147
|
if (!input.hasAttribute("type")) input.setAttribute("type", "number");
|
|
6148
6148
|
if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
|
|
@@ -6356,7 +6356,8 @@ function list_default(Alpine) {
|
|
|
6356
6356
|
focusLastOption(el);
|
|
6357
6357
|
break;
|
|
6358
6358
|
case "Up":
|
|
6359
|
-
case "ArrowUp":
|
|
6359
|
+
case "ArrowUp": {
|
|
6360
|
+
event.preventDefault();
|
|
6360
6361
|
let prevElem = event.target.previousElementSibling;
|
|
6361
6362
|
if (prevElem && prevElem.getAttribute("data-slot") !== "list-header") {
|
|
6362
6363
|
prevElem.focus();
|
|
@@ -6367,8 +6368,10 @@ function list_default(Alpine) {
|
|
|
6367
6368
|
}
|
|
6368
6369
|
}
|
|
6369
6370
|
break;
|
|
6371
|
+
}
|
|
6370
6372
|
case "Down":
|
|
6371
|
-
case "ArrowDown":
|
|
6373
|
+
case "ArrowDown": {
|
|
6374
|
+
event.preventDefault();
|
|
6372
6375
|
let nextElem = event.target.nextElementSibling;
|
|
6373
6376
|
if (nextElem) {
|
|
6374
6377
|
nextElem.focus();
|
|
@@ -6379,6 +6382,7 @@ function list_default(Alpine) {
|
|
|
6379
6382
|
}
|
|
6380
6383
|
}
|
|
6381
6384
|
break;
|
|
6385
|
+
}
|
|
6382
6386
|
case " ":
|
|
6383
6387
|
case "Enter":
|
|
6384
6388
|
selectOption(event.target);
|
|
@@ -6402,13 +6406,13 @@ function list_default(Alpine) {
|
|
|
6402
6406
|
el.setAttribute("data-slot", "list");
|
|
6403
6407
|
el.setAttribute("role", "group");
|
|
6404
6408
|
});
|
|
6405
|
-
Alpine.directive("h-list-header", (el, { original
|
|
6409
|
+
Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
|
|
6406
6410
|
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
6407
6411
|
el.setAttribute("role", "presentation");
|
|
6408
6412
|
el.setAttribute("data-slot", "list-header");
|
|
6409
6413
|
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
6410
6414
|
if (!list) {
|
|
6411
|
-
throw new Error(`${
|
|
6415
|
+
throw new Error(`${original} must be placed inside a list element`);
|
|
6412
6416
|
}
|
|
6413
6417
|
if (!el.hasAttribute("id")) {
|
|
6414
6418
|
const id = `lbh${uuid_default()}`;
|
|
@@ -6466,9 +6470,9 @@ function menu_default(Alpine) {
|
|
|
6466
6470
|
}
|
|
6467
6471
|
}
|
|
6468
6472
|
});
|
|
6469
|
-
Alpine.directive("h-menu", (el, { original
|
|
6473
|
+
Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
6470
6474
|
if (el.tagName !== "UL") {
|
|
6471
|
-
throw new Error(`${
|
|
6475
|
+
throw new Error(`${original} must be an ul element`);
|
|
6472
6476
|
}
|
|
6473
6477
|
el.classList.add(
|
|
6474
6478
|
"hidden",
|
|
@@ -6500,11 +6504,11 @@ function menu_default(Alpine) {
|
|
|
6500
6504
|
const menuTrigger = (() => {
|
|
6501
6505
|
if (isSubmenu) return;
|
|
6502
6506
|
let sibling = el.previousElementSibling;
|
|
6503
|
-
while (sibling && !
|
|
6507
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_menu_trigger")) {
|
|
6504
6508
|
sibling = sibling.previousElementSibling;
|
|
6505
6509
|
}
|
|
6506
|
-
if (!
|
|
6507
|
-
throw new Error(`${
|
|
6510
|
+
if (!Object.prototype.hasOwnProperty.call(sibling, "_menu_trigger")) {
|
|
6511
|
+
throw new Error(`${original} menu must be placed after a menu trigger element`);
|
|
6508
6512
|
}
|
|
6509
6513
|
return sibling;
|
|
6510
6514
|
})();
|
|
@@ -6513,7 +6517,7 @@ function menu_default(Alpine) {
|
|
|
6513
6517
|
if (parent && parent.hasAttribute("id")) {
|
|
6514
6518
|
el.setAttribute("aria-labelledby", parent.id);
|
|
6515
6519
|
} else {
|
|
6516
|
-
throw new Error(`${
|
|
6520
|
+
throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
6517
6521
|
}
|
|
6518
6522
|
}
|
|
6519
6523
|
}
|
|
@@ -6521,7 +6525,7 @@ function menu_default(Alpine) {
|
|
|
6521
6525
|
if (isSubmenu) {
|
|
6522
6526
|
menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
6523
6527
|
if (!menuSubItem) {
|
|
6524
|
-
throw new Error(`${
|
|
6528
|
+
throw new Error(`${original} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
|
|
6525
6529
|
}
|
|
6526
6530
|
setAriaAttrubutes(menuSubItem);
|
|
6527
6531
|
} else if (menuTrigger) {
|
|
@@ -6629,7 +6633,7 @@ function menu_default(Alpine) {
|
|
|
6629
6633
|
}
|
|
6630
6634
|
break;
|
|
6631
6635
|
case "Up":
|
|
6632
|
-
case "ArrowUp":
|
|
6636
|
+
case "ArrowUp": {
|
|
6633
6637
|
event.preventDefault();
|
|
6634
6638
|
let menuitems = el.querySelectorAll(':scope > [role^=menuitem][tabIndex="-1"]:has(~ [role^=menuitem][tabIndex="0"])');
|
|
6635
6639
|
if (menuitems.length) {
|
|
@@ -6641,6 +6645,7 @@ function menu_default(Alpine) {
|
|
|
6641
6645
|
menuitem.focus();
|
|
6642
6646
|
}
|
|
6643
6647
|
break;
|
|
6648
|
+
}
|
|
6644
6649
|
case "Home":
|
|
6645
6650
|
case "PageUp":
|
|
6646
6651
|
event.preventDefault();
|
|
@@ -6762,9 +6767,9 @@ function menu_default(Alpine) {
|
|
|
6762
6767
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
6763
6768
|
});
|
|
6764
6769
|
});
|
|
6765
|
-
Alpine.directive("h-menu-item", (el, { original
|
|
6770
|
+
Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6766
6771
|
if (el.tagName !== "LI") {
|
|
6767
|
-
throw new Error(`${
|
|
6772
|
+
throw new Error(`${original} must be a li element`);
|
|
6768
6773
|
}
|
|
6769
6774
|
el.classList.add(
|
|
6770
6775
|
"focus:bg-secondary-hover",
|
|
@@ -6818,7 +6823,7 @@ function menu_default(Alpine) {
|
|
|
6818
6823
|
el.removeEventListener("mouseleave", focusOut);
|
|
6819
6824
|
});
|
|
6820
6825
|
});
|
|
6821
|
-
Alpine.directive("h-menu-sub", (el, { original
|
|
6826
|
+
Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6822
6827
|
el.classList.add(
|
|
6823
6828
|
"focus:bg-secondary-hover",
|
|
6824
6829
|
"hover:bg-secondary-hover",
|
|
@@ -6850,7 +6855,7 @@ function menu_default(Alpine) {
|
|
|
6850
6855
|
const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
|
|
6851
6856
|
el.appendChild(chevronRight);
|
|
6852
6857
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6853
|
-
if (!parentMenu) throw new Error(`${
|
|
6858
|
+
if (!parentMenu) throw new Error(`${original} must have a parent`);
|
|
6854
6859
|
if (!el.hasAttribute("id")) {
|
|
6855
6860
|
el.setAttribute("id", `ms${uuid_default()}`);
|
|
6856
6861
|
}
|
|
@@ -6947,9 +6952,9 @@ function menu_default(Alpine) {
|
|
|
6947
6952
|
el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
|
|
6948
6953
|
el.setAttribute("data-slot", "menu-label");
|
|
6949
6954
|
});
|
|
6950
|
-
Alpine.directive("h-menu-checkbox-item", (el, { original
|
|
6955
|
+
Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6951
6956
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6952
|
-
throw new Error(`${
|
|
6957
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6953
6958
|
}
|
|
6954
6959
|
el.classList.add(
|
|
6955
6960
|
"focus:bg-secondary-hover",
|
|
@@ -6989,7 +6994,7 @@ function menu_default(Alpine) {
|
|
|
6989
6994
|
el._x_model.set(!el._x_model.get());
|
|
6990
6995
|
setState(el._x_model.get());
|
|
6991
6996
|
}
|
|
6992
|
-
if (
|
|
6997
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
6993
6998
|
setState(el._x_model.get(), false);
|
|
6994
6999
|
el.addEventListener("click", onActivate);
|
|
6995
7000
|
}
|
|
@@ -7006,7 +7011,7 @@ function menu_default(Alpine) {
|
|
|
7006
7011
|
el.addEventListener("mouseenter", focusIn);
|
|
7007
7012
|
el.addEventListener("focus", focusIn);
|
|
7008
7013
|
cleanup(() => {
|
|
7009
|
-
if (
|
|
7014
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7010
7015
|
el.removeEventListener("click", onActivate);
|
|
7011
7016
|
el.removeEventListener("keydown", onActivate);
|
|
7012
7017
|
}
|
|
@@ -7016,9 +7021,9 @@ function menu_default(Alpine) {
|
|
|
7016
7021
|
el.removeEventListener("mouseleave", focusOut);
|
|
7017
7022
|
});
|
|
7018
7023
|
});
|
|
7019
|
-
Alpine.directive("h-menu-radio-item", (el, { original
|
|
7024
|
+
Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
7020
7025
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
7021
|
-
throw new Error(`${
|
|
7026
|
+
throw new Error(`${original} must be a li or div element`);
|
|
7022
7027
|
}
|
|
7023
7028
|
el.classList.add(
|
|
7024
7029
|
"focus:bg-secondary-hover",
|
|
@@ -7074,7 +7079,7 @@ function menu_default(Alpine) {
|
|
|
7074
7079
|
el._x_model.set(value);
|
|
7075
7080
|
}
|
|
7076
7081
|
}
|
|
7077
|
-
if (
|
|
7082
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7078
7083
|
effect(() => {
|
|
7079
7084
|
setState(el._x_model.get() === value);
|
|
7080
7085
|
});
|
|
@@ -7094,7 +7099,7 @@ function menu_default(Alpine) {
|
|
|
7094
7099
|
el.addEventListener("mouseenter", focusIn);
|
|
7095
7100
|
el.addEventListener("focus", focusIn);
|
|
7096
7101
|
cleanup(() => {
|
|
7097
|
-
if (
|
|
7102
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7098
7103
|
el.removeEventListener("click", onActivate);
|
|
7099
7104
|
el.removeEventListener("keydown", onActivate);
|
|
7100
7105
|
}
|
|
@@ -7142,7 +7147,7 @@ function notifications_default(Alpine) {
|
|
|
7142
7147
|
};
|
|
7143
7148
|
this.items.push(item);
|
|
7144
7149
|
this.listeners.forEach((listener) => {
|
|
7145
|
-
if (
|
|
7150
|
+
if (Object.prototype.hasOwnProperty.call(listener, "added")) listener.added(item);
|
|
7146
7151
|
});
|
|
7147
7152
|
},
|
|
7148
7153
|
update(id, data) {
|
|
@@ -7155,7 +7160,7 @@ function notifications_default(Alpine) {
|
|
|
7155
7160
|
this.items[index].data[key] = value;
|
|
7156
7161
|
}
|
|
7157
7162
|
this.listeners.forEach((listener) => {
|
|
7158
|
-
if (
|
|
7163
|
+
if (Object.prototype.hasOwnProperty.call(listener, "updated")) listener.updated(id, data);
|
|
7159
7164
|
});
|
|
7160
7165
|
} else {
|
|
7161
7166
|
console.error(`Notification with id "${id}" does not exist`);
|
|
@@ -7166,7 +7171,7 @@ function notifications_default(Alpine) {
|
|
|
7166
7171
|
throw new Error("Cannot remove a notification if an ID is not provided");
|
|
7167
7172
|
}
|
|
7168
7173
|
this.listeners.forEach((listener) => {
|
|
7169
|
-
if (
|
|
7174
|
+
if (Object.prototype.hasOwnProperty.call(listener, "removed")) listener.removed(id);
|
|
7170
7175
|
});
|
|
7171
7176
|
this.items = this.items.filter((n) => n.id !== id);
|
|
7172
7177
|
}
|
|
@@ -7191,9 +7196,9 @@ function notifications_default(Alpine) {
|
|
|
7191
7196
|
}
|
|
7192
7197
|
};
|
|
7193
7198
|
});
|
|
7194
|
-
Alpine.directive("h-notification-overlay", (el, { original
|
|
7199
|
+
Alpine.directive("h-notification-overlay", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7195
7200
|
if (el.tagName !== "SECTION") {
|
|
7196
|
-
throw new Error(`${
|
|
7201
|
+
throw new Error(`${original} must be a button`);
|
|
7197
7202
|
}
|
|
7198
7203
|
const notificationTemplates = {};
|
|
7199
7204
|
el.querySelectorAll("template").forEach((template) => {
|
|
@@ -7328,17 +7333,17 @@ function notifications_default(Alpine) {
|
|
|
7328
7333
|
xlBreakpointListener.remove();
|
|
7329
7334
|
});
|
|
7330
7335
|
});
|
|
7331
|
-
Alpine.directive("h-notification-list", (el, { original
|
|
7336
|
+
Alpine.directive("h-notification-list", (el, { original }) => {
|
|
7332
7337
|
if (el.tagName !== "OL" && el.tagName !== "UL") {
|
|
7333
|
-
throw new Error(`${
|
|
7338
|
+
throw new Error(`${original} must be a list element`);
|
|
7334
7339
|
}
|
|
7335
7340
|
el.classList.add("flex", "flex-col", "divide-solid", "divide-y");
|
|
7336
7341
|
el.setAttribute("data-slot", "notification-list");
|
|
7337
7342
|
el.setAttribute("role", "group");
|
|
7338
7343
|
});
|
|
7339
|
-
Alpine.directive("h-notification", (el, { original
|
|
7344
|
+
Alpine.directive("h-notification", (el, { original, modifiers }) => {
|
|
7340
7345
|
if (el.tagName !== "LI") {
|
|
7341
|
-
throw new Error(`${
|
|
7346
|
+
throw new Error(`${original} must be a list item element`);
|
|
7342
7347
|
}
|
|
7343
7348
|
el.classList.add("pointer-events-auto", "p-3", "flex", "gap-2");
|
|
7344
7349
|
if (modifiers.includes("floating")) {
|
|
@@ -7374,7 +7379,7 @@ function notifications_default(Alpine) {
|
|
|
7374
7379
|
el.classList.add("flex", "gap-2", "data-[orientation=vertical]:flex-col");
|
|
7375
7380
|
el.setAttribute("data-slot", "notification-actions");
|
|
7376
7381
|
});
|
|
7377
|
-
Alpine.directive("h-notification-close", (el, { original
|
|
7382
|
+
Alpine.directive("h-notification-close", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7378
7383
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "notification-close");
|
|
7379
7384
|
let nId;
|
|
7380
7385
|
function close() {
|
|
@@ -7393,7 +7398,7 @@ function notifications_default(Alpine) {
|
|
|
7393
7398
|
el.removeEventListener("click", close);
|
|
7394
7399
|
});
|
|
7395
7400
|
} else {
|
|
7396
|
-
console.error(`${
|
|
7401
|
+
console.error(`${original} must be inside a notification with an id`);
|
|
7397
7402
|
}
|
|
7398
7403
|
});
|
|
7399
7404
|
}
|
|
@@ -7482,7 +7487,7 @@ function pagination_default(Alpine) {
|
|
|
7482
7487
|
// src/components/popover.js
|
|
7483
7488
|
function popover_default(Alpine) {
|
|
7484
7489
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
7485
|
-
el.
|
|
7490
|
+
el._h_popover = Alpine2.reactive({
|
|
7486
7491
|
id: void 0,
|
|
7487
7492
|
controls: `hpc${uuid_default()}`,
|
|
7488
7493
|
auto: expression ? false : true,
|
|
@@ -7492,7 +7497,7 @@ function popover_default(Alpine) {
|
|
|
7492
7497
|
const getExpanded = evaluateLater(expression);
|
|
7493
7498
|
effect(() => {
|
|
7494
7499
|
getExpanded((expanded) => {
|
|
7495
|
-
el.
|
|
7500
|
+
el._h_popover.expanded = expanded;
|
|
7496
7501
|
});
|
|
7497
7502
|
});
|
|
7498
7503
|
}
|
|
@@ -7502,33 +7507,33 @@ function popover_default(Alpine) {
|
|
|
7502
7507
|
}
|
|
7503
7508
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
7504
7509
|
if (el.hasAttribute("id")) {
|
|
7505
|
-
el.
|
|
7510
|
+
el._h_popover.id = el.getAttribute("id");
|
|
7506
7511
|
} else {
|
|
7507
|
-
el.
|
|
7508
|
-
el.setAttribute("id", el.
|
|
7512
|
+
el._h_popover.id = `hp${uuid_default()}`;
|
|
7513
|
+
el.setAttribute("id", el._h_popover.id);
|
|
7509
7514
|
}
|
|
7510
|
-
el.setAttribute("aria-controls", el.
|
|
7515
|
+
el.setAttribute("aria-controls", el._h_popover.controls);
|
|
7511
7516
|
el.setAttribute("aria-haspopup", "dialog");
|
|
7512
7517
|
const setAttributes = () => {
|
|
7513
|
-
el.setAttribute("aria-expanded", el.
|
|
7518
|
+
el.setAttribute("aria-expanded", el._h_popover.expanded);
|
|
7514
7519
|
};
|
|
7515
7520
|
const close = () => {
|
|
7516
|
-
el.
|
|
7521
|
+
el._h_popover.expanded = false;
|
|
7517
7522
|
el.addEventListener("click", handler);
|
|
7518
7523
|
setAttributes();
|
|
7519
7524
|
};
|
|
7520
7525
|
const handler = () => {
|
|
7521
|
-
el.
|
|
7526
|
+
el._h_popover.expanded = !el._h_popover.expanded;
|
|
7522
7527
|
setAttributes();
|
|
7523
7528
|
Alpine2.nextTick(() => {
|
|
7524
|
-
if (el.
|
|
7529
|
+
if (el._h_popover.auto && el._h_popover.expanded) {
|
|
7525
7530
|
top.addEventListener("click", close, { once: true });
|
|
7526
7531
|
el.removeEventListener("click", handler);
|
|
7527
7532
|
}
|
|
7528
7533
|
});
|
|
7529
7534
|
};
|
|
7530
7535
|
setAttributes();
|
|
7531
|
-
if (el.
|
|
7536
|
+
if (el._h_popover.auto) {
|
|
7532
7537
|
el.addEventListener("click", handler);
|
|
7533
7538
|
cleanup(() => {
|
|
7534
7539
|
el.removeEventListener("click", handler);
|
|
@@ -7540,16 +7545,16 @@ function popover_default(Alpine) {
|
|
|
7540
7545
|
});
|
|
7541
7546
|
}
|
|
7542
7547
|
});
|
|
7543
|
-
Alpine.directive("h-popover", (el, { original
|
|
7548
|
+
Alpine.directive("h-popover", (el, { original, modifiers }, { effect, cleanup }) => {
|
|
7544
7549
|
const popover = (() => {
|
|
7545
7550
|
let sibling = el.previousElementSibling;
|
|
7546
|
-
while (sibling && !
|
|
7551
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_h_popover")) {
|
|
7547
7552
|
sibling = sibling.previousElementSibling;
|
|
7548
7553
|
}
|
|
7549
7554
|
return sibling;
|
|
7550
7555
|
})();
|
|
7551
7556
|
if (!popover) {
|
|
7552
|
-
throw new Error(`${
|
|
7557
|
+
throw new Error(`${original} must be placed after a popover element`);
|
|
7553
7558
|
}
|
|
7554
7559
|
el.classList.add(
|
|
7555
7560
|
"absolute",
|
|
@@ -7575,8 +7580,8 @@ function popover_default(Alpine) {
|
|
|
7575
7580
|
el.setAttribute("data-slot", "popover");
|
|
7576
7581
|
el.setAttribute("role", "dialog");
|
|
7577
7582
|
el.setAttribute("tabindex", "-1");
|
|
7578
|
-
el.setAttribute("id", popover.
|
|
7579
|
-
el.setAttribute("aria-labelledby", popover.
|
|
7583
|
+
el.setAttribute("id", popover._h_popover.controls);
|
|
7584
|
+
el.setAttribute("aria-labelledby", popover._h_popover.id);
|
|
7580
7585
|
let noScroll = modifiers.includes("no-scroll");
|
|
7581
7586
|
if (noScroll) {
|
|
7582
7587
|
el.classList.remove("overflow-auto");
|
|
@@ -7614,7 +7619,7 @@ function popover_default(Alpine) {
|
|
|
7614
7619
|
});
|
|
7615
7620
|
}
|
|
7616
7621
|
effect(() => {
|
|
7617
|
-
if (popover.
|
|
7622
|
+
if (popover._h_popover.expanded) {
|
|
7618
7623
|
el.classList.remove("hidden");
|
|
7619
7624
|
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
7620
7625
|
} else {
|
|
@@ -7727,7 +7732,7 @@ function range_default(Alpine) {
|
|
|
7727
7732
|
el.classList.add("harmonia-slider");
|
|
7728
7733
|
el.setAttribute("data-slot", "range");
|
|
7729
7734
|
(0, import_nouislider.create)(el, evaluate2(expression));
|
|
7730
|
-
if (
|
|
7735
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7731
7736
|
el.noUiSlider.on("change", (values) => {
|
|
7732
7737
|
el._x_model.set(values);
|
|
7733
7738
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -7809,11 +7814,11 @@ function select_default(Alpine) {
|
|
|
7809
7814
|
});
|
|
7810
7815
|
}
|
|
7811
7816
|
});
|
|
7812
|
-
Alpine.directive("h-select-input", (el, { original
|
|
7817
|
+
Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7813
7818
|
if (el.tagName !== "INPUT") {
|
|
7814
|
-
throw new Error(`${
|
|
7819
|
+
throw new Error(`${original} must be an input of type "text"`);
|
|
7815
7820
|
}
|
|
7816
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
7821
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
7817
7822
|
const label = (() => {
|
|
7818
7823
|
const field = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "field");
|
|
7819
7824
|
if (field) {
|
|
@@ -7822,8 +7827,8 @@ function select_default(Alpine) {
|
|
|
7822
7827
|
return;
|
|
7823
7828
|
})();
|
|
7824
7829
|
if (!select) {
|
|
7825
|
-
throw new Error(`${
|
|
7826
|
-
} else if (
|
|
7830
|
+
throw new Error(`${original} must be inside a select element`);
|
|
7831
|
+
} else if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7827
7832
|
select._h_select.multiple = Array.isArray(el._x_model.get());
|
|
7828
7833
|
select._h_model.set = (value) => {
|
|
7829
7834
|
if (select._h_select.multiple) {
|
|
@@ -7921,7 +7926,7 @@ function select_default(Alpine) {
|
|
|
7921
7926
|
const onKeyDown = (event) => {
|
|
7922
7927
|
switch (event.key) {
|
|
7923
7928
|
case "Down":
|
|
7924
|
-
case "ArrowDown":
|
|
7929
|
+
case "ArrowDown": {
|
|
7925
7930
|
event.preventDefault();
|
|
7926
7931
|
let nextIndex = 0;
|
|
7927
7932
|
for (let o = 0; o < options.length; o++) {
|
|
@@ -7943,8 +7948,9 @@ function select_default(Alpine) {
|
|
|
7943
7948
|
options[nextIndex].setAttribute("tabindex", "0");
|
|
7944
7949
|
options[nextIndex].focus();
|
|
7945
7950
|
break;
|
|
7951
|
+
}
|
|
7946
7952
|
case "Up":
|
|
7947
|
-
case "ArrowUp":
|
|
7953
|
+
case "ArrowUp": {
|
|
7948
7954
|
event.preventDefault();
|
|
7949
7955
|
let prevIndex = options.length - 1;
|
|
7950
7956
|
for (let o = options.length - 1; o >= 0; o--) {
|
|
@@ -7966,6 +7972,7 @@ function select_default(Alpine) {
|
|
|
7966
7972
|
options[prevIndex].setAttribute("tabindex", "0");
|
|
7967
7973
|
options[prevIndex].focus();
|
|
7968
7974
|
break;
|
|
7975
|
+
}
|
|
7969
7976
|
case "Home":
|
|
7970
7977
|
case "PageUp":
|
|
7971
7978
|
event.preventDefault();
|
|
@@ -8082,10 +8089,10 @@ function select_default(Alpine) {
|
|
|
8082
8089
|
}
|
|
8083
8090
|
});
|
|
8084
8091
|
});
|
|
8085
|
-
Alpine.directive("h-select-content", (el, { original
|
|
8086
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8092
|
+
Alpine.directive("h-select-content", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8093
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8087
8094
|
if (!select) {
|
|
8088
|
-
throw new Error(`${
|
|
8095
|
+
throw new Error(`${original} must be inside a select element`);
|
|
8089
8096
|
}
|
|
8090
8097
|
el.classList.add(
|
|
8091
8098
|
"absolute",
|
|
@@ -8114,7 +8121,7 @@ function select_default(Alpine) {
|
|
|
8114
8121
|
el.setAttribute("id", select._h_select.controls);
|
|
8115
8122
|
el.setAttribute("tabindex", "-1");
|
|
8116
8123
|
if (!select._h_select.trigger) {
|
|
8117
|
-
throw new Error(`${
|
|
8124
|
+
throw new Error(`${original}: trigger not found`);
|
|
8118
8125
|
}
|
|
8119
8126
|
let autoUpdateCleanup;
|
|
8120
8127
|
function updatePosition() {
|
|
@@ -8175,10 +8182,10 @@ function select_default(Alpine) {
|
|
|
8175
8182
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8176
8183
|
});
|
|
8177
8184
|
});
|
|
8178
|
-
Alpine.directive("h-select-search", (el, { original
|
|
8179
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8185
|
+
Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8186
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8180
8187
|
if (!select) {
|
|
8181
|
-
throw new Error(`${
|
|
8188
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8182
8189
|
} else {
|
|
8183
8190
|
select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
|
|
8184
8191
|
}
|
|
@@ -8243,17 +8250,17 @@ function select_default(Alpine) {
|
|
|
8243
8250
|
Alpine.directive("h-select-label", (el) => {
|
|
8244
8251
|
el.classList.add("text-muted-foreground", "px-2", "py-1.5", "text-xs");
|
|
8245
8252
|
el.setAttribute("data-slot", "select-label");
|
|
8246
|
-
const selectGroup = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8253
|
+
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_selectGroup"));
|
|
8247
8254
|
if (selectGroup) {
|
|
8248
8255
|
const id = `hsl${uuid_default()}`;
|
|
8249
8256
|
el.setAttribute("id", id);
|
|
8250
8257
|
selectGroup._h_selectGroup.labelledby = id;
|
|
8251
8258
|
}
|
|
8252
8259
|
});
|
|
8253
|
-
Alpine.directive("h-select-option", (el, { original
|
|
8254
|
-
const select = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8260
|
+
Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
|
|
8261
|
+
const select = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8255
8262
|
if (!select) {
|
|
8256
|
-
throw new Error(`${
|
|
8263
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8257
8264
|
}
|
|
8258
8265
|
el.classList.add(
|
|
8259
8266
|
"focus:bg-primary",
|
|
@@ -8449,10 +8456,10 @@ function sheet_default(Alpine) {
|
|
|
8449
8456
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8450
8457
|
});
|
|
8451
8458
|
});
|
|
8452
|
-
Alpine.directive("h-sheet", (el, { original
|
|
8453
|
-
const overlay = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8459
|
+
Alpine.directive("h-sheet", (el, { original }, { effect, cleanup }) => {
|
|
8460
|
+
const overlay = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sheet_overlay"));
|
|
8454
8461
|
if (!overlay) {
|
|
8455
|
-
throw new Error(`${
|
|
8462
|
+
throw new Error(`${original} must be placed inside a sheet overlay`);
|
|
8456
8463
|
}
|
|
8457
8464
|
el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
|
|
8458
8465
|
el.setAttribute("data-slot", "sheet");
|
|
@@ -8575,10 +8582,10 @@ function sidebar_default(Alpine) {
|
|
|
8575
8582
|
});
|
|
8576
8583
|
}
|
|
8577
8584
|
});
|
|
8578
|
-
Alpine.directive("h-sidebar-group-label", (el, { original
|
|
8579
|
-
const group = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8585
|
+
Alpine.directive("h-sidebar-group-label", (el, { original }, { cleanup }) => {
|
|
8586
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_group"));
|
|
8580
8587
|
if (!group) {
|
|
8581
|
-
throw new Error(`${
|
|
8588
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8582
8589
|
}
|
|
8583
8590
|
el.classList.add(
|
|
8584
8591
|
"ring-sidebar-ring",
|
|
@@ -8667,10 +8674,10 @@ function sidebar_default(Alpine) {
|
|
|
8667
8674
|
}
|
|
8668
8675
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
8669
8676
|
});
|
|
8670
|
-
Alpine.directive("h-sidebar-group-content", (el, { original
|
|
8671
|
-
const group = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8677
|
+
Alpine.directive("h-sidebar-group-content", (el, { original }, { effect }) => {
|
|
8678
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_group"));
|
|
8672
8679
|
if (!group) {
|
|
8673
|
-
throw new Error(`${
|
|
8680
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8674
8681
|
}
|
|
8675
8682
|
el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
|
|
8676
8683
|
el.setAttribute("data-slot", "sidebar-group-content");
|
|
@@ -8683,16 +8690,16 @@ function sidebar_default(Alpine) {
|
|
|
8683
8690
|
});
|
|
8684
8691
|
}
|
|
8685
8692
|
});
|
|
8686
|
-
Alpine.directive("h-sidebar-menu", (el, { original
|
|
8693
|
+
Alpine.directive("h-sidebar-menu", (el, { original }) => {
|
|
8687
8694
|
if (el.tagName !== "UL") {
|
|
8688
|
-
throw new Error(`${
|
|
8695
|
+
throw new Error(`${original} must be an ul element`);
|
|
8689
8696
|
}
|
|
8690
8697
|
el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
|
|
8691
8698
|
el.setAttribute("data-slot", "sidebar-menu");
|
|
8692
8699
|
});
|
|
8693
|
-
Alpine.directive("h-sidebar-menu-item", (el, { original
|
|
8700
|
+
Alpine.directive("h-sidebar-menu-item", (el, { original, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
8694
8701
|
if (el.tagName !== "LI") {
|
|
8695
|
-
throw new Error(`${
|
|
8702
|
+
throw new Error(`${original} must be a li element`);
|
|
8696
8703
|
}
|
|
8697
8704
|
el._h_sidebar_menu_item = {
|
|
8698
8705
|
isSub: false,
|
|
@@ -8728,13 +8735,13 @@ function sidebar_default(Alpine) {
|
|
|
8728
8735
|
});
|
|
8729
8736
|
}
|
|
8730
8737
|
});
|
|
8731
|
-
Alpine.directive("h-sidebar-menu-button", (el, { original
|
|
8738
|
+
Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
8732
8739
|
if (el.tagName !== "BUTTON" && el.tagName !== "A") {
|
|
8733
|
-
throw new Error(`${
|
|
8740
|
+
throw new Error(`${original} must be a button or a link`);
|
|
8734
8741
|
} else if (el.tagName === "BUTTON") {
|
|
8735
8742
|
el.setAttribute("type", "button");
|
|
8736
8743
|
}
|
|
8737
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8744
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8738
8745
|
el.classList.add(
|
|
8739
8746
|
"flex",
|
|
8740
8747
|
"w-full",
|
|
@@ -8767,7 +8774,7 @@ function sidebar_default(Alpine) {
|
|
|
8767
8774
|
lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
|
|
8768
8775
|
};
|
|
8769
8776
|
function setSize2(size3) {
|
|
8770
|
-
if (
|
|
8777
|
+
if (Object.prototype.hasOwnProperty.call(sizes, size3)) {
|
|
8771
8778
|
el.classList.add(...sizes[size3]);
|
|
8772
8779
|
}
|
|
8773
8780
|
}
|
|
@@ -8868,9 +8875,9 @@ function sidebar_default(Alpine) {
|
|
|
8868
8875
|
}
|
|
8869
8876
|
el.setAttribute("data-slot", "sidebar-menu-action");
|
|
8870
8877
|
});
|
|
8871
|
-
Alpine.directive("h-sidebar-menu-badge", (el, { original
|
|
8878
|
+
Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
|
|
8872
8879
|
if (el.tagName !== "SPAN") {
|
|
8873
|
-
throw new Error(`${
|
|
8880
|
+
throw new Error(`${original} must be a span element`);
|
|
8874
8881
|
}
|
|
8875
8882
|
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");
|
|
8876
8883
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
@@ -8896,13 +8903,13 @@ function sidebar_default(Alpine) {
|
|
|
8896
8903
|
el.setAttribute("data-slot", "sidebar-separator");
|
|
8897
8904
|
el.setAttribute("role", "none");
|
|
8898
8905
|
});
|
|
8899
|
-
Alpine.directive("h-sidebar-menu-sub", (el, { original
|
|
8906
|
+
Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
8900
8907
|
if (el.tagName !== "UL") {
|
|
8901
|
-
throw new Error(`${
|
|
8908
|
+
throw new Error(`${original} must be an ul element`);
|
|
8902
8909
|
}
|
|
8903
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8910
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8904
8911
|
if (!menuItem) {
|
|
8905
|
-
throw new Error(`${
|
|
8912
|
+
throw new Error(`${original} must be placed inside a sidebar menu item`);
|
|
8906
8913
|
}
|
|
8907
8914
|
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");
|
|
8908
8915
|
if (el.getAttribute("data-line") !== "false") {
|
|
@@ -8977,7 +8984,7 @@ function spinner_default(Alpine) {
|
|
|
8977
8984
|
|
|
8978
8985
|
// src/components/split.js
|
|
8979
8986
|
function split_default(Alpine) {
|
|
8980
|
-
Alpine.directive("h-split", (el,
|
|
8987
|
+
Alpine.directive("h-split", (el, _, { cleanup, Alpine: Alpine2 }) => {
|
|
8981
8988
|
const panels = [];
|
|
8982
8989
|
const state = Alpine2.reactive({
|
|
8983
8990
|
isHorizontal: el.getAttribute("data-orientation") === "horizontal",
|
|
@@ -9173,10 +9180,10 @@ function split_default(Alpine) {
|
|
|
9173
9180
|
observer.disconnect();
|
|
9174
9181
|
});
|
|
9175
9182
|
});
|
|
9176
|
-
Alpine.directive("h-split-panel", (el, { original
|
|
9177
|
-
const split = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
9183
|
+
Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
9184
|
+
const split = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_split"));
|
|
9178
9185
|
if (!split) {
|
|
9179
|
-
throw new Error(`${
|
|
9186
|
+
throw new Error(`${original} must be inside an split element`);
|
|
9180
9187
|
}
|
|
9181
9188
|
el.classList.add(
|
|
9182
9189
|
"flex",
|
|
@@ -9727,7 +9734,7 @@ function tabs_default(Alpine) {
|
|
|
9727
9734
|
el.setAttribute("role", "tablist");
|
|
9728
9735
|
el.setAttribute("data-slot", "tab-list");
|
|
9729
9736
|
});
|
|
9730
|
-
Alpine.directive("h-tab", (el, { original
|
|
9737
|
+
Alpine.directive("h-tab", (el, { original }) => {
|
|
9731
9738
|
el.classList.add(
|
|
9732
9739
|
"cursor-pointer",
|
|
9733
9740
|
"focus-visible:border-ring",
|
|
@@ -9776,8 +9783,8 @@ function tabs_default(Alpine) {
|
|
|
9776
9783
|
);
|
|
9777
9784
|
el.setAttribute("role", "tab");
|
|
9778
9785
|
el.setAttribute("data-slot", "tab");
|
|
9779
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9780
|
-
if (!el.hasAttribute("aria-controls")) throw new Error(`${
|
|
9786
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tabs must have an id`);
|
|
9787
|
+
if (!el.hasAttribute("aria-controls")) throw new Error(`${original}: aria-controls must be set to the tab-content id.`);
|
|
9781
9788
|
});
|
|
9782
9789
|
Alpine.directive("h-tab-action", (el) => {
|
|
9783
9790
|
el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
|
|
@@ -9811,13 +9818,13 @@ function tabs_default(Alpine) {
|
|
|
9811
9818
|
el.setAttribute("role", "button");
|
|
9812
9819
|
el.setAttribute("data-slot", "tab-list-action");
|
|
9813
9820
|
});
|
|
9814
|
-
Alpine.directive("h-tabs-content", (el, { original
|
|
9821
|
+
Alpine.directive("h-tabs-content", (el, { original }) => {
|
|
9815
9822
|
el.classList.add("flex-1", "outline-none");
|
|
9816
9823
|
el.setAttribute("role", "tabpanel");
|
|
9817
9824
|
el.setAttribute("tabindex", "0");
|
|
9818
9825
|
el.setAttribute("data-slot", "tabs-content");
|
|
9819
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9820
|
-
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${
|
|
9826
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tab content must have an id`);
|
|
9827
|
+
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original}: aria-labelledby must be set to the tab id.`);
|
|
9821
9828
|
});
|
|
9822
9829
|
}
|
|
9823
9830
|
|
|
@@ -10228,13 +10235,13 @@ function timepicker_default(Alpine) {
|
|
|
10228
10235
|
top.removeEventListener("click", el._h_timepicker.close);
|
|
10229
10236
|
});
|
|
10230
10237
|
});
|
|
10231
|
-
Alpine.directive("h-time-picker-input", (el, { original
|
|
10238
|
+
Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10232
10239
|
if (el.tagName !== "INPUT") {
|
|
10233
|
-
throw new Error(`${
|
|
10240
|
+
throw new Error(`${original} must be a readonly input of type "text"`);
|
|
10234
10241
|
}
|
|
10235
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10242
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10236
10243
|
if (!timepicker) {
|
|
10237
|
-
throw new Error(`${
|
|
10244
|
+
throw new Error(`${original} must be inside a time-picker element`);
|
|
10238
10245
|
}
|
|
10239
10246
|
timepicker._h_timepicker.focusInput = () => {
|
|
10240
10247
|
el.focus();
|
|
@@ -10244,7 +10251,7 @@ function timepicker_default(Alpine) {
|
|
|
10244
10251
|
el.dispatchEvent(new Event("change"));
|
|
10245
10252
|
});
|
|
10246
10253
|
};
|
|
10247
|
-
if (
|
|
10254
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
10248
10255
|
timepicker._h_timepicker.model = el._x_model;
|
|
10249
10256
|
} else {
|
|
10250
10257
|
timepicker._h_timepicker.model = {
|
|
@@ -10332,7 +10339,7 @@ function timepicker_default(Alpine) {
|
|
|
10332
10339
|
});
|
|
10333
10340
|
});
|
|
10334
10341
|
Alpine.directive("h-time-picker-popup", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10335
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10342
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10336
10343
|
el.classList.add(
|
|
10337
10344
|
"overflow-hidden",
|
|
10338
10345
|
"outline-none",
|
|
@@ -10432,7 +10439,7 @@ function timepicker_default(Alpine) {
|
|
|
10432
10439
|
}
|
|
10433
10440
|
switch (event.key) {
|
|
10434
10441
|
case "Up":
|
|
10435
|
-
case "ArrowUp":
|
|
10442
|
+
case "ArrowUp": {
|
|
10436
10443
|
event.target.setAttribute("tabindex", "-1");
|
|
10437
10444
|
let prevElem = event.target.previousElementSibling;
|
|
10438
10445
|
if (prevElem === null || prevElem.classList.contains("hidden")) {
|
|
@@ -10445,8 +10452,9 @@ function timepicker_default(Alpine) {
|
|
|
10445
10452
|
prevElem.setAttribute("tabindex", "0");
|
|
10446
10453
|
prevElem.focus();
|
|
10447
10454
|
break;
|
|
10455
|
+
}
|
|
10448
10456
|
case "Down":
|
|
10449
|
-
case "ArrowDown":
|
|
10457
|
+
case "ArrowDown": {
|
|
10450
10458
|
event.target.setAttribute("tabindex", "-1");
|
|
10451
10459
|
let nextElem = event.target.nextElementSibling;
|
|
10452
10460
|
if (nextElem === null || nextElem.classList.contains("hidden")) {
|
|
@@ -10459,8 +10467,9 @@ function timepicker_default(Alpine) {
|
|
|
10459
10467
|
nextElem.setAttribute("tabindex", "0");
|
|
10460
10468
|
nextElem.focus();
|
|
10461
10469
|
break;
|
|
10470
|
+
}
|
|
10462
10471
|
case "Home":
|
|
10463
|
-
case "PageUp":
|
|
10472
|
+
case "PageUp": {
|
|
10464
10473
|
let firstChild;
|
|
10465
10474
|
if (list.firstChild === event.target) {
|
|
10466
10475
|
break;
|
|
@@ -10477,8 +10486,9 @@ function timepicker_default(Alpine) {
|
|
|
10477
10486
|
firstChild.setAttribute("tabindex", "0");
|
|
10478
10487
|
firstChild.focus();
|
|
10479
10488
|
break;
|
|
10489
|
+
}
|
|
10480
10490
|
case "End":
|
|
10481
|
-
case "PageDown":
|
|
10491
|
+
case "PageDown": {
|
|
10482
10492
|
let lastElem;
|
|
10483
10493
|
if (list.lastChild === event.target) {
|
|
10484
10494
|
break;
|
|
@@ -10495,22 +10505,25 @@ function timepicker_default(Alpine) {
|
|
|
10495
10505
|
lastElem.setAttribute("tabindex", "0");
|
|
10496
10506
|
lastElem.focus();
|
|
10497
10507
|
break;
|
|
10508
|
+
}
|
|
10498
10509
|
case "Right":
|
|
10499
|
-
case "ArrowRight":
|
|
10510
|
+
case "ArrowRight": {
|
|
10500
10511
|
let nextColumn = event.target.parentElement.nextElementSibling;
|
|
10501
10512
|
if (nextColumn) {
|
|
10502
10513
|
const child = nextColumn.querySelector('li[tabindex="0"]');
|
|
10503
10514
|
child.focus();
|
|
10504
10515
|
}
|
|
10505
10516
|
break;
|
|
10517
|
+
}
|
|
10506
10518
|
case "Left":
|
|
10507
|
-
case "ArrowLeft":
|
|
10519
|
+
case "ArrowLeft": {
|
|
10508
10520
|
let prevColumn = event.target.parentElement.previousElementSibling;
|
|
10509
10521
|
if (prevColumn) {
|
|
10510
10522
|
const child = prevColumn.querySelector('li[tabindex="0"]');
|
|
10511
10523
|
child.focus();
|
|
10512
10524
|
}
|
|
10513
10525
|
break;
|
|
10526
|
+
}
|
|
10514
10527
|
case "Enter":
|
|
10515
10528
|
case " ":
|
|
10516
10529
|
event.target.click();
|
|
@@ -10911,16 +10924,16 @@ function tooltip_default(Alpine) {
|
|
|
10911
10924
|
el.removeEventListener("pointerleave", handler);
|
|
10912
10925
|
});
|
|
10913
10926
|
});
|
|
10914
|
-
Alpine.directive("h-tooltip", (el, { original
|
|
10927
|
+
Alpine.directive("h-tooltip", (el, { original }, { effect, cleanup }) => {
|
|
10915
10928
|
const tooltip = (() => {
|
|
10916
10929
|
let sibling = el.previousElementSibling;
|
|
10917
|
-
while (sibling && !
|
|
10930
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_tooltip")) {
|
|
10918
10931
|
sibling = sibling.previousElementSibling;
|
|
10919
10932
|
}
|
|
10920
10933
|
return sibling;
|
|
10921
10934
|
})();
|
|
10922
10935
|
if (!tooltip) {
|
|
10923
|
-
throw new Error(`${
|
|
10936
|
+
throw new Error(`${original} must be placed after a tooltip trigger element`);
|
|
10924
10937
|
}
|
|
10925
10938
|
el.classList.add(
|
|
10926
10939
|
"absolute",
|
|
@@ -11025,7 +11038,7 @@ function tree_default(Alpine) {
|
|
|
11025
11038
|
);
|
|
11026
11039
|
el.setAttribute("data-slot", "subtree");
|
|
11027
11040
|
el.setAttribute("role", "group");
|
|
11028
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11041
|
+
const treeItem = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_tree_item"));
|
|
11029
11042
|
effect(() => {
|
|
11030
11043
|
if (treeItem._h_tree_item.expanded) {
|
|
11031
11044
|
el.classList.remove("!hidden");
|
|
@@ -11165,9 +11178,9 @@ function tree_default(Alpine) {
|
|
|
11165
11178
|
});
|
|
11166
11179
|
}
|
|
11167
11180
|
});
|
|
11168
|
-
Alpine.directive("h-tree-button", (el, { original
|
|
11169
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11170
|
-
if (!treeItem) throw new Error(`${
|
|
11181
|
+
Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
|
|
11182
|
+
const treeItem = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_tree_item"));
|
|
11183
|
+
if (!treeItem) throw new Error(`${original} must be inside a tree item`);
|
|
11171
11184
|
el.classList.add(
|
|
11172
11185
|
"flex",
|
|
11173
11186
|
"w-full",
|
|
@@ -11231,7 +11244,7 @@ function tree_default(Alpine) {
|
|
|
11231
11244
|
}
|
|
11232
11245
|
|
|
11233
11246
|
// package.json
|
|
11234
|
-
var version = "1.9.
|
|
11247
|
+
var version = "1.9.1";
|
|
11235
11248
|
|
|
11236
11249
|
// src/utils/theme.js
|
|
11237
11250
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
@@ -11324,7 +11337,7 @@ function focus_default(Alpine) {
|
|
|
11324
11337
|
|
|
11325
11338
|
// src/utils/include.js
|
|
11326
11339
|
function include_default(Alpine) {
|
|
11327
|
-
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
11340
|
+
Alpine.directive("h-include", (el, { original, modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
11328
11341
|
const getUrl = evaluateLater(expression);
|
|
11329
11342
|
function executeScript(oldScript) {
|
|
11330
11343
|
return new Promise((resolve, reject) => {
|
|
@@ -11399,7 +11412,7 @@ function include_default(Alpine) {
|
|
|
11399
11412
|
|
|
11400
11413
|
// src/utils/template.js
|
|
11401
11414
|
function template_default(Alpine) {
|
|
11402
|
-
Alpine.directive("h-template", (el, { original
|
|
11415
|
+
Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
11403
11416
|
if (el.hasAttribute(Alpine2.prefixed("data"))) {
|
|
11404
11417
|
const template = evaluate2(expression);
|
|
11405
11418
|
const clone = template.content.cloneNode(true).firstElementChild;
|
|
@@ -11413,7 +11426,7 @@ function template_default(Alpine) {
|
|
|
11413
11426
|
clone.remove();
|
|
11414
11427
|
});
|
|
11415
11428
|
} else {
|
|
11416
|
-
console.error(`${
|
|
11429
|
+
console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
|
|
11417
11430
|
}
|
|
11418
11431
|
});
|
|
11419
11432
|
}
|