@delon/util 15.2.1 → 16.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/esm2022/array/array.service.mjs +279 -0
  2. package/esm2022/browser/cookie.service.mjs +104 -0
  3. package/esm2022/browser/scroll.service.mjs +89 -0
  4. package/esm2022/config/config.service.mjs +39 -0
  5. package/esm2022/format/currency.service.mjs +239 -0
  6. package/esm2022/other/lazy.service.mjs +133 -0
  7. package/esm2022/pipes/currency/cny.pipe.mjs +24 -0
  8. package/esm2022/pipes/currency/mega.pipe.mjs +30 -0
  9. package/esm2022/pipes/currency/module.mjs +20 -0
  10. package/esm2022/pipes/currency/price.pipe.mjs +28 -0
  11. package/esm2022/pipes/filter/filter.pipe.mjs +20 -0
  12. package/esm2022/pipes/filter/module.mjs +18 -0
  13. package/esm2022/pipes/format/mask.pipe.mjs +35 -0
  14. package/esm2022/pipes/format/module.mjs +18 -0
  15. package/{fesm2020 → fesm2022}/array.mjs +3 -3
  16. package/{fesm2015 → fesm2022}/array.mjs.map +1 -1
  17. package/{fesm2020 → fesm2022}/browser.mjs +6 -6
  18. package/{fesm2020 → fesm2022}/browser.mjs.map +1 -1
  19. package/{fesm2020 → fesm2022}/config.mjs +3 -3
  20. package/{fesm2020 → fesm2022}/config.mjs.map +1 -1
  21. package/{fesm2020 → fesm2022}/format.mjs +3 -3
  22. package/{fesm2020 → fesm2022}/format.mjs.map +1 -1
  23. package/{fesm2020 → fesm2022}/other.mjs +3 -3
  24. package/{fesm2020 → fesm2022}/other.mjs.map +1 -1
  25. package/{fesm2020 → fesm2022}/pipe-currency.mjs +13 -13
  26. package/{fesm2020 → fesm2022}/pipe-currency.mjs.map +1 -1
  27. package/fesm2022/pipe-filter.mjs +40 -0
  28. package/{fesm2015 → fesm2022}/pipe-filter.mjs.map +1 -1
  29. package/{fesm2015 → fesm2022}/pipe-format.mjs +7 -7
  30. package/{fesm2015 → fesm2022}/pipe-format.mjs.map +1 -1
  31. package/package.json +53 -87
  32. package/esm2020/array/array.service.mjs +0 -278
  33. package/esm2020/browser/cookie.service.mjs +0 -103
  34. package/esm2020/browser/scroll.service.mjs +0 -88
  35. package/esm2020/config/config.service.mjs +0 -38
  36. package/esm2020/format/currency.service.mjs +0 -238
  37. package/esm2020/other/lazy.service.mjs +0 -132
  38. package/esm2020/pipes/currency/cny.pipe.mjs +0 -23
  39. package/esm2020/pipes/currency/mega.pipe.mjs +0 -29
  40. package/esm2020/pipes/currency/module.mjs +0 -19
  41. package/esm2020/pipes/currency/price.pipe.mjs +0 -27
  42. package/esm2020/pipes/filter/filter.pipe.mjs +0 -19
  43. package/esm2020/pipes/filter/module.mjs +0 -17
  44. package/esm2020/pipes/format/mask.pipe.mjs +0 -34
  45. package/esm2020/pipes/format/module.mjs +0 -17
  46. package/fesm2015/array.mjs +0 -255
  47. package/fesm2015/browser.mjs +0 -283
  48. package/fesm2015/browser.mjs.map +0 -1
  49. package/fesm2015/config.mjs +0 -57
  50. package/fesm2015/config.mjs.map +0 -1
  51. package/fesm2015/date-time.mjs +0 -207
  52. package/fesm2015/date-time.mjs.map +0 -1
  53. package/fesm2015/decorator.mjs +0 -121
  54. package/fesm2015/decorator.mjs.map +0 -1
  55. package/fesm2015/format.mjs +0 -413
  56. package/fesm2015/format.mjs.map +0 -1
  57. package/fesm2015/other.mjs +0 -319
  58. package/fesm2015/other.mjs.map +0 -1
  59. package/fesm2015/pipe-currency.mjs +0 -96
  60. package/fesm2015/pipe-currency.mjs.map +0 -1
  61. package/fesm2015/pipe-filter.mjs +0 -40
  62. package/fesm2020/array.mjs.map +0 -1
  63. package/fesm2020/delon-util.mjs +0 -16
  64. package/fesm2020/delon-util.mjs.map +0 -1
  65. package/fesm2020/form.mjs +0 -118
  66. package/fesm2020/form.mjs.map +0 -1
  67. package/fesm2020/math.mjs +0 -85
  68. package/fesm2020/math.mjs.map +0 -1
  69. package/fesm2020/pipe-filter.mjs +0 -40
  70. package/fesm2020/pipe-filter.mjs.map +0 -1
  71. package/fesm2020/pipe-format.mjs +0 -55
  72. package/fesm2020/pipe-format.mjs.map +0 -1
  73. package/fesm2020/pipes.mjs +0 -8
  74. package/fesm2020/pipes.mjs.map +0 -1
  75. package/fesm2020/token.mjs +0 -37
  76. package/fesm2020/token.mjs.map +0 -1
  77. /package/{esm2020 → esm2022}/array/array-type.service.mjs +0 -0
  78. /package/{esm2020 → esm2022}/array/array.mjs +0 -0
  79. /package/{esm2020 → esm2022}/array/index.mjs +0 -0
  80. /package/{esm2020 → esm2022}/browser/browser.mjs +0 -0
  81. /package/{esm2020 → esm2022}/browser/copy.mjs +0 -0
  82. /package/{esm2020 → esm2022}/browser/index.mjs +0 -0
  83. /package/{esm2020 → esm2022}/browser/is-empty.mjs +0 -0
  84. /package/{esm2020 → esm2022}/browser/style.mjs +0 -0
  85. /package/{esm2020 → esm2022}/config/abc/date-picker.type.mjs +0 -0
  86. /package/{esm2020 → esm2022}/config/abc/error-collect.type.mjs +0 -0
  87. /package/{esm2020 → esm2022}/config/abc/exception.type.mjs +0 -0
  88. /package/{esm2020 → esm2022}/config/abc/image.type.mjs +0 -0
  89. /package/{esm2020 → esm2022}/config/abc/index.mjs +0 -0
  90. /package/{esm2020 → esm2022}/config/abc/loading.type.mjs +0 -0
  91. /package/{esm2020 → esm2022}/config/abc/lodop.type.mjs +0 -0
  92. /package/{esm2020 → esm2022}/config/abc/media.type.mjs +0 -0
  93. /package/{esm2020 → esm2022}/config/abc/onboarding.type.mjs +0 -0
  94. /package/{esm2020 → esm2022}/config/abc/page-header.type.mjs +0 -0
  95. /package/{esm2020 → esm2022}/config/abc/pdf.type.mjs +0 -0
  96. /package/{esm2020 → esm2022}/config/abc/qr.type.mjs +0 -0
  97. /package/{esm2020 → esm2022}/config/abc/se.type.mjs +0 -0
  98. /package/{esm2020 → esm2022}/config/abc/sg.type.mjs +0 -0
  99. /package/{esm2020 → esm2022}/config/abc/st.type.mjs +0 -0
  100. /package/{esm2020 → esm2022}/config/abc/sv.type.mjs +0 -0
  101. /package/{esm2020 → esm2022}/config/abc/xlsx.type.mjs +0 -0
  102. /package/{esm2020 → esm2022}/config/abc/zip.type.mjs +0 -0
  103. /package/{esm2020 → esm2022}/config/acl/acl.type.mjs +0 -0
  104. /package/{esm2020 → esm2022}/config/auth/auth.type.mjs +0 -0
  105. /package/{esm2020 → esm2022}/config/cache/cache.type.mjs +0 -0
  106. /package/{esm2020 → esm2022}/config/chart/chart.type.mjs +0 -0
  107. /package/{esm2020 → esm2022}/config/config.mjs +0 -0
  108. /package/{esm2020 → esm2022}/config/config.types.mjs +0 -0
  109. /package/{esm2020 → esm2022}/config/index.mjs +0 -0
  110. /package/{esm2020 → esm2022}/config/mock/mock.type.mjs +0 -0
  111. /package/{esm2020 → esm2022}/config/sf/sf.type.mjs +0 -0
  112. /package/{esm2020 → esm2022}/config/theme/http.type.mjs +0 -0
  113. /package/{esm2020 → esm2022}/config/theme/i18n.type.mjs +0 -0
  114. /package/{esm2020 → esm2022}/config/theme/index.mjs +0 -0
  115. /package/{esm2020 → esm2022}/config/theme/responsive.type.mjs +0 -0
  116. /package/{esm2020 → esm2022}/config/util/array.type.mjs +0 -0
  117. /package/{esm2020 → esm2022}/config/util/currency.type.mjs +0 -0
  118. /package/{esm2020 → esm2022}/date-time/date-time.mjs +0 -0
  119. /package/{esm2020 → esm2022}/date-time/index.mjs +0 -0
  120. /package/{esm2020 → esm2022}/date-time/picker.mjs +0 -0
  121. /package/{esm2020 → esm2022}/date-time/time.mjs +0 -0
  122. /package/{esm2020 → esm2022}/decorator/convert.mjs +0 -0
  123. /package/{esm2020 → esm2022}/decorator/decorator.mjs +0 -0
  124. /package/{esm2020 → esm2022}/decorator/index.mjs +0 -0
  125. /package/{esm2020 → esm2022}/decorator/zone-outside.mjs +0 -0
  126. /package/{esm2020 → esm2022}/delon-util.mjs +0 -0
  127. /package/{esm2020 → esm2022}/form/form.mjs +0 -0
  128. /package/{esm2020 → esm2022}/form/index.mjs +0 -0
  129. /package/{esm2020 → esm2022}/form/match-control.mjs +0 -0
  130. /package/{esm2020 → esm2022}/form/validators.mjs +0 -0
  131. /package/{esm2020 → esm2022}/format/currency.types.mjs +0 -0
  132. /package/{esm2020 → esm2022}/format/format.mjs +0 -0
  133. /package/{esm2020 → esm2022}/format/index.mjs +0 -0
  134. /package/{esm2020 → esm2022}/format/string.mjs +0 -0
  135. /package/{esm2020 → esm2022}/format/validate.mjs +0 -0
  136. /package/{esm2020 → esm2022}/index.mjs +0 -0
  137. /package/{esm2020 → esm2022}/math/in-range.mjs +0 -0
  138. /package/{esm2020 → esm2022}/math/index.mjs +0 -0
  139. /package/{esm2020 → esm2022}/math/math.mjs +0 -0
  140. /package/{esm2020 → esm2022}/math/round.mjs +0 -0
  141. /package/{esm2020 → esm2022}/other/assert.mjs +0 -0
  142. /package/{esm2020 → esm2022}/other/deep.mjs +0 -0
  143. /package/{esm2020 → esm2022}/other/index.mjs +0 -0
  144. /package/{esm2020 → esm2022}/other/logger.mjs +0 -0
  145. /package/{esm2020 → esm2022}/other/other.mjs +0 -0
  146. /package/{esm2020 → esm2022}/pipes/currency/index.mjs +0 -0
  147. /package/{esm2020 → esm2022}/pipes/currency/pipe-currency.mjs +0 -0
  148. /package/{esm2020 → esm2022}/pipes/filter/index.mjs +0 -0
  149. /package/{esm2020 → esm2022}/pipes/filter/pipe-filter.mjs +0 -0
  150. /package/{esm2020 → esm2022}/pipes/format/index.mjs +0 -0
  151. /package/{esm2020 → esm2022}/pipes/format/pipe-format.mjs +0 -0
  152. /package/{esm2020 → esm2022}/pipes/index.mjs +0 -0
  153. /package/{esm2020 → esm2022}/pipes/pipes.mjs +0 -0
  154. /package/{esm2020 → esm2022}/token/index.mjs +0 -0
  155. /package/{esm2020 → esm2022}/token/page-visibility.mjs +0 -0
  156. /package/{esm2020 → esm2022}/token/token.mjs +0 -0
  157. /package/{esm2020 → esm2022}/token/window.mjs +0 -0
  158. /package/{fesm2020 → fesm2022}/date-time.mjs +0 -0
  159. /package/{fesm2020 → fesm2022}/date-time.mjs.map +0 -0
  160. /package/{fesm2020 → fesm2022}/decorator.mjs +0 -0
  161. /package/{fesm2020 → fesm2022}/decorator.mjs.map +0 -0
  162. /package/{fesm2015 → fesm2022}/delon-util.mjs +0 -0
  163. /package/{fesm2015 → fesm2022}/delon-util.mjs.map +0 -0
  164. /package/{fesm2015 → fesm2022}/form.mjs +0 -0
  165. /package/{fesm2015 → fesm2022}/form.mjs.map +0 -0
  166. /package/{fesm2015 → fesm2022}/math.mjs +0 -0
  167. /package/{fesm2015 → fesm2022}/math.mjs.map +0 -0
  168. /package/{fesm2015 → fesm2022}/pipes.mjs +0 -0
  169. /package/{fesm2015 → fesm2022}/pipes.mjs.map +0 -0
  170. /package/{fesm2015 → fesm2022}/token.mjs +0 -0
  171. /package/{fesm2015 → fesm2022}/token.mjs.map +0 -0
