From 7b7aad081abba28685bb9352c4f01f33a5e2de45 Mon Sep 17 00:00:00 2001 From: Sarin-Udompanish <86759822+Sarin-Udompanish@users.noreply.github.com> Date: Mon, 1 May 2023 11:45:11 +0700 Subject: [PATCH] chore/sync-v6 (#663) * test: increase mocha test timeout to 5 sec (#642) * refactor(combo-box): use conditional template rendering instead of `hidden` attribute to hide clear icon (#602) * fix(calendar): unexpected `blur` event fired when view changes (#655) * chore(release): publish [skip ci] - @refinitiv-ui/docs@6.4.10 - @refinitiv-ui/elements@6.7.3 --------- Co-authored-by: wattachai <117723407+wattachai-lseg@users.noreply.github.com> Co-authored-by: Wasuwat Limsuparhat <86233706+wsuwt@users.noreply.github.com> Co-authored-by: refinitiv-ui-dev Co-authored-by: Sarin Udompanish --- documents/CHANGELOG.md | 8 ++++++++ packages/elements/CHANGELOG.md | 11 +++++++++++ packages/elements/src/calendar/index.ts | 23 +++++++++++++++++------ packages/elements/src/combo-box/index.ts | 10 +++++----- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/documents/CHANGELOG.md b/documents/CHANGELOG.md index 53f30eb1e1..4c65fa8dfa 100644 --- a/documents/CHANGELOG.md +++ b/documents/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.4.10](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/docs@6.4.9...@refinitiv-ui/docs@6.4.10) (2023-04-21) + +**Note:** Version bump only for package @refinitiv-ui/docs + + + + + ## [6.4.9](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/docs@6.4.8...@refinitiv-ui/docs@6.4.9) (2023-03-23) **Note:** Version bump only for package @refinitiv-ui/docs diff --git a/packages/elements/CHANGELOG.md b/packages/elements/CHANGELOG.md index c33baba134..5a17dbf1d4 100644 --- a/packages/elements/CHANGELOG.md +++ b/packages/elements/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [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) + + +### Bug Fixes + +* **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)) + + + + + ## [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) diff --git a/packages/elements/src/calendar/index.ts b/packages/elements/src/calendar/index.ts index 65b9605f9a..55040ae71e 100644 --- a/packages/elements/src/calendar/index.ts +++ b/packages/elements/src/calendar/index.ts @@ -84,6 +84,7 @@ import type { Button } from '../button'; import './locales.js'; import '../button/index.js'; import '@refinitiv-ui/phrasebook/locale/en/calendar.js'; +import { PropertyValueMap } from 'lit'; export { CalendarFilter @@ -479,6 +480,22 @@ export class Calendar extends ControlElement implements MultiValue { void super.performUpdate(); } + /** + * Invoked before update() to compute values needed during the update. + * Implement willUpdate to compute property values that depend on other properties and are used in the rest of the update process. + * @param changedProperties Properties that will change + * @returns {void} + */ + protected willUpdate (changedProperties: PropertyValueMap | Map): void { + super.willUpdate(changedProperties); + + // This code is here to ensure that focus is not lost + // while navigating through the render views using keyboard + if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) { + this.viewBtnRef.value.focus(); + } + } + /** * Updates the element * @param changedProperties Properties that has changed @@ -509,12 +526,6 @@ export class Calendar extends ControlElement implements MultiValue { protected updated (changedProperties: PropertyValues): void { super.updated(changedProperties); - // This code is here to ensure that focus is not lost - // while navigating through the render views using keyboard - if (this.focused && changedProperties.has('renderView') && this.viewBtnRef.value && this.activeElement !== this.viewBtnRef.value) { - this.viewBtnRef.value.focus(); - } - const cellIndex = this.activeCellIndex; if (cellIndex && changedProperties.has('activeCellIndex')) { const dateButtonEl = this.getDateButtonByIndex(cellIndex); diff --git a/packages/elements/src/combo-box/index.ts b/packages/elements/src/combo-box/index.ts index 7dd26bdf81..237619b326 100644 --- a/packages/elements/src/combo-box/index.ts +++ b/packages/elements/src/combo-box/index.ts @@ -102,8 +102,8 @@ export class ComboBox extends FormFieldElement { [part~=input] { cursor: text; } - [hidden] { - display: none !important; + [part~=input]::-ms-clear { + display: none; } `; } @@ -1197,12 +1197,12 @@ export class ComboBox extends FormFieldElement { * @returns Popup template or undefined */ protected get clearButtonTemplate (): TemplateResult | undefined { - if (this.clears) { + const hasText = (this.label || this.query || this.freeTextValue || this.inputText); + if (this.clears && hasText) { return html`
+ part="button button-clear">
`; }