@rxap/remote-method 12.0.9 → 13.0.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 (125) hide show
  1. package/directive/package.json +5 -5
  2. package/esm2020/directive/lib/error.mjs +7 -0
  3. package/esm2020/directive/lib/remote-method-template-collection.directive.mjs +333 -0
  4. package/esm2020/directive/lib/remote-method-template.directive.mjs +201 -0
  5. package/esm2020/directive/lib/remote-method.directive.mjs +165 -0
  6. package/esm2020/directive/lib/tokens.mjs +3 -0
  7. package/esm2020/directive/public_api.mjs +6 -0
  8. package/esm2020/directive/rxap-remote-method-directive.mjs +5 -0
  9. package/esm2020/http/directive/lib/contenteditable.directive.mjs +86 -0
  10. package/esm2020/http/directive/lib/http-remote-method.directive.mjs +79 -0
  11. package/esm2020/http/directive/public_api.mjs +3 -0
  12. package/esm2020/http/directive/rxap-remote-method-http-directive.mjs +5 -0
  13. package/esm2020/http/lib/base-http.remote-method.mjs +82 -0
  14. package/esm2020/http/lib/http-remote-method.loader.mjs +30 -0
  15. package/esm2020/http/lib/http.remote-method.mjs +45 -0
  16. package/esm2020/http/public_api.mjs +4 -0
  17. package/esm2020/http/rxap-remote-method-http.mjs +5 -0
  18. package/esm2020/index.mjs +6 -0
  19. package/esm2020/lib/base.remote-method.mjs +73 -0
  20. package/esm2020/lib/error.mjs +7 -0
  21. package/esm2020/lib/proxy.remote-method.mjs +29 -0
  22. package/esm2020/lib/remote-method-loader.mjs +17 -0
  23. package/esm2020/lib/tokens.mjs +4 -0
  24. package/esm2020/rxap-remote-method.mjs +5 -0
  25. package/esm2020/testing/lib/remote-method-testing-loader.mjs +47 -0
  26. package/esm2020/testing/public_api.mjs +2 -0
  27. package/esm2020/testing/rxap-remote-method-testing.mjs +5 -0
  28. package/fesm2015/rxap-remote-method-directive.mjs +712 -0
  29. package/fesm2015/rxap-remote-method-directive.mjs.map +1 -0
  30. package/fesm2015/rxap-remote-method-http-directive.mjs +172 -0
  31. package/fesm2015/rxap-remote-method-http-directive.mjs.map +1 -0
  32. package/fesm2015/rxap-remote-method-http.mjs +158 -0
  33. package/fesm2015/rxap-remote-method-http.mjs.map +1 -0
  34. package/fesm2015/{rxap-remote-method-testing.js → rxap-remote-method-testing.mjs} +1 -1
  35. package/fesm2015/rxap-remote-method-testing.mjs.map +1 -0
  36. package/fesm2015/{rxap-remote-method.js → rxap-remote-method.mjs} +35 -31
  37. package/fesm2015/rxap-remote-method.mjs.map +1 -0
  38. package/{fesm2015/rxap-remote-method-directive.js → fesm2020/rxap-remote-method-directive.mjs} +64 -72
  39. package/fesm2020/rxap-remote-method-directive.mjs.map +1 -0
  40. package/{fesm2015/rxap-remote-method-http-directive.js → fesm2020/rxap-remote-method-http-directive.mjs} +15 -15
  41. package/fesm2020/rxap-remote-method-http-directive.mjs.map +1 -0
  42. package/{fesm2015/rxap-remote-method-http.js → fesm2020/rxap-remote-method-http.mjs} +18 -16
  43. package/fesm2020/rxap-remote-method-http.mjs.map +1 -0
  44. package/{esm2015/testing/lib/remote-method-testing-loader.js → fesm2020/rxap-remote-method-testing.mjs} +18 -17
  45. package/fesm2020/rxap-remote-method-testing.mjs.map +1 -0
  46. package/fesm2020/rxap-remote-method.mjs +126 -0
  47. package/fesm2020/rxap-remote-method.mjs.map +1 -0
  48. package/http/directive/package.json +5 -5
  49. package/http/package.json +5 -5
  50. package/package.json +62 -14
  51. package/src/schematics/base/index.js +9 -9
  52. package/src/schematics/base/index.js.map +1 -1
  53. package/src/schematics/directive/index.js +6 -6
  54. package/src/schematics/directive/index.js.map +1 -1
  55. package/src/schematics/http/index.js +7 -7
  56. package/src/schematics/http/index.js.map +1 -1
  57. package/src/schematics/ng-add/index.js +1 -1
  58. package/src/schematics/ng-add/index.js.map +1 -1
  59. package/testing/package.json +5 -5
  60. package/bundles/rxap-remote-method-directive.umd.js +0 -1150
  61. package/bundles/rxap-remote-method-directive.umd.js.map +0 -1
  62. package/bundles/rxap-remote-method-http-directive.umd.js +0 -565
  63. package/bundles/rxap-remote-method-http-directive.umd.js.map +0 -1
  64. package/bundles/rxap-remote-method-http.umd.js +0 -520
  65. package/bundles/rxap-remote-method-http.umd.js.map +0 -1
  66. package/bundles/rxap-remote-method-testing.umd.js +0 -388
  67. package/bundles/rxap-remote-method-testing.umd.js.map +0 -1
  68. package/bundles/rxap-remote-method.umd.js +0 -527
  69. package/bundles/rxap-remote-method.umd.js.map +0 -1
  70. package/esm2015/directive/lib/error.js +0 -7
  71. package/esm2015/directive/lib/error.js.map +0 -1
  72. package/esm2015/directive/lib/remote-method-template-collection.directive.js +0 -333
  73. package/esm2015/directive/lib/remote-method-template-collection.directive.js.map +0 -1
  74. package/esm2015/directive/lib/remote-method-template.directive.js +0 -204
  75. package/esm2015/directive/lib/remote-method-template.directive.js.map +0 -1
  76. package/esm2015/directive/lib/remote-method.directive.js +0 -170
  77. package/esm2015/directive/lib/remote-method.directive.js.map +0 -1
  78. package/esm2015/directive/lib/tokens.js +0 -3
  79. package/esm2015/directive/lib/tokens.js.map +0 -1
  80. package/esm2015/directive/public_api.js +0 -6
  81. package/esm2015/directive/public_api.js.map +0 -1
  82. package/esm2015/directive/rxap-remote-method-directive.js +0 -5
  83. package/esm2015/directive/rxap-remote-method-directive.js.map +0 -1
  84. package/esm2015/http/directive/lib/contenteditable.directive.js +0 -86
  85. package/esm2015/http/directive/lib/contenteditable.directive.js.map +0 -1
  86. package/esm2015/http/directive/lib/http-remote-method.directive.js +0 -79
  87. package/esm2015/http/directive/lib/http-remote-method.directive.js.map +0 -1
  88. package/esm2015/http/directive/public_api.js +0 -3
  89. package/esm2015/http/directive/public_api.js.map +0 -1
  90. package/esm2015/http/directive/rxap-remote-method-http-directive.js +0 -5
  91. package/esm2015/http/directive/rxap-remote-method-http-directive.js.map +0 -1
  92. package/esm2015/http/lib/base-http.remote-method.js +0 -79
  93. package/esm2015/http/lib/base-http.remote-method.js.map +0 -1
  94. package/esm2015/http/lib/http-remote-method.loader.js +0 -30
  95. package/esm2015/http/lib/http-remote-method.loader.js.map +0 -1
  96. package/esm2015/http/lib/http.remote-method.js +0 -46
  97. package/esm2015/http/lib/http.remote-method.js.map +0 -1
  98. package/esm2015/http/public_api.js +0 -4
  99. package/esm2015/http/public_api.js.map +0 -1
  100. package/esm2015/http/rxap-remote-method-http.js +0 -5
  101. package/esm2015/http/rxap-remote-method-http.js.map +0 -1
  102. package/esm2015/index.js +0 -6
  103. package/esm2015/index.js.map +0 -1
  104. package/esm2015/lib/base.remote-method.js +0 -76
  105. package/esm2015/lib/base.remote-method.js.map +0 -1
  106. package/esm2015/lib/error.js +0 -7
  107. package/esm2015/lib/error.js.map +0 -1
  108. package/esm2015/lib/proxy.remote-method.js +0 -32
  109. package/esm2015/lib/proxy.remote-method.js.map +0 -1
  110. package/esm2015/lib/remote-method-loader.js +0 -20
  111. package/esm2015/lib/remote-method-loader.js.map +0 -1
  112. package/esm2015/lib/tokens.js +0 -4
  113. package/esm2015/lib/tokens.js.map +0 -1
  114. package/esm2015/rxap-remote-method.js +0 -5
  115. package/esm2015/rxap-remote-method.js.map +0 -1
  116. package/esm2015/testing/lib/remote-method-testing-loader.js.map +0 -1
  117. package/esm2015/testing/public_api.js +0 -2
  118. package/esm2015/testing/public_api.js.map +0 -1
  119. package/esm2015/testing/rxap-remote-method-testing.js +0 -5
  120. package/esm2015/testing/rxap-remote-method-testing.js.map +0 -1
  121. package/fesm2015/rxap-remote-method-directive.js.map +0 -1
  122. package/fesm2015/rxap-remote-method-http-directive.js.map +0 -1
  123. package/fesm2015/rxap-remote-method-http.js.map +0 -1
  124. package/fesm2015/rxap-remote-method-testing.js.map +0 -1
  125. package/fesm2015/rxap-remote-method.js.map +0 -1
