kwikid-forms 0.1.18 → 0.1.20
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/bundles/kwikid-forms.umd.js +1182 -463
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/builder/builder.component.js +236 -104
- package/esm2015/lib/builder/builder.module.js +42 -5
- package/esm2015/lib/builder/element-config-editor/editors/basic/radio-config.editor.component.js +302 -0
- package/esm2015/lib/builder/element-config-editor/editors/basic/text-config.editor.component.js +135 -0
- package/esm2015/lib/builder/element-config-editor/editors/basic-element-config.editor.component.js +542 -0
- package/esm2015/lib/builder/element-config-editor/element-config-editor.component.js +89 -0
- package/esm2015/lib/builder/shared/elements.js +44 -0
- package/esm2015/lib/builder/shared/helpers.js +6 -0
- package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +2 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +1 -1
- package/esm2015/lib/renderer/form-view/form-view.component.js +73 -41
- package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +22 -12
- package/esm2015/lib/renderer/renderer.component.js +24 -4
- package/esm2015/lib/renderer/renderer.config-converter.helper.js +6 -6
- package/fesm2015/kwikid-forms.js +1480 -172
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/builder/builder.component.d.ts +21 -53
- package/lib/builder/builder.module.d.ts +9 -4
- package/lib/builder/element-config-editor/editors/basic/radio-config.editor.component.d.ts +25 -0
- package/lib/builder/element-config-editor/editors/basic/text-config.editor.component.d.ts +16 -0
- package/lib/builder/element-config-editor/editors/basic-element-config.editor.component.d.ts +20 -0
- package/lib/builder/element-config-editor/element-config-editor.component.d.ts +20 -0
- package/lib/builder/shared/elements.d.ts +32 -0
- package/lib/builder/shared/helpers.d.ts +1 -0
- package/lib/renderer/form-view/definitions/form-view.actions.definition.d.ts +12 -12
- package/lib/renderer/form-view/definitions/form-view.apis.definition.d.ts +2 -1
- package/lib/renderer/form-view/form-view.component.d.ts +1 -2
- package/package.json +1 -1
package/fesm2015/kwikid-forms.js
CHANGED
|
@@ -1,161 +1,1375 @@
|
|
|
1
|
+
import { __decorate, __awaiter } from 'tslib';
|
|
2
|
+
import * as i4 from '@angular/cdk/drag-drop';
|
|
1
3
|
import { copyArrayItem, moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
2
4
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { FormGroup, FormControl,
|
|
5
|
+
import { EventEmitter, Component, Input, Output, ViewEncapsulation, Pipe, Inject, HostListener, NgModule } from '@angular/core';
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
|
+
import { FormGroup, FormControl, FormArray, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { logMethod, setMissingKeyValue, getObjectFromLocalStorage, isNotEmptyValue, isEmptyValue, checkObjectKeyExists, Source, setValueToObjectPath, Rule, Condition, Action, PATTERNS, Validation, isUndefined, replaceString, getObjectValueFromPath, ESourceKey } from 'kwikid-toolkit';
|
|
6
9
|
import * as i2 from 'kwikui';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
10
|
+
import { KwikUIButtonModule, KwikUIInputModule, KwikUIButtonIconModule, KwikUIModule } from 'kwikui';
|
|
11
|
+
import _ from 'lodash';
|
|
12
|
+
import * as i3 from '@angular/common';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import * as i3$1 from '@taiga-ui/core';
|
|
11
15
|
import { TuiAlertService, TuiLabelModule, TuiSvgModule, TuiLoaderModule } from '@taiga-ui/core';
|
|
12
|
-
import * as i4 from '@taiga-ui/kit';
|
|
16
|
+
import * as i4$1 from '@taiga-ui/kit';
|
|
13
17
|
import { TuiPushService, TuiPushModule } from '@taiga-ui/kit';
|
|
14
|
-
import { checkObjectKeyExists, isNotEmptyValue, Source, setValueToObjectPath, Rule, Condition, Action, isEmptyValue, logMethod, PATTERNS, Validation, isUndefined, replaceString, getObjectValueFromPath } from 'kwikid-toolkit';
|
|
15
18
|
import { pairwise } from 'rxjs/operators';
|
|
16
19
|
import { TuiDay } from '@taiga-ui/cdk';
|
|
17
|
-
import * as
|
|
18
|
-
import { CommonModule } from '@angular/common';
|
|
19
|
-
import * as i1 from '@angular/platform-browser';
|
|
20
|
+
import * as i1$1 from '@angular/platform-browser';
|
|
20
21
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
21
22
|
import * as cloneDeep from 'lodash/cloneDeep';
|
|
22
23
|
import { HttpClientModule } from '@angular/common/http';
|
|
23
24
|
|
|
24
|
-
class
|
|
25
|
+
class Elements {
|
|
25
26
|
constructor() {
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class: "tui-space_right-3 tui-space_bottom-3",
|
|
33
|
-
type: "button",
|
|
34
|
-
appearance: "primary",
|
|
35
|
-
icon: "",
|
|
36
|
-
iconRight: "",
|
|
37
|
-
shape: null,
|
|
38
|
-
size: "m"
|
|
27
|
+
this.commonValidators = {
|
|
28
|
+
max: null,
|
|
29
|
+
maxLength: null,
|
|
30
|
+
min: null,
|
|
31
|
+
minLength: null,
|
|
32
|
+
required: true
|
|
39
33
|
};
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
size: "m",
|
|
44
|
-
value: "2"
|
|
34
|
+
this.commonProperties = {
|
|
35
|
+
placeholder: "",
|
|
36
|
+
readOnly: false
|
|
45
37
|
};
|
|
46
|
-
this.
|
|
47
|
-
|
|
38
|
+
this.commonCore = {
|
|
39
|
+
key: "",
|
|
40
|
+
label: "",
|
|
48
41
|
disabled: false,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
label: "label",
|
|
53
|
-
placeholder: "placeholder",
|
|
54
|
-
type: "text",
|
|
55
|
-
validators: {
|
|
56
|
-
required: true
|
|
42
|
+
messages: [],
|
|
43
|
+
default: {
|
|
44
|
+
value: true
|
|
57
45
|
}
|
|
58
46
|
};
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
this.basic = [
|
|
48
|
+
Object.assign(Object.assign({ elementTitle: "Text", elementType: "text", isElement: true, elementCategory: "basic" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign(Object.assign({}, this.commonProperties), { case: "default" }) }),
|
|
49
|
+
Object.assign(Object.assign({ elementTitle: "Radio", elementType: "radio", isElement: true, elementCategory: "basic" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign(Object.assign({}, this.commonProperties), { orientation: "vertical" }) })
|
|
50
|
+
];
|
|
51
|
+
this.documents = [
|
|
52
|
+
Object.assign(Object.assign({ elementTitle: "Aadhaar Number", elementType: "aadhaar-number", isElement: true, elementCategory: "document" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign(Object.assign({}, this.commonProperties), { mask: "####-####-####" }) })
|
|
53
|
+
];
|
|
54
|
+
this.others = [
|
|
55
|
+
Object.assign(Object.assign({ elementTitle: "Gender", elementType: "gender", isElement: true, elementCategory: "others" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign({}, this.commonProperties) })
|
|
56
|
+
];
|
|
57
|
+
this.templates = [
|
|
58
|
+
Object.assign(Object.assign({ elementTitle: "PAN with NSDL", elementType: "pan_with_nsdl", isElement: true, elementCategory: "template" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign({}, this.commonProperties) })
|
|
59
|
+
];
|
|
60
|
+
this.elementMapping = {
|
|
61
|
+
basic: ["text", "radio"],
|
|
62
|
+
documents: ["aadhaar-number"],
|
|
63
|
+
others: [],
|
|
64
|
+
templates: []
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function revisedRandId() {
|
|
70
|
+
return Math.random()
|
|
71
|
+
.toString(36)
|
|
72
|
+
.replace(/[^a-z]+/g, "");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
class BasicTextConfigEditor {
|
|
76
|
+
constructor() {
|
|
77
|
+
this.saveBasicClickCounter = 0;
|
|
78
|
+
this.elementConfig = {
|
|
79
|
+
properties: {
|
|
80
|
+
case: "default"
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this.updateElement = new EventEmitter();
|
|
84
|
+
this.basicTextFormGroup = undefined;
|
|
85
|
+
}
|
|
86
|
+
ngOnInit() {
|
|
87
|
+
this.createBasicTextFormGroup();
|
|
88
|
+
}
|
|
89
|
+
ngOnChanges(changes) {
|
|
90
|
+
const verifyChange = (key) => {
|
|
91
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
92
|
+
};
|
|
93
|
+
if (verifyChange("elementConfig")) {
|
|
94
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
95
|
+
this.createBasicTextFormGroup();
|
|
96
|
+
}
|
|
97
|
+
if (verifyChange("saveBasicClickCounter")) {
|
|
98
|
+
if (changes.saveBasicClickCounter.previousValue !==
|
|
99
|
+
changes.saveBasicClickCounter.currentValue) {
|
|
100
|
+
this.saveBasicClickCounter = changes.saveBasicClickCounter.currentValue;
|
|
101
|
+
this.handleOnSave();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
createBasicTextFormGroup() {
|
|
106
|
+
this.basicTextFormGroup = new FormGroup({
|
|
107
|
+
properties: new FormGroup({
|
|
108
|
+
case: new FormControl(this.elementConfig.properties.case, {
|
|
109
|
+
updateOn: "change"
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
this.basicTextFormGroup.updateValueAndValidity();
|
|
114
|
+
}
|
|
115
|
+
handleOnSave() {
|
|
116
|
+
let basicElementConfig = this.basicTextFormGroup.getRawValue();
|
|
117
|
+
this.updateElement.emit({
|
|
118
|
+
basicElementConfig: basicElementConfig
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** @nocollapse */ BasicTextConfigEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicTextConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
+
/** @nocollapse */ BasicTextConfigEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BasicTextConfigEditor, selector: "basic-text-config-editor", inputs: { saveBasicClickCounter: "saveBasicClickCounter", elementConfig: "elementConfig" }, outputs: { updateElement: "updateElement" }, usesOnChanges: true, ngImport: i0, template: `
|
|
124
|
+
<form [formGroup]="basicTextFormGroup">
|
|
125
|
+
<fieldset formGroupName="properties">
|
|
126
|
+
<legend>Miscellaneous</legend>
|
|
127
|
+
<div class="form-group">
|
|
128
|
+
<label for="basic-text-config-case">Case</label>
|
|
129
|
+
<select
|
|
130
|
+
class="form-control"
|
|
131
|
+
formControlName="case"
|
|
132
|
+
id="basic-text-config-case"
|
|
133
|
+
>
|
|
134
|
+
<option
|
|
135
|
+
[ngValue]="null"
|
|
136
|
+
disabled
|
|
137
|
+
>Select Case</option
|
|
138
|
+
>
|
|
139
|
+
<option
|
|
140
|
+
*ngFor="let case of ['default', 'upper', 'lower']"
|
|
141
|
+
[ngValue]="case"
|
|
142
|
+
>
|
|
143
|
+
{{ case }}
|
|
144
|
+
</option>
|
|
145
|
+
</select>
|
|
146
|
+
</div>
|
|
147
|
+
</fieldset>
|
|
148
|
+
</form>
|
|
149
|
+
`, isInline: true, styles: [""], directives: [{ type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
150
|
+
__decorate([
|
|
151
|
+
logMethod
|
|
152
|
+
], BasicTextConfigEditor.prototype, "ngOnInit", null);
|
|
153
|
+
__decorate([
|
|
154
|
+
logMethod
|
|
155
|
+
], BasicTextConfigEditor.prototype, "ngOnChanges", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
logMethod
|
|
158
|
+
], BasicTextConfigEditor.prototype, "createBasicTextFormGroup", null);
|
|
159
|
+
__decorate([
|
|
160
|
+
logMethod
|
|
161
|
+
], BasicTextConfigEditor.prototype, "handleOnSave", null);
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicTextConfigEditor, decorators: [{
|
|
163
|
+
type: Component,
|
|
164
|
+
args: [{
|
|
165
|
+
selector: "basic-text-config-editor",
|
|
166
|
+
template: `
|
|
167
|
+
<form [formGroup]="basicTextFormGroup">
|
|
168
|
+
<fieldset formGroupName="properties">
|
|
169
|
+
<legend>Miscellaneous</legend>
|
|
170
|
+
<div class="form-group">
|
|
171
|
+
<label for="basic-text-config-case">Case</label>
|
|
172
|
+
<select
|
|
173
|
+
class="form-control"
|
|
174
|
+
formControlName="case"
|
|
175
|
+
id="basic-text-config-case"
|
|
176
|
+
>
|
|
177
|
+
<option
|
|
178
|
+
[ngValue]="null"
|
|
179
|
+
disabled
|
|
180
|
+
>Select Case</option
|
|
181
|
+
>
|
|
182
|
+
<option
|
|
183
|
+
*ngFor="let case of ['default', 'upper', 'lower']"
|
|
184
|
+
[ngValue]="case"
|
|
185
|
+
>
|
|
186
|
+
{{ case }}
|
|
187
|
+
</option>
|
|
188
|
+
</select>
|
|
189
|
+
</div>
|
|
190
|
+
</fieldset>
|
|
191
|
+
</form>
|
|
192
|
+
`,
|
|
193
|
+
styles: [``]
|
|
194
|
+
}]
|
|
195
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveBasicClickCounter: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], elementConfig: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], updateElement: [{
|
|
200
|
+
type: Output
|
|
201
|
+
}], ngOnInit: [], ngOnChanges: [], createBasicTextFormGroup: [], handleOnSave: [] } });
|
|
202
|
+
|
|
203
|
+
class BasicRadioConfigEditor {
|
|
204
|
+
constructor() {
|
|
205
|
+
this.optionType = {
|
|
206
|
+
label: "",
|
|
207
|
+
disabled: false,
|
|
208
|
+
description: ""
|
|
209
|
+
};
|
|
210
|
+
this.saveBasicClickCounter = 0;
|
|
211
|
+
this.elementConfig = {
|
|
212
|
+
properties: {
|
|
213
|
+
orientation: "horizontal"
|
|
67
214
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
215
|
+
options: []
|
|
216
|
+
};
|
|
217
|
+
this.updateElement = new EventEmitter();
|
|
218
|
+
this.basicRadioFormGroup = undefined;
|
|
219
|
+
}
|
|
220
|
+
ngOnInit() {
|
|
221
|
+
this.createBasicRadioFormGroup();
|
|
222
|
+
}
|
|
223
|
+
ngOnChanges(changes) {
|
|
224
|
+
const verifyChange = (key) => {
|
|
225
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
226
|
+
};
|
|
227
|
+
if (verifyChange("elementConfig")) {
|
|
228
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
229
|
+
this.createBasicRadioFormGroup();
|
|
230
|
+
}
|
|
231
|
+
if (verifyChange("saveBasicClickCounter")) {
|
|
232
|
+
if (changes.saveBasicClickCounter.previousValue !==
|
|
233
|
+
changes.saveBasicClickCounter.currentValue) {
|
|
234
|
+
this.saveBasicClickCounter = changes.saveBasicClickCounter.currentValue;
|
|
235
|
+
this.handleOnSave();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
createBasicRadioFormGroup() {
|
|
240
|
+
let optionsFormArray = [];
|
|
241
|
+
this.elementConfig = setMissingKeyValue(this.elementConfig, "options", [
|
|
242
|
+
this.optionType
|
|
243
|
+
]);
|
|
244
|
+
for (let option of this.elementConfig.options) {
|
|
245
|
+
optionsFormArray.push(this.createOptionConfigFormGroup(option));
|
|
246
|
+
}
|
|
247
|
+
this.basicRadioFormGroup = new FormGroup({
|
|
248
|
+
properties: new FormGroup({
|
|
249
|
+
orientation: new FormControl(this.elementConfig.properties.orientation, {
|
|
250
|
+
updateOn: "change"
|
|
251
|
+
})
|
|
252
|
+
}),
|
|
253
|
+
options: new FormArray(optionsFormArray)
|
|
254
|
+
});
|
|
255
|
+
this.basicRadioFormGroup.updateValueAndValidity();
|
|
256
|
+
}
|
|
257
|
+
handleOnSave() {
|
|
258
|
+
let basicElementConfig = this.basicRadioFormGroup.getRawValue();
|
|
259
|
+
this.updateElement.emit({
|
|
260
|
+
basicElementConfig: basicElementConfig
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
get optionsArray() {
|
|
264
|
+
return this.basicRadioFormGroup.get("options");
|
|
265
|
+
}
|
|
266
|
+
createOptionConfigFormGroup(optionConfig) {
|
|
267
|
+
const optionFormGroup = new FormGroup({
|
|
268
|
+
label: new FormControl(optionConfig.label, {
|
|
269
|
+
updateOn: "change"
|
|
270
|
+
}),
|
|
271
|
+
disabled: new FormControl(optionConfig.disabled, {
|
|
272
|
+
updateOn: "change"
|
|
273
|
+
}),
|
|
274
|
+
description: new FormControl(optionConfig.description, {
|
|
275
|
+
updateOn: "change"
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
return optionFormGroup;
|
|
279
|
+
}
|
|
280
|
+
addOption() {
|
|
281
|
+
const options = this.basicRadioFormGroup.get("options");
|
|
282
|
+
options.push(this.createOptionConfigFormGroup(this.optionType));
|
|
283
|
+
}
|
|
284
|
+
removeOption(optionIndex) {
|
|
285
|
+
const options = this.basicRadioFormGroup.get("options");
|
|
286
|
+
if (options.length > 1) {
|
|
287
|
+
options.removeAt(optionIndex);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
this.addOption();
|
|
291
|
+
// options.reset();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/** @nocollapse */ BasicRadioConfigEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicRadioConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
296
|
+
/** @nocollapse */ BasicRadioConfigEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BasicRadioConfigEditor, selector: "basic-radio-config-editor", inputs: { saveBasicClickCounter: "saveBasicClickCounter", elementConfig: "elementConfig" }, outputs: { updateElement: "updateElement" }, usesOnChanges: true, ngImport: i0, template: `
|
|
297
|
+
<form [formGroup]="basicRadioFormGroup">
|
|
298
|
+
<fieldset formArrayName="options">
|
|
299
|
+
<legend>Options</legend>
|
|
300
|
+
<ng-container
|
|
301
|
+
*ngFor="let option of optionsArray.controls; let i = index"
|
|
302
|
+
>
|
|
303
|
+
<div [formGroupName]="i">
|
|
304
|
+
<div class="form-group">
|
|
305
|
+
<label for="basic-radio-config-placeholder">label</label>
|
|
306
|
+
<input
|
|
307
|
+
class="form-control"
|
|
308
|
+
formControlName="label"
|
|
309
|
+
id="basic-radio-config-placeholder"
|
|
310
|
+
type="text"
|
|
311
|
+
/>
|
|
312
|
+
</div>
|
|
313
|
+
<div class="form-group">
|
|
314
|
+
<label for="basic-radio-config-disabled">disabled</label>
|
|
315
|
+
<select
|
|
316
|
+
class="form-control"
|
|
317
|
+
formControlName="disabled"
|
|
318
|
+
id="basic-radio-config-disabled"
|
|
319
|
+
>
|
|
320
|
+
<option
|
|
321
|
+
[ngValue]="null"
|
|
322
|
+
disabled
|
|
323
|
+
>Select Disability</option
|
|
324
|
+
>
|
|
325
|
+
<option
|
|
326
|
+
*ngFor="let disabled of [true, false]"
|
|
327
|
+
[ngValue]="disabled"
|
|
328
|
+
>
|
|
329
|
+
{{ disabled }}
|
|
330
|
+
</option>
|
|
331
|
+
</select>
|
|
332
|
+
</div>
|
|
333
|
+
<div class="form-group">
|
|
334
|
+
<label for="basic-radio-config-description">description</label>
|
|
335
|
+
<input
|
|
336
|
+
class="form-control"
|
|
337
|
+
formControlName="description"
|
|
338
|
+
id="basic-radio-config-description"
|
|
339
|
+
type="text"
|
|
340
|
+
/>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
<div class="form-array-actions">
|
|
344
|
+
<button (click)="removeOption(i)">Remove</button>
|
|
345
|
+
<button (click)="addOption()">Add</button>
|
|
346
|
+
</div>
|
|
347
|
+
</ng-container>
|
|
348
|
+
</fieldset>
|
|
349
|
+
<fieldset formGroupName="properties">
|
|
350
|
+
<legend>Miscellaneous</legend>
|
|
351
|
+
<div class="form-group">
|
|
352
|
+
<label for="basic-radio-config-orientation">Orientation</label>
|
|
353
|
+
<select
|
|
354
|
+
class="form-control"
|
|
355
|
+
formControlName="orientation"
|
|
356
|
+
id="basic-radio-config-orientation"
|
|
357
|
+
>
|
|
358
|
+
<option
|
|
359
|
+
[ngValue]="null"
|
|
360
|
+
disabled
|
|
361
|
+
>Select Orientation</option
|
|
362
|
+
>
|
|
363
|
+
<option
|
|
364
|
+
*ngFor="let orientation of ['horizontal', 'vertical']"
|
|
365
|
+
[ngValue]="orientation"
|
|
366
|
+
>
|
|
367
|
+
{{ orientation }}
|
|
368
|
+
</option>
|
|
369
|
+
</select>
|
|
370
|
+
</div>
|
|
371
|
+
</fieldset>
|
|
372
|
+
</form>
|
|
373
|
+
`, isInline: true, styles: ["\n .form-array-actions {\n display: flex;\n flex-direction: row;\n align-content: center;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n }\n "], directives: [{ type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
374
|
+
__decorate([
|
|
375
|
+
logMethod
|
|
376
|
+
], BasicRadioConfigEditor.prototype, "ngOnInit", null);
|
|
377
|
+
__decorate([
|
|
378
|
+
logMethod
|
|
379
|
+
], BasicRadioConfigEditor.prototype, "ngOnChanges", null);
|
|
380
|
+
__decorate([
|
|
381
|
+
logMethod
|
|
382
|
+
], BasicRadioConfigEditor.prototype, "createBasicRadioFormGroup", null);
|
|
383
|
+
__decorate([
|
|
384
|
+
logMethod
|
|
385
|
+
], BasicRadioConfigEditor.prototype, "handleOnSave", null);
|
|
386
|
+
__decorate([
|
|
387
|
+
logMethod
|
|
388
|
+
], BasicRadioConfigEditor.prototype, "createOptionConfigFormGroup", null);
|
|
389
|
+
__decorate([
|
|
390
|
+
logMethod
|
|
391
|
+
], BasicRadioConfigEditor.prototype, "addOption", null);
|
|
392
|
+
__decorate([
|
|
393
|
+
logMethod
|
|
394
|
+
], BasicRadioConfigEditor.prototype, "removeOption", null);
|
|
395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicRadioConfigEditor, decorators: [{
|
|
396
|
+
type: Component,
|
|
397
|
+
args: [{
|
|
398
|
+
selector: "basic-radio-config-editor",
|
|
399
|
+
template: `
|
|
400
|
+
<form [formGroup]="basicRadioFormGroup">
|
|
401
|
+
<fieldset formArrayName="options">
|
|
402
|
+
<legend>Options</legend>
|
|
403
|
+
<ng-container
|
|
404
|
+
*ngFor="let option of optionsArray.controls; let i = index"
|
|
405
|
+
>
|
|
406
|
+
<div [formGroupName]="i">
|
|
407
|
+
<div class="form-group">
|
|
408
|
+
<label for="basic-radio-config-placeholder">label</label>
|
|
409
|
+
<input
|
|
410
|
+
class="form-control"
|
|
411
|
+
formControlName="label"
|
|
412
|
+
id="basic-radio-config-placeholder"
|
|
413
|
+
type="text"
|
|
414
|
+
/>
|
|
415
|
+
</div>
|
|
416
|
+
<div class="form-group">
|
|
417
|
+
<label for="basic-radio-config-disabled">disabled</label>
|
|
418
|
+
<select
|
|
419
|
+
class="form-control"
|
|
420
|
+
formControlName="disabled"
|
|
421
|
+
id="basic-radio-config-disabled"
|
|
422
|
+
>
|
|
423
|
+
<option
|
|
424
|
+
[ngValue]="null"
|
|
425
|
+
disabled
|
|
426
|
+
>Select Disability</option
|
|
427
|
+
>
|
|
428
|
+
<option
|
|
429
|
+
*ngFor="let disabled of [true, false]"
|
|
430
|
+
[ngValue]="disabled"
|
|
431
|
+
>
|
|
432
|
+
{{ disabled }}
|
|
433
|
+
</option>
|
|
434
|
+
</select>
|
|
435
|
+
</div>
|
|
436
|
+
<div class="form-group">
|
|
437
|
+
<label for="basic-radio-config-description">description</label>
|
|
438
|
+
<input
|
|
439
|
+
class="form-control"
|
|
440
|
+
formControlName="description"
|
|
441
|
+
id="basic-radio-config-description"
|
|
442
|
+
type="text"
|
|
443
|
+
/>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
446
|
+
<div class="form-array-actions">
|
|
447
|
+
<button (click)="removeOption(i)">Remove</button>
|
|
448
|
+
<button (click)="addOption()">Add</button>
|
|
449
|
+
</div>
|
|
450
|
+
</ng-container>
|
|
451
|
+
</fieldset>
|
|
452
|
+
<fieldset formGroupName="properties">
|
|
453
|
+
<legend>Miscellaneous</legend>
|
|
454
|
+
<div class="form-group">
|
|
455
|
+
<label for="basic-radio-config-orientation">Orientation</label>
|
|
456
|
+
<select
|
|
457
|
+
class="form-control"
|
|
458
|
+
formControlName="orientation"
|
|
459
|
+
id="basic-radio-config-orientation"
|
|
460
|
+
>
|
|
461
|
+
<option
|
|
462
|
+
[ngValue]="null"
|
|
463
|
+
disabled
|
|
464
|
+
>Select Orientation</option
|
|
465
|
+
>
|
|
466
|
+
<option
|
|
467
|
+
*ngFor="let orientation of ['horizontal', 'vertical']"
|
|
468
|
+
[ngValue]="orientation"
|
|
469
|
+
>
|
|
470
|
+
{{ orientation }}
|
|
471
|
+
</option>
|
|
472
|
+
</select>
|
|
473
|
+
</div>
|
|
474
|
+
</fieldset>
|
|
475
|
+
</form>
|
|
476
|
+
`,
|
|
477
|
+
styles: [
|
|
478
|
+
`
|
|
479
|
+
.form-array-actions {
|
|
480
|
+
display: flex;
|
|
481
|
+
flex-direction: row;
|
|
482
|
+
align-content: center;
|
|
483
|
+
justify-content: center;
|
|
484
|
+
align-items: center;
|
|
485
|
+
gap: 1rem;
|
|
486
|
+
}
|
|
487
|
+
`
|
|
488
|
+
]
|
|
489
|
+
}]
|
|
490
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveBasicClickCounter: [{
|
|
491
|
+
type: Input
|
|
492
|
+
}], elementConfig: [{
|
|
493
|
+
type: Input
|
|
494
|
+
}], updateElement: [{
|
|
495
|
+
type: Output
|
|
496
|
+
}], ngOnInit: [], ngOnChanges: [], createBasicRadioFormGroup: [], handleOnSave: [], createOptionConfigFormGroup: [], addOption: [], removeOption: [] } });
|
|
497
|
+
|
|
498
|
+
class BasicElementConfigEditor {
|
|
499
|
+
constructor() {
|
|
500
|
+
this.saveClickCounter = 0;
|
|
501
|
+
this.elementConfig = {
|
|
502
|
+
label: "",
|
|
503
|
+
key: "",
|
|
504
|
+
disabled: false,
|
|
505
|
+
default: {
|
|
506
|
+
value: true
|
|
507
|
+
},
|
|
508
|
+
validators: {
|
|
509
|
+
min: null,
|
|
510
|
+
max: null,
|
|
511
|
+
minLength: null,
|
|
512
|
+
maxLength: null,
|
|
513
|
+
required: true
|
|
73
514
|
},
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
component: KwikUIInputComponent,
|
|
78
|
-
props: this.inputComponent
|
|
515
|
+
properties: {
|
|
516
|
+
placeholder: "",
|
|
517
|
+
readOnly: false
|
|
79
518
|
}
|
|
80
|
-
|
|
81
|
-
this.
|
|
519
|
+
};
|
|
520
|
+
this.updateElement = new EventEmitter();
|
|
521
|
+
this.elementType = "";
|
|
522
|
+
this.saveBasicClickCounter = 0;
|
|
523
|
+
this.basicFormGroup = undefined;
|
|
82
524
|
}
|
|
83
525
|
ngOnInit() {
|
|
84
|
-
|
|
85
|
-
|
|
526
|
+
this.assignVariables();
|
|
527
|
+
this.createBasicFormGroup();
|
|
528
|
+
}
|
|
529
|
+
ngOnChanges(changes) {
|
|
530
|
+
const verifyChange = (key) => {
|
|
531
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
532
|
+
};
|
|
533
|
+
if (verifyChange("elementConfig")) {
|
|
534
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
535
|
+
this.assignVariables();
|
|
536
|
+
this.createBasicFormGroup();
|
|
537
|
+
}
|
|
538
|
+
if (verifyChange("saveClickCounter")) {
|
|
539
|
+
if (changes.saveClickCounter.previousValue !==
|
|
540
|
+
changes.saveClickCounter.currentValue) {
|
|
541
|
+
this.saveClickCounter = changes.saveClickCounter.currentValue;
|
|
542
|
+
this.handleOnSave();
|
|
543
|
+
}
|
|
86
544
|
}
|
|
87
545
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
546
|
+
assignVariables() {
|
|
547
|
+
this.elementType = this.elementConfig.elementType;
|
|
548
|
+
}
|
|
549
|
+
createBasicFormGroup() {
|
|
550
|
+
this.basicFormGroup = new FormGroup({
|
|
551
|
+
label: new FormControl(this.elementConfig.label),
|
|
552
|
+
key: new FormControl(this.elementConfig.key),
|
|
553
|
+
disabled: new FormControl(this.elementConfig.disabled),
|
|
554
|
+
default: new FormGroup({
|
|
555
|
+
value: new FormControl(this.elementConfig.default.value, {
|
|
556
|
+
updateOn: "change"
|
|
557
|
+
})
|
|
558
|
+
}),
|
|
559
|
+
validators: new FormGroup({
|
|
560
|
+
min: new FormControl(this.elementConfig.validators.min, {
|
|
561
|
+
updateOn: "change"
|
|
562
|
+
}),
|
|
563
|
+
minLength: new FormControl(this.elementConfig.validators.minLength, {
|
|
564
|
+
updateOn: "change"
|
|
565
|
+
}),
|
|
566
|
+
max: new FormControl(this.elementConfig.validators.max, {
|
|
567
|
+
updateOn: "change"
|
|
568
|
+
}),
|
|
569
|
+
maxLength: new FormControl(this.elementConfig.validators.maxLength, {
|
|
570
|
+
updateOn: "change"
|
|
571
|
+
}),
|
|
572
|
+
required: new FormControl(this.elementConfig.validators.required, {
|
|
573
|
+
updateOn: "change"
|
|
574
|
+
})
|
|
575
|
+
}),
|
|
576
|
+
properties: new FormGroup({
|
|
577
|
+
placeholder: new FormControl(this.elementConfig.properties.placeholder, {
|
|
578
|
+
updateOn: "change"
|
|
579
|
+
}),
|
|
580
|
+
readOnly: new FormControl(this.elementConfig.properties.readOnly, {
|
|
581
|
+
updateOn: "change"
|
|
582
|
+
})
|
|
583
|
+
})
|
|
584
|
+
});
|
|
585
|
+
this.basicFormGroup.updateValueAndValidity();
|
|
586
|
+
}
|
|
587
|
+
handleOnSaveUpdateElement(event) {
|
|
588
|
+
// Get Common Config
|
|
589
|
+
let basicElementCommonConfig = this.basicFormGroup.getRawValue();
|
|
590
|
+
basicElementCommonConfig.key = basicElementCommonConfig.key.replace(/\s/g, "_");
|
|
591
|
+
// Get Basic Element Config
|
|
592
|
+
const basicElementConfig = event.basicElementConfig;
|
|
593
|
+
this.elementConfig = _.merge(this.elementConfig, basicElementCommonConfig, basicElementConfig);
|
|
594
|
+
this.updateElement.emit({ elementConfig: this.elementConfig });
|
|
595
|
+
}
|
|
596
|
+
handleOnSave() {
|
|
597
|
+
this.saveBasicClickCounter++;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/** @nocollapse */ BasicElementConfigEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicElementConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
601
|
+
/** @nocollapse */ BasicElementConfigEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BasicElementConfigEditor, selector: "basic-element-config-editor", inputs: { saveClickCounter: "saveClickCounter", elementConfig: "elementConfig" }, outputs: { updateElement: "updateElement" }, usesOnChanges: true, ngImport: i0, template: `
|
|
602
|
+
<ng-container *ngIf="elementConfig !== undefined">
|
|
603
|
+
<table>
|
|
604
|
+
<tr>
|
|
605
|
+
<td>Id</td>
|
|
606
|
+
<td>{{ elementConfig.elementId }}</td>
|
|
607
|
+
</tr>
|
|
608
|
+
<tr>
|
|
609
|
+
<td>Type</td>
|
|
610
|
+
<td>{{ elementConfig.elementType }}</td>
|
|
611
|
+
</tr>
|
|
612
|
+
<tr>
|
|
613
|
+
<td>Category</td>
|
|
614
|
+
<td>{{ elementConfig.elementCategory }}</td>
|
|
615
|
+
</tr>
|
|
616
|
+
</table>
|
|
617
|
+
</ng-container>
|
|
618
|
+
<form [formGroup]="basicFormGroup">
|
|
619
|
+
<fieldset>
|
|
620
|
+
<legend>Standard</legend>
|
|
621
|
+
<div class="form-group">
|
|
622
|
+
<label for="basic-field-label">Label</label>
|
|
623
|
+
<input
|
|
624
|
+
type="text"
|
|
625
|
+
class="form-control"
|
|
626
|
+
id="basic-field-label"
|
|
627
|
+
formControlName="label"
|
|
628
|
+
required
|
|
629
|
+
/>
|
|
630
|
+
</div>
|
|
631
|
+
<div class="form-group">
|
|
632
|
+
<label for="basic-field-key">Key</label>
|
|
633
|
+
<input
|
|
634
|
+
type="text"
|
|
635
|
+
class="form-control"
|
|
636
|
+
id="basic-field-key"
|
|
637
|
+
formControlName="key"
|
|
638
|
+
required
|
|
639
|
+
/>
|
|
640
|
+
</div>
|
|
641
|
+
<div class="form-group">
|
|
642
|
+
<label for="basic-input-property-disabled">disabled</label>
|
|
643
|
+
<select
|
|
644
|
+
class="form-control"
|
|
645
|
+
formControlName="disabled"
|
|
646
|
+
id="basic-input-property-disabled"
|
|
647
|
+
>
|
|
648
|
+
<option
|
|
649
|
+
[ngValue]="null"
|
|
650
|
+
disabled
|
|
651
|
+
>Select either true or false</option
|
|
652
|
+
>
|
|
653
|
+
<option
|
|
654
|
+
*ngFor="let disabled of [true, false]"
|
|
655
|
+
[ngValue]="disabled"
|
|
656
|
+
>
|
|
657
|
+
{{ disabled }}
|
|
658
|
+
</option>
|
|
659
|
+
</select>
|
|
660
|
+
</div>
|
|
661
|
+
</fieldset>
|
|
662
|
+
<fieldset formGroupName="default">
|
|
663
|
+
<legend>Default</legend>
|
|
664
|
+
<div class="form-group">
|
|
665
|
+
<label for="basic-input-property-value">value</label>
|
|
666
|
+
<select
|
|
667
|
+
class="form-control"
|
|
668
|
+
formControlName="value"
|
|
669
|
+
id="basic-input-property-value"
|
|
670
|
+
>
|
|
671
|
+
<option
|
|
672
|
+
[ngValue]="null"
|
|
673
|
+
value
|
|
674
|
+
>Select either true or false</option
|
|
675
|
+
>
|
|
676
|
+
<option
|
|
677
|
+
*ngFor="let value of [true, false]"
|
|
678
|
+
[ngValue]="value"
|
|
679
|
+
>
|
|
680
|
+
{{ value }}
|
|
681
|
+
</option>
|
|
682
|
+
</select>
|
|
683
|
+
</div>
|
|
684
|
+
</fieldset>
|
|
685
|
+
<fieldset formGroupName="validators">
|
|
686
|
+
<legend>Validators</legend>
|
|
687
|
+
<div class="form-group">
|
|
688
|
+
<label for="basic-input-validators-min">min</label>
|
|
689
|
+
<input
|
|
690
|
+
class="form-control"
|
|
691
|
+
formControlName="min"
|
|
692
|
+
id="basic-input-validators-min"
|
|
693
|
+
type="number"
|
|
694
|
+
/>
|
|
695
|
+
</div>
|
|
696
|
+
<div class="form-group">
|
|
697
|
+
<label for="basic-input-validators-max">max</label>
|
|
698
|
+
<input
|
|
699
|
+
class="form-control"
|
|
700
|
+
formControlName="max"
|
|
701
|
+
id="basic-input-validators-max"
|
|
702
|
+
type="number"
|
|
703
|
+
/>
|
|
704
|
+
</div>
|
|
705
|
+
<div class="form-group">
|
|
706
|
+
<label for="basic-input-validators-minLength">minLength</label>
|
|
707
|
+
<input
|
|
708
|
+
class="form-control"
|
|
709
|
+
formControlName="minLength"
|
|
710
|
+
id="basic-input-validators-minLength"
|
|
711
|
+
type="number"
|
|
712
|
+
/>
|
|
713
|
+
</div>
|
|
714
|
+
<div class="form-group">
|
|
715
|
+
<label for="basic-input-validators-maxLength">maxLength</label>
|
|
716
|
+
<input
|
|
717
|
+
class="form-control"
|
|
718
|
+
formControlName="maxLength"
|
|
719
|
+
id="basic-input-validators-maxLength"
|
|
720
|
+
type="number"
|
|
721
|
+
/>
|
|
722
|
+
</div>
|
|
723
|
+
<div class="form-group">
|
|
724
|
+
<label for="basic-input-property-required">required</label>
|
|
725
|
+
<select
|
|
726
|
+
class="form-control"
|
|
727
|
+
formControlName="required"
|
|
728
|
+
id="basic-input-property-required"
|
|
729
|
+
>
|
|
730
|
+
<option
|
|
731
|
+
[ngValue]="null"
|
|
732
|
+
disabled
|
|
733
|
+
>Select either true or false</option
|
|
734
|
+
>
|
|
735
|
+
<option
|
|
736
|
+
*ngFor="let required of [true, false]"
|
|
737
|
+
[ngValue]="required"
|
|
738
|
+
>
|
|
739
|
+
{{ required }}
|
|
740
|
+
</option>
|
|
741
|
+
</select>
|
|
742
|
+
</div>
|
|
743
|
+
</fieldset>
|
|
744
|
+
<fieldset formGroupName="properties">
|
|
745
|
+
<legend>Properties</legend>
|
|
746
|
+
<div class="form-group">
|
|
747
|
+
<label for="basic-input-property-placeholder">Placeholder</label>
|
|
748
|
+
<input
|
|
749
|
+
class="form-control"
|
|
750
|
+
formControlName="placeholder"
|
|
751
|
+
id="basic-input-property-placeholder"
|
|
752
|
+
type="text"
|
|
753
|
+
/>
|
|
754
|
+
</div>
|
|
755
|
+
<div class="form-group">
|
|
756
|
+
<label for="basic-input-property-readonly">readOnly</label>
|
|
757
|
+
<select
|
|
758
|
+
class="form-control"
|
|
759
|
+
formControlName="readOnly"
|
|
760
|
+
id="basic-input-property-readonly"
|
|
761
|
+
>
|
|
762
|
+
<option
|
|
763
|
+
[ngValue]="null"
|
|
764
|
+
disabled
|
|
765
|
+
>Select either true or false</option
|
|
766
|
+
>
|
|
767
|
+
<option
|
|
768
|
+
*ngFor="let readonly of [true, false]"
|
|
769
|
+
[ngValue]="readonly"
|
|
770
|
+
>
|
|
771
|
+
{{ readonly }}
|
|
772
|
+
</option>
|
|
773
|
+
</select>
|
|
774
|
+
</div>
|
|
775
|
+
</fieldset>
|
|
776
|
+
<ng-container [ngSwitch]="elementType">
|
|
777
|
+
<ng-container *ngSwitchCase="'text'">
|
|
778
|
+
<basic-text-config-editor
|
|
779
|
+
[saveBasicClickCounter]="saveBasicClickCounter"
|
|
780
|
+
[elementConfig]="elementConfig"
|
|
781
|
+
(updateElement)="handleOnSaveUpdateElement($event)"
|
|
782
|
+
></basic-text-config-editor>
|
|
783
|
+
</ng-container>
|
|
784
|
+
<ng-container *ngSwitchCase="'radio'">
|
|
785
|
+
<basic-radio-config-editor
|
|
786
|
+
[saveBasicClickCounter]="saveBasicClickCounter"
|
|
787
|
+
[elementConfig]="elementConfig"
|
|
788
|
+
(updateElement)="handleOnSaveUpdateElement($event)"
|
|
789
|
+
></basic-radio-config-editor>
|
|
790
|
+
</ng-container>
|
|
791
|
+
</ng-container>
|
|
792
|
+
</form>
|
|
793
|
+
`, isInline: true, styles: ["\n :host {\n display: flex;\n flex-direction: column;\n align-content: center;\n justify-content: flex-start;\n align-items: stretch;\n gap: 1rem;\n }\n "], components: [{ type: BasicTextConfigEditor, selector: "basic-text-config-editor", inputs: ["saveBasicClickCounter", "elementConfig"], outputs: ["updateElement"] }, { type: BasicRadioConfigEditor, selector: "basic-radio-config-editor", inputs: ["saveBasicClickCounter", "elementConfig"], outputs: ["updateElement"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
|
|
794
|
+
__decorate([
|
|
795
|
+
logMethod
|
|
796
|
+
], BasicElementConfigEditor.prototype, "ngOnInit", null);
|
|
797
|
+
__decorate([
|
|
798
|
+
logMethod
|
|
799
|
+
], BasicElementConfigEditor.prototype, "ngOnChanges", null);
|
|
800
|
+
__decorate([
|
|
801
|
+
logMethod
|
|
802
|
+
], BasicElementConfigEditor.prototype, "assignVariables", null);
|
|
803
|
+
__decorate([
|
|
804
|
+
logMethod
|
|
805
|
+
], BasicElementConfigEditor.prototype, "createBasicFormGroup", null);
|
|
806
|
+
__decorate([
|
|
807
|
+
logMethod
|
|
808
|
+
], BasicElementConfigEditor.prototype, "handleOnSaveUpdateElement", null);
|
|
809
|
+
__decorate([
|
|
810
|
+
logMethod
|
|
811
|
+
], BasicElementConfigEditor.prototype, "handleOnSave", null);
|
|
812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BasicElementConfigEditor, decorators: [{
|
|
813
|
+
type: Component,
|
|
814
|
+
args: [{
|
|
815
|
+
selector: "basic-element-config-editor",
|
|
816
|
+
template: `
|
|
817
|
+
<ng-container *ngIf="elementConfig !== undefined">
|
|
818
|
+
<table>
|
|
819
|
+
<tr>
|
|
820
|
+
<td>Id</td>
|
|
821
|
+
<td>{{ elementConfig.elementId }}</td>
|
|
822
|
+
</tr>
|
|
823
|
+
<tr>
|
|
824
|
+
<td>Type</td>
|
|
825
|
+
<td>{{ elementConfig.elementType }}</td>
|
|
826
|
+
</tr>
|
|
827
|
+
<tr>
|
|
828
|
+
<td>Category</td>
|
|
829
|
+
<td>{{ elementConfig.elementCategory }}</td>
|
|
830
|
+
</tr>
|
|
831
|
+
</table>
|
|
832
|
+
</ng-container>
|
|
833
|
+
<form [formGroup]="basicFormGroup">
|
|
834
|
+
<fieldset>
|
|
835
|
+
<legend>Standard</legend>
|
|
836
|
+
<div class="form-group">
|
|
837
|
+
<label for="basic-field-label">Label</label>
|
|
838
|
+
<input
|
|
839
|
+
type="text"
|
|
840
|
+
class="form-control"
|
|
841
|
+
id="basic-field-label"
|
|
842
|
+
formControlName="label"
|
|
843
|
+
required
|
|
844
|
+
/>
|
|
845
|
+
</div>
|
|
846
|
+
<div class="form-group">
|
|
847
|
+
<label for="basic-field-key">Key</label>
|
|
848
|
+
<input
|
|
849
|
+
type="text"
|
|
850
|
+
class="form-control"
|
|
851
|
+
id="basic-field-key"
|
|
852
|
+
formControlName="key"
|
|
853
|
+
required
|
|
854
|
+
/>
|
|
855
|
+
</div>
|
|
856
|
+
<div class="form-group">
|
|
857
|
+
<label for="basic-input-property-disabled">disabled</label>
|
|
858
|
+
<select
|
|
859
|
+
class="form-control"
|
|
860
|
+
formControlName="disabled"
|
|
861
|
+
id="basic-input-property-disabled"
|
|
862
|
+
>
|
|
863
|
+
<option
|
|
864
|
+
[ngValue]="null"
|
|
865
|
+
disabled
|
|
866
|
+
>Select either true or false</option
|
|
867
|
+
>
|
|
868
|
+
<option
|
|
869
|
+
*ngFor="let disabled of [true, false]"
|
|
870
|
+
[ngValue]="disabled"
|
|
871
|
+
>
|
|
872
|
+
{{ disabled }}
|
|
873
|
+
</option>
|
|
874
|
+
</select>
|
|
875
|
+
</div>
|
|
876
|
+
</fieldset>
|
|
877
|
+
<fieldset formGroupName="default">
|
|
878
|
+
<legend>Default</legend>
|
|
879
|
+
<div class="form-group">
|
|
880
|
+
<label for="basic-input-property-value">value</label>
|
|
881
|
+
<select
|
|
882
|
+
class="form-control"
|
|
883
|
+
formControlName="value"
|
|
884
|
+
id="basic-input-property-value"
|
|
885
|
+
>
|
|
886
|
+
<option
|
|
887
|
+
[ngValue]="null"
|
|
888
|
+
value
|
|
889
|
+
>Select either true or false</option
|
|
890
|
+
>
|
|
891
|
+
<option
|
|
892
|
+
*ngFor="let value of [true, false]"
|
|
893
|
+
[ngValue]="value"
|
|
894
|
+
>
|
|
895
|
+
{{ value }}
|
|
896
|
+
</option>
|
|
897
|
+
</select>
|
|
898
|
+
</div>
|
|
899
|
+
</fieldset>
|
|
900
|
+
<fieldset formGroupName="validators">
|
|
901
|
+
<legend>Validators</legend>
|
|
902
|
+
<div class="form-group">
|
|
903
|
+
<label for="basic-input-validators-min">min</label>
|
|
904
|
+
<input
|
|
905
|
+
class="form-control"
|
|
906
|
+
formControlName="min"
|
|
907
|
+
id="basic-input-validators-min"
|
|
908
|
+
type="number"
|
|
909
|
+
/>
|
|
910
|
+
</div>
|
|
911
|
+
<div class="form-group">
|
|
912
|
+
<label for="basic-input-validators-max">max</label>
|
|
913
|
+
<input
|
|
914
|
+
class="form-control"
|
|
915
|
+
formControlName="max"
|
|
916
|
+
id="basic-input-validators-max"
|
|
917
|
+
type="number"
|
|
918
|
+
/>
|
|
919
|
+
</div>
|
|
920
|
+
<div class="form-group">
|
|
921
|
+
<label for="basic-input-validators-minLength">minLength</label>
|
|
922
|
+
<input
|
|
923
|
+
class="form-control"
|
|
924
|
+
formControlName="minLength"
|
|
925
|
+
id="basic-input-validators-minLength"
|
|
926
|
+
type="number"
|
|
927
|
+
/>
|
|
928
|
+
</div>
|
|
929
|
+
<div class="form-group">
|
|
930
|
+
<label for="basic-input-validators-maxLength">maxLength</label>
|
|
931
|
+
<input
|
|
932
|
+
class="form-control"
|
|
933
|
+
formControlName="maxLength"
|
|
934
|
+
id="basic-input-validators-maxLength"
|
|
935
|
+
type="number"
|
|
936
|
+
/>
|
|
937
|
+
</div>
|
|
938
|
+
<div class="form-group">
|
|
939
|
+
<label for="basic-input-property-required">required</label>
|
|
940
|
+
<select
|
|
941
|
+
class="form-control"
|
|
942
|
+
formControlName="required"
|
|
943
|
+
id="basic-input-property-required"
|
|
944
|
+
>
|
|
945
|
+
<option
|
|
946
|
+
[ngValue]="null"
|
|
947
|
+
disabled
|
|
948
|
+
>Select either true or false</option
|
|
949
|
+
>
|
|
950
|
+
<option
|
|
951
|
+
*ngFor="let required of [true, false]"
|
|
952
|
+
[ngValue]="required"
|
|
953
|
+
>
|
|
954
|
+
{{ required }}
|
|
955
|
+
</option>
|
|
956
|
+
</select>
|
|
957
|
+
</div>
|
|
958
|
+
</fieldset>
|
|
959
|
+
<fieldset formGroupName="properties">
|
|
960
|
+
<legend>Properties</legend>
|
|
961
|
+
<div class="form-group">
|
|
962
|
+
<label for="basic-input-property-placeholder">Placeholder</label>
|
|
963
|
+
<input
|
|
964
|
+
class="form-control"
|
|
965
|
+
formControlName="placeholder"
|
|
966
|
+
id="basic-input-property-placeholder"
|
|
967
|
+
type="text"
|
|
968
|
+
/>
|
|
969
|
+
</div>
|
|
970
|
+
<div class="form-group">
|
|
971
|
+
<label for="basic-input-property-readonly">readOnly</label>
|
|
972
|
+
<select
|
|
973
|
+
class="form-control"
|
|
974
|
+
formControlName="readOnly"
|
|
975
|
+
id="basic-input-property-readonly"
|
|
976
|
+
>
|
|
977
|
+
<option
|
|
978
|
+
[ngValue]="null"
|
|
979
|
+
disabled
|
|
980
|
+
>Select either true or false</option
|
|
981
|
+
>
|
|
982
|
+
<option
|
|
983
|
+
*ngFor="let readonly of [true, false]"
|
|
984
|
+
[ngValue]="readonly"
|
|
985
|
+
>
|
|
986
|
+
{{ readonly }}
|
|
987
|
+
</option>
|
|
988
|
+
</select>
|
|
989
|
+
</div>
|
|
990
|
+
</fieldset>
|
|
991
|
+
<ng-container [ngSwitch]="elementType">
|
|
992
|
+
<ng-container *ngSwitchCase="'text'">
|
|
993
|
+
<basic-text-config-editor
|
|
994
|
+
[saveBasicClickCounter]="saveBasicClickCounter"
|
|
995
|
+
[elementConfig]="elementConfig"
|
|
996
|
+
(updateElement)="handleOnSaveUpdateElement($event)"
|
|
997
|
+
></basic-text-config-editor>
|
|
998
|
+
</ng-container>
|
|
999
|
+
<ng-container *ngSwitchCase="'radio'">
|
|
1000
|
+
<basic-radio-config-editor
|
|
1001
|
+
[saveBasicClickCounter]="saveBasicClickCounter"
|
|
1002
|
+
[elementConfig]="elementConfig"
|
|
1003
|
+
(updateElement)="handleOnSaveUpdateElement($event)"
|
|
1004
|
+
></basic-radio-config-editor>
|
|
1005
|
+
</ng-container>
|
|
1006
|
+
</ng-container>
|
|
1007
|
+
</form>
|
|
1008
|
+
`,
|
|
1009
|
+
styles: [
|
|
1010
|
+
`
|
|
1011
|
+
:host {
|
|
1012
|
+
display: flex;
|
|
1013
|
+
flex-direction: column;
|
|
1014
|
+
align-content: center;
|
|
1015
|
+
justify-content: flex-start;
|
|
1016
|
+
align-items: stretch;
|
|
1017
|
+
gap: 1rem;
|
|
1018
|
+
}
|
|
1019
|
+
`
|
|
1020
|
+
]
|
|
1021
|
+
}]
|
|
1022
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveClickCounter: [{
|
|
1023
|
+
type: Input
|
|
1024
|
+
}], elementConfig: [{
|
|
1025
|
+
type: Input
|
|
1026
|
+
}], updateElement: [{
|
|
1027
|
+
type: Output
|
|
1028
|
+
}], ngOnInit: [], ngOnChanges: [], assignVariables: [], createBasicFormGroup: [], handleOnSaveUpdateElement: [], handleOnSave: [] } });
|
|
1029
|
+
|
|
1030
|
+
class ElementConfigEditor {
|
|
1031
|
+
constructor() {
|
|
1032
|
+
this.formKey = "";
|
|
1033
|
+
this.elementConfig = undefined;
|
|
1034
|
+
this.updateElement = new EventEmitter();
|
|
1035
|
+
this.elementType = "";
|
|
1036
|
+
this.elementCategory = "";
|
|
1037
|
+
this.elementEditorFormGroup = undefined;
|
|
1038
|
+
this.saveClickCounter = 0;
|
|
1039
|
+
}
|
|
1040
|
+
ngOnInit() { }
|
|
1041
|
+
ngOnChanges(changes) {
|
|
1042
|
+
const verifyChange = (key) => {
|
|
1043
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
1044
|
+
};
|
|
1045
|
+
if (verifyChange("formKey")) {
|
|
1046
|
+
this.formKey = changes.formKey.currentValue;
|
|
1047
|
+
}
|
|
1048
|
+
if (verifyChange("elementConfig")) {
|
|
1049
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
1050
|
+
if (this.elementConfig !== undefined) {
|
|
1051
|
+
this.elementType = this.elementConfig.elementType;
|
|
1052
|
+
this.elementCategory = this.elementConfig.elementCategory;
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
throw new Error("'elementConfig' doesn't have 'elementType'");
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
updateFormGroup() {
|
|
1060
|
+
this.elementEditorFormGroup = new FormGroup({
|
|
1061
|
+
properties: new FormGroup({
|
|
1062
|
+
orientation: new FormControl(this.elementConfig.properties.orientation, {
|
|
1063
|
+
updateOn: "change"
|
|
1064
|
+
})
|
|
1065
|
+
})
|
|
1066
|
+
});
|
|
1067
|
+
this.elementEditorFormGroup.updateValueAndValidity();
|
|
1068
|
+
}
|
|
1069
|
+
handleOnSaveUpdateElement(event) {
|
|
1070
|
+
this.updateElement.emit(event);
|
|
1071
|
+
}
|
|
1072
|
+
handleOnClickSave() {
|
|
1073
|
+
this.saveClickCounter++;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
/** @nocollapse */ ElementConfigEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementConfigEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1077
|
+
/** @nocollapse */ ElementConfigEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementConfigEditor, selector: "element-config-editor", inputs: { formKey: "formKey", elementConfig: "elementConfig" }, outputs: { updateElement: "updateElement" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"container\" *ngIf=\"elementConfig\">\n <div class=\"element-config-editor-header\">\n '{{ elementConfig.elementType }}' Element Config Editor\n </div>\n <div class=\"element-config-editor-body\"\n ><ng-container [ngSwitch]=\"elementCategory\">\n <!-- Basic -->\n <ng-container *ngSwitchCase=\"'basic'\">\n <basic-element-config-editor\n [saveClickCounter]=\"saveClickCounter\"\n [elementConfig]=\"elementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></basic-element-config-editor>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"element-config-editor-footer\">\n <button\n class=\"save-button\"\n type=\"submit\"\n (click)=\"handleOnClickSave()\"\n >\n Save\n </button></div\n >\n</div>\n", styles: ["form{display:flex;align-content:center;justify-content:flex-start;flex:1;flex-direction:column;align-items:stretch;grid-gap:1rem;gap:1rem}.form-group{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-gap:.25rem;gap:.25rem}.container{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-gap:1rem;gap:1rem}.container .element-config-editor-footer{display:flex;flex-direction:row;align-items:center;justify-content:center;align-content:center;grid-gap:1rem;gap:1rem}\n", "kwikid-forms-builder button{align-content:center;align-items:center;background:black;border-color:transparent;box-shadow:0 2px 10px -6px #000;border-radius:1rem;color:#fff;cursor:pointer;display:flex;flex-direction:row;justify-content:center;padding:.5rem;transform:scale(1);transition:.05s ease-in}kwikid-forms-builder button:hover{box-shadow:0 2px 10px -5px #000}kwikid-forms-builder button:active{transform:scale(.98);transition:.05s ease-out}kwikid-forms-builder fieldset{display:flex;flex-direction:column;justify-content:center;align-items:stretch;align-content:center;grid-gap:.5rem;gap:.5rem;padding:.5rem 1rem 1rem;box-shadow:0 2px 10px -6px #000;border:1px solid gray}kwikid-forms-builder input,kwikid-forms-builder select{flex:1;width:100%;border:1px solid black;outline:none;padding:.25rem;overflow-x:auto}kwikid-forms-builder table,kwikid-forms-builder tr,kwikid-forms-builder td{border:1px solid black;padding:.5rem 1rem}\n"], components: [{ type: BasicElementConfigEditor, selector: "basic-element-config-editor", inputs: ["saveClickCounter", "elementConfig"], outputs: ["updateElement"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1078
|
+
__decorate([
|
|
1079
|
+
logMethod
|
|
1080
|
+
], ElementConfigEditor.prototype, "ngOnInit", null);
|
|
1081
|
+
__decorate([
|
|
1082
|
+
logMethod
|
|
1083
|
+
], ElementConfigEditor.prototype, "ngOnChanges", null);
|
|
1084
|
+
__decorate([
|
|
1085
|
+
logMethod
|
|
1086
|
+
], ElementConfigEditor.prototype, "updateFormGroup", null);
|
|
1087
|
+
__decorate([
|
|
1088
|
+
logMethod
|
|
1089
|
+
], ElementConfigEditor.prototype, "handleOnSaveUpdateElement", null);
|
|
1090
|
+
__decorate([
|
|
1091
|
+
logMethod
|
|
1092
|
+
], ElementConfigEditor.prototype, "handleOnClickSave", null);
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementConfigEditor, decorators: [{
|
|
1094
|
+
type: Component,
|
|
1095
|
+
args: [{
|
|
1096
|
+
selector: "element-config-editor",
|
|
1097
|
+
templateUrl: "./element-config-editor.component.html",
|
|
1098
|
+
styleUrls: [
|
|
1099
|
+
"./element-config-editor.component.scss",
|
|
1100
|
+
"../shared/shared.scss"
|
|
1101
|
+
],
|
|
1102
|
+
encapsulation: ViewEncapsulation.None
|
|
1103
|
+
}]
|
|
1104
|
+
}], ctorParameters: function () { return []; }, propDecorators: { formKey: [{
|
|
1105
|
+
type: Input
|
|
1106
|
+
}], elementConfig: [{
|
|
1107
|
+
type: Input
|
|
1108
|
+
}], updateElement: [{
|
|
1109
|
+
type: Output
|
|
1110
|
+
}], ngOnInit: [], ngOnChanges: [], updateFormGroup: [], handleOnSaveUpdateElement: [], handleOnClickSave: [] } });
|
|
1111
|
+
|
|
1112
|
+
class KwikIDFormsBuilderComponent {
|
|
1113
|
+
constructor() {
|
|
1114
|
+
this.formKey = "";
|
|
1115
|
+
this.formTitle = "";
|
|
1116
|
+
this.builderFormGroup = undefined;
|
|
1117
|
+
this.basicElements = new Elements().basic;
|
|
1118
|
+
this.documentElements = new Elements().documents;
|
|
1119
|
+
this.otherElements = new Elements().others;
|
|
1120
|
+
this.templateElements = new Elements().templates;
|
|
1121
|
+
this.elementsMapping = new Elements().elementMapping;
|
|
1122
|
+
this.formElementsDragList = [];
|
|
1123
|
+
this.formElementsDropList = [];
|
|
1124
|
+
this.elementEditorElementConfig = undefined;
|
|
1125
|
+
this.builderFormGroup = new FormGroup({
|
|
1126
|
+
formKey: new FormControl("", [Validators.required]),
|
|
1127
|
+
formTitle: new FormControl("", [Validators.required])
|
|
1128
|
+
});
|
|
1129
|
+
const formDropConfig = getObjectFromLocalStorage("formDropConfig");
|
|
1130
|
+
if (isNotEmptyValue(formDropConfig)) {
|
|
1131
|
+
this.formKey = formDropConfig.key;
|
|
1132
|
+
this.formTitle = formDropConfig.title;
|
|
1133
|
+
const formFields = formDropConfig.fields.map((item) => {
|
|
1134
|
+
item.elementId = revisedRandId();
|
|
1135
|
+
item.elementCategory = this.elementsMapping.basic.includes(item.type)
|
|
1136
|
+
? "basic"
|
|
1137
|
+
: this.elementsMapping.documents.includes(item.type)
|
|
1138
|
+
? "document"
|
|
1139
|
+
: "others";
|
|
1140
|
+
item.elementType =
|
|
1141
|
+
item.elementCategory === "basic" ||
|
|
1142
|
+
item.elementCategory === "document"
|
|
1143
|
+
? item.type
|
|
1144
|
+
: String(`NA<>${item.type}`);
|
|
1145
|
+
item.isElement = true;
|
|
1146
|
+
const elementFiltered = item.elementCategory === "basic"
|
|
1147
|
+
? this.basicElements.find((element) => element.elementType === item.type)
|
|
1148
|
+
: item.elementCategory === "document"
|
|
1149
|
+
? this.documentElements.find((element) => element.elementType === item.type)
|
|
1150
|
+
: item.elementCategory === "others"
|
|
1151
|
+
? this.otherElements.find((element) => element.elementType === item.type)
|
|
1152
|
+
: undefined;
|
|
1153
|
+
console.log(elementFiltered);
|
|
1154
|
+
item.elementTitle = isEmptyValue(elementFiltered)
|
|
1155
|
+
? item.elementCategory + "::" + item.elementType
|
|
1156
|
+
: elementFiltered.elementTitle;
|
|
1157
|
+
return item;
|
|
1158
|
+
});
|
|
1159
|
+
this.formElementsDropList = formFields;
|
|
1160
|
+
console.log(formFields);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
ngOnInit() {
|
|
1164
|
+
this.formElementsDragList = [
|
|
1165
|
+
{ isElement: false, elementTitle: "Basic Elements" },
|
|
1166
|
+
...this.basicElements,
|
|
1167
|
+
{ isElement: false, elementTitle: "Document Elements" },
|
|
1168
|
+
...this.documentElements,
|
|
1169
|
+
{ isElement: false, elementTitle: "Other Elements" },
|
|
1170
|
+
...this.otherElements
|
|
1171
|
+
];
|
|
1172
|
+
for (let formElementsDragItem of this.formElementsDragList) {
|
|
1173
|
+
formElementsDragItem.elementId = revisedRandId();
|
|
1174
|
+
}
|
|
92
1175
|
}
|
|
93
1176
|
handleOnChange(event, id, key, idx) {
|
|
94
1177
|
const _value = event.target.value;
|
|
95
|
-
this.formGroup.controls[id]["controls"][key].patchValue(_value);
|
|
96
1178
|
}
|
|
97
|
-
|
|
98
|
-
|
|
1179
|
+
// DOM Event Handlers
|
|
1180
|
+
handleGetKeyValue(e) {
|
|
1181
|
+
this.builderFormGroup.patchValue({
|
|
1182
|
+
[e.key]: e.value
|
|
1183
|
+
}, { emitEvent: false });
|
|
99
1184
|
}
|
|
100
|
-
drop(event) {
|
|
1185
|
+
drop(event, elementCategory) {
|
|
101
1186
|
// let item = JSON.parse(JSON.stringify(event));
|
|
102
1187
|
if (event.previousContainer !== event.container) {
|
|
103
1188
|
console.log("copying");
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1189
|
+
if (event.item.data.isElement) {
|
|
1190
|
+
// Clone the item that was dropped.
|
|
1191
|
+
const draggedItemIndex = this.formElementsDragList.findIndex((item) => {
|
|
1192
|
+
return item.elementId === event.item.data.elementId;
|
|
1193
|
+
});
|
|
1194
|
+
copyArrayItem(this.formElementsDragList, this.formElementsDropList, draggedItemIndex, event.currentIndex);
|
|
1195
|
+
this.formElementsDragList = JSON.parse(JSON.stringify(this.formElementsDragList.map((item) => {
|
|
1196
|
+
item.elementId = revisedRandId();
|
|
1197
|
+
return item;
|
|
1198
|
+
})));
|
|
1199
|
+
}
|
|
115
1200
|
}
|
|
116
1201
|
else {
|
|
117
1202
|
console.log("moving");
|
|
118
1203
|
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
119
1204
|
}
|
|
120
|
-
if (event.previousContainer.data) {
|
|
121
|
-
this.menu = this.menu.filter((f) => !f.temp);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exited(event) {
|
|
125
|
-
const currentIdx = event.container.data.findIndex((f) => f.id === event.item.data.id);
|
|
126
|
-
this.menu.splice(currentIdx + 1, 0, Object.assign(Object.assign({}, event.item.data), { temp: true }));
|
|
127
|
-
}
|
|
128
|
-
entered() {
|
|
129
|
-
this.menu = this.menu.filter((f) => !f.temp);
|
|
130
1205
|
}
|
|
131
|
-
|
|
132
|
-
|
|
1206
|
+
exit(event, elementCategory) { }
|
|
1207
|
+
enter(event, elementCategory) { }
|
|
1208
|
+
/** Predicate function that only allows isElement: true items to be dropped into a list. */
|
|
1209
|
+
isElementPredicate(item) {
|
|
1210
|
+
return item.data.isElement;
|
|
133
1211
|
}
|
|
134
1212
|
removeElement(idx, id) {
|
|
135
|
-
this.
|
|
136
|
-
this.table.splice(idx, 1);
|
|
1213
|
+
this.formElementsDropList.splice(idx, 1);
|
|
137
1214
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
1215
|
+
editElement(idx, item) {
|
|
1216
|
+
this.elementEditorElementConfig = item;
|
|
1217
|
+
}
|
|
1218
|
+
handleOnSaveUpdateElement(event) { }
|
|
1219
|
+
handleOnClickSaveForms(event) {
|
|
1220
|
+
if (isEmptyValue(this.formKey)) {
|
|
1221
|
+
window.alert("Please provide Form Key");
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
else {
|
|
1225
|
+
this.formKey = this.formKey.replace(/\s/g, "_").toLocaleUpperCase();
|
|
1226
|
+
}
|
|
1227
|
+
if (isEmptyValue(this.formTitle)) {
|
|
1228
|
+
window.alert("Please provide Form Title");
|
|
1229
|
+
return;
|
|
141
1230
|
}
|
|
142
|
-
|
|
1231
|
+
let finalFields = JSON.parse(JSON.stringify(this.formElementsDropList));
|
|
1232
|
+
finalFields = finalFields.map((item) => {
|
|
1233
|
+
if (item.elementType.startsWith("NA<>", 0)) {
|
|
1234
|
+
delete item.elementId;
|
|
1235
|
+
delete item.elementType;
|
|
1236
|
+
delete item.elementTitle;
|
|
1237
|
+
delete item.elementCategory;
|
|
1238
|
+
delete item.isElement;
|
|
1239
|
+
return item;
|
|
1240
|
+
}
|
|
1241
|
+
delete item.elementId;
|
|
1242
|
+
delete item.elementType;
|
|
1243
|
+
delete item.elementTitle;
|
|
1244
|
+
delete item.elementCategory;
|
|
1245
|
+
delete item.isElement;
|
|
1246
|
+
if (item.default.value) {
|
|
1247
|
+
item.default = {
|
|
1248
|
+
value: {
|
|
1249
|
+
is_found: false,
|
|
1250
|
+
value: "",
|
|
1251
|
+
sources: [
|
|
1252
|
+
{
|
|
1253
|
+
key: "OBJECT",
|
|
1254
|
+
props: {
|
|
1255
|
+
object: {
|
|
1256
|
+
key: "ALL_FORMS_DATA",
|
|
1257
|
+
path: String(`$.${this.formKey}.${item.key}`)
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
value: "",
|
|
1261
|
+
validation: {
|
|
1262
|
+
is_valid: false,
|
|
1263
|
+
triggers: ["ON_INIT"],
|
|
1264
|
+
rules: [
|
|
1265
|
+
{
|
|
1266
|
+
id: "1",
|
|
1267
|
+
key: "VALUE_CHECK",
|
|
1268
|
+
props: {
|
|
1269
|
+
value: {
|
|
1270
|
+
source: {
|
|
1271
|
+
key: "OBJECT",
|
|
1272
|
+
props: {
|
|
1273
|
+
object: {
|
|
1274
|
+
key: "ALL_FORMS_DATA",
|
|
1275
|
+
path: String(`$.${this.formKey}.${item.key}`)
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
pattern: { key: "IS_NOT_EMPTY" }
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
],
|
|
1284
|
+
actions: [
|
|
1285
|
+
{
|
|
1286
|
+
id: "1",
|
|
1287
|
+
key: "SET_FIELD_DEFAULT_VALUE",
|
|
1288
|
+
condition: "1",
|
|
1289
|
+
props: {
|
|
1290
|
+
fieldKey: String(`${item.key}`),
|
|
1291
|
+
value: {
|
|
1292
|
+
source: {
|
|
1293
|
+
key: "OBJECT",
|
|
1294
|
+
props: {
|
|
1295
|
+
object: {
|
|
1296
|
+
key: "ALL_FORMS_DATA",
|
|
1297
|
+
path: String(`$.${this.formKey}.${item.key}`)
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
]
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
]
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
else {
|
|
1312
|
+
item.default = {
|
|
1313
|
+
value: {
|
|
1314
|
+
is_found: false,
|
|
1315
|
+
value: "",
|
|
1316
|
+
sources: []
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
return item;
|
|
1321
|
+
});
|
|
1322
|
+
const finalFormConfig = {
|
|
1323
|
+
key: this.formKey,
|
|
1324
|
+
title: this.formTitle,
|
|
1325
|
+
fields: finalFields
|
|
1326
|
+
};
|
|
1327
|
+
localStorage.setItem("rendererFormConfig", JSON.stringify(finalFormConfig));
|
|
1328
|
+
localStorage.setItem("builderFormConfig", JSON.stringify({
|
|
1329
|
+
key: this.formKey,
|
|
1330
|
+
title: this.formTitle,
|
|
1331
|
+
fields: this.formElementsDropList
|
|
1332
|
+
}));
|
|
1333
|
+
console.log(finalFormConfig);
|
|
1334
|
+
console.log(this.formElementsDropList);
|
|
143
1335
|
}
|
|
144
1336
|
}
|
|
145
1337
|
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
146
|
-
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", ngImport: i0, template: "<!-- <div>{{ name }}</div>\n<p>Start editing to see some magic happen :)</p>\n\n<button (click)=\"getJSON()\">Get JSON</button>\n\n<div class=\"drap-copy\">\n <div>\n <ul\n class=\"menu\"\n cdkDropList\n #menuList=\"cdkDropList\"\n [cdkDropListData]=\"menu\"\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"[tableList]\"\n (cdkDropListDropped)=\"drop($event)\"\n (cdkDropListExited)=\"exited($event)\"\n (cdkDropListEntered)=\"entered()\"\n >\n <li class=\"item\" *ngFor=\"let item of menu\" cdkDrag [cdkDragData]=\"item\">\n <div class=\"item\" *cdkDragPlaceholder>\n <a>{{ item.title }}</a>\n </div>\n <ng-container *ngComponentOutlet=\"item.component\"> </ng-container>\n </li>\n </ul>\n </div>\n\n <div\n class=\"table\"\n cdkDropList\n #tableList=\"cdkDropList\"\n [cdkDropListData]=\"table\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n <div class=\"content\">\n <div>\n <div class=\"item\" *ngFor=\"let item of table; let idx = index\" cdkDrag>\n <ng-container *ngComponentOutlet=\"item.component\"> </ng-container>\n <div class=\"item-header\">\n <p>{{ idx }}--{{ item.title }}</p>\n <button (click)=\"removeElement(idx, item.id)\">Remove</button>\n </div>\n <div class=\"desc\">\n <div>id - {{ item.id }}</div>\n <div>key - {{ item.key }}</div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"formModal; context: item\"\n ></ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>\n<ng-template #formModal let-component=\"component\" let-props=\"props\" let-id=\"id\">\n <div class=\"field_editor\">\n <div *ngFor=\"let i of props | keyvalue; let idx = index\">\n <div class=\"formModalInputGroup\">\n <label>{{ i.key }}</label>\n <input\n value=\"{{ i.value }}\"\n (keyup)=\"handleOnChange($event, id, i.key, idx)\"\n />\n </div>\n </div>\n </div>\n</ng-template> -->\n", styles: [":host{--padding: 1rem;--border: 1px solid #e8e8e8}ul,li{list-style:none}*{margin:0;padding:0}p{font-family:Lato}.item{margin-bottom:12px;padding:var(--padding);border:var(--border);background:#fff;cursor:move;display:flex;flex-direction:column;grid-row-gap:.5rem;row-gap:.5rem}.item-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;grid-column-gap:.5rem;column-gap:.5rem}.table,.menu{padding:var(--padding)}.drap-copy{display:flex;border:var(--border)}.drap-copy>div{flex:1}.drap-copy>div:first-child{border-right:var(--border)}.desc{display:flex;justify-content:space-between;font-size:1em;color:#00000073}.field_editor{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;align-content:center;grid-row-gap:.5rem;row-gap:.5rem}.formModalInputGroup{display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;grid-column-gap:.5rem;column-gap:.5rem}\n"] });
|
|
1338
|
+
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", ngImport: i0, template: "<div class=\"container\">\n <div class=\"wrapper\">\n <div class=\"builder-header\">\n <div class=\"builder-title\">KwikID Form Builder</div>\n <form\n [formGroup]=\"builderFormGroup\"\n class=\"builder-form\"\n >\n <kwikui-input\n [label]=\"'Form Key'\"\n [id]=\"'form_key'\"\n [type]=\"'text'\"\n [formControlName]=\"'formKey'\"\n [formControl]=\"builderFormGroup.controls['formKey']\"\n [disabled]=\"false\"\n [placeholder]=\"'Please enter a Form Key'\"\n [focus]=\"false\"\n [invalid]=\"false\"\n [case]=\"'upper'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-input\n [label]=\"'Form Title'\"\n [id]=\"'form_title'\"\n [type]=\"'text'\"\n [formControlName]=\"'formTitle'\"\n [formControl]=\"builderFormGroup.controls['formTitle']\"\n [disabled]=\"false\"\n [placeholder]=\"'Please enter a Form Title'\"\n [focus]=\"false\"\n [invalid]=\"false\"\n [case]=\"'default'\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-button\n [disabled]=\"builderFormGroup.valid\"\n id=\"save_form_btn\"\n label=\"Save Form\"\n [showLoader]=\"false\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"primary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"'rounded'\"\n size=\"m\"\n (onClick)=\"handleOnClickSaveForms($event)\"\n ></kwikui-button>\n </form>\n </div>\n <div class=\"builder-body\">\n <div class=\"form-elements-drag-wrapper\">\n <div\n class=\"form-elements-drag\"\n cdkDropList\n [cdkDropListData]=\"formElementsDragList\"\n cdkDropListSortingDisabled\n [cdkDropListConnectedTo]=\"[formElementsList]\"\n (cdkDropListExited)=\"exit($event, 'other')\"\n (cdkDropListEntered)=\"enter($event, 'other')\"\n >\n <ng-container\n *ngFor=\"let formElementDragItem of formElementsDragList\"\n >\n <ng-container *ngIf=\"formElementDragItem.isElement\">\n <div\n class=\"form-element-drag\"\n cdkDrag\n [cdkDragData]=\"formElementDragItem\"\n >\n ⋮⋮ {{ formElementDragItem.elementTitle }}\n <!-- <ng-container *ngComponentOutlet=\"formElementDragItem.component\"></ng-container> -->\n </div>\n <div\n class=\"form-element-drag\"\n *cdkDragPlaceholder\n >\n {{ formElementDragItem.elementTitle }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"!formElementDragItem.isElement\">\n <div class=\"form-element-category\">\n {{ formElementDragItem.elementTitle }}\n </div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div\n class=\"form-elements-drop-wrapper\"\n cdkDropList\n #formElementsList=\"cdkDropList\"\n [cdkDropListData]=\"formElementsDropList\"\n (cdkDropListDropped)=\"drop($event, '')\"\n [cdkDropListEnterPredicate]=\"isElementPredicate\"\n >\n <ng-container\n *ngFor=\"\n let formElementDropItem of formElementsDropList;\n let idx = index\n \"\n >\n <div\n class=\"form-drop-element\"\n cdkDrag\n >\n <div class=\"form-drop-element-grab-symbol\">⋮⋮</div>\n <div class=\"form-drop-element-main\">\n <div class=\"form-drop-element-header\">\n <div class=\"form-drop-element-title\">\n {{ formElementDropItem.elementTitle }}\n </div>\n <div class=\"form-drop-element-actions\">\n <kwikui-button-icon\n [disabled]=\"false\"\n [id]=\"'edit-element'\"\n [showLoader]=\"false\"\n [styles]=\"\"\n [class]=\"\"\n [type]=\"'button'\"\n [appearance]=\"'secondary'\"\n [icon]=\"'tuiIconEdit'\"\n [shape]=\"'rounded'\"\n [size]=\"'s'\"\n (onClick)=\"editElement(idx, formElementDropItem)\"\n ></kwikui-button-icon>\n <kwikui-button-icon\n [disabled]=\"false\"\n [id]=\"'remove-element'\"\n [showLoader]=\"false\"\n [styles]=\"\"\n [class]=\"\"\n [type]=\"'button'\"\n [appearance]=\"'accent'\"\n [icon]=\"'tuiIconCloseLarge'\"\n [shape]=\"'rounded'\"\n [size]=\"'s'\"\n (onClick)=\"removeElement(idx, formElementDropItem)\"\n ></kwikui-button-icon>\n <!-- <button\n (click)=\"editElement(idx, formElementDropItem)\"\n title=\"edit element properties\"\n >\n ✎\n </button>\n <button\n (click)=\"removeElement(idx, formElementDropItem)\"\n title=\"delete element\"\n >\n ✖\n </button> -->\n </div>\n </div>\n <div class=\"form-drop-element-body\"> </div>\n <div class=\"form-drop-element-footer\">\n <div class=\"form-drop-element-id\">\n {{ formElementDropItem.elementId }}\n </div>\n <div class=\"form-drop-element-category\">\n {{ formElementDropItem.elementCategory }}\n </div>\n <div class=\"form-drop-element-type\">\n {{ formElementDropItem.elementType }}\n </div>\n </div>\n <div\n class=\"example-custom-placeholder\"\n *cdkDragPlaceholder\n ></div>\n <!-- <ng-container *ngComponentOutlet=\"formElementDropItem.component\"> </ng-container> -->\n <!-- <ng-container *ngTemplateOutlet=\"formModal; context: formElementDropItem\"></ng-container> -->\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"element-property-editor-wrapper\">\n <element-config-editor\n [elementConfig]=\"elementEditorElementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></element-config-editor>\n </div>\n </div>\n <div class=\"builder-footer\"> © Baiju Dodhia, KwikID </div>\n </div>\n</div>\n", styles: ["kwikid-forms-builder button{align-content:center;align-items:center;background:black;border-color:transparent;box-shadow:0 2px 10px -6px #000;border-radius:1rem;color:#fff;cursor:pointer;display:flex;flex-direction:row;justify-content:center;padding:.5rem;transform:scale(1);transition:.05s ease-in}kwikid-forms-builder button:hover{box-shadow:0 2px 10px -5px #000}kwikid-forms-builder button:active{transform:scale(.98);transition:.05s ease-out}kwikid-forms-builder fieldset{display:flex;flex-direction:column;justify-content:center;align-items:stretch;align-content:center;grid-gap:.5rem;gap:.5rem;padding:.5rem 1rem 1rem;box-shadow:0 2px 10px -6px #000;border:1px solid gray}kwikid-forms-builder input,kwikid-forms-builder select{flex:1;width:100%;border:1px solid black;outline:none;padding:.25rem;overflow-x:auto}kwikid-forms-builder table,kwikid-forms-builder tr,kwikid-forms-builder td{border:1px solid black;padding:.5rem 1rem}\n", ":host{all:unset;position:relative;width:100%;height:100%}.container{width:100%;height:100%;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.container .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.container .wrapper .builder-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:1rem;max-height:max-content;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.container .wrapper .builder-header .builder-title{font-weight:bold;display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center}.container .wrapper .builder-header .builder-form{display:flex;align-content:center;justify-content:flex-end;flex:1;flex-direction:row;align-items:center;grid-gap:1rem;gap:1rem;width:100%}.container .wrapper .builder-header .builder-form kwikui-input{width:16rem}.container .wrapper .builder-body{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:stretch;grid-gap:1rem;gap:1rem;flex:1;padding:1rem;overflow:auto}.container .wrapper .builder-body>*{width:100%;border:1px solid lightgray;overflow:auto;box-shadow:0 2px 10px -6px #000}.container .wrapper .builder-body .form-elements-drag-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-gap:1rem;gap:1rem;padding:1rem;min-width:16rem;max-width:16rem}.container .wrapper .builder-body .form-elements-drag-wrapper .form-elements-drag{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-gap:1rem;gap:1rem;border-bottom:none}.container .wrapper .builder-body .form-elements-drag-wrapper .form-elements-drag .form-element-drag{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;grid-gap:1rem;gap:1rem;border:1px solid lightgray;padding:1rem;cursor:grab;box-shadow:0 2px 10px -6px #000;text-transform:capitalize}.container .wrapper .builder-body .form-elements-drag-wrapper .form-elements-drag .form-element-category{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;grid-gap:1rem;gap:1rem;border-left:.25rem solid blue;padding:.5rem;background:lightblue}.container .wrapper .builder-body .form-elements-drop-wrapper{padding:1rem;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-gap:1rem;gap:1rem;min-width:20rem;max-width:28rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder{display:flex;justify-content:flex-start;justify-items:start;align-items:center;padding:1rem;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000;cursor:grab;flex-direction:row;position:relative;grid-gap:1rem;gap:1rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main{flex:1;display:flex;justify-content:space-between;justify-items:start;align-items:stretch;flex-direction:column;width:100%;grid-gap:.5rem;gap:.5rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-header,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-header .form-drop-element-actions,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-header .form-drop-element-actions{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-gap:1rem;gap:1rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-header .form-drop-element-actions button,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-header .form-drop-element-actions button{width:1.6rem;height:1.6rem;transform:rotate(90deg)!important}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-header .form-drop-element-actions button:first-child,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-header .form-drop-element-actions button:first-child{background-color:#dc143c!important;color:#fff!important}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-header .form-drop-element-actions button:last-child,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-header .form-drop-element-actions button:last-child{background-color:gray!important;color:#fff!important}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-body,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-body{border-top:1px dashed lightgray;border-bottom:1px dashed lightgray}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-footer,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-footer{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center;grid-gap:.5rem;gap:.5rem}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-footer .form-drop-element-id,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-footer .form-drop-element-id{background:orange;padding:0 5px;border-radius:1rem;color:#fff}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-footer .form-drop-element-category,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-footer .form-drop-element-category{background:blue;padding:0 5px;border-radius:1rem;color:#fff}.container .wrapper .builder-body .form-elements-drop-wrapper .form-drop-element .form-drop-element-main .form-drop-element-footer .form-drop-element-type,.container .wrapper .builder-body .form-elements-drop-wrapper .cdk-drag-placeholder .form-drop-element-main .form-drop-element-footer .form-drop-element-type{background:green;padding:0 5px;border-radius:1rem;color:#fff}.container .wrapper .builder-body .element-property-editor-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;padding:1rem;min-width:20rem;grid-gap:1rem;gap:1rem}.container .wrapper .builder-footer{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:1rem;max-height:30px;border:1px solid lightgray;box-shadow:0 -2px 10px -6px #000;font-weight:bold}.cdk-drag-preview{width:-moz-fit-content;width:fit-content;height:auto;box-sizing:border-box;background-color:transparent;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;cursor:grabbing}.cdk-drag-placeholder{opacity:1}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "size", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: ElementConfigEditor, selector: "element-config-editor", inputs: ["formKey", "elementConfig"], outputs: ["updateElement"] }], directives: [{ type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i4.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }] });
|
|
1339
|
+
__decorate([
|
|
1340
|
+
logMethod
|
|
1341
|
+
], KwikIDFormsBuilderComponent.prototype, "handleGetKeyValue", null);
|
|
1342
|
+
__decorate([
|
|
1343
|
+
logMethod
|
|
1344
|
+
], KwikIDFormsBuilderComponent.prototype, "drop", null);
|
|
1345
|
+
__decorate([
|
|
1346
|
+
logMethod
|
|
1347
|
+
], KwikIDFormsBuilderComponent.prototype, "exit", null);
|
|
1348
|
+
__decorate([
|
|
1349
|
+
logMethod
|
|
1350
|
+
], KwikIDFormsBuilderComponent.prototype, "enter", null);
|
|
1351
|
+
__decorate([
|
|
1352
|
+
logMethod
|
|
1353
|
+
], KwikIDFormsBuilderComponent.prototype, "removeElement", null);
|
|
1354
|
+
__decorate([
|
|
1355
|
+
logMethod
|
|
1356
|
+
], KwikIDFormsBuilderComponent.prototype, "editElement", null);
|
|
1357
|
+
__decorate([
|
|
1358
|
+
logMethod
|
|
1359
|
+
], KwikIDFormsBuilderComponent.prototype, "handleOnSaveUpdateElement", null);
|
|
147
1360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsBuilderComponent, decorators: [{
|
|
148
1361
|
type: Component,
|
|
149
1362
|
args: [{
|
|
150
1363
|
selector: "kwikid-forms-builder",
|
|
151
1364
|
templateUrl: "./builder.component.html",
|
|
152
|
-
styleUrls: ["./builder.component.scss"]
|
|
1365
|
+
styleUrls: ["shared/shared.scss", "./builder.component.scss"]
|
|
153
1366
|
}]
|
|
154
|
-
}], ctorParameters: function () { return []; } });
|
|
1367
|
+
}], ctorParameters: function () { return []; }, propDecorators: { handleGetKeyValue: [], drop: [], exit: [], enter: [], removeElement: [], editElement: [], handleOnSaveUpdateElement: [] } });
|
|
155
1368
|
|
|
156
1369
|
var EActionKey;
|
|
157
1370
|
(function (EActionKey) {
|
|
158
1371
|
EActionKey["SET_VALUE"] = "SET_VALUE";
|
|
1372
|
+
EActionKey["SET_FIELD_DEFAULT_VALUE"] = "SET_FIELD_DEFAULT_VALUE";
|
|
159
1373
|
EActionKey["FIELD_MESSAGE_SHOW"] = "FIELD_MESSAGE_SHOW";
|
|
160
1374
|
EActionKey["FIELD_MESSAGES_HIDE"] = "FIELD_MESSAGES_HIDE";
|
|
161
1375
|
EActionKey["FIELD_ERROR_SHOW"] = "FIELD_ERROR_SHOW";
|
|
@@ -728,19 +1942,29 @@ class Apis {
|
|
|
728
1942
|
var _a;
|
|
729
1943
|
return __awaiter(this, void 0, void 0, function* () {
|
|
730
1944
|
const headers = this._request.headers;
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
1945
|
+
if (checkObjectKeyExists(this._request, "headers")) {
|
|
1946
|
+
if (checkObjectKeyExists(this._request.headers, "validation")) {
|
|
1947
|
+
const validation = headers.validation;
|
|
1948
|
+
const triggers = validation.triggers;
|
|
1949
|
+
const rules = validation.rules;
|
|
1950
|
+
const actions = (_a = validation) === null || _a === void 0 ? void 0 : _a.actions;
|
|
1951
|
+
const rulesMapping = new Rule(rules, this._object).mapping();
|
|
1952
|
+
for (let action of actions) {
|
|
1953
|
+
const conditionSuccess = new Condition(action.condition, rulesMapping).evaluate();
|
|
1954
|
+
if (conditionSuccess) {
|
|
1955
|
+
const actions = new Action(action, rulesMapping, this._object, this._takeAction);
|
|
1956
|
+
yield actions.execute();
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
return this._object.FIELD_CONFIG;
|
|
1960
|
+
}
|
|
1961
|
+
else {
|
|
1962
|
+
return this._object.FIELD_CONFIG;
|
|
741
1963
|
}
|
|
742
1964
|
}
|
|
743
|
-
|
|
1965
|
+
else {
|
|
1966
|
+
return this._object.FIELD_CONFIG;
|
|
1967
|
+
}
|
|
744
1968
|
});
|
|
745
1969
|
}
|
|
746
1970
|
validateResponse() {
|
|
@@ -790,21 +2014,20 @@ class SafeHtmlPipe$1 {
|
|
|
790
2014
|
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
791
2015
|
}
|
|
792
2016
|
}
|
|
793
|
-
/** @nocollapse */ SafeHtmlPipe$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe$1, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2017
|
+
/** @nocollapse */ SafeHtmlPipe$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe$1, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
794
2018
|
/** @nocollapse */ SafeHtmlPipe$1.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe$1, name: "safeHtml" });
|
|
795
2019
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe$1, decorators: [{
|
|
796
2020
|
type: Pipe,
|
|
797
2021
|
args: [{
|
|
798
2022
|
name: "safeHtml"
|
|
799
2023
|
}]
|
|
800
|
-
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
|
|
2024
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
|
|
801
2025
|
|
|
802
2026
|
class KwikIDFormViewComponent {
|
|
803
2027
|
constructor(push, alert, formViewService) {
|
|
804
2028
|
this.push = push;
|
|
805
2029
|
this.alert = alert;
|
|
806
2030
|
this.formViewService = formViewService;
|
|
807
|
-
this.apiCallResponse = {};
|
|
808
2031
|
this.isMobileView = false;
|
|
809
2032
|
this.onClickViewForms = new EventEmitter();
|
|
810
2033
|
this.onClickSaveForm = new EventEmitter();
|
|
@@ -847,24 +2070,6 @@ class KwikIDFormViewComponent {
|
|
|
847
2070
|
if (verifyChange("formData")) {
|
|
848
2071
|
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
|
|
849
2072
|
}
|
|
850
|
-
if (verifyChange("apiCallResponse")) {
|
|
851
|
-
this.apiCallResponse = changes.apiCallResponse.currentValue;
|
|
852
|
-
this.formData = Object.assign(Object.assign({}, this.formData), { [this.apiCallResponse.key]: this.apiCallResponse.response });
|
|
853
|
-
this.formGroup.patchValue({
|
|
854
|
-
[this.apiCallResponse.key]: this.apiCallResponse.response
|
|
855
|
-
}, { emitEvent: false });
|
|
856
|
-
let field = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
|
|
857
|
-
const apis = new Apis({
|
|
858
|
-
FIELD_CONFIG: field,
|
|
859
|
-
FORM_FIELDS: this.formFields,
|
|
860
|
-
FORM_DATA: this.formData,
|
|
861
|
-
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
862
|
-
ALL_FORMS_DATA: this.allFormsData
|
|
863
|
-
}, this.takeAction.bind(this));
|
|
864
|
-
(() => __awaiter(this, void 0, void 0, function* () {
|
|
865
|
-
field = yield apis.validateResponse();
|
|
866
|
-
}))();
|
|
867
|
-
}
|
|
868
2073
|
if (verifyChange("isMobileView")) {
|
|
869
2074
|
this.isMobileView = changes.isMobileView.currentValue;
|
|
870
2075
|
}
|
|
@@ -1112,7 +2317,7 @@ class KwikIDFormViewComponent {
|
|
|
1112
2317
|
});
|
|
1113
2318
|
}
|
|
1114
2319
|
handleOnClickApiCall(e) {
|
|
1115
|
-
var _a;
|
|
2320
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1116
2321
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1117
2322
|
let field = getFormFieldByKey(this.formFields, e.key);
|
|
1118
2323
|
if (field.type === "api-call") {
|
|
@@ -1136,15 +2341,37 @@ class KwikIDFormViewComponent {
|
|
|
1136
2341
|
field = yield apis.validateRequestBody();
|
|
1137
2342
|
if (field.api.request.body.validation.is_valid) {
|
|
1138
2343
|
// Call API Here
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
request
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
2344
|
+
let apiCallResponse = undefined;
|
|
2345
|
+
if (field.api.request.url.hasOwnProperty("type") &&
|
|
2346
|
+
field.api.request.url.type === "MOCK") {
|
|
2347
|
+
apiCallResponse = field.api.request.url.data;
|
|
2348
|
+
}
|
|
2349
|
+
else {
|
|
2350
|
+
const url = field.api.request.url;
|
|
2351
|
+
const method = (_b = (_a = field.api.request) === null || _a === void 0 ? void 0 : _a.method) !== null && _b !== void 0 ? _b : "POST";
|
|
2352
|
+
const headers = Object.assign({ "Content-Type": "application/json" }, (((_d = (_c = field.api.request) === null || _c === void 0 ? void 0 : _c.headers) === null || _d === void 0 ? void 0 : _d.value) || {}));
|
|
2353
|
+
const body = (_g = (_f = (_e = field.api.request) === null || _e === void 0 ? void 0 : _e.body) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : null;
|
|
2354
|
+
const response = yield fetch(url, {
|
|
2355
|
+
method: method,
|
|
2356
|
+
headers: Object.assign({}, headers),
|
|
2357
|
+
body: JSON.stringify(body)
|
|
2358
|
+
});
|
|
2359
|
+
apiCallResponse = yield response.json();
|
|
2360
|
+
}
|
|
2361
|
+
this.formData = Object.assign(Object.assign({}, this.formData), { [field.key]: apiCallResponse });
|
|
2362
|
+
this.formGroup.patchValue({
|
|
2363
|
+
[field.key]: apiCallResponse
|
|
2364
|
+
}, { emitEvent: false });
|
|
2365
|
+
const apis = new Apis({
|
|
2366
|
+
FIELD_CONFIG: field,
|
|
2367
|
+
FORM_FIELDS: this.formFields,
|
|
2368
|
+
FORM_DATA: this.formData,
|
|
2369
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
2370
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
2371
|
+
}, this.takeAction.bind(this));
|
|
2372
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
2373
|
+
field = yield apis.validateResponse();
|
|
2374
|
+
}))();
|
|
1148
2375
|
}
|
|
1149
2376
|
else {
|
|
1150
2377
|
// Request Body Validation Failed
|
|
@@ -1438,14 +2665,45 @@ class KwikIDFormViewComponent {
|
|
|
1438
2665
|
this.fieldMessageHide(action.props.fieldKey, action.props.message);
|
|
1439
2666
|
break;
|
|
1440
2667
|
case EActionKey.SET_VALUE:
|
|
1441
|
-
const
|
|
1442
|
-
const sourceValue = yield
|
|
1443
|
-
|
|
1444
|
-
object.FIELD_CONFIG =
|
|
1445
|
-
this.formData =
|
|
2668
|
+
const setValue_Source = new Source(object);
|
|
2669
|
+
const sourceValue = yield setValue_Source.getValueFromSource(action.props.value.source);
|
|
2670
|
+
setValue_Source.setValueToSource(action.props.value.destination, sourceValue);
|
|
2671
|
+
object.FIELD_CONFIG = setValue_Source.object.FIELD_CONFIG;
|
|
2672
|
+
this.formData = setValue_Source.object.FORM_DATA;
|
|
2673
|
+
this.patchFormGroup(this.formData);
|
|
2674
|
+
this.allFormsData = setValue_Source.object.ALL_FORMS_DATA;
|
|
2675
|
+
this.previousFormData = setValue_Source.object.PREVIOUS_FORM_DATA;
|
|
2676
|
+
break;
|
|
2677
|
+
case EActionKey.SET_FIELD_DEFAULT_VALUE:
|
|
2678
|
+
const setDefaultValue_Source = new Source(object);
|
|
2679
|
+
const sourceDefaultValue = yield setDefaultValue_Source.getValueFromSource(action.props.value.source);
|
|
2680
|
+
const destinationDefaultValue_FieldConfig_Config = {
|
|
2681
|
+
key: ESourceKey.OBJECT,
|
|
2682
|
+
props: {
|
|
2683
|
+
object: {
|
|
2684
|
+
key: "FIELD_CONFIG",
|
|
2685
|
+
path: "default.value.value"
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
setDefaultValue_Source.setValueToSource(destinationDefaultValue_FieldConfig_Config, sourceDefaultValue);
|
|
2690
|
+
const destinationDefaultValue_FormData_Config__Props__Object__Path = String(`${action.props.fieldKey}`);
|
|
2691
|
+
const destinationDefaultValue_FormData_Config = {
|
|
2692
|
+
key: ESourceKey.OBJECT,
|
|
2693
|
+
props: {
|
|
2694
|
+
object: {
|
|
2695
|
+
key: "FORM_DATA",
|
|
2696
|
+
path: String(action.props.fieldKey)
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2700
|
+
setDefaultValue_Source.setValueToSource(destinationDefaultValue_FormData_Config, sourceDefaultValue);
|
|
2701
|
+
object.FIELD_CONFIG = setDefaultValue_Source.object.FIELD_CONFIG;
|
|
2702
|
+
this.formData = setDefaultValue_Source.object.FORM_DATA;
|
|
1446
2703
|
this.patchFormGroup(this.formData);
|
|
1447
|
-
this.allFormsData =
|
|
1448
|
-
this.previousFormData =
|
|
2704
|
+
this.allFormsData = setDefaultValue_Source.object.ALL_FORMS_DATA;
|
|
2705
|
+
this.previousFormData =
|
|
2706
|
+
setDefaultValue_Source.object.PREVIOUS_FORM_DATA;
|
|
1449
2707
|
break;
|
|
1450
2708
|
case EActionKey.SET_DROPDOWN_OPTIONS:
|
|
1451
2709
|
const setDropdownValue_Sources = new Source(object);
|
|
@@ -1482,7 +2740,7 @@ class KwikIDFormViewComponent {
|
|
|
1482
2740
|
}
|
|
1483
2741
|
}
|
|
1484
2742
|
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormViewComponent, deps: [{ token: TuiPushService }, { token: TuiAlertService }, { token: KwikIDFormViewService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1485
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", apiCallResponse: "apiCallResponse", isMobileView: "isMobileView", allFormsData: "allFormsData", formsList: "formsList" }, outputs: { onClickViewForms: "onClickViewForms", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall" }, providers: [KwikIDFormViewService], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div id=\"uf-form-fields-header-container\">\n <div id=\"uf-form-fields-title\">\n {{ formConfig.title }}\n </div>\n <div id=\"uf-form-fields-steps\">\n Step {{ formConfig.sequenceNo }} of {{ this.formsListLength }}\n </div>\n <hr />\n </div>\n <form\n class=\"kwikid-form show\"\n [formGroup]=\"formGroup\"\n >\n <ng-container *ngFor=\"let field of formFields; let i = index\">\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | safeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n class=\"title\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n label=\"Reset\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox-block\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox-block\n ><kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number\n ><kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto\"\n >\n <kwikui-radio-list\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-radio-list>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\"></span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'dropdown-with-search'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-select-combobox\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-select-combobox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api-call'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n shape=\"null\"\n size=\"m\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickApiCall($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div class=\"kwikid-form-buttons\">\n <kwikui-button\n *ngIf=\"isMobileView\"\n [disabled]=\"viewFormsButton.disabled\"\n id=\"\"\n label=\"View Forms\"\n [showLoader]=\"viewFormsButton.showLoader\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"secondary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n [disabled]=\"saveFormButton.disabled\"\n id=\"\"\n label=\"Save\"\n [showLoader]=\"saveFormButton.showLoader\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"primary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n</div>\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconCancel\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-row-gap:1rem;row-gap:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-column-gap:10px;column-gap:10px}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;grid-row-gap:.5rem;row-gap:.5rem;padding:1rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1em}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-gap:.5rem;gap:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;grid-row-gap:1rem;row-gap:1rem;padding:1rem}#field-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top{color:#fff!important}#field-error-notification .t-close{color:#fff!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "prefix", "postfix", "precision", "decimal", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4.TuiPushDirective, selector: "tui-push" }], pipes: { "safeHtml": SafeHtmlPipe$1 } });
|
|
2743
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: { formConfig: "formConfig", formData: "formData", isMobileView: "isMobileView", allFormsData: "allFormsData", formsList: "formsList" }, outputs: { onClickViewForms: "onClickViewForms", onClickSaveForm: "onClickSaveForm", onClickApiCall: "onClickApiCall" }, providers: [KwikIDFormViewService], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"kwikid-form-container\"\n *ngIf=\"!loading\"\n>\n <div id=\"uf-form-fields-header-container\">\n <div id=\"uf-form-fields-title\">\n {{ formConfig.title }}\n </div>\n <div id=\"uf-form-fields-steps\">\n Step {{ formConfig.sequenceNo }} of {{ this.formsListLength }}\n </div>\n <hr />\n </div>\n <form\n class=\"kwikid-form show\"\n [formGroup]=\"formGroup\"\n >\n <ng-container *ngFor=\"let field of formFields; let i = index\">\n <ng-container [ngSwitch]=\"field.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div [innerHtml]=\"field.html | safeHtml\"></div>\n </div>\n </ng-container>\n <!-- Form Title -->\n <ng-container *ngSwitchCase=\"'title'\">\n <div\n class=\"title\"\n [class.hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <div>\n {{ field.label }}\n </div>\n <kwikui-button\n *ngIf=\"field?.reset\"\n appearance=\"whiteblock\"\n size=\"s\"\n label=\"Reset\"\n (onClick)=\"handleOnClickResetFormFields($event, field)\"\n ></kwikui-button>\n </div>\n </ng-container>\n <!-- Input Text -->\n <ng-container *ngSwitchCase=\"'text'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input\n [case]=\"field?.properties?.case\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [placeholder]=\"field?.properties?.placeholder\"\n [type]=\"'text'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Checkbox -->\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-checkbox-block\n [contentAlign]=\"field?.properties?.contentAlign ?? 'left'\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.properties?.placeholder\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size ?? 'l'\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-checkbox-block\n ><kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Number -->\n <ng-container *ngSwitchCase=\"'number'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-number\n [decimal]=\"field?.properties?.decimal\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [postfix]=\"field?.properties?.postfix ?? ''\"\n [precision]=\"field?.properties?.precision\"\n [prefix]=\"field?.properties?.prefix ?? ''\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-number\n ><kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Date -->\n <ng-container *ngSwitchCase=\"'date'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-date\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [max]=\"field?.properties?.max\"\n [min]=\"field?.properties?.min\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-date>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Phone -->\n <ng-container *ngSwitchCase=\"'phone'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-phone\n [countryCode]=\"field?.properties?.countryCode\"\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [phoneMaskAfterCountryCode]=\"\n field?.properties?.phoneMaskAfterCountryCode\n \"\n [removeCountryCodeFromValue]=\"\n field?.properties?.removeCountryCodeFromValue\n \"\n [placeholder]=\"field?.properties?.placeholder\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-phone>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Input Radio -->\n <ng-container *ngSwitchCase=\"'radio'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <label\n [tuiLabel]=\"labelTemplate\"\n style=\"min-height: auto; padding: 0px 0.5rem\"\n >\n <kwikui-radio-list\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [items]=\"field?.options\"\n [label]=\"field?.label\"\n [orientation]=\"field?.properties?.orientation\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [size]=\"field?.properties?.size\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-radio-list>\n </label>\n <ng-template #labelTemplate>\n <p\n class=\"tui-space_bottom-2\"\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <b>\n {{ field.label }}\n <span *ngIf=\"field.validators?.required\"></span>\n </b>\n </p>\n </ng-template>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Dropdown -->\n <ng-container *ngSwitchCase=\"'dropdown-with-search'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-select-combobox\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field.label\"\n [options]=\"field.options\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-select-combobox>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- API Call -->\n <ng-container *ngSwitchCase=\"'api-call'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-button-api-call\n [apiStatus]=\"field?.api?.status?.value\"\n [class]=\"field?.class\"\n [disabled]=\"field?.disabled\"\n [id]=\"field.key\"\n [label]=\"field?.api?.status?.labels[field?.api?.status?.value]\"\n [showLoader]=\"field?.disabled === 'loading'\"\n shape=\"null\"\n size=\"m\"\n styles=\"width: fit-content\"\n (onClick)=\"handleOnClickApiCall($event)\"\n ></kwikui-button-api-call>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Mobile OTP -->\n <ng-container *ngSwitchCase=\"'otp'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-otp\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [mask]=\"field?.properties?.mask\"\n [placeholder]=\"field?.properties?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-otp>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n <!-- Aadhaar Number -->\n <ng-container *ngSwitchCase=\"'aadhaar-number'\">\n <div\n [hidden]=\"field?.hidden\"\n id=\"field_{{ field.key }}\"\n >\n <kwikui-input-aadhaar\n [disabled]=\"field?.disabled\"\n [focus]=\"field?.focus\"\n [formControl]=\"formGroup.controls[field.key]\"\n [formControlName]=\"field.key\"\n [id]=\"field.key\"\n [invalid]=\"field?.invalid\"\n [label]=\"field?.label\"\n [placeholder]=\"field?.placeholder\"\n [properties]=\"field?.properties\"\n [validators]=\"field?.validators\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input-aadhaar>\n <kwikui-messages\n [messages]=\"field.messages\"\n [id]=\"field.key\"\n ></kwikui-messages>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </form>\n <div class=\"kwikid-form-buttons\">\n <kwikui-button\n *ngIf=\"isMobileView\"\n [disabled]=\"viewFormsButton.disabled\"\n id=\"\"\n label=\"View Forms\"\n [showLoader]=\"viewFormsButton.showLoader\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"secondary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnClickViewForms($event)\"\n ></kwikui-button>\n <kwikui-button\n [disabled]=\"saveFormButton.disabled\"\n id=\"\"\n label=\"Save\"\n [showLoader]=\"saveFormButton.showLoader\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"primary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnClickSaveForm($event)\"\n ></kwikui-button>\n </div>\n</div>\n<div\n class=\"kwikid-form-container-loading\"\n *ngIf=\"loading\"\n>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n <div\n class=\"large-wrapper\"\n [class.tui-skeleton]=\"loading\"\n [class.tui-skeleton_rounded]=\"loading\"\n ></div>\n</div>\n<tui-push\n id=\"field-error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Missing/Incorrect Fields!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconCancel\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.kwikid-form-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}.kwikid-form.show{width:100%;height:100%;padding:1rem;overflow-y:auto;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch;grid-row-gap:1rem;row-gap:1rem}.kwikid-form-buttons{width:100%;bottom:0px;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-column-gap:10px;column-gap:10px}.kwikid-form-buttons *{flex-grow:1}#uf-form-fields-header-container{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:flex-start;grid-row-gap:.5rem;row-gap:.5rem;padding:1rem}#uf-form-fields-header-container hr{width:100%}#uf-form-fields-title{color:#000;font-size:1.75em;font-weight:bold}#uf-form-fields-steps{color:var(--color-on-secondary-container);font-size:1em}.title{border-left:.25rem solid var(--tui-primary);padding:.75rem;font-size:1.4em;font-weight:bold;background-color:var(--tui-secondary);display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-gap:.5rem;gap:.5rem}.title:not(:first-child){margin-top:.5rem}.title.hidden{display:none}.large-wrapper{width:100%;height:60px}.large-wrapper:first-child{margin-bottom:auto}.large-wrapper:last-child{margin-top:auto}.kwikid-form-container-loading{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;grid-row-gap:1rem;row-gap:1rem;padding:1rem}#field-error-notification{background-color:var(--tui-error-fill);color:#fff!important}#field-error-notification .t-top{color:#fff!important}#field-error-notification .t-close{color:#fff!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "size", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputNumberComponent, selector: "kwikui-input-number", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "prefix", "postfix", "precision", "decimal", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3$1.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4$1.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4$1.TuiPushDirective, selector: "tui-push" }], pipes: { "safeHtml": SafeHtmlPipe$1 } });
|
|
1486
2744
|
__decorate([
|
|
1487
2745
|
logMethod
|
|
1488
2746
|
], KwikIDFormViewComponent.prototype, "ngOnInit", null);
|
|
@@ -1611,18 +2869,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1611
2869
|
styleUrls: ["./form-view.component.scss"],
|
|
1612
2870
|
providers: [KwikIDFormViewService]
|
|
1613
2871
|
}]
|
|
1614
|
-
}], ctorParameters: function () { return [{ type: i4.TuiPushService, decorators: [{
|
|
2872
|
+
}], ctorParameters: function () { return [{ type: i4$1.TuiPushService, decorators: [{
|
|
1615
2873
|
type: Inject,
|
|
1616
2874
|
args: [TuiPushService]
|
|
1617
|
-
}] }, { type: i3.TuiAlertService, decorators: [{
|
|
2875
|
+
}] }, { type: i3$1.TuiAlertService, decorators: [{
|
|
1618
2876
|
type: Inject,
|
|
1619
2877
|
args: [TuiAlertService]
|
|
1620
2878
|
}] }, { type: KwikIDFormViewService }]; }, propDecorators: { formConfig: [{
|
|
1621
2879
|
type: Input
|
|
1622
2880
|
}], formData: [{
|
|
1623
2881
|
type: Input
|
|
1624
|
-
}], apiCallResponse: [{
|
|
1625
|
-
type: Input
|
|
1626
2882
|
}], isMobileView: [{
|
|
1627
2883
|
type: Input
|
|
1628
2884
|
}], allFormsData: [{
|
|
@@ -1650,14 +2906,14 @@ class SafeHtmlPipe {
|
|
|
1650
2906
|
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
1651
2907
|
}
|
|
1652
2908
|
}
|
|
1653
|
-
/** @nocollapse */ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2909
|
+
/** @nocollapse */ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1654
2910
|
/** @nocollapse */ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
|
|
1655
2911
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
1656
2912
|
type: Pipe,
|
|
1657
2913
|
args: [{
|
|
1658
2914
|
name: "safeHtml"
|
|
1659
2915
|
}]
|
|
1660
|
-
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
|
|
2916
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
|
|
1661
2917
|
|
|
1662
2918
|
class KwikIDFormsListComponent {
|
|
1663
2919
|
constructor() {
|
|
@@ -1749,7 +3005,7 @@ class KwikIDFormsListComponent {
|
|
|
1749
3005
|
}
|
|
1750
3006
|
}
|
|
1751
3007
|
/** @nocollapse */ KwikIDFormsListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1752
|
-
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: { showFormFields: "showFormFields", userConfig: "userConfig", activeFormConfig: "activeFormConfig", formsList: "formsList", formsListCompleted: "formsListCompleted", isMobileView: "isMobileView" }, outputs: { onClickSetActiveForm: "onClickSetActiveForm", onClickHideFormsList: "onClickHideFormsList", onClickSubmitForms: "onClickSubmitForms" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"sidebar-container\">\n <div id=\"sidebar\">\n <div ngClass=\"kwikid-form-header\">\n <div id=\"uf-header\">\n <div id=\"uf-header-logo-container\">\n <img\n id=\"uf-header-logo\"\n src=\"{{ this.userConfig.theme.clientLogo }}\"\n [ngClass]=\"'large-icon'\"\n />\n </div>\n </div>\n <hr />\n </div>\n <div id=\"uf-progress\">\n <div id=\"uf-progress-steps\">\n {{ this.formsListCompleted.length }} / {{ this.formsListLength }} Steps\n Completed\n </div>\n <kwikui-progress-segmented\n [max]=\"this.formsListLength\"\n size=\"m\"\n [value]=\"this.formsListCompleted.length\"\n ></kwikui-progress-segmented>\n </div>\n <div id=\"uf-sections-container\">\n <ng-container *ngFor=\"let form of formsList; let i = index\">\n <ng-container [ngSwitch]=\"form.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div [innerHtml]=\"form.props.htmlContent | safeHtml\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'form'\">\n <div\n [class]=\"'uf-section-item'\"\n [class.completed]=\"form.status === 'completed' && !form.disabled\"\n [class.edit]=\"form.status === 'editable' && !form.disabled\"\n [class.locked]=\"form.status === 'locked' && form.disabled\"\n [class.active]=\"\n activeFormConfig !== undefined &&\n form.key === activeFormConfig.key\n \"\n (click)=\"\n form.status === 'locked' && form.disabled\n ? undefined\n : handleOnClickSetActiveForm(form.key)\n \"\n >\n <div class=\"uf-form-section-card-title\">\n {{ form.props.title }} <span *ngIf=\"form?.required\"\n >*</span\n >\n </div>\n <div class=\"uf-form-section-card-status\">\n <div\n *ngIf=\"form.status === 'completed' && !form.disabled\"\n class=\"uf-form-section-card-status-img completed\"\n >\n <tui-svg src=\"tuiIconCheckLarge\"></tui-svg>\n </div>\n <div\n *ngIf=\"form.status !== 'completed' && !form.disabled\"\n class=\"uf-form-section-card-status-img edit\"\n >\n <tui-svg src=\"tuiIconEdit\"></tui-svg>\n </div>\n <div\n *ngIf=\"form.status !== 'completed' && form.disabled\"\n class=\"uf-form-section-card-status-img locked\"\n >\n <tui-svg src=\"tuiIconLock\"></tui-svg>\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div id=\"submit-sidebar-btn-container\">\n <kwikui-button\n [disabled]=\"false\"\n id=\"\"\n label=\"Submit\"\n [showLoader]=\"false\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"primary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnSubmitForms($event)\"\n ></kwikui-button>\n </div>\n </div>\n</div>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}#sidebar-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}#sidebar{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch}.uf-section-item{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;padding:1rem;grid-gap:1rem;gap:1rem;cursor:pointer;box-shadow:0 1px 3px -1px var(--tui-base-05);border-radius:.5rem;background-color:var(--tui-base-02);position:relative}.uf-section-item:hover{box-shadow:0 1px 3px -1px var(--tui-base-08)}#submit-sidebar-btn-container{width:100%;bottom:0px;z-index:1;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-gap:1rem;gap:1rem}#submit-sidebar-btn-container *{flex-grow:1}#uf-sections-container{display:flex;flex-direction:column;height:100%;grid-row-gap:20px;row-gap:20px;padding:1rem;overflow-y:auto}.uf-form-section-card{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:10px;column-gap:10px;border:none;border-radius:8px;background-color:#e9e9e9;height:-moz-fit-content;height:fit-content;min-height:60px;padding:10px 15px;width:100%;max-width:350px;margin:0 auto}.uf-section-item.locked{-webkit-user-select:none;user-select:none;cursor:not-allowed}.uf-form-section-card .uf-form-section-card-title{font-size:1.2em;text-align:left;line-height:1.25em}.uf-form-section-card .uf-form-section-card-status{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.uf-form-section-card .uf-form-section-card-status .uf-form-section-card-status-img{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;border-radius:100%;color:#fff;font-weight:bold}.uf-form-section-card-status-img.completed{background-color:var(--tui-success-fill);padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-status-img.edit{background-color:var(--tui-error-fill);padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-status-img.locked{background-color:var(--tui-neutral-fill);padding:.25rem;border-radius:50%;color:#fff}#uf-progress{display:flex;padding:1rem;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;grid-gap:.5rem;gap:.5rem}#uf-progress-steps{font-size:1em;text-align:right;color:#3d3d3d}.uf-form-section-card-title{font-size:1em;font-weight:bold;color:#000}@media screen and (max-width: 600px){#sidebar-container{max-width:unset}}.kwikid-form-header{height:70px;z-index:6}.kwikid-form-header hr{width:calc(100% - 1rem);margin-left:auto;margin-right:auto}#uf-header{display:flex;flex-direction:row;align-content:center;align-items:center;justify-content:flex-start;grid-column-gap:10px;column-gap:10px;padding:10px 20px;width:100%;max-width:calc(400px + 50vw + 2rem);margin:0 auto;height:70px;z-index:1}#uf-header #uf-header-goback-container{display:none}#uf-header #uf-header-goback-container:hover{border-radius:50%;background-color:#d3d3d3}#uf-header #uf-header-goback-container #uf-header-goback{width:100%;height:auto}#uf-header #uf-header-logo-container{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}#uf-header #uf-header-logo-container #uf-header-logo.small-icon{width:100%;height:50px}#uf-header #uf-header-logo-container #uf-header-logo.large-icon{width:100%;height:50px}#uf-header #uf-header-title-container{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;grid-row-gap:4px;row-gap:4px}#uf-header #uf-header-title-container #uf-header-title{font-size:1.4em;color:#121212}#uf-header #uf-header-title-container #uf-header-subtitle{font-size:1.2em;color:#121212}\n"], components: [{ type: i2.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["id", "value", "max", "size", "colors"] }, { type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type:
|
|
3008
|
+
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: { showFormFields: "showFormFields", userConfig: "userConfig", activeFormConfig: "activeFormConfig", formsList: "formsList", formsListCompleted: "formsListCompleted", isMobileView: "isMobileView" }, outputs: { onClickSetActiveForm: "onClickSetActiveForm", onClickHideFormsList: "onClickHideFormsList", onClickSubmitForms: "onClickSubmitForms" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"sidebar-container\">\n <div id=\"sidebar\">\n <div ngClass=\"kwikid-form-header\">\n <div id=\"uf-header\">\n <div id=\"uf-header-logo-container\">\n <img\n id=\"uf-header-logo\"\n src=\"{{ this.userConfig.theme.clientLogo }}\"\n [ngClass]=\"'large-icon'\"\n />\n </div>\n </div>\n <hr />\n </div>\n <div id=\"uf-progress\">\n <div id=\"uf-progress-steps\">\n {{ this.formsListCompleted.length }} / {{ this.formsListLength }} Steps\n Completed\n </div>\n <kwikui-progress-segmented\n [max]=\"this.formsListLength\"\n size=\"m\"\n [value]=\"this.formsListCompleted.length\"\n ></kwikui-progress-segmented>\n </div>\n <div id=\"uf-sections-container\">\n <ng-container *ngFor=\"let form of formsList; let i = index\">\n <ng-container [ngSwitch]=\"form.type\">\n <!-- HTML Content -->\n <ng-container *ngSwitchCase=\"'html'\">\n <div [innerHtml]=\"form.props.htmlContent | safeHtml\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'form'\">\n <div\n [class]=\"'uf-section-item'\"\n [class.completed]=\"form.status === 'completed' && !form.disabled\"\n [class.edit]=\"form.status === 'editable' && !form.disabled\"\n [class.locked]=\"form.status === 'locked' && form.disabled\"\n [class.active]=\"\n activeFormConfig !== undefined &&\n form.key === activeFormConfig.key\n \"\n (click)=\"\n form.status === 'locked' && form.disabled\n ? undefined\n : handleOnClickSetActiveForm(form.key)\n \"\n >\n <div class=\"uf-form-section-card-title\">\n {{ form.props.title }} <span *ngIf=\"form?.required\"\n >*</span\n >\n </div>\n <div class=\"uf-form-section-card-status\">\n <div\n *ngIf=\"form.status === 'completed' && !form.disabled\"\n class=\"uf-form-section-card-status-img completed\"\n >\n <tui-svg src=\"tuiIconCheckLarge\"></tui-svg>\n </div>\n <div\n *ngIf=\"form.status !== 'completed' && !form.disabled\"\n class=\"uf-form-section-card-status-img edit\"\n >\n <tui-svg src=\"tuiIconEdit\"></tui-svg>\n </div>\n <div\n *ngIf=\"form.status !== 'completed' && form.disabled\"\n class=\"uf-form-section-card-status-img locked\"\n >\n <tui-svg src=\"tuiIconLock\"></tui-svg>\n </div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div id=\"submit-sidebar-btn-container\">\n <kwikui-button\n [disabled]=\"false\"\n id=\"\"\n label=\"Submit\"\n [showLoader]=\"false\"\n styles=\"\"\n class=\"\"\n type=\"button\"\n appearance=\"primary\"\n icon=\"\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"width: 100%\"\n (onClick)=\"handleOnSubmitForms($event)\"\n ></kwikui-button>\n </div>\n </div>\n</div>\n", styles: ["::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}#sidebar-container{width:100%;height:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center}#sidebar{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:flex-start;align-items:stretch}.uf-section-item{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;align-content:center;padding:1rem;grid-gap:1rem;gap:1rem;cursor:pointer;box-shadow:0 1px 3px -1px var(--tui-base-05);border-radius:.5rem;background-color:var(--tui-base-02);position:relative}.uf-section-item:hover{box-shadow:0 1px 3px -1px var(--tui-base-08)}#submit-sidebar-btn-container{width:100%;bottom:0px;z-index:1;padding:1rem;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;grid-gap:1rem;gap:1rem}#submit-sidebar-btn-container *{flex-grow:1}#uf-sections-container{display:flex;flex-direction:column;height:100%;grid-row-gap:20px;row-gap:20px;padding:1rem;overflow-y:auto}.uf-form-section-card{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:10px;column-gap:10px;border:none;border-radius:8px;background-color:#e9e9e9;height:-moz-fit-content;height:fit-content;min-height:60px;padding:10px 15px;width:100%;max-width:350px;margin:0 auto}.uf-section-item.locked{-webkit-user-select:none;user-select:none;cursor:not-allowed}.uf-form-section-card .uf-form-section-card-title{font-size:1.2em;text-align:left;line-height:1.25em}.uf-form-section-card .uf-form-section-card-status{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}.uf-form-section-card .uf-form-section-card-status .uf-form-section-card-status-img{width:30px;height:30px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;border-radius:100%;color:#fff;font-weight:bold}.uf-form-section-card-status-img.completed{background-color:var(--tui-success-fill);padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-status-img.edit{background-color:var(--tui-error-fill);padding:.25rem;border-radius:50%;color:#fff}.uf-form-section-card-status-img.locked{background-color:var(--tui-neutral-fill);padding:.25rem;border-radius:50%;color:#fff}#uf-progress{display:flex;padding:1rem;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;grid-gap:.5rem;gap:.5rem}#uf-progress-steps{font-size:1em;text-align:right;color:#3d3d3d}.uf-form-section-card-title{font-size:1em;font-weight:bold;color:#000}@media screen and (max-width: 600px){#sidebar-container{max-width:unset}}.kwikid-form-header{height:70px;z-index:6}.kwikid-form-header hr{width:calc(100% - 1rem);margin-left:auto;margin-right:auto}#uf-header{display:flex;flex-direction:row;align-content:center;align-items:center;justify-content:flex-start;grid-column-gap:10px;column-gap:10px;padding:10px 20px;width:100%;max-width:calc(400px + 50vw + 2rem);margin:0 auto;height:70px;z-index:1}#uf-header #uf-header-goback-container{display:none}#uf-header #uf-header-goback-container:hover{border-radius:50%;background-color:#d3d3d3}#uf-header #uf-header-goback-container #uf-header-goback{width:100%;height:auto}#uf-header #uf-header-logo-container{display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center}#uf-header #uf-header-logo-container #uf-header-logo.small-icon{width:100%;height:50px}#uf-header #uf-header-logo-container #uf-header-logo.large-icon{width:100%;height:50px}#uf-header #uf-header-title-container{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;grid-row-gap:4px;row-gap:4px}#uf-header #uf-header-title-container #uf-header-title{font-size:1.4em;color:#121212}#uf-header #uf-header-title-container #uf-header-subtitle{font-size:1.2em;color:#121212}\n"], components: [{ type: i2.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["id", "value", "max", "size", "colors"] }, { type: i3$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "safeHtml": SafeHtmlPipe } });
|
|
1753
3009
|
__decorate([
|
|
1754
3010
|
logMethod
|
|
1755
3011
|
], KwikIDFormsListComponent.prototype, "ngOnChanges", null);
|
|
@@ -2032,7 +3288,7 @@ class Converter {
|
|
|
2032
3288
|
}
|
|
2033
3289
|
return field;
|
|
2034
3290
|
};
|
|
2035
|
-
const
|
|
3291
|
+
const getConnectedelementTypeValueObject = (key) => {
|
|
2036
3292
|
const object = {
|
|
2037
3293
|
key: key,
|
|
2038
3294
|
conditions: { formula: "", rules: [] },
|
|
@@ -2044,12 +3300,12 @@ class Converter {
|
|
|
2044
3300
|
if (checkObjectKeyExists(field, "connectedTo")) {
|
|
2045
3301
|
if (typeof field["connectedTo"] === "string") {
|
|
2046
3302
|
field["connectedElements"] = [
|
|
2047
|
-
|
|
3303
|
+
getConnectedelementTypeValueObject(field["connectedTo"])
|
|
2048
3304
|
];
|
|
2049
3305
|
}
|
|
2050
3306
|
else {
|
|
2051
3307
|
field["connectedTo"] = field["connectedTo"].map((key) => {
|
|
2052
|
-
return
|
|
3308
|
+
return getConnectedelementTypeValueObject(key);
|
|
2053
3309
|
});
|
|
2054
3310
|
field["connectedElements"] = field["connectedTo"];
|
|
2055
3311
|
}
|
|
@@ -2058,11 +3314,11 @@ class Converter {
|
|
|
2058
3314
|
if (checkObjectKeyExists(field, "connectedToParent")) {
|
|
2059
3315
|
if (typeof field["connectedToParent"] === "string") {
|
|
2060
3316
|
field["connectedParentFields"] = [
|
|
2061
|
-
|
|
3317
|
+
getConnectedelementTypeValueObject(field["connectedToParent"])
|
|
2062
3318
|
];
|
|
2063
3319
|
}
|
|
2064
3320
|
else {
|
|
2065
|
-
field["connectedParentFields"] =
|
|
3321
|
+
field["connectedParentFields"] = getConnectedelementTypeValueObject(field["connectedToParent"]);
|
|
2066
3322
|
}
|
|
2067
3323
|
}
|
|
2068
3324
|
this.removeFieldKey(field, "connectedToParent");
|
|
@@ -2804,10 +4060,30 @@ class KwikIDFormsRendererComponent {
|
|
|
2804
4060
|
});
|
|
2805
4061
|
let formConfig = undefined;
|
|
2806
4062
|
if (checkObjectKeyExists(activeFormConfig, "props")) {
|
|
2807
|
-
|
|
4063
|
+
if (checkObjectKeyExists(activeFormConfig.props, "url")) {
|
|
4064
|
+
formConfig = yield this.fetchFormConfig(activeFormConfig.props.url);
|
|
4065
|
+
}
|
|
4066
|
+
else {
|
|
4067
|
+
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
4068
|
+
formConfig = activeFormConfig;
|
|
4069
|
+
}
|
|
4070
|
+
else {
|
|
4071
|
+
console.error("No url or fields key in activeFormConfig");
|
|
4072
|
+
}
|
|
4073
|
+
}
|
|
2808
4074
|
}
|
|
2809
4075
|
else {
|
|
2810
|
-
|
|
4076
|
+
if (checkObjectKeyExists(activeFormConfig.formContent, "url")) {
|
|
4077
|
+
formConfig = yield this.fetchFormConfig(activeFormConfig.formContent.url);
|
|
4078
|
+
}
|
|
4079
|
+
else {
|
|
4080
|
+
if (checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
4081
|
+
formConfig = activeFormConfig;
|
|
4082
|
+
}
|
|
4083
|
+
else {
|
|
4084
|
+
console.error("No url or fields key in activeFormConfig");
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
2811
4087
|
}
|
|
2812
4088
|
console.log(JSON.parse(JSON.stringify(formConfig)));
|
|
2813
4089
|
formConfig = new Converter().convertFormConfig(formConfig);
|
|
@@ -2900,7 +4176,7 @@ class KwikIDFormsRendererComponent {
|
|
|
2900
4176
|
}
|
|
2901
4177
|
}
|
|
2902
4178
|
/** @nocollapse */ KwikIDFormsRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormsRendererComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2903
|
-
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { stepConfig: "stepConfig", userConfig: "userConfig", formsData: "formsData", apiCallResponse: "apiCallResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div ngClass=\"kwikid-renderer\">\n <div\n ngClass=\"kwikid-layout-container\"\n *ngIf=\"!loading\"\n >\n <div\n ngClass=\"kwikid-sections-container\"\n *ngIf=\"showFormSections\"\n class=\"active\"\n [class.active]=\"showFormSections\"\n [class.mobile]=\"isMobileView\"\n >\n <kwikid-forms-list\n [showFormFields]=\"this.showFormFields\"\n [activeFormConfig]=\"this.activeFormConfig\"\n [userConfig]=\"this.userConfig\"\n [formsList]=\"this.formsList\"\n [formsListCompleted]=\"this.formsListCompleted\"\n [isMobileView]=\"this.isMobileView\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\n ></kwikid-forms-list>\n </div>\n <div\n ngClass=\"kwikid-forms-container\"\n *ngIf=\"\n this.showForm &&\n this.showFormFields &&\n this.activeFormConfig !== undefined\n \"\n [class.active]=\"showFormFields\"\n [class.mobile]=\"isMobileView\"\n [@panelInOut]\n >\n <kwikid-form-view\n [formConfig]=\"this.activeFormConfig\"\n [formData]=\"this.activeFormData\"\n [
|
|
4179
|
+
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsRendererComponent, selector: "kwikid-forms-renderer", inputs: { stepConfig: "stepConfig", userConfig: "userConfig", formsData: "formsData", apiCallResponse: "apiCallResponse" }, outputs: { onClickSubmit: "onClickSubmit", getFormData: "getFormData", onClickApiCall: "onClickApiCall" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div ngClass=\"kwikid-renderer\">\n <div\n ngClass=\"kwikid-layout-container\"\n *ngIf=\"!loading\"\n >\n <div\n ngClass=\"kwikid-sections-container\"\n *ngIf=\"showFormSections\"\n class=\"active\"\n [class.active]=\"showFormSections\"\n [class.mobile]=\"isMobileView\"\n >\n <kwikid-forms-list\n [showFormFields]=\"this.showFormFields\"\n [activeFormConfig]=\"this.activeFormConfig\"\n [userConfig]=\"this.userConfig\"\n [formsList]=\"this.formsList\"\n [formsListCompleted]=\"this.formsListCompleted\"\n [isMobileView]=\"this.isMobileView\"\n (onClickSetActiveForm)=\"this.handleOnClickSetActiveForm($event)\"\n (onClickSubmitForms)=\"this.handleOnClickSubmitForms($event)\"\n ></kwikid-forms-list>\n </div>\n <div\n ngClass=\"kwikid-forms-container\"\n *ngIf=\"\n this.showForm &&\n this.showFormFields &&\n this.activeFormConfig !== undefined\n \"\n [class.active]=\"showFormFields\"\n [class.mobile]=\"isMobileView\"\n [@panelInOut]\n >\n <kwikid-form-view\n [formConfig]=\"this.activeFormConfig\"\n [formData]=\"this.activeFormData\"\n [formsList]=\"this.formsList\"\n [allFormsData]=\"this.allFormsData\"\n [isMobileView]=\"this.isMobileView\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n </div>\n </div>\n</div>\n<div\n ngClass=\"kwikid-forms-renderer-loader\"\n *ngIf=\"loader\"\n>\n <span class=\"loader\"></span>\n</div>\n<tui-push\n id=\"error-notification\"\n *tuiPush=\"showErrorNotification\"\n heading=\"Please complete the required Forms!\"\n type=\"Error\"\n (close)=\"toggleErrorNotification(false)\"\n>\n <tui-svg\n src=\"tuiIconCancel\"\n style=\"color: #fff !important\"\n >\n </tui-svg>\n</tui-push>\n", styles: [":host{position:relative}.kwikid-root{width:100%;height:100%}.kwikid-renderer{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-layout-container{display:flex;flex-direction:row;padding:0 1rem;height:100%;justify-content:center;align-items:stretch;background:var(--tui-secondary-active);position:relative}.kwikid-sections-container{display:block;width:100%;max-width:400px;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);margin:auto 1rem auto 0;box-shadow:0 0 12px -8px var(--tui-secondary)}.kwikid-sections-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}.kwikid-forms-container{display:block;width:100%;max-width:50%;margin:auto 0;height:calc(100% - 2rem);padding:.25rem .5rem 0;border-radius:1rem;background-color:var(--tui-base-01);box-shadow:0 0 12px -8px var(--tui-primary)}.kwikid-forms-container.mobile{position:absolute;top:0;left:0;z-index:5;opacity:1;visibility:visible;transition:all 1s;height:100%;border-radius:0;max-width:unset}@media screen and (max-width: 600px){.kwikid-layout-container{padding:0;background:transparent}.kwikid-sections-container{position:absolute;max-width:100%;bottom:-10000px;left:-10000px;opacity:0;padding:0;visibility:hidden}.kwikid-sections-container.active{visibility:visible}.kwikid-sections-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container{display:none;max-width:100%;height:100%;padding:0;border-radius:0;box-shadow:none}.kwikid-forms-container.mobile{height:100%;opacity:1;visibility:visible;transition:all 2s;border-radius:0;box-shadow:none;top:0px;margin:0;position:absolute}.kwikid-forms-container.active{display:block}}.kwikid-forms-renderer-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-forms-renderer-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-forms-renderer-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-forms-renderer-loader .t-loader{display:none!important}#error-notification{background-color:var(--tui-error-fill);color:#fff!important}#error-notification .t-top{color:#fff!important}#error-notification .t-close{color:#fff!important}\n"], components: [{ type: KwikIDFormsListComponent, selector: "kwikid-forms-list", inputs: ["showFormFields", "userConfig", "activeFormConfig", "formsList", "formsListCompleted", "isMobileView"], outputs: ["onClickSetActiveForm", "onClickHideFormsList", "onClickSubmitForms"] }, { type: KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "isMobileView", "allFormsData", "formsList"], outputs: ["onClickViewForms", "onClickSaveForm", "onClickApiCall"] }, { type: i4$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4$1.TuiPushDirective, selector: "tui-push" }], animations: [
|
|
2904
4180
|
trigger("panelInOut", [
|
|
2905
4181
|
transition(":enter", [
|
|
2906
4182
|
style({ transform: "translateY(100%)" }),
|
|
@@ -2990,13 +4266,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2990
4266
|
class KwikIDFormBuilderModule {
|
|
2991
4267
|
}
|
|
2992
4268
|
/** @nocollapse */ KwikIDFormBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2993
|
-
/** @nocollapse */ KwikIDFormBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormBuilderModule, declarations: [KwikIDFormsBuilderComponent
|
|
2994
|
-
|
|
4269
|
+
/** @nocollapse */ KwikIDFormBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormBuilderModule, declarations: [KwikIDFormsBuilderComponent,
|
|
4270
|
+
ElementConfigEditor,
|
|
4271
|
+
BasicElementConfigEditor,
|
|
4272
|
+
BasicTextConfigEditor,
|
|
4273
|
+
BasicRadioConfigEditor], imports: [CommonModule,
|
|
4274
|
+
FormsModule,
|
|
4275
|
+
ReactiveFormsModule,
|
|
4276
|
+
DragDropModule,
|
|
4277
|
+
KwikUIButtonModule,
|
|
4278
|
+
KwikUIInputModule,
|
|
4279
|
+
KwikUIButtonIconModule], exports: [KwikIDFormsBuilderComponent] });
|
|
4280
|
+
/** @nocollapse */ KwikIDFormBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormBuilderModule, providers: [], imports: [[
|
|
4281
|
+
CommonModule,
|
|
4282
|
+
FormsModule,
|
|
4283
|
+
ReactiveFormsModule,
|
|
4284
|
+
DragDropModule,
|
|
4285
|
+
KwikUIButtonModule,
|
|
4286
|
+
KwikUIInputModule,
|
|
4287
|
+
KwikUIButtonIconModule
|
|
4288
|
+
]] });
|
|
2995
4289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDFormBuilderModule, decorators: [{
|
|
2996
4290
|
type: NgModule,
|
|
2997
4291
|
args: [{
|
|
2998
|
-
declarations: [
|
|
2999
|
-
|
|
4292
|
+
declarations: [
|
|
4293
|
+
KwikIDFormsBuilderComponent,
|
|
4294
|
+
ElementConfigEditor,
|
|
4295
|
+
BasicElementConfigEditor,
|
|
4296
|
+
BasicTextConfigEditor,
|
|
4297
|
+
BasicRadioConfigEditor
|
|
4298
|
+
],
|
|
4299
|
+
imports: [
|
|
4300
|
+
CommonModule,
|
|
4301
|
+
FormsModule,
|
|
4302
|
+
ReactiveFormsModule,
|
|
4303
|
+
DragDropModule,
|
|
4304
|
+
KwikUIButtonModule,
|
|
4305
|
+
KwikUIInputModule,
|
|
4306
|
+
KwikUIButtonIconModule
|
|
4307
|
+
],
|
|
3000
4308
|
providers: [],
|
|
3001
4309
|
exports: [KwikIDFormsBuilderComponent]
|
|
3002
4310
|
}]
|