@gx-design-vue/pro-table 0.2.0-alpha.8 → 0.2.0-alpha.9
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/ProTable.d.ts +14 -492
- package/dist/ProTable.js +818 -518
- package/dist/components/ScrollBar/Bar.d.ts +81 -0
- package/dist/components/ScrollBar/Bar.js +84 -0
- package/dist/components/ScrollBar/Thumb.d.ts +52 -0
- package/dist/components/ScrollBar/{Thumb/index.js → Thumb.js} +67 -55
- package/dist/components/ScrollBar/context.d.ts +3 -4
- package/dist/components/ScrollBar/context.js +3 -3
- package/dist/components/ScrollBar/util.d.ts +6 -5
- package/dist/components/ScrollBar/util.js +1 -12
- package/dist/components/SearchForm/CollapseToggle.d.ts +55 -0
- package/dist/components/SearchForm/CollapseToggle.js +47 -0
- package/dist/components/SearchForm/FormItemContainer.d.ts +75 -0
- package/dist/components/SearchForm/FormItemContainer.js +225 -0
- package/dist/components/SearchForm/FormItemWrapper.d.ts +82 -0
- package/dist/components/SearchForm/FormItemWrapper.js +62 -0
- package/dist/components/SearchForm/SearchForm.d.ts +130 -0
- package/dist/components/SearchForm/SearchForm.js +319 -0
- package/dist/components/SearchForm/index.d.ts +2 -0
- package/dist/components/SearchForm/index.js +2 -0
- package/dist/components/Toolbar/FullscreenIcon.d.ts +26 -0
- package/dist/components/Toolbar/FullscreenIcon.js +22 -0
- package/dist/components/Toolbar/ListToolBar.d.ts +111 -0
- package/dist/components/Toolbar/ListToolBar.js +101 -0
- package/dist/components/Toolbar/index.d.ts +103 -0
- package/dist/components/Toolbar/index.js +101 -0
- package/dist/components/Toolbar/style.d.ts +8 -0
- package/dist/components/{ListToolBar → Toolbar}/style.js +32 -27
- package/dist/context/TableContext.d.ts +15 -27
- package/dist/context/TableContext.js +3 -3
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.js +16 -0
- package/dist/hooks/useBreakpoints.d.ts +13 -0
- package/dist/hooks/useBreakpoints.js +57 -0
- package/dist/hooks/useCellRender.d.ts +13 -0
- package/dist/hooks/useCellRender.js +28 -0
- package/dist/hooks/useColumnResize.d.ts +30 -0
- package/dist/hooks/useColumnResize.js +110 -0
- package/dist/hooks/useColumns.d.ts +35 -24
- package/dist/hooks/useColumns.js +89 -56
- package/dist/hooks/useFetchData.d.ts +40 -65
- package/dist/hooks/useFetchData.js +157 -172
- package/dist/hooks/useFitPage.d.ts +19 -0
- package/dist/hooks/useFitPage.js +90 -0
- package/dist/hooks/useKeepAliveReload.d.ts +21 -0
- package/dist/hooks/useKeepAliveReload.js +24 -0
- package/dist/hooks/useLoading.d.ts +18 -7
- package/dist/hooks/useLoading.js +26 -8
- package/dist/hooks/usePagination.d.ts +10 -7
- package/dist/hooks/usePagination.js +37 -26
- package/dist/hooks/useRequestOptions.d.ts +18 -0
- package/dist/hooks/useRequestOptions.js +39 -0
- package/dist/hooks/useRowSelection.d.ts +27 -15
- package/dist/hooks/useRowSelection.js +92 -77
- package/dist/hooks/useTable.d.ts +19 -77
- package/dist/hooks/useTable.js +66 -54
- package/dist/hooks/useTableForm.d.ts +15 -83
- package/dist/hooks/useTableForm.js +93 -57
- package/dist/hooks/useTableScroll.d.ts +33 -31
- package/dist/hooks/useTableScroll.js +71 -26
- package/dist/hooks/useTableSize.d.ts +17 -7
- package/dist/hooks/useTableSize.js +20 -6
- package/dist/index.d.ts +10 -7
- package/dist/index.js +9 -3
- package/dist/interface.d.ts +492 -0
- package/dist/pro-table.esm.js +3512 -3965
- package/dist/pro-table.js +1 -1
- package/dist/style/fit-page.d.ts +4 -2
- package/dist/style/fit-page.js +9 -3
- package/dist/style/index.d.ts +4 -6
- package/dist/style/index.js +24 -74
- package/dist/style/list.d.ts +4 -2
- package/dist/style/list.js +1 -10
- package/dist/style/resizable.d.ts +8 -0
- package/dist/style/resizable.js +18 -0
- package/dist/style/scroll.d.ts +4 -2
- package/dist/style/scroll.js +8 -6
- package/dist/style/search.d.ts +8 -0
- package/dist/{components/Form/style.js → style/search.js} +22 -8
- package/dist/theme/augment.d.ts +8 -0
- package/dist/theme/interface/components.d.ts +8 -0
- package/dist/utils/dateFormat.d.ts +9 -0
- package/dist/utils/dateFormat.js +29 -0
- package/dist/utils/formConstants.d.ts +9 -0
- package/dist/utils/formConstants.js +29 -0
- package/dist/utils/valueFormat.d.ts +9 -0
- package/dist/utils/valueFormat.js +27 -0
- package/package.json +10 -9
- package/dist/components/Form/components/RequestSelect.d.ts +0 -50
- package/dist/components/Form/components/RequestSelect.js +0 -56
- package/dist/components/Form/hooks/useForm.d.ts +0 -11
- package/dist/components/Form/hooks/useForm.js +0 -30
- package/dist/components/Form/index.d.ts +0 -32
- package/dist/components/Form/index.js +0 -504
- package/dist/components/Form/style.d.ts +0 -6
- package/dist/components/Form/utils/config.d.ts +0 -9
- package/dist/components/Form/utils/config.js +0 -29
- package/dist/components/Form/utils/dateFormat.d.ts +0 -22
- package/dist/components/Form/utils/dateFormat.js +0 -43
- package/dist/components/ListToolBar/index.d.ts +0 -59
- package/dist/components/ListToolBar/index.js +0 -123
- package/dist/components/ListToolBar/style.d.ts +0 -6
- package/dist/components/ScrollBar/Bar/index.d.ts +0 -49
- package/dist/components/ScrollBar/Bar/index.js +0 -68
- package/dist/components/ScrollBar/Bar/props.d.ts +0 -25
- package/dist/components/ScrollBar/Bar/props.js +0 -17
- package/dist/components/ScrollBar/Thumb/index.d.ts +0 -40
- package/dist/components/ScrollBar/Thumb/props.d.ts +0 -20
- package/dist/components/ScrollBar/Thumb/props.js +0 -17
- package/dist/components/TableCell/index.d.ts +0 -37
- package/dist/components/TableCell/index.js +0 -69
- package/dist/components/ToolBar/FullscreenIcon.d.ts +0 -7
- package/dist/components/ToolBar/FullscreenIcon.js +0 -11
- package/dist/components/ToolBar/index.d.ts +0 -34
- package/dist/components/ToolBar/index.js +0 -97
- package/dist/hooks/tryOnActivated.d.ts +0 -6
- package/dist/hooks/tryOnActivated.js +0 -12
- package/dist/hooks/useDebounceFn.d.ts +0 -8
- package/dist/hooks/useDebounceFn.js +0 -31
- package/dist/hooks/useScrollArea.d.ts +0 -24
- package/dist/hooks/useScrollArea.js +0 -102
- package/dist/props.d.ts +0 -340
- package/dist/props.js +0 -247
- package/dist/types/ColumnTypings.d.ts +0 -130
- package/dist/types/SlotsTypings.d.ts +0 -63
- package/dist/types/SlotsTypings.js +0 -12
- package/dist/types/TableTypings.d.ts +0 -359
- package/dist/types/index.d.ts +0 -9
- package/dist/utils/utils.d.ts +0 -10
- package/dist/utils/utils.js +0 -89
- /package/dist/{types/ColumnTypings.js → interface.js} +0 -0
- /package/dist/{types/TableTypings.js → theme/augment.js} +0 -0
- /package/dist/{types/index.js → theme/interface/components.js} +0 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { formatDateRangeArray, formatStringValue, resolveValueFormat } from "../../utils/dateFormat.js";
|
|
2
|
+
import { useRequestOptions } from "../../hooks/useRequestOptions.js";
|
|
3
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
4
|
+
import { Cascader, DatePicker, Input, InputNumber, Select, SpaceCompact, TimePicker, TreeSelect } from "antdv-next";
|
|
5
|
+
import dayjs from "dayjs";
|
|
6
|
+
//#region src/components/SearchForm/FormItemContainer.tsx
|
|
7
|
+
const { RangePicker } = DatePicker;
|
|
8
|
+
const FormItemContainer = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "ProTableFormItemContainer",
|
|
10
|
+
props: {
|
|
11
|
+
prefixCls: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
record: {
|
|
16
|
+
type: Object,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
formState: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
autoRequest: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
onChange: {
|
|
32
|
+
type: Function,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
onSubmit: {
|
|
36
|
+
type: Function,
|
|
37
|
+
default: void 0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(props) {
|
|
41
|
+
const { optionList, loading: requestLoading } = useRequestOptions({
|
|
42
|
+
fetch: props.record.request?.fetch,
|
|
43
|
+
manual: props.record.request?.manual,
|
|
44
|
+
debounceTime: props.record.request?.debounceTime
|
|
45
|
+
});
|
|
46
|
+
const rangeInputStyle = {
|
|
47
|
+
width: "calc((100% - 30px) / 2)",
|
|
48
|
+
flex: "0 0 calc((100% - 30px) / 2)",
|
|
49
|
+
minWidth: 0
|
|
50
|
+
};
|
|
51
|
+
function handleChange(value, options) {
|
|
52
|
+
props.onChange(value, props.record, options);
|
|
53
|
+
}
|
|
54
|
+
function renderText() {
|
|
55
|
+
const fields = props.record.field ?? {};
|
|
56
|
+
const inputProps = {
|
|
57
|
+
style: { width: "100%" },
|
|
58
|
+
value: props.formState[props.record.name],
|
|
59
|
+
placeholder: props.record.placeholder || "请输入",
|
|
60
|
+
allowClear: props.record.allowClear ?? true,
|
|
61
|
+
...fields
|
|
62
|
+
};
|
|
63
|
+
if (props.autoRequest) return createVNode(Input.Search, mergeProps(inputProps, {
|
|
64
|
+
"onSearch": () => props.onSubmit?.(),
|
|
65
|
+
"onChange": (e) => {
|
|
66
|
+
props.formState[props.record.name] = e.target?.value ?? e;
|
|
67
|
+
}
|
|
68
|
+
}), null);
|
|
69
|
+
return createVNode(Input, mergeProps(inputProps, { "onChange": (e) => handleChange(e.target?.value ?? e) }), null);
|
|
70
|
+
}
|
|
71
|
+
function renderNumber() {
|
|
72
|
+
return createVNode(InputNumber, mergeProps({
|
|
73
|
+
"style": { width: "100%" },
|
|
74
|
+
"value": props.formState[props.record.name],
|
|
75
|
+
"placeholder": props.record.placeholder || "请输入",
|
|
76
|
+
"onChange": (val) => handleChange(val ?? void 0)
|
|
77
|
+
}, props.record.field ?? {}), null);
|
|
78
|
+
}
|
|
79
|
+
function renderNumberRange() {
|
|
80
|
+
const name = props.record.name;
|
|
81
|
+
const value = props.formState[name];
|
|
82
|
+
const placeholder = Array.isArray(props.record.placeholder) ? props.record.placeholder : ["请输入", "请输入"];
|
|
83
|
+
return createVNode(SpaceCompact, {
|
|
84
|
+
"class": `${props.prefixCls}-search-input-compact`,
|
|
85
|
+
"style": { width: "100%" }
|
|
86
|
+
}, { default: () => [
|
|
87
|
+
createVNode(InputNumber, {
|
|
88
|
+
"value": value?.[0],
|
|
89
|
+
"placeholder": placeholder[0] || "请输入",
|
|
90
|
+
"onChange": (val) => handleChange(val, { key: 0 }),
|
|
91
|
+
"style": rangeInputStyle
|
|
92
|
+
}, null),
|
|
93
|
+
createVNode(Input, {
|
|
94
|
+
"disabled": true,
|
|
95
|
+
"value": "~",
|
|
96
|
+
"class": `${props.prefixCls}-number-range-separator`,
|
|
97
|
+
"style": {
|
|
98
|
+
width: 30,
|
|
99
|
+
flex: "0 0 30px",
|
|
100
|
+
pointerEvents: "none"
|
|
101
|
+
}
|
|
102
|
+
}, null),
|
|
103
|
+
createVNode(InputNumber, {
|
|
104
|
+
"value": value?.[1],
|
|
105
|
+
"placeholder": placeholder[1] || "请输入",
|
|
106
|
+
"onChange": (val) => handleChange(val, { key: 1 }),
|
|
107
|
+
"style": rangeInputStyle
|
|
108
|
+
}, null)
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
function renderSelect() {
|
|
112
|
+
const isLoading = props.record.loading || requestLoading.value;
|
|
113
|
+
const options = props.record.request ? optionList.value : props.record.valueEnum || [];
|
|
114
|
+
const fields = props.record.field ?? {};
|
|
115
|
+
return createVNode(Select, mergeProps({
|
|
116
|
+
"style": { width: "100%" },
|
|
117
|
+
"value": isLoading ? void 0 : props.formState[props.record.name],
|
|
118
|
+
"optionFilterProp": "label",
|
|
119
|
+
"placeholder": props.record.placeholder || "请选择",
|
|
120
|
+
"showSearch": props.record.showSearch,
|
|
121
|
+
"allowClear": props.record.allowClear ?? true,
|
|
122
|
+
"loading": isLoading,
|
|
123
|
+
"options": options,
|
|
124
|
+
"onChange": (val) => handleChange(val ?? void 0)
|
|
125
|
+
}, fields), null);
|
|
126
|
+
}
|
|
127
|
+
function renderTreeSelect() {
|
|
128
|
+
const fields = props.record.field ?? {};
|
|
129
|
+
const isLoading = props.record.loading || requestLoading.value;
|
|
130
|
+
return createVNode(TreeSelect, mergeProps({
|
|
131
|
+
"style": { width: "100%" },
|
|
132
|
+
"value": props.formState[props.record.name],
|
|
133
|
+
"placeholder": props.record.placeholder || "请选择",
|
|
134
|
+
"allowClear": props.record.allowClear ?? true,
|
|
135
|
+
"treeData": isLoading ? [] : props.record.request ? optionList.value : props.record.valueEnum || [],
|
|
136
|
+
"loading": isLoading,
|
|
137
|
+
"onChange": (val) => handleChange(val ?? (fields.treeCheckable || fields.multiple ? [] : null))
|
|
138
|
+
}, fields), null);
|
|
139
|
+
}
|
|
140
|
+
function renderCascader() {
|
|
141
|
+
const fields = props.record.field ?? {};
|
|
142
|
+
const isLoading = props.record.loading || requestLoading.value;
|
|
143
|
+
return createVNode(Cascader, mergeProps({
|
|
144
|
+
"style": { width: "100%" },
|
|
145
|
+
"value": props.formState[props.record.name],
|
|
146
|
+
"placeholder": props.record.placeholder || "请选择",
|
|
147
|
+
"allowClear": props.record.allowClear ?? true,
|
|
148
|
+
"options": isLoading ? [] : props.record.request ? optionList.value : props.record.valueEnum || [],
|
|
149
|
+
"loading": isLoading,
|
|
150
|
+
"onChange": (val) => handleChange(val ?? void 0)
|
|
151
|
+
}, fields), null);
|
|
152
|
+
}
|
|
153
|
+
function renderDate() {
|
|
154
|
+
const format = resolveValueFormat(props.record.valueFormat, props.record.showTime);
|
|
155
|
+
return createVNode(DatePicker, mergeProps({
|
|
156
|
+
"style": { width: "100%" },
|
|
157
|
+
"value": props.formState[props.record.name] ? dayjs(props.formState[props.record.name]) : void 0,
|
|
158
|
+
"placeholder": props.record.placeholder || "请选择",
|
|
159
|
+
"allowClear": props.record.allowClear ?? true,
|
|
160
|
+
"format": format,
|
|
161
|
+
"showTime": props.record.showTime,
|
|
162
|
+
"onChange": (val) => handleChange(val ? formatStringValue(val, format) : null)
|
|
163
|
+
}, props.record.field ?? {}), null);
|
|
164
|
+
}
|
|
165
|
+
function renderDatePicker(picker, format, placeholder) {
|
|
166
|
+
const value = props.formState[props.record.name];
|
|
167
|
+
return createVNode(DatePicker, mergeProps({
|
|
168
|
+
"style": { width: "100%" },
|
|
169
|
+
"picker": picker,
|
|
170
|
+
"value": value ? dayjs(value, format) : void 0,
|
|
171
|
+
"placeholder": placeholder || "请选择",
|
|
172
|
+
"allowClear": props.record.allowClear ?? true,
|
|
173
|
+
"onChange": (val) => handleChange(val ? formatStringValue(val, format) : null)
|
|
174
|
+
}, props.record.field ?? {}), null);
|
|
175
|
+
}
|
|
176
|
+
function renderDateRange() {
|
|
177
|
+
const format = resolveValueFormat(props.record.valueFormat, props.record.showTime);
|
|
178
|
+
const value = props.formState[props.record.name];
|
|
179
|
+
const fields = props.record.field ?? {};
|
|
180
|
+
const placeholderValue = Array.isArray(props.record.placeholder) ? props.record.placeholder : ["开始日期", "结束日期"];
|
|
181
|
+
return createVNode(RangePicker, mergeProps({
|
|
182
|
+
"style": { width: "100%" },
|
|
183
|
+
"value": Array.isArray(value) && value.length === 2 ? formatDateRangeArray(value, format, "dayjs") : void 0,
|
|
184
|
+
"placeholder": placeholderValue,
|
|
185
|
+
"format": format,
|
|
186
|
+
"showTime": props.record.showTime,
|
|
187
|
+
"onChange": (val) => {
|
|
188
|
+
handleChange(val && Array.isArray(val) && val.length === 2 ? formatDateRangeArray(val, format, "string") : null);
|
|
189
|
+
}
|
|
190
|
+
}, fields), null);
|
|
191
|
+
}
|
|
192
|
+
function renderTime() {
|
|
193
|
+
const format = props.record.valueFormat || "HH:mm:ss";
|
|
194
|
+
return createVNode(TimePicker, mergeProps({
|
|
195
|
+
"style": { width: "100%" },
|
|
196
|
+
"value": props.formState[props.record.name] ? dayjs(props.formState[props.record.name], format) : void 0,
|
|
197
|
+
"placeholder": props.record.placeholder || "请选择",
|
|
198
|
+
"allowClear": props.record.allowClear ?? true,
|
|
199
|
+
"use12Hours": props.record.use12Hours,
|
|
200
|
+
"format": format,
|
|
201
|
+
"onChange": (val) => handleChange(val ? formatStringValue(val, format) : null)
|
|
202
|
+
}, props.record.field ?? {}), null);
|
|
203
|
+
}
|
|
204
|
+
return () => {
|
|
205
|
+
switch (props.record.valueType ?? "text") {
|
|
206
|
+
case "text": return renderText();
|
|
207
|
+
case "number": return renderNumber();
|
|
208
|
+
case "numberRange": return renderNumberRange();
|
|
209
|
+
case "select": return renderSelect();
|
|
210
|
+
case "treeSelect": return renderTreeSelect();
|
|
211
|
+
case "cascader": return renderCascader();
|
|
212
|
+
case "date": return renderDate();
|
|
213
|
+
case "dateWeek": return renderDatePicker("week", "YYYY-wo", props.record.placeholder || "请选择");
|
|
214
|
+
case "dateMonth": return renderDatePicker("month", "YYYY-MM", props.record.placeholder || "请选择");
|
|
215
|
+
case "dateQuarter": return renderDatePicker("quarter", "YYYY-QQ", props.record.placeholder || "请选择");
|
|
216
|
+
case "dateYear": return renderDatePicker("year", "YYYY", props.record.placeholder || "请选择");
|
|
217
|
+
case "dateRange": return renderDateRange();
|
|
218
|
+
case "time": return renderTime();
|
|
219
|
+
default: return renderText();
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
//#endregion
|
|
225
|
+
export { FormItemContainer };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { CSSProperties, PropType } from "vue";
|
|
3
|
+
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/SearchForm/FormItemWrapper.d.ts
|
|
6
|
+
declare const FormItemWrapper: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
7
|
+
label: {
|
|
8
|
+
type: PropType<string | any>;
|
|
9
|
+
default: any;
|
|
10
|
+
};
|
|
11
|
+
labelWidth: {
|
|
12
|
+
type: PropType<number | string>;
|
|
13
|
+
default: any;
|
|
14
|
+
};
|
|
15
|
+
labelAlign: {
|
|
16
|
+
type: PropType<"left" | "center" | "right">;
|
|
17
|
+
default: any;
|
|
18
|
+
};
|
|
19
|
+
colon: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
23
|
+
prefixCls: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
hashId: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
formItemStyle: {
|
|
32
|
+
type: PropType<CSSProperties>;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
globalLabelGap: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
default: any;
|
|
38
|
+
};
|
|
39
|
+
}>, () => _$vue_jsx_runtime0.JSX.Element, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
40
|
+
label: {
|
|
41
|
+
type: PropType<string | any>;
|
|
42
|
+
default: any;
|
|
43
|
+
};
|
|
44
|
+
labelWidth: {
|
|
45
|
+
type: PropType<number | string>;
|
|
46
|
+
default: any;
|
|
47
|
+
};
|
|
48
|
+
labelAlign: {
|
|
49
|
+
type: PropType<"left" | "center" | "right">;
|
|
50
|
+
default: any;
|
|
51
|
+
};
|
|
52
|
+
colon: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: any;
|
|
55
|
+
};
|
|
56
|
+
prefixCls: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
required: true;
|
|
59
|
+
};
|
|
60
|
+
hashId: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
formItemStyle: {
|
|
65
|
+
type: PropType<CSSProperties>;
|
|
66
|
+
default: () => {};
|
|
67
|
+
};
|
|
68
|
+
globalLabelGap: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: any;
|
|
71
|
+
};
|
|
72
|
+
}>> & Readonly<{}>, {
|
|
73
|
+
label: any;
|
|
74
|
+
labelWidth: string | number;
|
|
75
|
+
labelAlign: "left" | "center" | "right";
|
|
76
|
+
colon: boolean;
|
|
77
|
+
hashId: string;
|
|
78
|
+
formItemStyle: CSSProperties;
|
|
79
|
+
globalLabelGap: number;
|
|
80
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
81
|
+
//#endregion
|
|
82
|
+
export { FormItemWrapper };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createVNode, defineComponent } from "vue";
|
|
2
|
+
//#region src/components/SearchForm/FormItemWrapper.tsx
|
|
3
|
+
const FormItemWrapper = /* @__PURE__ */ defineComponent({
|
|
4
|
+
name: "ProTableFormItemWrapper",
|
|
5
|
+
props: {
|
|
6
|
+
label: {
|
|
7
|
+
type: [String, Object],
|
|
8
|
+
default: void 0
|
|
9
|
+
},
|
|
10
|
+
labelWidth: {
|
|
11
|
+
type: [Number, String],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
labelAlign: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
colon: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
prefixCls: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
hashId: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
formItemStyle: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({})
|
|
33
|
+
},
|
|
34
|
+
globalLabelGap: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: void 0
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(props, { slots }) {
|
|
40
|
+
return () => {
|
|
41
|
+
const showLabel = !!props.label;
|
|
42
|
+
const labelAlignClass = props.labelAlign ? `${props.prefixCls}-search-item-label-${props.labelAlign}` : "";
|
|
43
|
+
const noColonClass = props.colon === false ? `${props.prefixCls}-search-item-label-no-colon` : "";
|
|
44
|
+
return createVNode("div", {
|
|
45
|
+
"class": [`${props.prefixCls}-search-item`, props.hashId],
|
|
46
|
+
"style": {
|
|
47
|
+
...props.formItemStyle,
|
|
48
|
+
...props.globalLabelGap != null ? { gap: `${props.globalLabelGap}px` } : {}
|
|
49
|
+
}
|
|
50
|
+
}, [showLabel && createVNode("div", {
|
|
51
|
+
"class": [
|
|
52
|
+
`${props.prefixCls}-search-item-label`,
|
|
53
|
+
labelAlignClass,
|
|
54
|
+
noColonClass
|
|
55
|
+
],
|
|
56
|
+
"style": props.labelWidth ? { width: typeof props.labelWidth === "number" ? `${props.labelWidth}px` : props.labelWidth } : void 0
|
|
57
|
+
}, [props.label]), createVNode("div", { "class": `${props.prefixCls}-search-item-children` }, [slots.default?.()])]);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { FormItemWrapper };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { FormConfig, ProSearchMap } from "../../interface.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { PropType } from "vue";
|
|
4
|
+
import * as _$vue_jsx_runtime0 from "vue/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/SearchForm/SearchForm.d.ts
|
|
7
|
+
declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
8
|
+
prefixCls: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
formColumns: {
|
|
13
|
+
type: PropType<ProSearchMap[]>;
|
|
14
|
+
default: () => any[];
|
|
15
|
+
};
|
|
16
|
+
formState: {
|
|
17
|
+
type: PropType<Record<string, any>>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
defaultFormSearch: {
|
|
21
|
+
type: PropType<Record<string, any>>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
formConfig: {
|
|
25
|
+
type: PropType<FormConfig | undefined>;
|
|
26
|
+
default: any;
|
|
27
|
+
};
|
|
28
|
+
formAutoRequest: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
formActions: {
|
|
33
|
+
type: PropType<FormConfig["actions"] | undefined>;
|
|
34
|
+
default: any;
|
|
35
|
+
};
|
|
36
|
+
loading: {
|
|
37
|
+
type: PropType<boolean | any>;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
cardBordered: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
proClasses: {
|
|
45
|
+
type: PropType<Record<string, string>>;
|
|
46
|
+
default: () => {};
|
|
47
|
+
};
|
|
48
|
+
proStyles: {
|
|
49
|
+
type: PropType<Record<string, any>>;
|
|
50
|
+
default: () => {};
|
|
51
|
+
};
|
|
52
|
+
onSearch: {
|
|
53
|
+
type: PropType<(params: Record<string, any>, action?: "reset" | "submit") => void>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
onReset: {
|
|
57
|
+
type: PropType<(params: Record<string, any>) => void>;
|
|
58
|
+
default: any;
|
|
59
|
+
};
|
|
60
|
+
}>, () => _$vue_jsx_runtime0.JSX.Element, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
61
|
+
prefixCls: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
required: true;
|
|
64
|
+
};
|
|
65
|
+
formColumns: {
|
|
66
|
+
type: PropType<ProSearchMap[]>;
|
|
67
|
+
default: () => any[];
|
|
68
|
+
};
|
|
69
|
+
formState: {
|
|
70
|
+
type: PropType<Record<string, any>>;
|
|
71
|
+
required: true;
|
|
72
|
+
};
|
|
73
|
+
defaultFormSearch: {
|
|
74
|
+
type: PropType<Record<string, any>>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
formConfig: {
|
|
78
|
+
type: PropType<FormConfig | undefined>;
|
|
79
|
+
default: any;
|
|
80
|
+
};
|
|
81
|
+
formAutoRequest: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: boolean;
|
|
84
|
+
};
|
|
85
|
+
formActions: {
|
|
86
|
+
type: PropType<FormConfig["actions"] | undefined>;
|
|
87
|
+
default: any;
|
|
88
|
+
};
|
|
89
|
+
loading: {
|
|
90
|
+
type: PropType<boolean | any>;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
|
+
cardBordered: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
|
+
proClasses: {
|
|
98
|
+
type: PropType<Record<string, string>>;
|
|
99
|
+
default: () => {};
|
|
100
|
+
};
|
|
101
|
+
proStyles: {
|
|
102
|
+
type: PropType<Record<string, any>>;
|
|
103
|
+
default: () => {};
|
|
104
|
+
};
|
|
105
|
+
onSearch: {
|
|
106
|
+
type: PropType<(params: Record<string, any>, action?: "reset" | "submit") => void>;
|
|
107
|
+
required: true;
|
|
108
|
+
};
|
|
109
|
+
onReset: {
|
|
110
|
+
type: PropType<(params: Record<string, any>) => void>;
|
|
111
|
+
default: any;
|
|
112
|
+
};
|
|
113
|
+
}>> & Readonly<{}>, {
|
|
114
|
+
loading: any;
|
|
115
|
+
formColumns: ProSearchMap<"text", string>[];
|
|
116
|
+
formConfig: FormConfig;
|
|
117
|
+
formAutoRequest: boolean;
|
|
118
|
+
formActions: {
|
|
119
|
+
reset?: boolean;
|
|
120
|
+
resetReload?: boolean;
|
|
121
|
+
searchText?: string;
|
|
122
|
+
resetText?: string;
|
|
123
|
+
};
|
|
124
|
+
cardBordered: boolean;
|
|
125
|
+
proClasses: Record<string, string>;
|
|
126
|
+
proStyles: Record<string, any>;
|
|
127
|
+
onReset: (params: Record<string, any>) => void;
|
|
128
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
129
|
+
//#endregion
|
|
130
|
+
export { ProTableSearchForm as default };
|