tnp-helpers 13.1.17 → 13.1.19

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 (217) hide show
  1. package/app.js +3 -3
  2. package/app.js.map +1 -0
  3. package/browser/README.md +24 -24
  4. package/browser/esm2020/lib/angular.helper.mjs +87 -87
  5. package/browser/esm2020/lib/base-component.mjs +49 -49
  6. package/browser/esm2020/lib/base-formly-component.mjs +112 -112
  7. package/browser/esm2020/lib/condition-wait.mjs +45 -45
  8. package/browser/esm2020/lib/constants.mjs +9 -8
  9. package/browser/esm2020/lib/dual-component-ctrl.mjs +118 -118
  10. package/browser/esm2020/lib/firedev-models.mjs +3 -3
  11. package/browser/esm2020/lib/helpers-array-obj.mjs +82 -82
  12. package/browser/esm2020/lib/helpers-browser.mjs +46 -46
  13. package/browser/esm2020/lib/helpers-environment.mjs +32 -32
  14. package/browser/esm2020/lib/helpers-numbers.mjs +8 -8
  15. package/browser/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  16. package/browser/esm2020/lib/helpers-strings.mjs +252 -252
  17. package/browser/esm2020/lib/helpers.mjs +283 -283
  18. package/browser/esm2020/lib/index.mjs +15 -15
  19. package/browser/esm2020/lib/long-press.directive.mjs +112 -112
  20. package/browser/esm2020/lib/project.mjs +429 -429
  21. package/browser/esm2020/lib/resize-service.mjs +21 -21
  22. package/browser/esm2020/public-api.mjs +1 -1
  23. package/browser/esm2020/tnp-helpers.mjs +4 -4
  24. package/browser/fesm2015/tnp-helpers.mjs +1677 -1676
  25. package/browser/fesm2015/tnp-helpers.mjs.map +1 -0
  26. package/browser/fesm2020/tnp-helpers.mjs +1667 -1666
  27. package/browser/fesm2020/tnp-helpers.mjs.map +1 -0
  28. package/browser/lib/angular.helper.d.ts +35 -35
  29. package/browser/lib/base-component.d.ts +16 -16
  30. package/browser/lib/base-formly-component.d.ts +30 -30
  31. package/browser/lib/condition-wait.d.ts +7 -7
  32. package/browser/lib/constants.d.ts +6 -5
  33. package/browser/lib/dual-component-ctrl.d.ts +24 -24
  34. package/browser/lib/firedev-models.d.ts +12 -12
  35. package/browser/lib/helpers-array-obj.d.ts +14 -14
  36. package/browser/lib/helpers-browser.d.ts +10 -10
  37. package/browser/lib/helpers-environment.d.ts +4 -4
  38. package/browser/lib/helpers-numbers.d.ts +2 -2
  39. package/browser/lib/helpers-strings-regexes.d.ts +27 -27
  40. package/browser/lib/helpers-strings.d.ts +49 -49
  41. package/browser/lib/helpers.d.ts +31 -31
  42. package/browser/lib/index.d.ts +11 -11
  43. package/browser/lib/long-press.directive.d.ts +24 -24
  44. package/browser/lib/project.d.ts +94 -94
  45. package/browser/lib/resize-service.d.ts +8 -8
  46. package/browser/tnp-helpers.d.ts +4 -4
  47. package/client/README.md +24 -24
  48. package/client/esm2020/lib/angular.helper.mjs +87 -87
  49. package/client/esm2020/lib/base-component.mjs +49 -49
  50. package/client/esm2020/lib/base-formly-component.mjs +112 -112
  51. package/client/esm2020/lib/condition-wait.mjs +45 -45
  52. package/client/esm2020/lib/constants.mjs +9 -8
  53. package/client/esm2020/lib/dual-component-ctrl.mjs +118 -118
  54. package/client/esm2020/lib/firedev-models.mjs +3 -3
  55. package/client/esm2020/lib/helpers-array-obj.mjs +82 -82
  56. package/client/esm2020/lib/helpers-browser.mjs +46 -46
  57. package/client/esm2020/lib/helpers-environment.mjs +32 -32
  58. package/client/esm2020/lib/helpers-numbers.mjs +8 -8
  59. package/client/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  60. package/client/esm2020/lib/helpers-strings.mjs +252 -252
  61. package/client/esm2020/lib/helpers.mjs +283 -283
  62. package/client/esm2020/lib/index.mjs +15 -15
  63. package/client/esm2020/lib/long-press.directive.mjs +112 -112
  64. package/client/esm2020/lib/project.mjs +429 -429
  65. package/client/esm2020/lib/resize-service.mjs +21 -21
  66. package/client/esm2020/public-api.mjs +1 -1
  67. package/client/esm2020/tnp-helpers.mjs +4 -4
  68. package/client/fesm2015/tnp-helpers.mjs +1677 -1676
  69. package/client/fesm2015/tnp-helpers.mjs.map +1 -0
  70. package/client/fesm2020/tnp-helpers.mjs +1667 -1666
  71. package/client/fesm2020/tnp-helpers.mjs.map +1 -0
  72. package/client/lib/angular.helper.d.ts +35 -35
  73. package/client/lib/base-component.d.ts +16 -16
  74. package/client/lib/base-formly-component.d.ts +30 -30
  75. package/client/lib/condition-wait.d.ts +7 -7
  76. package/client/lib/constants.d.ts +6 -5
  77. package/client/lib/dual-component-ctrl.d.ts +24 -24
  78. package/client/lib/firedev-models.d.ts +12 -12
  79. package/client/lib/helpers-array-obj.d.ts +14 -14
  80. package/client/lib/helpers-browser.d.ts +10 -10
  81. package/client/lib/helpers-environment.d.ts +4 -4
  82. package/client/lib/helpers-numbers.d.ts +2 -2
  83. package/client/lib/helpers-strings-regexes.d.ts +27 -27
  84. package/client/lib/helpers-strings.d.ts +49 -49
  85. package/client/lib/helpers.d.ts +31 -31
  86. package/client/lib/index.d.ts +11 -11
  87. package/client/lib/long-press.directive.d.ts +24 -24
  88. package/client/lib/project.d.ts +94 -94
  89. package/client/lib/resize-service.d.ts +8 -8
  90. package/client/tnp-helpers.d.ts +4 -4
  91. package/index.d.ts +1 -1
  92. package/index.js.map +1 -0
  93. package/lib/angular.helper.d.ts +35 -35
  94. package/lib/angular.helper.js +3 -3
  95. package/lib/angular.helper.js.map +1 -0
  96. package/lib/base-component.d.ts +13 -13
  97. package/lib/base-component.js +3 -3
  98. package/lib/base-component.js.map +1 -0
  99. package/lib/base-formly-component.d.ts +27 -27
  100. package/lib/base-formly-component.js +3 -3
  101. package/lib/base-formly-component.js.map +1 -0
  102. package/lib/condition-wait.d.ts +8 -8
  103. package/lib/condition-wait.js.map +1 -0
  104. package/lib/constants.d.ts +7 -6
  105. package/lib/constants.js +1 -0
  106. package/lib/constants.js.map +1 -0
  107. package/lib/dual-component-ctrl.d.ts +24 -24
  108. package/lib/dual-component-ctrl.js +3 -3
  109. package/lib/dual-component-ctrl.js.map +1 -0
  110. package/lib/firedev-models.d.ts +13 -13
  111. package/lib/firedev-models.js.map +1 -0
  112. package/lib/git-project.d.ts +45 -45
  113. package/lib/git-project.js.map +1 -0
  114. package/lib/helpers-array-obj.d.ts +15 -15
  115. package/lib/helpers-array-obj.js.map +1 -0
  116. package/lib/helpers-browser.d.ts +11 -11
  117. package/lib/helpers-browser.js.map +1 -0
  118. package/lib/helpers-cli-tool.backend.d.ts +55 -55
  119. package/lib/helpers-cli-tool.backend.js.map +1 -0
  120. package/lib/helpers-dependencies.backend.d.ts +11 -11
  121. package/lib/helpers-dependencies.backend.js.map +1 -0
  122. package/lib/helpers-environment.d.ts +5 -5
  123. package/lib/helpers-environment.js.map +1 -0
  124. package/lib/helpers-file-folders.backend.d.ts +84 -83
  125. package/lib/helpers-file-folders.backend.js +10 -1
  126. package/lib/helpers-file-folders.backend.js.map +1 -0
  127. package/lib/helpers-git.backend.d.ts +43 -43
  128. package/lib/helpers-git.backend.js.map +1 -0
  129. package/lib/helpers-json5.backend.d.ts +16 -16
  130. package/lib/helpers-json5.backend.js.map +1 -0
  131. package/lib/helpers-morphi-framework.backend.d.ts +4 -4
  132. package/lib/helpers-morphi-framework.backend.js.map +1 -0
  133. package/lib/helpers-network.backend.d.ts +8 -8
  134. package/lib/helpers-network.backend.js.map +1 -0
  135. package/lib/helpers-npm.backend.d.ts +3 -3
  136. package/lib/helpers-npm.backend.js.map +1 -0
  137. package/lib/helpers-numbers.d.ts +3 -3
  138. package/lib/helpers-numbers.js.map +1 -0
  139. package/lib/helpers-path.backend.d.ts +7 -7
  140. package/lib/helpers-path.backend.js.map +1 -0
  141. package/lib/helpers-process.backend.d.ts +58 -54
  142. package/lib/helpers-process.backend.js +20 -0
  143. package/lib/helpers-process.backend.js.map +1 -0
  144. package/lib/helpers-strings-regexes.d.ts +28 -28
  145. package/lib/helpers-strings-regexes.js.map +1 -0
  146. package/lib/helpers-strings.d.ts +50 -50
  147. package/lib/helpers-strings.js.map +1 -0
  148. package/lib/helpers-system-terminal.backend.d.ts +5 -5
  149. package/lib/helpers-system-terminal.backend.js.map +1 -0
  150. package/lib/helpers-vscode.backend.d.ts +5 -5
  151. package/lib/helpers-vscode.backend.js.map +1 -0
  152. package/lib/helpers.d.ts +72 -72
  153. package/lib/helpers.js.map +1 -0
  154. package/lib/index.d.ts +12 -12
  155. package/lib/index.js.map +1 -0
  156. package/lib/long-press.directive.d.ts +22 -22
  157. package/lib/long-press.directive.js.map +1 -0
  158. package/lib/merge-helpers.backend.d.ts +23 -23
  159. package/lib/merge-helpers.backend.js.map +1 -0
  160. package/lib/project.d.ts +97 -97
  161. package/lib/project.js.map +1 -0
  162. package/lib/resize-service.d.ts +6 -6
  163. package/lib/resize-service.js.map +1 -0
  164. package/lib/ts-code/index.d.ts +1 -1
  165. package/lib/ts-code/index.js.map +1 -0
  166. package/lib/ts-code/ts-code-extractor.d.ts +14 -14
  167. package/lib/ts-code/ts-code-extractor.js.map +1 -0
  168. package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
  169. package/lib/ts-code/ts-code-modifier.backend.js.map +1 -0
  170. package/package.json +5 -5
  171. package/package.json_devDependencies.json +222 -222
  172. package/package.json_tnp.json5 +44 -44
  173. package/tmp-environment.json +30 -29
  174. package/websql/README.md +24 -24
  175. package/websql/esm2020/lib/angular.helper.mjs +87 -87
  176. package/websql/esm2020/lib/base-component.mjs +49 -49
  177. package/websql/esm2020/lib/base-formly-component.mjs +112 -112
  178. package/websql/esm2020/lib/condition-wait.mjs +45 -45
  179. package/websql/esm2020/lib/constants.mjs +9 -8
  180. package/websql/esm2020/lib/dual-component-ctrl.mjs +118 -118
  181. package/websql/esm2020/lib/firedev-models.mjs +3 -3
  182. package/websql/esm2020/lib/helpers-array-obj.mjs +82 -82
  183. package/websql/esm2020/lib/helpers-browser.mjs +46 -46
  184. package/websql/esm2020/lib/helpers-environment.mjs +32 -32
  185. package/websql/esm2020/lib/helpers-numbers.mjs +8 -8
  186. package/websql/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  187. package/websql/esm2020/lib/helpers-strings.mjs +252 -252
  188. package/websql/esm2020/lib/helpers.mjs +283 -283
  189. package/websql/esm2020/lib/index.mjs +15 -15
  190. package/websql/esm2020/lib/long-press.directive.mjs +112 -112
  191. package/websql/esm2020/lib/project.mjs +429 -429
  192. package/websql/esm2020/lib/resize-service.mjs +21 -21
  193. package/websql/esm2020/public-api.mjs +1 -1
  194. package/websql/esm2020/tnp-helpers.mjs +4 -4
  195. package/websql/fesm2015/tnp-helpers.mjs +1677 -1676
  196. package/websql/fesm2015/tnp-helpers.mjs.map +1 -0
  197. package/websql/fesm2020/tnp-helpers.mjs +1667 -1666
  198. package/websql/fesm2020/tnp-helpers.mjs.map +1 -0
  199. package/websql/lib/angular.helper.d.ts +35 -35
  200. package/websql/lib/base-component.d.ts +16 -16
  201. package/websql/lib/base-formly-component.d.ts +30 -30
  202. package/websql/lib/condition-wait.d.ts +7 -7
  203. package/websql/lib/constants.d.ts +6 -5
  204. package/websql/lib/dual-component-ctrl.d.ts +24 -24
  205. package/websql/lib/firedev-models.d.ts +12 -12
  206. package/websql/lib/helpers-array-obj.d.ts +14 -14
  207. package/websql/lib/helpers-browser.d.ts +10 -10
  208. package/websql/lib/helpers-environment.d.ts +4 -4
  209. package/websql/lib/helpers-numbers.d.ts +2 -2
  210. package/websql/lib/helpers-strings-regexes.d.ts +27 -27
  211. package/websql/lib/helpers-strings.d.ts +49 -49
  212. package/websql/lib/helpers.d.ts +31 -31
  213. package/websql/lib/index.d.ts +11 -11
  214. package/websql/lib/long-press.directive.d.ts +24 -24
  215. package/websql/lib/project.d.ts +94 -94
  216. package/websql/lib/resize-service.d.ts +8 -8
  217. package/websql/tnp-helpers.d.ts +4 -4
