@yelon/util 12.0.19 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. package/README.md +1 -1
  2. package/{date-time/yelon-util-date-time.d.ts → array/array.d.ts} +1 -0
  3. package/array/array.service.d.ts +3 -0
  4. package/array/package.json +6 -7
  5. package/browser/browser.d.ts +1 -0
  6. package/browser/cookie.service.d.ts +3 -0
  7. package/browser/copy.d.ts +1 -1
  8. package/browser/package.json +5 -6
  9. package/browser/scroll.service.d.ts +3 -0
  10. package/config/config.d.ts +5 -0
  11. package/config/config.service.d.ts +3 -0
  12. package/config/package.json +6 -7
  13. package/date-time/date-time.d.ts +5 -0
  14. package/date-time/package.json +6 -7
  15. package/decorator/decorator.d.ts +5 -0
  16. package/decorator/package.json +6 -7
  17. package/{esm2015/array/array-type.service.js → esm2020/array/array-type.service.mjs} +0 -0
  18. package/esm2020/array/array.mjs +5 -0
  19. package/esm2020/array/array.service.mjs +278 -0
  20. package/{esm2015/array/index.js → esm2020/array/index.mjs} +0 -0
  21. package/{esm2015/browser/browser.js → esm2020/browser/browser.mjs} +0 -0
  22. package/esm2020/browser/cookie.service.mjs +103 -0
  23. package/esm2020/browser/copy.mjs +9 -0
  24. package/{esm2015/browser/index.js → esm2020/browser/index.mjs} +0 -0
  25. package/{esm2015/browser/is-empty.js → esm2020/browser/is-empty.mjs} +0 -0
  26. package/esm2020/browser/scroll.service.mjs +88 -0
  27. package/{esm2015/browser/style.js → esm2020/browser/style.mjs} +2 -2
  28. package/{esm2015/config/abc/date-picker.type.js → esm2020/config/abc/date-picker.type.mjs} +0 -0
  29. package/{esm2015/config/abc/error-collect.type.js → esm2020/config/abc/error-collect.type.mjs} +0 -0
  30. package/{esm2015/config/abc/image.type.js → esm2020/config/abc/image.type.mjs} +0 -0
  31. package/{esm2015/config/abc/index.js → esm2020/config/abc/index.mjs} +0 -0
  32. package/{esm2015/config/abc/loading.type.js → esm2020/config/abc/loading.type.mjs} +0 -0
  33. package/{esm2015/config/abc/lodop.type.js → esm2020/config/abc/lodop.type.mjs} +0 -0
  34. package/{esm2015/config/abc/media.type.js → esm2020/config/abc/media.type.mjs} +0 -0
  35. package/{esm2015/config/abc/onboarding.type.js → esm2020/config/abc/onboarding.type.mjs} +0 -0
  36. package/{esm2015/config/abc/page-header.type.js → esm2020/config/abc/page-header.type.mjs} +0 -0
  37. package/{esm2015/config/abc/pdf.type.js → esm2020/config/abc/pdf.type.mjs} +0 -0
  38. package/{esm2015/config/abc/qr.type.js → esm2020/config/abc/qr.type.mjs} +0 -0
  39. package/{esm2015/config/abc/se.type.js → esm2020/config/abc/se.type.mjs} +0 -0
  40. package/{esm2015/config/abc/sg.type.js → esm2020/config/abc/sg.type.mjs} +0 -0
  41. package/{esm2015/config/abc/st.type.js → esm2020/config/abc/st.type.mjs} +0 -0
  42. package/{esm2015/config/abc/sv.type.js → esm2020/config/abc/sv.type.mjs} +0 -0
  43. package/{esm2015/config/abc/xlsx.type.js → esm2020/config/abc/xlsx.type.mjs} +0 -0
  44. package/{esm2015/config/abc/zip.type.js → esm2020/config/abc/zip.type.mjs} +0 -0
  45. package/{esm2015/config/acl/acl.type.js → esm2020/config/acl/acl.type.mjs} +0 -0
  46. package/{esm2015/config/auth/auth.type.js → esm2020/config/auth/auth.type.mjs} +0 -0
  47. package/{esm2015/config/bis/bis.type.js → esm2020/config/bis/bis.type.mjs} +0 -0
  48. package/{esm2015/config/cache/cache.type.js → esm2020/config/cache/cache.type.mjs} +0 -0
  49. package/{esm2015/config/chart/chart.type.js → esm2020/config/chart/chart.type.mjs} +0 -0
  50. package/esm2020/config/config.mjs +5 -0
  51. package/esm2020/config/config.service.mjs +37 -0
  52. package/{esm2015/config/config.types.js → esm2020/config/config.types.mjs} +0 -0
  53. package/{esm2015/config/index.js → esm2020/config/index.mjs} +0 -0
  54. package/{esm2015/config/mock/mock.type.js → esm2020/config/mock/mock.type.mjs} +0 -0
  55. package/{esm2015/config/sf/sf.type.js → esm2020/config/sf/sf.type.mjs} +0 -0
  56. package/{esm2015/config/stomp/stomp.type.js → esm2020/config/stomp/stomp.type.mjs} +0 -0
  57. package/{esm2015/config/theme/http.type.js → esm2020/config/theme/http.type.mjs} +0 -0
  58. package/{esm2015/config/theme/i18n.type.js → esm2020/config/theme/i18n.type.mjs} +0 -0
  59. package/{esm2015/config/theme/index.js → esm2020/config/theme/index.mjs} +0 -0
  60. package/{esm2015/config/theme/responsive.type.js → esm2020/config/theme/responsive.type.mjs} +0 -0
  61. package/{esm2015/config/util/array.type.js → esm2020/config/util/array.type.mjs} +0 -0
  62. package/{esm2015/config/util/currency.type.js → esm2020/config/util/currency.type.mjs} +0 -0
  63. package/esm2020/date-time/date-time.mjs +5 -0
  64. package/{esm2015/date-time/index.js → esm2020/date-time/index.mjs} +0 -0
  65. package/esm2020/date-time/picker.mjs +116 -0
  66. package/{esm2015/date-time/time.js → esm2020/date-time/time.mjs} +6 -2
  67. package/esm2020/decorator/convert.mjs +58 -0
  68. package/esm2020/decorator/decorator.mjs +5 -0
  69. package/{esm2015/decorator/index.js → esm2020/decorator/index.mjs} +0 -0
  70. package/esm2020/decorator/zone-outside.mjs +57 -0
  71. package/esm2020/form/form.mjs +5 -0
  72. package/{esm2015/form/index.js → esm2020/form/index.mjs} +0 -0
  73. package/{esm2015/form/match-control.js → esm2020/form/match-control.mjs} +0 -0
  74. package/{esm2015/form/validators.js → esm2020/form/validators.mjs} +0 -0
  75. package/esm2020/format/currency.service.mjs +238 -0
  76. package/{esm2015/format/currency.types.js → esm2020/format/currency.types.mjs} +0 -0
  77. package/esm2020/format/format.mjs +5 -0
  78. package/{esm2015/format/index.js → esm2020/format/index.mjs} +0 -0
  79. package/esm2020/format/string.mjs +85 -0
  80. package/{esm2015/format/validate.js → esm2020/format/validate.mjs} +0 -0
  81. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  82. package/{esm2015/math/in-range.js → esm2020/math/in-range.mjs} +0 -0
  83. package/{esm2015/math/index.js → esm2020/math/index.mjs} +0 -0
  84. package/esm2020/math/math.mjs +5 -0
  85. package/{esm2015/math/round.js → esm2020/math/round.mjs} +0 -0
  86. package/{esm2015/other/assert.js → esm2020/other/assert.mjs} +0 -0
  87. package/{esm2015/other/deep.js → esm2020/other/deep.mjs} +0 -0
  88. package/{esm2015/other/index.js → esm2020/other/index.mjs} +0 -0
  89. package/esm2020/other/lazy.service.mjs +104 -0
  90. package/{esm2015/other/logger.js → esm2020/other/logger.mjs} +0 -0
  91. package/esm2020/other/other.mjs +5 -0
  92. package/{esm2015/other/resize.js → esm2020/other/resize.mjs} +0 -0
  93. package/{esm2015/other/url.js → esm2020/other/url.mjs} +0 -0
  94. package/esm2020/pipes/currency/cny.pipe.mjs +23 -0
  95. package/{esm2015/pipes/currency/index.js → esm2020/pipes/currency/index.mjs} +2 -1
  96. package/esm2020/pipes/currency/mega.pipe.mjs +29 -0
  97. package/esm2020/pipes/currency/module.mjs +19 -0
  98. package/esm2020/pipes/currency/pipe-currency.mjs +5 -0
  99. package/esm2020/pipes/currency/price.pipe.mjs +27 -0
  100. package/esm2020/pipes/filter/filter.pipe.mjs +19 -0
  101. package/{esm2015/pipes/filter/index.js → esm2020/pipes/filter/index.mjs} +0 -0
  102. package/esm2020/pipes/filter/module.mjs +17 -0
  103. package/{esm2015/other/yelon-util-other.js → esm2020/pipes/filter/pipe-filter.mjs} +1 -1
  104. package/{esm2015/pipes/format/index.js → esm2020/pipes/format/index.mjs} +0 -0
  105. package/esm2020/pipes/format/mask.pipe.mjs +34 -0
  106. package/esm2020/pipes/format/module.mjs +17 -0
  107. package/{esm2015/array/yelon-util-array.js → esm2020/pipes/format/pipe-format.mjs} +1 -1
  108. package/{esm2015/pipes/index.js → esm2020/pipes/index.mjs} +0 -0
  109. package/esm2020/pipes/pipes.mjs +5 -0
  110. package/{esm2015/token/index.js → esm2020/token/index.mjs} +0 -0
  111. package/{esm2015/token/page-visibility.js → esm2020/token/page-visibility.mjs} +0 -0
  112. package/esm2020/token/token.mjs +5 -0
  113. package/{esm2015/token/window.js → esm2020/token/window.mjs} +0 -0
  114. package/{esm2015/yelon-util.js → esm2020/yelon-util.mjs} +0 -0
  115. package/fesm2015/{yelon-util-array.js → array.mjs} +8 -10
  116. package/fesm2015/array.mjs.map +1 -0
  117. package/fesm2015/{browser.js → browser.mjs} +28 -42
  118. package/fesm2015/browser.mjs.map +1 -0
  119. package/fesm2015/{yelon-util-config.js → config.mjs} +14 -8
  120. package/fesm2015/config.mjs.map +1 -0
  121. package/fesm2015/{yelon-util-date-time.js → date-time.mjs} +1 -1
  122. package/fesm2015/date-time.mjs.map +1 -0
  123. package/fesm2015/{yelon-util-decorator.js → decorator.mjs} +8 -4
  124. package/fesm2015/decorator.mjs.map +1 -0
  125. package/fesm2015/{yelon-util-form.js → form.mjs} +1 -1
  126. package/fesm2015/form.mjs.map +1 -0
  127. package/fesm2015/{yelon-util-format.js → format.mjs} +18 -14
  128. package/fesm2015/format.mjs.map +1 -0
  129. package/fesm2015/{yelon-util-math.js → math.mjs} +1 -1
  130. package/fesm2015/math.mjs.map +1 -0
  131. package/fesm2015/{yelon-util-other.js → other.mjs} +17 -29
  132. package/fesm2015/other.mjs.map +1 -0
  133. package/fesm2015/pipe-currency.mjs +96 -0
  134. package/fesm2015/pipe-currency.mjs.map +1 -0
  135. package/fesm2015/pipe-filter.mjs +40 -0
  136. package/fesm2015/pipe-filter.mjs.map +1 -0
  137. package/fesm2015/pipe-format.mjs +55 -0
  138. package/fesm2015/pipe-format.mjs.map +1 -0
  139. package/fesm2015/{yelon-util-pipes.js → pipes.mjs} +1 -1
  140. package/fesm2015/pipes.mjs.map +1 -0
  141. package/fesm2015/{yelon-util-token.js → token.mjs} +1 -1
  142. package/fesm2015/token.mjs.map +1 -0
  143. package/fesm2015/{yelon-util.js → yelon-util.mjs} +1 -1
  144. package/fesm2015/yelon-util.mjs.map +1 -0
  145. package/fesm2020/array.mjs +285 -0
  146. package/fesm2020/array.mjs.map +1 -0
  147. package/fesm2020/browser.mjs +260 -0
  148. package/fesm2020/browser.mjs.map +1 -0
  149. package/fesm2020/config.mjs +54 -0
  150. package/fesm2020/config.mjs.map +1 -0
  151. package/fesm2020/date-time.mjs +210 -0
  152. package/fesm2020/date-time.mjs.map +1 -0
  153. package/fesm2020/decorator.mjs +121 -0
  154. package/fesm2020/decorator.mjs.map +1 -0
  155. package/fesm2020/form.mjs +118 -0
  156. package/fesm2020/form.mjs.map +1 -0
  157. package/fesm2020/format.mjs +431 -0
  158. package/fesm2020/format.mjs.map +1 -0
  159. package/fesm2020/math.mjs +85 -0
  160. package/fesm2020/math.mjs.map +1 -0
  161. package/fesm2020/other.mjs +303 -0
  162. package/fesm2020/other.mjs.map +1 -0
  163. package/fesm2020/pipe-currency.mjs +94 -0
  164. package/fesm2020/pipe-currency.mjs.map +1 -0
  165. package/fesm2020/pipe-filter.mjs +40 -0
  166. package/fesm2020/pipe-filter.mjs.map +1 -0
  167. package/fesm2020/pipe-format.mjs +55 -0
  168. package/fesm2020/pipe-format.mjs.map +1 -0
  169. package/fesm2020/pipes.mjs +8 -0
  170. package/fesm2020/pipes.mjs.map +1 -0
  171. package/fesm2020/token.mjs +38 -0
  172. package/fesm2020/token.mjs.map +1 -0
  173. package/fesm2020/yelon-util.mjs +16 -0
  174. package/fesm2020/yelon-util.mjs.map +1 -0
  175. package/{array/yelon-util-array.d.ts → form/form.d.ts} +1 -0
  176. package/form/package.json +6 -7
  177. package/format/currency.service.d.ts +3 -0
  178. package/format/format.d.ts +5 -0
  179. package/format/package.json +6 -7
  180. package/{config/yelon-util-config.d.ts → math/math.d.ts} +1 -0
  181. package/math/package.json +6 -7
  182. package/other/lazy.service.d.ts +3 -0
  183. package/{decorator/yelon-util-decorator.d.ts → other/other.d.ts} +1 -0
  184. package/other/package.json +6 -7
  185. package/package.json +132 -8
  186. package/pipes/currency/cny.pipe.d.ts +3 -0
  187. package/pipes/currency/index.d.ts +1 -0
  188. package/pipes/currency/mega.pipe.d.ts +3 -0
  189. package/pipes/currency/module.d.ts +7 -0
  190. package/pipes/currency/package.json +6 -7
  191. package/pipes/currency/pipe-currency.d.ts +5 -0
  192. package/pipes/currency/price.pipe.d.ts +3 -0
  193. package/pipes/filter/filter.pipe.d.ts +3 -0
  194. package/pipes/filter/module.d.ts +5 -0
  195. package/pipes/filter/package.json +6 -7
  196. package/pipes/filter/pipe-filter.d.ts +5 -0
  197. package/pipes/format/mask.pipe.d.ts +3 -0
  198. package/pipes/format/module.d.ts +5 -0
  199. package/pipes/format/package.json +6 -7
  200. package/pipes/format/pipe-format.d.ts +5 -0
  201. package/pipes/package.json +6 -7
  202. package/pipes/pipes.d.ts +5 -0
  203. package/token/package.json +6 -7
  204. package/token/token.d.ts +5 -0
  205. package/yelon-util.d.ts +1 -0
  206. package/array/yelon-util-array.metadata.json +0 -1
  207. package/browser/browser.metadata.json +0 -1
  208. package/bundles/browser.umd.js +0 -325
  209. package/bundles/browser.umd.js.map +0 -1
  210. package/bundles/yelon-util-array.umd.js +0 -641
  211. package/bundles/yelon-util-array.umd.js.map +0 -1
  212. package/bundles/yelon-util-config.umd.js +0 -411
  213. package/bundles/yelon-util-config.umd.js.map +0 -1
  214. package/bundles/yelon-util-date-time.umd.js +0 -238
  215. package/bundles/yelon-util-date-time.umd.js.map +0 -1
  216. package/bundles/yelon-util-decorator.umd.js +0 -462
  217. package/bundles/yelon-util-decorator.umd.js.map +0 -1
  218. package/bundles/yelon-util-form.umd.js +0 -135
  219. package/bundles/yelon-util-form.umd.js.map +0 -1
  220. package/bundles/yelon-util-format.umd.js +0 -785
  221. package/bundles/yelon-util-format.umd.js.map +0 -1
  222. package/bundles/yelon-util-math.umd.js +0 -104
  223. package/bundles/yelon-util-math.umd.js.map +0 -1
  224. package/bundles/yelon-util-other.umd.js +0 -733
  225. package/bundles/yelon-util-other.umd.js.map +0 -1
  226. package/bundles/yelon-util-pipes-currency.umd.js +0 -108
  227. package/bundles/yelon-util-pipes-currency.umd.js.map +0 -1
  228. package/bundles/yelon-util-pipes-filter.umd.js +0 -374
  229. package/bundles/yelon-util-pipes-filter.umd.js.map +0 -1
  230. package/bundles/yelon-util-pipes-format.umd.js +0 -66
  231. package/bundles/yelon-util-pipes-format.umd.js.map +0 -1
  232. package/bundles/yelon-util-pipes.umd.js +0 -38
  233. package/bundles/yelon-util-pipes.umd.js.map +0 -1
  234. package/bundles/yelon-util-token.umd.js +0 -49
  235. package/bundles/yelon-util-token.umd.js.map +0 -1
  236. package/bundles/yelon-util.umd.js +0 -86
  237. package/bundles/yelon-util.umd.js.map +0 -1
  238. package/config/yelon-util-config.metadata.json +0 -1
  239. package/date-time/yelon-util-date-time.metadata.json +0 -1
  240. package/decorator/yelon-util-decorator.metadata.json +0 -1
  241. package/esm2015/array/array.service.js +0 -250
  242. package/esm2015/browser/cookie.service.js +0 -104
  243. package/esm2015/browser/copy.js +0 -27
  244. package/esm2015/browser/scroll.service.js +0 -89
  245. package/esm2015/config/config.service.js +0 -34
  246. package/esm2015/config/yelon-util-config.js +0 -5
  247. package/esm2015/date-time/picker.js +0 -116
  248. package/esm2015/date-time/yelon-util-date-time.js +0 -5
  249. package/esm2015/decorator/convert.js +0 -56
  250. package/esm2015/decorator/yelon-util-decorator.js +0 -5
  251. package/esm2015/decorator/zone-outside.js +0 -55
  252. package/esm2015/form/yelon-util-form.js +0 -5
  253. package/esm2015/format/currency.service.js +0 -225
  254. package/esm2015/format/string.js +0 -76
  255. package/esm2015/format/yelon-util-format.js +0 -5
  256. package/esm2015/math/yelon-util-math.js +0 -5
  257. package/esm2015/other/lazy.service.js +0 -118
  258. package/esm2015/pipes/currency/cny.pipe.js +0 -22
  259. package/esm2015/pipes/currency/mega.pipe.js +0 -26
  260. package/esm2015/pipes/currency/module.js +0 -14
  261. package/esm2015/pipes/currency/price.pipe.js +0 -26
  262. package/esm2015/pipes/currency/yelon-util-pipes-currency.js +0 -6
  263. package/esm2015/pipes/filter/filter.pipe.js +0 -15
  264. package/esm2015/pipes/filter/module.js +0 -12
  265. package/esm2015/pipes/filter/yelon-util-pipes-filter.js +0 -5
  266. package/esm2015/pipes/format/mask.pipe.js +0 -30
  267. package/esm2015/pipes/format/module.js +0 -12
  268. package/esm2015/pipes/format/yelon-util-pipes-format.js +0 -5
  269. package/esm2015/pipes/yelon-util-pipes.js +0 -5
  270. package/esm2015/token/yelon-util-token.js +0 -5
  271. package/fesm2015/browser.js.map +0 -1
  272. package/fesm2015/yelon-util-array.js.map +0 -1
  273. package/fesm2015/yelon-util-config.js.map +0 -1
  274. package/fesm2015/yelon-util-date-time.js.map +0 -1
  275. package/fesm2015/yelon-util-decorator.js.map +0 -1
  276. package/fesm2015/yelon-util-form.js.map +0 -1
  277. package/fesm2015/yelon-util-format.js.map +0 -1
  278. package/fesm2015/yelon-util-math.js.map +0 -1
  279. package/fesm2015/yelon-util-other.js.map +0 -1
  280. package/fesm2015/yelon-util-pipes-currency.js +0 -87
  281. package/fesm2015/yelon-util-pipes-currency.js.map +0 -1
  282. package/fesm2015/yelon-util-pipes-filter.js +0 -32
  283. package/fesm2015/yelon-util-pipes-filter.js.map +0 -1
  284. package/fesm2015/yelon-util-pipes-format.js +0 -47
  285. package/fesm2015/yelon-util-pipes-format.js.map +0 -1
  286. package/fesm2015/yelon-util-pipes.js.map +0 -1
  287. package/fesm2015/yelon-util-token.js.map +0 -1
  288. package/fesm2015/yelon-util.js.map +0 -1
  289. package/form/yelon-util-form.d.ts +0 -4
  290. package/form/yelon-util-form.metadata.json +0 -1
  291. package/format/yelon-util-format.d.ts +0 -4
  292. package/format/yelon-util-format.metadata.json +0 -1
  293. package/math/yelon-util-math.d.ts +0 -4
  294. package/math/yelon-util-math.metadata.json +0 -1
  295. package/other/yelon-util-other.d.ts +0 -4
  296. package/other/yelon-util-other.metadata.json +0 -1
  297. package/pipes/currency/yelon-util-pipes-currency.d.ts +0 -5
  298. package/pipes/currency/yelon-util-pipes-currency.metadata.json +0 -1
  299. package/pipes/filter/yelon-util-pipes-filter.d.ts +0 -4
  300. package/pipes/filter/yelon-util-pipes-filter.metadata.json +0 -1
  301. package/pipes/format/yelon-util-pipes-format.d.ts +0 -4
  302. package/pipes/format/yelon-util-pipes-format.metadata.json +0 -1
  303. package/pipes/yelon-util-pipes.d.ts +0 -4
  304. package/pipes/yelon-util-pipes.metadata.json +0 -1
  305. package/token/yelon-util-token.d.ts +0 -4
  306. package/token/yelon-util-token.metadata.json +0 -1
  307. package/yelon-util.metadata.json +0 -1
