@dev-tcloud/tcloud-ui 6.19.1 → 6.19.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.
@@ -0,0 +1,92 @@
1
+ # Progress Status Bar
2
+
3
+ ## Características
4
+ - Componente standalone para exibir progresso com gradiente por faixa de status.
5
+ - Permite definir múltiplas faixas (`start` e `end`) para trocar automaticamente a cor.
6
+ - Suporte aos status de gradiente: `info`, `danger`, `success` e `alert`.
7
+ - Quando o valor atual ultrapassa a última faixa, mantém o gradiente da última configuração.
8
+
9
+ ## Instalação
10
+ ```ts
11
+ import { TCloudUiProgressStatusBarComponent } from 'projects/tcloud-ui/src/public-api';
12
+
13
+ @Component({
14
+ selector: 'app-example',
15
+ standalone: true,
16
+ imports: [TCloudUiProgressStatusBarComponent],
17
+ template: `
18
+ <tcloud-ui-progress-status-bar
19
+ [currentValue]="42"
20
+ [progressStatusConfig]="statusConfig">
21
+ </tcloud-ui-progress-status-bar>
22
+ `
23
+ })
24
+ export class ExampleComponent {
25
+ statusConfig = [
26
+ { start: 0, end: 25, gradientStatus: 'info' },
27
+ { start: 26, end: 60, gradientStatus: 'alert' },
28
+ { start: 61, end: 85, gradientStatus: 'danger' },
29
+ { start: 86, end: 100, gradientStatus: 'success' }
30
+ ];
31
+ }
32
+ ```
33
+
34
+ ## Propriedades (API)
35
+ ### Inputs
36
+ | Nome | Tipo | Descrição | Valor Default |
37
+ | --- | --- | --- | --- |
38
+ | currentValue | number | Valor percentual atual da barra. | obrigatório |
39
+ | progressStatusConfig | ProgressStatusConfig[] | Lista de faixas para definir gradiente por intervalo. | obrigatório |
40
+
41
+ ### Tipo ProgressStatusConfig
42
+ | Nome | Tipo | Descrição |
43
+ | --- | --- | --- |
44
+ | start | number | Valor inicial da faixa (inclusivo). |
45
+ | end | number | Valor final da faixa (inclusivo). |
46
+ | gradientStatus | ProgressStatusBarGradientStatus | Tipo de gradiente aplicado para a faixa. |
47
+
48
+ ### Enum ProgressStatusBarGradientStatus
49
+ - `info`
50
+ - `danger`
51
+ - `success`
52
+ - `alert`
53
+
54
+ ### Outputs
55
+ | Nome | Tipo de Evento | Descrição |
56
+ | --- | --- | --- |
57
+ | (não possui) | - | Componente não emite eventos. |
58
+
59
+ ## Exemplos de Uso
60
+ ### Uso Básico
61
+ ```html
62
+ <tcloud-ui-progress-status-bar
63
+ [currentValue]="42"
64
+ [progressStatusConfig]="statusConfig">
65
+ </tcloud-ui-progress-status-bar>
66
+ ```
67
+
68
+ ### Exemplo com faixas operacionais
69
+ ```ts
70
+ statusConfig = [
71
+ { start: 0, end: 40, gradientStatus: 'success' },
72
+ { start: 41, end: 75, gradientStatus: 'info' },
73
+ { start: 76, end: 90, gradientStatus: 'alert' },
74
+ { start: 91, end: 100, gradientStatus: 'danger' }
75
+ ];
76
+ ```
77
+
78
+ ```html
79
+ <tcloud-ui-progress-status-bar
80
+ [currentValue]="82"
81
+ [progressStatusConfig]="statusConfig">
82
+ </tcloud-ui-progress-status-bar>
83
+ ```
84
+
85
+ ### Valor acima da última faixa
86
+ ```html
87
+ <!-- Usa o gradiente da última faixa configurada -->
88
+ <tcloud-ui-progress-status-bar
89
+ [currentValue]="120"
90
+ [progressStatusConfig]="statusConfig">
91
+ </tcloud-ui-progress-status-bar>
92
+ ```
@@ -5631,6 +5631,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
5631
5631
  type: Input
