@yelon/util 19.2.0 → 20.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 (121) hide show
  1. package/array/index.d.ts +149 -2
  2. package/browser/index.d.ts +134 -5
  3. package/config/index.d.ts +1423 -14
  4. package/date-time/index.d.ts +115 -2
  5. package/decorator/index.d.ts +37 -2
  6. package/fesm2022/array.mjs +9 -8
  7. package/fesm2022/array.mjs.map +1 -1
  8. package/fesm2022/browser.mjs +7 -6
  9. package/fesm2022/browser.mjs.map +1 -1
  10. package/fesm2022/config.mjs +3 -3
  11. package/fesm2022/config.mjs.map +1 -1
  12. package/fesm2022/date-time.mjs.map +1 -1
  13. package/fesm2022/decorator.mjs +1 -66
  14. package/fesm2022/decorator.mjs.map +1 -1
  15. package/fesm2022/form.mjs.map +1 -1
  16. package/fesm2022/format.mjs +8 -7
  17. package/fesm2022/format.mjs.map +1 -1
  18. package/fesm2022/math.mjs.map +1 -1
  19. package/fesm2022/mcache.mjs.map +1 -1
  20. package/fesm2022/mtypes.mjs.map +1 -1
  21. package/fesm2022/other.mjs +6 -6
  22. package/fesm2022/other.mjs.map +1 -1
  23. package/fesm2022/pipe-currency.mjs +13 -13
  24. package/fesm2022/pipe-currency.mjs.map +1 -1
  25. package/fesm2022/pipe-filter.mjs +7 -7
  26. package/fesm2022/pipe-filter.mjs.map +1 -1
  27. package/fesm2022/pipe-format.mjs +7 -7
  28. package/fesm2022/pipe-format.mjs.map +1 -1
  29. package/fesm2022/token.mjs.map +1 -1
  30. package/form/index.d.ts +80 -2
  31. package/format/index.d.ts +239 -4
  32. package/math/index.d.ts +50 -2
  33. package/mcache/index.d.ts +21 -1
  34. package/mtypes/index.d.ts +197 -9
  35. package/other/index.d.ts +154 -7
  36. package/package.json +12 -12
  37. package/pipes/currency/index.d.ts +52 -4
  38. package/pipes/filter/index.d.ts +21 -2
  39. package/pipes/format/index.d.ts +36 -2
  40. package/token/index.d.ts +18 -2
  41. package/array/array-type.service.d.ts +0 -68
  42. package/array/array.service.d.ts +0 -78
  43. package/browser/cookie.service.d.ts +0 -62
  44. package/browser/copy.d.ts +0 -6
  45. package/browser/is-empty.d.ts +0 -6
  46. package/browser/scroll.service.d.ts +0 -34
  47. package/browser/style.d.ts +0 -19
  48. package/config/abc/cell.type.d.ts +0 -118
  49. package/config/abc/date-picker.type.d.ts +0 -49
  50. package/config/abc/error-collect.type.d.ts +0 -10
  51. package/config/abc/exception.type.d.ts +0 -7
  52. package/config/abc/image.type.d.ts +0 -15
  53. package/config/abc/index.d.ts +0 -17
  54. package/config/abc/loading.type.d.ts +0 -29
  55. package/config/abc/lodop.type.d.ts +0 -33
  56. package/config/abc/media.type.d.ts +0 -10
  57. package/config/abc/onboarding.type.d.ts +0 -4
  58. package/config/abc/page-header.type.d.ts +0 -39
  59. package/config/abc/pdf.type.d.ts +0 -35
  60. package/config/abc/se.type.d.ts +0 -32
  61. package/config/abc/sg.type.d.ts +0 -10
  62. package/config/abc/st.type.d.ts +0 -464
  63. package/config/abc/sv.type.d.ts +0 -14
  64. package/config/abc/xlsx.type.d.ts +0 -12
  65. package/config/abc/zip.type.d.ts +0 -10
  66. package/config/acl/acl.type.d.ts +0 -31
  67. package/config/auth/auth.type.d.ts +0 -55
  68. package/config/bis/bis.type.d.ts +0 -11
  69. package/config/cache/cache.type.d.ts +0 -66
  70. package/config/chart/chart.type.d.ts +0 -30
  71. package/config/config.service.d.ts +0 -14
  72. package/config/config.types.d.ts +0 -51
  73. package/config/mock/mock.type.d.ts +0 -14
  74. package/config/sf/sf.type.d.ts +0 -130
  75. package/config/socket/socket.type.d.ts +0 -4
  76. package/config/theme/http.type.d.ts +0 -15
  77. package/config/theme/i18n.type.d.ts +0 -14
  78. package/config/theme/index.d.ts +0 -4
  79. package/config/theme/pipe.type.d.ts +0 -7
  80. package/config/theme/responsive.type.d.ts +0 -10
  81. package/config/util/array.type.d.ts +0 -22
  82. package/config/util/currency.type.d.ts +0 -39
  83. package/date-time/picker.d.ts +0 -68
  84. package/date-time/time.d.ts +0 -42
  85. package/decorator/convert.d.ts +0 -31
  86. package/decorator/zone-outside.d.ts +0 -35
  87. package/form/match-control.d.ts +0 -15
  88. package/form/validators.d.ts +0 -62
  89. package/format/currency.service.d.ts +0 -38
  90. package/format/currency.types.d.ts +0 -82
  91. package/format/string.d.ts +0 -41
  92. package/format/validate.d.ts +0 -72
  93. package/math/in-range.d.ts +0 -14
  94. package/math/round.d.ts +0 -33
  95. package/mcache/localStorageUtils.d.ts +0 -19
  96. package/mtypes/authority.type.d.ts +0 -3
  97. package/mtypes/header-menu.type.d.ts +0 -12
  98. package/mtypes/menu.type.d.ts +0 -40
  99. package/mtypes/nav.types.d.ts +0 -29
  100. package/mtypes/page.d.ts +0 -46
  101. package/mtypes/project-info.types.d.ts +0 -22
  102. package/mtypes/response.d.ts +0 -7
  103. package/mtypes/role.type.d.ts +0 -10
  104. package/mtypes/user.types.d.ts +0 -22
  105. package/other/assert.d.ts +0 -36
  106. package/other/deep.d.ts +0 -32
  107. package/other/favicon.d.ts +0 -2
  108. package/other/lazy.service.d.ts +0 -44
  109. package/other/logger.d.ts +0 -4
  110. package/other/path-to-regexp.service.d.ts +0 -26
  111. package/other/resize.d.ts +0 -1
  112. package/pipes/currency/cny.pipe.d.ts +0 -14
  113. package/pipes/currency/mega.pipe.d.ts +0 -15
  114. package/pipes/currency/module.d.ts +0 -9
  115. package/pipes/currency/price.pipe.d.ts +0 -18
  116. package/pipes/filter/filter.pipe.d.ts +0 -12
  117. package/pipes/filter/module.d.ts +0 -7
  118. package/pipes/format/mask.pipe.d.ts +0 -27
  119. package/pipes/format/module.d.ts +0 -7
  120. package/token/page-visibility.d.ts +0 -8
  121. package/token/window.d.ts +0 -7
