@vunk/form 1.4.1 → 1.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/components/input-collection/index.cjs +14 -7
- package/components/input-collection/index.mjs +14 -7
- package/components/input-collection/src/ctx.d.ts +8 -1
- package/components/input-collection/src/index.vue.d.ts +12 -3
- package/components/input-collection/src/types.d.ts +11 -2
- package/package.json +1 -1
|
@@ -27,6 +27,13 @@ const props = {
|
|
|
27
27
|
readonly: {
|
|
28
28
|
type: Boolean,
|
|
29
29
|
default: void 0
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @description 是否可以splice
|
|
33
|
+
*/
|
|
34
|
+
splicable: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
30
37
|
}
|
|
31
38
|
};
|
|
32
39
|
const emits = {
|
|
@@ -2080,13 +2087,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
2080
2087
|
return props2.columns.map(column => {
|
|
2081
2088
|
return {
|
|
2082
2089
|
...column,
|
|
2083
|
-
slots: ({
|
|
2084
|
-
$index
|
|
2085
|
-
}) => vue.createVNode(formItemRenderer.VkfFormItemRenderer, {
|
|
2090
|
+
slots: e => vue.createVNode(formItemRenderer.VkfFormItemRenderer, {
|
|
2086
2091
|
"source": [{
|
|
2087
|
-
prop: [
|
|
2092
|
+
prop: [e.$index, column.prop].flat(),
|
|
2088
2093
|
templateType: column.templateType,
|
|
2089
|
-
readonly: readonly.value
|
|
2094
|
+
readonly: readonly.value,
|
|
2095
|
+
...column.templateProps,
|
|
2096
|
+
...column.createTemplateProps?.(e)
|
|
2090
2097
|
}]
|
|
2091
2098
|
}, null)
|
|
2092
2099
|
};
|
|
@@ -2096,7 +2103,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
2096
2103
|
label: "\u64CD\u4F5C",
|
|
2097
2104
|
align: "center",
|
|
2098
2105
|
width: "120px",
|
|
2099
|
-
hidden: readonly.value,
|
|
2106
|
+
hidden: readonly.value || !props2.splicable,
|
|
2100
2107
|
slots: ({
|
|
2101
2108
|
$index
|
|
2102
2109
|
}) => vue.createVNode(vue.Fragment, null, [vue.createVNode(elementPlus.ElButton, {
|
|
@@ -2160,7 +2167,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2160
2167
|
vue.normalizeProps(vue.guardReactiveProps(_ctx.formItemBindProps)),
|
|
2161
2168
|
{
|
|
2162
2169
|
default: vue.withCtx(() => [
|
|
2163
|
-
!_ctx.readonly ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
2170
|
+
!_ctx.readonly && _ctx.splicable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
2164
2171
|
vue.createVNode(_component_ElButton, {
|
|
2165
2172
|
type: "primary",
|
|
2166
2173
|
onClick: _ctx.addToFirst
|
|
@@ -23,6 +23,13 @@ const props = {
|
|
|
23
23
|
readonly: {
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: void 0
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 是否可以splice
|
|
29
|
+
*/
|
|
30
|
+
splicable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
26
33
|
}
|
|
27
34
|
};
|
|
28
35
|
const emits = {
|
|
@@ -2076,13 +2083,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2076
2083
|
return props2.columns.map(column => {
|
|
2077
2084
|
return {
|
|
2078
2085
|
...column,
|
|
2079
|
-
slots: ({
|
|
2080
|
-
$index
|
|
2081
|
-
}) => createVNode(VkfFormItemRenderer, {
|
|
2086
|
+
slots: e => createVNode(VkfFormItemRenderer, {
|
|
2082
2087
|
"source": [{
|
|
2083
|
-
prop: [
|
|
2088
|
+
prop: [e.$index, column.prop].flat(),
|
|
2084
2089
|
templateType: column.templateType,
|
|
2085
|
-
readonly: readonly.value
|
|
2090
|
+
readonly: readonly.value,
|
|
2091
|
+
...column.templateProps,
|
|
2092
|
+
...column.createTemplateProps?.(e)
|
|
2086
2093
|
}]
|
|
2087
2094
|
}, null)
|
|
2088
2095
|
};
|
|
@@ -2092,7 +2099,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2092
2099
|
label: "\u64CD\u4F5C",
|
|
2093
2100
|
align: "center",
|
|
2094
2101
|
width: "120px",
|
|
2095
|
-
hidden: readonly.value,
|
|
2102
|
+
hidden: readonly.value || !props2.splicable,
|
|
2096
2103
|
slots: ({
|
|
2097
2104
|
$index
|
|
2098
2105
|
}) => createVNode(Fragment, null, [createVNode(ElButton, {
|
|
@@ -2156,7 +2163,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2156
2163
|
normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
|
|
2157
2164
|
{
|
|
2158
2165
|
default: withCtx(() => [
|
|
2159
|
-
!_ctx.readonly ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
2166
|
+
!_ctx.readonly && _ctx.splicable ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
2160
2167
|
createVNode(_component_ElButton, {
|
|
2161
2168
|
type: "primary",
|
|
2162
2169
|
onClick: _ctx.addToFirst
|
|
@@ -3,7 +3,7 @@ import { Column } from './types';
|
|
|
3
3
|
import { NormalObject } from '@vunk/shared';
|
|
4
4
|
export declare const props: {
|
|
5
5
|
columns: {
|
|
6
|
-
type: PropType<Column[]>;
|
|
6
|
+
type: PropType<Column<any>[]>;
|
|
7
7
|
default: () => any[];
|
|
8
8
|
};
|
|
9
9
|
modelValue: {
|
|
@@ -14,6 +14,13 @@ export declare const props: {
|
|
|
14
14
|
type: BooleanConstructor;
|
|
15
15
|
default: any;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @description 是否可以splice
|
|
19
|
+
*/
|
|
20
|
+
splicable: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
17
24
|
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
18
25
|
formItemSize: {
|
|
19
26
|
type: PropType<"default" | "small" | "large">;
|
|
@@ -2,7 +2,7 @@ import { __VkTableColumns } from '@vunk/plus/components/table-columns';
|
|
|
2
2
|
import { SetDataEvent } from '@vunk/core';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
columns: {
|
|
5
|
-
type: import("vue").PropType<import("./types").Column[]>;
|
|
5
|
+
type: import("vue").PropType<import("./types").Column<any>[]>;
|
|
6
6
|
default: () => any[];
|
|
7
7
|
};
|
|
8
8
|
modelValue: {
|
|
@@ -13,6 +13,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
13
13
|
type: BooleanConstructor;
|
|
14
14
|
default: any;
|
|
15
15
|
};
|
|
16
|
+
splicable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
17
21
|
formItemSize: {
|
|
18
22
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
@@ -69,7 +73,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
69
73
|
'update:modelValue': any;
|
|
70
74
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
71
75
|
columns: {
|
|
72
|
-
type: import("vue").PropType<import("./types").Column[]>;
|
|
76
|
+
type: import("vue").PropType<import("./types").Column<any>[]>;
|
|
73
77
|
default: () => any[];
|
|
74
78
|
};
|
|
75
79
|
modelValue: {
|
|
@@ -80,6 +84,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
80
84
|
type: BooleanConstructor;
|
|
81
85
|
default: any;
|
|
82
86
|
};
|
|
87
|
+
splicable: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
83
91
|
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
84
92
|
formItemSize: {
|
|
85
93
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
@@ -138,7 +146,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
138
146
|
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
139
147
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
140
148
|
modelValue: import("@vunk/shared").NormalObject[];
|
|
141
|
-
columns: import("./types").Column[];
|
|
149
|
+
columns: import("./types").Column<any>[];
|
|
150
|
+
splicable: boolean;
|
|
142
151
|
}, {}, {
|
|
143
152
|
ElTable: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
144
153
|
data: {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { __VkTableColumns } from '@vunk/plus/components/table-columns';
|
|
2
2
|
import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default';
|
|
3
|
-
import { VueComponentPropsType } from '@vunk/shared';
|
|
3
|
+
import { Keyof, NormalObject, VueComponentPropsType } from '@vunk/shared';
|
|
4
4
|
import { BasicSource } from '@vunk/form/shared';
|
|
5
5
|
import Core from './index.vue';
|
|
6
|
+
import { TableColumnCtx } from 'element-plus';
|
|
6
7
|
export interface Source<P extends string = string> extends VueComponentPropsType<typeof Core>, BasicSource {
|
|
7
8
|
prop?: P;
|
|
8
9
|
templateType: 'VkfInputCollection';
|
|
9
10
|
}
|
|
10
|
-
export type Column = Omit<__VkTableColumns.Source
|
|
11
|
+
export type Column<R extends NormalObject = NormalObject> = Omit<__VkTableColumns.Source<R>, 'slots'> & {
|
|
12
|
+
templateType: __VkfTemplatesDefault.CoreSource['templateType'];
|
|
13
|
+
templateProps?: Partial<__VkfTemplatesDefault.CoreSource<Keyof<R>>>;
|
|
14
|
+
createTemplateProps?: (e: {
|
|
15
|
+
row: R;
|
|
16
|
+
column: TableColumnCtx<R>;
|
|
17
|
+
$index: number;
|
|
18
|
+
}) => Partial<__VkfTemplatesDefault.CoreSource<Keyof<R>>>;
|
|
19
|
+
};
|