@firestitch/common 12.7.0 → 13.0.1

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 (253) hide show
  1. package/app/directives/autofocus.directive.d.ts +13 -13
  2. package/app/directives/index.d.ts +4 -4
  3. package/app/directives/model-change.directive.d.ts +16 -16
  4. package/app/directives/prevent-default.directive.d.ts +6 -6
  5. package/app/directives/stop-propagation.directive.d.ts +6 -6
  6. package/app/fs-common.module.d.ts +19 -19
  7. package/app/pipes/bytes.pipe.d.ts +7 -7
  8. package/app/pipes/currency.pipe.d.ts +9 -9
  9. package/app/pipes/index.d.ts +2 -2
  10. package/app/pipes/number.pipe.d.ts +7 -7
  11. package/app/pipes/ordinal-number.pipe.d.ts +7 -7
  12. package/app/pipes/truncate.pipe.d.ts +8 -8
  13. package/app/pipes/util.pipe.d.ts +24 -24
  14. package/app/services/array.service.d.ts +61 -61
  15. package/app/services/math.service.d.ts +9 -9
  16. package/app/services/util.service.d.ts +89 -89
  17. package/app/services/vaildate.service.d.ts +16 -16
  18. package/{esm2015/app/directives/autofocus.directive.js → esm2020/app/directives/autofocus.directive.mjs} +51 -51
  19. package/{esm2015/app/directives/index.js → esm2020/app/directives/index.mjs} +5 -5
  20. package/esm2020/app/directives/model-change.directive.mjs +37 -0
  21. package/{esm2015/app/directives/prevent-default.directive.js → esm2020/app/directives/prevent-default.directive.mjs} +19 -19
  22. package/{esm2015/app/directives/stop-propagation.directive.js → esm2020/app/directives/stop-propagation.directive.mjs} +19 -19
  23. package/{esm2015/app/fs-common.module.js → esm2020/app/fs-common.module.mjs} +98 -98
  24. package/{esm2015/app/pipes/bytes.pipe.js → esm2020/app/pipes/bytes.pipe.mjs} +17 -17
  25. package/{esm2015/app/pipes/currency.pipe.js → esm2020/app/pipes/currency.pipe.mjs} +23 -23
  26. package/{esm2015/app/pipes/index.js → esm2020/app/pipes/index.mjs} +2 -2
  27. package/{esm2015/app/pipes/number.pipe.js → esm2020/app/pipes/number.pipe.mjs} +17 -17
  28. package/{esm2015/app/pipes/ordinal-number.pipe.js → esm2020/app/pipes/ordinal-number.pipe.mjs} +17 -17
  29. package/{esm2015/app/pipes/truncate.pipe.js → esm2020/app/pipes/truncate.pipe.mjs} +18 -18
  30. package/esm2020/app/pipes/util.pipe.mjs +60 -0
  31. package/{esm2015/app/services/array.service.js → esm2020/app/services/array.service.mjs} +225 -225
  32. package/{esm2015/app/services/math.service.js → esm2020/app/services/math.service.mjs} +21 -21
  33. package/{esm2015/app/services/util.service.js → esm2020/app/services/util.service.mjs} +251 -251
  34. package/{esm2015/app/services/vaildate.service.js → esm2020/app/services/vaildate.service.mjs} +28 -28
  35. package/{esm2015/firestitch-common.js → esm2020/firestitch-common.mjs} +4 -4
  36. package/{esm2015/libs/array/compare/compare.js → esm2020/libs/array/compare/compare.mjs} +7 -7
  37. package/{esm2015/libs/array/compare/index.js → esm2020/libs/array/compare/index.mjs} +1 -1
  38. package/{esm2015/libs/array/filter/filter.js → esm2020/libs/array/filter/filter.mjs} +26 -26
  39. package/{esm2015/libs/array/filter/index.js → esm2020/libs/array/filter/index.mjs} +1 -1
  40. package/{esm2015/libs/array/find/find.js → esm2020/libs/array/find/find.mjs} +5 -5
  41. package/{esm2015/libs/array/find/index.js → esm2020/libs/array/find/index.mjs} +1 -1
  42. package/{esm2015/libs/array/inArray/inArray.js → esm2020/libs/array/inArray/inArray.mjs} +11 -11
  43. package/{esm2015/libs/array/inArray/index.js → esm2020/libs/array/inArray/index.mjs} +1 -1
  44. package/{esm2015/libs/array/index/index.js → esm2020/libs/array/index/index.mjs} +7 -7
  45. package/{esm2015/libs/array/index.js → esm2020/libs/array/index.mjs} +13 -13
  46. package/{esm2015/libs/array/indexOf/index.js → esm2020/libs/array/indexOf/index.mjs} +1 -1
  47. package/{esm2015/libs/array/indexOf/indexOf.js → esm2020/libs/array/indexOf/indexOf.mjs} +15 -15
  48. package/{esm2015/libs/array/keyExists/index.js → esm2020/libs/array/keyExists/index.mjs} +1 -1
  49. package/{esm2015/libs/array/keyExists/keyExists.js → esm2020/libs/array/keyExists/keyExists.mjs} +3 -3
  50. package/{esm2015/libs/array/ksort/index.js → esm2020/libs/array/ksort/index.mjs} +1 -1
  51. package/{esm2015/libs/array/ksort/ksort.js → esm2020/libs/array/ksort/ksort.mjs} +7 -7
  52. package/{esm2015/libs/array/list/index.js → esm2020/libs/array/list/index.mjs} +1 -1
  53. package/{esm2015/libs/array/list/list.js → esm2020/libs/array/list/list.mjs} +12 -12
  54. package/{esm2015/libs/array/nameValue/index.js → esm2020/libs/array/nameValue/index.mjs} +1 -1
  55. package/{esm2015/libs/array/nameValue/nameValue.js → esm2020/libs/array/nameValue/nameValue.mjs} +20 -20
  56. package/{esm2015/libs/array/remove/index.js → esm2020/libs/array/remove/index.mjs} +1 -1
  57. package/{esm2015/libs/array/remove/remove.js → esm2020/libs/array/remove/remove.mjs} +8 -8
  58. package/{esm2015/libs/array/rsort/index.js → esm2020/libs/array/rsort/index.mjs} +1 -1
  59. package/{esm2015/libs/array/rsort/rsort.js → esm2020/libs/array/rsort/rsort.mjs} +4 -4
  60. package/{esm2015/libs/array/sort/index.js → esm2020/libs/array/sort/index.mjs} +1 -1
  61. package/{esm2015/libs/array/sort/sort.js → esm2020/libs/array/sort/sort.mjs} +26 -26
  62. package/{esm2015/libs/format/acronym/acronym.js → esm2020/libs/format/acronym/acronym.mjs} +21 -21
  63. package/{esm2015/libs/format/acronym/index.js → esm2020/libs/format/acronym/index.mjs} +1 -1
  64. package/{esm2015/libs/format/bytes/bytes.js → esm2020/libs/format/bytes/bytes.mjs} +17 -17
  65. package/{esm2015/libs/format/bytes/index.js → esm2020/libs/format/bytes/index.mjs} +1 -1
  66. package/{esm2015/libs/format/currency/currency.js → esm2020/libs/format/currency/currency.mjs} +8 -8
  67. package/{esm2015/libs/format/currency/index.js → esm2020/libs/format/currency/index.mjs} +1 -1
  68. package/{esm2015/libs/format/index.js → esm2020/libs/format/index.mjs} +5 -5
  69. package/{esm2015/libs/format/number/index.js → esm2020/libs/format/number/index.mjs} +1 -1
  70. package/{esm2015/libs/format/number/number.js → esm2020/libs/format/number/number.mjs} +7 -7
  71. package/{esm2015/libs/format/truncate/index.js → esm2020/libs/format/truncate/index.mjs} +1 -1
  72. package/{esm2015/libs/format/truncate/truncate.js → esm2020/libs/format/truncate/truncate.mjs} +11 -11
  73. package/{esm2015/libs/index.js → esm2020/libs/index.mjs} +6 -6
  74. package/{esm2015/libs/rxjs/delayedRetry.js → esm2020/libs/rxjs/delayedRetry.mjs} +19 -19
  75. package/{esm2015/libs/rxjs/keyboard-shortcut.js → esm2020/libs/rxjs/keyboard-shortcut.mjs} +17 -17
  76. package/{esm2015/libs/util/boolean/boolean.js → esm2020/libs/util/boolean/boolean.mjs} +3 -3
  77. package/{esm2015/libs/util/boolean/index.js → esm2020/libs/util/boolean/index.mjs} +1 -1
  78. package/{esm2015/libs/util/clone/clone.js → esm2020/libs/util/clone/clone.mjs} +20 -20
  79. package/{esm2015/libs/util/clone/index.js → esm2020/libs/util/clone/index.mjs} +1 -1
  80. package/{esm2015/libs/util/debounce/debounce.js → esm2020/libs/util/debounce/debounce.mjs} +16 -16
  81. package/{esm2015/libs/util/debounce/index.js → esm2020/libs/util/debounce/index.mjs} +1 -1
  82. package/{esm2015/libs/util/get-normalized-path/get-normalized-path.js → esm2020/libs/util/get-normalized-path/get-normalized-path.mjs} +5 -5
  83. package/{esm2015/libs/util/get-normalized-path/index.js → esm2020/libs/util/get-normalized-path/index.mjs} +1 -1
  84. package/{esm2015/libs/util/guid/guid.js → esm2020/libs/util/guid/guid.mjs} +18 -18
  85. package/{esm2015/libs/util/guid/index.js → esm2020/libs/util/guid/index.mjs} +1 -1
  86. package/esm2020/libs/util/index.mjs +24 -0
  87. package/esm2020/libs/util/is-array-equal/index.mjs +2 -0
  88. package/{esm2015/libs/util/is-array-equal/is-array-equal.js → esm2020/libs/util/is-array-equal/is-array-equal.mjs} +21 -21
  89. package/esm2020/libs/util/is-class/index.mjs +2 -0
  90. package/esm2020/libs/util/is-class/is-class.mjs +18 -0
  91. package/esm2020/libs/util/is-empty/index.mjs +2 -0
  92. package/esm2020/libs/util/is-empty/is-empty.mjs +12 -0
  93. package/esm2020/libs/util/is-numeric/index.mjs +2 -0
  94. package/esm2020/libs/util/is-numeric/is-numeric.mjs +5 -0
  95. package/{esm2015/libs/util/is-object/index.js → esm2020/libs/util/is-object/index.mjs} +1 -1
  96. package/{esm2015/libs/util/is-object/is-object.js → esm2020/libs/util/is-object/is-object.mjs} +3 -3
  97. package/{esm2015/libs/util/keys/index.js → esm2020/libs/util/keys/index.mjs} +1 -1
  98. package/{esm2015/libs/util/keys/keys.js → esm2020/libs/util/keys/keys.mjs} +37 -37
  99. package/{esm2015/libs/util/length/index.js → esm2020/libs/util/length/index.mjs} +1 -1
  100. package/{esm2015/libs/util/length/length.js → esm2020/libs/util/length/length.mjs} +9 -9
  101. package/esm2020/libs/util/ordinal-number/index.mjs +2 -0
  102. package/{esm2015/libs/util/ordinal-number/ordinal-number.js → esm2020/libs/util/ordinal-number/ordinal-number.mjs} +7 -7
  103. package/{esm2015/libs/util/queue/index.js → esm2020/libs/util/queue/index.mjs} +3 -3
  104. package/{esm2015/libs/util/queue/operation.js → esm2020/libs/util/queue/operation.mjs} +14 -14
  105. package/{esm2015/libs/util/queue/queue-stats.js → esm2020/libs/util/queue/queue-stats.mjs} +1 -1
  106. package/{esm2015/libs/util/queue/queue.enum.js → esm2020/libs/util/queue/queue.enum.mjs} +5 -5
  107. package/{esm2015/libs/util/queue/queue.js → esm2020/libs/util/queue/queue.mjs} +164 -164
  108. package/{esm2015/libs/util/remove-query-params/index.js → esm2020/libs/util/remove-query-params/index.mjs} +1 -1
  109. package/{esm2015/libs/util/remove-query-params/remove-query-params.js → esm2020/libs/util/remove-query-params/remove-query-params.mjs} +3 -3
  110. package/{esm2015/libs/util/resolve/index.js → esm2020/libs/util/resolve/index.mjs} +1 -1
  111. package/{esm2015/libs/util/resolve/resolve.js → esm2020/libs/util/resolve/resolve.mjs} +9 -9
  112. package/{esm2015/libs/util/round/index.js → esm2020/libs/util/round/index.mjs} +1 -1
  113. package/{esm2015/libs/util/round/round.js → esm2020/libs/util/round/round.mjs} +5 -5
  114. package/esm2020/libs/util/source-loader/index.mjs +2 -0
  115. package/esm2020/libs/util/source-loader/source-loader.mjs +155 -0
  116. package/{esm2015/libs/util/stringify/index.js → esm2020/libs/util/stringify/index.mjs} +1 -1
  117. package/{esm2015/libs/util/stringify/stringify.js → esm2020/libs/util/stringify/stringify.mjs} +3 -3
  118. package/{esm2015/libs/util/throttle/index.js → esm2020/libs/util/throttle/index.mjs} +1 -1
  119. package/{esm2015/libs/util/throttle/throttle.js → esm2020/libs/util/throttle/throttle.mjs} +12 -12
  120. package/{esm2015/libs/util/to-string/index.js → esm2020/libs/util/to-string/index.mjs} +1 -1
  121. package/{esm2015/libs/util/to-string/to-string.js → esm2020/libs/util/to-string/to-string.mjs} +6 -6
  122. package/{esm2015/libs/util/uuid/index.js → esm2020/libs/util/uuid/index.mjs} +1 -1
  123. package/{esm2015/libs/util/uuid/uuid.js → esm2020/libs/util/uuid/uuid.mjs} +4 -4
  124. package/{esm2015/libs/util/value/index.js → esm2020/libs/util/value/index.mjs} +1 -1
  125. package/{esm2015/libs/util/value/value.js → esm2020/libs/util/value/value.mjs} +8 -8
  126. package/{esm2015/libs/validate/email/email.js → esm2020/libs/validate/email/email.mjs} +3 -3
  127. package/{esm2015/libs/validate/email/index.js → esm2020/libs/validate/email/index.mjs} +1 -1
  128. package/{esm2015/libs/validate/index.js → esm2020/libs/validate/index.mjs} +3 -3
  129. package/{esm2015/libs/validate/phone/index.js → esm2020/libs/validate/phone/index.mjs} +1 -1
  130. package/{esm2015/libs/validate/phone/phone.js → esm2020/libs/validate/phone/phone.mjs} +4 -4
  131. package/{esm2015/libs/validate/url/index.js → esm2020/libs/validate/url/index.mjs} +1 -1
  132. package/{esm2015/libs/validate/url/url.js → esm2020/libs/validate/url/url.mjs} +11 -11
  133. package/{esm2015/public_api.js → esm2020/public_api.mjs} +17 -17
  134. package/fesm2015/firestitch-common.mjs +1713 -0
  135. package/fesm2015/firestitch-common.mjs.map +1 -0
  136. package/{fesm2015/firestitch-common.js → fesm2020/firestitch-common.mjs} +1656 -1646
  137. package/fesm2020/firestitch-common.mjs.map +1 -0
  138. package/firestitch-common.d.ts +5 -5
  139. package/libs/array/compare/compare.d.ts +1 -1
  140. package/libs/array/compare/index.d.ts +1 -1
  141. package/libs/array/filter/filter.d.ts +1 -1
  142. package/libs/array/filter/index.d.ts +1 -1
  143. package/libs/array/find/find.d.ts +1 -1
  144. package/libs/array/find/index.d.ts +1 -1
  145. package/libs/array/inArray/inArray.d.ts +1 -1
  146. package/libs/array/inArray/index.d.ts +1 -1
  147. package/libs/array/index/index.d.ts +1 -1
  148. package/libs/array/index.d.ts +13 -13
  149. package/libs/array/indexOf/index.d.ts +1 -1
  150. package/libs/array/indexOf/indexOf.d.ts +1 -1
  151. package/libs/array/keyExists/index.d.ts +1 -1
  152. package/libs/array/keyExists/keyExists.d.ts +1 -1
  153. package/libs/array/ksort/index.d.ts +1 -1
  154. package/libs/array/ksort/ksort.d.ts +1 -1
  155. package/libs/array/list/index.d.ts +1 -1
  156. package/libs/array/list/list.d.ts +1 -1
  157. package/libs/array/nameValue/index.d.ts +1 -1
  158. package/libs/array/nameValue/nameValue.d.ts +1 -1
  159. package/libs/array/remove/index.d.ts +1 -1
  160. package/libs/array/remove/remove.d.ts +1 -1
  161. package/libs/array/rsort/index.d.ts +1 -1
  162. package/libs/array/rsort/rsort.d.ts +1 -1
  163. package/libs/array/sort/index.d.ts +1 -1
  164. package/libs/array/sort/sort.d.ts +1 -1
  165. package/libs/format/acronym/acronym.d.ts +1 -1
  166. package/libs/format/acronym/index.d.ts +1 -1
  167. package/libs/format/bytes/bytes.d.ts +1 -1
  168. package/libs/format/bytes/index.d.ts +1 -1
  169. package/libs/format/currency/currency.d.ts +1 -1
  170. package/libs/format/currency/index.d.ts +1 -1
  171. package/libs/format/index.d.ts +5 -5
  172. package/libs/format/number/index.d.ts +1 -1
  173. package/libs/format/number/number.d.ts +1 -1
  174. package/libs/format/truncate/index.d.ts +1 -1
  175. package/libs/format/truncate/truncate.d.ts +1 -1
  176. package/libs/index.d.ts +5 -5
  177. package/libs/rxjs/delayedRetry.d.ts +2 -2
  178. package/libs/rxjs/keyboard-shortcut.d.ts +2 -2
  179. package/libs/util/boolean/boolean.d.ts +1 -1
  180. package/libs/util/boolean/index.d.ts +1 -1
  181. package/libs/util/clone/clone.d.ts +1 -1
  182. package/libs/util/clone/index.d.ts +1 -1
  183. package/libs/util/debounce/debounce.d.ts +1 -1
  184. package/libs/util/debounce/index.d.ts +1 -1
  185. package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
  186. package/libs/util/get-normalized-path/index.d.ts +1 -1
  187. package/libs/util/guid/guid.d.ts +1 -1
  188. package/libs/util/guid/index.d.ts +1 -1
  189. package/libs/util/index.d.ts +23 -23
  190. package/libs/util/is-array-equal/index.d.ts +1 -0
  191. package/libs/util/is-array-equal/is-array-equal.d.ts +1 -1
  192. package/libs/util/is-class/index.d.ts +1 -0
  193. package/libs/util/{isClass/isClass.d.ts → is-class/is-class.d.ts} +1 -1
  194. package/libs/util/is-empty/index.d.ts +1 -0
  195. package/libs/util/{isEmpty/isEmpty.d.ts → is-empty/is-empty.d.ts} +1 -1
  196. package/libs/util/is-numeric/index.d.ts +1 -0
  197. package/libs/util/{isNumeric/isNumeric.d.ts → is-numeric/is-numeric.d.ts} +1 -1
  198. package/libs/util/is-object/index.d.ts +1 -1
  199. package/libs/util/is-object/is-object.d.ts +1 -1
  200. package/libs/util/keys/index.d.ts +1 -1
  201. package/libs/util/keys/keys.d.ts +37 -37
  202. package/libs/util/length/index.d.ts +1 -1
  203. package/libs/util/length/length.d.ts +1 -1
  204. package/libs/util/ordinal-number/index.d.ts +1 -0
  205. package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
  206. package/libs/util/queue/index.d.ts +3 -3
  207. package/libs/util/queue/operation.d.ts +7 -7
  208. package/libs/util/queue/queue-stats.d.ts +5 -5
  209. package/libs/util/queue/queue.d.ts +39 -39
  210. package/libs/util/queue/queue.enum.d.ts +4 -4
  211. package/libs/util/remove-query-params/index.d.ts +1 -1
  212. package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
  213. package/libs/util/resolve/index.d.ts +1 -1
  214. package/libs/util/resolve/resolve.d.ts +1 -1
  215. package/libs/util/round/index.d.ts +1 -1
  216. package/libs/util/round/round.d.ts +1 -1
  217. package/libs/util/source-loader/index.d.ts +1 -0
  218. package/libs/util/source-loader/source-loader.d.ts +11 -7
  219. package/libs/util/stringify/index.d.ts +1 -1
  220. package/libs/util/stringify/stringify.d.ts +1 -1
  221. package/libs/util/throttle/index.d.ts +1 -1
  222. package/libs/util/throttle/throttle.d.ts +1 -1
  223. package/libs/util/to-string/index.d.ts +1 -1
  224. package/libs/util/to-string/to-string.d.ts +1 -1
  225. package/libs/util/uuid/index.d.ts +1 -1
  226. package/libs/util/uuid/uuid.d.ts +1 -1
  227. package/libs/util/value/index.d.ts +1 -1
  228. package/libs/util/value/value.d.ts +1 -1
  229. package/libs/validate/email/email.d.ts +1 -1
  230. package/libs/validate/email/index.d.ts +1 -1
  231. package/libs/validate/index.d.ts +3 -3
  232. package/libs/validate/phone/index.d.ts +1 -1
  233. package/libs/validate/phone/phone.d.ts +1 -1
  234. package/libs/validate/url/index.d.ts +1 -1
  235. package/libs/validate/url/url.d.ts +7 -7
  236. package/package.json +20 -7
  237. package/public_api.d.ts +14 -14
  238. package/bundles/firestitch-common.umd.js +0 -2258
  239. package/bundles/firestitch-common.umd.js.map +0 -1
  240. package/esm2015/app/directives/model-change.directive.js +0 -37
  241. package/esm2015/app/pipes/util.pipe.js +0 -60
  242. package/esm2015/libs/util/index.js +0 -24
  243. package/esm2015/libs/util/isClass/index.js +0 -2
  244. package/esm2015/libs/util/isClass/isClass.js +0 -18
  245. package/esm2015/libs/util/isEmpty/index.js +0 -2
  246. package/esm2015/libs/util/isEmpty/isEmpty.js +0 -12
  247. package/esm2015/libs/util/isNumeric/index.js +0 -2
  248. package/esm2015/libs/util/isNumeric/isNumeric.js +0 -5
  249. package/esm2015/libs/util/source-loader/source-loader.js +0 -145
  250. package/fesm2015/firestitch-common.js.map +0 -1
  251. package/libs/util/isClass/index.d.ts +0 -1
  252. package/libs/util/isEmpty/index.d.ts +0 -1
  253. package/libs/util/isNumeric/index.d.ts +0 -1
