@qin-ui/antd-vue-pro 2.4.0 → 2.4.2
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/api.json +1 -1
- package/es/antd-vue-pro.css +11 -11
- package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
- package/es/{src/components → components}/component-provider/constants/index.d.ts +2 -2
- package/es/components/component-provider/constants/index.d.ts.map +1 -0
- package/es/components/component-provider/index.d.ts.map +1 -0
- package/es/components/component-provider/types/index.d.ts.map +1 -0
- package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
- package/es/{src/components → components}/form/components/BaseField/utils/index.d.ts +1 -0
- package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
- package/es/components/form/components/index.d.ts.map +1 -0
- package/es/components/form/constants/index.d.ts.map +1 -0
- package/es/components/form/hooks/index.d.ts.map +1 -0
- package/es/components/form/hooks/useFields.d.ts.map +1 -0
- package/es/components/form/hooks/useForm.d.ts.map +1 -0
- package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
- package/es/components/form/hooks/useGroupFieldAttrs.d.ts.map +1 -0
- package/es/components/form/index.d.ts.map +1 -0
- package/es/components/form/types/index.d.ts.map +1 -0
- package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
- package/es/{src/components → components}/table/components/ProTable.vue.d.ts +4 -1
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
- package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
- package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/index.d.ts.map +1 -0
- package/es/components/table/hooks/index.d.ts.map +1 -0
- package/es/components/table/hooks/useTable.d.ts.map +1 -0
- package/es/components/table/index.d.ts.map +1 -0
- package/es/{src/components → components}/table/types/index.d.ts +1 -1
- package/es/components/table/types/index.d.ts.map +1 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +111 -229
- package/es/index.js.map +1 -1
- package/es/{src/locale → locale}/index.d.ts +1 -1
- package/es/locale/index.d.ts.map +1 -0
- package/es/shared/core/index.d.ts +6 -0
- package/es/shared/core/index.d.ts.map +1 -0
- package/es/shared/ui/index.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/component-provider/components/index.vue +4 -3
- package/src/components/component-provider/constants/index.ts +4 -3
- package/src/components/form/components/BaseField/index.vue +3 -6
- package/src/components/form/components/BaseField/utils/index.ts +11 -0
- package/src/components/form/components/BaseFormItem/index.vue +2 -1
- package/src/components/form/components/ProForm/index.vue +23 -23
- package/src/components/form/hooks/useGroupFieldAttrs.ts +9 -3
- package/src/components/table/components/ColumnControl.vue +8 -10
- package/src/components/table/components/ProTable.vue +74 -31
- package/src/components/table/components/SearchForm.vue +8 -182
- package/src/components/table/types/index.ts +1 -1
- package/src/locale/index.ts +1 -1
- package/src/shared/core/index.ts +11 -0
- package/es/__tests__/BaseField.spec.d.ts +0 -2
- package/es/__tests__/BaseField.spec.d.ts.map +0 -1
- package/es/__tests__/BaseFormItem.spec.d.ts +0 -2
- package/es/__tests__/BaseFormItem.spec.d.ts.map +0 -1
- package/es/__tests__/ProForm.spec.d.ts +0 -2
- package/es/__tests__/ProForm.spec.d.ts.map +0 -1
- package/es/__tests__/ProTable.spec.d.ts +0 -2
- package/es/__tests__/ProTable.spec.d.ts.map +0 -1
- package/es/__tests__/SearchForm.spec.d.ts +0 -2
- package/es/__tests__/SearchForm.spec.d.ts.map +0 -1
- package/es/__tests__/controls.spec.d.ts +0 -2
- package/es/__tests__/controls.spec.d.ts.map +0 -1
- package/es/__tests__/helpers/fixtures.d.ts +0 -15
- package/es/__tests__/helpers/fixtures.d.ts.map +0 -1
- package/es/__tests__/helpers/mount.d.ts +0 -38
- package/es/__tests__/helpers/mount.d.ts.map +0 -1
- package/es/__tests__/hooks-locale.spec.d.ts +0 -2
- package/es/__tests__/hooks-locale.spec.d.ts.map +0 -1
- package/es/__tests__/index.spec.d.ts +0 -2
- package/es/__tests__/index.spec.d.ts.map +0 -1
- package/es/__tests__/integration.spec.d.ts +0 -2
- package/es/__tests__/integration.spec.d.ts.map +0 -1
- package/es/__tests__/setup.d.ts +0 -14
- package/es/__tests__/setup.d.ts.map +0 -1
- package/es/src/components/component-provider/components/index.vue.d.ts.map +0 -1
- package/es/src/components/component-provider/constants/index.d.ts.map +0 -1
- package/es/src/components/component-provider/index.d.ts.map +0 -1
- package/es/src/components/component-provider/types/index.d.ts.map +0 -1
- package/es/src/components/form/components/BaseField/index.vue.d.ts.map +0 -1
- package/es/src/components/form/components/BaseField/utils/index.d.ts.map +0 -1
- package/es/src/components/form/components/BaseFormItem/index.vue.d.ts.map +0 -1
- package/es/src/components/form/components/ContainerFragment/index.vue.d.ts.map +0 -1
- package/es/src/components/form/components/ProForm/index.vue.d.ts.map +0 -1
- package/es/src/components/form/components/SlotComponent/index.vue.d.ts.map +0 -1
- package/es/src/components/form/components/index.d.ts.map +0 -1
- package/es/src/components/form/constants/index.d.ts.map +0 -1
- package/es/src/components/form/hooks/index.d.ts.map +0 -1
- package/es/src/components/form/hooks/useFields.d.ts.map +0 -1
- package/es/src/components/form/hooks/useForm.d.ts.map +0 -1
- package/es/src/components/form/hooks/useFormRef.d.ts.map +0 -1
- package/es/src/components/form/hooks/useGroupFieldAttrs.d.ts.map +0 -1
- package/es/src/components/form/index.d.ts.map +0 -1
- package/es/src/components/form/types/index.d.ts.map +0 -1
- package/es/src/components/table/components/ColumnControl.vue.d.ts.map +0 -1
- package/es/src/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +0 -1
- package/es/src/components/table/components/DefaultTableContainer.vue.d.ts.map +0 -1
- package/es/src/components/table/components/ProTable.vue.d.ts.map +0 -1
- package/es/src/components/table/components/SearchForm.vue.d.ts.map +0 -1
- package/es/src/components/table/components/SizeControl.vue.d.ts.map +0 -1
- package/es/src/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +0 -1
- package/es/src/components/table/components/icons/DownOutlined.vue.d.ts.map +0 -1
- package/es/src/components/table/components/icons/FilterOutlined.vue.d.ts.map +0 -1
- package/es/src/components/table/components/index.d.ts.map +0 -1
- package/es/src/components/table/hooks/index.d.ts.map +0 -1
- package/es/src/components/table/hooks/useTable.d.ts.map +0 -1
- package/es/src/components/table/index.d.ts.map +0 -1
- package/es/src/components/table/types/index.d.ts.map +0 -1
- package/es/src/index.d.ts.map +0 -1
- package/es/src/locale/index.d.ts.map +0 -1
- package/es/src/shared/core/index.d.ts +0 -6
- package/es/src/shared/core/index.d.ts.map +0 -1
- package/es/src/shared/ui/index.d.ts.map +0 -1
- /package/es/{src/components → components}/component-provider/components/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/component-provider/index.d.ts +0 -0
- /package/es/{src/components → components}/component-provider/types/index.d.ts +0 -0
- /package/es/{src/components → components}/form/components/BaseField/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/form/components/BaseFormItem/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/form/components/ContainerFragment/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/form/components/ProForm/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/form/components/SlotComponent/index.vue.d.ts +0 -0
- /package/es/{src/components → components}/form/components/index.d.ts +0 -0
- /package/es/{src/components → components}/form/constants/index.d.ts +0 -0
- /package/es/{src/components → components}/form/hooks/index.d.ts +0 -0
- /package/es/{src/components → components}/form/hooks/useFields.d.ts +0 -0
- /package/es/{src/components → components}/form/hooks/useForm.d.ts +0 -0
- /package/es/{src/components → components}/form/hooks/useFormRef.d.ts +0 -0
- /package/es/{src/components → components}/form/hooks/useGroupFieldAttrs.d.ts +0 -0
- /package/es/{src/components → components}/form/index.d.ts +0 -0
- /package/es/{src/components → components}/form/types/index.d.ts +0 -0
- /package/es/{src/components → components}/table/components/ColumnControl.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/DefaultSearchFormContainer.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/DefaultTableContainer.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/SearchForm.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/SizeControl.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/icons/ColumnHeightOutlined.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/icons/DownOutlined.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/icons/FilterOutlined.vue.d.ts +0 -0
- /package/es/{src/components → components}/table/components/index.d.ts +0 -0
- /package/es/{src/components → components}/table/hooks/index.d.ts +0 -0
- /package/es/{src/components → components}/table/hooks/useTable.d.ts +0 -0
- /package/es/{src/components → components}/table/index.d.ts +0 -0
- /package/es/{src/index.d.ts → index.d.ts} +0 -0
- /package/es/{src/shared → shared}/ui/index.d.ts +0 -0
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./antd-vue-pro.css";
|
|
2
|
-
import { inject, computed, toValue, mergeProps, defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, createSlots, toRaw, ref, useAttrs, createCommentVNode, resolveDynamicComponent, renderSlot, normalizeProps, isVNode, createTextVNode, toDisplayString, provide, useSlots, createElementVNode,
|
|
2
|
+
import { inject, computed, toValue, mergeProps, defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, createSlots, toRaw, ref, useAttrs, createCommentVNode, resolveDynamicComponent, renderSlot, normalizeProps, isVNode, createTextVNode, toDisplayString, provide, useSlots, createElementVNode, normalizeStyle, useModel, watch, mergeModels, onMounted, normalizeClass, nextTick } from "vue";
|
|
3
3
|
import { Transfer, TreeSelect, Slider, Switch, RadioGroup, CheckboxGroup, TimePicker, RangePicker, DatePicker, Cascader, Select, InputNumber, InputPassword, InputSearch, Textarea, Input, Row, Col, FormItem, Form, Space, Button, theme, Dropdown, Menu, MenuItem, Checkbox, MenuDivider, Table } from "ant-design-vue";
|
|
4
|
-
import { isPlainObject, getObject, toPath, useForm as useForm$1, resolveLocaleName, zhTW, enUS, zhCN, format, cloneDeep, InjectionFormSlotsKey, InjectionFormKey, camelizeProperties, useFields as useFields$1, useFormRef as useFormRef$1, pick, isPromise, useTable as useTable$1 } from "@qin-ui/pro-components-core";
|
|
4
|
+
import { isPlainObject, getObject, toPath, useForm as useForm$1, resolveLocaleName, zhTW, enUS, zhCN, format, cloneDeep, InjectionFormSlotsKey, createFormProxy, InjectionFormKey, camelizeProperties, useFields as useFields$1, useFormRef as useFormRef$1, useSearchFormExpand, pick, isPromise, useTable as useTable$1 } from "@qin-ui/pro-components-core";
|
|
5
5
|
import { enUS as enUS2, useFormData, zhCN as zhCN2, zhTW as zhTW2 } from "@qin-ui/pro-components-core";
|
|
6
6
|
import { colProps } from "ant-design-vue/es/grid/Col";
|
|
7
7
|
import { formItemProps, useInjectFormItemContext } from "ant-design-vue/es/form";
|
|
@@ -64,7 +64,7 @@ const INJECT_CONFIG = {
|
|
|
64
64
|
injectionKey: Symbol(""),
|
|
65
65
|
default: {
|
|
66
66
|
max: 10 ** 15 - 1,
|
|
67
|
-
min: -
|
|
67
|
+
min: -999999999999999,
|
|
68
68
|
controls: false,
|
|
69
69
|
style: { width: "100%" }
|
|
70
70
|
}
|
|
@@ -176,6 +176,8 @@ const formItemPropKeys = Object.keys(formItemProps()).concat([
|
|
|
176
176
|
"formItemContainer"
|
|
177
177
|
]);
|
|
178
178
|
const gridItemPropKeys = Object.keys(colProps());
|
|
179
|
+
const gridItemPropKeySet = new Set(gridItemPropKeys);
|
|
180
|
+
const formItemPropKeySet = new Set(formItemPropKeys);
|
|
179
181
|
function useGroupFieldAttrs(validFields) {
|
|
180
182
|
const config = INJECT_CONFIG["pro-form-item"];
|
|
181
183
|
const injectFormItemProps = inject(config.injectionKey, config.default);
|
|
@@ -198,10 +200,12 @@ function useGroupFieldAttrs(validFields) {
|
|
|
198
200
|
lg,
|
|
199
201
|
xl,
|
|
200
202
|
xxl,
|
|
203
|
+
formItemContainer: injectFormItemContainer,
|
|
201
204
|
...injectRest
|
|
202
205
|
} = rawInject;
|
|
203
206
|
const initGridItemProps = span || span === 0 ? { span } : { xs, sm, md, lg, xl, xxl, span: injectSpan };
|
|
204
207
|
gridItemProps2 = fields ? { span: span ?? 24 } : initGridItemProps;
|
|
208
|
+
const container = formItemContainer ?? injectFormItemContainer;
|
|
205
209
|
formItemProps2 = mergeProps(
|
|
206
210
|
injectRest,
|
|
207
211
|
{ class: injectClassName, style: injectStyle },
|
|
@@ -209,9 +213,9 @@ function useGroupFieldAttrs(validFields) {
|
|
|
209
213
|
formItemDataAttrs
|
|
210
214
|
);
|
|
211
215
|
Object.keys(rest).forEach((k) => {
|
|
212
|
-
if (
|
|
216
|
+
if (gridItemPropKeySet.has(k)) {
|
|
213
217
|
gridItemProps2[k] = rest[k];
|
|
214
|
-
} else if (
|
|
218
|
+
} else if (formItemPropKeySet.has(k)) {
|
|
215
219
|
formItemProps2[k] = rest[k];
|
|
216
220
|
} else {
|
|
217
221
|
componentProps[k] = rest[k];
|
|
@@ -232,7 +236,7 @@ function useGroupFieldAttrs(validFields) {
|
|
|
232
236
|
formItemProps: formItemProps2,
|
|
233
237
|
formItemSlots,
|
|
234
238
|
componentProps,
|
|
235
|
-
formItemContainer,
|
|
239
|
+
formItemContainer: container,
|
|
236
240
|
rawField: field
|
|
237
241
|
};
|
|
238
242
|
}
|
|
@@ -259,7 +263,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
259
263
|
setup(__props) {
|
|
260
264
|
const props = __props;
|
|
261
265
|
const validFields = computed(
|
|
262
|
-
() => (
|
|
266
|
+
() => (
|
|
267
|
+
// hidden 支持 Ref/ComputedRef/getter 等响应式形态(统一使用 toValue 取值)
|
|
268
|
+
(props.fields ?? []).filter((field) => !toValue(field.hidden))
|
|
269
|
+
)
|
|
263
270
|
);
|
|
264
271
|
useProviderDisabled(computed(() => props.disabled));
|
|
265
272
|
const config = INJECT_CONFIG["pro-form"];
|
|
@@ -395,6 +402,14 @@ const getInitProps = (field, injectProps = {}, t) => {
|
|
|
395
402
|
}
|
|
396
403
|
return {};
|
|
397
404
|
};
|
|
405
|
+
const warnedUnknownComponents = /* @__PURE__ */ new Set();
|
|
406
|
+
function warnUnknownComponent(name) {
|
|
407
|
+
if (warnedUnknownComponents.has(name)) return;
|
|
408
|
+
warnedUnknownComponents.add(name);
|
|
409
|
+
console.warn(
|
|
410
|
+
`[pro-components] 未识别的组件类型 "${name}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
|
|
411
|
+
);
|
|
412
|
+
}
|
|
398
413
|
const LOCALE_INJECT_KEY = Symbol("pro-locale");
|
|
399
414
|
const useLocale = () => {
|
|
400
415
|
const config = useConfigContextInject();
|
|
@@ -472,7 +487,6 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
472
487
|
initProps,
|
|
473
488
|
attrs,
|
|
474
489
|
{ class: attrs.componentClass, style: attrs.componentStyle },
|
|
475
|
-
{ class: initProps.componentClass, style: initProps.componentStyle },
|
|
476
490
|
{ disabled: attrs.disabled ?? parentDisabled.value ?? initProps.disabled },
|
|
477
491
|
{ modelProp: effectiveModelProp }
|
|
478
492
|
);
|
|
@@ -488,14 +502,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
488
502
|
const formSlots = inject(InjectionFormSlotsKey, void 0);
|
|
489
503
|
const customComponents = inject(INJECT_COMPONENTS, {});
|
|
490
504
|
const is = computed(() => {
|
|
505
|
+
var _a;
|
|
491
506
|
const teleportSlot = props.path && (formSlots == null ? void 0 : formSlots[props.path]);
|
|
492
507
|
if (teleportSlot) return teleportSlot;
|
|
493
508
|
if (typeof props.component === "string") {
|
|
494
|
-
const resolved = customComponents[props.component] || componentMap[props.component];
|
|
509
|
+
const resolved = ((_a = toValue(customComponents)) == null ? void 0 : _a[props.component]) || componentMap[props.component];
|
|
495
510
|
if (resolved) return resolved;
|
|
496
|
-
|
|
497
|
-
`[pro-components] 未识别的组件类型 "${props.component}",已降级为原生元素渲染。如为自定义组件请在 componentMap 或 ProComponentProvider 中注册。`
|
|
498
|
-
);
|
|
511
|
+
warnUnknownComponent(props.component);
|
|
499
512
|
return props.component;
|
|
500
513
|
}
|
|
501
514
|
return props.component;
|
|
@@ -580,28 +593,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
580
593
|
const currentForm = computed(
|
|
581
594
|
() => props.form ?? fallbackForm
|
|
582
595
|
);
|
|
583
|
-
const formProxy =
|
|
584
|
-
get(_, prop) {
|
|
585
|
-
const target = currentForm.value;
|
|
586
|
-
const val = target == null ? void 0 : target[prop];
|
|
587
|
-
if (typeof val === "function") {
|
|
588
|
-
return (...args) => {
|
|
589
|
-
var _a, _b;
|
|
590
|
-
return (_b = (_a = currentForm.value) == null ? void 0 : _a[prop]) == null ? void 0 : _b.call(_a, ...args);
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
return val;
|
|
594
|
-
},
|
|
595
|
-
set(_, prop, value) {
|
|
596
|
-
if (currentForm.value) {
|
|
597
|
-
currentForm.value[prop] = value;
|
|
598
|
-
}
|
|
599
|
-
return true;
|
|
600
|
-
},
|
|
601
|
-
has(_, prop) {
|
|
602
|
-
return Boolean(currentForm.value && prop in currentForm.value);
|
|
603
|
-
}
|
|
604
|
-
});
|
|
596
|
+
const formProxy = createFormProxy(() => currentForm.value);
|
|
605
597
|
provide(InjectionFormKey, formProxy);
|
|
606
598
|
const fields = computed(() => {
|
|
607
599
|
var _a;
|
|
@@ -627,11 +619,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
627
619
|
const formKey = computed(() => getFormKey(currentForm.value));
|
|
628
620
|
const config = INJECT_CONFIG["pro-form"];
|
|
629
621
|
const injectFormConfig = inject(config.injectionKey, config.default);
|
|
622
|
+
const attrs = useAttrs();
|
|
630
623
|
const injectAttrs = computed(() => {
|
|
631
624
|
const raw = toValue(injectFormConfig);
|
|
632
625
|
const { grid: _injectGrid, ...rest } = raw || {};
|
|
633
626
|
return rest;
|
|
634
627
|
});
|
|
628
|
+
const formAttrs = computed(() => {
|
|
629
|
+
return mergeProps(injectAttrs.value, camelizeProperties(attrs));
|
|
630
|
+
});
|
|
635
631
|
const slots = useSlots();
|
|
636
632
|
provide(InjectionFormSlotsKey, slots);
|
|
637
633
|
return (_ctx, _cache) => {
|
|
@@ -639,7 +635,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
639
635
|
key: formKey.value,
|
|
640
636
|
ref: setFormRef,
|
|
641
637
|
model: formData.value
|
|
642
|
-
},
|
|
638
|
+
}, formAttrs.value, { class: "pro-form" }), {
|
|
643
639
|
default: withCtx(() => [
|
|
644
640
|
createVNode(unref(_sfc_main$e), {
|
|
645
641
|
fields: fields.value,
|
|
@@ -701,155 +697,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
701
697
|
const { t } = useLocale();
|
|
702
698
|
const props = __props;
|
|
703
699
|
const emit = __emit;
|
|
704
|
-
const
|
|
705
|
-
const collapseHeight = ref(0);
|
|
706
|
-
const rowHeight = ref(32);
|
|
707
|
-
let resizeObserver = null;
|
|
708
|
-
let intersectionObserver = null;
|
|
709
|
-
const cleanupObservers = () => {
|
|
710
|
-
if (resizeObserver) {
|
|
711
|
-
resizeObserver.disconnect();
|
|
712
|
-
resizeObserver = null;
|
|
713
|
-
}
|
|
714
|
-
if (intersectionObserver) {
|
|
715
|
-
intersectionObserver.disconnect();
|
|
716
|
-
intersectionObserver = null;
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
onBeforeUnmount(() => {
|
|
720
|
-
cleanupObservers();
|
|
721
|
-
});
|
|
722
|
-
const computedExpand = computed(() => {
|
|
723
|
-
if (!props.expand) return false;
|
|
724
|
-
if (props.expand === true) return { minExpandRows: 2, expandStatus: false };
|
|
725
|
-
return {
|
|
726
|
-
minExpandRows: Math.max(Math.floor(props.expand.minExpandRows ?? 2), 1),
|
|
727
|
-
expandStatus: props.expand.expandStatus ?? false
|
|
728
|
-
};
|
|
729
|
-
});
|
|
730
|
-
const showExpandToggle = ref(false);
|
|
731
|
-
const expandStatus = ref(true);
|
|
732
|
-
const updateHeights = () => {
|
|
733
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
734
|
-
if (!props.expand || !((_b = (_a = props.form) == null ? void 0 : _a.formRef) == null ? void 0 : _b.value)) return;
|
|
735
|
-
const proFormEl = (_c = props.form.formRef.value) == null ? void 0 : _c.$el;
|
|
736
|
-
if (!proFormEl) return;
|
|
737
|
-
const itemHeight = (_f = (_e = (_d = proFormEl == null ? void 0 : proFormEl.querySelector("[class*='-form-item']")) == null ? void 0 : _d.getBoundingClientRect) == null ? void 0 : _e.call(_d)) == null ? void 0 : _f.height;
|
|
738
|
-
if (itemHeight && itemHeight > 0) {
|
|
739
|
-
rowHeight.value = itemHeight;
|
|
740
|
-
}
|
|
741
|
-
const naturalHeight = proFormEl.scrollHeight || ((_h = (_g = proFormEl.getBoundingClientRect) == null ? void 0 : _g.call(proFormEl)) == null ? void 0 : _h.height) || 0;
|
|
742
|
-
if (naturalHeight > 0) {
|
|
743
|
-
proFormHeight.value = naturalHeight;
|
|
744
|
-
}
|
|
745
|
-
};
|
|
746
|
-
const isManualToggle = ref(false);
|
|
747
|
-
const changeExpandStatus = () => {
|
|
748
|
-
isManualToggle.value = true;
|
|
749
|
-
expandStatus.value = !expandStatus.value;
|
|
750
|
-
};
|
|
751
|
-
const hasFieldValue = (val) => val !== null && val !== void 0 && val !== "" && !(Array.isArray(val) && val.length === 0) && !(typeof val === "object" && Object.keys(val).length === 0);
|
|
752
|
-
const setInitExpandStatus = () => {
|
|
753
|
-
var _a, _b, _c;
|
|
754
|
-
if (isManualToggle.value) return;
|
|
755
|
-
const initStatus = computedExpand.value ? computedExpand.value.expandStatus : false;
|
|
756
|
-
expandStatus.value = initStatus;
|
|
757
|
-
if (((_b = (_a = props.form) == null ? void 0 : _a.formRef) == null ? void 0 : _b.value) && computedExpand.value) {
|
|
758
|
-
const formEl = props.form.formRef.value.$el;
|
|
759
|
-
const formItemsEl = (_c = formEl == null ? void 0 : formEl.querySelectorAll) == null ? void 0 : _c.call(
|
|
760
|
-
formEl,
|
|
761
|
-
"[class*='-form-item'] > [path]"
|
|
762
|
-
);
|
|
763
|
-
if (!formItemsEl || formItemsEl.length === 0) return;
|
|
764
|
-
if (intersectionObserver) {
|
|
765
|
-
intersectionObserver.disconnect();
|
|
766
|
-
}
|
|
767
|
-
intersectionObserver = new IntersectionObserver(
|
|
768
|
-
(entries) => {
|
|
769
|
-
if (isManualToggle.value) return;
|
|
770
|
-
expandStatus.value = entries.some((e) => {
|
|
771
|
-
var _a2, _b2;
|
|
772
|
-
if (e.intersectionRatio === 0) {
|
|
773
|
-
const path = e.target.getAttribute("path");
|
|
774
|
-
const searchFieldValue = path ? (_b2 = (_a2 = props.form) == null ? void 0 : _a2.getFormData) == null ? void 0 : _b2.call(_a2, path) : void 0;
|
|
775
|
-
return hasFieldValue(searchFieldValue);
|
|
776
|
-
}
|
|
777
|
-
return computedExpand.value ? computedExpand.value.expandStatus : false;
|
|
778
|
-
});
|
|
779
|
-
intersectionObserver == null ? void 0 : intersectionObserver.disconnect();
|
|
780
|
-
},
|
|
781
|
-
{ root: formEl }
|
|
782
|
-
);
|
|
783
|
-
formItemsEl.forEach((element) => {
|
|
784
|
-
intersectionObserver == null ? void 0 : intersectionObserver.observe(element);
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
};
|
|
788
|
-
watch(
|
|
789
|
-
[
|
|
790
|
-
() => {
|
|
791
|
-
var _a, _b, _c;
|
|
792
|
-
return (_c = (_b = (_a = props.form) == null ? void 0 : _a.fields.value) == null ? void 0 : _b.filter((f) => !f.hidden)) == null ? void 0 : _c.length;
|
|
793
|
-
},
|
|
794
|
-
() => {
|
|
795
|
-
var _a, _b;
|
|
796
|
-
return (_b = (_a = props.form) == null ? void 0 : _a.formRef) == null ? void 0 : _b.value;
|
|
797
|
-
},
|
|
798
|
-
() => props.expand
|
|
799
|
-
],
|
|
800
|
-
() => {
|
|
801
|
-
updateHeights();
|
|
802
|
-
},
|
|
803
|
-
{ flush: "post", immediate: true }
|
|
804
|
-
);
|
|
805
|
-
watch(
|
|
806
|
-
() => {
|
|
807
|
-
var _a, _b;
|
|
808
|
-
return (_b = (_a = props.form) == null ? void 0 : _a.formRef) == null ? void 0 : _b.value;
|
|
809
|
-
},
|
|
810
|
-
(val) => {
|
|
811
|
-
if (resizeObserver) {
|
|
812
|
-
resizeObserver.disconnect();
|
|
813
|
-
resizeObserver = null;
|
|
814
|
-
}
|
|
815
|
-
const formEl = val == null ? void 0 : val.$el;
|
|
816
|
-
if (formEl && typeof ResizeObserver !== "undefined") {
|
|
817
|
-
resizeObserver = new ResizeObserver(() => {
|
|
818
|
-
updateHeights();
|
|
819
|
-
});
|
|
820
|
-
resizeObserver.observe(formEl);
|
|
821
|
-
}
|
|
822
|
-
},
|
|
823
|
-
{ immediate: true }
|
|
824
|
-
);
|
|
825
|
-
watchEffect(
|
|
826
|
-
() => {
|
|
827
|
-
if (typeof proFormHeight.value !== "number") return;
|
|
828
|
-
if (props.layout === "grid" && computedExpand.value) {
|
|
829
|
-
const { minExpandRows } = computedExpand.value;
|
|
830
|
-
collapseHeight.value = Math.min(
|
|
831
|
-
minExpandRows * rowHeight.value + (minExpandRows - 1) * props.rowGap,
|
|
832
|
-
+proFormHeight.value
|
|
833
|
-
);
|
|
834
|
-
showExpandToggle.value = +proFormHeight.value - collapseHeight.value > 1;
|
|
835
|
-
if (showExpandToggle.value) {
|
|
836
|
-
setInitExpandStatus();
|
|
837
|
-
}
|
|
838
|
-
} else {
|
|
839
|
-
showExpandToggle.value = false;
|
|
840
|
-
}
|
|
841
|
-
},
|
|
842
|
-
{ flush: "post" }
|
|
843
|
-
);
|
|
700
|
+
const { showExpandToggle, expandStatus, changeExpandStatus, heightStyle } = useSearchFormExpand(props);
|
|
844
701
|
const layoutProps = computed(() => {
|
|
845
|
-
const currentHeight = expandStatus.value ? proFormHeight.value : collapseHeight.value;
|
|
846
|
-
const heightStyle = currentHeight !== "unset" && currentHeight !== void 0 ? `${currentHeight}px` : void 0;
|
|
847
702
|
return props.layout === "grid" ? {
|
|
848
703
|
grid: {
|
|
849
704
|
gutter: [props.columnGap, props.rowGap],
|
|
850
705
|
style: { flex: 1, marginRight: "12px" }
|
|
851
706
|
},
|
|
852
|
-
style: {
|
|
707
|
+
style: {
|
|
708
|
+
display: "flex",
|
|
709
|
+
overflow: "hidden",
|
|
710
|
+
height: heightStyle.value
|
|
711
|
+
}
|
|
853
712
|
} : {
|
|
854
713
|
layout: "inline",
|
|
855
714
|
style: { gap: `${props.rowGap}px ${props.columnGap}px` },
|
|
@@ -910,29 +769,29 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
910
769
|
], 64)) : createCommentVNode("", true)
|
|
911
770
|
], true),
|
|
912
771
|
renderSlot(_ctx.$slots, "expand-button", {
|
|
913
|
-
expandStatus: expandStatus
|
|
914
|
-
changeExpandStatus
|
|
772
|
+
expandStatus: unref(expandStatus),
|
|
773
|
+
changeExpandStatus: unref(changeExpandStatus)
|
|
915
774
|
}, () => [
|
|
916
|
-
props.expandButton !== false && showExpandToggle
|
|
775
|
+
props.expandButton !== false && unref(showExpandToggle) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
917
776
|
props.expandButton ? (openBlock(), createBlock(resolveDynamicComponent(props.expandButton), {
|
|
918
777
|
key: 0,
|
|
919
|
-
"expand-status": expandStatus
|
|
920
|
-
onClick: changeExpandStatus
|
|
921
|
-
}, null, 8, ["expand-status"])) : (openBlock(), createBlock(unref(Button), {
|
|
778
|
+
"expand-status": unref(expandStatus),
|
|
779
|
+
onClick: unref(changeExpandStatus)
|
|
780
|
+
}, null, 8, ["expand-status", "onClick"])) : (openBlock(), createBlock(unref(Button), {
|
|
922
781
|
key: 1,
|
|
923
782
|
type: "link",
|
|
924
783
|
class: "pro-table_search-form_expand-toggle-button",
|
|
925
|
-
onClick: changeExpandStatus
|
|
784
|
+
onClick: unref(changeExpandStatus)
|
|
926
785
|
}, {
|
|
927
786
|
default: withCtx(() => [
|
|
928
|
-
createTextVNode(toDisplayString(expandStatus
|
|
787
|
+
createTextVNode(toDisplayString(unref(expandStatus) ? unref(t)("table.collapse") : unref(t)("table.expand")) + " ", 1),
|
|
929
788
|
createVNode(DownOutlined, {
|
|
930
789
|
class: "transition",
|
|
931
|
-
style: normalizeStyle([{ "margin-left": "4px" }, { transform: `rotate(${expandStatus
|
|
790
|
+
style: normalizeStyle([{ "margin-left": "4px" }, { transform: `rotate(${unref(expandStatus) ? -180 : 0}deg)` }])
|
|
932
791
|
}, null, 8, ["style"])
|
|
933
792
|
]),
|
|
934
793
|
_: 1
|
|
935
|
-
}))
|
|
794
|
+
}, 8, ["onClick"]))
|
|
936
795
|
], 64)) : createCommentVNode("", true)
|
|
937
796
|
], true)
|
|
938
797
|
]),
|
|
@@ -944,7 +803,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
944
803
|
};
|
|
945
804
|
}
|
|
946
805
|
});
|
|
947
|
-
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
806
|
+
const SearchForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-15688cc0"]]);
|
|
948
807
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
949
808
|
__name: "DefaultSearchFormContainer",
|
|
950
809
|
setup(__props) {
|
|
@@ -1081,7 +940,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1081
940
|
const rawKey = item.key ?? (Array.isArray(item.dataIndex) ? item.dataIndex.join(".") : item.dataIndex);
|
|
1082
941
|
if (!rawKey || !item.title) return [];
|
|
1083
942
|
const key = String(rawKey);
|
|
1084
|
-
if ((_b = (_a = props.columnControl) == null ? void 0 : _a.excludedKeys) == null ? void 0 : _b.some((ek) => String(ek) === key))
|
|
943
|
+
if (key === "__INDEX__" || ((_b = (_a = props.columnControl) == null ? void 0 : _a.excludedKeys) == null ? void 0 : _b.some((ek) => String(ek) === key)))
|
|
1085
944
|
return [];
|
|
1086
945
|
const disabled = ((_d = (_c = props.columnControl) == null ? void 0 : _c.disabledKeys) == null ? void 0 : _d.some((dk) => String(dk) === key)) ?? false;
|
|
1087
946
|
const label = ((_f = (_e = props.columnControl) == null ? void 0 : _e.labels) == null ? void 0 : _f[key]) ?? (typeof item.title === "string" ? item.title : key);
|
|
@@ -1138,13 +997,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1138
997
|
},
|
|
1139
998
|
{ immediate: true }
|
|
1140
999
|
);
|
|
1141
|
-
onMounted(() => {
|
|
1142
|
-
var _a, _b;
|
|
1143
|
-
(_b = (_a = props.columnControl) == null ? void 0 : _a.disabledKeys) == null ? void 0 : _b.forEach((key) => {
|
|
1144
|
-
var _a2, _b2;
|
|
1145
|
-
(_b2 = (_a2 = props.table) == null ? void 0 : _a2.setColumn) == null ? void 0 : _b2.call(_a2, String(key), { hidden: false });
|
|
1146
|
-
});
|
|
1147
|
-
});
|
|
1148
1000
|
watch(
|
|
1149
1001
|
() => {
|
|
1150
1002
|
var _a;
|
|
@@ -1156,7 +1008,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1156
1008
|
(_b = (_a = props.table) == null ? void 0 : _a.setColumn) == null ? void 0 : _b.call(_a, String(key), { hidden: false });
|
|
1157
1009
|
});
|
|
1158
1010
|
},
|
|
1159
|
-
{ deep: true }
|
|
1011
|
+
{ immediate: true, deep: true }
|
|
1160
1012
|
);
|
|
1161
1013
|
return (_ctx, _cache) => {
|
|
1162
1014
|
return openBlock(), createBlock(unref(Dropdown), {
|
|
@@ -1233,7 +1085,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1233
1085
|
};
|
|
1234
1086
|
}
|
|
1235
1087
|
});
|
|
1236
|
-
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
1088
|
+
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ca3f82db"]]);
|
|
1237
1089
|
const _hoisted_1 = { class: "pro-table_header" };
|
|
1238
1090
|
const _hoisted_2 = {
|
|
1239
1091
|
key: 0,
|
|
@@ -1269,13 +1121,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1269
1121
|
"loadingModifiers": {}
|
|
1270
1122
|
}),
|
|
1271
1123
|
emits: ["update:size", "update:loading"],
|
|
1272
|
-
setup(__props) {
|
|
1124
|
+
setup(__props, { expose: __expose }) {
|
|
1125
|
+
const tableProperties = Object.keys(tableProps());
|
|
1273
1126
|
const props = __props;
|
|
1274
1127
|
const { t } = useLocale();
|
|
1275
1128
|
const config = INJECT_CONFIG["pro-table"];
|
|
1276
1129
|
const injectPropsRaw = inject(config.injectionKey, config.default);
|
|
1277
1130
|
const injectProps = computed(() => toValue(injectPropsRaw) || {});
|
|
1278
|
-
const tableProperties = Object.keys(tableProps());
|
|
1279
1131
|
const injectAttrs = computed(
|
|
1280
1132
|
() => pick(injectProps.value, tableProperties)
|
|
1281
1133
|
);
|
|
@@ -1294,14 +1146,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1294
1146
|
});
|
|
1295
1147
|
const size = useModel(__props, "size");
|
|
1296
1148
|
const loading = useModel(__props, "loading");
|
|
1149
|
+
let searchSequence = 0;
|
|
1297
1150
|
const _search = async () => {
|
|
1298
1151
|
var _a;
|
|
1152
|
+
const seq = ++searchSequence;
|
|
1299
1153
|
const searchPromise = (_a = props.search || attrs.onSearch) == null ? void 0 : _a();
|
|
1300
|
-
if (isPromise(searchPromise))
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1154
|
+
if (!isPromise(searchPromise)) return;
|
|
1155
|
+
loading.value = true;
|
|
1156
|
+
try {
|
|
1157
|
+
await searchPromise;
|
|
1158
|
+
} finally {
|
|
1159
|
+
if (seq === searchSequence) {
|
|
1305
1160
|
loading.value = false;
|
|
1306
1161
|
}
|
|
1307
1162
|
}
|
|
@@ -1313,15 +1168,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1313
1168
|
_search();
|
|
1314
1169
|
});
|
|
1315
1170
|
};
|
|
1171
|
+
const customSlotNames = [
|
|
1172
|
+
"search-form",
|
|
1173
|
+
"button-bar",
|
|
1174
|
+
"toolbar",
|
|
1175
|
+
"table"
|
|
1176
|
+
];
|
|
1316
1177
|
const slots = useSlots();
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1178
|
+
const forwardedSlotNames = () => Object.keys(slots).filter(
|
|
1179
|
+
(name) => !customSlotNames.includes(name)
|
|
1180
|
+
);
|
|
1181
|
+
const columnRequiredSlotNames = /* @__PURE__ */ new Set([
|
|
1182
|
+
"bodyCell",
|
|
1183
|
+
"headerCell",
|
|
1184
|
+
"customFilterDropdown",
|
|
1185
|
+
"customFilterIcon"
|
|
1186
|
+
]);
|
|
1187
|
+
const isSlotRenderable = (name, scoped) => {
|
|
1188
|
+
if (columnRequiredSlotNames.has(name)) {
|
|
1189
|
+
return visibleComputedColumns.value.length > 0 && Boolean(scoped == null ? void 0 : scoped.column);
|
|
1190
|
+
}
|
|
1191
|
+
return true;
|
|
1192
|
+
};
|
|
1325
1193
|
const searchPage1st = () => {
|
|
1326
1194
|
var _a, _b;
|
|
1327
1195
|
(_b = (_a = props.table) == null ? void 0 : _a.setPageParam) == null ? void 0 : _b.call(_a, { current: 1 });
|
|
@@ -1339,13 +1207,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1339
1207
|
const container = props.tableContainer ?? injectProps.value.tableContainer ?? DefaultTableContainer;
|
|
1340
1208
|
return container ? container : void 0;
|
|
1341
1209
|
});
|
|
1342
|
-
const
|
|
1210
|
+
const getIndex = (i) => {
|
|
1211
|
+
var _a;
|
|
1212
|
+
const pageParam = (_a = props.table) == null ? void 0 : _a.pageParam;
|
|
1213
|
+
if (pageParam && computedPagination.value !== false) {
|
|
1214
|
+
const current = pageParam.current ?? 1;
|
|
1215
|
+
const pageSize = pageParam.pageSize ?? 10;
|
|
1216
|
+
return (current - 1) * pageSize + i + 1;
|
|
1217
|
+
}
|
|
1218
|
+
return i + 1;
|
|
1219
|
+
};
|
|
1343
1220
|
const indexColumn = computed(() => ({
|
|
1344
1221
|
title: t("table.index"),
|
|
1345
|
-
dataIndex: "
|
|
1346
|
-
key: "
|
|
1222
|
+
dataIndex: "__INDEX__",
|
|
1223
|
+
key: "__INDEX__",
|
|
1347
1224
|
width: 80,
|
|
1348
|
-
customRender:
|
|
1225
|
+
customRender: ({ index: index2 }) => getIndex(index2)
|
|
1349
1226
|
}));
|
|
1350
1227
|
const computedColumns = computed(() => {
|
|
1351
1228
|
var _a;
|
|
@@ -1385,11 +1262,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1385
1262
|
(_c = attrs.onChange) == null ? void 0 : _c.call(attrs, ...args);
|
|
1386
1263
|
_search();
|
|
1387
1264
|
};
|
|
1388
|
-
const
|
|
1265
|
+
const searchFormVisible = computed(() => {
|
|
1389
1266
|
var _a, _b, _c, _d;
|
|
1390
1267
|
const searchFields = (_b = (_a = props.table) == null ? void 0 : _a.searchForm) == null ? void 0 : _b.fields;
|
|
1391
1268
|
const fieldList = (Array.isArray(searchFields) ? searchFields : searchFields == null ? void 0 : searchFields.value) ?? [];
|
|
1392
|
-
return !!(
|
|
1269
|
+
return !!(((_c = computedSearchFormConfig.value) == null ? void 0 : _c.hidden) !== true && ((_d = props.table) == null ? void 0 : _d.searchForm) && fieldList.filter((item) => !toValue(item.hidden)).length > 0);
|
|
1393
1270
|
});
|
|
1394
1271
|
const computedControl = computed(() => {
|
|
1395
1272
|
const controlConfig = props.control ?? injectProps.value.control;
|
|
@@ -1413,12 +1290,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1413
1290
|
_search();
|
|
1414
1291
|
}
|
|
1415
1292
|
});
|
|
1293
|
+
__expose({
|
|
1294
|
+
/** 手动触发一次查询(与内部搜索共用 loading 竞态守卫),便于外部刷新列表 */
|
|
1295
|
+
search: _search
|
|
1296
|
+
});
|
|
1416
1297
|
return (_ctx, _cache) => {
|
|
1417
1298
|
return openBlock(), createElementBlock("div", {
|
|
1418
1299
|
class: normalizeClass(["pro-table", unref(attrs).class]),
|
|
1419
1300
|
style: normalizeStyle(unref(attrs).style)
|
|
1420
1301
|
}, [
|
|
1421
|
-
|
|
1302
|
+
searchFormVisible.value || _ctx.$slots["search-form"] ? (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
1422
1303
|
key: 0,
|
|
1423
1304
|
component: computedSearchFormConfig.value.container
|
|
1424
1305
|
}, {
|
|
@@ -1441,10 +1322,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1441
1322
|
createVNode(unref(_sfc_main$c), { component: computedTableContainer.value }, {
|
|
1442
1323
|
default: withCtx(() => [
|
|
1443
1324
|
createElementVNode("div", _hoisted_1, [
|
|
1444
|
-
|
|
1325
|
+
_ctx.$slots["button-bar"] ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
1445
1326
|
renderSlot(_ctx.$slots, "button-bar", {}, void 0, true)
|
|
1446
1327
|
])) : createCommentVNode("", true),
|
|
1447
|
-
|
|
1328
|
+
_ctx.$slots["toolbar"] ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1448
1329
|
renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)
|
|
1449
1330
|
])) : createCommentVNode("", true),
|
|
1450
1331
|
computedControl.value.sizeControl ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
@@ -1470,11 +1351,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1470
1351
|
pagination: computedPagination.value,
|
|
1471
1352
|
onChange: onTableChange
|
|
1472
1353
|
}), createSlots({ _: 2 }, [
|
|
1473
|
-
renderList(
|
|
1354
|
+
renderList(forwardedSlotNames(), (name) => {
|
|
1474
1355
|
return {
|
|
1475
1356
|
name,
|
|
1476
1357
|
fn: withCtx((scoped) => [
|
|
1477
|
-
renderSlot(_ctx.$slots, name, normalizeProps(
|
|
1358
|
+
isSlotRenderable(name, scoped) ? renderSlot(_ctx.$slots, name, normalizeProps(mergeProps({ key: 0 }, scoped)), void 0, true) : createCommentVNode("", true)
|
|
1478
1359
|
])
|
|
1479
1360
|
};
|
|
1480
1361
|
})
|
|
@@ -1487,7 +1368,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1487
1368
|
};
|
|
1488
1369
|
}
|
|
1489
1370
|
});
|
|
1490
|
-
const ProTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
1371
|
+
const ProTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3276e1dc"]]);
|
|
1491
1372
|
function useTable(params) {
|
|
1492
1373
|
return useTable$1(params);
|
|
1493
1374
|
}
|
|
@@ -1536,9 +1417,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1536
1417
|
}
|
|
1537
1418
|
});
|
|
1538
1419
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1420
|
+
provide(
|
|
1421
|
+
INJECT_COMPONENTS,
|
|
1422
|
+
computed(() => props.componentMap)
|
|
1423
|
+
);
|
|
1542
1424
|
provide(
|
|
1543
1425
|
LOCALE_INJECT_KEY,
|
|
1544
1426
|
computed(() => props.locale)
|