@kazee-ds/vue 0.4.0 → 0.5.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/index.js +971 -150
- package/dist/index.js.map +1 -1
- package/dist/types/Toast.vue.d.ts +35 -0
- package/dist/types/ToastProvider.vue.d.ts +41 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/toast-model.d.ts +64 -0
- package/dist/types/useToast.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Fragment, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, mergeModels, mergeProps, normalizeClass, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useModel, watch, withCtx, withModifiers } from "vue";
|
|
2
|
-
import { CheckboxRoot, ComboboxAnchor, ComboboxContent, ComboboxInput, ComboboxItem, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ComboboxViewport, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Label, ListboxContent, ListboxItem, ListboxRoot, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, RadioGroupItem, RadioGroupRoot, RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarNext, RangeCalendarPrev, RangeCalendarRoot, SelectContent, SelectItem, SelectItemText, SelectPortal, SelectRoot, SelectTrigger, SelectValue, SelectViewport, SwitchRoot, TabsContent, TabsList, TabsRoot, TabsTrigger, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, useId } from "reka-ui";
|
|
1
|
+
import { Fragment, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useModel, watch, withCtx, withModifiers } from "vue";
|
|
2
|
+
import { CheckboxRoot, ComboboxAnchor, ComboboxContent, ComboboxInput, ComboboxItem, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ComboboxViewport, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Label, ListboxContent, ListboxItem, ListboxRoot, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, RadioGroupItem, RadioGroupRoot, RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarNext, RangeCalendarPrev, RangeCalendarRoot, SelectContent, SelectItem, SelectItemText, SelectPortal, SelectRoot, SelectTrigger, SelectValue, SelectViewport, SwitchRoot, TabsContent, TabsList, TabsRoot, TabsTrigger, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, useId } from "reka-ui";
|
|
3
3
|
import { endOfMonth, getLocalTimeZone, parseDate, startOfMonth, startOfWeek, today } from "@internationalized/date";
|
|
4
4
|
//#region src/Button.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var _hoisted_1$
|
|
5
|
+
var _hoisted_1$40 = [
|
|
6
6
|
"aria-label",
|
|
7
7
|
"aria-labelledby",
|
|
8
8
|
"type",
|
|
@@ -122,7 +122,7 @@ var Button_default = /* @__PURE__ */ defineComponent({
|
|
|
122
122
|
pressed: pressed.value,
|
|
123
123
|
focused: focused.value,
|
|
124
124
|
focusVisible: focusVisible.value
|
|
125
|
-
})], 42, _hoisted_1$
|
|
125
|
+
})], 42, _hoisted_1$40);
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
});
|
|
@@ -289,7 +289,7 @@ var ToggleButton_default = /* @__PURE__ */ defineComponent({
|
|
|
289
289
|
});
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/ToggleButtonGroup.vue?vue&type=script&setup=true&lang.ts
|
|
292
|
-
var _hoisted_1$
|
|
292
|
+
var _hoisted_1$39 = ["role"];
|
|
293
293
|
//#endregion
|
|
294
294
|
//#region src/ToggleButtonGroup.vue
|
|
295
295
|
var ToggleButtonGroup_default = /* @__PURE__ */ defineComponent({
|
|
@@ -353,7 +353,7 @@ var ToggleButtonGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
353
353
|
dir: __props.dir,
|
|
354
354
|
"onUpdate:modelValue": update
|
|
355
355
|
}, {
|
|
356
|
-
default: withCtx(() => [createElementVNode("div", { role: radio.value ? "radiogroup" : "toolbar" }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
356
|
+
default: withCtx(() => [createElementVNode("div", { role: radio.value ? "radiogroup" : "toolbar" }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$39)]),
|
|
357
357
|
_: 3
|
|
358
358
|
}, 8, [
|
|
359
359
|
"class",
|
|
@@ -380,7 +380,7 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
380
380
|
//#endregion
|
|
381
381
|
//#region src/CheckIcon.vue
|
|
382
382
|
var _sfc_main$2 = {};
|
|
383
|
-
var _hoisted_1$
|
|
383
|
+
var _hoisted_1$38 = {
|
|
384
384
|
viewBox: "0 0 16 16",
|
|
385
385
|
fill: "none",
|
|
386
386
|
stroke: "currentColor",
|
|
@@ -390,13 +390,13 @@ var _hoisted_1$36 = {
|
|
|
390
390
|
"aria-hidden": "true"
|
|
391
391
|
};
|
|
392
392
|
function _sfc_render$2(_ctx, _cache) {
|
|
393
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
393
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$38, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M3.5 8.5l3 3 6-6.5" }, null, -1)])]);
|
|
394
394
|
}
|
|
395
395
|
var CheckIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/ChevronIcon.vue
|
|
398
398
|
var _sfc_main$1 = {};
|
|
399
|
-
var _hoisted_1$
|
|
399
|
+
var _hoisted_1$37 = {
|
|
400
400
|
viewBox: "0 0 16 16",
|
|
401
401
|
fill: "none",
|
|
402
402
|
stroke: "currentColor",
|
|
@@ -406,13 +406,13 @@ var _hoisted_1$35 = {
|
|
|
406
406
|
"aria-hidden": "true"
|
|
407
407
|
};
|
|
408
408
|
function _sfc_render$1(_ctx, _cache) {
|
|
409
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
409
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$37, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M4 6l4 4 4-4" }, null, -1)])]);
|
|
410
410
|
}
|
|
411
411
|
var ChevronIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
412
412
|
//#endregion
|
|
413
413
|
//#region src/CloseIcon.vue
|
|
414
414
|
var _sfc_main = {};
|
|
415
|
-
var _hoisted_1$
|
|
415
|
+
var _hoisted_1$36 = {
|
|
416
416
|
viewBox: "0 0 16 16",
|
|
417
417
|
fill: "none",
|
|
418
418
|
stroke: "currentColor",
|
|
@@ -422,17 +422,17 @@ var _hoisted_1$34 = {
|
|
|
422
422
|
"aria-hidden": "true"
|
|
423
423
|
};
|
|
424
424
|
function _sfc_render(_ctx, _cache) {
|
|
425
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
425
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$36, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M4 4l8 8M12 4l-8 8" }, null, -1)])]);
|
|
426
426
|
}
|
|
427
427
|
var CloseIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
|
|
428
428
|
//#endregion
|
|
429
429
|
//#region src/FieldFeedback.vue?vue&type=script&setup=true&lang.ts
|
|
430
|
-
var _hoisted_1$
|
|
430
|
+
var _hoisted_1$35 = {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "field-feedback"
|
|
433
433
|
};
|
|
434
|
-
var _hoisted_2$
|
|
435
|
-
var _hoisted_3$
|
|
434
|
+
var _hoisted_2$28 = ["id"];
|
|
435
|
+
var _hoisted_3$24 = ["id"];
|
|
436
436
|
//#endregion
|
|
437
437
|
//#region src/FieldFeedback.vue
|
|
438
438
|
var FieldFeedback_default = /* @__PURE__ */ defineComponent({
|
|
@@ -445,21 +445,21 @@ var FieldFeedback_default = /* @__PURE__ */ defineComponent({
|
|
|
445
445
|
},
|
|
446
446
|
setup(__props) {
|
|
447
447
|
return (_ctx, _cache) => {
|
|
448
|
-
return __props.description || __props.showError ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
448
|
+
return __props.description || __props.showError ? (openBlock(), createElementBlock("div", _hoisted_1$35, [__props.description ? (openBlock(), createElementBlock("span", {
|
|
449
449
|
key: 0,
|
|
450
450
|
id: `${__props.controlId}-description`,
|
|
451
451
|
class: "input__description"
|
|
452
|
-
}, toDisplayString(__props.description), 9, _hoisted_2$
|
|
452
|
+
}, toDisplayString(__props.description), 9, _hoisted_2$28)) : createCommentVNode("", true), __props.showError ? (openBlock(), createElementBlock("span", {
|
|
453
453
|
key: 1,
|
|
454
454
|
id: `${__props.controlId}-error`,
|
|
455
455
|
class: "input__error"
|
|
456
|
-
}, toDisplayString(__props.errorMessage), 9, _hoisted_3$
|
|
456
|
+
}, toDisplayString(__props.errorMessage), 9, _hoisted_3$24)) : createCommentVNode("", true)])) : createCommentVNode("", true);
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
});
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region src/SelectionValidation.vue?vue&type=script&setup=true&lang.ts
|
|
462
|
-
var _hoisted_1$
|
|
462
|
+
var _hoisted_1$34 = [
|
|
463
463
|
"required",
|
|
464
464
|
"disabled",
|
|
465
465
|
"value"
|
|
@@ -497,7 +497,7 @@ var SelectionValidation_default = /* @__PURE__ */ defineComponent({
|
|
|
497
497
|
disabled: __props.disabled,
|
|
498
498
|
value: __props.hasValue ? "selected" : "",
|
|
499
499
|
onInvalid: _cache[0] || (_cache[0] = withModifiers(($event) => emit("invalid"), ["prevent"]))
|
|
500
|
-
}, null, 40, _hoisted_1$
|
|
500
|
+
}, null, 40, _hoisted_1$34);
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
503
|
});
|
|
@@ -527,20 +527,20 @@ function filterOptions(options, query) {
|
|
|
527
527
|
}
|
|
528
528
|
//#endregion
|
|
529
529
|
//#region src/Select.vue?vue&type=script&setup=true&lang.ts
|
|
530
|
-
var _hoisted_1$
|
|
531
|
-
var _hoisted_2$
|
|
532
|
-
var _hoisted_3$
|
|
530
|
+
var _hoisted_1$33 = ["data-multiple", "dir"];
|
|
531
|
+
var _hoisted_2$27 = ["for"];
|
|
532
|
+
var _hoisted_3$23 = {
|
|
533
533
|
key: 0,
|
|
534
534
|
class: "selection__required",
|
|
535
535
|
"aria-hidden": "true"
|
|
536
536
|
};
|
|
537
|
-
var _hoisted_4$
|
|
538
|
-
var _hoisted_5$
|
|
537
|
+
var _hoisted_4$19 = ["data-clearable"];
|
|
538
|
+
var _hoisted_5$13 = {
|
|
539
539
|
key: 0,
|
|
540
540
|
class: "selection__leading",
|
|
541
541
|
"aria-hidden": "true"
|
|
542
542
|
};
|
|
543
|
-
var _hoisted_6$
|
|
543
|
+
var _hoisted_6$10 = [
|
|
544
544
|
"data-empty",
|
|
545
545
|
"aria-hidden",
|
|
546
546
|
"tabindex",
|
|
@@ -655,7 +655,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
655
655
|
createElementVNode("label", {
|
|
656
656
|
class: "select__label",
|
|
657
657
|
for: unref(controlId)
|
|
658
|
-
}, [createTextVNode(toDisplayString(__props.label), 1), __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
658
|
+
}, [createTextVNode(toDisplayString(__props.label), 1), __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$23, " *")) : createCommentVNode("", true)], 8, _hoisted_2$27),
|
|
659
659
|
createVNode(unref(SelectRoot), {
|
|
660
660
|
"model-value": multiple.value ? ids.value : ids.value[0] ?? "",
|
|
661
661
|
multiple: multiple.value,
|
|
@@ -674,7 +674,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
674
674
|
"aria-describedby": unref(describedBy)
|
|
675
675
|
}, {
|
|
676
676
|
default: withCtx(() => [
|
|
677
|
-
_ctx.$slots.start ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
677
|
+
_ctx.$slots.start ? (openBlock(), createElementBlock("span", _hoisted_5$13, [renderSlot(_ctx.$slots, "start")])) : createCommentVNode("", true),
|
|
678
678
|
createVNode(unref(SelectValue), {
|
|
679
679
|
class: "select__value",
|
|
680
680
|
placeholder: __props.placeholder
|
|
@@ -700,7 +700,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
700
700
|
"aria-label": __props.clearLabel ?? "Hapus pilihan",
|
|
701
701
|
disabled: __props.disabled || ids.value.length === 0,
|
|
702
702
|
onClick: clear
|
|
703
|
-
}, [createVNode(CloseIcon_default, { class: "selection__close-icon" })], 8, _hoisted_6$
|
|
703
|
+
}, [createVNode(CloseIcon_default, { class: "selection__close-icon" })], 8, _hoisted_6$10)) : createCommentVNode("", true)], 8, _hoisted_4$19), createVNode(unref(SelectPortal), null, {
|
|
704
704
|
default: withCtx(() => [createVNode(unref(SelectContent), {
|
|
705
705
|
class: "select__popover",
|
|
706
706
|
position: "popper",
|
|
@@ -774,7 +774,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
774
774
|
"required",
|
|
775
775
|
"disabled"
|
|
776
776
|
])
|
|
777
|
-
], 10, _hoisted_1$
|
|
777
|
+
], 10, _hoisted_1$33);
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
780
|
});
|
|
@@ -834,14 +834,14 @@ var SelectGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
834
834
|
});
|
|
835
835
|
//#endregion
|
|
836
836
|
//#region src/Input.vue?vue&type=script&setup=true&lang.ts
|
|
837
|
-
var _hoisted_1$
|
|
838
|
-
var _hoisted_2$
|
|
839
|
-
var _hoisted_3$
|
|
840
|
-
var _hoisted_4$
|
|
837
|
+
var _hoisted_1$32 = ["dir"];
|
|
838
|
+
var _hoisted_2$26 = ["disabled"];
|
|
839
|
+
var _hoisted_3$22 = ["data-invalid", "data-readonly"];
|
|
840
|
+
var _hoisted_4$18 = {
|
|
841
841
|
key: 0,
|
|
842
842
|
class: "input__prefix"
|
|
843
843
|
};
|
|
844
|
-
var _hoisted_5$
|
|
844
|
+
var _hoisted_5$12 = [
|
|
845
845
|
"id",
|
|
846
846
|
"type",
|
|
847
847
|
"name",
|
|
@@ -863,7 +863,7 @@ var _hoisted_5$11 = [
|
|
|
863
863
|
"spellcheck",
|
|
864
864
|
"form"
|
|
865
865
|
];
|
|
866
|
-
var _hoisted_6$
|
|
866
|
+
var _hoisted_6$9 = {
|
|
867
867
|
key: 1,
|
|
868
868
|
class: "input__suffix"
|
|
869
869
|
};
|
|
@@ -993,7 +993,7 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
993
993
|
"data-readonly": __props.readonly || void 0,
|
|
994
994
|
onPointerdown: pointerdown
|
|
995
995
|
}, [
|
|
996
|
-
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
996
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_4$18, [renderSlot(_ctx.$slots, "prefix")])) : createCommentVNode("", true),
|
|
997
997
|
createElementVNode("input", {
|
|
998
998
|
id: controlId.value,
|
|
999
999
|
ref_key: "control",
|
|
@@ -1023,9 +1023,9 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
1023
1023
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event)),
|
|
1024
1024
|
onKeydown: _cache[2] || (_cache[2] = ($event) => emit("keydown", $event)),
|
|
1025
1025
|
onKeyup: _cache[3] || (_cache[3] = ($event) => emit("keyup", $event))
|
|
1026
|
-
}, null, 40, _hoisted_5$
|
|
1027
|
-
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
1028
|
-
], 42, _hoisted_3$
|
|
1026
|
+
}, null, 40, _hoisted_5$12),
|
|
1027
|
+
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_6$9, [renderSlot(_ctx.$slots, "suffix")])) : createCommentVNode("", true)
|
|
1028
|
+
], 42, _hoisted_3$22)], 8, _hoisted_2$26),
|
|
1029
1029
|
__props.description ? (openBlock(), createElementBlock("span", {
|
|
1030
1030
|
key: 0,
|
|
1031
1031
|
id: `${controlId.value}-description`,
|
|
@@ -1036,14 +1036,14 @@ var Input_default = /* @__PURE__ */ defineComponent({
|
|
|
1036
1036
|
id: `${controlId.value}-error`,
|
|
1037
1037
|
class: "input__error"
|
|
1038
1038
|
}, toDisplayString(__props.errorMessage), 9, _hoisted_8$7)) : createCommentVNode("", true)
|
|
1039
|
-
], 10, _hoisted_1$
|
|
1039
|
+
], 10, _hoisted_1$32);
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
1042
|
});
|
|
1043
1043
|
//#endregion
|
|
1044
1044
|
//#region src/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
1045
|
-
var _hoisted_1$
|
|
1046
|
-
var _hoisted_2$
|
|
1045
|
+
var _hoisted_1$31 = ["data-resize", "dir"];
|
|
1046
|
+
var _hoisted_2$25 = [
|
|
1047
1047
|
"id",
|
|
1048
1048
|
"rows",
|
|
1049
1049
|
"name",
|
|
@@ -1058,8 +1058,8 @@ var _hoisted_2$24 = [
|
|
|
1058
1058
|
"autocomplete",
|
|
1059
1059
|
"maxlength"
|
|
1060
1060
|
];
|
|
1061
|
-
var _hoisted_3$
|
|
1062
|
-
var _hoisted_4$
|
|
1061
|
+
var _hoisted_3$21 = ["id"];
|
|
1062
|
+
var _hoisted_4$17 = ["id"];
|
|
1063
1063
|
//#endregion
|
|
1064
1064
|
//#region src/Textarea.vue
|
|
1065
1065
|
var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1144,18 +1144,18 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1144
1144
|
autocomplete: __props.autoComplete,
|
|
1145
1145
|
maxlength: __props.maxLength,
|
|
1146
1146
|
onInput
|
|
1147
|
-
}, null, 40, _hoisted_2$
|
|
1147
|
+
}, null, 40, _hoisted_2$25),
|
|
1148
1148
|
__props.description ? (openBlock(), createElementBlock("span", {
|
|
1149
1149
|
key: 0,
|
|
1150
1150
|
id: `${controlId.value}-description`,
|
|
1151
1151
|
class: "input__description"
|
|
1152
|
-
}, toDisplayString(__props.description), 9, _hoisted_3$
|
|
1152
|
+
}, toDisplayString(__props.description), 9, _hoisted_3$21)) : createCommentVNode("", true),
|
|
1153
1153
|
showError.value ? (openBlock(), createElementBlock("div", {
|
|
1154
1154
|
key: 1,
|
|
1155
1155
|
id: `${controlId.value}-error`,
|
|
1156
1156
|
class: "input__error"
|
|
1157
|
-
}, toDisplayString(__props.errorMessage), 9, _hoisted_4$
|
|
1158
|
-
], 8, _hoisted_1$
|
|
1157
|
+
}, toDisplayString(__props.errorMessage), 9, _hoisted_4$17)) : createCommentVNode("", true)
|
|
1158
|
+
], 8, _hoisted_1$31);
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
});
|
|
@@ -1184,9 +1184,9 @@ var Label_default = /* @__PURE__ */ defineComponent({
|
|
|
1184
1184
|
});
|
|
1185
1185
|
//#endregion
|
|
1186
1186
|
//#region src/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
1187
|
-
var _hoisted_1$
|
|
1188
|
-
var _hoisted_2$
|
|
1189
|
-
var _hoisted_3$
|
|
1187
|
+
var _hoisted_1$30 = ["dir"];
|
|
1188
|
+
var _hoisted_2$24 = ["data-disabled"];
|
|
1189
|
+
var _hoisted_3$20 = ["name", "value"];
|
|
1190
1190
|
//#endregion
|
|
1191
1191
|
//#region src/Checkbox.vue
|
|
1192
1192
|
var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1278,13 +1278,13 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1278
1278
|
}, {
|
|
1279
1279
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.label), 1)]),
|
|
1280
1280
|
_: 1
|
|
1281
|
-
}, 8, ["for"])], 8, _hoisted_2$
|
|
1281
|
+
}, 8, ["for"])], 8, _hoisted_2$24),
|
|
1282
1282
|
__props.indeterminate && selected.value && __props.name && !__props.disabled ? (openBlock(), createElementBlock("input", {
|
|
1283
1283
|
key: 0,
|
|
1284
1284
|
type: "hidden",
|
|
1285
1285
|
name: __props.name,
|
|
1286
1286
|
value: __props.value
|
|
1287
|
-
}, null, 8, _hoisted_3$
|
|
1287
|
+
}, null, 8, _hoisted_3$20)) : createCommentVNode("", true),
|
|
1288
1288
|
createVNode(FieldFeedback_default, {
|
|
1289
1289
|
"control-id": unref(controlId),
|
|
1290
1290
|
description: __props.description,
|
|
@@ -1296,15 +1296,15 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1296
1296
|
"error-message",
|
|
1297
1297
|
"show-error"
|
|
1298
1298
|
])
|
|
1299
|
-
], 8, _hoisted_1$
|
|
1299
|
+
], 8, _hoisted_1$30);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
//#endregion
|
|
1304
1304
|
//#region src/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
1305
|
-
var _hoisted_1$
|
|
1306
|
-
var _hoisted_2$
|
|
1307
|
-
var _hoisted_3$
|
|
1305
|
+
var _hoisted_1$29 = ["id"];
|
|
1306
|
+
var _hoisted_2$23 = ["data-orientation"];
|
|
1307
|
+
var _hoisted_3$19 = ["data-disabled"];
|
|
1308
1308
|
//#endregion
|
|
1309
1309
|
//#region src/RadioGroup.vue
|
|
1310
1310
|
var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1367,7 +1367,7 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
1367
1367
|
createElementVNode("span", {
|
|
1368
1368
|
id: `${unref(controlId)}-label`,
|
|
1369
1369
|
class: "label"
|
|
1370
|
-
}, toDisplayString(__props.label), 9, _hoisted_1$
|
|
1370
|
+
}, toDisplayString(__props.label), 9, _hoisted_1$29),
|
|
1371
1371
|
createElementVNode("div", {
|
|
1372
1372
|
class: "radio-group__items",
|
|
1373
1373
|
"data-orientation": __props.orientation
|
|
@@ -1396,8 +1396,8 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
1396
1396
|
}, {
|
|
1397
1397
|
default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1)]),
|
|
1398
1398
|
_: 2
|
|
1399
|
-
}, 1032, ["for"])], 8, _hoisted_3$
|
|
1400
|
-
}), 128))], 8, _hoisted_2$
|
|
1399
|
+
}, 1032, ["for"])], 8, _hoisted_3$19);
|
|
1400
|
+
}), 128))], 8, _hoisted_2$23),
|
|
1401
1401
|
createVNode(FieldFeedback_default, {
|
|
1402
1402
|
"control-id": unref(controlId),
|
|
1403
1403
|
description: __props.description,
|
|
@@ -1428,8 +1428,8 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
1428
1428
|
});
|
|
1429
1429
|
//#endregion
|
|
1430
1430
|
//#region src/Switch.vue?vue&type=script&setup=true&lang.ts
|
|
1431
|
-
var _hoisted_1$
|
|
1432
|
-
var _hoisted_2$
|
|
1431
|
+
var _hoisted_1$28 = ["dir"];
|
|
1432
|
+
var _hoisted_2$22 = ["data-disabled"];
|
|
1433
1433
|
//#endregion
|
|
1434
1434
|
//#region src/Switch.vue
|
|
1435
1435
|
var Switch_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1510,7 +1510,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
1510
1510
|
}, {
|
|
1511
1511
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.label), 1)]),
|
|
1512
1512
|
_: 1
|
|
1513
|
-
}, 8, ["for"])], 8, _hoisted_2$
|
|
1513
|
+
}, 8, ["for"])], 8, _hoisted_2$22), createVNode(FieldFeedback_default, {
|
|
1514
1514
|
"control-id": unref(controlId),
|
|
1515
1515
|
description: __props.description,
|
|
1516
1516
|
"error-message": __props.errorMessage,
|
|
@@ -1520,7 +1520,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
1520
1520
|
"description",
|
|
1521
1521
|
"error-message",
|
|
1522
1522
|
"show-error"
|
|
1523
|
-
])], 8, _hoisted_1$
|
|
1523
|
+
])], 8, _hoisted_1$28);
|
|
1524
1524
|
};
|
|
1525
1525
|
}
|
|
1526
1526
|
});
|
|
@@ -1529,7 +1529,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
1529
1529
|
var formErrorsKey = /* @__PURE__ */ Symbol("KazeeFormErrors");
|
|
1530
1530
|
//#endregion
|
|
1531
1531
|
//#region src/Field.vue?vue&type=script&setup=true&lang.ts
|
|
1532
|
-
var _hoisted_1$
|
|
1532
|
+
var _hoisted_1$27 = ["dir"];
|
|
1533
1533
|
//#endregion
|
|
1534
1534
|
//#region src/Field.vue
|
|
1535
1535
|
var Field_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1621,13 +1621,13 @@ var Field_default = /* @__PURE__ */ defineComponent({
|
|
|
1621
1621
|
"error-message",
|
|
1622
1622
|
"show-error"
|
|
1623
1623
|
])
|
|
1624
|
-
], 8, _hoisted_1$
|
|
1624
|
+
], 8, _hoisted_1$27);
|
|
1625
1625
|
};
|
|
1626
1626
|
}
|
|
1627
1627
|
});
|
|
1628
1628
|
//#endregion
|
|
1629
1629
|
//#region src/Form.vue?vue&type=script&setup=true&lang.ts
|
|
1630
|
-
var _hoisted_1$
|
|
1630
|
+
var _hoisted_1$26 = [
|
|
1631
1631
|
"id",
|
|
1632
1632
|
"dir",
|
|
1633
1633
|
"aria-label",
|
|
@@ -1682,7 +1682,7 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
1682
1682
|
novalidate: __props.noValidate,
|
|
1683
1683
|
onSubmit: submit,
|
|
1684
1684
|
onReset: _cache[0] || (_cache[0] = ($event) => emit("reset", $event))
|
|
1685
|
-
}, [renderSlot(_ctx.$slots, "default")], 40, _hoisted_1$
|
|
1685
|
+
}, [renderSlot(_ctx.$slots, "default")], 40, _hoisted_1$26);
|
|
1686
1686
|
};
|
|
1687
1687
|
}
|
|
1688
1688
|
});
|
|
@@ -1702,17 +1702,17 @@ function listboxSelection(value, options, mode) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
//#endregion
|
|
1704
1704
|
//#region src/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
1705
|
-
var _hoisted_1$
|
|
1706
|
-
var _hoisted_2$
|
|
1707
|
-
var _hoisted_3$
|
|
1708
|
-
var _hoisted_4$
|
|
1705
|
+
var _hoisted_1$25 = ["dir"];
|
|
1706
|
+
var _hoisted_2$21 = ["id"];
|
|
1707
|
+
var _hoisted_3$18 = { class: "listbox__text" };
|
|
1708
|
+
var _hoisted_4$16 = {
|
|
1709
1709
|
key: 0,
|
|
1710
1710
|
class: "listbox__empty",
|
|
1711
1711
|
role: "option",
|
|
1712
1712
|
"aria-disabled": "true",
|
|
1713
1713
|
"aria-selected": "false"
|
|
1714
1714
|
};
|
|
1715
|
-
var _hoisted_5$
|
|
1715
|
+
var _hoisted_5$11 = [
|
|
1716
1716
|
"name",
|
|
1717
1717
|
"value",
|
|
1718
1718
|
"disabled"
|
|
@@ -1768,7 +1768,7 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1768
1768
|
createElementVNode("span", {
|
|
1769
1769
|
id: labelId.value,
|
|
1770
1770
|
class: "label"
|
|
1771
|
-
}, toDisplayString(__props.label), 9, _hoisted_2$
|
|
1771
|
+
}, toDisplayString(__props.label), 9, _hoisted_2$21),
|
|
1772
1772
|
createVNode(unref(ListboxRoot), {
|
|
1773
1773
|
"model-value": model.value,
|
|
1774
1774
|
multiple: __props.selectionMode === "multiple",
|
|
@@ -1795,14 +1795,14 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1795
1795
|
"aria-disabled": __props.disabled || option.isDisabled || void 0,
|
|
1796
1796
|
class: "listbox__item"
|
|
1797
1797
|
}, {
|
|
1798
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_3$
|
|
1798
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_3$18, toDisplayString(option.label), 1), createVNode(CheckIcon_default, { class: "listbox__check" })]),
|
|
1799
1799
|
_: 2
|
|
1800
1800
|
}, 1032, [
|
|
1801
1801
|
"value",
|
|
1802
1802
|
"disabled",
|
|
1803
1803
|
"aria-disabled"
|
|
1804
1804
|
]);
|
|
1805
|
-
}), 128)), !__props.options.length ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
1805
|
+
}), 128)), !__props.options.length ? (openBlock(), createElementBlock("span", _hoisted_4$16, toDisplayString(__props.emptyMessage), 1)) : createCommentVNode("", true)]),
|
|
1806
1806
|
_: 1
|
|
1807
1807
|
}, 8, [
|
|
1808
1808
|
"id",
|
|
@@ -1838,17 +1838,17 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
1838
1838
|
name: __props.name,
|
|
1839
1839
|
value: key,
|
|
1840
1840
|
disabled: __props.disabled
|
|
1841
|
-
}, null, 8, _hoisted_5$
|
|
1841
|
+
}, null, 8, _hoisted_5$11);
|
|
1842
1842
|
}), 128)) : createCommentVNode("", true)
|
|
1843
|
-
], 8, _hoisted_1$
|
|
1843
|
+
], 8, _hoisted_1$25);
|
|
1844
1844
|
};
|
|
1845
1845
|
}
|
|
1846
1846
|
});
|
|
1847
1847
|
//#endregion
|
|
1848
1848
|
//#region src/NumberField.vue?vue&type=script&setup=true&lang.ts
|
|
1849
|
-
var _hoisted_1$
|
|
1850
|
-
var _hoisted_2$
|
|
1851
|
-
var _hoisted_3$
|
|
1849
|
+
var _hoisted_1$24 = ["dir"];
|
|
1850
|
+
var _hoisted_2$20 = { class: "number-field__group" };
|
|
1851
|
+
var _hoisted_3$17 = [
|
|
1852
1852
|
"name",
|
|
1853
1853
|
"value",
|
|
1854
1854
|
"disabled"
|
|
@@ -1933,7 +1933,7 @@ var NumberField_default = /* @__PURE__ */ defineComponent({
|
|
|
1933
1933
|
"disable-wheel-change": "",
|
|
1934
1934
|
"onUpdate:modelValue": update
|
|
1935
1935
|
}, {
|
|
1936
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_2$
|
|
1936
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_2$20, [
|
|
1937
1937
|
createVNode(unref(NumberFieldDecrement), {
|
|
1938
1938
|
class: "number-field__step",
|
|
1939
1939
|
"aria-label": __props.decrementLabel ?? `Kurangi ${__props.label}`
|
|
@@ -1991,31 +1991,31 @@ var NumberField_default = /* @__PURE__ */ defineComponent({
|
|
|
1991
1991
|
name: __props.name,
|
|
1992
1992
|
value: selected.value === null ? "" : String(selected.value),
|
|
1993
1993
|
disabled: __props.disabled
|
|
1994
|
-
}, null, 8, _hoisted_3$
|
|
1995
|
-
], 8, _hoisted_1$
|
|
1994
|
+
}, null, 8, _hoisted_3$17)) : createCommentVNode("", true)
|
|
1995
|
+
], 8, _hoisted_1$24);
|
|
1996
1996
|
};
|
|
1997
1997
|
}
|
|
1998
1998
|
});
|
|
1999
1999
|
//#endregion
|
|
2000
2000
|
//#region src/Card.vue?vue&type=script&setup=true&lang.ts
|
|
2001
|
-
var _hoisted_1$
|
|
2002
|
-
var _hoisted_2$
|
|
2001
|
+
var _hoisted_1$23 = { class: "card" };
|
|
2002
|
+
var _hoisted_2$19 = {
|
|
2003
2003
|
key: 0,
|
|
2004
2004
|
class: "card__header"
|
|
2005
2005
|
};
|
|
2006
|
-
var _hoisted_3$
|
|
2006
|
+
var _hoisted_3$16 = {
|
|
2007
2007
|
key: 0,
|
|
2008
2008
|
class: "card__heading"
|
|
2009
2009
|
};
|
|
2010
|
-
var _hoisted_4$
|
|
2010
|
+
var _hoisted_4$15 = {
|
|
2011
2011
|
key: 0,
|
|
2012
2012
|
class: "card__title-row"
|
|
2013
2013
|
};
|
|
2014
|
-
var _hoisted_5$
|
|
2014
|
+
var _hoisted_5$10 = {
|
|
2015
2015
|
key: 2,
|
|
2016
2016
|
class: "card__description"
|
|
2017
2017
|
};
|
|
2018
|
-
var _hoisted_6$
|
|
2018
|
+
var _hoisted_6$8 = {
|
|
2019
2019
|
key: 1,
|
|
2020
2020
|
class: "card__actions"
|
|
2021
2021
|
};
|
|
@@ -2035,8 +2035,8 @@ var Card_default = /* @__PURE__ */ defineComponent({
|
|
|
2035
2035
|
},
|
|
2036
2036
|
setup(__props) {
|
|
2037
2037
|
return (_ctx, _cache) => {
|
|
2038
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2039
|
-
__props.title || __props.description || _ctx.$slots.actions || _ctx.$slots.header || _ctx.$slots["title-extras"] ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2038
|
+
return openBlock(), createElementBlock("div", _hoisted_1$23, [
|
|
2039
|
+
__props.title || __props.description || _ctx.$slots.actions || _ctx.$slots.header || _ctx.$slots["title-extras"] ? (openBlock(), createElementBlock("div", _hoisted_2$19, [__props.title || __props.description || _ctx.$slots.header || _ctx.$slots["title-extras"] ? (openBlock(), createElementBlock("div", _hoisted_3$16, [renderSlot(_ctx.$slots, "header", {}, () => [_ctx.$slots["title-extras"] ? (openBlock(), createElementBlock("div", _hoisted_4$15, [__props.title ? (openBlock(), createBlock(resolveDynamicComponent(`h${__props.headingLevel}`), {
|
|
2040
2040
|
key: 0,
|
|
2041
2041
|
class: "card__title"
|
|
2042
2042
|
}, {
|
|
@@ -2048,7 +2048,7 @@ var Card_default = /* @__PURE__ */ defineComponent({
|
|
|
2048
2048
|
}, {
|
|
2049
2049
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
|
|
2050
2050
|
_: 1
|
|
2051
|
-
})) : createCommentVNode("", true), __props.description ? (openBlock(), createElementBlock("p", _hoisted_5$
|
|
2051
|
+
})) : createCommentVNode("", true), __props.description ? (openBlock(), createElementBlock("p", _hoisted_5$10, toDisplayString(__props.description), 1)) : createCommentVNode("", true)])])) : createCommentVNode("", true), _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6$8, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
2052
2052
|
createElementVNode("div", _hoisted_7$6, [renderSlot(_ctx.$slots, "default")]),
|
|
2053
2053
|
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8$6, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("", true)
|
|
2054
2054
|
]);
|
|
@@ -2057,7 +2057,7 @@ var Card_default = /* @__PURE__ */ defineComponent({
|
|
|
2057
2057
|
});
|
|
2058
2058
|
//#endregion
|
|
2059
2059
|
//#region src/Badge.vue?vue&type=script&setup=true&lang.ts
|
|
2060
|
-
var _hoisted_1$
|
|
2060
|
+
var _hoisted_1$22 = ["data-tone"];
|
|
2061
2061
|
//#endregion
|
|
2062
2062
|
//#region src/Badge.vue
|
|
2063
2063
|
var Badge_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2068,13 +2068,13 @@ var Badge_default = /* @__PURE__ */ defineComponent({
|
|
|
2068
2068
|
return openBlock(), createElementBlock("span", {
|
|
2069
2069
|
class: "badge",
|
|
2070
2070
|
"data-tone": __props.tone
|
|
2071
|
-
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$
|
|
2071
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$22);
|
|
2072
2072
|
};
|
|
2073
2073
|
}
|
|
2074
2074
|
});
|
|
2075
2075
|
//#endregion
|
|
2076
2076
|
//#region src/Skeleton.vue?vue&type=script&setup=true&lang.ts
|
|
2077
|
-
var _hoisted_1$
|
|
2077
|
+
var _hoisted_1$21 = ["data-shape", "data-animated"];
|
|
2078
2078
|
//#endregion
|
|
2079
2079
|
//#region src/Skeleton.vue
|
|
2080
2080
|
var Skeleton_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2094,13 +2094,13 @@ var Skeleton_default = /* @__PURE__ */ defineComponent({
|
|
|
2094
2094
|
"data-shape": __props.shape,
|
|
2095
2095
|
"data-animated": __props.animated ? "true" : void 0,
|
|
2096
2096
|
"aria-hidden": "true"
|
|
2097
|
-
}), null, 16, _hoisted_1$
|
|
2097
|
+
}), null, 16, _hoisted_1$21);
|
|
2098
2098
|
};
|
|
2099
2099
|
}
|
|
2100
2100
|
});
|
|
2101
2101
|
//#endregion
|
|
2102
2102
|
//#region src/Separator.vue?vue&type=script&setup=true&lang.ts
|
|
2103
|
-
var _hoisted_1$
|
|
2103
|
+
var _hoisted_1$20 = [
|
|
2104
2104
|
"data-orientation",
|
|
2105
2105
|
"role",
|
|
2106
2106
|
"aria-hidden",
|
|
@@ -2126,7 +2126,7 @@ var Separator_default = /* @__PURE__ */ defineComponent({
|
|
|
2126
2126
|
role: __props.decorative ? "presentation" : "separator",
|
|
2127
2127
|
"aria-hidden": __props.decorative ? "true" : void 0,
|
|
2128
2128
|
"aria-orientation": __props.decorative ? void 0 : __props.orientation
|
|
2129
|
-
}), null, 16, _hoisted_1$
|
|
2129
|
+
}), null, 16, _hoisted_1$20);
|
|
2130
2130
|
};
|
|
2131
2131
|
}
|
|
2132
2132
|
});
|
|
@@ -2229,19 +2229,19 @@ function mountTabsIndicator(container) {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
//#endregion
|
|
2231
2231
|
//#region src/TabsListView.vue?vue&type=script&setup=true&lang.ts
|
|
2232
|
-
var _hoisted_1$
|
|
2233
|
-
var _hoisted_2$
|
|
2232
|
+
var _hoisted_1$19 = ["aria-label"];
|
|
2233
|
+
var _hoisted_2$18 = {
|
|
2234
2234
|
key: 0,
|
|
2235
2235
|
class: "tabs__separator",
|
|
2236
2236
|
"aria-hidden": "true"
|
|
2237
2237
|
};
|
|
2238
|
-
var _hoisted_3$
|
|
2238
|
+
var _hoisted_3$15 = {
|
|
2239
2239
|
key: 1,
|
|
2240
2240
|
class: "tabs__icon",
|
|
2241
2241
|
"aria-hidden": "true"
|
|
2242
2242
|
};
|
|
2243
|
-
var _hoisted_4$
|
|
2244
|
-
var _hoisted_5$
|
|
2243
|
+
var _hoisted_4$14 = { class: "tabs__label" };
|
|
2244
|
+
var _hoisted_5$9 = ["aria-label"];
|
|
2245
2245
|
//#endregion
|
|
2246
2246
|
//#region src/TabsListView.vue
|
|
2247
2247
|
var TabsListView_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2275,7 +2275,7 @@ var TabsListView_default = /* @__PURE__ */ defineComponent({
|
|
|
2275
2275
|
}, [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
|
|
2276
2276
|
viewBox: "0 0 24 24",
|
|
2277
2277
|
"aria-hidden": "true"
|
|
2278
|
-
}, [createElementVNode("path", { d: "m14 6-6 6 6 6" })], -1)])], 8, _hoisted_1$
|
|
2278
|
+
}, [createElementVNode("path", { d: "m14 6-6 6 6 6" })], -1)])], 8, _hoisted_1$19),
|
|
2279
2279
|
createVNode(unref(TabsList), {
|
|
2280
2280
|
class: "tabs__list",
|
|
2281
2281
|
"aria-label": __props.label
|
|
@@ -2288,9 +2288,9 @@ var TabsListView_default = /* @__PURE__ */ defineComponent({
|
|
|
2288
2288
|
disabled: item.isDisabled
|
|
2289
2289
|
}, {
|
|
2290
2290
|
default: withCtx(() => [
|
|
2291
|
-
__props.showSeparators && index > 0 ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
2292
|
-
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
2293
|
-
createElementVNode("span", _hoisted_4$
|
|
2291
|
+
__props.showSeparators && index > 0 ? (openBlock(), createElementBlock("span", _hoisted_2$18)) : createCommentVNode("", true),
|
|
2292
|
+
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_3$15, [renderSlot(_ctx.$slots, "icon", { item })])) : createCommentVNode("", true),
|
|
2293
|
+
createElementVNode("span", _hoisted_4$14, toDisplayString(item.label), 1)
|
|
2294
2294
|
]),
|
|
2295
2295
|
_: 2
|
|
2296
2296
|
}, 1032, ["value", "disabled"]);
|
|
@@ -2306,23 +2306,23 @@ var TabsListView_default = /* @__PURE__ */ defineComponent({
|
|
|
2306
2306
|
}, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
|
|
2307
2307
|
viewBox: "0 0 24 24",
|
|
2308
2308
|
"aria-hidden": "true"
|
|
2309
|
-
}, [createElementVNode("path", { d: "m10 6 6 6-6 6" })], -1)])], 8, _hoisted_5$
|
|
2309
|
+
}, [createElementVNode("path", { d: "m10 6 6 6-6 6" })], -1)])], 8, _hoisted_5$9)
|
|
2310
2310
|
], 512);
|
|
2311
2311
|
};
|
|
2312
2312
|
}
|
|
2313
2313
|
});
|
|
2314
2314
|
//#endregion
|
|
2315
2315
|
//#region src/Tabs.vue?vue&type=script&setup=true&lang.ts
|
|
2316
|
-
var _hoisted_1$
|
|
2316
|
+
var _hoisted_1$18 = {
|
|
2317
2317
|
key: 0,
|
|
2318
2318
|
class: "tabs__toolbar"
|
|
2319
2319
|
};
|
|
2320
|
-
var _hoisted_2$
|
|
2321
|
-
var _hoisted_3$
|
|
2320
|
+
var _hoisted_2$17 = { class: "tabs__navigation" };
|
|
2321
|
+
var _hoisted_3$14 = {
|
|
2322
2322
|
key: 1,
|
|
2323
2323
|
class: "tabs__extras"
|
|
2324
2324
|
};
|
|
2325
|
-
var _hoisted_4$
|
|
2325
|
+
var _hoisted_4$13 = {
|
|
2326
2326
|
key: 0,
|
|
2327
2327
|
class: "tabs__actions"
|
|
2328
2328
|
};
|
|
@@ -2386,7 +2386,7 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
2386
2386
|
"data-orientation": __props.orientation,
|
|
2387
2387
|
"onUpdate:modelValue": update
|
|
2388
2388
|
}, {
|
|
2389
|
-
default: withCtx(() => [_ctx.$slots.extras || _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2389
|
+
default: withCtx(() => [_ctx.$slots.extras || _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_1$18, [createElementVNode("div", _hoisted_2$17, [__props.items.length ? (openBlock(), createBlock(TabsListView_default, {
|
|
2390
2390
|
key: 0,
|
|
2391
2391
|
label: __props.label,
|
|
2392
2392
|
items: __props.items,
|
|
@@ -2403,7 +2403,7 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
|
|
|
2403
2403
|
"show-separators",
|
|
2404
2404
|
"previous-label",
|
|
2405
2405
|
"next-label"
|
|
2406
|
-
])) : createCommentVNode("", true), _ctx.$slots.extras ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2406
|
+
])) : createCommentVNode("", true), _ctx.$slots.extras ? (openBlock(), createElementBlock("div", _hoisted_3$14, [renderSlot(_ctx.$slots, "extras")])) : createCommentVNode("", true)]), _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_4$13, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true)])) : __props.items.length ? (openBlock(), createBlock(TabsListView_default, {
|
|
2407
2407
|
key: 1,
|
|
2408
2408
|
label: __props.label,
|
|
2409
2409
|
items: __props.items,
|
|
@@ -2472,25 +2472,25 @@ function paginationModel(totalItems, pageSize, value, siblingCount = 1) {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
//#endregion
|
|
2474
2474
|
//#region src/Pagination.vue?vue&type=script&setup=true&lang.ts
|
|
2475
|
-
var _hoisted_1$
|
|
2475
|
+
var _hoisted_1$17 = [
|
|
2476
2476
|
"id",
|
|
2477
2477
|
"aria-label",
|
|
2478
2478
|
"dir"
|
|
2479
2479
|
];
|
|
2480
|
-
var _hoisted_2$
|
|
2481
|
-
var _hoisted_3$
|
|
2480
|
+
var _hoisted_2$16 = ["disabled"];
|
|
2481
|
+
var _hoisted_3$13 = {
|
|
2482
2482
|
key: 0,
|
|
2483
2483
|
class: "pagination__gap",
|
|
2484
2484
|
"aria-hidden": "true"
|
|
2485
2485
|
};
|
|
2486
|
-
var _hoisted_4$
|
|
2486
|
+
var _hoisted_4$12 = [
|
|
2487
2487
|
"aria-label",
|
|
2488
2488
|
"aria-current",
|
|
2489
2489
|
"disabled",
|
|
2490
2490
|
"onClick"
|
|
2491
2491
|
];
|
|
2492
|
-
var _hoisted_5$
|
|
2493
|
-
var _hoisted_6$
|
|
2492
|
+
var _hoisted_5$8 = ["disabled"];
|
|
2493
|
+
var _hoisted_6$7 = {
|
|
2494
2494
|
class: "pagination__summary",
|
|
2495
2495
|
"aria-live": "polite"
|
|
2496
2496
|
};
|
|
@@ -2539,9 +2539,9 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
2539
2539
|
class: "pagination__button",
|
|
2540
2540
|
disabled: __props.disabled || model.value.current === 1,
|
|
2541
2541
|
onClick: _cache[0] || (_cache[0] = ($event) => change(model.value.current - 1))
|
|
2542
|
-
}, toDisplayString(__props.previousLabel), 9, _hoisted_2$
|
|
2542
|
+
}, toDisplayString(__props.previousLabel), 9, _hoisted_2$16),
|
|
2543
2543
|
(openBlock(true), createElementBlock(Fragment, null, renderList(model.value.entries, (entry) => {
|
|
2544
|
-
return openBlock(), createElementBlock(Fragment, { key: entry }, [typeof entry === "string" ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
2544
|
+
return openBlock(), createElementBlock(Fragment, { key: entry }, [typeof entry === "string" ? (openBlock(), createElementBlock("span", _hoisted_3$13, "...")) : (openBlock(), createElementBlock("button", {
|
|
2545
2545
|
key: 1,
|
|
2546
2546
|
type: "button",
|
|
2547
2547
|
class: "pagination__button",
|
|
@@ -2549,23 +2549,23 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
2549
2549
|
"aria-current": entry === model.value.current ? "page" : void 0,
|
|
2550
2550
|
disabled: __props.disabled,
|
|
2551
2551
|
onClick: ($event) => change(entry)
|
|
2552
|
-
}, toDisplayString(entry), 9, _hoisted_4$
|
|
2552
|
+
}, toDisplayString(entry), 9, _hoisted_4$12))], 64);
|
|
2553
2553
|
}), 128)),
|
|
2554
2554
|
createElementVNode("button", {
|
|
2555
2555
|
type: "button",
|
|
2556
2556
|
class: "pagination__button",
|
|
2557
2557
|
disabled: __props.disabled || model.value.current === model.value.count,
|
|
2558
2558
|
onClick: _cache[1] || (_cache[1] = ($event) => change(model.value.current + 1))
|
|
2559
|
-
}, toDisplayString(__props.nextLabel), 9, _hoisted_5$
|
|
2560
|
-
createElementVNode("span", _hoisted_6$
|
|
2561
|
-
], 8, _hoisted_1$
|
|
2559
|
+
}, toDisplayString(__props.nextLabel), 9, _hoisted_5$8),
|
|
2560
|
+
createElementVNode("span", _hoisted_6$7, toDisplayString(model.value.current) + " / " + toDisplayString(model.value.count), 1)
|
|
2561
|
+
], 8, _hoisted_1$17);
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
2564
|
});
|
|
2565
2565
|
//#endregion
|
|
2566
2566
|
//#region src/Table.vue?vue&type=script&setup=true&lang.ts
|
|
2567
|
-
var _hoisted_1$
|
|
2568
|
-
var _hoisted_2$
|
|
2567
|
+
var _hoisted_1$16 = ["aria-label"];
|
|
2568
|
+
var _hoisted_2$15 = { class: "table__caption" };
|
|
2569
2569
|
//#endregion
|
|
2570
2570
|
//#region src/Table.vue
|
|
2571
2571
|
var Table_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2579,18 +2579,18 @@ var Table_default = /* @__PURE__ */ defineComponent({
|
|
|
2579
2579
|
role: "region",
|
|
2580
2580
|
"aria-label": __props.caption,
|
|
2581
2581
|
tabindex: "0"
|
|
2582
|
-
}, [createElementVNode("table", mergeProps(_ctx.$attrs, { class: "table" }), [createElementVNode("caption", _hoisted_2$
|
|
2582
|
+
}, [createElementVNode("table", mergeProps(_ctx.$attrs, { class: "table" }), [createElementVNode("caption", _hoisted_2$15, toDisplayString(__props.caption), 1), renderSlot(_ctx.$slots, "default")], 16)], 8, _hoisted_1$16);
|
|
2583
2583
|
};
|
|
2584
2584
|
}
|
|
2585
2585
|
});
|
|
2586
2586
|
//#endregion
|
|
2587
2587
|
//#region src/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
2588
|
-
var _hoisted_1$
|
|
2589
|
-
var _hoisted_2$
|
|
2590
|
-
var _hoisted_3$
|
|
2591
|
-
var _hoisted_4$
|
|
2592
|
-
var _hoisted_5$
|
|
2593
|
-
var _hoisted_6$
|
|
2588
|
+
var _hoisted_1$15 = ["id", "dir"];
|
|
2589
|
+
var _hoisted_2$14 = ["aria-sort"];
|
|
2590
|
+
var _hoisted_3$12 = ["disabled", "onClick"];
|
|
2591
|
+
var _hoisted_4$11 = { "aria-hidden": "true" };
|
|
2592
|
+
var _hoisted_5$7 = { key: 0 };
|
|
2593
|
+
var _hoisted_6$6 = ["colspan"];
|
|
2594
2594
|
var _hoisted_7$5 = {
|
|
2595
2595
|
key: 0,
|
|
2596
2596
|
class: "data-table__status",
|
|
@@ -2657,7 +2657,7 @@ var DataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
2657
2657
|
class: "table__sort",
|
|
2658
2658
|
disabled: __props.loading || __props.disabled,
|
|
2659
2659
|
onClick: ($event) => requestSort(column)
|
|
2660
|
-
}, [createTextVNode(toDisplayString(column.label), 1), createElementVNode("span", _hoisted_4$
|
|
2660
|
+
}, [createTextVNode(toDisplayString(column.label), 1), createElementVNode("span", _hoisted_4$11, toDisplayString(__props.sort?.columnId === column.id ? __props.sort.direction === "ascending" ? "↑" : "↓" : "↕"), 1)], 8, _hoisted_3$12)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(column.label), 1)], 64))], 8, _hoisted_2$14);
|
|
2661
2661
|
}), 128))])]), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (row) => {
|
|
2662
2662
|
return openBlock(), createElementBlock("tr", { key: row.id }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
2663
2663
|
return openBlock(), createElementBlock("td", { key: column.id }, [renderSlot(_ctx.$slots, "cell", {
|
|
@@ -2666,31 +2666,31 @@ var DataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
2666
2666
|
value: row.cells[column.id]
|
|
2667
2667
|
}, () => [createTextVNode(toDisplayString(row.cells[column.id] ?? ""), 1)])]);
|
|
2668
2668
|
}), 128))]);
|
|
2669
|
-
}), 128)), !__props.rows.length ? (openBlock(), createElementBlock("tr", _hoisted_5$
|
|
2669
|
+
}), 128)), !__props.rows.length ? (openBlock(), createElementBlock("tr", _hoisted_5$7, [createElementVNode("td", {
|
|
2670
2670
|
colspan: Math.max(1, __props.columns.length),
|
|
2671
2671
|
class: "table__empty"
|
|
2672
|
-
}, toDisplayString(__props.loading ? __props.loadingMessage : __props.errorMessage || __props.emptyMessage), 9, _hoisted_6$
|
|
2672
|
+
}, toDisplayString(__props.loading ? __props.loadingMessage : __props.errorMessage || __props.emptyMessage), 9, _hoisted_6$6)])) : createCommentVNode("", true)])]),
|
|
2673
2673
|
_: 3
|
|
2674
2674
|
}, 8, ["caption", "aria-busy"]),
|
|
2675
2675
|
__props.loading ? (openBlock(), createElementBlock("p", _hoisted_7$5, toDisplayString(__props.loadingMessage), 1)) : createCommentVNode("", true),
|
|
2676
2676
|
__props.errorMessage && !__props.loading ? (openBlock(), createElementBlock("p", _hoisted_8$5, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
|
|
2677
|
-
], 8, _hoisted_1$
|
|
2677
|
+
], 8, _hoisted_1$15);
|
|
2678
2678
|
};
|
|
2679
2679
|
}
|
|
2680
2680
|
});
|
|
2681
2681
|
//#endregion
|
|
2682
2682
|
//#region src/Alert.vue?vue&type=script&setup=true&lang.ts
|
|
2683
|
-
var _hoisted_1$
|
|
2683
|
+
var _hoisted_1$14 = [
|
|
2684
2684
|
"id",
|
|
2685
2685
|
"data-tone",
|
|
2686
2686
|
"role"
|
|
2687
2687
|
];
|
|
2688
|
-
var _hoisted_2$
|
|
2689
|
-
var _hoisted_3$
|
|
2688
|
+
var _hoisted_2$13 = { class: "alert__title" };
|
|
2689
|
+
var _hoisted_3$11 = {
|
|
2690
2690
|
key: 0,
|
|
2691
2691
|
class: "alert__description"
|
|
2692
2692
|
};
|
|
2693
|
-
var _hoisted_4$
|
|
2693
|
+
var _hoisted_4$10 = {
|
|
2694
2694
|
key: 1,
|
|
2695
2695
|
class: "alert__actions"
|
|
2696
2696
|
};
|
|
@@ -2714,11 +2714,832 @@ var Alert_default = /* @__PURE__ */ defineComponent({
|
|
|
2714
2714
|
"data-tone": __props.tone,
|
|
2715
2715
|
role: __props.announcement === "polite" ? "status" : __props.announcement === "assertive" ? "alert" : void 0
|
|
2716
2716
|
}, [
|
|
2717
|
-
createElementVNode("p", _hoisted_2$
|
|
2718
|
-
__props.description ? (openBlock(), createElementBlock("p", _hoisted_3$
|
|
2717
|
+
createElementVNode("p", _hoisted_2$13, toDisplayString(__props.title), 1),
|
|
2718
|
+
__props.description ? (openBlock(), createElementBlock("p", _hoisted_3$11, toDisplayString(__props.description), 1)) : createCommentVNode("", true),
|
|
2719
2719
|
renderSlot(_ctx.$slots, "default"),
|
|
2720
|
-
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
2721
|
-
], 8, _hoisted_1$
|
|
2720
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_4$10, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true)
|
|
2721
|
+
], 8, _hoisted_1$14);
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
});
|
|
2725
|
+
//#endregion
|
|
2726
|
+
//#region src/useToast.ts
|
|
2727
|
+
var toastManagerKey = Symbol("KazeeToastManager");
|
|
2728
|
+
/** Access the nearest provider's manager. Create imperative managers per application. */
|
|
2729
|
+
function useToast() {
|
|
2730
|
+
const manager = inject(toastManagerKey);
|
|
2731
|
+
if (!manager) throw new Error("useToast must be used inside ToastProvider.");
|
|
2732
|
+
return manager;
|
|
2733
|
+
}
|
|
2734
|
+
//#endregion
|
|
2735
|
+
//#region src/Toast.vue?vue&type=script&setup=true&lang.ts
|
|
2736
|
+
var _hoisted_1$13 = [
|
|
2737
|
+
"data-toast-id",
|
|
2738
|
+
"data-tone",
|
|
2739
|
+
"data-loading",
|
|
2740
|
+
"data-state",
|
|
2741
|
+
"data-placement",
|
|
2742
|
+
"data-paused",
|
|
2743
|
+
"data-swipe",
|
|
2744
|
+
"dir",
|
|
2745
|
+
"inert",
|
|
2746
|
+
"aria-hidden",
|
|
2747
|
+
"tabindex"
|
|
2748
|
+
];
|
|
2749
|
+
var _hoisted_2$12 = {
|
|
2750
|
+
class: "toast__indicator",
|
|
2751
|
+
"aria-hidden": "true"
|
|
2752
|
+
};
|
|
2753
|
+
var _hoisted_3$10 = {
|
|
2754
|
+
viewBox: "0 0 24 24",
|
|
2755
|
+
fill: "none",
|
|
2756
|
+
stroke: "currentColor",
|
|
2757
|
+
"stroke-width": "1.8",
|
|
2758
|
+
"stroke-linecap": "round",
|
|
2759
|
+
"stroke-linejoin": "round"
|
|
2760
|
+
};
|
|
2761
|
+
var _hoisted_4$9 = { class: "toast__body" };
|
|
2762
|
+
var _hoisted_5$6 = {
|
|
2763
|
+
key: 1,
|
|
2764
|
+
class: "toast__actions"
|
|
2765
|
+
};
|
|
2766
|
+
var _hoisted_6$5 = {
|
|
2767
|
+
role: "status",
|
|
2768
|
+
"aria-live": "polite",
|
|
2769
|
+
"aria-atomic": "true",
|
|
2770
|
+
style: {
|
|
2771
|
+
"position": "absolute",
|
|
2772
|
+
"width": "1px",
|
|
2773
|
+
"height": "1px",
|
|
2774
|
+
"padding": "0",
|
|
2775
|
+
"margin": "-1px",
|
|
2776
|
+
"overflow": "hidden",
|
|
2777
|
+
"clip": "rect(0, 0, 0, 0)",
|
|
2778
|
+
"white-space": "nowrap",
|
|
2779
|
+
"border": "0"
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
//#endregion
|
|
2783
|
+
//#region src/Toast.vue
|
|
2784
|
+
var Toast_default = /* @__PURE__ */ defineComponent({
|
|
2785
|
+
inheritAttrs: false,
|
|
2786
|
+
__name: "Toast",
|
|
2787
|
+
props: {
|
|
2788
|
+
entry: {},
|
|
2789
|
+
manager: { default: void 0 },
|
|
2790
|
+
placement: { default: "bottom-end" },
|
|
2791
|
+
closeLabel: { default: "Tutup" },
|
|
2792
|
+
dir: { default: void 0 },
|
|
2793
|
+
showProgress: {
|
|
2794
|
+
type: Boolean,
|
|
2795
|
+
default: false
|
|
2796
|
+
},
|
|
2797
|
+
swipeThreshold: { default: 50 }
|
|
2798
|
+
},
|
|
2799
|
+
setup(__props) {
|
|
2800
|
+
const props = __props;
|
|
2801
|
+
const manager = props.manager ?? useToast();
|
|
2802
|
+
const closing = computed(() => props.entry.state === "closing");
|
|
2803
|
+
const swipe = ref();
|
|
2804
|
+
const delta = ref(0);
|
|
2805
|
+
const announcement = ref("");
|
|
2806
|
+
watch(() => [
|
|
2807
|
+
props.entry.title,
|
|
2808
|
+
props.entry.description,
|
|
2809
|
+
props.entry.isLoading
|
|
2810
|
+
], () => {
|
|
2811
|
+
if (!closing.value) announcement.value = [props.entry.title, props.entry.description].filter(Boolean).join(". ");
|
|
2812
|
+
});
|
|
2813
|
+
const style = computed(() => ({
|
|
2814
|
+
touchAction: "pan-y",
|
|
2815
|
+
"--toast-progress": props.entry.duration > 0 ? props.entry.remaining / props.entry.duration : 0,
|
|
2816
|
+
"--toast-remaining": `${props.entry.remaining}ms`,
|
|
2817
|
+
"--toast-duration": `${props.entry.duration}ms`,
|
|
2818
|
+
"--toast-swipe-x": `${delta.value}px`,
|
|
2819
|
+
"--reka-toast-swipe-move-x": `${delta.value}px`,
|
|
2820
|
+
"--reka-toast-swipe-end-x": `${delta.value}px`
|
|
2821
|
+
}));
|
|
2822
|
+
function viewport(element) {
|
|
2823
|
+
return element?.closest(".toast-list");
|
|
2824
|
+
}
|
|
2825
|
+
function dismiss() {
|
|
2826
|
+
const element = document.activeElement;
|
|
2827
|
+
if (element instanceof HTMLElement && element.closest("[data-toast-id]")?.getAttribute("data-toast-id") === props.entry.id) viewport(element)?.focus({ preventScroll: true });
|
|
2828
|
+
manager.dismiss(props.entry.id);
|
|
2829
|
+
}
|
|
2830
|
+
function action(value, reason, event) {
|
|
2831
|
+
event.preventDefault();
|
|
2832
|
+
value.onAction();
|
|
2833
|
+
if (value.dismiss !== false) {
|
|
2834
|
+
viewport(event.currentTarget)?.focus({ preventScroll: true });
|
|
2835
|
+
manager.dismiss(props.entry.id, reason);
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
let pointer;
|
|
2839
|
+
function pointerDown(event) {
|
|
2840
|
+
if (closing.value || event.button !== 0 || event.isPrimary === false) return;
|
|
2841
|
+
if (event.target.closest("button,a,input,textarea,select,[role=\"button\"],[contenteditable]:not([contenteditable=\"false\"]),[data-no-swipe]")) return;
|
|
2842
|
+
const rtl = props.dir === "rtl" || !props.dir && getComputedStyle(event.currentTarget).direction === "rtl";
|
|
2843
|
+
const start = props.placement.endsWith("start");
|
|
2844
|
+
pointer = {
|
|
2845
|
+
id: event.pointerId,
|
|
2846
|
+
x: event.clientX,
|
|
2847
|
+
y: event.clientY,
|
|
2848
|
+
direction: start !== rtl ? -1 : 1,
|
|
2849
|
+
started: false
|
|
2850
|
+
};
|
|
2851
|
+
}
|
|
2852
|
+
function pointerMove(event) {
|
|
2853
|
+
if (!pointer || pointer.id !== event.pointerId) return;
|
|
2854
|
+
const x = event.clientX - pointer.x;
|
|
2855
|
+
const y = event.clientY - pointer.y;
|
|
2856
|
+
if (!pointer.started) {
|
|
2857
|
+
if (Math.abs(y) > Math.abs(x) && Math.abs(y) > 8) {
|
|
2858
|
+
pointer = void 0;
|
|
2859
|
+
return;
|
|
2860
|
+
}
|
|
2861
|
+
if (Math.abs(x) < 8) return;
|
|
2862
|
+
if (x * pointer.direction < 0) {
|
|
2863
|
+
pointer = void 0;
|
|
2864
|
+
return;
|
|
2865
|
+
}
|
|
2866
|
+
pointer.started = true;
|
|
2867
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
2868
|
+
swipe.value = "start";
|
|
2869
|
+
}
|
|
2870
|
+
delta.value = Math.max(0, x * pointer.direction) * pointer.direction;
|
|
2871
|
+
swipe.value = "move";
|
|
2872
|
+
}
|
|
2873
|
+
function pointerEnd(event, cancel = false) {
|
|
2874
|
+
if (!pointer || pointer.id !== event.pointerId) return;
|
|
2875
|
+
const started = pointer.started;
|
|
2876
|
+
pointer = void 0;
|
|
2877
|
+
const node = event.currentTarget;
|
|
2878
|
+
if (node.hasPointerCapture?.(event.pointerId)) node.releasePointerCapture(event.pointerId);
|
|
2879
|
+
if (!started) return;
|
|
2880
|
+
if (!cancel && Math.abs(delta.value) >= props.swipeThreshold) {
|
|
2881
|
+
swipe.value = "end";
|
|
2882
|
+
manager.dismiss(props.entry.id, "swipe");
|
|
2883
|
+
} else {
|
|
2884
|
+
swipe.value = "cancel";
|
|
2885
|
+
delta.value = 0;
|
|
2886
|
+
}
|
|
2887
|
+
node.addEventListener("click", (click) => {
|
|
2888
|
+
click.preventDefault();
|
|
2889
|
+
click.stopPropagation();
|
|
2890
|
+
}, { once: true });
|
|
2891
|
+
}
|
|
2892
|
+
return (_ctx, _cache) => {
|
|
2893
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(ToastRoot), {
|
|
2894
|
+
open: !closing.value,
|
|
2895
|
+
"force-mount": true,
|
|
2896
|
+
duration: Infinity,
|
|
2897
|
+
type: "background",
|
|
2898
|
+
"as-child": ""
|
|
2899
|
+
}, {
|
|
2900
|
+
default: withCtx(() => [createElementVNode("li", {
|
|
2901
|
+
class: "toast",
|
|
2902
|
+
"data-toast-id": __props.entry.id,
|
|
2903
|
+
"data-tone": __props.entry.tone,
|
|
2904
|
+
"data-loading": __props.entry.isLoading || void 0,
|
|
2905
|
+
"data-state": __props.entry.state,
|
|
2906
|
+
"data-placement": __props.placement,
|
|
2907
|
+
"data-paused": __props.entry.paused || void 0,
|
|
2908
|
+
"data-swipe": swipe.value,
|
|
2909
|
+
dir: __props.dir,
|
|
2910
|
+
inert: closing.value || void 0,
|
|
2911
|
+
"aria-hidden": closing.value || void 0,
|
|
2912
|
+
tabindex: closing.value ? -1 : 0,
|
|
2913
|
+
style: normalizeStyle(style.value),
|
|
2914
|
+
onPointerdown: pointerDown,
|
|
2915
|
+
onPointermove: pointerMove,
|
|
2916
|
+
onPointerup: _cache[2] || (_cache[2] = ($event) => pointerEnd($event)),
|
|
2917
|
+
onPointercancel: _cache[3] || (_cache[3] = ($event) => pointerEnd($event, true))
|
|
2918
|
+
}, [
|
|
2919
|
+
createElementVNode("span", _hoisted_2$12, [renderSlot(_ctx.$slots, "indicator", { entry: __props.entry }, () => [(openBlock(), createElementBlock("svg", _hoisted_3$10, [__props.entry.isLoading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[4] || (_cache[4] = createElementVNode("circle", {
|
|
2920
|
+
cx: "12",
|
|
2921
|
+
cy: "12",
|
|
2922
|
+
r: "9",
|
|
2923
|
+
opacity: ".25"
|
|
2924
|
+
}, null, -1)), _cache[5] || (_cache[5] = createElementVNode("path", { d: "M12 3a9 9 0 0 1 9 9" }, null, -1))], 64)) : __props.entry.tone === "success" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[6] || (_cache[6] = createElementVNode("circle", {
|
|
2925
|
+
cx: "12",
|
|
2926
|
+
cy: "12",
|
|
2927
|
+
r: "9"
|
|
2928
|
+
}, null, -1)), _cache[7] || (_cache[7] = createElementVNode("path", { d: "m8 12 3 3 5-6" }, null, -1))], 64)) : __props.entry.tone === "warning" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[8] || (_cache[8] = createElementVNode("path", { d: "m12 3 10 18H2L12 3Z" }, null, -1)), _cache[9] || (_cache[9] = createElementVNode("path", { d: "M12 9v4m0 4h.01" }, null, -1))], 64)) : __props.entry.tone === "danger" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [_cache[10] || (_cache[10] = createElementVNode("circle", {
|
|
2929
|
+
cx: "12",
|
|
2930
|
+
cy: "12",
|
|
2931
|
+
r: "9"
|
|
2932
|
+
}, null, -1)), _cache[11] || (_cache[11] = createElementVNode("path", { d: "m9 9 6 6m0-6-6 6" }, null, -1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [_cache[12] || (_cache[12] = createElementVNode("circle", {
|
|
2933
|
+
cx: "12",
|
|
2934
|
+
cy: "12",
|
|
2935
|
+
r: "9"
|
|
2936
|
+
}, null, -1)), _cache[13] || (_cache[13] = createElementVNode("path", { d: "M12 11v6m0-10h.01" }, null, -1))], 64))]))])]),
|
|
2937
|
+
createElementVNode("div", _hoisted_4$9, [renderSlot(_ctx.$slots, "default", {
|
|
2938
|
+
entry: __props.entry,
|
|
2939
|
+
dismiss
|
|
2940
|
+
}, () => [
|
|
2941
|
+
createVNode(unref(ToastTitle), { class: "toast__title" }, {
|
|
2942
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.entry.title), 1)]),
|
|
2943
|
+
_: 1
|
|
2944
|
+
}),
|
|
2945
|
+
__props.entry.description ? (openBlock(), createBlock(unref(ToastDescription), {
|
|
2946
|
+
key: 0,
|
|
2947
|
+
class: "toast__description"
|
|
2948
|
+
}, {
|
|
2949
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.entry.description), 1)]),
|
|
2950
|
+
_: 1
|
|
2951
|
+
})) : createCommentVNode("", true),
|
|
2952
|
+
__props.entry.action || __props.entry.cancel ? (openBlock(), createElementBlock("div", _hoisted_5$6, [__props.entry.action ? (openBlock(), createBlock(unref(ToastAction), {
|
|
2953
|
+
key: 0,
|
|
2954
|
+
class: "toast__action",
|
|
2955
|
+
"alt-text": __props.entry.action.altText,
|
|
2956
|
+
"close-on-click": false,
|
|
2957
|
+
disabled: closing.value,
|
|
2958
|
+
onClick: _cache[0] || (_cache[0] = ($event) => action(__props.entry.action, "action", $event))
|
|
2959
|
+
}, {
|
|
2960
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.entry.action.label), 1)]),
|
|
2961
|
+
_: 1
|
|
2962
|
+
}, 8, ["alt-text", "disabled"])) : createCommentVNode("", true), __props.entry.cancel ? (openBlock(), createBlock(unref(ToastAction), {
|
|
2963
|
+
key: 1,
|
|
2964
|
+
class: "toast__action",
|
|
2965
|
+
"data-cancel": "",
|
|
2966
|
+
"alt-text": __props.entry.cancel.altText,
|
|
2967
|
+
"close-on-click": false,
|
|
2968
|
+
disabled: closing.value,
|
|
2969
|
+
onClick: _cache[1] || (_cache[1] = ($event) => action(__props.entry.cancel, "cancel", $event))
|
|
2970
|
+
}, {
|
|
2971
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.entry.cancel.label), 1)]),
|
|
2972
|
+
_: 1
|
|
2973
|
+
}, 8, ["alt-text", "disabled"])) : createCommentVNode("", true)])) : createCommentVNode("", true)
|
|
2974
|
+
])]),
|
|
2975
|
+
createVNode(unref(ToastClose), {
|
|
2976
|
+
class: "toast__close",
|
|
2977
|
+
"aria-label": __props.closeLabel,
|
|
2978
|
+
disabled: closing.value,
|
|
2979
|
+
onClick: dismiss
|
|
2980
|
+
}, {
|
|
2981
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createElementVNode("svg", {
|
|
2982
|
+
"aria-hidden": "true",
|
|
2983
|
+
viewBox: "0 0 24 24",
|
|
2984
|
+
fill: "none",
|
|
2985
|
+
stroke: "currentColor",
|
|
2986
|
+
"stroke-width": "1.8",
|
|
2987
|
+
"stroke-linecap": "round"
|
|
2988
|
+
}, [createElementVNode("path", { d: "m6 6 12 12M6 18 18 6" })], -1)])]),
|
|
2989
|
+
_: 1
|
|
2990
|
+
}, 8, ["aria-label", "disabled"]),
|
|
2991
|
+
__props.showProgress && __props.entry.duration > 0 && !__props.entry.isLoading ? (openBlock(), createElementBlock("span", {
|
|
2992
|
+
key: `${__props.entry.generation}-${__props.entry.remaining}-${__props.entry.paused}`,
|
|
2993
|
+
class: "toast__progress",
|
|
2994
|
+
"aria-hidden": "true"
|
|
2995
|
+
})) : createCommentVNode("", true)
|
|
2996
|
+
], 44, _hoisted_1$13)]),
|
|
2997
|
+
_: 3
|
|
2998
|
+
}, 8, ["open"]), createElementVNode("span", _hoisted_6$5, toDisplayString(announcement.value), 1)], 64);
|
|
2999
|
+
};
|
|
3000
|
+
}
|
|
3001
|
+
});
|
|
3002
|
+
//#endregion
|
|
3003
|
+
//#region src/toast-model.ts
|
|
3004
|
+
var EMPTY = Object.freeze([]);
|
|
3005
|
+
var messageOptions = (message) => typeof message === "string" ? { title: message } : message;
|
|
3006
|
+
var milliseconds = (value, fallback) => Number.isFinite(value) && value >= 0 ? value : fallback;
|
|
3007
|
+
/** Complete required notifications/cleanup before reporting user callback failures. */
|
|
3008
|
+
var complete = (operations) => {
|
|
3009
|
+
const errors = [];
|
|
3010
|
+
for (const operation of operations) try {
|
|
3011
|
+
operation();
|
|
3012
|
+
} catch (error) {
|
|
3013
|
+
errors.push(error);
|
|
3014
|
+
}
|
|
3015
|
+
if (errors.length === 1) throw errors[0];
|
|
3016
|
+
if (errors.length > 1) throw new AggregateError(errors, "Toast lifecycle callbacks failed.");
|
|
3017
|
+
};
|
|
3018
|
+
/** Create per application/provider; no browser globals or timers are used until attached. */
|
|
3019
|
+
function createToastManager(options = {}) {
|
|
3020
|
+
const maxVisible = Math.max(1, Math.floor(options.maxVisible ?? 3));
|
|
3021
|
+
const maxPending = Math.max(0, Math.floor(options.maxPending ?? 50));
|
|
3022
|
+
const duration = milliseconds(options.duration ?? 5e3, 5e3);
|
|
3023
|
+
const exitDuration = milliseconds(options.exitDuration ?? 200, 200);
|
|
3024
|
+
const records = /* @__PURE__ */ new Map();
|
|
3025
|
+
const visible = [];
|
|
3026
|
+
const pending = [];
|
|
3027
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
3028
|
+
const pauses = /* @__PURE__ */ new Map();
|
|
3029
|
+
let snapshot = EMPTY;
|
|
3030
|
+
let attached = false;
|
|
3031
|
+
let disposed = false;
|
|
3032
|
+
let sequence = 0;
|
|
3033
|
+
let generation = 0;
|
|
3034
|
+
const paused = () => !attached || pauses.size > 0;
|
|
3035
|
+
const freeze = (entry) => Object.freeze({
|
|
3036
|
+
...entry,
|
|
3037
|
+
action: entry.action ? Object.freeze({ ...entry.action }) : void 0,
|
|
3038
|
+
cancel: entry.cancel ? Object.freeze({ ...entry.cancel }) : void 0
|
|
3039
|
+
});
|
|
3040
|
+
const publish = () => {
|
|
3041
|
+
const next = visible.map((id) => records.get(id).entry);
|
|
3042
|
+
if (next.length === snapshot.length && next.every((entry, index) => entry === snapshot[index])) return;
|
|
3043
|
+
snapshot = Object.freeze(next);
|
|
3044
|
+
complete([...listeners]);
|
|
3045
|
+
};
|
|
3046
|
+
const stop = (record) => {
|
|
3047
|
+
if (record.timer !== void 0) clearTimeout(record.timer);
|
|
3048
|
+
record.timer = void 0;
|
|
3049
|
+
if (record.startedAt !== null) {
|
|
3050
|
+
const elapsed = Math.max(0, Date.now() - record.startedAt);
|
|
3051
|
+
if (record.entry.state === "closing") record.exitRemaining = Math.max(0, record.exitRemaining - elapsed);
|
|
3052
|
+
else record.entry = freeze({
|
|
3053
|
+
...record.entry,
|
|
3054
|
+
remaining: Math.max(0, record.entry.remaining - elapsed)
|
|
3055
|
+
});
|
|
3056
|
+
}
|
|
3057
|
+
record.startedAt = null;
|
|
3058
|
+
};
|
|
3059
|
+
const promote = () => {
|
|
3060
|
+
while (visible.length < maxVisible && pending.length) {
|
|
3061
|
+
const id = pending.shift();
|
|
3062
|
+
const record = records.get(id);
|
|
3063
|
+
visible.push(id);
|
|
3064
|
+
record.entry = freeze({
|
|
3065
|
+
...record.entry,
|
|
3066
|
+
visibleAt: Date.now(),
|
|
3067
|
+
paused: paused()
|
|
3068
|
+
});
|
|
3069
|
+
start(record);
|
|
3070
|
+
}
|
|
3071
|
+
};
|
|
3072
|
+
const remove = (id) => {
|
|
3073
|
+
const record = records.get(id);
|
|
3074
|
+
if (!record) return;
|
|
3075
|
+
stop(record);
|
|
3076
|
+
records.delete(id);
|
|
3077
|
+
const index = visible.indexOf(id);
|
|
3078
|
+
if (index >= 0) visible.splice(index, 1);
|
|
3079
|
+
const waiting = pending.indexOf(id);
|
|
3080
|
+
if (waiting >= 0) pending.splice(waiting, 1);
|
|
3081
|
+
promote();
|
|
3082
|
+
publish();
|
|
3083
|
+
};
|
|
3084
|
+
const start = (record) => {
|
|
3085
|
+
if (!attached || record.entry.visibleAt === null || record.timer !== void 0) return;
|
|
3086
|
+
const closing = record.entry.state === "closing";
|
|
3087
|
+
if (!closing && (paused() || record.entry.isLoading || record.entry.duration === 0)) return;
|
|
3088
|
+
record.startedAt = Date.now();
|
|
3089
|
+
record.timer = setTimeout(() => {
|
|
3090
|
+
record.timer = void 0;
|
|
3091
|
+
record.startedAt = null;
|
|
3092
|
+
if (closing) remove(record.entry.id);
|
|
3093
|
+
else manager.dismiss(record.entry.id, "timeout");
|
|
3094
|
+
}, closing ? record.exitRemaining : record.entry.remaining);
|
|
3095
|
+
};
|
|
3096
|
+
const refreshPause = () => {
|
|
3097
|
+
for (const id of visible) {
|
|
3098
|
+
const record = records.get(id);
|
|
3099
|
+
stop(record);
|
|
3100
|
+
record.entry = freeze({
|
|
3101
|
+
...record.entry,
|
|
3102
|
+
paused: paused() || record.entry.state === "closing"
|
|
3103
|
+
});
|
|
3104
|
+
start(record);
|
|
3105
|
+
}
|
|
3106
|
+
publish();
|
|
3107
|
+
};
|
|
3108
|
+
const update = (id, changes, invalidate, onGeneration) => {
|
|
3109
|
+
const record = records.get(id);
|
|
3110
|
+
if (!record || record.entry.state === "closing" || disposed) return false;
|
|
3111
|
+
stop(record);
|
|
3112
|
+
const before = record.entry;
|
|
3113
|
+
const settled = before.isLoading && changes.isLoading === false;
|
|
3114
|
+
const nextDuration = changes.duration !== void 0 ? milliseconds(changes.duration, duration) : settled ? duration : before.duration;
|
|
3115
|
+
record.entry = freeze({
|
|
3116
|
+
...before,
|
|
3117
|
+
...changes,
|
|
3118
|
+
id,
|
|
3119
|
+
tone: changes.tone ?? before.tone,
|
|
3120
|
+
duration: nextDuration,
|
|
3121
|
+
isLoading: changes.isLoading ?? before.isLoading,
|
|
3122
|
+
remaining: changes.duration !== void 0 || settled ? nextDuration : before.remaining,
|
|
3123
|
+
generation: invalidate ? ++generation : before.generation
|
|
3124
|
+
});
|
|
3125
|
+
onGeneration?.(record.entry.generation);
|
|
3126
|
+
start(record);
|
|
3127
|
+
publish();
|
|
3128
|
+
return true;
|
|
3129
|
+
};
|
|
3130
|
+
const add = (value, onGeneration) => {
|
|
3131
|
+
if (disposed) return null;
|
|
3132
|
+
if (value.id !== void 0 && records.has(value.id)) return update(value.id, value, true, onGeneration) ? value.id : null;
|
|
3133
|
+
if (visible.length >= maxVisible && pending.length >= maxPending) return null;
|
|
3134
|
+
let id = value.id;
|
|
3135
|
+
if (id === void 0) do
|
|
3136
|
+
id = `toast-${++sequence}`;
|
|
3137
|
+
while (records.has(id));
|
|
3138
|
+
const entry = freeze({
|
|
3139
|
+
...value,
|
|
3140
|
+
id,
|
|
3141
|
+
tone: value.tone ?? "neutral",
|
|
3142
|
+
duration: milliseconds(value.duration ?? duration, duration),
|
|
3143
|
+
isLoading: value.isLoading ?? false,
|
|
3144
|
+
generation: ++generation,
|
|
3145
|
+
state: "open",
|
|
3146
|
+
createdAt: Date.now(),
|
|
3147
|
+
visibleAt: visible.length < maxVisible ? Date.now() : null,
|
|
3148
|
+
remaining: milliseconds(value.duration ?? duration, duration),
|
|
3149
|
+
paused: paused()
|
|
3150
|
+
});
|
|
3151
|
+
const record = {
|
|
3152
|
+
entry,
|
|
3153
|
+
startedAt: null,
|
|
3154
|
+
exitRemaining: exitDuration
|
|
3155
|
+
};
|
|
3156
|
+
records.set(id, record);
|
|
3157
|
+
if (visible.length < maxVisible) {
|
|
3158
|
+
visible.push(id);
|
|
3159
|
+
start(record);
|
|
3160
|
+
} else pending.push(id);
|
|
3161
|
+
onGeneration?.(entry.generation);
|
|
3162
|
+
publish();
|
|
3163
|
+
return id;
|
|
3164
|
+
};
|
|
3165
|
+
const manager = {
|
|
3166
|
+
add,
|
|
3167
|
+
update: (id, changes) => update(id, changes, true),
|
|
3168
|
+
dismiss(id, reason = "dismiss") {
|
|
3169
|
+
const record = records.get(id);
|
|
3170
|
+
if (!record || record.entry.state === "closing") return;
|
|
3171
|
+
stop(record);
|
|
3172
|
+
record.entry = freeze({
|
|
3173
|
+
...record.entry,
|
|
3174
|
+
state: "closing",
|
|
3175
|
+
paused: true,
|
|
3176
|
+
remaining: reason === "timeout" ? 0 : record.entry.remaining
|
|
3177
|
+
});
|
|
3178
|
+
complete([() => {
|
|
3179
|
+
if (record.entry.visibleAt === null) remove(id);
|
|
3180
|
+
else {
|
|
3181
|
+
start(record);
|
|
3182
|
+
publish();
|
|
3183
|
+
}
|
|
3184
|
+
}, () => record.entry.onClose?.(reason)]);
|
|
3185
|
+
},
|
|
3186
|
+
clear(reason = "clear") {
|
|
3187
|
+
complete([...pending, ...visible].map((id) => () => manager.dismiss(id, reason)));
|
|
3188
|
+
},
|
|
3189
|
+
pause(reason) {
|
|
3190
|
+
if (disposed) return;
|
|
3191
|
+
pauses.set(reason, (pauses.get(reason) ?? 0) + 1);
|
|
3192
|
+
if (pauses.size === 1 && pauses.get(reason) === 1) refreshPause();
|
|
3193
|
+
},
|
|
3194
|
+
resume(reason) {
|
|
3195
|
+
const count = pauses.get(reason);
|
|
3196
|
+
if (!count || disposed) return;
|
|
3197
|
+
if (count === 1) pauses.delete(reason);
|
|
3198
|
+
else pauses.set(reason, count - 1);
|
|
3199
|
+
if (!pauses.size) refreshPause();
|
|
3200
|
+
},
|
|
3201
|
+
attach() {
|
|
3202
|
+
if (disposed) throw new Error("Cannot attach a disposed ToastManager.");
|
|
3203
|
+
if (attached) throw new Error("A ToastManager may attach to only one provider.");
|
|
3204
|
+
attached = true;
|
|
3205
|
+
try {
|
|
3206
|
+
refreshPause();
|
|
3207
|
+
} catch (error) {
|
|
3208
|
+
attached = false;
|
|
3209
|
+
complete([() => {
|
|
3210
|
+
throw error;
|
|
3211
|
+
}, refreshPause]);
|
|
3212
|
+
}
|
|
3213
|
+
let detached = false;
|
|
3214
|
+
return () => {
|
|
3215
|
+
if (detached || disposed) return;
|
|
3216
|
+
detached = true;
|
|
3217
|
+
attached = false;
|
|
3218
|
+
refreshPause();
|
|
3219
|
+
};
|
|
3220
|
+
},
|
|
3221
|
+
dispose() {
|
|
3222
|
+
if (disposed) return;
|
|
3223
|
+
disposed = true;
|
|
3224
|
+
attached = false;
|
|
3225
|
+
const closing = [...records.values()].filter((record) => record.entry.state === "open");
|
|
3226
|
+
for (const record of records.values()) stop(record);
|
|
3227
|
+
records.clear();
|
|
3228
|
+
visible.length = 0;
|
|
3229
|
+
pending.length = 0;
|
|
3230
|
+
pauses.clear();
|
|
3231
|
+
complete([
|
|
3232
|
+
publish,
|
|
3233
|
+
() => listeners.clear(),
|
|
3234
|
+
...closing.map((record) => () => record.entry.onClose?.("unmount"))
|
|
3235
|
+
]);
|
|
3236
|
+
},
|
|
3237
|
+
subscribe(listener) {
|
|
3238
|
+
if (!disposed) listeners.add(listener);
|
|
3239
|
+
return () => {
|
|
3240
|
+
listeners.delete(listener);
|
|
3241
|
+
};
|
|
3242
|
+
},
|
|
3243
|
+
getSnapshot: () => snapshot,
|
|
3244
|
+
getServerSnapshot: () => EMPTY,
|
|
3245
|
+
promise(task, messages, promiseOptions = {}) {
|
|
3246
|
+
let expected;
|
|
3247
|
+
const id = add({
|
|
3248
|
+
...promiseOptions,
|
|
3249
|
+
...messageOptions(messages.loading),
|
|
3250
|
+
isLoading: true
|
|
3251
|
+
}, (value) => {
|
|
3252
|
+
expected = value;
|
|
3253
|
+
});
|
|
3254
|
+
const settle = (message, tone) => {
|
|
3255
|
+
if (id === null || records.get(id)?.entry.generation !== expected || records.get(id)?.entry.state !== "open") return;
|
|
3256
|
+
const content = typeof message === "function" ? message() : message;
|
|
3257
|
+
if (records.get(id)?.entry.generation !== expected || records.get(id)?.entry.state !== "open") return;
|
|
3258
|
+
update(id, {
|
|
3259
|
+
tone,
|
|
3260
|
+
duration: promiseOptions.duration ?? duration,
|
|
3261
|
+
...messageOptions(content),
|
|
3262
|
+
isLoading: false
|
|
3263
|
+
}, false);
|
|
3264
|
+
};
|
|
3265
|
+
return {
|
|
3266
|
+
id,
|
|
3267
|
+
promise: task.then((value) => {
|
|
3268
|
+
const message = messages.success;
|
|
3269
|
+
settle(typeof message === "function" ? () => message(value) : message, "success");
|
|
3270
|
+
return value;
|
|
3271
|
+
}, (error) => {
|
|
3272
|
+
const message = messages.error;
|
|
3273
|
+
settle(typeof message === "function" ? () => message(error) : message, "danger");
|
|
3274
|
+
throw error;
|
|
3275
|
+
})
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
};
|
|
3279
|
+
return manager;
|
|
3280
|
+
}
|
|
3281
|
+
//#endregion
|
|
3282
|
+
//#region src/ToastProvider.vue?vue&type=script&setup=true&lang.ts
|
|
3283
|
+
var _hoisted_1$12 = ["data-placement", "dir"];
|
|
3284
|
+
//#endregion
|
|
3285
|
+
//#region src/ToastProvider.vue
|
|
3286
|
+
var ToastProvider_default = /* @__PURE__ */ defineComponent({
|
|
3287
|
+
inheritAttrs: false,
|
|
3288
|
+
__name: "ToastProvider",
|
|
3289
|
+
props: {
|
|
3290
|
+
manager: { default: void 0 },
|
|
3291
|
+
placement: { default: "bottom-end" },
|
|
3292
|
+
label: { default: "Notifikasi" },
|
|
3293
|
+
closeLabel: { default: "Tutup" },
|
|
3294
|
+
hotkey: { default: () => ["altKey", "KeyT"] },
|
|
3295
|
+
dir: { default: void 0 },
|
|
3296
|
+
showProgress: {
|
|
3297
|
+
type: Boolean,
|
|
3298
|
+
default: false
|
|
3299
|
+
},
|
|
3300
|
+
swipeThreshold: { default: 50 }
|
|
3301
|
+
},
|
|
3302
|
+
setup(__props) {
|
|
3303
|
+
const props = __props;
|
|
3304
|
+
const manager = props.manager ?? createToastManager();
|
|
3305
|
+
const owned = !props.manager;
|
|
3306
|
+
provide(toastManagerKey, manager);
|
|
3307
|
+
const entries = shallowRef(manager.getServerSnapshot());
|
|
3308
|
+
const region = ref();
|
|
3309
|
+
const active = ref(false);
|
|
3310
|
+
const causes = /* @__PURE__ */ new Set();
|
|
3311
|
+
let unsubscribe;
|
|
3312
|
+
let detach;
|
|
3313
|
+
let previousFocus;
|
|
3314
|
+
const positions = /* @__PURE__ */ new Map();
|
|
3315
|
+
const movements = /* @__PURE__ */ new Map();
|
|
3316
|
+
let reflowQueued = false;
|
|
3317
|
+
const hotkeyText = computed(() => props.hotkey.map((key) => ({
|
|
3318
|
+
altKey: "Alt",
|
|
3319
|
+
ctrlKey: "Ctrl",
|
|
3320
|
+
metaKey: "Meta",
|
|
3321
|
+
shiftKey: "Shift"
|
|
3322
|
+
})[key] ?? key.replace(/^Key|^Digit/, "")).join("+"));
|
|
3323
|
+
const viewportLabel = computed(() => hotkeyText.value ? `${props.label} (${hotkeyText.value})` : props.label);
|
|
3324
|
+
function pause(cause) {
|
|
3325
|
+
if (!causes.has(cause)) {
|
|
3326
|
+
causes.add(cause);
|
|
3327
|
+
manager.pause(`vue:${cause}`);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
function resume(cause) {
|
|
3331
|
+
if (causes.delete(cause)) manager.resume(`vue:${cause}`);
|
|
3332
|
+
}
|
|
3333
|
+
function focusOut(event) {
|
|
3334
|
+
if (!region.value?.contains(event.relatedTarget)) resume("focus");
|
|
3335
|
+
}
|
|
3336
|
+
function focusIn(event) {
|
|
3337
|
+
if (event.relatedTarget instanceof HTMLElement && !region.value?.contains(event.relatedTarget)) previousFocus = event.relatedTarget;
|
|
3338
|
+
pause("focus");
|
|
3339
|
+
}
|
|
3340
|
+
function windowBlur() {
|
|
3341
|
+
pause("window");
|
|
3342
|
+
}
|
|
3343
|
+
function windowFocus() {
|
|
3344
|
+
resume("window");
|
|
3345
|
+
}
|
|
3346
|
+
function visibility() {
|
|
3347
|
+
if (document.hidden) pause("document");
|
|
3348
|
+
else resume("document");
|
|
3349
|
+
}
|
|
3350
|
+
function list() {
|
|
3351
|
+
return region.value?.querySelector(".toast-list");
|
|
3352
|
+
}
|
|
3353
|
+
function restoreIfEmpty() {
|
|
3354
|
+
const focused = document.activeElement;
|
|
3355
|
+
if (!region.value?.contains(focused)) return;
|
|
3356
|
+
if (!entries.value.some((entry) => entry.state === "open")) {
|
|
3357
|
+
if (previousFocus?.isConnected) previousFocus.focus({ preventScroll: true });
|
|
3358
|
+
else if (focused instanceof HTMLElement) focused.blur();
|
|
3359
|
+
return;
|
|
3360
|
+
}
|
|
3361
|
+
const id = focused instanceof Element ? focused.closest("[data-toast-id]")?.dataset.toastId : void 0;
|
|
3362
|
+
if (id && !entries.value.some((entry) => entry.id === id && entry.state === "open")) list()?.focus({ preventScroll: true });
|
|
3363
|
+
}
|
|
3364
|
+
function keyboard(event) {
|
|
3365
|
+
if (!props.hotkey.length || event.defaultPrevented || !entries.value.some((entry) => entry.state === "open")) return;
|
|
3366
|
+
const modifiers = [
|
|
3367
|
+
"altKey",
|
|
3368
|
+
"ctrlKey",
|
|
3369
|
+
"metaKey",
|
|
3370
|
+
"shiftKey"
|
|
3371
|
+
];
|
|
3372
|
+
if (!props.hotkey.every((key) => modifiers.includes(key) ? event[key] : event.code === key || event.key.toLowerCase() === key.toLowerCase()) || modifiers.some((key) => event[key] !== props.hotkey.includes(key))) return;
|
|
3373
|
+
previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : void 0;
|
|
3374
|
+
list()?.focus({ preventScroll: true });
|
|
3375
|
+
event.preventDefault();
|
|
3376
|
+
}
|
|
3377
|
+
function escape(event) {
|
|
3378
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
3379
|
+
const target = event.target instanceof Element ? event.target.closest("[data-toast-id]") : null;
|
|
3380
|
+
const entry = target ? entries.value.find((item) => item.id === target.dataset.toastId && item.state === "open") : [...entries.value].reverse().find((item) => item.state === "open");
|
|
3381
|
+
if (!entry) return;
|
|
3382
|
+
event.preventDefault();
|
|
3383
|
+
event.stopPropagation();
|
|
3384
|
+
list()?.focus({ preventScroll: true });
|
|
3385
|
+
manager.dismiss(entry.id);
|
|
3386
|
+
restoreIfEmpty();
|
|
3387
|
+
}
|
|
3388
|
+
function capturePositions() {
|
|
3389
|
+
positions.clear();
|
|
3390
|
+
if (!active.value || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
3391
|
+
const origin = region.value?.getBoundingClientRect();
|
|
3392
|
+
region.value?.querySelectorAll(".toast").forEach((element) => {
|
|
3393
|
+
if (element.dataset.toastId) positions.set(element.dataset.toastId, {
|
|
3394
|
+
x: element.offsetLeft + (origin?.left ?? 0),
|
|
3395
|
+
y: element.offsetTop + (origin?.top ?? 0)
|
|
3396
|
+
});
|
|
3397
|
+
});
|
|
3398
|
+
}
|
|
3399
|
+
function animateMovement(previous) {
|
|
3400
|
+
if (!active.value) return;
|
|
3401
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3402
|
+
for (const animation of movements.values()) animation.cancel();
|
|
3403
|
+
movements.clear();
|
|
3404
|
+
return;
|
|
3405
|
+
}
|
|
3406
|
+
const origin = region.value?.getBoundingClientRect();
|
|
3407
|
+
region.value?.querySelectorAll(".toast").forEach((element) => {
|
|
3408
|
+
const before = previous.get(element.dataset.toastId ?? "");
|
|
3409
|
+
if (!before || element.dataset.state !== "open" || !element.animate) return;
|
|
3410
|
+
const x = before.x - element.offsetLeft - (origin?.left ?? 0);
|
|
3411
|
+
const y = before.y - element.offsetTop - (origin?.top ?? 0);
|
|
3412
|
+
if (!x && !y) return;
|
|
3413
|
+
movements.get(element)?.cancel();
|
|
3414
|
+
const css = getComputedStyle(element);
|
|
3415
|
+
const token = css.getPropertyValue("--ds-motion-duration-normal").trim();
|
|
3416
|
+
const parsed = Number.parseFloat(token);
|
|
3417
|
+
const duration = Number.isFinite(parsed) ? parsed * (token.endsWith("ms") ? 1 : 1e3) : 200;
|
|
3418
|
+
const animation = element.animate([{ translate: `${x}px ${y}px` }, { translate: "0px 0px" }], {
|
|
3419
|
+
duration,
|
|
3420
|
+
easing: css.getPropertyValue("--ds-motion-ease-standard").trim() || "ease"
|
|
3421
|
+
});
|
|
3422
|
+
movements.set(element, animation);
|
|
3423
|
+
const remove = () => {
|
|
3424
|
+
if (movements.get(element) === animation) movements.delete(element);
|
|
3425
|
+
};
|
|
3426
|
+
animation.finished.then(remove, remove);
|
|
3427
|
+
});
|
|
3428
|
+
for (const [element, animation] of movements) if (!element.isConnected) {
|
|
3429
|
+
animation.cancel();
|
|
3430
|
+
movements.delete(element);
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
onMounted(() => {
|
|
3434
|
+
detach = manager.attach();
|
|
3435
|
+
active.value = true;
|
|
3436
|
+
entries.value = manager.getSnapshot();
|
|
3437
|
+
unsubscribe = manager.subscribe(() => {
|
|
3438
|
+
if (!reflowQueued) {
|
|
3439
|
+
capturePositions();
|
|
3440
|
+
const previous = new Map(positions);
|
|
3441
|
+
reflowQueued = true;
|
|
3442
|
+
entries.value = manager.getSnapshot();
|
|
3443
|
+
nextTick(() => {
|
|
3444
|
+
reflowQueued = false;
|
|
3445
|
+
animateMovement(previous);
|
|
3446
|
+
});
|
|
3447
|
+
}
|
|
3448
|
+
entries.value = manager.getSnapshot();
|
|
3449
|
+
restoreIfEmpty();
|
|
3450
|
+
});
|
|
3451
|
+
window.addEventListener("blur", windowBlur);
|
|
3452
|
+
window.addEventListener("focus", windowFocus);
|
|
3453
|
+
document.addEventListener("visibilitychange", visibility);
|
|
3454
|
+
document.addEventListener("keydown", keyboard);
|
|
3455
|
+
visibility();
|
|
3456
|
+
if (!document.hasFocus()) pause("window");
|
|
3457
|
+
});
|
|
3458
|
+
onBeforeUnmount(() => {
|
|
3459
|
+
for (const animation of movements.values()) animation.cancel();
|
|
3460
|
+
movements.clear();
|
|
3461
|
+
if (!active.value) return;
|
|
3462
|
+
active.value = false;
|
|
3463
|
+
const errors = [];
|
|
3464
|
+
const cleanup = (operation) => {
|
|
3465
|
+
try {
|
|
3466
|
+
operation?.();
|
|
3467
|
+
} catch (error) {
|
|
3468
|
+
errors.push(error);
|
|
3469
|
+
}
|
|
3470
|
+
};
|
|
3471
|
+
cleanup(unsubscribe);
|
|
3472
|
+
cleanup(detach);
|
|
3473
|
+
[...causes].forEach((cause) => cleanup(() => resume(cause)));
|
|
3474
|
+
if (owned) cleanup(() => manager.dispose());
|
|
3475
|
+
window.removeEventListener("blur", windowBlur);
|
|
3476
|
+
window.removeEventListener("focus", windowFocus);
|
|
3477
|
+
document.removeEventListener("visibilitychange", visibility);
|
|
3478
|
+
document.removeEventListener("keydown", keyboard);
|
|
3479
|
+
if (errors.length === 1) throw errors[0];
|
|
3480
|
+
if (errors.length > 1) throw new AggregateError(errors, "Toast provider cleanup failed.");
|
|
3481
|
+
});
|
|
3482
|
+
return (_ctx, _cache) => {
|
|
3483
|
+
return openBlock(), createBlock(unref(ToastProvider), {
|
|
3484
|
+
duration: Infinity,
|
|
3485
|
+
"disable-swipe": true,
|
|
3486
|
+
label: __props.label
|
|
3487
|
+
}, {
|
|
3488
|
+
default: withCtx(() => [
|
|
3489
|
+
renderSlot(_ctx.$slots, "default", { toast: unref(manager) }),
|
|
3490
|
+
createElementVNode("div", {
|
|
3491
|
+
ref_key: "region",
|
|
3492
|
+
ref: region,
|
|
3493
|
+
class: "toast-region",
|
|
3494
|
+
"data-placement": __props.placement,
|
|
3495
|
+
dir: __props.dir,
|
|
3496
|
+
onPointerenter: _cache[0] || (_cache[0] = ($event) => pause("hover")),
|
|
3497
|
+
onPointerleave: _cache[1] || (_cache[1] = ($event) => resume("hover")),
|
|
3498
|
+
onFocusin: focusIn,
|
|
3499
|
+
onFocusout: focusOut,
|
|
3500
|
+
onKeydownCapture: escape
|
|
3501
|
+
}, [createVNode(unref(ToastViewport), {
|
|
3502
|
+
class: "toast-list",
|
|
3503
|
+
hotkey: [],
|
|
3504
|
+
label: viewportLabel.value,
|
|
3505
|
+
"data-placement": __props.placement,
|
|
3506
|
+
dir: __props.dir
|
|
3507
|
+
}, null, 8, [
|
|
3508
|
+
"label",
|
|
3509
|
+
"data-placement",
|
|
3510
|
+
"dir"
|
|
3511
|
+
])], 40, _hoisted_1$12),
|
|
3512
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(entries.value, (entry) => {
|
|
3513
|
+
return openBlock(), createBlock(Toast_default, {
|
|
3514
|
+
key: entry.generation,
|
|
3515
|
+
entry,
|
|
3516
|
+
manager: unref(manager),
|
|
3517
|
+
placement: __props.placement,
|
|
3518
|
+
dir: __props.dir,
|
|
3519
|
+
"close-label": __props.closeLabel,
|
|
3520
|
+
"show-progress": __props.showProgress,
|
|
3521
|
+
"swipe-threshold": __props.swipeThreshold
|
|
3522
|
+
}, createSlots({ _: 2 }, [_ctx.$slots.toast ? {
|
|
3523
|
+
name: "default",
|
|
3524
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "toast", mergeProps({ ref_for: true }, slotProps))]),
|
|
3525
|
+
key: "0"
|
|
3526
|
+
} : void 0, _ctx.$slots.indicator ? {
|
|
3527
|
+
name: "indicator",
|
|
3528
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "indicator", mergeProps({ ref_for: true }, slotProps))]),
|
|
3529
|
+
key: "1"
|
|
3530
|
+
} : void 0]), 1032, [
|
|
3531
|
+
"entry",
|
|
3532
|
+
"manager",
|
|
3533
|
+
"placement",
|
|
3534
|
+
"dir",
|
|
3535
|
+
"close-label",
|
|
3536
|
+
"show-progress",
|
|
3537
|
+
"swipe-threshold"
|
|
3538
|
+
]);
|
|
3539
|
+
}), 128))
|
|
3540
|
+
]),
|
|
3541
|
+
_: 3
|
|
3542
|
+
}, 8, ["label"]);
|
|
2722
3543
|
};
|
|
2723
3544
|
}
|
|
2724
3545
|
});
|
|
@@ -4877,6 +5698,6 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
|
|
|
4877
5698
|
}
|
|
4878
5699
|
});
|
|
4879
5700
|
//#endregion
|
|
4880
|
-
export { Alert_default as Alert, Badge_default as Badge, Breadcrumb_default as Breadcrumb, Button_default as Button, ButtonGroup_default as ButtonGroup, ButtonGroupSeparator_default as ButtonGroupSeparator, ButtonGroupSeparator_default as ToggleButtonGroupSeparator, Card_default as Card, Chart_default as Chart, Checkbox_default as Checkbox, Combobox_default as Combobox, DataTable_default as DataTable, DateRangePicker_default as DateRangePicker, Dialog_default as Dialog, DropdownMenu_default as DropdownMenu, Empty_default as Empty, Field_default as Field, Form_default as Form, Input_default as Input, Label_default as Label, Listbox_default as Listbox, NumberField_default as NumberField, Pagination_default as Pagination, Popover_default as Popover, RadioGroup_default as RadioGroup, Select_default as Select, SelectGroup_default as SelectGroup, Separator_default as Separator, Sidebar_default as Sidebar, Skeleton_default as Skeleton, Spinner_default as Spinner, Switch_default as Switch, Table_default as Table, Tabs_default as Tabs, Textarea_default as Textarea, ToggleButton_default as ToggleButton, ToggleButtonGroup_default as ToggleButtonGroup, ToggleGroup_default as ToggleGroup, Tooltip_default as Tooltip, createDateRangePresets, rangeText as formatDateRange };
|
|
5701
|
+
export { Alert_default as Alert, Badge_default as Badge, Breadcrumb_default as Breadcrumb, Button_default as Button, ButtonGroup_default as ButtonGroup, ButtonGroupSeparator_default as ButtonGroupSeparator, ButtonGroupSeparator_default as ToggleButtonGroupSeparator, Card_default as Card, Chart_default as Chart, Checkbox_default as Checkbox, Combobox_default as Combobox, DataTable_default as DataTable, DateRangePicker_default as DateRangePicker, Dialog_default as Dialog, DropdownMenu_default as DropdownMenu, Empty_default as Empty, Field_default as Field, Form_default as Form, Input_default as Input, Label_default as Label, Listbox_default as Listbox, NumberField_default as NumberField, Pagination_default as Pagination, Popover_default as Popover, RadioGroup_default as RadioGroup, Select_default as Select, SelectGroup_default as SelectGroup, Separator_default as Separator, Sidebar_default as Sidebar, Skeleton_default as Skeleton, Spinner_default as Spinner, Switch_default as Switch, Table_default as Table, Tabs_default as Tabs, Textarea_default as Textarea, Toast_default as Toast, ToastProvider_default as ToastProvider, ToggleButton_default as ToggleButton, ToggleButtonGroup_default as ToggleButtonGroup, ToggleGroup_default as ToggleGroup, Tooltip_default as Tooltip, createDateRangePresets, createToastManager, rangeText as formatDateRange, useToast };
|
|
4881
5702
|
|
|
4882
5703
|
//# sourceMappingURL=index.js.map
|