tnp-helpers 13.1.11 → 13.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/app.js +3 -3
  2. package/browser/README.md +24 -24
  3. package/browser/esm2020/lib/base-component.mjs +49 -49
  4. package/browser/esm2020/lib/base-formly-component.mjs +112 -112
  5. package/browser/esm2020/lib/condition-wait.mjs +45 -45
  6. package/browser/esm2020/lib/constants.mjs +7 -7
  7. package/browser/esm2020/lib/dual-component-ctrl.mjs +118 -118
  8. package/browser/esm2020/lib/firedev-models.mjs +3 -3
  9. package/browser/esm2020/lib/helpers-array-obj.mjs +82 -82
  10. package/browser/esm2020/lib/helpers-environment.mjs +32 -32
  11. package/browser/esm2020/lib/helpers-numbers.mjs +8 -8
  12. package/browser/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  13. package/browser/esm2020/lib/helpers-strings.mjs +252 -252
  14. package/browser/esm2020/lib/helpers.mjs +280 -280
  15. package/browser/esm2020/lib/index.mjs +14 -14
  16. package/browser/esm2020/lib/long-press.directive.mjs +112 -112
  17. package/browser/esm2020/lib/project.mjs +429 -429
  18. package/browser/esm2020/lib/resize-service.mjs +21 -21
  19. package/browser/esm2020/public-api.mjs +1 -1
  20. package/browser/esm2020/tnp-helpers.mjs +4 -4
  21. package/browser/fesm2015/tnp-helpers.mjs +1542 -1542
  22. package/browser/fesm2020/tnp-helpers.mjs +1534 -1534
  23. package/browser/lib/base-component.d.ts +16 -16
  24. package/browser/lib/base-formly-component.d.ts +30 -30
  25. package/browser/lib/condition-wait.d.ts +7 -7
  26. package/browser/lib/constants.d.ts +5 -5
  27. package/browser/lib/dual-component-ctrl.d.ts +24 -24
  28. package/browser/lib/firedev-models.d.ts +12 -12
  29. package/browser/lib/helpers-array-obj.d.ts +14 -14
  30. package/browser/lib/helpers-environment.d.ts +4 -4
  31. package/browser/lib/helpers-numbers.d.ts +2 -2
  32. package/browser/lib/helpers-strings-regexes.d.ts +27 -27
  33. package/browser/lib/helpers-strings.d.ts +49 -49
  34. package/browser/lib/helpers.d.ts +27 -27
  35. package/browser/lib/index.d.ts +10 -10
  36. package/browser/lib/long-press.directive.d.ts +24 -24
  37. package/browser/lib/project.d.ts +94 -94
  38. package/browser/lib/resize-service.d.ts +8 -8
  39. package/browser/tnp-helpers.d.ts +4 -4
  40. package/client/README.md +24 -24
  41. package/client/esm2020/lib/base-component.mjs +49 -49
  42. package/client/esm2020/lib/base-formly-component.mjs +112 -112
  43. package/client/esm2020/lib/condition-wait.mjs +45 -45
  44. package/client/esm2020/lib/constants.mjs +7 -7
  45. package/client/esm2020/lib/dual-component-ctrl.mjs +118 -118
  46. package/client/esm2020/lib/firedev-models.mjs +3 -3
  47. package/client/esm2020/lib/helpers-array-obj.mjs +82 -82
  48. package/client/esm2020/lib/helpers-environment.mjs +32 -32
  49. package/client/esm2020/lib/helpers-numbers.mjs +8 -8
  50. package/client/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  51. package/client/esm2020/lib/helpers-strings.mjs +252 -252
  52. package/client/esm2020/lib/helpers.mjs +280 -280
  53. package/client/esm2020/lib/index.mjs +14 -14
  54. package/client/esm2020/lib/long-press.directive.mjs +112 -112
  55. package/client/esm2020/lib/project.mjs +429 -429
  56. package/client/esm2020/lib/resize-service.mjs +21 -21
  57. package/client/esm2020/public-api.mjs +1 -1
  58. package/client/esm2020/tnp-helpers.mjs +4 -4
  59. package/client/fesm2015/tnp-helpers.mjs +1542 -1542
  60. package/client/fesm2020/tnp-helpers.mjs +1534 -1534
  61. package/client/lib/base-component.d.ts +16 -16
  62. package/client/lib/base-formly-component.d.ts +30 -30
  63. package/client/lib/condition-wait.d.ts +7 -7
  64. package/client/lib/constants.d.ts +5 -5
  65. package/client/lib/dual-component-ctrl.d.ts +24 -24
  66. package/client/lib/firedev-models.d.ts +12 -12
  67. package/client/lib/helpers-array-obj.d.ts +14 -14
  68. package/client/lib/helpers-environment.d.ts +4 -4
  69. package/client/lib/helpers-numbers.d.ts +2 -2
  70. package/client/lib/helpers-strings-regexes.d.ts +27 -27
  71. package/client/lib/helpers-strings.d.ts +49 -49
  72. package/client/lib/helpers.d.ts +27 -27
  73. package/client/lib/index.d.ts +10 -10
  74. package/client/lib/long-press.directive.d.ts +24 -24
  75. package/client/lib/project.d.ts +94 -94
  76. package/client/lib/resize-service.d.ts +8 -8
  77. package/client/tnp-helpers.d.ts +4 -4
  78. package/index.d.ts +1 -1
  79. package/lib/angular.helper.d.ts +22 -22
  80. package/lib/base-component.d.ts +13 -13
  81. package/lib/base-component.js +3 -3
  82. package/lib/base-formly-component.d.ts +27 -27
  83. package/lib/base-formly-component.js +3 -3
  84. package/lib/condition-wait.d.ts +8 -8
  85. package/lib/constants.d.ts +6 -6
  86. package/lib/dual-component-ctrl.d.ts +24 -24
  87. package/lib/dual-component-ctrl.js +3 -3
  88. package/lib/firedev-models.d.ts +13 -13
  89. package/lib/git-project.d.ts +46 -46
  90. package/lib/helpers-array-obj.d.ts +15 -15
  91. package/lib/helpers-cli-tool.backend.d.ts +55 -55
  92. package/lib/helpers-dependencies.backend.d.ts +11 -11
  93. package/lib/helpers-environment.d.ts +5 -5
  94. package/lib/helpers-file-folders.backend.d.ts +83 -83
  95. package/lib/helpers-git.backend.d.ts +43 -43
  96. package/lib/helpers-json5.backend.d.ts +16 -16
  97. package/lib/helpers-morphi-framework.backend.d.ts +4 -4
  98. package/lib/helpers-network.backend.d.ts +8 -8
  99. package/lib/helpers-npm.backend.d.ts +3 -3
  100. package/lib/helpers-numbers.d.ts +3 -3
  101. package/lib/helpers-path.backend.d.ts +7 -7
  102. package/lib/helpers-process.backend.d.ts +53 -53
  103. package/lib/helpers-strings-regexes.d.ts +28 -28
  104. package/lib/helpers-strings.d.ts +50 -50
  105. package/lib/helpers-system-terminal.backend.d.ts +5 -5
  106. package/lib/helpers-vscode.backend.d.ts +5 -5
  107. package/lib/helpers.d.ts +69 -69
  108. package/lib/helpers.js +2 -2
  109. package/lib/index.d.ts +11 -11
  110. package/lib/long-press.directive.d.ts +22 -22
  111. package/lib/merge-helpers.backend.d.ts +23 -23
  112. package/lib/project.d.ts +97 -97
  113. package/lib/resize-service.d.ts +6 -6
  114. package/lib/ts-code/index.d.ts +1 -1
  115. package/lib/ts-code/ts-code-extractor.d.ts +14 -14
  116. package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
  117. package/package.json +2 -2
  118. package/package.json_devDependencies.json +222 -222
  119. package/package.json_tnp.json5 +44 -44
  120. package/tmp-environment.json +8 -8
  121. package/websql/README.md +24 -24
  122. package/websql/esm2020/lib/base-component.mjs +49 -49
  123. package/websql/esm2020/lib/base-formly-component.mjs +112 -112
  124. package/websql/esm2020/lib/condition-wait.mjs +45 -45
  125. package/websql/esm2020/lib/constants.mjs +7 -7
  126. package/websql/esm2020/lib/dual-component-ctrl.mjs +118 -118
  127. package/websql/esm2020/lib/firedev-models.mjs +3 -3
  128. package/websql/esm2020/lib/helpers-array-obj.mjs +82 -82
  129. package/websql/esm2020/lib/helpers-environment.mjs +32 -32
  130. package/websql/esm2020/lib/helpers-numbers.mjs +8 -8
  131. package/websql/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  132. package/websql/esm2020/lib/helpers-strings.mjs +252 -252
  133. package/websql/esm2020/lib/helpers.mjs +280 -280
  134. package/websql/esm2020/lib/index.mjs +14 -14
  135. package/websql/esm2020/lib/long-press.directive.mjs +112 -112
  136. package/websql/esm2020/lib/project.mjs +429 -429
  137. package/websql/esm2020/lib/resize-service.mjs +21 -21
  138. package/websql/esm2020/public-api.mjs +1 -1
  139. package/websql/esm2020/tnp-helpers.mjs +4 -4
  140. package/websql/fesm2015/tnp-helpers.mjs +1542 -1542
  141. package/websql/fesm2020/tnp-helpers.mjs +1534 -1534
  142. package/websql/lib/base-component.d.ts +16 -16
  143. package/websql/lib/base-formly-component.d.ts +30 -30
  144. package/websql/lib/condition-wait.d.ts +7 -7
  145. package/websql/lib/constants.d.ts +5 -5
  146. package/websql/lib/dual-component-ctrl.d.ts +24 -24
  147. package/websql/lib/firedev-models.d.ts +12 -12
  148. package/websql/lib/helpers-array-obj.d.ts +14 -14
  149. package/websql/lib/helpers-environment.d.ts +4 -4
  150. package/websql/lib/helpers-numbers.d.ts +2 -2
  151. package/websql/lib/helpers-strings-regexes.d.ts +27 -27
  152. package/websql/lib/helpers-strings.d.ts +49 -49
  153. package/websql/lib/helpers.d.ts +27 -27
  154. package/websql/lib/index.d.ts +10 -10
  155. package/websql/lib/long-press.directive.d.ts +24 -24
  156. package/websql/lib/project.d.ts +94 -94
  157. package/websql/lib/resize-service.d.ts +8 -8
  158. package/websql/tnp-helpers.d.ts +4 -4
@@ -10,1580 +10,1580 @@ import { FieldType } from '@ngx-formly/core';
10
10
  import { Log, Level } from 'ng2-logger/browser';
11
11
  import * as elementResizeDetectorMaker from 'element-resize-detector';
12
12
 
