@selectwin/kit 0.1.155 → 0.1.157
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.
- package/dist/SelectNumberField.d.ts +5 -0
- package/dist/SelectSelect.d.ts +2 -0
- package/dist/index.js +36 -31
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -14,5 +14,10 @@ export interface SelectNumberFieldProps {
|
|
|
14
14
|
onBlur?: () => void;
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
size?: 'sm' | 'md';
|
|
17
|
+
/**
|
|
18
|
+
* O nome acessível do input quando não há `label` visível — uma célula de tabela cujo cabeçalho já diz o que é
|
|
19
|
+
* ("Peso" do sinal "IP da rede Tor"). Sem ele, o leitor de tela anuncia só "campo de edição". Ignorado com `label`.
|
|
20
|
+
*/
|
|
21
|
+
ariaLabel?: string;
|
|
17
22
|
}
|
|
18
23
|
export declare const SelectNumberField: import('react').ForwardRefExoticComponent<SelectNumberFieldProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectNumberFieldProps> & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/SelectSelect.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ type SelectSelectOwnProps = {
|
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
/** Control density. Default `md`; use `sm` in dense surfaces and modal/card forms. */
|
|
25
25
|
size?: 'sm' | 'md';
|
|
26
|
+
/** O nome acessível do `<select>` quando não há `label` visível (uma célula de tabela). Ignorado com `label`. */
|
|
27
|
+
ariaLabel?: string;
|
|
26
28
|
};
|
|
27
29
|
export type SelectSelectProps = SelectSelectOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSelectOwnProps>;
|
|
28
30
|
export declare const SelectSelect: import('react').ForwardRefExoticComponent<SelectSelectOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectSelectOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/index.js
CHANGED
|
@@ -3702,12 +3702,12 @@ var er = (e) => {
|
|
|
3702
3702
|
}) : null
|
|
3703
3703
|
]
|
|
3704
3704
|
});
|
|
3705
|
-
}), nr = r(function({ label: e, value: t, onChange: n, options: r, labelAction: i, help: a, info: o, description: c, hint: l, error: u, placeholder: d, name: f, required: p, disabled: m, size: _ = "md",
|
|
3706
|
-
let
|
|
3705
|
+
}), nr = r(function({ label: e, value: t, onChange: n, options: r, labelAction: i, help: a, info: o, description: c, hint: l, error: u, placeholder: d, name: f, required: p, disabled: m, size: _ = "md", ariaLabel: v, className: y, ...b }, x) {
|
|
3706
|
+
let S = s(), C = u ? `${S}-err` : l ? `${S}-hint` : void 0;
|
|
3707
3707
|
return /* @__PURE__ */ g("div", {
|
|
3708
|
-
ref:
|
|
3709
|
-
...
|
|
3710
|
-
className: `select-field${_ === "sm" ? " select-field--sm" : ""}${
|
|
3708
|
+
ref: x,
|
|
3709
|
+
...b,
|
|
3710
|
+
className: `select-field${_ === "sm" ? " select-field--sm" : ""}${y ? " " + y : ""}`,
|
|
3711
3711
|
children: [
|
|
3712
3712
|
(e || a || o || i) && /* @__PURE__ */ g("div", {
|
|
3713
3713
|
className: "select-field__labelrow",
|
|
@@ -3715,7 +3715,7 @@ var er = (e) => {
|
|
|
3715
3715
|
className: "select-field__labelwrap",
|
|
3716
3716
|
children: [e && /* @__PURE__ */ h("label", {
|
|
3717
3717
|
className: "select-field__label",
|
|
3718
|
-
htmlFor:
|
|
3718
|
+
htmlFor: S,
|
|
3719
3719
|
children: e
|
|
3720
3720
|
}), a != null && a !== "" ? /* @__PURE__ */ h(xn, { content: a }) : o && /* @__PURE__ */ h("span", {
|
|
3721
3721
|
className: "select-field__info",
|
|
@@ -3732,7 +3732,7 @@ var er = (e) => {
|
|
|
3732
3732
|
/* @__PURE__ */ g("div", {
|
|
3733
3733
|
className: "select-select-wrap",
|
|
3734
3734
|
children: [/* @__PURE__ */ g("select", {
|
|
3735
|
-
id:
|
|
3735
|
+
id: S,
|
|
3736
3736
|
className: `select-input select-select${u ? " select-input--error" : ""}`,
|
|
3737
3737
|
value: t,
|
|
3738
3738
|
onChange: (e) => n(e.target.value),
|
|
@@ -3740,7 +3740,8 @@ var er = (e) => {
|
|
|
3740
3740
|
required: p,
|
|
3741
3741
|
disabled: m,
|
|
3742
3742
|
"aria-invalid": u ? !0 : void 0,
|
|
3743
|
-
"aria-describedby":
|
|
3743
|
+
"aria-describedby": C,
|
|
3744
|
+
"aria-label": e ? void 0 : v,
|
|
3744
3745
|
children: [d && /* @__PURE__ */ h("option", {
|
|
3745
3746
|
value: "",
|
|
3746
3747
|
disabled: !0,
|
|
@@ -3757,11 +3758,11 @@ var er = (e) => {
|
|
|
3757
3758
|
})]
|
|
3758
3759
|
}),
|
|
3759
3760
|
u ? /* @__PURE__ */ h("p", {
|
|
3760
|
-
id: `${
|
|
3761
|
+
id: `${S}-err`,
|
|
3761
3762
|
className: "select-field__error",
|
|
3762
3763
|
children: u
|
|
3763
3764
|
}) : l ? /* @__PURE__ */ h("p", {
|
|
3764
|
-
id: `${
|
|
3765
|
+
id: `${S}-hint`,
|
|
3765
3766
|
className: "select-field__hint",
|
|
3766
3767
|
children: l
|
|
3767
3768
|
}) : null
|
|
@@ -29803,23 +29804,23 @@ function gp({ value: e, onChange: t, presets: n = lp, maxDate: r, placement: i =
|
|
|
29803
29804
|
}
|
|
29804
29805
|
//#endregion
|
|
29805
29806
|
//#region src/SelectNumberField.tsx
|
|
29806
|
-
var _p = r(function({ label: e, value: t, onChange: n, min: r, max: i, step: a = 1, decimal: o = !1, disabled: c = !1, hint: l, error: u, onBlur: d, placeholder: p, size: m = "md",
|
|
29807
|
-
let
|
|
29807
|
+
var _p = r(function({ label: e, value: t, onChange: n, min: r, max: i, step: a = 1, decimal: o = !1, disabled: c = !1, hint: l, error: u, onBlur: d, placeholder: p, size: m = "md", ariaLabel: _, className: v, ...y }, b) {
|
|
29808
|
+
let x = s(), S = u ? `${x}-err` : l ? `${x}-hint` : void 0, C = (e) => Math.min(i ?? Infinity, Math.max(r ?? -Infinity, e)), w = (e) => Math.round(e * 1e6) / 1e6, T = t ?? 0, E = r != null && T <= r, D = i != null && T >= i, [O, k] = f(!1), [A, j] = f(""), M = o && O ? A : t == null ? "" : String(t), N = (e) => {
|
|
29808
29809
|
let t = o ? e.replace(/[^\d.,-]/g, "").replace(",", ".") : e.replace(/[^\d-]/g, "");
|
|
29809
|
-
if (o &&
|
|
29810
|
+
if (o && j(t), t === "" || t === "-" || t === ".") return n(null);
|
|
29810
29811
|
let r = Number(t);
|
|
29811
|
-
Number.isFinite(r) && n(
|
|
29812
|
-
},
|
|
29813
|
-
let t =
|
|
29814
|
-
o &&
|
|
29812
|
+
Number.isFinite(r) && n(C(r));
|
|
29813
|
+
}, P = (e) => {
|
|
29814
|
+
let t = C(w(T + e));
|
|
29815
|
+
o && j(String(t)), n(t);
|
|
29815
29816
|
};
|
|
29816
29817
|
return /* @__PURE__ */ g("div", {
|
|
29817
|
-
ref:
|
|
29818
|
-
...
|
|
29819
|
-
className: `select-field${m === "sm" ? " select-field--sm" : ""}${
|
|
29818
|
+
ref: b,
|
|
29819
|
+
...y,
|
|
29820
|
+
className: `select-field${m === "sm" ? " select-field--sm" : ""}${v ? " " + v : ""}`,
|
|
29820
29821
|
children: [
|
|
29821
29822
|
e && /* @__PURE__ */ h(Sn, {
|
|
29822
|
-
htmlFor:
|
|
29823
|
+
htmlFor: x,
|
|
29823
29824
|
label: e
|
|
29824
29825
|
}),
|
|
29825
29826
|
/* @__PURE__ */ g("div", {
|
|
@@ -29834,41 +29835,45 @@ var _p = r(function({ label: e, value: t, onChange: n, min: r, max: i, step: a =
|
|
|
29834
29835
|
children: "−"
|
|
29835
29836
|
}),
|
|
29836
29837
|
label: "Diminuir",
|
|
29837
|
-
disabled: c ||
|
|
29838
|
-
onClick: () =>
|
|
29838
|
+
disabled: c || E,
|
|
29839
|
+
onClick: () => P(-a)
|
|
29839
29840
|
}),
|
|
29840
29841
|
/* @__PURE__ */ h("input", {
|
|
29841
|
-
id:
|
|
29842
|
+
id: x,
|
|
29842
29843
|
className: `select-input select-numfield__input${u ? " select-input--error" : ""}`,
|
|
29843
29844
|
type: "text",
|
|
29844
29845
|
inputMode: o ? "decimal" : "numeric",
|
|
29845
29846
|
autoComplete: "off",
|
|
29846
29847
|
disabled: c,
|
|
29847
29848
|
placeholder: p,
|
|
29848
|
-
value:
|
|
29849
|
-
onChange: (e) =>
|
|
29849
|
+
value: M,
|
|
29850
|
+
onChange: (e) => N(e.target.value),
|
|
29850
29851
|
onFocus: () => {
|
|
29851
|
-
|
|
29852
|
+
k(!0), j(t == null ? "" : String(t));
|
|
29852
29853
|
},
|
|
29853
29854
|
onBlur: () => {
|
|
29854
|
-
|
|
29855
|
+
k(!1), d == null || d();
|
|
29855
29856
|
},
|
|
29856
|
-
"aria-invalid": u ? !0 : void 0
|
|
29857
|
+
"aria-invalid": u ? !0 : void 0,
|
|
29858
|
+
"aria-describedby": S,
|
|
29859
|
+
"aria-label": e ? void 0 : _
|
|
29857
29860
|
}),
|
|
29858
29861
|
/* @__PURE__ */ h(Y, {
|
|
29859
29862
|
variant: "outline",
|
|
29860
29863
|
size: m,
|
|
29861
29864
|
icon: /* @__PURE__ */ h(Me, {}),
|
|
29862
29865
|
label: "Aumentar",
|
|
29863
|
-
disabled: c ||
|
|
29864
|
-
onClick: () =>
|
|
29866
|
+
disabled: c || D,
|
|
29867
|
+
onClick: () => P(a)
|
|
29865
29868
|
})
|
|
29866
29869
|
]
|
|
29867
29870
|
}),
|
|
29868
29871
|
u ? /* @__PURE__ */ h("p", {
|
|
29872
|
+
id: `${x}-err`,
|
|
29869
29873
|
className: "select-field__error",
|
|
29870
29874
|
children: u
|
|
29871
29875
|
}) : l ? /* @__PURE__ */ h("p", {
|
|
29876
|
+
id: `${x}-hint`,
|
|
29872
29877
|
className: "select-field__hint",
|
|
29873
29878
|
children: l
|
|
29874
29879
|
}) : null
|