@rxap/form-window-system 12.1.8 → 13.0.0-next.2

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/esm2020/index.mjs +7 -0
  2. package/esm2020/lib/form-window-footer.directive.mjs +64 -0
  3. package/esm2020/lib/form-window-ref.mjs +27 -0
  4. package/esm2020/lib/form-window.service.mjs +118 -0
  5. package/esm2020/lib/open-form-window-method.directive.mjs +114 -0
  6. package/esm2020/lib/open-form-window.method.mjs +50 -0
  7. package/esm2020/lib/open-form.directive.mjs +130 -0
  8. package/esm2020/rxap-form-window-system.mjs +5 -0
  9. package/fesm2015/rxap-form-window-system.mjs +496 -0
  10. package/fesm2015/rxap-form-window-system.mjs.map +1 -0
  11. package/{fesm2015/rxap-form-window-system.js → fesm2020/rxap-form-window-system.mjs} +44 -42
  12. package/fesm2020/rxap-form-window-system.mjs.map +1 -0
  13. package/package.json +47 -31
  14. package/src/schematics/ng-add/index.js +1 -1
  15. package/src/schematics/ng-add/index.js.map +1 -1
  16. package/bundles/rxap-form-window-system.umd.js +0 -868
  17. package/bundles/rxap-form-window-system.umd.js.map +0 -1
  18. package/esm2015/index.js +0 -7
  19. package/esm2015/index.js.map +0 -1
  20. package/esm2015/lib/form-window-footer.directive.js +0 -64
  21. package/esm2015/lib/form-window-footer.directive.js.map +0 -1
  22. package/esm2015/lib/form-window-ref.js +0 -27
  23. package/esm2015/lib/form-window-ref.js.map +0 -1
  24. package/esm2015/lib/form-window.service.js +0 -119
  25. package/esm2015/lib/form-window.service.js.map +0 -1
  26. package/esm2015/lib/open-form-window-method.directive.js +0 -114
  27. package/esm2015/lib/open-form-window-method.directive.js.map +0 -1
  28. package/esm2015/lib/open-form-window.method.js +0 -45
  29. package/esm2015/lib/open-form-window.method.js.map +0 -1
  30. package/esm2015/lib/open-form.directive.js +0 -132
  31. package/esm2015/lib/open-form.directive.js.map +0 -1
  32. package/esm2015/rxap-form-window-system.js +0 -5
  33. package/esm2015/rxap-form-window-system.js.map +0 -1
  34. package/fesm2015/rxap-form-window-system.js.map +0 -1
