@jungherz-de/glasskit-elements 1.22.1 → 1.22.3
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/CHANGELOG.md +28 -1
- package/README.md +2 -2
- package/SKILL.md +11 -8
- package/dist/components/base.js +34 -0
- package/dist/components/glk-button.js +6 -9
- package/dist/components/glk-calendar.js +10 -2
- package/dist/components/glk-checkbox.js +3 -8
- package/dist/components/glk-input.js +20 -14
- package/dist/components/glk-radio.js +8 -11
- package/dist/components/glk-range.js +3 -6
- package/dist/components/glk-search.js +3 -6
- package/dist/components/glk-segmented.js +14 -3
- package/dist/components/glk-select.js +3 -8
- package/dist/components/glk-textarea.js +3 -8
- package/dist/components/glk-toggle.js +3 -8
- package/dist/glasskit-elements.esm.js +112 -85
- package/dist/glasskit-elements.js +112 -85
- package/dist/glasskit-elements.min.js +1 -1
- package/package.json +3 -3
- package/src/base.js +34 -0
- package/src/components/buttons/glk-button.js +6 -9
- package/src/components/forms/glk-calendar.js +10 -2
- package/src/components/forms/glk-checkbox.js +3 -8
- package/src/components/forms/glk-input.js +20 -14
- package/src/components/forms/glk-radio.js +8 -11
- package/src/components/forms/glk-range.js +3 -6
- package/src/components/forms/glk-search.js +3 -6
- package/src/components/forms/glk-segmented.js +14 -3
- package/src/components/forms/glk-select.js +3 -8
- package/src/components/forms/glk-textarea.js +3 -8
- package/src/components/forms/glk-toggle.js +3 -8
|
@@ -3,7 +3,7 @@ import '@jungherz-de/glasskit/glasskit-styles.js';
|
|
|
3
3
|
|
|
4
4
|
class GlkTextarea extends GlkFormElement {
|
|
5
5
|
static get observedAttributes() {
|
|
6
|
-
return ['label', 'placeholder', 'rows', '
|
|
6
|
+
return ['label', 'placeholder', 'rows', 'readonly', 'name', 'value', 'required'];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
render() {
|
|
@@ -28,7 +28,6 @@ class GlkTextarea extends GlkFormElement {
|
|
|
28
28
|
this._pendingValue = undefined;
|
|
29
29
|
if (value) this._textarea.value = value;
|
|
30
30
|
|
|
31
|
-
if (this.getBoolAttr('disabled')) this._textarea.disabled = true;
|
|
32
31
|
if (this.getBoolAttr('readonly')) this._textarea.readOnly = true;
|
|
33
32
|
if (this.getBoolAttr('required')) this._textarea.required = true;
|
|
34
33
|
|
|
@@ -64,9 +63,6 @@ class GlkTextarea extends GlkFormElement {
|
|
|
64
63
|
case 'rows':
|
|
65
64
|
this._textarea.setAttribute('rows', this.getAttribute('rows') || '');
|
|
66
65
|
break;
|
|
67
|
-
case 'disabled':
|
|
68
|
-
this._textarea.disabled = this.getBoolAttr('disabled');
|
|
69
|
-
break;
|
|
70
66
|
case 'readonly':
|
|
71
67
|
this._textarea.readOnly = this.getBoolAttr('readonly');
|
|
72
68
|
break;
|
|
@@ -83,6 +79,8 @@ class GlkTextarea extends GlkFormElement {
|
|
|
83
79
|
}
|
|
84
80
|
}
|
|
85
81
|
|
|
82
|
+
applyDisabled(disabled) { this._textarea.disabled = disabled; }
|
|
83
|
+
|
|
86
84
|
get _validityField() { return this._textarea; }
|
|
87
85
|
|
|
88
86
|
_syncFormValue() {
|
|
@@ -104,9 +102,6 @@ class GlkTextarea extends GlkFormElement {
|
|
|
104
102
|
this._syncFormValue();
|
|
105
103
|
}
|
|
106
104
|
|
|
107
|
-
get disabled() { return this.getBoolAttr('disabled'); }
|
|
108
|
-
set disabled(v) { this.setBoolAttr('disabled', v); }
|
|
109
|
-
|
|
110
105
|
get readOnly() { return this.getBoolAttr('readonly'); }
|
|
111
106
|
set readOnly(v) { this.setBoolAttr('readonly', v); }
|
|
112
107
|
}
|
|
@@ -3,7 +3,7 @@ import '@jungherz-de/glasskit/glasskit-styles.js';
|
|
|
3
3
|
|
|
4
4
|
class GlkToggle extends GlkFormElement {
|
|
5
5
|
static get observedAttributes() {
|
|
6
|
-
return ['checked', '
|
|
6
|
+
return ['checked', 'label', 'name', 'value', 'required'];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
static get hostStyles() { return checkControlSheet; }
|
|
@@ -35,7 +35,6 @@ class GlkToggle extends GlkFormElement {
|
|
|
35
35
|
label.appendChild(this._labelEl);
|
|
36
36
|
|
|
37
37
|
if (this.getBoolAttr('checked')) this._input.checked = true;
|
|
38
|
-
if (this.getBoolAttr('disabled')) this._input.disabled = true;
|
|
39
38
|
if (this.getBoolAttr('required')) this._input.required = true;
|
|
40
39
|
|
|
41
40
|
this._defaultChecked = this.getBoolAttr('checked');
|
|
@@ -70,9 +69,6 @@ class GlkToggle extends GlkFormElement {
|
|
|
70
69
|
this._input.checked = this.getBoolAttr('checked');
|
|
71
70
|
this._syncFormValue();
|
|
72
71
|
break;
|
|
73
|
-
case 'disabled':
|
|
74
|
-
this._input.disabled = this.getBoolAttr('disabled');
|
|
75
|
-
break;
|
|
76
72
|
case 'label':
|
|
77
73
|
this._labelEl.textContent = this.getAttribute('label') || '';
|
|
78
74
|
break;
|
|
@@ -85,6 +81,8 @@ class GlkToggle extends GlkFormElement {
|
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
|
|
84
|
+
applyDisabled(disabled) { this._input.disabled = disabled; }
|
|
85
|
+
|
|
88
86
|
get _validityField() { return this._input; }
|
|
89
87
|
|
|
90
88
|
_syncFormValue() {
|
|
@@ -113,9 +111,6 @@ class GlkToggle extends GlkFormElement {
|
|
|
113
111
|
if (this._input) this._syncFormValue();
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
get disabled() { return this.getBoolAttr('disabled'); }
|
|
117
|
-
set disabled(v) { this.setBoolAttr('disabled', v); }
|
|
118
|
-
|
|
119
114
|
get name() { return this.getAttribute('name'); }
|
|
120
115
|
set name(v) { this.setAttribute('name', v); }
|
|
121
116
|
|