keevo-components 1.5.163 → 1.5.164
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/lib/api/helpers/keevo-validators.mjs +64 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/keevo-components.mjs +64 -1
- package/fesm2015/keevo-components.mjs.map +1 -1
- package/fesm2020/keevo-components.mjs +64 -1
- package/fesm2020/keevo-components.mjs.map +1 -1
- package/lib/api/helpers/keevo-validators.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -4201,6 +4201,69 @@ class TranslatePrimeng {
|
|
|
4201
4201
|
}
|
|
4202
4202
|
}
|
|
4203
4203
|
|
|
4204
|
+
class KeevoValidators {
|
|
4205
|
+
static required(erroMessage) {
|
|
4206
|
+
return (control) => {
|
|
4207
|
+
if (Validators.required(control))
|
|
4208
|
+
return { required: true, erroMessage: `${erroMessage ? erroMessage : 'Campo obrigatório'}` };
|
|
4209
|
+
return null;
|
|
4210
|
+
};
|
|
4211
|
+
}
|
|
4212
|
+
static dateGreaterThan(startControlName, erroMessage) {
|
|
4213
|
+
return (endControl) => {
|
|
4214
|
+
const parent = endControl.parent;
|
|
4215
|
+
if (!parent)
|
|
4216
|
+
return null;
|
|
4217
|
+
const startControl = parent.get(startControlName);
|
|
4218
|
+
const startDate = startControl.value;
|
|
4219
|
+
const endDate = endControl.value;
|
|
4220
|
+
if (!startDate || !endDate) {
|
|
4221
|
+
return null;
|
|
4222
|
+
}
|
|
4223
|
+
if (startDate > endDate) {
|
|
4224
|
+
return { greaterThan: true, erroMessage: erroMessage };
|
|
4225
|
+
}
|
|
4226
|
+
return null;
|
|
4227
|
+
};
|
|
4228
|
+
}
|
|
4229
|
+
static min(min, erroMessage) {
|
|
4230
|
+
return (control) => {
|
|
4231
|
+
if (Validators.min(min)(control))
|
|
4232
|
+
return { min: true, erroMessage: `${erroMessage ? erroMessage : 'Informe um valor maior ou igual à '}${min}` };
|
|
4233
|
+
return null;
|
|
4234
|
+
};
|
|
4235
|
+
}
|
|
4236
|
+
static max(min, erroMessage) {
|
|
4237
|
+
return (control) => {
|
|
4238
|
+
if (Validators.max(min)(control))
|
|
4239
|
+
return { min: true, erroMessage: `${erroMessage ? erroMessage : 'Informe um valor menor ou igual à '}${min}` };
|
|
4240
|
+
return null;
|
|
4241
|
+
};
|
|
4242
|
+
}
|
|
4243
|
+
static email(erroMessage) {
|
|
4244
|
+
return (control) => {
|
|
4245
|
+
if (Validators.email(control)) {
|
|
4246
|
+
return { email: true, erroMessage: `${erroMessage ? erroMessage : 'Endereço de e-mail inválido!'}` };
|
|
4247
|
+
}
|
|
4248
|
+
return null;
|
|
4249
|
+
};
|
|
4250
|
+
}
|
|
4251
|
+
static maxLengthArray(max) {
|
|
4252
|
+
return (c) => {
|
|
4253
|
+
if (c.value.length < max)
|
|
4254
|
+
return null;
|
|
4255
|
+
return { maxLengthArray: true, erroMessage: 'Tamanho máximo excedido!' };
|
|
4256
|
+
};
|
|
4257
|
+
}
|
|
4258
|
+
static maxLength(max, erroMessage) {
|
|
4259
|
+
return (control) => {
|
|
4260
|
+
if (Validators.maxLength(max)(control))
|
|
4261
|
+
return { maxLength: true, erroMessage: `${erroMessage ? erroMessage : 'Limite máximo de ${max} caracteres atingido!'}` };
|
|
4262
|
+
return null;
|
|
4263
|
+
};
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4204
4267
|
class PipesModule {
|
|
4205
4268
|
}
|
|
4206
4269
|
PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4309,5 +4372,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
4309
4372
|
* Generated bundle index. Do not edit.
|
|
4310
4373
|
*/
|
|
4311
4374
|
|
|
4312
|
-
export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropdownNew, BaseComponentInput, BaseComponentMultiSelect, ButtonPersonalizeComponent, ButtonPopupComponent, ButtonSecondaryComponent, ButtonSuccessComponent, ChartComponent, CheckComponent, CodigoFipePipe, ComponentProviders, ComponentService, CpfCnpjPipe, DropdownComponent, EditorComponent, ErrorComponent, FormService, InputCalendarComponent, InputMaskComponent, InputNumberComponent, InputPasswordComponent, InputTextCheckboxComponent, InputTextComponent, InputTextareaComponent, InputTimeComponent, KVTreeTableModule, KeevoComponentsModule, KvButtonsModule, KvChartModule, KvInputsModule, KvLoginModule, KvMenuModule, KvPageFormModule, KvPickListModule, KvTableModule, KvWorkspaceModule, KvtreeViewModule, LoginComponent, MenuComponent, MultiSelectComponent, NotificationService, ObjectService, OrgchartComponent, OrgchartModule, PageFormComponent, PeriodosChart, PickListComponent, PipesModule, PrimeNgModule, RadioGroupComponent, SwitchComponent, TableComponent, TablePaginate, TelefonePipe, TranslatePrimeng, TreeTableComponent, TreeViewComponent, WorkspaceComponent, kvErrorModule };
|
|
4375
|
+
export { BaseApiService, BaseChartComponent, BaseComponent, BaseComponentButton, BaseComponentCrud, BaseComponentCrudForm, BaseComponentCrudList, BaseComponentDropDown, BaseComponentDropdownNew, BaseComponentInput, BaseComponentMultiSelect, ButtonPersonalizeComponent, ButtonPopupComponent, ButtonSecondaryComponent, ButtonSuccessComponent, ChartComponent, CheckComponent, CodigoFipePipe, ComponentProviders, ComponentService, CpfCnpjPipe, DropdownComponent, EditorComponent, ErrorComponent, FormService, InputCalendarComponent, InputMaskComponent, InputNumberComponent, InputPasswordComponent, InputTextCheckboxComponent, InputTextComponent, InputTextareaComponent, InputTimeComponent, KVTreeTableModule, KeevoComponentsModule, KeevoValidators, KvButtonsModule, KvChartModule, KvInputsModule, KvLoginModule, KvMenuModule, KvPageFormModule, KvPickListModule, KvTableModule, KvWorkspaceModule, KvtreeViewModule, LoginComponent, MenuComponent, MultiSelectComponent, NotificationService, ObjectService, OrgchartComponent, OrgchartModule, PageFormComponent, PeriodosChart, PickListComponent, PipesModule, PrimeNgModule, RadioGroupComponent, SwitchComponent, TableComponent, TablePaginate, TelefonePipe, TranslatePrimeng, TreeTableComponent, TreeViewComponent, WorkspaceComponent, kvErrorModule };
|
|
4313
4376
|
//# sourceMappingURL=keevo-components.mjs.map
|