13
- class HelpersArrayObj {
14
- from(s) {
15
- if (_.isArray(s)) {
16
- return s;
17
- }
18
- if (_.isString(s)) {
19
- return s.split(' ');
20
- }
21
- }
22
- second(arr) {
23
- if (!Array.isArray(arr) || arr.length < 2) {
24
- return void 0;
25
- }
26
- return arr[1];
27
- }
28
- arrayMoveElementBefore(arr, a, b, prop) {
29
- let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
30
- _.pullAt(arr, indexA);
31
- let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
32
- if (indexB === 0) {
33
- arr.unshift(a);
34
- }
35
- else {
36
- arr.splice(indexB - 1, 0, a);
37
- }
38
- return arr;
39
- }
40
- arrayMoveElementAfterB(arr, a, b, prop) {
41
- let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
42
- _.pullAt(arr, indexA);
43
- let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
44
- if (indexB === arr.length - 1) {
45
- arr.push(a);
46
- }
47
- else {
48
- arr.splice(indexB + 1, 0, a);
49
- }
50
- return arr;
51
- }
52
- uniqArray(array, uniqueProperty) {
53
- var seen = {};
54
- return array
55
- .filter(f => !!f)
56
- .filter(function (item) {
57
- return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item) ? false
58
- : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
59
- });
60
- }
61
- sortKeys(obj) {
62
- if (_.isArray(obj)) {
63
- return obj.map(Helpers.arrays.sortKeys);
64
- }
65
- if (_.isObject(obj)) {
66
- return _.fromPairs(_.keys(obj).sort().map(key => [key, Helpers.arrays.sortKeys(obj[key])]));
67
- }
68
- return obj;
69
- }
70
- ;
71
- /**
72
- * Fuzzy search
73
- */
74
- fuzzy(query, list, valueFn) {
75
- const resultsFuzzy = fuzzy.filter(query, list.map(k => valueFn ? valueFn(k) : k));
76
- const resultsFuzzyKebab = fuzzy.filter(_.kebabCase(query), list.map(k => _.kebabCase((valueFn ? valueFn(k) : k))));
77
- const matches = resultsFuzzy.map((el) => el.string);
78
- const matchesKebab = resultsFuzzyKebab.map((el) => el.string);
79
- const results = (resultsFuzzy.length === 0) ? [] : list.filter(k => {
80
- return matches.includes((valueFn ? valueFn(k) : k));
81
- });
82
- if (matches.length === 0 && matchesKebab.length > 0) {
83
- const m = list.find(k => _.kebabCase((valueFn ? valueFn(k) : k)) === _.first(matchesKebab));
84
- results.push(m);
85
- matches.push((valueFn ? valueFn(m) : m));
86
- }
87
- return { matches, results };
88
- }
89
- }
90
- ;
13
+ class HelpersArrayObj {
14
+ from(s) {
15
+ if (_.isArray(s)) {
16
+ return s;
17
+ }
18
+ if (_.isString(s)) {
19
+ return s.split(' ');
20
+ }
21
+ }
22
+ second(arr) {
23
+ if (!Array.isArray(arr) || arr.length < 2) {
24
+ return void 0;
25
+ }
26
+ return arr[1];
27
+ }
28
+ arrayMoveElementBefore(arr, a, b, prop) {
29
+ let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
30
+ _.pullAt(arr, indexA);
31
+ let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
32
+ if (indexB === 0) {
33
+ arr.unshift(a);
34
+ }
35
+ else {
36
+ arr.splice(indexB - 1, 0, a);
37
+ }
38
+ return arr;
39
+ }
40
+ arrayMoveElementAfterB(arr, a, b, prop) {
41
+ let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
42
+ _.pullAt(arr, indexA);
43
+ let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
44
+ if (indexB === arr.length - 1) {
45
+ arr.push(a);
46
+ }
47
+ else {
48
+ arr.splice(indexB + 1, 0, a);
49
+ }
50
+ return arr;
51
+ }
52
+ uniqArray(array, uniqueProperty) {
53
+ var seen = {};
54
+ return array
55
+ .filter(f => !!f)
56
+ .filter(function (item) {
57
+ return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item) ? false
58
+ : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
59
+ });
60
+ }
61
+ sortKeys(obj) {
62
+ if (_.isArray(obj)) {
63
+ return obj.map(Helpers.arrays.sortKeys);
64
+ }
65
+ if (_.isObject(obj)) {
66
+ return _.fromPairs(_.keys(obj).sort().map(key => [key, Helpers.arrays.sortKeys(obj[key])]));
67
+ }
68
+ return obj;
69
+ }
70
+ ;
71
+ /**
72
+ * Fuzzy search
73
+ */
74
+ fuzzy(query, list, valueFn) {
75
+ const resultsFuzzy = fuzzy.filter(query, list.map(k => valueFn ? valueFn(k) : k));
76
+ const resultsFuzzyKebab = fuzzy.filter(_.kebabCase(query), list.map(k => _.kebabCase((valueFn ? valueFn(k) : k))));
77
+ const matches = resultsFuzzy.map((el) => el.string);
78
+ const matchesKebab = resultsFuzzyKebab.map((el) => el.string);
79
+ const results = (resultsFuzzy.length === 0) ? [] : list.filter(k => {
80
+ return matches.includes((valueFn ? valueFn(k) : k));
81
+ });
82
+ if (matches.length === 0 && matchesKebab.length > 0) {
83
+ const m = list.find(k => _.kebabCase((valueFn ? valueFn(k) : k)) === _.first(matchesKebab));
84
+ results.push(m);
85
+ matches.push((valueFn ? valueFn(m) : m));
86
+ }
87
+ return { matches, results };
88
+ }
89
+ }
90
+ ;
91
91
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-array-obj.ts
92
92
 
93
- class HelpersStringsRegexes {
94
- escapeStringForRegEx(s) {
95
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
96
- }
97
- matchExactOnce(s, regex) {
98
- if (!_.isString(s) || !_.isRegExp(regex)) {
99
- return void 0;
100
- }
101
- const result = s.match(regex);
102
- if (_.isNil(result)) {
103
- return void 0;
104
- }
105
- return result.length >= 1 ? _.first(result) : void 0;
106
- }
107
- get regex() {
108
- return {
109
- /**
110
- * mathes
111
- * xxx.xxx.xxx.xxx
112
- * xxx.xxx.xxx.xxx:port
113
- * http://xxx.xxx.xxx.xxx:port
114
- * http://xxx.xxx.xxx.xxx
115
- * https://xxx.xxx.xxx.xxx:port
116
- * https://xxx.xxx.xxx.xxx *
117
- */
118
- get forStringWithIpHost() {
119
- const regex = /(http(s)?\:\/\/)?(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]?)(\:[0-9]+)?/;
120
- return regex;
121
- },
122
- /**
123
- * mathes
124
- * http://domain.com:port
125
- * http://domain.com
126
- * http://domain:port
127
- * http://domain
128
- * https://domain.com:port
129
- * https://domain.com
130
- * https://domain:port
131
- * https://domain
132
- */
133
- get forStringWithDomainHost() {
134
- const regex = /(((http(s)?\:\/\/)?[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+(\:[0-9]+)?)|((http(s)?\:\/\/)[a-zA-Z0-9-]{1,61}))/;
135
- return regex;
136
- }
137
- };
138
- }
139
- }
140
- ;
93
+ class HelpersStringsRegexes {
94
+ escapeStringForRegEx(s) {
95
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
96
+ }
97
+ matchExactOnce(s, regex) {
98
+ if (!_.isString(s) || !_.isRegExp(regex)) {
99
+ return void 0;
100
+ }
101
+ const result = s.match(regex);
102
+ if (_.isNil(result)) {
103
+ return void 0;
104
+ }
105
+ return result.length >= 1 ? _.first(result) : void 0;
106
+ }
107
+ get regex() {
108
+ return {
109
+ /**
110
+ * mathes
111
+ * xxx.xxx.xxx.xxx
112
+ * xxx.xxx.xxx.xxx:port
113
+ * http://xxx.xxx.xxx.xxx:port
114
+ * http://xxx.xxx.xxx.xxx
115
+ * https://xxx.xxx.xxx.xxx:port
116
+ * https://xxx.xxx.xxx.xxx *
117
+ */
118
+ get forStringWithIpHost() {
119
+ const regex = /(http(s)?\:\/\/)?(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]?)(\:[0-9]+)?/;
120
+ return regex;
121
+ },
122
+ /**
123
+ * mathes
124
+ * http://domain.com:port
125
+ * http://domain.com
126
+ * http://domain:port
127
+ * http://domain
128
+ * https://domain.com:port
129
+ * https://domain.com
130
+ * https://domain:port
131
+ * https://domain
132
+ */
133
+ get forStringWithDomainHost() {
134
+ const regex = /(((http(s)?\:\/\/)?[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+(\:[0-9]+)?)|((http(s)?\:\/\/)[a-zA-Z0-9-]{1,61}))/;
135
+ return regex;
136
+ }
137
+ };
138
+ }
139
+ }
140
+ ;
141
141
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-strings-regexes.ts
142
142
 
143
- /* */
144
- /* */
145
- /* */
146
- /* */
147
- class HelpersEnvironment {
148
- environmentName(filename, local_env_name) {
149
- /* */
150
- /* */
151
- /* */
152
- /* */
153
- /* */
154
- /* */
155
- }
156
- isValidGitRepuUrl(url) {
157
- const regex = /^([A-Za-z0-9]+@|http(|s)\:\/\/)([A-Za-z0-9.]+(:\d+)?)(?::|\/)([\d\/\w.-]+?)(\.git)?$/;
158
- const res = regex.test(url);
159
- return res;
160
- }
161
- isValidIp(ip) {
162
- if (!_.isString(ip)) {
163
- return false;
164
- }
165
- ip = ip.trim();
166
- if (ip === 'localhost') {
167
- return true;
168
- }
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);
170
- }
171
- }
172
- ;
143
+ /* */
144
+ /* */
145
+ /* */
146
+ /* */
147
+ class HelpersEnvironment {
148
+ environmentName(filename, local_env_name) {
149
+ /* */
150
+ /* */
151
+ /* */
152
+ /* */
153
+ /* */
154
+ /* */
155
+ }
156
+ isValidGitRepuUrl(url) {
157
+ const regex = /^([A-Za-z0-9]+@|http(|s)\:\/\/)([A-Za-z0-9.]+(:\d+)?)(?::|\/)([\d\/\w.-]+?)(\.git)?$/;
158
+ const res = regex.test(url);
159
+ return res;
160
+ }
161
+ isValidIp(ip) {
162
+ if (!_.isString(ip)) {
163
+ return false;
164
+ }
165
+ ip = ip.trim();
166
+ if (ip === 'localhost') {
167
+ return true;
168
+ }
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);
170
+ }
171
+ }
172
+ ;
173
173
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-environment.ts
174
174
 
