@fiscozen/input 1.0.0-next.1 → 1.0.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.
- package/CHANGELOG.md +30 -0
- package/dist/input.js +35 -34
- package/dist/input.umd.cjs +1 -1
- package/dist/src/utils.d.ts +2 -2
- package/package.json +7 -5
- package/src/utils.ts +19 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/coverage/FzCurrencyInput.vue.html +0 -640
- package/coverage/FzInput.vue.html +0 -709
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -494
- package/coverage/coverage-final.json +0 -4
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -146
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/useInputStyle.ts.html +0 -343
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @fiscozen/input
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- **LIB-1898: Redesign completo di FzInput.** Floating label, nuova API per gli slot, e introduzione di FzCurrencyInput.
|
|
8
|
+
|
|
9
|
+
### Modifiche dalla versione 0.1.17
|
|
10
|
+
|
|
11
|
+
#### Nuove funzionalità
|
|
12
|
+
- Floating label con supporto per tutti i tipi di input (email, telefono, URL)
|
|
13
|
+
- Nuovo componente **FzCurrencyInput** con formattazione automatica, supporto per valori negativi, gestione min/max, e step con `forceStep`
|
|
14
|
+
- Secondo pulsante icona a destra (`rightIconLast`) con gestione accessibilità
|
|
15
|
+
- Prop `environment` per sostituire la deprecata prop `size`
|
|
16
|
+
- Prop `autocomplete` per il controllo dell'autocompletamento
|
|
17
|
+
- Slot `left-icon` per FzCurrencyInput
|
|
18
|
+
|
|
19
|
+
#### Miglioramenti
|
|
20
|
+
- Gestione migliorata degli eventi di tastiera: il tasto Enter ora consente il submit del form
|
|
21
|
+
- Gestione incolla migliorata per FzCurrencyInput con supporto formati italiani
|
|
22
|
+
- Prevenzione delle race condition negli aggiornamenti del model
|
|
23
|
+
- Click sulle icone disabilitato quando l'input è `disabled` o `readonly`
|
|
24
|
+
- Miglioramento accessibilità con `aria-labelledby` e `aria-describedby`
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
- @fiscozen/button@1.0.1
|
|
30
|
+
- @fiscozen/composables@1.0.1
|
package/dist/input.js
CHANGED
|
@@ -6462,17 +6462,18 @@ const P4 = {
|
|
|
6462
6462
|
md: "backoffice",
|
|
6463
6463
|
lg: "frontoffice"
|
|
6464
6464
|
};
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6465
|
+
let V8 = 0;
|
|
6466
|
+
function H8(e) {
|
|
6467
|
+
const a = Date.now() - 16e11;
|
|
6468
|
+
return `${e}-${a}-${++V8}`;
|
|
6468
6469
|
}
|
|
6469
|
-
function
|
|
6470
|
-
return
|
|
6470
|
+
function _8() {
|
|
6471
|
+
return H8("fz-input");
|
|
6471
6472
|
}
|
|
6472
|
-
const
|
|
6473
|
+
const W8 = { class: "fz-input w-full flex flex-col gap-8" }, q8 = ["id", "for"], Y8 = ["tabindex"], G8 = { class: "flex flex-col justify-around min-w-0 grow" }, X8 = {
|
|
6473
6474
|
key: 0,
|
|
6474
6475
|
class: "text-xs text-grey-300 grow-0 overflow-hidden text-ellipsis whitespace-nowrap"
|
|
6475
|
-
},
|
|
6476
|
+
}, K8 = ["type", "required", "disabled", "readonly", "placeholder", "id", "pattern", "name", "maxlength", "autocomplete", "aria-required", "aria-invalid", "aria-disabled", "aria-labelledby", "aria-describedby"], Q8 = { class: "flex items-center gap-4" }, Z8 = ["id"], J8 = ["id"], el = /* @__PURE__ */ o1({
|
|
6476
6477
|
__name: "FzInput",
|
|
6477
6478
|
props: /* @__PURE__ */ u2({
|
|
6478
6479
|
label: {},
|
|
@@ -6537,7 +6538,7 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6537
6538
|
},
|
|
6538
6539
|
{ immediate: !0 }
|
|
6539
6540
|
);
|
|
6540
|
-
const c = x(() => n.environment ? n.environment : n.size ? P4[n.size] : "frontoffice"), r = D4(e, "modelValue"), i = g1(null), l = g1(null), s =
|
|
6541
|
+
const c = x(() => n.environment ? n.environment : n.size ? P4[n.size] : "frontoffice"), r = D4(e, "modelValue"), i = g1(null), l = g1(null), s = _8(), o = g1(!1), {
|
|
6541
6542
|
staticContainerClass: d,
|
|
6542
6543
|
computedContainerClass: g,
|
|
6543
6544
|
computedLabelClass: L,
|
|
@@ -6590,14 +6591,14 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6590
6591
|
return a({
|
|
6591
6592
|
inputRef: l,
|
|
6592
6593
|
containerRef: i
|
|
6593
|
-
}), (M, $) => (S(), H("div",
|
|
6594
|
+
}), (M, $) => (S(), H("div", W8, [
|
|
6594
6595
|
_(M.$slots, "label", {}, () => [
|
|
6595
6596
|
e.label ? (S(), H("label", {
|
|
6596
6597
|
key: 0,
|
|
6597
6598
|
id: `${w(s)}-label`,
|
|
6598
6599
|
class: O(w(L)),
|
|
6599
6600
|
for: w(s)
|
|
6600
|
-
}, H1(e.label) + H1(e.required ? " *" : ""), 11,
|
|
6601
|
+
}, H1(e.label) + H1(e.required ? " *" : ""), 11, q8)) : j("", !0)
|
|
6601
6602
|
]),
|
|
6602
6603
|
u1("div", {
|
|
6603
6604
|
class: O([w(d), w(g)]),
|
|
@@ -6622,8 +6623,8 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6622
6623
|
onKeydown: $[0] || ($[0] = (n1) => s1.value ? (M1) => m(M1, "fzinput:left-icon-click") : void 0)
|
|
6623
6624
|
}, null, 8, ["name", "variant", "role", "aria-label", "aria-disabled", "tabindex", "class"])) : j("", !0)
|
|
6624
6625
|
]),
|
|
6625
|
-
u1("div",
|
|
6626
|
-
w(h) ? j("", !0) : (S(), H("span",
|
|
6626
|
+
u1("div", G8, [
|
|
6627
|
+
w(h) ? j("", !0) : (S(), H("span", X8, H1(e.placeholder), 1)),
|
|
6627
6628
|
Je(u1("input", I2({
|
|
6628
6629
|
type: e.type,
|
|
6629
6630
|
required: e.required,
|
|
@@ -6651,12 +6652,12 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6651
6652
|
onFocus: $[3] || ($[3] = (n1) => {
|
|
6652
6653
|
o.value = !0, M.$emit("focus", n1);
|
|
6653
6654
|
})
|
|
6654
|
-
}), null, 16,
|
|
6655
|
+
}), null, 16, K8), [
|
|
6655
6656
|
[e3, r.value]
|
|
6656
6657
|
])
|
|
6657
6658
|
]),
|
|
6658
6659
|
_(M.$slots, "right-icon", {}, () => [
|
|
6659
|
-
u1("div",
|
|
6660
|
+
u1("div", Q8, [
|
|
6660
6661
|
e.secondRightIcon && !e.secondRightIconButton ? (S(), q(w(Y), {
|
|
6661
6662
|
key: 0,
|
|
6662
6663
|
name: e.secondRightIcon,
|
|
@@ -6716,7 +6717,7 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6716
6717
|
})) : j("", !0)
|
|
6717
6718
|
])
|
|
6718
6719
|
])
|
|
6719
|
-
], 42,
|
|
6720
|
+
], 42, Y8),
|
|
6720
6721
|
e.error && M.$slots.errorMessage ? (S(), H("div", {
|
|
6721
6722
|
key: 0,
|
|
6722
6723
|
id: `${w(s)}-error`,
|
|
@@ -6735,14 +6736,14 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6735
6736
|
}, [
|
|
6736
6737
|
_(M.$slots, "errorMessage")
|
|
6737
6738
|
], 2)
|
|
6738
|
-
], 12,
|
|
6739
|
+
], 12, Z8)) : M.$slots.helpText ? (S(), H("span", {
|
|
6739
6740
|
key: 1,
|
|
6740
6741
|
id: `${w(s)}-help`,
|
|
6741
6742
|
class: O([w(D)]),
|
|
6742
6743
|
style: a4({ width: w(p) })
|
|
6743
6744
|
}, [
|
|
6744
6745
|
_(M.$slots, "helpText")
|
|
6745
|
-
], 14,
|
|
6746
|
+
], 14, J8)) : j("", !0)
|
|
6746
6747
|
]));
|
|
6747
6748
|
}
|
|
6748
6749
|
}), Z = (e, a) => {
|
|
@@ -6768,7 +6769,7 @@ const _8 = { class: "fz-input w-full flex flex-col gap-8" }, W8 = ["id", "for"],
|
|
|
6768
6769
|
return n !== 0 && (t = Math.abs(n) >= e / 2 ? a + c - n : a - n), t;
|
|
6769
6770
|
}, f1 = (e, a, t) => Math.max(e, Math.min(a, t));
|
|
6770
6771
|
new DOMRect(0, 0, window.innerWidth, window.innerHeight);
|
|
6771
|
-
const
|
|
6772
|
+
const al = {
|
|
6772
6773
|
blue: {
|
|
6773
6774
|
50: {
|
|
6774
6775
|
value: "#eff1ff",
|
|
@@ -7602,8 +7603,8 @@ const el = {
|
|
|
7602
7603
|
}
|
|
7603
7604
|
}
|
|
7604
7605
|
}, e4 = {
|
|
7605
|
-
global:
|
|
7606
|
-
},
|
|
7606
|
+
global: al
|
|
7607
|
+
}, tl = [
|
|
7607
7608
|
"blue",
|
|
7608
7609
|
"purple",
|
|
7609
7610
|
"orange",
|
|
@@ -7611,17 +7612,17 @@ const el = {
|
|
|
7611
7612
|
"yellow",
|
|
7612
7613
|
"grey",
|
|
7613
7614
|
"core"
|
|
7614
|
-
],
|
|
7615
|
-
safeColorNames:
|
|
7616
|
-
},
|
|
7615
|
+
], nl = {
|
|
7616
|
+
safeColorNames: tl
|
|
7617
|
+
}, cl = [
|
|
7617
7618
|
"error",
|
|
7618
7619
|
"warning",
|
|
7619
7620
|
"success",
|
|
7620
7621
|
"info"
|
|
7621
|
-
],
|
|
7622
|
-
semanticColorNames:
|
|
7623
|
-
},
|
|
7624
|
-
|
|
7622
|
+
], rl = {
|
|
7623
|
+
semanticColorNames: cl
|
|
7624
|
+
}, ll = nl.safeColorNames, il = rl.semanticColorNames, L1 = {};
|
|
7625
|
+
ll.forEach((e) => {
|
|
7625
7626
|
const a = e4.global[e];
|
|
7626
7627
|
a && Object.keys(a).forEach((t) => {
|
|
7627
7628
|
var c;
|
|
@@ -7630,7 +7631,7 @@ rl.forEach((e) => {
|
|
|
7630
7631
|
});
|
|
7631
7632
|
});
|
|
7632
7633
|
const $4 = e4.global.semantic;
|
|
7633
|
-
$4 &&
|
|
7634
|
+
$4 && il.forEach((e) => {
|
|
7634
7635
|
const a = $4[e];
|
|
7635
7636
|
a && typeof a == "object" && Object.keys(a).forEach((t) => {
|
|
7636
7637
|
var c;
|
|
@@ -7645,7 +7646,7 @@ Object.entries(e4.global.breakpoint).reduce(
|
|
|
7645
7646
|
(e, [a, t]) => (e[a] = t.value, e),
|
|
7646
7647
|
{}
|
|
7647
7648
|
);
|
|
7648
|
-
const
|
|
7649
|
+
const ol = { class: "flex items-center gap-4" }, sl = { class: "flex flex-col justify-between items-center" }, ul = /* @__PURE__ */ o1({
|
|
7649
7650
|
__name: "FzCurrencyInput",
|
|
7650
7651
|
props: /* @__PURE__ */ u2({
|
|
7651
7652
|
modelValue: {},
|
|
@@ -7932,7 +7933,7 @@ const il = { class: "flex items-center gap-4" }, ol = { class: "flex flex-col ju
|
|
|
7932
7933
|
), a({
|
|
7933
7934
|
inputRef: r,
|
|
7934
7935
|
containerRef: c
|
|
7935
|
-
}), (u, m) => (S(), q(
|
|
7936
|
+
}), (u, m) => (S(), q(el, I2({
|
|
7936
7937
|
ref_key: "fzInputRef",
|
|
7937
7938
|
ref: t
|
|
7938
7939
|
}, l, {
|
|
@@ -7951,7 +7952,7 @@ const il = { class: "flex items-center gap-4" }, ol = { class: "flex flex-col ju
|
|
|
7951
7952
|
_(u.$slots, "left-icon")
|
|
7952
7953
|
]),
|
|
7953
7954
|
"right-icon": N1(() => [
|
|
7954
|
-
u1("div",
|
|
7955
|
+
u1("div", ol, [
|
|
7955
7956
|
l.valid ? (S(), q(w(Y), {
|
|
7956
7957
|
key: 0,
|
|
7957
7958
|
name: "check",
|
|
@@ -7959,7 +7960,7 @@ const il = { class: "flex items-center gap-4" }, ol = { class: "flex flex-col ju
|
|
|
7959
7960
|
class: "text-semantic-success",
|
|
7960
7961
|
"aria-hidden": "true"
|
|
7961
7962
|
})) : j("", !0),
|
|
7962
|
-
u1("div",
|
|
7963
|
+
u1("div", sl, [
|
|
7963
7964
|
P1(w(Y), {
|
|
7964
7965
|
name: "angle-up",
|
|
7965
7966
|
size: "xs",
|
|
@@ -8000,7 +8001,7 @@ const il = { class: "flex items-center gap-4" }, ol = { class: "flex flex-col ju
|
|
|
8000
8001
|
}
|
|
8001
8002
|
});
|
|
8002
8003
|
export {
|
|
8003
|
-
|
|
8004
|
-
|
|
8004
|
+
ul as FzCurrencyInput,
|
|
8005
|
+
el as FzInput,
|
|
8005
8006
|
P4 as sizeToEnvironmentMapping
|
|
8006
8007
|
};
|