Browse Source

Improve expanded mode.

release/6.x
Sebastian 4 years ago
parent
commit
c4748ad4bd
  1. 6
      frontend/src/app/features/content/shared/forms/array-editor.component.html
  2. 18
      frontend/src/app/features/content/shared/forms/array-editor.component.scss
  3. 3
      frontend/src/app/features/content/shared/forms/array-editor.component.ts
  4. 6
      frontend/src/app/features/content/shared/forms/assets-editor.component.html
  5. 30
      frontend/src/app/features/content/shared/forms/assets-editor.component.scss
  6. 3
      frontend/src/app/features/content/shared/forms/assets-editor.component.ts
  7. 7
      frontend/src/app/features/content/shared/forms/field-editor.component.html
  8. 1
      frontend/src/app/features/content/shared/forms/field-editor.component.scss
  9. 2
      frontend/src/app/features/content/shared/references/references-editor.component.html
  10. 23
      frontend/src/app/features/content/shared/references/references-editor.component.scss
  11. 3
      frontend/src/app/features/content/shared/references/references-editor.component.ts
  12. 2
      frontend/src/app/theme/_mixins.scss
  13. 1
      frontend/src/app/theme/_vars.scss

6
frontend/src/app/features/content/shared/forms/array-editor.component.html

@ -1,5 +1,5 @@
<ng-container *ngIf="formModel.itemChanges | async; let items">
<div class="array-container" *ngIf="items.length > 0 && items.length <= 20;"
<div class="array-container" [class.expanded]="isExpanded" *ngIf="items.length > 0 && items.length <= 20;"
cdkDropList
[cdkDropListDisabled]="false"
[cdkDropListData]="items"
@ -31,7 +31,7 @@
</div>
</div>
<div class="array-container" *ngIf="items.length > 20">
<div class="array-container" [class.expanded]="isExpanded" *ngIf="items.length > 20">
<virtual-scroller #scroll [items]="$any(items)" [enableUnequalChildrenSizes]="true">
<div *ngFor="let itemForm of scroll.viewPortItems; index as i" class="item"
[class.first]="scroll.viewPortInfo.startIndexWithBuffer + i === 0"
@ -59,7 +59,7 @@
</virtual-scroller>
</div>
<div class="row g-0 align-items-center">
<div class="array-buttons row g-0 align-items-center" [class.expanded]="isExpanded">
<div class="col-auto">
<ng-container *ngIf="isArray; else component">
<ng-container *ngIf="hasField">

18
frontend/src/app/features/content/shared/forms/array-editor.component.scss

