wlwy-package 4.0.0-beta.11 → 4.0.0-beta.13
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/dist/types/components/form/default/src/checkbox.vue.d.ts +6 -2
- package/dist/types/components/form/default/src/form.vue.d.ts +2 -2
- package/dist/types/components/form/default/src/inputMatch.vue.d.ts +6 -1
- package/dist/types/components/form/default/src/radio.vue.d.ts +6 -2
- package/dist/types/components/form/default/src/select.vue.d.ts +6 -2
- package/dist/types/hooks/business/src/useCountryDict.d.ts +10 -3
- package/dist/types/hooks/business/src/useCurrencyDict.d.ts +10 -3
- package/dist/types/hooks/business/src/useCustomerDict.d.ts +10 -3
- package/dist/types/hooks/business/src/useWarehouseZoneDict.d.ts +10 -3
- package/dist/types/hooks/business/useBusinessDict.d.ts +11 -0
- package/dist/types/hooks/business/useDict.d.ts +25 -20
- package/dist/types/hooks/web/index.d.ts +1 -1
- package/dist/types/hooks/web/src/useDate.d.ts +9 -4
- package/dist/types/hooks/web/src/useEnum.d.ts +6 -2
- package/dist/types/store/modules/dict.d.ts +6 -204
- package/dist/types/type.d.ts +2 -3
- package/dist/wlwy-package.es.js +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { WFormCheckboxProps } from '../type';
|
|
2
|
-
import type { OptionType } from '../../../../type';
|
|
3
2
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormCheckboxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WFormCheckboxProps> & Readonly<{}>, {
|
|
4
3
|
params: any;
|
|
5
4
|
method: string;
|
|
6
|
-
options:
|
|
5
|
+
options: {
|
|
6
|
+
key: import("../../../../type").KeyType;
|
|
7
|
+
value: import("../../../../type").KeyType;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
}[];
|
|
7
11
|
allowClear: boolean;
|
|
8
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
9
13
|
label?: ((props: any) => any) | undefined;
|
|
@@ -6,8 +6,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormProps
|
|
|
6
6
|
$data: {};
|
|
7
7
|
$props: {
|
|
8
8
|
size?: "small" | "middle" | "large" | undefined;
|
|
9
|
-
disabled?: boolean | undefined;
|
|
10
9
|
onSubmit?: ((e: Event) => void) | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
11
|
colon?: boolean | undefined;
|
|
12
12
|
labelCol?: (Partial<import("vue").ExtractPropTypes<{
|
|
13
13
|
span: (NumberConstructor | StringConstructor)[];
|
|
@@ -134,8 +134,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormProps
|
|
|
134
134
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R, args_2: import("@vue/reactivity").OnCleanup) => any : (args_0: any, args_1: any, args_2: import("@vue/reactivity").OnCleanup) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
135
135
|
name?: string | undefined;
|
|
136
136
|
size?: "small" | "middle" | "large" | undefined;
|
|
137
|
-
disabled?: boolean | undefined;
|
|
138
137
|
onSubmit?: ((e: Event) => void) | undefined;
|
|
138
|
+
disabled?: boolean | undefined;
|
|
139
139
|
prefixCls?: string | undefined;
|
|
140
140
|
layout?: string | undefined;
|
|
141
141
|
colon?: boolean | undefined;
|
|
@@ -11,7 +11,12 @@ declare const _default: import("vue").DefineComponent<WInputMatchProps, {}, {},
|
|
|
11
11
|
labelModel: string;
|
|
12
12
|
labelOptions: WDropdownListItem[];
|
|
13
13
|
afterModel: string;
|
|
14
|
-
afterOptions:
|
|
14
|
+
afterOptions: {
|
|
15
|
+
key: import("../../../../type.ts").KeyType;
|
|
16
|
+
value: import("../../../../type.ts").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[];
|
|
15
20
|
numberfs: string[];
|
|
16
21
|
inputfs: string[];
|
|
17
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { WFormRadioProps } from '../type';
|
|
2
|
-
import type { OptionType } from '../../../../type';
|
|
3
2
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormRadioProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WFormRadioProps> & Readonly<{}>, {
|
|
4
3
|
params: any;
|
|
5
4
|
method: string;
|
|
6
|
-
options:
|
|
5
|
+
options: {
|
|
6
|
+
key: import("../../../../type").KeyType;
|
|
7
|
+
value: import("../../../../type").KeyType;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
}[];
|
|
7
11
|
allowClear: boolean;
|
|
8
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
9
13
|
label?: ((props: any) => any) | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { WFormSelectProps } from '../type';
|
|
2
|
-
import type { OptionType } from '../../../../type';
|
|
3
2
|
declare var __VLS_11: number, __VLS_12: any, __VLS_15: "label" | "extra" | "help", __VLS_16: any;
|
|
4
3
|
type __VLS_Slots = {} & {
|
|
5
4
|
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
@@ -9,7 +8,12 @@ type __VLS_Slots = {} & {
|
|
|
9
8
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WFormSelectProps> & Readonly<{}>, {
|
|
10
9
|
params: any;
|
|
11
10
|
method: string;
|
|
12
|
-
options:
|
|
11
|
+
options: {
|
|
12
|
+
key: import("../../../../type").KeyType;
|
|
13
|
+
value: import("../../../../type").KeyType;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
}[];
|
|
13
17
|
allowClear: boolean;
|
|
14
18
|
autoClearSearchValue: boolean;
|
|
15
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { ExtendedSuffix } from '../../../type';
|
|
2
2
|
type IdType = ExtendedSuffix<'country'>;
|
|
3
|
+
/**
|
|
4
|
+
* 内置国家字典。也可通过 {@link useBusinessDict}('country') 使用。
|
|
5
|
+
* @param id 缓存 key,默认 `'country'`;同名字典多份缓存时传 `'country_xxx'`
|
|
6
|
+
*/
|
|
3
7
|
export default function useCountryDict(id?: IdType): {
|
|
4
8
|
dict: {
|
|
5
|
-
[x: string]: any;
|
|
6
9
|
key: import("../../../type").KeyType;
|
|
7
10
|
value: import("../../../type").KeyType;
|
|
8
11
|
label: string;
|
|
9
12
|
disabled?: boolean | undefined;
|
|
10
13
|
}[];
|
|
11
|
-
getDict: () => Promise<
|
|
14
|
+
getDict: (reload?: boolean) => Promise<{
|
|
15
|
+
key: import("../../../type").KeyType;
|
|
16
|
+
value: import("../../../type").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[]>;
|
|
12
20
|
getLabelByCode: (code: string) => string;
|
|
13
21
|
getItemByCode: (code: string) => {
|
|
14
|
-
[x: string]: any;
|
|
15
22
|
key: import("../../../type").KeyType;
|
|
16
23
|
value: import("../../../type").KeyType;
|
|
17
24
|
label: string;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { ExtendedSuffix } from '../../../type';
|
|
2
2
|
type IdType = ExtendedSuffix<'currency'>;
|
|
3
|
+
/**
|
|
4
|
+
* 内置币种字典。也可通过 {@link useBusinessDict}('currency') 使用。
|
|
5
|
+
* @param id 缓存 key,默认 `'currency'`;同名字典多份缓存时传 `'currency_xxx'`
|
|
6
|
+
*/
|
|
3
7
|
export default function useCurrencyDict(id?: IdType): {
|
|
4
8
|
dict: {
|
|
5
|
-
[x: string]: any;
|
|
6
9
|
key: import("../../../type").KeyType;
|
|
7
10
|
value: import("../../../type").KeyType;
|
|
8
11
|
label: string;
|
|
9
12
|
disabled?: boolean | undefined;
|
|
10
13
|
}[];
|
|
11
|
-
getDict: () => Promise<
|
|
14
|
+
getDict: (reload?: boolean) => Promise<{
|
|
15
|
+
key: import("../../../type").KeyType;
|
|
16
|
+
value: import("../../../type").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[]>;
|
|
12
20
|
getLabelByCode: (code: string) => string;
|
|
13
21
|
getItemByCode: (code: string) => {
|
|
14
|
-
[x: string]: any;
|
|
15
22
|
key: import("../../../type").KeyType;
|
|
16
23
|
value: import("../../../type").KeyType;
|
|
17
24
|
label: string;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { ExtendedSuffix } from '../../../type';
|
|
2
2
|
type IdType = ExtendedSuffix<'customer'>;
|
|
3
|
+
/**
|
|
4
|
+
* 内置客户字典。也可通过 {@link useBusinessDict}('customer') 使用。
|
|
5
|
+
* @param id 缓存 key,默认 `'customer'`;同名字典多份缓存时传 `'customer_xxx'`
|
|
6
|
+
*/
|
|
3
7
|
export default function useCustomerDict(id?: IdType): {
|
|
4
8
|
dict: {
|
|
5
|
-
[x: string]: any;
|
|
6
9
|
key: import("../../../type").KeyType;
|
|
7
10
|
value: import("../../../type").KeyType;
|
|
8
11
|
label: string;
|
|
9
12
|
disabled?: boolean | undefined;
|
|
10
13
|
}[];
|
|
11
|
-
getDict: () => Promise<
|
|
14
|
+
getDict: (reload?: boolean) => Promise<{
|
|
15
|
+
key: import("../../../type").KeyType;
|
|
16
|
+
value: import("../../../type").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[]>;
|
|
12
20
|
getLabelByCode: (code: string) => string;
|
|
13
21
|
getItemByCode: (code: string) => {
|
|
14
|
-
[x: string]: any;
|
|
15
22
|
key: import("../../../type").KeyType;
|
|
16
23
|
value: import("../../../type").KeyType;
|
|
17
24
|
label: string;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { ExtendedSuffix } from '../../../type';
|
|
2
2
|
type IdType = ExtendedSuffix<'warehouseZone'>;
|
|
3
|
+
/**
|
|
4
|
+
* 内置库区字典。也可通过 {@link useBusinessDict}('warehouseZone') 使用。
|
|
5
|
+
* @param id 缓存 key,默认 `'warehouseZone'`;同名字典多份缓存时传 `'warehouseZone_xxx'`
|
|
6
|
+
*/
|
|
3
7
|
export default function useWarehouseZoneDict(id?: IdType): {
|
|
4
8
|
dict: {
|
|
5
|
-
[x: string]: any;
|
|
6
9
|
key: import("../../../type").KeyType;
|
|
7
10
|
value: import("../../../type").KeyType;
|
|
8
11
|
label: string;
|
|
9
12
|
disabled?: boolean | undefined;
|
|
10
13
|
}[];
|
|
11
|
-
getDict: () => Promise<
|
|
14
|
+
getDict: (reload?: boolean) => Promise<{
|
|
15
|
+
key: import("../../../type").KeyType;
|
|
16
|
+
value: import("../../../type").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[]>;
|
|
12
20
|
getLabelByCode: (code: string) => string;
|
|
13
21
|
getItemByCode: (code: string) => {
|
|
14
|
-
[x: string]: any;
|
|
15
22
|
key: import("../../../type").KeyType;
|
|
16
23
|
value: import("../../../type").KeyType;
|
|
17
24
|
label: string;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import type { DictBasicNameType } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* 公共组件**内置业务字典**入口。
|
|
4
|
+
*
|
|
5
|
+
* 仅支持 {@link DictBasicNameType}(`warehouseZone` / `country` / `customer` / `currency`),
|
|
6
|
+
* 内部转发至对应的 `useXxxDict`。
|
|
7
|
+
*
|
|
8
|
+
* 业务项目自定义字典请使用 {@link useDict}。
|
|
9
|
+
*
|
|
10
|
+
* @param name 内置字典基础名称
|
|
11
|
+
* @returns 对应内置字典 Hook 的返回值;未找到时返回 `{}`
|
|
12
|
+
*/
|
|
2
13
|
export default function useBusinessDict(name: DictBasicNameType): any;
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import type { ClearDictOption,
|
|
1
|
+
import type { ClearDictOption, OptionType } from '../../type';
|
|
2
|
+
/** 公共组件内置业务字典基础名称(请通过 {@link useBusinessDict} / useXxxDict 使用) */
|
|
2
3
|
export type DictBasicNameType = 'warehouseZone' | 'country' | 'customer' | 'currency';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 字典缓存 key。
|
|
6
|
+
* - 业务自定义字典:可传任意 `string`(建议避免与内置名冲突,或使用 `private_` 前缀)
|
|
7
|
+
* - 内置名及其后缀:会与公共内置字典共用同一缓存
|
|
8
|
+
*/
|
|
9
|
+
export type DictNameType = DictBasicNameType | (string & {});
|
|
10
|
+
/** 字典拉取配置 */
|
|
11
|
+
export type DictOptionType<T = unknown> = {
|
|
12
|
+
/** 远程请求,返回 `{ key, value, label, ... }` 选项列表 */
|
|
13
|
+
request: () => Promise<OptionType<T>[]>;
|
|
6
14
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* 通用字典 Hook,供**业务项目自定义字典**使用:按名称读写缓存、按 code 查 label/item、清除缓存。
|
|
17
|
+
*
|
|
18
|
+
* 公共组件内置字典请使用 {@link useBusinessDict}(或 `useCountryDict` 等具体 Hook)。
|
|
19
|
+
*
|
|
20
|
+
* @param name 字典名称(缓存 key),可传任意 string
|
|
21
|
+
* @param option 拉取配置,需提供 `request`
|
|
22
|
+
* @returns `{ dict, getDict, getLabelByCode, getItemByCode, clearDict }`
|
|
23
|
+
*/
|
|
24
|
+
export default function useDict<T = unknown>(name: DictNameType, option: DictOptionType<T>): {
|
|
25
|
+
dict: OptionType<T>[];
|
|
26
|
+
getDict: (reload?: boolean) => Promise<OptionType<T>[]>;
|
|
16
27
|
getLabelByCode: (code: string) => string;
|
|
17
|
-
getItemByCode: (code: string) =>
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
key: import("../../type").KeyType;
|
|
20
|
-
value: import("../../type").KeyType;
|
|
21
|
-
label: string;
|
|
22
|
-
disabled?: boolean | undefined;
|
|
23
|
-
} | undefined;
|
|
28
|
+
getItemByCode: (code: string) => OptionType<T> | undefined;
|
|
24
29
|
clearDict: (option?: ClearDictOption | boolean) => void;
|
|
25
30
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as useCatchPreloadError } from './src/useCatchPreloadError';
|
|
2
2
|
export { default as useCookie } from './src/useCookie';
|
|
3
|
-
export { default as useDate, type DateInput, type DateRange, type UseDateOptions, type RecentRangeOptions } from './src/useDate';
|
|
3
|
+
export { default as useDate, type DateInput, type DateRange, type UseDateOptions, type RecentRangeOptions, type RangeOffsets, type RecentRangeN, } from './src/useDate';
|
|
4
4
|
export { default as useEnum } from './src/useEnum';
|
|
5
5
|
export { default as useExport } from './src/useExport';
|
|
6
6
|
export * from './src/useI18n';
|
|
@@ -12,7 +12,12 @@ export type RecentRangeOptions = {
|
|
|
12
12
|
includeCurrent?: boolean;
|
|
13
13
|
/** 基准日,默认今天 */
|
|
14
14
|
base?: DateInput;
|
|
15
|
+
/** 方向:forward=正向(往未来)、backward=反向(往过去),默认 backward */
|
|
16
|
+
direction?: 'forward' | 'backward';
|
|
15
17
|
};
|
|
18
|
+
/** 相对 base 的偏移元组 [起点偏移, 终点偏移];配合 direction:backward 时正=往过去,forward 时正=往未来 */
|
|
19
|
+
export type RangeOffsets = readonly [start: number, end: number];
|
|
20
|
+
export type RecentRangeN = number | RangeOffsets;
|
|
16
21
|
export declare const DEFAULT_DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
17
22
|
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
18
23
|
/**
|
|
@@ -31,10 +36,10 @@ export default function useDate(options?: UseDateOptions): {
|
|
|
31
36
|
endOf: (value?: DateInput, unit?: OpUnitType) => Dayjs;
|
|
32
37
|
toTimestamp: (value?: DateInput) => number;
|
|
33
38
|
fromTimestamp: (ms: number) => Dayjs;
|
|
34
|
-
recentRange: (n:
|
|
35
|
-
recentDays: (n:
|
|
36
|
-
recentMonths: (n:
|
|
37
|
-
recentYears: (n:
|
|
39
|
+
recentRange: (n: RecentRangeN, unit?: ManipulateType, opts?: RecentRangeOptions) => DateRange;
|
|
40
|
+
recentDays: (n: RecentRangeN, opts?: RecentRangeOptions) => DateRange;
|
|
41
|
+
recentMonths: (n: RecentRangeN, opts?: RecentRangeOptions) => DateRange;
|
|
42
|
+
recentYears: (n: RecentRangeN, opts?: RecentRangeOptions) => DateRange;
|
|
38
43
|
presets: {
|
|
39
44
|
last3Days: () => DateRange;
|
|
40
45
|
last7Days: () => DateRange;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { OptionType } from '../../../type';
|
|
2
1
|
type CommonType = {
|
|
3
2
|
[key: string]: {
|
|
4
3
|
[key: string]: string;
|
|
@@ -12,7 +11,12 @@ export declare const COMMON: {};
|
|
|
12
11
|
export declare const OPTION: {};
|
|
13
12
|
export default function useEnum<T extends CommonType, K>(options: EnumType<T, K>): {
|
|
14
13
|
enums: T;
|
|
15
|
-
enumMap: Map<keyof T,
|
|
14
|
+
enumMap: Map<keyof T, {
|
|
15
|
+
key: import("../../../type").KeyType;
|
|
16
|
+
value: import("../../../type").KeyType;
|
|
17
|
+
label: string;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
}[]>;
|
|
16
20
|
getEnum: <T_1 extends keyof T, K_1 extends keyof T[T_1]>(name: T_1, keyTypeTransform?: "number" | "boolean" | "boolean2number" | "original") => {
|
|
17
21
|
key: keyof T[T_1];
|
|
18
22
|
value: keyof T[T_1];
|