@vunk/form 1.1.1 → 1.1.3
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/vditor/index.d.ts +4 -0
- package/components/vditor/index.js +68 -0
- package/components/vditor/src/ctx.d.ts +15 -0
- package/components/vditor/src/ctx.js +15 -0
- package/components/vditor/src/index.vue.d.ts +31 -0
- package/components/vditor/src/types.d.ts +4 -0
- package/components/vditor/src/types.js +1 -0
- package/package.json +1 -1
- package/shared/types/source/index.d.ts +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Vditor from 'vditor';
|
|
2
|
+
import { defineComponent, ref, onMounted, provide, openBlock, createElementBlock } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
},
|
|
9
|
+
defaultOptions: {
|
|
10
|
+
type: Object,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const emits = {
|
|
15
|
+
load: (e) => e
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _export_sfc = (sfc, props) => {
|
|
19
|
+
const target = sfc.__vccOpts || sfc;
|
|
20
|
+
for (const [key, val] of props) {
|
|
21
|
+
target[key] = val;
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const _sfc_main = defineComponent({
|
|
27
|
+
name: "VkfVditor",
|
|
28
|
+
emits,
|
|
29
|
+
props,
|
|
30
|
+
setup(props2, { emit }) {
|
|
31
|
+
const vditorNode = ref();
|
|
32
|
+
const ready = ref(false);
|
|
33
|
+
onMounted(() => {
|
|
34
|
+
const vditor = new Vditor(vditorNode.value, {
|
|
35
|
+
...props2.defaultOptions,
|
|
36
|
+
cache: {
|
|
37
|
+
enable: true,
|
|
38
|
+
id: "VkfVditorCache",
|
|
39
|
+
...props2.defaultOptions.cache || {}
|
|
40
|
+
},
|
|
41
|
+
after() {
|
|
42
|
+
ready.value = true;
|
|
43
|
+
emit("load", vditor);
|
|
44
|
+
provide("vkfVditor", vditor);
|
|
45
|
+
props2.defaultOptions.after?.();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
vditorNode
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const _hoisted_1 = { ref: "vditorNode" };
|
|
55
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
56
|
+
return openBlock(), createElementBlock("div", _hoisted_1, null, 512);
|
|
57
|
+
}
|
|
58
|
+
var VkfVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
59
|
+
|
|
60
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
61
|
+
__proto__: null
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
VkfVditor.install = (app) => {
|
|
65
|
+
app.component(VkfVditor.name, VkfVditor);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { VkfVditor, types as __VkfVditor, VkfVditor as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import Vditor from 'vditor';
|
|
3
|
+
export declare const props: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: PropType<unknown>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
type: PropType<IOptions>;
|
|
10
|
+
default: () => IOptions;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const emits: {
|
|
14
|
+
load: (e: Vditor) => Vditor;
|
|
15
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Vditor from 'vditor';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: import("vue").PropType<unknown>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
type: import("vue").PropType<IOptions>;
|
|
10
|
+
default: () => IOptions;
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
vditorNode: Ref<HTMLDivElement>;
|
|
14
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
load: (e: Vditor) => Vditor;
|
|
16
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
modelValue: {
|
|
18
|
+
type: import("vue").PropType<unknown>;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
defaultOptions: {
|
|
22
|
+
type: import("vue").PropType<IOptions>;
|
|
23
|
+
default: () => IOptions;
|
|
24
|
+
};
|
|
25
|
+
}>> & {
|
|
26
|
+
onLoad?: ((e: Vditor) => any) | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
modelValue: {};
|
|
29
|
+
defaultOptions: IOptions;
|
|
30
|
+
}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -10,4 +10,4 @@ export interface BasicSource {
|
|
|
10
10
|
prop?: any;
|
|
11
11
|
}
|
|
12
12
|
export declare type FormItemRendererSource<P extends string = string> = __VkfTemplatesDefault.Source<P>;
|
|
13
|
-
export declare type
|
|
13
|
+
export declare type AllTemplatesSource<P extends string = string> = __VkfTemplatesDefault.Source<P> | __VkfTemplatesMapbox.Source<P> | __VkfTemplatesLayout.ElRowSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.ElColSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.VkfFlexSource<AllTemplatesSource<P>> | __VkfTemplatesElementPlus.Source;
|