@vunk/form 2.5.3 → 2.5.4
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/form-item-renderer/index.cjs +6 -0
- package/components/form-item-renderer/index.mjs +6 -0
- package/components/form-item-renderer/src/types.d.ts +2 -1
- package/components/information-templates-default/index.css +4 -0
- package/index.css +4 -0
- package/package.json +1 -1
- package/shared/types/source/index.d.ts +2 -1
|
@@ -6,6 +6,7 @@ var vue = require('vue');
|
|
|
6
6
|
var templateInstancesProvider = require('@vunk/form/components/template-instances-provider');
|
|
7
7
|
var form = require('@vunk/form/shared/form');
|
|
8
8
|
var composables = require('@vunk/form/composables');
|
|
9
|
+
var _function = require('@vunk/shared/function');
|
|
9
10
|
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
10
11
|
|
|
11
12
|
const props = {
|
|
@@ -59,8 +60,13 @@ const VkfFormItemRenderer$1 = vue.defineComponent({
|
|
|
59
60
|
const preTemplateVisible = rendererData ? templateIf(rendererData.value) : true;
|
|
60
61
|
if (!preTemplateVisible) return a;
|
|
61
62
|
const slotData = { ...c };
|
|
63
|
+
Object.assign(
|
|
64
|
+
slotData,
|
|
65
|
+
_function.isCallable(c.templateProps) ? c.templateProps(rendererData?.value) : c.templateProps
|
|
66
|
+
);
|
|
62
67
|
Reflect.deleteProperty(slotData, "templateType");
|
|
63
68
|
Reflect.deleteProperty(slotData, "templateIf");
|
|
69
|
+
Reflect.deleteProperty(slotData, "templateProps");
|
|
64
70
|
const nodeKey = currentK.join(",") + "-" + c.templateType + "-" + (c.prop || "no-prop");
|
|
65
71
|
const modelValue = vue.computed({
|
|
66
72
|
get: () => c.prop && getDataValue?.(c.prop),
|
|
@@ -2,6 +2,7 @@ import { defineComponent, computed, h, nextTick, openBlock, createBlock, withCtx
|
|
|
2
2
|
import { VkfTemplateInstancesProvider } from '@vunk/form/components/template-instances-provider';
|
|
3
3
|
import { genTemplateIfFunc } from '@vunk/form/shared/form';
|
|
4
4
|
import { useTemplateInstancesContext, useRendererData } from '@vunk/form/composables';
|
|
5
|
+
import { isCallable } from '@vunk/shared/function';
|
|
5
6
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
7
|
|
|
7
8
|
const props = {
|
|
@@ -55,8 +56,13 @@ const VkfFormItemRenderer$1 = defineComponent({
|
|
|
55
56
|
const preTemplateVisible = rendererData ? templateIf(rendererData.value) : true;
|
|
56
57
|
if (!preTemplateVisible) return a;
|
|
57
58
|
const slotData = { ...c };
|
|
59
|
+
Object.assign(
|
|
60
|
+
slotData,
|
|
61
|
+
isCallable(c.templateProps) ? c.templateProps(rendererData?.value) : c.templateProps
|
|
62
|
+
);
|
|
58
63
|
Reflect.deleteProperty(slotData, "templateType");
|
|
59
64
|
Reflect.deleteProperty(slotData, "templateIf");
|
|
65
|
+
Reflect.deleteProperty(slotData, "templateProps");
|
|
60
66
|
const nodeKey = currentK.join(",") + "-" + c.templateType + "-" + (c.prop || "no-prop");
|
|
61
67
|
const modelValue = computed({
|
|
62
68
|
get: () => c.prop && getDataValue?.(c.prop),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { NormalObject } from '@vunk/core';
|
|
1
|
+
import { Func, NormalObject } from '@vunk/core';
|
|
2
2
|
export interface RendererTreeData {
|
|
3
3
|
key?: string;
|
|
4
4
|
templateType?: string;
|
|
5
5
|
templateIf?: string | ((e: NormalObject) => boolean) | boolean;
|
|
6
|
+
templateProps?: NormalObject | Func;
|
|
6
7
|
[k: string]: any;
|
|
7
8
|
}
|
package/index.css
CHANGED
|
@@ -232,6 +232,10 @@
|
|
|
232
232
|
padding: 0;
|
|
233
233
|
border: none;
|
|
234
234
|
box-shadow: none;
|
|
235
|
+
pointer-events: auto;
|
|
236
|
+
}
|
|
237
|
+
.vkf-information-templates-default-main .el-select__suffix {
|
|
238
|
+
display: none;
|
|
235
239
|
}
|
|
236
240
|
.vkf-information-templates-default-main .el-select__selected-item {
|
|
237
241
|
user-select: text;
|
package/package.json
CHANGED
|
@@ -2,11 +2,12 @@ import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default';
|
|
|
2
2
|
import { __VkfTemplatesLayout } from '@vunk/form/components/templates-layout';
|
|
3
3
|
import { __VkfTemplatesElementPlus } from '@vunk/form/components/templates-element-plus';
|
|
4
4
|
import { __VkfTemplatesEsri } from '@vunk/form/components/templates-esri';
|
|
5
|
-
import { NormalObject } from '@vunk/core';
|
|
5
|
+
import { AnyFunc, NormalObject } from '@vunk/core';
|
|
6
6
|
import { __VkfTemplatesVariant } from '@vunk/form/components/templates-variant';
|
|
7
7
|
export interface BasicSource {
|
|
8
8
|
templateIf?: ((data: NormalObject) => boolean) | string | boolean;
|
|
9
9
|
templateType?: string;
|
|
10
|
+
templateProps?: NormalObject | AnyFunc;
|
|
10
11
|
class?: any;
|
|
11
12
|
prop?: any;
|
|
12
13
|
}
|