vft 0.0.306 → 0.0.307

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.
Files changed (42) hide show
  1. package/es/component.js +119 -121
  2. package/es/components/index.d.ts +0 -1
  3. package/es/components/index.js +367 -369
  4. package/es/components/modal/use/use-modal.js +51 -53
  5. package/es/components/pagination/index.d.ts +2 -2
  6. package/es/components/pagination/pagination.vue.d.ts +1 -1
  7. package/es/components/timeline/timeline-item.vue2.js +18 -24
  8. package/es/index.js +506 -508
  9. package/es/package.json.d.ts +1 -1
  10. package/es/package.json.js +1 -1
  11. package/lib/component.cjs +1 -1
  12. package/lib/components/index.cjs +1 -1
  13. package/lib/components/index.d.ts +0 -1
  14. package/lib/components/modal/use/use-modal.cjs +1 -1
  15. package/lib/components/pagination/index.d.ts +2 -2
  16. package/lib/components/pagination/pagination.vue.d.ts +1 -1
  17. package/lib/components/timeline/timeline-item.vue2.cjs +1 -1
  18. package/lib/index.cjs +1 -1
  19. package/lib/package.json.cjs +1 -1
  20. package/lib/package.json.d.ts +1 -1
  21. package/package.json +6 -6
  22. package/web-types.json +1 -1
  23. package/es/components/exception/exception.png.js +0 -4
  24. package/es/components/exception/exception.vue.d.ts +0 -16
  25. package/es/components/exception/exception.vue.js +0 -4
  26. package/es/components/exception/exception.vue2.js +0 -52
  27. package/es/components/exception/index.d.ts +0 -22
  28. package/es/components/exception/index.js +0 -12
  29. package/es/components/exception/style/css.d.ts +0 -1
  30. package/es/components/exception/style/css.js +0 -2
  31. package/es/components/exception/style/index.d.ts +0 -1
  32. package/es/components/exception/style/index.js +0 -2
  33. package/lib/components/exception/exception.png.cjs +0 -1
  34. package/lib/components/exception/exception.vue.cjs +0 -1
  35. package/lib/components/exception/exception.vue.d.ts +0 -16
  36. package/lib/components/exception/exception.vue2.cjs +0 -1
  37. package/lib/components/exception/index.cjs +0 -1
  38. package/lib/components/exception/index.d.ts +0 -22
  39. package/lib/components/exception/style/css.cjs +0 -1
  40. package/lib/components/exception/style/css.d.ts +0 -1
  41. package/lib/components/exception/style/index.cjs +0 -1
  42. package/lib/components/exception/style/index.d.ts +0 -1
