hamzus-ui 0.0.137 → 0.0.139

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.137",
3
+ "version": "0.0.139",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -41,6 +41,10 @@
41
41
  // fnctions
42
42
  function formatInput(inputValue) {
43
43
 
44
+ if (!inputValue.replace) {
45
+ inputValue = inputValue.toString()
46
+ }
47
+
44
48
  // verifier que c est un nombre
45
49
  if (type === 'number') {
46
50
  // Remplace les virgules par des points
@@ -48,6 +52,11 @@
48
52
 
49
53
  // Supprime tout sauf chiffres et un seul point
50
54
  inputValue = inputValue.replace(/[^0-9.]/g, '');
55
+
56
+ // si le step est a 1 ou plus grand on retire les virgule
57
+ if (step !== "" && step >= 1) {
58
+ inputValue = inputValue.replace(".", '');
59
+ }
51
60
  }
52
61
 
53
62
  if (formatPattern.length == 0) {