@refinitiv-ui/elements 6.11.0 → 6.12.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 +11 -0
- package/LICENSE +1 -1
- package/README.md +5 -5
- package/lib/combo-box/index.js +2 -0
- package/lib/slider/custom-elements.json +1 -1
- package/lib/slider/custom-elements.md +1 -1
- package/lib/slider/index.d.ts +6 -1
- package/lib/slider/index.js +14 -2
- package/lib/tree/elements/tree.js +4 -4
- package/lib/tree/managers/tree-manager.d.ts +8 -0
- package/lib/tree/managers/tree-manager.js +19 -1
- package/lib/tree-select/index.d.ts +12 -3
- package/lib/tree-select/index.js +54 -18
- package/lib/version.js +1 -1
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [6.12.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.11.0...@refinitiv-ui/elements@6.12.0) (2023-09-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **slider:** incorrect updating to value ([#947](https://github.com/Refinitiv/refinitiv-ui/issues/947)) ([f883987](https://github.com/Refinitiv/refinitiv-ui/commit/f883987482cf91c7b6b687c9c67d733bf7a9e4d3))
|
|
11
|
+
- **slider:** number field not revalidate when error state changes ([#953](https://github.com/Refinitiv/refinitiv-ui/issues/953)) ([d4b952e](https://github.com/Refinitiv/refinitiv-ui/commit/d4b952e9d376b0e751584afc6de7a5527dbc11c3))
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **utils:** add `selectedAt` property to `DataItem` interface ([181066b](https://github.com/Refinitiv/refinitiv-ui/commit/181066bad6842f0b06d0607150d3d633bf89f0e7))
|
|
16
|
+
|
|
6
17
|
# [6.11.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.10.2...@refinitiv-ui/elements@6.11.0) (2023-09-11)
|
|
7
18
|
|
|
8
19
|
### Features
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Element Framework
|
|
2
2
|
|
|
3
|
-
Element Framework (EF) is a collection of elements that includes theming capability within the
|
|
3
|
+
Element Framework (EF) is a collection of elements that includes theming capability within the LSEG Workspace's design system. The elements are a set of web components which is a standard web technology and can be utilized across all browsers.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -10,17 +10,17 @@ EF elements are published under single package.
|
|
|
10
10
|
npm install @refinitiv-ui/elements
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The elements are required theme to instantiate itself in the app.
|
|
13
|
+
The elements are required theme to instantiate itself in the app. LSEG Workspace's design system is called Halo theme and you can install it from npm command.
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
npm install @refinitiv-ui/halo-theme
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Finally, import both elements that you want to use and its themes into your application and it is ready to go. To follow
|
|
19
|
+
Finally, import both elements that you want to use and its themes into your application and it is ready to go. To follow LSEG Workspace's design system, it is required styles of some native elements e.g. typography.
|
|
20
20
|
|
|
21
21
|
<br>
|
|
22
22
|
|
|
23
|
-
> The font "Proxima Nova Fin" shall only be used within
|
|
23
|
+
> The font "Proxima Nova Fin" shall only be used within LSEG products or services. The copyright owner must approve any use of such font outside of LSEG products or services, which may be subject to a fee. Please see https://www.fontspring.com/lic/fontspring/webfont#license_text
|
|
24
24
|
|
|
25
25
|
<br>
|
|
26
26
|
|
|
@@ -57,4 +57,4 @@ See list of elements, demo and more tutorial by visiting [EF Documentation](http
|
|
|
57
57
|
|
|
58
58
|
# License
|
|
59
59
|
|
|
60
|
-
Apache License 2.0. However, Halo theme shall only be used within
|
|
60
|
+
Apache License 2.0. However, Halo theme shall only be used within LSEG products or services due to license of the font "Proxima Nova Fin".
|
package/lib/combo-box/index.js
CHANGED
|
@@ -288,9 +288,11 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
288
288
|
* @returns {void}
|
|
289
289
|
*/
|
|
290
290
|
updateComposerValues(newValues) {
|
|
291
|
+
const selectedAt = Date.now();
|
|
291
292
|
this.queryItems((item, composer) => {
|
|
292
293
|
if (newValues.includes(composer.getItemPropertyValue(item, 'value'))) {
|
|
293
294
|
composer.setItemPropertyValue(item, 'selected', true);
|
|
295
|
+
composer.setItemPropertyValue(item, 'selectedAt', selectedAt + newValues.indexOf(item.value ?? '')); // Sequential selection
|
|
294
296
|
return true;
|
|
295
297
|
}
|
|
296
298
|
composer.setItemPropertyValue(item, 'selected', false);
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"name": "input",
|
|
180
|
-
"description": "Fired when the user inputs a value by interacting with the slider or updating its input field."
|
|
180
|
+
"description": "Fired with the value of the input in `e.detail.value` like another custom events when the user inputs a value by interacting with the slider or updating its input field."
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"name": "from-input",
|
|
@@ -25,7 +25,7 @@ Allows users to make selections from a range of values
|
|
|
25
25
|
|-----------------|--------------------------------------------------|
|
|
26
26
|
| `from-changed` | Fired when the user changes from's value. The event is not triggered if `from` property is changed programmatically. |
|
|
27
27
|
| `from-input` | Fired when the user inputs from's value by interacting with the slider or updating its input field. |
|
|
28
|
-
| `input` | Fired when the user inputs a value by interacting with the slider or updating its input field. |
|
|
28
|
+
| `input` | Fired with the value of the input in `e.detail.value` like another custom events when the user inputs a value by interacting with the slider or updating its input field. |
|
|
29
29
|
| `to-changed` | Fired when the user changes to's value. The event is not triggered if `to` property is changed programmatically. |
|
|
30
30
|
| `to-input` | Fired when the user inputs to's value by interacting with the slider or updating its input field. |
|
|
31
31
|
| `value-changed` | Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically. |
|
package/lib/slider/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import '../number-field/index.js';
|
|
|
18
18
|
* @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
19
19
|
* @fires from-changed - Fired when the user changes from's value. The event is not triggered if `from` property is changed programmatically.
|
|
20
20
|
* @fires to-changed - Fired when the user changes to's value. The event is not triggered if `to` property is changed programmatically.
|
|
21
|
-
* @fires input - Fired when the user inputs a value by interacting with the slider or updating its input field.
|
|
21
|
+
* @fires input - Fired with the value of the input in `e.detail.value` like another custom events when the user inputs a value by interacting with the slider or updating its input field.
|
|
22
22
|
* @fires from-input - Fired when the user inputs from's value by interacting with the slider or updating its input field.
|
|
23
23
|
* @fires to-input - Fired when the user inputs to's value by interacting with the slider or updating its input field.
|
|
24
24
|
*/
|
|
@@ -341,6 +341,11 @@ export declare class Slider extends ControlElement {
|
|
|
341
341
|
* @returns validated to value.
|
|
342
342
|
*/
|
|
343
343
|
private validateTo;
|
|
344
|
+
/**
|
|
345
|
+
* Validate number field from changed thumb
|
|
346
|
+
* @returns {void}
|
|
347
|
+
*/
|
|
348
|
+
private validateNumberField;
|
|
344
349
|
/**
|
|
345
350
|
* Calculate the nearest possible step value depending on step interval
|
|
346
351
|
* @param thumbPosition current thumb position in fraction
|
package/lib/slider/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { clamp, countDecimalPlace, isDecimalNumber, preventDefault } from './uti
|
|
|
27
27
|
* @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
28
28
|
* @fires from-changed - Fired when the user changes from's value. The event is not triggered if `from` property is changed programmatically.
|
|
29
29
|
* @fires to-changed - Fired when the user changes to's value. The event is not triggered if `to` property is changed programmatically.
|
|
30
|
-
* @fires input - Fired when the user inputs a value by interacting with the slider or updating its input field.
|
|
30
|
+
* @fires input - Fired with the value of the input in `e.detail.value` like another custom events when the user inputs a value by interacting with the slider or updating its input field.
|
|
31
31
|
* @fires from-input - Fired when the user inputs from's value by interacting with the slider or updating its input field.
|
|
32
32
|
* @fires to-input - Fired when the user inputs to's value by interacting with the slider or updating its input field.
|
|
33
33
|
*/
|
|
@@ -766,6 +766,7 @@ let Slider = class Slider extends ControlElement {
|
|
|
766
766
|
this.valuePreviousInput = this.value;
|
|
767
767
|
}
|
|
768
768
|
this.onDrag(event);
|
|
769
|
+
this.validateNumberField();
|
|
769
770
|
if (event.changedTouches) {
|
|
770
771
|
this.addEventListener('touchmove', this.onDrag);
|
|
771
772
|
this.addEventListener('touchend', this.onDragEnd);
|
|
@@ -859,6 +860,17 @@ let Slider = class Slider extends ControlElement {
|
|
|
859
860
|
}
|
|
860
861
|
return this.fromNumber + this.minRangeNumber;
|
|
861
862
|
}
|
|
863
|
+
/**
|
|
864
|
+
* Validate number field from changed thumb
|
|
865
|
+
* @returns {void}
|
|
866
|
+
*/
|
|
867
|
+
validateNumberField() {
|
|
868
|
+
if (this.isShowInputField) {
|
|
869
|
+
const name = this.changedThumb?.getAttribute('name');
|
|
870
|
+
const numberField = this[`${name}Input`];
|
|
871
|
+
requestAnimationFrame(() => numberField.reportValidity());
|
|
872
|
+
}
|
|
873
|
+
}
|
|
862
874
|
/**
|
|
863
875
|
* Calculate the nearest possible step value depending on step interval
|
|
864
876
|
* @param thumbPosition current thumb position in fraction
|
|
@@ -1000,7 +1012,7 @@ let Slider = class Slider extends ControlElement {
|
|
|
1000
1012
|
if (valueFor === SliderDataName.to && value < this.fromNumber + this.minRangeNumber) {
|
|
1001
1013
|
return false;
|
|
1002
1014
|
}
|
|
1003
|
-
else if (value > this.toNumber - this.minRangeNumber) {
|
|
1015
|
+
else if (valueFor === SliderDataName.from && value > this.toNumber - this.minRangeNumber) {
|
|
1004
1016
|
return false;
|
|
1005
1017
|
}
|
|
1006
1018
|
}
|
|
@@ -376,7 +376,7 @@ let Tree = class Tree extends List {
|
|
|
376
376
|
*/
|
|
377
377
|
get values() {
|
|
378
378
|
return this.manager.checkedItems.map((item) => {
|
|
379
|
-
return this.composer.getItemPropertyValue(item, 'value')
|
|
379
|
+
return this.composer.getItemPropertyValue(item, 'value') ?? '';
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
set values(values) {
|
|
@@ -386,9 +386,9 @@ let Tree = class Tree extends List {
|
|
|
386
386
|
}
|
|
387
387
|
else {
|
|
388
388
|
// Clone value arrays
|
|
389
|
-
const newValue = [...values]
|
|
390
|
-
const oldValue = [...this.values]
|
|
391
|
-
if (newValue !== oldValue) {
|
|
389
|
+
const newValue = [...values];
|
|
390
|
+
const oldValue = [...this.values];
|
|
391
|
+
if (newValue.toString() !== oldValue.toString()) {
|
|
392
392
|
this.manager.uncheckAllItems();
|
|
393
393
|
values.some((value) => {
|
|
394
394
|
this.queryItemsByPropertyValue('value', value).forEach((item) => {
|
|
@@ -24,6 +24,10 @@ export declare class TreeManager<T extends TreeDataItem> {
|
|
|
24
24
|
* Mode (algorithm) the tree manage is using
|
|
25
25
|
*/
|
|
26
26
|
private mode;
|
|
27
|
+
/**
|
|
28
|
+
* Last selected item timestamp
|
|
29
|
+
*/
|
|
30
|
+
private lastSelectedAt?;
|
|
27
31
|
constructor(composer: CollectionComposer<T>, mode?: TreeManagerMode);
|
|
28
32
|
/**
|
|
29
33
|
* Is the manager maintaining parent/child relationships
|
|
@@ -42,6 +46,10 @@ export declare class TreeManager<T extends TreeDataItem> {
|
|
|
42
46
|
* When managing relationships, this excludes groups/parents from the result.
|
|
43
47
|
*/
|
|
44
48
|
get checkedItems(): readonly T[];
|
|
49
|
+
/**
|
|
50
|
+
* Compare items function order by sequential selected timestamp
|
|
51
|
+
*/
|
|
52
|
+
protected get orderBySelectedAt(): (itemA: T, itemB: T) => number;
|
|
45
53
|
/**
|
|
46
54
|
* Items which should be visibly displayed.
|
|
47
55
|
* This can be used to render items.
|
|
@@ -47,12 +47,24 @@ export class TreeManager {
|
|
|
47
47
|
* When managing relationships, this excludes groups/parents from the result.
|
|
48
48
|
*/
|
|
49
49
|
get checkedItems() {
|
|
50
|
-
|
|
50
|
+
const items = this.composer.queryItems((item) => {
|
|
51
51
|
if (this.manageRelationships && this.isItemParent(item)) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
return this.isItemChecked(item);
|
|
55
55
|
}, Infinity);
|
|
56
|
+
return Object.freeze(items.slice().sort(this.orderBySelectedAt));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Compare items function order by sequential selected timestamp
|
|
60
|
+
*/
|
|
61
|
+
get orderBySelectedAt() {
|
|
62
|
+
// Order by sequential selected timestamp
|
|
63
|
+
return (itemA, itemB) => {
|
|
64
|
+
const timeA = this.composer.getItemPropertyValue(itemA, 'selectedAt') ?? 0;
|
|
65
|
+
const timeB = this.composer.getItemPropertyValue(itemB, 'selectedAt') ?? 0;
|
|
66
|
+
return timeA - timeB;
|
|
67
|
+
};
|
|
56
68
|
}
|
|
57
69
|
/**
|
|
58
70
|
* Items which should be visibly displayed.
|
|
@@ -341,7 +353,13 @@ export class TreeManager {
|
|
|
341
353
|
}
|
|
342
354
|
_checkItem(item, manageRelationships = this.manageRelationships) {
|
|
343
355
|
if (this.canCheckItem(item)) {
|
|
356
|
+
// Create unique timestamp base on the latest selection for sequential selection.
|
|
357
|
+
const timestamp = Date.now();
|
|
358
|
+
this.lastSelectedAt =
|
|
359
|
+
this.lastSelectedAt && this.lastSelectedAt >= timestamp ? this.lastSelectedAt + 1 : timestamp;
|
|
360
|
+
// Set item selected with timestamp
|
|
344
361
|
this.composer.setItemPropertyValue(item, 'selected', true);
|
|
362
|
+
this.composer.setItemPropertyValue(item, 'selectedAt', this.lastSelectedAt);
|
|
345
363
|
if (manageRelationships) {
|
|
346
364
|
this.forceUpdateOnPath(item);
|
|
347
365
|
this.getItemDescendants(item).forEach((descendant) => this._checkItem(descendant, false));
|
|
@@ -59,7 +59,11 @@ export declare class TreeSelect extends ComboBox<TreeSelectDataItem> {
|
|
|
59
59
|
/**
|
|
60
60
|
* Extracted values from {@link this.checkedGroupedItems}
|
|
61
61
|
*/
|
|
62
|
-
protected pillsData: TreeSelectDataItem[]
|
|
62
|
+
protected pillsData: Readonly<TreeSelectDataItem[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Cache old selection timestamps for revert selected timestamps when cancel selection
|
|
65
|
+
*/
|
|
66
|
+
protected oldSelection: Map<string, number | undefined>;
|
|
63
67
|
/**
|
|
64
68
|
* Are there pills visible
|
|
65
69
|
*/
|
|
@@ -207,10 +211,15 @@ export declare class TreeSelect extends ComboBox<TreeSelectDataItem> {
|
|
|
207
211
|
*/
|
|
208
212
|
protected persistSelection(): void;
|
|
209
213
|
/**
|
|
210
|
-
*
|
|
214
|
+
* Revert modified selection to old values. Run on Esc or Cancel
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*/
|
|
217
|
+
protected revertModifiedSelection(): void;
|
|
218
|
+
/**
|
|
219
|
+
* Revert all selected timestamps to the previous state which affect to item sorting
|
|
211
220
|
* @returns {void}
|
|
212
221
|
*/
|
|
213
|
-
protected
|
|
222
|
+
protected revertSelectionTimestamps(): void;
|
|
214
223
|
/**
|
|
215
224
|
* Update memoized track
|
|
216
225
|
*
|
package/lib/tree-select/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { css, html, nothing, triggerResize } from '@refinitiv-ui/core';
|
|
2
|
+
import { WarningNotice, css, html, nothing, triggerResize } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
@@ -21,6 +21,7 @@ import { VERSION } from '../version.js';
|
|
|
21
21
|
export { TreeSelectRenderer };
|
|
22
22
|
const MEMO_THROTTLE = 16;
|
|
23
23
|
const POPUP_POSITION = ['bottom-start', 'top-start'];
|
|
24
|
+
const valueFormatWarning = new WarningNotice("The specified 'values' format does not conform to the required format.");
|
|
24
25
|
/**
|
|
25
26
|
* Dropdown control that allows selection from the tree list
|
|
26
27
|
*
|
|
@@ -65,6 +66,10 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
65
66
|
* Extracted values from {@link this.checkedGroupedItems}
|
|
66
67
|
*/
|
|
67
68
|
this.pillsData = [];
|
|
69
|
+
/**
|
|
70
|
+
* Cache old selection timestamps for revert selected timestamps when cancel selection
|
|
71
|
+
*/
|
|
72
|
+
this.oldSelection = new Map();
|
|
68
73
|
/**
|
|
69
74
|
* Are there pills visible
|
|
70
75
|
*/
|
|
@@ -165,8 +170,26 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
165
170
|
return this._values;
|
|
166
171
|
}
|
|
167
172
|
set values(values) {
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
if (!Array.isArray(values)) {
|
|
174
|
+
valueFormatWarning.show();
|
|
175
|
+
this.values = [];
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
// Update the selection state when found new value
|
|
179
|
+
const newValues = values.slice(0, this.multiple ? values.length : 1);
|
|
180
|
+
const oldValues = this.values.slice();
|
|
181
|
+
if (newValues.toString() !== oldValues.toString()) {
|
|
182
|
+
this._values = values;
|
|
183
|
+
this.updateComposerValues(values);
|
|
184
|
+
this.updatePills();
|
|
185
|
+
if (this.freeText) {
|
|
186
|
+
// free text mode is only supported in single selection mode
|
|
187
|
+
// so if there is no valid selection in the composer, we can assume
|
|
188
|
+
// the first item can be used as the free text item.
|
|
189
|
+
this.freeTextValue = !this.composerValues.length ? newValues[0] : '';
|
|
190
|
+
}
|
|
191
|
+
this.requestUpdate('values', oldValues);
|
|
192
|
+
}
|
|
170
193
|
}
|
|
171
194
|
/**
|
|
172
195
|
* Set maximum number of selected items
|
|
@@ -228,7 +251,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
228
251
|
* @override
|
|
229
252
|
*/
|
|
230
253
|
get selectedLabels() {
|
|
231
|
-
return this.checkedGroupedItems.map((selected) => this.getItemPropertyValue(selected, 'label')
|
|
254
|
+
return this.checkedGroupedItems.map((selected) => this.getItemPropertyValue(selected, 'label') ?? '');
|
|
232
255
|
}
|
|
233
256
|
/**
|
|
234
257
|
* Returns memoized selected state
|
|
@@ -332,29 +355,37 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
332
355
|
* @returns {void}
|
|
333
356
|
*/
|
|
334
357
|
persistSelection() {
|
|
335
|
-
const oldValues = this.values
|
|
358
|
+
const oldValues = this.values;
|
|
336
359
|
const newValues = this.composerValues;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
if (oldComparison !== newComparison) {
|
|
360
|
+
if (oldValues.toString() !== newValues.toString()) {
|
|
361
|
+
// Set new values order by sequential selection
|
|
340
362
|
this.values = newValues;
|
|
341
363
|
this.notifyPropertyChange('value', this.value);
|
|
342
364
|
}
|
|
343
365
|
}
|
|
344
366
|
/**
|
|
345
|
-
*
|
|
367
|
+
* Revert modified selection to old values. Run on Esc or Cancel
|
|
346
368
|
* @returns {void}
|
|
347
369
|
*/
|
|
348
|
-
|
|
349
|
-
const oldValues = this.values
|
|
370
|
+
revertModifiedSelection() {
|
|
371
|
+
const oldValues = this.values;
|
|
350
372
|
const newValues = this.composerValues;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
// revert selected item by updating the collection composer
|
|
355
|
-
this.updateComposerValues(this._values);
|
|
373
|
+
if (oldValues.toString() !== newValues.toString()) {
|
|
374
|
+
// Revert selected item by updating the collection composer
|
|
375
|
+
this.updateComposerValues(oldValues);
|
|
356
376
|
}
|
|
357
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Revert all selected timestamps to the previous state which affect to item sorting
|
|
380
|
+
* @returns {void}
|
|
381
|
+
*/
|
|
382
|
+
revertSelectionTimestamps() {
|
|
383
|
+
this.selection.forEach((item) => {
|
|
384
|
+
const oldSelectedAt = this.oldSelection.get(item.value);
|
|
385
|
+
this.composer.setItemPropertyValue(item, 'selectedAt', oldSelectedAt);
|
|
386
|
+
});
|
|
387
|
+
this.oldSelection.clear(); // Clear cache old selection
|
|
388
|
+
}
|
|
358
389
|
/**
|
|
359
390
|
* Update memoized track
|
|
360
391
|
*
|
|
@@ -419,6 +450,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
419
450
|
const event = new CustomEvent('cancel');
|
|
420
451
|
this.dispatchEvent(event);
|
|
421
452
|
if (!event.defaultPrevented) {
|
|
453
|
+
this.revertSelectionTimestamps();
|
|
422
454
|
this.closeAndReset();
|
|
423
455
|
// reset always happens on popup close action
|
|
424
456
|
}
|
|
@@ -487,6 +519,10 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
487
519
|
onPopupOpened() {
|
|
488
520
|
super.onPopupOpened();
|
|
489
521
|
this.clearSelectionFilter();
|
|
522
|
+
// Cache current selection timestamps for reverting modified selection when user cancel
|
|
523
|
+
this.selection.forEach((item) => {
|
|
524
|
+
this.oldSelection.set(item.value, this.getItemPropertyValue(item, 'selectedAt'));
|
|
525
|
+
});
|
|
490
526
|
this.updatePills();
|
|
491
527
|
this.updateMemo();
|
|
492
528
|
}
|
|
@@ -504,7 +540,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
504
540
|
onPopupClosed() {
|
|
505
541
|
super.onPopupClosed();
|
|
506
542
|
this.updateMemo();
|
|
507
|
-
this.
|
|
543
|
+
this.revertModifiedSelection();
|
|
508
544
|
this.exitEditSelection();
|
|
509
545
|
}
|
|
510
546
|
/**
|
|
@@ -731,7 +767,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
731
767
|
*/
|
|
732
768
|
updatePills() {
|
|
733
769
|
if (this.showPills) {
|
|
734
|
-
this.pillsData = this.checkedGroupedItems
|
|
770
|
+
this.pillsData = this.checkedGroupedItems;
|
|
735
771
|
this.hasPills = !!this.pillsData.length;
|
|
736
772
|
}
|
|
737
773
|
}
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.12.0';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.12.0",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "LSEG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "./lib/index.js",
|
|
8
8
|
"module": "./lib/index.js",
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
},
|
|
340
340
|
"dependencies": {
|
|
341
341
|
"@lit-labs/context": "^0.3.1",
|
|
342
|
-
"@refinitiv-ui/halo-theme": "^6.6.
|
|
343
|
-
"@refinitiv-ui/solar-theme": "^6.4.
|
|
342
|
+
"@refinitiv-ui/halo-theme": "^6.6.1",
|
|
343
|
+
"@refinitiv-ui/solar-theme": "^6.4.1",
|
|
344
344
|
"@types/chart.js": "^2.9.31",
|
|
345
345
|
"chart.js": "~2.9.4",
|
|
346
346
|
"d3-interpolate": "^3.0.1",
|
|
@@ -349,25 +349,25 @@
|
|
|
349
349
|
"tslib": "^2.3.1"
|
|
350
350
|
},
|
|
351
351
|
"devDependencies": {
|
|
352
|
-
"@refinitiv-ui/core": "^6.5.
|
|
353
|
-
"@refinitiv-ui/demo-block": "^6.1.
|
|
354
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
355
|
-
"@refinitiv-ui/phrasebook": "^6.3.
|
|
356
|
-
"@refinitiv-ui/test-helpers": "^6.0.
|
|
357
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
358
|
-
"@refinitiv-ui/utils": "^6.
|
|
352
|
+
"@refinitiv-ui/core": "^6.5.1",
|
|
353
|
+
"@refinitiv-ui/demo-block": "^6.1.12",
|
|
354
|
+
"@refinitiv-ui/i18n": "^6.0.18",
|
|
355
|
+
"@refinitiv-ui/phrasebook": "^6.3.7",
|
|
356
|
+
"@refinitiv-ui/test-helpers": "^6.0.15",
|
|
357
|
+
"@refinitiv-ui/translate": "^6.0.27",
|
|
358
|
+
"@refinitiv-ui/utils": "^6.3.0",
|
|
359
359
|
"@types/d3-interpolate": "^3.0.1"
|
|
360
360
|
},
|
|
361
361
|
"peerDependencies": {
|
|
362
362
|
"@refinitiv-ui/browser-sparkline": "^1.0.0 || ^2.0.0",
|
|
363
|
-
"@refinitiv-ui/core": "^6.5.
|
|
364
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
365
|
-
"@refinitiv-ui/phrasebook": "^6.3.
|
|
366
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
367
|
-
"@refinitiv-ui/utils": "^6.
|
|
363
|
+
"@refinitiv-ui/core": "^6.5.1",
|
|
364
|
+
"@refinitiv-ui/i18n": "^6.0.18",
|
|
365
|
+
"@refinitiv-ui/phrasebook": "^6.3.7",
|
|
366
|
+
"@refinitiv-ui/translate": "^6.0.27",
|
|
367
|
+
"@refinitiv-ui/utils": "^6.3.0"
|
|
368
368
|
},
|
|
369
369
|
"publishConfig": {
|
|
370
370
|
"access": "public"
|
|
371
371
|
},
|
|
372
|
-
"gitHead": "
|
|
372
|
+
"gitHead": "14c76686cee42f70897fd6234691ac09fd318858"
|
|
373
373
|
}
|