@@ -6,1693 +6,1703 @@ import * as i1$1 from '@angular/forms';
6
6
  import { Subject, Observable, of, combineLatest, iif, throwError, timer, fromEvent, merge } from 'rxjs';
7
7
  import { debounceTime, takeUntil, take, map, delay, finalize, shareReplay, retryWhen, tap, concatMap, distinctUntilChanged, share, filter as filter$1 } from 'rxjs/operators';
8
8
 
9
- class FsAutofocusDirective {
10
- constructor(_matInput, _el) {
11
- this._matInput = _matInput;
12
- this._el = _el;
13
- this.fsAutofocus = true;
14
- }
15
- ngAfterViewInit() {
16
- if (this.fsAutofocus || this.fsAutofocus === undefined) {
17
- this.focus();
18
- }
19
- }
20
- focus() {
21
- setTimeout(() => {
22
- const tmpEl = document.createElement('input');
23
- tmpEl.style.width = '0';
24
- tmpEl.style.height = '0';
25
- tmpEl.style.margin = '0';
26
- tmpEl.style.padding = '0';
27
- tmpEl.style.border = '0';
28
- tmpEl.style.opacity = '0';
29
- document.body.appendChild(tmpEl);
30
- tmpEl.focus();
31
- if (this._matInput) {
32
- this._matInput.focus();
33
- }
34
- else if (this._el.nativeElement.focus) {
35
- this._el.nativeElement.focus();
36
- }
37
- document.body.removeChild(tmpEl);
38
- }, 50);
39
- }
40
- }
41
- FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAutofocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
42
- FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsAutofocusDirective, selector: "[fsAutofocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus" }, ngImport: i0 });
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsAutofocusDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: '[fsAutofocus],[autofocus]',
47
- }]
48
- }], ctorParameters: function () { return [{ type: i1.MatInput, decorators: [{
49
- type: Optional
50
- }, {
51
- type: Host
52
- }] }, { type: i0.ElementRef }]; }, propDecorators: { fsAutofocus: [{
53
- type: Input
9
+ class FsAutofocusDirective {
10
+ constructor(_matInput, _el) {
11
+ this._matInput = _matInput;
12
+ this._el = _el;
13
+ this.fsAutofocus = true;
14
+ }
15
+ ngAfterViewInit() {
16
+ if (this.fsAutofocus || this.fsAutofocus === undefined) {
17
+ this.focus();
18
+ }
19
+ }
20
+ focus() {
21
+ setTimeout(() => {
22
+ const tmpEl = document.createElement('input');
23
+ tmpEl.style.width = '0';
24
+ tmpEl.style.height = '0';
25
+ tmpEl.style.margin = '0';
26
+ tmpEl.style.padding = '0';
27
+ tmpEl.style.border = '0';
28
+ tmpEl.style.opacity = '0';
29
+ document.body.appendChild(tmpEl);
30
+ tmpEl.focus();
31
+ if (this._matInput) {
32
+ this._matInput.focus();
33
+ }
34
+ else if (this._el.nativeElement.focus) {
35
+ this._el.nativeElement.focus();
36
+ }
37
+ document.body.removeChild(tmpEl);
38
+ }, 50);
39
+ }
40
+ }
41
+ FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
42
+ FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutofocusDirective, selector: "[fsAutofocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus" }, ngImport: i0 });
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, decorators: [{
44
+ type: Directive,
45
+ args: [{
46
+ selector: '[fsAutofocus],[autofocus]',
47
+ }]
48
+ }], ctorParameters: function () { return [{ type: i1.MatInput, decorators: [{
49
+ type: Optional
50
+ }, {
51
+ type: Host
52
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { fsAutofocus: [{
53
+ type: Input
54
54
  }] } });
55
55
 
56
- class FsModelChangeDirective {
57
- constructor(_ngModel) {
58
- this._ngModel = _ngModel;
59
- this.fsModelChange = new EventEmitter();
60
- this._destroy$ = new Subject();
61
- }
62
- ngOnInit() {
63
- this._ngModel.update
64
- .pipe(debounceTime(this.fsModelChangeOptions.debounce), takeUntil(this._destroy$))
65
- .subscribe((value) => {
66
- this.fsModelChange.emit(value);
67
- });
68
- }
69
- ngOnDestroy() {
70
- this._destroy$.next();
71
- this._destroy$.complete();
72
- }
73
- }
74
- FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
75
- FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsModelChangeDirective, decorators: [{
77
- type: Directive,
78
- args: [{
79
- selector: '[fsModelChange]',
80
- }]
81
- }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
82
- type: Input
83
- }], fsModelChange: [{
84
- type: Output
56
+ class FsModelChangeDirective {
57
+ constructor(_ngModel) {
58
+ this._ngModel = _ngModel;
59
+ this.fsModelChange = new EventEmitter();
60
+ this._destroy$ = new Subject();
61
+ }
62
+ ngOnInit() {
63
+ this._ngModel.update
64
+ .pipe(debounceTime(this.fsModelChangeOptions?.debounce || 500), takeUntil(this._destroy$))
65
+ .subscribe((value) => {
66
+ this.fsModelChange.emit(value);
67
+ });
68
+ }
69
+ ngOnDestroy() {
70
+ this._destroy$.next();
71
+ this._destroy$.complete();
72
+ }
73
+ }
74
+ FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
75
+ FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, decorators: [{
77
+ type: Directive,
78
+ args: [{
79
+ selector: '[fsModelChange]',
80
+ }]
81
+ }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
82
+ type: Input
83
+ }], fsModelChange: [{
84
+ type: Output
85
85
  }] } });
86
86
 
87
- class FsPreventDefaultDirective {
88
- preventClick(event) {
89
- event.preventDefault();
90
- }
91
- }
92
- FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
- FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
95
- type: Directive,
96
- args: [{
97
- selector: '[fsPreventDefault]',
98
- }]
99
- }], propDecorators: { preventClick: [{
100
- type: HostListener,
101
- args: ['click', ['$event']]
87
+ class FsPreventDefaultDirective {
88
+ preventClick(event) {
89
+ event.preventDefault();
90
+ }
91
+ }
92
+ FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
+ FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
95
+ type: Directive,
96
+ args: [{
97
+ selector: '[fsPreventDefault]',
98
+ }]
99
+ }], propDecorators: { preventClick: [{
100
+ type: HostListener,
101
+ args: ['click', ['$event']]
102
102
  }] } });
103
103
 
104
- class FsStopPropagationDirective {
105
- preventClick(event) {
106
- event.stopPropagation();
107
- }
108
- }
109
- FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
110
- FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
112
- type: Directive,
113
- args: [{
114
- selector: '[fsStopPropagation]',
115
- }]
116
- }], propDecorators: { preventClick: [{
117
- type: HostListener,
118
- args: ['click', ['$event']]
104
+ class FsStopPropagationDirective {
105
+ preventClick(event) {
106
+ event.stopPropagation();
107
+ }
108
+ }
109
+ FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
110
+ FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
112
+ type: Directive,
113
+ args: [{
114
+ selector: '[fsStopPropagation]',
115
+ }]
116
+ }], propDecorators: { preventClick: [{
117
+ type: HostListener,
118
+ args: ['click', ['$event']]
119
119
  }] } });
120
120
 
