intelliwaketssveltekitv25 0.1.120 → 0.1.121
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/Functions.d.ts +1 -1
- package/dist/InputNumber.svelte +6 -7
- package/package.json +1 -1
package/dist/Functions.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export declare function IsMobileOrTablet(): boolean;
|
|
|
202
202
|
*/
|
|
203
203
|
export declare function DownloadString(filename: string, text: string): void;
|
|
204
204
|
export declare function HandleKeyDownNumerics(event: KeyboardEvent, allowDecimals?: boolean, allowNegative?: boolean): void;
|
|
205
|
-
export type TInputNumberAttributes = Omit<HTMLInputAttributes, 'value' | 'this' | 'onchange' | '
|
|
205
|
+
export type TInputNumberAttributes = Omit<HTMLInputAttributes, 'value' | 'this' | 'onchange' | 'use'> & {
|
|
206
206
|
value: number | null;
|
|
207
207
|
onchange?: (value: number | null) => void;
|
|
208
208
|
inputClass?: string;
|
package/dist/InputNumber.svelte
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
nullDash,
|
|
26
26
|
prefix,
|
|
27
27
|
suffix,
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
28
30
|
allowNegative,
|
|
29
31
|
use = [],
|
|
30
32
|
thisRef = $bindable<HTMLInputElement>(),
|
|
@@ -84,13 +86,10 @@
|
|
|
84
86
|
if (onchange) onchange(numericValue)
|
|
85
87
|
} else if (!isNaN(numericValue)) {
|
|
86
88
|
numericValue /= displayMultiplier
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
let minAt = CleanNumberNull(fixedDecimals ?? maxAt)
|
|
92
|
-
if (minAt !== null) numericValue = Math.min(numericValue, minAt)
|
|
93
|
-
|
|
89
|
+
const useMin = CleanNumberNull(min)
|
|
90
|
+
if (useMin !== null) numericValue = Math.max(numericValue, useMin)
|
|
91
|
+
const useMax = CleanNumberNull(max)
|
|
92
|
+
if (useMax !== null) numericValue = Math.min(numericValue, useMax)
|
|
94
93
|
value = CleanNumber(numericValue, useDecimals)
|
|
95
94
|
|
|
96
95
|
if (onchange) onchange(numericValue)
|