@jungherz-de/glasskit-elements 1.6.2 → 1.8.0
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/components/glk-accordion-item.js +62 -0
- package/dist/components/glk-accordion.js +13 -0
- package/dist/components/glk-avatar.js +59 -0
- package/dist/components/glk-badge.js +38 -0
- package/dist/components/glk-button.js +81 -0
- package/dist/components/glk-card.js +51 -0
- package/dist/components/glk-checkbox.js +104 -0
- package/dist/components/glk-divider.js +12 -0
- package/dist/components/glk-input.js +139 -0
- package/dist/components/glk-list-item.js +188 -0
- package/dist/components/glk-list.js +75 -0
- package/dist/components/glk-modal.js +101 -0
- package/dist/components/glk-nav.js +13 -0
- package/dist/components/glk-pill.js +49 -0
- package/dist/components/glk-popover.js +109 -0
- package/dist/components/glk-progress.js +78 -0
- package/dist/components/glk-radio.js +110 -0
- package/dist/components/glk-range.js +113 -0
- package/dist/components/glk-search.js +88 -0
- package/dist/components/glk-select.js +97 -0
- package/dist/components/glk-status.js +36 -0
- package/dist/components/glk-tab-accessory.js +66 -0
- package/dist/components/glk-tab-bar.js +59 -0
- package/dist/components/glk-tab-dock.js +52 -0
- package/dist/components/glk-tab-item.js +93 -0
- package/dist/components/glk-textarea.js +96 -0
- package/dist/components/glk-title.js +17 -0
- package/dist/components/glk-toast.js +105 -0
- package/dist/components/glk-toggle.js +122 -0
- package/dist/components/shared/base-Bm9Z714o.js +199 -0
- package/dist/glasskit-elements.esm.js +39 -12
- package/dist/glasskit-elements.js +39 -12
- package/dist/glasskit-elements.min.js +1 -1
- package/package.json +7 -4
- package/src/base.js +11 -1
- package/src/components/containers/glk-list.js +2 -2
- package/src/components/content/glk-card.js +19 -2
- package/src/components/feedback/glk-modal.js +5 -5
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import { GlkElement } from '../../base.js';
|
|
2
2
|
|
|
3
|
+
// <glk-card fill> stretches the visible card to the height of its grid or flex
|
|
4
|
+
// cell. The host must become a grid for this: it is stretched by the outer
|
|
5
|
+
// layout but keeps height:auto, so a percentage height on the inner card has
|
|
6
|
+
// nothing definite to resolve against. Making the host a grid stretches its
|
|
7
|
+
// single child instead, which needs no percentage at all. The card also becomes
|
|
8
|
+
// a flex column so a footer can be pushed down with margin-top:auto.
|
|
9
|
+
const fillSheet = new CSSStyleSheet();
|
|
10
|
+
fillSheet.replaceSync(`
|
|
11
|
+
:host([fill]) { display: grid; }
|
|
12
|
+
:host([fill]) .glass-card { display: flex; flex-direction: column; }
|
|
13
|
+
`);
|
|
14
|
+
|
|
3
15
|
class GlkCard extends GlkElement {
|
|
4
16
|
static get observedAttributes() {
|
|
5
|
-
return ['glow'];
|
|
17
|
+
return ['glow', 'fill'];
|
|
6
18
|
}
|
|
7
19
|
|
|
20
|
+
static get hostStyles() { return fillSheet; }
|
|
21
|
+
|
|
8
22
|
render() {
|
|
9
|
-
this._card = this.createElement('div', this._computeClasses());
|
|
23
|
+
this._card = this.createElement('div', this._computeClasses(), { part: 'card' });
|
|
10
24
|
this._card.appendChild(document.createElement('slot'));
|
|
11
25
|
this._wrapper.appendChild(this._card);
|
|
12
26
|
}
|
|
@@ -27,6 +41,9 @@ class GlkCard extends GlkElement {
|
|
|
27
41
|
|
|
28
42
|
get glow() { return this.getBoolAttr('glow'); }
|
|
29
43
|
set glow(v) { this.setBoolAttr('glow', v); }
|
|
44
|
+
|
|
45
|
+
get fill() { return this.getBoolAttr('fill'); }
|
|
46
|
+
set fill(v) { this.setBoolAttr('fill', v); }
|
|
30
47
|
}
|
|
31
48
|
|
|
32
49
|
customElements.define('glk-card', GlkCard);
|
|
@@ -6,22 +6,22 @@ class GlkModal extends GlkElement {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
render() {
|
|
9
|
-
this._overlay = this.createElement('div', ['glass-modal-overlay']);
|
|
9
|
+
this._overlay = this.createElement('div', ['glass-modal-overlay'], { part: 'overlay' });
|
|
10
10
|
|
|
11
|
-
const modal = this.createElement('div', ['glass-modal']);
|
|
11
|
+
const modal = this.createElement('div', ['glass-modal'], { part: 'modal' });
|
|
12
12
|
|
|
13
13
|
// Header
|
|
14
|
-
const header = this.createElement('div', ['glass-modal__header']);
|
|
14
|
+
const header = this.createElement('div', ['glass-modal__header'], { part: 'header' });
|
|
15
15
|
this._titleEl = this.createElement('h2', ['glass-modal__title']);
|
|
16
16
|
this._titleEl.textContent = this.getAttribute('title') || '';
|
|
17
17
|
header.appendChild(this._titleEl);
|
|
18
18
|
|
|
19
19
|
// Body
|
|
20
|
-
const body = this.createElement('div', ['glass-modal__body']);
|
|
20
|
+
const body = this.createElement('div', ['glass-modal__body'], { part: 'body' });
|
|
21
21
|
body.appendChild(document.createElement('slot'));
|
|
22
22
|
|
|
23
23
|
// Footer — clone action buttons from light DOM into shadow DOM
|
|
24
|
-
this._footer = this.createElement('div', ['glass-modal__footer']);
|
|
24
|
+
this._footer = this.createElement('div', ['glass-modal__footer'], { part: 'footer' });
|
|
25
25
|
|
|
26
26
|
modal.appendChild(header);
|
|
27
27
|
modal.appendChild(body);
|