175
- class HelpersStrings {
176
- /**
177
- * Example:
178
- *
179
- * const result = interpolateString("I'm {age} years old!")
180
- * .withParameters({ age: 29 });
181
- *
182
- * const result = interpolateString("The {a} says {n}, {n}, {n}!")
183
- * .withParameters({ a: 'cow', n: 'moo' });
184
- *
185
- *
186
- * @param value string to interpolate
187
- * @param parameters object with parametes
188
- */
189
- interpolateString(value) {
190
- if (typeof value !== 'string') {
191
- Helpers.warn('[ss-logic][helper] Value for interpolation is not string: ', value);
192
- return value;
193
- }
194
- return {
195
- withParameters(parameters) {
196
- if (typeof parameters !== 'object') {
197
- Helpers.log(parameters);
198
- Helpers.warn('[ss-logic][helper] Parameters are not a object: ');
199
- return value;
200
- }
201
- return value.replace(/{([^{}]*)}/g, function (a, b) {
202
- var r = parameters[b];
203
- return typeof r === 'string' || typeof r === 'number' ? r : a;
204
- });
205
- }
206
- };
207
- }
208
- numValue(pixelsCss) {
209
- return parseInt(pixelsCss.replace('px', ''));
210
- }
211
- /**
212
- * examples:
213
- * 'aa bb bb' => ['aa','bb','cc'],
214
- * 'aa' => ['aa']
215
- * ['aa'] => ['aa']
216
- */
217
- splitIfNeed(stringOrArr) {
218
- let res = [];
219
- if (_.isArray(stringOrArr)) {
220
- res = stringOrArr.map(s => {
221
- return s.trim();
222
- });
223
- }
224
- if (_.isString(stringOrArr)) {
225
- res = stringOrArr.split(/\s*[\s,]\s*/);
226
- }
227
- return res.filter(f => !!f && (f.trim() !== ''));
228
- }
229
- removeDoubleOrMoreEmptyLines(s) {
230
- s = s === null || s === void 0 ? void 0 : s.split('\n').map(f => f.trimRight()).join('\n');
231
- return s === null || s === void 0 ? void 0 : s.replace(/(\r\n|\r|\n){2,}/g, '$1\n');
232
- }
233
- /**
234
- *
235
- * https://stackoverflow.com/a/57129703/1345101
236
- *
237
- * Returns the plural of an English word.
238
- *
239
- * @export
240
- * @param {string} word
241
- * @param {number} [amount]
242
- * @returns {string}
243
- */
244
- plural(word, amount) {
245
- if (amount !== undefined && amount === 1) {
246
- return word;
247
- }
248
- const plural = {
249
- '(quiz)$': "$1zes",
250
- '^(ox)$': "$1en",
251
- '([m|l])ouse$': "$1ice",
252
- '(matr|vert|ind)ix|ex$': "$1ices",
253
- '(x|ch|ss|sh)$': "$1es",
254
- '([^aeiouy]|qu)y$': "$1ies",
255
- '(hive)$': "$1s",
256
- '(?:([^f])fe|([lr])f)$': "$1$2ves",
257
- '(shea|lea|loa|thie)f$': "$1ves",
258
- 'sis$': "ses",
259
- '([ti])um$': "$1a",
260
- '(tomat|potat|ech|her|vet)o$': "$1oes",
261
- '(bu)s$': "$1ses",
262
- '(alias)$': "$1es",
263
- '(octop)us$': "$1i",
264
- '(ax|test)is$': "$1es",
265
- '(us)$': "$1es",
266
- '([^s]+)$': "$1s"
267
- };
268
- const irregular = {
269
- 'move': 'moves',
270
- 'foot': 'feet',
271
- 'goose': 'geese',
272
- 'sex': 'sexes',
273
- 'child': 'children',
274
- 'man': 'men',
275
- 'tooth': 'teeth',
276
- 'person': 'people'
277
- };
278
- const uncountable = [
279
- 'sheep',
280
- 'fish',
281
- 'deer',
282
- 'moose',
283
- 'series',
284
- 'species',
285
- 'money',
286
- 'rice',
287
- 'information',
288
- 'equipment',
289
- 'bison',
290
- 'cod',
291
- 'offspring',
292
- 'pike',
293
- 'salmon',
294
- 'shrimp',
295
- 'swine',
296
- 'trout',
297
- 'aircraft',
298
- 'hovercraft',
299
- 'spacecraft',
300
- 'sugar',
301
- 'tuna',
302
- 'you',
303
- 'wood'
304
- ];
305
- if (uncountable.indexOf(word.toLowerCase()) >= 0) {
306
- return word;
307
- }
308
- for (const w in irregular) {
309
- const pattern = new RegExp(`${w}$`, 'i');
310
- const replace = irregular[w];
311
- if (pattern.test(word)) {
312
- return word.replace(pattern, replace);
313
- }
314
- }
315
- for (const reg in plural) {
316
- const pattern = new RegExp(reg, 'i');
317
- if (pattern.test(word)) {
318
- return word.replace(pattern, plural[reg]);
319
- }
320
- }
321
- return word;
322
- }
323
- /**
324
- * https://stackoverflow.com/a/57129703/1345101
325
- *
326
- * Returns the singular of an English word.
327
- *
328
- * @export
329
- * @param {string} word
330
- * @param {number} [amount]
331
- * @returns {string}
332
- */
333
- singular(word, amount) {
334
- if (amount !== undefined && amount !== 1) {
335
- return word;
336
- }
337
- const singular = {
338
- '(quiz)zes$': "$1",
339
- '(matr)ices$': "$1ix",
340
- '(vert|ind)ices$': "$1ex",
341
- '^(ox)en$': "$1",
342
- '(alias)es$': "$1",
343
- '(octop|vir)i$': "$1us",
344
- '(cris|ax|test)es$': "$1is",
345
- '(shoe)s$': "$1",
346
- '(o)es$': "$1",
347
- '(bus)es$': "$1",
348
- '([m|l])ice$': "$1ouse",
349
- '(x|ch|ss|sh)es$': "$1",
350
- '(m)ovies$': "$1ovie",
351
- '(s)eries$': "$1eries",
352
- '([^aeiouy]|qu)ies$': "$1y",
353
- '([lr])ves$': "$1f",
354
- '(tive)s$': "$1",
355
- '(hive)s$': "$1",
356
- '(li|wi|kni)ves$': "$1fe",
357
- '(shea|loa|lea|thie)ves$': "$1f",
358
- '(^analy)ses$': "$1sis",
359
- '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$': "$1$2sis",
360
- '([ti])a$': "$1um",
361
- '(n)ews$': "$1ews",
362
- '(h|bl)ouses$': "$1ouse",
363
- '(corpse)s$': "$1",
364
- '(us)es$': "$1",
365
- 's$': ""
366
- };
367
- const irregular = {
368
- 'move': 'moves',
369
- 'foot': 'feet',
370
- 'goose': 'geese',
371
- 'sex': 'sexes',
372
- 'child': 'children',
373
- 'man': 'men',
374
- 'tooth': 'teeth',
375
- 'person': 'people'
376
- };
377
- const uncountable = [
378
- 'sheep',
379
- 'fish',
380
- 'deer',
381
- 'moose',
382
- 'series',
383
- 'species',
384
- 'money',
385
- 'rice',
386
- 'information',
387
- 'equipment',
388
- 'bison',
389
- 'cod',
390
- 'offspring',
391
- 'pike',
392
- 'salmon',
393
- 'shrimp',
394
- 'swine',
395
- 'trout',
396
- 'aircraft',
397
- 'hovercraft',
398
- 'spacecraft',
399
- 'sugar',
400
- 'tuna',
401
- 'you',
402
- 'wood'
403
- ];
404
- if (uncountable.indexOf(word.toLowerCase()) >= 0) {
405
- return word;
406
- }
407
- for (const w in irregular) {
408
- const pattern = new RegExp(`${irregular[w]}$`, 'i');
409
- const replace = w;
410
- if (pattern.test(word)) {
411
- return word.replace(pattern, replace);
412
- }
413
- }
414
- for (const reg in singular) {
415
- const pattern = new RegExp(reg, 'i');
416
- if (pattern.test(word)) {
417
- return word.replace(pattern, singular[reg]);
418
- }
419
- }
420
- return word;
421
- }
422
- }
423
- ;
175
+ class HelpersStrings {
176
+ /**
177
+ * Example:
178
+ *
179
+ * const result = interpolateString("I'm {age} years old!")
180
+ * .withParameters({ age: 29 });
181
+ *
182
+ * const result = interpolateString("The {a} says {n}, {n}, {n}!")
183
+ * .withParameters({ a: 'cow', n: 'moo' });
184
+ *
185
+ *
186
+ * @param value string to interpolate
187
+ * @param parameters object with parametes
188
+ */
189
+ interpolateString(value) {
190
+ if (typeof value !== 'string') {
191
+ Helpers.warn('[ss-logic][helper] Value for interpolation is not string: ', value);
192
+ return value;
193
+ }
194
+ return {
195
+ withParameters(parameters) {
196
+ if (typeof parameters !== 'object') {
197
+ Helpers.log(parameters);
198
+ Helpers.warn('[ss-logic][helper] Parameters are not a object: ');
199
+ return value;
200
+ }
201
+ return value.replace(/{([^{}]*)}/g, function (a, b) {
202
+ var r = parameters[b];
203
+ return typeof r === 'string' || typeof r === 'number' ? r : a;
204
+ });
205
+ }
206
+ };
207
+ }
208
+ numValue(pixelsCss) {
209
+ return parseInt(pixelsCss.replace('px', ''));
210
+ }
211
+ /**
212
+ * examples:
213
+ * 'aa bb bb' => ['aa','bb','cc'],
214
+ * 'aa' => ['aa']
215
+ * ['aa'] => ['aa']
216
+ */
217
+ splitIfNeed(stringOrArr) {
218
+ let res = [];
219
+ if (_.isArray(stringOrArr)) {
220
+ res = stringOrArr.map(s => {
221
+ return s.trim();
222
+ });
223
+ }
224
+ if (_.isString(stringOrArr)) {
225
+ res = stringOrArr.split(/\s*[\s,]\s*/);
226
+ }
227
+ return res.filter(f => !!f && (f.trim() !== ''));
228
+ }
229
+ removeDoubleOrMoreEmptyLines(s) {
230
+ s = s === null || s === void 0 ? void 0 : s.split('\n').map(f => f.trimRight()).join('\n');
231
+ return s === null || s === void 0 ? void 0 : s.replace(/(\r\n|\r|\n){2,}/g, '$1\n');
232
+ }
233
+ /**
234
+ *
235
+ * https://stackoverflow.com/a/57129703/1345101
236
+ *
237
+ * Returns the plural of an English word.
238
+ *
239
+ * @export
240
+ * @param {string} word
241
+ * @param {number} [amount]
242
+ * @returns {string}
243
+ */
244
+ plural(word, amount) {
245
+ if (amount !== undefined && amount === 1) {
246
+ return word;
247
+ }
248
+ const plural = {
249
+ '(quiz)$': "$1zes",
250
+ '^(ox)$': "$1en",
251
+ '([m|l])ouse$': "$1ice",
252
+ '(matr|vert|ind)ix|ex$': "$1ices",
253
+ '(x|ch|ss|sh)$': "$1es",
254
+ '([^aeiouy]|qu)y$': "$1ies",
255
+ '(hive)$': "$1s",
256
+ '(?:([^f])fe|([lr])f)$': "$1$2ves",
257
+ '(shea|lea|loa|thie)f$': "$1ves",
258
+ 'sis$': "ses",
259
+ '([ti])um$': "$1a",
260
+ '(tomat|potat|ech|her|vet)o$': "$1oes",
261
+ '(bu)s$': "$1ses",
262
+ '(alias)$': "$1es",
263
+ '(octop)us$': "$1i",
264
+ '(ax|test)is$': "$1es",
265
+ '(us)$': "$1es",
266
+ '([^s]+)$': "$1s"
267
+ };
268
+ const irregular = {
269
+ 'move': 'moves',
270
+ 'foot': 'feet',
271
+ 'goose': 'geese',
272
+ 'sex': 'sexes',
273
+ 'child': 'children',
274
+ 'man': 'men',
275
+ 'tooth': 'teeth',
276
+ 'person': 'people'
277
+ };
278
+ const uncountable = [
279
+ 'sheep',
280
+ 'fish',
281
+ 'deer',
282
+ 'moose',
283
+ 'series',
284
+ 'species',
285
+ 'money',
286
+ 'rice',
287
+ 'information',
288
+ 'equipment',
289
+ 'bison',
290
+ 'cod',
291
+ 'offspring',
292
+ 'pike',
293
+ 'salmon',
294
+ 'shrimp',
295
+ 'swine',
296
+ 'trout',
297
+ 'aircraft',
298
+ 'hovercraft',
299
+ 'spacecraft',
300
+ 'sugar',
301
+ 'tuna',
302
+ 'you',
303
+ 'wood'
304
+ ];
305
+ if (uncountable.indexOf(word.toLowerCase()) >= 0) {
306
+ return word;
307
+ }
308
+ for (const w in irregular) {
309
+ const pattern = new RegExp(`${w}$`, 'i');
310
+ const replace = irregular[w];
311
+ if (pattern.test(word)) {
312
+ return word.replace(pattern, replace);
313
+ }
314
+ }
315
+ for (const reg in plural) {
316
+ const pattern = new RegExp(reg, 'i');
317
+ if (pattern.test(word)) {
318
+ return word.replace(pattern, plural[reg]);
319
+ }
320
+ }
321
+ return word;
322
+ }
323
+ /**
324
+ * https://stackoverflow.com/a/57129703/1345101
325
+ *
326
+ * Returns the singular of an English word.
327
+ *
328
+ * @export
329
+ * @param {string} word
330
+ * @param {number} [amount]
331
+ * @returns {string}
332
+ */
333
+ singular(word, amount) {
334
+ if (amount !== undefined && amount !== 1) {
335
+ return word;
336
+ }
337
+ const singular = {
338
+ '(quiz)zes$': "$1",
339
+ '(matr)ices$': "$1ix",
340
+ '(vert|ind)ices$': "$1ex",
341
+ '^(ox)en$': "$1",
342
+ '(alias)es$': "$1",
343
+ '(octop|vir)i$': "$1us",
344
+ '(cris|ax|test)es$': "$1is",
345
+ '(shoe)s$': "$1",
346
+ '(o)es$': "$1",
347
+ '(bus)es$': "$1",
348
+ '([m|l])ice$': "$1ouse",
349
+ '(x|ch|ss|sh)es$': "$1",
350
+ '(m)ovies$': "$1ovie",
351
+ '(s)eries$': "$1eries",
352
+ '([^aeiouy]|qu)ies$': "$1y",
353
+ '([lr])ves$': "$1f",
354
+ '(tive)s$': "$1",
355
+ '(hive)s$': "$1",
356
+ '(li|wi|kni)ves$': "$1fe",
357
+ '(shea|loa|lea|thie)ves$': "$1f",
358
+ '(^analy)ses$': "$1sis",
359
+ '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$': "$1$2sis",
360
+ '([ti])a$': "$1um",
361
+ '(n)ews$': "$1ews",
362
+ '(h|bl)ouses$': "$1ouse",
363
+ '(corpse)s$': "$1",
364
+ '(us)es$': "$1",
365
+ 's$': ""
366
+ };
367
+ const irregular = {
368
+ 'move': 'moves',
369
+ 'foot': 'feet',
370
+ 'goose': 'geese',
371
+ 'sex': 'sexes',
372
+ 'child': 'children',
373
+ 'man': 'men',
374
+ 'tooth': 'teeth',
375
+ 'person': 'people'
376
+ };
377
+ const uncountable = [
378
+ 'sheep',
379
+ 'fish',
380
+ 'deer',
381
+ 'moose',
382
+ 'series',
383
+ 'species',
384
+ 'money',
385
+ 'rice',
386
+ 'information',
387
+ 'equipment',
388
+ 'bison',
389
+ 'cod',
390
+ 'offspring',
391
+ 'pike',
392
+ 'salmon',
393
+ 'shrimp',
394
+ 'swine',
395
+ 'trout',
396
+ 'aircraft',
397
+ 'hovercraft',
398
+ 'spacecraft',
399
+ 'sugar',
400
+ 'tuna',
401
+ 'you',
402
+ 'wood'
403
+ ];
404
+ if (uncountable.indexOf(word.toLowerCase()) >= 0) {
405
+ return word;
406
+ }
407
+ for (const w in irregular) {
408
+ const pattern = new RegExp(`${irregular[w]}$`, 'i');
409
+ const replace = w;
410
+ if (pattern.test(word)) {
411
+ return word.replace(pattern, replace);
412
+ }
413
+ }
414
+ for (const reg in singular) {
415
+ const pattern = new RegExp(reg, 'i');
416
+ if (pattern.test(word)) {
417
+ return word.replace(pattern, singular[reg]);
418
+ }
419
+ }
420
+ return word;
421
+ }
422
+ }
423
+ ;
424
424
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-strings.ts
425
425
 
