Skip to content

Commit

Permalink
chore/sync-v6 (#663)
Browse files Browse the repository at this point in the history
* 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/[email protected]
 - @refinitiv-ui/[email protected]

---------

Co-authored-by: wattachai <[email protected]>
Co-authored-by: Wasuwat Limsuparhat <[email protected]>
Co-authored-by: refinitiv-ui-dev <[email protected]>
Co-authored-by: Sarin Udompanish <[email protected]>
  • Loading branch information
5 people authored May 1, 2023
1 parent f64a180 commit 7b7aad0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
8 changes: 8 additions & 0 deletions documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@refinitiv-ui/[email protected]) (2023-04-21)

**Note:** Version bump only for package @refinitiv-ui/docs





## [6.4.9](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/[email protected]...@refinitiv-ui/[email protected]) (2023-03-23)

**Note:** Version bump only for package @refinitiv-ui/docs
Expand Down
11 changes: 11 additions & 0 deletions packages/elements/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@refinitiv-ui/[email protected]) (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/[email protected]...@refinitiv-ui/[email protected]) (2023-03-23)


Expand Down
23 changes: 17 additions & 6 deletions packages/elements/src/calendar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<any> | Map<PropertyKey, unknown>): 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
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions packages/elements/src/combo-box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class ComboBox<T extends DataItem = ItemData> extends FormFieldElement {
[part~=input] {
cursor: text;
}
[hidden] {
display: none !important;
[part~=input]::-ms-clear {
display: none;
}
`;
}
Expand Down Expand Up @@ -1197,12 +1197,12 @@ export class ComboBox<T extends DataItem = ItemData> 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`
<div
id="clears-button"
part="button button-clear"
?hidden=${!this.label && !this.query && !this.freeTextValue && !this.inputText}><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
part="button button-clear"><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
</div>
`;
}
Expand Down

0 comments on commit 7b7aad0

Please sign in to comment.