@tripod311/splash 0.0.8 → 0.0.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactiveProp.d.ts","sourceRoot":"","sources":["../../src/reactives/reactiveProp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAe;IACxD,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"reactiveProp.d.ts","sourceRoot":"","sources":["../../src/reactives/reactiveProp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAe;IACxD,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM;IAgBnD,MAAM,CAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAiBpC,OAAO,IAAK,MAAM,GAAG,IAAI;CAGzB"}
|
|
@@ -5,21 +5,32 @@ export default class ReactiveProp extends ReactiveElement {
|
|
|
5
5
|
constructor(element, propName) {
|
|
6
6
|
super(element);
|
|
7
7
|
this.propName = propName;
|
|
8
|
-
if (
|
|
9
|
-
this.currentValue = element.
|
|
8
|
+
if (this.propName === "value") {
|
|
9
|
+
this.currentValue = element.value;
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
|
|
12
|
+
if (element.hasAttribute(propName)) {
|
|
13
|
+
this.currentValue = element.getAttribute(this.propName);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.currentValue = null;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
update(newValue, oldValue) {
|
|
16
|
-
if (
|
|
17
|
-
this.
|
|
18
|
-
this.element.
|
|
21
|
+
if (this.propName === "value") {
|
|
22
|
+
this.element.value = newValue;
|
|
23
|
+
this.currentValue = this.element.value;
|
|
19
24
|
}
|
|
20
25
|
else {
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
if (newValue === null || newValue === undefined) {
|
|
27
|
+
this.currentValue = null;
|
|
28
|
+
this.element.removeAttribute(this.propName);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.currentValue = newValue.toString();
|
|
32
|
+
this.element.setAttribute(this.propName, this.currentValue);
|
|
33
|
+
}
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
36
|
current() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactiveProp.js","sourceRoot":"","sources":["../../src/reactives/reactiveProp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAe;IAC9C,QAAQ,CAAS;IACjB,YAAY,CAAgB;IAEtC,YAAa,OAAoB,EAAE,QAAgB;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"reactiveProp.js","sourceRoot":"","sources":["../../src/reactives/reactiveProp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,uBAAuB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAe;IAC9C,QAAQ,CAAS;IACjB,YAAY,CAAgB;IAEtC,YAAa,OAAoB,EAAE,QAAgB;QAClD,KAAK,CA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