wacom 21.1.3 → 21.1.5
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 +288 -134
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +307 -205
package/fesm2022/wacom.mjs
CHANGED
|
@@ -186,10 +186,10 @@ class MetaService {
|
|
|
186
186
|
console.warn(`To disable these warnings, set metaConfig.warnMissingGuard: false in your MetaConfig passed to MetaModule.forRoot()`);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
190
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaService, deps: [{ token: CONFIG_TOKEN, optional: true }, { token: i1.Router }, { token: i2.Meta }, { token: i2.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
190
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaService, providedIn: 'root' }); }
|
|
191
191
|
}
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaService, decorators: [{
|
|
193
193
|
type: Injectable,
|
|
194
194
|
args: [{
|
|
195
195
|
providedIn: 'root',
|
|
@@ -249,10 +249,10 @@ class MetaGuard {
|
|
|
249
249
|
this.metaService.setTag(key, this._meta.defaults[key]);
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
253
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaGuard, deps: [{ token: MetaService }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
253
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaGuard, providedIn: 'root' }); }
|
|
254
254
|
}
|
|
255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MetaGuard, decorators: [{
|
|
256
256
|
type: Injectable,
|
|
257
257
|
args: [{ providedIn: 'root' }]
|
|
258
258
|
}], ctorParameters: () => [{ type: MetaService }, { type: undefined, decorators: [{
|
|
@@ -675,10 +675,10 @@ class CoreService {
|
|
|
675
675
|
if (sig)
|
|
676
676
|
sig.update(updater);
|
|
677
677
|
}
|
|
678
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
679
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CoreService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
679
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CoreService, providedIn: 'root' }); }
|
|
680
680
|
}
|
|
681
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: CoreService, decorators: [{
|
|
682
682
|
type: Injectable,
|
|
683
683
|
args: [{
|
|
684
684
|
providedIn: 'root',
|
|
@@ -702,13 +702,19 @@ class CrudComponent {
|
|
|
702
702
|
*/
|
|
703
703
|
constructor(formConfig, formService, crudService, module = '') {
|
|
704
704
|
/** The array of documents currently loaded and shown */
|
|
705
|
-
this.documents = signal([],
|
|
705
|
+
this.documents = signal([], ...(ngDevMode ? [{ debugName: "documents" }] : []));
|
|
706
706
|
/** Current pagination page */
|
|
707
707
|
this.page = 1;
|
|
708
708
|
/** CoreService handles timing and copying helpers */
|
|
709
709
|
this.__core = inject(CoreService);
|
|
710
710
|
/** ChangeDetectorRef handles on push strategy */
|
|
711
711
|
this.__cdr = inject(ChangeDetectorRef);
|
|
712
|
+
/**
|
|
713
|
+
* Optional client-side predicate used when `configType === 'local'`.
|
|
714
|
+
* Only documents for which this function returns `true` will be included
|
|
715
|
+
* in the list returned by `setDocuments()` in local mode.
|
|
716
|
+
*/
|
|
717
|
+
this.localDocumentsFilter = () => true;
|
|
712
718
|
/** Fields considered when performing bulk updates. */
|
|
713
719
|
this.updatableFields = ['_id', 'name', 'description', 'data'];
|
|
714
720
|
/** Data source mode used for document retrieval. */
|
|
@@ -742,7 +748,7 @@ class CrudComponent {
|
|
|
742
748
|
}
|
|
743
749
|
else {
|
|
744
750
|
this.documents.update(() => this.crudService
|
|
745
|
-
.getDocs()
|
|
751
|
+
.getDocs(this.localDocumentsFilter)
|
|
746
752
|
.map((doc) => this.crudService.getSignal(doc)));
|
|
747
753
|
this.crudService.loaded.pipe(take(1)).subscribe(() => {
|
|
748
754
|
resolve();
|
|
@@ -790,17 +796,17 @@ class CrudComponent {
|
|
|
790
796
|
* In creation mode, adds new documents.
|
|
791
797
|
* In update mode, syncs changes and deletes removed entries.
|
|
792
798
|
*/
|
|
793
|
-
bulkManagement(
|
|
799
|
+
bulkManagement(isCreateFlow = true) {
|
|
794
800
|
return () => {
|
|
795
801
|
this.__form
|
|
796
|
-
.modalDocs(
|
|
802
|
+
.modalDocs(isCreateFlow
|
|
797
803
|
? []
|
|
798
804
|
: this.documents().map((obj) => Object.fromEntries(this.updatableFields.map((key) => [
|
|
799
805
|
key,
|
|
800
806
|
obj()[key],
|
|
801
807
|
]))))
|
|
802
808
|
.then(async (docs) => {
|
|
803
|
-
if (
|
|
809
|
+
if (isCreateFlow) {
|
|
804
810
|
for (const doc of docs) {
|
|
805
811
|
this.preCreate(doc);
|
|
806
812
|
await firstValueFrom(this.crudService.create(doc));
|
|
@@ -971,10 +977,10 @@ class ClickOutsideDirective {
|
|
|
971
977
|
// cleanup
|
|
972
978
|
this._dref.onDestroy(() => document.removeEventListener('pointerdown', this.handler, true));
|
|
973
979
|
}
|
|
974
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
975
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.
|
|
980
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
981
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.3", type: ClickOutsideDirective, isStandalone: true, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, ngImport: i0 }); }
|
|
976
982
|
}
|
|
977
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
978
984
|
type: Directive,
|
|
979
985
|
args: [{
|
|
980
986
|
selector: '[clickOutside]',
|
|
@@ -994,12 +1000,12 @@ class ManualDisabledDirective {
|
|
|
994
1000
|
if (!native)
|
|
995
1001
|
return;
|
|
996
1002
|
native.disabled = !!disabled;
|
|
997
|
-
},
|
|
1003
|
+
}, ...(ngDevMode ? [{ debugName: "syncDisabledEffect" }] : []));
|
|
998
1004
|
}
|
|
999
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1000
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
1005
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualDisabledDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1006
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: ManualDisabledDirective, isStandalone: true, selector: "input[manualDisabled], textarea[manualDisabled]", inputs: { manualDisabled: { classPropertyName: "manualDisabled", publicName: "manualDisabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1001
1007
|
}
|
|
1002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualDisabledDirective, decorators: [{
|
|
1003
1009
|
type: Directive,
|
|
1004
1010
|
args: [{
|
|
1005
1011
|
selector: 'input[manualDisabled], textarea[manualDisabled]',
|
|
@@ -1021,12 +1027,12 @@ class ManualNameDirective {
|
|
|
1021
1027
|
if (native.name !== name) {
|
|
1022
1028
|
native.name = name;
|
|
1023
1029
|
}
|
|
1024
|
-
},
|
|
1030
|
+
}, ...(ngDevMode ? [{ debugName: "syncNameEffect" }] : []));
|
|
1025
1031
|
}
|
|
1026
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1027
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
1032
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualNameDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1033
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: ManualNameDirective, isStandalone: true, selector: "input[manualName], textarea[manualName]", inputs: { manualName: { classPropertyName: "manualName", publicName: "manualName", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1028
1034
|
}
|
|
1029
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualNameDirective, decorators: [{
|
|
1030
1036
|
type: Directive,
|
|
1031
1037
|
args: [{
|
|
1032
1038
|
selector: 'input[manualName], textarea[manualName]',
|
|
@@ -1046,12 +1052,12 @@ class ManualReadonlyDirective {
|
|
|
1046
1052
|
if (!native)
|
|
1047
1053
|
return;
|
|
1048
1054
|
native.readOnly = !!readonly;
|
|
1049
|
-
},
|
|
1055
|
+
}, ...(ngDevMode ? [{ debugName: "syncReadonlyEffect" }] : []));
|
|
1050
1056
|
}
|
|
1051
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1052
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
1057
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualReadonlyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1058
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: ManualReadonlyDirective, isStandalone: true, selector: "input[manualReadonly], textarea[manualReadonly]", inputs: { manualReadonly: { classPropertyName: "manualReadonly", publicName: "manualReadonly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1053
1059
|
}
|
|
1054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualReadonlyDirective, decorators: [{
|
|
1055
1061
|
type: Directive,
|
|
1056
1062
|
args: [{
|
|
1057
1063
|
selector: 'input[manualReadonly], textarea[manualReadonly]',
|
|
@@ -1073,12 +1079,12 @@ class ManualTypeDirective {
|
|
|
1073
1079
|
if (native.type !== t) {
|
|
1074
1080
|
native.type = t;
|
|
1075
1081
|
}
|
|
1076
|
-
},
|
|
1082
|
+
}, ...(ngDevMode ? [{ debugName: "syncTypeEffect" }] : []));
|
|
1077
1083
|
}
|
|
1078
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1079
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
1084
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualTypeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1085
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.3", type: ManualTypeDirective, isStandalone: true, selector: "input[manualType], textarea[manualType]", inputs: { manualType: { classPropertyName: "manualType", publicName: "manualType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
1080
1086
|
}
|
|
1081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ManualTypeDirective, decorators: [{
|
|
1082
1088
|
type: Directive,
|
|
1083
1089
|
args: [{
|
|
1084
1090
|
selector: 'input[manualType], textarea[manualType]',
|
|
@@ -1117,10 +1123,10 @@ class ArrPipe {
|
|
|
1117
1123
|
}
|
|
1118
1124
|
return arr;
|
|
1119
1125
|
}
|
|
1120
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1121
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1126
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ArrPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1127
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: ArrPipe, isStandalone: true, name: "arr" }); }
|
|
1122
1128
|
}
|
|
1123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ArrPipe, decorators: [{
|
|
1124
1130
|
type: Pipe,
|
|
1125
1131
|
args: [{
|
|
1126
1132
|
name: 'arr',
|
|
@@ -1134,10 +1140,10 @@ class MongodatePipe {
|
|
|
1134
1140
|
let timestamp = _id.toString().substring(0, 8);
|
|
1135
1141
|
return new Date(parseInt(timestamp, 16) * 1000);
|
|
1136
1142
|
}
|
|
1137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1138
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MongodatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1144
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: MongodatePipe, isStandalone: true, name: "mongodate" }); }
|
|
1139
1145
|
}
|
|
1140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MongodatePipe, decorators: [{
|
|
1141
1147
|
type: Pipe,
|
|
1142
1148
|
args: [{
|
|
1143
1149
|
name: 'mongodate',
|
|
@@ -1149,10 +1155,10 @@ class NumberPipe {
|
|
|
1149
1155
|
const result = Number(value); // Convert value to a number
|
|
1150
1156
|
return isNaN(result) ? 0 : result; // Return 0 if conversion fails
|
|
1151
1157
|
}
|
|
1152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1153
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: NumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1159
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: NumberPipe, isStandalone: true, name: "number" }); }
|
|
1154
1160
|
}
|
|
1155
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: NumberPipe, decorators: [{
|
|
1156
1162
|
type: Pipe,
|
|
1157
1163
|
args: [{
|
|
1158
1164
|
name: 'number',
|
|
@@ -1180,10 +1186,10 @@ class PaginationPipe {
|
|
|
1180
1186
|
}
|
|
1181
1187
|
return arr.slice((config.page - 1) * config.perPage, config.page * config.perPage);
|
|
1182
1188
|
}
|
|
1183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1184
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: PaginationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1190
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: PaginationPipe, isStandalone: true, name: "page", pure: false }); }
|
|
1185
1191
|
}
|
|
1186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: PaginationPipe, decorators: [{
|
|
1187
1193
|
type: Pipe,
|
|
1188
1194
|
args: [{
|
|
1189
1195
|
name: 'page',
|
|
@@ -1198,10 +1204,10 @@ class SafePipe {
|
|
|
1198
1204
|
transform(html) {
|
|
1199
1205
|
return this._sanitizer.bypassSecurityTrustResourceUrl(html);
|
|
1200
1206
|
}
|
|
1201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1202
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SafePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1208
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: SafePipe, isStandalone: true, name: "safe" }); }
|
|
1203
1209
|
}
|
|
1204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SafePipe, decorators: [{
|
|
1205
1211
|
type: Pipe,
|
|
1206
1212
|
args: [{
|
|
1207
1213
|
name: 'safe',
|
|
@@ -1268,10 +1274,10 @@ class SearchPipe {
|
|
|
1268
1274
|
: Object.entries(items).forEach(([k, v]) => check(v, k));
|
|
1269
1275
|
return limit ? out.slice(0, limit) : out;
|
|
1270
1276
|
}
|
|
1271
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1272
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1277
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1278
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: SearchPipe, isStandalone: true, name: "search" }); }
|
|
1273
1279
|
}
|
|
1274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchPipe, decorators: [{
|
|
1275
1281
|
type: Pipe,
|
|
1276
1282
|
args: [{ name: 'search', pure: true }]
|
|
1277
1283
|
}] });
|
|
@@ -1331,10 +1337,10 @@ class SplicePipe {
|
|
|
1331
1337
|
}
|
|
1332
1338
|
return arr;
|
|
1333
1339
|
}
|
|
1334
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1335
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SplicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1341
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: SplicePipe, isStandalone: true, name: "splice" }); }
|
|
1336
1342
|
}
|
|
1337
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SplicePipe, decorators: [{
|
|
1338
1344
|
type: Pipe,
|
|
1339
1345
|
args: [{
|
|
1340
1346
|
name: 'splice',
|
|
@@ -1346,10 +1352,10 @@ class SplitPipe {
|
|
|
1346
1352
|
const arr = value.split(devider);
|
|
1347
1353
|
return arr.length > index ? arr[index] : '';
|
|
1348
1354
|
}
|
|
1349
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1350
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.
|
|
1355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SplitPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1356
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: SplitPipe, isStandalone: true, name: "split" }); }
|
|
1351
1357
|
}
|
|
1352
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SplitPipe, decorators: [{
|
|
1353
1359
|
type: Pipe,
|
|
1354
1360
|
args: [{
|
|
1355
1361
|
name: 'split',
|
|
@@ -1472,10 +1478,10 @@ class EmitterService {
|
|
|
1472
1478
|
}
|
|
1473
1479
|
return source$;
|
|
1474
1480
|
}
|
|
1475
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1476
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
1481
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: EmitterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1482
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: EmitterService, providedIn: 'root' }); }
|
|
1477
1483
|
}
|
|
1478
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: EmitterService, decorators: [{
|
|
1479
1485
|
type: Injectable,
|
|
1480
1486
|
args: [{ providedIn: 'root' }]
|
|
1481
1487
|
}] });
|
|
@@ -1801,10 +1807,10 @@ class HttpService {
|
|
|
1801
1807
|
}
|
|
1802
1808
|
return newDoc;
|
|
1803
1809
|
}
|
|
1804
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1805
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
1810
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: HttpService, deps: [{ token: CONFIG_TOKEN, optional: true }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1811
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: HttpService, providedIn: 'root' }); }
|
|
1806
1812
|
}
|
|
1807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: HttpService, decorators: [{
|
|
1808
1814
|
type: Injectable,
|
|
1809
1815
|
args: [{
|
|
1810
1816
|
providedIn: 'root',
|
|
@@ -1824,9 +1830,9 @@ class NetworkService {
|
|
|
1824
1830
|
*/
|
|
1825
1831
|
constructor(config) {
|
|
1826
1832
|
/** Internal mutable signals. */
|
|
1827
|
-
this._status = signal(navigator.onLine ? 'poor' : 'none',
|
|
1828
|
-
this._latencyMs = signal(null,
|
|
1829
|
-
this._isOnline = signal(navigator.onLine,
|
|
1833
|
+
this._status = signal(navigator.onLine ? 'poor' : 'none', ...(ngDevMode ? [{ debugName: "_status" }] : []));
|
|
1834
|
+
this._latencyMs = signal(null, ...(ngDevMode ? [{ debugName: "_latencyMs" }] : []));
|
|
1835
|
+
this._isOnline = signal(navigator.onLine, ...(ngDevMode ? [{ debugName: "_isOnline" }] : []));
|
|
1830
1836
|
/** Public read-only signals. */
|
|
1831
1837
|
this.status = this._status.asReadonly();
|
|
1832
1838
|
this.latencyMs = this._latencyMs.asReadonly();
|
|
@@ -1948,10 +1954,10 @@ class NetworkService {
|
|
|
1948
1954
|
return { ok: false, latency: null };
|
|
1949
1955
|
}
|
|
1950
1956
|
}
|
|
1951
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1952
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
1957
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: NetworkService, deps: [{ token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1958
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: NetworkService, providedIn: 'root' }); }
|
|
1953
1959
|
}
|
|
1954
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: NetworkService, decorators: [{
|
|
1955
1961
|
type: Injectable,
|
|
1956
1962
|
args: [{ providedIn: 'root' }]
|
|
1957
1963
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -2126,10 +2132,10 @@ class StoreService {
|
|
|
2126
2132
|
}
|
|
2127
2133
|
return key;
|
|
2128
2134
|
}
|
|
2129
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
2130
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
2135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: StoreService, deps: [{ token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2136
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: StoreService, providedIn: 'root' }); }
|
|
2131
2137
|
}
|
|
2132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
2138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: StoreService, decorators: [{
|
|
2133
2139
|
type: Injectable,
|
|
2134
2140
|
args: [{
|
|
2135
2141
|
providedIn: 'root',
|
|
@@ -2154,41 +2160,66 @@ class CrudService {
|
|
|
2154
2160
|
constructor(_config) {
|
|
2155
2161
|
this._config = _config;
|
|
2156
2162
|
/**
|
|
2157
|
-
* URL for the API.
|
|
2163
|
+
* Base URL for the API collection associated with this service.
|
|
2158
2164
|
*/
|
|
2159
2165
|
this._url = '/api/';
|
|
2160
2166
|
/**
|
|
2161
|
-
*
|
|
2167
|
+
* In-memory cache with all documents currently known by the service.
|
|
2162
2168
|
*/
|
|
2163
2169
|
this._docs = [];
|
|
2164
2170
|
/**
|
|
2165
|
-
* Number of documents per page.
|
|
2171
|
+
* Number of documents per page for paginated `get()` calls.
|
|
2166
2172
|
*/
|
|
2167
2173
|
this._perPage = 20;
|
|
2168
2174
|
/**
|
|
2169
|
-
*
|
|
2175
|
+
* Registered callbacks that recompute filtered document views.
|
|
2170
2176
|
*/
|
|
2171
2177
|
this._filteredDocumentsCallbacks = [];
|
|
2172
2178
|
/**
|
|
2173
|
-
*
|
|
2174
|
-
*
|
|
2175
|
-
* @param _config - Configuration options for the CRUD service.
|
|
2176
|
-
* @param __httpService - Service to handle HTTP requests.
|
|
2177
|
-
* @param __storeService - Service to manage local storage of documents.
|
|
2178
|
-
* @param __coreService - Core service for utility functions.
|
|
2179
|
+
* HTTP client wrapper used for API communication.
|
|
2179
2180
|
*/
|
|
2180
2181
|
this.__httpService = inject(HttpService);
|
|
2182
|
+
/**
|
|
2183
|
+
* Key–value storage service used to persist documents locally.
|
|
2184
|
+
*/
|
|
2181
2185
|
this.__storeService = inject(StoreService);
|
|
2186
|
+
/**
|
|
2187
|
+
* Core helper service with utility methods (copy, debounce, toSignal, etc.).
|
|
2188
|
+
*/
|
|
2182
2189
|
this.__coreService = inject(CoreService);
|
|
2190
|
+
/**
|
|
2191
|
+
* Global event bus for cross-service communication.
|
|
2192
|
+
*/
|
|
2183
2193
|
this.__emitterService = inject(EmitterService);
|
|
2194
|
+
/**
|
|
2195
|
+
* Network status service used to queue work while offline.
|
|
2196
|
+
*/
|
|
2184
2197
|
this.__networkService = inject(NetworkService);
|
|
2185
2198
|
/**
|
|
2186
2199
|
* Cache of per-document signals indexed by document _id.
|
|
2187
2200
|
* Prevents creating multiple signals for the same document.
|
|
2188
2201
|
*/
|
|
2202
|
+
this._signal = {};
|
|
2203
|
+
/**
|
|
2204
|
+
* Cache of per (field,value) lists of document signals.
|
|
2205
|
+
* Key format: `${field}_${JSON.stringify(value)}`.
|
|
2206
|
+
*/
|
|
2189
2207
|
this._signals = {};
|
|
2208
|
+
/**
|
|
2209
|
+
* Cache of per-field maps: fieldValue -> array of document signals.
|
|
2210
|
+
*/
|
|
2211
|
+
this._fieldSignals = {};
|
|
2212
|
+
/**
|
|
2213
|
+
* Track pending fetch-by-id requests to avoid duplicate calls.
|
|
2214
|
+
*/
|
|
2190
2215
|
this._fetchingId = {};
|
|
2216
|
+
/**
|
|
2217
|
+
* Queue of operations that must be retried when network comes back online.
|
|
2218
|
+
*/
|
|
2191
2219
|
this._onOnline = [];
|
|
2220
|
+
/**
|
|
2221
|
+
* Local counter used to build unique local identifiers together with Date.now().
|
|
2222
|
+
*/
|
|
2192
2223
|
this._randomCount = 0;
|
|
2193
2224
|
this._config.signalFields = this._config.signalFields || {};
|
|
2194
2225
|
this._url += this._config.name;
|
|
@@ -2219,49 +2250,131 @@ class CrudService {
|
|
|
2219
2250
|
* Returns a WritableSignal for a document by _id, creating it if absent.
|
|
2220
2251
|
* Caches the signal to avoid redundant instances and initializes it
|
|
2221
2252
|
* with the current snapshot of the document.
|
|
2222
|
-
* Work very carefully with this and localId, better avoid such flows
|
|
2223
|
-
*
|
|
2253
|
+
* Work very carefully with this and localId, better avoid such flows.
|
|
2254
|
+
*
|
|
2255
|
+
* @param _id - Document identifier or a document instance.
|
|
2224
2256
|
*/
|
|
2225
2257
|
getSignal(_id) {
|
|
2226
2258
|
if (typeof _id !== 'string') {
|
|
2227
2259
|
_id = this._id(_id);
|
|
2228
2260
|
}
|
|
2229
2261
|
// Reuse existing signal if present
|
|
2230
|
-
if (this.
|
|
2231
|
-
return this.
|
|
2262
|
+
if (this._signal[_id]) {
|
|
2263
|
+
return this._signal[_id];
|
|
2232
2264
|
}
|
|
2233
2265
|
// Always base the signal on the current canonical doc()
|
|
2234
2266
|
const doc = this.doc(_id);
|
|
2235
|
-
this.
|
|
2236
|
-
return this.
|
|
2267
|
+
this._signal[_id] = this.__coreService.toSignal(doc, this._config.signalFields);
|
|
2268
|
+
return this._signal[_id];
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Returns a signal with an array of document signals that match
|
|
2272
|
+
* a given field/value pair.
|
|
2273
|
+
*
|
|
2274
|
+
* Example:
|
|
2275
|
+
* const activitiesSig = service.getSignals('userId', currentUserId);
|
|
2276
|
+
*/
|
|
2277
|
+
getSignals(field, value) {
|
|
2278
|
+
const id = field + '_' + JSON.stringify(value);
|
|
2279
|
+
if (!this._signals[id]) {
|
|
2280
|
+
this._signals[id] = signal(this._getSignals(id));
|
|
2281
|
+
}
|
|
2282
|
+
return this._signals[id];
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Builds the array of document signals for a given (field,value) key.
|
|
2286
|
+
* Only documents with a real _id are included.
|
|
2287
|
+
*/
|
|
2288
|
+
_getSignals(id) {
|
|
2289
|
+
const sep = id.indexOf('_');
|
|
2290
|
+
if (sep === -1) {
|
|
2291
|
+
return [];
|
|
2292
|
+
}
|
|
2293
|
+
const field = id.slice(0, sep);
|
|
2294
|
+
const valueJson = id.slice(sep + 1);
|
|
2295
|
+
const list = [];
|
|
2296
|
+
for (const doc of this.getDocs()) {
|
|
2297
|
+
if (JSON.stringify(doc[field]) !== valueJson) {
|
|
2298
|
+
continue;
|
|
2299
|
+
}
|
|
2300
|
+
const docId = this._id(doc);
|
|
2301
|
+
if (!docId)
|
|
2302
|
+
continue;
|
|
2303
|
+
list.push(this.getSignal(docId));
|
|
2304
|
+
}
|
|
2305
|
+
return list;
|
|
2306
|
+
}
|
|
2307
|
+
/**
|
|
2308
|
+
* Returns a signal with a map: fieldValue -> array of document signals.
|
|
2309
|
+
*
|
|
2310
|
+
* Example:
|
|
2311
|
+
* const byStatusSig = service.getFieldSignals('status');
|
|
2312
|
+
* byStatusSig() might be { active: [sig1, sig2], draft: [sig3] }.
|
|
2313
|
+
*/
|
|
2314
|
+
getFieldSignals(field) {
|
|
2315
|
+
if (!this._fieldSignals[field]) {
|
|
2316
|
+
this._fieldSignals[field] = signal(this._getFieldSignals(field));
|
|
2317
|
+
}
|
|
2318
|
+
return this._fieldSignals[field];
|
|
2319
|
+
}
|
|
2320
|
+
/**
|
|
2321
|
+
* Builds the map for a given field.
|
|
2322
|
+
* Only documents with a real _id are included.
|
|
2323
|
+
*/
|
|
2324
|
+
_getFieldSignals(field) {
|
|
2325
|
+
const byFields = {};
|
|
2326
|
+
for (const doc of this.getDocs()) {
|
|
2327
|
+
const docId = this._id(doc);
|
|
2328
|
+
if (!docId)
|
|
2329
|
+
continue;
|
|
2330
|
+
const value = String(doc[field]);
|
|
2331
|
+
if (!byFields[value]) {
|
|
2332
|
+
byFields[value] = [];
|
|
2333
|
+
}
|
|
2334
|
+
byFields[value].push(this.getSignal(docId));
|
|
2335
|
+
}
|
|
2336
|
+
return byFields;
|
|
2237
2337
|
}
|
|
2238
2338
|
/**
|
|
2239
2339
|
* Clears cached document signals except those explicitly preserved.
|
|
2240
2340
|
* Useful when changing routes or contexts to reduce memory.
|
|
2341
|
+
*
|
|
2241
2342
|
* @param exceptIds - List of ids whose signals should be kept.
|
|
2242
2343
|
*/
|
|
2243
2344
|
removeSignals(exceptIds = []) {
|
|
2244
|
-
for (const _id in this.
|
|
2345
|
+
for (const _id in this._signal) {
|
|
2245
2346
|
if (!exceptIds.includes(_id)) {
|
|
2246
|
-
delete this.
|
|
2347
|
+
delete this._signal[_id];
|
|
2247
2348
|
}
|
|
2248
2349
|
}
|
|
2249
2350
|
}
|
|
2351
|
+
/**
|
|
2352
|
+
* Restores documents from local storage (if present) and syncs
|
|
2353
|
+
* all existing signals with the restored data.
|
|
2354
|
+
*/
|
|
2250
2355
|
async restoreDocs() {
|
|
2251
2356
|
const docs = await this.__storeService.getJson('docs_' + this._config.name);
|
|
2252
2357
|
if (docs?.length) {
|
|
2253
2358
|
this._docs.length = 0;
|
|
2254
2359
|
this._docs.push(...docs);
|
|
2255
|
-
// keep all existing signals in sync with new docs
|
|
2256
|
-
for (const id in this._signals) {
|
|
2257
|
-
const d = this._docs.find((doc) => this._id(doc) === id);
|
|
2258
|
-
if (d) {
|
|
2259
|
-
this._syncSignalForDoc(d);
|
|
2260
|
-
}
|
|
2261
|
-
}
|
|
2262
2360
|
this._filterDocuments();
|
|
2263
2361
|
for (const doc of this._docs) {
|
|
2264
|
-
|
|
2362
|
+
if (doc.__deleted) {
|
|
2363
|
+
this.delete(doc, doc.__options?.['delete'] || {});
|
|
2364
|
+
}
|
|
2365
|
+
else if (!doc._id) {
|
|
2366
|
+
this.create(doc, doc.__options?.['create'] || {});
|
|
2367
|
+
}
|
|
2368
|
+
else if (doc.__modified?.length) {
|
|
2369
|
+
for (const id of doc.__modified) {
|
|
2370
|
+
if (id.startsWith('up')) {
|
|
2371
|
+
this.update(doc, doc.__options?.[id] || {});
|
|
2372
|
+
}
|
|
2373
|
+
else {
|
|
2374
|
+
this.unique(doc, doc.__options?.[id] || {});
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2265
2378
|
}
|
|
2266
2379
|
this.__emitterService.complete(this._config.name + '_loaded', this._docs);
|
|
2267
2380
|
}
|
|
@@ -2281,21 +2394,23 @@ class CrudService {
|
|
|
2281
2394
|
return this._docs.filter(filter);
|
|
2282
2395
|
}
|
|
2283
2396
|
/**
|
|
2284
|
-
* Retrieves the document
|
|
2397
|
+
* Retrieves the first document that matches the given predicate.
|
|
2285
2398
|
*
|
|
2286
|
-
* @
|
|
2399
|
+
* @param find - Predicate used to locate a specific document.
|
|
2287
2400
|
*/
|
|
2288
2401
|
getDoc(find) {
|
|
2289
2402
|
return this._docs.find(find);
|
|
2290
2403
|
}
|
|
2291
2404
|
/**
|
|
2292
|
-
* Clears the current list of documents
|
|
2405
|
+
* Clears the current list of documents, persists the empty state
|
|
2406
|
+
* and recomputes all derived signals.
|
|
2293
2407
|
*
|
|
2294
2408
|
* Empties the internal documents array and saves the updated state to local storage.
|
|
2295
2409
|
*/
|
|
2296
2410
|
clearDocs() {
|
|
2297
2411
|
this._docs.splice(0, this._docs.length);
|
|
2298
2412
|
this.setDocs();
|
|
2413
|
+
this._updateSignals();
|
|
2299
2414
|
}
|
|
2300
2415
|
/**
|
|
2301
2416
|
* Adds multiple documents to the service and saves them to local storage.
|
|
@@ -2354,8 +2469,8 @@ class CrudService {
|
|
|
2354
2469
|
*/
|
|
2355
2470
|
doc(_id) {
|
|
2356
2471
|
// If we already have a signal for this id, use its current value
|
|
2357
|
-
if (this.
|
|
2358
|
-
return this.
|
|
2472
|
+
if (this._signal[_id]) {
|
|
2473
|
+
return this._signal[_id]();
|
|
2359
2474
|
}
|
|
2360
2475
|
let doc = this._docs.find((d) => this._id(d) === _id ||
|
|
2361
2476
|
(d._localId && d._localId === Number(_id))) || null;
|
|
@@ -2681,7 +2796,7 @@ class CrudService {
|
|
|
2681
2796
|
this._docs.splice(idx, 1);
|
|
2682
2797
|
}
|
|
2683
2798
|
this.setDocs();
|
|
2684
|
-
// We keep signal but mark it deleted
|
|
2799
|
+
// We keep signal but mark it deleted and recompute mappings.
|
|
2685
2800
|
this._syncSignalForDoc({
|
|
2686
2801
|
...doc,
|
|
2687
2802
|
__deleted: true,
|
|
@@ -2707,6 +2822,11 @@ class CrudService {
|
|
|
2707
2822
|
});
|
|
2708
2823
|
return obs;
|
|
2709
2824
|
}
|
|
2825
|
+
/**
|
|
2826
|
+
* Registers a filtered view of documents and returns the recompute callback.
|
|
2827
|
+
*
|
|
2828
|
+
* The callback is called automatically whenever `_filterDocuments()` runs.
|
|
2829
|
+
*/
|
|
2710
2830
|
filteredDocuments(storeObjectOrArray, config = {}) {
|
|
2711
2831
|
const callback = () => {
|
|
2712
2832
|
if (Array.isArray(storeObjectOrArray)) {
|
|
@@ -2784,7 +2904,15 @@ class CrudService {
|
|
|
2784
2904
|
return callback;
|
|
2785
2905
|
}
|
|
2786
2906
|
/**
|
|
2787
|
-
* Generates a unique ID for a document.
|
|
2907
|
+
* Generates a unique ID for a document when using local-only identifiers.
|
|
2908
|
+
*
|
|
2909
|
+
* @returns The unique ID as a number.
|
|
2910
|
+
*/
|
|
2911
|
+
_localId() {
|
|
2912
|
+
return Number(Date.now() + '' + this._randomCount++);
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* Returns the configured identity field for the given document as string.
|
|
2788
2916
|
*
|
|
2789
2917
|
* @param doc - The document for which to generate the ID.
|
|
2790
2918
|
* @returns The unique ID as a string.
|
|
@@ -2793,7 +2921,8 @@ class CrudService {
|
|
|
2793
2921
|
return doc[this._config._id || '_id']?.toString();
|
|
2794
2922
|
}
|
|
2795
2923
|
/**
|
|
2796
|
-
* Executes all registered filter document callbacks
|
|
2924
|
+
* Executes all registered filter document callbacks and emits a
|
|
2925
|
+
* `<name>_filtered` event.
|
|
2797
2926
|
*/
|
|
2798
2927
|
_filterDocuments() {
|
|
2799
2928
|
for (const callback of this._filteredDocumentsCallbacks) {
|
|
@@ -2801,6 +2930,10 @@ class CrudService {
|
|
|
2801
2930
|
}
|
|
2802
2931
|
this.__emitterService.emit(`${this._config.name}_filtered`);
|
|
2803
2932
|
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Marks a document as modified for a given operation id and
|
|
2935
|
+
* keeps the document in the store until the operation is confirmed.
|
|
2936
|
+
*/
|
|
2804
2937
|
_updateModified(doc, id, options) {
|
|
2805
2938
|
doc.__modified ||= [];
|
|
2806
2939
|
doc.__options ||= {};
|
|
@@ -2810,6 +2943,10 @@ class CrudService {
|
|
|
2810
2943
|
this.addDoc(doc);
|
|
2811
2944
|
}
|
|
2812
2945
|
}
|
|
2946
|
+
/**
|
|
2947
|
+
* Removes a modification mark from the document once the
|
|
2948
|
+
* server operation is confirmed.
|
|
2949
|
+
*/
|
|
2813
2950
|
_removeModified(doc, id) {
|
|
2814
2951
|
doc.__modified ||= [];
|
|
2815
2952
|
if (doc.__modified.find((m) => m === id)) {
|
|
@@ -2817,16 +2954,33 @@ class CrudService {
|
|
|
2817
2954
|
this.addDoc(doc);
|
|
2818
2955
|
}
|
|
2819
2956
|
}
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2957
|
+
/**
|
|
2958
|
+
* Syncs a single document's signal (if exists) and refreshes all
|
|
2959
|
+
* derived collections (field/value lists and field maps).
|
|
2960
|
+
*/
|
|
2823
2961
|
_syncSignalForDoc(doc) {
|
|
2824
2962
|
const id = this._id(doc);
|
|
2825
|
-
if (
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2963
|
+
if (id && this._signal[id]) {
|
|
2964
|
+
this._signal[id].set(doc);
|
|
2965
|
+
}
|
|
2966
|
+
this._updateSignals();
|
|
2967
|
+
}
|
|
2968
|
+
/**
|
|
2969
|
+
* Rebuilds all derived signal collections:
|
|
2970
|
+
* - all per (field,value) lists of document signals
|
|
2971
|
+
* - all per-field maps value -> [signals]
|
|
2972
|
+
*
|
|
2973
|
+
* This keeps `getSignals()` and `getFieldSignals()` in sync after
|
|
2974
|
+
* any mutation that touches `_docs`.
|
|
2975
|
+
*/
|
|
2976
|
+
_updateSignals() {
|
|
2977
|
+
// refresh all (field,value) collections
|
|
2978
|
+
for (const key in this._signals) {
|
|
2979
|
+
this._signals[key].set(this._getSignals(key));
|
|
2980
|
+
}
|
|
2981
|
+
// refresh all per-field maps
|
|
2982
|
+
for (const field in this._fieldSignals) {
|
|
2983
|
+
this._fieldSignals[field].set(this._getFieldSignals(field));
|
|
2830
2984
|
}
|
|
2831
2985
|
}
|
|
2832
2986
|
}
|
|
@@ -2949,10 +3103,10 @@ class DomService {
|
|
|
2949
3103
|
delete this._providedIn[providedIn];
|
|
2950
3104
|
}
|
|
2951
3105
|
}
|
|
2952
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
2953
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
3106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3107
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DomService, providedIn: 'root' }); }
|
|
2954
3108
|
}
|
|
2955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
3109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DomService, decorators: [{
|
|
2956
3110
|
type: Injectable,
|
|
2957
3111
|
args: [{
|
|
2958
3112
|
providedIn: 'root',
|
|
@@ -3070,10 +3224,10 @@ class RtcService {
|
|
|
3070
3224
|
this.localStream?.getTracks().forEach((track) => track.stop());
|
|
3071
3225
|
this.localStream = null;
|
|
3072
3226
|
}
|
|
3073
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
3074
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
3227
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RtcService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3228
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RtcService, providedIn: 'root' }); }
|
|
3075
3229
|
}
|
|
3076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
3230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: RtcService, decorators: [{
|
|
3077
3231
|
type: Injectable,
|
|
3078
3232
|
args: [{ providedIn: 'root' }]
|
|
3079
3233
|
}] });
|
|
@@ -3194,10 +3348,10 @@ class SocketService {
|
|
|
3194
3348
|
}
|
|
3195
3349
|
this._io.emit(to, message, room);
|
|
3196
3350
|
}
|
|
3197
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
3198
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
3351
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SocketService, deps: [{ token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3352
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SocketService, providedIn: 'root' }); }
|
|
3199
3353
|
}
|
|
3200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
3354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SocketService, decorators: [{
|
|
3201
3355
|
type: Injectable,
|
|
3202
3356
|
args: [{
|
|
3203
3357
|
providedIn: 'root',
|
|
@@ -3639,10 +3793,10 @@ class TimeService {
|
|
|
3639
3793
|
}
|
|
3640
3794
|
return lastWeek - firstWeek + 1;
|
|
3641
3795
|
}
|
|
3642
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
3643
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
3796
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TimeService, deps: [{ token: i1$2.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3797
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TimeService, providedIn: 'root' }); }
|
|
3644
3798
|
}
|
|
3645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
3799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TimeService, decorators: [{
|
|
3646
3800
|
type: Injectable,
|
|
3647
3801
|
args: [{
|
|
3648
3802
|
providedIn: 'root',
|
|
@@ -3658,7 +3812,7 @@ class UtilService {
|
|
|
3658
3812
|
// --- CSS variables (persisted) ---
|
|
3659
3813
|
this._storageKey = 'css_variables';
|
|
3660
3814
|
this._css = {};
|
|
3661
|
-
this._cssSig = signal({},
|
|
3815
|
+
this._cssSig = signal({}, ...(ngDevMode ? [{ debugName: "_cssSig" }] : []));
|
|
3662
3816
|
// --- Forms store ---
|
|
3663
3817
|
this._forms = new Map();
|
|
3664
3818
|
// --- Global bag for design/debug ---
|
|
@@ -3884,10 +4038,10 @@ class UtilService {
|
|
|
3884
4038
|
}
|
|
3885
4039
|
catch { }
|
|
3886
4040
|
}
|
|
3887
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
3888
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
4041
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UtilService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4042
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UtilService, providedIn: 'root' }); }
|
|
3889
4043
|
}
|
|
3890
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
4044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UtilService, decorators: [{
|
|
3891
4045
|
type: Injectable,
|
|
3892
4046
|
args: [{ providedIn: 'root' }]
|
|
3893
4047
|
}], ctorParameters: () => [] });
|
|
@@ -3924,8 +4078,8 @@ class WacomModule {
|
|
|
3924
4078
|
],
|
|
3925
4079
|
};
|
|
3926
4080
|
}
|
|
3927
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
3928
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.
|
|
4081
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: WacomModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4082
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: WacomModule, imports: [CommonModule, FormsModule, ArrPipe,
|
|
3929
4083
|
SafePipe,
|
|
3930
4084
|
SplicePipe,
|
|
3931
4085
|
SearchPipe,
|
|
@@ -3936,12 +4090,12 @@ class WacomModule {
|
|
|
3936
4090
|
SearchPipe,
|
|
3937
4091
|
MongodatePipe,
|
|
3938
4092
|
PaginationPipe, ClickOutsideDirective] }); }
|
|
3939
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.
|
|
4093
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: WacomModule, providers: [
|
|
3940
4094
|
{ provide: CONFIG_TOKEN, useValue: DEFAULT_CONFIG },
|
|
3941
4095
|
provideHttpClient(withInterceptorsFromDi()),
|
|
3942
4096
|
], imports: [CommonModule, FormsModule] }); }
|
|
3943
4097
|
}
|
|
3944
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
4098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: WacomModule, decorators: [{
|
|
3945
4099
|
type: NgModule,
|
|
3946
4100
|
args: [{
|
|
3947
4101
|
imports: [CommonModule, FormsModule, ...PIPES, ...DIRECTIVES],
|