@sfxcode/formkit-primevue 3.0.11 → 3.0.12

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.
@@ -41,7 +41,8 @@ function handleBlur(e: InputNumberBlurEvent) {
41
41
  }
42
42
 
43
43
  function handleInput(_: any) {
44
- props.context?.node.input(_.value)
44
+ if (typeof _.value === 'number' || _.value === null)
45
+ props.context?.node.input(_.value)
45
46
  }
46
47
 
47
48
  function roundToDecimals(value: any, decimals: number) {
@@ -52,13 +53,13 @@ function roundToDecimals(value: any, decimals: number) {
52
53
  watch(
53
54
  () => props.context._value,
54
55
  (newValue) => {
55
- if (newValue !== props.context.node.value) {
56
- if (props.context.maxFractionDigits) {
56
+ // Only update if the value is different
57
+ if (newValue !== props.context.node.value && typeof newValue === 'number') {
58
+ if (props.context.maxFractionDigits && props.context.maxFractionDigits > 0) {
57
59
  // fix floating-point precision issues
58
60
  props.context?.node.input(roundToDecimals(newValue, props.context.maxFractionDigits))
59
61
  }
60
62
  else {
61
- // Only update if the value is different
62
63
  props.context?.node.input(newValue)
63
64
  }
64
65
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "3.0.11",
4
+ "version": "3.0.12",
5
5
  "packageManager": "pnpm@10.18.2+sha512.9fb969fa749b3ade6035e0f109f0b8a60b5d08a1a87fdf72e337da90dcc93336e2280ca4e44f2358a649b83c17959e9993e777c2080879f3801e6f0d999ad3dd",
6
6
  "author": {
7
7
  "name": "Tom",