godown 3.0.0 → 3.0.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 +12 -12
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +12 -12
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +12 -12
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +11 -11
- package/build/godown.js +11 -11
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +11 -11
- package/build/godown.umd.js.map +1 -1
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.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.d.ts.map +1 -1
- package/components/badge.js +1 -1
- package/components/badge.js.map +1 -1
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -1
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts.map +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts.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/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -1
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js.map +1 -1
- package/components/form.d.ts.map +1 -1
- package/components/form.js.map +1 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js.map +1 -1
- package/components/heading.d.ts.map +1 -1
- package/components/heading.js +1 -1
- package/components/heading.js.map +1 -1
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -1
- package/components/input.js.map +1 -1
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +1 -1
- package/components/layout.js.map +1 -1
- package/components/link.js.map +1 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -1
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +20 -25
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -1
- package/components/router.js.map +1 -1
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -1
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +1 -1
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js +1 -1
- package/components/text.js.map +1 -1
- package/components/time.d.ts.map +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -1
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -1
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -1
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-anchor.js.map +1 -1
- 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.map +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +82 -69
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +52 -36
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts.map +1 -1
- package/dev/components/badge.js +57 -50
- package/dev/components/badge.js.map +1 -1
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +20 -14
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +13 -10
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +40 -35
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +63 -43
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +72 -61
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +61 -57
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +28 -23
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +19 -17
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +16 -11
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js +4 -4
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +16 -11
- package/dev/components/grid.js.map +1 -1
- package/dev/components/heading.d.ts.map +1 -1
- package/dev/components/heading.js +62 -40
- package/dev/components/heading.js.map +1 -1
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +32 -24
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +43 -30
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.js +1 -1
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +51 -42
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +33 -30
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +12 -5
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +20 -25
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +17 -17
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +65 -57
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +65 -61
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +66 -58
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +88 -79
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +51 -45
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +13 -2
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +31 -23
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +35 -27
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +9 -9
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +27 -26
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +83 -68
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +1 -2
- package/dev/core/super-openable.js.map +1 -1
- package/package.json +5 -5
- package/src/components/alert.ts +84 -75
- package/src/components/avatar.ts +54 -40
- package/src/components/badge.ts +68 -65
- package/src/components/breath.ts +23 -19
- package/src/components/button.ts +14 -11
- package/src/components/card.ts +42 -40
- package/src/components/carousel.ts +65 -47
- package/src/components/details.ts +74 -65
- package/src/components/dialog.ts +64 -62
- package/src/components/divider.ts +33 -30
- package/src/components/dragbox.ts +22 -22
- package/src/components/flex.ts +31 -28
- package/src/components/form.ts +7 -9
- package/src/components/grid.ts +31 -28
- package/src/components/heading.ts +67 -49
- package/src/components/input.ts +37 -31
- package/src/components/layout.ts +45 -34
- package/src/components/link.ts +1 -1
- package/src/components/progress.ts +53 -46
- package/src/components/range.ts +58 -52
- package/src/components/rotate.ts +15 -10
- package/src/components/router.ts +40 -45
- package/src/components/select.ts +74 -70
- package/src/components/skeleton.ts +67 -65
- package/src/components/split.ts +73 -69
- package/src/components/switch.ts +90 -83
- package/src/components/text.ts +53 -49
- package/src/components/time.ts +14 -3
- package/src/components/tooltip.ts +32 -24
- package/src/components/typewriter.ts +37 -31
- package/src/core/global-style.ts +11 -12
- package/src/core/super-anchor.ts +29 -30
- package/src/core/super-input.ts +86 -73
- package/src/core/super-openable.ts +2 -8
- package/web-types.json +1 -1
package/src/components/card.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
-
import { css, html
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
|
-
import {
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
5
|
+
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
7
6
|
import type Layout from "../layout.js";
|
8
7
|
|
9
8
|
const protoName = "card";
|
@@ -21,44 +20,42 @@ const cssScope = scopePrefix(protoName);
|
|
21
20
|
* @category display
|
22
21
|
*/
|
23
22
|
@godown(protoName)
|
24
|
-
@styles(
|
25
|
-
|
26
|
-
:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
23
|
+
@styles(css`
|
24
|
+
:host {
|
25
|
+
${cssScope}--background: var(${cssGlobalVars.background});
|
26
|
+
${cssScope}--border-width: .0375em;
|
27
|
+
${cssScope}--border-color: transparent;
|
28
|
+
${cssScope}--border-background: var(${cssGlobalVars.passive});
|
29
|
+
${cssScope}--padding: .75em;
|
30
|
+
color: var(${cssGlobalVars.foreground});
|
31
|
+
background: var(${cssScope}--background);
|
32
|
+
border-width: var(${cssScope}--border-width);
|
33
|
+
display: block;
|
34
|
+
flex-shrink: 0;
|
35
|
+
position: relative;
|
36
|
+
overflow: hidden;
|
37
|
+
box-sizing: border-box;
|
38
|
+
}
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
slot {
|
41
|
+
display: block;
|
42
|
+
padding: var(${cssScope}--padding);
|
43
|
+
}
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
:host,
|
46
|
+
slot {
|
47
|
+
border-color: var(${cssScope}--border-background);
|
48
|
+
border-style: solid;
|
49
|
+
}
|
52
50
|
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
[name="footer"] {
|
52
|
+
border-top-width: var(${cssScope}--border-width);
|
53
|
+
}
|
56
54
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
)
|
55
|
+
[name="header"] {
|
56
|
+
border-bottom-width: var(${cssScope}--border-width);
|
57
|
+
}
|
58
|
+
`)
|
62
59
|
class Card extends GlobalStyle {
|
63
60
|
@property({ type: Boolean })
|
64
61
|
footer = false;
|
@@ -67,9 +64,14 @@ class Card extends GlobalStyle {
|
|
67
64
|
header = false;
|
68
65
|
|
69
66
|
protected render(): TemplateResult<1> {
|
70
|
-
return html
|
71
|
-
|
72
|
-
|
67
|
+
return html`
|
68
|
+
<div
|
69
|
+
part="root"
|
70
|
+
${attr(this.observedRecord)}
|
71
|
+
>
|
72
|
+
${[this.header ? htmlSlot("header") : "", htmlSlot(), this.footer ? htmlSlot("footer") : ""]}
|
73
|
+
</div>
|
74
|
+
`;
|
73
75
|
}
|
74
76
|
}
|
75
77
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { attr, godown, htmlSlot, htmlStyle, part, styles } from "@godown/element";
|
2
2
|
import iconChevronLeft from "@godown/f7-icon/icons/chevron-left.js";
|
3
3
|
import iconChevronRight from "@godown/f7-icon/icons/chevron-right.js";
|
4
|
-
import { css, html
|
4
|
+
import { type TemplateResult, css, html } from "lit";
|
5
5
|
import { property } from "lit/decorators.js";
|
6
6
|
|
7
7
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -23,52 +23,50 @@ const protoName = "carousel";
|
|
23
23
|
* @category display
|
24
24
|
*/
|
25
25
|
@godown(protoName)
|
26
|
-
@styles(
|
27
|
-
|
28
|
-
:
|
29
|
-
|
30
|
-
|
31
|
-
}
|
26
|
+
@styles(css`
|
27
|
+
:host {
|
28
|
+
display: block;
|
29
|
+
transition: 0.3s;
|
30
|
+
}
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
[part="root"] {
|
33
|
+
direction: ltr;
|
34
|
+
overflow: hidden;
|
35
|
+
}
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
37
|
+
[part="root"],
|
38
|
+
[part="move-root"] {
|
39
|
+
height: 100%;
|
40
|
+
width: 100%;
|
41
|
+
display: flex;
|
42
|
+
position: relative;
|
43
|
+
transition: inherit;
|
44
|
+
}
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
[part="prev"],
|
47
|
+
[part="next"] {
|
48
|
+
height: 100%;
|
49
|
+
width: 1.5em;
|
50
|
+
z-index: 1;
|
51
|
+
position: absolute;
|
52
|
+
display: flex;
|
53
|
+
align-items: center;
|
54
|
+
justify-content: center;
|
55
|
+
user-select: none;
|
56
|
+
}
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
[part="prev"] {
|
59
|
+
left: 0;
|
60
|
+
}
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
[part="next"] {
|
63
|
+
right: 0;
|
64
|
+
}
|
66
65
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
)
|
66
|
+
slot::slotted(*) {
|
67
|
+
flex-shrink: 0 !important;
|
68
|
+
}
|
69
|
+
`)
|
72
70
|
class Carousel extends GlobalStyle {
|
73
71
|
/**
|
74
72
|
* The index of the element is displayed for the first time.
|
@@ -98,12 +96,32 @@ class Carousel extends GlobalStyle {
|
|
98
96
|
private _cloneLast: HTMLElement | undefined;
|
99
97
|
|
100
98
|
protected render(): TemplateResult<1> {
|
101
|
-
return html
|
102
|
-
<
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
99
|
+
return html`
|
100
|
+
<div
|
101
|
+
part="root"
|
102
|
+
${attr(this.observedRecord)}
|
103
|
+
>
|
104
|
+
<i
|
105
|
+
part="prev"
|
106
|
+
@click="${this.prev}"
|
107
|
+
>
|
108
|
+
${iconChevronLeft()}
|
109
|
+
</i>
|
110
|
+
<div
|
111
|
+
part="move-root"
|
112
|
+
style="transform:${`translateX(-${this.index + 1}00%)`}"
|
113
|
+
>
|
114
|
+
${htmlSlot()}
|
115
|
+
</div>
|
116
|
+
<i
|
117
|
+
part="next"
|
118
|
+
@click="${this.next}"
|
119
|
+
>
|
120
|
+
${iconChevronRight()}
|
121
|
+
</i>
|
122
|
+
${htmlStyle(`:host,:host([contents]) [part=root]{width:${this.width};}`)}
|
123
|
+
</div>
|
124
|
+
`;
|
107
125
|
}
|
108
126
|
|
109
127
|
protected async firstUpdated(): Promise<void> {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
2
|
import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
|
3
|
-
import { css, html
|
3
|
+
import { type TemplateResult, css, html } from "lit";
|
4
4
|
import { property } from "lit/decorators.js";
|
5
5
|
|
6
6
|
import { scopePrefix } from "../core/global-style.js";
|
@@ -19,66 +19,64 @@ const cssScope = scopePrefix(protoName);
|
|
19
19
|
* @category display
|
20
20
|
*/
|
21
21
|
@godown(protoName)
|
22
|
-
@styles(
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
22
|
+
@styles(css`
|
23
|
+
:host {
|
24
|
+
${cssScope}--icon-deg-open: 0deg;
|
25
|
+
${cssScope}--icon-deg-close: 90deg;
|
26
|
+
${cssScope}--icon-space: 0.3em;
|
27
|
+
${cssScope}--summary-direction: row;
|
28
|
+
${cssScope}--transition: .3s;
|
29
|
+
height: fit-content;
|
30
|
+
display: block;
|
31
|
+
transition: var(${cssScope}--transition);
|
32
|
+
}
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
[part="root"] {
|
35
|
+
height: 100%;
|
36
|
+
position: relative;
|
37
|
+
overflow: hidden;
|
38
|
+
}
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
40
|
+
[part="title"] {
|
41
|
+
direction: ltr;
|
42
|
+
height: 100%;
|
43
|
+
display: flex;
|
44
|
+
flex-wrap: nowrap;
|
45
|
+
justify-content: space-between;
|
46
|
+
background: inherit;
|
47
|
+
align-items: center;
|
48
|
+
flex-direction: var(${cssScope}--summary-direction);
|
49
|
+
}
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
[part="details"] {
|
52
|
+
display: grid;
|
53
|
+
overflow: hidden;
|
54
|
+
grid-template-rows: 0fr;
|
55
|
+
transition: var(${cssScope}--transition);
|
56
|
+
transition-property: grid-template-rows;
|
57
|
+
}
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
:host([open]) [part="details"] {
|
60
|
+
grid-template-rows: 1fr;
|
61
|
+
}
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
:host([float]) [part="details"] {
|
64
|
+
top: 100%;
|
65
|
+
position: absolute;
|
66
|
+
}
|
68
67
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
[part="icon"] {
|
69
|
+
display: flex;
|
70
|
+
backface-visibility: hidden;
|
71
|
+
padding: var(${cssScope}--icon-space);
|
72
|
+
transition: var(${cssScope}--transition);
|
73
|
+
transform: rotate(var(${cssScope}--icon-deg-close));
|
74
|
+
}
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
)
|
76
|
+
:host([open]) [part="icon"] {
|
77
|
+
transform: rotate(var(${cssScope}--icon-deg-open));
|
78
|
+
}
|
79
|
+
`)
|
82
80
|
class Details extends SuperOpenable {
|
83
81
|
/**
|
84
82
|
* If it is true, the summary event scope will fill the element.
|
@@ -93,17 +91,28 @@ class Details extends SuperOpenable {
|
|
93
91
|
summary = "";
|
94
92
|
|
95
93
|
protected render(): TemplateResult<1> {
|
96
|
-
return html
|
97
|
-
<
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
94
|
+
return html`
|
95
|
+
<dl
|
96
|
+
part="root"
|
97
|
+
${attr(this.observedRecord)}
|
98
|
+
>
|
99
|
+
<dt
|
100
|
+
part="title"
|
101
|
+
@click="${this._handelClick}"
|
102
|
+
>
|
103
|
+
<span part="summary">${this.summary || htmlSlot("summary")}</span>
|
104
|
+
<span>
|
105
|
+
<i part="icon">${svgCaretDown()}</i>
|
106
|
+
</span>
|
107
|
+
</dt>
|
108
|
+
<dd
|
109
|
+
part="details"
|
110
|
+
@click=${this.fill ? () => this.toggle() : null}
|
111
|
+
>
|
112
|
+
<div style="min-height: 0;">${htmlSlot()}</div>
|
113
|
+
</dd>
|
114
|
+
</dl>
|
115
|
+
`;
|
107
116
|
}
|
108
117
|
}
|
109
118
|
|
package/src/components/dialog.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { attr, godown,
|
2
|
-
import {
|
1
|
+
import { type HandlerEvent, attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { type PropertyValues, type TemplateResult, css, html } from "lit";
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
@@ -19,71 +19,68 @@ const cssScope = scopePrefix(protoName);
|
|
19
19
|
* @category feedback
|
20
20
|
*/
|
21
21
|
@godown(protoName)
|
22
|
-
@styles(
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
|
36
|
-
:host([open]) {
|
37
|
-
visibility: visible;
|
38
|
-
}
|
22
|
+
@styles(css`
|
23
|
+
:host {
|
24
|
+
${cssScope}--background: none;
|
25
|
+
${cssScope}--background-modal: var(${cssGlobalVars.background});
|
26
|
+
${cssScope}--opacity-modal: 0.2;
|
27
|
+
background: var(${cssScope}--background);
|
28
|
+
pointer-events: none;
|
29
|
+
visibility: hidden;
|
30
|
+
position: fixed;
|
31
|
+
z-index: 1;
|
32
|
+
inset: 0;
|
33
|
+
}
|
39
34
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
opacity: var(${cssScope}--opacity-modal);
|
35
|
+
:host([open]) {
|
36
|
+
visibility: visible;
|
37
|
+
}
|
44
38
|
|
45
|
-
|
39
|
+
:host([open][modal]) [part="modal"] {
|
40
|
+
pointer-events: all;
|
41
|
+
visibility: visible;
|
42
|
+
opacity: var(${cssScope}--opacity-modal);
|
43
|
+
}
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
45
|
+
[part="modal"] {
|
46
|
+
visibility: hidden;
|
47
|
+
opacity: 0;
|
48
|
+
width: 100%;
|
49
|
+
height: 100%;
|
50
|
+
position: absolute;
|
51
|
+
background: var(${cssScope}--background-modal);
|
52
|
+
}
|
55
53
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
54
|
+
[part="root"] {
|
55
|
+
width: 100%;
|
56
|
+
height: 100%;
|
57
|
+
display: flex;
|
58
|
+
position: relative;
|
59
|
+
align-items: center;
|
60
|
+
justify-content: center;
|
61
|
+
}
|
64
62
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
[part="container"] {
|
64
|
+
pointer-events: all;
|
65
|
+
position: absolute;
|
66
|
+
}
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
[direction^="top"] [part="container"] {
|
69
|
+
top: 0;
|
70
|
+
}
|
73
71
|
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
[direction^="bottom"] [part="container"] {
|
73
|
+
bottom: 0;
|
74
|
+
}
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
[direction$="right"] [part="container"] {
|
77
|
+
right: 0;
|
78
|
+
}
|
81
79
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
)
|
80
|
+
[direction$="left"] [part="container"] {
|
81
|
+
left: 0;
|
82
|
+
}
|
83
|
+
`)
|
87
84
|
class Dialog extends SuperOpenable {
|
88
85
|
/**
|
89
86
|
* Direction of the opening animation.
|
@@ -106,10 +103,15 @@ class Dialog extends SuperOpenable {
|
|
106
103
|
private _modalInvoke = false;
|
107
104
|
|
108
105
|
protected render(): TemplateResult<1> {
|
109
|
-
return html
|
110
|
-
<div
|
111
|
-
|
112
|
-
|
106
|
+
return html`
|
107
|
+
<div
|
108
|
+
part="root"
|
109
|
+
${attr(this.observedRecord)}
|
110
|
+
>
|
111
|
+
<div part="modal"></div>
|
112
|
+
<div part="container">${htmlSlot()}</div>
|
113
|
+
</div>
|
114
|
+
`;
|
113
115
|
}
|
114
116
|
|
115
117
|
showModal(): void {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { attr, godown, styles } from "@godown/element";
|
2
|
-
import { css, html
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -12,34 +12,32 @@ const protoName = "divider";
|
|
12
12
|
* @category layout
|
13
13
|
*/
|
14
14
|
@godown(protoName)
|
15
|
-
@styles(
|
16
|
-
|
17
|
-
:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
`,
|
42
|
-
)
|
15
|
+
@styles(css`
|
16
|
+
:host {
|
17
|
+
width: 100%;
|
18
|
+
height: 0.05em;
|
19
|
+
margin: auto;
|
20
|
+
display: block;
|
21
|
+
background: currentColor;
|
22
|
+
}
|
23
|
+
|
24
|
+
:host([vertical]) {
|
25
|
+
width: 0.05em;
|
26
|
+
height: max(1em, 100%);
|
27
|
+
}
|
28
|
+
|
29
|
+
:host([contents]) [part="root"] {
|
30
|
+
width: 100%;
|
31
|
+
height: 0.05em;
|
32
|
+
margin: auto;
|
33
|
+
display: block;
|
34
|
+
background: currentColor;
|
35
|
+
}
|
36
|
+
|
37
|
+
[part="root"] {
|
38
|
+
display: contents;
|
39
|
+
}
|
40
|
+
`)
|
43
41
|
class Divider extends GlobalStyle {
|
44
42
|
/**
|
45
43
|
* Vertical display.
|
@@ -48,7 +46,12 @@ class Divider extends GlobalStyle {
|
|
48
46
|
vertical = false;
|
49
47
|
|
50
48
|
protected render(): TemplateResult<1> {
|
51
|
-
return html
|
49
|
+
return html`
|
50
|
+
<div
|
51
|
+
part="root"
|
52
|
+
${attr(this.observedRecord)}
|
53
|
+
></div>
|
54
|
+
`;
|
52
55
|
}
|
53
56
|
}
|
54
57
|
|