@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.
- package/array/index.d.ts +149 -2
- package/browser/index.d.ts +134 -5
- package/config/index.d.ts +1423 -14
- package/date-time/index.d.ts +115 -2
- package/decorator/index.d.ts +37 -2
- package/fesm2022/array.mjs +9 -8
- package/fesm2022/array.mjs.map +1 -1
- package/fesm2022/browser.mjs +7 -6
- package/fesm2022/browser.mjs.map +1 -1
- package/fesm2022/config.mjs +3 -3
- package/fesm2022/config.mjs.map +1 -1
- package/fesm2022/date-time.mjs.map +1 -1
- package/fesm2022/decorator.mjs +1 -66
- package/fesm2022/decorator.mjs.map +1 -1
- package/fesm2022/form.mjs.map +1 -1
- package/fesm2022/format.mjs +8 -7
- package/fesm2022/format.mjs.map +1 -1
- package/fesm2022/math.mjs.map +1 -1
- package/fesm2022/mcache.mjs.map +1 -1
- package/fesm2022/mtypes.mjs.map +1 -1
- package/fesm2022/other.mjs +6 -6
- package/fesm2022/other.mjs.map +1 -1
- package/fesm2022/pipe-currency.mjs +13 -13
- package/fesm2022/pipe-currency.mjs.map +1 -1
- package/fesm2022/pipe-filter.mjs +7 -7
- package/fesm2022/pipe-filter.mjs.map +1 -1
- package/fesm2022/pipe-format.mjs +7 -7
- package/fesm2022/pipe-format.mjs.map +1 -1
- package/fesm2022/token.mjs.map +1 -1
- package/form/index.d.ts +80 -2
- package/format/index.d.ts +239 -4
- package/math/index.d.ts +50 -2
- package/mcache/index.d.ts +21 -1
- package/mtypes/index.d.ts +197 -9
- package/other/index.d.ts +154 -7
- package/package.json +12 -12
- package/pipes/currency/index.d.ts +52 -4
- package/pipes/filter/index.d.ts +21 -2
- package/pipes/format/index.d.ts +36 -2
- package/token/index.d.ts +18 -2
- package/array/array-type.service.d.ts +0 -68
- package/array/array.service.d.ts +0 -78
- package/browser/cookie.service.d.ts +0 -62
- package/browser/copy.d.ts +0 -6
- package/browser/is-empty.d.ts +0 -6
- package/browser/scroll.service.d.ts +0 -34
- package/browser/style.d.ts +0 -19
- package/config/abc/cell.type.d.ts +0 -118
- package/config/abc/date-picker.type.d.ts +0 -49
- package/config/abc/error-collect.type.d.ts +0 -10
- package/config/abc/exception.type.d.ts +0 -7
- package/config/abc/image.type.d.ts +0 -15
- package/config/abc/index.d.ts +0 -17
- package/config/abc/loading.type.d.ts +0 -29
- package/config/abc/lodop.type.d.ts +0 -33
- package/config/abc/media.type.d.ts +0 -10
- package/config/abc/onboarding.type.d.ts +0 -4
- package/config/abc/page-header.type.d.ts +0 -39
- package/config/abc/pdf.type.d.ts +0 -35
- package/config/abc/se.type.d.ts +0 -32
- package/config/abc/sg.type.d.ts +0 -10
- package/config/abc/st.type.d.ts +0 -464
- package/config/abc/sv.type.d.ts +0 -14
- package/config/abc/xlsx.type.d.ts +0 -12
- package/config/abc/zip.type.d.ts +0 -10
- package/config/acl/acl.type.d.ts +0 -31
- package/config/auth/auth.type.d.ts +0 -55
- package/config/bis/bis.type.d.ts +0 -11
- package/config/cache/cache.type.d.ts +0 -66
- package/config/chart/chart.type.d.ts +0 -30
- package/config/config.service.d.ts +0 -14
- package/config/config.types.d.ts +0 -51
- package/config/mock/mock.type.d.ts +0 -14
- package/config/sf/sf.type.d.ts +0 -130
- package/config/socket/socket.type.d.ts +0 -4
- package/config/theme/http.type.d.ts +0 -15
- package/config/theme/i18n.type.d.ts +0 -14
- package/config/theme/index.d.ts +0 -4
- package/config/theme/pipe.type.d.ts +0 -7
- package/config/theme/responsive.type.d.ts +0 -10
- package/config/util/array.type.d.ts +0 -22
- package/config/util/currency.type.d.ts +0 -39
- package/date-time/picker.d.ts +0 -68
- package/date-time/time.d.ts +0 -42
- package/decorator/convert.d.ts +0 -31
- package/decorator/zone-outside.d.ts +0 -35
- package/form/match-control.d.ts +0 -15
- package/form/validators.d.ts +0 -62
- package/format/currency.service.d.ts +0 -38
- package/format/currency.types.d.ts +0 -82
- package/format/string.d.ts +0 -41
- package/format/validate.d.ts +0 -72
- package/math/in-range.d.ts +0 -14
- package/math/round.d.ts +0 -33
- package/mcache/localStorageUtils.d.ts +0 -19
- package/mtypes/authority.type.d.ts +0 -3
- package/mtypes/header-menu.type.d.ts +0 -12
- package/mtypes/menu.type.d.ts +0 -40
- package/mtypes/nav.types.d.ts +0 -29
- package/mtypes/page.d.ts +0 -46
- package/mtypes/project-info.types.d.ts +0 -22
- package/mtypes/response.d.ts +0 -7
- package/mtypes/role.type.d.ts +0 -10
- package/mtypes/user.types.d.ts +0 -22
- package/other/assert.d.ts +0 -36
- package/other/deep.d.ts +0 -32
- package/other/favicon.d.ts +0 -2
- package/other/lazy.service.d.ts +0 -44
- package/other/logger.d.ts +0 -4
- package/other/path-to-regexp.service.d.ts +0 -26
- package/other/resize.d.ts +0 -1
- package/pipes/currency/cny.pipe.d.ts +0 -14
- package/pipes/currency/mega.pipe.d.ts +0 -15
- package/pipes/currency/module.d.ts +0 -9
- package/pipes/currency/price.pipe.d.ts +0 -18
- package/pipes/filter/filter.pipe.d.ts +0 -12
- package/pipes/filter/module.d.ts +0 -7
- package/pipes/format/mask.pipe.d.ts +0 -27
- package/pipes/format/module.d.ts +0 -7
- package/token/page-visibility.d.ts +0 -8
- package/token/window.d.ts +0 -7
@@ -14,10 +14,10 @@ class CurrencyMegaPipe {
|
|
14
14
|
const res = this.srv.mega(value, options);
|
15
15
|
return res.value + (this.isCN ? res.unitI18n : res.unit);
|
16
16
|
}
|
17
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
18
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyMegaPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
18
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: CurrencyMegaPipe, isStandalone: true, name: "mega" });
|
19
19
|
}
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyMegaPipe, decorators: [{
|
21
21
|
type: Pipe,
|
22
22
|
args: [{ name: 'mega' }]
|
23
23
|
}] });
|
@@ -36,10 +36,10 @@ class CurrencyPricePipe {
|
|
36
36
|
transform(value, options) {
|
37
37
|
return this.srv.format(value, options);
|
38
38
|
}
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
40
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPricePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
40
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPricePipe, isStandalone: true, name: "price" });
|
41
41
|
}
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPricePipe, decorators: [{
|
43
43
|
type: Pipe,
|
44
44
|
args: [{ name: 'price' }]
|
45
45
|
}] });
|
@@ -54,21 +54,21 @@ class CurrencyCNYPipe {
|
|
54
54
|
transform(value, options) {
|
55
55
|
return this.srv.cny(value, options);
|
56
56
|
}
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
58
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyCNYPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
58
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: CurrencyCNYPipe, isStandalone: true, name: "cny" });
|
59
59
|
}
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyCNYPipe, decorators: [{
|
61
61
|
type: Pipe,
|
62
62
|
args: [{ name: 'cny' }]
|
63
63
|
}] });
|
64
64
|
|
65
65
|
const PIPES = [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe];
|
66
66
|
class CurrencyPipeModule {
|
67
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
68
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
69
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
68
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPipeModule, imports: [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe], exports: [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe] });
|
69
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPipeModule });
|
70
70
|
}
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CurrencyPipeModule, decorators: [{
|
72
72
|
type: NgModule,
|
73
73
|
args: [{
|
74
74
|
imports: PIPES,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pipe-currency.mjs","sources":["../../../../packages/util/pipes/currency/mega.pipe.ts","../../../../packages/util/pipes/currency/price.pipe.ts","../../../../packages/util/pipes/currency/cny.pipe.ts","../../../../packages/util/pipes/currency/module.ts","../../../../packages/util/pipes/currency/pipe-currency.ts"],"sourcesContent":["import { LOCALE_ID, Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyMegaOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Large number format filter\n *\n * 大数据格式化\n */\n@Pipe({ name: 'mega' })\nexport class CurrencyMegaPipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n private isCN = inject(LOCALE_ID).startsWith('zh');\n\n transform(value: number | string, options?: CurrencyMegaOptions): string {\n const res = this.srv.mega(value, options);\n return res.value + (this.isCN ? res.unitI18n : res.unit);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyFormatOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Format a number with commas as thousands separators\n *\n * 格式化货币,用逗号将数字格式化为千位分隔符\n * ```ts\n * 10000 => `10,000`\n * 10000.567 => `10,000.57`\n * ```\n */\n@Pipe({ name: 'price' })\nexport class CurrencyPricePipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n\n transform(value: number | string, options?: CurrencyFormatOptions): string {\n return this.srv.format(value, options);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyCNYOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Converted into RMB notation.\n *\n * 转化成人民币表示法\n */\n@Pipe({ name: 'cny' })\nexport class CurrencyCNYPipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n\n transform(value: number | string, options?: CurrencyCNYOptions): string {\n return this.srv.cny(value, options);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { CurrencyCNYPipe } from './cny.pipe';\nimport { CurrencyMegaPipe } from './mega.pipe';\nimport { CurrencyPricePipe } from './price.pipe';\n\nconst PIPES = [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe];\n\n@NgModule({\n imports: PIPES,\n exports: PIPES\n})\nexport class CurrencyPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;MAEU,gBAAgB,CAAA;AACV,IAAA,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC;IACtC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;IAEjD,SAAS,CAAC,KAAsB,EAAE,OAA6B,EAAA;AAC7D,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;QACzC,OAAO,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC
|
1
|
+
{"version":3,"file":"pipe-currency.mjs","sources":["../../../../packages/util/pipes/currency/mega.pipe.ts","../../../../packages/util/pipes/currency/price.pipe.ts","../../../../packages/util/pipes/currency/cny.pipe.ts","../../../../packages/util/pipes/currency/module.ts","../../../../packages/util/pipes/currency/pipe-currency.ts"],"sourcesContent":["import { LOCALE_ID, Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyMegaOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Large number format filter\n *\n * 大数据格式化\n */\n@Pipe({ name: 'mega' })\nexport class CurrencyMegaPipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n private isCN = inject(LOCALE_ID).startsWith('zh');\n\n transform(value: number | string, options?: CurrencyMegaOptions): string {\n const res = this.srv.mega(value, options);\n return res.value + (this.isCN ? res.unitI18n : res.unit);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyFormatOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Format a number with commas as thousands separators\n *\n * 格式化货币,用逗号将数字格式化为千位分隔符\n * ```ts\n * 10000 => `10,000`\n * 10000.567 => `10,000.57`\n * ```\n */\n@Pipe({ name: 'price' })\nexport class CurrencyPricePipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n\n transform(value: number | string, options?: CurrencyFormatOptions): string {\n return this.srv.format(value, options);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\n\nimport { CurrencyCNYOptions, CurrencyService } from '@yelon/util/format';\n\n/**\n * Converted into RMB notation.\n *\n * 转化成人民币表示法\n */\n@Pipe({ name: 'cny' })\nexport class CurrencyCNYPipe implements PipeTransform {\n private readonly srv = inject(CurrencyService);\n\n transform(value: number | string, options?: CurrencyCNYOptions): string {\n return this.srv.cny(value, options);\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { CurrencyCNYPipe } from './cny.pipe';\nimport { CurrencyMegaPipe } from './mega.pipe';\nimport { CurrencyPricePipe } from './price.pipe';\n\nconst PIPES = [CurrencyMegaPipe, CurrencyPricePipe, CurrencyCNYPipe];\n\n@NgModule({\n imports: PIPES,\n exports: PIPES\n})\nexport class CurrencyPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;MAEU,gBAAgB,CAAA;AACV,IAAA,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC;IACtC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;IAEjD,SAAS,CAAC,KAAsB,EAAE,OAA6B,EAAA;AAC7D,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;QACzC,OAAO,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC;IAC1D;uGAPW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,IAAI;mBAAC,EAAE,IAAI,EAAE,MAAM,EAAE;;;ACLtB;;;;;;;;AAQG;MAEU,iBAAiB,CAAA;AACX,IAAA,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC;IAE9C,SAAS,CAAC,KAAsB,EAAE,OAA+B,EAAA;QAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;IACxC;uGALW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,IAAI;mBAAC,EAAE,IAAI,EAAE,OAAO,EAAE;;;ACTvB;;;;AAIG;MAEU,eAAe,CAAA;AACT,IAAA,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC;IAE9C,SAAS,CAAC,KAAsB,EAAE,OAA4B,EAAA;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;IACrC;uGALW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,IAAI;mBAAC,EAAE,IAAI,EAAE,KAAK,EAAE;;;ACHrB,MAAM,KAAK,GAAG,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,CAAC;MAMvD,kBAAkB,CAAA;uGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAlB,kBAAkB,EAAA,OAAA,EAAA,CANhB,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,CAAA,EAAA,OAAA,EAAA,CAApD,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,CAAA,EAAA,CAAA;wGAMtD,kBAAkB,EAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACXD;;AAEG;;;;"}
|
package/fesm2022/pipe-filter.mjs
CHANGED
@@ -11,21 +11,21 @@ class FilterPipe {
|
|
11
11
|
transform(array, matcher, ...args) {
|
12
12
|
return array.filter(i => matcher(i, ...args));
|
13
13
|
}
|
14
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
15
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
15
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter", pure: false });
|
16
16
|
}
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterPipe, decorators: [{
|
18
18
|
type: Pipe,
|
19
19
|
args: [{ name: 'filter', pure: false }]
|
20
20
|
}] });
|
21
21
|
|
22
22
|
const PIPES = [FilterPipe];
|
23
23
|
class FilterPipeModule {
|
24
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
25
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
26
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
25
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: FilterPipeModule, imports: [FilterPipe], exports: [FilterPipe] });
|
26
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterPipeModule });
|
27
27
|
}
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterPipeModule, decorators: [{
|
29
29
|
type: NgModule,
|
30
30
|
args: [{
|
31
31
|
imports: PIPES,
|
@@ -1 +1 @@
|
|
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\n/**\n * Filter array\n *\n * 过滤数组\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure\n@Pipe({ name: 'filter', pure: false })\nexport class FilterPipe implements PipeTransform {\n transform<T>(array: readonly T[], matcher: (item: T, ...args: any[]) => boolean, ...args: any[]): 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 imports: PIPES,\n exports: PIPES\n})\nexport class FilterPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;AAIG;AACH;MAEa,UAAU,CAAA;AACrB,IAAA,SAAS,CAAI,KAAmB,EAAE,OAA6C,EAAE,GAAG,IAAW,EAAA;AAC7F,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC
|
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\n/**\n * Filter array\n *\n * 过滤数组\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure\n@Pipe({ name: 'filter', pure: false })\nexport class FilterPipe implements PipeTransform {\n transform<T>(array: readonly T[], matcher: (item: T, ...args: any[]) => boolean, ...args: any[]): 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 imports: PIPES,\n exports: PIPES\n})\nexport class FilterPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;AAIG;AACH;MAEa,UAAU,CAAA;AACrB,IAAA,SAAS,CAAI,KAAmB,EAAE,OAA6C,EAAE,GAAG,IAAW,EAAA;AAC7F,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAC/C;uGAHW,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;;;ACJrC,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC;MAMb,gBAAgB,CAAA;uGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAhB,gBAAgB,EAAA,OAAA,EAAA,CANd,UAAU,CAAA,EAAA,OAAA,EAAA,CAAV,UAAU,CAAA,EAAA,CAAA;wGAMZ,gBAAgB,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
|
package/fesm2022/pipe-format.mjs
CHANGED
@@ -25,21 +25,21 @@ class FormatMaskPipe {
|
|
25
25
|
transform(value, mask) {
|
26
26
|
return formatMask(value, mask);
|
27
27
|
}
|
28
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
29
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormatMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
29
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: FormatMaskPipe, isStandalone: true, name: "mask" });
|
30
30
|
}
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormatMaskPipe, decorators: [{
|
32
32
|
type: Pipe,
|
33
33
|
args: [{ name: 'mask' }]
|
34
34
|
}] });
|
35
35
|
|
36
36
|
const PIPES = [FormatMaskPipe];
|
37
37
|
class FormatPipeModule {
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
39
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
40
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormatPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
39
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: FormatPipeModule, imports: [FormatMaskPipe], exports: [FormatMaskPipe] });
|
40
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormatPipeModule });
|
41
41
|
}
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormatPipeModule, decorators: [{
|
43
43
|
type: NgModule,
|
44
44
|
args: [{
|
45
45
|
imports: PIPES,
|
@@ -1 +1 @@
|
|
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 '@yelon/util/format';\n\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@Pipe({ name: 'mask' })\nexport class FormatMaskPipe implements PipeTransform {\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 imports: PIPES,\n exports: PIPES\n})\nexport class FormatPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;AAkBG;MAEU,cAAc,CAAA;IACzB,SAAS,CAAC,KAAa,EAAE,IAA+B,EAAA;AACtD,QAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC
|
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 '@yelon/util/format';\n\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@Pipe({ name: 'mask' })\nexport class FormatMaskPipe implements PipeTransform {\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 imports: PIPES,\n exports: PIPES\n})\nexport class FormatPipeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;AAkBG;MAEU,cAAc,CAAA;IACzB,SAAS,CAAC,KAAa,EAAE,IAA+B,EAAA;AACtD,QAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;IAChC;uGAHW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,IAAI;mBAAC,EAAE,IAAI,EAAE,MAAM,EAAE;;;ACnBtB,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC;MAMjB,gBAAgB,CAAA;uGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAhB,gBAAgB,EAAA,OAAA,EAAA,CANd,cAAc,CAAA,EAAA,OAAA,EAAA,CAAd,cAAc,CAAA,EAAA,CAAA;wGAMhB,gBAAgB,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
|
package/fesm2022/token.mjs.map
CHANGED
@@ -1 +1 @@
|
|
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;QACxC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC
|
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;QACxC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;QAC5C;AACA,QAAA,OAAO,WAAW;IACpB;AACD,CAAA;;ACZD;;;;AAIG;MACU,eAAe,GAAG,IAAI,cAAc,CAAsB,kBAAkB,EAAE;IACzF,OAAO,EAAE,MAAK;AACZ,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,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;IACH;AACD,CAAA;;ACnBD;;AAEG;;;;"}
|
package/form/index.d.ts
CHANGED
@@ -1,2 +1,80 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* A set of validators for reactive forms
|
5
|
+
*
|
6
|
+
* 一套用于响应式表单的验证器
|
7
|
+
*/
|
8
|
+
declare class _Validators {
|
9
|
+
/**
|
10
|
+
* Wheter is number
|
11
|
+
*
|
12
|
+
* 是否为数字
|
13
|
+
*/
|
14
|
+
static num(control: AbstractControl): ValidationErrors | null;
|
15
|
+
/**
|
16
|
+
* Wheter is integer
|
17
|
+
*
|
18
|
+
* 是否为整数
|
19
|
+
*/
|
20
|
+
static int(control: AbstractControl): ValidationErrors | null;
|
21
|
+
/**
|
22
|
+
* Wheter is decimal
|
23
|
+
*
|
24
|
+
* 是否为小数点数值
|
25
|
+
*/
|
26
|
+
static decimal(control: AbstractControl): ValidationErrors | null;
|
27
|
+
/**
|
28
|
+
* Wheter is People's Republic of China identity card
|
29
|
+
*
|
30
|
+
* 是否为中华人民共和国居民身份证
|
31
|
+
*/
|
32
|
+
static idCard(control: AbstractControl): ValidationErrors | null;
|
33
|
+
/**
|
34
|
+
* Wheter is china mobile (China)
|
35
|
+
*
|
36
|
+
* 是否为手机号(中国)
|
37
|
+
*/
|
38
|
+
static mobile(control: AbstractControl): ValidationErrors | null;
|
39
|
+
/**
|
40
|
+
* Wheter is url address
|
41
|
+
*
|
42
|
+
* 是否URL地址
|
43
|
+
*/
|
44
|
+
static url(control: AbstractControl): ValidationErrors | null;
|
45
|
+
/**
|
46
|
+
* Wheter is IPv4 address (Support v4, v6)
|
47
|
+
*
|
48
|
+
* 是否IP4地址(支持v4、v6)
|
49
|
+
*/
|
50
|
+
static ip(control: AbstractControl): ValidationErrors | null;
|
51
|
+
/**
|
52
|
+
* Wheter is color
|
53
|
+
*
|
54
|
+
* 是否颜色代码值
|
55
|
+
*/
|
56
|
+
static color(control: AbstractControl): ValidationErrors | null;
|
57
|
+
/**
|
58
|
+
* Wheter is chinese
|
59
|
+
*
|
60
|
+
* 是否中文
|
61
|
+
*/
|
62
|
+
static chinese(control: AbstractControl): ValidationErrors | null;
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Match two control values
|
67
|
+
*
|
68
|
+
* 匹配两个控件值
|
69
|
+
* ```ts
|
70
|
+
* this.form = new FormGroup({
|
71
|
+
* pwd: new FormControl(''),
|
72
|
+
* repwd: new FormControl(''),
|
73
|
+
* }, {
|
74
|
+
* validators: MatchControl('pwd', 'repwd'),
|
75
|
+
* });
|
76
|
+
* ```
|
77
|
+
*/
|
78
|
+
declare function MatchControl(controlName: string, matchingControlName: string): ValidatorFn;
|
79
|
+
|
80
|
+
export { MatchControl, _Validators };
|
package/format/index.d.ts
CHANGED
@@ -1,4 +1,239 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* String formatting
|
5
|
+
*
|
6
|
+
* 字符串格式化
|
7
|
+
* ```
|
8
|
+
* format('this is ${name}', { name: 'asdf' })
|
9
|
+
* // output: this is asdf
|
10
|
+
* format('this is ${user.name}', { user: { name: 'asdf' } }, true)
|
11
|
+
* // output: this is asdf
|
12
|
+
* ```
|
13
|
+
*/
|
14
|
+
declare function format(str: string | null | undefined, obj: any | null | undefined, needDeepGet?: boolean): string;
|
15
|
+
interface FormatMaskOption {
|
16
|
+
mask: string;
|
17
|
+
tokens?: Record<string, FormatMaskToken>;
|
18
|
+
}
|
19
|
+
interface FormatMaskToken {
|
20
|
+
pattern: RegExp;
|
21
|
+
default?: any;
|
22
|
+
transform?: (char: string) => string;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* Format mask
|
26
|
+
*
|
27
|
+
* 格式化掩码
|
28
|
+
*
|
29
|
+
* | 字符 | 描述 |
|
30
|
+
* | --- | --- |
|
31
|
+
* | `0` | 任意数字,若该位置字符不符合,则默认为 `0` 填充 |
|
32
|
+
* | `9` | 任意数字 |
|
33
|
+
* | `#` | 任意字符 |
|
34
|
+
* | `U` | 转换大写 |
|
35
|
+
* | `L` | 转换小写 |
|
36
|
+
* | `*` | 转换为 `*` 字符 |
|
37
|
+
*
|
38
|
+
* ```ts
|
39
|
+
* formatMask('123', '(###)') => (123)
|
40
|
+
* formatMask('15900000000', '999****9999') => 159****0000
|
41
|
+
* ```
|
42
|
+
*/
|
43
|
+
declare function formatMask(value: string, option: string | FormatMaskOption): string;
|
44
|
+
|
45
|
+
declare const REGEX_STR: {
|
46
|
+
num: string;
|
47
|
+
idCard: string;
|
48
|
+
mobile: string;
|
49
|
+
url: string;
|
50
|
+
ip: string;
|
51
|
+
color: string;
|
52
|
+
chinese: string;
|
53
|
+
};
|
54
|
+
declare const REGEX: {
|
55
|
+
num: RegExp;
|
56
|
+
idCard: RegExp;
|
57
|
+
mobile: RegExp;
|
58
|
+
url: RegExp;
|
59
|
+
ip: RegExp;
|
60
|
+
color: RegExp;
|
61
|
+
chinese: RegExp;
|
62
|
+
};
|
63
|
+
/**
|
64
|
+
* Wheter is number
|
65
|
+
*
|
66
|
+
* 是否为数字
|
67
|
+
*/
|
68
|
+
declare function isNum(value: string | number): boolean;
|
69
|
+
/**
|
70
|
+
* Wheter is integer
|
71
|
+
*
|
72
|
+
* 是否为整数
|
73
|
+
*/
|
74
|
+
declare function isInt(value: string | number): boolean;
|
75
|
+
/**
|
76
|
+
* Wheter is decimal
|
77
|
+
*
|
78
|
+
* 是否为小数点数值
|
79
|
+
*/
|
80
|
+
declare function isDecimal(value: string | number): boolean;
|
81
|
+
/**
|
82
|
+
* Wheter is People's Republic of China identity card
|
83
|
+
*
|
84
|
+
* 是否为中华人民共和国居民身份证
|
85
|
+
*/
|
86
|
+
declare function isIdCard(value: string): boolean;
|
87
|
+
/**
|
88
|
+
* Wheter is china mobile (China)
|
89
|
+
*
|
90
|
+
* 是否为手机号(中国)
|
91
|
+
*/
|
92
|
+
declare function isMobile(value: string): boolean;
|
93
|
+
/**
|
94
|
+
* Wheter is url address
|
95
|
+
*
|
96
|
+
* 是否URL地址
|
97
|
+
*/
|
98
|
+
declare function isUrl(url: string): boolean;
|
99
|
+
/**
|
100
|
+
* Wheter is IPv4 address (Support v4, v6)
|
101
|
+
*
|
102
|
+
* 是否IP4地址(支持v4、v6)
|
103
|
+
*/
|
104
|
+
declare function isIp(ip: string): boolean;
|
105
|
+
/**
|
106
|
+
* Wheter is color
|
107
|
+
*
|
108
|
+
* 是否颜色代码值
|
109
|
+
*/
|
110
|
+
declare function isColor(color: string): boolean;
|
111
|
+
/**
|
112
|
+
* Wheter is chinese
|
113
|
+
*
|
114
|
+
* 是否中文
|
115
|
+
*/
|
116
|
+
declare function isChinese(value: string): boolean;
|
117
|
+
|
118
|
+
type CurrencyStartingUnit = 'yuan' | 'cent';
|
119
|
+
interface CurrencyStartingUnitOptions {
|
120
|
+
/**
|
121
|
+
* The starting unit of the value, `yuan` means 元, `cent` means 分, default: `yuan`
|
122
|
+
*
|
123
|
+
* 值的起始单位,`yuan` 元,`cent` 分,默认:`yuan`
|
124
|
+
*/
|
125
|
+
startingUnit?: CurrencyStartingUnit;
|
126
|
+
}
|
127
|
+
interface CurrencyFormatOptions extends CurrencyStartingUnitOptions {
|
128
|
+
/**
|
129
|
+
* Using `DEFAULT_CURRENCY_CODE` when value is `true
|
130
|
+
*
|
131
|
+
* 是否使用 `CurrencyPipe` 来替代
|
132
|
+
*/
|
133
|
+
useAngular?: boolean;
|
134
|
+
/**
|
135
|
+
* 精度,默认:`2`
|
136
|
+
*/
|
137
|
+
precision?: number;
|
138
|
+
/**
|
139
|
+
* 是否忽略精度 `.0` 或 `.00` 结尾的字符,默认:`true`
|
140
|
+
*/
|
141
|
+
ignoreZeroPrecision?: boolean;
|
142
|
+
/**
|
143
|
+
* Use anguar `currency` pipe parse when is set, pls refer to [document](https://angular.io/api/common/CurrencyPipe)
|
144
|
+
*
|
145
|
+
* 若指定则表示使用 Angular 自带的 `currency` 管道来解析,见[文档](https://angular.cn/api/common/CurrencyPipe)
|
146
|
+
*/
|
147
|
+
ngCurrency?: {
|
148
|
+
display: 'code' | 'symbol' | 'symbol-narrow';
|
149
|
+
currencyCode?: string;
|
150
|
+
digitsInfo?: string;
|
151
|
+
locale?: string;
|
152
|
+
};
|
153
|
+
}
|
154
|
+
/**
|
155
|
+
* Large number format filter, [Document](https://ng.yunzainfo.com/util/format/en#mega)
|
156
|
+
*
|
157
|
+
* 大数据格式化,[文档](https://ng.yunzainfo.com/util/format/en#mega)
|
158
|
+
*/
|
159
|
+
interface CurrencyMegaOptions extends CurrencyStartingUnitOptions {
|
160
|
+
/**
|
161
|
+
* 精度,默认:`2`
|
162
|
+
*/
|
163
|
+
precision?: number;
|
164
|
+
/**
|
165
|
+
* 单位国际化,默认:`{Q: '京', T: '兆', B: '亿', M: '万', K: '千',}`
|
166
|
+
*/
|
167
|
+
unitI18n?: CurrencyMegaUnitI18n;
|
168
|
+
}
|
169
|
+
interface CurrencyMegaResult {
|
170
|
+
raw: number | string;
|
171
|
+
value: string;
|
172
|
+
unit: string;
|
173
|
+
unitI18n: string;
|
174
|
+
}
|
175
|
+
declare const CurrencyMega_Powers: {
|
176
|
+
unit: string;
|
177
|
+
value: number;
|
178
|
+
}[];
|
179
|
+
interface CurrencyMegaUnitI18n {
|
180
|
+
Q: string;
|
181
|
+
T: string;
|
182
|
+
B: string;
|
183
|
+
M: string;
|
184
|
+
K: string;
|
185
|
+
}
|
186
|
+
interface CurrencyCNYOptions extends CurrencyStartingUnitOptions {
|
187
|
+
/**
|
188
|
+
* Whether to return to uppercase notation, default: `true`
|
189
|
+
*
|
190
|
+
* 是否返回大写表示法,默认:`true`
|
191
|
+
*/
|
192
|
+
inWords?: boolean;
|
193
|
+
/**
|
194
|
+
* Specify negative sign, default: `negative`
|
195
|
+
*
|
196
|
+
* 指定负数符号,默认:`负`
|
197
|
+
*/
|
198
|
+
minusSymbol?: string;
|
199
|
+
}
|
200
|
+
|
201
|
+
declare class CurrencyService {
|
202
|
+
private readonly locale;
|
203
|
+
private readonly defCurrencyCode;
|
204
|
+
private readonly cogSrv;
|
205
|
+
private c;
|
206
|
+
private readonly currencyPipe;
|
207
|
+
constructor();
|
208
|
+
/**
|
209
|
+
* Format a number with commas as thousands separators
|
210
|
+
*
|
211
|
+
* 格式化货币,用逗号将数字格式化为千位分隔符
|
212
|
+
* ```ts
|
213
|
+
* 10000 => `10,000`
|
214
|
+
* 10000.567 => `10,000.57`
|
215
|
+
* ```
|
216
|
+
*/
|
217
|
+
format(value: number | string, options?: CurrencyFormatOptions): string;
|
218
|
+
/**
|
219
|
+
* Large number format filter
|
220
|
+
*
|
221
|
+
* 大数据格式化
|
222
|
+
* ```ts
|
223
|
+
* 1000 => { value: '1', unit: 'K', unitI18n: '千' }
|
224
|
+
* 12456 => { value: '12.46', unit: 'K', unitI18n: '千' }
|
225
|
+
* ```
|
226
|
+
*/
|
227
|
+
mega(value: number | string, options?: CurrencyMegaOptions): CurrencyMegaResult;
|
228
|
+
/**
|
229
|
+
* Converted into RMB notation.
|
230
|
+
*
|
231
|
+
* 转化成人民币表示法
|
232
|
+
*/
|
233
|
+
cny(value: number | string, options?: CurrencyCNYOptions): string;
|
234
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyService, never>;
|
235
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CurrencyService>;
|
236
|
+
}
|
237
|
+
|
238
|
+
export { CurrencyMega_Powers, CurrencyService, REGEX, REGEX_STR, format, formatMask, isChinese, isColor, isDecimal, isIdCard, isInt, isIp, isMobile, isNum, isUrl };
|
239
|
+
export type { CurrencyCNYOptions, CurrencyFormatOptions, CurrencyMegaOptions, CurrencyMegaResult, CurrencyMegaUnitI18n, CurrencyStartingUnit, CurrencyStartingUnitOptions, FormatMaskOption, FormatMaskToken };
|
package/math/index.d.ts
CHANGED
@@ -1,2 +1,50 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* 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.
|
3
|
+
*
|
4
|
+
* 检查 `value` 是否在 `start` 与 `end` 之间,但不包括 `end`。 如果 `end` 没有指定,那么 `start` 设置为 `0`。 如果 `start` 大于 `end`,那么参数会交换以便支持负范围。
|
5
|
+
* ```ts
|
6
|
+
* inRange(3, 2, 4); // true
|
7
|
+
* inRange(4, 8); // true
|
8
|
+
* inRange(4, 2); // false
|
9
|
+
* inRange(2, 2); // false
|
10
|
+
* inRange(1.2, 2); // true
|
11
|
+
* inRange(-3, -2, -6); // true
|
12
|
+
* ```
|
13
|
+
*/
|
14
|
+
declare function inRange(value: number, start: number, end?: number): boolean;
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Computes `number` rounded up to `precision`.
|
18
|
+
*
|
19
|
+
* 根据 `precision`(精度) 向上舍入 `number`。
|
20
|
+
* ```ts
|
21
|
+
* ceil(4.006); // 5
|
22
|
+
* ceil(6.004, 2); // 6.01
|
23
|
+
* ceil(6040, -2); // 6100
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
declare function ceil(number: number, precision?: number): number;
|
27
|
+
/**
|
28
|
+
* Computes `number` rounded down to `precision`.
|
29
|
+
*
|
30
|
+
* 根据 `precision`(精度) 向下舍入 `number`。
|
31
|
+
* ```ts
|
32
|
+
* floor(4.006); // 4
|
33
|
+
* floor(0.046, 2); // 0.04
|
34
|
+
* floor(4060, -2); // 4000
|
35
|
+
* ```
|
36
|
+
*/
|
37
|
+
declare function floor(number: number, precision?: number): number;
|
38
|
+
/**
|
39
|
+
* Computes `number` rounded to `precision`.
|
40
|
+
*
|
41
|
+
* 根据 `precision`(精度) 四舍五入 `number`。
|
42
|
+
* ```ts
|
43
|
+
* round(4.006); // 4
|
44
|
+
* round(4.006, 2); // 4.01
|
45
|
+
* round(4060, -2); // 4100
|
46
|
+
* ```
|
47
|
+
*/
|
48
|
+
declare function round(number: number, precision?: number): number;
|
49
|
+
|
50
|
+
export { ceil, floor, inRange, round };
|
package/mcache/index.d.ts
CHANGED
@@ -1 +1,21 @@
|
|
1
|
-
|
1
|
+
import { YunzaiUser, YunzaiProjectInfo, LayoutBasicAside, NavType, YunzaiNavTopic } from '@yelon/util/mtypes';
|
2
|
+
|
3
|
+
declare const YZ_USER_KEY = "_yz_user";
|
4
|
+
declare const YZ_PROJECT_INFO_KEY = "_yz_project_info";
|
5
|
+
declare const YZ_CURRENT_KEY = "_yz_current";
|
6
|
+
declare const YZ_HEADER_KEY = "_yz_header";
|
7
|
+
declare const YZ_HEADER_TYPE_KEY = "_yz_header_type";
|
8
|
+
declare const YZ_DEFAULT_ROUTE_KEY = "_yz_default_route";
|
9
|
+
declare const YZ_TENANT_KEY = "_yz_tenant";
|
10
|
+
declare const YZ_NEED_AUTH_KEY = "_yz_need_auth";
|
11
|
+
type returnSet<T> = (data: T) => void;
|
12
|
+
type returnGet<T> = () => T | null;
|
13
|
+
declare function useLocalStorageUser(): [returnSet<YunzaiUser>, returnGet<YunzaiUser>];
|
14
|
+
declare function useLocalStorageProjectInfo(): [returnSet<YunzaiProjectInfo>, returnGet<YunzaiProjectInfo>];
|
15
|
+
declare function useLocalStorageCurrent(): [returnSet<LayoutBasicAside>, returnGet<LayoutBasicAside>];
|
16
|
+
declare function useLocalStorageHeaderType(): [returnSet<NavType>, returnGet<NavType>];
|
17
|
+
declare function useLocalStorageHeader(): [returnSet<YunzaiNavTopic[]>, returnGet<YunzaiNavTopic[]>];
|
18
|
+
declare function useLocalStorageDefaultRoute(): [returnSet<string>, returnGet<string>];
|
19
|
+
declare function useLocalStorageTenant(): [returnSet<string>, returnGet<string>];
|
20
|
+
|
21
|
+
export { YZ_CURRENT_KEY, YZ_DEFAULT_ROUTE_KEY, YZ_HEADER_KEY, YZ_HEADER_TYPE_KEY, YZ_NEED_AUTH_KEY, YZ_PROJECT_INFO_KEY, YZ_TENANT_KEY, YZ_USER_KEY, useLocalStorageCurrent, useLocalStorageDefaultRoute, useLocalStorageHeader, useLocalStorageHeaderType, useLocalStorageProjectInfo, useLocalStorageTenant, useLocalStorageUser };
|