tnp-helpers 13.0.38 → 13.1.1

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