@ -23,6 +23,24 @@ virtual-scroller {
background: $color-border-lighter;
margin: 0;
margin-bottom: 1rem;
overflow-y: auto;
&.expanded {
@include absolute(3rem, 1.25rem, 2.375rem + 1rem + .75rem, 1.25rem);
margin: 0;
virtual-scroller {
@include absolute(0, 0, 0, 0);
height: 100%;
}
}
}
.array-buttons {
&.expanded {
@include absolute(null, 1.25rem, .75rem, 1.25rem);
max-height: none;
}
}
.drag-container {

3
frontend/src/app/features/content/shared/forms/array-editor.component.ts

@ -35,6 +35,9 @@ export class ArrayEditorComponent implements OnChanges {
@Input()
public isComparing = false;
@Input()
public isExpanded = false;
@Input()
public canUnset?: boolean | null;

6
frontend/src/app/features/content/shared/forms/assets-editor.component.html

@ -1,4 +1,8 @@
<div class="assets-container" (sqxDropFile)="addFiles($event)" [sqxDropDisabled]="snapshot.isDisabled" tabindex="1000">
<div class="assets-container"
[class.expanded]="isExpanded"
(sqxDropFile)="addFiles($event)"
[sqxDropDisabled]="snapshot.isDisabled"
tabindex="1000">
<div class="header list">
<div class="row gx-2">
<div class="col" [class.disabled]="snapshot.isDisabled">

30
frontend/src/app/features/content/shared/forms/assets-editor.component.scss

@ -1,19 +1,23 @@
@import 'mixins';
@import 'vars';
.disabled {
pointer-events: none;
.assets-container {
background: $color-background;
max-height: 26.5rem;
min-height: 26.5rem;
overflow-x: hidden;
overflow-y: scroll;
padding: 1rem;
padding-bottom: 0;
&.expanded {
@include absolute(3rem, 1.25rem, .75rem, 1.25rem);
max-height: none;
}
}
.assets {
&-container {
background: $color-background;
height: $asset-height + 2rem;
overflow-x: hidden;
overflow-y: scroll;
padding: 1rem;
padding-bottom: 0;
}
.disabled {
pointer-events: none;
}
.list-view {
@ -26,10 +30,6 @@
min-height: 1px;
}
.unrow {
display: block;
}
.drop-area {
@include truncate-nowidth;
border: 2px dashed darken($color-border, 10%);

3
frontend/src/app/features/content/shared/forms/assets-editor.component.ts

@ -50,6 +50,9 @@ export class AssetsEditorComponent extends StatefulControlComponent<State, Reado
@Input()
public folderId?: string;
@Input()
public isExpanded = false;
@Input()
public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true);

7
frontend/src/app/features/content/shared/forms/field-editor.component.html

@ -48,12 +48,13 @@
[formModel]="$any(formModel)"
[formContext]="formContext"
[isComparing]="isComparing"
[isExpanded]="isExpanded"
[language]="language"
[languages]="languages">
</sqx-array-editor>
</ng-container>
<ng-container *ngSwitchCase="'Assets'">
<sqx-assets-editor [formControl]="$any(fieldForm)" [folderId]="field.rawProperties.folderId"></sqx-assets-editor>
<sqx-assets-editor [formControl]="$any(fieldForm)" [folderId]="field.rawProperties.folderId" [isExpanded]="isExpanded"></sqx-assets-editor>
</ng-container>
<ng-container *ngSwitchCase="'Boolean'">
<ng-container [ngSwitch]="field.rawProperties.editor">
@ -88,6 +89,7 @@
[formModel]="$any(formModel)"
[formContext]="formContext"
[isComparing]="isComparing"
[isExpanded]="isExpanded"
[language]="language"
[languages]="languages">
</sqx-array-editor>
@ -124,9 +126,10 @@
<ng-container [ngSwitch]="field.rawProperties.editor">
<ng-container *ngSwitchCase="'List'">
<sqx-references-editor
[formControl]="$any(fieldForm)"
[allowDuplicates]="field.rawProperties.allowDuplicated"
[formContext]="formContext"
[formControl]="$any(fieldForm)"
[isExpanded]="isExpanded"
[language]="language"
[languages]="languages"
[schemaIds]="field.rawProperties.schemaIds">

1
frontend/src/app/features/content/shared/forms/field-editor.component.scss

@ -20,6 +20,7 @@
overflow-x: hidden;
overflow-y: auto;
padding: .75rem 1.25rem;
padding-top: 1.5rem;
z-index: 500;
}
}

2
frontend/src/app/features/content/shared/references/references-editor.component.html

@ -1,4 +1,4 @@
<div class="references-container"
<div class="references-container" [class.expanded]="isExpanded"
(sqxResizeCondition)="setCompact($event)"
[sqxResizeMinWidth]="600"
[sqxResizeMaxWidth]="0">

23
frontend/src/app/features/content/shared/references/references-editor.component.scss

@ -1,6 +1,20 @@
@import 'mixins';
@import 'vars';
.references-container {
background: $color-background;
max-height: 20rem;
min-height: 6rem;
overflow-x: hidden;
overflow-y: auto;
padding: 1rem;
&.expanded {
@include absolute(3rem, 1.25rem, .75rem, 1.25rem);
max-height: none;
}
}
.disabled {
pointer-events: none;
}
@ -13,15 +27,6 @@
text-align: center;
}
.references-container {
background: $color-background;
max-height: 20rem;
min-height: 6rem;
overflow-x: hidden;
overflow-y: auto;
padding: 1rem;
}
.drop-area {
border: 2px dashed darken($color-border, 10%);
border-radius: $border-radius;

3
frontend/src/app/features/content/shared/references/references-editor.component.ts

@ -44,6 +44,9 @@ export class ReferencesEditorComponent extends StatefulControlComponent<State, R
@Input()
public formContext!: any;
@Input()
public isExpanded = false;
@Input()
public allowDuplicates?: boolean | null = true;

2
frontend/src/app/theme/_mixins.scss

@ -20,7 +20,7 @@
background: $background;
border-color: $color;
color: $color;
z-index: 1000;
z-index: 100;
}
@mixin build-text-button($color) {

1
frontend/src/app/theme/_vars.scss

@ -85,7 +85,6 @@ $history-dot-sm-offset-x: -($history-dot-sm-size * .5 + 1px);
$asset-width: 14.5rem;
$asset-folder-height: 4rem;
$asset-height: 19rem;
$asset-header: 12rem;
$asset-image: 12rem;
$asset-footer: 7rem;

Loading…
Cancel
Save