@refinitiv-ui/elements 6.0.1 → 6.0.2
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 +14 -0
- package/lib/accordion/index.js +2 -2
- package/lib/autosuggest/helpers/renderer.d.ts +1 -1
- package/lib/autosuggest/helpers/utils.d.ts +1 -1
- package/lib/autosuggest/index.d.ts +2 -1
- package/lib/autosuggest/themes/halo/dark/index.js +1 -1
- package/lib/autosuggest/themes/halo/light/index.js +1 -1
- package/lib/button/index.js +2 -1
- package/lib/button/themes/halo/dark/index.js +1 -1
- package/lib/button/themes/halo/light/index.js +1 -1
- package/lib/button/themes/solar/charcoal/index.js +1 -1
- package/lib/button/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/checkbox/index.d.ts +8 -15
- package/lib/checkbox/index.js +19 -41
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
- package/lib/checkbox/themes/solar/pearl/index.js +1 -1
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/combo-box/index.d.ts +4 -3
- package/lib/combo-box/index.js +7 -3
- package/lib/combo-box/themes/halo/dark/index.js +1 -1
- package/lib/combo-box/themes/halo/light/index.js +1 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
- package/lib/combo-box/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-field/index.d.ts +1 -1
- package/lib/datetime-field/utils.d.ts +1 -1
- package/lib/datetime-picker/themes/halo/dark/index.js +1 -1
- package/lib/datetime-picker/themes/halo/light/index.js +1 -1
- package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
- package/lib/email-field/themes/halo/dark/index.js +1 -1
- package/lib/email-field/themes/halo/light/index.js +1 -1
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/index.d.ts +2 -2
- package/lib/heatmap/themes/halo/light/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/item/helpers/types.d.ts +6 -6
- package/lib/item/index.d.ts +2 -2
- package/lib/item/index.js +0 -1
- package/lib/item/themes/halo/dark/index.js +1 -1
- package/lib/item/themes/halo/light/index.js +1 -1
- package/lib/list/elements/list-item.d.ts +30 -0
- package/lib/list/elements/list-item.js +19 -0
- package/lib/list/elements/list.d.ts +307 -0
- package/lib/list/elements/list.js +632 -0
- package/lib/list/helpers/renderer.d.ts +0 -1
- package/lib/list/helpers/renderer.js +1 -3
- package/lib/list/index.d.ts +3 -317
- package/lib/list/index.js +3 -641
- package/lib/list/themes/halo/dark/index.js +4 -1
- package/lib/list/themes/halo/light/index.js +5 -2
- package/lib/list/themes/solar/charcoal/index.js +4 -1
- package/lib/list/themes/solar/pearl/index.js +4 -1
- package/lib/multi-input/index.d.ts +1 -5
- package/lib/multi-input/index.js +17 -18
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.js +1 -1
- package/lib/number-field/themes/halo/dark/index.js +1 -1
- package/lib/number-field/themes/halo/light/index.js +1 -1
- package/lib/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- package/lib/overlay/index.d.ts +2 -1
- package/lib/overlay-menu/helpers/constants.d.ts +6 -0
- package/lib/overlay-menu/helpers/constants.js +7 -0
- package/lib/overlay-menu/helpers/types.d.ts +0 -6
- package/lib/overlay-menu/helpers/types.js +1 -7
- package/lib/overlay-menu/index.d.ts +1 -1
- package/lib/overlay-menu/index.js +1 -1
- package/lib/password-field/themes/halo/dark/index.js +1 -1
- package/lib/password-field/themes/halo/light/index.js +1 -1
- package/lib/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- package/lib/pill/index.d.ts +11 -3
- package/lib/pill/index.js +25 -11
- package/lib/radio-button/index.d.ts +7 -11
- package/lib/radio-button/index.js +14 -25
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/search-field/themes/halo/dark/index.js +1 -1
- package/lib/search-field/themes/halo/light/index.js +1 -1
- package/lib/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- package/lib/select/index.d.ts +13 -1
- package/lib/select/index.js +25 -7
- package/lib/select/themes/halo/dark/index.js +1 -1
- package/lib/select/themes/halo/light/index.js +1 -1
- package/lib/select/themes/solar/charcoal/index.js +1 -1
- package/lib/select/themes/solar/pearl/index.js +1 -1
- package/lib/slider/themes/halo/dark/index.js +1 -1
- package/lib/slider/themes/halo/light/index.js +1 -1
- package/lib/slider/themes/solar/charcoal/index.js +1 -1
- package/lib/slider/themes/solar/pearl/index.js +1 -1
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/index.d.ts +6 -7
- package/lib/tab-bar/index.js +12 -10
- package/lib/tab-bar/themes/halo/dark/index.js +1 -0
- package/lib/tab-bar/themes/halo/light/index.js +1 -0
- package/lib/tab-bar/themes/solar/charcoal/index.js +1 -0
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -0
- package/lib/text-field/index.js +2 -3
- package/lib/text-field/themes/halo/dark/index.js +1 -1
- package/lib/text-field/themes/halo/light/index.js +1 -1
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/toggle/index.d.ts +7 -10
- package/lib/toggle/index.js +14 -24
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +11 -4
- package/lib/tooltip/helpers/overflow-tooltip.js +34 -6
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/index.js +2 -2
- package/lib/tree/elements/tree-item.d.ts +4 -0
- package/lib/tree/elements/tree-item.js +4 -0
- package/lib/tree/elements/tree.d.ts +1 -0
- package/lib/tree/elements/tree.js +1 -0
- package/lib/tree/helpers/renderer.d.ts +0 -1
- package/lib/tree/helpers/renderer.js +0 -2
- package/lib/tree/index.d.ts +2 -1
- package/lib/tree/themes/halo/dark/index.js +2 -2
- package/lib/tree/themes/halo/light/index.js +3 -3
- package/lib/tree/themes/solar/charcoal/index.js +2 -2
- package/lib/tree/themes/solar/pearl/index.js +2 -2
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { JSXInterface } from '../../jsx';
|
|
2
|
+
import { ControlElement, CSSResultGroup, PropertyValues, TapEvent, TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
+
import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/collection.js';
|
|
4
|
+
import type { ItemData } from '../../item';
|
|
5
|
+
import type { ListData } from '../helpers/types';
|
|
6
|
+
import { ListRenderer } from '../helpers/renderer.js';
|
|
7
|
+
import './list-item.js';
|
|
8
|
+
/**
|
|
9
|
+
* Key direction
|
|
10
|
+
*/
|
|
11
|
+
declare enum Direction {
|
|
12
|
+
UP = -1,
|
|
13
|
+
DOWN = 1
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Provides listing and immutable selection
|
|
17
|
+
* @fires value-changed - Dispatched when value changes
|
|
18
|
+
*/
|
|
19
|
+
export declare class List<T extends DataItem = ItemData> extends ControlElement {
|
|
20
|
+
/**
|
|
21
|
+
* Element version number
|
|
22
|
+
* @returns version number
|
|
23
|
+
*/
|
|
24
|
+
static get version(): string;
|
|
25
|
+
protected readonly defaultRole: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Used to timestamp renders.
|
|
28
|
+
* This enables diff checking against item updates,
|
|
29
|
+
* rendering only items which have updated since the last render cycle.
|
|
30
|
+
*/
|
|
31
|
+
private renderTimestamp;
|
|
32
|
+
/**
|
|
33
|
+
* Requests an update after a composer modification.
|
|
34
|
+
* @returns Update promise.
|
|
35
|
+
*/
|
|
36
|
+
private modificationUpdate;
|
|
37
|
+
/**
|
|
38
|
+
* Item map; used to link element nodes to data items.
|
|
39
|
+
*/
|
|
40
|
+
private itemMap;
|
|
41
|
+
/**
|
|
42
|
+
* Element map; used to link data items to element nodes.
|
|
43
|
+
*/
|
|
44
|
+
private elementMap;
|
|
45
|
+
/**
|
|
46
|
+
* Composer used to query and modify item state.
|
|
47
|
+
*/
|
|
48
|
+
protected composer: CollectionComposer<T>;
|
|
49
|
+
/**
|
|
50
|
+
* Element focus delegation.
|
|
51
|
+
* Set to `false` and relies on native focusing.
|
|
52
|
+
*/
|
|
53
|
+
readonly delegatesFocus = false;
|
|
54
|
+
/**
|
|
55
|
+
* Renderer used to render list item elements
|
|
56
|
+
* @type {ListRenderer}
|
|
57
|
+
*/
|
|
58
|
+
renderer: ListRenderer;
|
|
59
|
+
/**
|
|
60
|
+
* Disable selections
|
|
61
|
+
*/
|
|
62
|
+
stateless: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Allow multiple selections
|
|
65
|
+
*/
|
|
66
|
+
multiple: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The data object, used to render the list.
|
|
69
|
+
* @type {ListData}
|
|
70
|
+
* @default null
|
|
71
|
+
*/
|
|
72
|
+
get data(): ListData<T>;
|
|
73
|
+
set data(value: ListData<T>);
|
|
74
|
+
private _data;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the first selected item value.
|
|
77
|
+
* Use `values` when multiple selection mode is enabled.
|
|
78
|
+
* @default -
|
|
79
|
+
*/
|
|
80
|
+
get value(): string;
|
|
81
|
+
set value(value: string);
|
|
82
|
+
/**
|
|
83
|
+
* Returns a values collection of the currently
|
|
84
|
+
* selected item values
|
|
85
|
+
* @type {string[]}
|
|
86
|
+
* @default []
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
89
|
+
get values(): string[];
|
|
90
|
+
set values(values: string[]);
|
|
91
|
+
/**
|
|
92
|
+
* Selects an item in the list
|
|
93
|
+
* @param item Data Item or Item Element
|
|
94
|
+
* @returns If a selection has been made or not
|
|
95
|
+
*/
|
|
96
|
+
selectItem(item?: T | HTMLElement): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Navigate up through the list items
|
|
99
|
+
* @returns {void}
|
|
100
|
+
*/
|
|
101
|
+
up(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Navigate down through the list items
|
|
104
|
+
* @returns {void}
|
|
105
|
+
*/
|
|
106
|
+
down(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Navigate to first focusable item of the list
|
|
109
|
+
* @returns {void}
|
|
110
|
+
*/
|
|
111
|
+
first(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Navigate to first focusable item of the list
|
|
114
|
+
* @returns {void}
|
|
115
|
+
*/
|
|
116
|
+
last(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Proxy for querying the composer
|
|
119
|
+
* @param engine composer querying engine
|
|
120
|
+
* @returns Collection of queried items
|
|
121
|
+
*/
|
|
122
|
+
protected queryItems(engine: (item: T, composer: CollectionComposer<T>) => boolean): readonly T[];
|
|
123
|
+
/**
|
|
124
|
+
* Proxy for querying the composer by property and value
|
|
125
|
+
* @param name Property name
|
|
126
|
+
* @param value Property value
|
|
127
|
+
* @returns Collection of queried items
|
|
128
|
+
*/
|
|
129
|
+
protected queryItemsByPropertyValue<K extends keyof T>(name: K, value: T[K]): readonly T[];
|
|
130
|
+
/**
|
|
131
|
+
* Gets the associated element for the data item provided,
|
|
132
|
+
* if there is one available.
|
|
133
|
+
* @param item Item to map element to
|
|
134
|
+
* @returns Associated element
|
|
135
|
+
*/
|
|
136
|
+
protected elementFromItem(item: T): HTMLElement | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Gets the associated data item for the provided element,
|
|
139
|
+
* if there is one available.
|
|
140
|
+
* @param element Element to map item to
|
|
141
|
+
* @returns Associated date item
|
|
142
|
+
*/
|
|
143
|
+
protected itemFromElement(element: HTMLElement): T | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Tries to find the next focusable element.
|
|
146
|
+
* @param direction Direction to search
|
|
147
|
+
* @param element Starting element
|
|
148
|
+
* @returns Next logical element to focus
|
|
149
|
+
*/
|
|
150
|
+
protected getNextFocusableItem(direction: Direction, element?: HTMLElement): HTMLElement | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Tries to find the next highlight item
|
|
153
|
+
* @param direction Direction to search
|
|
154
|
+
* @returns A data item, if found.
|
|
155
|
+
*/
|
|
156
|
+
protected getNextHighlightItem(direction: Direction): T | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Clears any highlighted item
|
|
159
|
+
* @returns {void}
|
|
160
|
+
*/
|
|
161
|
+
protected clearHighlighted(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Highlights a single item.
|
|
164
|
+
* Used for navigation.
|
|
165
|
+
* @param item Item to highlight
|
|
166
|
+
* @param scrollToItem Scroll the item into view?
|
|
167
|
+
* @returns {void}
|
|
168
|
+
*/
|
|
169
|
+
protected highlightItem(item?: T, scrollToItem?: boolean): void;
|
|
170
|
+
/**
|
|
171
|
+
* Gets the available tabbable elements
|
|
172
|
+
*/
|
|
173
|
+
protected get tabbableItems(): HTMLElement[];
|
|
174
|
+
/**
|
|
175
|
+
* Returns the current focused element
|
|
176
|
+
*/
|
|
177
|
+
protected get highlightElement(): HTMLElement | null;
|
|
178
|
+
/**
|
|
179
|
+
* Tries to select the current highlighted element
|
|
180
|
+
* @returns {void}
|
|
181
|
+
*/
|
|
182
|
+
protected triggerActiveItem(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Scroll to list item element
|
|
185
|
+
* @param item Data item to scroll to
|
|
186
|
+
* @returns {void}
|
|
187
|
+
*/
|
|
188
|
+
scrollToItem(item: T): void;
|
|
189
|
+
/**
|
|
190
|
+
* Handles key input
|
|
191
|
+
* @param event Key down event object
|
|
192
|
+
* @returns {void}
|
|
193
|
+
*/
|
|
194
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
195
|
+
/**
|
|
196
|
+
* Handle list on tap
|
|
197
|
+
* Typically it will select an item
|
|
198
|
+
* @param event Event to handle
|
|
199
|
+
* @returns {void}
|
|
200
|
+
*/
|
|
201
|
+
protected onTap(event: TapEvent): void;
|
|
202
|
+
/**
|
|
203
|
+
* Handles mouse move
|
|
204
|
+
* Typically it will highlight an item
|
|
205
|
+
* @param event Event to handle
|
|
206
|
+
* @returns {void}
|
|
207
|
+
*/
|
|
208
|
+
protected onMouse(event: Event): void;
|
|
209
|
+
/**
|
|
210
|
+
* Handles item focus out
|
|
211
|
+
* Typically it will remove highlighting
|
|
212
|
+
* @returns {void}
|
|
213
|
+
*/
|
|
214
|
+
protected onBlur(): void;
|
|
215
|
+
/**
|
|
216
|
+
* Tries to find a known item element,
|
|
217
|
+
* from an event target
|
|
218
|
+
* @param target Event target
|
|
219
|
+
* @returns Found element, if available
|
|
220
|
+
*/
|
|
221
|
+
protected findItemElementFromTarget(target: EventTarget | HTMLElement | null): HTMLElement | null;
|
|
222
|
+
/**
|
|
223
|
+
* Clears the current selected items
|
|
224
|
+
* @returns {void}
|
|
225
|
+
*/
|
|
226
|
+
protected clearSelection(): void;
|
|
227
|
+
/**
|
|
228
|
+
* Queries and returns all renderable items.
|
|
229
|
+
* @returns Collection of renderable items
|
|
230
|
+
*/
|
|
231
|
+
protected get renderItems(): readonly T[];
|
|
232
|
+
/**
|
|
233
|
+
* Proxy for creating list item elements.
|
|
234
|
+
* Allows for a mapping to be created between
|
|
235
|
+
* Data Item and Item Element.
|
|
236
|
+
* @param item Data item context
|
|
237
|
+
* @param recyclableElements Child elements available for reuse
|
|
238
|
+
* @returns List item element
|
|
239
|
+
*/
|
|
240
|
+
private createListItem;
|
|
241
|
+
/**
|
|
242
|
+
* Clears all item-element and timestamp maps
|
|
243
|
+
* @returns {void}
|
|
244
|
+
*/
|
|
245
|
+
private clearMaps;
|
|
246
|
+
/**
|
|
247
|
+
* Fire value changed event
|
|
248
|
+
* @returns {void}
|
|
249
|
+
*/
|
|
250
|
+
private fireSelectionUpdate;
|
|
251
|
+
/**
|
|
252
|
+
* Calculates what elements can be recycled safely
|
|
253
|
+
* @param renderItems Current items to render
|
|
254
|
+
* @returns Collection of elements to be recycled
|
|
255
|
+
*/
|
|
256
|
+
private calculateRecyclableElements;
|
|
257
|
+
/**
|
|
258
|
+
* Renders updates to light DOM
|
|
259
|
+
* @returns {void}
|
|
260
|
+
*/
|
|
261
|
+
protected renderLightDOM(): void;
|
|
262
|
+
/**
|
|
263
|
+
* Invoked when the element is first updated. Implement to perform one time work on the element after update.
|
|
264
|
+
* @param changeProperties changed properties
|
|
265
|
+
* @returns {void}
|
|
266
|
+
*/
|
|
267
|
+
protected firstUpdated(changeProperties: PropertyValues): void;
|
|
268
|
+
/**
|
|
269
|
+
* Invoked before update() to compute values needed during the update.
|
|
270
|
+
* @param changeProperties changed properties
|
|
271
|
+
* @returns {void}
|
|
272
|
+
*/
|
|
273
|
+
protected willUpdate(changeProperties: PropertyValues): void;
|
|
274
|
+
/**
|
|
275
|
+
* A `CSSResultGroup` that will be used
|
|
276
|
+
* to style the host, slotted children
|
|
277
|
+
* and the internal template of the element.
|
|
278
|
+
* @return CSS template
|
|
279
|
+
*/
|
|
280
|
+
static get styles(): CSSResultGroup;
|
|
281
|
+
/**
|
|
282
|
+
* A `TemplateResult` that will be used
|
|
283
|
+
* to render the updated internal template.
|
|
284
|
+
* @return Render template
|
|
285
|
+
*/
|
|
286
|
+
protected render(): TemplateResult;
|
|
287
|
+
}
|
|
288
|
+
declare global {
|
|
289
|
+
interface HTMLElementTagNameMap {
|
|
290
|
+
'ef-list': List;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
export {};
|
|
294
|
+
|
|
295
|
+
declare global {
|
|
296
|
+
interface HTMLElementTagNameMap {
|
|
297
|
+
'ef-list': List;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
namespace JSX {
|
|
301
|
+
interface IntrinsicElements {
|
|
302
|
+
'ef-list': Partial<List> | JSXInterface.HTMLAttributes<List>;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export {};
|