keevo-components 0.0.7 → 0.0.9

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 (124) hide show
  1. package/ng-package.json +7 -0
  2. package/package.json +3 -22
  3. package/src/index.ts +1 -0
  4. package/src/lib/api/base-components/base-component-button.ts +25 -0
  5. package/src/lib/api/base-components/base-component-dropdown.ts +126 -0
  6. package/src/lib/api/base-components/base-component-input.ts +91 -0
  7. package/src/lib/api/base-components/base-component.ts +46 -0
  8. package/src/lib/api/components/error/error.component.html +3 -0
  9. package/src/lib/api/components/error/error.component.scss +0 -0
  10. package/src/lib/api/components/error/error.component.ts +22 -0
  11. package/src/lib/api/components/error/kverror.module.ts +23 -0
  12. package/src/lib/api/helpers/component-providers.ts +16 -0
  13. package/src/lib/api/helpers/translate-primeng.ts +25 -0
  14. package/src/lib/api/modules/primeng.module.ts +95 -0
  15. package/src/lib/api/services/component.service.ts +22 -0
  16. package/src/lib/api/services/object.service.ts +20 -0
  17. package/src/lib/buttons/button-secondary/button-secondary.component.html +9 -0
  18. package/src/lib/buttons/button-secondary/button-secondary.component.scss +13 -0
  19. package/src/lib/buttons/button-secondary/button-secondary.component.ts +13 -0
  20. package/src/lib/buttons/button-success/button-success.component.html +9 -0
  21. package/src/lib/buttons/button-success/button-success.component.scss +12 -0
  22. package/src/lib/buttons/button-success/button-success.component.ts +13 -0
  23. package/src/lib/buttons/kvbutton.module.ts +19 -0
  24. package/src/lib/inputs/check/check.component.html +11 -0
  25. package/src/lib/inputs/check/check.component.scss +0 -0
  26. package/src/lib/inputs/check/check.component.ts +24 -0
  27. package/src/lib/inputs/dropdown/dropdown.component.html +41 -0
  28. package/src/lib/inputs/dropdown/dropdown.component.scss +0 -0
  29. package/src/lib/inputs/dropdown/dropdown.component.ts +19 -0
  30. package/src/lib/inputs/input-calendar/input-calendar.component.html +22 -0
  31. package/src/lib/inputs/input-calendar/input-calendar.component.scss +0 -0
  32. package/src/lib/inputs/input-calendar/input-calendar.component.ts +54 -0
  33. package/src/lib/inputs/input-mask/input-mask.component.html +15 -0
  34. package/src/lib/inputs/input-mask/input-mask.component.scss +0 -0
  35. package/src/lib/inputs/input-mask/input-mask.component.ts +20 -0
  36. package/src/lib/inputs/input-number/input-number.component.html +15 -0
  37. package/src/lib/inputs/input-number/input-number.component.scss +0 -0
  38. package/src/lib/inputs/input-number/input-number.component.ts +51 -0
  39. package/src/lib/inputs/input-password/input-password.component.html +18 -0
  40. package/src/lib/inputs/input-password/input-password.component.scss +0 -0
  41. package/src/lib/inputs/input-password/input-password.component.ts +23 -0
  42. package/src/lib/inputs/input-text/input-text.component.html +14 -0
  43. package/src/lib/inputs/input-text/input-text.component.scss +18 -0
  44. package/src/lib/inputs/input-text/input-text.component.ts +17 -0
  45. package/src/lib/inputs/input-textarea/input-textarea.component.html +17 -0
  46. package/src/lib/inputs/input-textarea/input-textarea.component.scss +0 -0
  47. package/src/lib/inputs/input-textarea/input-textarea.component.ts +33 -0
  48. package/src/lib/inputs/input-time/input-time.component.html +18 -0
  49. package/src/lib/inputs/input-time/input-time.component.scss +0 -0
  50. package/src/lib/inputs/input-time/input-time.component.ts +20 -0
  51. package/src/lib/inputs/kvinputs.module.ts +53 -0
  52. package/src/lib/inputs/multi-select/multi-select.component.html +21 -0
  53. package/src/lib/inputs/multi-select/multi-select.component.scss +0 -0
  54. package/src/lib/inputs/multi-select/multi-select.component.ts +44 -0
  55. package/src/lib/inputs/switch/switch.component.html +11 -0
  56. package/src/lib/inputs/switch/switch.component.scss +3 -0
  57. package/src/lib/inputs/switch/switch.component.ts +24 -0
  58. package/src/lib/keevo-components.module.ts +17 -0
  59. package/{public-api.d.ts → src/public-api.ts} +34 -27
  60. package/tsconfig.lib.json +14 -0
  61. package/tsconfig.lib.prod.json +10 -0
  62. package/tsconfig.spec.json +14 -0
  63. package/esm2020/keevo-components.mjs +0 -5
  64. package/esm2020/lib/api/base-components/base-component-button.mjs +0 -33
  65. package/esm2020/lib/api/base-components/base-component-dropdown.mjs +0 -115
  66. package/esm2020/lib/api/base-components/base-component-input.mjs +0 -77
  67. package/esm2020/lib/api/base-components/base-component.mjs +0 -49
  68. package/esm2020/lib/api/components/error/error.component.mjs +0 -26
  69. package/esm2020/lib/api/components/error/kverror.module.mjs +0 -35
  70. package/esm2020/lib/api/helpers/component-providers.mjs +0 -16
  71. package/esm2020/lib/api/helpers/translate-primeng.mjs +0 -23
  72. package/esm2020/lib/api/modules/primeng.module.mjs +0 -187
  73. package/esm2020/lib/api/services/component.service.mjs +0 -27
  74. package/esm2020/lib/api/services/object.service.mjs +0 -26
  75. package/esm2020/lib/buttons/button-secondary/button-secondary.component.mjs +0 -17
  76. package/esm2020/lib/buttons/button-success/button-success.component.mjs +0 -17
  77. package/esm2020/lib/buttons/kvbutton.module.mjs +0 -29
  78. package/esm2020/lib/inputs/check/check.component.mjs +0 -26
  79. package/esm2020/lib/inputs/dropdown/dropdown.component.mjs +0 -26
  80. package/esm2020/lib/inputs/input-calendar/input-calendar.component.mjs +0 -62
  81. package/esm2020/lib/inputs/input-mask/input-mask.component.mjs +0 -22
  82. package/esm2020/lib/inputs/input-number/input-number.component.mjs +0 -56
  83. package/esm2020/lib/inputs/input-password/input-password.component.mjs +0 -32
  84. package/esm2020/lib/inputs/input-text/input-text.component.mjs +0 -20
  85. package/esm2020/lib/inputs/input-textarea/input-textarea.component.mjs +0 -42
  86. package/esm2020/lib/inputs/input-time/input-time.component.mjs +0 -23
  87. package/esm2020/lib/inputs/kvinputs.module.mjs +0 -89
  88. package/esm2020/lib/inputs/multi-select/multi-select.component.mjs +0 -50
  89. package/esm2020/lib/inputs/switch/switch.component.mjs +0 -26
  90. package/esm2020/lib/keevo-components.module.mjs +0 -28
  91. package/esm2020/public-api.mjs +0 -31
  92. package/esm2020/public_api.mjs +0 -31
  93. package/fesm2015/keevo-components.mjs +0 -1050
  94. package/fesm2015/keevo-components.mjs.map +0 -1
  95. package/fesm2020/keevo-components.mjs +0 -1046
  96. package/fesm2020/keevo-components.mjs.map +0 -1
  97. package/index.d.ts +0 -5
  98. package/lib/api/base-components/base-component-button.d.ts +0 -13
  99. package/lib/api/base-components/base-component-dropdown.d.ts +0 -31
  100. package/lib/api/base-components/base-component-input.d.ts +0 -26
  101. package/lib/api/base-components/base-component.d.ts +0 -21
  102. package/lib/api/components/error/error.component.d.ts +0 -12
  103. package/lib/api/components/error/kverror.module.d.ts +0 -10
  104. package/lib/api/helpers/component-providers.d.ts +0 -2
  105. package/lib/api/helpers/translate-primeng.d.ts +0 -4
  106. package/lib/api/modules/primeng.module.d.ts +0 -45
  107. package/lib/api/services/component.service.d.ts +0 -11
  108. package/lib/api/services/object.service.d.ts +0 -8
  109. package/lib/buttons/button-secondary/button-secondary.component.d.ts +0 -7
  110. package/lib/buttons/button-success/button-success.component.d.ts +0 -7
  111. package/lib/buttons/kvbutton.module.d.ts +0 -9
  112. package/lib/inputs/check/check.component.d.ts +0 -11
  113. package/lib/inputs/dropdown/dropdown.component.d.ts +0 -9
  114. package/lib/inputs/input-calendar/input-calendar.component.d.ts +0 -21
  115. package/lib/inputs/input-mask/input-mask.component.d.ts +0 -10
  116. package/lib/inputs/input-number/input-number.component.d.ts +0 -18
  117. package/lib/inputs/input-password/input-password.component.d.ts +0 -12
  118. package/lib/inputs/input-text/input-text.component.d.ts +0 -9
  119. package/lib/inputs/input-textarea/input-textarea.component.d.ts +0 -16
  120. package/lib/inputs/input-time/input-time.component.d.ts +0 -10
  121. package/lib/inputs/kvinputs.module.d.ts +0 -21
  122. package/lib/inputs/multi-select/multi-select.component.d.ts +0 -20
  123. package/lib/inputs/switch/switch.component.d.ts +0 -11
  124. package/lib/keevo-components.module.d.ts +0 -8
