@webtides/element-library 0.3.0 → 0.4.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 +208 -0
- package/README.md +72 -56
- package/all.js +16 -0
- package/catalog.js +17 -1
- package/custom-elements.json +14731 -10193
- 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 +45 -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 +1073 -0
- package/src/components/app-frame/app-frame.readme.md +416 -0
- package/src/components/app-frame/app-frame.style.js +527 -0
- package/src/components/button/button.changelog.md +25 -0
- package/src/components/button/button.events.js +3 -0
- package/src/components/button/button.js +209 -14
- package/src/components/button/button.readme.md +82 -6
- package/src/components/button/button.style.js +161 -7
- package/src/components/checkbox-field/checkbox-field.changelog.md +6 -0
- package/src/components/checkbox-field/checkbox-field.js +7 -1
- package/src/components/description-list/description-list.changelog.md +25 -0
- package/src/components/description-list/description-list.define.js +3 -0
- package/src/components/description-list/description-list.js +44 -0
- package/src/components/description-list/description-list.readme.md +135 -0
- package/src/components/description-list/description-list.style.js +140 -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/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/list/list.changelog.md +24 -0
- package/src/components/list/list.define.js +3 -0
- package/src/components/list/list.js +66 -0
- package/src/components/list/list.readme.md +122 -0
- package/src/components/list/list.style.js +56 -0
- package/src/components/list-item/list-item.changelog.md +24 -0
- package/src/components/list-item/list-item.define.js +3 -0
- package/src/components/list-item/list-item.js +128 -0
- package/src/components/list-item/list-item.readme.md +126 -0
- package/src/components/list-item/list-item.style.js +234 -0
- package/src/components/menu/menu.changelog.md +27 -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 +570 -0
- package/src/components/menu/menu.readme.md +272 -0
- package/src/components/menu/menu.style.js +55 -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 +24 -0
- package/src/components/menu-item/menu-item.define.js +3 -0
- package/src/components/menu-item/menu-item.js +130 -0
- package/src/components/menu-item/menu-item.readme.md +94 -0
- package/src/components/menu-item/menu-item.style.js +87 -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/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/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/switch-field/switch-field.changelog.md +6 -0
- package/src/components/switch-field/switch-field.js +7 -1
- 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/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 +1 -1
- package/src/styles/modal.style.js +14 -1
- package/src/styles/size.style.js +41 -0
- package/src/utils/focus.js +69 -0
- package/src/utils/scroll.js +24 -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 +491 -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 +97 -7
- package/types/src/components/button/button.events.d.ts +4 -0
- package/types/src/components/description-list/description-list.d.ts +29 -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/list/list.d.ts +39 -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 +62 -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 +266 -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 +59 -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/pagination/pagination.d.ts +31 -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/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/modal.style.d.ts +5 -0
- package/types/src/styles/size.style.d.ts +24 -0
- package/types/src/utils/focus.d.ts +25 -0
- package/types/src/utils/scroll.d.ts +11 -0
- package/web-types.json +2530 -393
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* One entry of an `el-menu`: an action, or a link with an address. A menu item to assistive
|
|
4
|
+
* technology (`role="menuitem"`). The menu moves the focus of the keyboard to it, so it is no stop
|
|
5
|
+
* of the Tab key itself.
|
|
6
|
+
*
|
|
7
|
+
* Choosing an entry is a click on it: listen for `click` on the entry, or for `menu-select` on the
|
|
8
|
+
* menu, which names the entry and its `value`.
|
|
9
|
+
*
|
|
10
|
+
* @element el-menu-item
|
|
11
|
+
*
|
|
12
|
+
* @slot - The text of the entry.
|
|
13
|
+
* @slot icon - An icon in front of the text: a decoration, the text is the name.
|
|
14
|
+
*
|
|
15
|
+
* @csspart base - The entry: a `<button>`, or an `<a>` with `href`.
|
|
16
|
+
* @csspart icon - The place of the icon.
|
|
17
|
+
* @csspart label - The text of the entry.
|
|
18
|
+
*
|
|
19
|
+
* @property {string} href - The address the entry leads to. With one it is a link.
|
|
20
|
+
* @property {string} target - Where to open the address.
|
|
21
|
+
* @property {string} rel - `rel` attribute for the link, written when `target` is set. Default
|
|
22
|
+
* `'noreferrer noopener'`.
|
|
23
|
+
* @property {string} value - What the entry stands for, for the listener of `menu-select`:
|
|
24
|
+
* `'delete'`. Default `''`.
|
|
25
|
+
* @property {boolean} disabled - Whether the entry cannot be chosen. The keyboard still gets to
|
|
26
|
+
* it. Default `false`.
|
|
27
|
+
* @property {'neutral'|'brand'|'success'|'warning'|'danger'} variant - The variant of the entry:
|
|
28
|
+
* `danger` for something that cannot be undone. Default `'neutral'`. Reflected to the `variant`
|
|
29
|
+
* attribute.
|
|
30
|
+
*/
|
|
31
|
+
export default class MenuItem extends TemplateElement {
|
|
32
|
+
constructor();
|
|
33
|
+
properties(): {
|
|
34
|
+
href: string;
|
|
35
|
+
target: string;
|
|
36
|
+
rel: string;
|
|
37
|
+
value: string;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
variant: string;
|
|
40
|
+
};
|
|
41
|
+
events(): {
|
|
42
|
+
"[part~='base']": {
|
|
43
|
+
slotchange: () => any;
|
|
44
|
+
click: (event: any) => void;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Puts the focus on the entry: on the control inside of it.
|
|
49
|
+
* @param {FocusOptions} [options]
|
|
50
|
+
*/
|
|
51
|
+
focus(options?: FocusOptions): void;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
private _disabled;
|
|
57
|
+
template(): any;
|
|
58
|
+
}
|
|
59
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* The destinations of an application: the places the user goes to all the time. Each destination
|
|
4
|
+
* is an `el-nav-item`: a link with an icon and a short text, and the one of the current view is
|
|
5
|
+
* marked. The element is a navigation landmark, named by `label`.
|
|
6
|
+
*
|
|
7
|
+
* Three layouts. A **bar** for the lower edge of a phone, in which three to five destinations share
|
|
8
|
+
* the width in equal parts. A **rail** for the side of a wider screen: a narrow column of icons
|
|
9
|
+
* with a word under each. A **list** for a sidebar: an icon and its text in one row, as wide as
|
|
10
|
+
* its place. A rail and a list have a group at their top and one at their lower end, and scroll
|
|
11
|
+
* where they have more destinations than height.
|
|
12
|
+
*
|
|
13
|
+
* `layout="auto"`, the default, is a bar, and where an `el-app-frame` has the element in the
|
|
14
|
+
* column at its side it is what `column` names, a rail or a list: the page writes the
|
|
15
|
+
* destinations once.
|
|
16
|
+
*
|
|
17
|
+
* A second group takes the destinations that have no room among the five of a bar (the
|
|
18
|
+
* `secondary` slot, with `secondary-label` as its heading). A bar leaves it out.
|
|
19
|
+
*
|
|
20
|
+
* In a region of an `el-app-frame` the surface reaches the edge of the screen, and the
|
|
21
|
+
* destinations stay clear of the home indicator and the notch. Alone it keeps them clear itself.
|
|
22
|
+
*
|
|
23
|
+
* The look is the stylesheet alone, so server-rendered destinations do not change when the
|
|
24
|
+
* element takes over. The script adds the tooltips of destinations that show an icon alone.
|
|
25
|
+
*
|
|
26
|
+
* @element el-nav
|
|
27
|
+
*
|
|
28
|
+
* @slot - The destinations: `el-nav-item` elements.
|
|
29
|
+
* @slot secondary - A second group of destinations, below the first: the pages that have no room
|
|
30
|
+
* in a bar, which leaves them out.
|
|
31
|
+
* @slot end - The destinations at the lower end of a rail or a list: the settings, the account. A
|
|
32
|
+
* bar has no room for them, and leaves them out.
|
|
33
|
+
*
|
|
34
|
+
* @csspart base - The navigation landmark (`<nav>`): the surface and its line to the content.
|
|
35
|
+
* @csspart groups - The two groups at the top, which scroll where a rail or a list has more
|
|
36
|
+
* destinations than height.
|
|
37
|
+
* @csspart list - The list of the destinations.
|
|
38
|
+
* @csspart secondary - The second group: its heading and its list.
|
|
39
|
+
* @csspart secondary-label - The heading of the second group, which a list shows.
|
|
40
|
+
* @csspart secondary-list - The list of the destinations of the second group.
|
|
41
|
+
* @csspart end - The list of the destinations at the lower end of a rail or a list.
|
|
42
|
+
* @csspart tooltip - The tooltip of a destination that shows an icon alone: an `el-tooltip`.
|
|
43
|
+
*
|
|
44
|
+
* @cssproperty --el-nav-rail-size - The width of a rail. Default `5rem`.
|
|
45
|
+
* @cssproperty --el-nav-list-size - The width of a list where its place is as wide as what is in
|
|
46
|
+
* it. Default `16rem`.
|
|
47
|
+
*
|
|
48
|
+
* @property {string} label - The name of the navigation for assistive technology, "Main". A page
|
|
49
|
+
* with more than one navigation needs it to tell them apart.
|
|
50
|
+
* @property {'auto'|'bar'|'rail'|'list'} layout - How the destinations lie: `bar`, a row in which
|
|
51
|
+
* they share the width in equal parts; `rail`, a narrow column; `list`, rows of an icon and its
|
|
52
|
+
* text; `auto`, a bar, and in the column at the side of an `el-app-frame` what `column` names.
|
|
53
|
+
* Default `'auto'`.
|
|
54
|
+
* @property {'rail'|'list'} column - What the destinations are in the column at the side of an
|
|
55
|
+
* `el-app-frame`, with `layout="auto"`. Default `'rail'`.
|
|
56
|
+
* @property {string} secondaryLabel - The heading of the second group, and its name for assistive
|
|
57
|
+
* technology: "More". Default `''`.
|
|
58
|
+
* @property {boolean} labels - Whether the destinations show their texts. With `false` they show
|
|
59
|
+
* an icon alone: the text stays the name of the link, and shows as a tooltip. Default `true`.
|
|
60
|
+
*/
|
|
61
|
+
export default class Nav extends TemplateElement {
|
|
62
|
+
/**
|
|
63
|
+
* Whether the element has started in a browser, see `connected()`.
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
private _started;
|
|
67
|
+
constructor();
|
|
68
|
+
properties(): {
|
|
69
|
+
label: string;
|
|
70
|
+
layout: string;
|
|
71
|
+
column: string;
|
|
72
|
+
secondaryLabel: string;
|
|
73
|
+
labels: boolean;
|
|
74
|
+
};
|
|
75
|
+
connected(): void;
|
|
76
|
+
events(): {
|
|
77
|
+
"[part~='base']": {
|
|
78
|
+
slotchange: () => any;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* @private
|
|
83
|
+
* @returns {boolean}
|
|
84
|
+
*/
|
|
85
|
+
private _showsLabels;
|
|
86
|
+
/**
|
|
87
|
+
* The destinations with their texts: what is in a destination and in none of its named slots.
|
|
88
|
+
* None before the element has started, and none while the texts show: a tooltip is for an
|
|
89
|
+
* icon alone, and on a server there is no pointer to show one to.
|
|
90
|
+
* @private
|
|
91
|
+
* @returns {Array<[Element, string]>}
|
|
92
|
+
*/
|
|
93
|
+
private _named;
|
|
94
|
+
/**
|
|
95
|
+
* Where the tooltip of a destination goes: beside a rail, on the side of the content, and
|
|
96
|
+
* above a bar. The stylesheet decides what the destinations are; this reads what it decided.
|
|
97
|
+
* @private
|
|
98
|
+
* @returns {string}
|
|
99
|
+
*/
|
|
100
|
+
private _tooltipPlacement;
|
|
101
|
+
template(): any;
|
|
102
|
+
}
|
|
103
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* One destination of an `el-nav`: a link with an icon and a short text under it. The destination
|
|
4
|
+
* of the current view is marked: for assistive technology (`aria-current="page"`), and for the
|
|
5
|
+
* eye by more than its colour.
|
|
6
|
+
*
|
|
7
|
+
* A count or a dot goes into the `badge` slot, an `el-badge` as a rule. It is part of the link and
|
|
8
|
+
* comes after the text, so a screen reader reads it with the name of the destination: "Inbox 12".
|
|
9
|
+
*
|
|
10
|
+
* @element el-nav-item
|
|
11
|
+
*
|
|
12
|
+
* @slot - The short text of the destination. One line: a text that does not fit is cut.
|
|
13
|
+
* @slot icon - The icon of the destination: a decoration, the text is the name.
|
|
14
|
+
* @slot badge - A count or a dot at the corner of the icon, an `el-badge` as a rule.
|
|
15
|
+
*
|
|
16
|
+
* @csspart base - The entry of the list (`role="listitem"`).
|
|
17
|
+
* @csspart link - The link: the whole destination is its target.
|
|
18
|
+
* @csspart icon - The icon, with the shape behind it that marks the current destination.
|
|
19
|
+
* @csspart badge - The place of the badge, at the corner of the icon.
|
|
20
|
+
* @csspart label - The text of the destination.
|
|
21
|
+
*
|
|
22
|
+
* @property {string} href - The address the destination leads to.
|
|
23
|
+
* @property {string} target - Where to open the address.
|
|
24
|
+
* @property {string} rel - `rel` attribute for the link, written when `target` is set. Default
|
|
25
|
+
* `'noreferrer noopener'`.
|
|
26
|
+
* @property {boolean} current - The destination of the current view: the link gets
|
|
27
|
+
* `aria-current="page"`, a heavier text and a shape behind its icon.
|
|
28
|
+
*/
|
|
29
|
+
export default class NavItem extends TemplateElement {
|
|
30
|
+
constructor();
|
|
31
|
+
properties(): {
|
|
32
|
+
href: string;
|
|
33
|
+
target: string;
|
|
34
|
+
rel: string;
|
|
35
|
+
current: boolean;
|
|
36
|
+
};
|
|
37
|
+
template(): any;
|
|
38
|
+
}
|
|
39
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,17 +8,24 @@ import Events from './pagination.events.js';
|
|
|
8
8
|
* The pagination does not load anything. A button sets `page` and fires `pagination-change`, and
|
|
9
9
|
* the page shows the entries that belong to it.
|
|
10
10
|
*
|
|
11
|
+
* A list that a server renders a page at a time has the page in its address. With `href`, the
|
|
12
|
+
* address of a page with `{page}` in the place of its number, the pages are links: they are in
|
|
13
|
+
* the server-rendered markup, lead to their page without a script, open in a new tab and can be
|
|
14
|
+
* copied. A link fires nothing and changes nothing: the address it leads to brings the next page.
|
|
15
|
+
*
|
|
11
16
|
* @element el-pagination
|
|
12
17
|
*
|
|
13
18
|
* @fires {CustomEvent<{ page: number }>} pagination-change - Fired when a button has changed the
|
|
14
|
-
* page. `detail.page` is the new page. Not fired when `page` is set from a script
|
|
19
|
+
* page. `detail.page` is the new page. Not fired when `page` is set from a script, and not by
|
|
20
|
+
* a link.
|
|
15
21
|
*
|
|
16
22
|
* @slot previous-icon - The icon of the button for the page before. Unset, an arrow head.
|
|
17
23
|
* @slot next-icon - The icon of the button for the page after. Unset, an arrow head.
|
|
18
24
|
*
|
|
19
25
|
* @csspart base - The `nav` landmark.
|
|
20
26
|
* @csspart list - The row of the buttons.
|
|
21
|
-
* @csspart button - Every button: the pages, the page before and the page after.
|
|
27
|
+
* @csspart button - Every button: the pages, the page before and the page after. With `href`
|
|
28
|
+
* they are links, and keep their parts.
|
|
22
29
|
* @csspart page - The button of a page.
|
|
23
30
|
* @csspart current - The button of the current page.
|
|
24
31
|
* @csspart previous - The button for the page before.
|
|
@@ -27,6 +34,9 @@ import Events from './pagination.events.js';
|
|
|
27
34
|
*
|
|
28
35
|
* @property {number} page - The current page, counted from 1. A page that does not exist is shown
|
|
29
36
|
* as the nearest one that does. Default `1`. Reflected to the `page` attribute.
|
|
37
|
+
* @property {string} href - The address of a page, with `{page}` in the place of its number:
|
|
38
|
+
* `/notes?page={page}`. With it the pages, the page before and the page after are links.
|
|
39
|
+
* Default `''`: buttons.
|
|
30
40
|
* @property {number} total - The number of entries in the whole list. Default `0`.
|
|
31
41
|
* @property {number} perPage - The number of entries on one page. Default `10`.
|
|
32
42
|
* @property {number} siblings - How many pages are shown on each side of the current page.
|
|
@@ -50,6 +60,7 @@ export default class Pagination extends TemplateElement {
|
|
|
50
60
|
constructor();
|
|
51
61
|
properties(): {
|
|
52
62
|
page: number;
|
|
63
|
+
href: string;
|
|
53
64
|
total: number;
|
|
54
65
|
perPage: number;
|
|
55
66
|
siblings: number;
|
|
@@ -109,8 +120,26 @@ export default class Pagination extends TemplateElement {
|
|
|
109
120
|
* @returns {Array<number | null>}
|
|
110
121
|
*/
|
|
111
122
|
private _items;
|
|
123
|
+
/**
|
|
124
|
+
* The address of a page: `href` with the number in the place of its mark.
|
|
125
|
+
* @private
|
|
126
|
+
* @param {number} page
|
|
127
|
+
* @returns {string}
|
|
128
|
+
*/
|
|
129
|
+
private _address;
|
|
112
130
|
/** @private */
|
|
113
131
|
private _pageTemplate;
|
|
132
|
+
/**
|
|
133
|
+
* The way to the page before or after, as a link. Where there is no such page, at the first
|
|
134
|
+
* page and at the last one, it is a link without an address: no stop of the Tab key, and one
|
|
135
|
+
* that says to assistive technology that it leads nowhere now.
|
|
136
|
+
* @private
|
|
137
|
+
* @param {'previous'|'next'} name
|
|
138
|
+
* @param {number} page - The page it leads to.
|
|
139
|
+
* @param {string} label
|
|
140
|
+
* @param {*} icon - The slot of its icon.
|
|
141
|
+
*/
|
|
142
|
+
private _stepLinkTemplate;
|
|
114
143
|
template(): any;
|
|
115
144
|
}
|
|
116
145
|
export declare function define(): void;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { StyledElement } from '@webtides/element-js';
|
|
2
2
|
/**
|
|
3
|
-
* Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls the
|
|
4
|
-
*
|
|
3
|
+
* Wraps any click-emitting child (`<a>`, `<button>`, …) and smoothly scrolls to the top when the
|
|
4
|
+
* child is clicked: the window, or the element around it that scrolls, the content of an
|
|
5
|
+
* `el-app-frame` for example.
|
|
5
6
|
*
|
|
6
7
|
* @element el-scroll-to-top
|
|
7
8
|
*
|
|
8
9
|
* @slot - Default slot. Any child that emits a `click` event will trigger the scroll.
|
|
9
10
|
*
|
|
10
11
|
* @property {number} duration - Duration of the easing animation in milliseconds. Ignored
|
|
11
|
-
* when
|
|
12
|
-
* scroll in that case).
|
|
12
|
+
* when what scrolls has `scroll-behavior: smooth`, the `html` element for the window (the
|
|
13
|
+
* browser drives the scroll in that case).
|
|
13
14
|
* @property {boolean} preventDefault - When `true`, the captured click's default action is
|
|
14
15
|
* suppressed.
|
|
15
16
|
*/
|
|
@@ -26,7 +27,7 @@ export default class ScrollToTop extends StyledElement {
|
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
|
-
* Scroll the
|
|
30
|
+
* Scroll to the top: the element around this one that scrolls, or the window.
|
|
30
31
|
* @returns {void}
|
|
31
32
|
*/
|
|
32
33
|
scrollToTop(): void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import RadioField from '../radio-field/radio-field.js';
|
|
2
|
+
/**
|
|
3
|
+
* One choice of a few options, shown as a row of joined buttons: "List | Grid",
|
|
4
|
+
* "Day | Week | Month". It looks like an `el-button-group` and behaves like a group of radios,
|
|
5
|
+
* because it is one: a native `<fieldset>`/`<legend>` with an `<input type="radio">` per option
|
|
6
|
+
* (it extends `el-radio-field`). So the one tab stop, the arrow keys, the value in the form, its
|
|
7
|
+
* reset and `required` are native, and the label, the help message and the error message are the
|
|
8
|
+
* ones of every field.
|
|
9
|
+
*
|
|
10
|
+
* In a container that gives its controls a size, an `el-toolbar`, the field takes it from there,
|
|
11
|
+
* while the page has not set `size` on the field itself.
|
|
12
|
+
*
|
|
13
|
+
* @element el-segmented-field
|
|
14
|
+
*
|
|
15
|
+
* @fires {CustomEvent<string>} input-change - Fired when the chosen option changes. `detail` is
|
|
16
|
+
* its value. Bubbles.
|
|
17
|
+
*
|
|
18
|
+
* @cssstate touched - Set once the user has left the group, or the browser has refused a submit
|
|
19
|
+
* because of it. Inherits `valid` and `invalid` from `FormField`.
|
|
20
|
+
*
|
|
21
|
+
* @property {string | null} value - The value of the chosen option.
|
|
22
|
+
* @property {Array<string | { value: string, label?: string, icon?: string, disabled?: boolean }>} options -
|
|
23
|
+
* The options. Plain strings (`['Day', 'Week']`) are value and label at once; an object has a
|
|
24
|
+
* `value`, a `label`, and can be `disabled`. With `icon`, the address of an SVG symbol
|
|
25
|
+
* (`'#grid'`, `'/icons.svg#grid'`), the option shows that icon in the place of its label: the
|
|
26
|
+
* label is then its name for assistive technology and its tooltip.
|
|
27
|
+
* @property {'small'|'medium'|'large'} size - The size of the options: their height, their padding
|
|
28
|
+
* and their font size. Default `'medium'`. Reflected to the `size` attribute.
|
|
29
|
+
*/
|
|
30
|
+
export default class SegmentedField extends RadioField {
|
|
31
|
+
constructor(options: any);
|
|
32
|
+
/**
|
|
33
|
+
* Whether the page has given the field a size of its own, see `_hasOwnSize()`.
|
|
34
|
+
* @private
|
|
35
|
+
* @type {boolean | undefined}
|
|
36
|
+
*/
|
|
37
|
+
private _ownSize;
|
|
38
|
+
properties(): {
|
|
39
|
+
name: string;
|
|
40
|
+
value: any;
|
|
41
|
+
required: boolean;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
label: string;
|
|
44
|
+
labelScreenReaderOnly: boolean;
|
|
45
|
+
errorMessage: string;
|
|
46
|
+
helpMessage: string;
|
|
47
|
+
valid: boolean;
|
|
48
|
+
touched: boolean;
|
|
49
|
+
options: any[];
|
|
50
|
+
size: string;
|
|
51
|
+
};
|
|
52
|
+
static observedAttributes: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether the field is writing a property to its attribute right now, see `reflectProperty()`.
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
private _reflecting;
|
|
58
|
+
connectedCallback(): void;
|
|
59
|
+
/**
|
|
60
|
+
* The page has written the `size` attribute, after the field was connected: the size is the
|
|
61
|
+
* field's own from now on, also when it is the default. The field writes the attribute itself
|
|
62
|
+
* as well, which says nothing.
|
|
63
|
+
*/
|
|
64
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
65
|
+
reflectProperty(options: any): void;
|
|
66
|
+
watch(): {
|
|
67
|
+
value: (value: any) => void;
|
|
68
|
+
valid: () => void;
|
|
69
|
+
touched: () => void;
|
|
70
|
+
size: () => void;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Whether the page has given the field a size of its own. A field without one takes the size
|
|
74
|
+
* of a container that gives one to its controls, a toolbar. The template marks the row with
|
|
75
|
+
* the answer, and the stylesheet reads the mark. On the server no attribute has been written
|
|
76
|
+
* by the element: one that is there is the one of the page.
|
|
77
|
+
* @private
|
|
78
|
+
* @returns {boolean}
|
|
79
|
+
*/
|
|
80
|
+
private _hasOwnSize;
|
|
81
|
+
template(): any;
|
|
82
|
+
/** @private */
|
|
83
|
+
private fieldTemplate;
|
|
84
|
+
}
|
|
85
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
import Events from './splitter.events.js';
|
|
3
|
+
/**
|
|
4
|
+
* The edge between two panes that are beside each other, which the user drags to set the width of
|
|
5
|
+
* one of them: with a mouse, a finger or a pen, and with the arrow keys. To assistive technology
|
|
6
|
+
* it is a separator with a value, the width in pixels, and with the name of what it sizes.
|
|
7
|
+
*
|
|
8
|
+
* The splitter is the control and sizes nothing itself, as a range does: it has a `value` between
|
|
9
|
+
* `min` and `max`, and tells of every change. The layout around it takes the value. An
|
|
10
|
+
* `el-app-frame` renders one at the edge of its navigation and of its aside (`resizable`); a page
|
|
11
|
+
* with two panes of its own writes one between them and sets the width of the pane from the
|
|
12
|
+
* event.
|
|
13
|
+
*
|
|
14
|
+
* @element el-splitter
|
|
15
|
+
*
|
|
16
|
+
* @fires {CustomEvent<{ value: number }>} splitter-resize - Fired with every change the user
|
|
17
|
+
* makes: while the edge is dragged, and with every key. The new width is in `detail.value`.
|
|
18
|
+
* @fires {CustomEvent<{ value: number }>} splitter-resize-end - Fired once the user has set a
|
|
19
|
+
* width: when the pointer lets go of the edge, and with every key. The width to keep is in
|
|
20
|
+
* `detail.value`.
|
|
21
|
+
*
|
|
22
|
+
* @csspart base - The separator: what takes the pointer and the focus. It is wider than the line.
|
|
23
|
+
* @csspart line - The line that shows, and the mark it becomes under the pointer and with the
|
|
24
|
+
* focus.
|
|
25
|
+
*
|
|
26
|
+
* @cssproperty --el-splitter-line-width - The width of the line. Default `--el-border-width`.
|
|
27
|
+
*
|
|
28
|
+
* @cssstate dragging - Set while a pointer drags the edge.
|
|
29
|
+
*
|
|
30
|
+
* @property {number} value - The width of the pane the splitter sizes, in pixels. Default `0`.
|
|
31
|
+
* @property {number} min - The least width. Default `0`.
|
|
32
|
+
* @property {number} max - The greatest width. Default `100`.
|
|
33
|
+
* @property {number} step - How far an arrow key moves the edge, in pixels. Default `16`.
|
|
34
|
+
* @property {string} label - The name of what the splitter sizes, for assistive technology.
|
|
35
|
+
* Default `''`.
|
|
36
|
+
* @property {'start'|'end'} placement - The edge of its pane the splitter is. `end`: the pane is
|
|
37
|
+
* in front of it, and grows when the edge moves away from the start. `start`: the pane is after
|
|
38
|
+
* it. Default `'end'`.
|
|
39
|
+
*/
|
|
40
|
+
export default class Splitter extends TemplateElement {
|
|
41
|
+
value: number;
|
|
42
|
+
/**
|
|
43
|
+
* The drag that is going on: the pointer, where it took the edge, the width then, and the
|
|
44
|
+
* direction in which the width grows.
|
|
45
|
+
* @private
|
|
46
|
+
* @type {{ pointerId: number, x: number, value: number, sign: number } | undefined}
|
|
47
|
+
*/
|
|
48
|
+
private _drag;
|
|
49
|
+
constructor();
|
|
50
|
+
properties(): {
|
|
51
|
+
value: number;
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
step: number;
|
|
55
|
+
label: string;
|
|
56
|
+
placement: string;
|
|
57
|
+
};
|
|
58
|
+
events(): {
|
|
59
|
+
"[part~='base']": {
|
|
60
|
+
pointerdown: (event: any) => void;
|
|
61
|
+
pointermove: (event: any) => void;
|
|
62
|
+
pointerup: (event: any) => void;
|
|
63
|
+
pointercancel: (event: any) => void;
|
|
64
|
+
lostpointercapture: (event: any) => void;
|
|
65
|
+
keydown: (event: any) => void;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
disconnected(): void;
|
|
69
|
+
/**
|
|
70
|
+
* A width between the least and the greatest one, in whole pixels.
|
|
71
|
+
* @private
|
|
72
|
+
* @param {number} value
|
|
73
|
+
* @returns {number}
|
|
74
|
+
*/
|
|
75
|
+
private _clamp;
|
|
76
|
+
/**
|
|
77
|
+
* The direction in which the width grows: 1 where it grows as the edge moves to the right.
|
|
78
|
+
* The pane is in front of the edge or after it, and the page runs from the left or from the
|
|
79
|
+
* right.
|
|
80
|
+
* @private
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
private _sign;
|
|
84
|
+
/**
|
|
85
|
+
* Takes a width from the user and tells of it. A width that is the same as before is none.
|
|
86
|
+
* @private
|
|
87
|
+
* @param {number} value
|
|
88
|
+
* @returns {boolean} Whether the width has changed.
|
|
89
|
+
*/
|
|
90
|
+
private _resize;
|
|
91
|
+
/**
|
|
92
|
+
* The edge follows the pointer that took it, wherever that goes. The separator captures the
|
|
93
|
+
* pointer, so a move outside of the window still arrives here. A page in the page takes a pen
|
|
94
|
+
* that is over it all the same: while the edge is dragged, the separator covers the viewport
|
|
95
|
+
* (see the stylesheet), and the pointer is over nothing else.
|
|
96
|
+
* @private
|
|
97
|
+
* @param {PointerEvent} event
|
|
98
|
+
*/
|
|
99
|
+
private _onPointerDown;
|
|
100
|
+
/**
|
|
101
|
+
* @private
|
|
102
|
+
* @param {PointerEvent} event
|
|
103
|
+
*/
|
|
104
|
+
private _onPointerMove;
|
|
105
|
+
/**
|
|
106
|
+
* The pointer has let go, or the system has taken it away: the width stays as it is now.
|
|
107
|
+
* @private
|
|
108
|
+
* @param {PointerEvent} event
|
|
109
|
+
*/
|
|
110
|
+
private _onPointerEnd;
|
|
111
|
+
/**
|
|
112
|
+
* Ends the drag that is going on, and tells of the width that stays if it is another one than
|
|
113
|
+
* before the drag.
|
|
114
|
+
* @private
|
|
115
|
+
*/
|
|
116
|
+
private _endDrag;
|
|
117
|
+
/**
|
|
118
|
+
* The arrow keys move the edge a step, in the direction of the arrow. `Home` and `End` take
|
|
119
|
+
* it to the least and to the greatest width.
|
|
120
|
+
* @private
|
|
121
|
+
* @param {KeyboardEvent} event
|
|
122
|
+
*/
|
|
123
|
+
private _onKeyDown;
|
|
124
|
+
template(): any;
|
|
125
|
+
}
|
|
126
|
+
export declare function define(): void;
|
|
127
|
+
export { Events };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* A narrow line of state at the lower edge of a tool for a desktop: whether the connection is
|
|
4
|
+
* there, what is selected, how many entries there are, a task that runs in the background, the
|
|
5
|
+
* version. Entries at its start and at its end, in one row that keeps its height.
|
|
6
|
+
*
|
|
7
|
+
* An entry is what the page writes: a text, an icon with a name, an `el-button`, or a small
|
|
8
|
+
* component (`el-spinner`, `el-progress-bar`). The bar is no live region. An entry whose change
|
|
9
|
+
* is to be announced is one the page marks itself (`role="status"`).
|
|
10
|
+
*
|
|
11
|
+
* In the footer of an `el-app-frame` the surface of the bar reaches as far as the surface of the
|
|
12
|
+
* region. The look is the stylesheet alone, so a server-rendered bar does not change when the
|
|
13
|
+
* element takes over.
|
|
14
|
+
*
|
|
15
|
+
* @element el-status-bar
|
|
16
|
+
*
|
|
17
|
+
* @slot - The entries at the start of the bar. They give way first where the bar is too narrow.
|
|
18
|
+
* @slot end - The entries at the end of the bar.
|
|
19
|
+
*
|
|
20
|
+
* @csspart base - The bar: its surface and the line to the content.
|
|
21
|
+
* @csspart row - The row of the entries, which keeps its height.
|
|
22
|
+
* @csspart start - The entries at the start.
|
|
23
|
+
* @csspart end - The entries at the end.
|
|
24
|
+
*/
|
|
25
|
+
export default class StatusBar extends TemplateElement {
|
|
26
|
+
constructor();
|
|
27
|
+
events(): {
|
|
28
|
+
"[part~='base']": {
|
|
29
|
+
slotchange: () => any;
|
|
30
|
+
};
|
|
31
|
+
this: {
|
|
32
|
+
focusout: () => void;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Entries that do not fit are cut off, and the browser moves a group to show a button in the
|
|
37
|
+
* part that is cut when the keyboard gets to it. With the focus gone, the group shows its
|
|
38
|
+
* first entries again.
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
private _showStart;
|
|
42
|
+
template(): any;
|
|
43
|
+
}
|
|
44
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,9 @@ import { StyledElement } from '@webtides/element-js';
|
|
|
13
13
|
* The links and panels need not be defined, or be there, when the group connects: it marks the
|
|
14
14
|
* selection with attributes and styles, and takes in parts that are added later.
|
|
15
15
|
*
|
|
16
|
+
* The group finds a panel by its `name` and a link by its `for`. It reads the property and falls
|
|
17
|
+
* back to the attribute, so it makes no difference which of the two a framework has set.
|
|
18
|
+
*
|
|
16
19
|
* @element el-tab-group
|
|
17
20
|
*
|
|
18
21
|
* @slot - Default slot containing `<el-tab-link>` and `<el-tab-panel>` children.
|
|
@@ -65,6 +68,20 @@ export default class TabGroup extends StyledElement {
|
|
|
65
68
|
* @returns {void}
|
|
66
69
|
*/
|
|
67
70
|
selectTab(name: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* What a link (`for`) or a panel (`name`) is found by, as a text: the property, and the
|
|
73
|
+
* attribute when the property has no value.
|
|
74
|
+
*
|
|
75
|
+
* A framework that creates the elements in the browser hands the value over as a property
|
|
76
|
+
* when the element has one, and then there is no attribute. An element whose tag is not
|
|
77
|
+
* defined yet has the attribute alone. Both sides of a comparison are texts: element-js
|
|
78
|
+
* parses the attribute `name="1"` to a number, and `getAttribute()` gives a text.
|
|
79
|
+
* @private
|
|
80
|
+
* @param {Element} element
|
|
81
|
+
* @param {'for' | 'name'} key
|
|
82
|
+
* @returns {string | null}
|
|
83
|
+
*/
|
|
84
|
+
private _keyOf;
|
|
68
85
|
/** @private */
|
|
69
86
|
private updateSelection;
|
|
70
87
|
/**
|