@vrojs/element-plus 0.0.7 → 0.0.9

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 +66 -7
  73. package/dist/vro-el-schema-form/useVroElSchemaForm.d.ts +39 -40
  74. package/dist/vro-el-schema-form/useVroElSchemaForm.js +15 -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 +7 -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 +44 -0
  128. package/dist/vro-el-table/useVroElTable.js +49 -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 +6 -6
@@ -1,6 +1,7 @@
1
+ import { VroElFileUploadModelValue } from './types';
1
2
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
3
  modelValue: {
3
- type: import('vue').PropType<string | string[]>;
4
+ type: import('vue').PropType<VroElFileUploadModelValue>;
4
5
  default: string;
5
6
  };
6
7
  accept: StringConstructor;
@@ -11,11 +12,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
11
12
  disabled: BooleanConstructor;
12
13
  params: import('vue').PropType<Record<string, any>>;
13
14
  upload: import('vue').PropType<import('./types').VroElFileUploadCallback>;
14
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
- "update:modelValue": (value: string | string[]) => any;
15
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ "update:modelValue": (value: VroElFileUploadModelValue) => any;
16
17
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
18
  modelValue: {
18
- type: import('vue').PropType<string | string[]>;
19
+ type: import('vue').PropType<VroElFileUploadModelValue>;
19
20
  default: string;
20
21
  };
21
22
  accept: StringConstructor;
@@ -27,10 +28,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
27
28
  params: import('vue').PropType<Record<string, any>>;
28
29
  upload: import('vue').PropType<import('./types').VroElFileUploadCallback>;
