@sumaris-net/ngx-components 1.19.6 → 1.19.7

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.
@@ -4808,6 +4808,67 @@
4808
4808
  },] },
4809
4809
  { type: i0.Injectable, args: [{ providedIn: 'root' },] }
4810
4810
  ];
4811
+ var FormGetValuePipe = /** @class */ (function () {
4812
+ function FormGetValuePipe(adapter, _ref) {
4813
+ this.adapter = adapter;
4814
+ this._ref = _ref;
4815
+ this.value = undefined;
4816
+ this._lastControl = null;
4817
+ }
4818
+ FormGetValuePipe.prototype.transform = function (form, path) {
4819
+ var _this = this;
4820
+ if (!form) {
4821
+ this._dispose();
4822
+ return undefined;
4823
+ }
4824
+ // if we ask another time for the same form and opts, return the last value
4825
+ if (form === this._lastControl && equals(path, this._lastPath)) {
4826
+ return this.value;
4827
+ }
4828
+ // store the query, in case it changes
4829
+ this._lastControl = form;
4830
+ // store the params, in case they change
4831
+ this._lastPath = path;
4832
+ // set the value
4833
+ var control = isNotNilOrBlank(path) ? form.get(path) : form;
4834
+ this.value = control === null || control === void 0 ? void 0 : control.value;
4835
+ // if there is a subscription to onLangChange, clean it
4836
+ this._dispose();
4837
+ // subscribe to valueChanges event, in case control value change
4838
+ if (!this._onControlValueChanges && control) {
4839
+ this._onControlValueChanges = control.valueChanges.subscribe(function (value) {
4840
+ _this.value = value;
4841
+ _this._ref.markForCheck();
4842
+ });
4843
+ }
4844
+ return this.value;
4845
+ };
4846
+ FormGetValuePipe.prototype.ngOnDestroy = function () {
4847
+ this._dispose();
4848
+ };
4849
+ /**
4850
+ * Clean any existing subscription to change events
4851
+ */
4852
+ FormGetValuePipe.prototype._dispose = function () {
4853
+ if (typeof this._onControlValueChanges !== 'undefined') {
4854
+ this._onControlValueChanges.unsubscribe();
4855
+ this._onControlValueChanges = undefined;
4856
+ }
4857
+ };
4858
+ return FormGetValuePipe;
4859
+ }());
4860
+ FormGetValuePipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormGetValuePipe_Factory() { return new FormGetValuePipe(i0.ɵɵinject(FormErrorTranslator), i0.ɵɵinject(i0.ChangeDetectorRef)); }, token: FormGetValuePipe, providedIn: "root" });
4861
+ FormGetValuePipe.decorators = [
4862
+ { type: i0.Pipe, args: [{
4863
+ name: 'formGetValue',
4864
+ pure: false
4865
+ },] },
4866
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
4867
+ ];
4868
+ FormGetValuePipe.ctorParameters = function () { return [
4869
+ { type: FormErrorTranslator },
4870
+ { type: i0.ChangeDetectorRef }
4871
+ ]; };
4811
4872
 
4812
4873
  var SharedPipesModule = /** @class */ (function () {
4813
4874
  function SharedPipesModule() {
@@ -4858,7 +4919,8 @@
4858
4919
  FormGetPipe,
4859
4920
  FormGetControlPipe,
4860
4921
  FormGetArrayPipe,
4861
- FormGetGroupPipe
4922
+ FormGetGroupPipe,
4923
+ FormGetValuePipe
4862
4924
  ],
4863
4925
  exports: [
4864
4926
  PropertyGetPipe,
@@ -11047,7 +11109,7 @@
11047
11109
  (items || []).forEach(EntityUtils.cleanIdAndUpdateDate);
11048
11110
  };
11049
11111
  EntityUtils.sort = function (data, sortBy, sortDirection) {
11050
- if (!data || data.length <= 1)
11112
+ if (!data || data.length <= 1 || !sortBy)
11051
11113
  return data;
11052
11114
  return data.sort(this.sortComparator(sortBy, sortDirection));
11053
11115
  };
@@ -19518,8 +19580,8 @@
19518
19580
  return __generator(this, function (_a) {
19519
19581
  switch (_a.label) {
19520
19582
  case 0:
19521
- dirty = component.dirty;
19522
- valid = component.valid;
19583
+ dirty = component === null || component === void 0 ? void 0 : component.dirty;
19584
+ valid = component === null || component === void 0 ? void 0 : component.valid;
19523
19585
  can = {
19524
19586
  confirmed: !dirty,
19525
19587
  save: false,
@@ -28799,7 +28861,8 @@
28799
28861
  }, opts));
28800
28862
  };
28801
28863
  AppEntityEditor.prototype.markForCheck = function () {
28802
- this.cd.markForCheck();
28864
+ var _a;
28865
+ (_a = this.cd) === null || _a === void 0 ? void 0 : _a.markForCheck();
28803
28866
  };
28804
28867
  /* -- private functions -- */
28805
28868
  /**
@@ -32007,6 +32070,7 @@
32007
32070
  exports.FormGetControlPipe = FormGetControlPipe;
32008
32071
  exports.FormGetGroupPipe = FormGetGroupPipe;
32009
32072
  exports.FormGetPipe = FormGetPipe;
32073
+ exports.FormGetValuePipe = FormGetValuePipe;
32010
32074
  exports.Fragments = Fragments$1;
32011
32075
  exports.GraphqlService = GraphqlService;
32012
32076
  exports.HAMMER_PRESS_TIME = HAMMER_PRESS_TIME;