@indice/ng-components 0.2.173-beta.1 → 0.2.173-beta.10

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,86 @@ 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
+
2683
+ class ProgressBarComponent {
2684
+ constructor() {
2685
+ this.value = 0;
2686
+ this.total = 0;
2687
+ this.text = undefined;
2688
+ this.percentage = 0;
2689
+ }
2690
+ ngOnChanges(changes) {
2691
+ if (changes.value || changes.total) {
2692
+ this.calcPercentage();
2693
+ }
2694
+ }
2695
+ calcPercentage() {
2696
+ if (this.total > 0) {
2697
+ this.percentage = (this.value / this.total) * 100;
2698
+ }
2699
+ else {
2700
+ this.percentage = 0;
2701
+ }
2702
+ }
2703
+ }
2704
+ ProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2705
+ 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 " });
2706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, decorators: [{
2707
+ type: Component,
2708
+ 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 " }]
2709
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
2710
+ type: Input
2711
+ }], total: [{
2712
+ type: Input
2713
+ }], text: [{
2714
+ type: Input
2715
+ }] } });
2716
+
2637
2717
  class DynamicComponentHostDirective {
2638
2718
  constructor(viewContainerRef) {
2639
2719
  this.viewContainerRef = viewContainerRef;
@@ -3975,6 +4055,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
3975
4055
  }]
3976
4056
  }] });
3977
4057
 
4058
+ class ShortNumberPipe {
4059
+ transform(number, args) {
4060
+ if (isNaN(number))
4061
+ return null; // will only work value is a number
4062
+ if (number === null)
4063
+ return null;
4064
+ if (number === 0)
4065
+ return null;
4066
+ let abs = Math.abs(number);
4067
+ const rounder = Math.pow(10, 1);
4068
+ const isNegative = number < 0; // will also work for Negative numbers
4069
+ let key = '';
4070
+ const powers = [
4071
+ { key: 'Q', value: Math.pow(10, 15) },
4072
+ { key: 'T', value: Math.pow(10, 12) },
4073
+ { key: 'B', value: Math.pow(10, 9) },
4074
+ { key: 'M', value: Math.pow(10, 6) },
4075
+ { key: 'K', value: 1000 }
4076
+ ];
4077
+ for (let i = 0; i < powers.length; i++) {
4078
+ let reduced = abs / powers[i].value;
4079
+ reduced = Math.round(reduced * rounder) / rounder;
4080
+ if (reduced >= 1) {
4081
+ abs = reduced;
4082
+ key = powers[i].key;
4083
+ break;
4084
+ }
4085
+ }
4086
+ return (isNegative ? '-' : '') + abs + key;
4087
+ }
4088
+ }
4089
+ ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4090
+ ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
4091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
4092
+ type: Pipe,
4093
+ args: [{
4094
+ name: 'shortNumber',
4095
+ pure: false
4096
+ }]
4097
+ }] });
4098
+
3978
4099
  class BaseListComponent {
3979
4100
  constructor(route$, router$) {
3980
4101
  this.route$ = route$;
@@ -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,
@@ -4707,7 +4829,11 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4707
4829
  ViewLayoutComponent,
4708
4830
  ToggleButtonComponent,
4709
4831
  ToggleButtonsListComponent,
4710
- ContentTileComponent], imports: [CommonModule,
4832
+ ContentTileComponent,
4833
+ ContentTileItemComponent,
4834
+ ContentTileHeaderComponent,
4835
+ StatsGridComponent,
4836
+ ProgressBarComponent], imports: [CommonModule,
4711
4837
  RouterModule,
4712
4838
  IndiceAuthModule,
4713
4839
  FormsModule], exports: [AddressPipe,
@@ -4721,6 +4847,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4721
4847
  DatepickerComponent,
4722
4848
  DropDownMenuComponent,
4723
4849
  DurationFormatPipe,
4850
+ ShortNumberPipe,
4724
4851
  ErrorComponent,
4725
4852
  FormLayoutComponent,
4726
4853
  KpiTileComponent,
@@ -4752,7 +4879,12 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4752
4879
  UnauthorizedComponent,
4753
4880
  ViewLayoutComponent,
4754
4881
  ToggleButtonComponent,
4755
- ToggleButtonsListComponent] });
4882
+ ToggleButtonsListComponent,
4883
+ ContentTileComponent,
4884
+ ContentTileItemComponent,
4885
+ ContentTileHeaderComponent,
4886
+ StatsGridComponent,
4887
+ ProgressBarComponent] });
4756
4888
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4757
4889
  RouterModule,
4758
4890
  IndiceAuthModule,
@@ -4773,6 +4905,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4773
4905
  DatepickerComponent,
4774
4906
  DropDownMenuComponent,
4775
4907
  DurationFormatPipe,
4908
+ ShortNumberPipe,
4776
4909
  DynamicComponentHostDirective,
4777
4910
  ErrorComponent,
4778
4911
  FormLayoutComponent,
@@ -4814,7 +4947,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4814
4947
  ViewLayoutComponent,
4815
4948
  ToggleButtonComponent,
4816
4949
  ToggleButtonsListComponent,
4817
- ContentTileComponent
4950
+ ContentTileComponent,
4951
+ ContentTileItemComponent,
4952
+ ContentTileHeaderComponent,
4953
+ StatsGridComponent,
4954
+ ProgressBarComponent
4818
4955
  ],
4819
4956
  imports: [
4820
4957
  CommonModule,
@@ -4834,6 +4971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4834
4971
  DatepickerComponent,
4835
4972
  DropDownMenuComponent,
4836
4973
  DurationFormatPipe,
4974
+ ShortNumberPipe,
4837
4975
  ErrorComponent,
4838
4976
  FormLayoutComponent,
4839
4977
  KpiTileComponent,
@@ -4865,7 +5003,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4865
5003
  UnauthorizedComponent,
4866
5004
  ViewLayoutComponent,
4867
5005
  ToggleButtonComponent,
4868
- ToggleButtonsListComponent
5006
+ ToggleButtonsListComponent,
5007
+ ContentTileComponent,
5008
+ ContentTileItemComponent,
5009
+ ContentTileHeaderComponent,
5010
+ StatsGridComponent,
5011
+ ProgressBarComponent
4869
5012
  ]
4870
5013
  }]
4871
5014
  }] });
@@ -4876,5 +5019,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4876
5019
  * Generated bundle index. Do not edit.
4877
5020
  */
4878
5021
 
4879
- 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 };
5022
+ 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, ProgressBarComponent, 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 };
4880
5023
  //# sourceMappingURL=indice-ng-components.mjs.map