@yibozhang/pro-table 16.1.15 → 16.1.16
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/esm2022/lib/plate-input/plate-input.component.mjs +32 -9
- package/esm2022/lib/plate-input/plate-prefix-default-load.service.mjs +22 -0
- package/esm2022/lib/plate-input/utils.mjs +21 -0
- package/esm2022/lib/tokens.mjs +2 -1
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/yibozhang-pro-table.mjs +70 -8
- package/fesm2022/yibozhang-pro-table.mjs.map +1 -1
- package/lib/plate-input/plate-input.component.d.ts +6 -3
- package/lib/plate-input/plate-prefix-default-load.service.d.ts +11 -0
- package/lib/plate-input/utils.d.ts +9 -0
- package/lib/tokens.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { OnInit, OnDestroy, ChangeDetectorRef, ElementRef } from "@angular/core";
|
|
2
2
|
import { ControlValueAccessor } from "@angular/forms";
|
|
3
|
-
import { PlatePrefixLoadService, PlatePrefixOption } from "../tokens";
|
|
3
|
+
import { PlatePrefixLoadService, PlatePrefixOption, PlatePrefixDefaultLoadService } from "../tokens";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class PlateInputComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
6
6
|
private cdr;
|
|
7
7
|
private elementRef;
|
|
8
8
|
private platePrefixLoadService?;
|
|
9
|
+
private platePrefixDefaultLoadService?;
|
|
9
10
|
nzPopoverVisible: boolean;
|
|
10
11
|
platePrefix: string;
|
|
11
12
|
plateSuffix: string;
|
|
12
13
|
platePrefixOptions: Array<PlatePrefixOption>;
|
|
13
14
|
disabled: boolean;
|
|
15
|
+
private defaultPrefix;
|
|
14
16
|
private onChange;
|
|
15
17
|
private onTouched;
|
|
16
18
|
private clickOutsideHandler?;
|
|
17
|
-
constructor(cdr: ChangeDetectorRef, elementRef: ElementRef, platePrefixLoadService?: PlatePrefixLoadService);
|
|
19
|
+
constructor(cdr: ChangeDetectorRef, elementRef: ElementRef, platePrefixLoadService?: PlatePrefixLoadService, platePrefixDefaultLoadService?: PlatePrefixDefaultLoadService);
|
|
18
20
|
ngOnInit(): void;
|
|
19
21
|
handlePlatePrefix(value: string): void;
|
|
20
22
|
writeValue(value: string): void;
|
|
@@ -25,9 +27,10 @@ export declare class PlateInputComponent implements OnInit, OnDestroy, ControlVa
|
|
|
25
27
|
private attachClickOutsideListener;
|
|
26
28
|
private removeClickOutsideListener;
|
|
27
29
|
ngOnDestroy(): void;
|
|
30
|
+
private applyDefaultPrefixIfEmpty;
|
|
28
31
|
private emitValue;
|
|
29
32
|
onBlur(): void;
|
|
30
33
|
handleAntdPlateSuffixBlur(event: any): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PlateInputComponent, [null, null, { optional: true; }]>;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PlateInputComponent, [null, null, { optional: true; }, { optional: true; }]>;
|
|
32
35
|
static ɵcmp: i0.ɵɵComponentDeclaration<PlateInputComponent, "app-plate-input", never, {}, {}, never, never, false, never>;
|
|
33
36
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
|
2
|
+
import { PlatePrefixDefaultLoadService } from "../tokens";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DefaultPlatePrefixDefaultLoadService implements PlatePrefixDefaultLoadService {
|
|
5
|
+
private http;
|
|
6
|
+
private readonly defaultApiUrl;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
loadDefaultPrefix(): Promise<string>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultPlatePrefixDefaultLoadService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultPlatePrefixDefaultLoadService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检测并分割车牌号
|
|
3
|
+
* @param plateNumber 车牌号字符串
|
|
4
|
+
* @returns 返回数组,第一个元素是中文字符(如果存在),第二个元素是剩余部分
|
|
5
|
+
* @example
|
|
6
|
+
* splitPlateNumber('京12345') // ['京', '12345']
|
|
7
|
+
* splitPlateNumber('12345') // ['', '12345']
|
|
8
|
+
*/
|
|
9
|
+
export declare function splitPlateNumber(plateNumber: string): [string, string];
|
package/lib/tokens.d.ts
CHANGED
|
@@ -33,3 +33,7 @@ export interface PlatePrefixLoadService {
|
|
|
33
33
|
loadPrefixOptions(): Promise<PlatePrefixOption[]>;
|
|
34
34
|
}
|
|
35
35
|
export declare const PLATE_PREFIX_LOAD_SERVICE: InjectionToken<PlatePrefixLoadService>;
|
|
36
|
+
export interface PlatePrefixDefaultLoadService {
|
|
37
|
+
loadDefaultPrefix(): Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
export declare const PLATE_PREFIX_DEFAULT_LOAD_SERVICE: InjectionToken<PlatePrefixDefaultLoadService>;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./lib/constants";
|
|
|
4
4
|
export * from "./lib/type";
|
|
5
5
|
export * from "./lib/tokens";
|
|
6
6
|
export * from "./lib/plate-input/plate-prefix-load.service";
|
|
7
|
+
export * from "./lib/plate-input/plate-prefix-default-load.service";
|
|
7
8
|
export * from "./lib/plate-input/plate-input.component";
|
|
8
9
|
export * from "./lib/plate-input/plate-input.module";
|
|
9
10
|
export * from "./lib/page-container/page-container.component";
|