@easyquery/core 7.2.3-rc03 → 7.2.4-beta03

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 (140) hide show
  1. package/dist/bundles/easyquery.core.js +9353 -9335
  2. package/dist/bundles/easyquery.core.js.map +1 -1
  3. package/dist/bundles/easyquery.core.min.js +1 -1
  4. package/dist/bundles/easyquery.core.min.js.map +1 -1
  5. package/dist/lib/common/eq_services.d.ts +56 -56
  6. package/dist/lib/common/eq_services.js +159 -159
  7. package/dist/lib/common/query_param.d.ts +25 -25
  8. package/dist/lib/common/query_param.js +1 -0
  9. package/dist/lib/common/tree.d.ts +10 -10
  10. package/dist/lib/common/tree.js +57 -57
  11. package/dist/lib/data/eq_aggr_container.d.ts +24 -24
  12. package/dist/lib/data/eq_aggr_container.js +108 -108
  13. package/dist/lib/data/eq_aggr_container.js.map +1 -1
  14. package/dist/lib/data/eq_data_loader.d.ts +8 -8
  15. package/dist/lib/data/eq_data_loader.js +49 -49
  16. package/dist/lib/data/eq_data_loader.js.map +1 -1
  17. package/dist/lib/data/google_data_converter.d.ts +82 -82
  18. package/dist/lib/data/google_data_converter.js +173 -173
  19. package/dist/lib/data/google_data_converter.js.map +1 -1
  20. package/dist/lib/dm/aggr_function.d.ts +27 -27
  21. package/dist/lib/dm/aggr_function.js +42 -42
  22. package/dist/lib/dm/data_model.d.ts +330 -330
  23. package/dist/lib/dm/data_model.js +934 -932
  24. package/dist/lib/dm/data_model.js.map +1 -1
  25. package/dist/lib/dm/dto/af_data.d.ts +16 -16
  26. package/dist/lib/dm/dto/af_data.js +1 -0
  27. package/dist/lib/dm/dto/dm_data.d.ts +34 -34
  28. package/dist/lib/dm/dto/dm_data.js +1 -0
  29. package/dist/lib/dm/dto/entity_data.d.ts +37 -37
  30. package/dist/lib/dm/dto/entity_data.js +1 -0
  31. package/dist/lib/dm/dto/operator_data.d.ts +44 -44
  32. package/dist/lib/dm/dto/operator_data.js +1 -0
  33. package/dist/lib/dm/dto/ve_data.d.ts +10 -10
  34. package/dist/lib/dm/dto/ve_data.js +1 -0
  35. package/dist/lib/dm/entity.d.ts +71 -71
  36. package/dist/lib/dm/entity.js +90 -88
  37. package/dist/lib/dm/entity.js.map +1 -1
  38. package/dist/lib/dm/link.d.ts +7 -7
  39. package/dist/lib/dm/link.js +1 -0
  40. package/dist/lib/dm/operator.d.ts +80 -80
  41. package/dist/lib/dm/operator.js +93 -93
  42. package/dist/lib/dm/value_editor.d.ts +16 -16
  43. package/dist/lib/dm/value_editor.js +43 -41
  44. package/dist/lib/dm/value_editor.js.map +1 -1
  45. package/dist/lib/eqs/eqs_data_fetcher.d.ts +7 -7
  46. package/dist/lib/eqs/eqs_data_fetcher.js +36 -36
  47. package/dist/lib/eqs/eqs_exporter.d.ts +10 -10
  48. package/dist/lib/eqs/eqs_exporter.js +57 -54
  49. package/dist/lib/eqs/eqs_exporter.js.map +1 -1
  50. package/dist/lib/eqs/eqs_model_loader.d.ts +7 -7
  51. package/dist/lib/eqs/eqs_model_loader.js +42 -40
  52. package/dist/lib/eqs/eqs_model_loader.js.map +1 -1
  53. package/dist/lib/eqs/eqs_query_file_loader.d.ts +9 -9
  54. package/dist/lib/eqs/eqs_query_file_loader.js +54 -54
  55. package/dist/lib/eqs/eqs_query_file_loader.js.map +1 -1
  56. package/dist/lib/eqs/eqs_query_synchronizer.d.ts +7 -7
  57. package/dist/lib/eqs/eqs_query_synchronizer.js +23 -23
  58. package/dist/lib/eqs/eqs_value_list_resolver.d.ts +7 -7
  59. package/dist/lib/eqs/eqs_value_list_resolver.js +28 -28
  60. package/dist/lib/export/exporter.d.ts +16 -16
  61. package/dist/lib/export/exporter.js +1 -0
  62. package/dist/lib/i18n/text_resources.d.ts +1 -1
  63. package/dist/lib/i18n/text_resources.js +26 -26
  64. package/dist/lib/i18n/text_resources.js.map +1 -1
  65. package/dist/lib/main/action.d.ts +13 -13
  66. package/dist/lib/main/action.js +5 -5
  67. package/dist/lib/main/context.d.ts +342 -342
  68. package/dist/lib/main/context.js +1439 -1438
  69. package/dist/lib/main/context.js.map +1 -1
  70. package/dist/lib/main/context_options.d.ts +145 -145
  71. package/dist/lib/main/context_options.js +1 -0
  72. package/dist/lib/main/data_fetcher.d.ts +46 -46
  73. package/dist/lib/main/data_fetcher.js +1 -0
  74. package/dist/lib/main/eq_actions.d.ts +14 -14
  75. package/dist/lib/main/eq_actions.js +15 -15
  76. package/dist/lib/main/list_cache.d.ts +8 -8
  77. package/dist/lib/main/list_cache.js +1 -0
  78. package/dist/lib/main/model_loader.d.ts +21 -21
  79. package/dist/lib/main/model_loader.js +32 -32
  80. package/dist/lib/main/model_storage.d.ts +13 -13
  81. package/dist/lib/main/model_storage.js +17 -17
  82. package/dist/lib/main/query_file_loader.d.ts +15 -15
  83. package/dist/lib/main/query_file_loader.js +1 -0
  84. package/dist/lib/main/query_storage.d.ts +58 -58
  85. package/dist/lib/main/query_storage.js +124 -124
  86. package/dist/lib/main/query_synchronizer.d.ts +9 -9
  87. package/dist/lib/main/query_synchronizer.js +1 -0
  88. package/dist/lib/main/value_list_resolver.d.ts +18 -18
  89. package/dist/lib/main/value_list_resolver.js +1 -0
  90. package/dist/lib/main/widget.d.ts +74 -74
  91. package/dist/lib/main/widget.js +101 -101
  92. package/dist/lib/public_api.d.ts +58 -58
  93. package/dist/lib/public_api.js +59 -42
  94. package/dist/lib/public_api.js.map +1 -1
  95. package/dist/lib/query/condition.d.ts +97 -97
  96. package/dist/lib/query/condition.js +331 -331
  97. package/dist/lib/query/descriptors.d.ts +36 -36
  98. package/dist/lib/query/descriptors.js +1 -0
  99. package/dist/lib/query/dto/condition_data.d.ts +38 -38
  100. package/dist/lib/query/dto/condition_data.js +1 -0
  101. package/dist/lib/query/dto/expression_data.d.ts +32 -32
  102. package/dist/lib/query/dto/expression_data.js +1 -0
  103. package/dist/lib/query/dto/query_column_data.d.ts +28 -28
  104. package/dist/lib/query/dto/query_column_data.js +1 -0
  105. package/dist/lib/query/dto/query_data.d.ts +27 -27
  106. package/dist/lib/query/dto/query_data.js +1 -0
  107. package/dist/lib/query/expression.d.ts +69 -69
  108. package/dist/lib/query/expression.js +202 -202
  109. package/dist/lib/query/query.d.ts +410 -410
  110. package/dist/lib/query/query.js +1393 -1391
  111. package/dist/lib/query/query.js.map +1 -1
  112. package/dist/lib/query/query_column.d.ts +70 -70
  113. package/dist/lib/query/query_column.js +157 -157
  114. package/dist/lib/query/query_events.d.ts +29 -29
  115. package/dist/lib/query/query_events.js +19 -19
  116. package/dist/lib/types/cond_part.d.ts +6 -6
  117. package/dist/lib/types/cond_part.js +7 -7
  118. package/dist/lib/types/cond_tag.d.ts +12 -12
  119. package/dist/lib/types/cond_tag.js +13 -13
  120. package/dist/lib/types/data_kind.d.ts +15 -15
  121. package/dist/lib/types/data_kind.js +16 -16
  122. package/dist/lib/types/eq_editor_tag.d.ts +17 -17
  123. package/dist/lib/types/eq_editor_tag.js +20 -20
  124. package/dist/lib/types/expr_tag.d.ts +19 -19
  125. package/dist/lib/types/expr_tag.js +20 -20
  126. package/dist/lib/types/link_type.d.ts +17 -17
  127. package/dist/lib/types/link_type.js +18 -18
  128. package/dist/lib/types/widget_group.d.ts +17 -17
  129. package/dist/lib/types/widget_group.js +18 -18
  130. package/dist/lib/utils/constants.d.ts +36 -36
  131. package/dist/lib/utils/constants.js +50 -50
  132. package/dist/lib/utils/format_parser.d.ts +40 -40
  133. package/dist/lib/utils/format_parser.js +87 -87
  134. package/dist/lib/utils/utils.d.ts +34 -34
  135. package/dist/lib/utils/utils.js +102 -102
  136. package/dist/lib/utils/version_info.d.ts +9 -9
  137. package/dist/lib/utils/version_info.js +12 -12
  138. package/dist/lib/utils/version_info.js.map +1 -1
  139. package/package.json +16 -16
  140. package/webpack.config.js +6 -5