@@ -10,1708 +10,1709 @@ import { FieldType } from '@ngx-formly/core';
10
10
  import { Log, Level } from 'ng2-logger/websql';
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?.split('\n').map(f => f.trimRight()).join('\n');
231
- return 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?.split('\n').map(f => f.trimRight()).join('\n');
231
+ return 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
- async function conditionWait(conditionAndTimeout) {
427
- await waitFor(conditionAndTimeout);
428
- }
429
- function waitFor(arr, messageToShow = void 0) {
430
- return new Promise(async (resolve, reject) => {
431
- if (arr.length === 0) {
432
- resolve(void 0);
433
- }
434
- else {
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
- const resultTrue = await Helpers.runSyncOrAsync(check.callback, check);
444
- if (resultTrue) {
445
- setTimeout(async () => {
446
- await waitFor(arr).then(() => {
447
- resolve(void 0);
448
- });
449
- }, timeoutNext);
450
- }
451
- else {
452
- arr.unshift(check);
453
- if (!messageToShow || check.errorMessage !== messageToShow) {
454
- Helpers.info(check.errorMessage);
455
- }
456
- else {
457
- }
458
- setTimeout(async () => {
459
- await waitFor(arr, check.errorMessage).then(() => {
460
- resolve(void 0);
461
- });
462
- }, timeoutCheck);
463
- }
464
- }
465
- });
466
- }
467
- ;
426
+ async function conditionWait(conditionAndTimeout) {
427
+ await waitFor(conditionAndTimeout);
428
+ }
429
+ function waitFor(arr, messageToShow = void 0) {
430
+ return new Promise(async (resolve, reject) => {
431
+ if (arr.length === 0) {
432
+ resolve(void 0);
433
+ }
434
+ else {
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
+ const resultTrue = await Helpers.runSyncOrAsync(check.callback, check);
444
+ if (resultTrue) {
445
+ setTimeout(async () => {
446
+ await waitFor(arr).then(() => {
447
+ resolve(void 0);
448
+ });
449
+ }, timeoutNext);
450
+ }
451
+ else {
452
+ arr.unshift(check);
453
+ if (!messageToShow || check.errorMessage !== messageToShow) {
454
+ Helpers.info(check.errorMessage);
455
+ }
456
+ else {
457
+ }
458
+ setTimeout(async () => {
459
+ await waitFor(arr, check.errorMessage).then(() => {
460
+ resolve(void 0);
461
+ });
462
+ }, timeoutCheck);
463
+ }
464
+ }
465
+ });
466
+ }
467
+ ;
468
468
  ({}); // @--end-of-file-for-module=tnp-helpers lib/condition-wait.ts
469
469
 
470
- class HelpersNumber {
471
- constructor() {
472
- this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
473
- }
474
- }
475
- ;
470
+ class HelpersNumber {
471
+ constructor() {
472
+ this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
473
+ }
474
+ }
475
+ ;
476
476
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-numbers.ts
477
477
 
478
- const key = Symbol('[firedev-helpers] helper browser key');
479
- class HelpersBrowaser {
480
- constructor(win) {
481
- this.init = (() => {
482
- const win = this.win;
483
- if (!win[key]) {
484
- win[key] = new HelpersBrowaser(win);
485
- }
486
- HelpersBrowaser.inst = win[key];
487
- })();
488
- win.addEventListener("beforeunload", (e) => {
489
- win.sessionStorage.tabId = this.tabId;
490
- return null;
491
- });
492
- setTimeout(() => {
493
- if (win.sessionStorage?.tabId) {
494
- // @ts-ignore
495
- this.tabId = Number(win.sessionStorage.tabId);
496
- win.sessionStorage.removeItem("tabId");
497
- }
498
- else {
499
- // @ts-ignore
500
- this.tabId = Math.floor(Math.random() * 1000000) + (new Date()).getTime();
501
- }
502
- HelpersBrowaser.callbacks.forEach((c) => {
503
- c(this);
504
- });
505
- });
506
- }
507
- static onInit(callback) {
508
- this.callbacks.push(callback);
509
- }
510
- get win() {
511
- let win = window;
512
- return win;
513
- }
514
- get tabIdSessionStorage() {
515
- return Number(this.win.sessionStorage?.tabId) || 0;
516
- }
517
- static get instance() {
518
- return HelpersBrowaser.inst;
519
- }
520
- }
521
- HelpersBrowaser.callbacks = [];
522
- ;
478
+ const key = Symbol('[firedev-helpers] helper browser key');
479
+ class HelpersBrowaser {
480
+ constructor(win) {
481
+ this.init = (() => {
482
+ const win = this.win;
483
+ if (!win[key]) {
484
+ win[key] = new HelpersBrowaser(win);
485
+ }
486
+ HelpersBrowaser.inst = win[key];
487
+ })();
488
+ win.addEventListener("beforeunload", (e) => {
489
+ win.sessionStorage.tabId = this.tabId;
490
+ return null;
491
+ });
492
+ setTimeout(() => {
493
+ if (win.sessionStorage?.tabId) {
494
+ // @ts-ignore
495
+ this.tabId = Number(win.sessionStorage.tabId);
496
+ win.sessionStorage.removeItem("tabId");
497
+ }
498
+ else {
499
+ // @ts-ignore
500
+ this.tabId = Math.floor(Math.random() * 1000000) + (new Date()).getTime();
501
+ }
502
+ HelpersBrowaser.callbacks.forEach((c) => {
503
+ c(this);
504
+ });
505
+ });
506
+ }
507
+ static onInit(callback) {
508
+ this.callbacks.push(callback);
509
+ }
510
+ get win() {
511
+ let win = window;
512
+ return win;
513
+ }
514
+ get tabIdSessionStorage() {
515
+ return Number(this.win.sessionStorage?.tabId) || 0;
516
+ }
517
+ static get instance() {
518
+ return HelpersBrowaser.inst;
519
+ }
520
+ }
521
+ HelpersBrowaser.callbacks = [];
522
+ ;
523
523
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers-browser.ts
524
524
 
