@indice/ng-components 0.2.173-beta.3 → 0.2.173-beta.8

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.
@@ -2634,6 +2634,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
2634
2634
  args: [ContentTileHeaderComponent]
2635
2635
  }] } });
2636
2636
 
2637
+ class StatsGridComponent {
2638
+ constructor() {
2639
+ this.busy = false;
2640
+ this.count = 6;
2641
+ this.loader = ['', '', '', '', '', ''];
2642
+ this.mode = 'normal';
2643
+ this.labels = ['Online', 'Offline', 'Faulted'];
2644
+ this.values = [10, 20, 30];
2645
+ this.colors = [
2646
+ 'rgb(53, 177, 201, 0.6)',
2647
+ 'rgb(168, 162, 158, 0.2)',
2648
+ 'rgb(233, 96, 96, 0.8)'
2649
+ ];
2650
+ }
2651
+ ngOnChanges(changes) {
2652
+ if (changes.count) {
2653
+ this.loader = [];
2654
+ for (let i = 0; i <= this.count; i++) {
2655
+ this.loader.push('');
2656
+ }
2657
+ }
2658
+ }
2659
+ isNumber(value) {
2660
+ return !isNaN(Number(value));
2661
+ ;
2662
+ }
2663
+ }
2664
+ StatsGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: StatsGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2665
+ StatsGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: StatsGridComponent, selector: "lib-stats-grid", inputs: { busy: "busy", count: "count", mode: "mode", labels: "labels", values: "values", colors: "colors" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!busy\">\n <ul role=\"list\" class=\"grid gap-1\"\n [class.grid-cols-3]=\"mode==='normal'\"\n [class.grid-cols-5]=\"mode!=='normal'\"\n [class.grid-flow-col]=\"mode!=='normal'\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <li class=\"col-span-1 flex pb-2\" *ngIf=\"mode==='normal'\">\n <div class=\"grid-cols-1 border-l-2 px-1\" [style]=\"'border-color:' + colors[i]\">\n <div class=\"text-xs text-ellipsis overflow-hidden\">{{labels[i]}}</div>\n <div *ngIf=\"isNumber(values[i])\" class=\"font-medium text-sm md:text-lg text-ellipsis overflow-hidden\">{{values[i] | number:'1.0-2':'el'}}</div>\n <div *ngIf=\"!isNumber(values[i])\" class=\"font-medium text-sm md:text-lg text-ellipsis overflow-hidden\">{{values[i]}}</div>\n </div>\n </li>\n <li class=\"col-span-1 flex pb-2\" *ngIf=\"mode!=='normal'\">\n <div class=\"grid-cols-1 border-l-2 pl-1 pr-2\" [style]=\"'border-color:' + colors[i]\">\n <div *ngIf=\"isNumber(values[i])\" class=\"font-medium text-xs lg:text-sm text-ellipsis overflow-hidden\">{{values[i] | number:'1.0-2':'el'}}</div>\n <div *ngIf=\"!isNumber(values[i])\" class=\"font-medium text-xs lg:text-sm text-ellipsis overflow-hidden\">{{values[i]}}</div>\n <div class=\"text-xs max-w-18 lg:w-auto truncate text-ellipsis overflow-hidden\">{{labels[i]}}</div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div *ngIf=\"busy\">\n <ul role=\"list\" class=\"grid gap-1\"\n [class.grid-cols-3]=\"mode==='normal'\"\n [class.grid-cols-5]=\"mode!=='normal'\"\n [class.grid-flow-col]=\"mode!=='normal'\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <li class=\"animate-pulse col-span-1 flex pb-2\" *ngIf=\"mode==='normal'\">\n <div class=\"grid-cols-1 border-l-2 px-1\" style=\"border-color:rgb(168, 162, 158, 0.2)\">\n <div class=\"rounded-md bg-slate-400/25 h-3 w-14\"></div>\n <div class=\"rounded-md bg-slate-400/25 mt-2 h-4 w-6\"></div>\n </div>\n </li>\n <li class=\"animate-pulse col-span-1 flex pb-2\" *ngIf=\"mode!=='normal'\">\n <div class=\"grid-cols-1 border-l-2 pl-1 pr-2\" style=\"border-color:rgb(168, 162, 158, 0.2)\">\n <div class=\"rounded-md bg-slate-400/25 h-3 w-14\"></div>\n <div class=\"rounded-md bg-slate-400/25 mt-2 h-4 w-6\"></div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div> ", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] });
2666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: StatsGridComponent, decorators: [{
2667
+ type: Component,
2668
+ args: [{ selector: 'lib-stats-grid', template: "<div *ngIf=\"!busy\">\n <ul role=\"list\" class=\"grid gap-1\"\n [class.grid-cols-3]=\"mode==='normal'\"\n [class.grid-cols-5]=\"mode!=='normal'\"\n [class.grid-flow-col]=\"mode!=='normal'\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <li class=\"col-span-1 flex pb-2\" *ngIf=\"mode==='normal'\">\n <div class=\"grid-cols-1 border-l-2 px-1\" [style]=\"'border-color:' + colors[i]\">\n <div class=\"text-xs text-ellipsis overflow-hidden\">{{labels[i]}}</div>\n <div *ngIf=\"isNumber(values[i])\" class=\"font-medium text-sm md:text-lg text-ellipsis overflow-hidden\">{{values[i] | number:'1.0-2':'el'}}</div>\n <div *ngIf=\"!isNumber(values[i])\" class=\"font-medium text-sm md:text-lg text-ellipsis overflow-hidden\">{{values[i]}}</div>\n </div>\n </li>\n <li class=\"col-span-1 flex pb-2\" *ngIf=\"mode!=='normal'\">\n <div class=\"grid-cols-1 border-l-2 pl-1 pr-2\" [style]=\"'border-color:' + colors[i]\">\n <div *ngIf=\"isNumber(values[i])\" class=\"font-medium text-xs lg:text-sm text-ellipsis overflow-hidden\">{{values[i] | number:'1.0-2':'el'}}</div>\n <div *ngIf=\"!isNumber(values[i])\" class=\"font-medium text-xs lg:text-sm text-ellipsis overflow-hidden\">{{values[i]}}</div>\n <div class=\"text-xs max-w-18 lg:w-auto truncate text-ellipsis overflow-hidden\">{{labels[i]}}</div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div *ngIf=\"busy\">\n <ul role=\"list\" class=\"grid gap-1\"\n [class.grid-cols-3]=\"mode==='normal'\"\n [class.grid-cols-5]=\"mode!=='normal'\"\n [class.grid-flow-col]=\"mode!=='normal'\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <li class=\"animate-pulse col-span-1 flex pb-2\" *ngIf=\"mode==='normal'\">\n <div class=\"grid-cols-1 border-l-2 px-1\" style=\"border-color:rgb(168, 162, 158, 0.2)\">\n <div class=\"rounded-md bg-slate-400/25 h-3 w-14\"></div>\n <div class=\"rounded-md bg-slate-400/25 mt-2 h-4 w-6\"></div>\n </div>\n </li>\n <li class=\"animate-pulse col-span-1 flex pb-2\" *ngIf=\"mode!=='normal'\">\n <div class=\"grid-cols-1 border-l-2 pl-1 pr-2\" style=\"border-color:rgb(168, 162, 158, 0.2)\">\n <div class=\"rounded-md bg-slate-400/25 h-3 w-14\"></div>\n <div class=\"rounded-md bg-slate-400/25 mt-2 h-4 w-6\"></div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div> " }]
2669
+ }], ctorParameters: function () { return []; }, propDecorators: { busy: [{
2670
+ type: Input
2671
+ }], count: [{
2672
+ type: Input
2673
+ }], mode: [{
2674
+ type: Input
2675
+ }], labels: [{
2676
+ type: Input
2677
+ }], values: [{
2678
+ type: Input
2679
+ }], colors: [{
2680
+ type: Input
2681
+ }] } });
2682
+
2637
2683
  class DynamicComponentHostDirective {
2638
2684
  constructor(viewContainerRef) {
2639
2685
  this.viewContainerRef = viewContainerRef;
@@ -3975,6 +4021,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
3975
4021
  }]
