@apipass/schemas 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/base-schema.component.d.ts +12 -12
- package/{esm2020 → esm2022}/apipass-schemas.mjs +4 -4
- package/esm2022/base-schema.component.mjs +38 -0
- package/{esm2020 → esm2022}/public-api.mjs +17 -17
- package/esm2022/schema-custom-attributes/schema-custom-attributes.mjs +169 -0
- package/esm2022/schema-fields.service.mjs +81 -0
- package/esm2022/schema-form/schema-array/array-session/array-session.mjs +141 -0
- package/esm2022/schema-form/schema-array/schema-array.mjs +219 -0
- package/esm2022/schema-form/schema-form.mjs +107 -0
- package/esm2022/schema-form/schema-input/field-render/field-render.mjs +76 -0
- package/esm2022/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +51 -0
- package/esm2022/schema-form/schema-input/input-render/input-render.mjs +193 -0
- package/esm2022/schema-form/schema-input/input-render/number-input/number-input.component.mjs +49 -0
- package/esm2022/schema-form/schema-input/schema-input.mjs +95 -0
- package/esm2022/schema-form/schema-object/schema-object.mjs +125 -0
- package/esm2022/schema-form-render.mjs +126 -0
- package/{esm2020 → esm2022}/schema-form-render.module.mjs +109 -108
- package/esm2022/schema-validation-field.mjs +18 -0
- package/{esm2020 → esm2022}/struct.utils.mjs +9 -9
- package/esm2022/type-script-compile/type-script-compile.base.mjs +115 -0
- package/{fesm2020 → fesm2022}/apipass-schemas.mjs +1571 -1563
- package/fesm2022/apipass-schemas.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/package.json +15 -21
- package/public-api.d.ts +16 -16
- package/schema-custom-attributes/schema-custom-attributes.d.ts +21 -21
- package/schema-fields.service.d.ts +14 -14
- package/schema-form/schema-array/array-session/array-session.d.ts +19 -19
- package/schema-form/schema-array/schema-array.d.ts +31 -32
- package/schema-form/schema-form.d.ts +31 -31
- package/schema-form/schema-input/field-render/field-render.d.ts +16 -16
- package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -15
- package/schema-form/schema-input/input-render/input-render.d.ts +29 -29
- package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -15
- package/schema-form/schema-input/schema-input.d.ts +18 -19
- package/schema-form/schema-object/schema-object.d.ts +34 -34
- package/schema-form-render.d.ts +31 -31
- package/schema-form-render.module.d.ts +23 -23
- package/schema-validation-field.d.ts +23 -23
- package/struct.utils.d.ts +1 -1
- package/type-script-compile/type-script-compile.base.d.ts +17 -17
- package/esm2020/base-schema.component.mjs +0 -37
- package/esm2020/schema-custom-attributes/schema-custom-attributes.mjs +0 -169
- package/esm2020/schema-fields.service.mjs +0 -80
- package/esm2020/schema-form/schema-array/array-session/array-session.mjs +0 -143
- package/esm2020/schema-form/schema-array/schema-array.mjs +0 -220
- package/esm2020/schema-form/schema-form.mjs +0 -107
- package/esm2020/schema-form/schema-input/field-render/field-render.mjs +0 -69
- package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +0 -46
- package/esm2020/schema-form/schema-input/input-render/input-render.mjs +0 -192
- package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +0 -44
- package/esm2020/schema-form/schema-input/schema-input.mjs +0 -96
- package/esm2020/schema-form/schema-object/schema-object.mjs +0 -123
- package/esm2020/schema-form-render.mjs +0 -126
- package/esm2020/schema-validation-field.mjs +0 -14
- package/esm2020/type-script-compile/type-script-compile.base.mjs +0 -114
- package/fesm2015/apipass-schemas.mjs +0 -1801
- package/fesm2015/apipass-schemas.mjs.map +0 -1
- package/fesm2020/apipass-schemas.mjs.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class TypeScriptCompileBase {
|
|
3
|
-
protected getTranslate(text: string): string;
|
|
4
|
-
protected addItemToFormProperties(formProperties: any, item: any, key: string): void;
|
|
5
|
-
compileProperties(input: any): {
|
|
6
|
-
compiledProperties: any;
|
|
7
|
-
formProperties: any;
|
|
8
|
-
inputData: any;
|
|
9
|
-
};
|
|
10
|
-
protected translateProperties(input: any): void;
|
|
11
|
-
protected proccessProperties(item: any, formProperties: Record<string, unknown>, key: any): void;
|
|
12
|
-
protected hasProperties(item: any): any;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TypeScriptCompileBase, never>;
|
|
14
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TypeScriptCompileBase>;
|
|
15
|
-
}
|
|
16
|
-
export declare function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl: TypeScriptCompileBase): any;
|
|
17
|
-
export declare const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER: any;
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TypeScriptCompileBase {
|
|
3
|
+
protected getTranslate(text: string): string;
|
|
4
|
+
protected addItemToFormProperties(formProperties: any, item: any, key: string): void;
|
|
5
|
+
compileProperties(input: any): {
|
|
6
|
+
compiledProperties: any;
|
|
7
|
+
formProperties: any;
|
|
8
|
+
inputData: any;
|
|
9
|
+
};
|
|
10
|
+
protected translateProperties(input: any): void;
|
|
11
|
+
protected proccessProperties(item: any, formProperties: Record<string, unknown>, key: any): void;
|
|
12
|
+
protected hasProperties(item: any): any;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TypeScriptCompileBase, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TypeScriptCompileBase>;
|
|
15
|
+
}
|
|
16
|
+
export declare function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl: TypeScriptCompileBase): any;
|
|
17
|
+
export declare const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER: any;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class BaseSchemaComponent {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.modelChange = new EventEmitter();
|
|
6
|
-
}
|
|
7
|
-
getSchemaProperties() {
|
|
8
|
-
return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
|
|
9
|
-
}
|
|
10
|
-
canRender(property) {
|
|
11
|
-
property.canRender = property?.conditionExpression ? eval(property.conditionExpression) : true;
|
|
12
|
-
return property.canRender;
|
|
13
|
-
}
|
|
14
|
-
onDrop(event, attr) {
|
|
15
|
-
const data = event.data;
|
|
16
|
-
if (!attr) {
|
|
17
|
-
attr = '';
|
|
18
|
-
}
|
|
19
|
-
attr += `{{${data}}}`;
|
|
20
|
-
return attr;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
BaseSchemaComponent.ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
|
|
24
|
-
BaseSchemaComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BaseSchemaComponent, selectors: [["ng-component"]], inputs: { model: "model", schema: "schema" }, outputs: { modelChange: "modelChange" }, decls: 0, vars: 0, template: function BaseSchemaComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
25
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseSchemaComponent, [{
|
|
26
|
-
type: Component,
|
|
27
|
-
args: [{
|
|
28
|
-
template: ''
|
|
29
|
-
}]
|
|
30
|
-
}], null, { model: [{
|
|
31
|
-
type: Input
|
|
32
|
-
}], schema: [{
|
|
33
|
-
type: Input
|
|
34
|
-
}], modelChange: [{
|
|
35
|
-
type: Output
|
|
36
|
-
}] }); })();
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS1zY2hlbWEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvc2NoZW1hcy9zcmMvYmFzZS1zY2hlbWEuY29tcG9uZW50Ln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3QgZGF0YSA9IGV2ZW50LmRhdGFcclxuICAgIGlmICghYXR0cikge1xyXG4gICAgICBhdHRyID0gJydcclxuICAgIH1cclxuICAgIGF0dHIgKz0gYHt7JHtkYXRhfX19YFxyXG4gICAgcmV0dXJuIGF0dHJcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { BaseSchemaComponent } from '../base-schema.component';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/common";
|
|
5
|
-
import * as i2 from "ngx-drag-drop";
|
|
6
|
-
import * as i3 from "@angular/forms";
|
|
7
|
-
import * as i4 from "@angular/material/tooltip";
|
|
8
|
-
const _c0 = function () { return { standalone: true }; };
|
|
9
|
-
function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
-
const _r8 = i0.ɵɵgetCurrentView();
|
|
11
|
-
i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "label", 8);
|
|
12
|
-
i0.ɵɵtext(3);
|
|
13
|
-
i0.ɵɵelementEnd();
|
|
14
|
-
i0.ɵɵelementStart(4, "span", 9);
|
|
15
|
-
i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r8); const i_r6 = restoredCtx.index; const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.removeCustomAttribute(i_r6)); });
|
|
16
|
-
i0.ɵɵelement(5, "i", 10);
|
|
17
|
-
i0.ɵɵelementEnd();
|
|
18
|
-
i0.ɵɵelementStart(6, "input", 11);
|
|
19
|
-
i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; return i0.ɵɵresetView(attribute_r5.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.onDropAttr($event, "value", attribute_r5)); });
|
|
20
|
-
i0.ɵɵelementEnd()()();
|
|
21
|
-
} if (rf & 2) {
|
|
22
|
-
const attribute_r5 = ctx.$implicit;
|
|
23
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
24
|
-
i0.ɵɵadvance(3);
|
|
25
|
-
i0.ɵɵtextInterpolate(attribute_r5.label);
|
|
26
|
-
i0.ɵɵadvance(2);
|
|
27
|
-
i0.ɵɵproperty("matTooltip", ctx_r0.customAttributeRemoveLabel);
|
|
28
|
-
i0.ɵɵadvance(1);
|
|
29
|
-
i0.ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0));
|
|
30
|
-
} }
|
|
31
|
-
function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
32
|
-
const _r12 = i0.ɵɵgetCurrentView();
|
|
33
|
-
i0.ɵɵelementStart(0, "div", 12)(1, "div", 13)(2, "div", 7)(3, "label", 8);
|
|
34
|
-
i0.ɵɵtext(4);
|
|
35
|
-
i0.ɵɵelementStart(5, "strong");
|
|
36
|
-
i0.ɵɵtext(6, "*");
|
|
37
|
-
i0.ɵɵelementEnd()();
|
|
38
|
-
i0.ɵɵelementStart(7, "input", 11);
|
|
39
|
-
i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.newCustomField.label = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.onDropAttr($event, "label", ctx_r13.newCustomField)); });
|
|
40
|
-
i0.ɵɵelementEnd()()();
|
|
41
|
-
i0.ɵɵelementStart(8, "div", 13)(9, "div", 7)(10, "label", 8);
|
|
42
|
-
i0.ɵɵtext(11);
|
|
43
|
-
i0.ɵɵelementStart(12, "strong");
|
|
44
|
-
i0.ɵɵtext(13, "*");
|
|
45
|
-
i0.ɵɵelementEnd()();
|
|
46
|
-
i0.ɵɵelementStart(14, "input", 11);
|
|
47
|
-
i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.newCustomField.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onDropAttr($event, "value", ctx_r15.newCustomField)); });
|
|
48
|
-
i0.ɵɵelementEnd()()()();
|
|
49
|
-
} if (rf & 2) {
|
|
50
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
51
|
-
i0.ɵɵadvance(4);
|
|
52
|
-
i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldNameLabel);
|
|
53
|
-
i0.ɵɵadvance(3);
|
|
54
|
-
i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", i0.ɵɵpureFunction0(6, _c0));
|
|
55
|
-
i0.ɵɵadvance(4);
|
|
56
|
-
i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldValueLabel);
|
|
57
|
-
i0.ɵɵadvance(3);
|
|
58
|
-
i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0));
|
|
59
|
-
} }
|
|
60
|
-
function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) { if (rf & 1) {
|
|
61
|
-
const _r17 = i0.ɵɵgetCurrentView();
|
|
62
|
-
i0.ɵɵelementStart(0, "button", 14);
|
|
63
|
-
i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.newCustomField = {}); });
|
|
64
|
-
i0.ɵɵtext(1);
|
|
65
|
-
i0.ɵɵelementEnd();
|
|
66
|
-
} if (rf & 2) {
|
|
67
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
68
|
-
i0.ɵɵadvance(1);
|
|
69
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r2.newCustomFieldAddLabel, " ");
|
|
70
|
-
} }
|
|
71
|
-
function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
-
const _r19 = i0.ɵɵgetCurrentView();
|
|
73
|
-
i0.ɵɵelementStart(0, "button", 15);
|
|
74
|
-
i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.newCustomField = null); });
|
|
75
|
-
i0.ɵɵtext(1);
|
|
76
|
-
i0.ɵɵelementEnd();
|
|
77
|
-
} if (rf & 2) {
|
|
78
|
-
const ctx_r3 = i0.ɵɵnextContext();
|
|
79
|
-
i0.ɵɵadvance(1);
|
|
80
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r3.newCustomFieldCancelLabel, " ");
|
|
81
|
-
} }
|
|
82
|
-
function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) { if (rf & 1) {
|
|
83
|
-
const _r21 = i0.ɵɵgetCurrentView();
|
|
84
|
-
i0.ɵɵelementStart(0, "button", 14);
|
|
85
|
-
i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.saveNewAttribute(ctx_r20.newCustomField)); });
|
|
86
|
-
i0.ɵɵtext(1);
|
|
87
|
-
i0.ɵɵelementEnd();
|
|
88
|
-
} if (rf & 2) {
|
|
89
|
-
const ctx_r4 = i0.ɵɵnextContext();
|
|
90
|
-
i0.ɵɵadvance(1);
|
|
91
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r4.newCustomFieldSaveLabel, " ");
|
|
92
|
-
} }
|
|
93
|
-
export class SchemaCustomAttributesComponent extends BaseSchemaComponent {
|
|
94
|
-
constructor() {
|
|
95
|
-
super(...arguments);
|
|
96
|
-
this.customAttributeRemoveLabel = 'Remove';
|
|
97
|
-
this.newCustomFieldNameLabel = 'Name';
|
|
98
|
-
this.newCustomFieldValueLabel = 'Value';
|
|
99
|
-
this.newCustomFieldAddLabel = 'Add';
|
|
100
|
-
this.newCustomFieldSaveLabel = 'Save';
|
|
101
|
-
this.newCustomFieldCancelLabel = 'Cancel';
|
|
102
|
-
this.onSaveAttribute = new EventEmitter();
|
|
103
|
-
this.onDropOnAttribute = new EventEmitter();
|
|
104
|
-
}
|
|
105
|
-
ngAfterContentInit() {
|
|
106
|
-
if (!this.model) {
|
|
107
|
-
this.model = [];
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
saveNewAttribute(newCustomField) {
|
|
111
|
-
this.onSaveAttribute.emit(newCustomField);
|
|
112
|
-
this.model.push(newCustomField);
|
|
113
|
-
this.newCustomField = null;
|
|
114
|
-
this.modelChange.emit(this.model);
|
|
115
|
-
}
|
|
116
|
-
removeCustomAttribute(attributeIndex) {
|
|
117
|
-
this.model.splice(attributeIndex, 1);
|
|
118
|
-
this.modelChange.emit(this.model);
|
|
119
|
-
}
|
|
120
|
-
onDropAttr($event, value, newCustomField) {
|
|
121
|
-
if (!newCustomField[value]) {
|
|
122
|
-
newCustomField[value] = '';
|
|
123
|
-
}
|
|
124
|
-
newCustomField[value] += `{{${$event.data}}}`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
SchemaCustomAttributesComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaCustomAttributesComponent_BaseFactory; return function SchemaCustomAttributesComponent_Factory(t) { return (ɵSchemaCustomAttributesComponent_BaseFactory || (ɵSchemaCustomAttributesComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaCustomAttributesComponent)))(t || SchemaCustomAttributesComponent); }; }();
|
|
128
|
-
SchemaCustomAttributesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaCustomAttributesComponent, selectors: [["schema-custom-attributes"]], inputs: { onDropFunction: "onDropFunction", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel" }, outputs: { onSaveAttribute: "onSaveAttribute", onDropOnAttribute: "onDropOnAttribute" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 5, consts: [["class", "row custom-attributes", 4, "ngFor", "ngForOf"], ["class", "struct-custom-field", 4, "ngIf"], [1, "row", "actions-buttons"], [1, "col-md-12", "pull-right"], ["class", "btn btn-outline-primary float-left", 3, "click", 4, "ngIf"], ["class", "btn btn-outline-danger float-left ml-2", 3, "click", 4, "ngIf"], [1, "row", "custom-attributes"], [1, "col-md-12"], [1, "info-label"], [1, "customAttributeDeleteIcon", 3, "click"], [1, "far", "fa-trash-alt", 3, "matTooltip"], ["dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange", "dndDrop"], [1, "struct-custom-field"], [1, "row"], [1, "btn", "btn-outline-primary", "float-left", 3, "click"], [1, "btn", "btn-outline-danger", "float-left", "ml-2", 3, "click"]], template: function SchemaCustomAttributesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
129
|
-
i0.ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 7, 5, "div", 0);
|
|
130
|
-
i0.ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 15, 8, "div", 1);
|
|
131
|
-
i0.ɵɵelementStart(2, "div", 2)(3, "div", 3);
|
|
132
|
-
i0.ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 2, 1, "button", 4);
|
|
133
|
-
i0.ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 2, 1, "button", 5);
|
|
134
|
-
i0.ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 2, 1, "button", 4);
|
|
135
|
-
i0.ɵɵelementEnd()();
|
|
136
|
-
} if (rf & 2) {
|
|
137
|
-
i0.ɵɵproperty("ngForOf", ctx.model);
|
|
138
|
-
i0.ɵɵadvance(1);
|
|
139
|
-
i0.ɵɵproperty("ngIf", ctx.newCustomField);
|
|
140
|
-
i0.ɵɵadvance(3);
|
|
141
|
-
i0.ɵɵproperty("ngIf", !ctx.newCustomField);
|
|
142
|
-
i0.ɵɵadvance(1);
|
|
143
|
-
i0.ɵɵproperty("ngIf", ctx.newCustomField);
|
|
144
|
-
i0.ɵɵadvance(1);
|
|
145
|
-
i0.ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
|
|
146
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, i4.MatTooltip], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}"] });
|
|
147
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
|
|
148
|
-
type: Component,
|
|
149
|
-
args: [{ selector: 'schema-custom-attributes', template: "<div class=\"row custom-attributes\" *ngFor=\"let attribute of model; let i = index\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ attribute.label }}</label>\r\n <span (click)=\"removeCustomAttribute(i)\" class=\"customAttributeDeleteIcon\">\r\n <i class=\"far fa-trash-alt\" [matTooltip]=\"this.customAttributeRemoveLabel\"></i>\r\n </span>\r\n\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"attribute.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', attribute)\"\r\n />\r\n </div>\r\n</div>\r\n<div *ngIf=\"newCustomField\" class=\"struct-custom-field\">\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldNameLabel }}<strong>*</strong></label>\r\n <input \r\n class=\"form-control\" \r\n [(ngModel)]=\"newCustomField.label\" \r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'label', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldValueLabel }}<strong>*</strong></label>\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"newCustomField.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row actions-buttons\">\r\n <div class=\"col-md-12 pull-right\">\r\n <button class=\"btn btn-outline-primary float-left\" *ngIf=\"!newCustomField\" (click)=\"newCustomField = {}\">\r\n {{ this.newCustomFieldAddLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-danger float-left ml-2\"\r\n *ngIf=\"newCustomField\"\r\n (click)=\"newCustomField = null\"\r\n >\r\n {{ this.newCustomFieldCancelLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-primary float-left\"\r\n *ngIf=\"newCustomField && newCustomField.label && newCustomField.value\"\r\n (click)=\"saveNewAttribute(newCustomField)\"\r\n >\r\n {{ this.newCustomFieldSaveLabel }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".customAttributeDeleteIcon{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon:hover{color:#777}.struct-custom-field{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}\n"] }]
|
|
150
|
-
}], null, { onDropFunction: [{
|
|
151
|
-
type: Input
|
|
152
|
-
}], customAttributeRemoveLabel: [{
|
|
153
|
-
type: Input
|
|
154
|
-
}], newCustomFieldNameLabel: [{
|
|
155
|
-
type: Input
|
|
156
|
-
}], newCustomFieldValueLabel: [{
|
|
157
|
-
type: Input
|
|
158
|
-
}], newCustomFieldAddLabel: [{
|
|
159
|
-
type: Input
|
|
160
|
-
}], newCustomFieldSaveLabel: [{
|
|
161
|
-
type: Input
|
|
162
|
-
}], newCustomFieldCancelLabel: [{
|
|
163
|
-
type: Input
|
|
164
|
-
}], onSaveAttribute: [{
|
|
165
|
-
type: Output
|
|
166
|
-
}], onDropOnAttribute: [{
|
|
167
|
-
type: Output
|
|
168
|
-
}] }); })();
|
|
169
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hLWN1c3RvbS1hdHRyaWJ1dGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvc2NoZW1hcy9zcmMvc2NoZW1hLWN1c3RvbS1hdHRyaWJ1dGVzL3NjaGVtYS1jdXN0b20tYXR0cmlidXRlcy50cyIsIi4uLy4uLy4uLy4uL3Byb2plY3RzL3NjaGVtYXMvc3JjL3NjaGVtYS1jdXN0b20tYXR0cmlidXRlcy9zY2hlbWEtY3Vzd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dG9tRmllbGRcIlxyXG4gICAgICAoY2xpY2spPVwibmV3Q3VzdG9tRmllbGQgPSBudWxsXCJcclxuICAgID5cclxuICAgICAge3sgdGhpcy5uZXdDdXN0b21GaWVsZENhbmNlbExhYmVsIH19XHJcbiAgICA8L2J1dHRvbj5cclxuICAgIDxidXR0b25cclxuICAgICAgY2xhc3M9XCJidG4gYnRuLW91dGxpbmUtcHJpbWFyeSBmbG9hdC1sZWZ0XCJcclxuICAgICAgKm5nSWY9XCJuZXdDdXN0b21GaWVsZCAmJiBuZXdDdXN0b21GaWVsZC5sYWJlbCAmJiBuZXdDdXN0b21GaWVsZC52YWx1ZVwiXHJcbiAgICAgIChjbGljayk9XCJzYXZlTmV3QXR0cmlidXRlKG5ld0N1c3RvbUZpZWxkKVwiXHJcbiAgICA+XHJcbiAgICAgIHt7IHRoaXMubmV3Q3VzdG9tRmllbGRTYXZlTGFiZWwgfX1cclxuICAgIDwvYnV0dG9uPlxyXG4gIDwvZGl2PlxyXG48L2Rpdj5cclxuIl19
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { SchemaValidationField } from './schema-validation-field';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export class SchemaFieldsService {
|
|
5
|
-
async validateSchemaFields(propertiesRendered, model, editing) {
|
|
6
|
-
if (!propertiesRendered) {
|
|
7
|
-
return new SchemaValidationField([], [], []);
|
|
8
|
-
}
|
|
9
|
-
const emptyFields = [];
|
|
10
|
-
const invalidMinLengthFields = [];
|
|
11
|
-
const invalidMaxLengthFields = [];
|
|
12
|
-
this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
|
|
13
|
-
const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
|
|
14
|
-
structValidationField.validationErrorsLabel = await this.getErrorsStringArray(structValidationField);
|
|
15
|
-
return structValidationField;
|
|
16
|
-
}
|
|
17
|
-
processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
|
|
18
|
-
for (const property of propertiesRendered) {
|
|
19
|
-
if ((property.type === 'object' || property.type === 'array') && property.properties) {
|
|
20
|
-
this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
21
|
-
}
|
|
22
|
-
else if (property.type === 'array' && !property.properties) {
|
|
23
|
-
const newProperty = { ...property };
|
|
24
|
-
newProperty.type = 'string';
|
|
25
|
-
this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const validateModel = recursive ? model : model[property.id];
|
|
29
|
-
if (property.type !== 'password' || !editing || validateModel !== undefined) {
|
|
30
|
-
if (property?.canRender && property?.minLength > 0 &&
|
|
31
|
-
(validateModel === undefined || validateModel === '' || validateModel === null)) {
|
|
32
|
-
emptyFields.push(property);
|
|
33
|
-
}
|
|
34
|
-
else if (property?.canRender && property?.minLength > 0 && (validateModel?.length < property.minLength)) {
|
|
35
|
-
invalidMinLengthFields.push(property);
|
|
36
|
-
}
|
|
37
|
-
else if (property?.canRender && property?.maxLength > 0 && (validateModel?.length > property.maxLength)) {
|
|
38
|
-
invalidMaxLengthFields.push(property);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async getErrorsStringArray(structValidation) {
|
|
45
|
-
if (!structValidation.isInvalidSchemaFields()) {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
const errors = [];
|
|
49
|
-
for (const field of structValidation.emptyFields) {
|
|
50
|
-
const fieldName = field.title || field.id;
|
|
51
|
-
errors.push({
|
|
52
|
-
type: 'emptyFields',
|
|
53
|
-
fieldName
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
for (const field of structValidation.invalidMinLengthFields) {
|
|
57
|
-
const fieldName = field.title || field.id;
|
|
58
|
-
errors.push({
|
|
59
|
-
type: 'invalidMinLengthFields',
|
|
60
|
-
fieldName,
|
|
61
|
-
minLength: field.minLength
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
for (const field of structValidation.invalidMaxLengthFields) {
|
|
65
|
-
const fieldName = field.title || field.id;
|
|
66
|
-
errors.push({
|
|
67
|
-
type: 'invalidMaxLengthFields',
|
|
68
|
-
fieldName,
|
|
69
|
-
maxLength: field.maxLength
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return errors;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
|
|
76
|
-
SchemaFieldsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
|
|
77
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFieldsService, [{
|
|
78
|
-
type: Injectable
|
|
79
|
-
}], null, null); })();
|
|
80
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hLWZpZWxkcy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvc2NoZW1hcy9zcmMvc2NoZW1hLWZpZWxkcy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDMUMsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sMkJBQTJCLENBQUE7O0FBR2pFLE1BQU0sT0FBTyxtQkFBbUI7SUFDdkIsS0FBSyxDQUFDLG9CQUFvQixDQUFFLGtCQUF5QixFQUFFLEtBQVUsRUFBRSxPQUFnQj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cclxuIl19
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { Component, ContentChild, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
|
|
2
|
-
import { BaseSchemaComponent } from '../../../base-schema.component';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/common";
|
|
5
|
-
import * as i2 from "ngx-drag-drop";
|
|
6
|
-
import * as i3 from "@angular/forms";
|
|
7
|
-
const _c0 = function () { return { standalone: true }; };
|
|
8
|
-
function ArraySessionComponent_div_4_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
-
const _r8 = i0.ɵɵgetCurrentView();
|
|
10
|
-
i0.ɵɵelementStart(0, "div", 0)(1, "div", 12)(2, "label", 13);
|
|
11
|
-
i0.ɵɵtext(3, "Loop");
|
|
12
|
-
i0.ɵɵelementEnd();
|
|
13
|
-
i0.ɵɵelementStart(4, "input", 14);
|
|
14
|
-
i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.loop = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.loop = ctx_r9.onDrop($event, item_r2.loop)); });
|
|
15
|
-
i0.ɵɵelementEnd()();
|
|
16
|
-
i0.ɵɵelementStart(5, "div", 15)(6, "label", 13);
|
|
17
|
-
i0.ɵɵtext(7, "Alias");
|
|
18
|
-
i0.ɵɵelementEnd();
|
|
19
|
-
i0.ɵɵelementStart(8, "input", 14);
|
|
20
|
-
i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.alias = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.alias = ctx_r13.onDrop($event, item_r2.alias)); });
|
|
21
|
-
i0.ɵɵelementEnd()()();
|
|
22
|
-
} if (rf & 2) {
|
|
23
|
-
const item_r2 = i0.ɵɵnextContext().$implicit;
|
|
24
|
-
i0.ɵɵadvance(4);
|
|
25
|
-
i0.ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0));
|
|
26
|
-
i0.ɵɵadvance(4);
|
|
27
|
-
i0.ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0));
|
|
28
|
-
} }
|
|
29
|
-
function ArraySessionComponent_div_4_ng_container_5_Template(rf, ctx) { if (rf & 1) {
|
|
30
|
-
i0.ɵɵelementContainer(0);
|
|
31
|
-
} }
|
|
32
|
-
const _c1 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
|
|
33
|
-
const _c2 = function (a0) { return { $implicit: a0 }; };
|
|
34
|
-
function ArraySessionComponent_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
-
const _r17 = i0.ɵɵgetCurrentView();
|
|
36
|
-
i0.ɵɵelementStart(0, "div", 7)(1, "div", 8);
|
|
37
|
-
i0.ɵɵtext(2);
|
|
38
|
-
i0.ɵɵelementStart(3, "i", 9);
|
|
39
|
-
i0.ɵɵlistener("click", function ArraySessionComponent_div_4_Template_i_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r17); const item_r2 = restoredCtx.$implicit; const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.remove(item_r2)); });
|
|
40
|
-
i0.ɵɵelementEnd()();
|
|
41
|
-
i0.ɵɵtemplate(4, ArraySessionComponent_div_4_div_4_Template, 9, 6, "div", 10);
|
|
42
|
-
i0.ɵɵtemplate(5, ArraySessionComponent_div_4_ng_container_5_Template, 1, 0, "ng-container", 11);
|
|
43
|
-
i0.ɵɵelementEnd();
|
|
44
|
-
} if (rf & 2) {
|
|
45
|
-
const item_r2 = ctx.$implicit;
|
|
46
|
-
const index_r3 = ctx.index;
|
|
47
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
48
|
-
i0.ɵɵadvance(2);
|
|
49
|
-
i0.ɵɵtextInterpolate2("", ctx_r0.removeLabel, " ", index_r3 + 1, " ");
|
|
50
|
-
i0.ɵɵadvance(2);
|
|
51
|
-
i0.ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
|
|
52
|
-
i0.ɵɵadvance(1);
|
|
53
|
-
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", i0.ɵɵpureFunction1(9, _c2, i0.ɵɵpureFunction3(5, _c1, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
|
|
54
|
-
} }
|
|
55
|
-
function ArraySessionComponent_button_9_Template(rf, ctx) { if (rf & 1) {
|
|
56
|
-
const _r19 = i0.ɵɵgetCurrentView();
|
|
57
|
-
i0.ɵɵelementStart(0, "button", 16);
|
|
58
|
-
i0.ɵɵlistener("click", function ArraySessionComponent_button_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.addLoop()); });
|
|
59
|
-
i0.ɵɵtext(1);
|
|
60
|
-
i0.ɵɵelementEnd();
|
|
61
|
-
} if (rf & 2) {
|
|
62
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
63
|
-
i0.ɵɵadvance(1);
|
|
64
|
-
i0.ɵɵtextInterpolate(ctx_r1.addLoopLabel);
|
|
65
|
-
} }
|
|
66
|
-
export class ArraySessionComponent extends BaseSchemaComponent {
|
|
67
|
-
constructor() {
|
|
68
|
-
super(...arguments);
|
|
69
|
-
this.label = '';
|
|
70
|
-
this.removeLabel = 'Remove';
|
|
71
|
-
this.addItemLabel = 'Add Item';
|
|
72
|
-
this.addLoopLabel = 'Add Loop';
|
|
73
|
-
this.showAddLoop = true;
|
|
74
|
-
this.onAdd = new EventEmitter();
|
|
75
|
-
this.onAddLoop = new EventEmitter();
|
|
76
|
-
this.subsectionItem = null;
|
|
77
|
-
}
|
|
78
|
-
add() {
|
|
79
|
-
this.onAdd.next();
|
|
80
|
-
}
|
|
81
|
-
addLoop() {
|
|
82
|
-
this.onAddLoop.next();
|
|
83
|
-
}
|
|
84
|
-
remove(item) {
|
|
85
|
-
const values = this.model;
|
|
86
|
-
const index = values.indexOf(item);
|
|
87
|
-
values.splice(index, 1);
|
|
88
|
-
this.model = values;
|
|
89
|
-
}
|
|
90
|
-
trackByIndex(index, obj) {
|
|
91
|
-
return index;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
ArraySessionComponent.ɵfac = /*@__PURE__*/ function () { let ɵArraySessionComponent_BaseFactory; return function ArraySessionComponent_Factory(t) { return (ɵArraySessionComponent_BaseFactory || (ɵArraySessionComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ArraySessionComponent)))(t || ArraySessionComponent); }; }();
|
|
95
|
-
ArraySessionComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
|
96
|
-
i0.ɵɵcontentQuery(dirIndex, TemplateRef, 5, TemplateRef);
|
|
97
|
-
} if (rf & 2) {
|
|
98
|
-
let _t;
|
|
99
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
|
|
100
|
-
} }, inputs: { label: "label", removeLabel: "removeLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", showAddLoop: "showAddLoop" }, outputs: { onAdd: "onAdd", onAddLoop: "onAddLoop" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 5, consts: [[1, "row"], [1, "col-md-12"], [1, "info-label", "bold"], ["class", "subsection-element", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "row", "add-buttons"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", 3, "click"], ["class", "btn btn-outline-primary float-left btn-personal-edit ml-2", 3, "click", 4, "ngIf"], [1, "subsection-element"], [1, "subsection-item-title"], [1, "far", "fa-trash-alt", 3, "click"], ["class", "row", 4, "ngIf"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "col-md-8"], [1, "info-label"], ["type", "text", "dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange", "dndDrop"], [1, "col-md-4"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", "ml-2", 3, "click"]], template: function ArraySessionComponent_Template(rf, ctx) { if (rf & 1) {
|
|
101
|
-
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "label", 2);
|
|
102
|
-
i0.ɵɵtext(3);
|
|
103
|
-
i0.ɵɵelementEnd();
|
|
104
|
-
i0.ɵɵtemplate(4, ArraySessionComponent_div_4_Template, 6, 11, "div", 3);
|
|
105
|
-
i0.ɵɵelementEnd()();
|
|
106
|
-
i0.ɵɵelementStart(5, "div", 4)(6, "div", 1)(7, "button", 5);
|
|
107
|
-
i0.ɵɵlistener("click", function ArraySessionComponent_Template_button_click_7_listener() { return ctx.add(); });
|
|
108
|
-
i0.ɵɵtext(8);
|
|
109
|
-
i0.ɵɵelementEnd();
|
|
110
|
-
i0.ɵɵtemplate(9, ArraySessionComponent_button_9_Template, 2, 1, "button", 6);
|
|
111
|
-
i0.ɵɵelementEnd()();
|
|
112
|
-
} if (rf & 2) {
|
|
113
|
-
i0.ɵɵadvance(3);
|
|
114
|
-
i0.ɵɵtextInterpolate(ctx.label);
|
|
115
|
-
i0.ɵɵadvance(1);
|
|
116
|
-
i0.ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
|
|
117
|
-
i0.ɵɵadvance(4);
|
|
118
|
-
i0.ɵɵtextInterpolate(ctx.addItemLabel);
|
|
119
|
-
i0.ɵɵadvance(1);
|
|
120
|
-
i0.ɵɵproperty("ngIf", ctx.showAddLoop);
|
|
121
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel], styles: [".subsection-element[_ngcontent-%COMP%]{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.subsection-item-title[_ngcontent-%COMP%] .fa-trash-alt[_ngcontent-%COMP%]{color:red;cursor:pointer}.subsection-item-title[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}.add-buttons[_ngcontent-%COMP%]{margin-top:5px}"] });
|
|
122
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArraySessionComponent, [{
|
|
123
|
-
type: Component,
|
|
124
|
-
args: [{ selector: 'array-session', template: "<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ label }}</label>\r\n <div class=\"subsection-element\" *ngFor=\"let item of model; let index = index; trackBy:trackByIndex;\">\r\n <div class=\"subsection-item-title\">{{ removeLabel }} {{ index + 1 }}\r\n <i class=\"far fa-trash-alt\" (click)=\"remove(item)\"></i>\r\n </div>\r\n <div class=\"row\" *ngIf=\"item.mappingAttributes || item.mappingAttributes === ''\">\r\n <div class=\"col-md-8\">\r\n <label class=\"info-label\">Loop</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.loop\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.loop = this.onDrop($event, item.loop)\" />\r\n </div>\r\n <div class=\"col-md-4\">\r\n <label class=\"info-label\">Alias</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.alias\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.alias = this.onDrop($event, item.alias)\" />\r\n </div>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"subsectionItem, context: {\r\n $implicit: {\r\n items: model, index: index,\r\n mappingAttributes: (item.mappingAttributes || item.mappingAttributes === '') ? item.mappingAttributes : item\r\n }\r\n }\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row add-buttons\">\r\n <div class=\"col-md-12\">\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit\" (click)=\"add()\">{{ this.addItemLabel }}</button>\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit ml-2\" *ngIf=\"showAddLoop\" (click)=\"addLoop()\">{{ this.addLoopLabel }}</button>\r\n </div>\r\n</div>\r\n", styles: [".subsection-element{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element:first-child{margin-top:0!important}.btn-personal-edit{margin:5px 0}.subsection-item-title{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.subsection-item-title .fa-trash-alt{color:red;cursor:pointer}.subsection-item-title label{font-weight:700}.add-buttons{margin-top:5px}\n"] }]
|
|
125
|
-
}], null, { label: [{
|
|
126
|
-
type: Input
|
|
127
|
-
}], removeLabel: [{
|
|
128
|
-
type: Input
|
|
129
|
-
}], addItemLabel: [{
|
|
130
|
-
type: Input
|
|
131
|
-
}], addLoopLabel: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], showAddLoop: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}], onAdd: [{
|
|
136
|
-
type: Output
|
|
137
|
-
}], onAddLoop: [{
|
|
138
|
-
type: Output
|
|
139
|
-
}], subsectionItem: [{
|
|
140
|
-
type: ContentChild,
|
|
141
|
-
args: [TemplateRef, { read: TemplateRef }]
|
|
142
|
-
}] }); })();
|
|
143
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXktc2Vzc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3NjaGVtYXMvc3JjL3NjaGVtYS1mb3JtL3NjaGVtYS1hcnJheS9hcnJheS1zZXNzaW9uL2FycmF5LXNlc3Npb24udHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zY2hlbWFzL3NyYy9zY2hlbWEtZm9ybS9zY2hlbWEtYXJyYXkvYXJyYXktc2Vzc2lvbi9hcnJheS1zZXNzaW9uLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsV0FBVyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ2pHLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFBOzs7Ozs7OztJQ005RCw4QkFBaUYsY0FBQSxnQkFBQTtJQUVuRCxvQkFBSTtJQUFBLGlCQUFRO0lBQ3RDLGlDQUM0RTtJQURwQyx3TUFBYSxxQ0FBaUIsSUFBUCxrTkFDakMsOEJBQVksbUNBQTh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