@refinitiv-ui/elements 6.19.0 → 6.20.1

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 CHANGED
@@ -3,6 +3,22 @@
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.20.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.20.0...@refinitiv-ui/elements@6.20.1) (2025-07-09)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **icon:** throw error once per session if sprite icon fails to load ([#1285](https://github.com/Refinitiv/refinitiv-ui/issues/1285)) ([db9d54a](https://github.com/Refinitiv/refinitiv-ui/commit/db9d54a4aab9d8278c3446fa463c66ce08ddb420))
11
+
12
+ # [6.20.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.19.0...@refinitiv-ui/elements@6.20.0) (2025-04-28)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **tooltip:** fix tooltip reopen when mouse leaves ([#1279](https://github.com/Refinitiv/refinitiv-ui/issues/1279)) ([6eb3ff3](https://github.com/Refinitiv/refinitiv-ui/commit/6eb3ff3bd92ab5f6c3b37be49519805cd39b1dc7))
17
+
18
+ ### Features
19
+
20
+ - **datetime-picker:** introduce preventCloseOnSelect to prevents the Picker from closing on date selection ([#1278](https://github.com/Refinitiv/refinitiv-ui/issues/1278)) ([4d937e7](https://github.com/Refinitiv/refinitiv-ui/commit/4d937e77fad7b89a56952d4a937da56451002fc5))
21
+
6
22
  # [6.19.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.18.6...@refinitiv-ui/elements@6.19.0) (2025-04-23)
7
23
 
8
24
  ### Features
@@ -76,6 +76,12 @@
76
76
  "type": "boolean",
77
77
  "default": "false"
78
78
  },
79
+ {
80
+ "name": "prevent-close-on-select",
81
+ "description": "Prevents the Picker from closing on date selection.\nNote that if timepicker is true, the picker will remain open regardless of this flag.",
82
+ "type": "boolean",
83
+ "default": "false"
84
+ },
79
85
  {
80
86
  "name": "input-disabled",
81
87
  "description": "Disable input part of the picker",
@@ -237,6 +243,13 @@
237
243
  "type": "boolean",
238
244
  "default": "false"
239
245
  },
246
+ {
247
+ "name": "preventCloseOnSelect",
248
+ "attribute": "prevent-close-on-select",
249
+ "description": "Prevents the Picker from closing on date selection.\nNote that if timepicker is true, the picker will remain open regardless of this flag.",
250
+ "type": "boolean",
251
+ "default": "false"
252
+ },
240
253
  {
241
254
  "name": "inputDisabled",
242
255
  "attribute": "input-disabled",
@@ -4,34 +4,35 @@ Control to pick date and time
4
4
 
5
5
  ## Properties
6
6
 
7
- | Property | Attribute | Type | Default | Description |
8
- |------------------------|--------------------------|----------------------------------|---------------|--------------------------------------------------|
9
- | `amPm` | `am-pm` | `boolean` | false | Toggles 12hr time display |
10
- | `clears` | `clears` | `boolean` | false | Show clears button |
11
- | `disabled` | `disabled` | `boolean` | false | Set disabled state |
12
- | `duplex` | `duplex` | `"" \| "consecutive" \| "split"` | null | Display two calendar pickers. |
13
- | `error` | `error` | `boolean` | false | Set error state |
14
- | `filter` | | `DatetimePickerFilter \| null` | null | Custom filter, used for enabling/disabling certain dates |
15
- | `firstDayOfWeek` | `first-day-of-week` | `number \| undefined` | | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
16
- | `format` | `format` | `string` | "dd-MMM-yyyy" | Set the datetime format<br />Based on date-fns formats (https://date-fns.org/) |
17
- | `inputDisabled` | `input-disabled` | `boolean` | false | Disable input part of the picker |
18
- | `inputTriggerDisabled` | `input-trigger-disabled` | `boolean` | false | Only open picker panel when calendar icon is clicked.<br />Clicking on the input will no longer open the picker. |
19
- | `max` | `max` | `string` | "" | Set maximum date |
20
- | `min` | `min` | `string` | "" | Set minimum date |
21
- | `opened` | `opened` | `boolean` | false | Toggles the opened state of the list |
22
- | `placeholder` | `placeholder` | `string` | "dd-MMM-yyyy" | Set placeholder text default depends on format |
23
- | `popupDisabled` | `popup-disabled` | `boolean` | false | Disable the popup |
24
- | `range` | `range` | `boolean` | false | Set to switch to range select mode |
25
- | `readonly` | `readonly` | `boolean` | false | Set readonly state |
26
- | `showSeconds` | `show-seconds` | `boolean` | false | Flag to show seconds time segment in display.<br />Seconds are automatically shown when `hh:mm:ss` time format is provided as a value. |
27
- | `timepicker` | `timepicker` | `boolean` | false | Toggle to display the time picker |
28
- | `value` | `value` | `string` | "" | Current date time value |
29
- | `values` | `values` | `string[]` | [] | Set multiple selected values |
30
- | `view` | `view` | `string` | "" | Set the current calendar view.<br />Accepted format: 'yyyy-MM' |
31
- | `views` | | `string[]` | [] | Set the current calendar views for duplex mode<br />Accepted format: 'yyyy-MM' |
32
- | `warning` | `warning` | `boolean` | false | Set warning state |
33
- | `weekdaysOnly` | `weekdays-only` | `boolean` | false | Only enable weekdays |
34
- | `weekendsOnly` | `weekends-only` | `boolean` | false | Only enable weekends |
7
+ | Property | Attribute | Type | Default | Description |
8
+ |------------------------|---------------------------|----------------------------------|---------------|--------------------------------------------------|
9
+ | `amPm` | `am-pm` | `boolean` | false | Toggles 12hr time display |
10
+ | `clears` | `clears` | `boolean` | false | Show clears button |
11
+ | `disabled` | `disabled` | `boolean` | false | Set disabled state |
12
+ | `duplex` | `duplex` | `"" \| "consecutive" \| "split"` | null | Display two calendar pickers. |
13
+ | `error` | `error` | `boolean` | false | Set error state |
14
+ | `filter` | | `DatetimePickerFilter \| null` | null | Custom filter, used for enabling/disabling certain dates |
15
+ | `firstDayOfWeek` | `first-day-of-week` | `number \| undefined` | | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
16
+ | `format` | `format` | `string` | "dd-MMM-yyyy" | Set the datetime format<br />Based on date-fns formats (https://date-fns.org/) |
17
+ | `inputDisabled` | `input-disabled` | `boolean` | false | Disable input part of the picker |
18
+ | `inputTriggerDisabled` | `input-trigger-disabled` | `boolean` | false | Only open picker panel when calendar icon is clicked.<br />Clicking on the input will no longer open the picker. |
19
+ | `max` | `max` | `string` | "" | Set maximum date |
20
+ | `min` | `min` | `string` | "" | Set minimum date |
21
+ | `opened` | `opened` | `boolean` | false | Toggles the opened state of the list |
22
+ | `placeholder` | `placeholder` | `string` | "dd-MMM-yyyy" | Set placeholder text default depends on format |
23
+ | `popupDisabled` | `popup-disabled` | `boolean` | false | Disable the popup |
24
+ | `preventCloseOnSelect` | `prevent-close-on-select` | `boolean` | false | Prevents the Picker from closing on date selection.<br />Note that if timepicker is true, the picker will remain open regardless of this flag. |
25
+ | `range` | `range` | `boolean` | false | Set to switch to range select mode |
26
+ | `readonly` | `readonly` | `boolean` | false | Set readonly state |
27
+ | `showSeconds` | `show-seconds` | `boolean` | false | Flag to show seconds time segment in display.<br />Seconds are automatically shown when `hh:mm:ss` time format is provided as a value. |
28
+ | `timepicker` | `timepicker` | `boolean` | false | Toggle to display the time picker |
29
+ | `value` | `value` | `string` | "" | Current date time value |
30
+ | `values` | `values` | `string[]` | [] | Set multiple selected values |
31
+ | `view` | `view` | `string` | "" | Set the current calendar view.<br />Accepted format: 'yyyy-MM' |
32
+ | `views` | | `string[]` | [] | Set the current calendar views for duplex mode<br />Accepted format: 'yyyy-MM' |
33
+ | `warning` | `warning` | `boolean` | false | Set warning state |
34
+ | `weekdaysOnly` | `weekdays-only` | `boolean` | false | Only enable weekdays |
35
+ | `weekendsOnly` | `weekends-only` | `boolean` | false | Only enable weekends |
35
36
 
36
37
  ## Methods
37
38
 
@@ -154,6 +154,11 @@ export declare class DatetimePicker extends FormFieldElement implements MultiVal
154
154
  * Clicking on the input will no longer open the picker.
155
155
  */
156
156
  inputTriggerDisabled: boolean;
157
+ /**
158
+ * Prevents the Picker from closing on date selection.
159
+ * Note that if timepicker is true, the picker will remain open regardless of this flag.
160
+ */
161
+ preventCloseOnSelect: boolean;
157
162
  /**
158
163
  * Disable input part of the picker
159
164
  */
@@ -104,6 +104,11 @@ let DatetimePicker = class DatetimePicker extends FormFieldElement {
104
104
  * Clicking on the input will no longer open the picker.
105
105
  */
106
106
  this.inputTriggerDisabled = false;
107
+ /**
108
+ * Prevents the Picker from closing on date selection.
109
+ * Note that if timepicker is true, the picker will remain open regardless of this flag.
110
+ */
111
+ this.preventCloseOnSelect = false;
107
112
  /**
108
113
  * Disable input part of the picker
109
114
  */
@@ -794,6 +799,9 @@ let DatetimePicker = class DatetimePicker extends FormFieldElement {
794
799
  // Close popup if there is no time picker
795
800
  const newValues = this.values;
796
801
  if (!this.timepicker && newValues[0] && (this.range ? newValues[1] : true)) {
802
+ if (this.preventCloseOnSelect) {
803
+ return;
804
+ }
797
805
  this.setOpened(false);
798
806
  /**
799
807
  * Custom cell selection delegates focus back to the text field when the overlay is closed,
@@ -1279,6 +1287,9 @@ __decorate([
1279
1287
  __decorate([
1280
1288
  property({ type: Boolean, attribute: 'input-trigger-disabled' })
1281
1289
  ], DatetimePicker.prototype, "inputTriggerDisabled", void 0);
1290
+ __decorate([
1291
+ property({ type: Boolean, attribute: 'prevent-close-on-select' })
1292
+ ], DatetimePicker.prototype, "preventCloseOnSelect", void 0);
1282
1293
  __decorate([
1283
1294
  property({ type: Boolean, attribute: 'input-disabled', reflect: true })
1284
1295
  ], DatetimePicker.prototype, "inputDisabled", void 0);
package/lib/icon/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { consume } from '@lit-labs/context';
3
- import { BasicElement, DeprecationNotice, css, svg } from '@refinitiv-ui/core';
3
+ import { BasicElement, DeprecationNotice, ErrorThrower, css, svg } from '@refinitiv-ui/core';
4
4
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
5
5
  import { property } from '@refinitiv-ui/core/decorators/property.js';
6
6
  import { unsafeSVG } from '@refinitiv-ui/core/directives/unsafe-svg.js';
@@ -19,6 +19,7 @@ const EmptyTemplate = svg ``;
19
19
  * As the cache key is an absolute URL, we can assume no clashes will occur.
20
20
  */
21
21
  export const iconTemplateCache = new Map();
22
+ const errorThrower = new ErrorThrower();
22
23
  let Icon = class Icon extends BasicElement {
23
24
  /**
24
25
  * Element version number
@@ -179,7 +180,9 @@ let Icon = class Icon extends BasicElement {
179
180
  void this.loadAndRenderIcon(iconProperty);
180
181
  }
181
182
  else {
182
- void this.loadAndRenderSpriteIcon(iconProperty);
183
+ void this.loadAndRenderSpriteIcon(iconProperty).catch((error) => {
184
+ errorThrower.once(String(error));
185
+ });
183
186
  }
184
187
  }
185
188
  /**
@@ -156,11 +156,6 @@ declare class Tooltip extends BasicElement {
156
156
  * Hide tooltip
157
157
  * @returns {void}
158
158
  */
159
- private hideTooltip;
160
- /**
161
- * Reset tooltip
162
- * @returns {void}
163
- */
164
159
  private resetTooltip;
165
160
  /**
166
161
  * Run when mouse is moving over the document
@@ -63,11 +63,15 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
63
63
  window.clearTimeout(this.timerTimeout);
64
64
  };
65
65
  /**
66
- * Reset tooltip
66
+ * Hide tooltip
67
67
  * @returns {void}
68
68
  */
69
69
  this.resetTooltip = () => {
70
- this.hideTooltip();
70
+ this.reset();
71
+ this.matchTarget = null;
72
+ this.matchTargetRect = null;
73
+ this.positionTarget = null;
74
+ this.setOpened(false);
71
75
  };
72
76
  /**
73
77
  * Run when mouse is moving over the document
@@ -84,7 +88,7 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
84
88
  */
85
89
  this.onClick = () => {
86
90
  this.clicked = true;
87
- this.hideTooltip();
91
+ this.resetTooltip();
88
92
  };
89
93
  /**
90
94
  * Run when document mouse out event happens
@@ -328,17 +332,6 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
328
332
  }
329
333
  this.appendChild(contentNode);
330
334
  }
331
- /**
332
- * Hide tooltip
333
- * @returns {void}
334
- */
335
- hideTooltip() {
336
- this.reset();
337
- this.matchTarget = null;
338
- this.matchTargetRect = null;
339
- this.positionTarget = null;
340
- this.setOpened(false);
341
- }
342
335
  /**
343
336
  * Try to show the tooltip if it matches the target
344
337
  * @param paths The paths leading to target
@@ -29,6 +29,7 @@ class TooltipManager {
29
29
  * @returns {void}
30
30
  */
31
31
  this.onClick = (event) => {
32
+ this.cancelThrottler();
32
33
  this.registry.forEach(({ click }) => click(event));
33
34
  };
34
35
  /**
@@ -36,6 +37,7 @@ class TooltipManager {
36
37
  * @returns {void}
37
38
  */
38
39
  this.onMouseOut = (event) => {
40
+ this.cancelThrottler();
39
41
  this.registry.forEach(({ mouseout }) => mouseout(event));
40
42
  };
41
43
  /**
@@ -43,6 +45,7 @@ class TooltipManager {
43
45
  * @returns {void}
44
46
  */
45
47
  this.onMouseLeave = (event) => {
48
+ this.cancelThrottler();
46
49
  this.registry.forEach(({ mouseleave }) => mouseleave(event));
47
50
  };
48
51
  /**
@@ -50,6 +53,7 @@ class TooltipManager {
50
53
  * @returns {void}
51
54
  */
52
55
  this.onWheel = (event) => {
56
+ this.cancelThrottler();
53
57
  this.registry.forEach(({ wheel }) => wheel(event));
54
58
  };
55
59
  /**
@@ -57,6 +61,7 @@ class TooltipManager {
57
61
  * @returns {void}
58
62
  */
59
63
  this.onKeyDown = (event) => {
64
+ this.cancelThrottler();
60
65
  this.registry.forEach(({ keydown }) => keydown(event));
61
66
  };
62
67
  /**
@@ -64,6 +69,7 @@ class TooltipManager {
64
69
  * @returns {void}
65
70
  */
66
71
  this.onBlur = (event) => {
72
+ this.cancelThrottler();
67
73
  this.registry.forEach(({ blur }) => blur(event));
68
74
  };
69
75
  }
@@ -89,6 +95,16 @@ class TooltipManager {
89
95
  }
90
96
  }
91
97
  }
98
+ /**
99
+ * Cancel the pending task of throttled mousemove event listener.
100
+ * This prevents the task from running out of order compared to the event dispatching sequence
101
+ * due to its setTimeout usage.
102
+ * Any event listener hiding the tooltip should call this method.
103
+ * @returns {void}
104
+ */
105
+ cancelThrottler() {
106
+ this.titleThrottler.task?.cancel();
107
+ }
92
108
  register(tooltip, documentCallbacks) {
93
109
  if (!this.registry.size) {
94
110
  // IE11 does not support event options
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.19.0';
1
+ export const VERSION = '6.20.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.19.0",
3
+ "version": "6.20.1",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "LSEG",
6
6
  "license": "Apache-2.0",
@@ -350,25 +350,25 @@
350
350
  "tslib": "^2.3.1"
351
351
  },
352
352
  "devDependencies": {
353
- "@refinitiv-ui/core": "^6.6.1",
354
- "@refinitiv-ui/demo-block": "^6.1.30",
353
+ "@refinitiv-ui/core": "^6.6.2",
354
+ "@refinitiv-ui/demo-block": "^6.1.31",
355
355
  "@refinitiv-ui/i18n": "^6.0.22",
356
356
  "@refinitiv-ui/phrasebook": "^6.3.9",
357
357
  "@refinitiv-ui/test-helpers": "^6.1.0",
358
- "@refinitiv-ui/translate": "^6.0.36",
358
+ "@refinitiv-ui/translate": "^6.0.37",
359
359
  "@refinitiv-ui/utils": "^6.4.0",
360
360
  "@types/d3-interpolate": "^3.0.1"
361
361
  },
362
362
  "peerDependencies": {
363
363
  "@refinitiv-ui/browser-sparkline": "^1.0.0 || ^2.0.0",
364
- "@refinitiv-ui/core": "^6.6.1",
364
+ "@refinitiv-ui/core": "^6.6.2",
365
365
  "@refinitiv-ui/i18n": "^6.0.22",
366
366
  "@refinitiv-ui/phrasebook": "^6.3.9",
367
- "@refinitiv-ui/translate": "^6.0.36",
367
+ "@refinitiv-ui/translate": "^6.0.37",
368
368
  "@refinitiv-ui/utils": "^6.4.0"
369
369
  },
370
370
  "publishConfig": {
371
371
  "access": "public"
372
372
  },
373
- "gitHead": "1d093a683a9b34ed8d0cbfcf3c8e4e14361b787a"
373
+ "gitHead": "ffbf4a93c4fe5f583dace149901da15cedc87bec"
374
374
  }