mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5631] Improved page layout and provide documentation (#3346)
* page layout supports CSS selectors * migrate to using CSS selectors for page layout * add docs
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding } from '@angular/core';
|
||||
|
||||
// @deprecated Use `.aca-page-layout-content` CSS selector instead
|
||||
@Component({
|
||||
standalone: true,
|
||||
selector: 'aca-page-layout-content',
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
||||
|
||||
// @deprecated Use `.aca-page-layout-error` selectors instead
|
||||
@Component({
|
||||
standalone: true,
|
||||
selector: 'aca-page-layout-error',
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
||||
|
||||
// @deprecated Use `.aca-page-layout-header` CSS selector instead
|
||||
@Component({
|
||||
standalone: true,
|
||||
selector: 'aca-page-layout-header',
|
||||
|
@@ -1,11 +1,17 @@
|
||||
<div class="aca-content-header">
|
||||
<button *ngIf="(appNavNarMode$ | async) === 'collapsed'"
|
||||
mat-icon-button
|
||||
(click)="toggleClick()"
|
||||
title="{{'APP.TOOLTIPS.EXPAND_NAVIGATION' | translate}}">
|
||||
<mat-icon>keyboard_double_arrow_right</mat-icon>
|
||||
</button>
|
||||
<ng-content select="aca-page-layout-header"></ng-content>
|
||||
</div>
|
||||
<ng-content select="aca-page-layout-error" *ngIf="hasError"></ng-content>
|
||||
<ng-content select="aca-page-layout-content" *ngIf="!hasError"></ng-content>
|
||||
<div class="aca-content-header">
|
||||
<button *ngIf="(appNavNarMode$ | async) === 'collapsed'"
|
||||
mat-icon-button
|
||||
(click)="toggleClick()"
|
||||
title="{{'APP.TOOLTIPS.EXPAND_NAVIGATION' | translate}}">
|
||||
<mat-icon>keyboard_double_arrow_right</mat-icon>
|
||||
</button>
|
||||
<ng-content select=".aca-page-layout-header, aca-page-layout-header"></ng-content>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="hasError">
|
||||
<ng-content select=".aca-page-layout-error, aca-page-layout-error"></ng-content>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!hasError">
|
||||
<ng-content select=".aca-page-layout-content, aca-page-layout-content"></ng-content>
|
||||
</ng-container>
|
||||
|
@@ -0,0 +1,69 @@
|
||||
# Page Layout Component
|
||||
|
||||
Selector: `aca-page-layout`
|
||||
|
||||
## Layout Structure
|
||||
|
||||
The layout component provides a set of slots for your custom content:
|
||||
|
||||
- header
|
||||
- error
|
||||
- content
|
||||
|
||||
```html
|
||||
<aca-page-layout>
|
||||
|
||||
<div class="aca-page-layout-header">
|
||||
<!-- Header Component -->
|
||||
</div>
|
||||
|
||||
<div class="aca-page-layout-error">
|
||||
<!-- Error Component -->
|
||||
</div>
|
||||
|
||||
<div class="aca-page-layout-content">
|
||||
<!-- Main Content -->
|
||||
</div>
|
||||
|
||||
</aca-page-layout>
|
||||
```
|
||||
|
||||
## Layout Header
|
||||
|
||||
Supports any HTML or Angular component as a content
|
||||
|
||||
```html
|
||||
<aca-page-layout>
|
||||
<div class="aca-page-layout-header">
|
||||
<!-- Header Component -->
|
||||
</div>
|
||||
</aca-page-layout>
|
||||
```
|
||||
|
||||
## Layout Error
|
||||
|
||||
Supports any HTML or Angular component as the error visualisation.
|
||||
Displayed only when an error is detected by the parent container component.
|
||||
|
||||
```html
|
||||
<aca-page-layout>
|
||||
<div class="aca-page-layout-error">
|
||||
<!-- Error Component -->
|
||||
</div>
|
||||
</aca-page-layout>
|
||||
```
|
||||
|
||||
## Layout Content
|
||||
|
||||
You can provide any Angular component or HTML element as the main content.
|
||||
In addition, you can use `scrollable` class to make the content scroll.
|
||||
|
||||
The content is displayed only when there are no errors detected.
|
||||
|
||||
```html
|
||||
<aca-page-layout>
|
||||
<div class="aca-page-layout-content scrollable">
|
||||
<!-- Main Content -->
|
||||
</div>
|
||||
</aca-page-layout>
|
||||
```
|
Reference in New Issue
Block a user