@masterkeymaterial/ui 0.0.1 → 0.0.2

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 (141) hide show
  1. package/README.md +9 -59
  2. package/ng-package.json +10 -0
  3. package/package.json +5 -14
  4. package/src/elements/ui-button/ui-button.css +229 -0
  5. package/src/elements/ui-button/ui-button.html +12 -0
  6. package/src/elements/ui-button/ui-button.ts +133 -0
  7. package/src/elements/ui-check-box/ui-check-box.css +66 -0
  8. package/src/elements/ui-check-box/ui-check-box.html +5 -0
  9. package/src/elements/ui-check-box/ui-check-box.ts +65 -0
  10. package/src/elements/ui-chip/ui-chip.css +24 -0
  11. package/src/elements/ui-chip/ui-chip.html +3 -0
  12. package/src/elements/ui-chip/ui-chip.ts +25 -0
  13. package/src/elements/ui-drop-zone/ui-drop-zone.css +91 -0
  14. package/src/elements/ui-drop-zone/ui-drop-zone.html +8 -0
  15. package/src/elements/ui-drop-zone/ui-drop-zone.ts +153 -0
  16. package/src/elements/ui-file-list/ui-file-list.css +43 -0
  17. package/src/elements/ui-file-list/ui-file-list.html +17 -0
  18. package/src/elements/ui-file-list/ui-file-list.ts +22 -0
  19. package/src/elements/ui-list-errors/ui-list-errors.css +30 -0
  20. package/src/elements/ui-list-errors/ui-list-errors.html +10 -0
  21. package/src/elements/ui-list-errors/ui-list-errors.ts +14 -0
  22. package/src/elements/ui-loading/ui-loading.css +13 -0
  23. package/src/elements/ui-loading/ui-loading.html +1 -0
  24. package/src/elements/ui-loading/ui-loading.ts +10 -0
  25. package/src/elements/ui-menu/ui-menu.css +69 -0
  26. package/src/elements/ui-menu/ui-menu.html +20 -0
  27. package/src/elements/ui-menu/ui-menu.ts +267 -0
  28. package/src/elements/ui-procurar/ui-procurar.css +48 -0
  29. package/src/elements/ui-procurar/ui-procurar.html +14 -0
  30. package/src/elements/ui-procurar/ui-procurar.ts +82 -0
  31. package/src/elements/ui-progress/ui-progress.css +0 -0
  32. package/src/elements/ui-progress/ui-progress.html +1 -0
  33. package/src/elements/ui-progress/ui-progress.ts +15 -0
  34. package/src/elements/ui-select/ui-select.css +211 -0
  35. package/src/elements/ui-select/ui-select.html +46 -0
  36. package/src/elements/ui-select/ui-select.ts +482 -0
  37. package/src/elements/ui-slide/ui-slide.css +75 -0
  38. package/src/elements/ui-slide/ui-slide.html +7 -0
  39. package/src/elements/ui-slide/ui-slide.ts +61 -0
  40. package/src/fields/Base/BaseFieldsForm/BaseFieldsForm.component.ts +113 -0
  41. package/src/fields/Base/BaseFieldsValues/BaseFieldsValues.ts +112 -0
  42. package/src/fields/Formulario/Formulario.ts +1056 -0
  43. package/src/fields/Formulario/form-action/form-action.css +98 -0
  44. package/src/fields/Formulario/form-action/form-action.html +75 -0
  45. package/src/fields/Formulario/form-action/form-action.ts +187 -0
  46. package/src/fields/Formulario/form-controls/form-controls.css +108 -0
  47. package/src/fields/Formulario/form-controls/form-controls.html +105 -0
  48. package/src/fields/Formulario/form-controls/form-controls.ts +122 -0
  49. package/src/fields/Formulario/form-fase/form-fase.css +84 -0
  50. package/src/fields/Formulario/form-fase/form-fase.html +24 -0
  51. package/src/fields/Formulario/form-fase/form-fase.ts +157 -0
  52. package/src/fields/Formulario/form-filter/form-filter.css +50 -0
  53. package/src/fields/Formulario/form-filter/form-filter.html +25 -0
  54. package/src/fields/Formulario/form-filter/form-filter.ts +53 -0
  55. package/src/fields/Formulario/form-no-action/form-no-action.css +32 -0
  56. package/src/fields/Formulario/form-no-action/form-no-action.html +12 -0
  57. package/src/fields/Formulario/form-no-action/form-no-action.ts +21 -0
  58. package/src/fields/Formulario/formated-values/formated-values.css +104 -0
  59. package/src/fields/Formulario/formated-values/formated-values.html +15 -0
  60. package/src/fields/Formulario/formated-values/formated-values.ts +186 -0
  61. package/src/fields/Formulario/single-values/single-values.css +88 -0
  62. package/src/fields/Formulario/single-values/single-values.html +11 -0
  63. package/src/fields/Formulario/single-values/single-values.ts +65 -0
  64. package/src/fields/autocomplete/autocomplete.css +94 -0
  65. package/src/fields/autocomplete/autocomplete.html +38 -0
  66. package/src/fields/autocomplete/autocomplete.ts +294 -0
  67. package/src/fields/button/button.css +7 -0
  68. package/src/fields/button/button.html +19 -0
  69. package/src/fields/button/button.ts +38 -0
  70. package/src/fields/checkbox/checkbox.css +27 -0
  71. package/src/fields/checkbox/checkbox.html +20 -0
  72. package/src/fields/checkbox/checkbox.ts +44 -0
  73. package/src/fields/color/CirculoColorido/circulocolorido.css +50 -0
  74. package/src/fields/color/CirculoColorido/circulocolorido.html +8 -0
  75. package/src/fields/color/CirculoColorido/circulocolorido.ts +24 -0
  76. package/src/fields/color/color.css +15 -0
  77. package/src/fields/color/color.html +24 -0
  78. package/src/fields/color/color.ts +47 -0
  79. package/src/fields/date/date.html +19 -0
  80. package/src/fields/date/date.ts +29 -0
  81. package/src/fields/datetime/datetime.html +19 -0
  82. package/src/fields/datetime/datetime.ts +29 -0
  83. package/src/fields/display/display.css +7 -0
  84. package/src/fields/display/display.html +20 -0
  85. package/src/fields/display/display.ts +43 -0
  86. package/src/fields/editor/editor.css +51 -0
  87. package/src/fields/editor/editor.html +37 -0
  88. package/src/fields/editor/editor.ts +218 -0
  89. package/src/fields/email/email.html +19 -0
  90. package/src/fields/email/email.ts +29 -0
  91. package/src/fields/fields.css +180 -0
  92. package/src/fields/generic/generic.html +3 -0
  93. package/src/fields/generic/generic.ts +91 -0
  94. package/src/fields/hidden/hidden.html +3 -0
  95. package/src/fields/hidden/hidden.ts +20 -0
  96. package/src/fields/icon/icon.css +19 -0
  97. package/src/fields/icon/icon.html +27 -0
  98. package/src/fields/icon/icon.ts +31 -0
  99. package/src/fields/multifactor/multifactor.css +21 -0
  100. package/src/fields/multifactor/multifactor.html +39 -0
  101. package/src/fields/multifactor/multifactor.ts +106 -0
  102. package/src/fields/multikv/multikv.css +43 -0
  103. package/src/fields/multikv/multikv.html +47 -0
  104. package/src/fields/multikv/multikv.ts +88 -0
  105. package/src/fields/multitext/multitext.css +36 -0
  106. package/src/fields/multitext/multitext.html +38 -0
  107. package/src/fields/multitext/multitext.ts +75 -0
  108. package/src/fields/number/number.html +20 -0
  109. package/src/fields/number/number.ts +35 -0
  110. package/src/fields/password/password.html +23 -0
  111. package/src/fields/password/password.ts +37 -0
  112. package/src/fields/search/search.css +0 -0
  113. package/src/fields/search/search.html +19 -0
  114. package/src/fields/search/search.ts +54 -0
  115. package/src/fields/select/select.css +15 -0
  116. package/src/fields/select/select.html +18 -0
  117. package/src/fields/select/select.ts +52 -0
  118. package/src/fields/slide/slide.css +27 -0
  119. package/src/fields/slide/slide.html +20 -0
  120. package/src/fields/slide/slide.ts +45 -0
  121. package/src/fields/text/text.html +19 -0
  122. package/src/fields/text/text.ts +30 -0
  123. package/src/fields/textarea/textarea.css +4 -0
  124. package/src/fields/textarea/textarea.html +20 -0
  125. package/src/fields/textarea/textarea.ts +31 -0
  126. package/src/fields/time/time.html +19 -0
  127. package/src/fields/time/time.ts +29 -0
  128. package/src/fields/upload/upload.css +24 -0
  129. package/src/fields/upload/upload.html +41 -0
  130. package/src/fields/upload/upload.ts +137 -0
  131. package/src/interfaces/interfaces.ts +61 -0
  132. package/src/public-api.ts +38 -0
  133. package/src/util/ClassOf.pipe.ts +11 -0
  134. package/src/util/JsonColorido.pipe.ts +11 -0
  135. package/src/util/util.ts +2151 -0
  136. package/tsconfig.lib.json +16 -0
  137. package/tsconfig.lib.prod.json +9 -0
  138. package/tsconfig.spec.json +13 -0
  139. package/fesm2022/masterkeymaterial-ui.mjs +0 -6457
  140. package/fesm2022/masterkeymaterial-ui.mjs.map +0 -1
  141. package/types/masterkeymaterial-ui.d.ts +0 -928
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @masterkeymaterial/ui
2
2
 
