@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
@@ -1,14 +0,0 @@
1
- import { YunzaiConfig, YunzaiConfigKey } from './config.types';
2
- import * as i0 from "@angular/core";
3
- export declare class YunzaiConfigService {
4
- private readonly config;
5
- get<T extends YunzaiConfigKey>(componentName: T, key?: string): YunzaiConfig[T];
6
- merge<T extends YunzaiConfigKey>(componentName: T, ...defaultValues: Array<YunzaiConfig[T]>): YunzaiConfig[T];
7
- /**
8
- * 将配置附加到当前实例中,支持 Signal 信号
9
- */
10
- attach<T extends YunzaiConfigKey>(componentThis: unknown, componentName: T, defaultValues: YunzaiConfig[T]): void;
11
- set<T extends YunzaiConfigKey>(componentName: T, value: YunzaiConfig[T]): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<YunzaiConfigService, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<YunzaiConfigService>;
14
- }
@@ -1,51 +0,0 @@
1
- import { EnvironmentProviders, InjectionToken } from '@angular/core';
2
- import { YunzaiCellConfig, YunzaiDateRangePickerConfig, YunzaiErrorCollectConfig, YunzaiExceptionType, YunzaiImageConfig, YunzaiLoadingConfig, YunzaiLodopConfig, YunzaiMediaConfig, YunzaiOnboardingConfig, YunzaiPageHeaderConfig, YunzaiPdfConfig, YunzaiSEConfig, YunzaiSGConfig, YunzaiSTConfig, YunzaiSVConfig, YunzaiXlsxConfig, YunzaiZipConfig } from './abc/index';
3
- import { YunzaiACLConfig } from './acl/acl.type';
4
- import { YunzaiAuthConfig } from './auth/auth.type';
5
- import { YunzaiBusinessConfig } from './bis/bis.type';
6
- import { YunzaiCacheConfig } from './cache/cache.type';
7
- import { YunzaiChartConfig } from './chart/chart.type';
8
- import { YunzaiMockConfig } from './mock/mock.type';
9
- import { YunzaiSFConfig } from './sf/sf.type';
10
- import { YunzaiSocketConfig } from './socket/socket.type';
11
- import { YunzaiThemeHttpClientConfig, YunzaiThemeResponsiveConfig, YunzaiThemeI18nConfig } from './theme/index';
12
- import { YunzaiThemePipeConfig } from './theme/pipe.type';
13
- import { YunzaiUtilArrayConfig } from './util/array.type';
14
- import { YunzaiUtilCurrencyConfig } from './util/currency.type';
15
- export interface YunzaiConfig {
16
- bis?: YunzaiBusinessConfig;
17
- socket?: YunzaiSocketConfig;
18
- dataRange?: YunzaiDateRangePickerConfig;
19
- exception?: YunzaiExceptionType;
20
- errorCollect?: YunzaiErrorCollectConfig;
21
- image?: YunzaiImageConfig;
22
- loading?: YunzaiLoadingConfig;
23
- onboarding?: YunzaiOnboardingConfig;
24
- lodop?: YunzaiLodopConfig;
25
- pageHeader?: YunzaiPageHeaderConfig;
26
- se?: YunzaiSEConfig;
27
- sg?: YunzaiSGConfig;
28
- sv?: YunzaiSVConfig;
29
- st?: YunzaiSTConfig;
30
- sf?: YunzaiSFConfig;
31
- cell?: YunzaiCellConfig;
32
- xlsx?: YunzaiXlsxConfig;
33
- zip?: YunzaiZipConfig;
34
- pdf?: YunzaiPdfConfig;
35
- media?: YunzaiMediaConfig;
36
- acl?: YunzaiACLConfig;
37
- auth?: YunzaiAuthConfig;
38
- cache?: YunzaiCacheConfig;
39
- chart?: YunzaiChartConfig;
40
- mock?: YunzaiMockConfig;
41
- utilArray?: YunzaiUtilArrayConfig;
42
- utilCurrency?: YunzaiUtilCurrencyConfig;
43
- themeHttp?: YunzaiThemeHttpClientConfig;
44
- themeResponsive?: YunzaiThemeResponsiveConfig;
45
- themeI18n?: YunzaiThemeI18nConfig;
46
- themePipe?: YunzaiThemePipeConfig;
47
- }
48
- export type YunzaiConfigKey = keyof YunzaiConfig;
49
- export declare const YUNZAI_CONFIG: InjectionToken<YunzaiConfig>;
50
- export declare function YUNZAI_CONFIG_FACTORY(): YunzaiConfig;
51
- export declare function provideYunzaiConfig(config: YunzaiConfig): EnvironmentProviders;
@@ -1,14 +0,0 @@
1
- export interface YunzaiMockConfig {
2
- /**
3
- * 请求延迟,单位:毫秒,默认:`300`
4
- */
5
- delay?: number;
6
- /**
7
- * 是否强制所有请求都Mock,默认:`false`,`true` 表示当请求的URL不存在时直接返回 404 错误,`false` 表示未命中时发送真实HTTP请求
8
- */
9
- force?: boolean;
10
- /**
11
- * 是否打印 Mock 请求信息,弥补浏览器无Network信息,默认:`true`
12
- */
13
- log?: boolean;
14
- }
@@ -1,130 +0,0 @@
1
- import type { Options as AjvOptions } from 'ajv';
2
- export interface YunzaiSFConfigFormatMap {
3
- 'date-time': {
4
- widget?: string;
5
- showTime?: boolean;
6
- format?: string;
7
- };
8
- date: {
9
- widget?: string;
10
- format?: string;
11
- };
12
- 'full-date': {
13
- widget?: string;
14
- format?: string;
15
- };
16
- time: {
17
- widget?: string;
18
- format?: string;
19
- };
20
- 'full-time': {
21
- widget?: string;
22
- format?: string;
23
- };
24
- week: {
25
- widget?: string;
26
- mode?: string;
27
- format?: string;
28
- };
29
- month: {
30
- widget?: string;
31
- mode?: string;
32
- format?: string;
33
- };
34
- uri: {
35
- widget?: string;
36
- };
37
- email: {
38
- widget?: string;
39
- type?: string;
40
- };
41
- color: {
42
- widget?: string;
43
- type?: string;
44
- };
45
- '': {
46
- widget?: string;
47
- };
48
- }
49
- export interface YunzaiSFConfig {
50
- formatMap?: YunzaiSFConfigFormatMap;
51
- /**
52
- * 是否忽略某些数据类型校验 `ERRORSDEFAULT`,默认:`[ 'type', 'enum' ]`
53
- *
54
- * - `type` 限定 Schema 中 `type` 类型
55
- * - `enum` 限定应当是预设定的枚举值之一
56
- */
57
- ignoreKeywords?: string[];
58
- /**
59
- * [ajv](https://ajv.js.org/options.html) 参数
60
- */
61
- ajv?: AjvOptions;
62
- /**
63
- * 是否实时校验,默认:`true`
64
- * - `true` 每一次都校验
65
- * - `false` 提交时校验
66
- */
67
- liveValidate?: boolean;
68
- /**
69
- * 指定表单 `autocomplete` 值,默认:`on`
70
- */
71
- autocomplete?: 'on' | 'off' | null;
72
- /**
73
- * 是否立即呈现错误视觉,默认:`false`
74
- */
75
- firstVisual?: boolean;
76
- /**
77
- * 是否只展示错误视觉不显示错误文本,默认:`false`
78
- */
79
- onlyVisual?: boolean;
80
- /**
81
- * 自定义通用错误信息,默认:`{}`
82
- */
83
- errors?: Record<string, string>;
84
- /**
85
- * 默认全局布局,类型为:`SFUISchemaItem`,使用时加上可智能提示,例如:
86
- *
87
- * ```ts
88
- * ui: {} as SFUISchemaItem
89
- * ```
90
- */
91
- ui?: any;
92
- /**
93
- * 元素组件大小,用于 `nzSize` 值
94
- */
95
- size?: 'default' | 'large' | 'small';
96
- /**
97
- * 按钮风格,类型为:`SFButton`,使用时加上可智能提示,例如:
98
- *
99
- * ```ts
100
- * button: {} as SFButton
101
- * ```
102
- */
103
- button?: any;
104
- /**
105
- * date小部件:`type="string"` 且不指定 `schema.format` 和 `ui.format` 时日期格式,默认:`yyyy-MM-dd HH:mm:ss`
106
- */
107
- uiDateStringFormat?: string;
108
- /**
109
- * date小部件:`type="number"` 且不指定 `schema.format` 和 `ui.format` 时日期格式,默认:`T` 13位 Unix Timestamp
110
- */
111
- uiDateNumberFormat?: string;
112
- /**
113
- * time小部件:`type="string"` 且不指定 `schema.format` 和 `ui.format` 时日期格式,默认:`HH:mm:ss`
114
- */
115
- uiTimeStringFormat?: string;
116
- /**
117
- * time小部件:`type="number"` 且不指定 `schema.format` 和 `ui.format` 时日期格式,默认:`T` 13位 Unix Timestamp,日期统一使用 `1970-01-01`
118
- */
119
- uiTimeNumberFormat?: string;
120
- /**
121
- * 指定 `format: 'email'` 的默认Email后缀,默认:`['qq.com', '163.com', 'gmail.com', '126.com', 'aliyun.com']`
122
- */
123
- uiEmailSuffixes?: string[];
124
- /**
125
- * Whether to delay rendering, should be manually call `refreshSchema()`
126
- *
127
- * 是否延迟渲染,需要手动调用 `refreshSchema()`
128
- */
129
- delay?: boolean;
130
- }
@@ -1,4 +0,0 @@
1
- import { RxStompConfig } from '@stomp/rx-stomp';
2
- export interface YunzaiSocketConfig extends RxStompConfig {
3
- baseUrl: string;
4
- }
@@ -1,15 +0,0 @@
1
- export interface YunzaiThemeHttpClientConfig {
2
- /**
3
- * 空值处理,默认:`include`
4
- * - include:包含
5
- * - ignore:忽略
6
- */
7
- nullValueHandling?: 'include' | 'ignore';
8
- /**
9
- * 时间值处理,默认:`timestamp`
10
- * - timestamp:时间戳毫秒级
11
- * - timestampSecond:时间戳秒级
12
- * - ignore:忽略处理,保持原始状态
13
- */
14
- dateValueHandling?: 'timestamp' | 'timestampSecond' | 'ignore';
15
- }
@@ -1,14 +0,0 @@
1
- export interface YunzaiThemeI18nConfig {
2
- /**
3
- * Overrides the default interpolation start and end delimiters ({{ and }}).
4
- *
5
- * 改写默认的插值表达式起止分界符({{ 和 }})。
6
- */
7
- interpolation?: [string, string];
8
- /**
9
- * Internationalization code URL guard parameter name, default: `i18n`
10
- *
11
- * 国际化代码 URL 守卫参数名,默认:`i18n`
12
- */
13
- paramNameOfUrlGuard?: string;
14
- }
@@ -1,4 +0,0 @@
1
- export * from './http.type';
2
- export * from './responsive.type';
3
- export * from './i18n.type';
4
- export * from './pipe.type';
@@ -1,7 +0,0 @@
1
- export interface YunzaiThemePipeConfig {
2
- dateFormat?: string;
3
- dateFormatCustom?: YunzaiThemePipeDateFormatCustom;
4
- }
5
- export type YunzaiThemePipeDateFormatCustom = (value: Date, formatString?: string | null, options?: {
6
- locale?: Locale;
7
- }) => string;
@@ -1,10 +0,0 @@
1
- export interface YunzaiThemeResponsiveConfig {
2
- rules: Record<number, {
3
- xs: number;
4
- sm?: number;
5
- md?: number;
6
- lg?: number;
7
- xl?: number;
8
- xxl?: number;
9
- }>;
10
- }
@@ -1,22 +0,0 @@
1
- export interface YunzaiUtilArrayConfig {
2
- /** 深度项名,默认:`'deep'` */
3
- deepMapName?: string;
4
- /** 扁平后数组的父数据项名,默认:`'parent'` */
5
- parentMapName?: string;
6
- /** 编号项名,默认:`'id'` */
7
- idMapName?: string;
8
- /** 父编号项名,默认:`'parent_id'` */
9
- parentIdMapName?: string;
10
- /** 源数据子项名,默认:`'children'` */
11
- childrenMapName?: string;
12
- /** 标题项名,默认:`'title'` */
13
- titleMapName?: string;
14
- /** 节点 Checkbox 是否选中项名,默认:`'checked'` */
15
- checkedMapname?: string;
16
- /** 节点本身是否选中项名,默认:`'selected'` */
17
- selectedMapname?: string;
18
- /** 节点是否展开(叶子节点无效)项名,默认:`'expanded'` */
19
- expandedMapname?: string;
20
- /** 设置是否禁用节点(不可进行任何操作)项名,默认:`'disabled'` */
21
- disabledMapname?: string;
22
- }
@@ -1,39 +0,0 @@
1
- export interface YunzaiUtilCurrencyConfig {
2
- /**
3
- * Starting unit, default: `yuan`
4
- *
5
- * 起始单位,默认:`yuan`
6
- * - `yuan` 人民币:元
7
- * - `cent` 人民币:分
8
- */
9
- startingUnit?: 'yuan' | 'cent';
10
- /**
11
- * 单位国际化,默认:`{Q: '京', T: '兆', B: '亿', M: '万', K: '千',}`
12
- */
13
- megaUnit?: {
14
- Q: string;
15
- T: string;
16
- B: string;
17
- M: string;
18
- K: string;
19
- };
20
- /**
21
- * 精度,默认:`2`
22
- */
23
- precision?: number;
24
- /**
25
- * 是否忽略精度 `.0` 或 `.00` 结尾的字符,默认:`true`
26
- */
27
- ignoreZeroPrecision: boolean;
28
- /**
29
- * Use anguar `currency` pipe parse when is set, pls refer to [document](https://angular.io/api/common/CurrencyPipe)
30
- *
31
- * 若指定则表示使用 Angular 自带的 `currency` 管道来解析,见[文档](https://angular.cn/api/common/CurrencyPipe)
32
- */
33
- ngCurrency?: {
34
- display: 'code' | 'symbol' | 'symbol-narrow';
35
- currencyCode?: string;
36
- digitsInfo?: string;
37
- locale?: string;
38
- };
39
- }
@@ -1,68 +0,0 @@
1
- import type { DisabledDateFn, DisabledTimeFn } from 'ng-zorro-antd/date-picker';
2
- export declare class DateTimePickerUtil {
3
- /**
4
- * Current local time
5
- *
6
- * 当前本地时间
7
- */
8
- get now(): Date;
9
- /**
10
- * Current local date (not including time part)
11
- *
12
- * 当前本地日期(不包含时间部分)
13
- */
14
- get date(): Date;
15
- /**
16
- * Remove the time part of the date
17
- *
18
- * 移除日期的时间部分
19
- */
20
- removeTime(d: Date): Date;
21
- /**
22
- * Format date-time
23
- *
24
- * 格式化日期
25
- */
26
- format(d: number | Date, formatString?: string): string;
27
- private genTick;
28
- /**
29
- * Calculate the number of days between two dates, `0` means the same day
30
- *
31
- * 计算两个日期相差天数,`0` 表示同一天
32
- */
33
- getDiffDays(dateLeft: Date | number, dateRight?: Date | number): number;
34
- /**
35
- * Disabled Before date (Default: today), Generally serves `nzDisabledDate`
36
- *
37
- * 禁用之前日期(默认:今天),一般服务于 `nzDisabledDate`
38
- */
39
- disabledBeforeDate(options?: {
40
- offsetDays?: Date | number;
41
- }): DisabledDateFn;
42
- /**
43
- * Disabled After date (Default: today), Generally serves `nzDisabledDate`
44
- *
45
- * 禁用之后日期(默认:今天),一般服务于 `nzDisabledDate`
46
- */
47
- disabledAfterDate(options?: {
48
- offsetDays?: Date | number;
49
- }): DisabledDateFn;
50
- private baseDisabledTime;
51
- /**
52
- * Disabled Before time (Default: now), Generally serves `nzDisabledTime`
53
- *
54
- * 禁用之前时间(默认:现在),一般服务于 `nzDisabledTime`
55
- */
56
- disabledBeforeTime(options?: {
57
- offsetSeconds?: number;
58
- }): DisabledTimeFn;
59
- /**
60
- * Disabled After time (Default: now), Generally serves `nzDisabledTime`
61
- *
62
- * 禁用之后时间(默认:现在),一般服务于 `nzDisabledTime`
63
- */
64
- disabledAfterTime(options?: {
65
- offsetSeconds?: number;
66
- }): DisabledTimeFn;
67
- }
68
- export declare const dateTimePickerUtil: DateTimePickerUtil;
@@ -1,42 +0,0 @@
1
- import type { YunzaiThemePipeDateFormatCustom } from '@yelon/util/config';
2
- import { DateLocale } from 'ng-zorro-antd/i18n';
3
- /**
4
- * Get the time range, return `[ Date, Date]` for the start and end dates
5
- *
6
- * 获取时间范围
7
- *
8
- * @param type 类型,带 `-` 表示过去一个时间,若指定 `number` 表示天数
9
- * @param time 开始时间
10
- * @param ignoreMaxTime 忽略追加结束日期的最大时间值
11
- */
12
- export declare function getTimeDistance(type: 'today' | '-today' | 'yesterday' | 'week' | '-week' | 'month' | '-month' | 'year' | '-year' | number, time?: Date | string | number, options?: {
13
- ignoreMaxTime?: boolean;
14
- }): [Date, Date];
15
- /**
16
- * fix time is the most, big value
17
- */
18
- export declare function fixEndTimeOfRange(dates: [Date, Date]): [Date, Date];
19
- export interface ToDateOptions {
20
- /** If parsing fails try to parse the date by pressing `formatString` */
21
- formatString?: string;
22
- /** If parsing fails returned default value, default: `new Date(NaN)` */
23
- defaultValue?: any;
24
- timestampSecond?: boolean;
25
- }
26
- /**
27
- * Convert to `Date` format
28
- *
29
- * @param value When is a number, it's treated as a timestamp; If it's seconds, you need to provide the `options.timestampSecond` parameter.
30
- */
31
- export declare function toDate(value?: Date | string | number | null, options?: string | ToDateOptions): Date;
32
- /**
33
- * Format date, supports `Date, number, string` types
34
- *
35
- * @param value When is a number, it is treated as a timestamp (Support seconds and milliseconds timestamp).
36
- * @param formatString Please refer to [date-fnd format](https://date-fns.org/v2.30.0/docs/format) for string format
37
- * @param dateLocale Recommended to be consistent with NG-ZORRO by using `inject(NZ_DATE_LOCALE)`
38
- */
39
- export declare function formatDate(value: Date | string | number, formatString: string, options?: {
40
- locale?: DateLocale;
41
- customFormat?: YunzaiThemePipeDateFormatCustom;
42
- }): string;
@@ -1,31 +0,0 @@
1
- export type BooleanInput = boolean | string | undefined | null;
2
- export type NumberInput = number | string | undefined | null;
3
- export declare function toBoolean(value: unknown, defaultValue?: boolean | null | undefined): boolean | null | undefined;
4
- /**
5
- * @deprecated Recommended to use the built-in `transform` and `static ngAcceptInputType_` can be removed
6
- * - Use `@Input({ transform: booleanAttribute })` instead of `@InputBoolean()`
7
- * - Use `@Input({ transform: (v: unknown) => (v == null ? null : booleanAttribute(v)) })` instead of `@InputBoolean(null)`
8
- *
9
- * Input decorator that handle a prop to do get/set automatically with toBoolean
10
- *
11
- * ```ts
12
- * {AT}Input() {AT}InputBoolean() visible: boolean = false;
13
- * {AT}Input() {AT}InputBoolean(null) visible: boolean = false;
14
- * ```
15
- */
16
- export declare function InputBoolean(defaultValue?: boolean | null): any;
17
- export declare function toNumber(value: unknown): number;
18
- export declare function toNumber<D>(value: unknown, fallback: D): number | D;
19
- /**
20
- * @deprecated Recommended to use the built-in `transform` and `static ngAcceptInputType_` can be removed
21
- * - Use `@Input({ transform: numberAttribute })` instead of `@InputNumber()`
22
- * - Use `@Input({ transform: (v: unknown) => (v == null ? null : numberAttribute(v)) })` instead of `@InputNumber(null)`
23
- *
24
- * Input decorator that handle a prop to do get/set automatically with toNumber
25
- *
26
- * ```ts
27
- * {AT}Input() {AT}InputNumber() visible: number = 1;
28
- * {AT}Input() {AT}InputNumber(null) visible: number = 2;
29
- * ```
30
- */
31
- export declare function InputNumber(defaultValue?: number | null): any;
@@ -1,35 +0,0 @@
1
- export interface ZoneOptions {
2
- ngZoneName?: string;
3
- }
4
- type DecoratorType = (target: unknown, fn: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
- /**
6
- * The decoration method runs in `runOutsideAngular`
7
- *
8
- * 装饰方法运行在 `runOutsideAngular` 内
9
- *
10
- * ```ts
11
- * class MockClass {
12
- * readonly ngZone = inject(NgZone);
13
- *
14
- * {AT}ZoneOutside()
15
- * runOutsideAngular(): void {}
16
- * }
17
- * ```
18
- */
19
- export declare function ZoneOutside(options?: ZoneOptions): DecoratorType;
20
- /**
21
- * The decoration method runs in `run`
22
- *
23
- * 装饰方法运行在 `run` 内
24
- *
25
- * ```ts
26
- * class MockClass {
27
- * readonly ngZone = inject(NgZone);
28
- *
29
- * {AT}ZoneRun()
30
- * run(): void {}
31
- * }
32
- * ```
33
- */
34
- export declare function ZoneRun(options?: ZoneOptions): DecoratorType;
35
- export {};
@@ -1,15 +0,0 @@
1
- import { ValidatorFn } from '@angular/forms';
2
- /**
3
- * Match two control values
4
- *
5
- * 匹配两个控件值
6
- * ```ts
7
- * this.form = new FormGroup({
8
- * pwd: new FormControl(''),
9
- * repwd: new FormControl(''),
10
- * }, {
11
- * validators: MatchControl('pwd', 'repwd'),
12
- * });
13
- * ```
14
- */
15
- export declare function MatchControl(controlName: string, matchingControlName: string): ValidatorFn;
@@ -1,62 +0,0 @@
1
- import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- /**
3
- * A set of validators for reactive forms
4
- *
5
- * 一套用于响应式表单的验证器
6
- */
7
- export declare class _Validators {
8
- /**
9
- * Wheter is number
10
- *
11
- * 是否为数字
12
- */
13
- static num(control: AbstractControl): ValidationErrors | null;
14
- /**
15
- * Wheter is integer
16
- *
17
- * 是否为整数
18
- */
19
- static int(control: AbstractControl): ValidationErrors | null;
20
- /**
21
- * Wheter is decimal
22
- *
23
- * 是否为小数点数值
24
- */
25
- static decimal(control: AbstractControl): ValidationErrors | null;
26
- /**
27
- * Wheter is People's Republic of China identity card
28
- *
29
- * 是否为中华人民共和国居民身份证
30
- */
31
- static idCard(control: AbstractControl): ValidationErrors | null;
32
- /**
33
- * Wheter is china mobile (China)
34
- *
35
- * 是否为手机号(中国)
36
- */
37
- static mobile(control: AbstractControl): ValidationErrors | null;
38
- /**
39
- * Wheter is url address
40
- *
41
- * 是否URL地址
42
- */
43
- static url(control: AbstractControl): ValidationErrors | null;
44
- /**
45
- * Wheter is IPv4 address (Support v4, v6)
46
- *
47
- * 是否IP4地址(支持v4、v6)
48
- */
49
- static ip(control: AbstractControl): ValidationErrors | null;
50
- /**
51
- * Wheter is color
52
- *
53
- * 是否颜色代码值
54
- */
55
- static color(control: AbstractControl): ValidationErrors | null;
56
- /**
57
- * Wheter is chinese
58
- *
59
- * 是否中文
60
- */
61
- static chinese(control: AbstractControl): ValidationErrors | null;
62
- }
@@ -1,38 +0,0 @@
1
- import { YunzaiConfigService } from '@yelon/util/config';
2
- import { CurrencyCNYOptions, CurrencyFormatOptions, CurrencyMegaOptions, CurrencyMegaResult } from './currency.types';
3
- import * as i0 from "@angular/core";
4
- export declare class CurrencyService {
5
- private readonly locale;
6
- private readonly defCurrencyCode;
7
- private c;
8
- private readonly currencyPipe;
9
- constructor(cog: YunzaiConfigService);
10
- /**
11
- * Format a number with commas as thousands separators
12
- *
13
- * 格式化货币,用逗号将数字格式化为千位分隔符
14
- * ```ts
15
- * 10000 => `10,000`
16
- * 10000.567 => `10,000.57`
17
- * ```
18
- */
19
- format(value: number | string, options?: CurrencyFormatOptions): string;
20
- /**
21
- * Large number format filter
22
- *
23
- * 大数据格式化
24
- * ```ts
25
- * 1000 => { value: '1', unit: 'K', unitI18n: '千' }
26
- * 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
27
- * ```
28
- */
29
- mega(value: number | string, options?: CurrencyMegaOptions): CurrencyMegaResult;
30
- /**
31
- * Converted into RMB notation.
32
- *
33
- * 转化成人民币表示法
34
- */
35
- cny(value: number | string, options?: CurrencyCNYOptions): string;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyService, never>;
37
- static ɵprov: i0.ɵɵInjectableDeclaration<CurrencyService>;
38
- }