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