121
- function stringify(value) {
122
- return JSON.stringify(value);
123
- }
124
-
125
- function guid(pattern, options = { case: 'lower', numbers: true }) {
126
- pattern = pattern || 'xxxxxx';
127
- let s = '';
128
- if (options.numbers !== false) {
129
- s = '0123456789';
130
- }
131
- if (!options.case || options.case === 'lower' || options.case === 'mixed') {
132
- s = s.concat('abcdefghijklmnopqrstuvwxyz');
133
- }
134
- if (options.case === 'upper' || options.case === 'mixed') {
135
- s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
136
- }
137
- const chars = s.match(/(.{1,1})/g);
138
- return pattern.replace(/[x]/g, function (c) {
139
- const i = (Math.random() * chars.length) | 0;
140
- return chars[i];
141
- });
142
- }
143
-
144
- function isEmpty(value, options) {
145
- options = options || {};
146
- return value === undefined ||
147
- value === null ||
148
- value === false ||
149
- value === '' ||
150
- String(value).length === 0 ||
151
- (Array.isArray(value) && value.length === 0) ||
152
- (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
153
- (!options.zero && (value === 0 || value === '0'));
154
- }
155
-
156
- class FsUtilStringifyPipe {
157
- constructor() { }
158
- transform(value) {
159
- return stringify(value);
160
- }
161
- }
162
- FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
163
- FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
165
- type: Pipe,
166
- args: [{
167
- name: 'fsUtilStringify'
168
- }]
169
- }], ctorParameters: function () { return []; } });
170
- class FsUtilGuidPipe {
171
- constructor() { }
172
- transform() {
173
- return guid();
174
- }
175
- }
176
- FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
177
- FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
179
- type: Pipe,
180
- args: [{
181
- name: 'fsUtilGuid'
182
- }]
183
- }], ctorParameters: function () { return []; } });
184
- class FsUtilIsEmptyPipe {
185
- transform(value) {
186
- return isEmpty(value);
187
- }
188
- }
189
- FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
190
- FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
192
- type: Pipe,
193
- args: [{
194
- name: 'fsUtilIsEmpty'
195
- }]
196
- }] });
197
- class FsUtilIsNotEmptyPipe {
198
- transform(value) {
199
- return !isEmpty(value);
200
- }
201
- }
202
- FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
203
- FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
205
- type: Pipe,
206
- args: [{
207
- name: 'fsUtilIsNotEmpty'
208
- }]
121
+ function guid(pattern, options = { case: 'lower', numbers: true }) {
122
+ pattern = pattern || 'xxxxxx';
123
+ let s = '';
124
+ if (options.numbers !== false) {
125
+ s = '0123456789';
126
+ }
127
+ if (!options.case || options.case === 'lower' || options.case === 'mixed') {
128
+ s = s.concat('abcdefghijklmnopqrstuvwxyz');
129
+ }
130
+ if (options.case === 'upper' || options.case === 'mixed') {
131
+ s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
132
+ }
133
+ const chars = s.match(/(.{1,1})/g);
134
+ return pattern.replace(/[x]/g, function (c) {
135
+ const i = (Math.random() * chars.length) | 0;
136
+ return chars[i];
137
+ });
138
+ }
139
+
140
+ function isEmpty(value, options) {
141
+ options = options || {};
142
+ return value === undefined ||
143
+ value === null ||
144
+ value === false ||
145
+ value === '' ||
146
+ String(value).length === 0 ||
147
+ (Array.isArray(value) && value.length === 0) ||
148
+ (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
149
+ (!options.zero && (value === 0 || value === '0'));
150
+ }
151
+
152
+ function stringify(value) {
153
+ return JSON.stringify(value);
154
+ }
155
+
156
+ class FsUtilStringifyPipe {
157
+ constructor() { }
158
+ transform(value) {
159
+ return stringify(value);
160
+ }
161
+ }
162
+ FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
163
+ FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
165
+ type: Pipe,
166
+ args: [{
167
+ name: 'fsUtilStringify',
168
+ }]
169
+ }], ctorParameters: function () { return []; } });
170
+ class FsUtilGuidPipe {
171
+ constructor() { }
172
+ transform() {
173
+ return guid();
174
+ }
175
+ }
176
+ FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
177
+ FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
179
+ type: Pipe,
180
+ args: [{
181
+ name: 'fsUtilGuid',
182
+ }]
183
+ }], ctorParameters: function () { return []; } });
184
+ class FsUtilIsEmptyPipe {
185
+ transform(value) {
186
+ return isEmpty(value);
187
+ }
188
+ }
189
+ FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
190
+ FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
192
+ type: Pipe,
193
+ args: [{
194
+ name: 'fsUtilIsEmpty',
195
+ }]
196
+ }] });
197
+ class FsUtilIsNotEmptyPipe {
198
+ transform(value) {
199
+ return !isEmpty(value);
200
+ }
201
+ }
202
+ FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
203
+ FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
205
+ type: Pipe,
206
+ args: [{
207
+ name: 'fsUtilIsNotEmpty',
208
+ }]
209
209
  }] });
210
210
 
211
- function email(value) {
212
- return !!String(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
213
- }
214
-
215
- function phone(value) {
216
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
217
- return valid || !String(value).length;
218
- }
219
-
220
- /**
221
- * Check validity of the url.
222
- * Protocol (http/https) isn't required.
223
- * @param value
224
- * @returns {boolean}
225
- */
226
- function url(value) {
227
- const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
228
- const regexp = new RegExp(expression);
229
- return !!String(value).match(regexp);
230
- }
231
-
232
- function compare(query, item) {
233
- let value = true;
234
- for (const key in query) {
235
- value = value && item[key] == query[key];
236
- }
237
- return value;
238
- }
239
-
240
- function filter(array, query) {
241
- if (typeof query !== 'function') {
242
- const queryObj = query;
243
- query = (item) => {
244
- return compare(queryObj, item);
245
- };
246
- }
247
- const isarray = Array.isArray(array);
248
- const list = isarray ? [] : {};
249
- if (isarray) {
250
- array.forEach(function (item, idx) {
251
- if (query(item)) {
252
- list.push(item);
253
- }
254
- });
255
- }
256
- else {
257
- Object.keys(array).forEach(key => {
258
- if (query(array[key])) {
259
- list[key] = array[key];
260
- }
261
- });
262
- }
263
- return list;
264
- }
265
-
266
- function inArray(values, array) {
267
- if (!Array.isArray(values)) {
268
- values = [values];
269
- }
270
- for (let i = 0, len = values.length; i < len; i++) {
271
- if (array.indexOf(values[i]) >= 0) {
272
- return true;
273
- }
274
- }
275
- return false;
276
- }
277
-
278
- function index(array, name, value = null) {
279
- const list = {};
280
- array.forEach(function (item) {
281
- list[item[name]] = value ? item[value] : item;
282
- });
283
- return list;
284
- }
285
-
286
- function indexOf(array, query) {
287
- if (typeof query !== 'function') {
288
- const queryObj = query;
289
- query = (item) => {
290
- return compare(queryObj, item);
291
- };
292
- }
293
- for (let i = 0, len = array.length; i < len; i++) {
294
- if (query(array[i])) {
295
- return i;
296
- }
297
- }
298
- return -1;
299
- }
300
-
301
- function keyExists(array, key) {
302
- return array.hasOwnProperty(key);
303
- }
304
-
305
- function ksort(unordered) {
306
- Object.keys(unordered).sort().forEach(function (key) {
307
- const value = unordered[key];
308
- delete unordered[key];
309
- unordered[key] = value;
310
- });
311
- }
312
-
313
- function list(array, property, index = null) {
314
- const resultList = index ? {} : [];
315
- array.forEach(function (item, idx) {
316
- if (index) {
317
- resultList[item[index]] = item[property];
318
- }
319
- else {
320
- resultList.push(item[property]);
321
- }
322
- });
323
- return resultList;
324
- }
325
-
326
- function nameValue(array, name, value) {
327
- const list = [];
328
- if (name || value) {
329
- const nameFn = typeof name === 'function' ? name : function (item) {
330
- return item[name];
331
- };
332
- const valueFn = typeof value === 'function' ? value : function (item) {
333
- return item[value];
334
- };
335
- array.forEach(function (item) {
336
- list.push({ name: nameFn(item), value: valueFn(item) });
337
- });
338
- }
339
- else {
340
- array.forEach(function (n, v) {
341
- list.push({ name: n, value: v });
342
- });
343
- }
344
- return list;
345
- }
346
-
347
- function remove(array, query) {
348
- const idx = indexOf(array, query);
349
- if (idx >= 0) {
350
- return array.splice(idx, 1);
351
- }
352
- return idx;
353
- }
354
-
355
- function sort(array, query, reverse = false) {
356
- if (typeof query !== 'function') {
357
- const queryStr = query;
358
- query = function (a, b) {
359
- if (reverse) {
360
- if (a[queryStr] < b[queryStr]) {
361
- return 1;
362
- }
363
- else if (a[queryStr] > b[queryStr]) {
364
- return -1;
365
- }
366
- }
367
- else {
368
- if (a[queryStr] > b[queryStr]) {
369
- return 1;
370
- }
371
- else if (a[queryStr] < b[queryStr]) {
372
- return -1;
373
- }
374
- }
375
- return 0;
376
- };
377
- }
378
- array.sort(query);
379
- return array;
380
- }
381
-
382
- function rsort(array, query) {
383
- return sort(array, query, true);
384
- }
385
-
386
- function find(array, query) {
387
- const data = filter(array, query);
388
- return data.length ? data[0] : null;
389
- }
390
-
391
- function boolean(value) {
392
- return String(value).toLowerCase() !== 'false' && !!value;
393
- }
394
-
395
- function debounce(func, wait, immediate) {
396
- let timeout;
397
- return function () {
398
- const context = this, args = arguments;
399
- const later = function () {
400
- timeout = null;
401
- if (!immediate)
402
- func.apply(context, args);
403
- };
404
- const callNow = immediate && !timeout;
405
- clearTimeout(timeout);
406
- timeout = setTimeout(later, wait);
407
- if (callNow)
408
- func.apply(context, args);
409
- };
410
- }
411
-
412
- const KEY_CANCEL$1 = 3;
413
- const KEY_HELP$1 = 6;
414
- const KEY_BACKSPACE$1 = 8;
415
- const KEY_TAB$1 = 9;
416
- const KEY_CLEAR$1 = 12;
417
- const KEY_RETURN$1 = 13;
418
- const KEY_ENTER$1 = 14;
419
- const KEY_SHIFT$1 = 16;
420
- const KEY_CONTROL$1 = 17;
421
- const KEY_ALT$1 = 18;
422
- const KEY_PAUSE$1 = 19;
423
- const KEY_CAPS_LOCK$1 = 20;
424
- const KEY_ESCAPE$1 = 27;
425
- const KEY_SPACE$1 = 32;
426
- const KEY_PAGE_UP$1 = 33;
427
- const KEY_PAGE_DOWN$1 = 34;
428
- const KEY_END$1 = 35;
429
- const KEY_HOME$1 = 36;
430
- const KEY_LEFT$1 = 37;
431
- const KEY_UP$1 = 38;
432
- const KEY_RIGHT$1 = 39;
433
- const KEY_DOWN$1 = 40;
434
- const KEY_PRINTSCREEN$1 = 44;
435
- const KEY_INSERT$1 = 45;
436
- const KEY_DELETE$1 = 46;
437
- const KEY_0$1 = 48;
438
- const KEY_1$1 = 49;
439
- const KEY_2$1 = 50;
440
- const KEY_3$1 = 51;
441
- const KEY_4$1 = 52;
442
- const KEY_5$1 = 53;
443
- const KEY_6$1 = 54;
444
- const KEY_7$1 = 55;
445
- const KEY_8$1 = 56;
446
- const KEY_9$1 = 57;
447
- const KEY_SEMICOLON$1 = 59;
211
+ function compare(query, item) {
212
+ let value = true;
213
+ for (const key in query) {
214
+ value = value && item[key] == query[key];
215
+ }
216
+ return value;
217
+ }
218
+
219
+ function filter(array, query) {
220
+ if (typeof query !== 'function') {
221
+ const queryObj = query;
222
+ query = (item) => {
223
+ return compare(queryObj, item);
224
+ };
225
+ }
226
+ const isarray = Array.isArray(array);
227
+ const list = isarray ? [] : {};
228
+ if (isarray) {
229
+ array.forEach(function (item, idx) {
230
+ if (query(item)) {
231
+ list.push(item);
232
+ }
233
+ });
234
+ }
235
+ else {
236
+ Object.keys(array).forEach(key => {
237
+ if (query(array[key])) {
238
+ list[key] = array[key];
239
+ }
240
+ });
241
+ }
242
+ return list;
243
+ }
244
+
245
+ function inArray(values, array) {
246
+ if (!Array.isArray(values)) {
247
+ values = [values];
248
+ }
249
+ for (let i = 0, len = values.length; i < len; i++) {
250
+ if (array.indexOf(values[i]) >= 0) {
251
+ return true;
252
+ }
253
+ }
254
+ return false;
255
+ }
256
+
257
+ function index(array, name, value = null) {
258
+ const list = {};
259
+ array.forEach(function (item) {
260
+ list[item[name]] = value ? item[value] : item;
261
+ });
262
+ return list;
263
+ }
264
+
265
+ function indexOf(array, query) {
266
+ if (typeof query !== 'function') {
267
+ const queryObj = query;
268
+ query = (item) => {
269
+ return compare(queryObj, item);
270
+ };
271
+ }
272
+ for (let i = 0, len = array.length; i < len; i++) {
273
+ if (query(array[i])) {
274
+ return i;
275
+ }
276
+ }
277
+ return -1;
278
+ }
279
+
280
+ function keyExists(array, key) {
281
+ return array.hasOwnProperty(key);
282
+ }
283
+
284
+ function ksort(unordered) {
285
+ Object.keys(unordered).sort().forEach(function (key) {
286
+ const value = unordered[key];
287
+ delete unordered[key];
288
+ unordered[key] = value;
289
+ });
290
+ }
291
+
292
+ function list(array, property, index = null) {
293
+ const resultList = index ? {} : [];
294
+ array.forEach(function (item, idx) {
295
+ if (index) {
296
+ resultList[item[index]] = item[property];
297
+ }
298
+ else {
299
+ resultList.push(item[property]);
300
+ }
301
+ });
302
+ return resultList;
303
+ }
304
+
305
+ function nameValue(array, name, value) {
306
+ const list = [];
307
+ if (name || value) {
308
+ const nameFn = typeof name === 'function' ? name : function (item) {
309
+ return item[name];
310
+ };
311
+ const valueFn = typeof value === 'function' ? value : function (item) {
312
+ return item[value];
313
+ };
314
+ array.forEach(function (item) {
315
+ list.push({ name: nameFn(item), value: valueFn(item) });
316
+ });
317
+ }
318
+ else {
319
+ array.forEach(function (n, v) {
320
+ list.push({ name: n, value: v });
321
+ });
322
+ }
323
+ return list;
324
+ }
325
+
326
+ function remove(array, query) {
327
+ const idx = indexOf(array, query);
328
+ if (idx >= 0) {
329
+ return array.splice(idx, 1);
330
+ }
331
+ return idx;
332
+ }
333
+
334
+ function sort(array, query, reverse = false) {
335
+ if (typeof query !== 'function') {
336
+ const queryStr = query;
337
+ query = function (a, b) {
338
+ if (reverse) {
339
+ if (a[queryStr] < b[queryStr]) {
340
+ return 1;
341
+ }
342
+ else if (a[queryStr] > b[queryStr]) {
343
+ return -1;
344
+ }
345
+ }
346
+ else {
347
+ if (a[queryStr] > b[queryStr]) {
348
+ return 1;
349
+ }
350
+ else if (a[queryStr] < b[queryStr]) {
351
+ return -1;
352
+ }
353
+ }
354
+ return 0;
355
+ };
356
+ }
357
+ array.sort(query);
358
+ return array;
359
+ }
360
+
361
+ function rsort(array, query) {
362
+ return sort(array, query, true);
363
+ }
364
+
365
+ function find(array, query) {
366
+ const data = filter(array, query);
367
+ return data.length ? data[0] : null;
368
+ }
369
+
370
+ function boolean(value) {
371
+ return String(value).toLowerCase() !== 'false' && !!value;
372
+ }
373
+
374
+ function clone(obj) {
375
+ if (obj instanceof Date) {
376
+ return new Date(obj);
377
+ }
378
+ else if (Array.isArray(obj)) {
379
+ const arr = [];
380
+ for (let i = 0; i < obj.length; i++) {
381
+ arr[i] = clone(obj[i]);
382
+ }
383
+ return arr;
384
+ }
385
+ else if (typeof (obj) === 'object') {
386
+ const cloned = {};
387
+ for (let key in obj) {
388
+ cloned[key] = clone(obj[key]);
389
+ }
390
+ return cloned;
391
+ }
392
+ return obj;
393
+ }
394
+
395
+ function debounce(func, wait, immediate) {
396
+ let timeout;
397
+ return function () {
398
+ const context = this, args = arguments;
399
+ const later = function () {
400
+ timeout = null;
401
+ if (!immediate)
402
+ func.apply(context, args);
403
+ };
404
+ const callNow = immediate && !timeout;
405
+ clearTimeout(timeout);
406
+ timeout = setTimeout(later, wait);
407
+ if (callNow)
408
+ func.apply(context, args);
409
+ };
410
+ }
411
+
412
+ function removeQueryParams(path) {
413
+ return path.split('?')[0];
414
+ }
415
+
416
+ function getNormalizedPath(locationSrv) {
417
+ const path = locationSrv.prepareExternalUrl(locationSrv.path());
418
+ return removeQueryParams(path);
419
+ }
420
+
421
+ function isArrayEqual(arr1, arr2) {
422
+ if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
423
+ return false;
424
+ }
425
+ const sortFn = (a, b) => {
426
+ if (a < b) {
427
+ return -1;
428
+ }
429
+ else if (a > b) {
430
+ return 1;
431
+ }
432
+ else {
433
+ return 0;
434
+ }
435
+ };
436
+ arr1 = [...arr1].sort(sortFn);
437
+ arr2 = [...arr2].sort(sortFn);
438
+ return arr1.every((value, index) => {
439
+ return value === arr2[index];
440
+ });
441
+ }
442
+
443
+ function isClass(value, cls) {
444
+ if (typeof value === 'object') {
445
+ if (typeof cls === 'string') {
446
+ if (value.constructor) {
447
+ if (value.constructor.name === cls) {
448
+ return true;
449
+ }
450
+ }
451
+ }
452
+ else {
453
+ if (value instanceof cls) {
454
+ return true;
455
+ }
456
+ }
457
+ }
458
+ return false;
459
+ }
460
+
461
+ function isNumeric(value) {
462
+ const str = String(value);
463
+ return str.length && !!str.match(/^-?\d*\.?\d*$/);
464
+ }
465
+
466
+ function isObject(value) {
467
+ return !!value && typeof value === 'object' && !Array.isArray(value);
468
+ }
469
+
470
+ const KEY_CANCEL$1 = 3;
471
+ const KEY_HELP$1 = 6;
472
+ const KEY_BACKSPACE$1 = 8;
473
+ const KEY_TAB$1 = 9;
474
+ const KEY_CLEAR$1 = 12;
475
+ const KEY_RETURN$1 = 13;
476
+ const KEY_ENTER$1 = 14;
477
+ const KEY_SHIFT$1 = 16;
478
+ const KEY_CONTROL$1 = 17;
479
+ const KEY_ALT$1 = 18;
480
+ const KEY_PAUSE$1 = 19;
481
+ const KEY_CAPS_LOCK$1 = 20;
482
+ const KEY_ESCAPE$1 = 27;
483
+ const KEY_SPACE$1 = 32;
484
+ const KEY_PAGE_UP$1 = 33;
485
+ const KEY_PAGE_DOWN$1 = 34;
486
+ const KEY_END$1 = 35;
487
+ const KEY_HOME$1 = 36;
488
+ const KEY_LEFT$1 = 37;
489
+ const KEY_UP$1 = 38;
490
+ const KEY_RIGHT$1 = 39;
491
+ const KEY_DOWN$1 = 40;
492
+ const KEY_PRINTSCREEN$1 = 44;
493
+ const KEY_INSERT$1 = 45;
494
+ const KEY_DELETE$1 = 46;
495
+ const KEY_0$1 = 48;
496
+ const KEY_1$1 = 49;
497
+ const KEY_2$1 = 50;
498
+ const KEY_3$1 = 51;
499
+ const KEY_4$1 = 52;
500
+ const KEY_5$1 = 53;
501
+ const KEY_6$1 = 54;
502
+ const KEY_7$1 = 55;
503
+ const KEY_8$1 = 56;
504
+ const KEY_9$1 = 57;
505
+ const KEY_SEMICOLON$1 = 59;
448
506
  const KEY_EQUALS$1 = 61;
