@codbex/harmonia 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmonia.css +1 -1
- package/dist/harmonia.esm.js +389 -188
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +389 -188
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +15 -2
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
|
}
|
|
@@ -4815,7 +4815,7 @@ function calendar_default(Alpine) {
|
|
|
4815
4815
|
];
|
|
4816
4816
|
const previousYearBtn = document.createElement("button");
|
|
4817
4817
|
previousYearBtn.classList.add(...buttonClasses);
|
|
4818
|
-
previousYearBtn.setAttribute("aria-label", el.hasAttribute("data-aria-prev-year") ? el.
|
|
4818
|
+
previousYearBtn.setAttribute("aria-label", el.hasAttribute("data-aria-prev-year") ? el.getAttribute("data-aria-prev-year") : "previous year");
|
|
4819
4819
|
previousYearBtn.setAttribute("type", "button");
|
|
4820
4820
|
previousYearBtn.appendChild(
|
|
4821
4821
|
createSvg({
|
|
@@ -4834,7 +4834,7 @@ function calendar_default(Alpine) {
|
|
|
4834
4834
|
header.appendChild(previousYearBtn);
|
|
4835
4835
|
const previousMonthBtn = document.createElement("button");
|
|
4836
4836
|
previousMonthBtn.classList.add(...buttonClasses);
|
|
4837
|
-
previousMonthBtn.setAttribute("aria-label", el.hasAttribute("data-aria-prev-month") ? el.
|
|
4837
|
+
previousMonthBtn.setAttribute("aria-label", el.hasAttribute("data-aria-prev-month") ? el.getAttribute("data-aria-prev-month") : "previous month");
|
|
4838
4838
|
previousMonthBtn.setAttribute("type", "button");
|
|
4839
4839
|
previousMonthBtn.appendChild(
|
|
4840
4840
|
createSvg({
|
|
@@ -4858,7 +4858,7 @@ function calendar_default(Alpine) {
|
|
|
4858
4858
|
header.appendChild(headerLabel);
|
|
4859
4859
|
const nextMonthBtn = document.createElement("button");
|
|
4860
4860
|
nextMonthBtn.classList.add(...buttonClasses);
|
|
4861
|
-
nextMonthBtn.setAttribute("aria-label", el.hasAttribute("data-aria-next-month") ? el.
|
|
4861
|
+
nextMonthBtn.setAttribute("aria-label", el.hasAttribute("data-aria-next-month") ? el.getAttribute("data-aria-next-month") : "next month");
|
|
4862
4862
|
nextMonthBtn.setAttribute("type", "button");
|
|
4863
4863
|
nextMonthBtn.appendChild(
|
|
4864
4864
|
createSvg({
|
|
@@ -4877,7 +4877,7 @@ function calendar_default(Alpine) {
|
|
|
4877
4877
|
header.appendChild(nextMonthBtn);
|
|
4878
4878
|
const nextYearBtn = document.createElement("button");
|
|
4879
4879
|
nextYearBtn.classList.add(...buttonClasses);
|
|
4880
|
-
nextYearBtn.setAttribute("aria-label", el.hasAttribute("data-aria-next-year") ? el.
|
|
4880
|
+
nextYearBtn.setAttribute("aria-label", el.hasAttribute("data-aria-next-year") ? el.getAttribute("data-aria-next-year") : "next year");
|
|
4881
4881
|
nextYearBtn.setAttribute("type", "button");
|
|
4882
4882
|
nextYearBtn.appendChild(
|
|
4883
4883
|
createSvg({
|
|
@@ -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(() => {
|
|
@@ -5282,6 +5282,192 @@ function checkbox_default(Alpine) {
|
|
|
5282
5282
|
});
|
|
5283
5283
|
}
|
|
5284
5284
|
|
|
5285
|
+
// src/components/chip.js
|
|
5286
|
+
function chip_default(Alpine) {
|
|
5287
|
+
Alpine.directive("h-chip", (el, { original }, { cleanup }) => {
|
|
5288
|
+
if (el.tagName !== "BUTTON") {
|
|
5289
|
+
throw new Error(`${original} must be a button element`);
|
|
5290
|
+
}
|
|
5291
|
+
el._h_chip = Alpine.reactive({
|
|
5292
|
+
variant: "default"
|
|
5293
|
+
});
|
|
5294
|
+
el.classList.add(
|
|
5295
|
+
"cursor-pointer",
|
|
5296
|
+
"inline-flex",
|
|
5297
|
+
"items-center",
|
|
5298
|
+
"justify-center",
|
|
5299
|
+
"whitespace-nowrap",
|
|
5300
|
+
"rounded-full",
|
|
5301
|
+
"text-sm",
|
|
5302
|
+
"leading-none",
|
|
5303
|
+
"transform-gpu",
|
|
5304
|
+
"overflow-hidden",
|
|
5305
|
+
"transition-all",
|
|
5306
|
+
"duration-100",
|
|
5307
|
+
"motion-reduce:transition-none",
|
|
5308
|
+
"disabled:pointer-events-none",
|
|
5309
|
+
"disabled:opacity-50",
|
|
5310
|
+
"[&_svg]:pointer-events-none",
|
|
5311
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
5312
|
+
"shrink-0",
|
|
5313
|
+
"[&_svg]:shrink-0",
|
|
5314
|
+
"focus-visible:outline-[calc(var(--spacing)*0.75)]",
|
|
5315
|
+
"focus-visible:outline",
|
|
5316
|
+
"h-7",
|
|
5317
|
+
"gap-1.5",
|
|
5318
|
+
"px-2.5",
|
|
5319
|
+
"has-[>svg]:pl-1.5",
|
|
5320
|
+
"has-[>[data-slot=chip-close]]:pr-0",
|
|
5321
|
+
"has-[>[data-slot=spinner]]:px-2",
|
|
5322
|
+
"text-secondary-foreground",
|
|
5323
|
+
"fill-secondary-foreground",
|
|
5324
|
+
"border"
|
|
5325
|
+
);
|
|
5326
|
+
if (!el.hasAttribute("type")) {
|
|
5327
|
+
el.setAttribute("type", "button");
|
|
5328
|
+
}
|
|
5329
|
+
el.setAttribute("data-slot", "chip");
|
|
5330
|
+
const variants = {
|
|
5331
|
+
default: ["bg-secondary", "[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-secondary-hover", "[&:active:not(:has([data-slot=chip-close]:active))]:bg-secondary-active", "outline-ring/50"],
|
|
5332
|
+
primary: [
|
|
5333
|
+
"bg-primary/10",
|
|
5334
|
+
"border-primary/50",
|
|
5335
|
+
"[&>svg]:fill-primary",
|
|
5336
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-primary/15",
|
|
5337
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-primary/20",
|
|
5338
|
+
"outline-primary/50"
|
|
5339
|
+
],
|
|
5340
|
+
positive: [
|
|
5341
|
+
"bg-positive/10",
|
|
5342
|
+
"border-positive/50",
|
|
5343
|
+
"[&>svg]:fill-positive",
|
|
5344
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-positive/15",
|
|
5345
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-positive/20",
|
|
5346
|
+
"outline-positive/50"
|
|
5347
|
+
],
|
|
5348
|
+
negative: [
|
|
5349
|
+
"bg-negative/10",
|
|
5350
|
+
"border-negative/50",
|
|
5351
|
+
"[&>svg]:fill-negative",
|
|
5352
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-negative/15",
|
|
5353
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-negative/20",
|
|
5354
|
+
"outline-negative/50"
|
|
5355
|
+
],
|
|
5356
|
+
warning: [
|
|
5357
|
+
"bg-warning/10",
|
|
5358
|
+
"border-warning/50",
|
|
5359
|
+
"[&>svg]:fill-warning",
|
|
5360
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-warning/15",
|
|
5361
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-warning/20",
|
|
5362
|
+
"outline-warning/50"
|
|
5363
|
+
],
|
|
5364
|
+
information: [
|
|
5365
|
+
"bg-information/10",
|
|
5366
|
+
"border-information/50",
|
|
5367
|
+
"[&>svg]:fill-information",
|
|
5368
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-information/15",
|
|
5369
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-information/20",
|
|
5370
|
+
"outline-information/50"
|
|
5371
|
+
],
|
|
5372
|
+
outline: [
|
|
5373
|
+
"bg-background",
|
|
5374
|
+
"[&>svg]:fill-secondary-foreground",
|
|
5375
|
+
"[&:hover:not(:has([data-slot=chip-close]:hover)):not(:active)]:bg-secondary-hover",
|
|
5376
|
+
"[&:active:not(:has([data-slot=chip-close]:active))]:bg-secondary-active",
|
|
5377
|
+
"outline-ring/50"
|
|
5378
|
+
]
|
|
5379
|
+
};
|
|
5380
|
+
function setVariant(variant) {
|
|
5381
|
+
el._h_chip.variant = variant;
|
|
5382
|
+
for (const [_, value] of Object.entries(variants)) {
|
|
5383
|
+
el.classList.remove(...value);
|
|
5384
|
+
}
|
|
5385
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
5386
|
+
}
|
|
5387
|
+
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
5388
|
+
const observer = new MutationObserver(() => {
|
|
5389
|
+
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
5390
|
+
});
|
|
5391
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant"] });
|
|
5392
|
+
cleanup(() => {
|
|
5393
|
+
observer.disconnect();
|
|
5394
|
+
});
|
|
5395
|
+
});
|
|
5396
|
+
Alpine.directive("h-chip-close", (el, { original }, { effect, cleanup }) => {
|
|
5397
|
+
if (el.tagName === "BUTTON") {
|
|
5398
|
+
throw new Error(`${original} must NOT be a button element`);
|
|
5399
|
+
}
|
|
5400
|
+
const chip = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_chip"));
|
|
5401
|
+
el.classList.add(
|
|
5402
|
+
"cursor-pointer",
|
|
5403
|
+
"inline-flex",
|
|
5404
|
+
"items-center",
|
|
5405
|
+
"justify-center",
|
|
5406
|
+
"pl-1",
|
|
5407
|
+
"pr-1.5",
|
|
5408
|
+
"h-full",
|
|
5409
|
+
"text-sm",
|
|
5410
|
+
"transition-all",
|
|
5411
|
+
"duration-100",
|
|
5412
|
+
"motion-reduce:transition-none",
|
|
5413
|
+
"disabled:pointer-events-none",
|
|
5414
|
+
"disabled:opacity-50",
|
|
5415
|
+
"bg-transparent",
|
|
5416
|
+
"text-secondary-foreground",
|
|
5417
|
+
"fill-secondary-foreground",
|
|
5418
|
+
"rounded-r-full",
|
|
5419
|
+
"border-l",
|
|
5420
|
+
"border-transparent",
|
|
5421
|
+
"outline-none",
|
|
5422
|
+
"focus-visible:inset-ring-[calc(var(--spacing)*0.75)]",
|
|
5423
|
+
"focus-visible:inset-ring",
|
|
5424
|
+
"hover:[[data-variant]>&]:border-inherit",
|
|
5425
|
+
"active:border-inherit",
|
|
5426
|
+
"aria-pressed:border-inherit"
|
|
5427
|
+
);
|
|
5428
|
+
el.setAttribute("data-slot", "chip-close");
|
|
5429
|
+
el.setAttribute("tabindex", "0");
|
|
5430
|
+
el.setAttribute("role", "button");
|
|
5431
|
+
el.appendChild(
|
|
5432
|
+
createSvg({
|
|
5433
|
+
icon: Close,
|
|
5434
|
+
classes: "size-3.5 shrink-0 pointer-events-none",
|
|
5435
|
+
attrs: {
|
|
5436
|
+
"aria-hidden": true,
|
|
5437
|
+
role: "presentation"
|
|
5438
|
+
}
|
|
5439
|
+
})
|
|
5440
|
+
);
|
|
5441
|
+
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5442
|
+
console.error(`${original}: Must have an "aria-label" or "aria-labelledby" attribute`, el);
|
|
5443
|
+
}
|
|
5444
|
+
const variants = {
|
|
5445
|
+
default: ["hover:border-foreground/20", "hover:bg-secondary-hover", "active:bg-secondary-active", "focus-visible:inset-ring-ring/50"],
|
|
5446
|
+
primary: ["hover:bg-primary/10", "active:bg-primary/15", "aria-pressed:bg-primary/15", "focus-visible:inset-ring-primary/50"],
|
|
5447
|
+
positive: ["hover:bg-positive/10", "active:bg-positive/15", "aria-pressed:bg-positive/15", "focus-visible:inset-ring-positive/50"],
|
|
5448
|
+
negative: ["hover:bg-negative/10", "active:bg-negative/15", "aria-pressed:bg-negative/15", "focus-visible:inset-ring-negative/50"],
|
|
5449
|
+
warning: ["hover:bg-warning/10", "active:bg-warning/15", "aria-pressed:bg-warning/15", "focus-visible:inset-ring-warning/50"],
|
|
5450
|
+
information: ["hover:bg-information/10", "active:bg-information/15", "aria-pressed:bg-information/15", "focus-visible:inset-ring-information/50"],
|
|
5451
|
+
outline: ["hover:bg-secondary-hover", "active:bg-secondary-active", "aria-pressed:bg-secondary-active", "focus-visible:inset-ring-ring/50"]
|
|
5452
|
+
};
|
|
5453
|
+
effect(() => {
|
|
5454
|
+
for (const [_, value] of Object.entries(variants)) {
|
|
5455
|
+
el.classList.remove(...value);
|
|
5456
|
+
}
|
|
5457
|
+
if (Object.prototype.hasOwnProperty.call(variants, chip._h_chip.variant)) {
|
|
5458
|
+
el.classList.add(...variants[chip._h_chip.variant]);
|
|
5459
|
+
}
|
|
5460
|
+
});
|
|
5461
|
+
const stopPropagation = (event) => {
|
|
5462
|
+
if (chip.getAttribute("aria-expanded") !== "true") event.stopPropagation();
|
|
5463
|
+
};
|
|
5464
|
+
el.addEventListener("click", stopPropagation);
|
|
5465
|
+
cleanup(() => {
|
|
5466
|
+
el.removeEventListener("click", stopPropagation);
|
|
5467
|
+
});
|
|
5468
|
+
});
|
|
5469
|
+
}
|
|
5470
|
+
|
|
5285
5471
|
// src/common/input-size.js
|
|
5286
5472
|
function setSize(el, size3) {
|
|
5287
5473
|
if (size3 === "sm") {
|
|
@@ -5303,7 +5489,7 @@ function sizeObserver(el) {
|
|
|
5303
5489
|
|
|
5304
5490
|
// src/components/datepicker.js
|
|
5305
5491
|
function datepicker_default(Alpine) {
|
|
5306
|
-
Alpine.directive("h-date-picker", (el, { original
|
|
5492
|
+
Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
|
|
5307
5493
|
const state = Alpine2.reactive({
|
|
5308
5494
|
expanded: false
|
|
5309
5495
|
});
|
|
@@ -5316,7 +5502,7 @@ function datepicker_default(Alpine) {
|
|
|
5316
5502
|
};
|
|
5317
5503
|
el._h_datepicker.input = el.querySelector("input");
|
|
5318
5504
|
if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
|
|
5319
|
-
throw new Error(`${
|
|
5505
|
+
throw new Error(`${original} must contain an input`);
|
|
5320
5506
|
} else if (el._h_datepicker.input.hasAttribute("id")) {
|
|
5321
5507
|
el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
|
|
5322
5508
|
} else {
|
|
@@ -5395,16 +5581,16 @@ function datepicker_default(Alpine) {
|
|
|
5395
5581
|
observer.disconnect();
|
|
5396
5582
|
});
|
|
5397
5583
|
});
|
|
5398
|
-
Alpine.directive("h-date-picker-trigger", (el, { original
|
|
5584
|
+
Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
5399
5585
|
if (el.tagName !== "BUTTON") {
|
|
5400
|
-
throw new Error(`${
|
|
5586
|
+
throw new Error(`${original} must be a button`);
|
|
5401
5587
|
}
|
|
5402
5588
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5403
|
-
throw new Error(`${
|
|
5589
|
+
throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5404
5590
|
}
|
|
5405
|
-
const datepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5591
|
+
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_datepicker"));
|
|
5406
5592
|
if (!datepicker) {
|
|
5407
|
-
throw new Error(`${
|
|
5593
|
+
throw new Error(`${original} must be inside an date-picker element`);
|
|
5408
5594
|
}
|
|
5409
5595
|
el.classList.add(
|
|
5410
5596
|
"cursor-pointer",
|
|
@@ -5583,7 +5769,7 @@ function dialog_default(Alpine) {
|
|
|
5583
5769
|
el.classList.add("order-1", "text-lg", "leading-none", "font-semibold");
|
|
5584
5770
|
el.setAttribute("data-slot", "dialog-title");
|
|
5585
5771
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
5586
|
-
if (dialog &&
|
|
5772
|
+
if (dialog && !dialog.hasAttribute("aria-labelledby") && !dialog.hasAttribute("aria-label")) {
|
|
5587
5773
|
if (!el.hasAttribute("id")) {
|
|
5588
5774
|
const id = `dht${uuid_default()}`;
|
|
5589
5775
|
el.setAttribute("id", id);
|
|
@@ -5616,7 +5802,7 @@ function dialog_default(Alpine) {
|
|
|
5616
5802
|
el.classList.add("order-3", "col-span-full", "text-muted-foreground", "text-sm");
|
|
5617
5803
|
el.setAttribute("data-slot", "dialog-description");
|
|
5618
5804
|
const dialog = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "dialog");
|
|
5619
|
-
if (dialog &&
|
|
5805
|
+
if (dialog && !dialog.hasAttribute("aria-describedby") && !dialog.hasAttribute("aria-description")) {
|
|
5620
5806
|
if (!el.hasAttribute("id")) {
|
|
5621
5807
|
const id = `dhd${uuid_default()}`;
|
|
5622
5808
|
el.setAttribute("id", id);
|
|
@@ -5692,13 +5878,13 @@ function expansion_panel_default(Alpine) {
|
|
|
5692
5878
|
});
|
|
5693
5879
|
}
|
|
5694
5880
|
});
|
|
5695
|
-
Alpine.directive("h-exp-panel-trigger", (el, { original
|
|
5881
|
+
Alpine.directive("h-exp-panel-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
5696
5882
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
5697
|
-
throw new Error(`${
|
|
5883
|
+
throw new Error(`${original} must be a header element`);
|
|
5698
5884
|
}
|
|
5699
|
-
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
5885
|
+
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_expPanelItem"));
|
|
5700
5886
|
if (!expPanelItem) {
|
|
5701
|
-
throw new Error(`${
|
|
5887
|
+
throw new Error(`${original} must have an exp-panel-item parent element`);
|
|
5702
5888
|
}
|
|
5703
5889
|
el.classList.add(
|
|
5704
5890
|
"bg-object-header",
|
|
@@ -5879,13 +6065,13 @@ function fieldset_default(Alpine) {
|
|
|
5879
6065
|
|
|
5880
6066
|
// src/components/icon.js
|
|
5881
6067
|
function icon_default(Alpine) {
|
|
5882
|
-
Alpine.directive("h-icon", (el, { original
|
|
6068
|
+
Alpine.directive("h-icon", (el, { original, modifiers }) => {
|
|
5883
6069
|
if (el.tagName.toLowerCase() !== "svg") {
|
|
5884
|
-
throw new Error(`${
|
|
6070
|
+
throw new Error(`${original} works only on svg elements`);
|
|
5885
6071
|
} else if (!el.hasAttribute("role")) {
|
|
5886
|
-
throw new Error(`${
|
|
6072
|
+
throw new Error(`${original} must have a role`);
|
|
5887
6073
|
} else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
5888
|
-
throw new Error(`${
|
|
6074
|
+
throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
|
|
5889
6075
|
}
|
|
5890
6076
|
el.classList.add("fill-current");
|
|
5891
6077
|
el.setAttribute("data-slot", "icon");
|
|
@@ -5935,7 +6121,7 @@ function info_page_default(Alpine) {
|
|
|
5935
6121
|
});
|
|
5936
6122
|
Alpine.directive("h-info-page-content", (el) => {
|
|
5937
6123
|
el.classList.add("vbox", "w-full", "max-w-sm", "min-w-0", "items-center", "gap-4", "text-sm", "text-balance");
|
|
5938
|
-
el.setAttribute("data-slot", "info-page-
|
|
6124
|
+
el.setAttribute("data-slot", "info-page-content");
|
|
5939
6125
|
});
|
|
5940
6126
|
}
|
|
5941
6127
|
|
|
@@ -6086,7 +6272,7 @@ function input_default(Alpine) {
|
|
|
6086
6272
|
"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
6273
|
};
|
|
6088
6274
|
function setVariant(variant) {
|
|
6089
|
-
if (
|
|
6275
|
+
if (Object.prototype.hasOwnProperty.call(variants, variant)) el.classList.add(...variants[variant]);
|
|
6090
6276
|
}
|
|
6091
6277
|
setVariant(el.getAttribute("data-align") ?? "inline-start");
|
|
6092
6278
|
const handler = (event) => {
|
|
@@ -6106,7 +6292,7 @@ function input_default(Alpine) {
|
|
|
6106
6292
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
6107
6293
|
el.setAttribute("data-slot", "label");
|
|
6108
6294
|
});
|
|
6109
|
-
Alpine.directive("h-input-number", (el, { original
|
|
6295
|
+
Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
|
|
6110
6296
|
el.classList.add(
|
|
6111
6297
|
"overflow-hidden",
|
|
6112
6298
|
"group/input-number",
|
|
@@ -6142,7 +6328,7 @@ function input_default(Alpine) {
|
|
|
6142
6328
|
el.setAttribute("data-slot", "input-number");
|
|
6143
6329
|
const input = el.querySelector("input");
|
|
6144
6330
|
if (!input || input.getAttribute("type") !== "number") {
|
|
6145
|
-
throw new Error(`${
|
|
6331
|
+
throw new Error(`${original} must contain an input of type 'number'`);
|
|
6146
6332
|
}
|
|
6147
6333
|
if (!input.hasAttribute("type")) input.setAttribute("type", "number");
|
|
6148
6334
|
if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
|
|
@@ -6356,7 +6542,8 @@ function list_default(Alpine) {
|
|
|
6356
6542
|
focusLastOption(el);
|
|
6357
6543
|
break;
|
|
6358
6544
|
case "Up":
|
|
6359
|
-
case "ArrowUp":
|
|
6545
|
+
case "ArrowUp": {
|
|
6546
|
+
event.preventDefault();
|
|
6360
6547
|
let prevElem = event.target.previousElementSibling;
|
|
6361
6548
|
if (prevElem && prevElem.getAttribute("data-slot") !== "list-header") {
|
|
6362
6549
|
prevElem.focus();
|
|
@@ -6367,8 +6554,10 @@ function list_default(Alpine) {
|
|
|
6367
6554
|
}
|
|
6368
6555
|
}
|
|
6369
6556
|
break;
|
|
6557
|
+
}
|
|
6370
6558
|
case "Down":
|
|
6371
|
-
case "ArrowDown":
|
|
6559
|
+
case "ArrowDown": {
|
|
6560
|
+
event.preventDefault();
|
|
6372
6561
|
let nextElem = event.target.nextElementSibling;
|
|
6373
6562
|
if (nextElem) {
|
|
6374
6563
|
nextElem.focus();
|
|
@@ -6379,6 +6568,7 @@ function list_default(Alpine) {
|
|
|
6379
6568
|
}
|
|
6380
6569
|
}
|
|
6381
6570
|
break;
|
|
6571
|
+
}
|
|
6382
6572
|
case " ":
|
|
6383
6573
|
case "Enter":
|
|
6384
6574
|
selectOption(event.target);
|
|
@@ -6402,13 +6592,13 @@ function list_default(Alpine) {
|
|
|
6402
6592
|
el.setAttribute("data-slot", "list");
|
|
6403
6593
|
el.setAttribute("role", "group");
|
|
6404
6594
|
});
|
|
6405
|
-
Alpine.directive("h-list-header", (el, { original
|
|
6595
|
+
Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
|
|
6406
6596
|
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
6407
6597
|
el.setAttribute("role", "presentation");
|
|
6408
6598
|
el.setAttribute("data-slot", "list-header");
|
|
6409
6599
|
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
6410
6600
|
if (!list) {
|
|
6411
|
-
throw new Error(`${
|
|
6601
|
+
throw new Error(`${original} must be placed inside a list element`);
|
|
6412
6602
|
}
|
|
6413
6603
|
if (!el.hasAttribute("id")) {
|
|
6414
6604
|
const id = `lbh${uuid_default()}`;
|
|
@@ -6466,9 +6656,9 @@ function menu_default(Alpine) {
|
|
|
6466
6656
|
}
|
|
6467
6657
|
}
|
|
6468
6658
|
});
|
|
6469
|
-
Alpine.directive("h-menu", (el, { original
|
|
6659
|
+
Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
6470
6660
|
if (el.tagName !== "UL") {
|
|
6471
|
-
throw new Error(`${
|
|
6661
|
+
throw new Error(`${original} must be an ul element`);
|
|
6472
6662
|
}
|
|
6473
6663
|
el.classList.add(
|
|
6474
6664
|
"hidden",
|
|
@@ -6500,11 +6690,11 @@ function menu_default(Alpine) {
|
|
|
6500
6690
|
const menuTrigger = (() => {
|
|
6501
6691
|
if (isSubmenu) return;
|
|
6502
6692
|
let sibling = el.previousElementSibling;
|
|
6503
|
-
while (sibling && !
|
|
6693
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_menu_trigger")) {
|
|
6504
6694
|
sibling = sibling.previousElementSibling;
|
|
6505
6695
|
}
|
|
6506
|
-
if (!
|
|
6507
|
-
throw new Error(`${
|
|
6696
|
+
if (!Object.prototype.hasOwnProperty.call(sibling, "_menu_trigger")) {
|
|
6697
|
+
throw new Error(`${original} menu must be placed after a menu trigger element`);
|
|
6508
6698
|
}
|
|
6509
6699
|
return sibling;
|
|
6510
6700
|
})();
|
|
@@ -6513,7 +6703,7 @@ function menu_default(Alpine) {
|
|
|
6513
6703
|
if (parent && parent.hasAttribute("id")) {
|
|
6514
6704
|
el.setAttribute("aria-labelledby", parent.id);
|
|
6515
6705
|
} else {
|
|
6516
|
-
throw new Error(`${
|
|
6706
|
+
throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
6517
6707
|
}
|
|
6518
6708
|
}
|
|
6519
6709
|
}
|
|
@@ -6521,7 +6711,7 @@ function menu_default(Alpine) {
|
|
|
6521
6711
|
if (isSubmenu) {
|
|
6522
6712
|
menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
6523
6713
|
if (!menuSubItem) {
|
|
6524
|
-
throw new Error(`${
|
|
6714
|
+
throw new Error(`${original} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
|
|
6525
6715
|
}
|
|
6526
6716
|
setAriaAttrubutes(menuSubItem);
|
|
6527
6717
|
} else if (menuTrigger) {
|
|
@@ -6629,7 +6819,7 @@ function menu_default(Alpine) {
|
|
|
6629
6819
|
}
|
|
6630
6820
|
break;
|
|
6631
6821
|
case "Up":
|
|
6632
|
-
case "ArrowUp":
|
|
6822
|
+
case "ArrowUp": {
|
|
6633
6823
|
event.preventDefault();
|
|
6634
6824
|
let menuitems = el.querySelectorAll(':scope > [role^=menuitem][tabIndex="-1"]:has(~ [role^=menuitem][tabIndex="0"])');
|
|
6635
6825
|
if (menuitems.length) {
|
|
@@ -6641,6 +6831,7 @@ function menu_default(Alpine) {
|
|
|
6641
6831
|
menuitem.focus();
|
|
6642
6832
|
}
|
|
6643
6833
|
break;
|
|
6834
|
+
}
|
|
6644
6835
|
case "Home":
|
|
6645
6836
|
case "PageUp":
|
|
6646
6837
|
event.preventDefault();
|
|
@@ -6762,9 +6953,9 @@ function menu_default(Alpine) {
|
|
|
6762
6953
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
6763
6954
|
});
|
|
6764
6955
|
});
|
|
6765
|
-
Alpine.directive("h-menu-item", (el, { original
|
|
6956
|
+
Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6766
6957
|
if (el.tagName !== "LI") {
|
|
6767
|
-
throw new Error(`${
|
|
6958
|
+
throw new Error(`${original} must be a li element`);
|
|
6768
6959
|
}
|
|
6769
6960
|
el.classList.add(
|
|
6770
6961
|
"focus:bg-secondary-hover",
|
|
@@ -6818,7 +7009,7 @@ function menu_default(Alpine) {
|
|
|
6818
7009
|
el.removeEventListener("mouseleave", focusOut);
|
|
6819
7010
|
});
|
|
6820
7011
|
});
|
|
6821
|
-
Alpine.directive("h-menu-sub", (el, { original
|
|
7012
|
+
Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6822
7013
|
el.classList.add(
|
|
6823
7014
|
"focus:bg-secondary-hover",
|
|
6824
7015
|
"hover:bg-secondary-hover",
|
|
@@ -6850,7 +7041,7 @@ function menu_default(Alpine) {
|
|
|
6850
7041
|
const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
|
|
6851
7042
|
el.appendChild(chevronRight);
|
|
6852
7043
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6853
|
-
if (!parentMenu) throw new Error(`${
|
|
7044
|
+
if (!parentMenu) throw new Error(`${original} must have a parent`);
|
|
6854
7045
|
if (!el.hasAttribute("id")) {
|
|
6855
7046
|
el.setAttribute("id", `ms${uuid_default()}`);
|
|
6856
7047
|
}
|
|
@@ -6947,9 +7138,9 @@ function menu_default(Alpine) {
|
|
|
6947
7138
|
el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
|
|
6948
7139
|
el.setAttribute("data-slot", "menu-label");
|
|
6949
7140
|
});
|
|
6950
|
-
Alpine.directive("h-menu-checkbox-item", (el, { original
|
|
7141
|
+
Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
6951
7142
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
6952
|
-
throw new Error(`${
|
|
7143
|
+
throw new Error(`${original} must be a li or div element`);
|
|
6953
7144
|
}
|
|
6954
7145
|
el.classList.add(
|
|
6955
7146
|
"focus:bg-secondary-hover",
|
|
@@ -6989,7 +7180,7 @@ function menu_default(Alpine) {
|
|
|
6989
7180
|
el._x_model.set(!el._x_model.get());
|
|
6990
7181
|
setState(el._x_model.get());
|
|
6991
7182
|
}
|
|
6992
|
-
if (
|
|
7183
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
6993
7184
|
setState(el._x_model.get(), false);
|
|
6994
7185
|
el.addEventListener("click", onActivate);
|
|
6995
7186
|
}
|
|
@@ -7006,7 +7197,7 @@ function menu_default(Alpine) {
|
|
|
7006
7197
|
el.addEventListener("mouseenter", focusIn);
|
|
7007
7198
|
el.addEventListener("focus", focusIn);
|
|
7008
7199
|
cleanup(() => {
|
|
7009
|
-
if (
|
|
7200
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7010
7201
|
el.removeEventListener("click", onActivate);
|
|
7011
7202
|
el.removeEventListener("keydown", onActivate);
|
|
7012
7203
|
}
|
|
@@ -7016,9 +7207,9 @@ function menu_default(Alpine) {
|
|
|
7016
7207
|
el.removeEventListener("mouseleave", focusOut);
|
|
7017
7208
|
});
|
|
7018
7209
|
});
|
|
7019
|
-
Alpine.directive("h-menu-radio-item", (el, { original
|
|
7210
|
+
Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
7020
7211
|
if (el.tagName !== "LI" && el.tagName !== "DIV") {
|
|
7021
|
-
throw new Error(`${
|
|
7212
|
+
throw new Error(`${original} must be a li or div element`);
|
|
7022
7213
|
}
|
|
7023
7214
|
el.classList.add(
|
|
7024
7215
|
"focus:bg-secondary-hover",
|
|
@@ -7074,7 +7265,7 @@ function menu_default(Alpine) {
|
|
|
7074
7265
|
el._x_model.set(value);
|
|
7075
7266
|
}
|
|
7076
7267
|
}
|
|
7077
|
-
if (
|
|
7268
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7078
7269
|
effect(() => {
|
|
7079
7270
|
setState(el._x_model.get() === value);
|
|
7080
7271
|
});
|
|
@@ -7094,7 +7285,7 @@ function menu_default(Alpine) {
|
|
|
7094
7285
|
el.addEventListener("mouseenter", focusIn);
|
|
7095
7286
|
el.addEventListener("focus", focusIn);
|
|
7096
7287
|
cleanup(() => {
|
|
7097
|
-
if (
|
|
7288
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7098
7289
|
el.removeEventListener("click", onActivate);
|
|
7099
7290
|
el.removeEventListener("keydown", onActivate);
|
|
7100
7291
|
}
|
|
@@ -7142,7 +7333,7 @@ function notifications_default(Alpine) {
|
|
|
7142
7333
|
};
|
|
7143
7334
|
this.items.push(item);
|
|
7144
7335
|
this.listeners.forEach((listener) => {
|
|
7145
|
-
if (
|
|
7336
|
+
if (Object.prototype.hasOwnProperty.call(listener, "added")) listener.added(item);
|
|
7146
7337
|
});
|
|
7147
7338
|
},
|
|
7148
7339
|
update(id, data) {
|
|
@@ -7155,7 +7346,7 @@ function notifications_default(Alpine) {
|
|
|
7155
7346
|
this.items[index].data[key] = value;
|
|
7156
7347
|
}
|
|
7157
7348
|
this.listeners.forEach((listener) => {
|
|
7158
|
-
if (
|
|
7349
|
+
if (Object.prototype.hasOwnProperty.call(listener, "updated")) listener.updated(id, data);
|
|
7159
7350
|
});
|
|
7160
7351
|
} else {
|
|
7161
7352
|
console.error(`Notification with id "${id}" does not exist`);
|
|
@@ -7166,7 +7357,7 @@ function notifications_default(Alpine) {
|
|
|
7166
7357
|
throw new Error("Cannot remove a notification if an ID is not provided");
|
|
7167
7358
|
}
|
|
7168
7359
|
this.listeners.forEach((listener) => {
|
|
7169
|
-
if (
|
|
7360
|
+
if (Object.prototype.hasOwnProperty.call(listener, "removed")) listener.removed(id);
|
|
7170
7361
|
});
|
|
7171
7362
|
this.items = this.items.filter((n) => n.id !== id);
|
|
7172
7363
|
}
|
|
@@ -7191,9 +7382,9 @@ function notifications_default(Alpine) {
|
|
|
7191
7382
|
}
|
|
7192
7383
|
};
|
|
7193
7384
|
});
|
|
7194
|
-
Alpine.directive("h-notification-overlay", (el, { original
|
|
7385
|
+
Alpine.directive("h-notification-overlay", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7195
7386
|
if (el.tagName !== "SECTION") {
|
|
7196
|
-
throw new Error(`${
|
|
7387
|
+
throw new Error(`${original} must be a button`);
|
|
7197
7388
|
}
|
|
7198
7389
|
const notificationTemplates = {};
|
|
7199
7390
|
el.querySelectorAll("template").forEach((template) => {
|
|
@@ -7328,17 +7519,17 @@ function notifications_default(Alpine) {
|
|
|
7328
7519
|
xlBreakpointListener.remove();
|
|
7329
7520
|
});
|
|
7330
7521
|
});
|
|
7331
|
-
Alpine.directive("h-notification-list", (el, { original
|
|
7522
|
+
Alpine.directive("h-notification-list", (el, { original }) => {
|
|
7332
7523
|
if (el.tagName !== "OL" && el.tagName !== "UL") {
|
|
7333
|
-
throw new Error(`${
|
|
7524
|
+
throw new Error(`${original} must be a list element`);
|
|
7334
7525
|
}
|
|
7335
7526
|
el.classList.add("flex", "flex-col", "divide-solid", "divide-y");
|
|
7336
7527
|
el.setAttribute("data-slot", "notification-list");
|
|
7337
7528
|
el.setAttribute("role", "group");
|
|
7338
7529
|
});
|
|
7339
|
-
Alpine.directive("h-notification", (el, { original
|
|
7530
|
+
Alpine.directive("h-notification", (el, { original, modifiers }) => {
|
|
7340
7531
|
if (el.tagName !== "LI") {
|
|
7341
|
-
throw new Error(`${
|
|
7532
|
+
throw new Error(`${original} must be a list item element`);
|
|
7342
7533
|
}
|
|
7343
7534
|
el.classList.add("pointer-events-auto", "p-3", "flex", "gap-2");
|
|
7344
7535
|
if (modifiers.includes("floating")) {
|
|
@@ -7374,7 +7565,7 @@ function notifications_default(Alpine) {
|
|
|
7374
7565
|
el.classList.add("flex", "gap-2", "data-[orientation=vertical]:flex-col");
|
|
7375
7566
|
el.setAttribute("data-slot", "notification-actions");
|
|
7376
7567
|
});
|
|
7377
|
-
Alpine.directive("h-notification-close", (el, { original
|
|
7568
|
+
Alpine.directive("h-notification-close", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
7378
7569
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "notification-close");
|
|
7379
7570
|
let nId;
|
|
7380
7571
|
function close() {
|
|
@@ -7393,7 +7584,7 @@ function notifications_default(Alpine) {
|
|
|
7393
7584
|
el.removeEventListener("click", close);
|
|
7394
7585
|
});
|
|
7395
7586
|
} else {
|
|
7396
|
-
console.error(`${
|
|
7587
|
+
console.error(`${original} must be inside a notification with an id`);
|
|
7397
7588
|
}
|
|
7398
7589
|
});
|
|
7399
7590
|
}
|
|
@@ -7482,7 +7673,7 @@ function pagination_default(Alpine) {
|
|
|
7482
7673
|
// src/components/popover.js
|
|
7483
7674
|
function popover_default(Alpine) {
|
|
7484
7675
|
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
7485
|
-
el.
|
|
7676
|
+
el._h_popover = Alpine2.reactive({
|
|
7486
7677
|
id: void 0,
|
|
7487
7678
|
controls: `hpc${uuid_default()}`,
|
|
7488
7679
|
auto: expression ? false : true,
|
|
@@ -7492,7 +7683,7 @@ function popover_default(Alpine) {
|
|
|
7492
7683
|
const getExpanded = evaluateLater(expression);
|
|
7493
7684
|
effect(() => {
|
|
7494
7685
|
getExpanded((expanded) => {
|
|
7495
|
-
el.
|
|
7686
|
+
el._h_popover.expanded = expanded;
|
|
7496
7687
|
});
|
|
7497
7688
|
});
|
|
7498
7689
|
}
|
|
@@ -7502,33 +7693,33 @@ function popover_default(Alpine) {
|
|
|
7502
7693
|
}
|
|
7503
7694
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
7504
7695
|
if (el.hasAttribute("id")) {
|
|
7505
|
-
el.
|
|
7696
|
+
el._h_popover.id = el.getAttribute("id");
|
|
7506
7697
|
} else {
|
|
7507
|
-
el.
|
|
7508
|
-
el.setAttribute("id", el.
|
|
7698
|
+
el._h_popover.id = `hp${uuid_default()}`;
|
|
7699
|
+
el.setAttribute("id", el._h_popover.id);
|
|
7509
7700
|
}
|
|
7510
|
-
el.setAttribute("aria-controls", el.
|
|
7701
|
+
el.setAttribute("aria-controls", el._h_popover.controls);
|
|
7511
7702
|
el.setAttribute("aria-haspopup", "dialog");
|
|
7512
7703
|
const setAttributes = () => {
|
|
7513
|
-
el.setAttribute("aria-expanded", el.
|
|
7704
|
+
el.setAttribute("aria-expanded", el._h_popover.expanded);
|
|
7514
7705
|
};
|
|
7515
7706
|
const close = () => {
|
|
7516
|
-
el.
|
|
7707
|
+
el._h_popover.expanded = false;
|
|
7517
7708
|
el.addEventListener("click", handler);
|
|
7518
7709
|
setAttributes();
|
|
7519
7710
|
};
|
|
7520
7711
|
const handler = () => {
|
|
7521
|
-
el.
|
|
7712
|
+
el._h_popover.expanded = !el._h_popover.expanded;
|
|
7522
7713
|
setAttributes();
|
|
7523
7714
|
Alpine2.nextTick(() => {
|
|
7524
|
-
if (el.
|
|
7715
|
+
if (el._h_popover.auto && el._h_popover.expanded) {
|
|
7525
7716
|
top.addEventListener("click", close, { once: true });
|
|
7526
7717
|
el.removeEventListener("click", handler);
|
|
7527
7718
|
}
|
|
7528
7719
|
});
|
|
7529
7720
|
};
|
|
7530
7721
|
setAttributes();
|
|
7531
|
-
if (el.
|
|
7722
|
+
if (el._h_popover.auto) {
|
|
7532
7723
|
el.addEventListener("click", handler);
|
|
7533
7724
|
cleanup(() => {
|
|
7534
7725
|
el.removeEventListener("click", handler);
|
|
@@ -7540,16 +7731,16 @@ function popover_default(Alpine) {
|
|
|
7540
7731
|
});
|
|
7541
7732
|
}
|
|
7542
7733
|
});
|
|
7543
|
-
Alpine.directive("h-popover", (el, { original
|
|
7734
|
+
Alpine.directive("h-popover", (el, { original, modifiers }, { effect, cleanup }) => {
|
|
7544
7735
|
const popover = (() => {
|
|
7545
7736
|
let sibling = el.previousElementSibling;
|
|
7546
|
-
while (sibling && !
|
|
7737
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_h_popover")) {
|
|
7547
7738
|
sibling = sibling.previousElementSibling;
|
|
7548
7739
|
}
|
|
7549
7740
|
return sibling;
|
|
7550
7741
|
})();
|
|
7551
7742
|
if (!popover) {
|
|
7552
|
-
throw new Error(`${
|
|
7743
|
+
throw new Error(`${original} must be placed after a popover element`);
|
|
7553
7744
|
}
|
|
7554
7745
|
el.classList.add(
|
|
7555
7746
|
"absolute",
|
|
@@ -7575,8 +7766,8 @@ function popover_default(Alpine) {
|
|
|
7575
7766
|
el.setAttribute("data-slot", "popover");
|
|
7576
7767
|
el.setAttribute("role", "dialog");
|
|
7577
7768
|
el.setAttribute("tabindex", "-1");
|
|
7578
|
-
el.setAttribute("id", popover.
|
|
7579
|
-
el.setAttribute("aria-labelledby", popover.
|
|
7769
|
+
el.setAttribute("id", popover._h_popover.controls);
|
|
7770
|
+
el.setAttribute("aria-labelledby", popover._h_popover.id);
|
|
7580
7771
|
let noScroll = modifiers.includes("no-scroll");
|
|
7581
7772
|
if (noScroll) {
|
|
7582
7773
|
el.classList.remove("overflow-auto");
|
|
@@ -7614,7 +7805,7 @@ function popover_default(Alpine) {
|
|
|
7614
7805
|
});
|
|
7615
7806
|
}
|
|
7616
7807
|
effect(() => {
|
|
7617
|
-
if (popover.
|
|
7808
|
+
if (popover._h_popover.expanded) {
|
|
7618
7809
|
el.classList.remove("hidden");
|
|
7619
7810
|
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
7620
7811
|
} else {
|
|
@@ -7727,7 +7918,7 @@ function range_default(Alpine) {
|
|
|
7727
7918
|
el.classList.add("harmonia-slider");
|
|
7728
7919
|
el.setAttribute("data-slot", "range");
|
|
7729
7920
|
(0, import_nouislider.create)(el, evaluate2(expression));
|
|
7730
|
-
if (
|
|
7921
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7731
7922
|
el.noUiSlider.on("change", (values) => {
|
|
7732
7923
|
el._x_model.set(values);
|
|
7733
7924
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -7809,11 +8000,11 @@ function select_default(Alpine) {
|
|
|
7809
8000
|
});
|
|
7810
8001
|
}
|
|
7811
8002
|
});
|
|
7812
|
-
Alpine.directive("h-select-input", (el, { original
|
|
8003
|
+
Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7813
8004
|
if (el.tagName !== "INPUT") {
|
|
7814
|
-
throw new Error(`${
|
|
8005
|
+
throw new Error(`${original} must be an input of type "text"`);
|
|
7815
8006
|
}
|
|
7816
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8007
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
7817
8008
|
const label = (() => {
|
|
7818
8009
|
const field = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "field");
|
|
7819
8010
|
if (field) {
|
|
@@ -7822,8 +8013,8 @@ function select_default(Alpine) {
|
|
|
7822
8013
|
return;
|
|
7823
8014
|
})();
|
|
7824
8015
|
if (!select) {
|
|
7825
|
-
throw new Error(`${
|
|
7826
|
-
} else if (
|
|
8016
|
+
throw new Error(`${original} must be inside a select element`);
|
|
8017
|
+
} else if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
7827
8018
|
select._h_select.multiple = Array.isArray(el._x_model.get());
|
|
7828
8019
|
select._h_model.set = (value) => {
|
|
7829
8020
|
if (select._h_select.multiple) {
|
|
@@ -7881,6 +8072,7 @@ function select_default(Alpine) {
|
|
|
7881
8072
|
displayValue.innerText = value;
|
|
7882
8073
|
displayValue.classList.add("text-muted-foreground");
|
|
7883
8074
|
} else {
|
|
8075
|
+
displayValue.innerText = "";
|
|
7884
8076
|
displayValue.classList.remove("text-muted-foreground");
|
|
7885
8077
|
}
|
|
7886
8078
|
}
|
|
@@ -7921,7 +8113,7 @@ function select_default(Alpine) {
|
|
|
7921
8113
|
const onKeyDown = (event) => {
|
|
7922
8114
|
switch (event.key) {
|
|
7923
8115
|
case "Down":
|
|
7924
|
-
case "ArrowDown":
|
|
8116
|
+
case "ArrowDown": {
|
|
7925
8117
|
event.preventDefault();
|
|
7926
8118
|
let nextIndex = 0;
|
|
7927
8119
|
for (let o = 0; o < options.length; o++) {
|
|
@@ -7943,8 +8135,9 @@ function select_default(Alpine) {
|
|
|
7943
8135
|
options[nextIndex].setAttribute("tabindex", "0");
|
|
7944
8136
|
options[nextIndex].focus();
|
|
7945
8137
|
break;
|
|
8138
|
+
}
|
|
7946
8139
|
case "Up":
|
|
7947
|
-
case "ArrowUp":
|
|
8140
|
+
case "ArrowUp": {
|
|
7948
8141
|
event.preventDefault();
|
|
7949
8142
|
let prevIndex = options.length - 1;
|
|
7950
8143
|
for (let o = options.length - 1; o >= 0; o--) {
|
|
@@ -7966,6 +8159,7 @@ function select_default(Alpine) {
|
|
|
7966
8159
|
options[prevIndex].setAttribute("tabindex", "0");
|
|
7967
8160
|
options[prevIndex].focus();
|
|
7968
8161
|
break;
|
|
8162
|
+
}
|
|
7969
8163
|
case "Home":
|
|
7970
8164
|
case "PageUp":
|
|
7971
8165
|
event.preventDefault();
|
|
@@ -8082,10 +8276,10 @@ function select_default(Alpine) {
|
|
|
8082
8276
|
}
|
|
8083
8277
|
});
|
|
8084
8278
|
});
|
|
8085
|
-
Alpine.directive("h-select-content", (el, { original
|
|
8086
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8279
|
+
Alpine.directive("h-select-content", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8280
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8087
8281
|
if (!select) {
|
|
8088
|
-
throw new Error(`${
|
|
8282
|
+
throw new Error(`${original} must be inside a select element`);
|
|
8089
8283
|
}
|
|
8090
8284
|
el.classList.add(
|
|
8091
8285
|
"absolute",
|
|
@@ -8114,7 +8308,7 @@ function select_default(Alpine) {
|
|
|
8114
8308
|
el.setAttribute("id", select._h_select.controls);
|
|
8115
8309
|
el.setAttribute("tabindex", "-1");
|
|
8116
8310
|
if (!select._h_select.trigger) {
|
|
8117
|
-
throw new Error(`${
|
|
8311
|
+
throw new Error(`${original}: trigger not found`);
|
|
8118
8312
|
}
|
|
8119
8313
|
let autoUpdateCleanup;
|
|
8120
8314
|
function updatePosition() {
|
|
@@ -8175,10 +8369,10 @@ function select_default(Alpine) {
|
|
|
8175
8369
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8176
8370
|
});
|
|
8177
8371
|
});
|
|
8178
|
-
Alpine.directive("h-select-search", (el, { original
|
|
8179
|
-
const select = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8372
|
+
Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
8373
|
+
const select = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8180
8374
|
if (!select) {
|
|
8181
|
-
throw new Error(`${
|
|
8375
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8182
8376
|
} else {
|
|
8183
8377
|
select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
|
|
8184
8378
|
}
|
|
@@ -8243,17 +8437,17 @@ function select_default(Alpine) {
|
|
|
8243
8437
|
Alpine.directive("h-select-label", (el) => {
|
|
8244
8438
|
el.classList.add("text-muted-foreground", "px-2", "py-1.5", "text-xs");
|
|
8245
8439
|
el.setAttribute("data-slot", "select-label");
|
|
8246
|
-
const selectGroup = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8440
|
+
const selectGroup = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_selectGroup"));
|
|
8247
8441
|
if (selectGroup) {
|
|
8248
8442
|
const id = `hsl${uuid_default()}`;
|
|
8249
8443
|
el.setAttribute("id", id);
|
|
8250
8444
|
selectGroup._h_selectGroup.labelledby = id;
|
|
8251
8445
|
}
|
|
8252
8446
|
});
|
|
8253
|
-
Alpine.directive("h-select-option", (el, { original
|
|
8254
|
-
const select = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8447
|
+
Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
|
|
8448
|
+
const select = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_select"));
|
|
8255
8449
|
if (!select) {
|
|
8256
|
-
throw new Error(`${
|
|
8450
|
+
throw new Error(`${original} must be inside an h-select element`);
|
|
8257
8451
|
}
|
|
8258
8452
|
el.classList.add(
|
|
8259
8453
|
"focus:bg-primary",
|
|
@@ -8356,7 +8550,7 @@ function select_default(Alpine) {
|
|
|
8356
8550
|
}
|
|
8357
8551
|
} else if (select._h_model.get() !== getValue()) {
|
|
8358
8552
|
select._h_model.set(getValue());
|
|
8359
|
-
} else {
|
|
8553
|
+
} else if (select.getAttribute("data-clearable") === "true") {
|
|
8360
8554
|
select._h_model.set("");
|
|
8361
8555
|
}
|
|
8362
8556
|
}
|
|
@@ -8449,10 +8643,10 @@ function sheet_default(Alpine) {
|
|
|
8449
8643
|
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8450
8644
|
});
|
|
8451
8645
|
});
|
|
8452
|
-
Alpine.directive("h-sheet", (el, { original
|
|
8453
|
-
const overlay = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8646
|
+
Alpine.directive("h-sheet", (el, { original }, { effect, cleanup }) => {
|
|
8647
|
+
const overlay = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sheet_overlay"));
|
|
8454
8648
|
if (!overlay) {
|
|
8455
|
-
throw new Error(`${
|
|
8649
|
+
throw new Error(`${original} must be placed inside a sheet overlay`);
|
|
8456
8650
|
}
|
|
8457
8651
|
el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
|
|
8458
8652
|
el.setAttribute("data-slot", "sheet");
|
|
@@ -8575,10 +8769,10 @@ function sidebar_default(Alpine) {
|
|
|
8575
8769
|
});
|
|
8576
8770
|
}
|
|
8577
8771
|
});
|
|
8578
|
-
Alpine.directive("h-sidebar-group-label", (el, { original
|
|
8579
|
-
const group = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8772
|
+
Alpine.directive("h-sidebar-group-label", (el, { original }, { cleanup }) => {
|
|
8773
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_group"));
|
|
8580
8774
|
if (!group) {
|
|
8581
|
-
throw new Error(`${
|
|
8775
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8582
8776
|
}
|
|
8583
8777
|
el.classList.add(
|
|
8584
8778
|
"ring-sidebar-ring",
|
|
@@ -8667,10 +8861,10 @@ function sidebar_default(Alpine) {
|
|
|
8667
8861
|
}
|
|
8668
8862
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
8669
8863
|
});
|
|
8670
|
-
Alpine.directive("h-sidebar-group-content", (el, { original
|
|
8671
|
-
const group = Alpine.findClosest(el.parentElement, (parent) =>
|
|
8864
|
+
Alpine.directive("h-sidebar-group-content", (el, { original }, { effect }) => {
|
|
8865
|
+
const group = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_group"));
|
|
8672
8866
|
if (!group) {
|
|
8673
|
-
throw new Error(`${
|
|
8867
|
+
throw new Error(`${original} must be placed inside a sidebar group`);
|
|
8674
8868
|
}
|
|
8675
8869
|
el.classList.add("w-full", "text-sm", "data-[collapsed=true]:hidden", "group-data-[collapsed=true]/sidebar:!block");
|
|
8676
8870
|
el.setAttribute("data-slot", "sidebar-group-content");
|
|
@@ -8683,16 +8877,16 @@ function sidebar_default(Alpine) {
|
|
|
8683
8877
|
});
|
|
8684
8878
|
}
|
|
8685
8879
|
});
|
|
8686
|
-
Alpine.directive("h-sidebar-menu", (el, { original
|
|
8880
|
+
Alpine.directive("h-sidebar-menu", (el, { original }) => {
|
|
8687
8881
|
if (el.tagName !== "UL") {
|
|
8688
|
-
throw new Error(`${
|
|
8882
|
+
throw new Error(`${original} must be an ul element`);
|
|
8689
8883
|
}
|
|
8690
8884
|
el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
|
|
8691
8885
|
el.setAttribute("data-slot", "sidebar-menu");
|
|
8692
8886
|
});
|
|
8693
|
-
Alpine.directive("h-sidebar-menu-item", (el, { original
|
|
8887
|
+
Alpine.directive("h-sidebar-menu-item", (el, { original, expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
8694
8888
|
if (el.tagName !== "LI") {
|
|
8695
|
-
throw new Error(`${
|
|
8889
|
+
throw new Error(`${original} must be a li element`);
|
|
8696
8890
|
}
|
|
8697
8891
|
el._h_sidebar_menu_item = {
|
|
8698
8892
|
isSub: false,
|
|
@@ -8728,13 +8922,13 @@ function sidebar_default(Alpine) {
|
|
|
8728
8922
|
});
|
|
8729
8923
|
}
|
|
8730
8924
|
});
|
|
8731
|
-
Alpine.directive("h-sidebar-menu-button", (el, { original
|
|
8925
|
+
Alpine.directive("h-sidebar-menu-button", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
|
|
8732
8926
|
if (el.tagName !== "BUTTON" && el.tagName !== "A") {
|
|
8733
|
-
throw new Error(`${
|
|
8927
|
+
throw new Error(`${original} must be a button or a link`);
|
|
8734
8928
|
} else if (el.tagName === "BUTTON") {
|
|
8735
8929
|
el.setAttribute("type", "button");
|
|
8736
8930
|
}
|
|
8737
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
8931
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8738
8932
|
el.classList.add(
|
|
8739
8933
|
"flex",
|
|
8740
8934
|
"w-full",
|
|
@@ -8767,7 +8961,7 @@ function sidebar_default(Alpine) {
|
|
|
8767
8961
|
lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
|
|
8768
8962
|
};
|
|
8769
8963
|
function setSize2(size3) {
|
|
8770
|
-
if (
|
|
8964
|
+
if (Object.prototype.hasOwnProperty.call(sizes, size3)) {
|
|
8771
8965
|
el.classList.add(...sizes[size3]);
|
|
8772
8966
|
}
|
|
8773
8967
|
}
|
|
@@ -8868,9 +9062,9 @@ function sidebar_default(Alpine) {
|
|
|
8868
9062
|
}
|
|
8869
9063
|
el.setAttribute("data-slot", "sidebar-menu-action");
|
|
8870
9064
|
});
|
|
8871
|
-
Alpine.directive("h-sidebar-menu-badge", (el, { original
|
|
9065
|
+
Alpine.directive("h-sidebar-menu-badge", (el, { original }) => {
|
|
8872
9066
|
if (el.tagName !== "SPAN") {
|
|
8873
|
-
throw new Error(`${
|
|
9067
|
+
throw new Error(`${original} must be a span element`);
|
|
8874
9068
|
}
|
|
8875
9069
|
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
9070
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
@@ -8896,13 +9090,13 @@ function sidebar_default(Alpine) {
|
|
|
8896
9090
|
el.setAttribute("data-slot", "sidebar-separator");
|
|
8897
9091
|
el.setAttribute("role", "none");
|
|
8898
9092
|
});
|
|
8899
|
-
Alpine.directive("h-sidebar-menu-sub", (el, { original
|
|
9093
|
+
Alpine.directive("h-sidebar-menu-sub", (el, { original }, { effect, Alpine: Alpine2 }) => {
|
|
8900
9094
|
if (el.tagName !== "UL") {
|
|
8901
|
-
throw new Error(`${
|
|
9095
|
+
throw new Error(`${original} must be an ul element`);
|
|
8902
9096
|
}
|
|
8903
|
-
const menuItem = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
9097
|
+
const menuItem = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_sidebar_menu_item"));
|
|
8904
9098
|
if (!menuItem) {
|
|
8905
|
-
throw new Error(`${
|
|
9099
|
+
throw new Error(`${original} must be placed inside a sidebar menu item`);
|
|
8906
9100
|
}
|
|
8907
9101
|
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
9102
|
if (el.getAttribute("data-line") !== "false") {
|
|
@@ -8977,7 +9171,7 @@ function spinner_default(Alpine) {
|
|
|
8977
9171
|
|
|
8978
9172
|
// src/components/split.js
|
|
8979
9173
|
function split_default(Alpine) {
|
|
8980
|
-
Alpine.directive("h-split", (el,
|
|
9174
|
+
Alpine.directive("h-split", (el, _, { cleanup, Alpine: Alpine2 }) => {
|
|
8981
9175
|
const panels = [];
|
|
8982
9176
|
const state = Alpine2.reactive({
|
|
8983
9177
|
isHorizontal: el.getAttribute("data-orientation") === "horizontal",
|
|
@@ -9173,10 +9367,10 @@ function split_default(Alpine) {
|
|
|
9173
9367
|
observer.disconnect();
|
|
9174
9368
|
});
|
|
9175
9369
|
});
|
|
9176
|
-
Alpine.directive("h-split-panel", (el, { original
|
|
9177
|
-
const split = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
9370
|
+
Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
9371
|
+
const split = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_split"));
|
|
9178
9372
|
if (!split) {
|
|
9179
|
-
throw new Error(`${
|
|
9373
|
+
throw new Error(`${original} must be inside an split element`);
|
|
9180
9374
|
}
|
|
9181
9375
|
el.classList.add(
|
|
9182
9376
|
"flex",
|
|
@@ -9727,7 +9921,7 @@ function tabs_default(Alpine) {
|
|
|
9727
9921
|
el.setAttribute("role", "tablist");
|
|
9728
9922
|
el.setAttribute("data-slot", "tab-list");
|
|
9729
9923
|
});
|
|
9730
|
-
Alpine.directive("h-tab", (el, { original
|
|
9924
|
+
Alpine.directive("h-tab", (el, { original }) => {
|
|
9731
9925
|
el.classList.add(
|
|
9732
9926
|
"cursor-pointer",
|
|
9733
9927
|
"focus-visible:border-ring",
|
|
@@ -9776,8 +9970,8 @@ function tabs_default(Alpine) {
|
|
|
9776
9970
|
);
|
|
9777
9971
|
el.setAttribute("role", "tab");
|
|
9778
9972
|
el.setAttribute("data-slot", "tab");
|
|
9779
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9780
|
-
if (!el.hasAttribute("aria-controls")) throw new Error(`${
|
|
9973
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tabs must have an id`);
|
|
9974
|
+
if (!el.hasAttribute("aria-controls")) throw new Error(`${original}: aria-controls must be set to the tab-content id.`);
|
|
9781
9975
|
});
|
|
9782
9976
|
Alpine.directive("h-tab-action", (el) => {
|
|
9783
9977
|
el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
|
|
@@ -9811,13 +10005,13 @@ function tabs_default(Alpine) {
|
|
|
9811
10005
|
el.setAttribute("role", "button");
|
|
9812
10006
|
el.setAttribute("data-slot", "tab-list-action");
|
|
9813
10007
|
});
|
|
9814
|
-
Alpine.directive("h-tabs-content", (el, { original
|
|
10008
|
+
Alpine.directive("h-tabs-content", (el, { original }) => {
|
|
9815
10009
|
el.classList.add("flex-1", "outline-none");
|
|
9816
10010
|
el.setAttribute("role", "tabpanel");
|
|
9817
10011
|
el.setAttribute("tabindex", "0");
|
|
9818
10012
|
el.setAttribute("data-slot", "tabs-content");
|
|
9819
|
-
if (!el.hasAttribute("id")) throw new Error(`${
|
|
9820
|
-
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${
|
|
10013
|
+
if (!el.hasAttribute("id")) throw new Error(`${original}: Tab content must have an id`);
|
|
10014
|
+
if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original}: aria-labelledby must be set to the tab id.`);
|
|
9821
10015
|
});
|
|
9822
10016
|
}
|
|
9823
10017
|
|
|
@@ -10228,13 +10422,13 @@ function timepicker_default(Alpine) {
|
|
|
10228
10422
|
top.removeEventListener("click", el._h_timepicker.close);
|
|
10229
10423
|
});
|
|
10230
10424
|
});
|
|
10231
|
-
Alpine.directive("h-time-picker-input", (el, { original
|
|
10425
|
+
Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10232
10426
|
if (el.tagName !== "INPUT") {
|
|
10233
|
-
throw new Error(`${
|
|
10427
|
+
throw new Error(`${original} must be a readonly input of type "text"`);
|
|
10234
10428
|
}
|
|
10235
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10429
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10236
10430
|
if (!timepicker) {
|
|
10237
|
-
throw new Error(`${
|
|
10431
|
+
throw new Error(`${original} must be inside a time-picker element`);
|
|
10238
10432
|
}
|
|
10239
10433
|
timepicker._h_timepicker.focusInput = () => {
|
|
10240
10434
|
el.focus();
|
|
@@ -10244,7 +10438,7 @@ function timepicker_default(Alpine) {
|
|
|
10244
10438
|
el.dispatchEvent(new Event("change"));
|
|
10245
10439
|
});
|
|
10246
10440
|
};
|
|
10247
|
-
if (
|
|
10441
|
+
if (Object.prototype.hasOwnProperty.call(el, "_x_model")) {
|
|
10248
10442
|
timepicker._h_timepicker.model = el._x_model;
|
|
10249
10443
|
} else {
|
|
10250
10444
|
timepicker._h_timepicker.model = {
|
|
@@ -10332,7 +10526,7 @@ function timepicker_default(Alpine) {
|
|
|
10332
10526
|
});
|
|
10333
10527
|
});
|
|
10334
10528
|
Alpine.directive("h-time-picker-popup", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
10335
|
-
const timepicker = Alpine2.findClosest(el.parentElement, (parent) =>
|
|
10529
|
+
const timepicker = Alpine2.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_timepicker"));
|
|
10336
10530
|
el.classList.add(
|
|
10337
10531
|
"overflow-hidden",
|
|
10338
10532
|
"outline-none",
|
|
@@ -10432,7 +10626,7 @@ function timepicker_default(Alpine) {
|
|
|
10432
10626
|
}
|
|
10433
10627
|
switch (event.key) {
|
|
10434
10628
|
case "Up":
|
|
10435
|
-
case "ArrowUp":
|
|
10629
|
+
case "ArrowUp": {
|
|
10436
10630
|
event.target.setAttribute("tabindex", "-1");
|
|
10437
10631
|
let prevElem = event.target.previousElementSibling;
|
|
10438
10632
|
if (prevElem === null || prevElem.classList.contains("hidden")) {
|
|
@@ -10445,8 +10639,9 @@ function timepicker_default(Alpine) {
|
|
|
10445
10639
|
prevElem.setAttribute("tabindex", "0");
|
|
10446
10640
|
prevElem.focus();
|
|
10447
10641
|
break;
|
|
10642
|
+
}
|
|
10448
10643
|
case "Down":
|
|
10449
|
-
case "ArrowDown":
|
|
10644
|
+
case "ArrowDown": {
|
|
10450
10645
|
event.target.setAttribute("tabindex", "-1");
|
|
10451
10646
|
let nextElem = event.target.nextElementSibling;
|
|
10452
10647
|
if (nextElem === null || nextElem.classList.contains("hidden")) {
|
|
@@ -10459,8 +10654,9 @@ function timepicker_default(Alpine) {
|
|
|
10459
10654
|
nextElem.setAttribute("tabindex", "0");
|
|
10460
10655
|
nextElem.focus();
|
|
10461
10656
|
break;
|
|
10657
|
+
}
|
|
10462
10658
|
case "Home":
|
|
10463
|
-
case "PageUp":
|
|
10659
|
+
case "PageUp": {
|
|
10464
10660
|
let firstChild;
|
|
10465
10661
|
if (list.firstChild === event.target) {
|
|
10466
10662
|
break;
|
|
@@ -10477,8 +10673,9 @@ function timepicker_default(Alpine) {
|
|
|
10477
10673
|
firstChild.setAttribute("tabindex", "0");
|
|
10478
10674
|
firstChild.focus();
|
|
10479
10675
|
break;
|
|
10676
|
+
}
|
|
10480
10677
|
case "End":
|
|
10481
|
-
case "PageDown":
|
|
10678
|
+
case "PageDown": {
|
|
10482
10679
|
let lastElem;
|
|
10483
10680
|
if (list.lastChild === event.target) {
|
|
10484
10681
|
break;
|
|
@@ -10495,22 +10692,25 @@ function timepicker_default(Alpine) {
|
|
|
10495
10692
|
lastElem.setAttribute("tabindex", "0");
|
|
10496
10693
|
lastElem.focus();
|
|
10497
10694
|
break;
|
|
10695
|
+
}
|
|
10498
10696
|
case "Right":
|
|
10499
|
-
case "ArrowRight":
|
|
10697
|
+
case "ArrowRight": {
|
|
10500
10698
|
let nextColumn = event.target.parentElement.nextElementSibling;
|
|
10501
10699
|
if (nextColumn) {
|
|
10502
10700
|
const child = nextColumn.querySelector('li[tabindex="0"]');
|
|
10503
10701
|
child.focus();
|
|
10504
10702
|
}
|
|
10505
10703
|
break;
|
|
10704
|
+
}
|
|
10506
10705
|
case "Left":
|
|
10507
|
-
case "ArrowLeft":
|
|
10706
|
+
case "ArrowLeft": {
|
|
10508
10707
|
let prevColumn = event.target.parentElement.previousElementSibling;
|
|
10509
10708
|
if (prevColumn) {
|
|
10510
10709
|
const child = prevColumn.querySelector('li[tabindex="0"]');
|
|
10511
10710
|
child.focus();
|
|
10512
10711
|
}
|
|
10513
10712
|
break;
|
|
10713
|
+
}
|
|
10514
10714
|
case "Enter":
|
|
10515
10715
|
case " ":
|
|
10516
10716
|
event.target.click();
|
|
@@ -10891,13 +11091,13 @@ function tooltip_default(Alpine) {
|
|
|
10891
11091
|
Alpine.directive("h-tooltip-trigger", (el, _, { Alpine: Alpine2, cleanup }) => {
|
|
10892
11092
|
el._tooltip = Alpine2.reactive({
|
|
10893
11093
|
id: void 0,
|
|
10894
|
-
controls: `
|
|
11094
|
+
controls: `htp${uuid_default()}`,
|
|
10895
11095
|
shown: false
|
|
10896
11096
|
});
|
|
10897
11097
|
if (el.hasAttribute("id")) {
|
|
10898
11098
|
el._tooltip.id = el.getAttribute("id");
|
|
10899
11099
|
} else {
|
|
10900
|
-
el._tooltip.id = `
|
|
11100
|
+
el._tooltip.id = `htt${uuid_default()}`;
|
|
10901
11101
|
el.setAttribute("id", el._tooltip.id);
|
|
10902
11102
|
}
|
|
10903
11103
|
el.setAttribute("aria-describedby", el._tooltip.controls);
|
|
@@ -10911,16 +11111,16 @@ function tooltip_default(Alpine) {
|
|
|
10911
11111
|
el.removeEventListener("pointerleave", handler);
|
|
10912
11112
|
});
|
|
10913
11113
|
});
|
|
10914
|
-
Alpine.directive("h-tooltip", (el, { original
|
|
11114
|
+
Alpine.directive("h-tooltip", (el, { original }, { effect, cleanup }) => {
|
|
10915
11115
|
const tooltip = (() => {
|
|
10916
11116
|
let sibling = el.previousElementSibling;
|
|
10917
|
-
while (sibling && !
|
|
11117
|
+
while (sibling && !Object.prototype.hasOwnProperty.call(sibling, "_tooltip")) {
|
|
10918
11118
|
sibling = sibling.previousElementSibling;
|
|
10919
11119
|
}
|
|
10920
11120
|
return sibling;
|
|
10921
11121
|
})();
|
|
10922
11122
|
if (!tooltip) {
|
|
10923
|
-
throw new Error(`${
|
|
11123
|
+
throw new Error(`${original} must be placed after a tooltip trigger element`);
|
|
10924
11124
|
}
|
|
10925
11125
|
el.classList.add(
|
|
10926
11126
|
"absolute",
|
|
@@ -11025,7 +11225,7 @@ function tree_default(Alpine) {
|
|
|
11025
11225
|
);
|
|
11026
11226
|
el.setAttribute("data-slot", "subtree");
|
|
11027
11227
|
el.setAttribute("role", "group");
|
|
11028
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11228
|
+
const treeItem = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_tree_item"));
|
|
11029
11229
|
effect(() => {
|
|
11030
11230
|
if (treeItem._h_tree_item.expanded) {
|
|
11031
11231
|
el.classList.remove("!hidden");
|
|
@@ -11165,9 +11365,9 @@ function tree_default(Alpine) {
|
|
|
11165
11365
|
});
|
|
11166
11366
|
}
|
|
11167
11367
|
});
|
|
11168
|
-
Alpine.directive("h-tree-button", (el, { original
|
|
11169
|
-
const treeItem = Alpine.findClosest(el.parentElement, (parent) =>
|
|
11170
|
-
if (!treeItem) throw new Error(`${
|
|
11368
|
+
Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
|
|
11369
|
+
const treeItem = Alpine.findClosest(el.parentElement, (parent) => Object.prototype.hasOwnProperty.call(parent, "_h_tree_item"));
|
|
11370
|
+
if (!treeItem) throw new Error(`${original} must be inside a tree item`);
|
|
11171
11371
|
el.classList.add(
|
|
11172
11372
|
"flex",
|
|
11173
11373
|
"w-full",
|
|
@@ -11231,7 +11431,7 @@ function tree_default(Alpine) {
|
|
|
11231
11431
|
}
|
|
11232
11432
|
|
|
11233
11433
|
// package.json
|
|
11234
|
-
var version = "1.
|
|
11434
|
+
var version = "1.10.0";
|
|
11235
11435
|
|
|
11236
11436
|
// src/utils/theme.js
|
|
11237
11437
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
@@ -11324,7 +11524,7 @@ function focus_default(Alpine) {
|
|
|
11324
11524
|
|
|
11325
11525
|
// src/utils/include.js
|
|
11326
11526
|
function include_default(Alpine) {
|
|
11327
|
-
Alpine.directive("h-include", (el, { modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
11527
|
+
Alpine.directive("h-include", (el, { original, modifiers, expression }, { evaluateLater, effect, cleanup, Alpine: Alpine2 }) => {
|
|
11328
11528
|
const getUrl = evaluateLater(expression);
|
|
11329
11529
|
function executeScript(oldScript) {
|
|
11330
11530
|
return new Promise((resolve, reject) => {
|
|
@@ -11399,7 +11599,7 @@ function include_default(Alpine) {
|
|
|
11399
11599
|
|
|
11400
11600
|
// src/utils/template.js
|
|
11401
11601
|
function template_default(Alpine) {
|
|
11402
|
-
Alpine.directive("h-template", (el, { original
|
|
11602
|
+
Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
|
|
11403
11603
|
if (el.hasAttribute(Alpine2.prefixed("data"))) {
|
|
11404
11604
|
const template = evaluate2(expression);
|
|
11405
11605
|
const clone = template.content.cloneNode(true).firstElementChild;
|
|
@@ -11413,7 +11613,7 @@ function template_default(Alpine) {
|
|
|
11413
11613
|
clone.remove();
|
|
11414
11614
|
});
|
|
11415
11615
|
} else {
|
|
11416
|
-
console.error(`${
|
|
11616
|
+
console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
|
|
11417
11617
|
}
|
|
11418
11618
|
});
|
|
11419
11619
|
}
|
|
@@ -11476,6 +11676,7 @@ export {
|
|
|
11476
11676
|
calendar_default as Calendar,
|
|
11477
11677
|
card_default as Card,
|
|
11478
11678
|
checkbox_default as Checkbox,
|
|
11679
|
+
chip_default as Chip,
|
|
11479
11680
|
datepicker_default as DatePicker,
|
|
11480
11681
|
dialog_default as Dialog,
|
|
11481
11682
|
expansion_panel_default as ExpansionPanel,
|