@refinitiv-ui/elements 7.11.0 → 7.11.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,13 @@
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.11.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.11.0...@refinitiv-ui/elements@7.11.1) (2024-05-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **chart:** fix gridlines colors ([#1161](https://github.com/Refinitiv/refinitiv-ui/issues/1161)) ([b59da6d](https://github.com/Refinitiv/refinitiv-ui/commit/b59da6d962d1e8026391df53c76c0fb1549738ca))
11
+ - **datetime-picker:** fix changing format doesn't sync to input ([#1164](https://github.com/Refinitiv/refinitiv-ui/issues/1164)) ([f63decc](https://github.com/Refinitiv/refinitiv-ui/commit/f63decc53ba9941bdc26b8ea432ca62525135111))
12
+
6
13
  # [7.11.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.10.10...@refinitiv-ui/elements@7.11.0) (2024-05-07)
7
14
 
8
15
  ### Features
@@ -112,6 +112,12 @@ export declare class Chart extends BasicElement {
112
112
  * @returns {void}
113
113
  */
114
114
  protected beforeUpdate: (chart: ChartJS) => void;
115
+ /**
116
+ * Set grid color in beforeUpdate event from Chartjs
117
+ * @param chart Chart.js instance
118
+ * @returns {void}
119
+ */
120
+ private decorateGridColors;
115
121
  /**
116
122
  * Inject theme color into each datasets
117
123
  * @param chart Chart.js instance
@@ -39,6 +39,7 @@ let Chart = class Chart extends BasicElement {
39
39
  // set global config again in case the CSS font isn't loaded when updating the chart
40
40
  this.setGlobalConfig();
41
41
  this.decorateColors(chart);
42
+ this.decorateGridColors(chart);
42
43
  };
43
44
  /**
44
45
  * Inject theme color into each datasets
@@ -395,12 +396,6 @@ let Chart = class Chart extends BasicElement {
395
396
  ChartJS.defaults.font.family = cssStyle.getPropertyValue('font-family');
396
397
  ChartJS.defaults.font.size = Number(cssStyle.getPropertyValue('font-size').replace('px', ''));
397
398
  ChartJS.defaults.font.style = cssStyle.getPropertyValue('font-style');
398
- // Set global grid color
399
- ChartJS.defaults.scale.grid.color = (line) => {
400
- return line.index === 0
401
- ? this.getComputedVariable('--zero-line-color', 'transparent')
402
- : this.getComputedVariable('--grid-line-color', 'transparent');
403
- };
404
399
  if (ChartJS.defaults.scales.radialLinear) {
405
400
  ChartJS.defaults.scales.radialLinear.ticks.showLabelBackdrop = false;
406
401
  }
@@ -425,6 +420,27 @@ let Chart = class Chart extends BasicElement {
425
420
  const result = parseFloat(cssComputeVar);
426
421
  return isNaN(result) ? undefined : result;
427
422
  }
423
+ /**
424
+ * Set grid color in beforeUpdate event from Chartjs
425
+ * @param chart Chart.js instance
426
+ * @returns {void}
427
+ */
428
+ decorateGridColors(chart) {
429
+ for (const scale of Object.keys(chart.scales)) {
430
+ const axis = chart.options?.scales?.[scale];
431
+ const userAxis = this.config?.options?.scales?.[scale];
432
+ const userGridColor = userAxis?.grid?.color;
433
+ const userBorderColor = userAxis?.border?.color;
434
+ // Change grid color if the color is the default value of `rgba(0,0,0,0.1)`
435
+ if (axis && userGridColor === 'rgba(0,0,0,0.1)') {
436
+ axis.grid.color = this.getComputedVariable('--grid-line-color', 'transparent');
437
+ }
438
+ // Change border color if the color is the default value of `rgba(0,0,0,0.1)`
439
+ if (axis && userBorderColor === 'rgba(0,0,0,0.1)') {
440
+ axis.border.color = this.getComputedVariable('--zero-line-color', 'transparent');
441
+ }
442
+ }
443
+ }
428
444
  /**
429
445
  * Merges all the different layers of the config.
430
446
  * @returns {void}
@@ -358,7 +358,9 @@ let DatetimePicker = class DatetimePicker extends FormFieldElement {
358
358
  if (this.opened && !this.canOpenPopup) {
359
359
  this.opened = false; /* this cannot be nor stopped nor listened */
360
360
  }
361
- if (changedProperties.has('_values') || changedProperties.has(TranslatePropertyKey)) {
361
+ if (changedProperties.has('_values') ||
362
+ changedProperties.has(TranslatePropertyKey) ||
363
+ changedProperties.has('format')) {
362
364
  this.syncInputValues();
363
365
  }
364
366
  if (changedProperties.has('placeholder')) {
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.11.0';
1
+ export const VERSION = '7.11.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "7.11.0",
3
+ "version": "7.11.1",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "LSEG",
6
6
  "license": "Apache-2.0",
@@ -373,5 +373,5 @@
373
373
  "publishConfig": {
374
374
  "access": "public"
375
375
  },
376
- "gitHead": "b689d22c6cc53274a12b42233d087f9d5ccdee2e"
376
+ "gitHead": "40fe09a69794fb8d964d638498b0f4fe31b50e7e"
377
377
  }