449
507
 
450
- function length(object) {
451
- if (Array.isArray(object)) {
452
- return object.length;
453
- }
454
- if (object instanceof Object) {
455
- return Object.keys(object).length;
456
- }
457
- return 0;
458
- }
459
-
460
- function resolve(promise, defaults = []) {
461
- const result = defaults;
462
- return new Promise(resolve => {
463
- promise.then(function (data) {
464
- Object.keys(data).forEach(key => result[key] = data[key]);
465
- resolve(result);
466
- });
467
- });
468
- }
469
-
470
- function uuid() {
471
- return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
472
- }
473
-
474
- function value(object, key, def) {
475
- if (typeof object === 'object' || Array.isArray(object)) {
476
- if (object.hasOwnProperty(key)) {
477
- return object[key];
478
- }
479
- }
480
- return def;
481
- }
482
-
483
- function isClass(value, cls) {
484
- if (typeof value === 'object') {
485
- if (typeof cls === 'string') {
486
- if (value.constructor) {
487
- if (value.constructor.name === cls) {
488
- return true;
489
- }
490
- }
491
- }
492
- else {
493
- if (value instanceof cls) {
494
- return true;
495
- }
496
- }
497
- }
498
- return false;
499
- }
500
-
501
- function isNumeric(value) {
502
- const str = String(value);
503
- return str.length && !!str.match(/^-?\d*\.?\d*$/);
504
- }
505
-
506
- function isObject(value) {
507
- return !!value && typeof value === 'object' && !Array.isArray(value);
508
- }
509
-
510
- function throttle(func, wait) {
511
- let waiting = false; // Initially, we're not waiting
512
- return function () {
513
- if (!waiting) { // If we're not waiting
514
- func.apply(null, arguments); // Execute users function
515
- waiting = true; // Prevent future invocations
516
- setTimeout(function () {
517
- waiting = false; // And allow future invocations
518
- }, wait);
519
- }
520
- };
521
- }
522
-
523
- class Operation {
524
- constructor(target, name) {
525
- this.ready$ = new Subject();
526
- this.name = name ? name : guid();
527
- if (target instanceof Observable) {
528
- this.target = target;
529
- }
530
- else {
531
- this.target = of(target);
532
- }
533
- }
534
- }
535
-
536
- var QueueState;
537
- (function (QueueState) {
538
- QueueState["Idle"] = "idle";
539
- QueueState["Processing"] = "processing";
508
+ function length(object) {
509
+ if (Array.isArray(object)) {
510
+ return object.length;
511
+ }
512
+ if (object instanceof Object) {
513
+ return Object.keys(object).length;
514
+ }
515
+ return 0;
516
+ }
517
+
518
+ function ordinalNumber(value) {
519
+ value = String(value);
520
+ const index = value.match `1?.$`;
521
+ const endings = [, 'st', 'nd', 'rd'];
522
+ const ending = endings[index] || 'th';
523
+ return value + ending;
524
+ }
525
+
526
+ class Operation {
527
+ constructor(target, name) {
528
+ this.ready$ = new Subject();
529
+ this.name = name ? name : guid();
530
+ if (target instanceof Observable) {
531
+ this.target = target;
532
+ }
533
+ else {
534
+ this.target = of(target);
535
+ }
536
+ }
537
+ }
538
+
539
+ var QueueState;
540
+ (function (QueueState) {
541
+ QueueState["Idle"] = "idle";
542
+ QueueState["Processing"] = "processing";
540
543
  })(QueueState || (QueueState = {}));
541
544
 
542
- class Queue {
543
- constructor(_limit = Infinity) {
544
- this._limit = _limit;
545
- this._queueStats = {
546
- completed: 0,
547
- total: 0,
548
- errors: [],
549
- };
550
- this._doneQueueStats = {
551
- completed: 0,
552
- total: 0,
553
- errors: [],
554
- };
555
- this._completeQueueStats = {
556
- completed: 0,
557
- total: 0,
558
- errors: [],
559
- };
560
- this._done = new Subject();
561
- this._queue = [];
562
- this._inProgress = [];
563
- this._state = QueueState.Idle;
564
- this._destroy$ = new Subject();
565
- // if(_targets) {
566
- // _targets.forEach((target) => {
567
- // this.push(target);
568
- // });
569
- // }
570
- }
571
- get total() {
572
- return this._queueStats.total;
573
- }
574
- get completed() {
575
- return this._queueStats.completed;
576
- }
577
- get pending() {
578
- return this._queue.length;
579
- }
580
- get inProgress() {
581
- return this._inProgress.length;
582
- }
583
- get errors() {
584
- return this._queueStats.errors;
585
- }
586
- get state() {
587
- return this._state;
588
- }
589
- get empty() {
590
- return !this._queue.length && !this._inProgress.length;
591
- }
592
- get pendingOperations() {
593
- return this._queue
594
- .map((operation) => operation.name);
595
- }
596
- get inProgressOperations() {
597
- return this._inProgress
598
- .map((operation) => operation.name);
599
- }
600
- isProcessing() {
601
- return this._state === QueueState.Processing;
602
- }
603
- isIdle() {
604
- return this._state === QueueState.Idle;
605
- }
606
- setLimit(value) {
607
- this._limit = value;
608
- }
609
- /**
610
- * @depreated
611
- */
612
- subscribe(fun, err, complete) {
613
- this.observe$
614
- .subscribe(fun, err, complete);
615
- }
616
- get observe$() {
617
- return this._done
618
- .pipe(takeUntil(this._destroy$));
619
- }
620
- get complete$() {
621
- if (!this.isProcessing()) {
622
- return of({ total: 0, completed: 0, errors: [] });
623
- }
624
- return this.observe$
625
- .pipe(take(1), map(() => (this._completeQueueStats)));
626
- }
627
- complete(fun, err, complete) {
628
- this.complete$.subscribe(fun, err, complete);
629
- }
630
- push(target, name) {
631
- const operation = new Operation(target, name);
632
- this._queueStats.total++;
633
- this._doneQueueStats.total++;
634
- this._completeQueueStats.total++;
635
- this._state = QueueState.Processing;
636
- if (this._inProgress.length < this._limit) {
637
- this._processOperation(operation);
638
- }
639
- else {
640
- this._queue.push(operation);
641
- }
642
- return operation.ready$;
643
- }
644
- clear() {
645
- this._queue = [];
646
- this._state = QueueState.Idle;
647
- this._queueStats = {
648
- total: 0,
649
- errors: [],
650
- completed: 0,
651
- };
652
- this._clearDoneQueueStats();
653
- }
654
- destroy() {
655
- this._done.complete();
656
- this.clear();
657
- }
658
- _processOperation(operation) {
659
- this._inProgress.push(operation);
660
- operation.target
661
- .pipe(delay(200), // Hack to prevent extra quick proccess execution
662
- finalize(() => {
663
- const opIndex = this._inProgress.indexOf(operation);
664
- this._inProgress.splice(opIndex, 1);
665
- if (this.empty) {
666
- this._state = QueueState.Idle;
667
- this._done.next(this._doneQueueStats);
668
- this._clearDoneQueueStats();
669
- }
670
- else {
671
- if (this._queue.length) {
672
- const queueItem = this._queue.shift();
673
- this._processOperation(queueItem);
674
- }
675
- }
676
- }), takeUntil(this._destroy$)).subscribe({
677
- next: (data) => {
678
- operation.ready$.next(data);
679
- },
680
- error: (error) => {
681
- this._queueStats.errors.push(error);
682
- this._doneQueueStats.errors.push(error);
683
- this._completeQueueStats.errors.push(error);
684
- operation.ready$.error(error);
685
- },
686
- complete: () => {
687
- this._queueStats.completed++;
688
- this._doneQueueStats.completed++;
689
- this._completeQueueStats.completed++;
690
- operation.ready$.complete();
691
- }
692
- });
693
- }
694
- _clearDoneQueueStats() {
695
- this._doneQueueStats = {
696
- total: 0,
697
- errors: [],
698
- completed: 0,
699
- };
700
- }
701
- }
702
-
703
- function removeQueryParams(path) {
704
- return path.split('?')[0];
705
- }
706
-
707
- function getNormalizedPath(locationSrv) {
708
- const path = locationSrv.prepareExternalUrl(locationSrv.path());
709
- return removeQueryParams(path);
710
- }
711
-
712
- function ordinalNumber(value) {
713
- value = String(value);
714
- const index = value.match `1?.$`;
715
- const endings = [, 'st', 'nd', 'rd'];
716
- const ending = endings[index] || 'th';
717
- return value + ending;
718
- }
719
-
720
- function round(num, decimalPlaces = 0) {
721
- num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
722
- const p = Math.pow(10, decimalPlaces);
723
- return Math.round(num * p) / p;
724
- }
725
-
726
- function clone(obj) {
727
- if (obj instanceof Date) {
728
- return new Date(obj);
729
- }
730
- else if (Array.isArray(obj)) {
731
- const arr = [];
732
- for (let i = 0; i < obj.length; i++) {
733
- arr[i] = clone(obj[i]);
734
- }
735
- return arr;
736
- }
737
- else if (typeof (obj) === 'object') {
738
- const cloned = {};
739
- for (let key in obj) {
740
- cloned[key] = clone(obj[key]);
741
- }
742
- return cloned;
743
- }
744
- return obj;
745
- }
746
-
747
- function toString(value) {
748
- if (value === null || value === undefined) {
749
- return '';
750
- }
751
- return `${value}`;
752
- }
753
-
754
- function isArrayEqual(arr1, arr2) {
755
- if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
756
- return false;
757
- }
758
- const sortFn = (a, b) => {
759
- if (a < b) {
760
- return -1;
761
- }
762
- else if (a > b) {
763
- return 1;
764
- }
765
- else {
766
- return 0;
767
- }
768
- };
769
- arr1 = [...arr1].sort(sortFn);
770
- arr2 = [...arr2].sort(sortFn);
771
- return arr1.every((value, index) => {
772
- return value === arr2[index];
773
- });
774
- }
775
-
776
- const fsSourceLoader = (function () {
777
- let _document;
778
- let _headElement;
779
- const _sources = new Map();
780
- const _loadedResources = new Map();
781
- // bad way but don't want to bother developer
782
- setDocument(document);
783
- // but developer can set document at any time
784
- function setDocument(document) {
785
- _document = document;
786
- _headElement = _document === null || _document === void 0 ? void 0 : _document.head;
787
- }
788
- /**
789
- * register a list of the resources for future loading
790
- *
791
- * example:
792
- * sourceLoader.registerResources({
793
- * froala: [
794
- * '/assets/js/froala/froala_editor.min.js',
795
- * '/assets/css/froala_editor.pkgd.min.css',
796
- * ],
797
- * froala_align: '/assets/js/froala/plugins/align.min.js',
798
- * froala_colors: '/assets/js/froala/plugins/colors.min.js',
799
- * froala_image: '/assets/js/froala/plugins/image.min.js',
800
- * });
801
- *
802
- */
803
- function registerResources(resources) {
804
- Object.entries(resources)
805
- .forEach(([name, path]) => {
806
- if (typeof path === 'string') {
807
- path = [path];
808
- }
809
- if (!_sources.has(name)) {
810
- _sources.set(name, new Set());
811
- }
812
- const resourcesList = _sources.get(name);
813
- path.forEach((p) => {
814
- resourcesList.add(p);
815
- });
816
- });
817
- }
818
- /**
819
- * load any resource previously registered
820
- *
821
- * sourceLoader.loadResource('froala')
822
- *
823
- * or load any js/css file
824
- *
825
- * sourceLoader.loadResource('/assets/my-source.js')
826
- *
827
- */
828
- function loadResource(name) {
829
- if (_loadedResources.has(name)) {
830
- return _loadedResources.get(name);
831
- }
832
- if (_sources.has(name)) {
833
- const sourcesForLoading = [..._sources.get(name)]
834
- .map((path) => {
835
- return _loadResource(path);
836
- })
837
- .filter((v) => !!v);
838
- return combineLatest(sourcesForLoading);
839
- }
840
- return _loadResource(name);
841
- }
842
- /**
843
- * the same as `loadResource` but you can pass list of the resources for loading
844
- */
845
- function loadResources(listOfResources) {
846
- const resourcesToLoad = listOfResources
847
- .reduce((acc, name) => {
848
- const loading$ = loadResource(name);
849
- if (loading$) {
850
- acc.push(loading$);
851
- }
852
- return acc;
853
- }, []);
854
- return combineLatest(resourcesToLoad);
855
- }
856
- ///
857
- function _loadResource(path) {
858
- if (_isStylesUrl(path)) {
859
- return _loadStyles(path);
860
- }
861
- if (_isJavascriptUrl(path)) {
862
- return _loadJs(path);
863
- }
864
- console.warn(`Resource ${path} can not be identified and loaded`);
865
- return null;
866
- }
867
- function _loadJs(scriptPath) {
868
- if (!_loadedResources.has(scriptPath)) {
869
- const obs$ = new Observable((obs) => {
870
- const script = document.createElement('script');
871
- script.src = scriptPath;
872
- _headElement.appendChild(script);
873
- script.onload = () => {
874
- obs.next();
875
- obs.complete();
876
- };
877
- script.onerror = (err) => {
878
- obs.error(err);
879
- };
880
- }).pipe(shareReplay(1));
881
- _loadedResources.set(scriptPath, obs$);
882
- }
883
- return _loadedResources.get(scriptPath);
884
- }
885
- function _loadStyles(stylePath) {
886
- if (!_loadedResources.has(stylePath)) {
887
- const obs$ = new Observable((obs) => {
888
- const style = document.createElement('link');
889
- style.id = stylePath;
890
- style.rel = 'stylesheet';
891
- style.href = `${stylePath}`;
892
- _headElement.appendChild(style);
893
- style.onload = () => {
894
- obs.next();
895
- obs.complete();
896
- };
897
- style.onerror = (err) => {
898
- obs.error(err);
899
- };
900
- });
901
- _loadedResources.set(stylePath, obs$);
902
- }
903
- return _loadedResources.get(stylePath);
904
- }
905
- function _isJavascriptUrl(url) {
906
- return url.endsWith('.js');
907
- }
908
- function _isStylesUrl(url) {
909
- return url.endsWith('.css');
910
- }
911
- return {
912
- setDocument,
913
- registerResources,
914
- loadResource,
915
- loadResources,
916
- };
545
+ class Queue {
546
+ constructor(_limit = Infinity) {
547
+ this._limit = _limit;
548
+ this._queueStats = {
549
+ completed: 0,
550
+ total: 0,
551
+ errors: [],
552
+ };
553
+ this._doneQueueStats = {
554
+ completed: 0,
555
+ total: 0,
556
+ errors: [],
557
+ };
558
+ this._completeQueueStats = {
559
+ completed: 0,
560
+ total: 0,
561
+ errors: [],
562
+ };
563
+ this._done = new Subject();
564
+ this._queue = [];
565
+ this._inProgress = [];
566
+ this._state = QueueState.Idle;
567
+ this._destroy$ = new Subject();
568
+ // if(_targets) {
569
+ // _targets.forEach((target) => {
570
+ // this.push(target);
571
+ // });
572
+ // }
573
+ }
574
+ get total() {
575
+ return this._queueStats.total;
576
+ }
577
+ get completed() {
578
+ return this._queueStats.completed;
579
+ }
580
+ get pending() {
581
+ return this._queue.length;
582
+ }
583
+ get inProgress() {
584
+ return this._inProgress.length;
585
+ }
586
+ get errors() {
587
+ return this._queueStats.errors;
588
+ }
589
+ get state() {
590
+ return this._state;
591
+ }
592
+ get empty() {
593
+ return !this._queue.length && !this._inProgress.length;
594
+ }
595
+ get pendingOperations() {
596
+ return this._queue
597
+ .map((operation) => operation.name);
598
+ }
599
+ get inProgressOperations() {
600
+ return this._inProgress
601
+ .map((operation) => operation.name);
602
+ }
603
+ isProcessing() {
604
+ return this._state === QueueState.Processing;
605
+ }
606
+ isIdle() {
607
+ return this._state === QueueState.Idle;
608
+ }
609
+ setLimit(value) {
610
+ this._limit = value;
611
+ }
612
+ /**
613
+ * @depreated
614
+ */
615
+ subscribe(fun, err, complete) {
616
+ this.observe$
617
+ .subscribe(fun, err, complete);
618
+ }
619
+ get observe$() {
620
+ return this._done
621
+ .pipe(takeUntil(this._destroy$));
622
+ }
623
+ get complete$() {
624
+ if (!this.isProcessing()) {
625
+ return of({ total: 0, completed: 0, errors: [] });
626
+ }
627
+ return this.observe$
628
+ .pipe(take(1), map(() => (this._completeQueueStats)));
629
+ }
630
+ complete(fun, err, complete) {
631
+ this.complete$.subscribe(fun, err, complete);
632
+ }
633
+ push(target, name) {
634
+ const operation = new Operation(target, name);
635
+ this._queueStats.total++;
636
+ this._doneQueueStats.total++;
637
+ this._completeQueueStats.total++;
638
+ this._state = QueueState.Processing;
639
+ if (this._inProgress.length < this._limit) {
640
+ this._processOperation(operation);
641
+ }
642
+ else {
643
+ this._queue.push(operation);
644
+ }
645
+ return operation.ready$;
646
+ }
647
+ clear() {
648
+ this._queue = [];
649
+ this._state = QueueState.Idle;
650
+ this._queueStats = {
651
+ total: 0,
652
+ errors: [],
653
+ completed: 0,
654
+ };
655
+ this._clearDoneQueueStats();
656
+ }
657
+ destroy() {
658
+ this._done.complete();
659
+ this.clear();
660
+ }
661
+ _processOperation(operation) {
662
+ this._inProgress.push(operation);
663
+ operation.target
664
+ .pipe(delay(200), // Hack to prevent extra quick proccess execution
665
+ finalize(() => {
666
+ const opIndex = this._inProgress.indexOf(operation);
667
+ this._inProgress.splice(opIndex, 1);
668
+ if (this.empty) {
669
+ this._state = QueueState.Idle;
670
+ this._done.next(this._doneQueueStats);
671
+ this._clearDoneQueueStats();
672
+ }
673
+ else {
674
+ if (this._queue.length) {
675
+ const queueItem = this._queue.shift();
676
+ this._processOperation(queueItem);
677
+ }
678
+ }
679
+ }), takeUntil(this._destroy$)).subscribe({
680
+ next: (data) => {
681
+ operation.ready$.next(data);
682
+ },
683
+ error: (error) => {
684
+ this._queueStats.errors.push(error);
685
+ this._doneQueueStats.errors.push(error);
686
+ this._completeQueueStats.errors.push(error);
687
+ operation.ready$.error(error);
688
+ },
689
+ complete: () => {
690
+ this._queueStats.completed++;
691
+ this._doneQueueStats.completed++;
692
+ this._completeQueueStats.completed++;
693
+ operation.ready$.complete();
694
+ }
695
+ });
696
+ }
697
+ _clearDoneQueueStats() {
698
+ this._doneQueueStats = {
699
+ total: 0,
700
+ errors: [],
701
+ completed: 0,
702
+ };
703
+ }
704
+ }
705
+
706
+ function resolve(promise, defaults = []) {
707
+ const result = defaults;
708
+ return new Promise(resolve => {
709
+ promise.then(function (data) {
710
+ Object.keys(data).forEach(key => result[key] = data[key]);
711
+ resolve(result);
712
+ });
713
+ });
714
+ }
715
+
716
+ function round(num, decimalPlaces = 0) {
717
+ num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
718
+ const p = Math.pow(10, decimalPlaces);
719
+ return Math.round(num * p) / p;
720
+ }
721
+
722
+ const fsSourceLoader = (function () {
723
+ let _document;
724
+ let _headElement;
725
+ const _sources = new Map();
726
+ const _loadedResources = new Map();
727
+ // bad way but don't want to bother developer
728
+ setDocument(document);
729
+ // but developer can set document at any time
730
+ function setDocument(document) {
731
+ _document = document;
732
+ _headElement = _document?.head;
733
+ }
734
+ /**
735
+ * register a list of the resources for future loading
736
+ *
737
+ * example:
738
+ * sourceLoader.registerResources({
739
+ * froala: [
740
+ * '/assets/js/froala/froala_editor.min.js',
741
+ * '/assets/css/froala_editor.pkgd.min.css',
742
+ * ],
743
+ * froala_align: '/assets/js/froala/plugins/align.min.js',
744
+ * froala_colors: '/assets/js/froala/plugins/colors.min.js',
745
+ * froala_image: '/assets/js/froala/plugins/image.min.js',
746
+ * });
747
+ *
748
+ */
749
+ function registerResources(resources) {
750
+ Object.entries(resources)
751
+ .forEach(([name, path]) => {
752
+ if (typeof path === 'string') {
753
+ path = [path];
754
+ }
755
+ if (!_sources.has(name)) {
756
+ _sources.set(name, new Set());
757
+ }
758
+ const resourcesList = _sources.get(name);
759
+ path.forEach((p) => {
760
+ resourcesList.add(p);
761
+ });
762
+ });
763
+ }
764
+ /**
765
+ * load any resource previously registered
766
+ *
767
+ * sourceLoader.loadResource('froala')
768
+ *
769
+ * or load any js/css file
770
+ *
771
+ * sourceLoader.loadResource('/assets/my-source.js')
772
+ *
773
+ */
774
+ function loadResource(name) {
775
+ if (_loadedResources.has(name)) {
776
+ return _loadedResources.get(name);
777
+ }
778
+ if (_sources.has(name)) {
779
+ const sourcesForLoading = [..._sources.get(name)]
780
+ .map((path) => {
781
+ return _loadResource(path);
782
+ })
783
+ .filter((v) => !!v);
784
+ return combineLatest(sourcesForLoading);
785
+ }
786
+ return _loadResource(name);
787
+ }
788
+ /**
789
+ * the same as `loadResource` but you can pass list of the resources for loading
790
+ */
791
+ function loadResources(listOfResources) {
792
+ const resourcesToLoad = listOfResources
793
+ .reduce((acc, name) => {
794
+ const loading$ = loadResource(name);
795
+ if (loading$) {
796
+ acc.push(loading$);
797
+ }
798
+ return acc;
799
+ }, []);
800
+ return combineLatest(resourcesToLoad);
801
+ }
802
+ ///
803
+ function _loadResource(path) {
804
+ if (_isStylesUrl(path)) {
805
+ return _loadStyles(path);
806
+ }
807
+ if (_isJavascriptUrl(path)) {
808
+ return _loadJs(path);
809
+ }
810
+ console.warn(`Resource ${path} can not be identified and loaded`);
811
+ return null;
812
+ }
813
+ function _loadJs(scriptPath) {
814
+ if (!_loadedResources.has(scriptPath)) {
815
+ const obs$ = new Observable((obs) => {
816
+ const script = document.createElement('script');
817
+ script.src = scriptPath;
818
+ _headElement.appendChild(script);
819
+ script.onload = () => {
820
+ obs.next();
821
+ obs.complete();
822
+ };
823
+ script.onerror = (err) => {
824
+ obs.error(err);
825
+ };
826
+ }).pipe(shareReplay(1));
827
+ _loadedResources.set(scriptPath, obs$);
828
+ }
829
+ return _loadedResources.get(scriptPath);
830
+ }
831
+ function _loadStyles(stylePath) {
832
+ if (!_loadedResources.has(stylePath)) {
833
+ const obs$ = new Observable((obs) => {
834
+ const style = document.createElement('link');
835
+ style.id = stylePath;
836
+ style.rel = 'stylesheet';
837
+ style.href = `${stylePath}`;
838
+ _headElement.appendChild(style);
839
+ style.onload = () => {
840
+ obs.next();
841
+ obs.complete();
842
+ };
843
+ style.onerror = (err) => {
844
+ obs.error(err);
845
+ };
846
+ });
847
+ _loadedResources.set(stylePath, obs$);
848
+ }
849
+ return _loadedResources.get(stylePath);
850
+ }
851
+ function _isJavascriptUrl(url) {
852
+ return url.endsWith('.js');
853
+ }
854
+ function _isStylesUrl(url) {
855
+ return url.endsWith('.css');
856
+ }
857
+ return {
858
+ setDocument,
859
+ registerResources,
860
+ loadResource,
861
+ loadResources,
862
+ loadJs: _loadJs,
863
+ loadStyles: _loadStyles,
864
+ };
917
865
  })();
866
+ function loadStyles(path) {
867
+ return fsSourceLoader.loadStyles(path);
868
+ }
869
+ ;
870
+ function loadJs(path) {
871
+ return fsSourceLoader.loadJs(path);
872
+ }
873
+ ;
874
+
875
+ function throttle(func, wait) {
876
+ let waiting = false; // Initially, we're not waiting
877
+ return function () {
878
+ if (!waiting) { // If we're not waiting
879
+ func.apply(null, arguments); // Execute users function
880
+ waiting = true; // Prevent future invocations
881
+ setTimeout(function () {
882
+ waiting = false; // And allow future invocations
883
+ }, wait);
884
+ }
885
+ };
886
+ }
918
887
 
919
- function number(value, decimals) {
920
- if (isNumeric(decimals)) {
921
- value = round(value, decimals);
922
- }
923
- return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
924
- }
925
-
926
- function acronym(str, length = 2) {
927
- const splittedString = str
928
- .replace(/[^a-zA-Z0-9]+/g, ' ')
929
- .split(' ');
930
- let result = '';
931
- for (let i = 0; i < length; i++) {
932
- if (!splittedString[i]) {
933
- if (splittedString.length === 1) {
934
- for (let j = 1; j < length; j++) {
935
- if (!splittedString[i - 1][j]) {
936
- break;
937
- }
938
- result += splittedString[i - 1][j].toUpperCase();
939
- }
940
- }
941
- break;
942
- }
943
- result += splittedString[i][0].toUpperCase();
944
- }
945
- return result;
946
- }
947
-
948
- function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
949
- const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
950
- amount = round(amount, digitsInfo[1]);
951
- return new CurrencyPipe(locale)
952
- .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
953
- }
954
-
955
- function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
956
- value = value || '';
957
- if (completeWords) {
958
- limit = value.substr(0, limit).lastIndexOf(' ');
959
- }
960
- let result = `${value.substr(0, limit)}`;
961
- if (result !== value) {
962
- result += ellipsis;
963
- }
964
- return result;
965
- }
966
-
967
- function delayedRetry(delayMs, maxRetry = 5, message) {
968
- let retries = 0;
969
- return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
970
- retries++;
971
- if (retries <= maxRetry) {
972
- console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
973
- }
974
- }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
975
- }
976
- const getErrorMessage = (maxRetry, defaultMessage) => {
977
- if (!defaultMessage) {
978
- return `Failed to load Resource for ${maxRetry} times. Giving up.`;
979
- }
980
- else {
981
- return defaultMessage;
982
- }
888
+ function toString(value) {
889
+ if (value === null || value === undefined) {
890
+ return '';
891
+ }
892
+ return `${value}`;
893
+ }
894
+
895
+ function uuid() {
896
+ return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
897
+ }
898
+
899
+ function value(object, key, def) {
900
+ if (typeof object === 'object' || Array.isArray(object)) {
901
+ if (object.hasOwnProperty(key)) {
902
+ return object[key];
903
+ }
904
+ }
905
+ return def;
906
+ }
907
+
908
+ function number(value, decimals) {
909
+ if (isNumeric(decimals)) {
910
+ value = round(value, decimals);
911
+ }
912
+ return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
913
+ }
914
+
915
+ function acronym(str, length = 2) {
916
+ const splittedString = str
917
+ .replace(/[^a-zA-Z0-9]+/g, ' ')
918
+ .split(' ');
919
+ let result = '';
920
+ for (let i = 0; i < length; i++) {
921
+ if (!splittedString[i]) {
922
+ if (splittedString.length === 1) {
923
+ for (let j = 1; j < length; j++) {
924
+ if (!splittedString[i - 1][j]) {
925
+ break;
926
+ }
927
+ result += splittedString[i - 1][j].toUpperCase();
928
+ }
929
+ }
930
+ break;
931
+ }
932
+ result += splittedString[i][0].toUpperCase();
933
+ }
934
+ return result;
935
+ }
936
+
937
+ function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
938
+ const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
939
+ amount = round(amount, digitsInfo[1]);
940
+ return new CurrencyPipe(locale)
941
+ .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
942
+ }
943
+
944
+ function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
945
+ value = value || '';
946
+ if (completeWords) {
947
+ limit = value.substr(0, limit).lastIndexOf(' ');
948
+ }
949
+ let result = `${value.substr(0, limit)}`;
950
+ if (result !== value) {
951
+ result += ellipsis;
952
+ }
953
+ return result;
954
+ }
955
+
956
+ function email(value) {
957
+ return !!String(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
958
+ }
959
+
960
+ function phone(value) {
961
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
962
+ return valid || !String(value).length;
963
+ }
964
+
965
+ /**
966
+ * Check validity of the url.
967
+ * Protocol (http/https) isn't required.
968
+ * @param value
969
+ * @returns {boolean}
970
+ */
971
+ function url(value) {
972
+ const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
973
+ const regexp = new RegExp(expression);
974
+ return !!String(value).match(regexp);
975
+ }
976
+
977
+ function delayedRetry(delayMs, maxRetry = 5, message) {
978
+ let retries = 0;
979
+ return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
980
+ retries++;
981
+ if (retries <= maxRetry) {
982
+ console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
983
+ }
984
+ }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
985
+ }
986
+ const getErrorMessage = (maxRetry, defaultMessage) => {
987
+ if (!defaultMessage) {
988
+ return `Failed to load Resource for ${maxRetry} times. Giving up.`;
989
+ }
990
+ else {
991
+ return defaultMessage;
992
+ }
983
993
  };
