tnp-helpers 0.0.67 → 13.0.2

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 (307) hide show
  1. package/app.js +2 -1
  2. package/browser/README.md +24 -0
  3. package/browser/esm2020/lib/base-component.mjs +48 -0
  4. package/browser/esm2020/lib/base-formly-component.mjs +123 -0
  5. package/browser/esm2020/lib/condition-wait.mjs +54 -0
  6. package/browser/esm2020/lib/constants.mjs +2 -0
  7. package/browser/esm2020/lib/dual-component-ctrl.mjs +116 -0
  8. package/browser/esm2020/lib/helpers-array-obj.mjs +81 -0
  9. package/browser/esm2020/lib/helpers-environment.mjs +21 -0
  10. package/browser/esm2020/lib/helpers-messages.mjs +68 -0
  11. package/browser/esm2020/lib/helpers-strings-regexes.mjs +49 -0
  12. package/browser/esm2020/lib/helpers-strings.mjs +61 -0
  13. package/browser/esm2020/lib/helpers.mjs +108 -0
  14. package/browser/esm2020/lib/index.mjs +11 -0
  15. package/browser/esm2020/lib/long-press.directive.mjs +106 -0
  16. package/browser/esm2020/lib/project.mjs +90 -0
  17. package/browser/esm2020/lib/resize-service.mjs +20 -0
  18. package/browser/esm2020/public-api.mjs +2 -0
  19. package/browser/esm2020/tnp-helpers.mjs +5 -0
  20. package/browser/fesm2015/tnp-helpers.mjs +936 -0
  21. package/browser/fesm2015/tnp-helpers.mjs.map +1 -0
  22. package/browser/fesm2020/tnp-helpers.mjs +927 -0
  23. package/browser/fesm2020/tnp-helpers.mjs.map +1 -0
  24. package/browser/{base-component.d.ts → lib/base-component.d.ts} +3 -0
  25. package/browser/{base-formly-component.d.ts → lib/base-formly-component.d.ts} +4 -1
  26. package/browser/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
  27. package/browser/{constants.d.ts → lib/constants.d.ts} +0 -0
  28. package/browser/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +0 -0
  29. package/{helpers-array-obj.d.ts → browser/lib/helpers-array-obj.d.ts} +1 -0
  30. package/browser/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
  31. package/browser/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
  32. package/browser/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
  33. package/browser/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
  34. package/browser/{helpers.d.ts → lib/helpers.d.ts} +1 -2
  35. package/{client → browser/lib}/index.d.ts +1 -1
  36. package/{client → browser/lib}/long-press.directive.d.ts +3 -0
  37. package/browser/{project.d.ts → lib/project.d.ts} +0 -0
  38. package/{client → browser/lib}/resize-service.d.ts +3 -0
  39. package/browser/package.json +31 -0
  40. package/browser/public-api.d.ts +1 -0
  41. package/browser/tnp-helpers.d.ts +5 -0
  42. package/client/README.md +24 -0
  43. package/client/esm2020/lib/base-component.mjs +48 -0
  44. package/client/esm2020/lib/base-formly-component.mjs +123 -0
  45. package/client/esm2020/lib/condition-wait.mjs +54 -0
  46. package/client/esm2020/lib/constants.mjs +2 -0
  47. package/client/esm2020/lib/dual-component-ctrl.mjs +116 -0
  48. package/client/esm2020/lib/helpers-array-obj.mjs +81 -0
  49. package/client/esm2020/lib/helpers-environment.mjs +21 -0
  50. package/client/esm2020/lib/helpers-messages.mjs +68 -0
  51. package/client/esm2020/lib/helpers-strings-regexes.mjs +49 -0
  52. package/client/esm2020/lib/helpers-strings.mjs +61 -0
  53. package/client/esm2020/lib/helpers.mjs +108 -0
  54. package/client/esm2020/lib/index.mjs +11 -0
  55. package/client/esm2020/lib/long-press.directive.mjs +106 -0
  56. package/client/esm2020/lib/project.mjs +90 -0
  57. package/client/esm2020/lib/resize-service.mjs +20 -0
  58. package/client/esm2020/public-api.mjs +2 -0
  59. package/client/esm2020/tnp-helpers.mjs +5 -0
  60. package/client/fesm2015/tnp-helpers.mjs +936 -0
  61. package/client/fesm2015/tnp-helpers.mjs.map +1 -0
  62. package/client/fesm2020/tnp-helpers.mjs +927 -0
  63. package/client/fesm2020/tnp-helpers.mjs.map +1 -0
  64. package/client/{base-component.d.ts → lib/base-component.d.ts} +3 -0
  65. package/{base-formly-component.d.ts → client/lib/base-formly-component.d.ts} +4 -1
  66. package/client/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
  67. package/client/{constants.d.ts → lib/constants.d.ts} +0 -0
  68. package/client/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +0 -0
  69. package/client/{helpers-array-obj.d.ts → lib/helpers-array-obj.d.ts} +1 -0
  70. package/client/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
  71. package/client/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
  72. package/client/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
  73. package/client/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
  74. package/client/{helpers.d.ts → lib/helpers.d.ts} +1 -2
  75. package/{browser → client/lib}/index.d.ts +1 -1
  76. package/{browser → client/lib}/long-press.directive.d.ts +3 -0
  77. package/client/{project.d.ts → lib/project.d.ts} +0 -0
  78. package/{resize-service.d.ts → client/lib/resize-service.d.ts} +3 -0
  79. package/client/package.json +25 -19
  80. package/client/public-api.d.ts +1 -0
  81. package/client/tnp-helpers.d.ts +5 -0
  82. package/index.d.ts +1 -11
  83. package/index.js +3 -21
  84. package/index.js.map +1 -1
  85. package/{base-component.d.ts → lib/base-component.d.ts} +0 -0
  86. package/{base-component.js → lib/base-component.js} +8 -7
  87. package/lib/base-component.js.map +1 -0
  88. package/{client → lib}/base-formly-component.d.ts +1 -1
  89. package/{base-formly-component.js → lib/base-formly-component.js} +45 -44
  90. package/lib/base-formly-component.js.map +1 -0
  91. package/{condition-wait.d.ts → lib/condition-wait.d.ts} +0 -0
  92. package/{condition-wait.js → lib/condition-wait.js} +10 -9
  93. package/lib/condition-wait.js.map +1 -0
  94. package/{constants.d.ts → lib/constants.d.ts} +0 -0
  95. package/{constants.js → lib/constants.js} +2 -1
  96. package/lib/constants.js.map +1 -0
  97. package/{dual-component-ctrl.d.ts → lib/dual-component-ctrl.d.ts} +0 -0
  98. package/{dual-component-ctrl.js → lib/dual-component-ctrl.js} +2 -1
  99. package/lib/dual-component-ctrl.js.map +1 -0
  100. package/{git-project.d.ts → lib/git-project.d.ts} +4 -3
  101. package/{git-project.js → lib/git-project.js} +20 -11
  102. package/lib/git-project.js.map +1 -0
  103. package/{browser → lib}/helpers-array-obj.d.ts +1 -0
  104. package/{helpers-array-obj.js → lib/helpers-array-obj.js} +8 -1
  105. package/lib/helpers-array-obj.js.map +1 -0
  106. package/{helpers-cli-tool.backend.d.ts → lib/helpers-cli-tool.backend.d.ts} +0 -0
  107. package/{helpers-cli-tool.backend.js → lib/helpers-cli-tool.backend.js} +5 -4
  108. package/lib/helpers-cli-tool.backend.js.map +1 -0
  109. package/{helpers-dependencies.backend.d.ts → lib/helpers-dependencies.backend.d.ts} +0 -0
  110. package/{helpers-dependencies.backend.js → lib/helpers-dependencies.backend.js} +6 -5
  111. package/lib/helpers-dependencies.backend.js.map +1 -0
  112. package/{helpers-environment.d.ts → lib/helpers-environment.d.ts} +0 -0
  113. package/{helpers-environment.js → lib/helpers-environment.js} +2 -1
  114. package/lib/helpers-environment.js.map +1 -0
  115. package/{helpers-file-folders.backend.d.ts → lib/helpers-file-folders.backend.d.ts} +1 -0
  116. package/{helpers-file-folders.backend.js → lib/helpers-file-folders.backend.js} +67 -47
  117. package/lib/helpers-file-folders.backend.js.map +1 -0
  118. package/{helpers-git.backend.d.ts → lib/helpers-git.backend.d.ts} +3 -1
  119. package/{helpers-git.backend.js → lib/helpers-git.backend.js} +90 -56
  120. package/lib/helpers-git.backend.js.map +1 -0
  121. package/{helpers-json5.backend.d.ts → lib/helpers-json5.backend.d.ts} +0 -0
  122. package/{helpers-json5.backend.js → lib/helpers-json5.backend.js} +3 -2
  123. package/lib/helpers-json5.backend.js.map +1 -0
  124. package/{helpers-messages.d.ts → lib/helpers-messages.d.ts} +0 -0
  125. package/{helpers-messages.js → lib/helpers-messages.js} +2 -1
  126. package/lib/helpers-messages.js.map +1 -0
  127. package/{helpers-morphi-framework.backend.d.ts → lib/helpers-morphi-framework.backend.d.ts} +0 -0
  128. package/{helpers-morphi-framework.backend.js → lib/helpers-morphi-framework.backend.js} +4 -3
  129. package/lib/helpers-morphi-framework.backend.js.map +1 -0
  130. package/{helpers-network.backend.d.ts → lib/helpers-network.backend.d.ts} +0 -0
  131. package/{helpers-network.backend.js → lib/helpers-network.backend.js} +2 -1
  132. package/lib/helpers-network.backend.js.map +1 -0
  133. package/{helpers-npm.backend.d.ts → lib/helpers-npm.backend.d.ts} +0 -0
  134. package/{helpers-npm.backend.js → lib/helpers-npm.backend.js} +2 -1
  135. package/lib/helpers-npm.backend.js.map +1 -0
  136. package/{helpers-path.backend.d.ts → lib/helpers-path.backend.d.ts} +0 -0
  137. package/{helpers-path.backend.js → lib/helpers-path.backend.js} +4 -3
  138. package/lib/helpers-path.backend.js.map +1 -0
  139. package/{helpers-process.backend.d.ts → lib/helpers-process.backend.d.ts} +2 -2
  140. package/{helpers-process.backend.js → lib/helpers-process.backend.js} +54 -53
  141. package/lib/helpers-process.backend.js.map +1 -0
  142. package/{helpers-strings-regexes.d.ts → lib/helpers-strings-regexes.d.ts} +0 -0
  143. package/{helpers-strings-regexes.js → lib/helpers-strings-regexes.js} +2 -1
  144. package/lib/helpers-strings-regexes.js.map +1 -0
  145. package/{helpers-strings.d.ts → lib/helpers-strings.d.ts} +0 -0
  146. package/{helpers-strings.js → lib/helpers-strings.js} +2 -1
  147. package/lib/helpers-strings.js.map +1 -0
  148. package/{helpers-system-terminal.backend.d.ts → lib/helpers-system-terminal.backend.d.ts} +1 -1
  149. package/{helpers-system-terminal.backend.js → lib/helpers-system-terminal.backend.js} +9 -8
  150. package/lib/helpers-system-terminal.backend.js.map +1 -0
  151. package/{helpers.d.ts → lib/helpers.d.ts} +5 -4
  152. package/{helpers.js → lib/helpers.js} +34 -28
  153. package/lib/helpers.js.map +1 -0
  154. package/{client/index.js → lib/index.d.ts} +3 -3
  155. package/lib/index.js +25 -0
  156. package/lib/index.js.map +1 -0
  157. package/{long-press.directive.d.ts → lib/long-press.directive.d.ts} +0 -0
  158. package/{long-press.directive.js → lib/long-press.directive.js} +40 -39
  159. package/lib/long-press.directive.js.map +1 -0
  160. package/{merge-helpers.backend.d.ts → lib/merge-helpers.backend.d.ts} +0 -0
  161. package/{merge-helpers.backend.js → lib/merge-helpers.backend.js} +7 -6
  162. package/lib/merge-helpers.backend.js.map +1 -0
  163. package/{project.d.ts → lib/project.d.ts} +0 -0
  164. package/{project.js → lib/project.js} +23 -21
  165. package/lib/project.js.map +1 -0
  166. package/{browser → lib}/resize-service.d.ts +0 -0
  167. package/{resize-service.js → lib/resize-service.js} +5 -4
  168. package/lib/resize-service.js.map +1 -0
  169. package/{ts-code-modifier → lib/ts-code}/index.d.ts +0 -0
  170. package/{ts-code-modifier → lib/ts-code}/index.js +3 -2
  171. package/lib/ts-code/index.js.map +1 -0
  172. package/lib/ts-code/ts-code-extractor.d.ts +14 -0
  173. package/lib/ts-code/ts-code-extractor.js +47 -0
  174. package/lib/ts-code/ts-code-extractor.js.map +1 -0
  175. package/{ts-code-modifier → lib/ts-code}/ts-code-modifier.backend.d.ts +0 -0
  176. package/{ts-code-modifier → lib/ts-code}/ts-code-modifier.backend.js +3 -2
  177. package/lib/ts-code/ts-code-modifier.backend.js.map +1 -0
  178. package/package.json +10 -18
  179. package/package.json_devDependencies.json +50 -50
  180. package/{package.json_tnp.json → package.json_tnp.json5} +12 -8
  181. package/tmp-environment.json +89 -126
  182. package/base-component.js.map +0 -1
  183. package/base-formly-component.js.map +0 -1
  184. package/browser/base-component.js +0 -48
  185. package/browser/base-component.js.map +0 -1
  186. package/browser/base-formly-component.js +0 -149
  187. package/browser/base-formly-component.js.map +0 -1
  188. package/browser/condition-wait.js +0 -57
  189. package/browser/condition-wait.js.map +0 -1
  190. package/browser/constants.js +0 -2
  191. package/browser/constants.js.map +0 -1
  192. package/browser/dual-component-ctrl.js +0 -118
  193. package/browser/dual-component-ctrl.js.map +0 -1
  194. package/browser/es5/base-component.js +0 -89
  195. package/browser/es5/base-formly-component.js +0 -158
  196. package/browser/es5/condition-wait.js +0 -135
  197. package/browser/es5/constants.js +0 -7
  198. package/browser/es5/dual-component-ctrl.js +0 -164
  199. package/browser/es5/git-project.js +0 -18
  200. package/browser/es5/helpers-array-obj.js +0 -129
  201. package/browser/es5/helpers-environment.js +0 -46
  202. package/browser/es5/helpers-messages.js +0 -105
  203. package/browser/es5/helpers-strings-regexes.js +0 -74
  204. package/browser/es5/helpers-strings.js +0 -96
  205. package/browser/es5/helpers.js +0 -217
  206. package/browser/es5/index.js +0 -86
  207. package/browser/es5/long-press.directive.js +0 -133
  208. package/browser/es5/project.js +0 -146
  209. package/browser/es5/resize-service.js +0 -45
  210. package/browser/git-project.d.ts +0 -2
  211. package/browser/git-project.js +0 -6
  212. package/browser/git-project.js.map +0 -1
  213. package/browser/helpers-array-obj.js +0 -75
  214. package/browser/helpers-array-obj.js.map +0 -1
  215. package/browser/helpers-environment.js +0 -21
  216. package/browser/helpers-environment.js.map +0 -1
  217. package/browser/helpers-messages.js +0 -68
  218. package/browser/helpers-messages.js.map +0 -1
  219. package/browser/helpers-strings-regexes.js +0 -49
  220. package/browser/helpers-strings-regexes.js.map +0 -1
  221. package/browser/helpers-strings.js +0 -61
  222. package/browser/helpers-strings.js.map +0 -1
  223. package/browser/helpers.js +0 -113
  224. package/browser/helpers.js.map +0 -1
  225. package/browser/index.js +0 -11
  226. package/browser/index.js.map +0 -1
  227. package/browser/long-press.directive.js +0 -125
  228. package/browser/long-press.directive.js.map +0 -1
  229. package/browser/project.js +0 -90
  230. package/browser/project.js.map +0 -1
  231. package/browser/resize-service.js +0 -20
  232. package/browser/resize-service.js.map +0 -1
  233. package/client/base-component.js +0 -48
  234. package/client/base-component.js.map +0 -1
  235. package/client/base-formly-component.js +0 -149
  236. package/client/base-formly-component.js.map +0 -1
  237. package/client/condition-wait.js +0 -57
  238. package/client/condition-wait.js.map +0 -1
  239. package/client/constants.js +0 -2
  240. package/client/constants.js.map +0 -1
  241. package/client/dual-component-ctrl.js +0 -118
  242. package/client/dual-component-ctrl.js.map +0 -1
  243. package/client/es5/base-component.js +0 -89
  244. package/client/es5/base-formly-component.js +0 -158
  245. package/client/es5/condition-wait.js +0 -135
  246. package/client/es5/constants.js +0 -7
  247. package/client/es5/dual-component-ctrl.js +0 -164
  248. package/client/es5/git-project.js +0 -18
  249. package/client/es5/helpers-array-obj.js +0 -129
  250. package/client/es5/helpers-environment.js +0 -46
  251. package/client/es5/helpers-messages.js +0 -105
  252. package/client/es5/helpers-strings-regexes.js +0 -74
  253. package/client/es5/helpers-strings.js +0 -96
  254. package/client/es5/helpers.js +0 -217
  255. package/client/es5/index.js +0 -86
  256. package/client/es5/long-press.directive.js +0 -133
  257. package/client/es5/project.js +0 -146
  258. package/client/es5/resize-service.js +0 -45
  259. package/client/git-project.d.ts +0 -2
  260. package/client/git-project.js +0 -6
  261. package/client/git-project.js.map +0 -1
  262. package/client/helpers-array-obj.js +0 -75
  263. package/client/helpers-array-obj.js.map +0 -1
  264. package/client/helpers-environment.js +0 -21
  265. package/client/helpers-environment.js.map +0 -1
  266. package/client/helpers-messages.js +0 -68
  267. package/client/helpers-messages.js.map +0 -1
  268. package/client/helpers-strings-regexes.js +0 -49
  269. package/client/helpers-strings-regexes.js.map +0 -1
  270. package/client/helpers-strings.js +0 -61
  271. package/client/helpers-strings.js.map +0 -1
  272. package/client/helpers.js +0 -113
  273. package/client/helpers.js.map +0 -1
  274. package/client/index.js.map +0 -1
  275. package/client/long-press.directive.js +0 -125
  276. package/client/long-press.directive.js.map +0 -1
  277. package/client/project.js +0 -90
  278. package/client/project.js.map +0 -1
  279. package/client/resize-service.js +0 -20
  280. package/client/resize-service.js.map +0 -1
  281. package/condition-wait.js.map +0 -1
  282. package/constants.js.map +0 -1
  283. package/dual-component-ctrl.js.map +0 -1
  284. package/git-project.js.map +0 -1
  285. package/helpers-array-obj.js.map +0 -1
  286. package/helpers-cli-tool.backend.js.map +0 -1
  287. package/helpers-dependencies.backend.js.map +0 -1
  288. package/helpers-environment.js.map +0 -1
  289. package/helpers-file-folders.backend.js.map +0 -1
  290. package/helpers-git.backend.js.map +0 -1
  291. package/helpers-json5.backend.js.map +0 -1
  292. package/helpers-messages.js.map +0 -1
  293. package/helpers-morphi-framework.backend.js.map +0 -1
  294. package/helpers-network.backend.js.map +0 -1
  295. package/helpers-npm.backend.js.map +0 -1
  296. package/helpers-path.backend.js.map +0 -1
  297. package/helpers-process.backend.js.map +0 -1
  298. package/helpers-strings-regexes.js.map +0 -1
  299. package/helpers-strings.js.map +0 -1
  300. package/helpers-system-terminal.backend.js.map +0 -1
  301. package/helpers.js.map +0 -1
  302. package/long-press.directive.js.map +0 -1
  303. package/merge-helpers.backend.js.map +0 -1
  304. package/project.js.map +0 -1
  305. package/resize-service.js.map +0 -1
  306. package/ts-code-modifier/index.js.map +0 -1
  307. package/ts-code-modifier/ts-code-modifier.backend.js.map +0 -1
