@ajsf/material 0.5.1-beta.1 → 0.5.1

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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/ajsf-material.d.ts +4 -0
  4. package/ajsf-material.metadata.json +1 -0
  5. package/bundles/ajsf-material.umd.js +1422 -0
  6. package/bundles/ajsf-material.umd.js.map +1 -0
  7. package/esm2015/ajsf-material.js +5 -0
  8. package/esm2015/lib/angular-flex-monkey-patch.js +12 -0
  9. package/esm2015/lib/material-design-framework.component.js +101 -0
  10. package/esm2015/lib/material-design-framework.module.js +80 -0
  11. package/esm2015/lib/material-design.framework.js +54 -0
  12. package/esm2015/lib/widgets/flex-layout-root.component.js +55 -0
  13. package/esm2015/lib/widgets/flex-layout-section.component.js +221 -0
  14. package/esm2015/lib/widgets/material-add-reference.component.js +53 -0
  15. package/esm2015/lib/widgets/material-button-group.component.js +63 -0
  16. package/esm2015/lib/widgets/material-button.component.js +60 -0
  17. package/esm2015/lib/widgets/material-checkbox.component.js +109 -0
  18. package/esm2015/lib/widgets/material-checkboxes.component.js +101 -0
  19. package/esm2015/lib/widgets/material-chip-list.component.js +33 -0
  20. package/esm2015/lib/widgets/material-datepicker.component.js +90 -0
  21. package/esm2015/lib/widgets/material-file.component.js +33 -0
  22. package/esm2015/lib/widgets/material-input.component.js +95 -0
  23. package/esm2015/lib/widgets/material-number.component.js +97 -0
  24. package/esm2015/lib/widgets/material-one-of.component.js +33 -0
  25. package/esm2015/lib/widgets/material-radios.component.js +84 -0
  26. package/esm2015/lib/widgets/material-select.component.js +115 -0
  27. package/esm2015/lib/widgets/material-slider.component.js +60 -0
  28. package/esm2015/lib/widgets/material-stepper.component.js +33 -0
  29. package/esm2015/lib/widgets/material-tabs.component.js +69 -0
  30. package/esm2015/lib/widgets/material-textarea.component.js +88 -0
  31. package/esm2015/lib/widgets/public_api.js +52 -0
  32. package/esm2015/public_api.js +8 -0
  33. package/fesm2015/ajsf-material.js +1710 -0
  34. package/fesm2015/ajsf-material.js.map +1 -0
  35. package/lib/angular-flex-monkey-patch.d.ts +1 -0
  36. package/lib/material-design-framework.component.d.ts +25 -0
  37. package/lib/material-design-framework.module.d.ts +12 -0
  38. package/lib/material-design.framework.d.ts +41 -0
  39. package/lib/widgets/flex-layout-root.component.d.ts +12 -0
  40. package/lib/widgets/flex-layout-section.component.d.ts +22 -0
  41. package/lib/widgets/material-add-reference.component.d.ts +17 -0
  42. package/lib/widgets/material-button-group.component.d.ts +20 -0
  43. package/lib/widgets/material-button.component.d.ts +18 -0
  44. package/lib/widgets/material-checkbox.component.d.ts +22 -0
  45. package/lib/widgets/material-checkboxes.component.d.ts +24 -0
  46. package/lib/widgets/material-chip-list.component.d.ts +18 -0
  47. package/lib/widgets/material-datepicker.component.d.ts +19 -0
  48. package/lib/widgets/material-file.component.d.ts +18 -0
  49. package/lib/widgets/material-input.component.d.ts +20 -0
  50. package/lib/widgets/material-number.component.d.ts +23 -0
  51. package/lib/widgets/material-one-of.component.d.ts +18 -0
  52. package/lib/widgets/material-radios.component.d.ts +20 -0
  53. package/lib/widgets/material-select.component.d.ts +21 -0
  54. package/lib/widgets/material-slider.component.d.ts +22 -0
  55. package/lib/widgets/material-stepper.component.d.ts +18 -0
  56. package/lib/widgets/material-tabs.component.d.ts +17 -0
  57. package/lib/widgets/material-textarea.component.d.ts +19 -0
  58. package/{src/lib/widgets/public_api.ts → lib/widgets/public_api.d.ts} +1 -14
  59. package/package.json +12 -4
  60. package/{src/public_api.ts → public_api.d.ts} +0 -4
  61. package/karma.conf.js +0 -37
  62. package/ng-package.json +0 -16
  63. package/src/lib/angular-flex-monkey-patch.ts +0 -13
  64. package/src/lib/material-design-framework.component.html +0 -20
  65. package/src/lib/material-design-framework.component.scss +0 -51
  66. package/src/lib/material-design-framework.component.spec.ts +0 -37
  67. package/src/lib/material-design-framework.component.ts +0 -121
  68. package/src/lib/material-design-framework.module.ts +0 -84
  69. package/src/lib/material-design.framework.ts +0 -75
  70. package/src/lib/widgets/flex-layout-root.component.html +0 -11
  71. package/src/lib/widgets/flex-layout-root.component.ts +0 -52
  72. package/src/lib/widgets/flex-layout-section.component.ts +0 -216
  73. package/src/lib/widgets/material-add-reference.component.ts +0 -56
  74. package/src/lib/widgets/material-button-group.component.ts +0 -68
  75. package/src/lib/widgets/material-button.component.ts +0 -59
  76. package/src/lib/widgets/material-checkbox.component.ts +0 -112
  77. package/src/lib/widgets/material-checkboxes.component.ts +0 -109
  78. package/src/lib/widgets/material-chip-list.component.ts +0 -35
  79. package/src/lib/widgets/material-datepicker.component.ts +0 -103
  80. package/src/lib/widgets/material-file.component.ts +0 -35
  81. package/src/lib/widgets/material-input.component.ts +0 -97
  82. package/src/lib/widgets/material-number.component.ts +0 -95
  83. package/src/lib/widgets/material-one-of.component.ts +0 -35
  84. package/src/lib/widgets/material-radios.component.ts +0 -89
  85. package/src/lib/widgets/material-select.component.ts +0 -118
  86. package/src/lib/widgets/material-slider.component.ts +0 -61
  87. package/src/lib/widgets/material-stepper.component.ts +0 -35
  88. package/src/lib/widgets/material-tabs.component.ts +0 -69
  89. package/src/lib/widgets/material-textarea.component.ts +0 -88
  90. package/src/test.ts +0 -21
  91. package/tsconfig.lib.json +0 -26
  92. package/tsconfig.lib.prod.json +0 -9
  93. package/tsconfig.spec.json +0 -17
  94. package/tslint.json +0 -11
