keevo-components 0.0.1

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.
Files changed (98) hide show
  1. package/README.md +24 -0
  2. package/esm2020/keevo-components.mjs +5 -0
  3. package/esm2020/lib/api/base-components/base-component-button.mjs +33 -0
  4. package/esm2020/lib/api/base-components/base-component-dropdown.mjs +115 -0
  5. package/esm2020/lib/api/base-components/base-component-input.mjs +77 -0
  6. package/esm2020/lib/api/base-components/base-component.mjs +49 -0
  7. package/esm2020/lib/api/components/error/error.component.mjs +26 -0
  8. package/esm2020/lib/api/components/error/kverror.module.mjs +35 -0
  9. package/esm2020/lib/api/helpers/component-providers.mjs +16 -0
  10. package/esm2020/lib/api/helpers/translate-primeng.mjs +23 -0
  11. package/esm2020/lib/api/index.mjs +2 -0
  12. package/esm2020/lib/api/modules/primeng.module.mjs +187 -0
  13. package/esm2020/lib/api/public-api.mjs +12 -0
  14. package/esm2020/lib/api/services/component.service.mjs +27 -0
  15. package/esm2020/lib/api/services/object.service.mjs +26 -0
  16. package/esm2020/lib/buttons/button-secondary/button-secondary.component.mjs +17 -0
  17. package/esm2020/lib/buttons/button-success/button-success.component.mjs +17 -0
  18. package/esm2020/lib/buttons/kvbutton.module.mjs +29 -0
  19. package/esm2020/lib/inputs/check/check.component.mjs +25 -0
  20. package/esm2020/lib/inputs/dropdown/dropdown.component.mjs +25 -0
  21. package/esm2020/lib/inputs/input-calendar/input-calendar.component.mjs +61 -0
  22. package/esm2020/lib/inputs/input-mask/input-mask.component.mjs +21 -0
  23. package/esm2020/lib/inputs/input-number/input-number.component.mjs +55 -0
  24. package/esm2020/lib/inputs/input-password/input-password.component.mjs +31 -0
  25. package/esm2020/lib/inputs/input-text/input-text.component.mjs +19 -0
  26. package/esm2020/lib/inputs/input-textarea/input-textarea.component.mjs +41 -0
  27. package/esm2020/lib/inputs/input-time/input-time.component.mjs +22 -0
  28. package/esm2020/lib/inputs/kvinputs.module.mjs +88 -0
  29. package/esm2020/lib/inputs/multi-select/multi-select.component.mjs +49 -0
  30. package/esm2020/lib/inputs/switch/switch.component.mjs +25 -0
  31. package/esm2020/lib/keevo-components.module.mjs +27 -0
  32. package/esm2020/public-api.mjs +25 -0
  33. package/esm2020/src/lib/api/base-components/base-component-button.mjs +33 -0
  34. package/esm2020/src/lib/api/base-components/base-component-dropdown.mjs +115 -0
  35. package/esm2020/src/lib/api/base-components/base-component-input.mjs +77 -0
  36. package/esm2020/src/lib/api/base-components/base-component.mjs +49 -0
  37. package/esm2020/src/lib/api/components/error/error.component.mjs +26 -0
  38. package/esm2020/src/lib/api/components/error/kverror.module.mjs +35 -0
  39. package/esm2020/src/lib/api/helpers/component-providers.mjs +16 -0
  40. package/esm2020/src/lib/api/helpers/translate-primeng.mjs +23 -0
  41. package/esm2020/src/lib/api/keevo-components-src-lib-api.mjs +5 -0
  42. package/esm2020/src/lib/api/modules/primeng.module.mjs +187 -0
  43. package/esm2020/src/lib/api/public-api.mjs +12 -0
  44. package/esm2020/src/lib/api/services/component.service.mjs +27 -0
  45. package/esm2020/src/lib/api/services/object.service.mjs +26 -0
  46. package/fesm2015/keevo-components-src-lib-api.mjs +594 -0
  47. package/fesm2015/keevo-components-src-lib-api.mjs.map +1 -0
  48. package/fesm2015/keevo-components.mjs +1050 -0
  49. package/fesm2015/keevo-components.mjs.map +1 -0
  50. package/fesm2020/keevo-components-src-lib-api.mjs +591 -0
  51. package/fesm2020/keevo-components-src-lib-api.mjs.map +1 -0
  52. package/fesm2020/keevo-components.mjs +1046 -0
  53. package/fesm2020/keevo-components.mjs.map +1 -0
  54. package/index.d.ts +5 -0
  55. package/lib/api/base-components/base-component-button.d.ts +13 -0
  56. package/lib/api/base-components/base-component-dropdown.d.ts +31 -0
  57. package/lib/api/base-components/base-component-input.d.ts +26 -0
  58. package/lib/api/base-components/base-component.d.ts +21 -0
  59. package/lib/api/components/error/error.component.d.ts +12 -0
  60. package/lib/api/components/error/kverror.module.d.ts +10 -0
  61. package/lib/api/helpers/component-providers.d.ts +2 -0
  62. package/lib/api/helpers/translate-primeng.d.ts +4 -0
  63. package/lib/api/index.d.ts +1 -0
  64. package/lib/api/modules/primeng.module.d.ts +45 -0
  65. package/lib/api/public-api.d.ts +11 -0
  66. package/lib/api/services/component.service.d.ts +11 -0
  67. package/lib/api/services/object.service.d.ts +8 -0
  68. package/lib/buttons/button-secondary/button-secondary.component.d.ts +7 -0
  69. package/lib/buttons/button-success/button-success.component.d.ts +7 -0
  70. package/lib/buttons/kvbutton.module.d.ts +9 -0
  71. package/lib/inputs/check/check.component.d.ts +10 -0
  72. package/lib/inputs/dropdown/dropdown.component.d.ts +8 -0
  73. package/lib/inputs/input-calendar/input-calendar.component.d.ts +20 -0
  74. package/lib/inputs/input-mask/input-mask.component.d.ts +9 -0
  75. package/lib/inputs/input-number/input-number.component.d.ts +17 -0
  76. package/lib/inputs/input-password/input-password.component.d.ts +11 -0
  77. package/lib/inputs/input-text/input-text.component.d.ts +8 -0
  78. package/lib/inputs/input-textarea/input-textarea.component.d.ts +15 -0
  79. package/lib/inputs/input-time/input-time.component.d.ts +9 -0
  80. package/lib/inputs/kvinputs.module.d.ts +21 -0
  81. package/lib/inputs/multi-select/multi-select.component.d.ts +19 -0
  82. package/lib/inputs/switch/switch.component.d.ts +10 -0
  83. package/lib/keevo-components.module.d.ts +8 -0
  84. package/package.json +47 -0
  85. package/public-api.d.ts +21 -0
  86. package/src/lib/api/base-components/base-component-button.d.ts +13 -0
  87. package/src/lib/api/base-components/base-component-dropdown.d.ts +31 -0
  88. package/src/lib/api/base-components/base-component-input.d.ts +26 -0
  89. package/src/lib/api/base-components/base-component.d.ts +21 -0
  90. package/src/lib/api/components/error/error.component.d.ts +12 -0
  91. package/src/lib/api/components/error/kverror.module.d.ts +10 -0
  92. package/src/lib/api/helpers/component-providers.d.ts +2 -0
  93. package/src/lib/api/helpers/translate-primeng.d.ts +4 -0
  94. package/src/lib/api/index.d.ts +5 -0
  95. package/src/lib/api/modules/primeng.module.d.ts +45 -0
  96. package/src/lib/api/public-api.d.ts +11 -0
  97. package/src/lib/api/services/component.service.d.ts +11 -0
  98. package/src/lib/api/services/object.service.d.ts +8 -0
