vft 0.0.406 → 0.0.409

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 (52) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/empty/constants.d.ts +10 -12
  3. package/es/components/empty/constants.js +10 -2
  4. package/es/components/empty/empty.vue.d.ts +1 -11
  5. package/es/components/empty/empty.vue2.js +75 -62
  6. package/es/components/empty/index.d.ts +13 -12
  7. package/es/components/empty/style/css.d.ts +1 -0
  8. package/es/components/empty/style/css.js +1 -0
  9. package/es/components/empty/style/index.d.ts +1 -0
  10. package/es/components/empty/style/index.js +1 -0
  11. package/es/components/empty/types.d.ts +9 -0
  12. package/es/components/empty/types.js +1 -0
  13. package/es/components/table/style/css.js +1 -1
  14. package/es/components/table/style/index.js +1 -1
  15. package/es/components/table/table.vue2.js +14 -14
  16. package/es/components/types.d.ts +1 -1
  17. package/es/package.json.d.ts +1 -1
  18. package/es/package.json.js +1 -1
  19. package/lib/components/empty/constants.cjs +1 -1
  20. package/lib/components/empty/constants.d.ts +10 -12
  21. package/lib/components/empty/empty.vue.d.ts +1 -11
  22. package/lib/components/empty/empty.vue2.cjs +1 -1
  23. package/lib/components/empty/index.d.ts +13 -12
  24. package/lib/components/empty/style/css.cjs +1 -1
  25. package/lib/components/empty/style/css.d.ts +1 -0
  26. package/lib/components/empty/style/index.cjs +1 -1
  27. package/lib/components/empty/style/index.d.ts +1 -0
  28. package/lib/components/empty/types.cjs +1 -0
  29. package/lib/components/empty/types.d.ts +9 -0
  30. package/lib/components/table/style/css.cjs +1 -1
  31. package/lib/components/table/style/index.cjs +1 -1
  32. package/lib/components/table/table.vue2.cjs +1 -1
  33. package/lib/components/types.d.ts +1 -1
  34. package/lib/package.json.cjs +1 -1
  35. package/lib/package.json.d.ts +1 -1
  36. package/package.json +5 -5
  37. package/theme-style/index.css +1 -1
  38. package/theme-style/src/common/icon.scss +7 -0
  39. package/theme-style/src/empty.scss +28 -20
  40. package/theme-style/vft-empty.css +1 -1
  41. package/theme-style/vft-upload.css +1 -1
  42. package/web-types.json +1 -1
  43. package/es/components/empty/assets/no-collect.png.js +0 -4
  44. package/es/components/empty/assets/no-data.png.js +0 -4
  45. package/es/components/empty/assets/no-filter.png.js +0 -4
  46. package/es/components/empty/assets/no-page-data.png.js +0 -4
  47. package/es/components/empty/assets/no-search.png.js +0 -4
  48. package/lib/components/empty/assets/no-collect.png.cjs +0 -1
  49. package/lib/components/empty/assets/no-data.png.cjs +0 -1
  50. package/lib/components/empty/assets/no-filter.png.cjs +0 -1
  51. package/lib/components/empty/assets/no-page-data.png.cjs +0 -1
  52. package/lib/components/empty/assets/no-search.png.cjs +0 -1
@@ -1,12 +1,10 @@
1
- export declare enum EmptyEnum {
2
- /** 暂无收藏记录 */
3
- NO_COLLECT = "no-collect.png",
4
- /** 整个页面数据 */
5
- NO_PAGE_DATA = "no-page-data.png",
6
- /** 暂无数据 */
7
- NO_DATA = "no-data.png",
8
- /** 此筛选条件下无结果 */
9
- NO_FILTER = "no-filter.png",
10
- /** 没有搜索结果 */
11
- NO_SEARCH = "no-search.png"
12
- }
1
+ export declare const EmptyEnum: {
2
+ readonly NotFound: "icon-not-found";
3
+ readonly NoFilter: "icon-no-filter";
4
+ readonly NoSearch: "icon-no-search";
5
+ readonly NetworkDisconnect: "icon-network-disconnect";
6
+ readonly Delete: "icon-delete";
7
+ readonly NoData: "icon-no-data";
8
+ readonly PageError: "icon-page-error";
9
+ };
10
+ export type EmptyEnumType = (typeof EmptyEnum)[keyof typeof EmptyEnum];
@@ -1,4 +1,12 @@
1
- var n = /* @__PURE__ */ ((a) => (a.NO_COLLECT = "no-collect.png", a.NO_PAGE_DATA = "no-page-data.png", a.NO_DATA = "no-data.png", a.NO_FILTER = "no-filter.png", a.NO_SEARCH = "no-search.png", a))(n || {});
1
+ const o = {
2
+ NotFound: "icon-not-found",
3
+ NoFilter: "icon-no-filter",
4
+ NoSearch: "icon-no-search",
5
+ NetworkDisconnect: "icon-network-disconnect",
6
+ Delete: "icon-delete",
7
+ NoData: "icon-no-data",
8
+ PageError: "icon-page-error"
9
+ };
2
10
  export {
3
- n as EmptyEnum
11
+ o as EmptyEnum
4
12
  };