984
994
 
985
- function bytes(bytes, decimals, unit) {
986
- if (!bytes) {
987
- return '0 MB';
988
- }
989
- const e = typeof unit === 'string' ?
990
- 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
991
- Math.floor(Math.log(bytes) / Math.log(1024));
992
- if (!isNumeric(decimals)) {
993
- decimals = (bytes / 1024) > 1000 ? 2 : 0;
994
- }
995
- return `${(bytes / Math.pow(1024, e))
996
- .toFixed(decimals)}`
997
- .replace(/\.00/, '')
998
- + ' '
999
- + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1000
- }
1001
-
1002
- class FsFormatBytesPipe {
1003
- transform(value, decimals, unit) {
1004
- return bytes(value, decimals, unit);
1005
- }
1006
- }
1007
- FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1008
- FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1009
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1010
- type: Pipe,
1011
- args: [{
1012
- name: 'fsFormatBytes',
1013
- }]
995
+ function bytes(bytes, decimals, unit) {
996
+ if (!bytes) {
997
+ return '0 MB';
998
+ }
999
+ const e = typeof unit === 'string' ?
1000
+ 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
1001
+ Math.floor(Math.log(bytes) / Math.log(1024));
1002
+ if (!isNumeric(decimals)) {
1003
+ decimals = (bytes / 1024) > 1000 ? 2 : 0;
1004
+ }
1005
+ return `${(bytes / Math.pow(1024, e))
1006
+ .toFixed(decimals)}`
1007
+ .replace(/\.00/, '')
1008
+ + ' '
1009
+ + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1010
+ }
1011
+
1012
+ class FsFormatBytesPipe {
1013
+ transform(value, decimals, unit) {
1014
+ return bytes(value, decimals, unit);
1015
+ }
1016
+ }
1017
+ FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1018
+ FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1020
+ type: Pipe,
1021
+ args: [{
1022
+ name: 'fsFormatBytes',
1023
+ }]
1014
1024
  }] });
