tnp-helpers 13.1.1 → 13.1.3

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 (185) hide show
  1. package/app.d.ts +1 -1
  2. package/app.js +6 -6
  3. package/browser/README.md +24 -24
  4. package/browser/esm2020/lib/base-component.mjs +47 -47
  5. package/browser/esm2020/lib/base-formly-component.mjs +125 -125
  6. package/browser/esm2020/lib/condition-wait.mjs +53 -53
  7. package/browser/esm2020/lib/constants.mjs +6 -6
  8. package/browser/esm2020/lib/dual-component-ctrl.mjs +120 -120
  9. package/browser/esm2020/lib/helpers-array-obj.mjs +80 -80
  10. package/browser/esm2020/lib/helpers-environment.mjs +30 -30
  11. package/browser/esm2020/lib/helpers-numbers.mjs +5 -5
  12. package/browser/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  13. package/browser/esm2020/lib/helpers-strings.mjs +257 -257
  14. package/browser/esm2020/lib/helpers.mjs +276 -276
  15. package/browser/esm2020/lib/index.mjs +14 -14
  16. package/browser/esm2020/lib/long-press.directive.mjs +111 -111
  17. package/browser/esm2020/lib/project.mjs +413 -413
  18. package/browser/esm2020/lib/resize-service.mjs +19 -19
  19. package/browser/esm2020/public-api.mjs +1 -1
  20. package/browser/esm2020/tnp-helpers.mjs +4 -4
  21. package/browser/fesm2015/tnp-helpers.mjs +1535 -1535
  22. package/browser/fesm2020/tnp-helpers.mjs +1527 -1527
  23. package/browser/lib/base-component.d.ts +17 -17
  24. package/browser/lib/base-formly-component.d.ts +31 -31
  25. package/browser/lib/condition-wait.d.ts +8 -8
  26. package/browser/lib/constants.d.ts +6 -6
  27. package/browser/lib/dual-component-ctrl.d.ts +25 -25
  28. package/browser/lib/helpers-array-obj.d.ts +15 -15
  29. package/browser/lib/helpers-environment.d.ts +5 -5
  30. package/browser/lib/helpers-numbers.d.ts +3 -3
  31. package/browser/lib/helpers-strings-regexes.d.ts +28 -28
  32. package/browser/lib/helpers-strings.d.ts +50 -50
  33. package/browser/lib/helpers.d.ts +28 -28
  34. package/browser/lib/index.d.ts +9 -9
  35. package/browser/lib/long-press.directive.d.ts +25 -25
  36. package/browser/lib/project.d.ts +91 -91
  37. package/browser/lib/resize-service.d.ts +9 -9
  38. package/browser/public-api.d.ts +1 -1
  39. package/browser/tnp-helpers.d.ts +5 -5
  40. package/client/README.md +24 -24
  41. package/client/esm2020/lib/base-component.mjs +47 -47
  42. package/client/esm2020/lib/base-formly-component.mjs +125 -125
  43. package/client/esm2020/lib/condition-wait.mjs +53 -53
  44. package/client/esm2020/lib/constants.mjs +6 -6
  45. package/client/esm2020/lib/dual-component-ctrl.mjs +120 -120
  46. package/client/esm2020/lib/helpers-array-obj.mjs +80 -80
  47. package/client/esm2020/lib/helpers-environment.mjs +30 -30
  48. package/client/esm2020/lib/helpers-numbers.mjs +5 -5
  49. package/client/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  50. package/client/esm2020/lib/helpers-strings.mjs +257 -257
  51. package/client/esm2020/lib/helpers.mjs +276 -276
  52. package/client/esm2020/lib/index.mjs +14 -14
  53. package/client/esm2020/lib/long-press.directive.mjs +111 -111
  54. package/client/esm2020/lib/project.mjs +413 -413
  55. package/client/esm2020/lib/resize-service.mjs +19 -19
  56. package/client/esm2020/public-api.mjs +1 -1
  57. package/client/esm2020/tnp-helpers.mjs +4 -4
  58. package/client/fesm2015/tnp-helpers.mjs +1535 -1535
  59. package/client/fesm2020/tnp-helpers.mjs +1527 -1527
  60. package/client/lib/base-component.d.ts +17 -17
  61. package/client/lib/base-formly-component.d.ts +31 -31
  62. package/client/lib/condition-wait.d.ts +8 -8
  63. package/client/lib/constants.d.ts +6 -6
  64. package/client/lib/dual-component-ctrl.d.ts +25 -25
  65. package/client/lib/helpers-array-obj.d.ts +15 -15
  66. package/client/lib/helpers-environment.d.ts +5 -5
  67. package/client/lib/helpers-numbers.d.ts +3 -3
  68. package/client/lib/helpers-strings-regexes.d.ts +28 -28
  69. package/client/lib/helpers-strings.d.ts +50 -50
  70. package/client/lib/helpers.d.ts +28 -28
  71. package/client/lib/index.d.ts +9 -9
  72. package/client/lib/long-press.directive.d.ts +25 -25
  73. package/client/lib/project.d.ts +91 -91
  74. package/client/lib/resize-service.d.ts +9 -9
  75. package/client/public-api.d.ts +1 -1
  76. package/client/tnp-helpers.d.ts +5 -5
  77. package/index.d.ts +1 -1
  78. package/index.js +5 -5
  79. package/lib/angular.helper.d.ts +22 -22
  80. package/lib/angular.helper.js +50 -50
  81. package/lib/base-component.d.ts +1 -1
  82. package/lib/base-component.js +6 -6
  83. package/lib/base-formly-component.d.ts +1 -1
  84. package/lib/base-formly-component.js +6 -6
  85. package/lib/condition-wait.d.ts +8 -8
  86. package/lib/condition-wait.js +94 -94
  87. package/lib/constants.d.ts +6 -6
  88. package/lib/constants.js +10 -10
  89. package/lib/dual-component-ctrl.d.ts +1 -1
  90. package/lib/dual-component-ctrl.js +6 -6
  91. package/lib/git-project.d.ts +44 -44
  92. package/lib/git-project.js +195 -195
  93. package/lib/helpers-array-obj.d.ts +15 -15
  94. package/lib/helpers-array-obj.js +88 -88
  95. package/lib/helpers-cli-tool.backend.d.ts +45 -45
  96. package/lib/helpers-cli-tool.backend.js +293 -293
  97. package/lib/helpers-dependencies.backend.d.ts +11 -11
  98. package/lib/helpers-dependencies.backend.js +105 -105
  99. package/lib/helpers-environment.d.ts +5 -5
  100. package/lib/helpers-environment.js +35 -35
  101. package/lib/helpers-file-folders.backend.d.ts +84 -84
  102. package/lib/helpers-file-folders.backend.js +736 -736
  103. package/lib/helpers-git.backend.d.ts +35 -35
  104. package/lib/helpers-git.backend.js +541 -545
  105. package/lib/helpers-git.backend.js.map +1 -1
  106. package/lib/helpers-json5.backend.d.ts +16 -16
  107. package/lib/helpers-json5.backend.js +70 -70
  108. package/lib/helpers-morphi-framework.backend.d.ts +4 -4
  109. package/lib/helpers-morphi-framework.backend.js +49 -49
  110. package/lib/helpers-network.backend.d.ts +8 -8
  111. package/lib/helpers-network.backend.js +48 -48
  112. package/lib/helpers-npm.backend.d.ts +3 -3
  113. package/lib/helpers-npm.backend.js +17 -17
  114. package/lib/helpers-numbers.d.ts +3 -3
  115. package/lib/helpers-numbers.js +11 -11
  116. package/lib/helpers-path.backend.d.ts +7 -7
  117. package/lib/helpers-path.backend.js +36 -36
  118. package/lib/helpers-process.backend.d.ts +57 -57
  119. package/lib/helpers-process.backend.js +529 -529
  120. package/lib/helpers-process.backend.js.map +1 -1
  121. package/lib/helpers-strings-regexes.d.ts +28 -28
  122. package/lib/helpers-strings-regexes.js +60 -60
  123. package/lib/helpers-strings.d.ts +50 -50
  124. package/lib/helpers-strings.js +265 -265
  125. package/lib/helpers-system-terminal.backend.d.ts +5 -5
  126. package/lib/helpers-system-terminal.backend.js +53 -53
  127. package/lib/helpers.d.ts +67 -67
  128. package/lib/helpers.js +391 -391
  129. package/lib/index.d.ts +6 -6
  130. package/lib/index.js +19 -19
  131. package/lib/long-press.directive.d.ts +22 -22
  132. package/lib/long-press.directive.js +141 -141
  133. package/lib/merge-helpers.backend.d.ts +23 -23
  134. package/lib/merge-helpers.backend.js +108 -108
  135. package/lib/project.d.ts +94 -94
  136. package/lib/project.js +422 -422
  137. package/lib/resize-service.d.ts +6 -6
  138. package/lib/resize-service.js +24 -24
  139. package/lib/ts-code/index.d.ts +1 -1
  140. package/lib/ts-code/index.js +7 -7
  141. package/lib/ts-code/ts-code-extractor.d.ts +14 -14
  142. package/lib/ts-code/ts-code-extractor.js +46 -46
  143. package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
  144. package/lib/ts-code/ts-code-modifier.backend.js +70 -70
  145. package/package.json +5 -5
  146. package/package.json_devDependencies.json +222 -222
  147. package/package.json_tnp.json5 +41 -41
  148. package/tmp-environment.json +36 -35
  149. package/websql/README.md +24 -24
  150. package/websql/esm2020/lib/base-component.mjs +47 -47
  151. package/websql/esm2020/lib/base-formly-component.mjs +125 -125
  152. package/websql/esm2020/lib/condition-wait.mjs +53 -53
  153. package/websql/esm2020/lib/constants.mjs +6 -6
  154. package/websql/esm2020/lib/dual-component-ctrl.mjs +120 -120
  155. package/websql/esm2020/lib/helpers-array-obj.mjs +80 -80
  156. package/websql/esm2020/lib/helpers-environment.mjs +30 -30
  157. package/websql/esm2020/lib/helpers-numbers.mjs +5 -5
  158. package/websql/esm2020/lib/helpers-strings-regexes.mjs +48 -48
  159. package/websql/esm2020/lib/helpers-strings.mjs +257 -257
  160. package/websql/esm2020/lib/helpers.mjs +276 -276
  161. package/websql/esm2020/lib/index.mjs +14 -14
  162. package/websql/esm2020/lib/long-press.directive.mjs +111 -111
  163. package/websql/esm2020/lib/project.mjs +413 -413
  164. package/websql/esm2020/lib/resize-service.mjs +19 -19
  165. package/websql/esm2020/public-api.mjs +1 -1
  166. package/websql/esm2020/tnp-helpers.mjs +4 -4
  167. package/websql/fesm2015/tnp-helpers.mjs +1535 -1535
  168. package/websql/fesm2020/tnp-helpers.mjs +1527 -1527
  169. package/websql/lib/base-component.d.ts +17 -17
  170. package/websql/lib/base-formly-component.d.ts +31 -31
  171. package/websql/lib/condition-wait.d.ts +8 -8
  172. package/websql/lib/constants.d.ts +6 -6
  173. package/websql/lib/dual-component-ctrl.d.ts +25 -25
  174. package/websql/lib/helpers-array-obj.d.ts +15 -15
  175. package/websql/lib/helpers-environment.d.ts +5 -5
  176. package/websql/lib/helpers-numbers.d.ts +3 -3
  177. package/websql/lib/helpers-strings-regexes.d.ts +28 -28
  178. package/websql/lib/helpers-strings.d.ts +50 -50
  179. package/websql/lib/helpers.d.ts +28 -28
  180. package/websql/lib/index.d.ts +9 -9
  181. package/websql/lib/long-press.directive.d.ts +25 -25
  182. package/websql/lib/project.d.ts +91 -91
  183. package/websql/lib/resize-service.d.ts +9 -9
  184. package/websql/public-api.d.ts +1 -1
  185. package/websql/tnp-helpers.d.ts +5 -5
