@refinitiv-ui/elements 7.3.2 → 7.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +1 -1
  3. package/README.md +5 -5
  4. package/lib/calendar/custom-elements.json +4 -0
  5. package/lib/calendar/custom-elements.md +4 -3
  6. package/lib/calendar/index.d.ts +8 -1
  7. package/lib/calendar/index.js +26 -3
  8. package/lib/calendar/themes/halo/dark/index.js +1 -1
  9. package/lib/calendar/themes/halo/light/index.js +1 -1
  10. package/lib/calendar/themes/solar/charcoal/index.js +1 -1
  11. package/lib/calendar/themes/solar/pearl/index.js +1 -1
  12. package/lib/combo-box/index.js +2 -0
  13. package/lib/datetime-field/custom-elements.json +0 -5
  14. package/lib/datetime-field/custom-elements.md +4 -5
  15. package/lib/datetime-field/index.d.ts +0 -22
  16. package/lib/datetime-field/index.js +2 -38
  17. package/lib/email-field/index.d.ts +0 -7
  18. package/lib/email-field/index.js +0 -13
  19. package/lib/number-field/custom-elements.json +8 -5
  20. package/lib/number-field/custom-elements.md +7 -6
  21. package/lib/number-field/index.d.ts +8 -10
  22. package/lib/number-field/index.js +25 -32
  23. package/lib/slider/custom-elements.json +1 -1
  24. package/lib/slider/custom-elements.md +1 -1
  25. package/lib/slider/index.d.ts +6 -1
  26. package/lib/slider/index.js +14 -2
  27. package/lib/text-field/index.d.ts +7 -12
  28. package/lib/text-field/index.js +15 -31
  29. package/lib/tree/elements/tree.js +4 -4
  30. package/lib/tree/managers/tree-manager.d.ts +8 -0
  31. package/lib/tree/managers/tree-manager.js +19 -1
  32. package/lib/tree-select/index.d.ts +12 -3
  33. package/lib/tree-select/index.js +54 -18
  34. package/lib/version.js +1 -1
  35. package/package.json +17 -17
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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
+ # [7.5.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.4.0...@refinitiv-ui/elements@7.5.0) (2023-09-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **slider:** incorrect updating `to` value ([#938](https://github.com/Refinitiv/refinitiv-ui/issues/938)) ([8479abc](https://github.com/Refinitiv/refinitiv-ui/commit/8479abc828571e06379b5f389058f60d5ba8443b))
11
+ - **slider:** number field not revalidate when error state changes ([#942](https://github.com/Refinitiv/refinitiv-ui/issues/942)) ([5fc64a6](https://github.com/Refinitiv/refinitiv-ui/commit/5fc64a6ac21cdbbf820ae97de04ec19443755e50))
12
+
13
+ ### Features
14
+
15
+ - **fields:** improve validation consistency for field elements ([#937](https://github.com/Refinitiv/refinitiv-ui/issues/937)) ([d58051c](https://github.com/Refinitiv/refinitiv-ui/commit/d58051c0b4d3508ac55d223299fd8bf267458ddf))
16
+ - **utils:** add `selectedAt` property to `DataItem` interface ([4d69419](https://github.com/Refinitiv/refinitiv-ui/commit/4d69419107d8ed8dd554cb7cf0ecadd327d02f18))
17
+
18
+ # [7.4.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.3.2...@refinitiv-ui/elements@7.4.0) (2023-09-11)
19
+
20
+ ### Features
21
+
22
+ - **calendar:** custom cell content ([#928](https://github.com/Refinitiv/refinitiv-ui/issues/928)) ([ce8ec58](https://github.com/Refinitiv/refinitiv-ui/commit/ce8ec5859f503af45750f9838b809a1a2db2365e))
23
+ - **number-field:** add new event step-up and step-down ([#906](https://github.com/Refinitiv/refinitiv-ui/issues/906)) ([75ec298](https://github.com/Refinitiv/refinitiv-ui/commit/75ec298d646913b645e3057160bdb664f298ba3d))
24
+
6
25
  ## [7.3.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.3.1...@refinitiv-ui/elements@7.3.2) (2023-09-04)
7
26
 
8
27
  ### Bug Fixes
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2023, Refinitiv.
1
+ Copyright © 2023, LSEG
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
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 Refinitiv 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.
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. Refinitiv Workspace's design system is called Halo theme and you can install it from npm command.
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 Refinitiv Workspace's design system, it is required styles of some native elements e.g. typography.
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 Refinitiv products or services. The copyright owner must approve any use of such font outside of Refinitiv products or services, which may be subject to a fee. Please see https://www.fontspring.com/lic/fontspring/webfont#license_text
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 Refinitiv products or services due to license of the font "Proxima Nova Fin".
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".
@@ -191,6 +191,10 @@
191
191
  }
192
192
  ],
193
193
  "slots": [
194
+ {
195
+ "name": "yyyy-mm-dd",
196
+ "description": "Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`"
197
+ },
194
198
  {
195
199
  "name": "footer",
196
200
  "description": "Adds slotted content into the footer of the calendar control"
@@ -30,6 +30,7 @@ Standard calendar element
30
30
 
31
31
  ## Slots
32
32
 
33
- | Name | Description |
34
- |----------|--------------------------------------------------|
35
- | `footer` | Adds slotted content into the footer of the calendar control |
33
+ | Name | Description |
34
+ |--------------|--------------------------------------------------|
35
+ | `footer` | Adds slotted content into the footer of the calendar control |
36
+ | `yyyy-mm-dd` | Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy` |
@@ -18,6 +18,7 @@ export { CalendarFilter };
18
18
  * @attr {boolean} disabled - Set disabled state
19
19
  * @prop {boolean} [disabled=false] - Set disabled state
20
20
  *
21
+ * @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
21
22
  * @slot footer - Adds slotted content into the footer of the calendar control
22
23
  */
23
24
  export declare class Calendar extends ControlElement implements MultiValue {
@@ -289,7 +290,13 @@ export declare class Calendar extends ControlElement implements MultiValue {
289
290
  */
290
291
  private onKeyDown;
291
292
  /**
292
- * Run when tap event happens ot table.
293
+ * Get cell content from tap event
294
+ * @param event Keyboard event
295
+ * @returns html element
296
+ */
297
+ private getCellContent;
298
+ /**
299
+ * Run when tap event happens to table.
293
300
  * Select the values or switch the view
294
301
  * @param event Tap event
295
302
  * @returns {void}
@@ -27,6 +27,7 @@ import { ViewFormatTranslateParams, monthInfo, monthsNames, weekdaysNames } from
27
27
  * @attr {boolean} disabled - Set disabled state
28
28
  * @prop {boolean} [disabled=false] - Set disabled state
29
29
  *
30
+ * @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
30
31
  * @slot footer - Adds slotted content into the footer of the calendar control
31
32
  */
32
33
  let Calendar = class Calendar extends ControlElement {
@@ -618,7 +619,28 @@ let Calendar = class Calendar extends ControlElement {
618
619
  event.preventDefault();
619
620
  }
620
621
  /**
621
- * Run when tap event happens ot table.
622
+ * Get cell content from tap event
623
+ * @param event Keyboard event
624
+ * @returns html element
625
+ */
626
+ getCellContent(event) {
627
+ const path = event.composedPath();
628
+ for (let i = 0; i <= path.length; i += 1) {
629
+ const node = path[i];
630
+ if (node === this) {
631
+ return null;
632
+ }
633
+ if (node.nodeType !== Node.ELEMENT_NODE) {
634
+ continue;
635
+ }
636
+ if (node.getAttribute('role') === 'button' && node.part.value.includes('cell-content')) {
637
+ return node;
638
+ }
639
+ }
640
+ return null;
641
+ }
642
+ /**
643
+ * Run when tap event happens to table.
622
644
  * Select the values or switch the view
623
645
  * @param event Tap event
624
646
  * @returns {void}
@@ -627,7 +649,7 @@ let Calendar = class Calendar extends ControlElement {
627
649
  if (event.defaultPrevented) {
628
650
  return;
629
651
  }
630
- const cell = event.target;
652
+ const cell = this.getCellContent(event);
631
653
  if (!cell || !this.isDateButton(cell) || !cell.value) {
632
654
  return;
633
655
  }
@@ -1128,6 +1150,7 @@ let Calendar = class Calendar extends ControlElement {
1128
1150
  const isSelectable = isSelection && !cell.disabled;
1129
1151
  const isSelected = cell.selected ? 'true' : 'false';
1130
1152
  const isActive = cell.active ? 0 : -1;
1153
+ const slotContent = cell.value ? html `<slot name=${cell.value}>${cell.text}</slot>` : cell.text;
1131
1154
  return html `<div
1132
1155
  role="gridcell"
1133
1156
  part="cell ${cell.view}"
@@ -1157,7 +1180,7 @@ let Calendar = class Calendar extends ControlElement {
1157
1180
  .value=${cell.value}
1158
1181
  .index=${cell.index}
1159
1182
  >
1160
- ${cell.text}
1183
+ ${slotContent}
1161
1184
  </div>
1162
1185
  </div>`;
1163
1186
  }
@@ -1,2 +1,2 @@
1
1
  import '@refinitiv-ui/elements/button/themes/halo/dark';
2
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
2
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host [part~=selection] ::slotted(*){position:absolute}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
@@ -1,2 +1,2 @@
1
1
  import '@refinitiv-ui/elements/button/themes/halo/light';
2
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
2
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host [part~=selection] ::slotted(*){position:absolute}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
@@ -1,2 +1,2 @@
1
1
  import '@refinitiv-ui/elements/button/themes/solar/charcoal';
2
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}' }}));
2
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host [part~=selection] ::slotted(*){position:absolute}:host([disabled]){opacity:.4}' }}));
@@ -1,2 +1,2 @@
1
1
  import '@refinitiv-ui/elements/button/themes/solar/pearl';
2
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}' }}));
2
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host [part~=selection] ::slotted(*){position:absolute}:host([disabled]){opacity:.4}' }}));
@@ -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);
@@ -258,11 +258,6 @@
258
258
  "name": "checkValidity",
259
259
  "description": "Returns true if an input element contains valid data.",
260
260
  "params": []
261
- },
262
- {
263
- "name": "reportValidity",
264
- "description": "Validate input. Mark as error if input is invalid",
265
- "params": []
266
261
  }
267
262
  ]
268
263
  }
@@ -37,11 +37,10 @@ A form control element for datetime input.
37
37
 
38
38
  ## Methods
39
39
 
40
- | Method | Type | Description |
41
- |------------------|----------------------------------|--------------------------------------------------|
42
- | `checkValidity` | `(): boolean` | Returns true if an input element contains valid data. |
43
- | `reportValidity` | `(): boolean` | Validate input. Mark as error if input is invalid |
44
- | `willUpdate` | `(changedProperties: any): void` | Updates the element<br /><br />**changedProperties**: Properties that has changed |
40
+ | Method | Type | Description |
41
+ |-----------------|----------------------------------|--------------------------------------------------|
42
+ | `checkValidity` | `(): boolean` | Returns true if an input element contains valid data. |
43
+ | `willUpdate` | `(changedProperties: any): void` | Updates the element<br /><br />**changedProperties**: Properties that has changed |
45
44
 
46
45
  ## Events
47
46
 
@@ -186,18 +186,6 @@ export declare class DatetimeField extends TextField {
186
186
  * @returns {void}
187
187
  */
188
188
  protected syncInputValue(changedProperties?: PropertyValues): void;
189
- /**
190
- * Check if input should be re-validated
191
- * @param changedProperties Properties that has changed
192
- * @returns True if input should be re-validated
193
- */
194
- protected shouldValidateInput(changedProperties: PropertyValues): boolean;
195
- /**
196
- * Validate input according `pattern`, `minLength` and `maxLength` properties
197
- * change state of `error` property according pattern validation
198
- * @returns {void}
199
- */
200
- protected validateInput(): void;
201
189
  /**
202
190
  * Override validation method for value
203
191
  * @param value value
@@ -244,21 +232,11 @@ export declare class DatetimeField extends TextField {
244
232
  * @returns {void}
245
233
  */
246
234
  protected setValueAndNotify(value: string): void;
247
- /**
248
- * Reset error state on input
249
- * @returns {void}
250
- */
251
- protected resetError(): void;
252
235
  /**
253
236
  * Returns true if an input element contains valid data.
254
237
  * @returns true if input is valid
255
238
  */
256
239
  checkValidity(): boolean;
257
- /**
258
- * Validate input. Mark as error if input is invalid
259
- * @returns false if there is an error
260
- */
261
- reportValidity(): boolean;
262
240
  /**
263
241
  * Select part
264
242
  * @param parts The list of parts
@@ -294,23 +294,6 @@ let DatetimeField = class DatetimeField extends TextField {
294
294
  this.inputValue = inputValue; // setting the value resets selection
295
295
  }
296
296
  }
297
- /**
298
- * Check if input should be re-validated
299
- * @param changedProperties Properties that has changed
300
- * @returns True if input should be re-validated
301
- */
302
- shouldValidateInput(changedProperties) {
303
- // TODO: this needs refactoring with all other fields to support common validation patterns
304
- return changedProperties.has(FocusedPropertyKey) && !this.focused;
305
- }
306
- /**
307
- * Validate input according `pattern`, `minLength` and `maxLength` properties
308
- * change state of `error` property according pattern validation
309
- * @returns {void}
310
- */
311
- validateInput() {
312
- this.reportValidity();
313
- }
314
297
  /**
315
298
  * Override validation method for value
316
299
  * @param value value
@@ -399,15 +382,6 @@ let DatetimeField = class DatetimeField extends TextField {
399
382
  this.notifyPropertyChange('value', value);
400
383
  }
401
384
  }
402
- /**
403
- * Reset error state on input
404
- * @returns {void}
405
- */
406
- resetError() {
407
- if (this.error && this.checkValidity()) {
408
- this.reportValidity();
409
- }
410
- }
411
385
  /**
412
386
  * Returns true if an input element contains valid data.
413
387
  * @returns true if input is valid
@@ -433,15 +407,6 @@ let DatetimeField = class DatetimeField extends TextField {
433
407
  }
434
408
  return true;
435
409
  }
436
- /**
437
- * Validate input. Mark as error if input is invalid
438
- * @returns false if there is an error
439
- */
440
- reportValidity() {
441
- const hasError = !this.checkValidity();
442
- this.notifyErrorChange(hasError);
443
- return !hasError;
444
- }
445
410
  /**
446
411
  * Select part
447
412
  * @param parts The list of parts
@@ -527,7 +492,7 @@ let DatetimeField = class DatetimeField extends TextField {
527
492
  this.setValueAndNotify(newValue);
528
493
  this.syncInputValue();
529
494
  this.selectPart(this.formatToParts(newValue), selectedPartIndex);
530
- this.resetError();
495
+ this.reportValidity();
531
496
  event.preventDefault();
532
497
  }
533
498
  break;
@@ -547,8 +512,7 @@ let DatetimeField = class DatetimeField extends TextField {
547
512
  */
548
513
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
549
514
  onPossibleValueChange(event) {
550
- // Nobody likes to see a red border
551
- this.resetError();
515
+ this.reportValidity();
552
516
  this.selectPartFrame.cancel(); // ensure no pending selection
553
517
  this.partLabel = '';
554
518
  const inputValue = this.inputElement?.value || '';
@@ -1,5 +1,4 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { PropertyValues } from '@refinitiv-ui/core';
3
2
  import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
4
3
  import '../icon/index.js';
5
4
  import { TextField } from '../text-field/index.js';
@@ -57,12 +56,6 @@ export declare class EmailField extends TextField {
57
56
  * @returns template map
58
57
  */
59
58
  protected get decorateInputMap(): TemplateMap;
60
- /**
61
- * Check if input should be re-validated
62
- * @param changedProperties Properties that has changed
63
- * @returns True if input should be re-validated
64
- */
65
- protected shouldValidateInput(changedProperties: PropertyValues): boolean;
66
59
  }
67
60
  declare global {
68
61
  interface HTMLElementTagNameMap {
@@ -52,7 +52,6 @@ let EmailField = class EmailField extends TextField {
52
52
  * Set to multiple mode, allows multiple emails in a single input
53
53
  */
54
54
  this.multiple = false;
55
- /* c8 ignore stop */
56
55
  }
57
56
  /**
58
57
  * Decorate `<input>` element with common properties extended from text-field:
@@ -68,18 +67,6 @@ let EmailField = class EmailField extends TextField {
68
67
  multiple: this.multiple
69
68
  };
70
69
  }
71
- /**
72
- * Check if input should be re-validated
73
- * @param changedProperties Properties that has changed
74
- * @returns True if input should be re-validated
75
- */
76
- /* c8 ignore start */
77
- shouldValidateInput(changedProperties) {
78
- // TODO: This validation should be refactored
79
- return (changedProperties.has('value') ||
80
- changedProperties.has('multiple') ||
81
- super.shouldValidateInput(changedProperties));
82
- }
83
70
  };
84
71
  __decorate([
85
72
  property({ type: Boolean, reflect: true })
@@ -159,6 +159,14 @@
159
159
  "name": "error-changed",
160
160
  "description": "Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically."
161
161
  },
162
+ {
163
+ "name": "step-up",
164
+ "description": "Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically."
165
+ },
166
+ {
167
+ "name": "step-down",
168
+ "description": "Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically."
169
+ },
162
170
  {
163
171
  "name": "input"
164
172
  }
@@ -188,11 +196,6 @@
188
196
  "name": "checkValidity",
189
197
  "description": "Returns true if an input element contains valid data.",
190
198
  "params": []
191
- },
192
- {
193
- "name": "reportValidity",
194
- "description": "Validate input. Mark as error if input is invalid",
195
- "params": []
196
199
  }
197
200
  ]
198
201
  }
@@ -21,12 +21,11 @@ Form control element for numbers.
21
21
 
22
22
  ## Methods
23
23
 
24
- | Method | Type | Description |
25
- |------------------|-----------------------------------------------|--------------------------------------------------|
26
- | `checkValidity` | `(): boolean` | Returns true if an input element contains valid data. |
27
- | `reportValidity` | `(): boolean` | Validate input. Mark as error if input is invalid |
28
- | `stepDown` | `(stepIncrement?: number \| undefined): void` | Decreases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
29
- | `stepUp` | `(stepIncrement?: number \| undefined): void` | Increases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
24
+ | Method | Type | Description |
25
+ |-----------------|-----------------------------------------------|--------------------------------------------------|
26
+ | `checkValidity` | `(): boolean` | Returns true if an input element contains valid data. |
27
+ | `stepDown` | `(stepIncrement?: number \| undefined): void` | Decreases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
28
+ | `stepUp` | `(stepIncrement?: number \| undefined): void` | Increases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
30
29
 
31
30
  ## Events
32
31
 
@@ -34,4 +33,6 @@ Form control element for numbers.
34
33
  |-----------------|--------------------------------------------------|
35
34
  | `error-changed` | Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically. |
36
35
  | `input` | |
36
+ | `step-down` | Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically. |
37
+ | `step-up` | Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically. |
37
38
  | `value-changed` | Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically. |
@@ -12,6 +12,8 @@ declare enum Direction {
12
12
  *
13
13
  * @fires value-changed - Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically.
14
14
  * @fires error-changed - Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically.
15
+ * @fires step-up - Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically.
16
+ * @fires step-down - Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically.
15
17
  *
16
18
  * @attr {boolean} disabled - Set disabled state
17
19
  * @prop {boolean} [disabled=false] - Set disabled state
@@ -150,6 +152,12 @@ export declare class NumberField extends FormFieldElement {
150
152
  * @returns {void}
151
153
  */
152
154
  protected onInputKeyDown(event: KeyboardEvent): void;
155
+ /**
156
+ * Trigger step-up or step-down event and return the event is cancelled
157
+ * @param direction Up or Down
158
+ * @returns {boolean} false if cancelled event. And true otherwise.
159
+ */
160
+ private dispatchStepEvent;
153
161
  /**
154
162
  * Run when spinner has been tapped
155
163
  * @param event tap event
@@ -201,11 +209,6 @@ export declare class NumberField extends FormFieldElement {
201
209
  * @returns {void}
202
210
  */
203
211
  private setSilentlyValueAndNotify;
204
- /**
205
- * Reset error state on input
206
- * @returns {void}
207
- */
208
- private resetError;
209
212
  /**
210
213
  * Get the allowed step value
211
214
  * @returns allowed step
@@ -263,11 +266,6 @@ export declare class NumberField extends FormFieldElement {
263
266
  * @returns true if input is valid
264
267
  */
265
268
  checkValidity(): boolean;
266
- /**
267
- * Validate input. Mark as error if input is invalid
268
- * @returns false if there is an error
269
- */
270
- reportValidity(): boolean;
271
269
  /**
272
270
  * @ignore
273
271
  * @inheritDoc
@@ -17,6 +17,8 @@ var Direction;
17
17
  *
18
18
  * @fires value-changed - Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically.
19
19
  * @fires error-changed - Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically.
20
+ * @fires step-up - Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically.
21
+ * @fires step-down - Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically.
20
22
  *
21
23
  * @attr {boolean} disabled - Set disabled state
22
24
  * @prop {boolean} [disabled=false] - Set disabled state
@@ -136,8 +138,6 @@ let NumberField = class NumberField extends FormFieldElement {
136
138
  * @returns {void}
137
139
  */
138
140
  update(changedProperties) {
139
- // This code probably should not be here, as validation must be instantiated by the app developer
140
- // Keep the element inline with others for now
141
141
  if (changedProperties.has(FocusedPropertyKey) && !this.focused) {
142
142
  this.reportValidity();
143
143
  }
@@ -251,6 +251,17 @@ let NumberField = class NumberField extends FormFieldElement {
251
251
  }
252
252
  event.preventDefault();
253
253
  }
254
+ /**
255
+ * Trigger step-up or step-down event and return the event is cancelled
256
+ * @param direction Up or Down
257
+ * @returns {boolean} false if cancelled event. And true otherwise.
258
+ */
259
+ dispatchStepEvent(direction) {
260
+ const eventName = direction === Direction.Up ? 'step-up' : 'step-down';
261
+ return this.dispatchEvent(new CustomEvent(eventName, {
262
+ cancelable: true
263
+ }));
264
+ }
254
265
  /**
255
266
  * Run when spinner has been tapped
256
267
  * @param event tap event
@@ -274,14 +285,17 @@ let NumberField = class NumberField extends FormFieldElement {
274
285
  * @returns {void}
275
286
  */
276
287
  onApplyStep(direction) {
277
- try {
278
- this.applyStepDirection(direction);
279
- this.dispatchEvent(new InputEvent('input'));
280
- this.setSilentlyValueAndNotify();
281
- }
282
- catch (error) {
283
- // According to specs stepDown/stepUp may fail for some invalid inputs
284
- // do nothing and report nothing in that case
288
+ const event = this.dispatchStepEvent(direction);
289
+ if (event) {
290
+ try {
291
+ this.applyStepDirection(direction);
292
+ this.dispatchEvent(new InputEvent('input'));
293
+ this.setSilentlyValueAndNotify();
294
+ }
295
+ catch (error) {
296
+ // According to specs stepDown/stepUp may fail for some invalid inputs
297
+ // do nothing and report nothing in that case
298
+ }
285
299
  }
286
300
  }
287
301
  /**
@@ -402,7 +416,7 @@ let NumberField = class NumberField extends FormFieldElement {
402
416
  */
403
417
  setSilentlyValueAndNotify() {
404
418
  // Nobody likes to see a red border
405
- this.resetError();
419
+ this.reportValidity();
406
420
  const value = this.valueAsNumberString(this.inputValue);
407
421
  if (super.value !== value) {
408
422
  // here we must set the value silently to avoid re-rendering of input
@@ -410,15 +424,6 @@ let NumberField = class NumberField extends FormFieldElement {
410
424
  this.notifyPropertyChange('value', value);
411
425
  }
412
426
  }
413
- /**
414
- * Reset error state on input
415
- * @returns {void}
416
- */
417
- resetError() {
418
- if (this.error && this.checkValidity()) {
419
- this.reportValidity();
420
- }
421
- }
422
427
  /**
423
428
  * Get the allowed step value
424
429
  * @returns allowed step
@@ -629,18 +634,6 @@ let NumberField = class NumberField extends FormFieldElement {
629
634
  }
630
635
  return true;
631
636
  }
632
- /**
633
- * Validate input. Mark as error if input is invalid
634
- * @returns false if there is an error
635
- */
636
- reportValidity() {
637
- const hasError = !this.checkValidity();
638
- if (this.error !== hasError) {
639
- this.error = hasError;
640
- this.notifyPropertyChange('error', this.error);
641
- }
642
- return !hasError;
643
- }
644
637
  /**
645
638
  * @ignore
646
639
  * @inheritDoc
@@ -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. |
@@ -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
@@ -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
  */
@@ -762,6 +762,7 @@ let Slider = class Slider extends ControlElement {
762
762
  this.valuePreviousInput = this.value;
763
763
  }
764
764
  this.onDrag(event);
765
+ this.validateNumberField();
765
766
  if (event.changedTouches) {
766
767
  this.addEventListener('touchmove', this.onDrag);
767
768
  this.addEventListener('touchend', this.onDragEnd);
@@ -855,6 +856,17 @@ let Slider = class Slider extends ControlElement {
855
856
  }
856
857
  return this.fromNumber + this.minRangeNumber;
857
858
  }
859
+ /**
860
+ * Validate number field from changed thumb
861
+ * @returns {void}
862
+ */
863
+ validateNumberField() {
864
+ if (this.isShowInputField) {
865
+ const name = this.changedThumb?.getAttribute('name');
866
+ const numberField = this[`${name}Input`];
867
+ requestAnimationFrame(() => numberField.reportValidity());
868
+ }
869
+ }
858
870
  /**
859
871
  * Calculate the nearest possible step value depending on step interval
860
872
  * @param thumbPosition current thumb position in fraction
@@ -996,7 +1008,7 @@ let Slider = class Slider extends ControlElement {
996
1008
  if (valueFor === SliderDataName.to && value < this.fromNumber + this.minRangeNumber) {
997
1009
  return false;
998
1010
  }
999
- else if (value > this.toNumber - this.minRangeNumber) {
1011
+ else if (valueFor === SliderDataName.from && value > this.toNumber - this.minRangeNumber) {
1000
1012
  return false;
1001
1013
  }
1002
1014
  }
@@ -68,6 +68,12 @@ export declare class TextField extends FormFieldElement {
68
68
  * @returns {void}
69
69
  */
70
70
  protected firstUpdated(changedProperties: PropertyValues): void;
71
+ /**
72
+ * Updates the element
73
+ * @param changedProperties Properties that has changed
74
+ * @returns {void}
75
+ */
76
+ protected update(changedProperties: PropertyValues): void;
71
77
  /**
72
78
  * Called when the element’s DOM has been updated and rendered
73
79
  * @param changedProperties Properties that has changed
@@ -86,13 +92,7 @@ export declare class TextField extends FormFieldElement {
86
92
  * @param changedProperties Properties that has changed
87
93
  * @returns {void}
88
94
  */
89
- protected syncInputValue(changedProperties: PropertyValues): void;
90
- /**
91
- * Check if input should be re-validated
92
- * @param changedProperties Properties that has changed
93
- * @returns True if input should be re-validated
94
- */
95
- protected shouldValidateInput(changedProperties: PropertyValues): boolean;
95
+ protected syncInputValue(): void;
96
96
  /**
97
97
  * Runs on input element `input` event
98
98
  * @param event `input` event
@@ -110,11 +110,6 @@ export declare class TextField extends FormFieldElement {
110
110
  * @returns {void}
111
111
  */
112
112
  protected onPossibleValueChange(event: InputEvent): void;
113
- /**
114
- * Uses native `checkValidity()` function to validate input
115
- * @returns {void}
116
- */
117
- protected validateInput(): void;
118
113
  /**
119
114
  * Fires event on `icon` click
120
115
  * @returns {void}
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { FormFieldElement, css, html, nothing } from '@refinitiv-ui/core';
2
+ import { FocusedPropertyKey, FormFieldElement, css, html, nothing } 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 { isElementOverflown } from '@refinitiv-ui/utils/element.js';
@@ -108,6 +108,17 @@ let TextField = class TextField extends FormFieldElement {
108
108
  super.firstUpdated(changedProperties);
109
109
  registerOverflowTooltip(this, () => this.inputValue, () => (this.inputElement ? isElementOverflown(this.inputElement) : false));
110
110
  }
111
+ /**
112
+ * Updates the element
113
+ * @param changedProperties Properties that has changed
114
+ * @returns {void}
115
+ */
116
+ update(changedProperties) {
117
+ if (changedProperties.has(FocusedPropertyKey) && !this.focused) {
118
+ this.reportValidity();
119
+ }
120
+ super.update(changedProperties);
121
+ }
111
122
  /**
112
123
  * Called when the element’s DOM has been updated and rendered
113
124
  * @param changedProperties Properties that has changed
@@ -116,10 +127,7 @@ let TextField = class TextField extends FormFieldElement {
116
127
  updated(changedProperties) {
117
128
  super.updated(changedProperties);
118
129
  if (this.shouldSyncInputValue(changedProperties)) {
119
- this.syncInputValue(changedProperties);
120
- }
121
- if (this.shouldValidateInput(changedProperties)) {
122
- this.validateInput();
130
+ this.syncInputValue();
123
131
  }
124
132
  }
125
133
  /**
@@ -137,26 +145,9 @@ let TextField = class TextField extends FormFieldElement {
137
145
  * @param changedProperties Properties that has changed
138
146
  * @returns {void}
139
147
  */
140
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
141
- syncInputValue(changedProperties) {
148
+ syncInputValue() {
142
149
  this.inputValue = this.value;
143
150
  }
144
- /**
145
- * Check if input should be re-validated
146
- * @param changedProperties Properties that has changed
147
- * @returns True if input should be re-validated
148
- */
149
- /* c8 ignore start */
150
- shouldValidateInput(changedProperties) {
151
- // TODO: This validation should be refactored
152
- return (changedProperties.has('pattern') ||
153
- !!(this.pattern && changedProperties.has('value')) ||
154
- changedProperties.has('minLength') ||
155
- !!(this.minLength && changedProperties.has('value')) ||
156
- changedProperties.has('maxLength') ||
157
- !!(this.maxLength && changedProperties.has('value')));
158
- }
159
- /* c8 ignore stop */
160
151
  /**
161
152
  * Runs on input element `input` event
162
153
  * @param event `input` event
@@ -181,14 +172,7 @@ let TextField = class TextField extends FormFieldElement {
181
172
  onPossibleValueChange(event) {
182
173
  const value = this.inputElement?.value || '';
183
174
  this.setValueAndNotify(value);
184
- }
185
- /**
186
- * Uses native `checkValidity()` function to validate input
187
- * @returns {void}
188
- */
189
- validateInput() {
190
- const error = !this.inputElement?.checkValidity();
191
- this.notifyErrorChange(error);
175
+ this.reportValidity();
192
176
  }
193
177
  /**
194
178
  * Fires event on `icon` click
@@ -374,7 +374,7 @@ let Tree = class Tree extends List {
374
374
  */
375
375
  get values() {
376
376
  return this.manager.checkedItems.map((item) => {
377
- return this.composer.getItemPropertyValue(item, 'value') || '';
377
+ return this.composer.getItemPropertyValue(item, 'value') ?? '';
378
378
  });
379
379
  }
380
380
  set values(values) {
@@ -384,9 +384,9 @@ let Tree = class Tree extends List {
384
384
  }
385
385
  else {
386
386
  // Clone value arrays
387
- const newValue = [...values].sort().toString();
388
- const oldValue = [...this.values].sort().toString();
389
- if (newValue !== oldValue) {
387
+ const newValue = [...values];
388
+ const oldValue = [...this.values];
389
+ if (newValue.toString() !== oldValue.toString()) {
390
390
  this.manager.uncheckAllItems();
391
391
  values.some((value) => {
392
392
  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
- return this.composer.queryItems((item) => {
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
- * Reverse selection. Run on Esc or Cancel
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 cancelSelection(): void;
222
+ protected revertSelectionTimestamps(): void;
214
223
  /**
215
224
  * Update memoized track
216
225
  *
@@ -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
- super.values = values;
169
- this._values = values;
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.slice();
358
+ const oldValues = this.values;
336
359
  const newValues = this.composerValues;
337
- const oldComparison = oldValues.sort().toString();
338
- const newComparison = newValues.sort().toString();
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
- * Reverse selection. Run on Esc or Cancel
367
+ * Revert modified selection to old values. Run on Esc or Cancel
346
368
  * @returns {void}
347
369
  */
348
- cancelSelection() {
349
- const oldValues = this.values.slice();
370
+ revertModifiedSelection() {
371
+ const oldValues = this.values;
350
372
  const newValues = this.composerValues;
351
- const oldComparison = oldValues.sort().toString();
352
- const newComparison = newValues.sort().toString();
353
- if (oldComparison !== newComparison) {
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.cancelSelection();
543
+ this.revertModifiedSelection();
508
544
  this.exitEditSelection();
509
545
  }
510
546
  /**
@@ -733,7 +769,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
733
769
  */
734
770
  updatePills() {
735
771
  if (this.showPills) {
736
- this.pillsData = this.checkedGroupedItems.slice();
772
+ this.pillsData = this.checkedGroupedItems;
737
773
  this.hasPills = !!this.pillsData.length;
738
774
  }
739
775
  }
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.3.2';
1
+ export const VERSION = '7.5.0';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "7.3.2",
3
+ "version": "7.5.0",
4
4
  "description": "Element Framework Elements",
5
- "author": "Refinitiv",
5
+ "author": "LSEG",
6
6
  "license": "Apache-2.0",
7
7
  "main": "./lib/index.js",
8
8
  "module": "./lib/index.js",
@@ -341,8 +341,8 @@
341
341
  },
342
342
  "dependencies": {
343
343
  "@lit-labs/context": "^0.3.1",
344
- "@refinitiv-ui/halo-theme": "^7.0.4",
345
- "@refinitiv-ui/solar-theme": "^7.0.4",
344
+ "@refinitiv-ui/halo-theme": "^7.1.1",
345
+ "@refinitiv-ui/solar-theme": "^7.1.1",
346
346
  "chart.js": "^4.3.0",
347
347
  "chartjs-adapter-date-fns": "^3.0.0",
348
348
  "d3-interpolate": "^3.0.1",
@@ -351,25 +351,25 @@
351
351
  "tslib": "^2.3.1"
352
352
  },
353
353
  "devDependencies": {
354
- "@refinitiv-ui/core": "^7.1.0",
355
- "@refinitiv-ui/demo-block": "^7.0.4",
356
- "@refinitiv-ui/i18n": "^7.0.3",
357
- "@refinitiv-ui/phrasebook": "^7.0.3",
358
- "@refinitiv-ui/test-helpers": "^7.0.3",
359
- "@refinitiv-ui/translate": "^7.0.3",
360
- "@refinitiv-ui/utils": "^7.0.3",
354
+ "@refinitiv-ui/core": "^7.2.0",
355
+ "@refinitiv-ui/demo-block": "^7.0.6",
356
+ "@refinitiv-ui/i18n": "^7.0.4",
357
+ "@refinitiv-ui/phrasebook": "^7.0.4",
358
+ "@refinitiv-ui/test-helpers": "^7.0.4",
359
+ "@refinitiv-ui/translate": "^7.0.4",
360
+ "@refinitiv-ui/utils": "^7.1.0",
361
361
  "@types/d3-interpolate": "^3.0.1"
362
362
  },
363
363
  "peerDependencies": {
364
364
  "@refinitiv-ui/browser-sparkline": "^1.0.0 || ^2.0.0",
365
- "@refinitiv-ui/core": "^7.1.0",
366
- "@refinitiv-ui/i18n": "^7.0.3",
367
- "@refinitiv-ui/phrasebook": "^7.0.3",
368
- "@refinitiv-ui/translate": "^7.0.3",
369
- "@refinitiv-ui/utils": "^7.0.3"
365
+ "@refinitiv-ui/core": "^7.2.0",
366
+ "@refinitiv-ui/i18n": "^7.0.4",
367
+ "@refinitiv-ui/phrasebook": "^7.0.4",
368
+ "@refinitiv-ui/translate": "^7.0.4",
369
+ "@refinitiv-ui/utils": "^7.1.0"
370
370
  },
371
371
  "publishConfig": {
372
372
  "access": "public"
373
373
  },
374
- "gitHead": "7926580c28da963085dceeeb27f9f706b627525c"
374
+ "gitHead": "e162ec78601e5f97201d53d740925ee2075fd95e"
375
375
  }