@candy-kingdom/bonnie-cms 0.1.7 → 0.2.0
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/esm2022/index.mjs +4 -5
- package/esm2022/lib/bonnie-cms.module.mjs +55 -24
- package/esm2022/lib/core-components/form-base.component.mjs +4 -7
- package/esm2022/lib/file-uploader/file-uploader.component.mjs +118 -0
- package/esm2022/lib/file-uploader/index.mjs +2 -0
- package/esm2022/lib/forms/file-form/file-form.component.mjs +43 -0
- package/esm2022/lib/forms/file-form/index.mjs +2 -0
- package/esm2022/lib/forms/index.mjs +8 -0
- package/esm2022/lib/forms/lottie-form/index.mjs +2 -0
- package/esm2022/lib/forms/lottie-form/lottie-form.component.mjs +45 -0
- package/esm2022/lib/forms/seo-form/index.mjs +2 -0
- package/esm2022/lib/{seo-form → forms/seo-form}/seo-form.component.mjs +6 -6
- package/esm2022/lib/forms/svg-form/index.mjs +2 -0
- package/esm2022/lib/forms/svg-form/svg-form.component.mjs +49 -0
- package/esm2022/lib/forms/text-form/TextInputStyle.mjs +7 -0
- package/esm2022/lib/forms/text-form/index.mjs +3 -0
- package/esm2022/lib/forms/text-form/text-form.component.mjs +33 -0
- package/esm2022/lib/forms/translation-form/index.mjs +2 -0
- package/esm2022/lib/forms/translation-form/translation-form.component.mjs +32 -0
- package/esm2022/lib/forms/unknown-form/index.mjs +2 -0
- package/esm2022/lib/forms/unknown-form/unknown-form.component.mjs +23 -0
- package/esm2022/lib/generated/file-setting-data.mjs +6 -0
- package/esm2022/lib/generated/i-setting.mjs +1 -1
- package/esm2022/lib/generated/index.mjs +4 -1
- package/esm2022/lib/generated/lottie-setting-data.mjs +6 -0
- package/esm2022/lib/generated/svg-setting-data.mjs +6 -0
- package/esm2022/lib/media-uploader/media-uploader.component.mjs +3 -3
- package/esm2022/lib/services/admin-data.service.mjs +37 -0
- package/esm2022/lib/services/data.service.mjs +75 -0
- package/esm2022/lib/services/index.mjs +3 -0
- package/esm2022/lib/translation-textarea/translation-textarea.component.mjs +1 -1
- package/fesm2022/candy-kingdom-bonnie-cms.mjs +522 -160
- package/fesm2022/candy-kingdom-bonnie-cms.mjs.map +1 -1
- package/index.d.ts +3 -4
- package/lib/bonnie-cms.module.d.ts +26 -21
- package/lib/core-components/form-base.component.d.ts +3 -5
- package/lib/file-uploader/file-uploader.component.d.ts +32 -0
- package/lib/file-uploader/index.d.ts +1 -0
- package/lib/forms/file-form/file-form.component.d.ts +14 -0
- package/lib/forms/file-form/index.d.ts +1 -0
- package/lib/forms/index.d.ts +7 -0
- package/lib/forms/lottie-form/index.d.ts +1 -0
- package/lib/forms/lottie-form/lottie-form.component.d.ts +16 -0
- package/lib/{seo-form → forms/seo-form}/seo-form.component.d.ts +2 -2
- package/lib/forms/svg-form/index.d.ts +1 -0
- package/lib/forms/svg-form/svg-form.component.d.ts +19 -0
- package/lib/{text-form → forms/text-form}/text-form.component.d.ts +3 -3
- package/lib/{translation-form → forms/translation-form}/translation-form.component.d.ts +4 -4
- package/lib/{unknown-form → forms/unknown-form}/unknown-form.component.d.ts +2 -2
- package/lib/generated/file-setting-data.d.ts +10 -0
- package/lib/generated/i-setting.d.ts +2 -0
- package/lib/generated/index.d.ts +3 -0
- package/lib/generated/lottie-setting-data.d.ts +9 -0
- package/lib/generated/svg-setting-data.d.ts +9 -0
- package/lib/services/admin-data.service.d.ts +16 -0
- package/lib/services/data.service.d.ts +19 -0
- package/lib/services/index.d.ts +2 -0
- package/package.json +1 -1
- package/esm2022/lib/seo-form/index.mjs +0 -2
- package/esm2022/lib/text-form/TextInputStyle.mjs +0 -7
- package/esm2022/lib/text-form/index.mjs +0 -3
- package/esm2022/lib/text-form/text-form.component.mjs +0 -33
- package/esm2022/lib/translation-form/index.mjs +0 -2
- package/esm2022/lib/translation-form/translation-form.component.mjs +0 -32
- package/esm2022/lib/unknown-form/index.mjs +0 -2
- package/esm2022/lib/unknown-form/unknown-form.component.mjs +0 -23
- /package/lib/{seo-form → forms/seo-form}/index.d.ts +0 -0
- /package/lib/{text-form → forms/text-form}/TextInputStyle.d.ts +0 -0
- /package/lib/{text-form → forms/text-form}/index.d.ts +0 -0
- /package/lib/{translation-form → forms/translation-form}/index.d.ts +0 -0
- /package/lib/{unknown-form → forms/unknown-form}/index.d.ts +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, forwardRef, Directive, Output, Component, ContentChildren, Host, Input, ViewChildren, ViewChild, HostBinding, NgModule } from '@angular/core';
|
|
3
|
-
import { Subject, debounceTime, map, last, catchError, Observable } from 'rxjs';
|
|
2
|
+
import { EventEmitter, forwardRef, Directive, Output, Component, ContentChildren, Host, Input, ViewChildren, ViewChild, ChangeDetectorRef, inject, Injectable, Inject, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { Subject, debounceTime, map, last, catchError, Observable, of, combineLatest, merge, mergeMap } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
6
|
-
import * as i2 from '@angular/common
|
|
7
|
-
import {
|
|
8
|
-
import * as i2
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
import * as i2$1 from '@angular/cdk/text-field';
|
|
6
|
+
import * as i2$1 from '@angular/common';
|
|
7
|
+
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
|
8
|
+
import * as i2 from '@angular/cdk/text-field';
|
|
11
9
|
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
|
12
10
|
import { take } from 'rxjs/operators';
|
|
13
11
|
import * as i1$1 from '@angular/platform-browser';
|
|
12
|
+
import * as i1$2 from '@angular/common/http';
|
|
13
|
+
import { HttpRequest, HttpEventType } from '@angular/common/http';
|
|
14
|
+
import * as i3 from 'ngx-lottie';
|
|
15
|
+
import { LottieComponent } from 'ngx-lottie';
|
|
14
16
|
import * as i4 from '@candy-kingdom/bonnie';
|
|
15
17
|
import { MediaObjectFit, BonnieModule } from '@candy-kingdom/bonnie';
|
|
16
18
|
|
|
@@ -54,6 +56,21 @@ import { MediaObjectFit, BonnieModule } from '@candy-kingdom/bonnie';
|
|
|
54
56
|
* Any changes made to this file can be lost when this file is regenerated.
|
|
55
57
|
*/
|
|
56
58
|
|
|
59
|
+
/**
|
|
60
|
+
* This is a TypeGen auto-generated file.
|
|
61
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* This is a TypeGen auto-generated file.
|
|
66
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This is a TypeGen auto-generated file.
|
|
71
|
+
* Any changes made to this file can be lost when this file is regenerated.
|
|
72
|
+
*/
|
|
73
|
+
|
|
57
74
|
/**
|
|
58
75
|
* This is a TypeGen auto-generated file.
|
|
59
76
|
* Any changes made to this file can be lost when this file is regenerated.
|
|
@@ -363,9 +380,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
363
380
|
|
|
364
381
|
class FormBaseComponent {
|
|
365
382
|
static { this.inputs = ['locale']; }
|
|
366
|
-
constructor(editable
|
|
383
|
+
constructor(editable) {
|
|
367
384
|
this.editable = editable;
|
|
368
|
-
this.http = http;
|
|
369
385
|
this.name = '';
|
|
370
386
|
this._locale = '';
|
|
371
387
|
}
|
|
@@ -375,7 +391,7 @@ class FormBaseComponent {
|
|
|
375
391
|
get locale() {
|
|
376
392
|
return this._locale;
|
|
377
393
|
}
|
|
378
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormBaseComponent, deps: [{ token: EditableDirective, host: true }
|
|
394
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormBaseComponent, deps: [{ token: EditableDirective, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
379
395
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: FormBaseComponent, selector: "ng-component", inputs: { locale: "locale" }, ngImport: i0, template: '', isInline: true }); }
|
|
380
396
|
}
|
|
381
397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormBaseComponent, decorators: [{
|
|
@@ -385,7 +401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
385
401
|
}]
|
|
386
402
|
}], ctorParameters: () => [{ type: EditableDirective, decorators: [{
|
|
387
403
|
type: Host
|
|
388
|
-
}] }
|
|
404
|
+
}] }], propDecorators: { locale: [{
|
|
389
405
|
type: Input
|
|
390
406
|
}] } });
|
|
391
407
|
|
|
@@ -458,7 +474,7 @@ class TranslationTextareaComponent {
|
|
|
458
474
|
});
|
|
459
475
|
}
|
|
460
476
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationTextareaComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
461
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: { minRows: "minRows", maxRows: "maxRows", text: "text", locale: "locale", device: "device" }, outputs: { startEditing: "startEditing", changed: "changed", blurred: "blurred" }, viewQueries: [{ propertyName: "autosizeList", predicate: CdkTextareaAutosize, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<textarea [(ngModel)]=\"text[locale]\"\r\n [cdkAutosizeMinRows]=\"minRows\"\r\n [cdkAutosizeMaxRows]=\"maxRows\"\r\n (click)=\"onClick()\"\r\n (keyup)=\"onKeyPress()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n cdkTextareaAutosize>\r\n</textarea>\r\n", styles: [":host{display:block;padding:6px 12px;border:1px solid silver}:host:hover{background-color:#333}:host:focus-within{background-color:#555}textarea{display:block;width:100%;line-height:140%;padding:2px 0;margin:0;box-sizing:content-box;border:none;resize:none;color:silver;background-color:transparent}textarea:focus{outline:none}textarea[readonly]{cursor:pointer}textarea[readonly]::selection{-webkit-user-select:none;user-select:none}textarea[readonly]:hover{background:repeating-linear-gradient(-45deg,#ccff00,#ccff00 10px,rgba(0,0,0,0) 10px,rgba(0,0,0,0) 20px) fixed bottom;color:#000}textarea:hover{cursor:pointer}textarea:focus{outline:none;color:#fff;cursor:default}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2
|
|
477
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: { minRows: "minRows", maxRows: "maxRows", text: "text", locale: "locale", device: "device" }, outputs: { startEditing: "startEditing", changed: "changed", blurred: "blurred" }, viewQueries: [{ propertyName: "autosizeList", predicate: CdkTextareaAutosize, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<textarea [(ngModel)]=\"text[locale]\"\r\n [cdkAutosizeMinRows]=\"minRows\"\r\n [cdkAutosizeMaxRows]=\"maxRows\"\r\n (click)=\"onClick()\"\r\n (keyup)=\"onKeyPress()\"\r\n (blur)=\"onBlur()\"\r\n matInput\r\n cdkTextareaAutosize>\r\n</textarea>\r\n", styles: [":host{display:block;padding:6px 12px;border:1px solid silver}:host:hover{background-color:#333}:host:focus-within{background-color:#555}textarea{display:block;width:100%;line-height:140%;padding:2px 0;margin:0;box-sizing:content-box;border:none;resize:none;color:silver;background-color:transparent}textarea:focus{outline:none}textarea[readonly]{cursor:pointer}textarea[readonly]::selection{-webkit-user-select:none;user-select:none}textarea[readonly]:hover{background:repeating-linear-gradient(-45deg,#ccff00,#ccff00 10px,rgba(0,0,0,0) 10px,rgba(0,0,0,0) 20px) fixed bottom;color:#000}textarea:hover{cursor:pointer}textarea:focus{outline:none;color:#fff;cursor:default}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }] }); }
|
|
462
478
|
}
|
|
463
479
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationTextareaComponent, decorators: [{
|
|
464
480
|
type: Component,
|
|
@@ -517,7 +533,7 @@ class LinkPopupComponent {
|
|
|
517
533
|
this.closed.emit();
|
|
518
534
|
}
|
|
519
535
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LinkPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
520
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: LinkPopupComponent, selector: "bonc-link-popup", inputs: { field: "field", maxRows: "maxRows", minRows: "minRows", linkTitle: "linkTitle", locale: "locale", link: "link" }, outputs: { linkChange: "linkChange", startEditing: "startEditing", changed: "changed", blurred: "blurred", open: "open", closed: "closed" }, ngImport: i0, template: "<bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n (click)=\"showPopup()\"\r\n [text]=\"linkTitle\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"onClick()\"\r\n (changed)=\"onChange()\"\r\n (blurred)=\"onBlur()\">\r\n</bonc-translation-input>\r\n\r\n<bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n (click)=\"showPopup()\"\r\n [text]=\"linkTitle\"\r\n [locale]=\"locale\"\r\n [minRows]=\"minRows\"\r\n [maxRows]=\"maxRows\"\r\n (startEditing)=\"onClick()\"\r\n (changed)=\"onChange()\"\r\n (blurred)=\"onBlur()\">\r\n</bonc-translation-textarea>\r\n\r\n<div *ngIf=\"popupIsShown\">\r\n <div class=\"popup\">\r\n <a (click)=\"hidePopup()\" class=\"close\">close</a>\r\n\r\n <label>Link\r\n <input [(ngModel)]=\"link[locale]\"\r\n (click)=\"onClick()\"\r\n (keyup)=\"onChange()\"\r\n (blur)=\"onBlur()\">\r\n </label>\r\n\r\n </div>\r\n</div>\r\n", styles: [":host{display:flex;flex-direction:column;position:relative}:host translation-input{z-index:1}.popup{position:absolute;display:flex;flex-direction:column;justify-content:center;width:350px;padding:20px;box-sizing:border-box;color:#000;background-color:#fff;z-index:5;border:2px solid black}.popup a{cursor:pointer}.popup a:hover{background-color:#cf0}.popup a.close{position:absolute;top:10px;right:10px}.popup label+label{margin-top:20px}.popup input{width:100%;margin-top:5px;padding:6px;font-size:12px;box-sizing:border-box;border:1px solid #222}.popup input:hover,.popup input:focus{background-color:silver;color:#333;border-color:silver;outline:none}button{display:block;color:#fff;background-color:transparent;box-shadow:none;border:none;outline:none;text-decoration:none;padding:3pt 10pt;text-align:center;-webkit-user-select:none;user-select:none;color:#000;cursor:pointer}button:hover{border-color:#333;background-color:#333}button:disabled{color:gray}button:hover{background-color:#cf0}\n"], dependencies: [{ kind: "directive", type: i2$
|
|
536
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: LinkPopupComponent, selector: "bonc-link-popup", inputs: { field: "field", maxRows: "maxRows", minRows: "minRows", linkTitle: "linkTitle", locale: "locale", link: "link" }, outputs: { linkChange: "linkChange", startEditing: "startEditing", changed: "changed", blurred: "blurred", open: "open", closed: "closed" }, ngImport: i0, template: "<bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n (click)=\"showPopup()\"\r\n [text]=\"linkTitle\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"onClick()\"\r\n (changed)=\"onChange()\"\r\n (blurred)=\"onBlur()\">\r\n</bonc-translation-input>\r\n\r\n<bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n (click)=\"showPopup()\"\r\n [text]=\"linkTitle\"\r\n [locale]=\"locale\"\r\n [minRows]=\"minRows\"\r\n [maxRows]=\"maxRows\"\r\n (startEditing)=\"onClick()\"\r\n (changed)=\"onChange()\"\r\n (blurred)=\"onBlur()\">\r\n</bonc-translation-textarea>\r\n\r\n<div *ngIf=\"popupIsShown\">\r\n <div class=\"popup\">\r\n <a (click)=\"hidePopup()\" class=\"close\">close</a>\r\n\r\n <label>Link\r\n <input [(ngModel)]=\"link[locale]\"\r\n (click)=\"onClick()\"\r\n (keyup)=\"onChange()\"\r\n (blur)=\"onBlur()\">\r\n </label>\r\n\r\n </div>\r\n</div>\r\n", styles: [":host{display:flex;flex-direction:column;position:relative}:host translation-input{z-index:1}.popup{position:absolute;display:flex;flex-direction:column;justify-content:center;width:350px;padding:20px;box-sizing:border-box;color:#000;background-color:#fff;z-index:5;border:2px solid black}.popup a{cursor:pointer}.popup a:hover{background-color:#cf0}.popup a.close{position:absolute;top:10px;right:10px}.popup label+label{margin-top:20px}.popup input{width:100%;margin-top:5px;padding:6px;font-size:12px;box-sizing:border-box;border:1px solid #222}.popup input:hover,.popup input:focus{background-color:silver;color:#333;border-color:silver;outline:none}button{display:block;color:#fff;background-color:transparent;box-shadow:none;border:none;outline:none;text-decoration:none;padding:3pt 10pt;text-align:center;-webkit-user-select:none;user-select:none;color:#000;cursor:pointer}button:hover{border-color:#333;background-color:#333}button:disabled{color:gray}button:hover{background-color:#cf0}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TranslationInputComponent, selector: "bonc-translation-input", inputs: ["text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: ["minRows", "maxRows", "text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }] }); }
|
|
521
537
|
}
|
|
522
538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LinkPopupComponent, decorators: [{
|
|
523
539
|
type: Component,
|
|
@@ -552,6 +568,448 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
552
568
|
args: [{ required: true }]
|
|
553
569
|
}] } });
|
|
554
570
|
|
|
571
|
+
class FormControlsComponent {
|
|
572
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
573
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: FormControlsComponent, selector: "bonc-form-controls", inputs: { editable: "editable" }, ngImport: i0, template: "<div [class.edit]=\"editable.inEditMode\" class=\"content\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<div [class.hidden]=\"!editable.inEditMode\" class=\"controls\">\r\n <a *ngIf=\"!editable.isDirty\" (click)=\"editable.cancel()\" class=\"close\">close</a>\r\n <ng-container *ngIf=\"editable.isDirty\">\r\n <a (click)=\"editable.cancel()\">reset</a>\r\n <a (click)=\"editable.requestSave()\" class=\"apply\">apply</a>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:flex;background-color:#222;color:silver}.content{flex:1;padding:10px}.content.edit{background-color:#111}.controls{display:flex;flex-direction:column;width:100px;background-color:#111}.controls.hidden{opacity:0;pointer-events:none}.controls a{display:block}.controls a.apply{flex:1}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
574
|
+
}
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormControlsComponent, decorators: [{
|
|
576
|
+
type: Component,
|
|
577
|
+
args: [{ selector: 'bonc-form-controls', template: "<div [class.edit]=\"editable.inEditMode\" class=\"content\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<div [class.hidden]=\"!editable.inEditMode\" class=\"controls\">\r\n <a *ngIf=\"!editable.isDirty\" (click)=\"editable.cancel()\" class=\"close\">close</a>\r\n <ng-container *ngIf=\"editable.isDirty\">\r\n <a (click)=\"editable.cancel()\">reset</a>\r\n <a (click)=\"editable.requestSave()\" class=\"apply\">apply</a>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:flex;background-color:#222;color:silver}.content{flex:1;padding:10px}.content.edit{background-color:#111}.controls{display:flex;flex-direction:column;width:100px;background-color:#111}.controls.hidden{opacity:0;pointer-events:none}.controls a{display:block}.controls a.apply{flex:1}\n"] }]
|
|
578
|
+
}], propDecorators: { editable: [{
|
|
579
|
+
type: Input,
|
|
580
|
+
args: [{ required: true }]
|
|
581
|
+
}] } });
|
|
582
|
+
|
|
583
|
+
class SeoFormComponent extends FormBaseComponent {
|
|
584
|
+
constructor() {
|
|
585
|
+
super(...arguments);
|
|
586
|
+
this._pageId = '';
|
|
587
|
+
this.ogImageUploadUrl = '';
|
|
588
|
+
this.label = '';
|
|
589
|
+
}
|
|
590
|
+
ngOnInit() {
|
|
591
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
592
|
+
this.editable.save();
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
set pageId(value) {
|
|
596
|
+
this._pageId = value;
|
|
597
|
+
this.ogImageUploadUrl = `/api/admin/page/Og-Image?pageId=${this.pageId}`; // todo: replace with link to single image api
|
|
598
|
+
}
|
|
599
|
+
get pageId() {
|
|
600
|
+
return this._pageId;
|
|
601
|
+
}
|
|
602
|
+
ResToSrc(res) {
|
|
603
|
+
return res.url;
|
|
604
|
+
}
|
|
605
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SeoFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
606
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SeoFormComponent, selector: "bonc-seo-form", inputs: { label: "label", pageId: "pageId" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <h2 *ngIf=\"label\">{{label}}</h2>\r\n\r\n <div class=\"form-group\">\r\n <label>Title</label>\r\n <bonc-translation-input [text]=\"editable.value.title\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Description</label>\r\n <bonc-translation-textarea [text]=\"editable.value.description\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Share image | 1200x630px</label>\r\n <!-- <simple-file-uploader *ngIf=\"locale === 'en'\"\r\n [(src)]=\"editable.value.ogImage.en\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader>\r\n\r\n <simple-file-uploader *ngIf=\"locale === 'ru'\"\r\n [(src)]=\"editable.value.ogImage.ru\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader> -->\r\n\r\n </div>\r\n\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"!editable.value\">Editable Value canot be null or undefined</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TranslationInputComponent, selector: "bonc-translation-input", inputs: ["text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: ["minRows", "maxRows", "text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
607
|
+
}
|
|
608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SeoFormComponent, decorators: [{
|
|
609
|
+
type: Component,
|
|
610
|
+
args: [{ selector: 'bonc-seo-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <h2 *ngIf=\"label\">{{label}}</h2>\r\n\r\n <div class=\"form-group\">\r\n <label>Title</label>\r\n <bonc-translation-input [text]=\"editable.value.title\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Description</label>\r\n <bonc-translation-textarea [text]=\"editable.value.description\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Share image | 1200x630px</label>\r\n <!-- <simple-file-uploader *ngIf=\"locale === 'en'\"\r\n [(src)]=\"editable.value.ogImage.en\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader>\r\n\r\n <simple-file-uploader *ngIf=\"locale === 'ru'\"\r\n [(src)]=\"editable.value.ogImage.ru\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader> -->\r\n\r\n </div>\r\n\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"!editable.value\">Editable Value canot be null or undefined</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
611
|
+
}], propDecorators: { label: [{
|
|
612
|
+
type: Input
|
|
613
|
+
}], pageId: [{
|
|
614
|
+
type: Input
|
|
615
|
+
}] } });
|
|
616
|
+
|
|
617
|
+
class FileUploaderComponent {
|
|
618
|
+
constructor(sanitizer, http, cd) {
|
|
619
|
+
this.sanitizer = sanitizer;
|
|
620
|
+
this.http = http;
|
|
621
|
+
this.cd = cd;
|
|
622
|
+
this.srcChange = new EventEmitter();
|
|
623
|
+
this.progress = 0;
|
|
624
|
+
this.isUploading = false;
|
|
625
|
+
this.autoplay = true;
|
|
626
|
+
this.fileTypeMask = undefined;
|
|
627
|
+
this._uploadTypes = [];
|
|
628
|
+
}
|
|
629
|
+
set src(newSrc) {
|
|
630
|
+
if (this._src === newSrc)
|
|
631
|
+
return;
|
|
632
|
+
this._src = newSrc;
|
|
633
|
+
}
|
|
634
|
+
get src() {
|
|
635
|
+
return this._src;
|
|
636
|
+
}
|
|
637
|
+
set uploadTypes(newUploadType) {
|
|
638
|
+
this._uploadTypes.splice(0, this._uploadTypes.length);
|
|
639
|
+
this._uploadTypes.push(...newUploadType);
|
|
640
|
+
this.fileTypeMask = this._uploadTypes.length === 0 ? undefined : this._uploadTypes.join(',');
|
|
641
|
+
this.cd.detectChanges();
|
|
642
|
+
}
|
|
643
|
+
get uploadTypes() {
|
|
644
|
+
return this._uploadTypes;
|
|
645
|
+
}
|
|
646
|
+
onFileSelect(fileInput) {
|
|
647
|
+
if (fileInput.files === undefined || fileInput.files === null || fileInput.files.length !== 1)
|
|
648
|
+
return;
|
|
649
|
+
const file = fileInput.files[0];
|
|
650
|
+
const uploadUrl = this.uploadUrlMap.get(file.type) ?? this.uploadUrlMap.get("");
|
|
651
|
+
if (uploadUrl === undefined || uploadUrl === null) {
|
|
652
|
+
console.error(`upload map doesn't have url for type '${file.type}'`);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
const formData = new FormData();
|
|
656
|
+
formData.append('file', file);
|
|
657
|
+
this.progress = 0;
|
|
658
|
+
this.isUploading = true;
|
|
659
|
+
this.updateClip();
|
|
660
|
+
const request = new HttpRequest('POST', uploadUrl, formData, {
|
|
661
|
+
reportProgress: true
|
|
662
|
+
});
|
|
663
|
+
this.http
|
|
664
|
+
.request(request)
|
|
665
|
+
.pipe(map(event => this.getEventMessage(event)),
|
|
666
|
+
// tap(message => this.showProgress(message)),
|
|
667
|
+
last(), // return last (completed) message to caller
|
|
668
|
+
catchError(this.handleError(file))).subscribe(() => { this.isUploading = false; });
|
|
669
|
+
}
|
|
670
|
+
selectFile(event) {
|
|
671
|
+
// ignore buble click on file picker
|
|
672
|
+
if (event.target === this.fileInput.nativeElement)
|
|
673
|
+
return;
|
|
674
|
+
this.fileInput.nativeElement.click();
|
|
675
|
+
}
|
|
676
|
+
getEventMessage(event) {
|
|
677
|
+
switch (event.type) {
|
|
678
|
+
case HttpEventType.Sent:
|
|
679
|
+
return;
|
|
680
|
+
case HttpEventType.UploadProgress:
|
|
681
|
+
this.progress = event.total === undefined ? 0.5 : event.loaded / event.total;
|
|
682
|
+
this.updateClip();
|
|
683
|
+
return;
|
|
684
|
+
case HttpEventType.Response:
|
|
685
|
+
if (event.body === null || event.body === undefined) {
|
|
686
|
+
console.warn(`empty body from uploader`);
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
this.srcChange.emit(event.body);
|
|
690
|
+
return;
|
|
691
|
+
default:
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
updateClip() {
|
|
696
|
+
this.clipStyle = this.sanitizer.bypassSecurityTrustStyle(`inset(0px 100% 0px 0%)`);
|
|
697
|
+
}
|
|
698
|
+
handleError(file) {
|
|
699
|
+
const func = (error, p2) => {
|
|
700
|
+
const message = `error uploadingFile ${file.name}.`;
|
|
701
|
+
console.error(message, error, p2);
|
|
702
|
+
alert(message);
|
|
703
|
+
return new Observable();
|
|
704
|
+
};
|
|
705
|
+
return func;
|
|
706
|
+
}
|
|
707
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FileUploaderComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i1$2.HttpClient }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
708
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: FileUploaderComponent, selector: "bonc-file-uploader", inputs: { uploadUrlMap: "uploadUrlMap", src: "src", uploadTypes: "uploadTypes" }, outputs: { srcChange: "srcChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<div *ngIf=\"src?.url?.length === undefined || src?.url?.length === 0\">Upload file</div>\r\n\r\n<ng-content></ng-content>\r\n\r\n<div (click)=\"selectFile($event)\" class=\"media-container\">\r\n <input #fileInput [accept]=\"fileTypeMask\" (change)=\"onFileSelect(fileInput)\" name=\"media\" type=\"file\" />\r\n <span *ngIf=\"isUploading\"\r\n [style.clip-path]=\"clipStyle\"\r\n [style.-webkit-clip-path]=\"clipStyle\"\r\n class=\"loader\"></span>\r\n\r\n <span *ngIf=\"isUploading\" class=\"loader-text\">\r\n <span *ngIf=\"progress < 1\">{{100 * progress | number: '1.0-0'}}%</span>\r\n <span *ngIf=\"progress >= 1\">converting</span>\r\n </span>\r\n</div>\r\n", styles: [":host{display:block;background-color:#000;position:relative}.media-container{display:block;position:absolute;inset:0;cursor:pointer}.media-container:hover:hover:after{display:flex;justify-content:center;align-items:center;content:\"\";position:absolute;color:silver;inset:0;font-weight:700;font-size:50pt;pointer-events:none;background-color:#ccff00b3}.media-container img,.media-container video{display:block;position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}input[type=file]{display:none}.loader{position:absolute;inset:0;background-color:#cf0}.loader-text{background-color:#000;position:absolute;top:50%;left:0;right:0;text-align:center;font-size:20pt;margin-top:-10pt;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.DecimalPipe, name: "number" }] }); }
|
|
709
|
+
}
|
|
710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FileUploaderComponent, decorators: [{
|
|
711
|
+
type: Component,
|
|
712
|
+
args: [{ selector: 'bonc-file-uploader', template: "<div *ngIf=\"src?.url?.length === undefined || src?.url?.length === 0\">Upload file</div>\r\n\r\n<ng-content></ng-content>\r\n\r\n<div (click)=\"selectFile($event)\" class=\"media-container\">\r\n <input #fileInput [accept]=\"fileTypeMask\" (change)=\"onFileSelect(fileInput)\" name=\"media\" type=\"file\" />\r\n <span *ngIf=\"isUploading\"\r\n [style.clip-path]=\"clipStyle\"\r\n [style.-webkit-clip-path]=\"clipStyle\"\r\n class=\"loader\"></span>\r\n\r\n <span *ngIf=\"isUploading\" class=\"loader-text\">\r\n <span *ngIf=\"progress < 1\">{{100 * progress | number: '1.0-0'}}%</span>\r\n <span *ngIf=\"progress >= 1\">converting</span>\r\n </span>\r\n</div>\r\n", styles: [":host{display:block;background-color:#000;position:relative}.media-container{display:block;position:absolute;inset:0;cursor:pointer}.media-container:hover:hover:after{display:flex;justify-content:center;align-items:center;content:\"\";position:absolute;color:silver;inset:0;font-weight:700;font-size:50pt;pointer-events:none;background-color:#ccff00b3}.media-container img,.media-container video{display:block;position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}input[type=file]{display:none}.loader{position:absolute;inset:0;background-color:#cf0}.loader-text{background-color:#000;position:absolute;top:50%;left:0;right:0;text-align:center;font-size:20pt;margin-top:-10pt;color:#fff}\n"] }]
|
|
713
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type: i1$2.HttpClient }, { type: i0.ChangeDetectorRef }], propDecorators: { fileInput: [{
|
|
714
|
+
type: ViewChild,
|
|
715
|
+
args: ['fileInput', { static: true }]
|
|
716
|
+
}], srcChange: [{
|
|
717
|
+
type: Output
|
|
718
|
+
}], uploadUrlMap: [{
|
|
719
|
+
type: Input,
|
|
720
|
+
args: [{ required: true }]
|
|
721
|
+
}], src: [{
|
|
722
|
+
type: Input
|
|
723
|
+
}], uploadTypes: [{
|
|
724
|
+
type: Input
|
|
725
|
+
}] } });
|
|
726
|
+
|
|
727
|
+
class SvgFormComponent extends FormBaseComponent {
|
|
728
|
+
constructor(editable) {
|
|
729
|
+
super(editable);
|
|
730
|
+
this.cd = inject(ChangeDetectorRef);
|
|
731
|
+
this.SvgMime = 'image/svg+xml';
|
|
732
|
+
this.label = '';
|
|
733
|
+
this.uploadMap = new Map();
|
|
734
|
+
this._uploadUrl = '/api/admin/upload/image/svg';
|
|
735
|
+
this.uploadMap.set(this.SvgMime, this._uploadUrl);
|
|
736
|
+
}
|
|
737
|
+
ngOnInit() {
|
|
738
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
739
|
+
this.editable.save();
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
set uploadUrl(newValue) {
|
|
743
|
+
this._uploadUrl = newValue;
|
|
744
|
+
this.uploadMap.set(this.SvgMime, this._uploadUrl);
|
|
745
|
+
this.cd.detectChanges();
|
|
746
|
+
}
|
|
747
|
+
onFileUploaded(fileSrc) {
|
|
748
|
+
this.editable.startEditing();
|
|
749
|
+
const svgSrc = fileSrc;
|
|
750
|
+
this.editable.value = svgSrc;
|
|
751
|
+
this.editable.updateDirty();
|
|
752
|
+
}
|
|
753
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SvgFormComponent, deps: [{ token: EditableDirective, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
754
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SvgFormComponent, selector: "bonc-svg-form", inputs: { label: "label", uploadUrl: "uploadUrl" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"[SvgMime]\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n <img *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [src]=\"editable.value?.url\" />\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}a{color:silver}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }, { kind: "component", type: FileUploaderComponent, selector: "bonc-file-uploader", inputs: ["uploadUrlMap", "src", "uploadTypes"], outputs: ["srcChange"] }] }); }
|
|
755
|
+
}
|
|
756
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SvgFormComponent, decorators: [{
|
|
757
|
+
type: Component,
|
|
758
|
+
args: [{ selector: 'bonc-svg-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"[SvgMime]\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n <img *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [src]=\"editable.value?.url\" />\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}a{color:silver}\n"] }]
|
|
759
|
+
}], ctorParameters: () => [{ type: EditableDirective, decorators: [{
|
|
760
|
+
type: Host
|
|
761
|
+
}] }], propDecorators: { label: [{
|
|
762
|
+
type: Input
|
|
763
|
+
}], uploadUrl: [{
|
|
764
|
+
type: Input
|
|
765
|
+
}] } });
|
|
766
|
+
|
|
767
|
+
class FileFormComponent extends FormBaseComponent {
|
|
768
|
+
constructor() {
|
|
769
|
+
super(...arguments);
|
|
770
|
+
this.label = '';
|
|
771
|
+
this.uploadTypes = [];
|
|
772
|
+
this.uploadMap = new Map();
|
|
773
|
+
}
|
|
774
|
+
ngOnInit() {
|
|
775
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
776
|
+
this.editable.save();
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
;
|
|
780
|
+
onFileUploaded(fileSrc) {
|
|
781
|
+
this.editable.startEditing();
|
|
782
|
+
const svgSrc = fileSrc;
|
|
783
|
+
this.editable.value = svgSrc;
|
|
784
|
+
this.editable.updateDirty();
|
|
785
|
+
}
|
|
786
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FileFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
787
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: FileFormComponent, selector: "bonc-file-form", inputs: { label: "label", uploadTypes: "uploadTypes", uploadMap: "uploadMap" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"uploadTypes\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n <div *ngIf=\"editable.value?.url?.length ?? 0 > 0\">{{editable.value?.url}}</div>\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}a{color:silver}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }, { kind: "component", type: FileUploaderComponent, selector: "bonc-file-uploader", inputs: ["uploadUrlMap", "src", "uploadTypes"], outputs: ["srcChange"] }] }); }
|
|
788
|
+
}
|
|
789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FileFormComponent, decorators: [{
|
|
790
|
+
type: Component,
|
|
791
|
+
args: [{ selector: 'bonc-file-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"uploadTypes\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n <div *ngIf=\"editable.value?.url?.length ?? 0 > 0\">{{editable.value?.url}}</div>\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}a{color:silver}\n"] }]
|
|
792
|
+
}], propDecorators: { label: [{
|
|
793
|
+
type: Input
|
|
794
|
+
}], uploadTypes: [{
|
|
795
|
+
type: Input,
|
|
796
|
+
args: [{ required: true }]
|
|
797
|
+
}], uploadMap: [{
|
|
798
|
+
type: Input,
|
|
799
|
+
args: [{ required: true }]
|
|
800
|
+
}] } });
|
|
801
|
+
|
|
802
|
+
var TextInputStyle;
|
|
803
|
+
(function (TextInputStyle) {
|
|
804
|
+
TextInputStyle[TextInputStyle["NotSet"] = 0] = "NotSet";
|
|
805
|
+
TextInputStyle[TextInputStyle["SingleLine"] = 1] = "SingleLine";
|
|
806
|
+
TextInputStyle[TextInputStyle["MultiLine"] = 2] = "MultiLine";
|
|
807
|
+
})(TextInputStyle || (TextInputStyle = {}));
|
|
808
|
+
|
|
809
|
+
class TextFormComponent extends FormBaseComponent {
|
|
810
|
+
constructor() {
|
|
811
|
+
super(...arguments);
|
|
812
|
+
this.TextInputStyle = TextInputStyle;
|
|
813
|
+
this.label = '';
|
|
814
|
+
this.type = TextInputStyle.SingleLine;
|
|
815
|
+
}
|
|
816
|
+
ngOnInit() {
|
|
817
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
818
|
+
this.editable.save();
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
822
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TextFormComponent, selector: "bonc-text-form", inputs: { label: "label", type: "type" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <input *ngIf=\"editable && type === TextInputStyle.SingleLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\" />\r\n\r\n <textarea *ngIf=\"editable && type === TextInputStyle.MultiLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\">\r\n </textarea>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}input,textarea{display:block;width:100%;padding:6px;color:silver;border:1px solid silver;background-color:transparent;box-sizing:border-box;font-size:inherit}input:hover,textarea:hover{border-color:transparent;background-color:#333;cursor:pointer}input:focus,textarea:focus{outline:none;color:#fff;border-color:transparent;background-color:#555}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
823
|
+
}
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextFormComponent, decorators: [{
|
|
825
|
+
type: Component,
|
|
826
|
+
args: [{ selector: 'bonc-text-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <input *ngIf=\"editable && type === TextInputStyle.SingleLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\" />\r\n\r\n <textarea *ngIf=\"editable && type === TextInputStyle.MultiLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\">\r\n </textarea>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}input,textarea{display:block;width:100%;padding:6px;color:silver;border:1px solid silver;background-color:transparent;box-sizing:border-box;font-size:inherit}input:hover,textarea:hover{border-color:transparent;background-color:#333;cursor:pointer}input:focus,textarea:focus{outline:none;color:#fff;border-color:transparent;background-color:#555}\n"] }]
|
|
827
|
+
}], propDecorators: { label: [{
|
|
828
|
+
type: Input
|
|
829
|
+
}], type: [{
|
|
830
|
+
type: Input
|
|
831
|
+
}] } });
|
|
832
|
+
|
|
833
|
+
class LottieFormComponent extends FormBaseComponent {
|
|
834
|
+
constructor() {
|
|
835
|
+
super(...arguments);
|
|
836
|
+
this.LottieMimeType = 'application/json';
|
|
837
|
+
this.label = '';
|
|
838
|
+
this.uploadMap = new Map();
|
|
839
|
+
}
|
|
840
|
+
ngOnInit() {
|
|
841
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
842
|
+
this.editable.save();
|
|
843
|
+
});
|
|
844
|
+
this.editable.valueChange.subscribe(x => {
|
|
845
|
+
const url = x?.url ?? '';
|
|
846
|
+
this.animOptions = url.length === 0 ? undefined : { path: url };
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
;
|
|
850
|
+
onFileUploaded(fileSrc) {
|
|
851
|
+
this.editable.startEditing();
|
|
852
|
+
const svgSrc = fileSrc;
|
|
853
|
+
this.editable.value = svgSrc;
|
|
854
|
+
this.editable.updateDirty();
|
|
855
|
+
}
|
|
856
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LottieFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
857
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: LottieFormComponent, selector: "bonc-lottie-form", inputs: { label: "label", uploadMap: "uploadMap" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"[LottieMimeType]\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n\r\n <ng-lottie *ngIf=\"animOptions\"\r\n [options]=\"animOptions\"></ng-lottie>\r\n\r\n\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block;max-width:600px}a{color:silver}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LottieComponent, selector: "ng-lottie", inputs: ["width", "height"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }, { kind: "component", type: FileUploaderComponent, selector: "bonc-file-uploader", inputs: ["uploadUrlMap", "src", "uploadTypes"], outputs: ["srcChange"] }] }); }
|
|
858
|
+
}
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LottieFormComponent, decorators: [{
|
|
860
|
+
type: Component,
|
|
861
|
+
args: [{ selector: 'bonc-lottie-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n <bonc-file-uploader [src]=\"editable.value\"\r\n [uploadTypes]=\"[LottieMimeType]\"\r\n [uploadUrlMap]=\"uploadMap\"\r\n (srcChange)=\"onFileUploaded($event)\">\r\n\r\n <ng-lottie *ngIf=\"animOptions\"\r\n [options]=\"animOptions\"></ng-lottie>\r\n\r\n\r\n </bonc-file-uploader>\r\n\r\n <a *ngIf=\"editable.value?.url?.length ?? 0 > 0\" [href]=\"editable.value!.url\" download target=\"_blank\">Download</a>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block;max-width:600px}a{color:silver}\n"] }]
|
|
862
|
+
}], propDecorators: { label: [{
|
|
863
|
+
type: Input
|
|
864
|
+
}], uploadMap: [{
|
|
865
|
+
type: Input,
|
|
866
|
+
args: [{ required: true }]
|
|
867
|
+
}] } });
|
|
868
|
+
|
|
869
|
+
class TranslationFormComponent extends FormBaseComponent {
|
|
870
|
+
constructor() {
|
|
871
|
+
super(...arguments);
|
|
872
|
+
this.TextEditorField = TextEditorField;
|
|
873
|
+
}
|
|
874
|
+
ngOnInit() {
|
|
875
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
876
|
+
this.editable.save();
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
880
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TranslationFormComponent, selector: "bonc-translation-form", inputs: { field: "field", label: "label" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n [text]=\"editable.value\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n\r\n\r\n <bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n [text]=\"editable.value\"\r\n [minRows]=\"2\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"editable.value===undefined\">Editable value canot be undefined</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TranslationInputComponent, selector: "bonc-translation-input", inputs: ["text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: ["minRows", "maxRows", "text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
881
|
+
}
|
|
882
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationFormComponent, decorators: [{
|
|
883
|
+
type: Component,
|
|
884
|
+
args: [{ selector: 'bonc-translation-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n [text]=\"editable.value\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n\r\n\r\n <bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n [text]=\"editable.value\"\r\n [minRows]=\"2\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"editable.value===undefined\">Editable value canot be undefined</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
885
|
+
}], propDecorators: { field: [{
|
|
886
|
+
type: Input,
|
|
887
|
+
args: [{ required: true }]
|
|
888
|
+
}], label: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}] } });
|
|
891
|
+
|
|
892
|
+
class UnknownFormComponent extends FormBaseComponent {
|
|
893
|
+
constructor() {
|
|
894
|
+
super(...arguments);
|
|
895
|
+
this.label = '';
|
|
896
|
+
}
|
|
897
|
+
ngOnInit() {
|
|
898
|
+
this.editable.externalSaveCall.subscribe(() => {
|
|
899
|
+
this.editable.save();
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
903
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: UnknownFormComponent, selector: "bonc-unknown-form", inputs: { label: "label" }, usesInheritance: true, ngImport: i0, template: "<label>Unknown form:<b>{{label}}</b></label>\r\n<pre><ng-content></ng-content></pre>\r\n", styles: [":host{display:block;color:#000;padding:20px;background-color:#dc143c;margin-bottom:10px}\n"] }); }
|
|
904
|
+
}
|
|
905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownFormComponent, decorators: [{
|
|
906
|
+
type: Component,
|
|
907
|
+
args: [{ selector: 'bonc-unknown-form', template: "<label>Unknown form:<b>{{label}}</b></label>\r\n<pre><ng-content></ng-content></pre>\r\n", styles: [":host{display:block;color:#000;padding:20px;background-color:#dc143c;margin-bottom:10px}\n"] }]
|
|
908
|
+
}], propDecorators: { label: [{
|
|
909
|
+
type: Input
|
|
910
|
+
}] } });
|
|
911
|
+
|
|
912
|
+
class DataService {
|
|
913
|
+
constructor(http, baseHref) {
|
|
914
|
+
this.http = http;
|
|
915
|
+
this.baseHref = baseHref;
|
|
916
|
+
}
|
|
917
|
+
getView(viewCode) {
|
|
918
|
+
const pageOb = this.getSkeleton(`${this.baseHref}api/views/${viewCode}`);
|
|
919
|
+
return pageOb;
|
|
920
|
+
}
|
|
921
|
+
getPage(pageRoute) {
|
|
922
|
+
const pageUrl = `/${pageRoute}`;
|
|
923
|
+
const pageOb = this.getSkeleton(`${this.baseHref}api/pages/?url=${encodeURIComponent(pageUrl)}`);
|
|
924
|
+
return pageOb;
|
|
925
|
+
}
|
|
926
|
+
getSettings(ids) {
|
|
927
|
+
const pageOb = this.http.get(`${this.baseHref}api/settings`, {
|
|
928
|
+
params: { ids: ids }
|
|
929
|
+
});
|
|
930
|
+
return pageOb;
|
|
931
|
+
}
|
|
932
|
+
getSkeleton(url) {
|
|
933
|
+
const skeletonOb = this.http.get(url);
|
|
934
|
+
const routeDataObs = skeletonOb
|
|
935
|
+
.pipe(map(x => {
|
|
936
|
+
const notEmptyDataRoutes = x.bones
|
|
937
|
+
.map(b => ('dataRoute' in b) && typeof (b.dataRoute) === 'string' ? b.dataRoute : '')
|
|
938
|
+
.filter(x => x.length > 0);
|
|
939
|
+
if (notEmptyDataRoutes.length === 0) {
|
|
940
|
+
const emptyData = {};
|
|
941
|
+
return { page: of(x), data: of(emptyData) };
|
|
942
|
+
}
|
|
943
|
+
return {
|
|
944
|
+
page: of(x),
|
|
945
|
+
data: combineLatest(notEmptyDataRoutes
|
|
946
|
+
.map(dataRoute => {
|
|
947
|
+
const url = `${this.baseHref}api/Pages/Children/?url=${dataRoute}`;
|
|
948
|
+
return {
|
|
949
|
+
route: dataRoute,
|
|
950
|
+
json: this.http.get(url)
|
|
951
|
+
};
|
|
952
|
+
})
|
|
953
|
+
.reduce((prev, curr) => {
|
|
954
|
+
prev[curr.route] = curr.json;
|
|
955
|
+
return prev;
|
|
956
|
+
}, {}))
|
|
957
|
+
};
|
|
958
|
+
}), map(x => combineLatest(x)), mergeMap(res => merge(res)), map(x => {
|
|
959
|
+
for (const bone of x.page.bones) {
|
|
960
|
+
if (!('dataRoute' in bone) || typeof bone.dataRoute !== 'string' || bone.dataRoute.length === 0)
|
|
961
|
+
continue;
|
|
962
|
+
const data = x.data[bone.dataRoute];
|
|
963
|
+
if (data === undefined || data === null)
|
|
964
|
+
throw new Error(`Data ${bone.dataRoute} have not been preloaded`);
|
|
965
|
+
bone.data = data; // todo: fix
|
|
966
|
+
}
|
|
967
|
+
return x.page;
|
|
968
|
+
}));
|
|
969
|
+
return routeDataObs;
|
|
970
|
+
}
|
|
971
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DataService, deps: [{ token: i1$2.HttpClient }, { token: APP_BASE_HREF }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
972
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DataService }); }
|
|
973
|
+
}
|
|
974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DataService, decorators: [{
|
|
975
|
+
type: Injectable
|
|
976
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
977
|
+
type: Inject,
|
|
978
|
+
args: [APP_BASE_HREF]
|
|
979
|
+
}] }] });
|
|
980
|
+
|
|
981
|
+
class AdminDataService {
|
|
982
|
+
constructor(http, baseHref) {
|
|
983
|
+
this.http = http;
|
|
984
|
+
this.baseHref = baseHref;
|
|
985
|
+
console.log('baseHref: ' + baseHref);
|
|
986
|
+
}
|
|
987
|
+
getSettingGroups() {
|
|
988
|
+
const pageOb = this.http.get(`${this.baseHref}api/admin/settings`);
|
|
989
|
+
return pageOb;
|
|
990
|
+
}
|
|
991
|
+
getPage(url) {
|
|
992
|
+
const pageOb = this.http.get(`${this.baseHref}api/admin/pages/${url}`);
|
|
993
|
+
return pageOb;
|
|
994
|
+
}
|
|
995
|
+
storePage(page) {
|
|
996
|
+
const ob = this.http.post(`${this.baseHref}api/admin/pages`, page);
|
|
997
|
+
return ob;
|
|
998
|
+
}
|
|
999
|
+
updateSettings(settings) {
|
|
1000
|
+
const ob = this.http.post(`${this.baseHref}api/admin/settings`, settings);
|
|
1001
|
+
return ob;
|
|
1002
|
+
}
|
|
1003
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AdminDataService, deps: [{ token: i1$2.HttpClient }, { token: APP_BASE_HREF }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1004
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AdminDataService }); }
|
|
1005
|
+
}
|
|
1006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AdminDataService, decorators: [{
|
|
1007
|
+
type: Injectable
|
|
1008
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
1009
|
+
type: Inject,
|
|
1010
|
+
args: [APP_BASE_HREF]
|
|
1011
|
+
}] }] });
|
|
1012
|
+
|
|
555
1013
|
class AdminControlsComponent {
|
|
556
1014
|
constructor() {
|
|
557
1015
|
this.DeviceType = DeviceType;
|
|
@@ -579,7 +1037,7 @@ class AdminControlsComponent {
|
|
|
579
1037
|
}
|
|
580
1038
|
}
|
|
581
1039
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AdminControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
582
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: AdminControlsComponent, selector: "bonc-admin-controls", inputs: { editableGroup: "editableGroup", deviceControls: "deviceControls" }, ngImport: i0, template: "<div class=\"page-controls\">\r\n <a (click)=\"changeLocale()\" class=\"locale\">Locale: {{locale}}</a>\r\n\r\n <!-- todo: return this functionality -->\r\n <!-- <a *ngIf=\"deviceControls\" (click)=\"changeDevice()\" class=\"device\">\r\n <span *ngIf=\"device === DeviceType.Desktop\">DESKTOP</span>\r\n <span *ngIf=\"device === DeviceType.Tablet\">TABLET</span>\r\n <span *ngIf=\"device === DeviceType.Mobile\">MOBILE</span>\r\n </a> -->\r\n\r\n <a *ngIf=\"editableGroup && editableGroup.inEditMode\"\r\n (click)=\"editableGroup.saveAll()\"\r\n class=\"save\">Save all</a>\r\n\r\n <a *ngIf=\"editableGroup && editableGroup.inEditMode\"\r\n (click)=\"editableGroup.cancelAll()\"\r\n class=\"cancel\">Cancel all</a>\r\n</div>\r\n", styles: [":host{display:block;position:sticky;top:0;width:100%;z-index:1000}.page-controls{background-color:#111;height:60px;display:flex;align-items:center;justify-content:center}.page-controls a{color:silver;padding:4px;cursor:pointer;-webkit-user-select:none;user-select:none;text-align:center}.page-controls a:hover{color:#000;background-color:#cf0}.page-controls a.device{width:80px}.page-controls a+a{margin-left:6px}\n"], dependencies: [{ kind: "directive", type: i2$
|
|
1040
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: AdminControlsComponent, selector: "bonc-admin-controls", inputs: { editableGroup: "editableGroup", deviceControls: "deviceControls" }, ngImport: i0, template: "<div class=\"page-controls\">\r\n <a (click)=\"changeLocale()\" class=\"locale\">Locale: {{locale}}</a>\r\n\r\n <!-- todo: return this functionality -->\r\n <!-- <a *ngIf=\"deviceControls\" (click)=\"changeDevice()\" class=\"device\">\r\n <span *ngIf=\"device === DeviceType.Desktop\">DESKTOP</span>\r\n <span *ngIf=\"device === DeviceType.Tablet\">TABLET</span>\r\n <span *ngIf=\"device === DeviceType.Mobile\">MOBILE</span>\r\n </a> -->\r\n\r\n <a *ngIf=\"editableGroup && editableGroup.inEditMode\"\r\n (click)=\"editableGroup.saveAll()\"\r\n class=\"save\">Save all</a>\r\n\r\n <a *ngIf=\"editableGroup && editableGroup.inEditMode\"\r\n (click)=\"editableGroup.cancelAll()\"\r\n class=\"cancel\">Cancel all</a>\r\n</div>\r\n", styles: [":host{display:block;position:sticky;top:0;width:100%;z-index:1000}.page-controls{background-color:#111;height:60px;display:flex;align-items:center;justify-content:center}.page-controls a{color:silver;padding:4px;cursor:pointer;-webkit-user-select:none;user-select:none;text-align:center}.page-controls a:hover{color:#000;background-color:#cf0}.page-controls a.device{width:80px}.page-controls a+a{margin-left:6px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
583
1041
|
}
|
|
584
1042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AdminControlsComponent, decorators: [{
|
|
585
1043
|
type: Component,
|
|
@@ -591,18 +1049,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
591
1049
|
type: Input
|
|
592
1050
|
}] } });
|
|
593
1051
|
|
|
594
|
-
class FormControlsComponent {
|
|
595
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
596
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: FormControlsComponent, selector: "bonc-form-controls", inputs: { editable: "editable" }, ngImport: i0, template: "<div [class.edit]=\"editable.inEditMode\" class=\"content\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<div [class.hidden]=\"!editable.inEditMode\" class=\"controls\">\r\n <a *ngIf=\"!editable.isDirty\" (click)=\"editable.cancel()\" class=\"close\">close</a>\r\n <ng-container *ngIf=\"editable.isDirty\">\r\n <a (click)=\"editable.cancel()\">reset</a>\r\n <a (click)=\"editable.requestSave()\" class=\"apply\">apply</a>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:flex;background-color:#222;color:silver}.content{flex:1;padding:10px}.content.edit{background-color:#111}.controls{display:flex;flex-direction:column;width:100px;background-color:#111}.controls.hidden{opacity:0;pointer-events:none}.controls a{display:block}.controls a.apply{flex:1}\n"], dependencies: [{ kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
597
|
-
}
|
|
598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FormControlsComponent, decorators: [{
|
|
599
|
-
type: Component,
|
|
600
|
-
args: [{ selector: 'bonc-form-controls', template: "<div [class.edit]=\"editable.inEditMode\" class=\"content\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n<div [class.hidden]=\"!editable.inEditMode\" class=\"controls\">\r\n <a *ngIf=\"!editable.isDirty\" (click)=\"editable.cancel()\" class=\"close\">close</a>\r\n <ng-container *ngIf=\"editable.isDirty\">\r\n <a (click)=\"editable.cancel()\">reset</a>\r\n <a (click)=\"editable.requestSave()\" class=\"apply\">apply</a>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:flex;background-color:#222;color:silver}.content{flex:1;padding:10px}.content.edit{background-color:#111}.controls{display:flex;flex-direction:column;width:100px;background-color:#111}.controls.hidden{opacity:0;pointer-events:none}.controls a{display:block}.controls a.apply{flex:1}\n"] }]
|
|
601
|
-
}], propDecorators: { editable: [{
|
|
602
|
-
type: Input,
|
|
603
|
-
args: [{ required: true }]
|
|
604
|
-
}] } });
|
|
605
|
-
|
|
606
1052
|
const imageMimeTypes = ['image/png', 'image/jpeg'];
|
|
607
1053
|
const videoMimeTypes = ['video/mp4'];
|
|
608
1054
|
const imageFileTypes = imageMimeTypes.join(',');
|
|
@@ -730,13 +1176,13 @@ class MediaUploaderComponent {
|
|
|
730
1176
|
};
|
|
731
1177
|
return func;
|
|
732
1178
|
}
|
|
733
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: MediaUploaderComponent, deps: [{ token: i1$1.DomSanitizer }, { token:
|
|
734
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: MediaUploaderComponent, selector: "bonc-media-uploader", inputs: { uploadUrlMap: "uploadUrlMap", forceRatio: "forceRatio", src: "src", uploadType: "uploadType" }, outputs: { srcChange: "srcChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<bon-media [src]=\"src\" [objectFit]=\"MediaObjectFit.Cover\"></bon-media>\r\n\r\n<div *ngIf=\"src?.sources?.length===0\">
|
|
1179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: MediaUploaderComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1180
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: MediaUploaderComponent, selector: "bonc-media-uploader", inputs: { uploadUrlMap: "uploadUrlMap", forceRatio: "forceRatio", src: "src", uploadType: "uploadType" }, outputs: { srcChange: "srcChange" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<bon-media [src]=\"src\" [objectFit]=\"MediaObjectFit.Cover\"></bon-media>\r\n\r\n<div *ngIf=\"src?.sources?.length===0\">Upload media</div>\r\n\r\n<div (click)=\"selectFile($event)\" class=\"media-container\">\r\n <input #fileInput [accept]=\"fileTypeMask\" (change)=\"onFileSelect(fileInput)\" name=\"media\" type=\"file\" />\r\n <span *ngIf=\"isUploading\"\r\n [style.clip-path]=\"clipStyle\"\r\n [style.-webkit-clip-path]=\"clipStyle\"\r\n class=\"loader\"></span>\r\n\r\n <span *ngIf=\"isUploading\" class=\"loader-text\">\r\n <span *ngIf=\"progress < 1\">{{100 * progress | number: '1.0-0'}}%</span>\r\n <span *ngIf=\"progress >= 1\">converting</span>\r\n </span>\r\n</div>\r\n", styles: [":host{display:block;background-color:#000;position:relative}.media-container{display:block;position:absolute;inset:0;cursor:pointer}.media-container:hover:hover:after{display:flex;justify-content:center;align-items:center;content:\"\";position:absolute;color:silver;inset:0;font-weight:700;font-size:50pt;pointer-events:none;background-color:#ccff00b3}.media-container img,.media-container video{display:block;position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}input[type=file]{display:none}.loader{position:absolute;inset:0;background-color:#cf0}.loader-text{background-color:#000;position:absolute;top:50%;left:0;right:0;text-align:center;font-size:20pt;margin-top:-10pt;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MarcyMediaComponent, selector: "bon-media", inputs: ["src", "objectFit"], outputs: ["isLoaded"] }, { kind: "pipe", type: i2$1.DecimalPipe, name: "number" }] }); }
|
|
735
1181
|
}
|
|
736
1182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: MediaUploaderComponent, decorators: [{
|
|
737
1183
|
type: Component,
|
|
738
|
-
args: [{ selector: 'bonc-media-uploader', template: "<bon-media [src]=\"src\" [objectFit]=\"MediaObjectFit.Cover\"></bon-media>\r\n\r\n<div *ngIf=\"src?.sources?.length===0\">
|
|
739
|
-
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type:
|
|
1184
|
+
args: [{ selector: 'bonc-media-uploader', template: "<bon-media [src]=\"src\" [objectFit]=\"MediaObjectFit.Cover\"></bon-media>\r\n\r\n<div *ngIf=\"src?.sources?.length===0\">Upload media</div>\r\n\r\n<div (click)=\"selectFile($event)\" class=\"media-container\">\r\n <input #fileInput [accept]=\"fileTypeMask\" (change)=\"onFileSelect(fileInput)\" name=\"media\" type=\"file\" />\r\n <span *ngIf=\"isUploading\"\r\n [style.clip-path]=\"clipStyle\"\r\n [style.-webkit-clip-path]=\"clipStyle\"\r\n class=\"loader\"></span>\r\n\r\n <span *ngIf=\"isUploading\" class=\"loader-text\">\r\n <span *ngIf=\"progress < 1\">{{100 * progress | number: '1.0-0'}}%</span>\r\n <span *ngIf=\"progress >= 1\">converting</span>\r\n </span>\r\n</div>\r\n", styles: [":host{display:block;background-color:#000;position:relative}.media-container{display:block;position:absolute;inset:0;cursor:pointer}.media-container:hover:hover:after{display:flex;justify-content:center;align-items:center;content:\"\";position:absolute;color:silver;inset:0;font-weight:700;font-size:50pt;pointer-events:none;background-color:#ccff00b3}.media-container img,.media-container video{display:block;position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}input[type=file]{display:none}.loader{position:absolute;inset:0;background-color:#cf0}.loader-text{background-color:#000;position:absolute;top:50%;left:0;right:0;text-align:center;font-size:20pt;margin-top:-10pt;color:#fff}\n"] }]
|
|
1185
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }, { type: i1$2.HttpClient }], propDecorators: { fileInput: [{
|
|
740
1186
|
type: ViewChild,
|
|
741
1187
|
args: ['fileInput', { static: true }]
|
|
742
1188
|
}], srcChange: [{
|
|
@@ -752,114 +1198,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
752
1198
|
type: Input
|
|
753
1199
|
}] } });
|
|
754
1200
|
|
|
755
|
-
var TextInputStyle;
|
|
756
|
-
(function (TextInputStyle) {
|
|
757
|
-
TextInputStyle[TextInputStyle["NotSet"] = 0] = "NotSet";
|
|
758
|
-
TextInputStyle[TextInputStyle["SingleLine"] = 1] = "SingleLine";
|
|
759
|
-
TextInputStyle[TextInputStyle["MultiLine"] = 2] = "MultiLine";
|
|
760
|
-
})(TextInputStyle || (TextInputStyle = {}));
|
|
761
|
-
|
|
762
|
-
class TextFormComponent extends FormBaseComponent {
|
|
763
|
-
constructor() {
|
|
764
|
-
super(...arguments);
|
|
765
|
-
this.TextInputStyle = TextInputStyle;
|
|
766
|
-
this.label = '';
|
|
767
|
-
this.type = TextInputStyle.SingleLine;
|
|
768
|
-
}
|
|
769
|
-
ngOnInit() {
|
|
770
|
-
this.editable.externalSaveCall.subscribe(() => {
|
|
771
|
-
this.editable.save();
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
775
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TextFormComponent, selector: "bonc-text-form", inputs: { locale: "locale", label: "label", type: "type" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <input *ngIf=\"editable && type === TextInputStyle.SingleLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\" />\r\n\r\n <textarea *ngIf=\"editable && type === TextInputStyle.MultiLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\">\r\n </textarea>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}input,textarea{display:block;width:100%;padding:6px;color:silver;border:1px solid silver;background-color:transparent;box-sizing:border-box;font-size:inherit}input:hover,textarea:hover{border-color:transparent;background-color:#333;cursor:pointer}input:focus,textarea:focus{outline:none;color:#fff;border-color:transparent;background-color:#555}\n"], dependencies: [{ kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
776
|
-
}
|
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextFormComponent, decorators: [{
|
|
778
|
-
type: Component,
|
|
779
|
-
args: [{ selector: 'bonc-text-form', inputs: FormBaseComponent.inputs, hostDirectives: [EditableDirective], template: "<bonc-form-controls [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <input *ngIf=\"editable && type === TextInputStyle.SingleLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\" />\r\n\r\n <textarea *ngIf=\"editable && type === TextInputStyle.MultiLine\"\r\n [(ngModel)]=\"editable.value\"\r\n (click)=\"editable.startEditing()\"\r\n (keyup)=\"editable.updateDirty()\"\r\n (blur)=\"editable.updateDirty()\">\r\n </textarea>\r\n</bonc-form-controls>\r\n", styles: [":host{display:block}input,textarea{display:block;width:100%;padding:6px;color:silver;border:1px solid silver;background-color:transparent;box-sizing:border-box;font-size:inherit}input:hover,textarea:hover{border-color:transparent;background-color:#333;cursor:pointer}input:focus,textarea:focus{outline:none;color:#fff;border-color:transparent;background-color:#555}\n"] }]
|
|
780
|
-
}], propDecorators: { label: [{
|
|
781
|
-
type: Input
|
|
782
|
-
}], type: [{
|
|
783
|
-
type: Input
|
|
784
|
-
}] } });
|
|
785
|
-
|
|
786
|
-
class SeoFormComponent extends FormBaseComponent {
|
|
787
|
-
constructor() {
|
|
788
|
-
super(...arguments);
|
|
789
|
-
this._pageId = '';
|
|
790
|
-
this.ogImageUploadUrl = '';
|
|
791
|
-
this.label = '';
|
|
792
|
-
}
|
|
793
|
-
ngOnInit() {
|
|
794
|
-
this.editable.externalSaveCall.subscribe(() => {
|
|
795
|
-
this.editable.save();
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
set pageId(value) {
|
|
799
|
-
this._pageId = value;
|
|
800
|
-
this.ogImageUploadUrl = `/api/admin/page/Og-Image?pageId=${this.pageId}`; // todo: replace with link to single image api
|
|
801
|
-
}
|
|
802
|
-
get pageId() {
|
|
803
|
-
return this._pageId;
|
|
804
|
-
}
|
|
805
|
-
ResToSrc(res) {
|
|
806
|
-
return res.url;
|
|
807
|
-
}
|
|
808
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SeoFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
809
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SeoFormComponent, selector: "bonc-seo-form", inputs: { label: "label", pageId: "pageId" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <h2 *ngIf=\"label\">{{label}}</h2>\r\n\r\n <div class=\"form-group\">\r\n <label>Title</label>\r\n <bonc-translation-input [text]=\"editable.value.title\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Description</label>\r\n <bonc-translation-textarea [text]=\"editable.value.description\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Share image | 1200x630px</label>\r\n <!-- <simple-file-uploader *ngIf=\"locale === 'en'\"\r\n [(src)]=\"editable.value.ogImage.en\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader>\r\n\r\n <simple-file-uploader *ngIf=\"locale === 'ru'\"\r\n [(src)]=\"editable.value.ogImage.ru\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader> -->\r\n\r\n </div>\r\n\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"!editable.value\">Editable Value canot be null or undefined</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TranslationInputComponent, selector: "bonc-translation-input", inputs: ["text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: ["minRows", "maxRows", "text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
810
|
-
}
|
|
811
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SeoFormComponent, decorators: [{
|
|
812
|
-
type: Component,
|
|
813
|
-
args: [{ selector: 'bonc-seo-form', hostDirectives: [EditableDirective], template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <h2 *ngIf=\"label\">{{label}}</h2>\r\n\r\n <div class=\"form-group\">\r\n <label>Title</label>\r\n <bonc-translation-input [text]=\"editable.value.title\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Description</label>\r\n <bonc-translation-textarea [text]=\"editable.value.description\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <label>Share image | 1200x630px</label>\r\n <!-- <simple-file-uploader *ngIf=\"locale === 'en'\"\r\n [(src)]=\"editable.value.ogImage.en\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader>\r\n\r\n <simple-file-uploader *ngIf=\"locale === 'ru'\"\r\n [(src)]=\"editable.value.ogImage.ru\"\r\n [forceUploadUrl]=\"ogImageUploadUrl\"\r\n [uploadType]=\"MediaType.Image\"\r\n [needDelete]=\"true\"\r\n (deleteFile)=\"deleteOgImage()\"\r\n [ratio]=\"1200/630\"\r\n [resToSrc]=\"ResToSrc\"\r\n (srcChange)=\"editable.startEditing(); editable.patchSave('ogImage',editable.value.ogImage)\">\r\n </simple-file-uploader> -->\r\n\r\n </div>\r\n\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"!editable.value\">Editable Value canot be null or undefined</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
814
|
-
}], propDecorators: { label: [{
|
|
815
|
-
type: Input
|
|
816
|
-
}], pageId: [{
|
|
817
|
-
type: Input
|
|
818
|
-
}] } });
|
|
819
|
-
|
|
820
|
-
class UnknownFormComponent extends FormBaseComponent {
|
|
821
|
-
constructor() {
|
|
822
|
-
super(...arguments);
|
|
823
|
-
this.label = '';
|
|
824
|
-
}
|
|
825
|
-
ngOnInit() {
|
|
826
|
-
this.editable.externalSaveCall.subscribe(() => {
|
|
827
|
-
this.editable.save();
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
831
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: UnknownFormComponent, selector: "bonc-unknown-form", inputs: { locale: "locale", label: "label" }, usesInheritance: true, ngImport: i0, template: "<label>Unknown form:<b>{{label}}</b></label>\r\n<pre><ng-content></ng-content></pre>\r\n", styles: [":host{display:block;color:#000;padding:20px;background-color:#dc143c;margin-bottom:10px}\n"] }); }
|
|
832
|
-
}
|
|
833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownFormComponent, decorators: [{
|
|
834
|
-
type: Component,
|
|
835
|
-
args: [{ selector: 'bonc-unknown-form', inputs: FormBaseComponent.inputs, template: "<label>Unknown form:<b>{{label}}</b></label>\r\n<pre><ng-content></ng-content></pre>\r\n", styles: [":host{display:block;color:#000;padding:20px;background-color:#dc143c;margin-bottom:10px}\n"] }]
|
|
836
|
-
}], propDecorators: { label: [{
|
|
837
|
-
type: Input
|
|
838
|
-
}] } });
|
|
839
|
-
|
|
840
|
-
class TranslationFormComponent extends FormBaseComponent {
|
|
841
|
-
constructor() {
|
|
842
|
-
super(...arguments);
|
|
843
|
-
this.TextEditorField = TextEditorField;
|
|
844
|
-
}
|
|
845
|
-
ngOnInit() {
|
|
846
|
-
this.editable.externalSaveCall.subscribe(() => {
|
|
847
|
-
this.editable.save();
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
851
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TranslationFormComponent, selector: "bonc-translation-form", inputs: { locale: "locale", field: "field", label: "label" }, usesInheritance: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n [text]=\"editable.value\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n\r\n\r\n <bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n [text]=\"editable.value\"\r\n [minRows]=\"2\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"editable.value===undefined\">Editable value canot be undefined</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TranslationInputComponent, selector: "bonc-translation-input", inputs: ["text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: TranslationTextareaComponent, selector: "bonc-translation-textarea", inputs: ["minRows", "maxRows", "text", "locale", "device"], outputs: ["startEditing", "changed", "blurred"] }, { kind: "component", type: FormControlsComponent, selector: "bonc-form-controls", inputs: ["editable"] }] }); }
|
|
852
|
-
}
|
|
853
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TranslationFormComponent, decorators: [{
|
|
854
|
-
type: Component,
|
|
855
|
-
args: [{ selector: 'bonc-translation-form', inputs: FormBaseComponent.inputs, hostDirectives: [EditableDirective], template: "<bonc-form-controls *ngIf=\"editable.value\" [editable]=\"editable\">\r\n <label *ngIf=\"label\">{{label}}</label>\r\n\r\n <bonc-translation-input *ngIf=\"field === TextEditorField.Input\"\r\n [text]=\"editable.value\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-input>\r\n\r\n\r\n <bonc-translation-textarea *ngIf=\"field === TextEditorField.Textarea\"\r\n [text]=\"editable.value\"\r\n [minRows]=\"2\"\r\n [locale]=\"locale\"\r\n (startEditing)=\"editable.startEditing()\"\r\n (changed)=\"editable.updateDirty()\"\r\n (blurred)=\"editable.updateDirty()\">\r\n </bonc-translation-textarea>\r\n</bonc-form-controls>\r\n\r\n<div *ngIf=\"editable.value===undefined\">Editable value canot be undefined</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
856
|
-
}], propDecorators: { field: [{
|
|
857
|
-
type: Input,
|
|
858
|
-
args: [{ required: true }]
|
|
859
|
-
}], label: [{
|
|
860
|
-
type: Input
|
|
861
|
-
}] } });
|
|
862
|
-
|
|
863
1201
|
class SkeletonEditorAnchorDirective {
|
|
864
1202
|
constructor(viewContainerRef) {
|
|
865
1203
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -1021,7 +1359,7 @@ class UnknownBoneEditorComponent extends BoneEditorBaseComponent {
|
|
|
1021
1359
|
return [];
|
|
1022
1360
|
}
|
|
1023
1361
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownBoneEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1024
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: UnknownBoneEditorComponent, selector: "bonc-unknown-bone-editor", usesInheritance: true, ngImport: i0, template: "<p>Unknown Bone Editor | bone type: {{bone.type}}</p>\r\n<pre>{{bone | json}}</pre>\r\n", styles: [":host{display:block;background-color:#dc143c}\n"], dependencies: [{ kind: "pipe", type: i2$
|
|
1362
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: UnknownBoneEditorComponent, selector: "bonc-unknown-bone-editor", usesInheritance: true, ngImport: i0, template: "<p>Unknown Bone Editor | bone type: {{bone.type}}</p>\r\n<pre>{{bone | json}}</pre>\r\n", styles: [":host{display:block;background-color:#dc143c}\n"], dependencies: [{ kind: "pipe", type: i2$1.JsonPipe, name: "json" }] }); }
|
|
1025
1363
|
}
|
|
1026
1364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UnknownBoneEditorComponent, decorators: [{
|
|
1027
1365
|
type: Component,
|
|
@@ -1113,7 +1451,7 @@ class BoneEditorContainerComponent {
|
|
|
1113
1451
|
// return true;
|
|
1114
1452
|
}
|
|
1115
1453
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BoneEditorContainerComponent, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1116
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: BoneEditorContainerComponent, selector: "bonc-bone-editor-container", inputs: { locale: "locale", device: "device", map: "map", bone: "bone" }, outputs: { removed: "removed", saved: "saved", editing: "editing" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: SkeletonEditorAnchorDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"editor\" class=\"left bar\" [class.inactive]=\"editor.noPresets\">\r\n <!-- <a *ngFor=\"let control of editor.controls\" (click)=\"control.activate()\">{{control.label}}</a> -->\r\n <!-- <a (click)=\"setDisabled(!disabled)\" class=\"disabled\">block {{disabled ? 'disabled' : 'enabled'}} ({{editor.bone.visibility}})</a> -->\r\n <a *ngIf=\"editor.currentPreset && !editor.noPresets\" (click)=\"nextPreset()\" class=\"preset\">style:<br />{{editor.currentPreset.title}}</a>\r\n</div>\r\n\r\n<div class=\"editor-container\"\r\n [class.disabled]=\"disabled\"\r\n [style.width]=\"\r\n device === DeviceType.Desktop ? '75vw'\r\n : device === DeviceType.Tablet ? '55vw'\r\n : device === DeviceType.Mobile ? '35vw'\r\n : '75vw' \">\r\n <ng-template boncSkeletonEditorAnchor>\r\n </ng-template>\r\n</div>\r\n\r\n<div *ngIf=\"editor\" [class.active]=\"editor.isEditing || editor.isDirty\" class=\"right bar\">\r\n <!-- <a *ngIf=\"!editor.isEditing\" (click)=\"editor.remove()\" class=\"delete\">!!! remove</a> -->\r\n <a *ngIf=\"editor.isDirty\" (click)=\"editor.resetData()\" class=\"reset\">reset</a>\r\n <a *ngIf=\"editor.isEditing && !editor.isDirty\" (click)=\"editor.finishEditing()\" class=\"close\">close</a>\r\n <a *ngIf=\"editor.isDirty\" (click)=\"editor.save()\" class=\"save\">apply</a>\r\n</div>\r\n", styles: [":host{display:flex}.editor-container{background-color:var(--bg-color)}.editor-container.disabled{opacity:.1;pointer-events:none}.editor-container.mobile{width:350px}.preset{white-space:pre-line}.bar{width:120px;display:flex;flex-direction:column;pointer-events:all}.bar.left:hover,.bar.active{background-color:#111}.bar.hidden{opacity:.2}.bar.left{position:relative;border-right:none}.bar.right{border-left:none;text-align:right}.bar.right .delete{display:none}.bar.right .delete:hover{color:#ff355e}.bar.right.active .delete,.bar.right:hover .delete{display:block}.left.bar.inactive a:hover{cursor:initial;color:#444}.popup{position:absolute;top:0;right:-350px;display:flex;flex-direction:column;width:350px;padding:20px;color:#222;background-color:#fff;border:2px solid black;box-sizing:border-box;z-index:3}.popup a{padding:0!important;cursor:pointer!important}.popup a.close{position:absolute;top:10px;right:10px;color:#666}.popup a.close:hover{background-color:#cf0!important}.popup a.reset{align-self:flex-start;margin-top:30px}.popup a.reset:hover{background-color:#cf0!important}.color-group{display:flex}.color-group:first-of-type{margin-top:20px}.color-group label{flex:1}.color-group input{border:1px solid #222;padding:6px;cursor:pointer}.color-group input:hover,.color-group input:focus{outline:none}.color-group+.color-group{margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$
|
|
1454
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: BoneEditorContainerComponent, selector: "bonc-bone-editor-container", inputs: { locale: "locale", device: "device", map: "map", bone: "bone" }, outputs: { removed: "removed", saved: "saved", editing: "editing" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: SkeletonEditorAnchorDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"editor\" class=\"left bar\" [class.inactive]=\"editor.noPresets\">\r\n <!-- <a *ngFor=\"let control of editor.controls\" (click)=\"control.activate()\">{{control.label}}</a> -->\r\n <!-- <a (click)=\"setDisabled(!disabled)\" class=\"disabled\">block {{disabled ? 'disabled' : 'enabled'}} ({{editor.bone.visibility}})</a> -->\r\n <a *ngIf=\"editor.currentPreset && !editor.noPresets\" (click)=\"nextPreset()\" class=\"preset\">style:<br />{{editor.currentPreset.title}}</a>\r\n</div>\r\n\r\n<div class=\"editor-container\"\r\n [class.disabled]=\"disabled\"\r\n [style.width]=\"\r\n device === DeviceType.Desktop ? '75vw'\r\n : device === DeviceType.Tablet ? '55vw'\r\n : device === DeviceType.Mobile ? '35vw'\r\n : '75vw' \">\r\n <ng-template boncSkeletonEditorAnchor>\r\n </ng-template>\r\n</div>\r\n\r\n<div *ngIf=\"editor\" [class.active]=\"editor.isEditing || editor.isDirty\" class=\"right bar\">\r\n <!-- <a *ngIf=\"!editor.isEditing\" (click)=\"editor.remove()\" class=\"delete\">!!! remove</a> -->\r\n <a *ngIf=\"editor.isDirty\" (click)=\"editor.resetData()\" class=\"reset\">reset</a>\r\n <a *ngIf=\"editor.isEditing && !editor.isDirty\" (click)=\"editor.finishEditing()\" class=\"close\">close</a>\r\n <a *ngIf=\"editor.isDirty\" (click)=\"editor.save()\" class=\"save\">apply</a>\r\n</div>\r\n", styles: [":host{display:flex}.editor-container{background-color:var(--bg-color)}.editor-container.disabled{opacity:.1;pointer-events:none}.editor-container.mobile{width:350px}.preset{white-space:pre-line}.bar{width:120px;display:flex;flex-direction:column;pointer-events:all}.bar.left:hover,.bar.active{background-color:#111}.bar.hidden{opacity:.2}.bar.left{position:relative;border-right:none}.bar.right{border-left:none;text-align:right}.bar.right .delete{display:none}.bar.right .delete:hover{color:#ff355e}.bar.right.active .delete,.bar.right:hover .delete{display:block}.left.bar.inactive a:hover{cursor:initial;color:#444}.popup{position:absolute;top:0;right:-350px;display:flex;flex-direction:column;width:350px;padding:20px;color:#222;background-color:#fff;border:2px solid black;box-sizing:border-box;z-index:3}.popup a{padding:0!important;cursor:pointer!important}.popup a.close{position:absolute;top:10px;right:10px;color:#666}.popup a.close:hover{background-color:#cf0!important}.popup a.reset{align-self:flex-start;margin-top:30px}.popup a.reset:hover{background-color:#cf0!important}.color-group{display:flex}.color-group:first-of-type{margin-top:20px}.color-group label{flex:1}.color-group input{border:1px solid #222;padding:6px;cursor:pointer}.color-group input:hover,.color-group input:focus{outline:none}.color-group+.color-group{margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: SkeletonEditorAnchorDirective, selector: "[boncSkeletonEditorAnchor]" }] }); }
|
|
1117
1455
|
}
|
|
1118
1456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BoneEditorContainerComponent, decorators: [{
|
|
1119
1457
|
type: Component,
|
|
@@ -1217,7 +1555,7 @@ class SkeletonEditorComponent {
|
|
|
1217
1555
|
this.bones[index2] = tempBone;
|
|
1218
1556
|
}
|
|
1219
1557
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SkeletonEditorComponent, deps: [{ token: EditableDirective, host: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1220
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SkeletonEditorComponent, selector: "bonc-skeleton-editor", inputs: { locale: "locale", device: "device", map: "map", templates: "templates" }, viewQueries: [{ propertyName: "boneEditorContainerList", predicate: ["boneEditorContainer"], descendants: true }], usesOnChanges: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<ng-template #controls let-index='index'>\r\n <div [class.appearable]=\"index > 0 && index < bones.length\" class=\"controls\">\r\n <div *ngIf=\"index < bones.length\" class=\"up-down\">\r\n <a *ngIf=\"index > 0\" (click)=\"moveDown(index - 1)\" class=\"down\">move down</a>\r\n <a *ngIf=\"index > 0\" (click)=\"moveUp(index)\" class=\"up\">move up</a>\r\n </div>\r\n <a (click)=\"templatesAreShown[index] = true\" class=\"add\">create</a>\r\n <a *ngIf=\"index < bones.length\" (click)=\"removeBone(index)\" class=\"remove\">remove</a>\r\n </div>\r\n\r\n <div *ngIf=\"templatesAreShown[index]\" class=\"templates\">\r\n <a *ngFor=\"let template of templates\" (click)=\"templatesAreShown[index] = false; createBone(index,template);\">{{template.title}}</a>\r\n <a (click)=\"templatesAreShown[index] = false\">Close</a>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- todo: add trackby -->\r\n<ng-container *ngFor=\"let bone of bones; let i = index\">\r\n <ng-container>\r\n <ng-container *ngTemplateOutlet=\"controls; context: {index: i}\"></ng-container>\r\n </ng-container>\r\n\r\n <bonc-bone-editor-container #boneEditorContainer\r\n [map]=\"map\"\r\n [bone]=\"bone\"\r\n [locale]=\"locale\"\r\n [device]=\"device\"\r\n (removed)=\"removeBone(i)\"\r\n (editing)=\"boneEditHandler($event)\"\r\n (saved)=\"boneChangeHandler(i, $event)\">\r\n </bonc-bone-editor-container>\r\n\r\n</ng-container>\r\n\r\n<ng-container *ngTemplateOutlet=\"controls; context: {index: bones.length}\"></ng-container>\r\n", styles: [":host{display:block}.controls{height:62px;display:flex;align-items:center;justify-content:space-between;margin:0 120px}.controls.appearable{background-color:var(--bg-color)}.controls.appearable *{opacity:0}.controls.appearable:hover{background-color:#222}.controls.appearable:hover *{opacity:1}.controls .up-down{width:100px;align-self:stretch;display:flex;flex-direction:column;justify-content:space-between}.controls a{display:flex;align-items:center;justify-content:center;color:#000;background-color:#cf0;-webkit-user-select:none;user-select:none;cursor:pointer}.controls a.add{padding:10px 30px}.controls a.up,.controls a.down,.controls a.remove{padding:4px 8px}.controls a.remove{align-self:flex-end}.controls a:hover{color:#cf0;background-color:#333}.controls a.remove:hover{color:#fff;background-color:#ff355e}.templates{width:220px;height:380px;position:absolute;left:50%;display:flex;flex-direction:column;margin-left:-110px;margin-top:-190px;z-index:10;padding:6px;background-color:#cf0;box-shadow:0 0 78px #000000bf}.templates a{display:flex;flex:1;align-items:center;justify-content:center;background-color:#cf0;text-align:center;cursor:pointer;text-transform:lowercase}.templates a:hover{text-decoration:underline;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$
|
|
1558
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SkeletonEditorComponent, selector: "bonc-skeleton-editor", inputs: { locale: "locale", device: "device", map: "map", templates: "templates" }, viewQueries: [{ propertyName: "boneEditorContainerList", predicate: ["boneEditorContainer"], descendants: true }], usesOnChanges: true, hostDirectives: [{ directive: EditableDirective }], ngImport: i0, template: "<ng-template #controls let-index='index'>\r\n <div [class.appearable]=\"index > 0 && index < bones.length\" class=\"controls\">\r\n <div *ngIf=\"index < bones.length\" class=\"up-down\">\r\n <a *ngIf=\"index > 0\" (click)=\"moveDown(index - 1)\" class=\"down\">move down</a>\r\n <a *ngIf=\"index > 0\" (click)=\"moveUp(index)\" class=\"up\">move up</a>\r\n </div>\r\n <a (click)=\"templatesAreShown[index] = true\" class=\"add\">create</a>\r\n <a *ngIf=\"index < bones.length\" (click)=\"removeBone(index)\" class=\"remove\">remove</a>\r\n </div>\r\n\r\n <div *ngIf=\"templatesAreShown[index]\" class=\"templates\">\r\n <a *ngFor=\"let template of templates\" (click)=\"templatesAreShown[index] = false; createBone(index,template);\">{{template.title}}</a>\r\n <a (click)=\"templatesAreShown[index] = false\">Close</a>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- todo: add trackby -->\r\n<ng-container *ngFor=\"let bone of bones; let i = index\">\r\n <ng-container>\r\n <ng-container *ngTemplateOutlet=\"controls; context: {index: i}\"></ng-container>\r\n </ng-container>\r\n\r\n <bonc-bone-editor-container #boneEditorContainer\r\n [map]=\"map\"\r\n [bone]=\"bone\"\r\n [locale]=\"locale\"\r\n [device]=\"device\"\r\n (removed)=\"removeBone(i)\"\r\n (editing)=\"boneEditHandler($event)\"\r\n (saved)=\"boneChangeHandler(i, $event)\">\r\n </bonc-bone-editor-container>\r\n\r\n</ng-container>\r\n\r\n<ng-container *ngTemplateOutlet=\"controls; context: {index: bones.length}\"></ng-container>\r\n", styles: [":host{display:block}.controls{height:62px;display:flex;align-items:center;justify-content:space-between;margin:0 120px}.controls.appearable{background-color:var(--bg-color)}.controls.appearable *{opacity:0}.controls.appearable:hover{background-color:#222}.controls.appearable:hover *{opacity:1}.controls .up-down{width:100px;align-self:stretch;display:flex;flex-direction:column;justify-content:space-between}.controls a{display:flex;align-items:center;justify-content:center;color:#000;background-color:#cf0;-webkit-user-select:none;user-select:none;cursor:pointer}.controls a.add{padding:10px 30px}.controls a.up,.controls a.down,.controls a.remove{padding:4px 8px}.controls a.remove{align-self:flex-end}.controls a:hover{color:#cf0;background-color:#333}.controls a.remove:hover{color:#fff;background-color:#ff355e}.templates{width:220px;height:380px;position:absolute;left:50%;display:flex;flex-direction:column;margin-left:-110px;margin-top:-190px;z-index:10;padding:6px;background-color:#cf0;box-shadow:0 0 78px #000000bf}.templates a{display:flex;flex:1;align-items:center;justify-content:center;background-color:#cf0;text-align:center;cursor:pointer;text-transform:lowercase}.templates a:hover{text-decoration:underline;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: BoneEditorContainerComponent, selector: "bonc-bone-editor-container", inputs: ["locale", "device", "map", "bone"], outputs: ["removed", "saved", "editing"] }] }); }
|
|
1221
1559
|
}
|
|
1222
1560
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SkeletonEditorComponent, decorators: [{
|
|
1223
1561
|
type: Component,
|
|
@@ -1249,21 +1587,28 @@ function createPreset(params) {
|
|
|
1249
1587
|
};
|
|
1250
1588
|
}
|
|
1251
1589
|
|
|
1590
|
+
const formComponents = [
|
|
1591
|
+
TranslationFormComponent,
|
|
1592
|
+
TextFormComponent,
|
|
1593
|
+
SeoFormComponent,
|
|
1594
|
+
SvgFormComponent,
|
|
1595
|
+
FileFormComponent,
|
|
1596
|
+
LottieFormComponent,
|
|
1597
|
+
UnknownFormComponent
|
|
1598
|
+
];
|
|
1252
1599
|
const components = [
|
|
1600
|
+
...formComponents,
|
|
1253
1601
|
TranslationInputComponent,
|
|
1254
1602
|
TranslationTextareaComponent,
|
|
1255
1603
|
AdminControlsComponent,
|
|
1256
1604
|
EditableGroupComponent,
|
|
1257
1605
|
FormControlsComponent,
|
|
1258
|
-
TranslationFormComponent,
|
|
1259
|
-
TextFormComponent,
|
|
1260
|
-
SeoFormComponent,
|
|
1261
|
-
UnknownFormComponent,
|
|
1262
1606
|
SkeletonEditorComponent,
|
|
1263
1607
|
SkeletonEditorAnchorDirective,
|
|
1264
1608
|
BoneEditorContainerComponent,
|
|
1265
1609
|
UnknownBoneEditorComponent,
|
|
1266
1610
|
MediaUploaderComponent,
|
|
1611
|
+
FileUploaderComponent,
|
|
1267
1612
|
LinkPopupComponent
|
|
1268
1613
|
];
|
|
1269
1614
|
const standaloneDirectives = [
|
|
@@ -1271,43 +1616,55 @@ const standaloneDirectives = [
|
|
|
1271
1616
|
];
|
|
1272
1617
|
class BonnieCmsModule {
|
|
1273
1618
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BonnieCmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1274
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: BonnieCmsModule, declarations: [
|
|
1619
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: BonnieCmsModule, declarations: [TranslationFormComponent,
|
|
1620
|
+
TextFormComponent,
|
|
1621
|
+
SeoFormComponent,
|
|
1622
|
+
SvgFormComponent,
|
|
1623
|
+
FileFormComponent,
|
|
1624
|
+
LottieFormComponent,
|
|
1625
|
+
UnknownFormComponent, TranslationInputComponent,
|
|
1275
1626
|
TranslationTextareaComponent,
|
|
1276
1627
|
AdminControlsComponent,
|
|
1277
1628
|
EditableGroupComponent,
|
|
1278
1629
|
FormControlsComponent,
|
|
1279
|
-
TranslationFormComponent,
|
|
1280
|
-
TextFormComponent,
|
|
1281
|
-
SeoFormComponent,
|
|
1282
|
-
UnknownFormComponent,
|
|
1283
1630
|
SkeletonEditorComponent,
|
|
1284
1631
|
SkeletonEditorAnchorDirective,
|
|
1285
1632
|
BoneEditorContainerComponent,
|
|
1286
1633
|
UnknownBoneEditorComponent,
|
|
1287
1634
|
MediaUploaderComponent,
|
|
1635
|
+
FileUploaderComponent,
|
|
1288
1636
|
LinkPopupComponent], imports: [CommonModule,
|
|
1289
1637
|
FormsModule,
|
|
1290
1638
|
CdkTextareaAutosize,
|
|
1291
|
-
BonnieModule,
|
|
1639
|
+
BonnieModule,
|
|
1640
|
+
LottieComponent, EditableDirective], exports: [CommonModule,
|
|
1292
1641
|
FormsModule,
|
|
1293
|
-
BonnieModule,
|
|
1642
|
+
BonnieModule,
|
|
1643
|
+
LottieFormComponent, TranslationFormComponent,
|
|
1644
|
+
TextFormComponent,
|
|
1645
|
+
SeoFormComponent,
|
|
1646
|
+
SvgFormComponent,
|
|
1647
|
+
FileFormComponent,
|
|
1648
|
+
LottieFormComponent,
|
|
1649
|
+
UnknownFormComponent, TranslationInputComponent,
|
|
1294
1650
|
TranslationTextareaComponent,
|
|
1295
1651
|
AdminControlsComponent,
|
|
1296
1652
|
EditableGroupComponent,
|
|
1297
1653
|
FormControlsComponent,
|
|
1298
|
-
TranslationFormComponent,
|
|
1299
|
-
TextFormComponent,
|
|
1300
|
-
SeoFormComponent,
|
|
1301
|
-
UnknownFormComponent,
|
|
1302
1654
|
SkeletonEditorComponent,
|
|
1303
1655
|
SkeletonEditorAnchorDirective,
|
|
1304
1656
|
BoneEditorContainerComponent,
|
|
1305
1657
|
UnknownBoneEditorComponent,
|
|
1306
1658
|
MediaUploaderComponent,
|
|
1659
|
+
FileUploaderComponent,
|
|
1307
1660
|
LinkPopupComponent, EditableDirective] }); }
|
|
1308
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BonnieCmsModule,
|
|
1661
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BonnieCmsModule, providers: [
|
|
1662
|
+
DataService,
|
|
1663
|
+
AdminDataService
|
|
1664
|
+
], imports: [CommonModule,
|
|
1309
1665
|
FormsModule,
|
|
1310
|
-
BonnieModule,
|
|
1666
|
+
BonnieModule,
|
|
1667
|
+
LottieComponent, CommonModule,
|
|
1311
1668
|
FormsModule,
|
|
1312
1669
|
BonnieModule] }); }
|
|
1313
1670
|
} // todo: move to standalone
|
|
@@ -1317,18 +1674,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1317
1674
|
declarations: [
|
|
1318
1675
|
...components,
|
|
1319
1676
|
],
|
|
1320
|
-
providers: [
|
|
1677
|
+
providers: [
|
|
1678
|
+
DataService,
|
|
1679
|
+
AdminDataService
|
|
1680
|
+
],
|
|
1321
1681
|
imports: [
|
|
1322
1682
|
CommonModule,
|
|
1323
1683
|
FormsModule,
|
|
1324
1684
|
CdkTextareaAutosize,
|
|
1325
1685
|
BonnieModule,
|
|
1686
|
+
LottieComponent,
|
|
1326
1687
|
...standaloneDirectives
|
|
1327
1688
|
],
|
|
1328
1689
|
exports: [
|
|
1329
1690
|
CommonModule,
|
|
1330
1691
|
FormsModule,
|
|
1331
1692
|
BonnieModule,
|
|
1693
|
+
LottieFormComponent,
|
|
1332
1694
|
...components,
|
|
1333
1695
|
...standaloneDirectives
|
|
1334
1696
|
]
|
|
@@ -1339,5 +1701,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1339
1701
|
* Generated bundle index. Do not edit.
|
|
1340
1702
|
*/
|
|
1341
1703
|
|
|
1342
|
-
export { AdminControlsComponent, BoneEditorBaseComponent, BoneEditorContainerComponent, BonnieCmsModule, DeviceType, DeviceVisibility, EditableDirective, EditableGroupComponent, FormBaseComponent, FormControlsComponent, LinkPopupComponent, MediaUploaderComponent, SeoFormComponent, SkeletonEditorAnchorDirective, SkeletonEditorComponent, TextEditorField, TextFormComponent, TextInputStyle, TextSettingType, TranslationFormComponent, TranslationInputComponent, TranslationTextareaComponent, UnknownBoneEditorComponent, UnknownFormComponent, createPreset, hasFlag, isLocalUrlString, regExpIsMobile, setOrRemoveFlag };
|
|
1704
|
+
export { AdminControlsComponent, AdminDataService, BoneEditorBaseComponent, BoneEditorContainerComponent, BonnieCmsModule, DataService, DeviceType, DeviceVisibility, EditableDirective, EditableGroupComponent, FileFormComponent, FileUploaderComponent, FormBaseComponent, FormControlsComponent, LinkPopupComponent, LottieFormComponent, MediaUploaderComponent, SeoFormComponent, SkeletonEditorAnchorDirective, SkeletonEditorComponent, SvgFormComponent, TextEditorField, TextFormComponent, TextInputStyle, TextSettingType, TranslationFormComponent, TranslationInputComponent, TranslationTextareaComponent, UnknownBoneEditorComponent, UnknownFormComponent, createPreset, hasFlag, isLocalUrlString, regExpIsMobile, setOrRemoveFlag };
|
|
1343
1705
|
//# sourceMappingURL=candy-kingdom-bonnie-cms.mjs.map
|