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
@@ -10,1563 +10,1563 @@ 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
- 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
- }
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
+ }
423
423
  }
424
424
 
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
- });
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
+ });
475
475
  }
476
476
 
477
- class HelpersNumber {
478
- constructor() {
479
- this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
480
- }
477
+ class HelpersNumber {
478
+ constructor() {
479
+ this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
480
+ }
481
481
  }
482
482
 
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
- /* */
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
+ /* */
747
747
  ]);
748
748
 
749
- const BaselineSiteJoinprefix = '__';
750
- const PREFIXES = {
751
- BASELINE: BaselineSiteJoinprefix,
752
- DELETED: '____DELETED____',
753
- ORIGINAL: '____ORIGINAL____',
749
+ const BaselineSiteJoinprefix = '__';
750
+ const PREFIXES = {
751
+ BASELINE: BaselineSiteJoinprefix,
752
+ DELETED: '____DELETED____',
753
+ ORIGINAL: '____ORIGINAL____',
754
754
  };
755
755
 
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
- /* */
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
+ /* */
1162
1162
  /* */
1163
1163
 
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
- }
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.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1176
+ 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 });
1177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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
+ }
1207
1207
  }
1208
1208
 
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
- }
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
+ }
1323
1323
  //#endregion
1324
1324
 
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
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.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1412
+ 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 });
1413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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
1441
1441
  }] } });
1442
1442
 
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
+ 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.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1455
+ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1457
+ type: Injectable
1458
1458
  }], ctorParameters: function () { return []; } });
1459
1459
 
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']
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.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1533
+ 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 });
1534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", 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']
1560
1560
  }] } });
1561
1561
 
1562
- /* */
1563
- /* */
1564
- // export * from './git-project';
1565
- const Helpers = HelpersTnp.Instance;
1562
+ /* */
1563
+ /* */
1564
+ // export * from './git-project';
1565
+ const Helpers = HelpersTnp.Instance;
1566
1566
  //#endregion
1567
1567
 
1568
- /**
1569
- * Generated bundle index. Do not edit.
1568
+ /**
1569
+ * Generated bundle index. Do not edit.
1570
1570
  */
1571
1571
 
1572
1572
  export { BaseComponent, BaseComponentForRouter, BaseFormlyComponent, BaselineSiteJoinprefix, DualComponentController, Helpers, LongPress, PREFIXES, Project, ResizeService };