@apipass/schemas 0.2.9 → 0.2.13
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/apipass-schemas.umd.js +98 -57
- package/bundles/apipass-schemas.umd.js.map +1 -1
- package/bundles/apipass-schemas.umd.min.js +2 -2
- package/bundles/apipass-schemas.umd.min.js.map +1 -1
- package/esm2015/schema-custom-attributes/schema-custom-attributes.js +8 -8
- package/esm2015/schema-fields.service.js +17 -15
- package/esm2015/schema-form/schema-input/input-render/input-render.js +67 -33
- package/esm2015/schema-form-render.js +1 -1
- package/esm2015/schema-form-render.module.js +10 -5
- package/fesm2015/apipass-schemas.js +92 -53
- package/fesm2015/apipass-schemas.js.map +1 -1
- package/package.json +2 -1
- package/schema-custom-attributes/schema-custom-attributes.d.ts +1 -1
- package/schema-fields.service.d.ts +1 -1
- package/schema-form/schema-input/input-render/input-render.d.ts +3 -0
- package/schema-form-render.module.d.ts +2 -1
|
@@ -3,6 +3,7 @@ import { NgForOf, NgIf, NgTemplateOutlet, NgClass, CommonModule, NgComponentOutl
|
|
|
3
3
|
import { DefaultValueAccessor, NgControlStatus, NgModel, MaxLengthValidator, FormControl, Validators, FormsModule, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatusGroup, RequiredValidator, MinLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModelGroup, NgForm } from '@angular/forms';
|
|
4
4
|
import { DndDropzoneDirective, DndModule, DndDraggableDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective } from 'ngx-drag-drop';
|
|
5
5
|
import { MatTooltip, MatTooltipModule, TooltipComponent } from '@angular/material/tooltip';
|
|
6
|
+
import { IconComponent, IconsModule } from '@apipass/icons';
|
|
6
7
|
import { SelectBoxComponent, InputsModule, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent } from '@apipass/inputs';
|
|
7
8
|
import { __awaiter } from 'tslib';
|
|
8
9
|
import { Dir } from '@angular/cdk/bidi';
|
|
@@ -331,7 +332,7 @@ function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
331
332
|
ɵɵelement(5, "i", 10);
|
|
332
333
|
ɵɵelementEnd();
|
|
333
334
|
ɵɵelementStart(6, "input", 11);
|
|
334
|
-
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; return attribute_r5.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; const ctx_r10 = ɵɵnextContext(); return ctx_r10.onDropAttr($event, attribute_r5); });
|
|
335
|
+
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; return attribute_r5.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; const ctx_r10 = ɵɵnextContext(); return ctx_r10.onDropAttr($event, "value", attribute_r5); });
|
|
335
336
|
ɵɵelementEnd();
|
|
336
337
|
ɵɵelementEnd();
|
|
337
338
|
ɵɵelementEnd();
|
|
@@ -357,7 +358,7 @@ function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
357
358
|
ɵɵelementEnd();
|
|
358
359
|
ɵɵelementEnd();
|
|
359
360
|
ɵɵelementStart(7, "input", 11);
|
|
360
|
-
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.newCustomField.label = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.onDropAttr($event, ctx_r13.newCustomField
|
|
361
|
+
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.newCustomField.label = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.onDropAttr($event, "label", ctx_r13.newCustomField); });
|
|
361
362
|
ɵɵelementEnd();
|
|
362
363
|
ɵɵelementEnd();
|
|
363
364
|
ɵɵelementEnd();
|
|
@@ -370,7 +371,7 @@ function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
370
371
|
ɵɵelementEnd();
|
|
371
372
|
ɵɵelementEnd();
|
|
372
373
|
ɵɵelementStart(14, "input", 11);
|
|
373
|
-
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { ɵɵrestoreView(_r12); const ctx_r14 = ɵɵnextContext(); return ctx_r14.newCustomField.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { ɵɵrestoreView(_r12); const ctx_r15 = ɵɵnextContext(); return ctx_r15.onDropAttr($event, ctx_r15.newCustomField
|
|
374
|
+
ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { ɵɵrestoreView(_r12); const ctx_r14 = ɵɵnextContext(); return ctx_r14.newCustomField.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { ɵɵrestoreView(_r12); const ctx_r15 = ɵɵnextContext(); return ctx_r15.onDropAttr($event, "value", ctx_r15.newCustomField); });
|
|
374
375
|
ɵɵelementEnd();
|
|
375
376
|
ɵɵelementEnd();
|
|
376
377
|
ɵɵelementEnd();
|
|
@@ -446,11 +447,11 @@ class SchemaCustomAttributesComponent extends BaseSchemaComponent {
|
|
|
446
447
|
this.model.splice(attributeIndex, 1);
|
|
447
448
|
this.modelChange.emit(this.model);
|
|
448
449
|
}
|
|
449
|
-
onDropAttr($event,
|
|
450
|
-
if (!
|
|
451
|
-
|
|
450
|
+
onDropAttr($event, value, newCustomField) {
|
|
451
|
+
if (!newCustomField[value]) {
|
|
452
|
+
newCustomField[value] = '';
|
|
452
453
|
}
|
|
453
|
-
|
|
454
|
+
newCustomField[value] += `{{${$event.data}}}`;
|
|
454
455
|
}
|
|
455
456
|
}
|
|
456
457
|
SchemaCustomAttributesComponent.ɵfac = function SchemaCustomAttributesComponent_Factory(t) { return ɵSchemaCustomAttributesComponent_BaseFactory(t || SchemaCustomAttributesComponent); };
|
|
@@ -885,44 +886,57 @@ const ɵBooleanInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactor
|
|
|
885
886
|
type: Input
|
|
886
887
|
}] }); })();
|
|
887
888
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
ɵɵelementStart(
|
|
892
|
-
ɵɵlistener("
|
|
889
|
+
function InputRenderComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
890
|
+
const _r6 = ɵɵgetCurrentView();
|
|
891
|
+
ɵɵelementStart(0, "div", 5);
|
|
892
|
+
ɵɵelementStart(1, "icon", 6);
|
|
893
|
+
ɵɵlistener("onClick", function InputRenderComponent_div_1_Template_icon_onClick_1_listener() { ɵɵrestoreView(_r6); const ctx_r5 = ɵɵnextContext(); return ctx_r5.schema.readOnlyPassword ? ctx_r5.editPassword() : ctx_r5.savePassword(); });
|
|
894
|
+
ɵɵelementEnd();
|
|
893
895
|
ɵɵelementEnd();
|
|
894
896
|
} if (rf & 2) {
|
|
895
897
|
const ctx_r0 = ɵɵnextContext();
|
|
896
|
-
|
|
897
|
-
ɵɵproperty("
|
|
898
|
+
ɵɵadvance(1);
|
|
899
|
+
ɵɵproperty("name", ctx_r0.schema.readOnlyPassword ? "fas fa-pencil-alt" : "fas fa-check");
|
|
898
900
|
} }
|
|
899
|
-
function
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
901
|
+
const _c0$6 = function () { return { standalone: true }; };
|
|
902
|
+
function InputRenderComponent_input_2_Template(rf, ctx) { if (rf & 1) {
|
|
903
|
+
const _r8 = ɵɵgetCurrentView();
|
|
904
|
+
ɵɵelementStart(0, "input", 7);
|
|
905
|
+
ɵɵlistener("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.value = $event; })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r8); const ctx_r9 = ɵɵnextContext(); return ctx_r9.onChange($event); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r8); const ctx_r10 = ɵɵnextContext(); return ctx_r10.onDropCallBack($event, ctx_r10.value); });
|
|
903
906
|
ɵɵelementEnd();
|
|
904
907
|
} if (rf & 2) {
|
|
905
908
|
const ctx_r1 = ɵɵnextContext();
|
|
906
|
-
|
|
909
|
+
ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
|
|
910
|
+
ɵɵproperty("disabled", ctx_r1.schema.readOnlyPassword)("type", ctx_r1.schema.type === "password" ? "password" : "text")("ngModel", ctx_r1.value)("ngModelOptions", ɵɵpureFunction0(7, _c0$6))("id", ctx_r1.inputId)("maxlength", ctx_r1.schema.maxLength);
|
|
907
911
|
} }
|
|
908
|
-
function
|
|
912
|
+
function InputRenderComponent_select_box_3_Template(rf, ctx) { if (rf & 1) {
|
|
909
913
|
const _r12 = ɵɵgetCurrentView();
|
|
910
|
-
ɵɵelementStart(0, "
|
|
911
|
-
ɵɵlistener("
|
|
914
|
+
ɵɵelementStart(0, "select-box", 8);
|
|
915
|
+
ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.value = $event; })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.onChange($event.key); });
|
|
912
916
|
ɵɵelementEnd();
|
|
913
917
|
} if (rf & 2) {
|
|
914
918
|
const ctx_r2 = ɵɵnextContext();
|
|
915
|
-
ɵɵproperty("
|
|
919
|
+
ɵɵproperty("id", ctx_r2.inputId)("ngModel", ctx_r2.value)("ngModelOptions", ɵɵpureFunction0(12, _c0$6))("placeholder", ctx_r2.schema.description || ctx_r2.selectPlaceHolderLabel)("searchPlaceHolder", ctx_r2.selectSearchPlaceHolderLabel)("clearText", ctx_r2.selectClearLabel)("notFoundText", ctx_r2.selectNotFoundLabel)("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r2.schema.options);
|
|
916
920
|
} }
|
|
917
|
-
function
|
|
921
|
+
function InputRenderComponent_number_input_4_Template(rf, ctx) { if (rf & 1) {
|
|
918
922
|
const _r15 = ɵɵgetCurrentView();
|
|
919
|
-
ɵɵelementStart(0, "
|
|
920
|
-
ɵɵlistener("modelChange", function
|
|
923
|
+
ɵɵelementStart(0, "number-input", 9);
|
|
924
|
+
ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r15); const ctx_r14 = ɵɵnextContext(); return ctx_r14.value = $event; })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r15); const ctx_r16 = ɵɵnextContext(); return ctx_r16.onChange($event); });
|
|
921
925
|
ɵɵelementEnd();
|
|
922
926
|
} if (rf & 2) {
|
|
923
927
|
const ctx_r3 = ɵɵnextContext();
|
|
924
928
|
ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
|
|
925
929
|
} }
|
|
930
|
+
function InputRenderComponent_boolean_input_5_Template(rf, ctx) { if (rf & 1) {
|
|
931
|
+
const _r18 = ɵɵgetCurrentView();
|
|
932
|
+
ɵɵelementStart(0, "boolean-input", 9);
|
|
933
|
+
ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r18); const ctx_r17 = ɵɵnextContext(); return ctx_r17.value = $event; })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r18); const ctx_r19 = ɵɵnextContext(); return ctx_r19.onChange($event); });
|
|
934
|
+
ɵɵelementEnd();
|
|
935
|
+
} if (rf & 2) {
|
|
936
|
+
const ctx_r4 = ɵɵnextContext();
|
|
937
|
+
ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
|
|
938
|
+
} }
|
|
939
|
+
const _c1$2 = function (a0) { return { "schema-input-container-password": a0 }; };
|
|
926
940
|
class InputRenderComponent extends BaseSchemaComponent {
|
|
927
941
|
constructor() {
|
|
928
942
|
super(...arguments);
|
|
@@ -935,7 +949,7 @@ class InputRenderComponent extends BaseSchemaComponent {
|
|
|
935
949
|
this.onDropEvent = new EventEmitter();
|
|
936
950
|
}
|
|
937
951
|
ngAfterContentInit() {
|
|
938
|
-
var _a, _b;
|
|
952
|
+
var _a, _b, _c;
|
|
939
953
|
if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) !== 'object' && ((_b = this.schema) === null || _b === void 0 ? void 0 : _b.type) !== 'array') {
|
|
940
954
|
if (!this.editing && this.schema.options) {
|
|
941
955
|
const $event = this.schema.options.filter((item) => item.selected === true);
|
|
@@ -955,25 +969,45 @@ class InputRenderComponent extends BaseSchemaComponent {
|
|
|
955
969
|
this.value = this.model;
|
|
956
970
|
}
|
|
957
971
|
}
|
|
972
|
+
if (this.editing && ((_c = this.schema) === null || _c === void 0 ? void 0 : _c.type) === 'password') {
|
|
973
|
+
this.schema.readOnlyPassword = true;
|
|
974
|
+
}
|
|
958
975
|
}
|
|
959
976
|
onDropCallBack($event, value) {
|
|
960
977
|
this.value = value = super.onDrop($event, value);
|
|
961
978
|
this.onChange(value);
|
|
962
979
|
}
|
|
963
980
|
onChange($event) {
|
|
964
|
-
this.
|
|
981
|
+
if (this.schema.type !== 'password' || !this.editing) {
|
|
982
|
+
this.model = $event;
|
|
983
|
+
this.modelChange.emit(this.model);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
savePassword() {
|
|
987
|
+
this.model = this.value || '';
|
|
965
988
|
this.modelChange.emit(this.model);
|
|
989
|
+
this.setReadOnlyPassword(true);
|
|
990
|
+
}
|
|
991
|
+
editPassword() {
|
|
992
|
+
this.setReadOnlyPassword(false);
|
|
993
|
+
}
|
|
994
|
+
setReadOnlyPassword(value) {
|
|
995
|
+
this.schema.readOnlyPassword = value;
|
|
966
996
|
}
|
|
967
997
|
}
|
|
968
998
|
InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
|
|
969
|
-
InputRenderComponent.ɵcmp = ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls:
|
|
999
|
+
InputRenderComponent.ɵcmp = ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls: 6, vars: 8, consts: [[1, "schema-input-container", 3, "ngClass"], ["class", "edit-icon", 4, "ngIf"], ["class", "form-control", "dndDropzone", "", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange", "dndDrop", 4, "ngIf"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange", 4, "ngIf"], [3, "model", "inputId", "placeholder", "maxLength", "modelChange", 4, "ngIf"], [1, "edit-icon"], ["size", "15", "type", "primary", 3, "name", "onClick"], ["dndDropzone", "", 1, "form-control", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange", "dndDrop"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange"], [3, "model", "inputId", "placeholder", "maxLength", "modelChange"]], template: function InputRenderComponent_Template(rf, ctx) { if (rf & 1) {
|
|
970
1000
|
ɵɵelementStart(0, "div", 0);
|
|
971
|
-
ɵɵtemplate(1,
|
|
972
|
-
ɵɵtemplate(2,
|
|
973
|
-
ɵɵtemplate(3,
|
|
974
|
-
ɵɵtemplate(4,
|
|
1001
|
+
ɵɵtemplate(1, InputRenderComponent_div_1_Template, 2, 1, "div", 1);
|
|
1002
|
+
ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
|
|
1003
|
+
ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
|
|
1004
|
+
ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
|
|
1005
|
+
ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
|
|
975
1006
|
ɵɵelementEnd();
|
|
976
1007
|
} if (rf & 2) {
|
|
1008
|
+
ɵɵproperty("ngClass", ɵɵpureFunction1(6, _c1$2, ctx.schema.type === "password"));
|
|
1009
|
+
ɵɵadvance(1);
|
|
1010
|
+
ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
|
|
977
1011
|
ɵɵadvance(1);
|
|
978
1012
|
ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
|
|
979
1013
|
ɵɵadvance(1);
|
|
@@ -982,7 +1016,7 @@ InputRenderComponent.ɵcmp = ɵɵdefineComponent({ type: InputRenderComponent, s
|
|
|
982
1016
|
ɵɵproperty("ngIf", ctx.schema.type === "number");
|
|
983
1017
|
ɵɵadvance(1);
|
|
984
1018
|
ɵɵproperty("ngIf", ctx.schema.type === "boolean");
|
|
985
|
-
} }, directives: [NgIf, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator, SelectBoxComponent, NumberInputComponent, BooleanInputComponent], styles: [""] });
|
|
1019
|
+
} }, directives: [NgClass, NgIf, IconComponent, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator, SelectBoxComponent, NumberInputComponent, BooleanInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;right:-5px;top:10px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:40px!important;width:calc(100% - 30px)!important}"] });
|
|
986
1020
|
const ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(InputRenderComponent);
|
|
987
1021
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(InputRenderComponent, [{
|
|
988
1022
|
type: Component,
|
|
@@ -1260,7 +1294,7 @@ class SchemaValidationField {
|
|
|
1260
1294
|
class SchemaFieldsService {
|
|
1261
1295
|
constructor() {
|
|
1262
1296
|
}
|
|
1263
|
-
validateSchemaFields(propertiesRendered, model) {
|
|
1297
|
+
validateSchemaFields(propertiesRendered, model, editing) {
|
|
1264
1298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1265
1299
|
if (!propertiesRendered) {
|
|
1266
1300
|
return new SchemaValidationField([], [], []);
|
|
@@ -1268,33 +1302,35 @@ class SchemaFieldsService {
|
|
|
1268
1302
|
const emptyFields = [];
|
|
1269
1303
|
const invalidMinLengthFields = [];
|
|
1270
1304
|
const invalidMaxLengthFields = [];
|
|
1271
|
-
this.processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
|
|
1305
|
+
this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
|
|
1272
1306
|
const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
|
|
1273
1307
|
structValidationField.validationErrorsLabel = yield this.getErrorsStringArray(structValidationField);
|
|
1274
1308
|
return structValidationField;
|
|
1275
1309
|
});
|
|
1276
1310
|
}
|
|
1277
|
-
processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
|
|
1311
|
+
processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
|
|
1278
1312
|
for (const property of propertiesRendered) {
|
|
1279
1313
|
if ((property.type === 'object' || property.type === 'array') && property.properties) {
|
|
1280
|
-
this.processProperties(property.properties, model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
1314
|
+
this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
1281
1315
|
}
|
|
1282
1316
|
else if (property.type === 'array' && !property.properties) {
|
|
1283
1317
|
const newProperty = Object.assign({}, property);
|
|
1284
1318
|
newProperty.type = 'string';
|
|
1285
|
-
this.processProperties([newProperty], model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
1319
|
+
this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
|
|
1286
1320
|
}
|
|
1287
1321
|
else {
|
|
1288
1322
|
const validateModel = recursive ? model : model[property.id];
|
|
1289
|
-
if (
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1323
|
+
if (property.type !== 'password' || !editing || validateModel !== undefined) {
|
|
1324
|
+
if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
|
|
1325
|
+
&& (validateModel === undefined || validateModel === '' || validateModel === null)) {
|
|
1326
|
+
emptyFields.push(property);
|
|
1327
|
+
}
|
|
1328
|
+
else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) < property.minLength)) {
|
|
1329
|
+
invalidMinLengthFields.push(property);
|
|
1330
|
+
}
|
|
1331
|
+
else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.maxLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) > property.maxLength)) {
|
|
1332
|
+
invalidMaxLengthFields.push(property);
|
|
1333
|
+
}
|
|
1298
1334
|
}
|
|
1299
1335
|
}
|
|
1300
1336
|
}
|
|
@@ -1418,7 +1454,7 @@ SchemaFormRenderComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaFormRenderCo
|
|
|
1418
1454
|
ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
|
|
1419
1455
|
} if (rf & 2) {
|
|
1420
1456
|
ɵɵproperty("ngIf", ctx.loaded);
|
|
1421
|
-
} }, directives: [NgIf, SchemaFormComponent, NgForOf, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{background:#fff;border:1px solid #ddd;border-radius:3px;padding:11px;width:100%}.schema[_ngcontent-%COMP%] select.form-control{border:1px solid #ddd;border-radius:4px;color:#777;cursor:pointer;padding:11px;width:100%}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{background:var(--color-primary);border:1px solid var(--color-secondary);border-radius:4px;color:var(--color-secondary);cursor:pointer;padding:5px 15px}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title, .schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
|
|
1457
|
+
} }, directives: [NgIf, SchemaFormComponent, NgForOf, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{background:#fff;border:1px solid #ddd;border-radius:3px;padding:11px;width:100%}.schema[_ngcontent-%COMP%] input.form-control:disabled{background:#ccc}.schema[_ngcontent-%COMP%] select.form-control{border:1px solid #ddd;border-radius:4px;color:#777;cursor:pointer;padding:11px;width:100%}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{background:var(--color-primary);border:1px solid var(--color-secondary);border-radius:4px;color:var(--color-secondary);cursor:pointer;padding:5px 15px}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title, .schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
|
|
1422
1458
|
const ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormRenderComponent);
|
|
1423
1459
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderComponent, [{
|
|
1424
1460
|
type: Component,
|
|
@@ -1587,7 +1623,8 @@ SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaForm
|
|
|
1587
1623
|
DndModule,
|
|
1588
1624
|
FormsModule,
|
|
1589
1625
|
MatTooltipModule,
|
|
1590
|
-
InputsModule
|
|
1626
|
+
InputsModule,
|
|
1627
|
+
IconsModule
|
|
1591
1628
|
]] });
|
|
1592
1629
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
|
|
1593
1630
|
SchemaArrayComponent,
|
|
@@ -1603,7 +1640,8 @@ SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaForm
|
|
|
1603
1640
|
DndModule,
|
|
1604
1641
|
FormsModule,
|
|
1605
1642
|
MatTooltipModule,
|
|
1606
|
-
InputsModule
|
|
1643
|
+
InputsModule,
|
|
1644
|
+
IconsModule], exports: [ArraySessionComponent,
|
|
1607
1645
|
SchemaArrayComponent,
|
|
1608
1646
|
FieldRenderComponent,
|
|
1609
1647
|
InputRenderComponent,
|
|
@@ -1622,7 +1660,8 @@ SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaForm
|
|
|
1622
1660
|
DndModule,
|
|
1623
1661
|
FormsModule,
|
|
1624
1662
|
MatTooltipModule,
|
|
1625
|
-
InputsModule
|
|
1663
|
+
InputsModule,
|
|
1664
|
+
IconsModule
|
|
1626
1665
|
],
|
|
1627
1666
|
declarations: [
|
|
1628
1667
|
ArraySessionComponent,
|
|
@@ -1656,7 +1695,7 @@ SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaForm
|
|
|
1656
1695
|
]
|
|
1657
1696
|
}]
|
|
1658
1697
|
}], null, null); })();
|
|
1659
|
-
ɵɵsetComponentScope(SchemaFormComponent, [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, DndDraggableDirective, DndDropzoneDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModel, NgModelGroup, NgForm, MatTooltip, TooltipComponent, Dir, CdkScrollable, SelectBoxComponent, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent, ArraySessionComponent,
|
|
1698
|
+
ɵɵsetComponentScope(SchemaFormComponent, [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, DndDraggableDirective, DndDropzoneDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModel, NgModelGroup, NgForm, MatTooltip, TooltipComponent, Dir, CdkScrollable, SelectBoxComponent, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent, IconComponent, ArraySessionComponent,
|
|
1660
1699
|
SchemaArrayComponent,
|
|
1661
1700
|
FieldRenderComponent,
|
|
1662
1701
|
InputRenderComponent,
|