3
- Biblioteca Angular com componentes de UI e campos de formulario reutilizaveis para montar formularios dinamicos.
3
+ Guia de instalacao para consumidores da biblioteca.
4
4
 
5
5
  ## Instalacao
6
6
 
@@ -8,76 +8,26 @@ Biblioteca Angular com componentes de UI e campos de formulario reutilizaveis pa
8
8
  npm install @masterkeymaterial/ui
9
9
  ```
10
10
 
11
- ## Peer Dependencies
11
+ ## Pre-requisitos
12
12
 
13
- Esta biblioteca depende das versoes abaixo no projeto consumidor:
13
+ Projeto consumidor com:
14
14
 
15
15
  ```json
16
16
  {
17
- "@angular/common": "^21.2.0",
18
- "@angular/core": "^21.2.0",
19
- "@angular/platform-browser": "^21.2.0"
17
+ "@angular/common": "^21.2.0",
18
+ "@angular/core": "^21.2.0",
19
+ "@angular/platform-browser": "^21.2.0"
20
20
  }
21
21
  ```
22
22
 
23
- ## Uso Rapido
23
+ ## Verificacao Rapida
24
24
 
25
- Exemplo de uso com componente standalone:
26
-
27
- ```ts
28
- import { Component } from '@angular/core';
29
- import { UiButton } from '@masterkeymaterial/ui';
30
-
31
- @Component({
32
- selector: 'app-root',
33
- standalone: true,
34
- imports: [UiButton],
35
- template: `
36
- <lib-ui-button
37
- [label]="'Salvar'"
38
- [tema]="'primario'"
39
- />
40
- `
41
- })
42
- export class AppComponent {}
43
- ```
44
-
45
- ## Build Da Biblioteca
46
-
47
- ```bash
48
- ng build MasterKeyMaterial --configuration production
49
- ```
50
-
51
- O artefato e gerado em `dist/master-key-material`.
52
-
53
- ## Publicacao No npm
54
-
55
- Com login valido no npm e permissao na org `masterkeymaterial`:
25
+ Depois da instalacao:
56
26
 
57
27
  ```bash