3976
4022
  }] });
3977
4023
 
4024
+ class ShortNumberPipe {
4025
+ transform(number, args) {
4026
+ if (isNaN(number))
4027
+ return null; // will only work value is a number
4028
+ if (number === null)
4029
+ return null;
4030
+ if (number === 0)
4031
+ return null;
4032
+ let abs = Math.abs(number);
4033
+ const rounder = Math.pow(10, 1);
4034
+ const isNegative = number < 0; // will also work for Negative numbers
4035
+ let key = '';
4036
+ const powers = [
4037
+ { key: 'Q', value: Math.pow(10, 15) },
4038
+ { key: 'T', value: Math.pow(10, 12) },
4039
+ { key: 'B', value: Math.pow(10, 9) },
4040
+ { key: 'M', value: Math.pow(10, 6) },
4041
+ { key: 'K', value: 1000 }
4042
+ ];
4043
+ for (let i = 0; i < powers.length; i++) {
4044
+ let reduced = abs / powers[i].value;
4045
+ reduced = Math.round(reduced * rounder) / rounder;
4046
+ if (reduced >= 1) {
4047
+ abs = reduced;
4048
+ key = powers[i].key;
4049
+ break;
4050
+ }
4051
+ }
4052
+ return (isNegative ? '-' : '') + abs + key;
4053
+ }
4054
+ }
4055
+ ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4056
+ ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
4057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
4058
+ type: Pipe,
4059
+ args: [{
4060
+ name: 'shortNumber',
4061
+ pure: false
4062
+ }]
4063
+ }] });
4064
+
3978
4065
  class BaseListComponent {
3979
4066
  constructor(route$, router$) {
3980
4067
  this.route$ = route$;
@@ -4641,6 +4728,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4641
4728
  }] }];
