tnp-helpers 13.1.5 → 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.d.ts +0 -1
- 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.d.ts +14 -1
- package/lib/base-component.js +3 -3
- package/lib/base-formly-component.d.ts +28 -1
- package/lib/base-formly-component.js +3 -3
- package/lib/dual-component-ctrl.d.ts +25 -1
- package/lib/dual-component-ctrl.js +3 -3
- package/lib/index.d.ts +5 -0
- package/package.json +5 -5
- package/tmp-environment.json +35 -35
- 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
|
@@ -88,6 +88,8 @@ class HelpersArrayObj {
|
|
|
88
88
|
return { matches, results };
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
;
|
|
92
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers-array-obj.ts
|
|
91
93
|
|
|
92
94
|
class HelpersStringsRegexes {
|
|
93
95
|
escapeStringForRegEx(s) {
|
|
@@ -136,6 +138,8 @@ class HelpersStringsRegexes {
|
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
}
|
|
141
|
+
;
|
|
142
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers-strings-regexes.ts
|
|
139
143
|
|
|
140
144
|
/* */
|
|
141
145
|
/* */
|
|
@@ -166,6 +170,8 @@ class HelpersEnvironment {
|
|
|
166
170
|
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);
|
|
167
171
|
}
|
|
168
172
|
}
|
|
173
|
+
;
|
|
174
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers-environment.ts
|
|
169
175
|
|
|
170
176
|
class HelpersStrings {
|
|
171
177
|
/**
|
|
@@ -201,7 +207,6 @@ class HelpersStrings {
|
|
|
201
207
|
};
|
|
202
208
|
}
|
|
203
209
|
numValue(pixelsCss) {
|
|
204
|
-
// tslint:disable-next-line:radix
|
|
205
210
|
return parseInt(pixelsCss.replace('px', ''));
|
|
206
211
|
}
|
|
207
212
|
/**
|
|
@@ -298,11 +303,9 @@ class HelpersStrings {
|
|
|
298
303
|
'you',
|
|
299
304
|
'wood'
|
|
300
305
|
];
|
|
301
|
-
// save some time in the case that singular and plural are the same
|
|
302
306
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
303
307
|
return word;
|
|
304
308
|
}
|
|
305
|
-
// check for irregular forms
|
|
306
309
|
for (const w in irregular) {
|
|
307
310
|
const pattern = new RegExp(`${w}$`, 'i');
|
|
308
311
|
const replace = irregular[w];
|
|
@@ -310,7 +313,6 @@ class HelpersStrings {
|
|
|
310
313
|
return word.replace(pattern, replace);
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
|
-
// check for matches using regular expressions
|
|
314
316
|
for (const reg in plural) {
|
|
315
317
|
const pattern = new RegExp(reg, 'i');
|
|
316
318
|
if (pattern.test(word)) {
|
|
@@ -400,11 +402,9 @@ class HelpersStrings {
|
|
|
400
402
|
'you',
|
|
401
403
|
'wood'
|
|
402
404
|
];
|
|
403
|
-
// save some time in the case that singular and plural are the same
|
|
404
405
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
405
406
|
return word;
|
|
406
407
|
}
|
|
407
|
-
// check for irregular forms
|
|
408
408
|
for (const w in irregular) {
|
|
409
409
|
const pattern = new RegExp(`${irregular[w]}$`, 'i');
|
|
410
410
|
const replace = w;
|
|
@@ -412,7 +412,6 @@ class HelpersStrings {
|
|
|
412
412
|
return word.replace(pattern, replace);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
// check for matches using regular expressions
|
|
416
415
|
for (const reg in singular) {
|
|
417
416
|
const pattern = new RegExp(reg, 'i');
|
|
418
417
|
if (pattern.test(word)) {
|
|
@@ -422,6 +421,8 @@ class HelpersStrings {
|
|
|
422
421
|
return word;
|
|
423
422
|
}
|
|
424
423
|
}
|
|
424
|
+
;
|
|
425
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers-strings.ts
|
|
425
426
|
|
|
426
427
|
function conditionWait(conditionAndTimeout) {
|
|
427
428
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -434,7 +435,6 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
434
435
|
resolve(void 0);
|
|
435
436
|
}
|
|
436
437
|
else {
|
|
437
|
-
// console.log(arr.length)
|
|
438
438
|
const check = arr.shift();
|
|
439
439
|
if (_.isUndefined(check.timeoutCheck)) {
|
|
440
440
|
check.timeoutCheck = 2000;
|
|
@@ -443,15 +443,9 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
443
443
|
check.timeoutNext = 4000;
|
|
444
444
|
}
|
|
445
445
|
const { timeoutCheck, timeoutNext, name } = check;
|
|
446
|
-
// console.log(`timeoutCheck: ${timeoutCheck}`);
|
|
447
|
-
// console.log(`timeoutNext: ${timeoutNext}`);
|
|
448
|
-
// console.log(`Checking: ${name}`)
|
|
449
446
|
const resultTrue = yield Helpers.runSyncOrAsync(check.callback, check);
|
|
450
|
-
// console.log(`after: ${name}`)
|
|
451
447
|
if (resultTrue) {
|
|
452
|
-
// console.log(`timeout 1 is set to ${timeoutNext}`)
|
|
453
448
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
454
|
-
// console.log(`timeout 1 is over`)
|
|
455
449
|
yield waitFor(arr).then(() => {
|
|
456
450
|
resolve(void 0);
|
|
457
451
|
});
|
|
@@ -463,11 +457,8 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
463
457
|
Helpers.info(check.errorMessage);
|
|
464
458
|
}
|
|
465
459
|
else {
|
|
466
|
-
// console.log(`dont show error message ${check.errorMessage}`)
|
|
467
460
|
}
|
|
468
|
-
// console.log(`timeout 2 is set to ${timeoutCheck}, arr.length is ${arr.length}`)
|
|
469
461
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
470
|
-
// console.log(`timeout 2 ${timeoutCheck} ovef`)
|
|
471
462
|
yield waitFor(arr, check.errorMessage).then(() => {
|
|
472
463
|
resolve(void 0);
|
|
473
464
|
});
|
|
@@ -476,12 +467,16 @@ function waitFor(arr, messageToShow = void 0) {
|
|
|
476
467
|
}
|
|
477
468
|
}));
|
|
478
469
|
}
|
|
470
|
+
;
|
|
471
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/condition-wait.ts
|
|
479
472
|
|
|
480
473
|
class HelpersNumber {
|
|
481
474
|
constructor() {
|
|
482
475
|
this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
|
|
483
476
|
}
|
|
484
477
|
}
|
|
478
|
+
;
|
|
479
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers-numbers.ts
|
|
485
480
|
|
|
486
481
|
function applyMixins(derivedCtor, baseCtors) {
|
|
487
482
|
baseCtors.forEach(baseCtor => {
|
|
@@ -752,6 +747,8 @@ applyMixins(HelpersTnp, [
|
|
|
752
747
|
/* */
|
|
753
748
|
/* */
|
|
754
749
|
]);
|
|
750
|
+
;
|
|
751
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/helpers.ts
|
|
755
752
|
|
|
756
753
|
const BaselineSiteJoinprefix = '__';
|
|
757
754
|
const PREFIXES = {
|
|
@@ -759,6 +756,7 @@ const PREFIXES = {
|
|
|
759
756
|
DELETED: '____DELETED____',
|
|
760
757
|
ORIGINAL: '____ORIGINAL____',
|
|
761
758
|
};
|
|
759
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/constants.ts
|
|
762
760
|
|
|
763
761
|
/* */
|
|
764
762
|
const Helpers$1 = HelpersTnp.Instance;
|
|
@@ -1183,6 +1181,8 @@ Project.emptyLocations = [];
|
|
|
1183
1181
|
/* */
|
|
1184
1182
|
/* */
|
|
1185
1183
|
/* */
|
|
1184
|
+
;
|
|
1185
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/project.ts
|
|
1186
1186
|
|
|
1187
1187
|
class BaseComponent {
|
|
1188
1188
|
constructor() {
|
|
@@ -1228,8 +1228,9 @@ class BaseComponentForRouter extends BaseComponent {
|
|
|
1228
1228
|
}));
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
|
+
;
|
|
1232
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/base-component.ts
|
|
1231
1233
|
|
|
1232
|
-
//#region @browser
|
|
1233
1234
|
const log$2 = Log.create(`DualComponentController`);
|
|
1234
1235
|
class DualComponentController {
|
|
1235
1236
|
constructor(cmp, isFormlyMode = false) {
|
|
@@ -1314,8 +1315,6 @@ class DualComponentController {
|
|
|
1314
1315
|
}
|
|
1315
1316
|
set mode(v) {
|
|
1316
1317
|
if (this.isFormlyMode) {
|
|
1317
|
-
// this.cmp.field.mode =
|
|
1318
|
-
// log.w(`[DualComponentController] You can't set mode in formly component mode`);
|
|
1319
1318
|
}
|
|
1320
1319
|
else {
|
|
1321
1320
|
this.__mode = v;
|
|
@@ -1345,7 +1344,8 @@ class DualComponentController {
|
|
|
1345
1344
|
}
|
|
1346
1345
|
}
|
|
1347
1346
|
}
|
|
1348
|
-
|
|
1347
|
+
;
|
|
1348
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/dual-component-ctrl.ts
|
|
1349
1349
|
|
|
1350
1350
|
const log$1 = Log.create('base formly component', Level.__NOTHING);
|
|
1351
1351
|
class BaseFormlyComponent extends FieldType {
|
|
@@ -1355,7 +1355,6 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1355
1355
|
this.ctrl = {};
|
|
1356
1356
|
this.change = new EventEmitter();
|
|
1357
1357
|
// @ts-ignore
|
|
1358
|
-
// @Input() formControl: FormControl; // TODO QUICK_FIX
|
|
1359
1358
|
this.handlers = [];
|
|
1360
1359
|
this.__field = {
|
|
1361
1360
|
templateOptions: {}
|
|
@@ -1395,10 +1394,7 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1395
1394
|
}
|
|
1396
1395
|
ngAfterViewInit() {
|
|
1397
1396
|
}
|
|
1398
|
-
// _model: any;
|
|
1399
1397
|
ngOnInit() {
|
|
1400
|
-
// console.log('model', this.model)
|
|
1401
|
-
// console.log('ket', this.key)
|
|
1402
1398
|
const isFormlyMode = !!this.field;
|
|
1403
1399
|
log$1.i(`isFormlyMode: ${isFormlyMode}`);
|
|
1404
1400
|
if (!isFormlyMode) {
|
|
@@ -1418,17 +1414,6 @@ class BaseFormlyComponent extends FieldType {
|
|
|
1418
1414
|
Object.keys(existed).forEach(key => {
|
|
1419
1415
|
this.ctrl[key] = existed[key];
|
|
1420
1416
|
});
|
|
1421
|
-
// if (!this.formControl) {
|
|
1422
|
-
// this.formControl = new FormControl({})
|
|
1423
|
-
// Object.defineProperty(this, 'field', {
|
|
1424
|
-
// get: () => {
|
|
1425
|
-
// return {
|
|
1426
|
-
// formControl: this.formControl
|
|
1427
|
-
// } as FormlyFieldConfig
|
|
1428
|
-
// }
|
|
1429
|
-
// })
|
|
1430
|
-
// // this.formControl = new FormControl({})
|
|
1431
|
-
// }
|
|
1432
1417
|
// @ts-ignore
|
|
1433
1418
|
this.change.next(this.ctrl.value);
|
|
1434
1419
|
}
|
|
@@ -1464,6 +1449,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1464
1449
|
}], key: [{
|
|
1465
1450
|
type: Input
|
|
1466
1451
|
}] } });
|
|
1452
|
+
;
|
|
1453
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/base-formly-component.ts
|
|
1467
1454
|
|
|
1468
1455
|
class ResizeService {
|
|
1469
1456
|
constructor() {
|
|
@@ -1481,6 +1468,8 @@ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", versio
|
|
|
1481
1468
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
|
|
1482
1469
|
type: Injectable
|
|
1483
1470
|
}], ctorParameters: function () { return []; } });
|
|
1471
|
+
;
|
|
1472
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/resize-service.ts
|
|
1484
1473
|
|
|
1485
1474
|
const log = Log.create(`[tnp-helpers] long-press`, Level.__NOTHING);
|
|
1486
1475
|
class LongPress {
|
|
@@ -1499,7 +1488,6 @@ class LongPress {
|
|
|
1499
1488
|
get press() { return this.pressing; }
|
|
1500
1489
|
get longPress() { return this.longPressing; }
|
|
1501
1490
|
onMouseDown(event) {
|
|
1502
|
-
// don't do right/middle clicks
|
|
1503
1491
|
log.d(`MOUSE DOWN `);
|
|
1504
1492
|
if (event.which !== 1)
|
|
1505
1493
|
return;
|
|
@@ -1583,12 +1571,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1583
1571
|
type: HostListener,
|
|
1584
1572
|
args: ['mouseup']
|
|
1585
1573
|
}] } });
|
|
1574
|
+
;
|
|
1575
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/long-press.directive.ts
|
|
1586
1576
|
|
|
1587
1577
|
/* */
|
|
1588
1578
|
/* */
|
|
1589
|
-
// export * from './git-project';
|
|
1590
1579
|
const Helpers = HelpersTnp.Instance;
|
|
1591
|
-
|
|
1580
|
+
;
|
|
1581
|
+
({}); // @--end-of-file-for-module=tnp-helpers tmp-src-bundle-websql/lib/index.ts
|
|
1592
1582
|
|
|
1593
1583
|
/**
|
|
1594
1584
|
* Generated bundle index. Do not edit.
|