@refinitiv-ui/elements 5.8.0 → 5.9.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 +21 -0
- package/lib/calendar/constants.d.ts +4 -0
- package/lib/calendar/constants.js +5 -0
- package/lib/calendar/index.d.ts +106 -17
- package/lib/calendar/index.js +486 -120
- package/lib/calendar/locales.js +2 -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/calendar/types.d.ts +11 -8
- package/lib/calendar/utils.js +2 -1
- package/lib/combo-box/custom-elements.json +23 -1
- package/lib/combo-box/custom-elements.md +8 -1
- package/lib/combo-box/helpers/renderer.d.ts +8 -0
- package/lib/combo-box/helpers/renderer.js +24 -0
- package/lib/combo-box/index.d.ts +36 -16
- package/lib/combo-box/index.js +60 -32
- package/lib/combo-box/themes/halo/dark/index.js +1 -2
- package/lib/combo-box/themes/halo/light/index.js +1 -2
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -2
- package/lib/combo-box/themes/solar/pearl/index.js +1 -2
- package/lib/time-picker/custom-elements.json +2 -4
- package/lib/time-picker/custom-elements.md +3 -3
- package/lib/time-picker/index.d.ts +92 -62
- package/lib/time-picker/index.js +278 -158
- package/lib/tree-select/themes/halo/dark/index.js +1 -2
- package/lib/tree-select/themes/halo/light/index.js +1 -2
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -2
- package/lib/tree-select/themes/solar/pearl/index.js +1 -2
- package/lib/version.js +1 -1
- package/package.json +291 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.9.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.8.1...@refinitiv-ui/elements@5.9.0) (2021-12-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add named exports to elements, themes and locales to support full backward compatibility ([#114](https://github.com/Refinitiv/refinitiv-ui/issues/114)) ([7d25d50](https://github.com/Refinitiv/refinitiv-ui/commit/7d25d50c649308fc5a17d086e9e01467a0dabfb9))
|
|
12
|
+
* **calendar:** add accessibility ([#73](https://github.com/Refinitiv/refinitiv-ui/issues/73)) ([a2576cc](https://github.com/Refinitiv/refinitiv-ui/commit/a2576cc8a1f0229bb5988af0c9d0bbf8ce7f765c))
|
|
13
|
+
* **combo-box:** improve screen reader support ([#116](https://github.com/Refinitiv/refinitiv-ui/issues/116)) ([f603de1](https://github.com/Refinitiv/refinitiv-ui/commit/f603de1d3b1900875d6903477938ecd21d055531))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [5.8.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.8.0...@refinitiv-ui/elements@5.8.1) (2021-12-07)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @refinitiv-ui/elements
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
# [5.8.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.7.0...@refinitiv-ui/elements@5.8.0) (2021-12-03)
|
|
7
28
|
|
|
8
29
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { uuid } from '@refinitiv-ui/utils/lib/uuid.js';
|
|
1
2
|
export var RenderView;
|
|
2
3
|
(function (RenderView) {
|
|
3
4
|
RenderView["DAY"] = "day";
|
|
@@ -21,3 +22,7 @@ export const MONTH_VIEW = {
|
|
|
21
22
|
columnCount: 4,
|
|
22
23
|
totalCount: 4 * 4
|
|
23
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* A symbol to ensure these locales cannot be overridden
|
|
27
|
+
*/
|
|
28
|
+
export const CalendarLocaleScope = uuid();
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues, MultiValue } from '@refinitiv-ui/core';
|
|
3
3
|
import { TranslateDirective, TranslatePromise } from '@refinitiv-ui/translate';
|
|
4
|
-
import
|
|
4
|
+
import { CalendarFilter } from './types';
|
|
5
5
|
import './locales.js';
|
|
6
6
|
import '../button/index.js';
|
|
7
|
-
|
|
7
|
+
import '@refinitiv-ui/phrasebook/lib/locale/en/calendar.js';
|
|
8
|
+
export { CalendarFilter };
|
|
8
9
|
/**
|
|
9
10
|
* Standard calendar element
|
|
10
11
|
*
|
|
@@ -25,6 +26,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
25
26
|
* @returns version number
|
|
26
27
|
*/
|
|
27
28
|
static get version(): string;
|
|
29
|
+
protected readonly defaultRole: string | null;
|
|
28
30
|
/**
|
|
29
31
|
* A `CSSResultGroup` that will be used
|
|
30
32
|
* to style the host, slotted children
|
|
@@ -32,6 +34,10 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
32
34
|
* @return CSS template
|
|
33
35
|
*/
|
|
34
36
|
static get styles(): CSSResultGroup;
|
|
37
|
+
/**
|
|
38
|
+
* Reference to the view button
|
|
39
|
+
*/
|
|
40
|
+
private viewBtnRef;
|
|
35
41
|
private _min;
|
|
36
42
|
/**
|
|
37
43
|
* Set minimum date
|
|
@@ -110,25 +116,63 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
110
116
|
* Fill head and tail cell dates
|
|
111
117
|
*/
|
|
112
118
|
fillCells: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Calendar internal translation strings
|
|
121
|
+
*/
|
|
122
|
+
protected dateT: TranslateDirective;
|
|
123
|
+
protected dateTPromise: TranslatePromise;
|
|
113
124
|
/**
|
|
114
125
|
* Used for translations
|
|
115
126
|
*/
|
|
116
127
|
protected t: TranslateDirective;
|
|
117
|
-
protected tPromise: TranslatePromise;
|
|
118
128
|
/**
|
|
119
129
|
* Used for internal navigation between render views
|
|
120
130
|
*/
|
|
121
|
-
private
|
|
122
|
-
private
|
|
131
|
+
private _renderView;
|
|
132
|
+
private get renderView();
|
|
133
|
+
private set renderView(value);
|
|
123
134
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
135
|
+
* Used for keyboard navigation when trying
|
|
136
|
+
* to restore focus on re-render and control navigation
|
|
126
137
|
*/
|
|
127
|
-
private
|
|
138
|
+
private _activeCellIndex;
|
|
139
|
+
private get activeCellIndex();
|
|
140
|
+
private set activeCellIndex(value);
|
|
128
141
|
/**
|
|
129
|
-
*
|
|
142
|
+
* Silently reset cell index without calling request update
|
|
143
|
+
* @returns {void}
|
|
130
144
|
*/
|
|
131
|
-
private
|
|
145
|
+
private resetActiveCellIndex;
|
|
146
|
+
private navigationGrid;
|
|
147
|
+
/**
|
|
148
|
+
* Connected to role. If false, the values are not announced in the screen reader
|
|
149
|
+
*/
|
|
150
|
+
private announceValues;
|
|
151
|
+
/**
|
|
152
|
+
* Get an active element
|
|
153
|
+
*/
|
|
154
|
+
private get activeElement();
|
|
155
|
+
/**
|
|
156
|
+
* Get selectable date button element by index
|
|
157
|
+
* @param index Cell index
|
|
158
|
+
* @returns button HTML date button element or null
|
|
159
|
+
*/
|
|
160
|
+
private getDateButtonByIndex;
|
|
161
|
+
/**
|
|
162
|
+
* Get active date button element
|
|
163
|
+
* @returns button HTML date button element or null
|
|
164
|
+
*/
|
|
165
|
+
private get activeDateButton();
|
|
166
|
+
/**
|
|
167
|
+
* Return true if passed target is HTML
|
|
168
|
+
* date button element that can be selected
|
|
169
|
+
* @param target Target to check
|
|
170
|
+
* @returns isDateButtonElement
|
|
171
|
+
*/
|
|
172
|
+
private isDateButton;
|
|
173
|
+
private isDateAvailable;
|
|
174
|
+
static get observedAttributes(): string[];
|
|
175
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
132
176
|
/**
|
|
133
177
|
* Perform asynchronous update
|
|
134
178
|
* @returns promise
|
|
@@ -140,6 +184,12 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
140
184
|
* @returns {void}
|
|
141
185
|
*/
|
|
142
186
|
protected update(changedProperties: PropertyValues): void;
|
|
187
|
+
/**
|
|
188
|
+
* Called after render life-cycle finished
|
|
189
|
+
* @param changedProperties Properties which have changed
|
|
190
|
+
* @return {void}
|
|
191
|
+
*/
|
|
192
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
143
193
|
/**
|
|
144
194
|
* Run when an element has been first updated
|
|
145
195
|
* @param changedProperties properties that was changed on first update
|
|
@@ -198,21 +248,30 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
198
248
|
* @returns cell selection model
|
|
199
249
|
*/
|
|
200
250
|
private getCellSelection;
|
|
251
|
+
/**
|
|
252
|
+
* Set navigation map based on rows
|
|
253
|
+
* @param rows A collection of rows with cells
|
|
254
|
+
* @returns {void}
|
|
255
|
+
*/
|
|
256
|
+
private setNavigationMap;
|
|
201
257
|
/**
|
|
202
258
|
* Run when next button is tapped.
|
|
203
259
|
* Change current view to next view
|
|
260
|
+
* @param event Next view tap event
|
|
204
261
|
* @returns {void}
|
|
205
262
|
*/
|
|
206
263
|
private onNextTap;
|
|
207
264
|
/**
|
|
208
265
|
* Run when previous button is tapped.
|
|
209
266
|
* Change current view to previous view
|
|
267
|
+
* @param event Previous view tap event
|
|
210
268
|
* @returns {void}
|
|
211
269
|
*/
|
|
212
270
|
private onPreviousTap;
|
|
213
271
|
/**
|
|
214
272
|
* Run when change view button is tapped.
|
|
215
273
|
* Switch between views
|
|
274
|
+
* @param event Render view tap event
|
|
216
275
|
* @returns {void}
|
|
217
276
|
*/
|
|
218
277
|
private onRenderViewTap;
|
|
@@ -221,7 +280,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
221
280
|
* @param event Keyboard event
|
|
222
281
|
* @returns {void}
|
|
223
282
|
*/
|
|
224
|
-
private
|
|
283
|
+
private onKeyDown;
|
|
225
284
|
/**
|
|
226
285
|
* Run when tap event happens ot table.
|
|
227
286
|
* Select the values or switch the view
|
|
@@ -229,6 +288,22 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
229
288
|
* @returns {void}
|
|
230
289
|
*/
|
|
231
290
|
private onTableTap;
|
|
291
|
+
/**
|
|
292
|
+
* Navigate over the grid
|
|
293
|
+
* @param key Navigation direction
|
|
294
|
+
* @returns navigation promise
|
|
295
|
+
*/
|
|
296
|
+
private onNavigation;
|
|
297
|
+
/**
|
|
298
|
+
* Navigate to the next view
|
|
299
|
+
* @returns {void}
|
|
300
|
+
*/
|
|
301
|
+
private toNextView;
|
|
302
|
+
/**
|
|
303
|
+
* Navigate to the previous view
|
|
304
|
+
* @returns {void}
|
|
305
|
+
*/
|
|
306
|
+
private toPreviousView;
|
|
232
307
|
/**
|
|
233
308
|
* Run when tap event happened on DAY view and the cell has the values
|
|
234
309
|
* Try to select/deselect cell value
|
|
@@ -261,13 +336,11 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
261
336
|
*/
|
|
262
337
|
private get formattedViewRender();
|
|
263
338
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @
|
|
267
|
-
* @param selectable True if cell may be selected
|
|
268
|
-
* @returns template result
|
|
339
|
+
* Set an active state of the cell based
|
|
340
|
+
* @param rows A collection of rows with cells
|
|
341
|
+
* @returns {void}
|
|
269
342
|
*/
|
|
270
|
-
private
|
|
343
|
+
private setActiveCell;
|
|
271
344
|
/**
|
|
272
345
|
* Get year view template
|
|
273
346
|
*/
|
|
@@ -288,6 +361,12 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
288
361
|
* Render a view based on the current render view
|
|
289
362
|
*/
|
|
290
363
|
private get viewRender();
|
|
364
|
+
/**
|
|
365
|
+
* Get cell translate label key based on selected state
|
|
366
|
+
* @param cell Cell
|
|
367
|
+
* @returns key Translate label key
|
|
368
|
+
*/
|
|
369
|
+
private getCellLabelKey;
|
|
291
370
|
/**
|
|
292
371
|
* Render cell template. Cell can be a day, month or year
|
|
293
372
|
* @param cell Cell object
|
|
@@ -300,6 +379,16 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
300
379
|
* @returns template result
|
|
301
380
|
*/
|
|
302
381
|
private renderRows;
|
|
382
|
+
/**
|
|
383
|
+
* Render button navigation template
|
|
384
|
+
* @returns template result
|
|
385
|
+
*/
|
|
386
|
+
private get buttonNavigationTemplate();
|
|
387
|
+
/**
|
|
388
|
+
* A template used to notify currently selected value for screen readers
|
|
389
|
+
* @returns template result
|
|
390
|
+
*/
|
|
391
|
+
private get selectionTemplate();
|
|
303
392
|
/**
|
|
304
393
|
* A `TemplateResult` that will be used
|
|
305
394
|
* to render the updated internal template.
|