mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Migrate to new animations api (#12078)
This commit is contained in:
@@ -1,30 +1,35 @@
|
||||
<div class="adf-new-version-container">
|
||||
<adf-version-comparison *ngIf="showVersionComparison" [node]="node" [newFileVersion]="newFileVersion" />
|
||||
<div class="adf-new-version-uploader-container" id="adf-new-version-uploader-container" [@uploadToggle]="uploadState">
|
||||
<table class="adf-version-upload" *ngIf="uploadState !== 'close' && !versionList.isLoading">
|
||||
<tr>
|
||||
<td>
|
||||
<adf-version-upload
|
||||
id="adf-version-upload-button"
|
||||
[node]="node"
|
||||
[newFileVersion]="newFileVersion"
|
||||
[currentVersion]="versionList?.latestVersion?.entry"
|
||||
(success)="onUploadSuccess($event)"
|
||||
(cancel)="onUploadCancel()"
|
||||
(error)="onUploadError($event)" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (showVersionComparison) {
|
||||
<adf-version-comparison [node]="node" [newFileVersion]="newFileVersion" />
|
||||
}
|
||||
<div class="adf-new-version-uploader-container" id="adf-new-version-uploader-container" [class.adf-upload-open]="uploadState === 'open'">
|
||||
@if (uploadState !== 'close' && !versionList.isLoading) {
|
||||
<div class="adf-version-upload">
|
||||
<adf-version-upload
|
||||
id="adf-version-upload-button"
|
||||
[node]="node"
|
||||
[newFileVersion]="newFileVersion"
|
||||
[currentVersion]="versionList?.latestVersion?.entry"
|
||||
(success)="onUploadSuccess($event)"
|
||||
(cancel)="onUploadCancel()"
|
||||
(error)="onUploadError($event)"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="adf-version-list-container">
|
||||
<div class="adf-version-list-table">
|
||||
<div>
|
||||
<button mat-raised-button
|
||||
@if (uploadState === 'close') {
|
||||
<button
|
||||
mat-raised-button
|
||||
id="adf-show-version-upload-button"
|
||||
class="adf-version-manager-upload-button"
|
||||
(click)="toggleNewVersion()"
|
||||
*ngIf="uploadState ==='close'">{{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.ADD' | translate }}
|
||||
</button>
|
||||
>
|
||||
{{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.ADD' | translate }}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<adf-version-list
|
||||
@@ -37,7 +42,8 @@
|
||||
[allowVersionDelete]="allowVersionDelete"
|
||||
(deleted)="refresh($event)"
|
||||
(restored)="refresh($event)"
|
||||
(viewVersion)="onViewVersion($event)" />
|
||||
(viewVersion)="onViewVersion($event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,6 +31,18 @@ adf-version-manager {
|
||||
height: 0;
|
||||
float: left;
|
||||
position: relative;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition:
|
||||
height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
|
||||
opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
|
||||
visibility 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
|
||||
&.adf-upload-open {
|
||||
height: 175px;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.adf-version-list.adf-version-list-element {
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ViewEncapsulation, inject } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { FileUploadErrorEvent } from '../common/events/file.event';
|
||||
@@ -33,14 +32,6 @@ import { TranslatePipe } from '@ngx-translate/core';
|
||||
imports: [CommonModule, VersionComparisonComponent, VersionUploadComponent, MatButtonModule, TranslatePipe, VersionListComponent],
|
||||
templateUrl: './version-manager.component.html',
|
||||
styleUrls: ['./version-manager.component.scss'],
|
||||
animations: [
|
||||
trigger('uploadToggle', [
|
||||
state('open', style({ height: '175px', opacity: 1, visibility: 'visible' })),
|
||||
state('close', style({ height: '0%', opacity: 0, visibility: 'hidden' })),
|
||||
transition('open => close', [style({ visibility: 'hidden' }), animate('0.4s cubic-bezier(0.25, 0.8, 0.25, 1)')]),
|
||||
transition('close => open', [style({ visibility: 'visible' }), animate('0.4s cubic-bezier(0.25, 0.8, 0.25, 1)')])
|
||||
])
|
||||
],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class VersionManagerComponent implements OnInit {
|
||||
|
||||
Reference in New Issue
Block a user