426
- function conditionWait(conditionAndTimeout) {
427
- return __awaiter(this, void 0, void 0, function* () {
428
- yield waitFor(conditionAndTimeout);
429
- });
430
- }
431
- function waitFor(arr, messageToShow = void 0) {
432
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
433
- if (arr.length === 0) {
434
- resolve(void 0);
435
- }
436
- else {
437
- const check = arr.shift();
438
- if (_.isUndefined(check.timeoutCheck)) {
439
- check.timeoutCheck = 2000;
440
- }
441
- if (_.isUndefined(check.timeoutNext)) {
442
- check.timeoutNext = 4000;
443
- }
444
- const { timeoutCheck, timeoutNext, name } = check;
445
- const resultTrue = yield Helpers.runSyncOrAsync(check.callback, check);
446
- if (resultTrue) {
447
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
448
- yield waitFor(arr).then(() => {
449
- resolve(void 0);
450
- });
451
- }), timeoutNext);
452
- }
453
- else {
454
- arr.unshift(check);
455
- if (!messageToShow || check.errorMessage !== messageToShow) {
456
- Helpers.info(check.errorMessage);
457
- }
458
- else {
459
- }
460
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
461
- yield waitFor(arr, check.errorMessage).then(() => {
462
- resolve(void 0);
463
- });
464
- }), timeoutCheck);
465
- }
466
- }
467
- }));
468
- }
469
- ;
426
+ function conditionWait(conditionAndTimeout) {
427
+ return __awaiter(this, void 0, void 0, function* () {
428
+ yield waitFor(conditionAndTimeout);
429
+ });
430
+ }
431
+ function waitFor(arr, messageToShow = void 0) {
432
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
433
+ if (arr.length === 0) {
434
+ resolve(void 0);
435
+ }
436
+ else {
437
+ const check = arr.shift();
438
+ if (_.isUndefined(check.timeoutCheck)) {
439
+ check.timeoutCheck = 2000;
440
+ }
441
+ if (_.isUndefined(check.timeoutNext)) {
442
+ check.timeoutNext = 4000;
443
+ }
444
+ const { timeoutCheck, timeoutNext, name } = check;
445
+ const resultTrue = yield Helpers.runSyncOrAsync(check.callback, check);
446
+ if (resultTrue) {
447
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
448
+ yield waitFor(arr).then(() => {
449
+ resolve(void 0);
450
+ });
451
+ }), timeoutNext);
452
+ }
453
+ else {
454
+ arr.unshift(check);
455
+ if (!messageToShow || check.errorMessage !== messageToShow) {
456
+ Helpers.info(check.errorMessage);
457
+ }
458
+ else {
459
+ }
460
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
461
+ yield waitFor(arr, check.errorMessage).then(() => {
462
+ resolve(void 0);
463
+ });
464
+ }), timeoutCheck);
465
+ }
466
+ }
467
+ }));
468
+ }
469
+ ;
470
470
  ({}); // @--end-of-file-for-module=tnp-helpers lib/condition-wait.ts
471
471
 
472
- class HelpersNumber {
473
- constructor() {
474
- this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
475
- }
476
- }
477
- ;
472
+ class HelpersNumber {
473
+ constructor() {
474
+ this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
475
+ }
476
+ }
477
+ ;
478
478
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-numbers.ts
479
479
 
480
- function applyMixins(derivedCtor, baseCtors) {
481
- baseCtors.forEach(baseCtor => {
482
- Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
483
- Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
484
- });
485
- });
486
- }
487
- // @ts-ignore
488
- class HelpersTnp extends CoreHelpers {
489
- constructor(
490
- /* */
491
- /* */
492
- /* */
493
- /* */
494
- /* */
495
- /* */
496
- /* */
497
- /* */
498
- /* */
499
- /* */
500
- /* */
501
- /* */
502
- /* */
503
- arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber()) {
504
- super();
505
- this.arrays = arrays;
506
- this.strings = strings;
507
- this.numbers = numbers;
508
- this.conditionWait = conditionWait;
509
- /* */
510
- /* */
511
- /* */
512
- /* */
513
- /* */
514
- /* */
515
- /* */
516
- /* */
517
- /* */
518
- /* */
519
- /* */
520
- /* */
521
- /* */
522
- /* */
523
- /* */
524
- /* */
525
- /* */
526
- /* */
527
- /* */
528
- /* */
529
- /* */
530
- /* */
531
- /* */
532
- /* */
533
- /* */
534
- /* */
535
- /* */
536
- /* */
537
- /* */
538
- /* */
539
- /* */
540
- /* */
541
- /* */
542
- /* */
543
- /* */
544
- /* */
545
- /* */
546
- /* */
547
- /* */
548
- /* */
549
- /* */
550
- /* */
551
- /* */
552
- /* */
553
- /* */
554
- /* */
555
- /* */
556
- /* */
557
- /* */
558
- /* */
559
- /* */
560
- /* */
561
- /* */
562
- /* */
563
- /* */
564
- /* */
565
- /* */
566
- /* */
567
- /* */
568
- /* */
569
- /* */
570
- /* */
571
- /* */
572
- /* */
573
- /* */
574
- /* */
575
- /* */
576
- /* */
577
- /* */
578
- /* */
579
- /* */
580
- /* */
581
- /* */
582
- /* */
583
- /* */
584
- /* */
585
- /* */
586
- /* */
587
- this.applyMixins = applyMixins;
588
- }
589
- static get Instance() {
590
- if (!HelpersTnp._instance) {
591
- HelpersTnp._instance = new HelpersTnp();
592
- }
593
- return HelpersTnp._instance;
594
- }
595
- CLIWRAP(f, name) {
596
- CLASS.setName(f, name);
597
- return f;
598
- }
599
- /* */
600
- /* */
601
- /* */
602
- /* */
603
- /* */
604
- /* */
605
- /* */
606
- /* */
607
- /* */
608
- /* */
609
- /* */
610
- /* */
611
- /* */
612
- /* */
613
- /* */
614
- /* */
615
- /* */
616
- /* */
617
- /* */
618
- /* */
619
- /* */
620
- /* */
621
- /* */
622
- /* */
623
- /* */
624
- /* */
625
- /* */
626
- /* */
627
- /* */
628
- /* */
629
- /* */
630
- /* */
631
- /* */
632
- /* */
633
- /* */
634
- /* */
635
- /* */
636
- /* */
637
- isElevated() {
638
- return __awaiter(this, void 0, void 0, function* () {
639
- /* */
640
- /* */
641
- /* */
642
- /* */
643
- });
644
- }
645
- /* */
646
- /* */
647
- /* */
648
- /* */
649
- /* */
650
- /* */
651
- /* */
652
- /* */
653
- /* */
654
- /* */
655
- /* */
656
- /* */
657
- /* */
658
- /* */
659
- /* */
660
- /* */
661
- /* */
662
- /* */
663
- /* */
664
- /* */
665
- /* */
666
- /* */
667
- /* */
668
- /* */
669
- mesureExectionInMs(description, functionToExecute, ...functionArguments) {
670
- return __awaiter(this, void 0, void 0, function* () {
671
- var start = new Date();
672
- yield Helpers.runSyncOrAsync(functionToExecute, ...functionArguments);
673
- //@ts-ignore
674
- var end = new Date() - start;
675
- if (Morphi.IsBrowser) {
676
- Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
677
- }
678
- /* */
679
- /* */
680
- return end;
681
- });
682
- }
683
- mesureExectionInMsSync(description, functionToExecute) {
684
- var start = new Date();
685
- functionToExecute();
686
- //@ts-ignore
687
- var end = new Date() - start;
688
- if (Morphi.IsBrowser) {
689
- Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
690
- }
691
- /* */
692
- /* */
693
- return end;
694
- }
695
- waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
696
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
697
- const result = yield Helpers.runSyncOrAsync(conditionFn);
698
- if (result) {
699
- resolve(void 0);
700
- }
701
- else {
702
- setTimeout(() => {
703
- Helpers.waitForCondition(conditionFn, howOfftenCheckInMs).then(() => {
704
- resolve(void 0);
705
- });
706
- }, howOfftenCheckInMs);
707
- }
708
- }));
709
- }
710
- getBrowserVerPath(moduleName, websql = false) {
711
- /* */
712
- /* */
713
- /* */
714
- /* */
715
- /* */
716
- }
717
- getMethodName(obj, method) {
718
- var methodName = null;
719
- Object.getOwnPropertyNames(obj).forEach(prop => {
720
- if (obj[prop] === method) {
721
- methodName = prop;
722
- }
723
- });
724
- if (methodName !== null) {
725
- return methodName;
726
- }
727
- var proto = Object.getPrototypeOf(obj);
728
- if (proto) {
729
- return Helpers.getMethodName(proto, method);
730
- }
731
- return null;
732
- }
733
- fixWebpackEnv(env) {
734
- _.forIn(env, (v, k) => {
735
- const value = v;
736
- if (value === 'true')
737
- env[k] = true;
738
- if (value === 'false')
739
- env[k] = false;
740
- });
741
- }
742
- }
743
- applyMixins(HelpersTnp, [
744
- HelpersStringsRegexes,
745
- HelpersEnvironment,
746
- /* */
747
- /* */
748
- /* */
749
- ]);
750
- ;
480
+ function applyMixins(derivedCtor, baseCtors) {
481
+ baseCtors.forEach(baseCtor => {
482
+ Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
483
+ Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
484
+ });
485
+ });
486
+ }
487
+ // @ts-ignore
488
+ class HelpersTnp extends CoreHelpers {
489
+ constructor(
490
+ /* */
491
+ /* */
492
+ /* */
493
+ /* */
494
+ /* */
495
+ /* */
496
+ /* */
497
+ /* */
498
+ /* */
499
+ /* */
500
+ /* */
501
+ /* */
502
+ /* */
503
+ arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber()) {
504
+ super();
505
+ this.arrays = arrays;
506
+ this.strings = strings;
507
+ this.numbers = numbers;
508
+ this.conditionWait = conditionWait;
509
+ /* */
510
+ /* */
511
+ /* */
512
+ /* */
513
+ /* */
514
+ /* */
515
+ /* */
516
+ /* */
517
+ /* */
518
+ /* */
519
+ /* */
520
+ /* */
521
+ /* */
522
+ /* */
523
+ /* */
524
+ /* */
525
+ /* */
526
+ /* */
527
+ /* */
528
+ /* */
529
+ /* */
530
+ /* */
531
+ /* */
532
+ /* */
533
+ /* */
534
+ /* */
535
+ /* */
536
+ /* */
537
+ /* */
538
+ /* */
539
+ /* */
540
+ /* */
541
+ /* */
542
+ /* */
543
+ /* */
544
+ /* */
545
+ /* */
546
+ /* */
547
+ /* */
548
+ /* */
549
+ /* */
550
+ /* */
551
+ /* */
552
+ /* */
553
+ /* */
554
+ /* */
555
+ /* */
556
+ /* */
557
+ /* */
558
+ /* */
559
+ /* */
560
+ /* */
561
+ /* */
562
+ /* */
563
+ /* */
564
+ /* */
565
+ /* */
566
+ /* */
567
+ /* */
568
+ /* */
569
+ /* */
570
+ /* */
571
+ /* */
572
+ /* */
573
+ /* */
574
+ /* */
575
+ /* */
576
+ /* */
577
+ /* */
578
+ /* */
579
+ /* */
580
+ /* */
581
+ /* */
582
+ /* */
583
+ /* */
584
+ /* */
585
+ /* */
586
+ /* */
587
+ this.applyMixins = applyMixins;
588
+ }
589
+ static get Instance() {
590
+ if (!HelpersTnp._instance) {
591
+ HelpersTnp._instance = new HelpersTnp();
592
+ }
593
+ return HelpersTnp._instance;
594
+ }
595
+ CLIWRAP(f, name) {
596
+ CLASS.setName(f, name);
597
+ return f;
598
+ }
599
+ /* */
600
+ /* */
601
+ /* */
602
+ /* */
603
+ /* */
604
+ /* */
605
+ /* */
606
+ /* */
607
+ /* */
608
+ /* */
609
+ /* */
610
+ /* */
611
+ /* */
612
+ /* */
613
+ /* */
614
+ /* */
615
+ /* */
616
+ /* */
617
+ /* */
618
+ /* */
619
+ /* */
620
+ /* */
621
+ /* */
622
+ /* */
623
+ /* */
624
+ /* */
625
+ /* */
626
+ /* */
627
+ /* */
628
+ /* */
629
+ /* */
630
+ /* */
631
+ /* */
632
+ /* */
633
+ /* */
634
+ /* */
635
+ /* */
636
+ /* */
637
+ isElevated() {
638
+ return __awaiter(this, void 0, void 0, function* () {
639
+ /* */
640
+ /* */
641
+ /* */
642
+ /* */
643
+ });
644
+ }
645
+ /* */
646
+ /* */
647
+ /* */
648
+ /* */
649
+ /* */
650
+ /* */
651
+ /* */
652
+ /* */
653
+ /* */
654
+ /* */
655
+ /* */
656
+ /* */
657
+ /* */
658
+ /* */
659
+ /* */
660
+ /* */
661
+ /* */
662
+ /* */
663
+ /* */
664
+ /* */
665
+ /* */
666
+ /* */
667
+ /* */
668
+ /* */
669
+ mesureExectionInMs(description, functionToExecute, ...functionArguments) {
670
+ return __awaiter(this, void 0, void 0, function* () {
671
+ var start = new Date();
672
+ yield Helpers.runSyncOrAsync(functionToExecute, ...functionArguments);
673
+ //@ts-ignore
674
+ var end = new Date() - start;
675
+ if (Morphi.IsBrowser) {
676
+ Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
677
+ }
678
+ /* */
679
+ /* */
680
+ return end;
681
+ });
682
+ }
683
+ mesureExectionInMsSync(description, functionToExecute) {
684
+ var start = new Date();
685
+ functionToExecute();
686
+ //@ts-ignore
687
+ var end = new Date() - start;
688
+ if (Morphi.IsBrowser) {
689
+ Helpers.log(`Execution time: ${end.toString()}ms for "${description}"`);
690
+ }
691
+ /* */
692
+ /* */
693
+ return end;
694
+ }
695
+ waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
696
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
697
+ const result = yield Helpers.runSyncOrAsync(conditionFn);
698
+ if (result) {
699
+ resolve(void 0);
700
+ }
701
+ else {
702
+ setTimeout(() => {
703
+ Helpers.waitForCondition(conditionFn, howOfftenCheckInMs).then(() => {
704
+ resolve(void 0);
705
+ });
706
+ }, howOfftenCheckInMs);
707
+ }
708
+ }));
709
+ }
710
+ getBrowserVerPath(moduleName, websql = false) {
711
+ /* */
712
+ /* */
713
+ /* */
714
+ /* */
715
+ /* */
716
+ }
717
+ getMethodName(obj, method) {
718
+ var methodName = null;
719
+ Object.getOwnPropertyNames(obj).forEach(prop => {
720
+ if (obj[prop] === method) {
721
+ methodName = prop;
722
+ }
723
+ });
724
+ if (methodName !== null) {
725
+ return methodName;
726
+ }
727
+ var proto = Object.getPrototypeOf(obj);
728
+ if (proto) {
729
+ return Helpers.getMethodName(proto, method);
730
+ }
731
+ return null;
732
+ }
733
+ fixWebpackEnv(env) {
734
+ _.forIn(env, (v, k) => {
735
+ const value = v;
736
+ if (value === 'true')
737
+ env[k] = true;
738
+ if (value === 'false')
739
+ env[k] = false;
740
+ });
741
+ }
742
+ }
743
+ applyMixins(HelpersTnp, [
744
+ HelpersStringsRegexes,
745
+ HelpersEnvironment,
746
+ /* */
747
+ /* */
748
+ /* */
749
+ ]);
750
+ ;
751
751
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers.ts
752
752
 