4642
4729
  } });
4643
4730
 
4731
+ class ProgressBarComponent {
4732
+ constructor() {
4733
+ this.value = 0;
4734
+ this.total = 0;
4735
+ this.text = undefined;
4736
+ this.percentage = 0;
4737
+ }
4738
+ ngOnChanges(changes) {
4739
+ if (changes.value || changes.total) {
4740
+ this.calcPercentage();
4741
+ }
4742
+ }
4743
+ calcPercentage() {
4744
+ if (this.total > 0) {
4745
+ this.percentage = (this.value / this.total) * 100;
4746
+ }
4747
+ else {
4748
+ this.percentage = 0;
4749
+ }
4750
+ }
4751
+ }
4752
+ ProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4753
+ ProgressBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.3", type: ProgressBarComponent, selector: "lib-progress-bar", inputs: { value: "value", total: "total", text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex grid grid-cols-1\">\n <div class=\"text-xs mt-2 truncate text-ellipsis\">{{value}}/{{total}} {{text}}</div>\n <div class=\"flex mt-1 h-4 rounded-md backdrop-blur-sm bg-slate-200/25\">\n <div class=\"h-2 m-1 rounded-md bg-sky-200 transition-[width] ease duration-300 transform\" [style]=\"'width:' + percentage + '%' \"></div>\n </div>\n </div>\n " });
4754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, decorators: [{
4755
+ type: Component,
4756
+ args: [{ selector: 'lib-progress-bar', template: "<div class=\"flex grid grid-cols-1\">\n <div class=\"text-xs mt-2 truncate text-ellipsis\">{{value}}/{{total}} {{text}}</div>\n <div class=\"flex mt-1 h-4 rounded-md backdrop-blur-sm bg-slate-200/25\">\n <div class=\"h-2 m-1 rounded-md bg-sky-200 transition-[width] ease duration-300 transform\" [style]=\"'width:' + percentage + '%' \"></div>\n </div>\n </div>\n " }]
4757
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
4758
+ type: Input
4759
+ }], total: [{
4760
+ type: Input
4761
+ }], text: [{
4762
+ type: Input
4763
+ }] } });
4764
+
4644
4765
  class IndiceComponentsModule {
4645
4766
  static forRoot() {
4646
4767
  return {
@@ -4666,6 +4787,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4666
4787
  DatepickerComponent,
4667
4788
  DropDownMenuComponent,
4668
4789
  DurationFormatPipe,
4790
+ ShortNumberPipe,
4669
4791
  DynamicComponentHostDirective,
4670
4792
  ErrorComponent,
4671
4793
  FormLayoutComponent,
@@ -4709,7 +4831,9 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4709
4831
  ToggleButtonsListComponent,
4710
4832
  ContentTileComponent,
4711
4833
  ContentTileItemComponent,
4712
- ContentTileHeaderComponent], imports: [CommonModule,
4834
+ ContentTileHeaderComponent,
4835
+ StatsGridComponent,
4836
+ ProgressBarComponent], imports: [CommonModule,
4713
4837
  RouterModule,
4714
4838
  IndiceAuthModule,
4715
4839
  FormsModule], exports: [AddressPipe,
@@ -4723,6 +4847,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4723
4847
  DatepickerComponent,
4724
4848
  DropDownMenuComponent,
4725
4849
  DurationFormatPipe,
4850
+ ShortNumberPipe,
4726
4851
  ErrorComponent,
4727
4852
  FormLayoutComponent,
4728
4853
  KpiTileComponent,
@@ -4757,7 +4882,8 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4757
4882
  ToggleButtonsListComponent,
4758
4883
  ContentTileComponent,
4759
4884
  ContentTileItemComponent,
4760
- ContentTileHeaderComponent] });
4885
+ ContentTileHeaderComponent,
4886
+ StatsGridComponent] });
4761
4887
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4762
4888
  RouterModule,
