@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.
@@ -0,0 +1,4 @@
1
+ import VkfVditor from './src/index.vue';
2
+ export * as __VkfVditor from './src/types';
3
+ export { VkfVditor, };
4
+ export default VkfVditor;
@@ -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,15 @@
1
+ const props = {
2
+ modelValue: {
3
+ type: Object,
4
+ default: () => ({})
5
+ },
6
+ defaultOptions: {
7
+ type: Object,
8
+ default: () => ({})
9
+ }
10
+ };
11
+ const emits = {
12
+ load: (e) => e
13
+ };
14
+
15
+ export { emits, props };
@@ -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,4 @@
1
+ import { NonVoidable } from '@vunk/core';
2
+ import Vditor from 'vditor';
3
+ export declare type DefaultOptions = NonVoidable<ConstructorParameters<typeof Vditor>[1]>;
4
+ export {};
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {
@@ -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 AllTemplatsSource<P extends string = string> = __VkfTemplatesDefault.Source<P> | __VkfTemplatesMapbox.Source<P> | __VkfTemplatesLayout.ElRowSource<AllTemplatsSource<P>> | __VkfTemplatesLayout.ElColSource<AllTemplatsSource<P>> | __VkfTemplatesLayout.VkfFlexSource<AllTemplatsSource<P>> | __VkfTemplatesElementPlus.Source;
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;