Skip to content

Commit

Permalink
Merge branch 'main' into fix/toolbar-spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
droshev authored Oct 7, 2024
2 parents fefc012 + b795ba6 commit 7274a94
Show file tree
Hide file tree
Showing 37 changed files with 177 additions and 23 deletions.
11 changes: 11 additions & 0 deletions 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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)


### Bug Fixes

* **core,platform:** make headingLevel a shared type, use for table toolbar ([#12500](https://github.com/SAP/fundamental-ngx/issues/12500)) ([08f5984](https://github.com/SAP/fundamental-ngx/commit/08f5984a67e226039544897f8aac3bb746fd3e09))





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["libs/*"],
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"conventionalCommits": true,
"tagVersionPrefix": "v",
"message": "chore(release): publish %v",
Expand Down
8 changes: 8 additions & 0 deletions libs/btp/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)

**Note:** Version bump only for package @fundamental-ngx/btp





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/btp
Expand Down
2 changes: 1 addition & 1 deletion libs/btp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/btp",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"peerDependencies": {
"@angular/common": "ANGULAR_VER_PLACEHOLDER",
"@angular/core": "ANGULAR_VER_PLACEHOLDER",
Expand Down
8 changes: 8 additions & 0 deletions libs/cdk/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)

**Note:** Version bump only for package @fundamental-ngx/cdk





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/cdk
Expand Down
2 changes: 1 addition & 1 deletion libs/cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/cdk",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"schematics": "./schematics/collection.json",
"description": "Fundamental Library for Angular - CDK",
"license": "Apache-2.0",
Expand Down
11 changes: 11 additions & 0 deletions libs/core/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)


### Bug Fixes

