@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.
@@ -2592,6 +2592,92 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
2592
2592
  args: [ContentTileHeaderComponent]
2593
2593
  }] } });
2594
2594
 
2595
+ class StatsGridComponent {
2596
+ constructor() {
2597
+ this.busy = false;
2598
+ this.count = 6;
2599
+ this.loader = ['', '', '', '', '', ''];
2600
+ this.mode = 'normal';
2601
+ this.labels = ['Online', 'Offline', 'Faulted'];
2602
+ this.values = [10, 20, 30];
2603
+ this.colors = [
2604
+ 'rgb(53, 177, 201, 0.6)',
2605
+ 'rgb(168, 162, 158, 0.2)',
2606
+ 'rgb(233, 96, 96, 0.8)'
2607
+ ];
2608
+ }
2609
+ ngOnChanges(changes) {
2610
+ if (changes.count) {
2611
+ this.loader = [];
2612
+ for (let i = 0; i <= this.count; i++) {
2613
+ this.loader.push('');
2614
+ }
2615
+ }
2616
+ }
2617
+ isNumber(value) {
2618
+ return !isNaN(Number(value));
2619
+ ;
2620
+ }
2621
+ }
2622
+ StatsGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: StatsGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2623
+ 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" }] });
2624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: StatsGridComponent, decorators: [{
2625
+ type: Component,
2626
+ 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> " }]
2627
+ }], ctorParameters: function () { return []; }, propDecorators: { busy: [{
2628
+ type: Input
2629
+ }], count: [{
2630
+ type: Input
2631
+ }], mode: [{
2632
+ type: Input
2633
+ }], labels: [{
2634
+ type: Input
2635
+ }], values: [{
2636
+ type: Input
2637
+ }], colors: [{
2638
+ type: Input
2639
+ }] } });
2640
+
2641
+ class ProgressBarComponent {
2642
+ constructor() {
2643
+ this.value = 0;
2644
+ this.total = 0;
2645
+ this.text = undefined;
2646
+ this.percentage = 0;
2647
+ }
2648
+ ngOnChanges(changes) {
2649
+ if (changes.value || changes.total) {
2650
+ this.calcPercentage();
2651
+ }
2652
+ }
2653
+ calcPercentage() {
2654
+ if (this.total > 0) {
2655
+ this.percentage = (this.value / this.total) * 100;
2656
+ }
2657
+ else {
2658
+ this.percentage = 0;
2659
+ }
2660
+ }
2661
+ }
2662
+ ProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2663
+ 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 " });
2664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, decorators: [{
2665
+ type: Component,
2666
+ 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 " }]
2667
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
2668
+ type: Input
2669
+ }], valueText: [{
2670
+ type: Input,
2671
+ args: ['value-text']
2672
+ }], total: [{
2673
+ type: Input
2674
+ }], totalText: [{
2675
+ type: Input,
2676
+ args: ['total-text']
2677
+ }], text: [{
2678
+ type: Input
2679
+ }] } });
2680
+
2595
2681
  class DynamicComponentHostDirective {
2596
2682
  constructor(viewContainerRef) {
2597
2683
  this.viewContainerRef = viewContainerRef;
@@ -3895,6 +3981,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
3895
3981
  }]
3896
3982
  }] });
3897
3983
 
