@speykye/vue-form-engine-adapter-antdv 0.1.0
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/fields/AntdvInputField.vue.d.ts +21 -0
- package/dist/fields/AntdvInputField.vue.d.ts.map +1 -0
- package/dist/fields/AntdvNumberField.vue.d.ts +21 -0
- package/dist/fields/AntdvNumberField.vue.d.ts.map +1 -0
- package/dist/fields/AntdvSelectField.vue.d.ts +21 -0
- package/dist/fields/AntdvSelectField.vue.d.ts.map +1 -0
- package/dist/fields/AntdvSwitchField.vue.d.ts +21 -0
- package/dist/fields/AntdvSwitchField.vue.d.ts.map +1 -0
- package/dist/fields/AntdvTextareaField.vue.d.ts +21 -0
- package/dist/fields/AntdvTextareaField.vue.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +279 -0
- package/dist/wrappers/AntdvFormItemWrapper.vue.d.ts +14 -0
- package/dist/wrappers/AntdvFormItemWrapper.vue.d.ts.map +1 -0
- package/dist/wrappers/AntdvFormWrapper.vue.d.ts +14 -0
- package/dist/wrappers/AntdvFormWrapper.vue.d.ts.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormFieldSchema, FormModel } from '@speykye/vue-form-engine-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
field: FormFieldSchema;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
model: FormModel;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: any) => any;
|
|
12
|
+
change: (value: any) => any;
|
|
13
|
+
blur: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
|
+
onChange?: ((value: any) => any) | undefined;
|
|
17
|
+
onBlur?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=AntdvInputField.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvInputField.vue.d.ts","sourceRoot":"","sources":["../../src/fields/AntdvInputField.vue"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEhF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAwGF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormFieldSchema, FormModel } from '@speykye/vue-form-engine-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
field: FormFieldSchema;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
model: FormModel;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: any) => any;
|
|
12
|
+
change: (value: any) => any;
|
|
13
|
+
blur: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
|
+
onChange?: ((value: any) => any) | undefined;
|
|
17
|
+
onBlur?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=AntdvNumberField.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvNumberField.vue.d.ts","sourceRoot":"","sources":["../../src/fields/AntdvNumberField.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEhF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAyGF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormFieldSchema, FormModel } from '@speykye/vue-form-engine-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
field: FormFieldSchema;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
model: FormModel;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: any) => any;
|
|
12
|
+
change: (value: any) => any;
|
|
13
|
+
blur: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
|
+
onChange?: ((value: any) => any) | undefined;
|
|
17
|
+
onBlur?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=AntdvSelectField.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvSelectField.vue.d.ts","sourceRoot":"","sources":["../../src/fields/AntdvSelectField.vue"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEhF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAiIF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormFieldSchema, FormModel } from '@speykye/vue-form-engine-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
field: FormFieldSchema;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
model: FormModel;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: any) => any;
|
|
12
|
+
change: (value: any) => any;
|
|
13
|
+
blur: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
|
+
onChange?: ((value: any) => any) | undefined;
|
|
17
|
+
onBlur?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=AntdvSwitchField.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvSwitchField.vue.d.ts","sourceRoot":"","sources":["../../src/fields/AntdvSwitchField.vue"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEhF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAmGF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormFieldSchema, FormModel } from '@speykye/vue-form-engine-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
field: FormFieldSchema;
|
|
4
|
+
modelValue: any;
|
|
5
|
+
model: FormModel;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: any) => any;
|
|
12
|
+
change: (value: any) => any;
|
|
13
|
+
blur: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
|
+
onChange?: ((value: any) => any) | undefined;
|
|
17
|
+
onBlur?: (() => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=AntdvTextareaField.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvTextareaField.vue.d.ts","sourceRoot":"","sources":["../../src/fields/AntdvTextareaField.vue"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEhF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAwGF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue");var t=(0,e.defineComponent)({__name:`AntdvInputField`,props:{field:{},modelValue:{},model:{},disabled:{type:Boolean},readonly:{type:Boolean},errorMessage:{}},emits:[`update:modelValue`,`change`,`blur`],setup(t,{emit:n}){let r=n;function i(e){r(`change`,e.target.value)}return(n,a)=>{let o=(0,e.resolveComponent)(`a-input`),s=(0,e.resolveComponent)(`a-form-item`);return(0,e.openBlock)(),(0,e.createBlock)(s,{label:t.field.label,"validate-status":t.errorMessage?`error`:void 0,help:t.errorMessage||void 0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(o,(0,e.mergeProps)({value:t.modelValue,placeholder:t.field.placeholder,disabled:t.disabled,readonly:t.readonly},t.field.props,{"onUpdate:value":a[0]||=e=>r(`update:modelValue`,e),onChange:i,onBlur:a[1]||=e=>r(`blur`)}),null,16,[`value`,`placeholder`,`disabled`,`readonly`])]),_:1},8,[`label`,`validate-status`,`help`])}}}),n=(0,e.defineComponent)({__name:`AntdvTextareaField`,props:{field:{},modelValue:{},model:{},disabled:{type:Boolean},readonly:{type:Boolean},errorMessage:{}},emits:[`update:modelValue`,`change`,`blur`],setup(t,{emit:n}){let r=n;function i(e){r(`change`,e.target.value)}return(n,a)=>{let o=(0,e.resolveComponent)(`a-textarea`),s=(0,e.resolveComponent)(`a-form-item`);return(0,e.openBlock)(),(0,e.createBlock)(s,{label:t.field.label,"validate-status":t.errorMessage?`error`:void 0,help:t.errorMessage||void 0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(o,(0,e.mergeProps)({value:t.modelValue,placeholder:t.field.placeholder,disabled:t.disabled,readonly:t.readonly},t.field.props,{"onUpdate:value":a[0]||=e=>r(`update:modelValue`,e),onChange:i,onBlur:a[1]||=e=>r(`blur`)}),null,16,[`value`,`placeholder`,`disabled`,`readonly`])]),_:1},8,[`label`,`validate-status`,`help`])}}}),r=(0,e.defineComponent)({__name:`AntdvNumberField`,props:{field:{},modelValue:{},model:{},disabled:{type:Boolean},readonly:{type:Boolean},errorMessage:{}},emits:[`update:modelValue`,`change`,`blur`],setup(t,{emit:n}){let r=n;return(n,i)=>{let a=(0,e.resolveComponent)(`a-input-number`),o=(0,e.resolveComponent)(`a-form-item`);return(0,e.openBlock)(),(0,e.createBlock)(o,{label:t.field.label,"validate-status":t.errorMessage?`error`:void 0,help:t.errorMessage||void 0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(a,(0,e.mergeProps)({value:t.modelValue,placeholder:t.field.placeholder,disabled:t.disabled,readonly:t.readonly,style:{width:`100%`}},t.field.props,{"onUpdate:value":i[0]||=e=>r(`update:modelValue`,e),onChange:i[1]||=e=>r(`change`,e),onBlur:i[2]||=e=>r(`blur`)}),null,16,[`value`,`placeholder`,`disabled`,`readonly`])]),_:1},8,[`label`,`validate-status`,`help`])}}}),i=(0,e.defineComponent)({__name:`AntdvSelectField`,props:{field:{},modelValue:{},model:{},disabled:{type:Boolean},readonly:{type:Boolean},errorMessage:{}},emits:[`update:modelValue`,`change`,`blur`],setup(t,{emit:n}){let r=n;return(n,i)=>{let a=(0,e.resolveComponent)(`a-select-option`),o=(0,e.resolveComponent)(`a-select`),s=(0,e.resolveComponent)(`a-form-item`);return(0,e.openBlock)(),(0,e.createBlock)(s,{label:t.field.label,"validate-status":t.errorMessage?`error`:void 0,help:t.errorMessage||void 0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(o,(0,e.mergeProps)({value:t.modelValue,placeholder:t.field.placeholder,disabled:t.disabled||t.readonly,style:{width:`100%`}},t.field.props,{"onUpdate:value":i[0]||=e=>r(`update:modelValue`,e),onChange:i[1]||=e=>r(`change`,e),onBlur:i[2]||=e=>r(`blur`)}),{default:(0,e.withCtx)(()=>[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.field.options??[],t=>((0,e.openBlock)(),(0,e.createBlock)(a,{key:String(t.value),value:t.value,disabled:t.disabled},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.label),1)]),_:2},1032,[`value`,`disabled`]))),128))]),_:1},16,[`value`,`placeholder`,`disabled`])]),_:1},8,[`label`,`validate-status`,`help`])}}}),a=(0,e.defineComponent)({__name:`AntdvSwitchField`,props:{field:{},modelValue:{},model:{},disabled:{type:Boolean},readonly:{type:Boolean},errorMessage:{}},emits:[`update:modelValue`,`change`,`blur`],setup(t,{emit:n}){let r=n;return(n,i)=>{let a=(0,e.resolveComponent)(`a-switch`),o=(0,e.resolveComponent)(`a-form-item`);return(0,e.openBlock)(),(0,e.createBlock)(o,{label:t.field.label,"validate-status":t.errorMessage?`error`:void 0,help:t.errorMessage||void 0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(a,(0,e.mergeProps)({checked:!!t.modelValue,disabled:t.disabled||t.readonly},t.field.props,{"onUpdate:checked":i[0]||=e=>r(`update:modelValue`,e),onChange:i[1]||=e=>r(`change`,e),onBlur:i[2]||=e=>r(`blur`)}),null,16,[`checked`,`disabled`])]),_:1},8,[`label`,`validate-status`,`help`])}}});function o(){return{name:`antdv-adapter`,fields:{input:{component:t,defaultValue:``},textarea:{component:n,defaultValue:``},number:{component:r,defaultValue:void 0},select:{component:i,defaultValue:void 0},switch:{component:a,defaultValue:!1}}}}exports.antdvAdapter=o;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAOhE,wBAAgB,YAAY,IAAI,UAAU,CAWzC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { Fragment as e, createBlock as t, createElementBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, mergeProps as o, openBlock as s, renderList as c, resolveComponent as l, toDisplayString as u, withCtx as d } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/fields/AntdvInputField.vue
|
|
4
|
+
var f = /* @__PURE__ */ a({
|
|
5
|
+
__name: "AntdvInputField",
|
|
6
|
+
props: {
|
|
7
|
+
field: {},
|
|
8
|
+
modelValue: {},
|
|
9
|
+
model: {},
|
|
10
|
+
disabled: { type: Boolean },
|
|
11
|
+
readonly: { type: Boolean },
|
|
12
|
+
errorMessage: {}
|
|
13
|
+
},
|
|
14
|
+
emits: [
|
|
15
|
+
"update:modelValue",
|
|
16
|
+
"change",
|
|
17
|
+
"blur"
|
|
18
|
+
],
|
|
19
|
+
setup(e, { emit: n }) {
|
|
20
|
+
let r = n;
|
|
21
|
+
function a(e) {
|
|
22
|
+
r("change", e.target.value);
|
|
23
|
+
}
|
|
24
|
+
return (n, c) => {
|
|
25
|
+
let u = l("a-input"), f = l("a-form-item");
|
|
26
|
+
return s(), t(f, {
|
|
27
|
+
label: e.field.label,
|
|
28
|
+
"validate-status": e.errorMessage ? "error" : void 0,
|
|
29
|
+
help: e.errorMessage || void 0
|
|
30
|
+
}, {
|
|
31
|
+
default: d(() => [i(u, o({
|
|
32
|
+
value: e.modelValue,
|
|
33
|
+
placeholder: e.field.placeholder,
|
|
34
|
+
disabled: e.disabled,
|
|
35
|
+
readonly: e.readonly
|
|
36
|
+
}, e.field.props, {
|
|
37
|
+
"onUpdate:value": c[0] ||= (e) => r("update:modelValue", e),
|
|
38
|
+
onChange: a,
|
|
39
|
+
onBlur: c[1] ||= (e) => r("blur")
|
|
40
|
+
}), null, 16, [
|
|
41
|
+
"value",
|
|
42
|
+
"placeholder",
|
|
43
|
+
"disabled",
|
|
44
|
+
"readonly"
|
|
45
|
+
])]),
|
|
46
|
+
_: 1
|
|
47
|
+
}, 8, [
|
|
48
|
+
"label",
|
|
49
|
+
"validate-status",
|
|
50
|
+
"help"
|
|
51
|
+
]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}), p = /* @__PURE__ */ a({
|
|
55
|
+
__name: "AntdvTextareaField",
|
|
56
|
+
props: {
|
|
57
|
+
field: {},
|
|
58
|
+
modelValue: {},
|
|
59
|
+
model: {},
|
|
60
|
+
disabled: { type: Boolean },
|
|
61
|
+
readonly: { type: Boolean },
|
|
62
|
+
errorMessage: {}
|
|
63
|
+
},
|
|
64
|
+
emits: [
|
|
65
|
+
"update:modelValue",
|
|
66
|
+
"change",
|
|
67
|
+
"blur"
|
|
68
|
+
],
|
|
69
|
+
setup(e, { emit: n }) {
|
|
70
|
+
let r = n;
|
|
71
|
+
function a(e) {
|
|
72
|
+
r("change", e.target.value);
|
|
73
|
+
}
|
|
74
|
+
return (n, c) => {
|
|
75
|
+
let u = l("a-textarea"), f = l("a-form-item");
|
|
76
|
+
return s(), t(f, {
|
|
77
|
+
label: e.field.label,
|
|
78
|
+
"validate-status": e.errorMessage ? "error" : void 0,
|
|
79
|
+
help: e.errorMessage || void 0
|
|
80
|
+
}, {
|
|
81
|
+
default: d(() => [i(u, o({
|
|
82
|
+
value: e.modelValue,
|
|
83
|
+
placeholder: e.field.placeholder,
|
|
84
|
+
disabled: e.disabled,
|
|
85
|
+
readonly: e.readonly
|
|
86
|
+
}, e.field.props, {
|
|
87
|
+
"onUpdate:value": c[0] ||= (e) => r("update:modelValue", e),
|
|
88
|
+
onChange: a,
|
|
89
|
+
onBlur: c[1] ||= (e) => r("blur")
|
|
90
|
+
}), null, 16, [
|
|
91
|
+
"value",
|
|
92
|
+
"placeholder",
|
|
93
|
+
"disabled",
|
|
94
|
+
"readonly"
|
|
95
|
+
])]),
|
|
96
|
+
_: 1
|
|
97
|
+
}, 8, [
|
|
98
|
+
"label",
|
|
99
|
+
"validate-status",
|
|
100
|
+
"help"
|
|
101
|
+
]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}), m = /* @__PURE__ */ a({
|
|
105
|
+
__name: "AntdvNumberField",
|
|
106
|
+
props: {
|
|
107
|
+
field: {},
|
|
108
|
+
modelValue: {},
|
|
109
|
+
model: {},
|
|
110
|
+
disabled: { type: Boolean },
|
|
111
|
+
readonly: { type: Boolean },
|
|
112
|
+
errorMessage: {}
|
|
113
|
+
},
|
|
114
|
+
emits: [
|
|
115
|
+
"update:modelValue",
|
|
116
|
+
"change",
|
|
117
|
+
"blur"
|
|
118
|
+
],
|
|
119
|
+
setup(e, { emit: n }) {
|
|
120
|
+
let r = n;
|
|
121
|
+
return (n, a) => {
|
|
122
|
+
let c = l("a-input-number"), u = l("a-form-item");
|
|
123
|
+
return s(), t(u, {
|
|
124
|
+
label: e.field.label,
|
|
125
|
+
"validate-status": e.errorMessage ? "error" : void 0,
|
|
126
|
+
help: e.errorMessage || void 0
|
|
127
|
+
}, {
|
|
128
|
+
default: d(() => [i(c, o({
|
|
129
|
+
value: e.modelValue,
|
|
130
|
+
placeholder: e.field.placeholder,
|
|
131
|
+
disabled: e.disabled,
|
|
132
|
+
readonly: e.readonly,
|
|
133
|
+
style: { width: "100%" }
|
|
134
|
+
}, e.field.props, {
|
|
135
|
+
"onUpdate:value": a[0] ||= (e) => r("update:modelValue", e),
|
|
136
|
+
onChange: a[1] ||= (e) => r("change", e),
|
|
137
|
+
onBlur: a[2] ||= (e) => r("blur")
|
|
138
|
+
}), null, 16, [
|
|
139
|
+
"value",
|
|
140
|
+
"placeholder",
|
|
141
|
+
"disabled",
|
|
142
|
+
"readonly"
|
|
143
|
+
])]),
|
|
144
|
+
_: 1
|
|
145
|
+
}, 8, [
|
|
146
|
+
"label",
|
|
147
|
+
"validate-status",
|
|
148
|
+
"help"
|
|
149
|
+
]);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}), h = /* @__PURE__ */ a({
|
|
153
|
+
__name: "AntdvSelectField",
|
|
154
|
+
props: {
|
|
155
|
+
field: {},
|
|
156
|
+
modelValue: {},
|
|
157
|
+
model: {},
|
|
158
|
+
disabled: { type: Boolean },
|
|
159
|
+
readonly: { type: Boolean },
|
|
160
|
+
errorMessage: {}
|
|
161
|
+
},
|
|
162
|
+
emits: [
|
|
163
|
+
"update:modelValue",
|
|
164
|
+
"change",
|
|
165
|
+
"blur"
|
|
166
|
+
],
|
|
167
|
+
setup(a, { emit: f }) {
|
|
168
|
+
let p = f;
|
|
169
|
+
return (f, m) => {
|
|
170
|
+
let h = l("a-select-option"), g = l("a-select"), _ = l("a-form-item");
|
|
171
|
+
return s(), t(_, {
|
|
172
|
+
label: a.field.label,
|
|
173
|
+
"validate-status": a.errorMessage ? "error" : void 0,
|
|
174
|
+
help: a.errorMessage || void 0
|
|
175
|
+
}, {
|
|
176
|
+
default: d(() => [i(g, o({
|
|
177
|
+
value: a.modelValue,
|
|
178
|
+
placeholder: a.field.placeholder,
|
|
179
|
+
disabled: a.disabled || a.readonly,
|
|
180
|
+
style: { width: "100%" }
|
|
181
|
+
}, a.field.props, {
|
|
182
|
+
"onUpdate:value": m[0] ||= (e) => p("update:modelValue", e),
|
|
183
|
+
onChange: m[1] ||= (e) => p("change", e),
|
|
184
|
+
onBlur: m[2] ||= (e) => p("blur")
|
|
185
|
+
}), {
|
|
186
|
+
default: d(() => [(s(!0), n(e, null, c(a.field.options ?? [], (e) => (s(), t(h, {
|
|
187
|
+
key: String(e.value),
|
|
188
|
+
value: e.value,
|
|
189
|
+
disabled: e.disabled
|
|
190
|
+
}, {
|
|
191
|
+
default: d(() => [r(u(e.label), 1)]),
|
|
192
|
+
_: 2
|
|
193
|
+
}, 1032, ["value", "disabled"]))), 128))]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 16, [
|
|
196
|
+
"value",
|
|
197
|
+
"placeholder",
|
|
198
|
+
"disabled"
|
|
199
|
+
])]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, [
|
|
202
|
+
"label",
|
|
203
|
+
"validate-status",
|
|
204
|
+
"help"
|
|
205
|
+
]);
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}), g = /* @__PURE__ */ a({
|
|
209
|
+
__name: "AntdvSwitchField",
|
|
210
|
+
props: {
|
|
211
|
+
field: {},
|
|
212
|
+
modelValue: {},
|
|
213
|
+
model: {},
|
|
214
|
+
disabled: { type: Boolean },
|
|
215
|
+
readonly: { type: Boolean },
|
|
216
|
+
errorMessage: {}
|
|
217
|
+
},
|
|
218
|
+
emits: [
|
|
219
|
+
"update:modelValue",
|
|
220
|
+
"change",
|
|
221
|
+
"blur"
|
|
222
|
+
],
|
|
223
|
+
setup(e, { emit: n }) {
|
|
224
|
+
let r = n;
|
|
225
|
+
return (n, a) => {
|
|
226
|
+
let c = l("a-switch"), u = l("a-form-item");
|
|
227
|
+
return s(), t(u, {
|
|
228
|
+
label: e.field.label,
|
|
229
|
+
"validate-status": e.errorMessage ? "error" : void 0,
|
|
230
|
+
help: e.errorMessage || void 0
|
|
231
|
+
}, {
|
|
232
|
+
default: d(() => [i(c, o({
|
|
233
|
+
checked: !!e.modelValue,
|
|
234
|
+
disabled: e.disabled || e.readonly
|
|
235
|
+
}, e.field.props, {
|
|
236
|
+
"onUpdate:checked": a[0] ||= (e) => r("update:modelValue", e),
|
|
237
|
+
onChange: a[1] ||= (e) => r("change", e),
|
|
238
|
+
onBlur: a[2] ||= (e) => r("blur")
|
|
239
|
+
}), null, 16, ["checked", "disabled"])]),
|
|
240
|
+
_: 1
|
|
241
|
+
}, 8, [
|
|
242
|
+
"label",
|
|
243
|
+
"validate-status",
|
|
244
|
+
"help"
|
|
245
|
+
]);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/index.ts
|
|
251
|
+
function _() {
|
|
252
|
+
return {
|
|
253
|
+
name: "antdv-adapter",
|
|
254
|
+
fields: {
|
|
255
|
+
input: {
|
|
256
|
+
component: f,
|
|
257
|
+
defaultValue: ""
|
|
258
|
+
},
|
|
259
|
+
textarea: {
|
|
260
|
+
component: p,
|
|
261
|
+
defaultValue: ""
|
|
262
|
+
},
|
|
263
|
+
number: {
|
|
264
|
+
component: m,
|
|
265
|
+
defaultValue: void 0
|
|
266
|
+
},
|
|
267
|
+
select: {
|
|
268
|
+
component: h,
|
|
269
|
+
defaultValue: void 0
|
|
270
|
+
},
|
|
271
|
+
switch: {
|
|
272
|
+
component: g,
|
|
273
|
+
defaultValue: !1
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
export { _ as antdvAdapter };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=AntdvFormItemWrapper.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvFormItemWrapper.vue.d.ts","sourceRoot":"","sources":["../../src/wrappers/AntdvFormItemWrapper.vue"],"names":[],"mappings":"AA8BA,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_8) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=AntdvFormWrapper.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AntdvFormWrapper.vue.d.ts","sourceRoot":"","sources":["../../src/wrappers/AntdvFormWrapper.vue"],"names":[],"mappings":"AAgCA,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@speykye/vue-form-engine-adapter-antdv",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"vue": "^3.5.0",
|
|
20
|
+
"ant-design-vue": "^4.2.6"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@speykye/vue-form-engine-core": "^0.1.0"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "vue-tsc --declaration --emitDeclarationOnly --outDir dist && vite build",
|
|
27
|
+
"typecheck": "vue-tsc --noEmit"
|
|
28
|
+
}
|
|
29
|
+
}
|