@qin-ui/antd-vue-pro 2.0.12 → 2.0.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/es/antd-vue-pro.css +19 -13
- package/es/form/index.js +4 -2
- package/es/index.d.ts +25 -7
- package/es/index.js +2 -1
- package/es/table/index.js +107 -85
- package/package.json +3 -1
package/es/antd-vue-pro.css
CHANGED
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
.
|
|
1
|
+
.pro-table_search-form[data-v-0bb2bc70] .ant-form-item {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.pro-table_search-form_expand-toggle-button[data-v-0bb2bc70] {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
padding: 0;
|
|
8
8
|
padding-left: 4px;
|
|
9
9
|
}
|
|
10
|
-
.transition[data-v-
|
|
10
|
+
.pro-table_search-form .transition[data-v-0bb2bc70] {
|
|
11
11
|
transition: all 0.25s;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.pro-table_search-form-container[data-v-c385cd54] {
|
|
14
14
|
margin-bottom: 24px;
|
|
15
15
|
padding: 24px;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.pro-table_table-container[data-v-ac3cdb51] {
|
|
18
18
|
flex: 1;
|
|
19
19
|
padding: 24px 24px 0;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.pro-table_size-control_button[data-v-0df8d4ae] {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
padding-right: 12px;
|
|
25
25
|
padding-left: 12px;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.pro-table_size-control_button[data-v-0df8d4ae] svg {
|
|
28
28
|
transform: scale(1.3);
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.pro-table_column-control_button[data-v-49bb3de5] {
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
padding-right: 12px;
|
|
34
34
|
padding-left: 12px;
|
|
35
35
|
}
|
|
36
|
-
.
|
|
36
|
+
.pro-table_column-control_button[data-v-49bb3de5] svg {
|
|
37
37
|
transform: scale(1.2, 1.4);
|
|
38
38
|
}
|
|
39
|
-
.pro-
|
|
39
|
+
.pro-table_header[data-v-54982423] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-
|
|
44
|
+
.pro-table_header[data-v-54982423]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-
|
|
47
|
+
.pro-table_header + .pro-table_header_content[data-v-54982423] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-
|
|
50
|
+
.pro-table_header_button-bar[data-v-54982423] {
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
.pro-table_header_toolbar[data-v-54982423] {
|
|
54
|
+
margin-left: 12px;
|
|
55
|
+
}
|
|
56
|
+
.pro-table[data-v-54982423] .ant-pagination .ant-pagination-total-text {
|
|
51
57
|
flex: 1;
|
|
52
58
|
}
|
package/es/form/index.js
CHANGED
|
@@ -37,7 +37,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
return (_a = unref(setFormRef)) == null ? void 0 : _a(el);
|
|
38
38
|
},
|
|
39
39
|
model: unref(formData)
|
|
40
|
-
}, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs))), {
|
|
40
|
+
}, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs)), { class: "pro-form" }), {
|
|
41
41
|
default: withCtx(() => [
|
|
42
42
|
createVNode(unref(_sfc_main$3), {
|
|
43
43
|
fields: unref(fields),
|
|
@@ -495,7 +495,8 @@ function useForm(...args) {
|
|
|
495
495
|
}
|
|
496
496
|
const initPropsMap = /* @__PURE__ */ new Map();
|
|
497
497
|
const getInitProps = (field) => {
|
|
498
|
-
const { component
|
|
498
|
+
const { component } = field;
|
|
499
|
+
const type = component === "input" ? "" : field.type;
|
|
499
500
|
if (COMPONENT_MAP.has(component)) {
|
|
500
501
|
const k = [component, type].filter(Boolean).join(".");
|
|
501
502
|
if (initPropsMap.has(k)) {
|
|
@@ -651,6 +652,7 @@ export {
|
|
|
651
652
|
_sfc_main as SlotComponent,
|
|
652
653
|
TeleportComponentNamePrefix,
|
|
653
654
|
_sfc_main$6 as default,
|
|
655
|
+
getInitProps,
|
|
654
656
|
useFields,
|
|
655
657
|
useForm,
|
|
656
658
|
useFormData
|
package/es/index.d.ts
CHANGED
|
@@ -260,7 +260,7 @@ declare type CompSlot<T extends string> = Partial<Record<KeyExpandString<T>, Slo
|
|
|
260
260
|
/**
|
|
261
261
|
* @description 容器组件类型
|
|
262
262
|
*/
|
|
263
|
-
export declare type ContainerComponent = Component<PathProps
|
|
263
|
+
export declare type ContainerComponent = Component<PathProps>;
|
|
264
264
|
|
|
265
265
|
export declare const ContainerFragment: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
266
266
|
|
|
@@ -289,13 +289,13 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
|
|
|
289
289
|
}>;
|
|
290
290
|
searchFormConfig?: Omit<SearchFormProps, "form"> & {
|
|
291
291
|
hidden?: boolean;
|
|
292
|
-
container?: ContainerComponent;
|
|
292
|
+
container?: ContainerComponent | false;
|
|
293
293
|
};
|
|
294
|
-
tableContainer?: ContainerComponent;
|
|
294
|
+
tableContainer?: ContainerComponent | false;
|
|
295
295
|
} & TableProps<any>) & Partial<{}>> & PublicProps;
|
|
296
296
|
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
297
297
|
attrs: any;
|
|
298
|
-
slots: Readonly<Omit<Readonly<{
|
|
298
|
+
slots: Readonly<Omit<Omit<Readonly<{
|
|
299
299
|
emptyText?: any;
|
|
300
300
|
expandIcon?: Slot<RenderExpandIconProps<any> | undefined> | undefined;
|
|
301
301
|
title?: any;
|
|
@@ -317,7 +317,15 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
|
|
|
317
317
|
customFilterIcon?: any;
|
|
318
318
|
customFilterDropdown?: any;
|
|
319
319
|
default: any;
|
|
320
|
-
}
|
|
320
|
+
}>, "bodyCell"> & Readonly<{
|
|
321
|
+
bodyCell?: (props: {
|
|
322
|
+
text: any;
|
|
323
|
+
value: any;
|
|
324
|
+
record: T extends Table<infer U extends Data> ? U : never;
|
|
325
|
+
index: number;
|
|
326
|
+
column: Column<T extends Table<infer U extends Data> ? U : never>;
|
|
327
|
+
}) => void;
|
|
328
|
+
}> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">> & Omit<Omit<Readonly<{
|
|
321
329
|
emptyText?: any;
|
|
322
330
|
expandIcon?: Slot<RenderExpandIconProps<any> | undefined> | undefined;
|
|
323
331
|
title?: any;
|
|
@@ -339,7 +347,15 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
|
|
|
339
347
|
customFilterIcon?: any;
|
|
340
348
|
customFilterDropdown?: any;
|
|
341
349
|
default: any;
|
|
342
|
-
}> &
|
|
350
|
+
}>, "bodyCell"> & Readonly<{
|
|
351
|
+
bodyCell?: (props: {
|
|
352
|
+
text: any;
|
|
353
|
+
value: any;
|
|
354
|
+
record: T extends Table<infer U extends Data> ? U : never;
|
|
355
|
+
index: number;
|
|
356
|
+
column: Column<T extends Table<infer U extends Data> ? U : never>;
|
|
357
|
+
}) => void;
|
|
358
|
+
}> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">;
|
|
343
359
|
emit: {};
|
|
344
360
|
}>) => VNode & {
|
|
345
361
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -464,6 +480,8 @@ declare type _FormProps = Pick<Partial<FormProps>, 'colon' | 'disabled' | 'hideR
|
|
|
464
480
|
|
|
465
481
|
declare type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelName'> & AllowedComponentProps>;
|
|
466
482
|
|
|
483
|
+
export declare const getInitProps: (field: Field) => Record<string, any>;
|
|
484
|
+
|
|
467
485
|
export declare type Grid = boolean | (RowProps & {});
|
|
468
486
|
|
|
469
487
|
export declare const INJECT_CONFIG: {
|
|
@@ -724,7 +742,7 @@ declare type RangePickerSlots = CompSlot<'dateRender' | 'renderExtraFooter' | 's
|
|
|
724
742
|
export declare type RenderComponentType = Component<VModelProps & PathProps>;
|
|
725
743
|
|
|
726
744
|
export declare type RequiredComponentVars = {
|
|
727
|
-
'pro-table': PP<TableProps & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn'>>;
|
|
745
|
+
'pro-table': PP<TableProps & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer'>>;
|
|
728
746
|
'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
|
|
729
747
|
grid: Exclude<Grid, undefined | boolean>;
|
|
730
748
|
}>;
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./antd-vue-pro.css";
|
|
2
2
|
import _sfc_main from "./form/index.js";
|
|
3
|
-
import { BaseField, BaseFormItem, COMPONENT_MAP, ContainerFragment, FORM_ITEM_SLOT_KEYS, InjectionFormKey, InjectionPathKey, SlotComponent, TeleportComponentNamePrefix, useFields, useForm, useFormData } from "./form/index.js";
|
|
3
|
+
import { BaseField, BaseFormItem, COMPONENT_MAP, ContainerFragment, FORM_ITEM_SLOT_KEYS, InjectionFormKey, InjectionPathKey, SlotComponent, TeleportComponentNamePrefix, getInitProps, useFields, useForm, useFormData } from "./form/index.js";
|
|
4
4
|
import BaseTable from "./table/index.js";
|
|
5
5
|
import { useTable } from "./table/index.js";
|
|
6
6
|
import { _ as _sfc_main$1 } from "./component-provider/index-DXPHmG1H.js";
|
|
@@ -38,6 +38,7 @@ export {
|
|
|
38
38
|
SlotComponent,
|
|
39
39
|
TeleportComponentNamePrefix,
|
|
40
40
|
index as default,
|
|
41
|
+
getInitProps,
|
|
41
42
|
useFields,
|
|
42
43
|
useForm,
|
|
43
44
|
useFormData,
|
package/es/table/index.js
CHANGED
|
@@ -151,10 +151,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
151
151
|
return (_ctx, _cache) => {
|
|
152
152
|
return openBlock(), createBlock(unref(_sfc_main$9), mergeProps(layoutProps.value, {
|
|
153
153
|
form: _ctx.form,
|
|
154
|
-
class: "
|
|
154
|
+
class: "pro-table_search-form transition"
|
|
155
155
|
}), {
|
|
156
156
|
default: withCtx(() => [
|
|
157
|
-
createVNode(unref(Space), {
|
|
157
|
+
createVNode(unref(Space), {
|
|
158
|
+
align: "start",
|
|
159
|
+
class: "pro-table_search-form_button-group"
|
|
160
|
+
}, {
|
|
158
161
|
default: withCtx(() => [
|
|
159
162
|
renderSlot(_ctx.$slots, "reset-button", { onClick: onReset }, () => [
|
|
160
163
|
_ctx.resetButton ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.resetButton), {
|
|
@@ -162,6 +165,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
162
165
|
onClick: onReset
|
|
163
166
|
})) : (openBlock(), createBlock(unref(Button), {
|
|
164
167
|
key: 1,
|
|
168
|
+
class: "pro-table_search-form_reset-button",
|
|
165
169
|
onClick: onReset
|
|
166
170
|
}, {
|
|
167
171
|
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
@@ -177,6 +181,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
177
181
|
onClick: onSearch
|
|
178
182
|
})) : (openBlock(), createBlock(unref(Button), {
|
|
179
183
|
key: 1,
|
|
184
|
+
class: "pro-table_search-form_search-button",
|
|
180
185
|
type: "primary",
|
|
181
186
|
"html-type": "submit",
|
|
182
187
|
onClick: onSearch
|
|
@@ -197,7 +202,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
197
202
|
}, null, 8, ["expand-status"])) : (openBlock(), createBlock(unref(Button), {
|
|
198
203
|
key: 1,
|
|
199
204
|
type: "link",
|
|
200
|
-
class: "
|
|
205
|
+
class: "pro-table_search-form_expand-toggle-button",
|
|
201
206
|
onClick: changeExpandStatus
|
|
202
207
|
}, {
|
|
203
208
|
default: withCtx(() => [
|
|
@@ -220,7 +225,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
220
225
|
};
|
|
221
226
|
}
|
|
222
227
|
});
|
|
223
|
-
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
228
|
+
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-0bb2bc70"]]);
|
|
224
229
|
function useModel(props, name, options) {
|
|
225
230
|
const eventName = `onUpdate:${name}`;
|
|
226
231
|
const emitUpdate = props[eventName];
|
|
@@ -240,7 +245,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
240
245
|
const { token } = theme.useToken();
|
|
241
246
|
return (_ctx, _cache) => {
|
|
242
247
|
return openBlock(), createElementBlock("div", {
|
|
243
|
-
class: "
|
|
248
|
+
class: "pro-table_search-form-container",
|
|
244
249
|
style: normalizeStyle({ backgroundColor: unref(token).colorBgContainer })
|
|
245
250
|
}, [
|
|
246
251
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -248,14 +253,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
248
253
|
};
|
|
249
254
|
}
|
|
250
255
|
});
|
|
251
|
-
const DefaultSearchFormContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
256
|
+
const DefaultSearchFormContainer = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-c385cd54"]]);
|
|
252
257
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
253
258
|
__name: "DefaultTableContainer",
|
|
254
259
|
setup(__props) {
|
|
255
260
|
const { token } = theme.useToken();
|
|
256
261
|
return (_ctx, _cache) => {
|
|
257
262
|
return openBlock(), createElementBlock("div", {
|
|
258
|
-
class: "
|
|
263
|
+
class: "pro-table_table-container",
|
|
259
264
|
style: normalizeStyle({ backgroundColor: unref(token).colorBgContainer })
|
|
260
265
|
}, [
|
|
261
266
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -263,7 +268,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
263
268
|
};
|
|
264
269
|
}
|
|
265
270
|
});
|
|
266
|
-
const DefaultTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
271
|
+
const DefaultTableContainer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ac3cdb51"]]);
|
|
267
272
|
const _sfc_main$4 = {};
|
|
268
273
|
const _hoisted_1$2 = {
|
|
269
274
|
focusable: "false",
|
|
@@ -308,12 +313,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
308
313
|
"selected-keys": unref(size) ? [unref(size)] : [],
|
|
309
314
|
items: sizeOptions,
|
|
310
315
|
onClick: onSizeChange
|
|
311
|
-
}, null, 8, ["selected-keys"
|
|
316
|
+
}, null, 8, ["selected-keys"])
|
|
312
317
|
]),
|
|
313
318
|
default: withCtx(() => [
|
|
314
319
|
createVNode(unref(Button), {
|
|
315
320
|
type: "text",
|
|
316
|
-
class: "
|
|
321
|
+
class: "pro-table_size-control_button"
|
|
317
322
|
}, {
|
|
318
323
|
default: withCtx(() => [
|
|
319
324
|
createVNode(ColumnHeightOutlined)
|
|
@@ -326,7 +331,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
326
331
|
};
|
|
327
332
|
}
|
|
328
333
|
});
|
|
329
|
-
const SizeControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
334
|
+
const SizeControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0df8d4ae"]]);
|
|
330
335
|
const _sfc_main$2 = {};
|
|
331
336
|
const _hoisted_1$1 = {
|
|
332
337
|
focusable: "false",
|
|
@@ -408,61 +413,59 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
408
413
|
placement: "bottomRight"
|
|
409
414
|
}, {
|
|
410
415
|
overlay: withCtx(() => [
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
createVNode(unref(Menu), {
|
|
417
|
+
style: { "min-width": "100px", "max-height": "500px", "overflow-y": "scroll" },
|
|
418
|
+
selectable: false
|
|
419
|
+
}, {
|
|
420
|
+
default: withCtx(() => [
|
|
421
|
+
(openBlock(), createBlock(unref(MenuItem), { key: 0 }, {
|
|
422
|
+
default: withCtx(() => [
|
|
423
|
+
createElementVNode("div", null, [
|
|
424
|
+
createVNode(unref(Checkbox), {
|
|
425
|
+
checked: checkAll.value,
|
|
426
|
+
indeterminate: indeterminate.value,
|
|
427
|
+
onChange: onCheckAllChange
|
|
428
|
+
}, {
|
|
429
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
430
|
+
createTextVNode(" 全选 ", -1)
|
|
431
|
+
])),
|
|
432
|
+
_: 1,
|
|
433
|
+
__: [2]
|
|
434
|
+
}, 8, ["checked", "indeterminate"])
|
|
435
|
+
])
|
|
436
|
+
]),
|
|
437
|
+
_: 1
|
|
438
|
+
})),
|
|
439
|
+
createVNode(unref(MenuDivider)),
|
|
440
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(checkedColumnsOptions.value, (item) => {
|
|
441
|
+
return openBlock(), createBlock(unref(MenuItem), {
|
|
442
|
+
key: item.value,
|
|
443
|
+
onClick: ($event) => checkColumnsMenuItemClick(item.value)
|
|
444
|
+
}, {
|
|
418
445
|
default: withCtx(() => [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}, 8, ["checked", "indeterminate"])
|
|
431
|
-
])
|
|
446
|
+
createVNode(unref(Checkbox), {
|
|
447
|
+
checked: checkedColumnKeys.value.includes(item.value)
|
|
448
|
+
}, {
|
|
449
|
+
default: withCtx(() => [
|
|
450
|
+
createElementVNode("div", {
|
|
451
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
452
|
+
}, ["stop"]))
|
|
453
|
+
}, toDisplayString(item.label), 1)
|
|
454
|
+
]),
|
|
455
|
+
_: 2
|
|
456
|
+
}, 1032, ["checked"])
|
|
432
457
|
]),
|
|
433
|
-
_:
|
|
434
|
-
})
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
onClick: ($event) => checkColumnsMenuItemClick(item.value)
|
|
440
|
-
}, {
|
|
441
|
-
default: withCtx(() => [
|
|
442
|
-
createVNode(unref(Checkbox), {
|
|
443
|
-
checked: checkedColumnKeys.value.includes(item.value)
|
|
444
|
-
}, {
|
|
445
|
-
default: withCtx(() => [
|
|
446
|
-
createElementVNode("div", {
|
|
447
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
448
|
-
}, ["stop"]))
|
|
449
|
-
}, toDisplayString(item.label), 1)
|
|
450
|
-
]),
|
|
451
|
-
_: 2
|
|
452
|
-
}, 1032, ["checked"])
|
|
453
|
-
]),
|
|
454
|
-
_: 2
|
|
455
|
-
}, 1032, ["onClick"]);
|
|
456
|
-
}), 128))
|
|
457
|
-
]),
|
|
458
|
-
_: 1
|
|
459
|
-
})
|
|
460
|
-
])
|
|
458
|
+
_: 2
|
|
459
|
+
}, 1032, ["onClick"]);
|
|
460
|
+
}), 128))
|
|
461
|
+
]),
|
|
462
|
+
_: 1
|
|
463
|
+
})
|
|
461
464
|
]),
|
|
462
465
|
default: withCtx(() => [
|
|
463
466
|
createVNode(unref(Button), {
|
|
464
467
|
type: "text",
|
|
465
|
-
class: "
|
|
468
|
+
class: "pro-table_column-control_button"
|
|
466
469
|
}, {
|
|
467
470
|
default: withCtx(() => [
|
|
468
471
|
createVNode(FilterOutlined)
|
|
@@ -475,18 +478,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
475
478
|
};
|
|
476
479
|
}
|
|
477
480
|
});
|
|
478
|
-
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
479
|
-
const _hoisted_1 = { class: "pro-
|
|
481
|
+
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-49bb3de5"]]);
|
|
482
|
+
const _hoisted_1 = { class: "pro-table_header" };
|
|
480
483
|
const _hoisted_2 = {
|
|
481
484
|
key: 0,
|
|
482
|
-
|
|
485
|
+
class: "pro-table_header_button-bar"
|
|
483
486
|
};
|
|
484
487
|
const _hoisted_3 = {
|
|
485
488
|
key: 1,
|
|
486
|
-
|
|
489
|
+
class: "pro-table_header_toolbar"
|
|
490
|
+
};
|
|
491
|
+
const _hoisted_4 = {
|
|
492
|
+
key: 2,
|
|
493
|
+
class: "pro-table_header_size-control"
|
|
494
|
+
};
|
|
495
|
+
const _hoisted_5 = {
|
|
496
|
+
key: 3,
|
|
497
|
+
class: "pro-table_header_column-control"
|
|
487
498
|
};
|
|
488
|
-
const _hoisted_4 = { key: 2 };
|
|
489
|
-
const _hoisted_5 = { key: 3 };
|
|
490
499
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
491
500
|
...{ name: "ProTable", inheritAttrs: false },
|
|
492
501
|
__name: "BaseTable",
|
|
@@ -497,7 +506,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
497
506
|
immediateSearch: { type: Boolean, default: void 0 },
|
|
498
507
|
control: { type: [Boolean, Object], default: void 0 },
|
|
499
508
|
searchFormConfig: { default: void 0 },
|
|
500
|
-
tableContainer: { default:
|
|
509
|
+
tableContainer: { type: Boolean, default: void 0 }
|
|
501
510
|
},
|
|
502
511
|
setup(__props) {
|
|
503
512
|
const props = __props;
|
|
@@ -506,10 +515,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
506
515
|
const tableProperties = Object.keys(tableProps());
|
|
507
516
|
const injectAttrs = pick(injectProps, tableProperties);
|
|
508
517
|
const computedSearchFormConfig = computed(() => {
|
|
518
|
+
var _a, _b;
|
|
519
|
+
const container = ((_a = props.searchFormConfig) == null ? void 0 : _a.container) ?? ((_b = injectProps.searchFormConfig) == null ? void 0 : _b.container) ?? DefaultSearchFormContainer;
|
|
509
520
|
return {
|
|
510
|
-
container: DefaultSearchFormContainer,
|
|
511
521
|
...injectProps.searchFormConfig,
|
|
512
|
-
...getObject(props.searchFormConfig)
|
|
522
|
+
...getObject(props.searchFormConfig),
|
|
523
|
+
container: container ? container : void 0
|
|
513
524
|
};
|
|
514
525
|
});
|
|
515
526
|
const attrs = useAttrs();
|
|
@@ -549,7 +560,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
549
560
|
_search();
|
|
550
561
|
};
|
|
551
562
|
const computedTableProps = computed(() => {
|
|
552
|
-
return {
|
|
563
|
+
return {
|
|
564
|
+
...injectAttrs,
|
|
565
|
+
...tableAttrs.value,
|
|
566
|
+
pagination: void 0,
|
|
567
|
+
onChange: void 0
|
|
568
|
+
};
|
|
569
|
+
});
|
|
570
|
+
const computedTableContainer = computed(() => {
|
|
571
|
+
const container = props.tableContainer ?? injectProps.tableContainer ?? DefaultTableContainer;
|
|
572
|
+
return container ? container : void 0;
|
|
553
573
|
});
|
|
554
574
|
const indexColumn = {
|
|
555
575
|
title: "序号",
|
|
@@ -557,19 +577,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
557
577
|
width: 80,
|
|
558
578
|
customRender: ({ index }) => index + 1
|
|
559
579
|
};
|
|
560
|
-
const computedColumns = computed(
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
580
|
+
const computedColumns = computed(
|
|
581
|
+
() => [
|
|
582
|
+
...props.addIndexColumn ?? injectProps.addIndexColumn ? [indexColumn] : [],
|
|
583
|
+
...(tableAttrs.value.columns ?? (columns == null ? void 0 : columns.value) ?? []).flatMap(
|
|
584
|
+
(item, index) => {
|
|
585
|
+
if (item.key) return [{ ...item, key: item.key }];
|
|
586
|
+
if (item.dataIndex) {
|
|
587
|
+
const dataIndexKey = Array.isArray(item.dataIndex) ? item.dataIndex.join(".") : item.dataIndex;
|
|
588
|
+
return [{ ...item, key: dataIndexKey }];
|
|
589
|
+
}
|
|
590
|
+
return [{ ...item, key: index }];
|
|
568
591
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
]);
|
|
592
|
+
)
|
|
593
|
+
]
|
|
594
|
+
);
|
|
573
595
|
const visibleComputedColumns = computed(() => {
|
|
574
596
|
return computedColumns.value.filter((item) => !item.hidden);
|
|
575
597
|
});
|
|
@@ -627,7 +649,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
627
649
|
]),
|
|
628
650
|
_: 3
|
|
629
651
|
}, 8, ["component"])) : createCommentVNode("", true),
|
|
630
|
-
createVNode(unref(_sfc_main$a), { component:
|
|
652
|
+
createVNode(unref(_sfc_main$a), { component: computedTableContainer.value }, {
|
|
631
653
|
default: withCtx(() => [
|
|
632
654
|
createElementVNode("div", _hoisted_1, [
|
|
633
655
|
unref(buttonBarSlot) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
@@ -650,7 +672,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
650
672
|
])) : createCommentVNode("", true)
|
|
651
673
|
]),
|
|
652
674
|
renderSlot(_ctx.$slots, "table", {}, () => [
|
|
653
|
-
createVNode(unref(Table), mergeProps({ class: "pro-
|
|
675
|
+
createVNode(unref(Table), mergeProps({ class: "pro-table_content" }, computedTableProps.value, {
|
|
654
676
|
size: unref(size),
|
|
655
677
|
loading: unref(loading),
|
|
656
678
|
columns: visibleComputedColumns.value,
|
|
@@ -675,7 +697,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
675
697
|
};
|
|
676
698
|
}
|
|
677
699
|
});
|
|
678
|
-
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
700
|
+
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-54982423"]]);
|
|
679
701
|
const getDefaultPageParam = () => ({ current: 1, pageSize: 10, total: 0 });
|
|
680
702
|
const pageParamProperty = ["current", "pageSize", "total"];
|
|
681
703
|
const useTable = (params) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qin-ui/antd-vue-pro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "二次封装antd vue组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -36,8 +36,10 @@
|
|
|
36
36
|
"url": "https://github.com/dufan3715/pro-components/issues"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@types/lodash-es": "^4.17.12",
|
|
39
40
|
"ant-design-vue": "^4",
|
|
40
41
|
"lodash-es": "^4.17.21",
|
|
42
|
+
"scroll-into-view-if-needed": "^3.1.0",
|
|
41
43
|
"vue": "^3.5.18",
|
|
42
44
|
"vue-component-type-helpers": "^3.0.1"
|
|
43
45
|
},
|