@enos5/enos-vue-default 1.4.3 → 1.4.4
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface ToastMessage {
|
|
2
2
|
id: string;
|
|
3
|
-
title
|
|
3
|
+
title?: string;
|
|
4
4
|
message: string;
|
|
5
5
|
variant: "success" | "error";
|
|
6
6
|
duration?: number;
|
|
@@ -9,6 +9,7 @@ type __VLS_Props = {
|
|
|
9
9
|
maxToasts?: number;
|
|
10
10
|
position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
11
11
|
variant?: "success" | "error";
|
|
12
|
+
defaultTitle?: string;
|
|
12
13
|
};
|
|
13
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
14
15
|
addToast: (message: string, options?: {
|
package/dist/index.js
CHANGED
|
@@ -659,7 +659,7 @@ const _sfc_main$J = /* @__PURE__ */ Object.assign({
|
|
|
659
659
|
return sizeClasses[props.size] ? props.size : "default";
|
|
660
660
|
});
|
|
661
661
|
const buttonClasses = computed(() => [
|
|
662
|
-
"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
662
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
663
663
|
variantClasses[resolvedVariant.value],
|
|
664
664
|
sizeClasses[resolvedSize.value],
|
|
665
665
|
attrs.class
|
|
@@ -2967,7 +2967,7 @@ const _sfc_main$l = /* @__PURE__ */ Object.assign({
|
|
|
2967
2967
|
return variantClasses[props.variant] ? props.variant : "primary";
|
|
2968
2968
|
});
|
|
2969
2969
|
const linkClasses = computed(() => [
|
|
2970
|
-
"inline-flex h-9 min-w-[40px] shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium shadow-xs outline-none transition-all aria-invalid:border-red-500 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
2970
|
+
"inline-flex h-9 min-w-[40px] shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium shadow-xs outline-none transition-all aria-invalid:border-red-500 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
2971
2971
|
variantClasses[resolvedVariant.value],
|
|
2972
2972
|
attrs.class
|
|
2973
2973
|
]);
|
|
@@ -4721,14 +4721,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4721
4721
|
}
|
|
4722
4722
|
});
|
|
4723
4723
|
const _hoisted_1 = { class: "fixed top-4 right-4 z-50 space-y-2" };
|
|
4724
|
-
const _hoisted_2 = {
|
|
4724
|
+
const _hoisted_2 = {
|
|
4725
|
+
key: 0,
|
|
4726
|
+
class: "font-semibold"
|
|
4727
|
+
};
|
|
4725
4728
|
const _hoisted_3 = { class: "text-sm opacity-90" };
|
|
4726
4729
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4727
4730
|
__name: "ToastContainer",
|
|
4728
4731
|
props: {
|
|
4729
4732
|
maxToasts: {},
|
|
4730
4733
|
position: {},
|
|
4731
|
-
variant: {}
|
|
4734
|
+
variant: {},
|
|
4735
|
+
defaultTitle: {}
|
|
4732
4736
|
},
|
|
4733
4737
|
setup(__props, { expose: __expose }) {
|
|
4734
4738
|
const props = __props;
|
|
@@ -4742,7 +4746,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4742
4746
|
const id = Date.now().toString();
|
|
4743
4747
|
const toast = {
|
|
4744
4748
|
id,
|
|
4745
|
-
title: title
|
|
4749
|
+
title: title ?? (props.defaultTitle || void 0),
|
|
4746
4750
|
message,
|
|
4747
4751
|
variant,
|
|
4748
4752
|
duration
|
|
@@ -4760,9 +4764,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4760
4764
|
toasts.value.splice(index, 1);
|
|
4761
4765
|
}
|
|
4762
4766
|
};
|
|
4763
|
-
onMounted(() => {
|
|
4764
|
-
console.log("ToastContainer mounted");
|
|
4765
|
-
});
|
|
4766
4767
|
__expose({
|
|
4767
4768
|
addToast
|
|
4768
4769
|
});
|
|
@@ -4775,7 +4776,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4775
4776
|
onClose: ($event) => removeToast(toast.id)
|
|
4776
4777
|
}, {
|
|
4777
4778
|
default: withCtx(() => [
|
|
4778
|
-
|
|
4779
|
+
toast.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(toast.title), 1)) : createCommentVNode("", true),
|
|
4779
4780
|
createElementVNode("div", _hoisted_3, toDisplayString(toast.message), 1)
|
|
4780
4781
|
]),
|
|
4781
4782
|
_: 2
|