@firestitch/block-editor 12.3.30 → 12.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/artboard/artboard.component.d.ts +6 -5
- package/app/components/block/block.component.d.ts +6 -5
- package/app/components/block/index.d.ts +1 -0
- package/app/components/group/group-dialog.component.d.ts +17 -0
- package/app/components/group/index.d.ts +1 -0
- package/app/components/index.d.ts +1 -0
- package/app/components/layers-reorder-dialog/index.d.ts +1 -0
- package/app/components/sidebar/index.d.ts +1 -0
- package/app/components/sidebar/sidebar.component.d.ts +13 -3
- package/app/fs-block-editor.module.d.ts +20 -19
- package/app/interfaces/block-group.d.ts +5 -0
- package/app/interfaces/block.d.ts +1 -1
- package/app/interfaces/index.d.ts +1 -0
- package/app/services/block-editor.service.d.ts +14 -11
- package/app/services/blocks-store.service.d.ts +1 -9
- package/bundles/firestitch-block-editor.umd.js +391 -254
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/artboard/artboard.component.js +15 -6
- package/esm2015/app/components/block/block.component.js +18 -18
- package/esm2015/app/components/block/index.js +2 -0
- package/esm2015/app/components/group/group-dialog.component.js +48 -0
- package/esm2015/app/components/group/index.js +2 -0
- package/esm2015/app/components/index.js +2 -1
- package/esm2015/app/components/layers-reorder-dialog/index.js +2 -0
- package/esm2015/app/components/sidebar/index.js +2 -0
- package/esm2015/app/components/sidebar/sidebar.component.js +111 -41
- package/esm2015/app/fs-block-editor.module.js +5 -3
- package/esm2015/app/interfaces/block-group.js +2 -0
- package/esm2015/app/interfaces/block.js +1 -1
- package/esm2015/app/interfaces/index.js +2 -1
- package/esm2015/app/services/block-editor.service.js +134 -37
- package/esm2015/app/services/blocks-store.service.js +9 -97
- package/fesm2015/firestitch-block-editor.js +311 -189
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i18 from '@angular/common';
|
|
2
2
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Component, ChangeDetectionStrategy, Input,
|
|
5
|
-
import * as
|
|
4
|
+
import { Injectable, Component, ChangeDetectionStrategy, Input, Inject, Directive, Pipe, ViewChild, HostBinding, HostListener, EventEmitter, ContentChildren, Output, ViewChildren, ElementRef, NgModule } from '@angular/core';
|
|
5
|
+
import * as i5 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import * as
|
|
7
|
+
import * as i7 from '@angular/material/input';
|
|
8
8
|
import { MatInputModule } from '@angular/material/input';
|
|
9
|
-
import * as i7 from '@angular/cdk/drag-drop';
|
|
9
|
+
import * as i7$1 from '@angular/cdk/drag-drop';
|
|
10
10
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/material/button';
|
|
12
12
|
import { MatButtonModule } from '@angular/material/button';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i12 from '@angular/material/checkbox';
|
|
14
14
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
15
|
-
import * as
|
|
15
|
+
import * as i9 from '@angular/material/form-field';
|
|
16
16
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
17
17
|
import * as i3 from '@angular/material/icon';
|
|
18
18
|
import { MatIconModule } from '@angular/material/icon';
|
|
19
|
-
import * as i4 from '@angular/material/list';
|
|
19
|
+
import * as i4$1 from '@angular/material/list';
|
|
20
20
|
import { MatListModule } from '@angular/material/list';
|
|
21
|
-
import * as
|
|
21
|
+
import * as i10 from '@angular/material/select';
|
|
22
22
|
import { MatSelectModule } from '@angular/material/select';
|
|
23
|
-
import * as
|
|
23
|
+
import * as i19 from '@angular/material/tooltip';
|
|
24
24
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
|
-
import * as
|
|
25
|
+
import * as i15 from '@firestitch/colorpicker';
|
|
26
26
|
import { FsColorPickerModule } from '@firestitch/colorpicker';
|
|
27
27
|
import * as i2 from '@firestitch/dialog';
|
|
28
28
|
import { FsDialogModule } from '@firestitch/dialog';
|
|
29
|
-
import * as
|
|
29
|
+
import * as i6$1 from '@firestitch/file';
|
|
30
30
|
import { FsFileModule } from '@firestitch/file';
|
|
31
|
-
import * as
|
|
31
|
+
import * as i6 from '@firestitch/form';
|
|
32
32
|
import { FsFormModule } from '@firestitch/form';
|
|
33
33
|
import { FsMenuModule } from '@firestitch/menu';
|
|
34
34
|
import * as i2$2 from '@firestitch/zoom-pan';
|
|
35
35
|
import { FsZoomPanComponent, FsZoomPanModule } from '@firestitch/zoom-pan';
|
|
36
|
-
import * as
|
|
36
|
+
import * as i13 from '@firestitch/autocomplete';
|
|
37
37
|
import { FsAutocompleteModule } from '@firestitch/autocomplete';
|
|
38
38
|
import * as i1 from '@angular/common/http';
|
|
39
|
-
import { throwError, Subject, BehaviorSubject, from, fromEvent
|
|
40
|
-
import { map, filter,
|
|
41
|
-
import * as i3$1 from '@firestitch/prompt';
|
|
39
|
+
import { throwError, of, Subject, BehaviorSubject, from, fromEvent } from 'rxjs';
|
|
40
|
+
import { map, filter, takeUntil, switchMap, tap, mapTo, groupBy, debounceTime, mergeAll, skip, delay } from 'rxjs/operators';
|
|
42
41
|
import * as i1$1 from '@angular/material/dialog';
|
|
43
42
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
44
|
-
import {
|
|
45
|
-
import * as
|
|
43
|
+
import { guid, index, round } from '@firestitch/common';
|
|
44
|
+
import * as i8 from '@angular/cdk/text-field';
|
|
45
|
+
import * as i3$1 from '@firestitch/prompt';
|
|
46
|
+
import * as i5$1 from '@angular/material/divider';
|
|
46
47
|
import Moveable from 'moveable';
|
|
47
48
|
import * as i1$2 from '@firestitch/api';
|
|
48
49
|
import * as i2$1 from '@firestitch/clipboard';
|
|
49
50
|
import * as i3$2 from '@firestitch/message';
|
|
50
|
-
import * as
|
|
51
|
-
import * as i20 from '@angular/cdk/text-field';
|
|
51
|
+
import * as i11 from '@angular/material/core';
|
|
52
52
|
|
|
53
53
|
class GoogleFontService {
|
|
54
54
|
constructor(httpClient) {
|
|
@@ -110,6 +110,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
110
110
|
type: Input
|
|
111
111
|
}] } });
|
|
112
112
|
|
|
113
|
+
class GroupDialogComponent {
|
|
114
|
+
constructor(_data, _dialogRef) {
|
|
115
|
+
this._data = _data;
|
|
116
|
+
this._dialogRef = _dialogRef;
|
|
117
|
+
this.save = () => {
|
|
118
|
+
if (this.blockGroup.name) {
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.blockGroup = Object.assign(Object.assign({}, this.blockGroup), { name: guid() });
|
|
122
|
+
this._blockEditor.blockGroups.push(this.blockGroup);
|
|
123
|
+
}
|
|
124
|
+
this._dialogRef.close(this.blockGroup);
|
|
125
|
+
return of(true);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
ngOnInit() {
|
|
129
|
+
this._blockEditor = this._data.blockEditor;
|
|
130
|
+
this.blockGroup = this._data.blockGroup || {};
|
|
131
|
+
this.block = this._data.block;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
GroupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GroupDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
135
|
+
GroupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: GroupDialogComponent, selector: "ng-component", ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Group</h1>\n <mat-dialog-content>\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.label\"\n name=\"groupLabel\"\n [required]=\"true\"\n placeholder=\"Group Label\">\n </textarea>\n </mat-form-field>\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [(ngModel)]=\"blockGroup.description\"\n name=\"groupDescription\">\n </textarea>\n </mat-form-field> \n </mat-dialog-content>\n <mat-dialog-actions>\n <button \n mat-button \n type=\"submit\"\n color=\"primary\">\n Save\n </button>\n <button \n mat-button \n type=\"button\"\n mat-dialog-close>\n Cancel\n </button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>", styles: [""], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i8.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.MatLabel, selector: "mat-label" }, { type: i6.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GroupDialogComponent, decorators: [{
|
|
137
|
+
type: Component,
|
|
138
|
+
args: [{
|
|
139
|
+
templateUrl: './group-dialog.component.html',
|
|
140
|
+
styleUrls: ['./group-dialog.component.scss'],
|
|
141
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
142
|
+
}]
|
|
143
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
144
|
+
type: Inject,
|
|
145
|
+
args: [MAT_DIALOG_DATA]
|
|
146
|
+
}] }, { type: i1$1.MatDialogRef }]; } });
|
|
147
|
+
|
|
113
148
|
class FsBlockEditorMarginDirective {
|
|
114
149
|
constructor(_elementRef) {
|
|
115
150
|
this._elementRef = _elementRef;
|
|
@@ -196,7 +231,7 @@ class LayersReorderDialogComponent {
|
|
|
196
231
|
}
|
|
197
232
|
}
|
|
198
233
|
LayersReorderDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LayersReorderDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
199
|
-
LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type:
|
|
234
|
+
LayersReorderDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: LayersReorderDialogComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <h1 mat-dialog-title><mat-icon>swap_vert</mat-icon> Reorder Blocks</h1>\n <mat-dialog-content>\n <mat-list cdkDropList (cdkDropListDropped)=\"swapItems($event)\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let block of blocks\">\n <mat-list-item cdkDrag cdkDragLockAxis=\"y\">\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\n <mat-icon>\n {{ blockTypeIcons[block.type] }}\n </mat-icon>\n <span class=\"block-label\">\n {{ block.label || block.content || 'No Content'}} \n </span>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button color=\"primary\" (click)=\"done()\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: ["h1{display:flex}.mat-icon{margin-right:20px}.block-label{min-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:1000px}.cdk-drag-preview{display:flex;padding-left:15px!important;background:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview ::ng-deep .mat-list-item-content{display:flex;flex-direction:row;align-items:center;font-size:16px}.cdk-drag-handle{cursor:grab}.cdk-drag-placeholder{opacity:.2}\n"], components: [{ type: i2.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$1.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i5$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i4$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i18.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i7$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i6.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
200
235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LayersReorderDialogComponent, decorators: [{
|
|
201
236
|
type: Component,
|
|
202
237
|
args: [{
|
|
@@ -218,7 +253,6 @@ var EventType;
|
|
|
218
253
|
})(EventType || (EventType = {}));
|
|
219
254
|
class BlocksStore {
|
|
220
255
|
constructor() {
|
|
221
|
-
this._lastTabIndex = -1;
|
|
222
256
|
this._eventBus$ = new Subject();
|
|
223
257
|
this._blocks$ = new BehaviorSubject([]);
|
|
224
258
|
this._destroy$ = new Subject();
|
|
@@ -251,16 +285,11 @@ class BlocksStore {
|
|
|
251
285
|
this._destroy$.next();
|
|
252
286
|
this._destroy$.complete();
|
|
253
287
|
}
|
|
254
|
-
init(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
.pipe(groupBy((block) => (block.guid)), map((group) => group.pipe(debounceTime(250))), mergeAll())
|
|
260
|
-
.subscribe((block) => {
|
|
261
|
-
this._config.blockChange(block);
|
|
262
|
-
});
|
|
263
|
-
}
|
|
288
|
+
init(blocks) {
|
|
289
|
+
blocks
|
|
290
|
+
.forEach((block) => {
|
|
291
|
+
this._appendBlock(block);
|
|
292
|
+
});
|
|
264
293
|
}
|
|
265
294
|
blockExists(block) {
|
|
266
295
|
const index = this.blocks.findIndex((b) => {
|
|
@@ -269,41 +298,7 @@ class BlocksStore {
|
|
|
269
298
|
return index !== -1;
|
|
270
299
|
}
|
|
271
300
|
blockAdd(block) {
|
|
272
|
-
|
|
273
|
-
console.warn('[BlockEditor] Config "blockAdd" is not defined');
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
block = this._createBlock(block);
|
|
277
|
-
this._config.blockAdd(block)
|
|
278
|
-
.pipe(takeUntil(this._destroy$))
|
|
279
|
-
.subscribe((newBlock) => {
|
|
280
|
-
this._appendBlock(newBlock);
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
blockUpload(block, fsFile) {
|
|
284
|
-
if (!this._config.blockUpload) {
|
|
285
|
-
return throwError('[BlockEditor] Config "blockUpload" is not defined');
|
|
286
|
-
}
|
|
287
|
-
const existing = this.blockExists(block);
|
|
288
|
-
if (!existing) {
|
|
289
|
-
block = this._createBlock(block);
|
|
290
|
-
}
|
|
291
|
-
return from(fsFile.imageInfo)
|
|
292
|
-
.pipe(switchMap((imageInfo) => {
|
|
293
|
-
if (!existing && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width)) {
|
|
294
|
-
const ratio = imageInfo.height / imageInfo.width;
|
|
295
|
-
block.width = this._config.width * .4;
|
|
296
|
-
block.height = block.width * ratio;
|
|
297
|
-
}
|
|
298
|
-
return this._config.blockUpload(block, fsFile.file);
|
|
299
|
-
}), tap((newBlock) => {
|
|
300
|
-
if (existing) {
|
|
301
|
-
this.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
this._appendBlock(newBlock);
|
|
305
|
-
}
|
|
306
|
-
}), takeUntil(this._destroy$));
|
|
301
|
+
this._appendBlock(block);
|
|
307
302
|
}
|
|
308
303
|
blockChange(block) {
|
|
309
304
|
this._dispatchEvent(EventType.Change, block);
|
|
@@ -326,26 +321,8 @@ class BlocksStore {
|
|
|
326
321
|
});
|
|
327
322
|
this._setBlocks(blocks);
|
|
328
323
|
}
|
|
329
|
-
isReordableBlock(block) {
|
|
330
|
-
return [
|
|
331
|
-
BlockType.LongText,
|
|
332
|
-
BlockType.ShortText,
|
|
333
|
-
BlockType.RadioButton,
|
|
334
|
-
BlockType.Checkbox,
|
|
335
|
-
BlockType.Date,
|
|
336
|
-
BlockType.Signature,
|
|
337
|
-
].indexOf(block.type) > -1;
|
|
338
|
-
}
|
|
339
|
-
updateTabIndex(index) {
|
|
340
|
-
this._lastTabIndex = index;
|
|
341
|
-
}
|
|
342
324
|
_setBlocks(blocks) {
|
|
343
325
|
this._blocks$.next([...blocks]);
|
|
344
|
-
blocks
|
|
345
|
-
.filter((b) => this.isReordableBlock(b))
|
|
346
|
-
.forEach((b) => {
|
|
347
|
-
this._lastTabIndex = Math.max(b.tabIndex, this._lastTabIndex);
|
|
348
|
-
});
|
|
349
326
|
}
|
|
350
327
|
_appendBlock(block) {
|
|
351
328
|
const blocks = [
|
|
@@ -362,34 +339,6 @@ class BlocksStore {
|
|
|
362
339
|
value,
|
|
363
340
|
});
|
|
364
341
|
}
|
|
365
|
-
_createBlock(block) {
|
|
366
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
367
|
-
let newBlock = Object.assign(Object.assign({}, block), { shapeBottomLeft: (_a = block.shapeBottomLeft) !== null && _a !== void 0 ? _a : 'round', shapeTopLeft: (_b = block.shapeTopLeft) !== null && _b !== void 0 ? _b : 'round', shapeTopRight: (_c = block.shapeTopRight) !== null && _c !== void 0 ? _c : 'round', shapeBottomRight: (_d = block.shapeBottomRight) !== null && _d !== void 0 ? _d : 'round', verticalAlign: (_e = block.verticalAlign) !== null && _e !== void 0 ? _e : 'top', horizontalAlign: (_f = block.horizontalAlign) !== null && _f !== void 0 ? _f : 'left', guid: block.guid || guid('xxxxxxxxxxxx'), keepRatio: (_g = block.keepRatio) !== null && _g !== void 0 ? _g : [
|
|
368
|
-
BlockType.Checkbox,
|
|
369
|
-
BlockType.RadioButton,
|
|
370
|
-
BlockType.Pdf,
|
|
371
|
-
]
|
|
372
|
-
.indexOf(block.type) !== -1 });
|
|
373
|
-
let width = (this._config.width * .333).toFixed(2);
|
|
374
|
-
let height = width / 2;
|
|
375
|
-
if (newBlock.type === BlockType.Rectangle) {
|
|
376
|
-
newBlock = Object.assign(Object.assign({}, newBlock), { borderColor: (_h = newBlock.borderColor) !== null && _h !== void 0 ? _h : '#cccccc', borderWidth: (_j = newBlock.borderWidth) !== null && _j !== void 0 ? _j : 1 });
|
|
377
|
-
}
|
|
378
|
-
else if (newBlock.type === BlockType.Checkbox || newBlock.type === BlockType.RadioButton) {
|
|
379
|
-
width = .25;
|
|
380
|
-
height = .25;
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
width = 2;
|
|
384
|
-
height = .5;
|
|
385
|
-
}
|
|
386
|
-
if (this.isReordableBlock(newBlock)) {
|
|
387
|
-
newBlock.tabIndex = this._lastTabIndex + 1;
|
|
388
|
-
this.updateTabIndex(newBlock.tabIndex);
|
|
389
|
-
}
|
|
390
|
-
return Object.assign({ top: height, left: width, width,
|
|
391
|
-
height }, newBlock);
|
|
392
|
-
}
|
|
393
342
|
_deduplicateIndexesFor(blocks) {
|
|
394
343
|
blocks.forEach((block, index) => {
|
|
395
344
|
block.index = index;
|
|
@@ -407,41 +356,91 @@ class BlockEditorService {
|
|
|
407
356
|
this._store = _store;
|
|
408
357
|
this._dialog = _dialog;
|
|
409
358
|
this._prompt = _prompt;
|
|
359
|
+
this.blockGroups = [];
|
|
410
360
|
this._selectedBlocks$ = new BehaviorSubject([]);
|
|
411
|
-
this._blockComponents = new
|
|
361
|
+
this._blockComponents$ = new BehaviorSubject([]);
|
|
412
362
|
this._blockClippable$ = new BehaviorSubject(null);
|
|
413
363
|
this._destroy$ = new Subject();
|
|
414
|
-
this._blockInited$ = new Subject();
|
|
415
364
|
}
|
|
416
|
-
get blockComponents() {
|
|
417
|
-
return
|
|
365
|
+
get blockComponents$() {
|
|
366
|
+
return this._blockComponents$.asObservable();
|
|
367
|
+
}
|
|
368
|
+
set blockComponents(blockComponents) {
|
|
369
|
+
this._blockComponents$.next(blockComponents);
|
|
418
370
|
}
|
|
419
371
|
init(config) {
|
|
420
372
|
this.config = config;
|
|
421
|
-
this._store.init(
|
|
373
|
+
this._store.init(config.blocks);
|
|
374
|
+
this._initBlockGroups();
|
|
375
|
+
this._initBlockChange();
|
|
422
376
|
}
|
|
423
377
|
blockAdd(block) {
|
|
424
|
-
this.
|
|
378
|
+
if (!this.config.blockAdd) {
|
|
379
|
+
console.warn('[BlockEditor] Config "blockAdd" is not defined');
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
block = this._initBlock(block);
|
|
383
|
+
this.config.blockAdd(block)
|
|
384
|
+
.pipe(takeUntil(this._destroy$))
|
|
385
|
+
.subscribe((newBlock) => {
|
|
386
|
+
this._store.blockAdd(newBlock);
|
|
387
|
+
});
|
|
425
388
|
}
|
|
426
389
|
blockUpload(block, fsFile) {
|
|
427
|
-
|
|
390
|
+
if (!this.config.blockUpload) {
|
|
391
|
+
return throwError('[BlockEditor] Config "blockUpload" is not defined');
|
|
392
|
+
}
|
|
393
|
+
const existing = this._store.blockExists(block);
|
|
394
|
+
if (!existing) {
|
|
395
|
+
block = this._initBlock(block);
|
|
396
|
+
}
|
|
397
|
+
return from(fsFile.imageInfo)
|
|
398
|
+
.pipe(switchMap((imageInfo) => {
|
|
399
|
+
if (!existing && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) && (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width)) {
|
|
400
|
+
const ratio = imageInfo.height / imageInfo.width;
|
|
401
|
+
block.width = this.config.width * .4;
|
|
402
|
+
block.height = block.width * ratio;
|
|
403
|
+
}
|
|
404
|
+
return this.config.blockUpload(block, fsFile.file);
|
|
405
|
+
}), tap((newBlock) => {
|
|
406
|
+
if (existing) {
|
|
407
|
+
this._store.blockUpdate(Object.assign(Object.assign({}, block), newBlock));
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
this.blockAdd(newBlock);
|
|
411
|
+
}
|
|
412
|
+
}), takeUntil(this._destroy$));
|
|
413
|
+
}
|
|
414
|
+
_initBlock(block) {
|
|
415
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
416
|
+
let newBlock = Object.assign(Object.assign({}, block), { shapeBottomLeft: (_a = block.shapeBottomLeft) !== null && _a !== void 0 ? _a : 'round', shapeTopLeft: (_b = block.shapeTopLeft) !== null && _b !== void 0 ? _b : 'round', shapeTopRight: (_c = block.shapeTopRight) !== null && _c !== void 0 ? _c : 'round', shapeBottomRight: (_d = block.shapeBottomRight) !== null && _d !== void 0 ? _d : 'round', verticalAlign: (_e = block.verticalAlign) !== null && _e !== void 0 ? _e : 'top', horizontalAlign: (_f = block.horizontalAlign) !== null && _f !== void 0 ? _f : 'left', index: block.guid ? block.index : this._store.blocks.length, guid: block.guid || guid('xxxxxxxxxxxx'), keepRatio: (_g = block.keepRatio) !== null && _g !== void 0 ? _g : [
|
|
417
|
+
BlockType.Checkbox,
|
|
418
|
+
BlockType.RadioButton,
|
|
419
|
+
BlockType.Pdf,
|
|
420
|
+
]
|
|
421
|
+
.indexOf(block.type) !== -1 });
|
|
422
|
+
let width = (this.config.width * .333).toFixed(2);
|
|
423
|
+
let height = width / 2;
|
|
424
|
+
if (newBlock.type === BlockType.Rectangle) {
|
|
425
|
+
newBlock = Object.assign(Object.assign({}, newBlock), { borderColor: (_h = newBlock.borderColor) !== null && _h !== void 0 ? _h : '#cccccc', borderWidth: (_j = newBlock.borderWidth) !== null && _j !== void 0 ? _j : 1 });
|
|
426
|
+
}
|
|
427
|
+
else if (newBlock.type === BlockType.Checkbox || newBlock.type === BlockType.RadioButton) {
|
|
428
|
+
width = .25;
|
|
429
|
+
height = .25;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
width = 2;
|
|
433
|
+
height = .5;
|
|
434
|
+
}
|
|
435
|
+
//get max tabindex
|
|
436
|
+
// newBlock.tabIndex = this._lastTabIndex + 1;
|
|
437
|
+
// this.updateTabIndex(newBlock.tabIndex);
|
|
438
|
+
return Object.assign({ top: height, left: width, width,
|
|
439
|
+
height }, newBlock);
|
|
428
440
|
}
|
|
429
441
|
blockRemove(block) {
|
|
430
442
|
this._store.blockRemove(block);
|
|
431
443
|
}
|
|
432
|
-
removeBlocks(blocks) {
|
|
433
|
-
this._prompt.confirm({
|
|
434
|
-
title: 'Confirm',
|
|
435
|
-
template: 'Are you sure your would like to delete this block?',
|
|
436
|
-
})
|
|
437
|
-
.pipe(switchMap(() => this.config.blocksRemove ? this.config.blocksRemove(blocks) : throwError('config.blocksRemove is not configured')), takeUntil(this._destroy$))
|
|
438
|
-
.subscribe(() => {
|
|
439
|
-
blocks.forEach((block) => {
|
|
440
|
-
this.blockRemove(block);
|
|
441
|
-
});
|
|
442
|
-
this.selectedBlocks = [];
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
444
|
get blocks$() {
|
|
446
445
|
return this._store.blocks$;
|
|
447
446
|
}
|
|
@@ -460,9 +459,6 @@ class BlockEditorService {
|
|
|
460
459
|
get blockAdded$() {
|
|
461
460
|
return this._store.blockAdded$;
|
|
462
461
|
}
|
|
463
|
-
get blockInited$() {
|
|
464
|
-
return this._blockInited$;
|
|
465
|
-
}
|
|
466
462
|
get blockRemoved$() {
|
|
467
463
|
return this._store.blockRemoved$;
|
|
468
464
|
}
|
|
@@ -472,16 +468,36 @@ class BlockEditorService {
|
|
|
472
468
|
blockChange(block) {
|
|
473
469
|
this._store.blockChange(block);
|
|
474
470
|
}
|
|
471
|
+
applyBlockGroup(block, blockGroup) {
|
|
472
|
+
block.name = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.name;
|
|
473
|
+
block.description = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.description;
|
|
474
|
+
block.label = blockGroup === null || blockGroup === void 0 ? void 0 : blockGroup.label;
|
|
475
|
+
this.blockChange(block);
|
|
476
|
+
}
|
|
475
477
|
isSelectedBlock(block) {
|
|
476
478
|
return this.selectedBlocks.indexOf(block) !== -1;
|
|
477
479
|
}
|
|
478
480
|
indexOf(block) {
|
|
479
481
|
return this.blocks.map((e) => e.guid).indexOf(block.guid);
|
|
480
482
|
}
|
|
481
|
-
selectedBlockComponentChangeProperty(
|
|
483
|
+
selectedBlockComponentChangeProperty(values) {
|
|
482
484
|
this.selectedBlocks
|
|
483
485
|
.forEach((block) => {
|
|
484
|
-
|
|
486
|
+
Object.keys(values)
|
|
487
|
+
.forEach((name) => {
|
|
488
|
+
block[name] = values[name];
|
|
489
|
+
});
|
|
490
|
+
this.blockChange(block);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
blockGroupChangeProperty(blockGroup, values) {
|
|
494
|
+
this.blocks
|
|
495
|
+
.filter((block) => block.name === blockGroup.name)
|
|
496
|
+
.forEach((block) => {
|
|
497
|
+
Object.keys(values)
|
|
498
|
+
.forEach((name) => {
|
|
499
|
+
block[name] = values[name];
|
|
500
|
+
});
|
|
485
501
|
this.blockChange(block);
|
|
486
502
|
});
|
|
487
503
|
}
|
|
@@ -514,19 +530,25 @@ class BlockEditorService {
|
|
|
514
530
|
hasSelectionRange() {
|
|
515
531
|
return this._selectionRange && (this._selectionRange.baseOffset - this._selectionRange.focusOffset) > 0;
|
|
516
532
|
}
|
|
517
|
-
initBlock(block, blockComponent) {
|
|
518
|
-
this._blockComponents.set(block, blockComponent);
|
|
519
|
-
this._blockInited$.next(block);
|
|
520
|
-
}
|
|
521
|
-
destroyBlock(block) {
|
|
522
|
-
this._blockComponents.delete(block);
|
|
523
|
-
}
|
|
524
533
|
registerContainer(container) {
|
|
525
534
|
this.container = container;
|
|
526
535
|
}
|
|
527
536
|
registerMargin(margin) {
|
|
528
537
|
this.margin = margin;
|
|
529
538
|
}
|
|
539
|
+
removeBlocks(blocks) {
|
|
540
|
+
this._prompt.confirm({
|
|
541
|
+
title: 'Confirm',
|
|
542
|
+
template: 'Are you sure your would like to delete this block?',
|
|
543
|
+
})
|
|
544
|
+
.pipe(switchMap(() => this.config.blocksRemove ? this.config.blocksRemove(blocks) : throwError('config.blocksRemove is not configured')), takeUntil(this._destroy$))
|
|
545
|
+
.subscribe(() => {
|
|
546
|
+
blocks.forEach((block) => {
|
|
547
|
+
this.blockRemove(block);
|
|
548
|
+
});
|
|
549
|
+
this.selectedBlocks = [];
|
|
550
|
+
});
|
|
551
|
+
}
|
|
530
552
|
openReorderDialog() {
|
|
531
553
|
const blocks = this.blocks
|
|
532
554
|
.sort((blockA, blockB) => (blockA.index - blockB.index))
|
|
@@ -544,7 +566,6 @@ class BlockEditorService {
|
|
|
544
566
|
blocks
|
|
545
567
|
.forEach((block, index) => {
|
|
546
568
|
block.index = index;
|
|
547
|
-
this._store.updateTabIndex(index);
|
|
548
569
|
});
|
|
549
570
|
});
|
|
550
571
|
}
|
|
@@ -552,6 +573,29 @@ class BlockEditorService {
|
|
|
552
573
|
this._destroy$.next();
|
|
553
574
|
this._destroy$.complete();
|
|
554
575
|
}
|
|
576
|
+
_initBlockGroups() {
|
|
577
|
+
this.blockGroups = Object.values(this._store.blocks
|
|
578
|
+
.reduce((accum, block) => {
|
|
579
|
+
if (block.name) {
|
|
580
|
+
const existing = accum[block.name] || {};
|
|
581
|
+
accum[block.name] = {
|
|
582
|
+
label: block.label || existing.label,
|
|
583
|
+
description: block.description || existing.description,
|
|
584
|
+
name: block.name,
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
return accum;
|
|
588
|
+
}, {}));
|
|
589
|
+
}
|
|
590
|
+
_initBlockChange() {
|
|
591
|
+
if (this.config.blockChange) {
|
|
592
|
+
this.blockChanged$
|
|
593
|
+
.pipe(groupBy((block) => (block.guid)), map((group) => group.pipe(debounceTime(250))), mergeAll())
|
|
594
|
+
.subscribe((block) => {
|
|
595
|
+
this.config.blockChange(block);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
555
599
|
}
|
|
556
600
|
BlockEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService, deps: [{ token: BlocksStore }, { token: i2.FsDialog }, { token: i3$1.FsPrompt }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
557
601
|
BlockEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BlockEditorService });
|
|
@@ -768,20 +812,17 @@ class FsBlockComponent {
|
|
|
768
812
|
this._cdRef.markForCheck();
|
|
769
813
|
});
|
|
770
814
|
}
|
|
771
|
-
|
|
815
|
+
ngAfterViewInit() {
|
|
772
816
|
setTimeout(() => {
|
|
773
817
|
this._initEvents();
|
|
774
818
|
this._initMoveable();
|
|
775
819
|
this._setTransform();
|
|
820
|
+
this._initElementGuidelines();
|
|
776
821
|
this.rotate = this.block.rotate;
|
|
777
|
-
this._blockEditor.initBlock(this.block, this);
|
|
778
|
-
this._blockEditor.blockInited$
|
|
779
|
-
.pipe(takeUntil(this._destroy$))
|
|
780
|
-
.subscribe(() => {
|
|
781
|
-
this._updateElementGuidelines();
|
|
782
|
-
});
|
|
783
822
|
});
|
|
784
823
|
}
|
|
824
|
+
ngAfterContentInit() {
|
|
825
|
+
}
|
|
785
826
|
pxToIn(px) {
|
|
786
827
|
return this.round(px / 96, 2);
|
|
787
828
|
}
|
|
@@ -815,7 +856,7 @@ class FsBlockComponent {
|
|
|
815
856
|
sel.addRange(range);
|
|
816
857
|
}
|
|
817
858
|
ngOnDestroy() {
|
|
818
|
-
this._blockEditor.destroyBlock(this.block);
|
|
859
|
+
//this._blockEditor.destroyBlock(this.block);
|
|
819
860
|
this._destroy$.next();
|
|
820
861
|
this._destroy$.complete();
|
|
821
862
|
}
|
|
@@ -826,11 +867,6 @@ class FsBlockComponent {
|
|
|
826
867
|
_triggerChanged() {
|
|
827
868
|
this._blockEditor.blockChange(this.block);
|
|
828
869
|
}
|
|
829
|
-
_updateElementGuidelines() {
|
|
830
|
-
this.moveable.elementGuidelines = this._blockEditor.blockComponents
|
|
831
|
-
.map((blockComponent) => blockComponent.el)
|
|
832
|
-
.filter((el) => !el.isSameNode(this.el));
|
|
833
|
-
}
|
|
834
870
|
_updateMoveable() {
|
|
835
871
|
const value = !this.block.lock && this.selected;
|
|
836
872
|
this.keepRatio = this.block.keepRatio;
|
|
@@ -839,6 +875,15 @@ class FsBlockComponent {
|
|
|
839
875
|
this.moveable.rotatable = this.block.rotatable && value;
|
|
840
876
|
this.moveable.scalable = this.block.scalable && value;
|
|
841
877
|
}
|
|
878
|
+
_initElementGuidelines() {
|
|
879
|
+
this._blockEditor.blockComponents$
|
|
880
|
+
.pipe(takeUntil(this._destroy$))
|
|
881
|
+
.subscribe((blockComponents) => {
|
|
882
|
+
this.moveable.elementGuidelines = blockComponents
|
|
883
|
+
.filter((blockComponent) => this !== blockComponent)
|
|
884
|
+
.map((blockComponent) => blockComponent.el);
|
|
885
|
+
});
|
|
886
|
+
}
|
|
842
887
|
_initMoveable() {
|
|
843
888
|
this._moveable = new Moveable(this._elementRef.nativeElement, {
|
|
844
889
|
target: this.el,
|
|
@@ -862,7 +907,6 @@ class FsBlockComponent {
|
|
|
862
907
|
throttleResize: 1,
|
|
863
908
|
snapDistFormat: (v, type) => `${this.round(v / 96, 2)}`,
|
|
864
909
|
});
|
|
865
|
-
this._updateElementGuidelines();
|
|
866
910
|
this._updateMoveable();
|
|
867
911
|
this.moveable
|
|
868
912
|
.on('clip', (e) => {
|
|
@@ -1073,7 +1117,7 @@ class FsBlockComponent {
|
|
|
1073
1117
|
}
|
|
1074
1118
|
}
|
|
1075
1119
|
FsBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: GoogleFontService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1076
|
-
FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { listeners: { "document:keydown": "keydown($event)" }, properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.
|
|
1120
|
+
FsBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { listeners: { "document:keydown": "keydown($event)" }, properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required,\n lock: block.lock,\n selected: selected\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'in' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'in' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'in' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'in' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + '%' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + '%' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngIf=\"block.imageUrl && ((block.imageUrl | createImageUrl) | async) as src\">\n <img \n [style.opacity]=\"block.imageOpacity ? block.imageOpacity/100 : 1\"\n [src]=\"src\">\n </ng-container>\n\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n <div class=\"outline\"></div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer;box-sizing:border-box}.block.selected{border-color:#31a2ff95}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative;z-index:100}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}.block.selected .outline,.block:hover .outline{border:1px solid rgba(68,170,255,.7);position:absolute;top:0;left:0;bottom:0;right:0;-webkit-user-select:none;user-select:none}.block.selected.lock .outline,.block:hover.lock .outline{border-color:#e4181866;border-style:dashed}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i18.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i18.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i18.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i18.AsyncPipe, "createImageUrl": CreateImageUrlPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1077
1121
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsBlockComponent, decorators: [{
|
|
1078
1122
|
type: Component,
|
|
1079
1123
|
args: [{
|
|
@@ -1114,7 +1158,7 @@ const BlockFormats = [
|
|
|
1114
1158
|
];
|
|
1115
1159
|
|
|
1116
1160
|
class SidebarComponent {
|
|
1117
|
-
constructor(_el, _blockEditor, _cdRef, _googleFontService, _clipboard, _message, _prompt, _document) {
|
|
1161
|
+
constructor(_el, _blockEditor, _cdRef, _googleFontService, _clipboard, _message, _prompt, _dialog, _document) {
|
|
1118
1162
|
this._el = _el;
|
|
1119
1163
|
this._blockEditor = _blockEditor;
|
|
1120
1164
|
this._cdRef = _cdRef;
|
|
@@ -1122,6 +1166,7 @@ class SidebarComponent {
|
|
|
1122
1166
|
this._clipboard = _clipboard;
|
|
1123
1167
|
this._message = _message;
|
|
1124
1168
|
this._prompt = _prompt;
|
|
1169
|
+
this._dialog = _dialog;
|
|
1125
1170
|
this._document = _document;
|
|
1126
1171
|
this.zoomCenter = new EventEmitter();
|
|
1127
1172
|
this.BlockTypes = BlockTypes;
|
|
@@ -1147,13 +1192,25 @@ class SidebarComponent {
|
|
|
1147
1192
|
get el() {
|
|
1148
1193
|
return this._el.nativeElement;
|
|
1149
1194
|
}
|
|
1195
|
+
get blockGroups() {
|
|
1196
|
+
return this._blockEditor.blockGroups;
|
|
1197
|
+
}
|
|
1150
1198
|
ngOnInit() {
|
|
1151
1199
|
this._blockEditor.selectedBlocks$
|
|
1152
1200
|
.pipe(takeUntil(this._destroy$))
|
|
1153
1201
|
.subscribe((blocks) => {
|
|
1154
1202
|
this.block = blocks[0] ? blocks[0] : null;
|
|
1155
|
-
this.
|
|
1156
|
-
|
|
1203
|
+
this.blockGroup = null;
|
|
1204
|
+
if (this.block) {
|
|
1205
|
+
this.formats = BlockFormats
|
|
1206
|
+
.filter((blockFormat) => (blockFormat.blockTypes.indexOf(this.block.type) !== -1));
|
|
1207
|
+
if (this.block.name) {
|
|
1208
|
+
this.blockGroup = this._blockEditor.blockGroups
|
|
1209
|
+
.find((blockGroup) => {
|
|
1210
|
+
return this.block.name === blockGroup.name;
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1157
1214
|
this._cdRef.markForCheck();
|
|
1158
1215
|
});
|
|
1159
1216
|
this._blockEditor.blockChanged$
|
|
@@ -1169,32 +1226,86 @@ class SidebarComponent {
|
|
|
1169
1226
|
};
|
|
1170
1227
|
}
|
|
1171
1228
|
}
|
|
1229
|
+
blockGroupChange(blockGroup) {
|
|
1230
|
+
this._blockEditor.applyBlockGroup(this.block, blockGroup);
|
|
1231
|
+
}
|
|
1232
|
+
blockRequired(value) {
|
|
1233
|
+
const values = { required: value, readonly: false };
|
|
1234
|
+
if (this.blockGroup) {
|
|
1235
|
+
this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
this.blockChangeProperty(values);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
blockReadonly(value) {
|
|
1242
|
+
const values = { readonly: value, required: false };
|
|
1243
|
+
if (this.blockGroup) {
|
|
1244
|
+
this._blockEditor.blockGroupChangeProperty(this.blockGroup, values);
|
|
1245
|
+
}
|
|
1246
|
+
else {
|
|
1247
|
+
this.blockChangeProperty(values);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
blockGroupEdit(event) {
|
|
1251
|
+
event.preventDefault();
|
|
1252
|
+
event.stopImmediatePropagation();
|
|
1253
|
+
this.blockGroupDialog(this.blockGroup)
|
|
1254
|
+
.subscribe((blockGroup) => {
|
|
1255
|
+
this._blockEditor.blocks
|
|
1256
|
+
.filter((block) => block.name === blockGroup.name)
|
|
1257
|
+
.forEach((block) => {
|
|
1258
|
+
this._blockEditor.applyBlockGroup(block, blockGroup);
|
|
1259
|
+
});
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
blockGroupCreate(event) {
|
|
1263
|
+
event.preventDefault();
|
|
1264
|
+
event.stopImmediatePropagation();
|
|
1265
|
+
this.blockGroupDialog()
|
|
1266
|
+
.subscribe((blockGroup) => {
|
|
1267
|
+
this._blockEditor.applyBlockGroup(this.block, blockGroup);
|
|
1268
|
+
this.blockGroup = blockGroup;
|
|
1269
|
+
this._cdRef.markForCheck();
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
blockGroupDialog(blockGroup) {
|
|
1273
|
+
return this._dialog.open(GroupDialogComponent, {
|
|
1274
|
+
data: {
|
|
1275
|
+
block: this.block,
|
|
1276
|
+
blockEditor: this._blockEditor,
|
|
1277
|
+
blockGroup,
|
|
1278
|
+
}
|
|
1279
|
+
})
|
|
1280
|
+
.afterClosed()
|
|
1281
|
+
.pipe(filter((block) => !!block), takeUntil(this._destroy$));
|
|
1282
|
+
}
|
|
1172
1283
|
fontChanged(font) {
|
|
1173
|
-
this._blockEditor.selectedBlockComponentChangeProperty(font === null || font === void 0 ? void 0 : font.family
|
|
1284
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ fontFamily: font === null || font === void 0 ? void 0 : font.family });
|
|
1174
1285
|
}
|
|
1175
1286
|
verticalAlignClick(value) {
|
|
1176
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1287
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ verticalAlign: value });
|
|
1177
1288
|
}
|
|
1178
1289
|
boldClick() {
|
|
1179
|
-
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.bold
|
|
1290
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ bold: !this.block.bold });
|
|
1180
1291
|
}
|
|
1181
1292
|
toggleLock() {
|
|
1182
|
-
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.lock
|
|
1293
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ lock: !this.block.lock });
|
|
1183
1294
|
}
|
|
1184
1295
|
fontColorChange(value) {
|
|
1185
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1296
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ fontColor: value });
|
|
1186
1297
|
}
|
|
1187
1298
|
italicClick() {
|
|
1188
|
-
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.italic
|
|
1299
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ italic: !this.block.italic });
|
|
1189
1300
|
}
|
|
1190
1301
|
underlineClick() {
|
|
1191
|
-
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.underline
|
|
1302
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ underline: !this.block.underline });
|
|
1192
1303
|
}
|
|
1193
1304
|
backgroundColorChange(value) {
|
|
1194
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1305
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ backgroundColor: value });
|
|
1195
1306
|
}
|
|
1196
1307
|
shadowColorChange(value) {
|
|
1197
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1308
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ shadowColor: value });
|
|
1198
1309
|
}
|
|
1199
1310
|
paddingAllChange(value) {
|
|
1200
1311
|
value = this.validNumeric(value) ? value : null;
|
|
@@ -1218,31 +1329,31 @@ class SidebarComponent {
|
|
|
1218
1329
|
}
|
|
1219
1330
|
}
|
|
1220
1331
|
borderColorChange(value) {
|
|
1221
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1332
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ borderColor: value });
|
|
1222
1333
|
}
|
|
1223
1334
|
toggleKeepRatio() {
|
|
1224
|
-
this._blockEditor.selectedBlockComponentChangeProperty(!this.block.keepRatio
|
|
1335
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ keepRatio: !this.block.keepRatio });
|
|
1225
1336
|
}
|
|
1226
1337
|
horizontalAlignClick(value) {
|
|
1227
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1338
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ horizontalAlign: value });
|
|
1228
1339
|
}
|
|
1229
1340
|
shapeRound(name) {
|
|
1230
1341
|
const value = this.block[name] === 'round' ? 'square' : 'round';
|
|
1231
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1342
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
|
|
1232
1343
|
}
|
|
1233
1344
|
numberChange(value, name) {
|
|
1234
1345
|
value = this.validNumeric(value) ? Number(value) : null;
|
|
1235
|
-
this._blockEditor.selectedBlockComponentChangeProperty(value
|
|
1346
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ [name]: value });
|
|
1236
1347
|
}
|
|
1237
1348
|
imageRemove() {
|
|
1238
|
-
this._blockEditor.selectedBlockComponentChangeProperty(null
|
|
1349
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ imageUrl: null });
|
|
1239
1350
|
}
|
|
1240
1351
|
imageClip() {
|
|
1241
1352
|
this.clippable = !this.clippable;
|
|
1242
1353
|
this._blockEditor.blockClippable = true;
|
|
1243
1354
|
}
|
|
1244
|
-
blockChangeProperty(
|
|
1245
|
-
this._blockEditor.selectedBlockComponentChangeProperty(
|
|
1355
|
+
blockChangeProperty(values) {
|
|
1356
|
+
this._blockEditor.selectedBlockComponentChangeProperty(values);
|
|
1246
1357
|
}
|
|
1247
1358
|
blockRemoveClick() {
|
|
1248
1359
|
this._blockEditor.removeBlocks(this._blockEditor.selectedBlocks);
|
|
@@ -1311,7 +1422,7 @@ class SidebarComponent {
|
|
|
1311
1422
|
numericInputKeypress(event, name, unit = 1) {
|
|
1312
1423
|
if (event.code === 'ArrowUp' || event.code === 'ArrowDown') {
|
|
1313
1424
|
this.block[name] = round(Number(this.block[name] || 0) + ((event.code === 'ArrowDown' ? -1 : 1) * unit), 3);
|
|
1314
|
-
this._blockEditor.selectedBlockComponentChangeProperty(this.block[name]
|
|
1425
|
+
this._blockEditor.selectedBlockComponentChangeProperty({ [name]: this.block[name] });
|
|
1315
1426
|
}
|
|
1316
1427
|
}
|
|
1317
1428
|
ngOnDestroy() {
|
|
@@ -1322,8 +1433,8 @@ class SidebarComponent {
|
|
|
1322
1433
|
return !value || !!String(value).match(/^\d*\.?\d*$/);
|
|
1323
1434
|
}
|
|
1324
1435
|
}
|
|
1325
|
-
SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: GoogleFontService }, { token: i2$1.FsClipboard }, { token: i3$2.FsMessage }, { token: i3$1.FsPrompt }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
1326
|
-
SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", zoompan: "zoompan" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\"\n [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'left', .01)\"\n (ngModelChange)=\"numberChange($event, 'left')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'top', .01)\"\n (ngModelChange)=\"numberChange($event, 'top')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate')\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'width', .01)\"\n (ngModelChange)=\"numberChange($event, 'width')\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'height', .01)\"\n (ngModelChange)=\"numberChange($event, 'height')\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}\n </div>\n <div class=\"sidebar-row\">\n\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'label')\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.Checkbox && block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty($event, 'description')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty($event, 'format')\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty($event, 'default')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty($event, 'formula')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton || block.type === BlockType.Checkbox\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupLabel\"\n name=\"groupLabel\"\n placeholder=\"Group Label\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupLabel')\">\n </textarea>\n </mat-form-field>\n\n <mat-form-field class=\"full-width\">\n <mat-label>Group Description</mat-label>\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.groupDescription\"\n name=\"groupDescription\"\n (ngModelChange)=\"blockChangeProperty($event, 'groupDescription')\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty($event, 'name')\">\n </mat-form-field>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockChangeProperty($event, 'required')\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockChangeProperty($event, 'readonly')\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row\">\n <fs-autocomplete\n [fetch]=\"fontFetch\"\n [fetchOnFocus]=\"true\"\n [displayWith]=\"fontDisplayWith\"\n [ngModel]=\"block.fontFamily ? { family: block.fontFamily } : null\"\n placeholder=\"Font\"\n [panelClass]=\"'font-autocomplete-panel'\"\n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n <app-font [font]=\"data\"></app-font>\n </ng-template>\n </fs-autocomplete>\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize')\"\n (ngModelChange)=\"numberChange($event, 'fontSize')\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight')\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'justify' }\"\n (click)=\"horizontalAlignClick('justify')\">\n <mat-icon>format_align_justify</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth')\"\n (ngModelChange)=\"numberChange($event, 'borderWidth')\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shapeRadius', 1)\"\n (ngModelChange)=\"numberChange($event, 'shapeRadius')\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row\">\n <fs-color-picker-chip\n (changed)=\"shadowColorChange($event)\"\n [color]=\"block.shadowColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowX')\"\n (ngModelChange)=\"numberChange($event, 'shadowX')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-y\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowY\"\n name=\"shadowY\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowY')\"\n (ngModelChange)=\"numberChange($event, 'shadowY')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowBlur')\"\n (ngModelChange)=\"numberChange($event, 'shadowBlur')\">\n <span matPrefix *ngIf=\"block.shadowBlur\">B</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowSpread')\"\n (ngModelChange)=\"numberChange($event, 'shadowSpread')\">\n <span matPrefix *ngIf=\"block.shadowSpread\">S</span>\n </mat-form-field>\n <!-- <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowOpacity\"\n name=\"shadowOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowOpacity')\"\n (ngModelChange)=\"numberChange($event, 'shadowOpacity')\">\n <span matPrefix *ngIf=\"block.shadowOpacity\">O</span>\n </mat-form-field> -->\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $event)\">\n <button\n type=\"button\"\n mat-icon-button>\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity')\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\n </ng-container>\n </div>\n </div>\n </ng-container> \n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n (keydown)=\"paddingAllKeypress($event, 1)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingTop')\"\n (ngModelChange)=\"numberChange($event, 'paddingTop')\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingBottom')\"\n (ngModelChange)=\"numberChange($event, 'paddingBottom')\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingLeft')\"\n (ngModelChange)=\"numberChange($event, 'paddingLeft')\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingRight')\"\n (ngModelChange)=\"numberChange($event, 'paddingRight')\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div> \n </ng-container> \n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n</ng-template>", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row.image-row .opacity{width:55px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .mat-form-field{width:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-x,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-y,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:26px}.sidebar .sidebar-panel.typography-panel fs-autocomplete{width:100%}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel.typography-panel .align-row .mat-icon-button{width:35px;height:35px;line-height:35px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i5$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i9.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i11.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i12.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "appearance", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared", "opened", "closed"] }, { type: FontComponent, selector: "app-font", inputs: ["font"] }, { type: i14.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i15.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i15.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i15.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i17.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i17.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i17.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i18.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i19.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i15.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i15.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i15.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i8.MatPrefix, selector: "[matPrefix]" }, { type: i20.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i8.MatLabel, selector: "mat-label" }, { type: i16.FsFormValidateDirective, selector: "[validate]", inputs: ["validate", "validateData", "validateOnSubmit"] }, { type: i12.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }, { type: i17.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1436
|
+
SidebarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }, { token: GoogleFontService }, { token: i2$1.FsClipboard }, { token: i3$2.FsMessage }, { token: i3$1.FsPrompt }, { token: i1$1.MatDialog }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
1437
|
+
SidebarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SidebarComponent, selector: "sidebar", inputs: { config: "config", blocks: "blocks", zoompan: "zoompan" }, outputs: { zoomCenter: "zoomCenter" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], ngImport: i0, template: "<div class=\"sidebar\">\n <form fsForm>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'draw'\">\n <ng-container [ngSwitch]=\"blockType.value\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Pdf }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"BlockType.Image\">\n <ng-container [ngTemplateOutlet]=\"addFile\" [ngTemplateOutletContext]=\"{ type: BlockType.Rectangle }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #addFile let-type=\"type\">\n <fs-file \n (select)=\"blockUpload({ type: type, keepRatio: true, borderWidth: 0 }, $event)\" \n [accept]=\"blockType.accept\">\n <ng-container [ngTemplateOutlet]=\"addButton\" [ngTemplateOutletContext]=\"{ blockType: blockType }\"></ng-container>\n </fs-file>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngFor=\"let blockType of BlockTypes\">\n <ng-container *ngIf=\"blockType.type === 'form'\">\n <ng-container \n [ngTemplateOutlet]=\"addButton\" \n [ngTemplateOutletContext]=\"{ blockType: blockType }\">\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div> \n\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-row\">\n <ng-container *ngIf=\"block\">\n <button\n class=\"layer-up\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerUp()\"\n [matTooltip]=\"'Increase layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n class=\"layer-down\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"layerDown()\"\n [matTooltip]=\"'Decrease layer'\">\n <mat-icon>arrow_back</mat-icon>\n <mat-icon>layers</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"toggleLock()\"\n [matTooltip]=\"block.lock ? 'Unlock' : 'Lock'\">\n <mat-icon>{{block.lock ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n [matTooltip]=\"'Delete block'\"\n (click)=\"blockRemoveClick()\">\n <mat-icon>delete_outline</mat-icon>\n </button> \n </ng-container>\n <ng-container *ngIf=\"blocksReordered\">\n <button\n class=\"reorder-layers\"\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"blocksReordered()\"\n [matTooltip]=\"'Reorder blocks'\">\n <mat-icon>swap_vert</mat-icon>\n </button>\n </ng-container>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n matTooltip=\"Reset zoom\"\n (click)=\"zoomCenter.emit()\">\n <mat-icon>crop_free</mat-icon>\n </button>\n </div>\n </div>\n <ng-container *ngIf=\"block\">\n <div class=\"sidebar-panel info-panel\">\n <div class=\"sidebar-label\">Info</div>\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.left\"\n name=\"left\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'left', .01)\"\n (ngModelChange)=\"numberChange($event, 'left')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.top\"\n name=\"top\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'top', .01)\"\n (ngModelChange)=\"numberChange($event, 'top')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless rotate\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.rotate\"\n name=\"rotate\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'rotate')\"\n (ngModelChange)=\"numberChange($event, 'rotate')\">\n <span matPrefix>R</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row field-gap\">\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.width\"\n name=\"width\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'width', .01)\"\n (ngModelChange)=\"numberChange($event, 'width')\">\n <span matPrefix>W</span>\n </mat-form-field>\n\n <div>\n <a (click)=\"toggleKeepRatio()\" class=\"keep-ratio\">\n <mat-icon>{{block.keepRatio ? 'lock_outline' : 'lock_open'}}</mat-icon>\n </a>\n </div>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.height\"\n name=\"height\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'height', .01)\"\n (ngModelChange)=\"numberChange($event, 'height')\">\n <span matPrefix>H</span>\n </mat-form-field>\n </div>\n </div>\n <ng-container\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date || block.type === BlockType.Signature\">\n <div class=\"sidebar-panel block-form-panel\">\n <div class=\"sidebar-label\">\n <mat-icon>{{blockTypeIcons[block.type]}}</mat-icon>\n {{blockTypeNames[block.type]}}\n </div>\n <div class=\"sidebar-row\">\n\n <ng-container *ngIf=\"block.type === BlockType.RadioButton\">\n <div class=\"group-block\">\n <mat-form-field class=\"full-width\" class=\"full-width\">\n <mat-label>Group</mat-label>\n <mat-select\n [(ngModel)]=\"blockGroup\"\n (ngModelChange)=\"blockGroupChange($event)\"\n name=\"group\">\n <ng-container *ngIf=\"blockGroups.length\">\n <mat-option [value]=\"null\">\n None\n </mat-option>\n </ng-container>\n <mat-option\n *ngFor=\"let item of blockGroups\"\n [value]=\"item\">\n {{ item.label }}\n </mat-option>\n <mat-option \n [value]=\"null\"\n (click)=\"blockGroupCreate($event)\">\n Create Group\n </mat-option>\n </mat-select> \n </mat-form-field>\n <ng-container *ngIf=\"blockGroup\">\n <a \n (click)=\"blockGroupEdit($event)\">\n <mat-icon>edit</mat-icon>\n </a>\n </ng-container>\n </div>\n </ng-container>\n\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.label\"\n name=\"label\"\n placeholder=\"Label\"\n (ngModelChange)=\"blockChangeProperty({ label: $event })\">\n </mat-form-field>\n\n <ng-container *ngIf=\"block.type !== BlockType.RadioButton\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.description\"\n name=\"description\"\n placeholder=\"Description\"\n (ngModelChange)=\"blockChangeProperty({ description: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <mat-form-field\n *ngIf=\"formats.length\"\n class=\"full-width\">\n <mat-label>Format</mat-label>\n <mat-select\n [(ngModel)]=\"block.format\"\n name=\"format\"\n (ngModelChange)=\"blockChangeProperty({ format: $event })\"> \n <mat-option [value]=\"null\">\n None\n </mat-option>\n <mat-option\n *ngFor=\"let item of formats\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container\n *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.Date\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.default\"\n name=\"default\"\n [validate]=\"validate\"\n placeholder=\"Default\"\n (ngModelChange)=\"blockChangeProperty({ default: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText\">\n <mat-form-field class=\"full-width\">\n <textarea\n matInput\n [cdkTextareaAutosize]=\"true\"\n [ngModel]=\"block.formula\"\n name=\"formula\"\n placeholder=\"Formula\"\n (ngModelChange)=\"blockChangeProperty({ formula: $event })\">\n </textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngIf=\"!blockGroup\">\n <ng-container [ngTemplateOutlet]=\"name\"></ng-container>\n </ng-container>\n\n <ng-template #name>\n <mat-form-field class=\"full-width\">\n <input\n matInput\n [ngModel]=\"block.name\"\n name=\"name\"\n placeholder=\"Name\"\n (ngModelChange)=\"blockChangeProperty({ name: $event })\">\n </mat-form-field>\n </ng-template>\n\n <div class=\"form-field-options\">\n <mat-checkbox\n name=\"required\"\n [(ngModel)]=\"block.required\"\n (ngModelChange)=\"blockRequired($event)\">\n Required\n </mat-checkbox>\n\n <mat-checkbox\n name=\"readonly\"\n [(ngModel)]=\"block.readonly\"\n (ngModelChange)=\"blockReadonly($event)\">\n Readonly\n </mat-checkbox>\n </div>\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle || block.type === BlockType.Image || block.type === BlockType.Pdf\">\n <div class=\"sidebar-panel typography-panel\">\n <div class=\"sidebar-label\">Typography</div>\n <div class=\"sidebar-row field-gap\">\n <fs-autocomplete\n [fetch]=\"fontFetch\"\n [fetchOnFocus]=\"true\"\n [displayWith]=\"fontDisplayWith\"\n [ngModel]=\"block.fontFamily ? { family: block.fontFamily } : null\"\n placeholder=\"Font\"\n [panelClass]=\"'font-autocomplete-panel'\"\n (ngModelChange)=\"fontChanged($event)\"\n name=\"fontfamily\">\n <ng-template fsAutocompleteTemplate let-data=\"data\">\n <app-font [font]=\"data\"></app-font>\n </ng-template>\n </fs-autocomplete>\n <fs-color-picker-chip\n (changed)=\"fontColorChange($event)\"\n [color]=\"block.fontColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless font-size\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.fontSize\"\n name=\"fontSize\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'fontSize')\"\n (ngModelChange)=\"numberChange($event, 'fontSize')\"\n placeholder=\"Size\">\n <span matPrefix *ngIf=\"block.fontSize\">S</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless line-height\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.lineHeight\"\n name=\"lineHeight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'lineHeight')\"\n (ngModelChange)=\"numberChange($event, 'lineHeight')\"\n placeholder=\"Line\">\n <span matPrefix *ngIf=\"block.lineHeight\">L</span>\n </mat-form-field>\n </div>\n\n <div class=\"sidebar-row style-row\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.bold }\"\n (click)=\"boldClick()\">\n <mat-icon>format_bold</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.italic }\"\n (click)=\"italicClick()\">\n <mat-icon>format_italic</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.underline }\"\n (click)=\"underlineClick()\">\n <mat-icon>format_underline</mat-icon>\n </button>\n </div>\n\n <div class=\"sidebar-row align-row field-gap\">\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'left' }\"\n (click)=\"horizontalAlignClick('left')\">\n <mat-icon>format_align_left</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'center' }\"\n (click)=\"horizontalAlignClick('center')\">\n <mat-icon>format_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'justify' }\"\n (click)=\"horizontalAlignClick('justify')\">\n <mat-icon>format_align_justify</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.horizontalAlign === 'right' }\"\n (click)=\"horizontalAlignClick('right')\">\n <mat-icon>format_align_right</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'top' }\"\n (click)=\"verticalAlignClick('top')\">\n <mat-icon>vertical_align_top</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'center' }\"\n (click)=\"verticalAlignClick('center')\">\n <mat-icon>vertical_align_center</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: block.verticalAlign === 'bottom' }\"\n (click)=\"verticalAlignClick('bottom')\">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Border</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"borderColorChange($event)\"\n [color]=\"block.borderColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless border-width\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.borderWidth\"\n name=\"borderWidth\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'borderWidth')\"\n (ngModelChange)=\"numberChange($event, 'borderWidth')\"\n placeholder=\"Width\">\n <span matPrefix *ngIf=\"block.borderWidth\">W</span>\n </mat-form-field>\n </div>\n </div>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Shape</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"backgroundColorChange($event)\"\n [color]=\"block.backgroundColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shape-radius\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shapeRadius\"\n name=\"shapeRadius\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shapeRadius', 1)\"\n (ngModelChange)=\"numberChange($event, 'shapeRadius')\"\n placeholder=\"Radius\">\n <span matPrefix *ngIf=\"block.shapeRadius\">R</span>\n </mat-form-field>\n\n <div class=\"shape-corners\">\n <div\n class=\"shape-corner shape-corner-top-left\"\n [ngClass]=\"{ round: block.shapeTopLeft === 'round' }\"\n (click)=\"shapeRound('shapeTopLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-top-right\"\n [ngClass]=\"{ round: block.shapeTopRight === 'round' }\"\n (click)=\"shapeRound('shapeTopRight')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-left\"\n [ngClass]=\"{ round: block.shapeBottomLeft === 'round' }\"\n (click)=\"shapeRound('shapeBottomLeft')\"></div>\n <div\n class=\"shape-corner shape-corner-bottom-right\"\n [ngClass]=\"{ round: block.shapeBottomRight === 'round' }\"\n (click)=\"shapeRound('shapeBottomRight')\"></div>\n </div>\n </div>\n </div>\n <div class=\"sidebar-panel shadow-panel\">\n <div class=\"sidebar-label\">Shadow</div>\n\n <div class=\"sidebar-row field-gap\">\n <fs-color-picker-chip\n (changed)=\"shadowColorChange($event)\"\n [color]=\"block.shadowColor\">\n </fs-color-picker-chip>\n\n <mat-form-field class=\"form-field-padless shadow-x\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowX\"\n name=\"shadowX\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowX')\"\n (ngModelChange)=\"numberChange($event, 'shadowX')\">\n <span matPrefix>X</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-y\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowY\"\n name=\"shadowY\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowY')\"\n (ngModelChange)=\"numberChange($event, 'shadowY')\">\n <span matPrefix>Y</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless shadow-blur\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowBlur\"\n name=\"shadowBlur\"\n placeholder=\"Blur\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowBlur')\"\n (ngModelChange)=\"numberChange($event, 'shadowBlur')\">\n <span matPrefix *ngIf=\"block.shadowBlur\">B</span>\n </mat-form-field>\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowSpread\"\n name=\"shadowSpread\"\n placeholder=\"Spread\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowSpread')\"\n (ngModelChange)=\"numberChange($event, 'shadowSpread')\">\n <span matPrefix *ngIf=\"block.shadowSpread\">S</span>\n </mat-form-field>\n <!-- <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.shadowOpacity\"\n name=\"shadowOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'shadowOpacity')\"\n (ngModelChange)=\"numberChange($event, 'shadowOpacity')\">\n <span matPrefix *ngIf=\"block.shadowOpacity\">O</span>\n </mat-form-field> -->\n </div>\n </div>\n <ng-container *ngIf=\"block.type === BlockType.Rectangle\">\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Image</div>\n <div class=\"sidebar-row image-row\">\n <fs-file (select)=\"blockUpload(block, $event)\">\n <button\n type=\"button\"\n mat-icon-button>\n <mat-icon>cloud_upload</mat-icon>\n </button>\n </fs-file>\n <ng-container *ngIf=\"block.imageUrl\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"imageRemove()\">\n <mat-icon>clear</mat-icon>\n </button>\n <button\n mat-icon-button\n class=\"toggle-button\"\n color=\"basic\"\n type=\"button\"\n [ngClass]=\"{ selected: clippable }\"\n (click)=\"imageClip()\">\n <mat-icon>crop</mat-icon>\n </button>\n\n <mat-form-field class=\"form-field-padless opacity\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.imageOpacity\"\n name=\"imageOpacity\"\n placeholder=\"Opacity\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"numericInputKeypress($event, 'imageOpacity')\"\n (ngModelChange)=\"numberChange($event, 'imageOpacity')\">\n <span matPrefix *ngIf=\"block.imageOpacity\">O</span>\n </mat-form-field>\n </ng-container>\n </div>\n </div>\n </ng-container> \n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Padding</div>\n <div class=\"sidebar-row padding-row field-gap\">\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [(ngModel)]=\"block.padding\"\n name=\"padding\"\n (focus)=\"inputFocus($event)\"\n (ngModelChange)=\"paddingAllChange($event)\"\n (keydown)=\"paddingAllKeypress($event, 1)\"\n placeholder=\"All\">\n <span matPrefix *ngIf=\"block.padding\">A</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingTop\"\n name=\"paddingTop\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingTop')\"\n (ngModelChange)=\"numberChange($event, 'paddingTop')\"\n placeholder=\"Top\">\n <span matPrefix *ngIf=\"block.paddingTop\">T</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingBottom\"\n name=\"paddingBottom\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingBottom')\"\n (ngModelChange)=\"numberChange($event, 'paddingBottom')\"\n placeholder=\"Bottom\">\n <span matPrefix *ngIf=\"block.paddingBottom\">B</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingLeft\"\n name=\"paddingLeft\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingLeft')\"\n (ngModelChange)=\"numberChange($event, 'paddingLeft')\"\n placeholder=\"Left\">\n <span matPrefix *ngIf=\"block.paddingLeft\">L</span>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-padless\" floatLabel=\"never\">\n <input\n matInput\n [ngModel]=\"block.paddingRight\"\n name=\"paddingRight\"\n (focus)=\"inputFocus($event)\"\n (keydown)=\"paddingKeypress($event, 'paddingRight')\"\n (ngModelChange)=\"numberChange($event, 'paddingRight')\"\n placeholder=\"Right\">\n <span matPrefix *ngIf=\"block.paddingRight\">R</span>\n </mat-form-field>\n </div>\n </div> \n </ng-container> \n </ng-container>\n <div class=\"sidebar-panel\">\n <div class=\"sidebar-label\">Tools</div>\n <div class=\"sidebar-row padding-row\">\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"exportBlocks()\"\n [matTooltip]=\"'Export blocks'\">\n <mat-icon>download</mat-icon>\n </button>\n <button\n mat-icon-button\n color=\"basic\"\n type=\"button\"\n (click)=\"importBlocks()\"\n [matTooltip]=\"'Import blocks'\">\n <mat-icon>upload</mat-icon>\n </button>\n </div>\n </div> \n\n <ng-container *ngFor=\"let sidebarPanel of sidebarPanels\">\n <div div class=\"sidebar-panel\" *ngIf=\"sidebarPanel.show\">\n <div class=\"sidebar-label\">{{sidebarPanel.label}}</div>\n <ng-container\n [ngTemplateOutlet]=\"sidebarPanel.templateRef\"\n [ngTemplateOutletContext]=\"{ block: block }\"></ng-container>\n </div>\n </ng-container>\n </form>\n</div>\n<ng-template #addButton let-blockType=\"blockType\">\n <button\n type=\"button\"\n mat-icon-button\n [matTooltip]=\"'Add ' + blockType.name\"\n (click)=\"blockAdd(blockType.value)\">\n <mat-icon>{{blockType.icon}}</mat-icon>\n </button>\n</ng-template>", styles: [".sidebar{width:285px;font-size:14px;height:100%;overflow:auto;background-color:#fff;padding:0 10px 10px;box-shadow:0 1px 3px 1px #0003;z-index:1;position:relative;box-sizing:border-box}.sidebar form{height:100%}.sidebar .sidebar-row{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.sidebar .sidebar-row+.sidebar-row{margin-top:12px}.sidebar .sidebar-row fs-color-picker-chip{margin-left:6px}.sidebar .sidebar-row.padding-row{flex-wrap:unset}.sidebar .sidebar-row.padding-row ::ng-deep .mat-form-field{width:20%;min-width:0}.sidebar .sidebar-row.image-row{margin-bottom:-5px}.sidebar .sidebar-row.image-row .opacity{width:55px;margin-left:10px}.sidebar .sidebar-row ::ng-deep .mat-checkbox,.sidebar .sidebar-row ::ng-deep .mat-form-field{font-size:12px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file){margin-right:11px}.sidebar .sidebar-row.field-gap>*:not(.mat-icon-button):not(fs-file):last-child{margin-right:0}.sidebar .layer-up ::ng-deep .mat-button-wrapper,.sidebar .layer-down ::ng-deep .mat-button-wrapper{position:relative}.sidebar .layer-up ::ng-deep .mat-button-wrapper mat-icon:first-child,.sidebar .layer-down ::ng-deep .mat-button-wrapper mat-icon:first-child{position:absolute;transform:rotate(90deg) scale(.5);top:-7px;color:#fff}.sidebar .layer-down mat-icon:first-child{transform:rotate(270deg) scale(.6)}.sidebar .padding{width:45px}.sidebar .line-height,.sidebar .font-size,.sidebar .border-width{width:45px}.sidebar .shape-radius{width:50px}.sidebar .shape-corners{display:grid;grid-template-columns:1fr 1fr;grid-column-gap:1px;column-gap:1px;grid-row-gap:1px;row-gap:1px}.sidebar .shape-corners .shape-corner{height:13px;width:13px;background-color:#ccc;cursor:pointer}.sidebar .shape-corners .shape-corner.round.shape-corner-top-right{border-top-right-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-top-left{border-top-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-left{border-bottom-left-radius:50%}.sidebar .shape-corners .shape-corner.round.shape-corner-bottom-right{border-bottom-right-radius:50%}.sidebar button.toggle-button:not(.selected) mat-icon{color:#ccc}.sidebar .group-block{width:100%;display:flex;align-items:center}.sidebar .group-block a{margin-left:5px;color:inherit}.sidebar .group-block a mat-icon{transform:scale(.8)}.sidebar .sidebar-panel{padding:10px}.sidebar .sidebar-panel+.sidebar-panel{border-top:1px solid #dadada}.sidebar .sidebar-panel.block-form-panel .sidebar-label{display:flex;align-items:center}.sidebar .sidebar-panel.block-form-panel .sidebar-label mat-icon{transform:scale(.8);color:inherit;margin-left:-5px}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox{display:block}.sidebar .sidebar-panel.block-form-panel .form-field-options mat-checkbox+mat-checkbox{margin-top:2px}.sidebar .sidebar-panel.info-panel .mat-form-field{width:60px}.sidebar .sidebar-panel.info-panel .mat-form-field.rotate{width:40px}.sidebar .sidebar-panel.shadow-panel .mat-form-field{width:41px}.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-x,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-y,.sidebar .sidebar-panel.shadow-panel .mat-form-field.shadow-blur{width:26px}.sidebar .sidebar-panel.typography-panel fs-autocomplete{width:100%}.sidebar .sidebar-panel.typography-panel .style-row{margin-bottom:-10px}.sidebar .sidebar-panel.typography-panel .align-row{margin-bottom:-5px}.sidebar .sidebar-panel.typography-panel .align-row .mat-icon-button{width:35px;height:35px;line-height:35px}.sidebar .sidebar-panel .sidebar-label{font-size:11px;margin-bottom:7px;color:#9e9e9e}.sidebar .sidebar-panel .keep-ratio{color:inherit;transform:scale(.85);display:block}.full-width{width:100%}:host ::ng-deep .mat-form-field-prefix{color:#9e9e9e;margin-right:3px;font-size:85%}\n"], components: [{ type: i6$1.FsFileComponent, selector: "fs-file", inputs: ["minHeight", "minWidth", "orientate", "multiple", "capture", "allowClick", "allowDrop", "accept", "disabled", "imageWidth", "imageHeight", "imageQuality"], outputs: ["select", "error", "clicked", "declined"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i13.FsAutocompleteComponent, selector: "fs-autocomplete", inputs: ["fetch", "placeholder", "displayWith", "fetchOnFocus", "readonly", "required", "disabled", "appearance", "hint", "panelWidth", "panelClass", "showClear"], outputs: ["cleared", "opened", "closed"] }, { type: FontComponent, selector: "app-font", inputs: ["font"] }, { type: i15.FsColorPickerChipComponent, selector: "fs-color-picker-chip", inputs: ["color", "showClear"], outputs: ["changed"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i18.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i18.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i18.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i18.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i18.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i18.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i19.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i9.MatPrefix, selector: "[matPrefix]" }, { type: i9.MatLabel, selector: "mat-label" }, { type: i8.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i6.FsFormValidateDirective, selector: "[validate]", inputs: ["validate", "validateData", "validateOnSubmit"] }, { type: i13.FsAutocompleteTemplateDirective, selector: "[fsAutocompleteTemplate]" }, { type: i18.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1327
1438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
1328
1439
|
type: Component,
|
|
1329
1440
|
args: [{
|
|
@@ -1332,7 +1443,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1332
1443
|
styleUrls: ['sidebar.component.scss'],
|
|
1333
1444
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1334
1445
|
}]
|
|
1335
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: GoogleFontService }, { type: i2$1.FsClipboard }, { type: i3$2.FsMessage }, { type: i3$1.FsPrompt }, { type: undefined, decorators: [{
|
|
1446
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BlockEditorService }, { type: i0.ChangeDetectorRef }, { type: GoogleFontService }, { type: i2$1.FsClipboard }, { type: i3$2.FsMessage }, { type: i3$1.FsPrompt }, { type: i1$1.MatDialog }, { type: undefined, decorators: [{
|
|
1336
1447
|
type: Inject,
|
|
1337
1448
|
args: [DOCUMENT]
|
|
1338
1449
|
}] }]; }, propDecorators: { sidebarPanels: [{
|
|
@@ -1376,13 +1487,22 @@ class ArtboardComponent {
|
|
|
1376
1487
|
this._cdRef.markForCheck();
|
|
1377
1488
|
});
|
|
1378
1489
|
}
|
|
1490
|
+
ngAfterViewInit() {
|
|
1491
|
+
this.blockComponents
|
|
1492
|
+
.changes
|
|
1493
|
+
.pipe(takeUntil(this._destroy$))
|
|
1494
|
+
.subscribe(() => {
|
|
1495
|
+
this._blockEditor.blockComponents = this.blockComponents.toArray();
|
|
1496
|
+
});
|
|
1497
|
+
this._blockEditor.blockComponents = this.blockComponents.toArray();
|
|
1498
|
+
}
|
|
1379
1499
|
ngOnDestroy() {
|
|
1380
1500
|
this._destroy$.next();
|
|
1381
1501
|
this._destroy$.complete();
|
|
1382
1502
|
}
|
|
1383
1503
|
}
|
|
1384
1504
|
ArtboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ArtboardComponent, deps: [{ token: i0.ElementRef }, { token: BlockEditorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1385
|
-
ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type:
|
|
1505
|
+
ArtboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ArtboardComponent, selector: "app-artboard", inputs: { config: "config", zoompan: "zoompan" }, queries: [{ propertyName: "sidebarPanels", predicate: FsBlockEditorSidebarPanelDirective }], viewQueries: [{ propertyName: "artboard", first: true, predicate: ["artboard"], descendants: true, static: true }, { propertyName: "marginContainer", first: true, predicate: ["marginContainer"], descendants: true, static: true }, { propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "blockComponents", predicate: FsBlockComponent, descendants: true }, { propertyName: "margins", predicate: FsBlockEditorMarginDirective, descendants: true }], ngImport: i0, template: "<div\n #artboard\n class=\"artboard mat-elevation-z4 deselectable\"\n [style.width]=\"config.width + config.unit\"\n [style.height]=\"config.height + config.unit\">\n <fs-block\n *ngFor=\"let block of blocks\"\n [zoompan]=\"zoompan\"\n [block]=\"block\">\n </fs-block>\n <div class=\"margin margin-top\" *ngIf=\"config.marginTop\" [style.top]=\"config.marginTop + 'in'\"></div>\n <div class=\"margin margin-left\" *ngIf=\"config.marginLeft\" [style.left]=\"config.marginLeft + 'in'\"></div>\n <div class=\"margin margin-bottom\" *ngIf=\"config.marginBottom\" [style.bottom]=\"config.marginBottom + 'in'\"></div>\n <div class=\"margin margin-right\" *ngIf=\"config.marginRight\" [style.right]=\"config.marginRight + 'in'\"></div>\n <div\n #marginContainer\n class=\"margin-container\"\n [style.top]=\"config.marginTop + 'in'\"\n [style.right]=\"config.marginRight + 'in'\"\n [style.bottom]=\"config.marginBottom + 'in'\"\n [style.left]=\"config.marginLeft + 'in'\">\n </div>\n</div> \n\n", styles: [".artboard{position:relative;display:inline-flex;background-color:#fff}.artboard .margin-container{position:absolute;z-index:-1}.artboard .margin{position:absolute;border-color:#ff85bd5e;border-style:dashed;border-width:0px}.artboard .margin.margin-top,.artboard .margin.margin-bottom{width:100%;border-top-width:1px}.artboard .margin.margin-left,.artboard .margin.margin-right{height:100%;border-left-width:1px}\n"], components: [{ type: FsBlockComponent, selector: "fs-block", inputs: ["block", "html", "zoompan"] }], directives: [{ type: i18.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i18.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1386
1506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ArtboardComponent, decorators: [{
|
|
1387
1507
|
type: Component,
|
|
1388
1508
|
args: [{
|
|
@@ -1503,7 +1623,8 @@ FsBlockEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
|
|
|
1503
1623
|
ArtboardComponent,
|
|
1504
1624
|
LayersReorderDialogComponent,
|
|
1505
1625
|
FontComponent,
|
|
1506
|
-
CreateImageUrlPipe
|
|
1626
|
+
CreateImageUrlPipe,
|
|
1627
|
+
GroupDialogComponent], imports: [CommonModule,
|
|
1507
1628
|
FormsModule,
|
|
1508
1629
|
MatIconModule,
|
|
1509
1630
|
MatButtonModule,
|
|
@@ -1583,6 +1704,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1583
1704
|
LayersReorderDialogComponent,
|
|
1584
1705
|
FontComponent,
|
|
1585
1706
|
CreateImageUrlPipe,
|
|
1707
|
+
GroupDialogComponent,
|
|
1586
1708
|
],
|
|
1587
1709
|
providers: [
|
|
1588
1710
|
GoogleFontService,
|