@zl-ui-kit/components 0.9.0 → 0.10.1

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 (44) hide show
  1. package/README.md +355 -190
  2. package/dist/components/ZlAddSub/index.css +1 -1
  3. package/dist/components/ZlAddSub/index.vue.mjs +2 -2
  4. package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +1 -1
  5. package/dist/components/ZlCardPage/index.vue.d.ts +94 -36
  6. package/dist/components/ZlCardPage/index.vue.mjs +2 -0
  7. package/dist/components/ZlChart/index.vue.d.ts +1 -0
  8. package/dist/components/ZlChart/index.vue.mjs +1 -0
  9. package/dist/components/ZlCheckAll/index.css +1 -1
  10. package/dist/components/ZlCheckAll/index.vue.mjs +1 -1
  11. package/dist/components/ZlDictTag/index.vue.d.ts +11 -3
  12. package/dist/components/ZlDictTag/index.vue.mjs +32 -23
  13. package/dist/components/ZlDynamicComponent/index.vue.d.ts +8 -3
  14. package/dist/components/ZlDynamicComponent/index.vue.mjs +24 -19
  15. package/dist/components/ZlEditor/ZlSqlEditor.vue.d.ts +28 -2
  16. package/dist/components/ZlEditor/ZlSqlEditor.vue.mjs +27 -18
  17. package/dist/components/ZlEditor/index.vue.d.ts +22 -1
  18. package/dist/components/ZlEditor/index.vue.mjs +47 -24
  19. package/dist/components/ZlForm/index.vue.d.ts +28 -2
  20. package/dist/components/ZlForm/index.vue.mjs +96 -90
  21. package/dist/components/ZlGrid/index.vue.d.ts +1 -1
  22. package/dist/components/ZlIcon/index.css +1 -1
  23. package/dist/components/ZlIcon/index.vue.d.ts +6 -2
  24. package/dist/components/ZlIcon/index.vue.mjs +2 -2
  25. package/dist/components/ZlIcon/index2.vue.mjs +30 -23
  26. package/dist/components/ZlPagination/index.css +1 -1
  27. package/dist/components/ZlPagination/index.vue.mjs +1 -1
  28. package/dist/components/ZlSearch/index.vue.d.ts +82 -23
  29. package/dist/components/ZlSearch/index.vue.mjs +8 -1
  30. package/dist/components/ZlSearchTable/index.vue.d.ts +180 -40
  31. package/dist/components/ZlSearchTable/index.vue.mjs +4 -0
  32. package/dist/components/ZlSorter/ZlSorterList.css +1 -1
  33. package/dist/components/ZlSorter/ZlSorterList.vue.d.ts +1 -1
  34. package/dist/components/ZlSorter/ZlSorterList.vue.mjs +2 -2
  35. package/dist/components/ZlSorter/index.css +1 -1
  36. package/dist/components/ZlSorter/index.vue.mjs +2 -2
  37. package/dist/components/ZlSwitch/index.vue.d.ts +6 -2
  38. package/dist/components/ZlSwitch/index.vue.mjs +26 -24
  39. package/dist/components/ZlTable/index.vue.d.ts +36 -1
  40. package/dist/components/ZlTable/index.vue.mjs +98 -75
  41. package/dist/components/ZlTabs/index.vue.d.ts +20 -3
  42. package/dist/components/ZlTabs/index.vue.mjs +30 -20
  43. package/dist/components/ZlTag/index.vue.d.ts +2 -2
  44. package/package.json +6 -6