package/mtypes/index.d.ts CHANGED
@@ -1,9 +1,197 @@
1
- export * from './authority.type';
2
- export * from './menu.type';
3
- export * from './user.types';
4
- export * from './role.type';
5
- export * from './project-info.types';
6
- export * from './header-menu.type';
7
- export * from './nav.types';
8
- export * from './page';
9
- export * from './response';
1
+ interface YunzaiAuthority {
2
+ authority: string;
3
+ }
4
+
5
+ interface YunzaiMenu {
6
+ [key: string]: any;
7
+ appCode: string;
8
+ appIconUrl: string;
9
+ appType: string;
10
+ appUrl: string;
11
+ attribute: string;
12
+ badge: number;
13
+ badge_dot: boolean;
14
+ badge_status: string;
15
+ children: YunzaiMenu[];
16
+ createdDate: string;
17
+ displayIndex: number;
18
+ externalLink: string;
19
+ group: boolean;
20
+ helpUrl: string;
21
+ hide: boolean;
22
+ hideChildren: boolean;
23
+ hideInBreadcrumb: boolean;
24
+ i18n: string;
25
+ icon: string;
26
+ id: string;
27
+ intro: string;
28
+ label: string;
29
+ link: string;
30
+ menuAuths: string[];
31
+ reuse: boolean;
32
+ shortcut: boolean;
33
+ shortcut_root: boolean;
34
+ systemCode: string;
35
+ target: string;
36
+ text: string;
37
+ version: number;
38
+ }
39
+ interface YunzaiMenuAttribute {
40
+ defaultRoute: any;
41
+ dataPlatform: any;
42
+ targetUser: any;
43
+ starConfig: any;
44
+ }
45
+
46
+ interface YunzaiRole {
47
+ id: string;
48
+ onlyDeptOne: boolean;
49
+ onlyOne: boolean;
50
+ roleDesc: string;
51
+ roleName: string;
52
+ roleValue: string;
53
+ status: number;
54
+ thisDepartment: boolean;
55
+ }
56
+
57
+ interface YunzaiUser {
58
+ email: string;
59
+ accountNonExpired: boolean;
60
+ accountNonLocked: boolean;
61
+ authorities: YunzaiAuthority[];
62
+ avatarId: string;
63
+ credentialsNonExpired: boolean;
64
+ deptId: string;
65
+ deptName: string;
66
+ enabled: boolean;
67
+ id: string;
68
+ menu: YunzaiMenu[];
69
+ realname: string;
70
+ roles: YunzaiRole[];
71
+ userCode: string;
72
+ userId: string;
73
+ userType: number;
74
+ username: string;
75
+ }
76
+
77
+ interface YunzaiHeaderStyle {
78
+ label: string;
79
+ value: string;
80
+ }
81
+ interface YunzaiProfile {
82
+ name: string;
83
+ url: string;
84
+ }
85
+ interface YunzaiProjectInfo {
86
+ colorfulLogoUrl: string;
87
+ copyright: string;
88
+ faviconUrl: string;
89
+ gateway: string;
90
+ headerStyle: YunzaiHeaderStyle[];
91
+ maxLogoUrl: string;
92
+ miniLogoUrl: string;
93
+ profileList: YunzaiProfile[];
94
+ projectName: string;
95
+ showAllMenu: boolean;
96
+ tucaoUrl: string;
97
+ pageTitlePattern: string;
98
+ }
99
+
100
+ interface YunzaiNavTopic {
101
+ attribute: any;
102
+ icon: any;
103
+ children: YunzaiNavTopic[];
104
+ intro: string;
105
+ key: string;
106
+ name: string;
107
+ target: string;
108
+ auth: boolean;
109
+ url: string;
110
+ version: string;
111
+ }
112
+
113
+ declare enum NavType {
114
+ APPLICATION = "application",// 应用与服务
115
+ GROUP = "group",// 分组
116
+ TILE = "tiled",// 平铺
117
+ BLANK = "blank",// 空
118
+ TABS = "tabs"
119
+ }
120
+ interface LayoutBasicAside {
121
+ name: string;
122
+ intro: string;
123
+ icon: string;
124
+ }
125
+ interface LayoutBasicDisplay {
126
+ nav: boolean;
127
+ reusetab: boolean;
128
+ aside: boolean;
129
+ }
130
+ interface LayoutNavApplicationState {
131
+ active: boolean;
132
+ type: 'all' | 'mine' | 'other';
133
+ topic?: YunzaiNavTopic;
134
+ topics: YunzaiNavTopic[];
135
+ list: YunzaiNavTopic[];
136
+ search: string | null;
137
+ }
138
+ interface LayoutNavGroupState {
139
+ topics: YunzaiNavTopic[];
140
+ }
141
+
142
+ interface YunzaiPageParam<T> {
143
+ pageNum?: number;
144
+ pageSize?: number;
145
+ pageParam?: T;
146
+ }
147
+ interface Pageable {
148
+ offset: number;
149
+ pageNumber: number;
150
+ pageSize: number;
151
+ paged: boolean;
152
+ sort: PageableSort;
153
+ unpaged: boolean;
154
+ }
155
+ interface PageableSort {
156
+ empty: boolean;
157
+ sorted: boolean;
158
+ unsorted: boolean;
159
+ }
160
+ interface YunzaiPageResult<T> {
161
+ content: T[];
162
+ empty: boolean;
163
+ first: boolean;
164
+ last: boolean;
165
+ number: number;
166
+ numberOfElements: number;
167
+ pageable: Pageable;
168
+ size: number;
169
+ sort: PageableSort;
170
+ totalElements: number;
171
+ totalPages: number;
172
+ }
173
+ declare class YunzaiPageBuilder<T extends any | unknown> {
174
+ private page;
175
+ pageNum(pageNum: number): this;
176
+ pageSize(pageSize: number): this;
177
+ pageParam(param: T): this;
178
+ default(): this;
179
+ build(): YunzaiPageParam<T>;
180
+ }
181
+ declare class Page<T> {
182
+ pageNum: number;
183
+ pageSize: number;
184
+ param?: Partial<T>;
185
+ private constructor();
186
+ static create<T>(): Page<T>;
187
+ }
188
+
189
+ interface YunzaiResponse<T> {
190
+ data: T;
191
+ errorMessage: string;
192
+ message: string;
193
+ }
194
+ type YunzaiPageResponse<T> = YunzaiResponse<YunzaiPageResult<T>>;
195
+
196
+ export { NavType, Page, YunzaiPageBuilder };
197
+ export type { LayoutBasicAside, LayoutBasicDisplay, LayoutNavApplicationState, LayoutNavGroupState, Pageable, PageableSort, YunzaiAuthority, YunzaiHeaderStyle, YunzaiMenu, YunzaiMenuAttribute, YunzaiNavTopic, YunzaiPageParam, YunzaiPageResponse, YunzaiPageResult, YunzaiProfile, YunzaiProjectInfo, YunzaiResponse, YunzaiRole, YunzaiUser };
package/other/index.d.ts CHANGED
@@ -1,7 +1,154 @@
1
- export * from './deep';
2
- export * from './logger';
3
- export * from './lazy.service';
4
- export * from './assert';
5
- export * from './path-to-regexp.service';
6
- export * from './resize';
7
- export * from './favicon';
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from '@angular/core';
3
+
4
+ /**
5
+ * Gets the value at `path` of `object`, like `_.get` in lodash.
6
+ *
7
+ * 类似 `_.get`,根据 `path` 获取安全值
8
+ */
9
+ declare function deepGet(obj: any, path: string | string[] | null | undefined, defaultValue?: unknown): any;
10
+ /**
11
+ * Base on [extend](https://github.com/justmoon/node-extend) deep copy.
12
+ *
13
+ * 基于 [extend](https://github.com/justmoon/node-extend) 的深度拷贝
14
+ *
15
+ * NOTE: Don't a lot of recursion, maybe performance issues
16
+ */
17
+ declare function deepCopy<T extends Record<string, any> = any>(obj: T | null | undefined): T;
18
+ /**
19
+ * Deep merge object.
20
+ *
21
+ * 深度合并对象
22
+ *
23
+ * @param original 原始对象
24
+ * @param arrayProcessMethod 数组处理方式
25
+ * - `true` 表示替换新值,不管新值为哪种类型
26
+ * - `false` 表示会合并整个数组(将旧数据与新数据合并成新数组)
27
+ * @param objects 要合并的对象
28
+ */
29
+ declare function deepMergeKey(original: unknown, arrayProcessMethod: boolean, ...objects: any[]): any;
30
+ /**
31
+ * Deep merge object.
32
+ *
33
+ * 深度合并对象
34
+ */
35
+ declare function deepMerge(original: unknown, ...objects: unknown[]): any;
36
+
37
+ declare const PREFIX = "[@YELON]:";
38
+ declare const warn: (...args: any[]) => void;
39
+ declare const warnDeprecation: (...args: any[]) => any;
40
+ declare const log: (...args: any[]) => void;
41
+
42
+ interface LazyResult {
43
+ path: string;
44
+ status: 'ok' | 'error' | 'loading';
45
+ error?: any;
46
+ }
47
+ interface LazyLoadItem {
48
+ path: string;
49
+ options?: LazyLoadOptions;
50
+ }
51
+ interface LazyLoadOptions {
52
+ innerContent?: string;
53
+ attributes?: Record<string, string>;
54
+ rel?: string;
55
+ }
56
+ /**
57
+ * `LazyService` delay loading JS or CSS files.
58
+ *
59
+ * 延迟加载资源(js 或 css)服务
60
+ */
61
+ declare class LazyService {
62
+ private readonly doc;
63
+ private list;
64
+ private cached;
65
+ private _notify;
66
+ get change(): Observable<LazyResult[]>;
67
+ clear(): void;
68
+ private attachAttributes;
69
+ /**
70
+ * Load script or style files
71
+ */
72
+ load(paths: string | LazyLoadItem | Array<string | LazyLoadItem>): Promise<LazyResult[]>;
73
+ /**
74
+ * Load a script file
75
+ */
76
+ loadScript(path: string, options?: LazyLoadOptions): Promise<LazyResult>;
77
+ /**
78
+ * Load a style file
79
+ */
80
+ loadStyle(path: string, options?: LazyLoadOptions): Promise<LazyResult>;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<LazyService, never>;
82
+ static ɵprov: i0.ɵɵInjectableDeclaration<LazyService>;
83
+ }
84
+
85
+ /**
86
+ * Assert whether the expression and throw an error into console in dev mode
87
+ *
88
+ * 断言表达式是否符合预期,并在开发模式下会在控制台抛出一个错误
89
+ */
90
+ declare function assert(expression: boolean, msg?: string): void;
91
+ /**
92
+ * Assert whether empty (`null` or `undefined`)
93
+ *
94
+ * 断言是否空值(`null` 或 `undefined`)
95
+ */
96
+ declare function assertEmpty(actual: unknown, msg?: string): void;
97
+ /**
98
+ * Assert whether `number` type
99
+ *
100
+ * 断言是否 `number` 类型
101
+ */
102
+ declare function assertNumber(actual: unknown, msg?: string): void;
103
+ /**
104
+ * Assert whether `string` type
105
+ *
106
+ * 断言是否 `string` 类型
107
+ */
108
+ declare function assertString(actual: unknown, msg?: string): void;
109
+ /**
110
+ * Assert whether `array` type
111
+ *
112
+ * 断言是否 `array` 类型
113
+ */
114
+ declare function assertArray(actual: unknown, msg?: string): void;
115
+ /**
116
+ * Assert whether `Observable` type
117
+ *
118
+ * 断言是否 `Observable` 类型
119
+ */
120
+ declare function assertObservable(obj: unknown, msg?: string): void;
121
+
122
+ declare class PathToRegexpService {
123
+ constructor();
124
+ DEFAULT_DELIMITER: string;
125
+ PATH_REGEXP: RegExp;
126
+ parse(str: any, options: any): (string | {
127
+ name: string | number;
128
+ prefix: string;
129
+ delimiter: any;
130
+ optional: boolean;
131
+ repeat: boolean;
132
+ pattern: any;
133
+ })[];
134
+ compile(str: any, options: any): (data: any, options: any) => string;
135
+ tokensToFunction(tokens: any, options: any): (data: any, options: any) => string;
136
+ escapeString(str: any): any;
137
+ escapeGroup(group: any): any;
138
+ flags(options: any): "" | "i";
139
+ regexpToRegexp(path: any, keys: any): any;
140
+ arrayToRegexp(path: any, keys: any, options: any): RegExp;
141
+ stringToRegexp(path: any, keys: any, options: any): RegExp;
142
+ tokensToRegExp(tokens: any, keys: any, options: any): RegExp;
143
+ pathToRegexp(path: any, keys: any, options: any): any;
144
+ static ɵfac: i0.ɵɵFactoryDeclaration<PathToRegexpService, never>;
145
+ static ɵprov: i0.ɵɵInjectableDeclaration<PathToRegexpService>;
146
+ }
147
+
148
+ declare const resizeWindow: () => void;
149
+
150
+ declare function setFavicon(path: string): void;
151
+ declare function hasFavicon(url: string): Promise<boolean>;
152
+
153
+ export { LazyService, PREFIX, PathToRegexpService, assert, assertArray, assertEmpty, assertNumber, assertObservable, assertString, deepCopy, deepGet, deepMerge, deepMergeKey, hasFavicon, log, resizeWindow, setFavicon, warn, warnDeprecation };
154
+ export type { LazyLoadItem, LazyLoadOptions, LazyResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yelon/util",
3
- "version": "19.2.0",
3
+ "version": "20.0.0-beta.0",
4
4
  "author": "yunzai-bot<yunzai-bot@outlook.com>",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,30 +37,30 @@
37
37
  "types": "./array/index.d.ts",
38
38
  "default": "./fesm2022/array.mjs"
39
39
  },
