@pantograph/vue 0.30.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Toast/Toast.d.ts +1 -1
- package/dist/Toast/index.js +12 -12
- package/dist/Toast/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/dist/use/index.js +1 -1
- package/dist/use/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/Toast/Toast.d.ts
CHANGED
package/dist/Toast/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, useSlots as N, computed as f, createElementBlock as i, openBlock as a, normalizeClass as t, unref as e, renderSlot as u, createCommentVNode as c, createElementVNode as y, createBlock as w, createVNode as g, normalizeStyle as V, createSlots as S, withCtx as z, createTextVNode as B, toDisplayString as v } from "vue";
|
|
2
2
|
import { cva as E } from "class-variance-authority";
|
|
3
3
|
import { getComponentOptions as I, getBemBlock as D, generateVariantClassList as k, normCls as r, getBemElement as n, getComponentName as L } from "@pantograph/utils";
|
|
4
4
|
import { _ as O } from "../IconButton.vue_vue_type_script_setup_true_lang-DsSD_y63.js";
|
|
@@ -8,7 +8,7 @@ import { getCssCoreVar as R } from "@pantograph/tokens";
|
|
|
8
8
|
import { i as j } from "../isNumber-BduWbB-B.js";
|
|
9
9
|
import { _ as q } from "../Progress.vue_vue_type_style_index_0_lang-Ba_Fby6M.js";
|
|
10
10
|
import { installComponent as A } from "@pantograph/utils-vue";
|
|
11
|
-
const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */
|
|
11
|
+
const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ T({
|
|
12
12
|
...I("Toast"),
|
|
13
13
|
__name: "Toast",
|
|
14
14
|
props: {
|
|
@@ -29,15 +29,15 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
29
29
|
actionsCls: {},
|
|
30
30
|
headerCls: {},
|
|
31
31
|
closeCls: {},
|
|
32
|
-
|
|
32
|
+
onCloseNotification: {}
|
|
33
33
|
},
|
|
34
34
|
setup(b) {
|
|
35
|
-
const p = b, l =
|
|
35
|
+
const p = b, l = N(), s = D("toast"), $ = E(s, {
|
|
36
36
|
variants: {
|
|
37
37
|
type: k(F, s),
|
|
38
38
|
paused: k("paused", s)
|
|
39
39
|
}
|
|
40
|
-
}),
|
|
40
|
+
}), h = f(() => {
|
|
41
41
|
switch (p.type) {
|
|
42
42
|
case "info":
|
|
43
43
|
return "sky";
|
|
@@ -49,7 +49,7 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
49
49
|
return "red";
|
|
50
50
|
}
|
|
51
51
|
return "primary";
|
|
52
|
-
}), d =
|
|
52
|
+
}), d = f(() => {
|
|
53
53
|
if (p.icon) return p.icon;
|
|
54
54
|
switch (p.type) {
|
|
55
55
|
case "info":
|
|
@@ -63,7 +63,7 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
return (o, m) => (a(), i("div", {
|
|
66
|
-
class: t(e(r)(e(
|
|
66
|
+
class: t(e(r)(e($)({ type: o.type, paused: o.paused }), p.class))
|
|
67
67
|
}, [
|
|
68
68
|
u(o.$slots, "render", {}, () => [
|
|
69
69
|
l.icon || d.value ? (a(), i("div", {
|
|
@@ -84,10 +84,10 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
84
84
|
} : void 0
|
|
85
85
|
]), 1032, ["icon", "style"])
|
|
86
86
|
], 2)) : c("", !0),
|
|
87
|
-
|
|
87
|
+
y("div", {
|
|
88
88
|
class: t(e(r)(e(n)(e(s), "body"), o.bodyCls))
|
|
89
89
|
}, [
|
|
90
|
-
|
|
90
|
+
y("div", {
|
|
91
91
|
class: t(e(r)(e(n)(e(s), "content"), o.contentCls))
|
|
92
92
|
}, [
|
|
93
93
|
o.title || l.title ? (a(), i("div", {
|
|
@@ -113,7 +113,7 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
113
113
|
type: "ghost",
|
|
114
114
|
onClick: m[0] || (m[0] = (H) => {
|
|
115
115
|
var C;
|
|
116
|
-
return (C = o.
|
|
116
|
+
return (C = o.onCloseNotification) == null ? void 0 : C.call(o);
|
|
117
117
|
})
|
|
118
118
|
})
|
|
119
119
|
])
|
|
@@ -135,13 +135,13 @@ const F = ["info", "success", "warning", "error"], G = /* @__PURE__ */ h({
|
|
|
135
135
|
u(o.$slots, "actions")
|
|
136
136
|
], 2)) : c("", !0)
|
|
137
137
|
], 2),
|
|
138
|
-
o.progress && e(j)(o.duration) && ![0, 1 / 0].includes(o.duration) ? (a(),
|
|
138
|
+
o.progress && e(j)(o.duration) && ![0, 1 / 0].includes(o.duration) ? (a(), w(e(q), {
|
|
139
139
|
key: 1,
|
|
140
140
|
class: t(e(r)(e(n)(e(s), "progress"), o.progressCls)),
|
|
141
141
|
noTransition: "",
|
|
142
142
|
notRounded: "",
|
|
143
143
|
duration: o.duration,
|
|
144
|
-
color:
|
|
144
|
+
color: h.value
|
|
145
145
|
}, null, 8, ["class", "duration", "color"])) : c("", !0)
|
|
146
146
|
])
|
|
147
147
|
], 2));
|
package/dist/Toast/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("class-variance-authority"),n=require("@pantograph/utils"),f=require("../IconButton.vue_vue_type_script_setup_true_lang-CY2MXWF8.js"),B=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js");require("../Progress/index.umd.cjs");const g=require("@pantograph/tokens"),y=require("../isNumber-DMOjxgl8.js"),k=require("../Progress.vue_vue_type_style_index_0_lang-D_g_XsJ4.js"),v=require("@pantograph/utils-vue"),u=["info","success","warning","error"],l=e.defineComponent({...n.getComponentOptions("Toast"),__name:"Toast",props:{type:{},duration:{default:3e3},progress:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},paused:{type:Boolean},title:{},description:{},icon:{},class:{},bodyCls:{},progressCls:{},contentCls:{},titleCls:{},descriptionCls:{},actionsCls:{},headerCls:{},closeCls:{},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("class-variance-authority"),n=require("@pantograph/utils"),f=require("../IconButton.vue_vue_type_script_setup_true_lang-CY2MXWF8.js"),B=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js");require("../Progress/index.umd.cjs");const g=require("@pantograph/tokens"),y=require("../isNumber-DMOjxgl8.js"),k=require("../Progress.vue_vue_type_style_index_0_lang-D_g_XsJ4.js"),v=require("@pantograph/utils-vue"),u=["info","success","warning","error"],l=e.defineComponent({...n.getComponentOptions("Toast"),__name:"Toast",props:{type:{},duration:{default:3e3},progress:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},paused:{type:Boolean},title:{},description:{},icon:{},class:{},bodyCls:{},progressCls:{},contentCls:{},titleCls:{},descriptionCls:{},actionsCls:{},headerCls:{},closeCls:{},onCloseNotification:{}},setup(m){const s=m,t=e.useSlots(),r=n.getBemBlock("toast"),d=C.cva(r,{variants:{type:n.generateVariantClassList(u,r),paused:n.generateVariantClassList("paused",r)}}),p=e.computed(()=>{switch(s.type){case"info":return"sky";case"success":return"green";case"warning":return"yellow";case"error":return"red"}return"primary"}),a=e.computed(()=>{if(s.icon)return s.icon;switch(s.type){case"info":return"tabler:info-circle";case"success":return"tabler:circle-check";case"warning":return"tabler:alert-triangle";case"error":return"tabler:circle-x"}});return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(d)({type:o.type,paused:o.paused}),s.class))},[e.renderSlot(o.$slots,"render",{},()=>[t.icon||a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.getBemElement)(e.unref(r),"icon"))},[e.createVNode(B._sfc_main,{icon:a.value,size:"sm",style:e.normalizeStyle({color:e.unref(g.getCssCoreVar)("rouad")})},e.createSlots({_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"icon")]),key:"0"}:void 0]),1032,["icon","style"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"body"),o.bodyCls))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"content"),o.contentCls))},[o.title||t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"header"),o.headerCls))},[o.title||t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"title"),o.titleCls,"paragraph"))},[e.renderSlot(o.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],2)):e.createCommentVNode("",!0),s.closable||t.closeButton?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"close"),o.closeCls))},[e.renderSlot(o.$slots,"closeButton",{},()=>[e.createVNode(f._sfc_main,{icon:"tabler:x",color:"neutral",type:"ghost",onClick:i[0]||(i[0]=N=>{var c;return(c=o.onCloseNotification)==null?void 0:c.call(o)})})])],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),o.description||t.description?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"description"),o.descriptionCls,"paragraph"))},[e.renderSlot(o.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(o.description),1)])],2)):e.createCommentVNode("",!0)],2),t.actions?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"actions"),o.actionsCls))},[e.renderSlot(o.$slots,"actions")],2)):e.createCommentVNode("",!0)],2),o.progress&&e.unref(y.isNumber)(o.duration)&&![0,1/0].includes(o.duration)?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:1,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(r),"progress"),o.progressCls)),noTransition:"",notRounded:"",duration:o.duration,color:p.value},null,8,["class","duration","color"])):e.createCommentVNode("",!0)])],2))}}),E=v.installComponent(l,n.getComponentName("Toast"));exports.Toast=l;exports.ToastPlugin=E;exports.ToastTypes=u;exports.default=l;
|