753
- const BaselineSiteJoinprefix = '__';
754
- const PREFIXES = {
755
- BASELINE: BaselineSiteJoinprefix,
756
- DELETED: '____DELETED____',
757
- ORIGINAL: '____ORIGINAL____',
758
- };
753
+ const BaselineSiteJoinprefix = '__';
754
+ const PREFIXES = {
755
+ BASELINE: BaselineSiteJoinprefix,
756
+ DELETED: '____DELETED____',
757
+ ORIGINAL: '____ORIGINAL____',
758
+ };
759
759
  ({}); // @--end-of-file-for-module=tnp-helpers lib/constants.ts
760
760
 
761
- /* */
762
- const Helpers$1 = HelpersTnp.Instance;
763
- class Project {
764
- constructor() {
765
- /* */
766
- /* */
767
- this.cache = {};
768
- this.browser = {};
769
- }
770
- static typeFrom(location) {
771
- /* */
772
- /* */
773
- /* */
774
- /* */
775
- /* */
776
- /* */
777
- /* */
778
- /* */
779
- /* */
780
- /* */
781
- /* */
782
- /* */
783
- return (void 0);
784
- }
785
- static unload(project) {
786
- Project.projects = Project.projects.filter(f => f !== project);
787
- }
788
- static From(locationOfProj) {
789
- /* */
790
- /* */
791
- /* */
792
- /* */
793
- /* */
794
- /* */
795
- /* */
796
- /* */
797
- /* */
798
- /* */
799
- /* */
800
- /* */
801
- /* */
802
- /* */
803
- /* */
804
- /* */
805
- /* */
806
- /* */
807
- /* */
808
- /* */
809
- /* */
810
- /* */
811
- /* */
812
- /* */
813
- /* */
814
- /* */
815
- /* */
816
- /* */
817
- /* */
818
- /* */
819
- /* */
820
- /* */
821
- /* */
822
- /* */
823
- /* */
824
- /* */
825
- /* */
826
- /* */
827
- /* */
828
- /* */
829
- /* */
830
- /* */
831
- /* */
832
- /* */
833
- /* */
834
- /* */
835
- /* */
836
- /* */
837
- /* */
838
- /* */
839
- /* */
840
- /* */
841
- /* */
842
- /* */
843
- /* */
844
- /* */
845
- /* */
846
- /* */
847
- /* */
848
- /* */
849
- /* */
850
- /* */
851
- /* */
852
- /* */
853
- /* */
854
- /* */
855
- /* */
856
- /* */
857
- /* */
858
- /* */
859
- /* */
860
- /* */
861
- /* */
862
- /* */
863
- /* */
864
- /* */
865
- /* */
866
- /* */
867
- /* */
868
- /* */
869
- /* */
870
- /* */
871
- /* */
872
- /* */
873
- /* */
874
- /* */
875
- /* */
876
- /* */
877
- /* */
878
- /* */
879
- /* */
880
- /* */
881
- /* */
882
- /* */
883
- /* */
884
- /* */
885
- /* */
886
- /* */
887
- /* */
888
- /* */
889
- /* */
890
- /* */
891
- /* */
892
- /* */
893
- /* */
894
- /* */
895
- /* */
896
- /* */
897
- /* */
898
- /* */
899
- /* */
900
- /* */
901
- /* */
902
- /* */
903
- /* */
904
- /* */
905
- /* */
906
- return (void 0);
907
- }
908
- static nearestTo(absoluteLocation, options) {
909
- /* */
910
- /* */
911
- /* */
912
- /* */
913
- /* */
914
- /* */
915
- /* */
916
- /* */
917
- /* */
918
- /* */
919
- /* */
920
- /* */
921
- /* */
922
- /* */
923
- /* */
924
- /* */
925
- /* */
926
- /* */
927
- /* */
928
- /* */
929
- /* */
930
- /* */
931
- /* */
932
- /* */
933
- /* */
934
- /* */
935
- /* */
936
- /* */
937
- /* */
938
- /* */
939
- /* */
940
- /* */
941
- /* */
942
- /* */
943
- /* */
944
- /* */
945
- /* */
946
- /* */
947
- /* */
948
- /* */
949
- /* */
950
- /* */
951
- /* */
952
- /* */
953
- /* */
954
- /* */
955
- /* */
956
- /* */
957
- /* */
958
- /* */
959
- /* */
960
- /* */
961
- /* */
962
- /* */
963
- /* */
964
- /* */
965
- /* */
966
- /* */
967
- return (void 0);
968
- }
969
- static allProjectFrom(absoluteLocation, stopOnCwd = '/') {
970
- /* */
971
- /* */
972
- /* */
973
- /* */
974
- /* */
975
- /* */
976
- /* */
977
- /* */
978
- /* */
979
- /* */
980
- /* */
981
- /* */
982
- /* */
983
- /* */
984
- /* */
985
- /* */
986
- /* */
987
- /* */
988
- /* */
989
- /* */
990
- /* */
991
- /* */
992
- return (void 0);
993
- }
994
- static DefaultPortByType(type) {
995
- if (type === 'workspace') {
996
- return 5000;
997
- }
998
- if (type === 'angular-client') {
999
- return 4300;
1000
- }
1001
- if (type === 'angular-lib') {
1002
- return 4250;
1003
- }
1004
- if (type === 'electron-client') {
1005
- return 4350;
1006
- }
1007
- if (type === 'ionic-client') {
1008
- return 8080;
1009
- }
1010
- if (type === 'docker') {
1011
- return 5000;
1012
- }
1013
- if (type === 'isomorphic-lib') {
1014
- return 4000;
1015
- }
1016
- if (type === 'container' || type === 'unknow-npm-project') {
1017
- return;
1018
- }
1019
- }
1020
- static get isBundleMode() {
1021
- if (Helpers$1.isBrowser) {
1022
- return true;
1023
- }
1024
- /* */
1025
- /* */
1026
- }
1027
- static get Current() {
1028
- /* */
1029
- /* */
1030
- /* */
1031
- /* */
1032
- /* */
1033
- /* */
1034
- /* */
1035
- /* */
1036
- /* */
1037
- /* */
1038
- /* */
1039
- return (void 0);
1040
- }
1041
- /**
1042
- * @deprecated
1043
- */
1044
- static get Tnp() {
1045
- /* */
1046
- /* */
1047
- /* */
1048
- /* */
1049
- /* */
1050
- /* */
1051
- /* */
1052
- return (void 0);
1053
- }
1054
- static by(libraryType, version
1055
- /* */
1056
- /* */
1057
- ) {
1058
- /* */
1059
- /* */
1060
- /* */
1061
- /* */
1062
- /* */
1063
- /* */
1064
- /* */
1065
- /* */
1066
- /* */
1067
- /* */
1068
- /* */
1069
- /* */
1070
- /* */
1071
- /* */
1072
- /* */
1073
- /* */
1074
- /* */
1075
- /* */
1076
- /* */
1077
- /* */
1078
- /* */
1079
- /* */
1080
- /* */
1081
- /* */
1082
- /* */
1083
- /* */
1084
- /* */
1085
- return (void 0);
1086
- }
1087
- defineProperty(variableName, classFn) {
1088
- /* */
1089
- /* */
1090
- /* */
1091
- /* */
1092
- /* */
1093
- /* */
1094
- /* */
1095
- /* */
1096
- /* */
1097
- /* */
1098
- /* */
1099
- /* */
1100
- /* */
1101
- /* */
1102
- /* */
1103
- /* */
1104
- /* */
1105
- /* */
1106
- /* */
1107
- /* */
1108
- /* */
1109
- /* */
1110
- /* */
1111
- /* */
1112
- return (void 0);
1113
- }
1114
- setType(type) {
1115
- // @ts-ignore
1116
- this._type = type;
1117
- }
1118
- typeIs(...types) {
1119
- return this._type && types.includes(this._type);
1120
- }
1121
- typeIsNot(...types) {
1122
- return !this.typeIs(...types);
1123
- }
1124
- forEmptyStructure() {
1125
- /* */
1126
- /* */
1127
- /* */
1128
- /* */
1129
- /* */
1130
- return (void 0);
1131
- }
1132
- }
1133
- Project.projects = [];
1134
- /**
1135
- * To speed up checking folder I am keeping pathes for alterdy checked folder
1136
- * This may break things that are creating new projects
1137
- */
1138
- Project.emptyLocations = [];
1139
- /* */
1140
- /* */
1141
- /* */
1142
- /* */
1143
- /* */
1144
- /* */
1145
- /* */
1146
- /* */
1147
- /* */
1148
- /* */
1149
- /* */
1150
- /* */
1151
- /* */
1152
- /* */
1153
- /* */
1154
- /* */
1155
- /* */
1156
- /* */
1157
- /* */
1158
- /* */
1159
- /* */
1160
- /* */
1161
- /* */
1162
- /* */
1163
- /* */
1164
- /* */
1165
- /* */
1166
- /* */
1167
- /* */
1168
- /* */
1169
- /* */
1170
- /* */
1171
- /* */
1172
- /* */
1173
- /* */
1174
- /* */
1175
- /* */
1176
- /* */
1177
- /* */
1178
- /* */
1179
- /* */
1180
- /* */
1181
- /* */
1182
- /* */
1183
- ;
761
+ /* */
762
+ const Helpers$1 = HelpersTnp.Instance;
763
+ class Project {
764
+ constructor() {
765
+ /* */
766
+ /* */
767
+ this.cache = {};
768
+ this.browser = {};
769
+ }
770
+ static typeFrom(location) {
771
+ /* */
772
+ /* */
773
+ /* */
774
+ /* */
775
+ /* */
776
+ /* */
777
+ /* */
778
+ /* */
779
+ /* */
780
+ /* */
781
+ /* */
782
+ /* */
783
+ return (void 0);
784
+ }
785
+ static unload(project) {
786
+ Project.projects = Project.projects.filter(f => f !== project);
787
+ }
788
+ static From(locationOfProj) {
789
+ /* */
790
+ /* */
791
+ /* */
792
+ /* */
793
+ /* */
794
+ /* */
795
+ /* */
796
+ /* */
797
+ /* */
798
+ /* */
799
+ /* */
800
+ /* */
801
+ /* */
802
+ /* */
803
+ /* */
804
+ /* */
805
+ /* */
806
+ /* */
807
+ /* */
808
+ /* */
809
+ /* */
810
+ /* */
811
+ /* */
812
+ /* */
813
+ /* */
814
+ /* */
815
+ /* */
816
+ /* */
817
+ /* */
818
+ /* */
819
+ /* */
820
+ /* */
821
+ /* */
822
+ /* */
823
+ /* */
824
+ /* */
825
+ /* */
826
+ /* */
827
+ /* */
828
+ /* */
829
+ /* */
830
+ /* */
831
+ /* */
832
+ /* */
833
+ /* */
834
+ /* */
835
+ /* */
836
+ /* */
837
+ /* */
838
+ /* */
839
+ /* */
840
+ /* */
841
+ /* */
842
+ /* */
843
+ /* */
844
+ /* */
845
+ /* */
846
+ /* */
847
+ /* */
848
+ /* */
849
+ /* */
850
+ /* */
851
+ /* */
852
+ /* */
853
+ /* */
854
+ /* */
855
+ /* */
856
+ /* */
857
+ /* */
858
+ /* */
859
+ /* */
860
+ /* */
861
+ /* */
862
+ /* */
863
+ /* */
864
+ /* */
865
+ /* */
866
+ /* */
867
+ /* */
868
+ /* */
869
+ /* */
870
+ /* */
871
+ /* */
872
+ /* */
873
+ /* */
874
+ /* */
875
+ /* */
876
+ /* */
877
+ /* */
878
+ /* */
879
+ /* */
880
+ /* */
881
+ /* */
882
+ /* */
883
+ /* */
884
+ /* */
885
+ /* */
886
+ /* */
887
+ /* */
888
+ /* */
889
+ /* */
890
+ /* */
891
+ /* */
892
+ /* */
893
+ /* */
894
+ /* */
895
+ /* */
896
+ /* */
897
+ /* */
898
+ /* */
899
+ /* */
900
+ /* */
901
+ /* */
902
+ /* */
903
+ /* */
904
+ /* */
905
+ /* */
906
+ return (void 0);
907
+ }
908
+ static nearestTo(absoluteLocation, options) {
909
+ /* */
910
+ /* */
911
+ /* */
912
+ /* */
913
+ /* */
914
+ /* */
915
+ /* */
916
+ /* */
917
+ /* */
918
+ /* */
919
+ /* */
920
+ /* */
921
+ /* */
922
+ /* */
923
+ /* */
924
+ /* */
925
+ /* */
926
+ /* */
927
+ /* */
928
+ /* */
929
+ /* */
930
+ /* */
931
+ /* */
932
+ /* */
933
+ /* */
934
+ /* */
935
+ /* */
936
+ /* */
937
+ /* */
938
+ /* */
939
+ /* */
940
+ /* */
941
+ /* */
942
+ /* */
943
+ /* */
944
+ /* */
945
+ /* */
946
+ /* */
947
+ /* */
948
+ /* */
949
+ /* */
950
+ /* */
951
+ /* */
952
+ /* */
953
+ /* */
954
+ /* */
955
+ /* */
956
+ /* */
957
+ /* */
958
+ /* */
959
+ /* */
960
+ /* */
961
+ /* */
962
+ /* */
963
+ /* */
964
+ /* */
965
+ /* */
966
+ /* */
967
+ return (void 0);
968
+ }
969
+ static allProjectFrom(absoluteLocation, stopOnCwd = '/') {
970
+ /* */
971
+ /* */
972
+ /* */
973
+ /* */
974
+ /* */
975
+ /* */
976
+ /* */
977
+ /* */
978
+ /* */
979
+ /* */
980
+ /* */
981
+ /* */
982
+ /* */
983
+ /* */
984
+ /* */
985
+ /* */
986
+ /* */
987
+ /* */
988
+ /* */
989
+ /* */
990
+ /* */
991
+ /* */
992
+ return (void 0);
993
+ }
994
+ static DefaultPortByType(type) {
995
+ if (type === 'workspace') {
996
+ return 5000;
997
+ }
998
+ if (type === 'angular-client') {
999
+ return 4300;
1000
+ }
1001
+ if (type === 'angular-lib') {
1002
+ return 4250;
1003
+ }
1004
+ if (type === 'electron-client') {
1005
+ return 4350;
1006
+ }
1007
+ if (type === 'ionic-client') {
1008
+ return 8080;
1009
+ }
1010
+ if (type === 'docker') {
1011
+ return 5000;
1012
+ }
1013
+ if (type === 'isomorphic-lib') {
1014
+ return 4000;
1015
+ }
1016
+ if (type === 'container' || type === 'unknow-npm-project') {
1017
+ return;
1018
+ }
1019
+ }
1020
+ static get isBundleMode() {
1021
+ if (Helpers$1.isBrowser) {
1022
+ return true;
1023
+ }
1024
+ /* */
1025
+ /* */
1026
+ }
1027
+ static get Current() {
1028
+ /* */
1029
+ /* */
1030
+ /* */
1031
+ /* */
1032
+ /* */
1033
+ /* */
1034
+ /* */
1035
+ /* */
1036
+ /* */
1037
+ /* */
1038
+ /* */
1039
+ return (void 0);
1040
+ }
1041
+ /**
1042
+ * @deprecated
1043
+ */
1044
+ static get Tnp() {
1045
+ /* */
1046
+ /* */
1047
+ /* */
1048
+ /* */
1049
+ /* */
1050
+ /* */
1051
+ /* */
1052
+ return (void 0);
1053
+ }
1054
+ static by(libraryType, version
1055
+ /* */
1056
+ /* */
1057
+ ) {
1058
+ /* */
1059
+ /* */
1060
+ /* */
1061
+ /* */
1062
+ /* */
1063
+ /* */
1064
+ /* */
1065
+ /* */
1066
+ /* */
1067
+ /* */
1068
+ /* */
1069
+ /* */
1070
+ /* */
1071
+ /* */
1072
+ /* */
1073
+ /* */
1074
+ /* */
1075
+ /* */
1076
+ /* */
1077
+ /* */
1078
+ /* */
1079
+ /* */
1080
+ /* */
1081
+ /* */
1082
+ /* */
1083
+ /* */
1084
+ /* */
1085
+ return (void 0);
1086
+ }
1087
+ defineProperty(variableName, classFn) {
1088
+ /* */
1089
+ /* */
1090
+ /* */
1091
+ /* */
1092
+ /* */
1093
+ /* */
1094
+ /* */
1095
+ /* */
1096
+ /* */
1097
+ /* */
1098
+ /* */
1099
+ /* */
1100
+ /* */
1101
+ /* */
1102
+ /* */
1103
+ /* */
1104
+ /* */
1105
+ /* */
1106
+ /* */
1107
+ /* */
1108
+ /* */
1109
+ /* */
1110
+ /* */
1111
+ /* */
1112
+ return (void 0);
1113
+ }
1114
+ setType(type) {
1115
+ // @ts-ignore
1116
+ this._type = type;
1117
+ }
1118
+ typeIs(...types) {
1119
+ return this._type && types.includes(this._type);
1120
+ }
1121
+ typeIsNot(...types) {
1122
+ return !this.typeIs(...types);
1123
+ }
1124
+ forEmptyStructure() {
1125
+ /* */
1126
+ /* */
1127
+ /* */
1128
+ /* */
1129
+ /* */
1130
+ return (void 0);
1131
+ }
1132
+ }
1133
+ Project.projects = [];
1134
+ /**
1135
+ * To speed up checking folder I am keeping pathes for alterdy checked folder
1136
+ * This may break things that are creating new projects
1137
+ */
1138
+ Project.emptyLocations = [];
1139
+ /* */
1140
+ /* */
1141
+ /* */
1142
+ /* */
1143
+ /* */
1144
+ /* */
1145
+ /* */
1146
+ /* */
1147
+ /* */
1148
+ /* */
1149
+ /* */
1150
+ /* */
1151
+ /* */
1152
+ /* */
1153
+ /* */
1154
+ /* */
1155
+ /* */
1156
+ /* */
1157
+ /* */
1158
+ /* */
1159
+ /* */
1160
+ /* */
1161
+ /* */
1162
+ /* */
1163
+ /* */
1164
+ /* */
1165
+ /* */
1166
+ /* */
1167
+ /* */
1168
+ /* */
1169
+ /* */
1170
+ /* */
1171
+ /* */
1172
+ /* */
1173
+ /* */
1174
+ /* */
1175
+ /* */
1176
+ /* */
1177
+ /* */
1178
+ /* */
1179
+ /* */
1180
+ /* */
1181
+ /* */
1182
+ /* */
1183
+ ;
1184
1184
  ({}); // @--end-of-file-for-module=tnp-helpers lib/project.ts