@@ -11,1571 +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
- 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
- }
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
+ }
424
424
  }
425
425
 
426
- function conditionWait(conditionAndTimeout) {
427
- return __awaiter(this, void 0, void 0, function* () {
428
- yield waitFor(conditionAndTimeout);
429
- });
430
- }
431
- function waitFor(arr, messageToShow = void 0) {
432
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
433
- if (arr.length === 0) {
434
- resolve(void 0);
435
- }
436
- else {
437
- // 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
- }));
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
+ }));
478
478
  }
479
479
 
480
- class HelpersNumber {
481
- constructor() {
482
- this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
483
- }
480
+ class HelpersNumber {
481
+ constructor() {
482
+ this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
483
+ }
484
484
  }
485
485
 
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
- /* */
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
+ /* */
754
754
  ]);
755
755
 
756
- const BaselineSiteJoinprefix = '__';
757
- const PREFIXES = {
758
- BASELINE: BaselineSiteJoinprefix,
759
- DELETED: '____DELETED____',
760
- ORIGINAL: '____ORIGINAL____',
756
+ const BaselineSiteJoinprefix = '__';
757
+ const PREFIXES = {
758
+ BASELINE: BaselineSiteJoinprefix,
759
+ DELETED: '____DELETED____',
760
+ ORIGINAL: '____ORIGINAL____',
761
761
  };
762
762
 
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
- /* */
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
+ /* */
1169
1169
  /* */
1170
1170
 
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
- }
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.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1183
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseComponent, selector: "app-base-component-meta", inputs: { model: "model" }, ngImport: i0, template: '<div></div>', isInline: true });
1184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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
+ }
1214
1214
  }