@@ -1,1150 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@rxap/remote-method'), require('@rxap/utilities'), require('@rxap/utilities/rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/remote-method/directive', ['exports', '@angular/core', '@rxap/remote-method', '@rxap/utilities', '@rxap/utilities/rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap['remote-method'] = global.rxap['remote-method'] || {}, global.rxap['remote-method'].directive = {}), global.ng.core, global.rxap['remote-method'], global.utilities, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, i0, i1, utilities, rxjs, operators) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
-
30
- /*! *****************************************************************************
31
- Copyright (c) Microsoft Corporation.
32
-
33
- Permission to use, copy, modify, and/or distribute this software for any
34
- purpose with or without fee is hereby granted.
35
-
36
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
- PERFORMANCE OF THIS SOFTWARE.
43
- ***************************************************************************** */
44
- /* global Reflect, Promise */
45
- var extendStatics = function (d, b) {
46
- extendStatics = Object.setPrototypeOf ||
47
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
48
- function (d, b) { for (var p in b)
49
- if (Object.prototype.hasOwnProperty.call(b, p))
50
- d[p] = b[p]; };
51
- return extendStatics(d, b);
52
- };
53
- function __extends(d, b) {
54
- if (typeof b !== "function" && b !== null)
55
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
56
- extendStatics(d, b);
57
- function __() { this.constructor = d; }
58
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
59
- }
60
- var __assign = function () {
61
- __assign = Object.assign || function __assign(t) {
62
- for (var s, i = 1, n = arguments.length; i < n; i++) {
63
- s = arguments[i];
64
- for (var p in s)
65
- if (Object.prototype.hasOwnProperty.call(s, p))
66
- t[p] = s[p];
67
- }
68
- return t;
69
- };
70
- return __assign.apply(this, arguments);
71
- };
72
- function __rest(s, e) {
73
- var t = {};
74
- for (var p in s)
75
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
76
- t[p] = s[p];
77
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
78
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
79
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
80
- t[p[i]] = s[p[i]];
81
- }
82
- return t;
83
- }
84
- function __decorate(decorators, target, key, desc) {
85
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
86
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
87
- r = Reflect.decorate(decorators, target, key, desc);
88
- else
89
- for (var i = decorators.length - 1; i >= 0; i--)
90
- if (d = decorators[i])
91
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
92
- return c > 3 && r && Object.defineProperty(target, key, r), r;
93
- }
94
- function __param(paramIndex, decorator) {
95
- return function (target, key) { decorator(target, key, paramIndex); };
96
- }
97
- function __metadata(metadataKey, metadataValue) {
98
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
99
- return Reflect.metadata(metadataKey, metadataValue);
100
- }
101
- function __awaiter(thisArg, _arguments, P, generator) {
102
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103
- return new (P || (P = Promise))(function (resolve, reject) {
104
- function fulfilled(value) { try {
105
- step(generator.next(value));
106
- }
107
- catch (e) {
108
- reject(e);
109
- } }
110
- function rejected(value) { try {
111
- step(generator["throw"](value));
112
- }
113
- catch (e) {
114
- reject(e);
115
- } }
116
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
117
- step((generator = generator.apply(thisArg, _arguments || [])).next());
118
- });
119
- }
120
- function __generator(thisArg, body) {
121
- var _ = { label: 0, sent: function () { if (t[0] & 1)
122
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
123
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
124
- function verb(n) { return function (v) { return step([n, v]); }; }
125
- function step(op) {
126
- if (f)
127
- throw new TypeError("Generator is already executing.");
128
- while (_)
129
- try {
130
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
131
- return t;
132
- if (y = 0, t)
133
- op = [op[0] & 2, t.value];
134
- switch (op[0]) {
135
- case 0:
136
- case 1:
137
- t = op;
138
- break;
139
- case 4:
140
- _.label++;
141
- return { value: op[1], done: false };
142
- case 5:
143
- _.label++;
144
- y = op[1];
145
- op = [0];
146
- continue;
147
- case 7:
148
- op = _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- default:
152
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
153
- _ = 0;
154
- continue;
155
- }
156
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
157
- _.label = op[1];
158
- break;
159
- }
160
- if (op[0] === 6 && _.label < t[1]) {
161
- _.label = t[1];
162
- t = op;
163
- break;
164
- }
165
- if (t && _.label < t[2]) {
166
- _.label = t[2];
167
- _.ops.push(op);
168
- break;
169
- }
170
- if (t[2])
171
- _.ops.pop();
172
- _.trys.pop();
173
- continue;
174
- }
175
- op = body.call(thisArg, _);
176
- }
177
- catch (e) {
178
- op = [6, e];
179
- y = 0;
180
- }
181
- finally {
182
- f = t = 0;
183
- }
184
- if (op[0] & 5)
185
- throw op[1];
186
- return { value: op[0] ? op[1] : void 0, done: true };
187
- }
188
- }
189
- var __createBinding = Object.create ? (function (o, m, k, k2) {
190
- if (k2 === undefined)
191
- k2 = k;
192
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
193
- }) : (function (o, m, k, k2) {
194
- if (k2 === undefined)
195
- k2 = k;
196
- o[k2] = m[k];
197
- });
198
- function __exportStar(m, o) {
199
- for (var p in m)
200
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
201
- __createBinding(o, m, p);
202
- }
203
- function __values(o) {
204
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
205
- if (m)
206
- return m.call(o);
207
- if (o && typeof o.length === "number")
208
- return {
209
- next: function () {
210
- if (o && i >= o.length)
211
- o = void 0;
212
- return { value: o && o[i++], done: !o };
213
- }
214
- };
215
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
216
- }
217
- function __read(o, n) {
218
- var m = typeof Symbol === "function" && o[Symbol.iterator];
219
- if (!m)
220
- return o;
221
- var i = m.call(o), r, ar = [], e;
222
- try {
223
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
224
- ar.push(r.value);
225
- }
226
- catch (error) {
227
- e = { error: error };
228
- }
229
- finally {
230
- try {
231
- if (r && !r.done && (m = i["return"]))
232
- m.call(i);
233
- }
234
- finally {
235
- if (e)
236
- throw e.error;
237
- }
238
- }
239
- return ar;
240
- }
241
- /** @deprecated */
242
- function __spread() {
243
- for (var ar = [], i = 0; i < arguments.length; i++)
244
- ar = ar.concat(__read(arguments[i]));
245
- return ar;
246
- }
247
- /** @deprecated */
248
- function __spreadArrays() {
249
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
250
- s += arguments[i].length;
251
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
252
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
253
- r[k] = a[j];
254
- return r;
255
- }
256
- function __spreadArray(to, from) {
257
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
258
- to[j] = from[i];
259
- return to;
260
- }
261
- function __await(v) {
262
- return this instanceof __await ? (this.v = v, this) : new __await(v);
263
- }
264
- function __asyncGenerator(thisArg, _arguments, generator) {
265
- if (!Symbol.asyncIterator)
266
- throw new TypeError("Symbol.asyncIterator is not defined.");
267
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
268
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
269
- function verb(n) { if (g[n])
270
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
271
- function resume(n, v) { try {
272
- step(g[n](v));
273
- }
274
- catch (e) {
275
- settle(q[0][3], e);
276
- } }
277
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
278
- function fulfill(value) { resume("next", value); }
279
- function reject(value) { resume("throw", value); }
280
- function settle(f, v) { if (f(v), q.shift(), q.length)
281
- resume(q[0][0], q[0][1]); }
282
- }
283
- function __asyncDelegator(o) {
284
- var i, p;
285
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
286
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
287
- }
288
- function __asyncValues(o) {
289
- if (!Symbol.asyncIterator)
290
- throw new TypeError("Symbol.asyncIterator is not defined.");
291
- var m = o[Symbol.asyncIterator], i;
292
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
293
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
294
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
295
- }
296
- function __makeTemplateObject(cooked, raw) {
297
- if (Object.defineProperty) {
298
- Object.defineProperty(cooked, "raw", { value: raw });
299
- }
300
- else {
301
- cooked.raw = raw;
302
- }
303
- return cooked;
304
- }
305
- ;
306
- var __setModuleDefault = Object.create ? (function (o, v) {
307
- Object.defineProperty(o, "default", { enumerable: true, value: v });
308
- }) : function (o, v) {
309
- o["default"] = v;
310
- };
311
- function __importStar(mod) {
312
- if (mod && mod.__esModule)
313
- return mod;
314
- var result = {};
315
- if (mod != null)
316
- for (var k in mod)
317
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
318
- __createBinding(result, mod, k);
319
- __setModuleDefault(result, mod);
320
- return result;
321
- }
322
- function __importDefault(mod) {
323
- return (mod && mod.__esModule) ? mod : { default: mod };
324
- }
325
- function __classPrivateFieldGet(receiver, state, kind, f) {
326
- if (kind === "a" && !f)
327
- throw new TypeError("Private accessor was defined without a getter");
328
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
329
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
330
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
331
- }
332
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
333
- if (kind === "m")
334
- throw new TypeError("Private method is not writable");
335
- if (kind === "a" && !f)
336
- throw new TypeError("Private accessor was defined without a setter");
337
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
338
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
339
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
340
- }
341
-
342
- var RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = new i0.InjectionToken('rxap/remote-method/directive/token');
343
-
344
- var RemoteMethodDirective = /** @class */ (function () {
345
- function RemoteMethodDirective(remoteMethodLoader, injector, remoteMethodToken) {
346
- if (injector === void 0) { injector = i0.Injector.NULL; }
347
- this.remoteMethodLoader = remoteMethodLoader;
348
- this.injector = injector;
349
- this.remoteMethodToken = remoteMethodToken;
350
- this.executed$ = new i0.EventEmitter();
351
- this.failure$ = new i0.EventEmitter();
352
- this.successful$ = new i0.EventEmitter();
353
- this.immediately = false;
354
- /**
355
- * true - a remote method call is in progress
356
- */
357
- this.executing$ = new rxjs.ToggleSubject();
358
- this._hasConfirmDirective = false;
359
- if (this.remoteMethodToken) {
360
- this._remoteMethodOrIdOrToken = this.remoteMethodToken;
361
- }
362
- }
363
- Object.defineProperty(RemoteMethodDirective.prototype, "remoteMethodOrIdOrToken", {
364
- set: function (value) {
365
- if (value) {
366
- this._remoteMethodOrIdOrToken = value;
367
- }
368
- },
369
- enumerable: false,
370
- configurable: true
371
- });
372
- Object.defineProperty(RemoteMethodDirective.prototype, "hasConfirmDirective", {
373
- set: function (value) {
374
- this._hasConfirmDirective = utilities.coerceBoolean(value);
375
- },
376
- enumerable: false,
377
- configurable: true
378
- });
379
- RemoteMethodDirective.prototype.ngOnInit = function () {
380
- if (this.immediately) {
381
- this.execute();
382
- }
383
- };
384
- RemoteMethodDirective.prototype.onConfirmed = function () {
385
- this.execute();
386
- };
387
- RemoteMethodDirective.prototype.onClick = function () {
388
- if (!this._hasConfirmDirective) {
389
- this.execute();
390
- }
391
- else {
392
- console.debug('skip remote method call. Wait for confirmation.');
393
- }
394
- };
395
- RemoteMethodDirective.prototype.execute = function () {
396
- return __awaiter(this, void 0, void 0, function () {
397
- var result, error_1;
398
- return __generator(this, function (_b) {
399
- switch (_b.label) {
400
- case 0:
401
- this.executing$.enable();
402
- _b.label = 1;
403
- case 1:
404
- _b.trys.push([1, 3, 4, 5]);
405
- return [4 /*yield*/, this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector)];
406
- case 2:
407
- result = _b.sent();
408
- this.executed(result);
409
- this.successful(result);
410
- return [3 /*break*/, 5];
411
- case 3:
412
- error_1 = _b.sent();
413
- if (i0.isDevMode()) {
414
- console.error("Remote method directive execution failed:", error_1.message);
415
- }
416
- this.failure(error_1);
417
- return [3 /*break*/, 5];
418
- case 4:
419
- this.executing$.disable();
420
- return [7 /*endfinally*/];
421
- case 5: return [2 /*return*/];
422
- }
423
- });
424
- });
425
- };
426
- RemoteMethodDirective.prototype.setParameter = function (parameterKey, value) {
427
- var _b;
428
- this.updateParameters((_b = {}, _b[parameterKey] = value, _b));
429
- };
430
- RemoteMethodDirective.prototype.updateParameters = function (parameters) {
431
- var _a;
432
- this.parameters = Object.assign(Object.assign({}, ((_a = this.parameters) !== null && _a !== void 0 ? _a : {})), parameters);
433
- };
434
- RemoteMethodDirective.prototype.executed = function (result) {
435
- this.executed$.emit(result);
436
- };
437
- RemoteMethodDirective.prototype.failure = function (error) {
438
- this.failure$.emit(error);
439
- };
440
- RemoteMethodDirective.prototype.successful = function (result) {
441
- this.successful$.emit(result);
442
- };
443
- /**
444
- * @deprecated removed
445
- * @protected
446
- */
447
- RemoteMethodDirective.prototype.call = function () {
448
- return __awaiter(this, void 0, void 0, function () {
449
- var result;
450
- return __generator(this, function (_b) {
451
- switch (_b.label) {
452
- case 0:
453
- this.executing$.enable();
454
- return [4 /*yield*/, this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector)];
455
- case 1:
456
- result = _b.sent();
457
- this.executing$.disable();
458
- return [2 /*return*/, result];
459
- }
460
- });
461
- });
462
- };
463
- return RemoteMethodDirective;
464
- }());
465
- RemoteMethodDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirective, deps: [{ token: i1.RemoteMethodLoader }, { token: i0.INJECTOR }, { token: RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
466
- RemoteMethodDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: RemoteMethodDirective, selector: "[rxapRemoteMethod]", inputs: { remoteMethodOrIdOrToken: ["rxapRemoteMethod", "remoteMethodOrIdOrToken"], parameters: "parameters", metadata: "metadata", immediately: "immediately", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"] }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, exportAs: ["rxapRemoteMethod"], ngImport: i0__namespace });
467
- __decorate([
468
- utilities.Required,
469
- __metadata("design:type", Object)
470
- ], RemoteMethodDirective.prototype, "_remoteMethodOrIdOrToken", void 0);
471
- __decorate([
472
- utilities.Deprecated('removed'),
473
- __metadata("design:type", Function),
474
- __metadata("design:paramtypes", []),
475
- __metadata("design:returntype", Promise)
476
- ], RemoteMethodDirective.prototype, "call", null);
477
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirective, decorators: [{
478
- type: i0.Directive,
479
- args: [{
480
- selector: '[rxapRemoteMethod]',
481
- exportAs: 'rxapRemoteMethod'
482
- }]
483
- }], ctorParameters: function () {
484
- return [{ type: i1__namespace.RemoteMethodLoader, decorators: [{
485
- type: i0.Inject,
486
- args: [i1.RemoteMethodLoader]
487
- }] }, { type: i0__namespace.Injector, decorators: [{
488
- type: i0.Inject,
489
- args: [i0.INJECTOR]
490
- }] }, { type: undefined, decorators: [{
491
- type: i0.Optional
492
- }, {
493
- type: i0.Self
494
- }, {
495
- type: i0.Inject,
496
- args: [RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN]
497
- }] }];
498
- }, propDecorators: { remoteMethodOrIdOrToken: [{
499
- type: i0.Input,
500
- args: ['rxapRemoteMethod']
501
- }], parameters: [{
502
- type: i0.Input
503
- }], metadata: [{
504
- type: i0.Input
505
- }], executed$: [{
506
- type: i0.Output,
507
- args: ['executed']
508
- }], failure$: [{
509
- type: i0.Output,
510
- args: ['failure']
511
- }], successful$: [{
512
- type: i0.Output,
513
- args: ['successful']
514
- }], immediately: [{
515
- type: i0.Input
516
- }], hasConfirmDirective: [{
517
- type: i0.Input,
518
- args: ['rxapConfirm']
519
- }], _remoteMethodOrIdOrToken: [], onConfirmed: [{
520
- type: i0.HostListener,
521
- args: ['confirmed']
522
- }], onClick: [{
523
- type: i0.HostListener,
524
- args: ['click']
525
- }], call: [] } });
526
- var RemoteMethodDirectiveModule = /** @class */ (function () {
527
- function RemoteMethodDirectiveModule() {
528
- }
529
- return RemoteMethodDirectiveModule;
530
- }());
531
- RemoteMethodDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
532
- RemoteMethodDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirectiveModule, declarations: [RemoteMethodDirective], exports: [RemoteMethodDirective] });
533
- RemoteMethodDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirectiveModule });
534
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodDirectiveModule, decorators: [{
535
- type: i0.NgModule,
536
- args: [{
537
- declarations: [RemoteMethodDirective],
538
- exports: [RemoteMethodDirective]
539
- }]
540
- }] });
541
-
542
- var RemoteMethodTemplateCollectionDirectiveContext = /** @class */ (function () {
543
- function RemoteMethodTemplateCollectionDirectiveContext($implicit, index, count) {
544
- this.$implicit = $implicit;
545
- this.index = index;
546
- this.count = count;
547
- }
548
- Object.defineProperty(RemoteMethodTemplateCollectionDirectiveContext.prototype, "first", {
549
- get: function () {
550
- return this.index === 0;
551
- },
552
- enumerable: false,
553
- configurable: true
554
- });
555
- Object.defineProperty(RemoteMethodTemplateCollectionDirectiveContext.prototype, "last", {
556
- get: function () {
557
- return this.index === this.count - 1;
558
- },
559
- enumerable: false,
560
- configurable: true
561
- });
562
- Object.defineProperty(RemoteMethodTemplateCollectionDirectiveContext.prototype, "even", {
563
- get: function () {
564
- return this.index % 2 === 0;
565
- },
566
- enumerable: false,
567
- configurable: true
568
- });
569
- Object.defineProperty(RemoteMethodTemplateCollectionDirectiveContext.prototype, "odd", {
570
- get: function () {
571
- return !this.even;
572
- },
573
- enumerable: false,
574
- configurable: true
575
- });
576
- return RemoteMethodTemplateCollectionDirectiveContext;
577
- }());
578
- function getTypeName(type) {
579
- return type['name'] || typeof type;
580
- }
581
- var RecordViewTuple = /** @class */ (function () {
582
- function RecordViewTuple(record, view) {
583
- this.record = record;
584
- this.view = view;
585
- }
586
- return RecordViewTuple;
587
- }());
588
- var RemoteMethodTemplateCollectionDirective = /** @class */ (function () {
589
- function RemoteMethodTemplateCollectionDirective(template, remoteMethodLoader, injector, viewContainerRef, cdr, differs, zone, remoteMethodToken) {
590
- this.template = template;
591
- this.remoteMethodLoader = remoteMethodLoader;
592
- this.injector = injector;
593
- this.viewContainerRef = viewContainerRef;
594
- this.cdr = cdr;
595
- this.differs = differs;
596
- this.zone = zone;
597
- this.remoteMethodToken = remoteMethodToken;
598
- this.withoutParameters = false;
599
- this._differ = null;
600
- /**
601
- * Holds the data that should be displayed
602
- * @private
603
- */
604
- this._data = null;
605
- this._dirty = true;
606
- /**
607
- * Indicates that the remote method returned a empty collection
608
- *
609
- * true - is empty
610
- * false - is NOT empty
611
- * null - unknown
612
- *
613
- * @private
614
- */
615
- this._empty = null;
616
- /**
617
- * Holds the error that call of the remote method throws
618
- *
619
- * @private
620
- */
621
- this._error = null;
622
- /**
623
- * Holds the empty template view ref.
624
- *
625
- * Is used to determine if a empty template is added to the
626
- * view. And used to destruct the empty template if the remote method
627
- * changes from empty to not empty.
628
- *
629
- * @private
630
- */
631
- this._emptyTemplateViewRef = null;
632
- /**
633
- * Holds the error template view ref.
634
- *
635
- * Is used to determine if a error template is added to the
636
- * view. And used to destruct the error template if the remote method
637
- * is called again with an error.
638
- *
639
- * @private
640
- */
641
- this._errorTemplateViewRef = null;
642
- if (this.remoteMethodToken) {
643
- this._remoteMethodOrIdOrToken = this.remoteMethodToken;
644
- }
645
- }
646
- /**
647
- * Asserts the correct type of the context for the template that `NgForOf` will render.
648
- *
649
- * The presence of this method is a signal to the Ivy template type-check compiler that the
650
- * `NgForOf` structural directive renders its template with a specific context type.
651
- */
652
- RemoteMethodTemplateCollectionDirective.ngTemplateContextGuard = function (dir, ctx) {
653
- return true;
654
- };
655
- Object.defineProperty(RemoteMethodTemplateCollectionDirective.prototype, "remoteMethodOrIdOrToken", {
656
- set: function (value) {
657
- if (value) {
658
- this._remoteMethodOrIdOrToken = value;
659
- }
660
- },
661
- enumerable: false,
662
- configurable: true
663
- });
664
- Object.defineProperty(RemoteMethodTemplateCollectionDirective.prototype, "trackBy", {
665
- get: function () {
666
- return this._trackByFn;
667
- },
668
- /**
669
- * A function that defines how to track changes for items in the iterable.
670
- *
671
- * When items are added, moved, or removed in the iterable,
672
- * the directive must re-render the appropriate DOM nodes.
673
- * To minimize churn in the DOM, only nodes that have changed
674
- * are re-rendered.
675
- *
676
- * By default, the change detector assumes that
677
- * the object instance identifies the node in the iterable.
678
- * When this function is supplied, the directive uses
679
- * the result of calling this function to identify the item node,
680
- * rather than the identity of the object itself.
681
- *
682
- * The function receives two inputs,
683
- * the iteration index and the node object ID.
684
- */
685
- set: function (fn) {
686
- if (i0.isDevMode() && fn != null && typeof fn !== 'function') {
687
- // TODO(vicb): use a log service once there is a public one available
688
- if (console && console.warn) {
689
- console.warn("trackBy must be a function, but received " + JSON.stringify(fn) + ". " +
690
- "See https://angular.io/api/common/NgForOf#change-propagation for more information.");
691
- }
692
- }
693
- this._trackByFn = fn;
694
- },
695
- enumerable: false,
696
- configurable: true
697
- });
698
- Object.defineProperty(RemoteMethodTemplateCollectionDirective.prototype, "data", {
699
- set: function (data) {
700
- this._data = data;
701
- this._dirty = true;
702
- },
703
- enumerable: false,
704
- configurable: true
705
- });
706
- RemoteMethodTemplateCollectionDirective.prototype.ngOnChanges = function (changes) {
707
- var parametersChanges = changes.parameters;
708
- if (parametersChanges) {
709
- this.call(parametersChanges.currentValue);
710
- }
711
- };
712
- RemoteMethodTemplateCollectionDirective.prototype.ngOnInit = function () {
713
- if (this.withoutParameters) {
714
- this.call();
715
- }
716
- };
717
- RemoteMethodTemplateCollectionDirective.prototype.call = function (parameters) {
718
- var _this = this;
719
- this.zone.onStable.pipe(operators.take(1), operators.tap(function () {
720
- _this.zone.run(function () {
721
- _this.remoteMethodLoader
722
- .call$(_this._remoteMethodOrIdOrToken, parameters, undefined, _this.injector)
723
- .then(function (response) {
724
- _this._empty = response.length === 0;
725
- _this._data = response;
726
- _this.cdr.detectChanges();
727
- })
728
- .catch(function (error) {
729
- _this._error = error;
730
- _this.cdr.detectChanges();
731
- });
732
- });
733
- })).subscribe();
734
- };
735
- RemoteMethodTemplateCollectionDirective.prototype.applyChanges = function (changes) {
736
- var _this = this;
737
- var insertTuples = [];
738
- changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
739
- if (item.previousIndex == null) {
740
- // NgForOf is never "null" or "undefined" here because the differ detected
741
- // that a new item needs to be inserted from the iterable. This implies that
742
- // there is an iterable value for "_ngForOf".
743
- var view = _this.viewContainerRef.createEmbeddedView(_this.template, new RemoteMethodTemplateCollectionDirectiveContext(null, -1, -1), currentIndex === null ? undefined : currentIndex);
744
- var tuple = new RecordViewTuple(item, view);
745
- insertTuples.push(tuple);
746
- }
747
- else if (currentIndex == null) {
748
- _this.viewContainerRef.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
749
- }
750
- else if (adjustedPreviousIndex !== null) {
751
- var view = _this.viewContainerRef.get(adjustedPreviousIndex);
752
- _this.viewContainerRef.move(view, currentIndex);
753
- var tuple = new RecordViewTuple(item, view);
754
- insertTuples.push(tuple);
755
- }
756
- });
757
- for (var i = 0; i < insertTuples.length; i++) {
758
- this.perViewChange(insertTuples[i].view, insertTuples[i].record);
759
- }
760
- for (var i = 0, ilen = this.viewContainerRef.length; i < ilen; i++) {
761
- var viewRef = this.viewContainerRef.get(i);
762
- viewRef.context.index = i;
763
- viewRef.context.count = ilen;
764
- }
765
- changes.forEachIdentityChange(function (record) {
766
- var viewRef = _this.viewContainerRef.get(record.currentIndex);
767
- viewRef.context.$implicit = record.item;
768
- });
769
- };
770
- RemoteMethodTemplateCollectionDirective.prototype.perViewChange = function (view, record) {
771
- view.context.$implicit = record.item;
772
- };
773
- /**
774
- * Applies the changes when needed.
775
- */
776
- RemoteMethodTemplateCollectionDirective.prototype.ngDoCheck = function () {
777
- if (this._error !== null) {
778
- this.viewContainerRef.clear();
779
- this._differ = null;
780
- if (this.errorTemplate) {
781
- this._errorTemplateViewRef = this.viewContainerRef.createEmbeddedView(this.errorTemplate, { $implicit: this._error, message: this._error.message, name: this._error.name });
782
- }
783
- }
784
- else if (this._empty === true) {
785
- this.viewContainerRef.clear();
786
- this._differ = null;
787
- // attaches the empty template if the data source is empty
788
- if (this.emptyTemplate) {
789
- this._emptyTemplateViewRef = this.viewContainerRef.createEmbeddedView(this.emptyTemplate);
790
- }
791
- }
792
- else if (this._empty === false) {
793
- // detach and destroy the empty template if the data source is not
794
- // empty any more
795
- if (this._emptyTemplateViewRef) {
796
- this._emptyTemplateViewRef.detach();
797
- this._emptyTemplateViewRef.destroy();
798
- this._errorTemplateViewRef = null;
799
- }
800
- if (this._errorTemplateViewRef) {
801
- this._errorTemplateViewRef.detach();
802
- this._errorTemplateViewRef.destroy();
803
- this._errorTemplateViewRef = null;
804
- }
805
- if (this._data) {
806
- this._dirty = false;
807
- // React on ngForOf changes only once all inputs have been initialized
808
- var value = this._data;
809
- if (!this._differ && value) {
810
- try {
811
- this._differ = this.differs.find(value).create(this.trackBy);
812
- }
813
- catch (_a) {
814
- throw new Error("Cannot find a differ supporting object '" + value + "' of type '" + getTypeName(value) + "'. NgFor only supports binding to Iterables such as Arrays.");
815
- }
816
- }
817
- }
818
- if (this._differ) {
819
- var changes = this._differ.diff(this._data);
820
- if (changes) {
821
- this.applyChanges(changes);
822
- }
823
- }
824
- }
825
- };
826
- return RemoteMethodTemplateCollectionDirective;
827
- }());
828
- RemoteMethodTemplateCollectionDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirective, deps: [{ token: i0.TemplateRef }, { token: i1.RemoteMethodLoader }, { token: i0.INJECTOR }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }, { token: i0.NgZone }, { token: RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
829
- RemoteMethodTemplateCollectionDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: RemoteMethodTemplateCollectionDirective, selector: "[rxapRemoteMethodCollection]", inputs: { remoteMethodOrIdOrToken: ["rxapRemoteMethodCollectionCall", "remoteMethodOrIdOrToken"], trackBy: ["rxapRemoteMethodCollectionTrackBy", "trackBy"], parameters: ["rxapRemoteMethodCollectionParameters", "parameters"], emptyTemplate: ["rxapRemoteMethodCollectionEmpty", "emptyTemplate"], errorTemplate: ["rxapRemoteMethodCollectionError", "errorTemplate"], withoutParameters: ["rxapRemoteMethodCollectionWithoutParameters", "withoutParameters"] }, exportAs: ["rxapRemoteMethodCollection"], usesOnChanges: true, ngImport: i0__namespace });
830
- __decorate([
831
- utilities.Required,
832
- __metadata("design:type", Object)
833
- ], RemoteMethodTemplateCollectionDirective.prototype, "_remoteMethodOrIdOrToken", void 0);
834
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirective, decorators: [{
835
- type: i0.Directive,
836
- args: [{
837
- selector: '[rxapRemoteMethodCollection]',
838
- exportAs: 'rxapRemoteMethodCollection'
839
- }]
840
- }], ctorParameters: function () {
841
- return [{ type: i0__namespace.TemplateRef, decorators: [{
842
- type: i0.Inject,
843
- args: [i0.TemplateRef]
844
- }] }, { type: i1__namespace.RemoteMethodLoader, decorators: [{
845
- type: i0.Inject,
846
- args: [i1.RemoteMethodLoader]
847
- }] }, { type: i0__namespace.Injector, decorators: [{
848
- type: i0.Inject,
849
- args: [i0.INJECTOR]
850
- }] }, { type: i0__namespace.ViewContainerRef, decorators: [{
851
- type: i0.Inject,
852
- args: [i0.ViewContainerRef]
853
- }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
854
- type: i0.Inject,
855
- args: [i0.ChangeDetectorRef]
856
- }] }, { type: i0__namespace.IterableDiffers, decorators: [{
857
- type: i0.Inject,
858
- args: [i0.IterableDiffers]
859
- }] }, { type: i0__namespace.NgZone, decorators: [{
860
- type: i0.Inject,
861
- args: [i0.NgZone]
862
- }] }, { type: undefined, decorators: [{
863
- type: i0.Optional
864
- }, {
865
- type: i0.Self
866
- }, {
867
- type: i0.Inject,
868
- args: [RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN]
869
- }] }];
870
- }, propDecorators: { remoteMethodOrIdOrToken: [{
871
- type: i0.Input,
872
- args: ['rxapRemoteMethodCollectionCall']
873
- }], trackBy: [{
874
- type: i0.Input,
875
- args: ['rxapRemoteMethodCollectionTrackBy']
876
- }], parameters: [{
877
- type: i0.Input,
878
- args: ['rxapRemoteMethodCollectionParameters']
879
- }], emptyTemplate: [{
880
- type: i0.Input,
881
- args: ['rxapRemoteMethodCollectionEmpty']
882
- }], errorTemplate: [{
883
- type: i0.Input,
884
- args: ['rxapRemoteMethodCollectionError']
885
- }], withoutParameters: [{
886
- type: i0.Input,
887
- args: ['rxapRemoteMethodCollectionWithoutParameters']
888
- }], _remoteMethodOrIdOrToken: [] } });
889
- var RemoteMethodTemplateCollectionDirectiveModule = /** @class */ (function () {
890
- function RemoteMethodTemplateCollectionDirectiveModule() {
891
- }
892
- return RemoteMethodTemplateCollectionDirectiveModule;
893
- }());
894
- RemoteMethodTemplateCollectionDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
895
- RemoteMethodTemplateCollectionDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirectiveModule, declarations: [RemoteMethodTemplateCollectionDirective], exports: [RemoteMethodTemplateCollectionDirective] });
896
- RemoteMethodTemplateCollectionDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirectiveModule });
897
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateCollectionDirectiveModule, decorators: [{
898
- type: i0.NgModule,
899
- args: [{
900
- declarations: [RemoteMethodTemplateCollectionDirective],
901
- exports: [RemoteMethodTemplateCollectionDirective]
902
- }]
903
- }] });
904
-
905
- var RemoteMethodTemplateDirective = /** @class */ (function () {
906
- function RemoteMethodTemplateDirective(template, remoteMethodLoader, injector, viewContainerRef, cdr, remoteMethodToken) {
907
- this.template = template;
908
- this.remoteMethodLoader = remoteMethodLoader;
909
- this.injector = injector;
910
- this.viewContainerRef = viewContainerRef;
911
- this.cdr = cdr;
912
- this.remoteMethodToken = remoteMethodToken;
913
- this.executed$ = new i0.EventEmitter();
914
- this.failure$ = new i0.EventEmitter();
915
- this.successful$ = new i0.EventEmitter();
916
- /**
917
- * true - a remote method call is in progress
918
- */
919
- this.executing$ = new rxjs.ToggleSubject();
920
- this.withoutParameters = false;
921
- this.embedded = new i0.EventEmitter();
922
- if (this.remoteMethodToken) {
923
- this._remoteMethodOrIdOrToken = this.remoteMethodToken;
924
- }
925
- }
926
- // TODO : remove template context Guard
927
- // the template context Guard must be defined with a concrete context type
928
- // else the context guard is resolved to any
929
- // For each child directive that should have a template context guard
930
- // the template context guard must be defined
931
- // !! add generation of concrete template context guard to openapi schematics !!
932
- RemoteMethodTemplateDirective.ngTemplateContextGuard = function (dir, ctx) {
933
- return true;
934
- };
935
- Object.defineProperty(RemoteMethodTemplateDirective.prototype, "remoteMethodOrIdOrToken", {
936
- set: function (value) {
937
- if (value) {
938
- this._remoteMethodOrIdOrToken = value;
939
- }
940
- },
941
- enumerable: false,
942
- configurable: true
943
- });
944
- RemoteMethodTemplateDirective.prototype.ngOnChanges = function (changes) {
945
- var parametersChanges = changes.parameters;
946
- if (parametersChanges) {
947
- this.execute(parametersChanges.currentValue);
948
- }
949
- };
950
- RemoteMethodTemplateDirective.prototype.ngOnInit = function () {
951
- this.renderLoadingTemplate();
952
- if (this.withoutParameters) {
953
- this.execute();
954
- }
955
- };
956
- RemoteMethodTemplateDirective.prototype.execute = function (parameters) {
957
- if (parameters === void 0) { parameters = this.parameters; }
958
- return __awaiter(this, void 0, void 0, function () {
959
- var result, error_1;
960
- return __generator(this, function (_b) {
961
- switch (_b.label) {
962
- case 0:
963
- this.executing$.enable();
964
- this.renderLoadingTemplate();
965
- _b.label = 1;
966
- case 1:
967
- _b.trys.push([1, 3, 4, 5]);
968
- return [4 /*yield*/, this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, parameters, this.metadata, this.injector)];
969
- case 2:
970
- result = _b.sent();
971
- this.executed(result);
972
- this.renderTemplate(result);
973
- this.successful(result);
974
- return [3 /*break*/, 5];
975
- case 3:
976
- error_1 = _b.sent();
977
- if (i0.isDevMode()) {
978
- console.error("Remote method directive execution failed:", error_1.message);
979
- }
980
- this.failure(error_1);
981
- return [3 /*break*/, 5];
982
- case 4:
983
- this.executing$.disable();
984
- return [7 /*endfinally*/];
985
- case 5: return [2 /*return*/];
986
- }
987
- });
988
- });
989
- };
990
- /**
991
- * @deprecated removed
992
- * @protected
993
- */
994
- RemoteMethodTemplateDirective.prototype.call = function (parameters) {
995
- this.execute(parameters)
996
- .catch(function (error) { return console.error('Remote method template rendering failed: ' + error.message); });
997
- };
998
- RemoteMethodTemplateDirective.prototype.setParameter = function (parameterKey, value) {
999
- var _b;
1000
- this.updateParameters((_b = {}, _b[parameterKey] = value, _b));
1001
- };
1002
- RemoteMethodTemplateDirective.prototype.updateParameters = function (parameters) {
1003
- var _a;
1004
- this.parameters = Object.assign(Object.assign({}, ((_a = this.parameters) !== null && _a !== void 0 ? _a : {})), parameters);
1005
- };
1006
- RemoteMethodTemplateDirective.prototype.renderLoadingTemplate = function () {
1007
- if (this.loadingTemplate) {
1008
- this.viewContainerRef.clear();
1009
- this.viewContainerRef.createEmbeddedView(this.loadingTemplate);
1010
- }
1011
- };
1012
- RemoteMethodTemplateDirective.prototype.executed = function (result) {
1013
- this.executed$.emit(result);
1014
- };
1015
- RemoteMethodTemplateDirective.prototype.failure = function (error) {
1016
- this.failure$.emit(error);
1017
- };
1018
- RemoteMethodTemplateDirective.prototype.successful = function (result) {
1019
- this.successful$.emit(result);
1020
- };
1021
- RemoteMethodTemplateDirective.prototype.renderTemplate = function (result) {
1022
- this.viewContainerRef.clear();
1023
- try {
1024
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });
1025
- }
1026
- catch (error) {
1027
- if (this.errorTemplate) {
1028
- this.viewContainerRef.createEmbeddedView(this.errorTemplate, { $implicit: error, message: error.message });
1029
- }
1030
- console.error(error.message);
1031
- }
1032
- this.embedded.emit();
1033
- this.cdr.detectChanges();
1034
- };
1035
- return RemoteMethodTemplateDirective;
1036
- }());
1037
- RemoteMethodTemplateDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: i1.RemoteMethodLoader }, { token: i0.INJECTOR }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1038
- RemoteMethodTemplateDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: RemoteMethodTemplateDirective, selector: "[rxapRemoteMethod]", inputs: { remoteMethodOrIdOrToken: ["rxapRemoteMethodCall", "remoteMethodOrIdOrToken"], metadata: ["rxapRemoteMethodMetadata", "metadata"], parameters: ["rxapRemoteMethodParameters", "parameters"], errorTemplate: ["rxapRemoteMethodError", "errorTemplate"], loadingTemplate: ["rxapRemoteMethodLoading", "loadingTemplate"], withoutParameters: ["rxapRemoteMethodWithoutParameters", "withoutParameters"] }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful", embedded: "embedded" }, exportAs: ["rxapRemoteMethod"], usesOnChanges: true, ngImport: i0__namespace });
1039
- __decorate([
1040
- utilities.Required,
1041
- __metadata("design:type", Object)
1042
- ], RemoteMethodTemplateDirective.prototype, "_remoteMethodOrIdOrToken", void 0);
1043
- __decorate([
1044
- utilities.Deprecated('removed'),
1045
- __metadata("design:type", Function),
1046
- __metadata("design:paramtypes", [Object]),
1047
- __metadata("design:returntype", void 0)
1048
- ], RemoteMethodTemplateDirective.prototype, "call", null);
1049
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirective, decorators: [{
1050
- type: i0.Directive,
1051
- args: [{
1052
- selector: '[rxapRemoteMethod]',
1053
- exportAs: 'rxapRemoteMethod'
1054
- }]
1055
- }], ctorParameters: function () {
1056
- return [{ type: i0__namespace.TemplateRef, decorators: [{
1057
- type: i0.Inject,
1058
- args: [i0.TemplateRef]
1059
- }] }, { type: i1__namespace.RemoteMethodLoader, decorators: [{
1060
- type: i0.Inject,
1061
- args: [i1.RemoteMethodLoader]
1062
- }] }, { type: i0__namespace.Injector, decorators: [{
1063
- type: i0.Inject,
1064
- args: [i0.INJECTOR]
1065
- }] }, { type: i0__namespace.ViewContainerRef, decorators: [{
1066
- type: i0.Inject,
1067
- args: [i0.ViewContainerRef]
1068
- }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
1069
- type: i0.Inject,
1070
- args: [i0.ChangeDetectorRef]
1071
- }] }, { type: undefined, decorators: [{
1072
- type: i0.Optional
1073
- }, {
1074
- type: i0.Self
1075
- }, {
1076
- type: i0.Inject,
1077
- args: [RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN]
1078
- }] }];
1079
- }, propDecorators: { remoteMethodOrIdOrToken: [{
1080
- type: i0.Input,
1081
- args: ['rxapRemoteMethodCall']
1082
- }], executed$: [{
1083
- type: i0.Output,
1084
- args: ['executed']
1085
- }], failure$: [{
1086
- type: i0.Output,
1087
- args: ['failure']
1088
- }], successful$: [{
1089
- type: i0.Output,
1090
- args: ['successful']
1091
- }], metadata: [{
1092
- type: i0.Input,
1093
- args: ['rxapRemoteMethodMetadata']
1094
- }], parameters: [{
1095
- type: i0.Input,
1096
- args: ['rxapRemoteMethodParameters']
1097
- }], errorTemplate: [{
1098
- type: i0.Input,
1099
- args: ['rxapRemoteMethodError']
1100
- }], loadingTemplate: [{
1101
- type: i0.Input,
1102
- args: ['rxapRemoteMethodLoading']
1103
- }], withoutParameters: [{
1104
- type: i0.Input,
1105
- args: ['rxapRemoteMethodWithoutParameters']
1106
- }], _remoteMethodOrIdOrToken: [], embedded: [{
1107
- type: i0.Output
1108
- }], call: [] } });
1109
- var RemoteMethodTemplateDirectiveModule = /** @class */ (function () {
1110
- function RemoteMethodTemplateDirectiveModule() {
1111
- }
1112
- return RemoteMethodTemplateDirectiveModule;
1113
- }());
1114
- RemoteMethodTemplateDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1115
- RemoteMethodTemplateDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirectiveModule, declarations: [RemoteMethodTemplateDirective], exports: [RemoteMethodTemplateDirective] });
1116
- RemoteMethodTemplateDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirectiveModule });
1117
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: RemoteMethodTemplateDirectiveModule, decorators: [{
1118
- type: i0.NgModule,
1119
- args: [{
1120
- declarations: [RemoteMethodTemplateDirective],
1121
- exports: [RemoteMethodTemplateDirective]
1122
- }]
1123
- }] });
1124
-
1125
- var RxapRemoteMethodDirectiveError = /** @class */ (function (_super) {
1126
- __extends(RxapRemoteMethodDirectiveError, _super);
1127
- function RxapRemoteMethodDirectiveError(message, code, scope) {
1128
- return _super.call(this, message, code !== null && code !== void 0 ? code : '', scope) || this;
1129
- }
1130
- return RxapRemoteMethodDirectiveError;
1131
- }(i1.RxapRemoteMethodError));
1132
-
1133
- /**
1134
- * Generated bundle index. Do not edit.
1135
- */
1136
-
1137
- exports.RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN;
1138
- exports.RemoteMethodDirective = RemoteMethodDirective;
1139
- exports.RemoteMethodDirectiveModule = RemoteMethodDirectiveModule;
1140
- exports.RemoteMethodTemplateCollectionDirective = RemoteMethodTemplateCollectionDirective;
1141
- exports.RemoteMethodTemplateCollectionDirectiveContext = RemoteMethodTemplateCollectionDirectiveContext;
1142
- exports.RemoteMethodTemplateCollectionDirectiveModule = RemoteMethodTemplateCollectionDirectiveModule;
1143
- exports.RemoteMethodTemplateDirective = RemoteMethodTemplateDirective;
1144
- exports.RemoteMethodTemplateDirectiveModule = RemoteMethodTemplateDirectiveModule;
1145
- exports.RxapRemoteMethodDirectiveError = RxapRemoteMethodDirectiveError;
1146
-
1147
- Object.defineProperty(exports, '__esModule', { value: true });
1148
-
1149
- })));
1150
- //# sourceMappingURL=rxap-remote-method-directive.umd.js.map