@codbex/harmonia 1.8.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.css +1 -1
- package/dist/harmonia.esm.js +314 -206
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +3 -3
- package/dist/harmonia.js +314 -206
- 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");
|
|
@@ -2838,7 +2838,8 @@ function badge_default(Alpine) {
|
|
|
2838
2838
|
"focus-visible:border-ring",
|
|
2839
2839
|
"focus-visible:ring-ring/50",
|
|
2840
2840
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
2841
|
-
"transition-
|
|
2841
|
+
"transition-colors",
|
|
2842
|
+
"transition-shadow",
|
|
2842
2843
|
"motion-reduce:transition-none",
|
|
2843
2844
|
"overflow-hidden"
|
|
2844
2845
|
);
|
|
@@ -2856,7 +2857,7 @@ function badge_default(Alpine) {
|
|
|
2856
2857
|
for (const [_2, value] of Object.entries(variants)) {
|
|
2857
2858
|
el.classList.remove(...value);
|
|
2858
2859
|
}
|
|
2859
|
-
if (
|
|
2860
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
2860
2861
|
}
|
|
2861
2862
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
2862
2863
|
const observer = new MutationObserver(() => {
|
|
@@ -2909,7 +2910,7 @@ function badge_default(Alpine) {
|
|
|
2909
2910
|
for (const [_2, value] of Object.entries(variants)) {
|
|
2910
2911
|
el.classList.remove(...value);
|
|
2911
2912
|
}
|
|
2912
|
-
if (
|
|
2913
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
2913
2914
|
}
|
|
2914
2915
|
setVariant(el.getAttribute("data-variant") ?? "primary");
|
|
2915
2916
|
const observer = new MutationObserver(() => {
|
|
@@ -2927,6 +2928,7 @@ var buttonVariants = {
|
|
|
2927
2928
|
default: [
|
|
2928
2929
|
"bg-secondary",
|
|
2929
2930
|
"text-secondary-foreground",
|
|
2931
|
+
"fill-secondary-foreground",
|
|
2930
2932
|
"shadow-button",
|
|
2931
2933
|
"hover:bg-secondary-hover",
|
|
2932
2934
|
"active:bg-secondary-active",
|
|
@@ -2938,6 +2940,7 @@ var buttonVariants = {
|
|
|
2938
2940
|
primary: [
|
|
2939
2941
|
"bg-primary",
|
|
2940
2942
|
"text-primary-foreground",
|
|
2943
|
+
"fill-primary-foreground",
|
|
2941
2944
|
"shadow-button",
|
|
2942
2945
|
"focus-visible:outline-primary/50",
|
|
2943
2946
|
"hover:bg-primary-hover",
|
|
@@ -2950,6 +2953,7 @@ var buttonVariants = {
|
|
|
2950
2953
|
positive: [
|
|
2951
2954
|
"bg-positive",
|
|
2952
2955
|
"text-positive-foreground",
|
|
2956
|
+
"fill-positive-foreground",
|
|
2953
2957
|
"shadow-button",
|
|
2954
2958
|
"focus-visible:outline-positive/50",
|
|
2955
2959
|
"hover:bg-positive-hover",
|
|
@@ -2962,6 +2966,7 @@ var buttonVariants = {
|
|
|
2962
2966
|
negative: [
|
|
2963
2967
|
"bg-negative",
|
|
2964
2968
|
"text-negative-foreground",
|
|
2969
|
+
"fill-negative-foreground",
|
|
2965
2970
|
"shadow-button",
|
|
2966
2971
|
"focus-visible:outline-negative/50",
|
|
2967
2972
|
"hover:bg-negative-hover",
|
|
@@ -2974,6 +2979,7 @@ var buttonVariants = {
|
|
|
2974
2979
|
warning: [
|
|
2975
2980
|
"bg-warning",
|
|
2976
2981
|
"text-warning-foreground",
|
|
2982
|
+
"fill-warning-foreground",
|
|
2977
2983
|
"shadow-button",
|
|
2978
2984
|
"focus-visible:outline-warning/50",
|
|
2979
2985
|
"hover:bg-warning-hover",
|
|
@@ -2986,6 +2992,7 @@ var buttonVariants = {
|
|
|
2986
2992
|
information: [
|
|
2987
2993
|
"bg-information",
|
|
2988
2994
|
"text-information-foreground",
|
|
2995
|
+
"fill-information-foreground",
|
|
2989
2996
|
"shadow-button",
|
|
2990
2997
|
"focus-visible:outline-information/50",
|
|
2991
2998
|
"hover:bg-information-hover",
|
|
@@ -2999,25 +3006,49 @@ var buttonVariants = {
|
|
|
2999
3006
|
"border",
|
|
3000
3007
|
"bg-background",
|
|
3001
3008
|
"text-foreground",
|
|
3009
|
+
"fill-foreground",
|
|
3002
3010
|
"hover:bg-secondary",
|
|
3003
3011
|
"hover:text-secondary-foreground",
|
|
3012
|
+
"hover:fill-secondary-foreground",
|
|
3004
3013
|
"active:bg-secondary-active",
|
|
3014
|
+
"active:text-secondary-foreground",
|
|
3015
|
+
"active:fill-secondary-foreground",
|
|
3005
3016
|
"aria-pressed:bg-secondary-active",
|
|
3017
|
+
"aria-pressed:text-secondary-foreground",
|
|
3018
|
+
"aria-pressed:fill-secondary-foreground",
|
|
3006
3019
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
3020
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
3021
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
3007
3022
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
3008
|
-
"data-[toggled=true]:
|
|
3023
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
3024
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
3025
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
3026
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
3027
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
3009
3028
|
],
|
|
3010
3029
|
transparent: [
|
|
3011
3030
|
"bg-transparent",
|
|
3012
3031
|
"text-foreground",
|
|
3032
|
+
"fill-foreground",
|
|
3013
3033
|
"shadow-none",
|
|
3014
3034
|
"hover:bg-secondary",
|
|
3015
3035
|
"hover:text-secondary-foreground",
|
|
3036
|
+
"hover:fill-secondary-foreground",
|
|
3016
3037
|
"active:bg-secondary-active",
|
|
3038
|
+
"active:text-secondary-foreground",
|
|
3039
|
+
"active:fill-secondary-foreground",
|
|
3017
3040
|
"aria-pressed:bg-secondary-active",
|
|
3041
|
+
"aria-pressed:text-secondary-foreground",
|
|
3042
|
+
"aria-pressed:fill-secondary-foreground",
|
|
3018
3043
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
3044
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
3045
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
3019
3046
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
3020
|
-
"data-[toggled=true]:
|
|
3047
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
3048
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
3049
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
3050
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
3051
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
3021
3052
|
],
|
|
3022
3053
|
link: ["text-primary", "underline-offset-4", "hover:underline"]
|
|
3023
3054
|
};
|
|
@@ -3033,6 +3064,7 @@ var setButtonClasses = (el) => {
|
|
|
3033
3064
|
"text-sm",
|
|
3034
3065
|
"font-medium",
|
|
3035
3066
|
"transition-all",
|
|
3067
|
+
"duration-100",
|
|
3036
3068
|
"motion-reduce:transition-none",
|
|
3037
3069
|
"disabled:pointer-events-none",
|
|
3038
3070
|
"disabled:opacity-50",
|
|
@@ -3068,7 +3100,7 @@ var getButtonSize = (size3, isAddon = false) => {
|
|
|
3068
3100
|
}
|
|
3069
3101
|
};
|
|
3070
3102
|
function button_default(Alpine) {
|
|
3071
|
-
Alpine.directive("h-button", (el, { original
|
|
3103
|
+
Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
|
|
3072
3104
|
setButtonClasses(el);
|
|
3073
3105
|
if (!el.hasAttribute("data-slot")) {
|
|
3074
3106
|
el.setAttribute("data-slot", "button");
|
|
@@ -3079,13 +3111,13 @@ function button_default(Alpine) {
|
|
|
3079
3111
|
for (const [_, value] of Object.entries(buttonVariants)) {
|
|
3080
3112
|
el.classList.remove(...value);
|
|
3081
3113
|
}
|
|
3082
|
-
if (
|
|
3114
|
+
if (Object.prototype.hasOwnProperty.call(buttonVariants, variant)) el.classList.add(...buttonVariants[variant]);
|
|
3083
3115
|
}
|
|
3084
3116
|
function setSize2(size3 = "default") {
|
|
3085
3117
|
el.classList.remove(...getButtonSize(lastSize, isAddon));
|
|
3086
3118
|
el.classList.add(...getButtonSize(size3, isAddon));
|
|
3087
3119
|
if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
3088
|
-
console.error(`${
|
|
3120
|
+
console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
|
|
3089
3121
|
}
|
|
3090
3122
|
lastSize = size3;
|
|
3091
3123
|
}
|
|
@@ -3138,7 +3170,7 @@ function button_default(Alpine) {
|
|
|
3138
3170
|
for (const [_, value] of Object.entries(variants)) {
|
|
3139
3171
|
el.classList.remove(...value);
|
|
3140
3172
|
}
|
|
3141
|
-
if (
|
|
3173
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
3142
3174
|
}
|
|
3143
3175
|
setVariant(el.getAttribute("data-orientation") ?? "horizontal");
|
|
3144
3176
|
});
|
|
@@ -3164,8 +3196,8 @@ var oppositeSideMap = {
|
|
|
3164
3196
|
bottom: "top",
|
|
3165
3197
|
top: "bottom"
|
|
3166
3198
|
};
|
|
3167
|
-
function clamp(start, value,
|
|
3168
|
-
return max(start, min(value,
|
|
3199
|
+
function clamp(start, value, end) {
|
|
3200
|
+
return max(start, min(value, end));
|
|
3169
3201
|
}
|
|
3170
3202
|
function evaluate(value, param) {
|
|
3171
3203
|
return typeof value === "function" ? value(param) : value;
|
|
@@ -4639,8 +4671,8 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
4639
4671
|
|
|
4640
4672
|
// src/components/calendar.js
|
|
4641
4673
|
function calendar_default(Alpine) {
|
|
4642
|
-
Alpine.directive("h-calendar", (el, { original
|
|
4643
|
-
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"));
|
|
4644
4676
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
4645
4677
|
el.setAttribute("tabindex", "-1");
|
|
4646
4678
|
if (datepicker) {
|
|
@@ -4697,7 +4729,7 @@ function calendar_default(Alpine) {
|
|
|
4697
4729
|
const onInputChange = () => {
|
|
4698
4730
|
const newValue = new Date(datepicker._h_datepicker.input.value);
|
|
4699
4731
|
if (isNaN(newValue)) {
|
|
4700
|
-
console.error(`${
|
|
4732
|
+
console.error(`${original}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
|
|
4701
4733
|
datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4702
4734
|
return;
|
|
4703
4735
|
} else if (selected.getTime() !== newValue.getTime()) {
|
|
@@ -4713,7 +4745,7 @@ function calendar_default(Alpine) {
|
|
|
4713
4745
|
function setFromModel() {
|
|
4714
4746
|
selected = new Date(el._x_model.get());
|
|
4715
4747
|
if (isNaN(selected)) {
|
|
4716
|
-
console.error(`${
|
|
4748
|
+
console.error(`${original}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4717
4749
|
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4718
4750
|
else el.setAttribute("data-invalid", "true");
|
|
4719
4751
|
} else if (datepicker) {
|
|
@@ -4721,7 +4753,7 @@ function calendar_default(Alpine) {
|
|
|
4721
4753
|
}
|
|
4722
4754
|
}
|
|
4723
4755
|
function checkForModel() {
|
|
4724
|
-
if (
|
|
4756
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model") && el._x_model.get()) {
|
|
4725
4757
|
setFromModel();
|
|
4726
4758
|
}
|
|
4727
4759
|
}
|
|
@@ -4925,8 +4957,8 @@ function calendar_default(Alpine) {
|
|
|
4925
4957
|
const year = date.getFullYear();
|
|
4926
4958
|
const month = date.getMonth();
|
|
4927
4959
|
const start = new Date(year, month, 1);
|
|
4928
|
-
const
|
|
4929
|
-
const days =
|
|
4960
|
+
const end = new Date(year, month + 1, 0);
|
|
4961
|
+
const days = end.getDate();
|
|
4930
4962
|
const prevEndDay = new Date(year, month, 1);
|
|
4931
4963
|
prevEndDay.setDate(prevEndDay.getDate() - 1);
|
|
4932
4964
|
let lastPrevMonthDay = prevEndDay.getDate();
|
|
@@ -5033,7 +5065,7 @@ function calendar_default(Alpine) {
|
|
|
5033
5065
|
break;
|
|
5034
5066
|
case "End":
|
|
5035
5067
|
event.preventDefault();
|
|
5036
|
-
newDay.setDate(
|
|
5068
|
+
newDay.setDate(new Date(newDay.getFullYear(), newDay.getMonth() + 1, 0).getDate());
|
|
5037
5069
|
break;
|
|
5038
5070
|
case "PageUp":
|
|
5039
5071
|
event.preventDefault();
|
|
@@ -5142,7 +5174,7 @@ function calendar_default(Alpine) {
|
|
|
5142
5174
|
if (datepicker) {
|
|
5143
5175
|
el.addEventListener("transitionend", onTransitionEnd);
|
|
5144
5176
|
}
|
|
5145
|
-
if (
|
|
5177
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
5146
5178
|
const modelExpression = el.getAttribute("x-model");
|
|
5147
5179
|
const evaluateModel = evaluateLater(modelExpression);
|
|
5148
5180
|
effect(() => {
|
|
@@ -5271,7 +5303,7 @@ function sizeObserver(el) {
|
|
|
5271
5303
|
|
|
5272
5304
|
// src/components/datepicker.js
|
|
5273
5305
|
function datepicker_default(Alpine) {
|
|
5274
|
-
Alpine.directive("h-date-picker", (el, { original
|
|
5306
|
+
Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
5275
5307
|
const state = Alpine2.reactive({
|
|
5276
5308
|
expanded: false
|
|
5277
5309
|
});
|
|
@@ -5284,7 +5316,7 @@ function datepicker_default(Alpine) {
|
|
|
5284
5316
|
};
|
|
5285
5317
|
el._h_datepicker.input = el.querySelector("input");
|
|
5286
5318
|
if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
|
|
5287
|
-
throw new Error(`${
|
|
5319
|
+
throw new Error(`${original} must contain an input`);
|
|
5288
5320
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
5289
5321
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
5290
5322
|
} else {
|
|
@@ -5297,7 +5329,8 @@ function datepicker_default(Alpine) {
|
|
|
5297
5329
|
"border-input",
|
|
5298
5330
|
"flex",
|
|
5299
5331
|
"items-center",
|
|
5300
|
-
"transition-
|
|
5332
|
+
"transition-colors",
|
|
5333
|
+
"transition-shadow",
|
|
5301
5334
|
"motion-reduce:transition-none",
|
|
5302
5335
|
"duration-200",
|
|
5303
5336
|
"outline-none",
|
|
@@ -5362,18 +5395,31 @@ function datepicker_default(Alpine) {
|
|
|
5362
5395
|
observer.disconnect();
|
|
5363
5396
|
});
|
|
5364
5397
|
});
|
|
5365
|
-
Alpine.directive("h-date-picker-trigger", (el, { original
|
|
5398
|
+
Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
5366
5399
|
if (el.tagName !== "BUTTON") {
|
|
5367
|
-
throw new Error(`${
|
|
5400
|
+
throw new Error(`${original} must be a button`);
|
|
5368
5401
|
}
|
|
5369
5402
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5370
|
-
throw new Error(`${
|
|
5403
|
+
throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5371
5404
|
}
|
|
5372
|
-
const datepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5405
|
+
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_datepicker"));
|
|
5373
5406
|
if (!datepicker) {
|
|
5374
|
-
throw new Error(`${
|
|
5407
|
+
throw new Error(`${original} must be inside an date-picker element`);
|
|
5375
5408
|
}
|
|
5376
|
-
el.classList.add(
|
|
5409
|
+
el.classList.add(
|
|
5410
|
+
"cursor-pointer",
|
|
5411
|
+
"inline-flex",
|
|
5412
|
+
"items-center",
|
|
5413
|
+
"justify-center",
|
|
5414
|
+
"h-full",
|
|
5415
|
+
"aspect-square",
|
|
5416
|
+
"bg-transparent",
|
|
5417
|
+
"hover:bg-secondary",
|
|
5418
|
+
"hover:text-secondary-foreground",
|
|
5419
|
+
"active:bg-secondary-active",
|
|
5420
|
+
"active:text-secondary-foreground",
|
|
5421
|
+
"outline-none"
|
|
5422
|
+
);
|
|
5377
5423
|
if (datepicker._h_datepicker.inTable) {
|
|
5378
5424
|
el.classList.add(
|
|
5379
5425
|
"focus-visible:inset-ring-ring/50",
|
|
@@ -5404,7 +5450,7 @@ function datepicker_default(Alpine) {
|
|
|
5404
5450
|
el.appendChild(
|
|
5405
5451
|
createSvg({
|
|
5406
5452
|
icon: Calendar,
|
|
5407
|
-
classes: "opacity-70 text-
|
|
5453
|
+
classes: "opacity-70 text-inherit size-4",
|
|
5408
5454
|
attrs: {
|
|
5409
5455
|
"aria-hidden": true,
|
|
5410
5456
|
role: "presentation"
|
|
@@ -5646,13 +5692,13 @@ function expansion_panel_default(Alpine) {
|
|
|
5646
5692
|
});
|
|
5647
5693
|
}
|
|
5648
5694
|
});
|
|
5649
|
-
Alpine.directive("h-exp-panel-trigger", (el, { original
|
|
5695
|
+
Alpine.directive("h-exp-panel-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
5650
5696
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
5651
|
-
throw new Error(`${
|
|
5697
|
+
throw new Error(`${original} must be a header element`);
|
|
5652
5698
|
}
|
|
5653
|
-
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5699
|
+
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_expPanelItem"));
|
|
5654
5700
|
if (!expPanelItem) {
|
|
5655
|
-
throw new Error(`${
|
|
5701
|
+
throw new Error(`${original} must have an exp-panel-item parent element`);
|
|
5656
5702
|
}
|
|
5657
5703
|
el.classList.add(
|
|
5658
5704
|
"bg-object-header",
|
|
@@ -5833,13 +5879,13 @@ function fieldset_default(Alpine) {
|
|
|
5833
5879
|
|
|
5834
5880
|
// src/components/icon.js
|
|
5835
5881
|
function icon_default(Alpine) {
|
|
5836
|
-
Alpine.directive("h-icon", (el, { original
|
|
5882
|
+
Alpine.directive("h-icon", (el, { original, modifiers }) => {
|
|
5837
5883
|
if (el.tagName.toLowerCase() !== "svg") {
|
|
5838
|
-
throw new Error(`${
|
|
5884
|
+
throw new Error(`${original} works only on svg elements`);
|
|
5839
5885
|
} else if (!el.hasAttribute("role")) {
|
|
5840
|
-
throw new Error(`${
|
|
5886
|
+
throw new Error(`${original} must have a role`);
|
|
5841
5887
|
} else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5842
|
-
throw new Error(`${
|
|
5888
|
+
throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5843
5889
|
}
|
|
5844
5890
|
el.classList.add("fill-current");
|
|
5845
5891
|
el.setAttribute("data-slot", "icon");
|
|
@@ -5911,7 +5957,8 @@ function input_default(Alpine) {
|
|
|
5911
5957
|
"[&::-webkit-color-swatch-wrapper]:rounded-0",
|
|
5912
5958
|
"[&::-webkit-color-swatch-wrapper]:p-0",
|
|
5913
5959
|
"text-base",
|
|
5914
|
-
"transition-
|
|
5960
|
+
"transition-colors",
|
|
5961
|
+
"transition-shadow",
|
|
5915
5962
|
"motion-reduce:transition-none",
|
|
5916
5963
|
"outline-none",
|
|
5917
5964
|
"file:inline-flex",
|
|
@@ -5969,7 +6016,8 @@ function input_default(Alpine) {
|
|
|
5969
6016
|
"rounded-control",
|
|
5970
6017
|
"border",
|
|
5971
6018
|
"shadow-input",
|
|
5972
|
-
"transition-
|
|
6019
|
+
"transition-colors",
|
|
6020
|
+
"transition-shadow",
|
|
5973
6021
|
"motion-reduce:transition-none",
|
|
5974
6022
|
"outline-none",
|
|
5975
6023
|
"min-w-0",
|
|
@@ -6038,7 +6086,7 @@ function input_default(Alpine) {
|
|
|
6038
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"]
|
|
6039
6087
|
};
|
|
6040
6088
|
function setVariant(variant) {
|
|
6041
|
-
if (
|
|
6089
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
6042
6090
|
}
|
|
6043
6091
|
setVariant(el.getAttribute("data-align") ?? "inline-start");
|
|
6044
6092
|
const handler = (event) => {
|
|
@@ -6058,7 +6106,7 @@ function input_default(Alpine) {
|
|
|
6058
6106
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
6059
6107
|
el.setAttribute("data-slot", "label");
|
|
6060
6108
|
});
|
|
6061
|
-
Alpine.directive("h-input-number", (el, { original
|
|
6109
|
+
Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
|
|
6062
6110
|
el.classList.add(
|
|
6063
6111
|
"overflow-hidden",
|
|
6064
6112
|
"group/input-number",
|
|
@@ -6071,8 +6119,10 @@ function input_default(Alpine) {
|
|
|
6071
6119
|
"rounded-control",
|
|
6072
6120
|
"border",
|
|
6073
6121
|
"shadow-input",
|
|
6074
|
-
"transition-
|
|
6122
|
+
"transition-colors",
|
|
6123
|
+
"transition-shadow",
|
|
6075
6124
|
"motion-reduce:transition-none",
|
|
6125
|
+
"duration-200",
|
|
6076
6126
|
"outline-none",
|
|
6077
6127
|
"min-w-0",
|
|
6078
6128
|
"has-[input:focus-visible]:border-ring",
|
|
@@ -6092,7 +6142,7 @@ function input_default(Alpine) {
|
|
|
6092
6142
|
el.setAttribute("data-slot", "input-number");
|
|
6093
6143
|
const input = el.querySelector("input");
|
|
6094
6144
|
if (!input || input.getAttribute("type") !== "number") {
|
|
6095
|
-
throw new Error(`${
|
|
6145
|
+
throw new Error(`${original} must contain an input of type 'number'`);
|
|
6096
6146
|
}
|
|
6097
6147
|
if (!input.hasAttribute("type")) input.setAttribute("type", "number");
|
|
6098
6148
|
if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
|
|
@@ -6117,7 +6167,7 @@ function input_default(Alpine) {
|
|
|
6117
6167
|
stepDown.appendChild(
|
|
6118
6168
|
createSvg({
|
|
6119
6169
|
icon: Minus,
|
|
6120
|
-
classes: "opacity-70
|
|
6170
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
6121
6171
|
attrs: {
|
|
6122
6172
|
"aria-hidden": true,
|
|
6123
6173
|
role: "presentation"
|
|
@@ -6135,16 +6185,23 @@ function input_default(Alpine) {
|
|
|
6135
6185
|
"[input:invalid~&]:border-negative",
|
|
6136
6186
|
"h-full",
|
|
6137
6187
|
"aspect-square",
|
|
6188
|
+
"transition-colors",
|
|
6189
|
+
"motion-reduce:transition-none",
|
|
6190
|
+
"duration-100",
|
|
6138
6191
|
"bg-transparent",
|
|
6139
6192
|
"hover:bg-secondary",
|
|
6193
|
+
"hover:text-secondary-foreground",
|
|
6140
6194
|
"active:bg-secondary-active",
|
|
6195
|
+
"active:text-secondary-foreground",
|
|
6141
6196
|
"outline-none",
|
|
6142
6197
|
"relative",
|
|
6143
6198
|
"[&:hover>svg]:text-secondary-foreground"
|
|
6144
6199
|
);
|
|
6145
6200
|
el.appendChild(stepDown);
|
|
6146
6201
|
const onStepDown = () => {
|
|
6147
|
-
input.
|
|
6202
|
+
if (input.step === "any") {
|
|
6203
|
+
input.value = (parseFloat(input.value) || 0) - 1;
|
|
6204
|
+
} else input.stepDown();
|
|
6148
6205
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
6149
6206
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
6150
6207
|
};
|
|
@@ -6158,7 +6215,7 @@ function input_default(Alpine) {
|
|
|
6158
6215
|
stepUp.appendChild(
|
|
6159
6216
|
createSvg({
|
|
6160
6217
|
icon: Plus,
|
|
6161
|
-
classes: "opacity-70
|
|
6218
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
6162
6219
|
attrs: {
|
|
6163
6220
|
"aria-hidden": true,
|
|
6164
6221
|
role: "presentation"
|
|
@@ -6176,16 +6233,23 @@ function input_default(Alpine) {
|
|
|
6176
6233
|
"[input:invalid~&]:border-negative",
|
|
6177
6234
|
"h-full",
|
|
6178
6235
|
"aspect-square",
|
|
6236
|
+
"transition-all",
|
|
6237
|
+
"motion-reduce:transition-none",
|
|
6238
|
+
"duration-100",
|
|
6179
6239
|
"bg-transparent",
|
|
6180
6240
|
"hover:bg-secondary",
|
|
6241
|
+
"hover:text-secondary-foreground",
|
|
6181
6242
|
"active:bg-secondary-active",
|
|
6243
|
+
"active:text-secondary-foreground",
|
|
6182
6244
|
"outline-none",
|
|
6183
6245
|
"relative",
|
|
6184
6246
|
"[&:hover>svg]:text-secondary-foreground"
|
|
6185
6247
|
);
|
|
6186
6248
|
el.appendChild(stepUp);
|
|
6187
6249
|
const onStepUp = () => {
|
|
6188
|
-
input.
|
|
6250
|
+
if (input.step === "any") {
|
|
6251
|
+
input.value = (parseFloat(input.value) || 0) + 1;
|
|
6252
|
+
} else input.stepUp();
|
|
6189
6253
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
6190
6254
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
6191
6255
|
};
|
|
@@ -6292,7 +6356,8 @@ function list_default(Alpine) {
|
|
|
6292
6356
|
focusLastOption(el);
|
|
6293
6357
|
break;
|
|
6294
6358
|
case "Up":
|
|
6295
|
-
case "ArrowUp":
|
|
6359
|
+
case "ArrowUp": {
|
|
6360
|
+
event.preventDefault();
|
|
6296
6361
|
let prevElem = event.target.previousElementSibling;
|
|
6297
6362
|
if (prevElem && prevElem.getAttribute("data-slot") !== "list-header") {
|
|
6298
6363
|
prevElem.focus();
|
|
@@ -6303,8 +6368,10 @@ function list_default(Alpine) {
|
|
|
6303
6368
|
}
|
|
6304
6369
|
}
|
|
6305
6370
|
break;
|
|
6371
|
+
}
|
|
6306
6372
|
case "Down":
|
|
6307
|
-
case "ArrowDown":
|
|
6373
|
+
case "ArrowDown": {
|
|
6374
|
+
event.preventDefault();
|
|
6308
6375
|
let nextElem = event.target.nextElementSibling;
|
|
6309
6376
|
if (nextElem) {
|
|
6310
6377
|
nextElem.focus();
|
|
@@ -6315,6 +6382,7 @@ function list_default(Alpine) {
|
|
|
6315
6382
|
}
|
|
6316
6383
|
}
|
|
6317
6384
|
break;
|
|
6385
|
+
}
|
|
6318
6386
|
case " ":
|
|
6319
6387
|
case "Enter":
|
|
6320
6388
|
selectOption(event.target);
|
|
@@ -6338,13 +6406,13 @@ function list_default(Alpine) {
|
|
|
6338
6406
|
el.setAttribute("data-slot", "list");
|
|
6339
6407
|
el.setAttribute("role", "group");
|
|
6340
6408
|
});
|
|
6341
|
-
Alpine.directive("h-list-header", (el, { original
|
|
6409
|
+
Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
|
|
6342
6410
|
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
6343
6411
|
el.setAttribute("role", "presentation");
|
|
6344
6412
|
el.setAttribute("data-slot", "list-header");
|
|
6345
6413
|
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
6346
6414
|
if (!list) {
|
|
6347
|
-
throw new Error(`${
|
|
6415
|
+
throw new Error(`${original} must be placed inside a list element`);
|
|
6348
6416
|
}
|
|
6349
6417
|
if (!el.hasAttribute("id")) {
|
|
6350
6418
|
const id = `lbh${uuid_default()}`;
|
|
@@ -6402,9 +6470,9 @@ function menu_default(Alpine) {
|
|
|
6402
6470
|
}
|
|
6403
6471
|
}
|
|
6404
6472
|
});
|
|
6405
|
-
Alpine.directive("h-menu", (el, { original
|
|
6473
|
+
Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
6406
6474
|
if (el.tagName !== "UL") {
|
|
6407
|
-
throw new Error(`${
|
|
6475
|
+
throw new Error(`${original} must be an ul element`);
|
|
6408
6476
|
}
|
|
6409
6477
|
el.classList.add(
|
|
6410
6478
|
"hidden",
|
|
@@ -6436,11 +6504,11 @@ function menu_default(Alpine) {
|
|
|
6436
6504
|
const menuTrigger = (() => {
|
|
6437
6505
|
if (isSubmenu) return;
|
|
6438
6506
|
let sibling = el.previousElementSibling;
|
|
6439
|
-
while (sibling && !
|
|
6507
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_menu_trigger")) {
|
|
6440
6508
|
sibling = sibling.previousElementSibling;
|
|
6441
6509
|
}
|
|
6442
|
-
if (!
|
|
6443
|
-
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`);
|
|
6444
6512
|
}
|
|
6445
6513
|
return sibling;
|
|
6446
6514
|
})();
|
|
@@ -6449,7 +6517,7 @@ function menu_default(Alpine) {
|
|
|
6449
6517
|
if (parent && parent.hasAttribute("id")) {
|
|
6450
6518
|
el.setAttribute("aria-labelledby", parent.id);
|
|
6451
6519
|
} else {
|
|
6452
|
-
throw new Error(`${
|
|
6520
|
+
throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
6453
6521
|
}
|
|
6454
6522
|
}
|
|
6455
6523
|
}
|
|
@@ -6457,7 +6525,7 @@ function menu_default(Alpine) {
|
|
|
6457
6525
|
if (isSubmenu) {
|
|
6458
6526
|
menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
6459
6527
|
if (!menuSubItem) {
|
|
6460
|
-
throw new Error(`${
|
|
6528
|
+
throw new Error(`${original} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
|
|
6461
6529
|
}
|
|
6462
6530
|
setAriaAttrubutes(menuSubItem);
|
|
6463
6531
|
} else if (menuTrigger) {
|
|
@@ -6520,7 +6588,9 @@ function menu_default(Alpine) {
|
|
|
6520
6588
|
}
|
|
6521
6589
|
function onClick(event) {
|
|
6522
6590
|
if (event.type === "contextmenu") event.preventDefault();
|
|
6523
|
-
|
|
6591
|
+
if (el.getAttribute("data-innerclicks") === "true" && el.contains(event.composedPath()[0])) {
|
|
6592
|
+
return;
|
|
6593
|
+
} else close(isSubmenu);
|
|
6524
6594
|
}
|
|
6525
6595
|
el.pauseKeyEvents = false;
|
|
6526
6596
|
function onKeyDown(event) {
|
|
@@ -6563,7 +6633,7 @@ function menu_default(Alpine) {
|
|
|
6563
6633
|
}
|
|
6564
6634
|
break;
|
|
6565
6635
|
case "Up":
|
|
6566
|
-
case "ArrowUp":
|
|
6636
|
+
case "ArrowUp": {
|
|
6567
6637
|
event.preventDefault();
|
|
6568
6638
|
let menuitems = el.querySelectorAll(':scope > [role^=menuitem][tabIndex="-1"]:has(~ [role^=menuitem][tabIndex="0"])');
|
|
6569
6639
|
if (menuitems.length) {
|
|
@@ -6575,6 +6645,7 @@ function menu_default(Alpine) {
|
|
|
6575
6645
|
menuitem.focus();
|
|
6576
6646
|
}
|
|
6577
6647
|
break;
|
|
6648
|
+
}
|
|
6578
6649
|
case "Home":
|
|
6579
6650
|
case "PageUp":
|
|
6580
6651
|
event.preventDefault();
|
|
@@ -6696,9 +6767,9 @@ function menu_default(Alpine) {
|
|
|
6696
6767
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
6697
6768
|
});
|
|
6698
6769
|
});
|
|
6699
|
-
Alpine.directive("h-menu-item", (el, { original
|
|
6770
|
+
Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6700
6771
|
if (el.tagName !== "LI") {
|
|
6701
|
-
throw new Error(`${
|
|
6772
|
+
throw new Error(`${original} must be a li element`);
|
|
6702
6773
|
}
|
|
6703
6774
|
el.classList.add(
|
|
6704
6775
|
"focus:bg-secondary-hover",
|
|
@@ -6752,7 +6823,7 @@ function menu_default(Alpine) {
|
|
|
6752
6823
|
el.removeEventListener("mouseleave", focusOut);
|
|
6753
6824
|
});
|
|
6754
6825
|
});
|
|
6755
|
-
Alpine.directive("h-menu-sub", (el, { original
|
|
6826
|
+
Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6756
6827
|
el.classList.add(
|
|
6757
6828
|
"focus:bg-secondary-hover",
|
|
6758
6829
|
"hover:bg-secondary-hover",
|
|
@@ -6784,7 +6855,7 @@ function menu_default(Alpine) {
|
|
|
6784
6855
|
const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
|
|
6785
6856
|
el.appendChild(chevronRight);
|
|
6786
6857
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6787
|
-
if (!parentMenu) throw new Error(`${
|
|
6858
|
+
if (!parentMenu) throw new Error(`${original} must have a parent`);
|
|
6788
6859
|
if (!el.hasAttribute("id")) {
|
|
6789
6860
|
el.setAttribute("id", `ms${uuid_default()}`);
|
|
6790
6861
|
}
|
|
@@ -6881,9 +6952,9 @@ function menu_default(Alpine) {
|
|
|
6881
6952
|
el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
|
|
6882
6953
|
el.setAttribute("data-slot", "menu-label");
|
|
6883
6954
|
});
|
|
6884
|
-
Alpine.directive("h-menu-checkbox-item", (el, { original
|
|
6955
|
+
Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6885
6956
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6886
|
-
throw new Error(`${
|
|
6957
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6887
6958
|
}
|
|
6888
6959
|
el.classList.add(
|
|
6889
6960
|
"focus:bg-secondary-hover",
|
|
@@ -6923,7 +6994,7 @@ function menu_default(Alpine) {
|
|
|
6923
6994
|
el._x_model.set(!el._x_model.get());
|
|
6924
6995
|
setState(el._x_model.get());
|
|
6925
6996
|
}
|
|
6926
|
-
if (
|
|
6997
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
6927
6998
|
setState(el._x_model.get(), false);
|
|
6928
6999
|
el.addEventListener("click", onActivate);
|
|
6929
7000
|
}
|
|
@@ -6940,7 +7011,7 @@ function menu_default(Alpine) {
|
|
|
6940
7011
|
el.addEventListener("mouseenter", focusIn);
|
|
6941
7012
|
el.addEventListener("focus", focusIn);
|
|
6942
7013
|
cleanup(() => {
|
|
6943
|
-
if (
|
|
7014
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
6944
7015
|
el.removeEventListener("click", onActivate);
|
|
6945
7016
|
el.removeEventListener("keydown", onActivate);
|
|
6946
7017
|
}
|
|
@@ -6950,9 +7021,9 @@ function menu_default(Alpine) {
|
|
|
6950
7021
|
el.removeEventListener("mouseleave", focusOut);
|
|
6951
7022
|
});
|
|
6952
7023
|
});
|
|
6953
|
-
Alpine.directive("h-menu-radio-item", (el, { original
|
|
7024
|
+
Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
6954
7025
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6955
|
-
throw new Error(`${
|
|
7026
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6956
7027
|
}
|
|
6957
7028
|
el.classList.add(
|
|
6958
7029
|
"focus:bg-secondary-hover",
|
|
@@ -7008,7 +7079,7 @@ function menu_default(Alpine) {
|
|
|
7008
7079
|
el._x_model.set(value);
|
|
7009
7080
|
}
|
|
7010
7081
|
}
|
|
7011
|
-
if (
|
|
7082
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7012
7083
|
effect(() => {
|
|
7013
7084
|
setState(el._x_model.get() === value);
|
|
7014
7085
|
});
|
|
@@ -7028,7 +7099,7 @@ function menu_default(Alpine) {
|
|
|
7028
7099
|
el.addEventListener("mouseenter", focusIn);
|
|
7029
7100
|
el.addEventListener("focus", focusIn);
|
|
7030
7101
|
cleanup(() => {
|
|
7031
|
-
if (
|
|
7102
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7032
7103
|
el.removeEventListener("click", onActivate);
|
|
7033
7104
|
el.removeEventListener("keydown", onActivate);
|
|
7034
7105
|
}
|
|
@@ -7076,7 +7147,7 @@ function notifications_default(Alpine) {
|
|
|
7076
7147
|
};
|
|
7077
7148
|
this.items.push(item);
|
|
7078
7149
|
this.listeners.forEach((listener) => {
|
|
7079
|
-
if (
|
|
7150
|
+
if (Object.prototype.hasOwnProperty.call(listener, "added")) listener.added(item);
|
|
7080
7151
|
});
|
|
7081
7152
|
},
|
|
7082
7153
|
update(id, data) {
|
|
@@ -7089,7 +7160,7 @@ function notifications_default(Alpine) {
|
|
|
7089
7160
|
this.items[index].data[key] = value;
|
|
7090
7161
|
}
|
|
7091
7162
|
this.listeners.forEach((listener) => {
|
|
7092
|
-
if (
|
|
7163
|
+
if (Object.prototype.hasOwnProperty.call(listener, "updated")) listener.updated(id, data);
|
|
7093
7164
|
});
|
|
7094
7165
|
} else {
|
|
7095
7166
|
console.error(`Notification with id "${id}" does not exist`);
|
|
@@ -7100,7 +7171,7 @@ function notifications_default(Alpine) {
|
|
|
7100
7171
|
throw new Error("Cannot remove a notification if an ID is not provided");
|
|
7101
7172
|
}
|
|
7102
7173
|
this.listeners.forEach((listener) => {
|
|
7103
|
-
if (
|
|
7174
|
+
if (Object.prototype.hasOwnProperty.call(listener, "removed")) listener.removed(id);
|
|
7104
7175
|
});
|
|
7105
7176
|
this.items = this.items.filter((n) => n.id !== id);
|
|
7106
7177
|
}
|
|
@@ -7125,9 +7196,9 @@ function notifications_default(Alpine) {
|
|
|
7125
7196
|
}
|
|
7126
7197
|
};
|
|
7127
7198
|
});
|
|
7128
|
-
Alpine.directive("h-notification-overlay", (el, { original
|
|
7199
|
+
Alpine.directive("h-notification-overlay", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7129
7200
|
if (el.tagName !== "SECTION") {
|
|
7130
|
-
throw new Error(`${
|
|
7201
|
+
throw new Error(`${original} must be a button`);
|
|
7131
7202
|
}
|
|
7132
7203
|
const notificationTemplates = {};
|
|
7133
7204
|
el.querySelectorAll("template").forEach((template) => {
|
|
@@ -7262,17 +7333,17 @@ function notifications_default(Alpine) {
|
|
|
7262
7333
|
xlBreakpointListener.remove();
|
|
7263
7334
|
});
|
|
7264
7335
|
});
|
|
7265
|
-
Alpine.directive("h-notification-list", (el, { original
|
|
7336
|
+
Alpine.directive("h-notification-list", (el, { original }) => {
|
|
7266
7337
|
if (el.tagName !== "OL" && el.tagName !== "UL") {
|
|
7267
|
-
throw new Error(`${
|
|
7338
|
+
throw new Error(`${original} must be a list element`);
|
|
7268
7339
|
}
|
|
7269
7340
|
el.classList.add("flex", "flex-col", "divide-solid", "divide-y");
|
|
7270
7341
|
el.setAttribute("data-slot", "notification-list");
|
|
7271
7342
|
el.setAttribute("role", "group");
|
|
7272
7343
|
});
|
|
7273
|
-
Alpine.directive("h-notification", (el, { original
|
|
7344
|
+
Alpine.directive("h-notification", (el, { original, modifiers }) => {
|
|
7274
7345
|
if (el.tagName !== "LI") {
|
|
7275
|
-
throw new Error(`${
|
|
7346
|
+
throw new Error(`${original} must be a list item element`);
|
|
7276
7347
|
}
|
|
7277
7348
|
el.classList.add("pointer-events-auto", "p-3", "flex", "gap-2");
|
|
7278
7349
|
if (modifiers.includes("floating")) {
|
|
@@ -7308,7 +7379,7 @@ function notifications_default(Alpine) {
|
|
|
7308
7379
|
el.classList.add("flex", "gap-2", "data-[orientation=vertical]:flex-col");
|
|
7309
7380
|
el.setAttribute("data-slot", "notification-actions");
|
|
7310
7381
|
});
|
|
7311
|
-
Alpine.directive("h-notification-close", (el, { original
|
|
7382
|
+
Alpine.directive("h-notification-close", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7312
7383
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "notification-close");
|
|
7313
7384
|
let nId;
|
|
7314
7385
|
function close() {
|
|
@@ -7327,7 +7398,7 @@ function notifications_default(Alpine) {
|
|
|
7327
7398
|
el.removeEventListener("click", close);
|
|
7328
7399
|
});
|
|
7329
7400
|
} else {
|
|
7330
|
-
console.error(`${
|
|
7401
|
+
console.error(`${original} must be inside a notification with an id`);
|
|
7331
7402
|
}
|
|
7332
7403
|
});
|
|
7333
7404
|
}
|
|
@@ -7416,7 +7487,7 @@ function pagination_default(Alpine) {
|
|
|
7416
7487
|
// src/components/popover.js
|
|
7417
7488
|
function popover_default(Alpine) {
|
|
7418
7489
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
7419
|
-
el.
|
|
7490
|
+
el._h_popover = Alpine2.reactive({
|
|
7420
7491
|
id: void 0,
|
|
7421
7492
|
controls: `hpc${uuid_default()}`,
|
|
7422
7493
|
auto: expression ? false : true,
|
|
@@ -7426,7 +7497,7 @@ function popover_default(Alpine) {
|
|
|
7426
7497
|
const getExpanded = evaluateLater(expression);
|
|
7427
7498
|
effect(() => {
|
|
7428
7499
|
getExpanded((expanded) => {
|
|
7429
|
-
el.
|
|
7500
|
+
el._h_popover.expanded = expanded;
|
|
7430
7501
|
});
|
|
7431
7502
|
});
|
|
7432
7503
|
}
|
|
@@ -7436,33 +7507,33 @@ function popover_default(Alpine) {
|
|
|
7436
7507
|
}
|
|
7437
7508
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
7438
7509
|
if (el.hasAttribute("id")) {
|
|
7439
|
-
el.
|
|
7510
|
+
el._h_popover.id = el.getAttribute("id");
|
|
7440
7511
|
} else {
|
|
7441
|
-
el.
|
|
7442
|
-
el.setAttribute("id", el.
|
|
7512
|
+
el._h_popover.id = `hp${uuid_default()}`;
|
|
7513
|
+
el.setAttribute("id", el._h_popover.id);
|
|
7443
7514
|
}
|
|
7444
|
-
el.setAttribute("aria-controls", el.
|
|
7515
|
+
el.setAttribute("aria-controls", el._h_popover.controls);
|
|
7445
7516
|
el.setAttribute("aria-haspopup", "dialog");
|
|
7446
7517
|
const setAttributes = () => {
|
|
7447
|
-
el.setAttribute("aria-expanded", el.
|
|
7518
|
+
el.setAttribute("aria-expanded", el._h_popover.expanded);
|
|
7448
7519
|
};
|
|
7449
7520
|
const close = () => {
|
|
7450
|
-
el.
|
|
7521
|
+
el._h_popover.expanded = false;
|
|
7451
7522
|
el.addEventListener("click", handler);
|
|
7452
7523
|
setAttributes();
|
|
7453
7524
|
};
|
|
7454
7525
|
const handler = () => {
|
|
7455
|
-
el.
|
|
7526
|
+
el._h_popover.expanded = !el._h_popover.expanded;
|
|
7456
7527
|
setAttributes();
|
|
7457
7528
|
Alpine2.nextTick(() => {
|
|
7458
|
-
if (el.
|
|
7529
|
+
if (el._h_popover.auto && el._h_popover.expanded) {
|
|
7459
7530
|
top.addEventListener("click", close, { once: true });
|
|
7460
7531
|
el.removeEventListener("click", handler);
|
|
7461
7532
|
}
|
|
7462
7533
|
});
|
|
7463
7534
|
};
|
|
7464
7535
|
setAttributes();
|
|
7465
|
-
if (el.
|
|
7536
|
+
if (el._h_popover.auto) {
|
|
7466
7537
|
el.addEventListener("click", handler);
|
|
7467
7538
|
cleanup(() => {
|
|
7468
7539
|
el.removeEventListener("click", handler);
|
|
@@ -7474,16 +7545,16 @@ function popover_default(Alpine) {
|
|
|
7474
7545
|
});
|
|
7475
7546
|
}
|
|
7476
7547
|
});
|
|
7477
|
-
Alpine.directive("h-popover", (el, { original
|
|
7548
|
+
Alpine.directive("h-popover", (el, { original, modifiers }, { effect, cleanup }) => {
|
|
7478
7549
|
const popover = (() => {
|
|
7479
7550
|
let sibling = el.previousElementSibling;
|
|
7480
|
-
while (sibling && !
|
|
7551
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_h_popover")) {
|
|
7481
7552
|
sibling = sibling.previousElementSibling;
|
|
7482
7553
|
}
|
|
7483
7554
|
return sibling;
|
|
7484
7555
|
})();
|
|
7485
7556
|
if (!popover) {
|
|
7486
|
-
throw new Error(`${
|
|
7557
|
+
throw new Error(`${original} must be placed after a popover element`);
|
|
7487
7558
|
}
|
|
7488
7559
|
el.classList.add(
|
|
7489
7560
|
"absolute",
|
|
@@ -7509,8 +7580,8 @@ function popover_default(Alpine) {
|
|
|
7509
7580
|
el.setAttribute("data-slot", "popover");
|
|
7510
7581
|
el.setAttribute("role", "dialog");
|
|
7511
7582
|
el.setAttribute("tabindex", "-1");
|
|
7512
|
-
el.setAttribute("id", popover.
|
|
7513
|
-
el.setAttribute("aria-labelledby", popover.
|
|
7583
|
+
el.setAttribute("id", popover._h_popover.controls);
|
|
7584
|
+
el.setAttribute("aria-labelledby", popover._h_popover.id);
|
|
7514
7585
|
let noScroll = modifiers.includes("no-scroll");
|
|
7515
7586
|
if (noScroll) {
|
|
7516
7587
|
el.classList.remove("overflow-auto");
|
|
@@ -7548,7 +7619,7 @@ function popover_default(Alpine) {
|
|
|
7548
7619
|
});
|
|
7549
7620
|
}
|
|
7550
7621
|
effect(() => {
|
|
7551
|
-
if (popover.
|
|
7622
|
+
if (popover._h_popover.expanded) {
|
|
7552
7623
|
el.classList.remove("hidden");
|
|
7553
7624
|
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
7554
7625
|
} else {
|
|
@@ -7661,7 +7732,7 @@ function range_default(Alpine) {
|
|
|
7661
7732
|
el.classList.add("harmonia-slider");
|
|
7662
7733
|
el.setAttribute("data-slot", "range");
|
|
7663
7734
|
(0, import_nouislider.create)(el, evaluate2(expression));
|
|
7664
|
-
if (
|
|
7735
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7665
7736
|
el.noUiSlider.on("change", (values) => {
|
|
7666
7737
|
el._x_model.set(values);
|
|
7667
7738
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -7699,9 +7770,18 @@ function select_default(Alpine) {
|
|
|
7699
7770
|
set: void 0,
|
|
7700
7771
|
get: void 0
|
|
7701
7772
|
};
|
|
7702
|
-
el.classList.add("cursor-pointer", "outline-none", "transition-
|
|
7773
|
+
el.classList.add("cursor-pointer", "outline-none", "transition-colors", "transition-shadow", "motion-reduce:transition-none", "duration-200", "w-full", "has-[input:disabled]:pointer-events-none", "has-[input:disabled]:opacity-50");
|
|
7703
7774
|
if (modifiers.includes("table")) {
|
|
7704
|
-
el.classList.add(
|
|
7775
|
+
el.classList.add(
|
|
7776
|
+
"h-10",
|
|
7777
|
+
"flex",
|
|
7778
|
+
"focus-visible:inset-ring-ring/50",
|
|
7779
|
+
"focus-visible:inset-ring-2",
|
|
7780
|
+
'[&>[data-slot="select-input"]]:hover:bg-table-hover',
|
|
7781
|
+
'[&>[data-slot="select-input"]]:hover:text-table-hover-foreground',
|
|
7782
|
+
'[&>[data-slot="select-input"]]:active:!bg-table-active',
|
|
7783
|
+
'[&>[data-slot="select-input"]]:active:!text-table-active-foreground'
|
|
7784
|
+
);
|
|
7705
7785
|
el.setAttribute("data-slot", "cell-input-select");
|
|
7706
7786
|
} else {
|
|
7707
7787
|
el.classList.add(
|
|
@@ -7715,8 +7795,11 @@ function select_default(Alpine) {
|
|
|
7715
7795
|
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
7716
7796
|
"has-[input:invalid]:border-negative",
|
|
7717
7797
|
"has-[input:invalid]:ring-negative/20",
|
|
7718
|
-
"hover:bg-secondary-hover
|
|
7719
|
-
"
|
|
7798
|
+
'[&>[data-slot="select-input"]]:hover:bg-secondary-hover',
|
|
7799
|
+
'[&>[data-slot="select-input"]]:hover:text-secondary-foreground',
|
|
7800
|
+
'[&>[data-slot="select-input"]]:active:bg-secondary-active',
|
|
7801
|
+
'[&>[data-slot="select-input"]]:active:text-secondary-foreground',
|
|
7802
|
+
'[&>[data-slot="select-input"]]:rounded-control',
|
|
7720
7803
|
"rounded-control",
|
|
7721
7804
|
"border",
|
|
7722
7805
|
"bg-input-inner",
|
|
@@ -7731,11 +7814,11 @@ function select_default(Alpine) {
|
|
|
7731
7814
|
});
|
|
7732
7815
|
}
|
|
7733
7816
|
});
|
|
7734
|
-
Alpine.directive("h-select-input", (el, { original
|
|
7817
|
+
Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7735
7818
|
if (el.tagName !== "INPUT") {
|
|
7736
|
-
throw new Error(`${
|
|
7819
|
+
throw new Error(`${original} must be an input of type "text"`);
|
|
7737
7820
|
}
|
|
7738
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
7821
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
7739
7822
|
const label = (() => {
|
|
7740
7823
|
const field = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "field");
|
|
7741
7824
|
if (field) {
|
|
@@ -7744,8 +7827,8 @@ function select_default(Alpine) {
|
|
|
7744
7827
|
return;
|
|
7745
7828
|
})();
|
|
7746
7829
|
if (!select) {
|
|
7747
|
-
throw new Error(`${
|
|
7748
|
-
} else if (
|
|
7830
|
+
throw new Error(`${original} must be inside a select element`);
|
|
7831
|
+
} else if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7749
7832
|
select._h_select.multiple = Array.isArray(el._x_model.get());
|
|
7750
7833
|
select._h_model.set = (value) => {
|
|
7751
7834
|
if (select._h_select.multiple) {
|
|
@@ -7843,7 +7926,7 @@ function select_default(Alpine) {
|
|
|
7843
7926
|
const onKeyDown = (event) => {
|
|
7844
7927
|
switch (event.key) {
|
|
7845
7928
|
case "Down":
|
|
7846
|
-
case "ArrowDown":
|
|
7929
|
+
case "ArrowDown": {
|
|
7847
7930
|
event.preventDefault();
|
|
7848
7931
|
let nextIndex = 0;
|
|
7849
7932
|
for (let o = 0; o < options.length; o++) {
|
|
@@ -7865,8 +7948,9 @@ function select_default(Alpine) {
|
|
|
7865
7948
|
options[nextIndex].setAttribute("tabindex", "0");
|
|
7866
7949
|
options[nextIndex].focus();
|
|
7867
7950
|
break;
|
|
7951
|
+
}
|
|
7868
7952
|
case "Up":
|
|
7869
|
-
case "ArrowUp":
|
|
7953
|
+
case "ArrowUp": {
|
|
7870
7954
|
event.preventDefault();
|
|
7871
7955
|
let prevIndex = options.length - 1;
|
|
7872
7956
|
for (let o = options.length - 1; o >= 0; o--) {
|
|
@@ -7888,6 +7972,7 @@ function select_default(Alpine) {
|
|
|
7888
7972
|
options[prevIndex].setAttribute("tabindex", "0");
|
|
7889
7973
|
options[prevIndex].focus();
|
|
7890
7974
|
break;
|
|
7975
|
+
}
|
|
7891
7976
|
case "Home":
|
|
7892
7977
|
case "PageUp":
|
|
7893
7978
|
event.preventDefault();
|
|
@@ -7973,7 +8058,7 @@ function select_default(Alpine) {
|
|
|
7973
8058
|
fakeTrigger.addEventListener("click", onClick);
|
|
7974
8059
|
const chevronDown = createSvg({
|
|
7975
8060
|
icon: ChevronDown,
|
|
7976
|
-
classes: "opacity-70 text-
|
|
8061
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none transition-transform motion-reduce:transition-none duration-200",
|
|
7977
8062
|
attrs: {
|
|
7978
8063
|
"aria-hidden": true,
|
|
7979
8064
|
role: "presentation"
|
|
@@ -8004,10 +8089,10 @@ function select_default(Alpine) {
|
|
|
8004
8089
|
}
|
|
8005
8090
|
});
|
|
8006
8091
|
});
|
|
8007
|
-
Alpine.directive("h-select-content", (el, { original
|
|
8008
|
-
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"));
|
|
8009
8094
|
if (!select) {
|
|
8010
|
-
throw new Error(`${
|
|
8095
|
+
throw new Error(`${original} must be inside a select element`);
|
|
8011
8096
|
}
|
|
8012
8097
|
el.classList.add(
|
|
8013
8098
|
"absolute",
|
|
@@ -8036,7 +8121,7 @@ function select_default(Alpine) {
|
|
|
8036
8121
|
el.setAttribute("id", select._h_select.controls);
|
|
8037
8122
|
el.setAttribute("tabindex", "-1");
|
|
8038
8123
|
if (!select._h_select.trigger) {
|
|
8039
|
-
throw new Error(`${
|
|
8124
|
+
throw new Error(`${original}: trigger not found`);
|
|
8040
8125
|
}
|
|
8041
8126
|
let autoUpdateCleanup;
|
|
8042
8127
|
function updatePosition() {
|
|
@@ -8097,10 +8182,10 @@ function select_default(Alpine) {
|
|
|
8097
8182
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8098
8183
|
});
|
|
8099
8184
|
});
|
|
8100
|
-
Alpine.directive("h-select-search", (el, { original
|
|
8101
|
-
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"));
|
|
8102
8187
|
if (!select) {
|
|
8103
|
-
throw new Error(`${
|
|
8188
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8104
8189
|
} else {
|
|
8105
8190
|
select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
|
|
8106
8191
|
}
|
|
@@ -8165,17 +8250,17 @@ function select_default(Alpine) {
|
|
|
8165
8250
|
Alpine.directive("h-select-label", (el) => {
|
|
8166
8251
|
el.classList.add("text-muted-foreground", "px-2", "py-1.5", "text-xs");
|
|
8167
8252
|
el.setAttribute("data-slot", "select-label");
|
|
8168
|
-
const selectGroup = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8253
|
+
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_selectGroup"));
|
|
8169
8254
|
if (selectGroup) {
|
|
8170
8255
|
const id = `hsl${uuid_default()}`;
|
|
8171
8256
|
el.setAttribute("id", id);
|
|
8172
8257
|
selectGroup._h_selectGroup.labelledby = id;
|
|
8173
8258
|
}
|
|
8174
8259
|
});
|
|
8175
|
-
Alpine.directive("h-select-option", (el, { original
|
|
8176
|
-
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"));
|
|
8177
8262
|
if (!select) {
|
|
8178
|
-
throw new Error(`${
|
|
8263
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8179
8264
|
}
|
|
8180
8265
|
el.classList.add(
|
|
8181
8266
|
"focus:bg-primary",
|
|
@@ -8268,6 +8353,7 @@ function select_default(Alpine) {
|
|
|
8268
8353
|
const onActivate = (event) => {
|
|
8269
8354
|
if (event.type === "keydown" && (event.key === "Enter" || event.key === " ") || event.type === "click") {
|
|
8270
8355
|
if (select._h_select.multiple) {
|
|
8356
|
+
event.stopPropagation();
|
|
8271
8357
|
const vIndex = select._h_model.get().indexOf(getValue());
|
|
8272
8358
|
if (vIndex > -1) {
|
|
8273
8359
|
const val = select._h_model.get().splice(vIndex, 1);
|
|
@@ -8370,10 +8456,10 @@ function sheet_default(Alpine) {
|
|
|
8370
8456
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8371
8457
|
});
|
|
8372
8458
|
});
|
|
8373
|
-
Alpine.directive("h-sheet", (el, { original
|
|
8374
|
-
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"));
|
|
8375
8461
|
if (!overlay) {
|
|
8376
|
-
throw new Error(`${
|
|
8462
|
+
throw new Error(`${original} must be placed inside a sheet overlay`);
|
|
8377
8463
|
}
|
|
8378
8464
|
el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
|
|
8379
8465
|
el.setAttribute("data-slot", "sheet");
|
|
@@ -8496,10 +8582,10 @@ function sidebar_default(Alpine) {
|
|
|
8496
8582
|
});
|
|
8497
8583
|
}
|
|
8498
8584
|
});
|
|
8499
|
-
Alpine.directive("h-sidebar-group-label", (el, { original
|
|
8500
|
-
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"));
|
|
8501
8587
|
if (!group) {
|
|
8502
|
-
throw new Error(`${
|
|
8588
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8503
8589
|
}
|
|
8504
8590
|
el.classList.add(
|
|
8505
8591
|
"ring-sidebar-ring",
|
|
@@ -8522,7 +8608,7 @@ function sidebar_default(Alpine) {
|
|
|
8522
8608
|
);
|
|
8523
8609
|
el.setAttribute("data-slot", "sidebar-group-label");
|
|
8524
8610
|
if (group._h_sidebar_group.collapsable) {
|
|
8525
|
-
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-secondary-
|
|
8611
|
+
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-sidebar-secondary", "hover:text-sidebar-secondary-foreground", "active:bg-sidebar-secondary", "active:text-sidebar-secondary-foreground");
|
|
8526
8612
|
if (el.hasAttribute("id")) {
|
|
8527
8613
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
8528
8614
|
} else {
|
|
@@ -8588,10 +8674,10 @@ function sidebar_default(Alpine) {
|
|
|
8588
8674
|
}
|
|
8589
8675
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
8590
8676
|
});
|
|
8591
|
-
Alpine.directive("h-sidebar-group-content", (el, { original
|
|
8592
|
-
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"));
|
|
8593
8679
|
if (!group) {
|
|
8594
|
-
throw new Error(`${
|
|
8680
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8595
8681
|
}
|
|
8596
8682
|
el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
|
|
8597
8683
|
el.setAttribute("data-slot", "sidebar-group-content");
|
|
@@ -8604,16 +8690,16 @@ function sidebar_default(Alpine) {
|
|
|
8604
8690
|
});
|
|
8605
8691
|
}
|
|
8606
8692
|
});
|
|
8607
|
-
Alpine.directive("h-sidebar-menu", (el, { original
|
|
8693
|
+
Alpine.directive("h-sidebar-menu", (el, { original }) => {
|
|
8608
8694
|
if (el.tagName !== "UL") {
|
|
8609
|
-
throw new Error(`${
|
|
8695
|
+
throw new Error(`${original} must be an ul element`);
|
|
8610
8696
|
}
|
|
8611
8697
|
el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
|
|
8612
8698
|
el.setAttribute("data-slot", "sidebar-menu");
|
|
8613
8699
|
});
|
|
8614
|
-
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 }) => {
|
|
8615
8701
|
if (el.tagName !== "LI") {
|
|
8616
|
-
throw new Error(`${
|
|
8702
|
+
throw new Error(`${original} must be a li element`);
|
|
8617
8703
|
}
|
|
8618
8704
|
el._h_sidebar_menu_item = {
|
|
8619
8705
|
isSub: false,
|
|
@@ -8649,13 +8735,13 @@ function sidebar_default(Alpine) {
|
|
|
8649
8735
|
});
|
|
8650
8736
|
}
|
|
8651
8737
|
});
|
|
8652
|
-
Alpine.directive("h-sidebar-menu-button", (el, { original
|
|
8738
|
+
Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
8653
8739
|
if (el.tagName !== "BUTTON" && el.tagName !== "A") {
|
|
8654
|
-
throw new Error(`${
|
|
8740
|
+
throw new Error(`${original} must be a button or a link`);
|
|
8655
8741
|
} else if (el.tagName === "BUTTON") {
|
|
8656
8742
|
el.setAttribute("type", "button");
|
|
8657
8743
|
}
|
|
8658
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8744
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8659
8745
|
el.classList.add(
|
|
8660
8746
|
"flex",
|
|
8661
8747
|
"w-full",
|
|
@@ -8688,7 +8774,7 @@ function sidebar_default(Alpine) {
|
|
|
8688
8774
|
lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
|
|
8689
8775
|
};
|
|
8690
8776
|
function setSize2(size3) {
|
|
8691
|
-
if (
|
|
8777
|
+
if (Object.prototype.hasOwnProperty.call(sizes, size3)) {
|
|
8692
8778
|
el.classList.add(...sizes[size3]);
|
|
8693
8779
|
}
|
|
8694
8780
|
}
|
|
@@ -8789,9 +8875,9 @@ function sidebar_default(Alpine) {
|
|
|
8789
8875
|
}
|
|
8790
8876
|
el.setAttribute("data-slot", "sidebar-menu-action");
|
|
8791
8877
|
});
|
|
8792
|
-
Alpine.directive("h-sidebar-menu-badge", (el, { original
|
|
8878
|
+
Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
|
|
8793
8879
|
if (el.tagName !== "SPAN") {
|
|
8794
|
-
throw new Error(`${
|
|
8880
|
+
throw new Error(`${original} must be a span element`);
|
|
8795
8881
|
}
|
|
8796
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");
|
|
8797
8883
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
@@ -8817,13 +8903,13 @@ function sidebar_default(Alpine) {
|
|
|
8817
8903
|
el.setAttribute("data-slot", "sidebar-separator");
|
|
8818
8904
|
el.setAttribute("role", "none");
|
|
8819
8905
|
});
|
|
8820
|
-
Alpine.directive("h-sidebar-menu-sub", (el, { original
|
|
8906
|
+
Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
8821
8907
|
if (el.tagName !== "UL") {
|
|
8822
|
-
throw new Error(`${
|
|
8908
|
+
throw new Error(`${original} must be an ul element`);
|
|
8823
8909
|
}
|
|
8824
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8910
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8825
8911
|
if (!menuItem) {
|
|
8826
|
-
throw new Error(`${
|
|
8912
|
+
throw new Error(`${original} must be placed inside a sidebar menu item`);
|
|
8827
8913
|
}
|
|
8828
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");
|
|
8829
8915
|
if (el.getAttribute("data-line") !== "false") {
|
|
@@ -8898,7 +8984,7 @@ function spinner_default(Alpine) {
|
|
|
8898
8984
|
|
|
8899
8985
|
// src/components/split.js
|
|
8900
8986
|
function split_default(Alpine) {
|
|
8901
|
-
Alpine.directive("h-split", (el,
|
|
8987
|
+
Alpine.directive("h-split", (el, _, { cleanup, Alpine: Alpine2 }) => {
|
|
8902
8988
|
const panels = [];
|
|
8903
8989
|
const state = Alpine2.reactive({
|
|
8904
8990
|
isHorizontal: el.getAttribute("data-orientation") === "horizontal",
|
|
@@ -9094,10 +9180,10 @@ function split_default(Alpine) {
|
|
|
9094
9180
|
observer.disconnect();
|
|
9095
9181
|
});
|
|
9096
9182
|
});
|
|
9097
|
-
Alpine.directive("h-split-panel", (el, { original
|
|
9098
|
-
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"));
|
|
9099
9185
|
if (!split) {
|
|
9100
|
-
throw new Error(`${
|
|
9186
|
+
throw new Error(`${original} must be inside an split element`);
|
|
9101
9187
|
}
|
|
9102
9188
|
el.classList.add(
|
|
9103
9189
|
"flex",
|
|
@@ -9542,7 +9628,8 @@ function table_default(Alpine) {
|
|
|
9542
9628
|
"justify-between",
|
|
9543
9629
|
"outline-none",
|
|
9544
9630
|
"gap-2",
|
|
9545
|
-
"transition-
|
|
9631
|
+
"transition-colors",
|
|
9632
|
+
"transition-shadow",
|
|
9546
9633
|
"motion-reduce:transition-none",
|
|
9547
9634
|
"[&_svg]:pointer-events-none",
|
|
9548
9635
|
"[&_svg]:opacity-70",
|
|
@@ -9647,7 +9734,7 @@ function tabs_default(Alpine) {
|
|
|
9647
9734
|
el.setAttribute("role", "tablist");
|
|
9648
9735
|
el.setAttribute("data-slot", "tab-list");
|
|
9649
9736
|
});
|
|
9650
|
-
Alpine.directive("h-tab", (el, { original
|
|
9737
|
+
Alpine.directive("h-tab", (el, { original }) => {
|
|
9651
9738
|
el.classList.add(
|
|
9652
9739
|
"cursor-pointer",
|
|
9653
9740
|
"focus-visible:border-ring",
|
|
@@ -9668,7 +9755,8 @@ function tabs_default(Alpine) {
|
|
|
9668
9755
|
"text-sm",
|
|
9669
9756
|
"font-medium",
|
|
9670
9757
|
"whitespace-nowrap",
|
|
9671
|
-
"transition-
|
|
9758
|
+
"transition-colors",
|
|
9759
|
+
"transition-shadow",
|
|
9672
9760
|
"motion-reduce:transition-none",
|
|
9673
9761
|
"group-data-[floating=true]/tab-bar:rounded-md",
|
|
9674
9762
|
"group-data-[floating=true]/tab-bar:border",
|
|
@@ -9695,8 +9783,8 @@ function tabs_default(Alpine) {
|
|
|
9695
9783
|
);
|
|
9696
9784
|
el.setAttribute("role", "tab");
|
|
9697
9785
|
el.setAttribute("data-slot", "tab");
|
|
9698
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9699
|
-
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.`);
|
|
9700
9788
|
});
|
|
9701
9789
|
Alpine.directive("h-tab-action", (el) => {
|
|
9702
9790
|
el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
|
|
@@ -9730,13 +9818,13 @@ function tabs_default(Alpine) {
|
|
|
9730
9818
|
el.setAttribute("role", "button");
|
|
9731
9819
|
el.setAttribute("data-slot", "tab-list-action");
|
|
9732
9820
|
});
|
|
9733
|
-
Alpine.directive("h-tabs-content", (el, { original
|
|
9821
|
+
Alpine.directive("h-tabs-content", (el, { original }) => {
|
|
9734
9822
|
el.classList.add("flex-1", "outline-none");
|
|
9735
9823
|
el.setAttribute("role", "tabpanel");
|
|
9736
9824
|
el.setAttribute("tabindex", "0");
|
|
9737
9825
|
el.setAttribute("data-slot", "tabs-content");
|
|
9738
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9739
|
-
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.`);
|
|
9740
9828
|
});
|
|
9741
9829
|
}
|
|
9742
9830
|
|
|
@@ -9850,7 +9938,8 @@ function textarea_default(Alpine) {
|
|
|
9850
9938
|
"py-2",
|
|
9851
9939
|
"text-base",
|
|
9852
9940
|
"shadow-input",
|
|
9853
|
-
"transition-
|
|
9941
|
+
"transition-colors",
|
|
9942
|
+
"transition-shadow",
|
|
9854
9943
|
"motion-reduce:transition-none",
|
|
9855
9944
|
"outline-none",
|
|
9856
9945
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
@@ -10032,8 +10121,6 @@ function timepicker_default(Alpine) {
|
|
|
10032
10121
|
el.classList.add(
|
|
10033
10122
|
"cursor-pointer",
|
|
10034
10123
|
"border-input",
|
|
10035
|
-
"hover:bg-secondary-hover",
|
|
10036
|
-
"active:bg-secondary-active",
|
|
10037
10124
|
"flex",
|
|
10038
10125
|
"items-center",
|
|
10039
10126
|
"justify-between",
|
|
@@ -10043,7 +10130,8 @@ function timepicker_default(Alpine) {
|
|
|
10043
10130
|
"data-[size=sm]:pr-1",
|
|
10044
10131
|
"text-sm",
|
|
10045
10132
|
"whitespace-nowrap",
|
|
10046
|
-
"transition-
|
|
10133
|
+
"transition-colors",
|
|
10134
|
+
"transition-shadow",
|
|
10047
10135
|
"motion-reduce:transition-none",
|
|
10048
10136
|
"duration-200",
|
|
10049
10137
|
"outline-none",
|
|
@@ -10060,16 +10148,30 @@ function timepicker_default(Alpine) {
|
|
|
10060
10148
|
"has-[input[aria-invalid=true]]:inset-ring-negative/20",
|
|
10061
10149
|
"dark:has-[input[aria-invalid=true]]:inset-ring-negative/40",
|
|
10062
10150
|
"has-[input:invalid]:!inset-ring-negative/20",
|
|
10063
|
-
"dark:has-[input:invalid]:!inset-ring-negative/40"
|
|
10151
|
+
"dark:has-[input:invalid]:!inset-ring-negative/40",
|
|
10152
|
+
"hover:bg-table-hover",
|
|
10153
|
+
"hover:text-table-hover-foreground",
|
|
10154
|
+
"active:!bg-table-active",
|
|
10155
|
+
"active:!text-table-active-foreground",
|
|
10156
|
+
"has-[[aria-expanded=true]]:bg-transparent",
|
|
10157
|
+
"has-[[aria-expanded=true]]:text-foreground"
|
|
10064
10158
|
);
|
|
10065
10159
|
el.setAttribute("data-slot", "cell-input-time");
|
|
10066
10160
|
} else {
|
|
10067
10161
|
el.classList.add(
|
|
10068
10162
|
"w-full",
|
|
10163
|
+
"hover:bg-secondary-hover",
|
|
10164
|
+
"hover:text-secondary-foreground",
|
|
10165
|
+
'[&>[data-slot="time-picker-input"]]:hover:text-secondary-foreground',
|
|
10166
|
+
"active:bg-secondary-active",
|
|
10167
|
+
"active:text-secondary-foreground",
|
|
10168
|
+
'[&>[data-slot="time-picker-input"]]:active:text-secondary-foreground',
|
|
10069
10169
|
"rounded-control",
|
|
10070
10170
|
"border",
|
|
10071
10171
|
"bg-input-inner",
|
|
10072
10172
|
"shadow-input",
|
|
10173
|
+
"has-[[aria-expanded=true]]:bg-input-inner",
|
|
10174
|
+
"has-[[aria-expanded=true]]:text-foreground",
|
|
10073
10175
|
"has-[input:focus-visible]:border-ring",
|
|
10074
10176
|
"has-[input:focus-visible]:ring-[calc(var(--spacing)*0.75)]",
|
|
10075
10177
|
"has-[input:focus-visible]:ring-ring/50",
|
|
@@ -10086,7 +10188,7 @@ function timepicker_default(Alpine) {
|
|
|
10086
10188
|
el.appendChild(
|
|
10087
10189
|
createSvg({
|
|
10088
10190
|
icon: Clock,
|
|
10089
|
-
classes: "opacity-70 text-
|
|
10191
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
10090
10192
|
attrs: {
|
|
10091
10193
|
"aria-hidden": true,
|
|
10092
10194
|
role: "presentation"
|
|
@@ -10133,13 +10235,13 @@ function timepicker_default(Alpine) {
|
|
|
10133
10235
|
top.removeEventListener("click", el._h_timepicker.close);
|
|
10134
10236
|
});
|
|
10135
10237
|
});
|
|
10136
|
-
Alpine.directive("h-time-picker-input", (el, { original
|
|
10238
|
+
Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10137
10239
|
if (el.tagName !== "INPUT") {
|
|
10138
|
-
throw new Error(`${
|
|
10240
|
+
throw new Error(`${original} must be a readonly input of type "text"`);
|
|
10139
10241
|
}
|
|
10140
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10242
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10141
10243
|
if (!timepicker) {
|
|
10142
|
-
throw new Error(`${
|
|
10244
|
+
throw new Error(`${original} must be inside a time-picker element`);
|
|
10143
10245
|
}
|
|
10144
10246
|
timepicker._h_timepicker.focusInput = () => {
|
|
10145
10247
|
el.focus();
|
|
@@ -10149,7 +10251,7 @@ function timepicker_default(Alpine) {
|
|
|
10149
10251
|
el.dispatchEvent(new Event("change"));
|
|
10150
10252
|
});
|
|
10151
10253
|
};
|
|
10152
|
-
if (
|
|
10254
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
10153
10255
|
timepicker._h_timepicker.model = el._x_model;
|
|
10154
10256
|
} else {
|
|
10155
10257
|
timepicker._h_timepicker.model = {
|
|
@@ -10237,7 +10339,7 @@ function timepicker_default(Alpine) {
|
|
|
10237
10339
|
});
|
|
10238
10340
|
});
|
|
10239
10341
|
Alpine.directive("h-time-picker-popup", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10240
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10342
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10241
10343
|
el.classList.add(
|
|
10242
10344
|
"overflow-hidden",
|
|
10243
10345
|
"outline-none",
|
|
@@ -10337,7 +10439,7 @@ function timepicker_default(Alpine) {
|
|
|
10337
10439
|
}
|
|
10338
10440
|
switch (event.key) {
|
|
10339
10441
|
case "Up":
|
|
10340
|
-
case "ArrowUp":
|
|
10442
|
+
case "ArrowUp": {
|
|
10341
10443
|
event.target.setAttribute("tabindex", "-1");
|
|
10342
10444
|
let prevElem = event.target.previousElementSibling;
|
|
10343
10445
|
if (prevElem === null || prevElem.classList.contains("hidden")) {
|
|
@@ -10350,8 +10452,9 @@ function timepicker_default(Alpine) {
|
|
|
10350
10452
|
prevElem.setAttribute("tabindex", "0");
|
|
10351
10453
|
prevElem.focus();
|
|
10352
10454
|
break;
|
|
10455
|
+
}
|
|
10353
10456
|
case "Down":
|
|
10354
|
-
case "ArrowDown":
|
|
10457
|
+
case "ArrowDown": {
|
|
10355
10458
|
event.target.setAttribute("tabindex", "-1");
|
|
10356
10459
|
let nextElem = event.target.nextElementSibling;
|
|
10357
10460
|
if (nextElem === null || nextElem.classList.contains("hidden")) {
|
|
@@ -10364,8 +10467,9 @@ function timepicker_default(Alpine) {
|
|
|
10364
10467
|
nextElem.setAttribute("tabindex", "0");
|
|
10365
10468
|
nextElem.focus();
|
|
10366
10469
|
break;
|
|
10470
|
+
}
|
|
10367
10471
|
case "Home":
|
|
10368
|
-
case "PageUp":
|
|
10472
|
+
case "PageUp": {
|
|
10369
10473
|
let firstChild;
|
|
10370
10474
|
if (list.firstChild === event.target) {
|
|
10371
10475
|
break;
|
|
@@ -10382,8 +10486,9 @@ function timepicker_default(Alpine) {
|
|
|
10382
10486
|
firstChild.setAttribute("tabindex", "0");
|
|
10383
10487
|
firstChild.focus();
|
|
10384
10488
|
break;
|
|
10489
|
+
}
|
|
10385
10490
|
case "End":
|
|
10386
|
-
case "PageDown":
|
|
10491
|
+
case "PageDown": {
|
|
10387
10492
|
let lastElem;
|
|
10388
10493
|
if (list.lastChild === event.target) {
|
|
10389
10494
|
break;
|
|
@@ -10400,22 +10505,25 @@ function timepicker_default(Alpine) {
|
|
|
10400
10505
|
lastElem.setAttribute("tabindex", "0");
|
|
10401
10506
|
lastElem.focus();
|
|
10402
10507
|
break;
|
|
10508
|
+
}
|
|
10403
10509
|
case "Right":
|
|
10404
|
-
case "ArrowRight":
|
|
10510
|
+
case "ArrowRight": {
|
|
10405
10511
|
let nextColumn = event.target.parentElement.nextElementSibling;
|
|
10406
10512
|
if (nextColumn) {
|
|
10407
10513
|
const child = nextColumn.querySelector('li[tabindex="0"]');
|
|
10408
10514
|
child.focus();
|
|
10409
10515
|
}
|
|
10410
10516
|
break;
|
|
10517
|
+
}
|
|
10411
10518
|
case "Left":
|
|
10412
|
-
case "ArrowLeft":
|
|
10519
|
+
case "ArrowLeft": {
|
|
10413
10520
|
let prevColumn = event.target.parentElement.previousElementSibling;
|
|
10414
10521
|
if (prevColumn) {
|
|
10415
10522
|
const child = prevColumn.querySelector('li[tabindex="0"]');
|
|
10416
10523
|
child.focus();
|
|
10417
10524
|
}
|
|
10418
10525
|
break;
|
|
10526
|
+
}
|
|
10419
10527
|
case "Enter":
|
|
10420
10528
|
case " ":
|
|
10421
10529
|
event.target.click();
|
|
@@ -10816,16 +10924,16 @@ function tooltip_default(Alpine) {
|
|
|
10816
10924
|
el.removeEventListener("pointerleave", handler);
|
|
10817
10925
|
});
|
|
10818
10926
|
});
|
|
10819
|
-
Alpine.directive("h-tooltip", (el, { original
|
|
10927
|
+
Alpine.directive("h-tooltip", (el, { original }, { effect, cleanup }) => {
|
|
10820
10928
|
const tooltip = (() => {
|
|
10821
10929
|
let sibling = el.previousElementSibling;
|
|
10822
|
-
while (sibling && !
|
|
10930
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_tooltip")) {
|
|
10823
10931
|
sibling = sibling.previousElementSibling;
|
|
10824
10932
|
}
|
|
10825
10933
|
return sibling;
|
|
10826
10934
|
})();
|
|
10827
10935
|
if (!tooltip) {
|
|
10828
|
-
throw new Error(`${
|
|
10936
|
+
throw new Error(`${original} must be placed after a tooltip trigger element`);
|
|
10829
10937
|
}
|
|
10830
10938
|
el.classList.add(
|
|
10831
10939
|
"absolute",
|
|
@@ -10930,7 +11038,7 @@ function tree_default(Alpine) {
|
|
|
10930
11038
|
);
|
|
10931
11039
|
el.setAttribute("data-slot", "subtree");
|
|
10932
11040
|
el.setAttribute("role", "group");
|
|
10933
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11041
|
+
const treeItem = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_tree_item"));
|
|
10934
11042
|
effect(() => {
|
|
10935
11043
|
if (treeItem._h_tree_item.expanded) {
|
|
10936
11044
|
el.classList.remove("!hidden");
|
|
@@ -11070,9 +11178,9 @@ function tree_default(Alpine) {
|
|
|
11070
11178
|
});
|
|
11071
11179
|
}
|
|
11072
11180
|
});
|
|
11073
|
-
Alpine.directive("h-tree-button", (el, { original
|
|
11074
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11075
|
-
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`);
|
|
11076
11184
|
el.classList.add(
|
|
11077
11185
|
"flex",
|
|
11078
11186
|
"w-full",
|
|
@@ -11136,7 +11244,7 @@ function tree_default(Alpine) {
|
|
|
11136
11244
|
}
|
|
11137
11245
|
|
|
11138
11246
|
// package.json
|
|
11139
|
-
var version = "1.
|
|
11247
|
+
var version = "1.9.1";
|
|
11140
11248
|
|
|
11141
11249
|
// src/utils/theme.js
|
|
11142
11250
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
@@ -11229,7 +11337,7 @@ function focus_default(Alpine) {
|
|
|
11229
11337
|
|
|
11230
11338
|
// src/utils/include.js
|
|
11231
11339
|
function include_default(Alpine) {
|
|
11232
|
-
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 }) => {
|
|
11233
11341
|
const getUrl = evaluateLater(expression);
|
|
11234
11342
|
function executeScript(oldScript) {
|
|
11235
11343
|
return new Promise((resolve, reject) => {
|
|
@@ -11304,7 +11412,7 @@ function include_default(Alpine) {
|
|
|
11304
11412
|
|
|
11305
11413
|
// src/utils/template.js
|
|
11306
11414
|
function template_default(Alpine) {
|
|
11307
|
-
Alpine.directive("h-template", (el, { original
|
|
11415
|
+
Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
11308
11416
|
if (el.hasAttribute(Alpine2.prefixed("data"))) {
|
|
11309
11417
|
const template = evaluate2(expression);
|
|
11310
11418
|
const clone = template.content.cloneNode(true).firstElementChild;
|
|
@@ -11318,7 +11426,7 @@ function template_default(Alpine) {
|
|
|
11318
11426
|
clone.remove();
|
|
11319
11427
|
});
|
|
11320
11428
|
} else {
|
|
11321
|
-
console.error(`${
|
|
11429
|
+
console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
|
|
11322
11430
|
}
|
|
11323
11431
|
});
|
|
11324
11432
|
}
|