@stemy/ngx-utils 13.4.2 → 13.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/stemy-ngx-utils.umd.js +195 -85
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +6 -1
- package/esm2015/ngx-utils/pipes/filter.pipe.js +6 -11
- package/esm2015/ngx-utils/pipes/find.pipe.js +9 -9
- package/esm2015/ngx-utils/services/api.service.js +6 -2
- package/esm2015/ngx-utils/services/base-http.service.js +8 -9
- package/esm2015/ngx-utils/services/config.service.js +14 -1
- package/esm2015/ngx-utils/services/language.service.js +16 -4
- package/esm2015/ngx-utils/services/universal.service.js +10 -7
- package/esm2015/ngx-utils/utils/object.utils.js +76 -30
- package/esm2015/public_api.js +2 -2
- package/esm2015/stemy-ngx-utils.js +3 -2
- package/esm2020/ngx-utils/common-types.mjs +6 -1
- package/esm2020/ngx-utils/components/dynamic-table/dynamic-table.component.mjs +6 -3
- package/esm2020/ngx-utils/directives/pagination-item.directive.mjs +3 -2
- package/esm2020/ngx-utils/pipes/filter.pipe.mjs +6 -11
- package/esm2020/ngx-utils/pipes/find.pipe.mjs +9 -9
- package/esm2020/ngx-utils/services/api.service.mjs +6 -2
- package/esm2020/ngx-utils/services/base-http.service.mjs +7 -8
- package/esm2020/ngx-utils/services/config.service.mjs +14 -1
- package/esm2020/ngx-utils/services/language.service.mjs +15 -4
- package/esm2020/ngx-utils/services/universal.service.mjs +10 -7
- package/esm2020/ngx-utils/utils/object.utils.mjs +76 -28
- package/esm2020/public_api.mjs +2 -2
- package/fesm2015/stemy-ngx-utils.js +143 -65
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/fesm2015/stemy-ngx-utils.mjs +149 -66
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +148 -66
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +10 -1
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +2 -1
- package/ngx-utils/pipes/find.pipe.d.ts +1 -1
- package/ngx-utils/services/base-http.service.d.ts +1 -0
- package/ngx-utils/services/config.service.d.ts +1 -0
- package/ngx-utils/services/language.service.d.ts +3 -3
- package/ngx-utils/services/universal.service.d.ts +3 -2
- package/ngx-utils/utils/object.utils.d.ts +3 -0
- package/package.json +2 -2
- package/public_api.d.ts +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -20,7 +20,12 @@ import elementResizeDetectorMaker from 'element-resize-detector';
|
|
|
20
20
|
import * as i4 from '@angular/forms';
|
|
21
21
|
import { FormsModule } from '@angular/forms';
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
function defaultPredicate(value, key, target, source) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function shouldCopyDefault(key, value) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
24
29
|
const hasBlob = typeof Blob !== "undefined" && !!Blob;
|
|
25
30
|
const hasFile = typeof File !== "undefined" && !!File;
|
|
26
31
|
class ObjectUtils {
|
|
@@ -180,17 +185,19 @@ class ObjectUtils {
|
|
|
180
185
|
return isNaN(key) || isArray ? target : Object.values(target);
|
|
181
186
|
}
|
|
182
187
|
static filter(obj, predicate) {
|
|
183
|
-
return ObjectUtils.copyRecursive(null, obj, predicate, new Map());
|
|
188
|
+
return ObjectUtils.copyRecursive(null, obj, predicate || defaultPredicate, new Map());
|
|
184
189
|
}
|
|
185
190
|
static copy(obj) {
|
|
186
|
-
return ObjectUtils.copyRecursive(null, obj,
|
|
191
|
+
return ObjectUtils.copyRecursive(null, obj, defaultPredicate, new Map());
|
|
187
192
|
}
|
|
188
193
|
static assign(target, source, predicate) {
|
|
189
|
-
return ObjectUtils.copyRecursive(target, source, predicate, new Map());
|
|
194
|
+
return ObjectUtils.copyRecursive(target, source, predicate || defaultPredicate, new Map());
|
|
190
195
|
}
|
|
191
196
|
static getType(obj) {
|
|
192
197
|
const regex = new RegExp("\\s([a-zA-Z]+)");
|
|
193
|
-
|
|
198
|
+
const target = !obj ? null : obj.constructor;
|
|
199
|
+
const type = !target ? null : Reflect.getMetadata("objectType", target);
|
|
200
|
+
return (type || Object.prototype.toString.call(obj).match(regex)[1]).toLowerCase();
|
|
194
201
|
}
|
|
195
202
|
static isPrimitive(value) {
|
|
196
203
|
const type = typeof value;
|
|
@@ -237,6 +244,9 @@ class ObjectUtils {
|
|
|
237
244
|
static isSet(value) {
|
|
238
245
|
return value instanceof Set;
|
|
239
246
|
}
|
|
247
|
+
static isConstructor(value) {
|
|
248
|
+
return (value && typeof value === "function" && value.prototype && value.prototype.constructor) === value && value.name !== "Object";
|
|
249
|
+
}
|
|
240
250
|
static checkInterface(obj, interFaceObject) {
|
|
241
251
|
return ObjectUtils.isInterface(obj, interFaceObject);
|
|
242
252
|
}
|
|
@@ -262,33 +272,71 @@ class ObjectUtils {
|
|
|
262
272
|
return str.length >= width ? str : new Array(width - str.length + 1).join(chr) + str;
|
|
263
273
|
}
|
|
264
274
|
static copyRecursive(target, source, predicate, copies) {
|
|
265
|
-
predicate = predicate || defaultPredicate;
|
|
266
275
|
if (ObjectUtils.isPrimitive(source) || ObjectUtils.isDate(source) || ObjectUtils.isBlob(source) || ObjectUtils.isFunction(source))
|
|
267
276
|
return source;
|
|
268
|
-
if (
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
if (copies.has(source))
|
|
278
|
+
return copies.get(source);
|
|
279
|
+
if (ObjectUtils.isArray(source)) {
|
|
280
|
+
target = ObjectUtils.isArray(target) ? Array.from(target) : [];
|
|
281
|
+
copies.set(source, target);
|
|
282
|
+
for (let index = 0; index < source.length; index++) {
|
|
283
|
+
const item = source[index];
|
|
284
|
+
if (!predicate(item, index, target, source))
|
|
285
|
+
continue;
|
|
286
|
+
if (target.length > index)
|
|
287
|
+
target[index] = ObjectUtils.copyRecursive(target[index], item, predicate, copies);
|
|
288
|
+
else
|
|
289
|
+
target.push(ObjectUtils.copyRecursive(null, item, predicate, copies));
|
|
280
290
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
return target;
|
|
292
|
+
}
|
|
293
|
+
// If object defines __shouldCopy as false, then don't copy it
|
|
294
|
+
if (source.__shouldCopy === false)
|
|
295
|
+
return source;
|
|
296
|
+
// Copy object
|
|
297
|
+
const shouldCopy = ObjectUtils.isFunction(source.__shouldCopy) ? source.__shouldCopy : shouldCopyDefault;
|
|
298
|
+
if (ObjectUtils.isConstructor(source.constructor)) {
|
|
299
|
+
if (!target) {
|
|
300
|
+
try {
|
|
301
|
+
target = new source.constructor();
|
|
302
|
+
}
|
|
303
|
+
catch (e) {
|
|
304
|
+
const proto = source.constructor.prototype || source.prototype;
|
|
305
|
+
target = Object.create(proto);
|
|
306
|
+
}
|
|
289
307
|
}
|
|
290
308
|
}
|
|
291
|
-
|
|
309
|
+
else {
|
|
310
|
+
target = Object.assign({}, target || {});
|
|
311
|
+
}
|
|
312
|
+
// Set to copies to prevent circular references
|
|
313
|
+
copies.set(source, target);
|
|
314
|
+
// Copy map entries
|
|
315
|
+
if (target instanceof Map) {
|
|
316
|
+
if (source instanceof Map) {
|
|
317
|
+
for (const [key, value] of source.entries()) {
|
|
318
|
+
if (!predicate(value, key, target, source))
|
|
319
|
+
continue;
|
|
320
|
+
target.set(key, !shouldCopy(key, value) ? value : ObjectUtils.copyRecursive(target.get(key), value, predicate, copies));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return target;
|
|
324
|
+
}
|
|
325
|
+
// Copy object members
|
|
326
|
+
const keys = Object.keys(source);
|
|
327
|
+
for (const key of keys) {
|
|
328
|
+
if (!predicate(source[key], key, target, source))
|
|
329
|
+
continue;
|
|
330
|
+
target[key] = !shouldCopy(key, source[key]) ? source[key] : ObjectUtils.copyRecursive(target[key], source[key], predicate, copies);
|
|
331
|
+
}
|
|
332
|
+
// Copy object properties
|
|
333
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
334
|
+
for (const key of Object.keys(descriptors)) {
|
|
335
|
+
if (keys.indexOf(key) >= 0)
|
|
336
|
+
continue;
|
|
337
|
+
Object.defineProperty(target, key, descriptors[key]);
|
|
338
|
+
}
|
|
339
|
+
return target;
|
|
292
340
|
}
|
|
293
341
|
}
|
|
294
342
|
|
|
@@ -352,6 +400,11 @@ function FactoryDependencies(...dependencies) {
|
|
|
352
400
|
ReflectUtils.defineMetadata("factoryDependencies", dependencies, target, method);
|
|
353
401
|
};
|
|
354
402
|
}
|
|
403
|
+
function ObjectType(type) {
|
|
404
|
+
return function (target) {
|
|
405
|
+
ReflectUtils.defineMetadata("objectType", type, target);
|
|
406
|
+
};
|
|
407
|
+
}
|
|
355
408
|
class PaginationItemContext {
|
|
356
409
|
constructor(item, parallelItem, count, index, dataIndex) {
|
|
357
410
|
this.item = item;
|
|
@@ -1350,25 +1403,25 @@ class UniversalService {
|
|
|
1350
1403
|
: this.dds.getDeviceInfo();
|
|
1351
1404
|
}
|
|
1352
1405
|
get browserName() {
|
|
1353
|
-
return this.dds.browser;
|
|
1406
|
+
return (this.dds.browser || "").toLowerCase();
|
|
1354
1407
|
}
|
|
1355
1408
|
get browserVersion() {
|
|
1356
1409
|
return this.dds.browser_version;
|
|
1357
1410
|
}
|
|
1358
1411
|
get isExplorer() {
|
|
1359
|
-
return this.
|
|
1412
|
+
return this.checkBrowser("ie");
|
|
1360
1413
|
}
|
|
1361
1414
|
get isEdge() {
|
|
1362
|
-
return this.
|
|
1415
|
+
return this.checkBrowser("edge");
|
|
1363
1416
|
}
|
|
1364
1417
|
get isChrome() {
|
|
1365
|
-
return this.
|
|
1418
|
+
return this.checkBrowser("chrome");
|
|
1366
1419
|
}
|
|
1367
1420
|
get isFirefox() {
|
|
1368
|
-
return this.
|
|
1421
|
+
return this.checkBrowser("firefox");
|
|
1369
1422
|
}
|
|
1370
1423
|
get isSafari() {
|
|
1371
|
-
return this.
|
|
1424
|
+
return this.checkBrowser("safari");
|
|
1372
1425
|
}
|
|
1373
1426
|
get isTablet() {
|
|
1374
1427
|
return this.dds.isTablet();
|
|
@@ -1382,6 +1435,9 @@ class UniversalService {
|
|
|
1382
1435
|
get isCrawler() {
|
|
1383
1436
|
return this.crawler;
|
|
1384
1437
|
}
|
|
1438
|
+
checkBrowser(name) {
|
|
1439
|
+
return this.browserName.includes(name) || false;
|
|
1440
|
+
}
|
|
1385
1441
|
}
|
|
1386
1442
|
UniversalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UniversalService, deps: [{ token: PLATFORM_ID }, { token: i1.DeviceDetectorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1387
1443
|
UniversalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: UniversalService });
|
|
@@ -2470,8 +2526,8 @@ class BaseHttpService {
|
|
|
2470
2526
|
// If we use token auth
|
|
2471
2527
|
if (this.client.renewTokenFunc && headers.has(authKey)) {
|
|
2472
2528
|
const currentTime = new Date().getTime();
|
|
2473
|
-
const userTokenTime = this.
|
|
2474
|
-
// And the last request was a long
|
|
2529
|
+
const userTokenTime = this.getUserTokenTime() || currentTime;
|
|
2530
|
+
// And the last request was a long-long time ago
|
|
2475
2531
|
if (currentTime - 600000 > userTokenTime) {
|
|
2476
2532
|
this.client.renewTokenFunc();
|
|
2477
2533
|
}
|
|
@@ -2499,6 +2555,9 @@ class BaseHttpService {
|
|
|
2499
2555
|
});
|
|
2500
2556
|
});
|
|
2501
2557
|
}
|
|
2558
|
+
getUserTokenTime() {
|
|
2559
|
+
return this.storage.get("userTokenTime");
|
|
2560
|
+
}
|
|
2502
2561
|
pushFailedRequest(url, options, req) {
|
|
2503
2562
|
if (url.indexOf("token") >= 0 || url === "user")
|
|
2504
2563
|
return false;
|
|
@@ -2541,11 +2600,7 @@ class BaseHttpService {
|
|
|
2541
2600
|
return this.url(url).replace(/(?:((?!:).\/)\/)/g, "$1");
|
|
2542
2601
|
}
|
|
2543
2602
|
async absoluteUrl(url, options) {
|
|
2544
|
-
|
|
2545
|
-
if (url == "api-docs") {
|
|
2546
|
-
return absoluteUrl.replace("/api", "");
|
|
2547
|
-
}
|
|
2548
|
-
return absoluteUrl;
|
|
2603
|
+
return this.parseUrl(url);
|
|
2549
2604
|
}
|
|
2550
2605
|
expressRequestUrl(url) {
|
|
2551
2606
|
const req = this.request;
|
|
@@ -2745,7 +2800,11 @@ class ApiService extends BaseHttpService {
|
|
|
2745
2800
|
return "api";
|
|
2746
2801
|
}
|
|
2747
2802
|
url(url) {
|
|
2748
|
-
|
|
2803
|
+
const baseUrl = this.expressRequestUrl(`/api/${url}`);
|
|
2804
|
+
if (url == "api-docs" || url == "socket") {
|
|
2805
|
+
return baseUrl.replace("/api/", "/");
|
|
2806
|
+
}
|
|
2807
|
+
return baseUrl;
|
|
2749
2808
|
}
|
|
2750
2809
|
get(url, options, body) {
|
|
2751
2810
|
return this.getPromise(url, options, body);
|
|
@@ -2852,6 +2911,19 @@ class ConfigService {
|
|
|
2852
2911
|
prepareConfig(config) {
|
|
2853
2912
|
return Promise.resolve(config);
|
|
2854
2913
|
}
|
|
2914
|
+
cloneRootElem() {
|
|
2915
|
+
if (this.rootElement instanceof HTMLElement) {
|
|
2916
|
+
const clone = this.rootElement.cloneNode(true);
|
|
2917
|
+
const children = Array.from(clone.childNodes);
|
|
2918
|
+
children.forEach(child => {
|
|
2919
|
+
if (child instanceof HTMLElement) {
|
|
2920
|
+
child.remove();
|
|
2921
|
+
}
|
|
2922
|
+
});
|
|
2923
|
+
return clone;
|
|
2924
|
+
}
|
|
2925
|
+
return this.rootElement.cloneNode(true);
|
|
2926
|
+
}
|
|
2855
2927
|
prepareUrl(url, ending) {
|
|
2856
2928
|
const project = !this.loadedConfig ? "" : this.loadedConfig.project;
|
|
2857
2929
|
const needsProtocol = url?.startsWith("//") ?? false;
|
|
@@ -3257,9 +3329,20 @@ class LanguageService extends StaticLanguageService {
|
|
|
3257
3329
|
this.languageSettings.next(settings);
|
|
3258
3330
|
const devLanguages = settings.devLanguages || [];
|
|
3259
3331
|
this.languageList = (settings.languages || []).filter(lang => {
|
|
3332
|
+
const unavailable = settings.settings[lang]?.unavailable;
|
|
3333
|
+
if (unavailable) {
|
|
3334
|
+
const parts = unavailable.split("/");
|
|
3335
|
+
const value = parts[0] || parts[1];
|
|
3336
|
+
const flags = parts.length > 1 ? parts[parts.length - 1] : "g";
|
|
3337
|
+
if (new RegExp(value, flags).test(this.config.baseDomain))
|
|
3338
|
+
return false;
|
|
3339
|
+
}
|
|
3260
3340
|
return devLanguages.indexOf(lang) < 0;
|
|
3261
3341
|
});
|
|
3262
|
-
|
|
3342
|
+
if (this.languageList.length === 0) {
|
|
3343
|
+
this.languageList = [defaultLanguage];
|
|
3344
|
+
}
|
|
3345
|
+
const lang = this.languages.indexOf(defaultLanguage) < 0 ? settings.defaultLanguage || this.languageList[0] : defaultLanguage;
|
|
3263
3346
|
await this.useLanguage(lang);
|
|
3264
3347
|
this.events.languageChanged.emit(lang);
|
|
3265
3348
|
}
|
|
@@ -3306,7 +3389,7 @@ class LanguageService extends StaticLanguageService {
|
|
|
3306
3389
|
return this.translationRequests[lang];
|
|
3307
3390
|
}
|
|
3308
3391
|
loadSettings() {
|
|
3309
|
-
this.settingsPromise = this.settingsPromise || this.client.get(`${this.config.translationUrl}languageSettings`).toPromise()
|
|
3392
|
+
this.settingsPromise = this.settingsPromise || (this.client.get(`${this.config.translationUrl}languageSettings`).toPromise())
|
|
3310
3393
|
.then((settings) => {
|
|
3311
3394
|
return settings;
|
|
3312
3395
|
}, () => {
|
|
@@ -3317,7 +3400,7 @@ class LanguageService extends StaticLanguageService {
|
|
|
3317
3400
|
settings: {
|
|
3318
3401
|
de: {},
|
|
3319
3402
|
hu: {},
|
|
3320
|
-
|
|
3403
|
+
en: {}
|
|
3321
3404
|
}
|
|
3322
3405
|
};
|
|
3323
3406
|
});
|
|
@@ -3700,25 +3783,20 @@ class FilterPipe {
|
|
|
3700
3783
|
const isObject = ObjectUtils.isObject(values);
|
|
3701
3784
|
if (!isObject && !ObjectUtils.isArray(values))
|
|
3702
3785
|
return [];
|
|
3703
|
-
const filterFunc = ObjectUtils.isFunction(filter) ? filter : (value, key, params) => {
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
key: key,
|
|
3707
|
-
item: value,
|
|
3708
|
-
index: key,
|
|
3709
|
-
params: params
|
|
3710
|
-
});
|
|
3786
|
+
const filterFunc = ObjectUtils.isFunction(filter) ? filter : (value, key, params, values) => {
|
|
3787
|
+
const index = key;
|
|
3788
|
+
return ObjectUtils.evaluate(filter, { value, key, params, values, index });
|
|
3711
3789
|
};
|
|
3712
3790
|
if (isObject) {
|
|
3713
3791
|
return Object.keys(values).filter(key => {
|
|
3714
|
-
return filterFunc(values[key], key, params);
|
|
3792
|
+
return filterFunc(values[key], key, params, values);
|
|
3715
3793
|
}).reduce((result, key) => {
|
|
3716
3794
|
result[key] = values[key];
|
|
3717
3795
|
return result;
|
|
3718
3796
|
}, {});
|
|
3719
3797
|
}
|
|
3720
3798
|
return values.filter((value, key) => {
|
|
3721
|
-
return filterFunc(value, key, params);
|
|
3799
|
+
return filterFunc(value, key, params, values);
|
|
3722
3800
|
});
|
|
3723
3801
|
}
|
|
3724
3802
|
}
|
|
@@ -3735,17 +3813,17 @@ function defaultFilter() {
|
|
|
3735
3813
|
return true;
|
|
3736
3814
|
}
|
|
3737
3815
|
class FindPipe {
|
|
3738
|
-
transform(values, filter = defaultFilter, params
|
|
3816
|
+
transform(values, filter = defaultFilter, params) {
|
|
3739
3817
|
if (!ObjectUtils.isArray(values))
|
|
3740
3818
|
return [];
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
});
|
|
3819
|
+
params = params || {};
|
|
3820
|
+
if (ObjectUtils.isObject(params)) {
|
|
3821
|
+
params.values = values;
|
|
3822
|
+
}
|
|
3823
|
+
const filterFunc = ObjectUtils.isFunction(filter) ? filter : (value, index, params, values) => {
|
|
3824
|
+
return ObjectUtils.evaluate(filter, { value, index, params, values });
|
|
3747
3825
|
};
|
|
3748
|
-
return values.find((value, index) => filterFunc(value, index, params));
|
|
3826
|
+
return values.find((value, index) => filterFunc(value, index, params, values));
|
|
3749
3827
|
}
|
|
3750
3828
|
}
|
|
3751
3829
|
FindPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FindPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -4690,8 +4768,9 @@ class PaginationItemDirective {
|
|
|
4690
4768
|
}
|
|
4691
4769
|
renderView() {
|
|
4692
4770
|
this.viewContainer.clear();
|
|
4693
|
-
this.pagination.items.forEach((item) => {
|
|
4771
|
+
this.pagination.items.forEach((item, ix) => {
|
|
4694
4772
|
item.$implicit = item;
|
|
4773
|
+
item.rowIndex = ix;
|
|
4695
4774
|
this.viewContainer.createEmbeddedView(this.templateRef, item);
|
|
4696
4775
|
});
|
|
4697
4776
|
}
|
|
@@ -5083,6 +5162,7 @@ class DynamicTableComponent {
|
|
|
5083
5162
|
this.tableId = UniqueUtils.uuid();
|
|
5084
5163
|
this.templates = {};
|
|
5085
5164
|
this.filter = "";
|
|
5165
|
+
this.testId = "table";
|
|
5086
5166
|
this.orders = {};
|
|
5087
5167
|
}
|
|
5088
5168
|
get items() {
|
|
@@ -5174,10 +5254,10 @@ class DynamicTableComponent {
|
|
|
5174
5254
|
}
|
|
5175
5255
|
}
|
|
5176
5256
|
DynamicTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DynamicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5177
|
-
DynamicTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DynamicTableComponent, selector: "dynamic-table", inputs: { label: "label", placeholder: "placeholder", dataLoader: "dataLoader", data: "data", parallelData: "parallelData", columns: "columns", showFilter: "showFilter", itemsPerPage: "itemsPerPage", updateTime: "updateTime", maxPages: "maxPages", directionLinks: "directionLinks", boundaryLinks: "boundaryLinks", orderBy: "orderBy", orderDescending: "orderDescending" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: ["rowTemplate"], descendants: true, static: true }, { propertyName: "wrapperTemplate", first: true, predicate: ["wrapperTemplate"], descendants: true, static: true }, { propertyName: "filterTemplate", first: true, predicate: ["filterTemplate"], descendants: true, static: true }, { propertyName: "templateDirectives", predicate: DynamicTableTemplateDirective }], viewQueries: [{ propertyName: "columnsTemplate", first: true, predicate: ["columnsTemplate"], descendants: true, static: true }, { propertyName: "defaultRowTemplate", first: true, predicate: ["defaultRowTemplate"], descendants: true, static: true }, { propertyName: "defaultWrapperTemplate", first: true, predicate: ["defaultWrapperTemplate"], descendants: true, static: true }, { propertyName: "defaultFilterTemplate", first: true, predicate: ["defaultFilterTemplate"], descendants: true, static: true }, { propertyName: "pagination", first: true, predicate: ["pagination"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n
|
|
5257
|
+
DynamicTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DynamicTableComponent, selector: "dynamic-table", inputs: { label: "label", placeholder: "placeholder", dataLoader: "dataLoader", data: "data", parallelData: "parallelData", columns: "columns", showFilter: "showFilter", itemsPerPage: "itemsPerPage", updateTime: "updateTime", maxPages: "maxPages", directionLinks: "directionLinks", boundaryLinks: "boundaryLinks", orderBy: "orderBy", orderDescending: "orderDescending", testId: "testId" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: ["rowTemplate"], descendants: true, static: true }, { propertyName: "wrapperTemplate", first: true, predicate: ["wrapperTemplate"], descendants: true, static: true }, { propertyName: "filterTemplate", first: true, predicate: ["filterTemplate"], descendants: true, static: true }, { propertyName: "templateDirectives", predicate: DynamicTableTemplateDirective }], viewQueries: [{ propertyName: "columnsTemplate", first: true, predicate: ["columnsTemplate"], descendants: true, static: true }, { propertyName: "defaultRowTemplate", first: true, predicate: ["defaultRowTemplate"], descendants: true, static: true }, { propertyName: "defaultWrapperTemplate", first: true, predicate: ["defaultWrapperTemplate"], descendants: true, static: true }, { propertyName: "defaultFilterTemplate", first: true, predicate: ["defaultFilterTemplate"], descendants: true, static: true }, { propertyName: "pagination", first: true, predicate: ["pagination"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [attr.data-testid]=\"testId + '-filter-input'\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n <ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\r\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\r\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\r\n </ng-template>\r\n <ng-template #pureTemplate>\r\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\r\n </ng-template>\r\n <td [ngClass]=\"'column-' + column\"\r\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\" *ngIf=\"!template || !template.pure; else pureTemplate\">\r\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\" [context]=\"context\"></ng-container>\r\n </td>\r\n </ng-template>\r\n\r\n <ng-template #columnsTemplate let-context>\r\n <ng-container *ngFor=\"let column of cols\"\r\n [ngxTemplateOutlet]=\"columnTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"{\r\n template: templates[column],\r\n column: column\r\n }\"></ng-container>\r\n </ng-template>\r\n\r\n <ng-template #defaultRowTemplate let-context>\r\n <tr>\r\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template #defaultWrapperTemplate>\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th *ngFor=\"let column of cols\" [ngClass]=\"'column-' + column\">\r\n <a *ngIf=\"orders[column]\" (click)=\"setOrder(column)\">\r\n <span>{{ 'label.' + column | translate }}</span>\r\n <i *ngIf=\"orderBy == column\"\r\n [icon]=\"orderDescending ? 'sort-desc' : 'sort-asc'\"\r\n [ngClass]=\"orderBy == column ? (orderDescending ? 'sort-desc': 'sort-asc') : ''\"></i>\r\n </a>\r\n <span *ngIf=\"!orders[column]\">{{ 'label.' + column | translate }}</span>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *paginationItem=\"let context\"\r\n [ngxTemplateOutlet]=\"rowTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"this\"></ng-container>\r\n </tbody>\r\n </table>\r\n </ng-template>\r\n\r\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\r\n [context]=\"this\"></ng-container>\r\n </div>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n</div>\r\n", components: [{ type: PaginationMenuComponent, selector: "pagination-menu", inputs: ["maxSize", "urlParam", "directionLinks", "boundaryLinks"] }], directives: [{ type: PaginationDirective, selector: "[pagination]", inputs: ["pagination", "page", "itemsPerPage", "updateTime", "waitFor"], outputs: ["pageChange", "onRefresh"], exportAs: ["pagination"] }, { type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }, { type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: IconDirective, selector: "[icon]", inputs: ["icon", "activeIcon", "active"], outputs: ["activeChange"] }, { type: PaginationItemDirective, selector: "[paginationItem]" }], pipes: { "translate": TranslatePipe } });
|
|
5178
5258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DynamicTableComponent, decorators: [{
|
|
5179
5259
|
type: Component,
|
|
5180
|
-
args: [{ selector: "dynamic-table", template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n
|
|
5260
|
+
args: [{ selector: "dynamic-table", template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [attr.data-testid]=\"testId + '-filter-input'\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n <ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\r\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\r\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\r\n </ng-template>\r\n <ng-template #pureTemplate>\r\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\r\n </ng-template>\r\n <td [ngClass]=\"'column-' + column\"\r\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\" *ngIf=\"!template || !template.pure; else pureTemplate\">\r\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\" [context]=\"context\"></ng-container>\r\n </td>\r\n </ng-template>\r\n\r\n <ng-template #columnsTemplate let-context>\r\n <ng-container *ngFor=\"let column of cols\"\r\n [ngxTemplateOutlet]=\"columnTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"{\r\n template: templates[column],\r\n column: column\r\n }\"></ng-container>\r\n </ng-template>\r\n\r\n <ng-template #defaultRowTemplate let-context>\r\n <tr>\r\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template #defaultWrapperTemplate>\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th *ngFor=\"let column of cols\" [ngClass]=\"'column-' + column\">\r\n <a *ngIf=\"orders[column]\" (click)=\"setOrder(column)\">\r\n <span>{{ 'label.' + column | translate }}</span>\r\n <i *ngIf=\"orderBy == column\"\r\n [icon]=\"orderDescending ? 'sort-desc' : 'sort-asc'\"\r\n [ngClass]=\"orderBy == column ? (orderDescending ? 'sort-desc': 'sort-asc') : ''\"></i>\r\n </a>\r\n <span *ngIf=\"!orders[column]\">{{ 'label.' + column | translate }}</span>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *paginationItem=\"let context\"\r\n [ngxTemplateOutlet]=\"rowTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"this\"></ng-container>\r\n </tbody>\r\n </table>\r\n </ng-template>\r\n\r\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\r\n [context]=\"this\"></ng-container>\r\n </div>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n</div>\r\n" }]
|
|
5181
5261
|
}], ctorParameters: function () { return []; }, propDecorators: { label: [{
|
|
5182
5262
|
type: Input
|
|
5183
5263
|
}], placeholder: [{
|
|
@@ -5206,6 +5286,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
5206
5286
|
type: Input
|
|
5207
5287
|
}], orderDescending: [{
|
|
5208
5288
|
type: Input
|
|
5289
|
+
}], testId: [{
|
|
5290
|
+
type: Input
|
|
5209
5291
|
}], rowTemplate: [{
|
|
5210
5292
|
type: ContentChild,
|
|
5211
5293
|
args: ["rowTemplate", { static: true }]
|
|
@@ -5629,5 +5711,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
5629
5711
|
* Generated bundle index. Do not edit.
|
|
5630
5712
|
*/
|
|
5631
5713
|
|
|
5632
|
-
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
|
|
5714
|
+
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
|
|
5633
5715
|
//# sourceMappingURL=stemy-ngx-utils.mjs.map
|