@vrojs/element-plus 0.0.6 → 0.0.8

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 (190) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +125 -83
  3. package/dist/locale/index.js +6 -7
  4. package/dist/locale/lang/en.d.ts +8 -0
  5. package/dist/locale/lang/en.js +8 -0
  6. package/dist/locale/lang/zh-cn.d.ts +8 -0
  7. package/dist/locale/lang/zh-cn.js +8 -0
  8. package/dist/locale/useLocale.d.ts +1 -48
  9. package/dist/locale/useLocale.js +16 -17
  10. package/dist/style/deps.js +7 -0
  11. package/dist/style/index.css +1 -1
  12. package/dist/style/index.js +7 -0
  13. package/dist/utils/elTableColumnProps.d.ts +149 -0
  14. package/dist/utils/elTableColumnProps.js +152 -0
  15. package/dist/utils/index.d.ts +1 -0
  16. package/dist/utils/index.js +4 -2
  17. package/dist/vro-el-checkbox-group/index.d.ts +1 -1
  18. package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.d.ts +1 -1
  19. package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.js +10 -10
  20. package/dist/vro-el-config-provider/config.d.ts +14 -0
  21. package/dist/vro-el-config-provider/config.js +36 -0
  22. package/dist/vro-el-config-provider/index.d.ts +16 -0
  23. package/dist/vro-el-config-provider/index.js +8 -2
  24. package/dist/vro-el-config-provider/types.d.ts +7 -0
  25. package/dist/vro-el-config-provider/types.js +7 -0
  26. package/dist/vro-el-config-provider/vro-el-config-provider.vue.d.ts +9 -0
  27. package/dist/vro-el-config-provider/vro-el-config-provider.vue.js +11 -11
  28. package/dist/vro-el-file-upload/index.d.ts +6 -6
  29. package/dist/vro-el-file-upload/style/index.css +1 -1
  30. package/dist/vro-el-file-upload/types.d.ts +9 -2
  31. package/dist/vro-el-file-upload/vro-el-file-upload.vue.d.ts +7 -6
  32. package/dist/vro-el-file-upload/vro-el-file-upload.vue.js +55 -51
  33. package/dist/vro-el-icon/index.d.ts +28 -40
  34. package/dist/vro-el-icon/style/css.js +1 -0
  35. package/dist/vro-el-icon/style/deps.js +1 -1
  36. package/dist/vro-el-icon/style/index.js +1 -1
  37. package/dist/vro-el-icon/types.d.ts +16 -13
  38. package/dist/vro-el-icon/types.js +8 -1
  39. package/dist/vro-el-icon/vro-el-icon.vue.d.ts +18 -27
  40. package/dist/vro-el-icon/vro-el-icon.vue.js +27 -23
  41. package/dist/vro-el-image/index.d.ts +10 -4
  42. package/dist/vro-el-image/style/css.js +4 -0
  43. package/dist/vro-el-image/style/index.css +1 -0
  44. package/dist/vro-el-image/style/index.js +4 -0
  45. package/dist/vro-el-image/types.d.ts +35 -0
  46. package/dist/vro-el-image/types.js +24 -1
  47. package/dist/vro-el-image/utils.d.ts +1 -1
  48. package/dist/vro-el-image/vro-el-image.vue.d.ts +7 -2
  49. package/dist/vro-el-image/vro-el-image.vue.js +55 -24
  50. package/dist/vro-el-image-upload/index.d.ts +1 -1
  51. package/dist/vro-el-image-upload/style/css.js +4 -0
  52. package/dist/vro-el-image-upload/style/index.css +1 -1
  53. package/dist/vro-el-image-upload/style/index.js +4 -0
  54. package/dist/vro-el-image-upload/types.d.ts +24 -7
  55. package/dist/vro-el-image-upload/types.js +21 -7
  56. package/dist/vro-el-image-upload/vro-el-image-upload.vue.d.ts +1 -1
  57. package/dist/vro-el-image-upload/vro-el-image-upload.vue.js +82 -68
  58. package/dist/vro-el-radio-group/index.d.ts +1 -1
  59. package/dist/vro-el-radio-group/vro-el-radio-group.vue.d.ts +1 -1
  60. package/dist/vro-el-radio-group/vro-el-radio-group.vue.js +12 -12
  61. package/dist/vro-el-schema-filter/index.d.ts +27 -31
  62. package/dist/vro-el-schema-filter/style/css.js +5 -0
  63. package/dist/vro-el-schema-filter/style/index.css +1 -1
  64. package/dist/vro-el-schema-filter/style/index.js +5 -0
  65. package/dist/vro-el-schema-filter/types.d.ts +17 -0
  66. package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.d.ts +38 -43
  67. package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.js +63 -44
  68. package/dist/vro-el-schema-form/index.d.ts +16 -18
  69. package/dist/vro-el-schema-form/style/css.js +5 -0
  70. package/dist/vro-el-schema-form/style/index.css +1 -1
  71. package/dist/vro-el-schema-form/style/index.js +5 -0
  72. package/dist/vro-el-schema-form/types.d.ts +65 -7
  73. package/dist/vro-el-schema-form/useVroElSchemaForm.d.ts +33 -37
  74. package/dist/vro-el-schema-form/useVroElSchemaForm.js +13 -13
  75. package/dist/vro-el-schema-form/vro-el-schema-form.vue.d.ts +11 -13
  76. package/dist/vro-el-schema-form/vro-el-schema-form.vue.js +79 -79
  77. package/dist/vro-el-schema-form-dialog/function-call.js +10 -7
  78. package/dist/vro-el-schema-form-dialog/index.d.ts +111 -142
  79. package/dist/vro-el-schema-form-dialog/style/css.js +5 -0
  80. package/dist/vro-el-schema-form-dialog/style/index.css +1 -1
  81. package/dist/vro-el-schema-form-dialog/style/index.js +5 -0
  82. package/dist/vro-el-schema-form-dialog/types.d.ts +25 -16
  83. package/dist/vro-el-schema-form-dialog/types.js +6 -11
  84. package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.d.ts +92 -113
  85. package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.js +83 -87
  86. package/dist/vro-el-schema-form-drawer/function-call.d.ts +4 -0
  87. package/dist/vro-el-schema-form-drawer/function-call.js +20 -0
  88. package/dist/vro-el-schema-form-drawer/index.d.ts +2207 -0
  89. package/dist/vro-el-schema-form-drawer/index.js +16 -0
  90. package/dist/vro-el-schema-form-drawer/injection.d.ts +9 -0
  91. package/dist/vro-el-schema-form-drawer/injection.js +9 -0
  92. package/dist/vro-el-schema-form-drawer/style/css.d.ts +0 -0
  93. package/dist/vro-el-schema-form-drawer/style/css.js +24 -0
  94. package/dist/vro-el-schema-form-drawer/style/deps.d.ts +0 -0
  95. package/dist/vro-el-schema-form-drawer/style/deps.js +24 -0
  96. package/dist/vro-el-schema-form-drawer/style/index.css +1 -0
  97. package/dist/vro-el-schema-form-drawer/style/index.d.ts +0 -0
  98. package/dist/vro-el-schema-form-drawer/style/index.js +48 -0
  99. package/dist/vro-el-schema-form-drawer/types.d.ts +110 -0
  100. package/dist/vro-el-schema-form-drawer/types.js +75 -0
  101. package/dist/vro-el-schema-form-drawer/useVroElSchemaFormDrawer.d.ts +14 -0
  102. package/dist/vro-el-schema-form-drawer/useVroElSchemaFormDrawer.js +18 -0
  103. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.d.ts +1832 -0
  104. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.js +134 -0
  105. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue2.js +4 -0
  106. package/dist/vro-el-select/index.d.ts +11 -11
  107. package/dist/vro-el-select/vro-el-select.vue.d.ts +11 -11
  108. package/dist/vro-el-select/vro-el-select.vue.js +11 -11
  109. package/dist/vro-el-skeleton/index.d.ts +9 -73
  110. package/dist/vro-el-skeleton/style/index.css +1 -1
  111. package/dist/vro-el-skeleton/types.d.ts +32 -24
  112. package/dist/vro-el-skeleton/types.js +3 -23
  113. package/dist/vro-el-skeleton/vro-el-skeleton.vue.d.ts +7 -48
  114. package/dist/vro-el-skeleton/vro-el-skeleton.vue.js +48 -46
  115. package/dist/vro-el-table/createUseVroElTable.d.ts +9 -0
  116. package/dist/vro-el-table/createUseVroElTable.js +7 -0
  117. package/dist/vro-el-table/index.js +13 -0
  118. package/dist/vro-el-table/style/css.d.ts +0 -0
  119. package/dist/vro-el-table/style/css.js +29 -0
  120. package/dist/vro-el-table/style/deps.d.ts +0 -0
  121. package/dist/vro-el-table/style/deps.js +28 -0
  122. package/dist/vro-el-table/style/index.css +1 -0
  123. package/dist/vro-el-table/style/index.d.ts +0 -0
  124. package/dist/vro-el-table/style/index.js +57 -0
  125. package/dist/vro-el-table/types.d.ts +97 -0
  126. package/dist/vro-el-table/types.js +66 -0
  127. package/dist/vro-el-table/useVroElTable.d.ts +43 -0
  128. package/dist/vro-el-table/useVroElTable.js +47 -0
  129. package/dist/vro-el-table/vro-el-table.vue.js +94 -0
  130. package/dist/vro-el-table/vro-el-table.vue2.js +4 -0
  131. package/dist/vro-el-table-actions-column/index.d.ts +269 -0
  132. package/dist/vro-el-table-actions-column/index.js +9 -0
  133. package/dist/vro-el-table-actions-column/style/css.d.ts +0 -0
  134. package/dist/vro-el-table-actions-column/style/css.js +4 -0
  135. package/dist/vro-el-table-actions-column/style/deps.d.ts +0 -0
  136. package/dist/vro-el-table-actions-column/style/deps.js +5 -0
  137. package/dist/vro-el-table-actions-column/style/index.css +1 -0
  138. package/dist/vro-el-table-actions-column/style/index.d.ts +0 -0
  139. package/dist/vro-el-table-actions-column/style/index.js +9 -0
  140. package/dist/vro-el-table-actions-column/types.d.ts +139 -0
  141. package/dist/vro-el-table-actions-column/types.js +37 -0
  142. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.d.ts +167 -0
  143. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.js +101 -0
  144. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue2.js +4 -0
  145. package/dist/vro-el-table-column/index.d.ts +257 -0
  146. package/dist/vro-el-table-column/index.js +9 -0
  147. package/dist/vro-el-table-column/style/css.d.ts +0 -0
  148. package/dist/vro-el-table-column/style/css.js +6 -0
  149. package/dist/vro-el-table-column/style/deps.d.ts +0 -0
  150. package/dist/vro-el-table-column/style/deps.js +1 -0
  151. package/dist/vro-el-table-column/style/index.css +1 -0
  152. package/dist/vro-el-table-column/style/index.d.ts +0 -0
  153. package/dist/vro-el-table-column/style/index.js +7 -0
  154. package/dist/vro-el-table-column/types.d.ts +141 -0
  155. package/dist/vro-el-table-column/types.js +43 -0
  156. package/dist/vro-el-table-column/vro-el-table-column.vue.d.ts +161 -0
  157. package/dist/vro-el-table-column/vro-el-table-column.vue.js +66 -0
  158. package/dist/vro-el-table-column/vro-el-table-column.vue2.js +4 -0
  159. package/dist/vro-el-table-column-group/index.d.ts +23 -0
  160. package/dist/vro-el-table-column-group/index.js +13 -0
  161. package/dist/vro-el-table-column-group/style/css.d.ts +0 -0
  162. package/dist/vro-el-table-column-group/style/css.js +9 -0
  163. package/dist/vro-el-table-column-group/style/deps.d.ts +0 -0
  164. package/dist/vro-el-table-column-group/style/deps.js +5 -0
  165. package/dist/vro-el-table-column-group/style/index.d.ts +0 -0
  166. package/dist/vro-el-table-column-group/style/index.js +14 -0
  167. package/dist/vro-el-table-column-group/types.d.ts +87 -0
  168. package/dist/vro-el-table-column-group/types.js +12 -0
  169. package/dist/vro-el-table-column-group/useVroElTableColumnGroup.d.ts +2 -0
  170. package/dist/vro-el-table-column-group/useVroElTableColumnGroup.js +10 -0
  171. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue.d.ts +14 -0
  172. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue.js +29 -0
  173. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue2.js +4 -0
  174. package/dist/vro-el-table-column-group/vroElTableColumnGroupColumnManager.d.ts +2 -0
  175. package/dist/vro-el-table-column-group/vroElTableColumnGroupColumnManager.js +9 -0
  176. package/dist/vro-el-tags/index.d.ts +234 -187
  177. package/dist/vro-el-tags/style/css.js +1 -0
  178. package/dist/vro-el-tags/style/index.css +1 -0
  179. package/dist/vro-el-tags/style/index.js +1 -0
  180. package/dist/vro-el-tags/types.d.ts +37 -1
  181. package/dist/vro-el-tags/types.js +17 -1
  182. package/dist/vro-el-tags/vro-el-tags.vue.d.ts +219 -8
  183. package/dist/vro-el-tags/vro-el-tags.vue.js +55 -45
  184. package/dist/vro-el-tree/index.d.ts +3235 -32
  185. package/dist/vro-el-tree/style/index.css +1 -1
  186. package/dist/vro-el-tree/types.d.ts +124 -5
  187. package/dist/vro-el-tree/types.js +12 -6
  188. package/dist/vro-el-tree/vro-el-tree.vue.d.ts +6020 -20
  189. package/dist/vro-el-tree/vro-el-tree.vue.js +54 -36
  190. package/package.json +10 -12