525
- const componentContextSymbol = Symbol();
526
- const componentsDestroy$Subjects = {};
527
- class SerializedSubject {
528
- constructor(id) {
529
- this.id = id;
530
- }
531
- }
532
- var NgHelpers;
533
- (function (NgHelpers) {
534
- function subjectId(destroySubject) {
535
- const id = Math.random().toString(36).substring(2);
536
- if (!destroySubject[componentContextSymbol]) {
537
- destroySubject[componentContextSymbol] = new SerializedSubject(id);
538
- componentsDestroy$Subjects[id] = destroySubject;
539
- }
540
- return destroySubject[componentContextSymbol];
541
- }
542
- /**
543
- * if you are using this.. please call Helpers.ng.unsubscribe(this.$destroy) in ngOnDestroy();
544
- */
545
- function serialize(destroy$) {
546
- return subjectId(destroy$);
547
- }
548
- NgHelpers.serialize = serialize;
549
- /**
550
- * if you are using this.. please call Helpers.ng.unsubscribe(this.$destroy) in ngOnDestroy();
551
- */
552
- function deserialize(destroy$) {
553
- if (destroy$?.id) {
554
- const realDestroySubject = componentsDestroy$Subjects[destroy$.id];
555
- return realDestroySubject;
556
- }
557
- return new Subject();
558
- }
559
- NgHelpers.deserialize = deserialize;
560
- function unsubscribe(destroy$) {
561
- const destroySubject = subjectId(destroy$);
562
- if (destroySubject?.id) {
563
- delete componentsDestroy$Subjects[destroySubject.id];
564
- delete destroySubject[componentContextSymbol];
565
- }
566
- }
567
- NgHelpers.unsubscribe = unsubscribe;
568
- /**
569
- get properties from scss file
570
-
571
-
572
- import styles from './tasks-ngrx-data.component.scss';
573
-
574
- export class ExampleComponent {
575
- sassFile = sassFile(styles);
576
-
577
- async ngOnInit() {
578
- this.tasksService.getAll();
579
- console.log(this.sassFile.stringValue('--max-container-size'))
580
- console.log(this.sassFile.numberValue('--max-container-size'))
581
- }
582
- }
583
- */
584
- function sassFile(styles) {
585
- const lines = (styles.split('\n'));
586
- return {
587
- stringValue: (name) => {
588
- for (let index = 0; index < lines.length; index++) {
589
- const l = lines[index];
590
- const [varName, value] = l.trim().split(':');
591
- if (varName === name) {
592
- return value.replace(';', '');
593
- }
594
- }
595
- },
596
- numberValue: (name) => {
597
- for (let index = 0; index < lines.length; index++) {
598
- const l = lines[index];
599
- const [varName, value] = l.trim().split(':');
600
- if (varName === name) {
601
- return Number(value.replace('px', '').replace(';', ''));
602
- }
603
- }
604
- }
605
- };
606
- }
607
- NgHelpers.sassFile = sassFile;
608
- })(NgHelpers || (NgHelpers = {}));
609
- ;
525
+ const componentContextSymbol = Symbol();
526
+ const componentsDestroy$Subjects = {};
527
+ class SerializedSubject {
528
+ constructor(id) {
529
+ this.id = id;
530
+ }
531
+ }
532
+ var NgHelpers;
533
+ (function (NgHelpers) {
534
+ function subjectId(destroySubject) {
535
+ const id = Math.random().toString(36).substring(2);
536
+ if (!destroySubject[componentContextSymbol]) {
537
+ destroySubject[componentContextSymbol] = new SerializedSubject(id);
538
+ componentsDestroy$Subjects[id] = destroySubject;
539
+ }
540
+ return destroySubject[componentContextSymbol];
541
+ }
542
+ /**
543
+ * if you are using this.. please call Helpers.ng.unsubscribe(this.$destroy) in ngOnDestroy();
544
+ */
545
+ function serialize(destroy$) {
546
+ return subjectId(destroy$);
547
+ }
548
+ NgHelpers.serialize = serialize;
549
+ /**
550
+ * if you are using this.. please call Helpers.ng.unsubscribe(this.$destroy) in ngOnDestroy();
551
+ */
552
+ function deserialize(destroy$) {
553
+ if (destroy$?.id) {
554
+ const realDestroySubject = componentsDestroy$Subjects[destroy$.id];
555
+ return realDestroySubject;
556
+ }
557
+ return new Subject();
558
+ }
559
+ NgHelpers.deserialize = deserialize;
560
+ function unsubscribe(destroy$) {
561
+ const destroySubject = subjectId(destroy$);
562
+ if (destroySubject?.id) {
563
+ delete componentsDestroy$Subjects[destroySubject.id];
564
+ delete destroySubject[componentContextSymbol];
565
+ }
566
+ }
567
+ NgHelpers.unsubscribe = unsubscribe;
568
+ /**
569
+ get properties from scss file
570
+
571
+
572
+ import styles from './tasks-ngrx-data.component.scss';
573
+
574
+ export class ExampleComponent {
575
+ sassFile = sassFile(styles);
576
+
577
+ async ngOnInit() {
578
+ this.tasksService.getAll();
579
+ console.log(this.sassFile.stringValue('--max-container-size'))
580
+ console.log(this.sassFile.numberValue('--max-container-size'))
581
+ }
582
+ }
583
+ */
584
+ function sassFile(styles) {
585
+ const lines = (styles.split('\n'));
586
+ return {
587
+ stringValue: (name) => {
588
+ for (let index = 0; index < lines.length; index++) {
589
+ const l = lines[index];
590
+ const [varName, value] = l.trim().split(':');
591
+ if (varName === name) {
592
+ return value.replace(';', '');
593
+ }
594
+ }
595
+ },
596
+ numberValue: (name) => {
597
+ for (let index = 0; index < lines.length; index++) {
598
+ const l = lines[index];
599
+ const [varName, value] = l.trim().split(':');
600
+ if (varName === name) {
601
+ return Number(value.replace('px', '').replace(';', ''));
602
+ }
603
+ }
604
+ }
605
+ };
606
+ }
607
+ NgHelpers.sassFile = sassFile;
608
+ })(NgHelpers || (NgHelpers = {}));
609
+ ;
610
610
  ({}); // @--end-of-file-for-module=tnp-helpers lib/angular.helper.ts
611
611
 
