@refinitiv-ui/elements 6.7.2 → 6.7.3

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,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.7.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.7.2...@refinitiv-ui/elements@6.7.3) (2023-04-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **calendar:** unexpected `blur` event fired when view changes ([#655](https://github.com/Refinitiv/refinitiv-ui/issues/655)) ([fae9141](https://github.com/Refinitiv/refinitiv-ui/commit/fae9141ed0e0832fc51175bfc3e90dbb35d82497))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.7.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.7.1...@refinitiv-ui/elements@6.7.2) (2023-03-23)
7
18
 
8
19
 
@@ -5,6 +5,7 @@ import type { CalendarFilter } from './types';
5
5
  import './locales.js';
6
6
  import '../button/index.js';
7
7
  import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
8
+ import { PropertyValueMap } from 'lit';
8
9
  export { CalendarFilter };
9
10
  /**
10
11
  * Standard calendar element
@@ -178,6 +179,13 @@ export declare class Calendar extends ControlElement implements MultiValue {
178
179
  * @returns promise
179
180
  */
180
181
  protected performUpdate(): Promise<void>;
182
+ /**
183
+ * Invoked before update() to compute values needed during the update.
184
+ * Implement willUpdate to compute property values that depend on other properties and are used in the rest of the update process.
185
+ * @param changedProperties Properties that will change
186
+ * @returns {void}
187
+ */
188
+ protected willUpdate(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
181
189
  /**
182
190
  * Updates the element
183
191
  * @param changedProperties Properties that has changed
@@ -345,6 +345,20 @@ let Calendar = class Calendar extends ControlElement {
345
345
  this.localFirstDayOfWeek = isNaN(localFirstDayOfWeek) ? FIRST_DAY_OF_WEEK : (localFirstDayOfWeek % 7);
346
346
  void super.performUpdate();
347
347
  }
348
+ /**
349
+ * Invoked before update() to compute values needed during the update.
350
+ * Implement willUpdate to compute property values that depend on other properties and are used in the rest of the update process.
351
+ * @param changedProperties Properties that will change
352
+ * @returns {void}
353
+ */
354
+ willUpdate(changedProperties) {
355
+ super.willUpdate(changedProperties);
356
+ // This code is here to ensure that focus is not lost
357
+ // while navigating through the render views using keyboard
358
+ if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) {
359
+ this.viewBtnRef.value.focus();
360
+ }
361
+ }
348
362
  /**
349
363
  * Updates the element
350
364
  * @param changedProperties Properties that has changed
@@ -372,11 +386,6 @@ let Calendar = class Calendar extends ControlElement {
372
386
  */
373
387
  updated(changedProperties) {
374
388
  super.updated(changedProperties);
375
- // This code is here to ensure that focus is not lost
376
- // while navigating through the render views using keyboard
377
- if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) {
378
- this.viewBtnRef.value.focus();
379
- }
380
389
  const cellIndex = this.activeCellIndex;
381
390
  if (cellIndex && changedProperties.has('activeCellIndex')) {
382
391
  const dateButtonEl = this.getDateButtonByIndex(cellIndex);
@@ -163,9 +163,6 @@ let ComboBox = class ComboBox extends FormFieldElement {
163
163
  [part~=input]::-ms-clear {
164
164
  display: none;
165
165
  }
166
- [hidden] {
167
- display: none !important;
168
- }
169
166
  `;
170
167
  }
171
168
  /**
@@ -1008,12 +1005,12 @@ let ComboBox = class ComboBox extends FormFieldElement {
1008
1005
  * @returns Popup template or undefined
1009
1006
  */
1010
1007
  get clearButtonTemplate() {
1011
- if (this.clears) {
1008
+ const hasText = (this.label || this.query || this.freeTextValue || this.inputText);
1009
+ if (this.clears && hasText) {
1012
1010
  return html `
1013
1011
  <div
1014
1012
  id="clears-button"
1015
- part="button button-clear"
1016
- ?hidden=${!this.label && !this.query && !this.freeTextValue && !this.inputText}><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
1013
+ part="button button-clear"><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
1017
1014
  </div>
1018
1015
  `;
1019
1016
  }
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.7.2';
1
+ export const VERSION = '6.7.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.7.2",
3
+ "version": "6.7.3",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "LSEG",
6
6
  "license": "Apache-2.0",
@@ -366,5 +366,5 @@
366
366
  "publishConfig": {
367
367
  "access": "public"
368
368
  },
369
- "gitHead": "ba91d5016c61a0a656ac42f60cf722ed1272fe9e"
369
+ "gitHead": "ef1aaabba6f26738f0a7e838025ca2158173796f"
370
370
  }