tnp-helpers 13.1.6 → 13.1.7
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/app.js +3 -3
- package/browser/esm2020/lib/base-component.mjs +3 -1
- package/browser/esm2020/lib/base-formly-component.mjs +3 -16
- package/browser/esm2020/lib/condition-wait.mjs +3 -11
- package/browser/esm2020/lib/constants.mjs +2 -1
- package/browser/esm2020/lib/dual-component-ctrl.mjs +3 -5
- package/browser/esm2020/lib/helpers-array-obj.mjs +3 -1
- package/browser/esm2020/lib/helpers-environment.mjs +3 -1
- package/browser/esm2020/lib/helpers-numbers.mjs +3 -1
- package/browser/esm2020/lib/helpers-strings-regexes.mjs +3 -1
- package/browser/esm2020/lib/helpers-strings.mjs +3 -8
- package/browser/esm2020/lib/helpers.mjs +3 -1
- package/browser/esm2020/lib/index.mjs +3 -4
- package/browser/esm2020/lib/long-press.directive.mjs +3 -2
- package/browser/esm2020/lib/project.mjs +3 -1
- package/browser/esm2020/lib/resize-service.mjs +3 -1
- package/browser/fesm2015/tnp-helpers.mjs +29 -39
- package/browser/fesm2015/tnp-helpers.mjs.map +1 -1
- package/browser/fesm2020/tnp-helpers.mjs +29 -39
- package/browser/fesm2020/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base-component.d.ts +2 -1
- package/browser/lib/base-formly-component.d.ts +2 -1
- package/browser/lib/condition-wait.d.ts +2 -1
- package/browser/lib/constants.d.ts +2 -1
- package/browser/lib/dual-component-ctrl.d.ts +2 -1
- package/browser/lib/helpers-array-obj.d.ts +2 -1
- package/browser/lib/helpers-environment.d.ts +2 -1
- package/browser/lib/helpers-numbers.d.ts +2 -1
- package/browser/lib/helpers-strings-regexes.d.ts +2 -1
- package/browser/lib/helpers-strings.d.ts +2 -1
- package/browser/lib/helpers.d.ts +2 -1
- package/browser/lib/index.d.ts +1 -0
- package/browser/lib/long-press.directive.d.ts +2 -1
- package/browser/lib/project.d.ts +2 -1
- package/browser/lib/resize-service.d.ts +2 -1
- package/browser/public-api.d.ts +2 -1
- package/browser/tnp-helpers.d.ts +2 -1
- package/client/esm2020/lib/base-component.mjs +3 -1
- package/client/esm2020/lib/base-formly-component.mjs +3 -16
- package/client/esm2020/lib/condition-wait.mjs +3 -11
- package/client/esm2020/lib/constants.mjs +2 -1
- package/client/esm2020/lib/dual-component-ctrl.mjs +3 -5
- package/client/esm2020/lib/helpers-array-obj.mjs +3 -1
- package/client/esm2020/lib/helpers-environment.mjs +3 -1
- package/client/esm2020/lib/helpers-numbers.mjs +3 -1
- package/client/esm2020/lib/helpers-strings-regexes.mjs +3 -1
- package/client/esm2020/lib/helpers-strings.mjs +3 -8
- package/client/esm2020/lib/helpers.mjs +3 -1
- package/client/esm2020/lib/index.mjs +3 -4
- package/client/esm2020/lib/long-press.directive.mjs +3 -2
- package/client/esm2020/lib/project.mjs +3 -1
- package/client/esm2020/lib/resize-service.mjs +3 -1
- package/client/fesm2015/tnp-helpers.mjs +29 -39
- package/client/fesm2015/tnp-helpers.mjs.map +1 -1
- package/client/fesm2020/tnp-helpers.mjs +29 -39
- package/client/fesm2020/tnp-helpers.mjs.map +1 -1
- package/client/lib/base-component.d.ts +2 -1
- package/client/lib/base-formly-component.d.ts +2 -1
- package/client/lib/condition-wait.d.ts +2 -1
- package/client/lib/constants.d.ts +2 -1
- package/client/lib/dual-component-ctrl.d.ts +2 -1
- package/client/lib/helpers-array-obj.d.ts +2 -1
- package/client/lib/helpers-environment.d.ts +2 -1
- package/client/lib/helpers-numbers.d.ts +2 -1
- package/client/lib/helpers-strings-regexes.d.ts +2 -1
- package/client/lib/helpers-strings.d.ts +2 -1
- package/client/lib/helpers.d.ts +2 -1
- package/client/lib/index.d.ts +1 -0
- package/client/lib/long-press.directive.d.ts +2 -1
- package/client/lib/project.d.ts +2 -1
- package/client/lib/resize-service.d.ts +2 -1
- package/client/public-api.d.ts +2 -1
- package/client/tnp-helpers.d.ts +2 -1
- package/lib/base-component.js +3 -3
- package/lib/base-formly-component.js +3 -3
- package/lib/dual-component-ctrl.js +3 -3
- package/package.json +5 -5
- package/tmp-environment.json +21 -21
- package/websql/esm2020/lib/base-component.mjs +3 -1
- package/websql/esm2020/lib/base-formly-component.mjs +3 -16
- package/websql/esm2020/lib/condition-wait.mjs +3 -11
- package/websql/esm2020/lib/constants.mjs +2 -1
- package/websql/esm2020/lib/dual-component-ctrl.mjs +3 -5
- package/websql/esm2020/lib/helpers-array-obj.mjs +3 -1
- package/websql/esm2020/lib/helpers-environment.mjs +3 -1
- package/websql/esm2020/lib/helpers-numbers.mjs +3 -1
- package/websql/esm2020/lib/helpers-strings-regexes.mjs +3 -1
- package/websql/esm2020/lib/helpers-strings.mjs +3 -8
- package/websql/esm2020/lib/helpers.mjs +3 -1
- package/websql/esm2020/lib/index.mjs +3 -4
- package/websql/esm2020/lib/long-press.directive.mjs +3 -2
- package/websql/esm2020/lib/project.mjs +3 -1
- package/websql/esm2020/lib/resize-service.mjs +3 -1
- package/websql/fesm2015/tnp-helpers.mjs +29 -39
- package/websql/fesm2015/tnp-helpers.mjs.map +1 -1
- package/websql/fesm2020/tnp-helpers.mjs +29 -39
- package/websql/fesm2020/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base-component.d.ts +2 -1
- package/websql/lib/base-formly-component.d.ts +2 -1
- package/websql/lib/condition-wait.d.ts +2 -1
- package/websql/lib/constants.d.ts +2 -1
- package/websql/lib/dual-component-ctrl.d.ts +2 -1
- package/websql/lib/helpers-array-obj.d.ts +2 -1
- package/websql/lib/helpers-environment.d.ts +2 -1
- package/websql/lib/helpers-numbers.d.ts +2 -1
- package/websql/lib/helpers-strings-regexes.d.ts +2 -1
- package/websql/lib/helpers-strings.d.ts +2 -1
- package/websql/lib/helpers.d.ts +2 -1
- package/websql/lib/index.d.ts +1 -0
- package/websql/lib/long-press.directive.d.ts +2 -1
- package/websql/lib/project.d.ts +2 -1
- package/websql/lib/resize-service.d.ts +2 -1
- package/websql/public-api.d.ts +2 -1
- package/websql/tnp-helpers.d.ts +2 -1
|
@@ -87,6 +87,8 @@ class HelpersArrayObj {
|
|
|
87
87
|
return { matches, results };
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
;
|
|
91
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers-array-obj.ts
|
|
90
92
|
|
|
91
93
|
class HelpersStringsRegexes {
|
|
92
94
|
escapeStringForRegEx(s) {
|
|
@@ -135,6 +137,8 @@ class HelpersStringsRegexes {
|
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
}
|
|
140
|
+
;
|
|
141
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers-strings-regexes.ts
|
|
138
142
|
|
|
139
143
|
/* */
|
|
140
144
|
/* */
|
|
@@ -165,6 +169,8 @@ class HelpersEnvironment {
|
|
|
165
169
|
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ip);
|
|
166
170
|
}
|
|
167
171
|
}
|
|
172
|
+
;
|
|
173
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers-environment.ts
|
|
168
174
|
|
|
169
175
|
class HelpersStrings {
|
|
170
176
|
/**
|
|
@@ -200,7 +206,6 @@ class HelpersStrings {
|
|
|
200
206
|
};
|
|
201
207
|
}
|
|
202
208
|
numValue(pixelsCss) {
|
|
203
|
-
// tslint:disable-next-line:radix
|
|
204
209
|
return parseInt(pixelsCss.replace('px', ''));
|
|
205
210
|
}
|
|
206
211
|
/**
|
|
@@ -297,11 +302,9 @@ class HelpersStrings {
|
|
|
297
302
|
'you',
|
|
298
303
|
'wood'
|
|
299
304
|
];
|
|
300
|
-
// save some time in the case that singular and plural are the same
|
|
301
305
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
302
306
|
return word;
|
|
303
307
|
}
|
|
304
|
-
// check for irregular forms
|
|
305
308
|
for (const w in irregular) {
|
|
306
309
|
const pattern = new RegExp(`${w}$`, 'i');
|
|
307
310
|
const replace = irregular[w];
|
|
@@ -309,7 +312,6 @@ class HelpersStrings {
|
|
|
309
312
|
return word.replace(pattern, replace);
|
|
310
313
|
}
|
|
311
314
|
}
|
|
312
|
-
// check for matches using regular expressions
|
|
313
315
|
for (const reg in plural) {
|
|
314
316
|
const pattern = new RegExp(reg, 'i');
|
|
315
317
|
if (pattern.test(word)) {
|
|
@@ -399,11 +401,9 @@ class HelpersStrings {
|
|
|
399
401
|
'you',
|
|
400
402
|
'wood'
|
|
401
403
|
];
|
|
402
|
-
// save some time in the case that singular and plural are the same
|
|
403
404
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
404
405
|
return word;
|
|
405
406
|
}
|
|
406
|
-
// check for irregular forms
|
|
407
407
|
for (const w in irregular) {
|
|
408
408
|
const pattern = new RegExp(`${irregular[w]}$`, 'i');
|
|
409
409
|
const replace = w;
|
|
@@ -411,7 +411,6 @@ class HelpersStrings {
|
|
|
411
411
|
return word.replace(pattern, replace);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
// check for matches using regular expressions
|
|
415
414
|
for (const reg in singular) {
|
|
416
415
|
const pattern = new RegExp(reg, 'i');
|
|
417
416
|
if (pattern.test(word)) {
|
|
@@ -421,6 +420,8 @@ class HelpersStrings {
|
|
|
421
420
|
return word;
|
|
422
421
|
}
|
|
423
422
|
}
|
|
423
|
+
;
|
|
424
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers-strings.ts
|
|
424
425
|
|
|
425
426
|
async function conditionWait(conditionAndTimeout) {
|
|
426
427
|
await waitFor(conditionAndTimeout);
|
|
@@ -431,7 +432,6 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
431
432
|
resolve(void 0);
|
|
432
433
|
}
|
|
433
434
|
else {
|
|
434
|
-
// console.log(arr.length)
|
|
435
435
|
const check = arr.shift();
|
|
436
436
|
if (_.isUndefined(check.timeoutCheck)) {
|
|
437
437
|
check.timeoutCheck = 2000;
|
|
@@ -440,15 +440,9 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
440
440
|
check.timeoutNext = 4000;
|
|
441
441
|
}
|
|
442
442
|
const { timeoutCheck, timeoutNext, name } = check;
|
|
443
|
-
// console.log(`timeoutCheck: ${timeoutCheck}`);
|
|
444
|
-
// console.log(`timeoutNext: ${timeoutNext}`);
|
|
445
|
-
// console.log(`Checking: ${name}`)
|
|
446
443
|
const resultTrue = await Helpers.runSyncOrAsync(check.callback, check);
|
|
447
|
-
// console.log(`after: ${name}`)
|
|
448
444
|
if (resultTrue) {
|
|
449
|
-
// console.log(`timeout 1 is set to ${timeoutNext}`)
|
|
450
445
|
setTimeout(async () => {
|
|
451
|
-
// console.log(`timeout 1 is over`)
|
|
452
446
|
await waitFor(arr).then(() => {
|
|
453
447
|
resolve(void 0);
|
|
454
448
|
});
|
|
@@ -460,11 +454,8 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
460
454
|
Helpers.info(check.errorMessage);
|
|
461
455
|
}
|
|
462
456
|
else {
|
|
463
|
-
// console.log(`dont show error message ${check.errorMessage}`)
|
|
464
457
|
}
|
|
465
|
-
// console.log(`timeout 2 is set to ${timeoutCheck}, arr.length is ${arr.length}`)
|
|
466
458
|
setTimeout(async () => {
|
|
467
|
-
// console.log(`timeout 2 ${timeoutCheck} ovef`)
|
|
468
459
|
await waitFor(arr, check.errorMessage).then(() => {
|
|
469
460
|
resolve(void 0);
|
|
470
461
|
});
|
|
@@ -473,12 +464,16 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
473
464
|
}
|
|
474
465
|
});
|
|
475
466
|
}
|
|
467
|
+
;
|
|
468
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/condition-wait.ts
|
|
476
469
|
|
|
477
470
|
class HelpersNumber {
|
|
478
471
|
constructor() {
|
|
479
472
|
this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
|
|
480
473
|
}
|
|
481
474
|
}
|
|
475
|
+
;
|
|
476
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers-numbers.ts
|
|
482
477
|
|
|
483
478
|
function applyMixins(derivedCtor, baseCtors) {
|
|
484
479
|
baseCtors.forEach(baseCtor => {
|
|
@@ -745,6 +740,8 @@ applyMixins(HelpersTnp, [
|
|
|
745
740
|
/* */
|
|
746
741
|
/* */
|
|
747
742
|
]);
|
|
743
|
+
;
|
|
744
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/helpers.ts
|
|
748
745
|
|
|
749
746
|
const BaselineSiteJoinprefix = '__';
|
|
750
747
|
const PREFIXES = {
|
|
@@ -752,6 +749,7 @@ const PREFIXES = {
|
|
|
752
749
|
DELETED: '____DELETED____',
|
|
753
750
|
ORIGINAL: '____ORIGINAL____',
|
|
754
751
|
};
|
|
752
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/constants.ts
|
|
755
753
|
|
|
756
754
|
/* */
|
|
757
755
|
const Helpers$1 = HelpersTnp.Instance;
|
|
@@ -1176,6 +1174,8 @@ Project.emptyLocations = [];
|
|
|
1176
1174
|
/* */
|
|
1177
1175
|
/* */
|
|
1178
1176
|
/* */
|
|
1177
|
+
;
|
|
1178
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/project.ts
|
|
1179
1179
|
|
|
1180
1180
|
class BaseComponent {
|
|
1181
1181
|
constructor() {
|
|
@@ -1221,8 +1221,9 @@ class BaseComponentForRouter extends BaseComponent {
|
|
|
1221
1221
|
}));
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
+
;
|
|
1225
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/base-component.ts
|
|
1224
1226
|
|
|
1225
|
-
//#region @browser
|
|
1226
1227
|
const log$2 = Log.create(`DualComponentController`);
|
|
1227
1228
|
class DualComponentController {
|
|
1228
1229
|
constructor(cmp, isFormlyMode = false) {
|
|
@@ -1305,8 +1306,6 @@ class DualComponentController {
|
|
|
1305
1306
|
}
|
|
1306
1307
|
set mode(v) {
|
|
1307
1308
|
if (this.isFormlyMode) {
|
|
1308
|
-
// this.cmp.field.mode =
|
|
1309
|
-
// log.w(`[DualComponentController] You can't set mode in formly component mode`);
|
|
1310
1309
|
}
|
|
1311
1310
|
else {
|
|
1312
1311
|
this.__mode = v;
|
|
@@ -1336,7 +1335,8 @@ class DualComponentController {
|
|
|
1336
1335
|
}
|
|
1337
1336
|
}
|
|
1338
1337
|
}
|
|
1339
|
-
|
|
1338
|
+
;
|
|
1339
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/dual-component-ctrl.ts
|
|
1340
1340
|
|
|
1341
1341
|
const log$1 = Log.create('base formly component', Level.__NOTHING);
|
|
1342
1342
|
class BaseFormlyComponent extends FieldType {
|
|
@@ -1346,7 +1346,6 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1346
1346
|
this.ctrl = {};
|
|
1347
1347
|
this.change = new EventEmitter();
|
|
1348
1348
|
// @ts-ignore
|
|
1349
|
-
// @Input() formControl: FormControl; // TODO QUICK_FIX
|
|
1350
1349
|
this.handlers = [];
|
|
1351
1350
|
this.__field = {
|
|
1352
1351
|
templateOptions: {}
|
|
@@ -1386,10 +1385,7 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1386
1385
|
}
|
|
1387
1386
|
ngAfterViewInit() {
|
|
1388
1387
|
}
|
|
1389
|
-
// _model: any;
|
|
1390
1388
|
ngOnInit() {
|
|
1391
|
-
// console.log('model', this.model)
|
|
1392
|
-
// console.log('ket', this.key)
|
|
1393
1389
|
const isFormlyMode = !!this.field;
|
|
1394
1390
|
log$1.i(`isFormlyMode: ${isFormlyMode}`);
|
|
1395
1391
|
if (!isFormlyMode) {
|
|
@@ -1409,17 +1405,6 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1409
1405
|
Object.keys(existed).forEach(key => {
|
|
1410
1406
|
this.ctrl[key] = existed[key];
|
|
1411
1407
|
});
|
|
1412
|
-
// if (!this.formControl) {
|
|
1413
|
-
// this.formControl = new FormControl({})
|
|
1414
|
-
// Object.defineProperty(this, 'field', {
|
|
1415
|
-
// get: () => {
|
|
1416
|
-
// return {
|
|
1417
|
-
// formControl: this.formControl
|
|
1418
|
-
// } as FormlyFieldConfig
|
|
1419
|
-
// }
|
|
1420
|
-
// })
|
|
1421
|
-
// // this.formControl = new FormControl({})
|
|
1422
|
-
// }
|
|
1423
1408
|
// @ts-ignore
|
|
1424
1409
|
this.change.next(this.ctrl.value);
|
|
1425
1410
|
}
|
|
@@ -1455,6 +1440,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1455
1440
|
}], key: [{
|
|
1456
1441
|
type: Input
|
|
1457
1442
|
}] } });
|
|
1443
|
+
;
|
|
1444
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/base-formly-component.ts
|
|
1458
1445
|
|
|
1459
1446
|
class ResizeService {
|
|
1460
1447
|
constructor() {
|
|
@@ -1472,6 +1459,8 @@ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", versio
|
|
|
1472
1459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
|
|
1473
1460
|
type: Injectable
|
|
1474
1461
|
}], ctorParameters: function () { return []; } });
|
|
1462
|
+
;
|
|
1463
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/resize-service.ts
|
|
1475
1464
|
|
|
1476
1465
|
const log = Log.create(`[tnp-helpers] long-press`, Level.__NOTHING);
|
|
1477
1466
|
class LongPress {
|
|
@@ -1490,7 +1479,6 @@ class LongPress {
|
|
|
1490
1479
|
get press() { return this.pressing; }
|
|
1491
1480
|
get longPress() { return this.longPressing; }
|
|
1492
1481
|
onMouseDown(event) {
|
|
1493
|
-
// don't do right/middle clicks
|
|
1494
1482
|
log.d(`MOUSE DOWN `);
|
|
1495
1483
|
if (event.which !== 1)
|
|
1496
1484
|
return;
|
|
@@ -1574,12 +1562,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1574
1562
|
type: HostListener,
|
|
1575
1563
|
args: ['mouseup']
|
|
1576
1564
|
}] } });
|
|
1565
|
+
;
|
|
1566
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/long-press.directive.ts
|
|
1577
1567
|
|
|
1578
1568
|
/* */
|
|
1579
1569
|
/* */
|
|
1580
|
-
// export * from './git-project';
|
|
1581
1570
|
const Helpers = HelpersTnp.Instance;
|
|
1582
|
-
|
|
1571
|
+
;
|
|
1572
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle/lib/index.ts
|
|
1583
1573
|
|
|
1584
1574
|
/**
|
|
1585
1575
|
* Generated bundle index. Do not edit.
|