keevo-components 1.5.163 → 1.5.165

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.
@@ -4145,47 +4145,197 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
4145
4145
  }] });
4146
4146
 
4147
4147
  class BaseComponentDropdownNew extends BaseComponentDropDown {
4148
+ ngOnInit() {
4149
+ if (this.dropDowValue)
4150
+ this.value = this.dropDowValue;
4151
+ }
4148
4152
  }
4149
4153
  BaseComponentDropdownNew.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentDropdownNew, deps: null, target: i0.ɵɵFactoryTarget.Component });
4150
- BaseComponentDropdownNew.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponentDropdownNew, isStandalone: true, selector: "app-base-dropdown", inputs: { formGroup: "formGroup", formControlName: "formControlName" }, usesInheritance: true, ngImport: i0, template: `
4151
- <div [formGroup]="formGroup">
4152
- <kv-dropdown
4153
- [filteredOptions]="filteredOptions"
4154
- [options]="options"
4155
- [optionLabel]="optionLabel"
4156
- [optionValue]="optionValue"
4157
- [filter]="filter"
4158
- [label]="label"
4159
- [showClear]="showClear"
4160
- [formControlName]="formControlName"
4161
- ></kv-dropdown>
4162
- </div>
4163
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: KeevoComponentsModule }, { kind: "component", type: DropdownComponent, selector: "kv-dropdown", inputs: ["dropDowValue", "itemTemplate", "selectedItemTemplate"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }] });
4154
+ BaseComponentDropdownNew.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponentDropdownNew, isStandalone: true, selector: "app-base-dropdown", inputs: { formGroup: "formGroup", formControlName: "formControlName", dropDowValue: "dropDowValue", itemTemplate: "itemTemplate", selectedItemTemplate: "selectedItemTemplate" }, usesInheritance: true, ngImport: i0, template: `
4155
+ <span>
4156
+ <kv-label
4157
+ [componentId]="componentId"
4158
+ [label]="label"
4159
+ />
4160
+ <p-dropdown
4161
+ appendTo="body"
4162
+ [class]="baseInputClass"
4163
+ [disabled]="disabled"
4164
+ [filter]="filter"
4165
+ [inputId]="componentId"
4166
+ [(ngModel)]="value"
4167
+ [options]="filteredOptions"
4168
+ [optionLabel]="optionLabel"
4169
+ [optionValue]="optionValue"
4170
+ [optionDisabled]="optionDisabled"
4171
+ [group]="group"
4172
+ [optionGroupLabel]="optionGroupLabel"
4173
+ [optionGroupChildren]="optionGroupChildren"
4174
+ [showClear]="showClear"
4175
+ [lazy]="lazy"
4176
+ scrollHeight="250px"
4177
+ (onBlur)="onInputBlur($event)"
4178
+ (onClick)="onInputClick($event)"
4179
+ (onChange)="onInputChange($event)"
4180
+ (onFilter)="onInputFilter($event)"
4181
+ [style]="{'width':widthField}"
4182
+ [panelStyle]="{ width: widthField, overflow: 'auto' }"
4183
+ styleClass="inputs"
4184
+ >
4185
+
4186
+ <ng-template
4187
+ *ngIf="showAddButton"
4188
+ pTemplate="footer"
4189
+ >
4190
+ <p-divider></p-divider>
4191
+ <div class="flex flex-wrap card-container p-1">
4192
+ <div class="flex justify-content-center">
4193
+ <button
4194
+ pButton
4195
+ label="Incluir"
4196
+ pTooltip="Clique aqui para incluir um novo registro"
4197
+ tooltipPosition="bottom"
4198
+ icon="pi pi-plus"
4199
+ class="p-button-rounded p-button-success mr-2"
4200
+ (click)="addClick($event)"
4201
+ ></button>
4202
+ </div>
4203
+ </div>
4204
+ </ng-template>
4205
+
4206
+ <ng-template
4207
+ let-selectedItem
4208
+ pTemplate="item"
4209
+ *ngIf="itemTemplate"
4210
+ >
4211
+ <ng-container
4212
+ [ngTemplateOutlet]="itemTemplate"
4213
+ [ngTemplateOutletContext]="{ $implicit: selectedItem }"
4214
+ >
4215
+ </ng-container>
4216
+ </ng-template>
4217
+
4218
+
4219
+ <ng-template
4220
+ let-item
4221
+ pTemplate="selectedItem"
4222
+ *ngIf="selectedItemTemplate"
4223
+ >
4224
+ <ng-container
4225
+ [ngTemplateOutlet]="selectedItemTemplate"
4226
+ [ngTemplateOutletContext]="{ $implicit: item }"
4227
+ >
4228
+
4229
+ </ng-container>
4230
+ </ng-template>
4231
+
4232
+ </p-dropdown>
4233
+
4234
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
4235
+ </span>
4236
+ <ng-content></ng-content>
4237
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: KeevoComponentsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: PrimeNgModule }, { kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i9.Divider, selector: "p-divider", inputs: ["styleClass", "style", "layout", "type", "align"] }, { kind: "component", type: i4.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "overlayDirection", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: LabelModule }, { kind: "component", type: LabelComponent, selector: "kv-label", inputs: ["componentId", "label"] }, { kind: "ngmodule", type: kvErrorModule }, { kind: "component", type: ErrorComponent, selector: "kv-error", inputs: ["formControl", "hasError"] }] });
4164
4238
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentDropdownNew, decorators: [{
4165
4239
  type: Component,
4166
4240
  args: [{
4167
4241
  selector: 'app-base-dropdown',
4168
4242
  template: `
4169
- <div [formGroup]="formGroup">
4170
- <kv-dropdown
4171
- [filteredOptions]="filteredOptions"
4172
- [options]="options"
4173
- [optionLabel]="optionLabel"
4174
- [optionValue]="optionValue"
4175
- [filter]="filter"
4176
- [label]="label"
4177
- [showClear]="showClear"
4178
- [formControlName]="formControlName"
4179
- ></kv-dropdown>
4180
- </div>
4243
+ <span>
4244
+ <kv-label
4245
+ [componentId]="componentId"
4246
+ [label]="label"
4247
+ />
4248
+ <p-dropdown
4249
+ appendTo="body"
4250
+ [class]="baseInputClass"
4251
+ [disabled]="disabled"
4252
+ [filter]="filter"
4253
+ [inputId]="componentId"
4254
+ [(ngModel)]="value"
4255
+ [options]="filteredOptions"
4256
+ [optionLabel]="optionLabel"
4257
+ [optionValue]="optionValue"
4258
+ [optionDisabled]="optionDisabled"
4259
+ [group]="group"
4260
+ [optionGroupLabel]="optionGroupLabel"
4261
+ [optionGroupChildren]="optionGroupChildren"
4262
+ [showClear]="showClear"
4263
+ [lazy]="lazy"
4264
+ scrollHeight="250px"
4265
+ (onBlur)="onInputBlur($event)"
4266
+ (onClick)="onInputClick($event)"
4267
+ (onChange)="onInputChange($event)"
4268
+ (onFilter)="onInputFilter($event)"
4269
+ [style]="{'width':widthField}"
4270
+ [panelStyle]="{ width: widthField, overflow: 'auto' }"
4271
+ styleClass="inputs"
4272
+ >
4273
+
4274
+ <ng-template
4275
+ *ngIf="showAddButton"
4276
+ pTemplate="footer"
4277
+ >
4278
+ <p-divider></p-divider>
4279
+ <div class="flex flex-wrap card-container p-1">
4280
+ <div class="flex justify-content-center">
4281
+ <button
4282
+ pButton
4283
+ label="Incluir"
4284
+ pTooltip="Clique aqui para incluir um novo registro"
4285
+ tooltipPosition="bottom"
4286
+ icon="pi pi-plus"
4287
+ class="p-button-rounded p-button-success mr-2"
4288
+ (click)="addClick($event)"
4289
+ ></button>
4290
+ </div>
4291
+ </div>
4292
+ </ng-template>
4293
+
4294
+ <ng-template
4295
+ let-selectedItem
4296
+ pTemplate="item"
4297
+ *ngIf="itemTemplate"
4298
+ >
4299
+ <ng-container
4300
+ [ngTemplateOutlet]="itemTemplate"
4301
+ [ngTemplateOutletContext]="{ $implicit: selectedItem }"
4302
+ >
4303
+ </ng-container>
4304
+ </ng-template>
4305
+
4306
+
4307
+ <ng-template
4308
+ let-item
4309
+ pTemplate="selectedItem"
4310
+ *ngIf="selectedItemTemplate"
4311
+ >
4312
+ <ng-container
4313
+ [ngTemplateOutlet]="selectedItemTemplate"
4314
+ [ngTemplateOutletContext]="{ $implicit: item }"
4315
+ >
4316
+
4317
+ </ng-container>
4318
+ </ng-template>
4319
+
4320
+ </p-dropdown>
4321
+
4322
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
4323
+ </span>
4324
+ <ng-content></ng-content>
4181
4325
  `,
4182
4326
  standalone: true,
4183
- imports: [KeevoComponentsModule, ReactiveFormsModule, FormsModule]
4327
+ imports: [KeevoComponentsModule, ReactiveFormsModule, FormsModule, PrimeNgModule, LabelModule, kvErrorModule]
4184
4328
  }]
4185
4329
  }], propDecorators: { formGroup: [{
4186
4330
  type: Input
4187
4331
  }], formControlName: [{
4188
4332
  type: Input
4333
+ }], dropDowValue: [{
4334
+ type: Input
4335
+ }], itemTemplate: [{
4336
+ type: Input
4337
+ }], selectedItemTemplate: [{
4338
+ type: Input
4189
4339
  }] } });
