@yelon/util 18.2.0 → 19.0.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 (166) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1 -1
  3. package/browser/cookie.service.d.ts +1 -3
  4. package/browser/style.d.ts +1 -3
  5. package/config/abc/date-picker.type.d.ts +2 -5
  6. package/config/abc/exception.type.d.ts +5 -7
  7. package/config/abc/loading.type.d.ts +1 -3
  8. package/config/abc/media.type.d.ts +1 -2
  9. package/config/abc/st.type.d.ts +11 -18
  10. package/config/acl/acl.type.d.ts +1 -2
  11. package/config/chart/chart.type.d.ts +1 -4
  12. package/config/config.service.d.ts +5 -4
  13. package/config/sf/sf.type.d.ts +3 -6
  14. package/config/theme/responsive.type.d.ts +8 -10
  15. package/date-time/time.d.ts +1 -2
  16. package/decorator/convert.d.ts +2 -3
  17. package/fesm2022/array.mjs +4 -4
  18. package/fesm2022/array.mjs.map +1 -1
  19. package/fesm2022/browser.mjs +13 -16
  20. package/fesm2022/browser.mjs.map +1 -1
  21. package/fesm2022/config.mjs +33 -18
  22. package/fesm2022/config.mjs.map +1 -1
  23. package/fesm2022/date-time.mjs +1 -1
  24. package/fesm2022/date-time.mjs.map +1 -1
  25. package/fesm2022/decorator.mjs.map +1 -1
  26. package/fesm2022/form.mjs.map +1 -1
  27. package/fesm2022/format.mjs +9 -7
  28. package/fesm2022/format.mjs.map +1 -1
  29. package/fesm2022/math.mjs.map +1 -1
  30. package/fesm2022/mcache.mjs.map +1 -1
  31. package/fesm2022/mtypes.mjs +4 -5
  32. package/fesm2022/mtypes.mjs.map +1 -1
  33. package/fesm2022/other.mjs +14 -17
  34. package/fesm2022/other.mjs.map +1 -1
  35. package/fesm2022/pipe-currency.mjs +20 -26
  36. package/fesm2022/pipe-currency.mjs.map +1 -1
  37. package/fesm2022/pipe-filter.mjs +8 -8
  38. package/fesm2022/pipe-filter.mjs.map +1 -1
  39. package/fesm2022/pipe-format.mjs +8 -8
  40. package/fesm2022/pipe-format.mjs.map +1 -1
  41. package/fesm2022/token.mjs.map +1 -1
  42. package/format/string.d.ts +3 -6
  43. package/mtypes/header-menu.type.d.ts +2 -3
  44. package/mtypes/menu.type.d.ts +5 -6
  45. package/mtypes/page.d.ts +1 -2
  46. package/other/deep.d.ts +4 -7
  47. package/other/lazy.service.d.ts +2 -5
  48. package/other/logger.d.ts +3 -4
  49. package/other/path-to-regexp.service.d.ts +11 -12
  50. package/package.json +12 -46
  51. package/pipes/filter/filter.pipe.d.ts +1 -2
  52. package/esm2022/array/array-type.service.mjs +0 -2
  53. package/esm2022/array/array.mjs +0 -5
  54. package/esm2022/array/array.service.mjs +0 -278
  55. package/esm2022/array/index.mjs +0 -3
  56. package/esm2022/browser/browser.mjs +0 -5
  57. package/esm2022/browser/cookie.service.mjs +0 -100
  58. package/esm2022/browser/copy.mjs +0 -28
  59. package/esm2022/browser/index.mjs +0 -6
  60. package/esm2022/browser/is-empty.mjs +0 -19
  61. package/esm2022/browser/scroll.service.mjs +0 -85
  62. package/esm2022/browser/style.mjs +0 -38
  63. package/esm2022/config/abc/cell.type.mjs +0 -2
  64. package/esm2022/config/abc/date-picker.type.mjs +0 -2
  65. package/esm2022/config/abc/error-collect.type.mjs +0 -2
  66. package/esm2022/config/abc/exception.type.mjs +0 -2
  67. package/esm2022/config/abc/image.type.mjs +0 -2
  68. package/esm2022/config/abc/index.mjs +0 -18
  69. package/esm2022/config/abc/loading.type.mjs +0 -2
  70. package/esm2022/config/abc/lodop.type.mjs +0 -2
  71. package/esm2022/config/abc/media.type.mjs +0 -2
  72. package/esm2022/config/abc/onboarding.type.mjs +0 -2
  73. package/esm2022/config/abc/page-header.type.mjs +0 -2
  74. package/esm2022/config/abc/pdf.type.mjs +0 -2
  75. package/esm2022/config/abc/se.type.mjs +0 -2
  76. package/esm2022/config/abc/sg.type.mjs +0 -2
  77. package/esm2022/config/abc/st.type.mjs +0 -2
  78. package/esm2022/config/abc/sv.type.mjs +0 -3
  79. package/esm2022/config/abc/xlsx.type.mjs +0 -2
  80. package/esm2022/config/abc/zip.type.mjs +0 -2
  81. package/esm2022/config/acl/acl.type.mjs +0 -2
  82. package/esm2022/config/auth/auth.type.mjs +0 -2
  83. package/esm2022/config/bis/bis.type.mjs +0 -2
  84. package/esm2022/config/cache/cache.type.mjs +0 -2
  85. package/esm2022/config/chart/chart.type.mjs +0 -2
  86. package/esm2022/config/config.mjs +0 -5
  87. package/esm2022/config/config.service.mjs +0 -38
  88. package/esm2022/config/config.types.mjs +0 -12
  89. package/esm2022/config/index.mjs +0 -15
  90. package/esm2022/config/mock/mock.type.mjs +0 -2
  91. package/esm2022/config/sf/sf.type.mjs +0 -2
  92. package/esm2022/config/socket/socket.type.mjs +0 -2
  93. package/esm2022/config/theme/http.type.mjs +0 -2
  94. package/esm2022/config/theme/i18n.type.mjs +0 -2
  95. package/esm2022/config/theme/index.mjs +0 -5
  96. package/esm2022/config/theme/pipe.type.mjs +0 -2
  97. package/esm2022/config/theme/responsive.type.mjs +0 -2
  98. package/esm2022/config/util/array.type.mjs +0 -2
  99. package/esm2022/config/util/currency.type.mjs +0 -2
  100. package/esm2022/date-time/date-time.mjs +0 -5
  101. package/esm2022/date-time/index.mjs +0 -3
  102. package/esm2022/date-time/picker.mjs +0 -116
  103. package/esm2022/date-time/time.mjs +0 -103
  104. package/esm2022/decorator/convert.mjs +0 -66
  105. package/esm2022/decorator/decorator.mjs +0 -5
  106. package/esm2022/decorator/index.mjs +0 -3
  107. package/esm2022/decorator/zone-outside.mjs +0 -57
  108. package/esm2022/form/form.mjs +0 -5
  109. package/esm2022/form/index.mjs +0 -3
  110. package/esm2022/form/match-control.mjs +0 -30
  111. package/esm2022/form/validators.mjs +0 -81
  112. package/esm2022/format/currency.service.mjs +0 -233
  113. package/esm2022/format/currency.types.mjs +0 -8
  114. package/esm2022/format/format.mjs +0 -5
  115. package/esm2022/format/index.mjs +0 -5
  116. package/esm2022/format/string.mjs +0 -85
  117. package/esm2022/format/validate.mjs +0 -94
  118. package/esm2022/index.mjs +0 -14
  119. package/esm2022/math/in-range.mjs +0 -25
  120. package/esm2022/math/index.mjs +0 -3
  121. package/esm2022/math/math.mjs +0 -5
  122. package/esm2022/math/round.mjs +0 -53
  123. package/esm2022/mcache/index.mjs +0 -2
  124. package/esm2022/mcache/localStorageUtils.mjs +0 -60
  125. package/esm2022/mcache/mcache.mjs +0 -5
  126. package/esm2022/mtypes/authority.type.mjs +0 -2
  127. package/esm2022/mtypes/header-menu.type.mjs +0 -2
  128. package/esm2022/mtypes/index.mjs +0 -10
  129. package/esm2022/mtypes/menu.type.mjs +0 -2
  130. package/esm2022/mtypes/mtypes.mjs +0 -5
  131. package/esm2022/mtypes/nav.types.mjs +0 -9
  132. package/esm2022/mtypes/page.mjs +0 -42
  133. package/esm2022/mtypes/project-info.types.mjs +0 -2
  134. package/esm2022/mtypes/response.mjs +0 -2
  135. package/esm2022/mtypes/role.type.mjs +0 -2
  136. package/esm2022/mtypes/user.types.mjs +0 -2
  137. package/esm2022/other/assert.mjs +0 -67
  138. package/esm2022/other/deep.mjs +0 -78
  139. package/esm2022/other/favicon.mjs +0 -29
  140. package/esm2022/other/index.mjs +0 -8
  141. package/esm2022/other/lazy.service.mjs +0 -129
  142. package/esm2022/other/logger.mjs +0 -33
  143. package/esm2022/other/other.mjs +0 -5
  144. package/esm2022/other/path-to-regexp.service.mjs +0 -239
  145. package/esm2022/other/resize.mjs +0 -4
  146. package/esm2022/pipes/currency/cny.pipe.mjs +0 -23
  147. package/esm2022/pipes/currency/index.mjs +0 -5
  148. package/esm2022/pipes/currency/mega.pipe.mjs +0 -25
  149. package/esm2022/pipes/currency/module.mjs +0 -19
  150. package/esm2022/pipes/currency/pipe-currency.mjs +0 -5
  151. package/esm2022/pipes/currency/price.pipe.mjs +0 -27
  152. package/esm2022/pipes/filter/filter.pipe.mjs +0 -20
  153. package/esm2022/pipes/filter/index.mjs +0 -3
  154. package/esm2022/pipes/filter/module.mjs +0 -17
  155. package/esm2022/pipes/filter/pipe-filter.mjs +0 -5
  156. package/esm2022/pipes/format/index.mjs +0 -3
  157. package/esm2022/pipes/format/mask.pipe.mjs +0 -34
  158. package/esm2022/pipes/format/module.mjs +0 -17
  159. package/esm2022/pipes/format/pipe-format.mjs +0 -5
  160. package/esm2022/pipes/index.mjs +0 -4
  161. package/esm2022/pipes/pipes.mjs +0 -5
  162. package/esm2022/token/index.mjs +0 -3
  163. package/esm2022/token/page-visibility.mjs +0 -15
  164. package/esm2022/token/token.mjs +0 -5
  165. package/esm2022/token/window.mjs +0 -17
  166. package/esm2022/yelon-util.mjs +0 -5
