@refinitiv-ui/elements 6.16.3 → 6.16.5

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,16 @@
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.16.5](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.16.4...@refinitiv-ui/elements@6.16.5) (2024-05-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **datetime-picker:** fix changing format doesn't sync to input ([#1163](https://github.com/Refinitiv/refinitiv-ui/issues/1163)) ([377d1c1](https://github.com/Refinitiv/refinitiv-ui/commit/377d1c1bd81909ab95079a6b627e3cdeb1b81260))
11
+
12
+ ## [6.16.4](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.16.3...@refinitiv-ui/elements@6.16.4) (2024-05-07)
13
+
14
+ **Note:** Version bump only for package @refinitiv-ui/elements
15
+
6
16
  ## [6.16.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.16.2...@refinitiv-ui/elements@6.16.3) (2024-04-01)
7
17
 
8
18
  ### Bug Fixes
@@ -90,7 +90,7 @@
90
90
  },
91
91
  {
92
92
  "name": "format",
93
- "description": "Set the datetime format\nBased on dane-fns datetime formats",
93
+ "description": "Set the datetime format\nBased on date-fns formats (https://date-fns.org/)",
94
94
  "type": "string",
95
95
  "default": "\"dd-MMM-yyyy\""
96
96
  },
@@ -248,7 +248,7 @@
248
248
  {
249
249
  "name": "format",
250
250
  "attribute": "format",
251
- "description": "Set the datetime format\nBased on dane-fns datetime formats",
251
+ "description": "Set the datetime format\nBased on date-fns formats (https://date-fns.org/)",
252
252
  "type": "string",
253
253
  "default": "\"dd-MMM-yyyy\""
254
254
  },
@@ -12,7 +12,7 @@ Control to pick date and time
12
12
  | `error` | `error` | `boolean` | false | Set error state |
13
13
  | `filter` | | `DatetimePickerFilter \| null` | null | Custom filter, used for enabling/disabling certain dates |
14
14
  | `firstDayOfWeek` | `first-day-of-week` | `number \| undefined` | | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
15
- | `format` | `format` | `string` | "dd-MMM-yyyy" | Set the datetime format<br />Based on dane-fns datetime formats |
15
+ | `format` | `format` | `string` | "dd-MMM-yyyy" | Set the datetime format<br />Based on date-fns formats (https://date-fns.org/) |
16
16
  | `inputDisabled` | `input-disabled` | `boolean` | false | Disable input part of the picker |
17
17
  | `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. |
18
18
  | `max` | `max` | `string` | "" | Set maximum date |
@@ -162,7 +162,7 @@ export declare class DatetimePicker extends FormFieldElement implements MultiVal
162
162
  private _format;
163
163
  /**
164
164
  * Set the datetime format
165
- * Based on dane-fns datetime formats
165
+ * Based on date-fns formats (https://date-fns.org/)
166
166
  * @param format Date format
167
167
  * @default dd-MMM-yyyy
168
168
  */
@@ -264,7 +264,7 @@ let DatetimePicker = class DatetimePicker extends FormFieldElement {
264
264
  }
265
265
  /**
266
266
  * Set the datetime format
267
- * Based on dane-fns datetime formats
267
+ * Based on date-fns formats (https://date-fns.org/)
268
268
  * @param format Date format
269
269
  * @default dd-MMM-yyyy
270
270
  */
@@ -359,7 +359,9 @@ let DatetimePicker = class DatetimePicker extends FormFieldElement {
359
359
  if (this.opened && !this.canOpenPopup) {
360
360
  this.opened = false; /* this cannot be nor stopped nor listened */
361
361
  }
362
- if (changedProperties.has('_values') || changedProperties.has(TranslatePropertyKey)) {
362
+ if (changedProperties.has('_values') ||
363
+ changedProperties.has(TranslatePropertyKey) ||
364
+ changedProperties.has('format')) {
363
365
  this.syncInputValues();
364
366
  }
365
367
  if (changedProperties.has('placeholder')) {
@@ -87,14 +87,17 @@ export class ViewportManager {
87
87
  return;
88
88
  }
89
89
  const screenRect = this.screenViewport.getBoundingClientRect();
90
- // since screenViewport is applied on html element, it does not include body zoom
91
- // Zoom is a legacy feature and must not be used by any means.
92
- // Kept here for compatibility with old apps
93
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
94
- // @ts-ignore
95
- // TODO: Remove @ts-ignore and re-test again when standardized zoom is implemented across major browsers and TypeScript, https://github.com/w3c/csswg-drafts/issues/5623
96
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
97
- const zoom = document.body ? parseFloat(window.getComputedStyle(document.body).zoom) : 1;
90
+ /**
91
+ * since screenViewport is applied on html element, it does not include body zoom.
92
+ * Zoom is a legacy feature and must not be used by any means.
93
+ * Kept here for compatibility with old apps.
94
+ *
95
+ * TODO: re-visit once the standardized zoom is implemented across major browsers.
96
+ * https://github.com/w3c/csswg-drafts/issues/5623
97
+ */
98
+ const zoom = document.body
99
+ ? parseFloat(window.getComputedStyle(document.body).getPropertyValue('zoom')) || 1
100
+ : 1;
98
101
  const screenHeight = screenRect.height / zoom;
99
102
  const screenWidth = screenRect.width / zoom;
100
103
  const { top, left, bottom, right } = viewport.getBoundingClientRect();
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.16.3';
1
+ export const VERSION = '6.16.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.16.3",
3
+ "version": "6.16.5",
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.5.6",
354
- "@refinitiv-ui/demo-block": "^6.1.23",
353
+ "@refinitiv-ui/core": "^6.5.7",
354
+ "@refinitiv-ui/demo-block": "^6.1.24",
355
355
  "@refinitiv-ui/i18n": "^6.0.21",
356
356
  "@refinitiv-ui/phrasebook": "^6.3.9",
357
357
  "@refinitiv-ui/test-helpers": "^6.0.15",
358
- "@refinitiv-ui/translate": "^6.0.33",
358
+ "@refinitiv-ui/translate": "^6.0.34",
359
359
  "@refinitiv-ui/utils": "^6.3.2",
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.5.6",
364
+ "@refinitiv-ui/core": "^6.5.7",
365
365
  "@refinitiv-ui/i18n": "^6.0.21",
366
366
  "@refinitiv-ui/phrasebook": "^6.3.9",
367
- "@refinitiv-ui/translate": "^6.0.33",
367
+ "@refinitiv-ui/translate": "^6.0.34",
368
368
  "@refinitiv-ui/utils": "^6.3.2"
369
369
  },
370
370
  "publishConfig": {
371
371
  "access": "public"
372
372
  },
373
- "gitHead": "946b383a1e4f8253620c23c41c2e502f22cb2c6b"
373
+ "gitHead": "3c00d54e43bead9ed6ed224baac0ca27b4ab5ca0"
374
374
  }