40
- "./browser": {
41
- "types": "./browser/index.d.ts",
42
- "default": "./fesm2022/browser.mjs"
43
- },
44
40
  "./config": {
45
41
  "types": "./config/index.d.ts",
46
42
  "default": "./fesm2022/config.mjs"
47
43
  },
48
- "./date-time": {
49
- "types": "./date-time/index.d.ts",
50
- "default": "./fesm2022/date-time.mjs"
51
- },
52
44
  "./decorator": {
53
45
  "types": "./decorator/index.d.ts",
54
46
  "default": "./fesm2022/decorator.mjs"
55
47
  },
56
- "./format": {
57
- "types": "./format/index.d.ts",
58
- "default": "./fesm2022/format.mjs"
48
+ "./browser": {
49
+ "types": "./browser/index.d.ts",
50
+ "default": "./fesm2022/browser.mjs"
51
+ },
52
+ "./date-time": {
53
+ "types": "./date-time/index.d.ts",
54
+ "default": "./fesm2022/date-time.mjs"
59
55
  },
60
56
  "./form": {
61
57
  "types": "./form/index.d.ts",
62
58
  "default": "./fesm2022/form.mjs"
63
59
  },
60
+ "./format": {
61
+ "types": "./format/index.d.ts",
62
+ "default": "./fesm2022/format.mjs"
63
+ },
64
64
  "./math": {
65
65
  "types": "./math/index.d.ts",
66
66
  "default": "./fesm2022/math.mjs"
@@ -1,4 +1,52 @@
1
- export * from './mega.pipe';
2
- export * from './price.pipe';
3
- export * from './module';
4
- export * from './cny.pipe';
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform } from '@angular/core';
3
+ import { CurrencyMegaOptions, CurrencyFormatOptions, CurrencyCNYOptions } from '@yelon/util/format';
4
+
5
+ /**
6
+ * Large number format filter
7
+ *
8
+ * 大数据格式化
9
+ */
10
+ declare class CurrencyMegaPipe implements PipeTransform {
11
+ private readonly srv;
12
+ private isCN;
13
+ transform(value: number | string, options?: CurrencyMegaOptions): string;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyMegaPipe, never>;
15
+ static ɵpipe: i0.ɵɵPipeDeclaration<CurrencyMegaPipe, "mega", 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
+ declare class CurrencyPricePipe implements PipeTransform {
28
+ private readonly srv;
29
+ transform(value: number | string, options?: CurrencyFormatOptions): string;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyPricePipe, never>;
31
+ static ɵpipe: i0.ɵɵPipeDeclaration<CurrencyPricePipe, "price", true>;
32
+ }
33
+
34
+ /**
35
+ * Converted into RMB notation.
36
+ *
37
+ * 转化成人民币表示法
38
+ */
39
+ declare class CurrencyCNYPipe implements PipeTransform {
40
+ private readonly srv;
41
+ transform(value: number | string, options?: CurrencyCNYOptions): string;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyCNYPipe, never>;
43
+ static ɵpipe: i0.ɵɵPipeDeclaration<CurrencyCNYPipe, "cny", true>;
44
+ }
45
+
46
+ declare class CurrencyPipeModule {
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyPipeModule, never>;
48
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CurrencyPipeModule, never, [typeof CurrencyMegaPipe, typeof CurrencyPricePipe, typeof CurrencyCNYPipe], [typeof CurrencyMegaPipe, typeof CurrencyPricePipe, typeof CurrencyCNYPipe]>;
49
+ static ɵinj: i0.ɵɵInjectorDeclaration<CurrencyPipeModule>;
50
+ }
51
+
52
+ export { CurrencyCNYPipe, CurrencyMegaPipe, CurrencyPipeModule, CurrencyPricePipe };
@@ -1,2 +1,21 @@
1
- export * from './filter.pipe';
2
- export * from './module';
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform } from '@angular/core';
3
+
4
+ /**
5
+ * Filter array
6
+ *
7
+ * 过滤数组
8
+ */
9
+ declare class FilterPipe implements PipeTransform {
10
+ transform<T>(array: readonly T[], matcher: (item: T, ...args: any[]) => boolean, ...args: any[]): T[];
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilterPipe, never>;
12
+ static ɵpipe: i0.ɵɵPipeDeclaration<FilterPipe, "filter", true>;
13
+ }
14
+
15
+ declare class FilterPipeModule {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilterPipeModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FilterPipeModule, never, [typeof FilterPipe], [typeof FilterPipe]>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<FilterPipeModule>;
19
+ }
20
+
21
+ export { FilterPipe, FilterPipeModule };
@@ -1,2 +1,36 @@
1
- export * from './mask.pipe';
2
- export * from './module';
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform } from '@angular/core';
3
+ import { FormatMaskOption } from '@yelon/util/format';
4
+
5
+ /**
6
+ * Format mask
7
+ *
8
+ * 格式化掩码
9
+ *
10
+ * | 字符 | 描述 |
11
+ * | --- | --- |
12
+ * | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |
13
+ * | `9` | 任意数字 |
14
+ * | `#` | 任意字符 |
15
+ * | `U` | 转换大写 |
16
+ * | `L` | 转换小写 |
17
+ * | `*` | 转换为 `*` 字符 |
18
+ *
19
+ * ```ts
20
+ * formatMask('123', '(###)') => (123)
21
+ * formatMask('15900000000', '999****9999') => 159****0000
22
+ * ```
23
+ */
24
+ declare class FormatMaskPipe implements PipeTransform {
25
+ transform(value: string, mask: string | FormatMaskOption): string;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormatMaskPipe, never>;
27
+ static ɵpipe: i0.ɵɵPipeDeclaration<FormatMaskPipe, "mask", true>;
28
+ }
29
+
30
+ declare class FormatPipeModule {
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormatPipeModule, never>;
32
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FormatPipeModule, never, [typeof FormatMaskPipe], [typeof FormatMaskPipe]>;
33
+ static ɵinj: i0.ɵɵInjectorDeclaration<FormatPipeModule>;
34
+ }
35
+
36
+ export { FormatMaskPipe, FormatPipeModule };
package/token/index.d.ts CHANGED
@@ -1,2 +1,18 @@
1
- export * from './window';
2
- export * from './page-visibility';
1
+ import { InjectionToken } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+
4
+ /**
5
+ * Access to global `window` object
6
+ *
7
+ * 访问全局 `window` 对象
8
+ */
9
+ declare const WINDOW: InjectionToken<Window>;
10
+
11
+ /**
12
+ * 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
13
+ *
14
+ * 通过 `visibilitychange` 事件来监听浏览器选项卡是否可见,一般用于当用户离开应用时暂时中断后端持续发送请求时
15
+ */
16
+ declare const PAGE_VISIBILITY: InjectionToken<Observable<boolean>>;
17
+
18
+ export { PAGE_VISIBILITY, WINDOW };
@@ -1,68 +0,0 @@
1
- import type { NzTreeNode } from 'ng-zorro-antd/core/tree';
2
- export interface ArrayServiceTreeToArrOptions<T extends object = any> {
3
- /** 深度项名,默认:`'deep'` */
4
- deepMapName?: string;
5
- /** 扁平后数组的父数据项名,默认:`'parent'` */
6
- parentMapName?: string;
7
- /** 源数据子项名,默认:`'children'` */
8
- childrenMapName?: string;
9
- /** 是否移除 `children` 节点,默认:`true` */
10
- clearChildren?: boolean;
11
- /** 转换成数组结构时回调 */
12
- cb?: (item: T, parent: T | null, deep: number) => void;
13
- }
14
- export interface ArrayServiceArrToTreeOptions<T extends object = any> {
15
- /** 编号项名,默认:`'id'` */
16
- idMapName?: string;
17
- /** 父编号项名,默认:`'parent_id'` */
18
- parentIdMapName?: string;
19
- /**
20
- * 根父编号值,默认会自动计算得到最合适的根父编号值,例如:
21
- *
22
- * @example
23
- * ```ts
24
- * const res = srv.arrToTree([
25
- * { id: 2, parent_id: 'a', title: 'c1' },
26
- * { id: 4, parent_id: 2, title: 't1' },
27
- * ],
28
- * { rootParentValue: 'a' });
29
- * ```
30
- */
31
- rootParentIdValue?: any;
32
- /** 子项名,默认:`'children'` */
33
- childrenMapName?: string;
34
- /** 转换成树数据时回调 */
35
- cb?: (item: T) => void;
36
- }
37
- export interface ArrayServiceArrToTreeNodeOptions<T extends object = any> {
38
- /** 编号项名,默认:`'id'` */
39
- idMapName?: string;
40
- /** 父编号项名,默认:`'parent_id'` */
41
- parentIdMapName?: string;
42
- /** 标题项名,默认:`'title'` */
43
- titleMapName?: string;
44
- /** 设置为叶子节点项名,若数据源不存在时自动根据 `children` 值决定是否为叶子节点,默认:`'isLeaf'` */
45
- isLeafMapName?: string;
46
- /** 节点 Checkbox 是否选中项名,默认:`'checked'` */
47
- checkedMapname?: string;
48
- /** 节点本身是否选中项名,默认:`'selected'` */
49
- selectedMapname?: string;
50
- /** 节点是否展开(叶子节点无效)项名,默认:`'expanded'` */
51
- expandedMapname?: string;
52
- /** 设置是否禁用节点(不可进行任何操作)项名,默认:`'disabled'` */
53
- disabledMapname?: string;
54
- /** 转换成树数据后,执行的递归回调 */
55
- cb?: (item: T, parent: T | null, deep: number) => void;
56
- }
57
- export interface ArrayServiceGetKeysByTreeNodeOptions {
58
- /** 是否包含半选状态的值,默认:`true` */
59
- includeHalfChecked?: boolean;
60
- /** 是否重新指定 `key` 键名,若不指定表示使用 `NzTreeNode.key` 值 */
61
- keyMapName?: string;
62
- /** 回调,返回一个值 `key` 值,优先级高于其他 */
63
- cb?: (item: NzTreeNode, parent: NzTreeNode | null, deep: number) => any;
64
- }
65
- export interface ArrayServiceGroupByResult {
66
- [key: string]: any;
67
- [key: number]: any;
68
- }