@yelon/util 12.0.18 → 13.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) 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/abc/pdf.type.d.ts +1 -1
  10. package/config/abc/qr.type.d.ts +1 -1
  11. package/config/config.d.ts +5 -0
  12. package/config/config.service.d.ts +3 -0
  13. package/config/package.json +6 -7
  14. package/date-time/date-time.d.ts +5 -0
  15. package/date-time/package.json +6 -7
  16. package/decorator/decorator.d.ts +5 -0
  17. package/decorator/package.json +6 -7
  18. package/{esm2015/array/array-type.service.js → esm2020/array/array-type.service.mjs} +0 -0
  19. package/esm2020/array/array.mjs +5 -0
  20. package/esm2020/array/array.service.mjs +278 -0
  21. package/{esm2015/array/index.js → esm2020/array/index.mjs} +0 -0
  22. package/{esm2015/browser/browser.js → esm2020/browser/browser.mjs} +0 -0
  23. package/esm2020/browser/cookie.service.mjs +103 -0
  24. package/esm2020/browser/copy.mjs +9 -0
  25. package/{esm2015/browser/index.js → esm2020/browser/index.mjs} +0 -0
  26. package/{esm2015/browser/is-empty.js → esm2020/browser/is-empty.mjs} +0 -0
  27. package/esm2020/browser/scroll.service.mjs +88 -0
  28. package/{esm2015/browser/style.js → esm2020/browser/style.mjs} +2 -2
  29. package/{esm2015/config/abc/date-picker.type.js → esm2020/config/abc/date-picker.type.mjs} +0 -0
  30. package/{esm2015/config/abc/error-collect.type.js → esm2020/config/abc/error-collect.type.mjs} +0 -0
  31. package/{esm2015/config/abc/image.type.js → esm2020/config/abc/image.type.mjs} +0 -0
  32. package/{esm2015/config/abc/index.js → esm2020/config/abc/index.mjs} +0 -0
  33. package/{esm2015/config/abc/loading.type.js → esm2020/config/abc/loading.type.mjs} +0 -0
  34. package/{esm2015/config/abc/lodop.type.js → esm2020/config/abc/lodop.type.mjs} +0 -0
  35. package/{esm2015/config/abc/media.type.js → esm2020/config/abc/media.type.mjs} +0 -0
  36. package/{esm2015/config/abc/onboarding.type.js → esm2020/config/abc/onboarding.type.mjs} +0 -0
  37. package/{esm2015/config/abc/page-header.type.js → esm2020/config/abc/page-header.type.mjs} +0 -0
  38. package/esm2020/config/abc/pdf.type.mjs +2 -0
  39. package/esm2020/config/abc/qr.type.mjs +2 -0
  40. package/{esm2015/config/abc/se.type.js → esm2020/config/abc/se.type.mjs} +0 -0
  41. package/{esm2015/config/abc/sg.type.js → esm2020/config/abc/sg.type.mjs} +0 -0
  42. package/{esm2015/config/abc/st.type.js → esm2020/config/abc/st.type.mjs} +0 -0
  43. package/{esm2015/config/abc/sv.type.js → esm2020/config/abc/sv.type.mjs} +0 -0
  44. package/{esm2015/config/abc/xlsx.type.js → esm2020/config/abc/xlsx.type.mjs} +0 -0
  45. package/{esm2015/config/abc/zip.type.js → esm2020/config/abc/zip.type.mjs} +0 -0
  46. package/{esm2015/config/acl/acl.type.js → esm2020/config/acl/acl.type.mjs} +0 -0
  47. package/{esm2015/config/auth/auth.type.js → esm2020/config/auth/auth.type.mjs} +0 -0
  48. package/{esm2015/config/bis/bis.type.js → esm2020/config/bis/bis.type.mjs} +0 -0
  49. package/{esm2015/config/cache/cache.type.js → esm2020/config/cache/cache.type.mjs} +0 -0
  50. package/{esm2015/config/chart/chart.type.js → esm2020/config/chart/chart.type.mjs} +0 -0
  51. package/esm2020/config/config.mjs +5 -0
  52. package/esm2020/config/config.service.mjs +37 -0
  53. package/{esm2015/config/config.types.js → esm2020/config/config.types.mjs} +0 -0
  54. package/{esm2015/config/index.js → esm2020/config/index.mjs} +0 -0
  55. package/{esm2015/config/mock/mock.type.js → esm2020/config/mock/mock.type.mjs} +0 -0
  56. package/{esm2015/config/sf/sf.type.js → esm2020/config/sf/sf.type.mjs} +0 -0
  57. package/{esm2015/config/stomp/stomp.type.js → esm2020/config/stomp/stomp.type.mjs} +0 -0
  58. package/{esm2015/config/theme/http.type.js → esm2020/config/theme/http.type.mjs} +0 -0
  59. package/{esm2015/config/theme/i18n.type.js → esm2020/config/theme/i18n.type.mjs} +0 -0
  60. package/{esm2015/config/theme/index.js → esm2020/config/theme/index.mjs} +0 -0
  61. package/{esm2015/config/theme/responsive.type.js → esm2020/config/theme/responsive.type.mjs} +0 -0
  62. package/{esm2015/config/util/array.type.js → esm2020/config/util/array.type.mjs} +0 -0
  63. package/{esm2015/config/util/currency.type.js → esm2020/config/util/currency.type.mjs} +0 -0
  64. package/esm2020/date-time/date-time.mjs +5 -0
  65. package/{esm2015/date-time/index.js → esm2020/date-time/index.mjs} +0 -0
  66. package/esm2020/date-time/picker.mjs +116 -0
  67. package/{esm2015/date-time/time.js → esm2020/date-time/time.mjs} +6 -2
  68. package/esm2020/decorator/convert.mjs +58 -0
  69. package/esm2020/decorator/decorator.mjs +5 -0
  70. package/{esm2015/decorator/index.js → esm2020/decorator/index.mjs} +0 -0
  71. package/esm2020/decorator/zone-outside.mjs +57 -0
  72. package/esm2020/form/form.mjs +5 -0
  73. package/{esm2015/form/index.js → esm2020/form/index.mjs} +0 -0
  74. package/{esm2015/form/match-control.js → esm2020/form/match-control.mjs} +0 -0
  75. package/{esm2015/form/validators.js → esm2020/form/validators.mjs} +0 -0
  76. package/esm2020/format/currency.service.mjs +238 -0
  77. package/{esm2015/format/currency.types.js → esm2020/format/currency.types.mjs} +0 -0
  78. package/esm2020/format/format.mjs +5 -0
  79. package/{esm2015/format/index.js → esm2020/format/index.mjs} +0 -0
  80. package/esm2020/format/string.mjs +85 -0
  81. package/{esm2015/format/validate.js → esm2020/format/validate.mjs} +0 -0
  82. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  83. package/{esm2015/math/in-range.js → esm2020/math/in-range.mjs} +0 -0
  84. package/{esm2015/math/index.js → esm2020/math/index.mjs} +0 -0
  85. package/esm2020/math/math.mjs +5 -0
  86. package/{esm2015/math/round.js → esm2020/math/round.mjs} +0 -0
  87. package/{esm2015/other/assert.js → esm2020/other/assert.mjs} +0 -0
  88. package/{esm2015/other/deep.js → esm2020/other/deep.mjs} +0 -0
  89. package/{esm2015/other/index.js → esm2020/other/index.mjs} +3 -1
  90. package/esm2020/other/lazy.service.mjs +104 -0
  91. package/{esm2015/other/logger.js → esm2020/other/logger.mjs} +0 -0
  92. package/esm2020/other/other.mjs +5 -0
  93. package/esm2020/other/resize.mjs +4 -0
  94. package/esm2020/other/url.mjs +13 -0
  95. package/esm2020/pipes/currency/cny.pipe.mjs +23 -0
  96. package/{esm2015/pipes/currency/index.js → esm2020/pipes/currency/index.mjs} +2 -1
  97. package/esm2020/pipes/currency/mega.pipe.mjs +29 -0
  98. package/esm2020/pipes/currency/module.mjs +19 -0
  99. package/esm2020/pipes/currency/pipe-currency.mjs +5 -0
  100. package/esm2020/pipes/currency/price.pipe.mjs +27 -0
  101. package/esm2020/pipes/filter/filter.pipe.mjs +19 -0
  102. package/{esm2015/pipes/filter/index.js → esm2020/pipes/filter/index.mjs} +0 -0
  103. package/esm2020/pipes/filter/module.mjs +17 -0
  104. package/{esm2015/other/yelon-util-other.js → esm2020/pipes/filter/pipe-filter.mjs} +1 -1
  105. package/{esm2015/pipes/format/index.js → esm2020/pipes/format/index.mjs} +0 -0
  106. package/esm2020/pipes/format/mask.pipe.mjs +34 -0
  107. package/esm2020/pipes/format/module.mjs +17 -0
  108. package/{esm2015/array/yelon-util-array.js → esm2020/pipes/format/pipe-format.mjs} +1 -1
  109. package/{esm2015/pipes/index.js → esm2020/pipes/index.mjs} +0 -0
  110. package/esm2020/pipes/pipes.mjs +5 -0
  111. package/{esm2015/token/index.js → esm2020/token/index.mjs} +0 -0
  112. package/{esm2015/token/page-visibility.js → esm2020/token/page-visibility.mjs} +0 -0
  113. package/esm2020/token/token.mjs +5 -0
  114. package/{esm2015/token/window.js → esm2020/token/window.mjs} +0 -0
  115. package/{esm2015/yelon-util.js → esm2020/yelon-util.mjs} +0 -0
  116. package/fesm2015/{yelon-util-array.js → array.mjs} +8 -10
  117. package/fesm2015/array.mjs.map +1 -0
  118. package/fesm2015/{browser.js → browser.mjs} +28 -42
  119. package/fesm2015/browser.mjs.map +1 -0
  120. package/fesm2015/{yelon-util-config.js → config.mjs} +14 -8
  121. package/fesm2015/config.mjs.map +1 -0
  122. package/fesm2015/{yelon-util-date-time.js → date-time.mjs} +1 -1
  123. package/fesm2015/date-time.mjs.map +1 -0
  124. package/fesm2015/{yelon-util-decorator.js → decorator.mjs} +8 -4
  125. package/fesm2015/decorator.mjs.map +1 -0
  126. package/fesm2015/{yelon-util-form.js → form.mjs} +1 -1
  127. package/fesm2015/form.mjs.map +1 -0
  128. package/fesm2015/{yelon-util-format.js → format.mjs} +18 -14
  129. package/fesm2015/format.mjs.map +1 -0
  130. package/fesm2015/{yelon-util-math.js → math.mjs} +1 -1
  131. package/fesm2015/math.mjs.map +1 -0
  132. package/fesm2015/{yelon-util-other.js → other.mjs} +35 -30
  133. package/fesm2015/other.mjs.map +1 -0
  134. package/fesm2015/pipe-currency.mjs +96 -0
  135. package/fesm2015/pipe-currency.mjs.map +1 -0
  136. package/fesm2015/pipe-filter.mjs +40 -0
  137. package/fesm2015/pipe-filter.mjs.map +1 -0
  138. package/fesm2015/pipe-format.mjs +55 -0
  139. package/fesm2015/pipe-format.mjs.map +1 -0
  140. package/fesm2015/{yelon-util-pipes.js → pipes.mjs} +1 -1
  141. package/fesm2015/pipes.mjs.map +1 -0
  142. package/fesm2015/{yelon-util-token.js → token.mjs} +1 -1
  143. package/fesm2015/token.mjs.map +1 -0
  144. package/fesm2015/{yelon-util.js → yelon-util.mjs} +1 -1
  145. package/fesm2015/yelon-util.mjs.map +1 -0
  146. package/fesm2020/array.mjs +285 -0
  147. package/fesm2020/array.mjs.map +1 -0
  148. package/fesm2020/browser.mjs +260 -0
  149. package/fesm2020/browser.mjs.map +1 -0
  150. package/fesm2020/config.mjs +54 -0
  151. package/fesm2020/config.mjs.map +1 -0
  152. package/fesm2020/date-time.mjs +210 -0
  153. package/fesm2020/date-time.mjs.map +1 -0
  154. package/fesm2020/decorator.mjs +121 -0
  155. package/fesm2020/decorator.mjs.map +1 -0
  156. package/fesm2020/form.mjs +118 -0
  157. package/fesm2020/form.mjs.map +1 -0
  158. package/fesm2020/format.mjs +431 -0
  159. package/fesm2020/format.mjs.map +1 -0
  160. package/fesm2020/math.mjs +85 -0
  161. package/fesm2020/math.mjs.map +1 -0
  162. package/fesm2020/other.mjs +303 -0
  163. package/fesm2020/other.mjs.map +1 -0
  164. package/fesm2020/pipe-currency.mjs +94 -0
  165. package/fesm2020/pipe-currency.mjs.map +1 -0
  166. package/fesm2020/pipe-filter.mjs +40 -0
  167. package/fesm2020/pipe-filter.mjs.map +1 -0
  168. package/fesm2020/pipe-format.mjs +55 -0
  169. package/fesm2020/pipe-format.mjs.map +1 -0
  170. package/fesm2020/pipes.mjs +8 -0
  171. package/fesm2020/pipes.mjs.map +1 -0
  172. package/fesm2020/token.mjs +38 -0
  173. package/fesm2020/token.mjs.map +1 -0
  174. package/fesm2020/yelon-util.mjs +16 -0
  175. package/fesm2020/yelon-util.mjs.map +1 -0
  176. package/{array/yelon-util-array.d.ts → form/form.d.ts} +1 -0
  177. package/form/package.json +6 -7
  178. package/format/currency.service.d.ts +3 -0
  179. package/format/format.d.ts +5 -0
  180. package/format/package.json +6 -7
  181. package/{config/yelon-util-config.d.ts → math/math.d.ts} +1 -0
  182. package/math/package.json +6 -7
  183. package/other/index.d.ts +2 -0
  184. package/other/lazy.service.d.ts +3 -0
  185. package/{decorator/yelon-util-decorator.d.ts → other/other.d.ts} +1 -0
  186. package/other/package.json +6 -7
  187. package/other/resize.d.ts +1 -0
  188. package/other/url.d.ts +2 -0
  189. package/package.json +132 -8
  190. package/pipes/currency/cny.pipe.d.ts +3 -0
  191. package/pipes/currency/index.d.ts +1 -0
  192. package/pipes/currency/mega.pipe.d.ts +3 -0
  193. package/pipes/currency/module.d.ts +7 -0
  194. package/pipes/currency/package.json +6 -7
  195. package/pipes/currency/pipe-currency.d.ts +5 -0
  196. package/pipes/currency/price.pipe.d.ts +3 -0
  197. package/pipes/filter/filter.pipe.d.ts +3 -0
  198. package/pipes/filter/module.d.ts +5 -0
  199. package/pipes/filter/package.json +6 -7
  200. package/pipes/filter/pipe-filter.d.ts +5 -0
  201. package/pipes/format/mask.pipe.d.ts +3 -0
  202. package/pipes/format/module.d.ts +5 -0
  203. package/pipes/format/package.json +6 -7
  204. package/pipes/format/pipe-format.d.ts +5 -0
  205. package/pipes/package.json +6 -7
  206. package/pipes/pipes.d.ts +5 -0
  207. package/token/package.json +6 -7
  208. package/token/token.d.ts +5 -0
  209. package/yelon-util.d.ts +1 -0
  210. package/array/yelon-util-array.metadata.json +0 -1
  211. package/browser/browser.metadata.json +0 -1
  212. package/bundles/browser.umd.js +0 -325
  213. package/bundles/browser.umd.js.map +0 -1
  214. package/bundles/yelon-util-array.umd.js +0 -641
  215. package/bundles/yelon-util-array.umd.js.map +0 -1
  216. package/bundles/yelon-util-config.umd.js +0 -411
  217. package/bundles/yelon-util-config.umd.js.map +0 -1
  218. package/bundles/yelon-util-date-time.umd.js +0 -238
  219. package/bundles/yelon-util-date-time.umd.js.map +0 -1
  220. package/bundles/yelon-util-decorator.umd.js +0 -462
  221. package/bundles/yelon-util-decorator.umd.js.map +0 -1
  222. package/bundles/yelon-util-form.umd.js +0 -135
  223. package/bundles/yelon-util-form.umd.js.map +0 -1
  224. package/bundles/yelon-util-format.umd.js +0 -785
  225. package/bundles/yelon-util-format.umd.js.map +0 -1
  226. package/bundles/yelon-util-math.umd.js +0 -104
  227. package/bundles/yelon-util-math.umd.js.map +0 -1
  228. package/bundles/yelon-util-other.umd.js +0 -714
  229. package/bundles/yelon-util-other.umd.js.map +0 -1
  230. package/bundles/yelon-util-pipes-currency.umd.js +0 -108
  231. package/bundles/yelon-util-pipes-currency.umd.js.map +0 -1
  232. package/bundles/yelon-util-pipes-filter.umd.js +0 -374
  233. package/bundles/yelon-util-pipes-filter.umd.js.map +0 -1
  234. package/bundles/yelon-util-pipes-format.umd.js +0 -66
  235. package/bundles/yelon-util-pipes-format.umd.js.map +0 -1
  236. package/bundles/yelon-util-pipes.umd.js +0 -38
  237. package/bundles/yelon-util-pipes.umd.js.map +0 -1
  238. package/bundles/yelon-util-token.umd.js +0 -49
  239. package/bundles/yelon-util-token.umd.js.map +0 -1
  240. package/bundles/yelon-util.umd.js +0 -86
  241. package/bundles/yelon-util.umd.js.map +0 -1
  242. package/config/yelon-util-config.metadata.json +0 -1
  243. package/date-time/yelon-util-date-time.metadata.json +0 -1
  244. package/decorator/yelon-util-decorator.metadata.json +0 -1
  245. package/esm2015/array/array.service.js +0 -250
  246. package/esm2015/browser/cookie.service.js +0 -104
  247. package/esm2015/browser/copy.js +0 -27
  248. package/esm2015/browser/scroll.service.js +0 -89
  249. package/esm2015/config/abc/pdf.type.js +0 -2
  250. package/esm2015/config/abc/qr.type.js +0 -2
  251. package/esm2015/config/config.service.js +0 -34
  252. package/esm2015/config/yelon-util-config.js +0 -5
  253. package/esm2015/date-time/picker.js +0 -116
  254. package/esm2015/date-time/yelon-util-date-time.js +0 -5
  255. package/esm2015/decorator/convert.js +0 -56
  256. package/esm2015/decorator/yelon-util-decorator.js +0 -5
  257. package/esm2015/decorator/zone-outside.js +0 -55
  258. package/esm2015/form/yelon-util-form.js +0 -5
  259. package/esm2015/format/currency.service.js +0 -225
  260. package/esm2015/format/string.js +0 -76
  261. package/esm2015/format/yelon-util-format.js +0 -5
  262. package/esm2015/math/yelon-util-math.js +0 -5
  263. package/esm2015/other/lazy.service.js +0 -118
  264. package/esm2015/pipes/currency/cny.pipe.js +0 -22
  265. package/esm2015/pipes/currency/mega.pipe.js +0 -26
  266. package/esm2015/pipes/currency/module.js +0 -14
  267. package/esm2015/pipes/currency/price.pipe.js +0 -26
  268. package/esm2015/pipes/currency/yelon-util-pipes-currency.js +0 -6
  269. package/esm2015/pipes/filter/filter.pipe.js +0 -15
  270. package/esm2015/pipes/filter/module.js +0 -12
  271. package/esm2015/pipes/filter/yelon-util-pipes-filter.js +0 -5
  272. package/esm2015/pipes/format/mask.pipe.js +0 -30
  273. package/esm2015/pipes/format/module.js +0 -12
  274. package/esm2015/pipes/format/yelon-util-pipes-format.js +0 -5
  275. package/esm2015/pipes/yelon-util-pipes.js +0 -5
  276. package/esm2015/token/yelon-util-token.js +0 -5
  277. package/fesm2015/browser.js.map +0 -1
  278. package/fesm2015/yelon-util-array.js.map +0 -1
  279. package/fesm2015/yelon-util-config.js.map +0 -1
  280. package/fesm2015/yelon-util-date-time.js.map +0 -1
  281. package/fesm2015/yelon-util-decorator.js.map +0 -1
  282. package/fesm2015/yelon-util-form.js.map +0 -1
  283. package/fesm2015/yelon-util-format.js.map +0 -1
  284. package/fesm2015/yelon-util-math.js.map +0 -1
  285. package/fesm2015/yelon-util-other.js.map +0 -1
  286. package/fesm2015/yelon-util-pipes-currency.js +0 -87
  287. package/fesm2015/yelon-util-pipes-currency.js.map +0 -1
  288. package/fesm2015/yelon-util-pipes-filter.js +0 -32
  289. package/fesm2015/yelon-util-pipes-filter.js.map +0 -1
  290. package/fesm2015/yelon-util-pipes-format.js +0 -47
  291. package/fesm2015/yelon-util-pipes-format.js.map +0 -1
  292. package/fesm2015/yelon-util-pipes.js.map +0 -1
  293. package/fesm2015/yelon-util-token.js.map +0 -1
  294. package/fesm2015/yelon-util.js.map +0 -1
  295. package/form/yelon-util-form.d.ts +0 -4
  296. package/form/yelon-util-form.metadata.json +0 -1
  297. package/format/yelon-util-format.d.ts +0 -4
  298. package/format/yelon-util-format.metadata.json +0 -1
  299. package/math/yelon-util-math.d.ts +0 -4
  300. package/math/yelon-util-math.metadata.json +0 -1
  301. package/other/yelon-util-other.d.ts +0 -4
  302. package/other/yelon-util-other.metadata.json +0 -1
  303. package/pipes/currency/yelon-util-pipes-currency.d.ts +0 -5
  304. package/pipes/currency/yelon-util-pipes-currency.metadata.json +0 -1
  305. package/pipes/filter/yelon-util-pipes-filter.d.ts +0 -4
  306. package/pipes/filter/yelon-util-pipes-filter.metadata.json +0 -1
  307. package/pipes/format/yelon-util-pipes-format.d.ts +0 -4
  308. package/pipes/format/yelon-util-pipes-format.metadata.json +0 -1
  309. package/pipes/yelon-util-pipes.d.ts +0 -4
  310. package/pipes/yelon-util-pipes.metadata.json +0 -1
  311. package/token/yelon-util-token.d.ts +0 -4
  312. package/token/yelon-util-token.metadata.json +0 -1
  313. package/yelon-util.metadata.json +0 -1
