ng-zenduit 1.0.0

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 (117) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/breadcrumbs/zendu-breadcrumbs.component.mjs +37 -0
  3. package/esm2020/lib/card-block/zendu-card-block.component.mjs +21 -0
  4. package/esm2020/lib/checkbox/zendu-checkbox.component.mjs +44 -0
  5. package/esm2020/lib/colorpicker/zendu-colorpicker.component.mjs +106 -0
  6. package/esm2020/lib/column-configuration/columnState.mjs +2 -0
  7. package/esm2020/lib/column-configuration/zendu-column-configuration.component.mjs +118 -0
  8. package/esm2020/lib/datepicker/date-picker-day.mjs +2 -0
  9. package/esm2020/lib/datepicker/date-picker-hint.mjs +2 -0
  10. package/esm2020/lib/datepicker/datepicker.mjs +9 -0
  11. package/esm2020/lib/datepicker/zendu-datepicker.component.mjs +434 -0
  12. package/esm2020/lib/doc-scanner/zendu-doc-scanner.component.mjs +628 -0
  13. package/esm2020/lib/file-upload/zendu-file-upload.component.mjs +107 -0
  14. package/esm2020/lib/filter/dateRange.mjs +2 -0
  15. package/esm2020/lib/filter/filtersConfig.mjs +2 -0
  16. package/esm2020/lib/filter/numberRange.mjs +2 -0
  17. package/esm2020/lib/filter/zendu-filter.component.mjs +461 -0
  18. package/esm2020/lib/icon/zendu-icon.component.mjs +24 -0
  19. package/esm2020/lib/local.lock.mjs +33 -0
  20. package/esm2020/lib/location-search/location.address.mjs +2 -0
  21. package/esm2020/lib/location-search/zendu-location-search.component.mjs +129 -0
  22. package/esm2020/lib/map/map.types.mjs +2 -0
  23. package/esm2020/lib/map/zendu-map.component.mjs +129 -0
  24. package/esm2020/lib/map-preview/zendu-map-preview.component.mjs +30 -0
  25. package/esm2020/lib/ng-zenduit.module.mjs +158 -0
  26. package/esm2020/lib/pagination-bar/pageItem.mjs +2 -0
  27. package/esm2020/lib/pagination-bar/zendu-pagination-bar.component.mjs +71 -0
  28. package/esm2020/lib/phone-input/zendu-phone-input.component.mjs +141 -0
  29. package/esm2020/lib/progress/zendu-progress.component.mjs +29 -0
  30. package/esm2020/lib/radio-button/radio-button.component.mjs +48 -0
  31. package/esm2020/lib/search-box/zendu-search-box.component.mjs +124 -0
  32. package/esm2020/lib/select/templates/zendu-select-option.directive.mjs +16 -0
  33. package/esm2020/lib/select/templates/zendu-select-value.directive.mjs +16 -0
  34. package/esm2020/lib/select/zendu-select.component.mjs +303 -0
  35. package/esm2020/lib/services/geoconding.service.mjs +61 -0
  36. package/esm2020/lib/services/map.service.mjs +181 -0
  37. package/esm2020/lib/services/opencv.service.mjs +109 -0
  38. package/esm2020/lib/services/zendu-notify.service.mjs +92 -0
  39. package/esm2020/lib/sort-header/zendu-sort-header.component.mjs +36 -0
  40. package/esm2020/lib/spinner/zendu-spinner.component.mjs +11 -0
  41. package/esm2020/lib/toggle/zendu-toggle.component.mjs +32 -0
  42. package/esm2020/lib/toggle-slide/zendu-toggle-slide.component.mjs +27 -0
  43. package/esm2020/lib/util.mjs +93 -0
  44. package/esm2020/ng-zenduit.mjs +5 -0
  45. package/esm2020/public-api.mjs +42 -0
  46. package/fesm2015/ng-zenduit.mjs +3768 -0
  47. package/fesm2015/ng-zenduit.mjs.map +1 -0
  48. package/fesm2020/ng-zenduit.mjs +3735 -0
  49. package/fesm2020/ng-zenduit.mjs.map +1 -0
  50. package/icons/arrow-down-small.svg +3 -0
  51. package/icons/arrow-up-small.svg +3 -0
  52. package/icons/calendar.svg +6 -0
  53. package/icons/cross.svg +3 -0
  54. package/icons/date.svg +3 -0
  55. package/icons/expand.svg +3 -0
  56. package/icons/filter.svg +3 -0
  57. package/icons/play.svg +10 -0
  58. package/icons/redo.svg +3 -0
  59. package/icons/rotate.svg +3 -0
  60. package/icons/time.svg +4 -0
  61. package/icons/undo.svg +3 -0
  62. package/index.d.ts +5 -0
  63. package/lib/breadcrumbs/zendu-breadcrumbs.component.d.ts +22 -0
  64. package/lib/card-block/zendu-card-block.component.d.ts +9 -0
  65. package/lib/checkbox/zendu-checkbox.component.d.ts +17 -0
  66. package/lib/colorpicker/zendu-colorpicker.component.d.ts +28 -0
  67. package/lib/column-configuration/columnState.d.ts +7 -0
  68. package/lib/column-configuration/zendu-column-configuration.component.d.ts +43 -0
  69. package/lib/datepicker/date-picker-day.d.ts +8 -0
  70. package/lib/datepicker/date-picker-hint.d.ts +5 -0
  71. package/lib/datepicker/datepicker.d.ts +7 -0
  72. package/lib/datepicker/zendu-datepicker.component.d.ts +94 -0
  73. package/lib/doc-scanner/zendu-doc-scanner.component.d.ts +82 -0
  74. package/lib/file-upload/zendu-file-upload.component.d.ts +28 -0
  75. package/lib/filter/dateRange.d.ts +4 -0
  76. package/lib/filter/filtersConfig.d.ts +88 -0
  77. package/lib/filter/numberRange.d.ts +4 -0
  78. package/lib/filter/zendu-filter.component.d.ts +59 -0
  79. package/lib/icon/zendu-icon.component.d.ts +10 -0
  80. package/lib/local.lock.d.ts +8 -0
  81. package/lib/location-search/location.address.d.ts +12 -0
  82. package/lib/location-search/zendu-location-search.component.d.ts +32 -0
  83. package/lib/map/map.types.d.ts +33 -0
  84. package/lib/map/zendu-map.component.d.ts +23 -0
  85. package/lib/map-preview/zendu-map-preview.component.d.ts +11 -0
  86. package/lib/ng-zenduit.module.d.ts +34 -0
  87. package/lib/pagination-bar/pageItem.d.ts +4 -0
  88. package/lib/pagination-bar/zendu-pagination-bar.component.d.ts +25 -0
  89. package/lib/phone-input/zendu-phone-input.component.d.ts +39 -0
  90. package/lib/progress/zendu-progress.component.d.ts +14 -0
  91. package/lib/radio-button/radio-button.component.d.ts +18 -0
  92. package/lib/search-box/zendu-search-box.component.d.ts +26 -0
  93. package/lib/select/templates/zendu-select-option.directive.d.ts +8 -0
  94. package/lib/select/templates/zendu-select-value.directive.d.ts +8 -0
  95. package/lib/select/zendu-select.component.d.ts +107 -0
  96. package/lib/services/geoconding.service.d.ts +23 -0
  97. package/lib/services/map.service.d.ts +22 -0
  98. package/lib/services/opencv.service.d.ts +46 -0
  99. package/lib/services/zendu-notify.service.d.ts +10 -0
  100. package/lib/sort-header/zendu-sort-header.component.d.ts +10 -0
  101. package/lib/spinner/zendu-spinner.component.d.ts +5 -0
  102. package/lib/toggle/zendu-toggle.component.d.ts +14 -0
  103. package/lib/toggle-slide/zendu-toggle-slide.component.d.ts +13 -0
  104. package/lib/util.d.ts +11 -0
  105. package/package.json +36 -0
  106. package/public-api.d.ts +38 -0
  107. package/styles/action-menu.scss +127 -0
  108. package/styles/all.scss +11 -0
  109. package/styles/button.scss +188 -0
  110. package/styles/colors.scss +125 -0
  111. package/styles/common-form.scss +159 -0
  112. package/styles/extenal.scss +2 -0
  113. package/styles/ghost.scss +38 -0
  114. package/styles/global-restyle.scss +25 -0
  115. package/styles/page-layout.scss +82 -0
  116. package/styles/snackbar.scss +91 -0
  117. package/styles/table.scss +107 -0
