1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6 | };
|
7 | import { adoptedStyle, customElement } from '@mantou/gem/lib/decorators';
|
8 | import { createCSSSheet, css } from '@mantou/gem/lib/utils';
|
9 | import { DuoyunModalElement } from './modal';
|
10 | const style = createCSSSheet(css `
|
11 | .dialog {
|
12 | top: 0;
|
13 | left: auto;
|
14 | right: 0;
|
15 | height: 100%;
|
16 | }
|
17 | .main {
|
18 | padding: 1.2em;
|
19 | min-width: 30em;
|
20 | min-height: none;
|
21 | max-height: none;
|
22 | border-radius: 0;
|
23 | }
|
24 | @keyframes showDialog {
|
25 | 0% {
|
26 | transform: translate(100%, 0);
|
27 | }
|
28 | 100% {
|
29 | transform: translate(0);
|
30 | }
|
31 | }
|
32 | `);
|
33 |
|
34 |
|
35 |
|
36 | let DuoyunDrawerElement = class DuoyunDrawerElement extends DuoyunModalElement {
|
37 | constructor(options) {
|
38 | super(options);
|
39 | this.addEventListener('maskclick', () => this.close(null));
|
40 | }
|
41 | };
|
42 | DuoyunDrawerElement = __decorate([
|
43 | customElement('dy-drawer'),
|
44 | adoptedStyle(style)
|
45 | ], DuoyunDrawerElement);
|
46 | export { DuoyunDrawerElement };
|
47 | export const Drawer = DuoyunDrawerElement;
|
48 |
|
\ | No newline at end of file |