@@ -1,91 +1,89 @@
1
- import { useKeepAliveLifeCycle as I } from "@vft/use";
2
- import { isFunction as V } from "@vft/utils";
3
- import { isEqual as w } from "lodash-es";
4
- import { reactive as v, ref as d, computed as P, unref as n, getCurrentInstance as h, watchEffect as H, nextTick as L, toRaw as M, onBeforeUnmount as R, onDeactivated as b } from "vue";
5
- const u = v({}), m = v({});
6
- function y() {
7
- const t = d(null), r = d(!1), l = d(""), { onBeforeUnMountedOrDeactivated: c, onMountedOrActivated: s } = I();
8
- function p(o, a) {
9
- if (!h())
1
+ import { onMountedOrActivated as h } from "@vft/use";
2
+ import { isFunction as I } from "@vft/utils";
3
+ import { isEqual as V } from "lodash-es";
4
+ import { reactive as g, ref as c, computed as m, unref as t, getCurrentInstance as v, watchEffect as w, nextTick as H, onBeforeUnmount as P, toRaw as d } from "vue";
5
+ const i = g({}), p = g({});
6
+ function x() {
7
+ const r = c(null), s = c(!1), l = c("");
8
+ function u(e, n) {
9
+ if (!v())
10
10
  throw new Error(
11
11
  "useModal() can only be used inside setup() or functional components!"
12
12
  );
13
- l.value = a, c(() => {
14
- t.value = null, r.value = !1, u[n(l)] = null;
15
- }), s(() => {
16
- n(r) && o === n(t) || (t.value = o, r.value = !0, o.emitVisible = (g, i) => {
17
- m[i] = g;
13
+ l.value = n, P(() => {
14
+ r.value = null, s.value = !1, i[t(l)] = null;
15
+ }), h(() => {
16
+ t(s) && e === t(r) || (r.value = e, s.value = !0, e.emitVisible = (M, a) => {
17
+ p[a] = M;
18
18
  });
19
19
  });
20
20
  }
21
- const e = () => {
22
- const o = n(t);
23
- return o || console.error("useModal instance is undefined!"), o;
21
+ const o = () => {
22
+ const e = t(r);
23
+ return e || console.error("useModal instance is undefined!"), e;
24
24
  }, f = {
25
- setModalProps: (o) => {
26
- e()?.setModalProps(o);
25
+ setModalProps: (e) => {
26
+ o()?.setModalProps(e);
27
27
  },
28
- getVisible: P(() => m[~~n(l)]),
28
+ getVisible: m(() => p[~~t(l)]),
29
29
  redoModalHeight: () => {
30
- e()?.redoModalHeight?.();
30
+ o()?.redoModalHeight?.();
31
31
  },
32
- openModal: (o = !0, a, g = !0) => {
33
- if (e()?.setModalProps({
34
- modelValue: o
35
- }), !a) return;
36
- const i = n(l);
37
- if (g) {
38
- u[i] = null, u[i] = M(a);
32
+ openModal: (e = !0, n, M = !0) => {
33
+ if (o()?.setModalProps({
34
+ modelValue: e
35
+ }), !n) return;
36
+ const a = t(l);
37
+ if (M) {
38
+ i[a] = null, i[a] = d(n);
39
39
  return;
40
40
  }
41
- w(M(u[i]), M(a)) || (u[i] = M(a));
41
+ V(d(i[a]), d(n)) || (i[a] = d(n));
42
42
  },
43
43
  closeModal: () => {
44
- e()?.setModalProps({ modelValue: !1 });
44
+ o()?.setModalProps({ modelValue: !1 });
45
45
  }
46
46
  };
47
- return [p, f];
47
+ return [u, f];
48
48
  }
49
- const A = (t) => {
50
- const r = d(null), l = h(), c = d(""), s = () => {
51
- const e = n(r);
49
+ const O = (r) => {
50
+ const s = c(null), l = v(), u = c(""), o = () => {
51
+ const e = t(s);
52
52
  return e || console.error("useModalInner instance is undefined!"), e;
53
- }, p = (e, f) => {
54
- R(() => {
55
- r.value = null;
56
- }), b(() => {
57
- r.value = null;
58
- }), c.value = f, r.value = e, l?.emit("register", e, f);
53
+ }, f = (e, n) => {
54
+ P(() => {
55
+ s.value = null;
56
+ }), u.value = n, s.value = e, l?.emit("register", e, n);
59
57
  };
60
- return H(() => {
61
- const e = u[n(c)];
62
- e && (!t || !V(t) || L(() => {
63
- t(e);
58
+ return w(() => {
59
+ const e = i[t(u)];
60
+ e && (!r || !I(r) || H(() => {
61
+ r(e);
64
62
  }));
65
63
  }), [
66
- p,
64
+ f,
67
65
  {
68
66
  changeLoading: (e = !0) => {
69
- s()?.setModalProps({ loading: e });
67
+ o()?.setModalProps({ loading: e });
70
68
  },
71
- getVisible: P(() => m[~~n(c)]),
69
+ getVisible: m(() => p[~~t(u)]),
72
70
  changeOkLoading: (e = !0) => {
73
- s()?.setModalProps({ confirmLoading: e });
71
+ o()?.setModalProps({ confirmLoading: e });
74
72
  },
75
73
  closeModal: () => {
76
- s()?.setModalProps({ modelValue: !1 });
74
+ o()?.setModalProps({ modelValue: !1 });
77
75
  },
78
76
  setModalProps: (e) => {
79
- s()?.setModalProps(e);
77
+ o()?.setModalProps(e);
80
78
  },
81
79
  redoModalHeight: () => {
82
- const e = s()?.redoModalHeight;
80
+ const e = o()?.redoModalHeight;
83
81
  e && e();
84
82
  }
85
83
  }
86
84
  ];
87
85
  };
88
86
  export {
89
- y as useModal,
90
- A as useModalInner
87
+ x as useModal,
88
+ O as useModalInner
91
89
  };
@@ -21,7 +21,7 @@ export declare const VftPagination: import("vft/es/utils").SFCWithInstall<import
21
21
  type: import("vue").PropType<number>;
22
22
  };
23
23
  layout: {
24
- type: import("vue").PropType<string>;
24
+ type: import("vue").PropType<string[]>;
25
25
  };
26
26
  pageSizes: {
27
27
  type: import("vue").PropType<number[]>;
@@ -83,7 +83,7 @@ export declare const VftPagination: import("vft/es/utils").SFCWithInstall<import
83
83
  type: import("vue").PropType<number>;
84
84
  };
85
85
  layout: {
86
- type: import("vue").PropType<string>;
86
+ type: import("vue").PropType<string[]>;
87
87
  };
88
88
  pageSizes: {
89
89
  type: import("vue").PropType<number[]>;
@@ -8,7 +8,7 @@ export interface PaginationProps {
8
8
  defaultCurrentPage?: number;
9
9
  pageCount?: number;
10
10
  pagerCount?: number;
11
- layout?: string;
11
+ layout?: string[];
12
12
  pageSizes?: number[];
13
13
  popperClass?: string;
14
14
  prevText?: string;
@@ -1,17 +1,17 @@
1
- import { defineComponent as c, computed as f, createElementBlock as a, openBlock as s, normalizeClass as l, unref as o, createElementVNode as n, createCommentVNode as m, normalizeStyle as y, createBlock as r, withCtx as v, resolveDynamicComponent as k, renderSlot as p, toDisplayString as d } from "vue";
2
- import { VftIcon as h } from "../icon/index.js";
1
+ import { defineComponent as d, computed as u, createElementBlock as a, openBlock as s, normalizeClass as l, unref as o, createElementVNode as n, createCommentVNode as m, normalizeStyle as f, createBlock as y, mergeProps as k, renderSlot as r, toDisplayString as p } from "vue";
2
+ import { VftIcon as v } from "../icon/index.js";
3
3
  import "@vueuse/core";
4
4
  import "@vft/utils";
5
5
  import "../../utils/ns-cover.js";
6
6
  import "lodash-es";
7
- import { useNamespace as B } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
8
8
  import "../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import "../../hooks/use-z-index/index.js";
11
- const C = c({
11
+ const B = d({
12
12
  name: "vft-timeline-item"
13
- }), I = /* @__PURE__ */ c({
14
- ...C,
13
+ }), D = /* @__PURE__ */ d({
14
+ ...B,
15
15
  props: {
16
16
  timestamp: {},
17
17
  hideTimestamp: { type: Boolean, default: !1 },
@@ -20,11 +20,11 @@ const C = c({
20
20
  type: {},
21
21
  color: {},
22
22
  size: { default: "normal" },
23
- icon: { default: "" },
23
+ icon: {},
24
24
  hollow: { type: Boolean, default: !1 }
25
25
  },
26
26
  setup(i) {
27
- const e = B("timeline-item"), u = f(() => [
27
+ const e = h("timeline-item"), c = u(() => [
28
28
  e.e("node"),
29
29
  e.em("node", i.size || ""),
30
30
  e.em("node", i.type || ""),
@@ -38,26 +38,20 @@ const C = c({
38
38
  }, null, 2),
39
39
  t.$slots.dot ? m("", !0) : (s(), a("div", {
40
40
  key: 0,
41
- class: l(u.value),
42
- style: y({
41
+ class: l(c.value),
42
+ style: f({
43
43
  backgroundColor: t.color
44
44
  })
45
45
  }, [
46
- t.icon ? (s(), r(o(h), {
47
- key: 0,
48
- class: l(o(e).e("icon"))
49
- }, {
50
- default: v(() => [
51
- (s(), r(k(t.icon)))
52
- ]),
53
- _: 1
54
- }, 8, ["class"])) : m("", !0)
46
+ t.icon?.icon ? (s(), y(o(v), k({ key: 0 }, t.icon, {
47
+ class: o(e).e("icon")
48
+ }), null, 16, ["class"])) : m("", !0)
55
49
  ], 6)),
56
50
  t.$slots.dot ? (s(), a("div", {
57
51
  key: 1,
58
52
  class: l(o(e).e("dot"))
59
53
  }, [
60
- p(t.$slots, "dot")
54
+ r(t.$slots, "dot")
61
55
  ], 2)) : m("", !0),
62
56
  n("div", {
63
57
  class: l(o(e).e("wrapper"))
@@ -65,20 +59,20 @@ const C = c({
65
59
  !t.hideTimestamp && t.placement === "top" ? (s(), a("div", {
66
60
  key: 0,
67
61
  class: l([o(e).e("timestamp"), o(e).is("top")])
68
- }, d(t.timestamp), 3)) : m("", !0),
62
+ }, p(t.timestamp), 3)) : m("", !0),
69
63
  n("div", {
70
64
  class: l(o(e).e("content"))
71
65
  }, [
72
- p(t.$slots, "default")
66
+ r(t.$slots, "default")
73
67
  ], 2),
74
68
  !t.hideTimestamp && t.placement === "bottom" ? (s(), a("div", {
75
69
  key: 1,
76
70
  class: l([o(e).e("timestamp"), o(e).is("bottom")])
77
- }, d(t.timestamp), 3)) : m("", !0)
71
+ }, p(t.timestamp), 3)) : m("", !0)
78
72
  ], 2)
79
73
  ], 2));
80
74
  }
81
75
  });
82
76
  export {
83
- I as default
77
+ D as default
84
78
  };