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
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/drag-drop'), require('@angular/core'), require('@angular/forms'), require('kwikui'), require('lodash'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('kwikid-forms', ['exports', '@angular/cdk/drag-drop', '@angular/core', '@angular/forms', 'kwikui', 'lodash', '@taiga-ui/core', '@taiga-ui/kit', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-forms"] = {}, global.ng.cdk.dragDrop, global.ng.core, global.ng.forms, global.kwikui, global.lodash, global["@taiga-ui/core"], global["@taiga-ui/kit"], global
|
|
5
|
-
})(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/drag-drop'), require('@angular/core'), require('@angular/forms'), require('kwikid-toolkit'), require('kwikui'), require('lodash'), require('@angular/common'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('rxjs/operators'), require('@taiga-ui/cdk'), require('@angular/platform-browser'), require('@angular/animations'), require('lodash/cloneDeep'), require('@angular/common/http')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('kwikid-forms', ['exports', '@angular/cdk/drag-drop', '@angular/core', '@angular/forms', 'kwikid-toolkit', 'kwikui', 'lodash', '@angular/common', '@taiga-ui/core', '@taiga-ui/kit', 'rxjs/operators', '@taiga-ui/cdk', '@angular/platform-browser', '@angular/animations', 'lodash/cloneDeep', '@angular/common/http'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-forms"] = {}, global.ng.cdk.dragDrop, global.ng.core, global.ng.forms, global["kwikid-toolkit"], global.kwikui, global.lodash, global.ng.common, global["@taiga-ui/core"], global["@taiga-ui/kit"], global.rxjs.operators, global["@taiga-ui/cdk"], global.ng.platformBrowser, global.ng.animations, global.cloneDeep, global.ng.common.http));
|
|
5
|
+
})(this, (function (exports, i4, i0, i1, kwikidToolkit, i2, _, i3, i3$1, i4$1, operators, cdk, i1$1, animations, cloneDeep, http) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
8
|
|
|
7
9
|
function _interopNamespace(e) {
|
|
8
10
|
if (e && e.__esModule) return e;
|
|
@@ -22,13 +24,15 @@
|
|
|
22
24
|
return Object.freeze(n);
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
25
28
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
var
|
|
29
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
30
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
31
|
+
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
28
32
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
33
|
+
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
34
|
+
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
35
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
32
36
|
var cloneDeep__namespace = /*#__PURE__*/_interopNamespace(cloneDeep);
|
|
33
37
|
|
|
34
38
|
/******************************************************************************
|
|
@@ -416,71 +420,570 @@
|
|
|
416
420
|
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
417
421
|
}
|
|
418
422
|
|
|
419
|
-
var
|
|
420
|
-
function
|
|
421
|
-
this.
|
|
423
|
+
var Elements = /** @class */ (function () {
|
|
424
|
+
function Elements() {
|
|
425
|
+
this.commonValidators = {
|
|
426
|
+
max: null,
|
|
427
|
+
maxLength: null,
|
|
428
|
+
min: null,
|
|
429
|
+
minLength: null,
|
|
430
|
+
required: true
|
|
431
|
+
};
|
|
432
|
+
this.commonProperties = {
|
|
433
|
+
placeholder: "",
|
|
434
|
+
readOnly: false
|
|
435
|
+
};
|
|
436
|
+
this.commonCore = {
|
|
437
|
+
key: "",
|
|
438
|
+
label: "",
|
|
422
439
|
disabled: false,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
class: "tui-space_right-3 tui-space_bottom-3",
|
|
428
|
-
type: "button",
|
|
429
|
-
appearance: "primary",
|
|
430
|
-
icon: "",
|
|
431
|
-
iconRight: "",
|
|
432
|
-
shape: null,
|
|
433
|
-
size: "m"
|
|
440
|
+
messages: [],
|
|
441
|
+
default: {
|
|
442
|
+
value: true
|
|
443
|
+
}
|
|
434
444
|
};
|
|
435
|
-
this.
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
445
|
+
this.basic = [
|
|
446
|
+
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" }) }),
|
|
447
|
+
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" }) })
|
|
448
|
+
];
|
|
449
|
+
this.documents = [
|
|
450
|
+
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: "####-####-####" }) })
|
|
451
|
+
];
|
|
452
|
+
this.others = [
|
|
453
|
+
Object.assign(Object.assign({ elementTitle: "Gender", elementType: "gender", isElement: true, elementCategory: "others" }, this.commonCore), { validators: Object.assign({}, this.commonValidators), properties: Object.assign({}, this.commonProperties) })
|
|
454
|
+
];
|
|
455
|
+
this.templates = [
|
|
456
|
+
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) })
|
|
457
|
+
];
|
|
458
|
+
this.elementMapping = {
|
|
459
|
+
basic: ["text", "radio"],
|
|
460
|
+
documents: ["aadhaar-number"],
|
|
461
|
+
others: [],
|
|
462
|
+
templates: []
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
return Elements;
|
|
466
|
+
}());
|
|
467
|
+
|
|
468
|
+
function revisedRandId() {
|
|
469
|
+
return Math.random()
|
|
470
|
+
.toString(36)
|
|
471
|
+
.replace(/[^a-z]+/g, "");
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
var BasicTextConfigEditor = /** @class */ (function () {
|
|
475
|
+
function BasicTextConfigEditor() {
|
|
476
|
+
this.saveBasicClickCounter = 0;
|
|
477
|
+
this.elementConfig = {
|
|
478
|
+
properties: {
|
|
479
|
+
case: "default"
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
this.updateElement = new i0.EventEmitter();
|
|
483
|
+
this.basicTextFormGroup = undefined;
|
|
484
|
+
}
|
|
485
|
+
BasicTextConfigEditor.prototype.ngOnInit = function () {
|
|
486
|
+
this.createBasicTextFormGroup();
|
|
487
|
+
};
|
|
488
|
+
BasicTextConfigEditor.prototype.ngOnChanges = function (changes) {
|
|
489
|
+
var verifyChange = function (key) {
|
|
490
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
440
491
|
};
|
|
441
|
-
|
|
442
|
-
|
|
492
|
+
if (verifyChange("elementConfig")) {
|
|
493
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
494
|
+
this.createBasicTextFormGroup();
|
|
495
|
+
}
|
|
496
|
+
if (verifyChange("saveBasicClickCounter")) {
|
|
497
|
+
if (changes.saveBasicClickCounter.previousValue !==
|
|
498
|
+
changes.saveBasicClickCounter.currentValue) {
|
|
499
|
+
this.saveBasicClickCounter = changes.saveBasicClickCounter.currentValue;
|
|
500
|
+
this.handleOnSave();
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
BasicTextConfigEditor.prototype.createBasicTextFormGroup = function () {
|
|
505
|
+
this.basicTextFormGroup = new i1.FormGroup({
|
|
506
|
+
properties: new i1.FormGroup({
|
|
507
|
+
case: new i1.FormControl(this.elementConfig.properties.case, {
|
|
508
|
+
updateOn: "change"
|
|
509
|
+
})
|
|
510
|
+
})
|
|
511
|
+
});
|
|
512
|
+
this.basicTextFormGroup.updateValueAndValidity();
|
|
513
|
+
};
|
|
514
|
+
BasicTextConfigEditor.prototype.handleOnSave = function () {
|
|
515
|
+
var basicElementConfig = this.basicTextFormGroup.getRawValue();
|
|
516
|
+
this.updateElement.emit({
|
|
517
|
+
basicElementConfig: basicElementConfig
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
return BasicTextConfigEditor;
|
|
521
|
+
}());
|
|
522
|
+
/** @nocollapse */ BasicTextConfigEditor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicTextConfigEditor, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
523
|
+
/** @nocollapse */ BasicTextConfigEditor.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "\n <form [formGroup]=\"basicTextFormGroup\">\n <fieldset formGroupName=\"properties\">\n <legend>Miscellaneous</legend>\n <div class=\"form-group\">\n <label for=\"basic-text-config-case\">Case</label>\n <select\n class=\"form-control\"\n formControlName=\"case\"\n id=\"basic-text-config-case\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Case</option\n >\n <option\n *ngFor=\"let case of ['default', 'upper', 'lower']\"\n [ngValue]=\"case\"\n >\n {{ case }}\n </option>\n </select>\n </div>\n </fieldset>\n </form>\n ", isInline: true, styles: [""], directives: [{ type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1__namespace.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1__namespace.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
524
|
+
__decorate([
|
|
525
|
+
kwikidToolkit.logMethod
|
|
526
|
+
], BasicTextConfigEditor.prototype, "ngOnInit", null);
|
|
527
|
+
__decorate([
|
|
528
|
+
kwikidToolkit.logMethod
|
|
529
|
+
], BasicTextConfigEditor.prototype, "ngOnChanges", null);
|
|
530
|
+
__decorate([
|
|
531
|
+
kwikidToolkit.logMethod
|
|
532
|
+
], BasicTextConfigEditor.prototype, "createBasicTextFormGroup", null);
|
|
533
|
+
__decorate([
|
|
534
|
+
kwikidToolkit.logMethod
|
|
535
|
+
], BasicTextConfigEditor.prototype, "handleOnSave", null);
|
|
536
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicTextConfigEditor, decorators: [{
|
|
537
|
+
type: i0.Component,
|
|
538
|
+
args: [{
|
|
539
|
+
selector: "basic-text-config-editor",
|
|
540
|
+
template: "\n <form [formGroup]=\"basicTextFormGroup\">\n <fieldset formGroupName=\"properties\">\n <legend>Miscellaneous</legend>\n <div class=\"form-group\">\n <label for=\"basic-text-config-case\">Case</label>\n <select\n class=\"form-control\"\n formControlName=\"case\"\n id=\"basic-text-config-case\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Case</option\n >\n <option\n *ngFor=\"let case of ['default', 'upper', 'lower']\"\n [ngValue]=\"case\"\n >\n {{ case }}\n </option>\n </select>\n </div>\n </fieldset>\n </form>\n ",
|
|
541
|
+
styles: [""]
|
|
542
|
+
}]
|
|
543
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveBasicClickCounter: [{
|
|
544
|
+
type: i0.Input
|
|
545
|
+
}], elementConfig: [{
|
|
546
|
+
type: i0.Input
|
|
547
|
+
}], updateElement: [{
|
|
548
|
+
type: i0.Output
|
|
549
|
+
}], ngOnInit: [], ngOnChanges: [], createBasicTextFormGroup: [], handleOnSave: [] } });
|
|
550
|
+
|
|
551
|
+
var BasicRadioConfigEditor = /** @class */ (function () {
|
|
552
|
+
function BasicRadioConfigEditor() {
|
|
553
|
+
this.optionType = {
|
|
554
|
+
label: "",
|
|
443
555
|
disabled: false,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
556
|
+
description: ""
|
|
557
|
+
};
|
|
558
|
+
this.saveBasicClickCounter = 0;
|
|
559
|
+
this.elementConfig = {
|
|
560
|
+
properties: {
|
|
561
|
+
orientation: "horizontal"
|
|
562
|
+
},
|
|
563
|
+
options: []
|
|
564
|
+
};
|
|
565
|
+
this.updateElement = new i0.EventEmitter();
|
|
566
|
+
this.basicRadioFormGroup = undefined;
|
|
567
|
+
}
|
|
568
|
+
BasicRadioConfigEditor.prototype.ngOnInit = function () {
|
|
569
|
+
this.createBasicRadioFormGroup();
|
|
570
|
+
};
|
|
571
|
+
BasicRadioConfigEditor.prototype.ngOnChanges = function (changes) {
|
|
572
|
+
var verifyChange = function (key) {
|
|
573
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
574
|
+
};
|
|
575
|
+
if (verifyChange("elementConfig")) {
|
|
576
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
577
|
+
this.createBasicRadioFormGroup();
|
|
578
|
+
}
|
|
579
|
+
if (verifyChange("saveBasicClickCounter")) {
|
|
580
|
+
if (changes.saveBasicClickCounter.previousValue !==
|
|
581
|
+
changes.saveBasicClickCounter.currentValue) {
|
|
582
|
+
this.saveBasicClickCounter = changes.saveBasicClickCounter.currentValue;
|
|
583
|
+
this.handleOnSave();
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
BasicRadioConfigEditor.prototype.createBasicRadioFormGroup = function () {
|
|
588
|
+
var e_1, _a;
|
|
589
|
+
var optionsFormArray = [];
|
|
590
|
+
this.elementConfig = kwikidToolkit.setMissingKeyValue(this.elementConfig, "options", [
|
|
591
|
+
this.optionType
|
|
592
|
+
]);
|
|
593
|
+
try {
|
|
594
|
+
for (var _b = __values(this.elementConfig.options), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
595
|
+
var option = _c.value;
|
|
596
|
+
optionsFormArray.push(this.createOptionConfigFormGroup(option));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
600
|
+
finally {
|
|
601
|
+
try {
|
|
602
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
603
|
+
}
|
|
604
|
+
finally { if (e_1) throw e_1.error; }
|
|
605
|
+
}
|
|
606
|
+
this.basicRadioFormGroup = new i1.FormGroup({
|
|
607
|
+
properties: new i1.FormGroup({
|
|
608
|
+
orientation: new i1.FormControl(this.elementConfig.properties.orientation, {
|
|
609
|
+
updateOn: "change"
|
|
610
|
+
})
|
|
611
|
+
}),
|
|
612
|
+
options: new i1.FormArray(optionsFormArray)
|
|
613
|
+
});
|
|
614
|
+
this.basicRadioFormGroup.updateValueAndValidity();
|
|
615
|
+
};
|
|
616
|
+
BasicRadioConfigEditor.prototype.handleOnSave = function () {
|
|
617
|
+
var basicElementConfig = this.basicRadioFormGroup.getRawValue();
|
|
618
|
+
this.updateElement.emit({
|
|
619
|
+
basicElementConfig: basicElementConfig
|
|
620
|
+
});
|
|
621
|
+
};
|
|
622
|
+
Object.defineProperty(BasicRadioConfigEditor.prototype, "optionsArray", {
|
|
623
|
+
get: function () {
|
|
624
|
+
return this.basicRadioFormGroup.get("options");
|
|
625
|
+
},
|
|
626
|
+
enumerable: false,
|
|
627
|
+
configurable: true
|
|
628
|
+
});
|
|
629
|
+
BasicRadioConfigEditor.prototype.createOptionConfigFormGroup = function (optionConfig) {
|
|
630
|
+
var optionFormGroup = new i1.FormGroup({
|
|
631
|
+
label: new i1.FormControl(optionConfig.label, {
|
|
632
|
+
updateOn: "change"
|
|
633
|
+
}),
|
|
634
|
+
disabled: new i1.FormControl(optionConfig.disabled, {
|
|
635
|
+
updateOn: "change"
|
|
636
|
+
}),
|
|
637
|
+
description: new i1.FormControl(optionConfig.description, {
|
|
638
|
+
updateOn: "change"
|
|
639
|
+
})
|
|
640
|
+
});
|
|
641
|
+
return optionFormGroup;
|
|
642
|
+
};
|
|
643
|
+
BasicRadioConfigEditor.prototype.addOption = function () {
|
|
644
|
+
var options = this.basicRadioFormGroup.get("options");
|
|
645
|
+
options.push(this.createOptionConfigFormGroup(this.optionType));
|
|
646
|
+
};
|
|
647
|
+
BasicRadioConfigEditor.prototype.removeOption = function (optionIndex) {
|
|
648
|
+
var options = this.basicRadioFormGroup.get("options");
|
|
649
|
+
if (options.length > 1) {
|
|
650
|
+
options.removeAt(optionIndex);
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
this.addOption();
|
|
654
|
+
// options.reset();
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
return BasicRadioConfigEditor;
|
|
658
|
+
}());
|
|
659
|
+
/** @nocollapse */ BasicRadioConfigEditor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicRadioConfigEditor, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
660
|
+
/** @nocollapse */ BasicRadioConfigEditor.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "\n <form [formGroup]=\"basicRadioFormGroup\">\n <fieldset formArrayName=\"options\">\n <legend>Options</legend>\n <ng-container\n *ngFor=\"let option of optionsArray.controls; let i = index\"\n >\n <div [formGroupName]=\"i\">\n <div class=\"form-group\">\n <label for=\"basic-radio-config-placeholder\">label</label>\n <input\n class=\"form-control\"\n formControlName=\"label\"\n id=\"basic-radio-config-placeholder\"\n type=\"text\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-disabled\">disabled</label>\n <select\n class=\"form-control\"\n formControlName=\"disabled\"\n id=\"basic-radio-config-disabled\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Disability</option\n >\n <option\n *ngFor=\"let disabled of [true, false]\"\n [ngValue]=\"disabled\"\n >\n {{ disabled }}\n </option>\n </select>\n </div>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-description\">description</label>\n <input\n class=\"form-control\"\n formControlName=\"description\"\n id=\"basic-radio-config-description\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"form-array-actions\">\n <button (click)=\"removeOption(i)\">Remove</button>\n <button (click)=\"addOption()\">Add</button>\n </div>\n </ng-container>\n </fieldset>\n <fieldset formGroupName=\"properties\">\n <legend>Miscellaneous</legend>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-orientation\">Orientation</label>\n <select\n class=\"form-control\"\n formControlName=\"orientation\"\n id=\"basic-radio-config-orientation\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Orientation</option\n >\n <option\n *ngFor=\"let orientation of ['horizontal', 'vertical']\"\n [ngValue]=\"orientation\"\n >\n {{ orientation }}\n </option>\n </select>\n </div>\n </fieldset>\n </form>\n ", 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__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1__namespace.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__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1__namespace.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] });
|
|
661
|
+
__decorate([
|
|
662
|
+
kwikidToolkit.logMethod
|
|
663
|
+
], BasicRadioConfigEditor.prototype, "ngOnInit", null);
|
|
664
|
+
__decorate([
|
|
665
|
+
kwikidToolkit.logMethod
|
|
666
|
+
], BasicRadioConfigEditor.prototype, "ngOnChanges", null);
|
|
667
|
+
__decorate([
|
|
668
|
+
kwikidToolkit.logMethod
|
|
669
|
+
], BasicRadioConfigEditor.prototype, "createBasicRadioFormGroup", null);
|
|
670
|
+
__decorate([
|
|
671
|
+
kwikidToolkit.logMethod
|
|
672
|
+
], BasicRadioConfigEditor.prototype, "handleOnSave", null);
|
|
673
|
+
__decorate([
|
|
674
|
+
kwikidToolkit.logMethod
|
|
675
|
+
], BasicRadioConfigEditor.prototype, "createOptionConfigFormGroup", null);
|
|
676
|
+
__decorate([
|
|
677
|
+
kwikidToolkit.logMethod
|
|
678
|
+
], BasicRadioConfigEditor.prototype, "addOption", null);
|
|
679
|
+
__decorate([
|
|
680
|
+
kwikidToolkit.logMethod
|
|
681
|
+
], BasicRadioConfigEditor.prototype, "removeOption", null);
|
|
682
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicRadioConfigEditor, decorators: [{
|
|
683
|
+
type: i0.Component,
|
|
684
|
+
args: [{
|
|
685
|
+
selector: "basic-radio-config-editor",
|
|
686
|
+
template: "\n <form [formGroup]=\"basicRadioFormGroup\">\n <fieldset formArrayName=\"options\">\n <legend>Options</legend>\n <ng-container\n *ngFor=\"let option of optionsArray.controls; let i = index\"\n >\n <div [formGroupName]=\"i\">\n <div class=\"form-group\">\n <label for=\"basic-radio-config-placeholder\">label</label>\n <input\n class=\"form-control\"\n formControlName=\"label\"\n id=\"basic-radio-config-placeholder\"\n type=\"text\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-disabled\">disabled</label>\n <select\n class=\"form-control\"\n formControlName=\"disabled\"\n id=\"basic-radio-config-disabled\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Disability</option\n >\n <option\n *ngFor=\"let disabled of [true, false]\"\n [ngValue]=\"disabled\"\n >\n {{ disabled }}\n </option>\n </select>\n </div>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-description\">description</label>\n <input\n class=\"form-control\"\n formControlName=\"description\"\n id=\"basic-radio-config-description\"\n type=\"text\"\n />\n </div>\n </div>\n <div class=\"form-array-actions\">\n <button (click)=\"removeOption(i)\">Remove</button>\n <button (click)=\"addOption()\">Add</button>\n </div>\n </ng-container>\n </fieldset>\n <fieldset formGroupName=\"properties\">\n <legend>Miscellaneous</legend>\n <div class=\"form-group\">\n <label for=\"basic-radio-config-orientation\">Orientation</label>\n <select\n class=\"form-control\"\n formControlName=\"orientation\"\n id=\"basic-radio-config-orientation\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select Orientation</option\n >\n <option\n *ngFor=\"let orientation of ['horizontal', 'vertical']\"\n [ngValue]=\"orientation\"\n >\n {{ orientation }}\n </option>\n </select>\n </div>\n </fieldset>\n </form>\n ",
|
|
687
|
+
styles: [
|
|
688
|
+
"\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 "
|
|
689
|
+
]
|
|
690
|
+
}]
|
|
691
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveBasicClickCounter: [{
|
|
692
|
+
type: i0.Input
|
|
693
|
+
}], elementConfig: [{
|
|
694
|
+
type: i0.Input
|
|
695
|
+
}], updateElement: [{
|
|
696
|
+
type: i0.Output
|
|
697
|
+
}], ngOnInit: [], ngOnChanges: [], createBasicRadioFormGroup: [], handleOnSave: [], createOptionConfigFormGroup: [], addOption: [], removeOption: [] } });
|
|
698
|
+
|
|
699
|
+
var BasicElementConfigEditor = /** @class */ (function () {
|
|
700
|
+
function BasicElementConfigEditor() {
|
|
701
|
+
this.saveClickCounter = 0;
|
|
702
|
+
this.elementConfig = {
|
|
703
|
+
label: "",
|
|
704
|
+
key: "",
|
|
705
|
+
disabled: false,
|
|
706
|
+
default: {
|
|
707
|
+
value: true
|
|
708
|
+
},
|
|
450
709
|
validators: {
|
|
710
|
+
min: null,
|
|
711
|
+
max: null,
|
|
712
|
+
minLength: null,
|
|
713
|
+
maxLength: null,
|
|
451
714
|
required: true
|
|
715
|
+
},
|
|
716
|
+
properties: {
|
|
717
|
+
placeholder: "",
|
|
718
|
+
readOnly: false
|
|
452
719
|
}
|
|
453
720
|
};
|
|
454
|
-
this.
|
|
455
|
-
this.
|
|
456
|
-
this.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
721
|
+
this.updateElement = new i0.EventEmitter();
|
|
722
|
+
this.elementType = "";
|
|
723
|
+
this.saveBasicClickCounter = 0;
|
|
724
|
+
this.basicFormGroup = undefined;
|
|
725
|
+
}
|
|
726
|
+
BasicElementConfigEditor.prototype.ngOnInit = function () {
|
|
727
|
+
this.assignVariables();
|
|
728
|
+
this.createBasicFormGroup();
|
|
729
|
+
};
|
|
730
|
+
BasicElementConfigEditor.prototype.ngOnChanges = function (changes) {
|
|
731
|
+
var verifyChange = function (key) {
|
|
732
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
733
|
+
};
|
|
734
|
+
if (verifyChange("elementConfig")) {
|
|
735
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
736
|
+
this.assignVariables();
|
|
737
|
+
this.createBasicFormGroup();
|
|
738
|
+
}
|
|
739
|
+
if (verifyChange("saveClickCounter")) {
|
|
740
|
+
if (changes.saveClickCounter.previousValue !==
|
|
741
|
+
changes.saveClickCounter.currentValue) {
|
|
742
|
+
this.saveClickCounter = changes.saveClickCounter.currentValue;
|
|
743
|
+
this.handleOnSave();
|
|
474
744
|
}
|
|
475
|
-
|
|
476
|
-
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
BasicElementConfigEditor.prototype.assignVariables = function () {
|
|
748
|
+
this.elementType = this.elementConfig.elementType;
|
|
749
|
+
};
|
|
750
|
+
BasicElementConfigEditor.prototype.createBasicFormGroup = function () {
|
|
751
|
+
this.basicFormGroup = new i1.FormGroup({
|
|
752
|
+
label: new i1.FormControl(this.elementConfig.label),
|
|
753
|
+
key: new i1.FormControl(this.elementConfig.key),
|
|
754
|
+
disabled: new i1.FormControl(this.elementConfig.disabled),
|
|
755
|
+
default: new i1.FormGroup({
|
|
756
|
+
value: new i1.FormControl(this.elementConfig.default.value, {
|
|
757
|
+
updateOn: "change"
|
|
758
|
+
})
|
|
759
|
+
}),
|
|
760
|
+
validators: new i1.FormGroup({
|
|
761
|
+
min: new i1.FormControl(this.elementConfig.validators.min, {
|
|
762
|
+
updateOn: "change"
|
|
763
|
+
}),
|
|
764
|
+
minLength: new i1.FormControl(this.elementConfig.validators.minLength, {
|
|
765
|
+
updateOn: "change"
|
|
766
|
+
}),
|
|
767
|
+
max: new i1.FormControl(this.elementConfig.validators.max, {
|
|
768
|
+
updateOn: "change"
|
|
769
|
+
}),
|
|
770
|
+
maxLength: new i1.FormControl(this.elementConfig.validators.maxLength, {
|
|
771
|
+
updateOn: "change"
|
|
772
|
+
}),
|
|
773
|
+
required: new i1.FormControl(this.elementConfig.validators.required, {
|
|
774
|
+
updateOn: "change"
|
|
775
|
+
})
|
|
776
|
+
}),
|
|
777
|
+
properties: new i1.FormGroup({
|
|
778
|
+
placeholder: new i1.FormControl(this.elementConfig.properties.placeholder, {
|
|
779
|
+
updateOn: "change"
|
|
780
|
+
}),
|
|
781
|
+
readOnly: new i1.FormControl(this.elementConfig.properties.readOnly, {
|
|
782
|
+
updateOn: "change"
|
|
783
|
+
})
|
|
784
|
+
})
|
|
785
|
+
});
|
|
786
|
+
this.basicFormGroup.updateValueAndValidity();
|
|
787
|
+
};
|
|
788
|
+
BasicElementConfigEditor.prototype.handleOnSaveUpdateElement = function (event) {
|
|
789
|
+
// Get Common Config
|
|
790
|
+
var basicElementCommonConfig = this.basicFormGroup.getRawValue();
|
|
791
|
+
basicElementCommonConfig.key = basicElementCommonConfig.key.replace(/\s/g, "_");
|
|
792
|
+
// Get Basic Element Config
|
|
793
|
+
var basicElementConfig = event.basicElementConfig;
|
|
794
|
+
this.elementConfig = ___default["default"].merge(this.elementConfig, basicElementCommonConfig, basicElementConfig);
|
|
795
|
+
this.updateElement.emit({ elementConfig: this.elementConfig });
|
|
796
|
+
};
|
|
797
|
+
BasicElementConfigEditor.prototype.handleOnSave = function () {
|
|
798
|
+
this.saveBasicClickCounter++;
|
|
799
|
+
};
|
|
800
|
+
return BasicElementConfigEditor;
|
|
801
|
+
}());
|
|
802
|
+
/** @nocollapse */ BasicElementConfigEditor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicElementConfigEditor, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
803
|
+
/** @nocollapse */ BasicElementConfigEditor.ɵcmp = i0__namespace.ɵɵ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__namespace, template: "\n <ng-container *ngIf=\"elementConfig !== undefined\">\n <table>\n <tr>\n <td>Id</td>\n <td>{{ elementConfig.elementId }}</td>\n </tr>\n <tr>\n <td>Type</td>\n <td>{{ elementConfig.elementType }}</td>\n </tr>\n <tr>\n <td>Category</td>\n <td>{{ elementConfig.elementCategory }}</td>\n </tr>\n </table>\n </ng-container>\n <form [formGroup]=\"basicFormGroup\">\n <fieldset>\n <legend>Standard</legend>\n <div class=\"form-group\">\n <label for=\"basic-field-label\">Label</label>\n <input\n type=\"text\"\n class=\"form-control\"\n id=\"basic-field-label\"\n formControlName=\"label\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-field-key\">Key</label>\n <input\n type=\"text\"\n class=\"form-control\"\n id=\"basic-field-key\"\n formControlName=\"key\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-disabled\">disabled</label>\n <select\n class=\"form-control\"\n formControlName=\"disabled\"\n id=\"basic-input-property-disabled\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let disabled of [true, false]\"\n [ngValue]=\"disabled\"\n >\n {{ disabled }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"default\">\n <legend>Default</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-property-value\">value</label>\n <select\n class=\"form-control\"\n formControlName=\"value\"\n id=\"basic-input-property-value\"\n >\n <option\n [ngValue]=\"null\"\n value\n >Select either true or false</option\n >\n <option\n *ngFor=\"let value of [true, false]\"\n [ngValue]=\"value\"\n >\n {{ value }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"validators\">\n <legend>Validators</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-min\">min</label>\n <input\n class=\"form-control\"\n formControlName=\"min\"\n id=\"basic-input-validators-min\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-max\">max</label>\n <input\n class=\"form-control\"\n formControlName=\"max\"\n id=\"basic-input-validators-max\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-minLength\">minLength</label>\n <input\n class=\"form-control\"\n formControlName=\"minLength\"\n id=\"basic-input-validators-minLength\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-maxLength\">maxLength</label>\n <input\n class=\"form-control\"\n formControlName=\"maxLength\"\n id=\"basic-input-validators-maxLength\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-required\">required</label>\n <select\n class=\"form-control\"\n formControlName=\"required\"\n id=\"basic-input-property-required\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let required of [true, false]\"\n [ngValue]=\"required\"\n >\n {{ required }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"properties\">\n <legend>Properties</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-property-placeholder\">Placeholder</label>\n <input\n class=\"form-control\"\n formControlName=\"placeholder\"\n id=\"basic-input-property-placeholder\"\n type=\"text\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-readonly\">readOnly</label>\n <select\n class=\"form-control\"\n formControlName=\"readOnly\"\n id=\"basic-input-property-readonly\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let readonly of [true, false]\"\n [ngValue]=\"readonly\"\n >\n {{ readonly }}\n </option>\n </select>\n </div>\n </fieldset>\n <ng-container [ngSwitch]=\"elementType\">\n <ng-container *ngSwitchCase=\"'text'\">\n <basic-text-config-editor\n [saveBasicClickCounter]=\"saveBasicClickCounter\"\n [elementConfig]=\"elementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></basic-text-config-editor>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <basic-radio-config-editor\n [saveBasicClickCounter]=\"saveBasicClickCounter\"\n [elementConfig]=\"elementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></basic-radio-config-editor>\n </ng-container>\n </ng-container>\n </form>\n ", 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.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__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1__namespace.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1__namespace.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1__namespace.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: i1__namespace.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
|
|
804
|
+
__decorate([
|
|
805
|
+
kwikidToolkit.logMethod
|
|
806
|
+
], BasicElementConfigEditor.prototype, "ngOnInit", null);
|
|
807
|
+
__decorate([
|
|
808
|
+
kwikidToolkit.logMethod
|
|
809
|
+
], BasicElementConfigEditor.prototype, "ngOnChanges", null);
|
|
810
|
+
__decorate([
|
|
811
|
+
kwikidToolkit.logMethod
|
|
812
|
+
], BasicElementConfigEditor.prototype, "assignVariables", null);
|
|
813
|
+
__decorate([
|
|
814
|
+
kwikidToolkit.logMethod
|
|
815
|
+
], BasicElementConfigEditor.prototype, "createBasicFormGroup", null);
|
|
816
|
+
__decorate([
|
|
817
|
+
kwikidToolkit.logMethod
|
|
818
|
+
], BasicElementConfigEditor.prototype, "handleOnSaveUpdateElement", null);
|
|
819
|
+
__decorate([
|
|
820
|
+
kwikidToolkit.logMethod
|
|
821
|
+
], BasicElementConfigEditor.prototype, "handleOnSave", null);
|
|
822
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BasicElementConfigEditor, decorators: [{
|
|
823
|
+
type: i0.Component,
|
|
824
|
+
args: [{
|
|
825
|
+
selector: "basic-element-config-editor",
|
|
826
|
+
template: "\n <ng-container *ngIf=\"elementConfig !== undefined\">\n <table>\n <tr>\n <td>Id</td>\n <td>{{ elementConfig.elementId }}</td>\n </tr>\n <tr>\n <td>Type</td>\n <td>{{ elementConfig.elementType }}</td>\n </tr>\n <tr>\n <td>Category</td>\n <td>{{ elementConfig.elementCategory }}</td>\n </tr>\n </table>\n </ng-container>\n <form [formGroup]=\"basicFormGroup\">\n <fieldset>\n <legend>Standard</legend>\n <div class=\"form-group\">\n <label for=\"basic-field-label\">Label</label>\n <input\n type=\"text\"\n class=\"form-control\"\n id=\"basic-field-label\"\n formControlName=\"label\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-field-key\">Key</label>\n <input\n type=\"text\"\n class=\"form-control\"\n id=\"basic-field-key\"\n formControlName=\"key\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-disabled\">disabled</label>\n <select\n class=\"form-control\"\n formControlName=\"disabled\"\n id=\"basic-input-property-disabled\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let disabled of [true, false]\"\n [ngValue]=\"disabled\"\n >\n {{ disabled }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"default\">\n <legend>Default</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-property-value\">value</label>\n <select\n class=\"form-control\"\n formControlName=\"value\"\n id=\"basic-input-property-value\"\n >\n <option\n [ngValue]=\"null\"\n value\n >Select either true or false</option\n >\n <option\n *ngFor=\"let value of [true, false]\"\n [ngValue]=\"value\"\n >\n {{ value }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"validators\">\n <legend>Validators</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-min\">min</label>\n <input\n class=\"form-control\"\n formControlName=\"min\"\n id=\"basic-input-validators-min\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-max\">max</label>\n <input\n class=\"form-control\"\n formControlName=\"max\"\n id=\"basic-input-validators-max\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-minLength\">minLength</label>\n <input\n class=\"form-control\"\n formControlName=\"minLength\"\n id=\"basic-input-validators-minLength\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-validators-maxLength\">maxLength</label>\n <input\n class=\"form-control\"\n formControlName=\"maxLength\"\n id=\"basic-input-validators-maxLength\"\n type=\"number\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-required\">required</label>\n <select\n class=\"form-control\"\n formControlName=\"required\"\n id=\"basic-input-property-required\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let required of [true, false]\"\n [ngValue]=\"required\"\n >\n {{ required }}\n </option>\n </select>\n </div>\n </fieldset>\n <fieldset formGroupName=\"properties\">\n <legend>Properties</legend>\n <div class=\"form-group\">\n <label for=\"basic-input-property-placeholder\">Placeholder</label>\n <input\n class=\"form-control\"\n formControlName=\"placeholder\"\n id=\"basic-input-property-placeholder\"\n type=\"text\"\n />\n </div>\n <div class=\"form-group\">\n <label for=\"basic-input-property-readonly\">readOnly</label>\n <select\n class=\"form-control\"\n formControlName=\"readOnly\"\n id=\"basic-input-property-readonly\"\n >\n <option\n [ngValue]=\"null\"\n disabled\n >Select either true or false</option\n >\n <option\n *ngFor=\"let readonly of [true, false]\"\n [ngValue]=\"readonly\"\n >\n {{ readonly }}\n </option>\n </select>\n </div>\n </fieldset>\n <ng-container [ngSwitch]=\"elementType\">\n <ng-container *ngSwitchCase=\"'text'\">\n <basic-text-config-editor\n [saveBasicClickCounter]=\"saveBasicClickCounter\"\n [elementConfig]=\"elementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></basic-text-config-editor>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <basic-radio-config-editor\n [saveBasicClickCounter]=\"saveBasicClickCounter\"\n [elementConfig]=\"elementConfig\"\n (updateElement)=\"handleOnSaveUpdateElement($event)\"\n ></basic-radio-config-editor>\n </ng-container>\n </ng-container>\n </form>\n ",
|
|
827
|
+
styles: [
|
|
828
|
+
"\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 "
|
|
829
|
+
]
|
|
830
|
+
}]
|
|
831
|
+
}], ctorParameters: function () { return []; }, propDecorators: { saveClickCounter: [{
|
|
832
|
+
type: i0.Input
|
|
833
|
+
}], elementConfig: [{
|
|
834
|
+
type: i0.Input
|
|
835
|
+
}], updateElement: [{
|
|
836
|
+
type: i0.Output
|
|
837
|
+
}], ngOnInit: [], ngOnChanges: [], assignVariables: [], createBasicFormGroup: [], handleOnSaveUpdateElement: [], handleOnSave: [] } });
|
|
838
|
+
|
|
839
|
+
var ElementConfigEditor = /** @class */ (function () {
|
|
840
|
+
function ElementConfigEditor() {
|
|
841
|
+
this.formKey = "";
|
|
842
|
+
this.elementConfig = undefined;
|
|
843
|
+
this.updateElement = new i0.EventEmitter();
|
|
844
|
+
this.elementType = "";
|
|
845
|
+
this.elementCategory = "";
|
|
846
|
+
this.elementEditorFormGroup = undefined;
|
|
847
|
+
this.saveClickCounter = 0;
|
|
848
|
+
}
|
|
849
|
+
ElementConfigEditor.prototype.ngOnInit = function () { };
|
|
850
|
+
ElementConfigEditor.prototype.ngOnChanges = function (changes) {
|
|
851
|
+
var verifyChange = function (key) {
|
|
852
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
853
|
+
};
|
|
854
|
+
if (verifyChange("formKey")) {
|
|
855
|
+
this.formKey = changes.formKey.currentValue;
|
|
856
|
+
}
|
|
857
|
+
if (verifyChange("elementConfig")) {
|
|
858
|
+
this.elementConfig = changes.elementConfig.currentValue;
|
|
859
|
+
if (this.elementConfig !== undefined) {
|
|
860
|
+
this.elementType = this.elementConfig.elementType;
|
|
861
|
+
this.elementCategory = this.elementConfig.elementCategory;
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
throw new Error("'elementConfig' doesn't have 'elementType'");
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
ElementConfigEditor.prototype.updateFormGroup = function () {
|
|
869
|
+
this.elementEditorFormGroup = new i1.FormGroup({
|
|
870
|
+
properties: new i1.FormGroup({
|
|
871
|
+
orientation: new i1.FormControl(this.elementConfig.properties.orientation, {
|
|
872
|
+
updateOn: "change"
|
|
873
|
+
})
|
|
874
|
+
})
|
|
875
|
+
});
|
|
876
|
+
this.elementEditorFormGroup.updateValueAndValidity();
|
|
877
|
+
};
|
|
878
|
+
ElementConfigEditor.prototype.handleOnSaveUpdateElement = function (event) {
|
|
879
|
+
this.updateElement.emit(event);
|
|
880
|
+
};
|
|
881
|
+
ElementConfigEditor.prototype.handleOnClickSave = function () {
|
|
882
|
+
this.saveClickCounter++;
|
|
883
|
+
};
|
|
884
|
+
return ElementConfigEditor;
|
|
885
|
+
}());
|
|
886
|
+
/** @nocollapse */ ElementConfigEditor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementConfigEditor, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
887
|
+
/** @nocollapse */ ElementConfigEditor.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
888
|
+
__decorate([
|
|
889
|
+
kwikidToolkit.logMethod
|
|
890
|
+
], ElementConfigEditor.prototype, "ngOnInit", null);
|
|
891
|
+
__decorate([
|
|
892
|
+
kwikidToolkit.logMethod
|
|
893
|
+
], ElementConfigEditor.prototype, "ngOnChanges", null);
|
|
894
|
+
__decorate([
|
|
895
|
+
kwikidToolkit.logMethod
|
|
896
|
+
], ElementConfigEditor.prototype, "updateFormGroup", null);
|
|
897
|
+
__decorate([
|
|
898
|
+
kwikidToolkit.logMethod
|
|
899
|
+
], ElementConfigEditor.prototype, "handleOnSaveUpdateElement", null);
|
|
900
|
+
__decorate([
|
|
901
|
+
kwikidToolkit.logMethod
|
|
902
|
+
], ElementConfigEditor.prototype, "handleOnClickSave", null);
|
|
903
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementConfigEditor, decorators: [{
|
|
904
|
+
type: i0.Component,
|
|
905
|
+
args: [{
|
|
906
|
+
selector: "element-config-editor",
|
|
907
|
+
templateUrl: "./element-config-editor.component.html",
|
|
908
|
+
styleUrls: [
|
|
909
|
+
"./element-config-editor.component.scss",
|
|
910
|
+
"../shared/shared.scss"
|
|
911
|
+
],
|
|
912
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
913
|
+
}]
|
|
914
|
+
}], ctorParameters: function () { return []; }, propDecorators: { formKey: [{
|
|
915
|
+
type: i0.Input
|
|
916
|
+
}], elementConfig: [{
|
|
917
|
+
type: i0.Input
|
|
918
|
+
}], updateElement: [{
|
|
919
|
+
type: i0.Output
|
|
920
|
+
}], ngOnInit: [], ngOnChanges: [], updateFormGroup: [], handleOnSaveUpdateElement: [], handleOnClickSave: [] } });
|
|
921
|
+
|
|
922
|
+
var KwikIDFormsBuilderComponent = /** @class */ (function () {
|
|
923
|
+
function KwikIDFormsBuilderComponent() {
|
|
924
|
+
var _this = this;
|
|
925
|
+
this.formKey = "";
|
|
926
|
+
this.formTitle = "";
|
|
927
|
+
this.builderFormGroup = undefined;
|
|
928
|
+
this.basicElements = new Elements().basic;
|
|
929
|
+
this.documentElements = new Elements().documents;
|
|
930
|
+
this.otherElements = new Elements().others;
|
|
931
|
+
this.templateElements = new Elements().templates;
|
|
932
|
+
this.elementsMapping = new Elements().elementMapping;
|
|
933
|
+
this.formElementsDragList = [];
|
|
934
|
+
this.formElementsDropList = [];
|
|
935
|
+
this.elementEditorElementConfig = undefined;
|
|
936
|
+
this.builderFormGroup = new i1.FormGroup({
|
|
937
|
+
formKey: new i1.FormControl("", [i1.Validators.required]),
|
|
938
|
+
formTitle: new i1.FormControl("", [i1.Validators.required])
|
|
939
|
+
});
|
|
940
|
+
var formDropConfig = kwikidToolkit.getObjectFromLocalStorage("formDropConfig");
|
|
941
|
+
if (kwikidToolkit.isNotEmptyValue(formDropConfig)) {
|
|
942
|
+
this.formKey = formDropConfig.key;
|
|
943
|
+
this.formTitle = formDropConfig.title;
|
|
944
|
+
var formFields = formDropConfig.fields.map(function (item) {
|
|
945
|
+
item.elementId = revisedRandId();
|
|
946
|
+
item.elementCategory = _this.elementsMapping.basic.includes(item.type)
|
|
947
|
+
? "basic"
|
|
948
|
+
: _this.elementsMapping.documents.includes(item.type)
|
|
949
|
+
? "document"
|
|
950
|
+
: "others";
|
|
951
|
+
item.elementType =
|
|
952
|
+
item.elementCategory === "basic" ||
|
|
953
|
+
item.elementCategory === "document"
|
|
954
|
+
? item.type
|
|
955
|
+
: String("NA<>" + item.type);
|
|
956
|
+
item.isElement = true;
|
|
957
|
+
var elementFiltered = item.elementCategory === "basic"
|
|
958
|
+
? _this.basicElements.find(function (element) { return element.elementType === item.type; })
|
|
959
|
+
: item.elementCategory === "document"
|
|
960
|
+
? _this.documentElements.find(function (element) { return element.elementType === item.type; })
|
|
961
|
+
: item.elementCategory === "others"
|
|
962
|
+
? _this.otherElements.find(function (element) { return element.elementType === item.type; })
|
|
963
|
+
: undefined;
|
|
964
|
+
console.log(elementFiltered);
|
|
965
|
+
item.elementTitle = kwikidToolkit.isEmptyValue(elementFiltered)
|
|
966
|
+
? item.elementCategory + "::" + item.elementType
|
|
967
|
+
: elementFiltered.elementTitle;
|
|
968
|
+
return item;
|
|
969
|
+
});
|
|
970
|
+
this.formElementsDropList = formFields;
|
|
971
|
+
console.log(formFields);
|
|
972
|
+
}
|
|
477
973
|
}
|
|
478
974
|
KwikIDFormsBuilderComponent.prototype.ngOnInit = function () {
|
|
479
975
|
var e_1, _a;
|
|
976
|
+
this.formElementsDragList = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
|
977
|
+
{ isElement: false, elementTitle: "Basic Elements" }
|
|
978
|
+
], __read(this.basicElements)), [
|
|
979
|
+
{ isElement: false, elementTitle: "Document Elements" }
|
|
980
|
+
]), __read(this.documentElements)), [
|
|
981
|
+
{ isElement: false, elementTitle: "Other Elements" }
|
|
982
|
+
]), __read(this.otherElements));
|
|
480
983
|
try {
|
|
481
|
-
for (var _b = __values(this.
|
|
482
|
-
var
|
|
483
|
-
|
|
984
|
+
for (var _b = __values(this.formElementsDragList), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
985
|
+
var formElementsDragItem = _c.value;
|
|
986
|
+
formElementsDragItem.elementId = revisedRandId();
|
|
484
987
|
}
|
|
485
988
|
}
|
|
486
989
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -491,89 +994,206 @@
|
|
|
491
994
|
finally { if (e_1) throw e_1.error; }
|
|
492
995
|
}
|
|
493
996
|
};
|
|
494
|
-
KwikIDFormsBuilderComponent.prototype.revisedRandId = function () {
|
|
495
|
-
return Math.random()
|
|
496
|
-
.toString(36)
|
|
497
|
-
.replace(/[^a-z]+/g, "");
|
|
498
|
-
};
|
|
499
997
|
KwikIDFormsBuilderComponent.prototype.handleOnChange = function (event, id, key, idx) {
|
|
500
998
|
var _value = event.target.value;
|
|
501
|
-
this.formGroup.controls[id]["controls"][key].patchValue(_value);
|
|
502
999
|
};
|
|
503
|
-
|
|
504
|
-
|
|
1000
|
+
// DOM Event Handlers
|
|
1001
|
+
KwikIDFormsBuilderComponent.prototype.handleGetKeyValue = function (e) {
|
|
1002
|
+
var _a;
|
|
1003
|
+
this.builderFormGroup.patchValue((_a = {},
|
|
1004
|
+
_a[e.key] = e.value,
|
|
1005
|
+
_a), { emitEvent: false });
|
|
505
1006
|
};
|
|
506
|
-
KwikIDFormsBuilderComponent.prototype.drop = function (event) {
|
|
1007
|
+
KwikIDFormsBuilderComponent.prototype.drop = function (event, elementCategory) {
|
|
507
1008
|
// let item = JSON.parse(JSON.stringify(event));
|
|
508
1009
|
if (event.previousContainer !== event.container) {
|
|
509
1010
|
console.log("copying");
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
1011
|
+
if (event.item.data.isElement) {
|
|
1012
|
+
// Clone the item that was dropped.
|
|
1013
|
+
var draggedItemIndex = this.formElementsDragList.findIndex(function (item) {
|
|
1014
|
+
return item.elementId === event.item.data.elementId;
|
|
1015
|
+
});
|
|
1016
|
+
i4.copyArrayItem(this.formElementsDragList, this.formElementsDropList, draggedItemIndex, event.currentIndex);
|
|
1017
|
+
this.formElementsDragList = JSON.parse(JSON.stringify(this.formElementsDragList.map(function (item) {
|
|
1018
|
+
item.elementId = revisedRandId();
|
|
1019
|
+
return item;
|
|
1020
|
+
})));
|
|
1021
|
+
}
|
|
521
1022
|
}
|
|
522
1023
|
else {
|
|
523
1024
|
console.log("moving");
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
if (event.previousContainer.data) {
|
|
527
|
-
this.menu = this.menu.filter(function (f) { return !f.temp; });
|
|
1025
|
+
i4.moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
528
1026
|
}
|
|
529
1027
|
};
|
|
530
|
-
KwikIDFormsBuilderComponent.prototype.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
this.menu = this.menu.filter(function (f) { return !f.temp; });
|
|
536
|
-
};
|
|
537
|
-
KwikIDFormsBuilderComponent.prototype.isNumber = function (val) {
|
|
538
|
-
return typeof val;
|
|
1028
|
+
KwikIDFormsBuilderComponent.prototype.exit = function (event, elementCategory) { };
|
|
1029
|
+
KwikIDFormsBuilderComponent.prototype.enter = function (event, elementCategory) { };
|
|
1030
|
+
/** Predicate function that only allows isElement: true items to be dropped into a list. */
|
|
1031
|
+
KwikIDFormsBuilderComponent.prototype.isElementPredicate = function (item) {
|
|
1032
|
+
return item.data.isElement;
|
|
539
1033
|
};
|
|
540
1034
|
KwikIDFormsBuilderComponent.prototype.removeElement = function (idx, id) {
|
|
541
|
-
this.
|
|
542
|
-
this.table.splice(idx, 1);
|
|
1035
|
+
this.formElementsDropList.splice(idx, 1);
|
|
543
1036
|
};
|
|
544
|
-
KwikIDFormsBuilderComponent.prototype.
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1037
|
+
KwikIDFormsBuilderComponent.prototype.editElement = function (idx, item) {
|
|
1038
|
+
this.elementEditorElementConfig = item;
|
|
1039
|
+
};
|
|
1040
|
+
KwikIDFormsBuilderComponent.prototype.handleOnSaveUpdateElement = function (event) { };
|
|
1041
|
+
KwikIDFormsBuilderComponent.prototype.handleOnClickSaveForms = function (event) {
|
|
1042
|
+
var _this = this;
|
|
1043
|
+
if (kwikidToolkit.isEmptyValue(this.formKey)) {
|
|
1044
|
+
window.alert("Please provide Form Key");
|
|
1045
|
+
return;
|
|
551
1046
|
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
1047
|
+
else {
|
|
1048
|
+
this.formKey = this.formKey.replace(/\s/g, "_").toLocaleUpperCase();
|
|
1049
|
+
}
|
|
1050
|
+
if (kwikidToolkit.isEmptyValue(this.formTitle)) {
|
|
1051
|
+
window.alert("Please provide Form Title");
|
|
1052
|
+
return;
|
|
558
1053
|
}
|
|
559
|
-
|
|
1054
|
+
var finalFields = JSON.parse(JSON.stringify(this.formElementsDropList));
|
|
1055
|
+
finalFields = finalFields.map(function (item) {
|
|
1056
|
+
if (item.elementType.startsWith("NA<>", 0)) {
|
|
1057
|
+
delete item.elementId;
|
|
1058
|
+
delete item.elementType;
|
|
1059
|
+
delete item.elementTitle;
|
|
1060
|
+
delete item.elementCategory;
|
|
1061
|
+
delete item.isElement;
|
|
1062
|
+
return item;
|
|
1063
|
+
}
|
|
1064
|
+
delete item.elementId;
|
|
1065
|
+
delete item.elementType;
|
|
1066
|
+
delete item.elementTitle;
|
|
1067
|
+
delete item.elementCategory;
|
|
1068
|
+
delete item.isElement;
|
|
1069
|
+
if (item.default.value) {
|
|
1070
|
+
item.default = {
|
|
1071
|
+
value: {
|
|
1072
|
+
is_found: false,
|
|
1073
|
+
value: "",
|
|
1074
|
+
sources: [
|
|
1075
|
+
{
|
|
1076
|
+
key: "OBJECT",
|
|
1077
|
+
props: {
|
|
1078
|
+
object: {
|
|
1079
|
+
key: "ALL_FORMS_DATA",
|
|
1080
|
+
path: String("$." + _this.formKey + "." + item.key)
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
value: "",
|
|
1084
|
+
validation: {
|
|
1085
|
+
is_valid: false,
|
|
1086
|
+
triggers: ["ON_INIT"],
|
|
1087
|
+
rules: [
|
|
1088
|
+
{
|
|
1089
|
+
id: "1",
|
|
1090
|
+
key: "VALUE_CHECK",
|
|
1091
|
+
props: {
|
|
1092
|
+
value: {
|
|
1093
|
+
source: {
|
|
1094
|
+
key: "OBJECT",
|
|
1095
|
+
props: {
|
|
1096
|
+
object: {
|
|
1097
|
+
key: "ALL_FORMS_DATA",
|
|
1098
|
+
path: String("$." + _this.formKey + "." + item.key)
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
pattern: { key: "IS_NOT_EMPTY" }
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
],
|
|
1107
|
+
actions: [
|
|
1108
|
+
{
|
|
1109
|
+
id: "1",
|
|
1110
|
+
key: "SET_FIELD_DEFAULT_VALUE",
|
|
1111
|
+
condition: "1",
|
|
1112
|
+
props: {
|
|
1113
|
+
fieldKey: String("" + item.key),
|
|
1114
|
+
value: {
|
|
1115
|
+
source: {
|
|
1116
|
+
key: "OBJECT",
|
|
1117
|
+
props: {
|
|
1118
|
+
object: {
|
|
1119
|
+
key: "ALL_FORMS_DATA",
|
|
1120
|
+
path: String("$." + _this.formKey + "." + item.key)
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
]
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
else {
|
|
1135
|
+
item.default = {
|
|
1136
|
+
value: {
|
|
1137
|
+
is_found: false,
|
|
1138
|
+
value: "",
|
|
1139
|
+
sources: []
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
return item;
|
|
1144
|
+
});
|
|
1145
|
+
var finalFormConfig = {
|
|
1146
|
+
key: this.formKey,
|
|
1147
|
+
title: this.formTitle,
|
|
1148
|
+
fields: finalFields
|
|
1149
|
+
};
|
|
1150
|
+
localStorage.setItem("rendererFormConfig", JSON.stringify(finalFormConfig));
|
|
1151
|
+
localStorage.setItem("builderFormConfig", JSON.stringify({
|
|
1152
|
+
key: this.formKey,
|
|
1153
|
+
title: this.formTitle,
|
|
1154
|
+
fields: this.formElementsDropList
|
|
1155
|
+
}));
|
|
1156
|
+
console.log(finalFormConfig);
|
|
1157
|
+
console.log(this.formElementsDropList);
|
|
560
1158
|
};
|
|
561
1159
|
return KwikIDFormsBuilderComponent;
|
|
562
1160
|
}());
|
|
563
1161
|
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsBuilderComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
564
|
-
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", ngImport: i0__namespace, 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"] });
|
|
1162
|
+
/** @nocollapse */ KwikIDFormsBuilderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDFormsBuilderComponent, selector: "kwikid-forms-builder", ngImport: i0__namespace, 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__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "size", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2__namespace.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__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4__namespace.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__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.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__namespace.CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }] });
|
|
1163
|
+
__decorate([
|
|
1164
|
+
kwikidToolkit.logMethod
|
|
1165
|
+
], KwikIDFormsBuilderComponent.prototype, "handleGetKeyValue", null);
|
|
1166
|
+
__decorate([
|
|
1167
|
+
kwikidToolkit.logMethod
|
|
1168
|
+
], KwikIDFormsBuilderComponent.prototype, "drop", null);
|
|
1169
|
+
__decorate([
|
|
1170
|
+
kwikidToolkit.logMethod
|
|
1171
|
+
], KwikIDFormsBuilderComponent.prototype, "exit", null);
|
|
1172
|
+
__decorate([
|
|
1173
|
+
kwikidToolkit.logMethod
|
|
1174
|
+
], KwikIDFormsBuilderComponent.prototype, "enter", null);
|
|
1175
|
+
__decorate([
|
|
1176
|
+
kwikidToolkit.logMethod
|
|
1177
|
+
], KwikIDFormsBuilderComponent.prototype, "removeElement", null);
|
|
1178
|
+
__decorate([
|
|
1179
|
+
kwikidToolkit.logMethod
|
|
1180
|
+
], KwikIDFormsBuilderComponent.prototype, "editElement", null);
|
|
1181
|
+
__decorate([
|
|
1182
|
+
kwikidToolkit.logMethod
|
|
1183
|
+
], KwikIDFormsBuilderComponent.prototype, "handleOnSaveUpdateElement", null);
|
|
565
1184
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsBuilderComponent, decorators: [{
|
|
566
1185
|
type: i0.Component,
|
|
567
1186
|
args: [{
|
|
568
1187
|
selector: "kwikid-forms-builder",
|
|
569
1188
|
templateUrl: "./builder.component.html",
|
|
570
|
-
styleUrls: ["./builder.component.scss"]
|
|
1189
|
+
styleUrls: ["shared/shared.scss", "./builder.component.scss"]
|
|
571
1190
|
}]
|
|
572
|
-
}], ctorParameters: function () { return []; } });
|
|
1191
|
+
}], ctorParameters: function () { return []; }, propDecorators: { handleGetKeyValue: [], drop: [], exit: [], enter: [], removeElement: [], editElement: [], handleOnSaveUpdateElement: [] } });
|
|
573
1192
|
|
|
574
1193
|
var EActionKey;
|
|
575
1194
|
(function (EActionKey) {
|
|
576
1195
|
EActionKey["SET_VALUE"] = "SET_VALUE";
|
|
1196
|
+
EActionKey["SET_FIELD_DEFAULT_VALUE"] = "SET_FIELD_DEFAULT_VALUE";
|
|
577
1197
|
EActionKey["FIELD_MESSAGE_SHOW"] = "FIELD_MESSAGE_SHOW";
|
|
578
1198
|
EActionKey["FIELD_MESSAGES_HIDE"] = "FIELD_MESSAGES_HIDE";
|
|
579
1199
|
EActionKey["FIELD_ERROR_SHOW"] = "FIELD_ERROR_SHOW";
|
|
@@ -996,38 +1616,38 @@
|
|
|
996
1616
|
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
997
1617
|
kwikidToolkit.checkObjectKeyExists(field.validators, "min") &&
|
|
998
1618
|
kwikidToolkit.isNotEmptyValue(field.validators.min)) {
|
|
999
|
-
validators.push(
|
|
1619
|
+
validators.push(i1.Validators.min(field.validators.min));
|
|
1000
1620
|
}
|
|
1001
1621
|
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1002
1622
|
kwikidToolkit.checkObjectKeyExists(field.validators, "max") &&
|
|
1003
1623
|
kwikidToolkit.isNotEmptyValue(field.validators.max)) {
|
|
1004
|
-
validators.push(
|
|
1624
|
+
validators.push(i1.Validators.max(field.validators.max));
|
|
1005
1625
|
}
|
|
1006
1626
|
if ((kwikidToolkit.checkObjectKeyExists(field, "required") && field.required) ||
|
|
1007
1627
|
(kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1008
1628
|
kwikidToolkit.checkObjectKeyExists(field.validators, "required") &&
|
|
1009
1629
|
field.validators.required)) {
|
|
1010
|
-
validators.push(
|
|
1630
|
+
validators.push(i1.Validators.required);
|
|
1011
1631
|
}
|
|
1012
1632
|
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1013
1633
|
kwikidToolkit.checkObjectKeyExists(field.validators, "minLength") &&
|
|
1014
1634
|
kwikidToolkit.isNotEmptyValue(field.validators.minLength)) {
|
|
1015
|
-
validators.push(
|
|
1635
|
+
validators.push(i1.Validators.minLength(field.validators.minLength));
|
|
1016
1636
|
}
|
|
1017
1637
|
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1018
1638
|
kwikidToolkit.checkObjectKeyExists(field.validators, "maxLength") &&
|
|
1019
1639
|
kwikidToolkit.isNotEmptyValue(field.validators.maxLength)) {
|
|
1020
|
-
validators.push(
|
|
1640
|
+
validators.push(i1.Validators.maxLength(field.validators.maxLength));
|
|
1021
1641
|
}
|
|
1022
1642
|
if (kwikidToolkit.checkObjectKeyExists(field, "validators") &&
|
|
1023
1643
|
kwikidToolkit.checkObjectKeyExists(field.validators, "pattern") &&
|
|
1024
1644
|
kwikidToolkit.isNotEmptyValue(field.validators.pattern)) {
|
|
1025
1645
|
if (kwikidToolkit.checkObjectKeyExists(field.validators.pattern, "key")) {
|
|
1026
1646
|
if (field.validators.pattern.key === "CUSTOM") {
|
|
1027
|
-
validators.push(
|
|
1647
|
+
validators.push(i1.Validators.pattern(field.validators.pattern.pattern));
|
|
1028
1648
|
}
|
|
1029
1649
|
else {
|
|
1030
|
-
validators.push(
|
|
1650
|
+
validators.push(i1.Validators.pattern(kwikidToolkit.PATTERNS[field.validators.pattern.key]));
|
|
1031
1651
|
}
|
|
1032
1652
|
}
|
|
1033
1653
|
}
|
|
@@ -1068,10 +1688,10 @@
|
|
|
1068
1688
|
invalid: false
|
|
1069
1689
|
});
|
|
1070
1690
|
}
|
|
1071
|
-
if (control instanceof
|
|
1691
|
+
if (control instanceof i1.FormGroup) {
|
|
1072
1692
|
recursiveFunc(control);
|
|
1073
1693
|
}
|
|
1074
|
-
else if (control instanceof
|
|
1694
|
+
else if (control instanceof i1.FormArray) {
|
|
1075
1695
|
recursiveFunc(control);
|
|
1076
1696
|
}
|
|
1077
1697
|
});
|
|
@@ -1102,7 +1722,7 @@
|
|
|
1102
1722
|
return __generator(this, function (_b) {
|
|
1103
1723
|
switch (_b.label) {
|
|
1104
1724
|
case 0:
|
|
1105
|
-
formGroup = new
|
|
1725
|
+
formGroup = new i1.FormGroup({});
|
|
1106
1726
|
_b.label = 1;
|
|
1107
1727
|
case 1:
|
|
1108
1728
|
_b.trys.push([1, 8, 9, 10]);
|
|
@@ -1126,7 +1746,7 @@
|
|
|
1126
1746
|
case 5:
|
|
1127
1747
|
value = convertFormFieldValueToKwikUIFormat(field, value);
|
|
1128
1748
|
validators = new FormValidation().getFormFieldValidators(field);
|
|
1129
|
-
formGroup.addControl(field.key, new
|
|
1749
|
+
formGroup.addControl(field.key, new i1.FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
|
|
1130
1750
|
_b.label = 6;
|
|
1131
1751
|
case 6:
|
|
1132
1752
|
fields_1_1 = fields_1.next();
|
|
@@ -1445,6 +2065,8 @@
|
|
|
1445
2065
|
switch (_f.label) {
|
|
1446
2066
|
case 0:
|
|
1447
2067
|
headers = this._request.headers;
|
|
2068
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request, "headers")) return [3 /*break*/, 11];
|
|
2069
|
+
if (!kwikidToolkit.checkObjectKeyExists(this._request.headers, "validation")) return [3 /*break*/, 9];
|
|
1448
2070
|
validation = headers.validation;
|
|
1449
2071
|
triggers = validation.triggers;
|
|
1450
2072
|
rules = validation.rules;
|
|
@@ -1480,6 +2102,10 @@
|
|
|
1480
2102
|
finally { if (e_8) throw e_8.error; }
|
|
1481
2103
|
return [7 /*endfinally*/];
|
|
1482
2104
|
case 8: return [2 /*return*/, this._object.FIELD_CONFIG];
|
|
2105
|
+
case 9: return [2 /*return*/, this._object.FIELD_CONFIG];
|
|
2106
|
+
case 10: return [3 /*break*/, 12];
|
|
2107
|
+
case 11: return [2 /*return*/, this._object.FIELD_CONFIG];
|
|
2108
|
+
case 12: return [2 /*return*/];
|
|
1483
2109
|
}
|
|
1484
2110
|
});
|
|
1485
2111
|
});
|
|
@@ -1562,21 +2188,20 @@
|
|
|
1562
2188
|
};
|
|
1563
2189
|
return SafeHtmlPipe;
|
|
1564
2190
|
}());
|
|
1565
|
-
/** @nocollapse */ SafeHtmlPipe$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe$1, deps: [{ token: i1__namespace.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
2191
|
+
/** @nocollapse */ SafeHtmlPipe$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe$1, deps: [{ token: i1__namespace$1.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1566
2192
|
/** @nocollapse */ SafeHtmlPipe$1.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe$1, name: "safeHtml" });
|
|
1567
2193
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe$1, decorators: [{
|
|
1568
2194
|
type: i0.Pipe,
|
|
1569
2195
|
args: [{
|
|
1570
2196
|
name: "safeHtml"
|
|
1571
2197
|
}]
|
|
1572
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }]; } });
|
|
2198
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }]; } });
|
|
1573
2199
|
|
|
1574
2200
|
var KwikIDFormViewComponent = /** @class */ (function () {
|
|
1575
2201
|
function KwikIDFormViewComponent(push, alert, formViewService) {
|
|
1576
2202
|
this.push = push;
|
|
1577
2203
|
this.alert = alert;
|
|
1578
2204
|
this.formViewService = formViewService;
|
|
1579
|
-
this.apiCallResponse = {};
|
|
1580
2205
|
this.isMobileView = false;
|
|
1581
2206
|
this.onClickViewForms = new i0.EventEmitter();
|
|
1582
2207
|
this.onClickSaveForm = new i0.EventEmitter();
|
|
@@ -1594,14 +2219,14 @@
|
|
|
1594
2219
|
disabled: false,
|
|
1595
2220
|
showLoader: false
|
|
1596
2221
|
};
|
|
1597
|
-
this.formGroup = new
|
|
2222
|
+
this.formGroup = new i1.FormGroup({});
|
|
1598
2223
|
this.showErrorNotification = false;
|
|
1599
2224
|
}
|
|
1600
2225
|
KwikIDFormViewComponent.prototype.ngOnInit = function () {
|
|
1601
2226
|
var _this = this;
|
|
1602
2227
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1603
|
-
return __generator(this, function (
|
|
1604
|
-
switch (
|
|
2228
|
+
return __generator(this, function (_h) {
|
|
2229
|
+
switch (_h.label) {
|
|
1605
2230
|
case 0:
|
|
1606
2231
|
this.formsList = this.formsList.filter(function (form) {
|
|
1607
2232
|
if (kwikidToolkit.checkObjectKeyExists(form, "hidden")) {
|
|
@@ -1613,7 +2238,7 @@
|
|
|
1613
2238
|
this.formsListLength = this.findFormsListLength(this.formsList);
|
|
1614
2239
|
return [4 /*yield*/, this.initFormConfig(this.formConfig)];
|
|
1615
2240
|
case 1:
|
|
1616
|
-
|
|
2241
|
+
_h.sent();
|
|
1617
2242
|
this.loading = false;
|
|
1618
2243
|
return [2 /*return*/];
|
|
1619
2244
|
}
|
|
@@ -1622,7 +2247,6 @@
|
|
|
1622
2247
|
};
|
|
1623
2248
|
KwikIDFormViewComponent.prototype.ngAfterViewInit = function () { };
|
|
1624
2249
|
KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
|
|
1625
|
-
var _b, _c;
|
|
1626
2250
|
var _this = this;
|
|
1627
2251
|
var verifyChange = function (key) {
|
|
1628
2252
|
return kwikidToolkit.checkObjectKeyExists(changes, key) && !changes[key].firstChange;
|
|
@@ -1630,31 +2254,6 @@
|
|
|
1630
2254
|
if (verifyChange("formData")) {
|
|
1631
2255
|
this.formData = Object.assign(Object.assign({}, this.formData), changes.formData.currentValue);
|
|
1632
2256
|
}
|
|
1633
|
-
if (verifyChange("apiCallResponse")) {
|
|
1634
|
-
this.apiCallResponse = changes.apiCallResponse.currentValue;
|
|
1635
|
-
this.formData = Object.assign(Object.assign({}, this.formData), (_b = {}, _b[this.apiCallResponse.key] = this.apiCallResponse.response, _b));
|
|
1636
|
-
this.formGroup.patchValue((_c = {},
|
|
1637
|
-
_c[this.apiCallResponse.key] = this.apiCallResponse.response,
|
|
1638
|
-
_c), { emitEvent: false });
|
|
1639
|
-
var field_1 = getFormFieldByKey(this.formFields, this.apiCallResponse.key);
|
|
1640
|
-
var apis_1 = new Apis({
|
|
1641
|
-
FIELD_CONFIG: field_1,
|
|
1642
|
-
FORM_FIELDS: this.formFields,
|
|
1643
|
-
FORM_DATA: this.formData,
|
|
1644
|
-
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1645
|
-
ALL_FORMS_DATA: this.allFormsData
|
|
1646
|
-
}, this.takeAction.bind(this));
|
|
1647
|
-
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1648
|
-
return __generator(this, function (_b) {
|
|
1649
|
-
switch (_b.label) {
|
|
1650
|
-
case 0: return [4 /*yield*/, apis_1.validateResponse()];
|
|
1651
|
-
case 1:
|
|
1652
|
-
field_1 = _b.sent();
|
|
1653
|
-
return [2 /*return*/];
|
|
1654
|
-
}
|
|
1655
|
-
});
|
|
1656
|
-
}); })();
|
|
1657
|
-
}
|
|
1658
2257
|
if (verifyChange("isMobileView")) {
|
|
1659
2258
|
this.isMobileView = changes.isMobileView.currentValue;
|
|
1660
2259
|
}
|
|
@@ -1674,11 +2273,11 @@
|
|
|
1674
2273
|
if (verifyChange("formConfig")) {
|
|
1675
2274
|
this.formConfig = changes.formConfig.currentValue;
|
|
1676
2275
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1677
|
-
return __generator(this, function (
|
|
1678
|
-
switch (
|
|
2276
|
+
return __generator(this, function (_h) {
|
|
2277
|
+
switch (_h.label) {
|
|
1679
2278
|
case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
|
|
1680
2279
|
case 1:
|
|
1681
|
-
|
|
2280
|
+
_h.sent();
|
|
1682
2281
|
return [2 /*return*/];
|
|
1683
2282
|
}
|
|
1684
2283
|
});
|
|
@@ -1706,55 +2305,55 @@
|
|
|
1706
2305
|
};
|
|
1707
2306
|
KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
|
|
1708
2307
|
return __awaiter(this, void 0, void 0, function () {
|
|
1709
|
-
var
|
|
1710
|
-
var e_2,
|
|
2308
|
+
var _h, _loop_1, this_1, _j, _k, field, _l, _m, field, validations, e_1_1;
|
|
2309
|
+
var e_2, _o, e_1, _p;
|
|
1711
2310
|
var _this = this;
|
|
1712
|
-
return __generator(this, function (
|
|
1713
|
-
switch (
|
|
2311
|
+
return __generator(this, function (_q) {
|
|
2312
|
+
switch (_q.label) {
|
|
1714
2313
|
case 0:
|
|
1715
2314
|
this.setFormFieldsFromFormConfig(formConfig);
|
|
1716
2315
|
this.setFormFieldGroupsFromFormConfig(formConfig);
|
|
1717
2316
|
this.setFormDataFromAllFormsData();
|
|
1718
|
-
|
|
2317
|
+
_h = this;
|
|
1719
2318
|
return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
|
|
1720
2319
|
case 1:
|
|
1721
|
-
|
|
2320
|
+
_h.formGroup = _q.sent();
|
|
1722
2321
|
_loop_1 = function (field) {
|
|
1723
|
-
var
|
|
2322
|
+
var _r;
|
|
1724
2323
|
if (field.isFormElement) {
|
|
1725
|
-
this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (
|
|
2324
|
+
this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_r = {}, _r[field.key] = this_1.formGroup.controls[field.key].value, _r));
|
|
1726
2325
|
this_1.formGroup.controls[field.key].valueChanges
|
|
1727
2326
|
.pipe(operators.pairwise())
|
|
1728
|
-
.subscribe(function (
|
|
1729
|
-
var
|
|
1730
|
-
var
|
|
1731
|
-
_this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (
|
|
1732
|
-
_this.formData = Object.assign(Object.assign({}, _this.formData), (
|
|
2327
|
+
.subscribe(function (_h) {
|
|
2328
|
+
var _j, _k;
|
|
2329
|
+
var _l = __read(_h, 2), previousValue = _l[0], currentValue = _l[1];
|
|
2330
|
+
_this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_j = {}, _j[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _j));
|
|
2331
|
+
_this.formData = Object.assign(Object.assign({}, _this.formData), (_k = {}, _k[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _k));
|
|
1733
2332
|
});
|
|
1734
2333
|
}
|
|
1735
2334
|
};
|
|
1736
2335
|
this_1 = this;
|
|
1737
2336
|
try {
|
|
1738
|
-
for (
|
|
1739
|
-
field =
|
|
2337
|
+
for (_j = __values(this.formFields), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
2338
|
+
field = _k.value;
|
|
1740
2339
|
_loop_1(field);
|
|
1741
2340
|
}
|
|
1742
2341
|
}
|
|
1743
2342
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1744
2343
|
finally {
|
|
1745
2344
|
try {
|
|
1746
|
-
if (
|
|
2345
|
+
if (_k && !_k.done && (_o = _j.return)) _o.call(_j);
|
|
1747
2346
|
}
|
|
1748
2347
|
finally { if (e_2) throw e_2.error; }
|
|
1749
2348
|
}
|
|
1750
|
-
|
|
2349
|
+
_q.label = 2;
|
|
1751
2350
|
case 2:
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
2351
|
+
_q.trys.push([2, 8, 9, 10]);
|
|
2352
|
+
_l = __values(this.formFields), _m = _l.next();
|
|
2353
|
+
_q.label = 3;
|
|
1755
2354
|
case 3:
|
|
1756
|
-
if (!!
|
|
1757
|
-
field =
|
|
2355
|
+
if (!!_m.done) return [3 /*break*/, 7];
|
|
2356
|
+
field = _m.value;
|
|
1758
2357
|
if (!field.isFormElement) return [3 /*break*/, 6];
|
|
1759
2358
|
if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 5];
|
|
1760
2359
|
validations = new kwikidToolkit.Validation({
|
|
@@ -1766,8 +2365,8 @@
|
|
|
1766
2365
|
}, this.takeAction.bind(this));
|
|
1767
2366
|
return [4 /*yield*/, validations.validate(field.validation)];
|
|
1768
2367
|
case 4:
|
|
1769
|
-
|
|
1770
|
-
|
|
2368
|
+
_q.sent();
|
|
2369
|
+
_q.label = 5;
|
|
1771
2370
|
case 5:
|
|
1772
2371
|
if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
|
|
1773
2372
|
this.handleConnectedElements({
|
|
@@ -1775,18 +2374,18 @@
|
|
|
1775
2374
|
value: this.formGroup.controls[field.key].value
|
|
1776
2375
|
}, "ON_INIT");
|
|
1777
2376
|
}
|
|
1778
|
-
|
|
2377
|
+
_q.label = 6;
|
|
1779
2378
|
case 6:
|
|
1780
|
-
|
|
2379
|
+
_m = _l.next();
|
|
1781
2380
|
return [3 /*break*/, 3];
|
|
1782
2381
|
case 7: return [3 /*break*/, 10];
|
|
1783
2382
|
case 8:
|
|
1784
|
-
e_1_1 =
|
|
2383
|
+
e_1_1 = _q.sent();
|
|
1785
2384
|
e_1 = { error: e_1_1 };
|
|
1786
2385
|
return [3 /*break*/, 10];
|
|
1787
2386
|
case 9:
|
|
1788
2387
|
try {
|
|
1789
|
-
if (
|
|
2388
|
+
if (_m && !_m.done && (_p = _l.return)) _p.call(_l);
|
|
1790
2389
|
}
|
|
1791
2390
|
finally { if (e_1) throw e_1.error; }
|
|
1792
2391
|
return [7 /*endfinally*/];
|
|
@@ -1817,10 +2416,10 @@
|
|
|
1817
2416
|
};
|
|
1818
2417
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
|
|
1819
2418
|
return __awaiter(this, void 0, void 0, function () {
|
|
1820
|
-
var rulesMapping,
|
|
1821
|
-
var e_3,
|
|
1822
|
-
return __generator(this, function (
|
|
1823
|
-
switch (
|
|
2419
|
+
var rulesMapping, _h, _j, action, conditionSuccess, actions, e_3_1;
|
|
2420
|
+
var e_3, _k;
|
|
2421
|
+
return __generator(this, function (_l) {
|
|
2422
|
+
switch (_l.label) {
|
|
1824
2423
|
case 0:
|
|
1825
2424
|
if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
|
|
1826
2425
|
rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
|
|
@@ -1829,14 +2428,14 @@
|
|
|
1829
2428
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1830
2429
|
ALL_FORMS_DATA: this.allFormsData
|
|
1831
2430
|
}).mapping();
|
|
1832
|
-
|
|
2431
|
+
_l.label = 1;
|
|
1833
2432
|
case 1:
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
2433
|
+
_l.trys.push([1, 6, 7, 8]);
|
|
2434
|
+
_h = __values(childFieldGroupConfig.actions), _j = _h.next();
|
|
2435
|
+
_l.label = 2;
|
|
1837
2436
|
case 2:
|
|
1838
|
-
if (!!
|
|
1839
|
-
action =
|
|
2437
|
+
if (!!_j.done) return [3 /*break*/, 5];
|
|
2438
|
+
action = _j.value;
|
|
1840
2439
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
1841
2440
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
1842
2441
|
actions = new kwikidToolkit.Action(action, rulesMapping, {
|
|
@@ -1848,19 +2447,19 @@
|
|
|
1848
2447
|
}, this.takeActionOnFieldGroup.bind(this));
|
|
1849
2448
|
return [4 /*yield*/, actions.execute()];
|
|
1850
2449
|
case 3:
|
|
1851
|
-
|
|
1852
|
-
|
|
2450
|
+
_l.sent();
|
|
2451
|
+
_l.label = 4;
|
|
1853
2452
|
case 4:
|
|
1854
|
-
|
|
2453
|
+
_j = _h.next();
|
|
1855
2454
|
return [3 /*break*/, 2];
|
|
1856
2455
|
case 5: return [3 /*break*/, 8];
|
|
1857
2456
|
case 6:
|
|
1858
|
-
e_3_1 =
|
|
2457
|
+
e_3_1 = _l.sent();
|
|
1859
2458
|
e_3 = { error: e_3_1 };
|
|
1860
2459
|
return [3 /*break*/, 8];
|
|
1861
2460
|
case 7:
|
|
1862
2461
|
try {
|
|
1863
|
-
if (
|
|
2462
|
+
if (_j && !_j.done && (_k = _h.return)) _k.call(_h);
|
|
1864
2463
|
}
|
|
1865
2464
|
finally { if (e_3) throw e_3.error; }
|
|
1866
2465
|
return [7 /*endfinally*/];
|
|
@@ -1871,15 +2470,15 @@
|
|
|
1871
2470
|
};
|
|
1872
2471
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
|
|
1873
2472
|
return __awaiter(this, void 0, void 0, function () {
|
|
1874
|
-
return __generator(this, function (
|
|
1875
|
-
switch (
|
|
2473
|
+
return __generator(this, function (_h) {
|
|
2474
|
+
switch (_h.label) {
|
|
1876
2475
|
case 0:
|
|
1877
2476
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
|
|
1878
2477
|
if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
|
|
1879
2478
|
return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
|
|
1880
2479
|
case 1:
|
|
1881
|
-
|
|
1882
|
-
|
|
2480
|
+
_h.sent();
|
|
2481
|
+
_h.label = 2;
|
|
1883
2482
|
case 2: return [2 /*return*/];
|
|
1884
2483
|
}
|
|
1885
2484
|
});
|
|
@@ -1887,10 +2486,10 @@
|
|
|
1887
2486
|
};
|
|
1888
2487
|
KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
|
|
1889
2488
|
return __awaiter(this, void 0, void 0, function () {
|
|
1890
|
-
var rulesMapping,
|
|
1891
|
-
var e_4,
|
|
1892
|
-
return __generator(this, function (
|
|
1893
|
-
switch (
|
|
2489
|
+
var rulesMapping, _h, _j, action, conditionSuccess, actions, e_4_1;
|
|
2490
|
+
var e_4, _k;
|
|
2491
|
+
return __generator(this, function (_l) {
|
|
2492
|
+
switch (_l.label) {
|
|
1894
2493
|
case 0:
|
|
1895
2494
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
|
|
1896
2495
|
rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
|
|
@@ -1899,14 +2498,14 @@
|
|
|
1899
2498
|
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
1900
2499
|
ALL_FORMS_DATA: this.allFormsData
|
|
1901
2500
|
}).mapping();
|
|
1902
|
-
|
|
2501
|
+
_l.label = 1;
|
|
1903
2502
|
case 1:
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2503
|
+
_l.trys.push([1, 6, 7, 8]);
|
|
2504
|
+
_h = __values(connectedFieldConfig.actions), _j = _h.next();
|
|
2505
|
+
_l.label = 2;
|
|
1907
2506
|
case 2:
|
|
1908
|
-
if (!!
|
|
1909
|
-
action =
|
|
2507
|
+
if (!!_j.done) return [3 /*break*/, 5];
|
|
2508
|
+
action = _j.value;
|
|
1910
2509
|
conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
|
|
1911
2510
|
if (!conditionSuccess) return [3 /*break*/, 4];
|
|
1912
2511
|
actions = new kwikidToolkit.Action(action, rulesMapping, {
|
|
@@ -1918,19 +2517,19 @@
|
|
|
1918
2517
|
}, this.takeAction.bind(this));
|
|
1919
2518
|
return [4 /*yield*/, actions.execute()];
|
|
1920
2519
|
case 3:
|
|
1921
|
-
|
|
1922
|
-
|
|
2520
|
+
_l.sent();
|
|
2521
|
+
_l.label = 4;
|
|
1923
2522
|
case 4:
|
|
1924
|
-
|
|
2523
|
+
_j = _h.next();
|
|
1925
2524
|
return [3 /*break*/, 2];
|
|
1926
2525
|
case 5: return [3 /*break*/, 8];
|
|
1927
2526
|
case 6:
|
|
1928
|
-
e_4_1 =
|
|
2527
|
+
e_4_1 = _l.sent();
|
|
1929
2528
|
e_4 = { error: e_4_1 };
|
|
1930
2529
|
return [3 /*break*/, 8];
|
|
1931
2530
|
case 7:
|
|
1932
2531
|
try {
|
|
1933
|
-
if (
|
|
2532
|
+
if (_j && !_j.done && (_k = _h.return)) _k.call(_h);
|
|
1934
2533
|
}
|
|
1935
2534
|
finally { if (e_4) throw e_4.error; }
|
|
1936
2535
|
return [7 /*endfinally*/];
|
|
@@ -1942,16 +2541,16 @@
|
|
|
1942
2541
|
KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
|
|
1943
2542
|
return __awaiter(this, void 0, void 0, function () {
|
|
1944
2543
|
var connectedField;
|
|
1945
|
-
return __generator(this, function (
|
|
1946
|
-
switch (
|
|
2544
|
+
return __generator(this, function (_h) {
|
|
2545
|
+
switch (_h.label) {
|
|
1947
2546
|
case 0:
|
|
1948
2547
|
connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
|
|
1949
2548
|
if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
|
|
1950
2549
|
if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
|
|
1951
2550
|
return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
|
|
1952
2551
|
case 1:
|
|
1953
|
-
connectedField =
|
|
1954
|
-
|
|
2552
|
+
connectedField = _h.sent();
|
|
2553
|
+
_h.label = 2;
|
|
1955
2554
|
case 2:
|
|
1956
2555
|
if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
|
|
1957
2556
|
if (connectedFieldConfig.handleNestedFields) {
|
|
@@ -1966,67 +2565,67 @@
|
|
|
1966
2565
|
KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
|
|
1967
2566
|
return __awaiter(this, void 0, void 0, function () {
|
|
1968
2567
|
var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_5_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_6_1;
|
|
1969
|
-
var e_5,
|
|
1970
|
-
return __generator(this, function (
|
|
1971
|
-
switch (
|
|
2568
|
+
var e_5, _h, e_6, _j;
|
|
2569
|
+
return __generator(this, function (_k) {
|
|
2570
|
+
switch (_k.label) {
|
|
1972
2571
|
case 0:
|
|
1973
2572
|
currentField = getFormFieldByKey(this.formFields, e.key);
|
|
1974
2573
|
if (!(currentField !== undefined)) return [3 /*break*/, 17];
|
|
1975
2574
|
if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
|
|
1976
2575
|
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
|
|
1977
2576
|
connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
|
|
1978
|
-
|
|
2577
|
+
_k.label = 1;
|
|
1979
2578
|
case 1:
|
|
1980
|
-
|
|
2579
|
+
_k.trys.push([1, 6, 7, 8]);
|
|
1981
2580
|
connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
|
|
1982
|
-
|
|
2581
|
+
_k.label = 2;
|
|
1983
2582
|
case 2:
|
|
1984
2583
|
if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
|
|
1985
2584
|
connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
|
|
1986
2585
|
return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
|
|
1987
2586
|
case 3:
|
|
1988
|
-
|
|
1989
|
-
|
|
2587
|
+
_k.sent();
|
|
2588
|
+
_k.label = 4;
|
|
1990
2589
|
case 4:
|
|
1991
2590
|
connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
|
|
1992
2591
|
return [3 /*break*/, 2];
|
|
1993
2592
|
case 5: return [3 /*break*/, 8];
|
|
1994
2593
|
case 6:
|
|
1995
|
-
e_5_1 =
|
|
2594
|
+
e_5_1 = _k.sent();
|
|
1996
2595
|
e_5 = { error: e_5_1 };
|
|
1997
2596
|
return [3 /*break*/, 8];
|
|
1998
2597
|
case 7:
|
|
1999
2598
|
try {
|
|
2000
|
-
if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (
|
|
2599
|
+
if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_h = connectedFieldGroups_1.return)) _h.call(connectedFieldGroups_1);
|
|
2001
2600
|
}
|
|
2002
2601
|
finally { if (e_5) throw e_5.error; }
|
|
2003
2602
|
return [7 /*endfinally*/];
|
|
2004
2603
|
case 8:
|
|
2005
2604
|
if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
|
|
2006
2605
|
connectedFields = currentField.connectedElements.connectedFields;
|
|
2007
|
-
|
|
2606
|
+
_k.label = 9;
|
|
2008
2607
|
case 9:
|
|
2009
|
-
|
|
2608
|
+
_k.trys.push([9, 14, 15, 16]);
|
|
2010
2609
|
connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
|
|
2011
|
-
|
|
2610
|
+
_k.label = 10;
|
|
2012
2611
|
case 10:
|
|
2013
2612
|
if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
|
|
2014
2613
|
connectedFieldConfig = connectedFields_1_1.value;
|
|
2015
2614
|
return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
|
|
2016
2615
|
case 11:
|
|
2017
|
-
currentField =
|
|
2018
|
-
|
|
2616
|
+
currentField = _k.sent();
|
|
2617
|
+
_k.label = 12;
|
|
2019
2618
|
case 12:
|
|
2020
2619
|
connectedFields_1_1 = connectedFields_1.next();
|
|
2021
2620
|
return [3 /*break*/, 10];
|
|
2022
2621
|
case 13: return [3 /*break*/, 16];
|
|
2023
2622
|
case 14:
|
|
2024
|
-
e_6_1 =
|
|
2623
|
+
e_6_1 = _k.sent();
|
|
2025
2624
|
e_6 = { error: e_6_1 };
|
|
2026
2625
|
return [3 /*break*/, 16];
|
|
2027
2626
|
case 15:
|
|
2028
2627
|
try {
|
|
2029
|
-
if (connectedFields_1_1 && !connectedFields_1_1.done && (
|
|
2628
|
+
if (connectedFields_1_1 && !connectedFields_1_1.done && (_j = connectedFields_1.return)) _j.call(connectedFields_1);
|
|
2030
2629
|
}
|
|
2031
2630
|
finally { if (e_6) throw e_6.error; }
|
|
2032
2631
|
return [7 /*endfinally*/];
|
|
@@ -2039,11 +2638,11 @@
|
|
|
2039
2638
|
};
|
|
2040
2639
|
// DOM Event Handlers
|
|
2041
2640
|
KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
|
|
2042
|
-
var
|
|
2641
|
+
var _h;
|
|
2043
2642
|
var _this = this;
|
|
2044
|
-
this.formGroup.patchValue((
|
|
2045
|
-
|
|
2046
|
-
|
|
2643
|
+
this.formGroup.patchValue((_h = {},
|
|
2644
|
+
_h[e.key] = e.value,
|
|
2645
|
+
_h), { emitEvent: false });
|
|
2047
2646
|
var field = getFormFieldByKey(this.formFields, e.key);
|
|
2048
2647
|
this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
|
|
2049
2648
|
if (field.isFormElement &&
|
|
@@ -2056,11 +2655,11 @@
|
|
|
2056
2655
|
ALL_FORMS_DATA: this.allFormsData
|
|
2057
2656
|
}, this.takeAction.bind(this));
|
|
2058
2657
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2059
|
-
return __generator(this, function (
|
|
2060
|
-
switch (
|
|
2658
|
+
return __generator(this, function (_h) {
|
|
2659
|
+
switch (_h.label) {
|
|
2061
2660
|
case 0: return [4 /*yield*/, validations_1.validate(field.validation)];
|
|
2062
2661
|
case 1:
|
|
2063
|
-
|
|
2662
|
+
_h.sent();
|
|
2064
2663
|
return [2 /*return*/];
|
|
2065
2664
|
}
|
|
2066
2665
|
});
|
|
@@ -2076,25 +2675,25 @@
|
|
|
2076
2675
|
};
|
|
2077
2676
|
KwikIDFormViewComponent.prototype.handleOnClickResetFormFields = function (e, field) {
|
|
2078
2677
|
return __awaiter(this, void 0, void 0, function () {
|
|
2079
|
-
var
|
|
2080
|
-
var e_8,
|
|
2081
|
-
return __generator(this, function (
|
|
2082
|
-
switch (
|
|
2678
|
+
var _h, _j, f, _k, _l, action, resetField, actions, e_7_1, e_8_1;
|
|
2679
|
+
var e_8, _m, e_7, _o;
|
|
2680
|
+
return __generator(this, function (_p) {
|
|
2681
|
+
switch (_p.label) {
|
|
2083
2682
|
case 0:
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2683
|
+
_p.trys.push([0, 11, 12, 13]);
|
|
2684
|
+
_h = __values(field.reset.fields), _j = _h.next();
|
|
2685
|
+
_p.label = 1;
|
|
2087
2686
|
case 1:
|
|
2088
|
-
if (!!
|
|
2089
|
-
f =
|
|
2090
|
-
|
|
2687
|
+
if (!!_j.done) return [3 /*break*/, 10];
|
|
2688
|
+
f = _j.value;
|
|
2689
|
+
_p.label = 2;
|
|
2091
2690
|
case 2:
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2691
|
+
_p.trys.push([2, 7, 8, 9]);
|
|
2692
|
+
_k = (e_7 = void 0, __values(f.actions)), _l = _k.next();
|
|
2693
|
+
_p.label = 3;
|
|
2095
2694
|
case 3:
|
|
2096
|
-
if (!!
|
|
2097
|
-
action =
|
|
2695
|
+
if (!!_l.done) return [3 /*break*/, 6];
|
|
2696
|
+
action = _l.value;
|
|
2098
2697
|
resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
|
|
2099
2698
|
actions = new kwikidToolkit.Action(action, {}, {
|
|
2100
2699
|
FIELD_CONFIG: resetField,
|
|
@@ -2105,33 +2704,33 @@
|
|
|
2105
2704
|
}, this.takeAction.bind(this));
|
|
2106
2705
|
return [4 /*yield*/, actions.execute()];
|
|
2107
2706
|
case 4:
|
|
2108
|
-
|
|
2109
|
-
|
|
2707
|
+
_p.sent();
|
|
2708
|
+
_p.label = 5;
|
|
2110
2709
|
case 5:
|
|
2111
|
-
|
|
2710
|
+
_l = _k.next();
|
|
2112
2711
|
return [3 /*break*/, 3];
|
|
2113
2712
|
case 6: return [3 /*break*/, 9];
|
|
2114
2713
|
case 7:
|
|
2115
|
-
e_7_1 =
|
|
2714
|
+
e_7_1 = _p.sent();
|
|
2116
2715
|
e_7 = { error: e_7_1 };
|
|
2117
2716
|
return [3 /*break*/, 9];
|
|
2118
2717
|
case 8:
|
|
2119
2718
|
try {
|
|
2120
|
-
if (
|
|
2719
|
+
if (_l && !_l.done && (_o = _k.return)) _o.call(_k);
|
|
2121
2720
|
}
|
|
2122
2721
|
finally { if (e_7) throw e_7.error; }
|
|
2123
2722
|
return [7 /*endfinally*/];
|
|
2124
2723
|
case 9:
|
|
2125
|
-
|
|
2724
|
+
_j = _h.next();
|
|
2126
2725
|
return [3 /*break*/, 1];
|
|
2127
2726
|
case 10: return [3 /*break*/, 13];
|
|
2128
2727
|
case 11:
|
|
2129
|
-
e_8_1 =
|
|
2728
|
+
e_8_1 = _p.sent();
|
|
2130
2729
|
e_8 = { error: e_8_1 };
|
|
2131
2730
|
return [3 /*break*/, 13];
|
|
2132
2731
|
case 12:
|
|
2133
2732
|
try {
|
|
2134
|
-
if (
|
|
2733
|
+
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
2135
2734
|
}
|
|
2136
2735
|
finally { if (e_8) throw e_8.error; }
|
|
2137
2736
|
return [7 /*endfinally*/];
|
|
@@ -2141,14 +2740,16 @@
|
|
|
2141
2740
|
});
|
|
2142
2741
|
};
|
|
2143
2742
|
KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
|
|
2144
|
-
var _a;
|
|
2743
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2145
2744
|
return __awaiter(this, void 0, void 0, function () {
|
|
2146
|
-
var field, apis;
|
|
2147
|
-
|
|
2148
|
-
|
|
2745
|
+
var field, apis, apiCallResponse, url, method, headers, body, response, apis_1;
|
|
2746
|
+
var _h, _j;
|
|
2747
|
+
var _this = this;
|
|
2748
|
+
return __generator(this, function (_k) {
|
|
2749
|
+
switch (_k.label) {
|
|
2149
2750
|
case 0:
|
|
2150
2751
|
field = getFormFieldByKey(this.formFields, e.key);
|
|
2151
|
-
if (!(field.type === "api-call")) return [3 /*break*/,
|
|
2752
|
+
if (!(field.type === "api-call")) return [3 /*break*/, 11];
|
|
2152
2753
|
// set button status to loading
|
|
2153
2754
|
field["api"]["status"]["value"] = EApiStatusType.LOADING;
|
|
2154
2755
|
field["showLoader"] = true;
|
|
@@ -2165,43 +2766,77 @@
|
|
|
2165
2766
|
}, this.takeAction.bind(this));
|
|
2166
2767
|
return [4 /*yield*/, apis.setRequestHeaders()];
|
|
2167
2768
|
case 1:
|
|
2168
|
-
field =
|
|
2769
|
+
field = _k.sent();
|
|
2169
2770
|
return [4 /*yield*/, apis.validateRequestHeaders()];
|
|
2170
2771
|
case 2:
|
|
2171
|
-
field =
|
|
2772
|
+
field = _k.sent();
|
|
2172
2773
|
return [4 /*yield*/, apis.setRequestBody()];
|
|
2173
2774
|
case 3:
|
|
2174
|
-
field =
|
|
2775
|
+
field = _k.sent();
|
|
2175
2776
|
return [4 /*yield*/, apis.validateRequestBody()];
|
|
2176
2777
|
case 4:
|
|
2177
|
-
field =
|
|
2178
|
-
if (field.api.request.body.validation.is_valid)
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2778
|
+
field = _k.sent();
|
|
2779
|
+
if (!field.api.request.body.validation.is_valid) return [3 /*break*/, 9];
|
|
2780
|
+
apiCallResponse = undefined;
|
|
2781
|
+
if (!(field.api.request.url.hasOwnProperty("type") &&
|
|
2782
|
+
field.api.request.url.type === "MOCK")) return [3 /*break*/, 5];
|
|
2783
|
+
apiCallResponse = field.api.request.url.data;
|
|
2784
|
+
return [3 /*break*/, 8];
|
|
2785
|
+
case 5:
|
|
2786
|
+
url = field.api.request.url;
|
|
2787
|
+
method = (_b = (_a = field.api.request) === null || _a === void 0 ? void 0 : _a.method) !== null && _b !== void 0 ? _b : "POST";
|
|
2788
|
+
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) || {}));
|
|
2789
|
+
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;
|
|
2790
|
+
return [4 /*yield*/, fetch(url, {
|
|
2791
|
+
method: method,
|
|
2792
|
+
headers: Object.assign({}, headers),
|
|
2793
|
+
body: JSON.stringify(body)
|
|
2794
|
+
})];
|
|
2795
|
+
case 6:
|
|
2796
|
+
response = _k.sent();
|
|
2797
|
+
return [4 /*yield*/, response.json()];
|
|
2798
|
+
case 7:
|
|
2799
|
+
apiCallResponse = _k.sent();
|
|
2800
|
+
_k.label = 8;
|
|
2801
|
+
case 8:
|
|
2802
|
+
this.formData = Object.assign(Object.assign({}, this.formData), (_h = {}, _h[field.key] = apiCallResponse, _h));
|
|
2803
|
+
this.formGroup.patchValue((_j = {},
|
|
2804
|
+
_j[field.key] = apiCallResponse,
|
|
2805
|
+
_j), { emitEvent: false });
|
|
2806
|
+
apis_1 = new Apis({
|
|
2807
|
+
FIELD_CONFIG: field,
|
|
2808
|
+
FORM_FIELDS: this.formFields,
|
|
2809
|
+
FORM_DATA: this.formData,
|
|
2810
|
+
PREVIOUS_FORM_DATA: this.previousFormData,
|
|
2811
|
+
ALL_FORMS_DATA: this.allFormsData
|
|
2812
|
+
}, this.takeAction.bind(this));
|
|
2813
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2814
|
+
return __generator(this, function (_h) {
|
|
2815
|
+
switch (_h.label) {
|
|
2816
|
+
case 0: return [4 /*yield*/, apis_1.validateResponse()];
|
|
2817
|
+
case 1:
|
|
2818
|
+
field = _h.sent();
|
|
2819
|
+
return [2 /*return*/];
|
|
2187
2820
|
}
|
|
2188
2821
|
});
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
}
|
|
2822
|
+
}); })();
|
|
2823
|
+
return [3 /*break*/, 10];
|
|
2824
|
+
case 9:
|
|
2825
|
+
// Request Body Validation Failed
|
|
2826
|
+
// Highlight Error in UI to User to Retry After Sometime.
|
|
2827
|
+
// Take Action based on Validation
|
|
2828
|
+
setTimeout(function () {
|
|
2829
|
+
field["api"]["status"]["value"] = EApiStatusType.FAILED;
|
|
2830
|
+
field["showLoader"] = false;
|
|
2831
|
+
}, 500);
|
|
2832
|
+
_k.label = 10;
|
|
2833
|
+
case 10:
|
|
2199
2834
|
this.viewFormsButton["disabled"] = false;
|
|
2200
2835
|
this.viewFormsButton["showLoader"] = false;
|
|
2201
2836
|
this.saveFormButton["disabled"] = false;
|
|
2202
2837
|
this.saveFormButton["showLoader"] = false;
|
|
2203
|
-
|
|
2204
|
-
case
|
|
2838
|
+
_k.label = 11;
|
|
2839
|
+
case 11: return [2 /*return*/];
|
|
2205
2840
|
}
|
|
2206
2841
|
});
|
|
2207
2842
|
});
|
|
@@ -2213,16 +2848,16 @@
|
|
|
2213
2848
|
};
|
|
2214
2849
|
KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
|
|
2215
2850
|
return __awaiter(this, void 0, void 0, function () {
|
|
2216
|
-
var formData,
|
|
2217
|
-
var e_10,
|
|
2851
|
+
var formData, _h, _j, field, controls, firstFieldWithError, controls_1, controls_1_1, control, _k, _l, field, validations, e_9_1;
|
|
2852
|
+
var e_10, _m, e_11, _o, e_9, _p;
|
|
2218
2853
|
var _this = this;
|
|
2219
|
-
return __generator(this, function (
|
|
2220
|
-
switch (
|
|
2854
|
+
return __generator(this, function (_q) {
|
|
2855
|
+
switch (_q.label) {
|
|
2221
2856
|
case 0:
|
|
2222
2857
|
formData = this.formGroup.getRawValue();
|
|
2223
2858
|
try {
|
|
2224
|
-
for (
|
|
2225
|
-
field =
|
|
2859
|
+
for (_h = __values(this.formFields), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
2860
|
+
field = _j.value;
|
|
2226
2861
|
if (field.isFormElement) {
|
|
2227
2862
|
if (field.hidden) {
|
|
2228
2863
|
delete formData[field.key];
|
|
@@ -2236,7 +2871,7 @@
|
|
|
2236
2871
|
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
2237
2872
|
finally {
|
|
2238
2873
|
try {
|
|
2239
|
-
if (
|
|
2874
|
+
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
2240
2875
|
}
|
|
2241
2876
|
finally { if (e_10) throw e_10.error; }
|
|
2242
2877
|
}
|
|
@@ -2255,7 +2890,7 @@
|
|
|
2255
2890
|
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
2256
2891
|
finally {
|
|
2257
2892
|
try {
|
|
2258
|
-
if (controls_1_1 && !controls_1_1.done && (
|
|
2893
|
+
if (controls_1_1 && !controls_1_1.done && (_o = controls_1.return)) _o.call(controls_1);
|
|
2259
2894
|
}
|
|
2260
2895
|
finally { if (e_11) throw e_11.error; }
|
|
2261
2896
|
}
|
|
@@ -2265,14 +2900,14 @@
|
|
|
2265
2900
|
}, 3000);
|
|
2266
2901
|
return [2 /*return*/];
|
|
2267
2902
|
}
|
|
2268
|
-
|
|
2903
|
+
_q.label = 1;
|
|
2269
2904
|
case 1:
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2905
|
+
_q.trys.push([1, 6, 7, 8]);
|
|
2906
|
+
_k = __values(this.formFields), _l = _k.next();
|
|
2907
|
+
_q.label = 2;
|
|
2273
2908
|
case 2:
|
|
2274
|
-
if (!!
|
|
2275
|
-
field =
|
|
2909
|
+
if (!!_l.done) return [3 /*break*/, 5];
|
|
2910
|
+
field = _l.value;
|
|
2276
2911
|
if (!(field.isFormElement &&
|
|
2277
2912
|
field.validation.triggers.includes("ON_SAVE"))) return [3 /*break*/, 4];
|
|
2278
2913
|
validations = new kwikidToolkit.Validation({
|
|
@@ -2284,7 +2919,7 @@
|
|
|
2284
2919
|
}, this.takeAction.bind(this));
|
|
2285
2920
|
return [4 /*yield*/, validations.validate(field.validation)];
|
|
2286
2921
|
case 3:
|
|
2287
|
-
|
|
2922
|
+
_q.sent();
|
|
2288
2923
|
if (!field.validation.is_valid) {
|
|
2289
2924
|
this.toggleErrorNotification(true);
|
|
2290
2925
|
setTimeout(function () {
|
|
@@ -2292,18 +2927,18 @@
|
|
|
2292
2927
|
}, 3000);
|
|
2293
2928
|
return [2 /*return*/];
|
|
2294
2929
|
}
|
|
2295
|
-
|
|
2930
|
+
_q.label = 4;
|
|
2296
2931
|
case 4:
|
|
2297
|
-
|
|
2932
|
+
_l = _k.next();
|
|
2298
2933
|
return [3 /*break*/, 2];
|
|
2299
2934
|
case 5: return [3 /*break*/, 8];
|
|
2300
2935
|
case 6:
|
|
2301
|
-
e_9_1 =
|
|
2936
|
+
e_9_1 = _q.sent();
|
|
2302
2937
|
e_9 = { error: e_9_1 };
|
|
2303
2938
|
return [3 /*break*/, 8];
|
|
2304
2939
|
case 7:
|
|
2305
2940
|
try {
|
|
2306
|
-
if (
|
|
2941
|
+
if (_l && !_l.done && (_p = _k.return)) _p.call(_k);
|
|
2307
2942
|
}
|
|
2308
2943
|
finally { if (e_9) throw e_9.error; }
|
|
2309
2944
|
return [7 /*endfinally*/];
|
|
@@ -2332,17 +2967,17 @@
|
|
|
2332
2967
|
this.formGroup.updateValueAndValidity();
|
|
2333
2968
|
};
|
|
2334
2969
|
KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
|
|
2335
|
-
var e_12,
|
|
2970
|
+
var e_12, _h;
|
|
2336
2971
|
try {
|
|
2337
|
-
for (var
|
|
2338
|
-
var fieldKey =
|
|
2972
|
+
for (var _j = __values(this.fieldGroups[fieldGroup]), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
2973
|
+
var fieldKey = _k.value;
|
|
2339
2974
|
this.fieldHide(fieldKey);
|
|
2340
2975
|
}
|
|
2341
2976
|
}
|
|
2342
2977
|
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
2343
2978
|
finally {
|
|
2344
2979
|
try {
|
|
2345
|
-
if (
|
|
2980
|
+
if (_k && !_k.done && (_h = _j.return)) _h.call(_j);
|
|
2346
2981
|
}
|
|
2347
2982
|
finally { if (e_12) throw e_12.error; }
|
|
2348
2983
|
}
|
|
@@ -2356,17 +2991,17 @@
|
|
|
2356
2991
|
this.formGroup.updateValueAndValidity();
|
|
2357
2992
|
};
|
|
2358
2993
|
KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
|
|
2359
|
-
var e_13,
|
|
2994
|
+
var e_13, _h;
|
|
2360
2995
|
try {
|
|
2361
|
-
for (var
|
|
2362
|
-
var fieldKey =
|
|
2996
|
+
for (var _j = __values(this.fieldGroups[fieldGroup]), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
2997
|
+
var fieldKey = _k.value;
|
|
2363
2998
|
this.fieldShow(fieldKey);
|
|
2364
2999
|
}
|
|
2365
3000
|
}
|
|
2366
3001
|
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
2367
3002
|
finally {
|
|
2368
3003
|
try {
|
|
2369
|
-
if (
|
|
3004
|
+
if (_k && !_k.done && (_h = _j.return)) _h.call(_j);
|
|
2370
3005
|
}
|
|
2371
3006
|
finally { if (e_13) throw e_13.error; }
|
|
2372
3007
|
}
|
|
@@ -2387,17 +3022,17 @@
|
|
|
2387
3022
|
}
|
|
2388
3023
|
};
|
|
2389
3024
|
KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
|
|
2390
|
-
var e_14,
|
|
3025
|
+
var e_14, _h;
|
|
2391
3026
|
try {
|
|
2392
|
-
for (var
|
|
2393
|
-
var fieldKey =
|
|
3027
|
+
for (var _j = __values(this.fieldGroups[fieldGroup]), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
3028
|
+
var fieldKey = _k.value;
|
|
2394
3029
|
this.fieldDisable(fieldKey);
|
|
2395
3030
|
}
|
|
2396
3031
|
}
|
|
2397
3032
|
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
2398
3033
|
finally {
|
|
2399
3034
|
try {
|
|
2400
|
-
if (
|
|
3035
|
+
if (_k && !_k.done && (_h = _j.return)) _h.call(_j);
|
|
2401
3036
|
}
|
|
2402
3037
|
finally { if (e_14) throw e_14.error; }
|
|
2403
3038
|
}
|
|
@@ -2418,17 +3053,17 @@
|
|
|
2418
3053
|
}
|
|
2419
3054
|
};
|
|
2420
3055
|
KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
|
|
2421
|
-
var e_15,
|
|
3056
|
+
var e_15, _h;
|
|
2422
3057
|
try {
|
|
2423
|
-
for (var
|
|
2424
|
-
var fieldKey =
|
|
3058
|
+
for (var _j = __values(this.fieldGroups[fieldGroup]), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
3059
|
+
var fieldKey = _k.value;
|
|
2425
3060
|
this.fieldEnable(fieldKey);
|
|
2426
3061
|
}
|
|
2427
3062
|
}
|
|
2428
3063
|
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
2429
3064
|
finally {
|
|
2430
3065
|
try {
|
|
2431
|
-
if (
|
|
3066
|
+
if (_k && !_k.done && (_h = _j.return)) _h.call(_j);
|
|
2432
3067
|
}
|
|
2433
3068
|
finally { if (e_15) throw e_15.error; }
|
|
2434
3069
|
}
|
|
@@ -2506,10 +3141,10 @@
|
|
|
2506
3141
|
};
|
|
2507
3142
|
KwikIDFormViewComponent.prototype.setObjectValue = function (field, path, value) { };
|
|
2508
3143
|
KwikIDFormViewComponent.prototype.patchFieldControlValue = function (key, value) {
|
|
2509
|
-
var
|
|
2510
|
-
this.formGroup.patchValue((
|
|
2511
|
-
|
|
2512
|
-
|
|
3144
|
+
var _h;
|
|
3145
|
+
this.formGroup.patchValue((_h = {},
|
|
3146
|
+
_h[key] = value,
|
|
3147
|
+
_h), { emitEvent: false });
|
|
2513
3148
|
};
|
|
2514
3149
|
KwikIDFormViewComponent.prototype.patchFormGroup = function (formData) {
|
|
2515
3150
|
if (kwikidToolkit.isUndefined(this.formGroup) || kwikidToolkit.isUndefined(formData)) {
|
|
@@ -2530,7 +3165,7 @@
|
|
|
2530
3165
|
};
|
|
2531
3166
|
KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
|
|
2532
3167
|
return __awaiter(this, void 0, void 0, function () {
|
|
2533
|
-
return __generator(this, function (
|
|
3168
|
+
return __generator(this, function (_h) {
|
|
2534
3169
|
switch (action.key) {
|
|
2535
3170
|
case EActionKey.FIELD_GROUP_HIDE:
|
|
2536
3171
|
this.fieldGroupHide(action.props.groupKey);
|
|
@@ -2553,12 +3188,12 @@
|
|
|
2553
3188
|
};
|
|
2554
3189
|
KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
|
|
2555
3190
|
return __awaiter(this, void 0, void 0, function () {
|
|
2556
|
-
var
|
|
2557
|
-
return __generator(this, function (
|
|
2558
|
-
switch (
|
|
3191
|
+
var _h, setValue_Source, sourceValue, setDefaultValue_Source, sourceDefaultValue, destinationDefaultValue_FieldConfig_Config, destinationDefaultValue_FormData_Config__Props__Object__Path, destinationDefaultValue_FormData_Config, setDropdownValue_Sources, dropdownValue, appendToPath, appendToPathStr, optionsPath;
|
|
3192
|
+
return __generator(this, function (_j) {
|
|
3193
|
+
switch (_j.label) {
|
|
2559
3194
|
case 0:
|
|
2560
|
-
|
|
2561
|
-
switch (
|
|
3195
|
+
_h = action.key;
|
|
3196
|
+
switch (_h) {
|
|
2562
3197
|
case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
|
|
2563
3198
|
case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
|
|
2564
3199
|
case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
|
|
@@ -2569,91 +3204,125 @@
|
|
|
2569
3204
|
case EActionKey.FIELD_MESSAGE_SHOW: return [3 /*break*/, 8];
|
|
2570
3205
|
case EActionKey.FIELD_MESSAGES_HIDE: return [3 /*break*/, 9];
|
|
2571
3206
|
case EActionKey.SET_VALUE: return [3 /*break*/, 10];
|
|
2572
|
-
case EActionKey.
|
|
2573
|
-
case EActionKey.
|
|
2574
|
-
case EActionKey.
|
|
3207
|
+
case EActionKey.SET_FIELD_DEFAULT_VALUE: return [3 /*break*/, 12];
|
|
3208
|
+
case EActionKey.SET_DROPDOWN_OPTIONS: return [3 /*break*/, 14];
|
|
3209
|
+
case EActionKey.HANDLE_CONNECTED_ELEMENTS: return [3 /*break*/, 19];
|
|
3210
|
+
case EActionKey.CUSTOM: return [3 /*break*/, 20];
|
|
2575
3211
|
}
|
|
2576
|
-
return [3 /*break*/,
|
|
3212
|
+
return [3 /*break*/, 21];
|
|
2577
3213
|
case 1:
|
|
2578
3214
|
this.fieldHide(action.props.fieldKey);
|
|
2579
|
-
return [3 /*break*/,
|
|
3215
|
+
return [3 /*break*/, 22];
|
|
2580
3216
|
case 2:
|
|
2581
3217
|
this.fieldShow(action.props.fieldKey);
|
|
2582
|
-
return [3 /*break*/,
|
|
3218
|
+
return [3 /*break*/, 22];
|
|
2583
3219
|
case 3:
|
|
2584
3220
|
this.fieldDisable(action.props.fieldKey);
|
|
2585
|
-
return [3 /*break*/,
|
|
3221
|
+
return [3 /*break*/, 22];
|
|
2586
3222
|
case 4:
|
|
2587
3223
|
this.fieldEnable(action.props.fieldKey);
|
|
2588
|
-
return [3 /*break*/,
|
|
3224
|
+
return [3 /*break*/, 22];
|
|
2589
3225
|
case 5:
|
|
2590
3226
|
this.fieldReset(action.props.fieldKey);
|
|
2591
|
-
return [3 /*break*/,
|
|
3227
|
+
return [3 /*break*/, 22];
|
|
2592
3228
|
case 6:
|
|
2593
3229
|
this.fieldErrorShow(action.props.fieldKey, action.props.message);
|
|
2594
|
-
return [3 /*break*/,
|
|
3230
|
+
return [3 /*break*/, 22];
|
|
2595
3231
|
case 7:
|
|
2596
3232
|
this.fieldErrorHide(action.props.fieldKey, action.props.message);
|
|
2597
|
-
return [3 /*break*/,
|
|
3233
|
+
return [3 /*break*/, 22];
|
|
2598
3234
|
case 8:
|
|
2599
3235
|
this.fieldMessageShow(action.props.fieldKey, action.props.message);
|
|
2600
|
-
return [3 /*break*/,
|
|
3236
|
+
return [3 /*break*/, 22];
|
|
2601
3237
|
case 9:
|
|
2602
3238
|
this.fieldMessageHide(action.props.fieldKey, action.props.message);
|
|
2603
|
-
return [3 /*break*/,
|
|
3239
|
+
return [3 /*break*/, 22];
|
|
2604
3240
|
case 10:
|
|
2605
|
-
|
|
2606
|
-
return [4 /*yield*/,
|
|
3241
|
+
setValue_Source = new kwikidToolkit.Source(object);
|
|
3242
|
+
return [4 /*yield*/, setValue_Source.getValueFromSource(action.props.value.source)];
|
|
2607
3243
|
case 11:
|
|
2608
|
-
sourceValue =
|
|
2609
|
-
|
|
2610
|
-
object.FIELD_CONFIG =
|
|
2611
|
-
this.formData =
|
|
3244
|
+
sourceValue = _j.sent();
|
|
3245
|
+
setValue_Source.setValueToSource(action.props.value.destination, sourceValue);
|
|
3246
|
+
object.FIELD_CONFIG = setValue_Source.object.FIELD_CONFIG;
|
|
3247
|
+
this.formData = setValue_Source.object.FORM_DATA;
|
|
2612
3248
|
this.patchFormGroup(this.formData);
|
|
2613
|
-
this.allFormsData =
|
|
2614
|
-
this.previousFormData =
|
|
2615
|
-
return [3 /*break*/,
|
|
3249
|
+
this.allFormsData = setValue_Source.object.ALL_FORMS_DATA;
|
|
3250
|
+
this.previousFormData = setValue_Source.object.PREVIOUS_FORM_DATA;
|
|
3251
|
+
return [3 /*break*/, 22];
|
|
2616
3252
|
case 12:
|
|
3253
|
+
setDefaultValue_Source = new kwikidToolkit.Source(object);
|
|
3254
|
+
return [4 /*yield*/, setDefaultValue_Source.getValueFromSource(action.props.value.source)];
|
|
3255
|
+
case 13:
|
|
3256
|
+
sourceDefaultValue = _j.sent();
|
|
3257
|
+
destinationDefaultValue_FieldConfig_Config = {
|
|
3258
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
3259
|
+
props: {
|
|
3260
|
+
object: {
|
|
3261
|
+
key: "FIELD_CONFIG",
|
|
3262
|
+
path: "default.value.value"
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
};
|
|
3266
|
+
setDefaultValue_Source.setValueToSource(destinationDefaultValue_FieldConfig_Config, sourceDefaultValue);
|
|
3267
|
+
destinationDefaultValue_FormData_Config__Props__Object__Path = String("" + action.props.fieldKey);
|
|
3268
|
+
destinationDefaultValue_FormData_Config = {
|
|
3269
|
+
key: kwikidToolkit.ESourceKey.OBJECT,
|
|
3270
|
+
props: {
|
|
3271
|
+
object: {
|
|
3272
|
+
key: "FORM_DATA",
|
|
3273
|
+
path: String(action.props.fieldKey)
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
};
|
|
3277
|
+
setDefaultValue_Source.setValueToSource(destinationDefaultValue_FormData_Config, sourceDefaultValue);
|
|
3278
|
+
object.FIELD_CONFIG = setDefaultValue_Source.object.FIELD_CONFIG;
|
|
3279
|
+
this.formData = setDefaultValue_Source.object.FORM_DATA;
|
|
3280
|
+
this.patchFormGroup(this.formData);
|
|
3281
|
+
this.allFormsData = setDefaultValue_Source.object.ALL_FORMS_DATA;
|
|
3282
|
+
this.previousFormData =
|
|
3283
|
+
setDefaultValue_Source.object.PREVIOUS_FORM_DATA;
|
|
3284
|
+
return [3 /*break*/, 22];
|
|
3285
|
+
case 14:
|
|
2617
3286
|
setDropdownValue_Sources = new kwikidToolkit.Source(object);
|
|
2618
3287
|
return [4 /*yield*/, setDropdownValue_Sources.getValueFromSource(action.props.value.source)];
|
|
2619
|
-
case
|
|
2620
|
-
dropdownValue =
|
|
2621
|
-
if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/,
|
|
2622
|
-
if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/,
|
|
3288
|
+
case 15:
|
|
3289
|
+
dropdownValue = _j.sent();
|
|
3290
|
+
if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 18];
|
|
3291
|
+
if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 17];
|
|
2623
3292
|
return [4 /*yield*/, setDropdownValue_Sources.getValueFromSource(action.props.options.appendToPath.source)];
|
|
2624
|
-
case
|
|
2625
|
-
appendToPath =
|
|
3293
|
+
case 16:
|
|
3294
|
+
appendToPath = _j.sent();
|
|
2626
3295
|
if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
|
|
2627
3296
|
appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
|
|
2628
3297
|
optionsPath = "" + action.props.options.path + appendToPathStr;
|
|
2629
3298
|
dropdownValue = kwikidToolkit.getObjectValueFromPath(dropdownValue, optionsPath);
|
|
2630
3299
|
}
|
|
2631
|
-
return [3 /*break*/,
|
|
2632
|
-
case
|
|
3300
|
+
return [3 /*break*/, 18];
|
|
3301
|
+
case 17:
|
|
2633
3302
|
dropdownValue = kwikidToolkit.getObjectValueFromPath(dropdownValue, action.props.options.path);
|
|
2634
|
-
|
|
2635
|
-
case
|
|
3303
|
+
_j.label = 18;
|
|
3304
|
+
case 18:
|
|
2636
3305
|
setDropdownValue_Sources.setValueToSource(action.props.value.destination, dropdownValue);
|
|
2637
3306
|
object.FIELD_CONFIG = setDropdownValue_Sources.object.FIELD_CONFIG;
|
|
2638
3307
|
this.formData = setDropdownValue_Sources.object.FORM_DATA;
|
|
2639
3308
|
this.allFormsData = setDropdownValue_Sources.object.ALL_FORMS_DATA;
|
|
2640
3309
|
this.previousFormData =
|
|
2641
3310
|
setDropdownValue_Sources.object.PREVIOUS_FORM_DATA;
|
|
2642
|
-
return [3 /*break*/,
|
|
2643
|
-
case
|
|
3311
|
+
return [3 /*break*/, 22];
|
|
3312
|
+
case 19:
|
|
2644
3313
|
this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
|
|
2645
|
-
return [3 /*break*/,
|
|
2646
|
-
case
|
|
2647
|
-
case
|
|
2648
|
-
case
|
|
3314
|
+
return [3 /*break*/, 22];
|
|
3315
|
+
case 20: return [3 /*break*/, 22];
|
|
3316
|
+
case 21: return [3 /*break*/, 22];
|
|
3317
|
+
case 22: return [2 /*return*/];
|
|
2649
3318
|
}
|
|
2650
3319
|
});
|
|
2651
3320
|
});
|
|
2652
3321
|
};
|
|
2653
3322
|
return KwikIDFormViewComponent;
|
|
2654
3323
|
}());
|
|
2655
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewComponent, deps: [{ token: i4.TuiPushService }, { token: i3.TuiAlertService }, { token: KwikIDFormViewService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2656
|
-
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2__namespace.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.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__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3__namespace.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4__namespace.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4__namespace.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4__namespace.TuiPushDirective, selector: "tui-push" }], pipes: { "safeHtml": SafeHtmlPipe$1 } });
|
|
3324
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewComponent, deps: [{ token: i4$1.TuiPushService }, { token: i3$1.TuiAlertService }, { token: KwikIDFormViewService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3325
|
+
/** @nocollapse */ KwikIDFormViewComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "size", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIMessagesComponent, selector: "kwikui-messages", inputs: ["messages", "id"] }, { type: i2__namespace.KwikUICheckboxBlockComponent, selector: "kwikui-checkbox-block", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "contentAlign", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.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__namespace.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "max", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputPhoneComponent, selector: "kwikui-input-phone", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "countryCode", "phoneMaskAfterCountryCode", "removeCountryCodeFromValue", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i3__namespace$1.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { type: i2__namespace.KwikUIRadioListComponent, selector: "kwikui-radio-list", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "size", "orientation", "items", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUISelectComboboxComponent, selector: "kwikui-select-combobox", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "options", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIButtonApiCallComponent, selector: "kwikui-button-api-call", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "shape", "size", "apiStatus"], outputs: ["onClick"] }, { type: i2__namespace.KwikUIInputOtpComponent, selector: "kwikui-input-otp", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputAadhaarComponent, selector: "kwikui-input-aadhaar", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "mask", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4__namespace$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i4__namespace$1.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4__namespace$1.TuiPushDirective, selector: "tui-push" }], pipes: { "safeHtml": SafeHtmlPipe$1 } });
|
|
2657
3326
|
__decorate([
|
|
2658
3327
|
kwikidToolkit.logMethod
|
|
2659
3328
|
], KwikIDFormViewComponent.prototype, "ngOnInit", null);
|
|
@@ -2783,19 +3452,17 @@
|
|
|
2783
3452
|
providers: [KwikIDFormViewService]
|
|
2784
3453
|
}]
|
|
2785
3454
|
}], ctorParameters: function () {
|
|
2786
|
-
return [{ type: i4__namespace.TuiPushService, decorators: [{
|
|
3455
|
+
return [{ type: i4__namespace$1.TuiPushService, decorators: [{
|
|
2787
3456
|
type: i0.Inject,
|
|
2788
|
-
args: [i4.TuiPushService]
|
|
2789
|
-
}] }, { type: i3__namespace.TuiAlertService, decorators: [{
|
|
3457
|
+
args: [i4$1.TuiPushService]
|
|
3458
|
+
}] }, { type: i3__namespace$1.TuiAlertService, decorators: [{
|
|
2790
3459
|
type: i0.Inject,
|
|
2791
|
-
args: [i3.TuiAlertService]
|
|
3460
|
+
args: [i3$1.TuiAlertService]
|
|
2792
3461
|
}] }, { type: KwikIDFormViewService }];
|
|
2793
3462
|
}, propDecorators: { formConfig: [{
|
|
2794
3463
|
type: i0.Input
|
|
2795
3464
|
}], formData: [{
|
|
2796
3465
|
type: i0.Input
|
|
2797
|
-
}], apiCallResponse: [{
|
|
2798
|
-
type: i0.Input
|
|
2799
3466
|
}], isMobileView: [{
|
|
2800
3467
|
type: i0.Input
|
|
2801
3468
|
}], allFormsData: [{
|
|
@@ -2824,14 +3491,14 @@
|
|
|
2824
3491
|
};
|
|
2825
3492
|
return SafeHtmlPipe;
|
|
2826
3493
|
}());
|
|
2827
|
-
/** @nocollapse */ SafeHtmlPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe, deps: [{ token: i1__namespace.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
3494
|
+
/** @nocollapse */ SafeHtmlPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe, deps: [{ token: i1__namespace$1.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
2828
3495
|
/** @nocollapse */ SafeHtmlPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe, name: "safeHtml" });
|
|
2829
3496
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SafeHtmlPipe, decorators: [{
|
|
2830
3497
|
type: i0.Pipe,
|
|
2831
3498
|
args: [{
|
|
2832
3499
|
name: "safeHtml"
|
|
2833
3500
|
}]
|
|
2834
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.DomSanitizer }]; } });
|
|
3501
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }]; } });
|
|
2835
3502
|
|
|
2836
3503
|
var KwikIDFormsListComponent = /** @class */ (function () {
|
|
2837
3504
|
function KwikIDFormsListComponent() {
|
|
@@ -2935,7 +3602,7 @@
|
|
|
2935
3602
|
return KwikIDFormsListComponent;
|
|
2936
3603
|
}());
|
|
2937
3604
|
/** @nocollapse */ KwikIDFormsListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2938
|
-
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["id", "value", "max", "size", "colors"] }, { type: i3__namespace.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type:
|
|
3605
|
+
/** @nocollapse */ KwikIDFormsListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIProgressSegmentedComponent, selector: "kwikui-progress-segmented", inputs: ["id", "value", "max", "size", "colors"] }, { type: i3__namespace$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "safeHtml": SafeHtmlPipe } });
|
|
2939
3606
|
__decorate([
|
|
2940
3607
|
kwikidToolkit.logMethod
|
|
2941
3608
|
], KwikIDFormsListComponent.prototype, "ngOnChanges", null);
|
|
@@ -3220,7 +3887,7 @@
|
|
|
3220
3887
|
}
|
|
3221
3888
|
return field;
|
|
3222
3889
|
};
|
|
3223
|
-
var
|
|
3890
|
+
var getConnectedelementTypeValueObject = function (key) {
|
|
3224
3891
|
var object = {
|
|
3225
3892
|
key: key,
|
|
3226
3893
|
conditions: { formula: "", rules: [] },
|
|
@@ -3232,12 +3899,12 @@
|
|
|
3232
3899
|
if (kwikidToolkit.checkObjectKeyExists(field, "connectedTo")) {
|
|
3233
3900
|
if (typeof field["connectedTo"] === "string") {
|
|
3234
3901
|
field["connectedElements"] = [
|
|
3235
|
-
|
|
3902
|
+
getConnectedelementTypeValueObject(field["connectedTo"])
|
|
3236
3903
|
];
|
|
3237
3904
|
}
|
|
3238
3905
|
else {
|
|
3239
3906
|
field["connectedTo"] = field["connectedTo"].map(function (key) {
|
|
3240
|
-
return
|
|
3907
|
+
return getConnectedelementTypeValueObject(key);
|
|
3241
3908
|
});
|
|
3242
3909
|
field["connectedElements"] = field["connectedTo"];
|
|
3243
3910
|
}
|
|
@@ -3246,11 +3913,11 @@
|
|
|
3246
3913
|
if (kwikidToolkit.checkObjectKeyExists(field, "connectedToParent")) {
|
|
3247
3914
|
if (typeof field["connectedToParent"] === "string") {
|
|
3248
3915
|
field["connectedParentFields"] = [
|
|
3249
|
-
|
|
3916
|
+
getConnectedelementTypeValueObject(field["connectedToParent"])
|
|
3250
3917
|
];
|
|
3251
3918
|
}
|
|
3252
3919
|
else {
|
|
3253
|
-
field["connectedParentFields"] =
|
|
3920
|
+
field["connectedParentFields"] = getConnectedelementTypeValueObject(field["connectedToParent"]);
|
|
3254
3921
|
}
|
|
3255
3922
|
}
|
|
3256
3923
|
_this.removeFieldKey(field, "connectedToParent");
|
|
@@ -4151,16 +4818,36 @@
|
|
|
4151
4818
|
}
|
|
4152
4819
|
});
|
|
4153
4820
|
formConfig = undefined;
|
|
4154
|
-
if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig, "props")) return [3 /*break*/,
|
|
4821
|
+
if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig, "props")) return [3 /*break*/, 4];
|
|
4822
|
+
if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig.props, "url")) return [3 /*break*/, 2];
|
|
4155
4823
|
return [4 /*yield*/, this.fetchFormConfig(activeFormConfig.props.url)];
|
|
4156
4824
|
case 1:
|
|
4157
4825
|
formConfig = _d.sent();
|
|
4158
|
-
return [3 /*break*/,
|
|
4159
|
-
case 2:
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4826
|
+
return [3 /*break*/, 3];
|
|
4827
|
+
case 2:
|
|
4828
|
+
if (kwikidToolkit.checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
4829
|
+
formConfig = activeFormConfig;
|
|
4830
|
+
}
|
|
4831
|
+
else {
|
|
4832
|
+
console.error("No url or fields key in activeFormConfig");
|
|
4833
|
+
}
|
|
4834
|
+
_d.label = 3;
|
|
4835
|
+
case 3: return [3 /*break*/, 7];
|
|
4163
4836
|
case 4:
|
|
4837
|
+
if (!kwikidToolkit.checkObjectKeyExists(activeFormConfig.formContent, "url")) return [3 /*break*/, 6];
|
|
4838
|
+
return [4 /*yield*/, this.fetchFormConfig(activeFormConfig.formContent.url)];
|
|
4839
|
+
case 5:
|
|
4840
|
+
formConfig = _d.sent();
|
|
4841
|
+
return [3 /*break*/, 7];
|
|
4842
|
+
case 6:
|
|
4843
|
+
if (kwikidToolkit.checkObjectKeyExists(activeFormConfig, "fields")) {
|
|
4844
|
+
formConfig = activeFormConfig;
|
|
4845
|
+
}
|
|
4846
|
+
else {
|
|
4847
|
+
console.error("No url or fields key in activeFormConfig");
|
|
4848
|
+
}
|
|
4849
|
+
_d.label = 7;
|
|
4850
|
+
case 7:
|
|
4164
4851
|
console.log(JSON.parse(JSON.stringify(formConfig)));
|
|
4165
4852
|
formConfig = new Converter().convertFormConfig(formConfig);
|
|
4166
4853
|
activeFormData = (_a = this.allFormsData[formConfig.key]) !== null && _a !== void 0 ? _a : {};
|
|
@@ -4273,7 +4960,7 @@
|
|
|
4273
4960
|
return KwikIDFormsRendererComponent;
|
|
4274
4961
|
}());
|
|
4275
4962
|
/** @nocollapse */ KwikIDFormsRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsRendererComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4276
|
-
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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 [
|
|
4963
|
+
/** @nocollapse */ KwikIDFormsRendererComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "timestamp"], outputs: ["close"] }, { type: i3__namespace$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.TuiPushAlertDirective, selector: "[tuiPush]", inputs: ["tuiPush"] }, { type: i4__namespace$1.TuiPushDirective, selector: "tui-push" }], animations: [
|
|
4277
4964
|
animations.trigger("panelInOut", [
|
|
4278
4965
|
animations.transition(":enter", [
|
|
4279
4966
|
animations.style({ transform: "translateY(100%)" }),
|
|
@@ -4366,13 +5053,45 @@
|
|
|
4366
5053
|
return KwikIDFormBuilderModule;
|
|
4367
5054
|
}());
|
|
4368
5055
|
/** @nocollapse */ KwikIDFormBuilderModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormBuilderModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4369
|
-
/** @nocollapse */ KwikIDFormBuilderModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormBuilderModule, declarations: [KwikIDFormsBuilderComponent
|
|
4370
|
-
|
|
5056
|
+
/** @nocollapse */ KwikIDFormBuilderModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormBuilderModule, declarations: [KwikIDFormsBuilderComponent,
|
|
5057
|
+
ElementConfigEditor,
|
|
5058
|
+
BasicElementConfigEditor,
|
|
5059
|
+
BasicTextConfigEditor,
|
|
5060
|
+
BasicRadioConfigEditor], imports: [i3.CommonModule,
|
|
5061
|
+
i1.FormsModule,
|
|
5062
|
+
i1.ReactiveFormsModule,
|
|
5063
|
+
i4.DragDropModule,
|
|
5064
|
+
i2.KwikUIButtonModule,
|
|
5065
|
+
i2.KwikUIInputModule,
|
|
5066
|
+
i2.KwikUIButtonIconModule], exports: [KwikIDFormsBuilderComponent] });
|
|
5067
|
+
/** @nocollapse */ KwikIDFormBuilderModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormBuilderModule, providers: [], imports: [[
|
|
5068
|
+
i3.CommonModule,
|
|
5069
|
+
i1.FormsModule,
|
|
5070
|
+
i1.ReactiveFormsModule,
|
|
5071
|
+
i4.DragDropModule,
|
|
5072
|
+
i2.KwikUIButtonModule,
|
|
5073
|
+
i2.KwikUIInputModule,
|
|
5074
|
+
i2.KwikUIButtonIconModule
|
|
5075
|
+
]] });
|
|
4371
5076
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormBuilderModule, decorators: [{
|
|
4372
5077
|
type: i0.NgModule,
|
|
4373
5078
|
args: [{
|
|
4374
|
-
declarations: [
|
|
4375
|
-
|
|
5079
|
+
declarations: [
|
|
5080
|
+
KwikIDFormsBuilderComponent,
|
|
5081
|
+
ElementConfigEditor,
|
|
5082
|
+
BasicElementConfigEditor,
|
|
5083
|
+
BasicTextConfigEditor,
|
|
5084
|
+
BasicRadioConfigEditor
|
|
5085
|
+
],
|
|
5086
|
+
imports: [
|
|
5087
|
+
i3.CommonModule,
|
|
5088
|
+
i1.FormsModule,
|
|
5089
|
+
i1.ReactiveFormsModule,
|
|
5090
|
+
i4.DragDropModule,
|
|
5091
|
+
i2.KwikUIButtonModule,
|
|
5092
|
+
i2.KwikUIInputModule,
|
|
5093
|
+
i2.KwikUIButtonIconModule
|
|
5094
|
+
],
|
|
4376
5095
|
providers: [],
|
|
4377
5096
|
exports: [KwikIDFormsBuilderComponent]
|
|
4378
5097
|
}]
|
|
@@ -4384,20 +5103,20 @@
|
|
|
4384
5103
|
return KwikIDFormViewModule;
|
|
4385
5104
|
}());
|
|
4386
5105
|
/** @nocollapse */ KwikIDFormViewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4387
|
-
/** @nocollapse */ KwikIDFormViewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent, SafeHtmlPipe$1], imports: [
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
i3.TuiLabelModule,
|
|
4391
|
-
i4.TuiPushModule,
|
|
4392
|
-
i3.TuiSvgModule,
|
|
5106
|
+
/** @nocollapse */ KwikIDFormViewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, declarations: [KwikIDFormViewComponent, SafeHtmlPipe$1], imports: [i3.CommonModule,
|
|
5107
|
+
i1.FormsModule,
|
|
5108
|
+
i1.ReactiveFormsModule,
|
|
5109
|
+
i3$1.TuiLabelModule,
|
|
5110
|
+
i4$1.TuiPushModule,
|
|
5111
|
+
i3$1.TuiSvgModule,
|
|
4393
5112
|
i2.KwikUIModule], exports: [KwikIDFormViewComponent] });
|
|
4394
5113
|
/** @nocollapse */ KwikIDFormViewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, imports: [[
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
i3.TuiLabelModule,
|
|
4399
|
-
i4.TuiPushModule,
|
|
4400
|
-
i3.TuiSvgModule,
|
|
5114
|
+
i3.CommonModule,
|
|
5115
|
+
i1.FormsModule,
|
|
5116
|
+
i1.ReactiveFormsModule,
|
|
5117
|
+
i3$1.TuiLabelModule,
|
|
5118
|
+
i4$1.TuiPushModule,
|
|
5119
|
+
i3$1.TuiSvgModule,
|
|
4401
5120
|
i2.KwikUIModule
|
|
4402
5121
|
]] });
|
|
4403
5122
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormViewModule, decorators: [{
|
|
@@ -4405,12 +5124,12 @@
|
|
|
4405
5124
|
args: [{
|
|
4406
5125
|
declarations: [KwikIDFormViewComponent, SafeHtmlPipe$1],
|
|
4407
5126
|
imports: [
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
i3.TuiLabelModule,
|
|
4412
|
-
i4.TuiPushModule,
|
|
4413
|
-
i3.TuiSvgModule,
|
|
5127
|
+
i3.CommonModule,
|
|
5128
|
+
i1.FormsModule,
|
|
5129
|
+
i1.ReactiveFormsModule,
|
|
5130
|
+
i3$1.TuiLabelModule,
|
|
5131
|
+
i4$1.TuiPushModule,
|
|
5132
|
+
i3$1.TuiSvgModule,
|
|
4414
5133
|
i2.KwikUIModule
|
|
4415
5134
|
],
|
|
4416
5135
|
exports: [KwikIDFormViewComponent]
|
|
@@ -4423,28 +5142,28 @@
|
|
|
4423
5142
|
return KwikIDFormsListModule;
|
|
4424
5143
|
}());
|
|
4425
5144
|
/** @nocollapse */ KwikIDFormsListModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4426
|
-
/** @nocollapse */ KwikIDFormsListModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListModule, declarations: [KwikIDFormsListComponent, SafeHtmlPipe], imports: [
|
|
4427
|
-
|
|
4428
|
-
|
|
5145
|
+
/** @nocollapse */ KwikIDFormsListModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListModule, declarations: [KwikIDFormsListComponent, SafeHtmlPipe], imports: [i3.CommonModule,
|
|
5146
|
+
i1.FormsModule,
|
|
5147
|
+
i1.ReactiveFormsModule,
|
|
4429
5148
|
i2.KwikUIModule,
|
|
4430
|
-
i3.TuiSvgModule], exports: [KwikIDFormsListComponent] });
|
|
5149
|
+
i3$1.TuiSvgModule], exports: [KwikIDFormsListComponent] });
|
|
4431
5150
|
/** @nocollapse */ KwikIDFormsListModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListModule, imports: [[
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
5151
|
+
i3.CommonModule,
|
|
5152
|
+
i1.FormsModule,
|
|
5153
|
+
i1.ReactiveFormsModule,
|
|
4435
5154
|
i2.KwikUIModule,
|
|
4436
|
-
i3.TuiSvgModule
|
|
5155
|
+
i3$1.TuiSvgModule
|
|
4437
5156
|
]] });
|
|
4438
5157
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsListModule, decorators: [{
|
|
4439
5158
|
type: i0.NgModule,
|
|
4440
5159
|
args: [{
|
|
4441
5160
|
declarations: [KwikIDFormsListComponent, SafeHtmlPipe],
|
|
4442
5161
|
imports: [
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
5162
|
+
i3.CommonModule,
|
|
5163
|
+
i1.FormsModule,
|
|
5164
|
+
i1.ReactiveFormsModule,
|
|
4446
5165
|
i2.KwikUIModule,
|
|
4447
|
-
i3.TuiSvgModule
|
|
5166
|
+
i3$1.TuiSvgModule
|
|
4448
5167
|
],
|
|
4449
5168
|
exports: [KwikIDFormsListComponent]
|
|
4450
5169
|
}]
|
|
@@ -4456,37 +5175,37 @@
|
|
|
4456
5175
|
return KwikIDFormRendererModule;
|
|
4457
5176
|
}());
|
|
4458
5177
|
/** @nocollapse */ KwikIDFormRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4459
|
-
/** @nocollapse */ KwikIDFormRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormRendererModule, declarations: [KwikIDFormsRendererComponent], imports: [
|
|
5178
|
+
/** @nocollapse */ KwikIDFormRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormRendererModule, declarations: [KwikIDFormsRendererComponent], imports: [i3.CommonModule,
|
|
4460
5179
|
http.HttpClientModule,
|
|
4461
5180
|
KwikIDFormViewModule,
|
|
4462
5181
|
KwikIDFormsListModule,
|
|
4463
5182
|
i2.KwikUIModule,
|
|
4464
|
-
i3.TuiLoaderModule,
|
|
4465
|
-
i4.TuiPushModule,
|
|
4466
|
-
i3.TuiSvgModule], exports: [KwikIDFormsRendererComponent] });
|
|
5183
|
+
i3$1.TuiLoaderModule,
|
|
5184
|
+
i4$1.TuiPushModule,
|
|
5185
|
+
i3$1.TuiSvgModule], exports: [KwikIDFormsRendererComponent] });
|
|
4467
5186
|
/** @nocollapse */ KwikIDFormRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormRendererModule, providers: [], imports: [[
|
|
4468
|
-
|
|
5187
|
+
i3.CommonModule,
|
|
4469
5188
|
http.HttpClientModule,
|
|
4470
5189
|
KwikIDFormViewModule,
|
|
4471
5190
|
KwikIDFormsListModule,
|
|
4472
5191
|
i2.KwikUIModule,
|
|
4473
|
-
i3.TuiLoaderModule,
|
|
4474
|
-
i4.TuiPushModule,
|
|
4475
|
-
i3.TuiSvgModule
|
|
5192
|
+
i3$1.TuiLoaderModule,
|
|
5193
|
+
i4$1.TuiPushModule,
|
|
5194
|
+
i3$1.TuiSvgModule
|
|
4476
5195
|
]] });
|
|
4477
5196
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormRendererModule, decorators: [{
|
|
4478
5197
|
type: i0.NgModule,
|
|
4479
5198
|
args: [{
|
|
4480
5199
|
declarations: [KwikIDFormsRendererComponent],
|
|
4481
5200
|
imports: [
|
|
4482
|
-
|
|
5201
|
+
i3.CommonModule,
|
|
4483
5202
|
http.HttpClientModule,
|
|
4484
5203
|
KwikIDFormViewModule,
|
|
4485
5204
|
KwikIDFormsListModule,
|
|
4486
5205
|
i2.KwikUIModule,
|
|
4487
|
-
i3.TuiLoaderModule,
|
|
4488
|
-
i4.TuiPushModule,
|
|
4489
|
-
i3.TuiSvgModule
|
|
5206
|
+
i3$1.TuiLoaderModule,
|
|
5207
|
+
i4$1.TuiPushModule,
|
|
5208
|
+
i3$1.TuiSvgModule
|
|
4490
5209
|
],
|
|
4491
5210
|
providers: [],
|
|
4492
5211
|
exports: [KwikIDFormsRendererComponent]
|
|
@@ -4499,15 +5218,15 @@
|
|
|
4499
5218
|
return KwikIDFormsModule;
|
|
4500
5219
|
}());
|
|
4501
5220
|
/** @nocollapse */ KwikIDFormsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
4502
|
-
/** @nocollapse */ KwikIDFormsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsModule, imports: [
|
|
4503
|
-
|
|
4504
|
-
|
|
5221
|
+
/** @nocollapse */ KwikIDFormsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsModule, imports: [i3.CommonModule,
|
|
5222
|
+
i1.FormsModule,
|
|
5223
|
+
i1.ReactiveFormsModule,
|
|
4505
5224
|
KwikIDFormBuilderModule,
|
|
4506
5225
|
KwikIDFormRendererModule], exports: [KwikIDFormBuilderModule, KwikIDFormRendererModule] });
|
|
4507
5226
|
/** @nocollapse */ KwikIDFormsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDFormsModule, imports: [[
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
5227
|
+
i3.CommonModule,
|
|
5228
|
+
i1.FormsModule,
|
|
5229
|
+
i1.ReactiveFormsModule,
|
|
4511
5230
|
KwikIDFormBuilderModule,
|
|
4512
5231
|
KwikIDFormRendererModule
|
|
4513
5232
|
], KwikIDFormBuilderModule, KwikIDFormRendererModule] });
|
|
@@ -4516,9 +5235,9 @@
|
|
|
4516
5235
|
args: [{
|
|
4517
5236
|
declarations: [],
|
|
4518
5237
|
imports: [
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
5238
|
+
i3.CommonModule,
|
|
5239
|
+
i1.FormsModule,
|
|
5240
|
+
i1.ReactiveFormsModule,
|
|
4522
5241
|
KwikIDFormBuilderModule,
|
|
4523
5242
|
KwikIDFormRendererModule
|
|
4524
5243
|
],
|