@@ -1,116 +0,0 @@
1
- import { addDays, addSeconds, differenceInCalendarDays, format } from 'date-fns';
2
- // TODO: timezone process
3
- export class DateTimePickerUtil {
4
- /**
5
- * Current local time
6
- *
7
- * 当前本地时间
8
- */
9
- get now() {
10
- return new Date();
11
- }
12
- /**
13
- * Current local date (not including time part)
14
- *
15
- * 当前本地日期(不包含时间部分)
16
- */
17
- get date() {
18
- return this.removeTime(this.now);
19
- }
20
- /**
21
- * Remove the time part of the date
22
- *
23
- * 移除日期的时间部分
24
- */
25
- removeTime(d) {
26
- return new Date(d.toDateString());
27
- }
28
- /**
29
- * Format date-time
30
- *
31
- * 格式化日期
32
- */
33
- format(d, formatString = 'yyyy-MM-dd HH:mm:ss') {
34
- return format(d, formatString);
35
- }
36
- genTick(count) {
37
- return new Array(count).fill(0).map((_, idx) => idx);
38
- }
39
- /**
40
- * Calculate the number of days between two dates, `0` means the same day
41
- *
42
- * 计算两个日期相差天数,`0` 表示同一天
43
- */
44
- getDiffDays(dateLeft, dateRight) {
45
- return differenceInCalendarDays(dateLeft, typeof dateRight === 'number' ? addDays(this.date, dateRight) : dateRight || this.date);
46
- }
47
- /**
48
- * Disabled Before date (Default: today), Generally serves `nzDisabledDate`
49
- *
50
- * 禁用之前日期(默认:今天),一般服务于 `nzDisabledDate`
51
- */
52
- disabledBeforeDate(options) {
53
- return (d) => this.getDiffDays(d, options === null || options === void 0 ? void 0 : options.offsetDays) < 0;
54
- }
55
- /**
56
- * Disabled After date (Default: today), Generally serves `nzDisabledDate`
57
- *
58
- * 禁用之后日期(默认:今天),一般服务于 `nzDisabledDate`
59
- */
60
- disabledAfterDate(options) {
61
- return (d) => this.getDiffDays(d, options === null || options === void 0 ? void 0 : options.offsetDays) > 0;
62
- }
63
- baseDisabledTime(type, offsetSeconds) {
64
- const tick24 = this.genTick(24);
65
- const tick60 = this.genTick(60);
66
- return (current) => {
67
- const cur = current;
68
- if (cur == null) {
69
- return {};
70
- }
71
- const now = addSeconds(this.now, offsetSeconds || 0);
72
- const nowHours = now.getHours();
73
- const nowMinutes = now.getMinutes();
74
- const curHours = cur.getHours();
75
- const isToday = this.getDiffDays(this.removeTime(cur)) === 0;
76
- return {
77
- nzDisabledHours: () => {
78
- if (!isToday)
79
- return [];
80
- return type === 'before' ? tick24.slice(0, nowHours) : tick24.slice(nowHours + 1);
81
- },
82
- nzDisabledMinutes: () => {
83
- if (isToday && curHours === nowHours) {
84
- return type === 'before' ? tick60.slice(0, nowMinutes) : tick60.slice(nowMinutes + 1);
85
- }
86
- return [];
87
- },
88
- nzDisabledSeconds: () => {
89
- if (isToday && curHours === nowHours && cur.getMinutes() === nowMinutes) {
90
- const nowSeconds = now.getSeconds();
91
- return type === 'before' ? tick60.slice(0, nowSeconds) : tick60.slice(nowSeconds + 1);
92
- }
93
- return [];
94
- }
95
- };
96
- };
97
- }
98
- /**
99
- * Disabled Before time (Default: now), Generally serves `nzDisabledTime`
100
- *
101
- * 禁用之前时间(默认:现在),一般服务于 `nzDisabledTime`
102
- */
103
- disabledBeforeTime(options) {
104
- return this.baseDisabledTime('before', options === null || options === void 0 ? void 0 : options.offsetSeconds);
105
- }
106
- /**
107
- * Disabled After time (Default: now), Generally serves `nzDisabledTime`
108
- *
109
- * 禁用之后时间(默认:现在),一般服务于 `nzDisabledTime`
110
- */
111
- disabledAfterTime(options) {
112
- return this.baseDisabledTime('after', options === null || options === void 0 ? void 0 : options.offsetSeconds);
113
- }
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tcbiAgICAgIGlmIChjdXIgPT0gbnVsbCkge1xuICAgICAgICByZXR1cm4ge30gYXMgTnpTYWZlQW55O1xuICAgICAgfVxuICAgICAgY29uc3Qgbm93ID0gYWRkU2Vjb25kcyh0aGlzLm5vdywgb2Zmc2V0U2Vjb25kcyB8fCAwKTtcbiAgICAgIGNvbnN0IG5vd0hvdXJzID0gbm93LmdldEhvdXJzKCk7XG4gICAgICBjb25zdCBub3dNaW51dGVzID0gbm93LmdldE1pbnV0ZXMoKTtcbiAgICAgIGNvbnN0IGN1ckhvdXJzID0gY3VyLmdldEhvdXJzKCk7XG4gICAgICBjb25zdCBpc1RvZGF5ID0gdGhpcy5nZXREaWZmRGF5cyh0aGlzLnJlbW92ZVRpbWUoY3VyKSkgPT09IDA7XG4gICAgICByZXR1cm4ge1xuICAgICAgICBuekRpc2FibGVkSG91cnM6ICgpID0+IHtcbiAgICAgICAgICBpZiAoIWlzVG9kYXkpIHJldHVybiBbXTtcbiAgICAgICAgICByZXR1cm4gdHlwZSA9PT0gJ2JlZm9yZScgPyB0aWNrMjQuc2xpY2UoMCwgbm93SG91cnMpIDogdGljazI0LnNsaWNlKG5vd0hvdXJzICsgMSk7XG4gICAgICAgIH0sXG4gICAgICAgIG56RGlzYWJsZWRNaW51dGVzOiAoKSA9PiB7XG4gICAgICAgICAgaWYgKGlzVG9kYXkgJiYgY3VySG91cnMgPT09IG5vd0hvdXJzKSB7XG4gICAgICAgICAgICByZXR1cm4gdHlwZSA9PT0gJ2JlZm9yZScgPyB0aWNrNjAuc2xpY2UoMCwgbm93TWludXRlcykgOiB0aWNrNjAuc2xpY2Uobm93TWludXRlcyArIDEpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgIH0sXG4gICAgICAgIG56RGlzYWJsZWRTZWNvbmRzOiAoKSA9PiB7XG4gICAgICAgICAgaWYgKGlzVG9kYXkgJiYgY3VySG91cnMgPT09IG5vd0hvdXJzICYmIGN1ci5nZXRNaW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IHJldHVybiB0aGlzLmJhc2VEaXNhYmxlZFRpbWUoJ2FmdGVyJywgb3B0aW9ucz8ub2Zmc2V0U2Vjb25kcyk7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IGRhdGVUaW1lUGlja2VyVXRpbCA9IG5ldyBEYXRlVGltZVBpY2tlclV0aWwoKTtcbiJdfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1kYXRlLXRpbWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2RhdGUtdGltZS95ZWxvbi11dGlsLWRhdGUtdGltZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -1,56 +0,0 @@
1
- import { warn } from '@yelon/util/other';
2
- function propDecoratorFactory(name, fallback, defaultValue) {
3
- function propDecorator(target, propName, originalDescriptor) {
4
- const privatePropName = `$$__${propName}`;
5
- if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
6
- warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
7
- }
8
- Object.defineProperty(target, privatePropName, {
9
- configurable: true,
10
- writable: true
11
- });
12
- return {
13
- get() {
14
- return originalDescriptor && originalDescriptor.get
15
- ? originalDescriptor.get.bind(this)()
16
- : this[privatePropName];
17
- },
18
- set(value) {
19
- if (originalDescriptor && originalDescriptor.set) {
20
- originalDescriptor.set.bind(this)(fallback(value, defaultValue));
21
- }
22
- this[privatePropName] = fallback(value, defaultValue);
23
- }
24
- };
25
- }
26
- return propDecorator;
27
- }
28
- export function toBoolean(value, defaultValue = false) {
29
- return value == null ? defaultValue : `${value}` !== 'false';
30
- }
31
- /**
32
- * Input decorator that handle a prop to do get/set automatically with toBoolean
33
- *
34
- * ```ts
35
- * {AT}Input() {AT}InputBoolean() visible: boolean = false;
36
- * {AT}Input() {AT}InputBoolean(null) visible: boolean = false;
37
- * ```
38
- */
39
- export function InputBoolean(defaultValue = false) {
40
- return propDecoratorFactory('InputBoolean', toBoolean, defaultValue);
41
- }
42
- export function toNumber(value, fallbackValue = 0) {
43
- return !isNaN(parseFloat(value)) && !isNaN(Number(value)) ? Number(value) : fallbackValue;
44
- }
45
- /**
46
- * Input decorator that handle a prop to do get/set automatically with toNumber
47
- *
48
- * ```ts
49
- * {AT}Input() {AT}InputNumber() visible: number = 1;
50
- * {AT}Input() {AT}InputNumber(null) visible: number = 2;
51
- * ```
52
- */
53
- export function InputNumber(defaultValue = 0) {
54
- return propDecoratorFactory('InputNumber', toNumber, defaultValue);
55
- }
56
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZGVjb3JhdG9yL2NvbnZlcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBS3pDLFNBQVMsb0JBQW9CLENBQzNCLElBQVksRUFDWixRQUFzQyxFQUN0QyxZQUF1QjtJQUV2QixTQUFTLGFBQWEsQ0FDcEIsTUFBaUIsRUFDakIsUUFBZ0IsRUFDaEIsa0JBQXVEO1FBRXZELE1BQU0sZUFBZSxHQUFHLE9BQU8sUUFBUSxFQUFFLENBQUM7UUFFMUMsSUFBSSxNQUFNLENBQUMsU0F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dfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1kZWNvcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2RlY29yYXRvci95ZWxvbi11dGlsLWRlY29yYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -1,55 +0,0 @@
1
- import { warn } from '@yelon/util/other';
2
- function makeFn(type, options) {
3
- return (_, __, descriptor) => {
4
- const source = descriptor.value;
5
- descriptor.value = function (...data) {
6
- const that = this;
7
- const ngZone = that[(options === null || options === void 0 ? void 0 : options.ngZoneName) || 'ngZone'];
8
- if (!ngZone) {
9
- warn(`ZoneOutside: Decorator should have 'ngZone' property with 'NgZone' class.`);
10
- return source.call(this, ...data);
11
- }
12
- let res;
13
- ngZone[type](() => {
14
- res = source.call(this, ...data);
15
- });
16
- return res;
17
- };
18
- return descriptor;
19
- };
20
- }
21
- /**
22
- * The decoration method runs in `runOutsideAngular`
23
- *
24
- * 装饰方法运行在 `runOutsideAngular` 内
25
- *
26
- * ```ts
27
- * class MockClass {
28
- * constructor(public ngZone: NgZone) {}
29
- *
30
- * {AT}ZoneOutside()
31
- * runOutsideAngular(): void {}
32
- * }
33
- * ```
34
- */
35
- export function ZoneOutside(options) {
36
- return makeFn('runOutsideAngular', options);
37
- }
38
- /**
39
- * The decoration method runs in `run`
40
- *
41
- * 装饰方法运行在 `run` 内
42
- *
43
- * ```ts
44
- * class MockClass {
45
- * constructor(public ngZone: NgZone) {}
46
- *
47
- * {AT}ZoneRun()
48
- * run(): void {}
49
- * }
50
- * ```
51
- */
52
- export function ZoneRun(options) {
53
- return makeFn('run', options);
54
- }
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiem9uZS1vdXRzaWRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9kZWNvcmF0b3Ivem9uZS1vdXRzaWRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQVF6QyxTQUFTLE1BQU0sQ0FBQyxJQUFpQyxFQUFFLE9BQXFCO0lBQ3RFLE9BQU8sQ0FBQyxDQUFDLEVBQUUsRUFBRSxFQUFFLFVBQVUsRUFBRSxFQUFFO1FBQzNCLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUM7UUFDaEMsVUFBVSxDQUFDLEtBQUssR0FBRyxVQUFVLEdBQUcsSUFBaUI7WUFDL0MsTUFBTSxJQUFJLEdBQUcsSUFBaUIsQ0FBQztZQUMvQixNQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsQ0FBQSxPQUFPLGFBQVAsT0FBTyx1QkFBUCxPQUFPLENBQUUsVUFBVSxLQUFJLFFBQVEsQ0FBQyxDQUFDO1lBQ3JELElBQUksQ0FBQyxNQUFNLEVBQUU7Z0JBQ1gsSUFBSSxDQUFDLDJFQUEyRSxDQUFDLENBQUM7Z0JBQ2xGLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FBQzthQUNuQztZQUNELElBQUksR0FBYyxDQUFDO1lBQ25CLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyx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t9XG4gKiB9XG4gKiBgYGBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIFpvbmVPdXRzaWRlKG9wdGlvbnM/OiBab25lT3B0aW9ucyk6IERlY29yYXRvclR5cGUge1xuICByZXR1cm4gbWFrZUZuKCdydW5PdXRzaWRlQW5ndWxhcicsIG9wdGlvbnMpO1xufVxuXG4vKipcbiAqIFRoZSBkZWNvcmF0aW9uIG1ldGhvZCBydW5zIGluIGBydW5gXG4gKlxuICog6KOF6aWw5pa55rOV6L+Q6KGM5ZyoIGBydW5gIOWGhVxuICpcbiAqIGBgYHRzXG4gKiBjbGFzcyBNb2NrQ2xhc3Mge1xuICogIGNvbnN0cnVjdG9yKHB1YmxpYyBuZ1pvbmU6IE5nWm9uZSkge31cbiAqXG4gKiAge0FUfVpvbmVSdW4oKVxuICogIHJ1bigpOiB2b2lkIHt9XG4gKiB9XG4gKiBgYGBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIFpvbmVSdW4ob3B0aW9ucz86IFpvbmVPcHRpb25zKTogRGVjb3JhdG9yVHlwZSB7XG4gIHJldHVybiBtYWtlRm4oJ3J1bicsIG9wdGlvbnMpO1xufVxuIl19
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1mb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9mb3JtL3llbG9uLXV0aWwtZm9ybS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -1,225 +0,0 @@
1
- import { CurrencyPipe, formatNumber } from '@angular/common';
2
- import { DEFAULT_CURRENCY_CODE, Inject, Injectable, LOCALE_ID } from '@angular/core';
3
- import { YunzaiConfigService } from '@yelon/util/config';
4
- import { CurrencyMega_Powers } from './currency.types';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@yelon/util/config";
7
- export class CurrencyService {
8
- constructor(cog, locale, _defaultCurrencyCode = 'USD') {
9
- this.locale = locale;
10
- this.currencyPipe = new CurrencyPipe(locale, _defaultCurrencyCode);
11
- this.c = cog.merge('utilCurrency', {
12
- startingUnit: 'yuan',
13
- megaUnit: { Q: '京', T: '兆', B: '亿', M: '万', K: '千' },
14
- precision: 2,
15
- ignoreZeroPrecision: true
16
- });
17
- }
18
- /**
19
- * Format a number with commas as thousands separators
20
- *
21
- * 格式化货币,用逗号将数字格式化为千位分隔符
22
- * ```ts
23
- * 10000 => `10,000`
24
- * 10000.567 => `10,000.57`
25
- * ```
26
- */
27
- format(value, options) {
28
- options = Object.assign({ startingUnit: this.c.startingUnit, precision: this.c.precision, ignoreZeroPrecision: this.c.ignoreZeroPrecision, ngCurrency: this.c.ngCurrency }, options);
29
- let truthValue = Number(value);
30
- if (value == null || isNaN(truthValue)) {
31
- return '';
32
- }
33
- if (options.startingUnit === 'cent') {
34
- truthValue = truthValue / 100;
35
- }
36
- if (options.ngCurrency != null) {
37
- const cur = options.ngCurrency;
38
- return this.currencyPipe.transform(truthValue, cur.currencyCode, cur.display, cur.digitsInfo, cur.locale || this.locale);
39
- }
40
- const res = formatNumber(truthValue, this.locale, `.${options.ignoreZeroPrecision ? 1 : options.precision}-${options.precision}`);
41
- return options.ignoreZeroPrecision ? res.replace(/(?:\.[0]+)$/g, '') : res;
42
- }
43
- /**
44
- * Large number format filter
45
- *
46
- * 大数据格式化
47
- * ```ts
48
- * 1000 => { value: '1', unit: 'K', unitI18n: '千' }
49
- * 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
50
- * ```
51
- */
52
- mega(value, options) {
53
- options = Object.assign({ precision: this.c.precision, unitI18n: this.c.megaUnit, startingUnit: this.c.startingUnit }, options);
54
- let num = Number(value);
55
- const res = { raw: value, value: '', unit: '', unitI18n: '' };
56
- if (isNaN(num) || num === 0) {
57
- res.value = value.toString();
58
- return res;
59
- }
60
- if (options.startingUnit === 'cent') {
61
- num = num / 100;
62
- }
63
- let abs = Math.abs(+num);
64
- const rounder = Math.pow(10, options.precision);
65
- const isNegative = num < 0;
66
- for (const p of CurrencyMega_Powers) {
67
- let reduced = abs / p.value;
68
- reduced = Math.round(reduced * rounder) / rounder;
69
- if (reduced >= 1) {
70
- abs = reduced;
71
- res.unit = p.unit;
72
- break;
73
- }
74
- }
75
- res.value = (isNegative ? '-' : '') + abs;
76
- res.unitI18n = options.unitI18n[res.unit];
77
- return res;
78
- }
79
- /**
80
- * Converted into RMB notation.
81
- *
82
- * 转化成人民币表示法
83
- */
84
- cny(value, options) {
85
- options = Object.assign({ inWords: true, minusSymbol: '负', startingUnit: this.c.startingUnit }, options);
86
- value = Number(value);
87
- if (isNaN(value)) {
88
- return '';
89
- }
90
- if (options.startingUnit === 'cent') {
91
- value = value / 100;
92
- }
93
- value = value.toString();
94
- let integer;
95
- let decimal;
96
- [integer, decimal] = value.split('.');
97
- let symbol = '';
98
- if (integer.startsWith('-')) {
99
- symbol = options.minusSymbol;
100
- integer = integer.substr(1);
101
- }
102
- if (/^-?\d+$/.test(value)) {
103
- decimal = null;
104
- }
105
- integer = (+integer).toString();
106
- const inWords = options.inWords;
107
- const unit = {
108
- num: inWords
109
- ? ['', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '点']
110
- : ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '点'],
111
- radice: inWords
112
- ? [
113
- '',
114
- '拾',
115
- '佰',
116
- '仟',
117
- '万',
118
- '拾',
119
- '佰',
120
- '仟',
121
- '亿',
122
- '拾',
123
- '佰',
124
- '仟',
125
- '万亿',
126
- '拾',
127
- '佰',
128
- '仟',
129
- '兆',
130
- '拾',
131
- '佰',
132
- '仟'
133
- ]
134
- : [
135
- '',
136
- '十',
137
- '百',
138
- '千',
139
- '万',
140
- '十',
141
- '百',
142
- '千',
143
- '亿',
144
- '十',
145
- '百',
146
- '千',
147
- '万亿',
148
- '十',
149
- '百',
150
- '千',
151
- '兆',
152
- '十',
153
- '百',
154
- '千'
155
- ],
156
- dec: ['角', '分', '厘', '毫']
157
- };
158
- if (inWords) {
159
- value = (+value).toFixed(5).toString();
160
- }
161
- let integerRes = '';
162
- const integerCount = integer.length;
163
- if (integer === '0' || integerCount === 0) {
164
- integerRes = '零';
165
- }
166
- else {
167
- let cnDesc = '';
168
- for (let i = 0; i < integerCount; i++) {
169
- const n = +integer[i];
170
- const j = integerCount - i - 1;
171
- const isZero = i > 1 && n !== 0 && integer[i - 1] === '0';
172
- const cnZero = isZero ? '零' : '';
173
- const isEmpptyUnit = (n === 0 && j % 4 !== 0) || integer.substr(i - 3, 4) === '0000';
174
- const descMark = cnDesc;
175
- let cnNum = unit.num[n];
176
- cnDesc = isEmpptyUnit ? '' : unit.radice[j];
177
- // 第一位是一十
178
- if (i === 0 && cnNum === '一' && cnDesc === '十')
179
- cnNum = '';
180
- const isChangeEr = n > 1 &&
181
- cnNum === '二' && // 去除首位
182
- ['', '十', '百'].indexOf(cnDesc) === -1 && // 不读两\两十\两百
183
- descMark !== '十'; // 不读十两
184
- if (isChangeEr)
185
- cnNum = '两';
186
- integerRes += cnZero + cnNum + cnDesc;
187
- }
188
- }
189
- // 小数部分拼接
190
- let decimalRes = '';
191
- const decimalCount = decimal ? decimal.toString().length : 0;
192
- if (decimal === null) {
193
- decimalRes = inWords ? '整' : '';
194
- }
195
- else if (decimal === '0') {
196
- decimalRes = '零';
197
- }
198
- else {
199
- for (let i = 0; i < decimalCount; i++) {
200
- if (inWords && i > unit.dec.length - 1)
201
- break;
202
- const n = decimal[i];
203
- const cnZero = n === '0' ? '零' : '';
204
- const cnNum = unit.num[+n];
205
- const cnDesc = inWords ? unit.dec[i] : '';
206
- decimalRes += cnZero + cnNum + cnDesc;
207
- }
208
- }
209
- const ret = symbol +
210
- (inWords
211
- ? integerRes + (decimalRes === '零' ? '元整' : `元${decimalRes}`)
212
- : integerRes + (decimalRes === '' ? '' : `点${decimalRes}`));
213
- return ret;
214
- }
215
- }
216
- CurrencyService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(i0.ɵɵinject(i1.YunzaiConfigService), i0.ɵɵinject(i0.LOCALE_ID), i0.ɵɵinject(i0.DEFAULT_CURRENCY_CODE)); }, token: CurrencyService, providedIn: "root" });
217
- CurrencyService.decorators = [
218
- { type: Injectable, args: [{ providedIn: 'root' },] }
219
- ];
220
- CurrencyService.ctorParameters = () => [
221
- { type: YunzaiConfigService },
222
- { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] },
223
- { type: String, decorators: [{ type: Inject, args: [DEFAULT_CURRENCY_CODE,] }] }
224
- ];
225
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVuY3kuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybWF0L2N1cnJlbmN5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUM3RCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFJckYsT0FBTyxFQUFFLG1CQUFtQixFQUE0QixNQUFNLG9CQUFvQixDQUFDO0FBRW5GLE9BQU8sRUFLTCxtQkFBbUIsRUFDcEIsTUF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GVjaW1hbF0gPSB2YWx1ZS5zcGxpdCgnLicpO1xuICAgIGxldCBzeW1ib2wgPSAnJztcbiAgICBpZiAoaW50ZWdlci5zdGFydHNXaXRoKCctJykpIHtcbiAgICAgIHN5bWJvbCA9IG9wdGlvbnMubWludXNTeW1ib2whO1xuICAgICAgaW50ZWdlciA9IGludGVnZXIuc3Vic3RyKDEpO1xuICAgIH1cbiAgICBpZiAoL14tP1xcZCskLy50ZXN0KHZhbHVlKSkge1xuICAgICAgZGVjaW1hbCA9IG51bGw7XG4gICAgfVxuICAgIGludGVnZXIgPSAoK2ludGVnZXIpLnRvU3RyaW5nKCk7XG4gICAgY29uc3QgaW5Xb3JkcyA9IG9wdGlvbnMuaW5Xb3JkcztcbiAgICBjb25zdCB1bml0OiB7IFtrZXk6IHN0cmluZ106IHN0cmluZ1tdIH0gPSB7XG4gICAgICBudW06IGluV29yZHNcbiAgICAgICAgPyBbJycsICflo7knLCAn6LSwJywgJ+WPgScsICfogoYnLCAn5LyNJywgJ+mZhicsICfmn5InLCAn5o2MJywgJ+eOlicsICfngrknXVxuICAgICAgICA6IFsnJywgJ+S4gCcsICfkuownLCAn5LiJJywgJ+WbmycsICfkupQnLCAn5YWtJywgJ+S4gycsICflhasnLCAn5LmdJywgJ+eCuSddLFxuICAgICAgcmFkaWNlOiBpbldvcmRzXG4gICAgICAgID8gW1xuICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nycsXG4gICAgICAgICAgICAn5LiHJyxcbiAgICAgICAgICAgICfmi74nLFxuICAgICAgICAgICAgJ+S9sCcsXG4gICAgICAgICAgICAn5LufJyxcbiAgICAgICAgICAgICfkur8nLFxuICAgICAgICAgICAgJ+aLvicsXG4gICAgICAgICAgICAn5L2wJyxcbiAgICAgICAgICAgICfku58nLFxuICAgICAgICAgICAgJ+S4h+S6vycsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nycsXG4gICAgICAgICAgICAn5YWGJyxcbiAgICAgICAgICAgICfmi74nLFxuICAgICAgICAgICAgJ+S9sCcsXG4gICAgICAgICAgICAn5LufJ1xuICAgICAgICAgIF1cbiAgICAgICAgOiBbXG4gICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJyxcbiAgICAgICAgICAgICfkuIcnLFxuICAgICAgICAgICAgJ+WNgScsXG4gICAgICAgICAgICAn55m+JyxcbiAgICAgICAgICAgICfljYMnLFxuICAgICAgICAgICAgJ+S6vycsXG4gICAgICAgICAgICAn5Y2BJyxcbiAgICAgICAgICAgICfnmb4nLFxuICAgICAgICAgICAgJ+WNgycsXG4gICAgICAgICAgICAn5LiH5Lq/JyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJyxcbiAgICAgICAgICAgICflhYYnLFxuICAgICAgICAgICAgJ+WNgScsXG4gICAgICAgICAgICAn55m+JyxcbiAgICAgICAgICAgICfljYMnXG4gICAgICAgICAgXSxcbiAgICAgIGRlYzogWyfop5InLCAn5YiGJywgJ+WOmCcsICfmr6snXVxuICAgIH07XG4gICAgaWYgKGluV29yZHMpIHtcbiAgICAgIHZhbHVlID0gKCt2YWx1ZSkudG9GaXhlZCg1KS50b1N0cmluZygpO1xuICAgIH1cbiAgICBsZXQgaW50ZWdlclJlcyA9ICcnO1xuICAgIGNvbnN0IGludGVnZXJDb3VudCA9IGludGVnZXIubGVuZ3RoO1xuICAgIGlmIChpbnRlZ2VyID09PSAnMCcgfHwgaW50ZWdlckNvdW50ID09PSAwKSB7XG4gICAgICBpbnRlZ2VyUmVzID0gJ+mbtic7XG4gICAgfSBlbHNlIHtcbiAgICAgIGxldCBjbkRlc2MgPSAnJztcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaW50ZWdlckNvdW50OyBpKyspIHtcbiAgICAgICAgY29uc3QgbiA9ICtpbnRlZ2VyW2ldO1xuICAgICAgICBjb25zdCBqID0gaW50ZWdlckNvdW50IC0gaSAtIDE7XG4gICAgICAgIGNvbnN0IGlzWmVybyA9IGkgPiAxICYmIG4gIT09IDAgJiYgaW50ZWdlcltpIC0gMV0gPT09ICcwJztcbiAgICAgICAgY29uc3QgY25aZXJvID0gaXNaZXJvID8gJ+mbticgOiAnJztcbiAgICAgICAgY29uc3QgaXNFbXBwdHlVbml0ID0gKG4gPT09IDAgJiYgaiAlIDQgIT09IDApIHx8IGludGVnZXIuc3Vic3RyKGkgLSAzLCA0KSA9PT0gJzAwMDAnO1xuICAgICAgICBjb25zdCBkZXNjTWFyayA9IGNuRGVzYztcbiAgICAgICAgbGV0IGNuTnVtID0gdW5pdC5udW1bbl07XG5cbiAgICAgICAgY25EZXNjID0gaXNFbXBwdHlVbml0ID8gJycgOiB1bml0LnJhZGljZVtqXTtcbiAgICAgICAgLy8g56ys5LiA5L2N5piv5LiA5Y2BXG4gICAgICAgIGlmIChpID09PSAwICYmIGNuTnVtID09PSAn5LiAJyAmJiBjbkRlc2MgPT09ICfljYEnKSBjbk51bSA9ICcnO1xuICAgICAgICBjb25zdCBpc0NoYW5nZUVyID1cbiAgICAgICAgICBuID4gMSAmJlxuICAgICAgICAgIGNuTnVtID09PSAn5LqMJyAmJiAvLyDljrvpmaTpppbkvY1cbiAgICAgICAgICBbJycsICfljYEnLCAn55m+J10uaW5kZXhPZihjbkRlc2MpID09PSAtMSAmJiAvLyDkuI3or7vkuKRcXOS4pOWNgVxc5Lik55m+XG4gICAgICAgICAgZGVzY01hcmsgIT09ICfljYEnOyAvLyDkuI3or7vljYHkuKRcbiAgICAgICAgaWYgKGlzQ2hhbmdlRXIpIGNuTnVtID0gJ+S4pCc7XG4gICAgICAgIGludGVnZXJSZXMgKz0gY25aZXJvICsgY25OdW0gKyBjbkRlc2M7XG4gICAgICB9XG4gIC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0=
@@ -1,76 +0,0 @@
1
- import { deepGet } from '@yelon/util/other';
2
- /**
3
- * String formatting
4
- *
5
- * 字符串格式化
6
- * ```
7
- * format('this is ${name}', { name: 'asdf' })
8
- * // output: this is asdf
9
- * format('this is ${user.name}', { user: { name: 'asdf' } }, true)
10
- * // output: this is asdf
11
- * ```
12
- */
13
- export function format(str, obj, needDeepGet = false) {
14
- return (str || '').replace(/\${([^}]+)}/g, (_work, key) => needDeepGet ? deepGet(obj, key.split('.'), '') : (obj || {})[key] || '');
15
- }
16
- /**
17
- * Format mask
18
- *
19
- * 格式化掩码
20
- *
21
- * | 字符 | 描述 |
22
- * | --- | --- |
23
- * | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |
24
- * | `9` | 任意数字 |
25
- * | `#` | 任意字符 |
26
- * | `U` | 转换大写 |
27
- * | `L` | 转换小写 |
28
- * | `*` | 转换为 `*` 字符 |
29
- *
30
- * ```ts
31
- * formatMask('123', '(###)') => (123)
32
- * formatMask('15900000000', '999****9999') => 159****0000
33
- * ```
34
- */
35
- export function formatMask(value, option) {
36
- if (!value) {
37
- return '';
38
- }
39
- const opt = Object.assign({}, (typeof option === 'string' ? { mask: option } : option));
40
- const tokens = Object.assign({ '0': { pattern: /\d/, default: '0' }, '9': { pattern: /\d/ }, '#': { pattern: /[a-zA-Z0-9]/ }, U: {
41
- pattern: /[a-zA-Z]/,
42
- transform: char => char.toLocaleUpperCase()
43
- }, L: {
44
- pattern: /[a-zA-Z]/,
45
- transform: char => char.toLocaleLowerCase()
46
- }, '*': {
47
- pattern: /.*/,
48
- transform: _ => `*`
49
- } }, opt.tokens);
50
- const splitValue = value.split('');
51
- return opt.mask
52
- .split('')
53
- .reduce((res, cur) => {
54
- var _a;
55
- const token = tokens[cur];
56
- if (!token) {
57
- res.push(cur);
58
- return res;
59
- }
60
- const value = (_a = splitValue.shift()) !== null && _a !== void 0 ? _a : '';
61
- if (!token.pattern.test(value)) {
62
- if (token.default)
63
- res.push(token.default);
64
- return res;
65
- }
66
- if (typeof token.transform === 'function') {
67
- res.push(token.transform(value));
68
- }
69
- else {
70
- res.push(value);
71
- }
72
- return res;
73
- }, [])
74
- .join('');
75
- }
76
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9mb3JtYXQvc3RyaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUU1Qzs7Ozs7Ozs7OztHQVVHO0FBQ0gsTUFBTSxVQUFVLE1BQU0sQ0FDcEIsR0FBOEIsRUFDOUIsR0FBaUMsRUFDakMsY0FBdUIsS0FBSztJQUU1QixPQUFPLENBQUMsR0FBRyxJQUFJLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLEVBQUUsQ0FBQyxLQUFhLEVBQUUsR0FBVyxFQUFFLEVBQUUsQ0FDeEUsV0FBVyxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxJQUFJLEVBQUUsQ0FDeEUsQ0FBQztBQUNKLENBQUM7QUFhRDs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBa0JHO0FBQ0gsTUFBTSxVQUFVLFVBQVUsQ0FBQyxLQUFhLEVBQUUsTUFBaUM7SUFDekUsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE9BQU8sRUFBRSxDQUFDO0tBQ1g7SUFDRCxNQUFNLEdBQUcscUJBQ0osQ0FBQyxPQUFPL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EtekEtWl0vLFxuICAgICAgdHJhbnNmb3JtOiBjaGFyID0+IGNoYXIudG9Mb2NhbGVMb3dlckNhc2UoKVxuICAgIH0sXG4gICAgJyonOiB7XG4gICAgICBwYXR0ZXJuOiAvLiovLFxuICAgICAgdHJhbnNmb3JtOiBfID0+IGAqYFxuICAgIH0sXG4gICAgLi4ub3B0LnRva2Vuc1xuICB9O1xuXG4gIGNvbnN0IHNwbGl0VmFsdWUgPSB2YWx1ZS5zcGxpdCgnJyk7XG4gIHJldHVybiBvcHQubWFza1xuICAgIC5zcGxpdCgnJylcbiAgICAucmVkdWNlKChyZXMsIGN1cikgPT4ge1xuICAgICAgY29uc3QgdG9rZW4gPSB0b2tlbnNbY3VyXTtcbiAgICAgIGlmICghdG9rZW4pIHtcbiAgICAgICAgcmVzLnB1c2goY3VyKTtcbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgIH1cblxuICAgICAgY29uc3QgdmFsdWUgPSBzcGxpdFZhbHVlLnNoaWZ0KCkgPz8gJyc7XG4gICAgICBpZiAoIXRva2VuLnBhdHRlcm4udGVzdCh2YWx1ZSkpIHtcbiAgICAgICAgaWYgKHRva2VuLmRlZmF1bHQpIHJlcy5wdXNoKHRva2VuLmRlZmF1bHQpO1xuICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIHRva2VuLnRyYW5zZm9ybSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICByZXMucHVzaCh0b2tlbi50cmFuc2Zvcm0odmFsdWUpKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlcy5wdXNoKHZhbHVlKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiByZXM7XG4gICAgfSwgW10gYXMgc3RyaW5nW10pXG4gICAgLmpvaW4oJycpO1xufVxuIl19
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1mb3JtYXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2Zvcm1hdC95ZWxvbi11dGlsLWZvcm1hdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVsb24tdXRpbC1tYXRoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9tYXRoL3llbG9uLXV0aWwtbWF0aC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==