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

feat(core): application frame enhancement #735

Merged
merged 35 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
45e28a2
feat(core/grid): add grid components
danielleroux Aug 23, 2023
18a8a07
test: add snapshot tests
danielleroux Aug 23, 2023
5fc0e06
docs: add
danielleroux Aug 23, 2023
c0e92c8
docs: add react examples
danielleroux Aug 23, 2023
9cea4b3
docs: add vue-examples add angular-examples
danielleroux Aug 23, 2023
41503a5
docs: simplify loading
danielleroux Aug 23, 2023
c7a4caf
fix: harmonize breakpoint behavior
danielleroux Aug 25, 2023
6c01352
refactor: cleanup my-component
danielleroux Aug 25, 2023
00b1ee1
refactor: remove mixins
danielleroux Aug 25, 2023
4297435
refactor: replace with context
danielleroux Aug 28, 2023
0a491a2
Merge remote-tracking branch 'origin/main' into feat/grid-layout
danielleroux Aug 28, 2023
7fbd989
fix(core/map): add context provider
danielleroux Aug 28, 2023
4cdc751
Merge remote-tracking branch 'origin/main' into feat/grid-layout
danielleroux Aug 29, 2023
d0daac7
feat(core/application-frame): add application frame
danielleroux Aug 29, 2023
cd5546e
feat: move breakpoint to shell app
danielleroux Aug 29, 2023
e4c3117
fix: prevent keyboard navigation
danielleroux Aug 29, 2023
b92e10b
docs: change docs
danielleroux Aug 29, 2023
b7c9f0f
test: fix tests
danielleroux Aug 29, 2023
246ccba
fix: slot behavior
danielleroux Aug 30, 2023
1818bfa
feat: integrate sidebar
danielleroux Aug 31, 2023
6e28fd2
fix(core/menu-category): change styling
danielleroux Sep 1, 2023
13897cc
Merge remote-tracking branch 'origin/main' into feat/poc-app-frame
danielleroux Sep 4, 2023
f23e6f7
fix: use themeSwitcher type
danielleroux Sep 4, 2023
39001e2
fix: mark deprecated
danielleroux Sep 5, 2023
4cc1968
test: update snapshots
danielleroux Sep 5, 2023
dd114c1
fix: menu-items
danielleroux Sep 5, 2023
94c06a9
chore: update generated files
danielleroux Sep 5, 2023
0e9a648
docs: replace theme switcher demo
danielleroux Sep 5, 2023
7903583
docs: use always classic theme
danielleroux Sep 5, 2023
6ca9e0a
Merge remote-tracking branch 'origin/main' into feat/poc-app-frame
danielleroux Sep 5, 2023
6e560f4
docs: handle not existing markdowns
danielleroux Sep 5, 2023
53f2175
fix: remove base display flex
danielleroux Sep 5, 2023
7863e37
docs: remove angular syntax
danielleroux Sep 5, 2023
169ad10
docs: remove old breakpoint definition
danielleroux Sep 5, 2023
0ba6045
fix: review comments
danielleroux Sep 6, 2023
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
4 changes: 2 additions & 2 deletions packages/angular-test-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import TabsRounded from 'src/preview-examples/tabs-rounded';
import Textarea from 'src/preview-examples/textarea';
import TextareaDisabled from 'src/preview-examples/textarea-disabled';
import TextareaReadonly from 'src/preview-examples/textarea-readonly';
import ThemeSwitcherService from 'src/preview-examples/theme-switcher';
import ThemeSwitcherExample from 'src/preview-examples/theme-switcher';
import Tile from 'src/preview-examples/tile';
import Timepicker from 'src/preview-examples/timepicker';
import Toast from 'src/preview-examples/toast';
Expand Down Expand Up @@ -198,7 +198,7 @@ import { NavigationTestComponent } from './components/navigation-test.component'
Textarea,
TextareaReadonly,
TextareaDisabled,
ThemeSwitcherService,
ThemeSwitcherExample,
Tile,
Timepicker,
ToggleButtonPrimaryGhost,
Expand Down
35 changes: 35 additions & 0 deletions packages/angular-test-app/src/preview-examples/theme-switcher.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<ix-grid>
<ix-row>
<ix-col size="2">
<span>Light/Dark</span>
</ix-col>
<ix-col>
<ix-button (click)="toggleMode()">Toggle mode</ix-button>
</ix-col>
</ix-row>

<ix-row>
<ix-col size="2">Theme</ix-col>
<ix-col>
<ix-select
[selectedIndices]="selectedTheme"
(itemSelectionChange)="onItemSelectionChange($event)"
placeholder="Select a theme"
>
<ix-select-item
*ngFor="let theme of themes"
[label]="theme"
[value]="theme"
></ix-select-item>
</ix-select>
</ix-col>
</ix-row>