5632
5632
  }] } });
5633
5633
 
5634
+ var ProgressStatusBarGradientStatus$1;
5635
+ (function (ProgressStatusBarGradientStatus) {
5636
+ ProgressStatusBarGradientStatus["info"] = "info";
5637
+ ProgressStatusBarGradientStatus["danger"] = "danger";
5638
+ ProgressStatusBarGradientStatus["success"] = "success";
5639
+ ProgressStatusBarGradientStatus["alert"] = "alert";
5640
+ })(ProgressStatusBarGradientStatus$1 || (ProgressStatusBarGradientStatus$1 = {}));
5641
+ var ProgressStatusBarRangeColor$1;
5642
+ (function (ProgressStatusBarRangeColor) {
5643
+ ProgressStatusBarRangeColor["dangerStart"] = "#F48E85";
5644
+ ProgressStatusBarRangeColor["dangerEnd"] = "#DC3545";
5645
+ ProgressStatusBarRangeColor["alertStart"] = "#FECD6E";
5646
+ ProgressStatusBarRangeColor["alertEnd"] = "#FEAC0E";
5647
+ ProgressStatusBarRangeColor["infoStart"] = "#6BC1F2";
5648
+ ProgressStatusBarRangeColor["infoEnd"] = "#0897E9";
5649
+ ProgressStatusBarRangeColor["successStart"] = "#A3E78C";
5650
+ ProgressStatusBarRangeColor["successEnd"] = "#47B13D";
5651
+ })(ProgressStatusBarRangeColor$1 || (ProgressStatusBarRangeColor$1 = {}));
5652
+ class TCloudUiProgressStatusBarComponent {
5653
+ constructor() {
5654
+ this.currentValue = input.required();
5655
+ this.progressStatusConfig = input.required();
5656
+ this.backgroundStyle = '';
5657
+ effect(() => {
5658
+ this.backgroundStyle = this.getBackgroundStyle();
5659
+ });
5660
+ }
5661
+ getBackgroundStyle() {
5662
+ if (!this.currentValue())
5663
+ return '';
5664
+ let currentStatusConfig = this.progressStatusConfig().find((x) => (this.currentValue() >= x.start && this.currentValue() <= x.end));
5665
+ const lastStatusConfig = this.progressStatusConfig()[this.progressStatusConfig()?.length - 1];
5666
+ if (!currentStatusConfig && this.currentValue() < lastStatusConfig.end)
5667
+ return '';
5668
+ if (!currentStatusConfig && this.currentValue() > lastStatusConfig.end) {
5669
+ currentStatusConfig = { start: 0, end: 100, gradientStatus: lastStatusConfig.gradientStatus };
5670
+ }
5671
+ const startStatus = this.getProgressStatusBarRangeColor(currentStatusConfig.gradientStatus, 'start');
5672
+ const endStatus = this.getProgressStatusBarRangeColor(currentStatusConfig.gradientStatus, 'end');
5673
+ let style = `width:${this.currentValue()}%;backgroundImage:linear-gradient(90deg`;
5674
+ style += `,${startStatus} 0%,${endStatus} 100%);`;
5675
+ return style;
5676
+ }
5677
+ getProgressStatusBarRangeColor(_gradientStatus, position) {
5678
+ switch (_gradientStatus) {
5679
+ case ProgressStatusBarGradientStatus$1.alert:
5680
+ return position === 'start' ? ProgressStatusBarRangeColor$1.alertStart : ProgressStatusBarRangeColor$1.alertEnd;
5681
+ case ProgressStatusBarGradientStatus$1.danger:
5682
+ return position === 'start' ? ProgressStatusBarRangeColor$1.dangerStart : ProgressStatusBarRangeColor$1.dangerEnd;
5683
+ case ProgressStatusBarGradientStatus$1.success:
5684
+ return position === 'start' ? ProgressStatusBarRangeColor$1.successStart : ProgressStatusBarRangeColor$1.successEnd;
5685
+ default:
5686
+ return position === 'start' ? ProgressStatusBarRangeColor$1.infoStart : ProgressStatusBarRangeColor$1.infoEnd;
5687
+ }
5688
+ }
5689
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TCloudUiProgressStatusBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5690
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.21", type: TCloudUiProgressStatusBarComponent, isStandalone: true, selector: "tcloud-ui-progress-status-bar", inputs: { currentValue: { classPropertyName: "currentValue", publicName: "currentValue", isSignal: true, isRequired: true, transformFunction: null }, progressStatusConfig: { classPropertyName: "progressStatusConfig", publicName: "progressStatusConfig", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"progress-status-bar-container\">\n <div\n class=\"progress-status-bar\"\n [style]=\"this.backgroundStyle\">\n </div>\n</div>\n", styles: [":host{display:block}.progress-status-bar-container{background-color:var(--c-neutral-200);border-radius:var(--bor-radius-pill);display:block;height:var(--size-12);position:relative}.progress-status-bar-container .progress-status-bar{border-radius:var(--bor-radius-pill);display:block;height:var(--size-12);left:0;max-width:100%;position:absolute;top:0;transition:width .2s linear;width:0}\n"] }); }
5691
+ }
5692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TCloudUiProgressStatusBarComponent, decorators: [{
5693
+ type: Component,
5694
+ args: [{ selector: 'tcloud-ui-progress-status-bar', imports: [], template: "<div class=\"progress-status-bar-container\">\n <div\n class=\"progress-status-bar\"\n [style]=\"this.backgroundStyle\">\n </div>\n</div>\n", styles: [":host{display:block}.progress-status-bar-container{background-color:var(--c-neutral-200);border-radius:var(--bor-radius-pill);display:block;height:var(--size-12);position:relative}.progress-status-bar-container .progress-status-bar{border-radius:var(--bor-radius-pill);display:block;height:var(--size-12);left:0;max-width:100%;position:absolute;top:0;transition:width .2s linear;width:0}\n"] }]
5695
+ }], ctorParameters: () => [] });
5696
+
5634
5697
  class TCloudUiReorderItemsComponent {
5635
5698
  constructor() {
5636
5699
  this.sort_items = [];
@@ -7556,7 +7619,7 @@ class TCloudUiPaginationPipe {
7556
7619
  this._tcloudUiPaginationService.notifyCollectionChange(args.id);
7557
7620
  }
7558
7621
  this._previousLengths.set(args.id, currentLength);
7559
- const total = Math.ceil((collection?.length || 0) / args.itemsPerPage);
7622
+ const total = args?.totalPages || Math.ceil((collection?.length || 0) / args.itemsPerPage);
7560
7623
  this._tcloudUiPaginationService.set_total(args, total);
7561
7624
  if (!Array.isArray(collection) ||
7562
7625
  isNaN(args.currentPage) ||
@@ -9020,6 +9083,7 @@ const COMPONENTS = [
9020
9083
  TCloudUiCubesComponent,
9021
9084
  TCloudUiMultiplesValuesComponent,
9022
9085
  TCloudUiProgressBarComponent,
9086
+ TCloudUiProgressStatusBarComponent,
9023
9087
  TCloudUiReorderItemsComponent,
9024
9088
  TCloudUiWelcomeComponent,
9025
9089
  TCloudUiContainerComponent,
@@ -9146,6 +9210,7 @@ class TCloudUiModule {
9146
9210
  TCloudUiCubesComponent,
9147
9211
  TCloudUiMultiplesValuesComponent,
9148
9212
  TCloudUiProgressBarComponent,
9213
+ TCloudUiProgressStatusBarComponent,
9149
9214
  TCloudUiReorderItemsComponent,
9150
9215
  TCloudUiWelcomeComponent,
9151
9216
  TCloudUiContainerComponent,
@@ -9237,6 +9302,7 @@ class TCloudUiModule {
9237
9302
  TCloudUiCubesComponent,
9238
9303
  TCloudUiMultiplesValuesComponent,
9239
9304
  TCloudUiProgressBarComponent,
9305
+ TCloudUiProgressStatusBarComponent,
9240
9306
  TCloudUiReorderItemsComponent,
9241
9307
  TCloudUiWelcomeComponent,
9242
9308
  TCloudUiContainerComponent,
@@ -11309,5 +11375,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
11309
11375
  * Generated bundle index. Do not edit.
11310
11376
  */
11311
11377
 
11312
- export { AcceptedFileType, BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, DateBRPipe, DropdownGroupedSize, DropdownMultiSize$1 as DropdownMultiSize, DropdownSize$1 as DropdownSize, MonthNamePipe, MultiLevelDropdownSize, ProductActionPipe, ProgressStatusBarGradientStatus, RespectivePipe, StatusInfoPipe, TCCondition, TCFiltersType, TCLOUD_UI_CONFIG, TCLOUD_UI_LAYOUT_SERVICE, TCLOUD_UI_LOCALE_SERVICE, TCLOUD_UI_USER_SERVICE, TCLOUD_UI_VIEWPORT_SERVICE, TCloudUiAccordionBodyComponent, TCloudUiAccordionComponent, TCloudUiAccordionTitleComponent, TCloudUiAlertBannerComponent, TCloudUiAlignDirective, TCloudUiBreadcrumbComponent, TCloudUiBreadcrumbService, TCloudUiButtonDirective, TCloudUiCalendarComponent, TCloudUiCardAccordionComponent, TCloudUiCardComponent, TCloudUiCardTitleComponent, TCloudUiCheckAccessDirective, TCloudUiCheckAccessService, TCloudUiCheckboxDirective, TCloudUiChoiceIssuesComponent, TCloudUiContainerColComponent, TCloudUiContainerComponent, TCloudUiContainerContentComponent, TCloudUiCubesComponent, TCloudUiCurrencyDirective, TCloudUiDataListComponent, TCloudUiDataListOptionComponent, TCloudUiDatepickerComponent, TCloudUiDatepickerTimeComponent, TCloudUiDigitOnlyDirective, TCloudUiDropdownComponent, TCloudUiDropdownMultiComponent, TCloudUiElCopyDirective, TCloudUiEmptyContentComponent, TCloudUiFaqComponent, TCloudUiFilterBarComponent, TCloudUiFiltersComponent, TCloudUiFormDirective, TCloudUiHighLightDirective, TCloudUiHoverParentDirective, TCloudUiIconButtonDirective, TCloudUiInputContainerComponent, TCloudUiInputDirective, TCloudUiInputPasswordComponent, TCloudUiInputSearchComponent, TCloudUiIpMaskDirective, TCloudUiLabelTokenComponent, TCloudUiLegendComponent, TCloudUiLineStepCircleComponent, TCloudUiLineStepTitleComponent, TCloudUiLinhaLogoComponent, TCloudUiLoadingComponent, TCloudUiLoadingTransitionsService, TCloudUiMessageComponent, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiSelectComponent, TCloudUiMultiplesValuesComponent, TCloudUiNgCheckAccessDirective, TCloudUiNgFeatureFlagsDirective, TCloudUiNotFoundComponent, TCloudUiNumberStepComponent, TCloudUiPaginationComponent, TCloudUiPaginationPipe, TCloudUiProgressBarComponent, TCloudUiRadioDirective, TCloudUiRangeDateComponent, TCloudUiReorderItemsComponent, TCloudUiScrollBoxComponent, TCloudUiSearchBarComponent, TCloudUiSearchInObjectService, TCloudUiSearchInputComponent, TCloudUiSkeletonLoadingComponent, TCloudUiSkeletonLoadingComponentStyle, TCloudUiSlideToggleDirective, TCloudUiSubNavbarComponent, TCloudUiSubNavbarGroupComponent, TCloudUiSubNavbarItemComponent, TCloudUiTabContentComponent, TCloudUiTabGroupComponent, TCloudUiTabHeadComponent, TCloudUiTabItemComponent, TCloudUiTabMenuComponent, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTagComponent, TCloudUiToastComponent, TCloudUiTooltipDirective, TCloudUiUploadAreaComponent, TCloudUiWelcomeComponent, TCloudUiWizardStepsComponent, TagColorsEnum, TcRevButtonDirective, TcRevCalendarComponent, TcRevCardAccordionComponent, TcRevCardComponent, TcRevCardTitleComponent, TcRevCheckboxDirective, TcRevComponentsLibModule, TcRevDropdownComponent, TcRevDropdownGroupedComponent, TcRevDropdownMultiComponent, TcRevDropdownMultiLevelComponent, TcRevEmptyContentComponent, TcRevFaqComponent, TcRevIconButtonDirective, TcRevInputContainerComponent, TcRevInputDirective, TcRevLoadingComponent, TcRevMessageComponent, TcRevMultiInputComponent, TcRevPaginationComponent, TcRevProgressStatusBarComponent, TcRevRadioDirective, TcRevSearchInputComponent, TcRevSideDrawerComponent, TcRevSkeletonLoadingComponent, TcRevSkeletonLoadingComponentStyle, TcRevSlideToggleDirective, TcRevSmallLoadingComponent, TcRevSmallLoadingComponentStyle, TcRevSubNavbarComponent, TcRevSubNavbarItemComponent, TcRevTabGroupComponent, TcRevTabItemComponent, TcRevTagComponent, TcRevToastComponent, TcRevTooltipDirective, TcRevWizardStepsComponent, ToTextPipe, TopologyEnvironmentPipe, TopologyProductPipe, TopologyRegionPipe, TopologyStatusPipe, echartBarConfig, isTextEllipsed, provideTCloudUi };
11378
+ export { AcceptedFileType, BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, DateBRPipe, DropdownGroupedSize, DropdownMultiSize$1 as DropdownMultiSize, DropdownSize$1 as DropdownSize, MonthNamePipe, MultiLevelDropdownSize, ProductActionPipe, ProgressStatusBarGradientStatus$1 as ProgressStatusBarGradientStatus, RespectivePipe, StatusInfoPipe, TCCondition, TCFiltersType, TCLOUD_UI_CONFIG, TCLOUD_UI_LAYOUT_SERVICE, TCLOUD_UI_LOCALE_SERVICE, TCLOUD_UI_USER_SERVICE, TCLOUD_UI_VIEWPORT_SERVICE, TCloudUiAccordionBodyComponent, TCloudUiAccordionComponent, TCloudUiAccordionTitleComponent, TCloudUiAlertBannerComponent, TCloudUiAlignDirective, TCloudUiBreadcrumbComponent, TCloudUiBreadcrumbService, TCloudUiButtonDirective, TCloudUiCalendarComponent, TCloudUiCardAccordionComponent, TCloudUiCardComponent, TCloudUiCardTitleComponent, TCloudUiCheckAccessDirective, TCloudUiCheckAccessService, TCloudUiCheckboxDirective, TCloudUiChoiceIssuesComponent, TCloudUiContainerColComponent, TCloudUiContainerComponent, TCloudUiContainerContentComponent, TCloudUiCubesComponent, TCloudUiCurrencyDirective, TCloudUiDataListComponent, TCloudUiDataListOptionComponent, TCloudUiDatepickerComponent, TCloudUiDatepickerTimeComponent, TCloudUiDigitOnlyDirective, TCloudUiDropdownComponent, TCloudUiDropdownMultiComponent, TCloudUiElCopyDirective, TCloudUiEmptyContentComponent, TCloudUiFaqComponent, TCloudUiFilterBarComponent, TCloudUiFiltersComponent, TCloudUiFormDirective, TCloudUiHighLightDirective, TCloudUiHoverParentDirective, TCloudUiIconButtonDirective, TCloudUiInputContainerComponent, TCloudUiInputDirective, TCloudUiInputPasswordComponent, TCloudUiInputSearchComponent, TCloudUiIpMaskDirective, TCloudUiLabelTokenComponent, TCloudUiLegendComponent, TCloudUiLineStepCircleComponent, TCloudUiLineStepTitleComponent, TCloudUiLinhaLogoComponent, TCloudUiLoadingComponent, TCloudUiLoadingTransitionsService, TCloudUiMessageComponent, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiSelectComponent, TCloudUiMultiplesValuesComponent, TCloudUiNgCheckAccessDirective, TCloudUiNgFeatureFlagsDirective, TCloudUiNotFoundComponent, TCloudUiNumberStepComponent, TCloudUiPaginationComponent, TCloudUiPaginationPipe, TCloudUiProgressBarComponent, TCloudUiProgressStatusBarComponent, TCloudUiRadioDirective, TCloudUiRangeDateComponent, TCloudUiReorderItemsComponent, TCloudUiScrollBoxComponent, TCloudUiSearchBarComponent, TCloudUiSearchInObjectService, TCloudUiSearchInputComponent, TCloudUiSkeletonLoadingComponent, TCloudUiSkeletonLoadingComponentStyle, TCloudUiSlideToggleDirective, TCloudUiSubNavbarComponent, TCloudUiSubNavbarGroupComponent, TCloudUiSubNavbarItemComponent, TCloudUiTabContentComponent, TCloudUiTabGroupComponent, TCloudUiTabHeadComponent, TCloudUiTabItemComponent, TCloudUiTabMenuComponent, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTagComponent, TCloudUiToastComponent, TCloudUiTooltipDirective, TCloudUiUploadAreaComponent, TCloudUiWelcomeComponent, TCloudUiWizardStepsComponent, TagColorsEnum, TcRevButtonDirective, TcRevCalendarComponent, TcRevCardAccordionComponent, TcRevCardComponent, TcRevCardTitleComponent, TcRevCheckboxDirective, TcRevComponentsLibModule, TcRevDropdownComponent, TcRevDropdownGroupedComponent, TcRevDropdownMultiComponent, TcRevDropdownMultiLevelComponent, TcRevEmptyContentComponent, TcRevFaqComponent, TcRevIconButtonDirective, TcRevInputContainerComponent, TcRevInputDirective, TcRevLoadingComponent, TcRevMessageComponent, TcRevMultiInputComponent, TcRevPaginationComponent, TcRevProgressStatusBarComponent, TcRevRadioDirective, TcRevSearchInputComponent, TcRevSideDrawerComponent, TcRevSkeletonLoadingComponent, TcRevSkeletonLoadingComponentStyle, TcRevSlideToggleDirective, TcRevSmallLoadingComponent, TcRevSmallLoadingComponentStyle, TcRevSubNavbarComponent, TcRevSubNavbarItemComponent, TcRevTabGroupComponent, TcRevTabItemComponent, TcRevTagComponent, TcRevToastComponent, TcRevTooltipDirective, TcRevWizardStepsComponent, ToTextPipe, TopologyEnvironmentPipe, TopologyProductPipe, TopologyRegionPipe, TopologyStatusPipe, echartBarConfig, isTextEllipsed, provideTCloudUi };
11313
11379
  //# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map