@@ -0,0 +1,11 @@
1
+ <div class="field-checkbox">
2
+ <p-checkbox
3
+ [binary]="true"
4
+ [disabled]="disabled"
5
+ [label]="label"
6
+ [inputId]="componentId"
7
+ [(ngModel)]="value"
8
+ (onChange)="emitOnCheckChange($event)">
9
+ </p-checkbox>
10
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
11
+ </div>
File without changes
@@ -0,0 +1,24 @@
1
+ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
2
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
3
+ import { ComponentService } from '../../api/services/component.service';
4
+ import { ComponentProviders } from '../../api/helpers/component-providers';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-check',
9
+ templateUrl: './check.component.html',
10
+ styleUrls: ['./check.component.scss'],
11
+ providers: ComponentProviders(CheckComponent),
12
+ })
13
+ export class CheckComponent extends BaseComponentInput<boolean> implements OnInit {
14
+
15
+ @Output() onCheckChange: EventEmitter<any> = new EventEmitter();
16
+
17
+ constructor(componentService: ComponentService) {
18
+ super(componentService);
19
+ }
20
+
21
+ emitOnCheckChange(event: any) {
22
+ this.onCheckChange.emit(event);
23
+ }
24
+ }
@@ -0,0 +1,41 @@
1
+ <span class="p-float-label">
2
+
3
+ <p-dropdown
4
+ appendTo="body"
5
+ [class]="baseInputClass"
6
+ [disabled]="disabled"
7
+ [filter]="filter"
8
+ [inputId]="componentId"
9
+ [(ngModel)]="value"
10
+ [options]="filteredOptions"
11
+ [optionLabel]="optionLabel"
12
+ [optionValue]="optionValue"
13
+ [showClear]="showClear"
14
+ [lazy]="true"
15
+ scrollHeight="100px"
16
+ (onBlur)="onInputBlur($event)"
17
+ (onClick)="onInputClick($event)"
18
+ (onChange)="selectionValue($event)">
19
+
20
+ <ng-template *ngIf="addButton" pTemplate="footer">
21
+ <p-divider></p-divider>
22
+ <div class="flex flex-wrap card-container p-1">
23
+ <div class="flex justify-content-center">
24
+ <button
25
+ pButton
26
+ label="Incluir"
27
+ pTooltip="Clique aqui para incluir um novo registro"
28
+ tooltipPosition="bottom"
29
+ icon="pi pi-plus"
30
+ class="p-button-rounded p-button-success mr-2"
31
+ (click)="addClick($event)"></button>
32
+ </div>
33
+ </div>
34
+ </ng-template>
35
+
36
+ </p-dropdown>
37
+ <label [for]="componentId">{{ label }}</label>
38
+
39
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
40
+ </span>
41
+ <ng-content></ng-content>
@@ -0,0 +1,19 @@
1
+ import { Component } from '@angular/core';
2
+ import { DialogService } from 'primeng/dynamicdialog';
3
+ import { ComponentService } from '../../api/services/component.service';
4
+ import { ComponentProviders } from '../../api/helpers/component-providers';
5
+ import { BaseComponentDropDown } from '../../api/base-components/base-component-dropdown';
6
+
7
+ @Component({
8
+ selector: 'kv-dropdown',
9
+ templateUrl: './dropdown.component.html',
10
+ styleUrls: ['./dropdown.component.scss'],
11
+ providers: ComponentProviders(DropdownComponent),
12
+ })
13
+ export class DropdownComponent extends BaseComponentDropDown {
14
+ constructor(
15
+ componentService: ComponentService,
16
+ dialogService: DialogService) {
17
+ super(componentService, dialogService);
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ <span class="p-float-label">
2
+
3
+ <p-calendar
4
+ appendTo="body"
5
+ [class]="baseInputClass"
6
+ [id]="componentId"
7
+ [(ngModel)]="value"
8
+ [disabled]="disabled"
9
+ [minDate]="minDate"
10
+ [maxDate]="maxDate"
11
+ [selectionMode]="selectionMode"
12
+ [showButtonBar]="showButtonBar"
13
+ [showIcon]="showIcon"
14
+ [view]="typeView"
15
+ [dateFormat]="dateFormat"
16
+ (onBlur)="onInputBlur($event)">
17
+ </p-calendar>
18
+ <label [for]="componentId">{{ label }}</label>
19
+
20
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
21
+ </span>
22
+ <ng-content></ng-content>
@@ -0,0 +1,54 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { CalendarTypeView } from 'primeng/calendar';
3
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
4
+ import { ComponentProviders } from '../../api/helpers/component-providers';
5
+ import { ComponentService } from '../../api/services/component.service';
6
+
7
+ @Component({
8
+ selector: 'kv-input-calendar',
9
+ templateUrl: './input-calendar.component.html',
10
+ styleUrls: ['./input-calendar.component.scss'],
11
+ providers: ComponentProviders(InputCalendarComponent),
12
+ })
13
+ export class InputCalendarComponent extends BaseComponentInput<Date> implements OnInit {
14
+
15
+ @Input() isYear: boolean = false;
16
+ @Input() isMonthYear: boolean = false;
17
+ @Input() minDate!: Date;
18
+ @Input() maxDate!: Date;
19
+ @Input() showButtonBar: boolean = false;
20
+ @Input() showIcon: boolean = true;
21
+ @Input() selectionMode: 'single' | 'multiple' | 'range' = 'single';
22
+
23
+ typeView: CalendarTypeView = 'date';
24
+ dateFormat: string = 'dd/mm/yy';
25
+
26
+ constructor(componentService: ComponentService) {
27
+ super(componentService);
28
+ }
29
+
30
+ override writeValue(value: Date): void {
31
+ this.value = value;
32
+
33
+ if (value && typeof value === 'string') {
34
+ this.value = new Date(value);
35
+ }
36
+ }
37
+
38
+ override ngOnInit(): void {
39
+ super.ngOnInit();
40
+
41
+ if (this.isYear) {
42
+ this.typeView = "year";
43
+ this.dateFormat = 'yy';
44
+ }
45
+ else if (this.isMonthYear) {
46
+ this.typeView = 'month';
47
+ this.dateFormat = 'mm/yy';
48
+ }
49
+ else {
50
+ this.typeView = 'date';
51
+ this.dateFormat = 'dd/mm/yy';
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,15 @@
1
+ <span class="p-float-label">
2
+
3
+ <p-inputMask
4
+ [class]="baseInputClass"
5
+ [inputId]="componentId"
6
+ [placeholder]="placeholder"
7
+ [(ngModel)]="value"
8
+ [mask]="mask"
9
+ (onBlur)="onInputBlur($event)">
10
+ </p-inputMask>
11
+ <label [for]="componentId">{{ label }}</label>
12
+
13
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
14
+ </span>
15
+ <ng-content></ng-content>
@@ -0,0 +1,20 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
3
+ import { ComponentProviders } from '../../api/helpers/component-providers';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-input-mask',
9
+ templateUrl: './input-mask.component.html',
10
+ styleUrls: ['./input-mask.component.scss'],
11
+ providers: ComponentProviders(InputMaskComponent),
12
+ })
13
+ export class InputMaskComponent extends BaseComponentInput<string> implements OnInit {
14
+
15
+ @Input() mask!: string;
16
+
17
+ constructor(componentService: ComponentService) {
18
+ super(componentService);
19
+ }
20
+ }
@@ -0,0 +1,15 @@
1
+ <span class="p-float-label">
2
+ <p-inputNumber
3
+ #inputNumber
4
+ [class]="baseInputClass"
5
+ [inputId]="componentId"
6
+ [min]="min"
7
+ [max]="max"
8
+ [(ngModel)]="value"
9
+ (onBlur)="onInputBlur($event)">
10
+ </p-inputNumber>
11
+ <label [for]="componentId">{{ label }}</label>
12
+
13
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
14
+ </span>
15
+ <ng-content></ng-content>
@@ -0,0 +1,51 @@
1
+ import { Component, Input, OnInit, ViewChild } from '@angular/core';
2
+ import { InputNumber } from 'primeng/inputnumber';
3
+ import { ComponentProviders } from '../../api/helpers/component-providers';
4
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
5
+ import { ComponentService } from '../../api/services/component.service';
6
+
7
+
8
+ @Component({
9
+ selector: 'kv-input-number',
10
+ templateUrl: './input-number.component.html',
11
+ styleUrls: ['./input-number.component.scss'],
12
+ providers: ComponentProviders(InputNumberComponent),
13
+ })
14
+ export class InputNumberComponent extends BaseComponentInput<string> implements OnInit {
15
+ @Input() mode: 'currency' | 'decimal' = 'decimal';
16
+ @Input() digits: number = 0;
17
+ @Input() min: number = 0;
18
+ @Input() max!: number;
19
+
20
+ @ViewChild('inputNumber', { static: true }) inputNumber!: InputNumber;
21
+
22
+ constructor(componentService: ComponentService) {
23
+ super(componentService);
24
+ }
25
+
26
+ override ngOnInit(): void {
27
+ super.ngOnInit();
28
+
29
+ this.inputNumber.mode = this.mode;
30
+ this.inputNumber.locale = 'pt-BR';
31
+
32
+ switch (this.mode) {
33
+ case 'decimal':
34
+ this.configDecimal();
35
+ break;
36
+ case 'currency':
37
+ this.configCurrency();
38
+ break;
39
+ }
40
+ }
41
+
42
+ private configDecimal() {
43
+ if (!this.digits) this.inputNumber.useGrouping = false;
44
+ this.inputNumber.minFractionDigits = this.digits;
45
+ this.inputNumber.maxFractionDigits = this.digits;
46
+ }
47
+
48
+ private configCurrency() {
49
+ this.inputNumber.currency = 'BRL';
50
+ }
51
+ }
@@ -0,0 +1,18 @@
1
+ <span class="p-float-label">
2
+ <p-password
3
+ appendTo="body"
4
+ [class]="baseInputClass"
5
+ [id]="componentId"
6
+ [(ngModel)]="value"
7
+ [disabled]="disabled"
8
+ [toggleMask]="toggleMask"
9
+ [feedback]="feedback"
10
+ [mediumRegex]="mediumRegex"
11
+ [strongRegex]="strongRegex"
12
+ (blur)="onInputBlur($event)">
13
+ </p-password>
14
+ <label [for]="componentId">{{ label }}</label>
15
+
16
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
17
+ </span>
18
+ <ng-content></ng-content>
@@ -0,0 +1,23 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { ComponentProviders } from '../../api/helpers/component-providers';
3
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-input-password',
9
+ templateUrl: './input-password.component.html',
10
+ styleUrls: ['./input-password.component.scss'],
11
+ providers: ComponentProviders(InputPasswordComponent),
12
+ })
13
+ export class InputPasswordComponent extends BaseComponentInput<string> {
14
+
15
+ @Input() feedback: boolean = false;
16
+ @Input() mediumRegex: string = '';
17
+ @Input() strongRegex: string = '';
18
+ @Input() toggleMask: boolean = true;
19
+
20
+ constructor(componentService: ComponentService) {
21
+ super(componentService);
22
+ }
23
+ }
@@ -0,0 +1,14 @@
1
+ <span class="p-float-label">
2
+ <input
3
+ pInputText
4
+ type="text"
5
+ [class]="baseInputClass"
6
+ [disabled]="disabled"
7
+ [id]="componentId"
8
+ [(ngModel)]="value"
9
+ (blur)="onInputBlur($event)">
10
+ <label [for]="componentId">{{ label }}</label>
11
+
12
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
13
+ </span>
14
+ <ng-content></ng-content>
@@ -0,0 +1,18 @@
1
+ .div-pai {
2
+ display: flex;
3
+ flex-direction: row;
4
+ column-gap: 0.25rem;
5
+ padding-right: 0;
6
+ }
7
+
8
+ .div-input {
9
+ width: 100%;
10
+ }
11
+
12
+ .div-button {
13
+ width: 20%;
14
+
15
+ button {
16
+ width: 100%;
17
+ }
18
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { ComponentProviders } from '../../api/helpers/component-providers';
3
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-input-text',
9
+ templateUrl: './input-text.component.html',
10
+ styleUrls: ['./input-text.component.scss'],
11
+ providers: ComponentProviders(InputTextComponent),
12
+ })
13
+ export class InputTextComponent extends BaseComponentInput<string> implements OnInit {
14
+ constructor(componentService: ComponentService) {
15
+ super(componentService);
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ <span class="p-float-label">
2
+ <textarea
3
+ pInputTextarea
4
+ [autoResize]="autoResize"
5
+ [class]="baseInputClass"
6
+ [cols]="cols"
7
+ [disabled]="disabled"
8
+ [id]="componentId"
9
+ [rows]="rows"
10
+ [(ngModel)]="value"
11
+ (blur)="onInputBlur($event)">
12
+ </textarea>
13
+ <label [for]="componentId">{{ label }}</label>
14
+
15
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
16
+ </span>
17
+ <ng-content></ng-content>
@@ -0,0 +1,33 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
3
+ import { ComponentProviders } from '../../api/helpers/component-providers';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-input-textarea',
9
+ templateUrl: './input-textarea.component.html',
10
+ styleUrls: ['./input-textarea.component.scss'],
11
+ providers: ComponentProviders(InputTextareaComponent),
12
+ })
13
+ export class InputTextareaComponent extends BaseComponentInput<string> implements OnInit {
14
+ @Input() multiline: boolean = false;
15
+ @Input() rows: number = 2;
16
+ @Input() cols: number = 20;
17
+ @Input() autoResize: boolean = false;
18
+ @Input() maxValueLength: number = 0;
19
+
20
+ counterValueLength: number = 0;
21
+
22
+ constructor(componentService: ComponentService) {
23
+ super(componentService);
24
+ }
25
+
26
+ override ngOnInit(): void {
27
+ super.ngOnInit();
28
+
29
+ this.formControl?.valueChanges.subscribe((value: any) => {
30
+ this.counterValueLength = value?.length;
31
+ });
32
+ }
33
+ }
@@ -0,0 +1,18 @@
1
+ <span class="p-float-label">
2
+
3
+ <p-calendar
4
+ appendTo="body"
5
+ [class]="baseInputClass"
6
+ [id]="componentId"
7
+ [(ngModel)]="value"
8
+ [disabled]="disabled"
9
+ [showIcon]="showIcon"
10
+ [showTime]="true"
11
+ [timeOnly]="true"
12
+ (onBlur)="onInputBlur($event)">
13
+ </p-calendar>
14
+ <label [for]="componentId">{{ label }}</label>
15
+
16
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
17
+ </span>
18
+ <ng-content></ng-content>
@@ -0,0 +1,20 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
3
+ import { ComponentProviders } from '../../api/helpers/component-providers';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-input-time',
9
+ templateUrl: './input-time.component.html',
10
+ styleUrls: ['./input-time.component.scss'],
11
+ providers: ComponentProviders(InputTimeComponent),
12
+ })
13
+ export class InputTimeComponent extends BaseComponentInput<string> implements OnInit {
14
+
15
+ @Input() showIcon: boolean = true;
16
+
17
+ constructor(componentService: ComponentService) {
18
+ super(componentService);
19
+ }
20
+ }
@@ -0,0 +1,53 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+ import { CheckComponent } from './check/check.component';
5
+ import { DropdownComponent } from './dropdown/dropdown.component';
6
+ import { InputCalendarComponent } from './input-calendar/input-calendar.component';
7
+ import { InputMaskComponent } from './input-mask/input-mask.component';
8
+ import { InputNumberComponent } from './input-number/input-number.component';
9
+ import { InputPasswordComponent } from './input-password/input-password.component';
10
+ import { InputTextComponent } from './input-text/input-text.component';
11
+ import { InputTextareaComponent } from './input-textarea/input-textarea.component';
12
+ import { InputTimeComponent } from './input-time/input-time.component';
13
+ import { MultiSelectComponent } from './multi-select/multi-select.component';
14
+ import { SwitchComponent } from './switch/switch.component';
15
+ import { kvErrorModule } from '../api/components/error/kverror.module';
16
+ import { PrimeNgModule } from '../api/modules/primeng.module';
17
+
18
+ @NgModule({
19
+ declarations: [
20
+ CheckComponent,
21
+ DropdownComponent,
22
+ InputCalendarComponent,
23
+ InputMaskComponent,
24
+ InputNumberComponent,
25
+ InputPasswordComponent,
26
+ InputTextComponent,
27
+ InputTextareaComponent,
28
+ InputTimeComponent,
29
+ MultiSelectComponent,
30
+ SwitchComponent,
31
+ ],
32
+ imports: [
33
+ CommonModule,
34
+ FormsModule,
35
+ kvErrorModule,
36
+ PrimeNgModule,
37
+ ReactiveFormsModule,
38
+ ],
39
+ exports: [
40
+ CheckComponent,
41
+ DropdownComponent,
42
+ InputCalendarComponent,
43
+ InputMaskComponent,
44
+ InputNumberComponent,
45
+ InputPasswordComponent,
46
+ InputTextComponent,
47
+ InputTextareaComponent,
48
+ InputTimeComponent,
49
+ MultiSelectComponent,
50
+ SwitchComponent,
51
+ ]
52
+ })
53
+ export class KvInputsModule { }
@@ -0,0 +1,21 @@
1
+ <span class="p-float-label">
2
+ <p-multiSelect
3
+ appendTo="body"
4
+ display="chip"
5
+ inputId="multiselect"
6
+ [class]="baseInputClass"
7
+ [disabled]="disabled"
8
+ [options]="options"
9
+ [optionLabel]="optionLabel"
10
+ [optionValue]="optionValue"
11
+ [filter]="filter"
12
+ [showClear]="showClear"
13
+ [(ngModel)]="value"
14
+ (onChange)="selectionChange($event)"
15
+ (onPanelHide)="panelHide($event)">
16
+ </p-multiSelect>
17
+ <label [for]="componentId">{{ label }}</label>
18
+
19
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
20
+ </span>
21
+ <ng-content></ng-content>
@@ -0,0 +1,44 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { ComponentProviders } from '../../api/helpers/component-providers';
3
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-multi-select',
9
+ templateUrl: './multi-select.component.html',
10
+ styleUrls: ['./multi-select.component.scss'],
11
+ providers: ComponentProviders(MultiSelectComponent),
12
+ })
13
+ export class MultiSelectComponent extends BaseComponentInput<any> implements OnInit {
14
+
15
+ @Input() options: any;
16
+ @Input() optionLabel!: string;
17
+ @Input() optionValue!: string;
18
+ @Input() filter: boolean = false;
19
+ @Input() showClear: boolean = false;
20
+
21
+ @Output() onSelectionChange: EventEmitter<any> = new EventEmitter();
22
+ @Output() onPanelHide: EventEmitter<any> = new EventEmitter();
23
+
24
+
25
+ constructor(componentService: ComponentService) {
26
+ super(componentService);
27
+ }
28
+
29
+ override ngOnInit(): void {
30
+ super.ngOnInit();
31
+ }
32
+
33
+ public override get baseInputClass(): string {
34
+ return `p-multiselect-sm ${this.hasError ? 'ng-invalid ng-dirty' : ''}`;
35
+ }
36
+
37
+ selectionChange(event: Event) {
38
+ this.onSelectionChange.emit(event);
39
+ }
40
+
41
+ panelHide(event: Event) {
42
+ this.onPanelHide.emit(event);
43
+ }
44
+ }
@@ -0,0 +1,11 @@
1
+ <div class="center field-checkbox">
2
+
3
+ <p-inputSwitch
4
+ [inputId]="componentId"
5
+ [(ngModel)]="value"
6
+ [disabled]="disabled">
7
+ </p-inputSwitch>
8
+ <label [for]="componentId">{{ label }}</label>
9
+
10
+ <kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
11
+ </div>
@@ -0,0 +1,3 @@
1
+ p-inputSwitch {
2
+ padding-right: 0.5rem;
3
+ }
@@ -0,0 +1,24 @@
1
+ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
2
+ import { ComponentProviders } from '../../api/helpers/component-providers';
3
+ import { BaseComponentInput } from '../../api/base-components/base-component-input';
4
+ import { ComponentService } from '../../api/services/component.service';
5
+
6
+
7
+ @Component({
8
+ selector: 'kv-switch',
9
+ templateUrl: './switch.component.html',
10
+ styleUrls: ['./switch.component.scss'],
11
+ providers: ComponentProviders(SwitchComponent),
12
+ })
13
+ export class SwitchComponent extends BaseComponentInput<boolean> implements OnInit {
14
+
15
+ @Output() onSwitchChange: EventEmitter<any> = new EventEmitter();
16
+
17
+ constructor(componentService: ComponentService) {
18
+ super(componentService);
19
+ }
20
+
21
+ emitOnSwitchChange(event: any) {
22
+ this.onSwitchChange.emit(event);
23
+ }
24
+ }