intelliwaketssveltekitv25 0.1.150 → 0.1.152
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/Functions.js +17 -7
- package/package.json +1 -1
package/dist/Functions.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const KEY_STRING_TAB = "Tab";
|
|
|
20
20
|
export declare const KEY_STRING_BACKSPACE = "Backspace";
|
|
21
21
|
export declare const KEY_STRING_ESCAPE = "Escape";
|
|
22
22
|
export declare const IsMetaKey: (e: KeyboardEvent) => boolean;
|
|
23
|
-
export declare const CaptureGPS: () => Promise<GeolocationPosition | null>;
|
|
23
|
+
export declare const CaptureGPS: (options?: PositionOptions) => Promise<GeolocationPosition | null>;
|
|
24
24
|
export declare const DownloadBase64Data: (fileName: string, base64: string) => void;
|
|
25
25
|
export declare const CopyRefToClipboard: (ref: HTMLElement, tryFormatted?: boolean) => boolean;
|
|
26
26
|
export declare const TableIDToExcel: (tableID: string, fileName?: string, appendDateTime?: boolean) => void;
|
package/dist/Functions.js
CHANGED
|
@@ -35,16 +35,26 @@ export const IsMetaKey = (e) => e.ctrlKey ||
|
|
|
35
35
|
'Escape',
|
|
36
36
|
'Enter'
|
|
37
37
|
].includes(e.key);
|
|
38
|
-
export const CaptureGPS = () => {
|
|
38
|
+
export const CaptureGPS = (options) => {
|
|
39
39
|
return new Promise((resolve) => {
|
|
40
|
-
|
|
41
|
-
navigator.geolocation
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
try {
|
|
41
|
+
if (navigator.geolocation) {
|
|
42
|
+
navigator.geolocation.getCurrentPosition((position) => {
|
|
43
|
+
resolve(position);
|
|
44
|
+
}, () => {
|
|
45
|
+
resolve(null);
|
|
46
|
+
}, {
|
|
47
|
+
...options,
|
|
48
|
+
timeout: options?.timeout ?? 10000,
|
|
49
|
+
maximumAge: options?.maximumAge ?? 15 * 60 * 1000
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
44
53
|
resolve(null);
|
|
45
|
-
}
|
|
54
|
+
}
|
|
46
55
|
}
|
|
47
|
-
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error(err);
|
|
48
58
|
resolve(null);
|
|
49
59
|
}
|
|
50
60
|
});
|