@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
|
@@ -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;
|
|
@@ -35,6 +35,10 @@ export default class PasswordField extends InputField {
|
|
|
35
35
|
size: string;
|
|
36
36
|
placeholder: string;
|
|
37
37
|
pattern: boolean;
|
|
38
|
+
clearable: boolean;
|
|
39
|
+
clearLabel: string;
|
|
40
|
+
maxlength: any;
|
|
41
|
+
minlength: any;
|
|
38
42
|
autocomplete: any;
|
|
39
43
|
inputmode: any;
|
|
40
44
|
enterkeyhint: any;
|
|
@@ -67,6 +71,12 @@ export default class PasswordField extends InputField {
|
|
|
67
71
|
click: () => void;
|
|
68
72
|
touchstart: () => void;
|
|
69
73
|
};
|
|
74
|
+
'.control': {
|
|
75
|
+
click: (event: any) => void;
|
|
76
|
+
};
|
|
77
|
+
'[data-clear]': {
|
|
78
|
+
click: () => void;
|
|
79
|
+
};
|
|
70
80
|
'[data-password-toggle]': {
|
|
71
81
|
click: () => void;
|
|
72
82
|
};
|
|
@@ -14,9 +14,12 @@ import FormField from '../form-field/form-field.js';
|
|
|
14
14
|
* because of it. Inherits `valid` and `invalid` from `FormField`.
|
|
15
15
|
*
|
|
16
16
|
* @property {string | null} value - The selected option's value.
|
|
17
|
-
* @property {Array<string | { value: string, label?: string, disabled?: boolean }>} options -
|
|
17
|
+
* @property {Array<string | { value: string, label?: string, disabled?: boolean, color?: string, icon?: string }>} options -
|
|
18
18
|
* Options to render. Accepts plain strings (`['Yes', 'No']`) or option objects
|
|
19
|
-
* (`[{ value, label, disabled? }]`). Strings are used as both value and label.
|
|
19
|
+
* (`[{ value, label, disabled? }]`). Strings are used as both value and label. An object can
|
|
20
|
+
* name a `color`, which is drawn as a dot in front of the label, and an `icon`, the address of
|
|
21
|
+
* an SVG symbol (`'#tag'`, `'/icons.svg#tag'`), which is drawn there as well. Both are
|
|
22
|
+
* decorations: the label stays the name of the option.
|
|
20
23
|
*/
|
|
21
24
|
export default class RadioField extends FormField {
|
|
22
25
|
constructor(options: any);
|
|
@@ -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
|
/**
|
|
@@ -12,6 +12,11 @@ import FormField from '../form-field/form-field.js';
|
|
|
12
12
|
* @property {string} placeholder - Placeholder text shown while the textarea is empty.
|
|
13
13
|
* @property {number} rows - Number of visible text rows. Forwarded to the underlying
|
|
14
14
|
* `<textarea>`'s `rows` attribute.
|
|
15
|
+
* @property {number | null} maxlength - Passed on to the control as `maxlength`: the browser takes
|
|
16
|
+
* no more characters than this while the user types. `null` (the default) leaves the attribute
|
|
17
|
+
* out.
|
|
18
|
+
* @property {number | null} minlength - Passed on as `minlength`: a text the user has typed that is
|
|
19
|
+
* shorter makes the field invalid. `null` (the default) leaves the attribute out.
|
|
15
20
|
* @property {string | null} autocomplete - Passed on to the control as its `autocomplete`
|
|
16
21
|
* attribute (e.g. `'email'`, `'current-password'`, `'one-time-code'`). `null` (the default)
|
|
17
22
|
* leaves the attribute out. The same holds for the five properties below.
|
|
@@ -39,6 +44,8 @@ export default class TextareaField extends FormField {
|
|
|
39
44
|
touched: boolean;
|
|
40
45
|
placeholder: string;
|
|
41
46
|
rows: number;
|
|
47
|
+
maxlength: any;
|
|
48
|
+
minlength: any;
|
|
42
49
|
autocomplete: any;
|
|
43
50
|
inputmode: any;
|
|
44
51
|
enterkeyhint: any;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* A toolbar: the row of controls over a list or a view. It gives them one size and one
|
|
4
|
+
* appearance, lays them out with a gap, in lines where they do not fit into one, and with a group
|
|
5
|
+
* at the end, and makes them one stop of the Tab key: the arrow keys move between them.
|
|
6
|
+
*
|
|
7
|
+
* The controls are what the page writes into it: `el-button` (also as a toggle, and with an icon
|
|
8
|
+
* alone), `el-button-group`, `el-segmented-field`, and `el-divider` between two groups.
|
|
9
|
+
*
|
|
10
|
+
* The look is the stylesheet alone, so a server-rendered toolbar does not change when the element
|
|
11
|
+
* takes over. The script adds the keyboard, and the tooltips of the buttons with an icon alone.
|
|
12
|
+
*
|
|
13
|
+
* @element el-toolbar
|
|
14
|
+
*
|
|
15
|
+
* @slot - The controls of the toolbar, and `el-divider` elements between two groups of them.
|
|
16
|
+
* @slot end - The controls at the end of the toolbar.
|
|
17
|
+
*
|
|
18
|
+
* @csspart base - The toolbar (`role="toolbar"`): the row of the controls.
|
|
19
|
+
* @csspart end - The group at the end.
|
|
20
|
+
* @csspart tooltip - The tooltip of a button with an icon alone: an `el-tooltip`.
|
|
21
|
+
*
|
|
22
|
+
* @property {string} label - The name of the toolbar for assistive technology, "Formatting".
|
|
23
|
+
* Unset, the toolbar has none.
|
|
24
|
+
* @property {'small'|'medium'|'large'} size - The size of the controls that have none of their
|
|
25
|
+
* own. Default `'medium'`. Reflected to the `size` attribute.
|
|
26
|
+
* @property {'filled'|'outlined'|'plain'} appearance - The appearance of the buttons that have
|
|
27
|
+
* none of their own. Default `'plain'`. Reflected to the `appearance` attribute.
|
|
28
|
+
*/
|
|
29
|
+
export default class Toolbar extends TemplateElement {
|
|
30
|
+
/**
|
|
31
|
+
* The control that had the focus last: where the Tab key comes back to.
|
|
32
|
+
* @private
|
|
33
|
+
* @type {HTMLElement | undefined}
|
|
34
|
+
*/
|
|
35
|
+
private _current;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the toolbar has started in a browser, see `connected()`.
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
private _started;
|
|
41
|
+
constructor();
|
|
42
|
+
properties(): {
|
|
43
|
+
label: string;
|
|
44
|
+
size: string;
|
|
45
|
+
appearance: string;
|
|
46
|
+
};
|
|
47
|
+
connected(): void;
|
|
48
|
+
events(): {
|
|
49
|
+
this: {
|
|
50
|
+
keydown: (event: any) => void;
|
|
51
|
+
focusin: (event: any) => void;
|
|
52
|
+
};
|
|
53
|
+
"[part~='base']": {
|
|
54
|
+
slotchange: () => any;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The controls of the toolbar that the user can move the focus to, in their order: the ones
|
|
59
|
+
* at the end last, as they are shown.
|
|
60
|
+
* @private
|
|
61
|
+
* @returns {HTMLElement[]}
|
|
62
|
+
*/
|
|
63
|
+
private _controls;
|
|
64
|
+
/**
|
|
65
|
+
* The arrow keys move the focus from control to control and around the ends, Home and End go
|
|
66
|
+
* to the first and the last one. The Tab key leaves the toolbar.
|
|
67
|
+
* @private
|
|
68
|
+
* @param {KeyboardEvent} event
|
|
69
|
+
*/
|
|
70
|
+
private _onKeydown;
|
|
71
|
+
/**
|
|
72
|
+
* Lets the Tab key leave the toolbar: the browser takes the key once every listener has had
|
|
73
|
+
* it, and goes to the next stop. Until then the other controls of the toolbar are none.
|
|
74
|
+
* @private
|
|
75
|
+
* @param {HTMLElement[]} controls
|
|
76
|
+
* @param {Element} current
|
|
77
|
+
*/
|
|
78
|
+
private _letTabLeave;
|
|
79
|
+
/**
|
|
80
|
+
* The Tab key comes into the toolbar at the control that had the focus last, and at the first
|
|
81
|
+
* one before any had it. A pointer puts the focus where it is pressed.
|
|
82
|
+
* @private
|
|
83
|
+
* @param {FocusEvent} event
|
|
84
|
+
*/
|
|
85
|
+
private _onFocusIn;
|
|
86
|
+
/**
|
|
87
|
+
* The buttons that show an icon alone: they have a name of their own for assistive technology
|
|
88
|
+
* (`aria-label`), which their content does not show. None before the toolbar has started: on
|
|
89
|
+
* a server there is no pointer to show a tooltip to.
|
|
90
|
+
* @private
|
|
91
|
+
* @returns {Element[]}
|
|
92
|
+
*/
|
|
93
|
+
private _namedButtons;
|
|
94
|
+
template(): any;
|
|
95
|
+
}
|
|
96
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,6 +26,14 @@ import Events from './tooltip.events.js';
|
|
|
26
26
|
*
|
|
27
27
|
* @property {string} for - The id of the anchor: the element the tooltip explains and opens from.
|
|
28
28
|
* It is looked up in the document or the shadow root the tooltip is in.
|
|
29
|
+
* @property {Element | null} anchor - The anchor as an element, for one that an id cannot name: an
|
|
30
|
+
* element in another tree than the tooltip. A property only, and it comes before `for`. Default
|
|
31
|
+
* `null`.
|
|
32
|
+
* @property {'description'|'label'} type - What the tooltip is to its anchor. `'description'`
|
|
33
|
+
* (the default): it explains the anchor, and is its description for a screen reader.
|
|
34
|
+
* `'label'`: it shows the name the anchor already has, of a button with an icon alone for
|
|
35
|
+
* example. The anchor is not described by it then, and the tooltip is hidden from assistive
|
|
36
|
+
* technology, which would read the name twice.
|
|
29
37
|
* @property {boolean} open - Whether the tooltip is shown. Reflected to the `open` attribute.
|
|
30
38
|
* @property {'top'|'top-start'|'top-end'|'bottom'|'bottom-start'|'bottom-end'|'left'|'left-start'|'left-end'|'right'|'right-start'|'right-end'} placement -
|
|
31
39
|
* The side of the anchor the tooltip is placed at, and with `-start` or `-end` the edge of the
|
|
@@ -51,9 +59,18 @@ export default class Tooltip extends TemplateElement {
|
|
|
51
59
|
* @type {Set<'anchor' | 'tooltip' | 'focus'>}
|
|
52
60
|
*/
|
|
53
61
|
_reasons;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the tooltip is shown, as it has said last (`:state(open)`). Kept here, and not
|
|
64
|
+
* read back from the states of the element: WebKit forgets what was added to them a
|
|
65
|
+
* moment later (`states.has()` is `false`), while the state still matches.
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
_shown;
|
|
69
|
+
_givenAnchor: any;
|
|
54
70
|
open: any;
|
|
55
71
|
id: string;
|
|
56
72
|
_anchor: any;
|
|
73
|
+
_describes: boolean;
|
|
57
74
|
_anchorListeners: AbortController;
|
|
58
75
|
_timer: number;
|
|
59
76
|
_openListeners: AbortController;
|
|
@@ -69,7 +86,15 @@ export default class Tooltip extends TemplateElement {
|
|
|
69
86
|
hideDelay: number;
|
|
70
87
|
arrow: boolean;
|
|
71
88
|
disabled: boolean;
|
|
89
|
+
type: string;
|
|
72
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* The anchor as an element. No property of element-js: an element is nothing to compare or to
|
|
93
|
+
* keep as state.
|
|
94
|
+
* @returns {Element | null}
|
|
95
|
+
*/
|
|
96
|
+
get anchor(): Element | null;
|
|
97
|
+
set anchor(anchor: Element | null);
|
|
73
98
|
connected(): void;
|
|
74
99
|
disconnected(): void;
|
|
75
100
|
afterUpdate(): void;
|
|
@@ -77,6 +102,7 @@ export default class Tooltip extends TemplateElement {
|
|
|
77
102
|
open: (open: any) => void;
|
|
78
103
|
for: () => void;
|
|
79
104
|
disabled: (disabled: any) => void;
|
|
105
|
+
type: () => void;
|
|
80
106
|
};
|
|
81
107
|
/**
|
|
82
108
|
* Opens the tooltip. A tooltip without an anchor in the page stays closed.
|