4763
4889
  IndiceAuthModule,
@@ -4778,6 +4904,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4778
4904
  DatepickerComponent,
4779
4905
  DropDownMenuComponent,
4780
4906
  DurationFormatPipe,
4907
+ ShortNumberPipe,
4781
4908
  DynamicComponentHostDirective,
4782
4909
  ErrorComponent,
4783
4910
  FormLayoutComponent,
@@ -4821,7 +4948,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4821
4948
  ToggleButtonsListComponent,
4822
4949
  ContentTileComponent,
4823
4950
  ContentTileItemComponent,
4824
- ContentTileHeaderComponent
4951
+ ContentTileHeaderComponent,
4952
+ StatsGridComponent,
4953
+ ProgressBarComponent
4825
4954
  ],
4826
4955
  imports: [
4827
4956
  CommonModule,
@@ -4841,6 +4970,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4841
4970
  DatepickerComponent,
4842
4971
  DropDownMenuComponent,
4843
4972
  DurationFormatPipe,
4973
+ ShortNumberPipe,
4844
4974
  ErrorComponent,
4845
4975
  FormLayoutComponent,
4846
4976
  KpiTileComponent,
@@ -4875,7 +5005,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4875
5005
  ToggleButtonsListComponent,
4876
5006
  ContentTileComponent,
4877
5007
  ContentTileItemComponent,
4878
- ContentTileHeaderComponent
5008
+ ContentTileHeaderComponent,
5009
+ StatsGridComponent
4879
5010
  ]
4880
5011
  }]
4881
5012
  }] });
@@ -4886,5 +5017,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4886
5017
  * Generated bundle index. Do not edit.
4887
5018
  */
4888
5019
 