1015
1025
 
1016
- class FsFormatCurrencyPipe {
1017
- constructor(locale) {
1018
- this.locale = locale;
1019
- }
1020
- transform(amount, precision = 2, currencyCode) {
1021
- return currency(amount, precision, currencyCode);
1022
- }
1023
- }
1024
- FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1025
- FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1026
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1027
- type: Pipe,
1028
- args: [{
1029
- name: 'fsFormatCurrency',
1030
- }]
1031
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1032
- type: Inject,
1033
- args: [LOCALE_ID]
1026
+ class FsFormatCurrencyPipe {
1027
+ constructor(locale) {
1028
+ this.locale = locale;
1029
+ }
1030
+ transform(amount, precision = 2, currencyCode) {
1031
+ return currency(amount, precision, currencyCode);
1032
+ }
1033
+ }
1034
+ FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1035
+ FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1037
+ type: Pipe,
1038
+ args: [{
1039
+ name: 'fsFormatCurrency',
1040
+ }]
1041
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1042
+ type: Inject,
1043
+ args: [LOCALE_ID]
1034
1044
  }] }]; } });
1035
1045
 
1036
- class FsFormatNumberPipe {
1037
- transform(value, decimals) {
1038
- return number(value, decimals);
1039
- }
1040
- }
1041
- FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1042
- FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1044
- type: Pipe,
1045
- args: [{
1046
- name: 'fsFormatNumber'
1047
- }]
1046
+ class FsFormatNumberPipe {
1047
+ transform(value, decimals) {
1048
+ return number(value, decimals);
1049
+ }
1050
+ }
1051
+ FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1052
+ FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1054
+ type: Pipe,
1055
+ args: [{
1056
+ name: 'fsFormatNumber'
1057
+ }]
1048
1058
  }] });
1049
1059
 
1050
- class FsFormatOrdinalNumberPipe {
1051
- transform(value) {
1052
- return ordinalNumber(value);
1053
- }
1054
- }
1055
- FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1056
- FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1057
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1058
- type: Pipe,
1059
- args: [{
1060
- name: 'fsFormatOrdinalNumber',
1061
- }]
1060
+ class FsFormatOrdinalNumberPipe {
1061
+ transform(value) {
1062
+ return ordinalNumber(value);
1063
+ }
1064
+ }
1065
+ FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1066
+ FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1068
+ type: Pipe,
1069
+ args: [{
1070
+ name: 'fsFormatOrdinalNumber',
1071
+ }]
1062
1072
  }] });
1063
1073
 
1064
- class FsFormatTruncatePipe {
1065
- constructor() { }
1066
- transform(value, limit, completeWords, ellipsis) {
1067
- return truncate(value, limit, completeWords, ellipsis);
1068
- }
1069
- }
1070
- FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1071
- FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1072
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1073
- type: Pipe,
1074
- args: [{
1075
- name: 'fsFormatTruncate'
1076
- }]
1074
+ class FsFormatTruncatePipe {
1075
+ constructor() { }
1076
+ transform(value, limit, completeWords, ellipsis) {
1077
+ return truncate(value, limit, completeWords, ellipsis);
1078
+ }
1079
+ }
1080
+ FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1081
+ FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1083
+ type: Pipe,
1084
+ args: [{
1085
+ name: 'fsFormatTruncate'
1086
+ }]
1077
1087
  }], ctorParameters: function () { return []; } });
1078
1088
 
1079
- class FsArray {
1080
- /**
1081
- * @deprecated use import { nameValue } from @firestitch/common/array; instead
1082
- */
1083
- nameValue(array, name, value) {
1084
- console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1085
- let list = [];
1086
- if (name || value) {
1087
- let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1088
- let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1089
- array.forEach(function (item) {
1090
- list.push({ name: nameFn(item), value: valueFn(item) });
1091
- });
1092
- }
1093
- else {
1094
- array.forEach(function (name, value) {
1095
- list.push({ name: name, value: value });
1096
- });
1097
- }
1098
- return list;
1099
- }
1100
- /**
1101
- * @deprecated use import { remove } from @firestitch/common/array; instead
1102
- */
1103
- remove(array, query) {
1104
- console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1105
- let idx = this.indexOf(array, query);
1106
- if (idx >= 0) {
1107
- return array.splice(idx, 1);
1108
- }
1109
- return idx;
1110
- }
1111
- /**
1112
- * @deprecated use import { indexOf } from @firestitch/common/array; instead
1113
- */
1114
- indexOf(array, query) {
1115
- console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1116
- if (typeof query !== 'function') {
1117
- let queryObj = query;
1118
- query = (item) => {
1119
- return this.compare(queryObj, item);
1120
- };
1121
- }
1122
- for (let i = 0, len = array.length; i < len; i++) {
1123
- if (query(array[i])) {
1124
- return i;
1125
- }
1126
- }
1127
- return -1;
1128
- }
1129
- /**
1130
- * @deprecated use import { compare } from @firestitch/common/array; instead
1131
- */
1132
- compare(query, item) {
1133
- console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1134
- let value = true;
1135
- for (let key in query) {
1136
- value = value && item[key] == query[key];
1137
- }
1138
- return value;
1139
- }
1140
- /**
1141
- * @deprecated use import { filter } from @firestitch/common/array; instead
1142
- */
1143
- filter(array, query) {
1144
- console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1145
- if (typeof query !== 'function') {
1146
- let queryObj = query;
1147
- query = (item) => {
1148
- return this.compare(queryObj, item);
1149
- };
1150
- }
1151
- let isarray = Array.isArray(array);
1152
- let list = isarray ? [] : {};
1153
- if (isarray)
1154
- array.forEach(function (item, idx) {
1155
- if (query(item)) {
1156
- list.push(item);
1157
- }
1158
- });
1159
- else
1160
- Object.keys(array).forEach(key => {
1161
- if (query(array[key])) {
1162
- list[key] = array[key];
1163
- }
1164
- });
1165
- return list;
1166
- }
1167
- /**
1168
- * @deprecated use import { index } from @firestitch/common/array; instead
1169
- */
1170
- index(array, property) {
1171
- console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1172
- let list = {};
1173
- array.forEach(function (item, idx) {
1174
- list[item[property]] = item;
1175
- });
1176
- return list;
1177
- }
1178
- /**
1179
- * @deprecated use import { sort } from @firestitch/common/array; instead
1180
- */
1181
- sort(array, query, reverse = false) {
1182
- console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1183
- if (typeof query !== 'function') {
1184
- let queryStr = query;
1185
- query = function (a, b) {
1186
- if (reverse) {
1187
- if (a[queryStr] < b[queryStr]) {
1188
- return 1;
1189
- }
1190
- else if (a[queryStr] > b[queryStr]) {
1191
- return -1;
1192
- }
1193
- }
1194
- else {
1195
- if (a[queryStr] > b[queryStr]) {
1196
- return 1;
1197
- }
1198
- else if (a[queryStr] < b[queryStr]) {
1199
- return -1;
1200
- }
1201
- }
1202
- return 0;
1203
- };
1204
- }
1205
- array.sort(query);
1206
- return array;
1207
- }
1208
- /**
1209
- * @deprecated use import { rsort } from @firestitch/common/array; instead
1210
- */
1211
- rsort(array, query) {
1212
- console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1213
- return this.sort(array, query, true);
1214
- }
1215
- /**
1216
- * @deprecated use import { list } from @firestitch/common/array; instead
1217
- */
1218
- list(array, property, index = null) {
1219
- console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1220
- let list = index ? {} : [];
1221
- array.forEach(function (item, idx) {
1222
- if (index) {
1223
- list[item[index]] = item[property];
1224
- }
1225
- else {
1226
- list.push(item[property]);
1227
- }
1228
- });
1229
- return list;
1230
- }
1231
- /**
1232
- * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1233
- */
1234
- applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1235
- console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1236
- let keyed = {};
1237
- objects.forEach(function (object) {
1238
- if (!object[parent_property]) {
1239
- object[depth_property] = 0;
1240
- }
1241
- keyed[object[id_property]] = object;
1242
- });
1243
- Object.keys(keyed).forEach(key => {
1244
- Object.keys(keyed).forEach(key => {
1245
- let object = keyed[key];
1246
- if (!keyed[key][depth_property]) {
1247
- if (keyed[key][parent_property]) {
1248
- keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1249
- }
1250
- }
1251
- });
1252
- });
1253
- return keyed;
1254
- }
1255
- /**
1256
- * @deprecated use import { inArray } from @firestitch/common/array; instead
1257
- */
1258
- inArray(values, array) {
1259
- console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1260
- if (!Array.isArray(values)) {
1261
- values = [values];
1262
- }
1263
- for (let i = 0, len = values.length; i < len; i++) {
1264
- if (array.indexOf(values[i]) >= 0) {
1265
- return true;
1266
- }
1267
- }
1268
- return false;
1269
- }
1270
- /**
1271
- * @deprecated use import { keyExists } from @firestitch/common/array; instead
1272
- */
1273
- keyExists(array, key) {
1274
- console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1275
- return array.hasOwnProperty(key);
1276
- }
1277
- /**
1278
- * @deprecated use import { length } from @firestitch/common/array; instead
1279
- */
1280
- length(array) {
1281
- console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1282
- return array.length;
1283
- }
1284
- /**
1285
- * @deprecated use import { ksort } from @firestitch/common/array; instead
1286
- */
1287
- ksort(unordered) {
1288
- console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1289
- Object.keys(unordered).sort().forEach(function (key) {
1290
- let value = unordered[key];
1291
- delete unordered[key];
1292
- unordered[key] = value;
1293
- });
1294
- }
1295
- }
1296
- FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1297
- FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray });
1298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsArray, decorators: [{
1299
- type: Injectable
1089
+ class FsArray {
1090
+ /**
1091
+ * @deprecated use import { nameValue } from @firestitch/common/array; instead
1092
+ */
1093
+ nameValue(array, name, value) {
1094
+ console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1095
+ let list = [];
1096
+ if (name || value) {
1097
+ let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1098
+ let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1099
+ array.forEach(function (item) {
1100
+ list.push({ name: nameFn(item), value: valueFn(item) });
1101
+ });
1102
+ }
1103
+ else {
1104
+ array.forEach(function (name, value) {
1105
+ list.push({ name: name, value: value });
1106
+ });
1107
+ }
1108
+ return list;
1109
+ }
1110
+ /**
1111
+ * @deprecated use import { remove } from @firestitch/common/array; instead
1112
+ */
1113
+ remove(array, query) {
1114
+ console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1115
+ let idx = this.indexOf(array, query);
1116
+ if (idx >= 0) {
1117
+ return array.splice(idx, 1);
1118
+ }
1119
+ return idx;
1120
+ }
1121
+ /**
1122
+ * @deprecated use import { indexOf } from @firestitch/common/array; instead
1123
+ */
1124
+ indexOf(array, query) {
1125
+ console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1126
+ if (typeof query !== 'function') {
1127
+ let queryObj = query;
1128
+ query = (item) => {
1129
+ return this.compare(queryObj, item);
1130
+ };
1131
+ }
1132
+ for (let i = 0, len = array.length; i < len; i++) {
1133
+ if (query(array[i])) {
1134
+ return i;
1135
+ }
1136
+ }
1137
+ return -1;
1138
+ }
1139
+ /**
1140
+ * @deprecated use import { compare } from @firestitch/common/array; instead
1141
+ */
1142
+ compare(query, item) {
1143
+ console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1144
+ let value = true;
1145
+ for (let key in query) {
1146
+ value = value && item[key] == query[key];
1147
+ }
1148
+ return value;
1149
+ }
1150
+ /**
1151
+ * @deprecated use import { filter } from @firestitch/common/array; instead
1152
+ */
1153
+ filter(array, query) {
1154
+ console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1155
+ if (typeof query !== 'function') {
1156
+ let queryObj = query;
1157
+ query = (item) => {
1158
+ return this.compare(queryObj, item);
1159
+ };
1160
+ }
1161
+ let isarray = Array.isArray(array);
1162
+ let list = isarray ? [] : {};
1163
+ if (isarray)
1164
+ array.forEach(function (item, idx) {
1165
+ if (query(item)) {
1166
+ list.push(item);
1167
+ }
1168
+ });
1169
+ else
1170
+ Object.keys(array).forEach(key => {
1171
+ if (query(array[key])) {
1172
+ list[key] = array[key];
1173
+ }
1174
+ });
1175
+ return list;
1176
+ }
1177
+ /**
1178
+ * @deprecated use import { index } from @firestitch/common/array; instead
1179
+ */
1180
+ index(array, property) {
1181
+ console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1182
+ let list = {};
1183
+ array.forEach(function (item, idx) {
1184
+ list[item[property]] = item;
1185
+ });
1186
+ return list;
1187
+ }
1188
+ /**
1189
+ * @deprecated use import { sort } from @firestitch/common/array; instead
1190
+ */
1191
+ sort(array, query, reverse = false) {
1192
+ console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1193
+ if (typeof query !== 'function') {
1194
+ let queryStr = query;
1195
+ query = function (a, b) {
1196
+ if (reverse) {
1197
+ if (a[queryStr] < b[queryStr]) {
1198
+ return 1;
1199
+ }
1200
+ else if (a[queryStr] > b[queryStr]) {
1201
+ return -1;
1202
+ }
1203
+ }
1204
+ else {
1205
+ if (a[queryStr] > b[queryStr]) {
1206
+ return 1;
1207
+ }
1208
+ else if (a[queryStr] < b[queryStr]) {
1209
+ return -1;
1210
+ }
1211
+ }
1212
+ return 0;
1213
+ };
1214
+ }
1215
+ array.sort(query);
1216
+ return array;
1217
+ }
1218
+ /**
1219
+ * @deprecated use import { rsort } from @firestitch/common/array; instead
1220
+ */
1221
+ rsort(array, query) {
1222
+ console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1223
+ return this.sort(array, query, true);
1224
+ }
1225
+ /**
1226
+ * @deprecated use import { list } from @firestitch/common/array; instead
1227
+ */
1228
+ list(array, property, index = null) {
1229
+ console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1230
+ let list = index ? {} : [];
1231
+ array.forEach(function (item, idx) {
1232
+ if (index) {
1233
+ list[item[index]] = item[property];
1234
+ }
1235
+ else {
1236
+ list.push(item[property]);
1237
+ }
1238
+ });
1239
+ return list;
1240
+ }
1241
+ /**
1242
+ * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1243
+ */
1244
+ applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1245
+ console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1246
+ let keyed = {};
1247
+ objects.forEach(function (object) {
1248
+ if (!object[parent_property]) {
1249
+ object[depth_property] = 0;
1250
+ }
1251
+ keyed[object[id_property]] = object;
1252
+ });
1253
+ Object.keys(keyed).forEach(key => {
1254
+ Object.keys(keyed).forEach(key => {
1255
+ let object = keyed[key];
1256
+ if (!keyed[key][depth_property]) {
1257
+ if (keyed[key][parent_property]) {
1258
+ keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1259
+ }
1260
+ }
1261
+ });
1262
+ });
1263
+ return keyed;
1264
+ }
1265
+ /**
1266
+ * @deprecated use import { inArray } from @firestitch/common/array; instead
1267
+ */
1268
+ inArray(values, array) {
1269
+ console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1270
+ if (!Array.isArray(values)) {
1271
+ values = [values];
1272
+ }
1273
+ for (let i = 0, len = values.length; i < len; i++) {
1274
+ if (array.indexOf(values[i]) >= 0) {
1275
+ return true;
1276
+ }
1277
+ }
1278
+ return false;
1279
+ }
1280
+ /**
1281
+ * @deprecated use import { keyExists } from @firestitch/common/array; instead
1282
+ */
1283
+ keyExists(array, key) {
1284
+ console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1285
+ return array.hasOwnProperty(key);
1286
+ }
1287
+ /**
1288
+ * @deprecated use import { length } from @firestitch/common/array; instead
1289
+ */
1290
+ length(array) {
1291
+ console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1292
+ return array.length;
1293
+ }
1294
+ /**
1295
+ * @deprecated use import { ksort } from @firestitch/common/array; instead
1296
+ */
1297
+ ksort(unordered) {
1298
+ console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1299
+ Object.keys(unordered).sort().forEach(function (key) {
1300
+ let value = unordered[key];
1301
+ delete unordered[key];
1302
+ unordered[key] = value;
1303
+ });
1304
+ }
1305
+ }
1306
+ FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1307
+ FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray });
1308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, decorators: [{
1309
+ type: Injectable
1300
1310
  }] });