@@ -1,203 +1,203 @@
1
- import { DataType } from '@easydata/core';
2
- import { equtils } from '../utils/utils';
3
- import { DataKind } from '../types/data_kind';
4
- import { ExprTag } from '../types/expr_tag';
5
- /**
6
- * Represents expression object.
7
- */
8
- var Expression = /** @class */ (function () {
9
- /** The default constructor. */
10
- function Expression(parent) {
11
- var _this = this;
12
- this.parent = parent;
13
- /** The tag. */
14
- this.tag = ExprTag.Constant;
15
- /** The data kind. */
16
- this.kind = DataKind.Scalar;
17
- /** The data type. */
18
- this.dataType = DataType.Unknown;
19
- /** The value. */
20
- this._value = ''; //DO NOT forget remove any
21
- /**
22
- * The distinct option. (e.g `SELECT DISTINCT`)
23
- */
24
- this.distinct = false;
25
- this._isDefaultValue = false;
26
- this.getText = function () { return _this.text || _this._value; };
27
- this.args = new Array();
28
- }
29
- Expression.prototype.getParent = function () {
30
- return this.parent;
31
- };
32
- Expression.prototype.getModel = function () {
33
- return this.parent.getQuery().getModel();
34
- };
35
- /**
36
- * Loads expression from its JSON representation object.
37
- * @param model The Data Model.
38
- * @param data The JSON representation object.
39
- */
40
- Expression.prototype.loadFromData = function (model, data) {
41
- if (data) {
42
- this.tag = data.tag;
43
- if (data.val) {
44
- this._value = data.val;
45
- this.text = data.txt;
46
- }
47
- else if (data.id) {
48
- this.kind = DataKind.Attribute;
49
- this._value = data.id;
50
- this.text = data.txt;
51
- }
52
- if (typeof data.dtype !== 'undefined') {
53
- this.dataType = data.dtype;
54
- }
55
- if (this.tag == ExprTag.EntityAttribute
56
- || this.tag == ExprTag.ParentEntityAttribute) {
57
- this.kind = DataKind.Attribute;
58
- //We don't load other info for EntityAttr
59
- }
60
- else {
61
- if (typeof data.kind !== 'undefined') {
62
- this.kind = data.kind;
63
- }
64
- if (data.query) {
65
- this.subQuery = this.parent.getQuery().createSubQuery();
66
- this.subQuery.loadFromDataOrJson(data.query);
67
- }
68
- if (typeof data.distinct !== 'undefined') {
69
- this.distinct = data.distinct;
70
- }
71
- if (data.func) {
72
- this.func = data.func;
73
- if (data.args) {
74
- for (var i = 0; i < data.args.length; i++) {
75
- var arg = new Expression(this.parent);
76
- arg.loadFromData(model, data.args[i]);
77
- this.args.push(arg);
78
- }
79
- }
80
- }
81
- if (data.sql) {
82
- this.sql = data.sql;
83
- this.baseAttrId = data.baseAttrId;
84
- }
85
- }
86
- }
87
- };
88
- /**
89
- * Saves expression from JSON representation object.
90
- * @returns The JSON representation object.
91
- */
92
- Expression.prototype.saveToData = function () {
93
- var obj = {
94
- tag: this.tag
95
- };
96
- obj.dtype = this.dataType;
97
- //Do not save other info for EntityAttr
98
- if (this.tag == ExprTag.EntityAttribute || this.tag == ExprTag.ParentEntityAttribute) {
99
- if (this._value) {
100
- obj.id = this._value;
101
- obj.val = this._value;
102
- }
103
- if (this.text) {
104
- obj.txt = this.text;
105
- }
106
- //Do not save other info for EntityAttr
107
- }
108
- else {
109
- if (this.subQuery) {
110
- obj.query = this.subQuery.toJSONData();
111
- }
112
- if (typeof this.kind !== "undefined") {
113
- obj.kind = this.kind;
114
- }
115
- if (this._value) {
116
- obj.val = this._value;
117
- }
118
- if (this.text) {
119
- obj.txt = this.text;
120
- }
121
- if (this.distinct) {
122
- obj.distinct = this.distinct;
123
- }
124
- if (this.func) {
125
- obj.func = this.func;
126
- obj.args = [];
127
- for (var i = 0; i < this.args.length; i++) {
128
- obj.args.push(this.args[i].saveToData());
129
- }
130
- }
131
- if (this.sql) {
132
- obj.sql = this.sql;
133
- obj.baseAttrId = this.baseAttrId;
134
- }
135
- }
136
- return obj;
137
- };
138
- Expression.prototype.getIndex = function () {
139
- return this.parent.getExpressionIndex(this);
140
- };
141
- Object.defineProperty(Expression.prototype, "value", {
142
- get: function () {
143
- return this._value;
144
- },
145
- enumerable: true,
146
- configurable: true
147
- });
148
- Expression.prototype.setValue = function (val, silent) {
149
- if (silent === void 0) { silent = false; }
150
- this.setContent(val, undefined, silent);
151
- };
152
- Expression.prototype.setContent = function (val, txt, silent) {
153
- if (silent === void 0) { silent = false; }
154
- var oldValue = this.value;
155
- if (this.kind == DataKind.Attribute && val) {
156
- var attr = this.getModel().getAttributeById(val);
157
- if (!attr) {
158
- throw "No such entity attribute:" + val;
159
- }
160
- this.dataType = attr.dataType;
161
- }
162
- this._value = val;
163
- if (typeof txt !== 'undefined') {
164
- this.text = txt;
165
- }
166
- else if (typeof this.text !== 'undefined') {
167
- this.text = val;
168
- }
169
- this._isDefaultValue = false;
170
- if (!silent) {
171
- this.parent.expressionChanged(this, oldValue);
172
- }
173
- };
174
- Expression.prototype.isEmpty = function () {
175
- return !(this.text || this._value);
176
- };
177
- Expression.prototype.hasText = function () {
178
- return this.text && this.text.length > 0;
179
- };
180
- Expression.prototype.tryCopyValueFrom = function (expr) {
181
- if (this.kind == expr.kind) {
182
- if (this.dataType == expr.dataType) {
183
- this.setContent(expr.value.length ? expr.value : this._value, (expr.text && expr.text.length) ? expr.text : this.text, true);
184
- }
185
- else {
186
- var val = equtils.convertValue(expr.value, expr.dataType, this.dataType);
187
- this.setContent(val.length ? val : this._value, (expr.text && expr.text.length) ? expr.text : this.text, true);
188
- }
189
- this.subQuery = expr.subQuery;
190
- this.sql = expr.sql;
191
- this.baseAttrId = expr.baseAttrId;
192
- }
193
- else if (!this._isDefaultValue) {
194
- this.setContent('', '', true);
195
- this.subQuery = null;
196
- this.sql = null;
197
- this.baseAttrId = null;
198
- }
199
- };
200
- return Expression;
201
- }());
202
- export { Expression };
1
+ import { DataType } from '@easydata/core';
2
+ import { equtils } from '../utils/utils';
3
+ import { DataKind } from '../types/data_kind';
4
+ import { ExprTag } from '../types/expr_tag';
5
+ /**
6
+ * Represents expression object.
7
+ */
8
+ var Expression = /** @class */ (function () {
9
+ /** The default constructor. */
10
+ function Expression(parent) {
11
+ var _this = this;
12
+ this.parent = parent;
13
+ /** The tag. */
14
+ this.tag = ExprTag.Constant;
15
+ /** The data kind. */
16
+ this.kind = DataKind.Scalar;
17
+ /** The data type. */
18
+ this.dataType = DataType.Unknown;
19
+ /** The value. */
20
+ this._value = ''; //DO NOT forget remove any
21
+ /**
22
+ * The distinct option. (e.g `SELECT DISTINCT`)
23
+ */
24
+ this.distinct = false;
25
+ this._isDefaultValue = false;
26
+ this.getText = function () { return _this.text || _this._value; };
27
+ this.args = new Array();
28
+ }
29
+ Expression.prototype.getParent = function () {
30
+ return this.parent;
31
+ };
32
+ Expression.prototype.getModel = function () {
33
+ return this.parent.getQuery().getModel();
34
+ };
35
+ /**
36
+ * Loads expression from its JSON representation object.
37
+ * @param model The Data Model.
38
+ * @param data The JSON representation object.
39
+ */
40
+ Expression.prototype.loadFromData = function (model, data) {
41
+ if (data) {
42
+ this.tag = data.tag;
43
+ if (data.val) {
44
+ this._value = data.val;
45
+ this.text = data.txt;
46
+ }
47
+ else if (data.id) {
48
+ this.kind = DataKind.Attribute;
49
+ this._value = data.id;
50
+ this.text = data.txt;
51
+ }
52
+ if (typeof data.dtype !== 'undefined') {
53
+ this.dataType = data.dtype;
54
+ }
55
+ if (this.tag == ExprTag.EntityAttribute
56
+ || this.tag == ExprTag.ParentEntityAttribute) {
57
+ this.kind = DataKind.Attribute;
58
+ //We don't load other info for EntityAttr
59
+ }
60
+ else {
61
+ if (typeof data.kind !== 'undefined') {
62
+ this.kind = data.kind;
63
+ }
64
+ if (data.query) {
65
+ this.subQuery = this.parent.getQuery().createSubQuery();
66
+ this.subQuery.loadFromDataOrJson(data.query);
67
+ }
68
+ if (typeof data.distinct !== 'undefined') {
69
+ this.distinct = data.distinct;
70
+ }
71
+ if (data.func) {
72
+ this.func = data.func;
73
+ if (data.args) {
74
+ for (var i = 0; i < data.args.length; i++) {
75
+ var arg = new Expression(this.parent);
76
+ arg.loadFromData(model, data.args[i]);
77
+ this.args.push(arg);
78
+ }
79
+ }
80
+ }
81
+ if (data.sql) {
82
+ this.sql = data.sql;
83
+ this.baseAttrId = data.baseAttrId;
84
+ }
85
+ }
86
+ }
87
+ };
88
+ /**
89
+ * Saves expression from JSON representation object.
90
+ * @returns The JSON representation object.
91
+ */
92
+ Expression.prototype.saveToData = function () {
93
+ var obj = {
94
+ tag: this.tag
95
+ };
96
+ obj.dtype = this.dataType;
97
+ //Do not save other info for EntityAttr
98
+ if (this.tag == ExprTag.EntityAttribute || this.tag == ExprTag.ParentEntityAttribute) {
99
+ if (this._value) {
100
+ obj.id = this._value;
101
+ obj.val = this._value;
102
+ }
103
+ if (this.text) {
104
+ obj.txt = this.text;
105
+ }
106
+ //Do not save other info for EntityAttr
107
+ }
108
+ else {
109
+ if (this.subQuery) {
110
+ obj.query = this.subQuery.toJSONData();
111
+ }
112
+ if (typeof this.kind !== "undefined") {
113
+ obj.kind = this.kind;
114
+ }
115
+ if (this._value) {
116
+ obj.val = this._value;
117
+ }
118
+ if (this.text) {
119
+ obj.txt = this.text;
120
+ }
121
+ if (this.distinct) {
122
+ obj.distinct = this.distinct;
123
+ }
124
+ if (this.func) {
125
+ obj.func = this.func;
126
+ obj.args = [];
127
+ for (var i = 0; i < this.args.length; i++) {
128
+ obj.args.push(this.args[i].saveToData());
129
+ }
130
+ }
131
+ if (this.sql) {
132
+ obj.sql = this.sql;
133
+ obj.baseAttrId = this.baseAttrId;
134
+ }
135
+ }
136
+ return obj;
137
+ };
138
+ Expression.prototype.getIndex = function () {
139
+ return this.parent.getExpressionIndex(this);
140
+ };
141
+ Object.defineProperty(Expression.prototype, "value", {
142
+ get: function () {
143
+ return this._value;
144
+ },
145
+ enumerable: false,
146
+ configurable: true
147
+ });
148
+ Expression.prototype.setValue = function (val, silent) {
149
+ if (silent === void 0) { silent = false; }
150
+ this.setContent(val, undefined, silent);
151
+ };
152
+ Expression.prototype.setContent = function (val, txt, silent) {
153
+ if (silent === void 0) { silent = false; }
154
+ var oldValue = this.value;
155
+ if (this.kind == DataKind.Attribute && val) {
156
+ var attr = this.getModel().getAttributeById(val);
157
+ if (!attr) {
158
+ throw "No such entity attribute:" + val;
159
+ }
160
+ this.dataType = attr.dataType;
161
+ }
162
+ this._value = val;
163
+ if (typeof txt !== 'undefined') {
164
+ this.text = txt;
165
+ }
166
+ else if (typeof this.text !== 'undefined') {
167
+ this.text = val;
168
+ }
169
+ this._isDefaultValue = false;
170
+ if (!silent) {
171
+ this.parent.expressionChanged(this, oldValue);
172
+ }
173
+ };
174
+ Expression.prototype.isEmpty = function () {
175
+ return !(this.text || this._value);
176
+ };
177
+ Expression.prototype.hasText = function () {
178
+ return this.text && this.text.length > 0;
179
+ };
180
+ Expression.prototype.tryCopyValueFrom = function (expr) {
181
+ if (this.kind == expr.kind) {
182
+ if (this.dataType == expr.dataType) {
183
+ this.setContent(expr.value.length ? expr.value : this._value, (expr.text && expr.text.length) ? expr.text : this.text, true);
184
+ }
185
+ else {
186
+ var val = equtils.convertValue(expr.value, expr.dataType, this.dataType);
187
+ this.setContent(val.length ? val : this._value, (expr.text && expr.text.length) ? expr.text : this.text, true);
188
+ }
189
+ this.subQuery = expr.subQuery;
190
+ this.sql = expr.sql;
191
+ this.baseAttrId = expr.baseAttrId;
192
+ }
193
+ else if (!this._isDefaultValue) {
194
+ this.setContent('', '', true);
195
+ this.subQuery = null;
196
+ this.sql = null;
197
+ this.baseAttrId = null;
198
+ }
199
+ };
200
+ return Expression;
201
+ }());
202
+ export { Expression };
203
203
  //# sourceMappingURL=expression.js.map