@esfaenza/parameters 12.2.5
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.
- package/README.md +1 -0
- package/bundles/esfaenza-parameters.umd.js +596 -0
- package/bundles/esfaenza-parameters.umd.js.map +1 -0
- package/esfaenza-parameters.d.ts +5 -0
- package/esfaenza-parameters.metadata.json +1 -0
- package/esm2015/esfaenza-parameters.js +6 -0
- package/esm2015/lib/es_parameters.component.js +174 -0
- package/esm2015/lib/es_parameters.component.loc.js +23 -0
- package/esm2015/lib/es_parameters.module.js +32 -0
- package/esm2015/lib/models/EsParametersModuleConfig.js +6 -0
- package/esm2015/lib/models/GenericParameter.js +33 -0
- package/esm2015/lib/tokens.js +6 -0
- package/esm2015/public-api.js +8 -0
- package/fesm2015/esfaenza-parameters.js +266 -0
- package/fesm2015/esfaenza-parameters.js.map +1 -0
- package/lib/es_parameters.component.d.ts +96 -0
- package/lib/es_parameters.component.loc.d.ts +12 -0
- package/lib/es_parameters.module.d.ts +5 -0
- package/lib/models/EsParametersModuleConfig.d.ts +9 -0
- package/lib/models/GenericParameter.d.ts +54 -0
- package/lib/tokens.d.ts +5 -0
- package/package.json +34 -0
- package/public-api.d.ts +4 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Parameters
|
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@esfaenza/forms-and-validations'), require('@esfaenza/localizations'), require('@esfaenza/extensions')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/parameters', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@esfaenza/forms-and-validations', '@esfaenza/localizations', '@esfaenza/extensions'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.parameters = {}), global.ng.core, global.ng.common, global.ng.forms, global.formsAndValidations, global.localizations, global.extensions));
|
|
5
|
+
}(this, (function (exports, core, common, forms, formsAndValidations, localizations, extensions) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/*! *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
/* global Reflect, Promise */
|
|
22
|
+
var extendStatics = function (d, b) {
|
|
23
|
+
extendStatics = Object.setPrototypeOf ||
|
|
24
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
+
function (d, b) { for (var p in b)
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
+
d[p] = b[p]; };
|
|
28
|
+
return extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
function __extends(d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
extendStatics(d, b);
|
|
34
|
+
function __() { this.constructor = d; }
|
|
35
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
+
}
|
|
37
|
+
var __assign = function () {
|
|
38
|
+
__assign = Object.assign || function __assign(t) {
|
|
39
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
+
s = arguments[i];
|
|
41
|
+
for (var p in s)
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
+
t[p] = s[p];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
return __assign.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
function __rest(s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s)
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
+
t[p] = s[p];
|
|
54
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
+
t[p[i]] = s[p[i]];
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function __decorate(decorators, target, key, desc) {
|
|
62
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
+
else
|
|
66
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
+
if (d = decorators[i])
|
|
68
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
+
}
|
|
71
|
+
function __param(paramIndex, decorator) {
|
|
72
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
+
}
|
|
74
|
+
function __metadata(metadataKey, metadataValue) {
|
|
75
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
+
}
|
|
78
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
+
function fulfilled(value) { try {
|
|
82
|
+
step(generator.next(value));
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
reject(e);
|
|
86
|
+
} }
|
|
87
|
+
function rejected(value) { try {
|
|
88
|
+
step(generator["throw"](value));
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
reject(e);
|
|
92
|
+
} }
|
|
93
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function __generator(thisArg, body) {
|
|
98
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
+
function step(op) {
|
|
103
|
+
if (f)
|
|
104
|
+
throw new TypeError("Generator is already executing.");
|
|
105
|
+
while (_)
|
|
106
|
+
try {
|
|
107
|
+
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)
|
|
108
|
+
return t;
|
|
109
|
+
if (y = 0, t)
|
|
110
|
+
op = [op[0] & 2, t.value];
|
|
111
|
+
switch (op[0]) {
|
|
112
|
+
case 0:
|
|
113
|
+
case 1:
|
|
114
|
+
t = op;
|
|
115
|
+
break;
|
|
116
|
+
case 4:
|
|
117
|
+
_.label++;
|
|
118
|
+
return { value: op[1], done: false };
|
|
119
|
+
case 5:
|
|
120
|
+
_.label++;
|
|
121
|
+
y = op[1];
|
|
122
|
+
op = [0];
|
|
123
|
+
continue;
|
|
124
|
+
case 7:
|
|
125
|
+
op = _.ops.pop();
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
continue;
|
|
128
|
+
default:
|
|
129
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
+
_ = 0;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
+
_.label = op[1];
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
+
_.label = t[1];
|
|
139
|
+
t = op;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (t && _.label < t[2]) {
|
|
143
|
+
_.label = t[2];
|
|
144
|
+
_.ops.push(op);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (t[2])
|
|
148
|
+
_.ops.pop();
|
|
149
|
+
_.trys.pop();
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
op = body.call(thisArg, _);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
op = [6, e];
|
|
156
|
+
y = 0;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
f = t = 0;
|
|
160
|
+
}
|
|
161
|
+
if (op[0] & 5)
|
|
162
|
+
throw op[1];
|
|
163
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
+
if (k2 === undefined)
|
|
168
|
+
k2 = k;
|
|
169
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
+
}) : (function (o, m, k, k2) {
|
|
171
|
+
if (k2 === undefined)
|
|
172
|
+
k2 = k;
|
|
173
|
+
o[k2] = m[k];
|
|
174
|
+
});
|
|
175
|
+
function __exportStar(m, o) {
|
|
176
|
+
for (var p in m)
|
|
177
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
+
__createBinding(o, m, p);
|
|
179
|
+
}
|
|
180
|
+
function __values(o) {
|
|
181
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
+
if (m)
|
|
183
|
+
return m.call(o);
|
|
184
|
+
if (o && typeof o.length === "number")
|
|
185
|
+
return {
|
|
186
|
+
next: function () {
|
|
187
|
+
if (o && i >= o.length)
|
|
188
|
+
o = void 0;
|
|
189
|
+
return { value: o && o[i++], done: !o };
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
+
}
|
|
194
|
+
function __read(o, n) {
|
|
195
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
+
if (!m)
|
|
197
|
+
return o;
|
|
198
|
+
var i = m.call(o), r, ar = [], e;
|
|
199
|
+
try {
|
|
200
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
+
ar.push(r.value);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
e = { error: error };
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
try {
|
|
208
|
+
if (r && !r.done && (m = i["return"]))
|
|
209
|
+
m.call(i);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
if (e)
|
|
213
|
+
throw e.error;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return ar;
|
|
217
|
+
}
|
|
218
|
+
/** @deprecated */
|
|
219
|
+
function __spread() {
|
|
220
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
+
ar = ar.concat(__read(arguments[i]));
|
|
222
|
+
return ar;
|
|
223
|
+
}
|
|
224
|
+
/** @deprecated */
|
|
225
|
+
function __spreadArrays() {
|
|
226
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
+
s += arguments[i].length;
|
|
228
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
+
r[k] = a[j];
|
|
231
|
+
return r;
|
|
232
|
+
}
|
|
233
|
+
function __spreadArray(to, from) {
|
|
234
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
235
|
+
to[j] = from[i];
|
|
236
|
+
return to;
|
|
237
|
+
}
|
|
238
|
+
function __await(v) {
|
|
239
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
240
|
+
}
|
|
241
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
242
|
+
if (!Symbol.asyncIterator)
|
|
243
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
244
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
245
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
246
|
+
function verb(n) { if (g[n])
|
|
247
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
248
|
+
function resume(n, v) { try {
|
|
249
|
+
step(g[n](v));
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
settle(q[0][3], e);
|
|
253
|
+
} }
|
|
254
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
255
|
+
function fulfill(value) { resume("next", value); }
|
|
256
|
+
function reject(value) { resume("throw", value); }
|
|
257
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
258
|
+
resume(q[0][0], q[0][1]); }
|
|
259
|
+
}
|
|
260
|
+
function __asyncDelegator(o) {
|
|
261
|
+
var i, p;
|
|
262
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
263
|
+
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; }
|
|
264
|
+
}
|
|
265
|
+
function __asyncValues(o) {
|
|
266
|
+
if (!Symbol.asyncIterator)
|
|
267
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
268
|
+
var m = o[Symbol.asyncIterator], i;
|
|
269
|
+
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);
|
|
270
|
+
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); }); }; }
|
|
271
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
272
|
+
}
|
|
273
|
+
function __makeTemplateObject(cooked, raw) {
|
|
274
|
+
if (Object.defineProperty) {
|
|
275
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
cooked.raw = raw;
|
|
279
|
+
}
|
|
280
|
+
return cooked;
|
|
281
|
+
}
|
|
282
|
+
;
|
|
283
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
284
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
285
|
+
}) : function (o, v) {
|
|
286
|
+
o["default"] = v;
|
|
287
|
+
};
|
|
288
|
+
function __importStar(mod) {
|
|
289
|
+
if (mod && mod.__esModule)
|
|
290
|
+
return mod;
|
|
291
|
+
var result = {};
|
|
292
|
+
if (mod != null)
|
|
293
|
+
for (var k in mod)
|
|
294
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
295
|
+
__createBinding(result, mod, k);
|
|
296
|
+
__setModuleDefault(result, mod);
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
function __importDefault(mod) {
|
|
300
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
301
|
+
}
|
|
302
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
303
|
+
if (!privateMap.has(receiver)) {
|
|
304
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
305
|
+
}
|
|
306
|
+
return privateMap.get(receiver);
|
|
307
|
+
}
|
|
308
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
309
|
+
if (!privateMap.has(receiver)) {
|
|
310
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
311
|
+
}
|
|
312
|
+
privateMap.set(receiver, value);
|
|
313
|
+
return value;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Token che indica il locale da utilizzare per l'applicazione. Sono supportati i locali "it-IT" ed "en-US"
|
|
318
|
+
*/
|
|
319
|
+
var PAR_LOCALE = new core.InjectionToken('PAR_LOCALE');
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Classe di localizzazione per il componente **EsParametersComponent**
|
|
323
|
+
*/
|
|
324
|
+
var EsParametersLoc = /** @class */ (function (_super) {
|
|
325
|
+
__extends(EsParametersLoc, _super);
|
|
326
|
+
/**
|
|
327
|
+
* Costruttore
|
|
328
|
+
*
|
|
329
|
+
* @ignore
|
|
330
|
+
*/
|
|
331
|
+
function EsParametersLoc(LOC_LOCALE) {
|
|
332
|
+
return _super.call(this, LOC_LOCALE) || this;
|
|
333
|
+
}
|
|
334
|
+
return EsParametersLoc;
|
|
335
|
+
}(localizations.LocalizationService));
|
|
336
|
+
EsParametersLoc.decorators = [
|
|
337
|
+
{ type: core.Injectable }
|
|
338
|
+
];
|
|
339
|
+
EsParametersLoc.ctorParameters = function () { return [
|
|
340
|
+
{ type: String, decorators: [{ type: core.Inject, args: [PAR_LOCALE,] }] }
|
|
341
|
+
]; };
|
|
342
|
+
|
|
343
|
+
// Angular
|
|
344
|
+
/**
|
|
345
|
+
* Componente che permette di graficare una lista di **GenericParameter** come Input in base al loro tipo specifico
|
|
346
|
+
*/
|
|
347
|
+
var EsParametersComponent = /** @class */ (function () {
|
|
348
|
+
/**
|
|
349
|
+
* Costruttore
|
|
350
|
+
*
|
|
351
|
+
* @ignore
|
|
352
|
+
*/
|
|
353
|
+
function EsParametersComponent(utiExts, lc, cdr, inj) {
|
|
354
|
+
this.utiExts = utiExts;
|
|
355
|
+
this.lc = lc;
|
|
356
|
+
this.cdr = cdr;
|
|
357
|
+
this.inj = inj;
|
|
358
|
+
/**
|
|
359
|
+
* Pipeline di Angular
|
|
360
|
+
*
|
|
361
|
+
* @ignore
|
|
362
|
+
*/
|
|
363
|
+
this.propagateChange = function (_) { };
|
|
364
|
+
/**
|
|
365
|
+
* Indica che l'ultimo parametro non deve avere margine in fondo
|
|
366
|
+
*/
|
|
367
|
+
this.LastParameterNoMargin = false;
|
|
368
|
+
/**
|
|
369
|
+
* col-md-X per la label
|
|
370
|
+
*/
|
|
371
|
+
this.LabelColWidth = 4;
|
|
372
|
+
/**
|
|
373
|
+
* col-md-X per l'input
|
|
374
|
+
*/
|
|
375
|
+
this.InputColWidth = 8;
|
|
376
|
+
/**
|
|
377
|
+
* Input a cui collegare la variabile **submitted** del form all'interno del quale viene utilizzato questo componente
|
|
378
|
+
*/
|
|
379
|
+
this.submitted = false;
|
|
380
|
+
/**
|
|
381
|
+
* Valore da mostrare qualora non fossero ancora ricevuti i **Parameters** da mostrare
|
|
382
|
+
*/
|
|
383
|
+
this.EmptyMessage = "";
|
|
384
|
+
/**
|
|
385
|
+
* Permette di rimuovere i parametri dalla lista cliccando sulla X davanti alla Label
|
|
386
|
+
*/
|
|
387
|
+
this.Removal = false;
|
|
388
|
+
/**
|
|
389
|
+
* Indica se i componenti di Input generati sono Readonly o no
|
|
390
|
+
*/
|
|
391
|
+
this.Readonly = false;
|
|
392
|
+
}
|
|
393
|
+
Object.defineProperty(EsParametersComponent.prototype, "LabelInputRatio", {
|
|
394
|
+
/**
|
|
395
|
+
* Permette di settare in una volta solo gli input **LabelColWidth** e **InputColWidth**, basta scriverlo con la sintassi "X Y"
|
|
396
|
+
*/
|
|
397
|
+
set: function (input) {
|
|
398
|
+
var ratio = input.split(/\s/);
|
|
399
|
+
this.LabelColWidth = parseInt(ratio[0]);
|
|
400
|
+
this.InputColWidth = parseInt(ratio[1]);
|
|
401
|
+
},
|
|
402
|
+
enumerable: false,
|
|
403
|
+
configurable: true
|
|
404
|
+
});
|
|
405
|
+
/**
|
|
406
|
+
* Pipeline di Angular
|
|
407
|
+
*
|
|
408
|
+
* @ignore
|
|
409
|
+
*/
|
|
410
|
+
EsParametersComponent.prototype.writeValue = function (obj) {
|
|
411
|
+
var _this = this;
|
|
412
|
+
this.Parameters = obj;
|
|
413
|
+
if (!this.Parameters)
|
|
414
|
+
return;
|
|
415
|
+
this.Parameters.forEach(function (t) {
|
|
416
|
+
if (t.typecode && !t.type)
|
|
417
|
+
t.type = _this.utiExts.getJsTypeFromTypeCode(t.typecode);
|
|
418
|
+
if (t.enumtype || t.dicttype)
|
|
419
|
+
t.type = 'enum';
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Pipeline di Angular
|
|
424
|
+
*
|
|
425
|
+
* @ignore
|
|
426
|
+
*/
|
|
427
|
+
EsParametersComponent.prototype.validate = function (c) {
|
|
428
|
+
var _a;
|
|
429
|
+
// Se la validazione è richiamata da un componente non me stesso vuol dire che i componenti di validazione interni stanno richiamando
|
|
430
|
+
// questo validator, ma dal loro punto di vista non se ne devono preoccupare quindi faccio finta non ci siano errori.
|
|
431
|
+
// Se invece vengo richiamato direttamente significa che è il form in cui vive es-parameters e lì devo effettuare la validazione
|
|
432
|
+
var control = (_a = this.inj.get(forms.NgControl, null)) === null || _a === void 0 ? void 0 : _a.control;
|
|
433
|
+
if (c != control)
|
|
434
|
+
return null;
|
|
435
|
+
var valid = true;
|
|
436
|
+
if (this.Parameters && this.Parameters.length > 0) {
|
|
437
|
+
this.Parameters.forEach(function (t) {
|
|
438
|
+
if (t.mandatory && !t.value)
|
|
439
|
+
valid = false;
|
|
440
|
+
else if (t.value && t.type == 'number')
|
|
441
|
+
valid = new RegExp(t.pattern || /^[+-]?[0-9]*[,]?[0-9]+$/).test(t.value);
|
|
442
|
+
else if (t.value && t.pattern)
|
|
443
|
+
valid = new RegExp(t.pattern).test(t.value);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
if (valid)
|
|
447
|
+
return null;
|
|
448
|
+
return { "es-parameters": valid };
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* Pipeline di Angular
|
|
452
|
+
*
|
|
453
|
+
* @ignore
|
|
454
|
+
*/
|
|
455
|
+
EsParametersComponent.prototype.registerOnChange = function (fn) { this.propagateChange = fn; };
|
|
456
|
+
/**
|
|
457
|
+
* Pipeline di Angular
|
|
458
|
+
*
|
|
459
|
+
* @ignore
|
|
460
|
+
*/
|
|
461
|
+
EsParametersComponent.prototype.registerOnTouched = function (fn) { };
|
|
462
|
+
/**
|
|
463
|
+
* Metodo che si occupa di gestire il modello in uscita e propagarlo sul binding ngModel
|
|
464
|
+
*/
|
|
465
|
+
EsParametersComponent.prototype.changed = function () {
|
|
466
|
+
var thyCleanShaltNotBlankMe = JSON.parse(JSON.stringify(this.Parameters));
|
|
467
|
+
this.propagateChange(thyCleanShaltNotBlankMe);
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Rimuove il parametro selezionato e propaga il modello
|
|
471
|
+
*
|
|
472
|
+
* @param {GenericParameter} par Parametro da rimuovere
|
|
473
|
+
*/
|
|
474
|
+
EsParametersComponent.prototype.removeParameter = function (par) {
|
|
475
|
+
this.Parameters.splice(this.Parameters.indexOf(par), 1);
|
|
476
|
+
this.changed();
|
|
477
|
+
};
|
|
478
|
+
return EsParametersComponent;
|
|
479
|
+
}());
|
|
480
|
+
EsParametersComponent.decorators = [
|
|
481
|
+
{ type: core.Component, args: [{
|
|
482
|
+
selector: "es-parameters",
|
|
483
|
+
providers: [
|
|
484
|
+
{ provide: localizations.LocalizationService, useClass: EsParametersLoc },
|
|
485
|
+
{
|
|
486
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
487
|
+
useExisting: core.forwardRef(function () { return EsParametersComponent; }),
|
|
488
|
+
multi: true
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
provide: forms.NG_VALIDATORS,
|
|
492
|
+
useExisting: core.forwardRef(function () { return EsParametersComponent; }),
|
|
493
|
+
multi: true
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
template: "<div *ngIf=\"(!Parameters || Parameters.length == 0) && EmptyMessage\">\r\n <em>{{EmptyMessage}}</em>\r\n</div>\r\n\r\n<div *ngIf=\"Parameters && Parameters.length > 0\">\r\n <div class=\"row form-group\" *ngFor=\"let par of Parameters; let i= index; let last = last;\" [class.app-margin-bottom-0]=\"LastParameterNoMargin && last\" [hidden]=\"!par.insertthis\">\r\n <label class=\"col-md-{{LabelColWidth}} m-t-5\"><span *ngIf=\"Removal\" class=\"fa fa-remove text-danger\" (click)=\"removeParameter(par)\"></span> {{par.description}}{{par.mandatory ? '*' : ''}}:</label>\r\n\r\n <div class=\"col-md-{{InputColWidth}}\" *ngIf=\"par.type == 'date'\">\r\n <form-date [FormLayout]=\"false\" [Readonly]=\"Readonly\" [required]=\"par.mandatory\" [(ngModel)]=\"par.value\" name=\"par{{i}}\" (inputChange)=\"changed();\" #validator></form-date>\r\n </div>\r\n <!--Se stringa-->\r\n <div class=\"col-md-{{InputColWidth}}\" *ngIf=\"par.type == 'string'\">\r\n <form-input [FormLayout]=\"false\" [Readonly]=\"Readonly\" [required]=\"par.mandatory\" [(ngModel)]=\"par.value\" name=\"par{{i}}\" (inputChange)=\"changed();\" #validator></form-input>\r\n </div>\r\n <!--Se numero-->\r\n <div class=\"col-md-{{InputColWidth}}\" *ngIf=\"par.type == 'number'\">\r\n <form-input [FormLayout]=\"false\" [Readonly]=\"Readonly\" [required]=\"par.mandatory\" [(ngModel)]=\"par.value\" name=\"par{{i}}\" (inputChange)=\"changed();\" #validator pattern=\"{{par.pattern || '^[+-]?[0-9]*[,]?[0-9]+$'}}\"></form-input>\r\n </div>\r\n <!--Se boolean-->\r\n <div class=\"col-md-{{InputColWidth}} m-t-5\" *ngIf=\"par.type == 'boolean'\">\r\n <form-checkbox [FormLayout]=\"false\" [Readonly]=\"Readonly\" [(ngModel)]=\"par.value\" name=\"par{{i}}\" (inputChange)=\"changed();\" #validator></form-checkbox>\r\n </div>\r\n <!--Se enum single select-->\r\n <div class=\"col-md-{{InputColWidth}}\" *ngIf=\"par.type == 'enum' && !par.multienum\">\r\n <form-select [FormLayout]=\"false\" [Readonly]=\"Readonly\" [required]=\"par.mandatory\" [(ngModel)]=\"par.value\" name=\"par{{i}}\" (inputChange)=\"changed();\" #validator [Source]=\"par.enumvalues\"></form-select>\r\n </div>\r\n <!--Se enum multi select-->\r\n <div class=\"col-md-{{InputColWidth}}\" *ngIf=\"par.type == 'enum' && par.multienum\">\r\n <form-multiselect [FormLayout]=\"false\" [SelectLabel]=\"('Select' | localize : lc) + '...'\" [(ngModel)]=\"par.value\" name=\"mtu\" [Readonly]=\"Readonly\" [Source]=\"par.enumvalues\" required (inputChange)=\"changed();\" #validator></form-multiselect>\r\n </div>\r\n\r\n <div class=\"clearfix\"></div>\r\n </div>\r\n</div>"
|
|
497
|
+
},] }
|
|
498
|
+
];
|
|
499
|
+
EsParametersComponent.ctorParameters = function () { return [
|
|
500
|
+
{ type: extensions.UtilityService },
|
|
501
|
+
{ type: localizations.LocalizationService },
|
|
502
|
+
{ type: core.ChangeDetectorRef },
|
|
503
|
+
{ type: core.Injector }
|
|
504
|
+
]; };
|
|
505
|
+
EsParametersComponent.propDecorators = {
|
|
506
|
+
LastParameterNoMargin: [{ type: core.Input }],
|
|
507
|
+
LabelColWidth: [{ type: core.Input }],
|
|
508
|
+
InputColWidth: [{ type: core.Input }],
|
|
509
|
+
submitted: [{ type: core.Input }],
|
|
510
|
+
EmptyMessage: [{ type: core.Input }],
|
|
511
|
+
Removal: [{ type: core.Input }],
|
|
512
|
+
Readonly: [{ type: core.Input }],
|
|
513
|
+
LabelInputRatio: [{ type: core.Input }]
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
var EsParametersModule = /** @class */ (function () {
|
|
517
|
+
function EsParametersModule() {
|
|
518
|
+
}
|
|
519
|
+
EsParametersModule.forRoot = function (config) {
|
|
520
|
+
return {
|
|
521
|
+
ngModule: EsParametersModule,
|
|
522
|
+
providers: [
|
|
523
|
+
{ provide: PAR_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' }
|
|
524
|
+
]
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
return EsParametersModule;
|
|
528
|
+
}());
|
|
529
|
+
EsParametersModule.decorators = [
|
|
530
|
+
{ type: core.NgModule, args: [{
|
|
531
|
+
declarations: [EsParametersComponent],
|
|
532
|
+
imports: [
|
|
533
|
+
common.CommonModule,
|
|
534
|
+
localizations.LocalizationModule,
|
|
535
|
+
forms.FormsModule,
|
|
536
|
+
extensions.FullExtensionsModule,
|
|
537
|
+
formsAndValidations.FormsAndValidationsModule,
|
|
538
|
+
],
|
|
539
|
+
exports: [EsParametersComponent]
|
|
540
|
+
},] }
|
|
541
|
+
];
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Classe che rappresenta un parametro generico
|
|
545
|
+
*/
|
|
546
|
+
var GenericParameter = /** @class */ (function () {
|
|
547
|
+
/**
|
|
548
|
+
* Costruttore
|
|
549
|
+
*
|
|
550
|
+
* @param {string} id Codice del parametro
|
|
551
|
+
* @param {string} description Descrizione del parametro
|
|
552
|
+
* @param {string} pattern Pattern di validazione
|
|
553
|
+
* @param {'date' | 'string' | 'number' | 'boolean' | 'enum'} type Tipo di input
|
|
554
|
+
* @param {boolean} mandatory Indica se il valore è obbligatorio o meno
|
|
555
|
+
* @param {any} v_default Valore di default per questo Parametro
|
|
556
|
+
* @param {{ id: string, description: string }[]} enumvalues Qualora il **type** fosse di tipo **enum**, qui devono esserci tutti i valori che può assumere
|
|
557
|
+
* @param {boolean} multienum Qualora il **type** fosse di tipo **enum**, indica se è possibile selezionare più valori (multiselect)
|
|
558
|
+
*/
|
|
559
|
+
function GenericParameter(id, description, pattern, type, mandatory, v_default, enumvalues, multienum) {
|
|
560
|
+
if (v_default === void 0) { v_default = null; }
|
|
561
|
+
if (enumvalues === void 0) { enumvalues = []; }
|
|
562
|
+
this.id = id;
|
|
563
|
+
this.description = description;
|
|
564
|
+
this.pattern = pattern;
|
|
565
|
+
this.mandatory = mandatory;
|
|
566
|
+
this.enumvalues = enumvalues;
|
|
567
|
+
this.multienum = multienum;
|
|
568
|
+
this.type = type == 'enum' ? "" : type;
|
|
569
|
+
this.insertthis = true;
|
|
570
|
+
this.enumtype = type == 'enum' ? type : "";
|
|
571
|
+
if (!this.enumtype && enumvalues.length != 0)
|
|
572
|
+
console.error("impossibile gestire valori di dizionario per un parametro non di tipo enum");
|
|
573
|
+
if (v_default != null)
|
|
574
|
+
this.value = v_default;
|
|
575
|
+
}
|
|
576
|
+
return GenericParameter;
|
|
577
|
+
}());
|
|
578
|
+
|
|
579
|
+
/*
|
|
580
|
+
* Public API Surface of parameters
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Generated bundle index. Do not edit.
|
|
585
|
+
*/
|
|
586
|
+
|
|
587
|
+
exports.EsParametersComponent = EsParametersComponent;
|
|
588
|
+
exports.EsParametersModule = EsParametersModule;
|
|
589
|
+
exports.GenericParameter = GenericParameter;
|
|
590
|
+
exports.PAR_LOCALE = PAR_LOCALE;
|
|
591
|
+
exports.ɵa = EsParametersLoc;
|
|
592
|
+
|
|
593
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
594
|
+
|
|
595
|
+
})));
|
|
596
|
+
//# sourceMappingURL=esfaenza-parameters.umd.js.map
|