@aerogel/core 0.1.1-next.ce10b6d6ba4cd98145cf14595fb4f292b979e2dc → 0.1.1-next.d6144642389e7fbf7ef662ecdbb069e185750112
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
|
@@ -65,11 +65,19 @@ function getValue(): FormFieldValue | null {
|
|
|
65
65
|
return $input.value.checked;
|
|
66
66
|
case 'date':
|
|
67
67
|
case 'time':
|
|
68
|
-
case 'datetime-local':
|
|
69
|
-
|
|
68
|
+
case 'datetime-local': {
|
|
69
|
+
const date = new Date(
|
|
70
70
|
Math.round($input.value.valueAsNumber / 60000) * 60000 +
|
|
71
|
-
getLocalTimezoneOffset($input.value.valueAsDate),
|
|
71
|
+
getLocalTimezoneOffset($input.value.valueAsDate ?? new Date($input.value.valueAsNumber)),
|
|
72
72
|
);
|
|
73
|
+
|
|
74
|
+
if (isNaN(date.getTime())) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return date;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
case 'number':
|
|
74
82
|
return $input.value.valueAsNumber;
|
|
75
83
|
default:
|
|
@@ -87,7 +95,10 @@ watchEffect(() => {
|
|
|
87
95
|
const roundedValue = Math.round(value.value.getTime() / 60000) * 60000;
|
|
88
96
|
|
|
89
97
|
$input.value.valueAsNumber = roundedValue - getLocalTimezoneOffset(value.value);
|
|
90
|
-
|
|
98
|
+
|
|
99
|
+
if (value.value.getTime() !== roundedValue) {
|
|
100
|
+
input.update(new Date(roundedValue));
|
|
101
|
+
}
|
|
91
102
|
|
|
92
103
|
return;
|
|
93
104
|
}
|
package/src/errors/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { App as AppInstance } from 'vue';
|
|
|
3
3
|
import App from '@aerogel/core/services/App';
|
|
4
4
|
import { bootServices } from '@aerogel/core/services';
|
|
5
5
|
import { definePlugin } from '@aerogel/core/plugins';
|
|
6
|
+
import { getErrorMessage } from '@aerogel/core/errors/utils';
|
|
6
7
|
|
|
7
8
|
import Errors from './Errors';
|
|
8
9
|
import settings from './settings';
|
|
@@ -16,6 +17,10 @@ export type { ErrorSource, ErrorReport, ErrorReportLog };
|
|
|
16
17
|
|
|
17
18
|
const services = { $errors: Errors };
|
|
18
19
|
const frameworkHandler: ErrorHandler = (error) => {
|
|
20
|
+
if (getErrorMessage(error).includes('ResizeObserver loop completed with undelivered notifications.')) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
Errors.report(error);
|
|
20
25
|
|
|
21
26
|
return true;
|
|
@@ -2,10 +2,14 @@ import { fail } from '@noeldemartin/utils';
|
|
|
2
2
|
import { customRef } from 'vue';
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
5
|
-
export function reactiveSet<T>(initial?: T[] | Set<T
|
|
5
|
+
export function reactiveSet<T>(initial?: T[] | Set<T>, options: { equals?: (a: T, b: T) => boolean } = {}) {
|
|
6
6
|
let set: Set<T> = new Set(initial);
|
|
7
7
|
let trigger: () => void;
|
|
8
8
|
let track: () => void;
|
|
9
|
+
const equals = options?.equals;
|
|
10
|
+
const hasEqual = equals
|
|
11
|
+
? (item: T) => ref.value.values().some((existingItem) => equals(item, existingItem))
|
|
12
|
+
: () => false;
|
|
9
13
|
const ref = customRef((_track, _trigger) => {
|
|
10
14
|
track = _track;
|
|
11
15
|
trigger = _trigger;
|
|
@@ -25,11 +29,15 @@ export function reactiveSet<T>(initial?: T[] | Set<T>) {
|
|
|
25
29
|
has(item: T) {
|
|
26
30
|
track();
|
|
27
31
|
|
|
28
|
-
return ref.value.has(item);
|
|
32
|
+
return ref.value.has(item) || hasEqual(item);
|
|
29
33
|
},
|
|
30
34
|
add(item: T) {
|
|
31
35
|
trigger();
|
|
32
36
|
|
|
37
|
+
if (hasEqual(item)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
ref.value.add(item);
|
|
34
42
|
},
|
|
35
43
|
delete(item: T) {
|