3984
+ class ShortNumberPipe {
3985
+ transform(number, args) {
3986
+ if (isNaN(number))
3987
+ return null; // will only work value is a number
3988
+ if (number === null)
3989
+ return null;
3990
+ if (number === 0)
3991
+ return null;
3992
+ let abs = Math.abs(number);
3993
+ const rounder = Math.pow(10, 1);
3994
+ const isNegative = number < 0; // will also work for Negative numbers
3995
+ let key = '';
3996
+ const powers = [
3997
+ { key: 'Q', value: Math.pow(10, 15) },
3998
+ { key: 'T', value: Math.pow(10, 12) },
3999
+ { key: 'B', value: Math.pow(10, 9) },
4000
+ { key: 'M', value: Math.pow(10, 6) },
4001
+ { key: 'K', value: 1000 }
4002
+ ];
4003
+ for (let i = 0; i < powers.length; i++) {
4004
+ let reduced = abs / powers[i].value;
4005
+ reduced = Math.round(reduced * rounder) / rounder;
4006
+ if (reduced >= 1) {
4007
+ abs = reduced;
4008
+ key = powers[i].key;
4009
+ break;
4010
+ }
4011
+ }
4012
+ return (isNegative ? '-' : '') + abs + key;
4013
+ }
4014
+ }
4015
+ ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4016
+ ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
4017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
4018
+ type: Pipe,
4019
+ args: [{
4020
+ name: 'shortNumber',
4021
+ pure: false
4022
+ }]
4023
+ }] });
4024
+
3898
4025
  class BaseListComponent {
3899
4026
  constructor(route$, router$) {
3900
4027
  this.route$ = route$;
@@ -4580,6 +4707,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4580
4707
  DatepickerComponent,
4581
4708
  DropDownMenuComponent,
4582
4709
  DurationFormatPipe,
4710
+ ShortNumberPipe,
4583
4711
  DynamicComponentHostDirective,
4584
4712
  ErrorComponent,
4585
4713
  FormLayoutComponent,
@@ -4621,7 +4749,11 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4621
4749
  ViewLayoutComponent,
4622
4750
  ToggleButtonComponent,
4623
4751
  ToggleButtonsListComponent,
4624
- ContentTileComponent], imports: [CommonModule,
4752
+ ContentTileComponent,
4753
+ ContentTileItemComponent,
4754
+ ContentTileHeaderComponent,
4755
+ StatsGridComponent,
4756
+ ProgressBarComponent], imports: [CommonModule,
4625
4757
  RouterModule,
4626
4758
  IndiceAuthModule,
4627
4759
  FormsModule], exports: [AddressPipe,
@@ -4635,6 +4767,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4635
4767
  DatepickerComponent,
4636
4768
  DropDownMenuComponent,
4637
4769
  DurationFormatPipe,
4770
+ ShortNumberPipe,
4638
4771
  ErrorComponent,
4639
4772
  FormLayoutComponent,
4640
4773
  KpiTileComponent,
@@ -4666,7 +4799,12 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4666
4799
  UnauthorizedComponent,
4667
4800
  ViewLayoutComponent,
4668
4801
  ToggleButtonComponent,
4669
- ToggleButtonsListComponent] });
4802
+ ToggleButtonsListComponent,
4803
+ ContentTileComponent,
4804
+ ContentTileItemComponent,
4805
+ ContentTileHeaderComponent,
4806
+ StatsGridComponent,
4807
+ ProgressBarComponent] });
4670
4808
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4671
4809
  RouterModule,
4672
4810
  IndiceAuthModule,
@@ -4687,6 +4825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4687
4825
  DatepickerComponent,
4688
4826
  DropDownMenuComponent,
4689
4827
  DurationFormatPipe,
4828
+ ShortNumberPipe,
4690
4829
  DynamicComponentHostDirective,
4691
4830
  ErrorComponent,
4692
4831
  FormLayoutComponent,
@@ -4728,7 +4867,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4728
4867
  ViewLayoutComponent,
4729
4868
  ToggleButtonComponent,
4730
4869
  ToggleButtonsListComponent,
4731
- ContentTileComponent
4870
+ ContentTileComponent,
4871
+ ContentTileItemComponent,
4872
+ ContentTileHeaderComponent,
4873
+ StatsGridComponent,
4874
+ ProgressBarComponent
4732
4875
  ],
4733
4876
  imports: [
4734
4877
  CommonModule,
@@ -4748,6 +4891,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4748
4891
  DatepickerComponent,
4749
4892
  DropDownMenuComponent,
4750
4893
  DurationFormatPipe,
4894
+ ShortNumberPipe,
4751
4895
  ErrorComponent,
4752
4896
  FormLayoutComponent,
4753
4897
  KpiTileComponent,
@@ -4779,7 +4923,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4779
4923
  UnauthorizedComponent,
4780
4924
  ViewLayoutComponent,
4781
4925
  ToggleButtonComponent,
4782
- ToggleButtonsListComponent
4926
+ ToggleButtonsListComponent,
4927
+ ContentTileComponent,
4928
+ ContentTileItemComponent,
4929
+ ContentTileHeaderComponent,
4930
+ StatsGridComponent,
4931
+ ProgressBarComponent
4783
4932
  ]
4784
4933
  }]
4785
4934
  }] });
@@ -4790,5 +4939,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4790
4939
  * Generated bundle index. Do not edit.
4791
4940
  */
4792
4941
 
4793
- 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 };
4942
+ 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 };
4794
4943
  //# sourceMappingURL=indice-ng-components.mjs.map