4889
- export { APP_LANGUAGES, APP_LINKS, APP_NOTIFICATIONS, AddressPipe, AuthCallbackComponent, AuthRenewComponent, AvatarInitialsComponent, BaseListComponent, BreadcrumbComponent, BreadcrumbItem, BreadcrumbRouteData, BreadcrumbService, ClickOutsideDirective, CollapsiblePanelComponent, ComboboxComponent, ComponentLoaderFactory, ContentTileComponent, ContentTileHeaderComponent, ContentTileItemComponent, DatepickerComponent, DefaultShellConfig, DropDownMenuComponent, DurationFormatPipe, ErrorComponent, ExternalNavLink, FormLayoutComponent, FragmentNavLink, HeaderMetaItem, Icons, IndiceComponentsModule, KpiTileComponent, LIBSTEPPER_ACCESSOR, LIBTABGROUP_ACCESSOR, LibStepComponent, LibStepInfoDirective, LibStepLabelDirective, LibStepperComponent, LibTabComponent, LibTabGroupComponent, LibTabLabelDirective, ListColumnComponent, ListDetailsSectionComponent, ListTileComponent, ListViewComponent, ListViewEmptyStateComponent, ListViewType, LoggedOutComponent, MODAL_CONFIG_DEFAULT_OVERRIDE, MenuOption, Modal, ModalOptions, ModalService, ModelViewLayoutComponent, NULL_TOAST, NavLink, NavLinksListComponent, NotificationNavLink, PageNotFoundComponent, PagerComponent, PagerPosition, RouterViewAction, SCREEN_SIZE, SHELL_CONFIG, ShellFooterComponent, ShellHeaderComponent, ShellLayoutComponent, ShellLayoutType, ShellSidebarComponent, ShellSidebarHeaderComponent, SidePaneComponent, SidePaneOverlayType, SidePaneSize, SideViewLayoutComponent, SkeletonLoaderComponent, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleButtonComponent, ToggleButtonsListComponent, ToggleComponent, UnauthorizedComponent, UserSettingsService, ViewAction, ViewLayoutComponent };
5020
+ export { APP_LANGUAGES, APP_LINKS, APP_NOTIFICATIONS, AddressPipe, AuthCallbackComponent, AuthRenewComponent, AvatarInitialsComponent, BaseListComponent, BreadcrumbComponent, BreadcrumbItem, BreadcrumbRouteData, BreadcrumbService, ClickOutsideDirective, CollapsiblePanelComponent, ComboboxComponent, ComponentLoaderFactory, ContentTileComponent, ContentTileHeaderComponent, ContentTileItemComponent, DatepickerComponent, DefaultShellConfig, DropDownMenuComponent, DurationFormatPipe, ErrorComponent, ExternalNavLink, FormLayoutComponent, FragmentNavLink, HeaderMetaItem, Icons, IndiceComponentsModule, KpiTileComponent, LIBSTEPPER_ACCESSOR, LIBTABGROUP_ACCESSOR, LibStepComponent, LibStepInfoDirective, LibStepLabelDirective, LibStepperComponent, LibTabComponent, LibTabGroupComponent, LibTabLabelDirective, ListColumnComponent, ListDetailsSectionComponent, ListTileComponent, ListViewComponent, ListViewEmptyStateComponent, ListViewType, LoggedOutComponent, MODAL_CONFIG_DEFAULT_OVERRIDE, MenuOption, Modal, ModalOptions, ModalService, ModelViewLayoutComponent, NULL_TOAST, NavLink, NavLinksListComponent, NotificationNavLink, PageNotFoundComponent, PagerComponent, PagerPosition, RouterViewAction, SCREEN_SIZE, SHELL_CONFIG, ShellFooterComponent, ShellHeaderComponent, ShellLayoutComponent, ShellLayoutType, ShellSidebarComponent, ShellSidebarHeaderComponent, ShortNumberPipe, SidePaneComponent, SidePaneOverlayType, SidePaneSize, SideViewLayoutComponent, SkeletonLoaderComponent, StatsGridComponent, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleButtonComponent, ToggleButtonsListComponent, ToggleComponent, UnauthorizedComponent, UserSettingsService, ViewAction, ViewLayoutComponent };
4890
5021
  //# sourceMappingURL=indice-ng-components.mjs.map