@eclipse-scout/core 11.0.39 → 11.0.41

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.
@@ -83785,6 +83785,35 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
83785
83785
  */
83786
83786
 
83787
83787
 
83788
+ /**
83789
+ * A lookup call that can load lookup rows from a REST service.
83790
+ *
83791
+ * API:
83792
+ * ----
83793
+ * By default, the REST service is expected to listen for POST requests at the URL defined by
83794
+ * this.resourceUrl. It receives a restriction object and must return a list of matching lookup rows.
83795
+ * The serialization format is JSON.
83796
+ *
83797
+ * Lookup rows:
83798
+ * ------------
83799
+ * The standard lookup row properties defined by Scout are usually sufficient (see AbstractLookupRowDo.java).
83800
+ *
83801
+ * Restriction:
83802
+ * ------------
83803
+ * The restriction object consists of a number of 'well-known' properties (e.g. 'text' in QueryBy.TEXT
83804
+ * mode, see AbstractLookupRestrictionDo.java for details) and additional, service-dependent properties
83805
+ * that can either be predefined in the model or added programmatically at runtime. Since all of those
83806
+ * properties are sent in the same restriction object, some care must be taken to prevent accidental
83807
+ * overwriting of properties.
83808
+ *
83809
+ * Order of precedence (lowest to highest):
83810
+ * 1. Restrictions automatically applied to all clones after their creation in the respective cloneFor method.
83811
+ * These are: 'active' (ALL, TEXT, REC) and 'maxRowCount' (ALL, TEXT, REC)
83812
+ * 2. Restrictions predefined in the model property 'restriction', shared by all clones.
83813
+ * 3. Restrictions applied to clones programmatically, e.g. during a 'prepareLookupCall' event.
83814
+ * 4. Hard-coded properties that are fundamental to the respective queryBy mode (cannot be overridden).
83815
+ * These are: 'ids' (KEY, KEYS) and 'text' (TEXT)
83816
+ */
83788
83817
 
83789
83818
  var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83790
83819
  _inherits(RestLookupCall, _LookupCall);
@@ -83824,6 +83853,19 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83824
83853
 
83825
83854
  this._restriction[key] = value;
83826
83855
  }
83856
+ /**
83857
+ * Adds the given key-value pair to 'this._restriction', but only if there is no predefined
83858
+ * value for this key in 'this.restriction'. This prevents unintentional overriding of
83859
+ * user-defined model restrictions.
83860
+ */
83861
+
83862
+ }, {
83863
+ key: "_addRestrictionIfAbsent",
83864
+ value: function _addRestrictionIfAbsent(key, value) {
83865
+ if (!this.restriction || _index__WEBPACK_IMPORTED_MODULE_0__["objects"].isNullOrUndefined(this.restriction[key])) {
83866
+ this.addRestriction(key, value);
83867
+ }
83868
+ }
83827
83869
  }, {
83828
83870
  key: "_getAll",
83829
83871
  value: function _getAll() {
@@ -83852,8 +83894,10 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83852
83894
  value: function cloneForAll() {
83853
83895
  var clone = _get(_getPrototypeOf(RestLookupCall.prototype), "cloneForAll", this).call(this);
83854
83896
 
83855
- clone.addRestriction('active', true);
83856
- clone.addRestriction('maxRowCount', this.maxRowCount);
83897
+ clone._addRestrictionIfAbsent('active', true);
83898
+
83899
+ clone._addRestrictionIfAbsent('maxRowCount', this.maxRowCount);
83900
+
83857
83901
  return clone;
83858
83902
  }
83859
83903
  }, {
@@ -83861,8 +83905,10 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83861
83905
  value: function cloneForText(text) {
83862
83906
  var clone = _get(_getPrototypeOf(RestLookupCall.prototype), "cloneForText", this).call(this, text);
83863
83907
 
83864
- clone.addRestriction('active', true);
83865
- clone.addRestriction('maxRowCount', this.maxRowCount);
83908
+ clone._addRestrictionIfAbsent('active', true);
83909
+
83910
+ clone._addRestrictionIfAbsent('maxRowCount', this.maxRowCount);
83911
+
83866
83912
  return clone;
83867
83913
  }
83868
83914
  }, {
@@ -83870,8 +83916,10 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83870
83916
  value: function cloneForRec(parentKey) {
83871
83917
  var clone = _get(_getPrototypeOf(RestLookupCall.prototype), "cloneForRec", this).call(this, parentKey);
83872
83918
 
83873
- clone.addRestriction('active', true);
83874
- clone.addRestriction('maxRowCount', this.maxRowCount);
83919
+ clone._addRestrictionIfAbsent('active', true);
83920
+
83921
+ clone._addRestrictionIfAbsent('maxRowCount', this.maxRowCount);
83922
+
83875
83923
  return clone;
83876
83924
  }
83877
83925
  }, {
@@ -83970,7 +84018,7 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83970
84018
  return value;
83971
84019
  };
83972
84020
 
83973
- var newRestrictions = {};
84021
+ var resolvedRestriction = {};
83974
84022
  var restriction = jquery__WEBPACK_IMPORTED_MODULE_1___default.a.extend({}, this.restriction, this._restriction);
83975
84023
  Object.keys(restriction).forEach(function (key) {
83976
84024
  var value = restriction[key];
@@ -83985,11 +84033,11 @@ var RestLookupCall = /*#__PURE__*/function (_LookupCall) {
83985
84033
  } // Only add non-null restrictions
83986
84034
 
83987
84035
 
83988
- if (newValue) {
83989
- newRestrictions[key] = newValue;
84036
+ if (!_index__WEBPACK_IMPORTED_MODULE_0__["objects"].isNullOrUndefined(newValue)) {
84037
+ resolvedRestriction[key] = newValue;
83990
84038
  }
83991
84039
  });
83992
- return newRestrictions;
84040
+ return resolvedRestriction;
83993
84041
  }
83994
84042
  }, {
83995
84043
  key: "_createAjaxCall",