icarys-fc-vant 1.0.1 → 1.0.2
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/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "icarys-fc-vant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "基于FormCreate和Vant的移动端低代码表单组件库,可以通过JSON生成具有动态渲染、数据收集、验证和提交功能的表单",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"module": "./src/index.js",
|
|
7
7
|
"unpkg": "./src/index.js",
|
|
8
8
|
"jsdelivr": "./src/index.js",
|
|
9
|
-
"typings": "./types/index.d.ts",
|
|
10
9
|
"scripts": {
|
|
11
|
-
"clean": "rimraf dist/",
|
|
12
|
-
"bili": "bili",
|
|
13
|
-
"build": "npm-run-all clean bili",
|
|
14
10
|
"dev": "vue-cli-service serve src/vant/examples",
|
|
15
|
-
"pub": "npm
|
|
11
|
+
"pub": "npm publish"
|
|
16
12
|
},
|
|
17
13
|
"keywords": [
|
|
18
14
|
"vue3",
|
package/src/index.js
CHANGED
|
@@ -1,56 +1,5 @@
|
|
|
1
1
|
// 主入口文件
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import * as utils from './utils/lib';
|
|
5
|
-
|
|
6
|
-
// 创建FormCreate实例工厂函数
|
|
7
|
-
const createFormCreate = (rules = [], options = {}) => {
|
|
8
|
-
return formCreateMobile(rules, options);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// 扩展createFormCreate,添加工具方法
|
|
12
|
-
Object.assign(createFormCreate, {
|
|
13
|
-
// 表单创建方法
|
|
14
|
-
create: createFormCreate,
|
|
15
|
-
|
|
16
|
-
// 工具方法
|
|
17
|
-
...utils,
|
|
18
|
-
|
|
19
|
-
// JSON解析方法
|
|
20
|
-
jsonParse: (jsonString) => {
|
|
21
|
-
try {
|
|
22
|
-
return JSON.parse(jsonString);
|
|
23
|
-
} catch (error) {
|
|
24
|
-
console.error('JSON parse error:', error);
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
// JSON序列化方法
|
|
30
|
-
jsonStringify: (obj) => {
|
|
31
|
-
try {
|
|
32
|
-
return JSON.stringify(obj, null, 2);
|
|
33
|
-
} catch (error) {
|
|
34
|
-
console.error('JSON stringify error:', error);
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
// 表单验证器
|
|
40
|
-
validator: formCreateMobile.validator || {},
|
|
41
|
-
|
|
42
|
-
// 表单生成器
|
|
43
|
-
maker: formCreateMobile.maker || {},
|
|
44
|
-
|
|
45
|
-
// 版本信息
|
|
46
|
-
version: '1.0.0'
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// 默认导出
|
|
50
|
-
export default createFormCreate;
|
|
51
|
-
|
|
52
|
-
// 命名导出
|
|
53
|
-
export { formCreateMobile };
|
|
54
|
-
export { formCreate };
|
|
2
|
+
export { default as formCreateMobile } from './vant/src/index';
|
|
3
|
+
export { default as formCreate } from './core/src/index';
|
|
55
4
|
export * from './utils/lib';
|
|
56
5
|
|
|
@@ -25,7 +25,7 @@ export default defineComponent({
|
|
|
25
25
|
},
|
|
26
26
|
render() {
|
|
27
27
|
return <van-checkbox-group direction="horizontal" {...this.$attrs} modelValue={Array.isArray(this.modelValue) ? this.modelValue : []}
|
|
28
|
-
|
|
28
|
+
onUpdate:modelValue={this.onInput}>
|
|
29
29
|
{(this.options || []).map(opt => {
|
|
30
30
|
const tmp = {...opt};
|
|
31
31
|
const {text, value} = opt;
|
|
@@ -25,7 +25,7 @@ export default defineComponent({
|
|
|
25
25
|
},
|
|
26
26
|
render() {
|
|
27
27
|
return <van-radio-group direction="horizontal" {...this.$attrs} modelValue={this.modelValue}
|
|
28
|
-
|
|
28
|
+
onUpdate:modelValue={this.onInput}>
|
|
29
29
|
{(this.options || []).map(opt => {
|
|
30
30
|
const tmp = {...opt};
|
|
31
31
|
const {text, value} = opt;
|
package/types/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormCreate,
|
|
3
|
-
FormCreateProps as $FormCreateProps,
|
|
4
|
-
FormRule as $FormRule,
|
|
5
|
-
Options as $Options,
|
|
6
|
-
Rule as $Rule,
|
|
7
|
-
Creator as $Creator,
|
|
8
|
-
Control as $Control,
|
|
9
|
-
Api as $Api,
|
|
10
|
-
Effect as $Effect,
|
|
11
|
-
Parser as $Parser,
|
|
12
|
-
} from "../src/core/src/index";
|
|
13
|
-
import {ApiAttrs, CreatorAttrs, OptionAttrs, RuleAttrs} from "../src/vant/types/config";
|
|
14
|
-
import {ExtractPropTypes} from "vue";
|
|
15
|
-
|
|
16
|
-
// 导出移动端表单生成器
|
|
17
|
-
declare const formCreateMobile: FormCreate<{}, OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>;
|
|
18
|
-
|
|
19
|
-
// 导出核心表单生成器
|
|
20
|
-
declare const formCreate: FormCreate;
|
|
21
|
-
|
|
22
|
-
// 导出工具函数
|
|
23
|
-
export * from '../src/utils/lib';
|
|
24
|
-
|
|
25
|
-
// 主要导出
|
|
26
|
-
export { formCreateMobile, formCreate };
|
|
27
|
-
export default formCreateMobile;
|
|
28
|
-
|
|
29
|
-
// 类型定义
|
|
30
|
-
export declare const maker: typeof formCreateMobile.maker;
|
|
31
|
-
export type FormRule = $FormRule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
32
|
-
export type Options = $Options<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
33
|
-
export type Rule = $Rule<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
34
|
-
export type Effect = $Effect<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
35
|
-
export type Creator = $Creator<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
36
|
-
export type Control = $Control<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
37
|
-
export type Api = $Api<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>
|
|
38
|
-
export type FormCreateProps = ExtractPropTypes<$FormCreateProps<OptionAttrs, CreatorAttrs, RuleAttrs, ApiAttrs>>
|
|
39
|
-
export type Parser = $Parser
|