@apipass/schemas 1.0.0 → 1.0.7
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/esm2020/base-schema.component.mjs +1 -2
- package/esm2020/public-api.mjs +1 -1
- package/esm2020/schema-custom-attributes/schema-custom-attributes.mjs +1 -1
- package/esm2020/schema-fields.service.mjs +4 -6
- package/esm2020/schema-form/schema-array/array-session/array-session.mjs +1 -1
- package/esm2020/schema-form/schema-array/schema-array.mjs +1 -1
- package/esm2020/schema-form/schema-form.mjs +1 -1
- package/esm2020/schema-form/schema-input/field-render/field-render.mjs +1 -1
- package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +1 -1
- package/esm2020/schema-form/schema-input/input-render/input-render.mjs +3 -3
- package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +1 -1
- package/esm2020/schema-form/schema-input/schema-input.mjs +1 -1
- package/esm2020/schema-form/schema-object/schema-object.mjs +1 -1
- package/esm2020/schema-form-render.mjs +3 -3
- package/esm2020/schema-form-render.module.mjs +1 -1
- package/esm2020/schema-validation-field.mjs +1 -1
- package/esm2020/struct.utils.mjs +1 -1
- package/esm2020/type-script-compile/type-script-compile.base.mjs +5 -3
- package/fesm2015/apipass-schemas.mjs +11 -13
- package/fesm2015/apipass-schemas.mjs.map +1 -1
- package/fesm2020/apipass-schemas.mjs +11 -13
- package/fesm2020/apipass-schemas.mjs.map +1 -1
- package/package.json +3 -3
- package/schema-fields.service.d.ts +3 -4
- package/type-script-compile/type-script-compile.base.d.ts +1 -1
- package/assets/css/buttons.scss +0 -118
- package/assets/css/colors.scss +0 -34
- package/assets/css/fonts.scss +0 -24
- package/assets/css/inputs.scss +0 -197
- package/assets/css/pt_sans.scss +0 -144
- package/assets/css/spacing.scss +0 -28
- package/assets/css/texts.scss +0 -18
|
@@ -21,7 +21,6 @@ class BaseSchemaComponent {
|
|
|
21
21
|
return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
|
|
22
22
|
}
|
|
23
23
|
canRender(property) {
|
|
24
|
-
// tslint:disable-next-line:no-eval
|
|
25
24
|
property.canRender = property?.conditionExpression ? eval(property.conditionExpression) : true;
|
|
26
25
|
return property.canRender;
|
|
27
26
|
}
|
|
@@ -973,10 +972,10 @@ InputRenderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InputR
|
|
|
973
972
|
i0.ɵɵproperty("ngIf", ctx.schema.type === "number");
|
|
974
973
|
i0.ɵɵadvance(1);
|
|
975
974
|
i0.ɵɵproperty("ngIf", ctx.schema.type === "boolean");
|
|
976
|
-
} }, dependencies: [i1.NgClass, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel, i4.SelectBoxComponent, i5.IconComponent, BooleanInputComponent, NumberInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:
|
|
975
|
+
} }, dependencies: [i1.NgClass, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel, i4.SelectBoxComponent, i5.IconComponent, BooleanInputComponent, NumberInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}"] });
|
|
977
976
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputRenderComponent, [{
|
|
978
977
|
type: Component,
|
|
979
|
-
args: [{ selector: 'input-render', template: "<div class=\"schema-input-container\" [ngClass]=\"{'schema-input-container-password' : schema.type === 'password' }\" >\r\n <div *ngIf=\"schema.type === 'password' && editing\" class=\"edit-icon\">\r\n <icon *ngIf=\"this.schema.readOnlyPassword\" size=\"15\" type=\"primary\" [name]=\"'fas fa-pencil-alt'\"\r\n (onClick)=\"editPassword()\">\r\n </icon>\r\n <icon *ngIf=\"!this.schema.readOnlyPassword\" size=\"15\" type=\"primary clickable\" [name]=\"'fas fa-ban'\"\r\n (mousedown)=\"cancelEditPassword(); $event.stopPropagation()\">\r\n </icon>\r\n </div>\r\n <input (blur)=\"onInputBlur()\"\r\n [disabled]=\"schema.readOnlyPassword\" class=\"form-control\"\r\n [type]=\"schema.type === 'password' ? 'password' : 'text'\"\r\n placeholder=\"{{schema.type === 'password' && this.schema.readOnlyPassword ? '*****' : schema.description}}\"\r\n *ngIf=\"(schema.type === 'string' || schema.type === 'password') && !schema.options\"\r\n [(ngModel)]=\"value\" [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"onChange($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\" [id]=\"inputId\" [maxlength]=\"schema.maxLength\"/>\r\n\r\n <select-box\r\n [id]=\"inputId\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event.key)\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n *ngIf=\"schema.type === 'string' && schema.options\"\r\n [placeholder]=\"schema.description || this.selectPlaceHolderLabel\"\r\n [searchPlaceHolder]=\"selectSearchPlaceHolderLabel\"\r\n [clearText]=\"this.selectClearLabel\"\r\n [notFoundText]=\"this.selectNotFoundLabel\"\r\n [bindKey]=\"'key'\"\r\n [bindValue]=\"'value'\"\r\n [enabledSearch]=\"true\"\r\n [limitItens]=\"30\"\r\n [data]=\"schema.options\">\r\n </select-box>\r\n\r\n <number-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'number'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></number-input>\r\n\r\n <boolean-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'boolean'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></boolean-input>\r\n</div>\r\n", styles: [".schema-input-container-password{position:relative}.schema-input-container-password .edit-icon{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password input{display:block;padding-right:
|
|
978
|
+
args: [{ selector: 'input-render', template: "<div class=\"schema-input-container\" [ngClass]=\"{'schema-input-container-password' : schema.type === 'password' }\" >\r\n <div *ngIf=\"schema.type === 'password' && editing\" class=\"edit-icon\">\r\n <icon *ngIf=\"this.schema.readOnlyPassword\" size=\"15\" type=\"primary\" [name]=\"'fas fa-pencil-alt'\"\r\n (onClick)=\"editPassword()\">\r\n </icon>\r\n <icon *ngIf=\"!this.schema.readOnlyPassword\" size=\"15\" type=\"primary clickable\" [name]=\"'fas fa-ban'\"\r\n (mousedown)=\"cancelEditPassword(); $event.stopPropagation()\">\r\n </icon>\r\n </div>\r\n <input (blur)=\"onInputBlur()\"\r\n [disabled]=\"schema.readOnlyPassword\" class=\"form-control\"\r\n [type]=\"schema.type === 'password' ? 'password' : 'text'\"\r\n placeholder=\"{{schema.type === 'password' && this.schema.readOnlyPassword ? '*****' : schema.description}}\"\r\n *ngIf=\"(schema.type === 'string' || schema.type === 'password') && !schema.options\"\r\n [(ngModel)]=\"value\" [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"onChange($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\" [id]=\"inputId\" [maxlength]=\"schema.maxLength\"/>\r\n\r\n <select-box\r\n [id]=\"inputId\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event.key)\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n *ngIf=\"schema.type === 'string' && schema.options\"\r\n [placeholder]=\"schema.description || this.selectPlaceHolderLabel\"\r\n [searchPlaceHolder]=\"selectSearchPlaceHolderLabel\"\r\n [clearText]=\"this.selectClearLabel\"\r\n [notFoundText]=\"this.selectNotFoundLabel\"\r\n [bindKey]=\"'key'\"\r\n [bindValue]=\"'value'\"\r\n [enabledSearch]=\"true\"\r\n [limitItens]=\"30\"\r\n [data]=\"schema.options\">\r\n </select-box>\r\n\r\n <number-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'number'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></number-input>\r\n\r\n <boolean-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'boolean'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></boolean-input>\r\n</div>\r\n", styles: [".schema-input-container-password{position:relative}.schema-input-container-password .edit-icon{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password input{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}\n"] }]
|
|
980
979
|
}], null, { selectPlaceHolderLabel: [{
|
|
981
980
|
type: Input
|
|
982
981
|
}], selectSearchPlaceHolderLabel: [{
|
|
@@ -1217,8 +1216,6 @@ class SchemaValidationField {
|
|
|
1217
1216
|
}
|
|
1218
1217
|
|
|
1219
1218
|
class SchemaFieldsService {
|
|
1220
|
-
constructor() {
|
|
1221
|
-
}
|
|
1222
1219
|
async validateSchemaFields(propertiesRendered, model, editing) {
|
|
1223
1220
|
if (!propertiesRendered) {
|
|
1224
1221
|
return new SchemaValidationField([], [], []);
|
|
@@ -1244,8 +1241,8 @@ class SchemaFieldsService {
|
|
|
1244
1241
|
else {
|
|
1245
1242
|
const validateModel = recursive ? model : model[property.id];
|
|
1246
1243
|
if (property.type !== 'password' || !editing || validateModel !== undefined) {
|
|
1247
|
-
if (property?.canRender && property?.minLength > 0
|
|
1248
|
-
|
|
1244
|
+
if (property?.canRender && property?.minLength > 0 &&
|
|
1245
|
+
(validateModel === undefined || validateModel === '' || validateModel === null)) {
|
|
1249
1246
|
emptyFields.push(property);
|
|
1250
1247
|
}
|
|
1251
1248
|
else if (property?.canRender && property?.minLength > 0 && (validateModel?.length < property.minLength)) {
|
|
@@ -1293,7 +1290,7 @@ SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new
|
|
|
1293
1290
|
SchemaFieldsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
|
|
1294
1291
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFieldsService, [{
|
|
1295
1292
|
type: Injectable
|
|
1296
|
-
}],
|
|
1293
|
+
}], null, null); })();
|
|
1297
1294
|
|
|
1298
1295
|
function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
1299
1296
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
@@ -1370,10 +1367,10 @@ SchemaFormRenderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: S
|
|
|
1370
1367
|
i0.ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
|
|
1371
1368
|
} if (rf & 2) {
|
|
1372
1369
|
i0.ɵɵproperty("ngIf", ctx.loaded);
|
|
1373
|
-
} }, dependencies: [i1.NgForOf, i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{width:100
|
|
1370
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema[_ngcontent-%COMP%] input.form-control:disabled{background:#ccc}.schema[_ngcontent-%COMP%] select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title{color:var(--color-primary)}.schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
|
|
1374
1371
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormRenderComponent, [{
|
|
1375
1372
|
type: Component,
|
|
1376
|
-
args: [{ selector: 'schema-form-render', template: "<div class=\"schema\" *ngIf=\"loaded\">\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schemas]=\"schemas\"\r\n [editing]=\"this.editing\"></schema-form>\r\n\r\n <div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model && customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"model.customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema ::ng-deep .info-label{display:block}.schema ::ng-deep input.form-control{width:100
|
|
1373
|
+
args: [{ selector: 'schema-form-render', template: "<div class=\"schema\" *ngIf=\"loaded\">\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schemas]=\"schemas\"\r\n [editing]=\"this.editing\"></schema-form>\r\n\r\n <div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model && customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"model.customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema ::ng-deep .info-label{display:block}.schema ::ng-deep input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema ::ng-deep input.form-control:disabled{background:#ccc}.schema ::ng-deep select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema ::ng-deep .ng-select-container{height:38px!important;min-height:38px!important}.schema ::ng-deep .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema ::ng-deep .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema ::ng-deep .subsection-item-title{color:var(--color-primary)}.schema ::ng-deep array-session .subsection-element{color:var(--color-primary)}\n"] }]
|
|
1377
1374
|
}], null, { requiredLabel: [{
|
|
1378
1375
|
type: Input
|
|
1379
1376
|
}], addItemLabel: [{
|
|
@@ -1478,7 +1475,9 @@ class TypeScriptCompileBase {
|
|
|
1478
1475
|
input.description = this.getTranslate(input.description);
|
|
1479
1476
|
}
|
|
1480
1477
|
if (input?.options instanceof Array) {
|
|
1481
|
-
input?.options.forEach((option) =>
|
|
1478
|
+
input?.options.forEach((option) => {
|
|
1479
|
+
option.value = this.getTranslate(option.value);
|
|
1480
|
+
});
|
|
1482
1481
|
}
|
|
1483
1482
|
}
|
|
1484
1483
|
proccessProperties(item, formProperties, key) {
|
|
@@ -1520,7 +1519,7 @@ function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
|
|
|
1520
1519
|
const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
|
|
1521
1520
|
provide: TypeScriptCompileBase,
|
|
1522
1521
|
deps: [[new Optional(), new SkipSelf(), TypeScriptCompileBase]],
|
|
1523
|
-
useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY
|
|
1522
|
+
useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY
|
|
1524
1523
|
};
|
|
1525
1524
|
|
|
1526
1525
|
class SchemaFormRenderModule {
|
|
@@ -1615,4 +1614,3 @@ i0.ɵɵsetComponentScope(SchemaFormComponent, [i1.NgForOf, SchemaArrayComponent,
|
|
|
1615
1614
|
|
|
1616
1615
|
export { APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY, APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER, ArraySessionComponent, BaseSchemaComponent, BooleanInputComponent, FieldRenderComponent, InputRenderComponent, NumberInputComponent, SchemaArrayComponent, SchemaCustomAttributesComponent, SchemaFieldsService, SchemaFormComponent, SchemaFormRenderComponent, SchemaFormRenderModule, SchemaInputComponent, SchemaObjectComponent, SchemaValidationField, TypeScriptCompileBase };
|
|
1617
1616
|
//# sourceMappingURL=apipass-schemas.mjs.map
|
|
1618
|
-
//# sourceMappingURL=apipass-schemas.mjs.map
|