@@ -0,0 +1,1422 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ajsf/core'), require('@angular/material/form-field'), require('lodash/cloneDeep'), require('@angular/common'), require('@angular/forms'), require('@angular/flex-layout'), require('@angular/material/autocomplete'), require('@angular/material/button'), require('@angular/material/button-toggle'), require('@angular/material/card'), require('@angular/material/checkbox'), require('@angular/material/chips'), require('@angular/material/core'), require('@angular/material/datepicker'), require('@angular/material/expansion'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/radio'), require('@angular/material/select'), require('@angular/material/slide-toggle'), require('@angular/material/slider'), require('@angular/material/stepper'), require('@angular/material/tabs'), require('@angular/material/tooltip'), require('@angular/material/menu'), require('@angular/material/toolbar'), require('@angular/flex-layout/core')) :
3
+ typeof define === 'function' && define.amd ? define('@ajsf/material', ['exports', '@angular/core', '@ajsf/core', '@angular/material/form-field', 'lodash/cloneDeep', '@angular/common', '@angular/forms', '@angular/flex-layout', '@angular/material/autocomplete', '@angular/material/button', '@angular/material/button-toggle', '@angular/material/card', '@angular/material/checkbox', '@angular/material/chips', '@angular/material/core', '@angular/material/datepicker', '@angular/material/expansion', '@angular/material/icon', '@angular/material/input', '@angular/material/radio', '@angular/material/select', '@angular/material/slide-toggle', '@angular/material/slider', '@angular/material/stepper', '@angular/material/tabs', '@angular/material/tooltip', '@angular/material/menu', '@angular/material/toolbar', '@angular/flex-layout/core'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ajsf = global.ajsf || {}, global.ajsf.material = {}), global.ng.core, global["@ajsf/core"], global.ng.material.formField, global["lodash-es"], global.ng.common, global.ng.forms, global.ng.flexLayout, global.ng.material.autocomplete, global.ng.material.button, global.ng.material.buttonToggle, global.ng.material.card, global.ng.material.checkbox, global.ng.material.chips, global.ng.material.core, global.ng.material.datepicker, global.ng.material.expansion, global.ng.material.icon, global.ng.material.input, global.ng.material.radio, global.ng.material.select, global.ng.material.slideToggle, global.ng.material.slider, global.ng.material.stepper, global.ng.material.tabs, global.ng.material.tooltip, global.ng.material.menu, global.ng.material.toolbar, global.ng.flexLayout.core));
5
+ })(this, (function (exports, core, core$1, formField, cloneDeep, common, forms, flexLayout, autocomplete, button, buttonToggle, card, checkbox, chips, core$3, datepicker, expansion, icon, input, radio, select, slideToggle, slider, stepper, tabs, tooltip, menu, toolbar, core$2) { 'use strict';
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
10
+
11
+ /*! *****************************************************************************
12
+ Copyright (c) Microsoft Corporation.
13
+
14
+ Permission to use, copy, modify, and/or distribute this software for any
15
+ purpose with or without fee is hereby granted.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
+ PERFORMANCE OF THIS SOFTWARE.
24
+ ***************************************************************************** */
25
+ /* global Reflect, Promise */
26
+ var extendStatics = function (d, b) {
27
+ extendStatics = Object.setPrototypeOf ||
28
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
29
+ function (d, b) { for (var p in b)
30
+ if (Object.prototype.hasOwnProperty.call(b, p))
31
+ d[p] = b[p]; };
32
+ return extendStatics(d, b);
33
+ };
34
+ function __extends(d, b) {
35
+ if (typeof b !== "function" && b !== null)
36
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
37
+ extendStatics(d, b);
38
+ function __() { this.constructor = d; }
39
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
40
+ }
41
+ var __assign = function () {
42
+ __assign = Object.assign || function __assign(t) {
43
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
44
+ s = arguments[i];
45
+ for (var p in s)
46
+ if (Object.prototype.hasOwnProperty.call(s, p))
47
+ t[p] = s[p];
48
+ }
49
+ return t;
50
+ };
51
+ return __assign.apply(this, arguments);
52
+ };
53
+ function __rest(s, e) {
54
+ var t = {};
55
+ for (var p in s)
56
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
57
+ t[p] = s[p];
58
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
59
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
60
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
61
+ t[p[i]] = s[p[i]];
62
+ }
63
+ return t;
64
+ }
65
+ function __decorate(decorators, target, key, desc) {
66
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
67
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
68
+ r = Reflect.decorate(decorators, target, key, desc);
69
+ else
70
+ for (var i = decorators.length - 1; i >= 0; i--)
71
+ if (d = decorators[i])
72
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
73
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
74
+ }
75
+ function __param(paramIndex, decorator) {
76
+ return function (target, key) { decorator(target, key, paramIndex); };
77
+ }
78
+ function __metadata(metadataKey, metadataValue) {
79
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
80
+ return Reflect.metadata(metadataKey, metadataValue);
81
+ }
82
+ function __awaiter(thisArg, _arguments, P, generator) {
83
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
84
+ return new (P || (P = Promise))(function (resolve, reject) {
85
+ function fulfilled(value) { try {
86
+ step(generator.next(value));
87
+ }
88
+ catch (e) {
89
+ reject(e);
90
+ } }
91
+ function rejected(value) { try {
92
+ step(generator["throw"](value));
93
+ }
94
+ catch (e) {
95
+ reject(e);
96
+ } }
97
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
98
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
99
+ });
100
+ }
101
+ function __generator(thisArg, body) {
102
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
103
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
104
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
105
+ function verb(n) { return function (v) { return step([n, v]); }; }
106
+ function step(op) {
107
+ if (f)
108
+ throw new TypeError("Generator is already executing.");
109
+ while (_)
110
+ try {
111
+ 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)
112
+ return t;
113
+ if (y = 0, t)
114
+ op = [op[0] & 2, t.value];
115
+ switch (op[0]) {
116
+ case 0:
117
+ case 1:
118
+ t = op;
119
+ break;
120
+ case 4:
121
+ _.label++;
122
+ return { value: op[1], done: false };
123
+ case 5:
124
+ _.label++;
125
+ y = op[1];
126
+ op = [0];
127
+ continue;
128
+ case 7:
129
+ op = _.ops.pop();
130
+ _.trys.pop();
131
+ continue;
132
+ default:
133
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
134
+ _ = 0;
135
+ continue;
136
+ }
137
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
138
+ _.label = op[1];
139
+ break;
140
+ }
141
+ if (op[0] === 6 && _.label < t[1]) {
142
+ _.label = t[1];
143
+ t = op;
144
+ break;
145
+ }
146
+ if (t && _.label < t[2]) {
147
+ _.label = t[2];
148
+ _.ops.push(op);
149
+ break;
150
+ }
151
+ if (t[2])
152
+ _.ops.pop();
153
+ _.trys.pop();
154
+ continue;
155
+ }
156
+ op = body.call(thisArg, _);
157
+ }
158
+ catch (e) {
159
+ op = [6, e];
160
+ y = 0;
161
+ }
162
+ finally {
163
+ f = t = 0;
164
+ }
165
+ if (op[0] & 5)
166
+ throw op[1];
167
+ return { value: op[0] ? op[1] : void 0, done: true };
168
+ }
169
+ }
170
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
171
+ if (k2 === undefined)
172
+ k2 = k;
173
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
174
+ }) : (function (o, m, k, k2) {
175
+ if (k2 === undefined)
176
+ k2 = k;
177
+ o[k2] = m[k];
178
+ });
179
+ function __exportStar(m, o) {
180
+ for (var p in m)
181
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
182
+ __createBinding(o, m, p);
183
+ }
184
+ function __values(o) {
185
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
186
+ if (m)
187
+ return m.call(o);
188
+ if (o && typeof o.length === "number")
189
+ return {
190
+ next: function () {
191
+ if (o && i >= o.length)
192
+ o = void 0;
193
+ return { value: o && o[i++], done: !o };
194
+ }
195
+ };
196
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
197
+ }
198
+ function __read(o, n) {
199
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
200
+ if (!m)
201
+ return o;
202
+ var i = m.call(o), r, ar = [], e;
203
+ try {
204
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
205
+ ar.push(r.value);
206
+ }
207
+ catch (error) {
208
+ e = { error: error };
209
+ }
210
+ finally {
211
+ try {
212
+ if (r && !r.done && (m = i["return"]))
213
+ m.call(i);
214
+ }
215
+ finally {
216
+ if (e)
217
+ throw e.error;
218
+ }
219
+ }
220
+ return ar;
221
+ }
222
+ /** @deprecated */
223
+ function __spread() {
224
+ for (var ar = [], i = 0; i < arguments.length; i++)
225
+ ar = ar.concat(__read(arguments[i]));
226
+ return ar;
227
+ }
228
+ /** @deprecated */
229
+ function __spreadArrays() {
230
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
231
+ s += arguments[i].length;
232
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
233
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
234
+ r[k] = a[j];
235
+ return r;
236
+ }
237
+ function __spreadArray(to, from) {
238
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
239
+ to[j] = from[i];
240
+ return to;
241
+ }
242
+ function __await(v) {
243
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
244
+ }
245
+ function __asyncGenerator(thisArg, _arguments, generator) {
246
+ if (!Symbol.asyncIterator)
247
+ throw new TypeError("Symbol.asyncIterator is not defined.");
248
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
249
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
250
+ function verb(n) { if (g[n])
251
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
252
+ function resume(n, v) { try {
253
+ step(g[n](v));
254
+ }
255
+ catch (e) {
256
+ settle(q[0][3], e);
257
+ } }
258
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
259
+ function fulfill(value) { resume("next", value); }
260
+ function reject(value) { resume("throw", value); }
261
+ function settle(f, v) { if (f(v), q.shift(), q.length)
262
+ resume(q[0][0], q[0][1]); }
263
+ }
264
+ function __asyncDelegator(o) {
265
+ var i, p;
266
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
267
+ 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; }
268
+ }
269
+ function __asyncValues(o) {
270
+ if (!Symbol.asyncIterator)
271
+ throw new TypeError("Symbol.asyncIterator is not defined.");
272
+ var m = o[Symbol.asyncIterator], i;
273
+ 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);
274
+ 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); }); }; }
275
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
276
+ }
277
+ function __makeTemplateObject(cooked, raw) {
278
+ if (Object.defineProperty) {
279
+ Object.defineProperty(cooked, "raw", { value: raw });
280
+ }
281
+ else {
282
+ cooked.raw = raw;
283
+ }
284
+ return cooked;
285
+ }
286
+ ;
287
+ var __setModuleDefault = Object.create ? (function (o, v) {
288
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
289
+ }) : function (o, v) {
290
+ o["default"] = v;
291
+ };
292
+ function __importStar(mod) {
293
+ if (mod && mod.__esModule)
294
+ return mod;
295
+ var result = {};
296
+ if (mod != null)
297
+ for (var k in mod)
298
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
299
+ __createBinding(result, mod, k);
300
+ __setModuleDefault(result, mod);
301
+ return result;
302
+ }
303
+ function __importDefault(mod) {
304
+ return (mod && mod.__esModule) ? mod : { default: mod };
305
+ }
306
+ function __classPrivateFieldGet(receiver, privateMap) {
307
+ if (!privateMap.has(receiver)) {
308
+ throw new TypeError("attempted to get private field on non-instance");
309
+ }
310
+ return privateMap.get(receiver);
311
+ }
312
+ function __classPrivateFieldSet(receiver, privateMap, value) {
313
+ if (!privateMap.has(receiver)) {
314
+ throw new TypeError("attempted to set private field on non-instance");
315
+ }
316
+ privateMap.set(receiver, value);
317
+ return value;
318
+ }
319
+
320
+ var FlexLayoutRootComponent = /** @class */ (function () {
321
+ function FlexLayoutRootComponent(jsf) {
322
+ this.jsf = jsf;
323
+ this.isFlexItem = false;
324
+ }
325
+ FlexLayoutRootComponent.prototype.removeItem = function (item) {
326
+ this.jsf.removeItem(item);
327
+ };
328
+ // Set attributes for flexbox child
329
+ // (container attributes are set in flex-layout-section.component)
330
+ FlexLayoutRootComponent.prototype.getFlexAttribute = function (node, attribute) {
331
+ var index = ['flex-grow', 'flex-shrink', 'flex-basis'].indexOf(attribute);
332
+ return ((node.options || {}).flex || '').split(/\s+/)[index] ||
333
+ (node.options || {})[attribute] || ['1', '1', 'auto'][index];
334
+ };
335
+ FlexLayoutRootComponent.prototype.showWidget = function (layoutNode) {
336
+ return this.jsf.evaluateCondition(layoutNode, this.dataIndex);
337
+ };
338
+ return FlexLayoutRootComponent;
339
+ }());
340
+ FlexLayoutRootComponent.decorators = [
341
+ { type: core.Component, args: [{
342
+ // tslint:disable-next-line:component-selector
343
+ selector: 'flex-layout-root-widget',
344
+ template: "\n <div *ngFor=\"let layoutNode of layout; let i = index\"\n [class.form-flex-item]=\"isFlexItem\"\n [style.flex-grow]=\"getFlexAttribute(layoutNode, 'flex-grow')\"\n [style.flex-shrink]=\"getFlexAttribute(layoutNode, 'flex-shrink')\"\n [style.flex-basis]=\"getFlexAttribute(layoutNode, 'flex-basis')\"\n [style.align-self]=\"(layoutNode?.options || {})['align-self']\"\n [style.order]=\"layoutNode?.options?.order\"\n [fxFlex]=\"layoutNode?.options?.fxFlex\"\n [fxFlexOrder]=\"layoutNode?.options?.fxFlexOrder\"\n [fxFlexOffset]=\"layoutNode?.options?.fxFlexOffset\"\n [fxFlexAlign]=\"layoutNode?.options?.fxFlexAlign\">\n <select-framework-widget *ngIf=\"showWidget(layoutNode)\"\n [dataIndex]=\"layoutNode?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])\"\n [layoutIndex]=\"(layoutIndex || []).concat(i)\"\n [layoutNode]=\"layoutNode\"></select-framework-widget>\n <div>",
345
+ changeDetection: core.ChangeDetectionStrategy.Default
346
+ },] }
347
+ ];
348
+ FlexLayoutRootComponent.ctorParameters = function () { return [
349
+ { type: core$1.JsonSchemaFormService }
350
+ ]; };
351
+ FlexLayoutRootComponent.propDecorators = {
352
+ dataIndex: [{ type: core.Input }],
353
+ layoutIndex: [{ type: core.Input }],
354
+ layout: [{ type: core.Input }],
355
+ isFlexItem: [{ type: core.Input }]
356
+ };
357
+
358
+ var FlexLayoutSectionComponent = /** @class */ (function () {
359
+ function FlexLayoutSectionComponent(jsf) {
360
+ this.jsf = jsf;
361
+ this.controlDisabled = false;
362
+ this.boundControl = false;
363
+ this.expanded = true;
364
+ this.containerType = 'div';
365
+ }
366
+ Object.defineProperty(FlexLayoutSectionComponent.prototype, "sectionTitle", {
367
+ get: function () {
368
+ return this.options.notitle ? null : this.jsf.setItemTitle(this);
369
+ },
370
+ enumerable: false,
371
+ configurable: true
372
+ });
373
+ FlexLayoutSectionComponent.prototype.ngOnInit = function () {
374
+ this.jsf.initializeControl(this);
375
+ this.options = this.layoutNode.options || {};
376
+ this.expanded = typeof this.options.expanded === 'boolean' ?
377
+ this.options.expanded : !this.options.expandable;
378
+ switch (this.layoutNode.type) {
379
+ case 'section':
380
+ case 'array':
381
+ case 'fieldset':
382
+ case 'advancedfieldset':
383
+ case 'authfieldset':
384
+ case 'optionfieldset':
385
+ case 'selectfieldset':
386
+ this.containerType = 'fieldset';
387
+ break;
388
+ case 'card':
389
+ this.containerType = 'card';
390
+ break;
391
+ case 'expansion-panel':
392
+ this.containerType = 'expansion-panel';
393
+ break;
394
+ default: // 'div', 'flex', 'tab', 'conditional', 'actions'
395
+ this.containerType = 'div';
396
+ }
397
+ };
398
+ FlexLayoutSectionComponent.prototype.toggleExpanded = function () {
399
+ if (this.options.expandable) {
400
+ this.expanded = !this.expanded;
401
+ }
402
+ };
403
+ // Set attributes for flexbox container
404
+ // (child attributes are set in flex-layout-root.component)
405
+ FlexLayoutSectionComponent.prototype.getFlexAttribute = function (attribute) {
406
+ var flexActive = this.layoutNode.type === 'flex' ||
407
+ !!this.options.displayFlex ||
408
+ this.options.display === 'flex';
409
+ // if (attribute !== 'flex' && !flexActive) { return null; }
410
+ switch (attribute) {
411
+ case 'is-flex':
412
+ return flexActive;
413
+ case 'display':
414
+ return flexActive ? 'flex' : 'initial';
415
+ case 'flex-direction':
416
+ case 'flex-wrap':
417
+ var index = ['flex-direction', 'flex-wrap'].indexOf(attribute);
418
+ return (this.options['flex-flow'] || '').split(/\s+/)[index] ||
419
+ this.options[attribute] || ['column', 'nowrap'][index];
420
+ case 'justify-content':
421
+ case 'align-items':
422
+ case 'align-content':
423
+ return this.options[attribute];
424
+ case 'layout':
425
+ return (this.options.fxLayout || 'row') +
426
+ this.options.fxLayoutWrap ? ' ' + this.options.fxLayoutWrap : '';
427
+ }
428
+ };
429
+ return FlexLayoutSectionComponent;
430
+ }());
431
+ FlexLayoutSectionComponent.decorators = [
432
+ { type: core.Component, args: [{
433
+ // tslint:disable-next-line:component-selector
434
+ selector: 'flex-layout-section-widget',
435
+ template: "\n <div *ngIf=\"containerType === 'div'\"\n [class]=\"options?.htmlClass || ''\"\n [class.expandable]=\"options?.expandable && !expanded\"\n [class.expanded]=\"options?.expandable && expanded\">\n <label *ngIf=\"sectionTitle\"\n [class]=\"'legend ' + (options?.labelHtmlClass || '')\"\n [innerHTML]=\"sectionTitle\"\n (click)=\"toggleExpanded()\"></label>\n <flex-layout-root-widget *ngIf=\"expanded\"\n [layout]=\"layoutNode.items\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\n [style.display]=\"getFlexAttribute('display')\"\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\n [style.justify-content]=\"getFlexAttribute('justify-content')\"\n [style.align-items]=\"getFlexAttribute('align-items')\"\n [style.align-content]=\"getFlexAttribute('align-content')\"\n [fxLayout]=\"getFlexAttribute('layout')\"\n [fxLayoutGap]=\"options?.fxLayoutGap\"\n [fxLayoutAlign]=\"options?.fxLayoutAlign\"\n [attr.fxFlexFill]=\"options?.fxLayoutAlign\"></flex-layout-root-widget>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </div>\n\n <fieldset *ngIf=\"containerType === 'fieldset'\"\n [class]=\"options?.htmlClass || ''\"\n [class.expandable]=\"options?.expandable && !expanded\"\n [class.expanded]=\"options?.expandable && expanded\"\n [disabled]=\"options?.readonly\">\n <legend *ngIf=\"sectionTitle\"\n [class]=\"'legend ' + (options?.labelHtmlClass || '')\"\n [innerHTML]=\"sectionTitle\"\n (click)=\"toggleExpanded()\"></legend>\n <flex-layout-root-widget *ngIf=\"expanded\"\n [layout]=\"layoutNode.items\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\n [style.display]=\"getFlexAttribute('display')\"\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\n [style.justify-content]=\"getFlexAttribute('justify-content')\"\n [style.align-items]=\"getFlexAttribute('align-items')\"\n [style.align-content]=\"getFlexAttribute('align-content')\"\n [fxLayout]=\"getFlexAttribute('layout')\"\n [fxLayoutGap]=\"options?.fxLayoutGap\"\n [fxLayoutAlign]=\"options?.fxLayoutAlign\"\n [attr.fxFlexFill]=\"options?.fxLayoutAlign\"></flex-layout-root-widget>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </fieldset>\n\n <mat-card *ngIf=\"containerType === 'card'\"\n [ngClass]=\"options?.htmlClass || ''\"\n [class.expandable]=\"options?.expandable && !expanded\"\n [class.expanded]=\"options?.expandable && expanded\">\n <mat-card-header *ngIf=\"sectionTitle\">\n <legend\n [class]=\"'legend ' + (options?.labelHtmlClass || '')\"\n [innerHTML]=\"sectionTitle\"\n (click)=\"toggleExpanded()\"></legend>\n </mat-card-header>\n <mat-card-content *ngIf=\"expanded\">\n <fieldset [disabled]=\"options?.readonly\">\n <flex-layout-root-widget *ngIf=\"expanded\"\n [layout]=\"layoutNode.items\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\n [style.display]=\"getFlexAttribute('display')\"\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\n [style.justify-content]=\"getFlexAttribute('justify-content')\"\n [style.align-items]=\"getFlexAttribute('align-items')\"\n [style.align-content]=\"getFlexAttribute('align-content')\"\n [fxLayout]=\"getFlexAttribute('layout')\"\n [fxLayoutGap]=\"options?.fxLayoutGap\"\n [fxLayoutAlign]=\"options?.fxLayoutAlign\"\n [attr.fxFlexFill]=\"options?.fxLayoutAlign\"></flex-layout-root-widget>\n </fieldset>\n </mat-card-content>\n <mat-card-footer>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </mat-card-footer>\n </mat-card>\n\n <mat-expansion-panel *ngIf=\"containerType === 'expansion-panel'\"\n [expanded]=\"expanded\"\n [hideToggle]=\"!options?.expandable\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <legend *ngIf=\"sectionTitle\"\n [class]=\"options?.labelHtmlClass\"\n [innerHTML]=\"sectionTitle\"\n (click)=\"toggleExpanded()\"></legend>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <fieldset [disabled]=\"options?.readonly\">\n <flex-layout-root-widget *ngIf=\"expanded\"\n [layout]=\"layoutNode.items\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [isFlexItem]=\"getFlexAttribute('is-flex')\"\n [class.form-flex-column]=\"getFlexAttribute('flex-direction') === 'column'\"\n [class.form-flex-row]=\"getFlexAttribute('flex-direction') === 'row'\"\n [style.display]=\"getFlexAttribute('display')\"\n [style.flex-direction]=\"getFlexAttribute('flex-direction')\"\n [style.flex-wrap]=\"getFlexAttribute('flex-wrap')\"\n [style.justify-content]=\"getFlexAttribute('justify-content')\"\n [style.align-items]=\"getFlexAttribute('align-items')\"\n [style.align-content]=\"getFlexAttribute('align-content')\"\n [fxLayout]=\"getFlexAttribute('layout')\"\n [fxLayoutGap]=\"options?.fxLayoutGap\"\n [fxLayoutAlign]=\"options?.fxLayoutAlign\"\n [attr.fxFlexFill]=\"options?.fxLayoutAlign\"></flex-layout-root-widget>\n </fieldset>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </mat-expansion-panel>",
436
+ styles: ["\n fieldset { border: 0; margin: 0; padding: 0; }\n .legend { font-weight: bold; }\n .expandable > .legend:before { content: '\u25B6'; padding-right: .3em; }\n .expanded > .legend:before { content: '\u25BC'; padding-right: .2em; }\n "]
437
+ },] }
438
+ ];
439
+ FlexLayoutSectionComponent.ctorParameters = function () { return [
440
+ { type: core$1.JsonSchemaFormService }
441
+ ]; };
442
+ FlexLayoutSectionComponent.propDecorators = {
443
+ layoutNode: [{ type: core.Input }],
444
+ layoutIndex: [{ type: core.Input }],
445
+ dataIndex: [{ type: core.Input }]
446
+ };
447
+
448
+ var MaterialAddReferenceComponent = /** @class */ (function () {
449
+ function MaterialAddReferenceComponent(jsf) {
450
+ this.jsf = jsf;
451
+ }
452
+ MaterialAddReferenceComponent.prototype.ngOnInit = function () {
453
+ this.options = this.layoutNode.options || {};
454
+ };
455
+ Object.defineProperty(MaterialAddReferenceComponent.prototype, "showAddButton", {
456
+ get: function () {
457
+ return !this.layoutNode.arrayItem ||
458
+ this.layoutIndex[this.layoutIndex.length - 1] < this.options.maxItems;
459
+ },
460
+ enumerable: false,
461
+ configurable: true
462
+ });
463
+ MaterialAddReferenceComponent.prototype.addItem = function (event) {
464
+ event.preventDefault();
465
+ this.jsf.addItem(this);
466
+ };
467
+ Object.defineProperty(MaterialAddReferenceComponent.prototype, "buttonText", {
468
+ get: function () {
469
+ var parent = {
470
+ dataIndex: this.dataIndex.slice(0, -1),
471
+ layoutIndex: this.layoutIndex.slice(0, -1),
472
+ layoutNode: this.jsf.getParentNode(this),
473
+ };
474
+ return parent.layoutNode.add ||
475
+ this.jsf.setArrayItemTitle(parent, this.layoutNode, this.itemCount);
476
+ },
477
+ enumerable: false,
478
+ configurable: true
479
+ });
480
+ return MaterialAddReferenceComponent;
481
+ }());
482
+ MaterialAddReferenceComponent.decorators = [
483
+ { type: core.Component, args: [{
484
+ // tslint:disable-next-line:component-selector
485
+ selector: 'material-add-reference-widget',
486
+ template: "\n <section [class]=\"options?.htmlClass || ''\" align=\"end\">\n <button mat-raised-button *ngIf=\"showAddButton\"\n [color]=\"options?.color || 'accent'\"\n [disabled]=\"options?.readonly\"\n (click)=\"addItem($event)\">\n <span *ngIf=\"options?.icon\" [class]=\"options?.icon\"></span>\n <span *ngIf=\"options?.title\" [innerHTML]=\"buttonText\"></span>\n </button>\n </section>",
487
+ changeDetection: core.ChangeDetectionStrategy.Default
488
+ },] }
489
+ ];
490
+ MaterialAddReferenceComponent.ctorParameters = function () { return [
491
+ { type: core$1.JsonSchemaFormService }
492
+ ]; };
493
+ MaterialAddReferenceComponent.propDecorators = {
494
+ layoutNode: [{ type: core.Input }],
495
+ layoutIndex: [{ type: core.Input }],
496
+ dataIndex: [{ type: core.Input }]
497
+ };
498
+
499
+ var MaterialButtonComponent = /** @class */ (function () {
500
+ function MaterialButtonComponent(jsf) {
501
+ this.jsf = jsf;
502
+ this.controlDisabled = false;
503
+ this.boundControl = false;
504
+ }
505
+ MaterialButtonComponent.prototype.ngOnInit = function () {
506
+ var _this = this;
507
+ this.options = this.layoutNode.options || {};
508
+ this.jsf.initializeControl(this);
509
+ if (core$1.hasOwn(this.options, 'disabled')) {
510
+ this.controlDisabled = this.options.disabled;
511
+ }
512
+ else if (this.jsf.formOptions.disableInvalidSubmit) {
513
+ this.controlDisabled = !this.jsf.isValid;
514
+ this.jsf.isValidChanges.subscribe(function (isValid) { return _this.controlDisabled = !isValid; });
515
+ }
516
+ };
517
+ MaterialButtonComponent.prototype.updateValue = function (event) {
518
+ if (typeof this.options.onClick === 'function') {
519
+ this.options.onClick(event);
520
+ }
521
+ else {
522
+ this.jsf.updateValue(this, event.target.value);
523
+ }
524
+ };
525
+ return MaterialButtonComponent;
526
+ }());
527
+ MaterialButtonComponent.decorators = [
528
+ { type: core.Component, args: [{
529
+ // tslint:disable-next-line:component-selector
530
+ selector: 'material-button-widget',
531
+ template: "\n <div class=\"button-row\" [class]=\"options?.htmlClass || ''\">\n <button mat-raised-button\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [color]=\"options?.color || 'primary'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [type]=\"layoutNode?.type\"\n [value]=\"controlValue\"\n (click)=\"updateValue($event)\">\n <mat-icon *ngIf=\"options?.icon\" class=\"mat-24\">{{options?.icon}}</mat-icon>\n <span *ngIf=\"options?.title\" [innerHTML]=\"options?.title\"></span>\n </button>\n </div>",
532
+ styles: [" button { margin-top: 10px; } "]
533
+ },] }
534
+ ];
535
+ MaterialButtonComponent.ctorParameters = function () { return [
536
+ { type: core$1.JsonSchemaFormService }
537
+ ]; };
538
+ MaterialButtonComponent.propDecorators = {
539
+ layoutNode: [{ type: core.Input }],
540
+ layoutIndex: [{ type: core.Input }],
541
+ dataIndex: [{ type: core.Input }]
542
+ };
543
+
544
+ var MaterialButtonGroupComponent = /** @class */ (function () {
545
+ function MaterialButtonGroupComponent(jsf) {
546
+ this.jsf = jsf;
547
+ this.controlDisabled = false;
548
+ this.boundControl = false;
549
+ this.radiosList = [];
550
+ this.vertical = false;
551
+ }
552
+ MaterialButtonGroupComponent.prototype.ngOnInit = function () {
553
+ this.options = this.layoutNode.options || {};
554
+ this.radiosList = core$1.buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
555
+ this.jsf.initializeControl(this);
556
+ };
557
+ MaterialButtonGroupComponent.prototype.updateValue = function (value) {
558
+ this.options.showErrors = true;
559
+ this.jsf.updateValue(this, value);
560
+ };
561
+ return MaterialButtonGroupComponent;
562
+ }());
563
+ MaterialButtonGroupComponent.decorators = [
564
+ { type: core.Component, args: [{
565
+ // tslint:disable-next-line:component-selector
566
+ selector: 'material-button-group-widget',
567
+ template: "\n <div>\n <div *ngIf=\"options?.title\">\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></label>\n </div>\n <mat-button-toggle-group\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [attr.required]=\"options?.required\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [name]=\"controlName\"\n [value]=\"controlValue\"\n [vertical]=\"!!options.vertical\">\n <mat-button-toggle *ngFor=\"let radioItem of radiosList\"\n [id]=\"'control' + layoutNode?._id + '/' + radioItem?.name\"\n [value]=\"radioItem?.value\"\n (click)=\"updateValue(radioItem?.value)\">\n <span [innerHTML]=\"radioItem?.name\"></span>\n </mat-button-toggle>\n </mat-button-toggle-group>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </div>",
568
+ styles: [" mat-error { font-size: 75%; } "]
569
+ },] }
570
+ ];
571
+ MaterialButtonGroupComponent.ctorParameters = function () { return [
572
+ { type: core$1.JsonSchemaFormService }
573
+ ]; };
574
+ MaterialButtonGroupComponent.propDecorators = {
575
+ layoutNode: [{ type: core.Input }],
576
+ layoutIndex: [{ type: core.Input }],
577
+ dataIndex: [{ type: core.Input }]
578
+ };
579
+
580
+ var MaterialCheckboxComponent = /** @class */ (function () {
581
+ function MaterialCheckboxComponent(jsf) {
582
+ this.jsf = jsf;
583
+ this.controlDisabled = false;
584
+ this.boundControl = false;
585
+ this.trueValue = true;
586
+ this.falseValue = false;
587
+ this.showSlideToggle = false;
588
+ }
589
+ MaterialCheckboxComponent.prototype.ngOnInit = function () {
590
+ this.options = this.layoutNode.options || {};
591
+ this.jsf.initializeControl(this, !this.options.readonly);
592
+ if (this.controlValue === null || this.controlValue === undefined) {
593
+ this.controlValue = false;
594
+ this.jsf.updateValue(this, this.falseValue);
595
+ }
596
+ if (this.layoutNode.type === 'slide-toggle' ||
597
+ this.layoutNode.format === 'slide-toggle') {
598
+ this.showSlideToggle = true;
599
+ }
600
+ };
601
+ MaterialCheckboxComponent.prototype.updateValue = function (event) {
602
+ this.options.showErrors = true;
603
+ this.jsf.updateValue(this, event.checked ? this.trueValue : this.falseValue);
604
+ };
605
+ Object.defineProperty(MaterialCheckboxComponent.prototype, "isChecked", {
606
+ get: function () {
607
+ return this.jsf.getFormControlValue(this) === this.trueValue;
608
+ },
609
+ enumerable: false,
610
+ configurable: true
611
+ });
612
+ return MaterialCheckboxComponent;
613
+ }());
614
+ MaterialCheckboxComponent.decorators = [
615
+ { type: core.Component, args: [{
616
+ // tslint:disable-next-line:component-selector
617
+ selector: 'material-checkbox-widget',
618
+ template: "\n <mat-checkbox *ngIf=\"boundControl && !showSlideToggle\"\n [formControl]=\"formControl\"\n align=\"left\"\n [color]=\"options?.color || 'primary'\"\n [id]=\"'control' + layoutNode?._id\"\n labelPosition=\"after\"\n [name]=\"controlName\"\n (blur)=\"options.showErrors = true\">\n <span *ngIf=\"options?.title\"\n class=\"checkbox-name\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></span>\n </mat-checkbox>\n <mat-checkbox *ngIf=\"!boundControl && !showSlideToggle\"\n align=\"left\"\n [color]=\"options?.color || 'primary'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n labelPosition=\"after\"\n [name]=\"controlName\"\n [checked]=\"isChecked\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateValue($event)\">\n <span *ngIf=\"options?.title\"\n class=\"checkbox-name\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></span>\n </mat-checkbox>\n <mat-slide-toggle *ngIf=\"boundControl && showSlideToggle\"\n [formControl]=\"formControl\"\n align=\"left\"\n [color]=\"options?.color || 'primary'\"\n [id]=\"'control' + layoutNode?._id\"\n labelPosition=\"after\"\n [name]=\"controlName\"\n (blur)=\"options.showErrors = true\">\n <span *ngIf=\"options?.title\"\n class=\"checkbox-name\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></span>\n </mat-slide-toggle>\n <mat-slide-toggle *ngIf=\"!boundControl && showSlideToggle\"\n align=\"left\"\n [color]=\"options?.color || 'primary'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n labelPosition=\"after\"\n [name]=\"controlName\"\n [checked]=\"isChecked\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateValue($event)\">\n <span *ngIf=\"options?.title\"\n class=\"checkbox-name\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></span>\n </mat-slide-toggle>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
619
+ styles: ["\n .checkbox-name { white-space: nowrap; }\n mat-error { font-size: 75%; }\n "]
620
+ },] }
621
+ ];
622
+ MaterialCheckboxComponent.ctorParameters = function () { return [
623
+ { type: core$1.JsonSchemaFormService }
624
+ ]; };
625
+ MaterialCheckboxComponent.propDecorators = {
626
+ layoutNode: [{ type: core.Input }],
627
+ layoutIndex: [{ type: core.Input }],
628
+ dataIndex: [{ type: core.Input }]
629
+ };
630
+
631
+ // TODO: Change this to use a Selection List instead?
632
+ // https://material.angular.io/components/list/overview
633
+ var MaterialCheckboxesComponent = /** @class */ (function () {
634
+ function MaterialCheckboxesComponent(jsf) {
635
+ this.jsf = jsf;
636
+ this.controlDisabled = false;
637
+ this.boundControl = false;
638
+ this.horizontalList = false;
639
+ this.checkboxList = [];
640
+ }
641
+ MaterialCheckboxesComponent.prototype.ngOnInit = function () {
642
+ var e_1, _a;
643
+ this.options = this.layoutNode.options || {};
644
+ this.horizontalList = this.layoutNode.type === 'checkboxes-inline' ||
645
+ this.layoutNode.type === 'checkboxbuttons';
646
+ this.jsf.initializeControl(this);
647
+ this.checkboxList = core$1.buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
648
+ if (this.boundControl) {
649
+ var formArray = this.jsf.getFormControl(this);
650
+ try {
651
+ for (var _b = __values(this.checkboxList), _c = _b.next(); !_c.done; _c = _b.next()) {
652
+ var checkboxItem = _c.value;
653
+ checkboxItem.checked = formArray.value.includes(checkboxItem.value);
654
+ }
655
+ }
656
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
657
+ finally {
658
+ try {
659
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
660
+ }
661
+ finally { if (e_1) throw e_1.error; }
662
+ }
663
+ }
664
+ };
665
+ Object.defineProperty(MaterialCheckboxesComponent.prototype, "allChecked", {
666
+ get: function () {
667
+ return this.checkboxList.filter(function (t) { return t.checked; }).length === this.checkboxList.length;
668
+ },
669
+ enumerable: false,
670
+ configurable: true
671
+ });
672
+ Object.defineProperty(MaterialCheckboxesComponent.prototype, "someChecked", {
673
+ get: function () {
674
+ var checkedItems = this.checkboxList.filter(function (t) { return t.checked; }).length;
675
+ return checkedItems > 0 && checkedItems < this.checkboxList.length;
676
+ },
677
+ enumerable: false,
678
+ configurable: true
679
+ });
680
+ MaterialCheckboxesComponent.prototype.updateValue = function () {
681
+ this.options.showErrors = true;
682
+ if (this.boundControl) {
683
+ this.jsf.updateArrayCheckboxList(this, this.checkboxList);
684
+ }
685
+ };
686
+ MaterialCheckboxesComponent.prototype.updateAllValues = function (event) {
687
+ this.options.showErrors = true;
688
+ this.checkboxList.forEach(function (t) { return t.checked = event.checked; });
689
+ this.updateValue();
690
+ };
691
+ return MaterialCheckboxesComponent;
692
+ }());
693
+ MaterialCheckboxesComponent.decorators = [
694
+ { type: core.Component, args: [{
695
+ // tslint:disable-next-line:component-selector
696
+ selector: 'material-checkboxes-widget',
697
+ template: "\n <div>\n <mat-checkbox type=\"checkbox\"\n [checked]=\"allChecked\"\n [color]=\"options?.color || 'primary'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [indeterminate]=\"someChecked\"\n [name]=\"options?.name\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateAllValues($event)\">\n <span class=\"checkbox-name\" [innerHTML]=\"options?.name\"></span>\n </mat-checkbox>\n <label *ngIf=\"options?.title\"\n class=\"title\"\n [class]=\"options?.labelHtmlClass || ''\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></label>\n <ul class=\"checkbox-list\" [class.horizontal-list]=\"horizontalList\">\n <li *ngFor=\"let checkboxItem of checkboxList\"\n [class]=\"options?.htmlClass || ''\">\n <mat-checkbox type=\"checkbox\"\n [(ngModel)]=\"checkboxItem.checked\"\n [color]=\"options?.color || 'primary'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [name]=\"checkboxItem?.name\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateValue()\">\n <span class=\"checkbox-name\" [innerHTML]=\"checkboxItem?.name\"></span>\n </mat-checkbox>\n </li>\n </ul>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </div>",
698
+ styles: ["\n .title { font-weight: bold; }\n .checkbox-list { list-style-type: none; }\n .horizontal-list > li { display: inline-block; margin-right: 10px; zoom: 1; }\n .checkbox-name { white-space: nowrap; }\n mat-error { font-size: 75%; }\n "]
699
+ },] }
700
+ ];
701
+ MaterialCheckboxesComponent.ctorParameters = function () { return [
702
+ { type: core$1.JsonSchemaFormService }
703
+ ]; };
704
+ MaterialCheckboxesComponent.propDecorators = {
705
+ layoutNode: [{ type: core.Input }],
706
+ layoutIndex: [{ type: core.Input }],
707
+ dataIndex: [{ type: core.Input }]
708
+ };
709
+
710
+ // TODO: Add this control
711
+ var MaterialChipListComponent = /** @class */ (function () {
712
+ function MaterialChipListComponent(jsf) {
713
+ this.jsf = jsf;
714
+ this.controlDisabled = false;
715
+ this.boundControl = false;
716
+ }
717
+ MaterialChipListComponent.prototype.ngOnInit = function () {
718
+ this.options = this.layoutNode.options || {};
719
+ this.jsf.initializeControl(this);
720
+ };
721
+ MaterialChipListComponent.prototype.updateValue = function (event) {
722
+ this.jsf.updateValue(this, event.target.value);
723
+ };
724
+ return MaterialChipListComponent;
725
+ }());
726
+ MaterialChipListComponent.decorators = [
727
+ { type: core.Component, args: [{
728
+ // tslint:disable-next-line:component-selector
729
+ selector: 'material-chip-list-widget',
730
+ template: ""
731
+ },] }
732
+ ];
733
+ MaterialChipListComponent.ctorParameters = function () { return [
734
+ { type: core$1.JsonSchemaFormService }
735
+ ]; };
736
+ MaterialChipListComponent.propDecorators = {
737
+ layoutNode: [{ type: core.Input }],
738
+ layoutIndex: [{ type: core.Input }],
739
+ dataIndex: [{ type: core.Input }]
740
+ };
741
+
742
+ var MaterialDatepickerComponent = /** @class */ (function () {
743
+ function MaterialDatepickerComponent(matFormFieldDefaultOptions, jsf) {
744
+ this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
745
+ this.jsf = jsf;
746
+ this.controlDisabled = false;
747
+ this.boundControl = false;
748
+ this.autoCompleteList = [];
749
+ }
750
+ MaterialDatepickerComponent.prototype.ngOnInit = function () {
751
+ this.options = this.layoutNode.options || {};
752
+ this.jsf.initializeControl(this, !this.options.readonly);
753
+ if (!this.options.notitle && !this.options.description && this.options.placeholder) {
754
+ this.options.description = this.options.placeholder;
755
+ }
756
+ };
757
+ return MaterialDatepickerComponent;
758
+ }());
759
+ MaterialDatepickerComponent.decorators = [
760
+ { type: core.Component, args: [{
761
+ // tslint:disable-next-line:component-selector
762
+ selector: 'material-datepicker-widget',
763
+ template: "\n <mat-form-field [appearance]=\"options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'\"\n [class]=\"options?.htmlClass || ''\"\n [floatLabel]=\"options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')\"\n [hideRequiredMarker]=\"options?.hideRequired ? 'true' : 'false'\"\n [style.width]=\"'100%'\">\n <mat-label *ngIf=\"!options?.notitle\">{{options?.title}}</mat-label>\n <span matPrefix *ngIf=\"options?.prefix || options?.fieldAddonLeft\"\n [innerHTML]=\"options?.prefix || options?.fieldAddonLeft\"></span>\n <input matInput *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [id]=\"'control' + layoutNode?._id\"\n [max]=\"options?.maximum\"\n [matDatepicker]=\"picker\"\n [min]=\"options?.minimum\"\n [name]=\"controlName\"\n [placeholder]=\"options?.title\"\n [readonly]=\"options?.readonly\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n (blur)=\"options.showErrors = true\"\n >\n <input matInput *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n [max]=\"options?.maximum\"\n [matDatepicker]=\"picker\"\n [min]=\"options?.minimum\"\n [name]=\"controlName\"\n [placeholder]=\"options?.title\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [readonly]=\"options?.readonly\"\n (blur)=\"options.showErrors = true\"\n >\n <span matSuffix *ngIf=\"options?.suffix || options?.fieldAddonRight\"\n [innerHTML]=\"options?.suffix || options?.fieldAddonRight\"></span>\n <mat-hint *ngIf=\"options?.description && (!options?.showErrors || !options?.errorMessage)\"\n align=\"end\" [innerHTML]=\"options?.description\"></mat-hint>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n </mat-form-field>\n <mat-datepicker #picker ></mat-datepicker>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
764
+ styles: ["\n mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }\n ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex\n .mat-form-field-infix { width: initial; }\n "]
765
+ },] }
766
+ ];
767
+ MaterialDatepickerComponent.ctorParameters = function () { return [
768
+ { type: undefined, decorators: [{ type: core.Inject, args: [formField.MAT_FORM_FIELD_DEFAULT_OPTIONS,] }, { type: core.Optional }] },
769
+ { type: core$1.JsonSchemaFormService }
770
+ ]; };
771
+ MaterialDatepickerComponent.propDecorators = {
772
+ layoutNode: [{ type: core.Input }],
773
+ layoutIndex: [{ type: core.Input }],
774
+ dataIndex: [{ type: core.Input }]
775
+ };
776
+
777
+ var MaterialDesignFrameworkComponent = /** @class */ (function () {
778
+ function MaterialDesignFrameworkComponent(changeDetector, jsf) {
779
+ this.changeDetector = changeDetector;
780
+ this.jsf = jsf;
781
+ this.frameworkInitialized = false;
782
+ this.formControl = null;
783
+ this.parentArray = null;
784
+ this.isOrderable = false;
785
+ this.dynamicTitle = null;
786
+ }
787
+ Object.defineProperty(MaterialDesignFrameworkComponent.prototype, "showRemoveButton", {
788
+ get: function () {
789
+ if (!this.layoutNode || !this.widgetOptions.removable ||
790
+ this.widgetOptions.readonly || this.layoutNode.type === '$ref') {
791
+ return false;
792
+ }
793
+ if (this.layoutNode.recursiveReference) {
794
+ return true;
795
+ }
796
+ if (!this.layoutNode.arrayItem || !this.parentArray) {
797
+ return false;
798
+ }
799
+ // If array length <= minItems, don't allow removing any items
800
+ return this.parentArray.items.length - 1 <= this.parentArray.options.minItems ? false :
801
+ // For removable list items, allow removing any item
802
+ this.layoutNode.arrayItemType === 'list' ? true :
803
+ // For removable tuple items, only allow removing last item in list
804
+ this.layoutIndex[this.layoutIndex.length - 1] === this.parentArray.items.length - 2;
805
+ },
806
+ enumerable: false,
807
+ configurable: true
808
+ });
809
+ MaterialDesignFrameworkComponent.prototype.ngOnInit = function () {
810
+ this.initializeFramework();
811
+ };
812
+ MaterialDesignFrameworkComponent.prototype.ngOnChanges = function () {
813
+ if (!this.frameworkInitialized) {
814
+ this.initializeFramework();
815
+ }
816
+ if (this.dynamicTitle) {
817
+ this.updateTitle();
818
+ }
819
+ };
820
+ MaterialDesignFrameworkComponent.prototype.initializeFramework = function () {
821
+ if (this.layoutNode) {
822
+ this.options = cloneDeep__default["default"](this.layoutNode.options || {});
823
+ this.widgetLayoutNode = Object.assign(Object.assign({}, this.layoutNode), { options: cloneDeep__default["default"](this.layoutNode.options || {}) });
824
+ this.widgetOptions = this.widgetLayoutNode.options;
825
+ this.formControl = this.jsf.getFormControl(this);
826
+ if (core$1.isDefined(this.widgetOptions.minimum) &&
827
+ core$1.isDefined(this.widgetOptions.maximum) &&
828
+ this.widgetOptions.multipleOf >= 1) {
829
+ this.layoutNode.type = 'range';
830
+ }
831
+ if (!['$ref', 'advancedfieldset', 'authfieldset', 'button', 'card',
832
+ 'checkbox', 'expansion-panel', 'help', 'message', 'msg', 'section',
833
+ 'submit', 'tabarray', 'tabs'].includes(this.layoutNode.type) &&
834
+ /{{.+?}}/.test(this.widgetOptions.title || '')) {
835
+ this.dynamicTitle = this.widgetOptions.title;
836
+ this.updateTitle();
837
+ }
838
+ if (this.layoutNode.arrayItem && this.layoutNode.type !== '$ref') {
839
+ this.parentArray = this.jsf.getParentNode(this);
840
+ if (this.parentArray) {
841
+ this.isOrderable =
842
+ this.parentArray.type.slice(0, 3) !== 'tab' &&
843
+ this.layoutNode.arrayItemType === 'list' &&
844
+ !this.widgetOptions.readonly &&
845
+ this.parentArray.options.orderable;
846
+ }
847
+ }
848
+ this.frameworkInitialized = true;
849
+ }
850
+ else {
851
+ this.options = {};
852
+ }
853
+ };
854
+ MaterialDesignFrameworkComponent.prototype.updateTitle = function () {
855
+ this.widgetLayoutNode.options.title = this.jsf.parseText(this.dynamicTitle, this.jsf.getFormControlValue(this), this.jsf.getFormControlGroup(this).value, this.dataIndex[this.dataIndex.length - 1]);
856
+ };
857
+ MaterialDesignFrameworkComponent.prototype.removeItem = function () {
858
+ this.jsf.removeItem(this);
859
+ };
860
+ return MaterialDesignFrameworkComponent;
861
+ }());
862
+ MaterialDesignFrameworkComponent.decorators = [
863
+ { type: core.Component, args: [{
864
+ // tslint:disable-next-line:component-selector
865
+ selector: 'material-design-framework',
866
+ template: "<div\n [class.array-item]=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"\n [orderable]=\"isOrderable\"\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\">\n <svg *ngIf=\"showRemoveButton\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"18\" width=\"18\" viewBox=\"0 0 24 24\"\n class=\"close-button\"\n (click)=\"removeItem()\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"/>\n </svg>\n <select-widget-widget\n [dataIndex]=\"dataIndex\"\n [layoutIndex]=\"layoutIndex\"\n [layoutNode]=\"widgetLayoutNode\"></select-widget-widget>\n</div>\n<div class=\"spacer\" *ngIf=\"widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'\"></div>\n",
867
+ styles: [".array-item{border-radius:2px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;padding:6px;position:relative;transition:all .28s cubic-bezier(.4,0,.2,1)}.close-button{cursor:pointer;position:absolute;top:6px;right:6px;fill:#0006;visibility:hidden;z-index:500}.close-button:hover{fill:#000c}.array-item:hover>.close-button{visibility:visible}.spacer{margin:6px 0}[draggable=true]:hover{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;cursor:move;z-index:10}[draggable=true].drag-target-top{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom{box-shadow:0 2px #000;position:relative;z-index:20}\n"]
868
+ },] }
869
+ ];
870
+ MaterialDesignFrameworkComponent.ctorParameters = function () { return [
871
+ { type: core.ChangeDetectorRef },
872
+ { type: core$1.JsonSchemaFormService }
873
+ ]; };
874
+ MaterialDesignFrameworkComponent.propDecorators = {
875
+ layoutNode: [{ type: core.Input }],
876
+ layoutIndex: [{ type: core.Input }],
877
+ dataIndex: [{ type: core.Input }]
878
+ };
879
+
880
+ // TODO: Add this control
881
+ var MaterialFileComponent = /** @class */ (function () {
882
+ function MaterialFileComponent(jsf) {
883
+ this.jsf = jsf;
884
+ this.controlDisabled = false;
885
+ this.boundControl = false;
886
+ }
887
+ MaterialFileComponent.prototype.ngOnInit = function () {
888
+ this.options = this.layoutNode.options || {};
889
+ this.jsf.initializeControl(this);
890
+ };
891
+ MaterialFileComponent.prototype.updateValue = function (event) {
892
+ this.jsf.updateValue(this, event.target.value);
893
+ };
894
+ return MaterialFileComponent;
895
+ }());
896
+ MaterialFileComponent.decorators = [
897
+ { type: core.Component, args: [{
898
+ // tslint:disable-next-line:component-selector
899
+ selector: 'material-file-widget',
900
+ template: ""
901
+ },] }
902
+ ];
903
+ MaterialFileComponent.ctorParameters = function () { return [
904
+ { type: core$1.JsonSchemaFormService }
905
+ ]; };
906
+ MaterialFileComponent.propDecorators = {
907
+ layoutNode: [{ type: core.Input }],
908
+ layoutIndex: [{ type: core.Input }],
909
+ dataIndex: [{ type: core.Input }]
910
+ };
911
+
912
+ var MaterialInputComponent = /** @class */ (function () {
913
+ function MaterialInputComponent(matFormFieldDefaultOptions, jsf) {
914
+ this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
915
+ this.jsf = jsf;
916
+ this.controlDisabled = false;
917
+ this.boundControl = false;
918
+ this.autoCompleteList = [];
919
+ }
920
+ MaterialInputComponent.prototype.ngOnInit = function () {
921
+ this.options = this.layoutNode.options || {};
922
+ this.jsf.initializeControl(this);
923
+ if (!this.options.notitle && !this.options.description && this.options.placeholder) {
924
+ this.options.description = this.options.placeholder;
925
+ }
926
+ };
927
+ MaterialInputComponent.prototype.updateValue = function (event) {
928
+ this.jsf.updateValue(this, event.target.value);
929
+ };
930
+ return MaterialInputComponent;
931
+ }());
932
+ MaterialInputComponent.decorators = [
933
+ { type: core.Component, args: [{
934
+ // tslint:disable-next-line:component-selector
935
+ selector: 'material-input-widget',
936
+ template: "\n <mat-form-field [appearance]=\"options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'\"\n [class]=\"options?.htmlClass || ''\"\n [floatLabel]=\"options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')\"\n [hideRequiredMarker]=\"options?.hideRequired ? 'true' : 'false'\"\n [style.width]=\"'100%'\">\n <mat-label *ngIf=\"!options?.notitle\">{{options?.title}}</mat-label>\n <span matPrefix *ngIf=\"options?.prefix || options?.fieldAddonLeft\"\n [innerHTML]=\"options?.prefix || options?.fieldAddonLeft\"></span>\n <input matInput *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.maxlength]=\"options?.maxLength\"\n [attr.minlength]=\"options?.minLength\"\n [attr.pattern]=\"options?.pattern\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [type]=\"layoutNode?.type\"\n (blur)=\"options.showErrors = true\">\n <input matInput *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.maxlength]=\"options?.maxLength\"\n [attr.minlength]=\"options?.minLength\"\n [attr.pattern]=\"options?.pattern\"\n [disabled]=\"controlDisabled\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [type]=\"layoutNode?.type\"\n [value]=\"controlValue\"\n (input)=\"updateValue($event)\"\n (blur)=\"options.showErrors = true\">\n <span matSuffix *ngIf=\"options?.suffix || options?.fieldAddonRight\"\n [innerHTML]=\"options?.suffix || options?.fieldAddonRight\"></span>\n <mat-hint *ngIf=\"options?.description && (!options?.showErrors || !options?.errorMessage)\"\n align=\"end\" [innerHTML]=\"options?.description\"></mat-hint>\n <mat-autocomplete *ngIf=\"options?.typeahead?.source\">\n <mat-option *ngFor=\"let word of options?.typeahead?.source\"\n [value]=\"word\">{{word}}</mat-option>\n </mat-autocomplete>\n </mat-form-field>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
937
+ styles: ["\n mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }\n ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex\n .mat-form-field-infix { width: initial; }\n "]
938
+ },] }
939
+ ];
940
+ MaterialInputComponent.ctorParameters = function () { return [
941
+ { type: undefined, decorators: [{ type: core.Inject, args: [formField.MAT_FORM_FIELD_DEFAULT_OPTIONS,] }, { type: core.Optional }] },
942
+ { type: core$1.JsonSchemaFormService }
943
+ ]; };
944
+ MaterialInputComponent.propDecorators = {
945
+ layoutNode: [{ type: core.Input }],
946
+ layoutIndex: [{ type: core.Input }],
947
+ dataIndex: [{ type: core.Input }]
948
+ };
949
+
950
+ var MaterialNumberComponent = /** @class */ (function () {
951
+ function MaterialNumberComponent(matFormFieldDefaultOptions, jsf) {
952
+ this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
953
+ this.jsf = jsf;
954
+ this.controlDisabled = false;
955
+ this.boundControl = false;
956
+ this.allowNegative = true;
957
+ this.allowDecimal = true;
958
+ this.allowExponents = false;
959
+ this.lastValidNumber = '';
960
+ }
961
+ MaterialNumberComponent.prototype.ngOnInit = function () {
962
+ this.options = this.layoutNode.options || {};
963
+ this.jsf.initializeControl(this);
964
+ if (this.layoutNode.dataType === 'integer') {
965
+ this.allowDecimal = false;
966
+ }
967
+ if (!this.options.notitle && !this.options.description && this.options.placeholder) {
968
+ this.options.description = this.options.placeholder;
969
+ }
970
+ };
971
+ MaterialNumberComponent.prototype.updateValue = function (event) {
972
+ this.jsf.updateValue(this, event.target.value);
973
+ };
974
+ return MaterialNumberComponent;
975
+ }());
976
+ MaterialNumberComponent.decorators = [
977
+ { type: core.Component, args: [{
978
+ // tslint:disable-next-line:component-selector
979
+ selector: 'material-number-widget',
980
+ template: "\n <mat-form-field [appearance]=\"options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'\"\n [class]=\"options?.htmlClass || ''\"\n [floatLabel]=\"options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')\"\n [hideRequiredMarker]=\"options?.hideRequired ? 'true' : 'false'\"\n [style.width]=\"'100%'\">\n <mat-label *ngIf=\"!options?.notitle\">{{options?.title}}</mat-label>\n <span matPrefix *ngIf=\"options?.prefix || options?.fieldAddonLeft\"\n [innerHTML]=\"options?.prefix || options?.fieldAddonLeft\"></span>\n <input matInput *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.max]=\"options?.maximum\"\n [attr.min]=\"options?.minimum\"\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [type]=\"'number'\"\n (blur)=\"options.showErrors = true\">\n <input matInput *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.max]=\"options?.maximum\"\n [attr.min]=\"options?.minimum\"\n [attr.step]=\"options?.multipleOf || options?.step || 'any'\"\n [disabled]=\"controlDisabled\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [type]=\"'number'\"\n [value]=\"controlValue\"\n (input)=\"updateValue($event)\"\n (blur)=\"options.showErrors = true\">\n <span matSuffix *ngIf=\"options?.suffix || options?.fieldAddonRight\"\n [innerHTML]=\"options?.suffix || options?.fieldAddonRight\"></span>\n <mat-hint *ngIf=\"layoutNode?.type === 'range'\" align=\"start\"\n [innerHTML]=\"controlValue\"></mat-hint>\n <mat-hint *ngIf=\"options?.description && (!options?.showErrors || !options?.errorMessage)\"\n align=\"end\" [innerHTML]=\"options?.description\"></mat-hint>\n </mat-form-field>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
981
+ styles: ["\n mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }\n ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex\n .mat-form-field-infix { width: initial; }\n "]
982
+ },] }
983
+ ];
984
+ MaterialNumberComponent.ctorParameters = function () { return [
985
+ { type: undefined, decorators: [{ type: core.Inject, args: [formField.MAT_FORM_FIELD_DEFAULT_OPTIONS,] }, { type: core.Optional }] },
986
+ { type: core$1.JsonSchemaFormService }
987
+ ]; };
988
+ MaterialNumberComponent.propDecorators = {
989
+ layoutNode: [{ type: core.Input }],
990
+ layoutIndex: [{ type: core.Input }],
991
+ dataIndex: [{ type: core.Input }]
992
+ };
993
+
994
+ // TODO: Add this control
995
+ var MaterialOneOfComponent = /** @class */ (function () {
996
+ function MaterialOneOfComponent(jsf) {
997
+ this.jsf = jsf;
998
+ this.controlDisabled = false;
999
+ this.boundControl = false;
1000
+ }
1001
+ MaterialOneOfComponent.prototype.ngOnInit = function () {
1002
+ this.options = this.layoutNode.options || {};
1003
+ this.jsf.initializeControl(this);
1004
+ };
1005
+ MaterialOneOfComponent.prototype.updateValue = function (event) {
1006
+ this.jsf.updateValue(this, event.target.value);
1007
+ };
1008
+ return MaterialOneOfComponent;
1009
+ }());
1010
+ MaterialOneOfComponent.decorators = [
1011
+ { type: core.Component, args: [{
1012
+ // tslint:disable-next-line:component-selector
1013
+ selector: 'material-one-of-widget',
1014
+ template: ""
1015
+ },] }
1016
+ ];
1017
+ MaterialOneOfComponent.ctorParameters = function () { return [
1018
+ { type: core$1.JsonSchemaFormService }
1019
+ ]; };
1020
+ MaterialOneOfComponent.propDecorators = {
1021
+ layoutNode: [{ type: core.Input }],
1022
+ layoutIndex: [{ type: core.Input }],
1023
+ dataIndex: [{ type: core.Input }]
1024
+ };
1025
+
1026
+ var MaterialRadiosComponent = /** @class */ (function () {
1027
+ function MaterialRadiosComponent(jsf) {
1028
+ this.jsf = jsf;
1029
+ this.controlDisabled = false;
1030
+ this.boundControl = false;
1031
+ this.flexDirection = 'column';
1032
+ this.radiosList = [];
1033
+ }
1034
+ MaterialRadiosComponent.prototype.ngOnInit = function () {
1035
+ this.options = this.layoutNode.options || {};
1036
+ if (this.layoutNode.type === 'radios-inline') {
1037
+ this.flexDirection = 'row';
1038
+ }
1039
+ this.radiosList = core$1.buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true);
1040
+ this.jsf.initializeControl(this, !this.options.readonly);
1041
+ };
1042
+ MaterialRadiosComponent.prototype.updateValue = function (value) {
1043
+ this.options.showErrors = true;
1044
+ this.jsf.updateValue(this, value);
1045
+ };
1046
+ return MaterialRadiosComponent;
1047
+ }());
1048
+ MaterialRadiosComponent.decorators = [
1049
+ { type: core.Component, args: [{
1050
+ // tslint:disable-next-line:component-selector
1051
+ selector: 'material-radios-widget',
1052
+ template: "\n <div>\n <div *ngIf=\"options?.title\">\n <label\n [attr.for]=\"'control' + layoutNode?._id\"\n [class]=\"options?.labelHtmlClass || ''\"\n [style.display]=\"options?.notitle ? 'none' : ''\"\n [innerHTML]=\"options?.title\"></label>\n </div>\n <mat-radio-group *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [attr.required]=\"options?.required\"\n [style.flex-direction]=\"flexDirection\"\n [name]=\"controlName\"\n (blur)=\"options.showErrors = true\">\n <mat-radio-button *ngFor=\"let radioItem of radiosList\"\n [id]=\"'control' + layoutNode?._id + '/' + radioItem?.name\"\n [value]=\"radioItem?.value\">\n <span [innerHTML]=\"radioItem?.name\"></span>\n </mat-radio-button>\n </mat-radio-group>\n <mat-radio-group *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.readonly]=\"options?.readonly ? 'readonly' : null\"\n [attr.required]=\"options?.required\"\n [style.flex-direction]=\"flexDirection\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [name]=\"controlName\"\n [value]=\"controlValue\">\n <mat-radio-button *ngFor=\"let radioItem of radiosList\"\n [id]=\"'control' + layoutNode?._id + '/' + radioItem?.name\"\n [value]=\"radioItem?.value\"\n (click)=\"updateValue(radioItem?.value)\">\n <span [innerHTML]=\"radioItem?.name\"></span>\n </mat-radio-button>\n </mat-radio-group>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>\n </div>",
1053
+ styles: ["\n mat-radio-group { display: inline-flex; }\n mat-radio-button { margin: 2px; }\n mat-error { font-size: 75%; }\n "]
1054
+ },] }
1055
+ ];
1056
+ MaterialRadiosComponent.ctorParameters = function () { return [
1057
+ { type: core$1.JsonSchemaFormService }
1058
+ ]; };
1059
+ MaterialRadiosComponent.propDecorators = {
1060
+ layoutNode: [{ type: core.Input }],
1061
+ layoutIndex: [{ type: core.Input }],
1062
+ dataIndex: [{ type: core.Input }]
1063
+ };
1064
+
1065
+ var MaterialSelectComponent = /** @class */ (function () {
1066
+ function MaterialSelectComponent(matFormFieldDefaultOptions, jsf) {
1067
+ this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
1068
+ this.jsf = jsf;
1069
+ this.controlDisabled = false;
1070
+ this.boundControl = false;
1071
+ this.selectList = [];
1072
+ this.isArray = core$1.isArray;
1073
+ }
1074
+ MaterialSelectComponent.prototype.ngOnInit = function () {
1075
+ this.options = this.layoutNode.options || {};
1076
+ this.selectList = core$1.buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, !!this.options.required, !!this.options.flatList);
1077
+ this.jsf.initializeControl(this, !this.options.readonly);
1078
+ if (!this.options.notitle && !this.options.description && this.options.placeholder) {
1079
+ this.options.description = this.options.placeholder;
1080
+ }
1081
+ };
1082
+ MaterialSelectComponent.prototype.updateValue = function (event) {
1083
+ this.options.showErrors = true;
1084
+ this.jsf.updateValue(this, event.value);
1085
+ };
1086
+ return MaterialSelectComponent;
1087
+ }());
1088
+ MaterialSelectComponent.decorators = [
1089
+ { type: core.Component, args: [{
1090
+ // tslint:disable-next-line:component-selector
1091
+ selector: 'material-select-widget',
1092
+ template: "\n <mat-form-field\n [appearance]=\"options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'\"\n [class]=\"options?.htmlClass || ''\"\n [floatLabel]=\"options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')\"\n [hideRequiredMarker]=\"options?.hideRequired ? 'true' : 'false'\"\n [style.width]=\"'100%'\">\n <mat-label *ngIf=\"!options?.notitle\">{{options?.title}}</mat-label>\n <span matPrefix *ngIf=\"options?.prefix || options?.fieldAddonLeft\"\n [innerHTML]=\"options?.prefix || options?.fieldAddonLeft\"></span>\n <mat-select *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.name]=\"controlName\"\n [id]=\"'control' + layoutNode?._id\"\n [multiple]=\"options?.multiple\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n (blur)=\"options.showErrors = true\">\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\n <mat-option *ngIf=\"!isArray(selectItem?.items)\"\n [value]=\"selectItem?.value\">\n <span [innerHTML]=\"selectItem?.name\"></span>\n </mat-option>\n <mat-optgroup *ngIf=\"isArray(selectItem?.items)\"\n [label]=\"selectItem?.group\">\n <mat-option *ngFor=\"let subItem of selectItem.items\"\n [value]=\"subItem?.value\">\n <span [innerHTML]=\"subItem?.name\"></span>\n </mat-option>\n </mat-optgroup>\n </ng-template>\n </mat-select>\n <mat-select *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.name]=\"controlName\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n [multiple]=\"options?.multiple\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [required]=\"options?.required\"\n [style.width]=\"'100%'\"\n [value]=\"controlValue\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateValue($event)\">\n <ng-template ngFor let-selectItem [ngForOf]=\"selectList\">\n <mat-option *ngIf=\"!isArray(selectItem?.items)\"\n [attr.selected]=\"selectItem?.value === controlValue\"\n [value]=\"selectItem?.value\">\n <span [innerHTML]=\"selectItem?.name\"></span>\n </mat-option>\n <mat-optgroup *ngIf=\"isArray(selectItem?.items)\"\n [label]=\"selectItem?.group\">\n <mat-option *ngFor=\"let subItem of selectItem.items\"\n [attr.selected]=\"subItem?.value === controlValue\"\n [value]=\"subItem?.value\">\n <span [innerHTML]=\"subItem?.name\"></span>\n </mat-option>\n </mat-optgroup>\n </ng-template>\n </mat-select>\n <span matSuffix *ngIf=\"options?.suffix || options?.fieldAddonRight\"\n [innerHTML]=\"options?.suffix || options?.fieldAddonRight\"></span>\n <mat-hint *ngIf=\"options?.description && (!options?.showErrors || !options?.errorMessage)\"\n align=\"end\" [innerHTML]=\"options?.description\"></mat-hint>\n </mat-form-field>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
1093
+ styles: ["\n mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }\n ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex\n .mat-form-field-infix { width: initial; }\n "]
1094
+ },] }
1095
+ ];
1096
+ MaterialSelectComponent.ctorParameters = function () { return [
1097
+ { type: undefined, decorators: [{ type: core.Inject, args: [formField.MAT_FORM_FIELD_DEFAULT_OPTIONS,] }, { type: core.Optional }] },
1098
+ { type: core$1.JsonSchemaFormService }
1099
+ ]; };
1100
+ MaterialSelectComponent.propDecorators = {
1101
+ layoutNode: [{ type: core.Input }],
1102
+ layoutIndex: [{ type: core.Input }],
1103
+ dataIndex: [{ type: core.Input }]
1104
+ };
1105
+
1106
+ var MaterialSliderComponent = /** @class */ (function () {
1107
+ function MaterialSliderComponent(jsf) {
1108
+ this.jsf = jsf;
1109
+ this.controlDisabled = false;
1110
+ this.boundControl = false;
1111
+ this.allowNegative = true;
1112
+ this.allowDecimal = true;
1113
+ this.allowExponents = false;
1114
+ this.lastValidNumber = '';
1115
+ }
1116
+ MaterialSliderComponent.prototype.ngOnInit = function () {
1117
+ this.options = this.layoutNode.options || {};
1118
+ this.jsf.initializeControl(this, !this.options.readonly);
1119
+ };
1120
+ MaterialSliderComponent.prototype.updateValue = function (event) {
1121
+ this.options.showErrors = true;
1122
+ this.jsf.updateValue(this, event.value);
1123
+ };
1124
+ return MaterialSliderComponent;
1125
+ }());
1126
+ MaterialSliderComponent.decorators = [
1127
+ { type: core.Component, args: [{
1128
+ // tslint:disable-next-line:component-selector
1129
+ selector: 'material-slider-widget',
1130
+ template: "\n <mat-slider thumbLabel *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [id]=\"'control' + layoutNode?._id\"\n [max]=\"options?.maximum\"\n [min]=\"options?.minimum\"\n [step]=\"options?.multipleOf || options?.step || 'any'\"\n [style.width]=\"'100%'\"\n (blur)=\"options.showErrors = true\"></mat-slider>\n <mat-slider thumbLabel *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [disabled]=\"controlDisabled || options?.readonly\"\n [id]=\"'control' + layoutNode?._id\"\n [max]=\"options?.maximum\"\n [min]=\"options?.minimum\"\n [step]=\"options?.multipleOf || options?.step || 'any'\"\n [style.width]=\"'100%'\"\n [value]=\"controlValue\"\n (blur)=\"options.showErrors = true\"\n (change)=\"updateValue($event)\"></mat-slider>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
1131
+ styles: [" mat-error { font-size: 75%; } "]
1132
+ },] }
1133
+ ];
1134
+ MaterialSliderComponent.ctorParameters = function () { return [
1135
+ { type: core$1.JsonSchemaFormService }
1136
+ ]; };
1137
+ MaterialSliderComponent.propDecorators = {
1138
+ layoutNode: [{ type: core.Input }],
1139
+ layoutIndex: [{ type: core.Input }],
1140
+ dataIndex: [{ type: core.Input }]
1141
+ };
1142
+
1143
+ // TODO: Add this control
1144
+ var MaterialStepperComponent = /** @class */ (function () {
1145
+ function MaterialStepperComponent(jsf) {
1146
+ this.jsf = jsf;
1147
+ this.controlDisabled = false;
1148
+ this.boundControl = false;
1149
+ }
1150
+ MaterialStepperComponent.prototype.ngOnInit = function () {
1151
+ this.options = this.layoutNode.options || {};
1152
+ this.jsf.initializeControl(this);
1153
+ };
1154
+ MaterialStepperComponent.prototype.updateValue = function (event) {
1155
+ this.jsf.updateValue(this, event.target.value);
1156
+ };
1157
+ return MaterialStepperComponent;
1158
+ }());
1159
+ MaterialStepperComponent.decorators = [
1160
+ { type: core.Component, args: [{
1161
+ // tslint:disable-next-line:component-selector
1162
+ selector: 'material-stepper-widget',
1163
+ template: ""
1164
+ },] }
1165
+ ];
1166
+ MaterialStepperComponent.ctorParameters = function () { return [
1167
+ { type: core$1.JsonSchemaFormService }
1168
+ ]; };
1169
+ MaterialStepperComponent.propDecorators = {
1170
+ layoutNode: [{ type: core.Input }],
1171
+ layoutIndex: [{ type: core.Input }],
1172
+ dataIndex: [{ type: core.Input }]
1173
+ };
1174
+
1175
+ var MaterialTabsComponent = /** @class */ (function () {
1176
+ function MaterialTabsComponent(jsf) {
1177
+ this.jsf = jsf;
1178
+ this.selectedItem = 0;
1179
+ this.showAddTab = true;
1180
+ }
1181
+ MaterialTabsComponent.prototype.ngOnInit = function () {
1182
+ this.options = this.layoutNode.options || {};
1183
+ this.itemCount = this.layoutNode.items.length - 1;
1184
+ this.updateControl();
1185
+ };
1186
+ MaterialTabsComponent.prototype.select = function (index) {
1187
+ if (this.layoutNode.items[index].type === '$ref') {
1188
+ this.jsf.addItem({
1189
+ layoutNode: this.layoutNode.items[index],
1190
+ layoutIndex: this.layoutIndex.concat(index),
1191
+ dataIndex: this.dataIndex.concat(index)
1192
+ });
1193
+ this.updateControl();
1194
+ }
1195
+ this.selectedItem = index;
1196
+ };
1197
+ MaterialTabsComponent.prototype.updateControl = function () {
1198
+ this.itemCount = this.layoutNode.items.length - 1;
1199
+ var lastItem = this.layoutNode.items[this.layoutNode.items.length - 1];
1200
+ this.showAddTab = lastItem.type === '$ref' &&
1201
+ this.itemCount < (lastItem.options.maxItems || 1000);
1202
+ };
1203
+ MaterialTabsComponent.prototype.setTabTitle = function (item, index) {
1204
+ return this.jsf.setArrayItemTitle(this, item, index);
1205
+ };
1206
+ return MaterialTabsComponent;
1207
+ }());
1208
+ MaterialTabsComponent.decorators = [
1209
+ { type: core.Component, args: [{
1210
+ // tslint:disable-next-line:component-selector
1211
+ selector: 'material-tabs-widget',
1212
+ template: "\n <nav mat-tab-nav-bar\n [attr.aria-label]=\"options?.label || options?.title || ''\"\n [style.width]=\"'100%'\">\n <a mat-tab-link *ngFor=\"let item of layoutNode?.items; let i = index\"\n [active]=\"selectedItem === i\"\n (click)=\"select(i)\">\n <span *ngIf=\"showAddTab || item.type !== '$ref'\"\n [innerHTML]=\"setTabTitle(item, i)\"></span>\n </a>\n </nav>\n <div *ngFor=\"let layoutItem of layoutNode?.items; let i = index\"\n [class]=\"options?.htmlClass || ''\">\n <select-framework-widget *ngIf=\"selectedItem === i\"\n [class]=\"(options?.fieldHtmlClass || '') + ' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')\"\n [dataIndex]=\"layoutNode?.dataType === 'array' ? (dataIndex || []).concat(i) : dataIndex\"\n [layoutIndex]=\"(layoutIndex || []).concat(i)\"\n [layoutNode]=\"layoutItem\"></select-framework-widget>\n </div>",
1213
+ styles: [" a { cursor: pointer; } "]
1214
+ },] }
1215
+ ];
1216
+ MaterialTabsComponent.ctorParameters = function () { return [
1217
+ { type: core$1.JsonSchemaFormService }
1218
+ ]; };
1219
+ MaterialTabsComponent.propDecorators = {
1220
+ layoutNode: [{ type: core.Input }],
1221
+ layoutIndex: [{ type: core.Input }],
1222
+ dataIndex: [{ type: core.Input }]
1223
+ };
1224
+
1225
+ var MaterialTextareaComponent = /** @class */ (function () {
1226
+ function MaterialTextareaComponent(matFormFieldDefaultOptions, jsf) {
1227
+ this.matFormFieldDefaultOptions = matFormFieldDefaultOptions;
1228
+ this.jsf = jsf;
1229
+ this.controlDisabled = false;
1230
+ this.boundControl = false;
1231
+ }
1232
+ MaterialTextareaComponent.prototype.ngOnInit = function () {
1233
+ this.options = this.layoutNode.options || {};
1234
+ this.jsf.initializeControl(this);
1235
+ if (!this.options.notitle && !this.options.description && this.options.placeholder) {
1236
+ this.options.description = this.options.placeholder;
1237
+ }
1238
+ };
1239
+ MaterialTextareaComponent.prototype.updateValue = function (event) {
1240
+ this.jsf.updateValue(this, event.target.value);
1241
+ };
1242
+ return MaterialTextareaComponent;
1243
+ }());
1244
+ MaterialTextareaComponent.decorators = [
1245
+ { type: core.Component, args: [{
1246
+ // tslint:disable-next-line:component-selector
1247
+ selector: 'material-textarea-widget',
1248
+ template: "\n <mat-form-field [appearance]=\"options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'\"\n [class]=\"options?.htmlClass || ''\"\n [floatLabel]=\"options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')\"\n [hideRequiredMarker]=\"options?.hideRequired ? 'true' : 'false'\"\n [style.width]=\"'100%'\">\n <mat-label *ngIf=\"!options?.notitle\">{{options?.title}}</mat-label>\n <span matPrefix *ngIf=\"options?.prefix || options?.fieldAddonLeft\"\n [innerHTML]=\"options?.prefix || options?.fieldAddonLeft\"></span>\n <textarea matInput *ngIf=\"boundControl\"\n [formControl]=\"formControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.maxlength]=\"options?.maxLength\"\n [attr.minlength]=\"options?.minLength\"\n [attr.pattern]=\"options?.pattern\"\n [required]=\"options?.required\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [style.width]=\"'100%'\"\n (blur)=\"options.showErrors = true\"></textarea>\n <textarea matInput *ngIf=\"!boundControl\"\n [attr.aria-describedby]=\"'control' + layoutNode?._id + 'Status'\"\n [attr.list]=\"'control' + layoutNode?._id + 'Autocomplete'\"\n [attr.maxlength]=\"options?.maxLength\"\n [attr.minlength]=\"options?.minLength\"\n [attr.pattern]=\"options?.pattern\"\n [required]=\"options?.required\"\n [disabled]=\"controlDisabled\"\n [id]=\"'control' + layoutNode?._id\"\n [name]=\"controlName\"\n [placeholder]=\"options?.notitle ? options?.placeholder : options?.title\"\n [readonly]=\"options?.readonly ? 'readonly' : null\"\n [style.width]=\"'100%'\"\n [value]=\"controlValue\"\n (input)=\"updateValue($event)\"\n (blur)=\"options.showErrors = true\"></textarea>\n <span matSuffix *ngIf=\"options?.suffix || options?.fieldAddonRight\"\n [innerHTML]=\"options?.suffix || options?.fieldAddonRight\"></span>\n <mat-hint *ngIf=\"options?.description && (!options?.showErrors || !options?.errorMessage)\"\n align=\"end\" [innerHTML]=\"options?.description\"></mat-hint>\n </mat-form-field>\n <mat-error *ngIf=\"options?.showErrors && options?.errorMessage\"\n [innerHTML]=\"options?.errorMessage\"></mat-error>",
1249
+ styles: ["\n mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }\n ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex\n .mat-form-field-infix { width: initial; }\n "]
1250
+ },] }
1251
+ ];
1252
+ MaterialTextareaComponent.ctorParameters = function () { return [
1253
+ { type: undefined, decorators: [{ type: core.Inject, args: [formField.MAT_FORM_FIELD_DEFAULT_OPTIONS,] }, { type: core.Optional }] },
1254
+ { type: core$1.JsonSchemaFormService }
1255
+ ]; };
1256
+ MaterialTextareaComponent.propDecorators = {
1257
+ layoutNode: [{ type: core.Input }],
1258
+ layoutIndex: [{ type: core.Input }],
1259
+ dataIndex: [{ type: core.Input }]
1260
+ };
1261
+
1262
+ var MATERIAL_FRAMEWORK_COMPONENTS = [
1263
+ FlexLayoutRootComponent, FlexLayoutSectionComponent,
1264
+ MaterialAddReferenceComponent, MaterialOneOfComponent,
1265
+ MaterialButtonComponent, MaterialButtonGroupComponent,
1266
+ MaterialCheckboxComponent, MaterialCheckboxesComponent,
1267
+ MaterialChipListComponent, MaterialDatepickerComponent,
1268
+ MaterialFileComponent, MaterialInputComponent, MaterialNumberComponent,
1269
+ MaterialRadiosComponent, MaterialSelectComponent, MaterialSliderComponent,
1270
+ MaterialStepperComponent, MaterialTabsComponent, MaterialTextareaComponent,
1271
+ MaterialDesignFrameworkComponent
1272
+ ];
1273
+
1274
+ // Material Design Framework
1275
+ // https://github.com/angular/material2
1276
+ var MaterialDesignFramework = /** @class */ (function (_super) {
1277
+ __extends(MaterialDesignFramework, _super);
1278
+ function MaterialDesignFramework() {
1279
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1280
+ _this.name = 'material-design';
1281
+ _this.framework = MaterialDesignFrameworkComponent;
1282
+ _this.stylesheets = [
1283
+ '//fonts.googleapis.com/icon?family=Material+Icons',
1284
+ '//fonts.googleapis.com/css?family=Roboto:300,400,500,700',
1285
+ ];
1286
+ _this.widgets = {
1287
+ 'root': FlexLayoutRootComponent,
1288
+ 'section': FlexLayoutSectionComponent,
1289
+ '$ref': MaterialAddReferenceComponent,
1290
+ 'button': MaterialButtonComponent,
1291
+ 'button-group': MaterialButtonGroupComponent,
1292
+ 'checkbox': MaterialCheckboxComponent,
1293
+ 'checkboxes': MaterialCheckboxesComponent,
1294
+ 'chip-list': MaterialChipListComponent,
1295
+ 'date': MaterialDatepickerComponent,
1296
+ 'file': MaterialFileComponent,
1297
+ 'number': MaterialNumberComponent,
1298
+ 'one-of': MaterialOneOfComponent,
1299
+ 'radios': MaterialRadiosComponent,
1300
+ 'select': MaterialSelectComponent,
1301
+ 'slider': MaterialSliderComponent,
1302
+ 'stepper': MaterialStepperComponent,
1303
+ 'tabs': MaterialTabsComponent,
1304
+ 'text': MaterialInputComponent,
1305
+ 'textarea': MaterialTextareaComponent,
1306
+ 'alt-date': 'date',
1307
+ 'any-of': 'one-of',
1308
+ 'card': 'section',
1309
+ 'color': 'text',
1310
+ 'expansion-panel': 'section',
1311
+ 'hidden': 'none',
1312
+ 'image': 'none',
1313
+ 'integer': 'number',
1314
+ 'radiobuttons': 'button-group',
1315
+ 'range': 'slider',
1316
+ 'submit': 'button',
1317
+ 'tagsinput': 'chip-list',
1318
+ 'wizard': 'stepper',
1319
+ };
1320
+ return _this;
1321
+ }
1322
+ return MaterialDesignFramework;
1323
+ }(core$1.Framework));
1324
+ MaterialDesignFramework.decorators = [
1325
+ { type: core.Injectable }
1326
+ ];
1327
+
1328
+ function fixAngularFlex() {
1329
+ // monkey patch based on errors in console - https://github.com/angular/flex-layout/issues/1011
1330
+ var MediaMarshallerUpdateElement = core$2.MediaMarshaller.prototype.updateElement;
1331
+ core$2.MediaMarshaller.prototype.updateElement = function (element, key, value) {
1332
+ if (key === 'layout-gap' && (value === null || value === undefined)) {
1333
+ value = '0px';
1334
+ }
1335
+ MediaMarshallerUpdateElement.apply(this, [element, key, value]);
1336
+ };
1337
+ }
1338
+
1339
+ /**
1340
+ * unused @angular/material modules:
1341
+ * MatDialogModule, MatGridListModule, MatListModule, MatMenuModule,
1342
+ * MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule,
1343
+ * MatSidenavModule, MatSnackBarModule, MatSortModule, MatTableModule,
1344
+ * ,
1345
+ */
1346
+ var ANGULAR_MATERIAL_MODULES = [
1347
+ autocomplete.MatAutocompleteModule, button.MatButtonModule, buttonToggle.MatButtonToggleModule, card.MatCardModule,
1348
+ checkbox.MatCheckboxModule, chips.MatChipsModule, datepicker.MatDatepickerModule, expansion.MatExpansionModule,
1349
+ formField.MatFormFieldModule, icon.MatIconModule, input.MatInputModule, core$3.MatNativeDateModule,
1350
+ radio.MatRadioModule, select.MatSelectModule, slider.MatSliderModule, slideToggle.MatSlideToggleModule,
1351
+ stepper.MatStepperModule, tabs.MatTabsModule, tooltip.MatTooltipModule,
1352
+ toolbar.MatToolbarModule, menu.MatMenuModule, toolbar.MatToolbarModule,
1353
+ ];
1354
+ var MaterialDesignFrameworkModule = /** @class */ (function () {
1355
+ function MaterialDesignFrameworkModule() {
1356
+ fixAngularFlex();
1357
+ }
1358
+ return MaterialDesignFrameworkModule;
1359
+ }());
1360
+ MaterialDesignFrameworkModule.decorators = [
1361
+ { type: core.NgModule, args: [{
1362
+ imports: __spreadArray(__spreadArray([
1363
+ common.CommonModule,
1364
+ forms.FormsModule,
1365
+ forms.ReactiveFormsModule,
1366
+ flexLayout.FlexLayoutModule
1367
+ ], __read(ANGULAR_MATERIAL_MODULES)), [
1368
+ core$1.WidgetLibraryModule,
1369
+ core$1.JsonSchemaFormModule,
1370
+ ]),
1371
+ declarations: __spreadArray([], __read(MATERIAL_FRAMEWORK_COMPONENTS)),
1372
+ exports: __spreadArray([
1373
+ core$1.JsonSchemaFormModule
1374
+ ], __read(MATERIAL_FRAMEWORK_COMPONENTS)),
1375
+ providers: [
1376
+ core$1.JsonSchemaFormService,
1377
+ core$1.FrameworkLibraryService,
1378
+ core$1.WidgetLibraryService,
1379
+ { provide: core$1.Framework, useClass: MaterialDesignFramework, multi: true },
1380
+ ],
1381
+ entryComponents: __spreadArray([], __read(MATERIAL_FRAMEWORK_COMPONENTS))
1382
+ },] }
1383
+ ];
1384
+ MaterialDesignFrameworkModule.ctorParameters = function () { return []; };
1385
+
1386
+ /*
1387
+ * Public API Surface of @ajsf/material-framework
1388
+ */
1389
+
1390
+ /**
1391
+ * Generated bundle index. Do not edit.
1392
+ */
1393
+
1394
+ exports.ANGULAR_MATERIAL_MODULES = ANGULAR_MATERIAL_MODULES;
1395
+ exports.FlexLayoutRootComponent = FlexLayoutRootComponent;
1396
+ exports.FlexLayoutSectionComponent = FlexLayoutSectionComponent;
1397
+ exports.MATERIAL_FRAMEWORK_COMPONENTS = MATERIAL_FRAMEWORK_COMPONENTS;
1398
+ exports.MaterialAddReferenceComponent = MaterialAddReferenceComponent;
1399
+ exports.MaterialButtonComponent = MaterialButtonComponent;
1400
+ exports.MaterialButtonGroupComponent = MaterialButtonGroupComponent;
1401
+ exports.MaterialCheckboxComponent = MaterialCheckboxComponent;
1402
+ exports.MaterialCheckboxesComponent = MaterialCheckboxesComponent;
1403
+ exports.MaterialChipListComponent = MaterialChipListComponent;
1404
+ exports.MaterialDatepickerComponent = MaterialDatepickerComponent;
1405
+ exports.MaterialDesignFramework = MaterialDesignFramework;
1406
+ exports.MaterialDesignFrameworkComponent = MaterialDesignFrameworkComponent;
1407
+ exports.MaterialDesignFrameworkModule = MaterialDesignFrameworkModule;
1408
+ exports.MaterialFileComponent = MaterialFileComponent;
1409
+ exports.MaterialInputComponent = MaterialInputComponent;
1410
+ exports.MaterialNumberComponent = MaterialNumberComponent;
1411
+ exports.MaterialOneOfComponent = MaterialOneOfComponent;
1412
+ exports.MaterialRadiosComponent = MaterialRadiosComponent;
1413
+ exports.MaterialSelectComponent = MaterialSelectComponent;
1414
+ exports.MaterialSliderComponent = MaterialSliderComponent;
1415
+ exports.MaterialStepperComponent = MaterialStepperComponent;
1416
+ exports.MaterialTabsComponent = MaterialTabsComponent;
1417
+ exports.MaterialTextareaComponent = MaterialTextareaComponent;
1418
+
1419
+ Object.defineProperty(exports, '__esModule', { value: true });
1420
+
1421
+ }));
1422
+ //# sourceMappingURL=ajsf-material.umd.js.map