* **core,platform:** make headingLevel a shared type, use for table toolbar ([#12500](https://github.com/SAP/fundamental-ngx/issues/12500)) ([08f5984](https://github.com/SAP/fundamental-ngx/commit/08f5984a67e226039544897f8aac3bb746fd3e09))





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<span
role="heading"
class="fd-dynamic-page__title"
[attr.aria-level]="headingLevel()"
[attr.aria-level]="_headingLevel()"
[id]="titleId()"
[class.fd-dynamic-page__title--wrap]="titleWrap"
fdkIgnoreClickOnSelection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { DYNAMIC_PAGE_HEADER_TOKEN, DynamicPageHeader } from '@fundamental-ngx/c

import { NgTemplateOutlet } from '@angular/common';
import { IgnoreClickOnSelectionDirective, Nullable } from '@fundamental-ngx/cdk/utils';
import { HeadingLevel } from '@fundamental-ngx/core/shared';
import { DYNAMIC_PAGE_CLASS_NAME, DynamicPageResponsiveSize } from '../../constants';
import { DynamicPageHeaderSubtitleDirective } from '../../directives/dynamic-page-header-subtitle.directive';
import { DynamicPageHeaderTitleDirective } from '../../directives/dynamic-page-header-title.directive';
Expand All @@ -34,8 +35,6 @@ import { DynamicPageBreadcrumbComponent } from '../breadcrumb/dynamic-page-bread

export const ActionSquashBreakpointPx = 1280;

export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';

let dynamicPageTitleId = 0;

@Component({
Expand Down Expand Up @@ -111,11 +110,14 @@ export class DynamicPageHeaderComponent implements OnInit, AfterViewInit, OnDest
_size: DynamicPageResponsiveSize;

/**
* The level of the Dynamic Page title
* Possible options: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
* Default: 'h2'
* Heading level of the dynamic page header title.
*/
headingLevel = input<HeadingLevel>('h2');
headingLevel = input<HeadingLevel>(2);

/** @hidden */
_headingLevel = computed(() =>
this.headingLevel() ? Number.parseInt(`${this.headingLevel()}`.replace(/\D/g, ''), 10) : undefined
);

/** Dynamic page title id, it has some default value if not set, */
titleId = input('fd-dynamic-page-title-id-' + dynamicPageTitleId++);
Expand Down
4 changes: 2 additions & 2 deletions libs/core/facets/facet/facet.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
} @else {
@if (facetTitle) {
<div
[attr.role]="!!headingLevel ? 'heading' : null"
[attr.aria-level]="headingLevel"
[attr.role]="!!_headingLevel ? 'heading' : null"
[attr.aria-level]="_headingLevel"
fd-title
[headerSize]="5"
class="fd-margin-bottom--sm"
Expand Down
14 changes: 12 additions & 2 deletions libs/core/facets/facet/facet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@angular/core';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { FormLabelComponent } from '@fundamental-ngx/core/form';
import { HeadingLevel } from '@fundamental-ngx/core/shared';
import { TitleComponent } from '@fundamental-ngx/core/title';
import { FACET_CLASS_NAME, FacetType } from '../constants';
import { addClassNameToFacetElement } from '../utils';
Expand Down Expand Up @@ -47,10 +48,16 @@ export class FacetComponent implements AfterViewInit {
subtitle: string;

/**
* Heading level (i.e. <h1>, <h2>, etc.) of the facet title.
* Heading level of the facet title.
*/
@Input()
headingLevel: Nullable<1 | 2 | 3 | 4 | 5 | 6>;
set headingLevel(level: Nullable<HeadingLevel>) {
if (typeof level === 'number') {
this._headingLevel = level;
} else if (typeof level === 'string') {
this._headingLevel = Number.parseInt(level.replace(/\D/g, ''), 10);
}
}

/**
* id for the facet
Expand Down Expand Up @@ -81,6 +88,9 @@ export class FacetComponent implements AfterViewInit {
return this.type !== 'image' ? this.titleId : '';
}

/** @hidden */
_headingLevel: number;

/** @hidden
* the internal id for the title to be associated with the aria-labelledby
*/
Expand Down
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/core",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"schematics": "./schematics/collection.json",
"ng-update": {
"migrations": "./schematics/migrations.json"
Expand Down
1 change: 1 addition & 0 deletions libs/core/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export * from './interfaces/tablist.interface';
export * from './services/value-state-message.service';
export * from './tokens/dynamic-page-header.token';
export * from './tokens/tabs.token';
export * from './types/heading-level';
19 changes: 19 additions & 0 deletions libs/core/shared/types/heading-level.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export type HeadingLevel =
| 1
| 2
| 3
| 4
| 5
| 6
| '1'
| '2'
| '3'
| '4'
| '5'
| '6'
| 'h1'
| 'h2'
| 'h3'
| 'h4'
| 'h5'
| 'h6';
4 changes: 3 additions & 1 deletion libs/core/toolbar/toolbar.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@if (title) {
<h4 fd-title class="fd-toolbar__title" [id]="titleId" #titleElement>{{ title }}</h4>
<span [attr.aria-level]="_headingLevel" fd-title class="fd-toolbar__title" [id]="titleId" #titleElement>{{
title
}}</span>
}
<ng-content></ng-content>
@if (overflownItems.length > 0) {
Expand Down
17 changes: 17 additions & 0 deletions libs/core/toolbar/toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
applyCssClass,
CssClassBuilder,
DynamicPortalComponent,
Nullable,
OVERFLOW_PRIORITY_SCORE,
OverflowPriority,
ResizeObserverService
Expand All @@ -40,6 +41,7 @@ import {
contentDensityObserverProviders
} from '@fundamental-ngx/core/content-density';
import { PopoverModule } from '@fundamental-ngx/core/popover';
import { HeadingLevel } from '@fundamental-ngx/core/shared';
import { TitleComponent, TitleToken } from '@fundamental-ngx/core/title';
import { BehaviorSubject, combineLatest, map, Observable, startWith } from 'rxjs';
import { ToolbarItem } from './abstract-toolbar-item.class';
Expand Down Expand Up @@ -143,6 +145,18 @@ export class ToolbarComponent implements AfterViewInit, AfterViewChecked, CssCla
@Input()
tabindex = -1;

/**
* Heading level of the toolbar title.
*/
@Input()
set headingLevel(level: Nullable<HeadingLevel>) {
if (typeof level === 'number') {
this._headingLevel = level;
} else if (typeof level === 'string') {
this._headingLevel = Number.parseInt(level.replace(/\D/g, ''), 10);
}
}

/** Toolbar Aria-label attribute. */
@Input()
@HostBinding('attr.aria-label')
Expand Down Expand Up @@ -187,6 +201,9 @@ export class ToolbarComponent implements AfterViewInit, AfterViewChecked, CssCla
/** @hidden */
spacerDirectives = contentChildren(ToolbarSpacerDirective);

/** @hidden */
_headingLevel = 2;

/** HTML Element Reference. */
readonly elementRef = inject(ElementRef);

Expand Down
8 changes: 8 additions & 0 deletions libs/cx/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)

**Note:** Version bump only for package @fundamental-ngx/cx





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/cx
Expand Down
2 changes: 1 addition & 1 deletion libs/cx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/cx",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"schematics": "./schematics/collection.json",
"description": "Fundamental Library for Angular - cx",
"license": "Apache-2.0",
Expand Down
8 changes: 8 additions & 0 deletions libs/datetime-adapter/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)

**Note:** Version bump only for package @fundamental-ngx/datetime-adapter





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/datetime-adapter
Expand Down
2 changes: 1 addition & 1 deletion libs/datetime-adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/datetime-adapter",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"description": "Datetime adapter for SAP Fundamentals, based on Day.js package",
"license": "Apache-2.0",
"homepage": "https://sap.github.io/fundamental-ngx/home",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ng-template #startColumn>
<fd-dynamic-page [autoResponsive]="true" ariaLabel="Example Dynamic Page" [positionRelative]="true">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}
<fd-dynamic-page size="large" ariaLabel="Example Dynamic Page" [autoResponsive]="false">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="overlay">
<fd-dynamic-page size="large" ariaLabel="Example Dynamic Page" [autoResponsive]="false">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@if (visible) {
<div class="overlay">
<fd-dynamic-page size="large" ariaLabel="Example Dynamic Page">
<fd-dynamic-page-header title="Lorem ipsum dolor sit amet, consectetur adipiscing elit">
<fd-dynamic-page-header headingLevel="2" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit">
<span *fdDynamicPageHeaderTitle="let collapsed">
Lorem ipsum dolor sit amet, consectetur adipiscing elit ({{
collapsed ? 'collapsed' : 'not collapsed'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="overlay">
<fd-dynamic-page ariaLabel="Example Dynamic Page">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="overlay">
<fd-dynamic-page size="large" ariaLabel="Example Dynamic Page" [autoResponsive]="false">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="overlay">
<fd-dynamic-page size="large" ariaLabel="Example Dynamic Page" [autoResponsive]="false">
<fd-dynamic-page-header
headingLevel="2"
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
subtitle="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"
>
Expand Down
8 changes: 8 additions & 0 deletions libs/i18n/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.

## [0.53.1-rc.1](https://github.com/SAP/fundamental-ngx/compare/v0.53.1-rc.0...v0.53.1-rc.1) (2024-10-07)

**Note:** Version bump only for package @fundamental-ngx/i18n





## [0.53.1-rc.0](https://github.com/SAP/fundamental-ngx/compare/v0.53.0...v0.53.1-rc.0) (2024-10-03)

**Note:** Version bump only for package @fundamental-ngx/i18n
Expand Down
2 changes: 1 addition & 1 deletion libs/i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fundamental-ngx/i18n",
"version": "0.53.1-rc.0",
"version": "0.53.1-rc.1",
"peerDependencies": {
"@angular/common": "ANGULAR_VER_PLACEHOLDER",
"@angular/core": "ANGULAR_VER_PLACEHOLDER",
Expand Down
Loading

0 comments on commit 7274a94

Please sign in to comment.