@@ -0,0 +1,936 @@
1
+ import { __awaiter } from 'tslib';
2
+ import { _, CoreHelpers } from 'tnp-core/browser';
3
+ import * as fuzzy from 'fuzzy';
4
+ import { CLASS } from 'typescript-class-helpers/browser';
5
+ import { Morphi } from 'morphi/browser';
6
+ import { config } from 'tnp-config/browser';
7
+ import * as i0 from '@angular/core';
8
+ import { Component, Input, EventEmitter, Output, Injectable, Directive, HostBinding, HostListener } from '@angular/core';
9
+ import { NavigationEnd } from '@angular/router';
10
+ import { FieldType } from '@ngx-formly/core';
11
+ import { Log, Level } from 'ng2-logger/browser';
12
+ import * as elementResizeDetectorMaker from 'element-resize-detector';
13
+
14
+ class HelpersArrayObj {
15
+ from(s) {
16
+ if (_.isArray(s)) {
17
+ return s;
18
+ }
19
+ if (_.isString(s)) {
20
+ return s.split(' ');
21
+ }
22
+ }
23
+ second(arr) {
24
+ if (!Array.isArray(arr) || arr.length < 2) {
25
+ return void 0;
26
+ }
27
+ return arr[1];
28
+ }
29
+ arrayMoveElementBefore(arr, a, b, prop) {
30
+ let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
31
+ _.pullAt(arr, indexA);
32
+ let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
33
+ if (indexB === 0) {
34
+ arr.unshift(a);
35
+ }
36
+ else {
37
+ arr.splice(indexB - 1, 0, a);
38
+ }
39
+ return arr;
40
+ }
41
+ arrayMoveElementAfterB(arr, a, b, prop) {
42
+ let indexA = prop ? arr.findIndex(elem => elem[prop] === a[prop]) : arr.indexOf(a);
43
+ _.pullAt(arr, indexA);
44
+ let indexB = prop ? arr.findIndex(elem => elem[prop] === b[prop]) : arr.indexOf(b);
45
+ if (indexB === arr.length - 1) {
46
+ arr.push(a);
47
+ }
48
+ else {
49
+ arr.splice(indexB + 1, 0, a);
50
+ }
51
+ return arr;
52
+ }
53
+ uniqArray(array, uniqueProperty) {
54
+ var seen = {};
55
+ return array
56
+ .filter(f => !!f)
57
+ .filter(function (item) {
58
+ return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item) ? false
59
+ : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
60
+ });
61
+ }
62
+ sortKeys(obj) {
63
+ if (_.isArray(obj)) {
64
+ return obj.map(Helpers.arrays.sortKeys);
65
+ }
66
+ if (_.isObject(obj)) {
67
+ return _.fromPairs(_.keys(obj).sort().map(key => [key, Helpers.arrays.sortKeys(obj[key])]));
68
+ }
69
+ return obj;
70
+ }
71
+ ;
72
+ /**
73
+ * Fuzzy search
74
+ */
75
+ fuzzy(query, list, valueFn) {
76
+ const resultsFuzzy = fuzzy.filter(query, list.map(k => valueFn ? valueFn(k) : k));
77
+ const resultsFuzzyKebab = fuzzy.filter(_.kebabCase(query), list.map(k => _.kebabCase((valueFn ? valueFn(k) : k))));
78
+ const matches = resultsFuzzy.map((el) => el.string);
79
+ const matchesKebab = resultsFuzzyKebab.map((el) => el.string);
80
+ const results = (resultsFuzzy.length === 0) ? [] : list.filter(k => {
81
+ return matches.includes((valueFn ? valueFn(k) : k));
82
+ });
83
+ if (matches.length === 0 && matchesKebab.length > 0) {
84
+ const m = list.find(k => _.kebabCase((valueFn ? valueFn(k) : k)) === _.first(matchesKebab));
85
+ results.push(m);
86
+ matches.push((valueFn ? valueFn(m) : m));
87
+ }
88
+ return { matches, results };
89
+ }
90
+ }
91
+
92
+ const KEY = {
93
+ LAST_ERROR: Symbol(),
94
+ LAST_INFO: Symbol(),
95
+ LAST_WARN: Symbol(),
96
+ LAST_LOG: Symbol(),
97
+ };
98
+ // export class Log {
99
+ // private static _instance: Log;
100
+ // public Instance() {
101
+ // if (!Log._instance) {
102
+ // Log._instance = new Log();
103
+ // }
104
+ // return Log._instance;
105
+ // }
106
+ // create(name: string, level?: Level) {
107
+ // if (level === void 0) {
108
+ // level = Level.DATA;
109
+ // }
110
+ // return {
111
+ // d(details: string, debugLevel?: number) {
112
+ // return Helpers.log(`[${name}] ${details}`, debugLevel)
113
+ // },
114
+ // i(details: string) {
115
+ // return Helpers.info(`[${name}] ${details}`)
116
+ // },
117
+ // w(details: string, noExit = false, noTrace = false) {
118
+ // return Helpers.error(`[${name}] ${details}`, noExit, noTrace);
119
+ // },
120
+ // er(details: string, ) {
121
+ // return Helpers.info(`[${name}] ${details}`)
122
+ // },
123
+ // }
124
+ // }
125
+ // }
126
+ class HelpersMessages {
127
+ msgCacheClear() {
128
+ global[KEY.LAST_LOG] = void 0;
129
+ global[KEY.LAST_WARN] = void 0;
130
+ global[KEY.LAST_ERROR] = void 0;
131
+ global[KEY.LAST_INFO] = void 0;
132
+ }
133
+ error(details, noExit = false, noTrace = false) {
134
+ if (Helpers.isBrowser) {
135
+ console.error(details);
136
+ return;
137
+ }
138
+ }
139
+ info(details) {
140
+ if (Helpers.isBrowser) {
141
+ console.info(details);
142
+ return;
143
+ }
144
+ }
145
+ log(details, debugLevel = 0) {
146
+ if (Helpers.isBrowser) {
147
+ console.log(details);
148
+ return;
149
+ }
150
+ }
151
+ warn(details, trace = false) {
152
+ if (Helpers.isBrowser) {
153
+ console.warn(details);
154
+ return;
155
+ }
156
+ }
157
+ }
158
+
159
+ class HelpersStringsRegexes {
160
+ escapeStringForRegEx(s) {
161
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
162
+ }
163
+ matchExactOnce(s, regex) {
164
+ if (!_.isString(s) || !_.isRegExp(regex)) {
165
+ return void 0;
166
+ }
167
+ const result = s.match(regex);
168
+ if (_.isNil(result)) {
169
+ return void 0;
170
+ }
171
+ return result.length >= 1 ? _.first(result) : void 0;
172
+ }
173
+ get regex() {
174
+ return {
175
+ /**
176
+ * mathes
177
+ * xxx.xxx.xxx.xxx
178
+ * xxx.xxx.xxx.xxx:port
179
+ * http://xxx.xxx.xxx.xxx:port
180
+ * http://xxx.xxx.xxx.xxx
181
+ * https://xxx.xxx.xxx.xxx:port
182
+ * https://xxx.xxx.xxx.xxx *
183
+ */
184
+ get forStringWithIpHost() {
185
+ 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]+)?/;
186
+ return regex;
187
+ },
188
+ /**
189
+ * mathes
190
+ * http://domain.com:port
191
+ * http://domain.com
192
+ * http://domain:port
193
+ * http://domain
194
+ * https://domain.com:port
195
+ * https://domain.com
196
+ * https://domain:port
197
+ * https://domain
198
+ */
199
+ get forStringWithDomainHost() {
200
+ 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}))/;
201
+ return regex;
202
+ }
203
+ };
204
+ }
205
+ }
206
+
207
+ class HelpersEnvironment {
208
+ environmentName(filename, local_env_name) {
209
+ }
210
+ isValidGitRepuUrl(url) {
211
+ const regex = /^([A-Za-z0-9]+@|http(|s)\:\/\/)([A-Za-z0-9.]+(:\d+)?)(?::|\/)([\d\/\w.-]+?)(\.git)?$/;
212
+ const res = regex.test(url);
213
+ return res;
214
+ }
215
+ isValidIp(ip) {
216
+ if (!_.isString(ip)) {
217
+ return false;
218
+ }
219
+ ip = ip.trim();
220
+ if (ip === 'localhost') {
221
+ return true;
222
+ }
223
+ 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);
224
+ }
225
+ }
226
+
227
+ class HelpersStrings {
228
+ /**
229
+ * Example:
230
+ *
231
+ * const result = interpolateString("I'm {age} years old!")
232
+ * .withParameters({ age: 29 });
233
+ *
234
+ * const result = interpolateString("The {a} says {n}, {n}, {n}!")
235
+ * .withParameters({ a: 'cow', n: 'moo' });
236
+ *
237
+ *
238
+ * @param value string to interpolate
239
+ * @param parameters object with parametes
240
+ */
241
+ interpolateString(value) {
242
+ if (typeof value !== 'string') {
243
+ console.warn('[ss-logic][helper] Value for interpolation is not string: ', value);
244
+ return value;
245
+ }
246
+ return {
247
+ withParameters(parameters) {
248
+ if (typeof parameters !== 'object') {
249
+ console.warn('[ss-logic][helper] Parameters are not a object: ', parameters);
250
+ return value;
251
+ }
252
+ return value.replace(/{([^{}]*)}/g, function (a, b) {
253
+ var r = parameters[b];
254
+ return typeof r === 'string' || typeof r === 'number' ? r : a;
255
+ });
256
+ }
257
+ };
258
+ }
259
+ numValue(pixelsCss) {
260
+ // tslint:disable-next-line:radix
261
+ return parseInt(pixelsCss.replace('px', ''));
262
+ }
263
+ /**
264
+ * examples:
265
+ * 'aa bb bb' => ['aa','bb','cc'],
266
+ * 'aa' => ['aa']
267
+ * ['aa'] => ['aa']
268
+ */
269
+ splitIfNeed(stringOrArr) {
270
+ let res = [];
271
+ if (_.isArray(stringOrArr)) {
272
+ res = stringOrArr.map(s => {
273
+ return s.trim();
274
+ });
275
+ }
276
+ if (_.isString(stringOrArr)) {
277
+ res = stringOrArr.split(/\s*[\s,]\s*/);
278
+ }
279
+ return res.filter(f => !!f && (f.trim() !== ''));
280
+ }
281
+ removeDoubleOrMoreEmptyLines(s) {
282
+ s = s === null || s === void 0 ? void 0 : s.split('\n').map(f => f.trimRight()).join('\n');
283
+ return s === null || s === void 0 ? void 0 : s.replace(/(\r\n|\r|\n){2,}/g, '$1\n');
284
+ }
285
+ }
286
+
287
+ function conditionWait(conditionAndTimeout) {
288
+ return __awaiter(this, void 0, void 0, function* () {
289
+ yield waitFor(conditionAndTimeout);
290
+ });
291
+ }
292
+ function waitFor(arr, messageToShow = void 0) {
293
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
294
+ if (arr.length === 0) {
295
+ resolve(void 0);
296
+ }
297
+ else {
298
+ // console.log(arr.length)
299
+ const check = arr.shift();
300
+ if (_.isUndefined(check.timeoutCheck)) {
301
+ check.timeoutCheck = 2000;
302
+ }
303
+ if (_.isUndefined(check.timeoutNext)) {
304
+ check.timeoutNext = 4000;
305
+ }
306
+ const { timeoutCheck, timeoutNext, name } = check;
307
+ // console.log(`timeoutCheck: ${timeoutCheck}`);
308
+ // console.log(`timeoutNext: ${timeoutNext}`);
309
+ // console.log(`Checking: ${name}`)
310
+ const resultTrue = yield Helpers.runSyncOrAsync(check.callback, check);
311
+ // console.log(`after: ${name}`)
312
+ if (resultTrue) {
313
+ // console.log(`timeout 1 is set to ${timeoutNext}`)
314
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
315
+ // console.log(`timeout 1 is over`)
316
+ yield waitFor(arr).then(() => {
317
+ resolve(void 0);
318
+ });
319
+ }), timeoutNext);
320
+ }
321
+ else {
322
+ arr.unshift(check);
323
+ if (!messageToShow || check.errorMessage !== messageToShow) {
324
+ Helpers.info(check.errorMessage);
325
+ }
326
+ else {
327
+ // console.log(`dont show error message ${check.errorMessage}`)
328
+ }
329
+ // console.log(`timeout 2 is set to ${timeoutCheck}, arr.length is ${arr.length}`)
330
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
331
+ // console.log(`timeout 2 ${timeoutCheck} ovef`)
332
+ yield waitFor(arr, check.errorMessage).then(() => {
333
+ resolve(void 0);
334
+ });
335
+ }), timeoutCheck);
336
+ }
337
+ }
338
+ }));
339
+ }
340
+
341
+ function applyMixins(derivedCtor, baseCtors) {
342
+ baseCtors.forEach(baseCtor => {
343
+ Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
344
+ Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
345
+ });
346
+ });
347
+ }
348
+ // @ts-ignore
349
+ class HelpersTnp extends CoreHelpers {
350
+ constructor(arrays = new HelpersArrayObj(), strings = new HelpersStrings()) {
351
+ super();
352
+ this.arrays = arrays;
353
+ this.strings = strings;
354
+ this.conditionWait = conditionWait;
355
+ this.applyMixins = applyMixins;
356
+ }
357
+ static get Instance() {
358
+ if (!HelpersTnp._instance) {
359
+ HelpersTnp._instance = new HelpersTnp();
360
+ }
361
+ return HelpersTnp._instance;
362
+ }
363
+ CLIWRAP(f, name) {
364
+ CLASS.setName(f, name);
365
+ return f;
366
+ }
367
+ isElevated() {
368
+ return __awaiter(this, void 0, void 0, function* () {
369
+ });
370
+ }
371
+ mesureExectionInMs(description, functionToExecute, ...functionArguments) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ var start = new Date();
374
+ yield Helpers.runSyncOrAsync(functionToExecute, ...functionArguments);
375
+ //@ts-ignore
376
+ var end = new Date() - start;
377
+ if (Morphi.IsBrowser) {
378
+ Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
379
+ }
380
+ return end;
381
+ });
382
+ }
383
+ mesureExectionInMsSync(description, functionToExecute) {
384
+ var start = new Date();
385
+ functionToExecute();
386
+ //@ts-ignore
387
+ var end = new Date() - start;
388
+ if (Morphi.IsBrowser) {
389
+ Helpers.info(`Execution time: ${end.toString()}ms for "${description}"`);
390
+ }
391
+ return end;
392
+ }
393
+ waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
394
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
395
+ const result = yield Helpers.runSyncOrAsync(conditionFn);
396
+ if (result) {
397
+ resolve(void 0);
398
+ }
399
+ else {
400
+ setTimeout(() => {
401
+ Helpers.waitForCondition(conditionFn, howOfftenCheckInMs).then(() => {
402
+ resolve(void 0);
403
+ });
404
+ }, howOfftenCheckInMs);
405
+ }
406
+ }));
407
+ }
408
+ getBrowserVerPath(moduleName) {
409
+ }
410
+ getMethodName(obj, method) {
411
+ var methodName = null;
412
+ Object.getOwnPropertyNames(obj).forEach(prop => {
413
+ if (obj[prop] === method) {
414
+ methodName = prop;
415
+ }
416
+ });
417
+ if (methodName !== null) {
418
+ return methodName;
419
+ }
420
+ var proto = Object.getPrototypeOf(obj);
421
+ if (proto) {
422
+ return Helpers.getMethodName(proto, method);
423
+ }
424
+ return null;
425
+ }
426
+ fixWebpackEnv(env) {
427
+ _.forIn(env, (v, k) => {
428
+ const value = v;
429
+ if (value === 'true')
430
+ env[k] = true;
431
+ if (value === 'false')
432
+ env[k] = false;
433
+ });
434
+ }
435
+ }
436
+ applyMixins(HelpersTnp, [
437
+ HelpersMessages,
438
+ HelpersStringsRegexes,
439
+ HelpersEnvironment,
440
+ ]);
441
+
442
+ const BaselineSiteJoinprefix = '__';
443
+
444
+ const Helpers$1 = HelpersTnp.Instance;
445
+ class Project {
446
+ constructor() {
447
+ this.cache = {};
448
+ this.browser = {};
449
+ }
450
+ static typeFrom(location) {
451
+ return (void 0);
452
+ }
453
+ static unload(project) {
454
+ Project.projects = Project.projects.filter(f => f !== project);
455
+ }
456
+ static From(location) {
457
+ return (void 0);
458
+ }
459
+ static nearestTo(absoluteLocation, options) {
460
+ return (void 0);
461
+ }
462
+ static allProjectFrom(absoluteLocation, stopOnCwd = '/') {
463
+ return (void 0);
464
+ }
465
+ static DefaultPortByType(type) {
466
+ if (type === 'workspace') {
467
+ return 5000;
468
+ }
469
+ if (type === 'angular-client') {
470
+ return 4300;
471
+ }
472
+ if (type === 'angular-lib') {
473
+ return 4250;
474
+ }
475
+ if (type === 'electron-client') {
476
+ return 4350;
477
+ }
478
+ if (type === 'ionic-client') {
479
+ return 8080;
480
+ }
481
+ if (type === 'docker') {
482
+ return 5000;
483
+ }
484
+ if (type === 'isomorphic-lib') {
485
+ return 4000;
486
+ }
487
+ if (type === 'container' || type === 'unknow-npm-project') {
488
+ return;
489
+ }
490
+ }
491
+ static get isBundleMode() {
492
+ if (Helpers$1.isBrowser) {
493
+ return true;
494
+ }
495
+ }
496
+ static get Current() {
497
+ return (void 0);
498
+ }
499
+ static get Tnp() {
500
+ return (void 0);
501
+ }
502
+ static by(libraryType, version) {
503
+ return (void 0);
504
+ }
505
+ defineProperty(variableName, classFn) {
506
+ return (void 0);
507
+ }
508
+ setType(type) {
509
+ // @ts-ignore
510
+ this._type = type;
511
+ }
512
+ typeIs(...types) {
513
+ return this._type && types.includes(this._type);
514
+ }
515
+ typeIsNot(...types) {
516
+ return !this.typeIs(...types);
517
+ }
518
+ forEmptyStructure() {
519
+ return [
520
+ { relativePath: config.file.package_json, includeContent: true },
521
+ { relativePath: config.folder.src },
522
+ ];
523
+ }
524
+ }
525
+ Project.projects = [];
526
+ /**
527
+ * To speed up checking folder I am keeping pathes for alterdy checked folder
528
+ * This may break things that are creating new projects
529
+ */
530
+ Project.emptyLocations = [];
531
+
532
+ class BaseComponent {
533
+ constructor() {
534
+ // @ts-ignore
535
+ this.model = {};
536
+ this.handlers = [];
537
+ }
538
+ ngOnDestroy() {
539
+ this.handlers.forEach(h => h.unsubscribe());
540
+ this.handlers.length = 0;
541
+ }
542
+ }
543
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
544
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: BaseComponent, selector: "app-base-component-meta", inputs: { model: "model" }, ngImport: i0, template: '<div></div>', isInline: true });
545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BaseComponent, decorators: [{
546
+ type: Component,
547
+ args: [{
548
+ selector: 'app-base-component-meta',
549
+ template: '<div></div>'
550
+ }]
551
+ }], propDecorators: { model: [{
552
+ type: Input
553
+ }] } });
554
+ const isCalledNgInitAfterInternalRefresh = Symbol();
555
+ class BaseComponentForRouter extends BaseComponent {
556
+ constructor(__router) {
557
+ super();
558
+ this.__router = __router;
559
+ this[isCalledNgInitAfterInternalRefresh] = false;
560
+ }
561
+ isCalledNgInitAfterInternalRefresh() {
562
+ return !!this[isCalledNgInitAfterInternalRefresh];
563
+ }
564
+ reloadNgOninitOnUrlChange() {
565
+ this.handlers.push(this.__router.events.subscribe(event => {
566
+ if (event instanceof NavigationEnd && this['ngOnInit']) {
567
+ this[isCalledNgInitAfterInternalRefresh] = true;
568
+ this['ngOnInit']();
569
+ if (this[isCalledNgInitAfterInternalRefresh]) {
570
+ this[isCalledNgInitAfterInternalRefresh] = false;
571
+ }
572
+ }
573
+ }));
574
+ }
575
+ }
576
+
577
+ const log$2 = Log.create(`DualComponentController`);
578
+ class DualComponentController {
579
+ constructor(cmp, isFormlyMode = false) {
580
+ this.cmp = cmp;
581
+ this.isFormlyMode = isFormlyMode;
582
+ }
583
+ getValTemplateOptions(propertyName) {
584
+ var _a;
585
+ if (this.isFormlyMode) {
586
+ const res = (_a = this.cmp.field) === null || _a === void 0 ? void 0 : _a.templateOptions[propertyName];
587
+ if (res === void 0 && this.cmp[propertyName]) {
588
+ return this.cmp[propertyName];
589
+ }
590
+ return res;
591
+ }
592
+ return this.cmp[propertyName];
593
+ }
594
+ getValContext(propertyName) {
595
+ var _a;
596
+ if (this.isFormlyMode) {
597
+ const res = (_a = this.cmp) === null || _a === void 0 ? void 0 : _a.field[propertyName];
598
+ if (res === void 0 && this.cmp[propertyName]) {
599
+ return this.cmp[propertyName];
600
+ }
601
+ return res;
602
+ }
603
+ return this.cmp[propertyName];
604
+ }
605
+ get disabled() {
606
+ return this.getValTemplateOptions('disabled');
607
+ }
608
+ get required() {
609
+ return this.getValTemplateOptions('required');
610
+ }
611
+ get type() {
612
+ if (!this.isFormlyMode) {
613
+ return CLASS.getNameFromObject(this.cmp);
614
+ }
615
+ return this.getValContext('type');
616
+ }
617
+ get label() {
618
+ return this.getValTemplateOptions('label');
619
+ }
620
+ get placeholder() {
621
+ return this.getValTemplateOptions('placeholder');
622
+ }
623
+ get defaultValue() {
624
+ return this.getValContext('defaultValue');
625
+ }
626
+ get formControl() {
627
+ return this.getValContext('formControl');
628
+ }
629
+ get key() {
630
+ return this.getValContext('key');
631
+ }
632
+ get path() {
633
+ return this.getValContext('path');
634
+ }
635
+ get model() {
636
+ if (this.isFormlyMode) {
637
+ return this.getValContext('model');
638
+ }
639
+ else {
640
+ return this.__model;
641
+ }
642
+ }
643
+ set model(v) {
644
+ if (this.isFormlyMode) {
645
+ log$2.w(`[DualComponentController] You can't set model in formly component mode`);
646
+ }
647
+ else {
648
+ this.__model = v;
649
+ }
650
+ }
651
+ get mode() {
652
+ if (this.isFormlyMode) {
653
+ return this.getValContext('mode');
654
+ }
655
+ else {
656
+ return this.__mode;
657
+ }
658
+ }
659
+ set mode(v) {
660
+ if (this.isFormlyMode) {
661
+ // this.cmp.field.mode =
662
+ // log.w(`[DualComponentController] You can't set mode in formly component mode`);
663
+ }
664
+ else {
665
+ this.__mode = v;
666
+ }
667
+ }
668
+ get value() {
669
+ if (this.isFormlyMode) {
670
+ return this.cmp.field.formControl.value;
671
+ }
672
+ if (_.isString(this.path)) {
673
+ return _.get(this.cmp.model, this.path);
674
+ }
675
+ return this.cmp.model;
676
+ }
677
+ set value(v) {
678
+ if (this.isFormlyMode) {
679
+ this.cmp.field.formControl.setValue(v);
680
+ this.cmp.change.next(v);
681
+ return;
682
+ }
683
+ if (_.isString(this.path)) {
684
+ _.set(this.cmp.model, this.path, v);
685
+ }
686
+ else {
687
+ this.cmp.model = v;
688
+ }
689
+ }
690
+ }
691
+
692
+ const log$1 = Log.create('base formly component', Level.__NOTHING);
693
+ class BaseFormlyComponent extends FieldType {
694
+ constructor() {
695
+ super(...arguments);
696
+ this.DualComponentController = DualComponentController;
697
+ this.ctrl = {};
698
+ this.change = new EventEmitter();
699
+ this.handlers = [];
700
+ this.__field = {
701
+ templateOptions: {}
702
+ };
703
+ }
704
+ // @ts-ignore
705
+ get mode() {
706
+ return this.ctrl.mode;
707
+ }
708
+ // @ts-ignore
709
+ set mode(v) {
710
+ this.ctrl.mode = v;
711
+ }
712
+ // @ts-ignore
713
+ set model(v) {
714
+ this.ctrl.model = v;
715
+ }
716
+ get model() {
717
+ return this.ctrl.model;
718
+ }
719
+ // @ts-ignore
720
+ set key(value) {
721
+ if (this.ctrl && this.ctrl.isFormlyMode) {
722
+ return;
723
+ }
724
+ this.path = value;
725
+ }
726
+ get key() {
727
+ if (this.ctrl && this.ctrl.isFormlyMode) {
728
+ return this.field.key;
729
+ }
730
+ return this.path;
731
+ }
732
+ ngOnDestroy() {
733
+ this.handlers.forEach(h => h.unsubscribe());
734
+ this.handlers.length = 0;
735
+ }
736
+ ngAfterViewInit() {
737
+ }
738
+ // _model: any;
739
+ ngOnInit() {
740
+ // console.log('model', this.model)
741
+ // console.log('ket', this.key)
742
+ const isFormlyMode = !!this.field;
743
+ log$1.i(`isFormlyMode: ${isFormlyMode}`);
744
+ if (!isFormlyMode) {
745
+ const that = this;
746
+ Object.defineProperty(this, 'field', {
747
+ get: function () {
748
+ return that.__field;
749
+ },
750
+ set: function (v) {
751
+ that.__field = v;
752
+ }
753
+ });
754
+ }
755
+ const existed = this.ctrl;
756
+ this.ctrl = new this.DualComponentController(this, isFormlyMode);
757
+ // @ts-ignore
758
+ Object.keys(existed).forEach(key => {
759
+ this.ctrl[key] = existed[key];
760
+ });
761
+ // if (!this.formControl) {
762
+ // this.formControl = new FormControl({})
763
+ // Object.defineProperty(this, 'field', {
764
+ // get: () => {
765
+ // return {
766
+ // formControl: this.formControl
767
+ // } as FormlyFieldConfig
768
+ // }
769
+ // })
770
+ // // this.formControl = new FormControl({})
771
+ // }
772
+ this.change.next(this.ctrl.value);
773
+ }
774
+ }
775
+ BaseFormlyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BaseFormlyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
776
+ BaseFormlyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", 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", formControl: "formControl" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: `<div></div>`, isInline: true });
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: BaseFormlyComponent, decorators: [{
778
+ type: Component,
779
+ args: [{
780
+ selector: 'app-base-formly-component-meta',
781
+ template: `<div></div>`
782
+ }]
783
+ }], propDecorators: { pizda: [{
784
+ type: Input
785
+ }], mode: [{
786
+ type: Input
787
+ }], disabled: [{
788
+ type: Input
789
+ }], required: [{
790
+ type: Input
791
+ }], label: [{
792
+ type: Input
793
+ }], placeholder: [{
794
+ type: Input
795
+ }], defaultValue: [{
796
+ type: Input
797
+ }], model: [{
798
+ type: Input
799
+ }], path: [{
800
+ type: Input
801
+ }], change: [{
802
+ type: Output
803
+ }], key: [{
804
+ type: Input
805
+ }], formControl: [{
806
+ type: Input
807
+ }] } });
808
+
809
+ class ResizeService {
810
+ constructor() {
811
+ this.resizeDetector = elementResizeDetectorMaker({ strategy: 'scroll' });
812
+ }
813
+ addResizeEventListener(element, handler) {
814
+ this.resizeDetector.listenTo(element, handler);
815
+ }
816
+ removeResizeEventListener(element) {
817
+ this.resizeDetector.uninstall(element);
818
+ }
819
+ }
820
+ ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ResizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
821
+ ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ResizeService });
822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ResizeService, decorators: [{
823
+ type: Injectable
824
+ }], ctorParameters: function () { return []; } });
825
+
826
+ const log = Log.create(`[tnp-helpers] long-press`, Level.__NOTHING);
827
+ class LongPress {
828
+ constructor() {
829
+ this.pressDuration = 1000;
830
+ this.onLongPress = new EventEmitter();
831
+ this.onLongPressing = new EventEmitter();
832
+ this.onLongPressEnd = new EventEmitter();
833
+ this.mouseX = 0;
834
+ this.mouseY = 0;
835
+ this.allowTrigger = false;
836
+ this.triggerEnd = _.debounce(() => {
837
+ this.endPress();
838
+ }, 500);
839
+ }
840
+ get press() { return this.pressing; }
841
+ get longPress() { return this.longPressing; }
842
+ onMouseDown(event) {
843
+ // don't do right/middle clicks
844
+ log.d(`MOUSE DOWN `);
845
+ if (event.which !== 1)
846
+ return;
847
+ this.allowTrigger = true;
848
+ this.mouseX = event.clientX;
849
+ this.mouseY = event.clientY;
850
+ this.pressing = true;
851
+ this.longPressing = false;
852
+ this.timeout = setTimeout(() => {
853
+ if (this.allowTrigger) {
854
+ this.longPressing = true;
855
+ log.d(`long pressing start pressDuration:${this.pressDuration} `);
856
+ this.onLongPress.emit(event);
857
+ this.loop(event);
858
+ }
859
+ }, this.pressDuration);
860
+ this.loop(event);
861
+ }
862
+ onMouseMove(event) {
863
+ if (this.pressing && !this.longPressing) {
864
+ const xThres = (event.clientX - this.mouseX) > 10;
865
+ const yThres = (event.clientY - this.mouseY) > 10;
866
+ if (xThres || yThres) {
867
+ this.endPress();
868
+ }
869
+ }
870
+ }
871
+ loop(event) {
872
+ if (this.longPressing) {
873
+ this.timeout = setTimeout(() => {
874
+ log.d(`emil longpressing`);
875
+ this.triggerEnd();
876
+ this.onLongPressing.emit(event);
877
+ this.loop(event);
878
+ }, 50);
879
+ }
880
+ }
881
+ endPress(emit = true) {
882
+ this.allowTrigger = false;
883
+ clearTimeout(this.timeout);
884
+ this.longPressing = false;
885
+ this.pressing = false;
886
+ if (emit) {
887
+ log.d(`EMIT END`);
888
+ this.onLongPressEnd.emit(true);
889
+ }
890
+ else {
891
+ log.d(`NOT EMIT END`);
892
+ }
893
+ }
894
+ onMouseUp() {
895
+ this.endPress(false);
896
+ }
897
+ }
898
+ LongPress.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: LongPress, deps: [], target: i0.ɵɵFactoryTarget.Directive });
899
+ LongPress.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", 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 });
900
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: LongPress, decorators: [{
901
+ type: Directive,
902
+ args: [{ selector: '[long-press]' }]
903
+ }], propDecorators: { pressDuration: [{
904
+ type: Input
905
+ }], onLongPress: [{
906
+ type: Output
907
+ }], onLongPressing: [{
908
+ type: Output
909
+ }], onLongPressEnd: [{
910
+ type: Output
911
+ }], press: [{
912
+ type: HostBinding,
913
+ args: ['class.press']
914
+ }], longPress: [{
915
+ type: HostBinding,
916
+ args: ['class.longpress']
917
+ }], onMouseDown: [{
918
+ type: HostListener,
919
+ args: ['mousedown', ['$event']]
920
+ }], onMouseMove: [{
921
+ type: HostListener,
922
+ args: ['mousemove', ['$event']]
923
+ }], onMouseUp: [{
924
+ type: HostListener,
925
+ args: ['mouseup']
926
+ }] } });
927
+
928
+ // export * from './git-project';
929
+ const Helpers = HelpersTnp.Instance;
930
+
931
+ /**
932
+ * Generated bundle index. Do not edit.
933
+ */
934
+
935
+ export { BaseComponent, BaseComponentForRouter, BaseFormlyComponent, BaselineSiteJoinprefix, DualComponentController, Helpers, LongPress, Project, ResizeService };
936
+ //# sourceMappingURL=tnp-helpers.mjs.map