@yelon/util 12.0.19 → 13.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. package/{date-time/yelon-util-date-time.d.ts → array/array.d.ts} +1 -0
  2. package/array/array.service.d.ts +3 -0
  3. package/array/package.json +6 -7
  4. package/browser/browser.d.ts +1 -0
  5. package/browser/cookie.service.d.ts +3 -0
  6. package/browser/copy.d.ts +1 -1
  7. package/browser/package.json +5 -6
  8. package/browser/scroll.service.d.ts +3 -0
  9. package/config/config.d.ts +5 -0
  10. package/config/config.service.d.ts +3 -0
  11. package/config/package.json +6 -7
  12. package/date-time/date-time.d.ts +5 -0
  13. package/date-time/package.json +6 -7
  14. package/decorator/decorator.d.ts +5 -0
  15. package/decorator/package.json +6 -7
  16. package/{esm2015/array/array-type.service.js → esm2020/array/array-type.service.mjs} +0 -0
  17. package/esm2020/array/array.mjs +5 -0
  18. package/esm2020/array/array.service.mjs +278 -0
  19. package/{esm2015/array/index.js → esm2020/array/index.mjs} +0 -0
  20. package/{esm2015/browser/browser.js → esm2020/browser/browser.mjs} +0 -0
  21. package/esm2020/browser/cookie.service.mjs +103 -0
  22. package/esm2020/browser/copy.mjs +9 -0
  23. package/{esm2015/browser/index.js → esm2020/browser/index.mjs} +0 -0
  24. package/{esm2015/browser/is-empty.js → esm2020/browser/is-empty.mjs} +0 -0
  25. package/esm2020/browser/scroll.service.mjs +88 -0
  26. package/{esm2015/browser/style.js → esm2020/browser/style.mjs} +2 -2
  27. package/{esm2015/config/abc/date-picker.type.js → esm2020/config/abc/date-picker.type.mjs} +0 -0
  28. package/{esm2015/config/abc/error-collect.type.js → esm2020/config/abc/error-collect.type.mjs} +0 -0
  29. package/{esm2015/config/abc/image.type.js → esm2020/config/abc/image.type.mjs} +0 -0
  30. package/{esm2015/config/abc/index.js → esm2020/config/abc/index.mjs} +0 -0
  31. package/{esm2015/config/abc/loading.type.js → esm2020/config/abc/loading.type.mjs} +0 -0
  32. package/{esm2015/config/abc/lodop.type.js → esm2020/config/abc/lodop.type.mjs} +0 -0
  33. package/{esm2015/config/abc/media.type.js → esm2020/config/abc/media.type.mjs} +0 -0
  34. package/{esm2015/config/abc/onboarding.type.js → esm2020/config/abc/onboarding.type.mjs} +0 -0
  35. package/{esm2015/config/abc/page-header.type.js → esm2020/config/abc/page-header.type.mjs} +0 -0
  36. package/{esm2015/config/abc/pdf.type.js → esm2020/config/abc/pdf.type.mjs} +0 -0
  37. package/{esm2015/config/abc/qr.type.js → esm2020/config/abc/qr.type.mjs} +0 -0
  38. package/{esm2015/config/abc/se.type.js → esm2020/config/abc/se.type.mjs} +0 -0
  39. package/{esm2015/config/abc/sg.type.js → esm2020/config/abc/sg.type.mjs} +0 -0
  40. package/{esm2015/config/abc/st.type.js → esm2020/config/abc/st.type.mjs} +0 -0
  41. package/{esm2015/config/abc/sv.type.js → esm2020/config/abc/sv.type.mjs} +0 -0
  42. package/{esm2015/config/abc/xlsx.type.js → esm2020/config/abc/xlsx.type.mjs} +0 -0
  43. package/{esm2015/config/abc/zip.type.js → esm2020/config/abc/zip.type.mjs} +0 -0
  44. package/{esm2015/config/acl/acl.type.js → esm2020/config/acl/acl.type.mjs} +0 -0
  45. package/{esm2015/config/auth/auth.type.js → esm2020/config/auth/auth.type.mjs} +0 -0
  46. package/{esm2015/config/bis/bis.type.js → esm2020/config/bis/bis.type.mjs} +0 -0
  47. package/{esm2015/config/cache/cache.type.js → esm2020/config/cache/cache.type.mjs} +0 -0
  48. package/{esm2015/config/chart/chart.type.js → esm2020/config/chart/chart.type.mjs} +0 -0
  49. package/esm2020/config/config.mjs +5 -0
  50. package/esm2020/config/config.service.mjs +37 -0
  51. package/{esm2015/config/config.types.js → esm2020/config/config.types.mjs} +0 -0
  52. package/{esm2015/config/index.js → esm2020/config/index.mjs} +0 -0
  53. package/{esm2015/config/mock/mock.type.js → esm2020/config/mock/mock.type.mjs} +0 -0
  54. package/{esm2015/config/sf/sf.type.js → esm2020/config/sf/sf.type.mjs} +0 -0
  55. package/{esm2015/config/stomp/stomp.type.js → esm2020/config/stomp/stomp.type.mjs} +0 -0
  56. package/{esm2015/config/theme/http.type.js → esm2020/config/theme/http.type.mjs} +0 -0
  57. package/{esm2015/config/theme/i18n.type.js → esm2020/config/theme/i18n.type.mjs} +0 -0
  58. package/{esm2015/config/theme/index.js → esm2020/config/theme/index.mjs} +0 -0
  59. package/{esm2015/config/theme/responsive.type.js → esm2020/config/theme/responsive.type.mjs} +0 -0
  60. package/{esm2015/config/util/array.type.js → esm2020/config/util/array.type.mjs} +0 -0
  61. package/{esm2015/config/util/currency.type.js → esm2020/config/util/currency.type.mjs} +0 -0
  62. package/esm2020/date-time/date-time.mjs +5 -0
  63. package/{esm2015/date-time/index.js → esm2020/date-time/index.mjs} +0 -0
  64. package/esm2020/date-time/picker.mjs +116 -0
  65. package/{esm2015/date-time/time.js → esm2020/date-time/time.mjs} +6 -2
  66. package/esm2020/decorator/convert.mjs +58 -0
  67. package/esm2020/decorator/decorator.mjs +5 -0
  68. package/{esm2015/decorator/index.js → esm2020/decorator/index.mjs} +0 -0
  69. package/esm2020/decorator/zone-outside.mjs +57 -0
  70. package/esm2020/form/form.mjs +5 -0
  71. package/{esm2015/form/index.js → esm2020/form/index.mjs} +0 -0
  72. package/{esm2015/form/match-control.js → esm2020/form/match-control.mjs} +0 -0
  73. package/{esm2015/form/validators.js → esm2020/form/validators.mjs} +0 -0
  74. package/esm2020/format/currency.service.mjs +238 -0
  75. package/{esm2015/format/currency.types.js → esm2020/format/currency.types.mjs} +0 -0
  76. package/esm2020/format/format.mjs +5 -0
  77. package/{esm2015/format/index.js → esm2020/format/index.mjs} +0 -0
  78. package/esm2020/format/string.mjs +85 -0
  79. package/{esm2015/format/validate.js → esm2020/format/validate.mjs} +0 -0
  80. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  81. package/{esm2015/math/in-range.js → esm2020/math/in-range.mjs} +0 -0
  82. package/{esm2015/math/index.js → esm2020/math/index.mjs} +0 -0
  83. package/esm2020/math/math.mjs +5 -0
  84. package/{esm2015/math/round.js → esm2020/math/round.mjs} +0 -0
  85. package/{esm2015/other/assert.js → esm2020/other/assert.mjs} +0 -0
  86. package/{esm2015/other/deep.js → esm2020/other/deep.mjs} +0 -0
  87. package/{esm2015/other/index.js → esm2020/other/index.mjs} +0 -0
  88. package/esm2020/other/lazy.service.mjs +119 -0
  89. package/{esm2015/other/logger.js → esm2020/other/logger.mjs} +0 -0
  90. package/esm2020/other/other.mjs +5 -0
  91. package/{esm2015/other/resize.js → esm2020/other/resize.mjs} +0 -0
  92. package/{esm2015/other/url.js → esm2020/other/url.mjs} +0 -0
  93. package/esm2020/pipes/currency/cny.pipe.mjs +23 -0
  94. package/{esm2015/pipes/currency/index.js → esm2020/pipes/currency/index.mjs} +2 -1
  95. package/esm2020/pipes/currency/mega.pipe.mjs +29 -0
  96. package/esm2020/pipes/currency/module.mjs +19 -0
  97. package/esm2020/pipes/currency/pipe-currency.mjs +5 -0
  98. package/esm2020/pipes/currency/price.pipe.mjs +27 -0
  99. package/esm2020/pipes/filter/filter.pipe.mjs +19 -0
  100. package/{esm2015/pipes/filter/index.js → esm2020/pipes/filter/index.mjs} +0 -0
  101. package/esm2020/pipes/filter/module.mjs +17 -0
  102. package/{esm2015/other/yelon-util-other.js → esm2020/pipes/filter/pipe-filter.mjs} +1 -1
  103. package/{esm2015/pipes/format/index.js → esm2020/pipes/format/index.mjs} +0 -0
  104. package/esm2020/pipes/format/mask.pipe.mjs +34 -0
  105. package/esm2020/pipes/format/module.mjs +17 -0
  106. package/{esm2015/array/yelon-util-array.js → esm2020/pipes/format/pipe-format.mjs} +1 -1
  107. package/{esm2015/pipes/index.js → esm2020/pipes/index.mjs} +0 -0
  108. package/esm2020/pipes/pipes.mjs +5 -0
  109. package/{esm2015/token/index.js → esm2020/token/index.mjs} +0 -0
  110. package/{esm2015/token/page-visibility.js → esm2020/token/page-visibility.mjs} +0 -0
  111. package/esm2020/token/token.mjs +5 -0
  112. package/{esm2015/token/window.js → esm2020/token/window.mjs} +0 -0
  113. package/{esm2015/yelon-util.js → esm2020/yelon-util.mjs} +0 -0
  114. package/fesm2015/{yelon-util-array.js → array.mjs} +8 -10
  115. package/fesm2015/array.mjs.map +1 -0
  116. package/fesm2015/{browser.js → browser.mjs} +28 -42
  117. package/fesm2015/browser.mjs.map +1 -0
  118. package/fesm2015/{yelon-util-config.js → config.mjs} +14 -8
  119. package/fesm2015/config.mjs.map +1 -0
  120. package/fesm2015/{yelon-util-date-time.js → date-time.mjs} +1 -1
  121. package/fesm2015/date-time.mjs.map +1 -0
  122. package/fesm2015/{yelon-util-decorator.js → decorator.mjs} +8 -4
  123. package/fesm2015/decorator.mjs.map +1 -0
  124. package/fesm2015/{yelon-util-form.js → form.mjs} +1 -1
  125. package/fesm2015/form.mjs.map +1 -0
  126. package/fesm2015/{yelon-util-format.js → format.mjs} +18 -14
  127. package/fesm2015/format.mjs.map +1 -0
  128. package/fesm2015/{yelon-util-math.js → math.mjs} +1 -1
  129. package/fesm2015/math.mjs.map +1 -0
  130. package/fesm2015/{yelon-util-other.js → other.mjs} +12 -9
  131. package/fesm2015/other.mjs.map +1 -0
  132. package/fesm2015/pipe-currency.mjs +96 -0
  133. package/fesm2015/pipe-currency.mjs.map +1 -0
  134. package/fesm2015/pipe-filter.mjs +40 -0
  135. package/fesm2015/pipe-filter.mjs.map +1 -0
  136. package/fesm2015/pipe-format.mjs +55 -0
  137. package/fesm2015/pipe-format.mjs.map +1 -0
  138. package/fesm2015/{yelon-util-pipes.js → pipes.mjs} +1 -1
  139. package/fesm2015/pipes.mjs.map +1 -0
  140. package/fesm2015/{yelon-util-token.js → token.mjs} +1 -1
  141. package/fesm2015/token.mjs.map +1 -0
  142. package/fesm2015/{yelon-util.js → yelon-util.mjs} +1 -1
  143. package/fesm2015/yelon-util.mjs.map +1 -0
  144. package/fesm2020/array.mjs +285 -0
  145. package/fesm2020/array.mjs.map +1 -0
  146. package/fesm2020/browser.mjs +260 -0
  147. package/fesm2020/browser.mjs.map +1 -0
  148. package/fesm2020/config.mjs +54 -0
  149. package/fesm2020/config.mjs.map +1 -0
  150. package/fesm2020/date-time.mjs +210 -0
  151. package/fesm2020/date-time.mjs.map +1 -0
  152. package/fesm2020/decorator.mjs +121 -0
  153. package/fesm2020/decorator.mjs.map +1 -0
  154. package/fesm2020/form.mjs +118 -0
  155. package/fesm2020/form.mjs.map +1 -0
  156. package/fesm2020/format.mjs +431 -0
  157. package/fesm2020/format.mjs.map +1 -0
  158. package/fesm2020/math.mjs +85 -0
  159. package/fesm2020/math.mjs.map +1 -0
  160. package/fesm2020/other.mjs +318 -0
  161. package/fesm2020/other.mjs.map +1 -0
  162. package/fesm2020/pipe-currency.mjs +94 -0
  163. package/fesm2020/pipe-currency.mjs.map +1 -0
  164. package/fesm2020/pipe-filter.mjs +40 -0
  165. package/fesm2020/pipe-filter.mjs.map +1 -0
  166. package/fesm2020/pipe-format.mjs +55 -0
  167. package/fesm2020/pipe-format.mjs.map +1 -0
  168. package/fesm2020/pipes.mjs +8 -0
  169. package/fesm2020/pipes.mjs.map +1 -0
  170. package/fesm2020/token.mjs +38 -0
  171. package/fesm2020/token.mjs.map +1 -0
  172. package/fesm2020/yelon-util.mjs +16 -0
  173. package/fesm2020/yelon-util.mjs.map +1 -0
  174. package/{array/yelon-util-array.d.ts → form/form.d.ts} +1 -0
  175. package/form/package.json +6 -7
  176. package/format/currency.service.d.ts +3 -0
  177. package/format/format.d.ts +5 -0
  178. package/format/package.json +6 -7
  179. package/{config/yelon-util-config.d.ts → math/math.d.ts} +1 -0
  180. package/math/package.json +6 -7
  181. package/other/lazy.service.d.ts +3 -0
  182. package/{decorator/yelon-util-decorator.d.ts → other/other.d.ts} +1 -0
  183. package/other/package.json +6 -7
  184. package/package.json +132 -8
  185. package/pipes/currency/cny.pipe.d.ts +3 -0
  186. package/pipes/currency/index.d.ts +1 -0
  187. package/pipes/currency/mega.pipe.d.ts +3 -0
  188. package/pipes/currency/module.d.ts +7 -0
  189. package/pipes/currency/package.json +6 -7
  190. package/pipes/currency/pipe-currency.d.ts +5 -0
  191. package/pipes/currency/price.pipe.d.ts +3 -0
  192. package/pipes/filter/filter.pipe.d.ts +3 -0
  193. package/pipes/filter/module.d.ts +5 -0
  194. package/pipes/filter/package.json +6 -7
  195. package/pipes/filter/pipe-filter.d.ts +5 -0
  196. package/pipes/format/mask.pipe.d.ts +3 -0
  197. package/pipes/format/module.d.ts +5 -0
  198. package/pipes/format/package.json +6 -7
  199. package/pipes/format/pipe-format.d.ts +5 -0
  200. package/pipes/package.json +6 -7
  201. package/pipes/pipes.d.ts +5 -0
  202. package/token/package.json +6 -7
  203. package/token/token.d.ts +5 -0
  204. package/yelon-util.d.ts +1 -0
  205. package/array/yelon-util-array.metadata.json +0 -1
  206. package/browser/browser.metadata.json +0 -1
  207. package/bundles/browser.umd.js +0 -325
  208. package/bundles/browser.umd.js.map +0 -1
  209. package/bundles/yelon-util-array.umd.js +0 -641
  210. package/bundles/yelon-util-array.umd.js.map +0 -1
  211. package/bundles/yelon-util-config.umd.js +0 -411
  212. package/bundles/yelon-util-config.umd.js.map +0 -1
  213. package/bundles/yelon-util-date-time.umd.js +0 -238
  214. package/bundles/yelon-util-date-time.umd.js.map +0 -1
  215. package/bundles/yelon-util-decorator.umd.js +0 -462
  216. package/bundles/yelon-util-decorator.umd.js.map +0 -1
  217. package/bundles/yelon-util-form.umd.js +0 -135
  218. package/bundles/yelon-util-form.umd.js.map +0 -1
  219. package/bundles/yelon-util-format.umd.js +0 -785
  220. package/bundles/yelon-util-format.umd.js.map +0 -1
  221. package/bundles/yelon-util-math.umd.js +0 -104
  222. package/bundles/yelon-util-math.umd.js.map +0 -1
  223. package/bundles/yelon-util-other.umd.js +0 -733
  224. package/bundles/yelon-util-other.umd.js.map +0 -1
  225. package/bundles/yelon-util-pipes-currency.umd.js +0 -108
  226. package/bundles/yelon-util-pipes-currency.umd.js.map +0 -1
  227. package/bundles/yelon-util-pipes-filter.umd.js +0 -374
  228. package/bundles/yelon-util-pipes-filter.umd.js.map +0 -1
  229. package/bundles/yelon-util-pipes-format.umd.js +0 -66
  230. package/bundles/yelon-util-pipes-format.umd.js.map +0 -1
  231. package/bundles/yelon-util-pipes.umd.js +0 -38
  232. package/bundles/yelon-util-pipes.umd.js.map +0 -1
  233. package/bundles/yelon-util-token.umd.js +0 -49
  234. package/bundles/yelon-util-token.umd.js.map +0 -1
  235. package/bundles/yelon-util.umd.js +0 -86
  236. package/bundles/yelon-util.umd.js.map +0 -1
  237. package/config/yelon-util-config.metadata.json +0 -1
  238. package/date-time/yelon-util-date-time.metadata.json +0 -1
  239. package/decorator/yelon-util-decorator.metadata.json +0 -1
  240. package/esm2015/array/array.service.js +0 -250
  241. package/esm2015/browser/cookie.service.js +0 -104
  242. package/esm2015/browser/copy.js +0 -27
  243. package/esm2015/browser/scroll.service.js +0 -89
  244. package/esm2015/config/config.service.js +0 -34
  245. package/esm2015/config/yelon-util-config.js +0 -5
  246. package/esm2015/date-time/picker.js +0 -116
  247. package/esm2015/date-time/yelon-util-date-time.js +0 -5
  248. package/esm2015/decorator/convert.js +0 -56
  249. package/esm2015/decorator/yelon-util-decorator.js +0 -5
  250. package/esm2015/decorator/zone-outside.js +0 -55
  251. package/esm2015/form/yelon-util-form.js +0 -5
  252. package/esm2015/format/currency.service.js +0 -225
  253. package/esm2015/format/string.js +0 -76
  254. package/esm2015/format/yelon-util-format.js +0 -5
  255. package/esm2015/math/yelon-util-math.js +0 -5
  256. package/esm2015/other/lazy.service.js +0 -118
  257. package/esm2015/pipes/currency/cny.pipe.js +0 -22
  258. package/esm2015/pipes/currency/mega.pipe.js +0 -26
  259. package/esm2015/pipes/currency/module.js +0 -14
  260. package/esm2015/pipes/currency/price.pipe.js +0 -26
  261. package/esm2015/pipes/currency/yelon-util-pipes-currency.js +0 -6
  262. package/esm2015/pipes/filter/filter.pipe.js +0 -15
  263. package/esm2015/pipes/filter/module.js +0 -12
  264. package/esm2015/pipes/filter/yelon-util-pipes-filter.js +0 -5
  265. package/esm2015/pipes/format/mask.pipe.js +0 -30
  266. package/esm2015/pipes/format/module.js +0 -12
  267. package/esm2015/pipes/format/yelon-util-pipes-format.js +0 -5
  268. package/esm2015/pipes/yelon-util-pipes.js +0 -5
  269. package/esm2015/token/yelon-util-token.js +0 -5
  270. package/fesm2015/browser.js.map +0 -1
  271. package/fesm2015/yelon-util-array.js.map +0 -1
  272. package/fesm2015/yelon-util-config.js.map +0 -1
  273. package/fesm2015/yelon-util-date-time.js.map +0 -1
  274. package/fesm2015/yelon-util-decorator.js.map +0 -1
  275. package/fesm2015/yelon-util-form.js.map +0 -1
  276. package/fesm2015/yelon-util-format.js.map +0 -1
  277. package/fesm2015/yelon-util-math.js.map +0 -1
  278. package/fesm2015/yelon-util-other.js.map +0 -1
  279. package/fesm2015/yelon-util-pipes-currency.js +0 -87
  280. package/fesm2015/yelon-util-pipes-currency.js.map +0 -1
  281. package/fesm2015/yelon-util-pipes-filter.js +0 -32
  282. package/fesm2015/yelon-util-pipes-filter.js.map +0 -1
  283. package/fesm2015/yelon-util-pipes-format.js +0 -47
  284. package/fesm2015/yelon-util-pipes-format.js.map +0 -1
  285. package/fesm2015/yelon-util-pipes.js.map +0 -1
  286. package/fesm2015/yelon-util-token.js.map +0 -1
  287. package/fesm2015/yelon-util.js.map +0 -1
  288. package/form/yelon-util-form.d.ts +0 -4
  289. package/form/yelon-util-form.metadata.json +0 -1
  290. package/format/yelon-util-format.d.ts +0 -4
  291. package/format/yelon-util-format.metadata.json +0 -1
  292. package/math/yelon-util-math.d.ts +0 -4
  293. package/math/yelon-util-math.metadata.json +0 -1
  294. package/other/yelon-util-other.d.ts +0 -4
  295. package/other/yelon-util-other.metadata.json +0 -1
  296. package/pipes/currency/yelon-util-pipes-currency.d.ts +0 -5
  297. package/pipes/currency/yelon-util-pipes-currency.metadata.json +0 -1
  298. package/pipes/filter/yelon-util-pipes-filter.d.ts +0 -4
  299. package/pipes/filter/yelon-util-pipes-filter.metadata.json +0 -1
  300. package/pipes/format/yelon-util-pipes-format.d.ts +0 -4
  301. package/pipes/format/yelon-util-pipes-format.metadata.json +0 -1
  302. package/pipes/yelon-util-pipes.d.ts +0 -4
  303. package/pipes/yelon-util-pipes.metadata.json +0 -1
  304. package/token/yelon-util-token.d.ts +0 -4
  305. package/token/yelon-util-token.metadata.json +0 -1
  306. package/yelon-util.metadata.json +0 -1