58
- npm publish dist/master-key-material --access public
28
+ npm ls @masterkeymaterial/ui
59
29
  ```
60
30
 
61
- Para testar antes de publicar:
62
-
63
- ```bash
64
- npm publish dist/master-key-material --dry-run
65
- ```
66
-
67
- ## Superficie Publica
68
-
69
- A API publica desta biblioteca e definida em `src/public-api.ts` e inclui:
70
-
71
- - Tipos e interfaces como `IKV`, `IKV_ext`, `IFileMetadata`, `ITipoBotao`, `ITiposTema`.
72
- - Utilitarios e base de formularios (`util`, `Formulario`, `BaseFieldsValues`, `BaseFieldsForm`).
73
- - Elementos de UI (`ui-button`, `ui-chip`, `ui-drop-zone`, `ui-file-list`, `ui-select`, `ui-procurar`, `ui-progress`, `ui-slide`, `ui-check-box`, `ui-list-errors`, `ui-loading`, `ui-menu`).
74
- - Componentes de formulario (`form-filter`, `form-action`, `form-no-action`, `formated-values`, `single-values`, `generic`).
75
-
76
- ## Compatibilidade
77
-
78
- - Angular 21.x
79
- - Node.js 18+ recomendado
80
-
81
31
  ## Licenca
82
32
 
83
33
  MIT
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/master-key-material",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "allowedNonPeerDependencies": [
8
+ "@floating-ui/dom"
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterkeymaterial/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Biblioteca Angular de componentes UI e campos de formulario reutilizaveis para construir formularios dinamicos.",
5
5
  "keywords": [
6
6
  "angular",
@@ -22,20 +22,11 @@
22
22
  "@floating-ui/dom": "^1.7.6",
23
23
  "tslib": "^2.3.0"
24
24
  },
25
+ "devDependencies": {
26
+ "typescript": "~5.9.2"
27
+ },
25
28
  "publishConfig": {
26
29
  "access": "public"
27
30
  },
28
- "sideEffects": false,
29
- "module": "fesm2022/masterkeymaterial-ui.mjs",
30
- "typings": "types/masterkeymaterial-ui.d.ts",
31
- "exports": {
32
- "./package.json": {
33
- "default": "./package.json"
34
- },
35
- ".": {
36
- "types": "./types/masterkeymaterial-ui.d.ts",
37
- "default": "./fesm2022/masterkeymaterial-ui.mjs"
38
- }
39
- },
40
- "type": "module"
31
+ "sideEffects": false
41
32
  }
@@ -0,0 +1,229 @@
1
+ :host {
2
+ display: block;
3
+ user-select: none;
4
+ }
5
+
6
+ button {
7
+ width: var(--ui-width, 100%);
8
+ height: var(--ui-height, 40px);
9
+ min-height: var(--ui-min-height, auto);
10
+ display: var(--ui-display, flex);
11
+ flex-direction: var(--ui-flex-direction, row);
12
+ justify-content: var(--ui-justify-content, center);
13
+ align-items: var(--ui-align-items, center);
14
+ background-color: var(--ui-background, var(--sys-background));
15
+ color: var(--ui-on-background, var(--sys-on-background));
16
+ border-radius: var(--ui-border-radius, var(--MasterRadius, 15px));
17
+ gap: var(--ui-gap, 0.5rem);
18
+ text-align: var(--ui-text-align, center);
19
+ font-size: var(--ui-font-size, 14px);
20
+ cursor: pointer;
21
+ text-decoration: none;
22
+ border: none;
23
+ position: relative;
24
+ padding: var(--ui-padding, 0 16px);
25
+ outline: 1px solid var(--ui-outline-color, transparent);
26
+ outline-offset: var(--ui-outline-offset, -1px);
27
+ margin: var(--ui-margin, 0);
28
+ --button-transparency: var(--ui-effect-color, light-dark(#00000025, #ffffff25));
29
+ }
30
+
31
+ button.radiusTabFormat {
32
+ border-radius: var(--MasterRadius, 15px) var(--MasterRadius, 15px) 0 0;
33
+ }
34
+
35
+ /* TODOS HOVER */
36
+ button:hover,
37
+ button:focus-visible {
38
+ filter: brightness(1.1) saturate(1.1);
39
+ }
40
+
41
+ button.icon:hover,
42
+ button.nofill:hover,
43
+ button.outlined:hover,
44
+ button.menu-item:hover,
45
+ button.menu-item-category:hover,
46
+ button.sidebar-item:hover,
47
+ button.sidebar-item-category:hover,
48
+ button.big:hover,
49
+ button.big:focus-visible,
50
+ button.icon:focus-visible,
51
+ button.nofill:focus-visible {
52
+ background-color: color-mix(in srgb, var(--btnr-corFundo, hsl(0 0 50)) 10%, transparent 90%);
53
+ }
54
+
55
+ .expandedClick:hover {
56
+ cursor: pointer;
57
+ }
58
+
59
+ /* FIM DOS HOVER */
60
+
61
+ button.fill {
62
+ background-color: var(--btnr-corFundo, var(--sys-background));
63
+ color: var(--btnr-corFrente, var(--sys-on-background));
64
+ --ui-cor-icone: var(--btnr-corFrente, var(--sys-on-background));
65
+ }
66
+
67
+ button.nofill {
68
+ background-color: var(--ui-background, transparent);
69
+ color: var(--ui-on-background, var(--btnr-corFundo, var(--sys-on-background)));
70
+ }
71
+
72
+ button.icon {
73
+ background-color: transparent;
74
+ --ui-cor-icone: var(--ui-on-background, var(--btnr-corFundo));
75
+ /* color: var(--ui-on-background, var(--btnr-corFundo)); */
76
+ height: var(--ui-height, 100%);
77
+ min-width: 36px;
78
+ aspect-ratio: 1 / 1;
79
+ padding: 0;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ }
84
+
85
+ button.outlined {
86
+ outline: 1px solid var(--ui-outline-color, var(--sys-outline));
87
+ color: var(--btnr-corFundo);
88
+ background-color: transparent;
89
+ }
90
+
91
+ button.menu-item {
92
+ color: var(--ui-color, var(--sys-on-background));
93
+ background-color: transparent;
94
+ border-radius: 0px;
95
+ padding: var(--ui-padding, 0 16px);
96
+ height: var(--ui-height, auto);
97
+ min-height: var(--ui-min-height, 40px);
98
+ justify-content: var(--ui-justify-content, flex-start);
99
+ }
100
+
101
+ button.menu-item-category {
102
+ color: var(--ui-color, var(--sys-on-background));
103
+ background-color: transparent;
104
+ border-radius: 0px;
105
+ padding: var(--ui-padding, 0 16px);
106
+ height: var(--ui-height, auto);
107
+ min-height: var(--ui-min-height, 40px);
108
+ justify-content: var(--ui-justify-content, flex-start);
109
+ }
110
+
111
+ button.raised {
112
+ color: var(--btnr-corFundo);
113
+ background-color: color-mix(in srgb, var(--sys-background) 40%, transparent 60%);
114
+ box-shadow:
115
+ 2px 2px 4px var(--button-transparency),
116
+ inset -1px -1px 1px var(--button-transparency);
117
+ }
118
+
119
+ button.big {
120
+ background-color: transparent;
121
+ color: var(--btnr-corFundo);
122
+ height: var(--ui-height, 100%);
123
+ padding: var(--ui-padding, 10px);
124
+ }
125
+
126
+ button.sidebar-item {
127
+ color: var(--ui-color, var(--sys-on-background));
128
+ background-color: transparent;
129
+ border-radius: 0px;
130
+ padding: var(--ui-padding, 0 16px);
131
+ height: var(--ui-height, auto);
132
+ min-height: var(--ui-min-height, 40px);
133
+ justify-content: var(--ui-justify-content, flex-start);
134
+ border-top-right-radius: var(--MasterRadius);
135
+ border-bottom-right-radius: var(--MasterRadius);
136
+ transition: all 0.3s;
137
+ outline: none;
138
+ }
139
+
140
+ button.sidebar-item-category {
141
+ color: var(--ui-color, var(--sys-on-background));
142
+ background-color: transparent;
143
+ border-radius: 0px;
144
+ padding: var(--ui-padding, 0 16px);
145
+ height: var(--ui-height, auto);
146
+ min-height: var(--ui-min-height, 40px);
147
+ justify-content: var(--ui-justify-content, flex-start);
148
+ border-top-right-radius: var(--MasterRadius);
149
+ border-bottom-right-radius: var(--MasterRadius);
150
+ transition: all 0.3s;
151
+ outline: none;
152
+ }
153
+
154
+
155
+
156
+ .ripple {
157
+ position: absolute;
158
+ border-radius: 50%;
159
+ background: var(--button-transparency);
160
+ transform: scale(0);
161
+ animation: ripple-animation 0.7s ease-out;
162
+ pointer-events: none;
163
+ z-index: 2;
164
+ }
165
+
166
+ @keyframes ripple-animation {
167
+ to {
168
+ transform: scale(1.4);
169
+ opacity: 0;
170
+ }
171
+ }
172
+
173
+ .expandedClick {
174
+ position: absolute;
175
+ top: 0;
176
+ left: 0;
177
+ width: 100%;
178
+ height: 100%;
179
+ z-index: 2;
180
+ overflow: hidden;
181
+ border-radius: inherit;
182
+ /* background-color: red; */
183
+ }
184
+
185
+
186
+ .icon .expandedClick {
187
+ transform: scale(1.1);
188
+ }
189
+
190
+ .disabled,
191
+ .disabled .expandedClick {
192
+ pointer-events: none;
193
+ cursor: default;
194
+ filter: grayscale(1);
195
+ opacity: 0.7;
196
+ }
197
+
198
+ .icone {
199
+ flex: 0;
200
+ opacity: var(--ui-opacity, 1);
201
+ font-size: var(--ui-font-size-icone, var(--ui-font-size));
202
+ color: var(--ui-cor-icone, var(--btnr-corFundo, var(--sys-on-background)));
203
+ }
204
+
205
+ .iconeCategory {
206
+ position: absolute;
207
+ right: 10px;
208
+ transition: transform 0.3s;
209
+ }
210
+
211
+ .ativo {
212
+ outline: 1px outset var(--sys-high);
213
+ box-shadow:
214
+ 0 0 1px var(--sys-high),
215
+ inset 0 0 5px var(--sys-high);
216
+ border-radius: var(--MasterRadius);
217
+ }
218
+
219
+ button.sidebar-item.ativo,
220
+ button.sidebar-item-category.ativo {
221
+ outline: none;
222
+ box-shadow: none;
223
+ background-color: color-mix(in srgb, var(--btnr-corFundo, hsl(0 0 50)) 10%, transparent 90%);
224
+ }
225
+
226
+ button.sidebar-item-category.category.ativo .iconeCategory {
227
+ transform: rotate(180deg);
228
+ transition: transform 0.3s;
229
+ }
@@ -0,0 +1,12 @@
1
+ <button #botao type="button" [class]="buttonClasses()" [style.--btnr-corFundo]="corFundo()"
2
+ [style.--btnr-corFrente]="corFrente()" [disabled]="disabled()" [tabIndex]="tabindex()"
3
+ [class.radiusTabFormat]="radiusTabFormat()" [class.disabled]="disabled()" [class.ativo]="ativo()"
4
+ (keyup.Enter)="onKeyPressed($event)" [class.category]="isCategory()">
5
+ @if(icone() && iconeAntes()){ <div class="icone iconeAntes"><i [class]="icone()"></i></div> }
6
+ <ng-content />
7
+ @if(icone() && iconeDepois()){ <div class="icone iconeDepois"><i [class]="icone()"></i></div> }
8
+ @if(isCategory()){ <div class="icone iconeCategory"><i [class]="iconeCategory()"></i></div> }
9
+ <span #rippleEffect class="expandedClick" (click)="onClickExpanded($event)">
10
+ <span #ripple class="ripple"></span>
11
+ </span>
12
+ </button>
@@ -0,0 +1,133 @@
1
+ import { Component, computed, effect, ElementRef, input, model, OnInit, output, signal, viewChild } from '@angular/core';
2
+ import { ITipoBotao, ITiposTema } from '../../interfaces/interfaces';
3
+
4
+ @Component({
5
+ selector: 'ui-button',
6
+ templateUrl: './ui-button.html',
7
+ styleUrl: './ui-button.css',
8
+ })
9
+ export class UiButton {
10
+
11
+ botao = viewChild('botao', { read: ElementRef });
12
+ rippleEffect = viewChild('rippleEffect', { read: ElementRef });
13
+ ripple = viewChild('ripple', { read: ElementRef });
14
+
15
+ icone = model<string | undefined | null>(null);
16
+ iconeAntes = model<boolean>(true);
17
+ iconeDepois = model<boolean>(false);
18
+ iconeCategory = model<string>('fa fa-chevron-right');
19
+
20
+ clicked = output<PointerEvent>();
21
+
22
+ disabled = input<boolean>();
23
+ eventPropagation = input<boolean>(false);
24
+ radiusTabFormat = input<boolean>(false);
25
+ tabindex = input<number | string>();
26
+ tipo = input<ITipoBotao | undefined>("fill");
27
+ tema = model<ITiposTema | undefined>("");
28
+ classes = input<string>("");
29
+ ativo = input<boolean>(false);
30
+
31
+ isCategory = computed(() => this.tipo() === 'menu-item-category' || this.tipo() === 'sidebar-item-category');
32
+ buttonClasses = computed(() => {
33
+ return `btnr ${this.tipo() || 'fill'} ${this.classes()}`;
34
+ });
35
+
36
+ corFundo = signal<string | undefined>(undefined);
37
+ corFrente = signal<string | undefined>(undefined);
38
+
39
+ constructor() {
40
+ effect(() => {
41
+ let tema = this.tema();
42
+ switch (tema) {
43
+ case "primary":
44
+ this.corFundo.set(`var(--sys-primary)`);
45
+ this.corFrente.set(`var(--sys-on-primary)`);
46
+ break;
47
+ case "secondary":
48
+ this.corFundo.set(`var(--sys-secondary)`);
49
+ this.corFrente.set(`var(--sys-on-secondary)`);
50
+ break;
51
+ case "high":
52
+ this.corFundo.set(`var(--sys-high)`);
53
+ this.corFrente.set(`var(--sys-on-high)`);
54
+ break;
55
+ case "success":
56
+ this.corFundo.set(`var(--sys-success)`);
57
+ this.corFrente.set(`var(--sys-on-success)`);
58
+ break;
59
+ case "warning":
60
+ this.corFundo.set(`var(--sys-warning)`);
61
+ this.corFrente.set(`var(--sys-on-warning)`);
62
+ break;
63
+ case "error":
64
+ this.corFundo.set(`var(--sys-error)`);
65
+ this.corFrente.set(`var(--sys-on-error)`);
66
+ break;
67
+ case "info":
68
+ this.corFundo.set(`var(--sys-info)`);
69
+ this.corFrente.set(`var(--sys-on-info)`);
70
+ break;
71
+ case "white":
72
+ this.corFundo.set(`var(--sys-white)`);
73
+ this.corFrente.set(`var(--sys-on-white)`);
74
+ break;
75
+ case "black":
76
+ this.corFundo.set(`var(--sys-black)`);
77
+ this.corFrente.set(`var(--sys-on-black)`);
78
+ break;
79
+ case "card":
80
+ this.corFundo.set(`var(--sys-card)`);
81
+ this.corFrente.set(`var(--sys-on-card)`);
82
+ break;
83
+ case "": // Sem Tema
84
+ default: // Tema Desconhecido
85
+ this.corFundo.set(undefined);
86
+ this.corFrente.set(undefined);
87
+ break;
88
+ }
89
+ });
90
+ }
91
+
92
+
93
+ onKeyPressed(ev: Event) {
94
+ this.onClickExpanded(ev as any);
95
+ }
96
+
97
+ onClickExpanded(ev: PointerEvent) {
98
+ if (this.disabled()) {
99
+ ev.preventDefault();
100
+ if (this.eventPropagation()) {
101
+ ev.stopPropagation();
102
+ }
103
+ return;
104
+ }
105
+ this.botao()?.nativeElement.focus();
106
+ if (ev instanceof PointerEvent) {
107
+ this.createRipple(ev);
108
+ }
109
+ this.clicked.emit(ev);
110
+ if (this.eventPropagation()) {
111
+ ev.stopPropagation();
112
+ }
113
+ }
114
+
115
+ createRipple(e: PointerEvent) {
116
+ const rippleEffect = e.currentTarget ?? this.rippleEffect()?.nativeElement;
117
+ const ripple = this.ripple()?.nativeElement.cloneNode(true) as HTMLElement;
118
+ const rect = rippleEffect.getBoundingClientRect();
119
+ // Calcula a posição do clique relativa ao botão
120
+ const x = e.clientX - rect.left;
121
+ const y = e.clientY - rect.top;
122
+ // Define o tamanho do ripple (maior dimensão do botão * 2)
123
+ const size = Math.max(rect.width, rect.height) * 2;
124
+ ripple.style.width = ripple.style.height = size + 'px';
125
+ ripple.style.left = (x - size / 2) + 'px';
126
+ ripple.style.top = (y - size / 2) + 'px';
127
+ ripple.classList.add('ripple');
128
+ rippleEffect.appendChild(ripple);
129
+ ripple.addEventListener('animationend', () => {
130
+ ripple.remove();
131
+ });
132
+ }
133
+ }
@@ -0,0 +1,66 @@
1
+ :host {
2
+ display: contents;
3
+ }
4
+
5
+ .marcador-area {
6
+ width: var(--ui-size, 22px);
7
+ height: var(--ui-size, 22px);
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ cursor: pointer;
12
+ user-select: none;
13
+ border-radius: 50%;
14
+ outline: 1px dashed var(--ui-outline, var(--sys-outline));
15
+ position: relative;
16
+ }
17
+
18
+ .marcador-area.multiple {
19
+ border-radius: 4px;
20
+ }
21
+
22
+ .marcador-area:focus-visible,
23
+ .marcador-area:hover {
24
+ outline: 1px solid var(--ui-color, var(--sys-primary));
25
+ }
26
+
27
+ .marcador-area.ativo {
28
+ outline: 1px solid var(--ui-color, var(--sys-primary));
29
+ }
30
+
31
+ .marcador-area.ativo .checkmark {
32
+ display: block;
33
+ }
34
+
35
+ .marcador-area.disabled {
36
+ cursor: not-allowed;
37
+ opacity: 0.6;
38
+ filter: grayscale(1);
39
+ pointer-events: none;
40
+ }
41
+
42
+ .checkmark.simples.ativo {
43
+ background-color: var(--ui-color, var(--sys-primary));
44
+ width: 100%;
45
+ height: 100%;
46
+ border-radius: 50%;
47
+ transform: scale(0.75);
48
+ }
49
+
50
+ .checkmark.multiple.ativo {
51
+ width: 60%;
52
+ height: 38%;
53
+ border-left: 2px solid var(--ui-color, var(--sys-primary));
54
+ border-bottom: 2px solid var(--ui-color, var(--sys-primary));
55
+ transform: rotate(-45deg) translateX(1px);
56
+ }
57
+
58
+ .checkmark.multiple.hasDash:not(.ativo) {
59
+ width: 60%;
60
+ height: 2px;
61
+ background-color: var(--ui-color, var(--sys-primary));
62
+ }
63
+
64
+ .marcador-area:has(.hasDash:not(.ativo)) {
65
+ outline: 1px solid var(--ui-outline, var(--sys-outline));
66
+ }
@@ -0,0 +1,5 @@
1
+ <div #marcabox class="marcador-area" tabindex="0" (click)="onClickMarcador()" [class.ativo]="ativo()"
2
+ [class.multiple]="!single()" (focus)="onFocus($event)" (blur)="onBlur($event)" [class.disabled]="disabled()">
3
+ <div class="checkmark {{ single() ? 'simples' : 'multiple' }}" [class.hasDash]="hasDash()" [class.ativo]="ativo()">
4
+ </div>
5
+ </div>
@@ -0,0 +1,65 @@
1
+ import { AfterViewInit, Component, computed, effect, ElementRef, input, model, output, viewChild } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'ui-check-box',
5
+ templateUrl: './ui-check-box.html',
6
+ styleUrl: './ui-check-box.css',
7
+ host: {
8
+ '[class.focused]': 'focused()',
9
+ }
10
+ })
11
+ export class UiCheckBox implements AfterViewInit {
12
+
13
+ marcabox = viewChild('marcabox', { read: ElementRef });
14
+
15
+ value = model<boolean>(false);
16
+ disabled = input<boolean>();
17
+ focused = model<boolean>(false);
18
+ focus = input<boolean>(false);
19
+ changed = output<boolean>();
20
+ single = input<boolean>(false);
21
+ hasDash = input<boolean>(false);
22
+
23
+ ativo = computed(() => {
24
+ const val = (this.value() as any);
25
+ return val === true || val === 'true' || val === 1 || val === '1';
26
+ });
27
+
28
+ constructor() {
29
+ effect(() => {
30
+ if (this.focus()) {
31
+ this.marcabox()?.nativeElement.focus();
32
+ }
33
+ });
34
+ }
35
+
36
+ ngAfterViewInit(): void {
37
+ this.marcabox()?.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {
38
+ if (event.key === ' ' || event.key === 'Enter') {
39
+ event.preventDefault();
40
+ this.onClickMarcador();
41
+ }
42
+ });
43
+ }
44
+
45
+ onClickMarcador() {
46
+ if (this.disabled()) return;
47
+
48
+ const currentValue = (this.value() as any);
49
+ const newValue = !(currentValue === true || currentValue === 'true' || currentValue === 1 || currentValue === '1');
50
+ this.value.set(newValue);
51
+ this.changed.emit(newValue);
52
+ }
53
+
54
+ onFocus(ev: FocusEvent) {
55
+ if (this.disabled()) return;
56
+
57
+ this.focused.set(true);
58
+ }
59
+
60
+ onBlur(ev: FocusEvent) {
61
+ this.focused.set(false);
62
+ }
63
+
64
+
65
+ }
@@ -0,0 +1,24 @@
1
+ :host {
2
+ display: var(--ui-display, contents);
3
+ }
4
+
5
+ .baseChip {
6
+ display: inline-block;
7
+ font-weight: 500;
8
+ white-space: nowrap;
9
+ user-select: none;
10
+ vertical-align: middle;
11
+ line-height: 1;
12
+ outline-offset: -2px;
13
+ padding: 4px 7px;
14
+ color: white;
15
+ letter-spacing: 1.1px;
16
+ text-transform: uppercase;
17
+ font-family: monospace;
18
+ font-size: 12px;
19
+ border-radius: var(--MasterRadius);
20
+
21
+ outline: 1px solid hsl(var(--ChipHue) 50 var(--lightnessHalf) / 50%);
22
+ color: hsl(var(--ChipHue) 50 var(--lightnessHalf));
23
+ background-color: hsl(var(--ChipHue) 50 50 / 10%);
24
+ }
@@ -0,0 +1,3 @@
1
+ <span class="baseChip" [style.--ChipHue]="hue() ?? 'var(--sys-hue-color1)'">
2
+ <ng-content></ng-content>
3
+ </span>