package/fesm2020/form.mjs DELETED
@@ -1,118 +0,0 @@
1
- import { isNum, isInt, isDecimal, isIdCard, isMobile, isUrl, isIp, isColor, isChinese } from '@delon/util/format';
2
-
3
- /**
4
- * A set of validators for reactive forms
5
- *
6
- * 一套用于响应式表单的验证器
7
- */
8
- class _Validators {
9
- /**
10
- * Wheter is number
11
- *
12
- * 是否为数字
13
- */
14
- static num(control) {
15
- return isNum(control.value) ? null : { num: true };
16
- }
17
- /**
18
- * Wheter is integer
19
- *
20
- * 是否为整数
21
- */
22
- static int(control) {
23
- return isInt(control.value) ? null : { int: true };
24
- }
25
- /**
26
- * Wheter is decimal
27
- *
28
- * 是否为小数点数值
29
- */
30
- static decimal(control) {
31
- return isDecimal(control.value) ? null : { decimal: true };
32
- }
33
- /**
34
- * Wheter is People's Republic of China identity card
35
- *
36
- * 是否为中华人民共和国居民身份证
37
- */
38
- static idCard(control) {
39
- return isIdCard(control.value) ? null : { idCard: true };
40
- }
41
- /**
42
- * Wheter is china mobile (China)
43
- *
44
- * 是否为手机号(中国)
45
- */
46
- static mobile(control) {
47
- return isMobile(control.value) ? null : { mobile: true };
48
- }
49
- /**
50
- * Wheter is url address
51
- *
52
- * 是否URL地址
53
- */
54
- static url(control) {
55
- return isUrl(control.value) ? null : { url: true };
56
- }
57
- /**
58
- * Wheter is IPv4 address (Support v4, v6)
59
- *
60
- * 是否IP4地址(支持v4、v6)
61
- */
62
- static ip(control) {
63
- return isIp(control.value) ? null : { ip: true };
64
- }
65
- /**
66
- * Wheter is color
67
- *
68
- * 是否颜色代码值
69
- */
70
- static color(control) {
71
- return isColor(control.value) ? null : { color: true };
72
- }
73
- /**
74
- * Wheter is chinese
75
- *
76
- * 是否中文
77
- */
78
- static chinese(control) {
79
- return isChinese(control.value) ? null : { chinese: true };
80
- }
81
- }
82
-
83
- /**
84
- * Match two control values
85
- *
86
- * 匹配两个控件值
87
- * ```ts
88
- * this.form = new FormGroup({
89
- * pwd: new FormControl(''),
90
- * repwd: new FormControl(''),
91
- * }, {
92
- * validators: MatchControl('pwd', 'repwd'),
93
- * });
94
- * ```
95
- */
96
- function MatchControl(controlName, matchingControlName) {
97
- return (formGroup) => {
98
- const control = formGroup.get(controlName);
99
- const matchingControl = formGroup.get(matchingControlName);
100
- if (matchingControl.errors && !matchingControl.errors.matchControl) {
101
- return null;
102
- }
103
- if (control.value !== matchingControl.value) {
104
- matchingControl.setErrors({ matchControl: true });
105
- }
106
- else {
107
- matchingControl.setErrors(null);
108
- }
109
- return null;
110
- };
111
- }
112
-
113
- /**
114
- * Generated bundle index. Do not edit.
115
- */
116
-
117
- export { MatchControl, _Validators };
118
- //# sourceMappingURL=form.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.mjs","sources":["../../../../packages/util/form/validators.ts","../../../../packages/util/form/match-control.ts","../../../../packages/util/form/form.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors } from '@angular/forms';\n\nimport { isChinese, isColor, isDecimal, isIdCard, isInt, isIp, isMobile, isNum, isUrl } from '@delon/util/format';\n\n/**\n * A set of validators for reactive forms\n *\n * 一套用于响应式表单的验证器\n */\nexport class _Validators {\n /**\n * Wheter is number\n *\n * 是否为数字\n */\n static num(control: AbstractControl): ValidationErrors | null {\n return isNum(control.value) ? null : { num: true };\n }\n\n /**\n * Wheter is integer\n *\n * 是否为整数\n */\n static int(control: AbstractControl): ValidationErrors | null {\n return isInt(control.value) ? null : { int: true };\n }\n\n /**\n * Wheter is decimal\n *\n * 是否为小数点数值\n */\n static decimal(control: AbstractControl): ValidationErrors | null {\n return isDecimal(control.value) ? null : { decimal: true };\n }\n\n /**\n * Wheter is People's Republic of China identity card\n *\n * 是否为中华人民共和国居民身份证\n */\n static idCard(control: AbstractControl): ValidationErrors | null {\n return isIdCard(control.value) ? null : { idCard: true };\n }\n\n /**\n * Wheter is china mobile (China)\n *\n * 是否为手机号(中国)\n */\n static mobile(control: AbstractControl): ValidationErrors | null {\n return isMobile(control.value) ? null : { mobile: true };\n }\n\n /**\n * Wheter is url address\n *\n * 是否URL地址\n */\n static url(control: AbstractControl): ValidationErrors | null {\n return isUrl(control.value) ? null : { url: true };\n }\n\n /**\n * Wheter is IPv4 address (Support v4, v6)\n *\n * 是否IP4地址(支持v4、v6)\n */\n static ip(control: AbstractControl): ValidationErrors | null {\n return isIp(control.value) ? null : { ip: true };\n }\n\n /**\n * Wheter is color\n *\n * 是否颜色代码值\n */\n static color(control: AbstractControl): ValidationErrors | null {\n return isColor(control.value) ? null : { color: true };\n }\n\n /**\n * Wheter is chinese\n *\n * 是否中文\n */\n static chinese(control: AbstractControl): ValidationErrors | null {\n return isChinese(control.value) ? null : { chinese: true };\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\n\n/**\n * Match two control values\n *\n * 匹配两个控件值\n * ```ts\n * this.form = new FormGroup({\n * pwd: new FormControl(''),\n * repwd: new FormControl(''),\n * }, {\n * validators: MatchControl('pwd', 'repwd'),\n * });\n * ```\n */\nexport function MatchControl(controlName: string, matchingControlName: string): ValidatorFn {\n return (formGroup: AbstractControl) => {\n const control = formGroup.get(controlName)!;\n const matchingControl = formGroup.get(matchingControlName)!;\n if (matchingControl.errors && !matchingControl.errors.matchControl) {\n return null;\n }\n if (control.value !== matchingControl.value) {\n matchingControl.setErrors({ matchControl: true });\n } else {\n matchingControl.setErrors(null);\n }\n return null;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;;AAIG;MACU,WAAW,CAAA;AACtB;;;;AAIG;IACH,OAAO,GAAG,CAAC,OAAwB,EAAA;AACjC,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;KACpD;AAED;;;;AAIG;IACH,OAAO,GAAG,CAAC,OAAwB,EAAA;AACjC,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;KACpD;AAED;;;;AAIG;IACH,OAAO,OAAO,CAAC,OAAwB,EAAA;AACrC,QAAA,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KAC5D;AAED;;;;AAIG;IACH,OAAO,MAAM,CAAC,OAAwB,EAAA;AACpC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KAC1D;AAED;;;;AAIG;IACH,OAAO,MAAM,CAAC,OAAwB,EAAA;AACpC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KAC1D;AAED;;;;AAIG;IACH,OAAO,GAAG,CAAC,OAAwB,EAAA;AACjC,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;KACpD;AAED;;;;AAIG;IACH,OAAO,EAAE,CAAC,OAAwB,EAAA;AAChC,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;KAClD;AAED;;;;AAIG;IACH,OAAO,KAAK,CAAC,OAAwB,EAAA;AACnC,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;KACxD;AAED;;;;AAIG;IACH,OAAO,OAAO,CAAC,OAAwB,EAAA;AACrC,QAAA,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KAC5D;AACF;;ACxFD;;;;;;;;;;;;AAYG;AACa,SAAA,YAAY,CAAC,WAAmB,EAAE,mBAA2B,EAAA;IAC3E,OAAO,CAAC,SAA0B,KAAI;QACpC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;QAC5C,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAE,CAAC;QAC5D,IAAI,eAAe,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,EAAE;AAClE,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACD,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,eAAe,CAAC,KAAK,EAAE;YAC3C,eAAe,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,SAAA;AAAM,aAAA;AACL,YAAA,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACjC,SAAA;AACD,QAAA,OAAO,IAAI,CAAC;AACd,KAAC,CAAC;AACJ;;AC7BA;;AAEG;;;;"}
package/fesm2020/math.mjs DELETED
@@ -1,85 +0,0 @@
1
- import { assertNumber } from '@delon/util/other';
2
-
3
- /**
4
- * Checks if `value` is between `start` and `end` to, but not including `end`. If `end` is not specified, it's set to start with `start` then set to `0`. If `start` is greater than `end` the params are swapped to support negative ranges.
5
- *
6
- * 检查 `value` 是否在 `start` 与 `end` 之间,但不包括 `end`。 如果 `end` 没有指定,那么 `start` 设置为 `0`。 如果 `start` 大于 `end`,那么参数会交换以便支持负范围。
7
- * ```ts
8
- * inRange(3, 2, 4); // true
9
- * inRange(4, 8); // true
10
- * inRange(4, 2); // false
11
- * inRange(2, 2); // false
12
- * inRange(1.2, 2); // true
13
- * inRange(-3, -2, -6); // true
14
- * ```
15
- */
16
- function inRange(value, start, end) {
17
- if (end === undefined) {
18
- end = start;
19
- start = 0;
20
- }
21
- assertNumber(value);
22
- assertNumber(start);
23
- assertNumber(end);
24
- return value >= Math.min(start, end) && value < Math.max(start, end);
25
- }
26
-
27
- /**
28
- * Computes `number` rounded up to `precision`.
29
- *
30
- * 根据 `precision`(精度) 向上舍入 `number`。
31
- * ```ts
32
- * ceil(4.006); // 5
33
- * ceil(6.004, 2); // 6.01
34
- * ceil(6040, -2); // 6100
35
- * ```
36
- */
37
- function ceil(number, precision = 0) {
38
- return createRound(number, precision, 'ceil');
39
- }
40
- /**
41
- * Computes `number` rounded down to `precision`.
42
- *
43
- * 根据 `precision`(精度) 向下舍入 `number`。
44
- * ```ts
45
- * floor(4.006); // 4
46
- * floor(0.046, 2); // 0.04
47
- * floor(4060, -2); // 4000
48
- * ```
49
- */
50
- function floor(number, precision = 0) {
51
- return createRound(number, precision, 'floor');
52
- }
53
- /**
54
- * Computes `number` rounded to `precision`.
55
- *
56
- * 根据 `precision`(精度) 四舍五入 `number`。
57
- * ```ts
58
- * round(4.006); // 4
59
- * round(4.006, 2); // 4.01
60
- * round(4060, -2); // 4100
61
- * ```
62
- */
63
- function round(number, precision = 0) {
64
- return createRound(number, precision, 'round');
65
- }
66
- function createRound(number, precision, methodName) {
67
- const func = Math[methodName];
68
- precision = precision == null ? 0 : Math.min(precision, 292);
69
- if (!precision) {
70
- return func(number);
71
- }
72
- // Shift with exponential notation to avoid floating-point issues.
73
- // See [MDN](https://mdn.io/round#Examples) for more details.
74
- let pair = `${number}e`.split('e');
75
- const value = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));
76
- pair = `${value}e`.split('e');
77
- return Number(`${pair[0]}e${Number(pair[1]) - precision}`);
78
- }
79
-
80
- /**
81
- * Generated bundle index. Do not edit.
82
- */
83
-
84
- export { ceil, floor, inRange, round };
85
- //# sourceMappingURL=math.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.mjs","sources":["../../../../packages/util/math/in-range.ts","../../../../packages/util/math/round.ts","../../../../packages/util/math/math.ts"],"sourcesContent":["import { assertNumber } from '@delon/util/other';\n\n/**\n * Checks if `value` is between `start` and `end` to, but not including `end`. If `end` is not specified, it's set to start with `start` then set to `0`. If `start` is greater than `end` the params are swapped to support negative ranges.\n *\n * 检查 `value` 是否在 `start` 与 `end` 之间,但不包括 `end`。 如果 `end` 没有指定,那么 `start` 设置为 `0`。 如果 `start` 大于 `end`,那么参数会交换以便支持负范围。\n * ```ts\n * inRange(3, 2, 4); // true\n * inRange(4, 8); // true\n * inRange(4, 2); // false\n * inRange(2, 2); // false\n * inRange(1.2, 2); // true\n * inRange(-3, -2, -6); // true\n * ```\n */\nexport function inRange(value: number, start: number, end?: number): boolean {\n if (end === undefined) {\n end = start;\n start = 0;\n }\n assertNumber(value);\n assertNumber(start);\n assertNumber(end);\n return value >= Math.min(start, end) && value < Math.max(start, end);\n}\n","/**\n * Computes `number` rounded up to `precision`.\n *\n * 根据 `precision`(精度) 向上舍入 `number`。\n * ```ts\n * ceil(4.006); // 5\n * ceil(6.004, 2); // 6.01\n * ceil(6040, -2); // 6100\n * ```\n */\nexport function ceil(number: number, precision: number = 0): number {\n return createRound(number, precision, 'ceil');\n}\n\n/**\n * Computes `number` rounded down to `precision`.\n *\n * 根据 `precision`(精度) 向下舍入 `number`。\n * ```ts\n * floor(4.006); // 4\n * floor(0.046, 2); // 0.04\n * floor(4060, -2); // 4000\n * ```\n */\nexport function floor(number: number, precision: number = 0): number {\n return createRound(number, precision, 'floor');\n}\n\n/**\n * Computes `number` rounded to `precision`.\n *\n * 根据 `precision`(精度) 四舍五入 `number`。\n * ```ts\n * round(4.006); // 4\n * round(4.006, 2); // 4.01\n * round(4060, -2); // 4100\n * ```\n */\nexport function round(number: number, precision: number = 0): number {\n return createRound(number, precision, 'round');\n}\n\nfunction createRound(number: number, precision: number, methodName: keyof Math): number {\n const func = Math[methodName] as (x: number) => number;\n\n precision = precision == null ? 0 : Math.min(precision, 292);\n if (!precision) {\n return func(number);\n }\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n let pair = `${number}e`.split('e');\n const value = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));\n pair = `${value}e`.split('e');\n return Number(`${pair[0]}e${Number(pair[1]) - precision}`);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;AAYG;SACa,OAAO,CAAC,KAAa,EAAE,KAAa,EAAE,GAAY,EAAA;IAChE,IAAI,GAAG,KAAK,SAAS,EAAE;QACrB,GAAG,GAAG,KAAK,CAAC;QACZ,KAAK,GAAG,CAAC,CAAC;AACX,KAAA;IACD,YAAY,CAAC,KAAK,CAAC,CAAC;IACpB,YAAY,CAAC,KAAK,CAAC,CAAC;IACpB,YAAY,CAAC,GAAG,CAAC,CAAC;IAClB,OAAO,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACvE;;ACxBA;;;;;;;;;AASG;SACa,IAAI,CAAC,MAAc,EAAE,YAAoB,CAAC,EAAA;IACxD,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;AASG;SACa,KAAK,CAAC,MAAc,EAAE,YAAoB,CAAC,EAAA;IACzD,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;AASG;SACa,KAAK,CAAC,MAAc,EAAE,YAAoB,CAAC,EAAA;IACzD,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,WAAW,CAAC,MAAc,EAAE,SAAiB,EAAE,UAAsB,EAAA;AAC5E,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAA0B,CAAC;AAEvD,IAAA,SAAS,GAAG,SAAS,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC7D,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACrB,KAAA;;;IAGD,IAAI,IAAI,GAAG,CAAA,EAAG,MAAM,CAAA,CAAA,CAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAG,EAAA,IAAI,CAAC,CAAC,CAAC,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA,CAAE,CAAC,CAAC,CAAC;IACxE,IAAI,GAAG,GAAG,KAAK,CAAA,CAAA,CAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC9B,IAAA,OAAO,MAAM,CAAC,CAAA,EAAG,IAAI,CAAC,CAAC,CAAC,CAAI,CAAA,EAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA,CAAE,CAAC,CAAC;AAC7D;;ACvDA;;AAEG;;;;"}
@@ -1,40 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, NgModule } from '@angular/core';
3
-
4
- class FilterPipe {
5
- /**
6
- * Filter array
7
- *
8
- * 过滤数组
9
- */
10
- transform(array, matcher, ...args) {
11
- return array.filter(i => matcher(i, ...args));
12
- }
13
- }
14
- FilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
15
- FilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FilterPipe, name: "filter" });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FilterPipe, decorators: [{
17
- type: Pipe,
18
- args: [{ name: 'filter' }]
19
- }] });
20
-
21
- const PIPES = [FilterPipe];
22
- class FilterPipeModule {
23
- }
24
- FilterPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FilterPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25
- FilterPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FilterPipeModule, declarations: [FilterPipe], exports: [FilterPipe] });
26
- FilterPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FilterPipeModule });
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FilterPipeModule, decorators: [{
28
- type: NgModule,
29
- args: [{
30
- declarations: PIPES,
31
- exports: PIPES
32
- }]
33
- }] });
34
-
35
- /**
36
- * Generated bundle index. Do not edit.
37
- */
38
-
39
- export { FilterPipe, FilterPipeModule };
40
- //# sourceMappingURL=pipe-filter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe-filter.mjs","sources":["../../../../packages/util/pipes/filter/filter.pipe.ts","../../../../packages/util/pipes/filter/module.ts","../../../../packages/util/pipes/filter/pipe-filter.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\nimport type { NzSafeAny } from 'ng-zorro-antd/core/types';\n\n@Pipe({ name: 'filter' })\nexport class FilterPipe implements PipeTransform {\n /**\n * Filter array\n *\n * 过滤数组\n */\n transform<T>(array: readonly T[], matcher: (item: T, ...args: NzSafeAny[]) => boolean, ...args: NzSafeAny[]): T[] {\n return array.filter(i => matcher(i, ...args));\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { FilterPipe } from './filter.pipe';\n\nconst PIPES = [FilterPipe];\n\n@NgModule({\n declarations: PIPES,\n exports: PIPES\n})\nexport class FilterPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,UAAU,CAAA;AACrB;;;;AAIG;AACH,IAAA,SAAS,CAAI,KAAmB,EAAE,OAAmD,EAAE,GAAG,IAAiB,EAAA;AACzG,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;KAC/C;;uGARU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;qGAAV,UAAU,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,CAAA;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,IAAI;mBAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;;;ACAxB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,CAAC;MAMd,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,YAAA,EAAA,CANd,UAAU,CAAA,EAAA,OAAA,EAAA,CAAV,UAAU,CAAA,EAAA,CAAA,CAAA;8GAMZ,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,KAAK;AACnB,oBAAA,OAAO,EAAE,KAAK;AACf,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
@@ -1,55 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, NgModule } from '@angular/core';
3
- import { formatMask } from '@delon/util/format';
4
-
5
- class FormatMaskPipe {
6
- /**
7
- * Format mask
8
- *
9
- * 格式化掩码
10
- *
11
- * | 字符 | 描述 |
12
- * | --- | --- |
13
- * | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |
14
- * | `9` | 任意数字 |
15
- * | `#` | 任意字符 |
16
- * | `U` | 转换大写 |
17
- * | `L` | 转换小写 |
18
- * | `*` | 转换为 `*` 字符 |
19
- *
20
- * ```ts
21
- * formatMask('123', '(###)') => (123)
22
- * formatMask('15900000000', '999****9999') => 159****0000
23
- * ```
24
- */
25
- transform(value, mask) {
26
- return formatMask(value, mask);
27
- }
28
- }
29
- FormatMaskPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormatMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
30
- FormatMaskPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FormatMaskPipe, name: "mask" });
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormatMaskPipe, decorators: [{
32
- type: Pipe,
33
- args: [{ name: 'mask' }]
34
- }] });
35
-
36
- const PIPES = [FormatMaskPipe];
37
- class FormatPipeModule {
38
- }
39
- FormatPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormatPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
40
- FormatPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FormatPipeModule, declarations: [FormatMaskPipe], exports: [FormatMaskPipe] });
41
- FormatPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormatPipeModule });
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormatPipeModule, decorators: [{
43
- type: NgModule,
44
- args: [{
45
- declarations: PIPES,
46
- exports: PIPES
47
- }]
48
- }] });
49
-
50
- /**
51
- * Generated bundle index. Do not edit.
52
- */
53
-
54
- export { FormatMaskPipe, FormatPipeModule };
55
- //# sourceMappingURL=pipe-format.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe-format.mjs","sources":["../../../../packages/util/pipes/format/mask.pipe.ts","../../../../packages/util/pipes/format/module.ts","../../../../packages/util/pipes/format/pipe-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\nimport { formatMask, FormatMaskOption } from '@delon/util/format';\n\n@Pipe({ name: 'mask' })\nexport class FormatMaskPipe implements PipeTransform {\n /**\n * Format mask\n *\n * 格式化掩码\n *\n * | 字符 | 描述 |\n * | --- | --- |\n * | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |\n * | `9` | 任意数字 |\n * | `#` | 任意字符 |\n * | `U` | 转换大写 |\n * | `L` | 转换小写 |\n * | `*` | 转换为 `*` 字符 |\n *\n * ```ts\n * formatMask('123', '(###)') => (123)\n * formatMask('15900000000', '999****9999') => 159****0000\n * ```\n */\n transform(value: string, mask: string | FormatMaskOption): string {\n return formatMask(value, mask);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { FormatMaskPipe } from './mask.pipe';\n\nconst PIPES = [FormatMaskPipe];\n\n@NgModule({\n declarations: PIPES,\n exports: PIPES\n})\nexport class FormatPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAKa,cAAc,CAAA;AACzB;;;;;;;;;;;;;;;;;;AAkBG;IACH,SAAS,CAAC,KAAa,EAAE,IAA+B,EAAA;AACtD,QAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAChC;;2GAtBU,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,CAAA;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,IAAI;mBAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;;;ACAtB,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,CAAC;MAMlB,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;8GAAhB,gBAAgB,EAAA,YAAA,EAAA,CANd,cAAc,CAAA,EAAA,OAAA,EAAA,CAAd,cAAc,CAAA,EAAA,CAAA,CAAA;8GAMhB,gBAAgB,EAAA,CAAA,CAAA;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,KAAK;AACnB,oBAAA,OAAO,EAAE,KAAK;AACf,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
@@ -1,8 +0,0 @@
1
- export * from '@delon/util/pipes/currency';
2
- export * from '@delon/util/pipes/format';
3
- export * from '@delon/util/pipes/filter';
4
-
5
- /**
6
- * Generated bundle index. Do not edit.
7
- */
8
- //# sourceMappingURL=pipes.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipes.mjs","sources":["../../../../packages/util/pipes/pipes.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;AAEG"}
@@ -1,37 +0,0 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import { InjectionToken, inject } from '@angular/core';
3
- import { fromEvent, startWith, map, distinctUntilChanged, share } from 'rxjs';
4
-
5
- /**
6
- * Access to global `window` object
7
- *
8
- * 访问全局 `window` 对象
9
- */
10
- const WINDOW = new InjectionToken('WINDOW', {
11
- factory: () => {
12
- const { defaultView } = inject(DOCUMENT);
13
- if (!defaultView) {
14
- throw new Error('Window is not available');
15
- }
16
- return defaultView;
17
- }
18
- });
19
-
20
- /**
21
- * Use the `visibilitychange` event to monitor whether the browser tab is visible, which is generally used when the user leaves the browser tab to temp interrupt the backend to continue sending requests
22
- *
23
- * 通过 `visibilitychange` 事件来监听浏览器选项卡是否可见,一般用于当用户离开应用时暂时中断后端持续发送请求时
24
- */
25
- const PAGE_VISIBILITY = new InjectionToken('PAGE_VISIBILITY`', {
26
- factory: () => {
27
- const doc = inject(DOCUMENT);
28
- return fromEvent(doc, 'visibilitychange').pipe(startWith(0), map(() => !doc.hidden), distinctUntilChanged(), share());
29
- }
30
- });
31
-
32
- /**
33
- * Generated bundle index. Do not edit.
34
- */
35
-
36
- export { PAGE_VISIBILITY, WINDOW };
37
- //# sourceMappingURL=token.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.mjs","sources":["../../../../packages/util/token/window.ts","../../../../packages/util/token/page-visibility.ts","../../../../packages/util/token/token.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\n\n/**\n * Access to global `window` object\n *\n * 访问全局 `window` 对象\n */\nexport const WINDOW = new InjectionToken<Window>('WINDOW', {\n factory: () => {\n const { defaultView } = inject(DOCUMENT);\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n return defaultView;\n }\n});\n","import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\nimport { fromEvent, Observable, distinctUntilChanged, map, share, startWith } from 'rxjs';\n\n/**\n * Use the `visibilitychange` event to monitor whether the browser tab is visible, which is generally used when the user leaves the browser tab to temp interrupt the backend to continue sending requests\n *\n * 通过 `visibilitychange` 事件来监听浏览器选项卡是否可见,一般用于当用户离开应用时暂时中断后端持续发送请求时\n */\nexport const PAGE_VISIBILITY = new InjectionToken<Observable<boolean>>('PAGE_VISIBILITY`', {\n factory: () => {\n const doc = inject(DOCUMENT);\n return fromEvent(doc, 'visibilitychange').pipe(\n startWith(0),\n map(() => !doc.hidden),\n distinctUntilChanged(),\n share()\n );\n }\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;MACU,MAAM,GAAG,IAAI,cAAc,CAAS,QAAQ,EAAE;IACzD,OAAO,EAAE,MAAK;QACZ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC5C,SAAA;AACD,QAAA,OAAO,WAAW,CAAC;KACpB;AACF,CAAA;;ACZD;;;;AAIG;MACU,eAAe,GAAG,IAAI,cAAc,CAAsB,kBAAkB,EAAE;IACzF,OAAO,EAAE,MAAK;AACZ,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC7B,QAAA,OAAO,SAAS,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAC5C,SAAS,CAAC,CAAC,CAAC,EACZ,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EACtB,oBAAoB,EAAE,EACtB,KAAK,EAAE,CACR,CAAC;KACH;AACF,CAAA;;ACnBD;;AAEG;;;;"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes