mis-crystal-design-system 2.9.7 → 2.9.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.
Files changed (45) hide show
  1. package/bundles/mis-crystal-design-system-dropdown.umd.js +1 -1
  2. package/bundles/mis-crystal-design-system-dropdown.umd.min.js +1 -1
  3. package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
  4. package/bundles/mis-crystal-design-system-phone-input.umd.js +68 -0
  5. package/bundles/mis-crystal-design-system-phone-input.umd.js.map +1 -0
  6. package/bundles/mis-crystal-design-system-phone-input.umd.min.js +2 -0
  7. package/bundles/mis-crystal-design-system-phone-input.umd.min.js.map +1 -0
  8. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js +472 -0
  9. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js.map +1 -0
  10. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js +16 -0
  11. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js.map +1 -0
  12. package/dropdown/mis-crystal-design-system-dropdown.metadata.json +1 -1
  13. package/esm2015/dropdown/dropdown.component.js +1 -1
  14. package/esm2015/phone-input/index.js +2 -0
  15. package/esm2015/phone-input/mis-crystal-design-system-phone-input.js +5 -0
  16. package/esm2015/phone-input/phone-input.component.js +36 -0
  17. package/esm2015/phone-input/phone-input.module.js +21 -0
  18. package/esm2015/phone-input/public_api.js +3 -0
  19. package/esm2015/virtual-scroll/index.js +2 -0
  20. package/esm2015/virtual-scroll/mis-crystal-design-system-virtual-scroll.js +5 -0
  21. package/esm2015/virtual-scroll/public_api.js +4 -0
  22. package/esm2015/virtual-scroll/virtual-scroll.component.js +112 -0
  23. package/esm2015/virtual-scroll/virtual-scroll.constants.js +2 -0
  24. package/esm2015/virtual-scroll/virtual-scroll.module.js +24 -0
  25. package/fesm2015/mis-crystal-design-system-dropdown.js +1 -1
  26. package/fesm2015/mis-crystal-design-system-phone-input.js +60 -0
  27. package/fesm2015/mis-crystal-design-system-phone-input.js.map +1 -0
  28. package/fesm2015/mis-crystal-design-system-virtual-scroll.js +142 -0
  29. package/fesm2015/mis-crystal-design-system-virtual-scroll.js.map +1 -0
  30. package/package.json +1 -1
  31. package/phone-input/index.d.ts +1 -0
  32. package/phone-input/mis-crystal-design-system-phone-input.d.ts +4 -0
  33. package/phone-input/mis-crystal-design-system-phone-input.metadata.json +1 -0
  34. package/phone-input/package.json +11 -0
  35. package/phone-input/phone-input.component.d.ts +17 -0
  36. package/phone-input/phone-input.module.d.ts +4 -0
  37. package/phone-input/public_api.d.ts +2 -0
  38. package/virtual-scroll/index.d.ts +1 -0
  39. package/virtual-scroll/mis-crystal-design-system-virtual-scroll.d.ts +4 -0
  40. package/virtual-scroll/mis-crystal-design-system-virtual-scroll.metadata.json +1 -0
  41. package/virtual-scroll/package.json +11 -0
  42. package/virtual-scroll/public_api.d.ts +3 -0
  43. package/virtual-scroll/virtual-scroll.component.d.ts +25 -0
  44. package/virtual-scroll/virtual-scroll.constants.d.ts +15 -0
  45. package/virtual-scroll/virtual-scroll.module.d.ts +4 -0
