@acrodata/gui 2.7.0 → 2.8.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/button-toggle/button-toggle.d.ts +0 -2
- package/codearea/codearea-dialog.d.ts +1 -5
- package/codearea/codearea.d.ts +1 -5
- package/combobox/combobox.d.ts +1 -2
- package/esm2022/button-toggle/button-toggle.mjs +6 -6
- package/esm2022/codearea/codearea-dialog.mjs +16 -19
- package/esm2022/codearea/codearea.mjs +15 -14
- package/esm2022/combobox/combobox.mjs +6 -6
- package/esm2022/field-group/field-group.mjs +7 -7
- package/esm2022/file-uploader/file-uploader-config.mjs +7 -8
- package/esm2022/file-uploader/file-uploader.mjs +12 -11
- package/esm2022/fill/fill-picker.mjs +11 -10
- package/esm2022/fill/fill.mjs +6 -6
- package/esm2022/gui-form.mjs +9 -8
- package/esm2022/gui-icons.mjs +10 -15
- package/esm2022/gui-utils.mjs +6 -6
- package/esm2022/image-select/image-select.mjs +6 -6
- package/esm2022/input-number/input-number.mjs +6 -6
- package/esm2022/input-text/input-text.mjs +6 -6
- package/esm2022/select/select.mjs +6 -6
- package/esm2022/slider/slider.mjs +6 -6
- package/esm2022/switch/switch.mjs +6 -6
- package/esm2022/textarea/textarea.mjs +6 -6
- package/fesm2022/acrodata-gui.mjs +127 -134
- package/fesm2022/acrodata-gui.mjs.map +1 -1
- package/field-group/field-group.d.ts +1 -2
- package/file-uploader/file-uploader-config.d.ts +0 -1
- package/file-uploader/file-uploader.d.ts +2 -4
- package/fill/fill-picker.d.ts +2 -3
- package/fill/fill.d.ts +1 -2
- package/gui-form.d.ts +1 -2
- package/gui-icons.d.ts +2 -5
- package/gui-utils.d.ts +1 -2
- package/image-select/image-select.d.ts +1 -2
- package/input-number/input-number.d.ts +0 -2
- package/input-text/input-text.d.ts +0 -2
- package/package.json +1 -1
- package/select/select.d.ts +0 -2
- package/slider/slider.d.ts +0 -2
- package/switch/switch.d.ts +0 -2
- package/textarea/textarea.d.ts +0 -2
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, Input, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component,
|
|
2
|
+
import { Pipe, inject, ElementRef, Input, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, ChangeDetectorRef, forwardRef, InjectionToken, Injectable, DestroyRef, ViewChild, KeyValueDiffers, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule, NG_VALUE_ACCESSOR, FormGroup, FormControl, FormArray, ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import { MatHint, MatFormField, MatPrefix, MatSuffix, MatFormFieldModule } from '@angular/material/form-field';
|
|
7
7
|
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
8
|
-
import
|
|
9
|
-
import { MatIcon, MatIconModule } from '@angular/material/icon';
|
|
8
|
+
import { MatIconRegistry, MatIcon, MatIconModule } from '@angular/material/icon';
|
|
10
9
|
import { MatSelect, MatSelectModule } from '@angular/material/select';
|
|
11
10
|
import { MatSlider, MatSliderThumb, MatSliderRangeThumb, MatSliderModule } from '@angular/material/slider';
|
|
12
11
|
import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
@@ -19,19 +18,16 @@ import { MtxColorpickerInput, MtxColorpicker, MtxColorpickerToggle, MtxColorpick
|
|
|
19
18
|
import { MtxSelect, MtxSelectOptionTemplate, MtxSelectLabelTemplate, MtxSelectModule } from '@ng-matero/extensions/select';
|
|
20
19
|
import { Subject, map, Subscription, of, mergeWith } from 'rxjs';
|
|
21
20
|
import { CodeEditor } from '@acrodata/code-editor';
|
|
21
|
+
import { RndDialogDragHandle, RndDialog } from '@acrodata/rnd-dialog';
|
|
22
22
|
import { coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
23
23
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import * as i1$2 from '@angular/cdk/dialog';
|
|
27
|
-
import { DIALOG_DATA } from '@angular/cdk/dialog';
|
|
28
|
-
import * as i2 from '@angular/platform-browser';
|
|
24
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
25
|
+
import { DialogRef, DIALOG_DATA } from '@angular/cdk/dialog';
|
|
29
26
|
import { finalize } from 'rxjs/operators';
|
|
30
|
-
import
|
|
31
|
-
import { HttpResponse } from '@angular/common/http';
|
|
27
|
+
import { HttpClient, HttpResponse } from '@angular/common/http';
|
|
32
28
|
import { GradientPicker } from '@acrodata/gradient-picker';
|
|
33
29
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
34
|
-
import * as
|
|
30
|
+
import * as i2 from 'ngx-color/chrome';
|
|
35
31
|
import { ColorChromeModule } from 'ngx-color/chrome';
|
|
36
32
|
import { MatOption } from '@angular/material/core';
|
|
37
33
|
|
|
@@ -88,15 +84,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
88
84
|
}]
|
|
89
85
|
}] });
|
|
90
86
|
class GuiFlexDirective {
|
|
91
|
-
constructor(
|
|
92
|
-
this.el =
|
|
87
|
+
constructor() {
|
|
88
|
+
this.el = inject(ElementRef);
|
|
93
89
|
this.flex = 100;
|
|
94
90
|
}
|
|
95
91
|
ngOnInit() {
|
|
96
92
|
this.el.nativeElement.style.flex = `1 1 ${this.flex}%`;
|
|
97
93
|
this.el.nativeElement.style.maxWidth = `${this.flex}%`;
|
|
98
94
|
}
|
|
99
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFlexDirective, deps: [
|
|
95
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFlexDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
100
96
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: GuiFlexDirective, isStandalone: true, selector: "[flex]", inputs: { flex: "flex" }, ngImport: i0 }); }
|
|
101
97
|
}
|
|
102
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFlexDirective, decorators: [{
|
|
@@ -105,7 +101,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
105
101
|
selector: '[flex]',
|
|
106
102
|
standalone: true,
|
|
107
103
|
}]
|
|
108
|
-
}],
|
|
104
|
+
}], propDecorators: { flex: [{
|
|
109
105
|
type: Input
|
|
110
106
|
}] } });
|
|
111
107
|
function compareValues(a, b, operator) {
|
|
@@ -220,8 +216,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
220
216
|
}] } });
|
|
221
217
|
|
|
222
218
|
class GuiButtonToggle {
|
|
223
|
-
constructor(
|
|
224
|
-
this.cdr =
|
|
219
|
+
constructor() {
|
|
220
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
225
221
|
this.config = {};
|
|
226
222
|
this.disabled = false;
|
|
227
223
|
this.value = '';
|
|
@@ -245,7 +241,7 @@ class GuiButtonToggle {
|
|
|
245
241
|
onValueChange() {
|
|
246
242
|
this.onChange(this.value);
|
|
247
243
|
}
|
|
248
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiButtonToggle, deps: [
|
|
244
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiButtonToggle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
249
245
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiButtonToggle, isStandalone: true, selector: "gui-button-toggle", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-button-toggle" }, providers: [
|
|
250
246
|
{
|
|
251
247
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -273,40 +269,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
273
269
|
GuiIcon,
|
|
274
270
|
GuiFieldLabel,
|
|
275
271
|
], template: "<mat-button-toggle-group\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [multiple]=\"config.multiple\"\n (change)=\"onValueChange()\"\n hideSingleSelectionIndicator\n hideMultipleSelectionIndicator\n>\n @for (opt of config.options; track $index) {\n <mat-button-toggle\n disableRipple\n [class.gui-icon-toggle]=\"config.useIcon\"\n [flex]=\"opt.col\"\n [value]=\"opt.value\"\n [disabled]=\"opt.disabled\"\n [title]=\"config.useIcon ? opt.label : ''\"\n >\n @if (config.useIcon) {\n <gui-icon [src]=\"opt.src!\" />\n } @else {\n {{ opt.label }}\n }\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n@if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n}\n", styles: [".gui-button-toggle{--mat-standard-button-toggle-shape: .25rem;--mat-standard-button-toggle-height: 1.5rem;--mat-standard-button-toggle-label-text-size: .75rem;--mat-standard-button-toggle-label-text-weight: 400;--mat-standard-button-toggle-label-text-line-height: var(--mat-standard-button-toggle-height)}.gui-button-toggle .mat-button-toggle-group{flex-wrap:wrap;border-width:0}.gui-button-toggle .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-width:0}.gui-button-toggle .mat-button-toggle-appearance-standard{background-color:var(--mdc-filled-text-field-container-color)}.gui-icon-toggle.mat-button-toggle .mat-button-toggle-label-content{padding:0;line-height:normal}.gui-icon-toggle .mat-button-toggle-button{display:flex}.gui-icon-toggle.mat-button-toggle-checked img{opacity:.64}\n"] }]
|
|
276
|
-
}],
|
|
272
|
+
}], propDecorators: { config: [{
|
|
277
273
|
type: Input
|
|
278
274
|
}], disabled: [{
|
|
279
275
|
type: Input
|
|
280
276
|
}] } });
|
|
281
277
|
|
|
282
|
-
class GuiIconButtonWrapper {
|
|
283
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconButtonWrapper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
284
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: GuiIconButtonWrapper, isStandalone: true, selector: "gui-icon-button-wrapper", host: { classAttribute: "gui-icon-button-wrapper" }, ngImport: i0, template: "<ng-content />\n", styles: [".gui-icon-button-wrapper{display:block;line-height:1}.gui-icon-button-wrapper .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 1.5rem;--mdc-icon-button-icon-size: .875rem;--mat-icon-button-touch-target-display: none;padding:0}.gui-icon-button-wrapper .mat-icon{display:inline-flex;justify-content:center;align-items:center;width:1.5rem;height:1.5rem}.gui-icon-button-wrapper .mat-icon svg{width:.875rem;height:.875rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
285
|
-
}
|
|
286
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconButtonWrapper, decorators: [{
|
|
287
|
-
type: Component,
|
|
288
|
-
args: [{ selector: 'gui-icon-button-wrapper', standalone: true, host: {
|
|
289
|
-
class: 'gui-icon-button-wrapper',
|
|
290
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n", styles: [".gui-icon-button-wrapper{display:block;line-height:1}.gui-icon-button-wrapper .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 1.5rem;--mdc-icon-button-icon-size: .875rem;--mat-icon-button-touch-target-display: none;padding:0}.gui-icon-button-wrapper .mat-icon{display:inline-flex;justify-content:center;align-items:center;width:1.5rem;height:1.5rem}.gui-icon-button-wrapper .mat-icon svg{width:.875rem;height:.875rem}\n"] }]
|
|
291
|
-
}] });
|
|
292
|
-
|
|
293
|
-
class GuiCodeareaConfig {
|
|
294
|
-
constructor() {
|
|
295
|
-
this.changes = new Subject();
|
|
296
|
-
this.theme = 'light';
|
|
297
|
-
this.languages = [];
|
|
298
|
-
this.extensions = [];
|
|
299
|
-
}
|
|
300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
301
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, providedIn: 'root' }); }
|
|
302
|
-
}
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, decorators: [{
|
|
304
|
-
type: Injectable,
|
|
305
|
-
args: [{
|
|
306
|
-
providedIn: 'root',
|
|
307
|
-
}]
|
|
308
|
-
}] });
|
|
309
|
-
|
|
310
278
|
const svgIcons = {
|
|
311
279
|
horizontal: `
|
|
312
280
|
<svg viewBox="0 0 24 24">
|
|
@@ -379,10 +347,10 @@ const svgIcons = {
|
|
|
379
347
|
/** Injection token that can be used to provide the default icons. */
|
|
380
348
|
const GUI_ICONS_CONFIG = new InjectionToken('gui-icons-config');
|
|
381
349
|
class GuiIconsRegistry {
|
|
382
|
-
constructor(
|
|
383
|
-
this._iconRegistry =
|
|
384
|
-
this._sanitizer =
|
|
385
|
-
this._defaultIcons =
|
|
350
|
+
constructor() {
|
|
351
|
+
this._iconRegistry = inject(MatIconRegistry);
|
|
352
|
+
this._sanitizer = inject(DomSanitizer);
|
|
353
|
+
this._defaultIcons = inject(GUI_ICONS_CONFIG, { optional: true });
|
|
386
354
|
}
|
|
387
355
|
add(...iconNames) {
|
|
388
356
|
const icons = Object.assign(svgIcons, this._defaultIcons);
|
|
@@ -390,18 +358,41 @@ class GuiIconsRegistry {
|
|
|
390
358
|
this._iconRegistry.addSvgIconLiteral(k, this._sanitizer.bypassSecurityTrustHtml(icons[k]));
|
|
391
359
|
});
|
|
392
360
|
}
|
|
393
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconsRegistry, deps: [
|
|
361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconsRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
394
362
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconsRegistry, providedIn: 'root' }); }
|
|
395
363
|
}
|
|
396
364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconsRegistry, decorators: [{
|
|
397
365
|
type: Injectable,
|
|
398
366
|
args: [{ providedIn: 'root' }]
|
|
399
|
-
}]
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
367
|
+
}] });
|
|
368
|
+
|
|
369
|
+
class GuiIconButtonWrapper {
|
|
370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconButtonWrapper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
371
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: GuiIconButtonWrapper, isStandalone: true, selector: "gui-icon-button-wrapper", host: { classAttribute: "gui-icon-button-wrapper" }, ngImport: i0, template: "<ng-content />\n", styles: [".gui-icon-button-wrapper{display:block;line-height:1}.gui-icon-button-wrapper .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 1.5rem;--mdc-icon-button-icon-size: .875rem;--mat-icon-button-touch-target-display: none;padding:0}.gui-icon-button-wrapper .mat-icon{display:inline-flex;justify-content:center;align-items:center;width:1.5rem;height:1.5rem}.gui-icon-button-wrapper .mat-icon svg{width:.875rem;height:.875rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
372
|
+
}
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiIconButtonWrapper, decorators: [{
|
|
374
|
+
type: Component,
|
|
375
|
+
args: [{ selector: 'gui-icon-button-wrapper', standalone: true, host: {
|
|
376
|
+
class: 'gui-icon-button-wrapper',
|
|
377
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n", styles: [".gui-icon-button-wrapper{display:block;line-height:1}.gui-icon-button-wrapper .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 1.5rem;--mdc-icon-button-icon-size: .875rem;--mat-icon-button-touch-target-display: none;padding:0}.gui-icon-button-wrapper .mat-icon{display:inline-flex;justify-content:center;align-items:center;width:1.5rem;height:1.5rem}.gui-icon-button-wrapper .mat-icon svg{width:.875rem;height:.875rem}\n"] }]
|
|
378
|
+
}] });
|
|
379
|
+
|
|
380
|
+
class GuiCodeareaConfig {
|
|
381
|
+
constructor() {
|
|
382
|
+
this.changes = new Subject();
|
|
383
|
+
this.theme = 'light';
|
|
384
|
+
this.languages = [];
|
|
385
|
+
this.extensions = [];
|
|
386
|
+
}
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
388
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, providedIn: 'root' }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaConfig, decorators: [{
|
|
391
|
+
type: Injectable,
|
|
392
|
+
args: [{
|
|
393
|
+
providedIn: 'root',
|
|
394
|
+
}]
|
|
395
|
+
}] });
|
|
405
396
|
|
|
406
397
|
class GuiCodeareaDialog {
|
|
407
398
|
get languages() {
|
|
@@ -415,15 +406,16 @@ class GuiCodeareaDialog {
|
|
|
415
406
|
? this.codeareaCfg.extensions(this.data)
|
|
416
407
|
: this.codeareaCfg.extensions;
|
|
417
408
|
}
|
|
418
|
-
constructor(
|
|
419
|
-
this.dialogRef =
|
|
420
|
-
this.data =
|
|
421
|
-
this.cdr =
|
|
422
|
-
this.destroyRef =
|
|
423
|
-
this.codeareaCfg =
|
|
409
|
+
constructor() {
|
|
410
|
+
this.dialogRef = inject(DialogRef);
|
|
411
|
+
this.data = inject(DIALOG_DATA);
|
|
412
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
413
|
+
this.destroyRef = inject(DestroyRef);
|
|
414
|
+
this.codeareaCfg = inject(GuiCodeareaConfig);
|
|
424
415
|
this.langDesc = this.codeareaCfg.languages.find(lang => this.data.language && lang.alias.includes(this.data.language.toLowerCase()));
|
|
425
416
|
this.title = `${this.data.title || ''} (${this.langDesc?.name || 'Plain Text'})`;
|
|
426
417
|
this.lineWrapping = false;
|
|
418
|
+
const iconsRegistry = inject(GuiIconsRegistry);
|
|
427
419
|
iconsRegistry.add('wrap');
|
|
428
420
|
this.codeareaCfg.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
429
421
|
this.cdr.markForCheck();
|
|
@@ -438,7 +430,7 @@ class GuiCodeareaDialog {
|
|
|
438
430
|
close() {
|
|
439
431
|
this.dialogRef.close();
|
|
440
432
|
}
|
|
441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaDialog, deps: [
|
|
433
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaDialog, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
442
434
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: GuiCodeareaDialog, isStandalone: true, selector: "gui-codearea-dialog", host: { classAttribute: "gui-codearea-dialog" }, ngImport: i0, template: "<div\n class=\"gui-codearea-dialog-header\"\n [class.dragging]=\"dragHandle.isDragging\"\n rndDialogDragHandle\n #dragHandle=\"rndDialogDragHandle\"\n>\n <span class=\"gui-codearea-dialog-title\" [title]=\"title\">{{ title }}</span>\n\n <span class=\"gui-codearea-dialog-spacer\"></span>\n\n <button mat-stroked-button (click)=\"close()\">Close</button>\n <button mat-flat-button (click)=\"save()\">Save</button>\n</div>\n\n<div class=\"gui-codearea-dialog-content\">\n <code-editor\n [(ngModel)]=\"data.value\"\n [disabled]=\"data.disabled || false\"\n [readonly]=\"data.readonly || false\"\n [language]=\"data.language || ''\"\n [languages]=\"languages\"\n [theme]=\"theme\"\n [extensions]=\"extensions\"\n [lineWrapping]=\"lineWrapping\"\n indentWithTab\n />\n\n <div class=\"gui-codearea-btns\">\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" (click)=\"toggleLineWrapping()\">\n <mat-icon svgIcon=\"wrap\" />\n </button>\n </gui-icon-button-wrapper>\n </div>\n</div>\n", styles: [".gui-codearea-dialog-panel{--rnd-dialog-container-color: var(--mdc-dialog-container-color)}.gui-codearea-dialog{--mdc-outlined-button-label-text-size: .75rem;--mdc-outlined-button-container-height: 1.5rem;--mat-outlined-button-horizontal-padding: .75rem;--mat-outlined-button-touch-target-display: none;--mdc-filled-button-label-text-size: .75rem;--mdc-filled-button-container-height: 1.5rem;--mat-filled-button-horizontal-padding: .75rem;--mat-filled-button-touch-target-display: none;display:flex;flex-direction:column;height:100%;overflow:hidden;border-radius:inherit;font-size:.75rem}.gui-codearea-dialog-header{display:flex;gap:.5rem;align-items:center;padding:.5rem;cursor:grab;border-bottom:1px solid rgba(0,0,0,.24);box-shadow:0 1px #ffffff3d}.gui-codearea-dialog-header.dragging{cursor:grabbing}.gui-codearea-dialog-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gui-codearea-dialog-spacer{flex:1}.gui-codearea-dialog-content{position:relative;flex:1;overflow:auto}.gui-codearea-dialog-content .code-editor{height:100%;overflow:auto;border:1px solid transparent}.gui-codearea-dialog-content:hover .gui-codearea-btns{display:block}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: RndDialogDragHandle, selector: "[rnd-dialog-drag-handle], [rndDialogDragHandle]", exportAs: ["rndDialogDragHandle"] }, { kind: "component", type: CodeEditor, selector: "code-editor", inputs: ["root", "autoFocus", "value", "disabled", "readonly", "theme", "placeholder", "indentWithTab", "indentUnit", "lineWrapping", "highlightWhitespace", "languages", "language", "setup", "extensions"], outputs: ["change", "focus", "blur"] }, { kind: "component", type: GuiIconButtonWrapper, selector: "gui-icon-button-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
443
435
|
}
|
|
444
436
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodeareaDialog, decorators: [{
|
|
@@ -454,10 +446,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
454
446
|
], host: {
|
|
455
447
|
class: 'gui-codearea-dialog',
|
|
456
448
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"gui-codearea-dialog-header\"\n [class.dragging]=\"dragHandle.isDragging\"\n rndDialogDragHandle\n #dragHandle=\"rndDialogDragHandle\"\n>\n <span class=\"gui-codearea-dialog-title\" [title]=\"title\">{{ title }}</span>\n\n <span class=\"gui-codearea-dialog-spacer\"></span>\n\n <button mat-stroked-button (click)=\"close()\">Close</button>\n <button mat-flat-button (click)=\"save()\">Save</button>\n</div>\n\n<div class=\"gui-codearea-dialog-content\">\n <code-editor\n [(ngModel)]=\"data.value\"\n [disabled]=\"data.disabled || false\"\n [readonly]=\"data.readonly || false\"\n [language]=\"data.language || ''\"\n [languages]=\"languages\"\n [theme]=\"theme\"\n [extensions]=\"extensions\"\n [lineWrapping]=\"lineWrapping\"\n indentWithTab\n />\n\n <div class=\"gui-codearea-btns\">\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" (click)=\"toggleLineWrapping()\">\n <mat-icon svgIcon=\"wrap\" />\n </button>\n </gui-icon-button-wrapper>\n </div>\n</div>\n", styles: [".gui-codearea-dialog-panel{--rnd-dialog-container-color: var(--mdc-dialog-container-color)}.gui-codearea-dialog{--mdc-outlined-button-label-text-size: .75rem;--mdc-outlined-button-container-height: 1.5rem;--mat-outlined-button-horizontal-padding: .75rem;--mat-outlined-button-touch-target-display: none;--mdc-filled-button-label-text-size: .75rem;--mdc-filled-button-container-height: 1.5rem;--mat-filled-button-horizontal-padding: .75rem;--mat-filled-button-touch-target-display: none;display:flex;flex-direction:column;height:100%;overflow:hidden;border-radius:inherit;font-size:.75rem}.gui-codearea-dialog-header{display:flex;gap:.5rem;align-items:center;padding:.5rem;cursor:grab;border-bottom:1px solid rgba(0,0,0,.24);box-shadow:0 1px #ffffff3d}.gui-codearea-dialog-header.dragging{cursor:grabbing}.gui-codearea-dialog-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gui-codearea-dialog-spacer{flex:1}.gui-codearea-dialog-content{position:relative;flex:1;overflow:auto}.gui-codearea-dialog-content .code-editor{height:100%;overflow:auto;border:1px solid transparent}.gui-codearea-dialog-content:hover .gui-codearea-btns{display:block}\n"] }]
|
|
457
|
-
}], ctorParameters: () => [
|
|
458
|
-
type: Inject,
|
|
459
|
-
args: [DIALOG_DATA]
|
|
460
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.DestroyRef }, { type: GuiCodeareaConfig }, { type: GuiIconsRegistry }] });
|
|
449
|
+
}], ctorParameters: () => [] });
|
|
461
450
|
|
|
462
451
|
class GuiCodearea {
|
|
463
452
|
get height() {
|
|
@@ -490,11 +479,11 @@ class GuiCodearea {
|
|
|
490
479
|
? this.codeareaCfg.extensions(this.dialogData)
|
|
491
480
|
: this.codeareaCfg.extensions;
|
|
492
481
|
}
|
|
493
|
-
constructor(
|
|
494
|
-
this.rndDialog =
|
|
495
|
-
this.cdr =
|
|
496
|
-
this.destroyRef =
|
|
497
|
-
this.codeareaCfg =
|
|
482
|
+
constructor() {
|
|
483
|
+
this.rndDialog = inject(RndDialog);
|
|
484
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
485
|
+
this.destroyRef = inject(DestroyRef);
|
|
486
|
+
this.codeareaCfg = inject(GuiCodeareaConfig);
|
|
498
487
|
this.config = {};
|
|
499
488
|
this.disabled = false;
|
|
500
489
|
this.setup = 'minimal';
|
|
@@ -504,6 +493,7 @@ class GuiCodearea {
|
|
|
504
493
|
this.oldValue = '';
|
|
505
494
|
this.onChange = () => { };
|
|
506
495
|
this.onTouched = () => { };
|
|
496
|
+
const iconsRegistry = inject(GuiIconsRegistry);
|
|
507
497
|
iconsRegistry.add('expand');
|
|
508
498
|
this.codeareaCfg.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
509
499
|
this.cdr.markForCheck();
|
|
@@ -550,7 +540,7 @@ class GuiCodearea {
|
|
|
550
540
|
}
|
|
551
541
|
});
|
|
552
542
|
}
|
|
553
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodearea, deps: [
|
|
543
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCodearea, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
554
544
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiCodearea, isStandalone: true, selector: "gui-codearea", inputs: { config: "config", disabled: "disabled", setup: "setup", height: "height", language: "language" }, host: { classAttribute: "gui-field gui-codearea" }, providers: [
|
|
555
545
|
{
|
|
556
546
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -578,7 +568,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
578
568
|
GuiFieldLabel,
|
|
579
569
|
GuiIconButtonWrapper,
|
|
580
570
|
], template: "<code-editor\n [style.height]=\"height\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [language]=\"language\"\n [languages]=\"languages\"\n [theme]=\"theme\"\n [setup]=\"setup\"\n [extensions]=\"extensions\"\n (blur)=\"onValueChange()\"\n/>\n\n<div class=\"gui-codearea-btns\">\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" (click)=\"onExpand()\">\n <mat-icon svgIcon=\"expand\" />\n </button>\n </gui-icon-button-wrapper>\n</div>\n\n@if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n}\n", styles: [".gui-codearea{position:relative;overflow:auto;border:1px solid var(--mdc-outlined-text-field-outline-color);border-radius:var(--mdc-outlined-text-field-container-shape)}.gui-codearea .code-editor{width:100%;min-height:1.5rem;overflow:auto;resize:vertical}.gui-codearea:hover .gui-codearea-btns{display:block}.gui-codearea-btns{position:absolute;top:0;right:0;display:none;margin:2px}[dir=rtl] .gui-codearea-btns{left:0;right:auto}.gui-codearea-btns .gui-icon-button-wrapper .mat-mdc-icon-button,.gui-codearea-btns .gui-icon-button-wrapper .mat-icon{width:1.25rem;height:1.25rem}.gui-codearea-btns .mat-mdc-icon-button{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:.25rem}.gui-codearea-btns .mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:inherit}\n"] }]
|
|
581
|
-
}], ctorParameters: () => [
|
|
571
|
+
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
582
572
|
type: Input
|
|
583
573
|
}], disabled: [{
|
|
584
574
|
type: Input
|
|
@@ -591,8 +581,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
591
581
|
}] } });
|
|
592
582
|
|
|
593
583
|
class GuiCombobox {
|
|
594
|
-
constructor(
|
|
595
|
-
this.cdr =
|
|
584
|
+
constructor() {
|
|
585
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
596
586
|
this.config = {};
|
|
597
587
|
this.disabled = false;
|
|
598
588
|
this.appendTo = 'body';
|
|
@@ -625,7 +615,7 @@ class GuiCombobox {
|
|
|
625
615
|
addTagFn(label) {
|
|
626
616
|
return { label, value: label };
|
|
627
617
|
}
|
|
628
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCombobox, deps: [
|
|
618
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiCombobox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
619
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiCombobox, isStandalone: true, selector: "gui-combobox", inputs: { config: "config", disabled: "disabled", appendTo: "appendTo" }, host: { classAttribute: "gui-field gui-combobox" }, providers: [
|
|
630
620
|
{
|
|
631
621
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -654,7 +644,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
654
644
|
MtxSelectOptionTemplate,
|
|
655
645
|
GuiFieldLabel,
|
|
656
646
|
], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <mtx-select\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [appendTo]=\"appendTo\"\n [items]=\"config.options || []\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [multiple]=\"config.multiple || false\"\n [addTag]=\"addTagFn\"\n [closeOnSelect]=\"!config.multiple\"\n [deselectOnClick]=\"true\"\n (change)=\"onValueChange()\"\n >\n <ng-template ng-option-tmp let-item=\"item\">\n <div class=\"ng-option-label\" [style.font-family]=\"config.useFont ? item.value : ''\">\n {{ item.label }}\n </div>\n </ng-template>\n </mtx-select>\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".gui-combobox .ng-select{padding-left:.5rem;padding-right:.5rem;margin-left:-.5rem;margin-right:-.5rem}.gui-combobox .ng-select.ng-select-multiple .ng-value{flex-direction:row-reverse}.gui-combobox .ng-select .ng-value-icon{font-family:math;font-size:10px}.gui-combobox .ng-select .ng-clear-wrapper .ng-clear{font-family:math;font-size:12px}.gui-combobox .ng-select .ng-arrow{vertical-align:-1px}.gui-combobox.ng-dropdown-panel{padding:.5rem 0}.gui-combobox.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{padding:0 .5rem;line-height:var(--mat-option-label-text-line-height)}.gui-combobox.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-tag-label{line-height:1}\n"] }]
|
|
657
|
-
}],
|
|
647
|
+
}], propDecorators: { mtxSelect: [{
|
|
658
648
|
type: ViewChild,
|
|
659
649
|
args: [MtxSelect]
|
|
660
650
|
}], config: [{
|
|
@@ -666,9 +656,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
666
656
|
}] } });
|
|
667
657
|
|
|
668
658
|
class GuiFieldGroup {
|
|
669
|
-
constructor(
|
|
670
|
-
this.differs =
|
|
671
|
-
this.cdr =
|
|
659
|
+
constructor() {
|
|
660
|
+
this.differs = inject(KeyValueDiffers);
|
|
661
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
672
662
|
this.config = {};
|
|
673
663
|
}
|
|
674
664
|
ngOnInit() {
|
|
@@ -680,7 +670,7 @@ class GuiFieldGroup {
|
|
|
680
670
|
this.cdr.markForCheck();
|
|
681
671
|
});
|
|
682
672
|
}
|
|
683
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFieldGroup, deps: [
|
|
673
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFieldGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
684
674
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiFieldGroup, isStandalone: true, selector: "gui-field-group", inputs: { config: "config" }, host: { classAttribute: "gui-field-group" }, ngImport: i0, template: "@if (config.parentType !== 'inline' && config.name) {\n <gui-field-label [config]=\"config\" [index]=\"config.index\" />\n}\n<ng-content />\n", styles: [".gui-field-group{display:flex;padding:.25rem .5rem}.gui-field{--mat-form-field-container-vertical-padding: .25rem;--mat-form-field-container-text-line-height: 1rem;--mat-form-field-container-text-size: .75rem;display:inline-flex;flex:1;flex-wrap:wrap}.gui-field>.mat-mdc-form-field{flex:1;width:0;max-width:100%}.gui-field .mat-mdc-text-field-wrapper,.gui-field .mat-mdc-form-field-hint-wrapper{position:relative;padding:0 .5rem;border-radius:var(--mdc-filled-text-field-container-shape)}[dir=rtl] .gui-field .mat-mdc-text-field-wrapper,[dir=rtl] .gui-field .mat-mdc-form-field-hint-wrapper{padding:0 .5rem}.gui-field .mat-mdc-form-field-infix{min-height:auto}.gui-field .mat-mdc-form-field-hint-spacer,.gui-field .mat-mdc-form-field-bottom-align:before,.gui-field .mdc-line-ripple{display:none}\n"], dependencies: [{ kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
685
675
|
}
|
|
686
676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFieldGroup, decorators: [{
|
|
@@ -688,13 +678,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
688
678
|
args: [{ selector: 'gui-field-group', host: {
|
|
689
679
|
class: 'gui-field-group',
|
|
690
680
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [GuiFieldLabel], template: "@if (config.parentType !== 'inline' && config.name) {\n <gui-field-label [config]=\"config\" [index]=\"config.index\" />\n}\n<ng-content />\n", styles: [".gui-field-group{display:flex;padding:.25rem .5rem}.gui-field{--mat-form-field-container-vertical-padding: .25rem;--mat-form-field-container-text-line-height: 1rem;--mat-form-field-container-text-size: .75rem;display:inline-flex;flex:1;flex-wrap:wrap}.gui-field>.mat-mdc-form-field{flex:1;width:0;max-width:100%}.gui-field .mat-mdc-text-field-wrapper,.gui-field .mat-mdc-form-field-hint-wrapper{position:relative;padding:0 .5rem;border-radius:var(--mdc-filled-text-field-container-shape)}[dir=rtl] .gui-field .mat-mdc-text-field-wrapper,[dir=rtl] .gui-field .mat-mdc-form-field-hint-wrapper{padding:0 .5rem}.gui-field .mat-mdc-form-field-infix{min-height:auto}.gui-field .mat-mdc-form-field-hint-spacer,.gui-field .mat-mdc-form-field-bottom-align:before,.gui-field .mdc-line-ripple{display:none}\n"] }]
|
|
691
|
-
}],
|
|
681
|
+
}], propDecorators: { config: [{
|
|
692
682
|
type: Input
|
|
693
683
|
}] } });
|
|
694
684
|
|
|
695
685
|
class GuiFileUploaderConfig {
|
|
696
|
-
constructor(
|
|
697
|
-
this.http =
|
|
686
|
+
constructor() {
|
|
687
|
+
this.http = inject(HttpClient);
|
|
698
688
|
/**
|
|
699
689
|
* The file upload URL
|
|
700
690
|
*/
|
|
@@ -720,7 +710,7 @@ class GuiFileUploaderConfig {
|
|
|
720
710
|
return null;
|
|
721
711
|
}));
|
|
722
712
|
}
|
|
723
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploaderConfig, deps: [
|
|
713
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploaderConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
724
714
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploaderConfig, providedIn: 'root' }); }
|
|
725
715
|
}
|
|
726
716
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploaderConfig, decorators: [{
|
|
@@ -728,12 +718,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
728
718
|
args: [{
|
|
729
719
|
providedIn: 'root',
|
|
730
720
|
}]
|
|
731
|
-
}]
|
|
721
|
+
}] });
|
|
732
722
|
|
|
733
723
|
class GuiFileUploader {
|
|
734
|
-
constructor(
|
|
735
|
-
this.fileUploaderCfg =
|
|
736
|
-
this.cdr =
|
|
724
|
+
constructor() {
|
|
725
|
+
this.fileUploaderCfg = inject(GuiFileUploaderConfig);
|
|
726
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
737
727
|
this.config = {};
|
|
738
728
|
this.disabled = false;
|
|
739
729
|
this.type = '*';
|
|
@@ -744,6 +734,7 @@ class GuiFileUploader {
|
|
|
744
734
|
this.url = '';
|
|
745
735
|
this.onChange = () => { };
|
|
746
736
|
this.onTouched = () => { };
|
|
737
|
+
const iconsRegistry = inject(GuiIconsRegistry);
|
|
747
738
|
iconsRegistry.add('link', 'clear', 'file', 'upload');
|
|
748
739
|
}
|
|
749
740
|
ngOnChanges(changes) {
|
|
@@ -810,7 +801,7 @@ class GuiFileUploader {
|
|
|
810
801
|
this.onTouched();
|
|
811
802
|
this.fileChange.emit(this.url);
|
|
812
803
|
}
|
|
813
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploader, deps: [
|
|
804
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFileUploader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
814
805
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiFileUploader, isStandalone: true, selector: "gui-file-uploader", inputs: { config: "config", disabled: "disabled", type: "type", name: "name", accept: "accept" }, outputs: { fileChange: "fileChange" }, host: { classAttribute: "gui-field gui-file-uploader" }, providers: [
|
|
815
806
|
{
|
|
816
807
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -841,7 +832,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
841
832
|
GuiFieldLabel,
|
|
842
833
|
GuiIconButtonWrapper,
|
|
843
834
|
], template: "<mat-form-field>\n <gui-icon-button-wrapper matPrefix>\n <mat-icon svgIcon=\"link\" />\n </gui-icon-button-wrapper>\n\n <input\n matInput\n type=\"text\"\n [ngModel]=\"url\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n (change)=\"onUrlChange($event)\"\n (blur)=\"onBlur()\"\n />\n\n @if (url) {\n <gui-icon-button-wrapper matSuffix>\n <button mat-icon-button type=\"button\" color=\"warn\" [disabled]=\"disabled\" (click)=\"onClear()\">\n <mat-icon svgIcon=\"clear\" />\n </button>\n </gui-icon-button-wrapper>\n }\n</mat-form-field>\n\n<figure class=\"gui-file-content\">\n @if (url) {\n @switch (type) {\n @case ('image') {\n <img [src]=\"url\" alt=\"\" />\n }\n @case ('video') {\n <video [src]=\"url\"></video>\n }\n @case ('audio') {\n <audio [src]=\"url\" controls></audio>\n }\n @default {\n <mat-icon svgIcon=\"file\" />\n }\n }\n } @else {\n <div class=\"gui-file-placeholder\">\n <mat-icon svgIcon=\"upload\" />\n </div>\n }\n\n <input\n #fileInput\n type=\"file\"\n [accept]=\"accept\"\n [name]=\"name\"\n [disabled]=\"disabled\"\n (change)=\"onFileChange($event)\"\n />\n</figure>\n\n@if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n}\n", styles: [".gui-file-uploader{display:block;overflow:auto;line-height:1}.gui-file-uploader .mat-mdc-form-field{width:100%}.gui-file-uploader .gui-file-content{position:relative;display:flex;align-items:center;justify-content:center;height:7.5rem;margin:.25rem 0 0;padding:.25rem;background-color:var(--mdc-filled-text-field-container-color);border:1px solid transparent;border-radius:.25rem}.gui-file-uploader .gui-file-content:hover,.gui-file-uploader .gui-file-content:focus-within{border-color:currentColor}.gui-file-uploader .gui-file-content img,.gui-file-uploader .gui-file-content video{width:100%;height:100%;object-fit:contain}.gui-file-uploader .gui-file-content input[type=file]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer}.gui-file-uploader .gui-file-content .mat-icon svg{width:1.5rem;height:1.5rem}\n"] }]
|
|
844
|
-
}], ctorParameters: () => [
|
|
835
|
+
}], ctorParameters: () => [], propDecorators: { fileInput: [{
|
|
845
836
|
type: ViewChild,
|
|
846
837
|
args: ['fileInput']
|
|
847
838
|
}], config: [{
|
|
@@ -859,8 +850,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
859
850
|
}] } });
|
|
860
851
|
|
|
861
852
|
class GuiFillPicker {
|
|
862
|
-
constructor(
|
|
863
|
-
this.cdr =
|
|
853
|
+
constructor() {
|
|
854
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
864
855
|
this.disabled = false;
|
|
865
856
|
this.type = 'all';
|
|
866
857
|
this.types = [
|
|
@@ -877,6 +868,7 @@ class GuiFillPicker {
|
|
|
877
868
|
};
|
|
878
869
|
this.onChange = () => { };
|
|
879
870
|
this.onTouched = () => { };
|
|
871
|
+
const iconsRegistry = inject(GuiIconsRegistry);
|
|
880
872
|
iconsRegistry.add('solid', 'gradient', 'image');
|
|
881
873
|
}
|
|
882
874
|
ngOnChanges(changes) {
|
|
@@ -977,14 +969,14 @@ class GuiFillPicker {
|
|
|
977
969
|
const bgImg = `url("${this.fillValue.image}")`;
|
|
978
970
|
this.onChange(bgImg);
|
|
979
971
|
}
|
|
980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFillPicker, deps: [
|
|
972
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFillPicker, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
981
973
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiFillPicker, isStandalone: true, selector: "gui-fill-picker", inputs: { disabled: "disabled", type: "type" }, host: { classAttribute: "gui-fill-picker" }, providers: [
|
|
982
974
|
{
|
|
983
975
|
provide: NG_VALUE_ACCESSOR,
|
|
984
976
|
useExisting: forwardRef(() => GuiFillPicker),
|
|
985
977
|
multi: true,
|
|
986
978
|
},
|
|
987
|
-
], usesOnChanges: true, ngImport: i0, template: "@if (type === 'all') {\n <div class=\"gui-fill-picker-header\">\n <mat-button-toggle-group\n [(ngModel)]=\"selectedType\"\n hideSingleSelectionIndicator\n (ngModelChange)=\"onTypeChange()\"\n >\n @for (t of types; track $index) {\n <mat-button-toggle [value]=\"t.value\" [title]=\"t.label\">\n <mat-icon [svgIcon]=\"t.value\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n </div>\n}\n\n<div class=\"gui-fill-picker-body\">\n @if (selectedType === 'solid') {\n <color-chrome [color]=\"fillValue.solid\" (onChangeComplete)=\"onColorChange($event)\" />\n } @else if (selectedType === 'gradient') {\n <gradient-picker [(ngModel)]=\"fillValue.gradient\" (ngModelChange)=\"onGradientChange()\" />\n } @else if (selectedType === 'image') {\n <gui-file-uploader\n type=\"image\"\n [(ngModel)]=\"fillValue.image\"\n (ngModelChange)=\"onImageChange()\"\n />\n }\n</div>\n", styles: [".gui-fill-picker{display:block;width:15rem;border-radius:.5rem;background-color:var(--mat-expansion-container-background-color);color:var(--mat-expansion-container-text-color);box-shadow:inset 0 0 1px #ffffffa3,0 2px 4px #00000029,0 8px 16px #0000001f,0 0 1px #0000001f}.gui-fill-picker color-chrome{display:block}.gui-fill-picker color-chrome .chrome-picker{width:auto;background:none;box-shadow:none;border-radius:0;font-family:inherit}.gui-fill-picker color-chrome .saturation{border-radius:.25rem;box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-body{padding:1rem 0 0}.gui-fill-picker color-chrome .chrome-swatch{box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-active{box-shadow:none}.gui-fill-picker color-chrome .alpha-checkboard{background-color:#fff;border-radius:2px}.gui-fill-picker color-chrome .alpha-gradient{border-radius:2px}.gui-fill-picker color-chrome .chrome-wrap{gap:.75rem;align-items:center}.gui-fill-picker color-chrome .chrome-fields{gap:.5rem;margin:0}.gui-fill-picker color-chrome .chrome-field{padding:0}.gui-fill-picker color-chrome .wrap{width:100%;line-height:1}.gui-fill-picker color-chrome .wrap input{background-color:transparent;box-shadow:none!important;color:var(--mdc-outlined-text-field-input-text-color)!important;border:1px solid var(--mdc-outlined-text-field-outline-color)!important}.gui-fill-picker color-chrome .chrome-toggle{display:flex;width:1.5rem;height:1.5rem;padding:.125rem;border-radius:2px}.gui-fill-picker color-chrome .chrome-toggle:hover{background:#0000000a}.gui-fill-picker color-chrome .chrome-icon{margin:0}.gui-fill-picker color-chrome .chrome-toggle-svg{width:1.25rem;height:1.25rem;border:none}.gui-fill-picker color-chrome .chrome-toggle-svg:hover{background:transparent}.gui-fill-picker color-chrome .chrome-toggle-svg path{fill:var(--mdc-icon-button-icon-color)}.gui-fill-picker .gradient-picker{--gp-container-width: auto;--gp-container-vertical-padding: 0;--gp-container-margin: -4px -12px;--gp-container-shape: 0;--gp-container-elevation-shadow: none;--gp-container-background-color: transparent;--gp-container-text-color: var(--mdc-filled-text-field-input-text-color);--gp-input-background-color: var(--mdc-filled-text-field-container-color)}.gui-fill-picker-header{padding:.375rem .375rem 0;line-height:1;--mat-standard-button-toggle-shape: 0;--mat-standard-button-toggle-height: 1}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard{gap:.25rem;border:none}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border:none}.gui-fill-picker-header .mat-button-toggle-appearance-standard{border-radius:.25rem}.gui-fill-picker-header .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0}.gui-fill-picker-body{padding:.75rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ColorChromeModule }, { kind: "component", type:
|
|
979
|
+
], usesOnChanges: true, ngImport: i0, template: "@if (type === 'all') {\n <div class=\"gui-fill-picker-header\">\n <mat-button-toggle-group\n [(ngModel)]=\"selectedType\"\n hideSingleSelectionIndicator\n (ngModelChange)=\"onTypeChange()\"\n >\n @for (t of types; track $index) {\n <mat-button-toggle [value]=\"t.value\" [title]=\"t.label\">\n <mat-icon [svgIcon]=\"t.value\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n </div>\n}\n\n<div class=\"gui-fill-picker-body\">\n @if (selectedType === 'solid') {\n <color-chrome [color]=\"fillValue.solid\" (onChangeComplete)=\"onColorChange($event)\" />\n } @else if (selectedType === 'gradient') {\n <gradient-picker [(ngModel)]=\"fillValue.gradient\" (ngModelChange)=\"onGradientChange()\" />\n } @else if (selectedType === 'image') {\n <gui-file-uploader\n type=\"image\"\n [(ngModel)]=\"fillValue.image\"\n (ngModelChange)=\"onImageChange()\"\n />\n }\n</div>\n", styles: [".gui-fill-picker{display:block;width:15rem;border-radius:.5rem;background-color:var(--mat-expansion-container-background-color);color:var(--mat-expansion-container-text-color);box-shadow:inset 0 0 1px #ffffffa3,0 2px 4px #00000029,0 8px 16px #0000001f,0 0 1px #0000001f}.gui-fill-picker color-chrome{display:block}.gui-fill-picker color-chrome .chrome-picker{width:auto;background:none;box-shadow:none;border-radius:0;font-family:inherit}.gui-fill-picker color-chrome .saturation{border-radius:.25rem;box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-body{padding:1rem 0 0}.gui-fill-picker color-chrome .chrome-swatch{box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-active{box-shadow:none}.gui-fill-picker color-chrome .alpha-checkboard{background-color:#fff;border-radius:2px}.gui-fill-picker color-chrome .alpha-gradient{border-radius:2px}.gui-fill-picker color-chrome .chrome-wrap{gap:.75rem;align-items:center}.gui-fill-picker color-chrome .chrome-fields{gap:.5rem;margin:0}.gui-fill-picker color-chrome .chrome-field{padding:0}.gui-fill-picker color-chrome .wrap{width:100%;line-height:1}.gui-fill-picker color-chrome .wrap input{background-color:transparent;box-shadow:none!important;color:var(--mdc-outlined-text-field-input-text-color)!important;border:1px solid var(--mdc-outlined-text-field-outline-color)!important}.gui-fill-picker color-chrome .chrome-toggle{display:flex;width:1.5rem;height:1.5rem;padding:.125rem;border-radius:2px}.gui-fill-picker color-chrome .chrome-toggle:hover{background:#0000000a}.gui-fill-picker color-chrome .chrome-icon{margin:0}.gui-fill-picker color-chrome .chrome-toggle-svg{width:1.25rem;height:1.25rem;border:none}.gui-fill-picker color-chrome .chrome-toggle-svg:hover{background:transparent}.gui-fill-picker color-chrome .chrome-toggle-svg path{fill:var(--mdc-icon-button-icon-color)}.gui-fill-picker .gradient-picker{--gp-container-width: auto;--gp-container-vertical-padding: 0;--gp-container-margin: -4px -12px;--gp-container-shape: 0;--gp-container-elevation-shadow: none;--gp-container-background-color: transparent;--gp-container-text-color: var(--mdc-filled-text-field-input-text-color);--gp-input-background-color: var(--mdc-filled-text-field-container-color)}.gui-fill-picker-header{padding:.375rem .375rem 0;line-height:1;--mat-standard-button-toggle-shape: 0;--mat-standard-button-toggle-height: 1}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard{gap:.25rem;border:none}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border:none}.gui-fill-picker-header .mat-button-toggle-appearance-standard{border-radius:.25rem}.gui-fill-picker-header .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0}.gui-fill-picker-body{padding:.75rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ColorChromeModule }, { kind: "component", type: i2.ChromeComponent, selector: "color-chrome", inputs: ["disableAlpha"] }, { kind: "component", type: GradientPicker, selector: "gradient-picker", inputs: ["disabled"] }, { kind: "component", type: GuiFileUploader, selector: "gui-file-uploader", inputs: ["config", "disabled", "type", "name", "accept"], outputs: ["fileChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
988
980
|
}
|
|
989
981
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFillPicker, decorators: [{
|
|
990
982
|
type: Component,
|
|
@@ -1005,15 +997,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1005
997
|
GradientPicker,
|
|
1006
998
|
GuiFileUploader,
|
|
1007
999
|
], template: "@if (type === 'all') {\n <div class=\"gui-fill-picker-header\">\n <mat-button-toggle-group\n [(ngModel)]=\"selectedType\"\n hideSingleSelectionIndicator\n (ngModelChange)=\"onTypeChange()\"\n >\n @for (t of types; track $index) {\n <mat-button-toggle [value]=\"t.value\" [title]=\"t.label\">\n <mat-icon [svgIcon]=\"t.value\" />\n </mat-button-toggle>\n }\n </mat-button-toggle-group>\n </div>\n}\n\n<div class=\"gui-fill-picker-body\">\n @if (selectedType === 'solid') {\n <color-chrome [color]=\"fillValue.solid\" (onChangeComplete)=\"onColorChange($event)\" />\n } @else if (selectedType === 'gradient') {\n <gradient-picker [(ngModel)]=\"fillValue.gradient\" (ngModelChange)=\"onGradientChange()\" />\n } @else if (selectedType === 'image') {\n <gui-file-uploader\n type=\"image\"\n [(ngModel)]=\"fillValue.image\"\n (ngModelChange)=\"onImageChange()\"\n />\n }\n</div>\n", styles: [".gui-fill-picker{display:block;width:15rem;border-radius:.5rem;background-color:var(--mat-expansion-container-background-color);color:var(--mat-expansion-container-text-color);box-shadow:inset 0 0 1px #ffffffa3,0 2px 4px #00000029,0 8px 16px #0000001f,0 0 1px #0000001f}.gui-fill-picker color-chrome{display:block}.gui-fill-picker color-chrome .chrome-picker{width:auto;background:none;box-shadow:none;border-radius:0;font-family:inherit}.gui-fill-picker color-chrome .saturation{border-radius:.25rem;box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-body{padding:1rem 0 0}.gui-fill-picker color-chrome .chrome-swatch{box-shadow:0 0 0 1px #ffffff1f,0 0 0 1px #0000001f}.gui-fill-picker color-chrome .chrome-active{box-shadow:none}.gui-fill-picker color-chrome .alpha-checkboard{background-color:#fff;border-radius:2px}.gui-fill-picker color-chrome .alpha-gradient{border-radius:2px}.gui-fill-picker color-chrome .chrome-wrap{gap:.75rem;align-items:center}.gui-fill-picker color-chrome .chrome-fields{gap:.5rem;margin:0}.gui-fill-picker color-chrome .chrome-field{padding:0}.gui-fill-picker color-chrome .wrap{width:100%;line-height:1}.gui-fill-picker color-chrome .wrap input{background-color:transparent;box-shadow:none!important;color:var(--mdc-outlined-text-field-input-text-color)!important;border:1px solid var(--mdc-outlined-text-field-outline-color)!important}.gui-fill-picker color-chrome .chrome-toggle{display:flex;width:1.5rem;height:1.5rem;padding:.125rem;border-radius:2px}.gui-fill-picker color-chrome .chrome-toggle:hover{background:#0000000a}.gui-fill-picker color-chrome .chrome-icon{margin:0}.gui-fill-picker color-chrome .chrome-toggle-svg{width:1.25rem;height:1.25rem;border:none}.gui-fill-picker color-chrome .chrome-toggle-svg:hover{background:transparent}.gui-fill-picker color-chrome .chrome-toggle-svg path{fill:var(--mdc-icon-button-icon-color)}.gui-fill-picker .gradient-picker{--gp-container-width: auto;--gp-container-vertical-padding: 0;--gp-container-margin: -4px -12px;--gp-container-shape: 0;--gp-container-elevation-shadow: none;--gp-container-background-color: transparent;--gp-container-text-color: var(--mdc-filled-text-field-input-text-color);--gp-input-background-color: var(--mdc-filled-text-field-container-color)}.gui-fill-picker-header{padding:.375rem .375rem 0;line-height:1;--mat-standard-button-toggle-shape: 0;--mat-standard-button-toggle-height: 1}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard{gap:.25rem;border:none}.gui-fill-picker-header .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border:none}.gui-fill-picker-header .mat-button-toggle-appearance-standard{border-radius:.25rem}.gui-fill-picker-header .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0}.gui-fill-picker-body{padding:.75rem}\n"] }]
|
|
1008
|
-
}], ctorParameters: () => [
|
|
1000
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
1009
1001
|
type: Input
|
|
1010
1002
|
}], type: [{
|
|
1011
1003
|
type: Input
|
|
1012
1004
|
}] } });
|
|
1013
1005
|
|
|
1014
1006
|
class GuiFill {
|
|
1015
|
-
constructor(
|
|
1016
|
-
this.cdr =
|
|
1007
|
+
constructor() {
|
|
1008
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1017
1009
|
this.config = {};
|
|
1018
1010
|
this.disabled = false;
|
|
1019
1011
|
this.type = 'all';
|
|
@@ -1045,7 +1037,7 @@ class GuiFill {
|
|
|
1045
1037
|
onValueChange() {
|
|
1046
1038
|
this.onChange(this.value);
|
|
1047
1039
|
}
|
|
1048
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFill, deps: [
|
|
1040
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiFill, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1049
1041
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiFill, isStandalone: true, selector: "gui-fill", inputs: { config: "config", disabled: "disabled", type: "type" }, host: { classAttribute: "gui-field gui-fill" }, providers: [
|
|
1050
1042
|
{
|
|
1051
1043
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1078,7 +1070,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1078
1070
|
GuiIconButtonWrapper,
|
|
1079
1071
|
GuiFillPicker,
|
|
1080
1072
|
], template: "<mat-form-field>\n <ng-container matPrefix>\n <span class=\"gui-color-block\">\n <span\n class=\"gui-color-block-bg\"\n [style.background]=\"value + ' center / contain no-repeat'\"\n ></span>\n </span>\n </ng-container>\n\n <input\n matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [mtxColorpicker]=\"cp\"\n (colorChange)=\"onValueChange()\"\n />\n\n <mtx-colorpicker #cp [content]=\"customPickerContent\" />\n <gui-icon-button-wrapper matSuffix>\n <mtx-colorpicker-toggle [for]=\"cp\" />\n </gui-icon-button-wrapper>\n\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n\n<ng-template #customPickerContent>\n <gui-fill-picker [type]=\"type\" [(ngModel)]=\"cp.selected\" (ngModelChange)=\"cp.select($event)\" />\n</ng-template>\n", styles: [".gui-color-block{position:relative;display:inline-block;width:1.5rem;height:1.5rem;background-color:#fff;background-image:conic-gradient(transparent 25%,#ccc 25% 50%,transparent 50% 75%,#ccc 75%);background-size:.5rem .5rem}.gui-color-block-bg{display:inline-block;width:100%;height:100%}.gui-color-block-bg:after{display:inline-block;width:100%;height:100%;box-sizing:border-box;border:1px solid currentColor;border-top-left-radius:var(--mdc-filled-text-field-container-shape);border-bottom-left-radius:var(--mdc-filled-text-field-container-shape);opacity:.24;content:\"\"}[dir=rtl] .gui-color-block-bg:after{border-radius:0;border-top-right-radius:var(--mdc-filled-text-field-container-shape);border-bottom-right-radius:var(--mdc-filled-text-field-container-shape)}.gui-fill .mat-mdc-icon-button{display:inline-flex;justify-content:center;align-items:center}\n"] }]
|
|
1081
|
-
}],
|
|
1073
|
+
}], propDecorators: { config: [{
|
|
1082
1074
|
type: Input
|
|
1083
1075
|
}], disabled: [{
|
|
1084
1076
|
type: Input
|
|
@@ -1087,8 +1079,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1087
1079
|
}] } });
|
|
1088
1080
|
|
|
1089
1081
|
class GuiImageSelect {
|
|
1090
|
-
constructor(
|
|
1091
|
-
this.cdr =
|
|
1082
|
+
constructor() {
|
|
1083
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1092
1084
|
this.config = {};
|
|
1093
1085
|
this.disabled = false;
|
|
1094
1086
|
this.appendTo = 'body';
|
|
@@ -1117,7 +1109,7 @@ class GuiImageSelect {
|
|
|
1117
1109
|
onValueChange() {
|
|
1118
1110
|
this.onChange(this.value);
|
|
1119
1111
|
}
|
|
1120
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiImageSelect, deps: [
|
|
1112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiImageSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1121
1113
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiImageSelect, isStandalone: true, selector: "gui-image-select", inputs: { config: "config", disabled: "disabled", appendTo: "appendTo" }, host: { classAttribute: "gui-field gui-image-select" }, providers: [
|
|
1122
1114
|
{
|
|
1123
1115
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1147,7 +1139,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1147
1139
|
MtxSelectOptionTemplate,
|
|
1148
1140
|
GuiFieldLabel,
|
|
1149
1141
|
], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <mtx-select\n [items]=\"config.options || []\"\n [appendTo]=\"appendTo\"\n bindValue=\"value\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n (change)=\"onValueChange()\"\n >\n <ng-template ng-label-tmp let-opt=\"item\">\n <img [src]=\"opt.src\" [alt]=\"opt.label\" />\n <span>{{ opt.label }}</span>\n </ng-template>\n <ng-template ng-option-tmp let-opt=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n <img [src]=\"opt.src\" [alt]=\"opt.label\" />\n <span>{{ opt.label }}</span>\n </ng-template>\n </mtx-select>\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".gui-image-select.ng-dropdown-panel .ng-dropdown-panel-items .ng-option img,.gui-image-select .ng-select .ng-value img{height:100%;max-width:7.5rem;object-fit:contain;border-radius:.25rem;background-color:var(--mat-option-hover-state-layer-color)}.gui-image-select{--mat-form-field-container-vertical-padding: 0}.gui-image-select .ng-select{padding:0 .5rem;margin:0 -.5rem}.gui-image-select .ng-select .ng-value-container{height:4rem}.gui-image-select .ng-select .ng-value{display:inline-flex;align-items:center;gap:.5rem;height:100%;padding:.5rem 0}.gui-image-select .ng-select .ng-clear-wrapper .ng-clear{font-family:math;font-size:12px}.gui-image-select .ng-select .ng-arrow{vertical-align:-1px}.gui-image-select.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{display:flex;align-items:center;gap:.5rem;height:4rem;padding:.5rem}\n"] }]
|
|
1150
|
-
}],
|
|
1142
|
+
}], propDecorators: { mtxSelect: [{
|
|
1151
1143
|
type: ViewChild,
|
|
1152
1144
|
args: [MtxSelect]
|
|
1153
1145
|
}], config: [{
|
|
@@ -1175,8 +1167,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1175
1167
|
}] } });
|
|
1176
1168
|
|
|
1177
1169
|
class GuiInputNumber {
|
|
1178
|
-
constructor(
|
|
1179
|
-
this.cdr =
|
|
1170
|
+
constructor() {
|
|
1171
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1180
1172
|
this.config = {};
|
|
1181
1173
|
this.disabled = false;
|
|
1182
1174
|
this.onChange = () => { };
|
|
@@ -1199,7 +1191,7 @@ class GuiInputNumber {
|
|
|
1199
1191
|
onValueChange() {
|
|
1200
1192
|
this.onChange(this.value);
|
|
1201
1193
|
}
|
|
1202
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiInputNumber, deps: [
|
|
1194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiInputNumber, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1203
1195
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiInputNumber, isStandalone: true, selector: "gui-input-number", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-input-number" }, providers: [
|
|
1204
1196
|
{
|
|
1205
1197
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1219,15 +1211,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1219
1211
|
multi: true,
|
|
1220
1212
|
},
|
|
1221
1213
|
], standalone: true, imports: [FormsModule, MatFormField, MatPrefix, MatInput, MatSuffix, MatHint, GuiFieldLabel], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onValueChange()\"\n />\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n" }]
|
|
1222
|
-
}],
|
|
1214
|
+
}], propDecorators: { config: [{
|
|
1223
1215
|
type: Input
|
|
1224
1216
|
}], disabled: [{
|
|
1225
1217
|
type: Input
|
|
1226
1218
|
}] } });
|
|
1227
1219
|
|
|
1228
1220
|
class GuiInputText {
|
|
1229
|
-
constructor(
|
|
1230
|
-
this.cdr =
|
|
1221
|
+
constructor() {
|
|
1222
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1231
1223
|
this.config = {};
|
|
1232
1224
|
this.disabled = false;
|
|
1233
1225
|
this.value = '';
|
|
@@ -1251,7 +1243,7 @@ class GuiInputText {
|
|
|
1251
1243
|
onValueChange() {
|
|
1252
1244
|
this.onChange(this.value);
|
|
1253
1245
|
}
|
|
1254
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiInputText, deps: [
|
|
1246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiInputText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1255
1247
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiInputText, isStandalone: true, selector: "gui-input-text", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-input-text" }, providers: [
|
|
1256
1248
|
{
|
|
1257
1249
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1271,15 +1263,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1271
1263
|
multi: true,
|
|
1272
1264
|
},
|
|
1273
1265
|
], standalone: true, imports: [FormsModule, MatFormField, MatPrefix, MatInput, MatSuffix, MatHint, GuiFieldLabel], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <input\n matInput\n type=\"text\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n (change)=\"onValueChange()\"\n />\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n" }]
|
|
1274
|
-
}],
|
|
1266
|
+
}], propDecorators: { config: [{
|
|
1275
1267
|
type: Input
|
|
1276
1268
|
}], disabled: [{
|
|
1277
1269
|
type: Input
|
|
1278
1270
|
}] } });
|
|
1279
1271
|
|
|
1280
1272
|
class GuiSelect {
|
|
1281
|
-
constructor(
|
|
1282
|
-
this.cdr =
|
|
1273
|
+
constructor() {
|
|
1274
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1283
1275
|
this.config = {};
|
|
1284
1276
|
this.disabled = false;
|
|
1285
1277
|
this.value = '';
|
|
@@ -1303,7 +1295,7 @@ class GuiSelect {
|
|
|
1303
1295
|
onValueChange() {
|
|
1304
1296
|
this.onChange(this.value);
|
|
1305
1297
|
}
|
|
1306
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSelect, deps: [
|
|
1298
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1307
1299
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiSelect, isStandalone: true, selector: "gui-select", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-select" }, providers: [
|
|
1308
1300
|
{
|
|
1309
1301
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1332,15 +1324,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1332
1324
|
MatHint,
|
|
1333
1325
|
GuiFieldLabel,
|
|
1334
1326
|
], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <mat-select\n panelClass=\"gui-select\"\n hideSingleSelectionIndicator\n disableRipple\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [multiple]=\"config.multiple || false\"\n (selectionChange)=\"onValueChange()\"\n >\n @for (opt of config.options; track $index) {\n <mat-option [value]=\"opt.value\" [disabled]=\"opt.disabled\">\n <span [style.font-family]=\"config.useFont ? opt.value : ''\">{{ opt.label }}</span>\n </mat-option>\n }\n </mat-select>\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n", styles: [".gui-select{--mat-select-trigger-text-line-height: 1rem;--mat-select-trigger-text-size: .75rem;--mat-option-label-text-size: .75rem}.gui-select .mat-mdc-option{min-height:var(--mat-option-label-text-line-height);padding:0 .5rem}.gui-select .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:.5rem}[dir=rtl] .gui-select .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:.5rem}.gui-select .mat-mdc-select-arrow-wrapper{height:1rem}.gui-select .mat-pseudo-checkbox{width:1rem;height:1rem;border-width:1px}\n"] }]
|
|
1335
|
-
}],
|
|
1327
|
+
}], propDecorators: { config: [{
|
|
1336
1328
|
type: Input
|
|
1337
1329
|
}], disabled: [{
|
|
1338
1330
|
type: Input
|
|
1339
1331
|
}] } });
|
|
1340
1332
|
|
|
1341
1333
|
class GuiSlider {
|
|
1342
|
-
constructor(
|
|
1343
|
-
this.cdr =
|
|
1334
|
+
constructor() {
|
|
1335
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1344
1336
|
this.config = {};
|
|
1345
1337
|
this.disabled = false;
|
|
1346
1338
|
this.onChange = () => { };
|
|
@@ -1378,7 +1370,7 @@ class GuiSlider {
|
|
|
1378
1370
|
this.maxValue = this.value[1];
|
|
1379
1371
|
}
|
|
1380
1372
|
}
|
|
1381
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSlider, deps: [
|
|
1373
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSlider, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1382
1374
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiSlider, isStandalone: true, selector: "gui-slider", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-slider" }, providers: [
|
|
1383
1375
|
{
|
|
1384
1376
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1409,15 +1401,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1409
1401
|
MatHint,
|
|
1410
1402
|
GuiFieldLabel,
|
|
1411
1403
|
], template: "@if (config.mode !== 'range') {\n <!-- normal slider -->\n <mat-slider [disabled]=\"disabled\" [step]=\"config.step\" [min]=\"config.min\" [max]=\"config.max\">\n <input matSliderThumb [(ngModel)]=\"value\" (valueChange)=\"onValueChange()\" />\n </mat-slider>\n <mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onValueChange()\"\n />\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n </mat-form-field>\n} @else {\n <!-- range slider -->\n <mat-slider [disabled]=\"disabled\" [step]=\"config.step\" [min]=\"config.min\" [max]=\"config.max\">\n <input matSliderStartThumb [(ngModel)]=\"minValue\" (valueChange)=\"onRangeInputChange()\" />\n <input matSliderEndThumb [(ngModel)]=\"maxValue\" (valueChange)=\"onRangeInputChange()\" />\n </mat-slider>\n <mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"minValue\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\"\n />\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n </mat-form-field>\n <mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <input\n matInput\n type=\"number\"\n [(ngModel)]=\"maxValue\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\"\n />\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n </mat-form-field>\n}\n\n@if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n}\n", styles: [".gui-slider .mat-mdc-slider{--mdc-slider-handle-width: .75rem;--mdc-slider-handle-height: .75rem;--mdc-slider-inactive-track-height: .125rem;--mdc-slider-active-track-height: .125rem;flex:3;min-width:auto;height:calc(var(--mdc-slider-handle-width) * 2);margin:0 calc(var(--mdc-slider-handle-width) / 2)}.gui-slider .mat-mdc-slider+.mat-mdc-form-field{flex:2}.gui-slider .mat-mdc-slider.mdc-slider--range+.mat-mdc-form-field,.gui-slider .mat-mdc-slider.mdc-slider--range+.mat-mdc-form-field+.mat-mdc-form-field{flex:1.5}.gui-slider .mat-mdc-slider .mdc-slider__input{top:0;height:calc(var(--mdc-slider-handle-width) * 2)}.gui-slider .mat-mdc-slider .mdc-slider__thumb{left:calc(var(--mdc-slider-handle-width) * -1);width:calc(var(--mdc-slider-handle-width) * 2);height:calc(var(--mdc-slider-handle-width) * 2);border-radius:50%;overflow:hidden}.gui-slider .mat-mdc-form-field{margin-left:.375rem}[dir=rtl] .gui-slider .mat-mdc-form-field{margin-left:0;margin-right:.375rem}.gui-slider .mat-mdc-form-field input::-webkit-outer-spin-button,.gui-slider .mat-mdc-form-field input::-webkit-inner-spin-button{appearance:none}\n"] }]
|
|
1412
|
-
}],
|
|
1404
|
+
}], propDecorators: { config: [{
|
|
1413
1405
|
type: Input
|
|
1414
1406
|
}], disabled: [{
|
|
1415
1407
|
type: Input
|
|
1416
1408
|
}] } });
|
|
1417
1409
|
|
|
1418
1410
|
class GuiSwitch {
|
|
1419
|
-
constructor(
|
|
1420
|
-
this.cdr =
|
|
1411
|
+
constructor() {
|
|
1412
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1421
1413
|
this.config = {};
|
|
1422
1414
|
this.disabled = false;
|
|
1423
1415
|
this.value = false;
|
|
@@ -1441,7 +1433,7 @@ class GuiSwitch {
|
|
|
1441
1433
|
onValueChange() {
|
|
1442
1434
|
this.onChange(this.value);
|
|
1443
1435
|
}
|
|
1444
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSwitch, deps: [
|
|
1436
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1445
1437
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiSwitch, isStandalone: true, selector: "gui-switch", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-switch" }, providers: [
|
|
1446
1438
|
{
|
|
1447
1439
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1461,15 +1453,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1461
1453
|
multi: true,
|
|
1462
1454
|
},
|
|
1463
1455
|
], standalone: true, imports: [FormsModule, MatSlideToggle, MatHint, GuiFieldLabel], template: "<mat-slide-toggle [(ngModel)]=\"value\" [disabled]=\"disabled\" hideIcon (change)=\"onValueChange()\" />\n@if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n}\n", styles: [".gui-switch .mat-mdc-slide-toggle{--mat-switch-unselected-handle-size: .5rem;--mat-switch-selected-handle-size: .75rem;--mat-switch-pressed-handle-size: .75rem;--mat-switch-selected-handle-horizontal-margin: 0;--mat-switch-selected-pressed-handle-horizontal-margin: 0;--mat-switch-unselected-handle-horizontal-margin: 0 .25rem;--mat-switch-unselected-pressed-handle-horizontal-margin: 0 .125rem;--mat-switch-track-outline-width: 1px;--mdc-switch-track-width: 1.75rem;--mdc-switch-track-height: 1rem;--mdc-switch-track-shape: .5rem;--mdc-switch-handle-width: .875rem;--mdc-switch-state-layer-size: 1.5rem;line-height:var(--mdc-switch-state-layer-size)}\n"] }]
|
|
1464
|
-
}],
|
|
1456
|
+
}], propDecorators: { config: [{
|
|
1465
1457
|
type: Input
|
|
1466
1458
|
}], disabled: [{
|
|
1467
1459
|
type: Input
|
|
1468
1460
|
}] } });
|
|
1469
1461
|
|
|
1470
1462
|
class GuiTextarea {
|
|
1471
|
-
constructor(
|
|
1472
|
-
this.cdr =
|
|
1463
|
+
constructor() {
|
|
1464
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1473
1465
|
this.config = {};
|
|
1474
1466
|
this.disabled = false;
|
|
1475
1467
|
this.value = '';
|
|
@@ -1493,7 +1485,7 @@ class GuiTextarea {
|
|
|
1493
1485
|
onValueChange() {
|
|
1494
1486
|
this.onChange(this.value);
|
|
1495
1487
|
}
|
|
1496
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiTextarea, deps: [
|
|
1488
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1497
1489
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiTextarea, isStandalone: true, selector: "gui-textarea", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-textarea" }, providers: [
|
|
1498
1490
|
{
|
|
1499
1491
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1513,7 +1505,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1513
1505
|
multi: true,
|
|
1514
1506
|
},
|
|
1515
1507
|
], standalone: true, imports: [FormsModule, MatFormField, MatPrefix, MatInput, MatSuffix, MatHint, GuiFieldLabel], template: "<mat-form-field>\n @if (config.prefix) {\n <span matPrefix>{{ config.prefix }}</span>\n }\n <textarea\n matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder || ''\"\n [rows]=\"config.rows\"\n (change)=\"onValueChange()\"\n ></textarea>\n @if (config.suffix) {\n <span matSuffix>{{ config.suffix }}</span>\n }\n @if (config.parentType === 'inline') {\n <mat-hint>\n <gui-field-label [config]=\"config\" />\n </mat-hint>\n }\n</mat-form-field>\n" }]
|
|
1516
|
-
}],
|
|
1508
|
+
}], propDecorators: { config: [{
|
|
1517
1509
|
type: Input
|
|
1518
1510
|
}], disabled: [{
|
|
1519
1511
|
type: Input
|
|
@@ -1521,7 +1513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1521
1513
|
|
|
1522
1514
|
let nextUniqueId = 0;
|
|
1523
1515
|
class GuiForm {
|
|
1524
|
-
constructor(
|
|
1516
|
+
constructor() {
|
|
1525
1517
|
/**
|
|
1526
1518
|
* The form instance which allow to track model value and validation status.
|
|
1527
1519
|
*/
|
|
@@ -1543,6 +1535,7 @@ class GuiForm {
|
|
|
1543
1535
|
this.controlSubscriptions = [];
|
|
1544
1536
|
// Unique id for this form
|
|
1545
1537
|
this.uid = `gui-form-${nextUniqueId++}`;
|
|
1538
|
+
const iconsRegistry = inject(GuiIconsRegistry);
|
|
1546
1539
|
iconsRegistry.add('horizontal', 'vertical', 'copy', 'add', 'delete');
|
|
1547
1540
|
}
|
|
1548
1541
|
ngOnChanges(changes) {
|
|
@@ -1746,7 +1739,7 @@ class GuiForm {
|
|
|
1746
1739
|
e.stopPropagation();
|
|
1747
1740
|
tabs.mode = mode;
|
|
1748
1741
|
}
|
|
1749
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiForm, deps: [
|
|
1742
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiForm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1750
1743
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: GuiForm, isStandalone: true, selector: "gui-form", inputs: { form: "form", config: "config", model: "model" }, outputs: { modelChange: "modelChange" }, host: { properties: { "attr.id": "uid" }, classAttribute: "gui-form" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n @for (item of formFields; track item) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: item, formGroup: form}\" />\n </div>\n }\n</form>\n\n<ng-template #controlType let-item let-parent=\"parent\" let-form=\"formGroup\">\n @if (item.show) {\n <ng-container [formGroup]=\"form\">\n @switch (item.type) {\n @case ('text') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-input-text [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('number') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-input-number [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('select') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-select [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('switch') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-switch [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('slider') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-slider [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('buttonToggle') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-button-toggle [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('fill') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-fill [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('file') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('image') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"image\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('video') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"video\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('audio') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"audio\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('imageSelect') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-image-select [formControlName]=\"item.key\" [config]=\"item\" [appendTo]=\"'#'+uid\" />\n </gui-field-group>\n }\n @case ('combobox') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-combobox [formControlName]=\"item.key\" [config]=\"item\" [appendTo]=\"'#'+uid\" />\n </gui-field-group>\n }\n @case ('textarea') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-textarea [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('codearea') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-codearea [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('hidden') {\n <input type=\"hidden\" [formControlName]=\"item.key\">\n }\n @case ('inline') {\n <gui-inline-group [config]=\"item\" [formGroupName]=\"item.key\">\n @for (child of item.children; track child) {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get(item.key)\n }\" />\n }\n </gui-inline-group>\n }\n @case ('group') {\n <mat-expansion-panel [formGroupName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\" />\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n @for (child of item.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get(item.key)\n }\" />\n </div>\n }\n </ng-template>\n </mat-expansion-panel>\n }\n @case ('tabs') {\n <mat-expansion-panel [formArrayName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\" />\n <!-- Show operation buttons when panel opened -->\n @if (item.expanded) {\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" [color]=\"item.mode!=='list'?'primary':''\"\n (click)=\"changeTabsMode($event, item, 'normal')\">\n <mat-icon svgIcon=\"horizontal\" />\n </button>\n <button mat-icon-button type=\"button\" [color]=\"item.mode==='list'?'primary':''\"\n (click)=\"changeTabsMode($event, item, 'list')\">\n <mat-icon svgIcon=\"vertical\" />\n </button>\n @if (item.template && (item.addable || item.addable===undefined)) {\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, true)\">\n <mat-icon svgIcon=\"copy\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item)\">\n <mat-icon svgIcon=\"add\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"removeTab($event, form.get(item.key), item)\">\n <mat-icon svgIcon=\"delete\" />\n </button>\n }\n </gui-icon-button-wrapper>\n }\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n @if (item.mode!=='list') {\n <!-- Horizontal mode -->\n <mat-tab-group class=\"gui-tabs\" disableRipple\n [mat-stretch-tabs]=\"false\" [(selectedIndex)]=\"item.selectedIndex\">\n @for (tab of item.children; track tab; let i = $index) {\n <mat-tab [disabled]=\"tab.disabled\">\n <ng-template mat-tab-label>\n <div>{{tab.name | ejs:{i} }}</div>\n </ng-template>\n <!-- FormControl & FormArray -->\n @if (!tab.children || tab.children.length===0 || tab.type==='tabs') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: tab, parent: item, formGroup: form.get([item.key])\n }\" />\n }\n <!-- FormGroup -->\n @if (tab.children?.length>0 && tab.type!=='tabs') {\n @for (child of tab.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get([item.key, i])\n }\" />\n </div>\n }\n }\n </mat-tab>\n }\n </mat-tab-group>\n } @else {\n <!-- Vertical mode -->\n <div class=\"gui-list\">\n @for (tab of item.children; track tab; let i = $index) {\n <div class=\"gui-list-item\"\n [class.gui-list-item-active]=\"item.selectedIndex===i\">\n <div class=\"gui-list-item-heading\">\n <button class=\"gui-list-item-title\" type=\"button\"\n (click)=\"item.selectedIndex=i\">{{tab.name | ejs:{i} }}</button>\n @if (item.template && (item.addable || item.addable===undefined)) {\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, true, i)\">\n <mat-icon svgIcon=\"copy\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, false, i)\">\n <mat-icon svgIcon=\"add\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"removeTab($event, form.get(item.key), item, i)\">\n <mat-icon svgIcon=\"delete\" />\n </button>\n </gui-icon-button-wrapper>\n }\n </div>\n <div class=\"gui-list-item-content\">\n <!-- FormControl & FormArray -->\n @if (!tab.children || tab.children.length===0 || tab.type==='tabs') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: tab, parent: item, formGroup: form.get([item.key])\n }\" />\n }\n <!-- FormGroup -->\n @if (tab.children?.length>0 && tab.type!=='tabs') {\n @for (child of tab.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get([item.key, i])\n }\" />\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n }\n </ng-template>\n </mat-expansion-panel>\n }\n @case ('menu') {\n <mat-tab-group class=\"gui-menu\" [formGroupName]=\"item.key\" disableRipple>\n @for (menuChild of item.children; track menuChild) {\n <mat-tab [label]=\"menuChild.name\"\n [disabled]=\"menuChild.disabled\">\n <ng-template matTabContent>\n @if (menuChild.type==='menuItem') {\n <!-- Must wrap with div -->\n @for (controlItem of menuChild.children; track controlItem) {\n <div [formGroupName]=\"menuChild.key\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: controlItem, formGroup: form.get([item.key, menuChild.key])\n }\" />\n </div>\n }\n }\n <!-- Support for unlimited nesting -->\n @if (menuChild.type==='menu') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: menuChild, formGroup: form.get(item.key)\n }\" />\n }\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n }\n }\n </ng-container>\n }\n</ng-template>\n", styles: [".gui-form{--mat-expansion-header-text-size: .75rem;--mat-expansion-header-collapsed-state-height: 2rem;--mat-expansion-header-expanded-state-height: 2rem;--mat-expansion-container-text-size: .75rem;--mat-expansion-container-shape: 0;position:relative;display:block;font-size:.75rem}.gui-form .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none}.gui-form .mat-expansion-panel-body{padding:0}.gui-form .mat-expansion-panel-header{padding:0 .75rem}.gui-form .mat-expansion-panel-header .mat-content{align-items:center;padding-right:.5rem}[dir=rtl] .gui-form .mat-expansion-panel-header .mat-content{padding-right:0;padding-left:.5rem}.gui-form .mat-expansion-panel-header .mat-content gui-field-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gui-form .mat-expansion-indicator svg{width:1.5rem;height:1.5rem;margin:0 -.5rem}.gui-form .mat-expansion-indicator:after{vertical-align:.125rem}.gui-form .mat-mdc-tab-header{--mat-tab-header-label-text-size: .75rem;--mdc-secondary-navigation-tab-container-height: 1.5rem}.gui-form .mat-mdc-tab-header-pagination{min-width:var(--mdc-secondary-navigation-tab-container-height)}.gui-form .mat-mdc-tab{min-width:auto;padding:0 .75rem}.gui-list-item-heading{display:flex;align-items:center;position:relative;padding:0 .75rem;line-height:1.5rem;border-bottom:var(--mat-tab-header-divider-height) solid transparent}.gui-list-item-heading:before{position:absolute;left:0;width:.125rem;height:1rem;background-color:var(--mat-expansion-header-text-color);content:\"\"}[dir=rtl] .gui-list-item-heading:before{left:auto;right:0}.gui-list-item-title{display:flex;flex:1;padding:0;background-color:transparent;border:none;color:inherit;font-size:inherit;font-family:inherit;letter-spacing:inherit;line-height:inherit;cursor:pointer}.gui-list-item-active .gui-list-item-title{font-weight:700}.gui-menu .mat-mdc-tab-header{--mdc-tab-indicator-active-indicator-shape: .25rem;padding:.25rem;background-color:var(--mdc-filled-text-field-container-color)}.gui-menu .mat-mdc-tab-header .mdc-tab__ripple:before{border-radius:var(--mdc-tab-indicator-active-indicator-shape)}.gui-menu .mat-mdc-tab-labels{gap:.25rem}.gui-menu .mdc-tab-indicator .mdc-tab-indicator__content{height:100%;background-color:var(--mdc-tab-indicator-active-indicator-color)}.gui-menu .mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:.24}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: MatExpansionPanelContent, selector: "ng-template[matExpansionPanelContent]" }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "directive", type: MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: GuiFieldGroup, selector: "gui-field-group", inputs: ["config"] }, { kind: "directive", type: GuiFlexDirective, selector: "[flex]", inputs: ["flex"] }, { kind: "component", type: GuiInputText, selector: "gui-input-text", inputs: ["config", "disabled"] }, { kind: "component", type: GuiInputNumber, selector: "gui-input-number", inputs: ["config", "disabled"] }, { kind: "component", type: GuiSelect, selector: "gui-select", inputs: ["config", "disabled"] }, { kind: "component", type: GuiSwitch, selector: "gui-switch", inputs: ["config", "disabled"] }, { kind: "component", type: GuiSlider, selector: "gui-slider", inputs: ["config", "disabled"] }, { kind: "component", type: GuiButtonToggle, selector: "gui-button-toggle", inputs: ["config", "disabled"] }, { kind: "component", type: GuiFill, selector: "gui-fill", inputs: ["config", "disabled", "type"] }, { kind: "component", type: GuiFileUploader, selector: "gui-file-uploader", inputs: ["config", "disabled", "type", "name", "accept"], outputs: ["fileChange"] }, { kind: "component", type: GuiImageSelect, selector: "gui-image-select", inputs: ["config", "disabled", "appendTo"] }, { kind: "component", type: GuiTextarea, selector: "gui-textarea", inputs: ["config", "disabled"] }, { kind: "component", type: GuiInlineGroup, selector: "gui-inline-group", inputs: ["config"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }, { kind: "component", type: GuiIconButtonWrapper, selector: "gui-icon-button-wrapper" }, { kind: "pipe", type: GuiEjsPipe, name: "ejs" }, { kind: "component", type: GuiCombobox, selector: "gui-combobox", inputs: ["config", "disabled", "appendTo"] }, { kind: "component", type: GuiCodearea, selector: "gui-codearea", inputs: ["config", "disabled", "setup", "height", "language"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1751
1744
|
}
|
|
1752
1745
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GuiForm, decorators: [{
|
|
@@ -1785,7 +1778,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1785
1778
|
GuiCombobox,
|
|
1786
1779
|
GuiCodearea,
|
|
1787
1780
|
], template: "<form [formGroup]=\"form\">\n @for (item of formFields; track item) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: item, formGroup: form}\" />\n </div>\n }\n</form>\n\n<ng-template #controlType let-item let-parent=\"parent\" let-form=\"formGroup\">\n @if (item.show) {\n <ng-container [formGroup]=\"form\">\n @switch (item.type) {\n @case ('text') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-input-text [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('number') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-input-number [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('select') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-select [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('switch') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-switch [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('slider') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-slider [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('buttonToggle') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-button-toggle [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('fill') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-fill [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('file') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('image') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"image\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('video') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"video\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('audio') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"audio\" [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('imageSelect') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-image-select [formControlName]=\"item.key\" [config]=\"item\" [appendTo]=\"'#'+uid\" />\n </gui-field-group>\n }\n @case ('combobox') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-combobox [formControlName]=\"item.key\" [config]=\"item\" [appendTo]=\"'#'+uid\" />\n </gui-field-group>\n }\n @case ('textarea') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-textarea [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('codearea') {\n <gui-field-group [config]=\"item\" [flex]=\"item.col\">\n <gui-codearea [formControlName]=\"item.key\" [config]=\"item\" />\n </gui-field-group>\n }\n @case ('hidden') {\n <input type=\"hidden\" [formControlName]=\"item.key\">\n }\n @case ('inline') {\n <gui-inline-group [config]=\"item\" [formGroupName]=\"item.key\">\n @for (child of item.children; track child) {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get(item.key)\n }\" />\n }\n </gui-inline-group>\n }\n @case ('group') {\n <mat-expansion-panel [formGroupName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\" />\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n @for (child of item.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get(item.key)\n }\" />\n </div>\n }\n </ng-template>\n </mat-expansion-panel>\n }\n @case ('tabs') {\n <mat-expansion-panel [formArrayName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\" />\n <!-- Show operation buttons when panel opened -->\n @if (item.expanded) {\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" [color]=\"item.mode!=='list'?'primary':''\"\n (click)=\"changeTabsMode($event, item, 'normal')\">\n <mat-icon svgIcon=\"horizontal\" />\n </button>\n <button mat-icon-button type=\"button\" [color]=\"item.mode==='list'?'primary':''\"\n (click)=\"changeTabsMode($event, item, 'list')\">\n <mat-icon svgIcon=\"vertical\" />\n </button>\n @if (item.template && (item.addable || item.addable===undefined)) {\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, true)\">\n <mat-icon svgIcon=\"copy\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item)\">\n <mat-icon svgIcon=\"add\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"removeTab($event, form.get(item.key), item)\">\n <mat-icon svgIcon=\"delete\" />\n </button>\n }\n </gui-icon-button-wrapper>\n }\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n @if (item.mode!=='list') {\n <!-- Horizontal mode -->\n <mat-tab-group class=\"gui-tabs\" disableRipple\n [mat-stretch-tabs]=\"false\" [(selectedIndex)]=\"item.selectedIndex\">\n @for (tab of item.children; track tab; let i = $index) {\n <mat-tab [disabled]=\"tab.disabled\">\n <ng-template mat-tab-label>\n <div>{{tab.name | ejs:{i} }}</div>\n </ng-template>\n <!-- FormControl & FormArray -->\n @if (!tab.children || tab.children.length===0 || tab.type==='tabs') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: tab, parent: item, formGroup: form.get([item.key])\n }\" />\n }\n <!-- FormGroup -->\n @if (tab.children?.length>0 && tab.type!=='tabs') {\n @for (child of tab.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get([item.key, i])\n }\" />\n </div>\n }\n }\n </mat-tab>\n }\n </mat-tab-group>\n } @else {\n <!-- Vertical mode -->\n <div class=\"gui-list\">\n @for (tab of item.children; track tab; let i = $index) {\n <div class=\"gui-list-item\"\n [class.gui-list-item-active]=\"item.selectedIndex===i\">\n <div class=\"gui-list-item-heading\">\n <button class=\"gui-list-item-title\" type=\"button\"\n (click)=\"item.selectedIndex=i\">{{tab.name | ejs:{i} }}</button>\n @if (item.template && (item.addable || item.addable===undefined)) {\n <gui-icon-button-wrapper>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, true, i)\">\n <mat-icon svgIcon=\"copy\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"addTab($event, form.get(item.key), item, false, i)\">\n <mat-icon svgIcon=\"add\" />\n </button>\n <button mat-icon-button type=\"button\" [disabled]=\"item.disabled\"\n (click)=\"removeTab($event, form.get(item.key), item, i)\">\n <mat-icon svgIcon=\"delete\" />\n </button>\n </gui-icon-button-wrapper>\n }\n </div>\n <div class=\"gui-list-item-content\">\n <!-- FormControl & FormArray -->\n @if (!tab.children || tab.children.length===0 || tab.type==='tabs') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: tab, parent: item, formGroup: form.get([item.key])\n }\" />\n }\n <!-- FormGroup -->\n @if (tab.children?.length>0 && tab.type!=='tabs') {\n @for (child of tab.children; track child) {\n <div>\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: child, parent: item, formGroup: form.get([item.key, i])\n }\" />\n </div>\n }\n }\n </div>\n </div>\n }\n </div>\n }\n </ng-template>\n </mat-expansion-panel>\n }\n @case ('menu') {\n <mat-tab-group class=\"gui-menu\" [formGroupName]=\"item.key\" disableRipple>\n @for (menuChild of item.children; track menuChild) {\n <mat-tab [label]=\"menuChild.name\"\n [disabled]=\"menuChild.disabled\">\n <ng-template matTabContent>\n @if (menuChild.type==='menuItem') {\n <!-- Must wrap with div -->\n @for (controlItem of menuChild.children; track controlItem) {\n <div [formGroupName]=\"menuChild.key\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: controlItem, formGroup: form.get([item.key, menuChild.key])\n }\" />\n </div>\n }\n }\n <!-- Support for unlimited nesting -->\n @if (menuChild.type==='menu') {\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{\n $implicit: menuChild, formGroup: form.get(item.key)\n }\" />\n }\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n }\n }\n </ng-container>\n }\n</ng-template>\n", styles: [".gui-form{--mat-expansion-header-text-size: .75rem;--mat-expansion-header-collapsed-state-height: 2rem;--mat-expansion-header-expanded-state-height: 2rem;--mat-expansion-container-text-size: .75rem;--mat-expansion-container-shape: 0;position:relative;display:block;font-size:.75rem}.gui-form .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none}.gui-form .mat-expansion-panel-body{padding:0}.gui-form .mat-expansion-panel-header{padding:0 .75rem}.gui-form .mat-expansion-panel-header .mat-content{align-items:center;padding-right:.5rem}[dir=rtl] .gui-form .mat-expansion-panel-header .mat-content{padding-right:0;padding-left:.5rem}.gui-form .mat-expansion-panel-header .mat-content gui-field-label{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gui-form .mat-expansion-indicator svg{width:1.5rem;height:1.5rem;margin:0 -.5rem}.gui-form .mat-expansion-indicator:after{vertical-align:.125rem}.gui-form .mat-mdc-tab-header{--mat-tab-header-label-text-size: .75rem;--mdc-secondary-navigation-tab-container-height: 1.5rem}.gui-form .mat-mdc-tab-header-pagination{min-width:var(--mdc-secondary-navigation-tab-container-height)}.gui-form .mat-mdc-tab{min-width:auto;padding:0 .75rem}.gui-list-item-heading{display:flex;align-items:center;position:relative;padding:0 .75rem;line-height:1.5rem;border-bottom:var(--mat-tab-header-divider-height) solid transparent}.gui-list-item-heading:before{position:absolute;left:0;width:.125rem;height:1rem;background-color:var(--mat-expansion-header-text-color);content:\"\"}[dir=rtl] .gui-list-item-heading:before{left:auto;right:0}.gui-list-item-title{display:flex;flex:1;padding:0;background-color:transparent;border:none;color:inherit;font-size:inherit;font-family:inherit;letter-spacing:inherit;line-height:inherit;cursor:pointer}.gui-list-item-active .gui-list-item-title{font-weight:700}.gui-menu .mat-mdc-tab-header{--mdc-tab-indicator-active-indicator-shape: .25rem;padding:.25rem;background-color:var(--mdc-filled-text-field-container-color)}.gui-menu .mat-mdc-tab-header .mdc-tab__ripple:before{border-radius:var(--mdc-tab-indicator-active-indicator-shape)}.gui-menu .mat-mdc-tab-labels{gap:.25rem}.gui-menu .mdc-tab-indicator .mdc-tab-indicator__content{height:100%;background-color:var(--mdc-tab-indicator-active-indicator-color)}.gui-menu .mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:.24}\n"] }]
|
|
1788
|
-
}], ctorParameters: () => [
|
|
1781
|
+
}], ctorParameters: () => [], propDecorators: { form: [{
|
|
1789
1782
|
type: Input
|
|
1790
1783
|
}], config: [{
|
|
1791
1784
|
type: Input
|