1185
1185
 
1186
- ;
1186
+ ;
1187
1187
  ({}); // @--end-of-file-for-module=tnp-helpers lib/firedev-models.ts
1188
1188
 
1189
- class BaseComponent {
1190
- constructor() {
1191
- // @ts-ignore
1192
- this.model = {};
1193
- this.handlers = [];
1194
- }
1195
- ngOnDestroy() {
1196
- this.handlers.forEach(h => h.unsubscribe());
1197
- this.handlers.length = 0;
1198
- }
1199
- }
1200
- BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1201
- BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseComponent, selector: "app-base-component-meta", inputs: { model: "model" }, ngImport: i0, template: '<div></div>', isInline: true });
1202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, decorators: [{
1203
- type: Component,
1204
- args: [{
1205
- selector: 'app-base-component-meta',
1206
- template: '<div></div>'
1207
- }]
1208
- }], propDecorators: { model: [{
1209
- type: Input
1210
- }] } });
1211
- const isCalledNgInitAfterInternalRefresh = Symbol();
1212
- class BaseComponentForRouter extends BaseComponent {
1213
- constructor(__router) {
1214
- super();
1215
- this.__router = __router;
1216
- this[isCalledNgInitAfterInternalRefresh] = false;
1217
- }
1218
- isCalledNgInitAfterInternalRefresh() {
1219
- return !!this[isCalledNgInitAfterInternalRefresh];
1220
- }
1221
- reloadNgOninitOnUrlChange() {
1222
- this.handlers.push(this.__router.events.subscribe(event => {
1223
- if (event instanceof NavigationEnd && this['ngOnInit']) {
1224
- this[isCalledNgInitAfterInternalRefresh] = true;
1225
- this['ngOnInit']();
1226
- if (this[isCalledNgInitAfterInternalRefresh]) {
1227
- this[isCalledNgInitAfterInternalRefresh] = false;
1228
- }
1229
- }
1230
- }));
1231
- }
1232
- }
1233
- ;
1189
+ class BaseComponent {
1190
+ constructor() {
1191
+ // @ts-ignore
1192
+ this.model = {};
1193
+ this.handlers = [];
1194
+ }
1195
+ ngOnDestroy() {
1196
+ this.handlers.forEach(h => h.unsubscribe());
1197
+ this.handlers.length = 0;
1198
+ }
1199
+ }
1200
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1201
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseComponent, selector: "app-base-component-meta", inputs: { model: "model" }, ngImport: i0, template: '<div></div>', isInline: true });
1202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, decorators: [{
1203
+ type: Component,
1204
+ args: [{
1205
+ selector: 'app-base-component-meta',
1206
+ template: '<div></div>'
1207
+ }]
1208
+ }], propDecorators: { model: [{
1209
+ type: Input
1210
+ }] } });
1211
+ const isCalledNgInitAfterInternalRefresh = Symbol();
1212
+ class BaseComponentForRouter extends BaseComponent {
1213
+ constructor(__router) {
1214
+ super();
1215
+ this.__router = __router;
1216
+ this[isCalledNgInitAfterInternalRefresh] = false;
1217
+ }
1218
+ isCalledNgInitAfterInternalRefresh() {
1219
+ return !!this[isCalledNgInitAfterInternalRefresh];
1220
+ }
1221
+ reloadNgOninitOnUrlChange() {
1222
+ this.handlers.push(this.__router.events.subscribe(event => {
1223
+ if (event instanceof NavigationEnd && this['ngOnInit']) {
1224
+ this[isCalledNgInitAfterInternalRefresh] = true;
1225
+ this['ngOnInit']();
1226
+ if (this[isCalledNgInitAfterInternalRefresh]) {
1227
+ this[isCalledNgInitAfterInternalRefresh] = false;
1228
+ }
1229
+ }
1230
+ }));
1231
+ }
1232
+ }
1233
+ ;
1234
1234
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base-component.ts
1235
1235
 