@@ -0,0 +1,142 @@
1
+ import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
2
+ import { CommonModule } from '@angular/common';
3
+ import { EventEmitter, Component, ChangeDetectorRef, Input, ViewChild, ContentChild, Output, NgModule } from '@angular/core';
4
+ import { LoaderModule } from 'mis-crystal-design-system/loader';
5
+ import { BehaviorSubject, of } from 'rxjs';
6
+ import { tap, catchError, throttleTime, mergeMap, scan } from 'rxjs/operators';
7
+
8
+ class VirtualScrollComponent {
9
+ constructor(changeDetectorRef) {
10
+ this.changeDetectorRef = changeDetectorRef;
11
+ // Infinite scroll related variables
12
+ this.offset = new BehaviorSubject(null);
13
+ this.endOfInfiniteData = false;
14
+ this.rowsLoading = false;
15
+ // Main state managing variables
16
+ this.loading = false;
17
+ this.error = false;
18
+ this.config = {
19
+ minBufferPx: 2400,
20
+ maxBufferPx: 2400,
21
+ rowHeight: 128,
22
+ pageSize: 5,
23
+ infiniteScrollDataFunction: (offset, pageSize) => of([1, 2, 3, 4, 5])
24
+ };
25
+ this.intialized = new EventEmitter();
26
+ this.switchOffInfiniteScroll = () => {
27
+ this.error = false;
28
+ this.loading = true;
29
+ this.data$ = this.config.data$.pipe(tap(() => {
30
+ this.loading = false;
31
+ this.changeDetectorRef.detectChanges();
32
+ }), catchError(err => {
33
+ console.error("Error: Unknown error occurred while fetching calendar data", err);
34
+ this.loading = false;
35
+ this.error = true;
36
+ return [];
37
+ }));
38
+ };
39
+ this.switchOnInfiniteScroll = () => {
40
+ this.error = false;
41
+ this.loading = true;
42
+ this.offset.next(0);
43
+ this.setupInfiniteScroll();
44
+ };
45
+ }
46
+ ngOnInit() {
47
+ this.switchOnInfiniteScroll();
48
+ this.virtualScrollApi = {
49
+ toggleLoader: () => this.loading = !this.loading,
50
+ toggleError: () => this.error = !this.error,
51
+ switchOnInfiniteScroll: this.switchOnInfiniteScroll,
52
+ switchOffInfiniteScroll: this.switchOffInfiniteScroll
53
+ };
54
+ this.changeDetectorRef.detectChanges();
55
+ this.intialized.emit(this.virtualScrollApi);
56
+ }
57
+ setupInfiniteScroll() {
58
+ const batchMap = this.offset.pipe(throttleTime(500), mergeMap(offset => this.getBatch(offset)), scan((acc, batch) => {
59
+ return [...acc, ...batch];
60
+ }, []));
61
+ this.data$ = batchMap.pipe(tap(data => {
62
+ this.rowsLoading = false;
63
+ this.loading = false;
64
+ setTimeout(() => {
65
+ this.changeDetectorRef.detectChanges();
66
+ }, 50);
67
+ }));
68
+ }
69
+ nextBatch(offset) {
70
+ if (this.endOfInfiniteData) {
71
+ return;
72
+ }
73
+ const end = this.viewPort.getRenderedRange().end;
74
+ const total = this.viewPort.getDataLength();
75
+ // console.log(`${end}, '>=', ${total}`);
76
+ // console.log("Offset->", offset)
77
+ offset = Math.ceil(offset / this.config.pageSize);
78
+ if (end === total && !this.rowsLoading) {
79
+ this.offset.next(offset);
80
+ }
81
+ }
82
+ getBatch(offset) {
83
+ this.rowsLoading = true;
84
+ if (offset == null)
85
+ offset = 0;
86
+ return this.config
87
+ .infiniteScrollDataFunction(offset, this.config.pageSize)
88
+ .pipe(tap((arr) => {
89
+ arr.length < this.config.pageSize ? (this.endOfInfiniteData = true) : null;
90
+ }), catchError(err => {
91
+ console.error("Error: Unknown error occurred while fetching calendar data", err);
92
+ this.rowsLoading = false;
93
+ this.loading = false;
94
+ this.error = true;
95
+ return [];
96
+ }));
97
+ }
98
+ }
99
+ VirtualScrollComponent.decorators = [
100
+ { type: Component, args: [{
101
+ selector: "mis-virtual-scroll",
102
+ template: "<div class=\"state-container\" *ngIf=\"loading\">\n <mis-loader></mis-loader>\n</div>\n<div class=\"state-container\" *ngIf=\"!loading && error\">\n <span>Unknown error has occurred.</span>\n</div>\n<ng-container *ngIf=\"data$ | async as data\">\n <cdk-virtual-scroll-viewport\n *ngIf=\"!loading && !error\"\n #viewport\n [minBufferPx]=\"config.minBufferPx\"\n [maxBufferPx]=\"config.maxBufferPx\"\n [itemSize]=\"this.config.rowHeight\"\n (scrolledIndexChange)=\"nextBatch(data.length)\"\n >\n <ng-container *cdkVirtualFor=\"let item of data\">\n <ng-container\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n </ng-container>\n <div id=\"loader-container\" *ngIf=\"rowsLoading\">\n <mis-loader></mis-loader>\n </div>\n </cdk-virtual-scroll-viewport>\n</ng-container>",
103
+ styles: ["cdk-virtual-scroll-viewport{height:100%}#main-container,.state-container{height:100%;width:100%}#loader-container,.state-container{display:flex;justify-content:center;align-items:center}#loader-container{width:100%;height:56px}::ng-deep #spinner{position:relative!important}"]
104
+ },] }
105
+ ];
106
+ VirtualScrollComponent.ctorParameters = () => [
107
+ { type: ChangeDetectorRef }
108
+ ];
109
+ VirtualScrollComponent.propDecorators = {
110
+ config: [{ type: Input, args: ["config",] }],
111
+ viewPort: [{ type: ViewChild, args: [CdkVirtualScrollViewport,] }],
112
+ customItem: [{ type: ContentChild, args: ["virtualScrollItem", { static: false },] }],
113
+ intialized: [{ type: Output }]
114
+ };
115
+
116
+ class VirtualScrollModule {
117
+ static forRoot() {
118
+ return { ngModule: VirtualScrollModule, providers: [] };
119
+ }
120
+ }
121
+ VirtualScrollModule.decorators = [
122
+ { type: NgModule, args: [{
123
+ declarations: [
124
+ VirtualScrollComponent
125
+ ],
126
+ imports: [
127
+ CommonModule,
128
+ ScrollingModule,
129
+ LoaderModule
130
+ ],
131
+ exports: [VirtualScrollComponent, ScrollingModule],
132
+ },] }
133
+ ];
134
+
135
+ // import { VirtualScrollModule } from "./virtual-scroll.module";
136
+
137
+ /**
138
+ * Generated bundle index. Do not edit.
139
+ */
140
+
141
+ export { VirtualScrollComponent, VirtualScrollModule };
142
+ //# sourceMappingURL=mis-crystal-design-system-virtual-scroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mis-crystal-design-system-virtual-scroll.js","sources":["../../../projects/mis-components/virtual-scroll/virtual-scroll.component.ts","../../../projects/mis-components/virtual-scroll/virtual-scroll.module.ts","../../../projects/mis-components/virtual-scroll/public_api.ts","../../../projects/mis-components/virtual-scroll/mis-crystal-design-system-virtual-scroll.ts"],"sourcesContent":["import { ChangeDetectorRef, Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from \"@angular/core\";\nimport { CdkVirtualScrollViewport } from \"@angular/cdk/scrolling\";\n\nimport { BehaviorSubject, Observable, of } from \"rxjs\";\nimport { catchError, mergeMap, scan, tap, throttleTime } from \"rxjs/operators\";\nimport { IVirtualScrollConfig } from \"./virtual-scroll.constants\";\n\n@Component({\n selector: \"mis-virtual-scroll\",\n templateUrl: \"./virtual-scroll.component.html\",\n styleUrls: [\"./virtual-scroll.component.scss\"],\n })\nexport class VirtualScrollComponent implements OnInit {\n\n // Infinite scroll related variables\n offset = new BehaviorSubject(null);\n endOfInfiniteData: boolean = false;\n rowsLoading: boolean = false;\n \n // Main state managing variables\n loading: boolean = false\n error: boolean = false\n \n // Scroll data related variables\n data$: Observable<any>\n @Input(\"config\") config: IVirtualScrollConfig = {\n minBufferPx: 2400,\n maxBufferPx: 2400,\n rowHeight: 128,\n pageSize: 5,\n infiniteScrollDataFunction: (offset, pageSize) => of([1,2,3,4,5])\n };\n @ViewChild(CdkVirtualScrollViewport) viewPort: CdkVirtualScrollViewport;\n @ContentChild(\"virtualScrollItem\", { static: false })\n customItem: TemplateRef<Element>;\n @Output() intialized = new EventEmitter<any>();\n\n virtualScrollApi: any\n\n\n constructor(private changeDetectorRef: ChangeDetectorRef){}\n ngOnInit(): void {\n this.switchOnInfiniteScroll()\n this.virtualScrollApi = {\n toggleLoader: () => this.loading = !this.loading,\n toggleError: () => this.error = !this.error,\n switchOnInfiniteScroll: this.switchOnInfiniteScroll,\n switchOffInfiniteScroll: this.switchOffInfiniteScroll\n }\n this.changeDetectorRef.detectChanges();\n this.intialized.emit(this.virtualScrollApi)\n }\n switchOffInfiniteScroll = (): void => {\n this.error = false\n this.loading = true\n this.data$ = this.config.data$.pipe(\n tap(() => {\n this.loading = false\n this.changeDetectorRef.detectChanges()\n }),\n catchError(err => {\n console.error(\"Error: Unknown error occurred while fetching calendar data\", err);\n this.loading = false;\n this.error = true;\n return [];\n })\n )\n }\n switchOnInfiniteScroll = (): void => {\n this.error = false\n this.loading = true\n this.offset.next(0)\n this.setupInfiniteScroll()\n }\n setupInfiniteScroll(): void {\n const batchMap = this.offset.pipe(\n throttleTime(500),\n mergeMap(offset => this.getBatch(offset)),\n scan((acc: Array<any>, batch: Array<any>) => {\n return [...acc, ...batch];\n }, [])\n );\n this.data$ = batchMap.pipe(\n tap(data => {\n this.rowsLoading = false;\n this.loading = false;\n setTimeout(() => {\n this.changeDetectorRef.detectChanges();\n }, 50)\n })\n );\n }\n nextBatch(offset): void {\n if (this.endOfInfiniteData) {\n return;\n }\n const end = this.viewPort.getRenderedRange().end;\n const total = this.viewPort.getDataLength();\n // console.log(`${end}, '>=', ${total}`);\n // console.log(\"Offset->\", offset)\n offset = Math.ceil(offset / this.config.pageSize)\n if (end === total && !this.rowsLoading) {\n this.offset.next(offset);\n }\n }\n getBatch(offset): Observable<any> {\n this.rowsLoading = true;\n if (offset == null) offset = 0;\n return this.config\n .infiniteScrollDataFunction(offset, this.config.pageSize)\n .pipe(\n tap((arr: Array<any>) => {\n arr.length < this.config.pageSize ? (this.endOfInfiniteData = true) : null;\n }),\n catchError(err => {\n console.error(\"Error: Unknown error occurred while fetching calendar data\", err);\n this.rowsLoading = false;\n this.loading = false;\n this.error = true;\n return [];\n })\n );\n }\n \n}","import { ScrollingModule } from \"@angular/cdk/scrolling\";\nimport { CommonModule } from \"@angular/common\";\nimport { ModuleWithProviders, NgModule } from \"@angular/core\"\n\nimport { LoaderModule} from \"mis-crystal-design-system/loader\"\n\nimport { VirtualScrollComponent } from \"./virtual-scroll.component\";\n\n@NgModule({\n declarations:[\n VirtualScrollComponent\n ],\n imports: [\n CommonModule,\n ScrollingModule,\n LoaderModule\n ],\n exports:[VirtualScrollComponent, ScrollingModule],\n})\nexport class VirtualScrollModule{ \n static forRoot() : ModuleWithProviders<VirtualScrollModule> {\n return { ngModule: VirtualScrollModule, providers: []}\n }\n}","// import { VirtualScrollModule } from \"./virtual-scroll.module\";\n\nexport { VirtualScrollModule } from \"./virtual-scroll.module\";\nexport { VirtualScrollComponent } from \"./virtual-scroll.component\";\nexport { IVirtualScrollApi, IVirtualScrollConfig } from \"./virtual-scroll.constants\"\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAYa,sBAAsB;IA4B/B,YAAoB,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;;QAzBxD,WAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACnC,sBAAiB,GAAY,KAAK,CAAC;QACnC,gBAAW,GAAY,KAAK,CAAC;;QAG7B,YAAO,GAAY,KAAK,CAAA;QACxB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AE;oBACL,YAAY;oBACZ,eAAe;oBACf,YAAY;iBACf;gBACD,OAAO,EAAC,CAAC,sBAAsB,EAAE,eAAe,CAAC;aACpD;;;AClBD;;ACAA;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mis-crystal-design-system",
3
- "version": "2.9.7",
3
+ "version": "2.9.8",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "*",
6
6
  "@angular/core": "*",
