@aquera/nile-elements 1.9.10 → 1.9.11
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/README.md +3 -0
- package/dist/{index-a487d8b4.esm.js → index-802939a8.esm.js} +1 -1
- package/dist/{index-747d1880.cjs.js → index-d37d33cb.cjs.js} +2 -2
- package/dist/index-d37d33cb.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +59 -5
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.esm.js +54 -0
- package/dist/nile-drawer/nile-drawer.esm.js +6 -6
- package/dist/src/nile-drawer/nile-drawer.css.js +54 -0
- package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.d.ts +4 -0
- package/dist/src/nile-drawer/nile-drawer.js +83 -38
- package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.test.js +71 -0
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-drawer/nile-drawer.css.ts +54 -0
- package/src/nile-drawer/nile-drawer.test.ts +73 -0
- package/src/nile-drawer/nile-drawer.ts +58 -11
- package/vscode-html-custom-data.json +11 -1
- package/dist/index-747d1880.cjs.js.map +0 -1
package/package.json
CHANGED
|
@@ -57,6 +57,56 @@ export const styles = css`
|
|
|
57
57
|
z-index: 700;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.drawer--push {
|
|
61
|
+
position: relative;
|
|
62
|
+
z-index: initial;
|
|
63
|
+
}
|
|
64
|
+
:host([push]) {
|
|
65
|
+
display: block;
|
|
66
|
+
flex: 0 0 auto;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
transition: inline-size var(--push-duration, 250ms) var(--push-easing, ease),
|
|
69
|
+
block-size var(--push-duration, 250ms) var(--push-easing, ease);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([push][placement='start']),
|
|
73
|
+
:host([push][placement='end']) {
|
|
74
|
+
inline-size: 0;
|
|
75
|
+
max-inline-size: 100%;
|
|
76
|
+
align-self: stretch;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([push][placement='top']),
|
|
80
|
+
:host([push][placement='bottom']) {
|
|
81
|
+
block-size: 0;
|
|
82
|
+
max-block-size: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([push][open][placement='start']),
|
|
86
|
+
:host([push][open][placement='end']) {
|
|
87
|
+
inline-size: var(--size);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([push][open][placement='top']),
|
|
91
|
+
:host([push][open][placement='bottom']) {
|
|
92
|
+
block-size: var(--size);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (prefers-reduced-motion: reduce) {
|
|
96
|
+
:host([push]) {
|
|
97
|
+
transition: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.drawer--push .drawer__overlay {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.drawer--push .drawer__panel {
|
|
106
|
+
max-inline-size: none;
|
|
107
|
+
max-block-size: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
60
110
|
.drawer__panel {
|
|
61
111
|
position: absolute;
|
|
62
112
|
display: flex;
|
|
@@ -177,6 +227,10 @@ export const styles = css`
|
|
|
177
227
|
display: none;
|
|
178
228
|
}
|
|
179
229
|
|
|
230
|
+
:host([nooverlay]) .drawer__overlay {
|
|
231
|
+
background-color: transparent;
|
|
232
|
+
}
|
|
233
|
+
|
|
180
234
|
.drawer__close:hover {
|
|
181
235
|
cursor:pointer;
|
|
182
236
|
}
|
|
@@ -103,4 +103,77 @@ describe('NileDrawer', () => {
|
|
|
103
103
|
it('98. header-actions part', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); expect(el.shadowRoot!.querySelector('[part="header-actions"]')).to.exist; });
|
|
104
104
|
it('99. dynamic closeOnEscape', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); el.closeOnEscape = false; await el.updateComplete; expect(el.closeOnEscape).to.be.false; });
|
|
105
105
|
it('100. full integration', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer label="Settings" placement="start" class="dr" id="dr1">Content<div slot="footer">Footer</div></nile-drawer>`); expect(el.label).to.equal('Settings'); expect(el.placement).to.equal('start'); expect(el.id).to.equal('dr1'); expect(el.open).to.be.false; expect(el.shadowRoot!.querySelector('.drawer')).to.exist; expect(el.shadowRoot!.querySelector('.drawer__panel')).to.exist; });
|
|
106
|
+
|
|
107
|
+
// Push mode: the drawer is part of the layout instead of an overlay.
|
|
108
|
+
it('101. push defaults false', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); expect(el.push).to.equal(false); });
|
|
109
|
+
it('102. push reflects', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push></nile-drawer>`); expect(el.push).to.be.true; expect(el.hasAttribute('push')).to.be.true; });
|
|
110
|
+
it('103. push adds drawer--push', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push></nile-drawer>`); expect(el.shadowRoot!.querySelector('.drawer--push')).to.exist; });
|
|
111
|
+
it('104. push drops drawer--fixed', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push></nile-drawer>`); expect(el.shadowRoot!.querySelector('.drawer--fixed')).to.be.null; });
|
|
112
|
+
it('105. push wins over contained', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push contained></nile-drawer>`); expect(el.shadowRoot!.querySelector('.drawer--push')).to.exist; expect(el.shadowRoot!.querySelector('.drawer--contained')).to.be.null; });
|
|
113
|
+
it('106. push hides the overlay', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push open></nile-drawer>`); await el.updateComplete; expect(getComputedStyle(el.shadowRoot!.querySelector('.drawer__overlay') as HTMLElement).display).to.equal('none'); });
|
|
114
|
+
it('107. push host is not display:contents', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push></nile-drawer>`); await el.updateComplete; expect(getComputedStyle(el).display).to.equal('block'); });
|
|
115
|
+
it('108. overlay mode host stays display:contents', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); await el.updateComplete; expect(getComputedStyle(el).display).to.equal('contents'); });
|
|
116
|
+
it('109. push takes inline space when open', async () => {
|
|
117
|
+
const c = await fixture(html`<div style="display:flex;width:400px;height:200px"><nile-drawer push placement="end" style="--size:100px"></nile-drawer><div style="flex:1 1 auto"></div></div>`);
|
|
118
|
+
const el = c.querySelector('nile-drawer') as NileDrawer;
|
|
119
|
+
await el.updateComplete;
|
|
120
|
+
expect(el.getBoundingClientRect().width).to.equal(0);
|
|
121
|
+
await el.show();
|
|
122
|
+
expect(el.getBoundingClientRect().width).to.equal(100);
|
|
123
|
+
await el.hide();
|
|
124
|
+
expect(el.getBoundingClientRect().width).to.equal(0);
|
|
125
|
+
});
|
|
126
|
+
it('110. push pushes its sibling', async () => {
|
|
127
|
+
const c = await fixture(html`<div style="display:flex;width:400px;height:200px"><nile-drawer push placement="start" style="--size:100px"></nile-drawer><div id="c" style="flex:1 1 auto"></div></div>`);
|
|
128
|
+
const el = c.querySelector('nile-drawer') as NileDrawer;
|
|
129
|
+
const content = c.querySelector('#c') as HTMLElement;
|
|
130
|
+
await el.updateComplete;
|
|
131
|
+
expect(content.getBoundingClientRect().width).to.equal(400);
|
|
132
|
+
await el.show();
|
|
133
|
+
expect(content.getBoundingClientRect().width).to.equal(300);
|
|
134
|
+
});
|
|
135
|
+
it('111. push takes block space when open', async () => {
|
|
136
|
+
const c = await fixture(html`<div style="display:flex;flex-direction:column;width:400px;height:200px"><nile-drawer push placement="top" style="--size:60px"></nile-drawer><div style="flex:1 1 auto"></div></div>`);
|
|
137
|
+
const el = c.querySelector('nile-drawer') as NileDrawer;
|
|
138
|
+
await el.updateComplete;
|
|
139
|
+
expect(el.getBoundingClientRect().height).to.equal(0);
|
|
140
|
+
await el.show();
|
|
141
|
+
expect(el.getBoundingClientRect().height).to.equal(60);
|
|
142
|
+
});
|
|
143
|
+
it('112. push emits after-show and after-hide', async () => {
|
|
144
|
+
const el = await fixture<NileDrawer>(html`<nile-drawer push style="--size:100px"></nile-drawer>`);
|
|
145
|
+
const seen: string[] = [];
|
|
146
|
+
['nile-show', 'nile-after-show', 'nile-hide', 'nile-after-hide'].forEach(t => el.addEventListener(t, e => seen.push(e.type)));
|
|
147
|
+
await el.show();
|
|
148
|
+
await el.hide();
|
|
149
|
+
expect(seen).to.deep.equal(['nile-show', 'nile-after-show', 'nile-hide', 'nile-after-hide']);
|
|
150
|
+
});
|
|
151
|
+
it('113. escape does not close a push drawer', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push open></nile-drawer>`); await el.updateComplete; document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); await el.updateComplete; expect(el.open).to.be.true; });
|
|
152
|
+
it('114. push does not lock body scrolling', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer push style="--size:100px"></nile-drawer>`); await el.show(); expect(document.body.classList.contains('nile-scroll-lock')).to.be.false; });
|
|
153
|
+
|
|
154
|
+
// noOverlay: hides the backdrop tint without giving up modal behaviour.
|
|
155
|
+
it('115. noOverlay defaults false', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); expect(el.noOverlay).to.equal(false); });
|
|
156
|
+
it('116. noOverlay reflects as nooverlay', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer nooverlay></nile-drawer>`); expect(el.noOverlay).to.be.true; expect(el.hasAttribute('nooverlay')).to.be.true; el.noOverlay = false; await el.updateComplete; expect(el.hasAttribute('nooverlay')).to.be.false; });
|
|
157
|
+
it('116b. noOverlay property sets the attribute', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer></nile-drawer>`); el.noOverlay = true; await el.updateComplete; expect(el.hasAttribute('nooverlay')).to.be.true; expect(el.hasAttribute('no-overlay')).to.be.false; });
|
|
158
|
+
it('117. overlay is tinted by default', async () => {
|
|
159
|
+
const el = await fixture<NileDrawer>(html`<nile-drawer open></nile-drawer>`);
|
|
160
|
+
await el.updateComplete;
|
|
161
|
+
const bg = getComputedStyle(el.shadowRoot!.querySelector('.drawer__overlay') as HTMLElement).backgroundColor;
|
|
162
|
+
expect(bg).to.not.equal('rgba(0, 0, 0, 0)');
|
|
163
|
+
});
|
|
164
|
+
it('118. noOverlay makes the overlay transparent', async () => {
|
|
165
|
+
const el = await fixture<NileDrawer>(html`<nile-drawer open nooverlay></nile-drawer>`);
|
|
166
|
+
await el.updateComplete;
|
|
167
|
+
const bg = getComputedStyle(el.shadowRoot!.querySelector('.drawer__overlay') as HTMLElement).backgroundColor;
|
|
168
|
+
expect(bg).to.equal('rgba(0, 0, 0, 0)');
|
|
169
|
+
});
|
|
170
|
+
it('119. noOverlay keeps click-outside-to-close working', async () => {
|
|
171
|
+
const el = await fixture<NileDrawer>(html`<nile-drawer open nooverlay></nile-drawer>`);
|
|
172
|
+
await el.updateComplete;
|
|
173
|
+
(el.shadowRoot!.querySelector('.drawer__overlay') as HTMLElement).click();
|
|
174
|
+
await el.updateComplete;
|
|
175
|
+
expect(el.open).to.be.false;
|
|
176
|
+
});
|
|
177
|
+
it('120. noOverlay still locks body scrolling', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer nooverlay></nile-drawer>`); await el.show(); expect(document.body.classList.contains('nile-scroll-lock')).to.be.true; await el.hide(); });
|
|
178
|
+
it('121. camelCase noOverlay in markup still works', async () => { const el = await fixture<NileDrawer>(html`<nile-drawer open noOverlay></nile-drawer>`); await el.updateComplete; expect(el.noOverlay).to.be.true; expect(getComputedStyle(el.shadowRoot!.querySelector('.drawer__overlay') as HTMLElement).backgroundColor).to.equal('rgba(0, 0, 0, 0)'); });
|
|
106
179
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import '../nile-icon-button/nile-icon-button';
|
|
9
|
-
import { animateTo, stopAnimations } from '../internal/animate';
|
|
9
|
+
import { animateTo, parseDuration, stopAnimations } from '../internal/animate';
|
|
10
10
|
import { classMap } from 'lit/directives/class-map.js';
|
|
11
11
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
12
12
|
import { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';
|
|
@@ -112,6 +112,8 @@ export class NileDrawer extends NileElement {
|
|
|
112
112
|
*/
|
|
113
113
|
@property({ type: Boolean, reflect: true }) contained = false;
|
|
114
114
|
|
|
115
|
+
@property({ type: Boolean, reflect: true }) push = false;
|
|
116
|
+
|
|
115
117
|
/**
|
|
116
118
|
* Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property
|
|
117
119
|
*/
|
|
@@ -122,6 +124,12 @@ export class NileDrawer extends NileElement {
|
|
|
122
124
|
* accessible way for users to dismiss the drawer.
|
|
123
125
|
*/
|
|
124
126
|
@property({ attribute: 'no-header', type: Boolean, reflect: true }) noHeader = false;
|
|
127
|
+
|
|
128
|
+
@property({type: Boolean, reflect: true }) noOverlay = false;
|
|
129
|
+
|
|
130
|
+
private get isNonModal() {
|
|
131
|
+
return this.contained || this.push;
|
|
132
|
+
}
|
|
125
133
|
|
|
126
134
|
connectedCallback() {
|
|
127
135
|
super.connectedCallback();
|
|
@@ -135,7 +143,7 @@ export class NileDrawer extends NileElement {
|
|
|
135
143
|
if (this.open) {
|
|
136
144
|
this.addOpenListeners();
|
|
137
145
|
|
|
138
|
-
if (!this.
|
|
146
|
+
if (!this.isNonModal) {
|
|
139
147
|
this.modal.activate();
|
|
140
148
|
lockBodyScrolling(this);
|
|
141
149
|
}
|
|
@@ -172,12 +180,40 @@ export class NileDrawer extends NileElement {
|
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
private handleDocumentKeyDown(event: KeyboardEvent) {
|
|
175
|
-
if (this.open && !this.
|
|
183
|
+
if (this.open && !this.isNonModal && event.key === 'Escape') {
|
|
176
184
|
event.stopPropagation();
|
|
177
185
|
this.requestClose('keyboard');
|
|
178
186
|
}
|
|
179
187
|
}
|
|
180
188
|
|
|
189
|
+
private async waitForPushTransition() {
|
|
190
|
+
await this.updateComplete;
|
|
191
|
+
|
|
192
|
+
const style = getComputedStyle(this);
|
|
193
|
+
const duration =
|
|
194
|
+
parseDuration(style.transitionDuration.split(',')[0]) + parseDuration(style.transitionDelay.split(',')[0]);
|
|
195
|
+
|
|
196
|
+
if (!duration) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return new Promise<void>(resolve => {
|
|
201
|
+
const finish = () => {
|
|
202
|
+
this.removeEventListener('transitionend', handleTransitionEnd);
|
|
203
|
+
clearTimeout(fallback);
|
|
204
|
+
resolve();
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const handleTransitionEnd = (event: Event) => {
|
|
208
|
+
if (event.target === this) {
|
|
209
|
+
finish();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const fallback = setTimeout(finish, duration + 50);
|
|
213
|
+
this.addEventListener('transitionend', handleTransitionEnd);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
181
217
|
@watch('open', { waitUntilFirstUpdate: true })
|
|
182
218
|
async handleOpenChange() {
|
|
183
219
|
if (this.open) {
|
|
@@ -186,8 +222,8 @@ export class NileDrawer extends NileElement {
|
|
|
186
222
|
this.addOpenListeners();
|
|
187
223
|
this.originalTrigger = document.activeElement as HTMLElement;
|
|
188
224
|
|
|
189
|
-
// Lock body scrolling only if the drawer isn't contained
|
|
190
|
-
if (!this.
|
|
225
|
+
// Lock body scrolling only if the drawer isn't contained or pushing
|
|
226
|
+
if (!this.isNonModal) {
|
|
191
227
|
this.modal.activate();
|
|
192
228
|
lockBodyScrolling(this);
|
|
193
229
|
}
|
|
@@ -224,6 +260,9 @@ export class NileDrawer extends NileElement {
|
|
|
224
260
|
}
|
|
225
261
|
});
|
|
226
262
|
|
|
263
|
+
if (this.push) {
|
|
264
|
+
await this.waitForPushTransition();
|
|
265
|
+
} else {
|
|
227
266
|
const panelAnimation = getAnimation(this, `drawer.show${uppercaseFirstLetter(this.placement)}`, {
|
|
228
267
|
dir: ''
|
|
229
268
|
});
|
|
@@ -232,6 +271,7 @@ export class NileDrawer extends NileElement {
|
|
|
232
271
|
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),
|
|
233
272
|
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)
|
|
234
273
|
]);
|
|
274
|
+
}
|
|
235
275
|
|
|
236
276
|
this.emit('nile-after-show');
|
|
237
277
|
} else {
|
|
@@ -239,12 +279,17 @@ export class NileDrawer extends NileElement {
|
|
|
239
279
|
this.emit('nile-hide');
|
|
240
280
|
this.removeOpenListeners();
|
|
241
281
|
|
|
242
|
-
if (!this.
|
|
282
|
+
if (!this.isNonModal) {
|
|
243
283
|
this.modal.deactivate();
|
|
244
284
|
unlockBodyScrolling(this);
|
|
245
285
|
}
|
|
246
286
|
|
|
247
287
|
await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);
|
|
288
|
+
|
|
289
|
+
if (this.push) {
|
|
290
|
+
await this.waitForPushTransition();
|
|
291
|
+
this.drawer.hidden = true;
|
|
292
|
+
} else {
|
|
248
293
|
const panelAnimation = getAnimation(this, `drawer.hide${uppercaseFirstLetter(this.placement)}`, {
|
|
249
294
|
dir: ''
|
|
250
295
|
});
|
|
@@ -267,6 +312,7 @@ export class NileDrawer extends NileElement {
|
|
|
267
312
|
// Now that the dialog is hidden, restore the overlay and panel for next time
|
|
268
313
|
this.overlay.hidden = false;
|
|
269
314
|
this.panel.hidden = false;
|
|
315
|
+
}
|
|
270
316
|
|
|
271
317
|
// Restore focus to the original trigger
|
|
272
318
|
const trigger = this.originalTrigger;
|
|
@@ -278,14 +324,14 @@ export class NileDrawer extends NileElement {
|
|
|
278
324
|
}
|
|
279
325
|
}
|
|
280
326
|
|
|
281
|
-
@watch('contained', { waitUntilFirstUpdate: true })
|
|
327
|
+
@watch(['contained', 'push'], { waitUntilFirstUpdate: true })
|
|
282
328
|
handleNoModalChange() {
|
|
283
|
-
if (this.open && !this.
|
|
329
|
+
if (this.open && !this.isNonModal) {
|
|
284
330
|
this.modal.activate();
|
|
285
331
|
lockBodyScrolling(this);
|
|
286
332
|
}
|
|
287
333
|
|
|
288
|
-
if (this.open && this.
|
|
334
|
+
if (this.open && this.isNonModal) {
|
|
289
335
|
this.modal.deactivate();
|
|
290
336
|
unlockBodyScrolling(this);
|
|
291
337
|
}
|
|
@@ -322,8 +368,9 @@ export class NileDrawer extends NileElement {
|
|
|
322
368
|
'drawer--end': this.placement === 'end',
|
|
323
369
|
'drawer--bottom': this.placement === 'bottom',
|
|
324
370
|
'drawer--start': this.placement === 'start',
|
|
325
|
-
'drawer--contained': this.contained,
|
|
326
|
-
'drawer--
|
|
371
|
+
'drawer--contained': this.contained && !this.push,
|
|
372
|
+
'drawer--push': this.push,
|
|
373
|
+
'drawer--fixed': !this.contained && !this.push,
|
|
327
374
|
'drawer--rtl': 'rtl',
|
|
328
375
|
'drawer--has-footer': this.hasSlotController.test('footer'),
|
|
329
376
|
})}
|
|
@@ -2323,7 +2323,7 @@
|
|
|
2323
2323
|
},
|
|
2324
2324
|
{
|
|
2325
2325
|
"name": "nile-drawer",
|
|
2326
|
-
"description": "Nile drawer component.\n\nEvents:\n\n * `nile-show` {} - Emitted when the drawer opens.\n\n * `nile-after-show` {} - Emitted after the drawer opens and all animations are complete.\n\n * `nile-hide` {} - Emitted when the drawer closes.\n\n * `nile-after-hide` {} - Emitted after the drawer closes and all animations are complete.\n\n * `nile-initial-focus` {} - Emitted when the drawer opens and is ready to receive focus. Calling\n`event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n\n * `nile-request-close` {`\"{ source: 'close-button' \" | \"keyboard\" | \" 'overlay' }\"`} - Emitted when the user attempts to\nclose the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n`event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\ndestructive behavior such as data loss.\n\nSlots:\n\n * ` ` {} - The drawer's main content.\n\n * `label` {} - The drawer's label. Alternatively, you can use the `label` attribute.\n\n * `header-actions` {} - Optional actions to add to the header. Works best with `<nile-icon-button>`.\n\n * `footer` {} - The drawer's footer, usually one or more buttons representing various options.\n\nAttributes:\n\n * `open` {`boolean`} - Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n\n * `closeOnEscape` {`boolean`} - \n\n * `label` {`string`} - The drawer's label as displayed in the header. You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\" | \"end\" | \"start\"`} - The direction from which the drawer will open.\n\n * `contained` {`boolean`} - By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\nits parent element, set this attribute and add `position: relative` to the parent.\n\n * `preventOverlayClose` {`boolean`} - Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property\n\n * `no-header` {`boolean`} - Removes the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the drawer.\n\nProperties:\n\n * `styles` - \n\n * `hasSlotController` - \n\n * `modal` - \n\n * `originalTrigger` {`HTMLElement | null`} - \n\n * `drawer` {`HTMLElement`} - \n\n * `panel` {`HTMLElement`} - \n\n * `overlay` {`HTMLElement`} - \n\n * `open` {`boolean`} - Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n\n * `closeOnEscape` {`boolean`} - \n\n * `label` {`string`} - The drawer's label as displayed in the header. You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\" | \"end\" | \"start\"`} - The direction from which the drawer will open.\n\n * `contained` {`boolean`} - By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\nits parent element, set this attribute and add `position: relative` to the parent.\n\n * `preventOverlayClose` {`boolean`} - Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property\n\n * `noHeader` {`boolean`} - Removes the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the drawer.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
2326
|
+
"description": "Nile drawer component.\n\nEvents:\n\n * `nile-show` {} - Emitted when the drawer opens.\n\n * `nile-after-show` {} - Emitted after the drawer opens and all animations are complete.\n\n * `nile-hide` {} - Emitted when the drawer closes.\n\n * `nile-after-hide` {} - Emitted after the drawer closes and all animations are complete.\n\n * `nile-initial-focus` {} - Emitted when the drawer opens and is ready to receive focus. Calling\n`event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.\n\n * `nile-request-close` {`\"{ source: 'close-button' \" | \"keyboard\" | \" 'overlay' }\"`} - Emitted when the user attempts to\nclose the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling\n`event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in\ndestructive behavior such as data loss.\n\nSlots:\n\n * ` ` {} - The drawer's main content.\n\n * `label` {} - The drawer's label. Alternatively, you can use the `label` attribute.\n\n * `header-actions` {} - Optional actions to add to the header. Works best with `<nile-icon-button>`.\n\n * `footer` {} - The drawer's footer, usually one or more buttons representing various options.\n\nAttributes:\n\n * `open` {`boolean`} - Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n\n * `closeOnEscape` {`boolean`} - \n\n * `label` {`string`} - The drawer's label as displayed in the header. You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\" | \"end\" | \"start\"`} - The direction from which the drawer will open.\n\n * `contained` {`boolean`} - By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\nits parent element, set this attribute and add `position: relative` to the parent.\n\n * `push` {`boolean`} - \n\n * `preventOverlayClose` {`boolean`} - Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property\n\n * `no-header` {`boolean`} - Removes the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the drawer.\n\n * `noOverlay` {`boolean`} - \n\nProperties:\n\n * `styles` - \n\n * `hasSlotController` - \n\n * `modal` - \n\n * `originalTrigger` {`HTMLElement | null`} - \n\n * `drawer` {`HTMLElement`} - \n\n * `panel` {`HTMLElement`} - \n\n * `overlay` {`HTMLElement`} - \n\n * `open` {`boolean`} - Indicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.\n\n * `closeOnEscape` {`boolean`} - \n\n * `label` {`string`} - The drawer's label as displayed in the header. You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\" | \"end\" | \"start\"`} - The direction from which the drawer will open.\n\n * `contained` {`boolean`} - By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\nits parent element, set this attribute and add `position: relative` to the parent.\n\n * `push` {`boolean`} - \n\n * `preventOverlayClose` {`boolean`} - Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property\n\n * `noHeader` {`boolean`} - Removes the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the drawer.\n\n * `noOverlay` {`boolean`} - \n\n * `isNonModal` {`boolean`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
2327
2327
|
"attributes": [
|
|
2328
2328
|
{
|
|
2329
2329
|
"name": "open",
|
|
@@ -2362,6 +2362,11 @@
|
|
|
2362
2362
|
"description": "`contained` {`boolean`} - By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\nits parent element, set this attribute and add `position: relative` to the parent.\n\nProperty: contained\n\nDefault: false",
|
|
2363
2363
|
"valueSet": "v"
|
|
2364
2364
|
},
|
|
2365
|
+
{
|
|
2366
|
+
"name": "push",
|
|
2367
|
+
"description": "`push` {`boolean`} - \n\nProperty: push\n\nDefault: false",
|
|
2368
|
+
"valueSet": "v"
|
|
2369
|
+
},
|
|
2365
2370
|
{
|
|
2366
2371
|
"name": "preventOverlayClose",
|
|
2367
2372
|
"description": "`preventOverlayClose` {`boolean`} - Drawer doesnt close when clicled on overlay, the only way to close is to do by handling open property\n\nProperty: preventOverlayClose\n\nDefault: false",
|
|
@@ -2372,6 +2377,11 @@
|
|
|
2372
2377
|
"description": "`no-header` {`boolean`} - Removes the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the drawer.\n\nProperty: noHeader\n\nDefault: false",
|
|
2373
2378
|
"valueSet": "v"
|
|
2374
2379
|
},
|
|
2380
|
+
{
|
|
2381
|
+
"name": "noOverlay",
|
|
2382
|
+
"description": "`noOverlay` {`boolean`} - \n\nProperty: noOverlay\n\nDefault: false",
|
|
2383
|
+
"valueSet": "v"
|
|
2384
|
+
},
|
|
2375
2385
|
{
|
|
2376
2386
|
"name": "onnile-show",
|
|
2377
2387
|
"description": "`nile-show` {} - Emitted when the drawer opens."
|