@tmagic/form 1.2.9 → 1.2.11
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/dist/tmagic-form.js +22 -36
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +22 -36
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/containers/Container.vue +4 -3
- package/src/containers/GroupListItem.vue +3 -5
- package/src/containers/Panel.vue +7 -7
- package/src/containers/Table.vue +2 -5
- package/types/containers/Panel.vue.d.ts +5 -4
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.
|
|
2
|
+
"version": "1.2.11",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@element-plus/icons-vue": "^2.0.9",
|
|
39
|
-
"@tmagic/design": "1.2.
|
|
40
|
-
"@tmagic/utils": "1.2.
|
|
39
|
+
"@tmagic/design": "1.2.11",
|
|
40
|
+
"@tmagic/utils": "1.2.11",
|
|
41
41
|
"lodash-es": "^4.17.21",
|
|
42
42
|
"sortablejs": "^1.14.0",
|
|
43
43
|
"vue": "^3.2.37"
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
:size="size"
|
|
49
49
|
:is="tagName"
|
|
50
50
|
:model="model"
|
|
51
|
+
:last-values="lastValues"
|
|
51
52
|
:config="config"
|
|
52
53
|
:name="name"
|
|
53
54
|
:disabled="disabled"
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
:size="size"
|
|
67
68
|
:is="tagName"
|
|
68
69
|
:model="model"
|
|
70
|
+
:last-values="lastValues"
|
|
69
71
|
:config="config"
|
|
70
72
|
:name="name"
|
|
71
73
|
:disabled="disabled"
|
|
@@ -74,7 +76,7 @@
|
|
|
74
76
|
@addDiffCount="onAddDiffCount"
|
|
75
77
|
></component>
|
|
76
78
|
|
|
77
|
-
<div v-if="extra" v-html="extra" class="m-form-tip"></div>
|
|
79
|
+
<div v-if="extra && type !== 'table'" v-html="extra" class="m-form-tip"></div>
|
|
78
80
|
</TMagicFormItem>
|
|
79
81
|
|
|
80
82
|
<TMagicTooltip v-if="config.tip" placement="left">
|
|
@@ -193,7 +195,7 @@
|
|
|
193
195
|
v-for="item in items"
|
|
194
196
|
:key="key(item)"
|
|
195
197
|
:model="name || name === 0 ? model[name] : model"
|
|
196
|
-
:last-values="name || name === 0 ? lastValues[name] : lastValues"
|
|
198
|
+
:last-values="name || name === 0 ? lastValues[name] || {} : lastValues"
|
|
197
199
|
:is-compare="isCompare"
|
|
198
200
|
:config="item"
|
|
199
201
|
:size="size"
|
|
@@ -258,7 +260,6 @@ const mForm = inject<FormState | undefined>('mForm');
|
|
|
258
260
|
const expand = ref(false);
|
|
259
261
|
|
|
260
262
|
const name = computed(() => props.config.name || '');
|
|
261
|
-
|
|
262
263
|
// 是否展示两个版本的对比内容
|
|
263
264
|
const showDiff = computed(() => {
|
|
264
265
|
if (!props.isCompare) return false;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-fields-group-list-item">
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<TMagicButton text :disabled="disabled" @click="expandHandler">{{ title }}</TMagicButton>
|
|
4
|
+
<TMagicButton text :disabled="disabled" :icon="expand ? CaretBottom : CaretRight" @click="expandHandler">{{
|
|
5
|
+
title
|
|
6
|
+
}}</TMagicButton>
|
|
9
7
|
|
|
10
8
|
<TMagicButton
|
|
11
9
|
v-show="showDelete(parseInt(String(index)))"
|
package/src/containers/Panel.vue
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
:body-style="{ display: expand ? 'block' : 'none' }"
|
|
6
6
|
>
|
|
7
7
|
<template #header>
|
|
8
|
-
<div
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</
|
|
8
|
+
<div style="width: 100%; display: flex; align-items: center">
|
|
9
|
+
<TMagicButton style="padding: 0" text :icon="expand ? CaretBottom : CaretRight" @click="expand = !expand">
|
|
10
|
+
</TMagicButton>
|
|
11
|
+
<span v-if="config && config.extra" v-html="config.extra" class="m-form-tip"></span>
|
|
12
|
+
<slot name="header">{{ filter(config.title) }}</slot>
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
import { computed, inject, ref } from 'vue';
|
|
62
62
|
import { CaretBottom, CaretRight } from '@element-plus/icons-vue';
|
|
63
63
|
|
|
64
|
-
import {
|
|
64
|
+
import { TMagicButton, TMagicCard } from '@tmagic/design';
|
|
65
65
|
|
|
66
66
|
import { FormState, PanelConfig } from '../schema';
|
|
67
67
|
import { filterFunction } from '../utils/form';
|
|
@@ -73,7 +73,7 @@ const props = defineProps<{
|
|
|
73
73
|
lastValues?: any;
|
|
74
74
|
isCompare?: boolean;
|
|
75
75
|
config: PanelConfig;
|
|
76
|
-
name
|
|
76
|
+
name?: string;
|
|
77
77
|
labelWidth?: string;
|
|
78
78
|
prop?: string;
|
|
79
79
|
size?: string;
|
package/src/containers/Table.vue
CHANGED
|
@@ -272,11 +272,8 @@ const foreUpdate = () => {
|
|
|
272
272
|
};
|
|
273
273
|
|
|
274
274
|
const swapArray = (index1: number, index2: number) => {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
1,
|
|
278
|
-
props.model[modelName.value][index1],
|
|
279
|
-
);
|
|
275
|
+
props.model[modelName.value].splice(index1, 0, props.model[modelName.value].splice(index2, 1)[0]);
|
|
276
|
+
|
|
280
277
|
if (props.sortKey) {
|
|
281
278
|
for (let i = props.model[modelName.value].length - 1, v = 0; i >= 0; i--, v++) {
|
|
282
279
|
props.model[modelName.value][v][props.sortKey] = i;
|
|
@@ -8,7 +8,7 @@ declare const _default: {
|
|
|
8
8
|
lastValues?: any;
|
|
9
9
|
isCompare?: boolean | undefined;
|
|
10
10
|
config: PanelConfig;
|
|
11
|
-
name
|
|
11
|
+
name?: string | undefined;
|
|
12
12
|
labelWidth?: string | undefined;
|
|
13
13
|
prop?: string | undefined;
|
|
14
14
|
size?: string | undefined;
|
|
@@ -35,7 +35,7 @@ declare const _default: {
|
|
|
35
35
|
lastValues?: any;
|
|
36
36
|
isCompare?: boolean | undefined;
|
|
37
37
|
config: PanelConfig;
|
|
38
|
-
name
|
|
38
|
+
name?: string | undefined;
|
|
39
39
|
labelWidth?: string | undefined;
|
|
40
40
|
prop?: string | undefined;
|
|
41
41
|
size?: string | undefined;
|
|
@@ -68,7 +68,7 @@ declare const _default: {
|
|
|
68
68
|
lastValues?: any;
|
|
69
69
|
isCompare?: boolean | undefined;
|
|
70
70
|
config: PanelConfig;
|
|
71
|
-
name
|
|
71
|
+
name?: string | undefined;
|
|
72
72
|
labelWidth?: string | undefined;
|
|
73
73
|
prop?: string | undefined;
|
|
74
74
|
size?: string | undefined;
|
|
@@ -85,7 +85,7 @@ declare const _default: {
|
|
|
85
85
|
lastValues?: any;
|
|
86
86
|
isCompare?: boolean | undefined;
|
|
87
87
|
config: PanelConfig;
|
|
88
|
-
name
|
|
88
|
+
name?: string | undefined;
|
|
89
89
|
labelWidth?: string | undefined;
|
|
90
90
|
prop?: string | undefined;
|
|
91
91
|
size?: string | undefined;
|
|
@@ -95,6 +95,7 @@ declare const _default: {
|
|
|
95
95
|
onAddDiffCount?: ((...args: any[]) => any) | undefined;
|
|
96
96
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "addDiffCount")[], "change" | "addDiffCount", {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
97
97
|
$slots: {
|
|
98
|
+
header: (_: {}) => any;
|
|
98
99
|
default: (_: {}) => any;
|
|
99
100
|
};
|
|
100
101
|
});
|