intelliwaketssveltekitv25 0.1.116 → 0.1.118
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 +2 -1
- package/dist/Functions.js +7 -2
- package/dist/Icon.svelte +6 -4
- package/dist/Icon.svelte.d.ts +1 -0
- package/dist/InputNumber.svelte +3 -2
- package/package.json +1 -1
package/dist/Functions.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ export declare function IsMobileOrTablet(): boolean;
|
|
|
200
200
|
* @return {void}
|
|
201
201
|
*/
|
|
202
202
|
export declare function DownloadString(filename: string, text: string): void;
|
|
203
|
-
export declare function HandleKeyDownNumerics(event: KeyboardEvent, allowDecimals?: boolean): void;
|
|
203
|
+
export declare function HandleKeyDownNumerics(event: KeyboardEvent, allowDecimals?: boolean, allowNegative?: boolean): void;
|
|
204
204
|
export type TInputNumberAttributes = Omit<HTMLInputAttributes, 'value' | 'this' | 'onchange' | 'min' | 'max' | 'use'> & {
|
|
205
205
|
value: number | null;
|
|
206
206
|
onchange?: (value: number | null) => void;
|
|
@@ -212,6 +212,7 @@ export type TInputNumberAttributes = Omit<HTMLInputAttributes, 'value' | 'this'
|
|
|
212
212
|
prefix?: string;
|
|
213
213
|
suffix?: string;
|
|
214
214
|
shiftDigits?: number;
|
|
215
|
+
allowNegative?: boolean;
|
|
215
216
|
use?: ActionArray;
|
|
216
217
|
thisRef?: HTMLInputElement;
|
|
217
218
|
};
|
package/dist/Functions.js
CHANGED
|
@@ -607,11 +607,15 @@ export function DownloadString(filename, text) {
|
|
|
607
607
|
element.click();
|
|
608
608
|
document.body.removeChild(element);
|
|
609
609
|
}
|
|
610
|
-
export function HandleKeyDownNumerics(event, allowDecimals = true) {
|
|
610
|
+
export function HandleKeyDownNumerics(event, allowDecimals = true, allowNegative = false) {
|
|
611
611
|
if (!allowDecimals && event.key === '.') {
|
|
612
612
|
event.preventDefault();
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
+
if (!allowNegative && event.key === '-') {
|
|
616
|
+
event.preventDefault();
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
615
619
|
if ([
|
|
616
620
|
'Backspace',
|
|
617
621
|
'Delete',
|
|
@@ -623,7 +627,8 @@ export function HandleKeyDownNumerics(event, allowDecimals = true) {
|
|
|
623
627
|
'ArrowUp',
|
|
624
628
|
'ArrowDown',
|
|
625
629
|
'.',
|
|
626
|
-
','
|
|
630
|
+
',',
|
|
631
|
+
'-'
|
|
627
632
|
].includes(event.key)) {
|
|
628
633
|
return;
|
|
629
634
|
}
|
package/dist/Icon.svelte
CHANGED
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
primaryOpacity = 1,
|
|
30
30
|
secondaryOpacity = 0.4,
|
|
31
31
|
swapOpacity = false,
|
|
32
|
-
invisible = false
|
|
32
|
+
invisible = false,
|
|
33
|
+
hidden
|
|
33
34
|
}: {
|
|
34
35
|
class?: string
|
|
35
36
|
id?: string
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
secondaryOpacity?: number
|
|
59
60
|
swapOpacity?: boolean
|
|
60
61
|
invisible?: boolean
|
|
62
|
+
hidden?: boolean
|
|
61
63
|
} = $props()
|
|
62
64
|
|
|
63
65
|
function setCustomSize(element: SVGElement, size: string) {
|
|
@@ -148,7 +150,7 @@
|
|
|
148
150
|
}
|
|
149
151
|
</style>
|
|
150
152
|
|
|
151
|
-
{#if !!icon && i[4]}
|
|
153
|
+
{#if !!icon && i[4] && !hidden}
|
|
152
154
|
<svg
|
|
153
155
|
id={id || undefined}
|
|
154
156
|
bind:this={svgElement}
|
|
@@ -187,13 +189,13 @@
|
|
|
187
189
|
<path
|
|
188
190
|
d={zero}
|
|
189
191
|
fill={secondaryColor || color || 'currentColor'}
|
|
190
|
-
fill-opacity={swapOpacity
|
|
192
|
+
fill-opacity={!!swapOpacity ? primaryOpacity : secondaryOpacity}
|
|
191
193
|
transform='translate({CleanNumber(i[0]) / -2} {CleanNumber(i[1]) / -2})'
|
|
192
194
|
/>
|
|
193
195
|
<path
|
|
194
196
|
d={one}
|
|
195
197
|
fill={primaryColor || color || 'currentColor'}
|
|
196
|
-
fill-opacity={swapOpacity
|
|
198
|
+
fill-opacity={!!swapOpacity ? secondaryOpacity : primaryOpacity}
|
|
197
199
|
transform='translate({CleanNumber(i[0]) / -2} {CleanNumber(i[1]) / -2})'
|
|
198
200
|
/>
|
|
199
201
|
{/if}
|
package/dist/Icon.svelte.d.ts
CHANGED
package/dist/InputNumber.svelte
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
max = null,
|
|
22
22
|
prefix,
|
|
23
23
|
suffix,
|
|
24
|
+
allowNegative,
|
|
24
25
|
shiftDigits = 0,
|
|
25
26
|
use = [],
|
|
26
27
|
thisRef = $bindable<HTMLInputElement>(),
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
const input = event.target as HTMLInputElement
|
|
71
72
|
const newValue = input.value
|
|
72
73
|
|
|
73
|
-
const cleanValue = newValue.replace(/[^\d
|
|
74
|
+
const cleanValue = newValue.replace(/[^\d.-]/g, '')
|
|
74
75
|
|
|
75
76
|
let numericValue = CleanNumberNull(cleanValue, constrainDecimals)
|
|
76
77
|
if (numericValue === null) {
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
if (otherProps.oninput) otherProps.oninput(e)
|
|
107
108
|
}}
|
|
108
109
|
onkeydown={e => {
|
|
109
|
-
HandleKeyDownNumerics(e, !!constrainDecimals)
|
|
110
|
+
HandleKeyDownNumerics(e, !!constrainDecimals, !!allowNegative)
|
|
110
111
|
if (otherProps.onkeydown) otherProps.onkeydown(e)
|
|
111
112
|
}}
|
|
112
113
|
onblur={e => {
|