612
- function applyMixins(derivedCtor, baseCtors) {
613
- baseCtors.forEach(baseCtor => {
614
- Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
615
- Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
616
- });
617
- });
618
- }
619
- // @ts-ignore
620
- class HelpersTnp extends CoreHelpers {
621
- constructor(
622
- /* */
623
- /* */
624
- /* */
625
- /* */
626
- /* */
627
- /* */
628
- /* */
629
- /* */
630
- /* */
631
- /* */
632
- /* */
633
- /* */
634
- /* */
635
- arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber(), browser = HelpersBrowaser.instance, ng = NgHelpers) {
636
- super();
637
- this.arrays = arrays;
638
- this.strings = strings;
639
- this.numbers = numbers;
640
- this.browser = browser;
641
- this.ng = ng;
642
- this.conditionWait = conditionWait;
643
- /* */
644
- /* */
645
- /* */
646
- /* */
647
- /* */
648
- /* */
649
- /* */
650
- /* */
651
- /* */
652
- /* */
653
- /* */
654
- /* */
655
- /* */
656
- /* */
657
- /* */
658
- /* */
659
- /* */
660
- /* */
661
- /* */
662
- /* */
663
- /* */
664
- /* */
665
- /* */
666
- /* */
667
- /* */
668
- /* */
669
- /* */
670
- /* */
671
- /* */
672
- /* */
673
- /* */
674
- /* */
675
- /* */
676
- /* */
677
- /* */
678
- /* */
679
- /* */
680
- /* */
681
- /* */
682
- /* */
683
- /* */
684
- /* */
685
- /* */
686
- /* */
687
- /* */
688
- /* */
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
- /* */
720
- /* */
721
- this.applyMixins = applyMixins;
722
- }
723
- static get Instance() {
724
- if (!HelpersTnp._instance) {
725
- HelpersTnp._instance = new HelpersTnp();
726
- }
727
- return HelpersTnp._instance;
728
- }
729
- CLIWRAP(f, name) {
730
- CLASS.setName(f, name);
731
- return f;
732
- }
733
- /* */
734
- /* */
735
- /* */
736
- /* */
737
- /* */
738
- /* */
739
- /* */
740
- /* */
741
- /* */
742
- /* */
743
- /* */
744
- /* */
745
- /* */
746
- /* */
747
- /* */
748
- /* */
749
- /* */
750
- /* */
751
- /* */
752
- /* */
753
- /* */
754
- /* */
755
- /* */
756
- /* */
757
- /* */
758
- /* */
759
- /* */
760
- /* */
761
- /* */
762
- /* */
763
- /* */
764
- /* */
765
- /* */
766
- /* */
767
- /* */
768
- /* */
769
- /* */
770
- /* */
771
- async isElevated() {
772
- /* */
773
- /* */
774
- /* */
775
- /* */
776
- }
777
- /* */
778
- /* */
779
- /* */
780
- /* */
781
- /* */
782
- /* */
783
- /* */
784
- /* */
785
- /* */
786
- /* */
787
- /* */
788
- /* */
789
- /* */
790
- /* */
791
- /* */
792
- /* */
793
- /* */
794
- /* */
795
- /* */
796
- /* */
797
- /* */
798
- /* */
799
- /* */
800
- /* */
801
- async mesureExectionInMs(description, functionToExecute, ...functionArguments) {
802
- var start = new Date();
803
- await Helpers.runSyncOrAsync(functionToExecute, ...functionArguments);
804
- //@ts-ignore
805
- var end = new Date() - start;
806
- if (Morphi.IsBrowser) {
807
- Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
808
- }
809
- /* */
810
- /* */
811
- return end;
812
- }
813
- mesureExectionInMsSync(description, functionToExecute) {
814
- var start = new Date();
815
- functionToExecute();
816
- //@ts-ignore
817
- var end = new Date() - start;
818
- if (Morphi.IsBrowser) {
819
- Helpers.log(`Execution time: ${end.toString()}ms for "${description}"`);
820
- }
821
- /* */
822
- /* */
823
- return end;
824
- }
825
- waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
826
- return new Promise(async (resolve, reject) => {
827
- const result = await Helpers.runSyncOrAsync(conditionFn);
828
- if (result) {
829
- resolve(void 0);
830
- }
831
- else {
832
- setTimeout(() => {
833
- Helpers.waitForCondition(conditionFn, howOfftenCheckInMs).then(() => {
834
- resolve(void 0);
835
- });
836
- }, howOfftenCheckInMs);
837
- }
838
- });
839
- }
840
- getBrowserVerPath(moduleName, websql = false) {
841
- /* */
842
- /* */
843
- /* */
844
- /* */
845
- /* */
846
- }
847
- getMethodName(obj, method) {
848
- var methodName = null;
849
- Object.getOwnPropertyNames(obj).forEach(prop => {
850
- if (obj[prop] === method) {
851
- methodName = prop;
852
- }
853
- });
854
- if (methodName !== null) {
855
- return methodName;
856
- }
857
- var proto = Object.getPrototypeOf(obj);
858
- if (proto) {
859
- return Helpers.getMethodName(proto, method);
860
- }
861
- return null;
862
- }
863
- fixWebpackEnv(env) {
864
- _.forIn(env, (v, k) => {
865
- const value = v;
866
- if (value === 'true')
867
- env[k] = true;
868
- if (value === 'false')
869
- env[k] = false;
870
- });
871
- }
872
- }
873
- applyMixins(HelpersTnp, [
874
- HelpersStringsRegexes,
875
- HelpersEnvironment,
876
- /* */
877
- /* */
878
- /* */
879
- ]);
880
- ;
612
+ function applyMixins(derivedCtor, baseCtors) {
613
+ baseCtors.forEach(baseCtor => {
614
+ Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
615
+ Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
616
+ });
617
+ });
618
+ }
619
+ // @ts-ignore
620
+ class HelpersTnp extends CoreHelpers {
621
+ constructor(
622
+ /* */
623
+ /* */
624
+ /* */
625
+ /* */
626
+ /* */
627
+ /* */
628
+ /* */
629
+ /* */
630
+ /* */
631
+ /* */
632
+ /* */
633
+ /* */
634
+ /* */
635
+ arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber(), browser = HelpersBrowaser.instance, ng = NgHelpers) {
636
+ super();
637
+ this.arrays = arrays;
638
+ this.strings = strings;
639
+ this.numbers = numbers;
640
+ this.browser = browser;
641
+ this.ng = ng;
642
+ this.conditionWait = conditionWait;
643
+ /* */
644
+ /* */
645
+ /* */
646
+ /* */
647
+ /* */
648
+ /* */
649
+ /* */
650
+ /* */
651
+ /* */
652
+ /* */
653
+ /* */
654
+ /* */
655
+ /* */
656
+ /* */
657
+ /* */
658
+ /* */
659
+ /* */
660
+ /* */
661
+ /* */
662
+ /* */
663
+ /* */
664
+ /* */
665
+ /* */
666
+ /* */
667
+ /* */
668
+ /* */
669
+ /* */
670
+ /* */
671
+ /* */
672
+ /* */
673
+ /* */
674
+ /* */
675
+ /* */
676
+ /* */
677
+ /* */
678
+ /* */
679
+ /* */
680
+ /* */
681
+ /* */
682
+ /* */
683
+ /* */
684
+ /* */
685
+ /* */
686
+ /* */
687
+ /* */
688
+ /* */
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
+ /* */
720
+ /* */
721
+ this.applyMixins = applyMixins;
722
+ }
723
+ static get Instance() {
724
+ if (!HelpersTnp._instance) {
725
+ HelpersTnp._instance = new HelpersTnp();
726
+ }
727
+ return HelpersTnp._instance;
728
+ }
729
+ CLIWRAP(f, name) {
730
+ CLASS.setName(f, name);
731
+ return f;
732
+ }
733
+ /* */
734
+ /* */
735
+ /* */
736
+ /* */
737
+ /* */
738
+ /* */
739
+ /* */
740
+ /* */
741
+ /* */
742
+ /* */
743
+ /* */
744
+ /* */
745
+ /* */
746
+ /* */
747
+ /* */
748
+ /* */
749
+ /* */
750
+ /* */
751
+ /* */
752
+ /* */
753
+ /* */
754
+ /* */
755
+ /* */
756
+ /* */
757
+ /* */
758
+ /* */
759
+ /* */
760
+ /* */
761
+ /* */
762
+ /* */
763
+ /* */
764
+ /* */
765
+ /* */
766
+ /* */
767
+ /* */
768
+ /* */
769
+ /* */
770
+ /* */
771
+ async isElevated() {
772
+ /* */
773
+ /* */
774
+ /* */
775
+ /* */
776
+ }
777
+ /* */
778
+ /* */
779
+ /* */
780
+ /* */
781
+ /* */
782
+ /* */
783
+ /* */
784
+ /* */
785
+ /* */
786
+ /* */
787
+ /* */
788
+ /* */
789
+ /* */
790
+ /* */
791
+ /* */
792
+ /* */
793
+ /* */
794
+ /* */
795
+ /* */
796
+ /* */
797
+ /* */
798
+ /* */
799
+ /* */
800
+ /* */
801
+ async mesureExectionInMs(description, functionToExecute, ...functionArguments) {
802
+ var start = new Date();
803
+ await Helpers.runSyncOrAsync(functionToExecute, ...functionArguments);
804
+ //@ts-ignore
805
+ var end = new Date() - start;
806
+ if (Morphi.IsBrowser) {
807
+ Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
808
+ }
809
+ /* */
810
+ /* */
811
+ return end;
812
+ }
813
+ mesureExectionInMsSync(description, functionToExecute) {
814
+ var start = new Date();
815
+ functionToExecute();
816
+ //@ts-ignore
817
+ var end = new Date() - start;
818
+ if (Morphi.IsBrowser) {
819
+ Helpers.log(`Execution time: ${end.toString()}ms for "${description}"`);
820
+ }
821
+ /* */
822
+ /* */
823
+ return end;
824
+ }
825
+ waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
826
+ return new Promise(async (resolve, reject) => {
827
+ const result = await Helpers.runSyncOrAsync(conditionFn);
828
+ if (result) {
829
+ resolve(void 0);
830
+ }
831
+ else {
832
+ setTimeout(() => {
833
+ Helpers.waitForCondition(conditionFn, howOfftenCheckInMs).then(() => {
834
+ resolve(void 0);
835
+ });
836
+ }, howOfftenCheckInMs);
837
+ }
838
+ });
839
+ }
840
+ getBrowserVerPath(moduleName, websql = false) {
841
+ /* */
842
+ /* */
843
+ /* */
844
+ /* */
845
+ /* */
846
+ }
847
+ getMethodName(obj, method) {
848
+ var methodName = null;
849
+ Object.getOwnPropertyNames(obj).forEach(prop => {
850
+ if (obj[prop] === method) {
851
+ methodName = prop;
852
+ }
853
+ });
854
+ if (methodName !== null) {
855
+ return methodName;
856
+ }
857
+ var proto = Object.getPrototypeOf(obj);
858
+ if (proto) {
859
+ return Helpers.getMethodName(proto, method);
860
+ }
861
+ return null;
862
+ }
863
+ fixWebpackEnv(env) {
864
+ _.forIn(env, (v, k) => {
865
+ const value = v;
866
+ if (value === 'true')
867
+ env[k] = true;
868
+ if (value === 'false')
869
+ env[k] = false;
870
+ });
871
+ }
872
+ }
873
+ applyMixins(HelpersTnp, [
874
+ HelpersStringsRegexes,
875
+ HelpersEnvironment,
876
+ /* */
877
+ /* */
878
+ /* */
879
+ ]);
880
+ ;
881
881
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers.ts
882
882
 
883
- const BaselineSiteJoinprefix = '__';
884
- const PREFIXES = {
885
- BASELINE: BaselineSiteJoinprefix,
886
- DELETED: '____DELETED____',
887
- ORIGINAL: '____ORIGINAL____',
888
- };
883
+ const BaselineSiteJoinprefix = '__';
884
+ const PREFIXES = {
885
+ BASELINE: BaselineSiteJoinprefix,
886
+ DELETED: '____DELETED____',
887
+ ORIGINAL: '____ORIGINAL____',
888
+ RESTORE_NPM: '____',
889
+ };
889
890
  ({}); // @--end-of-file-for-module=tnp-helpers lib/constants.ts
890
891
 
