@king-one/form-design 0.0.26 → 0.0.27
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/CHANGELOG.md +6 -0
- package/dist/es/src/components/form-material.vue.mjs +1 -1
- package/dist/es/src/components/panel/index.mjs +26 -24
- package/dist/es/src/components/panel/widget/leave-kit.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/leave-kit.vue2.mjs +66 -0
- package/dist/es/src/components/panel/widget/overtime-kit.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/overtime-kit.vue2.mjs +66 -0
- package/dist/es/src/components/props/widget/GridProps.vue2.mjs +80 -83
- package/dist/es/src/config/index.mjs +149 -124
- package/dist/es/src/core/FormSchema.mjs +45 -40
- package/dist/lib/src/components/form-material.vue.js +1 -1
- package/dist/lib/src/components/panel/index.js +1 -1
- package/dist/lib/src/components/panel/widget/leave-kit.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/leave-kit.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/overtime-kit.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/overtime-kit.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/GridProps.vue2.js +1 -1
- package/dist/lib/src/config/index.js +15 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/kit-panel.css +1 -1
- package/dist/types/src/components/panel/widget/leave-kit.vue.d.ts +3 -0
- package/dist/types/src/components/panel/widget/overtime-kit.vue.d.ts +3 -0
- package/dist/types/src/core/Design.d.ts +211 -79
- package/dist/types/src/core/FormSchema.d.ts +77 -13
- package/dist/types/src/types.d.ts +23 -7
- package/package.json +1 -1
- package/dist/es/src/components/panel/widget/kit.vue.mjs +0 -4
- package/dist/es/src/components/panel/widget/kit.vue2.mjs +0 -48
- package/dist/lib/src/components/panel/widget/kit.vue.js +0 -1
- package/dist/lib/src/components/panel/widget/kit.vue2.js +0 -1
- package/dist/types/src/components/panel/widget/kit.vue.d.ts +0 -8
|
@@ -11,6 +11,24 @@ export interface FormProps {
|
|
|
11
11
|
labelAlign: 'left' | 'right' | 'top';
|
|
12
12
|
style?: CSSProperties;
|
|
13
13
|
}
|
|
14
|
+
export interface BaseFieldSchema {
|
|
15
|
+
'type': valueType;
|
|
16
|
+
'format'?: string;
|
|
17
|
+
'title'?: string;
|
|
18
|
+
'name'?: string;
|
|
19
|
+
'x-component'?: string;
|
|
20
|
+
'x-component-props'?: Record<string, any>;
|
|
21
|
+
'x-decorator'?: string;
|
|
22
|
+
'properties'?: Record<string, BaseFieldSchema>;
|
|
23
|
+
'items'?: BaseFieldSchema | BaseFieldSchema[];
|
|
24
|
+
'x-validator'?: any[];
|
|
25
|
+
'x-reactions'?: {
|
|
26
|
+
dependencies?: Record<string, any>[];
|
|
27
|
+
fulfill?: {
|
|
28
|
+
state?: Record<string, any>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
14
32
|
export interface FieldSchema {
|
|
15
33
|
'title': string;
|
|
16
34
|
'key': string;
|
|
@@ -18,22 +36,20 @@ export interface FieldSchema {
|
|
|
18
36
|
'x-component'?: string;
|
|
19
37
|
'enum'?: any[];
|
|
20
38
|
'format'?: string;
|
|
21
|
-
'items'?:
|
|
22
|
-
|
|
23
|
-
properties?: Record<string, FieldSchema>;
|
|
24
|
-
[x: string]: any;
|
|
25
|
-
};
|
|
39
|
+
'items'?: BaseFieldSchema | BaseFieldSchema[];
|
|
40
|
+
'properties'?: Record<string, BaseFieldSchema>;
|
|
26
41
|
'children'?: FieldSchema[];
|
|
27
42
|
'required'?: boolean;
|
|
28
43
|
'id'?: string;
|
|
29
44
|
'name'?: string;
|
|
30
45
|
'icon'?: string | VNode;
|
|
31
46
|
'x-design-props'?: {
|
|
32
|
-
|
|
33
|
-
validate?: {
|
|
47
|
+
'validate'?: {
|
|
34
48
|
status: 'success' | 'error' | 'warning' | '';
|
|
35
49
|
message: string;
|
|
36
50
|
};
|
|
51
|
+
'convert-key'?: 'items' | 'properties';
|
|
52
|
+
'convert-type'?: 'base' | 'object' | 'array';
|
|
37
53
|
[x: string]: any;
|
|
38
54
|
};
|
|
39
55
|
'x-component-props'?: Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { defineComponent as f, defineAsyncComponent as m, openBlock as t, createElementBlock as s, normalizeClass as u, unref as i, Fragment as C, renderList as k, createBlock as y, resolveDynamicComponent as _ } from "vue";
|
|
2
|
-
import "../../../internal.mjs";
|
|
3
|
-
import { useInjectDesignContext as g } from "../../../context/design.mjs";
|
|
4
|
-
import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
|
|
5
|
-
const D = /* @__PURE__ */ f({
|
|
6
|
-
__name: "kit",
|
|
7
|
-
props: {
|
|
8
|
-
field: {}
|
|
9
|
-
},
|
|
10
|
-
setup(v) {
|
|
11
|
-
const { b: l } = h("kit-panel"), c = g(), { shared: a } = c;
|
|
12
|
-
function d(o, n = {}) {
|
|
13
|
-
return Object.entries(o).forEach(([e, r]) => {
|
|
14
|
-
typeof r == "function" ? n[e] = m(r) : n[e] = r;
|
|
15
|
-
}), n;
|
|
16
|
-
}
|
|
17
|
-
const p = d(a.panelWidgets);
|
|
18
|
-
return (o, n) => (t(), s(
|
|
19
|
-
"div",
|
|
20
|
-
{
|
|
21
|
-
class: u(i(l)())
|
|
22
|
-
},
|
|
23
|
-
[
|
|
24
|
-
(t(!0), s(
|
|
25
|
-
C,
|
|
26
|
-
null,
|
|
27
|
-
k(o.field.children, (e) => (t(), s("div", {
|
|
28
|
-
key: e.id,
|
|
29
|
-
class: "kit-item"
|
|
30
|
-
}, [
|
|
31
|
-
(t(), y(_(i(p)[e.key]), {
|
|
32
|
-
style: { width: "100%" },
|
|
33
|
-
readonly: "",
|
|
34
|
-
field: e
|
|
35
|
-
}, null, 8, ["field"]))
|
|
36
|
-
]))),
|
|
37
|
-
128
|
|
38
|
-
/* KEYED_FRAGMENT */
|
|
39
|
-
))
|
|
40
|
-
],
|
|
41
|
-
2
|
|
42
|
-
/* CLASS */
|
|
43
|
-
));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
export {
|
|
47
|
-
D as default
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./kit.vue2.js");exports.default=e.default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../internal.js");const a=require("../../../context/design.js"),d=require("../../../hooks/use-namespace/index.js"),p=e.defineComponent({__name:"kit",props:{field:{}},setup(f){const{b:l}=d.useNamespace("kit-panel"),s=a.useInjectDesignContext(),{shared:i}=s;function c(o,t={}){return Object.entries(o).forEach(([n,r])=>{typeof r=="function"?t[n]=e.defineAsyncComponent(r):t[n]=r}),t}const u=c(i.panelWidgets);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l)())},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.children,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"kit-item"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)[n.key]),{style:{width:"100%"},readonly:"",field:n},null,8,["field"]))]))),128))],2))}});exports.default=p;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FieldSchema } from '@king-one/form-design/dist/types/src/types';
|
|
2
|
-
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
declare const _default: DefineComponent<{
|
|
4
|
-
field: FieldSchema;
|
|
5
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
6
|
-
field: FieldSchema;
|
|
7
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|