@@ -1,51 +1,53 @@
1
- import { defineComponent as h, computed as g, createElementBlock as v, openBlock as m, normalizeStyle as _, renderSlot as s, createElementVNode as l, createVNode as n, unref as o, toDisplayString as p, withCtx as i, createTextVNode as d, createBlock as B, createCommentVNode as E } from "vue";
2
- import { formatMessage as T } from "@daysnap/utils";
3
- import { VroLoading as S } from "@vrojs/base";
4
- import { ElResult as C, ElButton as y, ElEmpty as V } from "element-plus";
5
- import { useLocale as D } from "../locale/useLocale.js";
6
- import { vroElSkeletonProps as $ } from "./types.js";
7
- const z = { class: "vro-el-skeleton__state vro-el-skeleton__loading" }, H = { class: "vro-el-skeleton__description" }, N = { class: "vro-el-skeleton__state" }, b = { class: "vro-el-skeleton__state" }, A = /* @__PURE__ */ h({
1
+ import { defineComponent as h, computed as v, createElementBlock as g, openBlock as p, normalizeStyle as B, renderSlot as l, createElementVNode as n, createVNode as i, unref as t, mergeProps as E, toDisplayString as a, withCtx as m, createTextVNode as d, createBlock as T, createCommentVNode as S } from "vue";
2
+ import { formatMessage as V } from "@daysnap/utils";
3
+ import { VroLoading as C } from "@vrojs/base";
4
+ import { ElResult as D, ElButton as c, ElEmpty as $ } from "element-plus";
5
+ import { useLocale as H } from "../locale/useLocale.js";
6
+ import { vroElSkeletonProps as N } from "./types.js";
7
+ const b = { class: "vro-el-skeleton-state vro-el-skeleton-loading" }, P = { class: "vro-el-skeleton-description" }, w = { class: "vro-el-skeleton-state" }, z = { class: "vro-el-skeleton-state" }, F = /* @__PURE__ */ h({
8
8
  name: "VroElSkeleton",
9
9
  __name: "vro-el-skeleton",
10
- props: $,
10
+ props: N,
11
11
  emits: ["refresh"],
12
- setup(c, { emit: k }) {
13
- const f = k, a = c, { t } = D(), u = g(() => ({
14
- minHeight: typeof a.minHeight == "number" ? `${a.minHeight}px` : a.minHeight
15
- })), r = () => {
12
+ setup(k, { emit: y }) {
13
+ const f = y, r = k, { t: o } = H(), u = v(() => {
14
+ if (r.minHeight !== void 0)
15
+ return {
16
+ "--vro-el-skeleton-min-height": typeof r.minHeight == "number" ? `${r.minHeight}px` : r.minHeight
17
+ };
18
+ }), s = () => {
16
19
  f("refresh");
17
20
  };
18
- return (e, w) => (m(), v("div", {
21
+ return (e, L) => (p(), g("div", {
19
22
  class: "vro-el-skeleton",
20
- style: _(u.value)
23
+ style: B(u.value)
21
24
  }, [
22
- e.loading ? s(e.$slots, "loading", { key: 0 }, () => [
23
- l("div", z, [
24
- n(o(S), {
25
- type: e.loadingType,
26
- size: e.loadingSize,
27
- color: e.loadingColor
28
- }, null, 8, ["type", "size", "color"]),
29
- l("p", H, p(e.loadingDescription ?? o(t)("skeleton.loadingDescription")), 1)
25
+ e.loading ? l(e.$slots, "loading", { key: 0 }, () => [
26
+ n("div", b, [
27
+ i(t(C), E({
28
+ type: "circular",
29
+ size: "32"
30
+ }, e.loadingProps), null, 16),
31
+ n("p", P, a(e.loadingDescription ?? t(o)("skeleton.loadingDescription")), 1)
30
32
  ])
31
- ]) : e.error ? s(e.$slots, "error", {
33
+ ]) : e.error ? l(e.$slots, "error", {
32
34
  key: 1,
33
35
  error: e.error,
34
- refresh: r
36
+ refresh: s
35
37
  }, () => [
36
- l("div", N, [
37
- n(o(C), {
38
+ n("div", w, [
39
+ i(t(D), {
38
40
  icon: "error",
39
- title: e.errorTitle ?? o(t)("skeleton.errorTitle"),
40
- "sub-title": o(T)(e.error)
41
+ title: e.errorTitle ?? t(o)("skeleton.errorTitle"),
42
+ "sub-title": t(V)(e.error)
41
43
  }, {
42
- extra: i(() => [
43
- n(o(y), {
44
+ extra: m(() => [
45
+ i(t(c), {
44
46
  type: "primary",
45
- onClick: r
47
+ onClick: s
46
48
  }, {
47
- default: i(() => [
48
- d(p(e.errorBtnText ?? o(t)("skeleton.errorBtnText")), 1)
49
+ default: m(() => [
50
+ d(a(e.errorBtnText ?? t(o)("skeleton.errorBtnText")), 1)
49
51
  ]),
50
52
  _: 1
51
53
  })
@@ -53,33 +55,33 @@ const z = { class: "vro-el-skeleton__state vro-el-skeleton__loading" }, H = { cl
53
55
  _: 1
54
56
  }, 8, ["title", "sub-title"])
55
57
  ])
56
- ]) : e.empty ? s(e.$slots, "empty", {
58
+ ]) : e.empty ? l(e.$slots, "empty", {
57
59
  key: 2,
58
- refresh: r
60
+ refresh: s
59
61
  }, () => [
60
- l("div", b, [
61
- n(o(V), {
62
- description: e.emptyDescription ?? o(t)("skeleton.emptyDescription")
62
+ n("div", z, [
63
+ i(t($), {
64
+ description: e.emptyDescription ?? t(o)("skeleton.emptyDescription")
63
65
  }, {
64
- default: i(() => [
65
- e.showEmptyBtn ? (m(), B(o(y), {
66
+ default: m(() => [
67
+ e.showEmptyBtn ? (p(), T(t(c), {
66
68
  key: 0,
67
69
  type: "primary",
68
- onClick: r
70
+ onClick: s
69
71
  }, {
70
- default: i(() => [
71
- d(p(e.emptyBtnText ?? o(t)("skeleton.emptyBtnText")), 1)
72
+ default: m(() => [
73
+ d(a(e.emptyBtnText ?? t(o)("skeleton.emptyBtnText")), 1)
72
74
  ]),
73
75
  _: 1
74
- })) : E("", !0)
76
+ })) : S("", !0)
75
77
  ]),
76
78
  _: 1
77
79
  }, 8, ["description"])
78
80
  ])
79
- ]) : s(e.$slots, "default", { key: 3 })
81
+ ]) : l(e.$slots, "default", { key: 3 })
80
82
  ], 4));
81
83
  }
82
84
  });
83
85
  export {
84
- A as default
86
+ F as default
85
87
  };
@@ -0,0 +1,9 @@
1
+ import { VroElSchemaFormSchema, VroElSchemaFormSchemaField } from '../vro-el-schema-form';
2
+ import { VroElTableRequest } from './types';
3
+ import { UseVroElTableOptions, UseVroElTableRawColumns, useVroElTable } from './useVroElTable';
4
+ export interface CreateUseVroElTable<Row extends Record<string, any> = any> {
5
+ <R extends VroElSchemaFormSchema, S extends VroElSchemaFormSchema = {
6
+ [P in keyof R]: VroElSchemaFormSchemaField;
7
+ }>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): ReturnType<typeof useVroElTable<Row, R, S>>;
8
+ }
9
+ export declare function createUseVroElTable<Row extends Record<string, any> = any>(): CreateUseVroElTable<Row>;
@@ -0,0 +1,7 @@
1
+ import { useVroElTable as e } from "./useVroElTable.js";
2
+ function o() {
3
+ return e;
4
+ }
5
+ export {
6
+ o as createUseVroElTable
7
+ };
@@ -0,0 +1,13 @@
1
+ import { withInstall as o } from "@vrojs/base";
2
+ import r from "./vro-el-table.vue.js";
3
+ import { createUseVroElTable as f } from "./createUseVroElTable.js";
4
+ import { vroElTableProps as s } from "./types.js";
5
+ import { useVroElTable as i } from "./useVroElTable.js";
6
+ const t = o(r);
7
+ export {
8
+ t as VroElTable,
9
+ f as createUseVroElTable,
10
+ t as default,
11
+ i as useVroElTable,
12
+ s as vroElTableProps
13
+ };
File without changes
@@ -0,0 +1,29 @@
1
+ import '../../style/base.css';
2
+ import '../../vro-el-file-upload/style/index.css';
3
+ import '../../vro-el-image-upload/style/index.css';
4
+ import '../../vro-el-image/style/index.css';
5
+ import '../../vro-el-schema-filter/style/index.css';
6
+ import '../../vro-el-schema-form/style/index.css';
7
+ import '../../vro-el-table-actions-column/style/index.css';
8
+ import '../../vro-el-table-column/style/index.css';
9
+ import './index.css';
10
+ import '../../vro-el-tags/style/index.css';
11
+ import '../../vro-el-tree/style/index.css';
12
+ /* empty css */
13
+ /* empty css */
14
+ /* empty css */
15
+ import "@vrojs/base/src/vro-loading/style/css";
16
+ import "@vrojs/base/src/vro-icon/style/css";
17
+ /* empty css */
18
+ /* empty css */
19
+ /* empty css */
20
+ /* empty css */
21
+ /* empty css */
22
+ /* empty css */
23
+ /* empty css */
24
+ /* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
+ /* empty css */
File without changes
@@ -0,0 +1,28 @@
1
+ import "element-plus/es/components/checkbox-group/style/css";
2
+ import "element-plus/es/components/checkbox/style/css";
3
+ import "element-plus/es/components/button/style/css";
4
+ import "element-plus/es/components/icon/style/css";
5
+ import "element-plus/es/components/image/style/css";
6
+ import "element-plus/es/components/loading/style/css";
7
+ import "element-plus/es/components/radio-group/style/css";
8
+ import "element-plus/es/components/radio/style/css";
9
+ import "element-plus/es/components/option/style/css";
10
+ import "element-plus/es/components/select/style/css";
11
+ import "element-plus/es/components/input/style/css";
12
+ import "element-plus/es/components/tag/style/css";
13
+ import "element-plus/es/components/tree/style/css";
14
+ import "element-plus/es/components/cascader/style/css";
15
+ import "element-plus/es/components/col/style/css";
16
+ import "element-plus/es/components/date-picker/style/css";
17
+ import "element-plus/es/components/divider/style/css";
18
+ import "element-plus/es/components/form-item/style/css";
19
+ import "element-plus/es/components/form/style/css";
20
+ import "element-plus/es/components/input-number/style/css";
21
+ import "element-plus/es/components/row/style/css";
22
+ import "element-plus/es/components/tree-select/style/css";
23
+ import "element-plus/es/components/dropdown-item/style/css";
24
+ import "element-plus/es/components/dropdown-menu/style/css";
25
+ import "element-plus/es/components/dropdown/style/css";
26
+ import "element-plus/es/components/table-column/style/css";
27
+ import "element-plus/es/components/pagination/style/css";
28
+ import "element-plus/es/components/table/style/css";
@@ -0,0 +1 @@
1
+ :root,:host{--vro-el-table-gap: 16px;--vro-el-table-padding: 16px;--vro-el-table-inner-gap: var(--vro-el-table-gap)}.vro-el-table{display:flex;flex-direction:column;width:100%;box-sizing:border-box;gap:var(--vro-el-table-gap)}.vro-el-table .el-table-column--selection{line-height:normal}.vro-el-table .el-table__expand-icon{display:flex;align-items:center;justify-content:center}.vro-el-table-inner{flex:1;position:relative;background-color:var(--el-bg-color);padding:var(--vro-el-table-padding);display:flex;flex-direction:column;gap:var(--vro-el-table-inner-gap)}.vro-el-table-header{display:flex;align-items:center;flex-wrap:wrap}.vro-el-table-header h2{font-size:16px}.vro-el-table-actions{flex-shrink:0;margin-left:auto}.vro-el-table-content{flex:1}.vro-el-table-content .el-table{width:100%;--el-table-bg-color: transparent}.vro-el-table-content .el-table__header{--el-table-header-bg-color: var(--el-bg-color-page);--el-table-header-text-color: var(--el-text-color-primary)}.vro-el-table-content .el-table__body-wrapper .cell{line-height:1.4}.vro-el-table-content .el-table__body-wrapper strong{font-weight:700;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt{font-weight:700;margin-bottom:8px;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt:last-child{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper dl dd{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper dl dd:last-of-type{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper ul li{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper ul li:last-of-type{margin-bottom:0}.vro-el-table-pagination{justify-content:flex-end}
File without changes
@@ -0,0 +1,57 @@
1
+ import '../../style/base.css';
2
+ import '../../vro-el-file-upload/style/index.css';
3
+ import '../../vro-el-image-upload/style/index.css';
4
+ import '../../vro-el-image/style/index.css';
5
+ import '../../vro-el-schema-filter/style/index.css';
6
+ import '../../vro-el-schema-form/style/index.css';
7
+ import '../../vro-el-table-actions-column/style/index.css';
8
+ import '../../vro-el-table-column/style/index.css';
9
+ import './index.css';
10
+ import '../../vro-el-tags/style/index.css';
11
+ import '../../vro-el-tree/style/index.css';
12
+ import "element-plus/es/components/checkbox-group/style/css";
13
+ import "element-plus/es/components/checkbox/style/css";
14
+ import "element-plus/es/components/button/style/css";
15
+ import "element-plus/es/components/icon/style/css";
16
+ import "element-plus/es/components/image/style/css";
17
+ import "element-plus/es/components/loading/style/css";
18
+ import "element-plus/es/components/radio-group/style/css";
19
+ import "element-plus/es/components/radio/style/css";
20
+ import "element-plus/es/components/option/style/css";
21
+ import "element-plus/es/components/select/style/css";
22
+ import "element-plus/es/components/input/style/css";
23
+ import "element-plus/es/components/tag/style/css";
24
+ import "element-plus/es/components/tree/style/css";
25
+ import "element-plus/es/components/cascader/style/css";
26
+ import "element-plus/es/components/col/style/css";
27
+ import "element-plus/es/components/date-picker/style/css";
28
+ import "element-plus/es/components/divider/style/css";
29
+ import "element-plus/es/components/form-item/style/css";
30
+ import "element-plus/es/components/form/style/css";
31
+ import "element-plus/es/components/input-number/style/css";
32
+ import "element-plus/es/components/row/style/css";
33
+ import "element-plus/es/components/tree-select/style/css";
34
+ import "element-plus/es/components/dropdown-item/style/css";
35
+ import "element-plus/es/components/dropdown-menu/style/css";
36
+ import "element-plus/es/components/dropdown/style/css";
37
+ import "element-plus/es/components/table-column/style/css";
38
+ import "element-plus/es/components/pagination/style/css";
39
+ import "element-plus/es/components/table/style/css";
40
+ /* empty css */
41
+ /* empty css */
42
+ /* empty css */
43
+ import "@vrojs/base/src/vro-loading/style/css";
44
+ import "@vrojs/base/src/vro-icon/style/css";
45
+ /* empty css */
46
+ /* empty css */
47
+ /* empty css */
48
+ /* empty css */
49
+ /* empty css */
50
+ /* empty css */
51
+ /* empty css */
52
+ /* empty css */
53
+ /* empty css */
54
+ /* empty css */
55
+ /* empty css */
56
+ /* empty css */
57
+ /* empty css */
@@ -0,0 +1,97 @@
1
+ import { PaginationProps, TableProps } from 'element-plus';
2
+ import { ExtractPropTypes, PropType } from 'vue';
3
+ import { VroElSchemaFilterProps } from '../vro-el-schema-filter';
4
+ import { VroElTableColumnGroupColumn } from '../vro-el-table-column-group';
5
+ export interface VroElTableRequestPayload {
6
+ currentPage?: number;
7
+ pageSize?: number;
8
+ query?: Record<string, any>;
9
+ }
10
+ export interface VroElTableRequest<T = any> {
11
+ (state: [number, number], query: any): Promise<[T[], number]>;
12
+ }
13
+ export interface VroElTableEmits {
14
+ request: [payload?: VroElTableRequestPayload];
15
+ 'selection-change': [selection: any[]];
16
+ }
17
+ export interface VroElTableSlots {
18
+ /**
19
+ * 自定义表格列内容,追加在 columns 渲染的列之后。
20
+ */
21
+ default?: () => any;
22
+ /**
23
+ * 自定义头部标题区域。
24
+ */
25
+ title?: () => any;
26
+ /**
27
+ * 自定义头部操作区域,追加在刷新按钮之后。
28
+ */
29
+ actions?: () => any;
30
+ /**
31
+ * 自定义表格内部前置列内容,渲染在 columns 之前。
32
+ */
33
+ 'content-prefix'?: () => any;
34
+ }
35
+ export declare const vroElTableProps: {
36
+ /**
37
+ * 是否启用筛选区。
38
+ *
39
+ * 当 filterProps.schema 为空时不会渲染筛选区。
40
+ */
41
+ filterable: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ /**
46
+ * 筛选区属性,透传给 VroElSchemaFilter。
47
+ */
48
+ filterProps: PropType<Partial<VroElSchemaFilterProps>>;
49
+ /**
50
+ * 表格列配置。
51
+ */
52
+ columns: {
53
+ type: PropType<VroElTableColumnGroupColumn[]>;
54
+ default: () => never[];
55
+ };
56
+ /**
57
+ * 表格数据。
58
+ */
59
+ data: {
60
+ type: PropType<any[]>;
61
+ default: () => never[];
62
+ };
63
+ /**
64
+ * 表格和筛选区 loading 状态。
65
+ */
66
+ loading: BooleanConstructor;
67
+ /**
68
+ * 表格属性,透传给 ElTable。
69
+ */
70
+ tableProps: PropType<Partial<TableProps<any>>>;
71
+ /**
72
+ * 是否启用分页。
73
+ */
74
+ pageable: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ /**
79
+ * 分页属性,透传给 ElPagination。
80
+ */
81
+ paginationProps: PropType<Partial<PaginationProps>>;
82
+ /**
83
+ * 是否显示刷新按钮。
84
+ */
85
+ showRefresh: {
86
+ type: BooleanConstructor;
87
+ default: boolean;
88
+ };
89
+ /**
90
+ * 是否显示头部区域。
91
+ */
92
+ showHeader: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
96
+ };
97
+ export type VroElTableProps = ExtractPropTypes<typeof vroElTableProps>;
@@ -0,0 +1,66 @@
1
+ import "element-plus";
2
+ const t = {
3
+ /**
4
+ * 是否启用筛选区。
5
+ *
6
+ * 当 filterProps.schema 为空时不会渲染筛选区。
7
+ */
8
+ filterable: {
9
+ type: Boolean,
10
+ default: !0
11
+ },
12
+ /**
13
+ * 筛选区属性,透传给 VroElSchemaFilter。
14
+ */
15
+ filterProps: Object,
16
+ /**
17
+ * 表格列配置。
18
+ */
19
+ columns: {
20
+ type: Array,
21
+ default: () => []
22
+ },
23
+ /**
24
+ * 表格数据。
25
+ */
26
+ data: {
27
+ type: Array,
28
+ default: () => []
29
+ },
30
+ /**
31
+ * 表格和筛选区 loading 状态。
32
+ */
33
+ loading: Boolean,
34
+ /**
35
+ * 表格属性,透传给 ElTable。
36
+ */
37
+ tableProps: Object,
38
+ /**
39
+ * 是否启用分页。
40
+ */
41
+ pageable: {
42
+ type: Boolean,
43
+ default: !0
44
+ },
45
+ /**
46
+ * 分页属性,透传给 ElPagination。
47
+ */
48
+ paginationProps: Object,
49
+ /**
50
+ * 是否显示刷新按钮。
51
+ */
52
+ showRefresh: {
53
+ type: Boolean,
54
+ default: !0
55
+ },
56
+ /**
57
+ * 是否显示头部区域。
58
+ */
59
+ showHeader: {
60
+ type: Boolean,
61
+ default: !0
62
+ }
63
+ };
64
+ export {
65
+ t as vroElTableProps
66
+ };
@@ -0,0 +1,43 @@
1
+ import { UseAsyncTaskOptions } from '@vrojs/use';
2
+ import { Ref } from 'vue';
3
+ import { VroElSchemaFormSchema, VroElSchemaFormSchemaField } from '../vro-el-schema-form';
4
+ import { VroElTableColumnGroupColumns } from '../vro-el-table-column-group';
5
+ import { VroElTableRequest } from './types';
6
+ export interface UseVroElTableOptions<Row extends Record<string, any> = any> extends Pick<UseAsyncTaskOptions<any>, 'activated' | 'immediate' | 'throwError' | 'onError'> {
7
+ query?: Ref<Record<string, any>>;
8
+ initialValue?: Row[];
9
+ }
10
+ export type UseVroElTableAsyncTaskParams = {
11
+ currentPage?: number;
12
+ pageSize?: number;
13
+ query?: Record<string, any>;
14
+ } | number;
15
+ export type UseVroElTableRawColumns<T extends Record<string, any> = any> = (() => VroElTableColumnGroupColumns<T>) | VroElTableColumnGroupColumns<T>;
16
+ export declare function useVroElTable<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = VroElSchemaFormSchema, S extends VroElSchemaFormSchema = {
17
+ [P in keyof R]: VroElSchemaFormSchemaField;
18
+ }>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): {
19
+ tableProps: import('vue').ComputedRef<{
20
+ filterProps: {
21
+ schema: import('vue').Reactive<S>;
22
+ };
23
+ loading: boolean;
24
+ columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
25
+ data: Row[];
26
+ paginationProps: {
27
+ currentPage: number;
28
+ pageSize: number;
29
+ total: number;
30
+ };
31
+ }>;
32
+ query: Ref<Record<string, any>, Record<string, any>>;
33
+ schema: import('vue').Reactive<S>;
34
+ columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
35
+ trigger: (params?: UseVroElTableAsyncTaskParams) => Promise<Row[]>;
36
+ data: Ref<Row[], Row[]>;
37
+ loading: Ref<boolean, boolean>;
38
+ pagination: {
39
+ currentPage: number;
40
+ pageSize: number;
41
+ total: number;
42
+ };
43
+ };
@@ -0,0 +1,47 @@
1
+ import q from "@daysnap/banana";
2
+ import { isFunction as p, filterEmptyValue as z, isNumber as E } from "@daysnap/utils";
3
+ import { useAsyncTask as T } from "@vrojs/use";
4
+ import { reactive as a, ref as V, computed as k } from "vue";
5
+ import "../vro-el-table-column-group/index.js";
6
+ function Q(r, o, f, y = {}) {
7
+ const { query: P, ...m } = y, i = a(p(r) ? r() : r), u = a(p(o) ? o() : o), n = P ?? V(z(q.extract(i), !0)), t = a({
8
+ currentPage: 1,
9
+ pageSize: 10,
10
+ total: 0
11
+ }), { trigger: b, data: c, loading: s } = T(
12
+ async (e) => {
13
+ E(e) && (e = { currentPage: e });
14
+ const { currentPage: l, pageSize: g } = Object.assign({}, t, e);
15
+ e?.query && (n.value = e?.query), t.currentPage = l, t.pageSize = g;
16
+ const [d, v] = await f([l, g], n.value);
17
+ return t.total = v, d || [];
18
+ },
19
+ {
20
+ immediate: !0,
21
+ throwError: !0,
22
+ initialValue: [],
23
+ ...m
24
+ }
25
+ );
26
+ return {
27
+ tableProps: k(() => ({
28
+ filterProps: {
29
+ schema: i
30
+ },
31
+ loading: s.value,
32
+ columns: u,
33
+ data: c.value,
34
+ paginationProps: t
35
+ })),
36
+ query: n,
37
+ schema: i,
38
+ columns: u,
39
+ trigger: b,
40
+ data: c,
41
+ loading: s,
42
+ pagination: t
43
+ };
44
+ }
45
+ export {
46
+ Q as useVroElTable
47
+ };
@@ -0,0 +1,94 @@
1
+ import { defineComponent as E, useTemplateRef as y, computed as k, resolveDirective as P, createElementBlock as i, openBlock as l, createBlock as n, createCommentVNode as a, createElementVNode as d, unref as r, mergeProps as u, withDirectives as T, renderSlot as s, withCtx as p, createTextVNode as $, toDisplayString as V, createVNode as q } from "vue";
2
+ import { isEmptyObject as C } from "@daysnap/utils";
3
+ import { RefreshRight as S } from "@element-plus/icons-vue";
4
+ import { ElButton as w, ElTable as z, ElPagination as B } from "element-plus";
5
+ import { useLocale as N } from "../locale/useLocale.js";
6
+ import { VroElSchemaFilter as R } from "../vro-el-schema-filter/index.js";
7
+ import { VroElTableColumnGroup as D } from "../vro-el-table-column-group/index.js";
8
+ import { vroElTableProps as j } from "./types.js";
9
+ const U = { class: "vro-el-table" }, F = { class: "vro-el-table-inner" }, G = {
10
+ key: 0,
11
+ class: "vro-el-table-header"
12
+ }, H = { class: "vro-el-table-actions" }, L = { class: "vro-el-table-content" }, X = /* @__PURE__ */ E({
13
+ name: "VroElTable",
14
+ __name: "vro-el-table",
15
+ props: j,
16
+ emits: ["request", "selection-change"],
17
+ setup(f, { expose: g }) {
18
+ const b = f, { t: v } = N(), m = y("refElTable"), c = k(() => {
19
+ const { filterable: e, filterProps: o } = b;
20
+ return !!(e && o?.schema && !C(o.schema));
21
+ });
22
+ return g({
23
+ get elTable() {
24
+ return m.value;
25
+ }
26
+ }), (e, o) => {
27
+ const h = P("loading");
28
+ return l(), i("div", U, [
29
+ c.value ? (l(), n(r(R), u({ key: 0 }, e.filterProps, {
30
+ loading: e.loading,
31
+ class: "vro-el-table-filter",
32
+ onQuery: o[0] || (o[0] = (t) => e.$emit("request", { query: t, currentPage: 1 }))
33
+ }), null, 16, ["loading"])) : a("", !0),
34
+ d("div", F, [
35
+ e.showHeader ? (l(), i("div", G, [
36
+ s(e.$slots, "title"),
37
+ d("div", H, [
38
+ e.showRefresh ? (l(), n(r(w), {
39
+ key: 0,
40
+ plain: "",
41
+ icon: r(S),
42
+ loading: e.loading,
43
+ onClick: o[1] || (o[1] = (t) => e.$emit("request"))
44
+ }, {
45
+ default: p(() => [
46
+ $(V(r(v)("table.refresh")), 1)
47
+ ]),
48
+ _: 1
49
+ }, 8, ["icon", "loading"])) : a("", !0),
50
+ s(e.$slots, "actions")
51
+ ])
52
+ ])) : a("", !0),
53
+ T((l(), i("div", L, [
54
+ q(r(z), u({
55
+ ref_key: "refElTable",
56
+ ref: m,
57
+ width: "100%",
58
+ "table-layout": "fixed"
59
+ }, e.tableProps, {
60
+ data: e.data,
61
+ onSelectionChange: o[2] || (o[2] = (t) => e.$emit("selection-change", t))
62
+ }), {
63
+ default: p(() => [
64
+ s(e.$slots, "content-prefix"),
65
+ e.columns.length ? (l(), n(r(D), {
66
+ key: 0,
67
+ columns: e.columns
68
+ }, null, 8, ["columns"])) : a("", !0),
69
+ s(e.$slots, "default")
70
+ ]),
71
+ _: 3
72
+ }, 16, ["data"])
73
+ ])), [
74
+ [h, e.loading]
75
+ ]),
76
+ e.pageable ? (l(), n(r(B), u({
77
+ key: 1,
78
+ class: "vro-el-table-pagination",
79
+ layout: "total, prev, pager, next, sizes, jumper",
80
+ background: "",
81
+ size: "small",
82
+ "page-sizes": [10, 20, 50, 100]
83
+ }, e.paginationProps, {
84
+ "onUpdate:currentPage": o[3] || (o[3] = (t) => e.$emit("request", { currentPage: t })),
85
+ "onUpdate:pageSize": o[4] || (o[4] = (t) => e.$emit("request", { pageSize: t, currentPage: 1 }))
86
+ }), null, 16)) : a("", !0)
87
+ ])
88
+ ]);
89
+ };
90
+ }
91
+ });
92
+ export {
93
+ X as default
94
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./vro-el-table.vue.js";
2
+ export {
3
+ f as default
4
+ };