@smallpearl/ngx-helper 0.33.50 → 20.0.3
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/core/index.d.ts +3 -1
- package/entities/index.d.ts +313 -2
- package/entity-field/index.d.ts +101 -2
- package/fesm2022/smallpearl-ngx-helper-entities.mjs +18 -18
- package/fesm2022/smallpearl-ngx-helper-entities.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +5 -4
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +6 -6
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-locale.mjs +6 -6
- package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +57 -31
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +15 -15
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +346 -334
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +152 -146
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +5 -5
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +19 -19
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +25 -26
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs +7 -7
- package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +24 -24
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +8 -9
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +35 -35
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -1
- package/forms/index.d.ts +55 -1
- package/hover-dropdown/index.d.ts +44 -1
- package/index.d.ts +4 -5
- package/locale/index.d.ts +55 -5
- package/mat-busy-wheel/index.d.ts +165 -4
- package/mat-context-menu/index.d.ts +65 -1
- package/mat-entity-crud/index.d.ts +1075 -6
- package/mat-entity-list/index.d.ts +394 -3
- package/mat-file-input/index.d.ts +61 -1
- package/mat-form-error/index.d.ts +184 -6
- package/mat-select-entity/index.d.ts +194 -1
- package/mat-select-infinite-scroll/index.d.ts +45 -2
- package/mat-side-menu-layout/index.d.ts +180 -6
- package/mat-tel-input/index.d.ts +169 -2
- package/package.json +18 -13
- package/sideload/index.d.ts +20 -1
- package/stationary-with-line-items/index.d.ts +78 -1
- package/core/src/version.d.ts +0 -1
- package/entities/src/paged-loader.d.ts +0 -219
- package/entities/src/paginator.d.ts +0 -87
- package/entity-field/src/entity-field.d.ts +0 -70
- package/entity-field/src/provider.d.ts +0 -27
- package/forms/src/validation-error-handler.d.ts +0 -52
- package/hover-dropdown/src/hover-dropdown.directive.d.ts +0 -41
- package/locale/src/currency.pipe.d.ts +0 -14
- package/locale/src/date.pipe.d.ts +0 -14
- package/locale/src/format-currency.d.ts +0 -1
- package/locale/src/format-date.d.ts +0 -2
- package/locale/src/is-empty.d.ts +0 -1
- package/locale/src/providers.d.ts +0 -20
- package/mat-busy-wheel/src/busy-wheel-op.d.ts +0 -65
- package/mat-busy-wheel/src/busy-wheel.component.d.ts +0 -12
- package/mat-busy-wheel/src/busy-wheel.service.d.ts +0 -42
- package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +0 -35
- package/mat-context-menu/src/mat-context-menu.component.d.ts +0 -61
- package/mat-entity-crud/src/convert-context-input-to-http-context.d.ts +0 -11
- package/mat-entity-crud/src/default-config.d.ts +0 -9
- package/mat-entity-crud/src/form-view-host.component.d.ts +0 -41
- package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +0 -277
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +0 -131
- package/mat-entity-crud/src/mat-entity-crud-item-action.d.ts +0 -68
- package/mat-entity-crud/src/mat-entity-crud-types.d.ts +0 -149
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -366
- package/mat-entity-crud/src/preview-host.component.d.ts +0 -21
- package/mat-entity-crud/src/preview-pane.component.d.ts +0 -31
- package/mat-entity-crud/src/providers.d.ts +0 -3
- package/mat-entity-list/src/config.d.ts +0 -6
- package/mat-entity-list/src/mat-entity-list-types.d.ts +0 -128
- package/mat-entity-list/src/mat-entity-list.component.d.ts +0 -259
- package/mat-entity-list/src/providers.d.ts +0 -3
- package/mat-file-input/src/mat-file-input.component.d.ts +0 -58
- package/mat-form-error/src/locales/en.d.ts +0 -4
- package/mat-form-error/src/locales/hu.d.ts +0 -4
- package/mat-form-error/src/locales/index.d.ts +0 -5
- package/mat-form-error/src/locales/pt-br.d.ts +0 -4
- package/mat-form-error/src/locales/zh-hans.d.ts +0 -4
- package/mat-form-error/src/locales/zh-hant.d.ts +0 -4
- package/mat-form-error/src/ngx-error-list.component.d.ts +0 -9
- package/mat-form-error/src/ngx-mat-error-control.d.ts +0 -17
- package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +0 -30
- package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +0 -8
- package/mat-form-error/src/ngx-mat-errors.component.d.ts +0 -44
- package/mat-form-error/src/types.d.ts +0 -68
- package/mat-form-error/src/utils/coerce-to-observable.d.ts +0 -3
- package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +0 -2
- package/mat-form-error/src/utils/find-error-for-control.d.ts +0 -9
- package/mat-form-error/src/utils/get-abstract-controls.d.ts +0 -3
- package/mat-form-error/src/utils/get-control-with-error.d.ts +0 -3
- package/mat-select-entity/src/mat-select-entity.component.d.ts +0 -190
- package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.directive.d.ts +0 -19
- package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.service.d.ts +0 -25
- package/mat-side-menu-layout/src/layout.service.d.ts +0 -23
- package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +0 -39
- package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +0 -18
- package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +0 -36
- package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +0 -66
- package/mat-side-menu-layout/src/nav-item.d.ts +0 -10
- package/mat-tel-input/src/country-codes.d.ts +0 -5
- package/mat-tel-input/src/mat-telephone.component.d.ts +0 -129
- package/mat-tel-input/src/providers.d.ts +0 -38
- package/ngx-helper.d.ts +0 -2
- package/public-api.d.ts +0 -1
- package/sideload/src/sideload.d.ts +0 -18
- package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +0 -74
|
@@ -6,15 +6,15 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
|
6
6
|
|
|
7
7
|
class SPMatBusyWheelComponent {
|
|
8
8
|
elRef;
|
|
9
|
-
wheelId = input('id_busy-wheel');
|
|
10
|
-
viewport = input(false);
|
|
9
|
+
wheelId = input('id_busy-wheel', ...(ngDevMode ? [{ debugName: "wheelId" }] : []));
|
|
10
|
+
viewport = input(false, ...(ngDevMode ? [{ debugName: "viewport" }] : []));
|
|
11
11
|
constructor(elRef) {
|
|
12
12
|
this.elRef = elRef;
|
|
13
13
|
}
|
|
14
14
|
ngOnInit() { }
|
|
15
15
|
ngOnDestroy() { }
|
|
16
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
16
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatBusyWheelComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", 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
18
|
<div class="busy-wheel-wrapper">
|
|
19
19
|
<span>
|
|
20
20
|
<div class="busy-wheel-container" id="{{ wheelId() }}">
|
|
@@ -30,7 +30,7 @@ class SPMatBusyWheelComponent {
|
|
|
30
30
|
</div>
|
|
31
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
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatBusyWheelComponent, decorators: [{
|
|
34
34
|
type: Component,
|
|
35
35
|
args: [{ selector: 'sp-mat-busy-wheel', imports: [MatProgressSpinnerModule], template: `
|
|
36
36
|
<div class="busy-wheel-wrapper">
|
|
@@ -47,8 +47,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
47
47
|
</span>
|
|
48
48
|
</div>
|
|
49
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 }] });
|
|
50
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { wheelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "wheelId", required: false }] }], viewport: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewport", required: false }] }] } });
|
|
51
51
|
|
|
52
|
+
// import { SPMatHostBusyWheelDirective } from './host-busy-wheel.directive';
|
|
52
53
|
const BACKDROP_DIV_ID = 'id_busy-wheel-backdrop';
|
|
53
54
|
const BUSY_WHEEL_DIV_ID = 'id_busy-wheel';
|
|
54
55
|
const VIEWPORT_BUSY_WHEEL_STYLE_ID = 'id_viewport_busy_wheel_style';
|
|
@@ -122,7 +123,6 @@ const VIEWPORT_BUSY_WHEEL_FRAGMENT_TEMPLATE = `
|
|
|
122
123
|
</div>
|
|
123
124
|
</div>
|
|
124
125
|
`;
|
|
125
|
-
;
|
|
126
126
|
class BusyWheelService {
|
|
127
127
|
defaultBusyWheelDir;
|
|
128
128
|
namedBusyWheelDirs = new Map();
|
|
@@ -138,31 +138,41 @@ class BusyWheelService {
|
|
|
138
138
|
show(id) {
|
|
139
139
|
if (id) {
|
|
140
140
|
const idParts = id.split(',');
|
|
141
|
-
idParts.forEach(id => {
|
|
141
|
+
idParts.forEach((id) => {
|
|
142
142
|
const trimmedId = id.trim();
|
|
143
143
|
const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);
|
|
144
144
|
if (busyWheelDirs) {
|
|
145
|
-
const containers = Array.isArray(busyWheelDirs)
|
|
145
|
+
const containers = Array.isArray(busyWheelDirs)
|
|
146
|
+
? busyWheelDirs
|
|
147
|
+
: [busyWheelDirs];
|
|
146
148
|
containers.forEach((busyWheelDir, index) => {
|
|
147
149
|
const wheelId = `${trimmedId}_${index}`;
|
|
148
150
|
//console.log(`showing busy-wheel: ${wheelId} for busyWheel: ${busyWheelDir.hostBusyWheel}`);
|
|
149
|
-
const busyWheelComponentRef = busyWheelDir
|
|
151
|
+
const busyWheelComponentRef = busyWheelDir
|
|
152
|
+
.getViewContainerRef()
|
|
153
|
+
.createComponent(SPMatBusyWheelComponent);
|
|
150
154
|
busyWheelComponentRef.setInput('wheelId', wheelId);
|
|
151
155
|
// Append the component as a child of the element with hostBusyWheel directive.
|
|
152
|
-
busyWheelDir
|
|
156
|
+
busyWheelDir
|
|
157
|
+
.getRenderer2()
|
|
158
|
+
.appendChild(busyWheelDir.getViewContainerRef().element.nativeElement, busyWheelComponentRef.injector.get(SPMatBusyWheelComponent)
|
|
159
|
+
.elRef.nativeElement);
|
|
153
160
|
// Save the position explicit css style of the element if one was set
|
|
154
161
|
let oldStyles = new Array();
|
|
155
|
-
if (busyWheelDir.
|
|
162
|
+
if (busyWheelDir.getViewContainerRef().element.nativeElement.style
|
|
163
|
+
.position) {
|
|
156
164
|
oldStyles.push({
|
|
157
165
|
style: 'position',
|
|
158
|
-
value: busyWheelDir.
|
|
166
|
+
value: busyWheelDir.getViewContainerRef().element.nativeElement.style
|
|
167
|
+
.position,
|
|
159
168
|
});
|
|
160
169
|
}
|
|
161
170
|
// Set the element's child controls's poisitioning to 'relative'
|
|
162
|
-
busyWheelDir.
|
|
171
|
+
busyWheelDir.getViewContainerRef().element.nativeElement.style.position =
|
|
172
|
+
'relative';
|
|
163
173
|
this.wheelComponents.set(wheelId, {
|
|
164
174
|
component: busyWheelComponentRef,
|
|
165
|
-
oldStyles: []
|
|
175
|
+
oldStyles: [],
|
|
166
176
|
});
|
|
167
177
|
});
|
|
168
178
|
}
|
|
@@ -186,11 +196,13 @@ class BusyWheelService {
|
|
|
186
196
|
hide(id) {
|
|
187
197
|
if (id) {
|
|
188
198
|
const idParts = id.split(',');
|
|
189
|
-
idParts.forEach(id => {
|
|
199
|
+
idParts.forEach((id) => {
|
|
190
200
|
const trimmedId = id.trim();
|
|
191
201
|
const busyWheelDirs = this.namedBusyWheelDirs.get(trimmedId);
|
|
192
202
|
if (busyWheelDirs) {
|
|
193
|
-
const containers = Array.isArray(busyWheelDirs)
|
|
203
|
+
const containers = Array.isArray(busyWheelDirs)
|
|
204
|
+
? busyWheelDirs
|
|
205
|
+
: [busyWheelDirs];
|
|
194
206
|
containers.forEach((busyWheelDir, index) => {
|
|
195
207
|
const wheelId = `${trimmedId}_${index}`;
|
|
196
208
|
const wheelData = this.wheelComponents.get(wheelId);
|
|
@@ -200,9 +212,10 @@ class BusyWheelService {
|
|
|
200
212
|
this.wheelComponents.delete(wheelId);
|
|
201
213
|
if (wheelData?.oldStyles && wheelData.oldStyles.length) {
|
|
202
214
|
// Remove position: relative style that we added
|
|
203
|
-
busyWheelDir.
|
|
204
|
-
|
|
205
|
-
|
|
215
|
+
busyWheelDir.getViewContainerRef().element
|
|
216
|
+
.nativeElement.style.position = '';
|
|
217
|
+
wheelData.oldStyles.forEach((style) => {
|
|
218
|
+
busyWheelDir.getViewContainerRef().element.nativeElement.style[style.style] = style.value;
|
|
206
219
|
});
|
|
207
220
|
}
|
|
208
221
|
}
|
|
@@ -218,7 +231,7 @@ class BusyWheelService {
|
|
|
218
231
|
}
|
|
219
232
|
}
|
|
220
233
|
registerBusyWheelHost(busyWheelDir) {
|
|
221
|
-
const id = busyWheelDir.
|
|
234
|
+
const id = busyWheelDir.getBusyWheelId();
|
|
222
235
|
if (!id) {
|
|
223
236
|
if (!this.defaultBusyWheelDir) {
|
|
224
237
|
if (!this.defaultBusyWheelDir) {
|
|
@@ -236,7 +249,7 @@ class BusyWheelService {
|
|
|
236
249
|
}
|
|
237
250
|
}
|
|
238
251
|
deregisterBusyWheelHost(busyWheelDir) {
|
|
239
|
-
const busyWheelId = busyWheelDir.
|
|
252
|
+
const busyWheelId = busyWheelDir.getBusyWheelId();
|
|
240
253
|
if (!busyWheelId) {
|
|
241
254
|
this.defaultBusyWheelDir = undefined;
|
|
242
255
|
}
|
|
@@ -322,10 +335,10 @@ class BusyWheelService {
|
|
|
322
335
|
busyWheelStyle.remove();
|
|
323
336
|
}
|
|
324
337
|
}
|
|
325
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
326
|
-
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
338
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BusyWheelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
339
|
+
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BusyWheelService, providedIn: 'root' });
|
|
327
340
|
}
|
|
328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BusyWheelService, decorators: [{
|
|
329
342
|
type: Injectable,
|
|
330
343
|
args: [{ providedIn: 'root' }]
|
|
331
344
|
}], ctorParameters: () => [] });
|
|
@@ -448,6 +461,9 @@ function showBusyWheelUntilEmits(numEmits, id, showImmediate = false) {
|
|
|
448
461
|
return trackBusyWheelStatus(id, true, showImmediate, numEmits);
|
|
449
462
|
}
|
|
450
463
|
|
|
464
|
+
class SPMatHostBusyWheelDirectiveBase {
|
|
465
|
+
}
|
|
466
|
+
|
|
451
467
|
/**
|
|
452
468
|
* Use this directive with a unique value assigned to it to display a busy
|
|
453
469
|
* wheel over it. This can be used as:-
|
|
@@ -471,11 +487,12 @@ function showBusyWheelUntilEmits(numEmits, id, showImmediate = false) {
|
|
|
471
487
|
* (or error). Note that you can also use the trackBusyWheelStatus() function
|
|
472
488
|
* if you want more control over the busy wheel.
|
|
473
489
|
*/
|
|
474
|
-
class SPMatHostBusyWheelDirective {
|
|
490
|
+
class SPMatHostBusyWheelDirective extends SPMatHostBusyWheelDirectiveBase {
|
|
475
491
|
viewContainerRef;
|
|
476
492
|
renderer2;
|
|
477
|
-
spHostBusyWheel = input();
|
|
493
|
+
spHostBusyWheel = input(...(ngDevMode ? [undefined, { debugName: "spHostBusyWheel" }] : []));
|
|
478
494
|
constructor(viewContainerRef, renderer2) {
|
|
495
|
+
super();
|
|
479
496
|
this.viewContainerRef = viewContainerRef;
|
|
480
497
|
this.renderer2 = renderer2;
|
|
481
498
|
}
|
|
@@ -485,16 +502,25 @@ class SPMatHostBusyWheelDirective {
|
|
|
485
502
|
ngOnDestroy() {
|
|
486
503
|
deregisterBusyWheelHost(this);
|
|
487
504
|
}
|
|
488
|
-
|
|
489
|
-
|
|
505
|
+
getBusyWheelId() {
|
|
506
|
+
return this.spHostBusyWheel();
|
|
507
|
+
}
|
|
508
|
+
getViewContainerRef() {
|
|
509
|
+
return this.viewContainerRef;
|
|
510
|
+
}
|
|
511
|
+
getRenderer2() {
|
|
512
|
+
return this.renderer2;
|
|
513
|
+
}
|
|
514
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatHostBusyWheelDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
515
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: SPMatHostBusyWheelDirective, isStandalone: true, selector: "[spHostBusyWheel]", inputs: { spHostBusyWheel: { classPropertyName: "spHostBusyWheel", publicName: "spHostBusyWheel", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
490
516
|
}
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatHostBusyWheelDirective, decorators: [{
|
|
492
518
|
type: Directive,
|
|
493
519
|
args: [{
|
|
494
520
|
selector: '[spHostBusyWheel]',
|
|
495
521
|
standalone: true,
|
|
496
522
|
}]
|
|
497
|
-
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }] });
|
|
523
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }], propDecorators: { spHostBusyWheel: [{ type: i0.Input, args: [{ isSignal: true, alias: "spHostBusyWheel", required: false }] }] } });
|
|
498
524
|
|
|
499
525
|
/**
|
|
500
526
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +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,EA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,CAAC,IAAI,CAAC;;0HAdpB,2BAA2B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,SAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;8GAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AC7BD;;AAEG;;;;"}
|
|
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-base.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 { SPMatHostBusyWheelDirectiveBase } from './host-busy-wheel-directive-base';\n// import { 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 private defaultBusyWheelDir!: SPMatHostBusyWheelDirectiveBase;\n private namedBusyWheelDirs = new Map<\n string,\n Array<SPMatHostBusyWheelDirectiveBase>\n >();\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)\n ? busyWheelDirs\n : [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\n .getViewContainerRef()\n .createComponent<SPMatBusyWheelComponent>(\n SPMatBusyWheelComponent,\n );\n busyWheelComponentRef.setInput('wheelId', wheelId);\n // Append the component as a child of the element with hostBusyWheel directive.\n busyWheelDir\n .getRenderer2()\n .appendChild(\n busyWheelDir.getViewContainerRef().element.nativeElement,\n busyWheelComponentRef.injector.get(SPMatBusyWheelComponent)\n .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 (\n busyWheelDir.getViewContainerRef().element.nativeElement.style\n .position\n ) {\n oldStyles.push({\n style: 'position',\n value:\n busyWheelDir.getViewContainerRef().element.nativeElement.style\n .position,\n });\n }\n // Set the element's child controls's poisitioning to 'relative'\n busyWheelDir.getViewContainerRef().element.nativeElement.style.position =\n '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)\n ? busyWheelDirs\n : [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 (\n busyWheelDir.getViewContainerRef().element\n .nativeElement as HTMLElement\n ).style.position = '';\n wheelData.oldStyles.forEach((style) => {\n busyWheelDir.getViewContainerRef().element.nativeElement.style[\n style.style\n ] = 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: SPMatHostBusyWheelDirectiveBase) {\n const id = busyWheelDir.getBusyWheelId();\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: SPMatHostBusyWheelDirectiveBase) {\n const busyWheelId = busyWheelDir.getBusyWheelId();\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(\n containerClass: string,\n id: string | undefined,\n ): 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(\n busyWheelDir: SPMatHostBusyWheelDirectiveBase,\n) {\n const instance = BusyWheelService.getInstance();\n instance.registerBusyWheelHost(busyWheelDir);\n}\n\nexport function deregisterBusyWheelHost(\n busyWheelDir: SPMatHostBusyWheelDirectiveBase,\n) {\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 { Renderer2, ViewContainerRef } from '@angular/core';\n\nexport abstract class SPMatHostBusyWheelDirectiveBase {\n abstract getBusyWheelId(): string | undefined;\n abstract getViewContainerRef(): ViewContainerRef;\n abstract getRenderer2(): Renderer2;\n}\n","import {\n Directive,\n input,\n OnDestroy,\n OnInit,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n deregisterBusyWheelHost,\n registerBusyWheelHost,\n} from './busy-wheel.service';\nimport { SPMatHostBusyWheelDirectiveBase } from './host-busy-wheel-directive-base';\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\n extends SPMatHostBusyWheelDirectiveBase\n implements OnInit, OnDestroy\n{\n spHostBusyWheel = input<string>();\n\n constructor(\n public viewContainerRef: ViewContainerRef,\n public renderer2: Renderer2,\n ) {\n super();\n }\n\n ngOnInit(): void {\n registerBusyWheelHost(this);\n }\n\n ngOnDestroy(): void {\n deregisterBusyWheelHost(this);\n }\n\n getBusyWheelId(): string | undefined {\n return this.spHostBusyWheel();\n }\n\n getViewContainerRef(): ViewContainerRef {\n return this.viewContainerRef;\n }\n\n getRenderer2(): Renderer2 {\n return this.renderer2;\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,mDAAC;AAChC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AAEvB,IAAA,WAAA,CAAmB,KAAiB,E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AA,EAAA,CAAA,gBAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,SAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;+GAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACxCD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, EventEmitter, viewChild,
|
|
2
|
+
import { input, signal, EventEmitter, viewChild, Output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/material/button';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import * as i3 from '@angular/material/icon';
|
|
@@ -18,30 +18,30 @@ class SPMatContextMenuComponent {
|
|
|
18
18
|
* If it is a function, the function will be called with the contextData
|
|
19
19
|
* as the argument when the user clicks on the menu trigger button.
|
|
20
20
|
*/
|
|
21
|
-
menuItems = input.required();
|
|
22
|
-
_menuItems = signal([]);
|
|
21
|
+
menuItems = input.required(...(ngDevMode ? [{ debugName: "menuItems" }] : []));
|
|
22
|
+
_menuItems = signal([], ...(ngDevMode ? [{ debugName: "_menuItems" }] : []));
|
|
23
23
|
/**
|
|
24
24
|
* Label to display for the context menu. If omitted will just show the
|
|
25
25
|
* menuIcon.
|
|
26
26
|
*/
|
|
27
|
-
label = input('');
|
|
27
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
28
28
|
/**
|
|
29
29
|
* Button icon. defaults to more_vert.
|
|
30
30
|
*/
|
|
31
|
-
menuIconName = input('more_vert');
|
|
31
|
+
menuIconName = input('more_vert', ...(ngDevMode ? [{ debugName: "menuIconName" }] : []));
|
|
32
32
|
/**
|
|
33
33
|
* By default the context menu is activated whenever the mouse cursor hovers
|
|
34
34
|
* over the button. Set this to 'true' to disable this feature.
|
|
35
35
|
*/
|
|
36
|
-
enableHover = input(false);
|
|
36
|
+
enableHover = input(false, ...(ngDevMode ? [{ debugName: "enableHover" }] : []));
|
|
37
37
|
/**
|
|
38
38
|
* Context data for menu item disabled callback
|
|
39
39
|
*/
|
|
40
|
-
contextData = input();
|
|
40
|
+
contextData = input(...(ngDevMode ? [undefined, { debugName: "contextData" }] : []));
|
|
41
41
|
/**
|
|
42
42
|
* enable menu backdrop
|
|
43
43
|
*/
|
|
44
|
-
hasBackdrop = input(false);
|
|
44
|
+
hasBackdrop = input(false, ...(ngDevMode ? [{ debugName: "hasBackdrop" }] : []));
|
|
45
45
|
/**
|
|
46
46
|
* Event generated when use selects an item in the context menu. This event
|
|
47
47
|
* is generated only if the context menu item does not specify a route to
|
|
@@ -49,7 +49,7 @@ class SPMatContextMenuComponent {
|
|
|
49
49
|
* value.
|
|
50
50
|
*/
|
|
51
51
|
selected = new EventEmitter();
|
|
52
|
-
menuTrigger = viewChild(MatMenuTrigger);
|
|
52
|
+
menuTrigger = viewChild(MatMenuTrigger, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : []));
|
|
53
53
|
constructor() { }
|
|
54
54
|
ngOnInit() { }
|
|
55
55
|
showMenu() {
|
|
@@ -73,8 +73,8 @@ class SPMatContextMenuComponent {
|
|
|
73
73
|
itemDisabled(menuItem) {
|
|
74
74
|
return menuItem?.disable && menuItem.disable(this.contextData());
|
|
75
75
|
}
|
|
76
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
77
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
76
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SPMatContextMenuComponent, isStandalone: true, selector: "sp-mat-context-menu", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, menuIconName: { classPropertyName: "menuIconName", publicName: "menuIconName", isSignal: true, isRequired: false, transformFunction: null }, enableHover: { classPropertyName: "enableHover", publicName: "enableHover", isSignal: true, isRequired: false, transformFunction: null }, contextData: { classPropertyName: "contextData", publicName: "contextData", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, viewQueries: [{ propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
78
78
|
<button
|
|
79
79
|
#menuTrigger
|
|
80
80
|
mat-icon-button
|
|
@@ -120,9 +120,9 @@ class SPMatContextMenuComponent {
|
|
|
120
120
|
</button> -->
|
|
121
121
|
}
|
|
122
122
|
</mat-menu>
|
|
123
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: HoverDropDownDirective, selector: "[hoverDropDown]", inputs: ["hoverTrigger", "menu"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: HoverDropDownDirective, selector: "[hoverDropDown]", inputs: ["hoverTrigger", "menu"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
124
124
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SPMatContextMenuComponent, decorators: [{
|
|
126
126
|
type: Component,
|
|
127
127
|
args: [{
|
|
128
128
|
imports: [
|
|
@@ -182,9 +182,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
182
182
|
`,
|
|
183
183
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
184
184
|
}]
|
|
185
|
-
}], ctorParameters: () => [], propDecorators: { selected: [{
|
|
185
|
+
}], ctorParameters: () => [], propDecorators: { menuItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItems", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], menuIconName: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuIconName", required: false }] }], enableHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableHover", required: false }] }], contextData: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextData", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], selected: [{
|
|
186
186
|
type: Output
|
|
187
|
-
}] } });
|
|
187
|
+
}], menuTrigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatMenuTrigger), { isSignal: true }] }] } });
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smallpearl-ngx-helper-mat-context-menu.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-context-menu/src/mat-context-menu.component.ts","../../../../projects/smallpearl/ngx-helper/mat-context-menu/smallpearl-ngx-helper-mat-context-menu.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n EventEmitter,\n input,\n OnInit,\n Output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';\nimport { RouterModule } from '@angular/router';\nimport { HoverDropDownDirective } from '@smallpearl/ngx-helper/hover-dropdown';\n\n/**\n * Describes each item in the context menu.\n */\nexport interface SPContextMenuItem {\n // Menu item label\n label: string;\n // Menu icon, A material icon\n icon?: string;\n // Angular route to navigate to when the menu item is selected.\n route?: string | string[];\n // Argument to the (selected) event when this menu item is selected\n // by the user and the corresponding ContextMenuItem does not have a\n // 'route' property value.\n role?: string;\n // Whether the menu item should be disabled\n disable?: (arg: any) => boolean;\n}\n\n@Component({\n imports: [\n RouterModule,\n MatButtonModule,\n MatIconModule,\n MatMenuModule,\n HoverDropDownDirective,\n ],\n selector: 'sp-mat-context-menu',\n template: `\n <button\n #menuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"contextMenu\"\n hoverDropDown\n [menu]=\"contextMenu\"\n (click)=\"$event.stopImmediatePropagation(); showMenu()\"\n >\n @if (menuIconName()) {\n <mat-icon>{{ menuIconName() }}</mat-icon>\n }\n {{ label() }}\n </button>\n <mat-menu #contextMenu=\"matMenu\" [hasBackdrop]=\"hasBackdrop()\">\n @for (menuItem of _menuItems(); track $index) {\n @if (menuItem.role) {\n <button\n mat-menu-item\n [routerLink]=\"menuItem.route ? menuItem.route : undefined\"\n (click)=\"$event.preventDefault(); onSelectMenuItem(menuItem)\"\n [disabled]=\"itemDisabled(menuItem)\"\n >\n @if (menuItem.icon) {\n <mat-icon>{{ menuItem.icon }}</mat-icon>\n }\n {{ menuItem.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.6em;\">\n <strong>{{ menuItem.label }}</strong>\n </div>\n }\n <!-- <button\n mat-menu-item\n [routerLink]=\"menuItem.route ? menuItem.route : undefined\"\n (click)=\"$event.preventDefault(); onSelectMenuItem(menuItem)\"\n [disabled]=\"itemDisabled(menuItem)\"\n >\n @if (menuItem.icon) {\n <mat-icon>{{ menuItem.icon }}</mat-icon>\n }\n {{ menuItem.label }}\n </button> -->\n }\n </mat-menu>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatContextMenuComponent implements OnInit {\n /**\n * The menu items to display. Refer to ContextMenuItem doc for details\n * on the menu items. This can be an array ofSPContextMenuItem objects or\n * a function that returns an array of SPContextMenuItem objects.\n * If it is a function, the function will be called with the contextData\n * as the argument when the user clicks on the menu trigger button.\n */\n menuItems = input.required<SPContextMenuItem[]|((contextData?: any) => SPContextMenuItem[])>();\n\n _menuItems = signal<SPContextMenuItem[]>([])\n /**\n * Label to display for the context menu. If omitted will just show the\n * menuIcon.\n */\n label = input<string>('');\n /**\n * Button icon. defaults to more_vert.\n */\n menuIconName = input<string>('more_vert');\n /**\n * By default the context menu is activated whenever the mouse cursor hovers\n * over the button. Set this to 'true' to disable this feature.\n */\n enableHover = input<boolean>(false);\n /**\n * Context data for menu item disabled callback\n */\n contextData = input<any>();\n /**\n * enable menu backdrop\n */\n hasBackdrop = input<boolean>(false);\n /**\n * Event generated when use selects an item in the context menu. This event\n * is generated only if the context menu item does not specify a route to\n * activate. The string event parameter is ContextMenuItem.role property\n * value.\n */\n @Output() selected = new EventEmitter<string>();\n\n menuTrigger = viewChild(MatMenuTrigger);\n\n constructor() {}\n\n ngOnInit() {}\n\n showMenu() {\n const menuTrigger = this.menuTrigger();\n const menuItems = this.menuItems();\n if (typeof menuItems === 'function') {\n this._menuItems.set(menuItems(this.contextData()));\n } else {\n this._menuItems.set(menuItems);\n }\n if (menuTrigger) {\n menuTrigger.openMenu();\n }\n }\n\n onSelectMenuItem(item: SPContextMenuItem) {\n if (!item.route) {\n this.selected.emit(item?.role || item.label);\n }\n }\n\n itemDisabled(menuItem: SPContextMenuItem) {\n return menuItem?.disable && menuItem.disable(this.contextData());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MA6Fa,yBAAyB,CAAA;AACpC;;;;;;AAMG;AACH,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-context-menu.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-context-menu/src/mat-context-menu.component.ts","../../../../projects/smallpearl/ngx-helper/mat-context-menu/smallpearl-ngx-helper-mat-context-menu.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n EventEmitter,\n input,\n OnInit,\n Output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';\nimport { RouterModule } from '@angular/router';\nimport { HoverDropDownDirective } from '@smallpearl/ngx-helper/hover-dropdown';\n\n/**\n * Describes each item in the context menu.\n */\nexport interface SPContextMenuItem {\n // Menu item label\n label: string;\n // Menu icon, A material icon\n icon?: string;\n // Angular route to navigate to when the menu item is selected.\n route?: string | string[];\n // Argument to the (selected) event when this menu item is selected\n // by the user and the corresponding ContextMenuItem does not have a\n // 'route' property value.\n role?: string;\n // Whether the menu item should be disabled\n disable?: (arg: any) => boolean;\n}\n\n@Component({\n imports: [\n RouterModule,\n MatButtonModule,\n MatIconModule,\n MatMenuModule,\n HoverDropDownDirective,\n ],\n selector: 'sp-mat-context-menu',\n template: `\n <button\n #menuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"contextMenu\"\n hoverDropDown\n [menu]=\"contextMenu\"\n (click)=\"$event.stopImmediatePropagation(); showMenu()\"\n >\n @if (menuIconName()) {\n <mat-icon>{{ menuIconName() }}</mat-icon>\n }\n {{ label() }}\n </button>\n <mat-menu #contextMenu=\"matMenu\" [hasBackdrop]=\"hasBackdrop()\">\n @for (menuItem of _menuItems(); track $index) {\n @if (menuItem.role) {\n <button\n mat-menu-item\n [routerLink]=\"menuItem.route ? menuItem.route : undefined\"\n (click)=\"$event.preventDefault(); onSelectMenuItem(menuItem)\"\n [disabled]=\"itemDisabled(menuItem)\"\n >\n @if (menuItem.icon) {\n <mat-icon>{{ menuItem.icon }}</mat-icon>\n }\n {{ menuItem.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.6em;\">\n <strong>{{ menuItem.label }}</strong>\n </div>\n }\n <!-- <button\n mat-menu-item\n [routerLink]=\"menuItem.route ? menuItem.route : undefined\"\n (click)=\"$event.preventDefault(); onSelectMenuItem(menuItem)\"\n [disabled]=\"itemDisabled(menuItem)\"\n >\n @if (menuItem.icon) {\n <mat-icon>{{ menuItem.icon }}</mat-icon>\n }\n {{ menuItem.label }}\n </button> -->\n }\n </mat-menu>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatContextMenuComponent implements OnInit {\n /**\n * The menu items to display. Refer to ContextMenuItem doc for details\n * on the menu items. This can be an array ofSPContextMenuItem objects or\n * a function that returns an array of SPContextMenuItem objects.\n * If it is a function, the function will be called with the contextData\n * as the argument when the user clicks on the menu trigger button.\n */\n menuItems = input.required<SPContextMenuItem[]|((contextData?: any) => SPContextMenuItem[])>();\n\n _menuItems = signal<SPContextMenuItem[]>([])\n /**\n * Label to display for the context menu. If omitted will just show the\n * menuIcon.\n */\n label = input<string>('');\n /**\n * Button icon. defaults to more_vert.\n */\n menuIconName = input<string>('more_vert');\n /**\n * By default the context menu is activated whenever the mouse cursor hovers\n * over the button. Set this to 'true' to disable this feature.\n */\n enableHover = input<boolean>(false);\n /**\n * Context data for menu item disabled callback\n */\n contextData = input<any>();\n /**\n * enable menu backdrop\n */\n hasBackdrop = input<boolean>(false);\n /**\n * Event generated when use selects an item in the context menu. This event\n * is generated only if the context menu item does not specify a route to\n * activate. The string event parameter is ContextMenuItem.role property\n * value.\n */\n @Output() selected = new EventEmitter<string>();\n\n menuTrigger = viewChild(MatMenuTrigger);\n\n constructor() {}\n\n ngOnInit() {}\n\n showMenu() {\n const menuTrigger = this.menuTrigger();\n const menuItems = this.menuItems();\n if (typeof menuItems === 'function') {\n this._menuItems.set(menuItems(this.contextData()));\n } else {\n this._menuItems.set(menuItems);\n }\n if (menuTrigger) {\n menuTrigger.openMenu();\n }\n }\n\n onSelectMenuItem(item: SPContextMenuItem) {\n if (!item.route) {\n this.selected.emit(item?.role || item.label);\n }\n }\n\n itemDisabled(menuItem: SPContextMenuItem) {\n return menuItem?.disable && menuItem.disable(this.contextData());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MA6Fa,yBAAyB,CAAA;AACpC;;;;;;AAMG;AACH,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAoE;AAE9F,IAAA,UAAU,GAAG,MAAM,CAAsB,EAAE,sDAAC;AAC5C;;;AAGG;AACH,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AACzB;;AAEG;AACH,IAAA,YAAY,GAAG,KAAK,CAAS,WAAW,wDAAC;AACzC;;;AAGG;AACH,IAAA,WAAW,GA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