@@ -1,868 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@rxap/window-system'), require('@rxap/forms'), require('@rxap/utilities'), require('@rxap/form-system'), require('@rxap/utilities/reflect-metadata'), require('@rxap/directives'), require('@angular/cdk/portal'), require('@rxap/utilities/rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/form-window-system', ['exports', '@angular/core', '@rxap/window-system', '@rxap/forms', '@rxap/utilities', '@rxap/form-system', '@rxap/utilities/reflect-metadata', '@rxap/directives', '@angular/cdk/portal', '@rxap/utilities/rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap['form-window-system'] = {}), global.ng.core, global.i1$1, global.i1, global.utilities, global.formSystem, global.reflectMetadata, global.directives, global.ng.cdk.portal, global.rxjs));
5
- }(this, (function (exports, i0, i1$1, i1, utilities, formSystem, reflectMetadata, directives, portal, rxjs) { '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$1);
29
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1);
30
-
31
- var FormWindowService = /** @class */ (function () {
32
- function FormWindowService(windowService, injector) {
33
- this.windowService = windowService;
34
- this.injector = injector;
35
- }
36
- FormWindowService.prototype.open = function (formDefinitionConstructor, options) {
37
- var _a, _b, _c, _d, _e;
38
- function FormDefinitionFactory(formBuilder, initial) {
39
- return formBuilder.build(initial);
40
- }
41
- function FormDefinitionBuilderFactory(_injector) {
42
- return new i1.RxapFormBuilder(formDefinitionConstructor, _injector);
43
- }
44
- var providers = (_a = options === null || options === void 0 ? void 0 : options.providers) !== null && _a !== void 0 ? _a : [];
45
- if (((_b = options === null || options === void 0 ? void 0 : options.injector) !== null && _b !== void 0 ? _b : this.injector).get(formDefinitionConstructor, null, i0.InjectFlags.Optional)) {
46
- providers.push({
47
- provide: i1.RXAP_FORM_DEFINITION_BUILDER,
48
- useFactory: FormDefinitionBuilderFactory,
49
- deps: [i0.INJECTOR]
50
- }, {
51
- provide: i1.RXAP_FORM_DEFINITION,
52
- useFactory: FormDefinitionFactory,
53
- deps: [
54
- i1.RXAP_FORM_DEFINITION_BUILDER,
55
- [new i0.Optional(), i1.RXAP_FORM_INITIAL_STATE]
56
- ]
57
- });
58
- }
59
- if (options) {
60
- if (options.initial) {
61
- providers.push({
62
- provide: i1.RXAP_FORM_INITIAL_STATE,
63
- useValue: options.initial
64
- });
65
- }
66
- if (options.submitMethod) {
67
- providers.push({
68
- provide: i1.RXAP_FORM_SUBMIT_METHOD,
69
- useValue: options.submitMethod,
70
- });
71
- }
72
- if (options.submitSuccessfulMethod) {
73
- providers.push({
74
- provide: i1.RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD,
75
- useValue: options.submitSuccessfulMethod,
76
- });
77
- }
78
- if (options.resetSubmit) {
79
- providers.push({
80
- provide: i1.RXAP_FORM_SUBMIT_METHOD,
81
- useValue: null,
82
- });
83
- }
84
- if (options.resetLoad && !options.loadMethod) {
85
- providers.push({
86
- provide: i1.RXAP_FORM_LOAD_METHOD,
87
- useValue: null,
88
- });
89
- }
90
- if (options.loadMethod) {
91
- providers.push({
92
- provide: i1.RXAP_FORM_LOAD_METHOD,
93
- useValue: options.loadMethod,
94
- });
95
- }
96
- if (options.context) {
97
- providers.push({
98
- provide: i1.RXAP_FORM_CONTEXT,
99
- useValue: options.context,
100
- });
101
- }
102
- }
103
- var injector = i0.Injector.create({
104
- parent: (_c = options === null || options === void 0 ? void 0 : options.injector) !== null && _c !== void 0 ? _c : this.injector,
105
- providers: providers,
106
- name: (_d = options === null || options === void 0 ? void 0 : options.injectorName) !== null && _d !== void 0 ? _d : 'FormWindowService',
107
- });
108
- var component = (_e = options === null || options === void 0 ? void 0 : options.component) !== null && _e !== void 0 ? _e : this.extractFormComponent(formDefinitionConstructor);
109
- var windowConfig = {
110
- component: component,
111
- injector: injector,
112
- };
113
- if (options) {
114
- windowConfig = Object.assign(utilities.DeleteUndefinedProperties(options), windowConfig);
115
- }
116
- return this.windowService.open(windowConfig);
117
- };
118
- FormWindowService.prototype.extractFormComponent = function (formDefinitionConstructor) {
119
- var _a;
120
- var component = (_a = reflectMetadata.getMetadata(formSystem.FormSystemMetadataKeys.FORM_COMPONENT, formDefinitionConstructor)) !== null && _a !== void 0 ? _a : null;
121
- if (!component) {
122
- throw new Error('Could not extract form component constructor');
123
- }
124
- return component;
125
- };
126
- return FormWindowService;
127
- }());
128
- FormWindowService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowService, deps: [{ token: i1$1.WindowService }, { token: i0.INJECTOR }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
129
- FormWindowService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowService, providedIn: 'root' });
130
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowService, decorators: [{
131
- type: i0.Injectable,
132
- args: [{
133
- providedIn: 'root',
134
- }]
135
- }], ctorParameters: function () {
136
- return [{ type: i1__namespace.WindowService, decorators: [{
137
- type: i0.Inject,
138
- args: [i1$1.WindowService]
139
- }] }, { type: i0__namespace.Injector, decorators: [{
140
- type: i0.Inject,
141
- args: [i0.INJECTOR]
142
- }] }];
143
- } });
144
-
145
- /*! *****************************************************************************
146
- Copyright (c) Microsoft Corporation.
147
-
148
- Permission to use, copy, modify, and/or distribute this software for any
149
- purpose with or without fee is hereby granted.
150
-
151
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
152
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
153
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
154
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
155
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
156
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
157
- PERFORMANCE OF THIS SOFTWARE.
158
- ***************************************************************************** */
159
- /* global Reflect, Promise */
160
- var extendStatics = function (d, b) {
161
- extendStatics = Object.setPrototypeOf ||
162
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
163
- function (d, b) { for (var p in b)
164
- if (Object.prototype.hasOwnProperty.call(b, p))
165
- d[p] = b[p]; };
166
- return extendStatics(d, b);
167
- };
168
- function __extends(d, b) {
169
- if (typeof b !== "function" && b !== null)
170
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
171
- extendStatics(d, b);
172
- function __() { this.constructor = d; }
173
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
174
- }
175
- var __assign = function () {
176
- __assign = Object.assign || function __assign(t) {
177
- for (var s, i = 1, n = arguments.length; i < n; i++) {
178
- s = arguments[i];
179
- for (var p in s)
180
- if (Object.prototype.hasOwnProperty.call(s, p))
181
- t[p] = s[p];
182
- }
183
- return t;
184
- };
185
- return __assign.apply(this, arguments);
186
- };
187
- function __rest(s, e) {
188
- var t = {};
189
- for (var p in s)
190
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
191
- t[p] = s[p];
192
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
193
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
194
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
195
- t[p[i]] = s[p[i]];
196
- }
197
- return t;
198
- }
199
- function __decorate(decorators, target, key, desc) {
200
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
201
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
202
- r = Reflect.decorate(decorators, target, key, desc);
203
- else
204
- for (var i = decorators.length - 1; i >= 0; i--)
205
- if (d = decorators[i])
206
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
207
- return c > 3 && r && Object.defineProperty(target, key, r), r;
208
- }
209
- function __param(paramIndex, decorator) {
210
- return function (target, key) { decorator(target, key, paramIndex); };
211
- }
212
- function __metadata(metadataKey, metadataValue) {
213
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
214
- return Reflect.metadata(metadataKey, metadataValue);
215
- }
216
- function __awaiter(thisArg, _arguments, P, generator) {
217
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
218
- return new (P || (P = Promise))(function (resolve, reject) {
219
- function fulfilled(value) { try {
220
- step(generator.next(value));
221
- }
222
- catch (e) {
223
- reject(e);
224
- } }
225
- function rejected(value) { try {
226
- step(generator["throw"](value));
227
- }
228
- catch (e) {
229
- reject(e);
230
- } }
231
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
232
- step((generator = generator.apply(thisArg, _arguments || [])).next());
233
- });
234
- }
235
- function __generator(thisArg, body) {
236
- var _ = { label: 0, sent: function () { if (t[0] & 1)
237
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
238
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
239
- function verb(n) { return function (v) { return step([n, v]); }; }
240
- function step(op) {
241
- if (f)
242
- throw new TypeError("Generator is already executing.");
243
- while (_)
244
- try {
245
- 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)
246
- return t;
247
- if (y = 0, t)
248
- op = [op[0] & 2, t.value];
249
- switch (op[0]) {
250
- case 0:
251
- case 1:
252
- t = op;
253
- break;
254
- case 4:
255
- _.label++;
256
- return { value: op[1], done: false };
257
- case 5:
258
- _.label++;
259
- y = op[1];
260
- op = [0];
261
- continue;
262
- case 7:
263
- op = _.ops.pop();
264
- _.trys.pop();
265
- continue;
266
- default:
267
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
268
- _ = 0;
269
- continue;
270
- }
271
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
272
- _.label = op[1];
273
- break;
274
- }
275
- if (op[0] === 6 && _.label < t[1]) {
276
- _.label = t[1];
277
- t = op;
278
- break;
279
- }
280
- if (t && _.label < t[2]) {
281
- _.label = t[2];
282
- _.ops.push(op);
283
- break;
284
- }
285
- if (t[2])
286
- _.ops.pop();
287
- _.trys.pop();
288
- continue;
289
- }
290
- op = body.call(thisArg, _);
291
- }
292
- catch (e) {
293
- op = [6, e];
294
- y = 0;
295
- }
296
- finally {
297
- f = t = 0;
298
- }
299
- if (op[0] & 5)
300
- throw op[1];
301
- return { value: op[0] ? op[1] : void 0, done: true };
302
- }
303
- }
304
- var __createBinding = Object.create ? (function (o, m, k, k2) {
305
- if (k2 === undefined)
306
- k2 = k;
307
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
308
- }) : (function (o, m, k, k2) {
309
- if (k2 === undefined)
310
- k2 = k;
311
- o[k2] = m[k];
312
- });
313
- function __exportStar(m, o) {
314
- for (var p in m)
315
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
316
- __createBinding(o, m, p);
317
- }
318
- function __values(o) {
319
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
320
- if (m)
321
- return m.call(o);
322
- if (o && typeof o.length === "number")
323
- return {
324
- next: function () {
325
- if (o && i >= o.length)
326
- o = void 0;
327
- return { value: o && o[i++], done: !o };
328
- }
329
- };
330
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
331
- }
332
- function __read(o, n) {
333
- var m = typeof Symbol === "function" && o[Symbol.iterator];
334
- if (!m)
335
- return o;
336
- var i = m.call(o), r, ar = [], e;
337
- try {
338
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
339
- ar.push(r.value);
340
- }
341
- catch (error) {
342
- e = { error: error };
343
- }
344
- finally {
345
- try {
346
- if (r && !r.done && (m = i["return"]))
347
- m.call(i);
348
- }
349
- finally {
350
- if (e)
351
- throw e.error;
352
- }
353
- }
354
- return ar;
355
- }
356
- /** @deprecated */
357
- function __spread() {
358
- for (var ar = [], i = 0; i < arguments.length; i++)
359
- ar = ar.concat(__read(arguments[i]));
360
- return ar;
361
- }
362
- /** @deprecated */
363
- function __spreadArrays() {
364
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
365
- s += arguments[i].length;
366
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
367
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
368
- r[k] = a[j];
369
- return r;
370
- }
371
- function __spreadArray(to, from) {
372
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
373
- to[j] = from[i];
374
- return to;
375
- }
376
- function __await(v) {
377
- return this instanceof __await ? (this.v = v, this) : new __await(v);
378
- }
379
- function __asyncGenerator(thisArg, _arguments, generator) {
380
- if (!Symbol.asyncIterator)
381
- throw new TypeError("Symbol.asyncIterator is not defined.");
382
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
383
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
384
- function verb(n) { if (g[n])
385
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
386
- function resume(n, v) { try {
387
- step(g[n](v));
388
- }
389
- catch (e) {
390
- settle(q[0][3], e);
391
- } }
392
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
393
- function fulfill(value) { resume("next", value); }
394
- function reject(value) { resume("throw", value); }
395
- function settle(f, v) { if (f(v), q.shift(), q.length)
396
- resume(q[0][0], q[0][1]); }
397
- }
398
- function __asyncDelegator(o) {
399
- var i, p;
400
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
401
- 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; }
402
- }
403
- function __asyncValues(o) {
404
- if (!Symbol.asyncIterator)
405
- throw new TypeError("Symbol.asyncIterator is not defined.");
406
- var m = o[Symbol.asyncIterator], i;
407
- 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);
408
- 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); }); }; }
409
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
410
- }
411
- function __makeTemplateObject(cooked, raw) {
412
- if (Object.defineProperty) {
413
- Object.defineProperty(cooked, "raw", { value: raw });
414
- }
415
- else {
416
- cooked.raw = raw;
417
- }
418
- return cooked;
419
- }
420
- ;
421
- var __setModuleDefault = Object.create ? (function (o, v) {
422
- Object.defineProperty(o, "default", { enumerable: true, value: v });
423
- }) : function (o, v) {
424
- o["default"] = v;
425
- };
426
- function __importStar(mod) {
427
- if (mod && mod.__esModule)
428
- return mod;
429
- var result = {};
430
- if (mod != null)
431
- for (var k in mod)
432
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
433
- __createBinding(result, mod, k);
434
- __setModuleDefault(result, mod);
435
- return result;
436
- }
437
- function __importDefault(mod) {
438
- return (mod && mod.__esModule) ? mod : { default: mod };
439
- }
440
- function __classPrivateFieldGet(receiver, state, kind, f) {
441
- if (kind === "a" && !f)
442
- throw new TypeError("Private accessor was defined without a getter");
443
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
444
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
445
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
446
- }
447
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
448
- if (kind === "m")
449
- throw new TypeError("Private method is not writable");
450
- if (kind === "a" && !f)
451
- throw new TypeError("Private accessor was defined without a setter");
452
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
453
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
454
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
455
- }
456
-
457
- /**
458
- * @deprecated removed
459
- */
460
- exports.FormWindowRef = /** @class */ (function () {
461
- function FormWindowRef(formDefinition, windowRef) {
462
- this.formDefinition = formDefinition;
463
- this.windowRef = windowRef;
464
- }
465
- FormWindowRef.prototype.submit = function () {
466
- throw new Error('Not yet implemented!');
467
- };
468
- FormWindowRef.prototype.reset = function () {
469
- throw new Error('Not yet implemented!');
470
- };
471
- FormWindowRef.prototype.close = function (result) {
472
- this.windowRef.close(result);
473
- };
474
- return FormWindowRef;
475
- }());
476
- exports.FormWindowRef = __decorate([
477
- __param(1, i0.Inject(i1$1.WindowRef)),
478
- __metadata("design:paramtypes", [Object, i1$1.WindowRef])
479
- ], exports.FormWindowRef);
480
-
481
- /**
482
- * @deprecated
483
- */
484
- var RXAP_WINDOW_FORM_SYSTEM_OPEN_FORM_CONSTRUCTOR = new i0.InjectionToken('rxap/window-form-system/open-form-constructor');
485
- /**
486
- * @deprecated
487
- */
488
- var OpenFormDirective = /** @class */ (function (_super) {
489
- __extends(OpenFormDirective, _super);
490
- function OpenFormDirective(formDefinitionConstructor, formWindowService, injector) {
491
- var _this = _super.call(this) || this;
492
- _this.formWindowService = formWindowService;
493
- _this.injector = injector;
494
- _this.type = 'button';
495
- _this.submitted = new i0.EventEmitter();
496
- if (formDefinitionConstructor) {
497
- _this._formDefinitionConstructor = formDefinitionConstructor;
498
- }
499
- return _this;
500
- }
501
- Object.defineProperty(OpenFormDirective.prototype, "formDefinitionConstructor", {
502
- set: function (value) {
503
- if (value) {
504
- this._formDefinitionConstructor = value;
505
- }
506
- },
507
- enumerable: false,
508
- configurable: true
509
- });
510
- OpenFormDirective.prototype.onSubmit = function (value) {
511
- if (i0.isDevMode()) {
512
- console.warn('[rxapOpenForm] No "onSubmit" method is provided!');
513
- }
514
- return value;
515
- };
516
- OpenFormDirective.prototype.execute = function () {
517
- this._formWindowRef = this.formWindowService.open(this._formDefinitionConstructor, {
518
- injector: this.injector,
519
- submitSuccessfulMethod: i1.ToFormMethod(this.onSubmitSuccessful.bind(this)),
520
- initial: this.initial,
521
- injectorName: 'OpenFormDirective',
522
- title: this.title,
523
- icon: this.icon,
524
- width: this.width,
525
- resizeable: this.resizeable,
526
- draggable: this.draggable,
527
- panelClass: this.panelClass,
528
- });
529
- };
530
- OpenFormDirective.prototype.onSubmitSuccessful = function (result) {
531
- var _a;
532
- this.submitted.emit(result);
533
- (_a = this._formWindowRef) === null || _a === void 0 ? void 0 : _a.close();
534
- };
535
- OpenFormDirective.prototype.ngOnDestroy = function () {
536
- var _a;
537
- (_a = this._formWindowRef) === null || _a === void 0 ? void 0 : _a.close();
538
- };
539
- return OpenFormDirective;
540
- }(directives.ConfirmClick));
541
- OpenFormDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirective, deps: [{ token: RXAP_WINDOW_FORM_SYSTEM_OPEN_FORM_CONSTRUCTOR, optional: true }, { token: FormWindowService }, { token: i0.INJECTOR }], target: i0__namespace.ɵɵFactoryTarget.Directive });
542
- OpenFormDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: OpenFormDirective, selector: "[rxapOpenForm]", inputs: { type: "type", formDefinitionConstructor: ["rxapOpenForm", "formDefinitionConstructor"], initial: "initial", title: "title", icon: "icon", width: "width", height: "height", resizeable: "resizeable", draggable: "draggable", panelClass: "panelClass", onSubmit: "onSubmit" }, outputs: { submitted: "submitted" }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" }, properties: { "attr.type": "this.type" } }, usesInheritance: true, ngImport: i0__namespace });
543
- __decorate([
544
- utilities.Required,
545
- __metadata("design:type", Object)
546
- ], OpenFormDirective.prototype, "_formDefinitionConstructor", void 0);
547
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirective, decorators: [{
548
- type: i0.Directive,
549
- args: [{
550
- selector: '[rxapOpenForm]',
551
- host: {
552
- '(click)': 'onClick()',
553
- '(confirmed)': 'onConfirm()',
554
- },
555
- }]
556
- }], ctorParameters: function () {
557
- return [{ type: undefined, decorators: [{
558
- type: i0.Optional
559
- }, {
560
- type: i0.Inject,
561
- args: [RXAP_WINDOW_FORM_SYSTEM_OPEN_FORM_CONSTRUCTOR]
562
- }] }, { type: FormWindowService, decorators: [{
563
- type: i0.Inject,
564
- args: [FormWindowService]
565
- }] }, { type: i0__namespace.Injector, decorators: [{
566
- type: i0.Inject,
567
- args: [i0.INJECTOR]
568
- }] }];
569
- }, propDecorators: { type: [{
570
- type: i0.HostBinding,
571
- args: ['attr.type']
572
- }, {
573
- type: i0.Input
574
- }], submitted: [{
575
- type: i0.Output
576
- }], formDefinitionConstructor: [{
577
- type: i0.Input,
578
- args: ['rxapOpenForm']
579
- }], initial: [{
580
- type: i0.Input
581
- }], _formDefinitionConstructor: [], title: [{
582
- type: i0.Input
583
- }], icon: [{
584
- type: i0.Input
585
- }], width: [{
586
- type: i0.Input
587
- }], height: [{
588
- type: i0.Input
589
- }], resizeable: [{
590
- type: i0.Input
591
- }], draggable: [{
592
- type: i0.Input
593
- }], panelClass: [{
594
- type: i0.Input
595
- }], onSubmit: [{
596
- type: i0.Input
597
- }] } });
598
- /**
599
- * @deprecated
600
- */
601
- var OpenFormDirectiveModule = /** @class */ (function () {
602
- function OpenFormDirectiveModule() {
603
- }
604
- return OpenFormDirectiveModule;
605
- }());
606
- OpenFormDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
607
- OpenFormDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirectiveModule, declarations: [OpenFormDirective], exports: [OpenFormDirective] });
608
- OpenFormDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirectiveModule });
609
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormDirectiveModule, decorators: [{
610
- type: i0.NgModule,
611
- args: [{
612
- exports: [OpenFormDirective],
613
- declarations: [OpenFormDirective],
614
- }]
615
- }] });
616
-
617
- var FormWindowFooterDirective = /** @class */ (function () {
618
- function FormWindowFooterDirective(formDirective, windowRef, template, viewContainerRef) {
619
- this.formDirective = formDirective;
620
- this.windowRef = windowRef;
621
- this.template = template;
622
- this.viewContainerRef = viewContainerRef;
623
- }
624
- /**
625
- * Asserts the correct type of the context for the template that `NgForOf` will render.
626
- *
627
- * The presence of this method is a signal to the Ivy template type-check compiler that the
628
- * `NgForOf` structural directive renders its template with a specific context type.
629
- */
630
- FormWindowFooterDirective.ngTemplateContextGuard = function (dir, ctx) {
631
- return true;
632
- };
633
- FormWindowFooterDirective.prototype.ngOnInit = function () {
634
- this.windowRef.setFooterPortal(new portal.TemplatePortal(this.template, this.viewContainerRef, {
635
- $implicit: this.windowRef,
636
- formDefinition: this.formDirective.formDefinition,
637
- formDirective: this.formDirective,
638
- }));
639
- };
640
- return FormWindowFooterDirective;
641
- }());
642
- FormWindowFooterDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirective, deps: [{ token: i1.FormDirective }, { token: i1$1.RXAP_WINDOW_REF }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
643
- FormWindowFooterDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: FormWindowFooterDirective, selector: "[rxapFormWindowFooter]", ngImport: i0__namespace });
644
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirective, decorators: [{
645
- type: i0.Directive,
646
- args: [{
647
- selector: '[rxapFormWindowFooter]'
648
- }]
649
- }], ctorParameters: function () {
650
- return [{ type: i1__namespace$1.FormDirective, decorators: [{
651
- type: i0.Inject,
652
- args: [i1.FormDirective]
653
- }] }, { type: i1__namespace.WindowRef, decorators: [{
654
- type: i0.Inject,
655
- args: [i1$1.RXAP_WINDOW_REF]
656
- }] }, { type: i0__namespace.TemplateRef, decorators: [{
657
- type: i0.Inject,
658
- args: [i0.TemplateRef]
659
- }] }, { type: i0__namespace.ViewContainerRef, decorators: [{
660
- type: i0.Inject,
661
- args: [i0.ViewContainerRef]
662
- }] }];
663
- } });
664
- var FormWindowFooterDirectiveModule = /** @class */ (function () {
665
- function FormWindowFooterDirectiveModule() {
666
- }
667
- return FormWindowFooterDirectiveModule;
668
- }());
669
- FormWindowFooterDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
670
- FormWindowFooterDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirectiveModule, declarations: [FormWindowFooterDirective], exports: [FormWindowFooterDirective] });
671
- FormWindowFooterDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirectiveModule });
672
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: FormWindowFooterDirectiveModule, decorators: [{
673
- type: i0.NgModule,
674
- args: [{
675
- exports: [FormWindowFooterDirective],
676
- declarations: [FormWindowFooterDirective]
677
- }]
678
- }] });
679
-
680
- var RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFINITION_CONSTRUCTOR = new i0.InjectionToken('rxap/form-window-system/open-form/definition-constructor');
681
- var RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFAULT_OPTIONS = new i0.InjectionToken('rxap/form-window-system/open-form/default-options');
682
- var RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_COMPONENT = new i0.InjectionToken('rxap/form-window-system/open-form/component');
683
- var OpenFormWindowMethod = /** @class */ (function () {
684
- function OpenFormWindowMethod(formWindowService, formDefinitionConstructor, injector, formComponent, defaultOptions) {
685
- if (formComponent === void 0) { formComponent = null; }
686
- if (defaultOptions === void 0) { defaultOptions = null; }
687
- this.formWindowService = formWindowService;
688
- this.formDefinitionConstructor = formDefinitionConstructor;
689
- this.injector = injector;
690
- this.formComponent = formComponent;
691
- this.defaultOptions = defaultOptions;
692
- }
693
- OpenFormWindowMethod.prototype.call = function (initial, options) {
694
- var _a, _b, _c, _d, _e;
695
- return this.formWindowService.open(this.formDefinitionConstructor, Object.assign(Object.assign(Object.assign(Object.assign({}, ((_a = this.defaultOptions) !== null && _a !== void 0 ? _a : {})), { injector: this.injector }), (options !== null && options !== void 0 ? options : {})), { initial: initial !== null && initial !== void 0 ? initial : (_b = this.defaultOptions) === null || _b === void 0 ? void 0 : _b.initial, component: (_e = (_c = this.formComponent) !== null && _c !== void 0 ? _c : (_d = this.defaultOptions) === null || _d === void 0 ? void 0 : _d.component) !== null && _e !== void 0 ? _e : undefined }));
696
- };
697
- return OpenFormWindowMethod;
698
- }());
699
- OpenFormWindowMethod.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethod, deps: [{ token: FormWindowService }, { token: RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFINITION_CONSTRUCTOR }, { token: i0.INJECTOR }, { token: RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_COMPONENT, optional: true }, { token: RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFAULT_OPTIONS, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
700
- OpenFormWindowMethod.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethod });
701
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethod, decorators: [{
702
- type: i0.Injectable
703
- }], ctorParameters: function () {
704
- return [{ type: FormWindowService, decorators: [{
705
- type: i0.Inject,
706
- args: [FormWindowService]
707
- }] }, { type: undefined, decorators: [{
708
- type: i0.Inject,
709
- args: [RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFINITION_CONSTRUCTOR]
710
- }] }, { type: i0__namespace.Injector, decorators: [{
711
- type: i0.Inject,
712
- args: [i0.INJECTOR]
713
- }] }, { type: undefined, decorators: [{
714
- type: i0.Optional
715
- }, {
716
- type: i0.Inject,
717
- args: [RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_COMPONENT]
718
- }] }, { type: undefined, decorators: [{
719
- type: i0.Optional
720
- }, {
721
- type: i0.Inject,
722
- args: [RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFAULT_OPTIONS]
723
- }] }];
724
- } });
725
-
726
- var OpenFormWindowMethodDirective = /** @class */ (function () {
727
- function OpenFormWindowMethodDirective(injector) {
728
- if (injector === void 0) { injector = null; }
729
- this.injector = injector;
730
- this.failure$ = new i0.EventEmitter();
731
- this.completed$ = new i0.EventEmitter();
732
- this.submitted$ = new i0.EventEmitter();
733
- /**
734
- * true - a remote method call is in progress
735
- */
736
- this.executing$ = new rxjs.CounterSubject(0);
737
- this._hasConfirmDirective = false;
738
- /**
739
- * Set of all active window ref instances.
740
- *
741
- * Used to distory all windows of the directive is
742
- * destroyed
743
- * @protected
744
- */
745
- this._windowRefInstance = new Set();
746
- }
747
- Object.defineProperty(OpenFormWindowMethodDirective.prototype, "hasConfirmDirective", {
748
- set: function (value) {
749
- this._hasConfirmDirective = utilities.coerceBoolean(value);
750
- },
751
- enumerable: false,
752
- configurable: true
753
- });
754
- OpenFormWindowMethodDirective.prototype.ngOnDestroy = function () {
755
- this._windowRefInstance.forEach(function (windowRef) { return windowRef.complete(); });
756
- };
757
- OpenFormWindowMethodDirective.prototype.onConfirmed = function () {
758
- this.execute();
759
- };
760
- OpenFormWindowMethodDirective.prototype.onClick = function () {
761
- if (!this._hasConfirmDirective) {
762
- this.execute();
763
- }
764
- else {
765
- console.debug('skip remote method call. Wait for confirmation.');
766
- }
767
- };
768
- OpenFormWindowMethodDirective.prototype.execute = function () {
769
- var _this = this;
770
- this.executing$.increase();
771
- var windowRef = this.method.call(this.initial, {
772
- providers: this.providers,
773
- injector: this.injector
774
- });
775
- windowRef.subscribe(function (value) { return _this.submitted(value); }, function (error) { return _this.failure(error); }, function () {
776
- _this.completed();
777
- _this.executing$.decrease();
778
- _this._windowRefInstance.delete(windowRef);
779
- });
780
- };
781
- OpenFormWindowMethodDirective.prototype.submitted = function (value) {
782
- this.submitted$.emit(value);
783
- };
784
- OpenFormWindowMethodDirective.prototype.failure = function (error) {
785
- this.failure$.emit(error);
786
- };
787
- OpenFormWindowMethodDirective.prototype.completed = function () {
788
- this.completed$.emit();
789
- };
790
- return OpenFormWindowMethodDirective;
791
- }());
792
- OpenFormWindowMethodDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirective, deps: [{ token: i0.INJECTOR, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
793
- OpenFormWindowMethodDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: OpenFormWindowMethodDirective, selector: "[rxapOpenFormWindowMethod]", inputs: { method: ["rxapOpenFormWindowMethod", "method"], initial: "initial", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"], providers: "providers" }, outputs: { failure$: "failure", completed$: "completed", submitted$: "submitted" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, ngImport: i0__namespace });
794
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirective, decorators: [{
795
- type: i0.Directive,
796
- args: [{
797
- selector: '[rxapOpenFormWindowMethod]'
798
- }]
799
- }], ctorParameters: function () {
800
- return [{ type: i0__namespace.Injector, decorators: [{
801
- type: i0.Optional
802
- }, {
803
- type: i0.Inject,
804
- args: [i0.INJECTOR]
805
- }] }];
806
- }, propDecorators: { method: [{
807
- type: i0.Input,
808
- args: ['rxapOpenFormWindowMethod']
809
- }], initial: [{
810
- type: i0.Input
811
- }], failure$: [{
812
- type: i0.Output,
813
- args: ['failure']
814
- }], completed$: [{
815
- type: i0.Output,
816
- args: ['completed']
817
- }], submitted$: [{
818
- type: i0.Output,
819
- args: ['submitted']
820
- }], hasConfirmDirective: [{
821
- type: i0.Input,
822
- args: ['rxapConfirm']
823
- }], providers: [{
824
- type: i0.Input
825
- }], onConfirmed: [{
826
- type: i0.HostListener,
827
- args: ['confirmed']
828
- }], onClick: [{
829
- type: i0.HostListener,
830
- args: ['click']
831
- }] } });
832
- var OpenFormWindowMethodDirectiveModule = /** @class */ (function () {
833
- function OpenFormWindowMethodDirectiveModule() {
834
- }
835
- return OpenFormWindowMethodDirectiveModule;
836
- }());
837
- OpenFormWindowMethodDirectiveModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirectiveModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
838
- OpenFormWindowMethodDirectiveModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirectiveModule, declarations: [OpenFormWindowMethodDirective], exports: [OpenFormWindowMethodDirective] });
839
- OpenFormWindowMethodDirectiveModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirectiveModule });
840
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OpenFormWindowMethodDirectiveModule, decorators: [{
841
- type: i0.NgModule,
842
- args: [{
843
- exports: [OpenFormWindowMethodDirective],
844
- declarations: [OpenFormWindowMethodDirective]
845
- }]
846
- }] });
847
-
848
- /**
849
- * Generated bundle index. Do not edit.
850
- */
851
-
852
- exports.FormWindowFooterDirective = FormWindowFooterDirective;
853
- exports.FormWindowFooterDirectiveModule = FormWindowFooterDirectiveModule;
854
- exports.FormWindowService = FormWindowService;
855
- exports.OpenFormDirective = OpenFormDirective;
856
- exports.OpenFormDirectiveModule = OpenFormDirectiveModule;
857
- exports.OpenFormWindowMethod = OpenFormWindowMethod;
858
- exports.OpenFormWindowMethodDirective = OpenFormWindowMethodDirective;
859
- exports.OpenFormWindowMethodDirectiveModule = OpenFormWindowMethodDirectiveModule;
860
- exports.RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_COMPONENT = RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_COMPONENT;
861
- exports.RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFAULT_OPTIONS = RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFAULT_OPTIONS;
862
- exports.RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFINITION_CONSTRUCTOR = RXAP_FORM_WINDOW_SYSTEM_OPEN_FORM_DEFINITION_CONSTRUCTOR;
863
- exports.RXAP_WINDOW_FORM_SYSTEM_OPEN_FORM_CONSTRUCTOR = RXAP_WINDOW_FORM_SYSTEM_OPEN_FORM_CONSTRUCTOR;
864
-
865
- Object.defineProperty(exports, '__esModule', { value: true });
866
-
867
- })));
868
- //# sourceMappingURL=rxap-form-window-system.umd.js.map