@yeepay/yee-boss-ui 0.1.20 → 0.1.21
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/README.md +94 -67
- package/dist/YeeGrid-C5jcjTuQ.js +629 -0
- package/dist/components/{form → grid}/form-api.d.ts +8 -4
- package/dist/components/grid/form-component-map.d.ts +9 -0
- package/dist/components/{form/types.d.ts → grid/form-types.d.ts} +45 -42
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/types.d.ts +12 -10
- package/dist/components/grid/use-yee-grid.d.ts +2 -2
- package/dist/components/grid/yee-grid-api.d.ts +4 -3
- package/dist/grid.js +2 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +42 -47
- package/dist/resolver.d.ts +25 -0
- package/dist/resolver.js +22 -0
- package/dist/style.css +1 -5
- package/dist/use-yee-grid-idCNjiBi.js +141 -0
- package/package.json +15 -26
- package/dist/YeeForm-COND7XQj.js +0 -160
- package/dist/YeeGrid-CF-0OZUj.js +0 -395
- package/dist/components/form/YeeForm.vue.d.ts +0 -14
- package/dist/components/form/component-map.d.ts +0 -9
- package/dist/components/form/index.d.ts +0 -3
- package/dist/components/grid/YeeGrid.vue.d.ts +0 -28
- package/dist/components/select/YeeSelect.vue.d.ts +0 -32
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/types.d.ts +0 -120
- package/dist/form-api-0148j8ew.js +0 -44
- package/dist/form.d.ts +0 -1
- package/dist/form.js +0 -6
- package/dist/index-DvY7PmUA.js +0 -132
- package/dist/select.d.ts +0 -1
- package/dist/select.js +0 -4
- package/dist/use-yee-grid-ClKZU8CY.js +0 -85
|
@@ -3,7 +3,7 @@ import { RangePickerProps } from 'ant-design-vue/es/date-picker';
|
|
|
3
3
|
import { VNodeChild } from 'vue';
|
|
4
4
|
import { YeeFileUploadProps } from '../file-upload/types';
|
|
5
5
|
/** Input.Password 在 Ant Design Vue 的 InputProps 之外提供的属性。 */
|
|
6
|
-
interface
|
|
6
|
+
interface YeeGridFormInputPasswordProps extends InputProps {
|
|
7
7
|
/** 点击图标时触发的默认动作。 */
|
|
8
8
|
action?: string;
|
|
9
9
|
/** 自定义密码显隐图标。 */
|
|
@@ -15,8 +15,8 @@ interface YeeFormInputPasswordProps extends InputProps {
|
|
|
15
15
|
/** 密码可见状态变化事件。 */
|
|
16
16
|
'onUpdate:visible'?: (visible: boolean) => void;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
export interface
|
|
18
|
+
/** YeeGrid 查询表单当前支持的组件及其原生属性。 */
|
|
19
|
+
export interface YeeGridFormComponentPropsMap {
|
|
20
20
|
AutoComplete: AutoCompleteProps;
|
|
21
21
|
Cascader: CascaderProps;
|
|
22
22
|
Checkbox: CheckboxProps;
|
|
@@ -25,7 +25,7 @@ export interface YeeFormComponentPropsMap {
|
|
|
25
25
|
DatePicker: DatePickerProps;
|
|
26
26
|
Input: InputProps;
|
|
27
27
|
InputNumber: InputNumberProps;
|
|
28
|
-
InputPassword:
|
|
28
|
+
InputPassword: YeeGridFormInputPasswordProps;
|
|
29
29
|
Mentions: MentionsProps;
|
|
30
30
|
Radio: RadioProps;
|
|
31
31
|
RadioGroup: RadioGroupProps;
|
|
@@ -41,56 +41,66 @@ export interface YeeFormComponentPropsMap {
|
|
|
41
41
|
TreeSelect: TreeSelectProps;
|
|
42
42
|
Upload: YeeFileUploadProps;
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
export type
|
|
46
|
-
/**
|
|
47
|
-
export type
|
|
48
|
-
/**
|
|
49
|
-
export type
|
|
50
|
-
|
|
44
|
+
/** YeeGrid 查询表单当前支持的 Schema 组件名。 */
|
|
45
|
+
export type YeeGridFormComponent = keyof YeeGridFormComponentPropsMap;
|
|
46
|
+
/** YeeGrid 查询表单内置渲染的组件名;Custom 由 `form-${fieldName}` 插槽渲染。 */
|
|
47
|
+
export type YeeGridFormBuiltInComponent = Exclude<YeeGridFormComponent, 'Custom'>;
|
|
48
|
+
/** YeeGrid 查询表单默认的字段值结构;建议业务侧传入更具体的泛型。 */
|
|
49
|
+
export type YeeGridFormValues = Record<string, unknown>;
|
|
50
|
+
/** 查询字段在当前响应式网格中占用的列数。 */
|
|
51
|
+
export type YeeGridFormFieldSpan = 1 | 2 | 3;
|
|
52
|
+
interface YeeGridFormSchemaBase<TValues extends object = YeeGridFormValues> {
|
|
51
53
|
/** 字段名,只允许使用 TValues 中已声明的键。 */
|
|
52
54
|
fieldName: keyof TValues & string;
|
|
53
55
|
/** 是否隐藏当前字段。 */
|
|
54
56
|
hide?: boolean;
|
|
55
57
|
/** 字段标题。 */
|
|
56
58
|
label: string;
|
|
59
|
+
/** 是否要求当前字段有值。 */
|
|
60
|
+
required?: boolean;
|
|
61
|
+
/** 字段横跨的网格列数,默认占 1 列;超出当前响应式列数时自动收窄。 */
|
|
62
|
+
span?: YeeGridFormFieldSpan;
|
|
57
63
|
}
|
|
58
64
|
/** 单个 Schema 字段;componentProps 会根据 component 自动提示。 */
|
|
59
|
-
export type
|
|
60
|
-
[TComponent in
|
|
65
|
+
export type YeeGridFormSchema<TValues extends object = YeeGridFormValues> = {
|
|
66
|
+
[TComponent in YeeGridFormComponent]: YeeGridFormSchemaBase<TValues> & {
|
|
61
67
|
/** 渲染使用的表单组件。 */
|
|
62
68
|
component: TComponent;
|
|
63
69
|
/** 对应 Ant Design Vue 组件的原生属性。 */
|
|
64
|
-
componentProps?:
|
|
70
|
+
componentProps?: YeeGridFormComponentPropsMap[TComponent];
|
|
65
71
|
};
|
|
66
|
-
}[
|
|
67
|
-
interface
|
|
72
|
+
}[YeeGridFormComponent];
|
|
73
|
+
interface YeeGridFormSchemaUpdateBase<TValues extends object = YeeGridFormValues> {
|
|
68
74
|
/** 需要更新的字段名。 */
|
|
69
75
|
fieldName: keyof TValues & string;
|
|
70
76
|
/** 是否隐藏当前字段。 */
|
|
71
77
|
hide?: boolean;
|
|
72
78
|
/** 新的字段标题。 */
|
|
73
79
|
label?: string;
|
|
80
|
+
/** 是否要求当前字段有值。 */
|
|
81
|
+
required?: boolean;
|
|
82
|
+
/** 新的网格列数,默认占 1 列;超出当前响应式列数时自动收窄。 */
|
|
83
|
+
span?: YeeGridFormFieldSpan;
|
|
74
84
|
}
|
|
75
85
|
/**
|
|
76
86
|
* 动态更新 Schema 时使用的字段配置。
|
|
77
87
|
* 传入 component 时,componentProps 会自动收窄为对应组件的原生属性。
|
|
78
88
|
*/
|
|
79
|
-
export type
|
|
89
|
+
export type YeeGridFormSchemaUpdate<TValues extends object = YeeGridFormValues> = YeeGridFormSchemaUpdateBase<TValues> & {
|
|
80
90
|
/** 不切换组件,只更新当前组件属性。 */
|
|
81
91
|
component?: never;
|
|
82
92
|
/** 当前组件的属性;组件类型由已有 Schema 决定。 */
|
|
83
|
-
componentProps?:
|
|
93
|
+
componentProps?: YeeGridFormComponentPropsMap[YeeGridFormComponent];
|
|
84
94
|
} | {
|
|
85
|
-
[TComponent in
|
|
95
|
+
[TComponent in YeeGridFormComponent]: YeeGridFormSchemaUpdateBase<TValues> & {
|
|
86
96
|
/** 需要切换到的表单组件。 */
|
|
87
97
|
component: TComponent;
|
|
88
98
|
/** 对应组件的原生属性。 */
|
|
89
|
-
componentProps?:
|
|
99
|
+
componentProps?: YeeGridFormComponentPropsMap[TComponent];
|
|
90
100
|
};
|
|
91
|
-
}[
|
|
92
|
-
/**
|
|
93
|
-
export interface
|
|
101
|
+
}[YeeGridFormComponent];
|
|
102
|
+
/** YeeGrid 查询表单的运行配置。 */
|
|
103
|
+
export interface YeeGridFormOptions<TValues extends object = YeeGridFormValues> {
|
|
94
104
|
/** 初始是否折叠。 */
|
|
95
105
|
collapsed?: boolean;
|
|
96
106
|
/** 折叠状态下展示的行数。 */
|
|
@@ -99,8 +109,12 @@ export interface YeeFormOptions<TValues extends object = YeeFormValues> {
|
|
|
99
109
|
handleCollapsedChange?: (collapsed: boolean) => void;
|
|
100
110
|
/** 表单初始值。 */
|
|
101
111
|
initialValues?: Partial<TValues>;
|
|
112
|
+
/** 表单项布局;horizontal 为标签和值同行,vertical 为上下排列。 */
|
|
113
|
+
layout?: 'horizontal' | 'vertical';
|
|
114
|
+
/** 水平布局时标签的宽度;未设置或传入 auto 时按标签内容自适应。 */
|
|
115
|
+
labelWidth?: number | 'auto';
|
|
102
116
|
/** 表单字段 Schema。 */
|
|
103
|
-
schema: readonly
|
|
117
|
+
schema: readonly YeeGridFormSchema<TValues>[];
|
|
104
118
|
/** 是否显示展开/收起按钮。 */
|
|
105
119
|
showCollapseButton?: boolean;
|
|
106
120
|
/** 字段变化后是否立即查询。 */
|
|
@@ -108,30 +122,19 @@ export interface YeeFormOptions<TValues extends object = YeeFormValues> {
|
|
|
108
122
|
/** 是否允许按 Enter 查询。 */
|
|
109
123
|
submitOnEnter?: boolean;
|
|
110
124
|
}
|
|
111
|
-
/**
|
|
112
|
-
export interface
|
|
113
|
-
/** 管理字段值和 Schema 的表单 API。 */
|
|
114
|
-
api: import('./form-api').YeeFormApi<TValues>;
|
|
115
|
-
/** 点击重置后的回调。 */
|
|
116
|
-
onReset?: () => Promise<void> | void;
|
|
117
|
-
/** 点击查询后的回调。 */
|
|
118
|
-
onSubmit?: (values: TValues) => Promise<void> | void;
|
|
119
|
-
/** 表单运行配置。 */
|
|
120
|
-
options: YeeFormOptions<TValues>;
|
|
121
|
-
}
|
|
122
|
-
/** YeeForm 字段插槽接收的参数。 */
|
|
123
|
-
export interface YeeFormSlotProps<TValues extends object = YeeFormValues, TFieldName extends keyof TValues & string = keyof TValues & string> {
|
|
125
|
+
/** YeeGrid 查询字段插槽接收的参数。 */
|
|
126
|
+
export interface YeeGridFormSlotProps<TValues extends object = YeeGridFormValues, TFieldName extends keyof TValues & string = keyof TValues & string> {
|
|
124
127
|
/** 当前字段的 Schema。 */
|
|
125
|
-
field:
|
|
126
|
-
/**
|
|
128
|
+
field: YeeGridFormSchema<TValues>;
|
|
129
|
+
/** 将当前字段写回查询表单 API。 */
|
|
127
130
|
setValue: (value: TValues[TFieldName]) => void;
|
|
128
131
|
/** 当前字段值。 */
|
|
129
132
|
value: TValues[TFieldName] | undefined;
|
|
130
133
|
/** 当前表单全部字段值的浅拷贝。 */
|
|
131
134
|
values: TValues;
|
|
132
135
|
}
|
|
133
|
-
/**
|
|
134
|
-
export type
|
|
135
|
-
[TFieldName in keyof TValues & string]?: (props:
|
|
136
|
+
/** YeeGrid 查询表单的字段作用域插槽,插槽名为 `form-${fieldName}`。 */
|
|
137
|
+
export type YeeGridFormSlots<TValues extends object = YeeGridFormValues> = {
|
|
138
|
+
[TFieldName in keyof TValues & string as `form-${TFieldName}`]?: (props: YeeGridFormSlotProps<TValues, TFieldName>) => unknown;
|
|
136
139
|
};
|
|
137
140
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { YeeGridApi } from './yee-grid-api';
|
|
2
2
|
export { useYeeGrid } from './use-yee-grid';
|
|
3
|
+
export { YeeGridFormApi } from './form-api';
|
|
3
4
|
export type { YeeGridComponent, YeeGridPage, YeeGridQuery, YeeGridQueryParams, YeeGridToolbarConfig, YeeGridOptions, YeeGridRuntimeProps, YeeGridSlots, UseYeeGridOptions, } from './types';
|
|
5
|
+
export type { YeeGridFormBuiltInComponent, YeeGridFormComponent, YeeGridFormComponentPropsMap, YeeGridFormFieldSpan, YeeGridFormOptions, YeeGridFormSchema, YeeGridFormSchemaUpdate, YeeGridFormSlotProps, YeeGridFormSlots, YeeGridFormValues, } from './form-types';
|
|
4
6
|
export type { VxeGridDefines, VxeGridListeners, VxeGridPropTypes, VxeGridSlotTypes, VxeTableDefines, } from 'vxe-table';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeGridSlots, VxeGridInstance, VxeGridListeners, VxeGridProps as NativeVxeGridProps, VxeGridSlotTypes } from 'vxe-table';
|
|
2
2
|
import { DefineComponent, VNodeChild } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { YeeGridFormOptions, YeeGridFormSlotProps, YeeGridFormValues } from './form-types';
|
|
4
4
|
import { YeeGridApi } from './yee-grid-api';
|
|
5
5
|
type NativeProxyConfig<T> = NonNullable<NativeVxeGridProps<T>['proxyConfig']>;
|
|
6
6
|
type NativeProxyAjax<T> = NonNullable<NativeProxyConfig<T>['ajax']>;
|
|
@@ -15,7 +15,7 @@ export interface YeeGridPage<T> {
|
|
|
15
15
|
total: number;
|
|
16
16
|
}
|
|
17
17
|
/** YeeGrid 代理查询函数。 */
|
|
18
|
-
export type YeeGridQuery<T, TFormValues extends object =
|
|
18
|
+
export type YeeGridQuery<T, TFormValues extends object = YeeGridFormValues> = (params: YeeGridQueryParams<T>, formValues: TFormValues) => Promise<YeeGridPage<T>>;
|
|
19
19
|
type YeeGridProxyAjax<T, TFormValues extends object> = Omit<NativeProxyAjax<T>, 'query'> & {
|
|
20
20
|
query?: YeeGridQuery<T, TFormValues>;
|
|
21
21
|
};
|
|
@@ -26,14 +26,14 @@ type NativeToolbarConfig<T> = NonNullable<NativeVxeGridProps<T>['toolbarConfig']
|
|
|
26
26
|
/** YeeGrid 工具栏配置,继承 VXE Grid ToolbarConfig。 */
|
|
27
27
|
export type YeeGridToolbarConfig<T> = NativeToolbarConfig<T>;
|
|
28
28
|
/** YeeGrid 表格配置,完整继承 VXE Grid 并收紧查询返回值。 */
|
|
29
|
-
export type YeeGridOptions<T = Record<string, unknown>, TFormValues extends object =
|
|
29
|
+
export type YeeGridOptions<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> = Omit<NativeVxeGridProps<T>, 'proxyConfig' | 'toolbarConfig'> & {
|
|
30
30
|
proxyConfig?: YeeGridProxyConfig<T, TFormValues>;
|
|
31
31
|
toolbarConfig?: YeeGridToolbarConfig<T>;
|
|
32
32
|
};
|
|
33
33
|
/** useYeeGrid 的初始化配置。 */
|
|
34
|
-
export interface UseYeeGridOptions<T = Record<string, unknown>, TFormValues extends object =
|
|
34
|
+
export interface UseYeeGridOptions<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> {
|
|
35
35
|
/** 可选的查询表单配置。 */
|
|
36
|
-
formOptions?:
|
|
36
|
+
formOptions?: YeeGridFormOptions<TFormValues>;
|
|
37
37
|
/** VXE Grid 原生事件。 */
|
|
38
38
|
gridEvents?: VxeGridListeners<T>;
|
|
39
39
|
/** VXE Grid 表格配置。 */
|
|
@@ -51,7 +51,7 @@ export interface YeeGridRuntimeProps {
|
|
|
51
51
|
tableTitleHelp?: string;
|
|
52
52
|
}
|
|
53
53
|
/** useYeeGrid 返回组件的公开插槽。 */
|
|
54
|
-
export
|
|
54
|
+
export type YeeGridSlots<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> = VxeGridSlots<T> & {
|
|
55
55
|
/** 空数据状态;YeeGrid 已提供默认空态。 */
|
|
56
56
|
empty?: () => VNodeChild;
|
|
57
57
|
/** 自定义表格标题。 */
|
|
@@ -60,15 +60,17 @@ export interface YeeGridSlots<T = Record<string, unknown>> extends VxeGridSlots<
|
|
|
60
60
|
'toolbar-actions'?: (props: VxeGridSlotTypes.DefaultSlotParams<T>) => VNodeChild;
|
|
61
61
|
/** 工具栏右侧工具区。 */
|
|
62
62
|
'toolbar-tools'?: (props: VxeGridSlotTypes.DefaultSlotParams<T>) => VNodeChild;
|
|
63
|
-
}
|
|
63
|
+
} & {
|
|
64
|
+
[TFieldName in keyof TFormValues & string as `form-${TFieldName}`]?: (props: YeeGridFormSlotProps<TFormValues, TFieldName>) => VNodeChild;
|
|
65
|
+
};
|
|
64
66
|
/** useYeeGrid 返回的、携带行类型和插槽提示的组件类型。 */
|
|
65
|
-
export type YeeGridComponent<T = Record<string, unknown
|
|
67
|
+
export type YeeGridComponent<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> = DefineComponent<YeeGridRuntimeProps> & {
|
|
66
68
|
new (): {
|
|
67
|
-
$slots: YeeGridSlots<T>;
|
|
69
|
+
$slots: YeeGridSlots<T, TFormValues>;
|
|
68
70
|
};
|
|
69
71
|
};
|
|
70
72
|
/** YeeGrid 内部挂载属性,不属于业务页面的直接调用入口。 */
|
|
71
|
-
export interface YeeGridInternalProps<T = Record<string, unknown>, TFormValues extends object =
|
|
73
|
+
export interface YeeGridInternalProps<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> extends YeeGridRuntimeProps {
|
|
72
74
|
api: YeeGridApi<T, TFormValues>;
|
|
73
75
|
}
|
|
74
76
|
/** YeeGrid 内部持有的 VXE Grid 实例。 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YeeGridFormValues } from './form-types';
|
|
2
2
|
import { YeeGridApi } from './yee-grid-api';
|
|
3
3
|
import { YeeGridComponent as YeeGridPublicComponent, UseYeeGridOptions } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* 创建类型安全的 YeeGrid 组件和控制器。
|
|
6
6
|
* Grid 的 VXE 实现只在组件真正渲染时加载,避免根入口按需引入时带入 VXE。
|
|
7
7
|
*/
|
|
8
|
-
export declare function useYeeGrid<T = Record<string, unknown>, TFormValues extends object =
|
|
8
|
+
export declare function useYeeGrid<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues>(options: UseYeeGridOptions<T, TFormValues>): readonly [YeeGridPublicComponent<T, TFormValues>, YeeGridApi<T, TFormValues>];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { YeeGridFormApi } from './form-api';
|
|
3
|
+
import { YeeGridFormValues } from './form-types';
|
|
3
4
|
import { YeeGridOptions, UseYeeGridOptions } from './types';
|
|
4
5
|
/** useYeeGrid 返回的表格控制器。 */
|
|
5
|
-
export declare class YeeGridApi<T = Record<string, unknown>, TFormValues extends object =
|
|
6
|
+
export declare class YeeGridApi<T = Record<string, unknown>, TFormValues extends object = YeeGridFormValues> {
|
|
6
7
|
/** 查询表单控制器。 */
|
|
7
|
-
readonly formApi:
|
|
8
|
+
readonly formApi: YeeGridFormApi<TFormValues>;
|
|
8
9
|
/** 查询表单当前是否可见。 */
|
|
9
10
|
readonly searchFormVisible: ShallowRef<boolean>;
|
|
10
11
|
/** 当前 Grid 初始化配置。 */
|
package/dist/grid.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ export * from './components/descriptions';
|
|
|
3
3
|
export * from './components/ellipsis-text';
|
|
4
4
|
export * from './components/app-shell';
|
|
5
5
|
export * from './components/file-upload';
|
|
6
|
-
export * from './components/form';
|
|
7
6
|
export * from './components/grid';
|
|
8
7
|
export * from './components/modal';
|
|
9
8
|
export * from './components/page';
|
|
10
|
-
export * from './components/select';
|
|
11
9
|
export { toAntDesignTheme } from './theme/ant-theme';
|
|
12
10
|
export { platformThemeKey, usePlatformTheme } from './theme/context';
|
|
13
11
|
export { toPlatformCssVariables } from './theme/css-variables';
|
|
14
12
|
export { darkThemeTokens, lightThemeTokens, resolvePlatformTheme, } from './theme/tokens';
|
|
13
|
+
export { YeeBossUIResolver } from './resolver';
|
|
15
14
|
export type { PlatformTheme, PlatformThemeMode, PlatformThemeTokens, ResolvedPlatformTheme, } from './theme/types';
|
|
16
15
|
export { default } from './plugin';
|
package/dist/index.js
CHANGED
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
import { P as
|
|
1
|
+
import { P as r } from "./PlatformConfigProvider-BuML7gEO.js";
|
|
2
2
|
import { C as G } from "./PlatformConfigProvider-BuML7gEO.js";
|
|
3
|
-
import { d as
|
|
4
|
-
import { p as
|
|
3
|
+
import { d as S, l as U, r as _, t as k, a as v } from "./tokens-Dw6w0SSs.js";
|
|
4
|
+
import { p as H, u as O } from "./context-DJQ4f46a.js";
|
|
5
5
|
import { Y as a } from "./index-mOUIZzI1.js";
|
|
6
|
-
import {
|
|
7
|
-
import { d as
|
|
8
|
-
import { Y as
|
|
9
|
-
import { Y as
|
|
10
|
-
import { Y as
|
|
11
|
-
import { Y as
|
|
12
|
-
import { Y as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
YeeEllipsisText: d,
|
|
20
|
-
YeeFileUpload: T,
|
|
21
|
-
YeeForm: n,
|
|
6
|
+
import { YeeBossUIResolver as F } from "./resolver.js";
|
|
7
|
+
import { d as m, c as t, b as i, a as p, Y } from "./YeeTabs-YwptF8tY.js";
|
|
8
|
+
import { Y as f } from "./YeePage-Duxhrl0F.js";
|
|
9
|
+
import { Y as l } from "./YeeFileUpload-BUFoWs8x.js";
|
|
10
|
+
import { Y as n } from "./YeeEllipsisText-BTSbIuBl.js";
|
|
11
|
+
import { Y as T } from "./YeeDescriptions-DyYySPuw.js";
|
|
12
|
+
import { Y as M, a as N, u as R } from "./use-yee-grid-idCNjiBi.js";
|
|
13
|
+
const d = {
|
|
14
|
+
PlatformConfigProvider: r,
|
|
15
|
+
YeeAppShell: Y,
|
|
16
|
+
YeeDescriptions: T,
|
|
17
|
+
YeeEllipsisText: n,
|
|
18
|
+
YeeFileUpload: l,
|
|
22
19
|
YeeHeader: p,
|
|
23
20
|
YeeMenu: i,
|
|
24
21
|
YeeModal: a,
|
|
25
|
-
YeePage:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, _ = {
|
|
22
|
+
YeePage: f,
|
|
23
|
+
YeeSidebar: t,
|
|
24
|
+
YeeTabs: m
|
|
25
|
+
}, C = {
|
|
30
26
|
install(e) {
|
|
31
|
-
Object.entries(
|
|
32
|
-
e.component(o,
|
|
27
|
+
Object.entries(d).forEach(([o, s]) => {
|
|
28
|
+
e.component(o, s);
|
|
33
29
|
});
|
|
34
30
|
}
|
|
35
31
|
};
|
|
36
32
|
export {
|
|
37
33
|
G as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
r as PlatformConfigProvider,
|
|
35
|
+
Y as YeeAppShell,
|
|
36
|
+
F as YeeBossUIResolver,
|
|
37
|
+
T as YeeDescriptions,
|
|
38
|
+
n as YeeEllipsisText,
|
|
39
|
+
l as YeeFileUpload,
|
|
40
|
+
M as YeeGridApi,
|
|
41
|
+
N as YeeGridFormApi,
|
|
46
42
|
p as YeeHeader,
|
|
47
43
|
i as YeeMenu,
|
|
48
44
|
a as YeeModal,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
v as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
K as useYeeGrid
|
|
45
|
+
f as YeePage,
|
|
46
|
+
t as YeeSidebar,
|
|
47
|
+
m as YeeTabs,
|
|
48
|
+
S as darkThemeTokens,
|
|
49
|
+
C as default,
|
|
50
|
+
U as lightThemeTokens,
|
|
51
|
+
H as platformThemeKey,
|
|
52
|
+
_ as resolvePlatformTheme,
|
|
53
|
+
k as toAntDesignTheme,
|
|
54
|
+
v as toPlatformCssVariables,
|
|
55
|
+
O as usePlatformTheme,
|
|
56
|
+
R as useYeeGrid
|
|
62
57
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const yeeBossUIComponentEntries: {
|
|
2
|
+
readonly PlatformConfigProvider: "@yeepay/yee-boss-ui/core";
|
|
3
|
+
readonly YeeAppShell: "@yeepay/yee-boss-ui/app-shell";
|
|
4
|
+
readonly YeeDescriptions: "@yeepay/yee-boss-ui/descriptions";
|
|
5
|
+
readonly YeeEllipsisText: "@yeepay/yee-boss-ui/ellipsis-text";
|
|
6
|
+
readonly YeeFileUpload: "@yeepay/yee-boss-ui/file-upload";
|
|
7
|
+
readonly YeeHeader: "@yeepay/yee-boss-ui/app-shell";
|
|
8
|
+
readonly YeeMenu: "@yeepay/yee-boss-ui/app-shell";
|
|
9
|
+
readonly YeeModal: "@yeepay/yee-boss-ui/modal";
|
|
10
|
+
readonly YeePage: "@yeepay/yee-boss-ui/page";
|
|
11
|
+
readonly YeeSidebar: "@yeepay/yee-boss-ui/app-shell";
|
|
12
|
+
readonly YeeTabs: "@yeepay/yee-boss-ui/app-shell";
|
|
13
|
+
};
|
|
14
|
+
export type YeeBossUIComponentName = keyof typeof yeeBossUIComponentEntries;
|
|
15
|
+
/**
|
|
16
|
+
* Resolver for unplugin-vue-components.
|
|
17
|
+
*
|
|
18
|
+
* Keep this entrypoint free of Vue component imports so Vite config loading
|
|
19
|
+
* does not eagerly load the component library.
|
|
20
|
+
*/
|
|
21
|
+
export declare function YeeBossUIResolver(): (name: string) => {
|
|
22
|
+
from: "@yeepay/yee-boss-ui/core" | "@yeepay/yee-boss-ui/app-shell" | "@yeepay/yee-boss-ui/descriptions" | "@yeepay/yee-boss-ui/ellipsis-text" | "@yeepay/yee-boss-ui/file-upload" | "@yeepay/yee-boss-ui/modal" | "@yeepay/yee-boss-ui/page";
|
|
23
|
+
name: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
export {};
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const y = {
|
|
2
|
+
PlatformConfigProvider: "@yeepay/yee-boss-ui/core",
|
|
3
|
+
YeeAppShell: "@yeepay/yee-boss-ui/app-shell",
|
|
4
|
+
YeeDescriptions: "@yeepay/yee-boss-ui/descriptions",
|
|
5
|
+
YeeEllipsisText: "@yeepay/yee-boss-ui/ellipsis-text",
|
|
6
|
+
YeeFileUpload: "@yeepay/yee-boss-ui/file-upload",
|
|
7
|
+
YeeHeader: "@yeepay/yee-boss-ui/app-shell",
|
|
8
|
+
YeeMenu: "@yeepay/yee-boss-ui/app-shell",
|
|
9
|
+
YeeModal: "@yeepay/yee-boss-ui/modal",
|
|
10
|
+
YeePage: "@yeepay/yee-boss-ui/page",
|
|
11
|
+
YeeSidebar: "@yeepay/yee-boss-ui/app-shell",
|
|
12
|
+
YeeTabs: "@yeepay/yee-boss-ui/app-shell"
|
|
13
|
+
};
|
|
14
|
+
function o() {
|
|
15
|
+
return (e) => {
|
|
16
|
+
const s = y[e];
|
|
17
|
+
return s ? { from: s, name: e } : void 0;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
o as YeeBossUIResolver
|
|
22
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -127,8 +127,6 @@ html.dark,
|
|
|
127
127
|
|
|
128
128
|
.yee-ui-modal__header[data-v-7424b0ee]{display:flex;align-items:center;width:100%;min-width:0}.yee-ui-modal__heading[data-v-7424b0ee]{flex:1;min-width:0}.yee-ui-modal__title[data-v-7424b0ee]{display:block;overflow:hidden;color:var(--yee-foreground);font-size:var(--yee-font-size-lg);font-weight:600;text-overflow:ellipsis;white-space:nowrap}.yee-ui-modal__header-actions[data-v-7424b0ee]{display:flex;flex:none;gap:4px;align-items:center;margin-inline-start:auto;padding-inline-start:16px}.yee-ui-modal__body[data-v-7424b0ee]{color:var(--yee-foreground);font-size:var(--yee-font-size)}.yee-ui-modal__header-action[data-v-7424b0ee]{display:inline-flex;align-items:center;justify-content:center;width:24px;min-width:24px;height:24px;padding:0;color:var(--yee-muted-foreground)}.yee-ui-modal__header-action[data-v-7424b0ee]:hover,.yee-ui-modal__header-action[data-v-7424b0ee]:focus-visible{color:var(--yee-foreground)}.ant-modal.yee-ui-modal .ant-modal-content,.yee-modal.yee-ui-modal .yee-modal-content{padding:0}.ant-modal.yee-ui-modal .ant-modal-header,.yee-modal.yee-ui-modal .yee-modal-header{padding:16px;margin-bottom:0;border-bottom:1px solid var(--yee-border-secondary)}.ant-modal.yee-ui-modal .ant-modal-body,.yee-modal.yee-ui-modal .yee-modal-body,.ant-drawer-content.yee-ui-modal-drawer .ant-drawer-header,.ant-drawer-content.yee-ui-modal-drawer .ant-drawer-body,.yee-drawer-content.yee-ui-modal-drawer .yee-drawer-header,.yee-drawer-content.yee-ui-modal-drawer .yee-drawer-body{padding:16px}.ant-drawer-content.yee-ui-modal-drawer .ant-drawer-footer,.yee-drawer-content.yee-ui-modal-drawer .yee-drawer-footer{padding:10px 16px}.ant-modal.yee-ui-modal .ant-modal-footer,.yee-modal.yee-ui-modal .yee-modal-footer{padding:10px 16px;margin-top:0;border-top:1px solid var(--yee-border-secondary)}.ant-modal.yee-ui-modal--fullscreen,.yee-modal.yee-ui-modal--fullscreen{height:100vh;height:100dvh}.ant-modal.yee-ui-modal--fullscreen .ant-modal-content,.yee-modal.yee-ui-modal--fullscreen .yee-modal-content{display:flex;flex-direction:column;height:100vh;height:100dvh;border-radius:0}.ant-modal.yee-ui-modal--fullscreen .ant-modal-header,.ant-modal.yee-ui-modal--fullscreen .ant-modal-footer,.yee-modal.yee-ui-modal--fullscreen .yee-modal-header,.yee-modal.yee-ui-modal--fullscreen .yee-modal-footer{flex:none}.ant-modal.yee-ui-modal--fullscreen .ant-modal-header,.yee-modal.yee-ui-modal--fullscreen .yee-modal-header{border-radius:0}.ant-modal.yee-ui-modal--fullscreen .ant-modal-body,.yee-modal.yee-ui-modal--fullscreen .yee-modal-body{flex:1;min-height:0;overflow:hidden}.ant-modal.yee-ui-modal--fullscreen .yee-ui-modal__body,.yee-modal.yee-ui-modal--fullscreen .yee-ui-modal__body{height:100%;overflow:auto}.yee-ui-modal__footer[data-v-7424b0ee]{display:flex;gap:8px;justify-content:flex-end}
|
|
129
129
|
|
|
130
|
-
.yee-ui-select[data-v-8acc9d8f]{min-width:0}.yee-ui-select[data-v-8acc9d8f] .ant-select,.yee-ui-select[data-v-8acc9d8f] .yee-select{width:100%}.yee-ui-select__option-label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
131
|
-
/*$vite$:1*/
|
|
132
130
|
.yee-ui-platform-theme[data-v-7e0afdd9]{display:contents}
|
|
133
131
|
/*$vite$:1*/
|
|
134
132
|
.yee-ui-descriptions[data-v-cd55dc37] .ant-descriptions-header,.yee-ui-descriptions[data-v-cd55dc37] .yee-descriptions-header{margin-bottom:16px}.yee-ui-descriptions[data-v-cd55dc37] .ant-descriptions-title,.yee-ui-descriptions[data-v-cd55dc37] .yee-descriptions-title{font-size:var(--yee-font-size-lg);font-weight:600}.yee-ui-descriptions[data-v-cd55dc37] .ant-descriptions-view table,.yee-ui-descriptions[data-v-cd55dc37] .yee-descriptions-view table{table-layout:fixed}.yee-ui-descriptions[data-v-cd55dc37] .ant-descriptions-item-label,.yee-ui-descriptions[data-v-cd55dc37] .yee-descriptions-item-label{color:var(--yee-foreground);font-weight:500;white-space:nowrap}.yee-ui-descriptions[data-v-cd55dc37] .ant-descriptions-item-content,.yee-ui-descriptions[data-v-cd55dc37] .yee-descriptions-item-content{min-width:0;overflow:hidden;color:var(--yee-card-foreground)}.yee-ui-descriptions__item[data-v-cd55dc37]{display:flex;flex-direction:column;gap:4px;min-width:0}.yee-ui-descriptions__content-row[data-v-cd55dc37]{display:flex;gap:8px;align-items:flex-start;min-width:0}.yee-ui-descriptions__value[data-v-cd55dc37]{flex:1 1 auto;min-width:0}.yee-ui-descriptions__value--ellipsis[data-v-cd55dc37]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yee-ui-descriptions__copy[data-v-cd55dc37]{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:22px;min-width:22px;height:22px;padding:0;color:var(--yee-primary);font:inherit;font-size:var(--yee-font-size);line-height:1;background:transparent;border:0;border-radius:var(--yee-radius-sm);cursor:pointer}.yee-ui-descriptions__copy[data-v-cd55dc37]:hover:not(:disabled){background:var(--yee-accent)}.yee-ui-descriptions__copy--copied[data-v-cd55dc37]:disabled{color:var(--yee-success);cursor:default}.yee-ui-descriptions__copy[data-v-cd55dc37]:focus-visible{outline:2px solid var(--yee-ring);outline-offset:2px}.yee-ui-descriptions__info[data-v-cd55dc37]{color:var(--yee-muted-foreground);font-size:var(--yee-font-size-sm);line-height:1.4}
|
|
@@ -137,9 +135,7 @@ html.dark,
|
|
|
137
135
|
/*$vite$:1*/
|
|
138
136
|
.yee-ui-file-upload[data-v-ac555a97],.yee-ui-file-upload[data-v-ac555a97] .ant-upload-wrapper,.yee-ui-file-upload[data-v-ac555a97] .yee-upload-wrapper{min-width:0}.yee-ui-file-upload[data-v-ac555a97] .ant-upload-select,.yee-ui-file-upload[data-v-ac555a97] .yee-upload-select{width:auto;height:auto;margin-inline-end:0}.yee-ui-file-upload[data-v-ac555a97] .ant-upload-list-item-action,.yee-ui-file-upload[data-v-ac555a97] .yee-upload-list-item-action{background:transparent!important}.yee-ui-file-upload__trigger[data-v-ac555a97]{display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:center;box-sizing:border-box;color:var(--yee-muted-foreground);font-size:var(--yee-font-size-sm)}.yee-ui-file-upload__trigger-sign[data-v-ac555a97]{color:var(--yee-foreground);font-size:24px;line-height:1}.yee-ui-file-upload__empty[data-v-ac555a97]{color:var(--yee-muted-foreground);font-size:var(--yee-font-size)}.yee-ui-file-upload__preview[data-v-ac555a97]{display:none}
|
|
139
137
|
/*$vite$:1*/
|
|
140
|
-
.yee-ui-
|
|
141
|
-
/*$vite$:1*/
|
|
142
|
-
.yee-ui-grid[data-v-b69f5a93]{display:flex;flex-direction:column;min-width:0;height:auto;min-height:0;box-sizing:border-box;overflow:hidden;color:var(--yee-foreground);background:var(--yee-card);border-radius:var(--yee-radius)}.yee-ui-grid--fill-page-content[data-v-b69f5a93]{height:100%}.yee-ui-grid__separator[data-v-b69f5a93]{flex:0 0 12px;background:var(--yee-background-deep)}.yee-ui-grid__table-container[data-v-b69f5a93]{flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}.yee-ui-grid__table[data-v-b69f5a93]{min-height:0;box-sizing:border-box;padding:16px}.yee-ui-grid__title[data-v-b69f5a93]{display:inline-flex;gap:6px;align-items:center;margin-right:12px;font-size:var(--yee-font-size-lg);font-weight:600}.yee-ui-grid__help[data-v-b69f5a93]{display:inline-grid;width:16px;height:16px;color:var(--yee-muted-foreground);font-size:11px;border:1px solid var(--yee-border);border-radius:50%;place-items:center}.yee-ui-grid__empty[data-v-b69f5a93]{padding:32px 0;color:var(--yee-muted-foreground);text-align:center}
|
|
138
|
+
.yee-ui-grid[data-v-df63401d]{display:flex;flex-direction:column;min-width:0;height:auto;min-height:0;box-sizing:border-box;overflow:hidden;color:var(--yee-foreground);background:var(--yee-card);border-radius:var(--yee-radius)}.yee-ui-grid--fill-page-content[data-v-df63401d]{height:100%}.yee-ui-grid__search-form[data-v-df63401d]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px;align-items:center;padding:16px;background:var(--yee-card)}.yee-ui-grid__field[data-v-df63401d]{display:grid;grid-template-columns:var(--yee-grid-label-width, max-content) minmax(0,1fr);gap:8px;align-items:center;min-width:0}.yee-ui-grid__field--span-2[data-v-df63401d]{grid-column:span 2}.yee-ui-grid__field--span-3[data-v-df63401d]{grid-column:span 3}.yee-ui-grid__field--vertical[data-v-df63401d]{grid-template-columns:minmax(0,1fr);gap:4px;align-items:stretch}.yee-ui-grid__field--no-label[data-v-df63401d]{grid-template-columns:minmax(0,1fr);gap:0}.yee-ui-grid__control[data-v-df63401d]{display:flex;flex-direction:column;min-width:0}.yee-ui-grid__label[data-v-df63401d]{color:var(--yee-foreground);font-size:var(--yee-font-size);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yee-ui-grid__field--vertical .yee-ui-grid__label[data-v-df63401d]{justify-self:start;text-align:left}.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-checkbox-wrapper,.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-radio-wrapper,.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-rate{color:var(--yee-destructive)}.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-checkbox-wrapper .ant-checkbox-inner,.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-radio-wrapper .ant-radio-inner{border-color:var(--yee-destructive)}.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-switch{background:var(--yee-destructive)}.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-segmented,.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-upload-select-picture-card{border-color:var(--yee-destructive)}.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-slider .ant-slider-track,.yee-ui-grid__field--error .yee-ui-grid__control[data-v-df63401d]>.ant-slider .ant-slider-handle{background:var(--yee-destructive);border-color:var(--yee-destructive)}.yee-ui-grid__field--error .yee-ui-grid__label[data-v-df63401d]:before,.yee-ui-grid__field--required .yee-ui-grid__label[data-v-df63401d]:before{margin-right:2px;color:var(--yee-destructive);content:"*"}.yee-ui-grid__form-actions[data-v-df63401d]{display:flex;gap:8px;align-items:center;grid-column:-2 / -1;justify-content:flex-end}.yee-ui-grid__collapse-button[data-v-df63401d]{display:inline-flex;gap:2px;align-items:center;padding-left:0;padding-right:0}.yee-ui-grid__collapse-icon[data-v-df63401d]{flex:0 0 auto;width:16px;height:16px;transition:transform .3s ease}.yee-ui-grid__collapse-icon--expanded[data-v-df63401d]{transform:rotate(180deg)}.yee-ui-grid__separator[data-v-df63401d]{flex:0 0 12px;background:var(--yee-background-deep)}.yee-ui-grid__table-container[data-v-df63401d]{flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}.yee-ui-grid__table[data-v-df63401d]{min-height:0;box-sizing:border-box;padding:16px}.yee-ui-grid__title[data-v-df63401d]{display:inline-flex;gap:6px;align-items:center;margin-right:12px;font-size:var(--yee-font-size-lg);font-weight:600}.yee-ui-grid__help[data-v-df63401d]{display:inline-grid;width:16px;height:16px;color:var(--yee-muted-foreground);font-size:11px;border:1px solid var(--yee-border);border-radius:50%;place-items:center}.yee-ui-grid__empty[data-v-df63401d]{padding:32px 0;color:var(--yee-muted-foreground);text-align:center}@media not (min-width:1024px){.yee-ui-grid__search-form[data-v-df63401d]{grid-template-columns:repeat(2,minmax(0,1fr))}.yee-ui-grid__field--span-3[data-v-df63401d]{grid-column:span 2}}@media not (min-width:768px){.yee-ui-grid__search-form[data-v-df63401d]{grid-template-columns:minmax(0,1fr)}.yee-ui-grid__field--span-2[data-v-df63401d],.yee-ui-grid__field--span-3[data-v-df63401d]{grid-column:span 1}}
|
|
143
139
|
/*$vite$:1*/
|
|
144
140
|
.yee-ui-page[data-v-ba7ea0ff]{display:flex;flex-direction:column;min-width:0;min-height:100%;box-sizing:border-box;color:var(--yee-foreground);background:var(--yee-background-deep)}.yee-ui-page--auto-height[data-v-ba7ea0ff]{height:calc(var(--yee-content-height, 100%) - var(--yee-page-height-offset));min-height:0;overflow:hidden}.yee-ui-page__header[data-v-ba7ea0ff],.yee-ui-page__footer[data-v-ba7ea0ff]{display:flex;flex:0 0 auto;gap:16px;align-items:center;box-sizing:border-box;padding:16px 24px;background:var(--yee-card)}.yee-ui-page__header[data-v-ba7ea0ff]{justify-content:space-between;border-bottom:1px solid var(--yee-border-secondary)}.yee-ui-page__footer[data-v-ba7ea0ff]{justify-content:flex-end;border-top:1px solid var(--yee-border-secondary)}.yee-ui-page__heading[data-v-ba7ea0ff]{min-width:0}.yee-ui-page__title[data-v-ba7ea0ff],.yee-ui-page__description[data-v-ba7ea0ff]{margin:0}.yee-ui-page__title[data-v-ba7ea0ff]{font-size:var(--yee-font-size-lg);font-weight:600;line-height:1.5}.yee-ui-page__description[data-v-ba7ea0ff]{margin-top:4px;color:var(--yee-muted-foreground);font-size:var(--yee-font-size);line-height:var(--yee-line-height)}.yee-ui-page__extra[data-v-ba7ea0ff]{flex:0 0 auto}.yee-ui-page__content[data-v-ba7ea0ff]{flex:1 1 auto;min-width:0;min-height:0;box-sizing:border-box}.yee-ui-page--auto-height>.yee-ui-page__content[data-v-ba7ea0ff]{flex:0 0 auto}
|
|
145
141
|
/*$vite$:1*/
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { shallowRef as a, reactive as n, defineComponent as h, onBeforeUnmount as d, h as o, defineAsyncComponent as m } from "vue";
|
|
2
|
+
class c {
|
|
3
|
+
/** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
|
|
4
|
+
schema = a([]);
|
|
5
|
+
initialValues = {};
|
|
6
|
+
values = n({});
|
|
7
|
+
/** @internal 使用配置初始化 Schema 和字段值。 */
|
|
8
|
+
configure(e) {
|
|
9
|
+
this.schema.value = e.schema.map((s) => ({ ...s })), this.initialValues = { ...e.initialValues }, this.resetForm();
|
|
10
|
+
}
|
|
11
|
+
/** 获取指定字段值,并保留 TValues 中声明的字段类型。 */
|
|
12
|
+
getFieldValue(e) {
|
|
13
|
+
return this.values[e];
|
|
14
|
+
}
|
|
15
|
+
/** 获取当前全部字段值的浅拷贝。 */
|
|
16
|
+
getValues() {
|
|
17
|
+
return { ...this.values };
|
|
18
|
+
}
|
|
19
|
+
/** 将字段值恢复为 initialValues。 */
|
|
20
|
+
resetForm() {
|
|
21
|
+
for (const e of Object.keys(this.values))
|
|
22
|
+
delete this.values[e];
|
|
23
|
+
Object.assign(this.values, this.initialValues);
|
|
24
|
+
}
|
|
25
|
+
/** 设置指定字段值,字段名和值必须与 TValues 保持一致。 */
|
|
26
|
+
setFieldValue(e, s) {
|
|
27
|
+
this.values[e] = s;
|
|
28
|
+
}
|
|
29
|
+
/** 批量更新已声明字段的值。 */
|
|
30
|
+
setValues(e) {
|
|
31
|
+
Object.assign(this.values, e);
|
|
32
|
+
}
|
|
33
|
+
/** @internal 获取供 Ant Design Vue Form 使用的响应式模型。 */
|
|
34
|
+
getModel() {
|
|
35
|
+
return this.values;
|
|
36
|
+
}
|
|
37
|
+
/** 校验指定字段是否满足必填配置。 */
|
|
38
|
+
validateField(e) {
|
|
39
|
+
const s = this.schema.value.find((i) => i.fieldName === e);
|
|
40
|
+
return !s || s.hide || !s.required || !f(this.getFieldValue(e));
|
|
41
|
+
}
|
|
42
|
+
/** 校验所有未隐藏的必填字段;校验失败时返回 false。 */
|
|
43
|
+
validate() {
|
|
44
|
+
return this.schema.value.every((e) => this.validateField(e.fieldName));
|
|
45
|
+
}
|
|
46
|
+
/** 按字段名动态更新 Schema。 */
|
|
47
|
+
updateSchema(e) {
|
|
48
|
+
const s = new Map(e.map((i) => [i.fieldName, i]));
|
|
49
|
+
this.schema.value = this.schema.value.map((i) => ({
|
|
50
|
+
...i,
|
|
51
|
+
...s.get(i.fieldName)
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function f(t) {
|
|
56
|
+
return t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 : typeof t == "number" && Number.isNaN(t);
|
|
57
|
+
}
|
|
58
|
+
class p {
|
|
59
|
+
/** 查询表单控制器。 */
|
|
60
|
+
formApi = new c();
|
|
61
|
+
/** 查询表单当前是否可见。 */
|
|
62
|
+
searchFormVisible;
|
|
63
|
+
/** 当前 Grid 初始化配置。 */
|
|
64
|
+
state;
|
|
65
|
+
grid;
|
|
66
|
+
constructor(e) {
|
|
67
|
+
this.state = a(e), this.searchFormVisible = a(e.showSearchForm ?? !0);
|
|
68
|
+
}
|
|
69
|
+
/** @internal 由 YeeGrid 挂载底层 VXE Grid 实例。 */
|
|
70
|
+
mount(e) {
|
|
71
|
+
this.grid = e;
|
|
72
|
+
}
|
|
73
|
+
/** 保留当前页码并执行查询,可在查询前合并表单值。 */
|
|
74
|
+
query = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("query"));
|
|
75
|
+
/** 回到第一页并重新查询,可在查询前合并表单值。 */
|
|
76
|
+
reload = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("reload"));
|
|
77
|
+
/** 合并更新 VXE Grid 配置。 */
|
|
78
|
+
setGridOptions(e) {
|
|
79
|
+
this.setState({
|
|
80
|
+
gridOptions: {
|
|
81
|
+
...this.state.value.gridOptions,
|
|
82
|
+
...e
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/** 设置表格加载状态。 */
|
|
87
|
+
setLoading(e) {
|
|
88
|
+
this.setGridOptions({ loading: e });
|
|
89
|
+
}
|
|
90
|
+
/** 合并更新 useYeeGrid 初始化配置。 */
|
|
91
|
+
setState(e) {
|
|
92
|
+
this.state.value = {
|
|
93
|
+
...this.state.value,
|
|
94
|
+
...e
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** 切换查询表单显隐,并返回切换后的状态。 */
|
|
98
|
+
toggleSearchForm(e) {
|
|
99
|
+
return this.searchFormVisible.value = e ?? !this.searchFormVisible.value, this.searchFormVisible.value;
|
|
100
|
+
}
|
|
101
|
+
/** @internal 清理底层 VXE Grid 实例引用。 */
|
|
102
|
+
unmount() {
|
|
103
|
+
this.grid = void 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
let r = !1;
|
|
107
|
+
function g() {
|
|
108
|
+
if (!(r || typeof document > "u")) {
|
|
109
|
+
if (document.querySelector("link[data-yee-grid-styles]")) {
|
|
110
|
+
r = !0;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
r = !0, import("@yeepay/yee-boss-ui/grid.css");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const y = m(() => import("./YeeGrid-C5jcjTuQ.js"));
|
|
117
|
+
function b(t) {
|
|
118
|
+
g();
|
|
119
|
+
const e = new p(t);
|
|
120
|
+
return [h({
|
|
121
|
+
name: "YeeGrid",
|
|
122
|
+
inheritAttrs: !1,
|
|
123
|
+
props: {
|
|
124
|
+
tableTitle: String,
|
|
125
|
+
tableTitleHelp: String
|
|
126
|
+
},
|
|
127
|
+
setup(i, { attrs: l, slots: u }) {
|
|
128
|
+
return d(() => e.unmount()), () => o(y, {
|
|
129
|
+
...l,
|
|
130
|
+
api: e,
|
|
131
|
+
...i.tableTitle ? { tableTitle: i.tableTitle } : {},
|
|
132
|
+
...i.tableTitleHelp ? { tableTitleHelp: i.tableTitleHelp } : {}
|
|
133
|
+
}, u);
|
|
134
|
+
}
|
|
135
|
+
}), e];
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
p as Y,
|
|
139
|
+
c as a,
|
|
140
|
+
b as u
|
|
141
|
+
};
|