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