wacom 21.1.21 → 21.1.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/fesm2022/wacom.mjs +49 -17
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +17 -7
package/fesm2022/wacom.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, PLATFORM_ID, Inject, Optional, Injectable, signal, ChangeDetectorRef, output, ElementRef,
|
|
2
|
+
import { InjectionToken, inject, PLATFORM_ID, Inject, Optional, Injectable, DestroyRef, signal, computed, ChangeDetectorRef, output, ElementRef, Directive, input, effect, Pipe, isSignal, ApplicationRef, EnvironmentInjector, createComponent, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$2 from '@angular/common';
|
|
4
4
|
import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
@@ -51,6 +51,16 @@ const NETWORK_CONFIG = new InjectionToken('NETWORK_CONFIG', {
|
|
|
51
51
|
factory: () => DEFAULT_NETWORK_CONFIG,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
// Add capitalize method to String prototype if it doesn't already exist
|
|
55
|
+
if (!String.prototype.capitalize) {
|
|
56
|
+
String.prototype.capitalize = function () {
|
|
57
|
+
if (this.length > 0) {
|
|
58
|
+
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
|
|
59
|
+
}
|
|
60
|
+
return '';
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
/**
|
|
55
65
|
* Utility helpers for meta management.
|
|
56
66
|
*
|
|
@@ -419,23 +429,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
419
429
|
}], ctorParameters: () => [{ type: MetaService }] });
|
|
420
430
|
|
|
421
431
|
// Core utilities and helpers for the Wacom app
|
|
422
|
-
// Add capitalize method to String prototype if it doesn't already exist
|
|
423
|
-
if (!String.prototype.capitalize) {
|
|
424
|
-
String.prototype.capitalize = function () {
|
|
425
|
-
if (this.length > 0) {
|
|
426
|
-
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
|
|
427
|
-
}
|
|
428
|
-
return '';
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
432
|
class CoreService {
|
|
432
433
|
constructor() {
|
|
433
|
-
this.
|
|
434
|
+
this._platformId = inject(PLATFORM_ID);
|
|
435
|
+
this._isBrowser = isPlatformBrowser(this._platformId);
|
|
436
|
+
this._destroyRef = inject(DestroyRef);
|
|
434
437
|
this.deviceID = '';
|
|
435
438
|
// After While
|
|
436
439
|
this._afterWhile = {};
|
|
437
440
|
// Device management
|
|
438
441
|
this.device = '';
|
|
442
|
+
// Viewport management (responsive breakpoint)
|
|
443
|
+
this.viewport = signal('desktop', ...(ngDevMode ? [{ debugName: "viewport" }] : []));
|
|
444
|
+
this.isViewportMobile = computed(() => this.viewport() === 'mobile', ...(ngDevMode ? [{ debugName: "isViewportMobile" }] : []));
|
|
445
|
+
this.isViewportTablet = computed(() => this.viewport() === 'tablet', ...(ngDevMode ? [{ debugName: "isViewportTablet" }] : []));
|
|
446
|
+
this.isViewportDesktop = computed(() => this.viewport() === 'desktop', ...(ngDevMode ? [{ debugName: "isViewportDesktop" }] : []));
|
|
439
447
|
// Version management
|
|
440
448
|
this.version = '1.0.0';
|
|
441
449
|
this.appVersion = '';
|
|
@@ -452,6 +460,7 @@ class CoreService {
|
|
|
452
460
|
: this.UUID());
|
|
453
461
|
localStorage.setItem('deviceID', this.deviceID);
|
|
454
462
|
this.detectDevice();
|
|
463
|
+
this.detectViewport();
|
|
455
464
|
}
|
|
456
465
|
else {
|
|
457
466
|
this.deviceID = this.UUID();
|
|
@@ -654,6 +663,29 @@ class CoreService {
|
|
|
654
663
|
isIos() {
|
|
655
664
|
return this.device === 'iOS';
|
|
656
665
|
}
|
|
666
|
+
detectViewport() {
|
|
667
|
+
if (!this._isBrowser)
|
|
668
|
+
return;
|
|
669
|
+
const mqMobile = window.matchMedia('(max-width: 767.98px)');
|
|
670
|
+
const mqTablet = window.matchMedia('(min-width: 768px) and (max-width: 1023.98px)');
|
|
671
|
+
const mqDesktop = window.matchMedia('(min-width: 1024px)');
|
|
672
|
+
const update = () => {
|
|
673
|
+
if (mqMobile.matches)
|
|
674
|
+
return this.viewport.set('mobile');
|
|
675
|
+
if (mqTablet.matches)
|
|
676
|
+
return this.viewport.set('tablet');
|
|
677
|
+
return this.viewport.set('desktop');
|
|
678
|
+
};
|
|
679
|
+
update();
|
|
680
|
+
mqMobile.addEventListener('change', update);
|
|
681
|
+
mqTablet.addEventListener('change', update);
|
|
682
|
+
mqDesktop.addEventListener('change', update);
|
|
683
|
+
this._destroyRef.onDestroy(() => {
|
|
684
|
+
mqMobile.removeEventListener('change', update);
|
|
685
|
+
mqTablet.removeEventListener('change', update);
|
|
686
|
+
mqDesktop.removeEventListener('change', update);
|
|
687
|
+
});
|
|
688
|
+
}
|
|
657
689
|
/**
|
|
658
690
|
* Sets the combined version string based on appVersion and dateVersion.
|
|
659
691
|
*/
|
|
@@ -887,7 +919,7 @@ class CrudComponent {
|
|
|
887
919
|
/** Name of the collection or module used for contextual actions. */
|
|
888
920
|
this._module = '';
|
|
889
921
|
const form = formConfig;
|
|
890
|
-
this.
|
|
922
|
+
this.__formService = formService;
|
|
891
923
|
this.form = form;
|
|
892
924
|
this.crudService = crudService;
|
|
893
925
|
this._module = module;
|
|
@@ -962,7 +994,7 @@ class CrudComponent {
|
|
|
962
994
|
*/
|
|
963
995
|
bulkManagement(isCreateFlow = true) {
|
|
964
996
|
return () => {
|
|
965
|
-
this.
|
|
997
|
+
this.__formService
|
|
966
998
|
.modalDocs(isCreateFlow
|
|
967
999
|
? []
|
|
968
1000
|
: this.documents().map((obj) => Object.fromEntries(this.updatableFields.map((key) => [
|
|
@@ -1003,7 +1035,7 @@ class CrudComponent {
|
|
|
1003
1035
|
}
|
|
1004
1036
|
/** Opens a modal to create a new document. */
|
|
1005
1037
|
create() {
|
|
1006
|
-
this.
|
|
1038
|
+
this.__formService.modal(this.form, {
|
|
1007
1039
|
label: 'Create',
|
|
1008
1040
|
click: async (created, close) => {
|
|
1009
1041
|
close();
|
|
@@ -1017,7 +1049,7 @@ class CrudComponent {
|
|
|
1017
1049
|
}
|
|
1018
1050
|
/** Displays a modal to edit an existing document. */
|
|
1019
1051
|
update(doc) {
|
|
1020
|
-
this.
|
|
1052
|
+
this.__formService.modal(this.form, {
|
|
1021
1053
|
label: 'Update',
|
|
1022
1054
|
click: (updated, close) => {
|
|
1023
1055
|
close();
|
|
@@ -1035,7 +1067,7 @@ class CrudComponent {
|
|
|
1035
1067
|
}
|
|
1036
1068
|
/** Opens a modal to edit the document's unique URL. */
|
|
1037
1069
|
mutateUrl(doc) {
|
|
1038
|
-
this.
|
|
1070
|
+
this.__formService.modalUnique(this._module, 'url', doc);
|
|
1039
1071
|
}
|
|
1040
1072
|
/** Moves the given document one position up and updates ordering. */
|
|
1041
1073
|
moveUp(doc) {
|
|
@@ -3173,7 +3205,7 @@ class CrudService {
|
|
|
3173
3205
|
_syncSignalForDoc(doc) {
|
|
3174
3206
|
const id = this._id(doc);
|
|
3175
3207
|
if (id && this._signal[id]) {
|
|
3176
|
-
this._signal[id].set(doc);
|
|
3208
|
+
this._signal[id].set({ ...doc });
|
|
3177
3209
|
}
|
|
3178
3210
|
this._updateSignals();
|
|
3179
3211
|
}
|