vft 0.0.504 → 0.0.505
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/es/components/alert/alert.vue2.js +46 -41
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as C, useSlots as
|
|
2
|
-
import { VftIcon as
|
|
1
|
+
import { defineComponent as C, useSlots as N, ref as S, computed as a, createBlock as r, openBlock as l, Transition as V, unref as o, withCtx as $, withDirectives as x, createElementVNode as v, normalizeClass as n, createCommentVNode as s, createElementBlock as c, renderSlot as k, createTextVNode as p, toDisplayString as u, Fragment as E, vShow as I } from "vue";
|
|
2
|
+
import { VftIcon as b } from "../icon/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
8
|
-
import { useNamespace as
|
|
8
|
+
import { useNamespace as D } from "../../hooks/use-namespace/index.js";
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
const
|
|
12
|
+
const M = C({
|
|
13
13
|
name: "vft-alert"
|
|
14
|
-
}),
|
|
15
|
-
...
|
|
14
|
+
}), Q = /* @__PURE__ */ C({
|
|
15
|
+
...M,
|
|
16
16
|
props: {
|
|
17
17
|
title: { default: "" },
|
|
18
18
|
description: { default: "" },
|
|
@@ -27,59 +27,64 @@ const D = C({
|
|
|
27
27
|
close: (e) => e instanceof MouseEvent
|
|
28
28
|
},
|
|
29
29
|
setup(e, { emit: h }) {
|
|
30
|
-
const
|
|
30
|
+
const w = h, t = D("alert"), B = {
|
|
31
|
+
success: "icon-success-filled",
|
|
32
|
+
warning: "icon-warning-filled",
|
|
33
|
+
error: "icon-error-filled",
|
|
34
|
+
info: "icon-info-filled"
|
|
35
|
+
}, d = N(), f = S(!0), m = a(() => B[e.type] || e.type), T = a(() => [
|
|
31
36
|
t.e("icon"),
|
|
32
|
-
{ [t.is("big")]: !!e.description || !!
|
|
33
|
-
]),
|
|
34
|
-
|
|
37
|
+
{ [t.is("big")]: !!e.description || !!d.default }
|
|
38
|
+
]), g = a(() => ({ [t.is("bold")]: e.description || d.default })), y = (i) => {
|
|
39
|
+
f.value = !1, w("close", i);
|
|
35
40
|
};
|
|
36
|
-
return (
|
|
37
|
-
name:
|
|
41
|
+
return (i, z) => (l(), r(V, {
|
|
42
|
+
name: o(t).b("fade")
|
|
38
43
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
|
|
41
|
-
class:
|
|
44
|
+
default: $(() => [
|
|
45
|
+
x(v("div", {
|
|
46
|
+
class: n([o(t).b(), o(t).m(e.type), o(t).is("center", e.center), o(t).is(e.effect)]),
|
|
42
47
|
role: "alert"
|
|
43
48
|
}, [
|
|
44
|
-
e.showIcon &&
|
|
49
|
+
e.showIcon && m.value ? (l(), r(o(b), {
|
|
45
50
|
key: 0,
|
|
46
|
-
class:
|
|
47
|
-
icon:
|
|
48
|
-
}, null, 8, ["class", "icon"])) :
|
|
49
|
-
|
|
50
|
-
class:
|
|
51
|
+
class: n(T.value),
|
|
52
|
+
icon: m.value
|
|
53
|
+
}, null, 8, ["class", "icon"])) : s("", !0),
|
|
54
|
+
v("div", {
|
|
55
|
+
class: n(o(t).e("content"))
|
|
51
56
|
}, [
|
|
52
|
-
e.title ||
|
|
57
|
+
e.title || i.$slots.title ? (l(), c("span", {
|
|
53
58
|
key: 0,
|
|
54
|
-
class:
|
|
59
|
+
class: n([o(t).e("title"), g.value])
|
|
55
60
|
}, [
|
|
56
|
-
k(
|
|
57
|
-
|
|
61
|
+
k(i.$slots, "title", {}, () => [
|
|
62
|
+
p(u(e.title), 1)
|
|
58
63
|
])
|
|
59
|
-
], 2)) :
|
|
60
|
-
|
|
64
|
+
], 2)) : s("", !0),
|
|
65
|
+
i.$slots.default || e.description ? (l(), c("p", {
|
|
61
66
|
key: 1,
|
|
62
|
-
class:
|
|
67
|
+
class: n(o(t).e("description"))
|
|
63
68
|
}, [
|
|
64
|
-
k(
|
|
65
|
-
|
|
69
|
+
k(i.$slots, "default", {}, () => [
|
|
70
|
+
p(u(e.description), 1)
|
|
66
71
|
])
|
|
67
|
-
], 2)) :
|
|
68
|
-
e.closable ? (
|
|
69
|
-
e.closeText ? (
|
|
72
|
+
], 2)) : s("", !0),
|
|
73
|
+
e.closable ? (l(), c(E, { key: 2 }, [
|
|
74
|
+
e.closeText ? (l(), c("div", {
|
|
70
75
|
key: 0,
|
|
71
|
-
class:
|
|
72
|
-
onClick:
|
|
73
|
-
}, u(e.closeText), 3)) : (
|
|
76
|
+
class: n([o(t).e("close-btn"), o(t).is("customed")]),
|
|
77
|
+
onClick: y
|
|
78
|
+
}, u(e.closeText), 3)) : (l(), r(o(b), {
|
|
74
79
|
key: 1,
|
|
75
|
-
class:
|
|
76
|
-
onClick:
|
|
80
|
+
class: n(o(t).e("close-btn")),
|
|
81
|
+
onClick: y,
|
|
77
82
|
icon: "icon-close"
|
|
78
83
|
}, null, 8, ["class"]))
|
|
79
|
-
], 64)) :
|
|
84
|
+
], 64)) : s("", !0)
|
|
80
85
|
], 2)
|
|
81
86
|
], 2), [
|
|
82
|
-
[
|
|
87
|
+
[I, f.value]
|
|
83
88
|
])
|
|
84
89
|
]),
|
|
85
90
|
_: 3
|
|
@@ -87,5 +92,5 @@ const D = C({
|
|
|
87
92
|
}
|
|
88
93
|
});
|
|
89
94
|
export {
|
|
90
|
-
|
|
95
|
+
Q as default
|
|
91
96
|
};
|
|
@@ -2,14 +2,14 @@ import "@vueuse/core";
|
|
|
2
2
|
import { isNumber as m, isClient as p } from "@vft/utils";
|
|
3
3
|
import { debugWarn as l } from "../../utils/error.js";
|
|
4
4
|
import "../../components/config-provider/hooks/use-global-config.js";
|
|
5
|
-
import { getCurrentInstance as i, inject as e, computed as c, unref as
|
|
5
|
+
import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../../components/form/index.js";
|
|
8
8
|
const s = {
|
|
9
9
|
current: 0
|
|
10
|
-
}, u =
|
|
10
|
+
}, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
|
|
11
11
|
const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
|
|
12
|
-
const r =
|
|
12
|
+
const r = Z(x);
|
|
13
13
|
return m(r) ? r : f;
|
|
14
14
|
}), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
|
|
15
15
|
return !p && !e(d) && l(
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../icon/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const k=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const C=e.defineComponent({name:"vft-alert"}),y=e.defineComponent({...C,props:{title:{default:""},description:{default:""},type:{default:"info"},closable:{type:Boolean,default:!0},closeText:{default:""},showIcon:{type:Boolean},center:{type:Boolean},effect:{default:"light"}},emits:{close:t=>t instanceof MouseEvent},setup(t,{emit:a}){const u=a,n=k.useNamespace("alert"),d={success:"icon-success-filled",warning:"icon-warning-filled",error:"icon-error-filled",info:"icon-info-filled"},o=e.useSlots(),c=e.ref(!0),s=e.computed(()=>d[t.type]||t.type),f=e.computed(()=>[n.e("icon"),{[n.is("big")]:!!t.description||!!o.default}]),m=e.computed(()=>({[n.is("bold")]:t.description||o.default})),i=l=>{c.value=!1,u("close",l)};return(l,B)=>(e.openBlock(),e.createBlock(e.Transition,{name:e.unref(n).b("fade")},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(n).b(),e.unref(n).m(t.type),e.unref(n).is("center",t.center),e.unref(n).is(t.effect)]),role:"alert"},[t.showIcon&&s.value?(e.openBlock(),e.createBlock(e.unref(r.VftIcon),{key:0,class:e.normalizeClass(f.value),icon:s.value},null,8,["class","icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("content"))},[t.title||l.$slots.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(n).e("title"),m.value])},[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),l.$slots.default||t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(n).e("description"))},[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)])],2)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.closeText?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(n).e("close-btn"),e.unref(n).is("customed")]),onClick:i},e.toDisplayString(t.closeText),3)):(e.openBlock(),e.createBlock(e.unref(r.VftIcon),{key:1,class:e.normalizeClass(e.unref(n).e("close-btn")),onClick:i,icon:"icon-close"},null,8,["class"]))],64)):e.createCommentVNode("",!0)],2)],2),[[e.vShow,c.value]])]),_:3},8,["name"]))}});exports.default=y;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.505";exports.version=e;
|
package/lib/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.505",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"resize-detector": "0.3.0",
|
|
57
57
|
"sortablejs": "1.15.0",
|
|
58
58
|
"photoswipe": "5.4.4",
|
|
59
|
-
"@vft/router": "0.0.73",
|
|
60
|
-
"@vft/use": "0.0.96",
|
|
61
59
|
"@vft/constants": "0.0.83",
|
|
60
|
+
"@vft/use": "0.0.96",
|
|
62
61
|
"@vft/store": "0.0.78",
|
|
62
|
+
"@vft/router": "0.0.73",
|
|
63
63
|
"@vft/utils": "0.0.161",
|
|
64
64
|
"@vft/directives": "0.0.36"
|
|
65
65
|
},
|