@selectwin/kit 0.1.151 → 0.1.152

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.
@@ -10,6 +10,8 @@ type SelectCopyRowOwnProps = {
10
10
  onCopy?: (value: string) => void;
11
11
  /** Texto corrido (uma mensagem): aparece inteiro, numa caixa, com o botão "Copiar". */
12
12
  prose?: boolean;
13
+ /** Onde cortar quando não cabe: no fim (padrão) ou no começo — para link e id, cuja parte que distingue é o fim. */
14
+ truncate?: 'end' | 'start';
13
15
  };
14
16
  export type SelectCopyRowProps = SelectCopyRowOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectCopyRowOwnProps>;
15
17
  export declare const SelectCopyRow: import('react').ForwardRefExoticComponent<SelectCopyRowOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectCopyRowOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
package/dist/index.js CHANGED
@@ -7606,16 +7606,16 @@ var vo = r(function({ children: e, align: t = "start", disclosure: n, className:
7606
7606
  })
7607
7607
  ]
7608
7608
  });
7609
- }), xo = r(function({ label: e, value: t, href: n, onCopy: r, prose: i = !1, className: a, ...o }, s) {
7610
- let [c, l] = f(!1), u = ca(n), d = () => {
7609
+ }), xo = r(function({ label: e, value: t, href: n, onCopy: r, prose: i = !1, truncate: a = "end", className: o, ...s }, c) {
7610
+ let [l, u] = f(!1), d = ca(n), p = () => {
7611
7611
  navigator.clipboard.writeText(t).then(() => {
7612
- l(!0), setTimeout(() => l(!1), 1200), r == null || r(t);
7612
+ u(!0), setTimeout(() => u(!1), 1200), r == null || r(t);
7613
7613
  });
7614
7614
  };
7615
7615
  return /* @__PURE__ */ g("div", {
7616
- ref: s,
7617
- ...o,
7618
- className: `select-copyrow${i ? " select-copyrow--prose" : ""}${a ? " " + a : ""}`,
7616
+ ref: c,
7617
+ ...s,
7618
+ className: `select-copyrow${i ? " select-copyrow--prose" : ""}${a === "start" && !i ? " select-copyrow--truncate-start" : ""}${o ? " " + o : ""}`,
7619
7619
  children: [e && /* @__PURE__ */ h("span", {
7620
7620
  className: "select-copyrow__label",
7621
7621
  children: e
@@ -7623,12 +7623,16 @@ var vo = r(function({ children: e, align: t = "start", disclosure: n, className:
7623
7623
  className: "select-copyrow__value",
7624
7624
  children: [/* @__PURE__ */ h("span", {
7625
7625
  className: "select-copyrow__text",
7626
- children: t
7626
+ title: a === "start" && !i ? t : void 0,
7627
+ children: a === "start" && !i ? /* @__PURE__ */ h("bdi", {
7628
+ dir: "ltr",
7629
+ children: t
7630
+ }) : t
7627
7631
  }), /* @__PURE__ */ g("div", {
7628
7632
  className: "select-copyrow__actions",
7629
- children: [u && /* @__PURE__ */ h("a", {
7633
+ children: [d && /* @__PURE__ */ h("a", {
7630
7634
  className: "select-iconbtn select-iconbtn--sm",
7631
- href: u,
7635
+ href: d,
7632
7636
  target: "_blank",
7633
7637
  rel: "noreferrer",
7634
7638
  "aria-label": "Abrir",
@@ -7638,14 +7642,14 @@ var vo = r(function({ children: e, align: t = "start", disclosure: n, className:
7638
7642
  variant: "secondary",
7639
7643
  size: "sm",
7640
7644
  inline: !0,
7641
- icon: h(c ? Ve : J, {}),
7642
- onClick: d,
7643
- children: c ? "Copiado" : "Copiar"
7645
+ icon: h(l ? Ve : J, {}),
7646
+ onClick: p,
7647
+ children: l ? "Copiado" : "Copiar"
7644
7648
  }) : /* @__PURE__ */ h(Y, {
7645
7649
  size: "sm",
7646
- icon: h(c ? Ve : J, {}),
7647
- label: c ? "Copiado" : "Copiar",
7648
- onClick: d
7650
+ icon: h(l ? Ve : J, {}),
7651
+ label: l ? "Copiado" : "Copiar",
7652
+ onClick: p
7649
7653
  })]
7650
7654
  })]
7651
7655
  })]