@masterkeymaterial/ui 0.0.2 → 0.0.3

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 (140) hide show
  1. package/fesm2022/masterkeymaterial-ui.mjs +6457 -0
  2. package/fesm2022/masterkeymaterial-ui.mjs.map +1 -0
  3. package/package.json +14 -5
  4. package/types/masterkeymaterial-ui.d.ts +928 -0
  5. package/ng-package.json +0 -10
  6. package/src/elements/ui-button/ui-button.css +0 -229
  7. package/src/elements/ui-button/ui-button.html +0 -12
  8. package/src/elements/ui-button/ui-button.ts +0 -133
  9. package/src/elements/ui-check-box/ui-check-box.css +0 -66
  10. package/src/elements/ui-check-box/ui-check-box.html +0 -5
  11. package/src/elements/ui-check-box/ui-check-box.ts +0 -65
  12. package/src/elements/ui-chip/ui-chip.css +0 -24
  13. package/src/elements/ui-chip/ui-chip.html +0 -3
  14. package/src/elements/ui-chip/ui-chip.ts +0 -25
  15. package/src/elements/ui-drop-zone/ui-drop-zone.css +0 -91
  16. package/src/elements/ui-drop-zone/ui-drop-zone.html +0 -8
  17. package/src/elements/ui-drop-zone/ui-drop-zone.ts +0 -153
  18. package/src/elements/ui-file-list/ui-file-list.css +0 -43
  19. package/src/elements/ui-file-list/ui-file-list.html +0 -17
  20. package/src/elements/ui-file-list/ui-file-list.ts +0 -22
  21. package/src/elements/ui-list-errors/ui-list-errors.css +0 -30
  22. package/src/elements/ui-list-errors/ui-list-errors.html +0 -10
  23. package/src/elements/ui-list-errors/ui-list-errors.ts +0 -14
  24. package/src/elements/ui-loading/ui-loading.css +0 -13
  25. package/src/elements/ui-loading/ui-loading.html +0 -1
  26. package/src/elements/ui-loading/ui-loading.ts +0 -10
  27. package/src/elements/ui-menu/ui-menu.css +0 -69
  28. package/src/elements/ui-menu/ui-menu.html +0 -20
  29. package/src/elements/ui-menu/ui-menu.ts +0 -267
  30. package/src/elements/ui-procurar/ui-procurar.css +0 -48
  31. package/src/elements/ui-procurar/ui-procurar.html +0 -14
  32. package/src/elements/ui-procurar/ui-procurar.ts +0 -82
  33. package/src/elements/ui-progress/ui-progress.css +0 -0
  34. package/src/elements/ui-progress/ui-progress.html +0 -1
  35. package/src/elements/ui-progress/ui-progress.ts +0 -15
  36. package/src/elements/ui-select/ui-select.css +0 -211
  37. package/src/elements/ui-select/ui-select.html +0 -46
  38. package/src/elements/ui-select/ui-select.ts +0 -482
  39. package/src/elements/ui-slide/ui-slide.css +0 -75
  40. package/src/elements/ui-slide/ui-slide.html +0 -7
  41. package/src/elements/ui-slide/ui-slide.ts +0 -61
  42. package/src/fields/Base/BaseFieldsForm/BaseFieldsForm.component.ts +0 -113
  43. package/src/fields/Base/BaseFieldsValues/BaseFieldsValues.ts +0 -112
  44. package/src/fields/Formulario/Formulario.ts +0 -1056
  45. package/src/fields/Formulario/form-action/form-action.css +0 -98
  46. package/src/fields/Formulario/form-action/form-action.html +0 -75
  47. package/src/fields/Formulario/form-action/form-action.ts +0 -187
  48. package/src/fields/Formulario/form-controls/form-controls.css +0 -108
  49. package/src/fields/Formulario/form-controls/form-controls.html +0 -105
  50. package/src/fields/Formulario/form-controls/form-controls.ts +0 -122
  51. package/src/fields/Formulario/form-fase/form-fase.css +0 -84
  52. package/src/fields/Formulario/form-fase/form-fase.html +0 -24
  53. package/src/fields/Formulario/form-fase/form-fase.ts +0 -157
  54. package/src/fields/Formulario/form-filter/form-filter.css +0 -50
  55. package/src/fields/Formulario/form-filter/form-filter.html +0 -25
  56. package/src/fields/Formulario/form-filter/form-filter.ts +0 -53
  57. package/src/fields/Formulario/form-no-action/form-no-action.css +0 -32
  58. package/src/fields/Formulario/form-no-action/form-no-action.html +0 -12
  59. package/src/fields/Formulario/form-no-action/form-no-action.ts +0 -21
  60. package/src/fields/Formulario/formated-values/formated-values.css +0 -104
  61. package/src/fields/Formulario/formated-values/formated-values.html +0 -15
  62. package/src/fields/Formulario/formated-values/formated-values.ts +0 -186
  63. package/src/fields/Formulario/single-values/single-values.css +0 -88
  64. package/src/fields/Formulario/single-values/single-values.html +0 -11
  65. package/src/fields/Formulario/single-values/single-values.ts +0 -65
  66. package/src/fields/autocomplete/autocomplete.css +0 -94
  67. package/src/fields/autocomplete/autocomplete.html +0 -38
  68. package/src/fields/autocomplete/autocomplete.ts +0 -294
  69. package/src/fields/button/button.css +0 -7
  70. package/src/fields/button/button.html +0 -19
  71. package/src/fields/button/button.ts +0 -38
  72. package/src/fields/checkbox/checkbox.css +0 -27
  73. package/src/fields/checkbox/checkbox.html +0 -20
  74. package/src/fields/checkbox/checkbox.ts +0 -44
  75. package/src/fields/color/CirculoColorido/circulocolorido.css +0 -50
  76. package/src/fields/color/CirculoColorido/circulocolorido.html +0 -8
  77. package/src/fields/color/CirculoColorido/circulocolorido.ts +0 -24
  78. package/src/fields/color/color.css +0 -15
  79. package/src/fields/color/color.html +0 -24
  80. package/src/fields/color/color.ts +0 -47
  81. package/src/fields/date/date.html +0 -19
  82. package/src/fields/date/date.ts +0 -29
  83. package/src/fields/datetime/datetime.html +0 -19
  84. package/src/fields/datetime/datetime.ts +0 -29
  85. package/src/fields/display/display.css +0 -7
  86. package/src/fields/display/display.html +0 -20
  87. package/src/fields/display/display.ts +0 -43
  88. package/src/fields/editor/editor.css +0 -51
  89. package/src/fields/editor/editor.html +0 -37
  90. package/src/fields/editor/editor.ts +0 -218
  91. package/src/fields/email/email.html +0 -19
  92. package/src/fields/email/email.ts +0 -29
  93. package/src/fields/fields.css +0 -180
  94. package/src/fields/generic/generic.html +0 -3
  95. package/src/fields/generic/generic.ts +0 -91
  96. package/src/fields/hidden/hidden.html +0 -3
  97. package/src/fields/hidden/hidden.ts +0 -20
  98. package/src/fields/icon/icon.css +0 -19
  99. package/src/fields/icon/icon.html +0 -27
  100. package/src/fields/icon/icon.ts +0 -31
  101. package/src/fields/multifactor/multifactor.css +0 -21
  102. package/src/fields/multifactor/multifactor.html +0 -39
  103. package/src/fields/multifactor/multifactor.ts +0 -106
  104. package/src/fields/multikv/multikv.css +0 -43
  105. package/src/fields/multikv/multikv.html +0 -47
  106. package/src/fields/multikv/multikv.ts +0 -88
  107. package/src/fields/multitext/multitext.css +0 -36
  108. package/src/fields/multitext/multitext.html +0 -38
  109. package/src/fields/multitext/multitext.ts +0 -75
  110. package/src/fields/number/number.html +0 -20
  111. package/src/fields/number/number.ts +0 -35
  112. package/src/fields/password/password.html +0 -23
  113. package/src/fields/password/password.ts +0 -37
  114. package/src/fields/search/search.css +0 -0
  115. package/src/fields/search/search.html +0 -19
  116. package/src/fields/search/search.ts +0 -54
  117. package/src/fields/select/select.css +0 -15
  118. package/src/fields/select/select.html +0 -18
  119. package/src/fields/select/select.ts +0 -52
  120. package/src/fields/slide/slide.css +0 -27
  121. package/src/fields/slide/slide.html +0 -20
  122. package/src/fields/slide/slide.ts +0 -45
  123. package/src/fields/text/text.html +0 -19
  124. package/src/fields/text/text.ts +0 -30
  125. package/src/fields/textarea/textarea.css +0 -4
  126. package/src/fields/textarea/textarea.html +0 -20
  127. package/src/fields/textarea/textarea.ts +0 -31
  128. package/src/fields/time/time.html +0 -19
  129. package/src/fields/time/time.ts +0 -29
  130. package/src/fields/upload/upload.css +0 -24
  131. package/src/fields/upload/upload.html +0 -41
  132. package/src/fields/upload/upload.ts +0 -137
  133. package/src/interfaces/interfaces.ts +0 -61
  134. package/src/public-api.ts +0 -38
  135. package/src/util/ClassOf.pipe.ts +0 -11
  136. package/src/util/JsonColorido.pipe.ts +0 -11
  137. package/src/util/util.ts +0 -2151
  138. package/tsconfig.lib.json +0 -16
  139. package/tsconfig.lib.prod.json +0 -9
  140. package/tsconfig.spec.json +0 -13
