tickera-angular-components 0.0.1-dev.78 → 0.0.1-dev.79
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.
|
@@ -4664,25 +4664,29 @@ class FormEditorComponent {
|
|
|
4664
4664
|
onChange = () => { };
|
|
4665
4665
|
onTouched = () => { };
|
|
4666
4666
|
subscription = null;
|
|
4667
|
-
|
|
4667
|
+
isBrowser;
|
|
4668
|
+
constructor(ngControl, transloco, platformId) {
|
|
4668
4669
|
this.ngControl = ngControl;
|
|
4669
4670
|
this.transloco = transloco;
|
|
4671
|
+
this.isBrowser = isPlatformBrowser(platformId);
|
|
4670
4672
|
if (this.ngControl) {
|
|
4671
4673
|
this.ngControl.valueAccessor = this;
|
|
4672
4674
|
}
|
|
4673
4675
|
}
|
|
4674
4676
|
ngOnInit() {
|
|
4675
|
-
this.
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
.
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4677
|
+
if (this.isBrowser) {
|
|
4678
|
+
this.editor = new Editor();
|
|
4679
|
+
if (this.value) {
|
|
4680
|
+
this.editor.setContent(this.value);
|
|
4681
|
+
}
|
|
4682
|
+
this.subscription = this.editor.valueChanges
|
|
4683
|
+
.pipe(distinctUntilChanged())
|
|
4684
|
+
.subscribe((doc) => {
|
|
4685
|
+
this.value = toHTML(doc);
|
|
4686
|
+
this.onChange(this.value);
|
|
4687
|
+
this.onTouched();
|
|
4688
|
+
});
|
|
4689
|
+
}
|
|
4686
4690
|
}
|
|
4687
4691
|
ngOnDestroy() {
|
|
4688
4692
|
this.subscription?.unsubscribe();
|
|
@@ -4739,8 +4743,8 @@ class FormEditorComponent {
|
|
|
4739
4743
|
}
|
|
4740
4744
|
return baseClasses;
|
|
4741
4745
|
}
|
|
4742
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: FormEditorComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i2$1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4743
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: FormEditorComponent, isStandalone: true, selector: "form-editor", inputs: { label: "label", name: "name", id: "id", placeholder: "placeholder", required: "required", readonly: "readonly", toolbar: "toolbar", fieldGroupClass: "fieldGroupClass" }, ngImport: i0, template: "<div [class]=\"fieldGroupClasses\">\n @if (label) {\n <label [for]=\"inputId\" class=\"form-editor-label\">\n {{ label }}\n\n @if (required) {\n <span class=\"form-editor-required\">*</span>\n }\n </label>\n }\n\n <div class=\"form-editor-wrapper\" [class.disabled]=\"disabled\">\n
|
|
4746
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: FormEditorComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i2$1.TranslocoService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
4747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: FormEditorComponent, isStandalone: true, selector: "form-editor", inputs: { label: "label", name: "name", id: "id", placeholder: "placeholder", required: "required", readonly: "readonly", toolbar: "toolbar", fieldGroupClass: "fieldGroupClass" }, host: { attributes: { "ngSkipHydration": "true" } }, ngImport: i0, template: "<div [class]=\"fieldGroupClasses\">\n @if (label) {\n <label [for]=\"inputId\" class=\"form-editor-label\">\n {{ label }}\n\n @if (required) {\n <span class=\"form-editor-required\">*</span>\n }\n </label>\n }\n\n @if (isBrowser) {\n <div class=\"form-editor-wrapper\" [class.disabled]=\"disabled\">\n <ngx-editor [editor]=\"editor\" outputFormat=\"html\" [placeholder]=\"placeholder\">\n <ngx-editor-menu\n [editor]=\"editor\"\n [toolbar]=\"toolbar\"\n [disabled]=\"disabled\"\n ></ngx-editor-menu>\n </ngx-editor>\n </div>\n }\n\n @if (showError) {\n <div class=\"form-editor-error-message\">\n {{ errorMessage }}\n </div>\n }\n</div>\n", styles: [".form-editor-label{color:#374151;display:block;font-size:.875rem;font-weight:600;margin-bottom:.25rem}@media(prefers-color-scheme:dark){.form-editor-label{color:#d1d5db}}.form-editor-wrapper{position:relative}.form-editor-wrapper.disabled{opacity:.5;pointer-events:none;cursor:not-allowed}.form-editor-required{color:#ef4444}.form-editor-error-message{color:#ef4444;font-size:.75rem;margin-top:.25rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: NgxEditorComponent, selector: "ngx-editor", inputs: ["editor", "outputFormat", "placeholder"], outputs: ["focusOut", "focusIn"] }, { kind: "component", type: NgxEditorMenuComponent, selector: "ngx-editor-menu", inputs: ["toolbar", "colorPresets", "disabled", "editor", "customMenuRef", "dropdownPlacement"] }] });
|
|
4744
4748
|
}
|
|
4745
4749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: FormEditorComponent, decorators: [{
|
|
4746
4750
|
type: Component,
|
|
@@ -4750,12 +4754,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4750
4754
|
ReactiveFormsModule,
|
|
4751
4755
|
NgxEditorComponent,
|
|
4752
4756
|
NgxEditorMenuComponent,
|
|
4753
|
-
], template: "<div [class]=\"fieldGroupClasses\">\n @if (label) {\n <label [for]=\"inputId\" class=\"form-editor-label\">\n {{ label }}\n\n @if (required) {\n <span class=\"form-editor-required\">*</span>\n }\n </label>\n }\n\n <div class=\"form-editor-wrapper\" [class.disabled]=\"disabled\">\n
|
|
4757
|
+
], host: { ngSkipHydration: 'true' }, template: "<div [class]=\"fieldGroupClasses\">\n @if (label) {\n <label [for]=\"inputId\" class=\"form-editor-label\">\n {{ label }}\n\n @if (required) {\n <span class=\"form-editor-required\">*</span>\n }\n </label>\n }\n\n @if (isBrowser) {\n <div class=\"form-editor-wrapper\" [class.disabled]=\"disabled\">\n <ngx-editor [editor]=\"editor\" outputFormat=\"html\" [placeholder]=\"placeholder\">\n <ngx-editor-menu\n [editor]=\"editor\"\n [toolbar]=\"toolbar\"\n [disabled]=\"disabled\"\n ></ngx-editor-menu>\n </ngx-editor>\n </div>\n }\n\n @if (showError) {\n <div class=\"form-editor-error-message\">\n {{ errorMessage }}\n </div>\n }\n</div>\n", styles: [".form-editor-label{color:#374151;display:block;font-size:.875rem;font-weight:600;margin-bottom:.25rem}@media(prefers-color-scheme:dark){.form-editor-label{color:#d1d5db}}.form-editor-wrapper{position:relative}.form-editor-wrapper.disabled{opacity:.5;pointer-events:none;cursor:not-allowed}.form-editor-required{color:#ef4444}.form-editor-error-message{color:#ef4444;font-size:.75rem;margin-top:.25rem}\n"] }]
|
|
4754
4758
|
}], ctorParameters: () => [{ type: i1$1.NgControl, decorators: [{
|
|
4755
4759
|
type: Self
|
|
4756
4760
|
}, {
|
|
4757
4761
|
type: Optional
|
|
4758
|
-
}] }, { type: i2$1.TranslocoService }
|
|
4762
|
+
}] }, { type: i2$1.TranslocoService }, { type: undefined, decorators: [{
|
|
4763
|
+
type: Inject,
|
|
4764
|
+
args: [PLATFORM_ID]
|
|
4765
|
+
}] }], propDecorators: { label: [{
|
|
4759
4766
|
type: Input
|
|
4760
4767
|
}], name: [{
|
|
4761
4768
|
type: Input
|