1215
1215
 
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
- }
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
+ }
1332
1332
  //#endregion
1333
1333
 
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
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.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1421
+ BaseFormlyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: BaseFormlyComponent, selector: "app-base-formly-component-meta", inputs: { pizda: "pizda", mode: "mode", disabled: "disabled", required: "required", label: "label", placeholder: "placeholder", defaultValue: "defaultValue", model: "model", path: "path", key: "key" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true });
1422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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
1450
1450
  }] } });
1451
1451
 
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
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.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1464
+ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1466
+ type: Injectable
1467
1467
  }], ctorParameters: function () { return []; } });
1468
1468
 
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']
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.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1542
+ LongPress.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LongPress, selector: "[long-press]", inputs: { pressDuration: "pressDuration" }, outputs: { onLongPress: "onLongPress", onLongPressing: "onLongPressing", onLongPressEnd: "onLongPressEnd" }, host: { listeners: { "mousedown": "onMouseDown($event)", "mousemove": "onMouseMove($event)", "mouseup": "onMouseUp()" }, properties: { "class.press": "this.press", "class.longpress": "this.longPress" } }, ngImport: i0 });
1543
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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']
1569
1569
  }] } });
1570
1570
 
1571
- /* */
1572
- /* */
1573
- // export * from './git-project';
1574
- const Helpers = HelpersTnp.Instance;
1571
+ /* */
1572
+ /* */
1573
+ // export * from './git-project';
1574
+ const Helpers = HelpersTnp.Instance;
1575
1575
  //#endregion
1576
1576
 
1577
- /**
1578
- * Generated bundle index. Do not edit.
1577
+ /**
1578
+ * Generated bundle index. Do not edit.
1579
1579
  */
1580
1580
 
1581
1581
  export { BaseComponent, BaseComponentForRouter, BaseFormlyComponent, BaselineSiteJoinprefix, DualComponentController, Helpers, LongPress, PREFIXES, Project, ResizeService };