@@ -0,0 +1,3768 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, HostListener, ViewChild, Directive, ContentChild, NgModule } from '@angular/core';
3
+ import { show } from 'node-snackbar';
4
+ import * as i1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i2 from '@angular/forms';
7
+ import { FormsModule } from '@angular/forms';
8
+ import * as i2$1 from '@angular/cdk/drag-drop';
9
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
10
+ import moment from 'moment/moment';
11
+ import uniqBy from 'lodash.uniqby';
12
+ import { __awaiter } from 'tslib';
13
+ import { PhoneNumberUtil } from 'google-libphonenumber';
14
+ import { fabric } from 'fabric';
15
+ import { Subject } from 'rxjs';
16
+ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
17
+
18
+ class ZenNotifyService {
19
+ info(msg, duration = 5000, hasDismiss = true) {
20
+ console.log(msg);
21
+ show({
22
+ pos: "top-center",
23
+ text: msg,
24
+ textColor: "white",
25
+ duration: duration,
26
+ actionText: "dismiss",
27
+ actionTextColor: "white",
28
+ showAction: hasDismiss
29
+ });
30
+ }
31
+ success(msg, duration = 5000, hasDismiss = true) {
32
+ console.log(msg);
33
+ show({
34
+ pos: "top-center",
35
+ text: msg,
36
+ textColor: "white",
37
+ backgroundColor: "#5cbb3a",
38
+ duration: duration,
39
+ actionText: "dismiss",
40
+ actionTextColor: "white",
41
+ showAction: hasDismiss
42
+ });
43
+ }
44
+ warn(msg, duration = 5000, hasDismiss = true) {
45
+ console.warn(msg);
46
+ show({
47
+ pos: "top-center",
48
+ text: msg,
49
+ textColor: "white",
50
+ backgroundColor: "#f1b10b",
51
+ duration: duration,
52
+ actionText: "dismiss",
53
+ actionTextColor: "white",
54
+ showAction: hasDismiss
55
+ });
56
+ }
57
+ error(err, duration = 5000, hasDismiss = true) {
58
+ console.error(err);
59
+ show({
60
+ pos: "top-center",
61
+ text: this.getErrorMessage(err),
62
+ textColor: "white",
63
+ backgroundColor: "#dc3e33",
64
+ duration: duration,
65
+ actionText: "dismiss",
66
+ actionTextColor: "white",
67
+ showAction: hasDismiss
68
+ });
69
+ }
70
+ getErrorMessage(ex) {
71
+ if (!ex) {
72
+ return '';
73
+ }
74
+ if (typeof ex === 'string') {
75
+ return ex;
76
+ }
77
+ else if (typeof ex.error === 'string') {
78
+ return ex.error;
79
+ }
80
+ else if (ex.error && ex.error.message) {
81
+ return ex.error.message;
82
+ }
83
+ else if (ex.message) {
84
+ return ex.message;
85
+ }
86
+ else if (ex.status && ex.statusText) {
87
+ return `Http error ${ex.status} ${ex.statusText}`;
88
+ }
89
+ else if (ex.statusText) {
90
+ return ex.statusText;
91
+ }
92
+ else {
93
+ console.warn('Can\'t extract error message from object:', ex);
94
+ return '';
95
+ }
96
+ }
97
+ }
98
+ ZenNotifyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenNotifyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
99
+ ZenNotifyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenNotifyService, providedIn: 'root' });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenNotifyService, decorators: [{
101
+ type: Injectable,
102
+ args: [{
103
+ providedIn: 'root'
104
+ }]
105
+ }] });
106
+
107
+ class ZenduCheckboxComponent {
108
+ constructor() {
109
+ this.checkedChange = new EventEmitter();
110
+ this.label = 'Enable';
111
+ this.disabled = false;
112
+ this.disableValueChange = false;
113
+ this.indeterminate = false;
114
+ }
115
+ /**
116
+ * Toggle state
117
+ */
118
+ toggle() {
119
+ if (this.disabled || this.disableValueChange) {
120
+ return;
121
+ }
122
+ this.checked = !this.checked;
123
+ this.indeterminate = false;
124
+ this.checkedChange.emit(this.checked);
125
+ }
126
+ }
127
+ ZenduCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
128
+ ZenduCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduCheckboxComponent, selector: "zen-checkbox", inputs: { checked: "checked", label: "label", disabled: "disabled", disableValueChange: "disableValueChange", indeterminate: "indeterminate", imageUrl: "imageUrl" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<div class=\"checkbox-component\"\n [ngClass]=\"{'app-disabled': disabled}\"\n (click)=\"toggle()\">\n <button class=\"app-checkbox\"\n [ngClass]=\"{ 'app-checked': checked && !indeterminate, 'app-indeterminate': indeterminate }\">\n <i *ngIf=\"checked && !indeterminate\"\n class=\"material-icons app-checkbox-icon\">done</i>\n <i *ngIf=\"indeterminate\"\n class=\"material-icons app-checkbox-icon\">remove</i>\n </button>\n <div class=\"app-checkbox-label\"\n *ngIf=\"label\">\n <img class=\"checkbox-image\"\n [src]=\"imageUrl\"\n *ngIf=\"imageUrl\">\n {{label}}\n </div>\n</div>", styles: [".checkbox-component{display:flex;align-items:center;cursor:pointer;gap:8px}.checkbox-component .app-checkbox{padding:4px;position:relative;width:20px;min-width:20px;height:20px;min-height:20px;border:1.6px solid #d6d6d8;border-radius:2px;box-sizing:border-box;color:#fff;background:transparent}.checkbox-component .app-checkbox:focus{outline:none;box-shadow:0 0 2px 2px #2188d94d}.checkbox-component .app-checkbox.app-checked{border-color:var(--color-primary, #2188d9);color:var(--color-primary, #2188d9)}.checkbox-component .app-checkbox.app-checked+.app-checkbox-label{color:#4f4f4f}.checkbox-component .app-checkbox.app-indeterminate{border-color:var(--color-primary, #2188d9);color:var(--color-primary, #2188d9)}.checkbox-component .app-checkbox .app-checkbox-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:18px}.checkbox-component .app-checkbox-label{font-weight:400;font-size:14px;line-height:130%;color:#828282;display:flex;align-items:center}.checkbox-component .app-checkbox-label .checkbox-image{margin-right:8px;width:36px}.checkbox-component:hover,.checkbox-component:focus{outline:none;text-decoration:none}.checkbox-component:hover .app-checkbox,.checkbox-component:focus .app-checkbox{border-color:#16598d}.checkbox-component:hover .app-checkbox.app-checked,.checkbox-component:focus .app-checkbox.app-checked{border-color:#16598d;color:#16598d}.checkbox-component:hover .app-checkbox.app-indeterminate,.checkbox-component:focus .app-checkbox.app-indeterminate{border-color:#16598d;color:#16598d}.checkbox-component.app-disabled{cursor:not-allowed}.checkbox-component.app-disabled .app-checkbox{border-color:#ececed}.checkbox-component.app-disabled .app-checkbox.app-checked,.checkbox-component.app-disabled .app-checkbox.app-indeterminate{border-color:#ececed;color:#ececed}.checkbox-component.app-disabled .app-checkbox-label{color:#ececed}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduCheckboxComponent, decorators: [{
130
+ type: Component,
131
+ args: [{ selector: 'zen-checkbox', template: "<div class=\"checkbox-component\"\n [ngClass]=\"{'app-disabled': disabled}\"\n (click)=\"toggle()\">\n <button class=\"app-checkbox\"\n [ngClass]=\"{ 'app-checked': checked && !indeterminate, 'app-indeterminate': indeterminate }\">\n <i *ngIf=\"checked && !indeterminate\"\n class=\"material-icons app-checkbox-icon\">done</i>\n <i *ngIf=\"indeterminate\"\n class=\"material-icons app-checkbox-icon\">remove</i>\n </button>\n <div class=\"app-checkbox-label\"\n *ngIf=\"label\">\n <img class=\"checkbox-image\"\n [src]=\"imageUrl\"\n *ngIf=\"imageUrl\">\n {{label}}\n </div>\n</div>", styles: [".checkbox-component{display:flex;align-items:center;cursor:pointer;gap:8px}.checkbox-component .app-checkbox{padding:4px;position:relative;width:20px;min-width:20px;height:20px;min-height:20px;border:1.6px solid #d6d6d8;border-radius:2px;box-sizing:border-box;color:#fff;background:transparent}.checkbox-component .app-checkbox:focus{outline:none;box-shadow:0 0 2px 2px #2188d94d}.checkbox-component .app-checkbox.app-checked{border-color:var(--color-primary, #2188d9);color:var(--color-primary, #2188d9)}.checkbox-component .app-checkbox.app-checked+.app-checkbox-label{color:#4f4f4f}.checkbox-component .app-checkbox.app-indeterminate{border-color:var(--color-primary, #2188d9);color:var(--color-primary, #2188d9)}.checkbox-component .app-checkbox .app-checkbox-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:18px}.checkbox-component .app-checkbox-label{font-weight:400;font-size:14px;line-height:130%;color:#828282;display:flex;align-items:center}.checkbox-component .app-checkbox-label .checkbox-image{margin-right:8px;width:36px}.checkbox-component:hover,.checkbox-component:focus{outline:none;text-decoration:none}.checkbox-component:hover .app-checkbox,.checkbox-component:focus .app-checkbox{border-color:#16598d}.checkbox-component:hover .app-checkbox.app-checked,.checkbox-component:focus .app-checkbox.app-checked{border-color:#16598d;color:#16598d}.checkbox-component:hover .app-checkbox.app-indeterminate,.checkbox-component:focus .app-checkbox.app-indeterminate{border-color:#16598d;color:#16598d}.checkbox-component.app-disabled{cursor:not-allowed}.checkbox-component.app-disabled .app-checkbox{border-color:#ececed}.checkbox-component.app-disabled .app-checkbox.app-checked,.checkbox-component.app-disabled .app-checkbox.app-indeterminate{border-color:#ececed;color:#ececed}.checkbox-component.app-disabled .app-checkbox-label{color:#ececed}\n"] }]
132
+ }], propDecorators: { checked: [{
133
+ type: Input
134
+ }], checkedChange: [{
135
+ type: Output
136
+ }], label: [{
137
+ type: Input
138
+ }], disabled: [{
139
+ type: Input
140
+ }], disableValueChange: [{
141
+ type: Input
142
+ }], indeterminate: [{
143
+ type: Input
144
+ }], imageUrl: [{
145
+ type: Input
146
+ }] } });
147
+
148
+ class ZenduColorPickerComponent {
149
+ constructor(_element) {
150
+ this._element = _element;
151
+ this.colorChange = new EventEmitter();
152
+ this.icon = "text";
153
+ this.showNone = true;
154
+ this.opened = false;
155
+ this.menuLeft = "0px";
156
+ this.menuTop = "";
157
+ this.menuBottom = "";
158
+ this.colorsRows = [
159
+ { colors: ["#000000", "#666666", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#ffffff"] },
160
+ { colors: ["#CC0000", "#E69138", "#F1C232", "#6AA84F", "#3C78D8", "#674EA7", "#A64D79"] },
161
+ { colors: ["#E06666", "#F6B26B", "#FFD966", "#93C47D", "#6D9EEB", "#8E7CC3", "#C27BA0"] },
162
+ { colors: ["#EA9999", "#F9CB9C", "#FFE599", "#B6D7A8", "#A4C2F4", "#B4A7D6", "#D5A6BD"] },
163
+ { colors: ["#F4CCCC", "#FCE5CD", "#FFF2CC", "#D9EAD3", "#C9DAF8", "#D9D2E9", "#EAD1DC"] }
164
+ ];
165
+ }
166
+ outsideHandling(event) {
167
+ if (!document.body.contains(event.target)) {
168
+ // element not in the DOM
169
+ return;
170
+ }
171
+ if (this._element.nativeElement.contains(event.target)) {
172
+ return;
173
+ }
174
+ this.hidePicker();
175
+ }
176
+ scroll() {
177
+ this.updatePlacement();
178
+ }
179
+ ngOnChanges(changes) {
180
+ if (changes["customTarget"] &&
181
+ changes["customTarget"].currentValue &&
182
+ this.customTarget) {
183
+ this.customTarget.addEventListener("click", this.toggleEvent.bind(this));
184
+ }
185
+ this.updatePlacement();
186
+ }
187
+ toggleEvent(evt) {
188
+ this.toggle();
189
+ evt.stopPropagation();
190
+ }
191
+ toggle() {
192
+ this.updatePlacement();
193
+ this.opened = !this.opened;
194
+ }
195
+ updatePlacement() {
196
+ let container;
197
+ if (this.customTarget) {
198
+ container = this.customTarget;
199
+ }
200
+ else {
201
+ const component = this._element.nativeElement;
202
+ container = component.getElementsByClassName("colorpicker-component").item(0);
203
+ }
204
+ const left = container.getBoundingClientRect().left;
205
+ const top = container.getBoundingClientRect().top;
206
+ const bottom = container.getBoundingClientRect().bottom;
207
+ const margin = 8;
208
+ this.menuLeft = `${left}px`;
209
+ const distToBottomOfPage = window.innerHeight - top;
210
+ if (distToBottomOfPage > 150) {
211
+ this.menuTop = `${bottom + margin}px`;
212
+ this.menuBottom = "";
213
+ }
214
+ else {
215
+ const bottomFixed = window.innerHeight - top + margin;
216
+ this.menuBottom = `${bottomFixed}px`;
217
+ this.menuTop = "";
218
+ }
219
+ }
220
+ hidePicker() {
221
+ this.opened = false;
222
+ }
223
+ selectColor(color) {
224
+ this.color = color;
225
+ this.colorChange.emit(color);
226
+ }
227
+ }
228
+ ZenduColorPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduColorPickerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
229
+ ZenduColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduColorPickerComponent, selector: "zen-colorpicker", inputs: { color: "color", icon: "icon", customTarget: "customTarget", showNone: "showNone" }, outputs: { colorChange: "colorChange" }, host: { listeners: { "window:mousedown": "outsideHandling($event)", "window:scroll": "scroll()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"colorpicker-component\"\n (click)=\"toggle()\"\n [class.opened]=\"opened\"\n [class.no-size]=\"customTarget\">\n\n <ng-container *ngIf=\"!customTarget\">\n <div *ngIf=\"icon == 'text'\">\n <img src=\"https://storage.googleapis.com/zenduit-icons/components/color_picker_text.svg\"\n class=\"icon-text\">\n </div>\n\n <div *ngIf=\"icon == 'paint'\">\n <img src=\"https://storage.googleapis.com/zenduit-icons/components/color_picker_paint.svg\"\n class=\"icon-paint\">\n </div>\n\n <div class=\"toggle\">\n <i class=\"material-icons\">arrow_drop_down</i>\n </div>\n\n <div class=\"color-line\"\n [ngStyle]=\"{'border-color': color}\">\n </div>\n </ng-container>\n\n <div *ngIf=\"opened\"\n class=\"color-menu\"\n [ngStyle]=\"{ 'left': menuLeft, 'top': menuTop, 'bottom': menuBottom }\">\n\n <div class=\"colors-container\">\n <div *ngFor=\"let row of colorsRows\"\n class=\"color-row\">\n <div *ngFor=\"let rowColor of row.colors\"\n (click)=\"selectColor(rowColor)\"\n class=\"color-item\"\n [ngStyle]=\"{'background-color': rowColor}\">\n <div *ngIf=\"rowColor == color\"\n class=\"select-icon\">\n <i class=\"material-icons\">check</i>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf=\"showNone\"\n class=\"no-color\"\n (click)=\"selectColor('')\">\n None\n </div>\n </div>\n</div>\n", styles: [".colorpicker-component{border:1px solid var(--color-primary, #2188d9);position:relative;border-radius:4px;padding:3px 4px;width:29px;height:19px;display:flex;cursor:pointer}.colorpicker-component.no-size{border:0;width:0px;height:0px;padding:0;margin:0}.colorpicker-component .color-line{width:14px;border:2px solid;position:absolute;bottom:5px;left:3px;z-index:1;background-color:#000}.colorpicker-component .material-icons{color:#333;font-size:16px}.colorpicker-component .icon-paint{margin-bottom:2px;margin-left:2px;height:13px;width:13px}.colorpicker-component .icon-text{margin-bottom:4px;margin-left:2px;height:11px;width:11px}.colorpicker-component .toggle{padding-top:4px}.colorpicker-component.opened{background:rgba(33,136,217,.1)}.colorpicker-component.opened .material-icons{color:var(--color-primary, #2188d9)!important}.colorpicker-component .color-menu{background:#ffffff;box-shadow:0 2px 4px -1px #00000008,0 4px 5px #0000003d,0 1px 10px #0000001a;border-radius:8px;position:fixed;overflow-y:auto;white-space:initial;padding:4px;z-index:10}.colorpicker-component .color-menu .colors-container .color-row{display:flex;align-items:center;justify-content:space-between}.colorpicker-component .color-menu .colors-container .color-row .color-item{width:14px;height:14px;cursor:pointer;border:1px solid #d5d5d5;border-radius:1px;margin:1px}.colorpicker-component .color-menu .colors-container .color-row .select-icon{position:relative}.colorpicker-component .color-menu .colors-container .color-row .select-icon .material-icons{position:absolute;color:#fff!important;font-size:12px;font-weight:700}.colorpicker-component .color-menu .no-color{background:#ffffff;border:1px solid #b0b0b0;border-radius:5px;font-family:Roboto;font-style:normal;font-weight:400;font-size:12px;display:flex;justify-content:center;margin-top:5px;cursor:pointer;color:#333}\n"], 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: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduColorPickerComponent, decorators: [{
231
+ type: Component,
232
+ args: [{ selector: 'zen-colorpicker', template: "<div class=\"colorpicker-component\"\n (click)=\"toggle()\"\n [class.opened]=\"opened\"\n [class.no-size]=\"customTarget\">\n\n <ng-container *ngIf=\"!customTarget\">\n <div *ngIf=\"icon == 'text'\">\n <img src=\"https://storage.googleapis.com/zenduit-icons/components/color_picker_text.svg\"\n class=\"icon-text\">\n </div>\n\n <div *ngIf=\"icon == 'paint'\">\n <img src=\"https://storage.googleapis.com/zenduit-icons/components/color_picker_paint.svg\"\n class=\"icon-paint\">\n </div>\n\n <div class=\"toggle\">\n <i class=\"material-icons\">arrow_drop_down</i>\n </div>\n\n <div class=\"color-line\"\n [ngStyle]=\"{'border-color': color}\">\n </div>\n </ng-container>\n\n <div *ngIf=\"opened\"\n class=\"color-menu\"\n [ngStyle]=\"{ 'left': menuLeft, 'top': menuTop, 'bottom': menuBottom }\">\n\n <div class=\"colors-container\">\n <div *ngFor=\"let row of colorsRows\"\n class=\"color-row\">\n <div *ngFor=\"let rowColor of row.colors\"\n (click)=\"selectColor(rowColor)\"\n class=\"color-item\"\n [ngStyle]=\"{'background-color': rowColor}\">\n <div *ngIf=\"rowColor == color\"\n class=\"select-icon\">\n <i class=\"material-icons\">check</i>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf=\"showNone\"\n class=\"no-color\"\n (click)=\"selectColor('')\">\n None\n </div>\n </div>\n</div>\n", styles: [".colorpicker-component{border:1px solid var(--color-primary, #2188d9);position:relative;border-radius:4px;padding:3px 4px;width:29px;height:19px;display:flex;cursor:pointer}.colorpicker-component.no-size{border:0;width:0px;height:0px;padding:0;margin:0}.colorpicker-component .color-line{width:14px;border:2px solid;position:absolute;bottom:5px;left:3px;z-index:1;background-color:#000}.colorpicker-component .material-icons{color:#333;font-size:16px}.colorpicker-component .icon-paint{margin-bottom:2px;margin-left:2px;height:13px;width:13px}.colorpicker-component .icon-text{margin-bottom:4px;margin-left:2px;height:11px;width:11px}.colorpicker-component .toggle{padding-top:4px}.colorpicker-component.opened{background:rgba(33,136,217,.1)}.colorpicker-component.opened .material-icons{color:var(--color-primary, #2188d9)!important}.colorpicker-component .color-menu{background:#ffffff;box-shadow:0 2px 4px -1px #00000008,0 4px 5px #0000003d,0 1px 10px #0000001a;border-radius:8px;position:fixed;overflow-y:auto;white-space:initial;padding:4px;z-index:10}.colorpicker-component .color-menu .colors-container .color-row{display:flex;align-items:center;justify-content:space-between}.colorpicker-component .color-menu .colors-container .color-row .color-item{width:14px;height:14px;cursor:pointer;border:1px solid #d5d5d5;border-radius:1px;margin:1px}.colorpicker-component .color-menu .colors-container .color-row .select-icon{position:relative}.colorpicker-component .color-menu .colors-container .color-row .select-icon .material-icons{position:absolute;color:#fff!important;font-size:12px;font-weight:700}.colorpicker-component .color-menu .no-color{background:#ffffff;border:1px solid #b0b0b0;border-radius:5px;font-family:Roboto;font-style:normal;font-weight:400;font-size:12px;display:flex;justify-content:center;margin-top:5px;cursor:pointer;color:#333}\n"] }]
233
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { color: [{
234
+ type: Input
235
+ }], colorChange: [{
236
+ type: Output
237
+ }], icon: [{
238
+ type: Input
239
+ }], customTarget: [{
240
+ type: Input
241
+ }], showNone: [{
242
+ type: Input
243
+ }], outsideHandling: [{
244
+ type: HostListener,
245
+ args: ['window:mousedown', ['$event']]
246
+ }], scroll: [{
247
+ type: HostListener,
248
+ args: ['window:scroll', []]
249
+ }] } });
250
+
251
+ class Util {
252
+ static debounce(func, wait, immediate) {
253
+ let timeout;
254
+ const context = this;
255
+ return function executedFunction() {
256
+ const args = arguments;
257
+ const later = function () {
258
+ timeout = null;
259
+ if (!immediate) {
260
+ func.apply(context, args);
261
+ }
262
+ };
263
+ const callNow = immediate && !timeout;
264
+ clearTimeout(timeout);
265
+ timeout = setTimeout(later, wait);
266
+ if (callNow) {
267
+ func.apply(context, args);
268
+ }
269
+ };
270
+ }
271
+ static clone(source) {
272
+ let str = JSON.stringify(source);
273
+ let outObj = JSON.parse(str);
274
+ this.updateClone(outObj);
275
+ // Convert in the output object ISO string to Date object
276
+ //
277
+ // @ts-ignore
278
+ for (let key of Object.keys(source)) {
279
+ const val = source[key];
280
+ if (val &&
281
+ typeof val == "object" &&
282
+ typeof val.getTime == "function" &&
283
+ typeof val.getDate == "function") {
284
+ outObj[key] = new Date(val);
285
+ }
286
+ }
287
+ return outObj;
288
+ }
289
+ /**
290
+ * Remove internal angularjs properties
291
+ * @param obj
292
+ */
293
+ static updateClone(obj) {
294
+ if (!obj) {
295
+ return;
296
+ }
297
+ if (Array.isArray(obj)) {
298
+ for (let item of obj) {
299
+ if (!item) {
300
+ item = item;
301
+ }
302
+ this.updateClone(item);
303
+ }
304
+ return;
305
+ }
306
+ let type = typeof obj;
307
+ if (type == "string" || type == "number") {
308
+ return;
309
+ }
310
+ // Remove invalid props
311
+ let keys = Object.keys(obj);
312
+ keys.forEach((key) => {
313
+ if (key[0] == '$' ||
314
+ key[0] == '&') {
315
+ delete obj[key];
316
+ return;
317
+ }
318
+ let val = obj[key];
319
+ if (Array.isArray(val)) {
320
+ let arr = val;
321
+ for (let k of arr) {
322
+ this.updateClone(k);
323
+ }
324
+ }
325
+ else if (typeof val == "object") {
326
+ this.updateClone(val);
327
+ }
328
+ });
329
+ }
330
+ static copyProperties(source, dest) {
331
+ for (let key of Object.keys(source)) {
332
+ dest[key] = source[key];
333
+ }
334
+ }
335
+ static sleep(ms) {
336
+ return new Promise((resolve) => {
337
+ setTimeout(() => {
338
+ resolve();
339
+ }, ms);
340
+ });
341
+ }
342
+ }
343
+
344
+ class ZenduSearchBoxComponent {
345
+ constructor(_element, _ngZone) {
346
+ this._element = _element;
347
+ this._ngZone = _ngZone;
348
+ this.textChange = new EventEmitter();
349
+ this.autoFocus = true;
350
+ this.placeholder = "Search";
351
+ this._focusAttempts = 0;
352
+ this.setDelay(500);
353
+ }
354
+ set delay(val) {
355
+ this.setDelay(val);
356
+ }
357
+ ngOnInit() {
358
+ // give 100ms for autoFocus initalization
359
+ setTimeout(() => {
360
+ if (this.autoFocus) {
361
+ this.doFocus();
362
+ }
363
+ }, 100);
364
+ }
365
+ onChange() {
366
+ this._debouncedInvoke();
367
+ }
368
+ clearFromParent() {
369
+ this.text = "";
370
+ }
371
+ clear() {
372
+ this.text = "";
373
+ this._debouncedInvoke();
374
+ }
375
+ invokeChange() {
376
+ this._ngZone.run(() => {
377
+ this.textChange.emit(this.text);
378
+ });
379
+ }
380
+ setDelay(delay) {
381
+ this._debouncedInvoke = Util.debounce(() => {
382
+ this.invokeChange();
383
+ }, delay);
384
+ }
385
+ activateSearchBox() {
386
+ this.searchInput.nativeElement.focus();
387
+ }
388
+ doFocus() {
389
+ this._focusAttempts++;
390
+ if (this._focusAttempts > 100) {
391
+ // stop attempts to initalize
392
+ return;
393
+ }
394
+ const input = this.getInput(this._element.nativeElement);
395
+ if (!input) {
396
+ // wait 100ms to run the next check
397
+ setTimeout(() => {
398
+ this.doFocus();
399
+ }, 100);
400
+ return;
401
+ }
402
+ // check if element visible or not
403
+ const height = input.clientHeight;
404
+ if (height == 0) {
405
+ // wait 100ms to run the next check
406
+ setTimeout(() => {
407
+ this.doFocus();
408
+ }, 100);
409
+ return;
410
+ }
411
+ // set focus to element
412
+ setTimeout(() => {
413
+ input.focus();
414
+ }, 1);
415
+ }
416
+ getInput(element) {
417
+ if (!element) {
418
+ return null;
419
+ }
420
+ if (element.nodeName == "INPUT") {
421
+ return element;
422
+ }
423
+ for (let idx = 0; idx < element.children.length; idx++) {
424
+ const el = element.children.item(idx);
425
+ if (el && el.nodeName == "INPUT") {
426
+ return el;
427
+ }
428
+ }
429
+ // find input in the children tree
430
+ for (let idx = 0; idx < element.children.length; idx++) {
431
+ const el = element.children.item(idx);
432
+ if (!el) {
433
+ continue;
434
+ }
435
+ const elInput = this.getInput(el);
436
+ if (elInput) {
437
+ return elInput;
438
+ }
439
+ }
440
+ return null;
441
+ }
442
+ }
443
+ ZenduSearchBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSearchBoxComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
444
+ ZenduSearchBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSearchBoxComponent, selector: "zen-search-box", inputs: { text: "text", delay: "delay", autoFocus: "autoFocus", placeholder: "placeholder" }, outputs: { textChange: "textChange" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }], ngImport: i0, template: "<div class=\"search-box-component\">\n <i class=\"svg-icons\"\n (click)=\"activateSearchBox()\">\n <svg width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"8.33333\"\n cy=\"8.33333\"\n r=\"5.83333\"\n stroke=\"#828282\"\n stroke-width=\"1.6\" />\n <path d=\"M17.5 17.5001L12.9166 12.9167\"\n stroke=\"#828282\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\" />\n </svg>\n </i>\n <input [(ngModel)]=\"text\"\n class=\"search-box\"\n (ngModelChange)=\"onChange()\"\n placeholder=\"{{placeholder}}\"\n #searchInput>\n <i class=\"material-icons close-icon\"\n *ngIf=\"text\"\n (click)=\"clear()\">close</i>\n</div>", styles: [".search-box-component{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:8px;width:100%;height:40px;background:#FFFFFF;border:1px solid #F2F2F2;box-sizing:border-box;border-radius:4px;padding:8px}.search-box-component:hover{border-color:#b8b9bc}.search-box-component:focus-within{box-shadow:0 0 2px 2px #2188d94d}.search-box-component input{border:0;font-style:normal;font-weight:400;font-size:14px;line-height:130%;width:100%;outline:none;color:#4f4f4f;font-family:Roboto}.search-box-component input::placeholder{color:#828282}.search-box-component .svg-icons{display:flex}.search-box-component .material-icons{color:#828282;-webkit-user-select:none;user-select:none}.search-box-component .material-icons.close-icon{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSearchBoxComponent, decorators: [{
446
+ type: Component,
447
+ args: [{ selector: 'zen-search-box', template: "<div class=\"search-box-component\">\n <i class=\"svg-icons\"\n (click)=\"activateSearchBox()\">\n <svg width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"8.33333\"\n cy=\"8.33333\"\n r=\"5.83333\"\n stroke=\"#828282\"\n stroke-width=\"1.6\" />\n <path d=\"M17.5 17.5001L12.9166 12.9167\"\n stroke=\"#828282\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\" />\n </svg>\n </i>\n <input [(ngModel)]=\"text\"\n class=\"search-box\"\n (ngModelChange)=\"onChange()\"\n placeholder=\"{{placeholder}}\"\n #searchInput>\n <i class=\"material-icons close-icon\"\n *ngIf=\"text\"\n (click)=\"clear()\">close</i>\n</div>", styles: [".search-box-component{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:8px;width:100%;height:40px;background:#FFFFFF;border:1px solid #F2F2F2;box-sizing:border-box;border-radius:4px;padding:8px}.search-box-component:hover{border-color:#b8b9bc}.search-box-component:focus-within{box-shadow:0 0 2px 2px #2188d94d}.search-box-component input{border:0;font-style:normal;font-weight:400;font-size:14px;line-height:130%;width:100%;outline:none;color:#4f4f4f;font-family:Roboto}.search-box-component input::placeholder{color:#828282}.search-box-component .svg-icons{display:flex}.search-box-component .material-icons{color:#828282;-webkit-user-select:none;user-select:none}.search-box-component .material-icons.close-icon{cursor:pointer}\n"] }]
448
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { text: [{
449
+ type: Input
450
+ }], textChange: [{
451
+ type: Output
452
+ }], delay: [{
453
+ type: Input
454
+ }], autoFocus: [{
455
+ type: Input
456
+ }], placeholder: [{
457
+ type: Input
458
+ }], searchInput: [{
459
+ type: ViewChild,
460
+ args: ['searchInput', { static: false }]
461
+ }] } });
462
+
463
+ class ZenduColumnConfigurationComponent {
464
+ constructor(_element) {
465
+ this._element = _element;
466
+ /**
467
+ * callback to emit changes for parent component
468
+ */
469
+ this.configurationChange = new EventEmitter();
470
+ /**
471
+ * input propery
472
+ */
473
+ this.configuration = [];
474
+ /**
475
+ * Default configuration for reset button
476
+ */
477
+ this.defaultConfiguration = [];
478
+ /**
479
+ * dropdown position
480
+ */
481
+ this.dropdownPosition = 'right';
482
+ /**
483
+ * Inital configuration
484
+ */
485
+ this._sourceConfiguration = [];
486
+ this.tempColumnConfiguration = [];
487
+ this.filteredColumnsConfiguration = [];
488
+ this.showPanel = false;
489
+ this.searchText = '';
490
+ }
491
+ outsideHandling(event) {
492
+ if (!document.body.contains(event.target)) {
493
+ // element not in the DOM
494
+ return;
495
+ }
496
+ if (this._element.nativeElement.contains(event.target)) {
497
+ return;
498
+ }
499
+ // hide the menu for outside click
500
+ this.hide();
501
+ }
502
+ ngOnChanges(changes) {
503
+ if (changes.configuration.currentValue && this.configuration) {
504
+ this.initData();
505
+ }
506
+ }
507
+ initData() {
508
+ this.tempColumnConfiguration = Util.clone(this.configuration);
509
+ this._sourceConfiguration = Util.clone(this.configuration);
510
+ this.filterItems();
511
+ }
512
+ togglePanel() {
513
+ this.showPanel = !this.showPanel;
514
+ // clear search
515
+ this.searchText = '';
516
+ if (this.showPanel) {
517
+ // restore inital values on open
518
+ this.tempColumnConfiguration = Util.clone(this._sourceConfiguration);
519
+ }
520
+ this.filterItems();
521
+ }
522
+ apply() {
523
+ this.configuration = Util.clone(this.tempColumnConfiguration);
524
+ // overwrite the default as well
525
+ this._sourceConfiguration = Util.clone(this.tempColumnConfiguration);
526
+ this.showPanel = false;
527
+ this.configurationChange.emit(this.configuration);
528
+ }
529
+ hide() {
530
+ this.showPanel = false;
531
+ }
532
+ onDrop(event) {
533
+ moveItemInArray(this.filteredColumnsConfiguration, event.previousIndex, event.currentIndex);
534
+ this.tempColumnConfiguration = this.filteredColumnsConfiguration;
535
+ }
536
+ reset() {
537
+ if (this.defaultConfiguration && this.defaultConfiguration.length) {
538
+ // use the default configuration
539
+ this.tempColumnConfiguration = Util.clone(this.defaultConfiguration);
540
+ }
541
+ else {
542
+ // activate all items
543
+ for (const item of this.tempColumnConfiguration) {
544
+ item.isVisible = true;
545
+ }
546
+ }
547
+ this.filterItems();
548
+ }
549
+ filterItems() {
550
+ this.filteredColumnsConfiguration = this.tempColumnConfiguration.filter((col) => col.displayName
551
+ .toLowerCase()
552
+ .includes(this.searchText.trim().toLowerCase()));
553
+ }
554
+ }
555
+ ZenduColumnConfigurationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduColumnConfigurationComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
556
+ ZenduColumnConfigurationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduColumnConfigurationComponent, selector: "zen-column-configuration", inputs: { configuration: "configuration", defaultConfiguration: "defaultConfiguration", dropdownPosition: "dropdownPosition" }, outputs: { configurationChange: "configurationChange" }, host: { listeners: { "window:mousedown": "outsideHandling($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"column-config-component\">\n <button class=\"button-basic button-icon\"\n [ngClass]=\"{ 'active': showPanel }\"\n (click)=\"togglePanel()\">\n <i class=\"material-icons\">view_column</i>\n </button>\n\n <div *ngIf=\"showPanel\"\n class=\"action-menu column-config-menu\"\n [ngClass]=\"{'right': dropdownPosition === 'right'}\">\n <div class=\"action-menu-header\">\n <div class=\"title\">Manage Columns</div>\n <zen-search-box [(text)]=\"searchText\"\n (textChange)=\"filterItems()\"></zen-search-box>\n </div>\n\n\n <div class=\"action-menu-body dnd-container\"\n cdkDropList\n (cdkDropListDropped)=\"onDrop($event)\">\n <div *ngFor=\"let config of filteredColumnsConfiguration\"\n class=\"action-item-checkbox drag-item\"\n cdkDrag>\n <zen-checkbox class=\"flex-1\"\n [(checked)]=\"config.isVisible\"\n [label]=\"config.displayName\"></zen-checkbox>\n <i class=\"material-icons drag-icon\">drag_handle</i>\n </div>\n </div>\n\n <div class=\"action-menu-footer\">\n <button (click)=\"reset()\"\n type=\"button\"\n class=\"button-stroked full-width\">Reset</button>\n <button (click)=\"apply()\"\n type=\"button\"\n class=\"button-flat full-width\">Apply</button>\n </div>\n </div>\n</div>\n", styles: [".column-config-component{display:inline-block;position:relative}.column-config-component .column-config-menu{top:115%;width:300px}.column-config-component .column-config-menu.right{right:0}.column-config-component .column-config-menu .dnd-container{max-height:218px;overflow-y:auto}.column-config-component .column-config-menu .dnd-container .drag-item{justify-content:space-between}.column-config-component .column-config-menu .dnd-container .drag-item .drag-icon{cursor:move;color:#b8b9bc}.column-config-component .column-config-menu .dnd-container .dndDraggingSource{display:none}.column-config-component .column-config-menu .dnd-container .dndPlaceholder{background-color:#b8b9bc;display:block;min-height:40px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: ZenduCheckboxComponent, selector: "zen-checkbox", inputs: ["checked", "label", "disabled", "disableValueChange", "indeterminate", "imageUrl"], outputs: ["checkedChange"] }, { kind: "component", type: ZenduSearchBoxComponent, selector: "zen-search-box", inputs: ["text", "delay", "autoFocus", "placeholder"], outputs: ["textChange"] }] });
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduColumnConfigurationComponent, decorators: [{
558
+ type: Component,
559
+ args: [{ selector: 'zen-column-configuration', template: "<div class=\"column-config-component\">\n <button class=\"button-basic button-icon\"\n [ngClass]=\"{ 'active': showPanel }\"\n (click)=\"togglePanel()\">\n <i class=\"material-icons\">view_column</i>\n </button>\n\n <div *ngIf=\"showPanel\"\n class=\"action-menu column-config-menu\"\n [ngClass]=\"{'right': dropdownPosition === 'right'}\">\n <div class=\"action-menu-header\">\n <div class=\"title\">Manage Columns</div>\n <zen-search-box [(text)]=\"searchText\"\n (textChange)=\"filterItems()\"></zen-search-box>\n </div>\n\n\n <div class=\"action-menu-body dnd-container\"\n cdkDropList\n (cdkDropListDropped)=\"onDrop($event)\">\n <div *ngFor=\"let config of filteredColumnsConfiguration\"\n class=\"action-item-checkbox drag-item\"\n cdkDrag>\n <zen-checkbox class=\"flex-1\"\n [(checked)]=\"config.isVisible\"\n [label]=\"config.displayName\"></zen-checkbox>\n <i class=\"material-icons drag-icon\">drag_handle</i>\n </div>\n </div>\n\n <div class=\"action-menu-footer\">\n <button (click)=\"reset()\"\n type=\"button\"\n class=\"button-stroked full-width\">Reset</button>\n <button (click)=\"apply()\"\n type=\"button\"\n class=\"button-flat full-width\">Apply</button>\n </div>\n </div>\n</div>\n", styles: [".column-config-component{display:inline-block;position:relative}.column-config-component .column-config-menu{top:115%;width:300px}.column-config-component .column-config-menu.right{right:0}.column-config-component .column-config-menu .dnd-container{max-height:218px;overflow-y:auto}.column-config-component .column-config-menu .dnd-container .drag-item{justify-content:space-between}.column-config-component .column-config-menu .dnd-container .drag-item .drag-icon{cursor:move;color:#b8b9bc}.column-config-component .column-config-menu .dnd-container .dndDraggingSource{display:none}.column-config-component .column-config-menu .dnd-container .dndPlaceholder{background-color:#b8b9bc;display:block;min-height:40px}\n"] }]
560
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { configurationChange: [{
561
+ type: Output
562
+ }], configuration: [{
563
+ type: Input
564
+ }], defaultConfiguration: [{
565
+ type: Input
566
+ }], dropdownPosition: [{
567
+ type: Input
568
+ }], outsideHandling: [{
569
+ type: HostListener,
570
+ args: ['window:mousedown', ['$event']]
571
+ }] } });
572
+
573
+ var DATEPICKER_POSITION;
574
+ (function (DATEPICKER_POSITION) {
575
+ DATEPICKER_POSITION["AUTO"] = "auto";
576
+ DATEPICKER_POSITION["LEFT"] = "left";
577
+ DATEPICKER_POSITION["RIGHT"] = "right";
578
+ DATEPICKER_POSITION["TOP"] = "top";
579
+ DATEPICKER_POSITION["BOTTOM"] = "bottom";
580
+ })(DATEPICKER_POSITION || (DATEPICKER_POSITION = {}));
581
+
582
+ class ZenduIconComponent {
583
+ constructor(_host) {
584
+ this._host = _host;
585
+ }
586
+ ngOnChanges(changes) {
587
+ if (this.src) {
588
+ // apply styles to host
589
+ const host = this._host.nativeElement;
590
+ host.style["mask-image"] = `url(${this.src})`;
591
+ host.style["-webkit-mask-image"] = `url(${this.src})`;
592
+ }
593
+ }
594
+ }
595
+ ZenduIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
596
+ ZenduIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduIconComponent, selector: "zen-icon", inputs: { src: "src" }, usesOnChanges: true, ngImport: i0, template: "", styles: [":host{background-color:#000;width:24px;height:24px;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;display:block}\n"] });
597
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduIconComponent, decorators: [{
598
+ type: Component,
599
+ args: [{ selector: 'zen-icon', template: "", styles: [":host{background-color:#000;width:24px;height:24px;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;display:block}\n"] }]
600
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { src: [{
601
+ type: Input
602
+ }] } });
603
+
604
+ const defaultHours = '12';
605
+ const defaultMinuts = '00';
606
+ class ZenduDatepickerComponent {
607
+ constructor(_element) {
608
+ this._element = _element;
609
+ /**
610
+ * callback to emit changes for parent component
611
+ */
612
+ this.dateChange = new EventEmitter();
613
+ this.showTime = false;
614
+ this.showDate = true;
615
+ this.boxDesign = false;
616
+ this.highlightDays = [];
617
+ this.autoConfirm = false;
618
+ /**
619
+ * datepicker states
620
+ */
621
+ this.highlightError = false;
622
+ this.disabled = false;
623
+ this.readonly = false;
624
+ this.xPosition = DATEPICKER_POSITION.AUTO;
625
+ this.yPosition = DATEPICKER_POSITION.AUTO;
626
+ this.selectedTime = { Hr: 1, Min: 0 };
627
+ this.isPickerVisible = false;
628
+ this.dayRows = [];
629
+ this.daysTitle = "";
630
+ this.weekDays = ["Mo", "Tu", "We", "Th", "Fri", "Sa", "Su"];
631
+ this.currentSlot = new Date();
632
+ this.hour = defaultHours;
633
+ this.min = defaultMinuts;
634
+ this.isPM = false;
635
+ this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
636
+ this.years = [];
637
+ this.monthPickerVisible = false;
638
+ this.yearPickerVisible = false;
639
+ this.right = false;
640
+ this.bottom = false;
641
+ }
642
+ outsideHandling(event) {
643
+ if (!document.body.contains(event.target)) {
644
+ // element not in the DOM
645
+ return;
646
+ }
647
+ if (this._element.nativeElement.contains(event.target)) {
648
+ return;
649
+ }
650
+ this.hideTimePicker();
651
+ }
652
+ scroll() {
653
+ this.updatePlacement();
654
+ }
655
+ ngOnChanges(changes) {
656
+ if (this.date) {
657
+ this._dateToSet = new Date(this.date);
658
+ this.selectedTime = {
659
+ Hr: moment(this.date).hours(),
660
+ Min: moment(this.date).minutes()
661
+ };
662
+ }
663
+ }
664
+ updatePlacement() {
665
+ this.right = false;
666
+ this.bottom = false;
667
+ if (this.xPosition === DATEPICKER_POSITION.AUTO && this.getHorizontalMenuDirection() === DATEPICKER_POSITION.LEFT) {
668
+ this.right = true;
669
+ }
670
+ if (this.yPosition === DATEPICKER_POSITION.AUTO && this.getVerticalMenuDirection() === DATEPICKER_POSITION.TOP) {
671
+ this.bottom = true;
672
+ }
673
+ if (this.xPosition === DATEPICKER_POSITION.RIGHT) {
674
+ this.right = true;
675
+ }
676
+ if (this.yPosition === DATEPICKER_POSITION.TOP) {
677
+ this.bottom = true;
678
+ }
679
+ }
680
+ getVerticalMenuDirection() {
681
+ const element = this._element.nativeElement;
682
+ const top = element.getBoundingClientRect().top;
683
+ const height = window.innerHeight;
684
+ if (top > (height / 2)) {
685
+ return DATEPICKER_POSITION.TOP;
686
+ }
687
+ else {
688
+ return DATEPICKER_POSITION.BOTTOM;
689
+ }
690
+ }
691
+ /**
692
+ * Used to get datepicker position
693
+ * @returns either "left" or "right"
694
+ */
695
+ getHorizontalMenuDirection() {
696
+ const element = this._element.nativeElement;
697
+ const left = element.getBoundingClientRect().left;
698
+ const width = window.innerWidth;
699
+ if (left > (width / 2)) {
700
+ return DATEPICKER_POSITION.LEFT;
701
+ }
702
+ else {
703
+ return DATEPICKER_POSITION.RIGHT;
704
+ }
705
+ }
706
+ togglePicker() {
707
+ if (this.disabled)
708
+ return;
709
+ this._dateToSet = this.date ? new Date(this.date) : null;
710
+ this.isPickerVisible = !this.isPickerVisible;
711
+ if (this.showDate) {
712
+ this.currentSlot = this._dateToSet || new Date();
713
+ this.updateDays();
714
+ }
715
+ if (this.showTime) {
716
+ this.selectedTime = {
717
+ Hr: moment(this.date).hours(),
718
+ Min: moment(this.date).minutes()
719
+ };
720
+ if (this.date) {
721
+ const formatted = moment(this.date).format('hh:mm A');
722
+ this.isPM = formatted.includes('PM');
723
+ this.hour = formatted.slice(0, 2);
724
+ this.min = formatted.slice(3, 5);
725
+ }
726
+ }
727
+ this.updatePlacement();
728
+ }
729
+ updateDays() {
730
+ if (!this.currentSlot) {
731
+ this.currentSlot = new Date();
732
+ }
733
+ this.daysTitle = moment(this.currentSlot).format("MMM yyyy");
734
+ this.dayRows = [];
735
+ let current = moment(this.currentSlot).startOf("month").startOf("week").add(1, "day");
736
+ let end = moment(this.currentSlot).endOf("month").endOf("week").add(1, "day");
737
+ const currentMonth = moment(this.currentSlot).month();
738
+ const date = moment(this._dateToSet);
739
+ while (current <= end) {
740
+ const row = { days: [] };
741
+ this.dayRows.push(row);
742
+ for (let idx = 0; idx < 7; idx++) {
743
+ let isSelected = false;
744
+ if (date) {
745
+ isSelected = current.date() == date.date() &&
746
+ date.month() == current.month();
747
+ }
748
+ let isOutside = currentMonth != current.month();
749
+ let isDisabled = false;
750
+ if (this.minDate && current.toDate() < this.minDate) {
751
+ isDisabled = true;
752
+ }
753
+ else if (this.maxDate && current.toDate() > this.maxDate) {
754
+ isDisabled = true;
755
+ }
756
+ let isHighlighted = false;
757
+ if (this.highlightDays && this.highlightDays.length) {
758
+ isHighlighted = this.highlightDays.indexOf(current.valueOf()) >= 0;
759
+ }
760
+ row.days.push({
761
+ date: current.toDate(),
762
+ lbl: moment(current).date().toString(),
763
+ isOutside: isOutside,
764
+ selected: isSelected,
765
+ isDisabled: isDisabled,
766
+ isHighlighted: isHighlighted
767
+ });
768
+ current = moment(current).add(1, "day");
769
+ }
770
+ }
771
+ }
772
+ nextMonth() {
773
+ this.currentSlot = moment(this.currentSlot).add(1, "month").toDate();
774
+ this.updateDays();
775
+ }
776
+ prevMonth() {
777
+ this.currentSlot = moment(this.currentSlot).subtract(1, "month").toDate();
778
+ this.updateDays();
779
+ }
780
+ nextYear() {
781
+ this.currentSlot = moment(this.currentSlot).add(1, "year").toDate();
782
+ this.updateDays();
783
+ }
784
+ prevYear() {
785
+ this.currentSlot = moment(this.currentSlot).subtract(1, "year").toDate();
786
+ this.updateDays();
787
+ }
788
+ nextYearGroup() {
789
+ this.years = this.years.map(year => year + 15);
790
+ }
791
+ prevYearGroup() {
792
+ this.years = this.years.map(year => year - 15);
793
+ }
794
+ selectDay(day) {
795
+ if (day.isDisabled) {
796
+ // day is disabled
797
+ return;
798
+ }
799
+ if (this.showTime) {
800
+ this._dateToSet = moment(day.date).hour(this.selectedTime.Hr).minute(this.selectedTime.Min).toDate();
801
+ }
802
+ else {
803
+ this._dateToSet = new Date(day.date);
804
+ if (this.autoConfirm) {
805
+ this.apply();
806
+ }
807
+ }
808
+ this.updateDays();
809
+ }
810
+ selectMonth(month) {
811
+ const newDate = new Date(this.currentSlot);
812
+ newDate.setMonth(month);
813
+ this.currentSlot = newDate;
814
+ this.updateDays();
815
+ this.monthPickerVisible = false;
816
+ }
817
+ selectYear(year) {
818
+ const newDate = new Date(this.currentSlot);
819
+ newDate.setFullYear(year);
820
+ this.currentSlot = newDate;
821
+ this.updateDays();
822
+ this.yearPickerVisible = false;
823
+ }
824
+ hideTimePicker() {
825
+ this.isPickerVisible = false;
826
+ }
827
+ timeChanged() {
828
+ let min = parseInt(this.min);
829
+ let hour = parseInt(this.hour);
830
+ if (isNaN(hour) || isNaN(min)) {
831
+ return;
832
+ }
833
+ hour = Math.min(hour, 12);
834
+ hour = Math.max(hour, 1);
835
+ min = Math.min(min, 59);
836
+ min = Math.max(min, 0);
837
+ const time = moment(`${hour} ${min} ${this.isPM ? "pm" : "am"}`, "h:m a");
838
+ this.selectedTime = {
839
+ Hr: time.hours(),
840
+ Min: time.minutes()
841
+ };
842
+ // added below condition because we can select the time without date, and it was showing invalid date in the input box
843
+ // second condition is required to disable apply button when date is not selected
844
+ if (this._dateToSet) {
845
+ this._dateToSet = moment(this._dateToSet).hour(this.selectedTime.Hr).minute(this.selectedTime.Min).toDate();
846
+ }
847
+ else if (!this.showDate) {
848
+ this._dateToSet = moment().hour(this.selectedTime.Hr).minute(this.selectedTime.Min).toDate();
849
+ }
850
+ // format
851
+ if (hour < 10) {
852
+ this.hour = `0${hour}`;
853
+ }
854
+ else {
855
+ this.hour = `${hour}`;
856
+ }
857
+ if (min < 10) {
858
+ this.min = `0${min}`;
859
+ }
860
+ else {
861
+ this.min = `${min}`;
862
+ }
863
+ }
864
+ formattedDate() {
865
+ if (!this.date) {
866
+ return "";
867
+ }
868
+ if (this.boxDesign && moment(this.date).isSame(moment(), "day")) {
869
+ return 'Today';
870
+ }
871
+ if (this.showDate && !this.showTime && !this.boxDesign) {
872
+ // Expanded formatting for date only picker
873
+ return moment(this.date).format("ddd, DD MMM YYYY");
874
+ }
875
+ return moment(this.date).format("MMM DD, YY");
876
+ }
877
+ formattedTime() {
878
+ if (!this.date) {
879
+ return "";
880
+ }
881
+ return moment(this.date).format("h:mm A");
882
+ }
883
+ toggleTime() {
884
+ this.isPM = !this.isPM;
885
+ this.timeChanged();
886
+ }
887
+ showMonthPicker() {
888
+ this.monthPickerVisible = true;
889
+ }
890
+ showYearPicker() {
891
+ this.yearPickerVisible = true;
892
+ this.years = [];
893
+ for (let i = this.currentSlot.getFullYear() - 7; i < this.currentSlot.getFullYear() + 8; i++) {
894
+ this.years.push(i);
895
+ }
896
+ }
897
+ hourUp() {
898
+ let hour = parseInt(this.hour);
899
+ if (isNaN(hour)) {
900
+ return;
901
+ }
902
+ hour++;
903
+ this.hour = hour.toString();
904
+ this.timeChanged();
905
+ }
906
+ hourDown() {
907
+ let hour = parseInt(this.hour);
908
+ if (isNaN(hour)) {
909
+ return;
910
+ }
911
+ hour--;
912
+ this.hour = hour.toString();
913
+ this.timeChanged();
914
+ }
915
+ minUp() {
916
+ let min = parseInt(this.min);
917
+ if (isNaN(min)) {
918
+ return;
919
+ }
920
+ min++;
921
+ this.min = min.toString();
922
+ this.timeChanged();
923
+ }
924
+ minDown() {
925
+ let min = parseInt(this.min);
926
+ if (isNaN(min)) {
927
+ return;
928
+ }
929
+ min--;
930
+ this.min = min.toString();
931
+ this.timeChanged();
932
+ }
933
+ apply() {
934
+ if (this._dateToSet) {
935
+ // If time selection has enabled and user keeps default time then triggering the timeChanged function
936
+ if (this.showTime && this.hour === defaultHours && this.min === defaultMinuts) {
937
+ this.timeChanged();
938
+ }
939
+ this.date = new Date(this._dateToSet);
940
+ }
941
+ this.dateChange.emit(this.date);
942
+ this.hideTimePicker();
943
+ }
944
+ cancel() {
945
+ this.hideTimePicker();
946
+ }
947
+ clear() {
948
+ this._dateToSet = null;
949
+ this.hour = defaultHours;
950
+ this.min = defaultMinuts;
951
+ this.date = null;
952
+ this.apply();
953
+ }
954
+ getIcon() {
955
+ // Change picker icon based on mode
956
+ switch (true) {
957
+ case this.showDate && this.showTime:
958
+ // Date + Time
959
+ return 'assets/ng-zenduit/icons/date.svg';
960
+ case this.showDate && !this.showTime:
961
+ // Date only
962
+ return 'assets/ng-zenduit/icons/calendar.svg';
963
+ case !this.showDate && this.showTime:
964
+ // Time only
965
+ return 'assets/ng-zenduit/icons/time.svg';
966
+ default:
967
+ return 'assets/ng-zenduit/icons/date.svg';
968
+ }
969
+ }
970
+ selectHintDate(date) {
971
+ if (!date) {
972
+ console.error('Invalid hint');
973
+ return;
974
+ }
975
+ this._dateToSet = new Date(date);
976
+ this.selectedTime = {
977
+ Hr: moment(date).hours(),
978
+ Min: moment(date).minutes()
979
+ };
980
+ if (this.autoConfirm) {
981
+ this.apply();
982
+ }
983
+ this.updateDays();
984
+ }
985
+ }
986
+ ZenduDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduDatepickerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
987
+ ZenduDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduDatepickerComponent, selector: "zen-datepicker", inputs: { date: "date", showTime: "showTime", showDate: "showDate", containerClass: "containerClass", minDate: "minDate", maxDate: "maxDate", boxDesign: "boxDesign", highlightDays: "highlightDays", autoConfirm: "autoConfirm", hint: "hint", highlightError: "highlightError", disabled: "disabled", readonly: "readonly", xPosition: "xPosition", yPosition: "yPosition" }, outputs: { dateChange: "dateChange" }, host: { listeners: { "window:mousedown": "outsideHandling($event)", "window:scroll": "scroll()" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"date-component\">\n <!-- Material design datepicker toggle -->\n <ng-container *ngIf=\"!boxDesign\">\n <button class=\"date-toggle\"\n [disabled]=\"disabled || readonly\"\n (click)=\"togglePicker()\"\n [ngClass]=\"{'active': isPickerVisible,'error': highlightError,'readonly': readonly}\">\n\n <div class=\"date-content\">\n <!-- date placeholder -->\n <div class=\"date-placeholder\"\n *ngIf=\"!date\">\n Select Date\n </div>\n\n <!-- Selected datetime -->\n <div *ngIf=\"date\">\n <span *ngIf=\"showDate\">{{formattedDate()}}</span>\n <span *ngIf=\"showTime\">&nbsp;{{formattedTime()}}</span>\n </div>\n </div>\n\n <!-- Datepicker icon, depends on picker type -->\n <zen-icon class=\"date-icon\"\n [src]=\"getIcon()\"\n [ngClass]=\"{'filled': date}\">\n </zen-icon>\n </button>\n </ng-container>\n\n <!-- Box design datepicker toggle -->\n <ng-container *ngIf=\"boxDesign\">\n <button class=\"date-toggle new-box-design\"\n [disabled]=\"disabled || readonly\"\n (click)=\"togglePicker()\"\n [ngClass]=\"{'active': isPickerVisible,'error': highlightError,'readonly': readonly}\">\n\n <!-- Datepicker icon, depends on picker type -->\n <zen-icon class=\"date-icon\"\n [src]=\"getIcon()\"\n [ngClass]=\"{'filled': date}\">\n </zen-icon>\n\n <div class=\"date-content new-box-design\">\n <!-- date placeholder -->\n <div class=\"date-placeholder\"\n *ngIf=\"!date\">\n Select Date\n </div>\n\n <!-- Selected datetime -->\n <div *ngIf=\"date\">\n <span *ngIf=\"showDate\">{{formattedDate()}}</span>\n <span *ngIf=\"showTime\">&nbsp;{{formattedTime()}}</span>\n </div>\n </div>\n </button>\n </ng-container>\n\n <!-- Datepicker popup -->\n <div *ngIf=\"isPickerVisible\"\n class=\"date-menu\"\n [ngClass]=\"{ 'right': right, 'bottom': bottom }\">\n <div class=\"date-modal\">\n <ng-container *ngIf=\"showDate\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevMonth()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showMonthPicker()\">{{daysTitle}}</span>\n <i (click)=\"nextMonth()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"days-container\">\n <div class=\"week-days\">\n <div *ngFor=\"let weekDay of weekDays\"\n class=\"week-day\">\n {{weekDay}}\n </div>\n </div>\n <div *ngFor=\"let row of dayRows\"\n class=\"day-row\">\n <div *ngFor=\"let day of row.days\"\n (click)=\"selectDay(day)\"\n class=\"day-item\"\n [class.ousideRange]=\"day.isOutside\"\n [class.selected]=\"day.selected\"\n [class.disabledDay]=\"day.isDisabled\">\n {{day.lbl}}\n <zen-icon *ngIf=\"day.isHighlighted\"\n class=\"highlight-icon\"\n src=\"assets/ng-zenduit/icons/play.svg\"></zen-icon>\n </div>\n </div>\n </div>\n </ng-container>\n\n <div *ngIf=\"showTime\"\n class=\"time-container\">\n\n <div class=\"time-lbl\">\n Select Time:\n </div>\n\n <div class=\"time-picker\">\n <div class=\"input-wrapper\">\n <zen-icon (click)=\"hourUp()\"\n src=\"assets/ng-zenduit/icons/arrow-up-small.svg\"></zen-icon>\n <input [(ngModel)]=\"hour\"\n (ngModelChange)=\"timeChanged()\" />\n <zen-icon (click)=\"hourDown()\"\n src=\"assets/ng-zenduit/icons/arrow-down-small.svg\"></zen-icon>\n </div>\n <label>:</label>\n <div class=\"input-wrapper\">\n <zen-icon (click)=\"minUp()\"\n src=\"assets/ng-zenduit/icons/arrow-up-small.svg\"></zen-icon>\n <input [(ngModel)]=\"min\"\n (ngModelChange)=\"timeChanged()\" />\n <zen-icon (click)=\"minDown()\"\n src=\"assets/ng-zenduit/icons/arrow-down-small.svg\"></zen-icon>\n </div>\n <div class=\"am-pm-picker\">\n <div class=\"main\"\n (click)=\"toggleTime()\">\n {{isPM ? 'PM' : 'AM'}}\n </div>\n <div class=\"sub\"\n (click)=\"toggleTime()\">\n {{isPM ? 'AM' : 'PM'}}\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"hint\"\n *ngIf=\"hint\">\n <div class=\"hint-description\">\n {{hint.description}}\n </div>\n <div class=\"hint-date\"\n (click)=\"selectHintDate(hint.date)\">\n {{hint.maskText}}\n </div>\n </div>\n\n <div class=\"footer\"\n *ngIf=\"!autoConfirm || showTime\">\n <button *ngIf=\"date\"\n (click)=\"clear()\"\n class=\"button-stroked\">\n Clear\n </button>\n <button *ngIf=\"!date\"\n (click)=\"cancel()\"\n class=\"button-stroked\">\n Cancel\n </button>\n <button [disabled]=\"!_dateToSet\"\n (click)=\"apply()\"\n class=\"button-flat\">\n Apply\n </button>\n </div>\n\n <ng-container *ngIf=\"monthPickerVisible\">\n <div class=\"month-picker\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevYear()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showYearPicker()\">{{ currentSlot | date: 'yyyy' }}</span>\n <i (click)=\"nextYear()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"months-container\">\n <div class=\"month-item\"\n *ngFor=\"let month of months; index as index\"\n (click)=\"selectMonth(index)\">\n {{ month }}\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"yearPickerVisible\">\n <div class=\"month-picker\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevYearGroup()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showYearPicker()\">{{ currentSlot | date: 'yyyy' }}</span>\n <i (click)=\"nextYearGroup()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"months-container\">\n <div class=\"month-item\"\n *ngFor=\"let year of years\"\n (click)=\"selectYear(year)\">\n {{ year }}\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"date-modal-extra-space\"></div>\n </div>\n</div>\n", styles: [".date-component{width:100%;position:relative}.date-component .date-toggle{display:flex;align-items:center;justify-content:space-between;position:relative;gap:9px;transition:.3s;width:100%;background:var(--color-white-primary, #ffffff);-webkit-appearance:none;appearance:none;outline:none;cursor:pointer;border:none;border-radius:0;border-bottom:1px solid var(--color-white-tint-4, #d6d6d8);padding:0 0 8px;font-size:14px;font-style:normal;font-weight:400;line-height:130%;color:var(--color-grey-primary, #4f4f4f)}.date-component .date-toggle.new-box-design{border:1px solid var(--color-white-tint-1, #f2f2f2);border-radius:2px;padding:6px 12px;gap:4px!important}.date-component .date-toggle:hover .date-placeholder{color:var(--color-grey-shade-2, #828282)}.date-component .date-toggle:hover .date-icon{background-color:var(--color-grey-shade-2, #828282)}.date-component .date-toggle:focus,.date-component .date-toggle.active{border-color:var(--color-blue-primary, #2188d9)}.date-component .date-toggle:focus .date-icon,.date-component .date-toggle.active .date-icon{background-color:var(--color-blue-primary, #2188d9)!important}.date-component .date-toggle[disabled]{cursor:not-allowed;border-color:var(--color-white-tint-3, #e0e0e0)}.date-component .date-toggle[disabled] .date-content{color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle[disabled] .date-icon{background-color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.readonly{cursor:default;border-color:var(--color-white-tint-3, #e0e0e0)}.date-component .date-toggle.readonly .date-content{color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.readonly .date-icon{background-color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.error{border-color:var(--color-error-primary, #dc3e33)}.date-component .date-toggle.error .date-icon{background-color:var(--color-error-primary, #dc3e33)!important}.date-component .date-toggle.error .date-content.new-box-design{color:var(--color-error-primary, #dc3e33)!important}.date-component .date-content{flex:1;font-size:16px;text-align:left;height:18px;min-width:30px;color:var(--color-grey-primary, #4f4f4f);white-space:nowrap;transition:.3s}.date-component .date-content .date-placeholder{transition:.3s;color:var(--color-white-tint-6, #bebebe)}.date-component .date-content.new-box-design{color:var(--color-grey-shade-2, #828282)}.date-component .date-icon{width:24px;height:24px;background-color:var(--color-white-tint-6, #bebebe);transition:.3s}.date-component .date-icon.filled{background-color:var(--color-grey-shade-2, #828282)}.date-component .date-menu{width:320px;background:transparent;position:absolute;z-index:10}.date-component .date-menu .date-modal{border-radius:8px;width:320px;overflow-y:auto;white-space:initial;background:#ffffff;box-shadow:0 2px 4px -1px #00000008,0 4px 5px #0000003d,0 1px 10px #0000001a}.date-component .date-menu .date-modal-extra-space{height:10px;margin:0 0 -10px;background:transparent}.date-component .date-menu .days-toolbar{display:flex;align-items:center;justify-content:space-between;padding:16px 34px}.date-component .date-menu .days-toolbar .material-icons{color:#333;font-size:20px;cursor:pointer;-webkit-user-select:none;user-select:none}.date-component .date-menu .days-toolbar .title{font-size:14px;font-weight:500;color:var(--color-grey-primary, #4f4f4f);cursor:pointer}.date-component .date-menu .days-container{border-bottom:1px solid #f2f2f2;padding:0 24px}.date-component .date-menu .days-container .week-days{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--color-grey-primary, #4f4f4f);font-weight:500;margin-bottom:8px;cursor:default}.date-component .date-menu .days-container .week-days .week-day{width:39px;text-align:center}.date-component .date-menu .days-container .day-row{display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:400;color:var(--color-grey-primary, #4f4f4f)}.date-component .date-menu .days-container .day-row .day-item{position:relative;width:39px;height:39px;display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:4px}.date-component .date-menu .days-container .day-row .day-item .highlight-icon{position:absolute;right:0;height:14px;width:14px;background-color:#5cbb3a}.date-component .date-menu .days-container .day-row .day-item:hover{background:var(--color-blue-tint-1, #f4f9fd);color:var(--color-blue-primary, #2188d9)}.date-component .date-menu .days-container .day-row .day-item.selected{background:var(--color-primary, #2188d9);color:#fff}.date-component .date-menu .days-container .day-row .day-item.selected .highlight-icon{background-color:#fff}.date-component .date-menu .days-container .day-row .day-item.ousideRange{color:#b8b9bc}.date-component .date-menu .days-container .day-row .day-item.disabledDay{color:#b8b9bc;cursor:not-allowed!important}.date-component .time-container{display:flex;padding:16px 24px;justify-content:space-between;border-bottom:1px solid #f2f2f2;align-items:center}.date-component .time-container .time-lbl{font-weight:500;font-size:14px;color:var(--color-grey-primary, #4f4f4f);white-space:nowrap}.date-component .time-container .time-picker{display:flex;align-items:center;gap:7px}.date-component .time-container .time-picker .input-wrapper{display:flex;flex-direction:column;align-items:center}.date-component .time-container .time-picker .input-wrapper zen-icon{background-color:var(--color-white-tint-4, #d6d6d8);width:16px;height:16px;cursor:pointer}.date-component .time-container .time-picker .input-wrapper input{width:30px;height:25px;text-align:center;border:1px solid var(--color-white-tint-1, #f2f2f2);font-weight:400;font-size:14px;color:var(--color-grey-primary, #4f4f4f);border-radius:2px}.date-component .time-container .time-picker .input-wrapper input:focus{outline:none;border-color:var(--color-blue-primary, #2188d9)}.date-component .time-container .time-picker .am-pm-picker{font-weight:400;font-size:14px;padding-top:18px;cursor:pointer}.date-component .time-container .time-picker .am-pm-picker .main{color:var(--color-grey-primary, #4f4f4f)}.date-component .time-container .time-picker .am-pm-picker .sub{color:var(--color-white-tint-4, #d6d6d8)}.date-component .hint{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:16px 24px;border-bottom:1px solid #ECECED;font-style:normal;font-weight:400;font-size:14px;line-height:130%;color:#4f4f4f}.date-component .hint .hint-date{cursor:pointer;text-decoration-line:underline}.date-component .footer{display:flex;justify-content:end;gap:16px;padding:16px 24px}.date-component .month-picker{position:absolute;inset:0;background:white}.date-component .month-picker .months-container{display:flex;flex-wrap:wrap;justify-content:space-between;padding:10px 20px}.date-component .month-picker .months-container .month-item{display:inline-flex;align-items:center;justify-content:center;height:50px;width:30%;cursor:pointer;color:var(--color-grey-shade-2, #828282);border-radius:4px}.date-component .month-picker .months-container .month-item:hover{color:#fff;background-color:var(--color-blue-primary, #2188d9)}.date-component .right{right:0}.date-component .bottom{bottom:42px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZenduIconComponent, selector: "zen-icon", inputs: ["src"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduDatepickerComponent, decorators: [{
989
+ type: Component,
990
+ args: [{ selector: 'zen-datepicker', template: "<div class=\"date-component\">\n <!-- Material design datepicker toggle -->\n <ng-container *ngIf=\"!boxDesign\">\n <button class=\"date-toggle\"\n [disabled]=\"disabled || readonly\"\n (click)=\"togglePicker()\"\n [ngClass]=\"{'active': isPickerVisible,'error': highlightError,'readonly': readonly}\">\n\n <div class=\"date-content\">\n <!-- date placeholder -->\n <div class=\"date-placeholder\"\n *ngIf=\"!date\">\n Select Date\n </div>\n\n <!-- Selected datetime -->\n <div *ngIf=\"date\">\n <span *ngIf=\"showDate\">{{formattedDate()}}</span>\n <span *ngIf=\"showTime\">&nbsp;{{formattedTime()}}</span>\n </div>\n </div>\n\n <!-- Datepicker icon, depends on picker type -->\n <zen-icon class=\"date-icon\"\n [src]=\"getIcon()\"\n [ngClass]=\"{'filled': date}\">\n </zen-icon>\n </button>\n </ng-container>\n\n <!-- Box design datepicker toggle -->\n <ng-container *ngIf=\"boxDesign\">\n <button class=\"date-toggle new-box-design\"\n [disabled]=\"disabled || readonly\"\n (click)=\"togglePicker()\"\n [ngClass]=\"{'active': isPickerVisible,'error': highlightError,'readonly': readonly}\">\n\n <!-- Datepicker icon, depends on picker type -->\n <zen-icon class=\"date-icon\"\n [src]=\"getIcon()\"\n [ngClass]=\"{'filled': date}\">\n </zen-icon>\n\n <div class=\"date-content new-box-design\">\n <!-- date placeholder -->\n <div class=\"date-placeholder\"\n *ngIf=\"!date\">\n Select Date\n </div>\n\n <!-- Selected datetime -->\n <div *ngIf=\"date\">\n <span *ngIf=\"showDate\">{{formattedDate()}}</span>\n <span *ngIf=\"showTime\">&nbsp;{{formattedTime()}}</span>\n </div>\n </div>\n </button>\n </ng-container>\n\n <!-- Datepicker popup -->\n <div *ngIf=\"isPickerVisible\"\n class=\"date-menu\"\n [ngClass]=\"{ 'right': right, 'bottom': bottom }\">\n <div class=\"date-modal\">\n <ng-container *ngIf=\"showDate\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevMonth()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showMonthPicker()\">{{daysTitle}}</span>\n <i (click)=\"nextMonth()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"days-container\">\n <div class=\"week-days\">\n <div *ngFor=\"let weekDay of weekDays\"\n class=\"week-day\">\n {{weekDay}}\n </div>\n </div>\n <div *ngFor=\"let row of dayRows\"\n class=\"day-row\">\n <div *ngFor=\"let day of row.days\"\n (click)=\"selectDay(day)\"\n class=\"day-item\"\n [class.ousideRange]=\"day.isOutside\"\n [class.selected]=\"day.selected\"\n [class.disabledDay]=\"day.isDisabled\">\n {{day.lbl}}\n <zen-icon *ngIf=\"day.isHighlighted\"\n class=\"highlight-icon\"\n src=\"assets/ng-zenduit/icons/play.svg\"></zen-icon>\n </div>\n </div>\n </div>\n </ng-container>\n\n <div *ngIf=\"showTime\"\n class=\"time-container\">\n\n <div class=\"time-lbl\">\n Select Time:\n </div>\n\n <div class=\"time-picker\">\n <div class=\"input-wrapper\">\n <zen-icon (click)=\"hourUp()\"\n src=\"assets/ng-zenduit/icons/arrow-up-small.svg\"></zen-icon>\n <input [(ngModel)]=\"hour\"\n (ngModelChange)=\"timeChanged()\" />\n <zen-icon (click)=\"hourDown()\"\n src=\"assets/ng-zenduit/icons/arrow-down-small.svg\"></zen-icon>\n </div>\n <label>:</label>\n <div class=\"input-wrapper\">\n <zen-icon (click)=\"minUp()\"\n src=\"assets/ng-zenduit/icons/arrow-up-small.svg\"></zen-icon>\n <input [(ngModel)]=\"min\"\n (ngModelChange)=\"timeChanged()\" />\n <zen-icon (click)=\"minDown()\"\n src=\"assets/ng-zenduit/icons/arrow-down-small.svg\"></zen-icon>\n </div>\n <div class=\"am-pm-picker\">\n <div class=\"main\"\n (click)=\"toggleTime()\">\n {{isPM ? 'PM' : 'AM'}}\n </div>\n <div class=\"sub\"\n (click)=\"toggleTime()\">\n {{isPM ? 'AM' : 'PM'}}\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"hint\"\n *ngIf=\"hint\">\n <div class=\"hint-description\">\n {{hint.description}}\n </div>\n <div class=\"hint-date\"\n (click)=\"selectHintDate(hint.date)\">\n {{hint.maskText}}\n </div>\n </div>\n\n <div class=\"footer\"\n *ngIf=\"!autoConfirm || showTime\">\n <button *ngIf=\"date\"\n (click)=\"clear()\"\n class=\"button-stroked\">\n Clear\n </button>\n <button *ngIf=\"!date\"\n (click)=\"cancel()\"\n class=\"button-stroked\">\n Cancel\n </button>\n <button [disabled]=\"!_dateToSet\"\n (click)=\"apply()\"\n class=\"button-flat\">\n Apply\n </button>\n </div>\n\n <ng-container *ngIf=\"monthPickerVisible\">\n <div class=\"month-picker\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevYear()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showYearPicker()\">{{ currentSlot | date: 'yyyy' }}</span>\n <i (click)=\"nextYear()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"months-container\">\n <div class=\"month-item\"\n *ngFor=\"let month of months; index as index\"\n (click)=\"selectMonth(index)\">\n {{ month }}\n </div>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"yearPickerVisible\">\n <div class=\"month-picker\">\n <div class=\"days-toolbar\">\n <i (click)=\"prevYearGroup()\"\n class=\"material-icons\">navigate_before</i>\n <span class=\"title\"\n (click)=\"showYearPicker()\">{{ currentSlot | date: 'yyyy' }}</span>\n <i (click)=\"nextYearGroup()\"\n class=\"material-icons\">navigate_next</i>\n </div>\n <div class=\"months-container\">\n <div class=\"month-item\"\n *ngFor=\"let year of years\"\n (click)=\"selectYear(year)\">\n {{ year }}\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"date-modal-extra-space\"></div>\n </div>\n</div>\n", styles: [".date-component{width:100%;position:relative}.date-component .date-toggle{display:flex;align-items:center;justify-content:space-between;position:relative;gap:9px;transition:.3s;width:100%;background:var(--color-white-primary, #ffffff);-webkit-appearance:none;appearance:none;outline:none;cursor:pointer;border:none;border-radius:0;border-bottom:1px solid var(--color-white-tint-4, #d6d6d8);padding:0 0 8px;font-size:14px;font-style:normal;font-weight:400;line-height:130%;color:var(--color-grey-primary, #4f4f4f)}.date-component .date-toggle.new-box-design{border:1px solid var(--color-white-tint-1, #f2f2f2);border-radius:2px;padding:6px 12px;gap:4px!important}.date-component .date-toggle:hover .date-placeholder{color:var(--color-grey-shade-2, #828282)}.date-component .date-toggle:hover .date-icon{background-color:var(--color-grey-shade-2, #828282)}.date-component .date-toggle:focus,.date-component .date-toggle.active{border-color:var(--color-blue-primary, #2188d9)}.date-component .date-toggle:focus .date-icon,.date-component .date-toggle.active .date-icon{background-color:var(--color-blue-primary, #2188d9)!important}.date-component .date-toggle[disabled]{cursor:not-allowed;border-color:var(--color-white-tint-3, #e0e0e0)}.date-component .date-toggle[disabled] .date-content{color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle[disabled] .date-icon{background-color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.readonly{cursor:default;border-color:var(--color-white-tint-3, #e0e0e0)}.date-component .date-toggle.readonly .date-content{color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.readonly .date-icon{background-color:var(--color-white-tint-3, #e0e0e0)!important}.date-component .date-toggle.error{border-color:var(--color-error-primary, #dc3e33)}.date-component .date-toggle.error .date-icon{background-color:var(--color-error-primary, #dc3e33)!important}.date-component .date-toggle.error .date-content.new-box-design{color:var(--color-error-primary, #dc3e33)!important}.date-component .date-content{flex:1;font-size:16px;text-align:left;height:18px;min-width:30px;color:var(--color-grey-primary, #4f4f4f);white-space:nowrap;transition:.3s}.date-component .date-content .date-placeholder{transition:.3s;color:var(--color-white-tint-6, #bebebe)}.date-component .date-content.new-box-design{color:var(--color-grey-shade-2, #828282)}.date-component .date-icon{width:24px;height:24px;background-color:var(--color-white-tint-6, #bebebe);transition:.3s}.date-component .date-icon.filled{background-color:var(--color-grey-shade-2, #828282)}.date-component .date-menu{width:320px;background:transparent;position:absolute;z-index:10}.date-component .date-menu .date-modal{border-radius:8px;width:320px;overflow-y:auto;white-space:initial;background:#ffffff;box-shadow:0 2px 4px -1px #00000008,0 4px 5px #0000003d,0 1px 10px #0000001a}.date-component .date-menu .date-modal-extra-space{height:10px;margin:0 0 -10px;background:transparent}.date-component .date-menu .days-toolbar{display:flex;align-items:center;justify-content:space-between;padding:16px 34px}.date-component .date-menu .days-toolbar .material-icons{color:#333;font-size:20px;cursor:pointer;-webkit-user-select:none;user-select:none}.date-component .date-menu .days-toolbar .title{font-size:14px;font-weight:500;color:var(--color-grey-primary, #4f4f4f);cursor:pointer}.date-component .date-menu .days-container{border-bottom:1px solid #f2f2f2;padding:0 24px}.date-component .date-menu .days-container .week-days{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--color-grey-primary, #4f4f4f);font-weight:500;margin-bottom:8px;cursor:default}.date-component .date-menu .days-container .week-days .week-day{width:39px;text-align:center}.date-component .date-menu .days-container .day-row{display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:400;color:var(--color-grey-primary, #4f4f4f)}.date-component .date-menu .days-container .day-row .day-item{position:relative;width:39px;height:39px;display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:4px}.date-component .date-menu .days-container .day-row .day-item .highlight-icon{position:absolute;right:0;height:14px;width:14px;background-color:#5cbb3a}.date-component .date-menu .days-container .day-row .day-item:hover{background:var(--color-blue-tint-1, #f4f9fd);color:var(--color-blue-primary, #2188d9)}.date-component .date-menu .days-container .day-row .day-item.selected{background:var(--color-primary, #2188d9);color:#fff}.date-component .date-menu .days-container .day-row .day-item.selected .highlight-icon{background-color:#fff}.date-component .date-menu .days-container .day-row .day-item.ousideRange{color:#b8b9bc}.date-component .date-menu .days-container .day-row .day-item.disabledDay{color:#b8b9bc;cursor:not-allowed!important}.date-component .time-container{display:flex;padding:16px 24px;justify-content:space-between;border-bottom:1px solid #f2f2f2;align-items:center}.date-component .time-container .time-lbl{font-weight:500;font-size:14px;color:var(--color-grey-primary, #4f4f4f);white-space:nowrap}.date-component .time-container .time-picker{display:flex;align-items:center;gap:7px}.date-component .time-container .time-picker .input-wrapper{display:flex;flex-direction:column;align-items:center}.date-component .time-container .time-picker .input-wrapper zen-icon{background-color:var(--color-white-tint-4, #d6d6d8);width:16px;height:16px;cursor:pointer}.date-component .time-container .time-picker .input-wrapper input{width:30px;height:25px;text-align:center;border:1px solid var(--color-white-tint-1, #f2f2f2);font-weight:400;font-size:14px;color:var(--color-grey-primary, #4f4f4f);border-radius:2px}.date-component .time-container .time-picker .input-wrapper input:focus{outline:none;border-color:var(--color-blue-primary, #2188d9)}.date-component .time-container .time-picker .am-pm-picker{font-weight:400;font-size:14px;padding-top:18px;cursor:pointer}.date-component .time-container .time-picker .am-pm-picker .main{color:var(--color-grey-primary, #4f4f4f)}.date-component .time-container .time-picker .am-pm-picker .sub{color:var(--color-white-tint-4, #d6d6d8)}.date-component .hint{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:16px 24px;border-bottom:1px solid #ECECED;font-style:normal;font-weight:400;font-size:14px;line-height:130%;color:#4f4f4f}.date-component .hint .hint-date{cursor:pointer;text-decoration-line:underline}.date-component .footer{display:flex;justify-content:end;gap:16px;padding:16px 24px}.date-component .month-picker{position:absolute;inset:0;background:white}.date-component .month-picker .months-container{display:flex;flex-wrap:wrap;justify-content:space-between;padding:10px 20px}.date-component .month-picker .months-container .month-item{display:inline-flex;align-items:center;justify-content:center;height:50px;width:30%;cursor:pointer;color:var(--color-grey-shade-2, #828282);border-radius:4px}.date-component .month-picker .months-container .month-item:hover{color:#fff;background-color:var(--color-blue-primary, #2188d9)}.date-component .right{right:0}.date-component .bottom{bottom:42px}\n"] }]
991
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { date: [{
992
+ type: Input
993
+ }], dateChange: [{
994
+ type: Output
995
+ }], showTime: [{
996
+ type: Input
997
+ }], showDate: [{
998
+ type: Input
999
+ }], containerClass: [{
1000
+ type: Input
1001
+ }], minDate: [{
1002
+ type: Input
1003
+ }], maxDate: [{
1004
+ type: Input
1005
+ }], boxDesign: [{
1006
+ type: Input
1007
+ }], highlightDays: [{
1008
+ type: Input
1009
+ }], autoConfirm: [{
1010
+ type: Input
1011
+ }], hint: [{
1012
+ type: Input
1013
+ }], highlightError: [{
1014
+ type: Input
1015
+ }], disabled: [{
1016
+ type: Input
1017
+ }], readonly: [{
1018
+ type: Input
1019
+ }], xPosition: [{
1020
+ type: Input
1021
+ }], yPosition: [{
1022
+ type: Input
1023
+ }], outsideHandling: [{
1024
+ type: HostListener,
1025
+ args: ['window:mousedown', ['$event']]
1026
+ }], scroll: [{
1027
+ type: HostListener,
1028
+ args: ['window:scroll', []]
1029
+ }] } });
1030
+
1031
+ class ZenduToggleSlideComponent {
1032
+ constructor() {
1033
+ this.enabledChange = new EventEmitter();
1034
+ }
1035
+ /**
1036
+ * Toggle state
1037
+ */
1038
+ toggle() {
1039
+ this.enabled = !this.enabled;
1040
+ this.enabledChange.emit(this.enabled);
1041
+ }
1042
+ }
1043
+ ZenduToggleSlideComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduToggleSlideComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1044
+ ZenduToggleSlideComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduToggleSlideComponent, selector: "zen-toggle-slide", inputs: { enabled: "enabled", disabled: "disabled" }, outputs: { enabledChange: "enabledChange" }, ngImport: i0, template: "<button class=\"toggle-slide-component\"\n (click)=\"toggle()\"\n [disabled]=\"disabled\"\n [class.active]=\"enabled\"\n [class.disabled]=\"disabled\">\n\n <div class=\"toggle-slider\"></div>\n <div class=\"toggle-btn\"></div>\n</button>\n", styles: [".toggle-slide-component{position:relative;padding:8px;background:none;border:none;cursor:pointer;outline:none}.toggle-slide-component .toggle-slider{width:25px;height:4px;background:#def0ff;border-radius:2px}.toggle-slide-component .toggle-btn{position:absolute;left:2px;top:3px;background:#ffffff;width:15px;height:15px;border-radius:8px;box-shadow:0 0 10px #bee1fd;transition:.4s}.toggle-slide-component:focus .toggle-slider,.toggle-slide-component:focus .toggle-btn{box-shadow:0 0 2px 2px #2188d94d}.toggle-slide-component:hover .toggle-slider{background:#d5ebfd}.toggle-slide-component.active .toggle-slider,.toggle-slide-component.active .toggle-btn{background:var(--color-primary, #2188d9)}.toggle-slide-component.active .toggle-btn{left:24px;background:var(--color-primary, #2188d9)}.toggle-slide-component.active:hover .toggle-slider,.toggle-slide-component.active:hover .toggle-btn{background-color:#0d74c5}.toggle-slide-component.disabled{cursor:not-allowed}.toggle-slide-component.disabled .toggle-slider,.toggle-slide-component.disabled .toggle-btn{background:#d0d0d2}\n"] });
1045
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduToggleSlideComponent, decorators: [{
1046
+ type: Component,
1047
+ args: [{ selector: 'zen-toggle-slide', template: "<button class=\"toggle-slide-component\"\n (click)=\"toggle()\"\n [disabled]=\"disabled\"\n [class.active]=\"enabled\"\n [class.disabled]=\"disabled\">\n\n <div class=\"toggle-slider\"></div>\n <div class=\"toggle-btn\"></div>\n</button>\n", styles: [".toggle-slide-component{position:relative;padding:8px;background:none;border:none;cursor:pointer;outline:none}.toggle-slide-component .toggle-slider{width:25px;height:4px;background:#def0ff;border-radius:2px}.toggle-slide-component .toggle-btn{position:absolute;left:2px;top:3px;background:#ffffff;width:15px;height:15px;border-radius:8px;box-shadow:0 0 10px #bee1fd;transition:.4s}.toggle-slide-component:focus .toggle-slider,.toggle-slide-component:focus .toggle-btn{box-shadow:0 0 2px 2px #2188d94d}.toggle-slide-component:hover .toggle-slider{background:#d5ebfd}.toggle-slide-component.active .toggle-slider,.toggle-slide-component.active .toggle-btn{background:var(--color-primary, #2188d9)}.toggle-slide-component.active .toggle-btn{left:24px;background:var(--color-primary, #2188d9)}.toggle-slide-component.active:hover .toggle-slider,.toggle-slide-component.active:hover .toggle-btn{background-color:#0d74c5}.toggle-slide-component.disabled{cursor:not-allowed}.toggle-slide-component.disabled .toggle-slider,.toggle-slide-component.disabled .toggle-btn{background:#d0d0d2}\n"] }]
1048
+ }], propDecorators: { enabled: [{
1049
+ type: Input
1050
+ }], enabledChange: [{
1051
+ type: Output
1052
+ }], disabled: [{
1053
+ type: Input
1054
+ }] } });
1055
+
1056
+ class ZenduRadioButtonComponent {
1057
+ constructor() {
1058
+ this.radioChange = new EventEmitter();
1059
+ this.disabled = false;
1060
+ }
1061
+ ngOnInit() {
1062
+ }
1063
+ ngOnChanges(changes) {
1064
+ if (changes["selected"]) {
1065
+ if (changes["selected"].currentValue) {
1066
+ this.selectedRadio = this.value;
1067
+ }
1068
+ else {
1069
+ this.selectedRadio = "";
1070
+ }
1071
+ }
1072
+ }
1073
+ emitChange(event) {
1074
+ if (this.disabled) {
1075
+ return;
1076
+ }
1077
+ this.radioChange.emit(event.target.value);
1078
+ }
1079
+ }
1080
+ ZenduRadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduRadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1081
+ ZenduRadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduRadioButtonComponent, selector: "zen-radio", inputs: { selected: "selected", label: "label", value: "value", name: "name", disabled: "disabled", imageUrl: "imageUrl" }, outputs: { radioChange: "radioChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"radio-component\"\n [ngClass]=\"{'disabled-radio': disabled}\">\n <input type=\"radio\"\n class=\"radio-input\"\n name=\"{{name}}\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n id=\"{{value}}\"\n [checked]=\"selectedRadio === value\"\n (change)=\"emitChange($event)\" />\n\n <label class=\"app-radio-button-label\"\n for=\"{{value}}\">\n <img class=\"radio-image\"\n [src]=\"imageUrl\"\n *ngIf=\"imageUrl\">\n {{label}}\n </label>\n</div>", styles: [".radio-component{display:flex;align-items:center;cursor:pointer;gap:8px;color:#828282;font-size:14px}.radio-component .radio-input{position:absolute;left:-9999px}.radio-component .radio-input+label{position:relative;padding:0 0 0 24px;cursor:pointer;display:flex;align-items:center;font-weight:400;width:100%}.radio-component .radio-input+label:before{content:\"\";background:#fff;border:1.6px solid #D6D6D8;height:16.67px;width:16.67px;border-radius:50%;position:absolute;left:0}.radio-component .radio-input+label:hover:before{border:1.6px solid #828282}.radio-component .radio-input+label:after{content:\"\";background:#2188D9;width:10px;height:10px;border-radius:50%;position:absolute;left:5px;opacity:0;transform:scale(2);transition:transform .3s linear,opacity .3s linear}.radio-component .radio-input:checked+label{color:#4f4f4f}.radio-component .radio-input:checked+label:before{border:1.6px solid #2188D9}.radio-component .radio-input:checked+label:hover:before{border:1.6px solid #16598D}.radio-component .radio-input:checked+label:after{opacity:1;transform:scale(1)}.radio-component .radio-input:checked+label:hover:after{background:#16598D}.radio-component .radio-image{margin-right:8px}.radio-component.disabled-radio .radio-input+label{cursor:not-allowed;color:#e0e0e0}.radio-component.disabled-radio .radio-input+label:before{border:1.6px solid #E0E0E0}.radio-component.disabled-radio .radio-input:checked+label:hover:before{border:1.6px solid #E0E0E0}.radio-component.disabled-radio .radio-input:checked+label:after{background:#E0E0E0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduRadioButtonComponent, decorators: [{
1083
+ type: Component,
1084
+ args: [{ selector: 'zen-radio', template: "<div class=\"radio-component\"\n [ngClass]=\"{'disabled-radio': disabled}\">\n <input type=\"radio\"\n class=\"radio-input\"\n name=\"{{name}}\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n id=\"{{value}}\"\n [checked]=\"selectedRadio === value\"\n (change)=\"emitChange($event)\" />\n\n <label class=\"app-radio-button-label\"\n for=\"{{value}}\">\n <img class=\"radio-image\"\n [src]=\"imageUrl\"\n *ngIf=\"imageUrl\">\n {{label}}\n </label>\n</div>", styles: [".radio-component{display:flex;align-items:center;cursor:pointer;gap:8px;color:#828282;font-size:14px}.radio-component .radio-input{position:absolute;left:-9999px}.radio-component .radio-input+label{position:relative;padding:0 0 0 24px;cursor:pointer;display:flex;align-items:center;font-weight:400;width:100%}.radio-component .radio-input+label:before{content:\"\";background:#fff;border:1.6px solid #D6D6D8;height:16.67px;width:16.67px;border-radius:50%;position:absolute;left:0}.radio-component .radio-input+label:hover:before{border:1.6px solid #828282}.radio-component .radio-input+label:after{content:\"\";background:#2188D9;width:10px;height:10px;border-radius:50%;position:absolute;left:5px;opacity:0;transform:scale(2);transition:transform .3s linear,opacity .3s linear}.radio-component .radio-input:checked+label{color:#4f4f4f}.radio-component .radio-input:checked+label:before{border:1.6px solid #2188D9}.radio-component .radio-input:checked+label:hover:before{border:1.6px solid #16598D}.radio-component .radio-input:checked+label:after{opacity:1;transform:scale(1)}.radio-component .radio-input:checked+label:hover:after{background:#16598D}.radio-component .radio-image{margin-right:8px}.radio-component.disabled-radio .radio-input+label{cursor:not-allowed;color:#e0e0e0}.radio-component.disabled-radio .radio-input+label:before{border:1.6px solid #E0E0E0}.radio-component.disabled-radio .radio-input:checked+label:hover:before{border:1.6px solid #E0E0E0}.radio-component.disabled-radio .radio-input:checked+label:after{background:#E0E0E0}\n"] }]
1085
+ }], ctorParameters: function () { return []; }, propDecorators: { selected: [{
1086
+ type: Input
1087
+ }], radioChange: [{
1088
+ type: Output
1089
+ }], label: [{
1090
+ type: Input
1091
+ }], value: [{
1092
+ type: Input
1093
+ }], name: [{
1094
+ type: Input
1095
+ }], disabled: [{
1096
+ type: Input
1097
+ }], imageUrl: [{
1098
+ type: Input
1099
+ }] } });
1100
+
1101
+ class ZenduFilterComponent {
1102
+ constructor() {
1103
+ this.config = { items: [] };
1104
+ this.position = 'right';
1105
+ this.resetBehavior = 'clear';
1106
+ this.filterChange = new EventEmitter();
1107
+ this.isVisible = false;
1108
+ this.isVisibleChange = new EventEmitter();
1109
+ this.customTrigger = false;
1110
+ this.searchText = '';
1111
+ this.isApplied = false;
1112
+ this.lastAppliedFilter = {};
1113
+ this.menuLeft = "0px";
1114
+ this.menuRight = "0px";
1115
+ this.menuTop = "0px";
1116
+ this.menuBottom = "0px";
1117
+ this.errorMessage = [];
1118
+ this.datepickerPosition = DATEPICKER_POSITION;
1119
+ }
1120
+ ngOnChanges(changes) {
1121
+ if (changes.config && changes.config.currentValue) {
1122
+ // init values
1123
+ for (const item of this.config.items) {
1124
+ if (item.type === 'multiselect') {
1125
+ item.dataSource = item.dataSource ? this.extractUniqueDataSource(item.dataSource) : [];
1126
+ }
1127
+ else if (item.type === 'dateRange' && !item.dateRange) {
1128
+ item.dateRange = { start: null, end: null };
1129
+ }
1130
+ else if (item.type === 'numberRange' && !item.numberRange) {
1131
+ item.numberRange = {};
1132
+ }
1133
+ if (typeof item.showTime !== 'boolean') {
1134
+ item.showTime = true;
1135
+ }
1136
+ }
1137
+ this.filterItems();
1138
+ this.resetedFilter = this.getFilterObject();
1139
+ this.filter = this.getFilterObject();
1140
+ this.lastAppliedFilter = Util.clone(this.filter);
1141
+ }
1142
+ if (changes.filter && changes.filter.currentValue) {
1143
+ this.lastAppliedFilter = Util.clone(changes.filter.currentValue);
1144
+ this.updateAppliedState();
1145
+ }
1146
+ if (changes.isVisible && changes.isVisible.currentValue) {
1147
+ this.updatePlacement();
1148
+ this.focusSearchBox();
1149
+ }
1150
+ }
1151
+ outsideHandling(event) {
1152
+ if (!this.isVisible) {
1153
+ return;
1154
+ }
1155
+ const target = event.target;
1156
+ if (!document.body.contains(target)) {
1157
+ // element not in the DOM
1158
+ return;
1159
+ }
1160
+ if (this._componentElement.nativeElement.contains(target)) {
1161
+ return;
1162
+ }
1163
+ // hide the menu for outside click
1164
+ this.hide();
1165
+ // restore values
1166
+ this.restorePreviousApplied();
1167
+ }
1168
+ windowSizeHandling() {
1169
+ if (!this.isVisible) {
1170
+ return;
1171
+ }
1172
+ this.updatePlacement();
1173
+ }
1174
+ windowScroll() {
1175
+ if (!this.isVisible) {
1176
+ return;
1177
+ }
1178
+ this.updatePlacement();
1179
+ }
1180
+ handleMouseScroll(event) {
1181
+ if (!this.isVisible) {
1182
+ return;
1183
+ }
1184
+ const target = event.target;
1185
+ if (!document.body.contains(target)) {
1186
+ return;
1187
+ }
1188
+ if (this._componentElement.nativeElement.contains(target) && !target.classList.contains('button-stroked')) {
1189
+ return;
1190
+ }
1191
+ this.hide();
1192
+ this.restorePreviousApplied();
1193
+ }
1194
+ onWindowKeyDown(event) {
1195
+ if (!this.isVisible) {
1196
+ return;
1197
+ }
1198
+ if (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'PageUp' || event.key === 'PageDown' || event.key === 'Home' || event.key === 'End') {
1199
+ const target = event.target;
1200
+ if (!document.body.contains(target)) {
1201
+ return;
1202
+ }
1203
+ if (this._componentElement.nativeElement.contains(target) && !target.classList.contains('button-stroked')) {
1204
+ return;
1205
+ }
1206
+ this.hide();
1207
+ this.restorePreviousApplied();
1208
+ }
1209
+ }
1210
+ focusSearchBox() {
1211
+ this.searchBox.doFocus();
1212
+ }
1213
+ isMenuIsVisible(item) {
1214
+ if (item.filteredDataSource && this.searchText) {
1215
+ if (!item.filteredDataSource.length) {
1216
+ return false;
1217
+ }
1218
+ }
1219
+ return true;
1220
+ }
1221
+ extractUniqueDataSource(array) {
1222
+ const items = array.filter(el => {
1223
+ return Boolean(typeof el.id === 'number' ? typeof el.id !== undefined : el.id &&
1224
+ typeof el.name === 'number' ? typeof el.name !== undefined : el.name);
1225
+ });
1226
+ return uniqBy(items, (el) => el.id);
1227
+ }
1228
+ onSelectAll(item) {
1229
+ item.dataSource.forEach(d => d.checked = item.isSelectedAll);
1230
+ }
1231
+ isItemActive(item) {
1232
+ if (item.type === 'multiselect') {
1233
+ const checkedItems = item.dataSource.filter(el => el.checked);
1234
+ item.isSelectedAll = checkedItems.length === item.dataSource.length;
1235
+ return checkedItems.length > 0;
1236
+ }
1237
+ else if (item.type === 'radio') {
1238
+ const selectedRadio = item.radioOptions.find(ro => ro.selected);
1239
+ return selectedRadio ? true : false;
1240
+ }
1241
+ else if (item.type === 'numberRange') {
1242
+ return Boolean(item.numberRange.from || item.numberRange.to);
1243
+ }
1244
+ else if (item.type === 'dateRange') {
1245
+ return Boolean(item.dateRange.start || item.dateRange.end);
1246
+ }
1247
+ else if (item.type === 'date') {
1248
+ return Boolean(item.date);
1249
+ }
1250
+ else {
1251
+ return false;
1252
+ }
1253
+ }
1254
+ searchTextChanged() {
1255
+ this.filterItems();
1256
+ }
1257
+ filterItems() {
1258
+ let filteredItemsCount = 0; // Initialize with 0
1259
+ for (const configItem of this.config.items) {
1260
+ if (configItem.type === 'multiselect') {
1261
+ configItem.filteredDataSource = configItem.dataSource.filter(el => {
1262
+ const preparedName = typeof el.name === 'number' ? el.name.toString() : el.name;
1263
+ return preparedName.toLowerCase().includes(this.searchText.toLowerCase());
1264
+ });
1265
+ filteredItemsCount += configItem.filteredDataSource.length; // Increment the count by the length of filteredDataSource
1266
+ }
1267
+ else if (configItem.type === 'dateRange') {
1268
+ if (this.searchText && !Boolean(configItem.dateRange.start || configItem.dateRange.end)) {
1269
+ configItem.filteredDataSource = [];
1270
+ }
1271
+ }
1272
+ else if (configItem.type === 'numberRange') {
1273
+ if (this.searchText && !Boolean(configItem.numberRange.from || configItem.numberRange.to)) {
1274
+ configItem.filteredDataSource = [];
1275
+ }
1276
+ }
1277
+ }
1278
+ this.showNoFilterResult = this.searchText && filteredItemsCount === 0;
1279
+ }
1280
+ resetFilters() {
1281
+ let selectAll = this.resetBehavior === "set_all";
1282
+ for (const item of this.config.items) {
1283
+ if (item.dataSource) {
1284
+ item.isSelectedAll = selectAll;
1285
+ for (const dsItem of item.dataSource) {
1286
+ dsItem.checked = selectAll;
1287
+ }
1288
+ }
1289
+ if (item.dateRange) {
1290
+ item.dateRange = { start: null, end: null };
1291
+ }
1292
+ if (item.numberRange) {
1293
+ item.numberRange = { from: null, to: null };
1294
+ }
1295
+ if (item.date) {
1296
+ item.date = new Date();
1297
+ }
1298
+ if (item.type === 'toggle') {
1299
+ item.enabled = false;
1300
+ }
1301
+ if (item.type === 'radio') {
1302
+ item.radioOptions.forEach(e => {
1303
+ if (e.id === item.selectedRadio) {
1304
+ e.selected = true;
1305
+ }
1306
+ else {
1307
+ e.selected = false;
1308
+ }
1309
+ });
1310
+ }
1311
+ }
1312
+ }
1313
+ restorePreviousApplied() {
1314
+ for (const item of this.config.items) {
1315
+ switch (item.type) {
1316
+ case 'multiselect':
1317
+ if (item.dataSource) {
1318
+ const selection = this.lastAppliedFilter[item.key];
1319
+ for (const dataItem of item.dataSource) {
1320
+ dataItem.checked = selection ? selection.includes(dataItem.id) : false;
1321
+ }
1322
+ }
1323
+ break;
1324
+ case 'dateRange':
1325
+ item.dateRange = this.lastAppliedFilter[item.key] || { start: null, end: null };
1326
+ break;
1327
+ case 'numberRange':
1328
+ item.numberRange = this.lastAppliedFilter[item.key] || {};
1329
+ break;
1330
+ case 'toggle':
1331
+ item.dateRange = this.lastAppliedFilter[item.key];
1332
+ break;
1333
+ case 'date':
1334
+ item.date = this.lastAppliedFilter[item.key];
1335
+ break;
1336
+ case 'radio':
1337
+ item.selectedRadio = this.lastAppliedFilter[item.key];
1338
+ break;
1339
+ }
1340
+ }
1341
+ }
1342
+ reset() {
1343
+ this.resetFilters();
1344
+ this.filter = this.getFilterObject();
1345
+ this.resetedFilter = this.getFilterObject();
1346
+ }
1347
+ apply() {
1348
+ this.filter = this.getFilterObject();
1349
+ let hasError = false;
1350
+ for (const iterator of this.config.items) {
1351
+ const itemFlag = this.onCheckValidity(iterator);
1352
+ if (!itemFlag) {
1353
+ hasError = true;
1354
+ }
1355
+ }
1356
+ if (hasError) {
1357
+ setTimeout(() => this.errorMessage = [], 5000);
1358
+ return;
1359
+ }
1360
+ else {
1361
+ this.errorMessage = [];
1362
+ }
1363
+ this.lastAppliedFilter = Util.clone(this.filter);
1364
+ this.filterChange.emit(this.filter);
1365
+ // update the apply state
1366
+ this.updateAppliedState();
1367
+ this.hide();
1368
+ }
1369
+ updateAppliedState() {
1370
+ this.isApplied = false;
1371
+ if (Object.keys(this.filter).length > 0) {
1372
+ if (this.resetedFilter) {
1373
+ // Filter was reset, so compare the reset filter object with the current filter
1374
+ // When user click on Reset and Then Apply, filter must unhighlighted
1375
+ if (JSON.stringify(this.resetedFilter) !== JSON.stringify(this.filter)) {
1376
+ this.isApplied = true;
1377
+ }
1378
+ }
1379
+ else {
1380
+ this.isApplied = true;
1381
+ }
1382
+ }
1383
+ }
1384
+ getFilterObject() {
1385
+ var _a, _b, _c;
1386
+ const filter = {};
1387
+ for (const item of this.config.items) {
1388
+ switch (item.type) {
1389
+ case 'multiselect':
1390
+ if (item.dataSource && item.dataSource.length) {
1391
+ const checkedIds = item.dataSource
1392
+ .filter(i => i.checked)
1393
+ .map(i => i.id);
1394
+ if (checkedIds.length) {
1395
+ filter[item.key] = checkedIds;
1396
+ }
1397
+ }
1398
+ break;
1399
+ case 'dateRange':
1400
+ if (item.dateRange &&
1401
+ item.dateRange.start &&
1402
+ item.dateRange.end) {
1403
+ filter[item.key] = item.dateRange;
1404
+ }
1405
+ break;
1406
+ case 'numberRange':
1407
+ if (item.numberRange &&
1408
+ typeof ((_a = item === null || item === void 0 ? void 0 : item.numberRange) === null || _a === void 0 ? void 0 : _a.from) === 'number' &&
1409
+ typeof ((_b = item === null || item === void 0 ? void 0 : item.numberRange) === null || _b === void 0 ? void 0 : _b.to) === 'number') {
1410
+ filter[item.key] = item.numberRange;
1411
+ }
1412
+ break;
1413
+ case 'toggle':
1414
+ filter[item.key] = item.enabled || false;
1415
+ break;
1416
+ case 'date':
1417
+ if (item.date) {
1418
+ filter[item.key] = item.date;
1419
+ }
1420
+ break;
1421
+ case 'radio':
1422
+ filter[item.key] = (_c = item.radioOptions.find(ro => ro.selected)) === null || _c === void 0 ? void 0 : _c.id;
1423
+ break;
1424
+ }
1425
+ }
1426
+ return filter;
1427
+ }
1428
+ hide() {
1429
+ this.isVisible = false;
1430
+ this.searchText = '';
1431
+ this.filterItems();
1432
+ this.isVisibleChange.emit(false);
1433
+ }
1434
+ radioChanged(value, item) {
1435
+ item.radioOptions.forEach(opt => opt.selected = opt.id === value);
1436
+ }
1437
+ toggle() {
1438
+ this.isVisible = !this.isVisible;
1439
+ this.updatePlacement();
1440
+ this.focusSearchBox();
1441
+ }
1442
+ onCheckValidity(item) {
1443
+ if (item.type === 'numberRange') {
1444
+ if (typeof item.numberRange.from === 'number' && typeof item.numberRange.to === 'number' && item.numberRange.from >= item.numberRange.to) {
1445
+ this.errorMessage.push(`Invalid Number range, Min number should be less than Max number.`);
1446
+ return false;
1447
+ }
1448
+ }
1449
+ if (item.type === 'dateRange') {
1450
+ if (item.dateRange.start && item.dateRange.end && new Date(item.dateRange.start) >= new Date(item.dateRange.end)) {
1451
+ this.errorMessage.push(`Invalid Date range, Start date should be less than End date.`);
1452
+ return false;
1453
+ }
1454
+ }
1455
+ return true;
1456
+ }
1457
+ updatePlacement() {
1458
+ const container = this._componentElement.nativeElement;
1459
+ const rect = container.getBoundingClientRect();
1460
+ const left = rect.left;
1461
+ const right = rect.right;
1462
+ const top = rect.top;
1463
+ const bottom = window.innerHeight - top;
1464
+ //Update left-right position
1465
+ if (this.position.includes("auto")) {
1466
+ const horizontalPosition = this.getHorizontalPosition();
1467
+ this.menuRight = horizontalPosition === "left" ? `${window.innerWidth - right}px` : "unset";
1468
+ this.menuLeft = horizontalPosition === "right" ? `${left}px` : "unset";
1469
+ }
1470
+ else if (this.position.includes("left")) {
1471
+ this.menuRight = `${window.innerWidth - right}px`;
1472
+ this.menuLeft = "unset";
1473
+ }
1474
+ else {
1475
+ this.menuLeft = `${left}px`;
1476
+ this.menuRight = "unset";
1477
+ }
1478
+ //Update top-bottom position
1479
+ if (this.position.includes("auto")) {
1480
+ const verticalPosition = this.getVerticalPosition();
1481
+ this.menuTop = verticalPosition === "bottom" ? `${top + 42}px` : "unset";
1482
+ this.menuBottom = verticalPosition === "top" ? `${bottom}px` : "unset";
1483
+ }
1484
+ else if (this.position.includes("top")) {
1485
+ this.menuTop = "unset";
1486
+ this.menuBottom = `${bottom + 10}px`;
1487
+ }
1488
+ else {
1489
+ this.menuTop = `${top + 55}px`;
1490
+ this.menuBottom = "unset";
1491
+ }
1492
+ }
1493
+ getVerticalPosition() {
1494
+ const top = this._componentElement.nativeElement.getBoundingClientRect().top;
1495
+ return top > window.innerHeight / 2 ? "top" : "bottom";
1496
+ }
1497
+ getHorizontalPosition() {
1498
+ const left = this._componentElement.nativeElement.getBoundingClientRect().left;
1499
+ return left > window.innerWidth / 2 ? "left" : "right";
1500
+ }
1501
+ }
1502
+ ZenduFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1503
+ ZenduFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduFilterComponent, selector: "zen-filter", inputs: { config: "config", filter: "filter", position: "position", resetBehavior: "resetBehavior", isVisible: "isVisible", customTrigger: "customTrigger", imageUrl: "imageUrl", label: "label" }, outputs: { filterChange: "filterChange", isVisibleChange: "isVisibleChange" }, host: { listeners: { "window:mousedown": "outsideHandling($event)", "window:resize": "windowSizeHandling($event)", "window:scroll": "windowScroll($event)", "window:wheel": "handleMouseScroll($event)", "window:keydown": "onWindowKeyDown($event)" } }, viewQueries: [{ propertyName: "searchBox", first: true, predicate: ["searchBox"], descendants: true }, { propertyName: "_componentElement", first: true, predicate: ["mainComponent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"filters-component\"\n\t #mainComponent\n\t click-out=\"isVisible && hide()\">\n\n\t<ng-container *ngIf=\"!customTrigger\">\n\t\t<button (click)=\"toggle()\"\n\t\t\t\tclass=\"button-stroked filter {{isApplied ? 'applied' : ''}}\">\n\t\t\t<zen-icon [src]=\"imageUrl\"\n\t\t\t\t\t *ngIf=\"imageUrl\"></zen-icon>\n\t\t\t<i class=\"filter-icon material-icons\"\n\t\t\t *ngIf=\"!imageUrl\">filter_list</i>\n\t\t\t<span *ngIf=\"label\">{{ label }}</span>\n\t\t</button>\n\t</ng-container>\n\n\t<ng-content *ngIf=\"customTrigger\"></ng-content>\n\n\t<div [hidden]=\"!isVisible\"\n\t\t class=\"action-menu menu-content\"\n\t\t [class.customTrigger]=\"customTrigger\"\n\t\t [ngStyle]=\"{ 'left': menuLeft, 'right': menuRight, 'top': menuTop, 'bottom': menuBottom }\">\n\t\t<div class=\"action-menu-header\">\n\t\t\t<zen-search-box [(text)]=\"searchText\"\n\t\t\t\t\t\t\t#searchBox\n\t\t\t\t\t\t\t(textChange)=\"searchTextChanged()\"></zen-search-box>\n\t\t</div>\n\n\t\t<div class=\"action-menu-body items-wrapper\">\n\t\t\t<ng-container *ngIf=\"errorMessage.length\">\n\t\t\t\t<li *ngFor=\"let item of errorMessage\" class=\"error-msg\">{{item}}</li>\n\t\t\t</ng-container>\n\t\t\t\n\t\t\t<div *ngFor=\"let item of config.items\">\n\t\t\t\t<div class=\"menu-item\"\n\t\t\t\t\t *ngIf=\"isMenuIsVisible(item)\">\n\n\t\t\t\t\t<!-- Divider between two filter -->\n\t\t\t\t\t<div *ngIf=\"item.type === 'divider'\">\n\t\t\t\t\t\t<p class=\"filter-divider\"></p>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Boolean toggle -->\n\t\t\t\t\t<div *ngIf=\"item.type === 'toggle'\"\n\t\t\t\t\t\t class=\"action-item toggle-row\">\n\t\t\t\t\t\t<div>{{item.title}}</div>\n\t\t\t\t\t\t<zen-toggle-slide [(enabled)]=\"item.enabled\"></zen-toggle-slide>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<button class=\"action-item expander-item\"\n\t\t\t\t\t\t\t*ngIf=\"item.type != 'toggle' && item.type != 'divider' && !item.disableCollapse\"\n\t\t\t\t\t\t\t(click)=\"item.expanded = !item.expanded\"\n\t\t\t\t\t\t\t[ngClass]=\"{'active': isItemActive(item), 'expanded': item.expanded}\">\n\t\t\t\t\t\t<i class=\"material-icons expand-icon\"\n\t\t\t\t\t\t [ngClass]=\"{'active': item.expanded}\">expand_more</i>\n\t\t\t\t\t\t{{item.title}}\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<ng-container *ngIf=\"item.expanded || item.disableCollapse\">\n\t\t\t\t\t\t<div [ngSwitch]=\"item.type\">\n\t\t\t\t\t\t\t<!-- Multiselect -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'multiselect'\">\n\t\t\t\t\t\t\t\t<div class=\"action-item-checkbox ds-item select-all\">\n\t\t\t\t\t\t\t\t\t<zen-checkbox *ngIf=\"item.dataSource.length === item.filteredDataSource.length\"\n\t\t\t\t\t\t\t\t\t\t\t\t [(checked)]=\"item.isSelectedAll\"\n\t\t\t\t\t\t\t\t\t\t\t\t [indeterminate]=\"isItemActive(item) && !item.isSelectedAll\"\n\t\t\t\t\t\t\t\t\t\t\t\t label=\"Select All\"\n\t\t\t\t\t\t\t\t\t\t\t\t (checkedChange)=\"onSelectAll(item)\">\n\t\t\t\t\t\t\t\t\t</zen-checkbox>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div *ngFor=\"let dsItem of item.filteredDataSource\"\n\t\t\t\t\t\t\t\t\t class=\"action-item-checkbox ds-item\">\n\t\t\t\t\t\t\t\t\t<zen-checkbox [(checked)]=\"dsItem.checked\"\n\t\t\t\t\t\t\t\t\t\t\t\t [imageUrl]=\"dsItem.imageUrl\"\n\t\t\t\t\t\t\t\t\t\t\t\t [label]=\"dsItem.name\"></zen-checkbox>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Date range picker -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'dateRange'\">\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">From:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.dateRange.start\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[yPosition]=\"item.config?.yPosition ?? datepickerPosition.AUTO\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">To:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.dateRange.end\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[yPosition]=\"item.config?.yPosition ?? datepickerPosition.AUTO\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Date picker -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'date'\">\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Date:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.date\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Number range -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'numberRange'\"\n\t\t\t\t\t\t\t\t class=\"filter-row number-range-row\">\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Min:</div>\n\t\t\t\t\t\t\t\t\t<input class=\"material-input\"\n\t\t\t\t\t\t\t\t\t\t [(ngModel)]=\"item.numberRange.from\"\n\t\t\t\t\t\t\t\t\t\t type=\"number\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Max:</div>\n\t\t\t\t\t\t\t\t\t<input class=\"material-input\"\n\t\t\t\t\t\t\t\t\t\t [(ngModel)]=\"item.numberRange.to\"\n\t\t\t\t\t\t\t\t\t\t type=\"number\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Radio -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'radio'\">\n\t\t\t\t\t\t\t\t<div *ngFor=\"let option of item.radioOptions\"\n\t\t\t\t\t\t\t\t\t class=\"action-item-radio ds-item\"\n\t\t\t\t\t\t\t\t\t [ngClass]=\"{'active': option.selected}\">\n\t\t\t\t\t\t\t\t\t<zen-radio [value]=\"option.id\"\n\t\t\t\t\t\t\t\t\t\t\t [label]=\"option.name\"\n\t\t\t\t\t\t\t\t\t\t\t [name]=\"item.key\"\n\t\t\t\t\t\t\t\t\t\t\t [imageUrl]=\"option.imageUrl\"\n\t\t\t\t\t\t\t\t\t\t\t [selected]=\"option.selected\"\n\t\t\t\t\t\t\t\t\t\t\t (radioChange)=\"radioChanged($event, item)\"\n\t\t\t\t\t\t\t\t\t\t\t [disabled]=\"option.disabled\"></zen-radio>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"showNoFilterResult\"\n\t\t\t\t class=\"no-item\">No Results Found..</span>\n\t\t</div>\n\n\t\t<div class=\"action-menu-footer\">\n\t\t\t<button (click)=\"reset()\"\n\t\t\t\t\tclass=\"button-stroked full-width\">\n\t\t\t\tReset\n\t\t\t</button>\n\t\t\t<button (click)=\"apply()\"\n\t\t\t\t\tclass=\"button-flat full-width\">\n\t\t\t\tApply\n\t\t\t</button>\n\t\t</div>\n\n\t</div>\n</div>", styles: [".filters-component{display:inline-block;position:relative}.filters-component .filter{color:#828282;position:relative;border-color:#ececed;padding:0 7px;height:38px}.filters-component .filter zen-icon{background:#828282}.filters-component .filter.applied{color:var(--color-primary, #2188d9);background:#f4f9fd;border:1px solid var(--color-primary, #2188d9)}.filters-component .filter.applied zen-icon{background:var(--color-primary, #2188d9)}.filters-component .filter .dot{background:var(--color-primary, #2188d9);width:4px;height:4px;position:absolute;border-radius:50%;left:42px;top:9px}.filters-component .menu-content{width:360px;white-space:initial;position:fixed}.filters-component .menu-content.customTrigger{top:30px}.filters-component .menu-content .items-wrapper{overflow-y:auto;max-height:calc(100vh - 407px);position:relative}.filters-component .menu-content .items-wrapper .expander-item{outline:none;border:none;display:flex;width:100%}.filters-component .menu-content .items-wrapper .action-item{color:#828282}.filters-component .menu-content .items-wrapper .action-item.expanded,.filters-component .menu-content .items-wrapper .action-item.active{background:#f4f9fd;color:#4f4f4f}.filters-component .menu-content .items-wrapper .expand-icon{transition:.3s}.filters-component .menu-content .items-wrapper .expand-icon.active{transform:rotate(180deg)}.filters-component .menu-content .items-wrapper .ds-item{padding-left:48px}.filters-component .menu-content .items-wrapper .no-item,.filters-component .menu-content .items-wrapper .error-msg{color:#dc3e33;display:flex;flex-direction:row;align-items:center;padding:10px 16px;font-weight:400;font-size:14px}.filters-component .menu-content .items-wrapper .select-all{font-weight:500}.filters-component .menu-content .items-wrapper .filter-row{padding:0 16px}.filters-component .menu-content .items-wrapper .filter-row:not(:last-of-type){margin-bottom:20px}.filters-component .menu-content .items-wrapper .filter-row .lbl{color:#60636c;font-size:14px;margin-bottom:8px}.filters-component .menu-content .items-wrapper .filter-row:focus-within .lbl{color:var(--color-primary, #2188d9)}.filters-component .menu-content .items-wrapper .number-range-row{display:flex;margin-left:32px;gap:16px;margin-bottom:10px}.filters-component .menu-content .items-wrapper .toggle-row{justify-content:space-between}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZenduCheckboxComponent, selector: "zen-checkbox", inputs: ["checked", "label", "disabled", "disableValueChange", "indeterminate", "imageUrl"], outputs: ["checkedChange"] }, { kind: "component", type: ZenduToggleSlideComponent, selector: "zen-toggle-slide", inputs: ["enabled", "disabled"], outputs: ["enabledChange"] }, { kind: "component", type: ZenduSearchBoxComponent, selector: "zen-search-box", inputs: ["text", "delay", "autoFocus", "placeholder"], outputs: ["textChange"] }, { kind: "component", type: ZenduDatepickerComponent, selector: "zen-datepicker", inputs: ["date", "showTime", "showDate", "containerClass", "minDate", "maxDate", "boxDesign", "highlightDays", "autoConfirm", "hint", "highlightError", "disabled", "readonly", "xPosition", "yPosition"], outputs: ["dateChange"] }, { kind: "component", type: ZenduRadioButtonComponent, selector: "zen-radio", inputs: ["selected", "label", "value", "name", "disabled", "imageUrl"], outputs: ["radioChange"] }, { kind: "component", type: ZenduIconComponent, selector: "zen-icon", inputs: ["src"] }] });
1504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduFilterComponent, decorators: [{
1505
+ type: Component,
1506
+ args: [{ selector: 'zen-filter', template: "<div class=\"filters-component\"\n\t #mainComponent\n\t click-out=\"isVisible && hide()\">\n\n\t<ng-container *ngIf=\"!customTrigger\">\n\t\t<button (click)=\"toggle()\"\n\t\t\t\tclass=\"button-stroked filter {{isApplied ? 'applied' : ''}}\">\n\t\t\t<zen-icon [src]=\"imageUrl\"\n\t\t\t\t\t *ngIf=\"imageUrl\"></zen-icon>\n\t\t\t<i class=\"filter-icon material-icons\"\n\t\t\t *ngIf=\"!imageUrl\">filter_list</i>\n\t\t\t<span *ngIf=\"label\">{{ label }}</span>\n\t\t</button>\n\t</ng-container>\n\n\t<ng-content *ngIf=\"customTrigger\"></ng-content>\n\n\t<div [hidden]=\"!isVisible\"\n\t\t class=\"action-menu menu-content\"\n\t\t [class.customTrigger]=\"customTrigger\"\n\t\t [ngStyle]=\"{ 'left': menuLeft, 'right': menuRight, 'top': menuTop, 'bottom': menuBottom }\">\n\t\t<div class=\"action-menu-header\">\n\t\t\t<zen-search-box [(text)]=\"searchText\"\n\t\t\t\t\t\t\t#searchBox\n\t\t\t\t\t\t\t(textChange)=\"searchTextChanged()\"></zen-search-box>\n\t\t</div>\n\n\t\t<div class=\"action-menu-body items-wrapper\">\n\t\t\t<ng-container *ngIf=\"errorMessage.length\">\n\t\t\t\t<li *ngFor=\"let item of errorMessage\" class=\"error-msg\">{{item}}</li>\n\t\t\t</ng-container>\n\t\t\t\n\t\t\t<div *ngFor=\"let item of config.items\">\n\t\t\t\t<div class=\"menu-item\"\n\t\t\t\t\t *ngIf=\"isMenuIsVisible(item)\">\n\n\t\t\t\t\t<!-- Divider between two filter -->\n\t\t\t\t\t<div *ngIf=\"item.type === 'divider'\">\n\t\t\t\t\t\t<p class=\"filter-divider\"></p>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Boolean toggle -->\n\t\t\t\t\t<div *ngIf=\"item.type === 'toggle'\"\n\t\t\t\t\t\t class=\"action-item toggle-row\">\n\t\t\t\t\t\t<div>{{item.title}}</div>\n\t\t\t\t\t\t<zen-toggle-slide [(enabled)]=\"item.enabled\"></zen-toggle-slide>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<button class=\"action-item expander-item\"\n\t\t\t\t\t\t\t*ngIf=\"item.type != 'toggle' && item.type != 'divider' && !item.disableCollapse\"\n\t\t\t\t\t\t\t(click)=\"item.expanded = !item.expanded\"\n\t\t\t\t\t\t\t[ngClass]=\"{'active': isItemActive(item), 'expanded': item.expanded}\">\n\t\t\t\t\t\t<i class=\"material-icons expand-icon\"\n\t\t\t\t\t\t [ngClass]=\"{'active': item.expanded}\">expand_more</i>\n\t\t\t\t\t\t{{item.title}}\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<ng-container *ngIf=\"item.expanded || item.disableCollapse\">\n\t\t\t\t\t\t<div [ngSwitch]=\"item.type\">\n\t\t\t\t\t\t\t<!-- Multiselect -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'multiselect'\">\n\t\t\t\t\t\t\t\t<div class=\"action-item-checkbox ds-item select-all\">\n\t\t\t\t\t\t\t\t\t<zen-checkbox *ngIf=\"item.dataSource.length === item.filteredDataSource.length\"\n\t\t\t\t\t\t\t\t\t\t\t\t [(checked)]=\"item.isSelectedAll\"\n\t\t\t\t\t\t\t\t\t\t\t\t [indeterminate]=\"isItemActive(item) && !item.isSelectedAll\"\n\t\t\t\t\t\t\t\t\t\t\t\t label=\"Select All\"\n\t\t\t\t\t\t\t\t\t\t\t\t (checkedChange)=\"onSelectAll(item)\">\n\t\t\t\t\t\t\t\t\t</zen-checkbox>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div *ngFor=\"let dsItem of item.filteredDataSource\"\n\t\t\t\t\t\t\t\t\t class=\"action-item-checkbox ds-item\">\n\t\t\t\t\t\t\t\t\t<zen-checkbox [(checked)]=\"dsItem.checked\"\n\t\t\t\t\t\t\t\t\t\t\t\t [imageUrl]=\"dsItem.imageUrl\"\n\t\t\t\t\t\t\t\t\t\t\t\t [label]=\"dsItem.name\"></zen-checkbox>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Date range picker -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'dateRange'\">\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">From:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.dateRange.start\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[yPosition]=\"item.config?.yPosition ?? datepickerPosition.AUTO\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">To:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.dateRange.end\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[yPosition]=\"item.config?.yPosition ?? datepickerPosition.AUTO\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Date picker -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'date'\">\n\t\t\t\t\t\t\t\t<div class=\"ds-item filter-row\">\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Date:</div>\n\t\t\t\t\t\t\t\t\t<zen-datepicker class=\"width-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[(date)]=\"item.date\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t[showTime]=\"item.showTime\">\n\t\t\t\t\t\t\t\t\t</zen-datepicker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Number range -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'numberRange'\"\n\t\t\t\t\t\t\t\t class=\"filter-row number-range-row\">\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Min:</div>\n\t\t\t\t\t\t\t\t\t<input class=\"material-input\"\n\t\t\t\t\t\t\t\t\t\t [(ngModel)]=\"item.numberRange.from\"\n\t\t\t\t\t\t\t\t\t\t type=\"number\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<div class=\"lbl\">Max:</div>\n\t\t\t\t\t\t\t\t\t<input class=\"material-input\"\n\t\t\t\t\t\t\t\t\t\t [(ngModel)]=\"item.numberRange.to\"\n\t\t\t\t\t\t\t\t\t\t type=\"number\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<!-- Radio -->\n\t\t\t\t\t\t\t<div *ngSwitchCase=\"'radio'\">\n\t\t\t\t\t\t\t\t<div *ngFor=\"let option of item.radioOptions\"\n\t\t\t\t\t\t\t\t\t class=\"action-item-radio ds-item\"\n\t\t\t\t\t\t\t\t\t [ngClass]=\"{'active': option.selected}\">\n\t\t\t\t\t\t\t\t\t<zen-radio [value]=\"option.id\"\n\t\t\t\t\t\t\t\t\t\t\t [label]=\"option.name\"\n\t\t\t\t\t\t\t\t\t\t\t [name]=\"item.key\"\n\t\t\t\t\t\t\t\t\t\t\t [imageUrl]=\"option.imageUrl\"\n\t\t\t\t\t\t\t\t\t\t\t [selected]=\"option.selected\"\n\t\t\t\t\t\t\t\t\t\t\t (radioChange)=\"radioChanged($event, item)\"\n\t\t\t\t\t\t\t\t\t\t\t [disabled]=\"option.disabled\"></zen-radio>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ng-container>\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"showNoFilterResult\"\n\t\t\t\t class=\"no-item\">No Results Found..</span>\n\t\t</div>\n\n\t\t<div class=\"action-menu-footer\">\n\t\t\t<button (click)=\"reset()\"\n\t\t\t\t\tclass=\"button-stroked full-width\">\n\t\t\t\tReset\n\t\t\t</button>\n\t\t\t<button (click)=\"apply()\"\n\t\t\t\t\tclass=\"button-flat full-width\">\n\t\t\t\tApply\n\t\t\t</button>\n\t\t</div>\n\n\t</div>\n</div>", styles: [".filters-component{display:inline-block;position:relative}.filters-component .filter{color:#828282;position:relative;border-color:#ececed;padding:0 7px;height:38px}.filters-component .filter zen-icon{background:#828282}.filters-component .filter.applied{color:var(--color-primary, #2188d9);background:#f4f9fd;border:1px solid var(--color-primary, #2188d9)}.filters-component .filter.applied zen-icon{background:var(--color-primary, #2188d9)}.filters-component .filter .dot{background:var(--color-primary, #2188d9);width:4px;height:4px;position:absolute;border-radius:50%;left:42px;top:9px}.filters-component .menu-content{width:360px;white-space:initial;position:fixed}.filters-component .menu-content.customTrigger{top:30px}.filters-component .menu-content .items-wrapper{overflow-y:auto;max-height:calc(100vh - 407px);position:relative}.filters-component .menu-content .items-wrapper .expander-item{outline:none;border:none;display:flex;width:100%}.filters-component .menu-content .items-wrapper .action-item{color:#828282}.filters-component .menu-content .items-wrapper .action-item.expanded,.filters-component .menu-content .items-wrapper .action-item.active{background:#f4f9fd;color:#4f4f4f}.filters-component .menu-content .items-wrapper .expand-icon{transition:.3s}.filters-component .menu-content .items-wrapper .expand-icon.active{transform:rotate(180deg)}.filters-component .menu-content .items-wrapper .ds-item{padding-left:48px}.filters-component .menu-content .items-wrapper .no-item,.filters-component .menu-content .items-wrapper .error-msg{color:#dc3e33;display:flex;flex-direction:row;align-items:center;padding:10px 16px;font-weight:400;font-size:14px}.filters-component .menu-content .items-wrapper .select-all{font-weight:500}.filters-component .menu-content .items-wrapper .filter-row{padding:0 16px}.filters-component .menu-content .items-wrapper .filter-row:not(:last-of-type){margin-bottom:20px}.filters-component .menu-content .items-wrapper .filter-row .lbl{color:#60636c;font-size:14px;margin-bottom:8px}.filters-component .menu-content .items-wrapper .filter-row:focus-within .lbl{color:var(--color-primary, #2188d9)}.filters-component .menu-content .items-wrapper .number-range-row{display:flex;margin-left:32px;gap:16px;margin-bottom:10px}.filters-component .menu-content .items-wrapper .toggle-row{justify-content:space-between}.hidden{display:none}\n"] }]
1507
+ }], ctorParameters: function () { return []; }, propDecorators: { config: [{
1508
+ type: Input
1509
+ }], filter: [{
1510
+ type: Input
1511
+ }], position: [{
1512
+ type: Input
1513
+ }], resetBehavior: [{
1514
+ type: Input
1515
+ }], filterChange: [{
1516
+ type: Output
1517
+ }], isVisible: [{
1518
+ type: Input
1519
+ }], isVisibleChange: [{
1520
+ type: Output
1521
+ }], customTrigger: [{
1522
+ type: Input
1523
+ }], imageUrl: [{
1524
+ type: Input
1525
+ }], label: [{
1526
+ type: Input
1527
+ }], searchBox: [{
1528
+ type: ViewChild,
1529
+ args: ['searchBox', { static: false }]
1530
+ }], _componentElement: [{
1531
+ type: ViewChild,
1532
+ args: ['mainComponent', { static: false }]
1533
+ }], outsideHandling: [{
1534
+ type: HostListener,
1535
+ args: ['window:mousedown', ['$event']]
1536
+ }], windowSizeHandling: [{
1537
+ type: HostListener,
1538
+ args: ['window:resize', ['$event']]
1539
+ }], windowScroll: [{
1540
+ type: HostListener,
1541
+ args: ['window:scroll', ['$event']]
1542
+ }], handleMouseScroll: [{
1543
+ type: HostListener,
1544
+ args: ['window:wheel', ['$event']]
1545
+ }], onWindowKeyDown: [{
1546
+ type: HostListener,
1547
+ args: ['window:keydown', ['$event']]
1548
+ }] } });
1549
+
1550
+ class ZenduSelectOptionDirective {
1551
+ constructor(template) {
1552
+ this.template = template;
1553
+ }
1554
+ }
1555
+ ZenduSelectOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectOptionDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1556
+ ZenduSelectOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSelectOptionDirective, selector: "[zen-select-option]", ngImport: i0 });
1557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectOptionDirective, decorators: [{
1558
+ type: Directive,
1559
+ args: [{
1560
+ selector: '[zen-select-option]'
1561
+ }]
1562
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
1563
+
1564
+ class ZenduSelectValueDirective {
1565
+ constructor(template) {
1566
+ this.template = template;
1567
+ }
1568
+ }
1569
+ ZenduSelectValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectValueDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
1570
+ ZenduSelectValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSelectValueDirective, selector: "[zen-select-value]", ngImport: i0 });
1571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectValueDirective, decorators: [{
1572
+ type: Directive,
1573
+ args: [{
1574
+ selector: '[zen-select-value]'
1575
+ }]
1576
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
1577
+
1578
+ class ZenduSelectComponent {
1579
+ constructor(_element) {
1580
+ this._element = _element;
1581
+ /**
1582
+ * callback to emit changes for parent component
1583
+ */
1584
+ this.selectModelChange = new EventEmitter();
1585
+ /**
1586
+ * List of options for select
1587
+ */
1588
+ this.options = [];
1589
+ /**
1590
+ * Property to set custom placeholder value
1591
+ */
1592
+ this.placeholder = 'Select Items';
1593
+ /**
1594
+ * Component property to disable component
1595
+ */
1596
+ this.disabled = false;
1597
+ /**
1598
+ * Show the custom icon for toggle
1599
+ */
1600
+ this.customIcon = "";
1601
+ /**
1602
+ * Color for custom icon
1603
+ */
1604
+ this.customIconColor = "";
1605
+ /**
1606
+ * Truncate text with "..." at the end
1607
+ */
1608
+ this.isTruncate = false;
1609
+ /**
1610
+ * Is dropdown expanded
1611
+ */
1612
+ this.isExpanded = false;
1613
+ this.searchText = '';
1614
+ this.labelText = '';
1615
+ this.isTopMenuDirection = false;
1616
+ }
1617
+ outsideHandling(event) {
1618
+ if (!document.body.contains(event.target)) {
1619
+ // element not in the DOM
1620
+ return;
1621
+ }
1622
+ if (this._element.nativeElement.contains(event.target)) {
1623
+ return;
1624
+ }
1625
+ // hide the menu for outside click
1626
+ this.hideDropDown();
1627
+ }
1628
+ scroll() {
1629
+ this.updatePlacement();
1630
+ }
1631
+ ngOnChanges(changeObj) {
1632
+ this.filterOptions();
1633
+ this.updateLabel();
1634
+ }
1635
+ isModelEmpty() {
1636
+ if (this.isMultiselect) {
1637
+ return !this.selectModel || !this.selectModel.length;
1638
+ }
1639
+ else {
1640
+ return typeof this.selectModel === 'undefined' || this.selectModel === null;
1641
+ }
1642
+ }
1643
+ handleOptionClick(option) {
1644
+ const optionValue = this.returnOption ? option : this.getId(option);
1645
+ if (this.isMultiselect) {
1646
+ this.toggleOption(optionValue);
1647
+ }
1648
+ else {
1649
+ this.singleSelect(optionValue);
1650
+ }
1651
+ this.emitChange();
1652
+ }
1653
+ // Logic for single select
1654
+ singleSelect(value) {
1655
+ this.selectModel = value;
1656
+ // Hide dropdown if single select
1657
+ this.hideDropDown();
1658
+ }
1659
+ toggleExpand() {
1660
+ this.isExpanded = !this.isExpanded;
1661
+ this.searchText = "";
1662
+ this.filterOptions();
1663
+ this.updatePlacement();
1664
+ }
1665
+ // Logic for multiselect
1666
+ toggleOption(value) {
1667
+ if (!Array.isArray(this.selectModel)) {
1668
+ this.selectModel = [];
1669
+ }
1670
+ const index = this.getElementIndex(value);
1671
+ if (index < 0) {
1672
+ this.selectModel.push(value);
1673
+ }
1674
+ else {
1675
+ this.selectModel.splice(index, 1);
1676
+ }
1677
+ this.updateLabel();
1678
+ }
1679
+ getElementIndex(value) {
1680
+ if (typeof value === 'object') {
1681
+ const valueId = this.getId(value);
1682
+ return this.selectModel.findIndex(el => this.getId(el) === valueId);
1683
+ }
1684
+ else {
1685
+ return this.selectModel.indexOf(value);
1686
+ }
1687
+ }
1688
+ toggleAll() {
1689
+ if (this.selectModel.length !== this.options.length) {
1690
+ this.selectModel = this.options.map(el => this.returnOption ? el : this.getId(el));
1691
+ }
1692
+ else {
1693
+ this.selectModel = [];
1694
+ }
1695
+ this.emitChange();
1696
+ }
1697
+ onSearchChange() {
1698
+ this.filterOptions();
1699
+ }
1700
+ filterOptions() {
1701
+ const options = this.options.slice(0);
1702
+ if (!this.searchText) {
1703
+ this.filteredOptions = options;
1704
+ return;
1705
+ }
1706
+ const regex = new RegExp(this.searchText, 'i');
1707
+ this.filteredOptions = options.filter(option => regex.test(this.getName(option)));
1708
+ }
1709
+ isSelected(option) {
1710
+ if (this.isModelEmpty()) {
1711
+ return false;
1712
+ }
1713
+ const optionId = this.getId(option);
1714
+ if (this.isMultiselect) {
1715
+ return this.selectModel.findIndex(el => this.getId(el) === optionId) >= 0;
1716
+ }
1717
+ else {
1718
+ return this.getId(this.selectModel) === optionId;
1719
+ }
1720
+ }
1721
+ updateLabel() {
1722
+ if (this.isModelEmpty()) {
1723
+ return;
1724
+ }
1725
+ if (this.isMultiselect) {
1726
+ const selectedCount = this.selectModel.length;
1727
+ if (selectedCount === 1) {
1728
+ this.labelText = this.getNameFromValue(this.selectModel[0]);
1729
+ }
1730
+ else {
1731
+ this.labelText = `${selectedCount} Selected`;
1732
+ }
1733
+ }
1734
+ else {
1735
+ this.labelText = this.getNameFromValue(this.selectModel);
1736
+ }
1737
+ }
1738
+ getNameFromValue(val) {
1739
+ if (this.returnOption) {
1740
+ return this.getName(val);
1741
+ }
1742
+ else {
1743
+ if (!this.options || !this.options.length) {
1744
+ return '';
1745
+ }
1746
+ return this.getName(this.options.find(el => this.getId(el) === val));
1747
+ }
1748
+ }
1749
+ getName(option) {
1750
+ if (typeof option === 'object') {
1751
+ if (this.displayProp) {
1752
+ return this.GetRecursiveProperty(option, this.displayProp);
1753
+ }
1754
+ else {
1755
+ console.error('App-Select: when using objects as model, a displayProp value is mandatory.');
1756
+ return "";
1757
+ }
1758
+ }
1759
+ else {
1760
+ return option;
1761
+ }
1762
+ }
1763
+ getId(option) {
1764
+ if (typeof option === 'object') {
1765
+ if (this.idProp) {
1766
+ return this.GetRecursiveProperty(option, this.idProp);
1767
+ }
1768
+ else {
1769
+ console.error('App-Select: when using objects as model, a idProp value is mandatory.');
1770
+ return "";
1771
+ }
1772
+ }
1773
+ else {
1774
+ return option;
1775
+ }
1776
+ }
1777
+ GetRecursiveProperty(object, path) {
1778
+ return path.split('.').reduce((obj, x) => {
1779
+ if (obj) {
1780
+ return obj[x];
1781
+ }
1782
+ else {
1783
+ return null;
1784
+ }
1785
+ }, object);
1786
+ }
1787
+ hideDropDown() {
1788
+ return __awaiter(this, void 0, void 0, function* () {
1789
+ this.isExpanded = false;
1790
+ });
1791
+ }
1792
+ emitChange() {
1793
+ // notify with timeout
1794
+ // allow output property "enabled" applied by parent first and then emit the onChange
1795
+ setTimeout(() => {
1796
+ this.selectModelChange.emit(this.selectModel);
1797
+ }, 1);
1798
+ }
1799
+ updatePlacement() {
1800
+ // update menu position base on scroll
1801
+ this.isTopMenuDirection = this.getMenuDirection() === "top";
1802
+ }
1803
+ getMenuDirection() {
1804
+ const element = this._element.nativeElement;
1805
+ const top = element.getBoundingClientRect().top;
1806
+ const height = window.innerHeight;
1807
+ if (top > (height / 2)) {
1808
+ return "top";
1809
+ }
1810
+ else {
1811
+ return "bottom";
1812
+ }
1813
+ }
1814
+ getMaxMenuHeight() {
1815
+ const containerElement = this.getContainerElement();
1816
+ if (!containerElement || !containerElement.clientHeight) {
1817
+ return "190px";
1818
+ }
1819
+ const parentHeight = containerElement.clientHeight;
1820
+ let height = Math.round((parentHeight / 2) - 25);
1821
+ height = Math.min(216, height);
1822
+ height = Math.max(96, height);
1823
+ return `${height}px`;
1824
+ }
1825
+ getContainerElement() {
1826
+ const component = this._element.nativeElement;
1827
+ const container = component.getElementsByClassName("app-select").item(0);
1828
+ return container.offsetParent;
1829
+ }
1830
+ }
1831
+ ZenduSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1832
+ ZenduSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSelectComponent, selector: "zen-select", inputs: { selectModel: "selectModel", options: "options", placeholder: "placeholder", displayProp: "displayProp", idProp: "idProp", hasSearch: "hasSearch", returnOption: "returnOption", isMultiselect: "isMultiselect", disabled: "disabled", customIcon: "customIcon", customIconColor: "customIconColor", isTruncate: "isTruncate" }, outputs: { selectModelChange: "selectModelChange" }, host: { listeners: { "window:mousedown": "outsideHandling($event)", "window:scroll": "scroll()" } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ZenduSelectOptionDirective, descendants: true }, { propertyName: "valueTemplate", first: true, predicate: ZenduSelectValueDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"app-select\">\n <button class=\"app-select-toggle\"\n [disabled]=\"disabled\"\n (click)=\"toggleExpand()\"\n [ngClass]=\"{'active': isExpanded}\">\n <div class=\"app-select-label\">\n <div class=\"placeholder\"\n *ngIf=\"isModelEmpty()\">\n <span>{{placeholder}}</span>\n </div>\n <div class=\"selected-item\"\n *ngIf=\"!isMultiselect && !isModelEmpty()\">\n <ng-template *ngIf=\"valueTemplate && selectModel[0]; else tplValueText\"\n [ngTemplateOutlet]=\"valueTemplate.template\"\n [ngTemplateOutletContext]=\"{ selectModel: selectModel, labelText: labelText }\"></ng-template>\n <ng-template #tplValueText>\n <span>{{ labelText }}</span>\n </ng-template>\n </div>\n <div class=\"selected-item\"\n *ngIf=\"isMultiselect && !isModelEmpty()\">\n <span>{{ labelText }}</span>\n </div>\n </div>\n <i *ngIf=\"!customIcon\"\n class=\"material-icons app-select-icon\">expand_more</i>\n <i *ngIf=\"customIcon\"\n class=\"material-icons-outlined custom-icon\"\n [style.color]=\"customIconColor\">{{customIcon}}</i>\n </button>\n\n <div class=\"action-menu-container\">\n <div class=\"action-menu app-select-dropdown-wrapper\"\n [ngClass]=\"{ 'show-top': isTopMenuDirection }\">\n <div class=\"app-select-dropdown\"\n *ngIf=\"isExpanded\">\n <div class=\"action-menu-header\"\n *ngIf=\"hasSearch\">\n <!--Search options-->\n <div class=\"search-wrapper\">\n <zen-search-box [(text)]=\"searchText\"\n (textChange)=\"onSearchChange()\"></zen-search-box>\n </div>\n </div>\n <div class=\"action-menu-body\">\n <!--No options found-->\n <div class=\"no-options-found\"\n *ngIf=\"!filteredOptions.length\">\n No matching options found\n </div>\n\n <!--Select All Option-->\n <div class=\"action-item-checkbox select-all\"\n *ngIf=\"isMultiselect && !searchText\"\n (click)=\"toggleAll()\">\n <zen-checkbox [checked]=\"selectModel.length === options.length\"\n [indeterminate]=\"selectModel.length !== options.length && selectModel.length\"\n [disableValueChange]=\"true\"\n [label]=\"'Select All'\"></zen-checkbox>\n </div>\n\n <!--Single select Options-->\n <ng-container *ngIf=\"!isMultiselect\">\n <a class=\"action-item\"\n *ngFor=\"let option of filteredOptions\"\n (click)=\"handleOptionClick(option)\"\n [ngClass]=\"{ 'active': isSelected(option) }\">\n <span *ngIf=\"!isMultiselect\"\n [class.action-item-truncate]=\"isTruncate\">\n <ng-template *ngIf=\"optionTemplate; else tplOptionText\"\n [ngTemplateOutlet]=\"optionTemplate.template\"\n [ngTemplateOutletContext]=\"{ option: option }\">\n </ng-template>\n <ng-template #tplOptionText>\n {{ getName(option) }}\n </ng-template>\n </span>\n </a>\n </ng-container>\n\n <!--Multiselect Options-->\n <ng-container *ngIf=\"isMultiselect\">\n <div class=\"action-item-checkbox\"\n *ngFor=\"let option of filteredOptions\"\n (click)=\"handleOptionClick(option)\">\n <zen-checkbox *ngIf=\"isMultiselect\"\n [checked]=\"isSelected(option)\"\n [label]=\"getName(option)\"\n [disableValueChange]=\"true\"></zen-checkbox>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: [".app-select{width:100%;position:relative}.app-select ::-webkit-scrollbar-thumb{background-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle{display:flex;align-items:center;justify-content:space-between;position:relative;transition:.3s;width:100%;background:#ffffff;-webkit-appearance:none;appearance:none;outline:none;cursor:pointer;border:none;border-radius:0;border-bottom:1px solid #d6d6d8;padding:0 0 8px;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333}.app-select .app-select-toggle .app-select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:14px;line-height:24px}.app-select .app-select-toggle .app-select-label .placeholder{color:#bebebe}.app-select .app-select-toggle .app-select-label .selected-item{color:#333}.app-select .app-select-toggle .custom-icon{color:#bebebe}.app-select .app-select-toggle .app-select-icon{color:#bebebe;transition:.3s}.app-select .app-select-toggle:focus{border-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle:focus .app-select-icon,.app-select .app-select-toggle:focus .custom-icon{color:var(--color-primary, #2188d9)!important}.app-select .app-select-toggle[readonly],.app-select .app-select-toggle[disabled]{cursor:not-allowed;color:#b8b9bc;border-color:#d0d0d2}.app-select .app-select-toggle.active{border-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle.active .custom-icon{color:var(--color-primary, #2188d9)!important}.app-select .app-select-toggle.active .app-select-icon{transform:rotate(180deg);color:var(--color-primary, #2188d9)}.app-select .action-menu-container{position:sticky;width:inherit;z-index:10}.app-select .app-select-dropdown-wrapper{top:115%;width:inherit}.app-select .app-select-dropdown-wrapper.show-top{top:unset;bottom:115%}.app-select .app-select-dropdown-wrapper .action-menu-body{max-height:200px;overflow:auto}.app-select .app-select-dropdown-wrapper .no-options-found{background:#ffffff;color:#b8b9bc;padding:8px 16px;text-decoration:none;font-style:normal;font-weight:400;font-size:16px;line-height:24px}.app-select .app-select-dropdown-wrapper .select-all{font-weight:500}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZenduCheckboxComponent, selector: "zen-checkbox", inputs: ["checked", "label", "disabled", "disableValueChange", "indeterminate", "imageUrl"], outputs: ["checkedChange"] }, { kind: "component", type: ZenduSearchBoxComponent, selector: "zen-search-box", inputs: ["text", "delay", "autoFocus", "placeholder"], outputs: ["textChange"] }] });
1833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSelectComponent, decorators: [{
1834
+ type: Component,
1835
+ args: [{ selector: 'zen-select', template: "<div class=\"app-select\">\n <button class=\"app-select-toggle\"\n [disabled]=\"disabled\"\n (click)=\"toggleExpand()\"\n [ngClass]=\"{'active': isExpanded}\">\n <div class=\"app-select-label\">\n <div class=\"placeholder\"\n *ngIf=\"isModelEmpty()\">\n <span>{{placeholder}}</span>\n </div>\n <div class=\"selected-item\"\n *ngIf=\"!isMultiselect && !isModelEmpty()\">\n <ng-template *ngIf=\"valueTemplate && selectModel[0]; else tplValueText\"\n [ngTemplateOutlet]=\"valueTemplate.template\"\n [ngTemplateOutletContext]=\"{ selectModel: selectModel, labelText: labelText }\"></ng-template>\n <ng-template #tplValueText>\n <span>{{ labelText }}</span>\n </ng-template>\n </div>\n <div class=\"selected-item\"\n *ngIf=\"isMultiselect && !isModelEmpty()\">\n <span>{{ labelText }}</span>\n </div>\n </div>\n <i *ngIf=\"!customIcon\"\n class=\"material-icons app-select-icon\">expand_more</i>\n <i *ngIf=\"customIcon\"\n class=\"material-icons-outlined custom-icon\"\n [style.color]=\"customIconColor\">{{customIcon}}</i>\n </button>\n\n <div class=\"action-menu-container\">\n <div class=\"action-menu app-select-dropdown-wrapper\"\n [ngClass]=\"{ 'show-top': isTopMenuDirection }\">\n <div class=\"app-select-dropdown\"\n *ngIf=\"isExpanded\">\n <div class=\"action-menu-header\"\n *ngIf=\"hasSearch\">\n <!--Search options-->\n <div class=\"search-wrapper\">\n <zen-search-box [(text)]=\"searchText\"\n (textChange)=\"onSearchChange()\"></zen-search-box>\n </div>\n </div>\n <div class=\"action-menu-body\">\n <!--No options found-->\n <div class=\"no-options-found\"\n *ngIf=\"!filteredOptions.length\">\n No matching options found\n </div>\n\n <!--Select All Option-->\n <div class=\"action-item-checkbox select-all\"\n *ngIf=\"isMultiselect && !searchText\"\n (click)=\"toggleAll()\">\n <zen-checkbox [checked]=\"selectModel.length === options.length\"\n [indeterminate]=\"selectModel.length !== options.length && selectModel.length\"\n [disableValueChange]=\"true\"\n [label]=\"'Select All'\"></zen-checkbox>\n </div>\n\n <!--Single select Options-->\n <ng-container *ngIf=\"!isMultiselect\">\n <a class=\"action-item\"\n *ngFor=\"let option of filteredOptions\"\n (click)=\"handleOptionClick(option)\"\n [ngClass]=\"{ 'active': isSelected(option) }\">\n <span *ngIf=\"!isMultiselect\"\n [class.action-item-truncate]=\"isTruncate\">\n <ng-template *ngIf=\"optionTemplate; else tplOptionText\"\n [ngTemplateOutlet]=\"optionTemplate.template\"\n [ngTemplateOutletContext]=\"{ option: option }\">\n </ng-template>\n <ng-template #tplOptionText>\n {{ getName(option) }}\n </ng-template>\n </span>\n </a>\n </ng-container>\n\n <!--Multiselect Options-->\n <ng-container *ngIf=\"isMultiselect\">\n <div class=\"action-item-checkbox\"\n *ngFor=\"let option of filteredOptions\"\n (click)=\"handleOptionClick(option)\">\n <zen-checkbox *ngIf=\"isMultiselect\"\n [checked]=\"isSelected(option)\"\n [label]=\"getName(option)\"\n [disableValueChange]=\"true\"></zen-checkbox>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: [".app-select{width:100%;position:relative}.app-select ::-webkit-scrollbar-thumb{background-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle{display:flex;align-items:center;justify-content:space-between;position:relative;transition:.3s;width:100%;background:#ffffff;-webkit-appearance:none;appearance:none;outline:none;cursor:pointer;border:none;border-radius:0;border-bottom:1px solid #d6d6d8;padding:0 0 8px;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333}.app-select .app-select-toggle .app-select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-weight:400;font-size:14px;line-height:24px}.app-select .app-select-toggle .app-select-label .placeholder{color:#bebebe}.app-select .app-select-toggle .app-select-label .selected-item{color:#333}.app-select .app-select-toggle .custom-icon{color:#bebebe}.app-select .app-select-toggle .app-select-icon{color:#bebebe;transition:.3s}.app-select .app-select-toggle:focus{border-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle:focus .app-select-icon,.app-select .app-select-toggle:focus .custom-icon{color:var(--color-primary, #2188d9)!important}.app-select .app-select-toggle[readonly],.app-select .app-select-toggle[disabled]{cursor:not-allowed;color:#b8b9bc;border-color:#d0d0d2}.app-select .app-select-toggle.active{border-color:var(--color-primary, #2188d9)}.app-select .app-select-toggle.active .custom-icon{color:var(--color-primary, #2188d9)!important}.app-select .app-select-toggle.active .app-select-icon{transform:rotate(180deg);color:var(--color-primary, #2188d9)}.app-select .action-menu-container{position:sticky;width:inherit;z-index:10}.app-select .app-select-dropdown-wrapper{top:115%;width:inherit}.app-select .app-select-dropdown-wrapper.show-top{top:unset;bottom:115%}.app-select .app-select-dropdown-wrapper .action-menu-body{max-height:200px;overflow:auto}.app-select .app-select-dropdown-wrapper .no-options-found{background:#ffffff;color:#b8b9bc;padding:8px 16px;text-decoration:none;font-style:normal;font-weight:400;font-size:16px;line-height:24px}.app-select .app-select-dropdown-wrapper .select-all{font-weight:500}\n"] }]
1836
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { selectModel: [{
1837
+ type: Input
1838
+ }], selectModelChange: [{
1839
+ type: Output
1840
+ }], options: [{
1841
+ type: Input
1842
+ }], placeholder: [{
1843
+ type: Input
1844
+ }], displayProp: [{
1845
+ type: Input
1846
+ }], idProp: [{
1847
+ type: Input
1848
+ }], hasSearch: [{
1849
+ type: Input
1850
+ }], returnOption: [{
1851
+ type: Input
1852
+ }], isMultiselect: [{
1853
+ type: Input
1854
+ }], disabled: [{
1855
+ type: Input
1856
+ }], customIcon: [{
1857
+ type: Input
1858
+ }], customIconColor: [{
1859
+ type: Input
1860
+ }], isTruncate: [{
1861
+ type: Input
1862
+ }], optionTemplate: [{
1863
+ type: ContentChild,
1864
+ args: [ZenduSelectOptionDirective]
1865
+ }], valueTemplate: [{
1866
+ type: ContentChild,
1867
+ args: [ZenduSelectValueDirective]
1868
+ }], outsideHandling: [{
1869
+ type: HostListener,
1870
+ args: ['window:mousedown', ['$event']]
1871
+ }], scroll: [{
1872
+ type: HostListener,
1873
+ args: ['window:scroll', []]
1874
+ }] } });
1875
+
1876
+ class ZenduPaginationBarComponent {
1877
+ constructor() {
1878
+ this.pageChange = new EventEmitter();
1879
+ this.perPageChange = new EventEmitter();
1880
+ this.pagesInGroup = 7;
1881
+ this.availablePagesSize = [10, 20, 30, 40, 50];
1882
+ this.page = 1;
1883
+ this.perPage = 10;
1884
+ }
1885
+ ngOnChanges(changes) {
1886
+ if (changes["count"]) {
1887
+ this.reCalculatePageCount();
1888
+ }
1889
+ }
1890
+ nextPage() {
1891
+ if (this.page + 1 > this.totalPages) {
1892
+ return;
1893
+ }
1894
+ this.page++;
1895
+ this.pageChange.emit(this.page);
1896
+ }
1897
+ prevPage() {
1898
+ if (this.page - 1 <= 0) {
1899
+ return;
1900
+ }
1901
+ this.page--;
1902
+ this.pageChange.emit(this.page);
1903
+ }
1904
+ updatePageSize() {
1905
+ this.reCalculatePageCount();
1906
+ this.page = 1;
1907
+ this.pageChange.emit(this.page);
1908
+ this.perPageChange.emit(this.perPage);
1909
+ }
1910
+ endRowSize() {
1911
+ const to = this.page * this.perPage;
1912
+ if (to <= this.count) {
1913
+ return to;
1914
+ }
1915
+ else {
1916
+ return this.count;
1917
+ }
1918
+ }
1919
+ reCalculatePageCount() {
1920
+ let pages = this.count / this.perPage;
1921
+ if (this.count % this.perPage !== 0) {
1922
+ pages++;
1923
+ }
1924
+ this.totalPages = pages;
1925
+ }
1926
+ }
1927
+ ZenduPaginationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduPaginationBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1928
+ ZenduPaginationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduPaginationBarComponent, selector: "zen-pagination-bar", inputs: { page: "page", perPage: "perPage", count: "count" }, outputs: { pageChange: "pageChange", perPageChange: "perPageChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"pagination-component\">\n <div class=\"select-dropdown\">\n <label>Rows per page:</label>\n <zen-select [(selectModel)]=\"perPage\"\n [options]=\"availablePagesSize\"\n (selectModelChange)=\"updatePageSize()\"></zen-select>\n </div>\n <div class=\"pages\">\n <button class=\"pagination-button\"\n [disabled]=\"page - 1 <= 0\"\n (click)=\"prevPage()\">\n <i class=\"material-icons\">keyboard_arrow_left</i>\n </button>\n <label>{{((page - 1) * perPage) + 1 }} - {{endRowSize()}} of {{count}}</label>\n <button class=\"pagination-button\"\n [disabled]=\"page + 1 > totalPages\"\n (click)=\"nextPage()\">\n <i class=\"material-icons\">keyboard_arrow_right</i>\n </button>\n </div>\n</div>\n", styles: [".pagination-component{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.pagination-component .select-dropdown{display:flex;flex-direction:row;align-items:center;gap:8px}.pagination-component .select-dropdown label{margin:0;font-style:normal;font-weight:400;font-size:12px;line-height:120%;color:#4f4f4f}.pagination-component .pages{display:flex;flex-direction:row;align-items:center;gap:8px}.pagination-component .pages label{margin:0;font-style:normal;font-weight:400;font-size:12px;line-height:16px;color:#828282}.pagination-component .pages .pagination-button{display:flex;flex-direction:row;align-items:center;height:16px;padding:0;box-sizing:border-box;white-space:nowrap;border:none;border-radius:50%;transition:.1s;cursor:pointer;color:#828282;background:#FFFFFF}.pagination-component .pages .pagination-button:hover{color:#4f4f4f;background:#F2F2F2}.pagination-component .pages .pagination-button:focus{outline:none;color:#2188d9;background:#F4F9FD}.pagination-component .pages .pagination-button:disabled{color:#e0e0e0;background:#FFFFFF;cursor:not-allowed}.pagination-component .pages .pagination-button .material-icons{font-size:16px;height:16px;width:16px}\n"], dependencies: [{ kind: "component", type: ZenduSelectComponent, selector: "zen-select", inputs: ["selectModel", "options", "placeholder", "displayProp", "idProp", "hasSearch", "returnOption", "isMultiselect", "disabled", "customIcon", "customIconColor", "isTruncate"], outputs: ["selectModelChange"] }] });
1929
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduPaginationBarComponent, decorators: [{
1930
+ type: Component,
1931
+ args: [{ selector: 'zen-pagination-bar', template: "<div class=\"pagination-component\">\n <div class=\"select-dropdown\">\n <label>Rows per page:</label>\n <zen-select [(selectModel)]=\"perPage\"\n [options]=\"availablePagesSize\"\n (selectModelChange)=\"updatePageSize()\"></zen-select>\n </div>\n <div class=\"pages\">\n <button class=\"pagination-button\"\n [disabled]=\"page - 1 <= 0\"\n (click)=\"prevPage()\">\n <i class=\"material-icons\">keyboard_arrow_left</i>\n </button>\n <label>{{((page - 1) * perPage) + 1 }} - {{endRowSize()}} of {{count}}</label>\n <button class=\"pagination-button\"\n [disabled]=\"page + 1 > totalPages\"\n (click)=\"nextPage()\">\n <i class=\"material-icons\">keyboard_arrow_right</i>\n </button>\n </div>\n</div>\n", styles: [".pagination-component{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.pagination-component .select-dropdown{display:flex;flex-direction:row;align-items:center;gap:8px}.pagination-component .select-dropdown label{margin:0;font-style:normal;font-weight:400;font-size:12px;line-height:120%;color:#4f4f4f}.pagination-component .pages{display:flex;flex-direction:row;align-items:center;gap:8px}.pagination-component .pages label{margin:0;font-style:normal;font-weight:400;font-size:12px;line-height:16px;color:#828282}.pagination-component .pages .pagination-button{display:flex;flex-direction:row;align-items:center;height:16px;padding:0;box-sizing:border-box;white-space:nowrap;border:none;border-radius:50%;transition:.1s;cursor:pointer;color:#828282;background:#FFFFFF}.pagination-component .pages .pagination-button:hover{color:#4f4f4f;background:#F2F2F2}.pagination-component .pages .pagination-button:focus{outline:none;color:#2188d9;background:#F4F9FD}.pagination-component .pages .pagination-button:disabled{color:#e0e0e0;background:#FFFFFF;cursor:not-allowed}.pagination-component .pages .pagination-button .material-icons{font-size:16px;height:16px;width:16px}\n"] }]
1932
+ }], ctorParameters: function () { return []; }, propDecorators: { page: [{
1933
+ type: Input
1934
+ }], perPage: [{
1935
+ type: Input
1936
+ }], count: [{
1937
+ type: Input
1938
+ }], pageChange: [{
1939
+ type: Output
1940
+ }], perPageChange: [{
1941
+ type: Output
1942
+ }] } });
1943
+
1944
+ class ZenduPhoneInputComponent {
1945
+ constructor() {
1946
+ this.maxLength = 12;
1947
+ this.phoneChange = new EventEmitter();
1948
+ this.validChange = new EventEmitter();
1949
+ this.disabled = false;
1950
+ this.phoneText = "";
1951
+ this.countryList = [
1952
+ {
1953
+ countryCode: "US",
1954
+ countryName: "America",
1955
+ countryCallingCode: "+1",
1956
+ flag: "https://storage.googleapis.com/zenduit-icons/Flags/USA.svg"
1957
+ },
1958
+ {
1959
+ countryCode: "CA",
1960
+ countryName: "Canada",
1961
+ countryCallingCode: "+1",
1962
+ flag: "https://storage.googleapis.com/zenduit-icons/Flags/Canada.svg"
1963
+ },
1964
+ {
1965
+ countryCode: "MX",
1966
+ countryName: "Mexico",
1967
+ countryCallingCode: "+52",
1968
+ flag: "https://storage.googleapis.com/zenduit-icons/Flags/Mexico.svg"
1969
+ }
1970
+ ];
1971
+ this.customCountry = {
1972
+ countryCode: "",
1973
+ countryName: "Custom",
1974
+ countryCallingCode: "",
1975
+ flag: "https://storage.googleapis.com/zenduit-icons/Flags/Custom.svg"
1976
+ };
1977
+ this.isExpanded = false;
1978
+ this.selectedCountry = this.countryList[1];
1979
+ }
1980
+ ngOnInit() {
1981
+ this.parseNumber();
1982
+ }
1983
+ ngOnChanges(changes) {
1984
+ if (changes["phone"] && (!this.selectedCountry || !this.selectedCountry.countryCode)) {
1985
+ this.parseNumber();
1986
+ }
1987
+ }
1988
+ parseNumber() {
1989
+ try {
1990
+ this.phoneText = this.phone;
1991
+ if (this.phone) {
1992
+ const countryFromList = this.countryList.find(country => this.phone.startsWith(country.countryCallingCode) || `+${this.phone}`.startsWith(country.countryCallingCode));
1993
+ if (countryFromList) {
1994
+ this.selectedCountry = countryFromList || this.customCountry;
1995
+ const phoneNumberUtil = PhoneNumberUtil.getInstance();
1996
+ const parsedPhone = phoneNumberUtil.parse(this.phone || "", 'US');
1997
+ setTimeout(() => {
1998
+ if (this.phoneText.startsWith('+')) {
1999
+ this.phoneText = this.phoneText.replace(`+${parsedPhone.getCountryCode()}`, "");
2000
+ }
2001
+ else if (this.phoneText.startsWith(parsedPhone.getCountryCode())) {
2002
+ this.phoneText = this.phoneText.replace(parsedPhone.getCountryCode(), "");
2003
+ }
2004
+ this.phoneChanged();
2005
+ });
2006
+ }
2007
+ else {
2008
+ this.selectedCountry = this.customCountry;
2009
+ }
2010
+ }
2011
+ else {
2012
+ this.selectedCountry = this.customCountry;
2013
+ }
2014
+ }
2015
+ catch (err) {
2016
+ console.warn(`Can't parse phone: ${this.phone}`, err);
2017
+ this.selectedCountry = this.customCountry;
2018
+ }
2019
+ }
2020
+ countryChanged(country) {
2021
+ this.isExpanded = false;
2022
+ this.selectedCountry = country;
2023
+ this.phoneChanged();
2024
+ }
2025
+ phoneChanged(input) {
2026
+ // allow + in custom country
2027
+ let custom = false;
2028
+ if (this.selectedCountry === this.customCountry && this.phoneText.includes('+')) {
2029
+ custom = true;
2030
+ }
2031
+ const phoneText = (this.phoneText || '').replace(/\D/g, '');
2032
+ this.phoneText = custom ? `+${phoneText}` : phoneText;
2033
+ if (input && input.value !== this.phoneText) {
2034
+ input.value = this.phoneText;
2035
+ }
2036
+ const fullNumber = `${this.selectedCountry.countryCallingCode}${this.phoneText}`;
2037
+ if (this.phone !== fullNumber) {
2038
+ this.phoneChange.emit(fullNumber);
2039
+ }
2040
+ const phoneNumberUtil = PhoneNumberUtil.getInstance();
2041
+ if (this.selectedCountry === this.customCountry) {
2042
+ this.validChange.emit(true);
2043
+ }
2044
+ else {
2045
+ try {
2046
+ this.validChange.emit(phoneNumberUtil.isValidNumber(phoneNumberUtil.parseAndKeepRawInput(fullNumber)));
2047
+ }
2048
+ catch (_a) {
2049
+ this.validChange.emit(false);
2050
+ }
2051
+ }
2052
+ }
2053
+ hideDropDown() {
2054
+ this.isExpanded = false;
2055
+ }
2056
+ toggle() {
2057
+ if (this.disabled) {
2058
+ return;
2059
+ }
2060
+ this.isExpanded = !this.isExpanded;
2061
+ }
2062
+ }
2063
+ ZenduPhoneInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduPhoneInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2064
+ ZenduPhoneInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduPhoneInputComponent, selector: "zen-phone-input", inputs: { phone: "phone", maxLength: "maxLength", disabled: "disabled" }, outputs: { phoneChange: "phoneChange", validChange: "validChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"phone-input-component\">\n <div class=\"material-input\">\n <a class=\"country-select\"\n (click)=\"toggle()\">\n <img class=\"country-flag\"\n [src]=\"selectedCountry.flag\">\n <i class=\"material-icons expand-icon\"\n [ngClass]=\"{'active': isExpanded}\">expand_more</i>\n <div class=\"code\">{{ selectedCountry.countryCallingCode }}</div>\n </a>\n <input class=\"phone-input\"\n type=\"text\"\n [(ngModel)]=\"phoneText\"\n (ngModelChange)=\"phoneChanged(input)\"\n (click)=\"isExpanded = false\"\n [disabled]=\"disabled\"\n country-code=\"selectedCountry.countryCode\"\n [maxlength]=\"maxLength\"\n #input>\n </div>\n\n <div class=\"action-menu country-dropdown-list\"\n *ngIf=\"isExpanded\">\n <div class=\"action-menu-body\">\n <!--Country's List-->\n <a class=\"action-item\"\n *ngFor=\"let country of countryList\"\n [ngClass]=\"{'active': selectedCountry.countryName === country.countryName}\"\n (click)=\"countryChanged(country)\">\n <img class=\"country-flag\"\n [src]=\"country.flag\">\n <div>{{ country.countryName }}</div>\n <div>{{ country.countryCallingCode }}</div>\n </a>\n\n <!--Custom Country-->\n <a class=\"action-item\"\n [ngClass]=\"{'active': selectedCountry.countryName === customCountry.countryName}\"\n (click)=\"countryChanged(customCountry)\">\n <img class=\"country-flag\"\n [src]=\"customCountry.flag\">\n <div>{{ customCountry.countryName }}</div>\n <div>{{ customCountry.countryCallingCode }}</div>\n </a>\n </div>\n </div>\n</div>\n", styles: [".phone-input-component{position:relative;width:100%}.phone-input-component .material-input,.phone-input-component .zen-input{display:flex;align-items:center;gap:8px}.phone-input-component .material-input .country-select,.phone-input-component .zen-input .country-select{display:flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;outline:none}.phone-input-component .material-input .country-select .expand-icon,.phone-input-component .zen-input .country-select .expand-icon{color:#60636c;transition:.3s}.phone-input-component .material-input .country-select .expand-icon.active,.phone-input-component .zen-input .country-select .expand-icon.active{color:#2188d9;transform:rotate(180deg)}.phone-input-component .material-input .country-select .code,.phone-input-component .zen-input .country-select .code{font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333}.phone-input-component .material-input .country-select:focus .expand-icon,.phone-input-component .zen-input .country-select:focus .expand-icon{color:#2188d9}.phone-input-component .material-input .phone-input,.phone-input-component .zen-input .phone-input{flex:1;border:none;outline:none;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333;background:transparent}.phone-input-component .country-dropdown-list{width:inherit;margin-top:8px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
2065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduPhoneInputComponent, decorators: [{
2066
+ type: Component,
2067
+ args: [{ selector: 'zen-phone-input', template: "<div class=\"phone-input-component\">\n <div class=\"material-input\">\n <a class=\"country-select\"\n (click)=\"toggle()\">\n <img class=\"country-flag\"\n [src]=\"selectedCountry.flag\">\n <i class=\"material-icons expand-icon\"\n [ngClass]=\"{'active': isExpanded}\">expand_more</i>\n <div class=\"code\">{{ selectedCountry.countryCallingCode }}</div>\n </a>\n <input class=\"phone-input\"\n type=\"text\"\n [(ngModel)]=\"phoneText\"\n (ngModelChange)=\"phoneChanged(input)\"\n (click)=\"isExpanded = false\"\n [disabled]=\"disabled\"\n country-code=\"selectedCountry.countryCode\"\n [maxlength]=\"maxLength\"\n #input>\n </div>\n\n <div class=\"action-menu country-dropdown-list\"\n *ngIf=\"isExpanded\">\n <div class=\"action-menu-body\">\n <!--Country's List-->\n <a class=\"action-item\"\n *ngFor=\"let country of countryList\"\n [ngClass]=\"{'active': selectedCountry.countryName === country.countryName}\"\n (click)=\"countryChanged(country)\">\n <img class=\"country-flag\"\n [src]=\"country.flag\">\n <div>{{ country.countryName }}</div>\n <div>{{ country.countryCallingCode }}</div>\n </a>\n\n <!--Custom Country-->\n <a class=\"action-item\"\n [ngClass]=\"{'active': selectedCountry.countryName === customCountry.countryName}\"\n (click)=\"countryChanged(customCountry)\">\n <img class=\"country-flag\"\n [src]=\"customCountry.flag\">\n <div>{{ customCountry.countryName }}</div>\n <div>{{ customCountry.countryCallingCode }}</div>\n </a>\n </div>\n </div>\n</div>\n", styles: [".phone-input-component{position:relative;width:100%}.phone-input-component .material-input,.phone-input-component .zen-input{display:flex;align-items:center;gap:8px}.phone-input-component .material-input .country-select,.phone-input-component .zen-input .country-select{display:flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;outline:none}.phone-input-component .material-input .country-select .expand-icon,.phone-input-component .zen-input .country-select .expand-icon{color:#60636c;transition:.3s}.phone-input-component .material-input .country-select .expand-icon.active,.phone-input-component .zen-input .country-select .expand-icon.active{color:#2188d9;transform:rotate(180deg)}.phone-input-component .material-input .country-select .code,.phone-input-component .zen-input .country-select .code{font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333}.phone-input-component .material-input .country-select:focus .expand-icon,.phone-input-component .zen-input .country-select:focus .expand-icon{color:#2188d9}.phone-input-component .material-input .phone-input,.phone-input-component .zen-input .phone-input{flex:1;border:none;outline:none;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#333;background:transparent}.phone-input-component .country-dropdown-list{width:inherit;margin-top:8px}\n"] }]
2068
+ }], ctorParameters: function () { return []; }, propDecorators: { phone: [{
2069
+ type: Input
2070
+ }], maxLength: [{
2071
+ type: Input
2072
+ }], phoneChange: [{
2073
+ type: Output
2074
+ }], validChange: [{
2075
+ type: Output
2076
+ }], disabled: [{
2077
+ type: Input
2078
+ }] } });
2079
+
2080
+ class ZenduSortHeaderComponent {
2081
+ constructor() {
2082
+ this.sortChange = new EventEmitter();
2083
+ }
2084
+ toggleSort() {
2085
+ switch (this.sort) {
2086
+ case 'asc':
2087
+ this.sort = 'desc';
2088
+ this.sortChange.emit(this.sort);
2089
+ break;
2090
+ case 'desc':
2091
+ this.sort = 'asc';
2092
+ this.sortChange.emit(this.sort);
2093
+ break;
2094
+ default:
2095
+ this.sort = 'asc';
2096
+ this.sortChange.emit(this.sort);
2097
+ }
2098
+ }
2099
+ }
2100
+ ZenduSortHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSortHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2101
+ ZenduSortHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSortHeaderComponent, selector: "zen-sort", inputs: { sort: "sort", active: "active" }, outputs: { sortChange: "sortChange" }, ngImport: i0, template: "<div class=\"sort-option\"\n (click)=\"toggleSort()\">\n <div>\n <i class=\"material-icons sort-icon\"\n [ngClass]=\"active && sort === 'asc' ? 'sort-icon-active' : ''\">\n keyboard_arrow_up\n </i>\n </div>\n <div>\n <i class=\"material-icons sort-icon\"\n [ngClass]=\"active && sort === 'desc' ? 'sort-icon-active' : ''\">\n keyboard_arrow_down\n </i>\n </div>\n</div>\n", styles: [".sort-option{display:flex;flex-direction:column;cursor:pointer;-webkit-user-select:none;user-select:none}.sort-option .sort-icon{display:flex;color:#cfe9fd;height:10px;align-items:center;font-weight:500;font-size:20px;transition:.3s}.sort-option .sort-icon-active{color:#2188d9}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSortHeaderComponent, decorators: [{
2103
+ type: Component,
2104
+ args: [{ selector: 'zen-sort', template: "<div class=\"sort-option\"\n (click)=\"toggleSort()\">\n <div>\n <i class=\"material-icons sort-icon\"\n [ngClass]=\"active && sort === 'asc' ? 'sort-icon-active' : ''\">\n keyboard_arrow_up\n </i>\n </div>\n <div>\n <i class=\"material-icons sort-icon\"\n [ngClass]=\"active && sort === 'desc' ? 'sort-icon-active' : ''\">\n keyboard_arrow_down\n </i>\n </div>\n</div>\n", styles: [".sort-option{display:flex;flex-direction:column;cursor:pointer;-webkit-user-select:none;user-select:none}.sort-option .sort-icon{display:flex;color:#cfe9fd;height:10px;align-items:center;font-weight:500;font-size:20px;transition:.3s}.sort-option .sort-icon-active{color:#2188d9}\n"] }]
2105
+ }], propDecorators: { sort: [{
2106
+ type: Input
2107
+ }], sortChange: [{
2108
+ type: Output
2109
+ }], active: [{
2110
+ type: Input
2111
+ }] } });
2112
+
2113
+ class ZenduToggleComponent {
2114
+ constructor() {
2115
+ this.enabledChange = new EventEmitter();
2116
+ this.onLabel = "On";
2117
+ this.offLabel = "Off";
2118
+ }
2119
+ /**
2120
+ * Toggle state
2121
+ */
2122
+ toggle() {
2123
+ this.enabled = !this.enabled;
2124
+ this.enabledChange.emit(this.enabled);
2125
+ }
2126
+ }
2127
+ ZenduToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2128
+ ZenduToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduToggleComponent, selector: "zen-toggle", inputs: { enabled: "enabled", onLabel: "onLabel", offLabel: "offLabel" }, outputs: { enabledChange: "enabledChange" }, ngImport: i0, template: "<div class=\"toggle-component\">\n <div class=\"toggle-component-content\"\n (click)=\"toggle()\">\n <div class=\"toggle-state toggle-state-left\"\n [ngClass]=\"enabled ? 'toggle-active' : ''\">\n {{onLabel}}\n </div>\n <div class=\"toggle-state toggle-state-right\"\n [ngClass]=\"enabled ? '' : 'toggle-active'\">\n {{offLabel}}\n </div>\n </div>\n</div>", styles: [".toggle-component{display:inline-block}.toggle-component .toggle-component-content{display:flex;flex-direction:row;align-items:center;justify-content:stretch;color:var(--color-grey-shade-2, #828282);cursor:pointer}.toggle-component .toggle-state{border:1px solid var(--color-grey-shade-2, #828282);padding:10px 16px;min-width:70px;text-align:center}.toggle-component .toggle-state-left{border-radius:4px 0 0 4px;border-right:1px solid var(--color-primary, #2188d9)}.toggle-component .toggle-state-right{border-radius:0 4px 4px 0;border-left:none}.toggle-component .toggle-active{background-color:var(--color-blue-tint-1, #f4f9fd);color:var(--color-primary, #2188d9);border-color:var(--color-primary, #2188d9)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduToggleComponent, decorators: [{
2130
+ type: Component,
2131
+ args: [{ selector: 'zen-toggle', template: "<div class=\"toggle-component\">\n <div class=\"toggle-component-content\"\n (click)=\"toggle()\">\n <div class=\"toggle-state toggle-state-left\"\n [ngClass]=\"enabled ? 'toggle-active' : ''\">\n {{onLabel}}\n </div>\n <div class=\"toggle-state toggle-state-right\"\n [ngClass]=\"enabled ? '' : 'toggle-active'\">\n {{offLabel}}\n </div>\n </div>\n</div>", styles: [".toggle-component{display:inline-block}.toggle-component .toggle-component-content{display:flex;flex-direction:row;align-items:center;justify-content:stretch;color:var(--color-grey-shade-2, #828282);cursor:pointer}.toggle-component .toggle-state{border:1px solid var(--color-grey-shade-2, #828282);padding:10px 16px;min-width:70px;text-align:center}.toggle-component .toggle-state-left{border-radius:4px 0 0 4px;border-right:1px solid var(--color-primary, #2188d9)}.toggle-component .toggle-state-right{border-radius:0 4px 4px 0;border-left:none}.toggle-component .toggle-active{background-color:var(--color-blue-tint-1, #f4f9fd);color:var(--color-primary, #2188d9);border-color:var(--color-primary, #2188d9)}\n"] }]
2132
+ }], propDecorators: { enabled: [{
2133
+ type: Input
2134
+ }], enabledChange: [{
2135
+ type: Output
2136
+ }], onLabel: [{
2137
+ type: Input
2138
+ }], offLabel: [{
2139
+ type: Input
2140
+ }] } });
2141
+
2142
+ class ZenduCardBlockComponent {
2143
+ }
2144
+ ZenduCardBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduCardBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2145
+ ZenduCardBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduCardBlockComponent, selector: "zen-card-block", inputs: { icon: "icon", title: "title", text: "text", selected: "selected" }, ngImport: i0, template: "<div class=\"component\">\n <zen-icon *ngIf=\"icon\"\n [src]=\"icon\"></zen-icon>\n\n <div class=\"title\">\n {{title}}\n </div>\n <div class=\"text\">\n {{text}}\n </div>\n</div>\n", styles: [".component{border-radius:10px;border:2px solid transparent;background:var(--color-white-primary, #ffffff);box-shadow:0 0 20px 2px #f0f0f0;padding:16px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;width:100%}.component:hover{border:2px solid var(--color-grey-shade-7, #121212)}.component zen-icon{width:50px;height:50px}.component .title{width:167px;text-align:center;font-family:Roboto;font-size:32px;font-style:normal;font-weight:500}.component .text{color:var(--color-white-tint-6, #bebebe);text-align:center;margin-top:22px;font-size:16px;font-style:normal;font-weight:400;line-height:130%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ZenduIconComponent, selector: "zen-icon", inputs: ["src"] }] });
2146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduCardBlockComponent, decorators: [{
2147
+ type: Component,
2148
+ args: [{ selector: 'zen-card-block', template: "<div class=\"component\">\n <zen-icon *ngIf=\"icon\"\n [src]=\"icon\"></zen-icon>\n\n <div class=\"title\">\n {{title}}\n </div>\n <div class=\"text\">\n {{text}}\n </div>\n</div>\n", styles: [".component{border-radius:10px;border:2px solid transparent;background:var(--color-white-primary, #ffffff);box-shadow:0 0 20px 2px #f0f0f0;padding:16px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;width:100%}.component:hover{border:2px solid var(--color-grey-shade-7, #121212)}.component zen-icon{width:50px;height:50px}.component .title{width:167px;text-align:center;font-family:Roboto;font-size:32px;font-style:normal;font-weight:500}.component .text{color:var(--color-white-tint-6, #bebebe);text-align:center;margin-top:22px;font-size:16px;font-style:normal;font-weight:400;line-height:130%}\n"] }]
2149
+ }], propDecorators: { icon: [{
2150
+ type: Input
2151
+ }], title: [{
2152
+ type: Input
2153
+ }], text: [{
2154
+ type: Input
2155
+ }], selected: [{
2156
+ type: Input
2157
+ }] } });
2158
+
2159
+ class ZenduMapPreviewComponent {
2160
+ constructor() {
2161
+ this.source = "";
2162
+ }
2163
+ ngOnChanges(changes) {
2164
+ if (this.apiKey && this.lat && this.lng) {
2165
+ this.source = `https://image.maps.ls.hereapi.com/mia/1.6/mapview?apiKey=${this.apiKey}&c=${this.lat},${this.lng}` +
2166
+ `&z=14&w=222&h=80&&base=reduced.night&incidents=off&traffic=off`;
2167
+ }
2168
+ else {
2169
+ this.source = "";
2170
+ }
2171
+ }
2172
+ }
2173
+ ZenduMapPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduMapPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2174
+ ZenduMapPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduMapPreviewComponent, selector: "zen-map-preview", inputs: { lat: "lat", lng: "lng", apiKey: "apiKey" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"component\"\n [ngStyle]=\"{ 'background-image': 'url('+source+')' }\">\n</div>\n", styles: [".component{width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduMapPreviewComponent, decorators: [{
2176
+ type: Component,
2177
+ args: [{ selector: 'zen-map-preview', template: "<div class=\"component\"\n [ngStyle]=\"{ 'background-image': 'url('+source+')' }\">\n</div>\n", styles: [".component{width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}\n"] }]
2178
+ }], propDecorators: { lat: [{
2179
+ type: Input
2180
+ }], lng: [{
2181
+ type: Input
2182
+ }], apiKey: [{
2183
+ type: Input
2184
+ }] } });
2185
+
2186
+ class ZenduSpinner {
2187
+ }
2188
+ ZenduSpinner.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
2189
+ ZenduSpinner.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduSpinner, selector: "zen-spinner", ngImport: i0, template: "<div class=\"component\">\n</div>\n", styles: [".component{width:64px;height:64px;border:6px solid var(--color-primary, #2188d9);border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation_spinner 1s linear infinite}@keyframes rotation_spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] });
2190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduSpinner, decorators: [{
2191
+ type: Component,
2192
+ args: [{ selector: 'zen-spinner', template: "<div class=\"component\">\n</div>\n", styles: [".component{width:64px;height:64px;border:6px solid var(--color-primary, #2188d9);border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation_spinner 1s linear infinite}@keyframes rotation_spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
2193
+ }] });
2194
+
2195
+ class LocalLock {
2196
+ constructor() {
2197
+ this._acquired = false;
2198
+ this._waitingResolvers = [];
2199
+ }
2200
+ lock() {
2201
+ return new Promise(resolve => {
2202
+ if (!this._acquired) {
2203
+ this._acquired = true;
2204
+ resolve();
2205
+ return;
2206
+ }
2207
+ this._waitingResolvers.push(resolve);
2208
+ });
2209
+ }
2210
+ release() {
2211
+ if (!this._acquired) {
2212
+ // Trying to release an unacquired lock
2213
+ return;
2214
+ }
2215
+ if (this._waitingResolvers.length > 0) {
2216
+ const resolve = this._waitingResolvers.shift();
2217
+ resolve();
2218
+ }
2219
+ else {
2220
+ this._acquired = false;
2221
+ }
2222
+ }
2223
+ isLock() {
2224
+ return this._acquired;
2225
+ }
2226
+ }
2227
+
2228
+ class OpenCVService {
2229
+ /**
2230
+ * extract paper from the image
2231
+ * @returns
2232
+ */
2233
+ extractPaper(options) {
2234
+ return __awaiter(this, void 0, void 0, function* () {
2235
+ // load open cv
2236
+ yield this.loadOpenCv();
2237
+ const htmlImage = yield this.loadImage(options.src);
2238
+ console.log("image is ready");
2239
+ const scanner = new window["jscanify"];
2240
+ return scanner.extractPaper(htmlImage, options.height, options.width, options.corners);
2241
+ });
2242
+ }
2243
+ /**
2244
+ * Get the paper corners from the specific image
2245
+ * @param src
2246
+ * @returns
2247
+ */
2248
+ getPaperCorners(src, height, width) {
2249
+ return __awaiter(this, void 0, void 0, function* () {
2250
+ // load opencv
2251
+ yield this.loadOpenCv();
2252
+ const cv = this.getCVInternal();
2253
+ const htmlImage = yield this.loadImage(src);
2254
+ console.log("image is ready", htmlImage);
2255
+ const scanner = new window["jscanify"];
2256
+ const img = cv.imread(htmlImage);
2257
+ const maxContour = scanner.findPaperContour(img);
2258
+ if (!maxContour) {
2259
+ return null;
2260
+ }
2261
+ const res = scanner.getCornerPoints(maxContour, img);
2262
+ return res;
2263
+ });
2264
+ }
2265
+ loadImage(src) {
2266
+ return new Promise((resolve) => {
2267
+ const image = new Image();
2268
+ image.src = src;
2269
+ image.onload = function () {
2270
+ resolve(image);
2271
+ };
2272
+ });
2273
+ }
2274
+ loadOpenCv() {
2275
+ return __awaiter(this, void 0, void 0, function* () {
2276
+ try {
2277
+ yield OpenCVService._lock.lock();
2278
+ if (OpenCVService._isOpenCVLoaded) {
2279
+ return;
2280
+ }
2281
+ console.log("load opencv...");
2282
+ // Storage bucket available here:
2283
+ // https://console.cloud.google.com/storage/browser/ng-zenduit/scripts?project=zendu-one
2284
+ // load open cv script
2285
+ this.loadScript("https://storage.googleapis.com/ng-zenduit/scripts/opencv_4.7.0.js");
2286
+ yield this.waitInitalization("cv");
2287
+ // load jscanify script
2288
+ this.loadScript("https://storage.googleapis.com/ng-zenduit/scripts/jscanify_1.2.0.js");
2289
+ yield this.waitInitalization("jscanify");
2290
+ console.log("OpenCV is ready");
2291
+ OpenCVService._isOpenCVLoaded = true;
2292
+ }
2293
+ finally {
2294
+ OpenCVService._lock.release();
2295
+ }
2296
+ });
2297
+ }
2298
+ loadScript(src) {
2299
+ const script = document.createElement('script');
2300
+ script.setAttribute('type', 'text/javascript');
2301
+ script.src = src;
2302
+ // insert script to document
2303
+ const node = document.getElementsByTagName('script')[0];
2304
+ if (node) {
2305
+ node.parentNode.insertBefore(script, node);
2306
+ }
2307
+ else {
2308
+ document.head.appendChild(script);
2309
+ }
2310
+ }
2311
+ waitInitalization(globalVarName) {
2312
+ return __awaiter(this, void 0, void 0, function* () {
2313
+ const timeout = Date.now() + 60000;
2314
+ // wait cv first
2315
+ while (true) {
2316
+ if (window[globalVarName]) {
2317
+ break;
2318
+ }
2319
+ yield Util.sleep(1000);
2320
+ if (Date.now() > timeout) {
2321
+ throw `Failed initalize OpenCV. Reason: timeout`;
2322
+ }
2323
+ }
2324
+ });
2325
+ }
2326
+ getCVInternal() {
2327
+ return window["cv"];
2328
+ }
2329
+ }
2330
+ OpenCVService._isOpenCVLoaded = false;
2331
+ OpenCVService._lock = new LocalLock();
2332
+ OpenCVService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpenCVService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2333
+ OpenCVService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpenCVService, providedIn: 'root' });
2334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpenCVService, decorators: [{
2335
+ type: Injectable,
2336
+ args: [{
2337
+ providedIn: 'root'
2338
+ }]
2339
+ }] });
2340
+
2341
+ class ZenduDocScanner {
2342
+ constructor(_opencv) {
2343
+ this._opencv = _opencv;
2344
+ this.src = '';
2345
+ this.width = 0;
2346
+ this.height = 0;
2347
+ this.isScanStart = false;
2348
+ this.canAddText = false;
2349
+ this.canDoodle = false;
2350
+ this.currentStateIndex = -1;
2351
+ this.canvasStates = [];
2352
+ this.isResize = false;
2353
+ this.isRedoing = false;
2354
+ this.isUndoing = false;
2355
+ this.extracted = new EventEmitter();
2356
+ this.cornersChanged = new EventEmitter();
2357
+ this.canAddTextOrDoole = new EventEmitter();
2358
+ this.canRedoOrUndo = new EventEmitter();
2359
+ this.screenPoints = [];
2360
+ this._scaleFactor = 1;
2361
+ this._controls = [];
2362
+ this.selectedColor = '#121212';
2363
+ this.isScaned = false;
2364
+ this.textAdded = false;
2365
+ this.icons = {
2366
+ cross: new Image(),
2367
+ rotate: new Image(),
2368
+ expand: new Image(),
2369
+ };
2370
+ this.Image = {
2371
+ height: 0,
2372
+ width: 0,
2373
+ };
2374
+ this.borderWidth = 5;
2375
+ this.colors = [
2376
+ { hexCode: '#FFFFFF', selected: false },
2377
+ { hexCode: '#121212', selected: false },
2378
+ { hexCode: '#2188D9', selected: false },
2379
+ { hexCode: '#DC3E33', selected: false },
2380
+ { hexCode: '#219653', selected: false },
2381
+ { hexCode: '#F1B10B', selected: false },
2382
+ { hexCode: '#00F0FF', selected: false },
2383
+ ];
2384
+ }
2385
+ set done(completed) {
2386
+ console.log('mark as completed', completed);
2387
+ if (completed) {
2388
+ this.completeScan(completed);
2389
+ }
2390
+ }
2391
+ ngAfterViewInit() {
2392
+ this.icons.cross.src = 'assets/ng-zenduit/icons/cross.svg';
2393
+ this.icons.rotate.src = 'assets/ng-zenduit/icons/rotate.svg';
2394
+ this.icons.expand.src = 'assets/ng-zenduit/icons/expand.svg';
2395
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
2396
+ yield this.init();
2397
+ // Add an event listener for canvas edits
2398
+ }), 1);
2399
+ }
2400
+ onCanvasEdit() {
2401
+ let objects = this._canvas.getObjects();
2402
+ if (objects && objects.length)
2403
+ this._canvas._activeObject = objects[objects.length - 1];
2404
+ if (!this.isScanStart && !this.isRedoing && !this.isUndoing) {
2405
+ this.canRedoOrUndo.emit({
2406
+ canUndo: this.currentStateIndex >= 0 ? true : false,
2407
+ canRedo: this.currentStateIndex < this.canvasStates.length - 1 ? true : false,
2408
+ });
2409
+ this.saveCanvasState();
2410
+ }
2411
+ }
2412
+ ngOnChanges(changes) {
2413
+ // When src changes
2414
+ if (changes['src'] && this._canvas) {
2415
+ this.build();
2416
+ }
2417
+ //When user start scan
2418
+ if (changes['isScanStart'] && changes['isScanStart'].currentValue) {
2419
+ if (this.src && this._canvas && this.isScanStart) {
2420
+ this.addPointsTodoc();
2421
+ this.canDoodle = false;
2422
+ this._canvas.isDrawingMode = false;
2423
+ this.isScaned = true;
2424
+ this._canvas.selection = false;
2425
+ this.textAdded = false;
2426
+ }
2427
+ }
2428
+ // When user wants to draw
2429
+ if (changes['canDoodle'] &&
2430
+ changes['canDoodle'].currentValue &&
2431
+ this._canvas) {
2432
+ if (this.canDoodle) {
2433
+ this._canvas.isDrawingMode = this.canDoodle;
2434
+ this._canvas.freeDrawingBrush = this.canDoodle
2435
+ ? new fabric.PencilBrush(this._canvas)
2436
+ : null;
2437
+ this._canvas.freeDrawingBrush.width = 10;
2438
+ this._canvas.freeDrawingBrush.color = this.selectedColor;
2439
+ this._canvas.selection = false;
2440
+ this.isScanStart = false;
2441
+ this.textAdded = false;
2442
+ this._canvas.renderAll();
2443
+ }
2444
+ }
2445
+ // When user wants to add text
2446
+ if (changes['canAddText'] &&
2447
+ changes['canAddText'].currentValue &&
2448
+ this.canAddText) {
2449
+ this.canDoodle = false;
2450
+ this._canvas.isDrawingMode = false;
2451
+ this.isScanStart = false;
2452
+ }
2453
+ if (changes['isUndoing'] && changes['isUndoing'].currentValue)
2454
+ this.undo();
2455
+ if (changes['isRedoing'] && changes['isRedoing'].currentValue)
2456
+ this.redo();
2457
+ }
2458
+ // To change the color of brush or text
2459
+ chngClrTextOrBrush(color, changeFor) {
2460
+ this.selectedColor = color;
2461
+ this.colors.map((clr, index) => {
2462
+ this.colors[index] = Object.assign(Object.assign({}, this.colors[index]), { selected: false });
2463
+ if (this.colors[index].hexCode === color) {
2464
+ this.colors[index] = Object.assign(Object.assign({}, this.colors[index]), { selected: true });
2465
+ }
2466
+ });
2467
+ if (changeFor === 'text') {
2468
+ const activeObject = this._canvas.getActiveObject();
2469
+ if (activeObject && activeObject.type === 'i-text') {
2470
+ // Check if an active text object is selected
2471
+ activeObject.set('fill', this.selectedColor); // Update the fill color
2472
+ this._canvas.renderAll(); // Render the canvas to see the changes
2473
+ }
2474
+ this._canvas.renderAll();
2475
+ // this.onCanvasEdit();
2476
+ }
2477
+ else {
2478
+ this._canvas.freeDrawingBrush.color = color;
2479
+ }
2480
+ this.selectedColor = color;
2481
+ }
2482
+ addPointsTodoc() {
2483
+ return __awaiter(this, void 0, void 0, function* () {
2484
+ const corners = yield this._opencv.getPaperCorners(this._canvas.toDataURL({
2485
+ format: 'jpeg',
2486
+ quality: 1,
2487
+ }), this.Image.height, this.Image.width);
2488
+ if (corners) {
2489
+ this.screenPoints = [
2490
+ corners.topLeftCorner,
2491
+ corners.topRightCorner,
2492
+ corners.bottomRightCorner,
2493
+ corners.bottomLeftCorner,
2494
+ ];
2495
+ }
2496
+ else {
2497
+ console.error(`can't detect document corners`);
2498
+ const width = this._canvas.getWidth() / this._scaleFactor;
2499
+ const height = this._canvas.getHeight() / this._scaleFactor;
2500
+ const offset = 20;
2501
+ this.screenPoints = [
2502
+ { x: offset, y: 0 },
2503
+ { x: width - offset, y: 0 },
2504
+ { x: width - offset, y: height - offset },
2505
+ { x: offset, y: height - offset },
2506
+ ];
2507
+ }
2508
+ // add polygon
2509
+ //
2510
+ this._cornersPg = new fabric.Polygon(this.screenPoints, {
2511
+ stroke: '#2188d9',
2512
+ strokeWidth: 10,
2513
+ selectable: false,
2514
+ fill: 'rgba(33, 136, 217, 0.1)',
2515
+ hasBorders: true,
2516
+ objectCaching: false,
2517
+ });
2518
+ this._canvas.add(this._cornersPg);
2519
+ this.createControls(this._cornersPg);
2520
+ });
2521
+ }
2522
+ init(src) {
2523
+ return __awaiter(this, void 0, void 0, function* () {
2524
+ // Create canvas with new changed src
2525
+ if (src) {
2526
+ this.createCanvas();
2527
+ }
2528
+ else {
2529
+ try {
2530
+ if (!this._canvasElement || !this._canvasElement.nativeElement) {
2531
+ // canvas is not ready
2532
+ return;
2533
+ }
2534
+ if (this._canvas) {
2535
+ // canvas already initalized
2536
+ return;
2537
+ }
2538
+ this.createCanvas();
2539
+ }
2540
+ catch (err) {
2541
+ console.error(err);
2542
+ }
2543
+ }
2544
+ });
2545
+ }
2546
+ createCanvas() {
2547
+ return __awaiter(this, void 0, void 0, function* () {
2548
+ // documentation: http://fabricjs.com/docs/fabric.Canvas.html
2549
+ let canvas = this._canvasElement.nativeElement;
2550
+ this._canvas = new fabric.Canvas(canvas, {
2551
+ backgroundColor: 'white',
2552
+ selection: false,
2553
+ });
2554
+ const { width, height } = this.getCanvasSize();
2555
+ this._canvas.setWidth(width);
2556
+ this._canvas.setHeight(height);
2557
+ this._canvas.on('object:added', this.onCanvasEdit.bind(this));
2558
+ this._canvas.on('object:modified', this.onCanvasEdit.bind(this));
2559
+ this._canvas.on('mouse:down', this.addTextOnClick.bind(this));
2560
+ this._canvas.on('mouse:move', this.resizeText.bind(this));
2561
+ this._canvas.on('mouse:up', this.stopResizeText.bind(this));
2562
+ if (this.src) {
2563
+ yield this.build();
2564
+ }
2565
+ });
2566
+ }
2567
+ renderIcon(ctx, left, top, styleOverride, fabricObject, iconName) {
2568
+ var size = 42;
2569
+ var iconBackgroundSize = 50; // Adjust the size as needed
2570
+ ctx.save();
2571
+ // Draw a background circle behind the icon
2572
+ ctx.fillStyle = 'white'; // Set the background color
2573
+ ctx.beginPath();
2574
+ ctx.arc(left, top - 10, iconBackgroundSize / 2, 0, 2 * Math.PI);
2575
+ ctx.fill();
2576
+ var img = this.icons[iconName];
2577
+ img.onload = function () { };
2578
+ ctx.translate(left, top - 10);
2579
+ ctx.rotate(fabric.util.degreesToRadians(fabricObject.angle));
2580
+ ctx.drawImage(img, -size / 2, -size / 2, size, size);
2581
+ ctx.restore();
2582
+ }
2583
+ stopResizeText(event) {
2584
+ if (this.isResize) {
2585
+ this.saveCanvasState();
2586
+ this.isResize = false;
2587
+ }
2588
+ }
2589
+ resizeText(event) {
2590
+ if (this.isResize) {
2591
+ const target = event.target;
2592
+ const deltaY = event.e.clientY - this.initialMouseY;
2593
+ // Limit the scaling factor to prevent excessive resizing
2594
+ const scalingFactor = Math.min(2, Math.max(0.5, 1 + deltaY / 100));
2595
+ // Calculate the new font size based on the original size and scaling factor
2596
+ const newFontSize = this.originalFontSize * scalingFactor;
2597
+ // Set the font size of the text object
2598
+ target.fontSize = newFontSize;
2599
+ // Re-render the canvas to see the live change
2600
+ event.target.canvas.renderAll();
2601
+ }
2602
+ }
2603
+ addTextOnClick(event) {
2604
+ let _text = new fabric.IText('Type your text here', {
2605
+ left: event.pointer.x,
2606
+ top: event.pointer.y,
2607
+ fill: this.selectedColor,
2608
+ fontSize: 50,
2609
+ fontFamily: 'Roboto',
2610
+ selectable: true,
2611
+ fontWeight: 400,
2612
+ borderScaleFactor: 3,
2613
+ borderColor: 'white',
2614
+ backgroundColor: 'transparent',
2615
+ cornerColor: 'white',
2616
+ padding: 42,
2617
+ width: 200, // Set the initial width of the text box
2618
+ });
2619
+ //Custom controls for add text box
2620
+ let customControls = {
2621
+ removeControl: new fabric.Control({
2622
+ x: -0.5,
2623
+ y: -0.5,
2624
+ offsetY: 16,
2625
+ cursorStyle: 'pointer',
2626
+ render: (ctx, left, top, styleOverride, fabricObject) => {
2627
+ return this.renderIcon(ctx, left, top, styleOverride, fabricObject, 'cross');
2628
+ },
2629
+ mouseUpHandler: (eventData, transform) => {
2630
+ var target = transform.target;
2631
+ var canvas = target.canvas;
2632
+ canvas.remove(target);
2633
+ canvas.requestRenderAll();
2634
+ this.saveCanvasState();
2635
+ return true;
2636
+ },
2637
+ }),
2638
+ rotateControl: new fabric.Control({
2639
+ x: 0.5,
2640
+ y: -0.5,
2641
+ offsetY: 16,
2642
+ cursorStyle: 'pointer',
2643
+ render: (ctx, left, top, styleOverride, fabricObject) => {
2644
+ return this.renderIcon(ctx, left, top, styleOverride, fabricObject, 'rotate');
2645
+ },
2646
+ mouseUpHandler: (eventData, transform) => {
2647
+ let fabricObject = transform.target;
2648
+ const rotationIncrement = 30; // Rotation increment in degrees
2649
+ fabricObject.set('angle', (fabricObject.angle + rotationIncrement) % 360);
2650
+ fabricObject.setCoords(); // Update object's coordinates
2651
+ this.saveCanvasState();
2652
+ return true;
2653
+ },
2654
+ }),
2655
+ expantControl: new fabric.Control({
2656
+ x: 0.5,
2657
+ y: 0.5,
2658
+ offsetY: 16,
2659
+ cursorStyle: 'grab',
2660
+ render: (ctx, left, top, styleOverride, fabricObject) => {
2661
+ return this.renderIcon(ctx, left, top, styleOverride, fabricObject, 'expand');
2662
+ },
2663
+ }),
2664
+ };
2665
+ if (event.transform && event.transform.action === 'scale') {
2666
+ this.isResize = true;
2667
+ this.initialMouseY = event.e.clientY;
2668
+ this.originalFontSize = event.target.fontSize;
2669
+ }
2670
+ if (!this.textAdded &&
2671
+ !this.canDoodle &&
2672
+ !this.isScanStart &&
2673
+ this.canAddText) {
2674
+ _text.controls = customControls;
2675
+ this._canvas.add(_text);
2676
+ this._canvas.renderAll();
2677
+ this.textAdded = true;
2678
+ }
2679
+ }
2680
+ // Function to save the canvas state
2681
+ saveCanvasState() {
2682
+ const state = JSON.stringify(this._canvas.toJSON());
2683
+ // const state = this._canvas.getObjects()[this._canvas.getObjects.length - 1]
2684
+ if (this.currentStateIndex < this.canvasStates.length - 1) {
2685
+ this.canvasStates.length = this.currentStateIndex + 1; // Remove future states
2686
+ }
2687
+ let activeObj = this._canvas.getActiveObject();
2688
+ if (activeObj && activeObj.type === 'path') {
2689
+ // set remove border and controls for drawing
2690
+ activeObj.set({
2691
+ hasControls: false,
2692
+ selectable: false,
2693
+ hasBorders: false,
2694
+ });
2695
+ }
2696
+ const customControl = activeObj && activeObj.controls ? activeObj.controls : null;
2697
+ this.canvasStates.push({ state, customControl });
2698
+ this.currentStateIndex++;
2699
+ }
2700
+ redo() {
2701
+ this.isRedoing = true;
2702
+ if (this.currentStateIndex < this.canvasStates.length - 1) {
2703
+ this.currentStateIndex++;
2704
+ const nextState = this.canvasStates[this.currentStateIndex];
2705
+ this.canRedoOrUndo.emit({
2706
+ canUndo: this.currentStateIndex > 0 ? true : false,
2707
+ canRedo: this.currentStateIndex < this.canvasStates.length - 1 ? true : false,
2708
+ });
2709
+ this._canvas.loadFromJSON(nextState.state, () => {
2710
+ let activeObject = this._canvas.getActiveObject();
2711
+ this._canvas.getObjects().forEach((obj) => {
2712
+ if (obj !== activeObject) {
2713
+ obj.evented = false;
2714
+ }
2715
+ });
2716
+ if (activeObject && activeObject.type !== 'path') {
2717
+ activeObject.controls =
2718
+ nextState && nextState.customControl
2719
+ ? nextState.customControl
2720
+ : null;
2721
+ activeObject.set({
2722
+ padding: 42,
2723
+ borderScaleFactor: 3,
2724
+ borderColor: 'white',
2725
+ });
2726
+ this.textAdded = true;
2727
+ this.canAddTextOrDoole.emit({ key: 'doodle', value: false });
2728
+ this.canAddTextOrDoole.emit({ key: 'text', value: true });
2729
+ }
2730
+ else {
2731
+ activeObject.set({
2732
+ hasControls: false,
2733
+ selectable: false,
2734
+ hasBorders: false,
2735
+ });
2736
+ this.canAddTextOrDoole.emit({ key: 'text', value: false });
2737
+ this.canAddTextOrDoole.emit({ key: 'doodle', value: true });
2738
+ this._canvas.selection = false;
2739
+ }
2740
+ this._canvas.renderAll();
2741
+ });
2742
+ }
2743
+ }
2744
+ undo() {
2745
+ this.isUndoing = true;
2746
+ if (this.currentStateIndex > 0) {
2747
+ this.currentStateIndex--;
2748
+ const previousState = this.canvasStates[this.currentStateIndex];
2749
+ this.canRedoOrUndo.emit({
2750
+ canUndo: this.currentStateIndex > 0 ? true : false,
2751
+ canRedo: this.currentStateIndex < this.canvasStates.length - 1 ? true : false,
2752
+ });
2753
+ this._canvas.loadFromJSON(previousState.state, () => {
2754
+ let activeObject = this._canvas.getActiveObject();
2755
+ if (activeObject) {
2756
+ if (activeObject.type !== 'path') {
2757
+ activeObject.set({
2758
+ padding: 42,
2759
+ borderScaleFactor: 3,
2760
+ borderColor: 'white',
2761
+ });
2762
+ this._canvas.isDrawingMode = false;
2763
+ this._canvas.freeDrawingBrush = null;
2764
+ this.textAdded = true;
2765
+ this.canAddTextOrDoole.emit({ key: 'doodle', value: false });
2766
+ this.canAddTextOrDoole.emit({ key: 'text', value: true });
2767
+ }
2768
+ else {
2769
+ activeObject.set({
2770
+ hasControls: false,
2771
+ hasBorders: false,
2772
+ });
2773
+ this._canvas.selection = false;
2774
+ this.canAddTextOrDoole.emit({ key: 'text', value: false });
2775
+ this.canAddTextOrDoole.emit({ key: 'doodle', value: true });
2776
+ }
2777
+ this._canvas.getActiveObject().controls =
2778
+ previousState && previousState.customControl
2779
+ ? previousState.customControl
2780
+ : null;
2781
+ }
2782
+ this._canvas.getObjects().forEach((obj) => {
2783
+ if (obj !== activeObject) {
2784
+ obj.evented = false;
2785
+ }
2786
+ });
2787
+ this._canvas.renderAll();
2788
+ });
2789
+ }
2790
+ }
2791
+ getCanvasSize() {
2792
+ const img = new Image();
2793
+ img.src = this.src;
2794
+ const box = this._component.nativeElement.getBoundingClientRect();
2795
+ const width = this.width || box.width || 1;
2796
+ const height = this.height || box.height || 1;
2797
+ return { width, height };
2798
+ }
2799
+ /**
2800
+ * recognize paper corners
2801
+ */
2802
+ build() {
2803
+ return __awaiter(this, void 0, void 0, function* () {
2804
+ if (!this.src || !this._canvas) {
2805
+ return;
2806
+ }
2807
+ const bg = yield this.loadBackgroundImage(this.src);
2808
+ // Remove all the existing objects before add the new image to background
2809
+ this._canvas.clear();
2810
+ const imgSize = bg.getOriginalSize();
2811
+ this.Image = {
2812
+ height: imgSize.height * this._scaleFactor,
2813
+ width: imgSize.width * this._scaleFactor,
2814
+ };
2815
+ const scaleX = this._canvas.width / imgSize.width;
2816
+ const scaleY = this._canvas.height / imgSize.height;
2817
+ this._scaleFactor = Math.min(scaleY, scaleX);
2818
+ this._canvas.setDimensions({
2819
+ width: imgSize.width,
2820
+ height: imgSize.height,
2821
+ }, {
2822
+ backstoreOnly: true,
2823
+ });
2824
+ this._canvas.setBackgroundImage(bg, () => {
2825
+ this._canvas.renderAll();
2826
+ });
2827
+ this.saveCanvasState();
2828
+ this._canvas.renderAll();
2829
+ });
2830
+ }
2831
+ createControls(polygon) {
2832
+ // remove previous controls
2833
+ if (this._controls.length) {
2834
+ this._canvas.remove(...this._controls);
2835
+ this._controls = [];
2836
+ }
2837
+ if (polygon) {
2838
+ for (const [index, point] of polygon.points.entries()) {
2839
+ const circle = this.createControl(index, polygon);
2840
+ this._controls.push(circle);
2841
+ this._canvas.add(circle);
2842
+ }
2843
+ }
2844
+ }
2845
+ createControl(index, polygon) {
2846
+ const point = polygon.points[index];
2847
+ const circle = new fabric.Circle({
2848
+ left: point.x,
2849
+ top: point.y,
2850
+ originX: 'center',
2851
+ originY: 'center',
2852
+ fill: '#2188d9',
2853
+ radius: 20,
2854
+ hasRotatingPoint: false,
2855
+ hasBorders: false,
2856
+ hasControls: false,
2857
+ objectCaching: false,
2858
+ });
2859
+ circle.on('moving', (evt) => {
2860
+ if (evt.pointer) {
2861
+ polygon.points[index] = new fabric.Point(evt.pointer.x, evt.pointer.y);
2862
+ polygon.dirty = true;
2863
+ }
2864
+ });
2865
+ circle.on('mouseup', (evt) => {
2866
+ this.cornersChanged.emit();
2867
+ this.screenPoints[index] = polygon.points[index];
2868
+ });
2869
+ return circle;
2870
+ }
2871
+ loadBackgroundImage(src) {
2872
+ return new Promise((resolve, reject) => {
2873
+ const img = new Image();
2874
+ img.onload = () => {
2875
+ let fabImage = new fabric.Image(img);
2876
+ resolve(fabImage);
2877
+ };
2878
+ img.src = src;
2879
+ });
2880
+ }
2881
+ completeScan(completed) {
2882
+ return __awaiter(this, void 0, void 0, function* () {
2883
+ if (!completed) {
2884
+ return;
2885
+ }
2886
+ console.log(`complete scan & extract paper`);
2887
+ if (!this._cornersPg) {
2888
+ console.error(`Corner line is not available`);
2889
+ }
2890
+ if (this._cornersPg) {
2891
+ this._canvas.remove(this._cornersPg);
2892
+ this._canvas.remove(...this._controls);
2893
+ this._canvas.renderAll();
2894
+ }
2895
+ let output;
2896
+ if (this.isScaned) {
2897
+ output = yield this._opencv.extractPaper({
2898
+ src: this._canvas.toDataURL({ quality: 1 }),
2899
+ corners: {
2900
+ topLeftCorner: this.screenPoints[0],
2901
+ topRightCorner: this.screenPoints[1],
2902
+ bottomRightCorner: this.screenPoints[2],
2903
+ bottomLeftCorner: this.screenPoints[3],
2904
+ },
2905
+ height: this._canvas.height,
2906
+ width: this._canvas.width,
2907
+ });
2908
+ this._canvas.remove(...this._canvas.getObjects());
2909
+ this.isScaned = false;
2910
+ }
2911
+ else {
2912
+ output = this._canvas.toCanvasElement();
2913
+ }
2914
+ this.currentStateIndex = null;
2915
+ this.canvasStates = [];
2916
+ this.canRedoOrUndo.emit({
2917
+ canUndo: this.currentStateIndex > 0 ? true : false,
2918
+ canRedo: this.currentStateIndex < this.canvasStates.length - 1 ? true : false,
2919
+ });
2920
+ this.extracted.emit(output);
2921
+ this.cleanupCanvas();
2922
+ });
2923
+ }
2924
+ cleanupCanvas() {
2925
+ this._canvas.getObjects().forEach((obj) => (obj.evented = false));
2926
+ this._canvas.selection = false;
2927
+ this._canvas.isDrawingMode = false;
2928
+ this.canDoodle = false;
2929
+ this.isScanStart = false;
2930
+ this.canAddText = false;
2931
+ this.textAdded = false;
2932
+ this._canvas.renderAll();
2933
+ }
2934
+ }
2935
+ ZenduDocScanner.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduDocScanner, deps: [{ token: OpenCVService }], target: i0.ɵɵFactoryTarget.Component });
2936
+ ZenduDocScanner.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduDocScanner, selector: "zen-doc-scanner", inputs: { src: "src", width: "width", height: "height", isScanStart: "isScanStart", canAddText: "canAddText", canDoodle: "canDoodle", isRedoing: "isRedoing", isUndoing: "isUndoing", done: "done" }, outputs: { extracted: "extracted", cornersChanged: "cornersChanged", canAddTextOrDoole: "canAddTextOrDoole", canRedoOrUndo: "canRedoOrUndo" }, viewQueries: [{ propertyName: "_canvasElement", first: true, predicate: ["drawCanas"], descendants: true }, { propertyName: "_component", first: true, predicate: ["componentWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #componentWrapper\n class=\"component\">\n <canvas #drawCanas></canvas>\n <div class=\"colors-container\" *ngIf=\"canDoodle || canAddText\">\n <div class=\"colors\" *ngFor=\"let color of colors\" [ngStyle]=\"{'background': color.hexCode, 'border':color.selected ? '1.6px solid white' : 'none'}\" (click)=\"chngClrTextOrBrush(color.hexCode, canAddText ? 'text': 'doodle')\"></div>\n </div>\n</div>\n", styles: [".component{width:100%;height:100%}.colors-container{display:flex;height:20px;gap:16px;padding:8px 62px;justify-content:space-between;background:#262626}.colors-container .colors{width:20px;height:20px;border-radius:50%}\n"], 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: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduDocScanner, decorators: [{
2938
+ type: Component,
2939
+ args: [{ selector: 'zen-doc-scanner', template: "<div #componentWrapper\n class=\"component\">\n <canvas #drawCanas></canvas>\n <div class=\"colors-container\" *ngIf=\"canDoodle || canAddText\">\n <div class=\"colors\" *ngFor=\"let color of colors\" [ngStyle]=\"{'background': color.hexCode, 'border':color.selected ? '1.6px solid white' : 'none'}\" (click)=\"chngClrTextOrBrush(color.hexCode, canAddText ? 'text': 'doodle')\"></div>\n </div>\n</div>\n", styles: [".component{width:100%;height:100%}.colors-container{display:flex;height:20px;gap:16px;padding:8px 62px;justify-content:space-between;background:#262626}.colors-container .colors{width:20px;height:20px;border-radius:50%}\n"] }]
2940
+ }], ctorParameters: function () { return [{ type: OpenCVService }]; }, propDecorators: { _canvasElement: [{
2941
+ type: ViewChild,
2942
+ args: ['drawCanas']
2943
+ }], _component: [{
2944
+ type: ViewChild,
2945
+ args: ['componentWrapper']
2946
+ }], src: [{
2947
+ type: Input
2948
+ }], width: [{
2949
+ type: Input
2950
+ }], height: [{
2951
+ type: Input
2952
+ }], isScanStart: [{
2953
+ type: Input
2954
+ }], canAddText: [{
2955
+ type: Input
2956
+ }], canDoodle: [{
2957
+ type: Input
2958
+ }], isRedoing: [{
2959
+ type: Input
2960
+ }], isUndoing: [{
2961
+ type: Input
2962
+ }], done: [{
2963
+ type: Input
2964
+ }], extracted: [{
2965
+ type: Output
2966
+ }], cornersChanged: [{
2967
+ type: Output
2968
+ }], canAddTextOrDoole: [{
2969
+ type: Output
2970
+ }], canRedoOrUndo: [{
2971
+ type: Output
2972
+ }] } });
2973
+
2974
+ class ZenduBreadcrumbs {
2975
+ constructor() {
2976
+ this.steps = [];
2977
+ /**
2978
+ * Enable manual activation. In this case active trips will managed by app
2979
+ */
2980
+ this.manualNavigation = false;
2981
+ this.onActivate = new EventEmitter();
2982
+ }
2983
+ onStepClick(step) {
2984
+ if (this.manualNavigation) {
2985
+ return;
2986
+ }
2987
+ const activeIdx = this.steps.indexOf(step);
2988
+ // update states
2989
+ for (let [idx, step] of this.steps.entries()) {
2990
+ step.active = idx <= activeIdx;
2991
+ }
2992
+ this.onActivate.emit(step);
2993
+ }
2994
+ }
2995
+ ZenduBreadcrumbs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduBreadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Component });
2996
+ ZenduBreadcrumbs.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduBreadcrumbs, selector: "zen-breadcrumbs", inputs: { steps: "steps", manualNavigation: "manualNavigation" }, outputs: { onActivate: "onActivate" }, ngImport: i0, template: "<div class=\"component\">\n <ng-container *ngFor=\"let step of steps; let isLast = last;\">\n <div class=\"line\"\n [ngClass]=\"{\n 'active': step.active,\n 'width': steps.length !== 1\n }\"></div>\n <div class=\"step\"\n [ngClass]=\"{\n 'active': step.active,\n 'mannual-navigation': manualNavigation,\n 'text-nowrap': steps.length === 1\n }\"\n (click)=\"onStepClick(step)\">\n {{step.text}}\n </div>\n <!-- last line -->\n <div *ngIf=\"isLast\"\n class=\"line\"\n [ngClass]=\"{\n 'active': step.active,\n 'width': steps.length !== 1\n }\"></div>\n </ng-container>\n\n</div>", styles: [".component{display:flex;align-items:center;position:relative;width:100%}.component .line{flex:1;background-color:var(--color-white-tint-2, #ececed);height:8px;width:100%}.component .line.active{background-color:var(--color-primary, #2188d9)}.component .line.width{width:12px}.component :first-child.line{flex:unset;border-top-left-radius:4px;border-bottom-left-radius:4px}.component :last-child.line{flex:unset;border-top-right-radius:4px;border-bottom-right-radius:4px}.component .step{background:white;position:relative;display:flex;padding:8px 24px;justify-content:center;align-items:center;margin:0 -2px;border-radius:50px;border:2px solid var(--color-primary, #2188d9);color:var(--color-primary, #2188d9);font-size:16px;font-style:normal;font-weight:400;cursor:pointer}.component .step.active{background-color:var(--color-primary, #2188d9);color:var(--color-white-primary, #ffffff)}.component .step.mannual-navigation{cursor:default}.component .step.text-nowrap{white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduBreadcrumbs, decorators: [{
2998
+ type: Component,
2999
+ args: [{ selector: 'zen-breadcrumbs', template: "<div class=\"component\">\n <ng-container *ngFor=\"let step of steps; let isLast = last;\">\n <div class=\"line\"\n [ngClass]=\"{\n 'active': step.active,\n 'width': steps.length !== 1\n }\"></div>\n <div class=\"step\"\n [ngClass]=\"{\n 'active': step.active,\n 'mannual-navigation': manualNavigation,\n 'text-nowrap': steps.length === 1\n }\"\n (click)=\"onStepClick(step)\">\n {{step.text}}\n </div>\n <!-- last line -->\n <div *ngIf=\"isLast\"\n class=\"line\"\n [ngClass]=\"{\n 'active': step.active,\n 'width': steps.length !== 1\n }\"></div>\n </ng-container>\n\n</div>", styles: [".component{display:flex;align-items:center;position:relative;width:100%}.component .line{flex:1;background-color:var(--color-white-tint-2, #ececed);height:8px;width:100%}.component .line.active{background-color:var(--color-primary, #2188d9)}.component .line.width{width:12px}.component :first-child.line{flex:unset;border-top-left-radius:4px;border-bottom-left-radius:4px}.component :last-child.line{flex:unset;border-top-right-radius:4px;border-bottom-right-radius:4px}.component .step{background:white;position:relative;display:flex;padding:8px 24px;justify-content:center;align-items:center;margin:0 -2px;border-radius:50px;border:2px solid var(--color-primary, #2188d9);color:var(--color-primary, #2188d9);font-size:16px;font-style:normal;font-weight:400;cursor:pointer}.component .step.active{background-color:var(--color-primary, #2188d9);color:var(--color-white-primary, #ffffff)}.component .step.mannual-navigation{cursor:default}.component .step.text-nowrap{white-space:nowrap}\n"] }]
3000
+ }], propDecorators: { steps: [{
3001
+ type: Input
3002
+ }], manualNavigation: [{
3003
+ type: Input
3004
+ }], onActivate: [{
3005
+ type: Output
3006
+ }] } });
3007
+
3008
+ class MapService {
3009
+ createDeviceMarker(device, minZoom) {
3010
+ const contentHtml = this.getDeviceContent(device);
3011
+ const lat = Math.max(Math.min(device.latitude, 180), -180);
3012
+ const lng = Math.max(Math.min(device.longitude, 180), -180);
3013
+ const deviceMarker = new H.map.DomMarker(new H.geo.Point(lat, lng), {
3014
+ zIndex: 10,
3015
+ icon: new H.map.DomIcon(contentHtml),
3016
+ data: device,
3017
+ min: minZoom ? minZoom : 0
3018
+ });
3019
+ return deviceMarker;
3020
+ }
3021
+ getDeviceContent(device) {
3022
+ let devIcon = "";
3023
+ if (device.icon) {
3024
+ devIcon = device.icon;
3025
+ }
3026
+ else {
3027
+ // Default icon
3028
+ devIcon = "https://storage.googleapis.com/ng-zenduit/icon/car.svg";
3029
+ }
3030
+ let isDriving = device.isDriving || false;
3031
+ let driveClass = "";
3032
+ if (isDriving) {
3033
+ driveClass = "driving-marker";
3034
+ }
3035
+ let directionSvg = 'https://storage.googleapis.com/ng-zenduit/icon/device_direction.svg';
3036
+ let displayDirection = isDriving ? "block" : "none";
3037
+ let classList = isDriving ? "moving" : "stopped";
3038
+ const lblContent = `<div class='gotrax-label ${classList}'>` +
3039
+ ` <span>${device.name}</span>` +
3040
+ ` <div class='gotrax-speed-label'></div>` +
3041
+ `</div>`;
3042
+ const bearing = device.bearing || 0;
3043
+ let contentHtml = `<div>` +
3044
+ `<div class='g-marker-vehilce-wrapper'>` +
3045
+ `<div class='g-marker-vehilce'>` +
3046
+ `<div class='${driveClass} gotrax-img'>
3047
+ ${lblContent}
3048
+ <div class='g-marker-icon ${classList}'><img class="g-marker-img svg-color white" src=${devIcon} />
3049
+ <div class="direction-arrow" style="display: ${displayDirection};transform: rotate(${bearing}deg); background-image: url('${directionSvg}');"></div>
3050
+ </div></div>` +
3051
+ `</div>` + // close g-marker-vehilce
3052
+ `</div>` + // close g-marker-vehilce-wrapper
3053
+ `</div>`;
3054
+ return contentHtml;
3055
+ }
3056
+ zoomToBounds(map, bounds) {
3057
+ if (!bounds || bounds.isEmpty()) {
3058
+ return;
3059
+ }
3060
+ if (isNaN(bounds.getCenter().lat) ||
3061
+ isNaN(bounds.getCenter().lng)) {
3062
+ return;
3063
+ }
3064
+ this.zoomToLatLngs(map, [bounds.getTopLeft(), bounds.getBottomRight()]);
3065
+ }
3066
+ zoomToLatLngs(map, pnts, zoom = 15) {
3067
+ if (!pnts || pnts.length == 0) {
3068
+ return;
3069
+ }
3070
+ if (pnts.length == 1) {
3071
+ map.setZoom(zoom);
3072
+ map.setCenter(new H.geo.Point(pnts[0].lat, pnts[0].lng));
3073
+ return;
3074
+ }
3075
+ const latLngs = [];
3076
+ pnts.forEach(p => latLngs.push(p.lat, p.lng, 0));
3077
+ const bounds = H.geo.Rect.coverLatLngAlts(latLngs);
3078
+ const minSize = 0.001;
3079
+ if (bounds.getWidth() < minSize &&
3080
+ bounds.getHeight() < minSize) {
3081
+ map.setCenter(bounds.getCenter());
3082
+ map.setZoom(17);
3083
+ }
3084
+ else {
3085
+ const p1 = bounds.getBottomRight();
3086
+ const p2 = bounds.getTopLeft();
3087
+ const width = Math.max(bounds.getWidth(), minSize);
3088
+ const height = Math.max(bounds.getHeight(), minSize);
3089
+ // add offset for zooming
3090
+ const targetBox = H.geo.Rect.coverLatLngAlts([
3091
+ p1.lat - (height * 0.15),
3092
+ p2.lng - (width * 0.15),
3093
+ 0,
3094
+ p2.lat + (height * 0.15),
3095
+ p1.lng + (width * 0.15),
3096
+ 0
3097
+ ]);
3098
+ map.getViewPort().resize();
3099
+ map.getViewModel().setLookAtData({ bounds: targetBox });
3100
+ }
3101
+ }
3102
+ /**
3103
+ * Create polylines for given trip and date range.
3104
+ * Method create separte polylines for logs outside the date range.
3105
+ */
3106
+ createTripPolyline(trip, map, theme) {
3107
+ let result = {};
3108
+ let coords = new Array();
3109
+ trip.logs.forEach(log => {
3110
+ let latLng = new H.geo.Point(log.latitude, log.longitude);
3111
+ coords.push(latLng.lat, latLng.lng);
3112
+ });
3113
+ if (coords.length < 2) {
3114
+ // Skip the empty path
3115
+ return result;
3116
+ }
3117
+ if (theme == "black") {
3118
+ const pl = this.createPl(coords, "#000000", 2);
3119
+ pl.setZIndex(1);
3120
+ result.polyline = pl;
3121
+ map.addObject(pl);
3122
+ }
3123
+ else {
3124
+ const pl = this.createPl(coords, "#9510e6", 5);
3125
+ pl.setZIndex(1);
3126
+ result.polyline = pl;
3127
+ let arrow = this.createArrow(coords);
3128
+ result.arrows = arrow;
3129
+ map.addObjects([pl, arrow]);
3130
+ // store additional information about polyline
3131
+ pl.setData({ type: "trip", trip: trip });
3132
+ arrow.setData({ type: "trip", trip: trip });
3133
+ }
3134
+ return result;
3135
+ }
3136
+ createPl(coords, color, strokeWeight) {
3137
+ const pl = new H.map.Polyline(H.geo.LineString.fromLatLngArray(coords), {
3138
+ style: {
3139
+ strokeColor: color,
3140
+ lineWidth: strokeWeight
3141
+ },
3142
+ arrows: {
3143
+ fillColor: "#ffffff"
3144
+ },
3145
+ zIndex: 0
3146
+ });
3147
+ return pl;
3148
+ }
3149
+ createArrow(coords) {
3150
+ return new H.map.Polyline(H.geo.LineString.fromLatLngArray(coords), {
3151
+ style: {
3152
+ lineWidth: 5,
3153
+ fillColor: 'white',
3154
+ strokeColor: 'rgba(255, 255, 255, 1)',
3155
+ lineDash: [0, 5],
3156
+ lineTailCap: 'arrow-tail',
3157
+ lineHeadCap: 'arrow-head'
3158
+ },
3159
+ zIndex: 1
3160
+ });
3161
+ }
3162
+ createStopMarker(map, log, stopIdx, tag, theme) {
3163
+ let icon;
3164
+ if (theme == "black") {
3165
+ const src = "https://storage.googleapis.com/ng-zenduit/icon/stop-icon-black.svg";
3166
+ icon = new H.map.DomIcon(`<div class="g-stop-img"><img src="${src}"/></div>`);
3167
+ }
3168
+ else {
3169
+ // deafault
3170
+ icon = new H.map.DomIcon(`<div class="g-stop"><label>${stopIdx}</label></div>`);
3171
+ }
3172
+ let stop = new H.map.DomMarker(new H.geo.Point(log.latitude, log.longitude), {
3173
+ icon: icon,
3174
+ zIndex: 2
3175
+ });
3176
+ map.addObject(stop);
3177
+ stop.setData(tag);
3178
+ return stop;
3179
+ }
3180
+ }
3181
+ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MapService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3182
+ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MapService });
3183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MapService, decorators: [{
3184
+ type: Injectable
3185
+ }] });
3186
+
3187
+ class ZenduMapComponent {
3188
+ constructor() {
3189
+ this.trips = [];
3190
+ this.devices = [];
3191
+ this.theme = 'default';
3192
+ this._objects = [];
3193
+ this._mapService = new MapService();
3194
+ }
3195
+ ngOnChanges(changes) {
3196
+ if (this.apiKey && !this._platform) {
3197
+ this.init();
3198
+ }
3199
+ if (changes["trips"] || changes["devices"]) {
3200
+ this.updateEntities();
3201
+ }
3202
+ }
3203
+ init() {
3204
+ this._platform = new H.service.Platform({
3205
+ apikey: this.apiKey
3206
+ });
3207
+ setTimeout(() => {
3208
+ this.initMap();
3209
+ this.updateEntities();
3210
+ }, 1000);
3211
+ }
3212
+ initMap() {
3213
+ // Obtain the default map types from the platform object
3214
+ const defaultLayers = this._platform.createDefaultLayers();
3215
+ this._map = new H.Map(this._mapElement.nativeElement, defaultLayers.vector.normal.map, {
3216
+ zoom: 3,
3217
+ center: { lat: 34.366, lng: -89.519 }
3218
+ });
3219
+ // Create the default UI
3220
+ const ui = H.ui.UI.createDefault(this._map, defaultLayers);
3221
+ const mapSettings = ui.getControl('mapsettings');
3222
+ mapSettings.setAlignment(H.ui.LayoutAlignment.RIGHT_TOP);
3223
+ mapSettings.setVisibility(false);
3224
+ const scalebar = ui.getControl('scalebar');
3225
+ scalebar.setAlignment(H.ui.LayoutAlignment.RIGHT_BOTTOM);
3226
+ const zoom = ui.getControl('zoom');
3227
+ zoom.setAlignment(H.ui.LayoutAlignment.RIGHT_BOTTOM);
3228
+ this._map.getBaseLayer().setMin(3);
3229
+ // MapEvents enables the event system
3230
+ // Behavior implements default interactions for pan/zoom (also on mobile touch environments)
3231
+ const behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(this._map));
3232
+ }
3233
+ updateEntities() {
3234
+ if (!this._map) {
3235
+ // map is not ready
3236
+ return;
3237
+ }
3238
+ this.clearEntities();
3239
+ this.createTrips();
3240
+ this.createDevices();
3241
+ }
3242
+ createTrips() {
3243
+ if (!this.trips || !this.trips.length) {
3244
+ return;
3245
+ }
3246
+ let box = null;
3247
+ for (const trip of this.trips) {
3248
+ const res = this._mapService.createTripPolyline(trip, this._map, this.theme);
3249
+ if (res.polyline) {
3250
+ this._objects.push(res.polyline);
3251
+ if (box) {
3252
+ box = box.mergeRect(res.polyline.getBoundingBox());
3253
+ }
3254
+ else {
3255
+ box = res.polyline.getBoundingBox();
3256
+ }
3257
+ }
3258
+ if (res.arrows) {
3259
+ this._objects.push(res.arrows);
3260
+ }
3261
+ }
3262
+ // create stop points
3263
+ //
3264
+ for (const [stopIdx, trip] of this.trips.entries()) {
3265
+ let stopLog = trip.logs[trip.logs.length - 1];
3266
+ this._objects.push(this._mapService.createStopMarker(this._map, stopLog, stopIdx + 1, trip, this.theme));
3267
+ }
3268
+ if (this.theme == "black") {
3269
+ // create a marker for first stop as well
3270
+ let stopLog = this.trips[0].logs[0];
3271
+ this._objects.push(this._mapService.createStopMarker(this._map, stopLog, 0, this.trips[0], this.theme));
3272
+ }
3273
+ if (box) {
3274
+ this._mapService.zoomToBounds(this._map, box);
3275
+ }
3276
+ }
3277
+ createDevices() {
3278
+ if (!this.devices || !this.devices.length) {
3279
+ return;
3280
+ }
3281
+ for (const device of this.devices) {
3282
+ const marker = this._mapService.createDeviceMarker(device);
3283
+ this._map.addObject(marker);
3284
+ this._objects.push(marker);
3285
+ }
3286
+ }
3287
+ clearEntities() {
3288
+ if (!this._map) {
3289
+ return;
3290
+ }
3291
+ this._map.removeObjects(this._objects);
3292
+ this._objects = [];
3293
+ }
3294
+ }
3295
+ ZenduMapComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduMapComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3296
+ ZenduMapComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduMapComponent, selector: "zen-map", inputs: { apiKey: "apiKey", trips: "trips", devices: "devices", theme: "theme" }, viewQueries: [{ propertyName: "_mapElement", first: true, predicate: ["map"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"component\">\n <div #map\n class=\"zen-map\"></div>\n</div>\n", styles: [".component{width:100%;height:100%}.component .zen-map{width:100%;height:100%;min-width:100px;min-height:100px}::ng-deep .component .zen-map .g-stop{display:flex;align-items:center;justify-content:center;padding:0 5px;min-width:16px;height:24px;background:#2188d9;border:1px solid black;border-radius:1px}::ng-deep .component .zen-map .g-stop label{color:#fff;display:block;text-align:center;margin:0!important}::ng-deep .component .zen-map .g-stop-img{position:relative}::ng-deep .component .zen-map .g-stop-img img{height:50px;position:relative;top:-49px;left:-20px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper{position:absolute;bottom:0;width:54px;display:flex;flex-direction:column;align-items:center;left:-27px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img{display:flex;flex-direction:row;justify-content:center;align-items:center}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .g-marker-vehilce{position:relative;cursor:pointer}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label-wrapper{position:absolute;bottom:42px;width:400px;left:-200px;display:flex}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label{font-weight:400;font-size:14px;border-radius:2px;text-align:center;white-space:nowrap;max-width:400px;text-overflow:ellipsis;overflow-x:hidden;color:#fff;position:absolute;top:-28px;padding:0 12px;line-height:18px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon{width:30px;height:30px;display:flex;flex-direction:row;justify-content:center;align-items:center}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .direction-arrow{height:72px;width:72px;background-repeat:no-repeat;background-size:15px;background-position:top;position:absolute}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label.moving{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label.stopped{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon.moving{border-radius:50%;background-color:#2188d9;width:36px;height:36px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon.stopped{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .svg-color.white{filter:invert(100%) sepia(4%) saturate(1%) hue-rotate(347deg) brightness(105%) contrast(100%)}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .g-marker-img{display:block;margin:auto;height:15px}\n"] });
3297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduMapComponent, decorators: [{
3298
+ type: Component,
3299
+ args: [{ selector: 'zen-map', template: "<div class=\"component\">\n <div #map\n class=\"zen-map\"></div>\n</div>\n", styles: [".component{width:100%;height:100%}.component .zen-map{width:100%;height:100%;min-width:100px;min-height:100px}::ng-deep .component .zen-map .g-stop{display:flex;align-items:center;justify-content:center;padding:0 5px;min-width:16px;height:24px;background:#2188d9;border:1px solid black;border-radius:1px}::ng-deep .component .zen-map .g-stop label{color:#fff;display:block;text-align:center;margin:0!important}::ng-deep .component .zen-map .g-stop-img{position:relative}::ng-deep .component .zen-map .g-stop-img img{height:50px;position:relative;top:-49px;left:-20px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper{position:absolute;bottom:0;width:54px;display:flex;flex-direction:column;align-items:center;left:-27px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img{display:flex;flex-direction:row;justify-content:center;align-items:center}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .g-marker-vehilce{position:relative;cursor:pointer}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label-wrapper{position:absolute;bottom:42px;width:400px;left:-200px;display:flex}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label{font-weight:400;font-size:14px;border-radius:2px;text-align:center;white-space:nowrap;max-width:400px;text-overflow:ellipsis;overflow-x:hidden;color:#fff;position:absolute;top:-28px;padding:0 12px;line-height:18px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon{width:30px;height:30px;display:flex;flex-direction:row;justify-content:center;align-items:center}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .direction-arrow{height:72px;width:72px;background-repeat:no-repeat;background-size:15px;background-position:top;position:absolute}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label.moving{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-label.stopped{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon.moving{border-radius:50%;background-color:#2188d9;width:36px;height:36px}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .gotrax-img>.g-marker-icon.stopped{background-color:#2188d9}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .svg-color.white{filter:invert(100%) sepia(4%) saturate(1%) hue-rotate(347deg) brightness(105%) contrast(100%)}::ng-deep .component .zen-map .g-marker-vehilce-wrapper .g-marker-img{display:block;margin:auto;height:15px}\n"] }]
3300
+ }], propDecorators: { _mapElement: [{
3301
+ type: ViewChild,
3302
+ args: ["map"]
3303
+ }], apiKey: [{
3304
+ type: Input
3305
+ }], trips: [{
3306
+ type: Input
3307
+ }], devices: [{
3308
+ type: Input
3309
+ }], theme: [{
3310
+ type: Input
3311
+ }] } });
3312
+
3313
+ class ZenduFileUpload {
3314
+ constructor() {
3315
+ this.fileTypes = `image/*`;
3316
+ this.uploadState = "";
3317
+ /**
3318
+ * fire when user clicked on "Upload now"
3319
+ */
3320
+ this.uploadFile = new EventEmitter();
3321
+ /**
3322
+ * fired when user click "Cancel"
3323
+ */
3324
+ this.uploadCancelled = new EventEmitter();
3325
+ this.isFileSelected = false;
3326
+ this.isFileDragover = false;
3327
+ this.filename = "";
3328
+ this._selectedFiles = [];
3329
+ }
3330
+ // Dragover listener
3331
+ onDragOver(evt) {
3332
+ evt.preventDefault();
3333
+ evt.stopPropagation();
3334
+ this.isFileDragover = true;
3335
+ }
3336
+ // Dragleave listener
3337
+ onDragLeave(evt) {
3338
+ evt.preventDefault();
3339
+ evt.stopPropagation();
3340
+ this.isFileDragover = false;
3341
+ }
3342
+ // Drop listener
3343
+ ondrop(evt) {
3344
+ var _a;
3345
+ evt.preventDefault();
3346
+ evt.stopPropagation();
3347
+ this.isFileDragover = false;
3348
+ let target = evt.dataTransfer;
3349
+ if (target && ((_a = target.files) === null || _a === void 0 ? void 0 : _a.length)) {
3350
+ this.handleFiles(target.files);
3351
+ }
3352
+ console.log('File Dropped');
3353
+ }
3354
+ onFileInput(evt) {
3355
+ return __awaiter(this, void 0, void 0, function* () {
3356
+ const target = evt.target;
3357
+ if (target && target.files) {
3358
+ yield this.handleFiles(target.files);
3359
+ }
3360
+ });
3361
+ }
3362
+ handleFiles(files) {
3363
+ return __awaiter(this, void 0, void 0, function* () {
3364
+ console.log(`handle files`, files);
3365
+ if (!files.length) {
3366
+ return;
3367
+ }
3368
+ this.filename = files.item(0).name;
3369
+ this._selectedFiles = [];
3370
+ for (let idx = 0; idx < files.length; idx++) {
3371
+ this._selectedFiles.push(files[idx]);
3372
+ }
3373
+ this.isFileSelected = true;
3374
+ this.uploadState = '';
3375
+ });
3376
+ }
3377
+ uploadNow() {
3378
+ if (!this._selectedFiles.length) {
3379
+ console.error(`no files for uploading`);
3380
+ return;
3381
+ }
3382
+ this.uploadFile.emit(this._selectedFiles);
3383
+ }
3384
+ clear() {
3385
+ this.isFileSelected = false;
3386
+ this.isFileDragover = false;
3387
+ this.filename = "";
3388
+ this._selectedFiles = [];
3389
+ this.uploadState = "";
3390
+ }
3391
+ cancelUploading() {
3392
+ this.uploadCancelled.emit();
3393
+ this.clear();
3394
+ }
3395
+ }
3396
+ ZenduFileUpload.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Component });
3397
+ ZenduFileUpload.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduFileUpload, selector: "zen-file-upload", inputs: { fileTypes: "fileTypes", uploadState: "uploadState" }, outputs: { uploadFile: "uploadFile", uploadCancelled: "uploadCancelled" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" } }, ngImport: i0, template: "<div class=\"component\">\n <div class=\"title\">\n <span *ngIf=\"uploadState != 'done'\">Upload File</span>\n <span *ngIf=\"uploadState == 'done'\">Uploaded File</span>\n </div>\n <div class=\"drop-area\"\n [class.dragover]=\"isFileDragover\"\n *ngIf=\"uploadState != 'done'\">\n\n <div class=\"box\"\n *ngIf=\"!isFileSelected\">\n <div>\n <zen-icon class=\"doc-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/document.svg\"></zen-icon>\n </div>\n <div>\n <div>Drag and Drop Here</div>\n <div>or</div>\n <span class=\"browse\"\n (click)=\"fileIp.click()\">Browse</span>\n\n <form><input type=\"file\"\n [accept]=\"fileTypes\"\n #fileIp\n (change)=\"onFileInput($event)\" /></form>\n </div>\n </div>\n\n <ng-container *ngIf=\"isFileSelected\">\n <!-- File selected state -->\n <ng-container *ngIf=\"uploadState == ''\">\n <div class=\"box-selected-file\">\n <div class=\"close-wrapper\">\n <zen-icon (click)=\"clear()\"\n class=\"close-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/cross.svg\"></zen-icon>\n </div>\n <div>\n <zen-icon class=\"img-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image.svg\"></zen-icon>\n </div>\n <div class=\"filename\">\n {{filename}}\n </div>\n </div>\n </ng-container>\n\n <!-- Uploading state -->\n <ng-container *ngIf=\"uploadState == 'uploading'\">\n <div class=\"box-file-uploading\">\n <div class=\"file-description\">\n <zen-icon class=\"img-icon-sm\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image-sm.svg\"></zen-icon>\n <div>{{filename}}</div>\n </div>\n <div class=\"progress\">\n <div class=\"progress-bar-value\"></div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n\n\n <!-- Uploading done -->\n <div *ngIf=\"uploadState == 'done'\"\n class=\"box-upload-done\">\n <div class=\"file-description\">\n <zen-icon class=\"img-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image.svg\"></zen-icon>\n <div class=\"filename\">{{filename}}</div>\n <div class=\"close-btn\">\n <zen-icon (click)=\"clear()\"\n class=\"close-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/cross.svg\"></zen-icon>\n </div>\n\n </div>\n </div>\n\n <div class=\"btn-upload-wrapper\">\n\n <button *ngIf=\"uploadState == ''\"\n (click)=\"uploadNow()\"\n class=\"button-flat full-width\"\n [disabled]=\"!isFileSelected\">\n Upload Now\n </button>\n\n <button *ngIf=\"uploadState == 'uploading'\"\n (click)=\"cancelUploading()\"\n class=\"button-alert full-width\"\n [disabled]=\"!isFileSelected\">\n Cancel\n </button>\n </div>\n\n</div>\n", styles: [".component{border-radius:4px;border:1px solid var(--color-white-tint-3, #e0e0e0);padding:24px;box-sizing:border-box;font-family:Roboto;width:100%;height:100%}.component .title{font-size:16px;font-style:normal;font-weight:500;margin-bottom:16px}.component .drop-area{border-radius:4px;border:1px dashed var(--color-white-tint-3, #e0e0e0);min-width:100px;margin-bottom:16px}.component .drop-area input[type=file]{display:none}.component .drop-area .box{padding:26px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}.component .drop-area .box .browse{color:var(--color-primary, #2188d9);font-style:normal;font-weight:500;line-height:130%;letter-spacing:.28px;text-decoration:underline;cursor:pointer}.component .drop-area .doc-icon{width:28px;height:28px;background-color:var(--color-grey-primary, #4f4f4f)}.component .drop-area.dragover{border:1px dashed var(--color-primary, #2188d9)}.component .drop-area.dragover .doc-icon{background-color:var(--color-primary, #2188d9)}.component .drop-area .box-selected-file{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;margin:8px}.component .drop-area .box-selected-file .img-icon{background-color:var(--color-grey-primary, #4f4f4f);width:52px;height:52px}.component .drop-area .box-selected-file .close-wrapper{width:100%;display:flex;justify-content:end;margin-bottom:8px}.component .drop-area .box-selected-file .close-wrapper .close-icon{background-color:var(--color-error-primary, #dc3e33);cursor:pointer}.component .drop-area .box-selected-file .filename{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400;margin-bottom:30px}.component .drop-area .box-file-uploading{padding:56px 28px;box-sizing:border-box}.component .drop-area .box-file-uploading .file-description{display:flex;align-items:center;gap:8px;font-size:14px;font-style:normal;font-weight:400;margin-bottom:5px}.component .drop-area .box-file-uploading .file-description .img-icon-sm{background-color:var(--color-grey-primary, #4f4f4f);width:28px;height:28px}.component .drop-area .box-file-uploading .progress{border-radius:4px;background-color:var(--color-white-tint-3, #e0e0e0);width:100%;height:5px;overflow:hidden}.component .drop-area .box-file-uploading .progress .progress-bar-value{width:100%;height:100%;background-color:var(--color-primary, #2188d9);animation:indeterminateAnimation 1s infinite linear;transform-origin:0% 50%}.component .box-upload-done .file-description{display:flex;align-items:center;gap:4px;font-size:14px;font-style:normal;font-weight:400}.component .box-upload-done .file-description .filename{flex:1}.component .box-upload-done .file-description .close-icon{background-color:var(--color-error-primary, #dc3e33);cursor:pointer}.component .box-upload-done .file-description .img-icon{background-color:var(--color-grey-primary, #4f4f4f);width:52px;height:52px}.component .btn-upload-wrapper button{width:100%}@keyframes indeterminateAnimation{0%{transform:translate(0) scaleX(0)}40%{transform:translate(0) scaleX(.4)}to{transform:translate(100%) scaleX(.5)}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ZenduIconComponent, selector: "zen-icon", inputs: ["src"] }] });
3398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduFileUpload, decorators: [{
3399
+ type: Component,
3400
+ args: [{ selector: 'zen-file-upload', template: "<div class=\"component\">\n <div class=\"title\">\n <span *ngIf=\"uploadState != 'done'\">Upload File</span>\n <span *ngIf=\"uploadState == 'done'\">Uploaded File</span>\n </div>\n <div class=\"drop-area\"\n [class.dragover]=\"isFileDragover\"\n *ngIf=\"uploadState != 'done'\">\n\n <div class=\"box\"\n *ngIf=\"!isFileSelected\">\n <div>\n <zen-icon class=\"doc-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/document.svg\"></zen-icon>\n </div>\n <div>\n <div>Drag and Drop Here</div>\n <div>or</div>\n <span class=\"browse\"\n (click)=\"fileIp.click()\">Browse</span>\n\n <form><input type=\"file\"\n [accept]=\"fileTypes\"\n #fileIp\n (change)=\"onFileInput($event)\" /></form>\n </div>\n </div>\n\n <ng-container *ngIf=\"isFileSelected\">\n <!-- File selected state -->\n <ng-container *ngIf=\"uploadState == ''\">\n <div class=\"box-selected-file\">\n <div class=\"close-wrapper\">\n <zen-icon (click)=\"clear()\"\n class=\"close-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/cross.svg\"></zen-icon>\n </div>\n <div>\n <zen-icon class=\"img-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image.svg\"></zen-icon>\n </div>\n <div class=\"filename\">\n {{filename}}\n </div>\n </div>\n </ng-container>\n\n <!-- Uploading state -->\n <ng-container *ngIf=\"uploadState == 'uploading'\">\n <div class=\"box-file-uploading\">\n <div class=\"file-description\">\n <zen-icon class=\"img-icon-sm\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image-sm.svg\"></zen-icon>\n <div>{{filename}}</div>\n </div>\n <div class=\"progress\">\n <div class=\"progress-bar-value\"></div>\n </div>\n </div>\n </ng-container>\n </ng-container>\n </div>\n\n\n <!-- Uploading done -->\n <div *ngIf=\"uploadState == 'done'\"\n class=\"box-upload-done\">\n <div class=\"file-description\">\n <zen-icon class=\"img-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/image.svg\"></zen-icon>\n <div class=\"filename\">{{filename}}</div>\n <div class=\"close-btn\">\n <zen-icon (click)=\"clear()\"\n class=\"close-icon\"\n src=\"https://storage.googleapis.com/ng-zenduit/icon/cross.svg\"></zen-icon>\n </div>\n\n </div>\n </div>\n\n <div class=\"btn-upload-wrapper\">\n\n <button *ngIf=\"uploadState == ''\"\n (click)=\"uploadNow()\"\n class=\"button-flat full-width\"\n [disabled]=\"!isFileSelected\">\n Upload Now\n </button>\n\n <button *ngIf=\"uploadState == 'uploading'\"\n (click)=\"cancelUploading()\"\n class=\"button-alert full-width\"\n [disabled]=\"!isFileSelected\">\n Cancel\n </button>\n </div>\n\n</div>\n", styles: [".component{border-radius:4px;border:1px solid var(--color-white-tint-3, #e0e0e0);padding:24px;box-sizing:border-box;font-family:Roboto;width:100%;height:100%}.component .title{font-size:16px;font-style:normal;font-weight:500;margin-bottom:16px}.component .drop-area{border-radius:4px;border:1px dashed var(--color-white-tint-3, #e0e0e0);min-width:100px;margin-bottom:16px}.component .drop-area input[type=file]{display:none}.component .drop-area .box{padding:26px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}.component .drop-area .box .browse{color:var(--color-primary, #2188d9);font-style:normal;font-weight:500;line-height:130%;letter-spacing:.28px;text-decoration:underline;cursor:pointer}.component .drop-area .doc-icon{width:28px;height:28px;background-color:var(--color-grey-primary, #4f4f4f)}.component .drop-area.dragover{border:1px dashed var(--color-primary, #2188d9)}.component .drop-area.dragover .doc-icon{background-color:var(--color-primary, #2188d9)}.component .drop-area .box-selected-file{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;margin:8px}.component .drop-area .box-selected-file .img-icon{background-color:var(--color-grey-primary, #4f4f4f);width:52px;height:52px}.component .drop-area .box-selected-file .close-wrapper{width:100%;display:flex;justify-content:end;margin-bottom:8px}.component .drop-area .box-selected-file .close-wrapper .close-icon{background-color:var(--color-error-primary, #dc3e33);cursor:pointer}.component .drop-area .box-selected-file .filename{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400;margin-bottom:30px}.component .drop-area .box-file-uploading{padding:56px 28px;box-sizing:border-box}.component .drop-area .box-file-uploading .file-description{display:flex;align-items:center;gap:8px;font-size:14px;font-style:normal;font-weight:400;margin-bottom:5px}.component .drop-area .box-file-uploading .file-description .img-icon-sm{background-color:var(--color-grey-primary, #4f4f4f);width:28px;height:28px}.component .drop-area .box-file-uploading .progress{border-radius:4px;background-color:var(--color-white-tint-3, #e0e0e0);width:100%;height:5px;overflow:hidden}.component .drop-area .box-file-uploading .progress .progress-bar-value{width:100%;height:100%;background-color:var(--color-primary, #2188d9);animation:indeterminateAnimation 1s infinite linear;transform-origin:0% 50%}.component .box-upload-done .file-description{display:flex;align-items:center;gap:4px;font-size:14px;font-style:normal;font-weight:400}.component .box-upload-done .file-description .filename{flex:1}.component .box-upload-done .file-description .close-icon{background-color:var(--color-error-primary, #dc3e33);cursor:pointer}.component .box-upload-done .file-description .img-icon{background-color:var(--color-grey-primary, #4f4f4f);width:52px;height:52px}.component .btn-upload-wrapper button{width:100%}@keyframes indeterminateAnimation{0%{transform:translate(0) scaleX(0)}40%{transform:translate(0) scaleX(.4)}to{transform:translate(100%) scaleX(.5)}}\n"] }]
3401
+ }], propDecorators: { fileTypes: [{
3402
+ type: Input
3403
+ }], uploadState: [{
3404
+ type: Input
3405
+ }], uploadFile: [{
3406
+ type: Output
3407
+ }], uploadCancelled: [{
3408
+ type: Output
3409
+ }], onDragOver: [{
3410
+ type: HostListener,
3411
+ args: ['dragover', ['$event']]
3412
+ }], onDragLeave: [{
3413
+ type: HostListener,
3414
+ args: ['dragleave', ['$event']]
3415
+ }], ondrop: [{
3416
+ type: HostListener,
3417
+ args: ['drop', ['$event']]
3418
+ }] } });
3419
+
3420
+ class ZenduProgress {
3421
+ constructor() {
3422
+ this.type = "bar";
3423
+ /**
3424
+ * progress value [0, 100]
3425
+ */
3426
+ this.value = 20;
3427
+ /**
3428
+ * progress text
3429
+ */
3430
+ this.text = "";
3431
+ }
3432
+ }
3433
+ ZenduProgress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduProgress, deps: [], target: i0.ɵɵFactoryTarget.Component });
3434
+ ZenduProgress.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduProgress, selector: "zen-progress", inputs: { type: "type", value: "value", text: "text" }, ngImport: i0, template: "<div class=\"component\">\n <!-- Progres bar -->\n <div *ngIf=\"type == 'bar'\">\n <div class=\"progress-bar\">\n <div class=\"progress-bar-val\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n <span class=\"value-text\">{{value}}%</span>\n </div>\n </div>\n <div class=\"progress-text\">\n {{text}}\n </div>\n </div>\n\n <!-- Circle progress -->\n <div *ngIf=\"type == 'circle'\"\n class=\"progress-circle-wrapper\">\n\n\n <div class=\"progress-circle\"\n [class.show-full-right-side]=\"value>=50\">\n\n <div class=\"center-pipe\"></div>\n\n <div class=\"circle-clipper\">\n <div class=\"right-full-bar progress-val-50\"></div>\n <div class=\"progress-bar-val progress-val-{{value}}\"></div>\n </div>\n <div class=\"text-wrapper\">\n <div class=\"text\"> {{value}}%</div>\n <div class=\"progress-text\">{{text}}</div>\n </div>\n </div>\n </div>\n\n <!-- Half-Circle progress -->\n <div *ngIf=\"type == 'half-circle'\"\n class=\"progress-half-circle-wrapper\">\n\n <div class=\"progress-circle\">\n <div class=\"center-pipe\"></div>\n\n <div class=\"circle-clipper\">\n <div class=\"right-full-bar progress-val-50\"></div>\n <div class=\"progress-bar-val progress-val-{{value}}\"></div>\n </div>\n <div class=\"text-wrapper\">\n <div class=\"text\"> {{value}}%</div>\n <div class=\"progress-text\">{{text}}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".component{font-family:Roboto}.component .progress-bar{min-width:100px;width:100%;height:24px;border-radius:4px;background-color:var(--color-white-tint-2, #ececed);overflow:hidden;position:relative}.component .progress-bar .progress-bar-val{height:100%;display:block;width:0;background-color:var(--color-primary, #2188d9);line-height:24px;position:absolute;text-align:end;padding-right:5px;transition:width 1s}.component .progress-bar .progress-bar-val .value-text{color:var(--color-white-primary, #ffffff);font-size:14px;font-style:normal;font-weight:500}.component .progress-text{color:var(--color-white-tint-4, #d6d6d8);overflow:hidden;font-size:14px;font-style:normal;font-weight:400;margin-top:8px}.component .progress-circle-wrapper .progress-circle{position:relative;width:188px;height:188px;background-color:var(--color-white-tint-2, #ececed);border-radius:50%}.component .progress-circle-wrapper .progress-circle .center-pipe{position:absolute;top:15px;left:15px;border-radius:50%;width:160px;height:160px;background-color:#fff}.component .progress-circle-wrapper .progress-circle .circle-clipper{border-radius:50%;width:188px;height:188px;position:absolute;clip:rect(0,188px,188px,94px)}.component .progress-circle-wrapper .progress-circle .progress-bar-val{position:absolute;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box}.component .progress-circle-wrapper .progress-circle .progress-val-0{transform:rotate(0)}.component .progress-circle-wrapper .progress-circle .progress-val-1{transform:rotate(3.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-2{transform:rotate(7.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-3{transform:rotate(10.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-4{transform:rotate(14.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-5{transform:rotate(18deg)}.component .progress-circle-wrapper .progress-circle .progress-val-6{transform:rotate(21.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-7{transform:rotate(25.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-8{transform:rotate(28.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-9{transform:rotate(32.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-10{transform:rotate(36deg)}.component .progress-circle-wrapper .progress-circle .progress-val-11{transform:rotate(39.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-12{transform:rotate(43.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-13{transform:rotate(46.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-14{transform:rotate(50.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-15{transform:rotate(54deg)}.component .progress-circle-wrapper .progress-circle .progress-val-16{transform:rotate(57.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-17{transform:rotate(61.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-18{transform:rotate(64.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-19{transform:rotate(68.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-20{transform:rotate(72deg)}.component .progress-circle-wrapper .progress-circle .progress-val-21{transform:rotate(75.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-22{transform:rotate(79.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-23{transform:rotate(82.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-24{transform:rotate(86.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-25{transform:rotate(90deg)}.component .progress-circle-wrapper .progress-circle .progress-val-26{transform:rotate(93.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-27{transform:rotate(97.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-28{transform:rotate(100.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-29{transform:rotate(104.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-30{transform:rotate(108deg)}.component .progress-circle-wrapper .progress-circle .progress-val-31{transform:rotate(111.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-32{transform:rotate(115.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-33{transform:rotate(118.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-34{transform:rotate(122.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-35{transform:rotate(126deg)}.component .progress-circle-wrapper .progress-circle .progress-val-36{transform:rotate(129.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-37{transform:rotate(133.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-38{transform:rotate(136.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-39{transform:rotate(140.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-40{transform:rotate(144deg)}.component .progress-circle-wrapper .progress-circle .progress-val-41{transform:rotate(147.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-42{transform:rotate(151.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-43{transform:rotate(154.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-44{transform:rotate(158.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-45{transform:rotate(162deg)}.component .progress-circle-wrapper .progress-circle .progress-val-46{transform:rotate(165.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-47{transform:rotate(169.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-48{transform:rotate(172.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-49{transform:rotate(176.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-50{transform:rotate(180deg)}.component .progress-circle-wrapper .progress-circle .progress-val-51{transform:rotate(183.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-52{transform:rotate(187.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-53{transform:rotate(190.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-54{transform:rotate(194.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-55{transform:rotate(198deg)}.component .progress-circle-wrapper .progress-circle .progress-val-56{transform:rotate(201.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-57{transform:rotate(205.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-58{transform:rotate(208.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-59{transform:rotate(212.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-60{transform:rotate(216deg)}.component .progress-circle-wrapper .progress-circle .progress-val-61{transform:rotate(219.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-62{transform:rotate(223.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-63{transform:rotate(226.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-64{transform:rotate(230.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-65{transform:rotate(234deg)}.component .progress-circle-wrapper .progress-circle .progress-val-66{transform:rotate(237.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-67{transform:rotate(241.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-68{transform:rotate(244.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-69{transform:rotate(248.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-70{transform:rotate(252deg)}.component .progress-circle-wrapper .progress-circle .progress-val-71{transform:rotate(255.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-72{transform:rotate(259.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-73{transform:rotate(262.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-74{transform:rotate(266.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-75{transform:rotate(270deg)}.component .progress-circle-wrapper .progress-circle .progress-val-76{transform:rotate(273.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-77{transform:rotate(277.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-78{transform:rotate(280.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-79{transform:rotate(284.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-80{transform:rotate(288deg)}.component .progress-circle-wrapper .progress-circle .progress-val-81{transform:rotate(291.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-82{transform:rotate(295.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-83{transform:rotate(298.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-84{transform:rotate(302.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-85{transform:rotate(306deg)}.component .progress-circle-wrapper .progress-circle .progress-val-86{transform:rotate(309.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-87{transform:rotate(313.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-88{transform:rotate(316.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-89{transform:rotate(320.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-90{transform:rotate(324deg)}.component .progress-circle-wrapper .progress-circle .progress-val-91{transform:rotate(327.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-92{transform:rotate(331.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-93{transform:rotate(334.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-94{transform:rotate(338.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-95{transform:rotate(342deg)}.component .progress-circle-wrapper .progress-circle .progress-val-96{transform:rotate(345.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-97{transform:rotate(349.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-98{transform:rotate(352.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-99{transform:rotate(356.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-100{transform:rotate(360deg)}.component .progress-circle-wrapper .progress-circle .right-full-bar{display:none}.component .progress-circle-wrapper .progress-circle.show-full-right-side .circle-clipper{clip:rect(auto,auto,auto,auto)}.component .progress-circle-wrapper .progress-circle.show-full-right-side .right-full-bar{position:absolute;display:block;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box;transform:rotate(180deg)}.component .progress-circle-wrapper .text-wrapper{position:absolute;width:188px;height:188px;justify-content:center;z-index:10;display:flex;flex-direction:column;align-items:center}.component .progress-circle-wrapper .text-wrapper .text{font-size:32px;font-style:normal;font-weight:500;color:var(--color-primary, #2188d9)}.component .progress-circle-wrapper .text-wrapper .progress-text{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}.component .progress-half-circle-wrapper{height:94px;overflow:hidden}.component .progress-half-circle-wrapper .progress-circle{position:relative;width:188px;height:188px;background-color:var(--color-white-tint-2, #ececed);border-radius:50%}.component .progress-half-circle-wrapper .progress-circle .center-pipe{position:absolute;top:15px;left:15px;border-radius:50%;width:160px;height:160px;background-color:#fff}.component .progress-half-circle-wrapper .progress-circle .circle-clipper{border-radius:50%;width:188px;height:188px;position:absolute}.component .progress-half-circle-wrapper .progress-circle .progress-bar-val{position:absolute;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box}.component .progress-half-circle-wrapper .progress-circle .progress-val-0{transform:rotate(-90deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-1{transform:rotate(-88.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-2{transform:rotate(-86.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-3{transform:rotate(-84.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-4{transform:rotate(-82.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-5{transform:rotate(-81deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-6{transform:rotate(-79.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-7{transform:rotate(-77.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-8{transform:rotate(-75.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-9{transform:rotate(-73.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-10{transform:rotate(-72deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-11{transform:rotate(-70.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-12{transform:rotate(-68.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-13{transform:rotate(-66.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-14{transform:rotate(-64.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-15{transform:rotate(-63deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-16{transform:rotate(-61.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-17{transform:rotate(-59.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-18{transform:rotate(-57.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-19{transform:rotate(-55.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-20{transform:rotate(-54deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-21{transform:rotate(-52.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-22{transform:rotate(-50.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-23{transform:rotate(-48.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-24{transform:rotate(-46.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-25{transform:rotate(-45deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-26{transform:rotate(-43.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-27{transform:rotate(-41.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-28{transform:rotate(-39.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-29{transform:rotate(-37.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-30{transform:rotate(-36deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-31{transform:rotate(-34.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-32{transform:rotate(-32.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-33{transform:rotate(-30.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-34{transform:rotate(-28.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-35{transform:rotate(-27deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-36{transform:rotate(-25.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-37{transform:rotate(-23.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-38{transform:rotate(-21.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-39{transform:rotate(-19.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-40{transform:rotate(-18deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-41{transform:rotate(-16.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-42{transform:rotate(-14.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-43{transform:rotate(-12.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-44{transform:rotate(-10.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-45{transform:rotate(-9deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-46{transform:rotate(-7.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-47{transform:rotate(-5.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-48{transform:rotate(-3.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-49{transform:rotate(-1.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-50{transform:rotate(0)}.component .progress-half-circle-wrapper .progress-circle .progress-val-51{transform:rotate(1.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-52{transform:rotate(3.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-53{transform:rotate(5.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-54{transform:rotate(7.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-55{transform:rotate(9deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-56{transform:rotate(10.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-57{transform:rotate(12.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-58{transform:rotate(14.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-59{transform:rotate(16.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-60{transform:rotate(18deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-61{transform:rotate(19.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-62{transform:rotate(21.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-63{transform:rotate(23.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-64{transform:rotate(25.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-65{transform:rotate(27deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-66{transform:rotate(28.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-67{transform:rotate(30.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-68{transform:rotate(32.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-69{transform:rotate(34.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-70{transform:rotate(36deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-71{transform:rotate(37.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-72{transform:rotate(39.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-73{transform:rotate(41.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-74{transform:rotate(43.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-75{transform:rotate(45deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-76{transform:rotate(46.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-77{transform:rotate(48.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-78{transform:rotate(50.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-79{transform:rotate(52.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-80{transform:rotate(54deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-81{transform:rotate(55.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-82{transform:rotate(57.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-83{transform:rotate(59.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-84{transform:rotate(61.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-85{transform:rotate(63deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-86{transform:rotate(64.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-87{transform:rotate(66.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-88{transform:rotate(68.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-89{transform:rotate(70.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-90{transform:rotate(72deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-91{transform:rotate(73.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-92{transform:rotate(75.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-93{transform:rotate(77.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-94{transform:rotate(79.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-95{transform:rotate(81deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-96{transform:rotate(82.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-97{transform:rotate(84.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-98{transform:rotate(86.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-99{transform:rotate(88.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-100{transform:rotate(90deg)}.component .progress-half-circle-wrapper .text-wrapper{position:absolute;width:188px;height:94px;justify-content:center;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:end}.component .progress-half-circle-wrapper .text-wrapper .text{font-size:20px;font-style:normal;font-weight:500;color:var(--color-primary, #2188d9)}.component .progress-half-circle-wrapper .text-wrapper .progress-text{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
3435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduProgress, decorators: [{
3436
+ type: Component,
3437
+ args: [{ selector: 'zen-progress', template: "<div class=\"component\">\n <!-- Progres bar -->\n <div *ngIf=\"type == 'bar'\">\n <div class=\"progress-bar\">\n <div class=\"progress-bar-val\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n <span class=\"value-text\">{{value}}%</span>\n </div>\n </div>\n <div class=\"progress-text\">\n {{text}}\n </div>\n </div>\n\n <!-- Circle progress -->\n <div *ngIf=\"type == 'circle'\"\n class=\"progress-circle-wrapper\">\n\n\n <div class=\"progress-circle\"\n [class.show-full-right-side]=\"value>=50\">\n\n <div class=\"center-pipe\"></div>\n\n <div class=\"circle-clipper\">\n <div class=\"right-full-bar progress-val-50\"></div>\n <div class=\"progress-bar-val progress-val-{{value}}\"></div>\n </div>\n <div class=\"text-wrapper\">\n <div class=\"text\"> {{value}}%</div>\n <div class=\"progress-text\">{{text}}</div>\n </div>\n </div>\n </div>\n\n <!-- Half-Circle progress -->\n <div *ngIf=\"type == 'half-circle'\"\n class=\"progress-half-circle-wrapper\">\n\n <div class=\"progress-circle\">\n <div class=\"center-pipe\"></div>\n\n <div class=\"circle-clipper\">\n <div class=\"right-full-bar progress-val-50\"></div>\n <div class=\"progress-bar-val progress-val-{{value}}\"></div>\n </div>\n <div class=\"text-wrapper\">\n <div class=\"text\"> {{value}}%</div>\n <div class=\"progress-text\">{{text}}</div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".component{font-family:Roboto}.component .progress-bar{min-width:100px;width:100%;height:24px;border-radius:4px;background-color:var(--color-white-tint-2, #ececed);overflow:hidden;position:relative}.component .progress-bar .progress-bar-val{height:100%;display:block;width:0;background-color:var(--color-primary, #2188d9);line-height:24px;position:absolute;text-align:end;padding-right:5px;transition:width 1s}.component .progress-bar .progress-bar-val .value-text{color:var(--color-white-primary, #ffffff);font-size:14px;font-style:normal;font-weight:500}.component .progress-text{color:var(--color-white-tint-4, #d6d6d8);overflow:hidden;font-size:14px;font-style:normal;font-weight:400;margin-top:8px}.component .progress-circle-wrapper .progress-circle{position:relative;width:188px;height:188px;background-color:var(--color-white-tint-2, #ececed);border-radius:50%}.component .progress-circle-wrapper .progress-circle .center-pipe{position:absolute;top:15px;left:15px;border-radius:50%;width:160px;height:160px;background-color:#fff}.component .progress-circle-wrapper .progress-circle .circle-clipper{border-radius:50%;width:188px;height:188px;position:absolute;clip:rect(0,188px,188px,94px)}.component .progress-circle-wrapper .progress-circle .progress-bar-val{position:absolute;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box}.component .progress-circle-wrapper .progress-circle .progress-val-0{transform:rotate(0)}.component .progress-circle-wrapper .progress-circle .progress-val-1{transform:rotate(3.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-2{transform:rotate(7.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-3{transform:rotate(10.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-4{transform:rotate(14.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-5{transform:rotate(18deg)}.component .progress-circle-wrapper .progress-circle .progress-val-6{transform:rotate(21.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-7{transform:rotate(25.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-8{transform:rotate(28.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-9{transform:rotate(32.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-10{transform:rotate(36deg)}.component .progress-circle-wrapper .progress-circle .progress-val-11{transform:rotate(39.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-12{transform:rotate(43.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-13{transform:rotate(46.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-14{transform:rotate(50.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-15{transform:rotate(54deg)}.component .progress-circle-wrapper .progress-circle .progress-val-16{transform:rotate(57.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-17{transform:rotate(61.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-18{transform:rotate(64.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-19{transform:rotate(68.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-20{transform:rotate(72deg)}.component .progress-circle-wrapper .progress-circle .progress-val-21{transform:rotate(75.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-22{transform:rotate(79.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-23{transform:rotate(82.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-24{transform:rotate(86.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-25{transform:rotate(90deg)}.component .progress-circle-wrapper .progress-circle .progress-val-26{transform:rotate(93.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-27{transform:rotate(97.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-28{transform:rotate(100.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-29{transform:rotate(104.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-30{transform:rotate(108deg)}.component .progress-circle-wrapper .progress-circle .progress-val-31{transform:rotate(111.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-32{transform:rotate(115.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-33{transform:rotate(118.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-34{transform:rotate(122.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-35{transform:rotate(126deg)}.component .progress-circle-wrapper .progress-circle .progress-val-36{transform:rotate(129.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-37{transform:rotate(133.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-38{transform:rotate(136.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-39{transform:rotate(140.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-40{transform:rotate(144deg)}.component .progress-circle-wrapper .progress-circle .progress-val-41{transform:rotate(147.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-42{transform:rotate(151.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-43{transform:rotate(154.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-44{transform:rotate(158.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-45{transform:rotate(162deg)}.component .progress-circle-wrapper .progress-circle .progress-val-46{transform:rotate(165.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-47{transform:rotate(169.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-48{transform:rotate(172.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-49{transform:rotate(176.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-50{transform:rotate(180deg)}.component .progress-circle-wrapper .progress-circle .progress-val-51{transform:rotate(183.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-52{transform:rotate(187.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-53{transform:rotate(190.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-54{transform:rotate(194.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-55{transform:rotate(198deg)}.component .progress-circle-wrapper .progress-circle .progress-val-56{transform:rotate(201.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-57{transform:rotate(205.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-58{transform:rotate(208.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-59{transform:rotate(212.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-60{transform:rotate(216deg)}.component .progress-circle-wrapper .progress-circle .progress-val-61{transform:rotate(219.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-62{transform:rotate(223.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-63{transform:rotate(226.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-64{transform:rotate(230.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-65{transform:rotate(234deg)}.component .progress-circle-wrapper .progress-circle .progress-val-66{transform:rotate(237.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-67{transform:rotate(241.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-68{transform:rotate(244.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-69{transform:rotate(248.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-70{transform:rotate(252deg)}.component .progress-circle-wrapper .progress-circle .progress-val-71{transform:rotate(255.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-72{transform:rotate(259.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-73{transform:rotate(262.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-74{transform:rotate(266.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-75{transform:rotate(270deg)}.component .progress-circle-wrapper .progress-circle .progress-val-76{transform:rotate(273.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-77{transform:rotate(277.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-78{transform:rotate(280.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-79{transform:rotate(284.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-80{transform:rotate(288deg)}.component .progress-circle-wrapper .progress-circle .progress-val-81{transform:rotate(291.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-82{transform:rotate(295.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-83{transform:rotate(298.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-84{transform:rotate(302.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-85{transform:rotate(306deg)}.component .progress-circle-wrapper .progress-circle .progress-val-86{transform:rotate(309.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-87{transform:rotate(313.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-88{transform:rotate(316.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-89{transform:rotate(320.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-90{transform:rotate(324deg)}.component .progress-circle-wrapper .progress-circle .progress-val-91{transform:rotate(327.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-92{transform:rotate(331.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-93{transform:rotate(334.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-94{transform:rotate(338.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-95{transform:rotate(342deg)}.component .progress-circle-wrapper .progress-circle .progress-val-96{transform:rotate(345.6deg)}.component .progress-circle-wrapper .progress-circle .progress-val-97{transform:rotate(349.2deg)}.component .progress-circle-wrapper .progress-circle .progress-val-98{transform:rotate(352.8deg)}.component .progress-circle-wrapper .progress-circle .progress-val-99{transform:rotate(356.4deg)}.component .progress-circle-wrapper .progress-circle .progress-val-100{transform:rotate(360deg)}.component .progress-circle-wrapper .progress-circle .right-full-bar{display:none}.component .progress-circle-wrapper .progress-circle.show-full-right-side .circle-clipper{clip:rect(auto,auto,auto,auto)}.component .progress-circle-wrapper .progress-circle.show-full-right-side .right-full-bar{position:absolute;display:block;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box;transform:rotate(180deg)}.component .progress-circle-wrapper .text-wrapper{position:absolute;width:188px;height:188px;justify-content:center;z-index:10;display:flex;flex-direction:column;align-items:center}.component .progress-circle-wrapper .text-wrapper .text{font-size:32px;font-style:normal;font-weight:500;color:var(--color-primary, #2188d9)}.component .progress-circle-wrapper .text-wrapper .progress-text{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}.component .progress-half-circle-wrapper{height:94px;overflow:hidden}.component .progress-half-circle-wrapper .progress-circle{position:relative;width:188px;height:188px;background-color:var(--color-white-tint-2, #ececed);border-radius:50%}.component .progress-half-circle-wrapper .progress-circle .center-pipe{position:absolute;top:15px;left:15px;border-radius:50%;width:160px;height:160px;background-color:#fff}.component .progress-half-circle-wrapper .progress-circle .circle-clipper{border-radius:50%;width:188px;height:188px;position:absolute}.component .progress-half-circle-wrapper .progress-circle .progress-bar-val{position:absolute;clip:rect(0,94px,188px,0);width:188px;height:188px;border-radius:50%;border:15px solid var(--color-primary, #2188d9);box-sizing:border-box}.component .progress-half-circle-wrapper .progress-circle .progress-val-0{transform:rotate(-90deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-1{transform:rotate(-88.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-2{transform:rotate(-86.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-3{transform:rotate(-84.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-4{transform:rotate(-82.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-5{transform:rotate(-81deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-6{transform:rotate(-79.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-7{transform:rotate(-77.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-8{transform:rotate(-75.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-9{transform:rotate(-73.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-10{transform:rotate(-72deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-11{transform:rotate(-70.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-12{transform:rotate(-68.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-13{transform:rotate(-66.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-14{transform:rotate(-64.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-15{transform:rotate(-63deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-16{transform:rotate(-61.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-17{transform:rotate(-59.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-18{transform:rotate(-57.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-19{transform:rotate(-55.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-20{transform:rotate(-54deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-21{transform:rotate(-52.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-22{transform:rotate(-50.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-23{transform:rotate(-48.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-24{transform:rotate(-46.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-25{transform:rotate(-45deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-26{transform:rotate(-43.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-27{transform:rotate(-41.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-28{transform:rotate(-39.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-29{transform:rotate(-37.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-30{transform:rotate(-36deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-31{transform:rotate(-34.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-32{transform:rotate(-32.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-33{transform:rotate(-30.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-34{transform:rotate(-28.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-35{transform:rotate(-27deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-36{transform:rotate(-25.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-37{transform:rotate(-23.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-38{transform:rotate(-21.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-39{transform:rotate(-19.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-40{transform:rotate(-18deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-41{transform:rotate(-16.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-42{transform:rotate(-14.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-43{transform:rotate(-12.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-44{transform:rotate(-10.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-45{transform:rotate(-9deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-46{transform:rotate(-7.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-47{transform:rotate(-5.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-48{transform:rotate(-3.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-49{transform:rotate(-1.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-50{transform:rotate(0)}.component .progress-half-circle-wrapper .progress-circle .progress-val-51{transform:rotate(1.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-52{transform:rotate(3.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-53{transform:rotate(5.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-54{transform:rotate(7.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-55{transform:rotate(9deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-56{transform:rotate(10.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-57{transform:rotate(12.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-58{transform:rotate(14.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-59{transform:rotate(16.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-60{transform:rotate(18deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-61{transform:rotate(19.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-62{transform:rotate(21.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-63{transform:rotate(23.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-64{transform:rotate(25.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-65{transform:rotate(27deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-66{transform:rotate(28.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-67{transform:rotate(30.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-68{transform:rotate(32.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-69{transform:rotate(34.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-70{transform:rotate(36deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-71{transform:rotate(37.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-72{transform:rotate(39.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-73{transform:rotate(41.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-74{transform:rotate(43.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-75{transform:rotate(45deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-76{transform:rotate(46.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-77{transform:rotate(48.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-78{transform:rotate(50.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-79{transform:rotate(52.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-80{transform:rotate(54deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-81{transform:rotate(55.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-82{transform:rotate(57.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-83{transform:rotate(59.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-84{transform:rotate(61.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-85{transform:rotate(63deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-86{transform:rotate(64.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-87{transform:rotate(66.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-88{transform:rotate(68.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-89{transform:rotate(70.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-90{transform:rotate(72deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-91{transform:rotate(73.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-92{transform:rotate(75.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-93{transform:rotate(77.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-94{transform:rotate(79.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-95{transform:rotate(81deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-96{transform:rotate(82.8deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-97{transform:rotate(84.6deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-98{transform:rotate(86.4deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-99{transform:rotate(88.2deg)}.component .progress-half-circle-wrapper .progress-circle .progress-val-100{transform:rotate(90deg)}.component .progress-half-circle-wrapper .text-wrapper{position:absolute;width:188px;height:94px;justify-content:center;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:end}.component .progress-half-circle-wrapper .text-wrapper .text{font-size:20px;font-style:normal;font-weight:500;color:var(--color-primary, #2188d9)}.component .progress-half-circle-wrapper .text-wrapper .progress-text{color:var(--color-grey-primary, #4f4f4f);font-size:14px;font-style:normal;font-weight:400}\n"] }]
3438
+ }], propDecorators: { type: [{
3439
+ type: Input
3440
+ }], value: [{
3441
+ type: Input
3442
+ }], text: [{
3443
+ type: Input
3444
+ }] } });
3445
+
3446
+ class GeocodingService {
3447
+ setAPIKey(apiKey) {
3448
+ this._platform = new H.service.Platform({
3449
+ apikey: apiKey
3450
+ });
3451
+ }
3452
+ geocode(searchText) {
3453
+ return __awaiter(this, void 0, void 0, function* () {
3454
+ return new Promise((resolve, reject) => {
3455
+ if (!this._platform) {
3456
+ reject("API KEY NOT SET");
3457
+ return;
3458
+ }
3459
+ const geocoder = this._platform.getGeocodingService();
3460
+ geocoder.geocode({ searchText: searchText }, (res) => {
3461
+ let locations = res.Response.View[0] ? res.Response.View[0].Result : [];
3462
+ let outItems = new Array();
3463
+ let boxOffset = 0.001;
3464
+ for (let location of locations) {
3465
+ let lat = location.Location.DisplayPosition.Latitude;
3466
+ let lng = location.Location.DisplayPosition.Longitude;
3467
+ let p1 = new H.geo.Point(lat - boxOffset, lng - boxOffset);
3468
+ let p2 = new H.geo.Point(lat + boxOffset, lng + boxOffset);
3469
+ let bounds = H.geo.Rect.coverPoints([p1, p2]);
3470
+ let street = location.Location.Address.Street;
3471
+ if (location.Location.Address.HouseNumber) {
3472
+ street += " " + location.Location.Address.HouseNumber;
3473
+ }
3474
+ outItems.push({
3475
+ name: location.Location.Address.Label,
3476
+ city: location.Location.Address.City,
3477
+ country: location.Location.Address.Country,
3478
+ postalCode: location.Location.Address.PostalCode,
3479
+ state: location.Location.Address.State,
3480
+ street: street,
3481
+ bounds: {
3482
+ xmin: bounds.getLeft(),
3483
+ xmax: bounds.getRight(),
3484
+ ymin: Math.min(bounds.getBottom(), bounds.getTop()),
3485
+ ymax: Math.max(bounds.getBottom(), bounds.getTop())
3486
+ }
3487
+ });
3488
+ }
3489
+ resolve(outItems);
3490
+ }, (e) => {
3491
+ console.warn(e);
3492
+ resolve([]);
3493
+ });
3494
+ });
3495
+ });
3496
+ }
3497
+ }
3498
+ GeocodingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: GeocodingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3499
+ GeocodingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: GeocodingService, providedIn: 'root' });
3500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: GeocodingService, decorators: [{
3501
+ type: Injectable,
3502
+ args: [{
3503
+ providedIn: 'root'
3504
+ }]
3505
+ }] });
3506
+
3507
+ class ZenduLocationSearch {
3508
+ constructor(_geocoding, _cdRef) {
3509
+ this._geocoding = _geocoding;
3510
+ this._cdRef = _cdRef;
3511
+ this.displaySearchIcon = true;
3512
+ this.addressChange = new EventEmitter();
3513
+ this.materialStyle = true;
3514
+ this.placeholder = "Search address";
3515
+ this.disabled = false;
3516
+ this.onSelect = new EventEmitter;
3517
+ // it will apply to input element text and icon color:
3518
+ // ie. input like { color: blue}
3519
+ this.customStyles = {};
3520
+ this.addressSearchChanged = new Subject();
3521
+ this.isSearching = false;
3522
+ this.ignoreFirstLoad = false;
3523
+ this.addressList = [];
3524
+ this.addressSearchChanged
3525
+ .pipe(debounceTime(200), distinctUntilChanged())
3526
+ .subscribe((addressSearch) => {
3527
+ this.address = addressSearch;
3528
+ this.isSearching = true;
3529
+ if (this._cancelation) {
3530
+ // cancel previous
3531
+ this._cancelation.cancelled = true;
3532
+ }
3533
+ this._cancelation = { cancelled: false };
3534
+ this.makeSearch(this._cancelation);
3535
+ });
3536
+ }
3537
+ /**
3538
+ * HERE MAPS API Key
3539
+ */
3540
+ set apiKey(apiKey) {
3541
+ this._geocoding.setAPIKey(apiKey);
3542
+ }
3543
+ ngOnChanges(changes) {
3544
+ return __awaiter(this, void 0, void 0, function* () {
3545
+ if (changes['address'] && this.address) {
3546
+ this._cancelation = { cancelled: false };
3547
+ yield this.makeSearch(this._cancelation);
3548
+ const address = this.addressList.find(addr => addr.name === this.address);
3549
+ if (address) {
3550
+ this.selectAddress(address);
3551
+ }
3552
+ }
3553
+ });
3554
+ }
3555
+ addressChanged(text) {
3556
+ this.isSearching = true;
3557
+ this.addressChange.emit(text);
3558
+ this.addressSearchChanged.next(text);
3559
+ this._cdRef.detectChanges();
3560
+ }
3561
+ makeSearch(cancellation) {
3562
+ return __awaiter(this, void 0, void 0, function* () {
3563
+ try {
3564
+ if (!this.ignoreFirstLoad) {
3565
+ this.ignoreFirstLoad = true;
3566
+ return;
3567
+ }
3568
+ this.addressList = [];
3569
+ if (!this.address) {
3570
+ this.isSearching = false;
3571
+ return;
3572
+ }
3573
+ this.addressList = [];
3574
+ let locations = yield this._geocoding.geocode(this.address);
3575
+ if (this._cancelation.cancelled) {
3576
+ // request cancelled
3577
+ return;
3578
+ }
3579
+ for (let location of locations) {
3580
+ this.addressList.push({
3581
+ name: location.name,
3582
+ bounds: location.bounds
3583
+ });
3584
+ }
3585
+ this.addressList = [...new Map(this.addressList.map((item) => [item.name, item])).values()];
3586
+ if (this.addressList.length > 20) {
3587
+ this.addressList = this.addressList.slice(0, 20);
3588
+ }
3589
+ this.isSearching = false;
3590
+ }
3591
+ catch (err) {
3592
+ console.error(err);
3593
+ }
3594
+ finally {
3595
+ this._cdRef.detectChanges();
3596
+ }
3597
+ });
3598
+ }
3599
+ selectAddress(address) {
3600
+ this.address = address.name;
3601
+ if (this.onSelect) {
3602
+ this.addressList = [];
3603
+ this.onSelect.emit(address);
3604
+ }
3605
+ }
3606
+ }
3607
+ ZenduLocationSearch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduLocationSearch, deps: [{ token: GeocodingService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3608
+ ZenduLocationSearch.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ZenduLocationSearch, selector: "zen-location-search", inputs: { apiKey: "apiKey", address: "address", displaySearchIcon: "displaySearchIcon", materialStyle: "materialStyle", placeholder: "placeholder", disabled: "disabled", customStyles: "customStyles" }, outputs: { addressChange: "addressChange", onSelect: "onSelect" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"component\">\n\n <div class=\"search-input-wrapper\"\n [class.boundaries]=\"!materialStyle\">\n <zen-icon src=\"https://storage.googleapis.com/ng-zenduit/icon/search.svg\"\n class=\"search-icon\"\n *ngIf=\"displaySearchIcon\"\n [style]=\"{'background-color': customStyles.color}\"></zen-icon>\n\n <input type=\"text\"\n class=\"material-input\"\n [style]=\"customStyles\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"address\"\n [ngClass]=\"{'no-icon': !displaySearchIcon}\"\n (ngModelChange)='addressChanged($event)'>\n </div>\n\n <div class=\"search-list\"\n [class.boundaries]=\"!materialStyle\"\n *ngIf=\"address\"\n appClickOutside\n (clickOutside)=\"addressList = [];\">\n <ul class=\"search-item-list\"\n *ngIf=\"addressList.length || isSearching\">\n <li *ngIf=\"isSearching\">Searching</li>\n <div *ngIf=\"!isSearching\">\n <li *ngFor=\"let address of addressList\"\n (click)=\"selectAddress(address)\">\n {{address.name}}\n </li>\n </div>\n </ul>\n </div>\n</div>\n", styles: [".component,.component .search-input-wrapper{position:relative}.component .search-input-wrapper .search-icon{position:absolute;left:4px;background-color:var(--color-white-tint-6, #bebebe)}.component .search-input-wrapper .material-input{padding-left:38px}.component .search-input-wrapper .material-input.no-icon{padding-left:8px}.component .search-input-wrapper .material-input.no-icon::placeholder{font-size:14px}.component .search-input-wrapper.boundaries .material-input{border:1px solid var(--color-white-tint-4, #d6d6d8);padding-top:8px;border-radius:4px;height:40px;font-style:normal;font-weight:400;font-size:14px;line-height:130%;color:var(--color-grey-primary, #4f4f4f)}.component .search-input-wrapper.boundaries .material-input:hover{border-color:#b8b9bc}.component .search-input-wrapper.boundaries .material-input:focus-within{box-shadow:0 0 2px 2px #2188d94d}.component .search-input-wrapper.boundaries .search-icon{top:8px;left:8px}.component .search-list{position:absolute;top:40px;left:16px;z-index:1;min-width:278px;max-width:420px;box-shadow:0 4px 10px #060c1b26;background:white}.component .search-list.boundaries{top:45px}.component .search-list ul.search-item-list{list-style-type:none;max-width:420px;max-height:30vh;overflow-y:scroll;overflow-x:inherit;margin:0;padding:5px 10px}.component .search-list ul.search-item-list li{background-color:#fff;padding:5px 10px;align-items:flex-start;color:#828282;cursor:pointer;width:100%;font-family:Roboto;font-style:normal;font-weight:400;font-size:14px}.component .search-list ul.search-item-list li:hover{text-decoration:none;background-color:#f5f5f5}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZenduIconComponent, selector: "zen-icon", inputs: ["src"] }] });
3609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ZenduLocationSearch, decorators: [{
3610
+ type: Component,
3611
+ args: [{ selector: 'zen-location-search', template: "<div class=\"component\">\n\n <div class=\"search-input-wrapper\"\n [class.boundaries]=\"!materialStyle\">\n <zen-icon src=\"https://storage.googleapis.com/ng-zenduit/icon/search.svg\"\n class=\"search-icon\"\n *ngIf=\"displaySearchIcon\"\n [style]=\"{'background-color': customStyles.color}\"></zen-icon>\n\n <input type=\"text\"\n class=\"material-input\"\n [style]=\"customStyles\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"address\"\n [ngClass]=\"{'no-icon': !displaySearchIcon}\"\n (ngModelChange)='addressChanged($event)'>\n </div>\n\n <div class=\"search-list\"\n [class.boundaries]=\"!materialStyle\"\n *ngIf=\"address\"\n appClickOutside\n (clickOutside)=\"addressList = [];\">\n <ul class=\"search-item-list\"\n *ngIf=\"addressList.length || isSearching\">\n <li *ngIf=\"isSearching\">Searching</li>\n <div *ngIf=\"!isSearching\">\n <li *ngFor=\"let address of addressList\"\n (click)=\"selectAddress(address)\">\n {{address.name}}\n </li>\n </div>\n </ul>\n </div>\n</div>\n", styles: [".component,.component .search-input-wrapper{position:relative}.component .search-input-wrapper .search-icon{position:absolute;left:4px;background-color:var(--color-white-tint-6, #bebebe)}.component .search-input-wrapper .material-input{padding-left:38px}.component .search-input-wrapper .material-input.no-icon{padding-left:8px}.component .search-input-wrapper .material-input.no-icon::placeholder{font-size:14px}.component .search-input-wrapper.boundaries .material-input{border:1px solid var(--color-white-tint-4, #d6d6d8);padding-top:8px;border-radius:4px;height:40px;font-style:normal;font-weight:400;font-size:14px;line-height:130%;color:var(--color-grey-primary, #4f4f4f)}.component .search-input-wrapper.boundaries .material-input:hover{border-color:#b8b9bc}.component .search-input-wrapper.boundaries .material-input:focus-within{box-shadow:0 0 2px 2px #2188d94d}.component .search-input-wrapper.boundaries .search-icon{top:8px;left:8px}.component .search-list{position:absolute;top:40px;left:16px;z-index:1;min-width:278px;max-width:420px;box-shadow:0 4px 10px #060c1b26;background:white}.component .search-list.boundaries{top:45px}.component .search-list ul.search-item-list{list-style-type:none;max-width:420px;max-height:30vh;overflow-y:scroll;overflow-x:inherit;margin:0;padding:5px 10px}.component .search-list ul.search-item-list li{background-color:#fff;padding:5px 10px;align-items:flex-start;color:#828282;cursor:pointer;width:100%;font-family:Roboto;font-style:normal;font-weight:400;font-size:14px}.component .search-list ul.search-item-list li:hover{text-decoration:none;background-color:#f5f5f5}\n"] }]
3612
+ }], ctorParameters: function () { return [{ type: GeocodingService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { apiKey: [{
3613
+ type: Input
3614
+ }], address: [{
3615
+ type: Input
3616
+ }], displaySearchIcon: [{
3617
+ type: Input
3618
+ }], addressChange: [{
3619
+ type: Output
3620
+ }], materialStyle: [{
3621
+ type: Input
3622
+ }], placeholder: [{
3623
+ type: Input
3624
+ }], disabled: [{
3625
+ type: Input
3626
+ }], onSelect: [{
3627
+ type: Output
3628
+ }], customStyles: [{
3629
+ type: Input
3630
+ }] } });
3631
+
3632
+ class NgZenduitModule {
3633
+ }
3634
+ NgZenduitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgZenduitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3635
+ NgZenduitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NgZenduitModule, declarations: [ZenduCheckboxComponent,
3636
+ ZenduToggleComponent,
3637
+ ZenduToggleSlideComponent,
3638
+ ZenduSearchBoxComponent,
3639
+ ZenduSelectComponent,
3640
+ ZenduSelectOptionDirective,
3641
+ ZenduSelectValueDirective,
3642
+ ZenduDatepickerComponent,
3643
+ ZenduFilterComponent,
3644
+ ZenduPaginationBarComponent,
3645
+ ZenduColumnConfigurationComponent,
3646
+ ZenduSortHeaderComponent,
3647
+ ZenduPhoneInputComponent,
3648
+ ZenduColorPickerComponent,
3649
+ ZenduRadioButtonComponent,
3650
+ ZenduIconComponent,
3651
+ ZenduCardBlockComponent,
3652
+ ZenduMapPreviewComponent,
3653
+ ZenduSpinner,
3654
+ ZenduDocScanner,
3655
+ ZenduBreadcrumbs,
3656
+ ZenduMapComponent,
3657
+ ZenduFileUpload,
3658
+ ZenduProgress,
3659
+ ZenduLocationSearch], imports: [CommonModule,
3660
+ FormsModule,
3661
+ DragDropModule], exports: [ZenduCheckboxComponent,
3662
+ ZenduToggleComponent,
3663
+ ZenduToggleSlideComponent,
3664
+ ZenduSearchBoxComponent,
3665
+ ZenduSelectComponent,
3666
+ ZenduSelectOptionDirective,
3667
+ ZenduSelectValueDirective,
3668
+ ZenduDatepickerComponent,
3669
+ ZenduFilterComponent,
3670
+ ZenduPaginationBarComponent,
3671
+ ZenduColumnConfigurationComponent,
3672
+ ZenduSortHeaderComponent,
3673
+ ZenduPhoneInputComponent,
3674
+ ZenduColorPickerComponent,
3675
+ ZenduRadioButtonComponent,
3676
+ ZenduIconComponent,
3677
+ ZenduCardBlockComponent,
3678
+ ZenduMapPreviewComponent,
3679
+ ZenduSpinner,
3680
+ ZenduDocScanner,
3681
+ ZenduBreadcrumbs,
3682
+ ZenduMapComponent,
3683
+ ZenduFileUpload,
3684
+ ZenduProgress,
3685
+ ZenduLocationSearch] });
3686
+ NgZenduitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgZenduitModule, providers: [
3687
+ OpenCVService
3688
+ ], imports: [CommonModule,
3689
+ FormsModule,
3690
+ DragDropModule] });
3691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NgZenduitModule, decorators: [{
3692
+ type: NgModule,
3693
+ args: [{
3694
+ declarations: [
3695
+ ZenduCheckboxComponent,
3696
+ ZenduToggleComponent,
3697
+ ZenduToggleSlideComponent,
3698
+ ZenduSearchBoxComponent,
3699
+ ZenduSelectComponent,
3700
+ ZenduSelectOptionDirective,
3701
+ ZenduSelectValueDirective,
3702
+ ZenduDatepickerComponent,
3703
+ ZenduFilterComponent,
3704
+ ZenduPaginationBarComponent,
3705
+ ZenduColumnConfigurationComponent,
3706
+ ZenduSortHeaderComponent,
3707
+ ZenduPhoneInputComponent,
3708
+ ZenduColorPickerComponent,
3709
+ ZenduRadioButtonComponent,
3710
+ ZenduIconComponent,
3711
+ ZenduCardBlockComponent,
3712
+ ZenduMapPreviewComponent,
3713
+ ZenduSpinner,
3714
+ ZenduDocScanner,
3715
+ ZenduBreadcrumbs,
3716
+ ZenduMapComponent,
3717
+ ZenduFileUpload,
3718
+ ZenduProgress,
3719
+ ZenduLocationSearch
3720
+ ],
3721
+ providers: [
3722
+ OpenCVService
3723
+ ],
3724
+ imports: [
3725
+ CommonModule,
3726
+ FormsModule,
3727
+ DragDropModule
3728
+ ],
3729
+ exports: [
3730
+ ZenduCheckboxComponent,
3731
+ ZenduToggleComponent,
3732
+ ZenduToggleSlideComponent,
3733
+ ZenduSearchBoxComponent,
3734
+ ZenduSelectComponent,
3735
+ ZenduSelectOptionDirective,
3736
+ ZenduSelectValueDirective,
3737
+ ZenduDatepickerComponent,
3738
+ ZenduFilterComponent,
3739
+ ZenduPaginationBarComponent,
3740
+ ZenduColumnConfigurationComponent,
3741
+ ZenduSortHeaderComponent,
3742
+ ZenduPhoneInputComponent,
3743
+ ZenduColorPickerComponent,
3744
+ ZenduRadioButtonComponent,
3745
+ ZenduIconComponent,
3746
+ ZenduCardBlockComponent,
3747
+ ZenduMapPreviewComponent,
3748
+ ZenduSpinner,
3749
+ ZenduDocScanner,
3750
+ ZenduBreadcrumbs,
3751
+ ZenduMapComponent,
3752
+ ZenduFileUpload,
3753
+ ZenduProgress,
3754
+ ZenduLocationSearch
3755
+ ]
3756
+ }]
3757
+ }] });
3758
+
3759
+ /*
3760
+ * Public API of ng-zenduit
3761
+ */
3762
+
3763
+ /**
3764
+ * Generated bundle index. Do not edit.
3765
+ */
3766
+
3767
+ export { DATEPICKER_POSITION, NgZenduitModule, ZenNotifyService, ZenduBreadcrumbs, ZenduCardBlockComponent, ZenduCheckboxComponent, ZenduColorPickerComponent, ZenduColumnConfigurationComponent, ZenduDatepickerComponent, ZenduDocScanner, ZenduFileUpload, ZenduFilterComponent, ZenduIconComponent, ZenduLocationSearch, ZenduMapComponent, ZenduMapPreviewComponent, ZenduPaginationBarComponent, ZenduPhoneInputComponent, ZenduProgress, ZenduRadioButtonComponent, ZenduSearchBoxComponent, ZenduSelectComponent, ZenduSelectOptionDirective, ZenduSelectValueDirective, ZenduSortHeaderComponent, ZenduSpinner, ZenduToggleComponent, ZenduToggleSlideComponent };
3768
+ //# sourceMappingURL=ng-zenduit.mjs.map