cx 24.0.1 → 24.0.3

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.
Files changed (45) hide show
  1. package/dist/charts.js +169 -235
  2. package/dist/data.js +42 -85
  3. package/dist/hooks.js +1 -1
  4. package/dist/manifest.js +763 -760
  5. package/dist/svg.js +47 -97
  6. package/dist/ui.js +180 -242
  7. package/dist/util.js +9 -7
  8. package/dist/widgets.js +1296 -1517
  9. package/locale/de-de.js +6 -1
  10. package/locale/en-us.js +5 -1
  11. package/locale/es-es.js +6 -1
  12. package/locale/fr-fr.js +7 -2
  13. package/locale/nl-nl.js +4 -5
  14. package/locale/pt-pt.js +12 -1
  15. package/locale/sr-latn-ba.js +6 -2
  16. package/package.json +1 -1
  17. package/src/data/StructuredSelector.d.ts +1 -1
  18. package/src/data/ops/updateTree.js +1 -1
  19. package/src/data/ops/updateTree.spec.js +16 -14
  20. package/src/ui/Culture.d.ts +0 -3
  21. package/src/ui/DataProxy.d.ts +1 -0
  22. package/src/ui/DataProxy.js +2 -2
  23. package/src/ui/Localization.js +0 -2
  24. package/src/ui/Rescope.js +2 -2
  25. package/src/ui/Text.js +2 -4
  26. package/src/ui/adapter/DataAdapter.js +7 -12
  27. package/src/ui/adapter/GroupAdapter.d.ts +22 -3
  28. package/src/ui/adapter/TreeAdapter.d.ts +23 -3
  29. package/src/widgets/form/DateTimeField.d.ts +86 -86
  30. package/src/widgets/form/DateTimeField.js +569 -572
  31. package/src/widgets/form/Field.js +24 -9
  32. package/src/widgets/form/FieldIcon.js +42 -0
  33. package/src/widgets/form/LookupField.d.ts +174 -174
  34. package/src/widgets/form/LookupField.js +1130 -1131
  35. package/src/widgets/form/MonthField.d.ts +37 -38
  36. package/src/widgets/form/MonthField.js +6 -9
  37. package/src/widgets/form/NumberField.d.ts +2 -2
  38. package/src/widgets/form/NumberField.js +5 -9
  39. package/src/widgets/form/Select.d.ts +31 -35
  40. package/src/widgets/form/Select.js +7 -12
  41. package/src/widgets/form/TextField.d.ts +2 -2
  42. package/src/widgets/form/TextField.js +6 -5
  43. package/src/widgets/grid/Grid.d.ts +9 -6
  44. package/src/widgets/grid/Grid.js +3277 -3276
  45. package/src/widgets/overlay/Dropdown.d.ts +1 -0
package/dist/data.js CHANGED
@@ -111,46 +111,21 @@ function isBinding(value) {
111
111
  return value instanceof Binding;
112
112
  }
113
113
 
114
- function ownKeys(object, enumerableOnly) {
115
- var keys = Object.keys(object);
116
- if (Object.getOwnPropertySymbols) {
117
- var symbols = Object.getOwnPropertySymbols(object);
118
- enumerableOnly &&
119
- (symbols = symbols.filter(function (sym) {
120
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
121
- })),
122
- keys.push.apply(keys, symbols);
123
- }
124
- return keys;
125
- }
126
- function _objectSpread2(target) {
127
- for (var i = 1; i < arguments.length; i++) {
128
- var source = null != arguments[i] ? arguments[i] : {};
129
- i % 2
130
- ? ownKeys(Object(source), !0).forEach(function (key) {
131
- _defineProperty(target, key, source[key]);
132
- })
133
- : Object.getOwnPropertyDescriptors
134
- ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source))
135
- : ownKeys(Object(source)).forEach(function (key) {
136
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
137
- });
138
- }
139
- return target;
140
- }
141
- function _defineProperty(obj, key, value) {
142
- key = _toPropertyKey(key);
143
- if (key in obj) {
144
- Object.defineProperty(obj, key, {
145
- value: value,
146
- enumerable: true,
147
- configurable: true,
148
- writable: true,
149
- });
150
- } else {
151
- obj[key] = value;
152
- }
153
- return obj;
114
+ function _extends() {
115
+ _extends = Object.assign
116
+ ? Object.assign.bind()
117
+ : function (target) {
118
+ for (var i = 1; i < arguments.length; i++) {
119
+ var source = arguments[i];
120
+ for (var key in source) {
121
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
122
+ target[key] = source[key];
123
+ }
124
+ }
125
+ }
126
+ return target;
127
+ };
128
+ return _extends.apply(this, arguments);
154
129
  }
155
130
  function _inheritsLoose(subClass, superClass) {
156
131
  subClass.prototype = Object.create(superClass.prototype);
@@ -163,7 +138,7 @@ function _setPrototypeOf(o, p) {
163
138
  : function _setPrototypeOf(o, p) {
164
139
  o.__proto__ = p;
165
140
  return o;
166
- };
141
+ };
167
142
  return _setPrototypeOf(o, p);
168
143
  }
