@vunk/form 2.6.2 → 2.7.1

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.
Files changed (40) hide show
  1. package/components/form-item-renderer/index.cjs +3 -0
  2. package/components/form-item-renderer/index.mjs +3 -0
  3. package/components/form-item-renderer/src/types.d.ts +2 -5
  4. package/components/form-item-renderer-template/src/types.d.ts +6 -2
  5. package/components/information/index.cjs +22 -36
  6. package/components/information/index.mjs +23 -37
  7. package/components/information/src/index.vue.d.ts +2 -370
  8. package/components/information-collection/index.cjs +78 -0
  9. package/components/information-collection/index.d.ts +4 -0
  10. package/components/information-collection/index.mjs +72 -0
  11. package/components/information-collection/src/ctx.d.ts +112 -0
  12. package/components/information-collection/src/index.vue.d.ts +232 -0
  13. package/components/information-collection/src/types.d.ts +6 -0
  14. package/components/information-tag/index.cjs +101 -0
  15. package/components/information-tag/index.css +6 -0
  16. package/components/information-tag/index.d.ts +4 -0
  17. package/components/information-tag/index.mjs +95 -0
  18. package/components/information-tag/src/ctx.d.ts +50 -0
  19. package/components/information-tag/src/index.vue.d.ts +106 -0
  20. package/components/information-templates-default/index.cjs +56 -169
  21. package/components/information-templates-default/index.mjs +58 -171
  22. package/components/information-templates-default/src/index.vue.d.ts +1 -51
  23. package/components/input-collection/index.cjs +0 -9
  24. package/components/input-collection/index.mjs +0 -9
  25. package/components/input-collection/src/ctx.d.ts +0 -7
  26. package/components/input-collection/src/index.vue.d.ts +0 -9
  27. package/components/input-collection/src/types.d.ts +2 -0
  28. package/index.css +7 -7
  29. package/package.json +14 -9
  30. package/shared/element-plus/ctx.d.ts +2 -0
  31. package/shared/element-plus/index.cjs +4 -0
  32. package/shared/element-plus/index.mjs +4 -2
  33. package/shared/types/source/index.d.ts +21 -1
  34. package/components/tag-information/index.cjs +0 -114
  35. package/components/tag-information/index.css +0 -6
  36. package/components/tag-information/index.d.ts +0 -4
  37. package/components/tag-information/index.mjs +0 -108
  38. package/components/tag-information/src/ctx.d.ts +0 -34
  39. package/components/tag-information/src/index.vue.d.ts +0 -912
  40. /package/components/{tag-information → information-tag}/src/types.d.ts +0 -0