891
- /* */
892
- const Helpers$1 = HelpersTnp.Instance;
893
- class Project {
894
- constructor() {
895
- /* */
896
- /* */
897
- this.cache = {};
898
- this.browser = {};
899
- }
900
- static typeFrom(location) {
901
- /* */
902
- /* */
903
- /* */
904
- /* */
905
- /* */
906
- /* */
907
- /* */
908
- /* */
909
- /* */
910
- /* */
911
- /* */
912
- /* */
913
- return (void 0);
914
- }
915
- static unload(project) {
916
- Project.projects = Project.projects.filter(f => f !== project);
917
- }
918
- static From(locationOfProj) {
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
- /* */
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
- /* */
1018
- /* */
1019
- /* */
1020
- /* */
1021
- /* */
1022
- /* */
1023
- /* */
1024
- /* */
1025
- /* */
1026
- /* */
1027
- /* */
1028
- /* */
1029
- /* */
1030
- /* */
1031
- /* */
1032
- /* */
1033
- /* */
1034
- /* */
1035
- /* */
1036
- return (void 0);
1037
- }
1038
- static nearestTo(absoluteLocation, options) {
1039
- /* */
1040
- /* */
1041
- /* */
1042
- /* */
1043
- /* */
1044
- /* */
1045
- /* */
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
- /* */
1077
- /* */
1078
- /* */
1079
- /* */
1080
- /* */
1081
- /* */
1082
- /* */
1083
- /* */
1084
- /* */
1085
- /* */
1086
- /* */
1087
- /* */
1088
- /* */
1089
- /* */
1090
- /* */
1091
- /* */
1092
- /* */
1093
- /* */
1094
- /* */
1095
- /* */
1096
- /* */
1097
- return (void 0);
1098
- }
1099
- static allProjectFrom(absoluteLocation, stopOnCwd = '/') {
1100
- /* */
1101
- /* */
1102
- /* */
1103
- /* */
1104
- /* */
1105
- /* */
1106
- /* */
1107
- /* */
1108
- /* */
1109
- /* */
1110
- /* */
1111
- /* */
1112
- /* */
1113
- /* */
1114
- /* */
1115
- /* */
1116
- /* */
1117
- /* */
1118
- /* */
1119
- /* */
1120
- /* */
1121
- /* */
1122
- return (void 0);
1123
- }
1124
- static DefaultPortByType(type) {
1125
- if (type === 'workspace') {
1126
- return 5000;
1127
- }
1128
- if (type === 'angular-client') {
1129
- return 4300;
1130
- }
1131
- if (type === 'angular-lib') {
1132
- return 4250;
1133
- }
1134
- if (type === 'electron-client') {
1135
- return 4350;
1136
- }
1137
- if (type === 'ionic-client') {
1138
- return 8080;
1139
- }
1140
- if (type === 'docker') {
1141
- return 5000;
1142
- }
1143
- if (type === 'isomorphic-lib') {
1144
- return 4000;
1145
- }
1146
- if (type === 'container' || type === 'unknow-npm-project') {
1147
- return;
1148
- }
1149
- }
1150
- static get isBundleMode() {
1151
- if (Helpers$1.isBrowser) {
1152
- return true;
1153
- }
1154
- /* */
1155
- /* */
1156
- }
1157
- static get Current() {
1158
- /* */
1159
- /* */
1160
- /* */
1161
- /* */
1162
- /* */
1163
- /* */
1164
- /* */
1165
- /* */
1166
- /* */
1167
- /* */
1168
- /* */
1169
- return (void 0);
1170
- }
1171
- /**
1172
- * @deprecated
1173
- */
1174
- static get Tnp() {
1175
- /* */
1176
- /* */
1177
- /* */
1178
- /* */
1179
- /* */
1180
- /* */
1181
- /* */
1182
- return (void 0);
1183
- }
1184
- static by(libraryType, version
1185
- /* */
1186
- /* */
1187
- ) {
1188
- /* */
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
- return (void 0);
1216
- }
1217
- defineProperty(variableName, classFn) {
1218
- /* */
1219
- /* */
1220
- /* */
1221
- /* */
1222
- /* */
1223
- /* */
1224
- /* */
1225
- /* */
1226
- /* */
1227
- /* */
1228
- /* */
1229
- /* */
1230
- /* */
1231
- /* */
1232
- /* */
1233
- /* */
1234
- /* */
1235
- /* */
1236
- /* */
1237
- /* */
1238
- /* */
1239
- /* */
1240
- /* */
1241
- /* */
1242
- return (void 0);
1243
- }
1244
- setType(type) {
1245
- // @ts-ignore
1246
- this._type = type;
1247
- }
1248
- typeIs(...types) {
1249
- return this._type && types.includes(this._type);
1250
- }
1251
- typeIsNot(...types) {
1252
- return !this.typeIs(...types);
1253
- }
1254
- forEmptyStructure() {
1255
- /* */
1256
- /* */
1257
- /* */
1258
- /* */
1259
- /* */
1260
- return (void 0);
1261
- }
1262
- }
1263
- Project.projects = [];
1264
- /**
1265
- * To speed up checking folder I am keeping pathes for alterdy checked folder
1266
- * This may break things that are creating new projects
1267
- */
1268
- Project.emptyLocations = [];
1269
- /* */
1270
- /* */
1271
- /* */
1272
- /* */
1273
- /* */
1274
- /* */
1275
- /* */
1276
- /* */
1277
- /* */
1278
- /* */
1279
- /* */
1280
- /* */
1281
- /* */
1282
- /* */
1283
- /* */
1284
- /* */
1285
- /* */
1286
- /* */
1287
- /* */
1288
- /* */
1289
- /* */
1290
- /* */
1291
- /* */
1292
- /* */
1293
- /* */
1294
- /* */
1295
- /* */
1296
- /* */
1297
- /* */
1298
- /* */
1299
- /* */
1300
- /* */
1301
- /* */
1302
- /* */
1303
- /* */
1304
- /* */
1305
- /* */
1306
- /* */
1307
- /* */
1308
- /* */
1309
- /* */
1310
- /* */
1311
- /* */
1312
- /* */
1313
- ;
892
+ /* */
893
+ const Helpers$1 = HelpersTnp.Instance;
894
+ class Project {
895
+ constructor() {
896
+ /* */
897
+ /* */
898
+ this.cache = {};
899
+ this.browser = {};
900
+ }
901
+ static typeFrom(location) {
902
+ /* */
903
+ /* */
904
+ /* */
905
+ /* */
906
+ /* */
907
+ /* */
908
+ /* */
909
+ /* */
910
+ /* */
911
+ /* */
912
+ /* */
913
+ /* */
914
+ return (void 0);
915
+ }
916
+ static unload(project) {
917
+ Project.projects = Project.projects.filter(f => f !== project);
918
+ }
919
+ static From(locationOfProj) {
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
+ /* */
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
+ /* */
1018
+ /* */
1019
+ /* */
1020
+ /* */
1021
+ /* */
1022
+ /* */
1023
+ /* */
1024
+ /* */
1025
+ /* */
1026
+ /* */
1027
+ /* */
1028
+ /* */
1029
+ /* */
1030
+ /* */
1031
+ /* */
1032
+ /* */
1033
+ /* */
1034
+ /* */
1035
+ /* */
1036
+ /* */
1037
+ return (void 0);
1038
+ }
1039
+ static nearestTo(absoluteLocation, options) {
1040
+ /* */
1041
+ /* */
1042
+ /* */
1043
+ /* */
1044
+ /* */
1045
+ /* */
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
+ /* */
1077
+ /* */
1078
+ /* */
1079
+ /* */
1080
+ /* */
1081
+ /* */
1082
+ /* */
1083
+ /* */
1084
+ /* */
1085
+ /* */
1086
+ /* */
1087
+ /* */
1088
+ /* */
1089
+ /* */
1090
+ /* */
1091
+ /* */
1092
+ /* */
1093
+ /* */
1094
+ /* */
1095
+ /* */
1096
+ /* */
1097
+ /* */
1098
+ return (void 0);
1099
+ }
1100
+ static allProjectFrom(absoluteLocation, stopOnCwd = '/') {
1101
+ /* */
1102
+ /* */
1103
+ /* */
1104
+ /* */
1105
+ /* */
1106
+ /* */
1107
+ /* */
1108
+ /* */
1109
+ /* */
1110
+ /* */
1111
+ /* */
1112
+ /* */
1113
+ /* */
1114
+ /* */
1115
+ /* */
1116
+ /* */
1117
+ /* */
1118
+ /* */
1119
+ /* */
1120
+ /* */
1121
+ /* */
1122
+ /* */
1123
+ return (void 0);
1124
+ }
1125
+ static DefaultPortByType(type) {
1126
+ if (type === 'workspace') {
1127
+ return 5000;
1128
+ }
1129
+ if (type === 'angular-client') {
1130
+ return 4300;
1131
+ }
1132
+ if (type === 'angular-lib') {
1133
+ return 4250;
1134
+ }
1135
+ if (type === 'electron-client') {
1136
+ return 4350;
1137
+ }
1138
+ if (type === 'ionic-client') {
1139
+ return 8080;
1140
+ }
1141
+ if (type === 'docker') {
1142
+ return 5000;
1143
+ }
1144
+ if (type === 'isomorphic-lib') {
1145
+ return 4000;
1146
+ }
1147
+ if (type === 'container' || type === 'unknow-npm-project') {
1148
+ return;
1149
+ }
1150
+ }
1151
+ static get isBundleMode() {
1152
+ if (Helpers$1.isBrowser) {
1153
+ return true;
1154
+ }
1155
+ /* */
1156
+ /* */
1157
+ }
1158
+ static get Current() {
1159
+ /* */
1160
+ /* */
1161
+ /* */
1162
+ /* */
1163
+ /* */
1164
+ /* */
1165
+ /* */
1166
+ /* */
1167
+ /* */
1168
+ /* */
1169
+ /* */
1170
+ return (void 0);
1171
+ }
1172
+ /**
1173
+ * @deprecated
1174
+ */
1175
+ static get Tnp() {
1176
+ /* */
1177
+ /* */
1178
+ /* */
1179
+ /* */
1180
+ /* */
1181
+ /* */
1182
+ /* */
1183
+ return (void 0);
1184
+ }
1185
+ static by(libraryType, version
1186
+ /* */
1187
+ /* */
1188
+ ) {
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
+ return (void 0);
1217
+ }
1218
+ defineProperty(variableName, classFn) {
1219
+ /* */
1220
+ /* */
1221
+ /* */
1222
+ /* */
1223
+ /* */
1224
+ /* */
1225
+ /* */
1226
+ /* */
1227
+ /* */
1228
+ /* */
1229
+ /* */
1230
+ /* */
1231
+ /* */
1232
+ /* */
1233
+ /* */
1234
+ /* */
1235
+ /* */
1236
+ /* */
1237
+ /* */
1238
+ /* */
1239
+ /* */
1240
+ /* */
1241
+ /* */
1242
+ /* */
1243
+ return (void 0);
1244
+ }
1245
+ setType(type) {
1246
+ // @ts-ignore
1247
+ this._type = type;
1248
+ }
1249
+ typeIs(...types) {
1250
+ return this._type && types.includes(this._type);
1251
+ }
1252
+ typeIsNot(...types) {
1253
+ return !this.typeIs(...types);
1254
+ }
1255
+ forEmptyStructure() {
1256
+ /* */
1257
+ /* */
1258
+ /* */
1259
+ /* */
1260
+ /* */
1261
+ return (void 0);
1262
+ }
1263
+ }
1264
+ Project.projects = [];
1265
+ /**
1266
+ * To speed up checking folder I am keeping pathes for alterdy checked folder
1267
+ * This may break things that are creating new projects
1268
+ */
1269
+ Project.emptyLocations = [];
1270
+ /* */
1271
+ /* */
1272
+ /* */
1273
+ /* */
1274
+ /* */
1275
+ /* */
1276
+ /* */
1277
+ /* */
1278
+ /* */
1279
+ /* */
1280
+ /* */
1281
+ /* */
1282
+ /* */
1283
+ /* */
1284
+ /* */
1285
+ /* */
1286
+ /* */
1287
+ /* */
1288
+ /* */
1289
+ /* */
1290
+ /* */
1291
+ /* */
1292
+ /* */
1293
+ /* */
1294
+ /* */
1295
+ /* */
1296
+ /* */
1297
+ /* */
1298
+ /* */
1299
+ /* */
1300
+ /* */
1301
+ /* */
1302
+ /* */
1303
+ /* */
1304
+ /* */
1305
+ /* */
1306
+ /* */
1307
+ /* */
1308
+ /* */
1309
+ /* */
1310
+ /* */
1311
+ /* */
1312
+ /* */
1313
+ /* */
1314
+ ;
1314
1315
  ({}); // @--end-of-file-for-module=tnp-helpers lib/project.ts
