@webtides/element-library 0.3.1 → 0.5.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/CHANGELOG.md +300 -0
- package/README.md +72 -56
- package/all.js +16 -0
- package/catalog.js +17 -1
- package/custom-elements.json +15912 -10065
- package/package.json +1 -1
- package/src/components/accordion/accordion.changelog.md +11 -0
- package/src/components/accordion/accordion.js +15 -3
- package/src/components/accordion/accordion.readme.md +27 -1
- package/src/components/accordion/accordion.style.js +19 -0
- package/src/components/app-bar/app-bar.changelog.md +24 -0
- package/src/components/app-bar/app-bar.define.js +3 -0
- package/src/components/app-bar/app-bar.js +91 -0
- package/src/components/app-bar/app-bar.readme.md +130 -0
- package/src/components/app-bar/app-bar.style.js +103 -0
- package/src/components/app-frame/app-frame.changelog.md +59 -0
- package/src/components/app-frame/app-frame.define.js +3 -0
- package/src/components/app-frame/app-frame.events.js +6 -0
- package/src/components/app-frame/app-frame.js +1085 -0
- package/src/components/app-frame/app-frame.readme.md +425 -0
- package/src/components/app-frame/app-frame.style.js +534 -0
- package/src/components/button/button.changelog.md +21 -0
- package/src/components/button/button.events.js +3 -0
- package/src/components/button/button.js +145 -3
- package/src/components/button/button.readme.md +72 -4
- package/src/components/button/button.style.js +167 -8
- package/src/components/button-group/button-group.changelog.md +10 -0
- package/src/components/button-group/button-group.readme.md +2 -0
- package/src/components/button-group/button-group.style.js +6 -2
- package/src/components/checkbox-group-field/checkbox-group-field.changelog.md +6 -0
- package/src/components/checkbox-group-field/checkbox-group-field.js +7 -2
- package/src/components/checkbox-group-field/checkbox-group-field.readme.md +23 -1
- package/src/components/combobox-field/combobox-field.changelog.md +6 -0
- package/src/components/combobox-field/combobox-field.readme.md +8 -0
- package/src/components/combobox-field/combobox-field.style.js +2 -0
- package/src/components/date-field/date-field.changelog.md +6 -0
- package/src/components/date-field/date-field.readme.md +10 -0
- package/src/components/date-field/date-field.style.js +8 -3
- package/src/components/description-list/description-list.changelog.md +42 -0
- package/src/components/description-list/description-list.define.js +3 -0
- package/src/components/description-list/description-list.js +49 -0
- package/src/components/description-list/description-list.readme.md +161 -0
- package/src/components/description-list/description-list.style.js +169 -0
- package/src/components/dialog/dialog.changelog.md +7 -0
- package/src/components/dialog/dialog.readme.md +5 -0
- package/src/components/dialog/dialog.style.js +17 -2
- package/src/components/divider/divider.changelog.md +6 -0
- package/src/components/divider/divider.readme.md +1 -1
- package/src/components/divider/divider.style.js +6 -0
- package/src/components/drawer/drawer.changelog.md +7 -0
- package/src/components/drawer/drawer.readme.md +7 -6
- package/src/components/drawer/drawer.style.js +35 -2
- package/src/components/dropdown/dropdown.readme.md +6 -1
- package/src/components/file-field/file-field.changelog.md +8 -0
- package/src/components/file-field/file-field.js +135 -5
- package/src/components/file-field/file-field.readme.md +35 -6
- package/src/components/file-field/file-field.style.js +71 -0
- package/src/components/form-field/form-field.js +1 -1
- package/src/components/input-field/input-field.changelog.md +10 -0
- package/src/components/input-field/input-field.js +192 -14
- package/src/components/input-field/input-field.readme.md +88 -2
- package/src/components/input-field/input-field.style.js +2 -0
- package/src/components/list/list.changelog.md +30 -0
- package/src/components/list/list.define.js +3 -0
- package/src/components/list/list.js +68 -0
- package/src/components/list/list.readme.md +123 -0
- package/src/components/list/list.style.js +56 -0
- package/src/components/list-item/list-item.changelog.md +40 -0
- package/src/components/list-item/list-item.define.js +3 -0
- package/src/components/list-item/list-item.js +130 -0
- package/src/components/list-item/list-item.readme.md +144 -0
- package/src/components/list-item/list-item.style.js +246 -0
- package/src/components/menu/menu.changelog.md +44 -0
- package/src/components/menu/menu.define.js +3 -0
- package/src/components/menu/menu.events.js +5 -0
- package/src/components/menu/menu.js +793 -0
- package/src/components/menu/menu.readme.md +313 -0
- package/src/components/menu/menu.style.js +59 -0
- package/src/components/menu-group/menu-group.changelog.md +20 -0
- package/src/components/menu-group/menu-group.define.js +3 -0
- package/src/components/menu-group/menu-group.js +44 -0
- package/src/components/menu-group/menu-group.readme.md +74 -0
- package/src/components/menu-group/menu-group.style.js +38 -0
- package/src/components/menu-item/menu-item.changelog.md +32 -0
- package/src/components/menu-item/menu-item.define.js +3 -0
- package/src/components/menu-item/menu-item.js +168 -0
- package/src/components/menu-item/menu-item.readme.md +132 -0
- package/src/components/menu-item/menu-item.style.js +117 -0
- package/src/components/nav/nav.changelog.md +35 -0
- package/src/components/nav/nav.define.js +3 -0
- package/src/components/nav/nav.js +212 -0
- package/src/components/nav/nav.readme.md +248 -0
- package/src/components/nav/nav.style.js +269 -0
- package/src/components/nav-item/nav-item.changelog.md +25 -0
- package/src/components/nav-item/nav-item.define.js +3 -0
- package/src/components/nav-item/nav-item.js +75 -0
- package/src/components/nav-item/nav-item.readme.md +111 -0
- package/src/components/nav-item/nav-item.style.js +159 -0
- package/src/components/otp-field/otp-field.changelog.md +6 -0
- package/src/components/otp-field/otp-field.readme.md +8 -0
- package/src/components/otp-field/otp-field.style.js +8 -3
- package/src/components/pagination/pagination.changelog.md +8 -0
- package/src/components/pagination/pagination.js +123 -49
- package/src/components/pagination/pagination.readme.md +24 -6
- package/src/components/pagination/pagination.style.js +11 -1
- package/src/components/password-field/password-field.changelog.md +7 -0
- package/src/components/password-field/password-field.readme.md +11 -1
- package/src/components/password-field/password-field.style.js +2 -0
- package/src/components/popover/popover.changelog.md +6 -0
- package/src/components/popover/popover.style.js +1 -0
- package/src/components/radio-field/radio-field.changelog.md +6 -0
- package/src/components/radio-field/radio-field.js +7 -2
- package/src/components/radio-field/radio-field.readme.md +23 -1
- package/src/components/scroll-to-top/scroll-to-top.changelog.md +7 -5
- package/src/components/scroll-to-top/scroll-to-top.js +16 -12
- package/src/components/scroll-to-top/scroll-to-top.readme.md +2 -0
- package/src/components/segmented-field/segmented-field.changelog.md +27 -0
- package/src/components/segmented-field/segmented-field.define.js +3 -0
- package/src/components/segmented-field/segmented-field.js +175 -0
- package/src/components/segmented-field/segmented-field.readme.md +140 -0
- package/src/components/segmented-field/segmented-field.style.js +193 -0
- package/src/components/splitter/splitter.changelog.md +24 -0
- package/src/components/splitter/splitter.define.js +3 -0
- package/src/components/splitter/splitter.events.js +4 -0
- package/src/components/splitter/splitter.js +237 -0
- package/src/components/splitter/splitter.readme.md +164 -0
- package/src/components/splitter/splitter.style.js +100 -0
- package/src/components/status-bar/status-bar.changelog.md +25 -0
- package/src/components/status-bar/status-bar.define.js +3 -0
- package/src/components/status-bar/status-bar.js +74 -0
- package/src/components/status-bar/status-bar.readme.md +139 -0
- package/src/components/status-bar/status-bar.style.js +122 -0
- package/src/components/tab-group/tab-group.changelog.md +7 -0
- package/src/components/tab-group/tab-group.js +30 -9
- package/src/components/tab-group/tab-group.readme.md +14 -0
- package/src/components/textarea-field/textarea-field.changelog.md +6 -0
- package/src/components/textarea-field/textarea-field.js +14 -1
- package/src/components/textarea-field/textarea-field.readme.md +23 -1
- package/src/components/toast/toast.changelog.md +6 -0
- package/src/components/toast/toast.readme.md +5 -3
- package/src/components/toast/toast.style.js +22 -6
- package/src/components/toolbar/toolbar.changelog.md +24 -0
- package/src/components/toolbar/toolbar.define.js +3 -0
- package/src/components/toolbar/toolbar.js +233 -0
- package/src/components/toolbar/toolbar.readme.md +156 -0
- package/src/components/toolbar/toolbar.style.js +49 -0
- package/src/components/tooltip/tooltip.changelog.md +11 -0
- package/src/components/tooltip/tooltip.js +51 -4
- package/src/components/tooltip/tooltip.readme.md +26 -1
- package/src/components/tree/tree.changelog.md +23 -0
- package/src/components/tree/tree.define.js +3 -0
- package/src/components/tree/tree.js +138 -0
- package/src/components/tree/tree.readme.md +119 -0
- package/src/components/tree/tree.style.js +16 -0
- package/src/components/tree-item/tree-item.changelog.md +23 -0
- package/src/components/tree-item/tree-item.define.js +3 -0
- package/src/components/tree-item/tree-item.events.js +3 -0
- package/src/components/tree-item/tree-item.js +246 -0
- package/src/components/tree-item/tree-item.readme.md +128 -0
- package/src/components/tree-item/tree-item.style.js +226 -0
- package/src/styles/appearance.style.js +47 -0
- package/src/styles/choice-group.style.js +27 -1
- package/src/styles/input-control.style.js +87 -0
- package/src/styles/modal.style.js +14 -1
- package/src/styles/native.css +100 -0
- package/src/styles/size.style.js +41 -0
- package/src/utils/floating.js +15 -1
- package/src/utils/focus.js +69 -0
- package/src/utils/options.js +35 -0
- package/src/utils/scroll.js +24 -0
- package/src/utils/text-entry-attributes.js +13 -0
- package/types/all.d.ts +16 -0
- package/types/src/components/accordion/accordion.d.ts +3 -1
- package/types/src/components/app-bar/app-bar.d.ts +43 -0
- package/types/src/components/app-bar/app-bar.define.d.ts +1 -0
- package/types/src/components/app-bar/app-bar.style.d.ts +2 -0
- package/types/src/components/app-frame/app-frame.d.ts +497 -0
- package/types/src/components/app-frame/app-frame.define.d.ts +1 -0
- package/types/src/components/app-frame/app-frame.events.d.ts +7 -0
- package/types/src/components/app-frame/app-frame.style.d.ts +8 -0
- package/types/src/components/button/button.d.ts +61 -0
- package/types/src/components/button/button.events.d.ts +4 -0
- package/types/src/components/checkbox-group-field/checkbox-group-field.d.ts +5 -2
- package/types/src/components/combobox-field/combobox-field.d.ts +10 -0
- package/types/src/components/date-field/date-field.d.ts +10 -0
- package/types/src/components/description-list/description-list.d.ts +34 -0
- package/types/src/components/description-list/description-list.define.d.ts +1 -0
- package/types/src/components/description-list/description-list.style.d.ts +2 -0
- package/types/src/components/file-field/file-field.d.ts +68 -3
- package/types/src/components/form-field/form-field.d.ts +1 -1
- package/types/src/components/input-field/input-field.d.ts +99 -0
- package/types/src/components/list/list.d.ts +41 -0
- package/types/src/components/list/list.define.d.ts +1 -0
- package/types/src/components/list/list.style.d.ts +2 -0
- package/types/src/components/list-item/list-item.d.ts +64 -0
- package/types/src/components/list-item/list-item.define.d.ts +1 -0
- package/types/src/components/list-item/list-item.style.d.ts +2 -0
- package/types/src/components/menu/menu.d.ts +362 -0
- package/types/src/components/menu/menu.define.d.ts +1 -0
- package/types/src/components/menu/menu.events.d.ts +6 -0
- package/types/src/components/menu/menu.style.d.ts +2 -0
- package/types/src/components/menu-group/menu-group.d.ts +24 -0
- package/types/src/components/menu-group/menu-group.define.d.ts +1 -0
- package/types/src/components/menu-group/menu-group.style.d.ts +2 -0
- package/types/src/components/menu-item/menu-item.d.ts +80 -0
- package/types/src/components/menu-item/menu-item.define.d.ts +1 -0
- package/types/src/components/menu-item/menu-item.style.d.ts +2 -0
- package/types/src/components/nav/nav.d.ts +103 -0
- package/types/src/components/nav/nav.define.d.ts +1 -0
- package/types/src/components/nav/nav.style.d.ts +2 -0
- package/types/src/components/nav-item/nav-item.d.ts +39 -0
- package/types/src/components/nav-item/nav-item.define.d.ts +1 -0
- package/types/src/components/nav-item/nav-item.style.d.ts +2 -0
- package/types/src/components/otp-field/otp-field.d.ts +10 -0
- package/types/src/components/pagination/pagination.d.ts +31 -2
- package/types/src/components/password-field/password-field.d.ts +10 -0
- package/types/src/components/radio-field/radio-field.d.ts +5 -2
- package/types/src/components/scroll-to-top/scroll-to-top.d.ts +6 -5
- package/types/src/components/segmented-field/segmented-field.d.ts +85 -0
- package/types/src/components/segmented-field/segmented-field.define.d.ts +1 -0
- package/types/src/components/segmented-field/segmented-field.style.d.ts +2 -0
- package/types/src/components/splitter/splitter.d.ts +127 -0
- package/types/src/components/splitter/splitter.define.d.ts +1 -0
- package/types/src/components/splitter/splitter.events.d.ts +5 -0
- package/types/src/components/splitter/splitter.style.d.ts +2 -0
- package/types/src/components/status-bar/status-bar.d.ts +44 -0
- package/types/src/components/status-bar/status-bar.define.d.ts +1 -0
- package/types/src/components/status-bar/status-bar.style.d.ts +2 -0
- package/types/src/components/tab-group/tab-group.d.ts +17 -0
- package/types/src/components/textarea-field/textarea-field.d.ts +7 -0
- package/types/src/components/toolbar/toolbar.d.ts +96 -0
- package/types/src/components/toolbar/toolbar.define.d.ts +1 -0
- package/types/src/components/toolbar/toolbar.style.d.ts +2 -0
- package/types/src/components/tooltip/tooltip.d.ts +26 -0
- package/types/src/components/tree/tree.d.ts +62 -0
- package/types/src/components/tree/tree.define.d.ts +1 -0
- package/types/src/components/tree/tree.style.d.ts +2 -0
- package/types/src/components/tree-item/tree-item.d.ts +106 -0
- package/types/src/components/tree-item/tree-item.define.d.ts +1 -0
- package/types/src/components/tree-item/tree-item.events.d.ts +4 -0
- package/types/src/components/tree-item/tree-item.style.d.ts +2 -0
- package/types/src/styles/appearance.style.d.ts +31 -0
- package/types/src/styles/choice-group.style.d.ts +1 -1
- package/types/src/styles/input-control.style.d.ts +15 -0
- package/types/src/styles/modal.style.d.ts +5 -0
- package/types/src/styles/size.style.d.ts +24 -0
- package/types/src/utils/floating.d.ts +11 -0
- package/types/src/utils/focus.d.ts +25 -0
- package/types/src/utils/options.d.ts +17 -0
- package/types/src/utils/scroll.d.ts +11 -0
- package/types/src/utils/text-entry-attributes.d.ts +10 -0
- package/web-types.json +2935 -308
|
@@ -5,7 +5,7 @@ const css = String.raw;
|
|
|
5
5
|
/**
|
|
6
6
|
* A group of choices in a field: a fieldset with a legend that holds the options, each of them a
|
|
7
7
|
* label around a native radio or checkbox (`el-radio-field`, `el-checkbox-group-field`,
|
|
8
|
-
* `el-rating-field`).
|
|
8
|
+
* `el-rating-field`, `el-segmented-field`).
|
|
9
9
|
*
|
|
10
10
|
* - The fieldset is the column of the field. It loses the border and the padding of the browser
|
|
11
11
|
* and stacks the legend, the help message, the options and the error message: all of them are
|
|
@@ -82,6 +82,32 @@ export default function choiceGroupStyle(host = ':host') {
|
|
|
82
82
|
opacity: 0.5;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/* What an option shows in front of its label: a colour, an icon. */
|
|
86
|
+
${field} .option-start {
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
flex: none;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: var(--el-space-1, 0.25em);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* The colour an option names, as a dot. It is the colour of a thing of the page, a tag or
|
|
94
|
+
a calendar, and what a user finds the option by: it stays where the user forces
|
|
95
|
+
colours, as the colour of a picture does. */
|
|
96
|
+
${field} .option-color {
|
|
97
|
+
inline-size: 0.75em;
|
|
98
|
+
block-size: 0.75em;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
background: var(--_el-option-color);
|
|
101
|
+
forced-color-adjust: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* An icon has the colour of the text, as the icon of a segment has. */
|
|
105
|
+
${field} .option-icon {
|
|
106
|
+
inline-size: 1.25em;
|
|
107
|
+
block-size: 1.25em;
|
|
108
|
+
fill: currentColor;
|
|
109
|
+
}
|
|
110
|
+
|
|
85
111
|
/* Touch screens: the label of an option is its hit area and at least --el-touch-target
|
|
86
112
|
in both directions. Without the token the sizes stay as they are. */
|
|
87
113
|
@media (any-pointer: coarse) {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { hostSelector } from './host.style.js';
|
|
2
|
+
|
|
3
|
+
const css = String.raw;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The control of a text field that has more in it than its input: content of the page at its
|
|
7
|
+
* start and at its end (an icon, a unit, a button), and the button that clears it. `.control` is
|
|
8
|
+
* the row with the input in its middle. A field renders it only while there is such content.
|
|
9
|
+
*
|
|
10
|
+
* This is the layout of that row, and the button. That the row is the control to the eye, with
|
|
11
|
+
* the border, the surface and the focus ring around all of it and none on the input, is the part
|
|
12
|
+
* of `styles/native.css`, as the border of an input alone is. Without that file the input keeps
|
|
13
|
+
* the look of the browser, and the content stands beside it in the row.
|
|
14
|
+
*
|
|
15
|
+
* The row follows the reading direction: the start is at the right in a right-to-left page.
|
|
16
|
+
* @param {string} [host] - `':host'` (the default), or the tag of a field without a shadow root.
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
export default function inputControlStyle(host = ':host') {
|
|
20
|
+
const field = hostSelector(host);
|
|
21
|
+
|
|
22
|
+
return css`
|
|
23
|
+
${field} .control {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--el-space-2, 8px);
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* The input takes the room that is left, and gives way to the content beside it. */
|
|
32
|
+
${field} .control input {
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
min-inline-size: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* What the page has put at the start or at the end: as wide as it is, in one line, in
|
|
38
|
+
the muted colour of the theme. A control in it has its own colours. */
|
|
39
|
+
${field} .control-content {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
flex: none;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: var(--el-space-1, 4px);
|
|
44
|
+
color: var(--el-color-fg-muted, inherit);
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
${field} .control-content[hidden],
|
|
49
|
+
${field} .control-clear[hidden] {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${field} .control-clear {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
flex: none;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
padding: 0;
|
|
59
|
+
border: none;
|
|
60
|
+
border-radius: var(--el-radius-sm, 0);
|
|
61
|
+
background: transparent;
|
|
62
|
+
color: var(--el-color-fg-muted, inherit);
|
|
63
|
+
font: inherit;
|
|
64
|
+
line-height: 0;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${field} .control-clear:focus-visible {
|
|
69
|
+
outline: var(--el-focus-ring-width, 2px) solid var(--el-color-focus-ring, currentColor);
|
|
70
|
+
outline-offset: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
${field} .control-clear svg {
|
|
74
|
+
width: 1em;
|
|
75
|
+
height: 1em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* On a touch screen the button is at least as large as a finger needs. Without the token
|
|
79
|
+
it stays as it is. */
|
|
80
|
+
@media (any-pointer: coarse) {
|
|
81
|
+
${field} .control-clear {
|
|
82
|
+
min-inline-size: var(--el-touch-target, auto);
|
|
83
|
+
min-block-size: var(--el-touch-target, auto);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
@@ -15,6 +15,11 @@ const css = String.raw;
|
|
|
15
15
|
* are different properties from the ones set here, so the order of the two stylesheets does not
|
|
16
16
|
* decide anything.
|
|
17
17
|
*
|
|
18
|
+
* A surface that reaches an edge of the screen keeps what is in it clear of the notch and the home
|
|
19
|
+
* indicator of a phone: the component says how much room each side needs
|
|
20
|
+
* (`--_el-modal-inset-block-start`, `-block-end`, `-inline-start`, `-inline-end`), and that room
|
|
21
|
+
* is the padding of the surface here.
|
|
22
|
+
*
|
|
18
23
|
* The module takes no host: a dialog with slots needs a shadow root, and the host of one is
|
|
19
24
|
* `:host`.
|
|
20
25
|
* @returns {string}
|
|
@@ -30,7 +35,15 @@ export default function modalStyle() {
|
|
|
30
35
|
* every visual token falls back to a null-ish value so an unthemed surface imposes nothing.
|
|
31
36
|
*/
|
|
32
37
|
dialog {
|
|
33
|
-
|
|
38
|
+
/* The surface keeps the room of the screen itself. What is in it and would ask the
|
|
39
|
+
screen when it is alone (an el-app-bar, an el-nav) has nothing to keep clear of. */
|
|
40
|
+
--_el-context-inset-block-start: 0px;
|
|
41
|
+
--_el-context-inset-block-end: 0px;
|
|
42
|
+
--_el-context-inset-inline-start: 0px;
|
|
43
|
+
--_el-context-inset-inline-end: 0px;
|
|
44
|
+
|
|
45
|
+
padding-block: var(--_el-modal-inset-block-start, 0px) var(--_el-modal-inset-block-end, 0px);
|
|
46
|
+
padding-inline: var(--_el-modal-inset-inline-start, 0px) var(--_el-modal-inset-inline-end, 0px);
|
|
34
47
|
background: var(--el-color-bg, transparent);
|
|
35
48
|
color: var(--el-color-fg, inherit);
|
|
36
49
|
box-shadow: var(--el-shadow-lg, none);
|
package/src/styles/native.css
CHANGED
|
@@ -133,6 +133,106 @@ el-select-field select:disabled ~ .dropdown-indicator {
|
|
|
133
133
|
cursor: not-allowed;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/*
|
|
137
|
+
* A text field with content of the page in its control: something at the start
|
|
138
|
+
* or at the end of it, or the button that clears it. The field renders a row
|
|
139
|
+
* around its input for that (.control), and the row is the control to the eye:
|
|
140
|
+
* it has the border, the surface and the focus ring, and the input inside of
|
|
141
|
+
* it has none of them. It is as high as an input of its size alone.
|
|
142
|
+
*
|
|
143
|
+
* The rules for the input in the row name the row, so they win over the rules
|
|
144
|
+
* for an input above whichever comes first.
|
|
145
|
+
*/
|
|
146
|
+
el-input-field .control,
|
|
147
|
+
el-password-field .control,
|
|
148
|
+
el-otp-field .control,
|
|
149
|
+
el-combobox-field .control,
|
|
150
|
+
el-date-field .control {
|
|
151
|
+
box-sizing: border-box;
|
|
152
|
+
width: 100%;
|
|
153
|
+
min-height: calc(var(--el-control-height) * var(--_el-size-scale, 1));
|
|
154
|
+
border: var(--el-border-width) solid var(--el-color-border);
|
|
155
|
+
border-radius: var(--el-radius-md);
|
|
156
|
+
padding-inline: var(--el-space-3);
|
|
157
|
+
background: var(--el-color-bg);
|
|
158
|
+
color: var(--el-color-fg);
|
|
159
|
+
font-family: var(--el-font-family);
|
|
160
|
+
font-size: var(--_el-size-font-size, var(--el-font-size-md));
|
|
161
|
+
line-height: var(--el-line-height);
|
|
162
|
+
transition:
|
|
163
|
+
border-color var(--el-duration-md) var(--el-ease),
|
|
164
|
+
box-shadow var(--el-duration-md) var(--el-ease);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@media (any-pointer: coarse) {
|
|
168
|
+
el-input-field .control,
|
|
169
|
+
el-password-field .control,
|
|
170
|
+
el-otp-field .control,
|
|
171
|
+
el-combobox-field .control,
|
|
172
|
+
el-date-field .control {
|
|
173
|
+
min-height: max(calc(var(--el-control-height) * var(--_el-size-scale, 1)), var(--el-touch-target, 0px));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
el-input-field .control input,
|
|
178
|
+
el-password-field .control input,
|
|
179
|
+
el-otp-field .control input,
|
|
180
|
+
el-combobox-field .control input,
|
|
181
|
+
el-date-field .control input {
|
|
182
|
+
min-height: 0;
|
|
183
|
+
border: 0;
|
|
184
|
+
border-radius: 0;
|
|
185
|
+
padding-inline: 0;
|
|
186
|
+
background: transparent;
|
|
187
|
+
font-size: inherit;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
el-input-field .control input:focus,
|
|
191
|
+
el-password-field .control input:focus,
|
|
192
|
+
el-otp-field .control input:focus,
|
|
193
|
+
el-combobox-field .control input:focus,
|
|
194
|
+
el-date-field .control input:focus {
|
|
195
|
+
box-shadow: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* The ring is for the input: a button in the row has its own. */
|
|
199
|
+
el-input-field .control:has(input:focus),
|
|
200
|
+
el-password-field .control:has(input:focus),
|
|
201
|
+
el-otp-field .control:has(input:focus),
|
|
202
|
+
el-combobox-field .control:has(input:focus),
|
|
203
|
+
el-date-field .control:has(input:focus) {
|
|
204
|
+
border-color: var(--el-color-focus-ring);
|
|
205
|
+
box-shadow:
|
|
206
|
+
0 0 0 var(--el-focus-ring-offset) var(--el-color-bg),
|
|
207
|
+
0 0 0 calc(var(--el-focus-ring-offset) + var(--el-focus-ring-width)) var(--el-color-focus-ring);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
el-input-field:state(invalid) .control,
|
|
211
|
+
el-password-field:state(invalid) .control,
|
|
212
|
+
el-otp-field:state(invalid) .control,
|
|
213
|
+
el-combobox-field:state(invalid) .control,
|
|
214
|
+
el-date-field:state(invalid) .control {
|
|
215
|
+
border-color: var(--el-color-danger);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* The row fades as a whole, and its input not a second time. */
|
|
219
|
+
el-input-field .control:has(input:disabled),
|
|
220
|
+
el-password-field .control:has(input:disabled),
|
|
221
|
+
el-otp-field .control:has(input:disabled),
|
|
222
|
+
el-combobox-field .control:has(input:disabled),
|
|
223
|
+
el-date-field .control:has(input:disabled) {
|
|
224
|
+
opacity: 0.55;
|
|
225
|
+
cursor: not-allowed;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
el-input-field .control input:disabled,
|
|
229
|
+
el-password-field .control input:disabled,
|
|
230
|
+
el-otp-field .control input:disabled,
|
|
231
|
+
el-combobox-field .control input:disabled,
|
|
232
|
+
el-date-field .control input:disabled {
|
|
233
|
+
opacity: 1;
|
|
234
|
+
}
|
|
235
|
+
|
|
136
236
|
/*
|
|
137
237
|
* The parts of a date (day, month, year) stand in a wrapper that has a padding
|
|
138
238
|
* of its own above and below. Without it the control is as high as an input
|
package/src/styles/size.style.js
CHANGED
|
@@ -46,3 +46,44 @@ export default function sizeStyle(host = ':host') {
|
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The size a container gives to the controls inside of it: a toolbar with `size="small"` has small
|
|
52
|
+
* controls. The container declares `size` as a reflected property and composes this module; it
|
|
53
|
+
* sets properties on the host that are inherited, at any depth and into shadow roots:
|
|
54
|
+
*
|
|
55
|
+
* - `--_el-context-size-height`, `--_el-context-size-padding-block`,
|
|
56
|
+
* `--_el-context-size-padding-inline`, `--_el-context-size-font-size`
|
|
57
|
+
*
|
|
58
|
+
* They are what `sizeStyle()` resolves a size to, under other names: a control declares the
|
|
59
|
+
* `--_el-size-` properties on its own host, so an inherited value of the same name would never
|
|
60
|
+
* reach it. A control that takes its size from a container reads the context first and its own
|
|
61
|
+
* size after it, on the element that it paints:
|
|
62
|
+
*
|
|
63
|
+
* min-height: var(--_el-context-size-height, var(--_el-size-height));
|
|
64
|
+
*
|
|
65
|
+
* It does so only while the page has not given it a size of its own. The stylesheet cannot ask
|
|
66
|
+
* that: element-js writes the default onto the element. So the control marks the element it paints
|
|
67
|
+
* from its template (`button--inherit-size` of `el-button`).
|
|
68
|
+
*
|
|
69
|
+
* `medium` sets nothing: it is the size a control has anyway.
|
|
70
|
+
* @param {string} [host] - `':host'` (the default), or the tag of a component without a shadow root.
|
|
71
|
+
* @returns {string}
|
|
72
|
+
*/
|
|
73
|
+
export function sizeContextStyle(host = ':host') {
|
|
74
|
+
return css`
|
|
75
|
+
${hostSelector(host, "[size='small']")} {
|
|
76
|
+
--_el-context-size-height: calc(var(--el-control-height, 2.5rem) * 0.8);
|
|
77
|
+
--_el-context-size-padding-block: var(--el-space-1, 0.25em);
|
|
78
|
+
--_el-context-size-padding-inline: var(--el-space-3, 0.75em);
|
|
79
|
+
--_el-context-size-font-size: var(--el-font-size-sm, 0.875rem);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
${hostSelector(host, "[size='large']")} {
|
|
83
|
+
--_el-context-size-height: calc(var(--el-control-height, 2.5rem) * 1.25);
|
|
84
|
+
--_el-context-size-padding-block: var(--el-space-3, 0.75em);
|
|
85
|
+
--_el-context-size-padding-inline: var(--el-space-5, 1.5em);
|
|
86
|
+
--_el-context-size-font-size: calc(var(--el-font-size-md, 1rem) * 1.125);
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
}
|
package/src/utils/floating.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';
|
|
1
|
+
import { arrow, autoUpdate, computePosition, flip, getOverflowAncestors, offset, shift } from '@floating-ui/dom';
|
|
2
2
|
|
|
3
3
|
/** How close to the edge of the viewport a floating element may come, and its arrow to one of its corners. */
|
|
4
4
|
const EDGE_PADDING = 8;
|
|
@@ -69,3 +69,17 @@ export async function placeAtAnchor(anchor, floating, { placement, distance = 0,
|
|
|
69
69
|
export function followAnchor(anchor, floating, update) {
|
|
70
70
|
return autoUpdate(anchor, floating, update);
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* What scrolls an element away: the regions around it that scroll, and the window for the page.
|
|
75
|
+
* The way up goes through slots and out of shadow roots, so the region of an `el-app-frame` is
|
|
76
|
+
* one of them for what is in its content.
|
|
77
|
+
*
|
|
78
|
+
* A `scroll` event does not bubble and does not leave a shadow root: who wants to know that an
|
|
79
|
+
* element has moved listens on each of these.
|
|
80
|
+
* @param {Element} element
|
|
81
|
+
* @returns {Array<Element | Window>}
|
|
82
|
+
*/
|
|
83
|
+
export function scrollersOf(element) {
|
|
84
|
+
return getOverflowAncestors(element).filter((scroller) => scroller instanceof Element || scroller === window);
|
|
85
|
+
}
|
package/src/utils/focus.js
CHANGED
|
@@ -16,3 +16,72 @@
|
|
|
16
16
|
export function focusLeft(group, event) {
|
|
17
17
|
return !(group.contains(event.relatedTarget) || group.matches(':active'));
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
/** What takes the focus by its tag or its attributes. Whether it does right now is asked of each one. */
|
|
21
|
+
const FOCUSABLE =
|
|
22
|
+
'a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable=""], [contenteditable="true"]';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The element that has the focus, also when it is inside of a shadow root: `document.activeElement`
|
|
26
|
+
* stops at the element whose shadow root the focus is in.
|
|
27
|
+
* @returns {Element | null}
|
|
28
|
+
*/
|
|
29
|
+
export function activeElement() {
|
|
30
|
+
let active = document.activeElement;
|
|
31
|
+
while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
32
|
+
return active;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The elements inside of `root` that the user can move the focus to, in the order of the document:
|
|
37
|
+
* the controls of the page, and the ones inside of the shadow roots of custom elements, the
|
|
38
|
+
* `<button>` of an `el-button` for example. Left out are controls that are disabled, inert, not
|
|
39
|
+
* shown or taken out of the tab order (`tabindex="-1"`).
|
|
40
|
+
*
|
|
41
|
+
* Each radio of a group is one of them, also the ones that are not checked: the Tab key stops at
|
|
42
|
+
* a group once, the arrow keys of a toolbar at every radio.
|
|
43
|
+
* @param {Element} root
|
|
44
|
+
* @returns {HTMLElement[]}
|
|
45
|
+
*/
|
|
46
|
+
export function focusableElements(root) {
|
|
47
|
+
const found = [];
|
|
48
|
+
const visit = (parent) => {
|
|
49
|
+
for (const element of parent.children) {
|
|
50
|
+
if (element.matches(FOCUSABLE) && takesFocus(element)) found.push(element);
|
|
51
|
+
// The controls of a component first, then what the page has put into it.
|
|
52
|
+
if (element.shadowRoot) visit(element.shadowRoot);
|
|
53
|
+
visit(element);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
visit(root);
|
|
57
|
+
return found;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Whether the user can move the focus to `root` or to an element inside of it, the ones in shadow
|
|
62
|
+
* roots included. It stops at the first one it finds, which `focusableElements()` does not.
|
|
63
|
+
* @param {Element} root
|
|
64
|
+
* @returns {boolean}
|
|
65
|
+
*/
|
|
66
|
+
export function containsFocusable(root) {
|
|
67
|
+
const visit = (parent) => {
|
|
68
|
+
for (const element of parent.children) {
|
|
69
|
+
if (element.matches(FOCUSABLE) && takesFocus(element)) return true;
|
|
70
|
+
if (element.shadowRoot && visit(element.shadowRoot)) return true;
|
|
71
|
+
if (visit(element)) return true;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
return (root.matches(FOCUSABLE) && takesFocus(root)) || visit(root);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param {HTMLElement} element
|
|
80
|
+
* @returns {boolean}
|
|
81
|
+
*/
|
|
82
|
+
function takesFocus(element) {
|
|
83
|
+
if (element.matches(':disabled') || element.getAttribute('tabindex') === '-1') return false;
|
|
84
|
+
if (element.closest('[inert]')) return false;
|
|
85
|
+
// Not rendered, or hidden: by itself, or by something around it.
|
|
86
|
+
return element.checkVisibility?.({ visibilityProperty: true }) ?? element.getClientRects().length > 0;
|
|
87
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { html } from '@webtides/element-js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* What an option of a group of choices shows in front of its label: a dot in the colour the option
|
|
5
|
+
* names (`color`), and an icon, the address of an SVG symbol (`icon`: `'#tag'`,
|
|
6
|
+
* `'/icons.svg#tag'`), as an option of `el-segmented-field` has it.
|
|
7
|
+
*
|
|
8
|
+
* Both are decorations. The label is the name of the option, so what is in front of it is hidden
|
|
9
|
+
* from assistive technology as a whole.
|
|
10
|
+
*
|
|
11
|
+
* Nothing for an option that has neither, a plain text among them: such an option has the markup
|
|
12
|
+
* it had.
|
|
13
|
+
* @param {string | { color?: string, icon?: string }} option
|
|
14
|
+
* @returns {import('@webtides/element-js').TemplateResult | null}
|
|
15
|
+
*/
|
|
16
|
+
export function optionStartTemplate(option) {
|
|
17
|
+
const color = option?.color;
|
|
18
|
+
const icon = option?.icon;
|
|
19
|
+
if (!color && !icon) return null;
|
|
20
|
+
|
|
21
|
+
// Each drawing is a whole <svg>: a part of one that comes from another template would be no
|
|
22
|
+
// part of the drawing.
|
|
23
|
+
return html`
|
|
24
|
+
<span class="option-start" aria-hidden="true">
|
|
25
|
+
${color ? html`<span class="option-color" style="--_el-option-color: ${color}"></span>` : null}
|
|
26
|
+
${
|
|
27
|
+
icon
|
|
28
|
+
? html`<svg class="option-icon" focusable="false">
|
|
29
|
+
<use href="${icon}"></use>
|
|
30
|
+
</svg>`
|
|
31
|
+
: null
|
|
32
|
+
}
|
|
33
|
+
</span>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The element that scrolls what an element is in, up and down: the nearest one around it that has
|
|
3
|
+
* more content than height and an overflow that scrolls. `null` where that is the document, which
|
|
4
|
+
* the window scrolls.
|
|
5
|
+
*
|
|
6
|
+
* The way up goes through slots and out of shadow roots: an element in the content of an
|
|
7
|
+
* `el-app-frame` is scrolled by a region in the shadow root of the frame.
|
|
8
|
+
* @param {Element} element
|
|
9
|
+
* @returns {HTMLElement | null}
|
|
10
|
+
*/
|
|
11
|
+
export function scrollContainer(element) {
|
|
12
|
+
let node = element.assignedSlot ?? element.parentNode ?? element.host;
|
|
13
|
+
|
|
14
|
+
while (node) {
|
|
15
|
+
if (node instanceof Element && node !== document.documentElement && node !== document.body) {
|
|
16
|
+
const { overflowY } = getComputedStyle(node);
|
|
17
|
+
const scrolls = overflowY === 'auto' || overflowY === 'scroll';
|
|
18
|
+
if (scrolls && node.scrollHeight > node.clientHeight) return node;
|
|
19
|
+
}
|
|
20
|
+
node = node.assignedSlot ?? node.parentNode ?? node.host;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
@@ -49,3 +49,16 @@ export function shadowNativeTextEntryProperties(element) {
|
|
|
49
49
|
export function textEntryAttributes(element) {
|
|
50
50
|
return Object.fromEntries(TEXT_ENTRY_ATTRIBUTES.map((name) => [name, element[name] ?? null]));
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* `maxlength` or `minlength` for the control: the number of the field, or `null` for one that is
|
|
55
|
+
* not set, which a plain binding leaves out.
|
|
56
|
+
*
|
|
57
|
+
* Empty is not set as well. element-js keeps an attribute that was on the field when it started:
|
|
58
|
+
* taken off, or with its property set to `null`, it is written back empty.
|
|
59
|
+
* @param {number | string | null | undefined} value
|
|
60
|
+
* @returns {number | string | null}
|
|
61
|
+
*/
|
|
62
|
+
export function lengthAttribute(value) {
|
|
63
|
+
return value === '' || value === undefined ? null : value;
|
|
64
|
+
}
|
package/types/all.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import './src/components/accordion/accordion.define.js';
|
|
2
2
|
import './src/components/accordion-group/accordion-group.define.js';
|
|
3
3
|
import './src/components/amount-field/amount-field.define.js';
|
|
4
|
+
import './src/components/app-bar/app-bar.define.js';
|
|
5
|
+
import './src/components/app-frame/app-frame.define.js';
|
|
4
6
|
import './src/components/avatar/avatar.define.js';
|
|
5
7
|
import './src/components/badge/badge.define.js';
|
|
6
8
|
import './src/components/breadcrumb/breadcrumb.define.js';
|
|
@@ -15,6 +17,7 @@ import './src/components/color-field/color-field.define.js';
|
|
|
15
17
|
import './src/components/combobox-field/combobox-field.define.js';
|
|
16
18
|
import './src/components/copy-button/copy-button.define.js';
|
|
17
19
|
import './src/components/date-field/date-field.define.js';
|
|
20
|
+
import './src/components/description-list/description-list.define.js';
|
|
18
21
|
import './src/components/dialog/dialog.define.js';
|
|
19
22
|
import './src/components/divider/divider.define.js';
|
|
20
23
|
import './src/components/drawer/drawer.define.js';
|
|
@@ -24,6 +27,13 @@ import './src/components/file-field/file-field.define.js';
|
|
|
24
27
|
import './src/components/form-field/form-field.define.js';
|
|
25
28
|
import './src/components/input-field/input-field.define.js';
|
|
26
29
|
import './src/components/lazy-src/lazy-src.define.js';
|
|
30
|
+
import './src/components/list/list.define.js';
|
|
31
|
+
import './src/components/list-item/list-item.define.js';
|
|
32
|
+
import './src/components/menu/menu.define.js';
|
|
33
|
+
import './src/components/menu-group/menu-group.define.js';
|
|
34
|
+
import './src/components/menu-item/menu-item.define.js';
|
|
35
|
+
import './src/components/nav/nav.define.js';
|
|
36
|
+
import './src/components/nav-item/nav-item.define.js';
|
|
27
37
|
import './src/components/notification/notification.define.js';
|
|
28
38
|
import './src/components/otp-field/otp-field.define.js';
|
|
29
39
|
import './src/components/pagination/pagination.define.js';
|
|
@@ -36,10 +46,13 @@ import './src/components/range-field/range-field.define.js';
|
|
|
36
46
|
import './src/components/rating-field/rating-field.define.js';
|
|
37
47
|
import './src/components/scroll-to/scroll-to.define.js';
|
|
38
48
|
import './src/components/scroll-to-top/scroll-to-top.define.js';
|
|
49
|
+
import './src/components/segmented-field/segmented-field.define.js';
|
|
39
50
|
import './src/components/select-field/select-field.define.js';
|
|
40
51
|
import './src/components/skeleton/skeleton.define.js';
|
|
41
52
|
import './src/components/slider/slider.define.js';
|
|
42
53
|
import './src/components/spinner/spinner.define.js';
|
|
54
|
+
import './src/components/splitter/splitter.define.js';
|
|
55
|
+
import './src/components/status-bar/status-bar.define.js';
|
|
43
56
|
import './src/components/sticky/sticky.define.js';
|
|
44
57
|
import './src/components/svg-use/svg-use.define.js';
|
|
45
58
|
import './src/components/switch-field/switch-field.define.js';
|
|
@@ -50,5 +63,8 @@ import './src/components/tag/tag.define.js';
|
|
|
50
63
|
import './src/components/tag-field/tag-field.define.js';
|
|
51
64
|
import './src/components/textarea-field/textarea-field.define.js';
|
|
52
65
|
import './src/components/toast/toast.define.js';
|
|
66
|
+
import './src/components/toolbar/toolbar.define.js';
|
|
53
67
|
import './src/components/tooltip/tooltip.define.js';
|
|
54
68
|
import './src/components/transition-classes/transition-classes.define.js';
|
|
69
|
+
import './src/components/tree/tree.define.js';
|
|
70
|
+
import './src/components/tree-item/tree-item.define.js';
|
|
@@ -22,7 +22,9 @@ import Events from './accordion.events.js';
|
|
|
22
22
|
* `el-accordion:state(open)` from outside.
|
|
23
23
|
*
|
|
24
24
|
* @property {boolean} open - Controls whether the accordion is expanded (`true`) or collapsed
|
|
25
|
-
* (`false`). Reflected to the `open` attribute.
|
|
25
|
+
* (`false`). Reflected to the `open` attribute. The stylesheet of the element reads that
|
|
26
|
+
* attribute: an accordion without `open="true"` shows its header alone, before the element
|
|
27
|
+
* starts as well.
|
|
26
28
|
*/
|
|
27
29
|
export default class Accordion extends TemplateElement {
|
|
28
30
|
open: any;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* The bar at the top of a view: which view this is, a way back or to the navigation at its start,
|
|
4
|
+
* and a few actions at its end. One row: a title that does not fit is cut with an ellipsis and
|
|
5
|
+
* never pushes the actions out.
|
|
6
|
+
*
|
|
7
|
+
* In the header of an `el-app-frame` the surface of the bar reaches up under the status bar of a
|
|
8
|
+
* phone, and its content stays below it. The bar is no landmark: the `header` of the page is.
|
|
9
|
+
*
|
|
10
|
+
* The look is the stylesheet alone, so a server-rendered bar does not change when the element
|
|
11
|
+
* takes over.
|
|
12
|
+
*
|
|
13
|
+
* @element el-app-bar
|
|
14
|
+
*
|
|
15
|
+
* @slot - The title of the view.
|
|
16
|
+
* @slot start - What is in front of the title: a button back, or the one for the navigation.
|
|
17
|
+
* @slot end - The actions of the view, at the end of the bar.
|
|
18
|
+
*
|
|
19
|
+
* @csspart base - The bar: its surface and the line to the content.
|
|
20
|
+
* @csspart row - The row of the start, the title and the end.
|
|
21
|
+
* @csspart start - The region in front of the title.
|
|
22
|
+
* @csspart title - The title. A heading while `heading-level` is set.
|
|
23
|
+
* @csspart end - The region at the end.
|
|
24
|
+
*
|
|
25
|
+
* @property {number} headingLevel - Makes the title the heading of the view, at this level
|
|
26
|
+
* (1 to 6). Unset, the title is text. Default `0`.
|
|
27
|
+
* @property {'filled'|'outlined'|'plain'} appearance - The appearance of the buttons in the bar
|
|
28
|
+
* that have none of their own. Default `'plain'`. Reflected to the `appearance` attribute.
|
|
29
|
+
*/
|
|
30
|
+
export default class AppBar extends TemplateElement {
|
|
31
|
+
constructor();
|
|
32
|
+
properties(): {
|
|
33
|
+
headingLevel: number;
|
|
34
|
+
appearance: string;
|
|
35
|
+
};
|
|
36
|
+
events(): {
|
|
37
|
+
"[part~='base']": {
|
|
38
|
+
slotchange: () => any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
template(): any;
|
|
42
|
+
}
|
|
43
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|