1301
1311
 
1302
- class FsMath {
1303
- /**
1304
- * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1305
- */
1306
- round(number, precision) {
1307
- console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1308
- precision = precision || 0;
1309
- let factor = Math.pow(10, precision);
1310
- let tempNumber = number * factor;
1311
- let roundedTempNumber = Math.round(tempNumber);
1312
- return roundedTempNumber / factor;
1313
- }
1314
- }
1315
- FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1316
- FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath });
1317
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsMath, decorators: [{
1318
- type: Injectable
1312
+ class FsMath {
1313
+ /**
1314
+ * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1315
+ */
1316
+ round(number, precision) {
1317
+ console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1318
+ precision = precision || 0;
1319
+ let factor = Math.pow(10, precision);
1320
+ let tempNumber = number * factor;
1321
+ let roundedTempNumber = Math.round(tempNumber);
1322
+ return roundedTempNumber / factor;
1323
+ }
1324
+ }
1325
+ FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1326
+ FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath });
1327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, decorators: [{
1328
+ type: Injectable
1319
1329
  }] });
1320
1330
 
1321
- const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1322
- /*
1323
- Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1324
- There might be a better way to organise constatns but I need to know use-cases
1325
- */
1326
- class FsUtil {
1327
- constructor() {
1328
- this.intervals = {};
1329
- }
1330
- /**
1331
- * @deprecated use @firestitch/common/util/guid instead
1332
- */
1333
- guid(pattern) {
1334
- console.warn('@deprecated use @firestitch/common/util/guid instead');
1335
- pattern = pattern || 'xxxxxx';
1336
- return pattern.replace(/[xy]/g, function (c) {
1337
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1338
- return v.toString(16);
1339
- });
1340
- }
1341
- /**
1342
- * @deprecated use import { uuid } from @firestitch/common/util; instead
1343
- */
1344
- uuid() {
1345
- console.warn('@deprecated use @firestitch/common/util/uuid instead');
1346
- return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1347
- }
1348
- /**
1349
- * @deprecated use import { resolve } from @firestitch/common/util; instead
1350
- */
1351
- resolve(promise, defaults = []) {
1352
- console.warn('@deprecated use @firestitch/common/util/resolve instead');
1353
- const result = defaults;
1354
- return new Promise(resolve => {
1355
- promise.then(function (data) {
1356
- Object.keys(data).forEach(key => result[key] = data[key]);
1357
- resolve(result);
1358
- });
1359
- });
1360
- }
1361
- /**
1362
- * @deprecated use _.toInteger() instead
1363
- */
1364
- int(value) {
1365
- console.warn('@deprecated use _.toInteger() instead');
1366
- value = parseInt(value);
1367
- if (isNaN(value)) {
1368
- value = 0;
1369
- }
1370
- return value;
1371
- }
1372
- /**
1373
- * @deprecated use _.toFinite() instead
1374
- */
1375
- float(value) {
1376
- console.warn('@deprecated use _.toFinite() instead');
1377
- value = parseFloat(value);
1378
- if (isNaN(value)) {
1379
- value = 0;
1380
- }
1381
- return value;
1382
- }
1383
- /**
1384
- * @deprecated use _.toString() instead
1385
- */
1386
- string(string) {
1387
- console.warn('@deprecated use _.toString() instead');
1388
- if (string === null || string === undefined) {
1389
- string = '';
1390
- }
1391
- return (string).toString();
1392
- }
1393
- /**
1394
- * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1395
- */
1396
- isEmpty(value, options) {
1397
- console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1398
- options = options || {};
1399
- return value === undefined ||
1400
- value === null ||
1401
- value === false ||
1402
- value === '' ||
1403
- !this.string(value).length ||
1404
- (this.isObject(value) &&
1405
- (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1406
- (!options.zero && (value === 0 || value === '0'));
1407
- }
1408
- /**
1409
- * @deprecated use _.isInteger() instead
1410
- */
1411
- isInt(value, type) {
1412
- console.warn('@deprecated use _.isInteger() instead');
1413
- const int = !!this.string(value).match(/^\d+$/);
1414
- if (!int) {
1415
- return false;
1416
- }
1417
- if (type) {
1418
- return Number.isInteger(value);
1419
- }
1420
- return true;
1421
- }
1422
- /**
1423
- * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1424
- */
1425
- each(object, func) {
1426
- console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1427
- if (!this.isArray(object) && !this.isObject(object)) {
1428
- return;
1429
- }
1430
- Object.keys(object).forEach(function (key) {
1431
- func(object[key], key);
1432
- });
1433
- }
1434
- /**
1435
- * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1436
- * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1437
- */
1438
- isObject(value) {
1439
- console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1440
- return value !== null && typeof value === 'object' && !this.isArray(value);
1441
- }
1442
- /**
1443
- * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1444
- */
1445
- isString(value) {
1446
- console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1447
- return typeof value === 'string' || value instanceof String;
1448
- }
1449
- /**
1450
- * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1451
- */
1452
- isArray(value) {
1453
- console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1454
- return value instanceof Array;
1455
- }
1456
- /**
1457
- * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1458
- */
1459
- isNumeric(value) {
1460
- console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1461
- return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1462
- }
1463
- /**
1464
- * @deprecated use import { isClass } from @firestitch/common/util; instead
1465
- */
1466
- isClass(value, cls) {
1467
- console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1468
- if (this.isObject(value)) {
1469
- if (this.isString(cls)) {
1470
- if (value.constructor) {
1471
- if (value.constructor.name === cls) {
1472
- return true;
1473
- }
1474
- }
1475
- }
1476
- else {
1477
- if (value instanceof cls) {
1478
- return true;
1479
- }
1480
- }
1481
- }
1482
- return false;
1483
- }
1484
- /**
1485
- * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1486
- */
1487
- isBoolean(value) {
1488
- console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1489
- return value === true || value === false;
1490
- }
1491
- /**
1492
- * @deprecated use import { value } from @firestitch/common/util; instead
1493
- */
1494
- value(object, key, def) {
1495
- console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1496
- if (this.isObject(object) || this.isArray(object)) {
1497
- if (object.hasOwnProperty(key)) {
1498
- return object[key];
1499
- }
1500
- }
1501
- return def;
1502
- }
1503
- throttle(func, wait) {
1504
- console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1505
- let waiting = false; // Initially, we're not waiting
1506
- return function () {
1507
- if (!waiting) { // If we're not waiting
1508
- func.apply(null, arguments); // Execute users function
1509
- waiting = true; // Prevent future invocations
1510
- setTimeout(function () {
1511
- waiting = false; // And allow future invocations
1512
- }, wait);
1513
- }
1514
- };
1515
- }
1516
- /**
1517
- * @deprecated use import { debounce } from @firestitch/common/util; instead
1518
- */
1519
- debounce(func, wait, immediate) {
1520
- console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1521
- var timeout;
1522
- return function () {
1523
- var context = this, args = arguments;
1524
- var later = function () {
1525
- timeout = null;
1526
- if (!immediate)
1527
- func.apply(context, args);
1528
- };
1529
- var callNow = immediate && !timeout;
1530
- clearTimeout(timeout);
1531
- timeout = setTimeout(later, wait);
1532
- if (callNow)
1533
- func.apply(context, args);
1534
- };
1535
- }
1536
- /**
1537
- * @deprecated use import { length } from @firestitch/common/util; instead
1538
- */
1539
- length(object) {
1540
- console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1541
- if (this.isObject(object)) {
1542
- return Object.keys(object).length;
1543
- }
1544
- if (this.isArray(object)) {
1545
- return object.length;
1546
- }
1547
- return 0;
1548
- }
1549
- /**
1550
- * @deprecated use import { boolean } from @firestitch/common/util; instead
1551
- */
1552
- boolean(value) {
1553
- console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1554
- return this.string(value).toLowerCase() !== 'false' && !!value;
1555
- }
1556
- /**
1557
- * @deprecated use import { stringify } from @firestitch/common/util; instead
1558
- */
1559
- stringify(value) {
1560
- console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1561
- return JSON.stringify(value);
1562
- }
1563
- }
1564
- FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1565
- FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil });
1566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsUtil, decorators: [{
1567
- type: Injectable
1331
+ const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1332
+ /*
1333
+ Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1334
+ There might be a better way to organise constatns but I need to know use-cases
1335
+ */
1336
+ class FsUtil {
1337
+ constructor() {
1338
+ this.intervals = {};
1339
+ }
1340
+ /**
1341
+ * @deprecated use @firestitch/common/util/guid instead
1342
+ */
1343
+ guid(pattern) {
1344
+ console.warn('@deprecated use @firestitch/common/util/guid instead');
1345
+ pattern = pattern || 'xxxxxx';
1346
+ return pattern.replace(/[xy]/g, function (c) {
1347
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1348
+ return v.toString(16);
1349
+ });
1350
+ }
1351
+ /**
1352
+ * @deprecated use import { uuid } from @firestitch/common/util; instead
1353
+ */
1354
+ uuid() {
1355
+ console.warn('@deprecated use @firestitch/common/util/uuid instead');
1356
+ return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1357
+ }
1358
+ /**
1359
+ * @deprecated use import { resolve } from @firestitch/common/util; instead
1360
+ */
1361
+ resolve(promise, defaults = []) {
1362
+ console.warn('@deprecated use @firestitch/common/util/resolve instead');
1363
+ const result = defaults;
1364
+ return new Promise(resolve => {
1365
+ promise.then(function (data) {
1366
+ Object.keys(data).forEach(key => result[key] = data[key]);
1367
+ resolve(result);
1368
+ });
1369
+ });
1370
+ }
1371
+ /**
1372
+ * @deprecated use _.toInteger() instead
1373
+ */
1374
+ int(value) {
1375
+ console.warn('@deprecated use _.toInteger() instead');
1376
+ value = parseInt(value);
1377
+ if (isNaN(value)) {
1378
+ value = 0;
1379
+ }
1380
+ return value;
1381
+ }
1382
+ /**
1383
+ * @deprecated use _.toFinite() instead
1384
+ */
1385
+ float(value) {
1386
+ console.warn('@deprecated use _.toFinite() instead');
1387
+ value = parseFloat(value);
1388
+ if (isNaN(value)) {
1389
+ value = 0;
1390
+ }
1391
+ return value;
1392
+ }
1393
+ /**
1394
+ * @deprecated use _.toString() instead
1395
+ */
1396
+ string(string) {
1397
+ console.warn('@deprecated use _.toString() instead');
1398
+ if (string === null || string === undefined) {
1399
+ string = '';
1400
+ }
1401
+ return (string).toString();
1402
+ }
1403
+ /**
1404
+ * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1405
+ */
1406
+ isEmpty(value, options) {
1407
+ console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1408
+ options = options || {};
1409
+ return value === undefined ||
1410
+ value === null ||
1411
+ value === false ||
1412
+ value === '' ||
1413
+ !this.string(value).length ||
1414
+ (this.isObject(value) &&
1415
+ (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1416
+ (!options.zero && (value === 0 || value === '0'));
1417
+ }
1418
+ /**
1419
+ * @deprecated use _.isInteger() instead
1420
+ */
1421
+ isInt(value, type) {
1422
+ console.warn('@deprecated use _.isInteger() instead');
1423
+ const int = !!this.string(value).match(/^\d+$/);
1424
+ if (!int) {
1425
+ return false;
1426
+ }
1427
+ if (type) {
1428
+ return Number.isInteger(value);
1429
+ }
1430
+ return true;
1431
+ }
1432
+ /**
1433
+ * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1434
+ */
1435
+ each(object, func) {
1436
+ console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1437
+ if (!this.isArray(object) && !this.isObject(object)) {
1438
+ return;
1439
+ }
1440
+ Object.keys(object).forEach(function (key) {
1441
+ func(object[key], key);
1442
+ });
1443
+ }
1444
+ /**
1445
+ * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1446
+ * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1447
+ */
1448
+ isObject(value) {
1449
+ console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1450
+ return value !== null && typeof value === 'object' && !this.isArray(value);
1451
+ }
1452
+ /**
1453
+ * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1454
+ */
1455
+ isString(value) {
1456
+ console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1457
+ return typeof value === 'string' || value instanceof String;
1458
+ }
1459
+ /**
1460
+ * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1461
+ */
1462
+ isArray(value) {
1463
+ console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1464
+ return value instanceof Array;
1465
+ }
1466
+ /**
1467
+ * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1468
+ */
1469
+ isNumeric(value) {
1470
+ console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1471
+ return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1472
+ }
1473
+ /**
1474
+ * @deprecated use import { isClass } from @firestitch/common/util; instead
1475
+ */
1476
+ isClass(value, cls) {
1477
+ console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1478
+ if (this.isObject(value)) {
1479
+ if (this.isString(cls)) {
1480
+ if (value.constructor) {
1481
+ if (value.constructor.name === cls) {
1482
+ return true;
1483
+ }
1484
+ }
1485
+ }
1486
+ else {
1487
+ if (value instanceof cls) {
1488
+ return true;
1489
+ }
1490
+ }
1491
+ }
1492
+ return false;
1493
+ }
1494
+ /**
1495
+ * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1496
+ */
1497
+ isBoolean(value) {
1498
+ console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1499
+ return value === true || value === false;
1500
+ }
1501
+ /**
1502
+ * @deprecated use import { value } from @firestitch/common/util; instead
1503
+ */
1504
+ value(object, key, def) {
1505
+ console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1506
+ if (this.isObject(object) || this.isArray(object)) {
1507
+ if (object.hasOwnProperty(key)) {
1508
+ return object[key];
1509
+ }
1510
+ }
1511
+ return def;
1512
+ }
1513
+ throttle(func, wait) {
1514
+ console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1515
+ let waiting = false; // Initially, we're not waiting
1516
+ return function () {
1517
+ if (!waiting) { // If we're not waiting
1518
+ func.apply(null, arguments); // Execute users function
1519
+ waiting = true; // Prevent future invocations
1520
+ setTimeout(function () {
1521
+ waiting = false; // And allow future invocations
1522
+ }, wait);
1523
+ }
1524
+ };
1525
+ }
1526
+ /**
1527
+ * @deprecated use import { debounce } from @firestitch/common/util; instead
1528
+ */
1529
+ debounce(func, wait, immediate) {
1530
+ console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1531
+ var timeout;
1532
+ return function () {
1533
+ var context = this, args = arguments;
1534
+ var later = function () {
1535
+ timeout = null;
1536
+ if (!immediate)
1537
+ func.apply(context, args);
1538
+ };
1539
+ var callNow = immediate && !timeout;
1540
+ clearTimeout(timeout);
1541
+ timeout = setTimeout(later, wait);
1542
+ if (callNow)
1543
+ func.apply(context, args);
1544
+ };
1545
+ }
1546
+ /**
1547
+ * @deprecated use import { length } from @firestitch/common/util; instead
1548
+ */
1549
+ length(object) {
1550
+ console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1551
+ if (this.isObject(object)) {
1552
+ return Object.keys(object).length;
1553
+ }
1554
+ if (this.isArray(object)) {
1555
+ return object.length;
1556
+ }
1557
+ return 0;
1558
+ }
1559
+ /**
1560
+ * @deprecated use import { boolean } from @firestitch/common/util; instead
1561
+ */
1562
+ boolean(value) {
1563
+ console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1564
+ return this.string(value).toLowerCase() !== 'false' && !!value;
1565
+ }
1566
+ /**
1567
+ * @deprecated use import { stringify } from @firestitch/common/util; instead
1568
+ */
1569
+ stringify(value) {
1570
+ console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1571
+ return JSON.stringify(value);
1572
+ }
1573
+ }
1574
+ FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1575
+ FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil });
1576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, decorators: [{
1577
+ type: Injectable
1568
1578
  }] });