1315
1316
 
1316
- ;
1317
+ ;
1317
1318
  ({}); // @--end-of-file-for-module=tnp-helpers lib/firedev-models.ts
1318
1319
 
1319
- class BaseComponent {
1320
- constructor() {
1321
- // @ts-ignore
1322
- this.model = {};
1323
- this.handlers = [];
1324
- }
1325
- ngOnDestroy() {
1326
- this.handlers.forEach(h => h.unsubscribe());
1327
- this.handlers.length = 0;
1328
- }
1329
- }
1330
- BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1331
- 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 });
1332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, decorators: [{
1333
- type: Component,
1334
- args: [{
1335
- selector: 'app-base-component-meta',
1336
- template: '<div></div>'
1337
- }]
1338
- }], propDecorators: { model: [{
1339
- type: Input
1340
- }] } });
1341
- const isCalledNgInitAfterInternalRefresh = Symbol();
1342
- class BaseComponentForRouter extends BaseComponent {
1343
- constructor(__router) {
1344
- super();
1345
- this.__router = __router;
1346
- this[isCalledNgInitAfterInternalRefresh] = false;
1347
- }
1348
- isCalledNgInitAfterInternalRefresh() {
1349
- return !!this[isCalledNgInitAfterInternalRefresh];
1350
- }
1351
- reloadNgOninitOnUrlChange() {
1352
- this.handlers.push(this.__router.events.subscribe(event => {
1353
- if (event instanceof NavigationEnd && this['ngOnInit']) {
1354
- this[isCalledNgInitAfterInternalRefresh] = true;
1355
- this['ngOnInit']();
1356
- if (this[isCalledNgInitAfterInternalRefresh]) {
1357
- this[isCalledNgInitAfterInternalRefresh] = false;
1358
- }
1359
- }
1360
- }));
1361
- }
1362
- }
1363
- ;
1320
+ class BaseComponent {
1321
+ constructor() {
1322
+ // @ts-ignore
1323
+ this.model = {};
1324
+ this.handlers = [];
1325
+ }
1326
+ ngOnDestroy() {
1327
+ this.handlers.forEach(h => h.unsubscribe());
1328
+ this.handlers.length = 0;
1329
+ }
1330
+ }
1331
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1332
+ 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 });
1333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseComponent, decorators: [{
1334
+ type: Component,
1335
+ args: [{
1336
+ selector: 'app-base-component-meta',
1337
+ template: '<div></div>'
1338
+ }]
1339
+ }], propDecorators: { model: [{
1340
+ type: Input
1341
+ }] } });
1342
+ const isCalledNgInitAfterInternalRefresh = Symbol();
1343
+ class BaseComponentForRouter extends BaseComponent {
1344
+ constructor(__router) {
1345
+ super();
1346
+ this.__router = __router;
1347
+ this[isCalledNgInitAfterInternalRefresh] = false;
1348
+ }
1349
+ isCalledNgInitAfterInternalRefresh() {
1350
+ return !!this[isCalledNgInitAfterInternalRefresh];
1351
+ }
1352
+ reloadNgOninitOnUrlChange() {
1353
+ this.handlers.push(this.__router.events.subscribe(event => {
1354
+ if (event instanceof NavigationEnd && this['ngOnInit']) {
1355
+ this[isCalledNgInitAfterInternalRefresh] = true;
1356
+ this['ngOnInit']();
1357
+ if (this[isCalledNgInitAfterInternalRefresh]) {
1358
+ this[isCalledNgInitAfterInternalRefresh] = false;
1359
+ }
1360
+ }
1361
+ }));
1362
+ }
1363
+ }
1364
+ ;
1364
1365
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base-component.ts
1365
1366
 
1366
- const log$2 = Log.create(`DualComponentController`);
1367
- class DualComponentController {
1368
- constructor(cmp, isFormlyMode = false) {
1369
- this.cmp = cmp;
1370
- this.isFormlyMode = isFormlyMode;
1371
- }
1372
- getValTemplateOptions(propertyName) {
1373
- if (this.isFormlyMode) {
1374
- const res = this.cmp.field?.templateOptions[propertyName];
1375
- if (res === void 0 && this.cmp[propertyName]) {
1376
- return this.cmp[propertyName];
1377
- }
1378
- return res;
1379
- }
1380
- return this.cmp[propertyName];
1381
- }
1382
- getValContext(propertyName) {
1383
- if (this.isFormlyMode) {
1384
- const res = this.cmp?.field[propertyName];
1385
- if (res === void 0 && this.cmp[propertyName]) {
1386
- return this.cmp[propertyName];
1387
- }
1388
- return res;
1389
- }
1390
- return this.cmp[propertyName];
1391
- }
1392
- get disabled() {
1393
- return this.getValTemplateOptions('disabled');
1394
- }
1395
- get required() {
1396
- return this.getValTemplateOptions('required');
1397
- }
1398
- get type() {
1399
- if (!this.isFormlyMode) {
1400
- return CLASS.getNameFromObject(this.cmp);
1401
- }
1402
- return this.getValContext('type');
1403
- }
1404
- get label() {
1405
- return this.getValTemplateOptions('label');
1406
- }
1407
- get placeholder() {
1408
- return this.getValTemplateOptions('placeholder');
1409
- }
1410
- get defaultValue() {
1411
- return this.getValContext('defaultValue');
1412
- }
1413
- get formControl() {
1414
- return this.getValContext('formControl');
1415
- }
1416
- get key() {
1417
- return this.getValContext('key');
1418
- }
1419
- get path() {
1420
- return this.getValContext('path');
1421
- }
1422
- get model() {
1423
- if (this.isFormlyMode) {
1424
- return this.getValContext('model');
1425
- }
1426
- else {
1427
- return this.__model;
1428
- }
1429
- }
1430
- set model(v) {
1431
- if (this.isFormlyMode) {
1432
- log$2.w(`[DualComponentController] You can't set model in formly component mode`);
1433
- }
1434
- else {
1435
- this.__model = v;
1436
- }
1437
- }
1438
- get mode() {
1439
- if (this.isFormlyMode) {
1440
- return this.getValContext('mode');
1441
- }
1442
- else {
1443
- return this.__mode;
1444
- }
1445
- }
1446
- set mode(v) {
1447
- if (this.isFormlyMode) {
1448
- }
1449
- else {
1450
- this.__mode = v;
1451
- }
1452
- }
1453
- get value() {
1454
- if (this.isFormlyMode) {
1455
- return this.cmp.field.formControl.value;
1456
- }
1457
- if (_.isString(this.path)) {
1458
- return _.get(this.cmp.model, this.path);
1459
- }
1460
- return this.cmp.model;
1461
- }
1462
- set value(v) {
1463
- if (this.isFormlyMode) {
1464
- this.cmp.field.formControl.setValue(v);
1465
- // @ts-ignore
1466
- this.cmp.change.next(v);
1467
- return;
1468
- }
1469
- if (_.isString(this.path)) {
1470
- _.set(this.cmp.model, this.path, v);
1471
- }
1472
- else {
1473
- this.cmp.model = v;
1474
- }
1475
- }
1476
- }
1477
- ;
1367
+ const log$2 = Log.create(`DualComponentController`);
1368
+ class DualComponentController {
1369
+ constructor(cmp, isFormlyMode = false) {
1370
+ this.cmp = cmp;
1371
+ this.isFormlyMode = isFormlyMode;
1372
+ }
1373
+ getValTemplateOptions(propertyName) {
1374
+ if (this.isFormlyMode) {
1375
+ const res = this.cmp.field?.templateOptions[propertyName];
1376
+ if (res === void 0 && this.cmp[propertyName]) {
1377
+ return this.cmp[propertyName];
1378
+ }
1379
+ return res;
1380
+ }
1381
+ return this.cmp[propertyName];
1382
+ }
1383
+ getValContext(propertyName) {
1384
+ if (this.isFormlyMode) {
1385
+ const res = this.cmp?.field[propertyName];
1386
+ if (res === void 0 && this.cmp[propertyName]) {
1387
+ return this.cmp[propertyName];
1388
+ }
1389
+ return res;
1390
+ }
1391
+ return this.cmp[propertyName];
1392
+ }
1393
+ get disabled() {
1394
+ return this.getValTemplateOptions('disabled');
1395
+ }
1396
+ get required() {
1397
+ return this.getValTemplateOptions('required');
1398
+ }
1399
+ get type() {
1400
+ if (!this.isFormlyMode) {
1401
+ return CLASS.getNameFromObject(this.cmp);
1402
+ }
1403
+ return this.getValContext('type');
1404
+ }
1405
+ get label() {
1406
+ return this.getValTemplateOptions('label');
1407
+ }
1408
+ get placeholder() {
1409
+ return this.getValTemplateOptions('placeholder');
1410
+ }
1411
+ get defaultValue() {
1412
+ return this.getValContext('defaultValue');
1413
+ }
1414
+ get formControl() {
1415
+ return this.getValContext('formControl');
1416
+ }
1417
+ get key() {
1418
+ return this.getValContext('key');
1419
+ }
1420
+ get path() {
1421
+ return this.getValContext('path');
1422
+ }
1423
+ get model() {
1424
+ if (this.isFormlyMode) {
1425
+ return this.getValContext('model');
1426
+ }
1427
+ else {
1428
+ return this.__model;
1429
+ }
1430
+ }
1431
+ set model(v) {
1432
+ if (this.isFormlyMode) {
1433
+ log$2.w(`[DualComponentController] You can't set model in formly component mode`);
1434
+ }
1435
+ else {
1436
+ this.__model = v;
1437
+ }
1438
+ }
1439
+ get mode() {
1440
+ if (this.isFormlyMode) {
1441
+ return this.getValContext('mode');
1442
+ }
1443
+ else {
1444
+ return this.__mode;
1445
+ }
1446
+ }
1447
+ set mode(v) {
1448
+ if (this.isFormlyMode) {
1449
+ }
1450
+ else {
1451
+ this.__mode = v;
1452
+ }
1453
+ }
1454
+ get value() {
1455
+ if (this.isFormlyMode) {
1456
+ return this.cmp.field.formControl.value;
1457
+ }
1458
+ if (_.isString(this.path)) {
1459
+ return _.get(this.cmp.model, this.path);
1460
+ }
1461
+ return this.cmp.model;
1462
+ }
1463
+ set value(v) {
1464
+ if (this.isFormlyMode) {
1465
+ this.cmp.field.formControl.setValue(v);
1466
+ // @ts-ignore
1467
+ this.cmp.change.next(v);
1468
+ return;
1469
+ }
1470
+ if (_.isString(this.path)) {
1471
+ _.set(this.cmp.model, this.path, v);
1472
+ }
1473
+ else {
1474
+ this.cmp.model = v;
1475
+ }
1476
+ }
1477
+ }
1478
+ ;
1478
1479
  ({}); // @--end-of-file-for-module=tnp-helpers lib/dual-component-ctrl.ts
