@wgalleti/primevue-components 1.2.0 → 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.
@@ -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;
@@ -5523,6 +5523,7 @@ var ea = {
5523
5523
  props: {
5524
5524
  modelValue: { default: 0 },
5525
5525
  orientation: { default: "vertical" },
5526
+ labels: { default: "all" },
5526
5527
  disabled: {
5527
5528
  type: Boolean,
5528
5529
  default: !1
@@ -5530,18 +5531,19 @@ var ea = {
5530
5531
  },
5531
5532
  emits: ["update:modelValue"],
5532
5533
  setup(e, { emit: t }) {
5533
- let n = e, r = t, i = f(() => n.modelValue), a = f(() => n.disabled), o = f(() => n.orientation);
5534
- 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) {
5535
5536
  n.disabled || r("update:modelValue", n.modelValue === e ? 0 : e);
5536
5537
  }
5537
5538
  N(ko, {
5538
5539
  active: i,
5539
- toggle: s,
5540
+ toggle: c,
5540
5541
  disabled: a,
5541
- orientation: o
5542
+ orientation: o,
5543
+ labels: s
5542
5544
  });
5543
- let c = P(null);
5544
- function l(e) {
5545
+ let l = P(null);
5546
+ function u(e) {
5545
5547
  if (n.orientation !== "horizontal") return;
5546
5548
  let t = {
5547
5549
  ArrowRight: 1,
@@ -5550,16 +5552,16 @@ var ea = {
5550
5552
  End: 0
5551
5553
  }[e.key];
5552
5554
  if (t === void 0) return;
5553
- 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);
5554
5556
  if (i < 0 || r.length === 0) return;
5555
5557
  let a = e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : (i + t + r.length) % r.length;
5556
5558
  e.preventDefault(), r[a].focus();
5557
5559
  }
5558
5560
  return (e, t) => (M(), h("div", {
5559
5561
  ref_key: "root",
5560
- ref: c,
5561
- class: k(["w-step-flow", `w-step-flow--${o.value}`]),
5562
- 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
5563
5565
  }, [I(e.$slots, "default")], 34));
5564
5566
  }
5565
5567
  }), jo = { class: "w-step-section__rail" }, Mo = {
@@ -5584,7 +5586,8 @@ var ea = {
5584
5586
  }, Uo = { class: "w-step-section__head" }, Wo = [
5585
5587
  "aria-expanded",
5586
5588
  "aria-current",
5587
- "disabled"
5589
+ "disabled",
5590
+ "title"
5588
5591
  ], Go = {
5589
5592
  key: 0,
5590
5593
  class: "pi pi-check"
@@ -5616,8 +5619,8 @@ var ea = {
5616
5619
  }
5617
5620
  },
5618
5621
  setup(e) {
5619
- 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);
5620
- 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() {
5621
5624
  a.value || (n ? n.toggle(t.step) : r.value = !r.value);
5622
5625
  }
5623
5626
  return (t, n) => o.value ? (M(), h("div", {
@@ -5637,7 +5640,8 @@ var ea = {
5637
5640
  "aria-expanded": i.value,
5638
5641
  "aria-current": i.value ? "step" : void 0,
5639
5642
  disabled: a.value,
5640
- onClick: l
5643
+ title: l.value,
5644
+ onClick: u
5641
5645
  }, [
5642
5646
  g("span", {
5643
5647
  class: k(["w-step-section__badge", {
@@ -5663,7 +5667,7 @@ var ea = {
5663
5667
  "aria-expanded": i.value,
5664
5668
  "aria-current": i.value ? "step" : void 0,
5665
5669
  disabled: a.value,
5666
- onClick: l
5670
+ onClick: u
5667
5671
  }, [
5668
5672
  g("i", { class: k(["w-step-section__chevron", i.value ? "pi pi-chevron-down" : "pi pi-chevron-right"]) }, null, 2),
5669
5673
  g("h2", Lo, L(e.title), 1),
@@ -7625,4 +7629,4 @@ var jc = {
7625
7629
  //#endregion
7626
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 };
7627
7631
 
7628
- //# sourceMappingURL=components-D5eeRtRP.js.map
7632
+ //# sourceMappingURL=components-BHHLGp-P.js.map