@@ -0,0 +1,19 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CurrencyCNYPipe } from './cny.pipe';
3
+ import { CurrencyMegaPipe } from './mega.pipe';
4
+ import { CurrencyPricePipe } from './price.pipe';
5
+ import * as i0 from "@angular/core";
6
+ const PIPES = [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe];
7
+ export class CurrencyPipeModule {
8
+ }
9
+ CurrencyPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
+ CurrencyPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPipeModule, declarations: [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe], exports: [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe] });
11
+ CurrencyPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPipeModule });
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPipeModule, decorators: [{
13
+ type: NgModule,
14
+ args: [{
15
+ declarations: PIPES,
16
+ exports: PIPES
17
+ }]
18
+ }] });
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2F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cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogUElQRVMsXG4gIGV4cG9ydHM6IFBJUEVTXG59KVxuZXhwb3J0IGNsYXNzIEN1cnJlbmN5UGlwZU1vZHVsZSB7fVxuIl19
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZS1jdXJyZW5jeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvcGlwZXMvY3VycmVuY3kvcGlwZS1jdXJyZW5jeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -0,0 +1,27 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@yelon/util/format";
4
+ export class CurrencyPricePipe {
5
+ constructor(srv) {
6
+ this.srv = srv;
7
+ }
8
+ /**
9
+ * Format a number with commas as thousands separators
10
+ *
11
+ * 格式化货币,用逗号将数字格式化为千位分隔符
12
+ * ```ts
13
+ * 10000 => `10,000`
14
+ * 10000.567 => `10,000.57`
15
+ * ```
16
+ */
17
+ transform(value, options) {
18
+ return this.srv.format(value, options);
19
+ }
20
+ }
21
+ CurrencyPricePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPricePipe, deps: [{ token: i1.CurrencyService }], target: i0.ɵɵFactoryTarget.Pipe });
22
+ CurrencyPricePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPricePipe, name: "price" });
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CurrencyPricePipe, decorators: [{
24
+ type: Pipe,
25
+ args: [{ name: 'price' }]
26
+ }], ctorParameters: function () { return [{ type: i1.CurrencyService }]; } });
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpY2UucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvcGlwZXMvY3VycmVuY3kvcHJpY2UucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQzs7O0FBS3BELE1BQU0sT0FBTyxpQkFBaUI7SUFDNUIsWUFBb0IsR0FBb0I7UUFBcEIsUUFBRyxHQUFILEdBQUcsQ0FBaUI7SUFBRyxDQUFDO0lBQzVDOzs7Ozs7OztPQVFHO0lBQ0gsU0FBUyxDQUFDLEtBQXNCLEVBQUUsT0FBK0I7UUFDL0QsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDekMsQ0FBQzs7OEdBYlUsaUJBQWlCOzRHQUFqQixpQkFBaUI7MkZBQWpCLGlCQUFpQjtrQkFEN0IsSUFBSTttQkFBQyxFQUFFLElBQUksRUFBRSxPQUFPLEVBQUUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQaXBlLCBQaXBlVHJhbnNmb3JtIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB7IEN1cnJlbmN5Rm9ybWF0T3B0aW9ucywgQ3VycmVuY3lTZXJ2aWNlIH0gZnJvbSAnQHllbG9uL3V0aWwvZm9ybWF0JztcblxuQFBpcGUoeyBuYW1lOiAncHJpY2UnIH0pXG5leHBvcnQgY2xhc3MgQ3VycmVuY3lQcmljZVBpcGUgaW1wbGVtZW50cyBQaXBlVHJhbnNmb3JtIHtcbiAgY29uc3RydWN0b3IocHJpdmF0ZSBzcnY6IEN1cnJlbmN5U2VydmljZSkge31cbiAgLyoqXG4gICAqIEZvcm1hdCBhIG51bWJlciB3aXRoIGNvbW1hcyBhcyB0aG91c2FuZHMgc2VwYXJhdG9yc1xuICAgKlxuICAgKiDmoLzlvI/ljJbotKfluIHvvIznlKjpgJflj7flsIbmlbDlrZfmoLzlvI/ljJbkuLrljYPkvY3liIbpmpTnrKZcbiAgICogYGBgdHNcbiAgICogMTAwMDAgPT4gYDEwLDAwMGBcbiAgICogMTAwMDAuNTY3ID0+IGAxMCwwMDAuNTdgXG4gICAqIGBgYFxuICAgKi9cbiAgdHJhbnNmb3JtKHZhbHVlOiBudW1iZXIgfCBzdHJpbmcsIG9wdGlvbnM/OiBDdXJyZW5jeUZvcm1hdE9wdGlvbnMpOiBzdHJpbmcge1xuICAgIHJldHVybiB0aGlzLnNydi5mb3JtYXQodmFsdWUsIG9wdGlvbnMpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,19 @@
1
+ import { Pipe } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class FilterPipe {
4
+ /**
5
+ * Filter array
6
+ *
7
+ * 过滤数组
8
+ */
9
+ transform(array, matcher, ...args) {
10
+ return array.filter(i => matcher(i, ...args));
11
+ }
12
+ }
13
+ FilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
14
+ FilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipe, name: "filter" });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipe, decorators: [{
16
+ type: Pipe,
17
+ args: [{ name: 'filter' }]
18
+ }] });
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsdGVyLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL3BpcGVzL2ZpbHRlci9maWx0ZXIucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQzs7QUFLcEQsTUFBTSxPQUFPLFVBQVU7SUFDckI7Ozs7T0FJRztJQUNILFNBQVMsQ0FBSSxLQUFtQixFQUFFLE9BQW1ELEVBQUUsR0FBRyxJQUFpQjtRQUN6RyxPQUFPLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxFQUFFLEdBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQztJQUNoRCxDQUFDOzt1R0FSVSxVQUFVO3FHQUFWLFVBQVU7MkZBQVYsVUFBVTtrQkFEdEIsSUFBSTttQkFBQyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQaXBlLCBQaXBlVHJhbnNmb3JtIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB0eXBlIHsgTnpTYWZlQW55IH0gZnJvbSAnbmctem9ycm8tYW50ZC9jb3JlL3R5cGVzJztcblxuQFBpcGUoeyBuYW1lOiAnZmlsdGVyJyB9KVxuZXhwb3J0IGNsYXNzIEZpbHRlclBpcGUgaW1wbGVtZW50cyBQaXBlVHJhbnNmb3JtIHtcbiAgLyoqXG4gICAqIEZpbHRlciBhcnJheVxuICAgKlxuICAgKiDov4fmu6TmlbDnu4RcbiAgICovXG4gIHRyYW5zZm9ybTxUPihhcnJheTogcmVhZG9ubHkgVFtdLCBtYXRjaGVyOiAoaXRlbTogVCwgLi4uYXJnczogTnpTYWZlQW55W10pID0+IGJvb2xlYW4sIC4uLmFyZ3M6IE56U2FmZUFueVtdKTogVFtdIHtcbiAgICByZXR1cm4gYXJyYXkuZmlsdGVyKGkgPT4gbWF0Y2hlcihpLCAuLi5hcmdzKSk7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { FilterPipe } from './filter.pipe';
3
+ import * as i0 from "@angular/core";
4
+ const PIPES = [FilterPipe];
5
+ export class FilterPipeModule {
6
+ }
7
+ FilterPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
+ FilterPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipeModule, declarations: [FilterPipe], exports: [FilterPipe] });
9
+ FilterPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipeModule });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FilterPipeModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ declarations: PIPES,
14
+ exports: PIPES
15
+ }]
16
+ }] });
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9waXBlcy9maWx0ZXIvbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFFM0MsTUFBTSxLQUFLLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQztBQU0zQixNQUFNLE9BQU8sZ0JBQWdCOzs2R0FBaEIsZ0JBQWdCOzhHQUFoQixnQkFBZ0IsaUJBTmQsVUFBVSxhQUFWLFVBQVU7OEdBTVosZ0JBQWdCOzJGQUFoQixnQkFBZ0I7a0JBSjVCLFFBQVE7bUJBQUM7b0JBQ1IsWUFBWSxFQUFFLEtBQUs7b0JBQ25CLE9BQU8sRUFBRSxLQUFLO2lCQUNmIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuaW1wb3J0IHsgRmlsdGVyUGlwZSB9IGZyb20gJy4vZmlsdGVyLnBpcGUnO1xuXG5jb25zdCBQSVBFUyA9IFtGaWx0ZXJQaXBlXTtcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBQSVBFUyxcbiAgZXhwb3J0czogUElQRVNcbn0pXG5leHBvcnQgY2xhc3MgRmlsdGVyUGlwZU1vZHVsZSB7fVxuIl19
@@ -2,4 +2,4 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1vdGhlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvb3RoZXIveWVsb24tdXRpbC1vdGhlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZS1maWx0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL3BpcGVzL2ZpbHRlci9waXBlLWZpbHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -0,0 +1,34 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { formatMask } from '@yelon/util/format';
3
+ import * as i0 from "@angular/core";
4
+ export class FormatMaskPipe {
5
+ /**
6
+ * Format mask
7
+ *
8
+ * 格式化掩码
9
+ *
10
+ * | 字符 | 描述 |
11
+ * | --- | --- |
12
+ * | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |
13
+ * | `9` | 任意数字 |
14
+ * | `#` | 任意字符 |
15
+ * | `U` | 转换大写 |
16
+ * | `L` | 转换小写 |
17
+ * | `*` | 转换为 `*` 字符 |
18
+ *
19
+ * ```ts
20
+ * formatMask('123', '(###)') => (123)
21
+ * formatMask('15900000000', '999****9999') => 159****0000
22
+ * ```
23
+ */
24
+ transform(value, mask) {
25
+ return formatMask(value, mask);
26
+ }
27
+ }
28
+ FormatMaskPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
29
+ FormatMaskPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatMaskPipe, name: "mask" });
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatMaskPipe, decorators: [{
31
+ type: Pipe,
32
+ args: [{ name: 'mask' }]
33
+ }] });
34
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFzay5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9waXBlcy9mb3JtYXQvbWFzay5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBRXBELE9BQU8sRUFBRSxVQUFVLEVBQW9CLE1BQU0sb0JBQW9CLENBQUM7O0FBR2xFLE1BQU0sT0FBTyxjQUFjO0lBQ3pCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7T0FrQkc7SUFDSCxTQUFTLENBQUMsS0FBYSxFQUFFLElBQStCO1FBQ3RELE9BQU8sVUFBVSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNqQyxDQUFDOzsyR0F0QlUsY0FBYzt5R0FBZCxjQUFjOzJGQUFkLGNBQWM7a0JBRDFCLElBQUk7bUJBQUMsRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUGlwZSwgUGlwZVRyYW5zZm9ybSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBmb3JtYXRNYXNrLCBGb3JtYXRNYXNrT3B0aW9uIH0gZnJvbSAnQHllbG9uL3V0aWwvZm9ybWF0JztcblxuQFBpcGUoeyBuYW1lOiAnbWFzaycgfSlcbmV4cG9ydCBjbGFzcyBGb3JtYXRNYXNrUGlwZSBpbXBsZW1lbnRzIFBpcGVUcmFuc2Zvcm0ge1xuICAvKipcbiAgICogRm9ybWF0IG1hc2tcbiAgICpcbiAgICog5qC85byP5YyW5o6p56CBXG4gICAqXG4gICAqIHwg5a2X56ymIHwg5o+P6L+wIHxcbiAgICogfCAtLS0gfCAtLS0gfFxuICAgKiB8IGAwYCB8IOS7u+aEj+aVsOWtl++8jOiLpeivpeS9jee9ruWtl+espuS4jeespuWQiO+8jOWImem7mOiupOS4uiBgMGAg5aGr5YWFIHxcbiAgICogfCBgOWAgfCDku7vmhI/mlbDlrZcgfFxuICAgKiB8IGAjYCB8IOS7u+aEj+Wtl+espiB8XG4gICAqIHwgYFVgIHwg6L2s5o2i5aSn5YaZIHxcbiAgICogfCBgTGAgfCDovazmjaLlsI/lhpkgfFxuICAgKiB8IGAqYCB8IOi9rOaNouS4uiBgKmAg5a2X56ymIHxcbiAgICpcbiAgICogYGBgdHNcbiAgICogZm9ybWF0TWFzaygnMTIzJywgJygjIyMpJykgPT4gKDEyMylcbiAgICogZm9ybWF0TWFzaygnMTU5MDAwMDAwMDAnLCAnOTk5KioqKjk5OTknKSA9PiAxNTkqKioqMDAwMFxuICAgKiBgYGBcbiAgICovXG4gIHRyYW5zZm9ybSh2YWx1ZTogc3RyaW5nLCBtYXNrOiBzdHJpbmcgfCBGb3JtYXRNYXNrT3B0aW9uKTogc3RyaW5nIHtcbiAgICByZXR1cm4gZm9ybWF0TWFzayh2YWx1ZSwgbWFzayk7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { FormatMaskPipe } from './mask.pipe';
3
+ import * as i0 from "@angular/core";
4
+ const PIPES = [FormatMaskPipe];
5
+ export class FormatPipeModule {
6
+ }
7
+ FormatPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
+ FormatPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatPipeModule, declarations: [FormatMaskPipe], exports: [FormatMaskPipe] });
9
+ FormatPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatPipeModule });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: FormatPipeModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ declarations: PIPES,
14
+ exports: PIPES
15
+ }]
16
+ }] });
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9waXBlcy9mb3JtYXQvbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGFBQWEsQ0FBQzs7QUFFN0MsTUFBTSxLQUFLLEdBQUcsQ0FBQyxjQUFjLENBQUMsQ0FBQztBQU0vQixNQUFNLE9BQU8sZ0JBQWdCOzs2R0FBaEIsZ0JBQWdCOzhHQUFoQixnQkFBZ0IsaUJBTmQsY0FBYyxhQUFkLGNBQWM7OEdBTWhCLGdCQUFnQjsyRkFBaEIsZ0JBQWdCO2tCQUo1QixRQUFRO21CQUFDO29CQUNSLFlBQVksRUFBRSxLQUFLO29CQUNuQixPQUFPLEVBQUUsS0FBSztpQkFDZiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB7IEZvcm1hdE1hc2tQaXBlIH0gZnJvbSAnLi9tYXNrLnBpcGUnO1xuXG5jb25zdCBQSVBFUyA9IFtGb3JtYXRNYXNrUGlwZV07XG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogUElQRVMsXG4gIGV4cG9ydHM6IFBJUEVTXG59KVxuZXhwb3J0IGNsYXNzIEZvcm1hdFBpcGVNb2R1bGUge31cbiJdfQ==
@@ -2,4 +2,4 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1hcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvYXJyYXkveWVsb24tdXRpbC1hcnJheS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZS1mb3JtYXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL3BpcGVzL2Zvcm1hdC9waXBlLWZvcm1hdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL3BpcGVzL3BpcGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL3Rva2VuL3Rva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -1,8 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable } from '@angular/core';
3
- import * as i1 from '@yelon/util/config';
4
- import { YunzaiConfigService } from '@yelon/util/config';
5
3
  import { NzTreeNode } from 'ng-zorro-antd/core/tree';
