keevo-components 2.0.34 → 2.0.36
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/fesm2022/keevo-components.mjs +30 -7
- package/fesm2022/keevo-components.mjs.map +1 -1
- package/lib/api/base-components/base-component-crud-form.d.ts +2 -2
- package/lib/api/helpers/keevo-validators.d.ts +1 -0
- package/lib/api/modules/primeng.module.d.ts +2 -1
- package/lib/components/kv-table/kv-table.component.d.ts +1 -1
- package/lib/components/kv-table-expandable/kv-table-expandable.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -114,6 +114,7 @@ import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
|
|
114
114
|
import * as i7$3 from 'primeng/treeselect';
|
|
115
115
|
import { TreeSelectModule } from 'primeng/treeselect';
|
|
116
116
|
import { TimelineModule } from 'primeng/timeline';
|
|
117
|
+
import { SplitterModule } from 'primeng/splitter';
|
|
117
118
|
import { SliderModule } from 'primeng/slider';
|
|
118
119
|
import * as i1$5 from 'ngx-loading';
|
|
119
120
|
import { NgxLoadingModule } from 'ngx-loading';
|
|
@@ -876,21 +877,27 @@ class BaseComponentCrudForm extends BaseComponentCrud {
|
|
|
876
877
|
* Método responsável pelo carregamento da tela
|
|
877
878
|
* @param obs - Observable responsável pelo salvamento dos dados
|
|
878
879
|
*/
|
|
879
|
-
loadData(obs) {
|
|
880
|
+
loadData(obs, setFormValuesCallback) {
|
|
880
881
|
obs.pipe(loading()).subscribe((data) => {
|
|
881
882
|
this.isNewRegistry = false;
|
|
882
883
|
this.registry = data;
|
|
883
|
-
|
|
884
|
+
if (!setFormValuesCallback)
|
|
885
|
+
this.setFormValues(this.registry);
|
|
886
|
+
else
|
|
887
|
+
setFormValuesCallback(this.registry);
|
|
884
888
|
this.loadGrids();
|
|
885
889
|
this.setTitlePopup();
|
|
886
890
|
});
|
|
887
891
|
}
|
|
888
|
-
async loadDataAsync(obs) {
|
|
892
|
+
async loadDataAsync(obs, setFormValuesCallback) {
|
|
889
893
|
await obs.pipe(loading()).toPromise();
|
|
890
894
|
const data = await obs.toPromise();
|
|
891
895
|
this.isNewRegistry = false;
|
|
892
896
|
this.registry = data;
|
|
893
|
-
|
|
897
|
+
if (!setFormValuesCallback)
|
|
898
|
+
this.setFormValues(this.registry);
|
|
899
|
+
else
|
|
900
|
+
setFormValuesCallback(this.registry);
|
|
894
901
|
this.loadGrids();
|
|
895
902
|
this.setTitlePopup();
|
|
896
903
|
}
|
|
@@ -3619,6 +3626,19 @@ class KeevoValidators {
|
|
|
3619
3626
|
return null;
|
|
3620
3627
|
};
|
|
3621
3628
|
}
|
|
3629
|
+
static fieldGreaterThan(fieldToValidate, fieldToCompare, erroMessage) {
|
|
3630
|
+
return (form) => {
|
|
3631
|
+
const group = form;
|
|
3632
|
+
const fieldToValidateValue = group.get(fieldToValidate)?.value ?? 0;
|
|
3633
|
+
const fieldToCompareValue = group.get(fieldToCompare)?.value ?? 0;
|
|
3634
|
+
const fieldToValidateControl = group.get(fieldToValidate);
|
|
3635
|
+
if (fieldToValidateValue > fieldToCompareValue) {
|
|
3636
|
+
fieldToValidateControl?.setErrors({ erroMessage });
|
|
3637
|
+
return { fieldGreaterThan: true };
|
|
3638
|
+
}
|
|
3639
|
+
return null;
|
|
3640
|
+
};
|
|
3641
|
+
}
|
|
3622
3642
|
static checkMinWords(value, minWords) {
|
|
3623
3643
|
const words = value.match(/\S+/g);
|
|
3624
3644
|
return !words || words.length < minWords;
|
|
@@ -4120,7 +4140,8 @@ class PrimeNgModule {
|
|
|
4120
4140
|
InputGroupModule,
|
|
4121
4141
|
InputGroupAddonModule,
|
|
4122
4142
|
TreeSelectModule,
|
|
4123
|
-
TimelineModule
|
|
4143
|
+
TimelineModule,
|
|
4144
|
+
SplitterModule] }); }
|
|
4124
4145
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: PrimeNgModule, providers: [
|
|
4125
4146
|
ConfirmationService,
|
|
4126
4147
|
DialogService,
|
|
@@ -4189,7 +4210,8 @@ class PrimeNgModule {
|
|
|
4189
4210
|
InputGroupModule,
|
|
4190
4211
|
InputGroupAddonModule,
|
|
4191
4212
|
TreeSelectModule,
|
|
4192
|
-
TimelineModule
|
|
4213
|
+
TimelineModule,
|
|
4214
|
+
SplitterModule] }); }
|
|
4193
4215
|
}
|
|
4194
4216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: PrimeNgModule, decorators: [{
|
|
4195
4217
|
type: NgModule,
|
|
@@ -4257,7 +4279,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
4257
4279
|
InputGroupModule,
|
|
4258
4280
|
InputGroupAddonModule,
|
|
4259
4281
|
TreeSelectModule,
|
|
4260
|
-
TimelineModule
|
|
4282
|
+
TimelineModule,
|
|
4283
|
+
SplitterModule
|
|
4261
4284
|
],
|
|
4262
4285
|
providers: [
|
|
4263
4286
|
ConfirmationService,
|