godown 3.4.0 → 3.5.1
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/godown+lit.iife.js +2 -2
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +2 -2
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +2 -2
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +5 -5
- package/build/godown.js +4 -4
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +5 -5
- package/build/godown.umd.js.map +1 -1
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.js +1 -1
- package/components/badge.js.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -1
- package/components/divider.js.map +1 -1
- package/components/range.d.ts +7 -6
- package/components/range.d.ts.map +1 -1
- package/components/range.js.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -13
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/core/global-style.js +1 -1
- package/core/super-input.d.ts +2 -2
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/package.json +6 -18
- package/src/components/avatar.ts +2 -1
- package/src/components/button.ts +2 -3
- package/src/components/card.ts +4 -0
- package/src/components/details.ts +1 -1
- package/src/components/dialog.ts +4 -6
- package/src/components/divider.ts +2 -1
- package/src/components/range.ts +13 -11
- package/src/components/split.ts +2 -1
- package/src/components/switch.ts +43 -60
- package/src/core/global-style.ts +2 -2
- package/src/core/super-input.ts +13 -8
- package/src/core/super-openable.ts +0 -4
- package/tsconfig.json +33 -0
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
- package/dev/alert.d.ts +0 -9
- package/dev/alert.d.ts.map +0 -1
- package/dev/alert.js +0 -5
- package/dev/alert.js.map +0 -1
- package/dev/avatar.d.ts +0 -9
- package/dev/avatar.d.ts.map +0 -1
- package/dev/avatar.js +0 -5
- package/dev/avatar.js.map +0 -1
- package/dev/badge.d.ts +0 -9
- package/dev/badge.d.ts.map +0 -1
- package/dev/badge.js +0 -5
- package/dev/badge.js.map +0 -1
- package/dev/breath.d.ts +0 -9
- package/dev/breath.d.ts.map +0 -1
- package/dev/breath.js +0 -5
- package/dev/breath.js.map +0 -1
- package/dev/button.d.ts +0 -9
- package/dev/button.d.ts.map +0 -1
- package/dev/button.js +0 -5
- package/dev/button.js.map +0 -1
- package/dev/card.d.ts +0 -9
- package/dev/card.d.ts.map +0 -1
- package/dev/card.js +0 -5
- package/dev/card.js.map +0 -1
- package/dev/carousel.d.ts +0 -9
- package/dev/carousel.d.ts.map +0 -1
- package/dev/carousel.js +0 -5
- package/dev/carousel.js.map +0 -1
- package/dev/components/alert.d.ts +0 -55
- package/dev/components/alert.d.ts.map +0 -1
- package/dev/components/alert.js +0 -236
- package/dev/components/alert.js.map +0 -1
- package/dev/components/avatar.d.ts +0 -33
- package/dev/components/avatar.d.ts.map +0 -1
- package/dev/components/avatar.js +0 -118
- package/dev/components/avatar.js.map +0 -1
- package/dev/components/badge.d.ts +0 -31
- package/dev/components/badge.d.ts.map +0 -1
- package/dev/components/badge.js +0 -122
- package/dev/components/badge.js.map +0 -1
- package/dev/components/breath.d.ts +0 -36
- package/dev/components/breath.d.ts.map +0 -1
- package/dev/components/breath.js +0 -135
- package/dev/components/breath.js.map +0 -1
- package/dev/components/button.d.ts +0 -60
- package/dev/components/button.d.ts.map +0 -1
- package/dev/components/button.js +0 -288
- package/dev/components/button.js.map +0 -1
- package/dev/components/card.d.ts +0 -27
- package/dev/components/card.d.ts.map +0 -1
- package/dev/components/card.js +0 -83
- package/dev/components/card.js.map +0 -1
- package/dev/components/carousel.d.ts +0 -39
- package/dev/components/carousel.d.ts.map +0 -1
- package/dev/components/carousel.js +0 -184
- package/dev/components/carousel.js.map +0 -1
- package/dev/components/details.d.ts +0 -24
- package/dev/components/details.d.ts.map +0 -1
- package/dev/components/details.js +0 -124
- package/dev/components/details.js.map +0 -1
- package/dev/components/dialog.d.ts +0 -43
- package/dev/components/dialog.d.ts.map +0 -1
- package/dev/components/dialog.js +0 -154
- package/dev/components/dialog.js.map +0 -1
- package/dev/components/divider.d.ts +0 -17
- package/dev/components/divider.d.ts.map +0 -1
- package/dev/components/divider.js +0 -63
- package/dev/components/divider.js.map +0 -1
- package/dev/components/dragbox.d.ts +0 -42
- package/dev/components/dragbox.d.ts.map +0 -1
- package/dev/components/dragbox.js +0 -126
- package/dev/components/dragbox.js.map +0 -1
- package/dev/components/flex.d.ts +0 -34
- package/dev/components/flex.d.ts.map +0 -1
- package/dev/components/flex.js +0 -73
- package/dev/components/flex.js.map +0 -1
- package/dev/components/form.d.ts +0 -24
- package/dev/components/form.d.ts.map +0 -1
- package/dev/components/form.js +0 -76
- package/dev/components/form.js.map +0 -1
- package/dev/components/grid.d.ts +0 -38
- package/dev/components/grid.d.ts.map +0 -1
- package/dev/components/grid.js +0 -67
- package/dev/components/grid.js.map +0 -1
- package/dev/components/heading.d.ts +0 -31
- package/dev/components/heading.d.ts.map +0 -1
- package/dev/components/heading.js +0 -127
- package/dev/components/heading.js.map +0 -1
- package/dev/components/input.d.ts +0 -23
- package/dev/components/input.d.ts.map +0 -1
- package/dev/components/input.js +0 -99
- package/dev/components/input.js.map +0 -1
- package/dev/components/layout.d.ts +0 -28
- package/dev/components/layout.d.ts.map +0 -1
- package/dev/components/layout.js +0 -96
- package/dev/components/layout.js.map +0 -1
- package/dev/components/link.d.ts +0 -54
- package/dev/components/link.d.ts.map +0 -1
- package/dev/components/link.js +0 -110
- package/dev/components/link.js.map +0 -1
- package/dev/components/progress.d.ts +0 -16
- package/dev/components/progress.d.ts.map +0 -1
- package/dev/components/progress.js +0 -101
- package/dev/components/progress.js.map +0 -1
- package/dev/components/range.d.ts +0 -121
- package/dev/components/range.d.ts.map +0 -1
- package/dev/components/range.js +0 -391
- package/dev/components/range.js.map +0 -1
- package/dev/components/rotate.d.ts +0 -30
- package/dev/components/rotate.d.ts.map +0 -1
- package/dev/components/rotate.js +0 -93
- package/dev/components/rotate.js.map +0 -1
- package/dev/components/router.d.ts +0 -116
- package/dev/components/router.d.ts.map +0 -1
- package/dev/components/router.js +0 -240
- package/dev/components/router.js.map +0 -1
- package/dev/components/select.d.ts +0 -53
- package/dev/components/select.d.ts.map +0 -1
- package/dev/components/select.js +0 -269
- package/dev/components/select.js.map +0 -1
- package/dev/components/skeleton.d.ts +0 -28
- package/dev/components/skeleton.d.ts.map +0 -1
- package/dev/components/skeleton.js +0 -122
- package/dev/components/skeleton.js.map +0 -1
- package/dev/components/split.d.ts +0 -56
- package/dev/components/split.d.ts.map +0 -1
- package/dev/components/split.js +0 -219
- package/dev/components/split.js.map +0 -1
- package/dev/components/switch.d.ts +0 -40
- package/dev/components/switch.d.ts.map +0 -1
- package/dev/components/switch.js +0 -166
- package/dev/components/switch.js.map +0 -1
- package/dev/components/text.d.ts +0 -21
- package/dev/components/text.d.ts.map +0 -1
- package/dev/components/text.js +0 -96
- package/dev/components/text.js.map +0 -1
- package/dev/components/time.d.ts +0 -36
- package/dev/components/time.d.ts.map +0 -1
- package/dev/components/time.js +0 -75
- package/dev/components/time.js.map +0 -1
- package/dev/components/tooltip.d.ts +0 -51
- package/dev/components/tooltip.d.ts.map +0 -1
- package/dev/components/tooltip.js +0 -140
- package/dev/components/tooltip.js.map +0 -1
- package/dev/components/typewriter.d.ts +0 -49
- package/dev/components/typewriter.d.ts.map +0 -1
- package/dev/components/typewriter.js +0 -149
- package/dev/components/typewriter.js.map +0 -1
- package/dev/core/direction.d.ts +0 -27
- package/dev/core/direction.d.ts.map +0 -1
- package/dev/core/direction.js +0 -56
- package/dev/core/direction.js.map +0 -1
- package/dev/core/global-style.d.ts +0 -20
- package/dev/core/global-style.d.ts.map +0 -1
- package/dev/core/global-style.js +0 -82
- package/dev/core/global-style.js.map +0 -1
- package/dev/core/outline.d.ts +0 -20
- package/dev/core/outline.d.ts.map +0 -1
- package/dev/core/outline.js +0 -44
- package/dev/core/outline.js.map +0 -1
- package/dev/core/super-anchor.d.ts +0 -18
- package/dev/core/super-anchor.d.ts.map +0 -1
- package/dev/core/super-anchor.js +0 -60
- package/dev/core/super-anchor.js.map +0 -1
- package/dev/core/super-input.d.ts +0 -43
- package/dev/core/super-input.d.ts.map +0 -1
- package/dev/core/super-input.js +0 -197
- package/dev/core/super-input.js.map +0 -1
- package/dev/core/super-openable.d.ts +0 -16
- package/dev/core/super-openable.d.ts.map +0 -1
- package/dev/core/super-openable.js +0 -36
- package/dev/core/super-openable.js.map +0 -1
- package/dev/details.d.ts +0 -9
- package/dev/details.d.ts.map +0 -1
- package/dev/details.js +0 -5
- package/dev/details.js.map +0 -1
- package/dev/dialog.d.ts +0 -9
- package/dev/dialog.d.ts.map +0 -1
- package/dev/dialog.js +0 -5
- package/dev/dialog.js.map +0 -1
- package/dev/divider.d.ts +0 -9
- package/dev/divider.d.ts.map +0 -1
- package/dev/divider.js +0 -5
- package/dev/divider.js.map +0 -1
- package/dev/dragbox.d.ts +0 -9
- package/dev/dragbox.d.ts.map +0 -1
- package/dev/dragbox.js +0 -5
- package/dev/dragbox.js.map +0 -1
- package/dev/flex.d.ts +0 -9
- package/dev/flex.d.ts.map +0 -1
- package/dev/flex.js +0 -5
- package/dev/flex.js.map +0 -1
- package/dev/form.d.ts +0 -9
- package/dev/form.d.ts.map +0 -1
- package/dev/form.js +0 -5
- package/dev/form.js.map +0 -1
- package/dev/grid.d.ts +0 -9
- package/dev/grid.d.ts.map +0 -1
- package/dev/grid.js +0 -5
- package/dev/grid.js.map +0 -1
- package/dev/heading.d.ts +0 -9
- package/dev/heading.d.ts.map +0 -1
- package/dev/heading.js +0 -5
- package/dev/heading.js.map +0 -1
- package/dev/index.d.ts +0 -31
- package/dev/index.d.ts.map +0 -1
- package/dev/index.js +0 -31
- package/dev/index.js.map +0 -1
- package/dev/input.d.ts +0 -9
- package/dev/input.d.ts.map +0 -1
- package/dev/input.js +0 -5
- package/dev/input.js.map +0 -1
- package/dev/layout.d.ts +0 -9
- package/dev/layout.d.ts.map +0 -1
- package/dev/layout.js +0 -5
- package/dev/layout.js.map +0 -1
- package/dev/link.d.ts +0 -9
- package/dev/link.d.ts.map +0 -1
- package/dev/link.js +0 -5
- package/dev/link.js.map +0 -1
- package/dev/progress.d.ts +0 -9
- package/dev/progress.d.ts.map +0 -1
- package/dev/progress.js +0 -5
- package/dev/progress.js.map +0 -1
- package/dev/range.d.ts +0 -9
- package/dev/range.d.ts.map +0 -1
- package/dev/range.js +0 -5
- package/dev/range.js.map +0 -1
- package/dev/rotate.d.ts +0 -9
- package/dev/rotate.d.ts.map +0 -1
- package/dev/rotate.js +0 -5
- package/dev/rotate.js.map +0 -1
- package/dev/router.d.ts +0 -9
- package/dev/router.d.ts.map +0 -1
- package/dev/router.js +0 -5
- package/dev/router.js.map +0 -1
- package/dev/select.d.ts +0 -9
- package/dev/select.d.ts.map +0 -1
- package/dev/select.js +0 -5
- package/dev/select.js.map +0 -1
- package/dev/skeleton.d.ts +0 -9
- package/dev/skeleton.d.ts.map +0 -1
- package/dev/skeleton.js +0 -5
- package/dev/skeleton.js.map +0 -1
- package/dev/split.d.ts +0 -9
- package/dev/split.d.ts.map +0 -1
- package/dev/split.js +0 -5
- package/dev/split.js.map +0 -1
- package/dev/switch.d.ts +0 -9
- package/dev/switch.d.ts.map +0 -1
- package/dev/switch.js +0 -5
- package/dev/switch.js.map +0 -1
- package/dev/text.d.ts +0 -9
- package/dev/text.d.ts.map +0 -1
- package/dev/text.js +0 -5
- package/dev/text.js.map +0 -1
- package/dev/time.d.ts +0 -9
- package/dev/time.d.ts.map +0 -1
- package/dev/time.js +0 -5
- package/dev/time.js.map +0 -1
- package/dev/tooltip.d.ts +0 -9
- package/dev/tooltip.d.ts.map +0 -1
- package/dev/tooltip.js +0 -5
- package/dev/tooltip.js.map +0 -1
- package/dev/typewriter.d.ts +0 -9
- package/dev/typewriter.d.ts.map +0 -1
- package/dev/typewriter.js +0 -5
- package/dev/typewriter.js.map +0 -1
package/dev/components/card.d.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { GlobalStyle } from "../core/global-style.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Card} renders a card.
|
5
|
-
*
|
6
|
-
* This may be similar to {@linkcode Layout},
|
7
|
-
* but it needs to be specified to enable header and footer.
|
8
|
-
*
|
9
|
-
* @slot - The main content of the card.
|
10
|
-
* @slot header - The header of the card.
|
11
|
-
* @slot footer - The footer of the card.
|
12
|
-
* @category display
|
13
|
-
*/
|
14
|
-
declare class Card extends GlobalStyle {
|
15
|
-
/**
|
16
|
-
* Whether to display the header.
|
17
|
-
*/
|
18
|
-
footer: boolean;
|
19
|
-
/**
|
20
|
-
* Whether to display the footer.
|
21
|
-
*/
|
22
|
-
header: boolean;
|
23
|
-
protected render(): TemplateResult<1>;
|
24
|
-
}
|
25
|
-
export default Card;
|
26
|
-
export { Card };
|
27
|
-
//# sourceMappingURL=card.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,yBAAyB,CAAC;AAMlF;;;;;;;;;;GAUG;AACH,cA+BM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,MAAM,UAAS;IAEf;;OAEG;IAEH,MAAM,UAAS;IAEf,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAUtC;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dev/components/card.js
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property } from "lit/decorators.js";
|
5
|
-
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
6
|
-
const protoName = "card";
|
7
|
-
const cssScope = scopePrefix(protoName);
|
8
|
-
/**
|
9
|
-
* {@linkcode Card} renders a card.
|
10
|
-
*
|
11
|
-
* This may be similar to {@linkcode Layout},
|
12
|
-
* but it needs to be specified to enable header and footer.
|
13
|
-
*
|
14
|
-
* @slot - The main content of the card.
|
15
|
-
* @slot header - The header of the card.
|
16
|
-
* @slot footer - The footer of the card.
|
17
|
-
* @category display
|
18
|
-
*/
|
19
|
-
let Card = class Card extends GlobalStyle {
|
20
|
-
constructor() {
|
21
|
-
super(...arguments);
|
22
|
-
/**
|
23
|
-
* Whether to display the header.
|
24
|
-
*/
|
25
|
-
this.footer = false;
|
26
|
-
/**
|
27
|
-
* Whether to display the footer.
|
28
|
-
*/
|
29
|
-
this.header = false;
|
30
|
-
}
|
31
|
-
render() {
|
32
|
-
return html `
|
33
|
-
<div
|
34
|
-
part="root"
|
35
|
-
${attr(this.observedRecord)}
|
36
|
-
>
|
37
|
-
${[this.header ? htmlSlot("header") : "", htmlSlot(), this.footer ? htmlSlot("footer") : ""]}
|
38
|
-
</div>
|
39
|
-
`;
|
40
|
-
}
|
41
|
-
};
|
42
|
-
__decorate([
|
43
|
-
property({ type: Boolean })
|
44
|
-
], Card.prototype, "footer", void 0);
|
45
|
-
__decorate([
|
46
|
-
property({ type: Boolean })
|
47
|
-
], Card.prototype, "header", void 0);
|
48
|
-
Card = __decorate([
|
49
|
-
godown(protoName),
|
50
|
-
styles(css `
|
51
|
-
:host {
|
52
|
-
${cssScope}--border-width: .075em;
|
53
|
-
${cssScope}--border-color: var(${cssGlobalVars.passive});
|
54
|
-
${cssScope}--padding: .5em;
|
55
|
-
border-width: var(${cssScope}--border-width);
|
56
|
-
display: block;
|
57
|
-
flex-shrink: 0;
|
58
|
-
border-radius: 0.2em;
|
59
|
-
}
|
60
|
-
|
61
|
-
slot {
|
62
|
-
display: block;
|
63
|
-
padding: var(${cssScope}--padding);
|
64
|
-
}
|
65
|
-
|
66
|
-
:host,
|
67
|
-
slot {
|
68
|
-
border-color: var(${cssScope}--border-color);
|
69
|
-
border-style: solid;
|
70
|
-
}
|
71
|
-
|
72
|
-
[name="footer"] {
|
73
|
-
border-top-width: var(${cssScope}--border-width);
|
74
|
-
}
|
75
|
-
|
76
|
-
[name="header"] {
|
77
|
-
border-bottom-width: var(${cssScope}--border-width);
|
78
|
-
}
|
79
|
-
`)
|
80
|
-
], Card);
|
81
|
-
export default Card;
|
82
|
-
export { Card };
|
83
|
-
//# sourceMappingURL=card.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/components/card.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGlF,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;;;;GAUG;AAgCH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW;IAA9B;;QACE;;WAEG;QAEH,WAAM,GAAG,KAAK,CAAC;QAEf;;WAEG;QAEH,WAAM,GAAG,KAAK,CAAC;IAYjB,CAAC;IAVW,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;;UAEzB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;;KAE/F,CAAC;IACJ,CAAC;CACF,CAAA;AAlBC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oCACb;AAMf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oCACb;AAXX,IAAI;IA/BT,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;MAEL,QAAQ;MACR,QAAQ,uBAAuB,aAAa,CAAC,OAAO;MACpD,QAAQ;wBACU,QAAQ;;;;;;;;mBAQb,QAAQ;;;;;wBAKH,QAAQ;;;;;4BAKJ,QAAQ;;;;+BAIL,QAAQ;;CAEtC,CAAC;GACI,IAAI,CAuBT;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { GlobalStyle } from "../core/global-style.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Carousel} make the content display as a carousel.
|
5
|
-
*
|
6
|
-
* When this component is `firstUpdated`,
|
7
|
-
* clone the first and last element and make the matching element visible when switching index.
|
8
|
-
*
|
9
|
-
* @slot - Carousel items, should maintain the same size.
|
10
|
-
* @fires change - Fires when the index changes.
|
11
|
-
* @category display
|
12
|
-
*/
|
13
|
-
declare class Carousel extends GlobalStyle {
|
14
|
-
/**
|
15
|
-
* The index of the current item.
|
16
|
-
*/
|
17
|
-
index: number;
|
18
|
-
/**
|
19
|
-
* The duration of the transition.
|
20
|
-
*/
|
21
|
-
autoChange: number;
|
22
|
-
protected _moveRoot: HTMLElement;
|
23
|
-
intervalID: number;
|
24
|
-
private __cloneFirst;
|
25
|
-
private __cloneLast;
|
26
|
-
protected _offset: number;
|
27
|
-
protected render(): TemplateResult<1>;
|
28
|
-
connectedCallback(): void;
|
29
|
-
protected firstUpdated(): Promise<void>;
|
30
|
-
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
31
|
-
show(i: number, n?: boolean): void;
|
32
|
-
next(): void;
|
33
|
-
prev(): void;
|
34
|
-
protected _doTranslateX(xValue: string, noTransition?: boolean): void;
|
35
|
-
normalizeIndex(i: number): number;
|
36
|
-
}
|
37
|
-
export default Carousel;
|
38
|
-
export { Carousel };
|
39
|
-
//# sourceMappingURL=carousel.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../src/components/carousel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQtD;;;;;;;;;GASG;AACH,cA6CM,QAAS,SAAQ,WAAW;IAChC;;OAEG;IAEH,KAAK,SAAK;IAEV;;OAEG;IAEH,UAAU,SAAK;IAGf,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC;IAEjC,UAAU,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,YAAY,CAA0B;IAE9C,OAAO,CAAC,WAAW,CAA0B;IAE7C,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAE1B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAuBrC,iBAAiB,IAAI,IAAI;cAYT,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7C,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAOvF,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAoBlC,IAAI,IAAI,IAAI;IASZ,IAAI,IAAI,IAAI;IASZ,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI;IAKrE,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAQlC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -1,184 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, part, styles } from "@godown/element";
|
3
|
-
import iconChevronLeft from "@godown/f7-icon/icons/chevron-left.js";
|
4
|
-
import iconChevronRight from "@godown/f7-icon/icons/chevron-right.js";
|
5
|
-
import { css, html } from "lit";
|
6
|
-
import { property } from "lit/decorators.js";
|
7
|
-
import { GlobalStyle } from "../core/global-style.js";
|
8
|
-
const protoName = "carousel";
|
9
|
-
function getWidth(e) {
|
10
|
-
return e.getBoundingClientRect().width;
|
11
|
-
}
|
12
|
-
/**
|
13
|
-
* {@linkcode Carousel} make the content display as a carousel.
|
14
|
-
*
|
15
|
-
* When this component is `firstUpdated`,
|
16
|
-
* clone the first and last element and make the matching element visible when switching index.
|
17
|
-
*
|
18
|
-
* @slot - Carousel items, should maintain the same size.
|
19
|
-
* @fires change - Fires when the index changes.
|
20
|
-
* @category display
|
21
|
-
*/
|
22
|
-
let Carousel = class Carousel extends GlobalStyle {
|
23
|
-
constructor() {
|
24
|
-
super(...arguments);
|
25
|
-
/**
|
26
|
-
* The index of the current item.
|
27
|
-
*/
|
28
|
-
this.index = 0;
|
29
|
-
/**
|
30
|
-
* The duration of the transition.
|
31
|
-
*/
|
32
|
-
this.autoChange = 0;
|
33
|
-
}
|
34
|
-
render() {
|
35
|
-
return html `
|
36
|
-
<div
|
37
|
-
part="root"
|
38
|
-
${attr(this.observedRecord)}
|
39
|
-
>
|
40
|
-
<i
|
41
|
-
part="prev"
|
42
|
-
@click="${this.prev}"
|
43
|
-
>
|
44
|
-
${iconChevronLeft()}
|
45
|
-
</i>
|
46
|
-
<div part="move-root">${htmlSlot()}</div>
|
47
|
-
<i
|
48
|
-
part="next"
|
49
|
-
@click="${this.next}"
|
50
|
-
>
|
51
|
-
${iconChevronRight()}
|
52
|
-
</i>
|
53
|
-
</div>
|
54
|
-
`;
|
55
|
-
}
|
56
|
-
connectedCallback() {
|
57
|
-
super.connectedCallback();
|
58
|
-
if (this.children.length) {
|
59
|
-
this.__cloneFirst?.remove();
|
60
|
-
this.__cloneLast?.remove();
|
61
|
-
this.__cloneLast = this.firstElementChild.cloneNode(true);
|
62
|
-
this.__cloneFirst = this.lastElementChild.cloneNode(true);
|
63
|
-
this.appendChild(this.__cloneLast);
|
64
|
-
this.insertBefore(this.__cloneFirst, this.firstElementChild);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
async firstUpdated() {
|
68
|
-
await this.updateComplete;
|
69
|
-
this.show(this.index, true);
|
70
|
-
}
|
71
|
-
attributeChangedCallback(name, _old, value) {
|
72
|
-
super.attributeChangedCallback(name, _old, value);
|
73
|
-
if (name === "index" && this.isConnected) {
|
74
|
-
this.show(this.index);
|
75
|
-
}
|
76
|
-
}
|
77
|
-
show(i, n) {
|
78
|
-
i = this.normalizeIndex(i);
|
79
|
-
this.index = i;
|
80
|
-
this._offset = 0;
|
81
|
-
for (let childIndex = 0; childIndex <= i; childIndex++) {
|
82
|
-
this._offset -= getWidth(this.children[childIndex]);
|
83
|
-
}
|
84
|
-
this._offset += (getWidth(this) - getWidth(this.children[i + 1])) / 2;
|
85
|
-
this.dispatchEvent(new CustomEvent("change", { detail: i, composed: true }));
|
86
|
-
this._doTranslateX(`${this._offset}px`, n);
|
87
|
-
this.timeouts.remove(this.intervalID);
|
88
|
-
if (this.autoChange > 0) {
|
89
|
-
this.intervalID = this.timeouts.add(setInterval(() => {
|
90
|
-
this.next();
|
91
|
-
}, this.autoChange));
|
92
|
-
}
|
93
|
-
}
|
94
|
-
next() {
|
95
|
-
if (this.index === this.childElementCount - 3) {
|
96
|
-
this._doTranslateX("0", true);
|
97
|
-
this.show(0);
|
98
|
-
}
|
99
|
-
else {
|
100
|
-
this.show(this.index + 1);
|
101
|
-
}
|
102
|
-
}
|
103
|
-
prev() {
|
104
|
-
if (this.index === 0) {
|
105
|
-
this._doTranslateX(`-${this.childElementCount - 1}00%`, true);
|
106
|
-
this.show(this.children.length - 3);
|
107
|
-
}
|
108
|
-
else {
|
109
|
-
this.show(this.index - 1);
|
110
|
-
}
|
111
|
-
}
|
112
|
-
_doTranslateX(xValue, noTransition) {
|
113
|
-
this._moveRoot.style.transform = `translateX(${xValue})`;
|
114
|
-
this._moveRoot.style.transition = noTransition ? "none" : "";
|
115
|
-
}
|
116
|
-
normalizeIndex(i) {
|
117
|
-
if (i < 0) {
|
118
|
-
return 0;
|
119
|
-
}
|
120
|
-
else if (i > this.children.length - 3) {
|
121
|
-
return this.children.length - 3;
|
122
|
-
}
|
123
|
-
return i;
|
124
|
-
}
|
125
|
-
};
|
126
|
-
__decorate([
|
127
|
-
property({ type: Number })
|
128
|
-
], Carousel.prototype, "index", void 0);
|
129
|
-
__decorate([
|
130
|
-
property({ type: Number })
|
131
|
-
], Carousel.prototype, "autoChange", void 0);
|
132
|
-
__decorate([
|
133
|
-
part("move-root")
|
134
|
-
], Carousel.prototype, "_moveRoot", void 0);
|
135
|
-
Carousel = __decorate([
|
136
|
-
godown(protoName),
|
137
|
-
styles(css `
|
138
|
-
:host {
|
139
|
-
display: block;
|
140
|
-
transition: 0.3s;
|
141
|
-
}
|
142
|
-
|
143
|
-
[part="root"] {
|
144
|
-
direction: ltr;
|
145
|
-
overflow: hidden;
|
146
|
-
}
|
147
|
-
|
148
|
-
[part="root"],
|
149
|
-
[part="move-root"] {
|
150
|
-
height: 100%;
|
151
|
-
width: 100%;
|
152
|
-
display: flex;
|
153
|
-
position: relative;
|
154
|
-
transition: inherit;
|
155
|
-
}
|
156
|
-
|
157
|
-
[part="prev"],
|
158
|
-
[part="next"] {
|
159
|
-
height: 100%;
|
160
|
-
width: 1.5em;
|
161
|
-
z-index: 1;
|
162
|
-
position: absolute;
|
163
|
-
display: flex;
|
164
|
-
align-items: center;
|
165
|
-
justify-content: center;
|
166
|
-
user-select: none;
|
167
|
-
}
|
168
|
-
|
169
|
-
[part="prev"] {
|
170
|
-
left: 0;
|
171
|
-
}
|
172
|
-
|
173
|
-
[part="next"] {
|
174
|
-
right: 0;
|
175
|
-
}
|
176
|
-
|
177
|
-
slot::slotted(*) {
|
178
|
-
flex-shrink: 0 !important;
|
179
|
-
}
|
180
|
-
`)
|
181
|
-
], Carousel);
|
182
|
-
export default Carousel;
|
183
|
-
export { Carousel };
|
184
|
-
//# sourceMappingURL=carousel.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../src/components/carousel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B,SAAS,QAAQ,CAAC,CAAC;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,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAA;AArHC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACjB;AAMV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACZ;AAGL;IADT,IAAI,CAAC,WAAW,CAAC;2CACe;AAd7B,QAAQ;IA7Cb,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CV,CAAC;GACI,QAAQ,CA0Hb;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { SuperOpenable } from "../core/super-openable.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Details} similar to `<details>`.
|
5
|
-
*
|
6
|
-
* @slot summary - Details summary if no `summary` is provided.
|
7
|
-
* @slot - Details content.
|
8
|
-
* @fires change - Fires when the open changes.
|
9
|
-
* @category display
|
10
|
-
*/
|
11
|
-
declare class Details extends SuperOpenable {
|
12
|
-
/**
|
13
|
-
* Determines whether the details component should fill the available space.
|
14
|
-
*/
|
15
|
-
fill: boolean;
|
16
|
-
/**
|
17
|
-
* The summary text to display in the details component.
|
18
|
-
*/
|
19
|
-
summary: string;
|
20
|
-
protected render(): TemplateResult<1>;
|
21
|
-
}
|
22
|
-
export default Details;
|
23
|
-
export { Details };
|
24
|
-
//# sourceMappingURL=details.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../src/components/details.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM1D;;;;;;;GAOG;AACH,cA2DM,OAAQ,SAAQ,aAAa;IACjC;;OAEG;IAEH,IAAI,UAAS;IAEb;;OAEG;IAEH,OAAO,SAAM;IAEb,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAwBtC;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,124 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
3
|
-
import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
|
4
|
-
import { css, html } from "lit";
|
5
|
-
import { property } from "lit/decorators.js";
|
6
|
-
import { scopePrefix } from "../core/global-style.js";
|
7
|
-
import { SuperOpenable } from "../core/super-openable.js";
|
8
|
-
const protoName = "details";
|
9
|
-
const cssScope = scopePrefix(protoName);
|
10
|
-
/**
|
11
|
-
* {@linkcode Details} similar to `<details>`.
|
12
|
-
*
|
13
|
-
* @slot summary - Details summary if no `summary` is provided.
|
14
|
-
* @slot - Details content.
|
15
|
-
* @fires change - Fires when the open changes.
|
16
|
-
* @category display
|
17
|
-
*/
|
18
|
-
let Details = class Details extends SuperOpenable {
|
19
|
-
constructor() {
|
20
|
-
super(...arguments);
|
21
|
-
/**
|
22
|
-
* Determines whether the details component should fill the available space.
|
23
|
-
*/
|
24
|
-
this.fill = false;
|
25
|
-
/**
|
26
|
-
* The summary text to display in the details component.
|
27
|
-
*/
|
28
|
-
this.summary = "";
|
29
|
-
}
|
30
|
-
render() {
|
31
|
-
return html `
|
32
|
-
<dl
|
33
|
-
part="root"
|
34
|
-
${attr(this.observedRecord)}
|
35
|
-
>
|
36
|
-
<dt
|
37
|
-
part="title"
|
38
|
-
@click="${this._handelClick}"
|
39
|
-
>
|
40
|
-
<span part="summary">${this.summary || htmlSlot("summary")}</span>
|
41
|
-
<span>
|
42
|
-
<i part="icon">${svgCaretDown()}</i>
|
43
|
-
</span>
|
44
|
-
</dt>
|
45
|
-
<dd
|
46
|
-
part="details"
|
47
|
-
@click=${this.fill ? () => this.toggle() : null}
|
48
|
-
>
|
49
|
-
<div style="min-height: 0;">${htmlSlot()}</div>
|
50
|
-
</dd>
|
51
|
-
</dl>
|
52
|
-
`;
|
53
|
-
}
|
54
|
-
};
|
55
|
-
__decorate([
|
56
|
-
property({ type: Boolean })
|
57
|
-
], Details.prototype, "fill", void 0);
|
58
|
-
__decorate([
|
59
|
-
property()
|
60
|
-
], Details.prototype, "summary", void 0);
|
61
|
-
Details = __decorate([
|
62
|
-
godown(protoName),
|
63
|
-
styles(css `
|
64
|
-
:host {
|
65
|
-
${cssScope}--icon-deg-open: 0deg;
|
66
|
-
${cssScope}--icon-deg-close: 90deg;
|
67
|
-
${cssScope}--icon-space: 0.3em;
|
68
|
-
${cssScope}--summary-direction: row;
|
69
|
-
${cssScope}--transition: .3s;
|
70
|
-
height: fit-content;
|
71
|
-
display: block;
|
72
|
-
transition: var(${cssScope}--transition);
|
73
|
-
}
|
74
|
-
|
75
|
-
[part="root"] {
|
76
|
-
height: 100%;
|
77
|
-
position: relative;
|
78
|
-
overflow: hidden;
|
79
|
-
}
|
80
|
-
|
81
|
-
[part="title"] {
|
82
|
-
direction: ltr;
|
83
|
-
height: 100%;
|
84
|
-
display: flex;
|
85
|
-
flex-wrap: nowrap;
|
86
|
-
justify-content: space-between;
|
87
|
-
background: inherit;
|
88
|
-
align-items: center;
|
89
|
-
flex-direction: var(${cssScope}--summary-direction);
|
90
|
-
}
|
91
|
-
|
92
|
-
[part="details"] {
|
93
|
-
display: grid;
|
94
|
-
overflow: hidden;
|
95
|
-
grid-template-rows: 0fr;
|
96
|
-
transition: var(${cssScope}--transition);
|
97
|
-
transition-property: grid-template-rows;
|
98
|
-
}
|
99
|
-
|
100
|
-
:host([open]) [part="details"] {
|
101
|
-
grid-template-rows: 1fr;
|
102
|
-
}
|
103
|
-
|
104
|
-
:host([float]) [part="details"] {
|
105
|
-
top: 100%;
|
106
|
-
position: absolute;
|
107
|
-
}
|
108
|
-
|
109
|
-
[part="icon"] {
|
110
|
-
display: flex;
|
111
|
-
backface-visibility: hidden;
|
112
|
-
padding: var(${cssScope}--icon-space);
|
113
|
-
transition: var(${cssScope}--transition);
|
114
|
-
transform: rotate(var(${cssScope}--icon-deg-close));
|
115
|
-
}
|
116
|
-
|
117
|
-
:host([open]) [part="icon"] {
|
118
|
-
transform: rotate(var(${cssScope}--icon-deg-open));
|
119
|
-
}
|
120
|
-
`)
|
121
|
-
], Details);
|
122
|
-
export default Details;
|
123
|
-
export { Details };
|
124
|
-
//# sourceMappingURL=details.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"details.js","sourceRoot":"","sources":["../../src/components/details.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;GAOG;AA4DH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QACE;;WAEG;QAEH,SAAI,GAAG,KAAK,CAAC;QAEb;;WAEG;QAEH,YAAO,GAAG,EAAE,CAAC;IA0Bf,CAAC;IAxBW,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;;;;oBAIf,IAAI,CAAC,YAAY;;iCAEJ,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC;;6BAEvC,YAAY,EAAE;;;;;mBAKxB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI;;wCAEjB,QAAQ,EAAE;;;KAG7C,CAAC;IACJ,CAAC;CACF,CAAA;AAhCC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACf;AAMb;IADC,QAAQ,EAAE;wCACE;AAXT,OAAO;IA3DZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;MAEL,QAAQ;MACR,QAAQ;MACR,QAAQ;MACR,QAAQ;MACR,QAAQ;;;sBAGQ,QAAQ;;;;;;;;;;;;;;;;;0BAiBJ,QAAQ;;;;;;;sBAOZ,QAAQ;;;;;;;;;;;;;;;;mBAgBX,QAAQ;sBACL,QAAQ;4BACF,QAAQ;;;;4BAIR,QAAQ;;CAEnC,CAAC;GACI,OAAO,CAqCZ;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { type HandlerEvent } from "@godown/element";
|
2
|
-
import { type PropertyValues, type TemplateResult } from "lit";
|
3
|
-
import { SuperOpenable } from "../core/super-openable.js";
|
4
|
-
import { type DirectionCardinal, type DirectionCenter, type DirectionCorner } from "../core/direction.js";
|
5
|
-
/**
|
6
|
-
* {@linkcode Dialog} similar to `<dialog>`.
|
7
|
-
*
|
8
|
-
* Like dialog, it listens for submit events and closes itself when the target method is "dialog".
|
9
|
-
*
|
10
|
-
* It listens for the keydown event and also closes itself when the {@linkcode key} contained in the key is pressed.
|
11
|
-
*
|
12
|
-
* @fires change - Fires when the open changes.
|
13
|
-
* @category feedback
|
14
|
-
*/
|
15
|
-
declare class Dialog extends SuperOpenable {
|
16
|
-
/**
|
17
|
-
* The direction of the dialog container.
|
18
|
-
*/
|
19
|
-
direction: DirectionCardinal | DirectionCorner | DirectionCenter;
|
20
|
-
/**
|
21
|
-
* Indicates whether the dialog should be displayed as a modal.
|
22
|
-
*/
|
23
|
-
modal: boolean;
|
24
|
-
/**
|
25
|
-
* The keys will close the dialog when pressed.
|
26
|
-
*/
|
27
|
-
key: string;
|
28
|
-
/**
|
29
|
-
* Indicates whether the modal has been invoked.
|
30
|
-
*/
|
31
|
-
private __modalInvoke;
|
32
|
-
protected render(): TemplateResult<1>;
|
33
|
-
showModal(): void;
|
34
|
-
private __submitEvent;
|
35
|
-
private __keydownEvent;
|
36
|
-
protected updated(changedProperties: PropertyValues): void;
|
37
|
-
protected _handleKeydown(e: KeyboardEvent): void;
|
38
|
-
protected _handelSubmit(e: HandlerEvent<HTMLFormElement>): void;
|
39
|
-
close(): void;
|
40
|
-
}
|
41
|
-
export default Dialog;
|
42
|
-
export { Dialog };
|
43
|
-
//# sourceMappingURL=dialog.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAI1E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EAErB,MAAM,sBAAsB,CAAC;AAK9B;;;;;;;;;GASG;AACH,cAkDM,MAAO,SAAQ,aAAa;IAChC;;OAEG;IAEH,SAAS,EAAE,iBAAiB,GAAG,eAAe,GAAG,eAAe,CAAC;IAEjE;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,GAAG,SAAY;IAEf;;OAEG;IACH,OAAO,CAAC,aAAa,CAAS;IAE9B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAiBrC,SAAS,IAAI,IAAI;IAQjB,OAAO,CAAC,aAAa,CAAqC;IAC1D,OAAO,CAAC,cAAc,CAAqC;IAE3D,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAc1D,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAQhD,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,GAAG,IAAI;IAO/D,KAAK,IAAI,IAAI;CAOd;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|