169
144
  function _isNativeReflectConstruct() {
@@ -198,20 +173,6 @@ function _assertThisInitialized(self) {
198
173
  }
199
174
  return self;
200
175
  }
201
- function _toPrimitive(input, hint) {
202
- if (typeof input !== "object" || input === null) return input;
203
- var prim = input[Symbol.toPrimitive];
204
- if (prim !== undefined) {
205
- var res = prim.call(input, hint || "default");
206
- if (typeof res !== "object") return res;
207
- throw new TypeError("@@toPrimitive must return a primitive value.");
208
- }
209
- return (hint === "string" ? String : Number)(input);
210
- }
211
- function _toPropertyKey(arg) {
212
- var key = _toPrimitive(arg, "string");
213
- return typeof key === "symbol" ? key : String(key);
214
- }
215
176
 
216
177
  function computable() {
217
178
  var _ref;
@@ -258,7 +219,7 @@ function computable() {
258
219
  null,
259
220
  inputs.map(function (s) {
260
221
  return s(data);
261
- })
222
+ }),
262
223
  );
263
224
  };
264
225
  selector.memoize = memoize;
@@ -421,8 +382,8 @@ function expression(str) {
421
382
  }),
422
383
  keys,
423
384
  helperNames,
424
- [body]
425
- )
385
+ [body],
386
+ ),
426
387
  )).bind.apply(_Function, [Format, Format.value].concat(formats, helperValues));
