@hr-components-dev/cli 1.1.6 → 1.1.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hr-components-dev/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"vite.config.ts",
|
|
33
33
|
"index.html",
|
|
34
34
|
"tsconfig.build.json",
|
|
35
|
+
"!src/scripts/**/*.ts",
|
|
35
36
|
"!**/*.test.js",
|
|
36
37
|
"!**/*.spec.js"
|
|
37
38
|
],
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { build } from "vite";
|
|
3
|
-
import vue from "@vitejs/plugin-vue";
|
|
4
|
-
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
5
|
-
import { dirname, resolve } from "path";
|
|
6
|
-
import { existsSync, readdirSync, readFileSync, statSync } from "fs";
|
|
7
|
-
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
|
8
|
-
import consola from "consola";
|
|
9
|
-
|
|
10
|
-
// 查找项目根目录
|
|
11
|
-
export const findProjectRoot = (startDir: string): string => {
|
|
12
|
-
let currentDir = startDir;
|
|
13
|
-
|
|
14
|
-
// 向上搜索直到找到标识性的文件或达到系统根目录
|
|
15
|
-
while (currentDir !== dirname(currentDir)) {
|
|
16
|
-
const pkgPath = resolve(currentDir, 'package.json');
|
|
17
|
-
if (existsSync(pkgPath)) {
|
|
18
|
-
try {
|
|
19
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
20
|
-
|
|
21
|
-
// 检查是否为根目录的更可靠方法:
|
|
22
|
-
// 1. 是否包含 workspaces 字段
|
|
23
|
-
// 2. 是否包含 src 目录
|
|
24
|
-
// 3. 是否包含特定的根项目标识
|
|
25
|
-
if (pkg.workspaces || existsSync(resolve(currentDir, 'src'))) {
|
|
26
|
-
// 验证是否存在 src/components 目录
|
|
27
|
-
if (existsSync(resolve(currentDir, 'src', 'components'))) {
|
|
28
|
-
return currentDir;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
} catch (e) {
|
|
32
|
-
// 忽略解析错误,继续向上搜索
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
currentDir = dirname(currentDir);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 如果没找到根目录,则尝试使用命令行参数或者环境变量
|
|
39
|
-
const argv = require('yargs').argv;
|
|
40
|
-
if (argv.root) {
|
|
41
|
-
return resolve(argv.root);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (process.env.PROJECT_ROOT) {
|
|
45
|
-
return resolve(process.env.PROJECT_ROOT);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// 最后的备选方案:返回初始目录
|
|
49
|
-
return startDir;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// 获取项目根目录
|
|
54
|
-
const projectRoot = findProjectRoot(process.cwd());
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// 将连字符命名转换为大驼峰命名(PascalCase)
|
|
58
|
-
function toPascalCase(str: string) {
|
|
59
|
-
// 将连字符命名转换为驼峰命名
|
|
60
|
-
function toCamelCase(str: string) {
|
|
61
|
-
return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
62
|
-
}
|
|
63
|
-
const camelCase = toCamelCase(str);
|
|
64
|
-
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// 获取所有组件名称
|
|
68
|
-
function getAllComponents() {
|
|
69
|
-
consola.info('projectRoot:', projectRoot);
|
|
70
|
-
const srcDir = resolve(projectRoot, "src/components");
|
|
71
|
-
|
|
72
|
-
if (!existsSync(srcDir)) {
|
|
73
|
-
console.error(`源目录不存在: ${srcDir}`);
|
|
74
|
-
process.exit(1);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const components = [];
|
|
78
|
-
const items = readdirSync(srcDir);
|
|
79
|
-
|
|
80
|
-
for (const item of items) {
|
|
81
|
-
const itemPath = resolve(srcDir, item);
|
|
82
|
-
if (statSync(itemPath).isDirectory()) {
|
|
83
|
-
const entryFile = resolve(itemPath, "index.ts");
|
|
84
|
-
if (existsSync(entryFile)) {
|
|
85
|
-
components.push(item);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return components;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async function buildComponent(componentName: string) {
|
|
94
|
-
const srcDir = resolve(projectRoot, "src/components");
|
|
95
|
-
const componentDir = resolve(srcDir, componentName);
|
|
96
|
-
const entryFile = resolve(componentDir, "index.ts");
|
|
97
|
-
|
|
98
|
-
// 转换为合法的 JS 标识符
|
|
99
|
-
const legalName = toPascalCase(componentName);
|
|
100
|
-
|
|
101
|
-
// 检查组件目录和入口文件是否存在
|
|
102
|
-
if (!existsSync(componentDir)) {
|
|
103
|
-
console.error(`组件目录不存在: ${componentDir}`);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (!existsSync(entryFile)) {
|
|
108
|
-
console.error(`入口文件不存在: ${entryFile}`);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
await build({
|
|
114
|
-
root: process.cwd(),
|
|
115
|
-
configFile: false,
|
|
116
|
-
plugins: [vue(), vueJsx(), cssInjectedByJsPlugin()],
|
|
117
|
-
build: {
|
|
118
|
-
lib: {
|
|
119
|
-
entry: entryFile,
|
|
120
|
-
name: legalName,
|
|
121
|
-
fileName: (format) => {
|
|
122
|
-
// 为不同格式生成不同的文件名
|
|
123
|
-
const name = format == "iife" ? "index.js" : `index.${format}.js`;
|
|
124
|
-
return name;
|
|
125
|
-
},
|
|
126
|
-
formats: ["es", "umd", "iife", "system", "cjs"], // 使用 ES 格式
|
|
127
|
-
},
|
|
128
|
-
outDir: resolve(process.cwd(), "dist", componentName),
|
|
129
|
-
emptyOutDir: true,
|
|
130
|
-
rollupOptions: {
|
|
131
|
-
external: ["vue"],
|
|
132
|
-
output: {
|
|
133
|
-
globals: {
|
|
134
|
-
vue: "Vue",
|
|
135
|
-
},
|
|
136
|
-
paths: {
|
|
137
|
-
// vue: "https://cdn.jsdelivr.net/npm/vue@3/dist/vue.esm-browser.prod.js", // 可选:指定vue的CDN路径
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
cssCodeSplit: false, // 禁用 CSS 代码分割,将所有 CSS 合并
|
|
142
|
-
cssMinify: true, // 压缩 CSS
|
|
143
|
-
},
|
|
144
|
-
define: {
|
|
145
|
-
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
console.log(`✅ 组件 ${componentName} 构建完成`);
|
|
150
|
-
} catch (error) {
|
|
151
|
-
console.error(`❌ 组件 ${componentName} 构建失败:`, error);
|
|
152
|
-
process.exit(1);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// 获取命令行参数
|
|
157
|
-
const args = process.argv.slice(2);
|
|
158
|
-
|
|
159
|
-
// 处理不同的参数情况
|
|
160
|
-
if (args.length === 0 || (args.length === 1 && args[0] === "--all")) {
|
|
161
|
-
// 批量构建所有组件
|
|
162
|
-
const components = getAllComponents();
|
|
163
|
-
|
|
164
|
-
if (components.length === 0) {
|
|
165
|
-
console.warn("未找到任何组件");
|
|
166
|
-
process.exit(0);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
console.log(`发现 ${components.length} 个组件,开始批量构建...`);
|
|
170
|
-
|
|
171
|
-
for (const component of components) {
|
|
172
|
-
await buildComponent(component);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
console.log("✅ 所有组件构建完成");
|
|
176
|
-
} else if (args.length === 1) {
|
|
177
|
-
// 构建单个组件
|
|
178
|
-
const componentName = args[0];
|
|
179
|
-
await buildComponent(componentName);
|
|
180
|
-
} else {
|
|
181
|
-
console.error("参数错误:请提供组件名称或使用 --all 参数构建所有组件");
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// component-preview.js
|
|
2
|
-
import { createServer } from "vite";
|
|
3
|
-
import { writeFileSync, existsSync } from "fs";
|
|
4
|
-
import path, { resolve } from "path";
|
|
5
|
-
|
|
6
|
-
const componentPath = process.argv[2];
|
|
7
|
-
|
|
8
|
-
if (!componentPath) {
|
|
9
|
-
console.error(
|
|
10
|
-
"请提供组件路径,例如: node script/component-preview.js /hr-test/HelloWorld.vue"
|
|
11
|
-
);
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (!existsSync("./src/components/" + componentPath)) {
|
|
16
|
-
console.error(`组件文件不存在: ${"./src/components/" + componentPath}`);
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 生成临时预览文件
|
|
21
|
-
const previewHtml = `
|
|
22
|
-
<!DOCTYPE html>
|
|
23
|
-
<html lang="en">
|
|
24
|
-
<head>
|
|
25
|
-
<meta charset="UTF-8">
|
|
26
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
27
|
-
<title>Component Preview</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<div id="app"></div>
|
|
31
|
-
<script type="module">
|
|
32
|
-
import { createApp } from 'vue'
|
|
33
|
-
import Component from '${"./src/components/" + componentPath.replace(/\\/g, "/")
|
|
34
|
-
}'
|
|
35
|
-
|
|
36
|
-
createApp(Component, {
|
|
37
|
-
msg: 'Component Preview'
|
|
38
|
-
}).mount('#app')
|
|
39
|
-
</script>
|
|
40
|
-
</body>
|
|
41
|
-
</html>`;
|
|
42
|
-
|
|
43
|
-
writeFileSync("./temp-preview.html", previewHtml);
|
|
44
|
-
|
|
45
|
-
// 启动 Vite 服务器
|
|
46
|
-
const v = import.meta;
|
|
47
|
-
const configFile = path.resolve(v.dirname, '../../') + "/vite.config.ts";
|
|
48
|
-
const server = await createServer({
|
|
49
|
-
configFile,
|
|
50
|
-
root: process.cwd(),
|
|
51
|
-
server: {
|
|
52
|
-
open: "./temp-preview.html",
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
await server.listen(5167);
|
|
57
|
-
server.printUrls();
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
4
|
-
|
|
5
|
-
const copyDirectory = (source: string, destination: string) => {
|
|
6
|
-
// 确保目标目录存在
|
|
7
|
-
fs.mkdirSync(destination, { recursive: true });
|
|
8
|
-
|
|
9
|
-
// 读取源目录内容
|
|
10
|
-
const entries = fs.readdirSync(source, { withFileTypes: true });
|
|
11
|
-
|
|
12
|
-
for (const entry of entries) {
|
|
13
|
-
const srcPath = path.join(source, entry.name);
|
|
14
|
-
const destPath = path.join(destination, entry.name);
|
|
15
|
-
|
|
16
|
-
if (entry.isDirectory()) {
|
|
17
|
-
// 递归复制目录
|
|
18
|
-
copyDirectory(srcPath, destPath);
|
|
19
|
-
} else {
|
|
20
|
-
// 复制文件(使用 COPYFILE_FICLONE_FORCE 标志避免符号链接)
|
|
21
|
-
try {
|
|
22
|
-
fs.copyFileSync(srcPath, destPath, fs.constants.COPYFILE_FICLONE_FORCE);
|
|
23
|
-
} catch (error) {
|
|
24
|
-
// 如果强制复制失败,使用普通复制
|
|
25
|
-
fs.copyFileSync(srcPath, destPath);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const copyNodeModulesSdk = (targetPath: string) => {
|
|
32
|
-
// 定义路径
|
|
33
|
-
const assetsSdkPath = path.resolve(__dirname, `../../assets/${targetPath}`).replace(/\\/g, '/');
|
|
34
|
-
const nodeModulesSdkPath = path.resolve(__dirname, `../../../node_modules/${targetPath}`).replace(/\\/g, '/');
|
|
35
|
-
|
|
36
|
-
// 检查 assets 目录是否存在 SDK 文件
|
|
37
|
-
if (fs.existsSync(assetsSdkPath)) {
|
|
38
|
-
// 如果 assets 目录存在 SDK,则使用它
|
|
39
|
-
return assetsSdkPath;
|
|
40
|
-
} else if (fs.existsSync(nodeModulesSdkPath)) {
|
|
41
|
-
// 如果 assets 目录不存在,但 node_modules 中有,则使用 node_modules 的
|
|
42
|
-
// 同时将文件复制到 assets 目录以便下次使用
|
|
43
|
-
const destAssetsSdkPath = path.resolve(__dirname, `../../assets/${targetPath}`);
|
|
44
|
-
|
|
45
|
-
// 确保目标目录存在
|
|
46
|
-
fs.mkdirSync(path.dirname(destAssetsSdkPath), { recursive: true });
|
|
47
|
-
|
|
48
|
-
// 如果目标目录已存在,先删除
|
|
49
|
-
if (fs.existsSync(destAssetsSdkPath)) {
|
|
50
|
-
fs.rmSync(destAssetsSdkPath, { recursive: true });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 使用自定义复制函数进行递归复制(避免符号链接问题)
|
|
54
|
-
try {
|
|
55
|
-
copyDirectory(nodeModulesSdkPath, destAssetsSdkPath);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error('Failed to copy directory:', error);
|
|
58
|
-
// 如果复制失败,直接返回 node_modules 路径
|
|
59
|
-
return nodeModulesSdkPath;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return destAssetsSdkPath;
|
|
63
|
-
} else {
|
|
64
|
-
throw new Error(`${targetPath} not found in either assets or node_modules`);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export default function setupAmisPlugin() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const amisPath = copyNodeModulesSdk('/amis/sdk');
|
|
74
|
-
// const fontawesome = copyNodeModulesSdk('/@fortawesome/fontawesome-free')
|
|
75
|
-
|
|
76
|
-
// console.log(fontawesome);
|
|
77
|
-
|
|
78
|
-
return viteStaticCopy({
|
|
79
|
-
targets: [
|
|
80
|
-
{
|
|
81
|
-
src: `${amisPath}/[!.]*`,
|
|
82
|
-
dest: 'amis/sdk'
|
|
83
|
-
},
|
|
84
|
-
// {
|
|
85
|
-
// src: `${fontawesome}/[!.]*`,
|
|
86
|
-
// dest: '@fortawesome'
|
|
87
|
-
// }
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import consola from "consola";
|
|
2
|
-
import type { ComponentType } from 'react'; // 引入 React 类型
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// 定义组件项的接口
|
|
6
|
-
interface ComponentItem {
|
|
7
|
-
组件名: string;
|
|
8
|
-
组件包: {
|
|
9
|
-
default: (props: amis.AmisComponentPropsType) => ComponentType<any>;
|
|
10
|
-
isFormItem: boolean;
|
|
11
|
-
};
|
|
12
|
-
组件类型: string;
|
|
13
|
-
注册状态: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 获取所有组件名称列表
|
|
18
|
-
*/
|
|
19
|
-
async function getAllComponents(): Promise<ComponentItem[]> {
|
|
20
|
-
// 使用 import.meta.glob 动态导入 src/components 下的所有组件
|
|
21
|
-
debugger;
|
|
22
|
-
const modules = import.meta.glob<{
|
|
23
|
-
default: (props: amis.AmisComponentPropsType) => ComponentType<any>,
|
|
24
|
-
isFormItem: boolean
|
|
25
|
-
}>('/src/components/*/index.ts');
|
|
26
|
-
consola.info(`找到[${Object.keys(modules).length}]个组件`, '/src/components/*/index.ts');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const components: ComponentItem[] = [];
|
|
30
|
-
for (const path in modules) {
|
|
31
|
-
try {
|
|
32
|
-
const loader = modules[path];
|
|
33
|
-
if (!loader) continue; // 防止 undefined 调用
|
|
34
|
-
const module = await loader();
|
|
35
|
-
// 从路径中提取组件名称
|
|
36
|
-
const componentName = path.match(/\/components\/(.+?)\//)?.[1];
|
|
37
|
-
if (componentName) {
|
|
38
|
-
components.push({
|
|
39
|
-
组件名: componentName,
|
|
40
|
-
组件包: module,
|
|
41
|
-
组件类型: module.isFormItem ? '@FormItem' : '@Renderer',
|
|
42
|
-
注册状态: '未注册'
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
consola.error(`加载组件失败: ${path}`, error);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
consola.info(`找到[${components.length}]个待注册组件`);
|
|
50
|
-
return components;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* 自动注册组件函数 *
|
|
55
|
-
* @param register - 组件注册函数,用于将组件注册到系统中
|
|
56
|
-
* @returns 无返回值的异步函数
|
|
57
|
-
*/
|
|
58
|
-
export const autoRegisterComponent = async (
|
|
59
|
-
register: (
|
|
60
|
-
name: string,
|
|
61
|
-
hook: (props: amis.AmisComponentPropsType) => ComponentType<any>,
|
|
62
|
-
isFormItem?: boolean
|
|
63
|
-
) => any
|
|
64
|
-
) => {
|
|
65
|
-
consola.start('开始自动注册组件....');
|
|
66
|
-
const components = await getAllComponents();
|
|
67
|
-
|
|
68
|
-
// 注册每个组件
|
|
69
|
-
for (let i = 0; i < components.length; i++) {
|
|
70
|
-
const component = components[i];
|
|
71
|
-
if (!component) continue;
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const componentModule = component.组件包;
|
|
75
|
-
|
|
76
|
-
if (componentModule.default) {
|
|
77
|
-
register(component.组件名, componentModule.default, componentModule.isFormItem);
|
|
78
|
-
consola.success(`组件注册 【${component.组件名}】 成功`);
|
|
79
|
-
component.注册状态 = '成功'; // 直接使用已存在的 component 对象
|
|
80
|
-
}
|
|
81
|
-
} catch (error) {
|
|
82
|
-
consola.error(`注册组件失败: ${component.组件名}`, error);
|
|
83
|
-
component.注册状态 = '失败'; // 同样直接赋值
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
console.table(components);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export default autoRegisterComponent;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { RootRenderProps } from 'amis-core/lib/Root';
|
|
2
|
-
import type { FormControlProps, IScopedContext, Schema } from 'amis';
|
|
3
|
-
import type * as vue from 'vue';
|
|
4
|
-
import React, { JSX } from 'react';
|
|
5
|
-
|
|
6
|
-
type PathModule = 'amis' | 'amis/embed' | 'amis-core' | 'react' | 'amis-ui' | 'amis-formula';
|
|
7
|
-
type AmisRequireCallback<T extends string | string[]> = T extends string
|
|
8
|
-
? (arg1: any) => void
|
|
9
|
-
: T extends Array<infer U>
|
|
10
|
-
? U extends string
|
|
11
|
-
? ((...args: any[]) => void) & { length: T['length'] }
|
|
12
|
-
: never
|
|
13
|
-
: never;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
declare global {
|
|
17
|
-
export interface Window {
|
|
18
|
-
amisRequire: <T extends PathModule | PathModule[]>(path: T, callback?: AmisRequireCallback<T>) => any;
|
|
19
|
-
}
|
|
20
|
-
namespace amis {
|
|
21
|
-
type TypeEmbed = {
|
|
22
|
-
updateProps: (props: Partial<RootRenderProps>, callback?: (p: Partial<RootRenderProps>, s: Schema) => void) => void;
|
|
23
|
-
updateSchema: (
|
|
24
|
-
newSchema: Schema,
|
|
25
|
-
props?: Partial<RootRenderProps>,
|
|
26
|
-
callback?: (p: Partial<RootRenderProps>, s: Schema) => void
|
|
27
|
-
) => void;
|
|
28
|
-
unmount: () => void;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type AmisComponentPropsType = {
|
|
32
|
-
/**
|
|
33
|
-
* Vue.es 模块
|
|
34
|
-
*/
|
|
35
|
-
vue: typeof vue;
|
|
36
|
-
/**
|
|
37
|
-
* React.es 模块
|
|
38
|
-
*/
|
|
39
|
-
react: typeof React;
|
|
40
|
-
/**
|
|
41
|
-
* amis 模块
|
|
42
|
-
*/
|
|
43
|
-
amislib: any;
|
|
44
|
-
/**
|
|
45
|
-
* amis-ui 模块
|
|
46
|
-
*/
|
|
47
|
-
amisUI: any;
|
|
48
|
-
/**
|
|
49
|
-
* 当前amis 实例
|
|
50
|
-
*/
|
|
51
|
-
scoped: IScopedContext & TypeEmbed;
|
|
52
|
-
/**
|
|
53
|
-
* 当前语言
|
|
54
|
-
*/
|
|
55
|
-
locale: string;
|
|
56
|
-
/**
|
|
57
|
-
* 当前主题
|
|
58
|
-
*/
|
|
59
|
-
theme: "dark" | "antd" | "cxd" | "ang";
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
type ComponentsFc<T = amis.AmisComponentPropsType> = (_p: T) => (_sp: FormControlProps) => React.ReactElement<React.DOMAttributes<Element>, any> | JSX.Element;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|