@hr-components-dev/render 1.0.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.
@@ -0,0 +1,2 @@
1
+ #amis_root[data-v-0c279816]{border-radius:8px;width:98%;height:calc(100vh - 80px);margin:0 auto}
2
+ /*$vite$:1*/
@@ -0,0 +1,40 @@
1
+ import { IScopedContext, Schema } from 'amis';
2
+ import * as vue from 'vue';
3
+ type Props = {
4
+ /**
5
+ * 渲染的 schema
6
+ */
7
+ schema?: Schema;
8
+ /**
9
+ * 当前页面的数据data
10
+ */
11
+ data?: Record<string, any>;
12
+ /**
13
+ * 全局的 context,可添加数据,函数,通过回调事件调用,用于更新数据
14
+ */
15
+ context?: Record<string, any>;
16
+ /**
17
+ * Amis 运行环境
18
+ */
19
+ env?: {};
20
+ /**
21
+ * 是否开启 AMIS 调试模式
22
+ */
23
+ debug: boolean;
24
+ };
25
+ declare const _default: vue.DefineComponent<Props, {
26
+ refresh: () => Promise<void>;
27
+ updateProps: (params?: any) => void;
28
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
29
+ ready: (scoped: IScopedContext & amis.TypeEmbed) => any;
30
+ doRegister: (register: (name: string, hook: (props: amis.AmisComponentPropsType) => React.ComponentType<any>, isFormItem?: boolean) => any) => any;
31
+ }, string, vue.PublicProps, Readonly<Props> & Readonly<{
32
+ onReady?: ((scoped: IScopedContext & amis.TypeEmbed) => any) | undefined;
33
+ onDoRegister?: ((register: (name: string, hook: (props: amis.AmisComponentPropsType) => React.ComponentType<any>, isFormItem?: boolean) => any) => any) | undefined;
34
+ }>, {
35
+ data: Record<string, any>;
36
+ schema: Schema;
37
+ context: Record<string, any>;
38
+ env: {};
39
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, HTMLDivElement>;
40
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { IScopedContext } from 'amis';
3
+ /**
4
+ * 动态执行给定的作用域表达式,并返回处理后的上下文和数据。
5
+ *
6
+ * @param scope - 要执行的动态表达式字符串。
7
+ * @returns 包含 `context` 和 `data` 的对象。如果 `scope` 为空,则返回空对象。
8
+ */
9
+ export declare const evalFc: (scopeStr: string, instance?: IScopedContext & amis.TypeEmbed) => Promise<{
10
+ data?: Record<string, string | number | boolean | null | undefined>;
11
+ context?: Record<string, any>;
12
+ }>;
13
+ /**
14
+ * 递归转换数组Schema类型的$字符串表达式
15
+ * @param orgobj 含$字符串的Schema表达式的对象
16
+ * @param args Title ,entity,user 参数
17
+ * @returns 计算后的对象
18
+ */
19
+ export declare function ConvertSchemaMarkToJSON<T>(orgobj: Record<string, any>, scope: any): T;
20
+ /**
21
+ * 封装response数据为一个文件下载
22
+ * @param response - Axios 响应对象
23
+ * @returns 如果服务端返回的是一个blob 则返回一个文件下载
24
+ */
25
+ export declare const responeToDownLoad: (response: AxiosResponse<any>) => {
26
+ msg: string;
27
+ status: number;
28
+ data: {};
29
+ };
@@ -0,0 +1,3 @@
1
+ export * from './registerAmisComponent';
2
+ export * from './setupAmisConfig';
3
+ export * from './evalScope';
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * 注册amis 自定义组件
4
+ * @param amislib amisReauire amis库
5
+ * @param react amisReauire react库
6
+ */
7
+ export declare const registerAmisComponent: (p: amis.AmisComponentPropsType) => (name: string, hook: (props: amis.AmisComponentPropsType) => React.ComponentType<any>, isFormItem?: boolean) => any;
8
+ export default registerAmisComponent;
@@ -0,0 +1,2 @@
1
+ /** 设置Amis配置 */
2
+ export declare const setupAmisConfig: () => void;
@@ -0,0 +1,2 @@
1
+ import { default as AmisRenderer } from './amis/components/amis.vue';
2
+ export default AmisRenderer;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vite').UserConfig;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@hr-components-dev/render",
3
+ "version": "1.0.0",
4
+ "description": "Standalone AmisRenderer component for Vue 3",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs.js",
7
+ "module": "./dist/index.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "typings": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.es.js",
14
+ "require": "./dist/index.cjs.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist/",
19
+ "README.md"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "peerDependencies": {
25
+ "vue": "^3.5.32"
26
+ },
27
+ "devDependencies": {
28
+ "@types/lodash": "^4.17.24",
29
+ "@types/node": "^25.5.2",
30
+ "@vitejs/plugin-vue": "^6.0.5",
31
+ "typescript": "~6.0.2",
32
+ "vite": "^8.0.7",
33
+ "vite-plugin-dts": "^4.5.4",
34
+ "vue-tsc": "^3.2.6"
35
+ },
36
+ "dependencies": {
37
+ "@maita/amis-tools": "^0.1.7",
38
+ "@sv-print/hiprint": "^0.3.23",
39
+ "axios": "^1.14.0",
40
+ "consola": "^3.4.2",
41
+ "dayjs": "^1.11.20",
42
+ "lodash": "^4.18.1"
43
+ },
44
+ "scripts": {
45
+ "build": "vue-tsc --project tsconfig.build.json && vite build",
46
+ "update-pkg": "npx npm-check-updates --deep -u"
47
+ }
48
+ }