@qin-ui/antd-vue-pro 2.0.4 → 2.0.5
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
CHANGED
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
.control-icon[data-v-88c80679] :hover {
|
|
37
37
|
color: #1677ff;
|
|
38
38
|
}
|
|
39
|
-
.pro-table .pro-table-header[data-v-
|
|
39
|
+
.pro-table .pro-table-header[data-v-a9d8c25c] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-table .pro-table-header[data-v-
|
|
44
|
+
.pro-table .pro-table-header[data-v-a9d8c25c]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-table .pro-table-header + .pro-table-content[data-v-
|
|
47
|
+
.pro-table .pro-table-header + .pro-table-content[data-v-a9d8c25c] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-table[data-v-
|
|
50
|
+
.pro-table[data-v-a9d8c25c] .ant-pagination .ant-pagination-total-text {
|
|
51
51
|
flex: 1;
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, provide, renderSlot } from "vue";
|
|
1
|
+
import { camelize, defineComponent, provide, renderSlot } from "vue";
|
|
2
2
|
import { i as isPlainObject } from "../vendor/utils/lodash-es-B2uQdS28.js";
|
|
3
3
|
const getPopupContainer = (triggerNode) => triggerNode.closest(".ant-form");
|
|
4
4
|
const INJECT_CONFIG = {
|
|
@@ -128,6 +128,11 @@ const INJECT_CONFIG = {
|
|
|
128
128
|
function getObject(val) {
|
|
129
129
|
return isPlainObject(val) ? val : {};
|
|
130
130
|
}
|
|
131
|
+
function camelizeProperties(obj) {
|
|
132
|
+
return Object.fromEntries(
|
|
133
|
+
Object.entries(obj).map(([key, value]) => [camelize(key), value])
|
|
134
|
+
);
|
|
135
|
+
}
|
|
131
136
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
132
137
|
__name: "index",
|
|
133
138
|
props: {
|
|
@@ -150,5 +155,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
150
155
|
export {
|
|
151
156
|
INJECT_CONFIG as I,
|
|
152
157
|
_sfc_main as _,
|
|
158
|
+
camelizeProperties as c,
|
|
153
159
|
getObject as g
|
|
154
160
|
};
|
package/es/form/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useProviderDisabled, useInjectDisabled } from "ant-design-vue/es/config
|
|
|
4
4
|
import { colProps } from "ant-design-vue/es/grid/Col";
|
|
5
5
|
import { formItemProps, useInjectFormItemContext } from "ant-design-vue/es/form";
|
|
6
6
|
import { defineComponent, provide, inject, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot, computed, toValue, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, reactive, useAttrs, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
|
|
7
|
-
import { I as INJECT_CONFIG, g as getObject } from "../component-provider/index-
|
|
7
|
+
import { I as INJECT_CONFIG, c as camelizeProperties, g as getObject } from "../component-provider/index-DXPHmG1H.js";
|
|
8
8
|
import { i as isPlainObject, t as toPath, g as get, s as set, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-B2uQdS28.js";
|
|
9
9
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
10
10
|
...{ name: "ProForm", inheritAttrs: false },
|
|
@@ -36,7 +36,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
return (_a = unref(setFormRef)) == null ? void 0 : _a(el);
|
|
37
37
|
},
|
|
38
38
|
model: unref(formData)
|
|
39
|
-
}, mergeProps(injectAttrs, _ctx.$attrs)), {
|
|
39
|
+
}, mergeProps(injectAttrs, unref(camelizeProperties)(_ctx.$attrs))), {
|
|
40
40
|
default: withCtx(() => [
|
|
41
41
|
createVNode(unref(_sfc_main$3), {
|
|
42
42
|
fields: unref(fields),
|
package/es/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import _sfc_main from "./form/index.js";
|
|
|
3
3
|
import { BaseField, BaseFormItem, COMPONENT_MAP, ContainerFragment, FORM, FORM_ITEM_SLOT_KEYS, PATH, SlotComponent, TeleportComponentNamePrefix, useFields, useForm, useFormData } from "./form/index.js";
|
|
4
4
|
import BaseTable from "./table/index.js";
|
|
5
5
|
import { useTable } from "./table/index.js";
|
|
6
|
-
import { _ as _sfc_main$1 } from "./component-provider/index-
|
|
7
|
-
import { I } from "./component-provider/index-
|
|
6
|
+
import { _ as _sfc_main$1 } from "./component-provider/index-DXPHmG1H.js";
|
|
7
|
+
import { I } from "./component-provider/index-DXPHmG1H.js";
|
|
8
8
|
const withInstall = (comp) => {
|
|
9
9
|
comp.install = (app) => {
|
|
10
10
|
app.component(comp.name, comp);
|
package/es/table/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElementBlock, openBlock, createElementVNode, defineComponent, ref, computed, watch, watchEffect, createBlock, unref, mergeProps, withCtx, createVNode, createCommentVNode, createTextVNode, toDisplayString, normalizeStyle, toValue, renderSlot, useAttrs, Fragment, renderList, withModifiers, inject, useSlots, onMounted, normalizeClass, isRef, createSlots, normalizeProps, guardReactiveProps, nextTick, reactive } from "vue";
|
|
2
|
-
import { I as INJECT_CONFIG, g as getObject } from "../component-provider/index-
|
|
2
|
+
import { I as INJECT_CONFIG, g as getObject, c as camelizeProperties } from "../component-provider/index-DXPHmG1H.js";
|
|
3
3
|
import _sfc_main$9, { ContainerFragment as _sfc_main$a, useForm } from "../form/index.js";
|
|
4
4
|
import { Space, Button, Dropdown, Menu, MenuItem, Checkbox, MenuDivider, Table } from "ant-design-vue";
|
|
5
5
|
import { p as pick, c as cloneDeep } from "../vendor/utils/lodash-es-B2uQdS28.js";
|
|
@@ -448,10 +448,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
448
448
|
const props = __props;
|
|
449
449
|
const config = INJECT_CONFIG["pro-table"];
|
|
450
450
|
const injectProps = inject(config.injectionKey, config.default);
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
Object.keys(tableProps())
|
|
454
|
-
);
|
|
451
|
+
const tableProperties = Object.keys(tableProps());
|
|
452
|
+
const injectAttrs = pick(injectProps, tableProperties);
|
|
455
453
|
const computedSearchFormConfig = computed(() => {
|
|
456
454
|
return {
|
|
457
455
|
container: DefaultSearchFormContainer,
|
|
@@ -459,7 +457,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
459
457
|
...getObject(props.searchFormConfig)
|
|
460
458
|
};
|
|
461
459
|
});
|
|
462
|
-
const attrs =
|
|
460
|
+
const attrs = useAttrs();
|
|
461
|
+
const tableAttrs = computed(() => {
|
|
462
|
+
return pick(camelizeProperties(attrs), tableProperties);
|
|
463
|
+
});
|
|
463
464
|
const { columns, dataSource, searchForm, pageParam, setPageParam } = props.table || {};
|
|
464
465
|
const size = useModel(attrs, "size");
|
|
465
466
|
const loading = useModel(attrs, "loading");
|
|
@@ -495,7 +496,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
495
496
|
_search();
|
|
496
497
|
};
|
|
497
498
|
const computedTableProps = computed(() => {
|
|
498
|
-
return { ...injectAttrs, ...
|
|
499
|
+
return { ...injectAttrs, ...tableAttrs.value, onChange: void 0 };
|
|
499
500
|
});
|
|
500
501
|
const indexColumn = {
|
|
501
502
|
title: "序号",
|
|
@@ -505,7 +506,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
505
506
|
};
|
|
506
507
|
const computedColumns = computed(() => [
|
|
507
508
|
...props.addIndexColumn ?? injectProps.addIndexColumn ? [indexColumn] : [],
|
|
508
|
-
...(
|
|
509
|
+
...(tableAttrs.value.columns ?? (columns == null ? void 0 : columns.value) ?? []).flatMap(
|
|
509
510
|
(item, index) => {
|
|
510
511
|
if (item.key) return [{ ...item, key: item.key }];
|
|
511
512
|
if (item.dataIndex) {
|
|
@@ -520,11 +521,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
520
521
|
return computedColumns.value.filter((item) => !item.hidden);
|
|
521
522
|
});
|
|
522
523
|
const computedDataSource = computed(() => {
|
|
523
|
-
return
|
|
524
|
+
return tableAttrs.value.dataSource ?? (dataSource == null ? void 0 : dataSource.value);
|
|
524
525
|
});
|
|
525
526
|
const computedPagination = computed(() => {
|
|
526
|
-
if (
|
|
527
|
-
return {
|
|
527
|
+
if (tableAttrs.value.pagination === false) return false;
|
|
528
|
+
return {
|
|
529
|
+
...injectAttrs.pagination,
|
|
530
|
+
...pageParam,
|
|
531
|
+
...tableAttrs.value.pagination
|
|
532
|
+
};
|
|
528
533
|
});
|
|
529
534
|
const onTableChange = (...args) => {
|
|
530
535
|
var _a;
|
|
@@ -617,7 +622,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
617
622
|
};
|
|
618
623
|
}
|
|
619
624
|
});
|
|
620
|
-
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
625
|
+
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a9d8c25c"]]);
|
|
621
626
|
const getDefaultPageParam = () => ({ current: 1, pageSize: 10, total: 0 });
|
|
622
627
|
const pageParamProperty = ["current", "pageSize", "total"];
|
|
623
628
|
const useTable = (params) => {
|