@wgalleti/primevue-components 1.1.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,9 @@ type __VLS_Props = {
15
15
  /** Nº de colunas do grid do form dialog (default: `formColumns` da config
16
16
  * do useCrudManager, senão 2). */
17
17
  formColumns?: number;
18
+ /** Largura da coluna do slot `#aside` do form dialog (track do grid: `'24rem'`,
19
+ * `'2fr'`…). Default: metade do dialog. Só vale com o slot preenchido. */
20
+ asideWidth?: string;
18
21
  autoInit?: boolean;
19
22
  showKpi?: boolean;
20
23
  kpiIcon?: string;
@@ -85,7 +88,16 @@ declare var __VLS_1: {}, __VLS_10: {}, __VLS_12: {
85
88
  isEditing: boolean;
86
89
  fieldId: string;
87
90
  setFormField: (f: string, v: unknown) => void;
91
+ }, __VLS_390: `image-${string}`, __VLS_391: {
92
+ field: FieldDef;
93
+ formData: Record<string, unknown>;
88
94
  }, __VLS_394: {
95
+ formData: Record<string, unknown>;
96
+ isEditing: boolean;
97
+ }, __VLS_397: {
98
+ formData: Record<string, unknown>;
99
+ isEditing: boolean;
100
+ }, __VLS_405: {
89
101
  item: Record<string, unknown> | null;
90
102
  };
91
103
  type __VLS_Slots = {} & {
@@ -94,6 +106,8 @@ type __VLS_Slots = {} & {
94
106
  [K in NonNullable<typeof __VLS_310>]?: (props: typeof __VLS_311) => any;
95
107
  } & {
96
108
  [K in NonNullable<typeof __VLS_385>]?: (props: typeof __VLS_386) => any;
109
+ } & {
110
+ [K in NonNullable<typeof __VLS_390>]?: (props: typeof __VLS_391) => any;
97
111
  } & {
98
112
  'header-actions'?: (props: typeof __VLS_1) => any;
99
113
  } & {
@@ -129,7 +143,11 @@ type __VLS_Slots = {} & {
129
143
  } & {
130
144
  'form-dialog'?: (props: typeof __VLS_371) => any;
131
145
  } & {
132
- 'delete-message'?: (props: typeof __VLS_394) => any;
146
+ 'after-fields'?: (props: typeof __VLS_394) => any;
147
+ } & {
148
+ aside?: (props: typeof __VLS_397) => any;
149
+ } & {
150
+ 'delete-message'?: (props: typeof __VLS_405) => any;
133
151
  };
134
152
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
135
153
  scrollToRow: typeof scrollToRow;
@@ -1,4 +1,4 @@
1
- import { StepFlowOrientation } from '../../utils/stepFlow';
1
+ import { StepFlowLabels, StepFlowOrientation } from '../../utils/stepFlow';
2
2
  /**
3
3
  * Etapas numeradas e colapsáveis (a espinha do editor de documento).
4
4
  * Diferente do WProgressFlow, que só ILUSTRA o progresso: aqui cada etapa é um
@@ -17,6 +17,13 @@ type __VLS_Props = {
17
17
  * para o empilhamento vertical (a régua não cabe).
18
18
  */
19
19
  orientation?: StepFlowOrientation;
20
+ /**
21
+ * Títulos da régua horizontal: `all` mostra todos lado a lado; `active` só o
22
+ * da etapa aberta — as outras ficam no número, com o título no tooltip e
23
+ * para o leitor de tela. Use `active` quando a régua é longa e os títulos
24
+ * sairiam cortados. Empilhado (abaixo de 840px) e na vertical, todos aparecem.
25
+ */
26
+ labels?: StepFlowLabels;
20
27
  /** Trava o clique no cabeçalho de todas as etapas. */
21
28
  disabled?: boolean;
22
29
  };
@@ -32,6 +39,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
32
39
  modelValue: number;
33
40
  disabled: boolean;
34
41
  orientation: StepFlowOrientation;
42
+ labels: StepFlowLabels;
35
43
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
36
44
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
45
  declare const _default: typeof __VLS_export;
@@ -47,19 +47,19 @@ var Ue = {
47
47
  key: 0,
48
48
  class: "w-cell-neutral"
49
49
  }, Ke = {
50
- key: 3,
50
+ key: 4,
51
51
  class: "w-cell-date"
52
52
  }, qe = {
53
- key: 4,
53
+ key: 5,
54
54
  class: "w-cell-date"
55
55
  }, Je = {
56
- key: 5,
56
+ key: 6,
57
57
  class: "w-cell-number"
58
58
  }, $ = {
59
- key: 6,
59
+ key: 7,
60
60
  class: "w-cell-number"
61
61
  }, Ye = {
62
- key: 7,
62
+ key: 8,
63
63
  class: "w-cell-text"
64
64
  }, Xe = /* @__PURE__ */ x({
65
65
  __name: "WCrudColumnRenderer",
@@ -73,24 +73,42 @@ var Ue = {
73
73
  function o(e, t, n) {
74
74
  return e.tagValue ? e.tagValue(t, n) : t ? e.trueLabel ?? "Ativo" : e.falseLabel ?? "Inativo";
75
75
  }
76
- function s(e, t, n) {
76
+ function s(e) {
77
+ return !!(e.tagValue || e.tagSeverity);
78
+ }
79
+ function c(e, t, n) {
80
+ return e.tagValue ? e.tagValue(t, n) : e.format ? e.format(t, n) : String(t);
81
+ }
82
+ function l(e, t, n) {
83
+ return e.tagSeverity?.(t, n) ?? "secondary";
84
+ }
85
+ function u(e, t, n) {
77
86
  return e.tagSeverity ? e.tagSeverity(t, n) : t ? e.trueSeverity === void 0 ? "success" : e.trueSeverity : e.falseSeverity === void 0 ? "danger" : e.falseSeverity;
78
87
  }
79
- return (n, c) => e.value == null ? (M(), h("span", Ue, "—")) : e.column.type === "image" ? (M(), h("img", {
88
+ return (n, f) => e.value == null ? (M(), h("span", Ue, "—")) : e.column.type === "image" ? (M(), h("img", {
80
89
  key: 1,
81
90
  src: String(e.value),
82
91
  alt: e.column.header,
83
92
  class: "w-cell-image"
84
- }, null, 8, We)) : e.column.type === "boolean" ? (M(), h(d, { key: 2 }, [s(e.column, e.value, e.rowData) === null ? (M(), h("span", Ge, L(o(e.column, e.value, e.rowData)), 1)) : (M(), p(R(X), {
93
+ }, null, 8, We)) : e.column.type === "boolean" ? (M(), h(d, { key: 2 }, [u(e.column, e.value, e.rowData) === null ? (M(), h("span", Ge, L(o(e.column, e.value, e.rowData)), 1)) : (M(), p(R(X), {
85
94
  key: 1,
86
95
  value: o(e.column, e.value, e.rowData),
87
- severity: s(e.column, e.value, e.rowData),
88
- class: k(["w-tag", `w-tag--${s(e.column, e.value, e.rowData)}`])
96
+ severity: u(e.column, e.value, e.rowData),
97
+ class: k(["w-tag", `w-tag--${u(e.column, e.value, e.rowData)}`])
98
+ }, null, 8, [
99
+ "value",
100
+ "severity",
101
+ "class"
102
+ ]))], 64)) : s(e.column) ? (M(), p(R(X), {
103
+ key: 3,
104
+ value: c(e.column, e.value, e.rowData),
105
+ severity: l(e.column, e.value, e.rowData),
106
+ class: k(["w-tag", `w-tag--${l(e.column, e.value, e.rowData)}`])
89
107
  }, null, 8, [
90
108
  "value",
91
109
  "severity",
92
110
  "class"
93
- ]))], 64)) : e.column.type === "date" ? (M(), h("span", Ke, L(R(t)(e.value)), 1)) : e.column.type === "datetime" ? (M(), h("span", qe, L(R(r)(e.value)), 1)) : e.column.type === "currency" ? (M(), h("span", Je, L(R(i)(e.value)), 1)) : e.column.type === "number" ? (M(), h("span", $, L(e.column.format ? e.column.format(e.value, e.rowData) : R(a)(e.value, e.column.decimals ?? 0)), 1)) : (M(), h("span", Ye, L(e.column.format ? e.column.format(e.value, e.rowData) : e.value), 1));
111
+ ])) : e.column.type === "date" ? (M(), h("span", Ke, L(e.column.format ? e.column.format(e.value, e.rowData) : R(t)(e.value)), 1)) : e.column.type === "datetime" ? (M(), h("span", qe, L(e.column.format ? e.column.format(e.value, e.rowData) : R(r)(e.value)), 1)) : e.column.type === "currency" ? (M(), h("span", Je, L(e.column.format ? e.column.format(e.value, e.rowData) : R(i)(e.value)), 1)) : e.column.type === "number" ? (M(), h("span", $, L(e.column.format ? e.column.format(e.value, e.rowData) : R(a)(e.value, e.column.decimals ?? 0)), 1)) : (M(), h("span", Ye, L(e.column.format ? e.column.format(e.value, e.rowData) : e.value), 1));
94
112
  }
95
113
  }), Ze = Object.defineProperty, Qe = (e, t, n) => t in e ? Ze(e, t, {
96
114
  enumerable: !0,
@@ -2238,6 +2256,7 @@ var pn = { class: "w-crud-form" }, mn = {
2238
2256
  max: i.max,
2239
2257
  "min-fraction-digits": i.minFractionDigits,
2240
2258
  "max-fraction-digits": i.maxFractionDigits,
2259
+ "use-grouping": i.useGrouping !== !1,
2241
2260
  suffix: i.suffix,
2242
2261
  prefix: i.prefix,
2243
2262
  placeholder: i.placeholder,
@@ -2252,6 +2271,7 @@ var pn = { class: "w-crud-form" }, mn = {
2252
2271
  "max",
2253
2272
  "min-fraction-digits",
2254
2273
  "max-fraction-digits",
2274
+ "use-grouping",
2255
2275
  "suffix",
2256
2276
  "prefix",
2257
2277
  "placeholder",
@@ -2838,6 +2858,7 @@ var Zn = { class: "w-crud" }, Qn = {
2838
2858
  },
2839
2859
  dialogWidth: { default: "480px" },
2840
2860
  formColumns: {},
2861
+ asideWidth: {},
2841
2862
  autoInit: {
2842
2863
  type: Boolean,
2843
2864
  default: !0
@@ -3802,15 +3823,32 @@ var Zn = { class: "w-crud" }, Qn = {
3802
3823
  width: t.dialogWidth,
3803
3824
  "form-columns": t.formColumns ?? t.crud.config.formColumns,
3804
3825
  "keyboard-nav": t.crud.config.keyboardNav,
3826
+ "aside-width": t.asideWidth,
3805
3827
  "onUpdate:visible": n[18] ||= (e) => {
3806
3828
  t.crud.dialogVisible.value = e, e || (t.crud.editingItem.value = null);
3807
3829
  },
3808
3830
  "onUpdate:field": n[19] ||= (e, n) => t.crud.setFormField(e, n),
3809
3831
  onSave: n[20] ||= (e) => t.crud.save()
3810
- }, _({ _: 2 }, [F(t.crud.config.form, (t) => ({
3811
- name: `field-${t.field}`,
3812
- fn: V((n) => [I(e.$slots, `field-${t.field}`, A(S(n)))])
3813
- }))]), 1032, [
3832
+ }, _({ _: 2 }, [
3833
+ F(t.crud.config.form, (t) => ({
3834
+ name: `field-${t.field}`,
3835
+ fn: V((n) => [I(e.$slots, `field-${t.field}`, A(S(n)))])
3836
+ })),
3837
+ F(t.crud.config.form.filter((e) => e.type === "image"), (t) => ({
3838
+ name: `image-${t.field}`,
3839
+ fn: V((n) => [I(e.$slots, `image-${t.field}`, A(S(n)))])
3840
+ })),
3841
+ e.$slots["after-fields"] ? {
3842
+ name: "after-fields",
3843
+ fn: V((t) => [I(e.$slots, "after-fields", A(S(t)))]),
3844
+ key: "0"
3845
+ } : void 0,
3846
+ e.$slots.aside ? {
3847
+ name: "aside",
3848
+ fn: V((t) => [I(e.$slots, "aside", A(S(t)))]),
3849
+ key: "1"
3850
+ } : void 0
3851
+ ]), 1032, [
3814
3852
  "visible",
3815
3853
  "title",
3816
3854
  "fields",
@@ -3820,7 +3858,8 @@ var Zn = { class: "w-crud" }, Qn = {
3820
3858
  "disabled",
3821
3859
  "width",
3822
3860
  "form-columns",
3823
- "keyboard-nav"
3861
+ "keyboard-nav",
3862
+ "aside-width"
3824
3863
  ])]),
3825
3864
  e.$slots["delete-message"] ? (M(), p(R(ye), {
3826
3865
  key: 2,
@@ -5484,6 +5523,7 @@ var ea = {
5484
5523
  props: {
5485
5524
  modelValue: { default: 0 },
5486
5525
  orientation: { default: "vertical" },
5526
+ labels: { default: "all" },
5487
5527
  disabled: {
5488
5528
  type: Boolean,
5489
5529
  default: !1
@@ -5491,18 +5531,19 @@ var ea = {
5491
5531
  },
5492
5532
  emits: ["update:modelValue"],
5493
5533
  setup(e, { emit: t }) {
5494
- let n = e, r = t, i = f(() => n.modelValue), a = f(() => n.disabled), o = f(() => n.orientation);
5495
- function s(e) {
5534
+ let n = e, r = t, i = f(() => n.modelValue), a = f(() => n.disabled), o = f(() => n.orientation), s = f(() => n.labels);
5535
+ function c(e) {
5496
5536
  n.disabled || r("update:modelValue", n.modelValue === e ? 0 : e);
5497
5537
  }
5498
5538
  N(ko, {
5499
5539
  active: i,
5500
- toggle: s,
5540
+ toggle: c,
5501
5541
  disabled: a,
5502
- orientation: o
5542
+ orientation: o,
5543
+ labels: s
5503
5544
  });
5504
- let c = P(null);
5505
- function l(e) {
5545
+ let l = P(null);
5546
+ function u(e) {
5506
5547
  if (n.orientation !== "horizontal") return;
5507
5548
  let t = {
5508
5549
  ArrowRight: 1,
@@ -5511,16 +5552,16 @@ var ea = {
5511
5552
  End: 0
5512
5553
  }[e.key];
5513
5554
  if (t === void 0) return;
5514
- let r = Array.from(c.value?.querySelectorAll(".w-step-section__head .w-step-section__trigger:not(:disabled)") ?? []), i = r.indexOf(document.activeElement);
5555
+ let r = Array.from(l.value?.querySelectorAll(".w-step-section__head .w-step-section__trigger:not(:disabled)") ?? []), i = r.indexOf(document.activeElement);
5515
5556
  if (i < 0 || r.length === 0) return;
5516
5557
  let a = e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : (i + t + r.length) % r.length;
5517
5558
  e.preventDefault(), r[a].focus();
5518
5559
  }
5519
5560
  return (e, t) => (M(), h("div", {
5520
5561
  ref_key: "root",
5521
- ref: c,
5522
- class: k(["w-step-flow", `w-step-flow--${o.value}`]),
5523
- onKeydown: l
5562
+ ref: l,
5563
+ class: k(["w-step-flow", [`w-step-flow--${o.value}`, { "w-step-flow--labels-active": s.value === "active" }]]),
5564
+ onKeydown: u
5524
5565
  }, [I(e.$slots, "default")], 34));
5525
5566
  }
5526
5567
  }), jo = { class: "w-step-section__rail" }, Mo = {
@@ -5545,7 +5586,8 @@ var ea = {
5545
5586
  }, Uo = { class: "w-step-section__head" }, Wo = [
5546
5587
  "aria-expanded",
5547
5588
  "aria-current",
5548
- "disabled"
5589
+ "disabled",
5590
+ "title"
5549
5591
  ], Go = {
5550
5592
  key: 0,
5551
5593
  class: "pi pi-check"
@@ -5577,8 +5619,8 @@ var ea = {
5577
5619
  }
5578
5620
  },
5579
5621
  setup(e) {
5580
- let t = e, n = w(ko, null), r = P(!0), i = f(() => n ? n.active.value === t.step : r.value), a = f(() => t.disabled || (n?.disabled.value ?? !1)), o = f(() => n?.orientation.value === "horizontal"), s = f(() => n !== null), c = f(() => o.value && n != null && t.step < n.active.value);
5581
- function l() {
5622
+ let t = e, n = w(ko, null), r = P(!0), i = f(() => n ? n.active.value === t.step : r.value), a = f(() => t.disabled || (n?.disabled.value ?? !1)), o = f(() => n?.orientation.value === "horizontal"), s = f(() => n !== null), c = f(() => o.value && n != null && t.step < n.active.value), l = f(() => o.value && n?.labels?.value === "active" && !i.value ? t.title : void 0);
5623
+ function u() {
5582
5624
  a.value || (n ? n.toggle(t.step) : r.value = !r.value);
5583
5625
  }
5584
5626
  return (t, n) => o.value ? (M(), h("div", {
@@ -5598,7 +5640,8 @@ var ea = {
5598
5640
  "aria-expanded": i.value,
5599
5641
  "aria-current": i.value ? "step" : void 0,
5600
5642
  disabled: a.value,
5601
- onClick: l
5643
+ title: l.value,
5644
+ onClick: u
5602
5645
  }, [
5603
5646
  g("span", {
5604
5647
  class: k(["w-step-section__badge", {
@@ -5624,7 +5667,7 @@ var ea = {
5624
5667
  "aria-expanded": i.value,
5625
5668
  "aria-current": i.value ? "step" : void 0,
5626
5669
  disabled: a.value,
5627
- onClick: l
5670
+ onClick: u
5628
5671
  }, [
5629
5672
  g("i", { class: k(["w-step-section__chevron", i.value ? "pi pi-chevron-down" : "pi pi-chevron-right"]) }, null, 2),
5630
5673
  g("h2", Lo, L(e.title), 1),
@@ -7586,4 +7629,4 @@ var jc = {
7586
7629
  //#endregion
7587
7630
  export { Zi as A, Kn as B, Aa as C, ra as D, la as E, Ti as F, It as G, dn as H, pi as I, gt as J, Mt as K, Lr as L, Ki as M, Mi as N, na as O, Ei as P, Xn as R, Va as S, ma as T, Jt as U, Hn as V, Lt as W, _t as X, bt as Y, Xe as Z, fo as _, Qc as a, Ua as b, Nc as c, $o as d, Ao as f, yo as g, Co as h, nl as i, $i as j, Xi as k, Ls as l, Oo as m, hl as n, Zc as o, ko as p, yt as q, dl as r, Bc as s, El as t, ss as u, $a as v, xa as w, Ha as x, Ga as y, Yn as z };
7588
7631
 
7589
- //# sourceMappingURL=components-BVJTg_MO.js.map
7632
+ //# sourceMappingURL=components-BHHLGp-P.js.map