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

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,92 @@ 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", valueText: ["value-text", "valueText"], total: "total", totalText: ["total-text", "totalText"], text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex grid grid-cols-1\">\n <div class=\"text-xs mt-2 truncate text-ellipsis\">{{text}} {{valueText ?? value}}/{{totalText ?? total}} </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\">{{text}} {{valueText ?? value}}/{{totalText ?? total}} </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
+ }], valueText: [{
2712
+ type: Input,
2713
+ args: ['value-text']
2714
+ }], total: [{
2715
+ type: Input
2716
+ }], totalText: [{
2717
+ type: Input,
2718
+ args: ['total-text']
2719
+ }], text: [{
2720
+ type: Input
2721
+ }] } });
2722
+
2637
2723
  class DynamicComponentHostDirective {
2638
2724
  constructor(viewContainerRef) {
2639
2725
  this.viewContainerRef = viewContainerRef;
@@ -3975,6 +4061,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
3975
4061
  }]
3976
4062
  }] });
3977
4063
 
4064
+ class ShortNumberPipe {
4065
+ transform(number, args) {
4066
+ if (isNaN(number))
4067
+ return null; // will only work value is a number
4068
+ if (number === null)
4069
+ return null;
4070
+ if (number === 0)
4071
+ return null;
4072
+ let abs = Math.abs(number);
4073
+ const rounder = Math.pow(10, 1);
4074
+ const isNegative = number < 0; // will also work for Negative numbers
4075
+ let key = '';
4076
+ const powers = [
4077
+ { key: 'Q', value: Math.pow(10, 15) },
4078
+ { key: 'T', value: Math.pow(10, 12) },
4079
+ { key: 'B', value: Math.pow(10, 9) },
4080
+ { key: 'M', value: Math.pow(10, 6) },
4081
+ { key: 'K', value: 1000 }
4082
+ ];
4083
+ for (let i = 0; i < powers.length; i++) {
4084
+ let reduced = abs / powers[i].value;
4085
+ reduced = Math.round(reduced * rounder) / rounder;
4086
+ if (reduced >= 1) {
4087
+ abs = reduced;
4088
+ key = powers[i].key;
4089
+ break;
4090
+ }
4091
+ }
4092
+ return (isNegative ? '-' : '') + abs + key;
4093
+ }
4094
+ }
4095
+ ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4096
+ ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
4097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
4098
+ type: Pipe,
4099
+ args: [{
4100
+ name: 'shortNumber',
4101
+ pure: false
4102
+ }]
4103
+ }] });
4104
+
3978
4105
  class BaseListComponent {
3979
4106
  constructor(route$, router$) {
3980
4107
  this.route$ = route$;
@@ -4666,6 +4793,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4666
4793
  DatepickerComponent,
4667
4794
  DropDownMenuComponent,
4668
4795
  DurationFormatPipe,
4796
+ ShortNumberPipe,
4669
4797
  DynamicComponentHostDirective,
4670
4798
  ErrorComponent,
4671
4799
  FormLayoutComponent,
@@ -4707,7 +4835,11 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4707
4835
  ViewLayoutComponent,
4708
4836
  ToggleButtonComponent,
4709
4837
  ToggleButtonsListComponent,
4710
- ContentTileComponent], imports: [CommonModule,
4838
+ ContentTileComponent,
4839
+ ContentTileItemComponent,
4840
+ ContentTileHeaderComponent,
4841
+ StatsGridComponent,
4842
+ ProgressBarComponent], imports: [CommonModule,
4711
4843
  RouterModule,
4712
4844
  IndiceAuthModule,
4713
4845
  FormsModule], exports: [AddressPipe,
@@ -4721,6 +4853,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4721
4853
  DatepickerComponent,
4722
4854
  DropDownMenuComponent,
4723
4855
  DurationFormatPipe,
4856
+ ShortNumberPipe,
4724
4857
  ErrorComponent,
4725
4858
  FormLayoutComponent,
4726
4859
  KpiTileComponent,
@@ -4752,7 +4885,12 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4752
4885
  UnauthorizedComponent,
4753
4886
  ViewLayoutComponent,
4754
4887
  ToggleButtonComponent,
4755
- ToggleButtonsListComponent] });
4888
+ ToggleButtonsListComponent,
4889
+ ContentTileComponent,
4890
+ ContentTileItemComponent,
4891
+ ContentTileHeaderComponent,
4892
+ StatsGridComponent,
4893
+ ProgressBarComponent] });
4756
4894
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4757
4895
  RouterModule,
4758
4896
  IndiceAuthModule,
@@ -4773,6 +4911,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4773
4911
  DatepickerComponent,
4774
4912
  DropDownMenuComponent,
4775
4913
  DurationFormatPipe,
4914
+ ShortNumberPipe,
4776
4915
  DynamicComponentHostDirective,
4777
4916
  ErrorComponent,
4778
4917
  FormLayoutComponent,
@@ -4814,7 +4953,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4814
4953
  ViewLayoutComponent,
4815
4954
  ToggleButtonComponent,
4816
4955
  ToggleButtonsListComponent,
4817
- ContentTileComponent
4956
+ ContentTileComponent,
4957
+ ContentTileItemComponent,
4958
+ ContentTileHeaderComponent,
4959
+ StatsGridComponent,
4960
+ ProgressBarComponent
4818
4961
  ],
4819
4962
  imports: [
4820
4963
  CommonModule,
@@ -4834,6 +4977,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4834
4977
  DatepickerComponent,
4835
4978
  DropDownMenuComponent,
4836
4979
  DurationFormatPipe,
4980
+ ShortNumberPipe,
4837
4981
  ErrorComponent,
4838
4982
  FormLayoutComponent,
4839
4983
  KpiTileComponent,
@@ -4865,7 +5009,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4865
5009
  UnauthorizedComponent,
4866
5010
  ViewLayoutComponent,
4867
5011
  ToggleButtonComponent,
4868
- ToggleButtonsListComponent
5012
+ ToggleButtonsListComponent,
5013
+ ContentTileComponent,
5014
+ ContentTileItemComponent,
5015
+ ContentTileHeaderComponent,
5016
+ StatsGridComponent,
5017
+ ProgressBarComponent
4869
5018
  ]
4870
5019
  }]
4871
5020
  }] });
@@ -4876,5 +5025,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4876
5025
  * Generated bundle index. Do not edit.
4877
5026
  */
4878
5027
 
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 };
5028
+ 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
5029
  //# sourceMappingURL=indice-ng-components.mjs.map