@htmlplus/element 2.4.0 → 2.4.1
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.
|
@@ -30,13 +30,9 @@ export function Element() {
|
|
|
30
30
|
call(this[CONSTANTS.API_INSTANCE], CONSTANTS.LIFECYCLE_ADOPTED);
|
|
31
31
|
}
|
|
32
32
|
attributeChangedCallback(attribute, prev, next) {
|
|
33
|
-
const instance = this[CONSTANTS.API_INSTANCE];
|
|
34
|
-
if (instance[CONSTANTS.API_LOCKED])
|
|
35
|
-
return;
|
|
36
|
-
const name = camelCase(attribute);
|
|
37
33
|
// ensures the integrity of readonly properties to prevent potential errors.
|
|
38
34
|
try {
|
|
39
|
-
this[
|
|
35
|
+
this[camelCase(attribute)] = next;
|
|
40
36
|
}
|
|
41
37
|
catch (_a) { }
|
|
42
38
|
}
|
|
@@ -22,11 +22,9 @@ export function Property(options) {
|
|
|
22
22
|
// Defines a new getter function.
|
|
23
23
|
descriptor.get = function () {
|
|
24
24
|
const value = getter === null || getter === void 0 ? void 0 : getter.apply(this);
|
|
25
|
-
|
|
26
|
-
target[CONSTANTS.API_LOCKED] = true;
|
|
25
|
+
this[CONSTANTS.API_LOCKED] = true;
|
|
27
26
|
updateAttribute(this, name, value);
|
|
28
|
-
|
|
29
|
-
target[CONSTANTS.API_LOCKED] = false;
|
|
27
|
+
this[CONSTANTS.API_LOCKED] = false;
|
|
30
28
|
return value;
|
|
31
29
|
};
|
|
32
30
|
// TODO: Check the lifecycle
|
|
@@ -51,13 +49,13 @@ export function Property(options) {
|
|
|
51
49
|
return;
|
|
52
50
|
this[symbol] = next;
|
|
53
51
|
request(this, name, previous, (skipped) => {
|
|
54
|
-
if (
|
|
52
|
+
if (skipped)
|
|
55
53
|
return;
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
if (!(options === null || options === void 0 ? void 0 : options.reflect))
|
|
55
|
+
return;
|
|
56
|
+
this[CONSTANTS.API_LOCKED] = true;
|
|
58
57
|
updateAttribute(this, name, next);
|
|
59
|
-
|
|
60
|
-
target[CONSTANTS.API_LOCKED] = false;
|
|
58
|
+
this[CONSTANTS.API_LOCKED] = false;
|
|
61
59
|
});
|
|
62
60
|
}
|
|
63
61
|
// Attaches the getter and setter functions to the current property of the target class.
|
|
@@ -73,6 +71,9 @@ export function Property(options) {
|
|
|
73
71
|
const set = descriptor
|
|
74
72
|
? undefined
|
|
75
73
|
: (input) => {
|
|
74
|
+
if (this[CONSTANTS.API_LOCKED]) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
76
77
|
this[key] = toProperty(input, options === null || options === void 0 ? void 0 : options.type);
|
|
77
78
|
};
|
|
78
79
|
// TODO: Check the configuration.
|