@yelon/util 17.3.2 → 18.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +27 -27
  3. package/array/array-type.service.d.ts +68 -68
  4. package/array/array.service.d.ts +78 -78
  5. package/array/index.d.ts +2 -2
  6. package/browser/cookie.service.d.ts +64 -64
  7. package/browser/copy.d.ts +6 -6
  8. package/browser/index.d.ts +5 -5
  9. package/browser/is-empty.d.ts +6 -6
  10. package/browser/scroll.service.d.ts +34 -34
  11. package/browser/style.d.ts +21 -21
  12. package/config/abc/cell.type.d.ts +118 -118
  13. package/config/abc/date-picker.type.d.ts +52 -52
  14. package/config/abc/error-collect.type.d.ts +10 -10
  15. package/config/abc/exception.type.d.ts +9 -9
  16. package/config/abc/image.type.d.ts +15 -15
  17. package/config/abc/index.d.ts +17 -18
  18. package/config/abc/loading.type.d.ts +31 -31
  19. package/config/abc/lodop.type.d.ts +33 -33
  20. package/config/abc/media.type.d.ts +11 -11
  21. package/config/abc/onboarding.type.d.ts +4 -4
  22. package/config/abc/page-header.type.d.ts +39 -39
  23. package/config/abc/pdf.type.d.ts +35 -35
  24. package/config/abc/se.type.d.ts +32 -32
  25. package/config/abc/sg.type.d.ts +10 -10
  26. package/config/abc/st.type.d.ts +465 -465
  27. package/config/abc/sv.type.d.ts +14 -14
  28. package/config/abc/xlsx.type.d.ts +12 -12
  29. package/config/abc/zip.type.d.ts +10 -10
  30. package/config/acl/acl.type.d.ts +32 -32
  31. package/config/auth/auth.type.d.ts +51 -51
  32. package/config/bis/bis.type.d.ts +11 -11
  33. package/config/cache/cache.type.d.ts +66 -66
  34. package/config/chart/chart.type.d.ts +33 -33
  35. package/config/config.service.d.ts +13 -13
  36. package/config/config.types.d.ts +51 -52
  37. package/config/index.d.ts +14 -14
  38. package/config/mock/mock.type.d.ts +14 -14
  39. package/config/sf/sf.type.d.ts +133 -133
  40. package/config/socket/socket.type.d.ts +4 -4
  41. package/config/theme/http.type.d.ts +15 -15
  42. package/config/theme/i18n.type.d.ts +14 -14
  43. package/config/theme/index.d.ts +3 -3
  44. package/config/theme/pipe.type.d.ts +3 -3
  45. package/config/theme/responsive.type.d.ts +12 -12
  46. package/config/util/array.type.d.ts +22 -22
  47. package/config/util/currency.type.d.ts +39 -39
  48. package/date-time/index.d.ts +2 -2
  49. package/date-time/picker.d.ts +68 -68
  50. package/date-time/time.d.ts +39 -39
  51. package/decorator/convert.d.ts +32 -32
  52. package/decorator/index.d.ts +2 -2
  53. package/decorator/zone-outside.d.ts +35 -35
  54. package/esm2022/array/array-type.service.mjs +1 -1
  55. package/esm2022/array/array.mjs +4 -4
  56. package/esm2022/array/array.service.mjs +277 -277
  57. package/esm2022/array/index.mjs +2 -2
  58. package/esm2022/browser/browser.mjs +4 -4
  59. package/esm2022/browser/cookie.service.mjs +99 -99
  60. package/esm2022/browser/copy.mjs +27 -27
  61. package/esm2022/browser/index.mjs +5 -5
  62. package/esm2022/browser/is-empty.mjs +18 -18
  63. package/esm2022/browser/scroll.service.mjs +84 -84
  64. package/esm2022/browser/style.mjs +37 -37
  65. package/esm2022/config/abc/cell.type.mjs +1 -1
  66. package/esm2022/config/abc/date-picker.type.mjs +1 -1
  67. package/esm2022/config/abc/error-collect.type.mjs +1 -1
  68. package/esm2022/config/abc/exception.type.mjs +1 -1
  69. package/esm2022/config/abc/image.type.mjs +1 -1
  70. package/esm2022/config/abc/index.mjs +18 -19
  71. package/esm2022/config/abc/loading.type.mjs +1 -1
  72. package/esm2022/config/abc/lodop.type.mjs +1 -1
  73. package/esm2022/config/abc/media.type.mjs +1 -1
  74. package/esm2022/config/abc/onboarding.type.mjs +1 -1
  75. package/esm2022/config/abc/page-header.type.mjs +1 -1
  76. package/esm2022/config/abc/pdf.type.mjs +1 -1
  77. package/esm2022/config/abc/se.type.mjs +1 -1
  78. package/esm2022/config/abc/sg.type.mjs +1 -1
  79. package/esm2022/config/abc/st.type.mjs +1 -1
  80. package/esm2022/config/abc/sv.type.mjs +2 -2
  81. package/esm2022/config/abc/xlsx.type.mjs +1 -1
  82. package/esm2022/config/abc/zip.type.mjs +1 -1
  83. package/esm2022/config/acl/acl.type.mjs +1 -1
  84. package/esm2022/config/auth/auth.type.mjs +1 -1
  85. package/esm2022/config/bis/bis.type.mjs +1 -1
  86. package/esm2022/config/cache/cache.type.mjs +1 -1
  87. package/esm2022/config/chart/chart.type.mjs +1 -1
  88. package/esm2022/config/config.mjs +4 -4
  89. package/esm2022/config/config.service.mjs +37 -37
  90. package/esm2022/config/config.types.mjs +12 -12
  91. package/esm2022/config/index.mjs +14 -14
  92. package/esm2022/config/mock/mock.type.mjs +1 -1
  93. package/esm2022/config/sf/sf.type.mjs +1 -1
  94. package/esm2022/config/socket/socket.type.mjs +1 -1
  95. package/esm2022/config/theme/http.type.mjs +1 -1
  96. package/esm2022/config/theme/i18n.type.mjs +1 -1
  97. package/esm2022/config/theme/index.mjs +3 -3
  98. package/esm2022/config/theme/pipe.type.mjs +1 -1
  99. package/esm2022/config/theme/responsive.type.mjs +1 -1
  100. package/esm2022/config/util/array.type.mjs +1 -1
  101. package/esm2022/config/util/currency.type.mjs +1 -1
  102. package/esm2022/date-time/date-time.mjs +4 -4
  103. package/esm2022/date-time/index.mjs +2 -2
  104. package/esm2022/date-time/picker.mjs +115 -115
  105. package/esm2022/date-time/time.mjs +100 -100
  106. package/esm2022/decorator/convert.mjs +65 -65
  107. package/esm2022/decorator/decorator.mjs +4 -4
  108. package/esm2022/decorator/index.mjs +2 -2
  109. package/esm2022/decorator/zone-outside.mjs +56 -56
  110. package/esm2022/form/form.mjs +4 -4
  111. package/esm2022/form/index.mjs +2 -2
  112. package/esm2022/form/match-control.mjs +29 -29
  113. package/esm2022/form/validators.mjs +80 -80
  114. package/esm2022/format/currency.service.mjs +232 -232
  115. package/esm2022/format/currency.types.mjs +7 -7
  116. package/esm2022/format/format.mjs +4 -4
  117. package/esm2022/format/index.mjs +4 -4
  118. package/esm2022/format/string.mjs +84 -84
  119. package/esm2022/format/validate.mjs +93 -93
  120. package/esm2022/index.mjs +13 -13
  121. package/esm2022/math/in-range.mjs +24 -24
  122. package/esm2022/math/index.mjs +2 -2
  123. package/esm2022/math/math.mjs +4 -4
  124. package/esm2022/math/round.mjs +52 -52
  125. package/esm2022/mcache/index.mjs +1 -1
  126. package/esm2022/mcache/localStorageUtils.mjs +58 -58
  127. package/esm2022/mcache/mcache.mjs +4 -4
  128. package/esm2022/mtypes/authority.type.mjs +1 -1
  129. package/esm2022/mtypes/header-menu.type.mjs +1 -1
  130. package/esm2022/mtypes/index.mjs +9 -9
  131. package/esm2022/mtypes/menu.type.mjs +1 -1
  132. package/esm2022/mtypes/mtypes.mjs +4 -4
  133. package/esm2022/mtypes/nav.types.mjs +8 -8
  134. package/esm2022/mtypes/page.mjs +41 -41
  135. package/esm2022/mtypes/project-info.types.mjs +1 -1
  136. package/esm2022/mtypes/response.mjs +1 -1
  137. package/esm2022/mtypes/role.type.mjs +1 -1
  138. package/esm2022/mtypes/user.types.mjs +1 -1
  139. package/esm2022/other/assert.mjs +66 -66
  140. package/esm2022/other/deep.mjs +77 -77
  141. package/esm2022/other/favicon.mjs +28 -28
  142. package/esm2022/other/index.mjs +7 -7
  143. package/esm2022/other/lazy.service.mjs +128 -128
  144. package/esm2022/other/logger.mjs +32 -32
  145. package/esm2022/other/other.mjs +4 -4
  146. package/esm2022/other/path-to-regexp.service.mjs +238 -238
  147. package/esm2022/other/resize.mjs +3 -3
  148. package/esm2022/pipes/currency/cny.pipe.mjs +22 -22
  149. package/esm2022/pipes/currency/index.mjs +4 -4
  150. package/esm2022/pipes/currency/mega.pipe.mjs +24 -24
  151. package/esm2022/pipes/currency/module.mjs +18 -18
  152. package/esm2022/pipes/currency/pipe-currency.mjs +4 -4
  153. package/esm2022/pipes/currency/price.pipe.mjs +26 -26
  154. package/esm2022/pipes/filter/filter.pipe.mjs +19 -19
  155. package/esm2022/pipes/filter/index.mjs +2 -2
  156. package/esm2022/pipes/filter/module.mjs +16 -16
  157. package/esm2022/pipes/filter/pipe-filter.mjs +4 -4
  158. package/esm2022/pipes/format/index.mjs +2 -2
  159. package/esm2022/pipes/format/mask.pipe.mjs +33 -33
  160. package/esm2022/pipes/format/module.mjs +16 -16
  161. package/esm2022/pipes/format/pipe-format.mjs +4 -4
  162. package/esm2022/pipes/index.mjs +3 -3
  163. package/esm2022/pipes/pipes.mjs +4 -4
  164. package/esm2022/token/index.mjs +2 -2
  165. package/esm2022/token/page-visibility.mjs +14 -14
  166. package/esm2022/token/token.mjs +4 -4
  167. package/esm2022/token/window.mjs +16 -16
  168. package/esm2022/yelon-util.mjs +4 -4
  169. package/fesm2022/array.mjs +285 -285
  170. package/fesm2022/browser.mjs +273 -273
  171. package/fesm2022/config.mjs +58 -58
  172. package/fesm2022/config.mjs.map +1 -1
  173. package/fesm2022/date-time.mjs +223 -223
  174. package/fesm2022/decorator.mjs +129 -129
  175. package/fesm2022/form.mjs +118 -118
  176. package/fesm2022/format.mjs +426 -426
  177. package/fesm2022/math.mjs +85 -85
  178. package/fesm2022/mcache.mjs +65 -65
  179. package/fesm2022/mtypes.mjs +57 -57
  180. package/fesm2022/other.mjs +583 -583
  181. package/fesm2022/pipe-currency.mjs +90 -90
  182. package/fesm2022/pipe-filter.mjs +41 -41
  183. package/fesm2022/pipe-format.mjs +55 -55
  184. package/fesm2022/pipes.mjs +8 -8
  185. package/fesm2022/token.mjs +37 -37
  186. package/fesm2022/yelon-util.mjs +18 -18
  187. package/form/index.d.ts +2 -2
  188. package/form/match-control.d.ts +15 -15
  189. package/form/validators.d.ts +62 -62
  190. package/format/currency.service.d.ts +38 -38
  191. package/format/currency.types.d.ts +82 -82
  192. package/format/index.d.ts +4 -4
  193. package/format/string.d.ts +44 -44
  194. package/format/validate.d.ts +72 -72
  195. package/index.d.ts +13 -13
  196. package/math/in-range.d.ts +14 -14
  197. package/math/index.d.ts +2 -2
  198. package/math/round.d.ts +33 -33
  199. package/mcache/index.d.ts +1 -1
  200. package/mcache/localStorageUtils.d.ts +18 -18
  201. package/mtypes/authority.type.d.ts +3 -3
  202. package/mtypes/header-menu.type.d.ts +13 -13
  203. package/mtypes/index.d.ts +9 -9
  204. package/mtypes/menu.type.d.ts +41 -41
  205. package/mtypes/nav.types.d.ts +29 -29
  206. package/mtypes/page.d.ts +47 -47
  207. package/mtypes/project-info.types.d.ts +22 -22
  208. package/mtypes/response.d.ts +7 -7
  209. package/mtypes/role.type.d.ts +10 -10
  210. package/mtypes/user.types.d.ts +22 -22
  211. package/other/assert.d.ts +36 -36
  212. package/other/deep.d.ts +35 -35
  213. package/other/favicon.d.ts +2 -2
  214. package/other/index.d.ts +7 -7
  215. package/other/lazy.service.d.ts +47 -47
  216. package/other/logger.d.ts +5 -5
  217. package/other/path-to-regexp.service.d.ts +27 -27
  218. package/other/resize.d.ts +1 -1
  219. package/package.json +135 -135
  220. package/pipes/currency/cny.pipe.d.ts +14 -14
  221. package/pipes/currency/index.d.ts +4 -4
  222. package/pipes/currency/mega.pipe.d.ts +15 -15
  223. package/pipes/currency/module.d.ts +9 -9
  224. package/pipes/currency/price.pipe.d.ts +18 -18
  225. package/pipes/filter/filter.pipe.d.ts +13 -13
  226. package/pipes/filter/index.d.ts +2 -2
  227. package/pipes/filter/module.d.ts +7 -7
  228. package/pipes/format/index.d.ts +2 -2
  229. package/pipes/format/mask.pipe.d.ts +27 -27
  230. package/pipes/format/module.d.ts +7 -7
  231. package/pipes/index.d.ts +3 -3
  232. package/token/index.d.ts +2 -2
  233. package/token/page-visibility.d.ts +8 -8
  234. package/token/window.d.ts +7 -7
  235. package/config/abc/qr.type.d.ts +0 -25
  236. package/esm2022/config/abc/qr.type.mjs +0 -2