@@ -0,0 +1,27 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { FormControlName, FormGroupDirective, NgControl } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ export class ComponentService {
5
+ constructor(injector, changeDetectorRef) {
6
+ this.injector = injector;
7
+ this.changeDetectorRef = changeDetectorRef;
8
+ }
9
+ getFormControl() {
10
+ try {
11
+ const control = this.injector.get(NgControl);
12
+ if (control.constructor === FormControlName) {
13
+ return this.injector.get(FormGroupDirective).getControl(control);
14
+ }
15
+ return undefined;
16
+ }
17
+ catch (ex) {
18
+ return undefined;
19
+ }
20
+ }
21
+ }
22
+ ComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Injectable });
23
+ ComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService, decorators: [{
25
+ type: Injectable
26
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }]; } });
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rZWV2by1jb21wb25lbnRzL3NyYy9saWIvYXBpL3NlcnZpY2VzL2NvbXBvbmVudC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBcUIsVUFBVSxFQUFZLE1BQU0sZUFBZSxDQUFDO0FBQ3hFLE9BQU8sRUFBZSxlQUFlLEVBQUUsa0JBQWtCLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7O0FBRzdGLE1BQU0sT0FBTyxnQkFBZ0I7SUFFM0IsWUFBNEIsUUFBa0IsRUFBUyxpQkFBb0M7UUFBL0QsYUFBUSxHQUFSLFFBQVEsQ0FBVTtRQUFTLHNCQUFpQixHQUFqQixpQkFBaUIsQ0FBbUI7SUFBSSxDQUFDO0lBRWhHLGNBQWM7UUFDWixJQUFJO1lBQ0YsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDN0MsSUFBSSxPQUFPLENBQUMsV0FBVyxLQUFLLGVBQWUsRUFBRTtnQkFDM0MsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxPQUEwQixDQUFDLENBQUM7YUFDckY7WUFFRCxPQUFPLFNBQVMsQ0FBQztTQUNsQjtRQUNELE9BQU0sRUFBRSxFQUFDO1lBQ1AsT0FBTyxTQUFTLENBQUM7U0FDbEI7SUFDSCxDQUFDOzs2R0FoQlUsZ0JBQWdCO2lIQUFoQixnQkFBZ0I7MkZBQWhCLGdCQUFnQjtrQkFENUIsVUFBVSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENoYW5nZURldGVjdG9yUmVmLCBJbmplY3RhYmxlLCBJbmplY3RvciB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBGb3JtQ29udHJvbCwgRm9ybUNvbnRyb2xOYW1lLCBGb3JtR3JvdXBEaXJlY3RpdmUsIE5nQ29udHJvbCB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcclxuXHJcbkBJbmplY3RhYmxlKClcclxuZXhwb3J0IGNsYXNzIENvbXBvbmVudFNlcnZpY2Uge1xyXG5cclxuICBjb25zdHJ1Y3RvcihwdWJsaWMgcmVhZG9ubHkgaW5qZWN0b3I6IEluamVjdG9yLCBwdWJsaWMgY2hhbmdlRGV0ZWN0b3JSZWY6IENoYW5nZURldGVjdG9yUmVmKSB7IH1cclxuXHJcbiAgZ2V0Rm9ybUNvbnRyb2woKTogRm9ybUNvbnRyb2w8YW55PiB8IHVuZGVmaW5lZCB7XHJcbiAgICB0cnkge1xyXG4gICAgICBjb25zdCBjb250cm9sID0gdGhpcy5pbmplY3Rvci5nZXQoTmdDb250cm9sKTtcclxuICAgICAgaWYgKGNvbnRyb2wuY29uc3RydWN0b3IgPT09IEZvcm1Db250cm9sTmFtZSkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmluamVjdG9yLmdldChGb3JtR3JvdXBEaXJlY3RpdmUpLmdldENvbnRyb2woY29udHJvbCBhcyBGb3JtQ29udHJvbE5hbWUpO1xyXG4gICAgICB9XHJcblxyXG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xyXG4gICAgfVxyXG4gICAgY2F0Y2goZXgpe1xyXG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0=
@@ -0,0 +1,26 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class ObjectService {
4
+ static filterObject(array, propertyName, value) {
5
+ return array.filter((e) => {
6
+ return e[propertyName] === value;
7
+ });
8
+ }
9
+ static findObject(array, propertyName, value) {
10
+ return array.find((e) => {
11
+ return e[propertyName] === value;
12
+ });
13
+ }
14
+ static getProperty(obj, propertyName) {
15
+ return obj[propertyName];
16
+ }
17
+ }
18
+ ObjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
19
+ ObjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, providedIn: 'root' });
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, decorators: [{
21
+ type: Injectable,
22
+ args: [{
23
+ providedIn: 'root'
24
+ }]
25
+ }] });
26
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JqZWN0LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rZWV2by1jb21wb25lbnRzL3NyYy9saWIvYXBpL3NlcnZpY2VzL29iamVjdC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBSzNDLE1BQU0sT0FBTyxhQUFhO0lBQ3hCLE1BQU0sQ0FBQyxZQUFZLENBQUMsS0FBVSxFQUFFLFlBQW9CLEVBQUUsS0FBVTtRQUM5RCxPQUFPLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFNLEVBQUUsRUFBRTtZQUM3QixPQUFPLENBQUMsQ0FBQyxZQUFZLENBQUMsS0FBSyxLQUFLLENBQUM7UUFDbkMsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsTUFBTSxDQUFDLFVBQVUsQ0FBQyxLQUFVLEVBQUUsWUFBb0IsRUFBRSxLQUFVO1FBQzVELE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQU0sRUFBRSxFQUFFO1lBQzNCLE9BQU8sQ0FBQyxDQUFDLFlBQVksQ0FBQyxLQUFLLEtBQUssQ0FBQztRQUNuQyxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUM7SUFDRCxNQUFNLENBQUMsV0FBVyxDQUFJLEdBQU0sRUFBRSxZQUFvQjtRQUNoRCxPQUFPLEdBQUcsQ0FBRSxZQUFpQyxDQUFDLENBQUM7SUFDakQsQ0FBQzs7MEdBYlUsYUFBYTs4R0FBYixhQUFhLGNBRlosTUFBTTsyRkFFUCxhQUFhO2tCQUh6QixVQUFVO21CQUFDO29CQUNWLFVBQVUsRUFBRSxNQUFNO2lCQUNuQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuXHJcbkBJbmplY3RhYmxlKHtcclxuICBwcm92aWRlZEluOiAncm9vdCdcclxufSlcclxuZXhwb3J0IGNsYXNzIE9iamVjdFNlcnZpY2Uge1xyXG4gIHN0YXRpYyBmaWx0ZXJPYmplY3QoYXJyYXk6IGFueSwgcHJvcGVydHlOYW1lOiBzdHJpbmcsIHZhbHVlOiBhbnkpIHtcclxuICAgIHJldHVybiBhcnJheS5maWx0ZXIoKGU6IGFueSkgPT4ge1xyXG4gICAgICByZXR1cm4gZVtwcm9wZXJ0eU5hbWVdID09PSB2YWx1ZTtcclxuICAgIH0pO1xyXG4gIH1cclxuICBzdGF0aWMgZmluZE9iamVjdChhcnJheTogYW55LCBwcm9wZXJ0eU5hbWU6IHN0cmluZywgdmFsdWU6IGFueSkge1xyXG4gICAgcmV0dXJuIGFycmF5LmZpbmQoKGU6IGFueSkgPT4ge1xyXG4gICAgICByZXR1cm4gZVtwcm9wZXJ0eU5hbWVdID09PSB2YWx1ZTtcclxuICAgIH0pO1xyXG4gIH1cclxuICBzdGF0aWMgZ2V0UHJvcGVydHk8VD4ob2JqOiBULCBwcm9wZXJ0eU5hbWU6IHN0cmluZykge1xyXG4gICAgcmV0dXJuIG9ialsocHJvcGVydHlOYW1lIGFzIGtleW9mIHR5cGVvZiBvYmopXTtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,594 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, EventEmitter, Output, Injectable, ViewChildren, ContentChildren, forwardRef, NgModule } from '@angular/core';
3
+ import { Subject, of } from 'rxjs';
4
+ import * as i1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import { NgControl, FormControlName, FormGroupDirective, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i2 from 'primeng/dynamicdialog';
8
+ import { DynamicDialogModule, DialogService, DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
9
+ import { AccordionModule } from 'primeng/accordion';
10
+ import { AutoFocusModule } from 'primeng/autofocus';
11
+ import { BadgeModule } from 'primeng/badge';
12
+ import { ButtonModule } from 'primeng/button';
13
+ import { CalendarModule } from 'primeng/calendar';
14
+ import { CardModule } from 'primeng/card';
15
+ import { CarouselModule } from 'primeng/carousel';
16
+ import { CheckboxModule } from 'primeng/checkbox';
17
+ import { ConfirmDialogModule } from 'primeng/confirmdialog';
18
+ import { ConfirmationService, MessageService } from 'primeng/api';
19
+ import { ContextMenuModule } from 'primeng/contextmenu';
20
+ import { DialogModule } from 'primeng/dialog';
21
+ import { DividerModule } from 'primeng/divider';
22
+ import { DropdownModule } from 'primeng/dropdown';
23
+ import { InputMaskModule } from 'primeng/inputmask';
24
+ import { InputNumberModule } from 'primeng/inputnumber';
25
+ import { InputSwitchModule } from 'primeng/inputswitch';
26
+ import { InputTextModule } from 'primeng/inputtext';
27
+ import { InputTextareaModule } from 'primeng/inputtextarea';
28
+ import { MenuModule } from 'primeng/menu';
29
+ import { MessageModule } from 'primeng/message';
30
+ import { MessagesModule } from 'primeng/messages';
31
+ import { MultiSelectModule } from 'primeng/multiselect';
32
+ import { OverlayPanelModule } from 'primeng/overlaypanel';
33
+ import { PanelModule } from 'primeng/panel';
34
+ import { PasswordModule } from 'primeng/password';
35
+ import { PickListModule } from 'primeng/picklist';
36
+ import { RadioButtonModule } from 'primeng/radiobutton';
37
+ import { RatingModule } from 'primeng/rating';
38
+ import { RippleModule } from 'primeng/ripple';
39
+ import { SidebarModule } from 'primeng/sidebar';
40
+ import { SkeletonModule } from 'primeng/skeleton';
41
+ import { SpeedDialModule } from 'primeng/speeddial';
42
+ import { SplitButtonModule } from 'primeng/splitbutton';
43
+ import { StepsModule } from 'primeng/steps';
44
+ import { TableModule } from 'primeng/table';
45
+ import { ToastModule } from 'primeng/toast';
46
+ import { ToolbarModule } from 'primeng/toolbar';
47
+ import { TooltipModule } from 'primeng/tooltip';
48
+
49
+ class BaseComponent {
50
+ constructor() {
51
+ this.stateChanges = new Subject();
52
+ this.isRequired = false;
53
+ this.disabled = false;
54
+ }
55
+ set value(value) {
56
+ this._value = value;
57
+ if (this.onChange)
58
+ this.onChange(value);
59
+ this.stateChanges.next();
60
+ }
61
+ get value() {
62
+ return this._value;
63
+ }
64
+ registerOnChange(fn) {
65
+ this.onChange = fn;
66
+ }
67
+ registerOnTouched(fn) {
68
+ this.onTouched = fn;
69
+ }
70
+ setDisabledState(isDisabled) {
71
+ this.disabled = isDisabled;
72
+ }
73
+ writeValue(value) {
74
+ this.value = value;
75
+ }
76
+ }
77
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
78
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponent, selector: "ng-component", inputs: { isRequired: ["required", "isRequired"], componentId: "componentId", label: "label", disabled: "disabled" }, ngImport: i0, template: '', isInline: true });
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponent, decorators: [{
80
+ type: Component,
81
+ args: [{
82
+ template: ''
83
+ }]
84
+ }], propDecorators: { isRequired: [{
85
+ type: Input,
86
+ args: ['required']
87
+ }], componentId: [{
88
+ type: Input
89
+ }], label: [{
90
+ type: Input
91
+ }], disabled: [{
92
+ type: Input
93
+ }] } });
94
+
95
+ class BaseComponentButton {
96
+ constructor() {
97
+ this.icon = '';
98
+ this.label = '';
99
+ this.loading = false;
100
+ this.disabled = false;
101
+ this.onClick = new EventEmitter();
102
+ }
103
+ click(event) {
104
+ this.onClick.emit();
105
+ }
106
+ }
107
+ BaseComponentButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
108
+ BaseComponentButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponentButton, selector: "ng-component", inputs: { icon: "icon", label: "label", loading: "loading", disabled: "disabled" }, outputs: { onClick: "onClick" }, ngImport: i0, template: '', isInline: true });
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentButton, decorators: [{
110
+ type: Component,
111
+ args: [{
112
+ template: '',
113
+ }]
114
+ }], ctorParameters: function () { return []; }, propDecorators: { icon: [{
115
+ type: Input
116
+ }], label: [{
117
+ type: Input
118
+ }], loading: [{
119
+ type: Input
120
+ }], disabled: [{
121
+ type: Input
122
+ }], onClick: [{
123
+ type: Output
124
+ }] } });
125
+
126
+ class ErrorComponent {
127
+ set setHasError(value) {
128
+ this.hasError = value;
129
+ this.emitError.emit(value);
130
+ }
131
+ ;
132
+ constructor() {
133
+ this.hasError = false;
134
+ this.emitError = new EventEmitter();
135
+ }
136
+ }
137
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
138
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ErrorComponent, selector: "kv-error", inputs: { formControl: "formControl", setHasError: ["hasError", "setHasError"] }, ngImport: i0, template: "<small *ngIf=\"hasError\" id=\"error-message\" class=\"p-error block\">\r\n <ng-content></ng-content>\r\n</small>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ErrorComponent, decorators: [{
140
+ type: Component,
141
+ args: [{ selector: 'kv-error', template: "<small *ngIf=\"hasError\" id=\"error-message\" class=\"p-error block\">\r\n <ng-content></ng-content>\r\n</small>\r\n" }]
142
+ }], ctorParameters: function () { return []; }, propDecorators: { formControl: [{
143
+ type: Input
144
+ }], setHasError: [{
145
+ type: Input,
146
+ args: ['hasError']
147
+ }] } });
148
+
149
+ class ComponentService {
150
+ constructor(injector, changeDetectorRef) {
151
+ this.injector = injector;
152
+ this.changeDetectorRef = changeDetectorRef;
153
+ }
154
+ getFormControl() {
155
+ try {
156
+ const control = this.injector.get(NgControl);
157
+ if (control.constructor === FormControlName) {
158
+ return this.injector.get(FormGroupDirective).getControl(control);
159
+ }
160
+ return undefined;
161
+ }
162
+ catch (ex) {
163
+ return undefined;
164
+ }
165
+ }
166
+ }
167
+ ComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Injectable });
168
+ ComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService });
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ComponentService, decorators: [{
170
+ type: Injectable
171
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }]; } });
172
+
173
+ class BaseComponentInput extends BaseComponent {
174
+ constructor(componentService) {
175
+ super();
176
+ this.componentService = componentService;
177
+ this.hasError = false;
178
+ this.placeholder = '';
179
+ this.onBlur = new EventEmitter();
180
+ }
181
+ get baseInputClass() {
182
+ return `${this.hasError ? 'ng-invalid ng-dirty' : ''} !important`;
183
+ }
184
+ erroMessage() {
185
+ var _a;
186
+ if (!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.errors))
187
+ return;
188
+ let message = '';
189
+ if (this.formControl.errors) {
190
+ const objErrors = this.formControl.errors;
191
+ if (objErrors.erroMessage)
192
+ message = objErrors.erroMessage;
193
+ }
194
+ return message;
195
+ }
196
+ getName(control) {
197
+ var _a, _b, _c, _d;
198
+ return (_d = (_c = Object.entries((_b = (_a = control.parent) === null || _a === void 0 ? void 0 : _a.controls) !== null && _b !== void 0 ? _b : []).find(([_, value]) => value === control)) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : null;
199
+ }
200
+ hasControlError() {
201
+ if (!this.formControl)
202
+ return false;
203
+ return (this.formControl.dirty || this.formControl.touched) && this.formControl.errors !== null;
204
+ }
205
+ ngAfterViewInit() {
206
+ this.viewErrors.forEach(c => {
207
+ c.emitError.subscribe(res => {
208
+ this.hasError = res;
209
+ this.componentService.changeDetectorRef.detectChanges();
210
+ });
211
+ });
212
+ }
213
+ ngAfterContentInit() {
214
+ this.contentErrors.forEach(c => {
215
+ c.emitError.subscribe(res => {
216
+ this.hasError = res;
217
+ });
218
+ });
219
+ }
220
+ ngOnInit() {
221
+ this.formControl = this.componentService.getFormControl();
222
+ }
223
+ onInputBlur(event) {
224
+ this.onTouched();
225
+ this.onBlur.emit(event);
226
+ }
227
+ }
228
+ BaseComponentInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentInput, deps: [{ token: ComponentService }], target: i0.ɵɵFactoryTarget.Component });
229
+ BaseComponentInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponentInput, selector: "ng-component", inputs: { placeholder: "placeholder" }, outputs: { onBlur: "onBlur" }, queries: [{ propertyName: "contentErrors", predicate: ErrorComponent }], viewQueries: [{ propertyName: "viewErrors", predicate: ErrorComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentInput, decorators: [{
231
+ type: Component,
232
+ args: [{
233
+ template: '',
234
+ }]
235
+ }], ctorParameters: function () { return [{ type: ComponentService }]; }, propDecorators: { placeholder: [{
236
+ type: Input
237
+ }], onBlur: [{
238
+ type: Output
239
+ }], viewErrors: [{
240
+ type: ViewChildren,
241
+ args: [ErrorComponent]
242
+ }], contentErrors: [{
243
+ type: ContentChildren,
244
+ args: [ErrorComponent]
245
+ }] } });
246
+
247
+ class ObjectService {
248
+ static filterObject(array, propertyName, value) {
249
+ return array.filter((e) => {
250
+ return e[propertyName] === value;
251
+ });
252
+ }
253
+ static findObject(array, propertyName, value) {
254
+ return array.find((e) => {
255
+ return e[propertyName] === value;
256
+ });
257
+ }
258
+ static getProperty(obj, propertyName) {
259
+ return obj[propertyName];
260
+ }
261
+ }
262
+ ObjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
263
+ ObjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, providedIn: 'root' });
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ObjectService, decorators: [{
265
+ type: Injectable,
266
+ args: [{
267
+ providedIn: 'root'
268
+ }]
269
+ }] });
270
+
271
+ class BaseComponentDropDown extends BaseComponentInput {
272
+ constructor(componentService, dialogService) {
273
+ super(componentService);
274
+ this.dialogService = dialogService;
275
+ this.addButton = false;
276
+ this.filter = true;
277
+ this.showClear = true;
278
+ this.onAddClick = new EventEmitter();
279
+ this.onSelectionChange = new EventEmitter();
280
+ this.onSelectionValue = new EventEmitter();
281
+ this.onClick = new EventEmitter();
282
+ }
283
+ ngOnInit() {
284
+ super.ngOnInit();
285
+ this.carregarCombo();
286
+ this.setPlaceHolder('Selecione um valor');
287
+ }
288
+ addClick(event) {
289
+ this.onAddClick.emit(event);
290
+ }
291
+ carregarCombo() {
292
+ this.listar().subscribe({
293
+ next: (data) => {
294
+ this.options = data;
295
+ this.filteredOptions = data;
296
+ },
297
+ error: (error) => { },
298
+ });
299
+ }
300
+ filterOptions(field, value) {
301
+ if (this.options) {
302
+ let lista = ObjectService.filterObject(this.options, field, value);
303
+ if ((lista === null || lista === void 0 ? void 0 : lista.length) > 0) {
304
+ of(lista).subscribe((opts) => {
305
+ this.filteredOptions = opts;
306
+ });
307
+ }
308
+ else
309
+ this.filteredOptions = [];
310
+ }
311
+ }
312
+ listar() { }
313
+ onInputClick(event) {
314
+ this.onClick.emit(event);
315
+ }
316
+ openDialog(componentType, width, height) {
317
+ const ref = this.dialogService.open(componentType, {
318
+ width: width || '70%',
319
+ height: height,
320
+ closable: false,
321
+ maximizable: true,
322
+ data: { popup: true },
323
+ });
324
+ ref.onClose.subscribe((id) => {
325
+ if (id) {
326
+ this.listar().subscribe((data) => {
327
+ var _a;
328
+ this.options = data;
329
+ this.filteredOptions = data;
330
+ if (id)
331
+ (_a = this.formControl) === null || _a === void 0 ? void 0 : _a.setValue(id);
332
+ });
333
+ }
334
+ });
335
+ }
336
+ selectionValue(event) {
337
+ this.onSelectionValue.emit(event);
338
+ let currentItem = null;
339
+ const controlName = this.getName(this.formControl);
340
+ if (controlName)
341
+ currentItem = ObjectService.findObject(this.options, controlName, event.value);
342
+ this.onSelectionChange.emit(currentItem);
343
+ }
344
+ setPlaceHolder(p) {
345
+ if (!this.placeholder)
346
+ this.placeholder = p;
347
+ }
348
+ }
349
+ BaseComponentDropDown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentDropDown, deps: [{ token: ComponentService }, { token: i2.DialogService }], target: i0.ɵɵFactoryTarget.Component });
350
+ BaseComponentDropDown.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: BaseComponentDropDown, selector: "ng-component", inputs: { options: "options", filteredOptions: "filteredOptions", optionLabel: "optionLabel", optionValue: "optionValue", addButton: "addButton", filter: "filter", showClear: "showClear" }, outputs: { onAddClick: "onAddClick", onSelectionChange: "onSelectionChange", onSelectionValue: "onSelectionValue", onClick: "onClick" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: BaseComponentDropDown, decorators: [{
352
+ type: Component,
353
+ args: [{
354
+ template: '',
355
+ }]
356
+ }], ctorParameters: function () { return [{ type: ComponentService }, { type: i2.DialogService }]; }, propDecorators: { options: [{
357
+ type: Input
358
+ }], filteredOptions: [{
359
+ type: Input
360
+ }], optionLabel: [{
361
+ type: Input
362
+ }], optionValue: [{
363
+ type: Input
364
+ }], addButton: [{
365
+ type: Input
366
+ }], filter: [{
367
+ type: Input
368
+ }], showClear: [{
369
+ type: Input
370
+ }], onAddClick: [{
371
+ type: Output
372
+ }], onSelectionChange: [{
373
+ type: Output
374
+ }], onSelectionValue: [{
375
+ type: Output
376
+ }], onClick: [{
377
+ type: Output
378
+ }] } });
379
+
380
+ function ComponentProviders(ref) {
381
+ return [
382
+ {
383
+ provide: NG_VALUE_ACCESSOR,
384
+ useExisting: forwardRef(() => ref),
385
+ multi: true,
386
+ },
387
+ {
388
+ provide: ComponentService
389
+ }
390
+ ];
391
+ }
392
+
393
+ class TranslatePrimeng {
394
+ config(config) {
395
+ config.ripple = true;
396
+ config.setTranslation({
397
+ monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
398
+ monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
399
+ dayNames: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabádo'],
400
+ dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
401
+ dayNamesMin: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
402
+ today: 'Hoje',
403
+ weekHeader: 'Semana',
404
+ emptyMessage: 'Nenhum resultado encontrado',
405
+ emptyFilterMessage: 'Nenhum registro encontrado com o filtro informado',
406
+ weak: 'Fraca',
407
+ medium: 'Média',
408
+ strong: 'Forte',
409
+ passwordPrompt: 'Informe a senha',
410
+ clear: 'Limpar',
411
+ apply: 'Aplicar'
412
+ });
413
+ }
414
+ }
415
+
416
+ class PrimeNgModule {
417
+ }
418
+ PrimeNgModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PrimeNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
419
+ PrimeNgModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: PrimeNgModule, exports: [AccordionModule,
420
+ AutoFocusModule,
421
+ BadgeModule,
422
+ ButtonModule,
423
+ CalendarModule,
424
+ CardModule,
425
+ CarouselModule,
426
+ CheckboxModule,
427
+ ConfirmDialogModule,
428
+ ContextMenuModule,
429
+ DialogModule,
430
+ DividerModule,
431
+ DropdownModule,
432
+ DynamicDialogModule,
433
+ InputMaskModule,
434
+ InputNumberModule,
435
+ InputSwitchModule,
436
+ InputTextModule,
437
+ InputTextareaModule,
438
+ MenuModule,
439
+ MessageModule,
440
+ MessagesModule,
441
+ MultiSelectModule,
442
+ OverlayPanelModule,
443
+ OverlayPanelModule,
444
+ PanelModule,
445
+ PasswordModule,
446
+ PickListModule,
447
+ RadioButtonModule,
448
+ RatingModule,
449
+ RippleModule,
450
+ SidebarModule,
451
+ SkeletonModule,
452
+ SpeedDialModule,
453
+ SplitButtonModule,
454
+ StepsModule,
455
+ TableModule,
456
+ ToastModule,
457
+ ToolbarModule,
458
+ TooltipModule] });
459
+ PrimeNgModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PrimeNgModule, providers: [
460
+ ConfirmationService,
461
+ DialogService,
462
+ DynamicDialogRef,
463
+ DynamicDialogConfig,
464
+ MessageService,
465
+ ], imports: [AccordionModule,
466
+ AutoFocusModule,
467
+ BadgeModule,
468
+ ButtonModule,
469
+ CalendarModule,
470
+ CardModule,
471
+ CarouselModule,
472
+ CheckboxModule,
473
+ ConfirmDialogModule,
474
+ ContextMenuModule,
475
+ DialogModule,
476
+ DividerModule,
477
+ DropdownModule,
478
+ DynamicDialogModule,
479
+ InputMaskModule,
480
+ InputNumberModule,
481
+ InputSwitchModule,
482
+ InputTextModule,
483
+ InputTextareaModule,
484
+ MenuModule,
485
+ MessageModule,
486
+ MessagesModule,
487
+ MultiSelectModule,
488
+ OverlayPanelModule,
489
+ OverlayPanelModule,
490
+ PanelModule,
491
+ PasswordModule,
492
+ PickListModule,
493
+ RadioButtonModule,
494
+ RatingModule,
495
+ RippleModule,
496
+ SidebarModule,
497
+ SkeletonModule,
498
+ SpeedDialModule,
499
+ SplitButtonModule,
500
+ StepsModule,
501
+ TableModule,
502
+ ToastModule,
503
+ ToolbarModule,
504
+ TooltipModule] });
505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PrimeNgModule, decorators: [{
506
+ type: NgModule,
507
+ args: [{
508
+ exports: [
509
+ AccordionModule,
510
+ AutoFocusModule,
511
+ BadgeModule,
512
+ ButtonModule,
513
+ CalendarModule,
514
+ CardModule,
515
+ CarouselModule,
516
+ CheckboxModule,
517
+ ConfirmDialogModule,
518
+ ContextMenuModule,
519
+ DialogModule,
520
+ DividerModule,
521
+ DropdownModule,
522
+ DynamicDialogModule,
523
+ InputMaskModule,
524
+ InputNumberModule,
525
+ InputSwitchModule,
526
+ InputTextModule,
527
+ InputTextareaModule,
528
+ MenuModule,
529
+ MessageModule,
530
+ MessagesModule,
531
+ MultiSelectModule,
532
+ OverlayPanelModule,
533
+ OverlayPanelModule,
534
+ PanelModule,
535
+ PasswordModule,
536
+ PickListModule,
537
+ RadioButtonModule,
538
+ RatingModule,
539
+ RippleModule,
540
+ SidebarModule,
541
+ SkeletonModule,
542
+ SpeedDialModule,
543
+ SplitButtonModule,
544
+ StepsModule,
545
+ TableModule,
546
+ ToastModule,
547
+ ToolbarModule,
548
+ TooltipModule,
549
+ ],
550
+ providers: [
551
+ ConfirmationService,
552
+ DialogService,
553
+ DynamicDialogRef,
554
+ DynamicDialogConfig,
555
+ MessageService,
556
+ ]
557
+ }]
558
+ }] });
559
+
560
+ class kvErrorModule {
561
+ }
562
+ kvErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: kvErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
563
+ kvErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: kvErrorModule, declarations: [ErrorComponent], imports: [CommonModule,
564
+ FormsModule,
565
+ PrimeNgModule,
566
+ ReactiveFormsModule], exports: [ErrorComponent] });
567
+ kvErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: kvErrorModule, imports: [CommonModule,
568
+ FormsModule,
569
+ PrimeNgModule,
570
+ ReactiveFormsModule] });
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: kvErrorModule, decorators: [{
572
+ type: NgModule,
573
+ args: [{
574
+ declarations: [
575
+ ErrorComponent,
576
+ ],
577
+ imports: [
578
+ CommonModule,
579
+ FormsModule,
580
+ PrimeNgModule,
581
+ ReactiveFormsModule,
582
+ ],
583
+ exports: [
584
+ ErrorComponent,
585
+ ]
586
+ }]
587
+ }] });
588
+
589
+ /**
590
+ * Generated bundle index. Do not edit.
591
+ */
592
+
593
+ export { BaseComponent, BaseComponentButton, BaseComponentDropDown, BaseComponentInput, ComponentProviders, ComponentService, ErrorComponent, ObjectService, PrimeNgModule, TranslatePrimeng, kvErrorModule };
594
+ //# sourceMappingURL=keevo-components-src-lib-api.mjs.map