tnp-helpers 13.1.14 → 13.1.15

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