1569
1579
 
1570
- class FsValidate {
1571
- constructor(fsUtil) {
1572
- this.fsUtil = fsUtil;
1573
- }
1574
- /**
1575
- * @deprecated use import { email } from @firestitch/common/validate; instead
1576
- */
1577
- phone(value) {
1578
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1579
- return valid || !String(value).length;
1580
- }
1581
- /**
1582
- * @deprecated use import { email } from @firestitch/common/validate; instead
1583
- */
1584
- email(value) {
1585
- return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
1586
- }
1587
- }
1588
- FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1589
- FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate });
1590
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsValidate, decorators: [{
1591
- type: Injectable
1580
+ class FsValidate {
1581
+ constructor(fsUtil) {
1582
+ this.fsUtil = fsUtil;
1583
+ }
1584
+ /**
1585
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1586
+ */
1587
+ phone(value) {
1588
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1589
+ return valid || !String(value).length;
1590
+ }
1591
+ /**
1592
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1593
+ */
1594
+ email(value) {
1595
+ return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
1596
+ }
1597
+ }
1598
+ FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1599
+ FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate });
1600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, decorators: [{
1601
+ type: Injectable
1592
1602
  }], ctorParameters: function () { return [{ type: FsUtil }]; } });
1593
1603
 
1594
- class FsCommonModule {
1595
- static forRoot() {
1596
- return {
1597
- ngModule: FsCommonModule,
1598
- providers: [
1599
- FsArray,
1600
- FsMath,
1601
- FsUtil,
1602
- FsValidate,
1603
- ],
1604
- };
1605
- }
1606
- }
1607
- FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1608
- FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1609
- FsPreventDefaultDirective,
1610
- FsAutofocusDirective,
1611
- FsUtilGuidPipe,
1612
- FsUtilIsEmptyPipe,
1613
- FsUtilIsNotEmptyPipe,
1614
- FsUtilStringifyPipe,
1615
- FsFormatNumberPipe,
1616
- FsFormatCurrencyPipe,
1617
- FsFormatTruncatePipe,
1618
- FsFormatBytesPipe,
1619
- FsFormatOrdinalNumberPipe,
1620
- FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1621
- FsPreventDefaultDirective,
1622
- FsAutofocusDirective,
1623
- FsUtilGuidPipe,
1624
- FsUtilStringifyPipe,
1625
- FsFormatNumberPipe,
1626
- FsFormatCurrencyPipe,
1627
- FsFormatTruncatePipe,
1628
- FsUtilIsEmptyPipe,
1629
- FsUtilIsNotEmptyPipe,
1630
- FsFormatBytesPipe,
1631
- FsModelChangeDirective,
1632
- FsFormatOrdinalNumberPipe] });
1633
- FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, imports: [[
1634
- CommonModule,
1635
- ]] });
1636
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsCommonModule, decorators: [{
1637
- type: NgModule,
1638
- args: [{
1639
- imports: [
1640
- CommonModule,
1641
- ],
1642
- declarations: [
1643
- FsStopPropagationDirective,
1644
- FsPreventDefaultDirective,
1645
- FsAutofocusDirective,
1646
- FsUtilGuidPipe,
1647
- FsUtilIsEmptyPipe,
1648
- FsUtilIsNotEmptyPipe,
1649
- FsUtilStringifyPipe,
1650
- FsFormatNumberPipe,
1651
- FsFormatCurrencyPipe,
1652
- FsFormatTruncatePipe,
1653
- FsFormatBytesPipe,
1654
- FsFormatOrdinalNumberPipe,
1655
- FsModelChangeDirective,
1656
- ],
1657
- exports: [
1658
- FsStopPropagationDirective,
1659
- FsPreventDefaultDirective,
1660
- FsAutofocusDirective,
1661
- FsUtilGuidPipe,
1662
- FsUtilStringifyPipe,
1663
- FsFormatNumberPipe,
1664
- FsFormatCurrencyPipe,
1665
- FsFormatTruncatePipe,
1666
- FsUtilIsEmptyPipe,
1667
- FsUtilIsNotEmptyPipe,
1668
- FsFormatBytesPipe,
1669
- FsModelChangeDirective,
1670
- FsFormatOrdinalNumberPipe,
1671
- ],
1672
- }]
1604
+ class FsCommonModule {
1605
+ static forRoot() {
1606
+ return {
1607
+ ngModule: FsCommonModule,
1608
+ providers: [
1609
+ FsArray,
1610
+ FsMath,
1611
+ FsUtil,
1612
+ FsValidate,
1613
+ ],
1614
+ };
1615
+ }
1616
+ }
1617
+ FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1618
+ FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1619
+ FsPreventDefaultDirective,
1620
+ FsAutofocusDirective,
1621
+ FsUtilGuidPipe,
1622
+ FsUtilIsEmptyPipe,
1623
+ FsUtilIsNotEmptyPipe,
1624
+ FsUtilStringifyPipe,
1625
+ FsFormatNumberPipe,
1626
+ FsFormatCurrencyPipe,
1627
+ FsFormatTruncatePipe,
1628
+ FsFormatBytesPipe,
1629
+ FsFormatOrdinalNumberPipe,
1630
+ FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1631
+ FsPreventDefaultDirective,
1632
+ FsAutofocusDirective,
1633
+ FsUtilGuidPipe,
1634
+ FsUtilStringifyPipe,
1635
+ FsFormatNumberPipe,
1636
+ FsFormatCurrencyPipe,
1637
+ FsFormatTruncatePipe,
1638
+ FsUtilIsEmptyPipe,
1639
+ FsUtilIsNotEmptyPipe,
1640
+ FsFormatBytesPipe,
1641
+ FsModelChangeDirective,
1642
+ FsFormatOrdinalNumberPipe] });
1643
+ FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, imports: [[
1644
+ CommonModule,
1645
+ ]] });
1646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, decorators: [{
1647
+ type: NgModule,
1648
+ args: [{
1649
+ imports: [
1650
+ CommonModule,
1651
+ ],
1652
+ declarations: [
1653
+ FsStopPropagationDirective,
1654
+ FsPreventDefaultDirective,
1655
+ FsAutofocusDirective,
1656
+ FsUtilGuidPipe,
1657
+ FsUtilIsEmptyPipe,
1658
+ FsUtilIsNotEmptyPipe,
1659
+ FsUtilStringifyPipe,
1660
+ FsFormatNumberPipe,
1661
+ FsFormatCurrencyPipe,
1662
+ FsFormatTruncatePipe,
1663
+ FsFormatBytesPipe,
1664
+ FsFormatOrdinalNumberPipe,
1665
+ FsModelChangeDirective,
1666
+ ],
1667
+ exports: [
1668
+ FsStopPropagationDirective,
1669
+ FsPreventDefaultDirective,
1670
+ FsAutofocusDirective,
1671
+ FsUtilGuidPipe,
1672
+ FsUtilStringifyPipe,
1673
+ FsFormatNumberPipe,
1674
+ FsFormatCurrencyPipe,
1675
+ FsFormatTruncatePipe,
1676
+ FsUtilIsEmptyPipe,
1677
+ FsUtilIsNotEmptyPipe,
1678
+ FsFormatBytesPipe,
1679
+ FsModelChangeDirective,
1680
+ FsFormatOrdinalNumberPipe,
1681
+ ],
1682
+ }]
1673
1683
  }] });
1674
1684
 
1675
- const keyboardShortcut = (shortcut) => {
1676
- // Observables for all keydown and keyup events
1677
- const keyDown$ = fromEvent(document, 'keydown');
1678
- const keyUp$ = fromEvent(document, 'keyup');
1679
- // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1680
- const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1681
- // Create KeyboardEvent Observable for specified KeyCode
1682
- const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1683
- // Create Event Stream for every KeyCode in shortcut
1684
- const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1685
- // Emit when specified keys are pressed (keydown).
1686
- // Emit only when all specified keys are pressed at the same time.
1687
- // More on combineLatest below
1688
- return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1685
+ const keyboardShortcut = (shortcut) => {
1686
+ // Observables for all keydown and keyup events
1687
+ const keyDown$ = fromEvent(document, 'keydown');
1688
+ const keyUp$ = fromEvent(document, 'keyup');
1689
+ // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1690
+ const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1691
+ // Create KeyboardEvent Observable for specified KeyCode
1692
+ const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1693
+ // Create Event Stream for every KeyCode in shortcut
1694
+ const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1695
+ // Emit when specified keys are pressed (keydown).
1696
+ // Emit only when all specified keys are pressed at the same time.
1697
+ // More on combineLatest below
1698
+ return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1689
1699
  };
1690
1700
 
1691
1701
  // Modules
1692
1702
 
1693
- /**
1694
- * Generated bundle index. Do not edit.
1703
+ /**
1704
+ * Generated bundle index. Do not edit.
1695
1705
  */
1696
1706
 
1697
- export { FsArray, FsAutofocusDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsModelChangeDirective, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, clone, compare, currency, debounce, delayedRetry, email, filter, find, fsSourceLoader, getNormalizedPath, guid, inArray, index, indexOf, isArrayEqual, isClass, isEmpty, isNumeric, isObject, keyExists, keyboardShortcut, ksort, length, list, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, round, rsort, sort, stringify, throttle, toString, truncate, url, uuid, value };
1698
- //# sourceMappingURL=firestitch-common.js.map
1707
+ export { FsArray, FsAutofocusDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsModelChangeDirective, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, clone, compare, currency, debounce, delayedRetry, email, filter, find, fsSourceLoader, getNormalizedPath, guid, inArray, index, indexOf, isArrayEqual, isClass, isEmpty, isNumeric, isObject, keyExists, keyboardShortcut, ksort, length, list, loadJs, loadStyles, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, round, rsort, sort, stringify, throttle, toString, truncate, url, uuid, value };
1708
+ //# sourceMappingURL=firestitch-common.mjs.map