4190
4340
 
4191
4341
  class TranslatePrimeng {
@@ -4211,6 +4361,69 @@ class TranslatePrimeng {
4211
4361
  }
4212
4362
  }
4213
4363
 
4364
+ class KeevoValidators {
4365
+ static required(erroMessage) {
4366
+ return (control) => {
4367
+ if (Validators.required(control))
4368
+ return { required: true, erroMessage: `${erroMessage ? erroMessage : 'Campo obrigatório'}` };
4369
+ return null;
4370
+ };
4371
+ }
4372
+ static dateGreaterThan(startControlName, erroMessage) {
4373
+ return (endControl) => {
4374
+ const parent = endControl.parent;
4375
+ if (!parent)
4376
+ return null;
4377
+ const startControl = parent.get(startControlName);
4378
+ const startDate = startControl.value;
4379
+ const endDate = endControl.value;
4380
+ if (!startDate || !endDate) {
4381
+ return null;
4382
+ }
4383
+ if (startDate > endDate) {
4384
+ return { greaterThan: true, erroMessage: erroMessage };
4385
+ }
4386
+ return null;
4387
+ };
4388
+ }
4389
+ static min(min, erroMessage) {
4390
+ return (control) => {
4391
+ if (Validators.min(min)(control))
4392
+ return { min: true, erroMessage: `${erroMessage ? erroMessage : 'Informe um valor maior ou igual à '}${min}` };
4393
+ return null;
4394
+ };
4395
+ }
4396
+ static max(min, erroMessage) {
4397
+ return (control) => {
4398
+ if (Validators.max(min)(control))
4399
+ return { min: true, erroMessage: `${erroMessage ? erroMessage : 'Informe um valor menor ou igual à '}${min}` };
4400
+ return null;
4401
+ };
4402
+ }
4403
+ static email(erroMessage) {
4404
+ return (control) => {
4405
+ if (Validators.email(control)) {
4406
+ return { email: true, erroMessage: `${erroMessage ? erroMessage : 'Endereço de e-mail inválido!'}` };
4407
+ }
4408
+ return null;
4409
+ };
4410
+ }
4411
+ static maxLengthArray(max) {
4412
+ return (c) => {
4413
+ if (c.value.length < max)
4414
+ return null;
4415
+ return { maxLengthArray: true, erroMessage: 'Tamanho máximo excedido!' };
4416
+ };
4417
+ }
4418
+ static maxLength(max, erroMessage) {
4419
+ return (control) => {
4420
+ if (Validators.maxLength(max)(control))
4421
+ return { maxLength: true, erroMessage: `${erroMessage ? erroMessage : 'Limite máximo de ${max} caracteres atingido!'}` };
4422
+ return null;
4423
+ };
4424
+ }
4425
+ }
4426
+
4214
4427
  class PipesModule {
4215
4428
  }
4216
4429
  PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -4319,5 +4532,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
4319
4532
  * Generated bundle index. Do not edit.
4320
4533
  */
4321
4534
 
4322
- 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 };
4535
+ 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 };
4323
4536
  //# sourceMappingURL=keevo-components.mjs.map