4
+ import * as i1 from '@yelon/util/config';
6
5
 
7
6
  /* eslint-disable @typescript-eslint/no-explicit-any */
8
7
  class ArrayService {
@@ -241,17 +240,16 @@ class ArrayService {
241
240
  .values());
242
241
  }
243
242
  }
244
- ArrayService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ArrayService_Factory() { return new ArrayService(i0.ɵɵinject(i1.YunzaiConfigService)); }, token: ArrayService, providedIn: "root" });
245
- ArrayService.decorators = [
246
- { type: Injectable, args: [{ providedIn: 'root' },] }
247
- ];
248
- ArrayService.ctorParameters = () => [
249
- { type: YunzaiConfigService }
250
- ];
243
+ ArrayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ArrayService, deps: [{ token: i1.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
244
+ ArrayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ArrayService, providedIn: 'root' });
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ArrayService, decorators: [{
246
+ type: Injectable,
247
+ args: [{ providedIn: 'root' }]
248
+ }], ctorParameters: function () { return [{ type: i1.YunzaiConfigService }]; } });
251
249
 
252
250
  /**
253
251
  * Generated bundle index. Do not edit.
254
252
  */
255
253
 
256
254
  export { ArrayService };
257
- //# sourceMappingURL=yelon-util-array.js.map
255
+ //# sourceMappingURL=array.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.mjs","sources":["../../../../packages/util/array/array.service.ts","../../../../packages/util/array/array.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Injectable } from '@angular/core';\n\nimport { YunzaiConfigService, YunzaiUtilArrayConfig } from '@yelon/util/config';\nimport { NzTreeNode } from 'ng-zorro-antd/core/tree';\n\nimport {\n ArrayServiceArrToTreeNodeOptions,\n ArrayServiceArrToTreeOptions,\n ArrayServiceGetKeysByTreeNodeOptions,\n ArrayServiceGroupByResult,\n ArrayServiceTreeToArrOptions\n} from './array-type.service';\n\n@Injectable({ providedIn: 'root' })\nexport class ArrayService {\n private c: YunzaiUtilArrayConfig;\n\n constructor(cog: YunzaiConfigService) {\n this.c = cog.merge('utilArray', {\n deepMapName: 'deep',\n parentMapName: 'parent',\n idMapName: 'id',\n parentIdMapName: 'parent_id',\n childrenMapName: 'children',\n titleMapName: 'title',\n checkedMapname: 'checked',\n selectedMapname: 'selected',\n expandedMapname: 'expanded',\n disabledMapname: 'disabled'\n })!;\n }\n\n /**\n * Convert tree structure to array structure\n *\n * 将树结构转换成数组结构\n */\n treeToArr<T extends object = any>(tree: readonly T[], options?: ArrayServiceTreeToArrOptions<T>): T[] {\n const opt = {\n deepMapName: this.c.deepMapName,\n parentMapName: this.c.parentMapName,\n childrenMapName: this.c.childrenMapName,\n clearChildren: true,\n cb: null,\n ...options\n } as ArrayServiceTreeToArrOptions;\n const result: Array<{ [key: string]: any }> = [];\n const inFn = (list: ReadonlyArray<{ [key: string]: any }>, parent: T | null, deep: number = 0): void => {\n for (const i of list) {\n i[opt.deepMapName!] = deep;\n i[opt.parentMapName!] = parent;\n if (opt.cb) {\n opt.cb(i, parent, deep);\n }\n result.push(i);\n const children = i[opt.childrenMapName!];\n if (children != null && Array.isArray(children) && children.length > 0) {\n inFn(children, i as T, deep + 1);\n }\n if (opt.clearChildren) {\n delete i[opt.childrenMapName!];\n }\n }\n };\n inFn(tree, null);\n return result as T[];\n }\n\n /**\n * Convert array structure to tree structure\n *\n * 数组转换成树数据\n */\n arrToTree<T extends object = any>(arr: readonly T[], options?: ArrayServiceArrToTreeOptions<T>): T[] {\n if (!Array.isArray(arr) || arr.length === 0) {\n return [];\n }\n\n const opt = {\n idMapName: this.c.idMapName,\n parentIdMapName: this.c.parentIdMapName,\n childrenMapName: this.c.childrenMapName,\n cb: null,\n ...options\n } as ArrayServiceArrToTreeOptions<T>;\n const tree: T[] = [];\n const childrenOf: { [key: string]: T[] } = {};\n let rootPid = opt.rootParentIdValue;\n const arrType = arr as ReadonlyArray<{ [key: string]: any }>;\n if (!rootPid) {\n const pids = arrType.map(i => i[opt.parentIdMapName!]);\n const emptyPid = pids.findIndex(w => w == null);\n rootPid = emptyPid !== -1 ? pids[emptyPid] : pids.sort()[0];\n }\n for (const item of arrType) {\n const id = item[opt.idMapName!];\n const pid = item[opt.parentIdMapName!];\n childrenOf[id] = childrenOf[id] || [];\n item[opt.childrenMapName!] = childrenOf[id];\n if (opt.cb) {\n opt.cb(item as T);\n }\n if (pid !== rootPid) {\n childrenOf[pid] = childrenOf[pid] || [];\n childrenOf[pid].push(item as T);\n } else {\n tree.push(item as T);\n }\n }\n return tree;\n }\n\n /**\n * 数组转换成 `nz-tree` 数据源,通过 `options` 转化项名,也可以使用 `options.cb` 更高级决定数据项\n */\n arrToTreeNode<T extends object = any>(arr: readonly T[], options?: ArrayServiceArrToTreeNodeOptions): NzTreeNode[] {\n const opt = {\n idMapName: this.c.idMapName,\n parentIdMapName: this.c.parentIdMapName,\n titleMapName: this.c.titleMapName,\n isLeafMapName: 'isLeaf',\n checkedMapname: this.c.checkedMapname,\n selectedMapname: this.c.selectedMapname,\n expandedMapname: this.c.expandedMapname,\n disabledMapname: this.c.disabledMapname,\n cb: null,\n ...options\n } as ArrayServiceArrToTreeNodeOptions<T>;\n const tree = this.arrToTree<T>(arr, {\n idMapName: opt.idMapName,\n parentIdMapName: opt.parentIdMapName,\n childrenMapName: 'children'\n });\n this.visitTree<T>(tree, (item: { [key: string]: any }, parent, deep) => {\n item.key = item[opt.idMapName!];\n item.title = item[opt.titleMapName!];\n item.checked = item[opt.checkedMapname!];\n item.selected = item[opt.selectedMapname!];\n item.expanded = item[opt.expandedMapname!];\n item.disabled = item[opt.disabledMapname!];\n if (item[opt.isLeafMapName!] == null) {\n item.isLeaf = item.children.length === 0;\n } else {\n item.isLeaf = item[opt.isLeafMapName!];\n }\n if (opt.cb) {\n opt.cb(item as any, parent, deep);\n }\n });\n return tree.map(node => new NzTreeNode(node as any));\n }\n\n /**\n * 递归访问整个树\n */\n visitTree<T extends object = any>(\n tree: readonly T[],\n cb: (item: T, parent: T | null, deep: number) => void,\n options?: {\n /** 子项名,默认:`'children'` */\n childrenMapName?: string;\n }\n ): void {\n options = {\n childrenMapName: this.c.childrenMapName,\n ...options\n };\n const inFn = (data: readonly T[], parent: T | null, deep: number): void => {\n for (const item of data) {\n cb(item, parent, deep);\n const childrenVal = (item as { [key: string]: any })[options!.childrenMapName!];\n if (Array.isArray(childrenVal) && childrenVal.length > 0) {\n inFn(childrenVal, item, deep + 1);\n }\n }\n };\n inFn(tree, null, 1);\n }\n\n /**\n * Return the value of the first tree value in the tree where predicate is true, and `undefined` otherwise\n *\n * 根据条件返回树的第一个值,否则返回 `undefined`\n */\n findTree<T extends object = any>(\n tree: readonly T[],\n predicate: (item: T) => boolean,\n options?: {\n /** 子项名,默认:`'children'` */\n childrenMapName?: string;\n }\n ): T | undefined {\n let res: T | undefined;\n this.visitTree<T>(\n tree,\n item => {\n if (res === undefined && predicate(item)) {\n res = item;\n }\n },\n options\n );\n return res;\n }\n\n /**\n * 获取所有已经选中的 `key` 值\n */\n getKeysByTreeNode(tree: NzTreeNode[], options?: ArrayServiceGetKeysByTreeNodeOptions): any[] {\n const opt = {\n includeHalfChecked: true,\n ...options\n } as ArrayServiceGetKeysByTreeNodeOptions;\n const keys: any[] = [];\n this.visitTree<NzTreeNode>(tree, (item, parent, deep) => {\n if (item.isChecked || (opt.includeHalfChecked && item.isHalfChecked)) {\n keys.push(opt.cb ? opt.cb(item, parent, deep) : opt.keyMapName ? item.origin[opt.keyMapName] : item.key);\n }\n });\n return keys;\n }\n private baseFlat(array: any[], depth: number, result: any[] = []): any[] {\n let index = -1;\n while (++index < array.length) {\n const value = array[index];\n if (depth > 0 && Array.isArray(value)) {\n if (depth > 1) {\n this.baseFlat(value, depth - 1, result);\n } else {\n let pushIndex = -1;\n const offset = result.length;\n\n while (++pushIndex < value.length) {\n result[offset + pushIndex] = value[pushIndex];\n }\n }\n } else {\n result[result.length] = value;\n }\n }\n return result;\n }\n /**\n * Recursively flattens array\n *\n * 递归扁平数组\n * ```ts\n * srv.flat([1, [2, 3, [4, 5, [6]]]]) => [1,2,3,4,5,6]\n * srv.flat([1, [2, 3, [4, 5, [6]]]], 1) => [1,2,3,[4, 5, [6]]]\n * ```\n */\n flat<T>(array: readonly T[], depth: number = 1 / 0): T[] {\n return Array.isArray(array) ? this.baseFlat(array as any[], depth) : (array as T[]);\n }\n /**\n * Group the array\n *\n * 对数组进行分组\n * ```ts\n * srv.groupBy([6.1, 4.2, 6.3], Math.floor) => {\"4\":[4.2],\"6\":[6.1,6.3]}\n * srv.groupBy(['one', 'two', 'three'], v => v.length) => {\"3\":[\"one\",\"two\"],\"5\":[\"three\"]}\n * ```\n */\n groupBy<T>(array: readonly T[], iteratee: (value: T) => string | number): ArrayServiceGroupByResult {\n if (!Array.isArray(array)) {\n return {};\n }\n return array.reduce((result, value) => {\n const key = iteratee(value);\n if (Object.prototype.hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n return result;\n }, {} as ArrayServiceGroupByResult);\n }\n /**\n * Creates a duplicate-free version of an array\n *\n * 创建去重后的数组\n * ```ts\n * uniq([1, 2, 2, 3, 1]) => [1,2,3]\n * uniq([{ a: 1 }, { a: 1 }, { a: 2 }], 'a') => [{\"a\":1},{\"a\":2}]\n * uniq([{ a: 1 }, { a: 1 }, { a: 2 }], i => (i.a === 1 ? 'a' : 'b')) => [{\"a\":1},{\"a\":2}]\n * ```\n */\n uniq<T>(array: readonly T[], predicate?: string | ((value: T) => string | number | boolean)): T[] {\n return Array.from(\n array\n .reduce((map, value) => {\n const key = predicate\n ? typeof predicate === 'string'\n ? (value as any)[predicate]\n : predicate!(value)\n : value;\n if (!map.has(key)) {\n map.set(key, value);\n }\n return map;\n }, new Map<string | number | boolean, T>())\n .values()\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport *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AC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK;YAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;gBACrD,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACzB;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACvB;YACD,OAAO,MAAM,CAAC;SACf,EAAE,EAA+B,CAAC,CAAC;KACrC;;;;;;;;;;;IAWD,IAAI,CAAI,KAAmB,EAAE,SAA8D;QACzF,OAAO,KAAK,CAAC,IAAI,CACf,KAAK;aACF,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK;YACjB,MAAM,GAAG,GAAG,SAAS;kBACjB,OAAO,SAAS,KAAK,QAAQ;sBAC1B,KAAa,CAAC,SAAS,CAAC;sBACzB,SAAU,CAAC,KAAK,CAAC;kBACnB,KAAK,CAAC;YACV,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACjB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACrB;YACD,OAAO,GAAG,CAAC;SACZ,EAAE,IAAI,GAAG,EAAgC,CAAC;aAC1C,MAAM,EAAE,CACZ,CAAC;KACH;;yGAjSU,YAAY;6GAAZ,YAAY,cADC,MAAM;2FACnB,YAAY;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACdlC;;;;;;"}
@@ -1,9 +1,7 @@
1
- import * as i2 from '@angular/cdk/platform';
2
- import { Platform } from '@angular/cdk/platform';
3
- import * as i1 from '@angular/common';
4
1
  import { DOCUMENT } from '@angular/common';
