ngx-opalbytes-components 1.19.0 → 1.21.0

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 (95) hide show
  1. package/README.md +103 -0
  2. package/cli/cao-comp.cjs +456 -0
  3. package/fesm2022/ngx-opalbytes-components.mjs +23 -7
  4. package/fesm2022/ngx-opalbytes-components.mjs.map +1 -1
  5. package/package.json +4 -1
  6. package/src/lib/shared/components/autocomplete/autocomplete.component.html +126 -0
  7. package/src/lib/shared/components/autocomplete/autocomplete.component.scss +150 -0
  8. package/src/lib/shared/components/autocomplete/autocomplete.component.ts +552 -0
  9. package/src/lib/shared/components/autocomplete/autocomplete.stories.ts +133 -0
  10. package/src/lib/shared/components/base-button/base-button.component.html +33 -0
  11. package/src/lib/shared/components/base-button/base-button.component.scss +14 -0
  12. package/src/lib/shared/components/base-button/base-button.component.spec.ts +64 -0
  13. package/src/lib/shared/components/base-button/base-button.component.ts +48 -0
  14. package/src/lib/shared/components/base-button/base-button.stories.ts +102 -0
  15. package/src/lib/shared/components/base-icon/base-icon.css +0 -0
  16. package/src/lib/shared/components/base-icon/base-icon.html +11 -0
  17. package/src/lib/shared/components/base-icon/base-icon.spec.ts +23 -0
  18. package/src/lib/shared/components/base-icon/base-icon.stories.ts +56 -0
  19. package/src/lib/shared/components/base-icon/base-icon.ts +18 -0
  20. package/src/lib/shared/components/base-input/base-input.css +193 -0
  21. package/src/lib/shared/components/base-input/base-input.html +43 -0
  22. package/src/lib/shared/components/base-input/base-input.spec.ts +146 -0
  23. package/src/lib/shared/components/base-input/base-input.stories.ts +137 -0
  24. package/src/lib/shared/components/base-input/base-input.ts +133 -0
  25. package/src/lib/shared/components/base-time-range/base-time-range.css +27 -0
  26. package/src/lib/shared/components/base-time-range/base-time-range.html +23 -0
  27. package/src/lib/shared/components/base-time-range/base-time-range.spec.ts +27 -0
  28. package/src/lib/shared/components/base-time-range/base-time-range.stories.ts +54 -0
  29. package/src/lib/shared/components/base-time-range/base-time-range.ts +61 -0
  30. package/src/lib/shared/components/base-toggle/base-toggle.component.html +28 -0
  31. package/src/lib/shared/components/base-toggle/base-toggle.component.scss +45 -0
  32. package/src/lib/shared/components/base-toggle/base-toggle.component.spec.ts +22 -0
  33. package/src/lib/shared/components/base-toggle/base-toggle.component.ts +138 -0
  34. package/src/lib/shared/components/base-toggle/base-toggle.stories.ts +63 -0
  35. package/src/lib/shared/components/card/card.component.css +264 -0
  36. package/src/lib/shared/components/card/card.component.html +103 -0
  37. package/src/lib/shared/components/card/card.component.ts +63 -0
  38. package/src/lib/shared/components/card/card.stories.ts +114 -0
  39. package/src/lib/shared/components/date-picker/date-picker.html +82 -0
  40. package/src/lib/shared/components/date-picker/date-picker.scss +8 -0
  41. package/src/lib/shared/components/date-picker/date-picker.spec.ts +23 -0
  42. package/src/lib/shared/components/date-picker/date-picker.stories.ts +91 -0
  43. package/src/lib/shared/components/date-picker/date-picker.ts +165 -0
  44. package/src/lib/shared/components/drop-down/drop-down.css +61 -0
  45. package/src/lib/shared/components/drop-down/drop-down.html +96 -0
  46. package/src/lib/shared/components/drop-down/drop-down.spec.ts +335 -0
  47. package/src/lib/shared/components/drop-down/drop-down.stories.ts +90 -0
  48. package/src/lib/shared/components/drop-down/drop-down.ts +335 -0
  49. package/src/lib/shared/components/footer/footer.css +29 -0
  50. package/src/lib/shared/components/footer/footer.html +10 -0
  51. package/src/lib/shared/components/footer/footer.spec.ts +22 -0
  52. package/src/lib/shared/components/footer/footer.stories.ts +51 -0
  53. package/src/lib/shared/components/footer/footer.ts +15 -0
  54. package/src/lib/shared/components/index.ts +19 -0
  55. package/src/lib/shared/components/kpi/kpi.css +0 -0
  56. package/src/lib/shared/components/kpi/kpi.html +11 -0
  57. package/src/lib/shared/components/kpi/kpi.spec.ts +38 -0
  58. package/src/lib/shared/components/kpi/kpi.stories.ts +65 -0
  59. package/src/lib/shared/components/kpi/kpi.ts +25 -0
  60. package/src/lib/shared/components/links-button/links-button.css +70 -0
  61. package/src/lib/shared/components/links-button/links-button.html +23 -0
  62. package/src/lib/shared/components/links-button/links-button.spec.ts +139 -0
  63. package/src/lib/shared/components/links-button/links-button.stories.ts +75 -0
  64. package/src/lib/shared/components/links-button/links-button.ts +45 -0
  65. package/src/lib/shared/components/paginator/paginator.css +0 -0
  66. package/src/lib/shared/components/paginator/paginator.html +10 -0
  67. package/src/lib/shared/components/paginator/paginator.spec.ts +23 -0
  68. package/src/lib/shared/components/paginator/paginator.stories.ts +56 -0
  69. package/src/lib/shared/components/paginator/paginator.ts +25 -0
  70. package/src/lib/shared/components/stepper/step/step.css +8 -0
  71. package/src/lib/shared/components/stepper/step/step.html +1 -0
  72. package/src/lib/shared/components/stepper/step/step.spec.ts +131 -0
  73. package/src/lib/shared/components/stepper/step/step.ts +14 -0
  74. package/src/lib/shared/components/stepper/stepper.css +17 -0
  75. package/src/lib/shared/components/stepper/stepper.html +11 -0
  76. package/src/lib/shared/components/stepper/stepper.spec.ts +238 -0
  77. package/src/lib/shared/components/stepper/stepper.stories.ts +77 -0
  78. package/src/lib/shared/components/stepper/stepper.ts +57 -0
  79. package/src/lib/shared/components/tab-group/tab-group.component.html +84 -0
  80. package/src/lib/shared/components/tab-group/tab-group.component.scss +151 -0
  81. package/src/lib/shared/components/tab-group/tab-group.spec.ts +22 -0
  82. package/src/lib/shared/components/tab-group/tab-group.stories.ts +102 -0
  83. package/src/lib/shared/components/tab-group/tab-group.ts +218 -0
  84. package/src/lib/shared/components/tab-panel/tab-content.directive.ts +7 -0
  85. package/src/lib/shared/components/tab-panel/tab-label.directive.ts +7 -0
  86. package/src/lib/shared/components/tab-panel/tab-panel.css +0 -0
  87. package/src/lib/shared/components/tab-panel/tab-panel.spec.ts +22 -0
  88. package/src/lib/shared/components/tab-panel/tab-panel.stories.ts +54 -0
  89. package/src/lib/shared/components/tab-panel/tab-panel.ts +31 -0
  90. package/src/lib/shared/components/time-picker/time-picker.css +84 -0
  91. package/src/lib/shared/components/time-picker/time-picker.html +21 -0
  92. package/src/lib/shared/components/time-picker/time-picker.spec.ts +23 -0
  93. package/src/lib/shared/components/time-picker/time-picker.stories.ts +66 -0
  94. package/src/lib/shared/components/time-picker/time-picker.ts +90 -0
  95. package/types/ngx-opalbytes-components.d.ts +23 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-opalbytes-components",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -12,6 +12,9 @@
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0"
14
14
  },
