@webtides/element-library 0.4.0 → 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 +107 -0
- package/custom-elements.json +1543 -199
- package/package.json +1 -1
- package/src/components/app-frame/app-frame.changelog.md +14 -0
- package/src/components/app-frame/app-frame.js +14 -2
- package/src/components/app-frame/app-frame.readme.md +12 -3
- package/src/components/app-frame/app-frame.style.js +7 -0
- package/src/components/button/button.changelog.md +6 -0
- package/src/components/button/button.style.js +6 -1
- 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 +17 -0
- package/src/components/description-list/description-list.js +7 -2
- package/src/components/description-list/description-list.readme.md +30 -4
- package/src/components/description-list/description-list.style.js +57 -28
- 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/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 +6 -0
- package/src/components/list/list.js +2 -0
- package/src/components/list/list.readme.md +1 -0
- package/src/components/list-item/list-item.changelog.md +16 -0
- package/src/components/list-item/list-item.js +2 -0
- package/src/components/list-item/list-item.readme.md +19 -1
- package/src/components/list-item/list-item.style.js +23 -11
- package/src/components/menu/menu.changelog.md +17 -0
- package/src/components/menu/menu.js +293 -70
- package/src/components/menu/menu.readme.md +47 -6
- package/src/components/menu/menu.style.js +6 -2
- package/src/components/menu-item/menu-item.changelog.md +8 -0
- package/src/components/menu-item/menu-item.js +41 -3
- package/src/components/menu-item/menu-item.readme.md +45 -7
- package/src/components/menu-item/menu-item.style.js +30 -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/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/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/styles/choice-group.style.js +26 -0
- package/src/styles/input-control.style.js +87 -0
- package/src/styles/native.css +100 -0
- package/src/utils/floating.js +15 -1
- package/src/utils/options.js +35 -0
- package/src/utils/text-entry-attributes.js +13 -0
- package/types/src/components/app-frame/app-frame.d.ts +7 -1
- 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 +7 -2
- 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 +2 -0
- package/types/src/components/list-item/list-item.d.ts +2 -0
- package/types/src/components/menu/menu.d.ts +105 -9
- package/types/src/components/menu-item/menu-item.d.ts +21 -0
- package/types/src/components/otp-field/otp-field.d.ts +10 -0
- 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/textarea-field/textarea-field.d.ts +7 -0
- package/types/src/styles/input-control.style.d.ts +15 -0
- package/types/src/utils/floating.d.ts +11 -0
- package/types/src/utils/options.d.ts +17 -0
- package/types/src/utils/text-entry-attributes.d.ts +10 -0
- package/web-types.json +514 -24
|
@@ -98,6 +98,32 @@ export default class Menu extends TemplateElement {
|
|
|
98
98
|
* @private
|
|
99
99
|
*/
|
|
100
100
|
private _leaving;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the panel is being placed, and whether it was asked to be placed again meanwhile.
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
private _placing;
|
|
106
|
+
/** @private */
|
|
107
|
+
private _placeAgain;
|
|
108
|
+
/**
|
|
109
|
+
* The entry that had the focus last while the menu is open. It gets the focus back when a
|
|
110
|
+
* press beside the entries has given it to the panel.
|
|
111
|
+
* @private
|
|
112
|
+
* @type {HTMLElement | undefined}
|
|
113
|
+
*/
|
|
114
|
+
private _current;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the menu is open and has not put the focus on an entry yet: its entries are not
|
|
117
|
+
* there, or not defined. The focus goes to them once they are.
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
private _entering;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the pointer that went down last is on the element the menu is open at, the button
|
|
123
|
+
* of a row. The `showAt()` the page calls with the click of that press closes the menu.
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
private _pressedAtPlace;
|
|
101
127
|
/**
|
|
102
128
|
* A pointer that goes down beside the open menu closes it. The panel is a popover the menu
|
|
103
129
|
* opens and closes itself (`popover="manual"`): the platform would close one of its own
|
|
@@ -106,6 +132,38 @@ export default class Menu extends TemplateElement {
|
|
|
106
132
|
* @param {PointerEvent} event
|
|
107
133
|
*/
|
|
108
134
|
private _onPressOutside;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the menu closes because the page has scrolled under it. The focus goes back to
|
|
137
|
+
* what the menu was opened for without scrolling to it then: the scroll of the user goes on.
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
private _closedByScroll;
|
|
141
|
+
/**
|
|
142
|
+
* What the menu listens on for a scroll while it is open at a point.
|
|
143
|
+
* @private
|
|
144
|
+
* @type {Array<Element | Window | Document> | undefined}
|
|
145
|
+
*/
|
|
146
|
+
private _scrollers;
|
|
147
|
+
/**
|
|
148
|
+
* What a menu at a point was opened for scrolls away under it: the page, or a region around
|
|
149
|
+
* the row. The menu closes, as the menu of the system does. At an element it follows the
|
|
150
|
+
* element instead, and it has no point to be left at.
|
|
151
|
+
*
|
|
152
|
+
* A scroll inside of the menu is none of these: a long menu scrolls in its panel. Neither is
|
|
153
|
+
* one of a region that does not move what the menu was opened for, another column of the
|
|
154
|
+
* page. A menu that was opened for nothing closes for every scroll in the page beside it.
|
|
155
|
+
* @private
|
|
156
|
+
* @param {Event} event
|
|
157
|
+
*/
|
|
158
|
+
private _onScroll;
|
|
159
|
+
/**
|
|
160
|
+
* The keys of a menu, for as long as it is open and wherever the focus is: an open menu that
|
|
161
|
+
* has lost the focus would be left with no key at all. The window hears a key before the
|
|
162
|
+
* page does, so `Escape` closes the menu and nothing behind it.
|
|
163
|
+
* @private
|
|
164
|
+
* @param {KeyboardEvent} event
|
|
165
|
+
*/
|
|
166
|
+
private _onKeyDown;
|
|
109
167
|
constructor();
|
|
110
168
|
properties(): {
|
|
111
169
|
open: boolean;
|
|
@@ -127,9 +185,10 @@ export default class Menu extends TemplateElement {
|
|
|
127
185
|
slotchange: () => void;
|
|
128
186
|
};
|
|
129
187
|
"[part~='panel']": {
|
|
130
|
-
keydown: (event: any) => void;
|
|
131
188
|
click: (event: any) => void;
|
|
189
|
+
focusin: (event: any) => void;
|
|
132
190
|
focusout: (event: any) => void;
|
|
191
|
+
slotchange: () => number;
|
|
133
192
|
};
|
|
134
193
|
};
|
|
135
194
|
/**
|
|
@@ -147,6 +206,9 @@ export default class Menu extends TemplateElement {
|
|
|
147
206
|
* `opener` is what the menu is opened for. It gets the focus back when the menu closes, and
|
|
148
207
|
* `menu-select` names it (`detail.opener`). Without one it is the element the menu is placed
|
|
149
208
|
* at.
|
|
209
|
+
*
|
|
210
|
+
* Called with the click of a press on the element the menu is open at, it closes the menu:
|
|
211
|
+
* the button of a row closes what it has opened, with the listener that opens it.
|
|
150
212
|
* @param {Element | { x: number, y: number }} place - The element, or the point in the
|
|
151
213
|
* coordinates of the viewport (`clientX`, `clientY`).
|
|
152
214
|
* @param {Element} [opener] - The row or the button the menu is opened for.
|
|
@@ -203,6 +265,12 @@ export default class Menu extends TemplateElement {
|
|
|
203
265
|
* @private
|
|
204
266
|
* @returns {boolean}
|
|
205
267
|
*/
|
|
268
|
+
private _hasFocusOnEntry;
|
|
269
|
+
/**
|
|
270
|
+
* Whether the focus is in the menu: on an entry, or on the panel around the entries.
|
|
271
|
+
* @private
|
|
272
|
+
* @returns {boolean}
|
|
273
|
+
*/
|
|
206
274
|
private _hasFocusInPanel;
|
|
207
275
|
/**
|
|
208
276
|
* The arrow keys on the button open the menu: down at its first entry, up at its last one.
|
|
@@ -211,12 +279,6 @@ export default class Menu extends TemplateElement {
|
|
|
211
279
|
* @param {KeyboardEvent} event
|
|
212
280
|
*/
|
|
213
281
|
private _onTriggerKeyDown;
|
|
214
|
-
/**
|
|
215
|
-
* The keys of a menu, while the focus is on one of its entries.
|
|
216
|
-
* @private
|
|
217
|
-
* @param {KeyboardEvent} event
|
|
218
|
-
*/
|
|
219
|
-
private _onKeyDown;
|
|
220
282
|
/**
|
|
221
283
|
* A click in the panel: the user has chosen the entry it is on, unless that one is disabled.
|
|
222
284
|
* @private
|
|
@@ -235,10 +297,27 @@ export default class Menu extends TemplateElement {
|
|
|
235
297
|
*/
|
|
236
298
|
private _onFocusOut;
|
|
237
299
|
/**
|
|
238
|
-
*
|
|
300
|
+
* The focus has come into the menu. On an entry: the menu remembers it. On the panel itself:
|
|
301
|
+
* the user has pressed beside the entries, on the heading of a group, a line or the padding,
|
|
302
|
+
* and the entry that had the focus gets it back. The keyboard goes on from there.
|
|
303
|
+
* @private
|
|
304
|
+
* @param {FocusEvent} event
|
|
305
|
+
*/
|
|
306
|
+
private _onFocusIn;
|
|
307
|
+
/**
|
|
308
|
+
* Puts the focus on the entry the menu is entered at. An entry that is not there yet, or
|
|
309
|
+
* whose element is not defined yet, cannot take it: the menu waits for it.
|
|
239
310
|
* @private
|
|
240
311
|
*/
|
|
241
312
|
private _focusEntry;
|
|
313
|
+
/**
|
|
314
|
+
* Other entries in the open menu, or entries that have rendered by now. The panel has
|
|
315
|
+
* another size, and a menu at a point is placed once. And the focus goes to the entry the
|
|
316
|
+
* menu is entered at, where none could take it when the menu opened and nothing in the menu
|
|
317
|
+
* has it by now.
|
|
318
|
+
* @private
|
|
319
|
+
*/
|
|
320
|
+
private _entriesChanged;
|
|
242
321
|
/** @private */
|
|
243
322
|
private _applyOpen;
|
|
244
323
|
/** @private */
|
|
@@ -256,9 +335,26 @@ export default class Menu extends TemplateElement {
|
|
|
256
335
|
* @private
|
|
257
336
|
*/
|
|
258
337
|
private _startPositioning;
|
|
338
|
+
/**
|
|
339
|
+
* A scroll does not bubble and does not leave a shadow root, so the menu listens where it
|
|
340
|
+
* happens: on every region around what it was opened for, and on the window for the page.
|
|
341
|
+
* Opened for nothing, it hears every scroll of the page on its way down from the document.
|
|
342
|
+
* @private
|
|
343
|
+
*/
|
|
344
|
+
private _listenForScroll;
|
|
259
345
|
/** @private */
|
|
260
346
|
private _stopPositioning;
|
|
261
|
-
/**
|
|
347
|
+
/**
|
|
348
|
+
* Places the panel at what the menu is open at.
|
|
349
|
+
*
|
|
350
|
+
* Not before the panel is shown: the element renders when `open` is set, before the menu has
|
|
351
|
+
* taken its place from `showAt()`, and would be placed at its own element. And one placement
|
|
352
|
+
* at a time: a placement takes a few turns, more where the panel has to try the other side,
|
|
353
|
+
* so one that was asked for first can be done last. A menu whose own element is out of view,
|
|
354
|
+
* below a long list, was taken there that way. What is asked for while the panel is being
|
|
355
|
+
* placed is placed after it, at what the menu is open at by then.
|
|
356
|
+
* @private
|
|
357
|
+
*/
|
|
262
358
|
private _position;
|
|
263
359
|
template(): any;
|
|
264
360
|
}
|
|
@@ -7,12 +7,20 @@ import { TemplateElement } from '@webtides/element-js';
|
|
|
7
7
|
* Choosing an entry is a click on it: listen for `click` on the entry, or for `menu-select` on the
|
|
8
8
|
* menu, which names the entry and its `value`.
|
|
9
9
|
*
|
|
10
|
+
* An entry can set something instead of doing something. With `type="checkbox"` it is on or off
|
|
11
|
+
* (`role="menuitemcheckbox"`), with `type="radio"` it is one of several of which one is chosen
|
|
12
|
+
* (`role="menuitemradio"`), and `checked` is its state, which it says (`aria-checked`) and shows
|
|
13
|
+
* with a mark in front of its text. The page sets `checked`: the entry does not change it when
|
|
14
|
+
* it is chosen.
|
|
15
|
+
*
|
|
10
16
|
* @element el-menu-item
|
|
11
17
|
*
|
|
12
18
|
* @slot - The text of the entry.
|
|
13
19
|
* @slot icon - An icon in front of the text: a decoration, the text is the name.
|
|
14
20
|
*
|
|
15
21
|
* @csspart base - The entry: a `<button>`, or an `<a>` with `href`.
|
|
22
|
+
* @csspart mark - The place of the mark of an entry with a `type`: a check, or a dot. It is
|
|
23
|
+
* there while the entry is not checked as well.
|
|
16
24
|
* @csspart icon - The place of the icon.
|
|
17
25
|
* @csspart label - The text of the entry.
|
|
18
26
|
*
|
|
@@ -24,6 +32,11 @@ import { TemplateElement } from '@webtides/element-js';
|
|
|
24
32
|
* `'delete'`. Default `''`.
|
|
25
33
|
* @property {boolean} disabled - Whether the entry cannot be chosen. The keyboard still gets to
|
|
26
34
|
* it. Default `false`.
|
|
35
|
+
* @property {'normal'|'checkbox'|'radio'} type - What the entry is: an action or a link
|
|
36
|
+
* (`'normal'`), an entry that is on or off (`'checkbox'`), or one of several of which one is
|
|
37
|
+
* chosen (`'radio'`). Default `'normal'`.
|
|
38
|
+
* @property {boolean} checked - Whether an entry with the `type` `checkbox` is on, or one with
|
|
39
|
+
* the `type` `radio` is the chosen one. The page sets it. Default `false`.
|
|
27
40
|
* @property {'neutral'|'brand'|'success'|'warning'|'danger'} variant - The variant of the entry:
|
|
28
41
|
* `danger` for something that cannot be undone. Default `'neutral'`. Reflected to the `variant`
|
|
29
42
|
* attribute.
|
|
@@ -36,6 +49,8 @@ export default class MenuItem extends TemplateElement {
|
|
|
36
49
|
rel: string;
|
|
37
50
|
value: string;
|
|
38
51
|
disabled: boolean;
|
|
52
|
+
type: string;
|
|
53
|
+
checked: boolean;
|
|
39
54
|
variant: string;
|
|
40
55
|
};
|
|
41
56
|
events(): {
|
|
@@ -54,6 +69,12 @@ export default class MenuItem extends TemplateElement {
|
|
|
54
69
|
* @returns {boolean}
|
|
55
70
|
*/
|
|
56
71
|
private _disabled;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the entry is checked: `checked` is there as an attribute without a value, or true.
|
|
74
|
+
* @private
|
|
75
|
+
* @returns {boolean}
|
|
76
|
+
*/
|
|
77
|
+
private _checked;
|
|
57
78
|
template(): any;
|
|
58
79
|
}
|
|
59
80
|
export declare function define(): void;
|
|
@@ -49,6 +49,10 @@ export default class OtpField extends InputField {
|
|
|
49
49
|
size: string;
|
|
50
50
|
placeholder: string;
|
|
51
51
|
pattern: boolean;
|
|
52
|
+
clearable: boolean;
|
|
53
|
+
clearLabel: string;
|
|
54
|
+
maxlength: any;
|
|
55
|
+
minlength: any;
|
|
52
56
|
enterkeyhint: any;
|
|
53
57
|
autocapitalize: any;
|
|
54
58
|
autocorrect: any;
|
|
@@ -70,6 +74,12 @@ export default class OtpField extends InputField {
|
|
|
70
74
|
click: () => void;
|
|
71
75
|
touchstart: () => void;
|
|
72
76
|
};
|
|
77
|
+
'.control': {
|
|
78
|
+
click: (event: any) => void;
|
|
79
|
+
};
|
|
80
|
+
'[data-clear]': {
|
|
81
|
+
click: () => void;
|
|
82
|
+
};
|
|
73
83
|
'[ref=input]': {
|
|
74
84
|
focus: () => void;
|
|
75
85
|
blur: () => 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);
|
|
@@ -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,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;
|
|
@@ -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>;
|
|
@@ -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;
|
|
@@ -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;
|