1479
1480
 
1480
- const log$1 = Log.create('base formly component', Level.__NOTHING);
1481
- class BaseFormlyComponent extends FieldType {
1482
- constructor() {
1483
- super(...arguments);
1484
- this.DualComponentController = DualComponentController;
1485
- this.ctrl = {};
1486
- this.change = new EventEmitter();
1487
- // @ts-ignore
1488
- this.handlers = [];
1489
- this.__field = {
1490
- templateOptions: {}
1491
- };
1492
- }
1493
- // @ts-ignore
1494
- get mode() {
1495
- return this.ctrl.mode;
1496
- }
1497
- // @ts-ignore
1498
- set mode(v) {
1499
- this.ctrl.mode = v;
1500
- }
1501
- // @ts-ignore
1502
- set model(v) {
1503
- this.ctrl.model = v;
1504
- }
1505
- get model() {
1506
- return this.ctrl.model;
1507
- }
1508
- // @ts-ignore
1509
- set key(value) {
1510
- if (this.ctrl && this.ctrl.isFormlyMode) {
1511
- return;
1512
- }
1513
- this.path = value;
1514
- }
1515
- get key() {
1516
- if (this.ctrl && this.ctrl.isFormlyMode) {
1517
- return this.field.key;
1518
- }
1519
- return this.path;
1520
- }
1521
- ngOnDestroy() {
1522
- this.handlers.forEach(h => h.unsubscribe());
1523
- this.handlers.length = 0;
1524
- }
1525
- ngAfterViewInit() {
1526
- }
1527
- ngOnInit() {
1528
- const isFormlyMode = !!this.field;
1529
- log$1.i(`isFormlyMode: ${isFormlyMode}`);
1530
- if (!isFormlyMode) {
1531
- const that = this;
1532
- Object.defineProperty(this, 'field', {
1533
- get: function () {
1534
- return that.__field;
1535
- },
1536
- set: function (v) {
1537
- that.__field = v;
1538
- }
1539
- });
1540
- }
1541
- const existed = this.ctrl;
1542
- this.ctrl = new this.DualComponentController(this, isFormlyMode);
1543
- // @ts-ignore
1544
- Object.keys(existed).forEach(key => {
1545
- this.ctrl[key] = existed[key];
1546
- });
1547
- // @ts-ignore
1548
- this.change.next(this.ctrl.value);
1549
- }
1550
- }
1551
- BaseFormlyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1552
- 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 });
1553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, decorators: [{
1554
- type: Component,
1555
- args: [{
1556
- selector: 'app-base-formly-component-meta',
1557
- template: `<div></div>`
1558
- }]
1559
- }], propDecorators: { pizda: [{
1560
- type: Input
1561
- }], mode: [{
1562
- type: Input
1563
- }], disabled: [{
1564
- type: Input
1565
- }], required: [{
1566
- type: Input
1567
- }], label: [{
1568
- type: Input
1569
- }], placeholder: [{
1570
- type: Input
1571
- }], defaultValue: [{
1572
- type: Input
1573
- }], model: [{
1574
- type: Input
1575
- }], path: [{
1576
- type: Input
1577
- }], change: [{
1578
- type: Output
1579
- }], key: [{
1580
- type: Input
1581
- }] } });
1582
- ;
1481
+ const log$1 = Log.create('base formly component', Level.__NOTHING);
1482
+ class BaseFormlyComponent extends FieldType {
1483
+ constructor() {
1484
+ super(...arguments);
1485
+ this.DualComponentController = DualComponentController;
1486
+ this.ctrl = {};
1487
+ this.change = new EventEmitter();
1488
+ // @ts-ignore
1489
+ this.handlers = [];
1490
+ this.__field = {
1491
+ templateOptions: {}
1492
+ };
1493
+ }
1494
+ // @ts-ignore
1495
+ get mode() {
1496
+ return this.ctrl.mode;
1497
+ }
1498
+ // @ts-ignore
1499
+ set mode(v) {
1500
+ this.ctrl.mode = v;
1501
+ }
1502
+ // @ts-ignore
1503
+ set model(v) {
1504
+ this.ctrl.model = v;
1505
+ }
1506
+ get model() {
1507
+ return this.ctrl.model;
1508
+ }
1509
+ // @ts-ignore
1510
+ set key(value) {
1511
+ if (this.ctrl && this.ctrl.isFormlyMode) {
1512
+ return;
1513
+ }
1514
+ this.path = value;
1515
+ }
1516
+ get key() {
1517
+ if (this.ctrl && this.ctrl.isFormlyMode) {
1518
+ return this.field.key;
1519
+ }
1520
+ return this.path;
1521
+ }
1522
+ ngOnDestroy() {
1523
+ this.handlers.forEach(h => h.unsubscribe());
1524
+ this.handlers.length = 0;
1525
+ }
1526
+ ngAfterViewInit() {
1527
+ }
1528
+ ngOnInit() {
1529
+ const isFormlyMode = !!this.field;
1530
+ log$1.i(`isFormlyMode: ${isFormlyMode}`);
1531
+ if (!isFormlyMode) {
1532
+ const that = this;
1533
+ Object.defineProperty(this, 'field', {
1534
+ get: function () {
1535
+ return that.__field;
1536
+ },
1537
+ set: function (v) {
1538
+ that.__field = v;
1539
+ }
1540
+ });
1541
+ }
1542
+ const existed = this.ctrl;
1543
+ this.ctrl = new this.DualComponentController(this, isFormlyMode);
1544
+ // @ts-ignore
1545
+ Object.keys(existed).forEach(key => {
1546
+ this.ctrl[key] = existed[key];
1547
+ });
1548
+ // @ts-ignore
1549
+ this.change.next(this.ctrl.value);
1550
+ }
1551
+ }
1552
+ BaseFormlyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1553
+ 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 });
1554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: BaseFormlyComponent, decorators: [{
1555
+ type: Component,
1556
+ args: [{
1557
+ selector: 'app-base-formly-component-meta',
1558
+ template: `<div></div>`
1559
+ }]
1560
+ }], propDecorators: { pizda: [{
1561
+ type: Input
1562
+ }], mode: [{
1563
+ type: Input
1564
+ }], disabled: [{
1565
+ type: Input
1566
+ }], required: [{
1567
+ type: Input
1568
+ }], label: [{
1569
+ type: Input
1570
+ }], placeholder: [{
1571
+ type: Input
1572
+ }], defaultValue: [{
1573
+ type: Input
1574
+ }], model: [{
1575
+ type: Input
1576
+ }], path: [{
1577
+ type: Input
1578
+ }], change: [{
1579
+ type: Output
1580
+ }], key: [{
1581
+ type: Input
1582
+ }] } });
1583
+ ;
1583
1584
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base-formly-component.ts
1584
1585
 
