@keyblade/pro-components 1.13.8-alpha.8 → 1.14.0

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 (156) hide show
  1. package/es/components.d.ts +7 -0
  2. package/es/global-props.d.ts +21 -2
  3. package/es/global-props.js +6 -2
  4. package/es/index.d.ts +7 -0
  5. package/es/index.js +47 -28
  6. package/es/inerface.d.ts +5 -1
  7. package/es/pro-calendar/calendar.vue.d.ts +75 -0
  8. package/es/pro-calendar/calendar.vue.js +159 -0
  9. package/es/pro-calendar/calendar.vue3.js +5 -0
  10. package/es/pro-calendar/enum.d.ts +6 -0
  11. package/es/pro-calendar/enum.js +4 -0
  12. package/es/pro-calendar/header.vue.d.ts +35 -0
  13. package/es/pro-calendar/header.vue.js +146 -0
  14. package/es/pro-calendar/header.vue2.js +4 -0
  15. package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
  16. package/es/pro-calendar/hooks/useCellClassName.js +40 -0
  17. package/es/pro-calendar/index.d.ts +117 -0
  18. package/es/pro-calendar/index.js +12 -0
  19. package/es/pro-calendar/interface.d.ts +89 -0
  20. package/es/pro-calendar/month.d.ts +5 -0
  21. package/es/pro-calendar/month.js +53 -0
  22. package/es/pro-calendar/month.vue.d.ts +22 -0
  23. package/es/pro-calendar/month.vue.js +126 -0
  24. package/es/pro-calendar/month.vue2.js +4 -0
  25. package/es/pro-calendar/week.vue.d.ts +3 -0
  26. package/es/pro-calendar/week.vue.js +34 -0
  27. package/es/pro-calendar/week.vue2.js +4 -0
  28. package/es/pro-calendar/year.vue.d.ts +3 -0
  29. package/es/pro-calendar/year.vue.js +123 -0
  30. package/es/pro-calendar/year.vue2.js +4 -0
  31. package/es/pro-date-range-picker/index.d.ts +183 -13
  32. package/es/pro-date-range-picker/index.js +6 -7
  33. package/es/pro-date-range-picker/interface.d.ts +38 -0
  34. package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
  35. package/es/pro-date-range-picker/pro-date-range-picker.vue.js +1 -1
  36. package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +127 -97
  37. package/es/pro-dates-picker/index.d.ts +49 -0
  38. package/es/pro-dates-picker/index.js +11 -0
  39. package/es/pro-dates-picker/index.vue.d.ts +29 -0
  40. package/es/pro-dates-picker/index.vue.js +135 -0
  41. package/es/pro-dates-picker/index.vue3.js +5 -0
  42. package/es/pro-dates-picker/interface.d.ts +38 -0
  43. package/es/pro-dates-picker/util.d.ts +12 -0
  44. package/es/pro-dates-picker/util.js +9 -0
  45. package/es/pro-find-password/enum.d.ts +8 -0
  46. package/es/pro-find-password/enum.js +4 -0
  47. package/es/pro-find-password/index.d.ts +11 -0
  48. package/es/pro-find-password/index.js +11 -0
  49. package/es/pro-find-password/index.vue.d.ts +4459 -0
  50. package/es/pro-find-password/index.vue.js +176 -0
  51. package/es/pro-find-password/index.vue3.js +5 -0
  52. package/es/pro-find-password/interface.d.ts +45 -0
  53. package/es/pro-find-password/reset-password.vue.d.ts +591 -0
  54. package/es/pro-find-password/reset-password.vue.js +179 -0
  55. package/es/pro-find-password/reset-password.vue2.js +4 -0
  56. package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
  57. package/es/pro-find-password/verify-user-name.vue.js +112 -0
  58. package/es/pro-find-password/verify-user-name.vue3.js +5 -0
  59. package/es/pro-footer-bar/index.d.ts +6 -3
  60. package/es/pro-footer-bar/index.js +6 -7
  61. package/es/pro-footer-bar/index.vue.d.ts +1 -1
  62. package/es/pro-footer-bar/index.vue.js +2 -2
  63. package/es/pro-footer-bar/index.vue2.js +24 -26
  64. package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +1 -0
  65. package/es/pro-form-group/index.d.ts +7 -6
  66. package/es/pro-form-group/index.js +6 -8
  67. package/es/pro-form-group/index.vue.d.ts +2 -2
  68. package/es/pro-form-group/index.vue.js +1 -1
  69. package/es/pro-form-group/index.vue2.js +31 -32
  70. package/es/pro-image-upload/cropper.vue.js +2 -2
  71. package/es/pro-image-upload/cropper.vue2.js +200 -190
  72. package/es/pro-image-upload/image-upload.vue.d.ts +1124 -371
  73. package/es/pro-image-upload/image-upload.vue.js +178 -144
  74. package/es/pro-image-upload/index.d.ts +1727 -1001
  75. package/es/pro-image-upload/index.js +6 -8
  76. package/es/pro-keep-alive-router-view/index.d.ts +1 -0
  77. package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
  78. package/es/pro-layout/hooks.d.ts +80 -1
  79. package/es/pro-layout/hooks.js +133 -84
  80. package/es/pro-layout/index.d.ts +9 -6
  81. package/es/pro-layout/index.js +6 -11
  82. package/es/pro-layout/pro-layout.vue.d.ts +4 -2
  83. package/es/pro-layout/pro-layout.vue.js +220 -208
  84. package/es/pro-loader/index.d.ts +43 -0
  85. package/es/pro-loader/index.js +11 -0
  86. package/es/pro-loader/index.vue.d.ts +28 -0
  87. package/es/pro-loader/index.vue.js +112 -0
  88. package/es/pro-loader/index.vue3.js +5 -0
  89. package/es/pro-loader/interface.d.ts +16 -0
  90. package/es/pro-login/enum.d.ts +6 -0
  91. package/es/pro-login/enum.js +4 -0
  92. package/es/pro-login/form-mobile.vue.d.ts +797 -0
  93. package/es/pro-login/form-mobile.vue.js +146 -0
  94. package/es/pro-login/form-mobile.vue2.js +4 -0
  95. package/es/pro-login/form-password.vue.d.ts +584 -0
  96. package/es/pro-login/form-password.vue.js +99 -0
  97. package/es/pro-login/form-password.vue2.js +4 -0
  98. package/es/pro-login/index.d.ts +11 -0
  99. package/es/pro-login/index.js +11 -0
  100. package/es/pro-login/index.vue.d.ts +4429 -0
  101. package/es/pro-login/index.vue.js +105 -0
  102. package/es/pro-login/index.vue3.js +5 -0
  103. package/es/pro-login/interface.d.ts +72 -0
  104. package/es/pro-login/regexp.d.ts +17 -0
  105. package/es/pro-login/regexp.js +28 -0
  106. package/es/pro-menu/index.d.ts +18 -80
  107. package/es/pro-menu/index.js +6 -7
  108. package/es/pro-menu/interface.d.ts +31 -0
  109. package/es/pro-menu/menu-item.vue.d.ts +27 -0
  110. package/es/pro-menu/menu-item.vue.js +35 -0
  111. package/es/pro-menu/menu-item.vue2.js +4 -0
  112. package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
  113. package/es/pro-menu/pro-menu-item.vue.js +63 -0
  114. package/es/pro-menu/pro-menu-item.vue2.js +4 -0
  115. package/es/pro-menu/pro-menu.vue.d.ts +9 -55
  116. package/es/pro-menu/pro-menu.vue.js +36 -119
  117. package/es/pro-menu/sub-menu.vue.d.ts +22 -0
  118. package/es/pro-menu/sub-menu.vue.js +55 -0
  119. package/es/pro-menu/sub-menu.vue2.js +4 -0
  120. package/es/pro-menu/util.d.ts +9 -0
  121. package/es/pro-menu/util.js +7 -0
  122. package/es/pro-page-container/constant.d.ts +2 -0
  123. package/es/pro-page-container/constant.js +9 -0
  124. package/es/pro-page-container/index.d.ts +7 -21
  125. package/es/pro-page-container/index.js +6 -8
  126. package/es/pro-page-container/interface.d.ts +12 -0
  127. package/es/pro-page-container/pro-page-container.vue.d.ts +4 -15
  128. package/es/pro-page-container/pro-page-container.vue.js +58 -38
  129. package/es/pro-page-header/constant.d.ts +2 -0
  130. package/es/pro-page-header/constant.js +13 -0
  131. package/es/pro-page-header/index.d.ts +12 -146
  132. package/es/pro-page-header/index.js +6 -8
  133. package/es/pro-page-header/interface.d.ts +21 -0
  134. package/es/pro-page-header/pro-page-header.vue.d.ts +18 -103
  135. package/es/pro-page-header/pro-page-header.vue.js +141 -124
  136. package/es/pro-reuse-tabs/index.d.ts +8 -6
  137. package/es/pro-reuse-tabs/index.js +6 -7
  138. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
  139. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
  140. package/es/pro-table/index.d.ts +18 -18
  141. package/es/pro-table/index.js +6 -7
  142. package/es/pro-table/index.vue.d.ts +6 -6
  143. package/es/pro-table/index.vue.js +94 -39
  144. package/es/pro-table/interface.d.ts +73 -65
  145. package/es/pro-textarea/index.d.ts +7 -5
  146. package/es/pro-textarea/index.js +5 -6
  147. package/es/pro-textarea/index.vue.d.ts +1 -1
  148. package/es/pro-textarea/index.vue.js +1 -1
  149. package/es/pro-textarea/index.vue2.js +14 -16
  150. package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
  151. package/es/style.css +1 -1
  152. package/es/utils.d.ts +6 -0
  153. package/es/utils.js +7 -0
  154. package/package.json +5 -4
  155. package/es/pro-date-range-picker/type.d.ts +0 -22
  156. package/es/pro-page-container/inerface.d.ts +0 -12
