@smallpearl/ngx-helper 0.29.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -0
- package/core/index.d.ts +2 -0
- package/core/src/ngx-helper.d.ts +7 -0
- package/core/src/version.d.ts +1 -0
- package/entity-field/index.d.ts +2 -0
- package/entity-field/src/entity-field-spec.d.ts +69 -0
- package/entity-field/src/provider.d.ts +27 -0
- package/fesm2022/smallpearl-ngx-helper-core.mjs +23 -0
- package/fesm2022/smallpearl-ngx-helper-core.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +112 -0
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-forms.mjs +112 -0
- package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +108 -0
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-locale.mjs +296 -0
- package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +504 -0
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +184 -0
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +1486 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +800 -0
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +328 -0
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +468 -0
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +854 -0
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +930 -0
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +926 -0
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs +111 -0
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +384 -0
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -0
- package/fesm2022/smallpearl-ngx-helper.mjs +13 -0
- package/fesm2022/smallpearl-ngx-helper.mjs.map +1 -0
- package/forms/index.d.ts +1 -0
- package/forms/src/validation-error-handler.d.ts +52 -0
- package/hover-dropdown/index.d.ts +1 -0
- package/hover-dropdown/src/hover-dropdown.directive.d.ts +41 -0
- package/index.d.ts +5 -0
- package/locale/index.d.ts +5 -0
- package/locale/src/currency.pipe.d.ts +14 -0
- package/locale/src/date.pipe.d.ts +14 -0
- package/locale/src/format-currency.d.ts +1 -0
- package/locale/src/format-date.d.ts +2 -0
- package/locale/src/is-empty.d.ts +1 -0
- package/locale/src/providers.d.ts +20 -0
- package/mat-busy-wheel/index.d.ts +4 -0
- package/mat-busy-wheel/src/busy-wheel-op.d.ts +65 -0
- package/mat-busy-wheel/src/busy-wheel.component.d.ts +12 -0
- package/mat-busy-wheel/src/busy-wheel.service.d.ts +42 -0
- package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +35 -0
- package/mat-context-menu/index.d.ts +1 -0
- package/mat-context-menu/src/mat-context-menu.component.d.ts +54 -0
- package/mat-entity-crud/index.d.ts +5 -0
- package/mat-entity-crud/src/default-config.d.ts +9 -0
- package/mat-entity-crud/src/form-view-host.component.d.ts +34 -0
- package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +95 -0
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +66 -0
- package/mat-entity-crud/src/mat-entity-crud-types.d.ts +141 -0
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +267 -0
- package/mat-entity-crud/src/preview-host.component.d.ts +19 -0
- package/mat-entity-crud/src/preview-pane.component.d.ts +27 -0
- package/mat-entity-crud/src/providers.d.ts +3 -0
- package/mat-entity-list/index.d.ts +3 -0
- package/mat-entity-list/src/config.d.ts +6 -0
- package/mat-entity-list/src/mat-entity-list-types.d.ts +53 -0
- package/mat-entity-list/src/mat-entity-list.component.d.ts +209 -0
- package/mat-entity-list/src/providers.d.ts +3 -0
- package/mat-file-input/README.md +63 -0
- package/mat-file-input/index.d.ts +1 -0
- package/mat-file-input/src/mat-file-input.component.d.ts +58 -0
- package/mat-form-error/README.md +306 -0
- package/mat-form-error/index.d.ts +6 -0
- package/mat-form-error/src/locales/en.d.ts +4 -0
- package/mat-form-error/src/locales/hu.d.ts +4 -0
- package/mat-form-error/src/locales/index.d.ts +3 -0
- package/mat-form-error/src/locales/pt-br.d.ts +4 -0
- package/mat-form-error/src/ngx-error-list.component.d.ts +9 -0
- package/mat-form-error/src/ngx-mat-error-control.d.ts +17 -0
- package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +30 -0
- package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +8 -0
- package/mat-form-error/src/ngx-mat-errors.component.d.ts +23 -0
- package/mat-form-error/src/types.d.ts +68 -0
- package/mat-form-error/src/utils/coerce-to-observable.d.ts +3 -0
- package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +2 -0
- package/mat-form-error/src/utils/find-error-for-control.d.ts +9 -0
- package/mat-form-error/src/utils/get-abstract-controls.d.ts +3 -0
- package/mat-form-error/src/utils/get-control-with-error.d.ts +3 -0
- package/mat-select-entity/index.d.ts +2 -0
- package/mat-select-entity/src/mat-select-entity.component.d.ts +207 -0
- package/mat-select-entity/src/providers.d.ts +9 -0
- package/mat-side-menu-layout/index.d.ts +6 -0
- package/mat-side-menu-layout/src/layout.service.d.ts +23 -0
- package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +39 -0
- package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +18 -0
- package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +36 -0
- package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +66 -0
- package/mat-side-menu-layout/src/nav-item.d.ts +10 -0
- package/mat-tel-input/README.md +18 -0
- package/mat-tel-input/index.d.ts +2 -0
- package/mat-tel-input/src/country-codes.d.ts +5 -0
- package/mat-tel-input/src/mat-telephone.component.d.ts +129 -0
- package/mat-tel-input/src/providers.d.ts +38 -0
- package/ngx-helper.d.ts +2 -0
- package/package.json +114 -0
- package/public-api.d.ts +1 -0
- package/sideload/index.d.ts +1 -0
- package/sideload/src/sideload.d.ts +17 -0
- package/stationary-with-line-items/index.d.ts +1 -0
- package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +74 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { tap, finalize } from 'rxjs';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, Component, Injectable, Directive } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/material/progress-spinner';
|
|
5
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
6
|
+
|
|
7
|
+
class SPMatBusyWheelComponent {
|
|
8
|
+
elRef;
|
|
9
|
+
wheelId = input('id_busy-wheel');
|
|
10
|
+
viewport = input(false);
|
|
11
|
+
constructor(elRef) {
|
|
12
|
+
this.elRef = elRef;
|
|
13
|
+
}
|
|
14
|
+
ngOnInit() { }
|
|
15
|
+
ngOnDestroy() { }
|
|
16
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatBusyWheelComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.6", type: SPMatBusyWheelComponent, isStandalone: true, selector: "sp-mat-busy-wheel", inputs: { wheelId: { classPropertyName: "wheelId", publicName: "wheelId", isSignal: true, isRequired: false, transformFunction: null }, viewport: { classPropertyName: "viewport", publicName: "viewport", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
18
|
+
<div class="busy-wheel-wrapper">
|
|
19
|
+
<span>
|
|
20
|
+
<div class="busy-wheel-container" id="{{ wheelId() }}">
|
|
21
|
+
<!--
|
|
22
|
+
We can replace mat-spinner with the following div, which will
|
|
23
|
+
remove the MatProgressSpinnerModule dependency. But the downside is
|
|
24
|
+
that the spinner will not follow the global material theme.
|
|
25
|
+
<div class="busy-wheel"></div>
|
|
26
|
+
-->
|
|
27
|
+
<mat-spinner mode="indeterminate" diameter="32"></mat-spinner>
|
|
28
|
+
</div>
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
`, isInline: true, styles: [".busy-wheel-wrapper{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;z-index:9999999;background-color:#ffffff59}.busy-wheel-container{display:flex;position:relative;top:0;height:100%;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
32
|
+
}
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatBusyWheelComponent, decorators: [{
|
|
34
|
+
type: Component,
|
|
35
|
+
args: [{ selector: 'sp-mat-busy-wheel', imports: [MatProgressSpinnerModule], template: `
|
|
36
|
+
<div class="busy-wheel-wrapper">
|
|
37
|
+
<span>
|
|
38
|
+
<div class="busy-wheel-container" id="{{ wheelId() }}">
|
|
39
|
+
<!--
|
|
40
|
+
We can replace mat-spinner with the following div, which will
|
|
41
|
+
remove the MatProgressSpinnerModule dependency. But the downside is
|
|
42
|
+
that the spinner will not follow the global material theme.
|
|
43
|
+
<div class="busy-wheel"></div>
|
|
44
|
+
-->
|
|
45
|
+
<mat-spinner mode="indeterminate" diameter="32"></mat-spinner>
|
|
46
|
+
</div>
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
`, styles: [".busy-wheel-wrapper{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;z-index:9999999;background-color:#ffffff59}.busy-wheel-container{display:flex;position:relative;top:0;height:100%;width:100%}\n"] }]
|
|
50
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
51
|
+
|
|
52
|
+
const BACKDROP_DIV_ID = 'id_busy-wheel-backdrop';
|
|
53
|
+
const BUSY_WHEEL_DIV_ID = 'id_busy-wheel';
|
|
54
|
+
const VIEWPORT_BUSY_WHEEL_STYLE_ID = 'id_viewport_busy_wheel_style';
|
|
55
|
+
const VIEWPORT_BUSY_WHEEL_STYLE = `
|
|
56
|
+
.busy-wheel-wrapper {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
z-index: 9999999;
|
|
66
|
+
background-color: rgba(255, 255, 255, 0.35);
|
|
67
|
+
}
|
|
68
|
+
.busy-wheel-container {
|
|
69
|
+
display: flex;
|
|
70
|
+
position: relative;
|
|
71
|
+
top: 0;
|
|
72
|
+
height: 100%;
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
.busy-wheel,
|
|
76
|
+
.busy-wheel:after {
|
|
77
|
+
border-radius: 50%;
|
|
78
|
+
width: 4em;
|
|
79
|
+
height: 4em;
|
|
80
|
+
}
|
|
81
|
+
.busy-wheel {
|
|
82
|
+
margin: auto auto;
|
|
83
|
+
font-size: 8px;
|
|
84
|
+
position: relative;
|
|
85
|
+
text-indent: -9999em;
|
|
86
|
+
border-top: 0.5em solid rgba(0, 0, 0, 0.8);
|
|
87
|
+
border-right: 0.5em solid rgba(0, 0, 0, 0.8);
|
|
88
|
+
border-bottom: 0.5em solid rgba(0, 0, 0, 0.8);
|
|
89
|
+
border-left: 0.5em solid #ffffff;
|
|
90
|
+
-webkit-transform: translateZ(0);
|
|
91
|
+
-ms-transform: translateZ(0);
|
|
92
|
+
transform: translateZ(0);
|
|
93
|
+
-webkit-animation: load8 1.1s infinite linear;
|
|
94
|
+
animation: load8 1.1s infinite linear;
|
|
95
|
+
}
|
|
96
|
+
@-webkit-keyframes load8 {
|
|
97
|
+
0% {
|
|
98
|
+
-webkit-transform: rotate(0deg);
|
|
99
|
+
transform: rotate(0deg);
|
|
100
|
+
}
|
|
101
|
+
100% {
|
|
102
|
+
-webkit-transform: rotate(360deg);
|
|
103
|
+
transform: rotate(360deg);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
@keyframes load8 {
|
|
107
|
+
0% {
|
|
108
|
+
-webkit-transform: rotate(0deg);
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
100% {
|
|
113
|
+
-webkit-transform: rotate(360deg);
|
|
114
|
+
transform: rotate(360deg);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
const VIEWPORT_BUSY_WHEEL_FRAGMENT_TEMPLATE = `
|
|
119
|
+
<div class="busy-wheel-wrapper" id="{wheelId}">
|
|
120
|
+
<div class="{containerClass}" style="display: flex; position: relative; top: 0; width: 100vw; height: 100vh; z-index: 9999999;">
|
|
121
|
+
<div class="busy-wheel"></div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
125
|
+
;
|
|
126
|
+
class BusyWheelService {
|
|
127
|
+
defaultBusyWheelDir;
|
|
128
|
+
namedBusyWheelDirs = new Map();
|
|
129
|
+
wheelComponents = new Map();
|
|
130
|
+
static s_instance;
|
|
131
|
+
constructor() { }
|
|
132
|
+
static getInstance() {
|
|
133
|
+
if (!this.s_instance) {
|
|
134
|
+
this.s_instance = new BusyWheelService();
|
|
135
|
+
}
|
|
136
|
+
return this.s_instance;
|
|
137
|
+
}
|
|
138
|
+
show(id) {
|
|
139
|
+
if (id) {
|
|
140
|
+
const idParts = id.split(',');
|
|
141
|
+
idParts.forEach(id => {
|
|
142
|
+
const trimmedId = id.trim();
|
|
143
|
+
const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);
|
|
144
|
+
if (busyWheelDirs) {
|
|
145
|
+
const containers = Array.isArray(busyWheelDirs) ? busyWheelDirs : [busyWheelDirs];
|
|
146
|
+
containers.forEach((busyWheelDir, index) => {
|
|
147
|
+
const wheelId = `${trimmedId}_${index}`;
|
|
148
|
+
//console.log(`showing busy-wheel: ${wheelId} for busyWheel: ${busyWheelDir.hostBusyWheel}`);
|
|
149
|
+
const busyWheelComponentRef = busyWheelDir.viewContainerRef.createComponent(SPMatBusyWheelComponent);
|
|
150
|
+
busyWheelComponentRef.setInput('wheelId', wheelId);
|
|
151
|
+
// Append the component as a child of the element with hostBusyWheel directive.
|
|
152
|
+
busyWheelDir.renderer2.appendChild(busyWheelDir.viewContainerRef.element.nativeElement, busyWheelComponentRef.injector.get(SPMatBusyWheelComponent).elRef.nativeElement);
|
|
153
|
+
// Save the position explicit css style of the element if one was set
|
|
154
|
+
let oldStyles = new Array();
|
|
155
|
+
if (busyWheelDir.viewContainerRef.element.nativeElement.style.position) {
|
|
156
|
+
oldStyles.push({
|
|
157
|
+
style: 'position',
|
|
158
|
+
value: busyWheelDir.viewContainerRef.element.nativeElement.style.position
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
// Set the element's child controls's poisitioning to 'relative'
|
|
162
|
+
busyWheelDir.viewContainerRef.element.nativeElement.style.position = 'relative';
|
|
163
|
+
this.wheelComponents.set(wheelId, {
|
|
164
|
+
component: busyWheelComponentRef,
|
|
165
|
+
oldStyles: []
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
// viewport global busy-wheel
|
|
173
|
+
const busyWheel = this.createViewportBusyWheel('busy-wheel-container', undefined);
|
|
174
|
+
const backdrop = this.createBackdrop();
|
|
175
|
+
backdrop.firstChild?.appendChild(busyWheel);
|
|
176
|
+
const viewportBusyWheelStyle = backdrop.querySelector('style');
|
|
177
|
+
if (viewportBusyWheelStyle) {
|
|
178
|
+
document.head.appendChild(viewportBusyWheelStyle);
|
|
179
|
+
}
|
|
180
|
+
const viewportBusyWheelDiv = backdrop.querySelector('body')?.firstChild;
|
|
181
|
+
if (viewportBusyWheelDiv) {
|
|
182
|
+
document.body.appendChild(viewportBusyWheelDiv);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
hide(id) {
|
|
187
|
+
if (id) {
|
|
188
|
+
const idParts = id.split(',');
|
|
189
|
+
idParts.forEach(id => {
|
|
190
|
+
const trimmedId = id.trim();
|
|
191
|
+
const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);
|
|
192
|
+
if (busyWheelDirs) {
|
|
193
|
+
const containers = Array.isArray(busyWheelDirs) ? busyWheelDirs : [busyWheelDirs];
|
|
194
|
+
containers.forEach((busyWheelDir, index) => {
|
|
195
|
+
const wheelId = `${trimmedId}_${index}`;
|
|
196
|
+
const wheelData = this.wheelComponents.get(wheelId);
|
|
197
|
+
if (wheelData) {
|
|
198
|
+
//console.log(`destroying busy-wheel: ${wheelId}`);
|
|
199
|
+
wheelData.component.destroy();
|
|
200
|
+
this.wheelComponents.delete(wheelId);
|
|
201
|
+
if (wheelData?.oldStyles && wheelData.oldStyles.length) {
|
|
202
|
+
// Remove position: relative style that we added
|
|
203
|
+
busyWheelDir.viewContainerRef.element.nativeElement.style.position = '';
|
|
204
|
+
wheelData.oldStyles.forEach(style => {
|
|
205
|
+
busyWheelDir.viewContainerRef.element.nativeElement.style[style.style] = style.value;
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// this.removeBusyWheel(wheelId);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
// viewport global busy-wheel, remove the entire backdrop, which
|
|
216
|
+
// will also kill the child busy-wheel.
|
|
217
|
+
this.removeViewportBusyWheel();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
registerBusyWheelHost(busyWheelDir) {
|
|
221
|
+
const id = busyWheelDir.spHostBusyWheel();
|
|
222
|
+
if (!id) {
|
|
223
|
+
if (!this.defaultBusyWheelDir) {
|
|
224
|
+
if (!this.defaultBusyWheelDir) {
|
|
225
|
+
this.defaultBusyWheelDir = busyWheelDir;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
if (!this.namedBusyWheelDirs.get(id)) {
|
|
231
|
+
//console.log(`registering busyWheelDir with id: ${id}`);
|
|
232
|
+
this.namedBusyWheelDirs.set(id, []);
|
|
233
|
+
}
|
|
234
|
+
this.namedBusyWheelDirs.get(id)?.push(busyWheelDir);
|
|
235
|
+
// this.namedHostViewContainerRefs.set(id, viewContainerRef);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
deregisterBusyWheelHost(busyWheelDir) {
|
|
239
|
+
const busyWheelId = busyWheelDir.spHostBusyWheel();
|
|
240
|
+
if (!busyWheelId) {
|
|
241
|
+
this.defaultBusyWheelDir = undefined;
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
//console.log(`deregistering busyWheel with id: ${busyWheelDir.hostBusyWheel}`);
|
|
245
|
+
this.namedBusyWheelDirs.delete(busyWheelId);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// private getContainersFromId(id: string) {
|
|
249
|
+
// let viewContainers = new Array<ViewContainerRef>();
|
|
250
|
+
// if (id) {
|
|
251
|
+
// const idParts = id.split(',');
|
|
252
|
+
// idParts.forEach(id => {
|
|
253
|
+
// const containers = this.namedBusyWheelDirs.get(id.trim());
|
|
254
|
+
// if (containers) {
|
|
255
|
+
// viewContainers = viewContainers.concat(containers);
|
|
256
|
+
// }
|
|
257
|
+
// });
|
|
258
|
+
// } else if (this.defaultBusyWheelDir) {
|
|
259
|
+
// viewContainers.push(this.defaultBusyWheelDir)
|
|
260
|
+
// }
|
|
261
|
+
// return viewContainers;
|
|
262
|
+
// }
|
|
263
|
+
/**
|
|
264
|
+
* Creates a div fragment that hosts the busy wheel. The fragment has the following
|
|
265
|
+
* structure:
|
|
266
|
+
*
|
|
267
|
+
* <div id="id_busy-wheel_{id}">
|
|
268
|
+
* <div class="{containerClass}">
|
|
269
|
+
* <!-- <div class="busy-wheel"></div> -->
|
|
270
|
+
* <mat-spinner></mat-spinner>
|
|
271
|
+
* </div>
|
|
272
|
+
* </div>
|
|
273
|
+
* @param containerClass
|
|
274
|
+
* @param id
|
|
275
|
+
* @returns
|
|
276
|
+
*/
|
|
277
|
+
createViewportBusyWheel(containerClass, id) {
|
|
278
|
+
let wheelId = BUSY_WHEEL_DIV_ID;
|
|
279
|
+
if (id) {
|
|
280
|
+
wheelId += `_${id}`;
|
|
281
|
+
}
|
|
282
|
+
let template = VIEWPORT_BUSY_WHEEL_FRAGMENT_TEMPLATE;
|
|
283
|
+
const parser = new DOMParser();
|
|
284
|
+
const doc = parser.parseFromString(template
|
|
285
|
+
.replace('{wheelId}', wheelId)
|
|
286
|
+
.replace('{containerClass}', containerClass), 'text/html');
|
|
287
|
+
const fragment = document.createDocumentFragment();
|
|
288
|
+
fragment.appendChild(doc.documentElement);
|
|
289
|
+
// Create the style element
|
|
290
|
+
const style = document.createElement('style');
|
|
291
|
+
style.textContent = VIEWPORT_BUSY_WHEEL_STYLE;
|
|
292
|
+
style.id = VIEWPORT_BUSY_WHEEL_STYLE_ID;
|
|
293
|
+
fragment.querySelector('head')?.appendChild(style);
|
|
294
|
+
return fragment;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Creates a backdrop overlay, of the same size as the container that it
|
|
298
|
+
* covers, on which the busy wheel will be positioned.
|
|
299
|
+
* @returns
|
|
300
|
+
*/
|
|
301
|
+
createBackdrop() {
|
|
302
|
+
const fragment = document.createDocumentFragment();
|
|
303
|
+
const backdropDiv = document.createElement('div');
|
|
304
|
+
backdropDiv.className = 'busy-wheel-backdrop';
|
|
305
|
+
backdropDiv.setAttribute('id', BACKDROP_DIV_ID);
|
|
306
|
+
fragment.appendChild(backdropDiv);
|
|
307
|
+
return fragment;
|
|
308
|
+
}
|
|
309
|
+
removeViewportBusyWheel(id) {
|
|
310
|
+
let wheelId = BUSY_WHEEL_DIV_ID;
|
|
311
|
+
if (id) {
|
|
312
|
+
wheelId += `_${id}`;
|
|
313
|
+
}
|
|
314
|
+
const body = document.body;
|
|
315
|
+
const busyWheelDiv = body.querySelector(`div#${wheelId}`);
|
|
316
|
+
if (busyWheelDiv) {
|
|
317
|
+
busyWheelDiv.remove();
|
|
318
|
+
}
|
|
319
|
+
// remove the style
|
|
320
|
+
const busyWheelStyle = document.head.querySelector(`style#${VIEWPORT_BUSY_WHEEL_STYLE_ID}`);
|
|
321
|
+
if (busyWheelStyle) {
|
|
322
|
+
busyWheelStyle.remove();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: BusyWheelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
326
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: BusyWheelService, providedIn: 'root' });
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: BusyWheelService, decorators: [{
|
|
329
|
+
type: Injectable,
|
|
330
|
+
args: [{ providedIn: 'root' }]
|
|
331
|
+
}], ctorParameters: () => [] });
|
|
332
|
+
function registerBusyWheelHost(busyWheelDir) {
|
|
333
|
+
const instance = BusyWheelService.getInstance();
|
|
334
|
+
instance.registerBusyWheelHost(busyWheelDir);
|
|
335
|
+
}
|
|
336
|
+
function deregisterBusyWheelHost(busyWheelDir) {
|
|
337
|
+
const instance = BusyWheelService.getInstance();
|
|
338
|
+
instance.deregisterBusyWheelHost(busyWheelDir);
|
|
339
|
+
}
|
|
340
|
+
function showBusyWheel(id) {
|
|
341
|
+
const instance = BusyWheelService.getInstance();
|
|
342
|
+
instance.show(id);
|
|
343
|
+
}
|
|
344
|
+
function hideBusyWheel(id) {
|
|
345
|
+
const instance = BusyWheelService.getInstance();
|
|
346
|
+
instance.hide(id);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Returns an rxjs operator that would track an http request status
|
|
351
|
+
* and would use the request status to hide the global busy wheel. The wheel
|
|
352
|
+
* would be hidden when the request completes or errors.
|
|
353
|
+
*
|
|
354
|
+
* Use it like below:
|
|
355
|
+
*
|
|
356
|
+
* this.http.get<User>('https://google.com/..').pipe(
|
|
357
|
+
* trackBusyWheelStatus(),
|
|
358
|
+
* tap(user => this.user = user)
|
|
359
|
+
* ).subscribe();
|
|
360
|
+
*
|
|
361
|
+
* Note that the function internally uses a timer to delay showing the busy
|
|
362
|
+
* wheel. This helps avoid needless screen flicker that can occur when quickly
|
|
363
|
+
* showing & hiding the wheel when the network connection and server response
|
|
364
|
+
* are so good that it can exceed natural user reaction time. We set this
|
|
365
|
+
* delay to 150 milliseconds for now.
|
|
366
|
+
*
|
|
367
|
+
* @param id A string value that uniquely identities the the busy wheel host
|
|
368
|
+
* container within the page. This allows multiple busy wheels to be hosted
|
|
369
|
+
* within a page, each for a distinct network (or time-consuming) operation.
|
|
370
|
+
* This is optional and if not specified, will create a busy wheel that
|
|
371
|
+
* covers the entire app viewport.
|
|
372
|
+
* @param show A boolean value that says whether to show the wheel as
|
|
373
|
+
* part of the operator setup. If set to false, the caller is expected
|
|
374
|
+
* to have displayed the busy wheel explicitly.
|
|
375
|
+
* @param showImmediate A boolean value that decides whether to show the
|
|
376
|
+
* busy wheel immediately. If set to false (default), the busy wheel will
|
|
377
|
+
* only be shown when the HTTP request has not completed within 200ms.
|
|
378
|
+
* @param hideOnNthEmit Number of emits upon which the busy wheel is to
|
|
379
|
+
* be hidden. A value of 0 for this means the wheel is hidden only when
|
|
380
|
+
* the observable completes (errorneously or otherwise).
|
|
381
|
+
* @returns An rxjs op that can be added to the pipe() arg list.
|
|
382
|
+
*/
|
|
383
|
+
function trackBusyWheelStatus(id, show = true, showImmediate = false, hideOnNthEmit = 0) {
|
|
384
|
+
let timeout = null;
|
|
385
|
+
let wheelShown = false;
|
|
386
|
+
if (show) {
|
|
387
|
+
timeout = setTimeout(() => {
|
|
388
|
+
showBusyWheel(id);
|
|
389
|
+
wheelShown = true;
|
|
390
|
+
}, showImmediate ? 0 : 150);
|
|
391
|
+
}
|
|
392
|
+
return function (source) {
|
|
393
|
+
let emits = 0;
|
|
394
|
+
const hideFn = () => {
|
|
395
|
+
// console.log('busywheel.hideFn');
|
|
396
|
+
if (timeout) {
|
|
397
|
+
clearTimeout(timeout);
|
|
398
|
+
timeout = null;
|
|
399
|
+
}
|
|
400
|
+
if (!show || wheelShown) {
|
|
401
|
+
hideBusyWheel(id);
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
return source.pipe(
|
|
405
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
406
|
+
tap((val) => {
|
|
407
|
+
if (hideOnNthEmit > 0 && ++emits == hideOnNthEmit) {
|
|
408
|
+
// console.log(`trackBusyWheelStatus - obs emitted ${hideOnNthEmit} values, hiding`);
|
|
409
|
+
hideFn();
|
|
410
|
+
}
|
|
411
|
+
}), finalize(() => {
|
|
412
|
+
// finalize() arg will be invoked upon completion or error
|
|
413
|
+
hideFn();
|
|
414
|
+
}));
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Show a busy wheel until the observable is complete. Busy wheel is shown is either viewport global
|
|
419
|
+
* or localized to the element with the the given id.
|
|
420
|
+
*
|
|
421
|
+
* An example use case for this operator are HTTP requests which will complete no matter
|
|
422
|
+
* what. Either successfully or with an error. Either case will mark the observer as completed.
|
|
423
|
+
*
|
|
424
|
+
* See trackBusyWheelStatus() for explanations on arguments
|
|
425
|
+
*
|
|
426
|
+
* @param id
|
|
427
|
+
* @param showImmediate
|
|
428
|
+
* @returns
|
|
429
|
+
*/
|
|
430
|
+
function showBusyWheelUntilComplete(id, showImmediate = false) {
|
|
431
|
+
return trackBusyWheelStatus(id, true, showImmediate, 0);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Show a busy wheel until the observable emits n number of values. Busy wheel is shown is
|
|
435
|
+
* either viewport global or localized to the element with the the given id.
|
|
436
|
+
*
|
|
437
|
+
* An example use case for this operator are observables that emit but which do not necessarily
|
|
438
|
+
* complete.
|
|
439
|
+
*
|
|
440
|
+
* See trackBusyWheelStatus() for explanations on arguments
|
|
441
|
+
*
|
|
442
|
+
* @param numEmits
|
|
443
|
+
* @param id
|
|
444
|
+
* @param showImmediate
|
|
445
|
+
* @returns
|
|
446
|
+
*/
|
|
447
|
+
function showBusyWheelUntilEmits(numEmits, id, showImmediate = false) {
|
|
448
|
+
return trackBusyWheelStatus(id, true, showImmediate, numEmits);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Use this directive with a unique value assigned to it to display a busy
|
|
453
|
+
* wheel over it. This can be used as:-
|
|
454
|
+
*
|
|
455
|
+
* import {showBusyWheelUntilComplete} from '@smallpearl/ngx-helper/mat-busy-wheel';
|
|
456
|
+
*
|
|
457
|
+
* <div spHostBusyWheel='myDivBusyWheel'>
|
|
458
|
+
* ..content
|
|
459
|
+
* </div>
|
|
460
|
+
*
|
|
461
|
+
* Then in your code:
|
|
462
|
+
*
|
|
463
|
+
* obs.pipe(
|
|
464
|
+
* showBusyWheelUntilComplete('myDivBusyWheel'),
|
|
465
|
+
* tap((resp) => {
|
|
466
|
+
* ...
|
|
467
|
+
* })
|
|
468
|
+
* ).subscribe();
|
|
469
|
+
*
|
|
470
|
+
* This will cover the 'div' above when the obs is waiting to be completed.
|
|
471
|
+
* (or error). Note that you can also use the trackBusyWheelStatus() function
|
|
472
|
+
* if you want more control over the busy wheel.
|
|
473
|
+
*/
|
|
474
|
+
class SPMatHostBusyWheelDirective {
|
|
475
|
+
viewContainerRef;
|
|
476
|
+
renderer2;
|
|
477
|
+
spHostBusyWheel = input();
|
|
478
|
+
constructor(viewContainerRef, renderer2) {
|
|
479
|
+
this.viewContainerRef = viewContainerRef;
|
|
480
|
+
this.renderer2 = renderer2;
|
|
481
|
+
}
|
|
482
|
+
ngOnInit() {
|
|
483
|
+
registerBusyWheelHost(this);
|
|
484
|
+
}
|
|
485
|
+
ngOnDestroy() {
|
|
486
|
+
deregisterBusyWheelHost(this);
|
|
487
|
+
}
|
|
488
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatHostBusyWheelDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
489
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: SPMatHostBusyWheelDirective, isStandalone: true, selector: "[spHostBusyWheel]", inputs: { spHostBusyWheel: { classPropertyName: "spHostBusyWheel", publicName: "spHostBusyWheel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
490
|
+
}
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: SPMatHostBusyWheelDirective, decorators: [{
|
|
492
|
+
type: Directive,
|
|
493
|
+
args: [{
|
|
494
|
+
selector: '[spHostBusyWheel]',
|
|
495
|
+
standalone: true,
|
|
496
|
+
}]
|
|
497
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }] });
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Generated bundle index. Do not edit.
|
|
501
|
+
*/
|
|
502
|
+
|
|
503
|
+
export { BusyWheelService, SPMatBusyWheelComponent, SPMatHostBusyWheelDirective, deregisterBusyWheelHost, hideBusyWheel, registerBusyWheelHost, showBusyWheel, showBusyWheelUntilComplete, showBusyWheelUntilEmits, trackBusyWheelStatus };
|
|
504
|
+
//# sourceMappingURL=smallpearl-ngx-helper-mat-busy-wheel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-busy-wheel.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-busy-wheel/src/busy-wheel.component.ts","../../../../projects/smallpearl/ngx-helper/mat-busy-wheel/src/busy-wheel.service.ts","../../../../projects/smallpearl/ngx-helper/mat-busy-wheel/src/busy-wheel-op.ts","../../../../projects/smallpearl/ngx-helper/mat-busy-wheel/src/host-busy-wheel.directive.ts","../../../../projects/smallpearl/ngx-helper/mat-busy-wheel/smallpearl-ngx-helper-mat-busy-wheel.ts"],"sourcesContent":["import { Component, ElementRef, input, OnDestroy, OnInit } from '@angular/core';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\n@Component({\n selector: 'sp-mat-busy-wheel',\n imports: [MatProgressSpinnerModule],\n template: `\n <div class=\"busy-wheel-wrapper\">\n <span>\n <div class=\"busy-wheel-container\" id=\"{{ wheelId() }}\">\n <!--\n We can replace mat-spinner with the following div, which will\n remove the MatProgressSpinnerModule dependency. But the downside is\n that the spinner will not follow the global material theme.\n <div class=\"busy-wheel\"></div>\n -->\n <mat-spinner mode=\"indeterminate\" diameter=\"32\"></mat-spinner>\n </div>\n </span>\n </div>\n `,\n styles: [\n `\n .busy-wheel-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n background-color: rgba(255, 255, 255, 0.35);\n }\n .busy-wheel-container {\n display: flex;\n position: relative;\n top: 0;\n height: 100%;\n width: 100%;\n }\n `\n ]\n})\nexport class SPMatBusyWheelComponent implements OnInit, OnDestroy {\n wheelId = input('id_busy-wheel');\n viewport = input(false);\n\n constructor(public elRef: ElementRef) {}\n\n ngOnInit() {}\n\n ngOnDestroy() {}\n}\n","import { ComponentRef, Injectable } from '@angular/core';\nimport { SPMatBusyWheelComponent } from './busy-wheel.component';\nimport { SPMatHostBusyWheelDirective } from './host-busy-wheel.directive';\n\nconst BACKDROP_DIV_ID = 'id_busy-wheel-backdrop';\nconst BUSY_WHEEL_DIV_ID = 'id_busy-wheel';\n\nconst VIEWPORT_BUSY_WHEEL_STYLE_ID = 'id_viewport_busy_wheel_style';\nconst VIEWPORT_BUSY_WHEEL_STYLE = `\n .busy-wheel-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n background-color: rgba(255, 255, 255, 0.35);\n }\n .busy-wheel-container {\n display: flex;\n position: relative;\n top: 0;\n height: 100%;\n width: 100%;\n }\n .busy-wheel,\n .busy-wheel:after {\n border-radius: 50%;\n width: 4em;\n height: 4em;\n }\n .busy-wheel {\n margin: auto auto;\n font-size: 8px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(0, 0, 0, 0.8);\n border-right: 0.5em solid rgba(0, 0, 0, 0.8);\n border-bottom: 0.5em solid rgba(0, 0, 0, 0.8);\n border-left: 0.5em solid #ffffff;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: load8 1.1s infinite linear;\n animation: load8 1.1s infinite linear;\n }\n @-webkit-keyframes load8 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes load8 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n`;\nconst VIEWPORT_BUSY_WHEEL_FRAGMENT_TEMPLATE = `\n<div class=\"busy-wheel-wrapper\" id=\"{wheelId}\">\n <div class=\"{containerClass}\" style=\"display: flex; position: relative; top: 0; width: 100vw; height: 100vh; z-index: 9999999;\">\n <div class=\"busy-wheel\"></div>\n </div>\n</div>\n`;\n\ninterface StyleInfo {\n style: string;\n value:string|number;\n};\n\ninterface WheelData {\n component: ComponentRef<SPMatBusyWheelComponent>;\n oldStyles: Array<{style: string, value:string|number}>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class BusyWheelService {\n\n private defaultBusyWheelDir!: SPMatHostBusyWheelDirective;\n private namedBusyWheelDirs = new Map<string, Array<SPMatHostBusyWheelDirective>>();\n private wheelComponents = new Map<string, WheelData>();\n\n static s_instance: BusyWheelService;\n\n constructor() {}\n\n static getInstance(): BusyWheelService {\n if (!this.s_instance) {\n this.s_instance = new BusyWheelService();\n }\n return this.s_instance;\n }\n\n show(id?: string) {\n if (id) {\n const idParts = id.split(',');\n idParts.forEach(id => {\n const trimmedId = id.trim();\n const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);\n if (busyWheelDirs) {\n const containers = Array.isArray(busyWheelDirs) ? busyWheelDirs : [busyWheelDirs];\n containers.forEach((busyWheelDir, index) => {\n const wheelId = `${trimmedId}_${index}`;\n //console.log(`showing busy-wheel: ${wheelId} for busyWheel: ${busyWheelDir.hostBusyWheel}`);\n const busyWheelComponentRef = busyWheelDir.viewContainerRef.createComponent<SPMatBusyWheelComponent>(SPMatBusyWheelComponent);\n busyWheelComponentRef.setInput('wheelId', wheelId);\n // Append the component as a child of the element with hostBusyWheel directive.\n busyWheelDir.renderer2.appendChild(\n busyWheelDir.viewContainerRef.element.nativeElement,\n busyWheelComponentRef.injector.get(SPMatBusyWheelComponent).elRef.nativeElement\n );\n // Save the position explicit css style of the element if one was set\n let oldStyles = new Array<StyleInfo>();\n if (busyWheelDir.viewContainerRef.element.nativeElement.style.position) {\n oldStyles.push({\n style: 'position',\n value: busyWheelDir.viewContainerRef.element.nativeElement.style.position\n });\n }\n // Set the element's child controls's poisitioning to 'relative'\n busyWheelDir.viewContainerRef.element.nativeElement.style.position = 'relative';\n this.wheelComponents.set(wheelId, {\n component: busyWheelComponentRef,\n oldStyles: []\n });\n });\n }\n })\n } else {\n // viewport global busy-wheel\n const busyWheel = this.createViewportBusyWheel(\n 'busy-wheel-container',\n undefined\n );\n const backdrop = this.createBackdrop();\n backdrop.firstChild?.appendChild(busyWheel);\n const viewportBusyWheelStyle = backdrop.querySelector('style');\n if (viewportBusyWheelStyle) {\n document.head.appendChild(viewportBusyWheelStyle);\n }\n const viewportBusyWheelDiv = backdrop.querySelector('body')?.firstChild;\n if (viewportBusyWheelDiv) {\n document.body.appendChild(viewportBusyWheelDiv);\n }\n }\n }\n\n hide(id?: string) {\n if (id) {\n const idParts = id.split(',');\n idParts.forEach(id => {\n const trimmedId = id.trim();\n const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);\n if (busyWheelDirs) {\n const containers = Array.isArray(busyWheelDirs) ? busyWheelDirs : [busyWheelDirs];\n containers.forEach((busyWheelDir, index) => {\n const wheelId = `${trimmedId}_${index}`;\n const wheelData = this.wheelComponents.get(wheelId);\n if (wheelData) {\n //console.log(`destroying busy-wheel: ${wheelId}`);\n wheelData.component.destroy();\n this.wheelComponents.delete(wheelId);\n if (wheelData?.oldStyles && wheelData.oldStyles.length) {\n // Remove position: relative style that we added\n (busyWheelDir.viewContainerRef.element.nativeElement as HTMLElement).style.position = '';\n wheelData.oldStyles.forEach(style => {\n busyWheelDir.viewContainerRef.element.nativeElement.style[style.style] = style.value;\n });\n }\n }\n // this.removeBusyWheel(wheelId);\n });\n }\n });\n } else {\n // viewport global busy-wheel, remove the entire backdrop, which\n // will also kill the child busy-wheel.\n this.removeViewportBusyWheel();\n }\n }\n\n registerBusyWheelHost(busyWheelDir: SPMatHostBusyWheelDirective) {\n const id = busyWheelDir.spHostBusyWheel();\n if (!id) {\n if (!this.defaultBusyWheelDir) {\n if (!this.defaultBusyWheelDir) {\n this.defaultBusyWheelDir = busyWheelDir;\n }\n }\n } else {\n if (!this.namedBusyWheelDirs.get(id)) {\n //console.log(`registering busyWheelDir with id: ${id}`);\n this.namedBusyWheelDirs.set(id, []);\n }\n this.namedBusyWheelDirs.get(id)?.push(busyWheelDir);\n // this.namedHostViewContainerRefs.set(id, viewContainerRef);\n }\n }\n\n deregisterBusyWheelHost(busyWheelDir: SPMatHostBusyWheelDirective) {\n const busyWheelId = busyWheelDir.spHostBusyWheel()\n if (!busyWheelId) {\n (this.defaultBusyWheelDir as any) = undefined;\n } else {\n //console.log(`deregistering busyWheel with id: ${busyWheelDir.hostBusyWheel}`);\n this.namedBusyWheelDirs.delete(busyWheelId);\n }\n }\n\n // private getContainersFromId(id: string) {\n // let viewContainers = new Array<ViewContainerRef>();\n // if (id) {\n // const idParts = id.split(',');\n // idParts.forEach(id => {\n // const containers = this.namedBusyWheelDirs.get(id.trim());\n // if (containers) {\n // viewContainers = viewContainers.concat(containers);\n // }\n // });\n // } else if (this.defaultBusyWheelDir) {\n // viewContainers.push(this.defaultBusyWheelDir)\n // }\n // return viewContainers;\n // }\n\n /**\n * Creates a div fragment that hosts the busy wheel. The fragment has the following\n * structure:\n *\n * <div id=\"id_busy-wheel_{id}\">\n * <div class=\"{containerClass}\">\n * <!-- <div class=\"busy-wheel\"></div> -->\n * <mat-spinner></mat-spinner>\n * </div>\n * </div>\n * @param containerClass\n * @param id\n * @returns\n */\n private createViewportBusyWheel(containerClass: string, id: string|undefined): DocumentFragment {\n let wheelId = BUSY_WHEEL_DIV_ID;\n if (id) {\n wheelId += `_${id}`;\n }\n let template = VIEWPORT_BUSY_WHEEL_FRAGMENT_TEMPLATE;\n const parser = new DOMParser();\n const doc = parser.parseFromString(\n template\n .replace('{wheelId}', wheelId)\n .replace('{containerClass}', containerClass),\n 'text/html'\n );\n const fragment = document.createDocumentFragment();\n fragment.appendChild(doc.documentElement);\n\n // Create the style element\n const style = document.createElement('style');\n style.textContent = VIEWPORT_BUSY_WHEEL_STYLE;\n style.id = VIEWPORT_BUSY_WHEEL_STYLE_ID;\n fragment.querySelector('head')?.appendChild(style);\n\n return fragment;\n }\n\n /**\n * Creates a backdrop overlay, of the same size as the container that it\n * covers, on which the busy wheel will be positioned.\n * @returns\n */\n private createBackdrop() {\n const fragment = document.createDocumentFragment();\n const backdropDiv = document.createElement('div');\n backdropDiv.className = 'busy-wheel-backdrop';\n backdropDiv.setAttribute('id', BACKDROP_DIV_ID);\n fragment.appendChild(backdropDiv);\n return fragment;\n }\n\n private removeViewportBusyWheel(id?: string) {\n let wheelId = BUSY_WHEEL_DIV_ID;\n if (id) {\n wheelId += `_${id}`;\n }\n const body: HTMLElement = document.body;\n const busyWheelDiv = body.querySelector(`div#${wheelId}`);\n if (busyWheelDiv) {\n busyWheelDiv.remove();\n }\n\n // remove the style\n const busyWheelStyle = document.head.querySelector(\n `style#${VIEWPORT_BUSY_WHEEL_STYLE_ID}`\n );\n if (busyWheelStyle) {\n busyWheelStyle.remove();\n }\n }\n}\n\nexport function registerBusyWheelHost(busyWheelDir: SPMatHostBusyWheelDirective) {\n const instance = BusyWheelService.getInstance();\n instance.registerBusyWheelHost(busyWheelDir);\n}\n\nexport function deregisterBusyWheelHost(busyWheelDir: SPMatHostBusyWheelDirective) {\n const instance = BusyWheelService.getInstance();\n instance.deregisterBusyWheelHost(busyWheelDir);\n}\n\nexport function showBusyWheel(id?: string) {\n const instance = BusyWheelService.getInstance();\n instance.show(id);\n}\n\nexport function hideBusyWheel(id?: string) {\n const instance = BusyWheelService.getInstance();\n instance.hide(id);\n}\n","import { finalize, Observable, tap } from 'rxjs';\nimport { hideBusyWheel, showBusyWheel } from './busy-wheel.service';\n\n/**\n * Returns an rxjs operator that would track an http request status\n * and would use the request status to hide the global busy wheel. The wheel\n * would be hidden when the request completes or errors.\n *\n * Use it like below:\n *\n * this.http.get<User>('https://google.com/..').pipe(\n * trackBusyWheelStatus(),\n * tap(user => this.user = user)\n * ).subscribe();\n *\n * Note that the function internally uses a timer to delay showing the busy\n * wheel. This helps avoid needless screen flicker that can occur when quickly\n * showing & hiding the wheel when the network connection and server response\n * are so good that it can exceed natural user reaction time. We set this\n * delay to 150 milliseconds for now.\n *\n * @param id A string value that uniquely identities the the busy wheel host\n * container within the page. This allows multiple busy wheels to be hosted\n * within a page, each for a distinct network (or time-consuming) operation.\n * This is optional and if not specified, will create a busy wheel that\n * covers the entire app viewport.\n * @param show A boolean value that says whether to show the wheel as\n * part of the operator setup. If set to false, the caller is expected\n * to have displayed the busy wheel explicitly.\n * @param showImmediate A boolean value that decides whether to show the\n * busy wheel immediately. If set to false (default), the busy wheel will\n * only be shown when the HTTP request has not completed within 200ms.\n * @param hideOnNthEmit Number of emits upon which the busy wheel is to\n * be hidden. A value of 0 for this means the wheel is hidden only when\n * the observable completes (errorneously or otherwise).\n * @returns An rxjs op that can be added to the pipe() arg list.\n */\nexport function trackBusyWheelStatus(id?: string, show = true, showImmediate = false, hideOnNthEmit = 0) {\n let timeout: any = null;\n let wheelShown = false;\n if (show) {\n timeout = setTimeout(\n () => {\n showBusyWheel(id);\n wheelShown = true;\n },\n showImmediate ? 0 : 150\n );\n }\n\n return function <T>(source: Observable<T>): Observable<T> {\n let emits = 0;\n const hideFn = () => {\n // console.log('busywheel.hideFn');\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n if (!show || wheelShown) {\n hideBusyWheel(id);\n }\n };\n return source.pipe(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tap((val) => {\n if (hideOnNthEmit > 0 && ++emits == hideOnNthEmit) {\n // console.log(`trackBusyWheelStatus - obs emitted ${hideOnNthEmit} values, hiding`);\n hideFn();\n }\n }),\n finalize(() => {\n // finalize() arg will be invoked upon completion or error\n hideFn();\n })\n );\n };\n}\n\n/**\n * Show a busy wheel until the observable is complete. Busy wheel is shown is either viewport global\n * or localized to the element with the the given id.\n *\n * An example use case for this operator are HTTP requests which will complete no matter\n * what. Either successfully or with an error. Either case will mark the observer as completed.\n *\n * See trackBusyWheelStatus() for explanations on arguments\n *\n * @param id\n * @param showImmediate\n * @returns\n */\nexport function showBusyWheelUntilComplete(id?: string, showImmediate = false) {\n return trackBusyWheelStatus(id, true, showImmediate, 0);\n}\n\n/**\n * Show a busy wheel until the observable emits n number of values. Busy wheel is shown is\n * either viewport global or localized to the element with the the given id.\n *\n * An example use case for this operator are observables that emit but which do not necessarily\n * complete.\n *\n * See trackBusyWheelStatus() for explanations on arguments\n *\n * @param numEmits\n * @param id\n * @param showImmediate\n * @returns\n */\nexport function showBusyWheelUntilEmits(numEmits: number, id?: string, showImmediate = false) {\n return trackBusyWheelStatus(id, true, showImmediate, numEmits);\n}\n","import { Directive, input, Input, OnDestroy, OnInit, Renderer2, ViewContainerRef } from '@angular/core';\nimport { deregisterBusyWheelHost, registerBusyWheelHost } from './busy-wheel.service';\n\n/**\n * Use this directive with a unique value assigned to it to display a busy\n * wheel over it. This can be used as:-\n *\n * import {showBusyWheelUntilComplete} from '@smallpearl/ngx-helper/mat-busy-wheel';\n *\n * <div spHostBusyWheel='myDivBusyWheel'>\n * ..content\n * </div>\n *\n * Then in your code:\n *\n * obs.pipe(\n * showBusyWheelUntilComplete('myDivBusyWheel'),\n * tap((resp) => {\n * ...\n * })\n * ).subscribe();\n *\n * This will cover the 'div' above when the obs is waiting to be completed.\n * (or error). Note that you can also use the trackBusyWheelStatus() function\n * if you want more control over the busy wheel.\n */\n@Directive({\n selector: '[spHostBusyWheel]',\n standalone: true,\n})\nexport class SPMatHostBusyWheelDirective implements OnInit, OnDestroy {\n\n spHostBusyWheel = input<string>()\n\n constructor(\n public viewContainerRef: ViewContainerRef,\n public renderer2: Renderer2,\n ) {}\n\n ngOnInit(): void {\n registerBusyWheelHost(this);\n }\n\n ngOnDestroy(): void {\n deregisterBusyWheelHost(this);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA6Ca,uBAAuB,CAAA;AAIf,IAAA,KAAA;AAHnB,IAAA,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;AAChC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAEvB,IAAA,WAAA,CAAmB,KAAiB,EAAA;QAAjB,IAAK,CAAA,KAAA,GAAL,KAAK;;AAExB,IAAA,QAAQ;AAER,IAAA,WAAW;0HARA,uBAAuB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,EAvCtB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EA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