5
2
  import * as i0 from '@angular/core';
6
3
  import { Injectable, Inject } from '@angular/core';
4
+ import * as i1 from '@angular/cdk/platform';
7
5
 
8
6
  /**
9
7
  * A set of simple Cookie manipulation classes.
@@ -94,14 +92,17 @@ class CookieService {
94
92
  this.doc.cookie = '';
95
93
  }
96
94
  }
97
- CookieService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CookieService_Factory() { return new CookieService(i0.ɵɵinject(i1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: CookieService, providedIn: "root" });
98
- CookieService.decorators = [
99
- { type: Injectable, args: [{ providedIn: 'root' },] }
100
- ];
101
- CookieService.ctorParameters = () => [
102
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
103
- { type: Platform }
104
- ];
95
+ CookieService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CookieService, deps: [{ token: DOCUMENT }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
96
+ CookieService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CookieService, providedIn: 'root' });
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: CookieService, decorators: [{
98
+ type: Injectable,
99
+ args: [{ providedIn: 'root' }]
100
+ }], ctorParameters: function () {
101
+ return [{ type: undefined, decorators: [{
102
+ type: Inject,
103
+ args: [DOCUMENT]
104
+ }] }, { type: i1.Platform }];
105
+ } });
105
106
 
106
107
  /**
107
108
  * Copy text to clipboard
@@ -109,25 +110,7 @@ CookieService.ctorParameters = () => [
109
110
  * 复制字符串文档至剪贴板
110
111
  */