@@ -0,0 +1 @@
1
+ export * from "./public_api";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
@@ -0,0 +1 @@
1
+ {"__symbolic":"module","version":4,"metadata":{"PhoneInputComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"mis-phone-input","template":"<div class=\"main-container-phone\">\n <mis-dropdown [height]=\"dropdownHeight\" [width]=\"dropdownWidth\" [data]=\"dropdownData\" [selectedItem]=\"dropdownSelectedItem\" [label]=\"label\" [searchEnabled]=\"false\" [multiLine]=\"false\" (onChange)=\"handleDropdownSelection($event)\"></mis-dropdown>\n <div class=\"details-field\">\n <div class=\"input-box\">\n <input\n [ngStyle]=\"{'height': inputHeight }\"\n class=\"black-text\"\n [placeholder]=\"inputPlaceholder\"\n [formControl]=\"inputFormControl\" \n type=\"number\"\n />\n </div>\n </div>\n</div>\n","styles":[".main-container-phone{display:flex;border:1px solid #e0e0e0;border-radius:6px}.details-field label{display:inline-block;min-width:224px;margin-right:24px}.details-field .input-box{width:100%}.details-field .input-box input{width:100%;height:32px}input{padding:10px 16px;border:none;outline:none;width:100%;height:auto;border-radius:6px}.black-text,input{color:#181f33;line-height:24px;font-size:16px}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.main-container-phone ::ng-deep .item{padding:8px!important}.main-container-phone ::ng-deep .dropdown{border:unset!important}"]}]}],"members":{"dropdownHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"dropdownWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"inputHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"dropdownData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"dropdownSelectedItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"inputPlaceholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"inputFormControl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"onDropdownSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"handleDropdownSelection":[{"__symbolic":"method"}]}},"PhoneInputModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"PhoneInputComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":12},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":12,"character":25},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":12,"character":46},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":12,"character":59},{"__symbolic":"reference","module":"@angular/cdk-experimental/scrolling","name":"ScrollingModule","line":12,"character":74},{"__symbolic":"reference","module":"mis-crystal-design-system/dropdown","name":"DropdownModule","line":12,"character":91}],"exports":[{"__symbolic":"reference","name":"PhoneInputComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"PhoneInputModule"},"providers":[]}}}}},"origins":{"PhoneInputComponent":"./phone-input.component","PhoneInputModule":"./phone-input.module"},"importAs":"mis-crystal-design-system/phone-input"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "main": "../bundles/mis-crystal-design-system-phone-input.umd.js",
3
+ "module": "../fesm2015/mis-crystal-design-system-phone-input.js",
4
+ "es2015": "../fesm2015/mis-crystal-design-system-phone-input.js",
5
+ "esm2015": "../esm2015/phone-input/mis-crystal-design-system-phone-input.js",
6
+ "fesm2015": "../fesm2015/mis-crystal-design-system-phone-input.js",
7
+ "typings": "mis-crystal-design-system-phone-input.d.ts",
8
+ "metadata": "mis-crystal-design-system-phone-input.metadata.json",
9
+ "sideEffects": false,
10
+ "name": "mis-crystal-design-system/phone-input"
11
+ }
@@ -0,0 +1,17 @@
1
+ import { EventEmitter, OnInit } from "@angular/core";
2
+ import { FormControl } from "@angular/forms";
3
+ import { DropdownItem } from "mis-crystal-design-system/dropdown";
4
+ export declare class PhoneInputComponent implements OnInit {
5
+ dropdownHeight?: string;
6
+ dropdownWidth?: string;
7
+ inputHeight?: string;
8
+ dropdownData: DropdownItem[];
9
+ dropdownSelectedItem: DropdownItem;
10
+ label: string;
11
+ inputPlaceholder: string;
12
+ inputFormControl: FormControl;
13
+ onDropdownSelection: EventEmitter<any>;
14
+ constructor();
15
+ ngOnInit(): void;
16
+ handleDropdownSelection(item: DropdownItem): void;
17
+ }
@@ -0,0 +1,4 @@
1
+ import { ModuleWithProviders } from "@angular/core";
2
+ export declare class PhoneInputModule {
3
+ static forRoot(): ModuleWithProviders<PhoneInputModule>;
4
+ }
@@ -0,0 +1,2 @@
1
+ export { PhoneInputComponent } from "./phone-input.component";
2
+ export { PhoneInputModule } from "./phone-input.module";
@@ -0,0 +1 @@
1
+ export * from "./public_api";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
@@ -0,0 +1 @@
1
+ {"__symbolic":"module","version":4,"metadata":{"VirtualScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":8,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"VirtualScrollComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":13,"character":8},{"__symbolic":"reference","module":"@angular/cdk/scrolling","name":"ScrollingModule","line":14,"character":8},{"__symbolic":"reference","module":"mis-crystal-design-system/loader","name":"LoaderModule","line":15,"character":8}],"exports":[{"__symbolic":"reference","name":"VirtualScrollComponent"},{"__symbolic":"reference","module":"@angular/cdk/scrolling","name":"ScrollingModule","line":17,"character":37}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"VirtualScrollModule"},"providers":[]}}}},"VirtualScrollComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"mis-virtual-scroll","template":"<div class=\"state-container\" *ngIf=\"loading\">\n <mis-loader></mis-loader>\n</div>\n<div class=\"state-container\" *ngIf=\"!loading && error\">\n <span>Unknown error has occurred.</span>\n</div>\n<ng-container *ngIf=\"data$ | async as data\">\n <cdk-virtual-scroll-viewport\n *ngIf=\"!loading && !error\"\n #viewport\n [minBufferPx]=\"config.minBufferPx\"\n [maxBufferPx]=\"config.maxBufferPx\"\n [itemSize]=\"this.config.rowHeight\"\n (scrolledIndexChange)=\"nextBatch(data.length)\"\n >\n <ng-container *cdkVirtualFor=\"let item of data\">\n <ng-container\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n </ng-container>\n <div id=\"loader-container\" *ngIf=\"rowsLoading\">\n <mis-loader></mis-loader>\n </div>\n </cdk-virtual-scroll-viewport>\n</ng-container>","styles":["cdk-virtual-scroll-viewport{height:100%}#main-container,.state-container{height:100%;width:100%}#loader-container,.state-container{display:flex;justify-content:center;align-items:center}#loader-container{width:100%;height:56px}::ng-deep #spinner{position:relative!important}"]}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":5},"arguments":["config"]}]}],"viewPort":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":32,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/cdk/scrolling","name":"CdkVirtualScrollViewport","line":32,"character":15}]}]}],"customItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":33,"character":5},"arguments":["virtualScrollItem",{"static":false}]}]}],"intialized":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":35,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":40,"character":43}]}],"ngOnInit":[{"__symbolic":"method"}],"setupInfiniteScroll":[{"__symbolic":"method"}],"nextBatch":[{"__symbolic":"method"}],"getBatch":[{"__symbolic":"method"}]}},"IVirtualScrollApi":{"__symbolic":"interface"},"IVirtualScrollConfig":{"__symbolic":"interface"}},"origins":{"VirtualScrollModule":"./virtual-scroll.module","VirtualScrollComponent":"./virtual-scroll.component","IVirtualScrollApi":"./virtual-scroll.constants","IVirtualScrollConfig":"./virtual-scroll.constants"},"importAs":"mis-crystal-design-system/virtual-scroll"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "main": "../bundles/mis-crystal-design-system-virtual-scroll.umd.js",
3
+ "module": "../fesm2015/mis-crystal-design-system-virtual-scroll.js",
4
+ "es2015": "../fesm2015/mis-crystal-design-system-virtual-scroll.js",
5
+ "esm2015": "../esm2015/virtual-scroll/mis-crystal-design-system-virtual-scroll.js",
6
+ "fesm2015": "../fesm2015/mis-crystal-design-system-virtual-scroll.js",
7
+ "typings": "mis-crystal-design-system-virtual-scroll.d.ts",
8
+ "metadata": "mis-crystal-design-system-virtual-scroll.metadata.json",
9
+ "sideEffects": false,
10
+ "name": "mis-crystal-design-system/virtual-scroll"
11
+ }
@@ -0,0 +1,3 @@
1
+ export { VirtualScrollModule } from "./virtual-scroll.module";
2
+ export { VirtualScrollComponent } from "./virtual-scroll.component";
3
+ export { IVirtualScrollApi, IVirtualScrollConfig } from "./virtual-scroll.constants";
@@ -0,0 +1,25 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnInit, TemplateRef } from "@angular/core";
2
+ import { CdkVirtualScrollViewport } from "@angular/cdk/scrolling";
3
+ import { BehaviorSubject, Observable } from "rxjs";
4
+ import { IVirtualScrollConfig } from "./virtual-scroll.constants";
5
+ export declare class VirtualScrollComponent implements OnInit {
6
+ private changeDetectorRef;
7
+ offset: BehaviorSubject<any>;
8
+ endOfInfiniteData: boolean;
9
+ rowsLoading: boolean;
10
+ loading: boolean;
11
+ error: boolean;
12
+ data$: Observable<any>;
13
+ config: IVirtualScrollConfig;
14
+ viewPort: CdkVirtualScrollViewport;
15
+ customItem: TemplateRef<Element>;
16
+ intialized: EventEmitter<any>;
17
+ virtualScrollApi: any;
18
+ constructor(changeDetectorRef: ChangeDetectorRef);
19
+ ngOnInit(): void;
20
+ switchOffInfiniteScroll: () => void;
21
+ switchOnInfiniteScroll: () => void;
22
+ setupInfiniteScroll(): void;
23
+ nextBatch(offset: any): void;
24
+ getBatch(offset: any): Observable<any>;
25
+ }
@@ -0,0 +1,15 @@
1
+ import { Observable } from "rxjs";
2
+ export interface IVirtualScrollConfig {
3
+ minBufferPx?: number;
4
+ maxBufferPx?: number;
5
+ rowHeight: number;
6
+ pageSize: number;
7
+ data$?: Observable<Array<any>>;
8
+ infiniteScrollDataFunction: (offset: number, pageSize: number) => Observable<Array<any>>;
9
+ }
10
+ export interface IVirtualScrollApi {
11
+ toggleLoader: () => void;
12
+ toggleError: () => void;
13
+ switchOnInfiniteScroll: () => void;
14
+ switchOffInfiniteScroll: () => void;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { ModuleWithProviders } from "@angular/core";
2
+ export declare class VirtualScrollModule {
3
+ static forRoot(): ModuleWithProviders<VirtualScrollModule>;
4
+ }