@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.
@@ -2592,6 +2592,52 @@ 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
+
2595
2641
  class DynamicComponentHostDirective {
2596
2642
  constructor(viewContainerRef) {
2597
2643
  this.viewContainerRef = viewContainerRef;
@@ -3895,6 +3941,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
3895
3941
  }]
3896
3942
  }] });
3897
3943
 
3944
+ class ShortNumberPipe {
3945
+ transform(number, args) {
3946
+ if (isNaN(number))
3947
+ return null; // will only work value is a number
3948
+ if (number === null)
3949
+ return null;
3950
+ if (number === 0)
3951
+ return null;
3952
+ let abs = Math.abs(number);
3953
+ const rounder = Math.pow(10, 1);
3954
+ const isNegative = number < 0; // will also work for Negative numbers
3955
+ let key = '';
3956
+ const powers = [
3957
+ { key: 'Q', value: Math.pow(10, 15) },
3958
+ { key: 'T', value: Math.pow(10, 12) },
3959
+ { key: 'B', value: Math.pow(10, 9) },
3960
+ { key: 'M', value: Math.pow(10, 6) },
3961
+ { key: 'K', value: 1000 }
3962
+ ];
3963
+ for (let i = 0; i < powers.length; i++) {
3964
+ let reduced = abs / powers[i].value;
3965
+ reduced = Math.round(reduced * rounder) / rounder;
3966
+ if (reduced >= 1) {
3967
+ abs = reduced;
3968
+ key = powers[i].key;
3969
+ break;
3970
+ }
3971
+ }
3972
+ return (isNegative ? '-' : '') + abs + key;
3973
+ }
3974
+ }
3975
+ ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3976
+ ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
3977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
3978
+ type: Pipe,
3979
+ args: [{
3980
+ name: 'shortNumber',
3981
+ pure: false
3982
+ }]
3983
+ }] });
3984
+
3898
3985
  class BaseListComponent {
3899
3986
  constructor(route$, router$) {
3900
3987
  this.route$ = route$;
@@ -4555,6 +4642,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4555
4642
  args: [MODAL_CONFIG_DEFAULT_OVERRIDE]
4556
4643
  }] }]; } });
4557
4644
 
4645
+ class ProgressBarComponent {
4646
+ constructor() {
4647
+ this.value = 0;
4648
+ this.total = 0;
4649
+ this.text = undefined;
4650
+ this.percentage = 0;
4651
+ }
4652
+ ngOnChanges(changes) {
4653
+ if (changes.value || changes.total) {
4654
+ this.calcPercentage();
4655
+ }
4656
+ }
4657
+ calcPercentage() {
4658
+ if (this.total > 0) {
4659
+ this.percentage = (this.value / this.total) * 100;
4660
+ }
4661
+ else {
4662
+ this.percentage = 0;
4663
+ }
4664
+ }
4665
+ }
4666
+ ProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4667
+ 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 " });
4668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ProgressBarComponent, decorators: [{
4669
+ type: Component,
4670
+ 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 " }]
4671
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
4672
+ type: Input
4673
+ }], total: [{
4674
+ type: Input
4675
+ }], text: [{
4676
+ type: Input
4677
+ }] } });
4678
+
4558
4679
  class IndiceComponentsModule {
4559
4680
  static forRoot() {
4560
4681
  return {
@@ -4580,6 +4701,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4580
4701
  DatepickerComponent,
4581
4702
  DropDownMenuComponent,
4582
4703
  DurationFormatPipe,
4704
+ ShortNumberPipe,
4583
4705
  DynamicComponentHostDirective,
4584
4706
  ErrorComponent,
4585
4707
  FormLayoutComponent,
@@ -4623,7 +4745,9 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4623
4745
  ToggleButtonsListComponent,
4624
4746
  ContentTileComponent,
4625
4747
  ContentTileItemComponent,
4626
- ContentTileHeaderComponent], imports: [CommonModule,
4748
+ ContentTileHeaderComponent,
4749
+ StatsGridComponent,
4750
+ ProgressBarComponent], imports: [CommonModule,
4627
4751
  RouterModule,
4628
4752
  IndiceAuthModule,
4629
4753
  FormsModule], exports: [AddressPipe,
@@ -4637,6 +4761,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4637
4761
  DatepickerComponent,
4638
4762
  DropDownMenuComponent,
4639
4763
  DurationFormatPipe,
4764
+ ShortNumberPipe,
4640
4765
  ErrorComponent,
4641
4766
  FormLayoutComponent,
4642
4767
  KpiTileComponent,
@@ -4671,7 +4796,8 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4671
4796
  ToggleButtonsListComponent,
4672
4797
  ContentTileComponent,
4673
4798
  ContentTileItemComponent,
4674
- ContentTileHeaderComponent] });
4799
+ ContentTileHeaderComponent,
4800
+ StatsGridComponent] });
4675
4801
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4676
4802
  RouterModule,
4677
4803
  IndiceAuthModule,
@@ -4692,6 +4818,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4692
4818
  DatepickerComponent,
4693
4819
  DropDownMenuComponent,
4694
4820
  DurationFormatPipe,
4821
+ ShortNumberPipe,
4695
4822
  DynamicComponentHostDirective,
4696
4823
  ErrorComponent,
4697
4824
  FormLayoutComponent,
@@ -4735,7 +4862,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4735
4862
  ToggleButtonsListComponent,
4736
4863
  ContentTileComponent,
4737
4864
  ContentTileItemComponent,
4738
- ContentTileHeaderComponent
4865
+ ContentTileHeaderComponent,
4866
+ StatsGridComponent,
4867
+ ProgressBarComponent
4739
4868
  ],
4740
4869
  imports: [
4741
4870
  CommonModule,
@@ -4755,6 +4884,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4755
4884
  DatepickerComponent,
4756
4885
  DropDownMenuComponent,
4757
4886
  DurationFormatPipe,
4887
+ ShortNumberPipe,
4758
4888
  ErrorComponent,
4759
4889
  FormLayoutComponent,
4760
4890
  KpiTileComponent,
@@ -4789,7 +4919,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4789
4919
  ToggleButtonsListComponent,
4790
4920
  ContentTileComponent,
4791
4921
  ContentTileItemComponent,
4792
- ContentTileHeaderComponent
4922
+ ContentTileHeaderComponent,
4923
+ StatsGridComponent
4793
4924
  ]
4794
4925
  }]
4795
4926
  }] });
@@ -4800,5 +4931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
4800
4931
  * Generated bundle index. Do not edit.
4801
4932
  */
4802
4933
 
4803
- 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 };
4934
+ 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 };
4804
4935
  //# sourceMappingURL=indice-ng-components.mjs.map