111
112
  function copy(value) {
112
- return new Promise((resolve) => {
113
- let copyTextArea = null;
114
- try {
115
- copyTextArea = document.createElement('textarea');
116
- copyTextArea.style.height = '0px';
117
- copyTextArea.style.opacity = '0';
118
- copyTextArea.style.width = '0px';
119
- document.body.appendChild(copyTextArea);
120
- copyTextArea.value = value;
121
- copyTextArea.select();
122
- document.execCommand('copy');
123
- resolve(value);
124
- }
125
- finally {
126
- if (copyTextArea && copyTextArea.parentNode) {
127
- copyTextArea.parentNode.removeChild(copyTextArea);
128
- }
129
- }
130
- });
113
+ return navigator.clipboard.writeText(value);
131
114
  }
132
115
 
133
116
  /**
@@ -175,7 +158,7 @@ class ScrollService {
175
158
  return [element.scrollLeft, element.scrollTop];
176
159
  }
177
160
  else {
178
- return [win.pageXOffset, win.pageYOffset];
161
+ return [win.scrollX, win.scrollY];
179
162
  }
180
163
  }
181
164
  /**
@@ -206,8 +189,8 @@ class ScrollService {
206
189
  const win = this._getWin();
207
190
  if (win && win.scrollBy) {
208
191
  win.scrollBy(0, element.getBoundingClientRect().top - topOffset);
209
- if (win.pageYOffset < 20) {
210
- win.scrollBy(0, -win.pageYOffset);
192
+ if (win.scrollY < 20) {
193
+ win.scrollBy(0, -win.scrollY);
211
194
  }
212
195
  }
213
196
  }
@@ -223,14 +206,17 @@ class ScrollService {
223
206
  this.scrollToElement(this._getDoc().body, topOffset);
224
207
  }
225
208
  }
226
- ScrollService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ScrollService_Factory() { return new ScrollService(i0.ɵɵinject(i1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: ScrollService, providedIn: "root" });
227
- ScrollService.decorators = [
228
- { type: Injectable, args: [{ providedIn: 'root' },] }
229
- ];
230
- ScrollService.ctorParameters = () => [
231
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
232
- { type: Platform }
233
- ];
209
+ ScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ScrollService, deps: [{ token: DOCUMENT }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
210
+ ScrollService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ScrollService, providedIn: 'root' });
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ScrollService, decorators: [{
212
+ type: Injectable,
213
+ args: [{ providedIn: 'root' }]
214
+ }], ctorParameters: function () {
215
+ return [{ type: undefined, decorators: [{
216
+ type: Inject,
217
+ args: [DOCUMENT]
218
+ }] }, { type: i1.Platform }];
219
+ } });
234
220
 
235
221
  function removeClass(el, classMap, renderer) {
236
222
  Object.keys(classMap).forEach(key => renderer.removeClass(el, key));
@@ -275,4 +261,4 @@ function updateHostClass(el, renderer, classMap, preClean = false) {
275
261
  */
276
262
 
277
263
  export { CookieService, ScrollService, copy, isEmpty, updateHostClass };
