@indice/ng-components 0.2.173-beta.3 → 0.2.173-beta.6
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.
- package/esm2020/lib/ng-components.module.mjs +6 -1
- package/esm2020/lib/pipes/short-number.pipe.mjs +43 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/indice-ng-components.mjs +46 -1
- package/fesm2015/indice-ng-components.mjs.map +1 -1
- package/fesm2020/indice-ng-components.mjs +46 -1
- package/fesm2020/indice-ng-components.mjs.map +1 -1
- package/lib/ng-components.module.d.ts +50 -49
- package/lib/pipes/short-number.pipe.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -3895,6 +3895,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
|
|
|
3895
3895
|
}]
|
|
3896
3896
|
}] });
|
|
3897
3897
|
|
|
3898
|
+
class ShortNumberPipe {
|
|
3899
|
+
transform(number, args) {
|
|
3900
|
+
if (isNaN(number))
|
|
3901
|
+
return null; // will only work value is a number
|
|
3902
|
+
if (number === null)
|
|
3903
|
+
return null;
|
|
3904
|
+
if (number === 0)
|
|
3905
|
+
return null;
|
|
3906
|
+
let abs = Math.abs(number);
|
|
3907
|
+
const rounder = Math.pow(10, 1);
|
|
3908
|
+
const isNegative = number < 0; // will also work for Negative numbers
|
|
3909
|
+
let key = '';
|
|
3910
|
+
const powers = [
|
|
3911
|
+
{ key: 'Q', value: Math.pow(10, 15) },
|
|
3912
|
+
{ key: 'T', value: Math.pow(10, 12) },
|
|
3913
|
+
{ key: 'B', value: Math.pow(10, 9) },
|
|
3914
|
+
{ key: 'M', value: Math.pow(10, 6) },
|
|
3915
|
+
{ key: 'K', value: 1000 }
|
|
3916
|
+
];
|
|
3917
|
+
for (let i = 0; i < powers.length; i++) {
|
|
3918
|
+
let reduced = abs / powers[i].value;
|
|
3919
|
+
reduced = Math.round(reduced * rounder) / rounder;
|
|
3920
|
+
if (reduced >= 1) {
|
|
3921
|
+
abs = reduced;
|
|
3922
|
+
key = powers[i].key;
|
|
3923
|
+
break;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
return (isNegative ? '-' : '') + abs + key;
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
ShortNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3930
|
+
ShortNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, name: "shortNumber", pure: false });
|
|
3931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ShortNumberPipe, decorators: [{
|
|
3932
|
+
type: Pipe,
|
|
3933
|
+
args: [{
|
|
3934
|
+
name: 'shortNumber',
|
|
3935
|
+
pure: false
|
|
3936
|
+
}]
|
|
3937
|
+
}] });
|
|
3938
|
+
|
|
3898
3939
|
class BaseListComponent {
|
|
3899
3940
|
constructor(route$, router$) {
|
|
3900
3941
|
this.route$ = route$;
|
|
@@ -4580,6 +4621,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
|
|
|
4580
4621
|
DatepickerComponent,
|
|
4581
4622
|
DropDownMenuComponent,
|
|
4582
4623
|
DurationFormatPipe,
|
|
4624
|
+
ShortNumberPipe,
|
|
4583
4625
|
DynamicComponentHostDirective,
|
|
4584
4626
|
ErrorComponent,
|
|
4585
4627
|
FormLayoutComponent,
|
|
@@ -4637,6 +4679,7 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
|
|
|
4637
4679
|
DatepickerComponent,
|
|
4638
4680
|
DropDownMenuComponent,
|
|
4639
4681
|
DurationFormatPipe,
|
|
4682
|
+
ShortNumberPipe,
|
|
4640
4683
|
ErrorComponent,
|
|
4641
4684
|
FormLayoutComponent,
|
|
4642
4685
|
KpiTileComponent,
|
|
@@ -4692,6 +4735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
|
|
|
4692
4735
|
DatepickerComponent,
|
|
4693
4736
|
DropDownMenuComponent,
|
|
4694
4737
|
DurationFormatPipe,
|
|
4738
|
+
ShortNumberPipe,
|
|
4695
4739
|
DynamicComponentHostDirective,
|
|
4696
4740
|
ErrorComponent,
|
|
4697
4741
|
FormLayoutComponent,
|
|
@@ -4755,6 +4799,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
|
|
|
4755
4799
|
DatepickerComponent,
|
|
4756
4800
|
DropDownMenuComponent,
|
|
4757
4801
|
DurationFormatPipe,
|
|
4802
|
+
ShortNumberPipe,
|
|
4758
4803
|
ErrorComponent,
|
|
4759
4804
|
FormLayoutComponent,
|
|
4760
4805
|
KpiTileComponent,
|
|
@@ -4800,5 +4845,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImpor
|
|
|
4800
4845
|
* Generated bundle index. Do not edit.
|
|
4801
4846
|
*/
|
|
4802
4847
|
|
|
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 };
|
|
4848
|
+
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, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleButtonComponent, ToggleButtonsListComponent, ToggleComponent, UnauthorizedComponent, UserSettingsService, ViewAction, ViewLayoutComponent };
|
|
4804
4849
|
//# sourceMappingURL=indice-ng-components.mjs.map
|