1236
- const log$2 = Log.create(`DualComponentController`);
1237
- class DualComponentController {
1238
- constructor(cmp, isFormlyMode = false) {
1239
- this.cmp = cmp;
1240
- this.isFormlyMode = isFormlyMode;
1241
- }
1242
- getValTemplateOptions(propertyName) {
1243
- var _a;
1244
- if (this.isFormlyMode) {
1245
- const res = (_a = this.cmp.field) === null || _a === void 0 ? void 0 : _a.templateOptions[propertyName];
1246
- if (res === void 0 && this.cmp[propertyName]) {
1247
- return this.cmp[propertyName];
1248
- }
1249
- return res;
1250
- }
1251
- return this.cmp[propertyName];
1252
- }
1253
- getValContext(propertyName) {
1254
- var _a;
1255
- if (this.isFormlyMode) {
1256
- const res = (_a = this.cmp) === null || _a === void 0 ? void 0 : _a.field[propertyName];
1257
- if (res === void 0 && this.cmp[propertyName]) {
1258
- return this.cmp[propertyName];
1259
- }
1260
- return res;
1261
- }
1262
- return this.cmp[propertyName];
1263
- }
1264
- get disabled() {
1265
- return this.getValTemplateOptions('disabled');
1266
- }
1267
- get required() {
1268
- return this.getValTemplateOptions('required');
1269
- }
1270
- get type() {
1271
- if (!this.isFormlyMode) {
1272
- return CLASS.getNameFromObject(this.cmp);
1273
- }
1274
- return this.getValContext('type');
1275
- }
1276
- get label() {
1277
- return this.getValTemplateOptions('label');
1278
- }
1279
- get placeholder() {
1280
- return this.getValTemplateOptions('placeholder');
1281
- }
1282
- get defaultValue() {
1283
- return this.getValContext('defaultValue');
1284
- }
1285
- get formControl() {
1286
- return this.getValContext('formControl');
1287
- }
1288
- get key() {
1289
- return this.getValContext('key');
1290
- }
1291
- get path() {
1292
- return this.getValContext('path');
1293
- }
1294
- get model() {
1295
- if (this.isFormlyMode) {
1296
- return this.getValContext('model');
1297
- }
1298
- else {
1299
- return this.__model;
1300
- }
1301
- }
1302
- set model(v) {
1303
- if (this.isFormlyMode) {
1304
- log$2.w(`[DualComponentController] You can't set model in formly component mode`);
1305
- }
1306
- else {
1307
- this.__model = v;
1308
- }
1309
- }
1310
- get mode() {
1311
- if (this.isFormlyMode) {
1312
- return this.getValContext('mode');
1313
- }
1314
- else {
1315
- return this.__mode;
1316
- }
1317
- }
1318
- set mode(v) {
1319
- if (this.isFormlyMode) {
1320
- }
1321
- else {
1322
- this.__mode = v;
1323
- }
1324
- }
1325
- get value() {
1326
- if (this.isFormlyMode) {
1327
- return this.cmp.field.formControl.value;
1328
- }
1329
- if (_.isString(this.path)) {
1330
- return _.get(this.cmp.model, this.path);
1331
- }
1332
- return this.cmp.model;
1333
- }
1334
- set value(v) {
1335
- if (this.isFormlyMode) {
1336
- this.cmp.field.formControl.setValue(v);
1337
- // @ts-ignore
1338
- this.cmp.change.next(v);
1339
- return;
1340
- }
1341
- if (_.isString(this.path)) {
1342
- _.set(this.cmp.model, this.path, v);
1343
- }
1344
- else {
1345
- this.cmp.model = v;
1346
- }
1347
- }
1348
- }
1349
- ;
1236
+ const log$2 = Log.create(`DualComponentController`);
1237
+ class DualComponentController {
1238
+ constructor(cmp, isFormlyMode = false) {
1239
+ this.cmp = cmp;
1240
+ this.isFormlyMode = isFormlyMode;
1241
+ }
1242
+ getValTemplateOptions(propertyName) {
1243
+ var _a;
1244
+ if (this.isFormlyMode) {
1245
+ const res = (_a = this.cmp.field) === null || _a === void 0 ? void 0 : _a.templateOptions[propertyName];
1246
+ if (res === void 0 && this.cmp[propertyName]) {
1247
+ return this.cmp[propertyName];
1248
+ }
1249
+ return res;
1250
+ }
1251
+ return this.cmp[propertyName];
1252
+ }
1253
+ getValContext(propertyName) {
1254
+ var _a;
1255
+ if (this.isFormlyMode) {
1256
+ const res = (_a = this.cmp) === null || _a === void 0 ? void 0 : _a.field[propertyName];
1257
+ if (res === void 0 && this.cmp[propertyName]) {
1258
+ return this.cmp[propertyName];
1259
+ }
1260
+ return res;
1261
+ }
1262
+ return this.cmp[propertyName];
1263
+ }
1264
+ get disabled() {
1265
+ return this.getValTemplateOptions('disabled');
1266
+ }
1267
+ get required() {
1268
+ return this.getValTemplateOptions('required');
1269
+ }
1270
+ get type() {
1271
+ if (!this.isFormlyMode) {
1272
+ return CLASS.getNameFromObject(this.cmp);
1273
+ }
1274
+ return this.getValContext('type');
1275
+ }
1276
+ get label() {
1277
+ return this.getValTemplateOptions('label');
1278
+ }
1279
+ get placeholder() {
1280
+ return this.getValTemplateOptions('placeholder');
1281
+ }
1282
+ get defaultValue() {
1283
+ return this.getValContext('defaultValue');
1284
+ }
1285
+ get formControl() {
1286
+ return this.getValContext('formControl');
1287
+ }
1288
+ get key() {
1289
+ return this.getValContext('key');
1290
+ }
1291
+ get path() {
1292
+ return this.getValContext('path');
1293
+ }
1294
+ get model() {
1295
+ if (this.isFormlyMode) {
1296
+ return this.getValContext('model');
1297
+ }
1298
+ else {
1299
+ return this.__model;
1300
+ }
1301
+ }
1302
+ set model(v) {
1303
+ if (this.isFormlyMode) {
1304
+ log$2.w(`[DualComponentController] You can't set model in formly component mode`);
1305
+ }
1306
+ else {
1307
+ this.__model = v;
1308
+ }
1309
+ }
1310
+ get mode() {
1311
+ if (this.isFormlyMode) {
1312
+ return this.getValContext('mode');
1313
+ }
1314
+ else {
1315
+ return this.__mode;
1316
+ }
1317
+ }
1318
+ set mode(v) {
1319
+ if (this.isFormlyMode) {
1320
+ }
1321
+ else {
1322
+ this.__mode = v;
1323
+ }
1324
+ }
1325
+ get value() {
1326
+ if (this.isFormlyMode) {
1327
+ return this.cmp.field.formControl.value;
1328
+ }
1329
+ if (_.isString(this.path)) {
1330
+ return _.get(this.cmp.model, this.path);
1331
+ }
1332
+ return this.cmp.model;
1333
+ }
1334
+ set value(v) {
1335
+ if (this.isFormlyMode) {
1336
+ this.cmp.field.formControl.setValue(v);
1337
+ // @ts-ignore
1338
+ this.cmp.change.next(v);
1339
+ return;
1340
+ }
1341
+ if (_.isString(this.path)) {
1342
+ _.set(this.cmp.model, this.path, v);
1343
+ }
1344
+ else {
1345
+ this.cmp.model = v;
1346
+ }
1347
+ }
1348
+ }
1349
+ ;
1350
1350
  ({}); // @--end-of-file-for-module=tnp-helpers lib/dual-component-ctrl.ts
1351
1351
 
1352
- const log$1 = Log.create('base formly component', Level.__NOTHING);
1353
- class BaseFormlyComponent extends FieldType {
1354
- constructor() {
1355
- super(...arguments);
1356
- this.DualComponentController = DualComponentController;
1357
- this.ctrl = {};
1358
- this.change = new EventEmitter();
1359
- // @ts-ignore
1360
- this.handlers = [];
1361
- this.__field = {
1362
- templateOptions: {}
1363
- };
1364
- }
1365
- // @ts-ignore
1366
- get mode() {
1367
- return this.ctrl.mode;
1368
- }
1369
- // @ts-ignore
1370
- set mode(v) {
1371
- this.ctrl.mode = v;
1372
- }
1373
- // @ts-ignore
1374
- set model(v) {
1375
- this.ctrl.model = v;
1376
- }
1377
- get model() {
1378
- return this.ctrl.model;
1379
- }
1380
- // @ts-ignore
1381
- set key(value) {
1382
- if (this.ctrl && this.ctrl.isFormlyMode) {
1383
- return;
1384
- }
1385
- this.path = value;
1386
- }
1387
- get key() {
1388
- if (this.ctrl && this.ctrl.isFormlyMode) {
1389
- return this.field.key;
1390
- }
1391
- return this.path;
1392
- }
1393
- ngOnDestroy() {
1394
- this.handlers.forEach(h => h.unsubscribe());
1395
- this.handlers.length = 0;
1396
- }
1397
- ngAfterViewInit() {
1398
- }
1399
- ngOnInit() {
1400
- const isFormlyMode = !!this.field;
1401
- log$1.i(`isFormlyMode: ${isFormlyMode}`);
1402
- if (!isFormlyMode) {
1403
- const that = this;
1404
- Object.defineProperty(this, 'field', {
1405
- get: function () {
1406
- return that.__field;
1407
- },
1408
- set: function (v) {
1409
- that.__field = v;
1410
- }
1411
- });
1412
- }
1413
- const existed = this.ctrl;
1414
- this.ctrl = new this.DualComponentController(this, isFormlyMode);
1415
- // @ts-ignore
1416
- Object.keys(existed).forEach(key => {
1417
- this.ctrl[key] = existed[key];
1418
- });
1419
- // @ts-ignore
1420
- this.change.next(this.ctrl.value);
1421
- }
1422
- }
1423
- BaseFormlyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1424
- BaseFormlyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseFormlyComponent, selector: "app-base-formly-component-meta", inputs: { pizda: "pizda", mode: "mode", disabled: "disabled", required: "required", label: "label", placeholder: "placeholder", defaultValue: "defaultValue", model: "model", path: "path", key: "key" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true });
1425
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, decorators: [{
1426
- type: Component,
1427
- args: [{
1428
- selector: 'app-base-formly-component-meta',
1429
- template: `<div></div>`
1430
- }]
1431
- }], propDecorators: { pizda: [{
1432
- type: Input
1433
- }], mode: [{
1434
- type: Input
1435
- }], disabled: [{
1436
- type: Input
1437
- }], required: [{
1438
- type: Input
1439
- }], label: [{
1440
- type: Input
1441
- }], placeholder: [{
1442
- type: Input
1443
- }], defaultValue: [{
1444
- type: Input
1445
- }], model: [{
1446
- type: Input
1447
- }], path: [{
1448
- type: Input
1449
- }], change: [{
1450
- type: Output
1451
- }], key: [{
1452
- type: Input
1453
- }] } });
1454
- ;
1352
+ const log$1 = Log.create('base formly component', Level.__NOTHING);
1353
+ class BaseFormlyComponent extends FieldType {
1354
+ constructor() {
1355
+ super(...arguments);
1356
+ this.DualComponentController = DualComponentController;
1357
+ this.ctrl = {};
1358
+ this.change = new EventEmitter();
1359
+ // @ts-ignore
1360
+ this.handlers = [];
1361
+ this.__field = {
1362
+ templateOptions: {}
1363
+ };
1364
+ }
1365
+ // @ts-ignore
1366
+ get mode() {
1367
+ return this.ctrl.mode;
1368
+ }
1369
+ // @ts-ignore
1370
+ set mode(v) {
1371
+ this.ctrl.mode = v;
1372
+ }
1373
+ // @ts-ignore
1374
+ set model(v) {
1375
+ this.ctrl.model = v;
1376
+ }
1377
+ get model() {
1378
+ return this.ctrl.model;
1379
+ }
1380
+ // @ts-ignore
1381
+ set key(value) {
1382
+ if (this.ctrl && this.ctrl.isFormlyMode) {
1383
+ return;
1384
+ }
1385
+ this.path = value;
1386
+ }
1387
+ get key() {
1388
+ if (this.ctrl && this.ctrl.isFormlyMode) {
1389
+ return this.field.key;
1390
+ }
1391
+ return this.path;
1392
+ }
1393
+ ngOnDestroy() {
1394
+ this.handlers.forEach(h => h.unsubscribe());
1395
+ this.handlers.length = 0;
1396
+ }
1397
+ ngAfterViewInit() {
1398
+ }
1399
+ ngOnInit() {
1400
+ const isFormlyMode = !!this.field;
1401
+ log$1.i(`isFormlyMode: ${isFormlyMode}`);
1402
+ if (!isFormlyMode) {
1403
+ const that = this;
1404
+ Object.defineProperty(this, 'field', {
1405
+ get: function () {
1406
+ return that.__field;
1407
+ },
1408
+ set: function (v) {
1409
+ that.__field = v;
1410
+ }
1411
+ });
1412
+ }
1413
+ const existed = this.ctrl;
1414
+ this.ctrl = new this.DualComponentController(this, isFormlyMode);
1415
+ // @ts-ignore
1416
+ Object.keys(existed).forEach(key => {
1417
+ this.ctrl[key] = existed[key];
1418
+ });
1419
+ // @ts-ignore
1420
+ this.change.next(this.ctrl.value);
1421
+ }
1422
+ }
1423
+ BaseFormlyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1424
+ BaseFormlyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseFormlyComponent, selector: "app-base-formly-component-meta", inputs: { pizda: "pizda", mode: "mode", disabled: "disabled", required: "required", label: "label", placeholder: "placeholder", defaultValue: "defaultValue", model: "model", path: "path", key: "key" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true });
1425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, decorators: [{
1426
+ type: Component,
1427
+ args: [{
1428
+ selector: 'app-base-formly-component-meta',
1429
+ template: `<div></div>`
1430
+ }]
1431
+ }], propDecorators: { pizda: [{
1432
+ type: Input
1433
+ }], mode: [{
1434
+ type: Input
1435
+ }], disabled: [{
1436
+ type: Input
1437
+ }], required: [{
1438
+ type: Input
1439
+ }], label: [{
1440
+ type: Input
1441
+ }], placeholder: [{
1442
+ type: Input
1443
+ }], defaultValue: [{
1444
+ type: Input
1445
+ }], model: [{
1446
+ type: Input
1447
+ }], path: [{
1448
+ type: Input
1449
+ }], change: [{
1450
+ type: Output
1451
+ }], key: [{
1452
+ type: Input
1453
+ }] } });
1454
+ ;
1455
1455
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base-formly-component.ts
1456
1456
 
