ngx-opalbytes-components 1.10.0 → 1.12.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.
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ngx-opalbytes-components
|
|
2
2
|
|
|
3
3
|
Uma biblioteca de componentes de UI reutilizáveis para aplicações Angular, projetada para acelerar o desenvolvimento e manter a consistência visual.
|
|
4
4
|
|
|
@@ -44,20 +44,30 @@ Os componentes nesta biblioteca são `standalone`, o que significa que você pod
|
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
46
|
import { Component } from '@angular/core';
|
|
47
|
-
// Importe
|
|
48
|
-
import { BaseButton } from 'ngx-opalbytes-components';
|
|
47
|
+
// Importe os componentes desejados
|
|
48
|
+
import { BaseButton, CaoAutocompleteComponent } from 'ngx-opalbytes-components';
|
|
49
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms'; // Adicione ReactiveFormsModule e FormControl
|
|
49
50
|
|
|
50
51
|
@Component({
|
|
51
52
|
selector: 'app-exemplo',
|
|
52
53
|
standalone: true,
|
|
53
54
|
imports: [
|
|
54
|
-
BaseButton // Adicione o componente aos imports
|
|
55
|
+
BaseButton, // Adicione o componente aos imports
|
|
56
|
+
CaoAutocompleteComponent, // Adicione o componente aos imports
|
|
57
|
+
ReactiveFormsModule // Importe ReactiveFormsModule
|
|
55
58
|
],
|
|
56
59
|
template: `
|
|
57
60
|
<cao-button buttonText="Clique Aqui"></cao-button>
|
|
61
|
+
<cao-autocomplete label="Selecione um Item" [options]="opcoesExemplo" [control]="meuControl"></cao-autocomplete>
|
|
58
62
|
`
|
|
59
63
|
})
|
|
60
|
-
export class ExemploComponent {
|
|
64
|
+
export class ExemploComponent {
|
|
65
|
+
meuControl = new FormControl();
|
|
66
|
+
opcoesExemplo = [
|
|
67
|
+
{ id: 1, nome: 'Opção 1' },
|
|
68
|
+
{ id: 2, nome: 'Opção 2' }
|
|
69
|
+
];
|
|
70
|
+
}
|
|
61
71
|
```
|
|
62
72
|
|
|
63
73
|
---
|
|
@@ -406,7 +416,7 @@ Um componente de modal genérico que pode ser customizado.
|
|
|
406
416
|
|
|
407
417
|
---
|
|
408
418
|
|
|
409
|
-
###
|
|
419
|
+
### CaoAutocompleteComponent
|
|
410
420
|
Um campo de preenchimento automático que funciona com `ngModel` ou `formControlName`.
|
|
411
421
|
|
|
412
422
|
**Seletor:** `<cao-autocomplete>`
|
|
@@ -451,7 +461,7 @@ Uma tabela de dados com ordenação, paginação e seleção de linhas. A config
|
|
|
451
461
|
|
|
452
462
|
---
|
|
453
463
|
|
|
454
|
-
###
|
|
464
|
+
### BaseTablePaginated
|
|
455
465
|
Uma tabela de dados leve com paginação no lado do cliente. Herda a maioria de suas funcionalidades do `BaseTable`.
|
|
456
466
|
|
|
457
467
|
**Seletor:** `<cao-table-light-paginated>`
|
|
@@ -484,7 +494,7 @@ Uma tabela de dados leve com paginação no lado do cliente. Herda a maioria de
|
|
|
484
494
|
### `BaseTimeRange`
|
|
485
495
|
Um seletor de intervalo de datas.
|
|
486
496
|
|
|
487
|
-
**Seletor:** `<cao-time-range>`
|
|
497
|
+
**Seletor:** `<cao-base-time-range>`
|
|
488
498
|
|
|
489
499
|
**Atributos (Inputs)**
|
|
490
500
|
|
|
@@ -605,7 +615,7 @@ Um seletor de horário.
|
|
|
605
615
|
|
|
606
616
|
---
|
|
607
617
|
|
|
608
|
-
##
|
|
618
|
+
## Como Contribuir
|
|
609
619
|
|
|
610
620
|
Para adicionar um novo componente a esta biblioteca, siga os passos abaixo:
|
|
611
621
|
|
|
@@ -620,7 +630,7 @@ Para adicionar um novo componente a esta biblioteca, siga os passos abaixo:
|
|
|
620
630
|
|
|
621
631
|
---
|
|
622
632
|
|
|
623
|
-
##
|
|
633
|
+
## Regras e Convenções
|
|
624
634
|
|
|
625
635
|
### Prefixo
|
|
626
636
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, NgOptimizedImage } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, Input, Output, Component, ViewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, inject, NgModule, Injectable } from '@angular/core';
|
|
4
|
+
import { EventEmitter, Input, Output, Component, ViewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, inject, NgModule, Injectable, ContentChildren } from '@angular/core';
|
|
5
5
|
import * as i3 from '@angular/material/tooltip';
|
|
6
6
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
7
7
|
import * as i3$1 from 'lucide-angular';
|
|
@@ -359,7 +359,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
359
359
|
args: [MatDateRangeInput]
|
|
360
360
|
}] } });
|
|
361
361
|
|
|
362
|
-
class
|
|
362
|
+
class CaoAutocompleteComponent {
|
|
363
363
|
label = "";
|
|
364
364
|
placeholder = "";
|
|
365
365
|
options = [];
|
|
@@ -457,16 +457,16 @@ class RnvAutocompleteComponent {
|
|
|
457
457
|
setDisabledState(isDisabled) {
|
|
458
458
|
isDisabled ? this.internalControl.disable() : this.internalControl.enable();
|
|
459
459
|
}
|
|
460
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
461
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type:
|
|
460
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
461
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoAutocompleteComponent, isStandalone: true, selector: "cao-autocomplete", inputs: { label: "label", placeholder: "placeholder", options: "options", control: "control", dataCy: "dataCy", controlName: "controlName" }, providers: [
|
|
462
462
|
{
|
|
463
463
|
provide: NG_VALUE_ACCESSOR,
|
|
464
|
-
useExisting: forwardRef(() =>
|
|
464
|
+
useExisting: forwardRef(() => CaoAutocompleteComponent),
|
|
465
465
|
multi: true,
|
|
466
466
|
},
|
|
467
467
|
], ngImport: i0, template: "<div class=\"form-field\">\n @if (label) {\n <label [for]=\"internalControl\">{{ label }}</label>\n }\n\n <mat-form-field appearance=\"outline\" class=\"rnv-autocomplete-mat-form-field\">\n <div class=\"input-wrapper\" [class.focused]=\"isFocused\">\n <input\n type=\"text\"\n matInput\n [placeholder]=\"placeholder\"\n [formControl]=\"internalControl\"\n [matAutocomplete]=\"auto\"\n [attr.data-cy]=\"dataCy\"\n [ngClass]=\"[\n control?.touched && control?.invalid ? 'invalid' : '',\n control?.touched && control?.valid && control?.value ? 'valid' : ''\n ]\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\" />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n [displayWith]=\"displayFn\"\n (optionSelected)=\"onOptionSelected($event)\">\n @for (option of filteredOptions$ | async; track option.id) {\n <mat-option [value]=\"option\">{{ option.nome }}</mat-option>\n }\n </mat-autocomplete>\n </div>\n </mat-form-field>\n</div>\n", styles: [".form-field{display:flex;flex-direction:column;width:100%}label{font-size:12px;font-weight:700;text-transform:uppercase;white-space:nowrap}.rnv-autocomplete-mat-form-field{width:100%}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper{border-radius:8px;padding:0;height:48px}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-flex{padding:0 10px;align-items:center}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding:0;min-height:0}.rnv-autocomplete-mat-form-field .mat-mdc-form-field-subscript-wrapper,.rnv-autocomplete-mat-form-field .mat-mdc-form-field-outline{display:none}.input-wrapper{position:relative;width:100%}.mat-mdc-option{font-size:1rem;padding:6px 16px;text-transform:uppercase}.mat-mdc-autocomplete-panel{border-radius:8px;padding:12px 6px;box-shadow:0 2px 10px #0000001a}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
468
468
|
}
|
|
469
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoAutocompleteComponent, decorators: [{
|
|
470
470
|
type: Component,
|
|
471
471
|
args: [{ selector: "cao-autocomplete", standalone: true, imports: [
|
|
472
472
|
CommonModule,
|
|
@@ -477,7 +477,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
477
477
|
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
478
478
|
{
|
|
479
479
|
provide: NG_VALUE_ACCESSOR,
|
|
480
|
-
useExisting: forwardRef(() =>
|
|
480
|
+
useExisting: forwardRef(() => CaoAutocompleteComponent),
|
|
481
481
|
multi: true,
|
|
482
482
|
},
|
|
483
483
|
], template: "<div class=\"form-field\">\n @if (label) {\n <label [for]=\"internalControl\">{{ label }}</label>\n }\n\n <mat-form-field appearance=\"outline\" class=\"rnv-autocomplete-mat-form-field\">\n <div class=\"input-wrapper\" [class.focused]=\"isFocused\">\n <input\n type=\"text\"\n matInput\n [placeholder]=\"placeholder\"\n [formControl]=\"internalControl\"\n [matAutocomplete]=\"auto\"\n [attr.data-cy]=\"dataCy\"\n [ngClass]=\"[\n control?.touched && control?.invalid ? 'invalid' : '',\n control?.touched && control?.valid && control?.value ? 'valid' : ''\n ]\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\" />\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n autoActiveFirstOption\n [displayWith]=\"displayFn\"\n (optionSelected)=\"onOptionSelected($event)\">\n @for (option of filteredOptions$ | async; track option.id) {\n <mat-option [value]=\"option\">{{ option.nome }}</mat-option>\n }\n </mat-autocomplete>\n </div>\n </mat-form-field>\n</div>\n", styles: [".form-field{display:flex;flex-direction:column;width:100%}label{font-size:12px;font-weight:700;text-transform:uppercase;white-space:nowrap}.rnv-autocomplete-mat-form-field{width:100%}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper{border-radius:8px;padding:0;height:48px}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-flex{padding:0 10px;align-items:center}.rnv-autocomplete-mat-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{padding:0;min-height:0}.rnv-autocomplete-mat-form-field .mat-mdc-form-field-subscript-wrapper,.rnv-autocomplete-mat-form-field .mat-mdc-form-field-outline{display:none}.input-wrapper{position:relative;width:100%}.mat-mdc-option{font-size:1rem;padding:6px 16px;text-transform:uppercase}.mat-mdc-autocomplete-panel{border-radius:8px;padding:12px 6px;box-shadow:0 2px 10px #0000001a}\n"] }]
|
|
@@ -2236,6 +2236,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2236
2236
|
}]
|
|
2237
2237
|
}], ctorParameters: () => [{ type: i1$4.Overlay }] });
|
|
2238
2238
|
|
|
2239
|
+
class StepComponent {
|
|
2240
|
+
title = "";
|
|
2241
|
+
isActive = false;
|
|
2242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2243
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: StepComponent, isStandalone: true, selector: "cao-step", inputs: { title: "title", isActive: "isActive" }, ngImport: i0, template: "<div class=\"step d-flex aic jcc\" [ngClass]=\"{'active': isActive}\"> {{ title }} </div>\n", styles: [".step{width:44px;height:44px;border-radius:100%;font-size:18px;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2244
|
+
}
|
|
2245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepComponent, decorators: [{
|
|
2246
|
+
type: Component,
|
|
2247
|
+
args: [{ selector: "cao-step", standalone: true, imports: [CommonModule], template: "<div class=\"step d-flex aic jcc\" [ngClass]=\"{'active': isActive}\"> {{ title }} </div>\n", styles: [".step{width:44px;height:44px;border-radius:100%;font-size:18px;font-weight:700}\n"] }]
|
|
2248
|
+
}], propDecorators: { title: [{
|
|
2249
|
+
type: Input
|
|
2250
|
+
}], isActive: [{
|
|
2251
|
+
type: Input
|
|
2252
|
+
}] } });
|
|
2253
|
+
|
|
2254
|
+
class StepperComponent {
|
|
2255
|
+
constructor() { }
|
|
2256
|
+
steps;
|
|
2257
|
+
title;
|
|
2258
|
+
activeStepIndex = 0;
|
|
2259
|
+
lengthStep = 0;
|
|
2260
|
+
showLine = true;
|
|
2261
|
+
maxReachedEvent = new EventEmitter();
|
|
2262
|
+
ngAfterContentInit() {
|
|
2263
|
+
if (this.steps.length > 0) {
|
|
2264
|
+
this.steps.toArray()[0].isActive = true;
|
|
2265
|
+
this.lengthStep = this.steps.length;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
nextStep() {
|
|
2269
|
+
if (this.steps.length > 0) {
|
|
2270
|
+
if (this.activeStepIndex < this.steps.length - 1) {
|
|
2271
|
+
this.activeStepIndex++;
|
|
2272
|
+
this.steps.toArray()[this.activeStepIndex].isActive = true;
|
|
2273
|
+
}
|
|
2274
|
+
else {
|
|
2275
|
+
this.maxReachedEvent.emit(null);
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
prevStep() {
|
|
2280
|
+
if (this.steps.length > 0) {
|
|
2281
|
+
if (this.activeStepIndex > 0) {
|
|
2282
|
+
this.steps.toArray()[this.activeStepIndex].isActive = false;
|
|
2283
|
+
this.activeStepIndex--;
|
|
2284
|
+
this.steps.toArray()[this.activeStepIndex].isActive = true;
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
resetStepper() {
|
|
2289
|
+
this.activeStepIndex = 0;
|
|
2290
|
+
this.steps.forEach((step) => (step.isActive = false));
|
|
2291
|
+
if (this.steps.length > 0) {
|
|
2292
|
+
this.steps.toArray()[0].isActive = true;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2296
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: StepperComponent, isStandalone: true, selector: "cao-stepper", inputs: { title: "title" }, outputs: { maxReachedEvent: "maxReachedEvent" }, queries: [{ propertyName: "steps", predicate: StepComponent }], ngImport: i0, template: "@if(title){\n<h3 class=\"stepper-title\">{{ title }}</h3>\n}\n<div class=\"d-flex step-container aic jcsb\">\n @if (showLine) {\n <div class=\"line\"></div>\n }\n <div class=\"steps d-flex aic jcsb\">\n <ng-content />\n </div>\n</div>\n", styles: [".step-container{position:relative}.steps{z-index:2;gap:24px}.line{width:100%;position:absolute;top:50%;height:1.5px;background-color:var(--return-color);z-index:1}\n"] });
|
|
2297
|
+
}
|
|
2298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2299
|
+
type: Component,
|
|
2300
|
+
args: [{ selector: "cao-stepper", standalone: true, template: "@if(title){\n<h3 class=\"stepper-title\">{{ title }}</h3>\n}\n<div class=\"d-flex step-container aic jcsb\">\n @if (showLine) {\n <div class=\"line\"></div>\n }\n <div class=\"steps d-flex aic jcsb\">\n <ng-content />\n </div>\n</div>\n", styles: [".step-container{position:relative}.steps{z-index:2;gap:24px}.line{width:100%;position:absolute;top:50%;height:1.5px;background-color:var(--return-color);z-index:1}\n"] }]
|
|
2301
|
+
}], ctorParameters: () => [], propDecorators: { steps: [{
|
|
2302
|
+
type: ContentChildren,
|
|
2303
|
+
args: [StepComponent]
|
|
2304
|
+
}], title: [{
|
|
2305
|
+
type: Input
|
|
2306
|
+
}], maxReachedEvent: [{
|
|
2307
|
+
type: Output
|
|
2308
|
+
}] } });
|
|
2309
|
+
|
|
2239
2310
|
/*
|
|
2240
2311
|
* Public API Surface of ngx-opalbytes-components
|
|
2241
2312
|
*/
|
|
@@ -2244,5 +2315,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2244
2315
|
* Generated bundle index. Do not edit.
|
|
2245
2316
|
*/
|
|
2246
2317
|
|
|
2247
|
-
export { BaseAlert, BaseAlertService, BaseButton, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseInput, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, DropDownComponent, Footer, LinksButton, Paginator,
|
|
2318
|
+
export { BaseAlert, BaseAlertService, BaseButton, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseInput, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, DropDownComponent, Footer, LinksButton, Paginator, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
|
|
2248
2319
|
//# sourceMappingURL=ngx-opalbytes-components.mjs.map
|