@@ -1,14 +1,4 @@
1
- import type { ComponentSize } from '../types';
2
- import { EmptyEnum } from './constants';
3
- export interface EmptyProps {
4
- /** 图片类型或字符串 支持自定义 slot */
5
- img?: string;
6
- type?: EmptyEnum;
7
- /** 图片大小 */
8
- size?: ComponentSize | string | number[];
9
- /** 图片底部描述 支持自定义 slot */
10
- desc?: string;
11
- }
1
+ import type { EmptyProps } from './types';
12
2
  declare function __VLS_template(): {
13
3
  img?(_: {}): any;
14
4
  default?(_: {}): any;
@@ -1,98 +1,111 @@
1
- import { defineComponent as u, getCurrentInstance as y, computed as p, createElementBlock as s, openBlock as i, normalizeClass as r, unref as e, createElementVNode as z, createCommentVNode as d, normalizeStyle as C, renderSlot as f, createVNode as T } from "vue";
2
- import { renderTNode as _, setSize as A, VNode as E } from "@vft/utils";
1
+ import { defineComponent as d, getCurrentInstance as k, computed as s, resolveComponent as z, createElementBlock as l, openBlock as a, normalizeClass as c, unref as o, createElementVNode as x, createCommentVNode as m, renderSlot as u, createBlock as C, normalizeProps as E, mergeProps as D, createVNode as V } from "vue";
3
2
  import "@vueuse/core";
4
- import { getSizeType as v } from "../../utils/helper.js";
3
+ import { singleAttrToObj as $, renderTNode as b, VNode as h } from "@vft/utils";
4
+ import { addUnit as w } from "../../utils/helper.js";
5
5
  import "lodash-es";
6
6
  import "../form/index.js";
7
- import { useNamespace as O } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as B } 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
- import k from "./assets/no-collect.png.js";
12
- import S from "./assets/no-data.png.js";
13
- import D from "./assets/no-filter.png.js";
14
- import V from "./assets/no-page-data.png.js";
15
- import $ from "./assets/no-search.png.js";
16
- import { EmptyEnum as t } from "./constants.js";
17
- const h = ["src"], x = u({
11
+ import { EmptyEnum as e } from "./constants.js";
12
+ const P = d({
18
13
  name: "vft-empty"
19
- }), X = /* @__PURE__ */ u({
20
- ...x,
14
+ }), H = /* @__PURE__ */ d({
15
+ ...P,
21
16
  props: {
22
- img: {},
23
- type: { default: () => t.NO_DATA },
24
- size: {},
17
+ icon: {},
18
+ type: { default: () => e.NoData },
19
+ size: { default: "default" },
25
20
  desc: {}
26
21
  },
27
- setup(n) {
28
- const o = O("empty"), g = y(), a = (/* @__PURE__ */ new Map([
22
+ setup(t) {
23
+ const n = B("empty"), p = k(), f = /* @__PURE__ */ new Map([
29
24
  [
30
- t.NO_COLLECT,
25
+ e.NotFound,
31
26
  {
32
- text: "暂无收藏记录",
33
- img: k
27
+ text: "页面不存在"
34
28
  }
35
29
  ],
36
30
  [
37
- t.NO_PAGE_DATA,
31
+ e.Delete,
38
32
  {
39
- text: "没有找到相关信息",
40
- size: 300,
41
- img: V
33
+ text: "已删除"
42
34
  }
43
35
  ],
44
36
  [
45
- t.NO_DATA,
37
+ e.NetworkDisconnect,
46
38
  {
47
- text: "暂无数据",
48
- img: S
39
+ text: "网络已断开"
49
40
  }
50
41
  ],
51
42
  [
52
- t.NO_FILTER,
43
+ e.NoData,
53
44
  {
54
- text: "此筛选条件下无结果",
55
- img: D
45
+ text: "暂无数据"
56
46
  }
57
47
  ],
58
48
  [
59
- t.NO_SEARCH,
49
+ e.PageError,
60
50
  {
61
- text: "没有搜索结果",
62
- img: $
51
+ text: "系统异常"
52
+ }
53
+ ],
54
+ [
55
+ e.NoFilter,
56
+ {
57
+ text: "此筛选条件下无结果"
58
+ }
59
+ ],
60
+ [
61
+ e.NoSearch,
62
+ {
63
+ text: "没有搜索结果"
63
64
  }
64
65
  ]
65
- ])).get(n.type), N = p(() => n.img || a?.img), c = p(
66
- () => _(g, "desc", { defaultNode: a?.text })
67
- ), l = v(n.size);
68
- return (m, L) => (i(), s("div", {
69
- class: r([e(o).b(), e(l) ? e(o).m(e(l)) : ""])
70
- }, [
71
- z("div", {
72
- class: r(e(o).e("image")),
73
- style: C(e(l) ? {} : e(A)(e(a)?.size || m.size))
66
+ ]), N = s(() => f.get(t.type)), v = s(() => {
67
+ switch (t.size) {
68
+ case "large":
69
+ return 120;
70
+ case "default":
71
+ return 80;
72
+ case "small":
73
+ return 60;
74
+ default:
75
+ return t.size || 80;
76
+ }
77
+ }), g = s(() => $(t.icon, "icon", {
78
+ size: w(v.value),
79
+ icon: t.type
80
+ })), i = s(
81
+ () => b(p, "desc", { defaultNode: N.value?.text })
82
+ );
83
+ return (r, T) => {
84
+ const y = z("vft-icon");
85
+ return a(), l("div", {
86
+ class: c([o(n).b()])
74
87
  }, [
75
- m.$slots.img ? f(m.$slots, "img", { key: 0 }) : (i(), s("img", {
88
+ x("div", {
89
+ class: c(o(n).e("image"))
90
+ }, [
91
+ r.$slots.img ? u(r.$slots, "img", { key: 0 }) : (a(), C(y, E(D({ key: 1 }, g.value)), null, 16))
92
+ ], 2),
93
+ i.value ? (a(), l("span", {
94
+ key: 0,
95
+ class: c(o(n).e("desc"))
96
+ }, [
97
+ V(o(h), { content: i.value }, null, 8, ["content"])
98
+ ], 2)) : m("", !0),
99
+ r.$slots.default ? (a(), l("div", {
76
100
  key: 1,
77
- src: N.value,
78
- alt: ""
79
- }, null, 8, h))
80
- ], 6),
81
- c.value ? (i(), s("span", {
82
- key: 0,
83
- class: r(e(o).e("desc"))
84
- }, [
85
- T(e(E), { content: c.value }, null, 8, ["content"])
86
- ], 2)) : d("", !0),
87
- m.$slots.default ? (i(), s("div", {
88
- key: 1,
89
- class: r(e(o).e("bottom"))
90
- }, [
91
- f(m.$slots, "default")
92
- ], 2)) : d("", !0)
93
- ], 2));
101
+ class: c(o(n).e("bottom"))
102
+ }, [
103
+ u(r.$slots, "default")
104
+ ], 2)) : m("", !0)
105
+ ], 2);
106
+ };
94
107
  }
95
108
  });
96
109
  export {
97
- X as default
110
+ H as default
98
111
  };
@@ -1,14 +1,15 @@
1
1
  export * from './constants';
2
+ export * from './types';
2
3
  export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
3
4
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
- img: {
5
- type: import("vue").PropType<string>;
5
+ icon: {
6
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
6
7
  };
7
8
  type: {
8
- type: import("vue").PropType<import("./constants").EmptyEnum>;
9
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
9
10
  };
10
11
  size: {
11
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
12
+ type: import("vue").PropType<import("../types").ComponentSize>;
12
13
  };
13
14
  desc: {
14
15
  type: import("vue").PropType<string>;
@@ -21,14 +22,14 @@ export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
21
22
  M: {};
22
23
  Defaults: {};
23
24
  }, Readonly<import("vue").ExtractPropTypes<{
24
- img: {
25
- type: import("vue").PropType<string>;
25
+ icon: {
26
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
26
27
  };
27
28
  type: {
28
- type: import("vue").PropType<import("./constants").EmptyEnum>;
29
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
29
30
  };
30
31
  size: {
31
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
32
+ type: import("vue").PropType<import("../types").ComponentSize>;
32
33
  };
33
34
  desc: {
34
35
  type: import("vue").PropType<string>;
@@ -38,14 +39,14 @@ export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
38
39
  __isTeleport?: never;
39
40
  __isSuspense?: never;
40
41
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
41
- img: {
42
- type: import("vue").PropType<string>;
42
+ icon: {
43
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
43
44
  };
44
45
  type: {
45
- type: import("vue").PropType<import("./constants").EmptyEnum>;
46
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
46
47
  };
47
48
  size: {
48
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
49
+ type: import("vue").PropType<import("../types").ComponentSize>;
49
50
  };
50
51
  desc: {
51
52
  type: import("vue").PropType<string>;
@@ -1 +1,2 @@
1
+ import 'vft/es/components/icon/style/css';
1
2
  import 'vft/theme-style/vft-empty.css';
@@ -1,2 +1,3 @@
1
1
  import "vft/theme-style/base.css";
2
+ import "vft/theme-style/vft-icon.css";
2
3
  import "vft/theme-style/vft-empty.css";
@@ -1 +1,2 @@
1
+ import 'vft/es/components/icon/style';
1
2
  import 'vft/theme-style/src/empty.scss';
@@ -1,2 +1,3 @@
1
1
  import "vft/theme-style/src/base.scss";
2
+ import "vft/theme-style/src/icon.scss";
2
3
  import "vft/theme-style/src/empty.scss";
@@ -0,0 +1,9 @@
1
+ import type { IconProps } from 'vft/es/components/icon';
2
+ import type { ComponentSize } from '../types';
3
+ import { type EmptyEnumType } from './constants';
4
+ export interface EmptyProps {
5
+ icon?: IconProps | string;
6
+ type?: EmptyEnumType;
7
+ size?: ComponentSize;
8
+ desc?: string;
9
+ }
@@ -0,0 +1 @@
1
+
@@ -1,5 +1,6 @@
1
1
  import "vft/theme-style/base.css";
2
2
  import "vft/theme-style/vft-clamp-toggle.css";
3
+ import "vft/theme-style/vft-icon.css";
3
4
  import "vft/theme-style/vft-empty.css";
4
5
  import "vft/theme-style/vft-pagination.css";
5
6
  import "vft/theme-style/vft-autocomplete.css";
@@ -15,7 +16,6 @@ import "vft/theme-style/vft-radio.css";
15
16
  import "vft/theme-style/vft-cascader-panel.css";
16
17
  import "vft/theme-style/vft-cascader.css";
17
18
  import "vft/theme-style/vft-color-picker.css";
18
- import "vft/theme-style/vft-icon.css";
19
19
  import "vft/theme-style/vft-button.css";
20
20
  import "vft/theme-style/vft-progress.css";
21
21
  import "vft/theme-style/vft-upload.css";
@@ -1,9 +1,9 @@
1
1
  import "vft/theme-style/src/base.scss";
2
2
  import "vft/theme-style/src/clamp-toggle.scss";
3
+ import "vft/theme-style/src/icon.scss";
3
4
  import "vft/theme-style/src/empty.scss";
4
5
  import "vft/theme-style/src/pagination.scss";
5
6
  import "vft/theme-style/src/skeleton-item.scss";
6
- import "vft/theme-style/src/icon.scss";
7
7
  import "vft/theme-style/src/skeleton.scss";
8
8
  import "vft/theme-style/src/autocomplete.scss";
9
9
  import "vft/theme-style/src/input.scss";
@@ -1,7 +1,7 @@
1
- import { defineComponent as F, useAttrs as ee, ref as u, getCurrentInstance as ae, computed as R, unref as e, watch as te, nextTick as oe, toRaw as le, createBlock as f, openBlock as m, withCtx as c, createElementVNode as P, normalizeClass as re, createVNode as p, createCommentVNode as D, mergeProps as _, withDirectives as ne, renderSlot as H } from "vue";
1
+ import { defineComponent as T, useAttrs as ee, ref as u, getCurrentInstance as ae, computed as R, unref as e, watch as te, nextTick as oe, toRaw as le, createBlock as f, openBlock as m, withCtx as c, createElementVNode as P, normalizeClass as re, createVNode as p, createCommentVNode as D, mergeProps as H, withDirectives as ne, renderSlot as _ } from "vue";
2
2
  import { VftEmpty as ce } from "../empty/index.js";
3
3
  import { vLoading as ie } from "../loading/directive.js";
4
- import { deepMerge as T, isClient as se, omit as ge, isFunction as de } from "@vft/utils";
4
+ import { deepMerge as F, isClient as se, omit as ge, isFunction as de } from "@vft/utils";
5
5
  import { FormCompEnum as ue } from "../../utils/form-register.js";
6
6
  import "@vueuse/core";
7
7
  import "../config-provider/hooks/use-global-config.js";
@@ -26,9 +26,9 @@ import { usePagination as Be } from "./use/use-pagination.js";
26
26
  import { EmptyEnum as ze } from "../empty/constants.js";
27
27
  const Re = {
28
28
  "vft-loading-text": "加载中..."
29
- }, Pe = F({
29
+ }, Pe = T({
30
30
  name: "vft-table"
31
- }), ta = /* @__PURE__ */ F({
31
+ }), ta = /* @__PURE__ */ T({
32
32
  ...Pe,
33
33
  props: {
34
34
  sticky: {
@@ -386,10 +386,10 @@ const Re = {
386
386
  "zoom"
387
387
  ],
388
388
  setup(De, {
389
- expose: A,
390
- emit: E
389
+ expose: E,
390
+ emit: A
391
391
  }) {
392
- const s = me("table"), l = E, N = ee(), h = u(), O = u([]), g = u(), V = ae(), o = R(() => T(V.props, e(g))), {
392
+ const s = me("table"), l = A, N = ee(), h = u(), O = u([]), g = u(), V = ae(), o = R(() => F(V.props, e(g))), {
393
393
  getLoading: I,
394
394
  setLoading: q
395
395
  } = Se(o), {
@@ -609,7 +609,7 @@ const Re = {
609
609
  });
610
610
  }
611
611
  })
612
- }, [J] = fe(T({
612
+ }, [J] = fe(F({
613
613
  schemas: [r.value?.formOptions?.addSearchAllSchema ? Z : {}],
614
614
  rowProps: {
615
615
  justify: "start"
@@ -633,29 +633,29 @@ const Re = {
633
633
  }, Q = () => {
634
634
  w(v()), l("form-reset");
635
635
  };
636
- return A({
636
+ return E({
637
637
  table: h,
638
638
  ...B
639
639
  }), (a, t) => (m(), f(e(pe), null, {
640
640
  fallback: c(() => [p(e(be))]),
641
641
  default: c(() => [P("div", {
642
642
  class: re(e(s).b())
643
- }, [p(e(ye), _({
643
+ }, [p(e(ye), H({
644
644
  ref_key: "xGrid",
645
645
  ref: h
646
646
  }, r.value), {
647
- toolbarButtons: c(() => [H(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(Ce), {
647
+ toolbarButtons: c(() => [_(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(Ce), {
648
648
  key: 0,
649
649
  onRegister: e(J),
650
650
  onSubmit: z,
651
651
  onReset: Q
652
- }, null, 8, ["onRegister"])) : D("", !0), H(a.$slots, "toolbar-right")]),
652
+ }, null, 8, ["onRegister"])) : D("", !0), _(a.$slots, "toolbar-right")]),
653
653
  empty: c(() => [p(e(ce), {
654
- type: e(ze).NO_DATA
654
+ type: e(ze).NoData
655
655
  }, null, 8, ["type"])]),
656
656
  loading: c(() => [ne(P("div", Re, null, 512), [[e(ie), r.value.loading]])]),
657
657
  _: 3
658
- }, 16), r.value.showPager && e(b) ? (m(), f(e(he), _({
658
+ }, 16), r.value.showPager && e(b) ? (m(), f(e(he), H({
659
659
  key: 0
660
660
  }, e(i), {
661
661
  class: [e(s).e("pager"), e(s).m("pager-" + e(i).pagePlacement)],
@@ -1,4 +1,4 @@
1
- export type ComponentSize = number | string | 'large' | 'small' | '';
1
+ export type ComponentSize = number | string | 'large' | 'small' | 'default';
2
2
  export type Nullable<T> = T | null;
3
3
  export type Recordable<T = any> = Record<string, T>;
4
4
  export type Awaitable<T> = Promise<T> | T;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.406",
3
+ "version": "0.0.409",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.406";
1
+ const o = "0.0.409";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(e=>(e.NO_COLLECT="no-collect.png",e.NO_PAGE_DATA="no-page-data.png",e.NO_DATA="no-data.png",e.NO_FILTER="no-filter.png",e.NO_SEARCH="no-search.png",e))(n||{});exports.EmptyEnum=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={NotFound:"icon-not-found",NoFilter:"icon-no-filter",NoSearch:"icon-no-search",NetworkDisconnect:"icon-network-disconnect",Delete:"icon-delete",NoData:"icon-no-data",PageError:"icon-page-error"};exports.EmptyEnum=o;
@@ -1,12 +1,10 @@
1
- export declare enum EmptyEnum {
2
- /** 暂无收藏记录 */
3
- NO_COLLECT = "no-collect.png",
4
- /** 整个页面数据 */
5
- NO_PAGE_DATA = "no-page-data.png",
6
- /** 暂无数据 */
7
- NO_DATA = "no-data.png",
8
- /** 此筛选条件下无结果 */
9
- NO_FILTER = "no-filter.png",
10
- /** 没有搜索结果 */
11
- NO_SEARCH = "no-search.png"
12
- }
1
+ export declare const EmptyEnum: {
2
+ readonly NotFound: "icon-not-found";
3
+ readonly NoFilter: "icon-no-filter";
4
+ readonly NoSearch: "icon-no-search";
5
+ readonly NetworkDisconnect: "icon-network-disconnect";
6
+ readonly Delete: "icon-delete";
7
+ readonly NoData: "icon-no-data";
8
+ readonly PageError: "icon-page-error";
9
+ };
10
+ export type EmptyEnumType = (typeof EmptyEnum)[keyof typeof EmptyEnum];
@@ -1,14 +1,4 @@
1
- import type { ComponentSize } from '../types';
2
- import { EmptyEnum } from './constants';
3
- export interface EmptyProps {
4
- /** 图片类型或字符串 支持自定义 slot */
5
- img?: string;
6
- type?: EmptyEnum;
7
- /** 图片大小 */
8
- size?: ComponentSize | string | number[];
9
- /** 图片底部描述 支持自定义 slot */
10
- desc?: string;
11
- }
1
+ import type { EmptyProps } from './types';
12
2
  declare function __VLS_template(): {
13
3
  img?(_: {}): any;
14
4
  default?(_: {}): any;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@vft/utils");require("@vueuse/core");const m=require("../../utils/helper.cjs");require("lodash-es");require("../form/index.cjs");const d=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const f=require("./assets/no-collect.png.cjs"),p=require("./assets/no-data.png.cjs"),g=require("./assets/no-filter.png.cjs"),y=require("./assets/no-page-data.png.cjs"),E=require("./assets/no-search.png.cjs"),t=require("./constants.cjs"),q=["src"],C=e.defineComponent({name:"vft-empty"}),N=e.defineComponent({...C,props:{img:{},type:{default:()=>t.EmptyEnum.NO_DATA},size:{},desc:{}},setup(o){const n=d.useNamespace("empty"),a=e.getCurrentInstance(),s=new Map([[t.EmptyEnum.NO_COLLECT,{text:"暂无收藏记录",img:f.default}],[t.EmptyEnum.NO_PAGE_DATA,{text:"没有找到相关信息",size:300,img:y.default}],[t.EmptyEnum.NO_DATA,{text:"暂无数据",img:p.default}],[t.EmptyEnum.NO_FILTER,{text:"此筛选条件下无结果",img:g.default}],[t.EmptyEnum.NO_SEARCH,{text:"没有搜索结果",img:E.default}]]).get(o.type),c=e.computed(()=>o.img||s?.img),i=e.computed(()=>l.renderTNode(a,"desc",{defaultNode:s?.text})),u=m.getSizeType(o.size);return(r,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(n).b(),e.unref(u)?e.unref(n).m(e.unref(u)):""])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("image")),style:e.normalizeStyle(e.unref(u)?{}:e.unref(l.setSize)(e.unref(s)?.size||r.size))},[r.$slots.img?e.renderSlot(r.$slots,"img",{key:0}):(e.openBlock(),e.createElementBlock("img",{key:1,src:c.value,alt:""},null,8,q))],6),i.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n).e("desc"))},[e.createVNode(e.unref(l.VNode),{content:i.value},null,8,["content"])],2)):e.createCommentVNode("",!0),r.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).e("bottom"))},[e.renderSlot(r.$slots,"default")],2)):e.createCommentVNode("",!0)],2))}});exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");const s=require("@vft/utils"),p=require("../../utils/helper.cjs");require("lodash-es");require("../form/index.cjs");const f=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const t=require("./constants.cjs"),E=e.defineComponent({name:"vft-empty"}),y=e.defineComponent({...E,props:{icon:{},type:{default:()=>t.EmptyEnum.NoData},size:{default:"default"},desc:{}},setup(n){const o=f.useNamespace("empty"),u=e.getCurrentInstance(),l=new Map([[t.EmptyEnum.NotFound,{text:"页面不存在"}],[t.EmptyEnum.Delete,{text:"已删除"}],[t.EmptyEnum.NetworkDisconnect,{text:"网络已断开"}],[t.EmptyEnum.NoData,{text:"暂无数据"}],[t.EmptyEnum.PageError,{text:"系统异常"}],[t.EmptyEnum.NoFilter,{text:"此筛选条件下无结果"}],[t.EmptyEnum.NoSearch,{text:"没有搜索结果"}]]),a=e.computed(()=>l.get(n.type)),i=e.computed(()=>{switch(n.size){case"large":return 120;case"default":return 80;case"small":return 60;default:return n.size||80}}),m=e.computed(()=>s.singleAttrToObj(n.icon,"icon",{size:p.addUnit(i.value),icon:n.type})),c=e.computed(()=>s.renderTNode(u,"desc",{defaultNode:a.value?.text}));return(r,v)=>{const d=e.resolveComponent("vft-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o).b()])},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o).e("image"))},[r.$slots.img?e.renderSlot(r.$slots,"img",{key:0}):(e.openBlock(),e.createBlock(d,e.normalizeProps(e.mergeProps({key:1},m.value)),null,16))],2),c.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("desc"))},[e.createVNode(e.unref(s.VNode),{content:c.value},null,8,["content"])],2)):e.createCommentVNode("",!0),r.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).e("bottom"))},[e.renderSlot(r.$slots,"default")],2)):e.createCommentVNode("",!0)],2)}}});exports.default=y;
@@ -1,14 +1,15 @@
1
1
  export * from './constants';
2
+ export * from './types';
2
3
  export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
3
4
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
- img: {
5
- type: import("vue").PropType<string>;
5
+ icon: {
6
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
6
7
  };
7
8
  type: {
8
- type: import("vue").PropType<import("./constants").EmptyEnum>;
9
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
9
10
  };
10
11
  size: {
11
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
12
+ type: import("vue").PropType<import("../types").ComponentSize>;
12
13
  };
13
14
  desc: {
14
15
  type: import("vue").PropType<string>;
@@ -21,14 +22,14 @@ export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
21
22
  M: {};
22
23
  Defaults: {};
23
24
  }, Readonly<import("vue").ExtractPropTypes<{
24
- img: {
25
- type: import("vue").PropType<string>;
25
+ icon: {
26
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
26
27
  };
27
28
  type: {
28
- type: import("vue").PropType<import("./constants").EmptyEnum>;
29
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
29
30
  };
30
31
  size: {
31
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
32
+ type: import("vue").PropType<import("../types").ComponentSize>;
32
33
  };
33
34
  desc: {
34
35
  type: import("vue").PropType<string>;
@@ -38,14 +39,14 @@ export declare const VftEmpty: import("vft/es/utils").SFCWithInstall<{
38
39
  __isTeleport?: never;
39
40
  __isSuspense?: never;
40
41
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
41
- img: {
42
- type: import("vue").PropType<string>;
42
+ icon: {
43
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
43
44
  };
44
45
  type: {
45
- type: import("vue").PropType<import("./constants").EmptyEnum>;
46
+ type: import("vue").PropType<import("./constants").EmptyEnumType>;
46
47
  };
47
48
  size: {
48
- type: import("vue").PropType<number[] | import("../types").ComponentSize>;
49
+ type: import("vue").PropType<import("../types").ComponentSize>;
49
50
  };
50
51
  desc: {
51
52
  type: import("vue").PropType<string>;
@@ -1 +1 @@
1
- "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-empty.css");
1
+ "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-icon.css");require("vft/theme-style/vft-empty.css");
@@ -1 +1,2 @@
1
+ import 'vft/es/components/icon/style/css';
1
2
  import 'vft/theme-style/vft-empty.css';
@@ -1 +1 @@
1
- "use strict";require("vft/theme-style/src/base.scss");require("vft/theme-style/src/empty.scss");
1
+ "use strict";require("vft/theme-style/src/base.scss");require("vft/theme-style/src/icon.scss");require("vft/theme-style/src/empty.scss");
@@ -1 +1,2 @@
1
+ import 'vft/es/components/icon/style';
1
2
  import 'vft/theme-style/src/empty.scss';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,9 @@
1
+ import type { IconProps } from 'vft/es/components/icon';
2
+ import type { ComponentSize } from '../types';
3
+ import { type EmptyEnumType } from './constants';
4
+ export interface EmptyProps {
5
+ icon?: IconProps | string;
6
+ type?: EmptyEnumType;
7
+ size?: ComponentSize;
8
+ desc?: string;
9
+ }
@@ -1 +1 @@
1
- "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-clamp-toggle.css");require("vft/theme-style/vft-empty.css");require("vft/theme-style/vft-pagination.css");require("vft/theme-style/vft-autocomplete.css");require("vft/theme-style/vft-input.css");require("vft/theme-style/vft-scrollbar.css");require("vft/theme-style/vft-popper.css");require("vft/theme-style/vft-slider.css");require("vft/theme-style/vft-input-number.css");require("vft/theme-style/vft-tooltip.css");require("vft/theme-style/vft-tag.css");require("vft/theme-style/vft-checkbox.css");require("vft/theme-style/vft-radio.css");require("vft/theme-style/vft-cascader-panel.css");require("vft/theme-style/vft-cascader.css");require("vft/theme-style/vft-color-picker.css");require("vft/theme-style/vft-icon.css");require("vft/theme-style/vft-button.css");require("vft/theme-style/vft-progress.css");require("vft/theme-style/vft-upload.css");require("vft/theme-style/vft-input-tag.css");require("vft/theme-style/vft-check-tag.css");require("vft/theme-style/vft-checkbox-button.css");require("vft/theme-style/vft-checkbox-group.css");require("vft/theme-style/vft-radio-group.css");require("vft/theme-style/vft-radio-button.css");require("vft/theme-style/vft-date-picker.css");require("vft/theme-style/vft-time-picker.css");require("vft/theme-style/vft-virtual-list.css");require("vft/theme-style/vft-select.css");require("vft/theme-style/vft-switch.css");require("vft/theme-style/vft-divider.css");require("vft/theme-style/vft-row.css");require("vft/theme-style/vft-col.css");require("vft/theme-style/vft-form.css");require("vft/theme-style/vft-form-item.css");require("vft/theme-style/vft-time-select.css");require("vft/theme-style/vft-super-form.css");require("vft/theme-style/vft-skeleton-item.css");require("vft/theme-style/vft-skeleton.css");require("vft/theme-style/vft-table.css");
1
+ "use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-clamp-toggle.css");require("vft/theme-style/vft-icon.css");require("vft/theme-style/vft-empty.css");require("vft/theme-style/vft-pagination.css");require("vft/theme-style/vft-autocomplete.css");require("vft/theme-style/vft-input.css");require("vft/theme-style/vft-scrollbar.css");require("vft/theme-style/vft-popper.css");require("vft/theme-style/vft-slider.css");require("vft/theme-style/vft-input-number.css");require("vft/theme-style/vft-tooltip.css");require("vft/theme-style/vft-tag.css");require("vft/theme-style/vft-checkbox.css");require("vft/theme-style/vft-radio.css");require("vft/theme-style/vft-cascader-panel.css");require("vft/theme-style/vft-cascader.css");require("vft/theme-style/vft-color-picker.css");require("vft/theme-style/vft-button.css");require("vft/theme-style/vft-progress.css");require("vft/theme-style/vft-upload.css");require("vft/theme-style/vft-input-tag.css");require("vft/theme-style/vft-check-tag.css");require("vft/theme-style/vft-checkbox-button.css");require("vft/theme-style/vft-checkbox-group.css");require("vft/theme-style/vft-radio-group.css");require("vft/theme-style/vft-radio-button.css");require("vft/theme-style/vft-date-picker.css");require("vft/theme-style/vft-time-picker.css");require("vft/theme-style/vft-virtual-list.css");require("vft/theme-style/vft-select.css");require("vft/theme-style/vft-switch.css");require("vft/theme-style/vft-divider.css");require("vft/theme-style/vft-row.css");require("vft/theme-style/vft-col.css");require("vft/theme-style/vft-form.css");require("vft/theme-style/vft-form-item.css");require("vft/theme-style/vft-time-select.css");require("vft/theme-style/vft-super-form.css");require("vft/theme-style/vft-skeleton-item.css");require("vft/theme-style/vft-skeleton.css");require("vft/theme-style/vft-table.css");