278
- //# sourceMappingURL=browser.js.map
264
+ //# sourceMappingURL=browser.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.mjs","sources":["../../../../packages/util/browser/cookie.service.ts","../../../../packages/util/browser/copy.ts","../../../../packages/util/browser/is-empty.ts","../../../../packages/util/browser/scroll.service.ts","../../../../packages/util/browser/style.ts","../../../../packages/util/browser/browser.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface CookieOptions {\n path?: string;\n domain?: string;\n /**\n * Expiration time, `number` is seconds\n *\n * 过期时间,`number` 类型表示秒数\n */\n expires?: number | Date | string;\n secure?: boolean;\n HttpOnly?: boolean;\n SameSite?: boolean | 'lax' | 'strict' | 'none';\n}\n\n/**\n * A set of simple Cookie manipulation classes.\n *\n * 一组简单的 Cookie 操作类。\n */\n@Injectable({ providedIn: 'root' })\nexport class CookieService {\n private get doc(): Document {\n return this._doc || document;\n }\n\n /**\n * Original cookie value\n *\n * 原始Cookie值\n */\n get cookie(): string {\n return this.platform.isBrowser ? this.doc.cookie : '';\n }\n\n constructor(@Inject(DOCUMENT) private _doc: NzSafeAny, private platform: Platform) {}\n\n /**\n * Get all cookie key-value pairs\n *\n * 获取所有Cookie键值对\n */\n getAll(): { [key: string]: string } {\n const ret: { [key: string]: string } = {};\n const arr = this.cookie.split('; ');\n for (let i = 0; i < arr.length; i++) {\n const cookie = arr[i];\n const index = cookie.indexOf('=');\n if (index > 0) {\n const name = decodeURIComponent(cookie.substring(0, index));\n if (ret[name] == null) {\n ret[name] = decodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n return ret;\n }\n\n /**\n * Get the value of given cookie `key`\n *\n * 获取指定 `key` 的值\n */\n get(key: string): string | undefined {\n return this.getAll()[key];\n }\n\n /**\n * Sets a value for given cookie key\n *\n * 设置指定 Cookie 键的值\n */\n put(key: string, value: string | undefined, options?: CookieOptions): void {\n if (!this.platform.isBrowser) {\n return;\n }\n const opt = { path: '/', ...options };\n if (typeof opt.expires === 'number') {\n opt.expires = new Date(+new Date() + opt.expires * 1e3);\n }\n if (typeof opt.expires !== 'string') {\n opt.expires = opt.expires ? opt.expires.toUTCString() : '';\n }\n const optStr: { [key: string]: string | boolean } = opt as NzSafeAny;\n const attributes = Object.keys(optStr)\n .filter(k => optStr[k] && optStr[k] !== true)\n .map(k => `${k}=${(optStr[k] as string).split(';')[0]}`)\n .join(';');\n this.doc.cookie = `${encodeURIComponent(String(key))}=${encodeURIComponent(String(value))}${\n attributes ? `; ${attributes}` : ''\n }`;\n }\n\n /**\n * Remove given cookie\n *\n * 移除指定 Cookie\n */\n remove(key: string, options?: CookieOptions): void {\n this.put(key, undefined, options);\n }\n\n /**\n * Remove all cookies\n *\n * 移除所有 Cookies\n */\n removeAll(): void {\n this.doc.cookie = '';\n }\n}\n","/**\n * Copy text to clipboard\n *\n * 复制字符串文档至剪贴板\n */\n export function copy(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n}\n","/**\n * Used to verify `<ng-content></ng-content>` is empty, useful for custom components.\n *\n * 用于校验 `<ng-content></ng-content>` 是否为空,自定义组件时蛮有用。\n */\nexport function isEmpty(element: HTMLElement): boolean {\n const nodes = element.childNodes;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes.item(i);\n if (node.nodeType === 1 && (node as HTMLElement).outerHTML.toString().trim().length !== 0) {\n return false;\n } else if (node.nodeType === 3 && node.textContent!.toString().trim().length !== 0) {\n return false;\n }\n }\n return true;\n}\n","import { Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n@Injectable({ providedIn: 'root' })\nexport class ScrollService {\n private _getDoc(): Document {\n return this._doc || document;\n }\n\n private _getWin(): Window {\n const doc = this._getDoc();\n return doc.defaultView || window;\n }\n\n constructor(@Inject(DOCUMENT) private _doc: NzSafeAny, private platform: Platform) {}\n\n /**\n * 获取滚动条位置\n *\n * @param element 指定元素,默认 `window`\n */\n getScrollPosition(element?: Element | Window): [number, number] {\n if (!this.platform.isBrowser) {\n return [0, 0];\n }\n\n const win = this._getWin();\n if (element && element !== win) {\n return [(element as Element).scrollLeft, (element as Element).scrollTop];\n } else {\n return [win.scrollX, win.scrollY];\n }\n }\n\n /**\n * 设置滚动条位置\n *\n * @param element 指定元素\n */\n scrollToPosition(element: Element | Window | null | undefined, position: [number, number]): void {\n if (!this.platform.isBrowser) {\n return;\n }\n (element || this._getWin()).scrollTo(position[0], position[1]);\n }\n\n /**\n * 设置滚动条至指定元素\n *\n * @param element 指定元素,默认 `document.body`\n * @param topOffset 偏移值,默认 `0`\n */\n scrollToElement(element?: Element | null, topOffset: number = 0): void {\n if (!this.platform.isBrowser) {\n return;\n }\n if (!element) {\n element = this._getDoc().body;\n }\n\n element.scrollIntoView();\n\n const win = this._getWin();\n if (win && win.scrollBy) {\n win.scrollBy(0, element!.getBoundingClientRect().top - topOffset);\n\n if (win.scrollY < 20) {\n win.scrollBy(0, -win.scrollY);\n }\n }\n }\n\n /**\n * 滚动至顶部\n *\n * @param topOffset 偏移值,默认 `0`\n */\n scrollToTop(topOffset: number = 0): void {\n if (!this.platform.isBrowser) {\n return;\n }\n this.scrollToElement(this._getDoc().body, topOffset);\n }\n}\n","import { Renderer2 } from '@angular/core';\n\nfunction removeClass(el: HTMLElement, classMap: { [klass: string]: unknown }, renderer: Renderer2): void {\n Object.keys(classMap).forEach(key => renderer.removeClass(el, key));\n}\n\nfunction addClass(el: HTMLElement, classMap: { [klass: string]: unknown }, renderer: Renderer2): void {\n for (const i in classMap) {\n if (classMap[i]) {\n renderer.addClass(el, i);\n }\n }\n}\n\n/**\n * Update host component style `class`\n *\n * 更新宿主组件样式 `class`\n *\n * ```ts\n * updateHostClass(\n * this.el.nativeElement,\n * this.renderer,\n * {\n * [ 'classname' ]: true,\n * [ 'classname' ]: this.type === '1',\n * [ this.cls ]: true,\n * [ `a-${this.cls}` ]: true\n * })\n * ```\n */\nexport function updateHostClass(\n el: HTMLElement,\n renderer: Renderer2,\n classMap: { [klass: string]: unknown },\n preClean: boolean = false\n): void {\n if (preClean === true) {\n renderer.removeAttribute(el, 'class');\n } else {\n removeClass(el, classMap, renderer);\n }\n classMap = { ...classMap };\n addClass(el, classMap, renderer);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAoBA;;;;;MAMa,aAAa;IAcxB,YAAsC,IAAe,EAAU,QAAkB;QAA3C,SAAI,GAAJ,IAAI,CAAW;QAAU,aAAQ,GAAR,QAAQ,CAAU;KAAI;IAbrF,IAAY,GAAG;QACb,OAAO,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;KAC9B;;;;;;IAOD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;KACvD;;;;;;IASD,MAAM;QACJ,MAAM,GAAG,GAA8B,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,K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OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CAAC,EAAe,EAAE,QAAsC,EAAE,QAAmB;IAC5F,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE;QACxB,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YACf,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SAC1B;KACF;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;SAiBgB,eAAe,CAC7B,EAAe,EACf,QAAmB,EACnB,QAAsC,EACtC,WAAoB,KAAK;IAEzB,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,QAAQ,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;KACvC;SAAM;QACL,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;KACrC;IACD,QAAQ,qBAAQ,QAAQ,CAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnC;;AC5CA;;;;;;"}
@@ -34,17 +34,23 @@ class YunzaiConfigService {
34
34
  this.config[componentName] = Object.assign(Object.assign({}, this.config[componentName]), value);
35
35
  }
36
36
  }
37
- YunzaiConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function YunzaiConfigService_Factory() { return new YunzaiConfigService(i0.ɵɵinject(YUNZAI_CONFIG, 8)); }, token: YunzaiConfigService, providedIn: "root" });
38
- YunzaiConfigService.decorators = [
39
- { type: Injectable, args: [{ providedIn: 'root' },] }
40
- ];
41
- YunzaiConfigService.ctorParameters = () => [
42
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [YUNZAI_CONFIG,] }] }
43
- ];
37
+ YunzaiConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiConfigService, deps: [{ token: YUNZAI_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
38
+ YunzaiConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiConfigService, providedIn: 'root' });
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiConfigService, decorators: [{
40
+ type: Injectable,
41
+ args: [{ providedIn: 'root' }]
42
+ }], ctorParameters: function () {
43
+ return [{ type: undefined, decorators: [{
44
+ type: Optional
45
+ }, {
46
+ type: Inject,
47
+ args: [YUNZAI_CONFIG]
48
+ }] }];
49
+ } });
44
50
 
45
51
  /**
46
52
  * Generated bundle index. Do not edit.
47
53
  */
48
54
 
49
55
  export { YUNZAI_CONFIG, YUNZAI_CONFIG_FACTORY, YunzaiConfigService, YunzaiSVConfig };
