@zl-ui-kit/components 0.18.2 → 0.18.4

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.
@@ -30,6 +30,8 @@ type __VLS_Props = {
30
30
  } | UseRequestInstance;
31
31
  /** 搜索表单项配置,为空则不渲染搜索栏 */
32
32
  queryItems?: SearchItem[];
33
+ /** 搜索项 label 为空时是否不渲染 label 占位,透传给 ZlSearch / ZlForm 的 hideEmptyLabel */
34
+ hideEmptyLabel?: boolean;
33
35
  /** 分页配置,false 关闭分页,对象则透传 */
34
36
  pagination?: Record<string, any> | boolean;
35
37
  /** 卡片数据的唯一键字段名,默认 id */
@@ -54,6 +56,7 @@ declare function __VLS_template(): {
54
56
  slot?: boolean;
55
57
  slots?: Record<string, any>;
56
58
  props: Record<string, any>;
59
+ hideLabel?: boolean;
57
60
  };
58
61
  }) => any>> & {
59
62
  'search-actions'?(_: {}): any;
@@ -72,6 +75,7 @@ declare function __VLS_template(): {
72
75
  readonly immediate?: boolean | undefined;
73
76
  readonly disabled?: boolean | undefined;
74
77
  readonly labelsVisible?: boolean | undefined;
78
+ readonly hideEmptyLabel?: boolean | undefined;
75
79
  readonly showLabels?: boolean | undefined;
76
80
  readonly onReset?: (() => any) | undefined;
77
81
  readonly onSearch?: ((params: Record<string, any>) => any) | undefined;
@@ -86,6 +90,7 @@ declare function __VLS_template(): {
86
90
  $props: {
87
91
  readonly items: import('../..').FormItem[];
88
92
  readonly model?: Record<string, any> | undefined;
93
+ readonly hideEmptyLabel?: boolean | undefined;
89
94
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
90
95
  $attrs: import('vue').Attrs;
91
96
  $refs: {
@@ -104,6 +109,7 @@ declare function __VLS_template(): {
104
109
  $options: import('vue').ComponentOptionsBase<Readonly<{
105
110
  items: import('../..').FormItem[];
106
111
  model?: Record<string, any>;
112
+ hideEmptyLabel?: boolean;
107
113
  }> & Readonly<{}>, {
108
114
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
109
115
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -141,6 +147,7 @@ declare function __VLS_template(): {
141
147
  }> & Omit<Readonly<{
142
148
  items: import('../..').FormItem[];
143
149
  model?: Record<string, any>;
150
+ hideEmptyLabel?: boolean;
144
151
  }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
145
152
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
146
153
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -163,6 +170,7 @@ declare function __VLS_template(): {
163
170
  slot?: boolean;
164
171
  slots?: Record<string, any>;
165
172
  props: Record<string, any>;
173
+ hideLabel?: boolean;
166
174
  };
167
175
  }) => any>> & {
168
176
  label?(_: {
@@ -176,6 +184,7 @@ declare function __VLS_template(): {
176
184
  slot?: boolean;
177
185
  slots?: Record<string, any>;
178
186
  props: Record<string, any>;
187
+ hideLabel?: boolean;
179
188
  };
180
189
  }): any;
181
190
  default?(_: {}): any;
@@ -187,6 +196,7 @@ declare function __VLS_template(): {
187
196
  $props: {
188
197
  readonly items: import('../..').FormItem[];
189
198
  readonly model?: Record<string, any> | undefined;
199
+ readonly hideEmptyLabel?: boolean | undefined;
190
200
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
191
201
  $attrs: import('vue').Attrs;
192
202
  $refs: {
@@ -205,6 +215,7 @@ declare function __VLS_template(): {
205
215
  $options: import('vue').ComponentOptionsBase<Readonly<{
206
216
  items: import('../..').FormItem[];
207
217
  model?: Record<string, any>;
218
+ hideEmptyLabel?: boolean;
208
219
  }> & Readonly<{}>, {
209
220
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
210
221
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -242,6 +253,7 @@ declare function __VLS_template(): {
242
253
  }> & Omit<Readonly<{
243
254
  items: import('../..').FormItem[];
244
255
  model?: Record<string, any>;
256
+ hideEmptyLabel?: boolean;
245
257
  }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
246
258
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
247
259
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -264,6 +276,7 @@ declare function __VLS_template(): {
264
276
  slot?: boolean;
265
277
  slots?: Record<string, any>;
266
278
  props: Record<string, any>;
279
+ hideLabel?: boolean;
267
280
  };
268
281
  }) => any>> & {
269
282
  label?(_: {
@@ -277,6 +290,7 @@ declare function __VLS_template(): {
277
290
  slot?: boolean;
278
291
  slots?: Record<string, any>;
279
292
  props: Record<string, any>;
293
+ hideLabel?: boolean;
280
294
  };
281
295
  }): any;
282
296
  default?(_: {}): any;
@@ -297,6 +311,7 @@ declare function __VLS_template(): {
297
311
  immediate?: boolean;
298
312
  disabled?: boolean;
299
313
  labelsVisible?: boolean;
314
+ hideEmptyLabel?: boolean;
300
315
  showLabels?: boolean;
301
316
  }> & Readonly<{
302
317
  onReset?: (() => any) | undefined;
@@ -312,6 +327,7 @@ declare function __VLS_template(): {
312
327
  disabled: boolean;
313
328
  immediate: boolean;
314
329
  items: SearchItem[];
330
+ hideEmptyLabel: boolean;
315
331
  labelsVisible: boolean;
316
332
  showLabels: boolean;
317
333
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -338,6 +354,7 @@ declare function __VLS_template(): {
338
354
  disabled: boolean;
339
355
  immediate: boolean;
340
356
  items: SearchItem[];
357
+ hideEmptyLabel: boolean;
341
358
  labelsVisible: boolean;
342
359
  showLabels: boolean;
343
360
  }> & Omit<Readonly<{
@@ -346,11 +363,12 @@ declare function __VLS_template(): {
346
363
  immediate?: boolean;
347
364
  disabled?: boolean;
348
365
  labelsVisible?: boolean;
366
+ hideEmptyLabel?: boolean;
349
367
  showLabels?: boolean;
350
368
  }> & Readonly<{
351
369
  onReset?: (() => any) | undefined;
352
370
  onSearch?: ((params: Record<string, any>) => any) | undefined;
353
- }>, "reset" | "search" | "params" | ("disabled" | "immediate" | "items" | "labelsVisible" | "showLabels")> & {
371
+ }>, "reset" | "search" | "params" | ("disabled" | "immediate" | "items" | "hideEmptyLabel" | "labelsVisible" | "showLabels")> & {
354
372
  params: Record<string, any>;
355
373
  search: () => Promise<void>;
356
374
  reset: () => Promise<void>;
@@ -366,6 +384,7 @@ declare function __VLS_template(): {
366
384
  slot?: boolean;
367
385
  slots?: Record<string, any>;
368
386
  props: Record<string, any>;
387
+ hideLabel?: boolean;
369
388
  };
370
389
  }) => any>> & Partial<Record<string, (_: {
371
390
  model: Record<string, any>;
@@ -378,6 +397,7 @@ declare function __VLS_template(): {
378
397
  slot?: boolean;
379
398
  slots?: Record<string, any>;
380
399
  props: Record<string, any>;
400
+ hideLabel?: boolean;
381
401
  };
382
402
  }) => any>> & {
383
403
  actions?(_: {}): any;
@@ -400,6 +420,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
400
420
  "onSearch-reset"?: (() => any) | undefined;
401
421
  }>, {
402
422
  immediate: boolean;
423
+ hideEmptyLabel: boolean;
403
424
  queryItems: SearchItem[];
404
425
  pagination: Record<string, any> | boolean;
405
426
  itemKey: string;
@@ -413,6 +434,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
413
434
  readonly immediate?: boolean | undefined;
414
435
  readonly disabled?: boolean | undefined;
415
436
  readonly labelsVisible?: boolean | undefined;
437
+ readonly hideEmptyLabel?: boolean | undefined;
416
438
  readonly showLabels?: boolean | undefined;
417
439
  readonly onReset?: (() => any) | undefined;
418
440
  readonly onSearch?: ((params: Record<string, any>) => any) | undefined;
@@ -427,6 +449,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
427
449
  $props: {
428
450
  readonly items: import('../..').FormItem[];
429
451
  readonly model?: Record<string, any> | undefined;
452
+ readonly hideEmptyLabel?: boolean | undefined;
430
453
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
431
454
  $attrs: import('vue').Attrs;
432
455
  $refs: {
@@ -445,6 +468,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
445
468
  $options: import('vue').ComponentOptionsBase<Readonly<{
446
469
  items: import('../..').FormItem[];
447
470
  model?: Record<string, any>;
471
+ hideEmptyLabel?: boolean;
448
472
  }> & Readonly<{}>, {
449
473
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
450
474
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -482,6 +506,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
482
506
  }> & Omit<Readonly<{
483
507
  items: import('../..').FormItem[];
484
508
  model?: Record<string, any>;
509
+ hideEmptyLabel?: boolean;
485
510
  }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
486
511
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
487
512
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -504,6 +529,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
504
529
  slot?: boolean;
505
530
  slots?: Record<string, any>;
506
531
  props: Record<string, any>;
532
+ hideLabel?: boolean;
507
533
  };
508
534
  }) => any>> & {
509
535
  label?(_: {
@@ -517,6 +543,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
517
543
  slot?: boolean;
518
544
  slots?: Record<string, any>;
519
545
  props: Record<string, any>;
546
+ hideLabel?: boolean;
520
547
  };
521
548
  }): any;
522
549
  default?(_: {}): any;
@@ -528,6 +555,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
528
555
  $props: {
529
556
  readonly items: import('../..').FormItem[];
530
557
  readonly model?: Record<string, any> | undefined;
558
+ readonly hideEmptyLabel?: boolean | undefined;
531
559
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
532
560
  $attrs: import('vue').Attrs;
533
561
  $refs: {
@@ -546,6 +574,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
546
574
  $options: import('vue').ComponentOptionsBase<Readonly<{
547
575
  items: import('../..').FormItem[];
548
576
  model?: Record<string, any>;
577
+ hideEmptyLabel?: boolean;
549
578
  }> & Readonly<{}>, {
550
579
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
551
580
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -583,6 +612,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
583
612
  }> & Omit<Readonly<{
584
613
  items: import('../..').FormItem[];
585
614
  model?: Record<string, any>;
615
+ hideEmptyLabel?: boolean;
586
616
  }> & Readonly<{}>, "items" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "setInitialValues" | "elForm" | "fields"> & {
587
617
  validate: (callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
588
618
  validateField: (props?: string | string[], callback?: (isValid: boolean, invalidFields?: Record<string, any>) => void) => Promise<boolean>;
@@ -605,6 +635,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
605
635
  slot?: boolean;
606
636
  slots?: Record<string, any>;
607
637
  props: Record<string, any>;
638
+ hideLabel?: boolean;
608
639
  };
609
640
  }) => any>> & {
610
641
  label?(_: {
@@ -618,6 +649,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
618
649
  slot?: boolean;
619
650
  slots?: Record<string, any>;
620
651
  props: Record<string, any>;
652
+ hideLabel?: boolean;
621
653
  };
622
654
  }): any;
623
655
  default?(_: {}): any;
@@ -638,6 +670,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
638
670
  immediate?: boolean;
639
671
  disabled?: boolean;
640
672
  labelsVisible?: boolean;
673
+ hideEmptyLabel?: boolean;
641
674
  showLabels?: boolean;
642
675
  }> & Readonly<{
643
676
  onReset?: (() => any) | undefined;
@@ -653,6 +686,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
653
686
  disabled: boolean;
654
687
  immediate: boolean;
655
688
  items: SearchItem[];
689
+ hideEmptyLabel: boolean;
656
690
  labelsVisible: boolean;
657
691
  showLabels: boolean;
658
692
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
@@ -679,6 +713,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
679
713
  disabled: boolean;
680
714
  immediate: boolean;
681
715
  items: SearchItem[];
716
+ hideEmptyLabel: boolean;
682
717
  labelsVisible: boolean;
683
718
  showLabels: boolean;
684
719
  }> & Omit<Readonly<{
@@ -687,11 +722,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
687
722
  immediate?: boolean;
688
723
  disabled?: boolean;
689
724
  labelsVisible?: boolean;
725
+ hideEmptyLabel?: boolean;
690
726
  showLabels?: boolean;
691
727
  }> & Readonly<{
692
728
  onReset?: (() => any) | undefined;
693
729
  onSearch?: ((params: Record<string, any>) => any) | undefined;
694
- }>, "reset" | "search" | "params" | ("disabled" | "immediate" | "items" | "labelsVisible" | "showLabels")> & {
730
+ }>, "reset" | "search" | "params" | ("disabled" | "immediate" | "items" | "hideEmptyLabel" | "labelsVisible" | "showLabels")> & {
695
731
  params: Record<string, any>;
696
732
  search: () => Promise<void>;
697
733
  reset: () => Promise<void>;
@@ -707,6 +743,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
707
743
  slot?: boolean;
708
744
  slots?: Record<string, any>;
709
745
  props: Record<string, any>;
746
+ hideLabel?: boolean;
710
747
  };
711
748
  }) => any>> & Partial<Record<string, (_: {
712
749
  model: Record<string, any>;
@@ -719,6 +756,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
719
756
  slot?: boolean;
720
757
  slots?: Record<string, any>;
721
758
  props: Record<string, any>;
759
+ hideLabel?: boolean;
722
760
  };
723
761
  }) => any>> & {
724
762
  actions?(_: {}): any;
@@ -1,25 +1,26 @@
1
- import { defineComponent as M, useSlots as V, ref as _, computed as u, watch as x, resolveDirective as F, withDirectives as L, openBlock as m, createElementBlock as z, normalizeStyle as G, createBlock as g, createSlots as H, withCtx as P, renderSlot as v, renderList as k, normalizeProps as J, guardReactiveProps as Q, createCommentVNode as q, createElementVNode as $, Fragment as T, mergeProps as D, unref as h } from "vue";
2
- import { usePageableRequest as U } from "@zl-ui-kit/composables";
3
- import { isArray as b } from "@zl-ui-kit/utils";
4
- import X from "../ZlEmpty/index.vue.mjs";
5
- import Y from "../ZlPagination/index.vue.mjs";
1
+ import { defineComponent as K, useSlots as M, ref as V, computed as u, watch as x, resolveDirective as F, withDirectives as G, openBlock as m, createElementBlock as z, normalizeStyle as H, createBlock as g, createSlots as J, withCtx as P, renderSlot as h, renderList as b, normalizeProps as Q, guardReactiveProps as T, createCommentVNode as k, createElementVNode as q, Fragment as U, mergeProps as $, unref as v } from "vue";
2
+ import { usePageableRequest as X } from "@zl-ui-kit/composables";
3
+ import { isArray as D } from "@zl-ui-kit/utils";
4
+ import Y from "../ZlEmpty/index.vue.mjs";
5
+ import _ from "../ZlPagination/index.vue.mjs";
6
6
  import ee from "../ZlSearch/index.vue.mjs";
7
7
  import '../ZlSearch/index.css';/* empty css */
8
8
  import { usePagination as te } from "../ZlPagination/usePagination.mjs";
9
- const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list" }, N = "search-", de = /* @__PURE__ */ M({
9
+ const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list" }, B = "search-", de = /* @__PURE__ */ K({
10
10
  name: "ZlCardPage",
11
11
  __name: "index",
12
12
  props: {
13
13
  immediate: { type: Boolean, default: !0 },
14
14
  request: {},
15
15
  queryItems: { default: () => [] },
16
+ hideEmptyLabel: { type: Boolean, default: !1 },
16
17
  pagination: { type: [Object, Boolean], default: !0 },
17
18
  itemKey: { default: "id" },
18
19
  cardMinWidth: {}
19
20
  },
20
21
  emits: ["search-reset"],
21
- setup(s, { expose: R, emit: w }) {
22
- const n = s, B = w, C = V(), E = _(null), p = u(() => {
22
+ setup(s, { expose: E, emit: N }) {
23
+ const n = s, R = N, w = M(), C = V(null), p = u(() => {
23
24
  const e = n.request;
24
25
  if (e && typeof e == "object" && "run" in e && "data" in e && !("service" in e))
25
26
  return {
@@ -40,14 +41,14 @@ const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list
40
41
  ...r ? { refreshDeps: r, refreshDepsAction: a ?? (() => l()) } : {}
41
42
  }
42
43
  };
43
- }), o = U(p.value.service, p.value.options), I = p.value.instance ?? {
44
+ }), o = X(p.value.service, p.value.options), I = p.value.instance ?? {
44
45
  loading: o.loading,
45
46
  data: o.data,
46
47
  run: o.run,
47
48
  params: o.params,
48
49
  refresh: o.refresh
49
- }, { loading: O, data: i, run: j, params: A, refresh: W } = I, y = u(() => A.value?.[0]), Z = u(() => {
50
- if (b(i.value))
50
+ }, { loading: O, data: i, run: j, params: A, refresh: L } = I, y = u(() => A.value?.[0]), W = u(() => {
51
+ if (D(i.value))
51
52
  return n.pagination && { total: i.value.length, ...n.pagination };
52
53
  {
53
54
  const e = i.value ?? {}, t = y.value ?? {}, r = n.pagination;
@@ -58,12 +59,12 @@ const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list
58
59
  total: e.total ?? 0
59
60
  };
60
61
  }
61
- }), d = te(() => Z.value ?? !1), S = u(
62
- () => b(i.value) ? i.value : i.value?.rows ?? []
63
- ), K = u(() => {
62
+ }), d = te(() => W.value ?? !1), S = u(
63
+ () => D(i.value) ? i.value : i.value?.rows ?? []
64
+ ), Z = u(() => {
64
65
  const e = [];
65
- return Object.keys(C).forEach((t) => {
66
- t.startsWith(N) && t !== "search-actions" && e.push(t.slice(N.length));
66
+ return Object.keys(w).forEach((t) => {
67
+ t.startsWith(B) && t !== "search-actions" && e.push(t.slice(B.length));
67
68
  }), e;
68
69
  });
69
70
  let f;
@@ -83,54 +84,55 @@ const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list
83
84
  e && !n.queryItems.length && l();
84
85
  },
85
86
  { immediate: !0, once: !0 }
86
- ), R({
87
+ ), E({
87
88
  /** 原地重查:用最近一次入参重新请求,保持当前页码(区别于 `search()` 会回到第 1 页) */
88
- refresh: W,
89
+ refresh: L,
89
90
  /** 最近一次请求的入参(`{ pageNum, pageSize, ...查询表单 }`),未请求过时为 `undefined` */
90
91
  params: y,
91
92
  /** 重新查询并回到第 1 页;消费方可在 useRequest 的 refreshDepsAction 里调用 */
92
93
  search: l
93
94
  }), (e, t) => {
94
95
  const r = F("loading");
95
- return L((m(), z("div", {
96
+ return G((m(), z("div", {
96
97
  class: "zl-card-page",
97
- style: G({ "--card-min-width": s.cardMinWidth })
98
+ style: H({ "--card-min-width": s.cardMinWidth })
98
99
  }, [
99
100
  s.queryItems.length || e.$slots["search-actions"] ? (m(), g(ee, {
100
101
  key: 0,
101
102
  ref_key: "searchRef",
102
- ref: E,
103
+ ref: C,
103
104
  items: s.queryItems,
104
105
  immediate: s.immediate,
106
+ "hide-empty-label": s.hideEmptyLabel,
105
107
  onSearch: l,
106
- onReset: t[0] || (t[0] = (a) => B("search-reset"))
107
- }, H({ _: 2 }, [
108
+ onReset: t[0] || (t[0] = (a) => R("search-reset"))
109
+ }, J({ _: 2 }, [
108
110
  e.$slots["search-actions"] ? {
109
111
  name: "actions",
110
112
  fn: P(() => [
111
- v(e.$slots, "search-actions")
113
+ h(e.$slots, "search-actions")
112
114
  ]),
113
115
  key: "0"
114
116
  } : void 0,
115
- k(K.value, (a) => ({
117
+ b(Z.value, (a) => ({
116
118
  name: a,
117
119
  fn: P((c) => [
118
- v(e.$slots, `search-${a}`, J(Q(c)))
120
+ h(e.$slots, `search-${a}`, Q(T(c)))
119
121
  ])
120
122
  }))
121
- ]), 1032, ["items", "immediate"])) : q("", !0),
122
- $("div", ae, [
123
- $("div", se, [
124
- S.value.length ? (m(!0), z(T, { key: 0 }, k(S.value, (a, c) => v(e.$slots, "default", D({
123
+ ]), 1032, ["items", "immediate", "hide-empty-label"])) : k("", !0),
124
+ q("div", ae, [
125
+ q("div", se, [
126
+ S.value.length ? (m(!0), z(U, { key: 0 }, b(S.value, (a, c) => h(e.$slots, "default", $({
125
127
  key: a[s.itemKey] || c
126
- }, { ref_for: !0 }, { data: a }))), 128)) : (m(), g(X, { key: 1 }))
128
+ }, { ref_for: !0 }, { data: a }))), 128)) : (m(), g(Y, { key: 1 }))
127
129
  ])
128
130
  ]),
129
- s.pagination && h(d) !== !1 ? (m(), g(Y, D({ key: 1 }, h(d), {
131
+ s.pagination && v(d) !== !1 ? (m(), g(_, $({ key: 1 }, v(d), {
130
132
  onChange: t[1] || (t[1] = (a) => l(void 0, a))
131
- }), null, 16)) : q("", !0)
133
+ }), null, 16)) : k("", !0)
132
134
  ], 4)), [
133
- [r, h(O)]
135
+ [r, v(O)]
134
136
  ]);
135
137
  };
136
138
  }
@@ -1 +1 @@
1
- .zl-description{display:inline-flex;gap:0 16px;font-size:12px;line-height:20px;white-space:nowrap;flex-wrap:wrap}.zl-description-type-secondary{padding:0 8px;background-color:var(--zl-fill-2, #eff4f9);border-radius:var(--zl-radius-small, 2px)}.zl-description-type-secondary .zl-description-item:not(:last-child):after{content:"";display:inline-block;height:12px;width:1px;background-color:var(--zl-border-2, #e3e9ef);position:absolute;top:4px;right:-8px}.zl-description-item{position:relative;display:inline-flex;align-items:center;gap:2px}.zl-description-item-icon{color:var(--zl-text-2, #4d5e7d)}.zl-description-item-label{color:var(--zl-text-3, #79879c);margin-right:10px}.zl-description-item-value{color:var(--zl-text-1, #242e43)}.zl-description .zl-tag:not(.zl-tag-fill){padding:0}
1
+ @charset "UTF-8";.zl-description{display:inline-flex;gap:0 16px;font-size:12px;line-height:20px;white-space:nowrap;flex-wrap:wrap;max-width:100%}.zl-description-type-secondary{padding:0 8px;background-color:var(--zl-fill-2, #eff4f9);border-radius:var(--zl-radius-small, 2px)}.zl-description-type-secondary .zl-description-item:not(:last-child):after{content:"";display:inline-block;height:12px;width:1px;background-color:var(--zl-border-2, #e3e9ef);position:absolute;top:4px;right:-8px}.zl-description-item{position:relative;display:inline-flex;align-items:center;gap:2px;min-width:0;max-width:100%}.zl-description-item-icon{color:var(--zl-text-2, #4d5e7d)}.zl-description-item-label{color:var(--zl-text-3, #79879c);margin-right:10px;flex-shrink:0}.zl-description-item-value{color:var(--zl-text-1, #242e43);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl-description .zl-tag:not(.zl-tag-fill){padding:0}
@@ -1,52 +1,56 @@
1
- import { defineComponent as g, computed as h, defineAsyncComponent as T, resolveComponent as b, openBlock as n, createElementBlock as r, normalizeClass as B, Fragment as m, renderList as D, createBlock as u, createCommentVNode as E, createElementVNode as y, toDisplayString as f, unref as N, mergeProps as V, renderSlot as Z, createTextVNode as F } from "vue";
1
+ import { defineComponent as C, computed as h, defineAsyncComponent as T, resolveComponent as g, openBlock as n, createElementBlock as a, normalizeClass as b, Fragment as B, renderList as D, createBlock as d, createCommentVNode as E, createElementVNode as u, toDisplayString as y, unref as N, mergeProps as V, renderSlot as Z, withCtx as A, createTextVNode as F } from "vue";
2
2
  import { useZlT as S } from "@zl-ui-kit/composables";
3
- import { isNumber as A } from "@zl-ui-kit/utils";
4
- const I = { class: "zl-description-item-label" }, K = { class: "zl-description-item-value" }, q = /* @__PURE__ */ g({
3
+ import { isNumber as w } from "@zl-ui-kit/utils";
4
+ import I from "../ZlAutoTooltip/index.vue.mjs";
5
+ const K = { class: "zl-description-item-label" }, L = { class: "zl-description-item-value" }, H = /* @__PURE__ */ C({
5
6
  name: "ZlDescription",
6
7
  __name: "index",
7
8
  props: {
8
9
  items: {},
9
10
  data: { default: () => ({}) },
10
- emptyChecker: { type: Function, default: (s) => !s && !A(s) },
11
+ emptyChecker: { type: Function, default: (s) => !s && !w(s) },
11
12
  emptyText: {},
12
13
  secondary: { type: Boolean }
13
14
  },
14
15
  setup(s) {
15
- const { t: k } = S(), t = s, v = h(() => {
16
- const c = [], d = t.emptyText ?? k("zl.description.empty", "暂无");
16
+ const { t: f } = S(), t = s, k = h(() => {
17
+ const c = [], p = t.emptyText ?? f("zl.description.empty", "暂无");
17
18
  for (const o of t.items) {
18
- const { visible: e, key: l, getValue: p, dict: a, ...z } = o, i = typeof p == "function" ? p(t.data, o.key, o) : t.data[o.key], x = t.emptyChecker(i, l, t.data) ? d : i;
19
- if (e === !1 || typeof e == "function" && !e(i, l, t.data))
19
+ const { visible: e, key: r, getValue: m, dict: l, ..._ } = o, i = typeof m == "function" ? m(t.data, o.key, o) : t.data[o.key], x = t.emptyChecker(i, r, t.data) ? p : i;
20
+ if (e === !1 || typeof e == "function" && !e(i, r, t.data))
20
21
  continue;
21
- const C = typeof a == "string" ? { dictKey: a } : a;
22
- c.push({ ...z, key: l, value: i, text: x, dict: C });
22
+ const z = typeof l == "string" ? { dictKey: l } : l;
23
+ c.push({ ..._, key: r, value: i, text: x, dict: z });
23
24
  }
24
25
  return c;
25
- }), _ = T(() => import("../ZlDictTag/index2.vue.mjs"));
26
- return (c, d) => {
27
- const o = b("zl-icon");
28
- return n(), r("div", {
29
- class: B(["zl-description", { "zl-description-type-secondary": s.secondary }])
26
+ }), v = T(() => import("../ZlDictTag/index2.vue.mjs"));
27
+ return (c, p) => {
28
+ const o = g("zl-icon");
29
+ return n(), a("div", {
30
+ class: b(["zl-description", { "zl-description-type-secondary": s.secondary }])
30
31
  }, [
31
- (n(!0), r(m, null, D(v.value, (e) => (n(), r("div", {
32
+ (n(!0), a(B, null, D(k.value, (e) => (n(), a("div", {
32
33
  key: e.key,
33
34
  class: "zl-description-item"
34
35
  }, [
35
- e.icon ? (n(), u(o, {
36
+ e.icon ? (n(), d(o, {
36
37
  key: 0,
37
38
  class: "zl-description-item-icon",
38
39
  icon: e.icon
39
40
  }, null, 8, ["icon"])) : E("", !0),
40
- y("div", I, f(e.label), 1),
41
- y("div", K, [
42
- e.dict ? (n(), u(N(_), V({
41
+ u("div", K, y(e.label), 1),
42
+ u("div", L, [
43
+ e.dict ? (n(), d(N(v), V({
43
44
  key: 0,
44
45
  ref_for: !0
45
46
  }, e.dict, {
46
47
  value: e.text
47
- }), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(), r(m, { key: 2 }, [
48
- F(f(e.text), 1)
49
- ], 64))
48
+ }), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(), d(I, { key: 2 }, {
49
+ default: A(() => [
50
+ F(y(e.text), 1)
51
+ ]),
52
+ _: 2
53
+ }, 1024))
50
54
  ])
51
55
  ]))), 128))
52
56
  ], 2);
@@ -54,6 +58,6 @@ const I = { class: "zl-description-item-label" }, K = { class: "zl-description-i
54
58
  }
55
59
  });
56
60
  export {
57
- q as default
61
+ H as default
58
62
  };
59
63
  //# sourceMappingURL=index.vue.mjs.map
@@ -1 +1 @@
1
- .zl-form-item-label{display:inline-flex;align-items:center;gap:2px}.zl-form-item-label__tooltip{color:var(--zl-text-3, var(--el-text-color-secondary))}
1
+ @charset "UTF-8";.zl-form-item-label{display:inline-flex;align-items:center;gap:2px}.zl-form-item-label__tooltip{color:var(--zl-text-3, var(--el-text-color-secondary))}.zl-form-item--no-label .el-form-item__label{display:none}
@@ -4,6 +4,11 @@ type __VLS_Props = {
4
4
  items: FormItem[];
5
5
  /** 表单值对象,不传时由组件内部自建 */
6
6
  model?: Record<string, any>;
7
+ /**
8
+ * 表单项 `label` 为空字符串/缺省时不渲染 label 占位(控件直接顶到最左)。
9
+ * 默认 false:即使 label 为空,EP 也会因 #label 插槽存在而保留 label 列占位
10
+ */
11
+ hideEmptyLabel?: boolean;
7
12
  };
8
13
  /** el-form 的校验回调:第一个参数为是否通过,失败时第二个参数为错误字段集合 */
9
14
  type ValidateCallback = (isValid: boolean, invalidFields?: Record<string, any>) => void;
@@ -32,6 +37,7 @@ declare function __VLS_template(): {
32
37
  slot?: boolean;
33
38
  slots?: Record<string, any>;
34
39
  props: Record<string, any>;
40
+ hideLabel?: boolean;
35
41
  };
36
42
  }) => any>> & {
37
43
  label?(_: {
@@ -45,6 +51,7 @@ declare function __VLS_template(): {
45
51
  slot?: boolean;
46
52
  slots?: Record<string, any>;
47
53
  props: Record<string, any>;
54
+ hideLabel?: boolean;
48
55
  };
49
56
  }): any;
50
57
  default?(_: {}): any;