1457
- class ResizeService {
1458
- constructor() {
1459
- this.resizeDetector = elementResizeDetectorMaker({ strategy: 'scroll' });
1460
- }
1461
- addResizeEventListener(element, handler) {
1462
- this.resizeDetector.listenTo(element, handler);
1463
- }
1464
- removeResizeEventListener(element) {
1465
- this.resizeDetector.uninstall(element);
1466
- }
1467
- }
1468
- ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1469
- ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1471
- type: Injectable
1472
- }], ctorParameters: function () { return []; } });
1473
- ;
1457
+ class ResizeService {
1458
+ constructor() {
1459
+ this.resizeDetector = elementResizeDetectorMaker({ strategy: 'scroll' });
1460
+ }
1461
+ addResizeEventListener(element, handler) {
1462
+ this.resizeDetector.listenTo(element, handler);
1463
+ }
1464
+ removeResizeEventListener(element) {
1465
+ this.resizeDetector.uninstall(element);
1466
+ }
1467
+ }
1468
+ ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1469
+ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1471
+ type: Injectable
1472
+ }], ctorParameters: function () { return []; } });
1473
+ ;
1474
1474
  ({}); // @--end-of-file-for-module=tnp-helpers lib/resize-service.ts
1475
1475
 
1476
- const log = Log.create(`[firedev-helpers] long-press`, Level.__NOTHING);
1477
- class LongPress {
1478
- constructor() {
1479
- this.pressDuration = 1000;
1480
- this.onLongPress = new EventEmitter();
1481
- this.onLongPressing = new EventEmitter();
1482
- this.onLongPressEnd = new EventEmitter();
1483
- this.mouseX = 0;
1484
- this.mouseY = 0;
1485
- this.allowTrigger = false;
1486
- this.triggerEnd = _.debounce(() => {
1487
- this.endPress();
1488
- }, 500);
1489
- }
1490
- get press() { return this.pressing; }
1491
- get longPress() { return this.longPressing; }
1492
- onMouseDown(event) {
1493
- log.d(`MOUSE DOWN `);
1494
- if (event.which !== 1)
1495
- return;
1496
- this.allowTrigger = true;
1497
- this.mouseX = event.clientX;
1498
- this.mouseY = event.clientY;
1499
- this.pressing = true;
1500
- this.longPressing = false;
1501
- this.timeout = setTimeout(() => {
1502
- if (this.allowTrigger) {
1503
- this.longPressing = true;
1504
- log.d(`long pressing start pressDuration:${this.pressDuration} `);
1505
- this.onLongPress.emit(event);
1506
- this.loop(event);
1507
- }
1508
- }, this.pressDuration);
1509
- this.loop(event);
1510
- }
1511
- onMouseMove(event) {
1512
- if (this.pressing && !this.longPressing) {
1513
- const xThres = (event.clientX - this.mouseX) > 10;
1514
- const yThres = (event.clientY - this.mouseY) > 10;
1515
- if (xThres || yThres) {
1516
- this.endPress();
1517
- }
1518
- }
1519
- }
1520
- loop(event) {
1521
- if (this.longPressing) {
1522
- this.timeout = setTimeout(() => {
1523
- log.d(`emil longpressing`);
1524
- this.triggerEnd();
1525
- this.onLongPressing.emit(event);
1526
- this.loop(event);
1527
- }, 50);
1528
- }
1529
- }
1530
- endPress(emit = true) {
1531
- this.allowTrigger = false;
1532
- clearTimeout(this.timeout);
1533
- this.longPressing = false;
1534
- this.pressing = false;
1535
- if (emit) {
1536
- log.d(`EMIT END`);
1537
- this.onLongPressEnd.emit(true);
1538
- }
1539
- else {
1540
- log.d(`NOT EMIT END`);
1541
- }
1542
- }
1543
- onMouseUp() {
1544
- this.endPress(false);
1545
- }
1546
- }
1547
- LongPress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1548
- LongPress.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LongPress, selector: "[long-press]", inputs: { pressDuration: "pressDuration" }, outputs: { onLongPress: "onLongPress", onLongPressing: "onLongPressing", onLongPressEnd: "onLongPressEnd" }, host: { listeners: { "mousedown": "onMouseDown($event)", "mousemove": "onMouseMove($event)", "mouseup": "onMouseUp()" }, properties: { "class.press": "this.press", "class.longpress": "this.longPress" } }, ngImport: i0 });
1549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, decorators: [{
1550
- type: Directive,
1551
- args: [{ selector: '[long-press]' }]
1552
- }], propDecorators: { pressDuration: [{
1553
- type: Input
1554
- }], onLongPress: [{
1555
- type: Output
1556
- }], onLongPressing: [{
1557
- type: Output
1558
- }], onLongPressEnd: [{
1559
- type: Output
1560
- }], press: [{
1561
- type: HostBinding,
1562
- args: ['class.press']
1563
- }], longPress: [{
1564
- type: HostBinding,
1565
- args: ['class.longpress']
1566
- }], onMouseDown: [{
1567
- type: HostListener,
1568
- args: ['mousedown', ['$event']]
1569
- }], onMouseMove: [{
1570
- type: HostListener,
1571
- args: ['mousemove', ['$event']]
1572
- }], onMouseUp: [{
1573
- type: HostListener,
1574
- args: ['mouseup']
1575
- }] } });
1576
- ;
1476
+ const log = Log.create(`[firedev-helpers] long-press`, Level.__NOTHING);
1477
+ class LongPress {
1478
+ constructor() {
1479
+ this.pressDuration = 1000;
1480
+ this.onLongPress = new EventEmitter();
1481
+ this.onLongPressing = new EventEmitter();
1482
+ this.onLongPressEnd = new EventEmitter();
1483
+ this.mouseX = 0;
1484
+ this.mouseY = 0;
1485
+ this.allowTrigger = false;
1486
+ this.triggerEnd = _.debounce(() => {
1487
+ this.endPress();
1488
+ }, 500);
1489
+ }
1490
+ get press() { return this.pressing; }
1491
+ get longPress() { return this.longPressing; }
1492
+ onMouseDown(event) {
1493
+ log.d(`MOUSE DOWN `);
1494
+ if (event.which !== 1)
1495
+ return;
1496
+ this.allowTrigger = true;
1497
+ this.mouseX = event.clientX;
1498
+ this.mouseY = event.clientY;
1499
+ this.pressing = true;
1500
+ this.longPressing = false;
1501
+ this.timeout = setTimeout(() => {
1502
+ if (this.allowTrigger) {
1503
+ this.longPressing = true;
1504
+ log.d(`long pressing start pressDuration:${this.pressDuration} `);
1505
+ this.onLongPress.emit(event);
1506
+ this.loop(event);
1507
+ }
1508
+ }, this.pressDuration);
1509
+ this.loop(event);
1510
+ }
1511
+ onMouseMove(event) {
1512
+ if (this.pressing && !this.longPressing) {
1513
+ const xThres = (event.clientX - this.mouseX) > 10;
1514
+ const yThres = (event.clientY - this.mouseY) > 10;
1515
+ if (xThres || yThres) {
1516
+ this.endPress();
1517
+ }
1518
+ }
1519
+ }
1520
+ loop(event) {
1521
+ if (this.longPressing) {
1522
+ this.timeout = setTimeout(() => {
1523
+ log.d(`emil longpressing`);
1524
+ this.triggerEnd();
1525
+ this.onLongPressing.emit(event);
1526
+ this.loop(event);
1527
+ }, 50);
1528
+ }
1529
+ }
1530
+ endPress(emit = true) {
1531
+ this.allowTrigger = false;
1532
+ clearTimeout(this.timeout);
1533
+ this.longPressing = false;
1534
+ this.pressing = false;
1535
+ if (emit) {
1536
+ log.d(`EMIT END`);
1537
+ this.onLongPressEnd.emit(true);
1538
+ }
1539
+ else {
1540
+ log.d(`NOT EMIT END`);
1541
+ }
1542
+ }
1543
+ onMouseUp() {
1544
+ this.endPress(false);
1545
+ }
1546
+ }
1547
+ LongPress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1548
+ LongPress.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LongPress, selector: "[long-press]", inputs: { pressDuration: "pressDuration" }, outputs: { onLongPress: "onLongPress", onLongPressing: "onLongPressing", onLongPressEnd: "onLongPressEnd" }, host: { listeners: { "mousedown": "onMouseDown($event)", "mousemove": "onMouseMove($event)", "mouseup": "onMouseUp()" }, properties: { "class.press": "this.press", "class.longpress": "this.longPress" } }, ngImport: i0 });
1549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, decorators: [{
1550
+ type: Directive,
1551
+ args: [{ selector: '[long-press]' }]
1552
+ }], propDecorators: { pressDuration: [{
1553
+ type: Input
1554
+ }], onLongPress: [{
1555
+ type: Output
1556
+ }], onLongPressing: [{
1557
+ type: Output
1558
+ }], onLongPressEnd: [{
1559
+ type: Output
1560
+ }], press: [{
1561
+ type: HostBinding,
1562
+ args: ['class.press']
1563
+ }], longPress: [{
1564
+ type: HostBinding,
1565
+ args: ['class.longpress']
1566
+ }], onMouseDown: [{
1567
+ type: HostListener,
1568
+ args: ['mousedown', ['$event']]
1569
+ }], onMouseMove: [{
1570
+ type: HostListener,
1571
+ args: ['mousemove', ['$event']]
1572
+ }], onMouseUp: [{
1573
+ type: HostListener,
1574
+ args: ['mouseup']
1575
+ }] } });
1576
+ ;
1577
1577
  ({}); // @--end-of-file-for-module=tnp-helpers lib/long-press.directive.ts
1578
1578
 
1579
- /* */
1580
- /* */
1581
- const Helpers = HelpersTnp.Instance;
1582
- ;
1579
+ /* */
1580
+ /* */
1581
+ const Helpers = HelpersTnp.Instance;
1582
+ ;
1583
1583
  ({}); // @--end-of-file-for-module=tnp-helpers lib/index.ts
1584
1584
 
1585
- /**
1586
- * Generated bundle index. Do not edit.
1585
+ /**
1586
+ * Generated bundle index. Do not edit.
1587
1587
  */
1588
1588
 
1589
1589
  export { BaseComponent, BaseComponentForRouter, BaseFormlyComponent, BaselineSiteJoinprefix, DualComponentController, Helpers, LongPress, PREFIXES, Project, ResizeService };