@acrodata/gui 0.1.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/README.md +66 -0
- package/_index.scss +19 -0
- package/button-toggle/button-toggle.d.ts +20 -0
- package/button-toggle/button-toggle.scss +21 -0
- package/button-toggle/icon.d.ts +7 -0
- package/button-toggle/icon.scss +11 -0
- package/esm2022/acrodata-gui.mjs +5 -0
- package/esm2022/button-toggle/button-toggle.mjs +62 -0
- package/esm2022/button-toggle/icon.mjs +28 -0
- package/esm2022/field-group/field-group.mjs +31 -0
- package/esm2022/field-label/field-label.mjs +32 -0
- package/esm2022/file-uploader/file-uploader-config.mjs +35 -0
- package/esm2022/file-uploader/file-uploader.mjs +125 -0
- package/esm2022/fill/fill.mjs +61 -0
- package/esm2022/gui-form.mjs +223 -0
- package/esm2022/gui-icons.mjs +33 -0
- package/esm2022/gui-module.mjs +172 -0
- package/esm2022/gui-utils.mjs +75 -0
- package/esm2022/image-select/image-select.mjs +60 -0
- package/esm2022/inline-group/inline-group.mjs +19 -0
- package/esm2022/input-number/input-number.mjs +59 -0
- package/esm2022/input-text/input-text.mjs +60 -0
- package/esm2022/interface.mjs +2 -0
- package/esm2022/public-api.mjs +23 -0
- package/esm2022/select/select.mjs +61 -0
- package/esm2022/slider/slider.mjs +75 -0
- package/esm2022/switch/switch.mjs +60 -0
- package/esm2022/textarea/textarea.mjs +60 -0
- package/fesm2022/acrodata-gui.mjs +1209 -0
- package/fesm2022/acrodata-gui.mjs.map +1 -0
- package/field-group/field-group.d.ts +14 -0
- package/field-group/field-group.scss +16 -0
- package/field-label/field-label.d.ts +12 -0
- package/field-label/field-label.scss +15 -0
- package/file-uploader/file-uploader-config.d.ts +23 -0
- package/file-uploader/file-uploader.d.ts +37 -0
- package/file-uploader/file-uploader.scss +43 -0
- package/fill/fill.d.ts +20 -0
- package/fill/fill.scss +30 -0
- package/gui-form.d.ts +69 -0
- package/gui-form.scss +110 -0
- package/gui-icons.d.ts +3 -0
- package/gui-module.d.ts +40 -0
- package/gui-utils.d.ts +33 -0
- package/image-select/image-select.d.ts +21 -0
- package/image-select/image-select.scss +48 -0
- package/index.d.ts +5 -0
- package/inline-group/inline-group.d.ts +7 -0
- package/inline-group/inline-group.scss +19 -0
- package/input-number/input-number.d.ts +20 -0
- package/input-number/input-number.scss +5 -0
- package/input-text/input-text.d.ts +20 -0
- package/input-text/input-text.scss +0 -0
- package/interface.d.ts +53 -0
- package/package.json +47 -0
- package/public-api.d.ts +19 -0
- package/select/select.d.ts +20 -0
- package/select/select.scss +18 -0
- package/slider/slider.d.ts +25 -0
- package/slider/slider.scss +49 -0
- package/switch/switch.d.ts +20 -0
- package/switch/switch.scss +8 -0
- package/textarea/textarea.d.ts +19 -0
- package/textarea/textarea.scss +0 -0
|
@@ -0,0 +1,1209 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, Directive, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, forwardRef, Injectable, EventEmitter, ViewChild, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2$1 from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, FormGroup, FormControl, FormArray, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
7
|
+
import * as i3 from '@angular/material/form-field';
|
|
8
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
|
+
import * as i4 from '@angular/material/input';
|
|
10
|
+
import { MatInputModule } from '@angular/material/input';
|
|
11
|
+
import * as i1$2 from '@angular/material/icon';
|
|
12
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
13
|
+
import * as i4$1 from '@angular/material/select';
|
|
14
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
15
|
+
import * as i5$1 from '@angular/material/slider';
|
|
16
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
17
|
+
import * as i4$2 from '@angular/material/slide-toggle';
|
|
18
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
19
|
+
import * as i4$3 from '@angular/material/button-toggle';
|
|
20
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
21
|
+
import * as i7 from '@angular/material/button';
|
|
22
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
23
|
+
import * as i5$3 from '@angular/material/tabs';
|
|
24
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
25
|
+
import * as i6 from '@angular/material/expansion';
|
|
26
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
27
|
+
import * as i2 from '@angular/material/tooltip';
|
|
28
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
29
|
+
import * as i5$2 from '@ng-matero/extensions/colorpicker';
|
|
30
|
+
import { MtxColorpickerModule } from '@ng-matero/extensions/colorpicker';
|
|
31
|
+
import * as i4$4 from '@ng-matero/extensions/select';
|
|
32
|
+
import { MtxSelectModule } from '@ng-matero/extensions/select';
|
|
33
|
+
import { of, Subscription } from 'rxjs';
|
|
34
|
+
import * as i5 from '@angular/material/core';
|
|
35
|
+
import * as i1$1 from '@angular/common/http';
|
|
36
|
+
import { HttpResponse } from '@angular/common/http';
|
|
37
|
+
import { catchError, finalize } from 'rxjs/operators';
|
|
38
|
+
import * as i2$2 from '@angular/platform-browser';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Lightweight EJS template engine
|
|
42
|
+
*
|
|
43
|
+
* @param str template string
|
|
44
|
+
* @param data data passed to the template
|
|
45
|
+
* @returns
|
|
46
|
+
*
|
|
47
|
+
* ### Example
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const people = ['geddy', 'neil', 'alex'];
|
|
51
|
+
* const res = ejsTmpl('<%= people.join(", ") %>', {people: people});
|
|
52
|
+
* console.log(res);
|
|
53
|
+
* // => 'geddy, neil, alex'
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
function ejsTmpl(str, data) {
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
59
|
+
const fn = new Function('obj', 'var p=[],print=function(){p.push.apply(p,arguments);};' +
|
|
60
|
+
// Introduce the data as local variables using with(){}
|
|
61
|
+
'with(obj){p.push("' +
|
|
62
|
+
// Convert the template into pure JavaScript
|
|
63
|
+
str
|
|
64
|
+
.replace(/[\r\t\n]/g, ' ')
|
|
65
|
+
.split('<%')
|
|
66
|
+
.join('\t')
|
|
67
|
+
.replace(/((^|%>)[^\t]*)'/g, '$1\r')
|
|
68
|
+
.replace(/\t=(.*?)%>/g, '",$1,"')
|
|
69
|
+
.split('\t')
|
|
70
|
+
.join('");')
|
|
71
|
+
.split('%>')
|
|
72
|
+
.join('p.push("')
|
|
73
|
+
.split('\r')
|
|
74
|
+
.join('"') +
|
|
75
|
+
'");}return p.join("");');
|
|
76
|
+
// Provide some basic currying to the user
|
|
77
|
+
return data ? fn(data) : fn;
|
|
78
|
+
}
|
|
79
|
+
class GuiEjsPipe {
|
|
80
|
+
transform(value, data = {}) {
|
|
81
|
+
return ejsTmpl(value, data);
|
|
82
|
+
}
|
|
83
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiEjsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
84
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.8", ngImport: i0, type: GuiEjsPipe, name: "ejs" }); }
|
|
85
|
+
}
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiEjsPipe, decorators: [{
|
|
87
|
+
type: Pipe,
|
|
88
|
+
args: [{
|
|
89
|
+
name: 'ejs',
|
|
90
|
+
}]
|
|
91
|
+
}] });
|
|
92
|
+
class GuiFlexDirective {
|
|
93
|
+
constructor(el) {
|
|
94
|
+
this.el = el;
|
|
95
|
+
this.flex = 100;
|
|
96
|
+
}
|
|
97
|
+
ngOnInit() {
|
|
98
|
+
this.el.nativeElement.style.flex = `1 1 ${this.flex}%`;
|
|
99
|
+
this.el.nativeElement.style.maxWidth = `${this.flex}%`;
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFlexDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
102
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.8", type: GuiFlexDirective, selector: "[flex]", inputs: { flex: "flex" }, ngImport: i0 }); }
|
|
103
|
+
}
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFlexDirective, decorators: [{
|
|
105
|
+
type: Directive,
|
|
106
|
+
args: [{
|
|
107
|
+
selector: '[flex]',
|
|
108
|
+
}]
|
|
109
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { flex: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}] } });
|
|
112
|
+
|
|
113
|
+
class GuiFieldLabel {
|
|
114
|
+
constructor() {
|
|
115
|
+
this.config = {};
|
|
116
|
+
this.title = '';
|
|
117
|
+
this.styless = false;
|
|
118
|
+
}
|
|
119
|
+
ngOnChanges() {
|
|
120
|
+
const { index, name, parentType, type } = this.config;
|
|
121
|
+
this.title = index != null && !isNaN(index) ? ejsTmpl(name || '', { i: index }) : name;
|
|
122
|
+
this.styless =
|
|
123
|
+
(parentType === 'inline' && type !== 'inline') || type === 'group' || type === 'tabs';
|
|
124
|
+
}
|
|
125
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFieldLabel, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
126
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiFieldLabel, selector: "gui-field-label", inputs: { config: "config", index: "index" }, host: { properties: { "class.gui-field-label": "!styless", "title": "title" } }, usesOnChanges: true, ngImport: i0, template: "<span *ngIf=\"!config.description\">{{title}}</span>\n<span *ngIf=\"config.description\"\n [class.gui-field-label-with-description]=\"config.description\"\n [matTooltip]=\"config.description\"\n matTooltipPosition=\"above\"\n matTooltipClass=\"gui-field-label-tooltip\">{{title}}</span>\n", styles: [".gui-field-label{display:inline-block;width:64px;height:24px;padding:0 4px;line-height:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gui-field-label-with-description{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFieldLabel, decorators: [{
|
|
129
|
+
type: Component,
|
|
130
|
+
args: [{ selector: 'gui-field-label', host: {
|
|
131
|
+
'[class.gui-field-label]': '!styless',
|
|
132
|
+
'[title]': 'title',
|
|
133
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span *ngIf=\"!config.description\">{{title}}</span>\n<span *ngIf=\"config.description\"\n [class.gui-field-label-with-description]=\"config.description\"\n [matTooltip]=\"config.description\"\n matTooltipPosition=\"above\"\n matTooltipClass=\"gui-field-label-tooltip\">{{title}}</span>\n", styles: [".gui-field-label{display:inline-block;width:64px;height:24px;padding:0 4px;line-height:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gui-field-label-with-description{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help}\n"] }]
|
|
134
|
+
}], propDecorators: { config: [{
|
|
135
|
+
type: Input
|
|
136
|
+
}], index: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}] } });
|
|
139
|
+
|
|
140
|
+
class GuiInputText {
|
|
141
|
+
constructor(cdr) {
|
|
142
|
+
this.cdr = cdr;
|
|
143
|
+
this.config = {};
|
|
144
|
+
this.disabled = false;
|
|
145
|
+
this.value = '';
|
|
146
|
+
this.onChange = () => { };
|
|
147
|
+
this.onTouched = () => { };
|
|
148
|
+
}
|
|
149
|
+
writeValue(value) {
|
|
150
|
+
this.value = value;
|
|
151
|
+
this.cdr.markForCheck();
|
|
152
|
+
}
|
|
153
|
+
registerOnChange(fn) {
|
|
154
|
+
this.onChange = fn;
|
|
155
|
+
}
|
|
156
|
+
registerOnTouched(fn) {
|
|
157
|
+
this.onTouched = fn;
|
|
158
|
+
}
|
|
159
|
+
setDisabledState(isDisabled) {
|
|
160
|
+
this.disabled = isDisabled;
|
|
161
|
+
this.cdr.markForCheck();
|
|
162
|
+
}
|
|
163
|
+
onValueChange() {
|
|
164
|
+
this.onChange(this.value);
|
|
165
|
+
}
|
|
166
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInputText, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
167
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiInputText, selector: "gui-input-text", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-input-text" }, providers: [
|
|
168
|
+
{
|
|
169
|
+
provide: NG_VALUE_ACCESSOR,
|
|
170
|
+
useExisting: forwardRef(() => GuiInputText),
|
|
171
|
+
multi: true,
|
|
172
|
+
},
|
|
173
|
+
], ngImport: i0, template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"text\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n (change)=\"onValueChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
174
|
+
}
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInputText, decorators: [{
|
|
176
|
+
type: Component,
|
|
177
|
+
args: [{ selector: 'gui-input-text', host: {
|
|
178
|
+
class: 'gui-field gui-input-text',
|
|
179
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
180
|
+
{
|
|
181
|
+
provide: NG_VALUE_ACCESSOR,
|
|
182
|
+
useExisting: forwardRef(() => GuiInputText),
|
|
183
|
+
multi: true,
|
|
184
|
+
},
|
|
185
|
+
], template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"text\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n (change)=\"onValueChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n" }]
|
|
186
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
187
|
+
type: Input
|
|
188
|
+
}], disabled: [{
|
|
189
|
+
type: Input
|
|
190
|
+
}] } });
|
|
191
|
+
|
|
192
|
+
class GuiInputNumber {
|
|
193
|
+
constructor(cdr) {
|
|
194
|
+
this.cdr = cdr;
|
|
195
|
+
this.config = {};
|
|
196
|
+
this.disabled = false;
|
|
197
|
+
this.onChange = () => { };
|
|
198
|
+
this.onTouched = () => { };
|
|
199
|
+
}
|
|
200
|
+
writeValue(value) {
|
|
201
|
+
this.value = value;
|
|
202
|
+
this.cdr.markForCheck();
|
|
203
|
+
}
|
|
204
|
+
registerOnChange(fn) {
|
|
205
|
+
this.onChange = fn;
|
|
206
|
+
}
|
|
207
|
+
registerOnTouched(fn) {
|
|
208
|
+
this.onTouched = fn;
|
|
209
|
+
}
|
|
210
|
+
setDisabledState(isDisabled) {
|
|
211
|
+
this.disabled = isDisabled;
|
|
212
|
+
this.cdr.markForCheck();
|
|
213
|
+
}
|
|
214
|
+
onValueChange() {
|
|
215
|
+
this.onChange(this.value);
|
|
216
|
+
}
|
|
217
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInputNumber, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
218
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiInputNumber, selector: "gui-input-number", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-input-number" }, providers: [
|
|
219
|
+
{
|
|
220
|
+
provide: NG_VALUE_ACCESSOR,
|
|
221
|
+
useExisting: forwardRef(() => GuiInputNumber),
|
|
222
|
+
multi: true,
|
|
223
|
+
},
|
|
224
|
+
], ngImport: i0, template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput 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 <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-input-number .mat-mdc-text-field-wrapper{padding-right:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.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: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
225
|
+
}
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInputNumber, decorators: [{
|
|
227
|
+
type: Component,
|
|
228
|
+
args: [{ selector: 'gui-input-number', host: {
|
|
229
|
+
class: 'gui-field gui-input-number',
|
|
230
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
231
|
+
{
|
|
232
|
+
provide: NG_VALUE_ACCESSOR,
|
|
233
|
+
useExisting: forwardRef(() => GuiInputNumber),
|
|
234
|
+
multi: true,
|
|
235
|
+
},
|
|
236
|
+
], template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput 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 <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-input-number .mat-mdc-text-field-wrapper{padding-right:0}\n"] }]
|
|
237
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], disabled: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}] } });
|
|
242
|
+
|
|
243
|
+
class GuiSelect {
|
|
244
|
+
constructor(cdr) {
|
|
245
|
+
this.cdr = cdr;
|
|
246
|
+
this.config = {};
|
|
247
|
+
this.disabled = false;
|
|
248
|
+
this.value = '';
|
|
249
|
+
this.onChange = () => { };
|
|
250
|
+
this.onTouched = () => { };
|
|
251
|
+
}
|
|
252
|
+
writeValue(value) {
|
|
253
|
+
this.value = value;
|
|
254
|
+
this.cdr.markForCheck();
|
|
255
|
+
}
|
|
256
|
+
registerOnChange(fn) {
|
|
257
|
+
this.onChange = fn;
|
|
258
|
+
}
|
|
259
|
+
registerOnTouched(fn) {
|
|
260
|
+
this.onTouched = fn;
|
|
261
|
+
}
|
|
262
|
+
setDisabledState(isDisabled) {
|
|
263
|
+
this.disabled = isDisabled;
|
|
264
|
+
this.cdr.markForCheck();
|
|
265
|
+
}
|
|
266
|
+
onValueChange() {
|
|
267
|
+
this.onChange(this.value);
|
|
268
|
+
}
|
|
269
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSelect, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
270
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiSelect, selector: "gui-select", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-select" }, providers: [
|
|
271
|
+
{
|
|
272
|
+
provide: NG_VALUE_ACCESSOR,
|
|
273
|
+
useExisting: forwardRef(() => GuiSelect),
|
|
274
|
+
multi: true,
|
|
275
|
+
},
|
|
276
|
+
], ngImport: i0, template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <mat-select panelClass=\"gui-select\" hideSingleSelectionIndicator disableRipple\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [multiple]=\"config.multiple || false\"\n (selectionChange)=\"onValueChange()\">\n <mat-option *ngFor=\"let opt of config.options\" [value]=\"opt.value\" [disabled]=\"opt.disabled\">\n <span [style]=\"{fontFamily: config.useFont ? opt.value : ''}\">{{opt.label}}</span>\n </mat-option>\n </mat-select>\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-select{--mat-select-trigger-text-size: 12px;--mat-option-label-text-size: 12px}.gui-select .mat-mdc-option{min-height:var(--mat-option-label-text-line-height);padding:0 8px}.gui-select .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:8px}.gui-select .mat-pseudo-checkbox{width:16px;height:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
277
|
+
}
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSelect, decorators: [{
|
|
279
|
+
type: Component,
|
|
280
|
+
args: [{ selector: 'gui-select', host: {
|
|
281
|
+
class: 'gui-field gui-select',
|
|
282
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
283
|
+
{
|
|
284
|
+
provide: NG_VALUE_ACCESSOR,
|
|
285
|
+
useExisting: forwardRef(() => GuiSelect),
|
|
286
|
+
multi: true,
|
|
287
|
+
},
|
|
288
|
+
], template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <mat-select panelClass=\"gui-select\" hideSingleSelectionIndicator disableRipple\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [multiple]=\"config.multiple || false\"\n (selectionChange)=\"onValueChange()\">\n <mat-option *ngFor=\"let opt of config.options\" [value]=\"opt.value\" [disabled]=\"opt.disabled\">\n <span [style]=\"{fontFamily: config.useFont ? opt.value : ''}\">{{opt.label}}</span>\n </mat-option>\n </mat-select>\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-select{--mat-select-trigger-text-size: 12px;--mat-option-label-text-size: 12px}.gui-select .mat-mdc-option{min-height:var(--mat-option-label-text-line-height);padding:0 8px}.gui-select .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:8px}.gui-select .mat-pseudo-checkbox{width:16px;height:16px}\n"] }]
|
|
289
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
290
|
+
type: Input
|
|
291
|
+
}], disabled: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}] } });
|
|
294
|
+
|
|
295
|
+
class GuiSwitch {
|
|
296
|
+
constructor(cdr) {
|
|
297
|
+
this.cdr = cdr;
|
|
298
|
+
this.config = {};
|
|
299
|
+
this.disabled = false;
|
|
300
|
+
this.value = false;
|
|
301
|
+
this.onChange = () => { };
|
|
302
|
+
this.onTouched = () => { };
|
|
303
|
+
}
|
|
304
|
+
writeValue(value) {
|
|
305
|
+
this.value = value;
|
|
306
|
+
this.cdr.markForCheck();
|
|
307
|
+
}
|
|
308
|
+
registerOnChange(fn) {
|
|
309
|
+
this.onChange = fn;
|
|
310
|
+
}
|
|
311
|
+
registerOnTouched(fn) {
|
|
312
|
+
this.onTouched = fn;
|
|
313
|
+
}
|
|
314
|
+
setDisabledState(isDisabled) {
|
|
315
|
+
this.disabled = isDisabled;
|
|
316
|
+
this.cdr.markForCheck();
|
|
317
|
+
}
|
|
318
|
+
onValueChange() {
|
|
319
|
+
this.onChange(this.value);
|
|
320
|
+
}
|
|
321
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSwitch, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
322
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiSwitch, selector: "gui-switch", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-switch" }, providers: [
|
|
323
|
+
{
|
|
324
|
+
provide: NG_VALUE_ACCESSOR,
|
|
325
|
+
useExisting: forwardRef(() => GuiSwitch),
|
|
326
|
+
multi: true,
|
|
327
|
+
},
|
|
328
|
+
], ngImport: i0, template: "<mat-slide-toggle [(ngModel)]=\"value\" [disabled]=\"disabled\" hideIcon\n (change)=\"onValueChange()\">\n</mat-slide-toggle>\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-switch .mdc-switch{--mdc-switch-track-width: 28px;--mdc-switch-handle-width: 14px;--mdc-switch-handle-height: 14px;--mdc-switch-state-layer-size: 24px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i4$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
329
|
+
}
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSwitch, decorators: [{
|
|
331
|
+
type: Component,
|
|
332
|
+
args: [{ selector: 'gui-switch', host: {
|
|
333
|
+
class: 'gui-field gui-switch',
|
|
334
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
335
|
+
{
|
|
336
|
+
provide: NG_VALUE_ACCESSOR,
|
|
337
|
+
useExisting: forwardRef(() => GuiSwitch),
|
|
338
|
+
multi: true,
|
|
339
|
+
},
|
|
340
|
+
], template: "<mat-slide-toggle [(ngModel)]=\"value\" [disabled]=\"disabled\" hideIcon\n (change)=\"onValueChange()\">\n</mat-slide-toggle>\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-switch .mdc-switch{--mdc-switch-track-width: 28px;--mdc-switch-handle-width: 14px;--mdc-switch-handle-height: 14px;--mdc-switch-state-layer-size: 24px}\n"] }]
|
|
341
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}], disabled: [{
|
|
344
|
+
type: Input
|
|
345
|
+
}] } });
|
|
346
|
+
|
|
347
|
+
class GuiSlider {
|
|
348
|
+
constructor(cdr) {
|
|
349
|
+
this.cdr = cdr;
|
|
350
|
+
this.config = {};
|
|
351
|
+
this.disabled = false;
|
|
352
|
+
this.onChange = () => { };
|
|
353
|
+
this.onTouched = () => { };
|
|
354
|
+
}
|
|
355
|
+
writeValue(value) {
|
|
356
|
+
this.value = value;
|
|
357
|
+
this.setInputValue();
|
|
358
|
+
this.cdr.markForCheck();
|
|
359
|
+
}
|
|
360
|
+
registerOnChange(fn) {
|
|
361
|
+
this.onChange = fn;
|
|
362
|
+
}
|
|
363
|
+
registerOnTouched(fn) {
|
|
364
|
+
this.onTouched = fn;
|
|
365
|
+
}
|
|
366
|
+
setDisabledState(isDisabled) {
|
|
367
|
+
this.disabled = isDisabled;
|
|
368
|
+
this.cdr.markForCheck();
|
|
369
|
+
}
|
|
370
|
+
onValueChange() {
|
|
371
|
+
this.onChange(this.value);
|
|
372
|
+
}
|
|
373
|
+
onRangeSliderChange() {
|
|
374
|
+
this.setInputValue();
|
|
375
|
+
this.onValueChange();
|
|
376
|
+
}
|
|
377
|
+
onRangeInputChange() {
|
|
378
|
+
this.value = [this.minValue, this.maxValue];
|
|
379
|
+
this.onValueChange();
|
|
380
|
+
}
|
|
381
|
+
setInputValue() {
|
|
382
|
+
if (Array.isArray(this.value)) {
|
|
383
|
+
this.minValue = this.value[0];
|
|
384
|
+
this.maxValue = this.value[1];
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSlider, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
388
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiSlider, selector: "gui-slider", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-slider" }, providers: [
|
|
389
|
+
{
|
|
390
|
+
provide: NG_VALUE_ACCESSOR,
|
|
391
|
+
useExisting: forwardRef(() => GuiSlider),
|
|
392
|
+
multi: true,
|
|
393
|
+
},
|
|
394
|
+
], ngImport: i0, template: "<!-- \u666E\u901A\u6ED1\u5757 -->\n<ng-container *ngIf=\"config.mode!=='range'\">\n <mat-slider [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min\"\n [max]=\"config.max\">\n <input matSliderThumb [(ngModel)]=\"value\" (valueChange)=\"onValueChange()\">\n </mat-slider>\n <mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onValueChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n</ng-container>\n\n<!-- \u533A\u95F4\u6ED1\u5757 -->\n<ng-container *ngIf=\"config.mode==='range'\">\n <mat-slider [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min\"\n [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 <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"minValue\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n <mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"maxValue\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n</ng-container>\n\n<!-- \u5E95\u90E8\u6807\u7B7E -->\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-slider .mat-mdc-slider{--mdc-slider-handle-width: 12px;--mdc-slider-handle-height: 12px;--mdc-slider-inactive-track-height: 2px;--mdc-slider-active-track-height: 2px;flex:1;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{width:80px;max-width:80px}.gui-slider .mat-mdc-slider.mdc-slider--range{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{width:60px;max-width:60px}.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:6px}.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"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.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: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatSlider, selector: "mat-slider", inputs: ["color", "disableRipple", "disabled", "discrete", "showTickMarks", "min", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i5$1.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: i5$1.MatSliderRangeThumb, selector: "input[matSliderStartThumb], input[matSliderEndThumb]", exportAs: ["matSliderRangeThumb"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
395
|
+
}
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiSlider, decorators: [{
|
|
397
|
+
type: Component,
|
|
398
|
+
args: [{ selector: 'gui-slider', host: {
|
|
399
|
+
class: 'gui-field gui-slider',
|
|
400
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
401
|
+
{
|
|
402
|
+
provide: NG_VALUE_ACCESSOR,
|
|
403
|
+
useExisting: forwardRef(() => GuiSlider),
|
|
404
|
+
multi: true,
|
|
405
|
+
},
|
|
406
|
+
], template: "<!-- \u666E\u901A\u6ED1\u5757 -->\n<ng-container *ngIf=\"config.mode!=='range'\">\n <mat-slider [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min\"\n [max]=\"config.max\">\n <input matSliderThumb [(ngModel)]=\"value\" (valueChange)=\"onValueChange()\">\n </mat-slider>\n <mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onValueChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n</ng-container>\n\n<!-- \u533A\u95F4\u6ED1\u5757 -->\n<ng-container *ngIf=\"config.mode==='range'\">\n <mat-slider [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min\"\n [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 <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"minValue\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n <mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <input matInput type=\"number\"\n [(ngModel)]=\"maxValue\"\n [disabled]=\"disabled\"\n [step]=\"config.step\"\n [min]=\"config.min!\"\n [max]=\"config.max!\"\n (change)=\"onRangeInputChange()\">\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n </mat-form-field>\n</ng-container>\n\n<!-- \u5E95\u90E8\u6807\u7B7E -->\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-slider .mat-mdc-slider{--mdc-slider-handle-width: 12px;--mdc-slider-handle-height: 12px;--mdc-slider-inactive-track-height: 2px;--mdc-slider-active-track-height: 2px;flex:1;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{width:80px;max-width:80px}.gui-slider .mat-mdc-slider.mdc-slider--range{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{width:60px;max-width:60px}.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:6px}.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"] }]
|
|
407
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
408
|
+
type: Input
|
|
409
|
+
}], disabled: [{
|
|
410
|
+
type: Input
|
|
411
|
+
}] } });
|
|
412
|
+
|
|
413
|
+
class GuiIcon {
|
|
414
|
+
constructor() {
|
|
415
|
+
this.src = '';
|
|
416
|
+
}
|
|
417
|
+
isUrl() {
|
|
418
|
+
return /https?:\/\/.+/.test(this.src);
|
|
419
|
+
}
|
|
420
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
421
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiIcon, selector: "gui-icon", inputs: { src: "src" }, host: { classAttribute: "gui-icon" }, ngImport: i0, template: `
|
|
422
|
+
<img *ngIf="isUrl()" [src]="src" />
|
|
423
|
+
<i *ngIf="!isUrl()" [ngClass]="src"></i>
|
|
424
|
+
`, isInline: true, styles: [".gui-icon{display:inline-flex}.gui-icon img,.gui-icon i{display:block;width:22px;height:22px;line-height:22px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
425
|
+
}
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiIcon, decorators: [{
|
|
427
|
+
type: Component,
|
|
428
|
+
args: [{ selector: 'gui-icon', template: `
|
|
429
|
+
<img *ngIf="isUrl()" [src]="src" />
|
|
430
|
+
<i *ngIf="!isUrl()" [ngClass]="src"></i>
|
|
431
|
+
`, host: {
|
|
432
|
+
class: 'gui-icon',
|
|
433
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".gui-icon{display:inline-flex}.gui-icon img,.gui-icon i{display:block;width:22px;height:22px;line-height:22px}\n"] }]
|
|
434
|
+
}], propDecorators: { src: [{
|
|
435
|
+
type: Input
|
|
436
|
+
}] } });
|
|
437
|
+
|
|
438
|
+
class GuiButtonToggle {
|
|
439
|
+
constructor(cdr) {
|
|
440
|
+
this.cdr = cdr;
|
|
441
|
+
this.config = {};
|
|
442
|
+
this.disabled = false;
|
|
443
|
+
this.value = '';
|
|
444
|
+
this.onChange = () => { };
|
|
445
|
+
this.onTouched = () => { };
|
|
446
|
+
}
|
|
447
|
+
writeValue(value) {
|
|
448
|
+
this.value = value;
|
|
449
|
+
this.cdr.markForCheck();
|
|
450
|
+
}
|
|
451
|
+
registerOnChange(fn) {
|
|
452
|
+
this.onChange = fn;
|
|
453
|
+
}
|
|
454
|
+
registerOnTouched(fn) {
|
|
455
|
+
this.onTouched = fn;
|
|
456
|
+
}
|
|
457
|
+
setDisabledState(isDisabled) {
|
|
458
|
+
this.disabled = isDisabled;
|
|
459
|
+
this.cdr.markForCheck();
|
|
460
|
+
}
|
|
461
|
+
onValueChange() {
|
|
462
|
+
this.onChange(this.value);
|
|
463
|
+
}
|
|
464
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiButtonToggle, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
465
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiButtonToggle, selector: "gui-button-toggle", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-button-toggle" }, providers: [
|
|
466
|
+
{
|
|
467
|
+
provide: NG_VALUE_ACCESSOR,
|
|
468
|
+
useExisting: forwardRef(() => GuiButtonToggle),
|
|
469
|
+
multi: true,
|
|
470
|
+
},
|
|
471
|
+
], ngImport: i0, template: "<mat-button-toggle-group [(ngModel)]=\"value\" [disabled]=\"disabled\" [multiple]=\"config.multiple\"\n (change)=\"onValueChange()\">\n <mat-button-toggle *ngFor=\"let opt of config.options\" 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 <gui-icon *ngIf=\"config.useIcon; else textLabel\" [src]=\"opt.src!\"></gui-icon>\n <ng-template #textLabel>{{opt.label}}</ng-template>\n </mat-button-toggle>\n</mat-button-toggle-group>\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-button-toggle{--mat-standard-button-toggle-height: 22px}.gui-button-toggle .mat-button-toggle-group{flex-wrap:wrap}.gui-icon-toggle.mat-button-toggle .mat-button-toggle-label-content{padding:0;line-height:normal}.gui-icon-toggle.mat-button-toggle-checked img{opacity:.64}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$3.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i4$3.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: GuiIcon, selector: "gui-icon", inputs: ["src"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }, { kind: "directive", type: GuiFlexDirective, selector: "[flex]", inputs: ["flex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
472
|
+
}
|
|
473
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiButtonToggle, decorators: [{
|
|
474
|
+
type: Component,
|
|
475
|
+
args: [{ selector: 'gui-button-toggle', host: {
|
|
476
|
+
class: 'gui-field gui-button-toggle',
|
|
477
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
478
|
+
{
|
|
479
|
+
provide: NG_VALUE_ACCESSOR,
|
|
480
|
+
useExisting: forwardRef(() => GuiButtonToggle),
|
|
481
|
+
multi: true,
|
|
482
|
+
},
|
|
483
|
+
], template: "<mat-button-toggle-group [(ngModel)]=\"value\" [disabled]=\"disabled\" [multiple]=\"config.multiple\"\n (change)=\"onValueChange()\">\n <mat-button-toggle *ngFor=\"let opt of config.options\" 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 <gui-icon *ngIf=\"config.useIcon; else textLabel\" [src]=\"opt.src!\"></gui-icon>\n <ng-template #textLabel>{{opt.label}}</ng-template>\n </mat-button-toggle>\n</mat-button-toggle-group>\n<mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n</mat-hint>\n", styles: [".gui-button-toggle{--mat-standard-button-toggle-height: 22px}.gui-button-toggle .mat-button-toggle-group{flex-wrap:wrap}.gui-icon-toggle.mat-button-toggle .mat-button-toggle-label-content{padding:0;line-height:normal}.gui-icon-toggle.mat-button-toggle-checked img{opacity:.64}\n"] }]
|
|
484
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
485
|
+
type: Input
|
|
486
|
+
}], disabled: [{
|
|
487
|
+
type: Input
|
|
488
|
+
}] } });
|
|
489
|
+
|
|
490
|
+
class GuiFill {
|
|
491
|
+
constructor(cdr) {
|
|
492
|
+
this.cdr = cdr;
|
|
493
|
+
this.config = {};
|
|
494
|
+
this.disabled = false;
|
|
495
|
+
this.value = '';
|
|
496
|
+
this.onChange = () => { };
|
|
497
|
+
this.onTouched = () => { };
|
|
498
|
+
}
|
|
499
|
+
writeValue(value) {
|
|
500
|
+
this.value = value;
|
|
501
|
+
this.cdr.markForCheck();
|
|
502
|
+
}
|
|
503
|
+
registerOnChange(fn) {
|
|
504
|
+
this.onChange = fn;
|
|
505
|
+
}
|
|
506
|
+
registerOnTouched(fn) {
|
|
507
|
+
this.onTouched = fn;
|
|
508
|
+
}
|
|
509
|
+
setDisabledState(isDisabled) {
|
|
510
|
+
this.disabled = isDisabled;
|
|
511
|
+
this.cdr.markForCheck();
|
|
512
|
+
}
|
|
513
|
+
onValueChange() {
|
|
514
|
+
this.onChange(this.value);
|
|
515
|
+
}
|
|
516
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFill, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
517
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiFill, selector: "gui-fill", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-fill" }, providers: [
|
|
518
|
+
{
|
|
519
|
+
provide: NG_VALUE_ACCESSOR,
|
|
520
|
+
useExisting: forwardRef(() => GuiFill),
|
|
521
|
+
multi: true,
|
|
522
|
+
},
|
|
523
|
+
], ngImport: i0, template: "<mat-form-field>\n <ng-container matPrefix>\n <span class=\"gui-color-block-empty\"></span>\n <span class=\"gui-color-block\" [style]=\"{background: value}\"></span>\n </ng-container>\n <input matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [mtxColorpicker]=\"cp\"\n (colorChange)=\"onValueChange()\">\n <mtx-colorpicker #cp></mtx-colorpicker>\n <mtx-colorpicker-toggle matSuffix [for]=\"cp\"></mtx-colorpicker-toggle>\n <mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-color-block,.gui-color-block-empty{position:relative;display:block;width:18px;height:18px;border:1px solid #000}.gui-color-block-empty{position:absolute;background-color:#fff;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-position:0 0,0 4px,4px -4px,-4px 0;background-size:8px 8px}.gui-fill .gui-colorpicker-toggle{display:flex;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$2.MtxColorpicker, selector: "mtx-colorpicker", inputs: ["content", "disabled", "xPosition", "yPosition", "restoreFocus", "opened", "color", "format"], outputs: ["opened", "closed"], exportAs: ["mtxColorpicker"] }, { kind: "directive", type: i5$2.MtxColorpickerInput, selector: "input[mtxColorpicker]", inputs: ["mtxColorpicker", "disabled", "value", "format"], outputs: ["colorChange", "colorInput"], exportAs: ["mtxColorpickerInput"] }, { kind: "component", type: i5$2.MtxColorpickerToggle, selector: "mtx-colorpicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["mtxColorpickerToggle"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
524
|
+
}
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFill, decorators: [{
|
|
526
|
+
type: Component,
|
|
527
|
+
args: [{ selector: 'gui-fill', host: {
|
|
528
|
+
class: 'gui-field gui-fill',
|
|
529
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
530
|
+
{
|
|
531
|
+
provide: NG_VALUE_ACCESSOR,
|
|
532
|
+
useExisting: forwardRef(() => GuiFill),
|
|
533
|
+
multi: true,
|
|
534
|
+
},
|
|
535
|
+
], template: "<mat-form-field>\n <ng-container matPrefix>\n <span class=\"gui-color-block-empty\"></span>\n <span class=\"gui-color-block\" [style]=\"{background: value}\"></span>\n </ng-container>\n <input matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [mtxColorpicker]=\"cp\"\n (colorChange)=\"onValueChange()\">\n <mtx-colorpicker #cp></mtx-colorpicker>\n <mtx-colorpicker-toggle matSuffix [for]=\"cp\"></mtx-colorpicker-toggle>\n <mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-color-block,.gui-color-block-empty{position:relative;display:block;width:18px;height:18px;border:1px solid #000}.gui-color-block-empty{position:absolute;background-color:#fff;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-position:0 0,0 4px,4px -4px,-4px 0;background-size:8px 8px}.gui-fill .gui-colorpicker-toggle{display:flex;color:#fff}\n"] }]
|
|
536
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
537
|
+
type: Input
|
|
538
|
+
}], disabled: [{
|
|
539
|
+
type: Input
|
|
540
|
+
}] } });
|
|
541
|
+
|
|
542
|
+
class GuiFieldGroup {
|
|
543
|
+
constructor(differs, cdr) {
|
|
544
|
+
this.differs = differs;
|
|
545
|
+
this.cdr = cdr;
|
|
546
|
+
this.config = {};
|
|
547
|
+
}
|
|
548
|
+
ngOnInit() {
|
|
549
|
+
this.configDiffer = this.differs.find(this.config).create();
|
|
550
|
+
}
|
|
551
|
+
ngDoCheck() {
|
|
552
|
+
const changes = this.configDiffer?.diff(this.config);
|
|
553
|
+
changes?.forEachChangedItem(record => {
|
|
554
|
+
this.cdr.markForCheck();
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFieldGroup, deps: [{ token: i0.KeyValueDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
558
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiFieldGroup, selector: "gui-field-group", inputs: { config: "config" }, host: { classAttribute: "gui-field-group" }, ngImport: i0, template: "<gui-field-label *ngIf=\"config.parentType !== 'inline' && config.name\"\n [config]=\"config\" [index]=\"config.index\">\n</gui-field-label>\n<ng-content></ng-content>\n", styles: [".gui-field-group{display:flex;padding:4px 8px}.gui-field{display:inline-flex;flex:1;flex-wrap:wrap}.gui-field>.mat-mdc-form-field{flex:1;width:0;max-width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
559
|
+
}
|
|
560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFieldGroup, decorators: [{
|
|
561
|
+
type: Component,
|
|
562
|
+
args: [{ selector: 'gui-field-group', host: {
|
|
563
|
+
class: 'gui-field-group',
|
|
564
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<gui-field-label *ngIf=\"config.parentType !== 'inline' && config.name\"\n [config]=\"config\" [index]=\"config.index\">\n</gui-field-label>\n<ng-content></ng-content>\n", styles: [".gui-field-group{display:flex;padding:4px 8px}.gui-field{display:inline-flex;flex:1;flex-wrap:wrap}.gui-field>.mat-mdc-form-field{flex:1;width:0;max-width:100%}\n"] }]
|
|
565
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
566
|
+
type: Input
|
|
567
|
+
}] } });
|
|
568
|
+
|
|
569
|
+
class GuiInlineGroup {
|
|
570
|
+
constructor() {
|
|
571
|
+
this.config = {};
|
|
572
|
+
}
|
|
573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInlineGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
574
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiInlineGroup, selector: "gui-inline-group", inputs: { config: "config" }, host: { classAttribute: "gui-inline-group" }, ngImport: i0, template: "<gui-field-label [config]=\"config\"></gui-field-label>\n<div class=\"gui-inline-group-content\">\n <ng-content></ng-content>\n</div>\n", styles: [".gui-inline-group{display:flex;padding:4px 8px}.gui-inline-group-content{display:inline-flex;flex:1;flex-flow:row wrap;margin:0 -4px}.gui-inline-group-content>.gui-field-group,.gui-inline-group-content>.gui-inline-group,.gui-inline-group-content>.mat-expansion-panel,.gui-inline-group-content>.gui-menu{width:100%;padding:0 4px}\n"], dependencies: [{ kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
575
|
+
}
|
|
576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiInlineGroup, decorators: [{
|
|
577
|
+
type: Component,
|
|
578
|
+
args: [{ selector: 'gui-inline-group', host: {
|
|
579
|
+
class: 'gui-inline-group',
|
|
580
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<gui-field-label [config]=\"config\"></gui-field-label>\n<div class=\"gui-inline-group-content\">\n <ng-content></ng-content>\n</div>\n", styles: [".gui-inline-group{display:flex;padding:4px 8px}.gui-inline-group-content{display:inline-flex;flex:1;flex-flow:row wrap;margin:0 -4px}.gui-inline-group-content>.gui-field-group,.gui-inline-group-content>.gui-inline-group,.gui-inline-group-content>.mat-expansion-panel,.gui-inline-group-content>.gui-menu{width:100%;padding:0 4px}\n"] }]
|
|
581
|
+
}], propDecorators: { config: [{
|
|
582
|
+
type: Input
|
|
583
|
+
}] } });
|
|
584
|
+
|
|
585
|
+
class GuiImageSelect {
|
|
586
|
+
constructor(cdr) {
|
|
587
|
+
this.cdr = cdr;
|
|
588
|
+
this.config = {};
|
|
589
|
+
this.disabled = false;
|
|
590
|
+
this.onChange = () => { };
|
|
591
|
+
this.onTouched = () => { };
|
|
592
|
+
}
|
|
593
|
+
writeValue(value) {
|
|
594
|
+
this.value = value;
|
|
595
|
+
this.cdr.markForCheck();
|
|
596
|
+
}
|
|
597
|
+
registerOnChange(fn) {
|
|
598
|
+
this.onChange = fn;
|
|
599
|
+
}
|
|
600
|
+
registerOnTouched(fn) {
|
|
601
|
+
this.onTouched = fn;
|
|
602
|
+
}
|
|
603
|
+
setDisabledState(isDisabled) {
|
|
604
|
+
this.disabled = isDisabled;
|
|
605
|
+
this.cdr.markForCheck();
|
|
606
|
+
}
|
|
607
|
+
onValueChange() {
|
|
608
|
+
this.onChange(this.value);
|
|
609
|
+
}
|
|
610
|
+
onPanelOpened() { }
|
|
611
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiImageSelect, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
612
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiImageSelect, selector: "gui-image-select", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-image-select" }, providers: [
|
|
613
|
+
{
|
|
614
|
+
provide: NG_VALUE_ACCESSOR,
|
|
615
|
+
useExisting: forwardRef(() => GuiImageSelect),
|
|
616
|
+
multi: true,
|
|
617
|
+
},
|
|
618
|
+
], ngImport: i0, template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <mtx-select [items]=\"config.options||[]\" appendTo=\".gui-form\" bindValue=\"value\"\n [(ngModel)]=\"value\"\n (change)=\"onValueChange()\"\n (open)=\"onPanelOpened()\">\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 <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-form .ng-dropdown-panel .ng-dropdown-panel-items .ng-option img,.gui-image-select .ng-select .ng-value img{height:100%;width:120px;object-fit:contain;border-radius:4px;background-color:var(--mat-option-hover-state-layer-color)}.gui-image-select .ng-select{padding:0 8px;margin:0 -8px}.gui-image-select .ng-select .ng-value-container{height:64px}.gui-image-select .ng-select .ng-value{display:inline-flex;align-items:center;gap:8px;height:100%;padding:8px 0}.gui-form .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{display:flex;align-items:center;gap:8px;height:64px;padding:8px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4$4.MtxSelect, selector: "mtx-select", inputs: ["disabled", "addTag", "addTagText", "appearance", "appendTo", "bindLabel", "bindValue", "closeOnSelect", "clearAllText", "clearable", "clearOnBackspace", "compareWith", "dropdownPosition", "groupBy", "groupValue", "selectableGroup", "selectableGroupAsModel", "hideSelected", "isOpen", "loading", "loadingText", "labelForId", "markFirst", "maxSelectedItems", "multiple", "notFoundText", "searchable", "readonly", "searchFn", "searchWhileComposing", "selectOnTab", "trackByFn", "inputAttrs", "tabIndex", "openOnEnter", "minTermLength", "editableSearchTerm", "keyDownFn", "virtualScroll", "typeToSearchText", "typeahead", "clearSearchOnAdd", "items", "value", "id", "placeholder", "required", "errorStateMatcher", "aria-label", "aria-labelledby"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["mtxSelect"] }, { kind: "directive", type: i4$4.MtxSelectOptionTemplate, selector: "[ng-option-tmp]" }, { kind: "directive", type: i4$4.MtxSelectLabelTemplate, selector: "[ng-label-tmp]" }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
619
|
+
}
|
|
620
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiImageSelect, decorators: [{
|
|
621
|
+
type: Component,
|
|
622
|
+
args: [{ selector: 'gui-image-select', host: {
|
|
623
|
+
class: 'gui-field gui-image-select',
|
|
624
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
625
|
+
{
|
|
626
|
+
provide: NG_VALUE_ACCESSOR,
|
|
627
|
+
useExisting: forwardRef(() => GuiImageSelect),
|
|
628
|
+
multi: true,
|
|
629
|
+
},
|
|
630
|
+
], template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <mtx-select [items]=\"config.options||[]\" appendTo=\".gui-form\" bindValue=\"value\"\n [(ngModel)]=\"value\"\n (change)=\"onValueChange()\"\n (open)=\"onPanelOpened()\">\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 <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType==='inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [".gui-form .ng-dropdown-panel .ng-dropdown-panel-items .ng-option img,.gui-image-select .ng-select .ng-value img{height:100%;width:120px;object-fit:contain;border-radius:4px;background-color:var(--mat-option-hover-state-layer-color)}.gui-image-select .ng-select{padding:0 8px;margin:0 -8px}.gui-image-select .ng-select .ng-value-container{height:64px}.gui-image-select .ng-select .ng-value{display:inline-flex;align-items:center;gap:8px;height:100%;padding:8px 0}.gui-form .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{display:flex;align-items:center;gap:8px;height:64px;padding:8px}\n"] }]
|
|
631
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
632
|
+
type: Input
|
|
633
|
+
}], disabled: [{
|
|
634
|
+
type: Input
|
|
635
|
+
}] } });
|
|
636
|
+
|
|
637
|
+
class GuiTextarea {
|
|
638
|
+
constructor(cdr) {
|
|
639
|
+
this.cdr = cdr;
|
|
640
|
+
this.config = {};
|
|
641
|
+
this.disabled = false;
|
|
642
|
+
this.value = '';
|
|
643
|
+
this.onChange = () => { };
|
|
644
|
+
this.onTouched = () => { };
|
|
645
|
+
}
|
|
646
|
+
writeValue(value) {
|
|
647
|
+
this.value = value;
|
|
648
|
+
this.cdr.markForCheck();
|
|
649
|
+
}
|
|
650
|
+
registerOnChange(fn) {
|
|
651
|
+
this.onChange = fn;
|
|
652
|
+
}
|
|
653
|
+
registerOnTouched(fn) {
|
|
654
|
+
this.onTouched = fn;
|
|
655
|
+
}
|
|
656
|
+
setDisabledState(isDisabled) {
|
|
657
|
+
this.disabled = isDisabled;
|
|
658
|
+
this.cdr.markForCheck();
|
|
659
|
+
}
|
|
660
|
+
onValueChange() {
|
|
661
|
+
this.onChange(this.value);
|
|
662
|
+
}
|
|
663
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiTextarea, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
664
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiTextarea, selector: "gui-textarea", inputs: { config: "config", disabled: "disabled" }, host: { classAttribute: "gui-field gui-textarea" }, providers: [
|
|
665
|
+
{
|
|
666
|
+
provide: NG_VALUE_ACCESSOR,
|
|
667
|
+
useExisting: forwardRef(() => GuiTextarea),
|
|
668
|
+
multi: true,
|
|
669
|
+
},
|
|
670
|
+
], ngImport: i0, template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <textarea matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [rows]=\"config.rows\"\n (change)=\"onValueChange()\"></textarea>\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
671
|
+
}
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiTextarea, decorators: [{
|
|
673
|
+
type: Component,
|
|
674
|
+
args: [{ selector: 'gui-textarea', host: {
|
|
675
|
+
class: 'gui-field gui-textarea',
|
|
676
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
677
|
+
{
|
|
678
|
+
provide: NG_VALUE_ACCESSOR,
|
|
679
|
+
useExisting: forwardRef(() => GuiTextarea),
|
|
680
|
+
multi: true,
|
|
681
|
+
},
|
|
682
|
+
], template: "<mat-form-field>\n <span *ngIf=\"config.prefix\" matPrefix>{{config.prefix}}</span>\n <textarea matInput\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"config.placeholder||''\"\n [rows]=\"config.rows\"\n (change)=\"onValueChange()\"></textarea>\n <span *ngIf=\"config.suffix\" matSuffix>{{config.suffix}}</span>\n <mat-hint *ngIf=\"config.parentType === 'inline'\">\n <gui-field-label [config]=\"config\"></gui-field-label>\n </mat-hint>\n</mat-form-field>\n" }]
|
|
683
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { config: [{
|
|
684
|
+
type: Input
|
|
685
|
+
}], disabled: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}] } });
|
|
688
|
+
|
|
689
|
+
class GuiFileUploaderConfig {
|
|
690
|
+
constructor(http) {
|
|
691
|
+
this.http = http;
|
|
692
|
+
/**
|
|
693
|
+
* The file upload URL
|
|
694
|
+
*/
|
|
695
|
+
this.url = '';
|
|
696
|
+
/**
|
|
697
|
+
* The file upload params
|
|
698
|
+
*/
|
|
699
|
+
this.params = {};
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* The File upload API
|
|
703
|
+
*
|
|
704
|
+
* @param file file data
|
|
705
|
+
* @returns
|
|
706
|
+
*/
|
|
707
|
+
upload(file) {
|
|
708
|
+
return this.http.post(this.url, file, {
|
|
709
|
+
reportProgress: true,
|
|
710
|
+
observe: 'events',
|
|
711
|
+
params: this.params,
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFileUploaderConfig, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
715
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFileUploaderConfig }); }
|
|
716
|
+
}
|
|
717
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFileUploaderConfig, decorators: [{
|
|
718
|
+
type: Injectable
|
|
719
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
720
|
+
|
|
721
|
+
class GuiFileUploader {
|
|
722
|
+
constructor(fileUploaderCfg, cdr) {
|
|
723
|
+
this.fileUploaderCfg = fileUploaderCfg;
|
|
724
|
+
this.cdr = cdr;
|
|
725
|
+
this.type = '*';
|
|
726
|
+
this.name = '';
|
|
727
|
+
this.accept = '';
|
|
728
|
+
this.disabled = false;
|
|
729
|
+
this.fileChange = new EventEmitter();
|
|
730
|
+
// media src
|
|
731
|
+
this.url = '';
|
|
732
|
+
this.onChange = () => { };
|
|
733
|
+
this.onTouched = () => { };
|
|
734
|
+
}
|
|
735
|
+
ngOnChanges(changes) {
|
|
736
|
+
if (changes['type']) {
|
|
737
|
+
this.accept = this.type + '/*';
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
writeValue(value) {
|
|
741
|
+
this.url = value;
|
|
742
|
+
this.cdr.markForCheck();
|
|
743
|
+
}
|
|
744
|
+
registerOnChange(fn) {
|
|
745
|
+
this.onChange = fn;
|
|
746
|
+
}
|
|
747
|
+
registerOnTouched(fn) {
|
|
748
|
+
this.onTouched = fn;
|
|
749
|
+
}
|
|
750
|
+
setDisabledState(isDisabled) {
|
|
751
|
+
this.disabled = isDisabled;
|
|
752
|
+
this.cdr.markForCheck();
|
|
753
|
+
}
|
|
754
|
+
upload(file) {
|
|
755
|
+
const formData = new FormData();
|
|
756
|
+
formData.append('file', file.data || '');
|
|
757
|
+
file.inProgress = true;
|
|
758
|
+
this.fileUploaderCfg
|
|
759
|
+
.upload(formData)
|
|
760
|
+
.pipe(catchError((error) => {
|
|
761
|
+
file.inProgress = false;
|
|
762
|
+
return of(`${file.data?.name || 'File'} upload failed.`);
|
|
763
|
+
}), finalize(() => { }))
|
|
764
|
+
.subscribe(res => {
|
|
765
|
+
if (res instanceof HttpResponse && res.body) {
|
|
766
|
+
this.url = res.body.data;
|
|
767
|
+
this.onChange(this.url);
|
|
768
|
+
this.onTouched();
|
|
769
|
+
this.fileChange.emit(this.url);
|
|
770
|
+
}
|
|
771
|
+
this.cdr.detectChanges();
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
onUrlChange(e) {
|
|
775
|
+
this.url = e.target.value;
|
|
776
|
+
this.onChange(this.url);
|
|
777
|
+
this.fileChange.emit(this.url);
|
|
778
|
+
}
|
|
779
|
+
onFileChange(e) {
|
|
780
|
+
this.file = {
|
|
781
|
+
data: e.target.files[0],
|
|
782
|
+
inProgress: false,
|
|
783
|
+
progress: 0,
|
|
784
|
+
};
|
|
785
|
+
this.upload(this.file);
|
|
786
|
+
// reset input value
|
|
787
|
+
e.target.value = '';
|
|
788
|
+
}
|
|
789
|
+
onBlur() {
|
|
790
|
+
this.onTouched();
|
|
791
|
+
}
|
|
792
|
+
onClear() {
|
|
793
|
+
this.url = '';
|
|
794
|
+
this.onChange(this.url);
|
|
795
|
+
this.onTouched();
|
|
796
|
+
this.fileChange.emit(this.url);
|
|
797
|
+
}
|
|
798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFileUploader, deps: [{ token: GuiFileUploaderConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
799
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiFileUploader, selector: "gui-file-uploader", inputs: { type: "type", name: "name", accept: "accept", disabled: "disabled" }, outputs: { fileChange: "fileChange" }, host: { classAttribute: "gui-file-uploader" }, providers: [
|
|
800
|
+
{
|
|
801
|
+
provide: NG_VALUE_ACCESSOR,
|
|
802
|
+
useExisting: forwardRef(() => GuiFileUploader),
|
|
803
|
+
multi: true,
|
|
804
|
+
},
|
|
805
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-form-field>\n <mat-icon matPrefix svgIcon=\"link\"></mat-icon>\n\n <input matInput type=\"text\" [ngModel]=\"url\" [disabled]=\"disabled\"\n (change)=\"onUrlChange($event)\" (blur)=\"onBlur()\">\n\n <button *ngIf=\"url\" matSuffix mat-icon-button color=\"warn\"\n [disabled]=\"disabled\" (click)=\"onClear()\">\n <mat-icon svgIcon=\"close\"></mat-icon>\n </button>\n</mat-form-field>\n\n<figure class=\"gui-file-content\">\n <ng-container *ngIf=\"url\" [ngSwitch]=\"type\">\n <img *ngSwitchCase=\"'image'\" [src]=\"url\">\n\n <video *ngSwitchCase=\"'video'\" [src]=\"url\"></video>\n\n <audio *ngSwitchCase=\"'audio'\" [src]=\"url\" controls></audio>\n\n <svg *ngSwitchDefault\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z\">\n </path>\n </svg>\n </ng-container>\n\n <div *ngIf=\"!url\" class=\"gui-file-placeholder\">\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6</div>\n\n <input #fileInput type=\"file\" [accept]=\"accept\" [name]=\"name\" tabindex=\"-1\"\n [disabled]=\"disabled\" (change)=\"onFileChange($event)\">\n</figure>\n", styles: [".gui-file-uploader{display:block;overflow:auto;flex: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:120px;margin:4px 0 0;padding:4px;background-color:var(--mdc-filled-text-field-container-color);border:1px solid transparent;border-radius:4px}.gui-file-uploader .gui-file-content:hover{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%;text-indent:9999px;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
806
|
+
}
|
|
807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiFileUploader, decorators: [{
|
|
808
|
+
type: Component,
|
|
809
|
+
args: [{ selector: 'gui-file-uploader', host: {
|
|
810
|
+
class: 'gui-file-uploader',
|
|
811
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
812
|
+
{
|
|
813
|
+
provide: NG_VALUE_ACCESSOR,
|
|
814
|
+
useExisting: forwardRef(() => GuiFileUploader),
|
|
815
|
+
multi: true,
|
|
816
|
+
},
|
|
817
|
+
], template: "<mat-form-field>\n <mat-icon matPrefix svgIcon=\"link\"></mat-icon>\n\n <input matInput type=\"text\" [ngModel]=\"url\" [disabled]=\"disabled\"\n (change)=\"onUrlChange($event)\" (blur)=\"onBlur()\">\n\n <button *ngIf=\"url\" matSuffix mat-icon-button color=\"warn\"\n [disabled]=\"disabled\" (click)=\"onClear()\">\n <mat-icon svgIcon=\"close\"></mat-icon>\n </button>\n</mat-form-field>\n\n<figure class=\"gui-file-content\">\n <ng-container *ngIf=\"url\" [ngSwitch]=\"type\">\n <img *ngSwitchCase=\"'image'\" [src]=\"url\">\n\n <video *ngSwitchCase=\"'video'\" [src]=\"url\"></video>\n\n <audio *ngSwitchCase=\"'audio'\" [src]=\"url\" controls></audio>\n\n <svg *ngSwitchDefault\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z\">\n </path>\n </svg>\n </ng-container>\n\n <div *ngIf=\"!url\" class=\"gui-file-placeholder\">\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6</div>\n\n <input #fileInput type=\"file\" [accept]=\"accept\" [name]=\"name\" tabindex=\"-1\"\n [disabled]=\"disabled\" (change)=\"onFileChange($event)\">\n</figure>\n", styles: [".gui-file-uploader{display:block;overflow:auto;flex: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:120px;margin:4px 0 0;padding:4px;background-color:var(--mdc-filled-text-field-container-color);border:1px solid transparent;border-radius:4px}.gui-file-uploader .gui-file-content:hover{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%;text-indent:9999px;cursor:pointer}\n"] }]
|
|
818
|
+
}], ctorParameters: function () { return [{ type: GuiFileUploaderConfig }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { fileInput: [{
|
|
819
|
+
type: ViewChild,
|
|
820
|
+
args: ['fileInput']
|
|
821
|
+
}], type: [{
|
|
822
|
+
type: Input
|
|
823
|
+
}], name: [{
|
|
824
|
+
type: Input
|
|
825
|
+
}], accept: [{
|
|
826
|
+
type: Input
|
|
827
|
+
}], disabled: [{
|
|
828
|
+
type: Input
|
|
829
|
+
}], fileChange: [{
|
|
830
|
+
type: Output
|
|
831
|
+
}] } });
|
|
832
|
+
|
|
833
|
+
class GuiForm {
|
|
834
|
+
constructor(cdr) {
|
|
835
|
+
this.cdr = cdr;
|
|
836
|
+
/**
|
|
837
|
+
* The form instance which allow to track model value and validation status.
|
|
838
|
+
*/
|
|
839
|
+
this.form = new FormGroup({});
|
|
840
|
+
/**
|
|
841
|
+
* The field configurations for building the form.
|
|
842
|
+
*/
|
|
843
|
+
this.config = {};
|
|
844
|
+
/**
|
|
845
|
+
* The model to be represented by the form.
|
|
846
|
+
*/
|
|
847
|
+
this.model = {};
|
|
848
|
+
this.formFields = [];
|
|
849
|
+
this.formSubscription = Subscription.EMPTY;
|
|
850
|
+
}
|
|
851
|
+
ngOnChanges(changes) {
|
|
852
|
+
if (changes['config']) {
|
|
853
|
+
this.form.controls = {}; // reset controls
|
|
854
|
+
this.formFields = this.getFormFieldArray(this.form, this.config, this.model);
|
|
855
|
+
}
|
|
856
|
+
if (changes['model'] && this.model && Object.keys(this.model).length > 0) {
|
|
857
|
+
this.form.patchValue(this.model);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
ngOnInit() {
|
|
861
|
+
this.formSubscription = this.form.valueChanges.subscribe(value => {
|
|
862
|
+
Object.assign(this.model, value);
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
ngOnDestroy() {
|
|
866
|
+
this.formSubscription.unsubscribe();
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Convert the object config to array config and register into the reactive form.
|
|
870
|
+
*
|
|
871
|
+
* @param form The reactive form instance
|
|
872
|
+
* @param config The config of the form fields
|
|
873
|
+
* @param model The value of the form control
|
|
874
|
+
* @param defaultValue The default value of the form field
|
|
875
|
+
* @param parentType The type of the form field parent
|
|
876
|
+
* @param options The reactive form options
|
|
877
|
+
* @returns
|
|
878
|
+
*/
|
|
879
|
+
getFormFieldArray(form, config = {}, model = {}, defaultValue = null, parentType = 'group', options = { emitEvent: false }) {
|
|
880
|
+
const tempArr = [];
|
|
881
|
+
for (const key of Object.keys(config)) {
|
|
882
|
+
// Inferring the form type by the data type of `children`
|
|
883
|
+
// 1. `undefined` => FormControl
|
|
884
|
+
// 2. `array` => FormArray
|
|
885
|
+
// 3. `object` => FormGroup
|
|
886
|
+
const _children = config[key].template ? [] : config[key].children;
|
|
887
|
+
const _type = !_children ? 'control' : Array.isArray(_children) ? 'array' : 'group';
|
|
888
|
+
const item = {
|
|
889
|
+
_type,
|
|
890
|
+
key,
|
|
891
|
+
parentType,
|
|
892
|
+
model: model[key],
|
|
893
|
+
default: defaultValue?.[key],
|
|
894
|
+
index: Number(key),
|
|
895
|
+
...config[key],
|
|
896
|
+
};
|
|
897
|
+
// The `group` type generally have no `default`, so we should
|
|
898
|
+
// set the default value manually
|
|
899
|
+
if (item.children && model[key] == null && item.default == null) {
|
|
900
|
+
item.model = model[key] = item._type === 'array' ? [] : {};
|
|
901
|
+
}
|
|
902
|
+
// Generate model by the `default` key of the field config
|
|
903
|
+
if (typeof model === 'object' && model[key] == null) {
|
|
904
|
+
model[key] = item.default;
|
|
905
|
+
}
|
|
906
|
+
// Special judgment on `tabs` type, the `children` key will be ignored if
|
|
907
|
+
// there has a `template` key
|
|
908
|
+
if (item.template) {
|
|
909
|
+
// If model is an array and not empty, the default value of the form field
|
|
910
|
+
// will use the model's value
|
|
911
|
+
if (Array.isArray(item.model) && item.model.length > 0) {
|
|
912
|
+
item.default = item.model;
|
|
913
|
+
}
|
|
914
|
+
if (item.default?.length) {
|
|
915
|
+
item.children = item.default.map((value) => {
|
|
916
|
+
Object.assign(value, item.template?.default);
|
|
917
|
+
return {
|
|
918
|
+
default: value,
|
|
919
|
+
...item.template,
|
|
920
|
+
};
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
item.children = [];
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
if (item._type === 'control') {
|
|
928
|
+
const formState = { value: item.default, disabled: item.disabled };
|
|
929
|
+
if (form instanceof FormGroup) {
|
|
930
|
+
form.registerControl(item.key, new FormControl(formState));
|
|
931
|
+
}
|
|
932
|
+
else if (form instanceof FormArray) {
|
|
933
|
+
form.insert(item.index || form.length, new FormControl(formState), options);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
else if (item._type === 'array') {
|
|
937
|
+
let formArray = new FormArray([]);
|
|
938
|
+
if (form instanceof FormGroup) {
|
|
939
|
+
formArray = form.registerControl(item.key, new FormArray([]));
|
|
940
|
+
}
|
|
941
|
+
else if (form instanceof FormArray) {
|
|
942
|
+
form.insert(item.index || form.length, formArray, options);
|
|
943
|
+
}
|
|
944
|
+
item.children = this.getFormFieldArray(formArray, item.children, item.model, item.default, item.type);
|
|
945
|
+
}
|
|
946
|
+
else if (item._type === 'group') {
|
|
947
|
+
let formGroup = new FormGroup({});
|
|
948
|
+
if (form instanceof FormGroup) {
|
|
949
|
+
formGroup = form.registerControl(item.key, new FormGroup({}));
|
|
950
|
+
}
|
|
951
|
+
else if (form instanceof FormArray) {
|
|
952
|
+
form.insert(item.index || form.length, formGroup, options);
|
|
953
|
+
}
|
|
954
|
+
item.children = this.getFormFieldArray(formGroup, item.children, item.model, item.default, item.type);
|
|
955
|
+
}
|
|
956
|
+
tempArr.push(item);
|
|
957
|
+
}
|
|
958
|
+
return tempArr;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Add a tab item.
|
|
962
|
+
*
|
|
963
|
+
* @param e The mouse event
|
|
964
|
+
* @param form The reactive form instance
|
|
965
|
+
* @param tabs The config of the tabs field
|
|
966
|
+
* @param index The index of the tabs array
|
|
967
|
+
*/
|
|
968
|
+
addTab(e, form, tabs, index) {
|
|
969
|
+
e.stopPropagation();
|
|
970
|
+
const insertIndex = index === void 0 ? tabs.children.length : index + 1;
|
|
971
|
+
// Save the index of the insertion in the config
|
|
972
|
+
tabs.template.index = insertIndex;
|
|
973
|
+
// The key in the object and the index in the array should be the same
|
|
974
|
+
tabs.children.forEach((child, index) => {
|
|
975
|
+
if (index >= insertIndex) {
|
|
976
|
+
child.index += 1;
|
|
977
|
+
child.key = child.index.toString();
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
// The constructed object looks like this `[{ key: 'tab', children: template }]`
|
|
981
|
+
// The key should preferably be `null`
|
|
982
|
+
const newTab = this.getFormFieldArray(form, { [insertIndex]: tabs.template }, {}, null, 'tabs', { emitEvent: true });
|
|
983
|
+
tabs.children.splice(insertIndex, 0, newTab[0]);
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Remove a tab item.
|
|
987
|
+
*
|
|
988
|
+
* @param e The mouse event
|
|
989
|
+
* @param form The reactive form instance
|
|
990
|
+
* @param tabs The config of the tabs field
|
|
991
|
+
* @param index The index of the tabs array
|
|
992
|
+
*/
|
|
993
|
+
removeTab(e, form, tabs, index) {
|
|
994
|
+
e.stopPropagation();
|
|
995
|
+
const removeIndex = index === void 0 ? tabs.children.length - 1 : index;
|
|
996
|
+
tabs.children.forEach((child, index) => {
|
|
997
|
+
if (index > removeIndex) {
|
|
998
|
+
child.index -= 1;
|
|
999
|
+
child.key = child.index.toString();
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
tabs.children.splice(removeIndex, 1);
|
|
1003
|
+
form.removeAt(removeIndex);
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Change the display mode of tabs.
|
|
1007
|
+
*
|
|
1008
|
+
* @param e The mouse event
|
|
1009
|
+
* @param tabs The config of the tabs field
|
|
1010
|
+
* @param mode The display mode of tabs
|
|
1011
|
+
*/
|
|
1012
|
+
changeTabsMode(e, tabs, mode) {
|
|
1013
|
+
e.stopPropagation();
|
|
1014
|
+
tabs.mode = mode;
|
|
1015
|
+
}
|
|
1016
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiForm, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1017
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: GuiForm, selector: "gui-form", inputs: { form: "form", config: "config", model: "model" }, host: { classAttribute: "gui-form" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\">\n <div *ngFor=\"let item of formFields\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: item, formGroup: form}\">\n </ng-template>\n </div>\n</form>\n\n<ng-template #controlType let-item let-parent=\"parent\" let-form=\"formGroup\">\n <ng-container [ngSwitch]=\"item.type\" [formGroup]=\"form\">\n <!-- Text -->\n <gui-field-group *ngSwitchCase=\"'text'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-input-text [formControlName]=\"item.key\" [config]=\"item\"></gui-input-text>\n </gui-field-group>\n <!-- Number -->\n <gui-field-group *ngSwitchCase=\"'number'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-input-number [formControlName]=\"item.key\" [config]=\"item\"></gui-input-number>\n </gui-field-group>\n <!-- Select -->\n <gui-field-group *ngSwitchCase=\"'select'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-select [formControlName]=\"item.key\" [config]=\"item\"></gui-select>\n </gui-field-group>\n <!-- Switch -->\n <gui-field-group *ngSwitchCase=\"'switch'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-switch [formControlName]=\"item.key\" [config]=\"item\"></gui-switch>\n </gui-field-group>\n <!-- Slider -->\n <gui-field-group *ngSwitchCase=\"'slider'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-slider [formControlName]=\"item.key\" [config]=\"item\"></gui-slider>\n </gui-field-group>\n <!-- Button Toggle -->\n <gui-field-group *ngSwitchCase=\"'buttonToggle'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-button-toggle [formControlName]=\"item.key\" [config]=\"item\"></gui-button-toggle>\n </gui-field-group>\n <!-- Fill -->\n <gui-field-group *ngSwitchCase=\"'fill'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-fill [formControlName]=\"item.key\" [config]=\"item\"></gui-fill>\n </gui-field-group>\n <!-- File -->\n <gui-field-group *ngSwitchCase=\"'file'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Image -->\n <gui-field-group *ngSwitchCase=\"'image'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"image\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Video -->\n <gui-field-group *ngSwitchCase=\"'video'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"video\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Audio -->\n <gui-field-group *ngSwitchCase=\"'audio'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"audio\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Image Select -->\n <gui-field-group *ngSwitchCase=\"'imageSelect'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-image-select [formControlName]=\"item.key\" [config]=\"item\"></gui-image-select>\n </gui-field-group>\n <!-- Textarea -->\n <gui-field-group *ngSwitchCase=\"'textarea'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-textarea [formControlName]=\"item.key\" [config]=\"item\"></gui-textarea>\n </gui-field-group>\n <!-- Hidden Input -->\n <input *ngSwitchCase=\"'hidden'\" type=\"hidden\" [formControlName]=\"item.key\">\n\n <!-- Inline Group -->\n <gui-inline-group *ngSwitchCase=\"'inline'\" [config]=\"item\" [formGroupName]=\"item.key\">\n <ng-container *ngFor=\"let child of item.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get(item.key)}\">\n </ng-template>\n </ng-container>\n </gui-inline-group>\n\n <!-- Group -->\n <mat-expansion-panel *ngSwitchCase=\"'group'\" [formGroupName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\"></gui-field-label>\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n <div *ngFor=\"let child of item.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get(item.key)}\">\n </ng-template>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <!-- Tabs -->\n <mat-expansion-panel *ngSwitchCase=\"'tabs'\" [formArrayName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\"></gui-field-label>\n <!-- Show operation buttons after panel opened -->\n <ng-container *ngIf=\"item.expanded\">\n <button mat-icon-button (click)=\"changeTabsMode($event, item, 'nav')\"\n [color]=\"item.mode!=='list'?'primary':''\" type=\"button\">\n <mat-icon svgIcon=\"dots_horizontal\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"changeTabsMode($event, item, 'list')\"\n [color]=\"item.mode==='list'?'primary':''\" type=\"button\">\n <mat-icon svgIcon=\"dots_vertical\"></mat-icon>\n </button>\n <ng-container *ngIf=\"item.template && (item.addable || item.addable===undefined)\">\n <button mat-icon-button (click)=\"addTab($event, form.get(item.key), item)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"plus\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"removeTab($event, form.get(item.key), item)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"delete\"></mat-icon>\n </button>\n </ng-container>\n </ng-container>\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n <!-- Horizontal nav mode -->\n <mat-tab-group *ngIf=\"item.mode!=='list'\" class=\"gui-tabs\"\n [mat-stretch-tabs]=\"false\" disableRipple>\n <mat-tab *ngFor=\"let tab of item.children; index as i\" [disabled]=\"tab.disabled\">\n <ng-template mat-tab-label>\n <div>{{tab.name | ejs:{i} }}</div>\n </ng-template>\n <!-- FormControl & FormArray -->\n <ng-container *ngIf=\"!tab.children || tab.children.length===0 || tab.type==='tabs'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: tab, parent: item, formGroup: form.get([item.key])}\">\n </ng-template>\n </ng-container>\n <!-- FormGroup -->\n <ng-container *ngIf=\"tab.children?.length>0 && tab.type!=='tabs'\">\n <div *ngFor=\"let child of tab.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get([item.key, i])}\">\n </ng-template>\n </div>\n </ng-container>\n </mat-tab>\n </mat-tab-group>\n\n <!-- Vertical list mode -->\n <div class=\"gui-list\" *ngIf=\"item.mode==='list'\">\n <div class=\"gui-list-item\" *ngFor=\"let tab of item.children; index as i\">\n <div class=\"gui-list-item-heading\">\n <span class=\"gui-list-item-title\">{{tab.name | ejs:{i} }}</span>\n <ng-container *ngIf=\"item.template && (item.addable || item.addable===undefined)\">\n <button mat-icon-button (click)=\"addTab($event, form.get(item.key), item, i)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"plus\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"removeTab($event, form.get(item.key), item, i)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"delete\"></mat-icon>\n </button>\n </ng-container>\n </div>\n <div class=\"gui-list-item-content\">\n <!-- FormControl & FormArray -->\n <ng-container *ngIf=\"!tab.children || tab.children.length===0 || tab.type==='tabs'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: tab, parent: item, formGroup: form.get([item.key])}\">\n </ng-template>\n </ng-container>\n <!-- FormGroup -->\n <ng-container *ngIf=\"tab.children?.length>0 && tab.type!=='tabs'\">\n <div *ngFor=\"let child of tab.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get([item.key, i])}\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <!-- Menu -->\n <mat-tab-group class=\"gui-menu\" *ngSwitchCase=\"'menu'\" [formGroupName]=\"item.key\" disableRipple>\n <mat-tab *ngFor=\"let menuChild of item.children\" [label]=\"menuChild.name\"\n [disabled]=\"menuChild.disabled\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"menuChild.type==='menuItem'\">\n <!-- Must wrap with div -->\n <div *ngFor=\"let controlItem of menuChild.children\" [formGroupName]=\"menuChild.key\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: controlItem, formGroup: form.get([item.key, menuChild.key])}\">\n </ng-template>\n </div>\n </ng-container>\n <!-- Support for unlimited nesting -->\n <ng-container *ngIf=\"menuChild.type==='menu'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: menuChild, formGroup: form.get(item.key)}\">\n </ng-template>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </ng-container>\n</ng-template>\n", styles: [".gui-form{--mat-form-field-container-text-size: 12px;--mat-expansion-header-text-size: 12px;--mat-expansion-container-text-size: 12px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 40px;position:relative;font-size:12px}.gui-form .mat-expansion-panel{--mat-expansion-container-shape: 0;box-shadow:none!important}.gui-form .mat-expansion-panel-body{padding:0}.gui-form .mat-expansion-panel-header{padding:0 12px}.gui-form .mat-expansion-panel-header .mat-content{align-items:center;padding-right:8px}.gui-form .mat-expansion-panel-header .mat-content gui-field-label{flex:1}.gui-form .mat-expansion-indicator:after{vertical-align:2px}.gui-form .mat-mdc-tab-header{--mat-tab-header-label-text-size: 12px;--mdc-secondary-navigation-tab-container-height: 24px}.gui-form .mat-mdc-tab{min-width:auto;padding:0 12px}.gui-form .mat-icon{display:inline-flex;justify-content:center;align-items:center;padding:0!important}.gui-form .mat-icon svg{width:14px;height:14px}.gui-form .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 24px;--mdc-icon-button-icon-size: 14px;padding:0}.gui-form .mat-mdc-icon-button .mat-mdc-button-touch-target{width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size)}.gui-form .mat-mdc-text-field-wrapper,.gui-form .mat-mdc-form-field-hint-wrapper{position:relative;padding:0 8px;border-radius:var(--mdc-filled-text-field-container-shape)}.gui-form .mat-mdc-form-field-infix{min-height:auto;padding:0!important}.gui-form .mat-mdc-form-field-hint-spacer,.gui-form .mat-mdc-form-field-bottom-align:before,.gui-form .mdc-line-ripple{display:none}.gui-list-item-heading{display:flex;align-items:center;position:relative;padding:0 12px;line-height:24px}.gui-list-item-heading .gui-list-item-title{flex:1}.gui-list-item-heading:before{position:absolute;left:0;width:2px;height:16px;background-color:var(--mat-expansion-header-text-color);content:\"\"}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i5$3.MatTabContent, selector: "[matTabContent]" }, { kind: "directive", type: i5$3.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i5$3.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i5$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: i6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i6.MatExpansionPanelContent, selector: "ng-template[matExpansionPanelContent]" }, { 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"] }, { kind: "component", type: GuiFieldGroup, selector: "gui-field-group", inputs: ["config"] }, { kind: "component", type: GuiFieldLabel, selector: "gui-field-label", inputs: ["config", "index"] }, { kind: "component", type: GuiInlineGroup, selector: "gui-inline-group", inputs: ["config"] }, { kind: "component", type: GuiImageSelect, selector: "gui-image-select", inputs: ["config", "disabled"] }, { kind: "component", type: GuiTextarea, selector: "gui-textarea", inputs: ["config", "disabled"] }, { kind: "component", type: GuiFileUploader, selector: "gui-file-uploader", inputs: ["type", "name", "accept", "disabled"], outputs: ["fileChange"] }, { kind: "directive", type: GuiFlexDirective, selector: "[flex]", inputs: ["flex"] }, { kind: "pipe", type: GuiEjsPipe, name: "ejs" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1018
|
+
}
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiForm, decorators: [{
|
|
1020
|
+
type: Component,
|
|
1021
|
+
args: [{ selector: 'gui-form', host: {
|
|
1022
|
+
class: 'gui-form',
|
|
1023
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div *ngFor=\"let item of formFields\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: item, formGroup: form}\">\n </ng-template>\n </div>\n</form>\n\n<ng-template #controlType let-item let-parent=\"parent\" let-form=\"formGroup\">\n <ng-container [ngSwitch]=\"item.type\" [formGroup]=\"form\">\n <!-- Text -->\n <gui-field-group *ngSwitchCase=\"'text'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-input-text [formControlName]=\"item.key\" [config]=\"item\"></gui-input-text>\n </gui-field-group>\n <!-- Number -->\n <gui-field-group *ngSwitchCase=\"'number'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-input-number [formControlName]=\"item.key\" [config]=\"item\"></gui-input-number>\n </gui-field-group>\n <!-- Select -->\n <gui-field-group *ngSwitchCase=\"'select'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-select [formControlName]=\"item.key\" [config]=\"item\"></gui-select>\n </gui-field-group>\n <!-- Switch -->\n <gui-field-group *ngSwitchCase=\"'switch'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-switch [formControlName]=\"item.key\" [config]=\"item\"></gui-switch>\n </gui-field-group>\n <!-- Slider -->\n <gui-field-group *ngSwitchCase=\"'slider'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-slider [formControlName]=\"item.key\" [config]=\"item\"></gui-slider>\n </gui-field-group>\n <!-- Button Toggle -->\n <gui-field-group *ngSwitchCase=\"'buttonToggle'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-button-toggle [formControlName]=\"item.key\" [config]=\"item\"></gui-button-toggle>\n </gui-field-group>\n <!-- Fill -->\n <gui-field-group *ngSwitchCase=\"'fill'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-fill [formControlName]=\"item.key\" [config]=\"item\"></gui-fill>\n </gui-field-group>\n <!-- File -->\n <gui-field-group *ngSwitchCase=\"'file'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Image -->\n <gui-field-group *ngSwitchCase=\"'image'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"image\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Video -->\n <gui-field-group *ngSwitchCase=\"'video'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"video\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Audio -->\n <gui-field-group *ngSwitchCase=\"'audio'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-file-uploader type=\"audio\" [formControlName]=\"item.key\"></gui-file-uploader>\n </gui-field-group>\n <!-- Image Select -->\n <gui-field-group *ngSwitchCase=\"'imageSelect'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-image-select [formControlName]=\"item.key\" [config]=\"item\"></gui-image-select>\n </gui-field-group>\n <!-- Textarea -->\n <gui-field-group *ngSwitchCase=\"'textarea'\" [config]=\"item\" [flex]=\"item.col\">\n <gui-textarea [formControlName]=\"item.key\" [config]=\"item\"></gui-textarea>\n </gui-field-group>\n <!-- Hidden Input -->\n <input *ngSwitchCase=\"'hidden'\" type=\"hidden\" [formControlName]=\"item.key\">\n\n <!-- Inline Group -->\n <gui-inline-group *ngSwitchCase=\"'inline'\" [config]=\"item\" [formGroupName]=\"item.key\">\n <ng-container *ngFor=\"let child of item.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get(item.key)}\">\n </ng-template>\n </ng-container>\n </gui-inline-group>\n\n <!-- Group -->\n <mat-expansion-panel *ngSwitchCase=\"'group'\" [formGroupName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\"></gui-field-label>\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n <div *ngFor=\"let child of item.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get(item.key)}\">\n </ng-template>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <!-- Tabs -->\n <mat-expansion-panel *ngSwitchCase=\"'tabs'\" [formArrayName]=\"item.key\"\n [(expanded)]=\"item.expanded\" [disabled]=\"item.disabled\">\n <mat-expansion-panel-header>\n <gui-field-label [config]=\"item\"></gui-field-label>\n <!-- Show operation buttons after panel opened -->\n <ng-container *ngIf=\"item.expanded\">\n <button mat-icon-button (click)=\"changeTabsMode($event, item, 'nav')\"\n [color]=\"item.mode!=='list'?'primary':''\" type=\"button\">\n <mat-icon svgIcon=\"dots_horizontal\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"changeTabsMode($event, item, 'list')\"\n [color]=\"item.mode==='list'?'primary':''\" type=\"button\">\n <mat-icon svgIcon=\"dots_vertical\"></mat-icon>\n </button>\n <ng-container *ngIf=\"item.template && (item.addable || item.addable===undefined)\">\n <button mat-icon-button (click)=\"addTab($event, form.get(item.key), item)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"plus\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"removeTab($event, form.get(item.key), item)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"delete\"></mat-icon>\n </button>\n </ng-container>\n </ng-container>\n </mat-expansion-panel-header>\n <!-- Lazy rendering -->\n <ng-template matExpansionPanelContent>\n <!-- Horizontal nav mode -->\n <mat-tab-group *ngIf=\"item.mode!=='list'\" class=\"gui-tabs\"\n [mat-stretch-tabs]=\"false\" disableRipple>\n <mat-tab *ngFor=\"let tab of item.children; index as i\" [disabled]=\"tab.disabled\">\n <ng-template mat-tab-label>\n <div>{{tab.name | ejs:{i} }}</div>\n </ng-template>\n <!-- FormControl & FormArray -->\n <ng-container *ngIf=\"!tab.children || tab.children.length===0 || tab.type==='tabs'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: tab, parent: item, formGroup: form.get([item.key])}\">\n </ng-template>\n </ng-container>\n <!-- FormGroup -->\n <ng-container *ngIf=\"tab.children?.length>0 && tab.type!=='tabs'\">\n <div *ngFor=\"let child of tab.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get([item.key, i])}\">\n </ng-template>\n </div>\n </ng-container>\n </mat-tab>\n </mat-tab-group>\n\n <!-- Vertical list mode -->\n <div class=\"gui-list\" *ngIf=\"item.mode==='list'\">\n <div class=\"gui-list-item\" *ngFor=\"let tab of item.children; index as i\">\n <div class=\"gui-list-item-heading\">\n <span class=\"gui-list-item-title\">{{tab.name | ejs:{i} }}</span>\n <ng-container *ngIf=\"item.template && (item.addable || item.addable===undefined)\">\n <button mat-icon-button (click)=\"addTab($event, form.get(item.key), item, i)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"plus\"></mat-icon>\n </button>\n <button mat-icon-button (click)=\"removeTab($event, form.get(item.key), item, i)\"\n type=\"button\" [disabled]=\"item.disabled\">\n <mat-icon svgIcon=\"delete\"></mat-icon>\n </button>\n </ng-container>\n </div>\n <div class=\"gui-list-item-content\">\n <!-- FormControl & FormArray -->\n <ng-container *ngIf=\"!tab.children || tab.children.length===0 || tab.type==='tabs'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: tab, parent: item, formGroup: form.get([item.key])}\">\n </ng-template>\n </ng-container>\n <!-- FormGroup -->\n <ng-container *ngIf=\"tab.children?.length>0 && tab.type!=='tabs'\">\n <div *ngFor=\"let child of tab.children\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: child, parent: item, formGroup: form.get([item.key, i])}\">\n </ng-template>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <!-- Menu -->\n <mat-tab-group class=\"gui-menu\" *ngSwitchCase=\"'menu'\" [formGroupName]=\"item.key\" disableRipple>\n <mat-tab *ngFor=\"let menuChild of item.children\" [label]=\"menuChild.name\"\n [disabled]=\"menuChild.disabled\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"menuChild.type==='menuItem'\">\n <!-- Must wrap with div -->\n <div *ngFor=\"let controlItem of menuChild.children\" [formGroupName]=\"menuChild.key\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: controlItem, formGroup: form.get([item.key, menuChild.key])}\">\n </ng-template>\n </div>\n </ng-container>\n <!-- Support for unlimited nesting -->\n <ng-container *ngIf=\"menuChild.type==='menu'\">\n <ng-template [ngTemplateOutlet]=\"controlType\"\n [ngTemplateOutletContext]=\"{$implicit: menuChild, formGroup: form.get(item.key)}\">\n </ng-template>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </ng-container>\n</ng-template>\n", styles: [".gui-form{--mat-form-field-container-text-size: 12px;--mat-expansion-header-text-size: 12px;--mat-expansion-container-text-size: 12px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 40px;position:relative;font-size:12px}.gui-form .mat-expansion-panel{--mat-expansion-container-shape: 0;box-shadow:none!important}.gui-form .mat-expansion-panel-body{padding:0}.gui-form .mat-expansion-panel-header{padding:0 12px}.gui-form .mat-expansion-panel-header .mat-content{align-items:center;padding-right:8px}.gui-form .mat-expansion-panel-header .mat-content gui-field-label{flex:1}.gui-form .mat-expansion-indicator:after{vertical-align:2px}.gui-form .mat-mdc-tab-header{--mat-tab-header-label-text-size: 12px;--mdc-secondary-navigation-tab-container-height: 24px}.gui-form .mat-mdc-tab{min-width:auto;padding:0 12px}.gui-form .mat-icon{display:inline-flex;justify-content:center;align-items:center;padding:0!important}.gui-form .mat-icon svg{width:14px;height:14px}.gui-form .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 24px;--mdc-icon-button-icon-size: 14px;padding:0}.gui-form .mat-mdc-icon-button .mat-mdc-button-touch-target{width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size)}.gui-form .mat-mdc-text-field-wrapper,.gui-form .mat-mdc-form-field-hint-wrapper{position:relative;padding:0 8px;border-radius:var(--mdc-filled-text-field-container-shape)}.gui-form .mat-mdc-form-field-infix{min-height:auto;padding:0!important}.gui-form .mat-mdc-form-field-hint-spacer,.gui-form .mat-mdc-form-field-bottom-align:before,.gui-form .mdc-line-ripple{display:none}.gui-list-item-heading{display:flex;align-items:center;position:relative;padding:0 12px;line-height:24px}.gui-list-item-heading .gui-list-item-title{flex:1}.gui-list-item-heading:before{position:absolute;left:0;width:2px;height:16px;background-color:var(--mat-expansion-header-text-color);content:\"\"}\n"] }]
|
|
1024
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { form: [{
|
|
1025
|
+
type: Input
|
|
1026
|
+
}], config: [{
|
|
1027
|
+
type: Input
|
|
1028
|
+
}], model: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}] } });
|
|
1031
|
+
|
|
1032
|
+
const svgIcons = {
|
|
1033
|
+
dots_horizontal: `
|
|
1034
|
+
<svg viewBox="0 0 24 24">
|
|
1035
|
+
<path d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"></path>
|
|
1036
|
+
</svg>
|
|
1037
|
+
`,
|
|
1038
|
+
dots_vertical: `
|
|
1039
|
+
<svg viewBox="0 0 24 24">
|
|
1040
|
+
<path d="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"></path>
|
|
1041
|
+
</svg>
|
|
1042
|
+
`,
|
|
1043
|
+
plus: `
|
|
1044
|
+
<svg viewBox="0 0 24 24">
|
|
1045
|
+
<path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"></path>
|
|
1046
|
+
</svg>
|
|
1047
|
+
`,
|
|
1048
|
+
delete: `
|
|
1049
|
+
<svg viewBox="0 0 24 24">
|
|
1050
|
+
<path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"></path>
|
|
1051
|
+
</svg>
|
|
1052
|
+
`,
|
|
1053
|
+
link: `
|
|
1054
|
+
<svg viewBox="0 0 24 24">
|
|
1055
|
+
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path>
|
|
1056
|
+
</svg>
|
|
1057
|
+
`,
|
|
1058
|
+
close: `
|
|
1059
|
+
<svg viewBox="0 0 24 24">
|
|
1060
|
+
<path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path>
|
|
1061
|
+
</svg>
|
|
1062
|
+
`,
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
class GuiModule {
|
|
1066
|
+
constructor(iconRegistry, sanitizer) {
|
|
1067
|
+
for (const key of Object.keys(svgIcons)) {
|
|
1068
|
+
iconRegistry.addSvgIconLiteral(key, sanitizer.bypassSecurityTrustHtml(svgIcons[key]));
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiModule, deps: [{ token: i1$2.MatIconRegistry }, { token: i2$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1072
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.8", ngImport: i0, type: GuiModule, declarations: [GuiForm,
|
|
1073
|
+
GuiInputText,
|
|
1074
|
+
GuiInputNumber,
|
|
1075
|
+
GuiSelect,
|
|
1076
|
+
GuiSwitch,
|
|
1077
|
+
GuiSlider,
|
|
1078
|
+
GuiIcon,
|
|
1079
|
+
GuiButtonToggle,
|
|
1080
|
+
GuiFill,
|
|
1081
|
+
GuiFieldGroup,
|
|
1082
|
+
GuiFieldLabel,
|
|
1083
|
+
GuiInlineGroup,
|
|
1084
|
+
GuiImageSelect,
|
|
1085
|
+
GuiTextarea,
|
|
1086
|
+
GuiFileUploader,
|
|
1087
|
+
GuiEjsPipe,
|
|
1088
|
+
GuiFlexDirective], imports: [CommonModule,
|
|
1089
|
+
ReactiveFormsModule,
|
|
1090
|
+
FormsModule,
|
|
1091
|
+
MatFormFieldModule,
|
|
1092
|
+
MatInputModule,
|
|
1093
|
+
MatSelectModule,
|
|
1094
|
+
MatSliderModule,
|
|
1095
|
+
MatSlideToggleModule,
|
|
1096
|
+
MatButtonToggleModule,
|
|
1097
|
+
MatIconModule,
|
|
1098
|
+
MatButtonModule,
|
|
1099
|
+
MatTabsModule,
|
|
1100
|
+
MatExpansionModule,
|
|
1101
|
+
MatTooltipModule,
|
|
1102
|
+
MtxColorpickerModule,
|
|
1103
|
+
MtxSelectModule], exports: [GuiForm,
|
|
1104
|
+
GuiInputText,
|
|
1105
|
+
GuiInputNumber,
|
|
1106
|
+
GuiSelect,
|
|
1107
|
+
GuiSwitch,
|
|
1108
|
+
GuiSlider,
|
|
1109
|
+
GuiIcon,
|
|
1110
|
+
GuiButtonToggle,
|
|
1111
|
+
GuiFill,
|
|
1112
|
+
GuiFieldGroup,
|
|
1113
|
+
GuiFieldLabel,
|
|
1114
|
+
GuiInlineGroup,
|
|
1115
|
+
GuiImageSelect,
|
|
1116
|
+
GuiTextarea,
|
|
1117
|
+
GuiFileUploader,
|
|
1118
|
+
GuiEjsPipe,
|
|
1119
|
+
GuiFlexDirective] }); }
|
|
1120
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiModule, providers: [GuiFileUploaderConfig], imports: [CommonModule,
|
|
1121
|
+
ReactiveFormsModule,
|
|
1122
|
+
FormsModule,
|
|
1123
|
+
MatFormFieldModule,
|
|
1124
|
+
MatInputModule,
|
|
1125
|
+
MatSelectModule,
|
|
1126
|
+
MatSliderModule,
|
|
1127
|
+
MatSlideToggleModule,
|
|
1128
|
+
MatButtonToggleModule,
|
|
1129
|
+
MatIconModule,
|
|
1130
|
+
MatButtonModule,
|
|
1131
|
+
MatTabsModule,
|
|
1132
|
+
MatExpansionModule,
|
|
1133
|
+
MatTooltipModule,
|
|
1134
|
+
MtxColorpickerModule,
|
|
1135
|
+
MtxSelectModule] }); }
|
|
1136
|
+
}
|
|
1137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: GuiModule, decorators: [{
|
|
1138
|
+
type: NgModule,
|
|
1139
|
+
args: [{
|
|
1140
|
+
imports: [
|
|
1141
|
+
CommonModule,
|
|
1142
|
+
ReactiveFormsModule,
|
|
1143
|
+
FormsModule,
|
|
1144
|
+
MatFormFieldModule,
|
|
1145
|
+
MatInputModule,
|
|
1146
|
+
MatSelectModule,
|
|
1147
|
+
MatSliderModule,
|
|
1148
|
+
MatSlideToggleModule,
|
|
1149
|
+
MatButtonToggleModule,
|
|
1150
|
+
MatIconModule,
|
|
1151
|
+
MatButtonModule,
|
|
1152
|
+
MatTabsModule,
|
|
1153
|
+
MatExpansionModule,
|
|
1154
|
+
MatTooltipModule,
|
|
1155
|
+
MtxColorpickerModule,
|
|
1156
|
+
MtxSelectModule,
|
|
1157
|
+
],
|
|
1158
|
+
declarations: [
|
|
1159
|
+
GuiForm,
|
|
1160
|
+
GuiInputText,
|
|
1161
|
+
GuiInputNumber,
|
|
1162
|
+
GuiSelect,
|
|
1163
|
+
GuiSwitch,
|
|
1164
|
+
GuiSlider,
|
|
1165
|
+
GuiIcon,
|
|
1166
|
+
GuiButtonToggle,
|
|
1167
|
+
GuiFill,
|
|
1168
|
+
GuiFieldGroup,
|
|
1169
|
+
GuiFieldLabel,
|
|
1170
|
+
GuiInlineGroup,
|
|
1171
|
+
GuiImageSelect,
|
|
1172
|
+
GuiTextarea,
|
|
1173
|
+
GuiFileUploader,
|
|
1174
|
+
GuiEjsPipe,
|
|
1175
|
+
GuiFlexDirective,
|
|
1176
|
+
],
|
|
1177
|
+
exports: [
|
|
1178
|
+
GuiForm,
|
|
1179
|
+
GuiInputText,
|
|
1180
|
+
GuiInputNumber,
|
|
1181
|
+
GuiSelect,
|
|
1182
|
+
GuiSwitch,
|
|
1183
|
+
GuiSlider,
|
|
1184
|
+
GuiIcon,
|
|
1185
|
+
GuiButtonToggle,
|
|
1186
|
+
GuiFill,
|
|
1187
|
+
GuiFieldGroup,
|
|
1188
|
+
GuiFieldLabel,
|
|
1189
|
+
GuiInlineGroup,
|
|
1190
|
+
GuiImageSelect,
|
|
1191
|
+
GuiTextarea,
|
|
1192
|
+
GuiFileUploader,
|
|
1193
|
+
GuiEjsPipe,
|
|
1194
|
+
GuiFlexDirective,
|
|
1195
|
+
],
|
|
1196
|
+
providers: [GuiFileUploaderConfig],
|
|
1197
|
+
}]
|
|
1198
|
+
}], ctorParameters: function () { return [{ type: i1$2.MatIconRegistry }, { type: i2$2.DomSanitizer }]; } });
|
|
1199
|
+
|
|
1200
|
+
/*
|
|
1201
|
+
* Public API Surface of gui
|
|
1202
|
+
*/
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Generated bundle index. Do not edit.
|
|
1206
|
+
*/
|
|
1207
|
+
|
|
1208
|
+
export { GuiButtonToggle, GuiEjsPipe, GuiFieldGroup, GuiFieldLabel, GuiFileUploader, GuiFileUploaderConfig, GuiFill, GuiFlexDirective, GuiForm, GuiIcon, GuiImageSelect, GuiInlineGroup, GuiInputNumber, GuiInputText, GuiModule, GuiSelect, GuiSlider, GuiSwitch, GuiTextarea, ejsTmpl };
|
|
1209
|
+
//# sourceMappingURL=acrodata-gui.mjs.map
|