wj-elements 0.1.114 → 0.1.116
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/wje-color-picker.js +1 -1
- package/dist/wje-dialog.js +0 -4
- package/dist/wje-element.js +17 -6
- package/dist/wje-icon-picker.js +1 -1
- package/dist/wje-masonry.js +1 -1
- package/dist/wje-radio.js +1 -1
- package/dist/wje-select.js +5 -1
- package/dist/wje-textarea.js +1 -1
- package/package.json +1 -1
package/dist/wje-color-picker.js
CHANGED
package/dist/wje-dialog.js
CHANGED
package/dist/wje-element.js
CHANGED
|
@@ -612,6 +612,20 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
612
612
|
let parts = name.split("-");
|
|
613
613
|
return [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join("");
|
|
614
614
|
}
|
|
615
|
+
checkGetterSetter(obj, property) {
|
|
616
|
+
let descriptor = Object.getOwnPropertyDescriptor(obj, property);
|
|
617
|
+
if (descriptor) {
|
|
618
|
+
return {
|
|
619
|
+
hasGetter: typeof descriptor.get === "function" ? descriptor.get : null,
|
|
620
|
+
hasSetter: typeof descriptor.set === "function" ? descriptor.set : null
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
let proto = Object.getPrototypeOf(obj);
|
|
624
|
+
if (proto) {
|
|
625
|
+
return this.checkGetterSetter(proto, property);
|
|
626
|
+
}
|
|
627
|
+
return { hasGetter: null, hasSetter: null };
|
|
628
|
+
}
|
|
615
629
|
/**
|
|
616
630
|
* Creates one property on this class for every
|
|
617
631
|
* HTML property defined on the element
|
|
@@ -620,13 +634,10 @@ const _WJElement = class _WJElement extends HTMLElement {
|
|
|
620
634
|
let attrs = this.getAttributeNames();
|
|
621
635
|
attrs.forEach((name) => {
|
|
622
636
|
const sanitizedName = this.sanitizeName(name);
|
|
623
|
-
|
|
624
|
-
return;
|
|
625
|
-
const protoFunc = Object.getOwnPropertyDescriptors(this.__proto__)[sanitizedName];
|
|
626
|
-
const func = Object.getOwnPropertyDescriptors(this)[sanitizedName];
|
|
637
|
+
const { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);
|
|
627
638
|
Object.defineProperty(this, sanitizedName, {
|
|
628
|
-
set:
|
|
629
|
-
get:
|
|
639
|
+
set: hasSetter ?? ((value) => this.setAttribute(name, value)),
|
|
640
|
+
get: hasGetter ?? (() => this.getAttribute(name))
|
|
630
641
|
});
|
|
631
642
|
});
|
|
632
643
|
}
|
package/dist/wje-icon-picker.js
CHANGED
package/dist/wje-masonry.js
CHANGED
|
@@ -192,7 +192,7 @@ class Masonry extends WJElement {
|
|
|
192
192
|
/**
|
|
193
193
|
* Callback for when the element is disconnected.
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
beforeDisconnect() {
|
|
196
196
|
this.unsetSlot.removeEventListener("slotchange", this.onSlotChange);
|
|
197
197
|
window.removeEventListener("resize", this.onResize);
|
|
198
198
|
if (this.ro != null) {
|
package/dist/wje-radio.js
CHANGED
package/dist/wje-select.js
CHANGED
|
@@ -72,7 +72,11 @@ class Select extends WJElement {
|
|
|
72
72
|
* @param {string} value - The value to set.
|
|
73
73
|
*/
|
|
74
74
|
set value(value) {
|
|
75
|
-
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
this.internals.setFormValue(JSON.stringify(value));
|
|
77
|
+
} else {
|
|
78
|
+
this.internals.setFormValue(value);
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Getter for the value attribute.
|
package/dist/wje-textarea.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.116",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|