29
30
  }>> & Readonly<{
30
- "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
31
+ "onUpdate:modelValue"?: ((value: VroElFileUploadModelValue) => any) | undefined;
31
32
  }>, {
33
+ modelValue: VroElFileUploadModelValue;
32
34
  disabled: boolean;
33
- modelValue: string | string[];
34
35
  max: number;
35
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
36
37
  export default _default;
@@ -1,78 +1,82 @@
1
- import { defineComponent as N, computed as h, createElementBlock as s, openBlock as r, createBlock as V, createCommentVNode as y, createElementVNode as d, unref as t, withCtx as k, createTextVNode as A, toDisplayString as E, Fragment as T, renderList as D, createVNode as L } from "vue";
2
- import { omitBy as P, isUndefined as x, isArray as u } from "@daysnap/utils";
3
- import { CircleCloseFilled as I } from "@element-plus/icons-vue";
1
+ import { defineComponent as F, computed as _, createElementBlock as u, openBlock as n, createBlock as V, createCommentVNode as y, createElementVNode as d, unref as o, withCtx as b, createTextVNode as N, toDisplayString as k, Fragment as A, renderList as T, createVNode as $ } from "vue";
2
+ import { omitBy as D, isUndefined as L, isArray as c } from "@daysnap/utils";
3
+ import { Upload as P, CircleCloseFilled as I } from "@element-plus/icons-vue";
4
4
  import { useAsyncTask as O } from "@vrojs/use";
5
- import { ElButton as S, ElIcon as $ } from "element-plus";
6
- import { useLocale as j } from "../locale/useLocale.js";
7
- import { vroElFileUploadProps as q } from "./types.js";
8
- import { getVroElFileUploadOptions as z } from "./utils.js";
9
- const G = { class: "vro-el-file-upload" }, H = ["accept", "multiple"], J = { class: "vro-el-file-upload-content" }, K = ["href"], le = /* @__PURE__ */ N({
5
+ import { ElButton as S, ElIcon as j } from "element-plus";
6
+ import { useLocale as q } from "../locale/useLocale.js";
7
+ import { vroElFileUploadProps as z } from "./types.js";
8
+ import { getVroElFileUploadOptions as G } from "./utils.js";
9
+ const H = { class: "vro-el-file-upload" }, J = ["accept", "disabled", "multiple"], K = { class: "vro-el-file-upload-content" }, M = ["href"], te = /* @__PURE__ */ F({
10
10
  name: "VroElFileUpload",
11
11
  __name: "vro-el-file-upload",
12
- props: q,
12
+ props: z,
13
13
  emits: ["update:modelValue"],
14
- setup(_, { emit: b }) {
15
- const p = b, C = _, { t: w } = j(), n = h(() => ({
16
- ...z(),
17
- ...P(C, x)
18
- })), i = h(() => {
19
- const { modelValue: e } = n.value;
20
- return u(e) ? e : e ? [e] : [];
21
- }), U = (e) => {
22
- let l = "";
23
- u(n.value.modelValue) && (l = [...n.value.modelValue], l.splice(e, 1)), p("update:modelValue", l);
24
- }, { loading: B, trigger: m } = O(
25
- async (e) => {
26
- const l = e.target, o = Array.from(l.files ?? []);
27
- if (l.value = "", !o?.length)
14
+ setup(E, { emit: C }) {
15
+ const p = C, x = E, { t: U } = q(), e = _(() => ({
16
+ ...G(),
17
+ ...D(x, L)
18
+ })), i = _(() => {
19
+ const { modelValue: l } = e.value;
20
+ return c(l) ? l : l ? [l] : [];
21
+ }), w = (l) => {
22
+ let t = "";
23
+ c(e.value.modelValue) && (t = [...e.value.modelValue], t.splice(l, 1)), p("update:modelValue", t);
24
+ }, { loading: m, trigger: f } = O(
25
+ async (l) => {
26
+ const t = l.target, a = Array.from(t.files ?? []);
27
+ if (t.value = "", !a?.length)
28
28
  return;
29
- const { modelValue: a, max: c, upload: f, params: F } = n.value;
30
- if (!f)
29
+ const { modelValue: r, max: v, upload: g, params: B } = e.value;
30
+ if (!g)
31
31
  throw new Error("not set upload");
32
- const v = await f(o.slice(0, c - i.value.length), { params: F });
33
- let g = v[0];
34
- u(a) && (g = [...a, ...v]), p("update:modelValue", g);
32
+ const s = await g(a.slice(0, v - i.value.length), { params: B });
33
+ if (!s.length)
34
+ return;
35
+ let h = s[0];
36
+ c(r) && (h = [...r, ...s]), p("update:modelValue", h);
35
37
  },
36
38
  {
37
39
  throwError: !0
38
40
  }
39
41
  );
40
- return (e, l) => (r(), s("div", G, [
41
- i.value.length < e.max && !e.disabled ? (r(), V(t(S), {
42
+ return (l, t) => (n(), u("div", H, [
43
+ i.value.length < e.value.max && !e.value.disabled ? (n(), V(o(S), {
42
44
  key: 0,
43
45
  class: "vro-el-file-upload-btn",
44
- loading: t(B),
45
- disabled: e.disabled,
46
+ loading: o(m),
47
+ disabled: e.value.disabled,
46
48
  type: "primary",
47
- icon: "upload"
49
+ icon: o(P)
48
50
  }, {
49
- default: k(() => [
50
- A(E(t(w)("fileUpload.btnText")) + " ", 1),
51
+ default: b(() => [
52
+ N(k(o(U)("fileUpload.btnText")) + " ", 1),
51
53
  d("input", {
52
54
  type: "file",
53
- accept: e.accept,
54
- multiple: e.max > 1,
55
- onChange: l[0] || (l[0] = //@ts-ignore
56
- (...o) => t(m) && t(m)(...o))
57
- }, null, 40, H)
55
+ accept: e.value.accept,
56
+ disabled: o(m),
57
+ multiple: e.value.max > 1,
58
+ onChange: t[0] || (t[0] = //@ts-ignore
59
+ (...a) => o(f) && o(f)(...a))
60
+ }, null, 40, J)
58
61
  ]),
59
62
  _: 1
60
- }, 8, ["loading", "disabled"])) : y("", !0),
61
- d("ul", J, [
62
- (r(!0), s(T, null, D(i.value, (o, a) => (r(), s("li", {
63
+ }, 8, ["loading", "disabled", "icon"])) : y("", !0),
64
+ d("ul", K, [
65
+ (n(!0), u(A, null, T(i.value, (a, r) => (n(), u("li", {
63
66
  class: "vro-el-file-upload-item",
64
- key: a
67
+ key: `${a}-${r}`
65
68
  }, [
66
69
  d("a", {
67
- href: o,
70
+ href: a,
68
71
  target: "_blank"
69
- }, E(o), 9, K),
70
- e.disabled ? y("", !0) : (r(), V(t($), {
72
+ }, k(a), 9, M),
73
+ e.value.disabled ? y("", !0) : (n(), V(o(j), {
71
74
  key: 0,
72
- onClick: (c) => U(a)
75
+ class: "vro-el-file-upload-clear",
76
+ onClick: (v) => w(r)
73
77
  }, {
74
- default: k(() => [
75
- L(t(I))
78
+ default: b(() => [
79
+ $(o(I))
76
80
  ]),
77
81
  _: 1
78
82
  }, 8, ["onClick"]))
@@ -82,5 +86,5 @@ const G = { class: "vro-el-file-upload" }, H = ["accept", "multiple"], J = { cla
82
86
  }
83
87
  });
84
88
  export {
85
- le as default
89
+ te as default
86
90
  };
@@ -2,24 +2,20 @@ export * from './types';
2
2
  export declare const VroElIcon: import('@vrojs/base').WithInstall<{
3
3
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
4
4
  name: {
5
- type: import('vue').PropType<string | import('vue').Raw<object>>;
5
+ type: import('vue').PropType<import('./types').VroElIconName>;
6
6
  default: string;
7
7
  };
8
- size: {
9
- readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
10
- readonly required: false;
11
- readonly validator: ((val: unknown) => boolean) | undefined;
12
- __epPropKey: true;
13
- };
14
- color: {
15
- readonly type: import('vue').PropType<string>;
16
- readonly required: false;
17
- readonly validator: ((val: unknown) => boolean) | undefined;
18
- __epPropKey: true;
8
+ fontFamily: {
9
+ type: StringConstructor;
10
+ default: string;
19
11
  };
12
+ size: import('vue').PropType<string | number>;
13
+ color: StringConstructor;
14
+ loading: import('vue').PropType<boolean | string>;
20
15
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
21
- name: string | import('vue').Raw<object>;
22
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
16
+ name: import('./types').VroElIconName;
17
+ fontFamily: string;
18
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLElement, import('vue').ComponentProvideOptions, {
23
19
  P: {};
24
20
  B: {};
25
21
  D: {};
@@ -28,46 +24,38 @@ export declare const VroElIcon: import('@vrojs/base').WithInstall<{
28
24
  Defaults: {};
29
25
  }, Readonly<import('vue').ExtractPropTypes<{
30
26
  name: {
31
- type: import('vue').PropType<string | import('vue').Raw<object>>;
27
+ type: import('vue').PropType<import('./types').VroElIconName>;
32
28
  default: string;
33
29
  };
34
- size: {
35
- readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
36
- readonly required: false;
37
- readonly validator: ((val: unknown) => boolean) | undefined;
38
- __epPropKey: true;
39
- };
40
- color: {
41
- readonly type: import('vue').PropType<string>;
42
- readonly required: false;
43
- readonly validator: ((val: unknown) => boolean) | undefined;
44
- __epPropKey: true;
30
+ fontFamily: {
31
+ type: StringConstructor;
32
+ default: string;
45
33
  };
34
+ size: import('vue').PropType<string | number>;
35
+ color: StringConstructor;
36
+ loading: import('vue').PropType<boolean | string>;
46
37
  }>> & Readonly<{}>, {}, {}, {}, {}, {
47
- name: string | import('vue').Raw<object>;
38
+ name: import('./types').VroElIconName;
39
+ fontFamily: string;
48
40
  }>;
49
41
  __isFragment?: never;
50
42
  __isTeleport?: never;
51
43
  __isSuspense?: never;
52
44
  } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
53
45
  name: {
54
- type: import('vue').PropType<string | import('vue').Raw<object>>;
46
+ type: import('vue').PropType<import('./types').VroElIconName>;
55
47
  default: string;
56
48
  };
57
- size: {
58
- readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
59
- readonly required: false;
60
- readonly validator: ((val: unknown) => boolean) | undefined;
61
- __epPropKey: true;
62
- };
63
- color: {
64
- readonly type: import('vue').PropType<string>;
65
- readonly required: false;
66
- readonly validator: ((val: unknown) => boolean) | undefined;
67
- __epPropKey: true;
49
+ fontFamily: {
50
+ type: StringConstructor;
51
+ default: string;
68
52
  };
53
+ size: import('vue').PropType<string | number>;
54
+ color: StringConstructor;
55
+ loading: import('vue').PropType<boolean | string>;
69
56
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
70
- name: string | import('vue').Raw<object>;
57
+ name: import('./types').VroElIconName;
58
+ fontFamily: string;
71
59
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
72
60
  $slots: {
73
61
  default?(_: {}): any;
@@ -1,3 +1,4 @@
1
1
  import '../../style/base.css';
2
2
  /* empty css */
3
+ import "@vrojs/base/src/vro-icon/style/css";
3
4
  /* empty css */
@@ -1 +1 @@
1
- import "element-plus/es/components/icon/style/css";
1
+
@@ -1,4 +1,4 @@
1
1
  import '../../style/base.css';
2
- import "element-plus/es/components/icon/style/css";
3
2
  /* empty css */
3
+ import "@vrojs/base/src/vro-icon/style/css";
4
4
  /* empty css */
@@ -1,20 +1,23 @@
1
- import { ExtractPropTypes, PropType, Raw } from 'vue';
1
+ import { Component, ExtractPropTypes, PropType, Raw } from 'vue';
2
+ export type VroElIconName = string | Raw<Component>;
2
3
  export declare const vroElIconProps: {
4
+ /**
5
+ * 图标名称或组件。
6
+ *
7
+ * - 传入 Element Plus 图标组件对象时,按组件渲染
8
+ * - 传入大写开头的字符串时,按已注册组件名渲染
9
+ * - 传入普通字符串时,按 VroIcon 的字体图标或图片图标渲染
10
+ */
3
11
  name: {
4
- type: PropType<string | Raw<object>>;
12
+ type: PropType<VroElIconName>;
5
13
  default: string;
6
14
  };
7
- size: {
8
- readonly type: PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
9
- readonly required: false;
10
- readonly validator: ((val: unknown) => boolean) | undefined;
11
- __epPropKey: true;
12
- };
13
- color: {
14
- readonly type: PropType<string>;
15
- readonly required: false;
16
- readonly validator: ((val: unknown) => boolean) | undefined;
17
- __epPropKey: true;
15
+ fontFamily: {
16
+ type: StringConstructor;
17
+ default: string;
18
18
  };
19
+ size: PropType<string | number>;
20
+ color: StringConstructor;
21
+ loading: PropType<boolean | string>;
19
22
  };
20
23
  export type VroElIconProps = ExtractPropTypes<typeof vroElIconProps>;
@@ -1,6 +1,13 @@
1
- import { iconProps as o } from "element-plus";
1
+ import { vroIconProps as o } from "@vrojs/base";
2
2
  const t = {
3
3
  ...o,
4
+ /**
5
+ * 图标名称或组件。
6
+ *
7
+ * - 传入 Element Plus 图标组件对象时,按组件渲染
8
+ * - 传入大写开头的字符串时,按已注册组件名渲染
9
+ * - 传入普通字符串时,按 VroIcon 的字体图标或图片图标渲染
10
+ */
4
11
  name: {
5
12
  type: [String, Object],
6
13
  default: ""
@@ -4,46 +4,37 @@ declare function __VLS_template(): {
4
4
  default?(_: {}): any;
5
5
  };
6
6
  refs: {};
7
- rootEl: any;
7
+ rootEl: HTMLElement;
8
8
  };
9
9
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
10
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
11
11
  name: {
12
- type: import('vue').PropType<string | import('vue').Raw<object>>;
12
+ type: import('vue').PropType<import('./types').VroElIconName>;
13
13
  default: string;
14
14
  };
15
- size: {
16
- readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
17
- readonly required: false;
18
- readonly validator: ((val: unknown) => boolean) | undefined;
19
- __epPropKey: true;
20
- };
21
- color: {
22
- readonly type: import('vue').PropType<string>;
23
- readonly required: false;
24
- readonly validator: ((val: unknown) => boolean) | undefined;
25
- __epPropKey: true;
15
+ fontFamily: {
16
+ type: StringConstructor;
17
+ default: string;
26
18
  };
19
+ size: import('vue').PropType<string | number>;
20
+ color: StringConstructor;
21
+ loading: import('vue').PropType<boolean | string>;
27
22
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
28
23
  name: {
29
- type: import('vue').PropType<string | import('vue').Raw<object>>;
24
+ type: import('vue').PropType<import('./types').VroElIconName>;
30
25
  default: string;
31
26
  };
32
- size: {
33
- readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
34
- readonly required: false;
35
- readonly validator: ((val: unknown) => boolean) | undefined;
36
- __epPropKey: true;
37
- };
38
- color: {
39
- readonly type: import('vue').PropType<string>;
40
- readonly required: false;
41
- readonly validator: ((val: unknown) => boolean) | undefined;
42
- __epPropKey: true;
27
+ fontFamily: {
28
+ type: StringConstructor;
29
+ default: string;
43
30
  };
31
+ size: import('vue').PropType<string | number>;
32
+ color: StringConstructor;
33
+ loading: import('vue').PropType<boolean | string>;
44
34
  }>> & Readonly<{}>, {
45
- name: string | import('vue').Raw<object>;
46
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
35
+ name: import('./types').VroElIconName;
36
+ fontFamily: string;
37
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
47
38
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
48
39
  export default _default;
49
40
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,33 +1,37 @@
1
- import { defineComponent as c, computed as m, createBlock as t, openBlock as n, unref as a, mergeProps as i, withCtx as p, renderSlot as u, createElementBlock as f, resolveDynamicComponent as d, normalizeClass as k } from "vue";
2
- import { isString as v } from "@daysnap/utils";
3
- import { ElIcon as E } from "element-plus";
4
- import { vroElIconProps as C } from "./types.js";
5
- const B = /* @__PURE__ */ c({
1
+ import { defineComponent as c, computed as f, createBlock as l, openBlock as a, unref as p, mergeProps as u, withCtx as v, renderSlot as d, createCommentVNode as y, resolveDynamicComponent as _ } from "vue";
2
+ import { isString as g, isObject as C } from "@daysnap/utils";
3
+ import { VroIcon as b } from "@vrojs/base";
4
+ import { vroElIconProps as h } from "./types.js";
5
+ const j = /* @__PURE__ */ c({
6
6
  name: "VroElIcon",
7
7
  __name: "vro-el-icon",
8
- props: C,
9
- setup(s) {
10
- const r = s, l = m(() => {
11
- const { name: e } = r;
12
- if (v(e)) {
13
- const o = e.substring(0, 1);
14
- return o >= "A" && o <= "Z";
15
- }
16
- return !0;
8
+ props: h,
9
+ setup(i) {
10
+ const m = i, o = f(() => {
11
+ const { name: e, ...t } = m;
12
+ let r = null, n = t.fontFamily;
13
+ if (g(e)) {
14
+ const s = e.substring(0, 1);
15
+ s >= "A" && s <= "Z" ? (r = e, n = "") : Object.assign(t, { name: e });
16
+ } else C(e) && (r = e, n = "");
17
+ return {
18
+ is: r,
19
+ attrs: t,
20
+ fontFamily: n
21
+ };
17
22
  });
18
- return (e, o) => (n(), t(a(E), i({ class: "vro-el-icon" }, r), {
19
- default: p(() => [
20
- u(e.$slots, "default", {}, () => [
21
- l.value ? (n(), t(d(e.name), { key: 0 })) : (n(), f("i", {
22
- key: 1,
23
- class: k(["iconfont", [e.name]])
24
- }, null, 2))
23
+ return (e, t) => (a(), l(p(b), u({ class: "vro-el-icon" }, o.value.attrs, {
24
+ "font-family": o.value.fontFamily
25
+ }), {
26
+ default: v(() => [
27
+ d(e.$slots, "default", {}, () => [
28
+ o.value.is ? (a(), l(_(o.value.is), { key: 0 })) : y("", !0)
25
29
  ])
26
30
  ]),
27
31
  _: 3
28
- }, 16));
32
+ }, 16, ["font-family"]));
29
33
  }
30
34
  });
31
35
  export {
32
- B as default
36
+ j as default
33
37
  };
@@ -10,6 +10,8 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
10
10
  ratio: (NumberConstructor | StringConstructor)[];
11
11
  previewRatio: (NumberConstructor | StringConstructor)[];
12
12
  normalizeSrc: import('vue').PropType<import('./types').VroElImageNormalizeSrc>;
13
+ loadingProps: import('vue').PropType<Partial<import('@vrojs/base').VroLoadingProps>>;
14
+ iconProps: import('vue').PropType<Partial<import('..').VroElIconProps>>;
13
15
  hideOnClickModal: BooleanConstructor;
14
16
  src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
15
17
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "none" | "fill" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
@@ -48,9 +50,9 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
48
50
  __epPropKey: true;
49
51
  };
50
52
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
53
+ src: string;
51
54
  previewTeleported: boolean;
52
55
  hideOnClickModal: boolean;
53
- src: string;
54
56
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown>;
55
57
  lazy: boolean;
56
58
  previewSrcList: string[];
@@ -78,6 +80,8 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
78
80
  ratio: (NumberConstructor | StringConstructor)[];
79
81
  previewRatio: (NumberConstructor | StringConstructor)[];
80
82
  normalizeSrc: import('vue').PropType<import('./types').VroElImageNormalizeSrc>;
83
+ loadingProps: import('vue').PropType<Partial<import('@vrojs/base').VroLoadingProps>>;
84
+ iconProps: import('vue').PropType<Partial<import('..').VroElIconProps>>;
81
85
  hideOnClickModal: BooleanConstructor;
82
86
  src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
83
87
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "none" | "fill" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
@@ -116,9 +120,9 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
116
120
  __epPropKey: true;
117
121
  };
118
122
  }>> & Readonly<{}>, {}, {}, {}, {}, {
123
+ src: string;
119
124
  previewTeleported: boolean;
120
125
  hideOnClickModal: boolean;
121
- src: string;
122
126
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown>;
123
127
  lazy: boolean;
124
128
  previewSrcList: string[];
@@ -143,6 +147,8 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
143
147
  ratio: (NumberConstructor | StringConstructor)[];
144
148
  previewRatio: (NumberConstructor | StringConstructor)[];
145
149
  normalizeSrc: import('vue').PropType<import('./types').VroElImageNormalizeSrc>;
150
+ loadingProps: import('vue').PropType<Partial<import('@vrojs/base').VroLoadingProps>>;
151
+ iconProps: import('vue').PropType<Partial<import('..').VroElIconProps>>;
146
152
  hideOnClickModal: BooleanConstructor;
147
153
  src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
148
154
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "none" | "fill" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
@@ -181,9 +187,9 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
181
187
  __epPropKey: true;
182
188
  };
183
189
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
190
+ src: string;
184
191
  previewTeleported: boolean;
185
192
  hideOnClickModal: boolean;
186
- src: string;
187
193
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown>;
188
194
  lazy: boolean;
189
195
  previewSrcList: string[];
@@ -196,7 +202,7 @@ export declare const VroElImage: import('@vrojs/base').WithInstall<{
196
202
  maxScale: number;
197
203
  showProgress: boolean;
198
204
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
199
- $slots: Partial<Record<string, (_: any) => any>>;
205
+ $slots: Readonly<import('./types').VroElImageSlots> & import('./types').VroElImageSlots;
200
206
  })>;
201
207
  export default VroElImage;
202
208
  export type VroElImageInstance = InstanceType<typeof VroElImage>;
@@ -1,3 +1,7 @@
1
1
  import '../../style/base.css';
2
+ import './index.css';
2
3
  /* empty css */
4
+ import "@vrojs/base/src/vro-loading/style/css";
5
+ import "@vrojs/base/src/vro-icon/style/css";
6
+ /* empty css */
3
7
  /* empty css */
@@ -0,0 +1 @@
1
+ :root,:host{--vro-el-image-placeholder-background: var(--el-fill-color-light);--vro-el-image-loading-color: var(--el-text-color-placeholder);--vro-el-image-loading-size: 16px;--vro-el-image-error-background: var(--el-fill-color-light);--vro-el-image-error-color: var(--el-text-color-placeholder);--vro-el-image-error-icon-size: 24px}.vro-el-image-placeholder,.vro-el-image-error{display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden}.vro-el-image-placeholder{--vro-loading-color: var(--vro-el-image-loading-color);--vro-loading-size: var(--vro-el-image-loading-size);background-color:var(--vro-el-image-placeholder-background)}.vro-el-image-error{color:var(--vro-el-image-error-color);background-color:var(--vro-el-image-error-background)}.vro-el-image-error-icon{font-size:var(--vro-el-image-error-icon-size)}
@@ -1,4 +1,8 @@
1
1
  import '../../style/base.css';
2
+ import './index.css';
2
3
  import "element-plus/es/components/image/style/css";
3
4
  /* empty css */
5
+ import "@vrojs/base/src/vro-loading/style/css";
6
+ import "@vrojs/base/src/vro-icon/style/css";
7
+ /* empty css */
4
8
  /* empty css */
@@ -1,18 +1,43 @@
1
+ import { VroLoadingProps, VroSlot } from '@vrojs/base';
1
2
  import { ExtractPropTypes, PropType } from 'vue';
3
+ import { VroElIconProps } from '../vro-el-icon';
2
4
  export type VroElImageNormalizeSrc = (options: {
3
5
  src: string;
4
6
  ratio?: string | number;
5
7
  baseUrl?: string;
6
8
  }) => string;
7
9
  export declare const vroElImageProps: {
10
+ /**
11
+ * 图片预览是否插入到 body。
12
+ */
8
13
  previewTeleported: {
9
14
  type: BooleanConstructor;
10
15
  default: boolean;
11
16
  };
17
+ /**
18
+ * 图片基础地址,会传入 normalizeSrc 统一处理。
19
+ */
12
20
  baseUrl: StringConstructor;
21
+ /**
22
+ * 图片地址转换比例。
23
+ */
13
24
  ratio: (NumberConstructor | StringConstructor)[];
25
+ /**
26
+ * 预览图片地址转换比例,默认使用 ratio。
27
+ */
14
28
  previewRatio: (NumberConstructor | StringConstructor)[];
29
+ /**
30
+ * 图片地址转换方法。
31
+ */
15
32
  normalizeSrc: PropType<VroElImageNormalizeSrc>;
33
+ /**
34
+ * 默认加载占位图标属性。
35
+ */
36
+ loadingProps: PropType<Partial<VroLoadingProps>>;
37
+ /**
38
+ * 默认加载失败图标属性。
39
+ */
40
+ iconProps: PropType<Partial<VroElIconProps>>;
16
41
  hideOnClickModal: BooleanConstructor;
17
42
  src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
18
43
  fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "none" | "fill" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
@@ -52,3 +77,13 @@ export declare const vroElImageProps: {
52
77
  };
53
78
  };
54
79
  export type VroElImageProps = ExtractPropTypes<typeof vroElImageProps>;
80
+ export interface VroElImageSlots {
81
+ /**
82
+ * 自定义图片加载中占位内容。
83
+ */
84
+ placeholder?: VroSlot;
85
+ /**
86
+ * 自定义图片加载失败内容。
87
+ */
88
+ error?: VroSlot;
89
+ }