@navservice/web-components 1.12.0 → 1.14.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 -1
- package/build/es/index.js +84 -75
- package/build/es/types.d.ts +5 -5
- package/build/lib/componentes/drawer/web-drawer-lateral.d.ts +28 -0
- package/build/lib/index.d.ts +2 -1
- package/build/lib/index.js +89 -112
- package/build/lib/types.d.ts +5 -5
- 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 TypesWebDrawerLateral {
|
|
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 WebDrawerLateral extends LitElement implements TypesWebDrawerLateral {
|
|
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
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 WebDrawerLateral 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,85 @@ 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('
|
|
421
|
-
export { MyElement };
|
|
430
|
+
if (!customElements.get('web-drawer-lateral')) customElements.define('web-drawer-lateral', WebDrawerLateral);
|
package/build/es/types.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TypesWebDrawerLateral } from './componentes/drawer/web-drawer-lateral';
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'my-element':
|
|
4
|
+
'my-element': TypesWebDrawerLateral;
|
|
5
5
|
}
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
8
|
-
'my-element': Partial<
|
|
8
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
namespace React {
|
|
12
12
|
namespace JSX {
|
|
13
13
|
interface IntrinsicElements {
|
|
14
|
-
'my-element': Partial<
|
|
14
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
namespace Vue {
|
|
19
19
|
namespace JSX {
|
|
20
20
|
interface IntrinsicElements {
|
|
21
|
-
'my-element': Partial<
|
|
21
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface TypesWebDrawerLateral {
|
|
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 WebDrawerLateral extends LitElement implements TypesWebDrawerLateral {
|
|
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
package/build/lib/index.js
CHANGED
|
@@ -16,41 +16,7 @@
|
|
|
16
16
|
})(globalThis, () => {
|
|
17
17
|
return (() => {
|
|
18
18
|
"use strict";
|
|
19
|
-
// The require scope
|
|
20
|
-
var __webpack_require__ = {};
|
|
21
|
-
|
|
22
|
-
// webpack/runtime/define_property_getters
|
|
23
|
-
(() => {
|
|
24
|
-
__webpack_require__.d = (exports, definition) => {
|
|
25
|
-
for(var key in definition) {
|
|
26
|
-
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
27
|
-
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
})();
|
|
32
|
-
// webpack/runtime/has_own_property
|
|
33
|
-
(() => {
|
|
34
|
-
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
35
|
-
})();
|
|
36
|
-
// webpack/runtime/make_namespace_object
|
|
37
|
-
(() => {
|
|
38
|
-
// define __esModule on exports
|
|
39
|
-
__webpack_require__.r = (exports) => {
|
|
40
|
-
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
-
}
|
|
43
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
-
};
|
|
45
|
-
})();
|
|
46
19
|
var __webpack_exports__ = {};
|
|
47
|
-
// ESM COMPAT FLAG
|
|
48
|
-
__webpack_require__.r(__webpack_exports__);
|
|
49
|
-
|
|
50
|
-
// EXPORTS
|
|
51
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
52
|
-
MyElement: () => (/* reexport */ MyElement)
|
|
53
|
-
});
|
|
54
20
|
|
|
55
21
|
;// CONCATENATED MODULE: ./src/index.css
|
|
56
22
|
// extracted by css-extract-rspack-plugin
|
|
@@ -117,7 +83,7 @@ const lit_html_t=globalThis,lit_html_i=t=>t,lit_html_s=lit_html_t.trustedTypes,l
|
|
|
117
83
|
|
|
118
84
|
//# sourceMappingURL=decorators.js.map
|
|
119
85
|
|
|
120
|
-
;// CONCATENATED MODULE: ./src/
|
|
86
|
+
;// CONCATENATED MODULE: ./src/componentes/drawer/web-drawer-lateral.ts
|
|
121
87
|
function applyDecs2203RFactory() {
|
|
122
88
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
123
89
|
return function addInitializer(initializer) {
|
|
@@ -490,7 +456,8 @@ function applyDecs2203RFactory() {
|
|
|
490
456
|
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
491
457
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
492
458
|
}
|
|
493
|
-
var _dec, _dec1,
|
|
459
|
+
var _dec, _dec1, // Propriedades:
|
|
460
|
+
_init_open, _init_escClose, _initProto;
|
|
494
461
|
|
|
495
462
|
|
|
496
463
|
_dec = property_n({
|
|
@@ -498,9 +465,9 @@ _dec = property_n({
|
|
|
498
465
|
}), _dec1 = property_n({
|
|
499
466
|
type: Boolean
|
|
500
467
|
});
|
|
501
|
-
class
|
|
468
|
+
class WebDrawerLateral extends lit_element_i {
|
|
502
469
|
static{
|
|
503
|
-
({ e: [_init_open,
|
|
470
|
+
({ e: [_init_open, _init_escClose, _initProto] } = _apply_decs_2203_r(this, [
|
|
504
471
|
[
|
|
505
472
|
_dec,
|
|
506
473
|
1,
|
|
@@ -509,10 +476,15 @@ class MyElement extends lit_element_i {
|
|
|
509
476
|
[
|
|
510
477
|
_dec1,
|
|
511
478
|
1,
|
|
512
|
-
"
|
|
479
|
+
"escClose"
|
|
513
480
|
]
|
|
514
481
|
], []));
|
|
515
482
|
}
|
|
483
|
+
// Funções recursivas:
|
|
484
|
+
onOpen;
|
|
485
|
+
onClose;
|
|
486
|
+
onClear;
|
|
487
|
+
onEscClose;
|
|
516
488
|
#___private_open_1 = (_initProto(this), _init_open(this, false));
|
|
517
489
|
get open() {
|
|
518
490
|
return this.#___private_open_1;
|
|
@@ -520,12 +492,12 @@ class MyElement extends lit_element_i {
|
|
|
520
492
|
set open(_v) {
|
|
521
493
|
this.#___private_open_1 = _v;
|
|
522
494
|
}
|
|
523
|
-
#
|
|
524
|
-
get
|
|
525
|
-
return this.#
|
|
495
|
+
#___private_escClose_2 = _init_escClose(this, true);
|
|
496
|
+
get escClose() {
|
|
497
|
+
return this.#___private_escClose_2;
|
|
526
498
|
}
|
|
527
|
-
set
|
|
528
|
-
this.#
|
|
499
|
+
set escClose(_v) {
|
|
500
|
+
this.#___private_escClose_2 = _v;
|
|
529
501
|
}
|
|
530
502
|
createRenderRoot() {
|
|
531
503
|
return this;
|
|
@@ -539,80 +511,86 @@ class MyElement extends lit_element_i {
|
|
|
539
511
|
super.disconnectedCallback();
|
|
540
512
|
}
|
|
541
513
|
handleKeydown = (event)=>{
|
|
542
|
-
if (this.
|
|
543
|
-
this.
|
|
514
|
+
if (this.escClose && event.key === 'Escape' && this.open) {
|
|
515
|
+
this.setCloseModal();
|
|
544
516
|
}
|
|
545
517
|
};
|
|
546
|
-
|
|
518
|
+
getEscClose() {
|
|
519
|
+
this.onEscClose?.(this.escClose);
|
|
520
|
+
return this.escClose;
|
|
521
|
+
}
|
|
522
|
+
setOpenModal = ()=>{
|
|
547
523
|
this.open = true;
|
|
524
|
+
this.onOpen?.(this.open);
|
|
548
525
|
};
|
|
549
|
-
|
|
526
|
+
setCloseModal = ()=>{
|
|
550
527
|
this.open = false;
|
|
528
|
+
this.onClose?.(this.open);
|
|
551
529
|
};
|
|
552
|
-
|
|
553
|
-
console.log('Clear acionado');
|
|
530
|
+
setClearAndClose = ()=>{
|
|
554
531
|
this.open = false;
|
|
532
|
+
this.onClear?.(this.open);
|
|
555
533
|
};
|
|
556
534
|
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>
|
|
535
|
+
return lit_html_b`
|
|
536
|
+
<div class="min-h-screen flex flex-col items-center justify-center gap-3 bg-gradient-to-br from-gray-50 to-gray-100">
|
|
537
|
+
<h1 class="text-3xl font-semibold tracking-tight text-gray-900">
|
|
538
|
+
Rsbuild + Lit
|
|
539
|
+
</h1>
|
|
540
|
+
<p class="text-sm text-gray-500">
|
|
541
|
+
Interface minimalista, rápida e moderna.
|
|
542
|
+
</p>
|
|
543
|
+
|
|
544
|
+
<button
|
|
545
|
+
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"
|
|
546
|
+
@click=${this.setOpenModal}
|
|
547
|
+
>
|
|
548
|
+
Abrir modal lateral
|
|
549
|
+
</button>
|
|
550
|
+
</div>
|
|
551
|
+
|
|
552
|
+
<!-- Overlay -->
|
|
553
|
+
<div
|
|
554
|
+
class="fixed inset-0 z-40 bg-black/40 backdrop-blur-sm transition-opacity duration-300
|
|
555
|
+
${this.open ? 'opacity-100 pointer-events-auto' : 'opacity-0 pointer-events-none'}"
|
|
556
|
+
@click=${this.setCloseModal}
|
|
557
|
+
></div>
|
|
558
|
+
|
|
559
|
+
<!-- Drawer -->
|
|
560
|
+
<aside
|
|
561
|
+
class="fixed right-0 top-0 z-50 h-full w-full max-w-md bg-white shadow-2xl
|
|
562
|
+
transition-transform duration-300 ease-out
|
|
563
|
+
${this.open ? 'translate-x-0' : 'translate-x-full'}"
|
|
564
|
+
>
|
|
565
|
+
<div class="flex h-full flex-col p-6">
|
|
566
|
+
<div class="mb-4">
|
|
567
|
+
<h2 class="text-lg font-semibold text-gray-900">
|
|
568
|
+
Confirmação
|
|
569
|
+
</h2>
|
|
570
|
+
<p class="mt-1 text-sm text-gray-500">
|
|
571
|
+
Este é um modal lateral com UX inspirada em Vercel e Cloudflare.
|
|
572
|
+
</p>
|
|
573
|
+
</div>
|
|
574
|
+
|
|
575
|
+
<div class="flex-1"></div>
|
|
576
|
+
|
|
577
|
+
<div class="flex justify-end gap-3 border-t pt-4">
|
|
578
|
+
<button
|
|
579
|
+
class="rounded-md px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-100 transition"
|
|
580
|
+
@click=${this.setClearAndClose}
|
|
581
|
+
>
|
|
582
|
+
Cancelar
|
|
583
|
+
</button>
|
|
584
|
+
|
|
585
|
+
<button
|
|
586
|
+
class="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 transition"
|
|
587
|
+
@click=${this.setCloseModal}
|
|
588
|
+
>
|
|
589
|
+
Confirmar
|
|
590
|
+
</button>
|
|
591
|
+
</div>
|
|
592
|
+
</div>
|
|
593
|
+
</aside>
|
|
616
594
|
`;
|
|
617
595
|
}
|
|
618
596
|
}
|
|
@@ -620,11 +598,10 @@ class MyElement extends lit_element_i {
|
|
|
620
598
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
621
599
|
|
|
622
600
|
|
|
601
|
+
// DRAWER
|
|
623
602
|
|
|
624
603
|
|
|
625
|
-
if (!customElements.get('
|
|
626
|
-
customElements.define('my-element', MyElement);
|
|
627
|
-
}
|
|
604
|
+
if (!customElements.get('web-drawer-lateral')) customElements.define('web-drawer-lateral', WebDrawerLateral);
|
|
628
605
|
|
|
629
606
|
return __webpack_exports__;
|
|
630
607
|
})()
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TypesWebDrawerLateral } from './componentes/drawer/web-drawer-lateral';
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLElementTagNameMap {
|
|
4
|
-
'my-element':
|
|
4
|
+
'my-element': TypesWebDrawerLateral;
|
|
5
5
|
}
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
8
|
-
'my-element': Partial<
|
|
8
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
namespace React {
|
|
12
12
|
namespace JSX {
|
|
13
13
|
interface IntrinsicElements {
|
|
14
|
-
'my-element': Partial<
|
|
14
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
namespace Vue {
|
|
19
19
|
namespace JSX {
|
|
20
20
|
interface IntrinsicElements {
|
|
21
|
-
'my-element': Partial<
|
|
21
|
+
'my-element': Partial<TypesWebDrawerLateral>;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
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
|
-
}
|