@@ -1,12 +1,11 @@
1
- import o from "./pro-reuse-tabs.vue.js";
1
+ import s from "./pro-reuse-tabs.vue.js";
2
2
  /* empty css */
3
- import { Tabs as e } from "@arco-design/web-vue";
4
- const m = Object.assign(o, {
5
- install: (s) => {
6
- s.use(e), s.component("KbProReuseTabs", o);
3
+ const a = Object.assign(s, {
4
+ install: (o) => {
5
+ o.component("KbProReuseTabs", s);
7
6
  }
8
7
  });
9
8
  export {
10
- m as ProReuseTabs,
11
- m as default
9
+ a as ProReuseTabs,
10
+ a as default
12
11
  };
@@ -52,8 +52,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
52
52
  "onTab-delete"?: ((_key: string) => any) | undefined;
53
53
  }>, {
54
54
  tabs: IProTab[];
55
- tabsSize: "small" | "mini" | "medium" | "large";
56
- tabsType: "line" | "text" | "card" | "card-gutter" | "rounded" | "capsule";
55
+ tabsSize: "small" | "medium" | "mini" | "large";
56
+ tabsType: "text" | "line" | "card" | "card-gutter" | "rounded" | "capsule";
57
57
  tabsHeaderPadding: boolean;
58
58
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
59
59
  export default _default;
@@ -1,5 +1,6 @@
1
- import { defineComponent as y, computed as f, resolveComponent as l, createElementBlock as s, openBlock as a, normalizeClass as k, createVNode as g, withCtx as v, Fragment as h, renderList as C, createBlock as S } from "vue";
2
- const _ = "keyblade-pro-reuse-tabs", q = /* @__PURE__ */ y({
1
+ import { defineComponent as m, computed as y, createElementBlock as d, openBlock as n, normalizeClass as f, createVNode as p, unref as l, withCtx as k, Fragment as g, renderList as h, createBlock as v } from "vue";
2
+ import { Tabs as S, TabPane as T } from "@arco-design/web-vue";
3
+ const z = "keyblade-pro-reuse-tabs", x = /* @__PURE__ */ m({
3
4
  __name: "pro-reuse-tabs",
4
5
  props: {
5
6
  tabs: {
@@ -28,43 +29,40 @@ const _ = "keyblade-pro-reuse-tabs", q = /* @__PURE__ */ y({
28
29
  "tab-click": (e) => !0,
29
30
  "tab-delete": (e) => !0
30
31
  },
31
- setup(e, { emit: d }) {
32
- const o = e, n = d, c = f(() => {
33
- var t;
34
- return ((t = o.tabs.find((r) => r.active)) == null ? void 0 : t.name) ?? void 0;
32
+ setup(e, { emit: s }) {
33
+ const o = e, i = s, c = y(() => {
34
+ var t, r;
35
+ return (r = (t = o.tabs.find((a) => a.active)) == null ? void 0 : t.name) != null ? r : void 0;
35
36
  }), u = (t) => {
36
- n("tab-click", String(t));
37
+ i("tab-click", String(t));
37
38
  }, b = (t) => {
38
- n("tab-delete", String(t));
39
- };
40
- return (t, r) => {
41
- const m = l("a-tab-pane"), p = l("a-tabs");
42
- return a(), s("div", {
43
- class: k(_)
44
- }, [
45
- g(p, {
46
- "active-key": c.value,
47
- size: e.tabsSize,
48
- type: e.tabsType,
49
- "header-padding": e.tabsHeaderPadding,
50
- editable: e.tabs.length > 1,
51
- "hide-content": "",
52
- "destroy-on-hide": "",
53
- onTabClick: u,
54
- onDelete: b
55
- }, {
56
- default: v(() => [
57
- (a(!0), s(h, null, C(e.tabs, (i) => (a(), S(m, {
58
- key: i.name,
59
- title: i.title
60
- }, null, 8, ["title"]))), 128))
61
- ]),
62
- _: 1
63
- }, 8, ["active-key", "size", "type", "header-padding", "editable"])
64
- ]);
39
+ i("tab-delete", String(t));
65
40
  };
41
+ return (t, r) => (n(), d("div", {
42
+ class: f(z)
43
+ }, [
44
+ p(l(S), {
45
+ "active-key": c.value,
46
+ size: e.tabsSize,
47
+ type: e.tabsType,
48
+ "header-padding": e.tabsHeaderPadding,
49
+ editable: e.tabs.length > 1,
50
+ "hide-content": "",
51
+ "destroy-on-hide": "",
52
+ onTabClick: u,
53
+ onDelete: b
54
+ }, {
55
+ default: k(() => [
56
+ (n(!0), d(g, null, h(e.tabs, (a) => (n(), v(l(T), {
57
+ key: a.name,
58
+ title: a.title
59
+ }, null, 8, ["title"]))), 128))
60
+ ]),
61
+ _: 1
62
+ }, 8, ["active-key", "size", "type", "header-padding", "editable"])
63
+ ]));
66
64
  }
67
65
  });
68
66
  export {
69
- q as default
67
+ x as default
70
68
  };
@@ -1,20 +1,19 @@
1
1
  import { App } from 'vue';
2
2
  declare const ProTable: {
3
3
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./interface').IProTable> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
4
- data: any[];
5
4
  size: "mini" | "medium" | "large" | "small";
6
5
  loading: boolean | Record<string, any>;
7
- scrollbar: boolean | any;
8
- bordered: boolean | any;
9
- columns: any[];
6
+ data: any[];
7
+ bordered: boolean | import('@arco-design/web-vue').TableBorder;
10
8
  hoverable: boolean;
11
- pagination: boolean | any;
9
+ scrollbar: boolean | any;
10
+ columns: Partial<import('./interface').IProTableColumn>[];
11
+ pagination: boolean | import('@arco-design/web-vue').PaginationProps;
12
12
  stripe: boolean;
13
13
  tableLayoutFixed: boolean;
14
14
  pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
15
15
  indentSize: number;
16
16
  rowKey: string;
17
- showHeader: boolean;
18
17
  spanAll: boolean;
19
18
  filterIconAlignLeft: boolean;
20
19
  hideExpandButtonOnEmpty: boolean;
@@ -31,20 +30,19 @@ declare const ProTable: {
31
30
  M: {};
32
31
  Defaults: {};
33
32
  }, Readonly<import('./interface').IProTable> & Readonly<{}>, {}, {}, {}, {}, {
34
- data: any[];
35
33
  size: "mini" | "medium" | "large" | "small";
36
34
  loading: boolean | Record<string, any>;
37
- scrollbar: boolean | any;
38
- bordered: boolean | any;
39
- columns: any[];
35
+ data: any[];
36
+ bordered: boolean | import('@arco-design/web-vue').TableBorder;
40
37
  hoverable: boolean;
41
- pagination: boolean | any;
38
+ scrollbar: boolean | any;
39
+ columns: Partial<import('./interface').IProTableColumn>[];
40
+ pagination: boolean | import('@arco-design/web-vue').PaginationProps;
42
41
  stripe: boolean;
43
42
  tableLayoutFixed: boolean;
44
43
  pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
45
44
  indentSize: number;
46
45
  rowKey: string;
47
- showHeader: boolean;
48
46
  spanAll: boolean;
49
47
  filterIconAlignLeft: boolean;
50
48
  hideExpandButtonOnEmpty: boolean;
@@ -58,20 +56,19 @@ declare const ProTable: {
58
56
  __isTeleport?: never;
59
57
  __isSuspense?: never;
60
58
  } & import('vue').ComponentOptionsBase<Readonly<import('./interface').IProTable> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
61
- data: any[];
62
59
  size: "mini" | "medium" | "large" | "small";
63
60
  loading: boolean | Record<string, any>;
64
- scrollbar: boolean | any;
65
- bordered: boolean | any;
66
- columns: any[];
61
+ data: any[];
62
+ bordered: boolean | import('@arco-design/web-vue').TableBorder;
67
63
  hoverable: boolean;
68
- pagination: boolean | any;
64
+ scrollbar: boolean | any;
65
+ columns: Partial<import('./interface').IProTableColumn>[];
66
+ pagination: boolean | import('@arco-design/web-vue').PaginationProps;
69
67
  stripe: boolean;
70
68
  tableLayoutFixed: boolean;
71
69
  pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
72
70
  indentSize: number;
73
71
  rowKey: string;
74
- showHeader: boolean;
75
72
  spanAll: boolean;
76
73
  filterIconAlignLeft: boolean;
77
74
  hideExpandButtonOnEmpty: boolean;
@@ -87,5 +84,8 @@ declare const ProTable: {
87
84
  }) & {
88
85
  install: (app: App) => void;
89
86
  };
87
+ /** 导出类型 */
88
+ export * from './interface';
89
+ /** 导出组件 */
90
90
  export { ProTable };
91
91
  export default ProTable;
@@ -1,12 +1,11 @@
1
- import t from "./index.vue.js";
1
+ import o from "./index.vue.js";
2
2
  /* empty css */
3
- import { Table as e } from "@arco-design/web-vue";
4
- const s = Object.assign(t, {
5
- install: (o) => {
6
- o.use(e), o.component("KbProTable", t);
3
+ const n = Object.assign(o, {
4
+ install: (t) => {
5
+ t.component("KbProTable", o);
7
6
  }
8
7
  });
9
8
  export {
10
- s as ProTable,
11
- s as default
9
+ n as ProTable,
10
+ n as default
12
11
  };
@@ -1,3 +1,4 @@
1
+ import { PaginationProps } from '@arco-design/web-vue';
1
2
  import { IProTable } from './interface';
2
3
  declare function __VLS_template(): {
3
4
  attrs: Partial<{}>;
@@ -9,20 +10,19 @@ declare function __VLS_template(): {
9
10
  };
10
11
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
12
  declare const __VLS_component: import('vue').DefineComponent<IProTable, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IProTable> & Readonly<{}>, {
12
- data: any[];
13
13
  size: "mini" | "medium" | "large" | "small";
14
14
  loading: boolean | Record<string, any>;
15
- scrollbar: boolean | any;
16
- bordered: boolean | any;
17
- columns: any[];
15
+ data: any[];
16
+ bordered: boolean | import('@arco-design/web-vue').TableBorder;
18
17
  hoverable: boolean;
19
- pagination: boolean | any;
18
+ scrollbar: boolean | any;
19
+ columns: Partial<import('./interface').IProTableColumn>[];
20
+ pagination: boolean | PaginationProps;
20
21
  stripe: boolean;
21
22
  tableLayoutFixed: boolean;
22
23
  pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
23
24
  indentSize: number;
24
25
  rowKey: string;
25
- showHeader: boolean;
26
26
  spanAll: boolean;
27
27
  filterIconAlignLeft: boolean;
28
28
  hideExpandButtonOnEmpty: boolean;
@@ -1,23 +1,53 @@
1
- import { defineComponent as B, useSlots as h, useAttrs as x, computed as s, resolveComponent as S, createElementBlock as r, openBlock as d, normalizeClass as u, createCommentVNode as k, createVNode as v, renderSlot as p, mergeProps as w, toHandlers as E, createSlots as P, renderList as z, unref as K, withCtx as R, normalizeProps as _, guardReactiveProps as L } from "vue";
2
- import { conclude as A } from "vue-global-config";
3
- import { globalProps as M } from "../global-props.js";
4
- const i = "keyblade-pro-table", F = /* @__PURE__ */ B({
1
+ var M = Object.defineProperty, N = Object.defineProperties;
2
+ var R = Object.getOwnPropertyDescriptors;
3
+ var B = Object.getOwnPropertySymbols;
4
+ var I = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
5
+ var x = (o, e, t) => e in o ? M(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, v = (o, e) => {
6
+ for (var t in e || (e = {}))
7
+ I.call(e, t) && x(o, t, e[t]);
8
+ if (B)
9
+ for (var t of B(e))
10
+ O.call(e, t) && x(o, t, e[t]);
11
+ return o;
12
+ }, k = (o, e) => N(o, R(e));
13
+ var S = (o, e, t) => new Promise((f, u) => {
14
+ var y = (s) => {
15
+ try {
16
+ i(t.next(s));
17
+ } catch (a) {
18
+ u(a);
19
+ }
20
+ }, m = (s) => {
21
+ try {
22
+ i(t.throw(s));
23
+ } catch (a) {
24
+ u(a);
25
+ }
26
+ }, i = (s) => s.done ? f(s.value) : Promise.resolve(s.value).then(y, m);
27
+ i((t = t.apply(o, e)).next());
28
+ });
29
+ import { defineComponent as A, useSlots as L, useAttrs as j, computed as C, createElementBlock as w, openBlock as b, normalizeClass as g, createCommentVNode as E, createVNode as _, renderSlot as z, unref as p, mergeProps as $, createSlots as P, withCtx as h, normalizeStyle as T, createElementVNode as K, withModifiers as D, createBlock as F, toDisplayString as H, renderList as V, normalizeProps as U, guardReactiveProps as q } from "vue";
30
+ import { Table as G, Tooltip as J, Message as Q } from "@arco-design/web-vue";
31
+ import { IconCopy as W } from "@arco-design/web-vue/es/icon";
32
+ import { conclude as X } from "vue-global-config";
33
+ import { globalProps as Y } from "../global-props.js";
34
+ import { useClipboard as Z } from "@vueuse/core";
35
+ const ee = ["onClick"], d = "keyblade-pro-table", de = /* @__PURE__ */ A({
5
36
  __name: "index",
6
37
  props: {
7
38
  size: { default: "large" },
8
39
  scrollbar: { type: Boolean, default: !0 },
9
40
  data: { default: () => [] },
10
41
  loading: { type: [Boolean, Object], default: !1 },
11
- bordered: { type: Boolean, default: { cell: !0 } },
42
+ bordered: { type: [Boolean, Object], default: void 0 },
12
43
  columns: { default: () => [] },
13
44
  hoverable: { type: Boolean, default: !0 },
14
- pagination: { type: Boolean, default: !0 },
45
+ pagination: { type: [Boolean, Object], default: !0 },
15
46
  stripe: { type: Boolean, default: !1 },
16
47
  tableLayoutFixed: { type: Boolean, default: !1 },
17
48
  pagePosition: { default: "tr" },
18
49
  indentSize: { default: 16 },
19
50
  rowKey: { default: "key" },
20
- showHeader: { type: Boolean, default: !0 },
21
51
  spanAll: { type: Boolean, default: !1 },
22
52
  filterIconAlignLeft: { type: Boolean, default: !1 },
23
53
  hideExpandButtonOnEmpty: { type: Boolean, default: !1 },
@@ -47,8 +77,6 @@ const i = "keyblade-pro-table", F = /* @__PURE__ */ B({
47
77
  onPageChange: {},
48
78
  onPageSizeChange: {},
49
79
  onExpand: {},
50
- "onUpdate:selectedKeys": {},
51
- "onUpdate:expandedKeys": {},
52
80
  onExpandedChange: {},
53
81
  onSelectAll: {},
54
82
  onSelectionChange: {},
@@ -63,39 +91,66 @@ const i = "keyblade-pro-table", F = /* @__PURE__ */ B({
63
91
  onRowDblclick: {},
64
92
  onCellDblclick: {},
65
93
  onRowContextmenu: {},
66
- onCellContextmenu: {}
94
+ onCellContextmenu: {},
95
+ "onUpdate:selectedKeys": {},
96
+ "onUpdate:expandedKeys": {}
67
97
  },
68
- setup(f) {
69
- const c = f, y = h(), m = x(), C = s(() => {
70
- const e = {};
71
- for (const [o, t] of Object.entries(m))
72
- o.startsWith("on") && typeof t == "function" && (e[o] = t);
73
- return e;
74
- }), g = s(() => A([c, M.table]) || {});
75
- return (e, o) => {
76
- var a, l;
77
- const t = S("a-table");
78
- return d(), r("div", {
79
- class: u(i)
98
+ setup(o) {
99
+ const e = o, t = L(), { copy: f } = Z(), u = j(), y = C(() => X([e, Y.table || {}]) || {}), m = C(() => {
100
+ var l, r;
101
+ return !((l = e.pagination) == null ? void 0 : l.total) && !((r = e.data) != null && r.length) && t["pagination-left"];
102
+ }), i = C(() => {
103
+ var a;
104
+ return (a = e.columns) == null ? void 0 : a.map((l) => l.clipboard ? k(v({}, l), {
105
+ hover: l.hover === void 0 ? !0 : l.hover,
106
+ slotName: `${d}-clipboard`
107
+ }) : l);
108
+ }), s = (a) => S(null, null, function* () {
109
+ try {
110
+ yield f(a), Q.success("拷贝成功!");
111
+ } catch (l) {
112
+ console.info(l);
113
+ }
114
+ });
115
+ return (a, l) => (b(), w("div", {
116
+ class: g(d)
117
+ }, [
118
+ m.value ? (b(), w("div", {
119
+ key: 0,
120
+ class: g(`${d}-header`)
121
+ }, [
122
+ z(a.$slots, "pagination-left")
123
+ ], 2)) : E("", !0),
124
+ _(p(G), $($(y.value, p(u)), { columns: i.value }), P({
125
+ [`${d}-clipboard`]: h(({ record: r, column: n }) => [
126
+ _(p(J), {
127
+ style: T({ display: n.ellipsis && n.hover ? "" : "none" }),
128
+ content: r[n.dataIndex]
129
+ }, {
130
+ default: h(() => [
131
+ K("div", {
132
+ class: g([`${d}-clipboard`, n.ellipsis ? `${d}-ellipsis` : ""]),
133
+ onClick: D((c) => s(r[n.dataIndex]), ["stop"])
134
+ }, [
135
+ K("span", null, H(r[n.dataIndex]), 1),
136
+ n.copyIcon ? (b(), F(p(W), { key: 0 })) : E("", !0)
137
+ ], 10, ee)
138
+ ]),
139
+ _: 2
140
+ }, 1032, ["style", "content"])
141
+ ]),
142
+ _: 2
80
143
  }, [
81
- !((a = e.pagination) != null && a.total) && !((l = e.data) != null && l.length) ? (d(), r("div", {
82
- key: 0,
83
- class: u(`${i}-header`)
84
- }, [
85
- p(e.$slots, "pagination-left")
86
- ], 2)) : k("", !0),
87
- v(t, w(g.value, E(C.value)), P({ _: 2 }, [
88
- z(K(y), (N, n) => ({
89
- name: n,
90
- fn: R((b) => [
91
- p(e.$slots, n, _(L(b ?? {})))
92
- ])
93
- }))
94
- ]), 1040)
95
- ]);
96
- };
144
+ V(p(t), (r, n) => ({
145
+ name: n,
146
+ fn: h((c) => [
147
+ z(a.$slots, n, U(q(c != null ? c : {})))
148
+ ])
149
+ }))
150
+ ]), 1040, ["columns"])
151
+ ]));
97
152
  }
98
153
  });
99
154
  export {
100
- F as default
155
+ de as default
101
156
  };
@@ -1,73 +1,80 @@
1
+ import { TableColumnData, TableBorder, PaginationProps } from '@arco-design/web-vue';
2
+ export interface IProTableColumn extends TableColumnData {
3
+ /** 带复制功能 */
4
+ clipboard?: boolean;
5
+ /** 悬停显示完整内容,ellipsis为true时生效,默认ture */
6
+ hover?: boolean;
7
+ /** 显示复制图标 */
8
+ copyIcon?: boolean;
9
+ }
1
10
  /**
2
11
  * table 组件属性接口
3
12
  */
4
- export interface IProTable {
13
+ export type IProTable = {
5
14
  /** 表格尺寸 */
6
- 'size'?: 'mini' | 'medium' | 'large' | 'small';
15
+ size?: 'mini' | 'medium' | 'large' | 'small';
7
16
  /** 滚动条配置 */
8
- 'scrollbar'?: boolean | any;
17
+ scrollbar?: boolean | any;
9
18
  /** 表格数据 */
10
- 'data'?: any[];
19
+ data?: any[];
11
20
  /** 加载状态 */
12
- 'loading'?: boolean | Record<string, any>;
21
+ loading?: boolean | Record<string, any>;
13
22
  /** 边框配置 */
14
- 'bordered'?: boolean | any;
23
+ bordered?: boolean | TableBorder;
15
24
  /** 表格列配置 */
16
- 'columns'?: any[];
25
+ columns?: Partial<IProTableColumn>[];
17
26
  /** 是否开启悬停效果 */
18
- 'hoverable'?: boolean;
27
+ hoverable?: boolean;
19
28
  /** 分页配置 */
20
- 'pagination'?: boolean | any;
29
+ pagination?: boolean | PaginationProps;
21
30
  /** 是否显示斑马纹 */
22
- 'stripe'?: boolean;
31
+ stripe?: boolean;
23
32
  /** 是否固定表格布局 */
24
- 'tableLayoutFixed'?: boolean;
33
+ tableLayoutFixed?: boolean;
25
34
  /** 分页位置 */
26
- 'pagePosition'?: 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br';
35
+ pagePosition?: 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br';
27
36
  /** 缩进大小 */
28
- 'indentSize'?: number;
37
+ indentSize?: number;
29
38
  /** 行键字段 */
30
- 'rowKey'?: string;
31
- /** 是否显示表头 */
32
- 'showHeader'?: boolean;
39
+ rowKey?: string;
33
40
  /** 是否跨行跨列 */
34
- 'spanAll'?: boolean;
41
+ spanAll?: boolean;
35
42
  /** 筛选图标是否左对齐 */
36
- 'filterIconAlignLeft'?: boolean;
43
+ filterIconAlignLeft?: boolean;
37
44
  /** 空数据时是否隐藏展开按钮 */
38
- 'hideExpandButtonOnEmpty'?: boolean;
45
+ hideExpandButtonOnEmpty?: boolean;
39
46
  /** 列是否可调整大小 */
40
- 'columnResizable'?: boolean;
47
+ columnResizable?: boolean;
41
48
  /** 汇总行文本 */
42
- 'summaryText'?: string;
49
+ summaryText?: string;
43
50
  /** 是否默认展开所有行 */
44
- 'defaultExpandAllRows'?: boolean;
51
+ defaultExpandAllRows?: boolean;
45
52
  /** 固定表头配置 */
46
- 'stickyHeader'?: number | boolean;
53
+ stickyHeader?: number | boolean;
47
54
  /** 是否显示空树 */
48
- 'showEmptyTree'?: boolean;
55
+ showEmptyTree?: boolean;
49
56
  /** 滚动配置 */
50
- 'scroll'?: {
57
+ scroll?: {
51
58
  x?: string | number;
52
59
  y?: string | number;
53
60
  minWidth?: string | number;
54
61
  maxHeight?: string | number;
55
62
  };
56
63
  /** 汇总行配置 */
57
- 'summary'?: boolean | ((params: {
64
+ summary?: boolean | ((params: {
58
65
  columns: any[];
59
66
  data: any[];
60
67
  }) => any[]);
61
68
  /** 自定义组件 */
62
- 'components'?: any;
69
+ components?: any;
63
70
  /** 虚拟列表配置 */
64
- 'virtualListProps'?: any;
71
+ virtualListProps?: any;
65
72
  /** 行选择配置 */
66
- 'rowSelection'?: any;
73
+ rowSelection?: any;
67
74
  /** 行展开配置 */
68
- 'expandable'?: any;
75
+ expandable?: any;
69
76
  /** 单元格合并方法 */
70
- 'spanMethod'?: (data: {
77
+ spanMethod?: (data: {
71
78
  record: any;
72
79
  column: any;
73
80
  rowIndex: number;
@@ -77,15 +84,15 @@ export interface IProTable {
77
84
  colspan?: number;
78
85
  };
79
86
  /** 加载更多回调 */
80
- 'loadMore'?: (record: any, done: (children?: any[]) => void) => void;
87
+ loadMore?: (record: any, done: (children?: any[]) => void) => void;
81
88
  /** 行类名 */
82
- 'rowClass'?: string | any[] | Record<string, any> | ((record: any, rowIndex: number) => any);
89
+ rowClass?: string | any[] | Record<string, any> | ((record: any, rowIndex: number) => any);
83
90
  /** 拖拽配置 */
84
- 'draggable'?: any;
91
+ draggable?: any;
85
92
  /** 行号配置 */
86
- 'rowNumber'?: boolean | Record<string, any>;
93
+ rowNumber?: boolean | Record<string, any>;
87
94
  /** 汇总行单元格合并方法 */
88
- 'summarySpanMethod'?: (data: {
95
+ summarySpanMethod?: (data: {
89
96
  record: any;
90
97
  column: any;
91
98
  rowIndex: number;
@@ -95,56 +102,57 @@ export interface IProTable {
95
102
  colspan?: number;
96
103
  };
97
104
  /** 选中的行键 */
98
- 'selectedKeys'?: (string | number)[];
105
+ selectedKeys?: (string | number)[];
99
106
  /** 默认选中的行键 */
100
- 'defaultSelectedKeys'?: (string | number)[];
107
+ defaultSelectedKeys?: (string | number)[];
101
108
  /** 展开的行键 */
102
- 'expandedKeys'?: (string | number)[];
109
+ expandedKeys?: (string | number)[];
103
110
  /** 默认展开的行键 */
104
- 'defaultExpandedKeys'?: (string | number)[];
111
+ defaultExpandedKeys?: (string | number)[];
105
112
  /** 数据变化事件 */
106
- 'onChange'?: (data: any[], extra: any, currentData: any[]) => any;
113
+ onChange?: (data: any[], extra: any, currentData: any[]) => any;
107
114
  /** 行选择事件 */
108
- 'onSelect'?: (rowKeys: (string | number)[], rowKey: string | number, record: any) => any;
115
+ onSelect?: (rowKeys: (string | number)[], rowKey: string | number, record: any) => any;
109
116
  /** 页码变化事件 */
110
- 'onPageChange'?: (page: number) => any;
117
+ onPageChange?: (page: number) => any;
111
118
  /** 每页大小变化事件 */
112
- 'onPageSizeChange'?: (pageSize: number) => any;
119
+ onPageSizeChange?: (pageSize: number) => any;
113
120
  /** 行展开事件 */
114
- 'onExpand'?: (rowKey: string | number, record: any) => any;
115
- /** 选中行键更新事件 */
116
- 'onUpdate:selectedKeys'?: (rowKeys: (string | number)[]) => any;
117
- /** 展开行键更新事件 */
118
- 'onUpdate:expandedKeys'?: (rowKeys: (string | number)[]) => any;
121
+ onExpand?: (rowKey: string | number, record: any) => any;
119
122
  /** 展开状态变化事件 */
120
- 'onExpandedChange'?: (rowKeys: (string | number)[]) => any;
123
+ onExpandedChange?: (rowKeys: (string | number)[]) => any;
121
124
  /** 全选事件 */
122
- 'onSelectAll'?: (checked: boolean) => any;
125
+ onSelectAll?: (checked: boolean) => any;
123
126
  /** 选择变化事件 */
124
- 'onSelectionChange'?: (rowKeys: (string | number)[]) => any;
127
+ onSelectionChange?: (rowKeys: (string | number)[]) => any;
125
128
  /** 排序变化事件 */
126
- 'onSorterChange'?: (dataIndex: string, direction: string) => any;
129
+ onSorterChange?: (dataIndex: string, direction: string) => any;
127
130
  /** 筛选变化事件 */
128
- 'onFilterChange'?: (dataIndex: string, filteredValues: string[]) => any;
131
+ onFilterChange?: (dataIndex: string, filteredValues: string[]) => any;
129
132
  /** 单元格鼠标进入事件 */
130
- 'onCellMouseEnter'?: (record: any, column: any, ev: Event) => any;
133
+ onCellMouseEnter?: (record: any, column: any, ev: Event) => any;
131
134
  /** 单元格鼠标离开事件 */
132
- 'onCellMouseLeave'?: (record: any, column: any, ev: Event) => any;
135
+ onCellMouseLeave?: (record: any, column: any, ev: Event) => any;
133
136
  /** 单元格点击事件 */
134
- 'onCellClick'?: (record: any, column: any, ev: Event) => any;
137
+ onCellClick?: (record: any, column: any, ev: Event) => any;
135
138
  /** 行点击事件 */
136
- 'onRowClick'?: (record: any, ev: Event) => any;
139
+ onRowClick?: (record: any, ev: Event) => any;
137
140
  /** 表头点击事件 */
138
- 'onHeaderClick'?: (column: any, ev: Event) => any;
141
+ onHeaderClick?: (column: any, ev: Event) => any;
139
142
  /** 列调整大小事件 */
140
- 'onColumnResize'?: (dataIndex: string, width: number) => any;
143
+ onColumnResize?: (dataIndex: string, width: number) => any;
141
144
  /** 行双击事件 */
142
- 'onRowDblclick'?: (record: any, ev: Event) => any;
145
+ onRowDblclick?: (record: any, ev: Event) => any;
143
146
  /** 单元格双击事件 */
144
- 'onCellDblclick'?: (record: any, column: any, ev: Event) => any;
147
+ onCellDblclick?: (record: any, column: any, ev: Event) => any;
145
148
  /** 行右键菜单事件 */
146
- 'onRowContextmenu'?: (record: any, ev: Event) => any;
149
+ onRowContextmenu?: (record: any, ev: Event) => any;
147
150
  /** 单元格右键菜单事件 */
148
- 'onCellContextmenu'?: (record: any, column: any, ev: Event) => any;
149
- }
151
+ onCellContextmenu?: (record: any, column: any, ev: Event) => any;
152
+ } & {
153
+ /** 选中行键更新事件 */
154
+ 'onUpdate:selectedKeys'?: (rowKeys: (string | number)[]) => any;
155
+ /** 展开行键更新事件 */
156
+ 'onUpdate:expandedKeys'?: (rowKeys: (string | number)[]) => any;
157
+ };
150
158
  export type ProTableProps = Partial<IProTable>;