1585
- class ResizeService {
1586
- constructor() {
1587
- this.resizeDetector = elementResizeDetectorMaker({ strategy: 'scroll' });
1588
- }
1589
- addResizeEventListener(element, handler) {
1590
- this.resizeDetector.listenTo(element, handler);
1591
- }
1592
- removeResizeEventListener(element) {
1593
- this.resizeDetector.uninstall(element);
1594
- }
1595
- }
1596
- ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1597
- ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1598
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1599
- type: Injectable
1600
- }], ctorParameters: function () { return []; } });
1601
- ;
1586
+ class ResizeService {
1587
+ constructor() {
1588
+ this.resizeDetector = elementResizeDetectorMaker({ strategy: 'scroll' });
1589
+ }
1590
+ addResizeEventListener(element, handler) {
1591
+ this.resizeDetector.listenTo(element, handler);
1592
+ }
1593
+ removeResizeEventListener(element) {
1594
+ this.resizeDetector.uninstall(element);
1595
+ }
1596
+ }
1597
+ ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1598
+ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService });
1599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ResizeService, decorators: [{
1600
+ type: Injectable
1601
+ }], ctorParameters: function () { return []; } });
1602
+ ;
1602
1603
  ({}); // @--end-of-file-for-module=tnp-helpers lib/resize-service.ts
1603
1604
 
1604
- const log = Log.create(`[firedev-helpers] long-press`, Level.__NOTHING);
1605
- class LongPress {
1606
- constructor() {
1607
- this.pressDuration = 1000;
1608
- this.onLongPress = new EventEmitter();
1609
- this.onLongPressing = new EventEmitter();
1610
- this.onLongPressEnd = new EventEmitter();
1611
- this.mouseX = 0;
1612
- this.mouseY = 0;
1613
- this.allowTrigger = false;
1614
- this.triggerEnd = _.debounce(() => {
1615
- this.endPress();
1616
- }, 500);
1617
- }
1618
- get press() { return this.pressing; }
1619
- get longPress() { return this.longPressing; }
1620
- onMouseDown(event) {
1621
- log.d(`MOUSE DOWN `);
1622
- if (event.which !== 1)
1623
- return;
1624
- this.allowTrigger = true;
1625
- this.mouseX = event.clientX;
1626
- this.mouseY = event.clientY;
1627
- this.pressing = true;
1628
- this.longPressing = false;
1629
- this.timeout = setTimeout(() => {
1630
- if (this.allowTrigger) {
1631
- this.longPressing = true;
1632
- log.d(`long pressing start pressDuration:${this.pressDuration} `);
1633
- this.onLongPress.emit(event);
1634
- this.loop(event);
1635
- }
1636
- }, this.pressDuration);
1637
- this.loop(event);
1638
- }
1639
- onMouseMove(event) {
1640
- if (this.pressing && !this.longPressing) {
1641
- const xThres = (event.clientX - this.mouseX) > 10;
1642
- const yThres = (event.clientY - this.mouseY) > 10;
1643
- if (xThres || yThres) {
1644
- this.endPress();
1645
- }
1646
- }
1647
- }
1648
- loop(event) {
1649
- if (this.longPressing) {
1650
- this.timeout = setTimeout(() => {
1651
- log.d(`emil longpressing`);
1652
- this.triggerEnd();
1653
- this.onLongPressing.emit(event);
1654
- this.loop(event);
1655
- }, 50);
1656
- }
1657
- }
1658
- endPress(emit = true) {
1659
- this.allowTrigger = false;
1660
- clearTimeout(this.timeout);
1661
- this.longPressing = false;
1662
- this.pressing = false;
1663
- if (emit) {
1664
- log.d(`EMIT END`);
1665
- this.onLongPressEnd.emit(true);
1666
- }
1667
- else {
1668
- log.d(`NOT EMIT END`);
1669
- }
1670
- }
1671
- onMouseUp() {
1672
- this.endPress(false);
1673
- }
1674
- }
1675
- LongPress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1676
- 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 });
1677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, decorators: [{
1678
- type: Directive,
1679
- args: [{ selector: '[long-press]' }]
1680
- }], propDecorators: { pressDuration: [{
1681
- type: Input
1682
- }], onLongPress: [{
1683
- type: Output
1684
- }], onLongPressing: [{
1685
- type: Output
1686
- }], onLongPressEnd: [{
1687
- type: Output
1688
- }], press: [{
1689
- type: HostBinding,
1690
- args: ['class.press']
1691
- }], longPress: [{
1692
- type: HostBinding,
1693
- args: ['class.longpress']
1694
- }], onMouseDown: [{
1695
- type: HostListener,
1696
- args: ['mousedown', ['$event']]
1697
- }], onMouseMove: [{
1698
- type: HostListener,
1699
- args: ['mousemove', ['$event']]
1700
- }], onMouseUp: [{
1701
- type: HostListener,
1702
- args: ['mouseup']
1703
- }] } });
1704
- ;
1605
+ const log = Log.create(`[firedev-helpers] long-press`, Level.__NOTHING);
1606
+ class LongPress {
1607
+ constructor() {
1608
+ this.pressDuration = 1000;
1609
+ this.onLongPress = new EventEmitter();
1610
+ this.onLongPressing = new EventEmitter();
1611
+ this.onLongPressEnd = new EventEmitter();
1612
+ this.mouseX = 0;
1613
+ this.mouseY = 0;
1614
+ this.allowTrigger = false;
1615
+ this.triggerEnd = _.debounce(() => {
1616
+ this.endPress();
1617
+ }, 500);
1618
+ }
1619
+ get press() { return this.pressing; }
1620
+ get longPress() { return this.longPressing; }
1621
+ onMouseDown(event) {
1622
+ log.d(`MOUSE DOWN `);
1623
+ if (event.which !== 1)
1624
+ return;
1625
+ this.allowTrigger = true;
1626
+ this.mouseX = event.clientX;
1627
+ this.mouseY = event.clientY;
1628
+ this.pressing = true;
1629
+ this.longPressing = false;
1630
+ this.timeout = setTimeout(() => {
1631
+ if (this.allowTrigger) {
1632
+ this.longPressing = true;
1633
+ log.d(`long pressing start pressDuration:${this.pressDuration} `);
1634
+ this.onLongPress.emit(event);
1635
+ this.loop(event);
1636
+ }
1637
+ }, this.pressDuration);
1638
+ this.loop(event);
1639
+ }
1640
+ onMouseMove(event) {
1641
+ if (this.pressing && !this.longPressing) {
1642
+ const xThres = (event.clientX - this.mouseX) > 10;
1643
+ const yThres = (event.clientY - this.mouseY) > 10;
1644
+ if (xThres || yThres) {
1645
+ this.endPress();
1646
+ }
1647
+ }
1648
+ }
1649
+ loop(event) {
1650
+ if (this.longPressing) {
1651
+ this.timeout = setTimeout(() => {
1652
+ log.d(`emil longpressing`);
1653
+ this.triggerEnd();
1654
+ this.onLongPressing.emit(event);
1655
+ this.loop(event);
1656
+ }, 50);
1657
+ }
1658
+ }
1659
+ endPress(emit = true) {
1660
+ this.allowTrigger = false;
1661
+ clearTimeout(this.timeout);
1662
+ this.longPressing = false;
1663
+ this.pressing = false;
1664
+ if (emit) {
1665
+ log.d(`EMIT END`);
1666
+ this.onLongPressEnd.emit(true);
1667
+ }
1668
+ else {
1669
+ log.d(`NOT EMIT END`);
1670
+ }
1671
+ }
1672
+ onMouseUp() {
1673
+ this.endPress(false);
1674
+ }
1675
+ }
1676
+ LongPress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1677
+ 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 });
1678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LongPress, decorators: [{
1679
+ type: Directive,
1680
+ args: [{ selector: '[long-press]' }]
1681
+ }], propDecorators: { pressDuration: [{
1682
+ type: Input
1683
+ }], onLongPress: [{
1684
+ type: Output
1685
+ }], onLongPressing: [{
1686
+ type: Output
1687
+ }], onLongPressEnd: [{
1688
+ type: Output
1689
+ }], press: [{
1690
+ type: HostBinding,
1691
+ args: ['class.press']
1692
+ }], longPress: [{
1693
+ type: HostBinding,
1694
+ args: ['class.longpress']
1695
+ }], onMouseDown: [{
1696
+ type: HostListener,
1697
+ args: ['mousedown', ['$event']]
1698
+ }], onMouseMove: [{
1699
+ type: HostListener,
1700
+ args: ['mousemove', ['$event']]
1701
+ }], onMouseUp: [{
1702
+ type: HostListener,
1703
+ args: ['mouseup']
1704
+ }] } });
1705
+ ;
1705
1706
  ({}); // @--end-of-file-for-module=tnp-helpers lib/long-press.directive.ts
1706
1707
 
1707
- /* */
1708
- /* */
1709
- const Helpers = HelpersTnp.Instance;
1710
- ;
1708
+ /* */
1709
+ /* */
1710
+ const Helpers = HelpersTnp.Instance;
1711
+ ;
1711
1712
  ({}); // @--end-of-file-for-module=tnp-helpers lib/index.ts
1712
1713
 
1713
- /**
1714
- * Generated bundle index. Do not edit.
1714
+ /**
1715
+ * Generated bundle index. Do not edit.
1715
1716
  */
1716
1717
 
1717
1718
  export { BaseComponent, BaseComponentForRouter, BaseFormlyComponent, BaselineSiteJoinprefix, DualComponentController, Helpers, LongPress, PREFIXES, Project, ResizeService, SerializedSubject };