tnp-helpers 13.1.15 → 13.1.16

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