50
- //# sourceMappingURL=yelon-util-config.js.map
56
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","sources":["../../../../packages/util/config/abc/sv.type.ts","../../../../packages/util/config/config.types.ts","../../../../packages/util/config/config.service.ts","../../../../packages/util/config/config.ts"],"sourcesContent":["export class YunzaiSVConfig {\n /** 大小,默认:`large` */\n size?: 'small' | 'large';\n /** 间距,默认:`32` */\n gutter?: number;\n /** 布局,默认:`horizontal` */\n layout?: 'horizontal' | 'vertical';\n /** 列数,默认:`3` */\n col?: number;\n /** 是否显示默认值,当内容为空值时显示 `-`,默认:`true` */\n default?: boolean;\n /** `label` 固定宽度,若 `null` 或 `undefined` 表示非固定,默认:`null` */\n labelWidth?: number;\n}\n","import { InjectionToken } from '@angular/core';\n\nimport {\n YunzaiDateRangePickerConfig,\n YunzaiErrorCollectConfig,\n YunzaiImageConfig,\n YunzaiLoadingConfig,\n YunzaiLodopConfig,\n YunzaiMediaConfig,\n YunzaiOnboardingConfig,\n YunzaiPageHeaderConfig,\n YunzaiPdfConfig,\n YunzaiQRConfig,\n YunzaiSEConfig,\n YunzaiSGConfig,\n YunzaiSTConfig,\n YunzaiSVConfig,\n YunzaiXlsxConfig,\n YunzaiZipConfig\n} from './abc/index';\nimport { YunzaiACLConfig } from './acl/acl.type';\nimport { YunzaiAuthConfig } from './auth/auth.type';\nimport { YunzaiBusinessConfig } from './bis/bis.type';\nimport { YunzaiCacheConfig } from './cache/cache.type';\nimport { YunzaiChartConfig } from './chart/chart.type';\nimport { YunzaiMockConfig } from './mock/mock.type';\nimport { YunzaiSFConfig } from './sf/sf.type';\nimport { YunzaiStompConfig } from './stomp/stomp.type';\nimport { YunzaiThemeHttpClientConfig } from './theme/http.type';\nimport { YunzaiThemeI18nConfig } from './theme/i18n.type';\nimport { YunzaiThemeResponsiveConfig } from './theme/responsive.type';\nimport { YunzaiUtilArrayConfig } from './util/array.type';\nimport { YunzaiUtilCurrencyConfig } from './util/currency.type';\n\nexport interface YunzaiConfig {\n bis?: YunzaiBusinessConfig;\n stomp?: YunzaiStompConfig;\n dataRange?: YunzaiDateRangePickerConfig;\n errorCollect?: YunzaiErrorCollectConfig;\n image?: YunzaiImageConfig;\n loading?: YunzaiLoadingConfig;\n onboarding?: YunzaiOnboardingConfig;\n lodop?: YunzaiLodopConfig;\n pageHeader?: YunzaiPageHeaderConfig;\n qr?: YunzaiQRConfig;\n se?: YunzaiSEConfig;\n sg?: YunzaiSGConfig;\n sv?: YunzaiSVConfig;\n st?: YunzaiSTConfig;\n sf?: YunzaiSFConfig;\n xlsx?: YunzaiXlsxConfig;\n zip?: YunzaiZipConfig;\n pdf?: YunzaiPdfConfig;\n media?: YunzaiMediaConfig;\n acl?: YunzaiACLConfig;\n auth?: YunzaiAuthConfig;\n cache?: YunzaiCacheConfig;\n chart?: YunzaiChartConfig;\n mock?: YunzaiMockConfig;\n utilArray?: YunzaiUtilArrayConfig;\n utilCurrency?: YunzaiUtilCurrencyConfig;\n themeHttp?: YunzaiThemeHttpClientConfig;\n themeResponsive?: YunzaiThemeResponsiveConfig;\n themeI18n?: YunzaiThemeI18nConfig;\n}\n\nexport type YunzaiConfigKey = keyof YunzaiConfig;\n\nexport const YUNZAI_CONFIG = new InjectionToken<YunzaiConfig>('yunzai-config', {\n providedIn: 'root',\n factory: YUNZAI_CONFIG_FACTORY\n});\n\nexport function YUNZAI_CONFIG_FACTORY(): YunzaiConfig {\n return {};\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { deepMergeKey } from '@yelon/util/other';\n\nimport { YunzaiConfig, YunzaiConfigKey, YUNZAI_CONFIG } from './config.types';\n\n@Injectable({ providedIn: 'root' })\nexport class YunzaiConfigService {\n private config: YunzaiConfig;\n\n constructor(@Optional() @Inject(YUNZAI_CONFIG) defaultConfig?: YunzaiConfig) {\n this.config = { ...defaultConfig };\n }\n\n get<T extends YunzaiConfigKey>(componentName: T, key?: string): YunzaiConfig[T] {\n const res = ((this.config[componentName] as { [key: string]: unknown }) || {}) as NzSafeAny;\n return key ? { [key]: res[key] } : res;\n }\n\n merge<T extends YunzaiConfigKey>(componentName: T, ...defaultValues: Array<YunzaiConfig[T]>): YunzaiConfig[T] {\n return deepMergeKey({}, true, ...defaultValues, this.get(componentName));\n }\n\n attach<T extends YunzaiConfigKey>(componentThis: unknown, componentName: T, defaultValues: YunzaiConfig[T]): void {\n Object.assign(componentThis, this.merge(componentName, defaultValues));\n }\n\n attachKey<T extends YunzaiConfigKey>(componentThis: unknown, componentName: T, key: string): void {\n Object.assign(componentThis, this.get(componentName, key));\n }\n\n set<T extends YunzaiConfigKey>(componentName: T, value: YunzaiConfig[T]): void {\n this.config[componentName] = { ...this.config[componentName], ...value };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAAa,cAAc;;;MCoEd,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe,EAAE;IAC7E,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,q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203,4 @@ const dateTimePickerUtil = new DateTimePickerUtil();
203
203
  */
204
204
 
205
205
  export { DateTimePickerUtil, dateTimePickerUtil, fixEndTimeOfRange, getTimeDistance, toDate };
206
- //# sourceMappingURL=yelon-util-date-time.js.map
206
+ //# sourceMappingURL=date-time.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-time.mjs","sources":["../../../../packages/util/date-time/time.ts","../../../../packages/util/date-time/picker.ts","../../../../packages/util/date-time/date-time.ts"],"sourcesContent":["import {\n addDays,\n endOfDay,\n endOfMonth,\n endOfWeek,\n endOfYear,\n parse,\n parseISO,\n startOfDay,\n startOfMonth,\n startOfWeek,\n startOfYear,\n subMonths,\n subWeeks,\n subYears\n} from 'date-fns';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n/**\n * Get the time range, return `[ Date, Date]` for the start and end dates\n *\n * 获取时间范围\n *\n * @param type 类型,带 `-` 表示过去一个时间,若指定 `number` 表示天数\n * @param time 开始时间\n */\nexport function getTimeDistance(\n type: 'today' | '-today' | 'yesterday' | 'week' | '-week' | 'month' | '-month' | 'year' | '-year' | number,\n time?: Date | string | number\n): [Date, Date] {\n time = time\n ? typeof time === 'string'\n ? parse(time, 'yyyy-MM-dd HH:mm:ss', new Date())\n : new Date(time)\n : new Date();\n const options: { weekStartsOn: 1 } = { weekStartsOn: 1 };\n\n let res: [Date, Date];\n switch (type) {\n case 'today':\n res = [time, time];\n break;\n case '-today':\n res = [addDays(time, -1), time];\n break;\n case 'yesterday':\n res = [addDays(time, -1), addDays(time, -1)];\n break;\n case 'week':\n res = [startOfWeek(time, options), endOfWeek(time, options)];\n break;\n case '-week':\n res = [startOfWeek(subWeeks(time, 1), options), endOfWeek(subWeeks(time, 1), options)];\n break;\n case 'month':\n res = [startOfMonth(time), endOfMonth(time)];\n break;\n case '-month':\n res = [startOfMonth(subMonths(time, 1)), endOfMonth(subMonths(time, 1))];\n break;\n case 'year':\n res = [startOfYear(time), endOfYear(time)];\n break;\n case '-year':\n res = [startOfYear(subYears(time, 1)), endOfYear(subYears(time, 1))];\n break;\n default:\n res = type > 0 ? [time, addDays(time, type)] : [addDays(time, type), time];\n break;\n }\n return fixEndTimeOfRange(res);\n}\n\n/**\n * fix time is the most, big value\n */\nexport function fixEndTimeOfRange(dates: [Date, Date]): [Date, Date] {\n return [startOfDay(dates[0]), endOfDay(dates[1])];\n}\n\nexport type ToDateOptions = string | { formatString?: string; defaultValue?: NzSafeAny };\n\n/**\n * Return the date parsed from string using the given format string\n * - If the argument is a number, it is treated as a timestamp.\n *\n * @param formatString If parsing fails try to parse the date by pressing `formatString`\n * @param defaultValue If parsing fails returned default value, default: `new Date(NaN)`\n */\nexport function toDate(value: Date | string | number, options?: ToDateOptions): Date {\n if (typeof options === 'string') options = { formatString: options };\n const { formatString, defaultValue } = {\n formatString: 'yyyy-MM-dd HH:mm:ss',\n defaultValue: new Date(NaN),\n ...options\n };\n if (value == null) {\n return defaultValue;\n }\n if (value instanceof Date) {\n return value;\n }\n if (typeof value === 'number' || (typeof value === 'string' && /[0-9]{10,13}/.test(value))) {\n return new Date(+value);\n }\n let tryDate = parseISO(value);\n if (isNaN(tryDate as NzSafeAny)) {\n tryDate = parse(value, formatString!, new Date());\n }\n\n return isNaN(tryDate as NzSafeAny) ? defaultValue : tryDate;\n}\n","import { addDays, addSeconds, differenceInCalendarDays, format } from 'date-fns';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { DisabledDateFn, DisabledTimeConfig, DisabledTimeFn } from 'ng-zorro-antd/date-picker';\n\n// TODO: timezone process\nexport class DateTimePickerUtil {\n /**\n * Current local time\n *\n * 当前本地时间\n */\n get now(): Date {\n return new Date();\n }\n /**\n * Current local date (not including time part)\n *\n * 当前本地日期(不包含时间部分)\n */\n get date(): Date {\n return this.removeTime(this.now);\n }\n /**\n * Remove the time part of the date\n *\n * 移除日期的时间部分\n */\n removeTime(d: Date): Date {\n return new Date(d.toDateString());\n }\n /**\n * Format date-time\n *\n * 格式化日期\n */\n format(d: number | Date, formatString: string = 'yyyy-MM-dd HH:mm:ss'): string {\n return format(d, formatString);\n }\n private genTick(count: number): number[] {\n return new Array(count).fill(0).map((_, idx) => idx);\n }\n /**\n * Calculate the number of days between two dates, `0` means the same day\n *\n * 计算两个日期相差天数,`0` 表示同一天\n */\n getDiffDays(dateLeft: Date | number, dateRight?: Date | number): number {\n return differenceInCalendarDays(\n dateLeft,\n typeof dateRight === 'number' ? addDays(this.date, dateRight) : dateRight || this.date\n );\n }\n /**\n * Disabled Before date (Default: today), Generally serves `nzDisabledDate`\n *\n * 禁用之前日期(默认:今天),一般服务于 `nzDisabledDate`\n */\n disabledBeforeDate(options?: { offsetDays?: Date | number }): DisabledDateFn {\n return (d): boolean => this.getDiffDays(d, options?.offsetDays) < 0;\n }\n /**\n * Disabled After date (Default: today), Generally serves `nzDisabledDate`\n *\n * 禁用之后日期(默认:今天),一般服务于 `nzDisabledDate`\n */\n disabledAfterDate(options?: { offsetDays?: Date | number }): DisabledDateFn {\n return (d): boolean => this.getDiffDays(d, options?.offsetDays) > 0;\n }\n private baseDisabledTime(type: 'before' | 'after', offsetSeconds?: number): DisabledTimeFn {\n const tick24 = this.genTick(24);\n const tick60 = this.genTick(60);\n return (current): DisabledTimeConfig => {\n const cur = current as Date;\n if (cur == null) {\n return {} as NzSafeAny;\n }\n const now = addSeconds(this.now, offsetSeconds || 0);\n const nowHours = now.getHours();\n const nowMinutes = now.getMinutes();\n const curHours = cur.getHours();\n const isToday = this.getDiffDays(this.removeTime(cur)) === 0;\n return {\n nzDisabledHours: () => {\n if (!isToday) return [];\n return type === 'before' ? tick24.slice(0, nowHours) : tick24.slice(nowHours + 1);\n },\n nzDisabledMinutes: () => {\n if (isToday && curHours === nowHours) {\n return type === 'before' ? tick60.slice(0, nowMinutes) : tick60.slice(nowMinutes + 1);\n }\n return [];\n },\n nzDisabledSeconds: () => {\n if (isToday && curHours === nowHours && cur.getMinutes() === nowMinutes) {\n const nowSeconds = now.getSeconds();\n return type === 'before' ? tick60.slice(0, nowSeconds) : tick60.slice(nowSeconds + 1);\n }\n return [];\n }\n };\n };\n }\n /**\n * Disabled Before time (Default: now), Generally serves `nzDisabledTime`\n *\n * 禁用之前时间(默认:现在),一般服务于 `nzDisabledTime`\n */\n disabledBeforeTime(options?: { offsetSeconds?: number }): DisabledTimeFn {\n return this.baseDisabledTime('before', options?.offsetSeconds);\n }\n /**\n * Disabled After time (Default: now), Generally serves `nzDisabledTime`\n *\n * 禁用之后时间(默认:现在),一般服务于 `nzDisabledTime`\n */\n disabledAfterTime(options?: { offsetSeconds?: number }): DisabledTimeFn {\n return this.baseDisabledTime('after', options?.offsetSeconds);\n }\n}\n\nexport const dateTimePickerUtil = new DateTimePickerUtil();\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAmBA;;;;;;;;SAQgB,eAAe,CAC7B,IAA0G,EAC1G,IAA6B;IAE7B,IAAI,GAAG,IAAI;UACP,OAAO,IAAI,KAAK,QAAQ;cACtB,KAAK,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,IAAI,EAAE,CAAC;cAC9C,IAAI,IAAI,CAAC,IAAI,CAAC;UAChB,IAAI,IAAI,EAAE,CAAC;IACf,MAAM,OAAO,GAAwB,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAEzD,IAAI,GAAiB,CAAC;IACtB,QAAQ,IAAI;QACV,KAAK,OAAO;YACV,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACnB,MAAM;QACR,KAAK,QAAQ;YACX,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAChC,MAAM;QACR,KAAK,WAAW;YACd,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YA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AC,OAAoC;QACrD,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAC,CAAC;KAChE;;;;;;IAMD,iBAAiB,CAAC,OAAoC;QACpD,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAC,CAAC;KAC/D;CACF;MAEY,kBAAkB,GAAG,IAAI,kBAAkB;;ACzHxD;;;;;;"}
@@ -3,8 +3,10 @@ import { warn } from '@yelon/util/other';
3
3
  function propDecoratorFactory(name, fallback, defaultValue) {
4
4
  function propDecorator(target, propName, originalDescriptor) {
5
5
  const privatePropName = `$$__${propName}`;
6
- if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
7
- warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
6
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
7
+ if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
8
+ warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
9
+ }
8
10
  }
9
11
  Object.defineProperty(target, privatePropName, {
10
12
  configurable: true,
@@ -62,7 +64,9 @@ function makeFn(type, options) {
62
64
  const that = this;
63
65
  const ngZone = that[(options === null || options === void 0 ? void 0 : options.ngZoneName) || 'ngZone'];
64
66
  if (!ngZone) {
65
- warn(`ZoneOutside: Decorator should have 'ngZone' property with 'NgZone' class.`);
67
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
68
+ warn(`ZoneOutside: Decorator should have 'ngZone' property with 'NgZone' class.`);
69
+ }
66
70
  return source.call(this, ...data);
67
71
  }
68
72
  let res;
@@ -114,4 +118,4 @@ function ZoneRun(options) {
114
118
  */
115
119
 
116
120
  export { InputBoolean, InputNumber, ZoneOutside, ZoneRun, toBoolean, toNumber };
117
- //# sourceMappingURL=yelon-util-decorator.js.map
121
+ //# sourceMappingURL=decorator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorator.mjs","sources":["../../../../packages/util/decorator/convert.ts","../../../../packages/util/decorator/zone-outside.ts","../../../../packages/util/decorator/decorator.ts"],"sourcesContent":["import { warn } from '@yelon/util/other';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport type BooleanInput = boolean | string | undefined | null;\nexport type NumberInput = number | string | undefined | null;\n\nfunction propDecoratorFactory<T, D>(\n name: string,\n fallback: (v: T, defaultValue: D) => D,\n defaultValue: NzSafeAny\n): (target: NzSafeAny, propName: string) => void {\n function propDecorator(\n target: NzSafeAny,\n propName: string,\n originalDescriptor?: TypedPropertyDescriptor<NzSafeAny>\n ): NzSafeAny {\n const privatePropName = `$$__${propName}`;\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {\n warn(`The prop \"${privatePropName}\" is already exist, it will be overrided by ${name} decorator.`);\n }\n }\n\n Object.defineProperty(target, privatePropName, {\n configurable: true,\n writable: true\n });\n\n return {\n get(): string {\n return originalDescriptor && originalDescriptor.get\n ? originalDescriptor.get.bind(this)()\n : this[privatePropName];\n },\n set(value: T): void {\n if (originalDescriptor && originalDescriptor.set) {\n originalDescriptor.set.bind(this)(fallback(value, defaultValue));\n }\n this[privatePropName] = fallback(value, defaultValue);\n }\n };\n }\n\n return propDecorator;\n}\n\nexport function toBoolean(\n value: unknown,\n defaultValue: boolean | null | undefined = false\n): boolean | null | undefined {\n return value == null ? defaultValue : `${value}` !== 'false';\n}\n\n/**\n * Input decorator that handle a prop to do get/set automatically with toBoolean\n *\n * ```ts\n * {AT}Input() {AT}InputBoolean() visible: boolean = false;\n * {AT}Input() {AT}InputBoolean(null) visible: boolean = false;\n * ```\n */\nexport function InputBoolean(defaultValue: boolean | null = false): NzSafeAny {\n return propDecoratorFactory('InputBoolean', toBoolean, defaultValue);\n}\n\nexport function toNumber(value: unknown): number;\nexport function toNumber<D>(value: unknown, fallback: D): number | D;\nexport function toNumber(value: unknown, fallbackValue: number = 0): number {\n return !isNaN(parseFloat(value as NzSafeAny)) && !isNaN(Number(value)) ? Number(value) : fallbackValue;\n}\n\n/**\n * Input decorator that handle a prop to do get/set automatically with toNumber\n *\n * ```ts\n * {AT}Input() {AT}InputNumber() visible: number = 1;\n * {AT}Input() {AT}InputNumber(null) visible: number = 2;\n * ```\n */\nexport function InputNumber(defaultValue: number | null = 0): NzSafeAny {\n return propDecoratorFactory('InputNumber', toNumber, defaultValue);\n}\n","import { warn } from '@yelon/util/other';\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nexport interface ZoneOptions {\n ngZoneName?: string;\n}\n\ntype DecoratorType = (target: unknown, fn: string, descriptor: PropertyDescriptor) => PropertyDescriptor;\n\nfunction makeFn(type: 'runOutsideAngular' | 'run', options?: ZoneOptions): DecoratorType {\n return (_, __, descriptor) => {\n const source = descriptor.value;\n descriptor.value = function (...data: NzSafeAny[]): () => void {\n const that = this as NzSafeAny;\n const ngZone = that[options?.ngZoneName || 'ngZone'];\n if (!ngZone) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n warn(`ZoneOutside: Decorator should have 'ngZone' property with 'NgZone' class.`);\n }\n return source.call(this, ...data);\n }\n let res: NzSafeAny;\n ngZone[type](() => {\n res = source.call(this, ...data);\n });\n return res;\n };\n\n return descriptor;\n };\n}\n\n/**\n * The decoration method runs in `runOutsideAngular`\n *\n * 装饰方法运行在 `runOutsideAngular` 内\n *\n * ```ts\n * class MockClass {\n * constructor(public ngZone: NgZone) {}\n *\n * {AT}ZoneOutside()\n * runOutsideAngular(): void {}\n * }\n * ```\n */\nexport function ZoneOutside(options?: ZoneOptions): DecoratorType {\n return makeFn('runOutsideAngular', options);\n}\n\n/**\n * The decoration method runs in `run`\n *\n * 装饰方法运行在 `run` 内\n *\n * ```ts\n * class MockClass {\n * constructor(public ngZone: NgZone) {}\n *\n * {AT}ZoneRun()\n * run(): void {}\n * }\n * ```\n */\nexport function ZoneRun(options?: ZoneOptions): DecoratorType {\n return makeFn('run', options);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAMA,SAAS,oBAAoB,CAC3B,IAAY,EACZ,QAAsC,EACtC,YAAuB;IAEvB,SAAS,aAAa,CACpB,MAAiB,EACjB,QAAgB,EAChB,kBAAuD;QAEvD,MAAM,eAAe,GAAG,OAAO,QAAQ,EAAE,CAAC;QAE1C,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE;YACjD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE;gBACjE,IAAI,CAAC,aAAa,eAAe,+CAA+C,IAAI,aAAa,CAAC,CAAC;aACpG;SACF;QAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;YAC7C,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,OAAO;YACL,GAAG;gBACD,OAAO,kBAAkB,IAAI,kBAAkB,CAAC,GAAG;sBAC/C,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;sBACnC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC3B;YACD,GAAG,CAAC,KAAQ;gBACV,IAAI,kBAAkB,IAAI,kBAAkB,CAAC,GAAG,EAAE;oBAChD,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;iBAClE;gBACD,IAAI,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;aACvD;SACF,CAAC;KACH;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;SAEe,SAAS,CACvB,KAAc,EACd,eAA2C,KAAK;IAEhD,OAAO,KAAK,IAAI,IAAI,GAAG,YAAY,GAAG,GAAG,KAAK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,CAAC;SACZ,CAAC;QAEF,OAAO,UAAU,CAAC;KACnB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;SAcgB,WAAW,CAAC,OAAqB;IAC/C,OAAO,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;SAcgB,OAAO,CAAC,OAAqB;IAC3C,OAAO,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAChC;;AClEA;;;;;;"}
@@ -115,4 +115,4 @@ function MatchControl(controlName, matchingControlName) {
115
115
  */
116
116
 
117
117
  export { MatchControl, _Validators };
118
- //# sourceMappingURL=yelon-util-form.js.map
118
+ //# sourceMappingURL=form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.mjs","sources":["../../../../packages/util/form/validators.ts","../../../../packages/util/form/match-control.ts","../../../../packages/util/form/form.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors } from '@angular/forms';\n\nimport { isChinese, isColor, isDecimal, isIdCard, isInt, isIp, isMobile, isNum, isUrl } from '@yelon/util/format';\n\n/**\n * A set of validators for reactive forms\n *\n * 一套用于响应式表单的验证器\n */\nexport class _Validators {\n /**\n * Wheter is number\n *\n * 是否为数字\n */\n static num(control: AbstractControl): ValidationErrors | null {\n return isNum(control.value) ? null : { num: true };\n }\n\n /**\n * Wheter is integer\n *\n * 是否为整数\n */\n static int(control: AbstractControl): ValidationErrors | null {\n return isInt(control.value) ? null : { int: true };\n }\n\n /**\n * Wheter is decimal\n *\n * 是否为小数点数值\n */\n static decimal(control: AbstractControl): ValidationErrors | null {\n return isDecimal(control.value) ? null : { decimal: true };\n }\n\n /**\n * Wheter is People's Republic of China identity card\n *\n * 是否为中华人民共和国居民身份证\n */\n static idCard(control: AbstractControl): ValidationErrors | null {\n return isIdCard(control.value) ? null : { idCard: true };\n }\n\n /**\n * Wheter is china mobile (China)\n *\n * 是否为手机号(中国)\n */\n static mobile(control: AbstractControl): ValidationErrors | null {\n return isMobile(control.value) ? null : { mobile: true };\n }\n\n /**\n * Wheter is url address\n *\n * 是否URL地址\n */\n static url(control: AbstractControl): ValidationErrors | null {\n return isUrl(control.value) ? null : { url: true };\n }\n\n /**\n * Wheter is IPv4 address (Support v4, v6)\n *\n * 是否IP4地址(支持v4、v6)\n */\n static ip(control: AbstractControl): ValidationErrors | null {\n return isIp(control.value) ? null : { ip: true };\n }\n\n /**\n * Wheter is color\n *\n * 是否颜色代码值\n */\n static color(control: AbstractControl): ValidationErrors | null {\n return isColor(control.value) ? null : { color: true };\n }\n\n /**\n * Wheter is chinese\n *\n * 是否中文\n */\n static chinese(control: AbstractControl): ValidationErrors | null {\n return isChinese(control.value) ? null : { chinese: true };\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\n\n/**\n * Match two control values\n *\n * 匹配两个控件值\n * ```ts\n * this.form = new FormGroup({\n * pwd: new FormControl(''),\n * repwd: new FormControl(''),\n * }, {\n * validators: MatchControl('pwd', 'repwd'),\n * });\n * ```\n */\nexport function MatchControl(controlName: string, matchingControlName: string): ValidatorFn {\n return (formGroup: AbstractControl) => {\n const control = formGroup.get(controlName)!;\n const matchingControl = formGroup.get(matchingControlName)!;\n if (matchingControl.errors && !matchingControl.errors.matchControl) {\n return null;\n }\n if (control.value !== matchingControl.value) {\n matchingControl.setErrors({ matchControl: true });\n } else {\n matchingControl.setErrors(null);\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;;;MAKa,WAAW;;;;;;IAMtB,OAAO,GAAG,CAAC,OAAwB;QACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;KACpD;;;;;;IAOD,OAAO,GAAG,CAAC,OAAwB;QACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE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