@@ -1,34 +1,41 @@
1
- import { defineComponent as a, computed as t, openBlock as n, createElementBlock as c, renderSlot as u, createBlock as d, unref as m, normalizeStyle as f, createElementVNode as k, createCommentVNode as h } from "vue";
2
- import { Icon as v } from "@iconify/vue/offline";
3
- const x = { class: "zl-icon" }, y = {
4
- key: 2,
5
- class: "zl-icon--local"
6
- }, I = ["xlink:href"], E = /* @__PURE__ */ a({
1
+ import { defineComponent as v, useAttrs as z, computed as t, openBlock as o, createElementBlock as s, normalizeStyle as k, unref as r, normalizeClass as h, renderSlot as x, createBlock as I, mergeProps as i, createElementVNode as S, createCommentVNode as $ } from "vue";
2
+ import { Icon as A } from "@iconify/vue/offline";
3
+ const B = ["xlink:href"], g = /* @__PURE__ */ v({
7
4
  name: "ZlIcon",
5
+ inheritAttrs: !1,
8
6
  __name: "index",
9
7
  props: {
10
- icon: {}
8
+ icon: {},
9
+ size: {},
10
+ color: {}
11
11
  },
12
- setup(e) {
13
- const o = e, l = t(() => o.icon.startsWith("http")), i = t(() => o.icon.includes(":")), r = t(() => `#icon-${o.icon}`);
14
- return (s, p) => (n(), c("div", x, [
15
- u(s.$slots, "default", {}, () => [
16
- i.value ? (n(), d(m(v), {
17
- key: 0,
18
- id: e.icon,
19
- icon: e.icon
20
- }, null, 8, ["id", "icon"])) : l.value ? (n(), c("div", {
21
- key: 1,
22
- style: f({ mask: `url(${e.icon}) no-repeat 50% 50%` }),
12
+ setup(n) {
13
+ const e = n, l = z(), u = t(() => ({
14
+ fontSize: typeof e.size == "number" ? `${e.size}px` : e.size,
15
+ color: e.color
16
+ })), c = t(() => {
17
+ const { class: a, style: y, ...p } = l;
18
+ return p;
19
+ }), m = t(() => e.icon.startsWith("http")), d = t(() => e.icon.includes(":")), f = t(() => `#icon-${e.icon}`);
20
+ return (a, y) => (o(), s("div", {
21
+ class: h(["zl-icon", r(l).class]),
22
+ style: k([u.value, r(l).style])
23
+ }, [
24
+ x(a.$slots, "default", {}, () => [
25
+ d.value ? (o(), I(r(A), i({ key: 0 }, c.value, {
26
+ id: n.icon,
27
+ icon: n.icon
28
+ }), null, 16, ["id", "icon"])) : m.value ? (o(), s("div", i({ key: 1 }, c.value, {
29
+ style: { mask: `url(${n.icon}) no-repeat 50% 50%` },
23
30
  class: "zl-icon--external"
24
- }, null, 4)) : e.icon ? (n(), c("svg", y, [
25
- k("use", { "xlink:href": r.value }, null, 8, I)
26
- ])) : h("", !0)
31
+ }), null, 16)) : n.icon ? (o(), s("svg", i({ key: 2 }, c.value, { class: "zl-icon--local" }), [
32
+ S("use", { "xlink:href": f.value }, null, 8, B)
33
+ ], 16)) : $("", !0)
27
34
  ], !0)
28
- ]));
35
+ ], 6));
29
36
  }
30
37
  });
31
38
  export {
32
- E as default
39
+ g as default
33
40
  };
34
41
  //# sourceMappingURL=index2.vue.mjs.map
@@ -1 +1 @@
1
- @charset "UTF-8";.zl-pagination[data-v-fd07517c]{padding:6px 16px;background-color:var(--zl-fill-1, #f9fbfd);justify-content:var(--zl-pagination-justify, flex-end)}.zl-pagination--left[data-v-fd07517c]{--zl-pagination-justify: flex-start}.zl-pagination--center[data-v-fd07517c]{--zl-pagination-justify: center}.zl-pagination--right[data-v-fd07517c]{--zl-pagination-justify: flex-end}
1
+ @charset "UTF-8";.zl-pagination[data-v-78457fcd]{padding:6px 16px;background-color:var(--zl-fill-1, #f9fbfd);justify-content:var(--zl-pagination-justify, flex-end)}.zl-pagination--left[data-v-78457fcd]{--zl-pagination-justify: flex-start}.zl-pagination--center[data-v-78457fcd]{--zl-pagination-justify: center}.zl-pagination--right[data-v-78457fcd]{--zl-pagination-justify: flex-end}
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.vue.mjs";
2
2
  import './index.css';/* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fd07517c"]]);
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-78457fcd"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -78,8 +78,15 @@ declare function __VLS_template(): {
78
78
  items: import('../..').FormItem[];
79
79
  model?: Record<string, any>;
80
80
  }> & Readonly<{}>, {
81
- validate: () => Promise<void>;
82
- validateField: (name: string) => Promise<void>;
81
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
82
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
83
+ resetFields: (props?: string | string[]) => any;
84
+ clearValidate: (props?: string | string[]) => any;
85
+ scrollToField: (prop: string) => any;
86
+ getField: (prop: string) => any;
87
+ fields: any;
88
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
89
+ elForm: any;
83
90
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
84
91
  items: import('../..').FormItem[];
85
92
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -107,9 +114,16 @@ declare function __VLS_template(): {
107
114
  }> & Omit<Readonly<{
108
115
  items: import('../..').FormItem[];
109
116
  model?: Record<string, any>;
110
- }> & Readonly<{}>, "items" | "validate" | "validateField"> & {
111
- validate: () => Promise<void>;
112
- validateField: (name: string) => Promise<void>;
117
+ }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
118
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
119
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
120
+ resetFields: (props?: string | string[]) => any;
121
+ clearValidate: (props?: string | string[]) => any;
122
+ scrollToField: (prop: string) => any;
123
+ getField: (prop: string) => any;
124
+ fields: any;
125
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
126
+ elForm: any;
113
127
  } & {} & import('vue').ComponentCustomProperties & {} & {
114
128
  $slots: Partial<Record<string, (_: {
115
129
  model: Record<string, any>;
@@ -165,8 +179,15 @@ declare function __VLS_template(): {
165
179
  items: import('../..').FormItem[];
166
180
  model?: Record<string, any>;
167
181
  }> & Readonly<{}>, {
168
- validate: () => Promise<void>;
169
- validateField: (name: string) => Promise<void>;
182
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
183
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
184
+ resetFields: (props?: string | string[]) => any;
185
+ clearValidate: (props?: string | string[]) => any;
186
+ scrollToField: (prop: string) => any;
187
+ getField: (prop: string) => any;
188
+ fields: any;
189
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
190
+ elForm: any;
170
191
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
171
192
  items: import('../..').FormItem[];
172
193
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -194,9 +215,16 @@ declare function __VLS_template(): {
194
215
  }> & Omit<Readonly<{
195
216
  items: import('../..').FormItem[];
196
217
  model?: Record<string, any>;
197
- }> & Readonly<{}>, "items" | "validate" | "validateField"> & {
198
- validate: () => Promise<void>;
199
- validateField: (name: string) => Promise<void>;
218
+ }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
219
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
220
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
221
+ resetFields: (props?: string | string[]) => any;
222
+ clearValidate: (props?: string | string[]) => any;
223
+ scrollToField: (prop: string) => any;
224
+ getField: (prop: string) => any;
225
+ fields: any;
226
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
227
+ elForm: any;
200
228
  } & {} & import('vue').ComponentCustomProperties & {} & {
201
229
  $slots: Partial<Record<string, (_: {
202
230
  model: Record<string, any>;
@@ -232,18 +260,21 @@ declare function __VLS_template(): {
232
260
  };
233
261
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
234
262
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
263
+ /** 当前查询表单值(已按各项 `toParams` 转换),可直接当请求入参 */
235
264
  params: import('vue').ComputedRef<Record<string, any>>;
265
+ /** 收起展开态并触发 `search` 事件(本身不做校验,带校验的查询走组件内查询按钮) */
236
266
  search: typeof search;
267
+ /** 重置表单并清除校验提示,随后触发 `reset` 事件与一次 `search` */
237
268
  reset: typeof reset;
238
269
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
239
- search: (params: Record<string, any>) => any;
240
270
  reset: () => any;
271
+ search: (params: Record<string, any>) => any;
241
272
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
242
- onSearch?: ((params: Record<string, any>) => any) | undefined;
243
273
  onReset?: (() => any) | undefined;
274
+ onSearch?: ((params: Record<string, any>) => any) | undefined;
244
275
  }>, {
245
- immediate: boolean;
246
276
  disabled: boolean;
277
+ immediate: boolean;
247
278
  items: SearchItem[];
248
279
  labelsVisible: boolean;
249
280
  showLabels: boolean;
@@ -273,8 +304,15 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
273
304
  items: import('../..').FormItem[];
274
305
  model?: Record<string, any>;
275
306
  }> & Readonly<{}>, {
276
- validate: () => Promise<void>;
277
- validateField: (name: string) => Promise<void>;
307
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
308
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
309
+ resetFields: (props?: string | string[]) => any;
310
+ clearValidate: (props?: string | string[]) => any;
311
+ scrollToField: (prop: string) => any;
312
+ getField: (prop: string) => any;
313
+ fields: any;
314
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
315
+ elForm: any;
278
316
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
279
317
  items: import('../..').FormItem[];
280
318
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -302,9 +340,16 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
302
340
  }> & Omit<Readonly<{
303
341
  items: import('../..').FormItem[];
304
342
  model?: Record<string, any>;
305
- }> & Readonly<{}>, "items" | "validate" | "validateField"> & {
306
- validate: () => Promise<void>;
307
- validateField: (name: string) => Promise<void>;
343
+ }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
344
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
345
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
346
+ resetFields: (props?: string | string[]) => any;
347
+ clearValidate: (props?: string | string[]) => any;
348
+ scrollToField: (prop: string) => any;
349
+ getField: (prop: string) => any;
350
+ fields: any;
351
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
352
+ elForm: any;
308
353
  } & {} & import('vue').ComponentCustomProperties & {} & {
309
354
  $slots: Partial<Record<string, (_: {
310
355
  model: Record<string, any>;
@@ -360,8 +405,15 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
360
405
  items: import('../..').FormItem[];
361
406
  model?: Record<string, any>;
362
407
  }> & Readonly<{}>, {
363
- validate: () => Promise<void>;
364
- validateField: (name: string) => Promise<void>;
408
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
409
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
410
+ resetFields: (props?: string | string[]) => any;
411
+ clearValidate: (props?: string | string[]) => any;
412
+ scrollToField: (prop: string) => any;
413
+ getField: (prop: string) => any;
414
+ fields: any;
415
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
416
+ elForm: any;
365
417
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
366
418
  items: import('../..').FormItem[];
367
419
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -389,9 +441,16 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
389
441
  }> & Omit<Readonly<{
390
442
  items: import('../..').FormItem[];
391
443
  model?: Record<string, any>;
392
- }> & Readonly<{}>, "items" | "validate" | "validateField"> & {
393
- validate: () => Promise<void>;
394
- validateField: (name: string) => Promise<void>;
444
+ }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
445
+ validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
446
+ validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
447
+ resetFields: (props?: string | string[]) => any;
448
+ clearValidate: (props?: string | string[]) => any;
449
+ scrollToField: (prop: string) => any;
450
+ getField: (prop: string) => any;
451
+ fields: any;
452
+ setInitialValues: (values: Record<string, any>, clearValidate?: boolean) => any;
453
+ elForm: any;
395
454
  } & {} & import('vue').ComponentCustomProperties & {} & {
396
455
  $slots: Partial<Record<string, (_: {
397
456
  model: Record<string, any>;
@@ -99,7 +99,14 @@ const de = { class: "zl-search" }, me = {
99
99
  async () => {
100
100
  await w(), H();
101
101
  }
102
- ), u.immediate && (async () => (await w(), _()))(), D({ params: j, search: V, reset: x }), (e, l) => {
102
+ ), u.immediate && (async () => (await w(), _()))(), D({
103
+ /** 当前查询表单值(已按各项 `toParams` 转换),可直接当请求入参 */
104
+ params: j,
105
+ /** 收起展开态并触发 `search` 事件(本身不做校验,带校验的查询走组件内查询按钮) */
106
+ search: V,
107
+ /** 重置表单并清除校验提示,随后触发 `reset` 事件与一次 `search` */
108
+ reset: x
109
+ }), (e, l) => {
103
110
  const i = se("el-button");
104
111
  return c(), f("div", de, [
105
112
  v.value.length ? (c(), f("div", me, [