427
388
  var selector = computable.apply(
428
389
  void 0,
@@ -430,7 +391,7 @@ function expression(str) {
430
391
  .map(function (k) {
431
392
  return args[k];
432
393
  })
433
- .concat([compute])
394
+ .concat([compute]),
434
395
  );
435
396
  expCache[str] = selector;
436
397
  return selector;
@@ -589,13 +550,13 @@ var Ref = /*#__PURE__*/ (function (_Component) {
589
550
  Ref.prototype.isRef = true;
590
551
  Ref.factory = function (alias, config, more) {
591
552
  if (isFunction(alias)) {
592
- var cfg = _objectSpread2(_objectSpread2({}, config), more);
553
+ var cfg = _extends({}, config, more);
593
554
  if (cfg.store) Object.assign(cfg, cfg.store.getMethods());
594
555
  var result = alias(cfg);
595
556
  if (result instanceof Ref) return result;
596
- return this.create(_objectSpread2(_objectSpread2(_objectSpread2({}, config), more), result));
557
+ return this.create(_extends({}, config, more, result));
597
558
  }
598
- return this.create(_objectSpread2(_objectSpread2({}, config), more));
559
+ return this.create(_extends({}, config, more));
599
560
  };
600
561
 
601
562
  var StoreRef = /*#__PURE__*/ (function (_Ref) {
@@ -806,7 +767,7 @@ View.prototype.sealed = false; //indicate that data should be copied before virt
806
767
  //Immer integration point
807
768
  View.prototype.mutate = function () {
808
769
  throw new Error(
809
- "Mutate requires Immer. Please install 'immer' and 'cx-immer' packages and enable store mutation by calling enableImmerMutate()."
770
+ "Mutate requires Immer. Please install 'immer' and 'cx-immer' packages and enable store mutation by calling enableImmerMutate().",
810
771
  );
811
772
  };
812
773
 
@@ -926,7 +887,7 @@ var ExposedRecordView = /*#__PURE__*/ (function (_View) {
926
887
  _proto.embed = function embed(data) {
927
888
  var collection = this.collectionBinding.value(data);
928
889
  var record = collection[this.itemIndex];
929
- var copy = this.sealed || this.immutable || this.store.sealed ? _objectSpread2({}, data) : data;
890
+ var copy = this.sealed || this.immutable || this.store.sealed ? _extends({}, data) : data;
930
891
  copy[this.recordName] = record;
931
892
  if (this.indexName) copy[this.indexName] = this.itemIndex;
932
893
  return copy;
@@ -945,7 +906,7 @@ var ExposedRecordView = /*#__PURE__*/ (function (_View) {
945
906
  var newCollection = [].concat(
946
907
  collection.slice(0, this.itemIndex),
947
908
  [record],
948
- collection.slice(this.itemIndex + 1)
909
+ collection.slice(this.itemIndex + 1),
949
910
  );
950
911
  return this.store.setItem(this.collectionBinding.path, newCollection);
951
912
  }
@@ -988,7 +949,7 @@ var ExposedValueView = /*#__PURE__*/ (function (_View) {
988
949
  var record = container[this.key];
989
950
  this.cache.version = this.meta.version;
990
951
  this.cache.key = this.key;
991
- this.cache.result = this.sealed || this.immutable || this.store.sealed ? _objectSpread2({}, data) : data;
952
+ this.cache.result = this.sealed || this.immutable || this.store.sealed ? _extends({}, data) : data;
992
953
  this.cache.result[this.recordName] = record;
993
954
  return this.cache.result;
994
955
  };
@@ -1081,7 +1042,7 @@ var AugmentedViewBase = /*#__PURE__*/ (function (_View) {
1081
1042
  return this.cache.result;
1082
1043
  };
1083
1044
  _proto.getBaseData = function getBaseData(parentStoreData) {
1084
- if (this.sealed || this.immutable || this.store.sealed) return _objectSpread2({}, parentStoreData);
1045
+ if (this.sealed || this.immutable || this.store.sealed) return _extends({}, parentStoreData);
1085
1046
  return parentStoreData;
1086
1047
  };
1087
1048
  _proto.embedAugmentData = function embedAugmentData(result, parentStoreData) {
@@ -1159,7 +1120,7 @@ var ZoomIntoPropertyView = /*#__PURE__*/ (function (_NestedDataView) {
1159
1120
  _proto.getBaseData = function getBaseData(parentStoreData) {
1160
1121
  var x = this.binding.value(parentStoreData);
1161
1122
  if (x != null && typeof x != "object") throw new Error("Zoomed value must be an object.");
1162
- return _objectSpread2({}, x);
1123
+ return _extends({}, x);
1163
1124
  };
1164
1125
  _proto.embedAugmentData = function embedAugmentData(result, parentStoreData) {
1165
1126
  result[this.rootName] = parentStoreData;
@@ -1388,7 +1349,7 @@ var StructuredSelector = /*#__PURE__*/ (function () {
1388
1349
  };
1389
1350
  _proto.createStoreSelector = function createStoreSelector() {
1390
1351
  if (this.config.constant) {
1391
- var result = _objectSpread2({}, this.config.constants);
1352
+ var result = _extends({}, this.config.constants);
1392
1353
  return function () {
1393
1354
  return result;
1394
1355
  };
@@ -1681,17 +1642,17 @@ function getComparer(sorters, dataAccessor, comparer) {
1681
1642
  var selector = isDefined(s.value)
1682
1643
  ? getSelector(s.value)
1683
1644
  : s.field
1684
- ? function (x) {
1685
- return x[s.field];
1686
- }
1687
- : function () {
1688
- return null;
1689
- };
1645
+ ? function (x) {
1646
+ return x[s.field];
1647
+ }
1648
+ : function () {
1649
+ return null;
1650
+ };
1690
1651
  return {
1691
1652
  getter: dataAccessor
1692
1653
  ? function (x) {
1693
1654
  return selector(dataAccessor(x));
1694
- }
1655
+ }
1695
1656
  : selector,
1696
1657
  factor: s.direction && s.direction[0].toLowerCase() == "d" ? -1 : 1,
1697
1658
  compare: s.comparer || s.compare || comparer || defaultCompare,
@@ -1726,7 +1687,7 @@ function indexSorter(sorters, dataAccessor, compare) {
1726
1687
  },
1727
1688
  function (v, k) {
1728
1689
  return k;
1729
- }
1690
+ },
1730
1691
  );
1731
1692
  result.sort(function (ia, ib) {
1732
1693
  return cmp(data[ia], data[ib]);
@@ -1792,21 +1753,17 @@ function updateTree(array, updateCallback, itemFilter, childrenField, removeFilt
1792
1753
  return updateArray(
1793
1754
  array,
1794
1755
  function (item) {
1795
- var _objectSpread2$1;
1756
+ var _extends2;
1796
1757
  if (!itemFilter || itemFilter(item)) item = updateCallback(item);
1797
1758
  var children = item[childrenField];
1798
1759
  if (!Array.isArray(children)) return item;
1799
1760
  var updatedChildren = updateTree(children, updateCallback, itemFilter, childrenField, removeFilter);
1800
1761
  if (updatedChildren != children)
1801
- return _objectSpread2(
1802
- _objectSpread2({}, item),
1803
- {},
1804
- ((_objectSpread2$1 = {}), (_objectSpread2$1[childrenField] = updatedChildren), _objectSpread2$1)
1805
- );
1762
+ return _extends({}, item, ((_extends2 = {}), (_extends2[childrenField] = updatedChildren), _extends2));
1806
1763
  return item;
1807
1764
  },
1808
1765
  null,
1809
- removeFilter
1766
+ removeFilter,
1810
1767
  );
1811
1768
  }
1812
1769
 
@@ -1821,7 +1778,7 @@ function removeTreeNodes(array, criteria, childrenField) {
1821
1778
  return false;
1822
1779
  },
1823
1780
  childrenField,
1824
- criteria
1781
+ criteria,
1825
1782
  );
1826
1783
  }
1827
1784
 
package/dist/hooks.js CHANGED
@@ -85,7 +85,7 @@ function useState(defaultValue) {
85
85
  set: function set(value) {
86
86
  var _instance$setState2;
87
87
  return instance.setState(
88
- ((_instance$setState2 = {}), (_instance$setState2[storeKey] = value), _instance$setState2)
88
+ ((_instance$setState2 = {}), (_instance$setState2[storeKey] = value), _instance$setState2),
89
89
  );
90
90
  },
91
91
  });