@michalrakus/x-react-web-lib 1.9.0 → 1.10.0

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 (34) hide show
  1. package/XInputInterval.d.ts +3 -0
  2. package/XInputInterval.js +5 -0
  3. package/XInputIntervalBase.d.ts +3 -0
  4. package/XInputIntervalBase.js +5 -0
  5. package/gulpfile.js +2 -0
  6. package/lib/components/XAutoComplete.js +1 -1
  7. package/lib/components/XCalendar.d.ts +2 -1
  8. package/lib/components/XCalendar.js +1 -1
  9. package/lib/components/XDropdownDT.d.ts +3 -0
  10. package/lib/components/XDropdownDT.js +14 -7
  11. package/lib/components/XDropdownForEntity.d.ts +1 -0
  12. package/lib/components/XDropdownForEntity.js +3 -1
  13. package/lib/components/XFormBase.d.ts +9 -0
  14. package/lib/components/XFormBase.js +117 -30
  15. package/lib/components/XFormDataTable2.d.ts +2 -1
  16. package/lib/components/XFormDataTable2.js +15 -22
  17. package/lib/components/XInputDate.js +1 -1
  18. package/lib/components/XInputInterval.d.ts +14 -0
  19. package/lib/components/XInputInterval.js +56 -0
  20. package/lib/components/XInputIntervalBase.d.ts +10 -0
  21. package/lib/components/XInputIntervalBase.js +97 -0
  22. package/lib/components/XInputIntervalDT.d.ts +11 -0
  23. package/lib/components/XInputIntervalDT.js +43 -0
  24. package/lib/components/XLazyDataTable.js +43 -29
  25. package/lib/components/XSearchButton.js +1 -1
  26. package/lib/components/XUtils.d.ts +12 -2
  27. package/lib/components/XUtils.js +51 -14
  28. package/lib/components/XUtilsConversions.d.ts +3 -0
  29. package/lib/components/XUtilsConversions.js +53 -1
  30. package/lib/serverApi/ExportImportParam.d.ts +2 -2
  31. package/lib/serverApi/FindParam.d.ts +6 -5
  32. package/lib/serverApi/XUtilsCommon.d.ts +1 -0
  33. package/lib/serverApi/XUtilsCommon.js +70 -0
  34. package/package.json +1 -1
@@ -15,6 +15,26 @@ var __read = (this && this.__read) || function (o, n) {
15
15
  }
16
16
  return ar;
17
17
  };
18
+ var __values = (this && this.__values) || function(o) {
19
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
20
+ if (m) return m.call(o);
21
+ if (o && typeof o.length === "number") return {
22
+ next: function () {
23
+ if (o && i >= o.length) o = void 0;
24
+ return { value: o && o[i++], done: !o };
25
+ }
26
+ };
27
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28
+ };
29
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
31
+ if (ar || !(i in from)) {
32
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
33
+ ar[i] = from[i];
34
+ }
35
+ }
36
+ return to.concat(ar || Array.prototype.slice.call(from));
37
+ };
18
38
  Object.defineProperty(exports, "__esModule", { value: true });
19
39
  exports.dateFormat = exports.XUtilsCommon = void 0;
20
40
  // funkcie spolocne pre Web i pre Server
@@ -38,6 +58,56 @@ var XUtilsCommon = /** @class */ (function () {
38
58
  }
39
59
  }
40
60
  };
61
+ // vseobecnejsia verzia, ktora funguje aj pre *toMany asociacie
62
+ // TODO - toto by sme mohli doplnit o kontrolu ak programator urobil preklep
63
+ XUtilsCommon.getValueOrValueListByPath = function (object, path) {
64
+ var e_1, _a;
65
+ var _b = __read(XUtilsCommon.getFieldAndRestPath(path), 2), field = _b[0], restPath = _b[1];
66
+ if (restPath === null) {
67
+ return object[field];
68
+ }
69
+ else {
70
+ var assocObject = object[field];
71
+ if (Array.isArray(assocObject)) {
72
+ // natrafili sme na pole (atribut "field" je *toMany asociacia), pozbierame hodnoty z pola
73
+ var resultValueList = [];
74
+ try {
75
+ for (var assocObject_1 = __values(assocObject), assocObject_1_1 = assocObject_1.next(); !assocObject_1_1.done; assocObject_1_1 = assocObject_1.next()) {
76
+ var assocObjectItem = assocObject_1_1.value;
77
+ if (assocObjectItem !== null && assocObjectItem !== undefined) { // pre istotu, nemalo by nastat
78
+ var itemValue = XUtilsCommon.getValueOrValueListByPath(assocObjectItem, restPath);
79
+ if (Array.isArray(itemValue)) {
80
+ resultValueList.push.apply(resultValueList, __spreadArray([], __read(itemValue), false));
81
+ }
82
+ else {
83
+ resultValueList.push(itemValue);
84
+ }
85
+ }
86
+ else {
87
+ resultValueList.push(null);
88
+ }
89
+ }
90
+ }
91
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
92
+ finally {
93
+ try {
94
+ if (assocObject_1_1 && !assocObject_1_1.done && (_a = assocObject_1.return)) _a.call(assocObject_1);
95
+ }
96
+ finally { if (e_1) throw e_1.error; }
97
+ }
98
+ return resultValueList;
99
+ }
100
+ else {
101
+ // pri vytvarani noveho riadku - assocObject neni v novom objekte ani ako null (je undefined)
102
+ if (assocObject !== null && assocObject !== undefined) {
103
+ return XUtilsCommon.getValueOrValueListByPath(assocObject, restPath);
104
+ }
105
+ else {
106
+ return null; // asociovany objekt je null, aj hodnota atributu bude null
107
+ }
108
+ }
109
+ }
110
+ };
41
111
  XUtilsCommon.getFieldListForPath = function (path) {
42
112
  return path.split('.');
43
113
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michalrakus/x-react-web-lib",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rimraf lib",