Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-calendar): get correct names size #7860

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)


### Bug Fixes

* declare webpackChunkName in generated dynamic imports for readable runtime bundle names ([#7835](https://github.com/SAP/ui5-webcomponents/issues/7835)) ([592a10b](https://github.com/SAP/ui5-webcomponents/commit/592a10b25a14da89885874c40c5c7a192b8b4d85))
* **ui5-list:** shift+tab navigation in List ([#7728](https://github.com/SAP/ui5-webcomponents/issues/7728)) ([399b941](https://github.com/SAP/ui5-webcomponents/commit/399b941ebeae7b44f6dba9cd4e8ec7ebb6f283c6))


### Features

* **ui5-illustrated-message:** titleLevel property added ([#7771](https://github.com/SAP/ui5-webcomponents/issues/7771)) ([2883c58](https://github.com/SAP/ui5-webcomponents/commit/2883c587f367e51e0f08065498b990f86e60e88c)), closes [#7037](https://github.com/SAP/ui5-webcomponents/issues/7037)





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"packages/playground",
"packages/create-package"
],
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"command": {
"publish": {
"allowBranch": "*",
Expand Down
8 changes: 8 additions & 0 deletions packages/base/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)

**Note:** Version bump only for package @ui5/webcomponents-base





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)


Expand Down
4 changes: 2 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-base",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: webcomponents.base",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@buxlabs/amd-to-es6": "0.16.1",
"@openui5/sap.ui.core": "1.116.0",
"@ui5/webcomponents-tools": "1.20.0-rc.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "117.0.3",
"clean-css": "^5.2.2",
"copy-and-watch": "^0.1.5",
Expand Down
8 changes: 8 additions & 0 deletions packages/create-package/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)

**Note:** Version bump only for package @ui5/create-webcomponents-package





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)

**Note:** Version bump only for package @ui5/create-webcomponents-package
Expand Down
2 changes: 1 addition & 1 deletion packages/create-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/create-webcomponents-package",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: create package",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/fiori/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)


### Features

* **ui5-illustrated-message:** titleLevel property added ([#7771](https://github.com/SAP/ui5-webcomponents/issues/7771)) ([2883c58](https://github.com/SAP/ui5-webcomponents/commit/2883c587f367e51e0f08065498b990f86e60e88c)), closes [#7037](https://github.com/SAP/ui5-webcomponents/issues/7037)





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)


Expand Down
12 changes: 6 additions & 6 deletions packages/fiori/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-fiori",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: webcomponents.fiori",
"ui5": {
"webComponentsPackage": true
Expand Down Expand Up @@ -41,14 +41,14 @@
"directory": "packages/fiori"
},
"dependencies": {
"@ui5/webcomponents": "1.20.0-rc.0",
"@ui5/webcomponents-base": "1.20.0-rc.0",
"@ui5/webcomponents-icons": "1.20.0-rc.0",
"@ui5/webcomponents-theming": "1.20.0-rc.0",
"@ui5/webcomponents": "1.20.0-rc.1",
"@ui5/webcomponents-base": "1.20.0-rc.1",
"@ui5/webcomponents-icons": "1.20.0-rc.1",
"@ui5/webcomponents-theming": "1.20.0-rc.1",
"@zxing/library": "^0.17.1"
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "117.0.3"
}
}
8 changes: 8 additions & 0 deletions packages/icons-business-suite/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)

**Note:** Version bump only for package @ui5/webcomponents-icons-business-suite





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)

**Note:** Version bump only for package @ui5/webcomponents-icons-business-suite
Expand Down
6 changes: 3 additions & 3 deletions packages/icons-business-suite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-icons-business-suite",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: SAP Fiori Tools icon set",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand All @@ -27,9 +27,9 @@
"directory": "packages/icons-business-suite"
},
"dependencies": {
"@ui5/webcomponents-base": "1.20.0-rc.0"
"@ui5/webcomponents-base": "1.20.0-rc.1"
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.0"
"@ui5/webcomponents-tools": "1.20.0-rc.1"
}
}
8 changes: 8 additions & 0 deletions packages/icons-tnt/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)

**Note:** Version bump only for package @ui5/webcomponents-icons-tnt





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)

**Note:** Version bump only for package @ui5/webcomponents-icons-tnt
Expand Down
6 changes: 3 additions & 3 deletions packages/icons-tnt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-icons-tnt",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: SAP Fiori Tools icon set",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand All @@ -27,9 +27,9 @@
"directory": "packages/icons-tnt"
},
"dependencies": {
"@ui5/webcomponents-base": "1.20.0-rc.0"
"@ui5/webcomponents-base": "1.20.0-rc.1"
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.0"
"@ui5/webcomponents-tools": "1.20.0-rc.1"
}
}
8 changes: 8 additions & 0 deletions packages/icons/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)

**Note:** Version bump only for package @ui5/webcomponents-icons





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)

**Note:** Version bump only for package @ui5/webcomponents-icons
Expand Down
6 changes: 3 additions & 3 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-icons",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: webcomponents.SAP-icons",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand All @@ -27,9 +27,9 @@
"directory": "packages/icons"
},
"dependencies": {
"@ui5/webcomponents-base": "1.20.0-rc.0"
"@ui5/webcomponents-base": "1.20.0-rc.1"
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.0"
"@ui5/webcomponents-tools": "1.20.0-rc.1"
}
}
11 changes: 11 additions & 0 deletions packages/localization/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)


