@aplus-frontend/ui 0.5.29 → 0.5.31
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 +50 -48
- package/es/src/ap-field/interface.d.ts +3 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +45 -36
- package/es/src/ap-grid/editable/index.vue.mjs +21 -12
- package/es/src/ap-grid/index.vue.mjs +106 -102
- package/es/src/ap-grid/interface.d.ts +5 -0
- package/es/src/ap-grid/utils/col.mjs +88 -77
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
- package/es/src/business/ap-product-info/ApProductInfo.mjs +59 -0
- package/es/src/business/ap-product-info/constans.d.ts +11 -14
- package/es/src/business/ap-product-info/constans.mjs +21 -0
- package/es/src/business/ap-product-info/index.d.ts +86 -0
- package/es/src/business/ap-product-info/index.mjs +7 -0
- package/es/src/business/ap-product-info/interface.d.ts +9 -7
- package/es/src/business/ap-product-info/interface.mjs +1 -0
- package/es/src/business/ap-product-info/style/css.d.ts +0 -0
- package/es/src/business/ap-product-info/style/css.js +1 -0
- package/es/src/business/ap-product-info/style/index.d.ts +0 -0
- package/es/src/business/ap-product-info/style/index.js +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +21 -19
- package/es/src/components.d.ts +1 -0
- package/es/src/editable-table/form-item.vue.mjs +15 -7
- package/es/src/editable-table/index.vue.mjs +36 -28
- package/es/src/index.mjs +36 -34
- package/es/src/path-map.mjs +1 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/interface.d.ts +3 -0
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +5 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +22 -25
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -0
- package/lib/src/business/ap-product-info/constans.d.ts +11 -14
- package/lib/src/business/ap-product-info/constans.js +1 -0
- package/lib/src/business/ap-product-info/index.d.ts +86 -0
- package/lib/src/business/ap-product-info/index.js +1 -0
- package/lib/src/business/ap-product-info/interface.d.ts +9 -7
- package/lib/src/business/ap-product-info/interface.js +1 -0
- package/lib/src/business/ap-product-info/style/css.cjs +1 -0
- package/lib/src/business/ap-product-info/style/css.d.ts +0 -0
- package/lib/src/business/ap-product-info/style/index.cjs +1 -0
- package/lib/src/business/ap-product-info/style/index.d.ts +0 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/components.d.ts +1 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +1 -1
- package/theme/ap-product-info/ap-product-info.css +87 -0
- package/theme/ap-product-info/ap-product-info.less +100 -0
- package/theme/index.css +87 -0
- package/theme/index.less +1 -0
|
@@ -1,46 +1,43 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { ApProductInfoValue } from './interface';
|
|
3
3
|
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
4
|
-
|
|
4
|
+
title: {
|
|
5
5
|
type: StringConstructor;
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
imgSrc: {
|
|
9
9
|
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
type:
|
|
12
|
+
preview: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
13
15
|
};
|
|
14
|
-
|
|
15
|
-
type: PropType<
|
|
16
|
+
values: {
|
|
17
|
+
type: PropType< ApProductInfoValue[]>;
|
|
18
|
+
default: () => never[];
|
|
16
19
|
};
|
|
17
|
-
|
|
20
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
21
|
+
title: {
|
|
18
22
|
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
19
24
|
};
|
|
20
|
-
onTitleClick: {
|
|
21
|
-
type: PropType< ApProductInfoProps["onTitleClick"]>;
|
|
22
|
-
};
|
|
23
|
-
}>, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
24
25
|
imgSrc: {
|
|
25
26
|
type: StringConstructor;
|
|
26
27
|
default: string;
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
type:
|
|
30
|
-
|
|
31
|
-
asku: {
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
};
|
|
34
|
-
asin: {
|
|
35
|
-
type: PropType< ApProductInfoProps["asin"]>;
|
|
36
|
-
};
|
|
37
|
-
msku: {
|
|
38
|
-
type: StringConstructor;
|
|
29
|
+
preview: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
39
32
|
};
|
|
40
|
-
|
|
41
|
-
type: PropType<
|
|
33
|
+
values: {
|
|
34
|
+
type: PropType< ApProductInfoValue[]>;
|
|
35
|
+
default: () => never[];
|
|
42
36
|
};
|
|
43
37
|
}>> & Readonly<{}>, {
|
|
38
|
+
values: ApProductInfoValue[];
|
|
39
|
+
title: string;
|
|
40
|
+
preview: boolean;
|
|
44
41
|
imgSrc: string;
|
|
45
42
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
46
43
|
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent as s, createVNode as e, createTextVNode as a, Fragment as d } from "vue";
|
|
2
|
+
import { ApProductInfoProps as f } from "./constans.mjs";
|
|
3
|
+
import "../../config-provider/index.mjs";
|
|
4
|
+
import { Tooltip as v } from "@aplus-frontend/antdv";
|
|
5
|
+
import { ApImage as p } from "../ap-image/index.mjs";
|
|
6
|
+
import { useNamespace as m } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { useGlobalConfig as g } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
const P = /* @__PURE__ */ s({
|
|
9
|
+
name: "ApProductInfo",
|
|
10
|
+
props: f(),
|
|
11
|
+
setup(i) {
|
|
12
|
+
const {
|
|
13
|
+
b: u,
|
|
14
|
+
e: t,
|
|
15
|
+
m: o
|
|
16
|
+
} = m("ap-product-info"), c = g("uiMode", "aplus"), r = (l) => typeof l == "function" ? l() : l || "--";
|
|
17
|
+
return () => e("div", {
|
|
18
|
+
class: [u(), `${o(c.value)}`]
|
|
19
|
+
}, [e("div", {
|
|
20
|
+
class: t("img")
|
|
21
|
+
}, [e(p, {
|
|
22
|
+
src: i.imgSrc,
|
|
23
|
+
width: 44,
|
|
24
|
+
height: 44,
|
|
25
|
+
preview: i.preview
|
|
26
|
+
}, null)]), e("div", {
|
|
27
|
+
class: [t("content")]
|
|
28
|
+
}, [i.title ? e(v, null, {
|
|
29
|
+
default: () => [e("div", {
|
|
30
|
+
class: t("title")
|
|
31
|
+
}, [i.title])],
|
|
32
|
+
title: () => e("div", {
|
|
33
|
+
class: t("title-tip")
|
|
34
|
+
}, [i.title])
|
|
35
|
+
}) : e("div", {
|
|
36
|
+
class: t("title")
|
|
37
|
+
}, [a("--")]), i.values && e("div", {
|
|
38
|
+
class: t("row-divider")
|
|
39
|
+
}, [i.values.map((l, n) => e(d, null, [e("div", {
|
|
40
|
+
key: n,
|
|
41
|
+
class: [t("item"), l.col === 2 && o("full-width"), n % 2 === 0 || l.col == 2 ? o("left") : o("right")]
|
|
42
|
+
}, [l.label && e("div", {
|
|
43
|
+
class: t("label")
|
|
44
|
+
}, [l.label, e("span", null, [a(":")])]), e("div", {
|
|
45
|
+
class: [t("value"), l.link && o("link")],
|
|
46
|
+
title: typeof l.value != "function" ? r(l.value) : "",
|
|
47
|
+
onClick: () => {
|
|
48
|
+
l.link && window.open(l.link, "_blank");
|
|
49
|
+
}
|
|
50
|
+
}, [typeof l.value == "function" ? l.value() : r(l.value)])]), l.col == 1 && n % 2 == 0 ? e("div", {
|
|
51
|
+
class: t("divider")
|
|
52
|
+
}, [e("div", {
|
|
53
|
+
class: t("divider-vertical")
|
|
54
|
+
}, null)]) : null]))])])]);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
P as default
|
|
59
|
+
};
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
imgSrc: {
|
|
5
|
-
type: StringConstructor;
|
|
6
|
-
default: string;
|
|
7
|
-
};
|
|
2
|
+
import { ApProductInfoValue } from './interface';
|
|
3
|
+
export declare const ApProductInfoProps: () => {
|
|
8
4
|
title: {
|
|
9
5
|
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
imgSrc: {
|
|
12
9
|
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
|
-
type:
|
|
16
|
-
|
|
17
|
-
msku: {
|
|
18
|
-
type: StringConstructor;
|
|
12
|
+
preview: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
19
15
|
};
|
|
20
|
-
|
|
21
|
-
type: PropType<
|
|
16
|
+
values: {
|
|
17
|
+
type: PropType<ApProductInfoValue[]>;
|
|
18
|
+
default: () => never[];
|
|
22
19
|
};
|
|
23
20
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const e = () => ({
|
|
2
|
+
title: {
|
|
3
|
+
type: String,
|
|
4
|
+
default: ""
|
|
5
|
+
},
|
|
6
|
+
imgSrc: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
preview: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
values: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
e as ApProductInfoProps
|
|
21
|
+
};
|
|
@@ -1 +1,87 @@
|
|
|
1
|
+
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps, Plugin } from 'vue';
|
|
2
|
+
import { ApProductInfoValue } from './interface';
|
|
1
3
|
export * from './interface';
|
|
4
|
+
declare const ApProductInfo: {
|
|
5
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
6
|
+
title: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
imgSrc: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
preview: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
values: {
|
|
19
|
+
type: PropType< ApProductInfoValue[]>;
|
|
20
|
+
default: () => never[];
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
23
|
+
values: ApProductInfoValue[];
|
|
24
|
+
title: string;
|
|
25
|
+
preview: boolean;
|
|
26
|
+
imgSrc: string;
|
|
27
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
28
|
+
P: {};
|
|
29
|
+
B: {};
|
|
30
|
+
D: {};
|
|
31
|
+
C: {};
|
|
32
|
+
M: {};
|
|
33
|
+
Defaults: {};
|
|
34
|
+
}, Readonly< ExtractPropTypes<{
|
|
35
|
+
title: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
imgSrc: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
preview: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
values: {
|
|
48
|
+
type: PropType< ApProductInfoValue[]>;
|
|
49
|
+
default: () => never[];
|
|
50
|
+
};
|
|
51
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
52
|
+
values: ApProductInfoValue[];
|
|
53
|
+
title: string;
|
|
54
|
+
preview: boolean;
|
|
55
|
+
imgSrc: string;
|
|
56
|
+
}>;
|
|
57
|
+
__isFragment?: never;
|
|
58
|
+
__isTeleport?: never;
|
|
59
|
+
__isSuspense?: never;
|
|
60
|
+
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
61
|
+
title: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
imgSrc: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
preview: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
values: {
|
|
74
|
+
type: PropType< ApProductInfoValue[]>;
|
|
75
|
+
default: () => never[];
|
|
76
|
+
};
|
|
77
|
+
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
78
|
+
values: ApProductInfoValue[];
|
|
79
|
+
title: string;
|
|
80
|
+
preview: boolean;
|
|
81
|
+
imgSrc: string;
|
|
82
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
83
|
+
$props: {
|
|
84
|
+
onClick?: () => void;
|
|
85
|
+
};
|
|
86
|
+
}));
|
|
87
|
+
export { ApProductInfo };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
1
2
|
export interface ApProductInfoProps {
|
|
2
3
|
imgSrc?: string;
|
|
4
|
+
preview?: boolean;
|
|
3
5
|
title?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
values?: ApProductInfoValue[];
|
|
7
|
+
}
|
|
8
|
+
export interface ApProductInfoValue {
|
|
9
|
+
label?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
col?: number;
|
|
12
|
+
value?: string | number | VNode | (() => VNode);
|
|
11
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui/theme/ap-product-info/ap-product-info.css';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@aplus-frontend/ui/theme/ap-product-info/ap-product-info.less';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { default as A } from "./ap-table-modal/index.mjs";
|
|
2
2
|
import { ApAttachment as x } from "./ap-attachment/index.mjs";
|
|
3
|
-
import { ApBatchAction as
|
|
4
|
-
import { ApBatchActionGroup as
|
|
5
|
-
import { ApButtonGroup as
|
|
3
|
+
import { ApBatchAction as a } from "./ap-batch-action/index.mjs";
|
|
4
|
+
import { ApBatchActionGroup as n } from "./ap-batch-action-group/index.mjs";
|
|
5
|
+
import { ApButtonGroup as c } from "./ap-button-group/index.mjs";
|
|
6
6
|
import { ApCard as d } from "./ap-card/index.mjs";
|
|
7
7
|
import { ApExpandAlert as G } from "./ap-expand-alert/index.mjs";
|
|
8
8
|
import { ApExportGroup as h } from "./ap-export-group/index.mjs";
|
|
9
|
-
import { ApImage as
|
|
10
|
-
import { ApInputRadio as
|
|
9
|
+
import { ApImage as L } from "./ap-image/index.mjs";
|
|
10
|
+
import { ApInputRadio as B } from "./ap-input-radio/index.mjs";
|
|
11
11
|
import { ApLabel as T, ApLabelGroup as y } from "./ap-label/index.mjs";
|
|
12
|
-
import { ApLadder as
|
|
13
|
-
import { ApSelectLayout as
|
|
14
|
-
import { ApStatus as
|
|
12
|
+
import { ApLadder as g } from "./ap-ladder/index.mjs";
|
|
13
|
+
import { ApSelectLayout as z } from "./ap-select-layout/index.mjs";
|
|
14
|
+
import { ApStatus as D, ApStatusGroup as H } from "./ap-status/index.mjs";
|
|
15
15
|
import { ApTitle as R } from "./ap-title/index.mjs";
|
|
16
16
|
import "./hooks/index.mjs";
|
|
17
17
|
import { ApSummary as k } from "./ap-summary/index.mjs";
|
|
@@ -20,30 +20,32 @@ import { ApExtensionSelect as J, ApGroupSearch as K, ApPopoverSelect as N } from
|
|
|
20
20
|
import "./ap-upload-file/index.mjs";
|
|
21
21
|
import "./batch-input-group/index.mjs";
|
|
22
22
|
import { ApSizeInput as Q } from "./ap-size-input/index.mjs";
|
|
23
|
-
import {
|
|
23
|
+
import { ApProductInfo as V } from "./ap-product-info/index.mjs";
|
|
24
|
+
import { ApTransformDataHelper as X } from "../utils/ap-trans-data/index.mjs";
|
|
24
25
|
export {
|
|
25
26
|
w as ApAppendix,
|
|
26
27
|
x as ApAttachment,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
a as ApBatchAction,
|
|
29
|
+
n as ApBatchActionGroup,
|
|
30
|
+
c as ApButtonGroup,
|
|
30
31
|
d as ApCard,
|
|
31
32
|
G as ApExpandAlert,
|
|
32
33
|
h as ApExportGroup,
|
|
33
34
|
J as ApExtensionSelect,
|
|
34
35
|
K as ApGroupSearch,
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
L as ApImage,
|
|
37
|
+
B as ApInputRadio,
|
|
37
38
|
T as ApLabel,
|
|
38
39
|
y as ApLabelGroup,
|
|
39
|
-
|
|
40
|
+
g as ApLadder,
|
|
40
41
|
N as ApPopoverSelect,
|
|
41
|
-
|
|
42
|
+
V as ApProductInfo,
|
|
43
|
+
z as ApSelectLayout,
|
|
42
44
|
Q as ApSizeInput,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
D as ApStatus,
|
|
46
|
+
H as ApStatusGroup,
|
|
45
47
|
k as ApSummary,
|
|
46
48
|
A as ApTableModal,
|
|
47
49
|
R as ApTitle,
|
|
48
|
-
|
|
50
|
+
X as ApTransformDataHelper
|
|
49
51
|
};
|
package/es/src/components.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare module '@vue/runtime-core' {
|
|
|
14
14
|
ApLabel: typeof components.ApLabel;
|
|
15
15
|
ApLabelGroup: typeof components.ApLabelGroup;
|
|
16
16
|
ApLadder: typeof components.ApLadder;
|
|
17
|
+
ApProductInfo: typeof components.ApProductInfo;
|
|
17
18
|
ApSelectLayout: typeof components.ApSelectLayout;
|
|
18
19
|
ApStatus: typeof components.ApStatus;
|
|
19
20
|
ApStatusGroup: typeof components.ApStatusGroup;
|
|
@@ -137,24 +137,32 @@ const we = /* @__PURE__ */ O({
|
|
|
137
137
|
const o = {
|
|
138
138
|
...e || {}
|
|
139
139
|
};
|
|
140
|
-
a == null || a.setFieldValue(l.name, o, !0, (
|
|
141
|
-
|
|
140
|
+
a == null || a.setFieldValue(l.name, o, !0, (r, f) => {
|
|
141
|
+
if (!r[f]) {
|
|
142
|
+
r[f] = [o];
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
ee(t) ? r[f].push(o) : r[f].splice(t, 0, o);
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
148
|
function k(e, t = "suffix") {
|
|
145
|
-
var
|
|
146
|
-
const n = ((
|
|
149
|
+
var r;
|
|
150
|
+
const n = ((r = s(d)) == null ? void 0 : r.length) || 0, o = m(e) ? e : e.length;
|
|
147
151
|
if (b(l.maxLength) && n + o > l.maxLength)
|
|
148
152
|
return;
|
|
149
153
|
const u = m(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
|
|
150
|
-
a == null || a.setFieldValue(l.name, u, !0, (
|
|
151
|
-
|
|
154
|
+
a == null || a.setFieldValue(l.name, u, !0, (f, i) => {
|
|
155
|
+
if (!f[i]) {
|
|
156
|
+
f[i] = [...u];
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
t === "suffix" ? f[i].push(...u) : f[i].unshift(...u);
|
|
152
160
|
});
|
|
153
161
|
}
|
|
154
162
|
function v(e) {
|
|
155
163
|
const t = new Set(m(e) ? [e] : e);
|
|
156
164
|
a == null || a.setFieldValue(l.name, void 0, !0, (n, o) => {
|
|
157
|
-
n[o] = n[o].filter((u,
|
|
165
|
+
n[o] = n[o].filter((u, r) => !t.has(r));
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
168
|
function E() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as $, useSlots as q, ref as w, watch as y, unref as
|
|
1
|
+
import { defineComponent as $, useSlots as q, ref as w, watch as y, unref as r, createBlock as J, openBlock as Q, withCtx as h, createVNode as C, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
|
|
2
2
|
import { Table as ae } from "@aplus-frontend/antdv";
|
|
3
3
|
import { ApForm as x } from "../ap-form/index.mjs";
|
|
4
4
|
import { isEqual as ne, isArray as b, isUndefined as oe, isNumber as g, cloneDeep as le, omit as R } from "lodash-unified";
|
|
@@ -6,8 +6,8 @@ import "../config-provider/index.mjs";
|
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
7
|
import { isDef as F } from "../utils/index.mjs";
|
|
8
8
|
import { scrollToRowIndex as ue } from "./utils.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { useNamespace as
|
|
9
|
+
import re from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { useNamespace as se } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
import { useControllableValue as ie } from "../hooks/useControllableValue.mjs";
|
|
12
12
|
import { useGlobalConfig as de } from "../config-provider/hooks/use-global-config.mjs";
|
|
13
13
|
const Re = /* @__PURE__ */ $({
|
|
@@ -115,7 +115,7 @@ const Re = /* @__PURE__ */ $({
|
|
|
115
115
|
}) {
|
|
116
116
|
const n = B, {
|
|
117
117
|
b: L
|
|
118
|
-
} =
|
|
118
|
+
} = se("editable-table"), _ = q(), D = T, v = w(), {
|
|
119
119
|
value: m,
|
|
120
120
|
updateValue: E
|
|
121
121
|
} = ie(n, D), i = w(), N = de("valueTypeMap"), c = x.useWatch(n.name, i);
|
|
@@ -127,11 +127,11 @@ const Re = /* @__PURE__ */ $({
|
|
|
127
127
|
flush: "post"
|
|
128
128
|
}), y(m, (e) => {
|
|
129
129
|
var t;
|
|
130
|
-
e !==
|
|
130
|
+
e !== r(c) && (ne(e, r(c)) || (t = i.value) == null || t.setFieldValue(n.name, e));
|
|
131
131
|
}, {
|
|
132
132
|
deep: !0
|
|
133
133
|
});
|
|
134
|
-
const S =
|
|
134
|
+
const S = re(n, N);
|
|
135
135
|
function k() {
|
|
136
136
|
var e;
|
|
137
137
|
(e = i.value) == null || e.resetFields();
|
|
@@ -145,36 +145,44 @@ const Re = /* @__PURE__ */ $({
|
|
|
145
145
|
return o == null ? void 0 : o[n.name];
|
|
146
146
|
}
|
|
147
147
|
function P(e, t) {
|
|
148
|
-
var l, u,
|
|
149
|
-
const o = ((l =
|
|
148
|
+
var l, u, s;
|
|
149
|
+
const o = ((l = r(m)) == null ? void 0 : l.length) || 0;
|
|
150
150
|
if (F(n.maxLength) && o >= n.maxLength)
|
|
151
151
|
return;
|
|
152
152
|
const a = {
|
|
153
153
|
...e || {}
|
|
154
154
|
};
|
|
155
|
-
(
|
|
156
|
-
|
|
155
|
+
(s = (u = i.value) == null ? void 0 : u.setFieldValue) == null || s.call(u, n.name, a, !0, (d, f) => {
|
|
156
|
+
if (!d[f]) {
|
|
157
|
+
d[f] = [a];
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
oe(t) ? d[f].push(a) : d[f].splice(t, 0, a);
|
|
157
161
|
});
|
|
158
162
|
}
|
|
159
163
|
function j(e, t = "suffix") {
|
|
160
|
-
var u,
|
|
161
|
-
const o = ((u =
|
|
164
|
+
var u, s, d;
|
|
165
|
+
const o = ((u = r(m)) == null ? void 0 : u.length) || 0, a = g(e) ? e : e.length;
|
|
162
166
|
if (F(n.maxLength) && o + a > n.maxLength)
|
|
163
167
|
return;
|
|
164
168
|
const l = g(e) ? new Array(e).fill({}) : le(e);
|
|
165
|
-
(d = (
|
|
166
|
-
|
|
169
|
+
(d = (s = i.value) == null ? void 0 : s.setFieldValue) == null || d.call(s, n.name, l, !0, (f, p) => {
|
|
170
|
+
if (!f[p]) {
|
|
171
|
+
f[p] = [...l];
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
t === "suffix" ? f[p].push(...l) : f[p].unshift(...l);
|
|
167
175
|
});
|
|
168
176
|
}
|
|
169
177
|
function z(e) {
|
|
170
178
|
var o, a;
|
|
171
179
|
const t = new Set(g(e) ? [e] : e);
|
|
172
180
|
(a = (o = i.value) == null ? void 0 : o.setFieldValue) == null || a.call(o, n.name, void 0, !0, (l, u) => {
|
|
173
|
-
l[u] = l[u].filter((
|
|
181
|
+
l[u] = l[u].filter((s, d) => !t.has(d));
|
|
174
182
|
});
|
|
175
183
|
}
|
|
176
184
|
function O() {
|
|
177
|
-
return
|
|
185
|
+
return r(m);
|
|
178
186
|
}
|
|
179
187
|
function K(e) {
|
|
180
188
|
var t;
|
|
@@ -182,13 +190,13 @@ const Re = /* @__PURE__ */ $({
|
|
|
182
190
|
}
|
|
183
191
|
function U(e) {
|
|
184
192
|
var t;
|
|
185
|
-
return (t =
|
|
193
|
+
return (t = r(m)) == null ? void 0 : t[e];
|
|
186
194
|
}
|
|
187
195
|
function G(e, t, o = !0) {
|
|
188
196
|
var a, l;
|
|
189
|
-
(l = (a = i.value) == null ? void 0 : a.setFieldValue) == null || l.call(a, n.name, void 0, !0, (u,
|
|
190
|
-
!u[
|
|
191
|
-
...o ? u[
|
|
197
|
+
(l = (a = i.value) == null ? void 0 : a.setFieldValue) == null || l.call(a, n.name, void 0, !0, (u, s) => {
|
|
198
|
+
!u[s] || !u[s][e] || (u[s][e] = {
|
|
199
|
+
...o ? u[s][e] : {},
|
|
192
200
|
...t
|
|
193
201
|
});
|
|
194
202
|
});
|
|
@@ -214,26 +222,26 @@ const Re = /* @__PURE__ */ $({
|
|
|
214
222
|
scrollTo: H,
|
|
215
223
|
clear: W,
|
|
216
224
|
setTableData: K
|
|
217
|
-
}), (e, t) => (Q(), J(
|
|
225
|
+
}), (e, t) => (Q(), J(r(x), {
|
|
218
226
|
ref_key: "formRef",
|
|
219
227
|
ref: i,
|
|
220
228
|
"initial-values": {
|
|
221
|
-
[n.name]:
|
|
229
|
+
[n.name]: r(m)
|
|
222
230
|
}
|
|
223
231
|
}, {
|
|
224
|
-
default: h(() => [C(
|
|
232
|
+
default: h(() => [C(r(x).FormItem, {
|
|
225
233
|
name: e.name,
|
|
226
234
|
"no-style": ""
|
|
227
235
|
}, {
|
|
228
|
-
default: h(() => [C(
|
|
236
|
+
default: h(() => [C(r(ae), X(r(R)(n, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
229
237
|
ref_key: "tableRef",
|
|
230
238
|
ref: v,
|
|
231
|
-
class:
|
|
232
|
-
columns:
|
|
233
|
-
"data-source":
|
|
239
|
+
class: r(L)(),
|
|
240
|
+
columns: r(S),
|
|
241
|
+
"data-source": r(m)
|
|
234
242
|
}), Y({
|
|
235
243
|
_: 2
|
|
236
|
-
}, [Z(
|
|
244
|
+
}, [Z(r(R)(_, ["headerCell"]), (o, a) => ({
|
|
237
245
|
name: a,
|
|
238
246
|
fn: h((l) => [M(e.$slots, a, ee(te(l || {})))])
|
|
239
247
|
}))]), 1040, ["class", "columns", "data-source"])]),
|