@@ -1,75 +0,0 @@
1
- import { Component, effect, OnInit } from '@angular/core';
2
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
3
- import { UiButton } from "../../elements/ui-button/ui-button";
4
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
5
-
6
- @Component({
7
- selector: 'fields-multitext',
8
- templateUrl: './multitext.html',
9
- styleUrls: ['../fields.css', './multitext.css'],
10
- imports: [UiButton, UiListErrors],
11
- })
12
- export class FieldsMultiText extends BaseFieldsForm implements OnInit {
13
-
14
- items: string[] | null = [];
15
-
16
- constructor() {
17
- super();
18
- effect(() => {
19
- const val = this.value();
20
- let empty = val === null || val === undefined || val === '';
21
- if (val && Array.isArray(val) && val.length <= 0) empty = true;
22
- // if (!Array.isArray(val)) errors = [...errors, Valide.msg.apenasLista];
23
- this.updateCampo({ empty });
24
- });
25
- }
26
-
27
- override ngOnInit() {
28
- super.ngOnInit();
29
- let value = this.value();
30
- if (value && Array.isArray(value)) this.items = value ?? [];
31
- else this.items = [];
32
- }
33
-
34
- ngAfterViewInit(): void {
35
- this.updateValue(this.items ?? [], false);
36
- }
37
-
38
- onInput(newValue: string) {
39
- this.updateValue(newValue);
40
- this.campo()?.onInput?.(this.form());
41
- this.onChangeEmit();
42
- }
43
-
44
- onClickAddItem() {
45
- let value = "";
46
- if (!this.items) this.items = [];
47
- this.items = [...this.items, value];
48
- this.updateValue(this.items);
49
- this.campo()?.onInput?.(this.form());
50
- this.onChangeEmit();
51
-
52
- setTimeout(() => {
53
- let allInputs = (document.querySelectorAll(`.FieldMultiText .input`) as NodeListOf<HTMLInputElement> | null);
54
- if (allInputs && allInputs.length > 0) {
55
- allInputs[allInputs.length - 1].focus();
56
- }
57
- }, 1);
58
- }
59
-
60
- onClickDelItem(index: number) {
61
- this.items = this.items?.filter((v, i) => i != index) ?? [];
62
- if (this.items && this.items?.length <= 0) this.items = [];
63
- this.updateValue(this.items);
64
- this.campo()?.onInput?.(this.form());
65
- this.onChangeEmit();
66
- }
67
-
68
- _onLocalInput(value: string, index: number) {
69
- if (this.items) this.items[index] = value;
70
- this.updateValue(this.items);
71
- this.campo()?.onInput?.(this.form());
72
- this.onChangeEmit();
73
- }
74
-
75
- }
@@ -1,20 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldText">
11
- <input type="number" [value]="value()" (input)="onInput($event.target.value)" (change)="onChangeEmit()"
12
- [name]="campo()?.prop" [disabled]="campo()?.disabled" [placeholder]="campo()?.placeholder ?? ''"
13
- [attr.maxLength]="campo()?.maxl" [attr.minLength]="campo()?.minl" [class]="campo()?.classe"
14
- [style]="campo()?.style" [readOnly]="campo()?.readonly ?? false" [class.outlined]="true"
15
- [class.input]="true" />
16
- </div>
17
- </div>
18
- </div>
19
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
20
- </div>
@@ -1,35 +0,0 @@
1
- import { Component, effect } from '@angular/core';
2
- import { LibUtil } from '../../util/util';
3
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
4
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
5
-
6
- @Component({
7
- selector: 'fields-number',
8
- templateUrl: './number.html',
9
- styleUrls: ['../fields.css'],
10
- imports: [UiListErrors],
11
- })
12
- export class FieldsNumber extends BaseFieldsForm {
13
-
14
- constructor() {
15
- super();
16
- effect(() => {
17
- const val = this.value();
18
- let empty = val === null || val === undefined || val === '' || val === 0;
19
- this.updateCampo({ empty });
20
- });
21
- }
22
-
23
- ngAfterViewInit(): void {
24
- this.onInput(this.value(), false);
25
- }
26
-
27
- onInput(newValue: string, touch: boolean = true) {
28
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
29
- let num = parseFloat(newValue);
30
- if (isNaN(num)) num = 0;
31
- this.updateValue(num, touch);
32
- this.campo()?.onInput?.(this.form());
33
- }
34
-
35
- }
@@ -1,23 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldPassword">
11
- <input [type]="hide() ? 'password' : 'text'" [value]="value()" (input)="onInput($event.target.value)"
12
- (change)="onChangeEmit()" [name]="campo()?.prop" [disabled]="campo()?.disabled"
13
- [placeholder]="campo()?.placeholder ?? ''" [class]="campo()?.classe" [style]="campo()?.style"
14
- [attr.maxLength]="campo()?.maxl" [attr.minLength]="campo()?.minl" [class.outlined]="true"
15
- [class.input]="true" />
16
- <ui-button tipo="icon" tema="primary" (click)="_aoClicarVerSenha($event)" aria-label="Oculta ou Exibe Senha"
17
- title="Oculta ou Exibe Senha" [aria-pressed]="hide()"><i
18
- [class]="hide() ? 'bi bi-eye-slash-fill' : 'bi bi-eye-fill'"></i></ui-button>
19
- </div>
20
- </div>
21
- </div>
22
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
23
- </div>
@@ -1,37 +0,0 @@
1
- import { Component, effect, signal } from '@angular/core';
2
- import { LibUtil } from '../../util/util';
3
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
4
- import { UiButton } from "../../elements/ui-button/ui-button";
5
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
6
-
7
- @Component({
8
- selector: 'fields-password',
9
- templateUrl: './password.html',
10
- styleUrls: ['../fields.css'],
11
- imports: [UiButton, UiListErrors],
12
- })
13
- export class FieldsPassword extends BaseFieldsForm {
14
-
15
- constructor() {
16
- super();
17
- effect(() => {
18
- const val = this.value();
19
- let empty = val === null || val === undefined || val === '';
20
- this.updateCampo({ empty });
21
- });
22
- }
23
-
24
- onInput(newValue: string) {
25
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
26
- this.updateValue(newValue);
27
- this.campo()?.onInput?.(this.form());
28
- }
29
-
30
- // Exibir e Ocultar Senha
31
- hide = signal(true);
32
- _aoClicarVerSenha(event: MouseEvent) {
33
- this.hide.set(!this.hide());
34
- event.stopPropagation();
35
- }
36
- }
37
-
File without changes
@@ -1,19 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty"
4
- [class.isCollapsed]="isCollapsed()">
5
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
6
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
7
- {{ campo()?.titulo }}
8
- </div>
9
- <div class="fieldControl doCampo">
10
- <div class="fieldEffect">
11
- <div class="fieldField FieldSearch">
12
- <ui-procurar [value]="value()" [name]="campo()?.prop" (inputed)="onInput($event)" (changed)="onChangeEmit()"
13
- [colapsed]="isCollapsed()" [disabled]="campo()?.disabled"
14
- [placeholder]="campo()?.placeholder ?? 'Procurar...'"></ui-procurar>
15
- </div>
16
- </div>
17
- </div>
18
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
19
- </div>
@@ -1,54 +0,0 @@
1
- import { Component, computed, effect, ElementRef, viewChild } from '@angular/core';
2
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
3
- import { UiProcurar } from "../../elements/ui-procurar/ui-procurar";
4
- import { LibUtil } from '../../util/util';
5
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
6
-
7
- @Component({
8
- selector: 'fields-search',
9
- templateUrl: './search.html',
10
- styleUrls: ['../fields.css', './search.css'],
11
- imports: [UiListErrors, UiProcurar],
12
- })
13
- export class FieldsSearch extends BaseFieldsForm {
14
-
15
- readonly searchInput = viewChild<ElementRef>('searchInput');
16
-
17
- isCollapsed = computed(() => this.campo()?.isCollapsed?.() ?? false);
18
-
19
- constructor() {
20
- super();
21
- effect(() => {
22
- const val = this.value();
23
- let empty = val === null || val === undefined || val === '';
24
- this.updateCampo({ empty });
25
- });
26
- }
27
-
28
- onInput(newValue: string) {
29
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
30
- this.updateValue(newValue);
31
- this.campo()?.onInput?.(this.form());
32
- }
33
-
34
- // Limpa o filtro de opções
35
- onClearSearch() {
36
- this.updateValue("");
37
- this.focusSearchInput();
38
- this.campo()?.onInput?.(this.form());
39
- this.onChangeEmit();
40
- }
41
-
42
- focusSearchInput() {
43
- this.searchInput()?.nativeElement?.focus();
44
- }
45
-
46
- onClickSearchIcon() {
47
- this.focusSearchInput();
48
- this.onChangeEmit();
49
- }
50
-
51
- onSearch() {
52
- this.onChangeEmit();
53
- }
54
- }
@@ -1,15 +0,0 @@
1
- .FieldSelect {
2
- width: 100%;
3
- padding: 0 4px 0 8px;
4
- }
5
-
6
- .FieldSelect ui-select {
7
- width: 100%;
8
- display: flex;
9
- justify-content: center;
10
- align-items: center;
11
- }
12
-
13
- .fieldField:has(ui-select.opened) {
14
- outline: 2px solid var(--campoCor);
15
- }
@@ -1,18 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldSelect">
11
- <ui-select [value]="this.value()" [options]="fieldOptions()" (changed)="onChange($event)"
12
- [multiple]="this.campo()?.multiple ?? false" [name]="this.campo()?.prop" [textEmpty]="this.campo()?.textEmpty"
13
- [canUnselect]="campo()?.canUnselect"></ui-select>
14
- </div>
15
- </div>
16
- </div>
17
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
18
- </div>
@@ -1,52 +0,0 @@
1
- import { Component, computed, effect, OnInit, signal } from '@angular/core';
2
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
3
- import { UiSelect } from '../../elements/ui-select/ui-select';
4
- import { IOptionValue } from '../../elements/ui-select/ui-select';
5
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
6
- import { LOG } from '../../util/util';
7
-
8
-
9
- @Component({
10
- selector: 'fields-select',
11
- templateUrl: './select.html',
12
- styleUrls: ['../fields.css', './select.css'],
13
- imports: [UiSelect, UiListErrors],
14
- })
15
- export class FieldsSelect extends BaseFieldsForm {
16
-
17
-
18
- constructor() {
19
- super();
20
- effect(() => {
21
- const val = this.value();
22
- let empty = val === null || val === undefined || val === '';
23
- this.updateCampo({ empty });
24
- });
25
- }
26
- // Um Refill pode estar em andamento enquanto este componente é iniciado.
27
- // Utilize o campo.mapear ou campo.refill para alterar o comportamento do refill inicial.
28
-
29
-
30
- fieldOptions = computed(() => {
31
- return this.campo()?.options?.() ?? [];
32
- });
33
-
34
-
35
- // Manipula mudança de valor (valueOfK não chegará nulo ou undefined)
36
- onChange(optionValue: IOptionValue) {
37
- let newValue: any = optionValue.keys;
38
-
39
- if (this.campo()?.onMatchOption && optionValue.optionChanged) {
40
- try {
41
- this.campo()?.onMatchOption?.(this.form(), optionValue.optionChanged);
42
- } catch (err) {
43
- LOG(1, `❌ Erro ao executar onMatchOption do campo '${this.name()}'`, err);
44
- }
45
- }
46
-
47
- this.updateValue(newValue);
48
- this.campo()?.onInput?.(this.form());
49
- this.onChangeEmit();
50
- }
51
-
52
- }
@@ -1,27 +0,0 @@
1
- .FieldSlide {
2
- padding-left: 4px;
3
- display: flex;
4
- flex-wrap: nowrap;
5
- align-items: center;
6
- transition: outline 0s;
7
- transition-delay: 0.2s;
8
- }
9
-
10
- .tituloClicavel {
11
- display: flex;
12
- align-items: center;
13
- padding-left: 8px;
14
- padding-right: 8px;
15
- font-size: 0.875rem;
16
- cursor: pointer;
17
- user-select: none;
18
- flex: 1;
19
- line-height: 30px;
20
- text-align: var(--ui-text-align, center);
21
- }
22
-
23
- .FieldSlide:has(ui-slide.focused) {
24
- outline: 2px solid var(--sys-primary);
25
- transition: outline 0s;
26
-
27
- }
@@ -1,20 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldSlide microPos4">
11
- <ui-slide [value]="value()" (changed)="onChange($event)" [focus]="signalFocus()"></ui-slide>
12
- <div class="tituloClicavel" (click)="toogleAtivo()">
13
- {{ value() ? (campo()?.textoAtivo ?? campo()?.tituloClicavel ) : (campo()?.textoInativo ??
14
- campo()?.tituloClicavel) }}
15
- </div>
16
- </div>
17
- </div>
18
- </div>
19
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
20
- </div>
@@ -1,45 +0,0 @@
1
- import { AfterViewInit, Component, effect, signal } from '@angular/core';
2
- import { UiSlide } from '../../elements/ui-slide/ui-slide';
3
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
4
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
5
-
6
- @Component({
7
- selector: 'fields-slide',
8
- templateUrl: './slide.html',
9
- styleUrls: ['../fields.css', './slide.css'],
10
- imports: [UiSlide, UiListErrors],
11
- })
12
- export class FieldsSlide extends BaseFieldsForm implements AfterViewInit {
13
-
14
- signalFocus = signal<boolean>(false);
15
-
16
- constructor() {
17
- super();
18
- effect(() => {
19
- const val = this.value();
20
- let empty = val === null || val === undefined || val === '';
21
- this.updateCampo({ empty });
22
- });
23
- }
24
-
25
- onChange(newValue: boolean) {
26
- this.updateValue(newValue);
27
- this.campo()?.onInput?.(this.form());
28
- this.onChangeEmit();
29
- }
30
-
31
- ngAfterViewInit(): void {
32
- let val = this.value();
33
- this.updateValue(val === true || val === 'true' || val === 1 || val === '1', false);
34
- }
35
-
36
- toogleAtivo() {
37
- this.onChange(!this.value());
38
- this.signalFocus.set(true);
39
- setTimeout(() => {
40
- this.signalFocus.set(false);
41
- }, 1)
42
- }
43
-
44
-
45
- }
@@ -1,19 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldText">
11
- <input type="text" [value]="value() ?? ''" (input)="onInput($event.target.value)" (change)="onChangeEmit()"
12
- [name]="campo()?.prop" [disabled]="campo()?.disabled" [placeholder]="campo()?.placeholder ?? ''"
13
- [attr.maxLength]="campo()?.maxl" [attr.minLength]="campo()?.minl" [class]="campo()?.classe"
14
- [style]="campo()?.style" [class.outlined]="true" [class.input]="true" />
15
- </div>
16
- </div>
17
- </div>
18
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
19
- </div>
@@ -1,30 +0,0 @@
1
- import { Component, effect } from '@angular/core';
2
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
3
- import { LibUtil } from '../../util/util';
4
- import { UiListErrors } from '../../elements/ui-list-errors/ui-list-errors';
5
-
6
- @Component({
7
- selector: 'fields-text',
8
- templateUrl: './text.html',
9
- styleUrls: ['../fields.css'],
10
- imports: [UiListErrors]
11
- })
12
- export class FieldsText extends BaseFieldsForm {
13
-
14
- constructor() {
15
- super();
16
- effect(() => {
17
- const val = this.value();
18
- let empty = val === null || val === undefined || val === '';
19
- this.updateCampo({ empty });
20
- });
21
- }
22
-
23
- onInput(newValue: string) {
24
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
25
- this.updateValue(newValue);
26
- this.campo()?.onInput?.(this.form());
27
-
28
- }
29
-
30
- }
@@ -1,4 +0,0 @@
1
- .FieldTextArea {
2
- padding: 0.5rem 0;
3
- line-height: 22px;
4
- }
@@ -1,20 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldTextArea">
11
- <textarea [value]="value()" (input)="onInput($event)" (change)="onChangeEmit()" [name]="campo()?.prop"
12
- [disabled]="campo()?.disabled" [placeholder]="campo()?.placeholder ?? ''" [attr.maxLength]="campo()?.maxl"
13
- [attr.minLength]="campo()?.minl" [class]="campo()?.classe" [style]="campo()?.style" [class.outlined]="true"
14
- [rows]="campo()?.rows ?? 5" [cols]="campo()?.cols" [attr.readonly]="campo()?.readonly ? true : null"
15
- [class.input]="true"></textarea>
16
- </div>
17
- </div>
18
- </div>
19
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
20
- </div>
@@ -1,31 +0,0 @@
1
- import { Component, effect } from '@angular/core';
2
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
3
- import { LibUtil } from '../../util/util';
4
- import { UiListErrors } from '../../elements/ui-list-errors/ui-list-errors';
5
-
6
- @Component({
7
- selector: 'fields-textarea',
8
- templateUrl: './textarea.html',
9
- styleUrls: ['../fields.css', './textarea.css'],
10
- imports: [UiListErrors]
11
- })
12
- export class FieldsTextarea extends BaseFieldsForm {
13
-
14
- constructor() {
15
- super();
16
- effect(() => {
17
- const val = this.value();
18
- let empty = val === null || val === undefined || val === '';
19
- this.updateCampo({ empty });
20
- });
21
- }
22
-
23
- onInput(event: Event) {
24
- let newValue = (event.target as HTMLTextAreaElement).value;
25
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
26
- this.updateValue(newValue);
27
- this.campo()?.onInput?.(this.form());
28
-
29
- }
30
-
31
- }
@@ -1,19 +0,0 @@
1
- <div class="fieldContainer" [class.isTouched]="campo()?.touched" [class.showTouched]="form().showTouched()"
2
- [class.isInvalid]="campo()?.invalid" [class.isDisabled]="campo()?.disabled" [class.isReadonly]="campo()?.readonly"
3
- [class.isNeed]="campo()?.need" [class.isPending]="campo()?.pending" [class.isEmpty]="campo()?.empty">
4
- <div class="fieldLabel" (click)="onClickLabel()" [class.hideLabel]="campo()?.hideLabel">
5
- @if(campo()?.icone){ <div class="fieldIcon"><i [class]="campo()?.icone"></i></div> }
6
- {{ campo()?.titulo }}
7
- </div>
8
- <div class="fieldControl doCampo">
9
- <div class="fieldEffect">
10
- <div class="fieldField FieldTime">
11
- <input type="time" [value]="value()" (input)="onInput($event.target.value)" (change)="onChangeEmit()"
12
- [name]="campo()?.prop" [disabled]="campo()?.disabled" [placeholder]="campo()?.placeholder ?? ''"
13
- [attr.maxLength]="campo()?.maxl" [attr.minLength]="campo()?.minl" [class]="campo()?.classe"
14
- [style]="campo()?.style" [class.outlined]="true" [class.input]="true" />
15
- </div>
16
- </div>
17
- </div>
18
- <ui-list-errors [errors]="campo()?.errors" [dica]="campo()?.dica" [show]="campo()?.touched"></ui-list-errors>
19
- </div>
@@ -1,29 +0,0 @@
1
- import { Component, effect } from '@angular/core';
2
- import { LibUtil } from '../../util/util';
3
- import { BaseFieldsForm } from '../Base/BaseFieldsForm/BaseFieldsForm.component';
4
- import { UiListErrors } from "../../elements/ui-list-errors/ui-list-errors";
5
-
6
- @Component({
7
- selector: 'fields-time',
8
- templateUrl: './time.html',
9
- styleUrls: ['../fields.css'],
10
- imports: [UiListErrors],
11
- })
12
- export class FieldsTime extends BaseFieldsForm {
13
-
14
- constructor() {
15
- super();
16
- effect(() => {
17
- const val = this.value();
18
- let empty = val === null || val === undefined || val === '';
19
- this.updateCampo({ empty });
20
- });
21
- }
22
-
23
- onInput(newValue: string) {
24
- if (this.campo()?.mask) newValue = LibUtil.mascarar(newValue, this.campo()?.mask) ?? '';
25
- this.updateValue(newValue);
26
- this.campo()?.onInput?.(this.form());
27
- }
28
-
29
- }
@@ -1,24 +0,0 @@
1
- .FieldUpload:has(ui-drop-zone) {
2
- outline: none;
3
- border: 0;
4
- }
5
-
6
- .fieldDidplayUpload {
7
- display: flex;
8
- flex-direction: column;
9
- align-items: center;
10
- justify-content: center;
11
- width: 100%;
12
- gap: 10px;
13
- }
14
-
15
- .fieldDidplayUpload i {
16
- font-size: 48px;
17
- }
18
-
19
- .dica {
20
- margin-top: 4px;
21
- font-size: 12px;
22
- filter: grayscale();
23
- opacity: 0.7;
24
- }