@@ -1,233 +1,233 @@
1
- import { CurrencyPipe, formatNumber } from '@angular/common';
2
- import { DEFAULT_CURRENCY_CODE, Injectable, LOCALE_ID, inject } 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) {
8
- this.locale = inject(LOCALE_ID);
9
- this.defCurrencyCode = inject(DEFAULT_CURRENCY_CODE, { optional: true }) ?? 'USD';
10
- this.currencyPipe = new CurrencyPipe(this.locale, this.defCurrencyCode);
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 = {
29
- startingUnit: this.c.startingUnit,
30
- precision: this.c.precision,
31
- ignoreZeroPrecision: this.c.ignoreZeroPrecision,
32
- ngCurrency: this.c.ngCurrency,
33
- ...options
34
- };
35
- let truthValue = Number(value);
36
- if (value == null || isNaN(truthValue)) {
37
- return '';
38
- }
39
- if (options.startingUnit === 'cent') {
40
- truthValue = truthValue / 100;
41
- }
42
- if (options.ngCurrency != null) {
43
- const cur = options.ngCurrency;
44
- return this.currencyPipe.transform(truthValue, cur.currencyCode, cur.display, cur.digitsInfo, cur.locale || this.locale);
45
- }
46
- const res = formatNumber(truthValue, this.locale, `.${options.ignoreZeroPrecision ? 1 : options.precision}-${options.precision}`);
47
- return options.ignoreZeroPrecision ? res.replace(/(?:\.[0]+)$/g, '') : res;
48
- }
49
- /**
50
- * Large number format filter
51
- *
52
- * 大数据格式化
53
- * ```ts
54
- * 1000 => { value: '1', unit: 'K', unitI18n: '千' }
55
- * 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
56
- * ```
57
- */
58
- mega(value, options) {
59
- options = { precision: this.c.precision, unitI18n: this.c.megaUnit, startingUnit: this.c.startingUnit, ...options };
60
- let num = Number(value);
61
- const res = { raw: value, value: '', unit: '', unitI18n: '' };
62
- if (isNaN(num) || num === 0) {
63
- res.value = value.toString();
64
- return res;
65
- }
66
- if (options.startingUnit === 'cent') {
67
- num = num / 100;
68
- }
69
- let abs = Math.abs(+num);
70
- const rounder = Math.pow(10, options.precision);
71
- const isNegative = num < 0;
72
- for (const p of CurrencyMega_Powers) {
73
- let reduced = abs / p.value;
74
- reduced = Math.round(reduced * rounder) / rounder;
75
- if (reduced >= 1) {
76
- abs = reduced;
77
- res.unit = p.unit;
78
- break;
79
- }
80
- }
81
- res.value = (isNegative ? '-' : '') + abs;
82
- res.unitI18n = options.unitI18n[res.unit];
83
- return res;
84
- }
85
- /**
86
- * Converted into RMB notation.
87
- *
88
- * 转化成人民币表示法
89
- */
90
- cny(value, options) {
91
- options = {
92
- inWords: true,
93
- minusSymbol: '负',
94
- startingUnit: this.c.startingUnit,
95
- ...options
96
- };
97
- value = Number(value);
98
- if (isNaN(value)) {
99
- return '';
100
- }
101
- if (options.startingUnit === 'cent') {
102
- value = value / 100;
103
- }
104
- value = value.toString();
105
- let integer;
106
- let decimal;
107
- [integer, decimal] = value.split('.');
108
- let symbol = '';
109
- if (integer.startsWith('-')) {
110
- symbol = options.minusSymbol;
111
- integer = integer.substring(1);
112
- }
113
- if (/^-?\d+$/.test(value)) {
114
- decimal = null;
115
- }
116
- integer = (+integer).toString();
117
- const inWords = options.inWords;
118
- const unit = {
119
- num: inWords
120
- ? ['', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '点']
121
- : ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '点'],
122
- radice: inWords
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
- ],
167
- dec: ['角', '分', '厘', '毫']
168
- };
169
- if (inWords) {
170
- value = (+value).toFixed(5).toString();
171
- }
172
- let integerRes = '';
173
- const integerCount = integer.length;
174
- if (integer === '0' || integerCount === 0) {
175
- integerRes = '零';
176
- }
177
- else {
178
- let cnDesc = '';
179
- for (let i = 0; i < integerCount; i++) {
180
- const n = +integer[i];
181
- const j = integerCount - i - 1;
182
- const isZero = i > 1 && n !== 0 && integer[i - 1] === '0';
183
- const cnZero = isZero ? '零' : '';
184
- const isEmpptyUnit = (n === 0 && j % 4 !== 0) || integer.substring(i - 3, i - 3 + 4) === '0000';
185
- const descMark = cnDesc;
186
- let cnNum = unit.num[n];
187
- cnDesc = isEmpptyUnit ? '' : unit.radice[j];
188
- // 第一位是一十
189
- if (i === 0 && cnNum === '一' && cnDesc === '十')
190
- cnNum = '';
191
- const isChangeEr = n > 1 &&
192
- cnNum === '二' && // 去除首位
193
- ['', '十', '百'].indexOf(cnDesc) === -1 && // 不读两\两十\两百
194
- descMark !== '十'; // 不读十两
195
- if (isChangeEr)
196
- cnNum = '两';
197
- integerRes += cnZero + cnNum + cnDesc;
198
- }
199
- }
200
- // 小数部分拼接
201
- let decimalRes = '';
202
- const decimalCount = decimal ? decimal.toString().length : 0;
203
- if (decimal === null) {
204
- decimalRes = inWords ? '整' : '';
205
- }
206
- else if (decimal === '0') {
207
- decimalRes = '零';
208
- }
209
- else {
210
- for (let i = 0; i < decimalCount; i++) {
211
- if (inWords && i > unit.dec.length - 1)
212
- break;
213
- const n = decimal[i];
214
- const cnZero = n === '0' ? '零' : '';
215
- const cnNum = unit.num[+n];
216
- const cnDesc = inWords ? unit.dec[i] : '';
217
- decimalRes += cnZero + cnNum + cnDesc;
218
- }
219
- }
220
- const ret = symbol +
221
- (inWords
222
- ? integerRes + (decimalRes === '零' ? '元整' : `元${decimalRes}`)
223
- : integerRes + (decimalRes === '' ? '' : `点${decimalRes}`));
224
- return ret;
225
- }
226
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: CurrencyService, deps: [{ token: i1.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
227
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: CurrencyService, providedIn: 'root' }); }
228
- }
229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: CurrencyService, decorators: [{
230
- type: Injectable,
231
- args: [{ providedIn: 'root' }]
232
- }], ctorParameters: () => [{ type: i1.YunzaiConfigService }] });
1
+ import { CurrencyPipe, formatNumber } from '@angular/common';
2
+ import { DEFAULT_CURRENCY_CODE, Injectable, LOCALE_ID, inject } 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) {
8
+ this.locale = inject(LOCALE_ID);
9
+ this.defCurrencyCode = inject(DEFAULT_CURRENCY_CODE, { optional: true }) ?? 'USD';
10
+ this.currencyPipe = new CurrencyPipe(this.locale, this.defCurrencyCode);
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 = {
29
+ startingUnit: this.c.startingUnit,
30
+ precision: this.c.precision,
31
+ ignoreZeroPrecision: this.c.ignoreZeroPrecision,
32
+ ngCurrency: this.c.ngCurrency,
33
+ ...options
34
+ };
35
+ let truthValue = Number(value);
36
+ if (value == null || isNaN(truthValue)) {
37
+ return '';
38
+ }
39
+ if (options.startingUnit === 'cent') {
40
+ truthValue = truthValue / 100;
41
+ }
42
+ if (options.ngCurrency != null) {
43
+ const cur = options.ngCurrency;
44
+ return this.currencyPipe.transform(truthValue, cur.currencyCode, cur.display, cur.digitsInfo, cur.locale || this.locale);
45
+ }
46
+ const res = formatNumber(truthValue, this.locale, `.${options.ignoreZeroPrecision ? 1 : options.precision}-${options.precision}`);
47
+ return options.ignoreZeroPrecision ? res.replace(/(?:\.[0]+)$/g, '') : res;
48
+ }
49
+ /**
50
+ * Large number format filter
51
+ *
52
+ * 大数据格式化
53
+ * ```ts
54
+ * 1000 => { value: '1', unit: 'K', unitI18n: '千' }
55
+ * 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
56
+ * ```
57
+ */
58
+ mega(value, options) {
59
+ options = { precision: this.c.precision, unitI18n: this.c.megaUnit, startingUnit: this.c.startingUnit, ...options };
60
+ let num = Number(value);
61
+ const res = { raw: value, value: '', unit: '', unitI18n: '' };
62
+ if (isNaN(num) || num === 0) {
63
+ res.value = value.toString();
64
+ return res;
65
+ }
66
+ if (options.startingUnit === 'cent') {
67
+ num = num / 100;
68
+ }
69
+ let abs = Math.abs(+num);
70
+ const rounder = Math.pow(10, options.precision);
71
+ const isNegative = num < 0;
72
+ for (const p of CurrencyMega_Powers) {
73
+ let reduced = abs / p.value;
74
+ reduced = Math.round(reduced * rounder) / rounder;
75
+ if (reduced >= 1) {
76
+ abs = reduced;
77
+ res.unit = p.unit;
78
+ break;
79
+ }
80
+ }
81
+ res.value = (isNegative ? '-' : '') + abs;
82
+ res.unitI18n = options.unitI18n[res.unit];
83
+ return res;
84
+ }
85
+ /**
86
+ * Converted into RMB notation.
87
+ *
88
+ * 转化成人民币表示法
89
+ */
90
+ cny(value, options) {
91
+ options = {
92
+ inWords: true,
93
+ minusSymbol: '负',
94
+ startingUnit: this.c.startingUnit,
95
+ ...options
96
+ };
97
+ value = Number(value);
98
+ if (isNaN(value)) {
99
+ return '';
100
+ }
101
+ if (options.startingUnit === 'cent') {
102
+ value = value / 100;
103
+ }
104
+ value = value.toString();
105
+ let integer;
106
+ let decimal;
107
+ [integer, decimal] = value.split('.');
108
+ let symbol = '';
109
+ if (integer.startsWith('-')) {
110
+ symbol = options.minusSymbol;
111
+ integer = integer.substring(1);
112
+ }
113
+ if (/^-?\d+$/.test(value)) {
114
+ decimal = null;
115
+ }
116
+ integer = (+integer).toString();
117
+ const inWords = options.inWords;
118
+ const unit = {
119
+ num: inWords
120
+ ? ['', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '点']
121
+ : ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '点'],
122
+ radice: inWords
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
+ ],
167
+ dec: ['角', '分', '厘', '毫']
168
+ };
169
+ if (inWords) {
170
+ value = (+value).toFixed(5).toString();
171
+ }
172
+ let integerRes = '';
173
+ const integerCount = integer.length;
174
+ if (integer === '0' || integerCount === 0) {
175
+ integerRes = '零';
176
+ }
177
+ else {
178
+ let cnDesc = '';
179
+ for (let i = 0; i < integerCount; i++) {
180
+ const n = +integer[i];
181
+ const j = integerCount - i - 1;
182
+ const isZero = i > 1 && n !== 0 && integer[i - 1] === '0';
183
+ const cnZero = isZero ? '零' : '';
184
+ const isEmpptyUnit = (n === 0 && j % 4 !== 0) || integer.substring(i - 3, i - 3 + 4) === '0000';
185
+ const descMark = cnDesc;
186
+ let cnNum = unit.num[n];
187
+ cnDesc = isEmpptyUnit ? '' : unit.radice[j];
188
+ // 第一位是一十
189
+ if (i === 0 && cnNum === '一' && cnDesc === '十')
190
+ cnNum = '';
191
+ const isChangeEr = n > 1 &&
192
+ cnNum === '二' && // 去除首位
193
+ ['', '十', '百'].indexOf(cnDesc) === -1 && // 不读两\两十\两百
194
+ descMark !== '十'; // 不读十两
195
+ if (isChangeEr)
196
+ cnNum = '两';
197
+ integerRes += cnZero + cnNum + cnDesc;
198
+ }
199
+ }
200
+ // 小数部分拼接
201
+ let decimalRes = '';
202
+ const decimalCount = decimal ? decimal.toString().length : 0;
203
+ if (decimal === null) {
204
+ decimalRes = inWords ? '整' : '';
205
+ }
206
+ else if (decimal === '0') {
207
+ decimalRes = '零';
208
+ }
209
+ else {
210
+ for (let i = 0; i < decimalCount; i++) {
211
+ if (inWords && i > unit.dec.length - 1)
212
+ break;
213
+ const n = decimal[i];
214
+ const cnZero = n === '0' ? '零' : '';
215
+ const cnNum = unit.num[+n];
216
+ const cnDesc = inWords ? unit.dec[i] : '';
217
+ decimalRes += cnZero + cnNum + cnDesc;
218
+ }
219
+ }
220
+ const ret = symbol +
221
+ (inWords
222
+ ? integerRes + (decimalRes === '零' ? '元整' : `元${decimalRes}`)
223
+ : integerRes + (decimalRes === '' ? '' : `点${decimalRes}`));
224
+ return ret;
225
+ }
226
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: CurrencyService, deps: [{ token: i1.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
227
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: CurrencyService, providedIn: 'root' }); }
228
+ }
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: CurrencyService, decorators: [{
230
+ type: Injectable,
231
+ args: [{ providedIn: 'root' }]
232
+ }], ctorParameters: () => [{ type: i1.YunzaiConfigService }] });
233
233
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVuY3kuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybWF0L2N1cnJlbmN5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUM3RCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsVUFBVSxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFLckYsT0FBTyxFQUtMLG1CQUFtQixFQUNwQixNQUFNLGtCQUFrQixDQUFDOzs7QUFHMUIsTUFBTSxPQUFPLGVBQWU7SUFPMUIsWUFBWSxHQUF3QjtRQU5uQixXQUFNLEdBQUcsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQzNCLG9CQUFlLEdBQUcsTUFBTSxDQUFDLHFCQUFxQixFQUFFLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxDQUFDLElBQUksS0FBSyxDQUFDO1FBTTVGLElBQUksQ0FBQyxZQUFZLEdBQUcsSUFBSSxZQUFZLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsZUFBZSxDQUFDLENBQUM7UUFDeEUsSUFBSSxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsS0FBSyxDQUFDLGNBQWMsRUFBRTtZQUNqQyxZQUFZLEVBQUUsTUFBTTt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XQgc3ltYm9sID0gJyc7XG4gICAgaWYgKGludGVnZXIuc3RhcnRzV2l0aCgnLScpKSB7XG4gICAgICBzeW1ib2wgPSBvcHRpb25zLm1pbnVzU3ltYm9sITtcbiAgICAgIGludGVnZXIgPSBpbnRlZ2VyLnN1YnN0cmluZygxKTtcbiAgICB9XG4gICAgaWYgKC9eLT9cXGQrJC8udGVzdCh2YWx1ZSkpIHtcbiAgICAgIGRlY2ltYWwgPSBudWxsO1xuICAgIH1cbiAgICBpbnRlZ2VyID0gKCtpbnRlZ2VyKS50b1N0cmluZygpO1xuICAgIGNvbnN0IGluV29yZHMgPSBvcHRpb25zLmluV29yZHM7XG4gICAgY29uc3QgdW5pdDogeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9ID0ge1xuICAgICAgbnVtOiBpbldvcmRzXG4gICAgICAgID8gWycnLCAn5aO5JywgJ+i0sCcsICflj4EnLCAn6IKGJywgJ+S8jScsICfpmYYnLCAn5p+SJywgJ+aNjCcsICfnjpYnLCAn54K5J11cbiAgICAgICAgOiBbJycsICfkuIAnLCAn5LqMJywgJ+S4iScsICflm5snLCAn5LqUJywgJ+WFrScsICfkuIMnLCAn5YWrJywgJ+S5nScsICfngrknXSxcbiAgICAgIHJhZGljZTogaW5Xb3Jkc1xuICAgICAgICA/IFtcbiAgICAgICAgICAgICcnLFxuICAgICAgICAgICAgJ+aLvicsXG4gICAgICAgICAgICAn5L2wJyxcbiAgICAgICAgICAgICfku58nLFxuICAgICAgICAgICAgJ+S4hycsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nycsXG4gICAgICAgICAgICAn5Lq/JyxcbiAgICAgICAgICAgICfmi74nLFxuICAgICAgICAgICAgJ+S9sCcsXG4gICAgICAgICAgICAn5LufJyxcbiAgICAgICAgICAgICfkuIfkur8nLFxuICAgICAgICAgICAgJ+aLvicsXG4gICAgICAgICAgICAn5L2wJyxcbiAgICAgICAgICAgICfku58nLFxuICAgICAgICAgICAgJ+WFhicsXG4gICAgICAgICAgICAn5ou+JyxcbiAgICAgICAgICAgICfkvbAnLFxuICAgICAgICAgICAgJ+S7nydcbiAgICAgICAgICBdXG4gICAgICAgIDogW1xuICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAn5Y2BJyxcbiAgICAgICAgICAgICfnmb4nLFxuICAgICAgICAgICAgJ+WNgycsXG4gICAgICAgICAgICAn5LiHJyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJyxcbiAgICAgICAgICAgICfkur8nLFxuICAgICAgICAgICAgJ+WNgScsXG4gICAgICAgICAgICAn55m+JyxcbiAgICAgICAgICAgICfljYMnLFxuICAgICAgICAgICAgJ+S4h+S6vycsXG4gICAgICAgICAgICAn5Y2BJyxcbiAgICAgICAgICAgICfnmb4nLFxuICAgICAgICAgICAgJ+WNgycsXG4gICAgICAgICAgICAn5YWGJyxcbiAgICAgICAgICAgICfljYEnLFxuICAgICAgICAgICAgJ+eZvicsXG4gICAgICAgICAgICAn5Y2DJ1xuICAgICAgICAgIF0sXG4gICAgICBkZWM6IFsn6KeSJywgJ+WIhicsICfljpgnLCAn5q+rJ11cbiAgICB9O1xuICAgIGlmIChpbldvcmRzKSB7XG4gICAgICB2YWx1ZSA9ICgrdmFsdWUpLnRvRml4ZWQoNSkudG9TdHJpbmcoKTtcbiAgICB9XG4gICAgbGV0IGludGVnZXJSZXMgPSAnJztcbiAgICBjb25zdCBpbnRlZ2VyQ291bnQgPSBpbnRlZ2VyLmxlbmd0aDtcbiAgICBpZiAoaW50ZWdlciA9PT0gJzAnIHx8IGludGVnZXJDb3VudCA9PT0gMCkge1xuICAgICAgaW50ZWdlclJlcyA9ICfpm7YnO1xuICAgIH0gZWxzZSB7XG4gICAgICBsZXQgY25EZXNjID0gJyc7XG4gICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGludGVnZXJDb3VudDsgaSsrKSB7XG4gICAgICAgIGNvbnN0IG4gPSAraW50ZWdlcltpXTtcbiAgICAgICAgY29uc3QgaiA9IGludGVnZXJDb3VudCAtIGkgLSAxO1xuICAgICAgICBjb25zdCBpc1plcm8gPSBpID4gMSAmJiBuICE9PSAwICYmIGludGVnZXJbaSAtIDFdID09PSAnMCc7XG4gICAgICAgIGNvbnN0IGNuWmVybyA9IGlzWmVybyA/ICfpm7YnIDogJyc7XG4gICAgICAgIGNvbnN0IGlzRW1wcHR5VW5pdCA9IChuID09PSAwICYmIGogJSA0ICE9PSAwKSB8fCBpbnRlZ2VyLnN1YnN0cmluZyhpIC0gMywgaSAtIDMgKyA0KSA9PT0gJzAwMDAnO1xuICAgICAgICBjb25zdCBkZXNjTWFyayA9IGNuRGVzYztcbiAgICAgICAgbGV0IGNuTnVtID0gdW5pdC5udW1bbl07XG5cbiAgICAgICAgY25EZXNjID0gaXNFbXBwdHlVbml0ID8gJycgOiB1bml0LnJhZGljZVtqXTtcbiAgICAgICAgLy8g56ys5LiA5L2N5piv5LiA5Y2BXG4gICAgICAgIGlmIChpID09PSAwICYmIGNuTnVtID09PSAn5LiAJyAmJiBjbkRlc2MgPT09ICfljYEnKSBjbk51bSA9ICcnO1xuICAgICAgICBjb25zdCBpc0NoYW5nZUVyID1cbiAgICAgICAgICBuID4gMSAmJlxuICAgICAgICAgIGNuTnVtID09PSAn5LqMJyAmJiAvLyDljrvpmaTpppbkvY1cbiAgICAgICAgICBbJycsICfljYEnLCAn55m+J10uaW5kZXhPZihjbkRlc2MpID09PSAtMSAmJiAvLyDkuI3or7vkuKRcXOS4pOWNgVxc5Lik55m+XG4gICAgICAgICAgZGVzY01hcmsgIT09ICfljYEnOyAvLyDkuI3or7vljYHkuKRcbiAgICAgICAgaWYgKGlzQ2hhbmdlRXIpIGNuTnVtID0gJ+S4pCc7XG4gICAgICAgIGludGVnZXJSZXMgKz0gY25aZXJvICsgY25OdW0gKyBjbkRlc2M7XG4gICAgICB9XG4gICAgfVxuXG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,8 +1,8 @@
1
- export const CurrencyMega_Powers = [
2
- { unit: 'Q', value: Math.pow(10, 15) },
3
- { unit: 'T', value: Math.pow(10, 12) },
4
- { unit: 'B', value: Math.pow(10, 9) },
5
- { unit: 'M', value: Math.pow(10, 6) },
6
- { unit: 'K', value: 1000 }
7
- ];
1
+ export const CurrencyMega_Powers = [
2
+ { unit: 'Q', value: Math.pow(10, 15) },
3
+ { unit: 'T', value: Math.pow(10, 12) },
4
+ { unit: 'B', value: Math.pow(10, 9) },
5
+ { unit: 'M', value: Math.pow(10, 6) },
6
+ { unit: 'K', value: 1000 }
7
+ ];
8
8
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVuY3kudHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2Zvcm1hdC9jdXJyZW5jeS50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnRUEsTUFBTSxDQUFDLE1BQU0sbUJBQW1CLEdBQUc7SUFDakMsRUFBRSxJQUFJLEVBQUUsR0FBRyxFQUFFLEtBQUssRUFBRSxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtJQUN0QyxFQUFFLElBQUksRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQyxFQUFFO0lBQ3RDLEVBQUUsSUFBSSxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLEVBQUU7SUFDckMsRUFBRSxJQUFJLEVBQUUsR0FBRyxFQUFFLEtBQUssRUFBRSxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRTtJQ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8qKlxuICAgKiBTcGVjaWZ5IG5lZ2F0aXZlIHNpZ24sIGRlZmF1bHQ6IGBuZWdhdGl2ZWBcbiAgICpcbiAgICog5oyH5a6a6LSf5pWw56ym5Y+377yM6buY6K6k77yaYOi0n2BcbiAgICovXG4gIG1pbnVzU3ltYm9sPzogc3RyaW5nO1xufVxuIl19
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWF0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9mb3JtYXQvZm9ybWF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -1,5 +1,5 @@
1
- export * from './string';
2
- export * from './validate';
3
- export * from './currency.service';
4
- export * from './currency.types';
1
+ export * from './string';
2
+ export * from './validate';
3
+ export * from './currency.service';
4
+ export * from './currency.types';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2Zvcm1hdC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsa0JBQWtCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3N0cmluZyc7XG5leHBvcnQgKiBmcm9tICcuL3ZhbGlkYXRlJztcbmV4cG9ydCAqIGZyb20gJy4vY3VycmVuY3kuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL2N1cnJlbmN5LnR5cGVzJztcbiJdfQ==