wacom 20.0.5 → 20.0.6

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.
@@ -805,7 +805,7 @@ class CoreService {
805
805
  this.linkIds[name].push(...reset());
806
806
  });
807
807
  }
808
- // Angular Signals
808
+ // Angular Signals //
809
809
  /**
810
810
  * Converts a plain object into a signal-wrapped object.
811
811
  * Optionally wraps specific fields of the object as individual signals,
@@ -813,7 +813,7 @@ class CoreService {
813
813
  *
814
814
  * @template Document - The type of the object being wrapped.
815
815
  * @param {Document} document - The plain object to wrap into a signal.
816
- * @param {Record<string, (doc: Document) => unknown>} [updatableFields={}] -
816
+ * @param {Record<string, (doc: Document) => unknown>} [signalFields={}] -
817
817
  * Optional map where each key is a field name and the value is a function
818
818
  * to extract the initial value for that field. These fields will be wrapped
819
819
  * as separate signals and embedded in the returned object.
@@ -827,13 +827,13 @@ class CoreService {
827
827
  * console.log(sig().name); // 'Alice'
828
828
  * console.log(sig().score()); // 42 — field is now a signal
829
829
  */
830
- toSignal(document, updatableFields = {}) {
831
- if (Object.keys(updatableFields).length) {
832
- const signalFields = {};
833
- for (const key in updatableFields) {
834
- signalFields[key] = signal(updatableFields[key](document));
830
+ toSignal(document, signalFields = {}) {
831
+ if (Object.keys(signalFields).length) {
832
+ const fields = {};
833
+ for (const key in signalFields) {
834
+ fields[key] = signal(signalFields[key](document));
835
835
  }
836
- return signal({ ...document, ...signalFields });
836
+ return signal({ ...document, ...fields });
837
837
  }
838
838
  else {
839
839
  return signal(document);
@@ -845,7 +845,7 @@ class CoreService {
845
845
  *
846
846
  * @template Document - The type of each object in the array.
847
847
  * @param {Document[]} arr - Array of plain objects to convert into signals.
848
- * @param {Record<string, (doc: Document) => unknown>} [updatableFields={}] -
848
+ * @param {Record<string, (doc: Document) => unknown>} [signalFields={}] -
849
849
  * Optional map where keys are field names and values are functions that extract the initial value
850
850
  * from the object. These fields will be turned into separate signals.
851
851
  *
@@ -858,8 +858,8 @@ class CoreService {
858
858
  * score: (u) => u.score,
859
859
  * });
860
860
  */
861
- toSignalsArray(arr, updatableFields = {}) {
862
- return arr.map((obj) => this.toSignal(obj, updatableFields));
861
+ toSignalsArray(arr, signalFields = {}) {
862
+ return arr.map((obj) => this.toSignal(obj, signalFields));
863
863
  }
864
864
  /**
865
865
  * Adds a new object to the signals array.
@@ -868,13 +868,26 @@ class CoreService {
868
868
  * @template Document - The type of the object being added.
869
869
  * @param {Signal<Document>[]} signals - The signals array to append to.
870
870
  * @param {Document} item - The object to wrap and push as a signal.
871
- * @param {Record<string, (doc: Document) => unknown>} [updatableFields={}] -
871
+ * @param {Record<string, (doc: Document) => unknown>} [signalFields={}] -
872
872
  * Optional map of fields to be wrapped as signals within the object.
873
873
  *
874
874
  * @returns {void}
875
875
  */
876
- pushSignal(signals, item, updatableFields = {}) {
877
- signals.push(this.toSignal(item, updatableFields));
876
+ pushSignal(signals, item, signalFields = {}) {
877
+ signals.push(this.toSignal(item, signalFields));
878
+ }
879
+ /**
880
+ * Removes the first signal from the array whose object's field matches the provided value.
881
+ * @template Document
882
+ * @param {WritableSignal<Document>[]} signals - The signals array to modify.
883
+ * @param {unknown} value - The value to match.
884
+ * @param {string} [field='_id'] - The object field to match against.
885
+ * @returns {void}
886
+ */
887
+ removeSignalByField(signals, value, field = '_id') {
888
+ const idx = signals.findIndex((sig) => sig()[field] === value);
889
+ if (idx > -1)
890
+ signals.splice(idx, 1);
878
891
  }
879
892
  /**
880
893
  * Returns a generic trackBy function for *ngFor, tracking by the specified object field.
@@ -910,19 +923,6 @@ class CoreService {
910
923
  if (sig)
911
924
  sig.update(updater);
912
925
  }
913
- /**
914
- * Removes the first signal from the array whose object's field matches the provided value.
915
- * @template Document
916
- * @param {WritableSignal<Document>[]} signals - The signals array to modify.
917
- * @param {unknown} value - The value to match.
918
- * @param {string} [field='_id'] - The object field to match against.
919
- * @returns {void}
920
- */
921
- removeSignalByField(signals, value, field = '_id') {
922
- const idx = signals.findIndex((sig) => sig()[field] === value);
923
- if (idx > -1)
924
- signals.splice(idx, 1);
925
- }
926
926
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
927
927
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, providedIn: 'root' });
928
928
  }
@@ -2388,6 +2388,7 @@ class CrudService extends BaseService {
2388
2388
  constructor(_config) {
2389
2389
  super();
2390
2390
  this._config = _config;
2391
+ this._config.signalFields = this._config.signalFields || {};
2391
2392
  this._url += this._config.name;
2392
2393
  this.loaded = this.__core.onComplete(this._config.name + '_loaded');
2393
2394
  if (this._config.unauthorized) {