@@ -0,0 +1,95 @@
1
+ import { defineComponent, computed, createVNode, mergeProps, isVNode } from 'vue';
2
+ import { tagProps, tagEmits, ElPopover, ElTag } from 'element-plus';
3
+ import { VkfInformation } from '@vunk/form';
4
+ import { isCallable } from '@vunk/shared/function';
5
+ import { createTagBindProps, createTagOnEmits } from '@vunk/form/shared/element-plus';
6
+ import { vOn } from '@vunk/core/shared/utils-vue';
7
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
+
9
+ const props = {
10
+ ...tagProps,
11
+ data: {
12
+ type: Object,
13
+ default: () => ({})
14
+ },
15
+ labelRender: {
16
+ type: Function,
17
+ default: (data) => data.label
18
+ },
19
+ title: {
20
+ type: [String, Function],
21
+ default: ""
22
+ },
23
+ placement: {
24
+ type: String,
25
+ default: "top"
26
+ },
27
+ formItems: {
28
+ type: Array,
29
+ default: () => []
30
+ },
31
+ trigger: {
32
+ type: String,
33
+ default: "hover"
34
+ },
35
+ showAfter: {
36
+ type: Number,
37
+ default: 500
38
+ }
39
+ };
40
+ const emits = {
41
+ ...tagEmits
42
+ };
43
+
44
+ function _isSlot(s) {
45
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
46
+ }
47
+ var _sfc_main = /* @__PURE__ */ defineComponent({
48
+ name: "VkfInformationTag",
49
+ props,
50
+ emits,
51
+ setup(props2, {
52
+ emit,
53
+ slots
54
+ }) {
55
+ const theTitle = computed(() => {
56
+ return isCallable(props2.title) ? props2.title(props2.data) : props2.title;
57
+ });
58
+ const tagProps = createTagBindProps(props2);
59
+ const tagEmits = createTagOnEmits(emit);
60
+ return () => createVNode(ElPopover, {
61
+ "placement": props2.placement,
62
+ "title": theTitle.value,
63
+ "width": 250,
64
+ "trigger": props2.trigger,
65
+ "show-after": props2.showAfter
66
+ }, {
67
+ reference: () => {
68
+ let _slot;
69
+ return createVNode(ElTag, mergeProps({
70
+ "class": "vkf-information-tag__tag"
71
+ }, tagProps.value, vOn(tagEmits)), _isSlot(_slot = props2.labelRender(props2.data)) ? _slot : {
72
+ default: () => [_slot]
73
+ });
74
+ },
75
+ default: () => createVNode(VkfInformation, {
76
+ "data": props2.data,
77
+ "form-items": props2.formItems
78
+ }, {
79
+ default: () => [slots.default?.()]
80
+ })
81
+ });
82
+ }
83
+ });
84
+
85
+ var VkfInformationTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/information-tag/src/index.vue"]]);
86
+
87
+ var types = /*#__PURE__*/Object.freeze({
88
+ __proto__: null
89
+ });
90
+
91
+ VkfInformationTag.install = (app) => {
92
+ app.component(VkfInformationTag.name || "VkfInformationTag", VkfInformationTag);
93
+ };
94
+
95
+ export { VkfInformationTag, types as __VkfInformationTag, VkfInformationTag as default };
@@ -0,0 +1,50 @@
1
+ import { PropType } from 'vue';
2
+ import { Placement } from '@sxzz/popperjs-es';
3
+ import { NormalObject } from '@vunk/shared';
4
+ export declare const props: {
5
+ data: {
6
+ type: ObjectConstructor;
7
+ default: () => {};
8
+ };
9
+ labelRender: {
10
+ type: PropType<(data: NormalObject) => string>;
11
+ default: (data: any) => any;
12
+ };
13
+ title: {
14
+ type: PropType<string | ((data: any) => string)>;
15
+ default: string;
16
+ };
17
+ placement: {
18
+ type: PropType<Placement>;
19
+ default: string;
20
+ };
21
+ formItems: {
22
+ type: PropType<any[]>;
23
+ default: () => any[];
24
+ };
25
+ trigger: {
26
+ type: PropType<"click" | "focus" | "hover" | "contextmenu">;
27
+ default: string;
28
+ };
29
+ showAfter: {
30
+ type: NumberConstructor;
31
+ default: number;
32
+ };
33
+ type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "primary", boolean>;
34
+ closable: BooleanConstructor;
35
+ disableTransitions: BooleanConstructor;
36
+ hit: BooleanConstructor;
37
+ color: StringConstructor;
38
+ size: {
39
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
40
+ readonly required: false;
41
+ readonly validator: ((val: unknown) => boolean) | undefined;
42
+ __epPropKey: true;
43
+ };
44
+ effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
45
+ round: BooleanConstructor;
46
+ };
47
+ export declare const emits: {
48
+ close: (evt: MouseEvent) => boolean;
49
+ click: (evt: MouseEvent) => boolean;
50
+ };
@@ -0,0 +1,106 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ data: {
3
+ type: ObjectConstructor;
4
+ default: () => {};
5
+ };
6
+ labelRender: {
7
+ type: import("vue").PropType<(data: import("@vunk/shared").NormalObject) => string>;
8
+ default: (data: any) => any;
9
+ };
10
+ title: {
11
+ type: import("vue").PropType<string | ((data: any) => string)>;
12
+ default: string;
13
+ };
14
+ placement: {
15
+ type: import("vue").PropType<import("@sxzz/popperjs-es").Placement>;
16
+ default: string;
17
+ };
18
+ formItems: {
19
+ type: import("vue").PropType<any[]>;
20
+ default: () => any[];
21
+ };
22
+ trigger: {
23
+ type: import("vue").PropType<"click" | "focus" | "hover" | "contextmenu">;
24
+ default: string;
25
+ };
26
+ showAfter: {
27
+ type: NumberConstructor;
28
+ default: number;
29
+ };
30
+ type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "primary", boolean>;
31
+ closable: BooleanConstructor;
32
+ disableTransitions: BooleanConstructor;
33
+ hit: BooleanConstructor;
34
+ color: StringConstructor;
35
+ size: {
36
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
37
+ readonly required: false;
38
+ readonly validator: ((val: unknown) => boolean) | undefined;
39
+ __epPropKey: true;
40
+ };
41
+ effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
42
+ round: BooleanConstructor;
43
+ }>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ close: (evt: MouseEvent) => boolean;
45
+ click: (evt: MouseEvent) => boolean;
46
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
47
+ data: {
48
+ type: ObjectConstructor;
49
+ default: () => {};
50
+ };
51
+ labelRender: {
52
+ type: import("vue").PropType<(data: import("@vunk/shared").NormalObject) => string>;
53
+ default: (data: any) => any;
54
+ };
55
+ title: {
56
+ type: import("vue").PropType<string | ((data: any) => string)>;
57
+ default: string;
58
+ };
59
+ placement: {
60
+ type: import("vue").PropType<import("@sxzz/popperjs-es").Placement>;
61
+ default: string;
62
+ };
63
+ formItems: {
64
+ type: import("vue").PropType<any[]>;
65
+ default: () => any[];
66
+ };
67
+ trigger: {
68
+ type: import("vue").PropType<"click" | "focus" | "hover" | "contextmenu">;
69
+ default: string;
70
+ };
71
+ showAfter: {
72
+ type: NumberConstructor;
73
+ default: number;
74
+ };
75
+ type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown, "primary", boolean>;
76
+ closable: BooleanConstructor;
77
+ disableTransitions: BooleanConstructor;
78
+ hit: BooleanConstructor;
79
+ color: StringConstructor;
80
+ size: {
81
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
82
+ readonly required: false;
83
+ readonly validator: ((val: unknown) => boolean) | undefined;
84
+ __epPropKey: true;
85
+ };
86
+ effect: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
87
+ round: BooleanConstructor;
88
+ }>> & Readonly<{
89
+ onClick?: (evt: MouseEvent) => any;
90
+ onClose?: (evt: MouseEvent) => any;
91
+ }>, {
92
+ type: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
93
+ trigger: "hover" | "click" | "contextmenu" | "focus";
94
+ effect: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "dark" | "light" | "plain", unknown>;
95
+ placement: import("@sxzz/popperjs-es").Placement;
96
+ showAfter: number;
97
+ data: Record<string, any>;
98
+ round: boolean;
99
+ formItems: any[];
100
+ title: string | ((data: any) => string);
101
+ closable: boolean;
102
+ disableTransitions: boolean;
103
+ hit: boolean;
104
+ labelRender: (data: import("@vunk/shared").NormalObject) => string;
105
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
106
+ export default _default;
@@ -6,182 +6,69 @@ var vue = require('vue');
6
6
  var formItemRendererTemplate = require('@vunk/form/components/form-item-renderer-template');
7
7
  var formItem = require('@vunk/form/components/form-item');
8
8
  var select = require('@vunk/form/components/select');
9
- var tagInformation = require('@vunk/form/components/tag-information');
9
+ var informationCollection = require('@vunk/form/components/information-collection');
10
10
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
11
11
 
12
- const props = {};
13
- const emits = {};
14
-
15
- var _sfc_main = vue.defineComponent({
12
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
16
13
  name: "VkfInformationTemplatesDefault",
17
- components: {
18
- VkfFormItem: formItem.VkfFormItem,
19
- VkfFormItemRendererTemplate: formItemRendererTemplate.VkfFormItemRendererTemplate,
20
- VkfTagInformation: tagInformation.VkfTagInformation,
21
- VkfSelect: select.VkfSelect
22
- },
23
- props,
24
- emits,
25
- setup(props2, { emit }) {
14
+ setup() {
26
15
  const prefixCls = "vkf-information-templates-default";
27
- const simpleStringTemplates = [
28
- "VkfInput",
29
- "VkfInputNumber",
30
- "VkfSlider"
31
- ];
32
- const simpleSelectTemplates = [
33
- "VkfSelect",
34
- "VkfRadio"
35
- ];
36
- const simpleCollectionTemplates = [
37
- "VkfInputCollection"
38
- ];
39
- return {
40
- prefixCls,
41
- simpleStringTemplates,
42
- simpleSelectTemplates,
43
- simpleCollectionTemplates
44
- };
16
+ const simpleStringTemplates = ["VkfInput", "VkfInputNumber", "VkfSlider"];
17
+ const simpleSelectTemplates = ["VkfSelect", "VkfRadio"];
18
+ const simpleCollectionTemplates = ["VkfInputCollection"];
19
+ return () => vue.createVNode(vue.Fragment, null, [simpleStringTemplates.map(t => vue.createVNode(formItemRendererTemplate.VkfFormItemRendererTemplate, {
20
+ "key": t,
21
+ "type": t
22
+ }, {
23
+ default: ({
24
+ props,
25
+ value
26
+ }) => vue.createVNode(formItem.VkfFormItem, {
27
+ "class": `${prefixCls}-main`,
28
+ "label": props.label,
29
+ "prop": props.prop,
30
+ "information": true
31
+ }, {
32
+ default: () => [vue.createVNode("div", {
33
+ "class": `${prefixCls}-value`
34
+ }, [value])]
35
+ })
36
+ })), simpleSelectTemplates.map(t => vue.createVNode(formItemRendererTemplate.VkfFormItemRendererTemplate, {
37
+ "key": t,
38
+ "type": t
39
+ }, {
40
+ default: ({
41
+ props,
42
+ value
43
+ }) => vue.createVNode(select.VkfSelect, {
44
+ "label": props.label,
45
+ "information": true,
46
+ "class": `${prefixCls}-main`,
47
+ "readonly": true,
48
+ "modelValue": value,
49
+ "options": props.options
50
+ }, null)
51
+ })), simpleCollectionTemplates.map(t => vue.createVNode(formItemRendererTemplate.VkfFormItemRendererTemplate, {
52
+ "key": t,
53
+ "type": t
54
+ }, {
55
+ default: ({
56
+ props,
57
+ value,
58
+ informationProps
59
+ }) => {
60
+ const formItemProps = formItem._VkfFormItemCtx.createBindProps(props);
61
+ return vue.createVNode(informationCollection.VkfInformationCollection, vue.mergeProps({
62
+ "class": `${prefixCls}-main`,
63
+ "modelValue": value,
64
+ "columns": props.columns
65
+ }, formItemProps.value, informationProps), null);
66
+ }
67
+ }))]);
45
68
  }
46
69
  });
47
70
 
48
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
49
- const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
50
- const _component_VkfFormItemRendererTemplate = vue.resolveComponent("VkfFormItemRendererTemplate");
51
- const _component_VkfSelect = vue.resolveComponent("VkfSelect");
52
- const _component_VkfTagInformation = vue.resolveComponent("VkfTagInformation");
53
- return vue.openBlock(), vue.createElementBlock(
54
- vue.Fragment,
55
- null,
56
- [
57
- (vue.openBlock(true), vue.createElementBlock(
58
- vue.Fragment,
59
- null,
60
- vue.renderList(_ctx.simpleStringTemplates, (t) => {
61
- return vue.openBlock(), vue.createBlock(_component_VkfFormItemRendererTemplate, {
62
- key: t,
63
- type: t
64
- }, {
65
- default: vue.withCtx(({ props, value }) => [
66
- vue.createVNode(_component_VkfFormItem, {
67
- class: vue.normalizeClass(`${_ctx.prefixCls}-main`),
68
- label: props.label,
69
- prop: props.prop,
70
- information: true
71
- }, {
72
- default: vue.withCtx(() => [
73
- vue.createElementVNode(
74
- "div",
75
- {
76
- class: vue.normalizeClass(`${_ctx.prefixCls}-value`)
77
- },
78
- vue.toDisplayString(value),
79
- 3
80
- /* TEXT, CLASS */
81
- )
82
- ]),
83
- _: 2
84
- /* DYNAMIC */
85
- }, 1032, ["class", "label", "prop"])
86
- ]),
87
- _: 2
88
- /* DYNAMIC */
89
- }, 1032, ["type"]);
90
- }),
91
- 128
92
- /* KEYED_FRAGMENT */
93
- )),
94
- (vue.openBlock(true), vue.createElementBlock(
95
- vue.Fragment,
96
- null,
97
- vue.renderList(_ctx.simpleSelectTemplates, (t) => {
98
- return vue.openBlock(), vue.createBlock(_component_VkfFormItemRendererTemplate, {
99
- key: t,
100
- type: t
101
- }, {
102
- default: vue.withCtx(({ props, value }) => [
103
- vue.createVNode(_component_VkfSelect, {
104
- label: props.label,
105
- information: true,
106
- class: vue.normalizeClass(`${_ctx.prefixCls}-main`),
107
- readonly: true,
108
- "model-value": value,
109
- options: props.options
110
- }, null, 8, ["label", "class", "model-value", "options"])
111
- ]),
112
- _: 2
113
- /* DYNAMIC */
114
- }, 1032, ["type"]);
115
- }),
116
- 128
117
- /* KEYED_FRAGMENT */
118
- )),
119
- (vue.openBlock(true), vue.createElementBlock(
120
- vue.Fragment,
121
- null,
122
- vue.renderList(_ctx.simpleCollectionTemplates, (t) => {
123
- return vue.openBlock(), vue.createBlock(_component_VkfFormItemRendererTemplate, {
124
- key: t,
125
- type: t
126
- }, {
127
- default: vue.withCtx(({ props, value }) => [
128
- vue.createVNode(_component_VkfFormItem, {
129
- class: vue.normalizeClass(`${_ctx.prefixCls}-main`),
130
- label: props.label,
131
- prop: props.prop,
132
- information: true
133
- }, {
134
- default: vue.withCtx(() => [
135
- vue.createElementVNode(
136
- "div",
137
- {
138
- class: vue.normalizeClass(`${_ctx.prefixCls}-value`)
139
- },
140
- [
141
- (vue.openBlock(true), vue.createElementBlock(
142
- vue.Fragment,
143
- null,
144
- vue.renderList(value, (item, index) => {
145
- return vue.openBlock(), vue.createBlock(_component_VkfTagInformation, {
146
- key: index,
147
- "label-render": props.summaryLabel,
148
- data: item,
149
- "form-items": props.columns.map((v) => {
150
- return {
151
- ...v,
152
- ...v.templateProps,
153
- ...v.templateProps?.createTemplateProps?.({
154
- row: item
155
- })
156
- };
157
- })
158
- }, null, 8, ["label-render", "data", "form-items"]);
159
- }),
160
- 128
161
- /* KEYED_FRAGMENT */
162
- ))
163
- ],
164
- 2
165
- /* CLASS */
166
- )
167
- ]),
168
- _: 2
169
- /* DYNAMIC */
170
- }, 1032, ["class", "label", "prop"])
171
- ]),
172
- _: 2
173
- /* DYNAMIC */
174
- }, 1032, ["type"]);
175
- }),
176
- 128
177
- /* KEYED_FRAGMENT */
178
- ))
179
- ],
180
- 64
181
- /* STABLE_FRAGMENT */
182
- );
183
- }
184
- var VkfInformationTemplatesDefault = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/information-templates-default/src/index.vue"]]);
71
+ var VkfInformationTemplatesDefault = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/information-templates-default/src/index.vue"]]);
185
72
 
186
73
  var types = /*#__PURE__*/Object.freeze({
187
74
  __proto__: null