@@ -1,103 +0,0 @@
1
- import { addDays, endOfDay, endOfMonth, endOfWeek, endOfYear, parse, parseISO, startOfDay, startOfMonth, startOfWeek, startOfYear, subMonths, subWeeks, subYears, format, formatDistanceToNow } from 'date-fns';
2
- /**
3
- * Get the time range, return `[ Date, Date]` for the start and end dates
4
- *
5
- * 获取时间范围
6
- *
7
- * @param type 类型,带 `-` 表示过去一个时间,若指定 `number` 表示天数
8
- * @param time 开始时间
9
- * @param ignoreMaxTime 忽略追加结束日期的最大时间值
10
- */
11
- export function getTimeDistance(type, time, options) {
12
- time = time
13
- ? typeof time === 'string'
14
- ? parse(time, 'yyyy-MM-dd HH:mm:ss', new Date())
15
- : new Date(time)
16
- : new Date();
17
- const opt = { weekStartsOn: 1 };
18
- let res;
19
- switch (type) {
20
- case 'today':
21
- res = [time, time];
22
- break;
23
- case '-today':
24
- res = [addDays(time, -1), time];
25
- break;
26
- case 'yesterday':
27
- res = [addDays(time, -1), addDays(time, -1)];
28
- break;
29
- case 'week':
30
- res = [startOfWeek(time, opt), endOfWeek(time, opt)];
31
- break;
32
- case '-week':
33
- res = [startOfWeek(subWeeks(time, 1), opt), endOfWeek(subWeeks(time, 1), opt)];
34
- break;
35
- case 'month':
36
- res = [startOfMonth(time), endOfMonth(time)];
37
- break;
38
- case '-month':
39
- res = [startOfMonth(subMonths(time, 1)), endOfMonth(subMonths(time, 1))];
40
- break;
41
- case 'year':
42
- res = [startOfYear(time), endOfYear(time)];
43
- break;
44
- case '-year':
45
- res = [startOfYear(subYears(time, 1)), endOfYear(subYears(time, 1))];
46
- break;
47
- default:
48
- res = type > 0 ? [time, addDays(time, type)] : [addDays(time, type), time];
49
- break;
50
- }
51
- return options?.ignoreMaxTime ? res : fixEndTimeOfRange(res);
52
- }
53
- /**
54
- * fix time is the most, big value
55
- */
56
- export function fixEndTimeOfRange(dates) {
57
- return [startOfDay(dates[0]), endOfDay(dates[1])];
58
- }
59
- /**
60
- * Convert to `Date` format
61
- *
62
- * @param value When is a number, it's treated as a timestamp; If it's seconds, you need to provide the `options.timestampSecond` parameter.
63
- */
64
- export function toDate(value, options) {
65
- const { formatString, defaultValue, timestampSecond } = {
66
- formatString: 'yyyy-MM-dd HH:mm:ss',
67
- defaultValue: new Date(NaN),
68
- timestampSecond: false,
69
- ...(typeof options === 'string' ? { formatString: options } : options)
70
- };
71
- if (value == null) {
72
- return defaultValue;
73
- }
74
- if (value instanceof Date) {
75
- return value;
76
- }
77
- if (typeof value === 'number' || (typeof value === 'string' && /^[0-9]+$/.test(value))) {
78
- const valueNumber = +value;
79
- return new Date(timestampSecond ? valueNumber * 1000 : valueNumber);
80
- }
81
- let tryDate = parseISO(value);
82
- if (isNaN(tryDate)) {
83
- tryDate = parse(value, formatString, new Date());
84
- }
85
- return isNaN(tryDate) ? defaultValue : tryDate;
86
- }
87
- /**
88
- * Format date, supports `Date, number, string` types
89
- *
90
- * @param value When is a number, it is treated as a timestamp (Support seconds and milliseconds timestamp).
91
- * @param formatString Please refer to [date-fnd format](https://date-fns.org/v2.30.0/docs/format) for string format
92
- * @param dateLocale Recommended to be consistent with NG-ZORRO by using `inject(NZ_DATE_LOCALE)`
93
- */
94
- export function formatDate(value, formatString, options) {
95
- value = toDate(value);
96
- if (isNaN(value))
97
- return '';
98
- const langOpt = { locale: options?.locale };
99
- return formatString === 'fn'
100
- ? formatDistanceToNow(value, langOpt)
101
- : (options?.customFormat ?? format)(value, formatString, langOpt);
102
- }
103
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZGF0ZS10aW1lL3RpbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLE9BQU8sRUFDUCxRQUFRLEVBQ1IsVUFBVSxFQUNWLFNBQVMsRUFDVCxTQUFTLEVBQ1QsS0FBSyxFQUNMLFFBQVEsRUFDUixVQUFVLEVBQ1YsWUFBWSxFQUNaLFdBQVcsRUFDWCxXQUFXLEVBQ1gsU0FBUyxFQUNULFFBQVEsRUFDUixRQUFRLEVBQ1IsTUFBTSxFQUNOLG1CQUFtQixFQUNwQixNQUFNLFVBQVUsQ0FBQztBQU1sQjs7Ozs7Ozs7R0FRRztBQUNILE1BQU0sVUFBVSxlQUFlLENBQzdCLElBQTBHLEVBQzFHLElBQTZCLEVBQzdCLE9BQXFDO0lBRXJDLElBQUksR0FBRyxJQUFJO1FBQ1QsQ0FBQyxDQUFDLE9BQU8sSUFBSSxLQUFLLFFBQVE7WUFDeEIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxJQUFJLEVBQUUscUJBQXFCLEVBQUUsSUFBSSxJQUFJLEVBQUUsQ0FBQztZQUNoRCxDQUFDLENBQUMsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDO1FBQ2xCLENBQUMsQ0FBQyxJQUFJLElBQUksRUFBRSxDQUFDO0lBQ2YsTUFBTSxHQUFHLEdBQXdCLEVBQUUsWUFBWSxFQUFFLENBQUMsRUFBRSxDQUFDO0lBRXJELElBQUksR0FBaUIsQ0FBQztJQUN0QixRQUFRLElBQUksRUFBRSxDQUFDO1FBQ2IsS0FBSyxPQUFPO1lBQ1YsR0FBRyxHQ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lRm9ybWF0Q3VzdG9tIH1cbik6IHN0cmluZyB7XG4gIHZhbHVlID0gdG9EYXRlKHZhbHVlKTtcbiAgaWYgKGlzTmFOKHZhbHVlIGFzIE56U2FmZUFueSkpIHJldHVybiAnJztcblxuICBjb25zdCBsYW5nT3B0ID0geyBsb2NhbGU6IG9wdGlvbnM/LmxvY2FsZSB9O1xuICByZXR1cm4gZm9ybWF0U3RyaW5nID09PSAnZm4nXG4gICAgPyBmb3JtYXREaXN0YW5jZVRvTm93KHZhbHVlLCBsYW5nT3B0KVxuICAgIDogKG9wdGlvbnM/LmN1c3RvbUZvcm1hdCA/PyBmb3JtYXQpKHZhbHVlLCBmb3JtYXRTdHJpbmcsIGxhbmdPcHQpO1xufVxuIl19
@@ -1,66 +0,0 @@
1
- import { warn } from '@yelon/util/other';
2
- function propDecoratorFactory(name, fallback, defaultValue) {
3
- function propDecorator(target, propName, originalDescriptor) {
4
- const privatePropName = `$$__${propName}`;
5
- if (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
- * @deprecated Recommended to use the built-in `transform` and `static ngAcceptInputType_` can be removed
35
- * - Use `@Input({ transform: booleanAttribute })` instead of `@InputBoolean()`
36
- * - Use `@Input({ transform: (v: unknown) => (v == null ? null : booleanAttribute(v)) })` instead of `@InputBoolean(null)`
37
- *
38
- * Input decorator that handle a prop to do get/set automatically with toBoolean
39
- *
40
- * ```ts
41
- * {AT}Input() {AT}InputBoolean() visible: boolean = false;
42
- * {AT}Input() {AT}InputBoolean(null) visible: boolean = false;
43
- * ```
44
- */
45
- export function InputBoolean(defaultValue = false) {
46
- return propDecoratorFactory('InputBoolean', toBoolean, defaultValue);
47
- }
48
- export function toNumber(value, fallbackValue = 0) {
49
- return !isNaN(parseFloat(value)) && !isNaN(Number(value)) ? Number(value) : fallbackValue;
50
- }
51
- /**
52
- * @deprecated Recommended to use the built-in `transform` and `static ngAcceptInputType_` can be removed
53
- * - Use `@Input({ transform: numberAttribute })` instead of `@InputNumber()`
54
- * - Use `@Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) })` instead of `@InputNumber(null)`
55
- *
56
- * Input decorator that handle a prop to do get/set automatically with toNumber
57
- *
58
- * ```ts
59
- * {AT}Input() {AT}InputNumber() visible: number = 1;
60
- * {AT}Input() {AT}InputNumber(null) visible: number = 2;
61
- * ```
62
- */
63
- export function InputNumber(defaultValue = 0) {
64
- return propDecoratorFactory('InputNumber', toNumber, defaultValue);
65
- }
66
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZGVjb3JhdG9yL2NvbnZlcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBTXpDLFNBQVMsb0JBQW9CLENBQzNCLElBQVksRUFDWixRQUFzQyxFQUN0QyxZQUF1QjtJQUV2QixTQUFTLGFBQWEsQ0FDcEIsTUFBaUIsRUFDakIsUUFBZ0IsRUFDaEIsa0JBQXVEO1FBRXZELE1B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FjdG9yeSgnSW5wdXROdW1iZXInLCB0b051bWJlciwgZGVmYXVsdFZhbHVlKTtcbn1cbiJdfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9kZWNvcmF0b3IvZGVjb3JhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -1,3 +0,0 @@
1
- export * from './convert';
2
- export * from './zone-outside';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2RlY29yYXRvci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFdBQVcsQ0FBQztBQUMxQixjQUFjLGdCQUFnQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jb252ZXJ0JztcbmV4cG9ydCAqIGZyb20gJy4vem9uZS1vdXRzaWRlJztcbiJdfQ==
@@ -1,57 +0,0 @@
1
- import { warn } from '@yelon/util/other';
2
- function makeFn(type, options) {
3
- return (_, __, descriptor) => {
4
- const source = descriptor.value;
5
- descriptor.value = function (...data) {
6
- const that = this;
7
- const ngZone = that[options?.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
- * readonly ngZone = inject(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
- * readonly ngZone = inject(NgZone);
48
- *
49
- * {AT}ZoneRun()
50
- * run(): void {}
51
- * }
52
- * ```
53
- */
54
- export function ZoneRun(options) {
55
- return makeFn('run', options);
56
- }
57
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiem9uZS1vdXRzaWRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9kZWNvcmF0b3Ivem9uZS1vdXRzaWRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQVN6QyxTQUFTLE1BQU0sQ0FBQyxJQUFpQyxFQUFFLE9BQXFCO0lBQ3RFLE9BQU8sQ0FBQyxDQUFDLEVBQUUsRUFBRSxFQUFFLFVBQVUsRUFBRSxFQUFFO1FBQzNCLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUM7UUFDaEM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pZCB7fVxuICogfVxuICogYGBgXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBab25lUnVuKG9wdGlvbnM/OiBab25lT3B0aW9ucyk6IERlY29yYXRvclR5cGUge1xuICByZXR1cm4gbWFrZUZuKCdydW4nLCBvcHRpb25zKTtcbn1cbiJdfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybS9mb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -1,3 +0,0 @@
1
- export * from './validators';
2
- export * from './match-control';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL2Zvcm0vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxpQkFBaUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vdmFsaWRhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL21hdGNoLWNvbnRyb2wnO1xuIl19
@@ -1,30 +0,0 @@
1
- /**
2
- * Match two control values
3
- *
4
- * 匹配两个控件值
5
- * ```ts
6
- * this.form = new FormGroup({
7
- * pwd: new FormControl(''),
8
- * repwd: new FormControl(''),
9
- * }, {
10
- * validators: MatchControl('pwd', 'repwd'),
11
- * });
12
- * ```
13
- */
14
- export function MatchControl(controlName, matchingControlName) {
15
- return (formGroup) => {
16
- const control = formGroup.get(controlName);
17
- const matchingControl = formGroup.get(matchingControlName);
18
- if (matchingControl.errors && !matchingControl.errors.matchControl) {
19
- return null;
20
- }
21
- if (control.value !== matchingControl.value) {
22
- matchingControl.setErrors({ matchControl: true });
23
- }
24
- else {
25
- matchingControl.setErrors(null);
26
- }
27
- return null;
28
- };
29
- }
30
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2gtY29udHJvbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybS9tYXRjaC1jb250cm9sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBOzs7Ozs7Ozs7Ozs7R0FZRztBQUNILE1BQU0sVUFBVSxZQUFZLENBQUMsV0FBbUIsRUFBRSxtQkFBMkI7SUFDM0UsT0FBTyxDQUFDLFNBQTBCLEVBQUUsRUFBRTtRQUNwQyxNQUFNLE9BQU8sR0FBRyxTQUFTLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0FBRSxDQUFDO1FBQzVDLE1BQU0sZUFBZSxHQUFHLFNBQVMsQ0FBQyxHQUFHLENBQUMsbUJBQW1CLENBQUUsQ0FBQztRQUM1RCxJQUFJLGVBQWUsQ0FBQyxNQUFNLElBQUksQ0FBQyxlQUFlLENBQUMsTUFBTSxDQUFDLFlBQVksRUFBRSxDQUFDO1lBQ25FLE9BQU8sSUFBSSxDQUFDO1FBQ2QsQ0FBQztRQUNELElBQUksT0FBTyxDQUFDLEtBQUssS0FBSyxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUM7WUFDNUMsZUFBZSxDQUF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ycy5tYXRjaENvbnRyb2wpIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgICBpZiAoY29udHJvbC52YWx1ZSAhPT0gbWF0Y2hpbmdDb250cm9sLnZhbHVlKSB7XG4gICAgICBtYXRjaGluZ0NvbnRyb2wuc2V0RXJyb3JzKHsgbWF0Y2hDb250cm9sOiB0cnVlIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICBtYXRjaGluZ0NvbnRyb2wuc2V0RXJyb3JzKG51bGwpO1xuICAgIH1cbiAgICByZXR1cm4gbnVsbDtcbiAgfTtcbn1cbiJdfQ==
@@ -1,81 +0,0 @@
1
- import { isChinese, isColor, isDecimal, isIdCard, isInt, isIp, isMobile, isNum, isUrl } from '@yelon/util/format';
2
- /**
3
- * A set of validators for reactive forms
4
- *
5
- * 一套用于响应式表单的验证器
6
- */
7
- export class _Validators {
8
- /**
9
- * Wheter is number
10
- *
11
- * 是否为数字
12
- */
13
- static num(control) {
14
- return isNum(control.value) ? null : { num: true };
15
- }
16
- /**
17
- * Wheter is integer
18
- *
19
- * 是否为整数
20
- */
21
- static int(control) {
22
- return isInt(control.value) ? null : { int: true };
23
- }
24
- /**
25
- * Wheter is decimal
26
- *
27
- * 是否为小数点数值
28
- */
29
- static decimal(control) {
30
- return isDecimal(control.value) ? null : { decimal: true };
31
- }
32
- /**
33
- * Wheter is People's Republic of China identity card
34
- *
35
- * 是否为中华人民共和国居民身份证
36
- */
37
- static idCard(control) {
38
- return isIdCard(control.value) ? null : { idCard: true };
39
- }
40
- /**
41
- * Wheter is china mobile (China)
42
- *
43
- * 是否为手机号(中国)
44
- */
45
- static mobile(control) {
46
- return isMobile(control.value) ? null : { mobile: true };
47
- }
48
- /**
49
- * Wheter is url address
50
- *
51
- * 是否URL地址
52
- */
53
- static url(control) {
54
- return isUrl(control.value) ? null : { url: true };
55
- }
56
- /**
57
- * Wheter is IPv4 address (Support v4, v6)
58
- *
59
- * 是否IP4地址(支持v4、v6)
60
- */
61
- static ip(control) {
62
- return isIp(control.value) ? null : { ip: true };
63
- }
64
- /**
65
- * Wheter is color
66
- *
67
- * 是否颜色代码值
68
- */
69
- static color(control) {
70
- return isColor(control.value) ? null : { color: true };
71
- }
72
- /**
73
- * Wheter is chinese
74
- *
75
- * 是否中文
76
- */
77
- static chinese(control) {
78
- return isChinese(control.value) ? null : { chinese: true };
79
- }
80
- }
81
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvZm9ybS92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLFNBQVMsRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRWxIOzs7O0dBSUc7QUFDSCxNQUFNLE9BQU8sV0FBVztJQUN0Qjs7OztPQUlHO0lBQ0gsTUFBTSxDQUFDLEdBQUcsQ0FBQyxPQUF3QjtRQUNqQyxPQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxHQUFHLEVBQUUsSUFBSSxFQUFFLENBQUM7SUFDckQsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxNQUFNLENBQUMsR0FBRyxDQUFDLE9BQXdCO1FBQ2pDLE9BQU8sS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsRUFBRSxJQUFJLEVBQUUsQ0FBQztJQUNyR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