@@ -0,0 +1,58 @@
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 (typeof ngDevMode === 'undefined' || ngDevMode) {
6
+ if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
7
+ warn(`The prop "${privatePropName}" is already exist, it will be overrided by ${name} decorator.`);
8
+ }
9
+ }
10
+ Object.defineProperty(target, privatePropName, {
11
+ configurable: true,
12
+ writable: true
13
+ });
14
+ return {
15
+ get() {
16
+ return originalDescriptor && originalDescriptor.get
17
+ ? originalDescriptor.get.bind(this)()
18
+ : this[privatePropName];
19
+ },
20
+ set(value) {
21
+ if (originalDescriptor && originalDescriptor.set) {
22
+ originalDescriptor.set.bind(this)(fallback(value, defaultValue));
23
+ }
24
+ this[privatePropName] = fallback(value, defaultValue);
25
+ }
26
+ };
27
+ }
28
+ return propDecorator;
29
+ }
30
+ export function toBoolean(value, defaultValue = false) {
31
+ return value == null ? defaultValue : `${value}` !== 'false';
32
+ }
33
+ /**
34
+ * Input decorator that handle a prop to do get/set automatically with toBoolean
35
+ *
36
+ * ```ts
37
+ * {AT}Input() {AT}InputBoolean() visible: boolean = false;
38
+ * {AT}Input() {AT}InputBoolean(null) visible: boolean = false;
39
+ * ```
40
+ */
41
+ export function InputBoolean(defaultValue = false) {
42
+ return propDecoratorFactory('InputBoolean', toBoolean, defaultValue);
43
+ }
44
+ export function toNumber(value, fallbackValue = 0) {
45
+ return !isNaN(parseFloat(value)) && !isNaN(Number(value)) ? Number(value) : fallbackValue;
46
+ }
47
+ /**
48
+ * Input decorator that handle a prop to do get/set automatically with toNumber
49
+ *
50
+ * ```ts
51
+ * {AT}Input() {AT}InputNumber() visible: number = 1;
52
+ * {AT}Input() {AT}InputNumber(null) visible: number = 2;
53
+ * ```
54
+ */
55
+ export function InputNumber(defaultValue = 0) {
56
+ return propDecoratorFactory('InputNumber', toNumber, defaultValue);
57
+ }
58
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZGVjb3JhdG9yL2NvbnZlcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBTXpDLFNBQVMsb0JBQW9CLENBQzNCLElBQVksRUFDWixRQUFzQyxFQUN0QyxZQUF1QjtJQUV2QixTQUFTLGFBQWEsQ0FDcEIsTUFBaUIsRUFDakIsUUFBZ0IsRUFDaEIsa0JBQXVEO1FBRXZELE1BQU0sZUFBZSxHQUFHLE9BQU8sUUFBUSxFQUFFLENBQUM7UUFFMUMsSUFBSSxPQUFPLFNBQVMsS0FBSyxXQUFXLElBQUksU0FBUyxFQUFFO1lBQ2pELElBQUksTUFBTSxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxlQUFlLENBQUMsRUFBRTtnQkFDakUsSUFBSSxDQUFDLGFBQWEsZUFBZSwrQ0FBK0MsSUFBSSxhQUFhLENBQUMsQ0FBQzthQUNwRztTQUNGO1FBRUQsTUFBTSxDQUFDLGNBQWMsQ0FBQyxNQUFNLEVBQUUsZUFBZSxFQUFFO1lBQzdDLFlBQVksRUFBRSxJQUFJO1lBQ2xCLFFBQVEsRUFBRSxJQUFJO1NBQ2YsQ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bHVlOiB1bmtub3duKTogbnVtYmVyO1xuZXhwb3J0IGZ1bmN0aW9uIHRvTnVtYmVyPEQ+KHZhbHVlOiB1bmtub3duLCBmYWxsYmFjazogRCk6IG51bWJlciB8IEQ7XG5leHBvcnQgZnVuY3Rpb24gdG9OdW1iZXIodmFsdWU6IHVua25vd24sIGZhbGxiYWNrVmFsdWU6IG51bWJlciA9IDApOiBudW1iZXIge1xuICByZXR1cm4gIWlzTmFOKHBhcnNlRmxvYXQodmFsdWUgYXMgTnpTYWZlQW55KSkgJiYgIWlzTmFOKE51bWJlcih2YWx1ZSkpID8gTnVtYmVyKHZhbHVlKSA6IGZhbGxiYWNrVmFsdWU7XG59XG5cbi8qKlxuICogSW5wdXQgZGVjb3JhdG9yIHRoYXQgaGFuZGxlIGEgcHJvcCB0byBkbyBnZXQvc2V0IGF1dG9tYXRpY2FsbHkgd2l0aCB0b051bWJlclxuICpcbiAqIGBgYHRzXG4gKiB7QVR9SW5wdXQoKSB7QVR9SW5wdXROdW1iZXIoKSB2aXNpYmxlOiBudW1iZXIgPSAxO1xuICoge0FUfUlucHV0KCkge0FUfUlucHV0TnVtYmVyKG51bGwpIHZpc2libGU6IG51bWJlciA9IDI7XG4gKiBgYGBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIElucHV0TnVtYmVyKGRlZmF1bHRWYWx1ZTogbnVtYmVyIHwgbnVsbCA9IDApOiBOelNhZmVBbnkge1xuICByZXR1cm4gcHJvcERlY29yYXRvckZhY3RvcnkoJ0lucHV0TnVtYmVyJywgdG9OdW1iZXIsIGRlZmF1bHRWYWx1ZSk7XG59XG4iXX0=
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9kZWNvcmF0b3IvZGVjb3JhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,57 @@
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?.ngZoneName || 'ngZone'];
8
+ if (!ngZone) {
9
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
10
+ warn(`ZoneOutside: Decorator should have 'ngZone' property with 'NgZone' class.`);
11
+ }
12
+ return source.call(this, ...data);
13
+ }
14
+ let res;
15
+ ngZone[type](() => {
16
+ res = source.call(this, ...data);
17
+ });
18
+ return res;
19
+ };
20
+ return descriptor;
21
+ };
22
+ }
23
+ /**
24
+ * The decoration method runs in `runOutsideAngular`
25
+ *
26
+ * 装饰方法运行在 `runOutsideAngular` 内
27
+ *
28
+ * ```ts
29
+ * class MockClass {
30
+ * constructor(public ngZone: NgZone) {}
31
+ *
32
+ * {AT}ZoneOutside()
33
+ * runOutsideAngular(): void {}
34
+ * }
35
+ * ```
36
+ */
37
+ export function ZoneOutside(options) {
38
+ return makeFn('runOutsideAngular', options);
39
+ }
40
+ /**
41
+ * The decoration method runs in `run`
42
+ *
43
+ * 装饰方法运行在 `run` 内
44
+ *
45
+ * ```ts
46
+ * class MockClass {
47
+ * constructor(public ngZone: NgZone) {}
48
+ *
49
+ * {AT}ZoneRun()
50
+ * run(): void {}
51
+ * }
52
+ * ```
53
+ */
54
+ export function ZoneRun(options) {
55
+ return makeFn('run', options);
56
+ }
57
+ //# sourceMapping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V4cG9ydCBmdW5jdGlvbiBab25lT3V0c2lkZShvcHRpb25zPzogWm9uZU9wdGlvbnMpOiBEZWNvcmF0b3JUeXBlIHtcbiAgcmV0dXJuIG1ha2VGbigncnVuT3V0c2lkZUFuZ3VsYXInLCBvcHRpb25zKTtcbn1cblxuLyoqXG4gKiBUaGUgZGVjb3JhdGlvbiBtZXRob2QgcnVucyBpbiBgcnVuYFxuICpcbiAqIOijhemlsOaWueazlei/kOihjOWcqCBgcnVuYCDlhoVcbiAqXG4gKiBgYGB0c1xuICogY2xhc3MgTW9ja0NsYXNzIHtcbiAqICBjb25zdHJ1Y3RvcihwdWJsaWMgbmdab25lOiBOZ1pvbmUpIHt9XG4gKlxuICogIHtBVH1ab25lUnVuKClcbiAqICBydW4oKTogdm9pZCB7fVxuICogfVxuICogYGBgXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBab25lUnVuKG9wdGlvbnM/OiBab25lT3B0aW9ucyk6IERlY29yYXRvclR5cGUge1xuICByZXR1cm4gbWFrZUZuKCdydW4nLCBvcHRpb25zKTtcbn1cbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybS9mb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,238 @@
1
+ import { CurrencyPipe, formatNumber } from '@angular/common';
2
+ import { DEFAULT_CURRENCY_CODE, Inject, Injectable, LOCALE_ID } from '@angular/core';
3
+ import { CurrencyMega_Powers } from './currency.types';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@yelon/util/config";
6
+ export class CurrencyService {
7
+ constructor(cog, locale, _defaultCurrencyCode = 'USD') {
8
+ this.locale = locale;
9
+ this.currencyPipe = new CurrencyPipe(locale, _defaultCurrencyCode);
10
+ this.c = cog.merge('utilCurrency', {
11
+ startingUnit: 'yuan',
12
+ megaUnit: { Q: '京', T: '兆', B: '亿', M: '万', K: '千' },
13
+ precision: 2,
14
+ ignoreZeroPrecision: true
15
+ });
16
+ }
17
+ /**
18
+ * Format a number with commas as thousands separators
19
+ *
20
+ * 格式化货币,用逗号将数字格式化为千位分隔符
21
+ * ```ts
22
+ * 10000 => `10,000`
23
+ * 10000.567 => `10,000.57`
24
+ * ```
25
+ */
26
+ format(value, options) {
27
+ options = {
28
+ startingUnit: this.c.startingUnit,
29
+ precision: this.c.precision,
30
+ ignoreZeroPrecision: this.c.ignoreZeroPrecision,
31
+ ngCurrency: this.c.ngCurrency,
32
+ ...options
33
+ };
34
+ let truthValue = Number(value);
35
+ if (value == null || isNaN(truthValue)) {
36
+ return '';
37
+ }
38
+ if (options.startingUnit === 'cent') {
39
+ truthValue = truthValue / 100;
40
+ }
41
+ if (options.ngCurrency != null) {
42
+ const cur = options.ngCurrency;
43
+ return this.currencyPipe.transform(truthValue, cur.currencyCode, cur.display, cur.digitsInfo, cur.locale || this.locale);
44
+ }
45
+ const res = formatNumber(truthValue, this.locale, `.${options.ignoreZeroPrecision ? 1 : options.precision}-${options.precision}`);
46
+ return options.ignoreZeroPrecision ? res.replace(/(?:\.[0]+)$/g, '') : res;
47
+ }
48
+ /**
49
+ * Large number format filter
50
+ *
51
+ * 大数据格式化
52
+ * ```ts
53
+ * 1000 => { value: '1', unit: 'K', unitI18n: '千' }
54
+ * 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
55
+ * ```
56
+ */
57
+ mega(value, options) {
58
+ options = { precision: this.c.precision, unitI18n: this.c.megaUnit, startingUnit: this.c.startingUnit, ...options };
59
+ let num = Number(value);
60
+ const res = { raw: value, value: '', unit: '', unitI18n: '' };
61
+ if (isNaN(num) || num === 0) {
62
+ res.value = value.toString();
63
+ return res;
64
+ }
65
+ if (options.startingUnit === 'cent') {
66
+ num = num / 100;
67
+ }
68
+ let abs = Math.abs(+num);
69
+ const rounder = Math.pow(10, options.precision);
70
+ const isNegative = num < 0;
71
+ for (const p of CurrencyMega_Powers) {
72
+ let reduced = abs / p.value;
73
+ reduced = Math.round(reduced * rounder) / rounder;
74
+ if (reduced >= 1) {
75
+ abs = reduced;
76
+ res.unit = p.unit;
77
+ break;
78
+ }
79
+ }
80
+ res.value = (isNegative ? '-' : '') + abs;
81
+ res.unitI18n = options.unitI18n[res.unit];
82
+ return res;
83
+ }
84
+ /**
85
+ * Converted into RMB notation.
86
+ *
87
+ * 转化成人民币表示法
88
+ */
89
+ cny(value, options) {
90
+ options = {
91
+ inWords: true,
92
+ minusSymbol: '负',
93
+ startingUnit: this.c.startingUnit,
94
+ ...options
95
+ };
96
+ value = Number(value);
97
+ if (isNaN(value)) {
98
+ return '';
99
+ }
100
+ if (options.startingUnit === 'cent') {
101
+ value = value / 100;
102
+ }
103
+ value = value.toString();
104
+ let integer;
105
+ let decimal;
106
+ [integer, decimal] = value.split('.');
107
+ let symbol = '';
108
+ if (integer.startsWith('-')) {
109
+ symbol = options.minusSymbol;
110
+ integer = integer.substring(1);
111
+ }
112
+ if (/^-?\d+$/.test(value)) {
113
+ decimal = null;
114
+ }
115
+ integer = (+integer).toString();
116
+ const inWords = options.inWords;
117
+ const unit = {
118
+ num: inWords
119
+ ? ['', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '点']
120
+ : ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '点'],
121
+ radice: inWords
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
+ '千',
157
+ '万亿',
158
+ '十',
159
+ '百',
160
+ '千',
161
+ '兆',
162
+ '十',
163
+ '百',
164
+ '千'
165
+ ],
166
+ dec: ['角', '分', '厘', '毫']
167
+ };
168
+ if (inWords) {
169
+ value = (+value).toFixed(5).toString();
170
+ }
171
+ let integerRes = '';
172
+ const integerCount = integer.length;
173
+ if (integer === '0' || integerCount === 0) {
174
+ integerRes = '零';
175
+ }
176
+ else {
177
+ let cnDesc = '';
178
+ for (let i = 0; i < integerCount; i++) {
179
+ const n = +integer[i];
180
+ const j = integerCount - i - 1;
181
+ const isZero = i > 1 && n !== 0 && integer[i - 1] === '0';
182
+ const cnZero = isZero ? '零' : '';
183
+ const isEmpptyUnit = (n === 0 && j % 4 !== 0) || integer.substring(i - 3, i - 3 + 4) === '0000';
184
+ const descMark = cnDesc;
185
+ let cnNum = unit.num[n];
186
+ cnDesc = isEmpptyUnit ? '' : unit.radice[j];
187
+ // 第一位是一十
188
+ if (i === 0 && cnNum === '一' && cnDesc === '十')
189
+ cnNum = '';
190
+ const isChangeEr = n > 1 &&
191
+ cnNum === '二' && // 去除首位
192
+ ['', '十', '百'].indexOf(cnDesc) === -1 && // 不读两\两十\两百
193
+ descMark !== '十'; // 不读十两
194
+ if (isChangeEr)
195
+ cnNum = '两';
196
+ integerRes += cnZero + cnNum + cnDesc;
197
+ }
198
+ }
199
+ // 小数部分拼接
200
+ let decimalRes = '';
201
+ const decimalCount = decimal ? decimal.toString().length : 0;
202
+ if (decimal === null) {
203
+ decimalRes = inWords ? '整' : '';
204
+ }
205
+ else if (decimal === '0') {
206
+ decimalRes = '零';
207
+ }
208
+ else {
209
+ for (let i = 0; i < decimalCount; i++) {
210
+ if (inWords && i > unit.dec.length - 1)
211
+ break;
212
+ const n = decimal[i];
213
+ const cnZero = n === '0' ? '零' : '';
214
+ const cnNum = unit.num[+n];
215
+ const cnDesc = inWords ? unit.dec[i] : '';
216
+ decimalRes += cnZero + cnNum + cnDesc;
217
+ }
218
+ }
219
+ const ret = symbol +
220
+ (inWords
221
+ ? integerRes + (decimalRes === '零' ? '元整' : `元${decimalRes}`)
222
+ : integerRes + (decimalRes === '' ? '' : `点${decimalRes}`));
223
+ return ret;
224
+ }
225
+ }
226
+ CurrencyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CurrencyService, deps: [{ token: i1.YunzaiConfigService }, { token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Injectable });
227
+ CurrencyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CurrencyService, providedIn: 'root' });
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CurrencyService, decorators: [{
229
+ type: Injectable,
230
+ args: [{ providedIn: 'root' }]
231
+ }], ctorParameters: function () { return [{ type: i1.YunzaiConfigService }, { type: undefined, decorators: [{
232
+ type: Inject,
233
+ args: [LOCALE_ID]
234
+ }] }, { type: undefined, decorators: [{
235
+ type: Inject,
236
+ args: [DEFAULT_CURRENCY_CODE]
237
+ }] }]; } });
238
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVuY3kuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybWF0L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JywgJ+S4gycsICflhasnLCAn5LmdJywgJ+eCuSddLFxuICAgICAgcmFkaWNlOiBpbldvcmRzXG4gICAgICAgID8gW1xuICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nycsXG4gICAgICAgICAgICAn5LiHJyxcbiAgICAgICAgICAgICfmi74nLFxuICAgICAgICAgICAgJ+S9sCcsXG4gICAgICAgICAgICAn5LufJyxcbiAgICAgICAgICAgICfkur8nLFxuICAgICAgICAgICAgJ+aLvicsXG4gICAgICAgICAgICAn5L2wJyxcbiAgICAgICAgICAgICfku58nLFxuICAgICAgICAgICAgJ+S4h+S6vycsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nycsXG4gICAgICAgICAgICAn5YWGJyxcbiAgICAgICAgICAgICfmi74nLFxuICAgICAgICAgICAgJ+S9sCcsXG4gICAgICAgICAgICAn5LufJ1xuICAgICAgICAgIF1cbiAgICAgICAgOiBbXG4gICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJyxcbiAgICAgICAgICAgICfkuIcnLFxuICAgICAgICAgICAgJ+WNgScsXG4gICAgICAgICAgICAn55m+JyxcbiAgICAgICAgICAgICfljYMnLFxuICAgICAgICAgICAgJ+S6vycsXG4gICAgICAgICAgICAn5Y2BJyxcbiAgICAgICAgICAgICfnmb4nLFxuICAgICAgICAgICAgJ+WNgycsXG4gICAgICAgICAgICAn5LiH5Lq/JyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJyxcbiAgICAgICAgICAgICflhYYnLFxuICAgICAgICAgICAgJ+WNgScsXG4gICAgICAgICAgICAn55m+JyxcbiAgICAgICAgICAgICfljYMnXG4gICAgICAgICAgXSxcbiAgICAgIGRlYzogWyfop5InLCAn5YiGJywgJ+WOmCcsICfmr6snXVxuICAgIH07XG4gICAgaWYgKGluV29yZHMpIHtcbiAgICAgIHZhbHVlID0gKCt2YWx1ZSkudG9GaXhlZCg1KS50b1N0cmluZygpO1xuICAgIH1cbiAgICBsZXQgaW50ZWdlclJlcyA9ICcnO1xuICAgIGNvbnN0IGludGVnZXJDb3VudCA9IGludGVnZXIubGVuZ3RoO1xuICAgIGlmIChpbnRlZ2VyID09PSAnMCcgfHwgaW50ZWdlckNvdW50ID09PSAwKSB7XG4gICAgICBpbnRlZ2VyUmVzID0gJ+mbtic7XG4gICAgfSBlbHNlIHtcbiAgICAgIGxldCBjbkRlc2MgPSAnJztcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaW50ZWdlckNvdW50OyBpKyspIHtcbiAgICAgICAgY29uc3QgbiA9ICtpbnRlZ2VyW2ldO1xuICAgICAgICBjb25zdCBqID0gaW50ZWdlckNvdW50IC0gaSAtIDE7XG4gICAgICAgIGNvbnN0IGlzWmVybyA9IGkgPiAxICYmIG4gIT09IDAgJiYgaW50ZWdlcltpIC0gMV0gPT09ICcwJztcbiAgICAgICAgY29uc3QgY25aZXJvID0gaXNaZXJvID8gJ+mbticgOiAnJztcbiAgICAgICAgY29uc3QgaXNFbXBwdHlVbml0ID0gKG4gPT09IDAgJiYgaiAlIDQgIT09IDApIHx8IGludGVnZXIuc3Vic3RyaW5nKGkgLSAzLCBpIC0gMyArIDQpID09PSAnMDAwMCc7XG4gICAgICAgIGNvbnN0IGRlc2NNYXJrID0gY25EZXNjO1xuICAgICAgICBsZXQgY25OdW0gPSB1bml0Lm51bVtuXTtcblxuICAgICAgICBjbkRlc2MgPSBpc0VtcHB0eVVuaXQgPyAnJyA6IHVuaXQucmFkaWNlW2pdO1xuICAgICAgICAvLyDnrKzkuIDkvY3mmK/kuIDljYFcbiAgICAgICAgaWYgKGkgPT09IDAgJiYgY25OdW0gPT09ICfkuIAnICYmIGNuRGV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lm51bVsrbl07XG4gICAgICAgIGNvbnN0IGNuRGVzYyA9IGluV29yZHMgPyB1bml0LmRlY1tpXSA6ICcnO1xuICAgICAgICBkZWNpbWFsUmVzICs9IGNuWmVybyArIGNuTnVtICsgY25EZXNjO1xuICAgICAgfVxuICAgIH1cbiAgICBjb25zdCByZXQgPVxuICAgICAgc3ltYm9sICtcbiAgICAgIChpbldvcmRzXG4gICAgICAgID8gaW50ZWdlclJlcyArIChkZWNpbWFsUmVzID09PSAn6Zu2JyA/ICflhYPmlbQnIDogYOWFgyR7ZGVjaW1hbFJlc31gKVxuICAgICAgICA6IGludGVnZXJSZXMgKyAoZGVjaW1hbFJlcyA9PT0gJycgPyAnJyA6IGDngrkke2RlY2ltYWxSZXN9YCkpO1xuICAgIHJldHVybiByZXQ7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9mb3JtYXQvZm9ybWF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,85 @@
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 = {
40
+ ...(typeof option === 'string' ? { mask: option } : option)
41
+ };
42
+ const tokens = {
43
+ '0': { pattern: /\d/, default: '0' },
44
+ '9': { pattern: /\d/ },
45
+ '#': { pattern: /[a-zA-Z0-9]/ },
46
+ U: {
47
+ pattern: /[a-zA-Z]/,
48
+ transform: char => char.toLocaleUpperCase()
49
+ },
50
+ L: {
51
+ pattern: /[a-zA-Z]/,
52
+ transform: char => char.toLocaleLowerCase()
53
+ },
54
+ '*': {
55
+ pattern: /.*/,
56
+ transform: _ => `*`
57
+ },
58
+ ...opt.tokens
59
+ };
60
+ const splitValue = value.split('');
61
+ return opt.mask
62
+ .split('')
63
+ .reduce((res, cur) => {
64
+ const token = tokens[cur];
65
+ if (!token) {
66
+ res.push(cur);
67
+ return res;
68
+ }
69
+ const value = splitValue.shift() ?? '';
70
+ if (!token.pattern.test(value)) {
71
+ if (token.default)
72
+ res.push(token.default);
73
+ return res;
74
+ }
75
+ if (typeof token.transform === 'function') {
76
+ res.push(token.transform(value));
77
+ }
78
+ else {
79
+ res.push(value);
80
+ }
81
+ return res;
82
+ }, [])
83
+ .join('');
84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bGVMb3dlckNhc2UoKVxuICAgIH0sXG4gICAgJyonOiB7XG4gICAgICBwYXR0ZXJuOiAvLiovLFxuICAgICAgdHJhbnNmb3JtOiBfID0+IGAqYFxuICAgIH0sXG4gICAgLi4ub3B0LnRva2Vuc1xuICB9O1xuXG4gIGNvbnN0IHNwbGl0VmFsdWUgPSB2YWx1ZS5zcGxpdCgnJyk7XG4gIHJldHVybiBvcHQubWFza1xuICAgIC5zcGxpdCgnJylcbiAgICAucmVkdWNlKChyZXMsIGN1cikgPT4ge1xuICAgICAgY29uc3QgdG9rZW4gPSB0b2tlbnNbY3VyXTtcbiAgICAgIGlmICghdG9rZW4pIHtcbiAgICAgICAgcmVzLnB1c2goY3VyKTtcbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgIH1cblxuICAgICAgY29uc3QgdmFsdWUgPSBzcGxpdFZhbHVlLnNoaWZ0KCkgPz8gJyc7XG4gICAgICBpZiAoIXRva2VuLnBhdHRlcm4udGVzdCh2YWx1ZSkpIHtcbiAgICAgICAgaWYgKHRva2VuLmRlZmF1bHQpIHJlcy5wdXNoKHRva2VuLmRlZmF1bHQpO1xuICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIHRva2VuLnRyYW5zZm9ybSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICByZXMucHVzaCh0b2tlbi50cmFuc2Zvcm0odmFsdWUpKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlcy5wdXNoKHZhbHVlKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiByZXM7XG4gICAgfSwgW10gYXMgc3RyaW5nW10pXG4gICAgLmpvaW4oJycpO1xufVxuIl19
File without changes
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0aC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvbWF0aC9tYXRoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19