<ix-row>
<ix-col size="2">Use System</ix-col>
<ix-col>
<input type="checkbox" id="system" (change)="onSystemMode($event)" />
<label for="system"></label>
</ix-col>
</ix-row>
</ix-grid>
54 changes: 31 additions & 23 deletions packages/angular-test-app/src/preview-examples/theme-switcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,44 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';
import { ThemeService } from '@siemens/ix-angular';
import { themeSwitcher } from '@siemens/ix';

@Component({
selector: 'app-example',
template: `
<ix-button class="mb-2" (click)="themeService.toggleMode()">
Toggle mode
</ix-button>
<ix-select
(itemSelectionChange)="onItemSelectionChange($event)"
placeholder="Select a theme"
>
<ix-select-item
label="Classic light"
value="theme-classic-light"
></ix-select-item>
<ix-select-item
label="Classic dark"
value="theme-classic-dark"
></ix-select-item>
</ix-select>
`,
templateUrl: './theme-switcher.html',
styles: [
`
ix-col {
align-items: center;
height: 2.5rem;
}
`,
],
})
export default class ThemeSwitcherService {
constructor(readonly themeService: ThemeService) {}
export default class ThemeSwitcherExample {
themes = ['theme-classic-light', 'theme-classic-dark'];
selectedTheme = this.themes[1];

constructor() {}

onItemSelectionChange(event: Event) {
const customEvent = event as CustomEvent<string | string[]>;
this.themeService.setTheme(customEvent.detail[0]);
const newTheme = customEvent.detail[0];
themeSwitcher.setTheme(newTheme);
this.selectedTheme = newTheme;
}

toggleMode() {
themeSwitcher.toggleMode();
}

onSystemMode({ target }: Event) {
if ((target as HTMLInputElement).checked) {
themeSwitcher.setVariant();
return;
}

themeSwitcher.setTheme(this.selectedTheme);
}
}
8 changes: 4 additions & 4 deletions packages/angular/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export declare interface IxAvatar extends Components.IxAvatar {}


@ProxyCmp({
inputs: ['applicationName', 'hideHeader']
inputs: ['applicationName', 'breakpoints', 'forceBreakpoint', 'hideHeader']
})
@Component({
selector: 'ix-basic-navigation',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['applicationName', 'hideHeader'],
inputs: ['applicationName', 'breakpoints', 'forceBreakpoint', 'hideHeader'],
})
export class IxBasicNavigation {
protected el: HTMLElement;
Expand Down Expand Up @@ -1260,15 +1260,15 @@ export declare interface IxMapNavigationOverlay extends Components.IxMapNavigati


@ProxyCmp({
inputs: ['applicationDescription', 'applicationName', 'breakpoints', 'enableMapExpand', 'enableSettings', 'enableToggleTheme', 'expand', 'forceBreakpoint', 'i18nCollapse', 'i18nExpand', 'i18nExpandSidebar', 'i18nLegal', 'i18nSettings', 'i18nToggleTheme', 'maxVisibleMenuItems', 'pinned', 'showAbout', 'showSettings'],
inputs: ['applicationDescription', 'applicationName', 'enableMapExpand', 'enableSettings', 'enableToggleTheme', 'expand', 'i18nCollapse', 'i18nExpand', 'i18nExpandSidebar', 'i18nLegal', 'i18nSettings', 'i18nToggleTheme', 'maxVisibleMenuItems', 'pinned', 'showAbout', 'showSettings'],
methods: ['toggleMapExpand', 'toggleMenu', 'toggleSettings', 'toggleAbout']
})
@Component({
selector: 'ix-menu',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['applicationDescription', 'applicationName', 'breakpoints', 'enableMapExpand', 'enableSettings', 'enableToggleTheme', 'expand', 'forceBreakpoint', 'i18nCollapse', 'i18nExpand', 'i18nExpandSidebar', 'i18nLegal', 'i18nSettings', 'i18nToggleTheme', 'maxVisibleMenuItems', 'pinned', 'showAbout', 'showSettings'],
inputs: ['applicationDescription', 'applicationName', 'enableMapExpand', 'enableSettings', 'enableToggleTheme', 'expand', 'i18nCollapse', 'i18nExpand', 'i18nExpandSidebar', 'i18nLegal', 'i18nSettings', 'i18nToggleTheme', 'maxVisibleMenuItems', 'pinned', 'showAbout', 'showSettings'],
})
export class IxMenu {
protected el: HTMLElement;
Expand Down
7 changes: 5 additions & 2 deletions packages/angular/src/theme/theme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
*/

import { EventEmitter, Injectable, Output } from '@angular/core';
import { themeSwitcher, ThemeSwitcher } from '@siemens/ix';
import { themeSwitcher } from '@siemens/ix';

/**
* @deprecated Use themeSwitcher from core package `import { themeSwitcher } from '@siemens/ix';`
*/
@Injectable({
providedIn: 'root',
})
export class ThemeService {
@Output() themeChanged = new EventEmitter<string>();

private themeSwitcher: ThemeSwitcher;
private themeSwitcher: typeof themeSwitcher;

constructor() {
this.themeSwitcher = themeSwitcher;
Expand Down
Loading