### Bug Fixes

* declare webpackChunkName in generated dynamic imports for readable runtime bundle names ([#7835](https://github.com/SAP/ui5-webcomponents/issues/7835)) ([592a10b](https://github.com/SAP/ui5-webcomponents/commit/592a10b25a14da89885874c40c5c7a192b8b4d85))





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)

**Note:** Version bump only for package @ui5/webcomponents-localization
Expand Down
6 changes: 3 additions & 3 deletions packages/localization/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-localization",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "Localization for UI5 Web Components",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,13 +29,13 @@
},
"devDependencies": {
"@openui5/sap.ui.core": "1.116.0",
"@ui5/webcomponents-tools": "1.20.0-rc.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "117.0.3",
"mkdirp": "^1.0.4",
"resolve": "^1.20.0"
},
"dependencies": {
"@types/openui5": "^1.113.0",
"@ui5/webcomponents-base": "1.20.0-rc.0"
"@ui5/webcomponents-base": "1.20.0-rc.1"
}
}
11 changes: 11 additions & 0 deletions packages/main/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.

# [1.20.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.0...v1.20.0-rc.1) (2023-11-16)


### Bug Fixes

* **ui5-list:** shift+tab navigation in List ([#7728](https://github.com/SAP/ui5-webcomponents/issues/7728)) ([399b941](https://github.com/SAP/ui5-webcomponents/commit/399b941ebeae7b44f6dba9cd4e8ec7ebb6f283c6))





# [1.20.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.19.0...v1.20.0-rc.0) (2023-11-09)


Expand Down
12 changes: 6 additions & 6 deletions packages/main/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents",
"version": "1.20.0-rc.0",
"version": "1.20.0-rc.1",
"description": "UI5 Web Components: webcomponents.main",
"ui5": {
"webComponentsPackage": true
Expand Down Expand Up @@ -43,13 +43,13 @@
"directory": "packages/main"
},
"dependencies": {
"@ui5/webcomponents-base": "1.20.0-rc.0",
"@ui5/webcomponents-icons": "1.20.0-rc.0",
"@ui5/webcomponents-localization": "1.20.0-rc.0",
"@ui5/webcomponents-theming": "1.20.0-rc.0"
"@ui5/webcomponents-base": "1.20.0-rc.1",
"@ui5/webcomponents-icons": "1.20.0-rc.1",
"@ui5/webcomponents-localization": "1.20.0-rc.1",
"@ui5/webcomponents-theming": "1.20.0-rc.1"
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "117.0.3"
}
}
18 changes: 16 additions & 2 deletions packages/main/src/DayPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,14 @@ class DayPicker extends CalendarPart implements ICalendarPicker {

let dayOfTheWeek;

const aDayNamesWide = localeData.getDays("wide", this._primaryCalendarType);
const aDayNamesAbbreviated = localeData.getDays("abbreviated", this._primaryCalendarType);
const aDayNamesWide = localeData.getDays("wide", this._primaryCalendarType) as Array<string>;
let aDayNamesAbbreviated = localeData.getDays("abbreviated", this._primaryCalendarType) as Array<string>;
let dayName;

if (this.namesTooLong(aDayNamesAbbreviated)) {
aDayNamesAbbreviated = localeData.getDays("narrow", this._primaryCalendarType) as Array<string>;
}

this._dayNames = [];
this._dayNames.push({
classes: "ui5-dp-dayname",
Expand All @@ -370,6 +374,16 @@ class DayPicker extends CalendarPart implements ICalendarPicker {
}
}

/**
* Tells if any of the days is more than 4 characters(too long to render).
* @param { Array<string> } dayNames
* @returns { boolean }
* @private
*/
namesTooLong(dayNames: Array<string>): boolean {
return dayNames.some(dayName => dayName.length > 3);
}

onAfterRendering() {
if (this._autoFocus && !this._hidden) {
this.focus();
Expand Down
17 changes: 17 additions & 0 deletions packages/main/test/specs/DayPicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,21 @@ describe("Day Picker Tests", () => {

assert.strictEqual(selectedDate, new Date(Date.now() + 24 * 3600 * 1000).getDate(), "Dates are equal");
});

it("Day names are correctly displayed when length is less than 3", async () => {
daypicker.id = "daypicker";
const dayPickerRoot = daypicker.getDayPickerRoot();
const dayPickerFirstDayName = dayPickerRoot.querySelector(".ui5-dp-firstday");

assert.strictEqual(dayPickerFirstDayName, "Sun", "Name is rendered correctly");
});

it("Day names are correctly displayed when length is more than 3", async () => {
browser.url(`test/pages/DayPicker.html?sap-ui-language=pt_PT`)
daypicker.id = "daypicker";
const dayPickerRoot = daypicker.getDayPickerRoot();
const dayPickerFirstDayName = dayPickerRoot.querySelector(".ui5-dp-firstday");

assert.strictEqual(dayPickerFirstDayName, "D", "Name is rendered correctly");
});
});
Loading
Loading