@navservice/web-components 1.11.0 → 1.13.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/build/es/componentes/drawer/web-drawer-lateral.d.ts +28 -0
- package/build/es/index.d.ts +2 -11
- package/build/es/index.js +85 -75
- package/build/es/types.d.ts +26 -0
- package/build/lib/componentes/drawer/web-drawer-lateral.d.ts +28 -0
- package/build/lib/index.d.ts +2 -11
- package/build/lib/index.js +91 -79
- package/build/lib/types.d.ts +26 -0
- package/package.json +1 -1
- package/build/es/my-element.d.ts +0 -13
- package/build/lib/my-element.d.ts +0 -13
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface TypesWebDrawerAPI {
|
|
3
|
+
setOpenModal?(): void;
|
|
4
|
+
setCloseModal?(): void;
|
|
5
|
+
setClearAndClose?(): void;
|
|
6
|
+
getEscClose?(): void;
|
|
7
|
+
onOpen?: (value: boolean) => void;
|
|
8
|
+
onClose?: (value: boolean) => void;
|
|
9
|
+
onClear?: (value: boolean) => void;
|
|
10
|
+
onEscClose?: (value: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class TypesWebDrawer extends LitElement implements TypesWebDrawerAPI {
|
|
13
|
+
onOpen?: (value: boolean) => void;
|
|
14
|
+
onClose?: (value: boolean) => void;
|
|
15
|
+
onClear?: (value: boolean) => void;
|
|
16
|
+
onEscClose?: (value: boolean) => void;
|
|
17
|
+
private accessor open;
|
|
18
|
+
private accessor escClose;
|
|
19
|
+
createRenderRoot(): this;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
private handleKeydown;
|
|
23
|
+
getEscClose(): boolean;
|
|
24
|
+
setOpenModal: () => void;
|
|
25
|
+
setCloseModal: () => void;
|
|
26
|
+
setClearAndClose: () => void;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
}
|
package/build/es/index.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
import
|
|
3
|
-
export * from './
|
|
4
|
-
declare global {
|
|
5
|
-
namespace JSX {
|
|
6
|
-
interface IntrinsicElements {
|
|
7
|
-
'my-element': Partial<MyElement> & {
|
|
8
|
-
ref?: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
2
|
+
import './types.ts';
|
|
3
|
+
export * from './componentes/drawer/web-drawer-lateral.ts';
|
|
13
4
|
export {};
|
package/build/es/index.js
CHANGED
|
@@ -295,15 +295,15 @@ function applyDecs2203RFactory() {
|
|
|
295
295
|
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
296
296
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
297
297
|
}
|
|
298
|
-
var _dec, _dec1, _init_open,
|
|
298
|
+
var _dec, _dec1, _init_open, _init_escClose, _initProto;
|
|
299
299
|
_dec = property({
|
|
300
300
|
type: Boolean
|
|
301
301
|
}), _dec1 = property({
|
|
302
302
|
type: Boolean
|
|
303
303
|
});
|
|
304
|
-
class
|
|
304
|
+
class TypesWebDrawer extends LitElement {
|
|
305
305
|
static{
|
|
306
|
-
({ e: [_init_open,
|
|
306
|
+
({ e: [_init_open, _init_escClose, _initProto] } = _apply_decs_2203_r(this, [
|
|
307
307
|
[
|
|
308
308
|
_dec,
|
|
309
309
|
1,
|
|
@@ -312,10 +312,14 @@ class MyElement extends LitElement {
|
|
|
312
312
|
[
|
|
313
313
|
_dec1,
|
|
314
314
|
1,
|
|
315
|
-
"
|
|
315
|
+
"escClose"
|
|
316
316
|
]
|
|
317
317
|
], []));
|
|
318
318
|
}
|
|
319
|
+
onOpen;
|
|
320
|
+
onClose;
|
|
321
|
+
onClear;
|
|
322
|
+
onEscClose;
|
|
319
323
|
#___private_open_1 = (_initProto(this), _init_open(this, false));
|
|
320
324
|
get open() {
|
|
321
325
|
return this.#___private_open_1;
|
|
@@ -323,12 +327,12 @@ class MyElement extends LitElement {
|
|
|
323
327
|
set open(_v) {
|
|
324
328
|
this.#___private_open_1 = _v;
|
|
325
329
|
}
|
|
326
|
-
#
|
|
327
|
-
get
|
|
328
|
-
return this.#
|
|
330
|
+
#___private_escClose_2 = _init_escClose(this, true);
|
|
331
|
+
get escClose() {
|
|
332
|
+
return this.#___private_escClose_2;
|
|
329
333
|
}
|
|
330
|
-
set
|
|
331
|
-
this.#
|
|
334
|
+
set escClose(_v) {
|
|
335
|
+
this.#___private_escClose_2 = _v;
|
|
332
336
|
}
|
|
333
337
|
createRenderRoot() {
|
|
334
338
|
return this;
|
|
@@ -342,80 +346,86 @@ class MyElement extends LitElement {
|
|
|
342
346
|
super.disconnectedCallback();
|
|
343
347
|
}
|
|
344
348
|
handleKeydown = (event)=>{
|
|
345
|
-
if (this.
|
|
349
|
+
if (this.escClose && 'Escape' === event.key && this.open) this.setCloseModal();
|
|
346
350
|
};
|
|
347
|
-
|
|
351
|
+
getEscClose() {
|
|
352
|
+
this.onEscClose?.(this.escClose);
|
|
353
|
+
return this.escClose;
|
|
354
|
+
}
|
|
355
|
+
setOpenModal = ()=>{
|
|
348
356
|
this.open = true;
|
|
357
|
+
this.onOpen?.(this.open);
|
|
349
358
|
};
|
|
350
|
-
|
|
359
|
+
setCloseModal = ()=>{
|
|
351
360
|
this.open = false;
|
|
361
|
+
this.onClose?.(this.open);
|
|
352
362
|
};
|
|
353
|
-
|
|
354
|
-
console.log('Clear acionado');
|
|
363
|
+
setClearAndClose = ()=>{
|
|
355
364
|
this.open = false;
|
|
365
|
+
this.onClear?.(this.open);
|
|
356
366
|
};
|
|
357
367
|
render() {
|
|
358
|
-
return html`
|
|
359
|
-
<div class="min-h-screen flex flex-col items-center justify-center gap-3 bg-gradient-to-br from-gray-50 to-gray-100">
|
|
360
|
-
<h1 class="text-3xl font-semibold tracking-tight text-gray-900">
|
|
361
|
-
Rsbuild + Lit
|
|
362
|
-
</h1>
|
|
363
|
-
<p class="text-sm text-gray-500">
|
|
364
|
-
Interface minimalista, rápida e moderna.
|
|
365
|
-
</p>
|
|
366
|
-
|
|
367
|
-
<button
|
|
368
|
-
class="mt-4 inline-flex items-center justify-center rounded-lg border border-gray-300 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
369
|
-
@click=${this.
|
|
370
|
-
>
|
|
371
|
-
Abrir modal lateral
|
|
372
|
-
</button>
|
|
373
|
-
</div>
|
|
374
|
-
|
|
375
|
-
<!-- Overlay -->
|
|
376
|
-
<div
|
|
377
|
-
class="fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300
|
|
378
|
-
${this.open ? 'opacity-100 pointer-events-auto' : 'opacity-0 pointer-events-none'}"
|
|
379
|
-
@click=${this.
|
|
380
|
-
></div>
|
|
381
|
-
|
|
382
|
-
<!-- Drawer -->
|
|
383
|
-
<aside
|
|
384
|
-
class="fixed right-0 top-0 z-50 h-full w-full max-w-md bg-white shadow-2xl
|
|
385
|
-
transition-transform duration-300 ease-out
|
|
386
|
-
${this.open ? 'translate-x-0' : 'translate-x-full'}"
|
|
387
|
-
>
|
|
388
|
-
<div class="flex h-full flex-col p-6">
|
|
389
|
-
<div class="mb-4">
|
|
390
|
-
<h2 class="text-lg font-semibold text-gray-900">
|
|
391
|
-
Confirmação
|
|
392
|
-
</h2>
|
|
393
|
-
<p class="mt-1 text-sm text-gray-500">
|
|
394
|
-
Este é um modal lateral com UX inspirada em Vercel e Cloudflare.
|
|
395
|
-
</p>
|
|
396
|
-
</div>
|
|
397
|
-
|
|
398
|
-
<div class="flex-1"></div>
|
|
399
|
-
|
|
400
|
-
<div class="flex justify-end gap-3 border-t pt-4">
|
|
401
|
-
<button
|
|
402
|
-
class="rounded-md px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-100 transition"
|
|
403
|
-
@click=${this.
|
|
404
|
-
>
|
|
405
|
-
Cancelar
|
|
406
|
-
</button>
|
|
407
|
-
|
|
408
|
-
<button
|
|
409
|
-
class="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 transition"
|
|
410
|
-
@click=${this.
|
|
411
|
-
>
|
|
412
|
-
Confirmar
|
|
413
|
-
</button>
|
|
414
|
-
</div>
|
|
415
|
-
</div>
|
|
416
|
-
</aside>
|
|
368
|
+
return html`
|
|
369
|
+
<div class="min-h-screen flex flex-col items-center justify-center gap-3 bg-gradient-to-br from-gray-50 to-gray-100">
|
|
370
|
+
<h1 class="text-3xl font-semibold tracking-tight text-gray-900">
|
|
371
|
+
Rsbuild + Lit
|
|
372
|
+
</h1>
|
|
373
|
+
<p class="text-sm text-gray-500">
|
|
374
|
+
Interface minimalista, rápida e moderna.
|
|
375
|
+
</p>
|
|
376
|
+
|
|
377
|
+
<button
|
|
378
|
+
class="mt-4 inline-flex items-center justify-center rounded-lg border border-gray-300 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
379
|
+
@click=${this.setOpenModal}
|
|
380
|
+
>
|
|
381
|
+
Abrir modal lateral
|
|
382
|
+
</button>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
<!-- Overlay -->
|
|
386
|
+
<div
|
|
387
|
+
class="fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300
|
|
388
|
+
${this.open ? 'opacity-100 pointer-events-auto' : 'opacity-0 pointer-events-none'}"
|
|
389
|
+
@click=${this.setCloseModal}
|
|
390
|
+
></div>
|
|
391
|
+
|
|
392
|
+
<!-- Drawer -->
|
|
393
|
+
<aside
|
|
394
|
+
class="fixed right-0 top-0 z-50 h-full w-full max-w-md bg-white shadow-2xl
|
|
395
|
+
transition-transform duration-300 ease-out
|
|
396
|
+
${this.open ? 'translate-x-0' : 'translate-x-full'}"
|
|
397
|
+
>
|
|
398
|
+
<div class="flex h-full flex-col p-6">
|
|
399
|
+
<div class="mb-4">
|
|
400
|
+
<h2 class="text-lg font-semibold text-gray-900">
|
|
401
|
+
Confirmação
|
|
402
|
+
</h2>
|
|
403
|
+
<p class="mt-1 text-sm text-gray-500">
|
|
404
|
+
Este é um modal lateral com UX inspirada em Vercel e Cloudflare.
|
|
405
|
+
</p>
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
<div class="flex-1"></div>
|
|
409
|
+
|
|
410
|
+
<div class="flex justify-end gap-3 border-t pt-4">
|
|
411
|
+
<button
|
|
412
|
+
class="rounded-md px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-100 transition"
|
|
413
|
+
@click=${this.setClearAndClose}
|
|
414
|
+
>
|
|
415
|
+
Cancelar
|
|
416
|
+
</button>
|
|
417
|
+
|
|
418
|
+
<button
|
|
419
|
+
class="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 transition"
|
|
420
|
+
@click=${this.setCloseModal}
|
|
421
|
+
>
|
|
422
|
+
Confirmar
|
|
423
|
+
</button>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
</aside>
|
|
417
427
|
`;
|
|
418
428
|
}
|
|
419
429
|
}
|
|
420
|
-
if (!customElements.get('my-element')) customElements.define('my-element',
|
|
421
|
-
export {
|
|
430
|
+
if (!customElements.get('my-element')) customElements.define('my-element', TypesWebDrawer);
|
|
431
|
+
export { TypesWebDrawer };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TypesWebDrawer } from './componentes/drawer/web-drawer-lateral';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'my-element': TypesWebDrawer;
|
|
5
|
+
}
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
namespace React {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
namespace Vue {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface TypesWebDrawerAPI {
|
|
3
|
+
setOpenModal?(): void;
|
|
4
|
+
setCloseModal?(): void;
|
|
5
|
+
setClearAndClose?(): void;
|
|
6
|
+
getEscClose?(): void;
|
|
7
|
+
onOpen?: (value: boolean) => void;
|
|
8
|
+
onClose?: (value: boolean) => void;
|
|
9
|
+
onClear?: (value: boolean) => void;
|
|
10
|
+
onEscClose?: (value: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class TypesWebDrawer extends LitElement implements TypesWebDrawerAPI {
|
|
13
|
+
onOpen?: (value: boolean) => void;
|
|
14
|
+
onClose?: (value: boolean) => void;
|
|
15
|
+
onClear?: (value: boolean) => void;
|
|
16
|
+
onEscClose?: (value: boolean) => void;
|
|
17
|
+
private accessor open;
|
|
18
|
+
private accessor escClose;
|
|
19
|
+
createRenderRoot(): this;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
private handleKeydown;
|
|
23
|
+
getEscClose(): boolean;
|
|
24
|
+
setOpenModal: () => void;
|
|
25
|
+
setCloseModal: () => void;
|
|
26
|
+
setClearAndClose: () => void;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
}
|
package/build/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
import
|
|
3
|
-
export * from './
|
|
4
|
-
declare global {
|
|
5
|
-
namespace JSX {
|
|
6
|
-
interface IntrinsicElements {
|
|
7
|
-
'my-element': Partial<MyElement> & {
|
|
8
|
-
ref?: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
2
|
+
import './types.ts';
|
|
3
|
+
export * from './componentes/drawer/web-drawer-lateral.ts';
|
|
13
4
|
export {};
|
package/build/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49
49
|
|
|
50
50
|
// EXPORTS
|
|
51
51
|
__webpack_require__.d(__webpack_exports__, {
|
|
52
|
-
|
|
52
|
+
TypesWebDrawer: () => (/* reexport */ TypesWebDrawer)
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
;// CONCATENATED MODULE: ./src/index.css
|
|
@@ -117,7 +117,7 @@ const lit_html_t=globalThis,lit_html_i=t=>t,lit_html_s=lit_html_t.trustedTypes,l
|
|
|
117
117
|
|
|
118
118
|
//# sourceMappingURL=decorators.js.map
|
|
119
119
|
|
|
120
|
-
;// CONCATENATED MODULE: ./src/
|
|
120
|
+
;// CONCATENATED MODULE: ./src/componentes/drawer/web-drawer-lateral.ts
|
|
121
121
|
function applyDecs2203RFactory() {
|
|
122
122
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
123
123
|
return function addInitializer(initializer) {
|
|
@@ -490,7 +490,8 @@ function applyDecs2203RFactory() {
|
|
|
490
490
|
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
491
491
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
492
492
|
}
|
|
493
|
-
var _dec, _dec1,
|
|
493
|
+
var _dec, _dec1, // Propriedades:
|
|
494
|
+
_init_open, _init_escClose, _initProto;
|
|
494
495
|
|
|
495
496
|
|
|
496
497
|
_dec = property_n({
|
|
@@ -498,9 +499,9 @@ _dec = property_n({
|
|
|
498
499
|
}), _dec1 = property_n({
|
|
499
500
|
type: Boolean
|
|
500
501
|
});
|
|
501
|
-
class
|
|
502
|
+
class TypesWebDrawer extends lit_element_i {
|
|
502
503
|
static{
|
|
503
|
-
({ e: [_init_open,
|
|
504
|
+
({ e: [_init_open, _init_escClose, _initProto] } = _apply_decs_2203_r(this, [
|
|
504
505
|
[
|
|
505
506
|
_dec,
|
|
506
507
|
1,
|
|
@@ -509,10 +510,15 @@ class MyElement extends lit_element_i {
|
|
|
509
510
|
[
|
|
510
511
|
_dec1,
|
|
511
512
|
1,
|
|
512
|
-
"
|
|
513
|
+
"escClose"
|
|
513
514
|
]
|
|
514
515
|
], []));
|
|
515
516
|
}
|
|
517
|
+
// Funções recursivas:
|
|
518
|
+
onOpen;
|
|
519
|
+
onClose;
|
|
520
|
+
onClear;
|
|
521
|
+
onEscClose;
|
|
516
522
|
#___private_open_1 = (_initProto(this), _init_open(this, false));
|
|
517
523
|
get open() {
|
|
518
524
|
return this.#___private_open_1;
|
|
@@ -520,12 +526,12 @@ class MyElement extends lit_element_i {
|
|
|
520
526
|
set open(_v) {
|
|
521
527
|
this.#___private_open_1 = _v;
|
|
522
528
|
}
|
|
523
|
-
#
|
|
524
|
-
get
|
|
525
|
-
return this.#
|
|
529
|
+
#___private_escClose_2 = _init_escClose(this, true);
|
|
530
|
+
get escClose() {
|
|
531
|
+
return this.#___private_escClose_2;
|
|
526
532
|
}
|
|
527
|
-
set
|
|
528
|
-
this.#
|
|
533
|
+
set escClose(_v) {
|
|
534
|
+
this.#___private_escClose_2 = _v;
|
|
529
535
|
}
|
|
530
536
|
createRenderRoot() {
|
|
531
537
|
return this;
|
|
@@ -539,80 +545,86 @@ class MyElement extends lit_element_i {
|
|
|
539
545
|
super.disconnectedCallback();
|
|
540
546
|
}
|
|
541
547
|
handleKeydown = (event)=>{
|
|
542
|
-
if (this.
|
|
543
|
-
this.
|
|
548
|
+
if (this.escClose && event.key === 'Escape' && this.open) {
|
|
549
|
+
this.setCloseModal();
|
|
544
550
|
}
|
|
545
551
|
};
|
|
546
|
-
|
|
552
|
+
getEscClose() {
|
|
553
|
+
this.onEscClose?.(this.escClose);
|
|
554
|
+
return this.escClose;
|
|
555
|
+
}
|
|
556
|
+
setOpenModal = ()=>{
|
|
547
557
|
this.open = true;
|
|
558
|
+
this.onOpen?.(this.open);
|
|
548
559
|
};
|
|
549
|
-
|
|
560
|
+
setCloseModal = ()=>{
|
|
550
561
|
this.open = false;
|
|
562
|
+
this.onClose?.(this.open);
|
|
551
563
|
};
|
|
552
|
-
|
|
553
|
-
console.log('Clear acionado');
|
|
564
|
+
setClearAndClose = ()=>{
|
|
554
565
|
this.open = false;
|
|
566
|
+
this.onClear?.(this.open);
|
|
555
567
|
};
|
|
556
568
|
render() {
|
|
557
|
-
return lit_html_b`
|
|
558
|
-
<div class="min-h-screen flex flex-col items-center justify-center gap-3 bg-gradient-to-br from-gray-50 to-gray-100">
|
|
559
|
-
<h1 class="text-3xl font-semibold tracking-tight text-gray-900">
|
|
560
|
-
Rsbuild + Lit
|
|
561
|
-
</h1>
|
|
562
|
-
<p class="text-sm text-gray-500">
|
|
563
|
-
Interface minimalista, rápida e moderna.
|
|
564
|
-
</p>
|
|
565
|
-
|
|
566
|
-
<button
|
|
567
|
-
class="mt-4 inline-flex items-center justify-center rounded-lg border border-gray-300 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
568
|
-
@click=${this.
|
|
569
|
-
>
|
|
570
|
-
Abrir modal lateral
|
|
571
|
-
</button>
|
|
572
|
-
</div>
|
|
573
|
-
|
|
574
|
-
<!-- Overlay -->
|
|
575
|
-
<div
|
|
576
|
-
class="fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300
|
|
577
|
-
${this.open ? 'opacity-100 pointer-events-auto' : 'opacity-0 pointer-events-none'}"
|
|
578
|
-
@click=${this.
|
|
579
|
-
></div>
|
|
580
|
-
|
|
581
|
-
<!-- Drawer -->
|
|
582
|
-
<aside
|
|
583
|
-
class="fixed right-0 top-0 z-50 h-full w-full max-w-md bg-white shadow-2xl
|
|
584
|
-
transition-transform duration-300 ease-out
|
|
585
|
-
${this.open ? 'translate-x-0' : 'translate-x-full'}"
|
|
586
|
-
>
|
|
587
|
-
<div class="flex h-full flex-col p-6">
|
|
588
|
-
<div class="mb-4">
|
|
589
|
-
<h2 class="text-lg font-semibold text-gray-900">
|
|
590
|
-
Confirmação
|
|
591
|
-
</h2>
|
|
592
|
-
<p class="mt-1 text-sm text-gray-500">
|
|
593
|
-
Este é um modal lateral com UX inspirada em Vercel e Cloudflare.
|
|
594
|
-
</p>
|
|
595
|
-
</div>
|
|
596
|
-
|
|
597
|
-
<div class="flex-1"></div>
|
|
598
|
-
|
|
599
|
-
<div class="flex justify-end gap-3 border-t pt-4">
|
|
600
|
-
<button
|
|
601
|
-
class="rounded-md px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-100 transition"
|
|
602
|
-
@click=${this.
|
|
603
|
-
>
|
|
604
|
-
Cancelar
|
|
605
|
-
</button>
|
|
606
|
-
|
|
607
|
-
<button
|
|
608
|
-
class="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 transition"
|
|
609
|
-
@click=${this.
|
|
610
|
-
>
|
|
611
|
-
Confirmar
|
|
612
|
-
</button>
|
|
613
|
-
</div>
|
|
614
|
-
</div>
|
|
615
|
-
</aside>
|
|
569
|
+
return lit_html_b`
|
|
570
|
+
<div class="min-h-screen flex flex-col items-center justify-center gap-3 bg-gradient-to-br from-gray-50 to-gray-100">
|
|
571
|
+
<h1 class="text-3xl font-semibold tracking-tight text-gray-900">
|
|
572
|
+
Rsbuild + Lit
|
|
573
|
+
</h1>
|
|
574
|
+
<p class="text-sm text-gray-500">
|
|
575
|
+
Interface minimalista, rápida e moderna.
|
|
576
|
+
</p>
|
|
577
|
+
|
|
578
|
+
<button
|
|
579
|
+
class="mt-4 inline-flex items-center justify-center rounded-lg border border-gray-300 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 shadow-sm transition hover:bg-gray-50 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
|
580
|
+
@click=${this.setOpenModal}
|
|
581
|
+
>
|
|
582
|
+
Abrir modal lateral
|
|
583
|
+
</button>
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
<!-- Overlay -->
|
|
587
|
+
<div
|
|
588
|
+
class="fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300
|
|
589
|
+
${this.open ? 'opacity-100 pointer-events-auto' : 'opacity-0 pointer-events-none'}"
|
|
590
|
+
@click=${this.setCloseModal}
|
|
591
|
+
></div>
|
|
592
|
+
|
|
593
|
+
<!-- Drawer -->
|
|
594
|
+
<aside
|
|
595
|
+
class="fixed right-0 top-0 z-50 h-full w-full max-w-md bg-white shadow-2xl
|
|
596
|
+
transition-transform duration-300 ease-out
|
|
597
|
+
${this.open ? 'translate-x-0' : 'translate-x-full'}"
|
|
598
|
+
>
|
|
599
|
+
<div class="flex h-full flex-col p-6">
|
|
600
|
+
<div class="mb-4">
|
|
601
|
+
<h2 class="text-lg font-semibold text-gray-900">
|
|
602
|
+
Confirmação
|
|
603
|
+
</h2>
|
|
604
|
+
<p class="mt-1 text-sm text-gray-500">
|
|
605
|
+
Este é um modal lateral com UX inspirada em Vercel e Cloudflare.
|
|
606
|
+
</p>
|
|
607
|
+
</div>
|
|
608
|
+
|
|
609
|
+
<div class="flex-1"></div>
|
|
610
|
+
|
|
611
|
+
<div class="flex justify-end gap-3 border-t pt-4">
|
|
612
|
+
<button
|
|
613
|
+
class="rounded-md px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-100 transition"
|
|
614
|
+
@click=${this.setClearAndClose}
|
|
615
|
+
>
|
|
616
|
+
Cancelar
|
|
617
|
+
</button>
|
|
618
|
+
|
|
619
|
+
<button
|
|
620
|
+
class="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 transition"
|
|
621
|
+
@click=${this.setCloseModal}
|
|
622
|
+
>
|
|
623
|
+
Confirmar
|
|
624
|
+
</button>
|
|
625
|
+
</div>
|
|
626
|
+
</div>
|
|
627
|
+
</aside>
|
|
616
628
|
`;
|
|
617
629
|
}
|
|
618
630
|
}
|
|
@@ -620,10 +632,10 @@ class MyElement extends lit_element_i {
|
|
|
620
632
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
621
633
|
|
|
622
634
|
|
|
635
|
+
// DRAWER
|
|
623
636
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
637
|
+
|
|
638
|
+
if (!customElements.get('my-element')) customElements.define('my-element', TypesWebDrawer);
|
|
627
639
|
|
|
628
640
|
return __webpack_exports__;
|
|
629
641
|
})()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TypesWebDrawer } from './componentes/drawer/web-drawer-lateral';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'my-element': TypesWebDrawer;
|
|
5
|
+
}
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
namespace React {
|
|
12
|
+
namespace JSX {
|
|
13
|
+
interface IntrinsicElements {
|
|
14
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
namespace Vue {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
'my-element': Partial<TypesWebDrawer>;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
package/package.json
CHANGED
package/build/es/my-element.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class MyElement extends LitElement {
|
|
3
|
-
accessor open: boolean;
|
|
4
|
-
accessor setOnEscClose: boolean;
|
|
5
|
-
createRenderRoot(): this;
|
|
6
|
-
connectedCallback(): void;
|
|
7
|
-
disconnectedCallback(): void;
|
|
8
|
-
handleKeydown: (event: KeyboardEvent) => void;
|
|
9
|
-
openModal: () => void;
|
|
10
|
-
closeModal: () => void;
|
|
11
|
-
clearAndClose: () => void;
|
|
12
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class MyElement extends LitElement {
|
|
3
|
-
accessor open: boolean;
|
|
4
|
-
accessor setOnEscClose: boolean;
|
|
5
|
-
createRenderRoot(): this;
|
|
6
|
-
connectedCallback(): void;
|
|
7
|
-
disconnectedCallback(): void;
|
|
8
|
-
handleKeydown: (event: KeyboardEvent) => void;
|
|
9
|
-
openModal: () => void;
|
|
10
|
-
closeModal: () => void;
|
|
11
|
-
clearAndClose: () => void;
|
|
12
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
-
}
|