15
+ "bin": {
16
+ "cao-comp": "cli/cao-comp.cjs"
17
+ },
15
18
  "sideEffects": false,
16
19
  "module": "fesm2022/ngx-opalbytes-components.mjs",
17
20
  "typings": "types/ngx-opalbytes-components.d.ts",
@@ -0,0 +1,126 @@
1
+ <div class="form-field">
2
+ @if (label) {
3
+ <label [for]="dataCy">{{ label }}</label>
4
+ }
5
+
6
+ <div class="rnv-autocomplete-field autocomplete">
7
+ <div
8
+ #wrapper
9
+ class="input-wrapper"
10
+ [class.has-leading-icon]="_leadingIcon"
11
+ [class.has-trailing-icon]="_trailingIcon"
12
+ [class.focused]="isFocused"
13
+ [class.invalid]="control?.touched && control?.invalid"
14
+ [class.valid]="control?.touched && control?.valid && control?.value">
15
+
16
+ @if (_leadingIcon) {
17
+ @if (isLucideIcon) {
18
+ <div class="icon"
19
+ tabindex="0"
20
+ (click)="onLeadingIconClick($event)"
21
+ (keydown.enter)="onLeadingIconClick($event)">
22
+ <svg [strokeWidth]="strokeWidthIcon" [size]="iconSize" [lucideIcon]="_leadingIcon" [style.color]="iconColor"></svg>
23
+ </div>
24
+ } @else {
25
+ <div class="icon"
26
+ tabindex="0"
27
+ (click)="onLeadingIconClick($event)"
28
+ (keydown.enter)="onLeadingIconClick($event)">
29
+ <img alt="ícone de início" [style.width]="iconSize" [src]="_leadingIcon" />
30
+ </div>
31
+ }
32
+ }
33
+
34
+ <input
35
+ #inputEl
36
+ type="text"
37
+ autocomplete="off"
38
+ role="combobox"
39
+ aria-haspopup="listbox"
40
+ [attr.aria-expanded]="isPanelOpen"
41
+ [attr.aria-controls]="isPanelOpen ? listboxId : null"
42
+ [attr.aria-activedescendant]="activeOptionId"
43
+ [placeholder]="placeholder"
44
+ [disabled]="isDisabled"
45
+ [formControl]="internalControl"
46
+ [attr.data-cy]="dataCy"
47
+ [id]="dataCy"
48
+ (focus)="onFocus()"
49
+ (blur)="onBlur()"
50
+ (input)="onUserInput()"
51
+ (keydown)="onInputKeydown($event)" />
52
+
53
+ @if (_trailingIcon) {
54
+ @if (isLucideIcon) {
55
+ <div
56
+ tabindex="0"
57
+ class="icon trailing-icon"
58
+ (click)="onTrailingIconClick($event)"
59
+ (keydown.enter)="onTrailingIconClick($event)">
60
+ <svg [strokeWidth]="strokeWidthIcon" [size]="iconSize" [lucideIcon]="_trailingIcon" [style.color]="iconColor"></svg>
61
+ </div>
62
+ } @else {
63
+ <div
64
+ tabindex="0"
65
+ class="icon trailing-icon"
66
+ (click)="onTrailingIconClick($event)"
67
+ (keydown.enter)="onTrailingIconClick($event)">
68
+ <img alt="ícone de fim" [style.width]="iconSize" [src]="_trailingIcon" />
69
+ </div>
70
+ }
71
+ }
72
+ </div>
73
+
74
+ @if (errorText) {
75
+ <span class="error-text">{{ errorText }}</span>
76
+ }
77
+ </div>
78
+ </div>
79
+
80
+ <ng-template #panel>
81
+ <div
82
+ class="autocomplete-panel"
83
+ cdkScrollable
84
+ role="listbox"
85
+ [id]="listboxId"
86
+ [style.width]="'100%'"
87
+ [style.max-height]="'260px'"
88
+ [style.background]="autocompleteBgColor">
89
+
90
+ @if (!filteredOptionsList.length) {
91
+ <div class="empty-state">Nenhum resultado encontrado</div>
92
+ }
93
+
94
+ @for (option of filteredOptionsList; track trackByOptionId($index, option)) {
95
+ <div
96
+ class="option-item"
97
+ role="option"
98
+ [id]="optionId(option)"
99
+ [class.active]="$index === activeIndex"
100
+ [class.selected]="isOptionSelected(option)"
101
+ [attr.aria-selected]="$index === activeIndex"
102
+ (mousedown)="$event.preventDefault(); selectOption(option)"
103
+ (mouseenter)="activeIndex = $index">
104
+ <span>{{ option.nome }}</span>
105
+
106
+ <div class="option-item-icons">
107
+ @if (showCheckIcon && isOptionSelected(option)) {
108
+ @if (isLucideCheckIcon) {
109
+ <svg class="check-icon" [strokeWidth]="strokeWidthIcon" [lucideIcon]="checkIcon" [style.color]="iconColor"></svg>
110
+ } @else {
111
+ <span class="check-icon">{{ checkIcon }}</span>
112
+ }
113
+ }
114
+
115
+ @if (optionIcon) {
116
+ @if (isLucideOptionIcon) {
117
+ <svg [strokeWidth]="strokeWidthIcon" [size]="iconSize" [lucideIcon]="optionIcon" [style.color]="optionIConColor || iconColor"></svg>
118
+ } @else {
119
+ <img alt="" [src]="optionIcon" />
120
+ }
121
+ }
122
+ </div>
123
+ </div>
124
+ }
125
+ </div>
126
+ </ng-template>
@@ -0,0 +1,150 @@
1
+ :host {
2
+ display: block;
3
+ position: relative;
4
+ --autocomplete-bg-color: white;
5
+ }
6
+
7
+ .form-field {
8
+ display: flex;
9
+ flex-direction: column;
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+
14
+ label {
15
+ font-size: 12px;
16
+ font-weight: 700;
17
+ text-transform: uppercase;
18
+ white-space: nowrap;
19
+ flex-shrink: 0;
20
+ }
21
+
22
+ .rnv-autocomplete-field {
23
+ width: 100%;
24
+ flex: 1;
25
+ min-height: 0;
26
+ display: flex;
27
+ flex-direction: column;
28
+ }
29
+
30
+ .input-wrapper {
31
+ position: relative;
32
+ width: 100%;
33
+ height: var(--form-field-height, 44px);
34
+ display: flex;
35
+ align-items: center;
36
+ background-color: var(--autocomplete-bg-color, white);
37
+ border: 1px solid transparent;
38
+ border-radius: 4px;
39
+ box-sizing: border-box;
40
+
41
+ &.invalid {
42
+ border-color: #d32f2f;
43
+ }
44
+
45
+ &.valid {
46
+ border-color: #2e7d32;
47
+ }
48
+ }
49
+
50
+ input {
51
+ width: 100%;
52
+ height: 100%;
53
+ border: none;
54
+ outline: none;
55
+ background: transparent;
56
+ padding: 12px;
57
+ font-size: 1rem;
58
+ box-sizing: border-box;
59
+
60
+ &:disabled {
61
+ opacity: .5;
62
+ cursor: not-allowed;
63
+ }
64
+ }
65
+
66
+ .input-wrapper.has-leading-icon input {
67
+ padding-left: 36px;
68
+ }
69
+
70
+ .input-wrapper.has-trailing-icon input {
71
+ padding-right: 28px;
72
+ }
73
+
74
+ .icon {
75
+ position: absolute;
76
+ top: 50%;
77
+ left: 6px;
78
+ transform: translateY(-50%);
79
+ width: auto;
80
+ height: auto;
81
+ z-index: 1;
82
+ cursor: pointer;
83
+ }
84
+
85
+ .trailing-icon {
86
+ left: auto;
87
+ right: 6px;
88
+ }
89
+
90
+ .error-text {
91
+ color: #d32f2f;
92
+ font-size: 11px;
93
+ margin-top: 2px;
94
+ }
95
+
96
+ /* Painel do CDK Overlay */
97
+ .autocomplete-panel {
98
+ background: var(--autocomplete-bg-color, white);
99
+ border-radius: 8px;
100
+ padding: 6px;
101
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
102
+ max-height: 260px;
103
+ overflow-y: auto;
104
+ box-sizing: border-box;
105
+ }
106
+
107
+ .empty-state {
108
+ padding: 8px 12px;
109
+ font-size: .9rem;
110
+ color: rgba(0, 0, 0, .5);
111
+ }
112
+
113
+ .option-item {
114
+ display: flex;
115
+ align-items: center;
116
+ justify-content: space-between;
117
+ padding: 8px 12px;
118
+ font-size: 1rem;
119
+ text-transform: uppercase;
120
+ border-radius: 4px;
121
+ cursor: pointer;
122
+ position: relative;
123
+
124
+ &:hover,
125
+ &.active {
126
+ background-color: rgba(0, 0, 0, .06);
127
+ }
128
+
129
+ &.selected {
130
+ background-color: rgba(25, 118, 210, .12);
131
+ font-weight: 600;
132
+ }
133
+
134
+ &.selected.active {
135
+ background-color: rgba(25, 118, 210, .2);
136
+ }
137
+ }
138
+
139
+ .option-item-icons {
140
+ display: flex;
141
+ align-items: center;
142
+ gap: 6px;
143
+ flex-shrink: 0;
144
+ }
145
+
146
+ .check-icon {
147
+ font-weight: 700;
148
+ font-size: .95rem;
149
+ line-height: 1;
150
+ }