@aplus-frontend/ui 0.1.23 → 0.1.24
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/index.mjs +66 -63
- package/es/src/ap-download/ap-download.vue.d.ts +0 -3
- package/es/src/ap-download/ap-download.vue.mjs +10 -10
- package/es/src/ap-field/number/index.vue.mjs +20 -19
- package/es/src/ap-form/ap-form-item.vue.mjs +27 -25
- package/es/src/ap-form/ap-form.vue.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +18 -18
- package/es/src/ap-form/interface.d.ts +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ap-attachment/ApAttachment.d.ts +97 -0
- package/es/src/business/ap-attachment/ApAttachment.mjs +82 -0
- package/es/src/business/ap-attachment/constans.d.ts +44 -0
- package/es/src/business/ap-attachment/constans.mjs +42 -0
- package/es/src/business/ap-attachment/index.d.ts +3 -0
- package/es/src/business/ap-attachment/interface.d.ts +13 -0
- package/es/src/business/ap-attachment/style.css +62 -0
- package/es/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +25 -22
- package/es/src/business/ap-input-radio/interface.d.ts +8 -2
- package/es/src/business/hooks/index.d.ts +1 -0
- package/es/src/business/hooks/index.mjs +4 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +29 -0
- package/es/src/business/hooks/usePageListApTable.mjs +67 -0
- package/es/src/business/index.d.ts +123 -3
- package/es/src/business/index.mjs +29 -26
- package/es/src/editable-table/form-item.vue.mjs +80 -77
- package/es/src/editable-table/hooks/use-get-columns.mjs +30 -30
- package/es/src/editable-table/interface.d.ts +2 -2
- package/es/src/index.mjs +204 -201
- package/es/src/locale/lang/en.mjs +4 -0
- package/es/src/locale/lang/zh-cn.mjs +4 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +62 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-download/ap-download.vue.d.ts +0 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +2 -2
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +97 -0
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -0
- package/lib/src/business/ap-attachment/constans.d.ts +44 -0
- package/lib/src/business/ap-attachment/constans.js +1 -0
- package/lib/src/business/ap-attachment/index.d.ts +3 -0
- package/lib/src/business/ap-attachment/interface.d.ts +13 -0
- package/lib/src/business/ap-attachment/style.css +62 -0
- package/lib/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
- package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
- package/lib/src/business/ap-input-radio/interface.d.ts +8 -2
- package/lib/src/business/hooks/index.d.ts +1 -0
- package/lib/src/business/hooks/index.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +29 -0
- package/lib/src/business/hooks/usePageListApTable.js +1 -0
- package/lib/src/business/index.d.ts +123 -3
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/interface.d.ts +2 -2
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +62 -0
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "../../index.mjs";
|
|
2
|
+
import { merge as p } from "lodash-unified";
|
|
3
|
+
import { ref as m } from "vue";
|
|
4
|
+
import { useGlobalConfig as d } from "../../config-provider/hooks/use-global-config.mjs";
|
|
5
|
+
function A(l) {
|
|
6
|
+
const t = m(null), n = d("uiMode", "aplus");
|
|
7
|
+
console.log("mode", n.value);
|
|
8
|
+
const {
|
|
9
|
+
isShowRowSelection: c = !0,
|
|
10
|
+
transformSearchFormValues: o,
|
|
11
|
+
api: a,
|
|
12
|
+
...u
|
|
13
|
+
} = l || {};
|
|
14
|
+
return [p(
|
|
15
|
+
{
|
|
16
|
+
// scroll,tableLayout,columnResizable设置表格可拖动
|
|
17
|
+
scroll: { x: "100%", y: "100%" },
|
|
18
|
+
tableLayout: "fixed",
|
|
19
|
+
columnResizable: !0,
|
|
20
|
+
// 表格header吸顶效果
|
|
21
|
+
class: "ap-table--sticky",
|
|
22
|
+
request: a ? async (e) => {
|
|
23
|
+
const r = o ? o(e) : e;
|
|
24
|
+
try {
|
|
25
|
+
if (!a) throw new Error("api is not defined");
|
|
26
|
+
const { records: s, total: i } = await a(r);
|
|
27
|
+
return {
|
|
28
|
+
data: s,
|
|
29
|
+
total: i
|
|
30
|
+
};
|
|
31
|
+
} catch (s) {
|
|
32
|
+
return console.error(s), {
|
|
33
|
+
data: [],
|
|
34
|
+
total: 0
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
} : void 0,
|
|
38
|
+
rowSelection: c ? {
|
|
39
|
+
mode: "internal",
|
|
40
|
+
fixed: "left",
|
|
41
|
+
columnWidth: 50
|
|
42
|
+
} : void 0,
|
|
43
|
+
ref(e) {
|
|
44
|
+
t.value = e;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
u
|
|
48
|
+
), {
|
|
49
|
+
reload: () => {
|
|
50
|
+
var e;
|
|
51
|
+
(e = t.value) == null || e.submit();
|
|
52
|
+
},
|
|
53
|
+
reset: () => {
|
|
54
|
+
var e;
|
|
55
|
+
(e = t.value) == null || e.reset();
|
|
56
|
+
},
|
|
57
|
+
getSearchFormValues: () => {
|
|
58
|
+
var r;
|
|
59
|
+
const e = ((r = t.value) == null ? void 0 : r.getSearchFormValues()) || {};
|
|
60
|
+
return o ? o(e) : e;
|
|
61
|
+
},
|
|
62
|
+
getApTableInstance: () => t.value
|
|
63
|
+
}];
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
A as usePageListApTable
|
|
67
|
+
};
|
|
@@ -14,14 +14,17 @@ import { ItemType, MenuTheme, MenuMode } from 'ant-design-vue';
|
|
|
14
14
|
import { CSSMotionProps } from 'ant-design-vue/es/_util/transition';
|
|
15
15
|
import { BuiltinPlacements, TriggerSubMenuAction, SelectEventHandler, MenuClickEventHandler } from 'ant-design-vue/es/menu/src/interface';
|
|
16
16
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
17
|
+
import { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
18
|
+
export * from './hooks/index';
|
|
17
19
|
export type { ApTitleProps } from './title/interface';
|
|
18
20
|
export type { ApExpandAlertProps } from './expandAlert/interface';
|
|
19
21
|
export type { ApLabelProps, ApLabelGroupProps, ApLabelGroupItemProps } from './ap-label/interface';
|
|
20
22
|
export type { ApStatusProps, ApStatusGroupProps, ApStatusGroupItemProps } from './ap-status/interface';
|
|
21
23
|
export type { ApSelectItem, ApSelectLayoutProps } from './ap-select-layout/interface';
|
|
22
|
-
export type { ApInputRadioProps } from './ap-input-radio/interface';
|
|
24
|
+
export type { ApInputRadioProps, ApInputValType } from './ap-input-radio/interface';
|
|
23
25
|
export type { ApExportGroupProps } from './ap-export-group/interface';
|
|
24
26
|
export * from './ap-batch-action-group/interface';
|
|
27
|
+
export type { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
25
28
|
export declare const ApTitle: {
|
|
26
29
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
27
30
|
title: {
|
|
@@ -1098,7 +1101,11 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1098
1101
|
type: PropType<(text: string) => void>;
|
|
1099
1102
|
};
|
|
1100
1103
|
value: {
|
|
1101
|
-
type: PropType<
|
|
1104
|
+
type: PropType<{
|
|
1105
|
+
inputval: string | number;
|
|
1106
|
+
radioVal: string | number;
|
|
1107
|
+
}>;
|
|
1108
|
+
required: true;
|
|
1102
1109
|
};
|
|
1103
1110
|
disabled: {
|
|
1104
1111
|
type: PropType<boolean>;
|
|
@@ -1152,8 +1159,16 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1152
1159
|
type: "up" | "down";
|
|
1153
1160
|
}) => void>;
|
|
1154
1161
|
};
|
|
1162
|
+
onInputRadioChange: {
|
|
1163
|
+
type: PropType<(value: {
|
|
1164
|
+
inputval: string | number;
|
|
1165
|
+
radioVal: string | number;
|
|
1166
|
+
}) => void>;
|
|
1167
|
+
required: true;
|
|
1168
|
+
};
|
|
1155
1169
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1156
1170
|
"update:value": (...args: any[]) => void;
|
|
1171
|
+
InputRadioChange: (...args: any[]) => void;
|
|
1157
1172
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
1158
1173
|
onBlur: {
|
|
1159
1174
|
type: PropType<(e: FocusEvent) => void>;
|
|
@@ -1168,7 +1183,11 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1168
1183
|
type: PropType<(text: string) => void>;
|
|
1169
1184
|
};
|
|
1170
1185
|
value: {
|
|
1171
|
-
type: PropType<
|
|
1186
|
+
type: PropType<{
|
|
1187
|
+
inputval: string | number;
|
|
1188
|
+
radioVal: string | number;
|
|
1189
|
+
}>;
|
|
1190
|
+
required: true;
|
|
1172
1191
|
};
|
|
1173
1192
|
disabled: {
|
|
1174
1193
|
type: PropType<boolean>;
|
|
@@ -1222,8 +1241,16 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1222
1241
|
type: "up" | "down";
|
|
1223
1242
|
}) => void>;
|
|
1224
1243
|
};
|
|
1244
|
+
onInputRadioChange: {
|
|
1245
|
+
type: PropType<(value: {
|
|
1246
|
+
inputval: string | number;
|
|
1247
|
+
radioVal: string | number;
|
|
1248
|
+
}) => void>;
|
|
1249
|
+
required: true;
|
|
1250
|
+
};
|
|
1225
1251
|
}>> & {
|
|
1226
1252
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
1253
|
+
onInputRadioChange?: ((...args: never) => any) | undefined;
|
|
1227
1254
|
}, {
|
|
1228
1255
|
bordered: boolean;
|
|
1229
1256
|
stringMode: boolean;
|
|
@@ -1970,5 +1997,98 @@ export declare const ApImage: DefineComponent<{
|
|
|
1970
1997
|
current?: number;
|
|
1971
1998
|
};
|
|
1972
1999
|
}, {}>;
|
|
2000
|
+
export declare const ApAttachment: DefineComponent<{
|
|
2001
|
+
attachmentList: {
|
|
2002
|
+
type: PropType<Array< AttachmentItemProps>>;
|
|
2003
|
+
default: never[];
|
|
2004
|
+
required: boolean;
|
|
2005
|
+
};
|
|
2006
|
+
textToolTipPlacement: {
|
|
2007
|
+
type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
|
|
2008
|
+
default: string;
|
|
2009
|
+
};
|
|
2010
|
+
fileMorePopoverPlacement: {
|
|
2011
|
+
type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
|
|
2012
|
+
default: string;
|
|
2013
|
+
};
|
|
2014
|
+
color: {
|
|
2015
|
+
type: StringConstructor;
|
|
2016
|
+
};
|
|
2017
|
+
size: {
|
|
2018
|
+
type: StringConstructor;
|
|
2019
|
+
default: string;
|
|
2020
|
+
};
|
|
2021
|
+
needName: {
|
|
2022
|
+
type: PropType<{
|
|
2023
|
+
nameKey?: string;
|
|
2024
|
+
pathKey?: string;
|
|
2025
|
+
}>;
|
|
2026
|
+
default: () => {
|
|
2027
|
+
nameKey: string;
|
|
2028
|
+
pathKey: string;
|
|
2029
|
+
};
|
|
2030
|
+
};
|
|
2031
|
+
getOssAccess: {
|
|
2032
|
+
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
2033
|
+
};
|
|
2034
|
+
disabled: {
|
|
2035
|
+
type: BooleanConstructor;
|
|
2036
|
+
default: boolean;
|
|
2037
|
+
};
|
|
2038
|
+
toolTipBgColor: {
|
|
2039
|
+
type: StringConstructor;
|
|
2040
|
+
};
|
|
2041
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
2042
|
+
attachmentList: {
|
|
2043
|
+
type: PropType<Array< AttachmentItemProps>>;
|
|
2044
|
+
default: never[];
|
|
2045
|
+
required: boolean;
|
|
2046
|
+
};
|
|
2047
|
+
textToolTipPlacement: {
|
|
2048
|
+
type: PropType< ApAttachmentProps["textToolTipPlacement"]>;
|
|
2049
|
+
default: string;
|
|
2050
|
+
};
|
|
2051
|
+
fileMorePopoverPlacement: {
|
|
2052
|
+
type: PropType< ApAttachmentProps["fileMorePopoverPlacement"]>;
|
|
2053
|
+
default: string;
|
|
2054
|
+
};
|
|
2055
|
+
color: {
|
|
2056
|
+
type: StringConstructor;
|
|
2057
|
+
};
|
|
2058
|
+
size: {
|
|
2059
|
+
type: StringConstructor;
|
|
2060
|
+
default: string;
|
|
2061
|
+
};
|
|
2062
|
+
needName: {
|
|
2063
|
+
type: PropType<{
|
|
2064
|
+
nameKey?: string;
|
|
2065
|
+
pathKey?: string;
|
|
2066
|
+
}>;
|
|
2067
|
+
default: () => {
|
|
2068
|
+
nameKey: string;
|
|
2069
|
+
pathKey: string;
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2072
|
+
getOssAccess: {
|
|
2073
|
+
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
2074
|
+
};
|
|
2075
|
+
disabled: {
|
|
2076
|
+
type: BooleanConstructor;
|
|
2077
|
+
default: boolean;
|
|
2078
|
+
};
|
|
2079
|
+
toolTipBgColor: {
|
|
2080
|
+
type: StringConstructor;
|
|
2081
|
+
};
|
|
2082
|
+
}>>, {
|
|
2083
|
+
size: string;
|
|
2084
|
+
disabled: boolean;
|
|
2085
|
+
needName: {
|
|
2086
|
+
nameKey?: string;
|
|
2087
|
+
pathKey?: string;
|
|
2088
|
+
};
|
|
2089
|
+
textToolTipPlacement: TooltipPlacement;
|
|
2090
|
+
attachmentList: AttachmentItemProps[];
|
|
2091
|
+
fileMorePopoverPlacement: TooltipPlacement;
|
|
2092
|
+
}, {}>;
|
|
1973
2093
|
export { ApTransformDataHelper };
|
|
1974
2094
|
export * from './ap-table-modal';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { withInstall as o } from "@aplus-frontend/utils";
|
|
2
|
+
import "./hooks/index.mjs";
|
|
2
3
|
import "./title/ApTitle.vue.mjs";
|
|
3
4
|
import "./expandAlert/ApExpandAlert.vue.mjs";
|
|
4
5
|
import t from "./ap-label/ApLabel.mjs";
|
|
5
|
-
import
|
|
6
|
+
import m from "./ap-label/ApLabelGroup.mjs";
|
|
6
7
|
import "./ap-status/ApStatus.vue.mjs";
|
|
7
8
|
import "./ap-status/ApStatusGroup.vue.mjs";
|
|
8
9
|
import "./ap-select-layout/select-layout.vue.mjs";
|
|
@@ -11,33 +12,35 @@ import "./ap-input-radio/ApInputRadio.vue.mjs";
|
|
|
11
12
|
import "./ap-batch-action/ApBatchAction.vue.mjs";
|
|
12
13
|
import "./ap-batch-action-group/ApBatchActionGroup.vue.mjs";
|
|
13
14
|
import "./ap-image/ApImage.vue.mjs";
|
|
14
|
-
import
|
|
15
|
+
import p from "./ap-attachment/ApAttachment.mjs";
|
|
16
|
+
import { ApTransformDataHelper as to } from "../utils/ap-trans-data/index.mjs";
|
|
15
17
|
import "./ap-batch-action-group/interface.mjs";
|
|
16
|
-
import { default as
|
|
18
|
+
import { default as po } from "./ap-table-modal/index.mjs";
|
|
17
19
|
import r from "./title/ApTitle.vue2.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
20
|
+
import i from "./expandAlert/ApExpandAlert.vue2.mjs";
|
|
21
|
+
import a from "./ap-status/ApStatus.vue2.mjs";
|
|
22
|
+
import n from "./ap-status/ApStatusGroup.vue2.mjs";
|
|
23
|
+
import c from "./ap-select-layout/select-layout.vue2.mjs";
|
|
24
|
+
import f from "./ap-export-group/ApExportGroup.vue2.mjs";
|
|
25
|
+
import s from "./ap-input-radio/ApInputRadio.vue2.mjs";
|
|
26
|
+
import A from "./ap-batch-action/ApBatchAction.vue2.mjs";
|
|
25
27
|
import _ from "./ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
|
|
26
|
-
import
|
|
27
|
-
const
|
|
28
|
+
import e from "./ap-image/ApImage.vue2.mjs";
|
|
29
|
+
const C = o(r), F = i, J = o(t), K = o(a), N = o(n), O = o(c), P = o(f), Q = s, U = A, V = m, W = _, X = e, Y = p;
|
|
28
30
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
Y as ApAttachment,
|
|
32
|
+
U as ApBatchAction,
|
|
33
|
+
W as ApBatchActionGroup,
|
|
34
|
+
F as ApExpandAlert,
|
|
35
|
+
P as ApExportGroup,
|
|
36
|
+
X as ApImage,
|
|
37
|
+
Q as ApInputRadio,
|
|
38
|
+
J as ApLabel,
|
|
39
|
+
V as ApLabelGroup,
|
|
40
|
+
O as ApSelectLayout,
|
|
41
|
+
K as ApStatus,
|
|
42
|
+
N as ApStatusGroup,
|
|
43
|
+
po as ApTableModal,
|
|
44
|
+
C as ApTitle,
|
|
45
|
+
to as ApTransformDataHelper
|
|
43
46
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as ee, Tooltip as
|
|
3
|
-
import { ApForm as
|
|
4
|
-
import { isNumber as i, cloneDeep as f, omit as
|
|
1
|
+
import { defineComponent as M, ref as x, unref as a, useSlots as q, watch as G, openBlock as m, createBlock as y, mergeProps as C, withCtx as d, createVNode as b, createSlots as H, createElementBlock as I, normalizeClass as W, createCommentVNode as w, createElementVNode as $, toDisplayString as Q, normalizeStyle as U, renderList as J, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z } from "vue";
|
|
2
|
+
import { Table as ee, Tooltip as te } from "ant-design-vue";
|
|
3
|
+
import { ApForm as R } from "../ap-form/index.mjs";
|
|
4
|
+
import { isArray as oe, isNumber as i, cloneDeep as f, omit as ae } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as le } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import { QuestionCircleOutlined as
|
|
12
|
-
import { useToken as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
const
|
|
8
|
+
import { isDef as c } from "../utils/index.mjs";
|
|
9
|
+
import ne from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { scrollToRowIndex as re, getColumnIsRequired as se } from "./utils.mjs";
|
|
11
|
+
import { QuestionCircleOutlined as ue } from "@ant-design/icons-vue";
|
|
12
|
+
import { useToken as de } from "ant-design-vue/es/theme/internal";
|
|
13
|
+
import { useNamespace as me } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useGlobalConfig as ie } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
const Le = /* @__PURE__ */ M({
|
|
16
16
|
name: "EditableTableInner",
|
|
17
17
|
__name: "form-item",
|
|
18
18
|
props: {
|
|
@@ -112,114 +112,117 @@ const ve = /* @__PURE__ */ q({
|
|
|
112
112
|
default: () => ({})
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
-
setup(
|
|
116
|
-
expose:
|
|
115
|
+
setup(B, {
|
|
116
|
+
expose: k
|
|
117
117
|
}) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
const l = B;
|
|
119
|
+
function D(e, t) {
|
|
120
|
+
return oe(t) ? t.reduce((o, n) => o == null ? void 0 : o[n], e) : e == null ? void 0 : e[t];
|
|
121
|
+
}
|
|
122
|
+
const {
|
|
123
|
+
internalInstance: r,
|
|
124
|
+
model: L
|
|
125
|
+
} = le(), s = x(D(a(L), l.name) || []), T = q(), E = R.useWatch(l.name);
|
|
126
|
+
G(() => E.value, (e) => {
|
|
127
|
+
var t;
|
|
128
|
+
s.value = e, (t = l.onChange) == null || t.call(l, e);
|
|
126
129
|
}, {
|
|
127
130
|
deep: !0
|
|
128
131
|
});
|
|
129
132
|
const {
|
|
130
|
-
b:
|
|
131
|
-
em:
|
|
132
|
-
} =
|
|
133
|
-
function
|
|
133
|
+
b: F,
|
|
134
|
+
em: N
|
|
135
|
+
} = me("editable-table"), p = x(), S = ie("valueTypeMap"), [, V] = de(), _ = ne(l, S);
|
|
136
|
+
function v(e, t) {
|
|
134
137
|
var u;
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
138
|
+
const o = ((u = a(s)) == null ? void 0 : u.length) || 0;
|
|
139
|
+
if (c(l.maxLength) && o >= l.maxLength)
|
|
137
140
|
return;
|
|
138
|
-
const
|
|
139
|
-
|
|
141
|
+
const n = [...a(s) || []];
|
|
142
|
+
c(t) ? n.splice(t, 0, {
|
|
140
143
|
...e || {}
|
|
141
|
-
}) :
|
|
144
|
+
}) : n.push({
|
|
142
145
|
...e || {}
|
|
143
|
-
}),
|
|
146
|
+
}), r == null || r.setFieldValue(l.name, n);
|
|
144
147
|
}
|
|
145
|
-
function z(e,
|
|
148
|
+
function z(e, t = "suffix") {
|
|
146
149
|
var g;
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
150
|
+
const o = ((g = a(s)) == null ? void 0 : g.length) || 0, n = i(e) ? e : e.length;
|
|
151
|
+
if (c(l.maxLength) && o + n > l.maxLength)
|
|
149
152
|
return;
|
|
150
|
-
const u = [...
|
|
151
|
-
|
|
153
|
+
const u = [...a(s) || []], h = i(e) ? new Array(e).fill({}) : f(e);
|
|
154
|
+
t === "suffix" ? u.push(...h) : u.unshift(...h), r == null || r.setFieldValue(l.name, u);
|
|
152
155
|
}
|
|
153
156
|
function P(e) {
|
|
154
|
-
let
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
+
let t = f(a(s) || []);
|
|
158
|
+
const o = i(e) ? [e] : e;
|
|
159
|
+
t = t.filter((n, u) => !o.includes(u)), r == null || r.setFieldValue(l.name, t);
|
|
157
160
|
}
|
|
158
161
|
function j() {
|
|
159
|
-
return
|
|
162
|
+
return a(s);
|
|
160
163
|
}
|
|
161
|
-
function
|
|
162
|
-
var
|
|
163
|
-
return (
|
|
164
|
+
function A(e) {
|
|
165
|
+
var t;
|
|
166
|
+
return (t = a(s)) == null ? void 0 : t[e];
|
|
164
167
|
}
|
|
165
|
-
function
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
...
|
|
169
|
-
...
|
|
170
|
-
},
|
|
168
|
+
function O(e, t) {
|
|
169
|
+
const o = f(a(s));
|
|
170
|
+
o[e] && (o[e] = {
|
|
171
|
+
...o[e],
|
|
172
|
+
...t
|
|
173
|
+
}, r == null || r.setFieldValue(l.name, [...o]));
|
|
171
174
|
}
|
|
172
|
-
function K(e,
|
|
173
|
-
var
|
|
174
|
-
const
|
|
175
|
-
|
|
175
|
+
function K(e, t) {
|
|
176
|
+
var n;
|
|
177
|
+
const o = e === "end" ? s.value.length - 1 : e;
|
|
178
|
+
re(o, (n = p.value) == null ? void 0 : n.$el, t);
|
|
176
179
|
}
|
|
177
|
-
return
|
|
178
|
-
add:
|
|
180
|
+
return k({
|
|
181
|
+
add: v,
|
|
179
182
|
remove: P,
|
|
180
|
-
getRowData:
|
|
183
|
+
getRowData: A,
|
|
181
184
|
getRowsData: j,
|
|
182
|
-
setRowData:
|
|
185
|
+
setRowData: O,
|
|
183
186
|
addMultiple: z,
|
|
184
187
|
scrollTo: K
|
|
185
|
-
}), (e,
|
|
188
|
+
}), (e, t) => (m(), y(a(R).FormItem, C(e.formItem, {
|
|
186
189
|
name: e.name,
|
|
187
190
|
label: e.label
|
|
188
191
|
}), {
|
|
189
|
-
default: d(() => [
|
|
190
|
-
class:
|
|
191
|
-
columns:
|
|
192
|
+
default: d(() => [b(a(ee), C(a(ae)(l, ["name", "maxLength", "onChange"]), {
|
|
193
|
+
class: a(F)(),
|
|
194
|
+
columns: a(_),
|
|
192
195
|
"data-source": s.value,
|
|
193
196
|
ref_key: "tableRef",
|
|
194
|
-
ref:
|
|
195
|
-
}),
|
|
197
|
+
ref: p
|
|
198
|
+
}), H({
|
|
196
199
|
headerCell: d(({
|
|
197
|
-
column:
|
|
198
|
-
}) => [
|
|
200
|
+
column: o
|
|
201
|
+
}) => [a(se)(o) ? (m(), I("span", {
|
|
199
202
|
key: 0,
|
|
200
|
-
class: W(
|
|
201
|
-
}, "*", 2)) :
|
|
203
|
+
class: W(a(N)("header-cell", "required"))
|
|
204
|
+
}, "*", 2)) : w("", !0), $("span", null, Q(o.title), 1), o.tooltip ? (m(), y(a(te), {
|
|
202
205
|
key: 1,
|
|
203
|
-
title:
|
|
206
|
+
title: o.tooltip,
|
|
204
207
|
placement: "bottom"
|
|
205
208
|
}, {
|
|
206
|
-
default: d(() => [
|
|
209
|
+
default: d(() => [b(a(ue), {
|
|
207
210
|
style: U({
|
|
208
211
|
paddingLeft: "4px",
|
|
209
|
-
color:
|
|
212
|
+
color: a(V).colorPrimary
|
|
210
213
|
})
|
|
211
214
|
}, null, 8, ["style"])]),
|
|
212
215
|
_: 2
|
|
213
|
-
}, 1032, ["title"])) :
|
|
216
|
+
}, 1032, ["title"])) : w("", !0)]),
|
|
214
217
|
_: 2
|
|
215
|
-
}, [J(
|
|
216
|
-
name:
|
|
217
|
-
fn: d((u) => [X(e.$slots,
|
|
218
|
+
}, [J(T, (o, n) => ({
|
|
219
|
+
name: n,
|
|
220
|
+
fn: d((u) => [X(e.$slots, n, Y(Z(u || {})))])
|
|
218
221
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
219
222
|
_: 3
|
|
220
223
|
}, 16, ["name", "label"]));
|
|
221
224
|
}
|
|
222
225
|
});
|
|
223
226
|
export {
|
|
224
|
-
|
|
227
|
+
Le as default
|
|
225
228
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { mergeClass as y, getFinalNode as
|
|
4
|
-
import { updateFormProps as
|
|
1
|
+
import { computed as h, unref as I } from "vue";
|
|
2
|
+
import { omit as R, isFunction as C, isArray as s } from "lodash-unified";
|
|
3
|
+
import { mergeClass as y, getFinalNode as N } from "../utils.mjs";
|
|
4
|
+
import { updateFormProps as T, getFieldProps as v, getPlaceholder as w, getTableRenderProps as A } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
6
|
import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
|
|
7
|
-
const
|
|
7
|
+
const D = (d, f) => {
|
|
8
8
|
const {
|
|
9
|
-
t:
|
|
9
|
+
t: x
|
|
10
10
|
} = G();
|
|
11
|
-
return
|
|
12
|
-
const t =
|
|
11
|
+
return h(() => {
|
|
12
|
+
const t = d.columns;
|
|
13
13
|
if (!t)
|
|
14
14
|
return [];
|
|
15
|
-
function c(
|
|
16
|
-
return
|
|
17
|
-
...
|
|
15
|
+
function c(g) {
|
|
16
|
+
return g.map((e) => ({
|
|
17
|
+
...R(e, ["ellipsis"]),
|
|
18
18
|
children: c(e.children || []),
|
|
19
19
|
customRender({
|
|
20
|
-
value:
|
|
20
|
+
value: l,
|
|
21
21
|
...n
|
|
22
22
|
}) {
|
|
23
|
-
const
|
|
23
|
+
const o = C(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
|
|
24
24
|
if (!e.valueType && !e.customRender && !e.customRenderFormItem)
|
|
25
25
|
return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
|
|
26
26
|
let r;
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
value:
|
|
27
|
+
if (o) {
|
|
28
|
+
const a = T(e, v(e.fieldProps, {
|
|
29
|
+
value: l,
|
|
30
30
|
...n
|
|
31
31
|
})), i = {};
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
return (
|
|
32
|
+
d.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (b) => {
|
|
33
|
+
var m;
|
|
34
|
+
return (m = d.onFieldChange) == null ? void 0 : m.call(d, n.index, e.dataIndex, b);
|
|
35
35
|
});
|
|
36
|
-
const
|
|
36
|
+
const F = s(e.dataIndex) ? e.dataIndex : [e.dataIndex];
|
|
37
37
|
r = {
|
|
38
|
-
name: [
|
|
39
|
-
...
|
|
38
|
+
name: [...s(d.name) ? d.name : [d.name], n.index, ...F],
|
|
39
|
+
...a || {},
|
|
40
40
|
// 格式化placeholder
|
|
41
|
-
placeholder: w(
|
|
41
|
+
placeholder: w(x, e.valueType, a == null ? void 0 : a.placeholder),
|
|
42
42
|
field: {
|
|
43
43
|
style: "width: 100%",
|
|
44
|
-
...(
|
|
44
|
+
...(a == null ? void 0 : a.field) || {},
|
|
45
45
|
...i,
|
|
46
|
-
class: y("is-editable",
|
|
46
|
+
class: y("is-editable", a.class)
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
} else
|
|
50
50
|
r = {
|
|
51
51
|
field: A(e, {
|
|
52
|
-
value:
|
|
52
|
+
value: l,
|
|
53
53
|
...n
|
|
54
54
|
})
|
|
55
55
|
};
|
|
56
|
-
const u =
|
|
56
|
+
const u = N(e, o, r, l, n.record, I(f));
|
|
57
57
|
return e.customRender ? e.customRender({
|
|
58
|
-
value:
|
|
58
|
+
value: l,
|
|
59
59
|
...n,
|
|
60
|
-
editable:
|
|
60
|
+
editable: o,
|
|
61
61
|
originalNode: u
|
|
62
62
|
}) : u;
|
|
63
63
|
}
|
|
@@ -67,5 +67,5 @@ const B = (l, m) => {
|
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
D as default
|
|
71
71
|
};
|
|
@@ -94,9 +94,9 @@ export type EditableTableProps<RecordType = any> = Omit<TableProps<RecordType>,
|
|
|
94
94
|
export type EditableTableFormItemProps<RecordType = any> = Omit<EditableTableProps<RecordType>, 'name'> & {
|
|
95
95
|
label?: string;
|
|
96
96
|
/**
|
|
97
|
-
* FormItem的name
|
|
97
|
+
* FormItem的name
|
|
98
98
|
*/
|
|
99
|
-
name:
|
|
99
|
+
name: NamePath;
|
|
100
100
|
/**
|
|
101
101
|
* 额外的表单项配置属性
|
|
102
102
|
*/
|