Skip to content

Commit

Permalink
feat(back-compat): header and footer backward compatibility components (
Browse files Browse the repository at this point in the history
#1535)

* feat(telekom-header): backward compatible data API

* docs(telekom-header): better docs

* feat(footer-back-compat): add component

* feat(header-back-compat): add link target support

* feat(header-back-compat): typo
  • Loading branch information
nowseemee authored Feb 24, 2023
1 parent 82d0f14 commit 2ae1afd
Show file tree
Hide file tree
Showing 25 changed files with 1,246 additions and 43 deletions.
13 changes: 13 additions & 0 deletions packages/components/src/components/badge/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
| `"visually-hidden"` | |


## Dependencies

### Used by

- [scale-telekom-header-data-back-compat](../telekom/telekom-header-data-back-compat)

### Graph
```mermaid
graph TD;
scale-telekom-header-data-back-compat --> scale-badge
style scale-badge fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
2 changes: 2 additions & 0 deletions packages/components/src/components/icon/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [scale-data-grid](../data-grid)
- [scale-input](../input)
- [scale-nav-icon](../telekom/nav-icon)
- [scale-telekom-header-data-back-compat](../telekom/telekom-header-data-back-compat)

### Graph
```mermaid
Expand All @@ -37,6 +38,7 @@ graph TD;
scale-data-grid --> scale-icon
scale-input --> scale-icon
scale-nav-icon --> scale-icon
scale-telekom-header-data-back-compat --> scale-icon
style scale-icon fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# scale-telekom-footer-data-back-compat



<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| ------------------ | ------------------- | ----------- | ------------------------- | ------------------------- |
| `copyright` | `copyright` | | `string` | `'© Deutsche Telekom AG'` |
| `footerNavigation` | `footer-navigation` | | `any` | `[]` |
| `type` | `type` | | `"minimal" \| "standard"` | `'standard'` |


## Dependencies

### Depends on

- [scale-telekom-footer](../telekom-footer)
- [scale-telekom-footer-content](../telekom-footer)

### Graph
```mermaid
graph TD;
scale-telekom-footer-data-back-compat --> scale-telekom-footer
scale-telekom-footer-data-back-compat --> scale-telekom-footer-content
scale-telekom-footer-content --> scale-logo
scale-logo --> scale-logo-svg
style scale-telekom-footer-data-back-compat fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* @license
* Scale https://github.com/telekom/scale
*
* Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import { Component, h, Prop } from '@stencil/core';
// import { findRootNode, findSelected } from '../../../utils/menu-utils';
// import { renderIcon } from '../../../utils/render-icon';

const readData = (data) => {
let parsedData;

try {
parsedData = JSON.parse(data);
} catch (error) {
parsedData = data;
}

return parsedData;
};

@Component({
tag: 'scale-telekom-footer-data-back-compat',
shadow: false,
})
export class TelekomFooterDataBackCompat {
@Prop({ reflect: true }) type: 'standard' | 'minimal' = 'standard';
@Prop() footerNavigation?: any = [];
@Prop() copyright?: string = '© Deutsche Telekom AG';

render() {
return (
<scale-telekom-footer type={this.type}>
<scale-telekom-footer-content>
<span slot="notice"> {this.copyright} </span>
<ul slot="navigation">
{readData(this.footerNavigation).map(
({
name,
id,
href = 'javascript:void(0);',
target = '_self',
}) => {
return (
<li>
<a href={href} id={id} target={target}>
{name}
</a>
</li>
);
}
)}
</ul>
</scale-telekom-footer-content>
</scale-telekom-footer>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

## Dependencies

### Used by

- [scale-telekom-footer-data-back-compat](../telekom-footer-data-back-compat)

### Depends on

- [scale-logo](../logo)
Expand All @@ -28,6 +32,7 @@
graph TD;
scale-telekom-footer-content --> scale-logo
scale-logo --> scale-logo-svg
scale-telekom-footer-data-back-compat --> scale-telekom-footer-content
style scale-telekom-footer-content fill:#f9f,stroke:#333,stroke-width:4px
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# scale-telekom-header-data-back-compat



<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| ------------------ | ------------------- | ----------- | -------- | ----------- |
| `activeRouteId` | `active-route-id` | | `string` | `undefined` |
| `addonNavigation` | `addon-navigation` | | `any` | `undefined` |
| `appName` | `app-name` | | `string` | `undefined` |
| `appNameClick` | `app-name-click` | | `any` | `undefined` |
| `appNameLink` | `app-name-link` | | `string` | `undefined` |
| `iconNavigation` | `icon-navigation` | | `any` | `undefined` |
| `mainNavigation` | `main-navigation` | | `any` | `undefined` |
| `sectorNavigation` | `sector-navigation` | | `any` | `undefined` |


## Dependencies

### Depends on

- [scale-telekom-header](../telekom-header)
- [scale-telekom-nav-list](../telekom-nav-list)
- [scale-telekom-nav-item](../telekom-nav-item)
- [scale-telekom-nav-flyout](../telekom-nav-flyout)
- [scale-telekom-mega-menu](../telekom-mega-menu)
- [scale-telekom-mega-menu-column](../telekom-mega-menu)
- [scale-badge](../../badge)
- [scale-icon-action-menu](../../icons/action-menu)
- [scale-telekom-mobile-flyout-canvas](../telekom-mobile-flyout-canvas)
- [scale-telekom-mobile-menu](../telekom-mobile-menu)
- [scale-telekom-mobile-menu-item](../telekom-mobile-menu-item)
- [scale-icon](../../icon)

### Graph
```mermaid
graph TD;
scale-telekom-header-data-back-compat --> scale-telekom-header
scale-telekom-header-data-back-compat --> scale-telekom-nav-list
scale-telekom-header-data-back-compat --> scale-telekom-nav-item
scale-telekom-header-data-back-compat --> scale-telekom-nav-flyout
scale-telekom-header-data-back-compat --> scale-telekom-mega-menu
scale-telekom-header-data-back-compat --> scale-telekom-mega-menu-column
scale-telekom-header-data-back-compat --> scale-badge
scale-telekom-header-data-back-compat --> scale-icon-action-menu
scale-telekom-header-data-back-compat --> scale-telekom-mobile-flyout-canvas
scale-telekom-header-data-back-compat --> scale-telekom-mobile-menu
scale-telekom-header-data-back-compat --> scale-telekom-mobile-menu-item
scale-telekom-header-data-back-compat --> scale-icon
scale-telekom-header --> scale-logo
scale-logo --> scale-logo-svg
scale-telekom-mega-menu-column --> scale-icon-navigation-right
scale-telekom-mobile-flyout-canvas --> scale-button
scale-telekom-mobile-flyout-canvas --> scale-icon-action-close
scale-telekom-mobile-menu --> scale-icon-navigation-left
scale-telekom-mobile-menu-item --> scale-icon-navigation-right
style scale-telekom-header-data-back-compat fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
Loading

0 comments on commit 2ae1afd

Please sign in to comment.