@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* A tree: entries that open and close, for folders, categories and a library beside the content.
|
|
4
|
+
* The tree is a list; every `el-tree-item` in it is an entry, and an entry holds the entries
|
|
5
|
+
* below it. An entry is a link, and one with entries below it has a button that opens and closes
|
|
6
|
+
* them.
|
|
7
|
+
*
|
|
8
|
+
* To assistive technology it is what it is in the markup: nested lists of links, each branch with
|
|
9
|
+
* a button that says whether it is open. It has no `role="tree"`: the links stay links, and they
|
|
10
|
+
* work before the script has run. The script adds the arrow keys of a tree.
|
|
11
|
+
*
|
|
12
|
+
* @element el-tree
|
|
13
|
+
*
|
|
14
|
+
* @slot - The entries of the first level: `el-tree-item` elements.
|
|
15
|
+
*
|
|
16
|
+
* @csspart base - The list of the first level (`role="list"`).
|
|
17
|
+
*
|
|
18
|
+
* @cssproperty --el-tree-indent - How far the entries of a level stand in from the ones of the
|
|
19
|
+
* level above. Unset, it is `--el-space-4`, and `1rem` without a theme. Read by the entries, so
|
|
20
|
+
* it can be set on the tree or for the page.
|
|
21
|
+
*
|
|
22
|
+
* @property {string} label - The name of the tree for assistive technology. Unset, the tree has
|
|
23
|
+
* none.
|
|
24
|
+
*/
|
|
25
|
+
export default class Tree extends TemplateElement {
|
|
26
|
+
constructor();
|
|
27
|
+
properties(): {
|
|
28
|
+
label: string;
|
|
29
|
+
};
|
|
30
|
+
events(): {
|
|
31
|
+
this: {
|
|
32
|
+
keydown: (event: any) => void;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The entries that are shown, in their order: every entry that is in no closed branch. An
|
|
37
|
+
* entry is asked for the control the focus goes to, see `focusTarget` of `el-tree-item`; one
|
|
38
|
+
* that has none (a name without a link and without entries below it) is passed.
|
|
39
|
+
* @private
|
|
40
|
+
* @returns {HTMLElement[]}
|
|
41
|
+
*/
|
|
42
|
+
private _shownItems;
|
|
43
|
+
/**
|
|
44
|
+
* The entry an entry is below, or `null` for one of the first level.
|
|
45
|
+
* @private
|
|
46
|
+
* @param {Element} item
|
|
47
|
+
* @returns {Element | null}
|
|
48
|
+
*/
|
|
49
|
+
private _parentOf;
|
|
50
|
+
/**
|
|
51
|
+
* The keys of the WAI-ARIA tree view pattern. Up and down go to the entry before and after
|
|
52
|
+
* among the ones that are shown, Home and End to the first and the last. Right opens a branch,
|
|
53
|
+
* and goes to its first entry when it is open; left closes it, and goes to the entry above
|
|
54
|
+
* when it is closed or has nothing below it. In a text that runs from right to left, the two
|
|
55
|
+
* are the other way round.
|
|
56
|
+
* @private
|
|
57
|
+
* @param {KeyboardEvent} event
|
|
58
|
+
*/
|
|
59
|
+
private _onKeydown;
|
|
60
|
+
template(): any;
|
|
61
|
+
}
|
|
62
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
import Events from './tree-item.events.js';
|
|
3
|
+
/**
|
|
4
|
+
* One entry of an `el-tree`, and the entries below it. It has the parts of a row of a list: an
|
|
5
|
+
* icon at the start, its name, a count at the end. With `href` the name is a link, and the whole
|
|
6
|
+
* row is its target. An entry with entries below it has a button that opens and closes them; its
|
|
7
|
+
* state is the `open` attribute, which the page can render.
|
|
8
|
+
*
|
|
9
|
+
* The entries below it are the `el-tree-item` elements the page writes into it.
|
|
10
|
+
*
|
|
11
|
+
* @element el-tree-item
|
|
12
|
+
*
|
|
13
|
+
* @fires {CustomEvent<{ open: boolean }>} tree-item-toggle - Fired when the user has opened or
|
|
14
|
+
* closed the entry, with its button or with the arrow keys. `detail.open` is the new state. Not
|
|
15
|
+
* fired when `open` is set from a script. It bubbles: an entry further up hears it as well, so
|
|
16
|
+
* look at `event.target`.
|
|
17
|
+
*
|
|
18
|
+
* @slot - The entries below this one: `el-tree-item` elements.
|
|
19
|
+
* @slot label - The name of the entry. Takes precedence over the `label` attribute.
|
|
20
|
+
* @slot start - What stands in front of the name: an icon.
|
|
21
|
+
* @slot end - What stands at the end of the row: a count. In an entry that is a link it is part
|
|
22
|
+
* of the target of the link.
|
|
23
|
+
*
|
|
24
|
+
* @csspart base - The entry: an item of the list it is in.
|
|
25
|
+
* @csspart row - The row of the entry: its button, its start, its name and its end.
|
|
26
|
+
* @csspart toggle - The button that opens and closes the entries below, present only with such
|
|
27
|
+
* entries.
|
|
28
|
+
* @csspart start - The region of the `start` slot.
|
|
29
|
+
* @csspart label - The name: an `<a>` with `href`; without, a `<button>` that opens and closes
|
|
30
|
+
* the entry when it has entries below it, and a `<span>` when it has none.
|
|
31
|
+
* @csspart end - The region of the `end` slot.
|
|
32
|
+
* @csspart children - The list of the entries below (`role="list"`).
|
|
33
|
+
*
|
|
34
|
+
* @cssproperty --el-tree-indent - How far the entries below stand in from this one. Unset, it is
|
|
35
|
+
* `--el-space-4`, and `1rem` without a theme.
|
|
36
|
+
*
|
|
37
|
+
* @property {string} label - The name of the entry.
|
|
38
|
+
* @property {string} href - The address the entry leads to. Unset, the entry is no link.
|
|
39
|
+
* @property {string} target - Where to open the address (only with `href`).
|
|
40
|
+
* @property {string} rel - `rel` attribute for the link, written when `target` is set. Default
|
|
41
|
+
* `'noreferrer noopener'`.
|
|
42
|
+
* @property {boolean} current - The entry is the one of the page the user is on: it gets
|
|
43
|
+
* `aria-current="page"` (`"true"` without `href`), a bar at its start and a heavier name.
|
|
44
|
+
* Default `false`.
|
|
45
|
+
* @property {boolean} open - Whether the entries below this one are shown. Reflected to the
|
|
46
|
+
* `open` attribute, which the stylesheet reads: an entry without `open="true"` is closed, before
|
|
47
|
+
* the element starts as well. Default `false`.
|
|
48
|
+
*/
|
|
49
|
+
export default class TreeItem extends TemplateElement {
|
|
50
|
+
open: boolean;
|
|
51
|
+
constructor();
|
|
52
|
+
properties(): {
|
|
53
|
+
label: string;
|
|
54
|
+
href: string;
|
|
55
|
+
target: string;
|
|
56
|
+
rel: string;
|
|
57
|
+
current: boolean;
|
|
58
|
+
open: boolean;
|
|
59
|
+
};
|
|
60
|
+
events(): {
|
|
61
|
+
'[data-toggle]': {
|
|
62
|
+
click: () => void;
|
|
63
|
+
};
|
|
64
|
+
"[part~='base']": {
|
|
65
|
+
slotchange: () => any;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Whether the entry has entries below it. The children of the host are asked, not the slot:
|
|
70
|
+
* a template is rendered on a server too, where there are no slots to ask.
|
|
71
|
+
* @returns {boolean}
|
|
72
|
+
*/
|
|
73
|
+
get hasItems(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The control of the entry that the focus goes to: its link, or the button its name is when it
|
|
76
|
+
* has entries below it and no address. `null` for a name alone.
|
|
77
|
+
* @returns {HTMLElement | null}
|
|
78
|
+
*/
|
|
79
|
+
get focusTarget(): HTMLElement | null;
|
|
80
|
+
/**
|
|
81
|
+
* Opens or closes the entry, as its button does, and says so with `tree-item-toggle`. An entry
|
|
82
|
+
* without entries below it stays as it is.
|
|
83
|
+
* @param {boolean} [open] - The state to go to. Left out, the entry goes to the other one.
|
|
84
|
+
* @returns {void}
|
|
85
|
+
*/
|
|
86
|
+
toggle(open?: boolean): void;
|
|
87
|
+
/** @private */
|
|
88
|
+
private labelContent;
|
|
89
|
+
/**
|
|
90
|
+
* The name of the entry, and what it is: a link, the button of a branch that leads nowhere, or
|
|
91
|
+
* a text.
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
private labelTemplate;
|
|
95
|
+
/**
|
|
96
|
+
* The button that opens and closes the entries below: for an entry that is a link, which
|
|
97
|
+
* cannot do both. It is named by the name of the entry, and says whether the entry is open.
|
|
98
|
+
* @private
|
|
99
|
+
*/
|
|
100
|
+
private toggleTemplate;
|
|
101
|
+
/** @private */
|
|
102
|
+
private chevronTemplate;
|
|
103
|
+
template(): any;
|
|
104
|
+
}
|
|
105
|
+
export declare function define(): void;
|
|
106
|
+
export { Events };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,3 +16,34 @@
|
|
|
16
16
|
* @returns {string}
|
|
17
17
|
*/
|
|
18
18
|
export default function appearanceStyle(surface: string, host?: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* The appearance a container gives to the controls inside of it: a toolbar with
|
|
21
|
+
* `appearance="plain"` has plain buttons. The container declares `appearance` as a reflected
|
|
22
|
+
* property and composes this module; it sets one of two properties on the host, which are
|
|
23
|
+
* inherited at any depth and into shadow roots:
|
|
24
|
+
*
|
|
25
|
+
* - `--_el-context-appearance-outlined`
|
|
26
|
+
* - `--_el-context-appearance-plain`
|
|
27
|
+
*
|
|
28
|
+
* Each is a switch: it is set to nothing, or it is not set. A stylesheet cannot ask for the value
|
|
29
|
+
* of a property, so the control puts the switch in front of a value in a property of its own,
|
|
30
|
+
* which is valid only where the switch is set, and falls back from one to the next:
|
|
31
|
+
*
|
|
32
|
+
* --_el-button-if-plain: var(--_el-context-appearance-plain) transparent;
|
|
33
|
+
* background: var(--_el-button-if-plain, var(--_el-variant-fill));
|
|
34
|
+
*
|
|
35
|
+
* Outside of a container none of the switches is set, and the control paints what it painted
|
|
36
|
+
* before, with the same values. As with the size, the control only does so while the page has not
|
|
37
|
+
* given it an appearance of its own, and marks that from its template.
|
|
38
|
+
*
|
|
39
|
+
* `filled` sets nothing: it is the appearance a control has anyway.
|
|
40
|
+
*
|
|
41
|
+
* The appearance a container has without the attribute is given as `byDefault`. The rule for it
|
|
42
|
+
* selects a host that has no `appearance` attribute as well: element-js writes the default onto
|
|
43
|
+
* the element when it starts, and in server-rendered markup it is not there yet.
|
|
44
|
+
* @param {string} [host] - `':host'` (the default), or the tag of a component without a shadow root.
|
|
45
|
+
* @param {'filled'|'outlined'|'plain'} [byDefault] - The appearance of a container without the
|
|
46
|
+
* attribute. Default `'filled'`.
|
|
47
|
+
* @returns {string}
|
|
48
|
+
*/
|
|
49
|
+
export declare function appearanceContextStyle(host?: string, byDefault?: 'filled' | 'outlined' | 'plain'): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A group of choices in a field: a fieldset with a legend that holds the options, each of them a
|
|
3
3
|
* label around a native radio or checkbox (`el-radio-field`, `el-checkbox-group-field`,
|
|
4
|
-
* `el-rating-field`).
|
|
4
|
+
* `el-rating-field`, `el-segmented-field`).
|
|
5
5
|
*
|
|
6
6
|
* - The fieldset is the column of the field. It loses the border and the padding of the browser
|
|
7
7
|
* and stacks the legend, the help message, the options and the error message: all of them are
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The control of a text field that has more in it than its input: content of the page at its
|
|
3
|
+
* start and at its end (an icon, a unit, a button), and the button that clears it. `.control` is
|
|
4
|
+
* the row with the input in its middle. A field renders it only while there is such content.
|
|
5
|
+
*
|
|
6
|
+
* This is the layout of that row, and the button. That the row is the control to the eye, with
|
|
7
|
+
* the border, the surface and the focus ring around all of it and none on the input, is the part
|
|
8
|
+
* of `styles/native.css`, as the border of an input alone is. Without that file the input keeps
|
|
9
|
+
* the look of the browser, and the content stands beside it in the row.
|
|
10
|
+
*
|
|
11
|
+
* The row follows the reading direction: the start is at the right in a right-to-left page.
|
|
12
|
+
* @param {string} [host] - `':host'` (the default), or the tag of a field without a shadow root.
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
export default function inputControlStyle(host?: string): string;
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
* are different properties from the ones set here, so the order of the two stylesheets does not
|
|
14
14
|
* decide anything.
|
|
15
15
|
*
|
|
16
|
+
* A surface that reaches an edge of the screen keeps what is in it clear of the notch and the home
|
|
17
|
+
* indicator of a phone: the component says how much room each side needs
|
|
18
|
+
* (`--_el-modal-inset-block-start`, `-block-end`, `-inline-start`, `-inline-end`), and that room
|
|
19
|
+
* is the padding of the surface here.
|
|
20
|
+
*
|
|
16
21
|
* The module takes no host: a dialog with slots needs a shadow root, and the host of one is
|
|
17
22
|
* `:host`.
|
|
18
23
|
* @returns {string}
|
|
@@ -18,3 +18,27 @@
|
|
|
18
18
|
* @returns {string}
|
|
19
19
|
*/
|
|
20
20
|
export default function sizeStyle(host?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The size a container gives to the controls inside of it: a toolbar with `size="small"` has small
|
|
23
|
+
* controls. The container declares `size` as a reflected property and composes this module; it
|
|
24
|
+
* sets properties on the host that are inherited, at any depth and into shadow roots:
|
|
25
|
+
*
|
|
26
|
+
* - `--_el-context-size-height`, `--_el-context-size-padding-block`,
|
|
27
|
+
* `--_el-context-size-padding-inline`, `--_el-context-size-font-size`
|
|
28
|
+
*
|
|
29
|
+
* They are what `sizeStyle()` resolves a size to, under other names: a control declares the
|
|
30
|
+
* `--_el-size-` properties on its own host, so an inherited value of the same name would never
|
|
31
|
+
* reach it. A control that takes its size from a container reads the context first and its own
|
|
32
|
+
* size after it, on the element that it paints:
|
|
33
|
+
*
|
|
34
|
+
* min-height: var(--_el-context-size-height, var(--_el-size-height));
|
|
35
|
+
*
|
|
36
|
+
* It does so only while the page has not given it a size of its own. The stylesheet cannot ask
|
|
37
|
+
* that: element-js writes the default onto the element. So the control marks the element it paints
|
|
38
|
+
* from its template (`button--inherit-size` of `el-button`).
|
|
39
|
+
*
|
|
40
|
+
* `medium` sets nothing: it is the size a control has anyway.
|
|
41
|
+
* @param {string} [host] - `':host'` (the default), or the tag of a component without a shadow root.
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
export declare function sizeContextStyle(host?: string): string;
|
|
@@ -34,3 +34,14 @@ export declare function placeAtAnchor(anchor: Element, floating: HTMLElement, {
|
|
|
34
34
|
* @returns {() => void} Stops it.
|
|
35
35
|
*/
|
|
36
36
|
export declare function followAnchor(anchor: Element, floating: HTMLElement, update: () => void): () => void;
|
|
37
|
+
/**
|
|
38
|
+
* What scrolls an element away: the regions around it that scroll, and the window for the page.
|
|
39
|
+
* The way up goes through slots and out of shadow roots, so the region of an `el-app-frame` is
|
|
40
|
+
* one of them for what is in its content.
|
|
41
|
+
*
|
|
42
|
+
* A `scroll` event does not bubble and does not leave a shadow root: who wants to know that an
|
|
43
|
+
* element has moved listens on each of these.
|
|
44
|
+
* @param {Element} element
|
|
45
|
+
* @returns {Array<Element | Window>}
|
|
46
|
+
*/
|
|
47
|
+
export declare function scrollersOf(element: Element): Array<Element | Window>;
|
|
@@ -14,3 +14,28 @@
|
|
|
14
14
|
* @returns {boolean}
|
|
15
15
|
*/
|
|
16
16
|
export declare function focusLeft(group: Element, event: FocusEvent): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The element that has the focus, also when it is inside of a shadow root: `document.activeElement`
|
|
19
|
+
* stops at the element whose shadow root the focus is in.
|
|
20
|
+
* @returns {Element | null}
|
|
21
|
+
*/
|
|
22
|
+
export declare function activeElement(): Element | null;
|
|
23
|
+
/**
|
|
24
|
+
* The elements inside of `root` that the user can move the focus to, in the order of the document:
|
|
25
|
+
* the controls of the page, and the ones inside of the shadow roots of custom elements, the
|
|
26
|
+
* `<button>` of an `el-button` for example. Left out are controls that are disabled, inert, not
|
|
27
|
+
* shown or taken out of the tab order (`tabindex="-1"`).
|
|
28
|
+
*
|
|
29
|
+
* Each radio of a group is one of them, also the ones that are not checked: the Tab key stops at
|
|
30
|
+
* a group once, the arrow keys of a toolbar at every radio.
|
|
31
|
+
* @param {Element} root
|
|
32
|
+
* @returns {HTMLElement[]}
|
|
33
|
+
*/
|
|
34
|
+
export declare function focusableElements(root: Element): HTMLElement[];
|
|
35
|
+
/**
|
|
36
|
+
* Whether the user can move the focus to `root` or to an element inside of it, the ones in shadow
|
|
37
|
+
* roots included. It stops at the first one it finds, which `focusableElements()` does not.
|
|
38
|
+
* @param {Element} root
|
|
39
|
+
* @returns {boolean}
|
|
40
|
+
*/
|
|
41
|
+
export declare function containsFocusable(root: Element): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an option of a group of choices shows in front of its label: a dot in the colour the option
|
|
3
|
+
* names (`color`), and an icon, the address of an SVG symbol (`icon`: `'#tag'`,
|
|
4
|
+
* `'/icons.svg#tag'`), as an option of `el-segmented-field` has it.
|
|
5
|
+
*
|
|
6
|
+
* Both are decorations. The label is the name of the option, so what is in front of it is hidden
|
|
7
|
+
* from assistive technology as a whole.
|
|
8
|
+
*
|
|
9
|
+
* Nothing for an option that has neither, a plain text among them: such an option has the markup
|
|
10
|
+
* it had.
|
|
11
|
+
* @param {string | { color?: string, icon?: string }} option
|
|
12
|
+
* @returns {import('@webtides/element-js').TemplateResult | null}
|
|
13
|
+
*/
|
|
14
|
+
export declare function optionStartTemplate(option: string | {
|
|
15
|
+
color?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
}): import('@webtides/element-js').TemplateResult | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 declare function scrollContainer(element: Element): HTMLElement | null;
|
|
@@ -16,3 +16,13 @@ export declare function shadowNativeTextEntryProperties(element: HTMLElement): v
|
|
|
16
16
|
* @returns {Record<string, unknown>}
|
|
17
17
|
*/
|
|
18
18
|
export declare function textEntryAttributes(element: HTMLElement): Record<string, unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* `maxlength` or `minlength` for the control: the number of the field, or `null` for one that is
|
|
21
|
+
* not set, which a plain binding leaves out.
|
|
22
|
+
*
|
|
23
|
+
* Empty is not set as well. element-js keeps an attribute that was on the field when it started:
|
|
24
|
+
* taken off, or with its property set to `null`, it is written back empty.
|
|
25
|
+
* @param {number | string | null | undefined} value
|
|
26
|
+
* @returns {number | string | null}
|
|
27
|
+
*/
|
|
28
|
+
export declare function lengthAttribute(value: number | string | null | undefined): number | string | null;
|